@xopcai/xopc 0.0.201 → 0.0.202
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-D8Cw0Mve.js → agent-avatar-dicebear-CAjfa48Q.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-ANavi648.js → agents-Cke8EF5Z.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BubrReXg.js → app-management-settings-panel-GNT3iv0V.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BY5Az2p4.js → appearance-settings-BFond2ll.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CFh9MBxc.js → apps-page-B9D-6sJt.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BY8843mB.js → archive-plugin-C6qpchzp.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DG45KScf.js → attachment-load-B4CcSDdV.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-751CeNI3.js → automations-page-BFS3dH43.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-DGIF2ZAv.js → binary-plugins-xYL_41XP.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C1Qktr1g.js → block-editor-nYiJQItv.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CGAWs-TT.js → browser-settings-page-ELV-Y8rz.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DyIRvPaq.js → browser-workflows-page-pT7Hvwwh.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CghUK68J.js → capabilities-settings-panel-Dbx_nPAI.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-XsTfkvUn.js → capability-presets-settings-panel-DHg_JMUz.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-DkoAZZMe.js → channels-settings-DjHOlPq-.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-FBOe9SWC.js → connectors-api-X5ukNasZ.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-e4vekkAu.js → connectors-page-RY-W6CQt.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-expression-Q4QaYjpI.js → cron-expression-DHY0LrLq.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-Dtn7e6TW.js → date-picker-CGm8EH8G.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Br6nPaM6.js → dependency-picker-DDECr6Hj.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DzTM6aH8.js → desktop-pet-BoEIRgm2.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-FDmaty3P.js → desktop-pet-settings-s4kmnf-W.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-X2e8xn8j.js → directory-picker-path-field-DmfFg4Gq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-Dx4MBfga.js → extension-debug-page-DrLEK8GU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bf_FEDhM.js → extension-page-DtyFPtMR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CrOgZxkf.js → extension-settings-page-Xok6T2KD.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-CZ4r-7qT.js → gateway-config-api-DwSpEYiw.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DpWmVi0w.js → gateway-settings-B5Zh2rx9.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DSQZhSvT.js → heartbeat-settings-C2RxqeK0.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-L0uHiu0T.js → home-page-DPhkqxEb.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DRrjYYzZ.js → index-CKSplmFw.js} +12 -12
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Bc3Quw42.js → keyboard-shortcuts-settings-BN3p-1wI.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Copi3sdP.js → local-app-workbench-page-D7FmunJF.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-CP9X_vtz.js → local-apps-page-C7H807zd.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DMKq6e29.js → logs-page-vrjf-JTk.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-CJmcaVje.js → management-settings-CTIaHfgU.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-AcuFp0TH.js → markdown-split-C0iKadAm.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BvFgsiJL.js → media-plugins-DcM72GSJ.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-IW7IQ9nJ.js → notes-page-By_EzRhP.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-Zb8U0anO.js → notes-workbench-Cp1ierS_.js} +2 -2
- package/dist/gateway/static/root/assets/{preview-open-alternatives-C-b34dgQ.js → preview-open-alternatives-CpblfmWk.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CWEzLykF.js → product-open-page-dQ2_5PLu.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BuIbLnan.js → project-detail-page-Cp_jfZJj.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BwUfRqNV.js → projects-page-DYbmweGw.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BTaXxcEi.js → remote-access-hub-U2qXVyLH.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DAohEZrX.js → runtime-tools-settings-panel-DiPj9FLN.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-C_OBW8A5.js → schema-form-BDLYItBP.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BnHoTCD3.js → sessions-page-CtNKNhCi.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B6IMzhWo.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-C7w2WS-A.js → settings-form-section-Dr4Uf_CY.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-zwibve4m.js → settings-loading-skeleton-Bqi7tsXj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B9W03dSW.js → settings-page-BbookgxJ.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-C8Hec2Af.js → setup-status-panel-mUu0iDlD.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-6e3ks2be.js → share-preview-page-1M79esSO.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Bwc5HfLI.js → shares-settings-DadcMA8y.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-D7kunhqy.js → skill-reload-api-C3ZzYCz0.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-WgkaNzpc.js → skills-page-B3kqZ-ke.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-D9QT5cxj.js → skills-page.utils-b9byH-KL.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-c1HVtv1Y.js → system-settings-panel-CL_AXjw1.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-CjP-6WVU.js → task-detail-page-Bnjpkl4v.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-D6UkH_Ga.js → use-autosave-CUI3q_I-.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-D8ZhPDNF.js → user-context-page-CBgAAZiB.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BOxkKbGh.js → voice-api-key-field-DLXOB1jw.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Dd19yK9t.js → work-discovery-overlay-BvlvyVJX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DUkdJl1e.js → work-discovery-page-BBpnnnrs.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-ZA3bP65I.js → workflow-run-setup-panel-DKpUxB-i.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-C2b5W5bw.js → workflows-page-Dd_9p9ji.js} +1 -1
- package/dist/gateway/static/root/index.html +1 -1
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +1 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/oauth-async.d.ts +1 -0
- package/dist/src/gateway/hono/oauth-async.js +14 -2
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/heartbeat/index.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-BTB_fxjt.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,l as o,t as s}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{d as c,f as l,i as u,n as d,p as f,r as p,u as m}from"./popover-select-BzdnTy3h.js";import{t as h}from"./external-link-DjqjBmc3.js";import{t as g}from"./cn-JdwAhgNB.js";import{t as _}from"./button-CSEbl4zT.js";import{o as v,s as y}from"./form-field-width-DJw_jULe.js";import{n as b,t as x}from"./interaction-BmQogeqz.js";import{t as S}from"./messages-D7kOD_o_.js";import{l as C,n as w}from"./locale-store-CnamlR07.js";import{i as T}from"./theme-store-BDyUTObE.js";import{i as E,o as D,s as O}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{a as k,i as A,n as j,o as M,r as N,s as P,t as F}from"./dist-BPoKqzeH.js";import{i as I}from"./vendor-swr-BIWyz7Rc.js";import{r as L}from"./gateway-config-swr-Cv2ywpdb.js";import{a as R,i as z,n as B,o as V,r as ee,t as te}from"./dist-DY4Af0fY.js";import{$c as ne,$i as re,An as ie,As as H,Bn as U,Dc as W,Fn as G,Hn as K,Ht as ae,In as oe,Jc as se,Jl as ce,Ll as le,Ln as ue,Lo as de,Ls as fe,Mn as pe,Na as q,Nl as me,Nn as he,Ns as ge,O as _e,Pl as ve,Pn as ye,Q as be,Qi as xe,Rn as Se,Ss as Ce,Ta as we,Ua as J,Uc as Te,Un as Ee,Ut as De,Vn as Oe,Vs as ke,Wa as Ae,Wl as je,Wn as Me,Ws as Ne,X as Pe,Xo as Fe,Xs as Ie,Yo as Le,aa as Re,as as ze,bc as Y,bs as Be,cs as Ve,ea as He,i as Ue,ia as We,is as Ge,jn as Ke,k as qe,kn as Je,ls as Ye,na as Xe,oa as Ze,r as Qe,ra as X,ta as $e,tl as et,ts as tt,uc as nt,wi as rt,ws as it,xc as at,xi as ot,zl as st,zn as ct,zo as lt}from"./index-DRrjYYzZ.js";import{t as ut}from"./markdown-editor-TWGaF7Xa.js";import{n as dt,r as ft}from"./settings-page-layout-BRQNel6r.js";import{r as pt,t as mt}from"./settings-loading-skeleton-zwibve4m.js";import{n as ht,t as gt}from"./use-autosave-D6UkH_Ga.js";import{n as _t,t as vt}from"./settings-form-section-C7w2WS-A.js";import{t as yt}from"./page-tabs-BaEQMYm_.js";import{n as bt}from"./agent-avatar-dicebear-D8Cw0Mve.js";import{c as xt,i as St,s as Ct}from"./capability-presets-api--tz0mGLY.js";import{a as wt,i as Tt,n as Et,o as Dt,s as Ot,t as kt}from"./typed-models-lib-q5-Vfqd8.js";import{n as At,r as jt,t as Mt}from"./channel-recipient-api-CkOKF9nc.js";import{t as Nt}from"./directory-picker-path-field-X2e8xn8j.js";var Z=n(),Q=r();function Pt(e){let t=(0,Z.c)(40),{open:n,onOpenChange:r,busy:i,deletePurge:a,deleteTarget:o,deleteConfirmText:s,onDeleteConfirmTextChange:c,onConfirm:l,onCancel:u,a:d}=e,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(k,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[0]=f):f=t[0];let p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p=g(`fixed left-1/2 top-1/2 z-[81] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-4 shadow-popover`,`dark:border-edge`),t[1]=p):p=t[1];let m=a?d.purgeDisk:d.removeFromConfig,h;t[2]===m?h=t[3]:(h=(0,Q.jsx)(P,{className:`text-base font-semibold text-fg`,children:m}),t[2]=m,t[3]=h);let v=a?d.confirmDeletePurge:d.confirmDelete,y;t[4]===v?y=t[5]:(y=(0,Q.jsx)(A,{className:`mt-2 whitespace-pre-wrap text-sm leading-relaxed text-fg-muted`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==d.purgeConfirmHint||t[7]!==d.purgeConfirmLabel||t[8]!==d.purgeConfirmPlaceholder||t[9]!==s||t[10]!==a||t[11]!==o||t[12]!==c?(b=a&&o?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-fg`,htmlFor:`agent-delete-confirm`,children:d.purgeConfirmLabel}),(0,Q.jsx)(`input`,{id:`agent-delete-confirm`,type:`text`,autoComplete:`off`,spellCheck:!1,className:g(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:d.purgeConfirmPlaceholder.replace(`{{agentId}}`,o.id),value:s,onChange:e=>c(e.target.value)}),(0,Q.jsx)(`p`,{className:`pt-0.5 text-xs text-fg-muted`,children:d.purgeConfirmHint.replace(`{{agentId}}`,o.id)})]}):null,t[6]=d.purgeConfirmHint,t[7]=d.purgeConfirmLabel,t[8]=d.purgeConfirmPlaceholder,t[9]=s,t[10]=a,t[11]=o,t[12]=c,t[13]=b):b=t[13];let x;t[14]!==d.createModalCancel||t[15]!==i||t[16]!==u?(x=(0,Q.jsx)(_,{type:`button`,variant:`ghost`,disabled:i,onClick:u,children:d.createModalCancel}),t[14]=d.createModalCancel,t[15]=i,t[16]=u,t[17]=x):x=t[17];let S=a?`border-red-200 text-red-700 hover:bg-red-50 dark:border-red-900/60 dark:text-red-300 dark:hover:bg-red-950/40`:void 0,C;t[18]!==i||t[19]!==s||t[20]!==a||t[21]!==o?(C=i||!o||a&&s.trim().toLowerCase()!==o.id.toLowerCase(),t[18]=i,t[19]=s,t[20]=a,t[21]=o,t[22]=C):C=t[22];let w=a?d.purgeDisk:d.removeFromConfig,T;t[23]!==l||t[24]!==C||t[25]!==w||t[26]!==S?(T=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:S,disabled:C,onClick:l,children:w}),t[23]=l,t[24]=C,t[25]=w,t[26]=S,t[27]=T):T=t[27];let E;t[28]!==T||t[29]!==x?(E=(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-end gap-2 border-t border-edge-subtle/60 pt-3`,children:[x,T]}),t[28]=T,t[29]=x,t[30]=E):E=t[30];let D;t[31]!==E||t[32]!==h||t[33]!==y||t[34]!==b?(D=(0,Q.jsxs)(M,{children:[f,(0,Q.jsxs)(N,{className:p,onOpenAutoFocus:Ft,children:[h,y,b,E]})]}),t[31]=E,t[32]=h,t[33]=y,t[34]=b,t[35]=D):D=t[35];let O;return t[36]!==r||t[37]!==n||t[38]!==D?(O=(0,Q.jsx)(F,{open:n,onOpenChange:r,children:D}),t[36]=r,t[37]=n,t[38]=D,t[39]=O):O=t[39],O}function Ft(e){return e.preventDefault()}var $=e(t(),1),It=[{id:`overview`,labelKey:`navOverview`,icon:Te},{id:`profile`,labelKey:`navProfile`,icon:Ce},{id:`capabilities`,labelKey:`navCapabilities`,icon:le},{id:`runtime`,labelKey:`navRuntime`,icon:H},{id:`connections`,labelKey:`navConnections`,icon:me},{id:`advanced`,labelKey:`navAdvanced`,icon:it},{id:`dangerZone`,labelKey:`navDangerZone`,icon:Ve}];function Lt(e){let t=(0,Z.c)(11),{a:n,panel:r,onPanelChange:i}=e,a;t[0]!==i||t[1]!==r?(a=(e,t,n)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>i(e),className:g(`flex w-auto shrink-0 items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm font-medium transition-colors sm:w-full`,b.press,r===e?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,Q.jsx)(n,{className:`size-4 shrink-0 opacity-90`,strokeWidth:2,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:t})]},e),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=a,s=n.editorNavAria,c;t[3]!==n||t[4]!==o?(c=It.map(e=>{let{id:t,labelKey:r,icon:i}=e;return o(t,n[r],i)}),t[3]=n,t[4]=o,t[5]=c):c=t[5];let l;t[6]===c?l=t[7]:(l=(0,Q.jsx)(`div`,{className:`flex gap-1 pb-1 sm:flex-col sm:gap-0.5 sm:pb-0`,children:c}),t[6]=c,t[7]=l);let u;return t[8]!==n.editorNavAria||t[9]!==l?(u=(0,Q.jsx)(`nav`,{className:`w-full overflow-x-auto sm:overflow-visible`,"aria-label":s,children:l}),t[8]=n.editorNavAria,t[9]=l,t[10]=u):u=t[10],u}function Rt(e){let t=(0,Z.c)(33),{open:n,onOpenChange:r,a:i,title:a,subtitle:o,panel:s,onPanelChange:c,children:l}=e,[d,f]=(0,$.useState)(null),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(k,{className:g(`xopc-dialog-overlay fixed inset-0 bg-scrim`,D)}),t[0]=p):p=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=g(`xopc-dialog-content fixed flex flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-popover dark:border-edge`,E,`inset-4 h-[calc(100dvh-2rem)] max-h-[calc(100dvh-2rem)] min-h-0`,`sm:inset-auto sm:left-1/2 sm:top-1/2 sm:h-[min(88vh,48rem)] sm:max-h-[min(88vh,48rem)] sm:min-h-[32rem] sm:w-[min(100%-2rem,58rem)] sm:-translate-x-1/2 sm:-translate-y-1/2`),t[1]=m):m=t[1];let h;t[2]===a?h=t[3]:(h=(0,Q.jsx)(P,{className:`text-base font-semibold leading-snug text-fg`,children:a}),t[2]=a,t[3]=h);let _;t[4]===o?_=t[5]:(_=(0,Q.jsx)(A,{className:`mt-1 font-mono text-xs text-fg-muted`,children:o}),t[4]=o,t[5]=_);let v;t[6]!==h||t[7]!==_?(v=(0,Q.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[h,_]}),t[6]=h,t[7]=_,t[8]=v):v=t[8];let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=g(x,`shrink-0 p-1.5 hover:bg-surface-base`),t[9]=y):y=t[9];let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(Le,{className:`size-4`,"aria-hidden":!0}),t[10]=b):b=t[10];let S;t[11]===i.closeDialogAria?S=t[12]:(S=(0,Q.jsx)(j,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:y,"aria-label":i.closeDialogAria,children:b})}),t[11]=i.closeDialogAria,t[12]=S);let C;t[13]!==v||t[14]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-2 border-b border-edge-subtle px-4 pb-3 pt-4 dark:border-edge`,children:[v,S]}),t[13]=v,t[14]=S,t[15]=C):C=t[15];let w;t[16]!==i||t[17]!==c||t[18]!==s?(w=(0,Q.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle px-4 py-3 dark:border-edge sm:flex sm:w-56 sm:shrink-0 sm:flex-col sm:overflow-y-auto sm:border-b-0 sm:border-r sm:px-0 sm:py-4 sm:pl-4 sm:pr-3`,children:(0,Q.jsx)(Lt,{a:i,panel:s,onPanelChange:c})}),t[16]=i,t[17]=c,t[18]=s,t[19]=w):w=t[19];let T;t[20]===l?T=t[21]:(T=(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden p-4 sm:pl-2 sm:pr-5`,children:l})}),t[20]=l,t[21]=T);let O;t[22]!==T||t[23]!==w?(O=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col sm:flex-row sm:overflow-hidden`,children:[w,T]}),t[22]=T,t[23]=w,t[24]=O):O=t[24];let I;t[25]!==d||t[26]!==O||t[27]!==C?(I=(0,Q.jsxs)(M,{children:[p,(0,Q.jsx)(N,{ref:f,className:m,onOpenAutoFocus:zt,children:(0,Q.jsxs)(u,{layer:`modal`,portalContainer:d,children:[C,O]})})]}),t[25]=d,t[26]=O,t[27]=C,t[28]=I):I=t[28];let L;return t[29]!==r||t[30]!==n||t[31]!==I?(L=(0,Q.jsx)(F,{open:n,onOpenChange:r,children:I}),t[29]=r,t[30]=n,t[31]=I,t[32]=L):L=t[32],L}function zt(e){return e.preventDefault()}function Bt(e){let t=(0,Z.c)(28),{label:n,mode:r,value:i,inheritedFrom:a,inheritLabel:o,overrideLabel:s,onClick:c}=e,l;t[0]===n?l=t[1]:(l=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:n}),t[0]=n,t[1]=l);let u=i||`—`,d;t[2]===u?d=t[3]:(d=(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm font-medium text-fg`,children:u}),t[2]=u,t[3]=d);let f;t[4]!==a||t[5]!==r?(f=r===`inherit`&&a?(0,Q.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-fg-muted`,children:a}):null,t[4]=a,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==l||t[8]!==d||t[9]!==f?(p=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[l,d,f]}),t[7]=l,t[8]=d,t[9]=f,t[10]=p):p=t[10];let m=r===`inherit`?`bg-surface-hover text-fg-muted`:`bg-accent-soft text-accent-fg`,h;t[11]===m?h=t[12]:(h=g(`mt-2 inline-flex shrink-0 self-start rounded-full px-2.5 py-0.5 text-xs font-medium sm:mt-0`,m),t[11]=m,t[12]=h);let _=r===`inherit`?o:s,v;t[13]!==h||t[14]!==_?(v=(0,Q.jsx)(`span`,{className:h,children:_}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==p||t[17]!==v?(y=(0,Q.jsxs)(Q.Fragment,{children:[p,v]}),t[16]=p,t[17]=v,t[18]=y):y=t[18];let b=y,x=c?`w-full text-left transition-colors hover:bg-surface-hover/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40 active:scale-[0.995] motion-reduce:active:scale-100`:void 0,S;t[19]===x?S=t[20]:(S=g(`flex flex-col gap-1 rounded-xl bg-surface-panel/80 px-4 py-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,x),t[19]=x,t[20]=S);let C=S;if(c){let e;return t[21]!==C||t[22]!==b||t[23]!==c?(e=(0,Q.jsx)(`button`,{type:`button`,className:C,onClick:c,children:b}),t[21]=C,t[22]=b,t[23]=c,t[24]=e):e=t[24],e}let w;return t[25]!==C||t[26]!==b?(w=(0,Q.jsx)(`div`,{className:C,children:b}),t[25]=C,t[26]=b,t[27]=w):w=t[27],w}function Vt(e){let t=(0,Z.c)(38),{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditModelStrategy:s,onEditWorkspace:c}=e,l=n.inheritance,u;t[0]===a?u=t[1]:(u=a.trim(),t[0]=a,t[1]=u);let d=!u,f;t[2]!==o||t[3]!==i?(f=!o.trim()||i.trim().length>0&&o.trim()===i.trim(),t[2]=o,t[3]=i,t[4]=f):f=t[4];let p=f,m=d?r||l.unset:a,h=p?i||l.unset:o,g;t[5]!==l.subtitle||t[6]!==l.title?(g=(0,Q.jsx)(_t,{icon:at,title:l.title,subtitle:l.subtitle}),t[5]=l.subtitle,t[6]=l.title,t[7]=g):g=t[7];let _=d?`inherit`:`override`,v;t[8]!==r||t[9]!==l.inheritsValue||t[10]!==d?(v=d&&r?l.inheritsValue.replace(`{{value}}`,r):void 0,t[8]=r,t[9]=l.inheritsValue,t[10]=d,t[11]=v):v=t[11];let y;t[12]!==m||t[13]!==l.badgeInherit||t[14]!==l.badgeOverride||t[15]!==l.modelLabel||t[16]!==s||t[17]!==_||t[18]!==v?(y=(0,Q.jsx)(Bt,{label:l.modelLabel,mode:_,value:m,inheritedFrom:v,inheritLabel:l.badgeInherit,overrideLabel:l.badgeOverride,onClick:s}),t[12]=m,t[13]=l.badgeInherit,t[14]=l.badgeOverride,t[15]=l.modelLabel,t[16]=s,t[17]=_,t[18]=v,t[19]=y):y=t[19];let b=p?`inherit`:`override`,x;t[20]!==i||t[21]!==l.inheritsValue||t[22]!==p?(x=p&&i?l.inheritsValue.replace(`{{value}}`,i):void 0,t[20]=i,t[21]=l.inheritsValue,t[22]=p,t[23]=x):x=t[23];let S;t[24]!==h||t[25]!==l.badgeInherit||t[26]!==l.badgeOverride||t[27]!==l.workspaceLabel||t[28]!==c||t[29]!==b||t[30]!==x?(S=(0,Q.jsx)(Bt,{label:l.workspaceLabel,mode:b,value:h,inheritedFrom:x,inheritLabel:l.badgeInherit,overrideLabel:l.badgeOverride,onClick:c}),t[24]=h,t[25]=l.badgeInherit,t[26]=l.badgeOverride,t[27]=l.workspaceLabel,t[28]=c,t[29]=b,t[30]=x,t[31]=S):S=t[31];let C;t[32]!==y||t[33]!==S?(C=(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[y,S]}),t[32]=y,t[33]=S,t[34]=C):C=t[34];let w;return t[35]!==g||t[36]!==C?(w=(0,Q.jsxs)(vt,{children:[g,C]}),t[35]=g,t[36]=C,t[37]=w):w=t[37],w}function Ht(e,t){for(let n of t){let t=e[n];if(t)return t}return`default`}function Ut(e){let t=(0,Z.c)(5),{source:n}=e,r;if(t[0]!==n){let e=n.startsWith(`preset:`),i=n.startsWith(`agent:`);r=g(`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium`,e&&`bg-accent/10 text-accent`,i&&`bg-surface-base text-fg-muted`,!e&&!i&&`bg-surface-panel text-fg-subtle`),t[0]=n,t[1]=r}else r=t[1];let i;return t[2]!==n||t[3]!==r?(i=(0,Q.jsx)(`span`,{className:r,children:n}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}function Wt(e){let t=(0,Z.c)(13),n;t[0]===e.name?n=t[1]:(n=(0,Q.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs font-medium text-fg`,children:e.name}),t[0]=e.name,t[1]=n);let r=e.monoValue&&`font-mono text-xs`,i;t[2]===r?i=t[3]:(i=g(`min-w-0 truncate text-sm text-fg`,r),t[2]=r,t[3]=i);let a;t[4]!==e.value||t[5]!==i?(a=(0,Q.jsx)(`div`,{className:i,children:e.value}),t[4]=e.value,t[5]=i,t[6]=a):a=t[6];let o;t[7]===e.source?o=t[8]:(o=(0,Q.jsx)(Ut,{source:e.source}),t[7]=e.source,t[8]=o);let s;return t[9]!==n||t[10]!==a||t[11]!==o?(s=(0,Q.jsxs)(`div`,{className:`grid gap-2 rounded-lg bg-surface-panel/80 px-3 py-2 shadow-surface sm:grid-cols-[minmax(0,10rem)_minmax(0,1fr)_auto] sm:items-center`,children:[n,a,o]}),t[9]=n,t[10]=a,t[11]=o,t[12]=s):s=t[12],s}function Gt(e,t){return e&&e.length>0?e.join(`, `):t}function Kt(e){let t=(0,Z.c)(39),{a:n,selected:r}=e,i;t[0]===r.id?i=t[1]:(i=r.id?[`agent-effective-manifest`,r.id]:null,t[0]=r.id,t[1]=i);let a;t[2]===r.id?a=t[3]:(a=()=>oe(r.id),t[2]=r.id,t[3]=a);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[4]=o):o=t[4];let{data:s,error:c,isLoading:l}=I(i,a,o),u=s?.manifest,d;t[5]!==s?.presetChain||t[6]!==u?.extends?(d=s?.presetChain??u?.extends??[],t[5]=s?.presetChain,t[6]=u?.extends,t[7]=d):d=t[7];let f=d,p;if(t[8]!==n.effectiveBoundariesTitle||t[9]!==n.effectiveEmpty||t[10]!==n.effectiveError||t[11]!==n.effectiveHint||t[12]!==n.effectiveLoading||t[13]!==n.effectiveLocksTitle||t[14]!==n.effectiveModelsTitle||t[15]!==n.effectiveNoLocks||t[16]!==n.effectiveNoOverrides||t[17]!==n.effectiveNoPresets||t[18]!==n.effectiveNoToolPolicies||t[19]!==n.effectiveOverridesTitle||t[20]!==n.effectivePresetChain||t[21]!==n.effectiveSkillsTitle||t[22]!==n.effectiveTitle||t[23]!==n.effectiveToolsTitle||t[24]!==s?.locks||t[25]!==s?.overrides||t[26]!==s?.sources||t[27]!==c||t[28]!==l||t[29]!==u||t[30]!==f){let e=s?.sources??{},r=Object.entries(u?.models?.roles??{}).sort(Xt),i=Object.entries(u?.tools?.builtin??{}).sort(Yt),a=u?.skills,o=u?.boundaries,d;t[32]===s?.overrides?d=t[33]:(d=s?.overrides??[],t[32]=s?.overrides,t[33]=d);let m=d,h;t[34]===s?.locks?h=t[35]:(h=s?.locks??[],t[34]=s?.locks,t[35]=h);let g=h,_;t[36]!==n.effectiveHint||t[37]!==n.effectiveTitle?(_=(0,Q.jsx)(_t,{icon:Y,title:n.effectiveTitle,subtitle:n.effectiveHint}),t[36]=n.effectiveHint,t[37]=n.effectiveTitle,t[38]=_):_=t[38],p=(0,Q.jsxs)(vt,{children:[_,l?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.effectiveLoading}):c?(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:c instanceof Error?c.message:n.effectiveError}):u?(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectivePresetChain}),(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-panel/80 px-3 py-2 text-sm text-fg shadow-surface`,children:f.length?f.join(` -> `):n.effectiveNoPresets})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveOverridesTitle}),m.length>0?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:m.map(Jt)}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoOverrides})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveLocksTitle}),g.length>0?(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.map(qt)}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoLocks})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveModelsTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`defaultRole`,value:u.models?.defaultRole??`—`,source:Ht(e,[`models.defaultRole`])}),r.map(t=>{let[n,r]=t;return(0,Q.jsx)(Wt,{name:n,value:r.model,monoValue:!0,source:Ht(e,[`models.roles.${n}.model`,`models.roles.${n}`])},n)})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveToolsTitle}),i.length>0?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:i.map(t=>{let[n,r]=t;return(0,Q.jsx)(Wt,{name:n,value:r.mode,source:Ht(e,[`tools.builtin.${n}.mode`,`tools.builtin.${n}`])},n)})}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoToolPolicies})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveSkillsTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`mode`,value:a?.mode??`all`,source:Ht(e,[`skills.mode`,`skills`])}),a?.mode===`allowlist`?(0,Q.jsx)(Wt,{name:`allow`,value:Gt(a.allow,`—`),source:Ht(e,[`skills.allow`,`skills`])}):null,a?.mode===`denylist`?(0,Q.jsx)(Wt,{name:`deny`,value:Gt(a.deny,`—`),source:Ht(e,[`skills.deny`,`skills`])}):null]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveBoundariesTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`requiresConfirmation`,value:Gt(o?.requiresConfirmation,`—`),source:Ht(e,[`boundaries.requiresConfirmation`,`boundaries`])}),(0,Q.jsx)(Wt,{name:`forbidden`,value:Gt(o?.forbidden,`—`),source:Ht(e,[`boundaries.forbidden`,`boundaries`])}),(0,Q.jsx)(Wt,{name:`escalation`,value:Gt(o?.escalation,`—`),source:Ht(e,[`boundaries.escalation`,`boundaries`])})]})]})]})}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.effectiveEmpty})]}),t[8]=n.effectiveBoundariesTitle,t[9]=n.effectiveEmpty,t[10]=n.effectiveError,t[11]=n.effectiveHint,t[12]=n.effectiveLoading,t[13]=n.effectiveLocksTitle,t[14]=n.effectiveModelsTitle,t[15]=n.effectiveNoLocks,t[16]=n.effectiveNoOverrides,t[17]=n.effectiveNoPresets,t[18]=n.effectiveNoToolPolicies,t[19]=n.effectiveOverridesTitle,t[20]=n.effectivePresetChain,t[21]=n.effectiveSkillsTitle,t[22]=n.effectiveTitle,t[23]=n.effectiveToolsTitle,t[24]=s?.locks,t[25]=s?.overrides,t[26]=s?.sources,t[27]=c,t[28]=l,t[29]=u,t[30]=f,t[31]=p}else p=t[31];return p}function qt(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 font-mono text-xs text-fg-muted shadow-surface`,children:e},e)}function Jt(e,t){return(0,Q.jsxs)(`div`,{className:`grid gap-1 rounded-lg bg-surface-panel/80 px-3 py-2 text-xs shadow-surface sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] sm:items-center`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`truncate font-mono font-medium text-fg`,children:e.path}),(0,Q.jsx)(`div`,{className:`mt-1 truncate text-fg-muted`,children:e.from})]}),(0,Q.jsx)(`span`,{className:`text-fg-subtle`,"aria-hidden":!0,children:`→`}),(0,Q.jsx)(`div`,{className:`truncate text-fg-muted sm:text-right`,children:e.to})]},`${e.path}-${e.from}-${e.to}-${t}`)}function Yt(e,t){let[n]=e,[r]=t;return n.localeCompare(r)}function Xt(e,t){let[n]=e,[r]=t;return n.localeCompare(r)}function Zt(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1`,children:(0,Q.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-5 pb-6`,children:n})}),t[0]=n,t[1]=r),r}function Qt(e){let t=(0,Z.c)(4),{active:n,children:r,onClick:i}=e,a=n?`rounded-md bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg`:`rounded-md px-3 py-1.5 text-sm font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,Q.jsx)(`button`,{type:`button`,onClick:i,className:a,children:r}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function $t(e){let t=(0,Z.c)(41),{a:n,selected:r,busy:i,defaultModel:a,defaultWorkspace:o,agentModel:s,agentWorkspace:c,capabilityPresets:l,defaultPresetId:u,onUpdateAgentExtends:d,onOpenCapabilityPreset:f}=e,[p,m]=(0,$.useState)(`sources`),h=p===`sources`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>m(`sources`),t[0]=g):g=t[0];let _;t[1]!==n.configSubtabSources||t[2]!==h?(_=(0,Q.jsx)(Qt,{active:h,onClick:g,children:n.configSubtabSources}),t[1]=n.configSubtabSources,t[2]=h,t[3]=_):_=t[3];let v=p===`shared`,y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(`shared`),t[4]=y):y=t[4];let b;t[5]!==n.configSubtabShared||t[6]!==v?(b=(0,Q.jsx)(Qt,{active:v,onClick:y,children:n.configSubtabShared}),t[5]=n.configSubtabShared,t[6]=v,t[7]=b):b=t[7];let x=p===`effective`,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>m(`effective`),t[8]=S):S=t[8];let C;t[9]!==n.configSubtabEffective||t[10]!==x?(C=(0,Q.jsx)(Qt,{active:x,onClick:S,children:n.configSubtabEffective}),t[9]=n.configSubtabEffective,t[10]=x,t[11]=C):C=t[11];let w;t[12]!==_||t[13]!==b||t[14]!==C?(w=(0,Q.jsx)(`div`,{className:`shrink-0 rounded-lg border border-edge bg-surface-panel p-1`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[_,b,C]})}),t[12]=_,t[13]=b,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==a||t[20]!==o||t[21]!==p?(T=p===`sources`?(0,Q.jsx)(en,{a:n,defaultModel:a,defaultWorkspace:o,agentModel:s,agentWorkspace:c}):null,t[16]=n,t[17]=s,t[18]=c,t[19]=a,t[20]=o,t[21]=p,t[22]=T):T=t[22];let E;t[23]!==n||t[24]!==i||t[25]!==l||t[26]!==u||t[27]!==f||t[28]!==d||t[29]!==r||t[30]!==p?(E=p===`shared`?(0,Q.jsx)(tn,{a:n,selected:r,busy:i,capabilityPresets:l,defaultPresetId:u,onUpdateAgentExtends:d,onOpenCapabilityPreset:f}):null,t[23]=n,t[24]=i,t[25]=l,t[26]=u,t[27]=f,t[28]=d,t[29]=r,t[30]=p,t[31]=E):E=t[31];let D;t[32]!==n||t[33]!==r||t[34]!==p?(D=p===`effective`?(0,Q.jsx)(an,{a:n,selected:r}):null,t[32]=n,t[33]=r,t[34]=p,t[35]=D):D=t[35];let O;return t[36]!==w||t[37]!==T||t[38]!==E||t[39]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[w,T,E,D]}),t[36]=w,t[37]=T,t[38]=E,t[39]=D,t[40]=O):O=t[40],O}function en(e){let t=(0,Z.c)(7),{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditWorkspace:s}=e,c;return t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==r||t[4]!==i||t[5]!==s?(c=(0,Q.jsx)(Zt,{children:(0,Q.jsx)(Vt,{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditWorkspace:s})}),t[0]=n,t[1]=a,t[2]=o,t[3]=r,t[4]=i,t[5]=s,t[6]=c):c=t[6],c}function tn(e){let t=(0,Z.c)(72),{a:n,selected:r,busy:i,capabilityPresets:a,defaultPresetId:o,onUpdateAgentExtends:s,onOpenCapabilityPreset:c}=e,l=o===void 0?`default`:o,u;t[0]===a?u=t[1]:(u=new Map(a.map(rn)),t[0]=a,t[1]=u);let f=u,m;t[2]!==n.capabilityPresetsGlobalDefault||t[3]!==n.capabilityPresetsGlobalDefaultHint||t[4]!==l||t[5]!==f?(m=f.get(l)??{id:l,name:n.capabilityPresetsGlobalDefault,description:n.capabilityPresetsGlobalDefaultHint},t[2]=n.capabilityPresetsGlobalDefault,t[3]=n.capabilityPresetsGlobalDefaultHint,t[4]=l,t[5]=f,t[6]=m):m=t[6];let g=m,v,y,b,x,S;if(t[7]!==n.capabilityPresetAdd||t[8]!==n.capabilityPresetMoveDown||t[9]!==n.capabilityPresetMoveUp||t[10]!==n.capabilityPresetRemove||t[11]!==n.capabilityPresetsEmptyAdditional||t[12]!==n.capabilityPresetsGlobalDefault||t[13]!==n.capabilityPresetsGlobalDefaultHint||t[14]!==n.capabilityPresetsHint||t[15]!==n.capabilityPresetsManage||t[16]!==n.capabilityPresetsTitle||t[17]!==i||t[18]!==a||t[19]!==l||t[20]!==g.description||t[21]!==g.id||t[22]!==g.name||t[23]!==c||t[24]!==s||t[25]!==f||t[26]!==r.extends){let e;t[32]===l?e=t[33]:(e=e=>e!==l,t[32]=l,t[33]=e);let o=r.extends.filter(e),u=a.map(nn).filter(e=>e!==l&&!o.includes(e)),m=u[0]??``;y=Zt,v=vt;let C;t[34]===c?C=t[35]:(C=()=>c(``),t[34]=c,t[35]=C);let w;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(h,{className:`size-3.5`,"aria-hidden":!0}),t[36]=w):w=t[36];let T;t[37]!==n.capabilityPresetsManage||t[38]!==i||t[39]!==C?(T=(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,className:`text-xs`,disabled:i,onClick:C,children:[w,n.capabilityPresetsManage]}),t[37]=n.capabilityPresetsManage,t[38]=i,t[39]=C,t[40]=T):T=t[40],t[41]!==n.capabilityPresetsHint||t[42]!==n.capabilityPresetsTitle||t[43]!==T?(b=(0,Q.jsx)(_t,{icon:Ce,title:n.capabilityPresetsTitle,subtitle:n.capabilityPresetsHint,trailing:T}),t[41]=n.capabilityPresetsHint,t[42]=n.capabilityPresetsTitle,t[43]=T,t[44]=b):b=t[44];let E;t[45]!==g.id||t[46]!==c?(E=()=>c(g.id),t[45]=g.id,t[46]=c,t[47]=E):E=t[47];let D=g.name||n.capabilityPresetsGlobalDefault,O;t[48]===D?O=t[49]:(O=(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:D}),t[48]=D,t[49]=O);let k;t[50]===n.capabilityPresetsGlobalDefault?k=t[51]:(k=(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent`,children:n.capabilityPresetsGlobalDefault}),t[50]=n.capabilityPresetsGlobalDefault,t[51]=k);let A;t[52]!==O||t[53]!==k?(A=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[O,k]}),t[52]=O,t[53]=k,t[54]=A):A=t[54];let j;t[55]===g.id?j=t[56]:(j=(0,Q.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-fg-muted`,children:g.id}),t[55]=g.id,t[56]=j);let M=g.description||n.capabilityPresetsGlobalDefaultHint,N;t[57]===M?N=t[58]:(N=(0,Q.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:M}),t[57]=M,t[58]=N);let P;t[59]!==E||t[60]!==A||t[61]!==j||t[62]!==N?(P=(0,Q.jsx)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-accent-soft/20 px-3 py-2 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`min-w-0 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:E,children:[A,j,N]})}),t[59]=E,t[60]=A,t[61]=j,t[62]=N,t[63]=P):P=t[63],x=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[P,o.length>0?o.map((e,t)=>{let r=f.get(e);return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-surface-panel/80 px-3 py-2 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`min-w-0 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>c(e),children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:r?.name??e}),(0,Q.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-fg-muted`,children:e}),r?.description?(0,Q.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:r.description}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-1.5`,children:[(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i||t===0,"aria-label":n.capabilityPresetMoveUp,onClick:()=>{let e=[...o],[n,r]=[e[t],e[t-1]];e[t-1]=n,e[t]=r,s(e)},children:(0,Q.jsx)(je,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i||t===o.length-1,"aria-label":n.capabilityPresetMoveDown,onClick:()=>{let e=[...o],[n,r]=[e[t+1],e[t]];e[t]=n,e[t+1]=r,s(e)},children:(0,Q.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i,"aria-label":n.capabilityPresetRemove,onClick:()=>s(o.filter(t=>t!==e)),children:(0,Q.jsx)(Ye,{className:`size-3.5`,"aria-hidden":!0})})]})]},e)}):(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-panel/60 p-3 text-sm text-fg-muted shadow-surface`,children:n.capabilityPresetsEmptyAdditional})]}),S=u.length>0?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,Q.jsx)(d,{className:`min-w-0 flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:border-edge-strong focus:outline-none`,disabled:i,defaultValue:m,children:u.map(e=>(0,Q.jsx)(p,{value:e,children:f.get(e)?.name??e},e))}),(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,disabled:i||!m,onClick:e=>{let t=e.currentTarget.parentElement?.querySelector(`select`)?.value||m;t&&s([...o,t])},children:[(0,Q.jsx)(Ne,{className:`size-4`,"aria-hidden":!0}),n.capabilityPresetAdd]})]}):null,t[7]=n.capabilityPresetAdd,t[8]=n.capabilityPresetMoveDown,t[9]=n.capabilityPresetMoveUp,t[10]=n.capabilityPresetRemove,t[11]=n.capabilityPresetsEmptyAdditional,t[12]=n.capabilityPresetsGlobalDefault,t[13]=n.capabilityPresetsGlobalDefaultHint,t[14]=n.capabilityPresetsHint,t[15]=n.capabilityPresetsManage,t[16]=n.capabilityPresetsTitle,t[17]=i,t[18]=a,t[19]=l,t[20]=g.description,t[21]=g.id,t[22]=g.name,t[23]=c,t[24]=s,t[25]=f,t[26]=r.extends,t[27]=v,t[28]=y,t[29]=b,t[30]=x,t[31]=S}else v=t[27],y=t[28],b=t[29],x=t[30],S=t[31];let C;t[64]!==v||t[65]!==b||t[66]!==x||t[67]!==S?(C=(0,Q.jsxs)(v,{children:[b,x,S]}),t[64]=v,t[65]=b,t[66]=x,t[67]=S,t[68]=C):C=t[68];let w;return t[69]!==y||t[70]!==C?(w=(0,Q.jsx)(y,{children:C}),t[69]=y,t[70]=C,t[71]=w):w=t[71],w}function nn(e){return e.id}function rn(e){return[e.id,e]}function an(e){let t=(0,Z.c)(3),{a:n,selected:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(Zt,{children:(0,Q.jsx)(Kt,{a:n,selected:r})}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function on(e){let t=(0,Z.c)(10),{a:n,selected:r,busy:i,onDelete:a}=e,o;return t[0]!==n.dangerZoneBody||t[1]!==n.dangerZoneHint||t[2]!==n.dangerZoneMainUnavailable||t[3]!==n.dangerZoneTitle||t[4]!==n.purgeDisk||t[5]!==n.removeFromConfig||t[6]!==i||t[7]!==a||t[8]!==r.id?(o=(0,Q.jsx)(Zt,{children:r.id===`main`?(0,Q.jsx)(vt,{children:(0,Q.jsx)(_t,{icon:Ve,title:n.dangerZoneTitle,subtitle:n.dangerZoneMainUnavailable})}):(0,Q.jsxs)(vt,{className:`border border-red-200/70 bg-red-50/60 dark:border-red-900/50 dark:bg-red-950/25`,children:[(0,Q.jsx)(_t,{icon:Ve,title:n.dangerZoneTitle,subtitle:n.dangerZoneHint}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsx)(`p`,{className:`max-w-xl text-sm text-red-800 dark:text-red-200`,children:n.dangerZoneBody}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>void a(!1),children:[(0,Q.jsx)(Ye,{className:`mr-1 size-4`,"aria-hidden":!0}),n.removeFromConfig]}),(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:`border-red-200 text-red-700 hover:bg-red-100 dark:border-red-900/60 dark:text-red-300 dark:hover:bg-red-950/50`,disabled:i,onClick:()=>void a(!0),children:n.purgeDisk})]})]})]})}),t[0]=n.dangerZoneBody,t[1]=n.dangerZoneHint,t[2]=n.dangerZoneMainUnavailable,t[3]=n.dangerZoneTitle,t[4]=n.purgeDisk,t[5]=n.removeFromConfig,t[6]=i,t[7]=a,t[8]=r.id,t[9]=o):o=t[9],o}function sn(){return g(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,y,`dark:border-edge`)}function cn(e){return[e.channel,e.accountId,e.peerKind,e.peerId].filter(e=>typeof e==`string`&&e.length>0).join(` · `)||e.channel}function ln(e,t,n,r){let i=e.trim(),a=t.trim();if(a)return{channel:i,peerId:a};if(n!=null){let e=r[n];if(!e)return{channel:i};let t={channel:i};e.accountId?.trim()&&(t.accountId=e.accountId.trim()),e.peerKind?.trim()&&(t.peerKind=e.peerKind.trim());let a=e.peerId?.trim()||e.chatId?.trim();return a&&(t.peerId=a),t}return{channel:i}}function un(e){let t=(0,Z.c)(31),{a:n,filesLoading:r,files:i,activeFile:a,setActiveFile:o,filesViewMode:s,setFilesViewMode:c,fileDraft:l,setFileDraft:u,fileSaving:d,profileFileLoading:f,profileEditorNonce:p,onTryInChat:m}=e,h=T(dn),v;t[0]!==n.missing||t[1]!==i?.files?(v=i?.files.map(e=>({id:e.name,label:e.missing?`${e.name} (${n.missing})`:e.name,title:e.name}))??[],t[0]=n.missing,t[1]=i?.files,t[2]=v):v=t[2];let y=v,x;t[3]===n.filesHint?x=t[4]:(x=(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.filesHint}),t[3]=n.filesHint,t[4]=x);let S;t[5]!==n.filesAutoSaveHint||t[6]!==n.filesEmpty||t[7]!==n.filesMarkdownEdit||t[8]!==n.filesMarkdownPreview||t[9]!==n.filesNavAria||t[10]!==n.filesSavingStatus||t[11]!==n.pickFile||t[12]!==n.tryInChat||t[13]!==a||t[14]!==l||t[15]!==d||t[16]!==y||t[17]!==i||t[18]!==r||t[19]!==s||t[20]!==h||t[21]!==m||t[22]!==p||t[23]!==f||t[24]!==o||t[25]!==u||t[26]!==c?(S=r?(0,Q.jsx)(mt,{rows:3}):i?(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden`,children:[(0,Q.jsx)(yt,{items:y,activeTab:a??``,onChange:o,ariaLabel:n.filesNavAria,tabIdPrefix:`agent-files-tab`,panelIdPrefix:`agent-files-panel`,className:`shrink-0 flex-wrap`,buttonClassName:`font-mono text-xs whitespace-nowrap`}),(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-hidden`,children:a?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`inline-flex rounded-lg border border-edge bg-surface-panel p-0.5`,role:`group`,"aria-label":`${n.filesMarkdownEdit} / ${n.filesMarkdownPreview}`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:g(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,b.press,s===`edit`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>c(`edit`),children:[(0,Q.jsx)(Be,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),n.filesMarkdownEdit]}),(0,Q.jsxs)(`button`,{type:`button`,className:g(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,b.press,s===`preview`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>c(`preview`),children:[(0,Q.jsx)(et,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),n.filesMarkdownPreview]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[d?(0,Q.jsx)(`span`,{children:n.filesSavingStatus}):null,(0,Q.jsx)(`span`,{children:n.filesAutoSaveHint}),m?(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,className:`ml-auto text-xs`,onClick:m,children:[(0,Q.jsx)(nt,{className:`mr-1 size-3.5`,"aria-hidden":!0}),n.tryInChat]}):null]})]}),s===`edit`?(0,Q.jsx)(`div`,{className:g(sn(),`flex min-h-0 flex-1 flex-col overflow-hidden p-0`,f&&`pointer-events-none opacity-60`),children:(0,Q.jsx)(ut,{initialContent:l,onChange:u,isDark:h,className:`min-h-0 flex-1`},`${a??`file`}-${p}`)}):(0,Q.jsx)(`div`,{className:g(sn(),`min-h-0 flex-1 overflow-y-auto text-sm`,f&&`pointer-events-none opacity-60`),children:(0,Q.jsx)(rt,{content:l,className:`text-sm`})})]}):(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.pickFile})})]}):(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.filesEmpty}),t[5]=n.filesAutoSaveHint,t[6]=n.filesEmpty,t[7]=n.filesMarkdownEdit,t[8]=n.filesMarkdownPreview,t[9]=n.filesNavAria,t[10]=n.filesSavingStatus,t[11]=n.pickFile,t[12]=n.tryInChat,t[13]=a,t[14]=l,t[15]=d,t[16]=y,t[17]=i,t[18]=r,t[19]=s,t[20]=h,t[21]=m,t[22]=p,t[23]=f,t[24]=o,t[25]=u,t[26]=c,t[27]=S):S=t[27];let C;return t[28]!==x||t[29]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[x,S]}),t[28]=x,t[29]=S,t[30]=C):C=t[30],C}function dn(e){return e.resolved===`dark`}function fn(e){let t=(0,Z.c)(44),[n,r]=(0,$.useState)(`files`),{a:i}=e,a;t[0]===i.advancedHint?a=t[1]:(a=(0,Q.jsx)(`p`,{className:`mb-3 max-w-[70ch] text-sm leading-6 text-fg-muted`,children:i.advancedHint}),t[0]=i.advancedHint,t[1]=a);let o;t[2]===i.advancedFilesTab?o=t[3]:(o={id:`files`,label:i.advancedFilesTab,icon:ne},t[2]=i.advancedFilesTab,t[3]=o);let s;t[4]===i.advancedConfigTab?s=t[5]:(s={id:`config`,label:i.advancedConfigTab,icon:it},t[4]=i.advancedConfigTab,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=[o,s],t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]!==i.advancedNavAria||t[10]!==n||t[11]!==c?(l=(0,Q.jsx)(yt,{items:c,activeTab:n,onChange:r,ariaLabel:i.advancedNavAria,tabIdPrefix:`agent-advanced-tab`,panelIdPrefix:`agent-advanced-panel`}),t[9]=i.advancedNavAria,t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]!==a||t[14]!==l?(u=(0,Q.jsxs)(`div`,{className:`shrink-0`,children:[a,l]}),t[13]=a,t[14]=l,t[15]=u):u=t[15];let d;t[16]!==i||t[17]!==n||t[18]!==e.activeFile||t[19]!==e.agentModel||t[20]!==e.agentWorkspace||t[21]!==e.busy||t[22]!==e.capabilityPresets||t[23]!==e.defaultModel||t[24]!==e.defaultPresetId||t[25]!==e.defaultWorkspace||t[26]!==e.fileDraft||t[27]!==e.fileSaving||t[28]!==e.files||t[29]!==e.filesLoading||t[30]!==e.filesViewMode||t[31]!==e.onOpenCapabilityPreset||t[32]!==e.onTryInChat||t[33]!==e.onUpdateAgentExtends||t[34]!==e.profileEditorNonce||t[35]!==e.profileFileLoading||t[36]!==e.selected||t[37]!==e.setActiveFile||t[38]!==e.setFileDraft||t[39]!==e.setFilesViewMode?(d=n===`files`?(0,Q.jsx)(un,{a:i,filesLoading:e.filesLoading,files:e.files,activeFile:e.activeFile,setActiveFile:e.setActiveFile,filesViewMode:e.filesViewMode,setFilesViewMode:e.setFilesViewMode,fileDraft:e.fileDraft,setFileDraft:e.setFileDraft,fileSaving:e.fileSaving,profileFileLoading:e.profileFileLoading,profileEditorNonce:e.profileEditorNonce,onTryInChat:e.onTryInChat}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3`,children:[(0,Q.jsx)(`p`,{className:`shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-3 py-2 text-xs leading-5 text-fg-muted`,children:i.advancedRuntimeCoverageHint}),(0,Q.jsx)($t,{a:i,selected:e.selected,busy:e.busy,defaultModel:e.defaultModel,defaultWorkspace:e.defaultWorkspace,agentModel:e.agentModel,agentWorkspace:e.agentWorkspace,capabilityPresets:e.capabilityPresets,defaultPresetId:e.defaultPresetId,onUpdateAgentExtends:e.onUpdateAgentExtends,onOpenCapabilityPreset:e.onOpenCapabilityPreset})]}),t[16]=i,t[17]=n,t[18]=e.activeFile,t[19]=e.agentModel,t[20]=e.agentWorkspace,t[21]=e.busy,t[22]=e.capabilityPresets,t[23]=e.defaultModel,t[24]=e.defaultPresetId,t[25]=e.defaultWorkspace,t[26]=e.fileDraft,t[27]=e.fileSaving,t[28]=e.files,t[29]=e.filesLoading,t[30]=e.filesViewMode,t[31]=e.onOpenCapabilityPreset,t[32]=e.onTryInChat,t[33]=e.onUpdateAgentExtends,t[34]=e.profileEditorNonce,t[35]=e.profileFileLoading,t[36]=e.selected,t[37]=e.setActiveFile,t[38]=e.setFileDraft,t[39]=e.setFilesViewMode,t[40]=d):d=t[40];let f;return t[41]!==u||t[42]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[u,d]}),t[41]=u,t[42]=d,t[43]=f):f=t[43],f}function pn(e){let t=(0,Z.c)(79),{a:n,selected:r,busy:i,skillsCatalogLoading:a,catalogForPick:o,skillsInherit:c,setSkillsInherit:l,skillsPick:u,setSkillsPick:d,onSaveSkills:f}=e,p,m;if(t[0]!==r.skills.entry||t[1]!==c||t[2]!==u){p=[...u].toSorted(vn);let e=[...r.skills.entry??[]].toSorted(_n);m=c!==(r.skills.entry===void 0)||!c&&JSON.stringify(p)!==JSON.stringify(e),t[0]=r.skills.entry,t[1]=c,t[2]=u,t[3]=p,t[4]=m}else p=t[3],m=t[4];let h=m,v;t[5]!==p||t[6]!==c?(v={inherit:c,skills:p},t[5]=p,t[6]=c,t[7]=v):v=t[7];let y;t[8]!==h||t[9]!==f||t[10]!==v?(y={value:v,dirty:h,onSave:f,delayMs:350},t[8]=h,t[9]=f,t[10]=v,t[11]=y):y=t[11];let b=gt(y),x;t[12]===r.skills.effectiveAllowlist?x=t[13]:(x=function(e){let t=r.skills.effectiveAllowlist;return t===void 0?!0:t.length===0?!1:t.includes(e)},t[12]=r.skills.effectiveAllowlist,t[13]=x);let S=x,C;t[14]!==o||t[15]!==r.skills.effectiveAllowlist?(C=function(){let e=r.skills.effectiveAllowlist;return e===void 0?new Set(o.map(gn)):new Set(e)},t[14]=o,t[15]=r.skills.effectiveAllowlist,t[16]=C):C=t[16];let w=C,T;t[17]!==b.error||t[18]!==b.status?(T=(0,Q.jsx)(ht,{status:b.status,error:b.error}),t[17]=b.error,t[18]=b.status,t[19]=T):T=t[19];let E;t[20]!==n.skillsHint||t[21]!==n.skillsTitle||t[22]!==T?(E=(0,Q.jsx)(_t,{className:`shrink-0`,icon:st,title:n.skillsTitle,subtitle:n.skillsHint,trailing:T}),t[20]=n.skillsHint,t[21]=n.skillsTitle,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==b||t[25]!==l||t[26]!==p?(D=()=>{l(!0),b.saveNow({inherit:!0,skills:p})},t[24]=b,t[25]=l,t[26]=p,t[27]=D):D=t[27];let O;t[28]!==n.skillsInherit||t[29]!==i||t[30]!==D?(O=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,disabled:i,onClick:D,children:n.skillsInherit}),t[28]=n.skillsInherit,t[29]=i,t[30]=D,t[31]=O):O=t[31];let k;t[32]!==b||t[33]!==w||t[34]!==l||t[35]!==d?(k=()=>{l(!1);let e=w();d(e),b.saveNow({inherit:!1,skills:[...e].toSorted(hn)})},t[32]=b,t[33]=w,t[34]=l,t[35]=d,t[36]=k):k=t[36];let A;t[37]!==n.skillsCustomize||t[38]!==i||t[39]!==k?(A=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,disabled:i,onClick:k,children:n.skillsCustomize}),t[37]=n.skillsCustomize,t[38]=i,t[39]=k,t[40]=A):A=t[40];let j;t[41]!==A||t[42]!==O?(j=(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[O,A]}),t[41]=A,t[42]=O,t[43]=j):j=t[43];let M;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(M=lt(`skills`),t[44]=M):M=t[44];let N;t[45]===n.skillsLibraryLink?N=t[46]:(N=(0,Q.jsx)(s,{to:M,className:`shrink-0 text-xs font-medium text-accent-fg hover:underline`,children:n.skillsLibraryLink}),t[45]=n.skillsLibraryLink,t[46]=N);let P;t[47]!==j||t[48]!==N?(P=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3`,children:[j,N]}),t[47]=j,t[48]=N,t[49]=P):P=t[49];let F;t[50]===r.skills.preset?F=t[51]:(F=r.skills.preset.length?r.skills.preset.join(`, `):`—`,t[50]=r.skills.preset,t[51]=F);let I;t[52]!==n.skillsPresetLabel||t[53]!==F?(I=(0,Q.jsxs)(`p`,{className:`mt-2 shrink-0 text-xs text-fg-muted`,children:[n.skillsPresetLabel,` `,F]}),t[52]=n.skillsPresetLabel,t[53]=F,t[54]=I):I=t[54];let L;t[55]!==n.skillsInherit||t[56]!==r.skills.effectiveAllowlist||t[57]!==c?(L=r.skills.effectiveAllowlist?.length?r.skills.effectiveAllowlist.join(`, `):c?n.skillsInherit:`—`,t[55]=n.skillsInherit,t[56]=r.skills.effectiveAllowlist,t[57]=c,t[58]=L):L=t[58];let R;t[59]!==n.skillsEffectiveLabel||t[60]!==L?(R=(0,Q.jsxs)(`p`,{className:`shrink-0 text-xs text-fg-muted`,children:[n.skillsEffectiveLabel,` `,L]}),t[59]=n.skillsEffectiveLabel,t[60]=L,t[61]=R):R=t[61];let z;t[62]!==n.skillsEmptyCatalog||t[63]!==n.skillsNoDescription||t[64]!==b||t[65]!==i||t[66]!==o||t[67]!==S||t[68]!==d||t[69]!==a||t[70]!==c||t[71]!==u?(z=a?(0,Q.jsx)(`div`,{className:`mt-3 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-0.5`,children:(0,Q.jsx)(pt,{rows:4})}):o.length===0?(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.skillsEmptyCatalog}):(0,Q.jsx)(`div`,{className:g(`mt-3 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-0.5`,c&&`opacity-50`),children:(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2.5 text-sm`,children:o.map(e=>{let t=e.name||e.directoryId,r=c?S(t):u.has(t),a=typeof e.description==`string`?e.description.trim():``,o=a||n.skillsNoDescription;return(0,Q.jsx)(`li`,{className:`h-16 shrink-0 overflow-hidden rounded-xl bg-surface-panel/70 px-3 shadow-surface`,children:(0,Q.jsxs)(`label`,{className:`flex h-full cursor-pointer items-center gap-3 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`shrink-0 rounded border-edge`,checked:r,disabled:c||i,onChange:()=>{d(e=>{let n=new Set(e);return r?n.delete(t):n.add(t),b.saveNow({inherit:!1,skills:[...n].toSorted(mn)}),n})},"aria-label":t}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:[(0,Q.jsx)(`div`,{className:`truncate font-mono text-xs font-medium text-fg`,title:t,children:t}),(0,Q.jsx)(`p`,{className:g(`mt-0.5 truncate text-xs leading-tight text-fg-muted`,!a&&`italic text-fg-subtle`),title:o,children:o})]})]})},t)})})}),t[62]=n.skillsEmptyCatalog,t[63]=n.skillsNoDescription,t[64]=b,t[65]=i,t[66]=o,t[67]=S,t[68]=d,t[69]=a,t[70]=c,t[71]=u,t[72]=z):z=t[72];let B;return t[73]!==P||t[74]!==I||t[75]!==R||t[76]!==z||t[77]!==E?(B=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col`,children:[E,P,I,R,z]}),t[73]=P,t[74]=I,t[75]=R,t[76]=z,t[77]=E,t[78]=B):B=t[78],B}function mn(e,t){return e.localeCompare(t)}function hn(e,t){return e.localeCompare(t)}function gn(e){return e.name||e.directoryId}function _n(e,t){return e.localeCompare(t)}function vn(e,t){return e.localeCompare(t)}var yn=[`write_file`,`apply_patch`,`exec_command`],bn=[`exec_command`,`image_generate`,`extensions`],xn=[`send_message`,`send_media`];function Sn(e){let t=(0,Z.c)(87),{mode:n,builtinToolIds:r,loading:i,disableSet:a,onDisableSetChange:o,defaultsDisableSet:s,unknownDisabledIds:c,getToolDescription:l,getGroupTitle:u,labels:d,quickActionsDisabled:f}=e,p;t[0]===c?p=t[1]:(p=c===void 0?[]:c,t[0]=c,t[1]=p);let m=p,h=f===void 0?!1:f,v;t[2]===r?v=t[3]:(v=new Set(r),t[2]=r,t[3]=v);let y=v,b;t[4]===s?b=t[5]:(b=s??new Set,t[4]=s,t[5]=b);let x=b,S;t[6]!==x||t[7]!==a||t[8]!==n||t[9]!==o?(S=(e,t)=>{if(n===`agentEntry`&&t&&x.has(e))return;let r=new Set(a);t?r.delete(e):r.add(e),o(r)},t[6]=x,t[7]=a,t[8]=n,t[9]=o,t[10]=S):S=t[10];let C=S,w;t[11]!==y||t[12]!==o?(w=e=>{let t=new Set;for(let n of e)y.has(n)&&t.add(n);o(t)},t[11]=y,t[12]=o,t[13]=w):w=t[13];let T=w,E;t[14]===o?E=t[15]:(E=()=>{o(new Set)},t[14]=o,t[15]=E);let D=E,O;t[16]!==r||t[17]!==o||t[18]!==m?(O=()=>{o(new Set([...r,...m]))},t[16]=r,t[17]=o,t[18]=m,t[19]=O):O=t[19];let k=O,A;t[20]===r?A=t[21]:(A=xt(r),t[20]=r,t[21]=A);let j=A,M;if(t[22]!==y||t[23]!==j||t[24]!==n||t[25]!==m){if(M=[],n===`defaults`&&m.length>0){let e;t[27]===m?e=t[28]:(e=m.toSorted(wn),t[27]=m,t[28]=e);let n;t[29]===e?n=t[30]:(n={key:`unknown`,ids:e},t[29]=e,t[30]=n),M.push(n)}for(let e of Ct){let t=e.toolIds.filter(e=>y.has(e));t.length>0&&M.push({key:e.key,ids:[...t]})}if(j.length>0){let e;t[31]===j?e=t[32]:(e={key:`misc`,ids:j},t[31]=j,t[32]=e),M.push(e)}t[22]=y,t[23]=j,t[24]=n,t[25]=m,t[26]=M}else M=t[26];let N=M,P=N.some(Cn),F=h||i,I;t[33]===d.quickActionsLabel?I=t[34]:(I=(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:d.quickActionsLabel}),t[33]=d.quickActionsLabel,t[34]=I);let L=F||r.length===0&&m.length===0,R;t[35]!==D||t[36]!==d.quickEnableAll||t[37]!==L?(R=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:L,onClick:D,children:d.quickEnableAll}),t[35]=D,t[36]=d.quickEnableAll,t[37]=L,t[38]=R):R=t[38];let z=F||r.length===0&&m.length===0,B;t[39]!==k||t[40]!==d.quickDisableAll||t[41]!==z?(B=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:z,onClick:k,children:d.quickDisableAll}),t[39]=k,t[40]=d.quickDisableAll,t[41]=z,t[42]=B):B=t[42];let V=F||r.length===0,ee;t[43]===T?ee=t[44]:(ee=()=>T(yn),t[43]=T,t[44]=ee);let te;t[45]!==d.quickReadOnlyWorkspace||t[46]!==V||t[47]!==ee?(te=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:V,onClick:ee,children:d.quickReadOnlyWorkspace}),t[45]=d.quickReadOnlyWorkspace,t[46]=V,t[47]=ee,t[48]=te):te=t[48];let ne=F||r.length===0,re;t[49]===T?re=t[50]:(re=()=>T(bn),t[49]=T,t[50]=re);let ie;t[51]!==d.quickHighRiskOff||t[52]!==ne||t[53]!==re?(ie=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:ne,onClick:re,children:d.quickHighRiskOff}),t[51]=d.quickHighRiskOff,t[52]=ne,t[53]=re,t[54]=ie):ie=t[54];let H=F||r.length===0,U;t[55]===T?U=t[56]:(U=()=>T(xn),t[55]=T,t[56]=U);let W;t[57]!==d.quickNoOutbound||t[58]!==H||t[59]!==U?(W=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:H,onClick:U,children:d.quickNoOutbound}),t[57]=d.quickNoOutbound,t[58]=H,t[59]=U,t[60]=W):W=t[60];let G;t[61]!==R||t[62]!==B||t[63]!==te||t[64]!==ie||t[65]!==W?(G=(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[R,B,te,ie,W]}),t[61]=R,t[62]=B,t[63]=te,t[64]=ie,t[65]=W,t[66]=G):G=t[66];let K;t[67]!==I||t[68]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[I,G]}),t[67]=I,t[68]=G,t[69]=K):K=t[69];let ae;t[70]!==x||t[71]!==a||t[72]!==u||t[73]!==l||t[74]!==N||t[75]!==P||t[76]!==d.emptyBuiltin||t[77]!==d.lockedByDefaults||t[78]!==d.notInBuiltin||t[79]!==i||t[80]!==n||t[81]!==F||t[82]!==C?(ae=i?(0,Q.jsx)(pt,{rows:4}):P?(0,Q.jsx)(`div`,{className:`max-h-[min(50vh,22rem)] overflow-y-auto overscroll-contain pr-0.5`,children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-5 pr-1`,children:N.map(e=>{let{key:t,ids:r}=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:u(t)}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>{let r=n===`defaults`&&t===`unknown`,i=n===`agentEntry`&&x.has(e),o=a.has(e),s=i?!1:!o,c=l(e);return(0,Q.jsx)(`li`,{className:g(`rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,r&&`bg-surface-panel/50`,i&&`opacity-60`),children:(0,Q.jsxs)(`label`,{className:g(`flex gap-3 text-sm`,i?`cursor-not-allowed`:`cursor-pointer`),children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`mt-1 shrink-0 rounded border-edge`,checked:s,disabled:i||F,onChange:()=>C(e,!s)}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-xs font-medium text-fg`,children:e}),r?(0,Q.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`(`,d.notInBuiltin,`)`]}):null,i?(0,Q.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`(`,d.lockedByDefaults,`)`]}):null]}),c?(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:c}):null]})]})},e)})})]},t)})})}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d.emptyBuiltin}),t[70]=x,t[71]=a,t[72]=u,t[73]=l,t[74]=N,t[75]=P,t[76]=d.emptyBuiltin,t[77]=d.lockedByDefaults,t[78]=d.notInBuiltin,t[79]=i,t[80]=n,t[81]=F,t[82]=C,t[83]=ae):ae=t[83];let oe;return t[84]!==K||t[85]!==ae?(oe=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[K,ae]}),t[84]=K,t[85]=ae,t[86]=oe):oe=t[86],oe}function Cn(e){return e.ids.length>0}function wn(e,t){return e.localeCompare(t)}function Tn(e){let t=(0,Z.c)(60),{a:n,data:r,selected:i,busy:a,toolEntryDisable:o,setToolEntryDisable:s,onSaveTools:c,onClearToolsEntry:l}=e,u=w(An),d;t[0]===u?d=t[1]:(d=S(u),t[0]=u,t[1]=d);let f=d.agentSettings.advanced,p;t[2]===i.tools.presetDenied?p=t[3]:(p=new Set(i.tools.presetDenied.flatMap(kn)),t[2]=i.tools.presetDenied,t[3]=p);let m=p,h;t[4]===o?h=t[5]:(h=[...o].toSorted(On),t[4]=o,t[5]=h);let g=h,v;t[6]===i.tools.entryDisable?v=t[7]:(v=[...i.tools.entryDisable].toSorted(Dn),t[6]=i.tools.entryDisable,t[7]=v);let y=v,b;t[8]===g?b=t[9]:(b=JSON.stringify(g),t[8]=g,t[9]=b);let x;t[10]===y?x=t[11]:(x=JSON.stringify(y),t[10]=y,t[11]=x);let C=b!==x,T;t[12]!==C||t[13]!==g||t[14]!==c?(T={value:g,dirty:C,onSave:c,delayMs:350},t[12]=C,t[13]=g,t[14]=c,t[15]=T):T=t[15];let E=gt(T),D;t[16]!==E||t[17]!==s?(D=e=>{s(e),E.saveNow([...e].toSorted(En))},t[16]=E,t[17]=s,t[18]=D):D=t[18];let O=D,k=n.toolsDisableGroups,A;t[19]===k?A=t[20]:(A=e=>k[e],t[19]=k,t[20]=A);let j=A,M;t[21]===n.toolDescriptions?M=t[22]:(M=e=>e in n.toolDescriptions?n.toolDescriptions[e]:``,t[21]=n.toolDescriptions,t[22]=M);let N=M,P;t[23]!==E.error||t[24]!==E.status?(P=(0,Q.jsx)(ht,{status:E.status,error:E.error}),t[23]=E.error,t[24]=E.status,t[25]=P):P=t[25];let F;t[26]!==n.toolsHint||t[27]!==n.toolsTitle||t[28]!==P?(F=(0,Q.jsx)(_t,{className:`shrink-0`,icon:Fe,title:n.toolsTitle,subtitle:n.toolsHint,trailing:P}),t[26]=n.toolsHint,t[27]=n.toolsTitle,t[28]=P,t[29]=F):F=t[29];let I;t[30]!==n.toolsLockedByPreset||t[31]!==f.toolsDisableEmptyBuiltin||t[32]!==f.toolsDisableLoadingBuiltin||t[33]!==f.toolsDisableNotInBuiltin||t[34]!==f.toolsDisableQuickActionsLabel||t[35]!==f.toolsDisableQuickDisableAll||t[36]!==f.toolsDisableQuickEnableAll||t[37]!==f.toolsDisableQuickHighRiskOff||t[38]!==f.toolsDisableQuickNoOutbound||t[39]!==f.toolsDisableQuickReadOnlyWorkspace?(I={loadingBuiltin:f.toolsDisableLoadingBuiltin,emptyBuiltin:f.toolsDisableEmptyBuiltin,quickActionsLabel:f.toolsDisableQuickActionsLabel,quickEnableAll:f.toolsDisableQuickEnableAll,quickDisableAll:f.toolsDisableQuickDisableAll,quickReadOnlyWorkspace:f.toolsDisableQuickReadOnlyWorkspace,quickHighRiskOff:f.toolsDisableQuickHighRiskOff,quickNoOutbound:f.toolsDisableQuickNoOutbound,notInBuiltin:f.toolsDisableNotInBuiltin,lockedByDefaults:n.toolsLockedByPreset},t[30]=n.toolsLockedByPreset,t[31]=f.toolsDisableEmptyBuiltin,t[32]=f.toolsDisableLoadingBuiltin,t[33]=f.toolsDisableNotInBuiltin,t[34]=f.toolsDisableQuickActionsLabel,t[35]=f.toolsDisableQuickDisableAll,t[36]=f.toolsDisableQuickEnableAll,t[37]=f.toolsDisableQuickHighRiskOff,t[38]=f.toolsDisableQuickNoOutbound,t[39]=f.toolsDisableQuickReadOnlyWorkspace,t[40]=I):I=t[40];let L;t[41]!==a||t[42]!==r.builtinToolIds||t[43]!==j||t[44]!==N||t[45]!==O||t[46]!==m||t[47]!==I||t[48]!==o?(L=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(Sn,{mode:`agentEntry`,builtinToolIds:r.builtinToolIds,loading:!1,disableSet:o,onDisableSetChange:O,defaultsDisableSet:m,getToolDescription:N,getGroupTitle:j,quickActionsDisabled:a,labels:I})}),t[41]=a,t[42]=r.builtinToolIds,t[43]=j,t[44]=N,t[45]=O,t[46]=m,t[47]=I,t[48]=o,t[49]=L):L=t[49];let R;t[50]===l?R=t[51]:(R=()=>void l(),t[50]=l,t[51]=R);let z;t[52]!==n.toolsClearEntry||t[53]!==a||t[54]!==R?(z=(0,Q.jsx)(`div`,{className:`mt-4 flex shrink-0 flex-wrap gap-2`,children:(0,Q.jsx)(_,{type:`button`,variant:`secondary`,disabled:a,onClick:R,children:n.toolsClearEntry})}),t[52]=n.toolsClearEntry,t[53]=a,t[54]=R,t[55]=z):z=t[55];let B;return t[56]!==F||t[57]!==L||t[58]!==z?(B=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col`,children:[F,L,z]}),t[56]=F,t[57]=L,t[58]=z,t[59]=B):B=t[59],B}function En(e,t){return e.localeCompare(t)}function Dn(e,t){return e.localeCompare(t)}function On(e,t){return e.localeCompare(t)}function kn(e){let t=String(e).trim();return t?[t]:[]}function An(e){return e.language}function jn(e){let t=(0,Z.c)(36),[n,r]=(0,$.useState)(`tools`),{a:i}=e,a;t[0]===i.capabilitiesHint?a=t[1]:(a=(0,Q.jsx)(`p`,{className:`mb-3 max-w-[70ch] text-sm leading-6 text-fg-muted`,children:i.capabilitiesHint}),t[0]=i.capabilitiesHint,t[1]=a);let o;t[2]===i.capabilitiesToolsTab?o=t[3]:(o={id:`tools`,label:i.capabilitiesToolsTab,icon:Fe},t[2]=i.capabilitiesToolsTab,t[3]=o);let s;t[4]===i.capabilitiesSkillsTab?s=t[5]:(s={id:`skills`,label:i.capabilitiesSkillsTab,icon:ke},t[4]=i.capabilitiesSkillsTab,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=[o,s],t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]!==i.capabilitiesNavAria||t[10]!==n||t[11]!==c?(l=(0,Q.jsx)(yt,{items:c,activeTab:n,onChange:r,ariaLabel:i.capabilitiesNavAria,tabIdPrefix:`agent-capabilities-tab`,panelIdPrefix:`agent-capabilities-panel`}),t[9]=i.capabilitiesNavAria,t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]!==a||t[14]!==l?(u=(0,Q.jsxs)(`div`,{className:`shrink-0`,children:[a,l]}),t[13]=a,t[14]=l,t[15]=u):u=t[15];let d;t[16]!==i||t[17]!==n||t[18]!==e.busy||t[19]!==e.catalogForPick||t[20]!==e.data||t[21]!==e.onClearToolsEntry||t[22]!==e.onSaveSkills||t[23]!==e.onSaveTools||t[24]!==e.selected||t[25]!==e.setSkillsInherit||t[26]!==e.setSkillsPick||t[27]!==e.setToolEntryDisable||t[28]!==e.skillsCatalogLoading||t[29]!==e.skillsInherit||t[30]!==e.skillsPick||t[31]!==e.toolEntryDisable?(d=n===`tools`?(0,Q.jsx)(Tn,{a:i,data:e.data,selected:e.selected,busy:e.busy,toolEntryDisable:e.toolEntryDisable,setToolEntryDisable:e.setToolEntryDisable,onSaveTools:e.onSaveTools,onClearToolsEntry:e.onClearToolsEntry}):(0,Q.jsx)(pn,{a:i,selected:e.selected,busy:e.busy,skillsCatalogLoading:e.skillsCatalogLoading,catalogForPick:e.catalogForPick,skillsInherit:e.skillsInherit,setSkillsInherit:e.setSkillsInherit,skillsPick:e.skillsPick,setSkillsPick:e.setSkillsPick,onSaveSkills:e.onSaveSkills}),t[16]=i,t[17]=n,t[18]=e.busy,t[19]=e.catalogForPick,t[20]=e.data,t[21]=e.onClearToolsEntry,t[22]=e.onSaveSkills,t[23]=e.onSaveTools,t[24]=e.selected,t[25]=e.setSkillsInherit,t[26]=e.setSkillsPick,t[27]=e.setToolEntryDisable,t[28]=e.skillsCatalogLoading,t[29]=e.skillsInherit,t[30]=e.skillsPick,t[31]=e.toolEntryDisable,t[32]=d):d=t[32];let f;return t[33]!==u||t[34]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[u,d]}),t[33]=u,t[34]=d,t[35]=f):f=t[35],f}var Mn=g(v,`w-full text-xs sm:w-auto sm:min-w-[11rem] sm:max-w-[17rem] sm:shrink-0`);function Nn(e){let t=(0,Z.c)(59),{a:n,busy:r,bindingsLoading:i,agentBindings:a,onRemoveBinding:o,onAddBinding:s,channelStatuses:c,channelsStatusLoading:l,useManualChannel:u,newBindChannel:f,setNewBindChannel:m,bindSessionChats:h,sessionsLoading:v,newBindSessionIdx:y,setNewBindSessionIdx:b,newBindCustomPeer:x,setNewBindCustomPeer:S,onRefreshSessions:C,lastActiveLabels:w,selectRecipient:T}=e,E=!l&&(u||c.length>0),D;t[0]!==n.channelsHint||t[1]!==n.channelsTitle?(D=(0,Q.jsx)(_t,{className:`shrink-0`,icon:at,title:n.channelsTitle,subtitle:n.channelsHint}),t[0]=n.channelsHint,t[1]=n.channelsTitle,t[2]=D):D=t[2];let O;t[3]!==n.channelsNone||t[4]!==n.removeBinding||t[5]!==a||t[6]!==i||t[7]!==r||t[8]!==o?(O=i?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-busy":`true`,children:Array.from({length:2}).map(Pn)}):a.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.channelsNone}):(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:a.map(e=>(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-xs`,children:cn(e.match)}),(0,Q.jsx)(_,{type:`button`,variant:`secondary`,disabled:r,onClick:()=>void o(e),children:n.removeBinding})]},`${e.match.channel}-${cn(e.match)}`))}),t[3]=n.channelsNone,t[4]=n.removeBinding,t[5]=a,t[6]=i,t[7]=r,t[8]=o,t[9]=O):O=t[9];let k;t[10]!==n.channelLabel||t[11]!==n.channelsDisabledSuffix||t[12]!==n.channelsManualChannelHint||t[13]!==c||t[14]!==l||t[15]!==f||t[16]!==m||t[17]!==S||t[18]!==b||t[19]!==u?(k=l?(0,Q.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,Q.jsx)(q,{className:`h-4 w-24`}),(0,Q.jsx)(q,{className:`h-10 w-full rounded-lg`})]}):u?(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelLabel}),(0,Q.jsx)(`input`,{className:sn(),value:f,onChange:e=>m(e.target.value),placeholder:`telegram`,autoComplete:`off`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsManualChannelHint})]}):(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelLabel}),(0,Q.jsx)(d,{className:g(sn(),`py-2`),value:f,onChange:e=>{m(e.target.value),b(null),S(``)},children:c.map(e=>(0,Q.jsxs)(p,{value:e.name,disabled:!e.enabled,children:[e.name,` `,e.enabled?``:n.channelsDisabledSuffix]},e.name))})]}),t[10]=n.channelLabel,t[11]=n.channelsDisabledSuffix,t[12]=n.channelsManualChannelHint,t[13]=c,t[14]=l,t[15]=f,t[16]=m,t[17]=S,t[18]=b,t[19]=u,t[20]=k):k=t[20];let A;t[21]!==n.channelsCustomPeerHint||t[22]!==n.channelsCustomPeerPlaceholder||t[23]!==n.channelsNoSessionsHint||t[24]!==n.channelsPeerAny||t[25]!==n.channelsPeerFromSessions||t[26]!==n.channelsRefreshSessions||t[27]!==n.channelsRefreshSessionsHint||t[28]!==n.channelsSessionLabel||t[29]!==n.peerIdLabel||t[30]!==h||t[31]!==r||t[32]!==w||t[33]!==f||t[34]!==x||t[35]!==y||t[36]!==C||t[37]!==T||t[38]!==v||t[39]!==S||t[40]!==b||t[41]!==E?(A=E&&f.trim()?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-edge-subtle pt-3 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelsSessionLabel}),(0,Q.jsxs)(_,{type:`button`,variant:`ghost`,className:`h-7 gap-1 px-2 text-xs`,disabled:r||v||!f.trim(),title:n.channelsRefreshSessionsHint,onClick:()=>C(),children:[(0,Q.jsx)(fe,{className:g(`size-3.5`,v&&`animate-spin`),strokeWidth:1.75}),n.channelsRefreshSessions]})]}),v&&h.length===0?(0,Q.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,Q.jsx)(q,{className:`h-4 w-32`}),(0,Q.jsx)(q,{className:`h-10 w-full rounded-lg`})]}):null,(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelsPeerFromSessions}),(0,Q.jsxs)(d,{className:g(sn(),`py-2`),value:y==null?``:String(y),disabled:r||!f.trim()||!!x.trim(),onChange:e=>{let t=e.target.value;b(t===``?null:Number(t))},children:[(0,Q.jsx)(p,{value:``,children:n.channelsPeerAny}),h.map((e,t)=>(0,Q.jsx)(p,{value:String(t),children:Mt(e,w)},`${e.channel}-${e.chatId}`))]})]}),h.length===0&&f.trim()&&!v?(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsNoSessionsHint}):null,(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.peerIdLabel}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-stretch sm:gap-2`,children:[(0,Q.jsx)(`input`,{type:`text`,className:g(sn(),`min-w-0 w-full sm:flex-1`),value:x,onChange:e=>{S(e.target.value),e.target.value.trim()&&b(null)},placeholder:n.channelsCustomPeerPlaceholder,autoComplete:`off`}),(0,Q.jsxs)(d,{className:Mn,value:x,onChange:e=>{let t=e.target.value;S(t||``),b(null)},children:[(0,Q.jsx)(p,{value:``,children:T}),h.map(e=>(0,Q.jsx)(p,{value:e.chatId,children:Mt(e,w)},`${e.channel}-${e.chatId}`))]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsCustomPeerHint})]})]}):null,t[21]=n.channelsCustomPeerHint,t[22]=n.channelsCustomPeerPlaceholder,t[23]=n.channelsNoSessionsHint,t[24]=n.channelsPeerAny,t[25]=n.channelsPeerFromSessions,t[26]=n.channelsRefreshSessions,t[27]=n.channelsRefreshSessionsHint,t[28]=n.channelsSessionLabel,t[29]=n.peerIdLabel,t[30]=h,t[31]=r,t[32]=w,t[33]=f,t[34]=x,t[35]=y,t[36]=C,t[37]=T,t[38]=v,t[39]=S,t[40]=b,t[41]=E,t[42]=A):A=t[42];let j;t[43]!==r||t[44]!==l||t[45]!==f?(j=r||!f.trim()||l,t[43]=r,t[44]=l,t[45]=f,t[46]=j):j=t[46];let M;t[47]!==n.addBinding||t[48]!==j?(M=(0,Q.jsx)(`div`,{children:(0,Q.jsx)(_,{type:`submit`,disabled:j,children:n.addBinding})}),t[47]=n.addBinding,t[48]=j,t[49]=M):M=t[49];let N;t[50]!==s||t[51]!==k||t[52]!==A||t[53]!==M?(N=(0,Q.jsxs)(`form`,{className:`mt-4 flex flex-col gap-3`,onSubmit:s,children:[k,A,M]}),t[50]=s,t[51]=k,t[52]=A,t[53]=M,t[54]=N):N=t[54];let P;return t[55]!==D||t[56]!==O||t[57]!==N?(P=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:[D,O,N]}),t[55]=D,t[56]=O,t[57]=N,t[58]=P):P=t[58],P}function Pn(e,t){return(0,Q.jsx)(q,{className:`h-10 rounded-lg`},t)}function Fn(e,t){switch(e){case`adventurer`:return t.avatarStyleAdventurer;case`bottts`:return t.avatarStyleRobot;case`lorelei`:return t.avatarStyleLorelei;case`thumbs`:return t.avatarStyleThumbs;case`fun-emoji`:return t.avatarStyleFunEmoji;default:return e}}function In(e){let{agentId:t,value:n,onChange:r,a:i,id:a}=e,o=(0,$.useRef)(null),[s,u]=(0,$.useState)(!1),[d,p]=(0,$.useState)(null),[h,v]=(0,$.useState)(!1),y=(0,$.useMemo)(()=>{let e=Re(n.trim());return e&&We(e.styleId)?e.styleId:$e[0]??`adventurer`},[n]),x=(0,$.useCallback)(async(e,n)=>{try{await pe(t)}catch{}r(X(e,n)),v(!1)},[t,r]),S=(0,$.useCallback)(async e=>{let n=e.target.files?.[0];if(e.target.value=``,n){p(null),u(!0);try{await Me(t,n),Ze(t),r(Xe)}catch(e){let t=e instanceof Error?e.message:``;p(t===`avatar_too_large`?i.avatarTooLarge:t===`unsupported_image_type`||t===`empty_file`?i.avatarInvalidImage:i.avatarUploadFailed)}finally{u(!1)}}},[i,t,r]),C=(e,t)=>{let r=Re(n.trim());return!!(r&&r.styleId===e&&r.seed===t)};return(0,Q.jsxs)(`div`,{...a?{id:a}:{},className:`flex flex-col gap-3 sm:col-span-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:i.avatarPickerTitle}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`input`,{ref:o,type:`file`,accept:`image/png,image/jpeg,image/webp,.png,.jpg,.jpeg,.webp`,className:`hidden`,onChange:e=>void S(e)}),(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,className:`gap-1.5 px-2.5 py-1.5 text-xs`,disabled:s,onClick:()=>o.current?.click(),children:[(0,Q.jsx)(ze,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),s?i.avatarUploading:i.avatarUploadCustom]})]})]}),d?(0,Q.jsx)(`p`,{className:`text-xs text-red-600 dark:text-red-400`,children:d}):null,(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:$e.map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void x(e,He[0]??t),className:g(`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,b.press,y===e?`border-fg bg-fg text-surface-base`:`border-edge-subtle bg-surface-panel text-fg hover:border-edge`),children:Fn(e,i)},e))}),(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel/50 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[He.map(e=>(0,Q.jsx)(`button`,{type:`button`,title:e,onClick:()=>void x(y,e),className:g(`flex size-12 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,b.press,C(y,e)?`border-accent ring-2 ring-accent/30`:`border-transparent hover:border-edge`),children:(0,Q.jsx)(`img`,{src:bt(y,e,96),alt:``,width:44,height:44,className:`size-11 rounded-full object-cover`,draggable:!1})},e)),(0,Q.jsxs)(l,{open:h,onOpenChange:v,children:[(0,Q.jsx)(f,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:g(`flex size-12 shrink-0 items-center justify-center rounded-xl border border-edge-subtle bg-surface-base text-xs font-medium text-fg-muted hover:border-edge hover:text-fg`,b.press),children:i.avatarMore})}),(0,Q.jsx)(c,{children:(0,Q.jsxs)(m,{className:`z-[80] max-h-72 w-[min(22rem,calc(100vw-2rem))] overflow-y-auto rounded-xl border border-edge-subtle bg-surface-panel p-3 shadow-lg`,sideOffset:6,align:`end`,children:[(0,Q.jsx)(`p`,{className:`mb-2 text-xs font-medium text-fg-muted`,children:Fn(y,i)}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:re.map(e=>(0,Q.jsx)(`button`,{type:`button`,title:e,onClick:()=>void x(y,e),className:g(`flex size-11 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,b.press,C(y,e)?`border-accent ring-2 ring-accent/30`:`border-transparent hover:border-edge`),children:(0,Q.jsx)(`img`,{src:bt(y,e,88),alt:``,width:40,height:40,className:`size-10 rounded-full object-cover`,draggable:!1})},e))})]})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:i.personaAvatar}),(0,Q.jsx)(xe,{agentId:t,avatar:n,size:40}),n.trim()&&!Re(n.trim())&&n.trim()!==`xopc:custom`?(0,Q.jsx)(`span`,{className:`truncate font-mono text-[10px] text-fg-muted`,title:n,children:n}):null]})]})]})}var Ln={name:``,description:``,language:``,creature:``,emoji:``,avatar:``};function Rn(e){let t={...Ln};if(!e.trim())return t;let n={name:`name`,description:`description`,language:`language`,creature:`creature`,emoji:`emoji`,avatar:`avatar`};for(let r of e.split(`
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,l as o,t as s}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{d as c,f as l,i as u,n as d,p as f,r as p,u as m}from"./popover-select-BzdnTy3h.js";import{t as h}from"./external-link-DjqjBmc3.js";import{t as g}from"./cn-JdwAhgNB.js";import{t as _}from"./button-CSEbl4zT.js";import{o as v,s as y}from"./form-field-width-DJw_jULe.js";import{n as b,t as x}from"./interaction-BmQogeqz.js";import{t as S}from"./messages-D7kOD_o_.js";import{l as C,n as w}from"./locale-store-CnamlR07.js";import{i as T}from"./theme-store-BDyUTObE.js";import{i as E,o as D,s as O}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{a as k,i as A,n as j,o as M,r as N,s as P,t as F}from"./dist-BPoKqzeH.js";import{i as I}from"./vendor-swr-BIWyz7Rc.js";import{r as L}from"./gateway-config-swr-Cv2ywpdb.js";import{a as R,i as z,n as B,o as V,r as ee,t as te}from"./dist-DY4Af0fY.js";import{$c as ne,$i as re,An as ie,As as H,Bn as U,Dc as W,Fn as G,Hn as K,Ht as ae,In as oe,Jc as se,Jl as ce,Ll as le,Ln as ue,Lo as de,Ls as fe,Mn as pe,Na as q,Nl as me,Nn as he,Ns as ge,O as _e,Pl as ve,Pn as ye,Q as be,Qi as xe,Rn as Se,Ss as Ce,Ta as we,Ua as J,Uc as Te,Un as Ee,Ut as De,Vn as Oe,Vs as ke,Wa as Ae,Wl as je,Wn as Me,Ws as Ne,X as Pe,Xo as Fe,Xs as Ie,Yo as Le,aa as Re,as as ze,bc as Y,bs as Be,cs as Ve,ea as He,i as Ue,ia as We,is as Ge,jn as Ke,k as qe,kn as Je,ls as Ye,na as Xe,oa as Ze,r as Qe,ra as X,ta as $e,tl as et,ts as tt,uc as nt,wi as rt,ws as it,xc as at,xi as ot,zl as st,zn as ct,zo as lt}from"./index-CKSplmFw.js";import{t as ut}from"./markdown-editor-TWGaF7Xa.js";import{n as dt,r as ft}from"./settings-page-layout-BRQNel6r.js";import{r as pt,t as mt}from"./settings-loading-skeleton-Bqi7tsXj.js";import{n as ht,t as gt}from"./use-autosave-CUI3q_I-.js";import{n as _t,t as vt}from"./settings-form-section-Dr4Uf_CY.js";import{t as yt}from"./page-tabs-BaEQMYm_.js";import{n as bt}from"./agent-avatar-dicebear-CAjfa48Q.js";import{c as xt,i as St,s as Ct}from"./capability-presets-api--tz0mGLY.js";import{a as wt,i as Tt,n as Et,o as Dt,s as Ot,t as kt}from"./typed-models-lib-q5-Vfqd8.js";import{n as At,r as jt,t as Mt}from"./channel-recipient-api-CkOKF9nc.js";import{t as Nt}from"./directory-picker-path-field-DmfFg4Gq.js";var Z=n(),Q=r();function Pt(e){let t=(0,Z.c)(40),{open:n,onOpenChange:r,busy:i,deletePurge:a,deleteTarget:o,deleteConfirmText:s,onDeleteConfirmTextChange:c,onConfirm:l,onCancel:u,a:d}=e,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(k,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[0]=f):f=t[0];let p;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(p=g(`fixed left-1/2 top-1/2 z-[81] w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-4 shadow-popover`,`dark:border-edge`),t[1]=p):p=t[1];let m=a?d.purgeDisk:d.removeFromConfig,h;t[2]===m?h=t[3]:(h=(0,Q.jsx)(P,{className:`text-base font-semibold text-fg`,children:m}),t[2]=m,t[3]=h);let v=a?d.confirmDeletePurge:d.confirmDelete,y;t[4]===v?y=t[5]:(y=(0,Q.jsx)(A,{className:`mt-2 whitespace-pre-wrap text-sm leading-relaxed text-fg-muted`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==d.purgeConfirmHint||t[7]!==d.purgeConfirmLabel||t[8]!==d.purgeConfirmPlaceholder||t[9]!==s||t[10]!==a||t[11]!==o||t[12]!==c?(b=a&&o?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`label`,{className:`mb-2 block text-sm font-medium text-fg`,htmlFor:`agent-delete-confirm`,children:d.purgeConfirmLabel}),(0,Q.jsx)(`input`,{id:`agent-delete-confirm`,type:`text`,autoComplete:`off`,spellCheck:!1,className:g(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:d.purgeConfirmPlaceholder.replace(`{{agentId}}`,o.id),value:s,onChange:e=>c(e.target.value)}),(0,Q.jsx)(`p`,{className:`pt-0.5 text-xs text-fg-muted`,children:d.purgeConfirmHint.replace(`{{agentId}}`,o.id)})]}):null,t[6]=d.purgeConfirmHint,t[7]=d.purgeConfirmLabel,t[8]=d.purgeConfirmPlaceholder,t[9]=s,t[10]=a,t[11]=o,t[12]=c,t[13]=b):b=t[13];let x;t[14]!==d.createModalCancel||t[15]!==i||t[16]!==u?(x=(0,Q.jsx)(_,{type:`button`,variant:`ghost`,disabled:i,onClick:u,children:d.createModalCancel}),t[14]=d.createModalCancel,t[15]=i,t[16]=u,t[17]=x):x=t[17];let S=a?`border-red-200 text-red-700 hover:bg-red-50 dark:border-red-900/60 dark:text-red-300 dark:hover:bg-red-950/40`:void 0,C;t[18]!==i||t[19]!==s||t[20]!==a||t[21]!==o?(C=i||!o||a&&s.trim().toLowerCase()!==o.id.toLowerCase(),t[18]=i,t[19]=s,t[20]=a,t[21]=o,t[22]=C):C=t[22];let w=a?d.purgeDisk:d.removeFromConfig,T;t[23]!==l||t[24]!==C||t[25]!==w||t[26]!==S?(T=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:S,disabled:C,onClick:l,children:w}),t[23]=l,t[24]=C,t[25]=w,t[26]=S,t[27]=T):T=t[27];let E;t[28]!==T||t[29]!==x?(E=(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-end gap-2 border-t border-edge-subtle/60 pt-3`,children:[x,T]}),t[28]=T,t[29]=x,t[30]=E):E=t[30];let D;t[31]!==E||t[32]!==h||t[33]!==y||t[34]!==b?(D=(0,Q.jsxs)(M,{children:[f,(0,Q.jsxs)(N,{className:p,onOpenAutoFocus:Ft,children:[h,y,b,E]})]}),t[31]=E,t[32]=h,t[33]=y,t[34]=b,t[35]=D):D=t[35];let O;return t[36]!==r||t[37]!==n||t[38]!==D?(O=(0,Q.jsx)(F,{open:n,onOpenChange:r,children:D}),t[36]=r,t[37]=n,t[38]=D,t[39]=O):O=t[39],O}function Ft(e){return e.preventDefault()}var $=e(t(),1),It=[{id:`overview`,labelKey:`navOverview`,icon:Te},{id:`profile`,labelKey:`navProfile`,icon:Ce},{id:`capabilities`,labelKey:`navCapabilities`,icon:le},{id:`runtime`,labelKey:`navRuntime`,icon:H},{id:`connections`,labelKey:`navConnections`,icon:me},{id:`advanced`,labelKey:`navAdvanced`,icon:it},{id:`dangerZone`,labelKey:`navDangerZone`,icon:Ve}];function Lt(e){let t=(0,Z.c)(11),{a:n,panel:r,onPanelChange:i}=e,a;t[0]!==i||t[1]!==r?(a=(e,t,n)=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>i(e),className:g(`flex w-auto shrink-0 items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm font-medium transition-colors sm:w-full`,b.press,r===e?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),children:[(0,Q.jsx)(n,{className:`size-4 shrink-0 opacity-90`,strokeWidth:2,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:t})]},e),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o=a,s=n.editorNavAria,c;t[3]!==n||t[4]!==o?(c=It.map(e=>{let{id:t,labelKey:r,icon:i}=e;return o(t,n[r],i)}),t[3]=n,t[4]=o,t[5]=c):c=t[5];let l;t[6]===c?l=t[7]:(l=(0,Q.jsx)(`div`,{className:`flex gap-1 pb-1 sm:flex-col sm:gap-0.5 sm:pb-0`,children:c}),t[6]=c,t[7]=l);let u;return t[8]!==n.editorNavAria||t[9]!==l?(u=(0,Q.jsx)(`nav`,{className:`w-full overflow-x-auto sm:overflow-visible`,"aria-label":s,children:l}),t[8]=n.editorNavAria,t[9]=l,t[10]=u):u=t[10],u}function Rt(e){let t=(0,Z.c)(33),{open:n,onOpenChange:r,a:i,title:a,subtitle:o,panel:s,onPanelChange:c,children:l}=e,[d,f]=(0,$.useState)(null),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(k,{className:g(`xopc-dialog-overlay fixed inset-0 bg-scrim`,D)}),t[0]=p):p=t[0];let m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=g(`xopc-dialog-content fixed flex flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-popover dark:border-edge`,E,`inset-4 h-[calc(100dvh-2rem)] max-h-[calc(100dvh-2rem)] min-h-0`,`sm:inset-auto sm:left-1/2 sm:top-1/2 sm:h-[min(88vh,48rem)] sm:max-h-[min(88vh,48rem)] sm:min-h-[32rem] sm:w-[min(100%-2rem,58rem)] sm:-translate-x-1/2 sm:-translate-y-1/2`),t[1]=m):m=t[1];let h;t[2]===a?h=t[3]:(h=(0,Q.jsx)(P,{className:`text-base font-semibold leading-snug text-fg`,children:a}),t[2]=a,t[3]=h);let _;t[4]===o?_=t[5]:(_=(0,Q.jsx)(A,{className:`mt-1 font-mono text-xs text-fg-muted`,children:o}),t[4]=o,t[5]=_);let v;t[6]!==h||t[7]!==_?(v=(0,Q.jsxs)(`div`,{className:`min-w-0 pr-2`,children:[h,_]}),t[6]=h,t[7]=_,t[8]=v):v=t[8];let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=g(x,`shrink-0 p-1.5 hover:bg-surface-base`),t[9]=y):y=t[9];let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(Le,{className:`size-4`,"aria-hidden":!0}),t[10]=b):b=t[10];let S;t[11]===i.closeDialogAria?S=t[12]:(S=(0,Q.jsx)(j,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:y,"aria-label":i.closeDialogAria,children:b})}),t[11]=i.closeDialogAria,t[12]=S);let C;t[13]!==v||t[14]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-2 border-b border-edge-subtle px-4 pb-3 pt-4 dark:border-edge`,children:[v,S]}),t[13]=v,t[14]=S,t[15]=C):C=t[15];let w;t[16]!==i||t[17]!==c||t[18]!==s?(w=(0,Q.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle px-4 py-3 dark:border-edge sm:flex sm:w-56 sm:shrink-0 sm:flex-col sm:overflow-y-auto sm:border-b-0 sm:border-r sm:px-0 sm:py-4 sm:pl-4 sm:pr-3`,children:(0,Q.jsx)(Lt,{a:i,panel:s,onPanelChange:c})}),t[16]=i,t[17]=c,t[18]=s,t[19]=w):w=t[19];let T;t[20]===l?T=t[21]:(T=(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden p-4 sm:pl-2 sm:pr-5`,children:l})}),t[20]=l,t[21]=T);let O;t[22]!==T||t[23]!==w?(O=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col sm:flex-row sm:overflow-hidden`,children:[w,T]}),t[22]=T,t[23]=w,t[24]=O):O=t[24];let I;t[25]!==d||t[26]!==O||t[27]!==C?(I=(0,Q.jsxs)(M,{children:[p,(0,Q.jsx)(N,{ref:f,className:m,onOpenAutoFocus:zt,children:(0,Q.jsxs)(u,{layer:`modal`,portalContainer:d,children:[C,O]})})]}),t[25]=d,t[26]=O,t[27]=C,t[28]=I):I=t[28];let L;return t[29]!==r||t[30]!==n||t[31]!==I?(L=(0,Q.jsx)(F,{open:n,onOpenChange:r,children:I}),t[29]=r,t[30]=n,t[31]=I,t[32]=L):L=t[32],L}function zt(e){return e.preventDefault()}function Bt(e){let t=(0,Z.c)(28),{label:n,mode:r,value:i,inheritedFrom:a,inheritLabel:o,overrideLabel:s,onClick:c}=e,l;t[0]===n?l=t[1]:(l=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-fg-subtle`,children:n}),t[0]=n,t[1]=l);let u=i||`—`,d;t[2]===u?d=t[3]:(d=(0,Q.jsx)(`p`,{className:`mt-1 truncate text-sm font-medium text-fg`,children:u}),t[2]=u,t[3]=d);let f;t[4]!==a||t[5]!==r?(f=r===`inherit`&&a?(0,Q.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-fg-muted`,children:a}):null,t[4]=a,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==l||t[8]!==d||t[9]!==f?(p=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[l,d,f]}),t[7]=l,t[8]=d,t[9]=f,t[10]=p):p=t[10];let m=r===`inherit`?`bg-surface-hover text-fg-muted`:`bg-accent-soft text-accent-fg`,h;t[11]===m?h=t[12]:(h=g(`mt-2 inline-flex shrink-0 self-start rounded-full px-2.5 py-0.5 text-xs font-medium sm:mt-0`,m),t[11]=m,t[12]=h);let _=r===`inherit`?o:s,v;t[13]!==h||t[14]!==_?(v=(0,Q.jsx)(`span`,{className:h,children:_}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==p||t[17]!==v?(y=(0,Q.jsxs)(Q.Fragment,{children:[p,v]}),t[16]=p,t[17]=v,t[18]=y):y=t[18];let b=y,x=c?`w-full text-left transition-colors hover:bg-surface-hover/45 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40 active:scale-[0.995] motion-reduce:active:scale-100`:void 0,S;t[19]===x?S=t[20]:(S=g(`flex flex-col gap-1 rounded-xl bg-surface-panel/80 px-4 py-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,x),t[19]=x,t[20]=S);let C=S;if(c){let e;return t[21]!==C||t[22]!==b||t[23]!==c?(e=(0,Q.jsx)(`button`,{type:`button`,className:C,onClick:c,children:b}),t[21]=C,t[22]=b,t[23]=c,t[24]=e):e=t[24],e}let w;return t[25]!==C||t[26]!==b?(w=(0,Q.jsx)(`div`,{className:C,children:b}),t[25]=C,t[26]=b,t[27]=w):w=t[27],w}function Vt(e){let t=(0,Z.c)(38),{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditModelStrategy:s,onEditWorkspace:c}=e,l=n.inheritance,u;t[0]===a?u=t[1]:(u=a.trim(),t[0]=a,t[1]=u);let d=!u,f;t[2]!==o||t[3]!==i?(f=!o.trim()||i.trim().length>0&&o.trim()===i.trim(),t[2]=o,t[3]=i,t[4]=f):f=t[4];let p=f,m=d?r||l.unset:a,h=p?i||l.unset:o,g;t[5]!==l.subtitle||t[6]!==l.title?(g=(0,Q.jsx)(_t,{icon:at,title:l.title,subtitle:l.subtitle}),t[5]=l.subtitle,t[6]=l.title,t[7]=g):g=t[7];let _=d?`inherit`:`override`,v;t[8]!==r||t[9]!==l.inheritsValue||t[10]!==d?(v=d&&r?l.inheritsValue.replace(`{{value}}`,r):void 0,t[8]=r,t[9]=l.inheritsValue,t[10]=d,t[11]=v):v=t[11];let y;t[12]!==m||t[13]!==l.badgeInherit||t[14]!==l.badgeOverride||t[15]!==l.modelLabel||t[16]!==s||t[17]!==_||t[18]!==v?(y=(0,Q.jsx)(Bt,{label:l.modelLabel,mode:_,value:m,inheritedFrom:v,inheritLabel:l.badgeInherit,overrideLabel:l.badgeOverride,onClick:s}),t[12]=m,t[13]=l.badgeInherit,t[14]=l.badgeOverride,t[15]=l.modelLabel,t[16]=s,t[17]=_,t[18]=v,t[19]=y):y=t[19];let b=p?`inherit`:`override`,x;t[20]!==i||t[21]!==l.inheritsValue||t[22]!==p?(x=p&&i?l.inheritsValue.replace(`{{value}}`,i):void 0,t[20]=i,t[21]=l.inheritsValue,t[22]=p,t[23]=x):x=t[23];let S;t[24]!==h||t[25]!==l.badgeInherit||t[26]!==l.badgeOverride||t[27]!==l.workspaceLabel||t[28]!==c||t[29]!==b||t[30]!==x?(S=(0,Q.jsx)(Bt,{label:l.workspaceLabel,mode:b,value:h,inheritedFrom:x,inheritLabel:l.badgeInherit,overrideLabel:l.badgeOverride,onClick:c}),t[24]=h,t[25]=l.badgeInherit,t[26]=l.badgeOverride,t[27]=l.workspaceLabel,t[28]=c,t[29]=b,t[30]=x,t[31]=S):S=t[31];let C;t[32]!==y||t[33]!==S?(C=(0,Q.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[y,S]}),t[32]=y,t[33]=S,t[34]=C):C=t[34];let w;return t[35]!==g||t[36]!==C?(w=(0,Q.jsxs)(vt,{children:[g,C]}),t[35]=g,t[36]=C,t[37]=w):w=t[37],w}function Ht(e,t){for(let n of t){let t=e[n];if(t)return t}return`default`}function Ut(e){let t=(0,Z.c)(5),{source:n}=e,r;if(t[0]!==n){let e=n.startsWith(`preset:`),i=n.startsWith(`agent:`);r=g(`shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium`,e&&`bg-accent/10 text-accent`,i&&`bg-surface-base text-fg-muted`,!e&&!i&&`bg-surface-panel text-fg-subtle`),t[0]=n,t[1]=r}else r=t[1];let i;return t[2]!==n||t[3]!==r?(i=(0,Q.jsx)(`span`,{className:r,children:n}),t[2]=n,t[3]=r,t[4]=i):i=t[4],i}function Wt(e){let t=(0,Z.c)(13),n;t[0]===e.name?n=t[1]:(n=(0,Q.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs font-medium text-fg`,children:e.name}),t[0]=e.name,t[1]=n);let r=e.monoValue&&`font-mono text-xs`,i;t[2]===r?i=t[3]:(i=g(`min-w-0 truncate text-sm text-fg`,r),t[2]=r,t[3]=i);let a;t[4]!==e.value||t[5]!==i?(a=(0,Q.jsx)(`div`,{className:i,children:e.value}),t[4]=e.value,t[5]=i,t[6]=a):a=t[6];let o;t[7]===e.source?o=t[8]:(o=(0,Q.jsx)(Ut,{source:e.source}),t[7]=e.source,t[8]=o);let s;return t[9]!==n||t[10]!==a||t[11]!==o?(s=(0,Q.jsxs)(`div`,{className:`grid gap-2 rounded-lg bg-surface-panel/80 px-3 py-2 shadow-surface sm:grid-cols-[minmax(0,10rem)_minmax(0,1fr)_auto] sm:items-center`,children:[n,a,o]}),t[9]=n,t[10]=a,t[11]=o,t[12]=s):s=t[12],s}function Gt(e,t){return e&&e.length>0?e.join(`, `):t}function Kt(e){let t=(0,Z.c)(39),{a:n,selected:r}=e,i;t[0]===r.id?i=t[1]:(i=r.id?[`agent-effective-manifest`,r.id]:null,t[0]=r.id,t[1]=i);let a;t[2]===r.id?a=t[3]:(a=()=>oe(r.id),t[2]=r.id,t[3]=a);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o={revalidateOnFocus:!1},t[4]=o):o=t[4];let{data:s,error:c,isLoading:l}=I(i,a,o),u=s?.manifest,d;t[5]!==s?.presetChain||t[6]!==u?.extends?(d=s?.presetChain??u?.extends??[],t[5]=s?.presetChain,t[6]=u?.extends,t[7]=d):d=t[7];let f=d,p;if(t[8]!==n.effectiveBoundariesTitle||t[9]!==n.effectiveEmpty||t[10]!==n.effectiveError||t[11]!==n.effectiveHint||t[12]!==n.effectiveLoading||t[13]!==n.effectiveLocksTitle||t[14]!==n.effectiveModelsTitle||t[15]!==n.effectiveNoLocks||t[16]!==n.effectiveNoOverrides||t[17]!==n.effectiveNoPresets||t[18]!==n.effectiveNoToolPolicies||t[19]!==n.effectiveOverridesTitle||t[20]!==n.effectivePresetChain||t[21]!==n.effectiveSkillsTitle||t[22]!==n.effectiveTitle||t[23]!==n.effectiveToolsTitle||t[24]!==s?.locks||t[25]!==s?.overrides||t[26]!==s?.sources||t[27]!==c||t[28]!==l||t[29]!==u||t[30]!==f){let e=s?.sources??{},r=Object.entries(u?.models?.roles??{}).sort(Xt),i=Object.entries(u?.tools?.builtin??{}).sort(Yt),a=u?.skills,o=u?.boundaries,d;t[32]===s?.overrides?d=t[33]:(d=s?.overrides??[],t[32]=s?.overrides,t[33]=d);let m=d,h;t[34]===s?.locks?h=t[35]:(h=s?.locks??[],t[34]=s?.locks,t[35]=h);let g=h,_;t[36]!==n.effectiveHint||t[37]!==n.effectiveTitle?(_=(0,Q.jsx)(_t,{icon:Y,title:n.effectiveTitle,subtitle:n.effectiveHint}),t[36]=n.effectiveHint,t[37]=n.effectiveTitle,t[38]=_):_=t[38],p=(0,Q.jsxs)(vt,{children:[_,l?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.effectiveLoading}):c?(0,Q.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:c instanceof Error?c.message:n.effectiveError}):u?(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectivePresetChain}),(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-panel/80 px-3 py-2 text-sm text-fg shadow-surface`,children:f.length?f.join(` -> `):n.effectiveNoPresets})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveOverridesTitle}),m.length>0?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:m.map(Jt)}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoOverrides})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveLocksTitle}),g.length>0?(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.map(qt)}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoLocks})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveModelsTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`defaultRole`,value:u.models?.defaultRole??`—`,source:Ht(e,[`models.defaultRole`])}),r.map(t=>{let[n,r]=t;return(0,Q.jsx)(Wt,{name:n,value:r.model,monoValue:!0,source:Ht(e,[`models.roles.${n}.model`,`models.roles.${n}`])},n)})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveToolsTitle}),i.length>0?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:i.map(t=>{let[n,r]=t;return(0,Q.jsx)(Wt,{name:n,value:r.mode,source:Ht(e,[`tools.builtin.${n}.mode`,`tools.builtin.${n}`])},n)})}):(0,Q.jsx)(`p`,{className:`rounded-lg bg-surface-panel/60 px-3 py-2 text-sm text-fg-muted shadow-surface`,children:n.effectiveNoToolPolicies})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveSkillsTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`mode`,value:a?.mode??`all`,source:Ht(e,[`skills.mode`,`skills`])}),a?.mode===`allowlist`?(0,Q.jsx)(Wt,{name:`allow`,value:Gt(a.allow,`—`),source:Ht(e,[`skills.allow`,`skills`])}):null,a?.mode===`denylist`?(0,Q.jsx)(Wt,{name:`deny`,value:Gt(a.deny,`—`),source:Ht(e,[`skills.deny`,`skills`])}):null]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n.effectiveBoundariesTitle}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Wt,{name:`requiresConfirmation`,value:Gt(o?.requiresConfirmation,`—`),source:Ht(e,[`boundaries.requiresConfirmation`,`boundaries`])}),(0,Q.jsx)(Wt,{name:`forbidden`,value:Gt(o?.forbidden,`—`),source:Ht(e,[`boundaries.forbidden`,`boundaries`])}),(0,Q.jsx)(Wt,{name:`escalation`,value:Gt(o?.escalation,`—`),source:Ht(e,[`boundaries.escalation`,`boundaries`])})]})]})]})}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.effectiveEmpty})]}),t[8]=n.effectiveBoundariesTitle,t[9]=n.effectiveEmpty,t[10]=n.effectiveError,t[11]=n.effectiveHint,t[12]=n.effectiveLoading,t[13]=n.effectiveLocksTitle,t[14]=n.effectiveModelsTitle,t[15]=n.effectiveNoLocks,t[16]=n.effectiveNoOverrides,t[17]=n.effectiveNoPresets,t[18]=n.effectiveNoToolPolicies,t[19]=n.effectiveOverridesTitle,t[20]=n.effectivePresetChain,t[21]=n.effectiveSkillsTitle,t[22]=n.effectiveTitle,t[23]=n.effectiveToolsTitle,t[24]=s?.locks,t[25]=s?.overrides,t[26]=s?.sources,t[27]=c,t[28]=l,t[29]=u,t[30]=f,t[31]=p}else p=t[31];return p}function qt(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 font-mono text-xs text-fg-muted shadow-surface`,children:e},e)}function Jt(e,t){return(0,Q.jsxs)(`div`,{className:`grid gap-1 rounded-lg bg-surface-panel/80 px-3 py-2 text-xs shadow-surface sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] sm:items-center`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`truncate font-mono font-medium text-fg`,children:e.path}),(0,Q.jsx)(`div`,{className:`mt-1 truncate text-fg-muted`,children:e.from})]}),(0,Q.jsx)(`span`,{className:`text-fg-subtle`,"aria-hidden":!0,children:`→`}),(0,Q.jsx)(`div`,{className:`truncate text-fg-muted sm:text-right`,children:e.to})]},`${e.path}-${e.from}-${e.to}-${t}`)}function Yt(e,t){let[n]=e,[r]=t;return n.localeCompare(r)}function Xt(e,t){let[n]=e,[r]=t;return n.localeCompare(r)}function Zt(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1`,children:(0,Q.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-5 pb-6`,children:n})}),t[0]=n,t[1]=r),r}function Qt(e){let t=(0,Z.c)(4),{active:n,children:r,onClick:i}=e,a=n?`rounded-md bg-accent-soft px-3 py-1.5 text-sm font-medium text-accent-fg`:`rounded-md px-3 py-1.5 text-sm font-medium text-fg-muted hover:bg-surface-hover hover:text-fg`,o;return t[0]!==r||t[1]!==i||t[2]!==a?(o=(0,Q.jsx)(`button`,{type:`button`,onClick:i,className:a,children:r}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3],o}function $t(e){let t=(0,Z.c)(41),{a:n,selected:r,busy:i,defaultModel:a,defaultWorkspace:o,agentModel:s,agentWorkspace:c,capabilityPresets:l,defaultPresetId:u,onUpdateAgentExtends:d,onOpenCapabilityPreset:f}=e,[p,m]=(0,$.useState)(`sources`),h=p===`sources`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>m(`sources`),t[0]=g):g=t[0];let _;t[1]!==n.configSubtabSources||t[2]!==h?(_=(0,Q.jsx)(Qt,{active:h,onClick:g,children:n.configSubtabSources}),t[1]=n.configSubtabSources,t[2]=h,t[3]=_):_=t[3];let v=p===`shared`,y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>m(`shared`),t[4]=y):y=t[4];let b;t[5]!==n.configSubtabShared||t[6]!==v?(b=(0,Q.jsx)(Qt,{active:v,onClick:y,children:n.configSubtabShared}),t[5]=n.configSubtabShared,t[6]=v,t[7]=b):b=t[7];let x=p===`effective`,S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>m(`effective`),t[8]=S):S=t[8];let C;t[9]!==n.configSubtabEffective||t[10]!==x?(C=(0,Q.jsx)(Qt,{active:x,onClick:S,children:n.configSubtabEffective}),t[9]=n.configSubtabEffective,t[10]=x,t[11]=C):C=t[11];let w;t[12]!==_||t[13]!==b||t[14]!==C?(w=(0,Q.jsx)(`div`,{className:`shrink-0 rounded-lg border border-edge bg-surface-panel p-1`,children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[_,b,C]})}),t[12]=_,t[13]=b,t[14]=C,t[15]=w):w=t[15];let T;t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==a||t[20]!==o||t[21]!==p?(T=p===`sources`?(0,Q.jsx)(en,{a:n,defaultModel:a,defaultWorkspace:o,agentModel:s,agentWorkspace:c}):null,t[16]=n,t[17]=s,t[18]=c,t[19]=a,t[20]=o,t[21]=p,t[22]=T):T=t[22];let E;t[23]!==n||t[24]!==i||t[25]!==l||t[26]!==u||t[27]!==f||t[28]!==d||t[29]!==r||t[30]!==p?(E=p===`shared`?(0,Q.jsx)(tn,{a:n,selected:r,busy:i,capabilityPresets:l,defaultPresetId:u,onUpdateAgentExtends:d,onOpenCapabilityPreset:f}):null,t[23]=n,t[24]=i,t[25]=l,t[26]=u,t[27]=f,t[28]=d,t[29]=r,t[30]=p,t[31]=E):E=t[31];let D;t[32]!==n||t[33]!==r||t[34]!==p?(D=p===`effective`?(0,Q.jsx)(an,{a:n,selected:r}):null,t[32]=n,t[33]=r,t[34]=p,t[35]=D):D=t[35];let O;return t[36]!==w||t[37]!==T||t[38]!==E||t[39]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[w,T,E,D]}),t[36]=w,t[37]=T,t[38]=E,t[39]=D,t[40]=O):O=t[40],O}function en(e){let t=(0,Z.c)(7),{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditWorkspace:s}=e,c;return t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==r||t[4]!==i||t[5]!==s?(c=(0,Q.jsx)(Zt,{children:(0,Q.jsx)(Vt,{a:n,defaultModel:r,defaultWorkspace:i,agentModel:a,agentWorkspace:o,onEditWorkspace:s})}),t[0]=n,t[1]=a,t[2]=o,t[3]=r,t[4]=i,t[5]=s,t[6]=c):c=t[6],c}function tn(e){let t=(0,Z.c)(72),{a:n,selected:r,busy:i,capabilityPresets:a,defaultPresetId:o,onUpdateAgentExtends:s,onOpenCapabilityPreset:c}=e,l=o===void 0?`default`:o,u;t[0]===a?u=t[1]:(u=new Map(a.map(rn)),t[0]=a,t[1]=u);let f=u,m;t[2]!==n.capabilityPresetsGlobalDefault||t[3]!==n.capabilityPresetsGlobalDefaultHint||t[4]!==l||t[5]!==f?(m=f.get(l)??{id:l,name:n.capabilityPresetsGlobalDefault,description:n.capabilityPresetsGlobalDefaultHint},t[2]=n.capabilityPresetsGlobalDefault,t[3]=n.capabilityPresetsGlobalDefaultHint,t[4]=l,t[5]=f,t[6]=m):m=t[6];let g=m,v,y,b,x,S;if(t[7]!==n.capabilityPresetAdd||t[8]!==n.capabilityPresetMoveDown||t[9]!==n.capabilityPresetMoveUp||t[10]!==n.capabilityPresetRemove||t[11]!==n.capabilityPresetsEmptyAdditional||t[12]!==n.capabilityPresetsGlobalDefault||t[13]!==n.capabilityPresetsGlobalDefaultHint||t[14]!==n.capabilityPresetsHint||t[15]!==n.capabilityPresetsManage||t[16]!==n.capabilityPresetsTitle||t[17]!==i||t[18]!==a||t[19]!==l||t[20]!==g.description||t[21]!==g.id||t[22]!==g.name||t[23]!==c||t[24]!==s||t[25]!==f||t[26]!==r.extends){let e;t[32]===l?e=t[33]:(e=e=>e!==l,t[32]=l,t[33]=e);let o=r.extends.filter(e),u=a.map(nn).filter(e=>e!==l&&!o.includes(e)),m=u[0]??``;y=Zt,v=vt;let C;t[34]===c?C=t[35]:(C=()=>c(``),t[34]=c,t[35]=C);let w;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(h,{className:`size-3.5`,"aria-hidden":!0}),t[36]=w):w=t[36];let T;t[37]!==n.capabilityPresetsManage||t[38]!==i||t[39]!==C?(T=(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,className:`text-xs`,disabled:i,onClick:C,children:[w,n.capabilityPresetsManage]}),t[37]=n.capabilityPresetsManage,t[38]=i,t[39]=C,t[40]=T):T=t[40],t[41]!==n.capabilityPresetsHint||t[42]!==n.capabilityPresetsTitle||t[43]!==T?(b=(0,Q.jsx)(_t,{icon:Ce,title:n.capabilityPresetsTitle,subtitle:n.capabilityPresetsHint,trailing:T}),t[41]=n.capabilityPresetsHint,t[42]=n.capabilityPresetsTitle,t[43]=T,t[44]=b):b=t[44];let E;t[45]!==g.id||t[46]!==c?(E=()=>c(g.id),t[45]=g.id,t[46]=c,t[47]=E):E=t[47];let D=g.name||n.capabilityPresetsGlobalDefault,O;t[48]===D?O=t[49]:(O=(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:D}),t[48]=D,t[49]=O);let k;t[50]===n.capabilityPresetsGlobalDefault?k=t[51]:(k=(0,Q.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent/10 px-2 py-0.5 text-[11px] font-medium text-accent`,children:n.capabilityPresetsGlobalDefault}),t[50]=n.capabilityPresetsGlobalDefault,t[51]=k);let A;t[52]!==O||t[53]!==k?(A=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[O,k]}),t[52]=O,t[53]=k,t[54]=A):A=t[54];let j;t[55]===g.id?j=t[56]:(j=(0,Q.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-fg-muted`,children:g.id}),t[55]=g.id,t[56]=j);let M=g.description||n.capabilityPresetsGlobalDefaultHint,N;t[57]===M?N=t[58]:(N=(0,Q.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:M}),t[57]=M,t[58]=N);let P;t[59]!==E||t[60]!==A||t[61]!==j||t[62]!==N?(P=(0,Q.jsx)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-accent-soft/20 px-3 py-2 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`min-w-0 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:E,children:[A,j,N]})}),t[59]=E,t[60]=A,t[61]=j,t[62]=N,t[63]=P):P=t[63],x=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[P,o.length>0?o.map((e,t)=>{let r=f.get(e);return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-surface-panel/80 px-3 py-2 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`min-w-0 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>c(e),children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:r?.name??e}),(0,Q.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-fg-muted`,children:e}),r?.description?(0,Q.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-fg-muted`,children:r.description}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-1.5`,children:[(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i||t===0,"aria-label":n.capabilityPresetMoveUp,onClick:()=>{let e=[...o],[n,r]=[e[t],e[t-1]];e[t-1]=n,e[t]=r,s(e)},children:(0,Q.jsx)(je,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i||t===o.length-1,"aria-label":n.capabilityPresetMoveDown,onClick:()=>{let e=[...o],[n,r]=[e[t+1],e[t]];e[t]=n,e[t+1]=r,s(e)},children:(0,Q.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:`size-8 rounded-lg p-0`,disabled:i,"aria-label":n.capabilityPresetRemove,onClick:()=>s(o.filter(t=>t!==e)),children:(0,Q.jsx)(Ye,{className:`size-3.5`,"aria-hidden":!0})})]})]},e)}):(0,Q.jsx)(`div`,{className:`rounded-lg bg-surface-panel/60 p-3 text-sm text-fg-muted shadow-surface`,children:n.capabilityPresetsEmptyAdditional})]}),S=u.length>0?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,Q.jsx)(d,{className:`min-w-0 flex-1 rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg focus:border-edge-strong focus:outline-none`,disabled:i,defaultValue:m,children:u.map(e=>(0,Q.jsx)(p,{value:e,children:f.get(e)?.name??e},e))}),(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,disabled:i||!m,onClick:e=>{let t=e.currentTarget.parentElement?.querySelector(`select`)?.value||m;t&&s([...o,t])},children:[(0,Q.jsx)(Ne,{className:`size-4`,"aria-hidden":!0}),n.capabilityPresetAdd]})]}):null,t[7]=n.capabilityPresetAdd,t[8]=n.capabilityPresetMoveDown,t[9]=n.capabilityPresetMoveUp,t[10]=n.capabilityPresetRemove,t[11]=n.capabilityPresetsEmptyAdditional,t[12]=n.capabilityPresetsGlobalDefault,t[13]=n.capabilityPresetsGlobalDefaultHint,t[14]=n.capabilityPresetsHint,t[15]=n.capabilityPresetsManage,t[16]=n.capabilityPresetsTitle,t[17]=i,t[18]=a,t[19]=l,t[20]=g.description,t[21]=g.id,t[22]=g.name,t[23]=c,t[24]=s,t[25]=f,t[26]=r.extends,t[27]=v,t[28]=y,t[29]=b,t[30]=x,t[31]=S}else v=t[27],y=t[28],b=t[29],x=t[30],S=t[31];let C;t[64]!==v||t[65]!==b||t[66]!==x||t[67]!==S?(C=(0,Q.jsxs)(v,{children:[b,x,S]}),t[64]=v,t[65]=b,t[66]=x,t[67]=S,t[68]=C):C=t[68];let w;return t[69]!==y||t[70]!==C?(w=(0,Q.jsx)(y,{children:C}),t[69]=y,t[70]=C,t[71]=w):w=t[71],w}function nn(e){return e.id}function rn(e){return[e.id,e]}function an(e){let t=(0,Z.c)(3),{a:n,selected:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,Q.jsx)(Zt,{children:(0,Q.jsx)(Kt,{a:n,selected:r})}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function on(e){let t=(0,Z.c)(10),{a:n,selected:r,busy:i,onDelete:a}=e,o;return t[0]!==n.dangerZoneBody||t[1]!==n.dangerZoneHint||t[2]!==n.dangerZoneMainUnavailable||t[3]!==n.dangerZoneTitle||t[4]!==n.purgeDisk||t[5]!==n.removeFromConfig||t[6]!==i||t[7]!==a||t[8]!==r.id?(o=(0,Q.jsx)(Zt,{children:r.id===`main`?(0,Q.jsx)(vt,{children:(0,Q.jsx)(_t,{icon:Ve,title:n.dangerZoneTitle,subtitle:n.dangerZoneMainUnavailable})}):(0,Q.jsxs)(vt,{className:`border border-red-200/70 bg-red-50/60 dark:border-red-900/50 dark:bg-red-950/25`,children:[(0,Q.jsx)(_t,{icon:Ve,title:n.dangerZoneTitle,subtitle:n.dangerZoneHint}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsx)(`p`,{className:`max-w-xl text-sm text-red-800 dark:text-red-200`,children:n.dangerZoneBody}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,disabled:i,onClick:()=>void a(!1),children:[(0,Q.jsx)(Ye,{className:`mr-1 size-4`,"aria-hidden":!0}),n.removeFromConfig]}),(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:`border-red-200 text-red-700 hover:bg-red-100 dark:border-red-900/60 dark:text-red-300 dark:hover:bg-red-950/50`,disabled:i,onClick:()=>void a(!0),children:n.purgeDisk})]})]})]})}),t[0]=n.dangerZoneBody,t[1]=n.dangerZoneHint,t[2]=n.dangerZoneMainUnavailable,t[3]=n.dangerZoneTitle,t[4]=n.purgeDisk,t[5]=n.removeFromConfig,t[6]=i,t[7]=a,t[8]=r.id,t[9]=o):o=t[9],o}function sn(){return g(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,y,`dark:border-edge`)}function cn(e){return[e.channel,e.accountId,e.peerKind,e.peerId].filter(e=>typeof e==`string`&&e.length>0).join(` · `)||e.channel}function ln(e,t,n,r){let i=e.trim(),a=t.trim();if(a)return{channel:i,peerId:a};if(n!=null){let e=r[n];if(!e)return{channel:i};let t={channel:i};e.accountId?.trim()&&(t.accountId=e.accountId.trim()),e.peerKind?.trim()&&(t.peerKind=e.peerKind.trim());let a=e.peerId?.trim()||e.chatId?.trim();return a&&(t.peerId=a),t}return{channel:i}}function un(e){let t=(0,Z.c)(31),{a:n,filesLoading:r,files:i,activeFile:a,setActiveFile:o,filesViewMode:s,setFilesViewMode:c,fileDraft:l,setFileDraft:u,fileSaving:d,profileFileLoading:f,profileEditorNonce:p,onTryInChat:m}=e,h=T(dn),v;t[0]!==n.missing||t[1]!==i?.files?(v=i?.files.map(e=>({id:e.name,label:e.missing?`${e.name} (${n.missing})`:e.name,title:e.name}))??[],t[0]=n.missing,t[1]=i?.files,t[2]=v):v=t[2];let y=v,x;t[3]===n.filesHint?x=t[4]:(x=(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.filesHint}),t[3]=n.filesHint,t[4]=x);let S;t[5]!==n.filesAutoSaveHint||t[6]!==n.filesEmpty||t[7]!==n.filesMarkdownEdit||t[8]!==n.filesMarkdownPreview||t[9]!==n.filesNavAria||t[10]!==n.filesSavingStatus||t[11]!==n.pickFile||t[12]!==n.tryInChat||t[13]!==a||t[14]!==l||t[15]!==d||t[16]!==y||t[17]!==i||t[18]!==r||t[19]!==s||t[20]!==h||t[21]!==m||t[22]!==p||t[23]!==f||t[24]!==o||t[25]!==u||t[26]!==c?(S=r?(0,Q.jsx)(mt,{rows:3}):i?(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden`,children:[(0,Q.jsx)(yt,{items:y,activeTab:a??``,onChange:o,ariaLabel:n.filesNavAria,tabIdPrefix:`agent-files-tab`,panelIdPrefix:`agent-files-panel`,className:`shrink-0 flex-wrap`,buttonClassName:`font-mono text-xs whitespace-nowrap`}),(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-hidden`,children:a?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`inline-flex rounded-lg border border-edge bg-surface-panel p-0.5`,role:`group`,"aria-label":`${n.filesMarkdownEdit} / ${n.filesMarkdownPreview}`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:g(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,b.press,s===`edit`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>c(`edit`),children:[(0,Q.jsx)(Be,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),n.filesMarkdownEdit]}),(0,Q.jsxs)(`button`,{type:`button`,className:g(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium`,b.press,s===`preview`?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover`),onClick:()=>c(`preview`),children:[(0,Q.jsx)(et,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),n.filesMarkdownPreview]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[d?(0,Q.jsx)(`span`,{children:n.filesSavingStatus}):null,(0,Q.jsx)(`span`,{children:n.filesAutoSaveHint}),m?(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,className:`ml-auto text-xs`,onClick:m,children:[(0,Q.jsx)(nt,{className:`mr-1 size-3.5`,"aria-hidden":!0}),n.tryInChat]}):null]})]}),s===`edit`?(0,Q.jsx)(`div`,{className:g(sn(),`flex min-h-0 flex-1 flex-col overflow-hidden p-0`,f&&`pointer-events-none opacity-60`),children:(0,Q.jsx)(ut,{initialContent:l,onChange:u,isDark:h,className:`min-h-0 flex-1`},`${a??`file`}-${p}`)}):(0,Q.jsx)(`div`,{className:g(sn(),`min-h-0 flex-1 overflow-y-auto text-sm`,f&&`pointer-events-none opacity-60`),children:(0,Q.jsx)(rt,{content:l,className:`text-sm`})})]}):(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.pickFile})})]}):(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.filesEmpty}),t[5]=n.filesAutoSaveHint,t[6]=n.filesEmpty,t[7]=n.filesMarkdownEdit,t[8]=n.filesMarkdownPreview,t[9]=n.filesNavAria,t[10]=n.filesSavingStatus,t[11]=n.pickFile,t[12]=n.tryInChat,t[13]=a,t[14]=l,t[15]=d,t[16]=y,t[17]=i,t[18]=r,t[19]=s,t[20]=h,t[21]=m,t[22]=p,t[23]=f,t[24]=o,t[25]=u,t[26]=c,t[27]=S):S=t[27];let C;return t[28]!==x||t[29]!==S?(C=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[x,S]}),t[28]=x,t[29]=S,t[30]=C):C=t[30],C}function dn(e){return e.resolved===`dark`}function fn(e){let t=(0,Z.c)(44),[n,r]=(0,$.useState)(`files`),{a:i}=e,a;t[0]===i.advancedHint?a=t[1]:(a=(0,Q.jsx)(`p`,{className:`mb-3 max-w-[70ch] text-sm leading-6 text-fg-muted`,children:i.advancedHint}),t[0]=i.advancedHint,t[1]=a);let o;t[2]===i.advancedFilesTab?o=t[3]:(o={id:`files`,label:i.advancedFilesTab,icon:ne},t[2]=i.advancedFilesTab,t[3]=o);let s;t[4]===i.advancedConfigTab?s=t[5]:(s={id:`config`,label:i.advancedConfigTab,icon:it},t[4]=i.advancedConfigTab,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=[o,s],t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]!==i.advancedNavAria||t[10]!==n||t[11]!==c?(l=(0,Q.jsx)(yt,{items:c,activeTab:n,onChange:r,ariaLabel:i.advancedNavAria,tabIdPrefix:`agent-advanced-tab`,panelIdPrefix:`agent-advanced-panel`}),t[9]=i.advancedNavAria,t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]!==a||t[14]!==l?(u=(0,Q.jsxs)(`div`,{className:`shrink-0`,children:[a,l]}),t[13]=a,t[14]=l,t[15]=u):u=t[15];let d;t[16]!==i||t[17]!==n||t[18]!==e.activeFile||t[19]!==e.agentModel||t[20]!==e.agentWorkspace||t[21]!==e.busy||t[22]!==e.capabilityPresets||t[23]!==e.defaultModel||t[24]!==e.defaultPresetId||t[25]!==e.defaultWorkspace||t[26]!==e.fileDraft||t[27]!==e.fileSaving||t[28]!==e.files||t[29]!==e.filesLoading||t[30]!==e.filesViewMode||t[31]!==e.onOpenCapabilityPreset||t[32]!==e.onTryInChat||t[33]!==e.onUpdateAgentExtends||t[34]!==e.profileEditorNonce||t[35]!==e.profileFileLoading||t[36]!==e.selected||t[37]!==e.setActiveFile||t[38]!==e.setFileDraft||t[39]!==e.setFilesViewMode?(d=n===`files`?(0,Q.jsx)(un,{a:i,filesLoading:e.filesLoading,files:e.files,activeFile:e.activeFile,setActiveFile:e.setActiveFile,filesViewMode:e.filesViewMode,setFilesViewMode:e.setFilesViewMode,fileDraft:e.fileDraft,setFileDraft:e.setFileDraft,fileSaving:e.fileSaving,profileFileLoading:e.profileFileLoading,profileEditorNonce:e.profileEditorNonce,onTryInChat:e.onTryInChat}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3`,children:[(0,Q.jsx)(`p`,{className:`shrink-0 rounded-lg border border-edge-subtle bg-surface-panel px-3 py-2 text-xs leading-5 text-fg-muted`,children:i.advancedRuntimeCoverageHint}),(0,Q.jsx)($t,{a:i,selected:e.selected,busy:e.busy,defaultModel:e.defaultModel,defaultWorkspace:e.defaultWorkspace,agentModel:e.agentModel,agentWorkspace:e.agentWorkspace,capabilityPresets:e.capabilityPresets,defaultPresetId:e.defaultPresetId,onUpdateAgentExtends:e.onUpdateAgentExtends,onOpenCapabilityPreset:e.onOpenCapabilityPreset})]}),t[16]=i,t[17]=n,t[18]=e.activeFile,t[19]=e.agentModel,t[20]=e.agentWorkspace,t[21]=e.busy,t[22]=e.capabilityPresets,t[23]=e.defaultModel,t[24]=e.defaultPresetId,t[25]=e.defaultWorkspace,t[26]=e.fileDraft,t[27]=e.fileSaving,t[28]=e.files,t[29]=e.filesLoading,t[30]=e.filesViewMode,t[31]=e.onOpenCapabilityPreset,t[32]=e.onTryInChat,t[33]=e.onUpdateAgentExtends,t[34]=e.profileEditorNonce,t[35]=e.profileFileLoading,t[36]=e.selected,t[37]=e.setActiveFile,t[38]=e.setFileDraft,t[39]=e.setFilesViewMode,t[40]=d):d=t[40];let f;return t[41]!==u||t[42]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[u,d]}),t[41]=u,t[42]=d,t[43]=f):f=t[43],f}function pn(e){let t=(0,Z.c)(79),{a:n,selected:r,busy:i,skillsCatalogLoading:a,catalogForPick:o,skillsInherit:c,setSkillsInherit:l,skillsPick:u,setSkillsPick:d,onSaveSkills:f}=e,p,m;if(t[0]!==r.skills.entry||t[1]!==c||t[2]!==u){p=[...u].toSorted(vn);let e=[...r.skills.entry??[]].toSorted(_n);m=c!==(r.skills.entry===void 0)||!c&&JSON.stringify(p)!==JSON.stringify(e),t[0]=r.skills.entry,t[1]=c,t[2]=u,t[3]=p,t[4]=m}else p=t[3],m=t[4];let h=m,v;t[5]!==p||t[6]!==c?(v={inherit:c,skills:p},t[5]=p,t[6]=c,t[7]=v):v=t[7];let y;t[8]!==h||t[9]!==f||t[10]!==v?(y={value:v,dirty:h,onSave:f,delayMs:350},t[8]=h,t[9]=f,t[10]=v,t[11]=y):y=t[11];let b=gt(y),x;t[12]===r.skills.effectiveAllowlist?x=t[13]:(x=function(e){let t=r.skills.effectiveAllowlist;return t===void 0?!0:t.length===0?!1:t.includes(e)},t[12]=r.skills.effectiveAllowlist,t[13]=x);let S=x,C;t[14]!==o||t[15]!==r.skills.effectiveAllowlist?(C=function(){let e=r.skills.effectiveAllowlist;return e===void 0?new Set(o.map(gn)):new Set(e)},t[14]=o,t[15]=r.skills.effectiveAllowlist,t[16]=C):C=t[16];let w=C,T;t[17]!==b.error||t[18]!==b.status?(T=(0,Q.jsx)(ht,{status:b.status,error:b.error}),t[17]=b.error,t[18]=b.status,t[19]=T):T=t[19];let E;t[20]!==n.skillsHint||t[21]!==n.skillsTitle||t[22]!==T?(E=(0,Q.jsx)(_t,{className:`shrink-0`,icon:st,title:n.skillsTitle,subtitle:n.skillsHint,trailing:T}),t[20]=n.skillsHint,t[21]=n.skillsTitle,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==b||t[25]!==l||t[26]!==p?(D=()=>{l(!0),b.saveNow({inherit:!0,skills:p})},t[24]=b,t[25]=l,t[26]=p,t[27]=D):D=t[27];let O;t[28]!==n.skillsInherit||t[29]!==i||t[30]!==D?(O=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,disabled:i,onClick:D,children:n.skillsInherit}),t[28]=n.skillsInherit,t[29]=i,t[30]=D,t[31]=O):O=t[31];let k;t[32]!==b||t[33]!==w||t[34]!==l||t[35]!==d?(k=()=>{l(!1);let e=w();d(e),b.saveNow({inherit:!1,skills:[...e].toSorted(hn)})},t[32]=b,t[33]=w,t[34]=l,t[35]=d,t[36]=k):k=t[36];let A;t[37]!==n.skillsCustomize||t[38]!==i||t[39]!==k?(A=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,disabled:i,onClick:k,children:n.skillsCustomize}),t[37]=n.skillsCustomize,t[38]=i,t[39]=k,t[40]=A):A=t[40];let j;t[41]!==A||t[42]!==O?(j=(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[O,A]}),t[41]=A,t[42]=O,t[43]=j):j=t[43];let M;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(M=lt(`skills`),t[44]=M):M=t[44];let N;t[45]===n.skillsLibraryLink?N=t[46]:(N=(0,Q.jsx)(s,{to:M,className:`shrink-0 text-xs font-medium text-accent-fg hover:underline`,children:n.skillsLibraryLink}),t[45]=n.skillsLibraryLink,t[46]=N);let P;t[47]!==j||t[48]!==N?(P=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-3`,children:[j,N]}),t[47]=j,t[48]=N,t[49]=P):P=t[49];let F;t[50]===r.skills.preset?F=t[51]:(F=r.skills.preset.length?r.skills.preset.join(`, `):`—`,t[50]=r.skills.preset,t[51]=F);let I;t[52]!==n.skillsPresetLabel||t[53]!==F?(I=(0,Q.jsxs)(`p`,{className:`mt-2 shrink-0 text-xs text-fg-muted`,children:[n.skillsPresetLabel,` `,F]}),t[52]=n.skillsPresetLabel,t[53]=F,t[54]=I):I=t[54];let L;t[55]!==n.skillsInherit||t[56]!==r.skills.effectiveAllowlist||t[57]!==c?(L=r.skills.effectiveAllowlist?.length?r.skills.effectiveAllowlist.join(`, `):c?n.skillsInherit:`—`,t[55]=n.skillsInherit,t[56]=r.skills.effectiveAllowlist,t[57]=c,t[58]=L):L=t[58];let R;t[59]!==n.skillsEffectiveLabel||t[60]!==L?(R=(0,Q.jsxs)(`p`,{className:`shrink-0 text-xs text-fg-muted`,children:[n.skillsEffectiveLabel,` `,L]}),t[59]=n.skillsEffectiveLabel,t[60]=L,t[61]=R):R=t[61];let z;t[62]!==n.skillsEmptyCatalog||t[63]!==n.skillsNoDescription||t[64]!==b||t[65]!==i||t[66]!==o||t[67]!==S||t[68]!==d||t[69]!==a||t[70]!==c||t[71]!==u?(z=a?(0,Q.jsx)(`div`,{className:`mt-3 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-0.5`,children:(0,Q.jsx)(pt,{rows:4})}):o.length===0?(0,Q.jsx)(`p`,{className:`shrink-0 text-sm text-fg-muted`,children:n.skillsEmptyCatalog}):(0,Q.jsx)(`div`,{className:g(`mt-3 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-0.5`,c&&`opacity-50`),children:(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2.5 text-sm`,children:o.map(e=>{let t=e.name||e.directoryId,r=c?S(t):u.has(t),a=typeof e.description==`string`?e.description.trim():``,o=a||n.skillsNoDescription;return(0,Q.jsx)(`li`,{className:`h-16 shrink-0 overflow-hidden rounded-xl bg-surface-panel/70 px-3 shadow-surface`,children:(0,Q.jsxs)(`label`,{className:`flex h-full cursor-pointer items-center gap-3 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`shrink-0 rounded border-edge`,checked:r,disabled:c||i,onChange:()=>{d(e=>{let n=new Set(e);return r?n.delete(t):n.add(t),b.saveNow({inherit:!1,skills:[...n].toSorted(mn)}),n})},"aria-label":t}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:[(0,Q.jsx)(`div`,{className:`truncate font-mono text-xs font-medium text-fg`,title:t,children:t}),(0,Q.jsx)(`p`,{className:g(`mt-0.5 truncate text-xs leading-tight text-fg-muted`,!a&&`italic text-fg-subtle`),title:o,children:o})]})]})},t)})})}),t[62]=n.skillsEmptyCatalog,t[63]=n.skillsNoDescription,t[64]=b,t[65]=i,t[66]=o,t[67]=S,t[68]=d,t[69]=a,t[70]=c,t[71]=u,t[72]=z):z=t[72];let B;return t[73]!==P||t[74]!==I||t[75]!==R||t[76]!==z||t[77]!==E?(B=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col`,children:[E,P,I,R,z]}),t[73]=P,t[74]=I,t[75]=R,t[76]=z,t[77]=E,t[78]=B):B=t[78],B}function mn(e,t){return e.localeCompare(t)}function hn(e,t){return e.localeCompare(t)}function gn(e){return e.name||e.directoryId}function _n(e,t){return e.localeCompare(t)}function vn(e,t){return e.localeCompare(t)}var yn=[`write_file`,`apply_patch`,`exec_command`],bn=[`exec_command`,`image_generate`,`extensions`],xn=[`send_message`,`send_media`];function Sn(e){let t=(0,Z.c)(87),{mode:n,builtinToolIds:r,loading:i,disableSet:a,onDisableSetChange:o,defaultsDisableSet:s,unknownDisabledIds:c,getToolDescription:l,getGroupTitle:u,labels:d,quickActionsDisabled:f}=e,p;t[0]===c?p=t[1]:(p=c===void 0?[]:c,t[0]=c,t[1]=p);let m=p,h=f===void 0?!1:f,v;t[2]===r?v=t[3]:(v=new Set(r),t[2]=r,t[3]=v);let y=v,b;t[4]===s?b=t[5]:(b=s??new Set,t[4]=s,t[5]=b);let x=b,S;t[6]!==x||t[7]!==a||t[8]!==n||t[9]!==o?(S=(e,t)=>{if(n===`agentEntry`&&t&&x.has(e))return;let r=new Set(a);t?r.delete(e):r.add(e),o(r)},t[6]=x,t[7]=a,t[8]=n,t[9]=o,t[10]=S):S=t[10];let C=S,w;t[11]!==y||t[12]!==o?(w=e=>{let t=new Set;for(let n of e)y.has(n)&&t.add(n);o(t)},t[11]=y,t[12]=o,t[13]=w):w=t[13];let T=w,E;t[14]===o?E=t[15]:(E=()=>{o(new Set)},t[14]=o,t[15]=E);let D=E,O;t[16]!==r||t[17]!==o||t[18]!==m?(O=()=>{o(new Set([...r,...m]))},t[16]=r,t[17]=o,t[18]=m,t[19]=O):O=t[19];let k=O,A;t[20]===r?A=t[21]:(A=xt(r),t[20]=r,t[21]=A);let j=A,M;if(t[22]!==y||t[23]!==j||t[24]!==n||t[25]!==m){if(M=[],n===`defaults`&&m.length>0){let e;t[27]===m?e=t[28]:(e=m.toSorted(wn),t[27]=m,t[28]=e);let n;t[29]===e?n=t[30]:(n={key:`unknown`,ids:e},t[29]=e,t[30]=n),M.push(n)}for(let e of Ct){let t=e.toolIds.filter(e=>y.has(e));t.length>0&&M.push({key:e.key,ids:[...t]})}if(j.length>0){let e;t[31]===j?e=t[32]:(e={key:`misc`,ids:j},t[31]=j,t[32]=e),M.push(e)}t[22]=y,t[23]=j,t[24]=n,t[25]=m,t[26]=M}else M=t[26];let N=M,P=N.some(Cn),F=h||i,I;t[33]===d.quickActionsLabel?I=t[34]:(I=(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:d.quickActionsLabel}),t[33]=d.quickActionsLabel,t[34]=I);let L=F||r.length===0&&m.length===0,R;t[35]!==D||t[36]!==d.quickEnableAll||t[37]!==L?(R=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:L,onClick:D,children:d.quickEnableAll}),t[35]=D,t[36]=d.quickEnableAll,t[37]=L,t[38]=R):R=t[38];let z=F||r.length===0&&m.length===0,B;t[39]!==k||t[40]!==d.quickDisableAll||t[41]!==z?(B=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:z,onClick:k,children:d.quickDisableAll}),t[39]=k,t[40]=d.quickDisableAll,t[41]=z,t[42]=B):B=t[42];let V=F||r.length===0,ee;t[43]===T?ee=t[44]:(ee=()=>T(yn),t[43]=T,t[44]=ee);let te;t[45]!==d.quickReadOnlyWorkspace||t[46]!==V||t[47]!==ee?(te=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:V,onClick:ee,children:d.quickReadOnlyWorkspace}),t[45]=d.quickReadOnlyWorkspace,t[46]=V,t[47]=ee,t[48]=te):te=t[48];let ne=F||r.length===0,re;t[49]===T?re=t[50]:(re=()=>T(bn),t[49]=T,t[50]=re);let ie;t[51]!==d.quickHighRiskOff||t[52]!==ne||t[53]!==re?(ie=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:ne,onClick:re,children:d.quickHighRiskOff}),t[51]=d.quickHighRiskOff,t[52]=ne,t[53]=re,t[54]=ie):ie=t[54];let H=F||r.length===0,U;t[55]===T?U=t[56]:(U=()=>T(xn),t[55]=T,t[56]=U);let W;t[57]!==d.quickNoOutbound||t[58]!==H||t[59]!==U?(W=(0,Q.jsx)(_,{type:`button`,variant:`secondary`,className:Dt,disabled:H,onClick:U,children:d.quickNoOutbound}),t[57]=d.quickNoOutbound,t[58]=H,t[59]=U,t[60]=W):W=t[60];let G;t[61]!==R||t[62]!==B||t[63]!==te||t[64]!==ie||t[65]!==W?(G=(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[R,B,te,ie,W]}),t[61]=R,t[62]=B,t[63]=te,t[64]=ie,t[65]=W,t[66]=G):G=t[66];let K;t[67]!==I||t[68]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[I,G]}),t[67]=I,t[68]=G,t[69]=K):K=t[69];let ae;t[70]!==x||t[71]!==a||t[72]!==u||t[73]!==l||t[74]!==N||t[75]!==P||t[76]!==d.emptyBuiltin||t[77]!==d.lockedByDefaults||t[78]!==d.notInBuiltin||t[79]!==i||t[80]!==n||t[81]!==F||t[82]!==C?(ae=i?(0,Q.jsx)(pt,{rows:4}):P?(0,Q.jsx)(`div`,{className:`max-h-[min(50vh,22rem)] overflow-y-auto overscroll-contain pr-0.5`,children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-5 pr-1`,children:N.map(e=>{let{key:t,ids:r}=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:u(t)}),(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:r.map(e=>{let r=n===`defaults`&&t===`unknown`,i=n===`agentEntry`&&x.has(e),o=a.has(e),s=i?!1:!o,c=l(e);return(0,Q.jsx)(`li`,{className:g(`rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,r&&`bg-surface-panel/50`,i&&`opacity-60`),children:(0,Q.jsxs)(`label`,{className:g(`flex gap-3 text-sm`,i?`cursor-not-allowed`:`cursor-pointer`),children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`mt-1 shrink-0 rounded border-edge`,checked:s,disabled:i||F,onChange:()=>C(e,!s)}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-xs font-medium text-fg`,children:e}),r?(0,Q.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`(`,d.notInBuiltin,`)`]}):null,i?(0,Q.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[`(`,d.lockedByDefaults,`)`]}):null]}),c?(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-fg-muted`,children:c}):null]})]})},e)})})]},t)})})}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:d.emptyBuiltin}),t[70]=x,t[71]=a,t[72]=u,t[73]=l,t[74]=N,t[75]=P,t[76]=d.emptyBuiltin,t[77]=d.lockedByDefaults,t[78]=d.notInBuiltin,t[79]=i,t[80]=n,t[81]=F,t[82]=C,t[83]=ae):ae=t[83];let oe;return t[84]!==K||t[85]!==ae?(oe=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[K,ae]}),t[84]=K,t[85]=ae,t[86]=oe):oe=t[86],oe}function Cn(e){return e.ids.length>0}function wn(e,t){return e.localeCompare(t)}function Tn(e){let t=(0,Z.c)(60),{a:n,data:r,selected:i,busy:a,toolEntryDisable:o,setToolEntryDisable:s,onSaveTools:c,onClearToolsEntry:l}=e,u=w(An),d;t[0]===u?d=t[1]:(d=S(u),t[0]=u,t[1]=d);let f=d.agentSettings.advanced,p;t[2]===i.tools.presetDenied?p=t[3]:(p=new Set(i.tools.presetDenied.flatMap(kn)),t[2]=i.tools.presetDenied,t[3]=p);let m=p,h;t[4]===o?h=t[5]:(h=[...o].toSorted(On),t[4]=o,t[5]=h);let g=h,v;t[6]===i.tools.entryDisable?v=t[7]:(v=[...i.tools.entryDisable].toSorted(Dn),t[6]=i.tools.entryDisable,t[7]=v);let y=v,b;t[8]===g?b=t[9]:(b=JSON.stringify(g),t[8]=g,t[9]=b);let x;t[10]===y?x=t[11]:(x=JSON.stringify(y),t[10]=y,t[11]=x);let C=b!==x,T;t[12]!==C||t[13]!==g||t[14]!==c?(T={value:g,dirty:C,onSave:c,delayMs:350},t[12]=C,t[13]=g,t[14]=c,t[15]=T):T=t[15];let E=gt(T),D;t[16]!==E||t[17]!==s?(D=e=>{s(e),E.saveNow([...e].toSorted(En))},t[16]=E,t[17]=s,t[18]=D):D=t[18];let O=D,k=n.toolsDisableGroups,A;t[19]===k?A=t[20]:(A=e=>k[e],t[19]=k,t[20]=A);let j=A,M;t[21]===n.toolDescriptions?M=t[22]:(M=e=>e in n.toolDescriptions?n.toolDescriptions[e]:``,t[21]=n.toolDescriptions,t[22]=M);let N=M,P;t[23]!==E.error||t[24]!==E.status?(P=(0,Q.jsx)(ht,{status:E.status,error:E.error}),t[23]=E.error,t[24]=E.status,t[25]=P):P=t[25];let F;t[26]!==n.toolsHint||t[27]!==n.toolsTitle||t[28]!==P?(F=(0,Q.jsx)(_t,{className:`shrink-0`,icon:Fe,title:n.toolsTitle,subtitle:n.toolsHint,trailing:P}),t[26]=n.toolsHint,t[27]=n.toolsTitle,t[28]=P,t[29]=F):F=t[29];let I;t[30]!==n.toolsLockedByPreset||t[31]!==f.toolsDisableEmptyBuiltin||t[32]!==f.toolsDisableLoadingBuiltin||t[33]!==f.toolsDisableNotInBuiltin||t[34]!==f.toolsDisableQuickActionsLabel||t[35]!==f.toolsDisableQuickDisableAll||t[36]!==f.toolsDisableQuickEnableAll||t[37]!==f.toolsDisableQuickHighRiskOff||t[38]!==f.toolsDisableQuickNoOutbound||t[39]!==f.toolsDisableQuickReadOnlyWorkspace?(I={loadingBuiltin:f.toolsDisableLoadingBuiltin,emptyBuiltin:f.toolsDisableEmptyBuiltin,quickActionsLabel:f.toolsDisableQuickActionsLabel,quickEnableAll:f.toolsDisableQuickEnableAll,quickDisableAll:f.toolsDisableQuickDisableAll,quickReadOnlyWorkspace:f.toolsDisableQuickReadOnlyWorkspace,quickHighRiskOff:f.toolsDisableQuickHighRiskOff,quickNoOutbound:f.toolsDisableQuickNoOutbound,notInBuiltin:f.toolsDisableNotInBuiltin,lockedByDefaults:n.toolsLockedByPreset},t[30]=n.toolsLockedByPreset,t[31]=f.toolsDisableEmptyBuiltin,t[32]=f.toolsDisableLoadingBuiltin,t[33]=f.toolsDisableNotInBuiltin,t[34]=f.toolsDisableQuickActionsLabel,t[35]=f.toolsDisableQuickDisableAll,t[36]=f.toolsDisableQuickEnableAll,t[37]=f.toolsDisableQuickHighRiskOff,t[38]=f.toolsDisableQuickNoOutbound,t[39]=f.toolsDisableQuickReadOnlyWorkspace,t[40]=I):I=t[40];let L;t[41]!==a||t[42]!==r.builtinToolIds||t[43]!==j||t[44]!==N||t[45]!==O||t[46]!==m||t[47]!==I||t[48]!==o?(L=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(Sn,{mode:`agentEntry`,builtinToolIds:r.builtinToolIds,loading:!1,disableSet:o,onDisableSetChange:O,defaultsDisableSet:m,getToolDescription:N,getGroupTitle:j,quickActionsDisabled:a,labels:I})}),t[41]=a,t[42]=r.builtinToolIds,t[43]=j,t[44]=N,t[45]=O,t[46]=m,t[47]=I,t[48]=o,t[49]=L):L=t[49];let R;t[50]===l?R=t[51]:(R=()=>void l(),t[50]=l,t[51]=R);let z;t[52]!==n.toolsClearEntry||t[53]!==a||t[54]!==R?(z=(0,Q.jsx)(`div`,{className:`mt-4 flex shrink-0 flex-wrap gap-2`,children:(0,Q.jsx)(_,{type:`button`,variant:`secondary`,disabled:a,onClick:R,children:n.toolsClearEntry})}),t[52]=n.toolsClearEntry,t[53]=a,t[54]=R,t[55]=z):z=t[55];let B;return t[56]!==F||t[57]!==L||t[58]!==z?(B=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col`,children:[F,L,z]}),t[56]=F,t[57]=L,t[58]=z,t[59]=B):B=t[59],B}function En(e,t){return e.localeCompare(t)}function Dn(e,t){return e.localeCompare(t)}function On(e,t){return e.localeCompare(t)}function kn(e){let t=String(e).trim();return t?[t]:[]}function An(e){return e.language}function jn(e){let t=(0,Z.c)(36),[n,r]=(0,$.useState)(`tools`),{a:i}=e,a;t[0]===i.capabilitiesHint?a=t[1]:(a=(0,Q.jsx)(`p`,{className:`mb-3 max-w-[70ch] text-sm leading-6 text-fg-muted`,children:i.capabilitiesHint}),t[0]=i.capabilitiesHint,t[1]=a);let o;t[2]===i.capabilitiesToolsTab?o=t[3]:(o={id:`tools`,label:i.capabilitiesToolsTab,icon:Fe},t[2]=i.capabilitiesToolsTab,t[3]=o);let s;t[4]===i.capabilitiesSkillsTab?s=t[5]:(s={id:`skills`,label:i.capabilitiesSkillsTab,icon:ke},t[4]=i.capabilitiesSkillsTab,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=[o,s],t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;t[9]!==i.capabilitiesNavAria||t[10]!==n||t[11]!==c?(l=(0,Q.jsx)(yt,{items:c,activeTab:n,onChange:r,ariaLabel:i.capabilitiesNavAria,tabIdPrefix:`agent-capabilities-tab`,panelIdPrefix:`agent-capabilities-panel`}),t[9]=i.capabilitiesNavAria,t[10]=n,t[11]=c,t[12]=l):l=t[12];let u;t[13]!==a||t[14]!==l?(u=(0,Q.jsxs)(`div`,{className:`shrink-0`,children:[a,l]}),t[13]=a,t[14]=l,t[15]=u):u=t[15];let d;t[16]!==i||t[17]!==n||t[18]!==e.busy||t[19]!==e.catalogForPick||t[20]!==e.data||t[21]!==e.onClearToolsEntry||t[22]!==e.onSaveSkills||t[23]!==e.onSaveTools||t[24]!==e.selected||t[25]!==e.setSkillsInherit||t[26]!==e.setSkillsPick||t[27]!==e.setToolEntryDisable||t[28]!==e.skillsCatalogLoading||t[29]!==e.skillsInherit||t[30]!==e.skillsPick||t[31]!==e.toolEntryDisable?(d=n===`tools`?(0,Q.jsx)(Tn,{a:i,data:e.data,selected:e.selected,busy:e.busy,toolEntryDisable:e.toolEntryDisable,setToolEntryDisable:e.setToolEntryDisable,onSaveTools:e.onSaveTools,onClearToolsEntry:e.onClearToolsEntry}):(0,Q.jsx)(pn,{a:i,selected:e.selected,busy:e.busy,skillsCatalogLoading:e.skillsCatalogLoading,catalogForPick:e.catalogForPick,skillsInherit:e.skillsInherit,setSkillsInherit:e.setSkillsInherit,skillsPick:e.skillsPick,setSkillsPick:e.setSkillsPick,onSaveSkills:e.onSaveSkills}),t[16]=i,t[17]=n,t[18]=e.busy,t[19]=e.catalogForPick,t[20]=e.data,t[21]=e.onClearToolsEntry,t[22]=e.onSaveSkills,t[23]=e.onSaveTools,t[24]=e.selected,t[25]=e.setSkillsInherit,t[26]=e.setSkillsPick,t[27]=e.setToolEntryDisable,t[28]=e.skillsCatalogLoading,t[29]=e.skillsInherit,t[30]=e.skillsPick,t[31]=e.toolEntryDisable,t[32]=d):d=t[32];let f;return t[33]!==u||t[34]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden`,children:[u,d]}),t[33]=u,t[34]=d,t[35]=f):f=t[35],f}var Mn=g(v,`w-full text-xs sm:w-auto sm:min-w-[11rem] sm:max-w-[17rem] sm:shrink-0`);function Nn(e){let t=(0,Z.c)(59),{a:n,busy:r,bindingsLoading:i,agentBindings:a,onRemoveBinding:o,onAddBinding:s,channelStatuses:c,channelsStatusLoading:l,useManualChannel:u,newBindChannel:f,setNewBindChannel:m,bindSessionChats:h,sessionsLoading:v,newBindSessionIdx:y,setNewBindSessionIdx:b,newBindCustomPeer:x,setNewBindCustomPeer:S,onRefreshSessions:C,lastActiveLabels:w,selectRecipient:T}=e,E=!l&&(u||c.length>0),D;t[0]!==n.channelsHint||t[1]!==n.channelsTitle?(D=(0,Q.jsx)(_t,{className:`shrink-0`,icon:at,title:n.channelsTitle,subtitle:n.channelsHint}),t[0]=n.channelsHint,t[1]=n.channelsTitle,t[2]=D):D=t[2];let O;t[3]!==n.channelsNone||t[4]!==n.removeBinding||t[5]!==a||t[6]!==i||t[7]!==r||t[8]!==o?(O=i?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-busy":`true`,children:Array.from({length:2}).map(Pn)}):a.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.channelsNone}):(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2 text-sm`,children:a.map(e=>(0,Q.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg border border-edge bg-surface-panel px-3 py-2`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-xs`,children:cn(e.match)}),(0,Q.jsx)(_,{type:`button`,variant:`secondary`,disabled:r,onClick:()=>void o(e),children:n.removeBinding})]},`${e.match.channel}-${cn(e.match)}`))}),t[3]=n.channelsNone,t[4]=n.removeBinding,t[5]=a,t[6]=i,t[7]=r,t[8]=o,t[9]=O):O=t[9];let k;t[10]!==n.channelLabel||t[11]!==n.channelsDisabledSuffix||t[12]!==n.channelsManualChannelHint||t[13]!==c||t[14]!==l||t[15]!==f||t[16]!==m||t[17]!==S||t[18]!==b||t[19]!==u?(k=l?(0,Q.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,Q.jsx)(q,{className:`h-4 w-24`}),(0,Q.jsx)(q,{className:`h-10 w-full rounded-lg`})]}):u?(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelLabel}),(0,Q.jsx)(`input`,{className:sn(),value:f,onChange:e=>m(e.target.value),placeholder:`telegram`,autoComplete:`off`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsManualChannelHint})]}):(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelLabel}),(0,Q.jsx)(d,{className:g(sn(),`py-2`),value:f,onChange:e=>{m(e.target.value),b(null),S(``)},children:c.map(e=>(0,Q.jsxs)(p,{value:e.name,disabled:!e.enabled,children:[e.name,` `,e.enabled?``:n.channelsDisabledSuffix]},e.name))})]}),t[10]=n.channelLabel,t[11]=n.channelsDisabledSuffix,t[12]=n.channelsManualChannelHint,t[13]=c,t[14]=l,t[15]=f,t[16]=m,t[17]=S,t[18]=b,t[19]=u,t[20]=k):k=t[20];let A;t[21]!==n.channelsCustomPeerHint||t[22]!==n.channelsCustomPeerPlaceholder||t[23]!==n.channelsNoSessionsHint||t[24]!==n.channelsPeerAny||t[25]!==n.channelsPeerFromSessions||t[26]!==n.channelsRefreshSessions||t[27]!==n.channelsRefreshSessionsHint||t[28]!==n.channelsSessionLabel||t[29]!==n.peerIdLabel||t[30]!==h||t[31]!==r||t[32]!==w||t[33]!==f||t[34]!==x||t[35]!==y||t[36]!==C||t[37]!==T||t[38]!==v||t[39]!==S||t[40]!==b||t[41]!==E?(A=E&&f.trim()?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-edge-subtle pt-3 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelsSessionLabel}),(0,Q.jsxs)(_,{type:`button`,variant:`ghost`,className:`h-7 gap-1 px-2 text-xs`,disabled:r||v||!f.trim(),title:n.channelsRefreshSessionsHint,onClick:()=>C(),children:[(0,Q.jsx)(fe,{className:g(`size-3.5`,v&&`animate-spin`),strokeWidth:1.75}),n.channelsRefreshSessions]})]}),v&&h.length===0?(0,Q.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,Q.jsx)(q,{className:`h-4 w-32`}),(0,Q.jsx)(q,{className:`h-10 w-full rounded-lg`})]}):null,(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.channelsPeerFromSessions}),(0,Q.jsxs)(d,{className:g(sn(),`py-2`),value:y==null?``:String(y),disabled:r||!f.trim()||!!x.trim(),onChange:e=>{let t=e.target.value;b(t===``?null:Number(t))},children:[(0,Q.jsx)(p,{value:``,children:n.channelsPeerAny}),h.map((e,t)=>(0,Q.jsx)(p,{value:String(t),children:Mt(e,w)},`${e.channel}-${e.chatId}`))]})]}),h.length===0&&f.trim()&&!v?(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsNoSessionsHint}):null,(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-fg-muted`,children:n.peerIdLabel}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-stretch sm:gap-2`,children:[(0,Q.jsx)(`input`,{type:`text`,className:g(sn(),`min-w-0 w-full sm:flex-1`),value:x,onChange:e=>{S(e.target.value),e.target.value.trim()&&b(null)},placeholder:n.channelsCustomPeerPlaceholder,autoComplete:`off`}),(0,Q.jsxs)(d,{className:Mn,value:x,onChange:e=>{let t=e.target.value;S(t||``),b(null)},children:[(0,Q.jsx)(p,{value:``,children:T}),h.map(e=>(0,Q.jsx)(p,{value:e.chatId,children:Mt(e,w)},`${e.channel}-${e.chatId}`))]})]}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.channelsCustomPeerHint})]})]}):null,t[21]=n.channelsCustomPeerHint,t[22]=n.channelsCustomPeerPlaceholder,t[23]=n.channelsNoSessionsHint,t[24]=n.channelsPeerAny,t[25]=n.channelsPeerFromSessions,t[26]=n.channelsRefreshSessions,t[27]=n.channelsRefreshSessionsHint,t[28]=n.channelsSessionLabel,t[29]=n.peerIdLabel,t[30]=h,t[31]=r,t[32]=w,t[33]=f,t[34]=x,t[35]=y,t[36]=C,t[37]=T,t[38]=v,t[39]=S,t[40]=b,t[41]=E,t[42]=A):A=t[42];let j;t[43]!==r||t[44]!==l||t[45]!==f?(j=r||!f.trim()||l,t[43]=r,t[44]=l,t[45]=f,t[46]=j):j=t[46];let M;t[47]!==n.addBinding||t[48]!==j?(M=(0,Q.jsx)(`div`,{children:(0,Q.jsx)(_,{type:`submit`,disabled:j,children:n.addBinding})}),t[47]=n.addBinding,t[48]=j,t[49]=M):M=t[49];let N;t[50]!==s||t[51]!==k||t[52]!==A||t[53]!==M?(N=(0,Q.jsxs)(`form`,{className:`mt-4 flex flex-col gap-3`,onSubmit:s,children:[k,A,M]}),t[50]=s,t[51]=k,t[52]=A,t[53]=M,t[54]=N):N=t[54];let P;return t[55]!==D||t[56]!==O||t[57]!==N?(P=(0,Q.jsxs)(vt,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:[D,O,N]}),t[55]=D,t[56]=O,t[57]=N,t[58]=P):P=t[58],P}function Pn(e,t){return(0,Q.jsx)(q,{className:`h-10 rounded-lg`},t)}function Fn(e,t){switch(e){case`adventurer`:return t.avatarStyleAdventurer;case`bottts`:return t.avatarStyleRobot;case`lorelei`:return t.avatarStyleLorelei;case`thumbs`:return t.avatarStyleThumbs;case`fun-emoji`:return t.avatarStyleFunEmoji;default:return e}}function In(e){let{agentId:t,value:n,onChange:r,a:i,id:a}=e,o=(0,$.useRef)(null),[s,u]=(0,$.useState)(!1),[d,p]=(0,$.useState)(null),[h,v]=(0,$.useState)(!1),y=(0,$.useMemo)(()=>{let e=Re(n.trim());return e&&We(e.styleId)?e.styleId:$e[0]??`adventurer`},[n]),x=(0,$.useCallback)(async(e,n)=>{try{await pe(t)}catch{}r(X(e,n)),v(!1)},[t,r]),S=(0,$.useCallback)(async e=>{let n=e.target.files?.[0];if(e.target.value=``,n){p(null),u(!0);try{await Me(t,n),Ze(t),r(Xe)}catch(e){let t=e instanceof Error?e.message:``;p(t===`avatar_too_large`?i.avatarTooLarge:t===`unsupported_image_type`||t===`empty_file`?i.avatarInvalidImage:i.avatarUploadFailed)}finally{u(!1)}}},[i,t,r]),C=(e,t)=>{let r=Re(n.trim());return!!(r&&r.styleId===e&&r.seed===t)};return(0,Q.jsxs)(`div`,{...a?{id:a}:{},className:`flex flex-col gap-3 sm:col-span-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:i.avatarPickerTitle}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`input`,{ref:o,type:`file`,accept:`image/png,image/jpeg,image/webp,.png,.jpg,.jpeg,.webp`,className:`hidden`,onChange:e=>void S(e)}),(0,Q.jsxs)(_,{type:`button`,variant:`secondary`,className:`gap-1.5 px-2.5 py-1.5 text-xs`,disabled:s,onClick:()=>o.current?.click(),children:[(0,Q.jsx)(ze,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),s?i.avatarUploading:i.avatarUploadCustom]})]})]}),d?(0,Q.jsx)(`p`,{className:`text-xs text-red-600 dark:text-red-400`,children:d}):null,(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:$e.map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void x(e,He[0]??t),className:g(`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,b.press,y===e?`border-fg bg-fg text-surface-base`:`border-edge-subtle bg-surface-panel text-fg hover:border-edge`),children:Fn(e,i)},e))}),(0,Q.jsxs)(`div`,{className:`rounded-xl border border-edge-subtle bg-surface-panel/50 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[He.map(e=>(0,Q.jsx)(`button`,{type:`button`,title:e,onClick:()=>void x(y,e),className:g(`flex size-12 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,b.press,C(y,e)?`border-accent ring-2 ring-accent/30`:`border-transparent hover:border-edge`),children:(0,Q.jsx)(`img`,{src:bt(y,e,96),alt:``,width:44,height:44,className:`size-11 rounded-full object-cover`,draggable:!1})},e)),(0,Q.jsxs)(l,{open:h,onOpenChange:v,children:[(0,Q.jsx)(f,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:g(`flex size-12 shrink-0 items-center justify-center rounded-xl border border-edge-subtle bg-surface-base text-xs font-medium text-fg-muted hover:border-edge hover:text-fg`,b.press),children:i.avatarMore})}),(0,Q.jsx)(c,{children:(0,Q.jsxs)(m,{className:`z-[80] max-h-72 w-[min(22rem,calc(100vw-2rem))] overflow-y-auto rounded-xl border border-edge-subtle bg-surface-panel p-3 shadow-lg`,sideOffset:6,align:`end`,children:[(0,Q.jsx)(`p`,{className:`mb-2 text-xs font-medium text-fg-muted`,children:Fn(y,i)}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:re.map(e=>(0,Q.jsx)(`button`,{type:`button`,title:e,onClick:()=>void x(y,e),className:g(`flex size-11 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,b.press,C(y,e)?`border-accent ring-2 ring-accent/30`:`border-transparent hover:border-edge`),children:(0,Q.jsx)(`img`,{src:bt(y,e,88),alt:``,width:40,height:40,className:`size-10 rounded-full object-cover`,draggable:!1})},e))})]})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:i.personaAvatar}),(0,Q.jsx)(xe,{agentId:t,avatar:n,size:40}),n.trim()&&!Re(n.trim())&&n.trim()!==`xopc:custom`?(0,Q.jsx)(`span`,{className:`truncate font-mono text-[10px] text-fg-muted`,title:n,children:n}):null]})]})]})}var Ln={name:``,description:``,language:``,creature:``,emoji:``,avatar:``};function Rn(e){let t={...Ln};if(!e.trim())return t;let n={name:`name`,description:`description`,language:`language`,creature:`creature`,emoji:`emoji`,avatar:`avatar`};for(let r of e.split(`
|
|
2
2
|
`)){let e=r.match(/^[-*]\s+\*\*(\w+):\*\*\s*(.*)/i);if(!e)continue;let i=n[e[1].toLowerCase()];if(!i)continue;let a=e[2].trim();/^_\(.*\)_$/.test(a)&&(a=``),t[i]=a}return t}function zn(e){return[`# IDENTITY.md - Who Am I?`,``,`- **Name:** ${e.name}`,`- **Description:** ${e.description}`,`- **Language:** ${e.language}`,`- **Creature:** ${e.creature}`,`- **Emoji:** ${e.emoji}`,`- **Avatar:** ${e.avatar}`,``].join(`
|
|
3
3
|
`)}var Bn=[{id:`professional`,labelEn:`Professional & Efficient`,labelZh:`专业高效`,emoji:`🎯`,content:`# SOUL.md - Who You Are
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./copy-Dv6d4Dvw.js";import{t as a}from"./cn-JdwAhgNB.js";import{t as o}from"./button-CSEbl4zT.js";import{n as s}from"./interaction-BmQogeqz.js";import{t as c}from"./copy-to-clipboard-HOJ79TWv.js";import{t as l}from"./messages-D7kOD_o_.js";import{n as u,r as d,s as f}from"./locale-store-CnamlR07.js";import{i as p,o as m}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{a as h,i as g,o as _,r as v,s as y,t as b}from"./dist-BPoKqzeH.js";import{i as x}from"./vendor-swr-BIWyz7Rc.js";import{r as S}from"./settings-form-draft-Dy10ldo8.js";import{Na as C,Po as w,tc as T}from"./index-DRrjYYzZ.js";import{n as E,r as D}from"./settings-page-layout-BRQNel6r.js";import{t as O}from"./settings-loading-skeleton-zwibve4m.js";import{r as k,t as A}from"./settings-form-section-C7w2WS-A.js";var j=n(),M=e(t(),1),N=r();function P(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function F(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function I(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var L={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function R({api:e,messages:t,embedded:n=!0}){let[r,l]=(0,M.useReducer)(S,L),{info:u,loadError:d,actionError:f,copiedField:x,clearDialogOpen:C,clearConfirmChecked:w,clearConfirmText:E,uninstallDialogOpen:D,removeUserDataOnUninstall:k,busy:j}=r,R=(0,M.useCallback)(async()=>{if(e?.getUninstallInfo){l({type:`patch`,patch:{loadError:null}});try{l({type:`patch`,patch:{info:await e.getUninstallInfo()}})}catch(e){l({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,M.useEffect)(()=>{R()},[R]);let z=async(e,n)=>{if(await c(e)){l({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>l({type:`patch`,patch:{copiedField:null}}),2e3);return}l({type:`patch`,patch:{actionError:t.copyFailed}})},B=async()=>{if(e?.clearUserData){l({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||l({type:`patch`,patch:{actionError:F(n.error,t.errors)}})}catch(e){l({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{l({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},V=async()=>{if(e?.uninstallApp){l({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:k});n.ok||l({type:`patch`,patch:{actionError:F(n.error,t.errors)}})}catch(e){l({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{l({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(d)return(0,N.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:d});if(!u)return(0,N.jsx)(O,{rows:2});let H=!u.packaged,U=j||u.pendingUpdate||H,W=!H&&u.uninstallMode!==`unsupported`,G=I(u,t),K=w&&E.trim()===t.clearDataConfirmPhrase;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(A,{children:[n?(0,N.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,N.jsx)(T,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,f?(0,N.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:f}):null,H?(0,N.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,u.pendingUpdate?(0,N.jsx)(`p`,{className:`mb-3 rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,N.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,N.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,N.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,N.jsx)(`code`,{className:`break-all text-xs text-fg`,children:u.appPath}),(0,N.jsxs)(`button`,{type:`button`,className:a(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,s.press),onClick:()=>void z(u.appPath,`app`),children:[(0,N.jsx)(i,{className:`size-3`,"aria-hidden":!0}),x===`app`?t.copied:t.copyPath]})]})]}),(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,N.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,N.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,N.jsx)(`code`,{className:`break-all text-xs text-fg`,children:u.dataPath}),(0,N.jsxs)(`button`,{type:`button`,className:a(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,s.press),onClick:()=>void z(u.dataPath,`data`),children:[(0,N.jsx)(i,{className:`size-3`,"aria-hidden":!0}),x===`data`?t.copied:t.copyPath]})]}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,P(u.dataSizeBytes,t.dataSizeUnknown)]}),(0,N.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,N.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,N.jsx)(`button`,{type:`button`,disabled:U,className:a(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,s.press),onClick:()=>{l({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),W?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,N.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:G})]}),(0,N.jsx)(`button`,{type:`button`,disabled:U,className:a(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,s.press),onClick:()=>{l({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,N.jsx)(b,{open:C,onOpenChange:e=>{e||l({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,N.jsxs)(_,{children:[(0,N.jsx)(h,{className:a(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,m)}),(0,N.jsxs)(v,{className:a(`fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,p,`rounded-2xl border border-edge bg-surface-panel p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,N.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,N.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:w,onChange:e=>l({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,N.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,N.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,N.jsx)(`input`,{id:`clear-data-confirm`,type:`text`,autoComplete:`off`,spellCheck:!1,className:a(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:E,onChange:e=>l({type:`patch`,patch:{clearConfirmText:e.target.value}})}),(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]}),(0,N.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,N.jsx)(o,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>{l({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,N.jsx)(o,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:j||!K,onClick:()=>void B(),children:t.confirmClear})]})]})]})}),W?(0,N.jsx)(b,{open:D,onOpenChange:e=>{e||l({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,N.jsxs)(_,{children:[(0,N.jsx)(h,{className:a(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,m)}),(0,N.jsxs)(v,{className:a(`fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,p,`rounded-2xl border border-edge bg-surface-panel p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,N.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:G}),(0,N.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:k,onChange:e=>l({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,N.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),k?(0,N.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,N.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,N.jsx)(o,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>l({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,N.jsx)(o,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:j,onClick:()=>void V(),children:t.confirmUninstall})]})]})]})}):null]})}async function z(){return(await f(d(`/api/migrations/status`))).payload}async function B(){await f(d(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function V({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=x(`settings-migration-status`,z,{refreshInterval:0,revalidateOnFocus:!1}),[a,s]=(0,M.useState)(!1),[c,l]=(0,M.useState)(null);async function u(){s(!0),l(null);try{await B(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}}if(r)return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,"aria-busy":`true`,children:[(0,N.jsx)(C,{className:`h-5 w-40 max-w-full`}),(0,N.jsx)(C,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let d=t?.items??[],f=d.filter(e=>e.status===`conflict`||e.status===`error`),p=d.filter(e=>e.safety===`auto`&&e.status===`planned`),m=f.length>0||d.some(e=>e.safety!==`auto`);return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:d.length===0?e.upToDate:m?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(p.length))})]}),p.length>0&&!m?(0,N.jsx)(o,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void u(),disabled:a,children:a?e.applying:e.apply}):null]}),d.length>0?(0,N.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-base px-3 py-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,N.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,N.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,c?(0,N.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:c}):null]})}function H(){let e=(0,j.c)(28),t=u(U),n;e[0]===t?n=e[1]:(n=l(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,a=typeof window<`u`?window.electronAPI?.system:void 0;if(!w()||!a){let t;e[2]===i.title?t=e[3]:(t=(0,N.jsx)(E,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,N.jsx)(V,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=k(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,N.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,N.jsxs)(D,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let o;e[18]===i.title?o=e[19]:(o=(0,N.jsx)(E,{title:i.title}),e[18]=i.title,e[19]=o);let s;e[20]===i.migrations?s=e[21]:(s=(0,N.jsx)(V,{messages:i.migrations}),e[20]=i.migrations,e[21]=s);let c;e[22]===i?c=e[23]:(c=(0,N.jsx)(R,{api:a,messages:i,embedded:!1}),e[22]=i,e[23]=c);let d;return e[24]!==o||e[25]!==s||e[26]!==c?(d=(0,N.jsxs)(D,{gap:`gap-6`,children:[o,s,c]}),e[24]=o,e[25]=s,e[26]=c,e[27]=d):d=e[27],d}function U(e){return e.language}export{H as AppManagementSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./copy-Dv6d4Dvw.js";import{t as a}from"./cn-JdwAhgNB.js";import{t as o}from"./button-CSEbl4zT.js";import{n as s}from"./interaction-BmQogeqz.js";import{t as c}from"./copy-to-clipboard-HOJ79TWv.js";import{t as l}from"./messages-D7kOD_o_.js";import{n as u,r as d,s as f}from"./locale-store-CnamlR07.js";import{i as p,o as m}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{a as h,i as g,o as _,r as v,s as y,t as b}from"./dist-BPoKqzeH.js";import{i as x}from"./vendor-swr-BIWyz7Rc.js";import{r as S}from"./settings-form-draft-Dy10ldo8.js";import{Na as C,Po as w,tc as T}from"./index-CKSplmFw.js";import{n as E,r as D}from"./settings-page-layout-BRQNel6r.js";import{t as O}from"./settings-loading-skeleton-Bqi7tsXj.js";import{r as k,t as A}from"./settings-form-section-Dr4Uf_CY.js";var j=n(),M=e(t(),1),N=r();function P(e,t){return e==null?t:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function F(e,t){return e===`PENDING_UPDATE`?t.pendingUpdate??t.generic:e===`UNINSTALLER_NOT_FOUND`?t.uninstallerNotFound??t.generic:e===`NOT_PACKAGED`?t.notPackaged??t.generic:t.generic}function I(e,t){if(e.platform===`darwin`)return t.uninstallDescDarwin;if(e.platform===`win32`)return t.uninstallDescWin;if(e.platform===`linux`){if(e.linuxPackageKind===`appimage`)return t.uninstallDescLinuxAppImage;if(e.linuxPackageKind===`deb`){let n=e.linuxDebPackageName??`xopc`;return t.uninstallDescLinuxDeb.replace(/\{\{package\}\}/g,n)}return t.uninstallDescLinuxUnknown}return t.uninstallDescLinuxUnknown}var L={info:null,loadError:null,actionError:null,copiedField:null,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``,uninstallDialogOpen:!1,removeUserDataOnUninstall:!1,busy:!1};function R({api:e,messages:t,embedded:n=!0}){let[r,l]=(0,M.useReducer)(S,L),{info:u,loadError:d,actionError:f,copiedField:x,clearDialogOpen:C,clearConfirmChecked:w,clearConfirmText:E,uninstallDialogOpen:D,removeUserDataOnUninstall:k,busy:j}=r,R=(0,M.useCallback)(async()=>{if(e?.getUninstallInfo){l({type:`patch`,patch:{loadError:null}});try{l({type:`patch`,patch:{info:await e.getUninstallInfo()}})}catch(e){l({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}}},[e]);(0,M.useEffect)(()=>{R()},[R]);let z=async(e,n)=>{if(await c(e)){l({type:`patch`,patch:{actionError:null,copiedField:n}}),window.setTimeout(()=>l({type:`patch`,patch:{copiedField:null}}),2e3);return}l({type:`patch`,patch:{actionError:t.copyFailed}})},B=async()=>{if(e?.clearUserData){l({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.clearUserData();n.ok||l({type:`patch`,patch:{actionError:F(n.error,t.errors)}})}catch(e){l({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{l({type:`patch`,patch:{busy:!1,clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})}}},V=async()=>{if(e?.uninstallApp){l({type:`patch`,patch:{busy:!0,actionError:null}});try{let n=await e.uninstallApp({removeUserData:k});n.ok||l({type:`patch`,patch:{actionError:F(n.error,t.errors)}})}catch(e){l({type:`patch`,patch:{actionError:e instanceof Error?e.message:t.errors.generic}})}finally{l({type:`patch`,patch:{busy:!1,uninstallDialogOpen:!1}})}}};if(d)return(0,N.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:d});if(!u)return(0,N.jsx)(O,{rows:2});let H=!u.packaged,U=j||u.pendingUpdate||H,W=!H&&u.uninstallMode!==`unsupported`,G=I(u,t),K=w&&E.trim()===t.clearDataConfirmPhrase;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(A,{children:[n?(0,N.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,N.jsx)(T,{className:`size-4 text-accent`,strokeWidth:1.75}),t.title]}):null,f?(0,N.jsx)(`p`,{className:`mb-3 text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:f}):null,H?(0,N.jsxs)(`div`,{className:`mb-4 rounded-xl bg-surface-panel/70 px-3 py-2.5 shadow-surface`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.devOnlyTitle}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.devOnlyBody})]}):null,u.pendingUpdate?(0,N.jsx)(`p`,{className:`mb-3 rounded-xl border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-200`,children:t.pendingUpdateBlocked}):null,(0,N.jsxs)(`dl`,{className:`space-y-3 text-sm`,children:[(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,N.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.appPath}),(0,N.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,N.jsx)(`code`,{className:`break-all text-xs text-fg`,children:u.appPath}),(0,N.jsxs)(`button`,{type:`button`,className:a(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,s.press),onClick:()=>void z(u.appPath,`app`),children:[(0,N.jsx)(i,{className:`size-3`,"aria-hidden":!0}),x===`app`?t.copied:t.copyPath]})]})]}),(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,children:[(0,N.jsx)(`dt`,{className:`text-xs font-medium text-fg-muted`,children:t.dataPath}),(0,N.jsxs)(`dd`,{className:`mt-1 flex items-start justify-between gap-2`,children:[(0,N.jsx)(`code`,{className:`break-all text-xs text-fg`,children:u.dataPath}),(0,N.jsxs)(`button`,{type:`button`,className:a(`inline-flex shrink-0 items-center gap-1 rounded-lg border border-edge px-2 py-1 text-xs text-fg hover:bg-surface-hover`,s.press),onClick:()=>void z(u.dataPath,`data`),children:[(0,N.jsx)(i,{className:`size-3`,"aria-hidden":!0}),x===`data`?t.copied:t.copyPath]})]}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[t.dataSize,`: `,P(u.dataSizeBytes,t.dataSizeUnknown)]}),(0,N.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-amber-800 dark:text-amber-200`,children:t.sharedDataWarning})]})]}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.clearData}),(0,N.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:t.clearDataDesc})]}),(0,N.jsx)(`button`,{type:`button`,disabled:U,className:a(`inline-flex shrink-0 items-center justify-center rounded-lg border border-danger/40 bg-danger px-3 py-1.5 text-sm font-medium text-white hover:bg-danger/90 disabled:opacity-50`,s.press),onClick:()=>{l({type:`patch`,patch:{clearConfirmChecked:!1,clearConfirmText:``,clearDialogOpen:!0}})},children:t.clearData})]}),W?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.uninstall}),(0,N.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:G})]}),(0,N.jsx)(`button`,{type:`button`,disabled:U,className:a(`inline-flex shrink-0 items-center justify-center rounded-lg border border-edge bg-surface-base px-3 py-1.5 text-sm font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,s.press),onClick:()=>{l({type:`patch`,patch:{removeUserDataOnUninstall:!1,uninstallDialogOpen:!0}})},children:t.uninstall})]}):null]})]}),(0,N.jsx)(b,{open:C,onOpenChange:e=>{e||l({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:(0,N.jsxs)(_,{children:[(0,N.jsx)(h,{className:a(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,m)}),(0,N.jsxs)(v,{className:a(`fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,p,`rounded-2xl border border-edge bg-surface-panel p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.clearDataConfirmTitle}),(0,N.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:t.clearDataConfirmDesc}),(0,N.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:w,onChange:e=>l({type:`patch`,patch:{clearConfirmChecked:e.target.checked}})}),(0,N.jsx)(`span`,{children:t.clearDataConfirmCheckbox})]}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,N.jsx)(`label`,{className:`block text-sm font-medium text-fg`,htmlFor:`clear-data-confirm`,children:t.clearDataConfirmLabel}),(0,N.jsx)(`input`,{id:`clear-data-confirm`,type:`text`,autoComplete:`off`,spellCheck:!1,className:a(`w-full rounded-md border border-edge bg-surface-panel px-3 py-1.5 font-mono text-xs text-fg`,`placeholder:text-fg-subtle`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface-panel`,`dark:border-edge`),placeholder:t.clearDataConfirmPhrase,value:E,onChange:e=>l({type:`patch`,patch:{clearConfirmText:e.target.value}})}),(0,N.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.clearDataConfirmHint})]}),(0,N.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,N.jsx)(o,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>{l({type:`patch`,patch:{clearDialogOpen:!1,clearConfirmChecked:!1,clearConfirmText:``}})},children:t.cancel}),(0,N.jsx)(o,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:j||!K,onClick:()=>void B(),children:t.confirmClear})]})]})]})}),W?(0,N.jsx)(b,{open:D,onOpenChange:e=>{e||l({type:`patch`,patch:{uninstallDialogOpen:!1}})},children:(0,N.jsxs)(_,{children:[(0,N.jsx)(h,{className:a(`xopc-dialog-overlay fixed inset-0 bg-scrim backdrop-blur-[1px]`,m)}),(0,N.jsxs)(v,{className:a(`fixed left-1/2 top-1/2 w-[min(100%-2rem,28rem)] -translate-x-1/2 -translate-y-1/2`,p,`rounded-2xl border border-edge bg-surface-panel p-6 shadow-popover outline-none dark:border-edge`),onOpenAutoFocus:e=>e.preventDefault(),children:[(0,N.jsx)(y,{className:`text-base font-semibold text-fg`,children:t.uninstallConfirmTitle}),(0,N.jsx)(g,{className:`mt-2 text-sm text-fg-muted`,children:G}),(0,N.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 text-sm text-fg`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox mt-0.5`,checked:k,onChange:e=>l({type:`patch`,patch:{removeUserDataOnUninstall:e.target.checked}})}),(0,N.jsx)(`span`,{children:t.removeUserDataCheckbox})]}),k?(0,N.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:t.clearDataConfirmDesc}):null,(0,N.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,N.jsx)(o,{type:`button`,variant:`secondary`,disabled:j,onClick:()=>l({type:`patch`,patch:{uninstallDialogOpen:!1}}),children:t.cancel}),(0,N.jsx)(o,{type:`button`,variant:`secondary`,className:`border-danger/40 bg-danger text-white hover:bg-danger/90 dark:border-danger/40`,disabled:j,onClick:()=>void V(),children:t.confirmUninstall})]})]})]})}):null]})}async function z(){return(await f(d(`/api/migrations/status`))).payload}async function B(){await f(d(`/api/migrations/apply`),{method:`POST`,body:`{}`})}function V({messages:e}){let{data:t,error:n,isLoading:r,mutate:i}=x(`settings-migration-status`,z,{refreshInterval:0,revalidateOnFocus:!1}),[a,s]=(0,M.useState)(!1),[c,l]=(0,M.useState)(null);async function u(){s(!0),l(null);try{await B(),await i(),window.dispatchEvent(new CustomEvent(`config-reload`))}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(!1)}}if(r)return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,"aria-busy":`true`,children:[(0,N.jsx)(C,{className:`h-5 w-40 max-w-full`}),(0,N.jsx)(C,{className:`mt-2 h-4 w-64 max-w-full`})]});if(n)return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:e.checkFailed})]});let d=t?.items??[],f=d.filter(e=>e.status===`conflict`||e.status===`error`),p=d.filter(e=>e.safety===`auto`&&e.status===`planned`),m=f.length>0||d.some(e=>e.safety!==`auto`);return(0,N.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:d.length===0?e.upToDate:m?e.manualAttention:e.safeRepairs.replace(`{{count}}`,String(p.length))})]}),p.length>0&&!m?(0,N.jsx)(o,{type:`button`,variant:`primary`,className:`px-3 py-1.5 text-xs`,onClick:()=>void u(),disabled:a,children:a?e.applying:e.apply}):null]}),d.length>0?(0,N.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,N.jsxs)(`div`,{className:`rounded-xl bg-surface-base px-3 py-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,N.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.title}),(0,N.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-[11px] uppercase tracking-wide text-fg-muted`,children:e.status})]}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:e.message})]},e.id))}):null,c?(0,N.jsx)(`p`,{className:`mt-3 text-sm text-red-500`,children:c}):null]})}function H(){let e=(0,j.c)(28),t=u(U),n;e[0]===t?n=e[1]:(n=l(t),e[0]=t,e[1]=n);let r=n.systemSettings,i=r.desktopApp,a=typeof window<`u`?window.electronAPI?.system:void 0;if(!w()||!a){let t;e[2]===i.title?t=e[3]:(t=(0,N.jsx)(E,{title:i.title}),e[2]=i.title,e[3]=t);let n;e[4]===i.migrations?n=e[5]:(n=(0,N.jsx)(V,{messages:i.migrations}),e[4]=i.migrations,e[5]=n);let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=k(),e[6]=a):a=e[6];let o;e[7]===r.desktopOnlyTitle?o=e[8]:(o=(0,N.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.desktopOnlyTitle}),e[7]=r.desktopOnlyTitle,e[8]=o);let s;e[9]===r.desktopOnlyBody?s=e[10]:(s=(0,N.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:r.desktopOnlyBody}),e[9]=r.desktopOnlyBody,e[10]=s);let c;e[11]!==o||e[12]!==s?(c=(0,N.jsxs)(`div`,{className:a,children:[o,s]}),e[11]=o,e[12]=s,e[13]=c):c=e[13];let l;return e[14]!==t||e[15]!==n||e[16]!==c?(l=(0,N.jsxs)(D,{gap:`gap-3`,children:[t,n,c]}),e[14]=t,e[15]=n,e[16]=c,e[17]=l):l=e[17],l}let o;e[18]===i.title?o=e[19]:(o=(0,N.jsx)(E,{title:i.title}),e[18]=i.title,e[19]=o);let s;e[20]===i.migrations?s=e[21]:(s=(0,N.jsx)(V,{messages:i.migrations}),e[20]=i.migrations,e[21]=s);let c;e[22]===i?c=e[23]:(c=(0,N.jsx)(R,{api:a,messages:i,embedded:!1}),e[22]=i,e[23]=c);let d;return e[24]!==o||e[25]!==s||e[26]!==c?(d=(0,N.jsxs)(D,{gap:`gap-6`,children:[o,s,c]}),e[24]=o,e[25]=s,e[26]=c,e[27]=d):d=e[27],d}function U(e){return e.language}export{H as AppManagementSettingsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i,r as a}from"./popover-select-BzdnTy3h.js";import{t as o}from"./cn-JdwAhgNB.js";import{n as s}from"./interaction-BmQogeqz.js";import{t as c}from"./messages-D7kOD_o_.js";import{n as l,r as u,s as d}from"./locale-store-CnamlR07.js";import{i as f}from"./theme-store-BDyUTObE.js";import{n as p,r as m}from"./gateway-config-swr-Cv2ywpdb.js";import{Na as h,Vo as g,oi as _}from"./index-DRrjYYzZ.js";import{n as v,r as y}from"./settings-page-layout-BRQNel6r.js";import{t as b}from"./settings-advanced-gate-BTB_fxjt.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await d(u(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await p()}var E=r();function D(){return o(`rounded-xl bg-surface-base px-4 py-1 sm:px-5`)}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},mono:{light:{canvas:`#ffffff`,panel:`#f5f5f5`,accent:`#111111`,fg:`#111111`,muted:`#e5e7eb`},dark:{canvas:`#101010`,panel:`#1a1a1a`,accent:`#737373`,fg:`#fafafa`,muted:`#333333`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}}};function k(e){let t=(0,S.c)(24),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]!==o||t[3]!==r?(c={backgroundColor:r,borderColor:o},t[2]=o,t[3]=r,t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[5]=i,t[6]=l);let u;t[7]===a?u=t[8]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[7]=a,t[8]=u);let d;t[9]!==l||t[10]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11];let f;t[12]===o?f=t[13]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[12]=o,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[14]=o,t[15]=p);let m;t[16]!==c||t[17]!==d||t[18]!==f||t[19]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm border p-1`,style:c,children:[d,f,p]}),t[16]=c,t[17]=d,t[18]=f,t[19]=p,t[20]=m):m=t[20];let h;return t[21]!==s||t[22]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[21]=s,t[22]=m,t[23]=h):h=t[23],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md border border-edge-subtle`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`mono`,labelKey:`colorSchemeModernMono`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(18),t=l(F),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=f(P),a=f(N),u;e[2]===r.colorSchemeTitle?u=e[3]:(u=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.colorSchemeTitle}),e[2]=r.colorSchemeTitle,e[3]=u);let d;e[4]===r.colorSchemeDescription?d=e[5]:(d=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.colorSchemeDescription}),e[4]=r.colorSchemeDescription,e[5]=d);let p;e[6]!==u||e[7]!==d?(p=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),e[6]=u,e[7]=d,e[8]=p):p=e[8];let m;e[9]!==r||e[10]!==i||e[11]!==a?(m=j.map(e=>{let{value:t,labelKey:n}=e,c=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":c,onClick:()=>a(t),className:o(`flex flex-col gap-2 rounded-xl border-2 p-2.5 text-left transition-[border-color,box-shadow,transform] duration-150`,s.pressCard,c?`border-accent shadow-[0_0_0_1px_var(--color-accent)]`:`border-edge-subtle hover:border-edge`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:o(`text-xs font-medium leading-none`,c?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[9]=r,e[10]=i,e[11]=a,e[12]=m):m=e[12];let h;e[13]===m?h=e[14]:(h=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:m}),e[13]=m,e[14]=h);let g;return e[15]!==p||e[16]!==h?(g=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-surface-panel/50 p-3.5 sm:py-4`,children:[p,h]}),e[15]=p,e[16]=h,e[17]=g):g=e[17],g}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(31),t=l(L),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:s,isLoading:u}=m(!0),d=s?.payload?.config,f;e[2]===d?f=e[3]:(f=w(d),e[2]=d,e[3]=f);let p=f,[g,_]=(0,x.useState)(p),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===p?(D=e[5],O=e[6]):(D=()=>_(p),O=[p],e[4]=p,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]===r.activityDetailDefaultDescription?M=e[12]:(M=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.activityDetailDefaultDescription}),e[11]=r.activityDetailDefaultDescription,e[12]=M);let N;e[13]!==j||e[14]!==M?(N=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[j,M]}),e[13]=j,e[14]=M,e[15]=N):N=e[15];let P;e[16]!==r.activityDetailLevels||e[17]!==A||e[18]!==u||e[19]!==g||e[20]!==v?(P=u?(0,E.jsx)(h,{className:`h-10 w-full rounded-lg sm:max-w-sm`}):(0,E.jsxs)(i,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`sm:max-w-sm`,children:[(0,E.jsx)(a,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(a,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(a,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[16]=r.activityDetailLevels,e[17]=A,e[18]=u,e[19]=g,e[20]=v,e[21]=P):P=e[21];let F=b?`text-red-600 dark:text-red-400`:`text-fg-subtle`,I;e[22]===F?I=e[23]:(I=o(`min-h-4 text-xs`,F),e[22]=F,e[23]=I);let R=b?r.activityDetailSaveError:v?r.activityDetailSaving:r.activityDetailDefaultHint,z;e[24]!==I||e[25]!==R?(z=(0,E.jsx)(`p`,{className:I,children:R}),e[24]=I,e[25]=R,e[26]=z):z=e[26];let B;return e[27]!==z||e[28]!==N||e[29]!==P?(B=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 py-3.5 sm:py-4`,children:[N,P,z]}),e[27]=z,e[28]=N,e[29]=P,e[30]=B):B=e[30],B}function L(e){return e.language}function R(){let e=(0,S.c)(27),t=l(V),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),a=_(z),o;e[2]===r.developerGroupTitle?o=e[3]:(o=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.developerGroupTitle}),e[2]=r.developerGroupTitle,e[3]=o);let s;e[4]===r.developerGroupDescription?s=e[5]:(s=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.developerGroupDescription}),e[4]=r.developerGroupDescription,e[5]=s);let u;e[6]!==o||e[7]!==s?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),e[6]=o,e[7]=s,e[8]=u):u=e[8];let d;e[9]===r.showRawToolDataTitle?d=e[10]:(d=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[9]=r.showRawToolDataTitle,e[10]=d);let f;e[11]===r.showRawToolDataDescription?f=e[12]:(f=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[11]=r.showRawToolDataDescription,e[12]=f);let p;e[13]!==d||e[14]!==f?(p=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),e[13]=d,e[14]=f,e[15]=p):p=e[15];let m;e[16]===a?m=e[17]:(m=e=>a(e.target.checked),e[16]=a,e[17]=m);let h;e[18]!==i||e[19]!==m?(h=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:m}),e[18]=i,e[19]=m,e[20]=h):h=e[20];let g;e[21]!==p||e[22]!==h?(g=(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[p,h]}),e[21]=p,e[22]=h,e[23]=g):g=e[23];let v;return e[24]!==u||e[25]!==g?(v=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 py-3.5 sm:py-4`,children:[u,g]}),e[24]=u,e[25]=g,e[26]=v):v=e[26],v}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(30),t=l(U),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]!==r.pageTitle||e[3]!==r.subtitle?(i=(0,E.jsx)(v,{title:r.pageTitle,subtitle:r.subtitle}),e[2]=r.pageTitle,e[3]=r.subtitle,e[4]=i):i=e[4];let a;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=D(),e[5]=a):a=e[5];let o;e[6]===r.languageTitle?o=e[7]:(o=(0,E.jsx)(`h2`,{id:`pref-language-heading`,className:`sr-only`,children:r.languageTitle}),e[6]=r.languageTitle,e[7]=o);let s;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,E.jsx)(g,{variant:`page`,sections:[`language`]}),e[8]=s):s=e[8];let u;e[9]===o?u=e[10]:(u=(0,E.jsxs)(`section`,{className:a,"aria-labelledby":`pref-language-heading`,children:[o,s]}),e[9]=o,e[10]=u);let d;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=D(),e[11]=d):d=e[11];let f;e[12]===r.themeTitle?f=e[13]:(f=(0,E.jsx)(`h2`,{id:`pref-appearance-heading`,className:`sr-only`,children:r.themeTitle}),e[12]=r.themeTitle,e[13]=f);let p,m,h;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,E.jsx)(g,{variant:`page`,sections:[`theme`,`font`]}),h=(0,E.jsx)(M,{}),p=(0,E.jsx)(I,{}),e[14]=p,e[15]=m,e[16]=h):(p=e[14],m=e[15],h=e[16]);let _;e[17]===f?_=e[18]:(_=(0,E.jsxs)(`section`,{className:d,"aria-labelledby":`pref-appearance-heading`,children:[f,m,h,p]}),e[17]=f,e[18]=_);let x;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=D(),e[19]=x):x=e[19];let C;e[20]===r.developerGroupTitle?C=e[21]:(C=(0,E.jsx)(`h2`,{id:`pref-developer-heading`,className:`sr-only`,children:r.developerGroupTitle}),e[20]=r.developerGroupTitle,e[21]=C);let w;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,E.jsx)(R,{}),e[22]=w):w=e[22];let T;e[23]===C?T=e[24]:(T=(0,E.jsx)(b,{children:(0,E.jsxs)(`section`,{className:x,"aria-labelledby":`pref-developer-heading`,children:[C,w]})}),e[23]=C,e[24]=T);let O;return e[25]!==i||e[26]!==_||e[27]!==T||e[28]!==u?(O=(0,E.jsxs)(y,{gap:`gap-6`,children:[i,u,_,T]}),e[25]=i,e[26]=_,e[27]=T,e[28]=u,e[29]=O):O=e[29],O}function U(e){return e.language}export{H as AppearanceSettingsPanel};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{n as i,r as a}from"./popover-select-BzdnTy3h.js";import{t as o}from"./cn-JdwAhgNB.js";import{n as s}from"./interaction-BmQogeqz.js";import{t as c}from"./messages-D7kOD_o_.js";import{n as l,r as u,s as d}from"./locale-store-CnamlR07.js";import{i as f}from"./theme-store-BDyUTObE.js";import{n as p,r as m}from"./gateway-config-swr-Cv2ywpdb.js";import{Na as h,Vo as g,oi as _}from"./index-CKSplmFw.js";import{n as v,r as y}from"./settings-page-layout-BRQNel6r.js";import{t as b}from"./settings-advanced-gate-B6IMzhWo.js";var x=e(t(),1),S=n();function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){let t=C(e)?e:{},n=C(t.gateway)?t.gateway:{},r=(C(n.webchat)?n.webchat:{}).activityDetailDefault;return r===`off`||r===`stream`||r===`on`?r:`on`}async function T(e){await d(u(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{webchat:{activityDetailDefault:e}}})}),await p()}var E=r();function D(){return o(`rounded-xl bg-surface-base px-4 py-1 sm:px-5`)}var O={default:{light:{canvas:`#ffffff`,panel:`#fafafa`,accent:`#3a6bff`,fg:`#111111`,muted:`#ececec`},dark:{canvas:`#0a0a0a`,panel:`#121212`,accent:`#3a6bff`,fg:`#f5f5f5`,muted:`#222222`}},emerald:{light:{canvas:`#f0fdf4`,panel:`#ffffff`,accent:`#059669`,fg:`#052e16`,muted:`#86efac`},dark:{canvas:`#000000`,panel:`#0a0a0a`,accent:`#10b981`,fg:`#d1fae5`,muted:`#134e2a`}},mono:{light:{canvas:`#ffffff`,panel:`#f5f5f5`,accent:`#111111`,fg:`#111111`,muted:`#e5e7eb`},dark:{canvas:`#101010`,panel:`#1a1a1a`,accent:`#737373`,fg:`#fafafa`,muted:`#333333`}},clay:{light:{canvas:`#fffaf0`,panel:`#ffffff`,accent:`#1a3a3a`,fg:`#0a0a0a`,muted:`#e5e5e5`},dark:{canvas:`#0a1a1a`,panel:`#1a2a2a`,accent:`#ffb084`,fg:`#fffaf0`,muted:`#2a3a3a`}}};function k(e){let t=(0,S.c)(24),{canvas:n,panel:r,accent:i,fg:a,muted:o}=e,s;t[0]===n?s=t[1]:(s={backgroundColor:n},t[0]=n,t[1]=s);let c;t[2]!==o||t[3]!==r?(c={backgroundColor:r,borderColor:o},t[2]=o,t[3]=r,t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=(0,E.jsx)(`div`,{className:`size-1 shrink-0 rounded-full`,style:{backgroundColor:i}}),t[5]=i,t[6]=l);let u;t[7]===a?u=t[8]:(u=(0,E.jsx)(`div`,{className:`h-1 min-w-0 flex-1 rounded-full`,style:{backgroundColor:a,opacity:.85}}),t[7]=a,t[8]=u);let d;t[9]!==l||t[10]!==u?(d=(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11];let f;t[12]===o?f=t[13]:(f=(0,E.jsx)(`div`,{className:`h-1 w-2/3 max-w-[70%] rounded-full`,style:{backgroundColor:o}}),t[12]=o,t[13]=f);let p;t[14]===o?p=t[15]:(p=(0,E.jsx)(`div`,{className:`size-1/2 max-w-[55%] rounded-full`,style:{backgroundColor:o}}),t[14]=o,t[15]=p);let m;t[16]!==c||t[17]!==d||t[18]!==f||t[19]!==p?(m=(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5 rounded-sm border p-1`,style:c,children:[d,f,p]}),t[16]=c,t[17]=d,t[18]=f,t[19]=p,t[20]=m):m=t[20];let h;return t[21]!==s||t[22]!==m?(h=(0,E.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 p-1.5`,style:s,children:m}),t[21]=s,t[22]=m,t[23]=h):h=t[23],h}function A(e){let t=(0,S.c)(8),{scheme:n}=e,{light:r,dark:i}=O[n],a;t[0]===r?a=t[1]:(a=(0,E.jsx)(k,{...r}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,E.jsx)(`div`,{className:`w-px shrink-0 bg-black/12 dark:bg-white/12`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=(0,E.jsx)(k,{...i}),t[3]=i,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,E.jsxs)(`div`,{className:`flex h-11 w-full overflow-hidden rounded-md border border-edge-subtle`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}var j=[{value:`default`,labelKey:`colorSchemeDefault`},{value:`emerald`,labelKey:`colorSchemeLightGreen`},{value:`mono`,labelKey:`colorSchemeModernMono`},{value:`clay`,labelKey:`colorSchemeClay`}];function M(){let e=(0,S.c)(18),t=l(F),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=f(P),a=f(N),u;e[2]===r.colorSchemeTitle?u=e[3]:(u=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.colorSchemeTitle}),e[2]=r.colorSchemeTitle,e[3]=u);let d;e[4]===r.colorSchemeDescription?d=e[5]:(d=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.colorSchemeDescription}),e[4]=r.colorSchemeDescription,e[5]=d);let p;e[6]!==u||e[7]!==d?(p=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[u,d]}),e[6]=u,e[7]=d,e[8]=p):p=e[8];let m;e[9]!==r||e[10]!==i||e[11]!==a?(m=j.map(e=>{let{value:t,labelKey:n}=e,c=i===t;return(0,E.jsxs)(`button`,{type:`button`,"aria-pressed":c,onClick:()=>a(t),className:o(`flex flex-col gap-2 rounded-xl border-2 p-2.5 text-left transition-[border-color,box-shadow,transform] duration-150`,s.pressCard,c?`border-accent shadow-[0_0_0_1px_var(--color-accent)]`:`border-edge-subtle hover:border-edge`),children:[(0,E.jsx)(A,{scheme:t}),(0,E.jsx)(`span`,{className:o(`text-xs font-medium leading-none`,c?`text-accent-fg`:`text-fg-muted`),children:r[n]})]},t)}),e[9]=r,e[10]=i,e[11]=a,e[12]=m):m=e[12];let h;e[13]===m?h=e[14]:(h=(0,E.jsx)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:m}),e[13]=m,e[14]=h);let g;return e[15]!==p||e[16]!==h?(g=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg bg-surface-panel/50 p-3.5 sm:py-4`,children:[p,h]}),e[15]=p,e[16]=h,e[17]=g):g=e[17],g}function N(e){return e.setColorScheme}function P(e){return e.colorScheme}function F(e){return e.language}function I(){let e=(0,S.c)(31),t=l(L),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,{data:s,isLoading:u}=m(!0),d=s?.payload?.config,f;e[2]===d?f=e[3]:(f=w(d),e[2]=d,e[3]=f);let p=f,[g,_]=(0,x.useState)(p),[v,y]=(0,x.useState)(!1),[b,C]=(0,x.useState)(!1),D,O;e[4]===p?(D=e[5],O=e[6]):(D=()=>_(p),O=[p],e[4]=p,e[5]=D,e[6]=O),(0,x.useEffect)(D,O);let k;e[7]===g?k=e[8]:(k=e=>{let t=g;_(e),y(!0),C(!1),T(e).catch(()=>{_(t),C(!0)}).finally(()=>y(!1))},e[7]=g,e[8]=k);let A=k,j;e[9]===r.activityDetailDefaultTitle?j=e[10]:(j=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.activityDetailDefaultTitle}),e[9]=r.activityDetailDefaultTitle,e[10]=j);let M;e[11]===r.activityDetailDefaultDescription?M=e[12]:(M=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.activityDetailDefaultDescription}),e[11]=r.activityDetailDefaultDescription,e[12]=M);let N;e[13]!==j||e[14]!==M?(N=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[j,M]}),e[13]=j,e[14]=M,e[15]=N):N=e[15];let P;e[16]!==r.activityDetailLevels||e[17]!==A||e[18]!==u||e[19]!==g||e[20]!==v?(P=u?(0,E.jsx)(h,{className:`h-10 w-full rounded-lg sm:max-w-sm`}):(0,E.jsxs)(i,{value:g,disabled:v,onChange:e=>A(e.target.value),triggerClassName:`sm:max-w-sm`,children:[(0,E.jsx)(a,{value:`off`,children:r.activityDetailLevels.off}),(0,E.jsx)(a,{value:`on`,children:r.activityDetailLevels.on}),(0,E.jsx)(a,{value:`stream`,children:r.activityDetailLevels.stream})]}),e[16]=r.activityDetailLevels,e[17]=A,e[18]=u,e[19]=g,e[20]=v,e[21]=P):P=e[21];let F=b?`text-red-600 dark:text-red-400`:`text-fg-subtle`,I;e[22]===F?I=e[23]:(I=o(`min-h-4 text-xs`,F),e[22]=F,e[23]=I);let R=b?r.activityDetailSaveError:v?r.activityDetailSaving:r.activityDetailDefaultHint,z;e[24]!==I||e[25]!==R?(z=(0,E.jsx)(`p`,{className:I,children:R}),e[24]=I,e[25]=R,e[26]=z):z=e[26];let B;return e[27]!==z||e[28]!==N||e[29]!==P?(B=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 py-3.5 sm:py-4`,children:[N,P,z]}),e[27]=z,e[28]=N,e[29]=P,e[30]=B):B=e[30],B}function L(e){return e.language}function R(){let e=(0,S.c)(27),t=l(V),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i=_(B),a=_(z),o;e[2]===r.developerGroupTitle?o=e[3]:(o=(0,E.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:r.developerGroupTitle}),e[2]=r.developerGroupTitle,e[3]=o);let s;e[4]===r.developerGroupDescription?s=e[5]:(s=(0,E.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:r.developerGroupDescription}),e[4]=r.developerGroupDescription,e[5]=s);let u;e[6]!==o||e[7]!==s?(u=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),e[6]=o,e[7]=s,e[8]=u):u=e[8];let d;e[9]===r.showRawToolDataTitle?d=e[10]:(d=(0,E.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:r.showRawToolDataTitle}),e[9]=r.showRawToolDataTitle,e[10]=d);let f;e[11]===r.showRawToolDataDescription?f=e[12]:(f=(0,E.jsx)(`p`,{className:`text-xs text-fg-muted`,children:r.showRawToolDataDescription}),e[11]=r.showRawToolDataDescription,e[12]=f);let p;e[13]!==d||e[14]!==f?(p=(0,E.jsxs)(`div`,{className:`min-w-0`,children:[d,f]}),e[13]=d,e[14]=f,e[15]=p):p=e[15];let m;e[16]===a?m=e[17]:(m=e=>a(e.target.checked),e[16]=a,e[17]=m);let h;e[18]!==i||e[19]!==m?(h=(0,E.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:i,onChange:m}),e[18]=i,e[19]=m,e[20]=h):h=e[20];let g;e[21]!==p||e[22]!==h?(g=(0,E.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[p,h]}),e[21]=p,e[22]=h,e[23]=g):g=e[23];let v;return e[24]!==u||e[25]!==g?(v=(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 py-3.5 sm:py-4`,children:[u,g]}),e[24]=u,e[25]=g,e[26]=v):v=e[26],v}function z(e){return e.setShowRawToolData}function B(e){return e.showRawToolData}function V(e){return e.language}function H(){let e=(0,S.c)(30),t=l(U),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.appearanceSettings,i;e[2]!==r.pageTitle||e[3]!==r.subtitle?(i=(0,E.jsx)(v,{title:r.pageTitle,subtitle:r.subtitle}),e[2]=r.pageTitle,e[3]=r.subtitle,e[4]=i):i=e[4];let a;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=D(),e[5]=a):a=e[5];let o;e[6]===r.languageTitle?o=e[7]:(o=(0,E.jsx)(`h2`,{id:`pref-language-heading`,className:`sr-only`,children:r.languageTitle}),e[6]=r.languageTitle,e[7]=o);let s;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,E.jsx)(g,{variant:`page`,sections:[`language`]}),e[8]=s):s=e[8];let u;e[9]===o?u=e[10]:(u=(0,E.jsxs)(`section`,{className:a,"aria-labelledby":`pref-language-heading`,children:[o,s]}),e[9]=o,e[10]=u);let d;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=D(),e[11]=d):d=e[11];let f;e[12]===r.themeTitle?f=e[13]:(f=(0,E.jsx)(`h2`,{id:`pref-appearance-heading`,className:`sr-only`,children:r.themeTitle}),e[12]=r.themeTitle,e[13]=f);let p,m,h;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,E.jsx)(g,{variant:`page`,sections:[`theme`,`font`]}),h=(0,E.jsx)(M,{}),p=(0,E.jsx)(I,{}),e[14]=p,e[15]=m,e[16]=h):(p=e[14],m=e[15],h=e[16]);let _;e[17]===f?_=e[18]:(_=(0,E.jsxs)(`section`,{className:d,"aria-labelledby":`pref-appearance-heading`,children:[f,m,h,p]}),e[17]=f,e[18]=_);let x;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(x=D(),e[19]=x):x=e[19];let C;e[20]===r.developerGroupTitle?C=e[21]:(C=(0,E.jsx)(`h2`,{id:`pref-developer-heading`,className:`sr-only`,children:r.developerGroupTitle}),e[20]=r.developerGroupTitle,e[21]=C);let w;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,E.jsx)(R,{}),e[22]=w):w=e[22];let T;e[23]===C?T=e[24]:(T=(0,E.jsx)(b,{children:(0,E.jsxs)(`section`,{className:x,"aria-labelledby":`pref-developer-heading`,children:[C,w]})}),e[23]=C,e[24]=T);let O;return e[25]!==i||e[26]!==_||e[27]!==T||e[28]!==u?(O=(0,E.jsxs)(y,{gap:`gap-6`,children:[i,u,_,T]}),e[25]=i,e[26]=_,e[27]=T,e[28]=u,e[29]=O):O=e[29],O}function U(e){return e.language}export{H as AppearanceSettingsPanel};
|