local-operator-ui 0.44.0 → 0.44.2
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/out/main/index.js +32506 -27973
- package/out/preload/index.js +84 -6
- package/out/renderer/assets/{_basePickBy-D3VtwrNY.js → _basePickBy-LPJBKSk3.js} +1 -1
- package/out/renderer/assets/{_baseUniq-D5X85E0S.js → _baseUniq-D8M8HOYM.js} +1 -1
- package/out/renderer/assets/agent-details-page-CZuUDIS7.js +6 -0
- package/out/renderer/assets/agent-hub-page-B2h53zmZ.js +6 -0
- package/out/renderer/assets/agents-page-DxPAtB0k.js +7 -0
- package/out/renderer/assets/{approvalsOverlay-BUwR8zXi.js → approvalsOverlay-BjR3EVfg.js} +1 -1
- package/out/renderer/assets/{arc-C5lHNCVd.js → arc-Blq81BHO.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-DMuNgh30.js → architectureDiagram-IEHRJDOE-BKX_zyB3.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-DBulh7Ye.js → blockDiagram-JOT3LUYC-DesagpJf.js} +1 -1
- package/out/renderer/assets/{book-open-YbPNmvto.js → book-open-BGI5fs27.js} +1 -1
- package/out/renderer/assets/browser-page-C156D5SG.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-YVU9CDM6.js → browser-webauthn-prompt-dv7y6_dA.js} +1 -1
- package/out/renderer/assets/{building-2-Dk-t19G0.js → building-2-D2OTMmkt.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-L3-9aXQh.js → c4Diagram-VJAJSXHY-CWsH54Hv.js} +1 -1
- package/out/renderer/assets/channel-DEPypRI4.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-CgXFdlYf.js → chunk-4BMEZGHF-B0-zmu4b.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-DT1C_gy2.js → chunk-A2AXSNBT-RQCYYGRS.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-YwH-fCeY.js → chunk-AEK57VVT-DwkZ07Wr.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-CPspVwrW.js → chunk-D6G4REZN-BWg_1fD9.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-BEbcJaEy.js → chunk-RZ5BOZE2-3EjCkn2h.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-BZPybVmi.js → chunk-XZIHB7SX-DoadzlFd.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-D64NGwBp.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-D64NGwBp.js +1 -0
- package/out/renderer/assets/clone-BrsLxtaK.js +1 -0
- package/out/renderer/assets/{console-mirror-BiNs1Fcs.js → console-mirror-Cx1_mcwT.js} +10 -10
- package/out/renderer/assets/{consoleCapture-C6-j0c5S.js → consoleCapture-CBiwH6qH.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-BNDyyAZz.js → conversation-input-sync-6W6mDd5c.js} +225 -225
- package/out/renderer/assets/{dagre-OKDRZEBW-WqN1d2Ic.js → dagre-OKDRZEBW-CkNv39Aw.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-DYfmB1X1.js → diagram-SSKATNLV-DKGhEDc0.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-Bfu4SDNY.js → diagram-VNBRO52H-2dRMMinF.js} +1 -1
- package/out/renderer/assets/{en-US-CHJkXXr4.js → en-US-CW_dDnkH.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-IWOis8-U.js → erDiagram-Q7BY3M3F-BaZqUE9f.js} +1 -1
- package/out/renderer/assets/{error-boundary-Bq37z0Vv.js → error-boundary-BhcUnSSp.js} +2 -2
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-DG_QDSF3.js → flowDiagram-4HSFHLVR-DO71jsf7.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-BN03PoHm.js → ganttDiagram-APWFNJXF-aaChmBo1.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-Bif0BK48.js → gitGraphDiagram-7IBYFJ6S-DH2o95aG.js} +1 -1
- package/out/renderer/assets/{graph-C-tc8AsB.js → graph-BzuMIyA9.js} +1 -1
- package/out/renderer/assets/{hash-C3PLrCW5.js → hash-Bof-oLZ7.js} +1 -1
- package/out/renderer/assets/{heart-DDY0lTmm.js → heart-Bd5kZnjR.js} +1 -1
- package/out/renderer/assets/{index-IM2mLpeL.js → index-B0Ue5RBi.js} +1 -1
- package/out/renderer/assets/index-BABrnwf5.css +1 -0
- package/out/renderer/assets/{index-C1xioNnx.js → index-Bf_5C9hH.js} +198 -198
- package/out/renderer/assets/{index-B4nU7SY-.js → index-CNnTZGuV.js} +1 -1
- package/out/renderer/assets/{index-OcjLnSVT.js → index-CxK1ypFa.js} +1 -1
- package/out/renderer/assets/infoDiagram-PH2N3AL5-DZJ-3Hbl.js +2 -0
- package/out/renderer/assets/{installer-DVWaW2Cw.js → installer-BTKc-9AM.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-_OmkcLjc.js → journeyDiagram-U35MCT3I-B1iYgquG.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-DUSiV5yR.js → kanban-definition-NDS4AKOZ-D6b_9SBk.js} +1 -1
- package/out/renderer/assets/{layout-BwlaoNdS.js → layout-BYe1V9vC.js} +1 -1
- package/out/renderer/assets/legacy-agents-page-B4QsRAZI.js +33 -0
- package/out/renderer/assets/{library-page-ckanGPFY.js → library-page-VgK0BSR2.js} +3 -3
- package/out/renderer/assets/{mermaid.core-CrjcyFIw.js → mermaid.core-CENNKUw2.js} +5 -5
- package/out/renderer/assets/mesh-page-CEgyAVW-.js +1 -0
- package/out/renderer/assets/{messages-Bsgf6o-p.js → messages-Bst4VOU3.js} +10 -10
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-B-X_MKbg.js → mindmap-definition-ALO5MXBD-DPYnshtf.js} +1 -1
- package/out/renderer/assets/{mini-_lgzfzw2.js → mini-DjdzboAc.js} +1 -1
- package/out/renderer/assets/{notebook-pen-BYY7185A.js → notebook-pen-CZVJiq5R.js} +1 -1
- package/out/renderer/assets/org-access-DZc8cPye.js +1 -0
- package/out/renderer/assets/org-surface-gate-Bj7rZIwL.js +1 -0
- package/out/renderer/assets/{page-header-CSOT2M6K.js → page-header-Dtg6CqtK.js} +1 -1
- package/out/renderer/assets/parseISO-CxPiCKvF.js +1 -0
- package/out/renderer/assets/path-utils-CzhWDDSj.js +58 -0
- package/out/renderer/assets/{pieDiagram-IB7DONF6-KbwgG4tn.js → pieDiagram-IB7DONF6-1_U-X3IZ.js} +1 -1
- package/out/renderer/assets/{projects-page-CVNMOB_d.js → projects-page-Bw-AAZ11.js} +6 -6
- package/out/renderer/assets/publication-validation-Iutn5hzY.js +1 -0
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-Bjz4TG3c.js → quadrantDiagram-7GDLP6J5-kbwdrehe.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-BKRNfIwb.js → radar-MK3ICKWK-DpsIZo-R.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-OK28kSbr.js → radient-auth-buttons-C1Juzc0D.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-D4k7IA0L.js → requirementDiagram-KVF5MWMF-qtUg8gWV.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-Dd96CGIr.js → sankeyDiagram-QLVOVGJD-B6i8Lf5L.js} +1 -1
- package/out/renderer/assets/{schedules-page-Bf3w5M5d.js → schedules-page-DjiYevaS.js} +2 -2
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-dLuGQfA8.js → sequenceDiagram-X6HHIX6F-B3NVLrcT.js} +1 -1
- package/out/renderer/assets/settings-page-BUpTYpEG.js +287 -0
- package/out/renderer/assets/{smartart-BKb_WKE6.js → smartart-BTOCcWLh.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-xdA_EMO3.js → stateDiagram-DGXRK772-nACatGwh.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-LbiD2EL_.js +1 -0
- package/out/renderer/assets/team-bridge-page-BW45aiP2.js +21 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-DJcCw_S5.js → timeline-definition-BDJGKUSR-BXO43hMG.js} +1 -1
- package/out/renderer/assets/use-default-on-banner-DjHLTfeK.js +1 -0
- package/out/renderer/assets/use-download-agent-mutation-D6QgUMMQ.js +56 -0
- package/out/renderer/assets/{use-session-snapshot-1Qr287OF.js → use-session-snapshot-CI2ND9fV.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-AN9BWRc1.js → xychartDiagram-VJFVF3MP-CA90n1Qk.js} +1 -1
- package/out/renderer/browser-approvals-overlay.html +2 -2
- package/out/renderer/console-capture.html +6 -6
- package/out/renderer/index.html +8 -8
- package/out/renderer/installer.html +5 -5
- package/out/renderer/mini.html +8 -8
- package/package.json +2 -2
- package/out/renderer/assets/agent-details-page-DuT7ksQQ.js +0 -6
- package/out/renderer/assets/agent-hub-page-Ql4T_UHE.js +0 -6
- package/out/renderer/assets/agents-page-b9zRicwX.js +0 -7
- package/out/renderer/assets/browser-page-B3tf6s7R.js +0 -1
- package/out/renderer/assets/channel-DL0ftT8O.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-jy6TeuKv.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-jy6TeuKv.js +0 -1
- package/out/renderer/assets/clone-CxDM6XKV.js +0 -1
- package/out/renderer/assets/format-esAOn2VS.js +0 -1
- package/out/renderer/assets/index-CJBIsxq7.css +0 -1
- package/out/renderer/assets/infoDiagram-PH2N3AL5-BSH7k17A.js +0 -2
- package/out/renderer/assets/legacy-agents-page-oa1T18xF.js +0 -33
- package/out/renderer/assets/mesh-page-DUvJxJjk.js +0 -1
- package/out/renderer/assets/org-access-M6CGnpV0.js +0 -1
- package/out/renderer/assets/org-surface-gate-BwyP7jwt.js +0 -1
- package/out/renderer/assets/parseISO-BHJWTxrA.js +0 -1
- package/out/renderer/assets/path-utils-Dy8qomEz.js +0 -58
- package/out/renderer/assets/publication-validation-DaTmgJDa.js +0 -1
- package/out/renderer/assets/settings-page-CfM3A9yR.js +0 -287
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-eb84WKtw.js +0 -1
- package/out/renderer/assets/team-bridge-page-Bq0clyqS.js +0 -21
- package/out/renderer/assets/use-download-agent-mutation-BsUnGrAQ.js +0 -56
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import{r as l,j as t,c as ue,t as Hs}from"./index-CNnTZGuV.js";import{o as qs}from"./console-mirror-Cx1_mcwT.js";import{co as $t,cp as Gs,cq as yn,cr as Ke,br as Ys,a3 as Zn,a4 as en,T as Jn,aq as Qs,ar as Ws,cs as Zs,ct as Js,cu as Xs,cv as ea,cw as Xn,cx as tn,a1 as es,cy as ta,cz as na,at as Pt,cA as vn,cB as sa,cC as pt,cD as Kt,be as ts,cE as nn,bX as ft,b1 as aa,cF as ns,a0 as ia,cG as ra,cH as oa,cI as la,cJ as ca,cK as da,cL as ua,S as ss,av as Ut,aw as Bt,aA as ga,c9 as Vt,cM as ma,cN as _a,cO as Ht,cP as pa,cQ as fa,cR as ha,cS as as,cT as xa,cU as ya,cV as va,ap as ba,cW as is,au as rs,cX as os,cY as ka,cZ as ja,c_ as wa,c$ as Na,d0 as Sa,d1 as Ma,d2 as Ca,d3 as Ea,bm as ls,aZ as Aa,d4 as et,d5 as bn,d6 as Ia,d7 as Ra,d8 as Ta,bd as Oa,d9 as La,da as Fa,bt as Da,db as za,dc as $a,dd as Pa,de as kn,df as Ka,bP as Ua,dg as Ba,dh as Va,c1 as Ha}from"./conversation-input-sync-6W6mDd5c.js";import{i as Re,u as sn,am as qa,a8 as Ga,an as Ya,ao as Ge,a as an,c as kt,ap as Qa,a0 as Wa,aq as Za,ar as Ja,as as Xa,at as ei,d as _e,au as ti,x as Ue,av as ni,aw as si,ax as ai,A as rn,ay as ii,q as st,az as ri,B as cs,r as oi,Q as li,aA as qt,aB as ci,aC as ds,Z as di}from"./path-utils-CzhWDDSj.js";import{cQ as us,cR as ui,cS as gi,cT as gs,cU as mi,bI as _i,cV as Ae,N as pi,S as ms,bl as ot,bm as me,cW as ce,cX as Et,cY as fi,cK as hi,cZ as xi,aQ as jn,c_ as yi,c$ as vi,d0 as dt,bk as bi,cz as ki,d1 as ji,d2 as wi,d3 as Ni,d4 as Si,ba as wn,d5 as Mi,b0 as Ci,bh as Nn,cJ as Ei,bi as Ai,bj as Ii,d6 as Ri,b9 as Ti,d7 as Oi}from"./index-Bf_5C9hH.js";import{P as Li}from"./page-header-Dtg6CqtK.js";import{c as R,u as se,B as O,S as ye,M as _s,m as Je,Y as jt,Z as wt,_ as We,A as ae,a as Nt,n as Ne,l as xe,F as on,G as ln,H as cn,J as dn,K as Ze,L as Ie,I as De,a0 as St,N as Fi,z as it,b as Gt,af as Di,C as ps,ai as Sn,T as fs,q as zi,r as $i,s as Pi,v as Ki,w as Mn,p as Ui,E as Bi,a5 as Vi,a4 as Hi}from"./error-boundary-BhcUnSSp.js";import{t as n,L as qi}from"./messages-Bst4VOU3.js";import{u as Gi,a as Yi,D as Qi}from"./use-default-on-banner-DjHLTfeK.js";import{R as Wi}from"./radient-auth-buttons-C1Juzc0D.js";import{N as Zi}from"./notebook-pen-CZVJiq5R.js";import{B as Ji}from"./book-open-BGI5fs27.js";import{i as Xi,a as qe,b as er,p as At,f as tr}from"./parseISO-CxPiCKvF.js";import{t as nr}from"./en-US-CW_dDnkH.js";/**
|
|
2
|
+
* @license lucide-react v0.507.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const sr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m14.31 8 5.74 9.94",key:"1y6ab4"}],["path",{d:"M9.69 8h11.48",key:"1wxppr"}],["path",{d:"m7.38 12 5.74-9.94",key:"1grp0k"}],["path",{d:"M9.69 16 3.95 6.06",key:"libnyf"}],["path",{d:"M14.31 16H2.83",key:"x5fava"}],["path",{d:"m16.62 12-5.74 9.94",key:"1vwawt"}]],ar=R("aperture",sr);/**
|
|
7
|
+
* @license lucide-react v0.507.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const ir=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]],rr=R("atom",ir);/**
|
|
12
|
+
* @license lucide-react v0.507.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const or=[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]],lr=R("audio-waveform",or);/**
|
|
17
|
+
* @license lucide-react v0.507.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const cr=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],dr=R("binary",cr);/**
|
|
22
|
+
* @license lucide-react v0.507.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const ur=[["path",{d:"M10 7v10.9",key:"1gynux"}],["path",{d:"M14 6.1V17",key:"116kdf"}],["path",{d:"M16 7V3a1 1 0 0 1 1.707-.707 2.5 2.5 0 0 0 2.152.717 1 1 0 0 1 1.131 1.131 2.5 2.5 0 0 0 .717 2.152A1 1 0 0 1 21 8h-4",key:"gpb6xx"}],["path",{d:"M16.536 7.465a5 5 0 0 0-7.072 0l-2 2a5 5 0 0 0 0 7.07 5 5 0 0 0 7.072 0l2-2a5 5 0 0 0 0-7.07",key:"1tsln4"}],["path",{d:"M8 17v4a1 1 0 0 1-1.707.707 2.5 2.5 0 0 0-2.152-.717 1 1 0 0 1-1.131-1.131 2.5 2.5 0 0 0-.717-2.152A1 1 0 0 1 3 16h4",key:"qexcha"}]],gr=R("candy",ur);/**
|
|
27
|
+
* @license lucide-react v0.507.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const mr=[["path",{d:"m21 8-2 2-1.5-3.7A2 2 0 0 0 15.646 5H8.4a2 2 0 0 0-1.903 1.257L5 10 3 8",key:"1imjwt"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 14h.01",key:"7oqj8z"}],["rect",{width:"18",height:"8",x:"3",y:"10",rx:"2",key:"a7itu8"}],["path",{d:"M5 18v2",key:"ppbyun"}],["path",{d:"M19 18v2",key:"gy7782"}]],_r=R("car-front",mr);/**
|
|
32
|
+
* @license lucide-react v0.507.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const pr=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["circle",{cx:"8",cy:"10",r:"2",key:"1xl4ub"}],["path",{d:"M8 12h8",key:"1wcyev"}],["circle",{cx:"16",cy:"10",r:"2",key:"r14t7q"}],["path",{d:"m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3",key:"l01ucn"}]],fr=R("cassette-tape",pr);/**
|
|
37
|
+
* @license lucide-react v0.507.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const hr=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],xr=R("chart-line",hr);/**
|
|
42
|
+
* @license lucide-react v0.507.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const yr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],vr=R("circle-plus",yr);/**
|
|
47
|
+
* @license lucide-react v0.507.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const br=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M11 9h4a2 2 0 0 0 2-2V3",key:"1ve2rv"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"M7 21v-4a2 2 0 0 1 2-2h4",key:"1fwkro"}],["circle",{cx:"15",cy:"15",r:"2",key:"3i40o0"}]],kr=R("circuit-board",br);/**
|
|
52
|
+
* @license lucide-react v0.507.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const jr=[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]],wr=R("cloud-lightning",jr);/**
|
|
57
|
+
* @license lucide-react v0.507.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const Nr=[["path",{d:"M10.188 8.5A6 6 0 0 1 16 4a1 1 0 0 0 6 6 6 6 0 0 1-3 5.197",key:"erj67n"}],["path",{d:"M13 16a3 3 0 1 1 0 6H7a5 5 0 1 1 4.9-6Z",key:"p44pc9"}]],Sr=R("cloud-moon",Nr);/**
|
|
62
|
+
* @license lucide-react v0.507.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const Mr=[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M8 19h.01",key:"puxtts"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M12 21h.01",key:"h35vbk"}],["path",{d:"M16 15h.01",key:"rnfrdf"}],["path",{d:"M16 19h.01",key:"1vcnzz"}]],Cr=R("cloud-snow",Mr);/**
|
|
67
|
+
* @license lucide-react v0.507.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const Er=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}],["path",{d:"M15.947 12.65a4 4 0 0 0-5.925-4.128",key:"dpwdj0"}],["path",{d:"M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z",key:"s09mg5"}]],Ar=R("cloud-sun",Er);/**
|
|
72
|
+
* @license lucide-react v0.507.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const Ir=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],Rr=R("coffee",Ir);/**
|
|
77
|
+
* @license lucide-react v0.507.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const Tr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],hs=R("contrast",Tr);/**
|
|
82
|
+
* @license lucide-react v0.507.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const Or=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Lr=R("credit-card",Or);/**
|
|
87
|
+
* @license lucide-react v0.507.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const Fr=[["path",{d:"m6 8 1.75 12.28a2 2 0 0 0 2 1.72h4.54a2 2 0 0 0 2-1.72L18 8",key:"8166m8"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M7 15a6.47 6.47 0 0 1 5 0 6.47 6.47 0 0 0 5 0",key:"yjz344"}],["path",{d:"m12 8 1-6h2",key:"3ybfa4"}]],Dr=R("cup-soda",Fr);/**
|
|
92
|
+
* @license lucide-react v0.507.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const zr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],$r=R("disc-3",zr);/**
|
|
97
|
+
* @license lucide-react v0.507.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const Pr=[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]],Kr=R("droplet",Pr);/**
|
|
102
|
+
* @license lucide-react v0.507.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const Ur=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],Br=R("droplets",Ur);/**
|
|
107
|
+
* @license lucide-react v0.507.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const Vr=[["path",{d:"M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z",key:"15baut"}],["path",{d:"M18 12v.5",key:"18hhni"}],["path",{d:"M16 17.93a9.77 9.77 0 0 1 0-11.86",key:"16dt7o"}],["path",{d:"M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33",key:"l9di03"}],["path",{d:"M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4",key:"1kjonw"}],["path",{d:"m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98",key:"1zlm23"}]],Hr=R("fish",Vr);/**
|
|
112
|
+
* @license lucide-react v0.507.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const qr=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],Gr=R("flame",qr);/**
|
|
117
|
+
* @license lucide-react v0.507.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const Yr=[["path",{d:"M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1",key:"3pnvol"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M12 10v12",key:"6ubwww"}],["path",{d:"M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z",key:"9hd38g"}],["path",{d:"M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z",key:"ufn41s"}]],Qr=R("flower-2",Yr);/**
|
|
122
|
+
* @license lucide-react v0.507.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const Wr=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",key:"14wa3c"}],["path",{d:"M12 7.5V9",key:"1oy5b0"}],["path",{d:"M7.5 12H9",key:"eltsq1"}],["path",{d:"M16.5 12H15",key:"vk5kw4"}],["path",{d:"M12 16.5V15",key:"k7eayi"}],["path",{d:"m8 8 1.88 1.88",key:"nxy4qf"}],["path",{d:"M14.12 9.88 16 8",key:"1lst6k"}],["path",{d:"m8 16 1.88-1.88",key:"h2eex1"}],["path",{d:"M14.12 14.12 16 16",key:"uqkrx3"}]],Zr=R("flower",Wr);/**
|
|
127
|
+
* @license lucide-react v0.507.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const Jr=[["path",{d:"M9 10h.01",key:"qbtxuw"}],["path",{d:"M15 10h.01",key:"1qmjsl"}],["path",{d:"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",key:"uwwb07"}]],Xr=R("ghost",Jr);/**
|
|
132
|
+
* @license lucide-react v0.507.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const eo=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],to=R("github",eo);/**
|
|
137
|
+
* @license lucide-react v0.507.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const no=[["path",{d:"m11.9 12.1 4.514-4.514",key:"109xqo"}],["path",{d:"M20.1 2.3a1 1 0 0 0-1.4 0l-1.114 1.114A2 2 0 0 0 17 4.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 17.828 7h1.344a2 2 0 0 0 1.414-.586L21.7 5.3a1 1 0 0 0 0-1.4z",key:"txyc8t"}],["path",{d:"m6 16 2 2",key:"16qmzd"}],["path",{d:"M8.23 9.85A3 3 0 0 1 11 8a5 5 0 0 1 5 5 3 3 0 0 1-1.85 2.77l-.92.38A2 2 0 0 0 12 18a4 4 0 0 1-4 4 6 6 0 0 1-6-6 4 4 0 0 1 4-4 2 2 0 0 0 1.85-1.23z",key:"1de1vg"}]],so=R("guitar",no);/**
|
|
142
|
+
* @license lucide-react v0.507.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const ao=[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]],io=R("hexagon",ao);/**
|
|
147
|
+
* @license lucide-react v0.507.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const ro=[["path",{d:"M12 17c5 0 8-2.69 8-6H4c0 3.31 3 6 8 6m-4 4h8m-4-3v3M5.14 11a3.5 3.5 0 1 1 6.71 0",key:"1uxfcu"}],["path",{d:"M12.14 11a3.5 3.5 0 1 1 6.71 0",key:"4k3m1s"}],["path",{d:"M15.5 6.5a3.5 3.5 0 1 0-7 0",key:"zmuahr"}]],oo=R("ice-cream-bowl",ro);/**
|
|
152
|
+
* @license lucide-react v0.507.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const lo=[["path",{d:"M21 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2Z",key:"jg2n2t"}],["path",{d:"M6 15v-2",key:"gd6mvg"}],["path",{d:"M12 15V9",key:"8c7uyn"}],["circle",{cx:"12",cy:"6",r:"3",key:"1gm2ql"}]],co=R("joystick",lo);/**
|
|
157
|
+
* @license lucide-react v0.507.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const uo=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],go=R("leaf",uo);/**
|
|
162
|
+
* @license lucide-react v0.507.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const mo=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],_o=R("lightbulb",mo);/**
|
|
167
|
+
* @license lucide-react v0.507.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const po=[["path",{d:"M8 2h8",key:"1ssgc1"}],["path",{d:"M9 2v2.789a4 4 0 0 1-.672 2.219l-.656.984A4 4 0 0 0 7 10.212V20a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-9.789a4 4 0 0 0-.672-2.219l-.656-.984A4 4 0 0 1 15 4.788V2",key:"qtp12x"}],["path",{d:"M7 15a6.472 6.472 0 0 1 5 0 6.47 6.47 0 0 0 5 0",key:"ygeh44"}]],fo=R("milk",po);/**
|
|
172
|
+
* @license lucide-react v0.507.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const ho=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9",key:"4ay0iu"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}]],xo=R("moon-star",ho);/**
|
|
177
|
+
* @license lucide-react v0.507.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const yo=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],vo=R("moon",yo);/**
|
|
182
|
+
* @license lucide-react v0.507.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const bo=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}],["path",{d:"M4.14 15.08c2.62-1.57 5.24-1.43 7.86.42 2.74 1.94 5.49 2 8.23.19",key:"1pvmmp"}]],ko=R("mountain-snow",bo);/**
|
|
187
|
+
* @license lucide-react v0.507.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const jo=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],wo=R("mountain",jo);/**
|
|
192
|
+
* @license lucide-react v0.507.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const No=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],So=R("radio",No);/**
|
|
197
|
+
* @license lucide-react v0.507.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const Mo=[["path",{d:"M22 18H2a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4Z",key:"1404fh"}],["path",{d:"M21 14 10 2 3 14h18Z",key:"1nzg7v"}],["path",{d:"M10 2v16",key:"1labyt"}]],Co=R("sailboat",Mo);/**
|
|
202
|
+
* @license lucide-react v0.507.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const Eo=[["path",{d:"M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z",key:"1wgbhj"}]],Ao=R("shirt",Eo);/**
|
|
207
|
+
* @license lucide-react v0.507.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const Io=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],Ro=R("skull",Io);/**
|
|
212
|
+
* @license lucide-react v0.507.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const To=[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]],Oo=R("snowflake",To);/**
|
|
217
|
+
* @license lucide-react v0.507.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const Lo=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]],Fo=R("sparkle",Lo);/**
|
|
222
|
+
* @license lucide-react v0.507.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const Do=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 4h.01",key:"1ujb9j"}],["path",{d:"M20 12h.01",key:"1ykeid"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M4 12h.01",key:"158zrr"}],["path",{d:"M17.657 6.343h.01",key:"31pqzk"}],["path",{d:"M17.657 17.657h.01",key:"jehnf4"}],["path",{d:"M6.343 17.657h.01",key:"gdk6ow"}],["path",{d:"M6.343 6.343h.01",key:"1uurf0"}]],zo=R("sun-dim",Do);/**
|
|
227
|
+
* @license lucide-react v0.507.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const $o=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Po=R("sun",$o);/**
|
|
232
|
+
* @license lucide-react v0.507.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const Ko=[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]],Uo=R("sunrise",Ko);/**
|
|
237
|
+
* @license lucide-react v0.507.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const Bo=[["path",{d:"M12 10V2",key:"16sf7g"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]],Vo=R("sunset",Bo);/**
|
|
242
|
+
* @license lucide-react v0.507.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const Ho=[["path",{d:"M3.5 21 14 3",key:"1szst5"}],["path",{d:"M20.5 21 10 3",key:"1310c3"}],["path",{d:"M15.5 21 12 15l-3.5 6",key:"1ddtfw"}],["path",{d:"M2 21h20",key:"1nyx9w"}]],qo=R("tent",Ho);/**
|
|
247
|
+
* @license lucide-react v0.507.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const Go=[["path",{d:"M8 19a4 4 0 0 1-2.24-7.32A3.5 3.5 0 0 1 9 6.03V6a3 3 0 1 1 6 0v.04a3.5 3.5 0 0 1 3.24 5.65A4 4 0 0 1 16 19Z",key:"oadzkq"}],["path",{d:"M12 19v3",key:"npa21l"}]],Yo=R("tree-deciduous",Go);/**
|
|
252
|
+
* @license lucide-react v0.507.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const Qo=[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]],Wo=R("tree-palm",Qo);/**
|
|
257
|
+
* @license lucide-react v0.507.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const Zo=[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]],Jo=R("tree-pine",Zo);/**
|
|
262
|
+
* @license lucide-react v0.507.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const Xo=[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"1l6gj6"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]],el=R("trees",Xo);/**
|
|
267
|
+
* @license lucide-react v0.507.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const tl=[["path",{d:"M22 12a10.06 10.06 1 0 0-20 0Z",key:"1teyop"}],["path",{d:"M12 12v8a2 2 0 0 0 4 0",key:"ulpmoc"}],["path",{d:"M12 2v1",key:"11qlp1"}]],nl=R("umbrella",tl);/**
|
|
272
|
+
* @license lucide-react v0.507.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const sl=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],al=R("waves",sl);/**
|
|
277
|
+
* @license lucide-react v0.507.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const il=[["path",{d:"M2 22 16 8",key:"60hf96"}],["path",{d:"M3.47 12.53 5 11l1.53 1.53a3.5 3.5 0 0 1 0 4.94L5 19l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1rdhi6"}],["path",{d:"M7.47 8.53 9 7l1.53 1.53a3.5 3.5 0 0 1 0 4.94L9 15l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1sdzmb"}],["path",{d:"M11.47 4.53 13 3l1.53 1.53a3.5 3.5 0 0 1 0 4.94L13 11l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"eoatbi"}],["path",{d:"M20 2h2v2a4 4 0 0 1-4 4h-2V6a4 4 0 0 1 4-4Z",key:"19rau1"}],["path",{d:"M11.47 17.47 13 19l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L5 19l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"tc8ph9"}],["path",{d:"M15.47 13.47 17 15l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L9 15l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"2m8kc5"}],["path",{d:"M19.47 9.47 21 11l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L13 11l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"vex3ng"}]],rl=R("wheat",il);/**
|
|
282
|
+
* @license lucide-react v0.507.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const ol=[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]],ll=R("wind",ol),cl=({appVersion:e=null,slowWaitHintMs:s})=>{se();const a="https://local-operator.com/download",[i,r]=l.useState(!1),o=us(i,s??ui),[u,m]=l.useState(!1),[c,d]=l.useState(null),[x,p]=l.useState("info"),[h,_]=l.useState(null),[y,v]=l.useState(null),w=e?.trim()?e.trim():null,z=l.useRef(!1),S=$t(K=>K.openDetail),I=l.useRef(!1),b=l.useRef(0),N=l.useRef(!1),k=l.useCallback((K,U)=>{I.current=!1,d(K),p(U),m(!0)},[]),$=l.useCallback(K=>{I.current=!0,d(K),p("success"),m(!0)},[]),W=l.useCallback(()=>{I.current&&(I.current=!1,m(!1),d(null))},[]),{clearDeferredUpdate:Y}=Gs();l.useEffect(()=>{const K=window.api.updater.onUpdateError(g=>{z.current&&g.includes("manually")&&(_({message:n("ui.common.updates.check_for_updates_button.the_server_is_installed_outside_the_app_so_use_the_tool_you_insta"),command:""}),I.current=!1,d(null),p("warning"),m(!0))}),U=window.api.updater.onBackendUpdateDevMode(g=>{z.current&&k(g,"info")}),V=()=>{N.current=!0,W()},B=window.api.updater.onUpdateAvailable(V),M=window.api.updater.onUpdateNpxAvailable(V),A=window.api.updater.onBackendUpdateAvailable(V);return()=>{K(),U(),B(),M(),A()}},[W,k]),l.useEffect(()=>{let K=!1;const U=()=>{window.api.updater.getLastInstallAttempt().then(B=>{K||v(B)}).catch(()=>{})};U();const V=window.api.updater.onUpdateInstallFailed(()=>U());return()=>{K=!0,V()}},[]);const P=async()=>{const K=++b.current;W(),N.current=!1;try{r(!0),z.current=!0,Y(Ke.UI),Y(Ke.BACKEND);const U=await window.api.updater.checkForAllUpdates({manual:!0});if(K!==b.current)return;U.app==="available"&&S(Ke.UI),U.server==="available"&&S(Ke.BACKEND),U?.affirmation&&!N.current?$(U.affirmation):W()}catch(U){if(K!==b.current)return;console.warn(`Update check failed; the app-level alert owns the report: ${gi(U)}`)}finally{K===b.current&&r(!1),setTimeout(()=>{z.current=!1},2e3)}},Q=()=>{I.current=!1,m(!1),d(null)};return t.jsxs(t.Fragment,{children:[y&&t.jsxs("div",{className:"mb-3 rounded-sm bg-sunken p-3",children:[t.jsxs("p",{className:"text-body-sm text-ink",children:[n("ui.common.updates.check_for_updates_button.the_last_update_to_version"),y.targetVersion," ",n("ui.common.updates.check_for_updates_button.didn_t_finish"),y.attempts>1?n("ui.common.updates.check_for_updates_button.detail",{attempts:y.attempts,attemptsText:String(y.attempts)}):"",".",w?n("ui.common.updates.check_for_updates_button.version",{liveversion:String(w)}):null]}),t.jsxs("p",{className:"mt-1 text-meta text-ink-dim",children:[n("ui.common.updates.check_for_updates_button.detected")," ",y.detectedAt?new Date(y.detectedAt).toLocaleString():n("ui.common.updates.check_for_updates_button.at_an_unknown_time"),". ",y.detail]}),t.jsx(O,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>void window.api.openExternal(a),children:n("ui.common.updates.check_for_updates_button.download_a_fresh_copy")})]}),t.jsxs(O,{variant:"outline",onClick:()=>void P(),disabled:i,children:[i?t.jsx(ye,{size:"sm"}):null,i?n("ui.common.updates.check_for_updates_button.checking"):n("ui.common.updates.check_for_updates_button.check_for_updates")]}),o&&t.jsx("p",{className:"mt-2 text-meta text-ink-muted",children:n("ui.common.updates.check_for_updates_button.still_checking_a_slow_or_stalled_connection_can_hold_this_for_abo")}),h&&t.jsxs(yn,{open:u,autoHideDuration:1e4,onClose:Q,variant:"warning",children:[t.jsx("p",{className:"text-body-sm",children:h.message}),h.command&&t.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:h.command})]}),c&&x!=="danger"&&t.jsx(yn,{open:u,autoHideDuration:6e3,onClose:Q,variant:x,children:c})]})},ht=["system-prompt"],dl=()=>{const{shouldEnableQuery:e}=Ys();return Re({enabled:e({bypassInternetCheck:!0}),queryKey:ht,queryFn:async()=>{try{const a=await Zn(en.baseUrl).config.getSystemPrompt();if(a===null)return null;if(a.status>=400)throw new Error(a.message||n("ui.common.errors.system_prompt_fetch"));return a.result}catch(s){const a=s instanceof Error?s.message:n("ui.common.errors.system_prompt_fetch_unknown");throw Jn(a),s}},refetchOnWindowFocus:!1,staleTime:5e3})},ul=()=>{const e=sn(),s=Zn(en.baseUrl);return Qs({mutationFn:async a=>{try{const i=await s.config.updateSystemPrompt(a);if(i.status>=400)throw new Error(i.message||n("ui.common.errors.system_prompt_update"));return i.result}catch(i){const r=i instanceof Error?i.message:n("ui.common.errors.system_prompt_update_unknown");throw Jn(r),i}},onSuccess:async a=>{await e.invalidateQueries({queryKey:ht,refetchType:"none"}),e.setQueryData(ht,i=>i&&{...i,...a}),await e.refetchQueries({queryKey:ht,type:"all"}),Ws(n("ui.notices.settings.system_prompt_updated"))},onError:a=>{console.error("Error updating system prompt:",a)}})},xs=({value:e,label:s,description:a,onChange:i,icon:r,isSaving:o=!1,disabled:u=!1})=>{se();const[m,c]=l.useState(e),d=l.useId(),x=`${d}-label`,p=`${d}-description`,h=async _=>{if(!(o||u)){c(_);try{await i(_)}catch(y){c(!_),console.error("Error toggling setting:",y)}}};return t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("span",{id:x,className:"flex min-h-6 items-center gap-2 text-body text-ink",children:[r&&t.jsx(r,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-dim"}),s]}),a&&t.jsx("p",{id:p,className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:a})]}),t.jsx("div",{className:"flex h-6 shrink-0 items-center",children:o?t.jsx(ye,{size:"md",label:n("ui.common.forms.toggle_setting.saving",{label:s})}):t.jsx(_s,{checked:m,onCheckedChange:h,disabled:u,"aria-labelledby":x,"aria-describedby":a?p:void 0})})]})};function Cn(e,s){const a=nr(e,s?.in);if(!Xi(a))throw new RangeError("Invalid time value");const i=qe(a.getDate(),2),r=qe(a.getMonth()+1,2),o=a.getFullYear(),u=qe(a.getHours(),2),m=qe(a.getMinutes(),2),c=qe(a.getSeconds(),2);let d="",x="";const p=a.getTimezoneOffset();if(p!==0){const h=Math.abs(p),_=qe(Math.trunc(h/60),2),y=qe(h%60,2);x=`${p<0?"+":"-"}${_}:${y}`}else x="Z";return`${o}-${r}-${i}T${u}:${m}:${c}${d}${x}`}function gl(e,s,a){return er(e,-30,a)}var ml=Zs({chartName:"LineChart",GraphicalChild:Xn,axisComponents:[{axisType:"xAxis",AxisComp:Js},{axisType:"yAxis",AxisComp:Xs}],formatAxisMap:ea});const _l=["radient","creditBalance"],pl=e=>{const{user:s,isAuthenticated:a}=tn(),i=s?.account?.tenant_id,r=a&&!!i&&e?.enabled;return Re({queryKey:[_l,i],queryFn:async()=>{if(!i)throw new Error(n("ui.common.errors.tenant_missing"));const o=await es({operation:"credits",tenantId:i});if(!o||typeof o.balance!="number")throw new Error(n("ui.common.errors.credit_balance_invalid"));return o},enabled:r,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},fl=["radient","usageRollup"],hl=(e,s)=>{const{user:a,isAuthenticated:i}=tn(),r=a?.account?.tenant_id,o=i&&!!r&&s?.enabled;return Re({queryKey:[...fl,r,e],queryFn:async()=>{if(!r)throw new Error(n("ui.common.errors.tenant_missing"));const u={};for(const[c,d]of Object.entries(e))d!=null&&(u[c]=String(d));const m=await es({operation:"usage",tenantId:r,query:u});if(!m)throw new Error(n("ui.common.errors.usage_rollup_invalid"));return m},enabled:o,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},xl=e=>e==="sidebars"?n("ui.settings.appearance.window_glass.coverage_sidebars"):n("ui.settings.appearance.window_glass.coverage_full"),yl=e=>{switch(e){case"window":return n("ui.settings.appearance.window_glass.material_window");case"menu":return n("ui.settings.appearance.window_glass.material_menu");case"popover":return n("ui.settings.appearance.window_glass.material_popover");case"mica":return n("ui.settings.appearance.window_glass.material_mica");case"acrylic":return n("ui.settings.appearance.window_glass.material_acrylic");case"tabbed":return n("ui.settings.appearance.window_glass.material_tabbed")}},vl=e=>{switch(e){case"reduced-transparency":return n("ui.settings.appearance.window_glass.unsupported_reduced_transparency");case"windows-too-old":return n("ui.settings.appearance.window_glass.unsupported_windows_too_old");case"windows-unverified":return n("ui.settings.appearance.window_glass.unsupported_windows_unverified");case"linux-compositor-dependent":return n("ui.settings.appearance.window_glass.unsupported_linux");case"hardware-acceleration-disabled":return n("ui.settings.appearance.window_glass.unsupported_acceleration");case"gpu-unavailable":return n("ui.settings.appearance.window_glass.unsupported_gpu");case"backdrop-filter-unavailable":return n("ui.settings.appearance.window_glass.unsupported_backdrop_filter");default:return n("ui.settings.appearance.window_glass.unsupported_other")}},En=({label:e,description:s,value:a,onValueChange:i,options:r})=>{const o=l.useId();return t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{id:o,className:"flex min-h-6 items-center text-body text-ink",children:e}),t.jsx("p",{className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:s})]}),t.jsx("div",{className:"flex h-6 shrink-0 items-center",children:t.jsx(jt,{value:a,onValueChange:i,children:t.jsx(wt,{"aria-labelledby":o,children:r.map(u=>t.jsx(We,{value:u.value,children:u.label},u.value))})})})]})},bl=({state:e,onChange:s})=>{se();const a=l.useId(),i=`${a}-description`,[r,o]=l.useState(null),u=l.useRef(!1),m=l.useRef(null),c=e?.settings.intensity??0;if(!e)return null;const d=!e.capability.supported,x=d?vl(e.capability.reason):null,p=async y=>{if(u.current){m.current=y;return}u.current=!0;try{await s({intensity:y})}finally{u.current=!1;const v=m.current;m.current=null,v!==null&&v!==y?p(v):o(null)}},h=e.settings.enabled,_=r??c;return t.jsxs("div",{className:"flex flex-col gap-4","data-window-glass":"","data-glass-gate":e.capability.reason,children:[t.jsx(Je,{content:x,disabled:!d,children:t.jsx("div",{className:d?"opacity-60":void 0,children:t.jsx(xs,{value:d?!1:h,disabled:d,label:n("ui.settings.appearance.window_glass.label"),description:n("ui.settings.appearance.window_glass.description"),onChange:async y=>s({enabled:y})},d?"unavailable":"available")})}),x&&t.jsx("p",{"data-glass-unsupported":e.capability.reason,className:"max-w-2xl text-body-sm text-ink-muted",children:x}),e.restartRequired&&t.jsx("output",{className:"block max-w-2xl text-body-sm text-ink","data-glass-restart":"",children:n("ui.settings.appearance.window_glass.restart_needed")}),h&&!d&&t.jsxs(t.Fragment,{children:[t.jsx(En,{label:n("ui.settings.appearance.window_glass.coverage_label"),description:n("ui.settings.appearance.window_glass.coverage_description"),value:e.settings.coverage,onValueChange:y=>void s({coverage:y}),options:ta.map(y=>({value:y,label:xl(y)}))}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex min-h-6 items-center justify-between gap-3",children:[t.jsx("label",{htmlFor:a,className:"text-body text-ink",children:n("ui.settings.appearance.window_glass.intensity_label")}),t.jsx("span",{"data-glass-readout":"",className:"shrink-0 text-meta text-ink-dim tabular-nums",children:n("ui.settings.appearance.window_glass.intensity_value",{value:String(_)})})]}),t.jsx("p",{id:i,className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:n("ui.settings.appearance.window_glass.intensity_description")}),t.jsx("input",{id:a,type:"range",min:0,max:100,step:5,value:_,"aria-describedby":i,"aria-valuetext":n("ui.settings.appearance.window_glass.intensity_value",{value:String(_)}),onChange:y=>{const v=Number(y.target.value);o(v),p(v)},style:{"--fill":`${_}%`},className:"mt-3 h-4 w-full cursor-pointer appearance-none bg-transparent bg-center bg-no-repeat bg-[length:100%_6px] bg-[linear-gradient(to_right,var(--color-accent)_0_var(--fill),var(--color-sunken)_var(--fill)_100%)] [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-accent [&::-webkit-slider-thumb]:transition-colors [&::-webkit-slider-thumb]:duration-fast [&::-webkit-slider-thumb]:ease-out-quart [&::-webkit-slider-thumb]:hover:bg-accent-hover"}),t.jsxs("div",{"aria-hidden":"true",className:"mt-1 flex justify-between text-meta text-ink-dim",children:[t.jsx("span",{children:n("ui.settings.appearance.window_glass.intensity_start")}),t.jsx("span",{children:n("ui.settings.appearance.window_glass.intensity_end")})]})]}),t.jsx(En,{label:n("ui.settings.appearance.window_glass.material_label"),description:n("ui.settings.appearance.window_glass.material_description"),value:e.settings.material,onValueChange:y=>void s({material:y}),options:e.capability.materials.map(y=>({value:y,label:yl(y)}))})]})]})},kl=new Set(["B","C","D","E","F"]);function jl(e){const{status:s,refused:a,everVisible:i,checking:r=!1}=e;return s?s.update_required||s.state==="signed_out"?"absent":s.state==="unavailable"?s.error?.code==="messaging_unavailable"?"dark":i?"error":"absent":s.surface_state==="G"?s.error===null||s.error?.code==="messaging_unavailable"?"dark":"error":s.capability<1||s.state!=="ready"||!s.visibility.settings?"absent":s.surface_state&&kl.has(s.surface_state)?"visible":"absent":r&&i?"visible":a&&i?"error":"absent"}function wl(e,s){return e!=="absent"}function tt(e,s){if(e.surface_state==="F")return"F";const a=s.endpoint;return a?a.state==="paused"?"D":a.state==="disabled"?"E":"C":"B"}const Nl="open_chief_of_staff";function Sl(e){const s=e?.delivery_hold;if(!s||s.code!==Nl||s.count<=0)return null;const a=s.session||e?.local.session||null;return{count:s.count,sessionId:a}}function ys(e){return qa(e)}function Ml(e){return e.target.endpoint_id?{kind:"endpoint",id:e.target.endpoint_id}:{kind:"account",id:e.target.account_id??""}}function Yt(e){return e.map((s,a)=>{const i=Ml(s);return{key:`${s.direction}:${s.effect}:${i.kind}:${i.id}:${a}`,direction:s.direction,effect:s.effect,kind:i.kind,id:i.id}})}function Qt(e,s){return e.filter(i=>i.effect==="deny"||s[i.direction]==="listed_only").map(i=>({direction:i.direction,effect:i.effect,target:i.kind==="endpoint"?{endpoint_id:i.id}:{account_id:i.id}})).sort((i,r)=>i.direction.localeCompare(r.direction)||i.effect.localeCompare(r.effect)||JSON.stringify(i.target).localeCompare(JSON.stringify(r.target)))}function vs(e){return JSON.stringify(e)}function Cl(e){return e.saving?{disabled:!0,reason:"saving"}:["send","receive"].some(i=>e.modes[i]==="listed_only"&&!e.entries.some(r=>r.direction===i&&r.effect==="allow"))?{disabled:!0,reason:"needs_entry"}:vs(Qt(e.entries,e.modes))===e.savedSignature?{disabled:!0,reason:"unchanged"}:{disabled:!1}}const El=/^[^\s\p{Cc}]{1,128}$/u;function Al(e){return e===""?n("ui.agentMessages.settings.allowlist.identifier_empty"):e.length>128?n("ui.agentMessages.settings.allowlist.identifier_long"):El.test(e)?null:n("ui.agentMessages.settings.allowlist.identifier_invalid")}function xt(e){switch(e.code){case"bridge_signin_required":return n("ui.agentMessages.settings.refusal.sign_in");case"bridge_not_available":return n("ui.agentMessages.settings.refusal.not_available");case"bridge_disabled":return n("ui.agentMessages.settings.refusal.disabled");case"rate_limited":return n("ui.agentMessages.settings.refusal.rate_limited");case"invalid_request":return n("ui.agentMessages.settings.refusal.invalid_request");case"consent_version_unknown":return n("ui.agentMessages.settings.consent.changed");case"messaging_unavailable":return n("ui.agentMessages.settings.dark.body");default:return e.message||n("ui.agentMessages.settings.refusal.generic")}}const Il=['[data-agent-messages-action="turn_on_again"]','[role="switch"]','[data-agent-messages-action="enable"]'],It="__none__";function Rl({availability:e,status:s,accountId:a,refusal:i=null,api:r=_i,onRefreshStatus:o,sessions:u=[],onOpenSession:m,focus:c=!1}){se();const[d,x]=l.useState({kind:"loading"}),[p,h]=l.useState(0),[_,y]=l.useState(null),[v,w]=l.useState(null),[z,S]=l.useState(s?.local.enabled??!1),[I,b]=l.useState(s?.local.session??""),N=s?.tenant_id??void 0,k=e==="visible",$=s?.account_id??null,W=$!==null&&$===a;l.useEffect(()=>{if(!k)return;let M=!1;return x({kind:"loading"}),w(null),(async()=>{try{const A=await r.settings(N);if(M)return;if(!A){x({kind:"error",refusal:{code:"invalid_response",message:n("ui.agentMessages.settings.error.unreadable")}});return}let g=null;if(A.endpoint){if(g=await r.allowlist(A.settings.tenant_id),M)return;if(!g){x({kind:"error",refusal:{code:"invalid_response",message:n("ui.agentMessages.settings.error.unreadable")}});return}}x({kind:"ready",settings:A,allowlist:g})}catch(A){if(M)return;x({kind:"error",refusal:Ae(A)})}})(),()=>{M=!0}},[k,a,$,N,p,r]),l.useEffect(()=>{if(!k||d.kind!=="ready"||!d.settings.endpoint||d.allowlist)return;let M=!1;return(async()=>{try{const A=await r.allowlist(d.settings.settings.tenant_id);if(M||!A)return;x(g=>g.kind==="ready"&&!g.allowlist?{...g,allowlist:A}:g)}catch(A){M||w(Ae(A))}})(),()=>{M=!0}},[k,d,r]),l.useEffect(()=>{s&&(S(s.local.enabled),b(s.local.session))},[s]);const Y=()=>h(M=>M+1),P=d.kind==="ready"?d.settings:null,Q=Gi(s,P,$),K=Yi({api:r,accountId:W?$:null,tenantId:P?.settings.tenant_id??null,markerTenantId:s?.tenant_id??null,onSettings:M=>x(A=>A.kind==="ready"?{...A,settings:M}:A),onChanged:()=>o(!0)}),U=l.useRef(null),V=l.useRef(!1);if(l.useEffect(()=>{if(!c){V.current=!1;return}if(V.current||d.kind!=="ready"||_!==null)return;const M=U.current,A=Il.map(g=>M?.querySelector(`${g}:not(:disabled)`)).find(g=>g!=null);A&&(A.focus(),V.current=!0)},[c,d,_,s]),e==="absent")return null;if(e==="dark")return t.jsxs("div",{"data-agent-messages-section":"",className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.agentMessages.settings.dark.title")}),t.jsx("p",{className:"max-w-2xl text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.dark.body")}),t.jsx("p",{className:"max-w-2xl text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.dark.nothing_enabled")})]});if(e==="error")return t.jsx("div",{"data-agent-messages-section":"",children:t.jsxs(ae,{variant:"warning",children:[t.jsx(Nt,{children:n("ui.agentMessages.settings.error.title")}),t.jsxs(Ne,{children:[i?xt(i):n("ui.agentMessages.settings.refusal.generic"),t.jsx(O,{className:"mt-3",variant:"secondary",onClick:()=>{Y(),o(!0)},children:n("ui.agentMessages.settings.error.retry")})]})]})});if(!s||!a)return null;const B=Sl(s);return t.jsxs("div",{ref:U,"data-agent-messages-section":"",className:"flex flex-col gap-6",children:[B&&t.jsx(Ol,{count:B.count,onMessage:B.sessionId&&m?()=>m(B.sessionId):void 0}),Q&&t.jsx(Qi,{consentText:Ga(s,P),pending:K.pending,failure:K.failure,onTurnOff:()=>void K.turnOff(),onDismiss:()=>void K.dismiss()}),v&&t.jsx(ae,{variant:"warning",children:t.jsx(Ne,{children:xt(v)})}),d.kind==="loading"&&t.jsx(Tl,{}),d.kind==="error"&&t.jsxs(ae,{variant:"warning",children:[t.jsx(Nt,{children:n("ui.agentMessages.settings.error.title")}),t.jsxs(Ne,{children:[d.refusal.code!=="client_unavailable"&&t.jsx("span",{className:"block",children:xt(d.refusal)}),t.jsx("span",{className:"block",children:n("ui.agentMessages.settings.error.no_changes")}),t.jsx(O,{className:"mt-3",variant:"secondary",onClick:Y,children:n("ui.agentMessages.settings.error.retry")})]})]}),d.kind==="ready"&&t.jsxs(t.Fragment,{children:[t.jsx(Dl,{state:tt(s,d.settings),status:s,settings:d.settings,accountId:$??a,accountMatches:W,api:r,pending:_,localEnabled:z,onActionRefusal:w,onSettings:M=>x(A=>A.kind==="ready"?{...A,settings:M}:A),onLocalEnabled:S,onRefreshStatus:o,setPending:y}),t.jsx($l,{value:I,sessions:u,pending:_==="session",disabled:_!==null,onSave:async M=>{y("session"),w(null);try{await r.localSetting("team_bridge.session",M),b(M),await o(!0)}catch(A){w(Ae(A))}finally{y(null)}}}),d.allowlist&&(tt(s,d.settings)==="C"||tt(s,d.settings)==="D"||tt(s,d.settings)==="F")&&t.jsx(Pl,{allowlist:d.allowlist,accountId:$??a,accountMatches:W,readOnly:s.read_only===!0&&tt(s,d.settings)==="F",pending:_!==null,onSaving:M=>y(M?"allowlist":null),onRefusal:w,onSaved:M=>x(A=>A.kind==="ready"?{...A,allowlist:M}:A),api:r},d.allowlist.view.tenant_id??"tenant")]})]})}function Tl(){return t.jsxs("div",{className:"flex flex-col gap-3","aria-busy":"true",children:[t.jsx(xe,{className:"h-5 w-40"}),t.jsx(xe,{className:"h-4 w-full max-w-xl"}),t.jsx(xe,{className:"h-9 w-36"}),t.jsx(xe,{className:"h-4 w-64"})]})}const Ol=({count:e,onMessage:s})=>t.jsx("output",{className:"block","data-agent-messages-hold":"open_chief_of_staff",children:t.jsx(ae,{variant:"info",className:ue(pi,"border-transparent"),children:t.jsxs("div",{className:"flex w-full min-w-0 items-center gap-3",children:[t.jsx("p",{className:"min-w-0 flex-1 text-body-sm text-ink",children:s?n("ui.agentMessages.settings.hold.chief_of_staff",{count:e}):n("ui.agentMessages.settings.hold.chief_of_staff_unlinked",{count:e})}),s&&t.jsx(O,{variant:"ghost",size:"sm",className:"shrink-0 text-ink",onClick:s,children:n("ui.agentMessages.settings.hold.open")})]})})}),An=({text:e})=>t.jsx("div",{className:"rounded-md border border-hairline bg-sunken p-3",children:t.jsx("p",{className:"whitespace-pre-wrap text-body-sm text-ink-muted",children:e})}),bs={B:"ui.agentMessages.settings.state.b_title",C:"ui.agentMessages.settings.state.c_title",D:"ui.agentMessages.settings.state.d_title",E:"ui.agentMessages.settings.state.e_title",F:"ui.agentMessages.settings.state.f_title"},ks={B:"ui.agentMessages.settings.state.b_body",C:"ui.agentMessages.settings.state.c_body",D:"ui.agentMessages.settings.state.d_body",E:"ui.agentMessages.settings.state.e_body",F:"ui.agentMessages.settings.state.f_body"};function Ll(e){return e==="B"?"ui.agentMessages.settings.default_on.b_title":bs[e]}function Fl(e){return e==="B"?"ui.agentMessages.settings.default_on.b_body":e==="E"?"ui.agentMessages.settings.default_on.e_body":ks[e]}const Dl=({state:e,status:s,settings:a,accountId:i,accountMatches:r,api:o,pending:u,localEnabled:m,onActionRefusal:c,onSettings:d,onLocalEnabled:x,onRefreshStatus:p,setPending:h})=>{const _=ys(s),y=a.settings.tenant_id,v=u!==null||!r,w=Ya(s);async function z(k,$={}){if(!r)return null;h(k),c(null);try{const W=await o.updateSettings({expected_account_id:i,tenant_id:y,state:k,...$});if(d(W),k==="disabled"&&!w)try{await o.localSetting("team_bridge.enabled",!1),x(!1)}catch(Y){c(Ae(Y))}return W}catch(W){const Y=Ae(W);return c(Y),Y.code==="consent_version_unknown"&&await p(!0),null}finally{h(null)}}async function S(){if(!(!_||!r||!await z("active",{consent_version:_.version,consented_via:"settings"}))){h("local");try{await o.localSetting("team_bridge.enabled",!0),x(!0),await p(!0)}catch($){c(Ae($))}finally{h(null)}}}if(e==="F")return t.jsxs("div",{"data-agent-messages-state":e,className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"rounded-md border border-hairline bg-sunken p-3",children:[t.jsx("p",{className:"text-body-sm text-ink",children:s.state_note?.trim()?s.state_note:n("ui.agentMessages.settings.state.turned_off_title")}),t.jsx("p",{className:"mt-1 text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.state.turned_off_org")})]}),t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.state.read_only")}),t.jsx(Rt,{settings:a,status:s,readOnly:!0}),t.jsx(Tt,{value:m,disabled:v,description:n("ui.agentMessages.settings.local.stays_enrolled"),onChange:async k=>{h("local"),c(null);try{await o.localSetting("team_bridge.enabled",k),x(k),await p(!0)}catch($){c(Ae($))}finally{h(null)}}})]});const I=a.endpoint?.label?.trim(),b=a.endpoint?.consent??null,N=b!==null&&!b.current;return t.jsxs("div",{"data-agent-messages-state":e,className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("h3",{className:"text-heading text-ink",children:n(w?Ll(e):bs[e])}),I&&t.jsx("span",{className:"text-body-sm text-ink-muted",children:I})]}),t.jsx("p",{className:"max-w-2xl text-body-sm text-ink-muted",children:n(w?Fl(e):ks[e])}),w&&e==="E"&&t.jsxs("div",{className:"flex flex-col gap-3",children:[_?t.jsx(An,{text:_.text}):t.jsx(ae,{variant:"warning",children:t.jsx(Ne,{children:n("ui.agentMessages.settings.consent.unavailable")})}),t.jsx("div",{className:"flex flex-wrap items-center gap-3",children:t.jsx(O,{"data-agent-messages-action":"turn_on_again",onClick:()=>void S(),disabled:v||!_,children:n("ui.agentMessages.settings.action.turn_on_again")})})]}),!w&&(e==="B"||e==="E")&&t.jsxs("div",{className:"flex flex-col gap-3",children:[_?t.jsx(An,{text:_.text}):t.jsx(ae,{variant:"warning",children:t.jsx(Ne,{children:n("ui.agentMessages.settings.consent.unavailable")})}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsx(O,{"data-agent-messages-action":"enable",onClick:()=>void S(),disabled:v||!_,children:e==="B"?n("ui.agentMessages.settings.action.enable"):n("ui.agentMessages.settings.action.enable_again")}),t.jsx("span",{className:"text-meta text-ink-dim",children:n("ui.agentMessages.settings.off_by_default")})]})]}),e==="C"&&a.endpoint&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(O,{"data-agent-messages-action":"pause",variant:"secondary",disabled:v,onClick:()=>void z("paused"),children:n("ui.agentMessages.settings.action.pause")}),t.jsx(O,{"data-agent-messages-action":"turn_off",variant:"secondary",disabled:v,onClick:()=>void z("disabled"),children:n("ui.agentMessages.settings.action.turn_off")})]}),t.jsx(Rt,{settings:a,status:s}),N&&!w&&t.jsx(In,{onRenew:()=>void S(),disabled:v||!_}),t.jsx(Tt,{value:m,disabled:v,description:n("ui.agentMessages.settings.local.stays_enrolled"),onChange:async k=>{h("local"),c(null);try{await o.localSetting("team_bridge.enabled",k),x(k),await p(!0)}catch($){c(Ae($))}finally{h(null)}}})]}),e==="D"&&a.endpoint&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(O,{"data-agent-messages-action":"resume",disabled:v||a.settings.consent_required&&_===null,onClick:()=>void z("active",a.settings.consent_required&&_?{consent_version:_.version,consented_via:"settings"}:{}),children:n("ui.agentMessages.settings.action.resume")}),t.jsx(O,{"data-agent-messages-action":"turn_off",variant:"secondary",disabled:v,onClick:()=>void z("disabled"),children:n("ui.agentMessages.settings.action.turn_off")})]}),a.settings.consent_required&&!_&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.consent.unavailable")}),t.jsx(Rt,{settings:a,status:s}),N&&!w&&t.jsx(In,{onRenew:()=>void S(),disabled:v||!_}),t.jsx(Tt,{value:m,disabled:v,description:n("ui.agentMessages.settings.local.stays_enrolled"),onChange:async k=>{h("local"),c(null);try{await o.localSetting("team_bridge.enabled",k),x(k),await p(!0)}catch($){c(Ae($))}finally{h(null)}}})]})]})},In=({onRenew:e,disabled:s})=>t.jsx(ae,{variant:"warning",children:t.jsxs(Ne,{children:[n("ui.agentMessages.settings.consent.renew"),t.jsx(O,{"data-agent-messages-action":"enable",className:"mt-3",variant:"secondary",disabled:s,onClick:e,children:n("ui.agentMessages.settings.action.enable_again")})]})});function zl(e){switch(e){case"dialog":return n("ui.agentMessages.settings.consent.via_dialog");case"settings":return n("ui.agentMessages.settings.consent.via_settings");case"default_on":return n("ui.agentMessages.settings.consent.via_default_on");default:return e}}const Rt=({settings:e,status:s,readOnly:a=!1})=>{const i=e.endpoint?.consent??null,r=ys(s);return i?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs(ot,{children:[t.jsx(me,{label:n("ui.agentMessages.settings.consent.version"),value:i.version}),t.jsx(me,{label:n("ui.agentMessages.settings.consent.via"),value:zl(i.consented_via)}),t.jsx(me,{label:n("ui.agentMessages.settings.consent.at"),value:i.consented_at})]}),!a&&r&&t.jsxs("details",{children:[t.jsx("summary",{className:"cursor-pointer text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.consent.show")}),t.jsx("p",{className:"mt-2 whitespace-pre-wrap text-body-sm text-ink-muted",children:r.text})]})]}):t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.consent.no_record")})},Tt=({value:e,disabled:s,description:a,onChange:i})=>{const r=l.useId();return t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{id:r,className:"text-body-sm text-ink",children:n("ui.agentMessages.settings.local.label")}),t.jsx("p",{className:"mt-0.5 text-meta text-ink-dim",children:a})]}),t.jsx(_s,{"aria-labelledby":r,checked:e,disabled:s,onCheckedChange:o=>void i(o)})]})},$l=({value:e,sessions:s,pending:a,disabled:i,onSave:r})=>{const o=s.some(u=>u.session_id===e);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.agentMessages.settings.session.title")}),t.jsx("p",{className:"max-w-2xl text-meta text-ink-dim",children:n("ui.agentMessages.settings.session.help")}),t.jsxs(on,{value:e===""?It:e,disabled:i,onValueChange:u=>void r(u===It?"":u),children:[t.jsx(ln,{className:"w-full max-w-md","aria-label":n("ui.agentMessages.settings.session.title"),children:t.jsx(cn,{})}),t.jsxs(dn,{children:[t.jsx(Ze,{value:It,children:n("ui.agentMessages.settings.session.none")}),s.map(u=>t.jsx(Ze,{value:u.session_id,children:u.title?.trim()||u.session_id},u.session_id)),e!==""&&!o&&t.jsx(Ze,{value:e,children:e})]})]}),e!==""&&!o&&t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.agentMessages.settings.session.unavailable")}),a&&t.jsx("p",{className:"text-meta text-ink-dim","aria-live":"polite",children:n("ui.agentMessages.settings.saving")})]})},Pl=({allowlist:e,accountId:s,accountMatches:a,readOnly:i,pending:r,api:o,onSaving:u,onRefusal:m,onSaved:c})=>{const[d,x]=l.useState(()=>Yt(e.allowlist.entries)),[p,h]=l.useState(()=>({send:e.view.directions.send.mode,receive:e.view.directions.receive.mode})),_=r||i||!a,y=vs(Qt(Kl(e),Ul(e))),v=Cl({entries:d,modes:p,savedSignature:y,saving:r}),w=l.useRef(0),z=b=>x(N=>[...N,{...b,key:`${b.direction}:${b.effect}:${w.current++}`}]),S=b=>x(N=>N.filter(k=>k.key!==b)),I=async()=>{if(!_){u(!0),m(null);try{const b=await o.updateAllowlist({expected_account_id:s,tenant_id:e.allowlist.tenant_id,entries:Qt(d,p)}),N=Yt(b.allowlist.entries);x(N),h({send:b.view.directions.send.mode,receive:b.view.directions.receive.mode}),c(b)}catch(b){m(Ae(b))}finally{u(!1)}}};return t.jsxs("div",{"data-agent-messages-allowlist":"",className:"flex flex-col gap-5",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.agentMessages.settings.allowlist.title")}),t.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.allowlist.description")})]}),t.jsx(Rn,{direction:"receive",title:n("ui.agentMessages.settings.allowlist.receive"),mode:p.receive,cues:e.view.cues,entries:d.filter(b=>b.direction==="receive"),disabled:_,onMode:b=>h(N=>({...N,receive:b})),onAdd:b=>z({...b,direction:"receive"}),onRemove:S}),t.jsx(Rn,{direction:"send",title:n("ui.agentMessages.settings.allowlist.send"),mode:p.send,cues:e.view.cues,entries:d.filter(b=>b.direction==="send"),disabled:_,onMode:b=>h(N=>({...N,send:b})),onAdd:b=>z({...b,direction:"send"}),onRemove:S}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs(O,{onClick:()=>void I(),disabled:v.disabled||_,children:[t.jsx(ms,{size:14}),n("ui.agentMessages.settings.allowlist.save")]}),v.disabled&&v.reason==="needs_entry"&&t.jsx("span",{className:"text-meta text-ink-dim",children:n("ui.agentMessages.settings.allowlist.needs_entry")}),v.disabled&&v.reason==="unchanged"&&t.jsx("span",{className:"text-meta text-ink-dim",children:n("ui.agentMessages.settings.allowlist.unchanged")}),i&&t.jsx("span",{className:"text-meta text-ink-dim",children:n("ui.agentMessages.settings.allowlist.read_only")}),r&&t.jsx("span",{className:"text-meta text-ink-dim","aria-live":"polite",children:n("ui.agentMessages.settings.saving")})]})]})};function Kl(e){return Yt(e.allowlist.entries)}function Ul(e){return{send:e.view.directions.send.mode,receive:e.view.directions.receive.mode}}const Rn=({direction:e,title:s,mode:a,cues:i,entries:r,disabled:o,onMode:u,onAdd:m,onRemove:c})=>{const d=r.filter(p=>p.effect==="allow"),x=r.filter(p=>p.effect==="deny");return t.jsxs("fieldset",{"data-agent-messages-direction":e,"data-agent-messages-level":a,className:"flex flex-col gap-3 rounded-md border border-hairline p-3",children:[t.jsx("legend",{className:"px-1 text-body-sm text-ink",children:s}),t.jsx(Bl,{mode:a,disabled:o,onMode:u}),t.jsxs("div",{className:"flex flex-col gap-1 text-meta text-ink-dim",children:[i.allow_entry_switches_direction_to_listed_only&&t.jsx("p",{children:n("ui.agentMessages.settings.allowlist.cue_listed_only")}),i.removing_allow_does_not_stop_open_thread&&t.jsx("p",{children:n("ui.agentMessages.settings.allowlist.cue_remove")}),i.deny_stops_pair_both_directions&&t.jsx("p",{children:n("ui.agentMessages.settings.allowlist.cue_deny")})]}),a==="listed_only"&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.agentMessages.settings.allowlist.allowed_heading")}),d.length===0&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.allowlist.allowed_empty")}),d.map(p=>t.jsx(Tn,{entry:p,disabled:o,onRemove:()=>c(p.key)},p.key)),t.jsx(On,{label:n("ui.agentMessages.settings.allowlist.add_allowed"),disabled:o,onAdd:p=>m({...p,effect:"allow"})})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.agentMessages.settings.allowlist.blocked_heading")}),x.length===0&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.agentMessages.settings.allowlist.blocked_empty")}),x.map(p=>t.jsx(Tn,{entry:p,disabled:o,onRemove:()=>c(p.key)},p.key)),t.jsx(On,{label:n("ui.agentMessages.settings.allowlist.add_blocked"),disabled:o,onAdd:p=>m({...p,effect:"deny"})})]})]})},Bl=({mode:e,disabled:s,onMode:a})=>{const i=[{value:"class_default",label:n("ui.agentMessages.settings.allowlist.anyone")},{value:"listed_only",label:n("ui.agentMessages.settings.allowlist.listed_only")}];return t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:n("ui.agentMessages.settings.allowlist.level")}),t.jsx("div",{"data-glass-well":"",className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:i.map(r=>t.jsx(O,{variant:"ghost",size:"sm","aria-pressed":e===r.value,disabled:s,onClick:()=>a(r.value),className:ue(e===r.value&&"bg-surface text-ink hover:bg-surface"),children:r.label},r.value))})]})},Tn=({entry:e,disabled:s,onRemove:a})=>t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded border border-hairline px-2 py-1",children:[t.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[t.jsx("span",{className:"shrink-0 text-meta text-ink-dim",children:e.kind==="endpoint"?n("ui.agentMessages.settings.allowlist.agent_id"):n("ui.agentMessages.settings.allowlist.person_id")}),t.jsx("span",{className:"break-all font-mono text-body-sm text-ink",children:e.id})]}),t.jsx(O,{variant:"secondary",size:"sm",disabled:s,"aria-label":`${n("ui.agentMessages.settings.allowlist.remove")} ${e.id}`,onClick:a,children:n("ui.agentMessages.settings.allowlist.remove")})]}),On=({label:e,disabled:s,onAdd:a})=>{const[i,r]=l.useState("endpoint"),[o,u]=l.useState(""),[m,c]=l.useState(null),d=l.useId(),x=`${d}-help`,p=()=>{const h=Al(o.trim());c(h),!h&&(a({kind:i,id:o.trim()}),u(""))};return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Ie,{htmlFor:d,children:e}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs(on,{value:i,disabled:s,onValueChange:h=>r(h),children:[t.jsx(ln,{className:"w-32","aria-label":n("ui.agentMessages.settings.allowlist.kind"),children:t.jsx(cn,{})}),t.jsxs(dn,{children:[t.jsx(Ze,{value:"endpoint",children:n("ui.agentMessages.settings.allowlist.kind_agent")}),t.jsx(Ze,{value:"account",children:n("ui.agentMessages.settings.allowlist.kind_person")})]})]}),t.jsx(De,{id:d,"aria-describedby":x,className:"max-w-xs",value:o,disabled:s,placeholder:n("ui.agentMessages.settings.allowlist.identifier"),onChange:h=>u(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),p())}}),t.jsx(O,{variant:"secondary",size:"sm",disabled:s,onClick:p,children:n("ui.agentMessages.settings.allowlist.add")})]}),t.jsx("p",{id:x,className:"text-meta text-ink-dim",children:i==="endpoint"?n("ui.agentMessages.settings.allowlist.identifier_help_agent"):n("ui.agentMessages.settings.allowlist.identifier_help_person")}),m&&t.jsx("p",{className:"text-meta text-danger",children:m})]})};function Vl(){const{snapshot:e}=gs(),[s,a]=l.useState(!1),i=jl({status:e.status,refused:e.refusal!==null,everVisible:s,checking:e.checking});return l.useEffect(()=>{i!=="absent"&&a(!0)},[i]),l.useEffect(()=>{mi()},[]),i}const Ln={get[Ke.UI](){return n("ui.settings.updates.update_following.application_updates")},get[Ke.BACKEND](){return n("ui.settings.updates.update_following.server_updates")}},ut={patch:{get label(){return n("ui.settings.updates.update_following.patch_label")},get description(){return n("ui.settings.updates.update_following.patch_help")}},minor:{get label(){return n("ui.settings.updates.update_following.minor_label")},get description(){return n("ui.settings.updates.update_following.minor_help")}},major:{get label(){return n("ui.settings.updates.update_following.major_label")},get description(){return n("ui.settings.updates.update_following.major_help")}}},Fn=({type:e})=>{se();const s=$t(i=>i.followed[e]),a=$t(i=>i.setFollowedSegment);return t.jsxs("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:items-center sm:justify-between sm:gap-6",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-body-sm text-ink",children:Ln[e]}),t.jsx("div",{className:"mt-0.5 text-meta text-ink-muted",children:ut[s].description})]}),t.jsxs(on,{value:s,onValueChange:i=>a(e,i),children:[t.jsx(ln,{"aria-label":n("ui.settings.updates.update_following.surface_choice",{surface:Ln[e],choice:ut[s].label}),className:"w-full sm:w-56","data-followed-segment":e,children:t.jsx(cn,{})}),t.jsx(dn,{children:na.map(i=>t.jsx(Ze,{value:i,title:ut[i].description,children:ut[i].label},i))})]})]})},Hl=()=>(se(),t.jsxs("div",{className:ue("flex flex-col gap-3"),children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.settings.updates.update_following.update_notifications")}),t.jsx("p",{className:"mt-1 text-meta text-ink-muted",children:n("ui.settings.updates.update_following.how_much_of_a_version_change_shows_the_update_notice_at_the_botto")})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Fn,{type:Ke.UI}),t.jsx(Fn,{type:Ke.BACKEND})]})]})),ql=({appVersion:e})=>t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(Hl,{}),t.jsx(cl,{appVersion:e})]}),Gl=e=>{if(!e)return null;try{return new URL(e).host}catch{return null}},Yl=()=>{se();const[e,s]=l.useState(null),[a,i]=l.useState({value:"Loading...",detail:null,degraded:!1}),[r,o]=l.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});l.useEffect(()=>{let m=!0;const c=_=>{if(!m)return;const y=Gl(_.url);if(_.state==="connecting"){i({value:"Loading...",detail:null,degraded:!1});return}if(_.state==="detached"){i({value:"Not connected",detail:_.detail||null,degraded:!1});return}if(_.state==="wedged"){i({value:"Not attached",detail:_.detail||null,degraded:!1});return}const v=_.version||"Version unknown";i({value:y?`${v} · ${y}`:v,detail:_.detail||null,degraded:_.state==="degraded"})};let d=!1;const x=window.api?.backend?.onStatusChange(_=>{d=!0,c(_)}),p=async()=>{try{const[_,y]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);m&&(s(_),o(y))}catch(_){console.error("Error fetching app information:",_)}},h=async()=>{try{const _=window.api?.backend;if(_){const w=await _.getStatus();d||c(w);return}const y=await vn.healthCheck(en.baseUrl),v=vn.getServerVersion(y);m&&i({value:v,detail:null,degraded:!1})}catch(_){console.error("Error fetching server version:",_),m&&i({value:"Unavailable",detail:null,degraded:!1})}};return p(),h(),()=>{m=!1,x?.()}},[]);const u=(m,c,d,x={})=>t.jsx(me,{label:t.jsx(Je,{content:d,children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(St,{size:12,className:"shrink-0"}),m]})}),valueClassName:x.valueClassName,value:t.jsxs(t.Fragment,{children:[x.valueTooltip?t.jsx(Je,{content:x.valueTooltip,children:t.jsx("span",{"data-backend-version":x.valueHoverTarget?"":void 0,children:c})}):c,x.statusNote?t.jsx("span",{className:"mt-0.5 block text-meta text-ink-dim",children:x.statusNote}):null]})});return t.jsx(ce,{title:n("ui.settings.updates.app_updates_section.application_updates_and_info"),icon:Pt,description:n("ui.settings.updates.app_updates_section.check_for_updates_and_view_information_about_your_local_operator_"),dataTourTag:"settings-app-updates-section",children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs(ot,{children:[u(n("ui.settings.updates.app_updates_section.application_version"),e??n("ui.settings.updates.app_updates_section.state_loading"),n("ui.settings.updates.app_updates_section.the_version_of_the_local_operator_user_interface_application")),u(n("ui.settings.updates.app_updates_section.server_version"),Et(a.value),n("ui.settings.updates.app_updates_section.the_version_of_the_local_operator_api_server_backend_and_the_addr"),{valueTooltip:a.detail,valueHoverTarget:!0,statusNote:a.degraded?n("ui.settings.updates.app_updates_section.not_answering"):void 0,valueClassName:a.degraded?"text-ink-muted":void 0}),u(n("ui.settings.updates.app_updates_section.platform"),`${r.platform} (${r.arch})`,n("ui.settings.updates.app_updates_section.the_operating_system_and_architecture_your_application_is_running")),u(n("ui.settings.updates.app_updates_section.node_js_version"),Et(r.nodeVersion),n("ui.settings.updates.app_updates_section.the_javascript_runtime_environment_version")),u(n("ui.settings.updates.app_updates_section.electron_version"),Et(r.electronVersion),n("ui.settings.updates.app_updates_section.the_framework_version_enabling_this_desktop_application"))]}),t.jsx(ql,{appVersion:e})]})})};function js(e){const s={id:"",name:n("ui.settings.model.default_effort.model_default")};return e.resolvedLevel&&e.stored.trim()===""&&un(e.resolvedLevel,e.storable)!==null&&(s.description=n("ui.settings.model.default_effort.model_default_resolves",{level:Ge(e.resolvedLevel)})),[s,...ws(e.ladder,e.storable)]}function un(e,s){const a=e.trim().toLowerCase();return a===""?null:s.find(i=>i.trim().toLowerCase()===a)??null}function ws(e,s){return e.flatMap(a=>{const i=un(a,s);return i===null?[]:[{id:i,name:Ge(a)}]})}function Ql(e,s){const a=e.trim().toLowerCase();return a!==""&&s.some(i=>i.toLowerCase()===a)?s.find(i=>i.toLowerCase()===a)??"":""}function Wl(e){if(!e.resolved||e.ladder===null)return null;const s=e.stored.trim().toLowerCase();if(s===""||e.ladder.some(r=>r.toLowerCase()===s))return null;const a=(e.resolvedLevel??"").trim(),i=a===""?"":un(a,e.storable)??"";return i.trim().toLowerCase()===s?null:i}const yt="\0unread";function gt(e){return e.trim()===""?"":yt}function Zl(e){if(!e.supported)return{kind:"unsupported",options:[],selectedId:"",disabled:!0,helper:""};if(!e.hasHome)return Pe("no-home",n("ui.settings.model.default_effort.no_home"));if(!e.hasModel)return Pe("no-model",n("ui.settings.model.default_effort.no_model"),yt);if(e.settings==="loading")return Pe("settings-loading",n("ui.settings.model.default_effort.settings_loading"),yt);if(e.settings==="error")return Pe("settings-error",n("ui.settings.model.default_effort.settings_error"),yt);if(e.preview==="loading")return Pe("loading",n("ui.settings.model.default_effort.loading"),gt(e.stored));if(e.preview==="error")return Pe("error",n("ui.settings.model.default_effort.error"),gt(e.stored));if(e.ladder===null||!e.specResolved)return Pe("unresolved",n("ui.settings.model.default_effort.unresolved"),gt(e.stored));const s=e.ladder;if(s.length===0)return Pe("empty",n("ui.settings.model.default_effort.empty"),gt(e.stored));const a=ws(s,e.storable);if(a.length===0){const i=Ge(s[0]),r=s.length===1&&s[0].trim().toLowerCase()==="auto";return{kind:"one-level",options:[{id:"",name:i}],selectedId:"",disabled:!0,helper:r?n("ui.settings.model.default_effort.one_level_sentinel"):n("ui.settings.model.default_effort.one_level",{level:i})}}if(s.length===1){const[i]=a;return{kind:"one-level",options:[i],selectedId:i.id,disabled:!0,helper:n("ui.settings.model.default_effort.one_level",{level:i.name})}}return{kind:"ready",options:js({ladder:s,resolvedLevel:e.resolvedLevel,stored:e.stored,storable:e.storable}),selectedId:Ql(e.stored,a.map(i=>i.id)),disabled:!1,helper:n("ui.settings.model.default_effort.helper_ready")}}function Pe(e,s,a=""){return{kind:e,options:js({ladder:[],resolvedLevel:null,stored:"",storable:[]}),selectedId:a,disabled:!0,helper:s}}const Jl=({hosting:e,modelName:s,focus:a=!1})=>{se();const i=an(),r=kt(i.data,"draft_preview"),o=sa(),u=e!==""&&s!=="",m=Re({queryKey:Kt.all,queryFn:()=>_e({op:"settings.list"}),enabled:r,staleTime:1e4}),c=m.data?.settings.find(G=>G.key===pt),d=typeof c?.value=="string"?c.value:"",x=(c?.choices??[]).map(G=>G.value).filter(G=>typeof G=="string"),p={cwd:o??"",model:u?{provider:e,model_id:s,reasoning_effort:null}:null},h=m.isSuccess?d:null,_=Re({...Wa(p,kt(i.data,"draft_fast")),queryKey:[...Qa(p),"model_effort",h],enabled:r&&!!o&&u}),y=_.isSuccess&&!_.isPlaceholderData,v=y?Za(_.data?.snapshot,null).effort:null,w=y&&Array.isArray(v?.reasoning_efforts)?Ja(v):null,z=y?Xa(v):null,S=v!==null&&!ei(v),[I,b]=l.useState(!1),[N,k]=l.useState(!1),[$,W]=l.useState(null),[Y,P]=l.useState(null),Q=`${e}\0${s}`,K=sn(),U=l.useRef(null),V=l.useRef(!1),B=l.useCallback(async(G,X)=>{b(!0),W(G),k(!1),X===null&&P(null);try{await _e({op:"settings.edit",key:pt,value:G}),await K.invalidateQueries({queryKey:Kt.all}),X!==null&&P(X)}catch{k(!0)}finally{b(!1),W(null)}},[K]),M=typeof v?.display_name=="string"&&v.display_name.trim()||s,A=Zl({supported:r,hasHome:!!o,hasModel:u,settings:m.isError?"error":m.isSuccess?"ready":"loading",preview:_.isError?"error":y?"ready":"loading",ladder:w,specResolved:S,stored:d,resolvedLevel:z,storable:x}),g=Wl({stored:d,ladder:w,resolvedLevel:z,resolved:y&&S&&m.isSuccess,storable:x}),T=l.useRef(null);l.useEffect(()=>{if(g===null||I)return;const G=`${e}\0${s}\0${d}\0${g}`;if(T.current===G)return;T.current=G;const X=g===""?n("ui.settings.model.default_effort.clamped_unset",{level:Ge(d),model:M}):n("ui.settings.model.default_effort.clamped",{level:Ge(d),model:M,resolved:Ge(g)});B(g,{text:X,model:Q})},[g,d,I,B,e,s,M,Q]);const E=l.useMemo(()=>A.options.map(Xl),[A.options]);l.useEffect(()=>{if(!a){V.current=!1;return}A.disabled||V.current||(U.current?.querySelector("[role=combobox]")?.focus(),V.current=!0)},[a,A.disabled]);const Z=$??A.selectedId,J=E.find(G=>G.id===Z)??($!==null?{id:$,name:Ge($)}:null),ee=t.jsxs("span",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{children:A.helper}),N&&t.jsx("span",{className:"text-danger",children:n("ui.settings.model.default_effort.save_failed")}),t.jsx("output",{"aria-live":"polite",children:Y?.model===Q?Y.text:""})]});return A.kind==="unsupported"?null:t.jsx("div",{ref:U,"data-setting-key":pt,children:t.jsx(Fi,{label:n("ui.settings.model.default_effort.label"),icon:t.jsx(fi,{size:16,"aria-hidden":"true"}),placeholder:n("ui.settings.model.default_effort.placeholder"),options:E,selected:J,onSelect:G=>{B(G.id,null)},helperText:ee,busy:I,busyLabel:n("ui.settings.model.default_effort.busy"),disabled:A.disabled||I})})};function Xl(e){return{id:e.id,name:e.name,description:e.description}}const ec=e=>e.replace(/[\p{Co}\p{Cc}]/gu," ").replace(/\s+/g," ").trim(),Ns=(e,s)=>{const a=s.trim().toLocaleLowerCase();return a?e.filter(i=>`${i.title} ${i.cwd} ${i.sourceId}`.toLocaleLowerCase().includes(a)):e},tc=(e,s)=>`${e??""}\0${[...s].sort().join("\0")}`,Ss=5e3,nc=(e,s,a,i=Ss)=>{const r=new Set(a);let o=!1;for(const u of Ns(e,s))if(!r.has(u.sourceId)){if(r.size>=i){o=!0;break}r.add(u.sourceId)}return{selected:r,capped:o}},sc=/cancel/i,ac=new Set(["done","failed","cancelled"]),Dn=e=>{switch(e){case"metadata_only":return"ui.settings.imports.availability_metadata_only";case"unsupported":return"ui.settings.imports.availability_unsupported";default:return"ui.settings.imports.availability_full"}},Ot=e=>{switch(e){case"queued":return"ui.settings.imports.state_queued";case"done":return"ui.settings.imports.state_done";case"failed":return"ui.settings.imports.state_failed";case"cancelled":return"ui.settings.imports.state_cancelled";default:return"ui.settings.imports.state_running"}},ic=e=>{switch(e){case"selecting":return"ui.settings.imports.phase_selecting";case"memory":return"ui.settings.imports.phase_memory";case"done":return"ui.settings.imports.phase_done";case"cancelled":return"ui.settings.imports.phase_cancelled";case"queued":return"ui.settings.imports.phase_queued";default:return"ui.settings.imports.phase_importing"}},rc=e=>{switch(e){case"resumed":return"ui.settings.imports.outcome_resumed";case"skipped_already_imported":return"ui.settings.imports.outcome_skipped";case"metadata_only":return"ui.settings.imports.outcome_metadata";case"failed":return"ui.settings.imports.outcome_failed";case"cancelled":return"ui.settings.imports.outcome_cancelled";default:return"ui.settings.imports.outcome_imported"}},oc=e=>e==="failed"?"danger":e==="metadata_only"||e==="skipped_already_imported"?"neutral":e==="cancelled"?"warning":"success",Wt=e=>ec(e.title)||e.sourceId,zn=({path:e,label:s,onCopyPath:a})=>{const[i,r]=l.useState(!1);return t.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-md border border-hairline bg-surface p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-body-sm text-ink",children:s}),t.jsx("p",{className:"mt-1 break-all font-mono text-meta text-ink-muted",children:e})]}),t.jsxs(O,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{a(e).then(o=>{o&&(r(!0),window.setTimeout(()=>r(!1),1500))})},children:[i?t.jsx(ps,{size:14}):t.jsx(ns,{size:14}),i?n("ui.settings.imports.copied"):n("ui.settings.imports.copy_path")]})]})},lc=({progress:e,sessions:s,selected:a})=>{const i=new Map(e.results.map(m=>[m.sourceId,m])),r=e.sessionId,o=Math.max(0,e.total-e.completed-(r&&!i.has(r)?1:0)),u=s.filter(m=>a.has(m.sourceId));return t.jsxs("div",{className:"flex flex-col gap-2",children:[e.results.map(m=>t.jsx(Ms,{row:m,jobCancelled:e.state==="cancelled"},`${m.source}:${m.sourceId}`)),u.filter(m=>!i.has(m.sourceId)&&m.sourceId!==r).map(m=>t.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-hairline bg-surface p-2 text-body-sm text-ink-muted",children:[t.jsx("span",{className:"min-w-0 truncate",children:Wt(m)}),t.jsx(it,{variant:"neutral",children:n("ui.settings.imports.session_pending")})]},m.sourceId)),r&&!i.has(r)&&t.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-hairline bg-surface p-2 text-body-sm text-ink-muted",children:[t.jsx(ft,{size:14,className:"animate-spin"}),t.jsx("span",{children:n("ui.settings.imports.session_importing")}),t.jsx("span",{className:"min-w-0 truncate",children:r})]}),o>0&&t.jsx("p",{className:"text-meta text-ink-muted",children:n("ui.settings.imports.progress_pending",{count:o})}),e.warnings.map(m=>t.jsx("p",{className:"text-meta text-warning",children:m.message},`${m.code}:${m.sessionId}:${m.message}`))]})},Ms=({row:e,jobCancelled:s=!1})=>{const i=s&&e.outcome==="failed"&&e.warnings.some(r=>sc.test(r))?"cancelled":e.outcome;return t.jsxs("div",{className:"rounded-md border border-hairline bg-surface p-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"min-w-0 truncate text-body-sm text-ink",children:e.sourceId}),t.jsx(it,{variant:oc(i),children:n(rc(i))}),t.jsx("span",{className:"text-meta text-ink-muted",children:n("ui.settings.imports.session_meta",{messages:e.messages,compactions:e.compactions})})]}),e.targetSessionId&&(e.messages>0||e.outcome==="skipped_already_imported")&&t.jsx("p",{className:"mt-1 break-all font-mono text-meta text-ink-muted",children:n("ui.settings.imports.result_target",{target:e.targetSessionId})}),e.warnings.map(r=>t.jsx("p",{className:"mt-1 text-meta text-warning",children:r},r))]})},cc=({sources:e,activeSource:s,sessions:a,query:i,selected:r,preview:o,previewStale:u,previewError:m,confirmed:c,busy:d,error:x,progress:p,result:h,cancelling:_,onSelectSource:y,onQueryChange:v,onToggleSession:w,onSelectAll:z,onClearSelection:S,onConfirmChange:I,onImport:b,onCancel:N,onRetry:k,onImportAnother:$,onRefresh:W,selectionNotice:Y,onCopyPath:P})=>{se();const Q=e.find(g=>g.source===s),K=p!==null&&!ac.has(p.state),U=p?.total??r.size,V=l.useMemo(()=>Ns(a,i),[i,a]),B=V.length>0&&V.every(g=>r.has(g.sourceId)),M=r.size,A=M>0&&o!==null&&!u&&c&&!d&&!p&&!h;return t.jsx(ce,{title:n("ui.settings.imports.title"),icon:Pt,description:n("ui.settings.imports.description"),dataTourTag:"settings-import-section",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[x&&t.jsxs(ae,{variant:"warning",children:[t.jsx(Nt,{children:n("ui.settings.imports.title")}),t.jsx(Ne,{children:t.jsxs("span",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("span",{children:x}),t.jsx(O,{variant:"secondary",size:"sm",onClick:k,children:n("ui.settings.imports.retry")})]})})]}),d==="sources"&&e.length===0?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(xe,{className:"h-20 w-full"}),t.jsx(xe,{className:"h-20 w-full"}),t.jsx(xe,{className:"h-20 w-full"}),t.jsx("p",{className:"text-meta text-ink-muted",children:n("ui.settings.imports.loading_sources")})]}):e.length===0?t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.imports.empty_sources")}):t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.settings.imports.source_heading")}),t.jsxs(O,{variant:"ghost",size:"sm",onClick:W,disabled:K||d==="sources"||d==="sessions",children:[t.jsx(hi,{size:14,className:ue(d==="sources"&&"animate-spin")}),n("ui.settings.imports.refresh")]})]}),!e.some(g=>g.detected)&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.imports.empty_sources")}),t.jsx("div",{className:"grid gap-2 lg:grid-cols-3",children:e.map(g=>{const T=g.source===s,E=g.detected?n(Dn(g.availability)):n("ui.settings.imports.source_not_found");return t.jsxs("button",{type:"button","aria-pressed":T,disabled:K,onClick:()=>y(g.source),className:ue("rounded-lg border p-3 text-start transition-colors disabled:cursor-not-allowed disabled:opacity-60","focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",T?"border-accent bg-accent-wash":"border-hairline bg-surface hover:bg-sunken"),children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("span",{className:"text-body-sm font-medium text-ink",children:g.label}),t.jsx(it,{variant:g.detected&&g.availability==="full"?"success":"neutral",children:E})]}),t.jsx("p",{className:"mt-1 text-meta text-ink-muted",children:n("ui.settings.imports.source_sessions",{count:g.sessionCount})}),t.jsx("p",{className:"mt-1 break-all text-meta text-ink-dim",children:g.detail||g.root})]},g.source)})})]}),Q&&!p&&!h&&t.jsxs("div",{className:"flex flex-col gap-3 border-t border-hairline pt-5",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("h3",{className:"text-heading text-ink",children:[n("ui.settings.imports.source_heading")," · ",Q.label]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(O,{variant:"secondary",size:"sm",onClick:B?S:z,disabled:V.length===0,children:B?n("ui.settings.imports.clear_all"):n("ui.settings.imports.select_all")}),t.jsx("span",{className:"text-meta text-ink-muted",children:n("ui.settings.imports.selected",{count:M})})]})]}),Y&&t.jsx("output",{className:"text-meta text-warning",children:Y}),t.jsxs("div",{className:"relative",children:[t.jsx(ts,{size:15,className:"pointer-events-none absolute top-1/2 start-3 -translate-y-1/2 text-ink-dim"}),t.jsx(De,{value:i,onChange:g=>v(g.target.value),placeholder:n("ui.settings.imports.search_placeholder"),className:"ps-9"})]}),d==="sessions"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(xe,{className:"h-12 w-full"}),t.jsx(xe,{className:"h-12 w-full"}),t.jsx("p",{className:"text-meta text-ink-muted",children:n("ui.settings.imports.loading_sessions",{source:Q.label})})]}):a.length===0?t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.imports.empty_sessions",{source:Q.label})}):V.length===0?t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.imports.empty_filter")}):t.jsx("div",{className:"flex max-h-80 flex-col gap-1 overflow-y-auto",children:V.map(g=>{const T=`import-session-${g.source}-${g.sourceId}`;return t.jsxs("div",{className:ue("flex items-start gap-3 rounded-md border p-3",r.has(g.sourceId)?"border-accent bg-row-selected":"border-hairline bg-surface hover:bg-sunken"),children:[t.jsx(Gt,{id:T,checked:r.has(g.sourceId),onCheckedChange:()=>w(g.sourceId),"aria-label":Wt(g),className:"mt-0.5"}),t.jsxs("label",{htmlFor:T,className:"min-w-0 flex-1 cursor-pointer text-start",children:[t.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"min-w-0 truncate text-body-sm text-ink",children:Wt(g)}),t.jsx(it,{variant:g.availability==="full"?"neutral":"warning",children:n(Dn(g.availability))})]}),t.jsxs("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-meta text-ink-muted",children:[t.jsx("span",{children:n("ui.settings.imports.session_meta",{messages:g.messageCount??0,compactions:g.compactionCount})}),t.jsx("span",{children:n("ui.settings.imports.session_updated",{date:nn(new Date((g.updatedTs||g.createdTs)*1e3))})})]}),g.cwd&&t.jsx("span",{className:"mt-1 block break-all font-mono text-meta text-ink-dim",children:g.cwd}),g.availability==="metadata_only"&&t.jsx("span",{className:"mt-1 block text-meta text-warning",children:n("ui.settings.imports.metadata_only_explain")}),g.availability==="unsupported"&&t.jsx("span",{className:"mt-1 block text-meta text-warning",children:n("ui.settings.imports.session_index_only")})]})]},g.sourceId)})})]}),Q&&M>0&&!p&&!h&&t.jsxs("div",{className:"flex flex-col gap-3 border-t border-hairline pt-5",children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.settings.imports.preview_heading")}),(d==="preview"||u||o===null&&!m)&&t.jsxs("p",{className:"flex items-center gap-2 text-meta text-ink-muted",children:[t.jsx(ft,{size:14,className:"animate-spin"}),n("ui.settings.imports.loading_preview")]}),o&&!u&&t.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-hairline bg-surface p-4",children:[t.jsx("p",{className:"text-body-sm text-ink",children:n("ui.settings.imports.preview_summary",{sessions:o.totalSessions,messages:o.totalMessages,compactions:o.totalCompactions})}),t.jsx("p",{className:"text-meta text-ink-muted",children:n("ui.settings.imports.preview_memory",{records:o.totalMemoryRecords,tokens:o.projectedMemoryTokens.toLocaleString()})}),o.warnings.slice(0,4).map((g,T)=>t.jsx("p",{className:"text-meta text-warning",children:g.message},`${g.code}:${g.sessionId}:${T}`)),o.warnings.length>4&&t.jsx("p",{className:"text-meta text-warning",children:n("ui.settings.imports.warnings_heading",{count:o.warnings.length})}),t.jsx("p",{className:"text-meta text-ink-muted",children:n("ui.settings.imports.preview_confirm")})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-hairline bg-surface p-4",children:[m&&t.jsx(ae,{variant:"warning",children:t.jsx(Ne,{children:t.jsxs("span",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("span",{children:m}),t.jsx(O,{variant:"secondary",size:"sm",onClick:k,children:n("ui.settings.imports.retry")})]})})}),t.jsxs("div",{className:"flex items-start gap-2 text-body-sm text-ink",children:[t.jsx(Gt,{checked:c,onCheckedChange:g=>I(g===!0),disabled:!o||u,"aria-label":n("ui.settings.imports.confirm_label"),className:"mt-0.5"}),t.jsx("span",{children:n("ui.settings.imports.confirm_label")})]}),t.jsxs(O,{variant:"primary",onClick:b,disabled:!A,className:"self-start",children:[d==="start"?t.jsx(ft,{size:14,className:"animate-spin"}):t.jsx(Pt,{size:14}),n("ui.settings.imports.import_button",{count:M})]})]})]}),p&&!h&&t.jsxs("div",{className:"flex flex-col gap-3 border-t border-hairline pt-5",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.settings.imports.progress_heading")}),t.jsxs(O,{variant:"secondary",size:"sm",onClick:N,disabled:_||p.state==="done"||p.state==="cancelled"||p.state==="failed",children:[t.jsx(aa,{size:12}),_?n("ui.settings.imports.cancelling"):n("ui.settings.imports.cancel")]})]}),t.jsxs("p",{className:"text-meta text-ink-muted",children:[n("ui.settings.imports.progress_job",{job:p.jobId,state:n(Ot(p.state))})," · ",n(ic(p.phase))]}),t.jsx(Di,{value:p.total?p.completed/p.total*100:0,className:"h-1.5"}),t.jsx(lc,{progress:p,sessions:a,selected:r})]}),h&&t.jsxs("div",{className:"flex flex-col gap-3 border-t border-hairline pt-5",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.settings.imports.result_heading")}),t.jsx(O,{variant:"secondary",size:"sm",onClick:$,children:n("ui.settings.imports.import_another")})]}),t.jsx("p",{className:"text-body-sm text-ink",children:h.state==="cancelled"?n("ui.settings.imports.result_summary_cancelled",{state:n(Ot(h.state)),sessions:h.sessions.length,total:U,messages:h.messages}):n("ui.settings.imports.result_summary",{state:n(Ot(h.state)),sessions:h.sessions.length,messages:h.messages})}),h.sessions.map(g=>t.jsx(Ms,{row:g,jobCancelled:h.state==="cancelled"},`${g.source}:${g.sourceId}:${g.targetSessionId}`)),(h.instructionReviewPath||h.memoryReviewPath)&&t.jsxs("div",{className:"flex flex-col gap-2",children:[h.instructionReviewPath&&t.jsx(zn,{path:h.instructionReviewPath,label:n("ui.settings.imports.review_instructions"),onCopyPath:P}),h.memoryReviewPath&&t.jsx(zn,{path:h.memoryReviewPath,label:n("ui.settings.imports.review_memory"),onCopyPath:P})]}),h.warnings.length>0&&t.jsx(ae,{variant:"warning",children:t.jsx(Ne,{children:t.jsxs("span",{className:"flex flex-col gap-1",children:[t.jsx("span",{children:n("ui.settings.imports.warnings_heading",{count:h.warnings.length})}),h.warnings.slice(0,4).map((g,T)=>t.jsx("span",{children:g.message},`${g.code}:${T}`))]})})}),h.error&&t.jsx(ae,{variant:"danger",children:t.jsx(Ne,{children:h.error})}),t.jsx("p",{className:"text-meta text-ink-muted",children:n("ui.settings.imports.rerun_safe")})]}),d==="start"&&!p&&t.jsxs("p",{className:"flex items-center gap-2 text-body-sm text-ink-muted",children:[t.jsx(ft,{size:14,className:"animate-spin"}),n("ui.settings.imports.importing")]})]})})},gn=e=>({source:e.source,sessionId:e.session_id,code:e.code,message:e.message}),Cs=e=>({source:e.source,sourceId:e.source_id,targetSessionId:e.target_session_id,outcome:e.outcome,messages:e.messages,compactions:e.compactions,redactions:e.redactions,skipped:e.skipped,warnings:e.warnings}),dc=e=>({jobId:e.job_id,state:e.state,sessions:e.sessions.map(Cs),messages:e.messages,compactions:e.compactions,memoryImported:e.memory_imported,memorySkipped:e.memory_skipped,memoryReviewPath:e.memory_review_path,instructionReviewPath:e.instruction_review_path,redactions:e.redactions,warnings:e.warnings.map(gn),error:e.error});async function uc(){return(await _e({op:"imports.sources"})).sources.map(s=>({source:s.source,label:s.label,root:s.root,detected:s.detected,sessionCount:s.session_count,availability:s.availability,detail:s.detail}))}async function gc(e,s=!1){return(await _e({op:"imports.sessions",source:e,includeSubagents:s})).sessions.map(i=>({source:i.source,sourceId:i.source_id,title:i.title??"",cwd:i.cwd??"",createdTs:i.created_ts,updatedTs:i.updated_ts,messageCount:i.message_count,compactionCount:i.compaction_count,kind:i.kind,availability:i.availability,parentSourceId:i.parent_source_id}))}async function mc(e){const s=await _e({op:"imports.preview",sources:e.sources,sessionIds:e.sessionIds,includeMemory:e.includeMemory??!0,includeInstructions:e.includeInstructions??!0});return{totalSessions:s.total_sessions,totalMessages:s.total_messages,messageCountsEstimated:s.message_counts_estimated,totalCompactions:s.total_compactions,totalMemoryRecords:s.total_memory_records,projectedMemoryTokens:s.projected_memory_tokens,projectedGlobalTokens:s.projected_global_tokens,warnings:s.warnings.map(gn),instructionReviewPaths:s.instruction_review_paths}}async function _c(e){return(await _e({op:"imports.start",sources:e.sources,sessionIds:e.sessionIds,includeMemory:e.includeMemory??!0,includeInstructions:e.includeInstructions??!0})).job_id}async function pc(e){const s=await _e({op:"imports.status",jobId:e});return{jobId:s.job_id,state:s.state,phase:s.phase,source:s.source,sessionId:s.session_id,completed:s.completed,total:s.total,results:s.results.map(Cs),warnings:s.warnings.map(gn),error:s.error,startedAt:s.started_at,updatedAt:s.updated_at,result:s.result?dc(s.result):void 0}}async function fc(e){await _e({op:"imports.cancel",jobId:e})}const mt=new Set(["done","failed","cancelled"]),Qe=e=>e instanceof Error?e.message:String(e),hc=()=>{se();const[e,s]=l.useState([]),[a,i]=l.useState(null),[r,o]=l.useState([]),[u,m]=l.useState(""),[c,d]=l.useState(new Set),[x,p]=l.useState(null),[h,_]=l.useState(null),[y,v]=l.useState(!1),[w,z]=l.useState(null),[S,I]=l.useState(null),[b,N]=l.useState(null),[k,$]=l.useState(null),[W,Y]=l.useState(!1),[P,Q]=l.useState(null),[K,U]=l.useState(0),V=l.useRef(0),B=l.useRef(0),[M,A]=l.useState(null),[g,T]=l.useState(null),E=l.useRef(null),Z=b!==null&&!mt.has(b.state),J=l.useCallback(async()=>{z("sources"),I(null);try{const q=await uc();s(q),i(ne=>q.some(de=>de.source===ne&&de.detected)?ne:q.find(de=>de.detected)?.source??null)}catch(q){I(n("ui.settings.imports.error_sources",{reason:Qe(q)}))}finally{z(null)}},[]);l.useEffect(()=>{J()},[J]);const ee=l.useCallback(async q=>{const ne=++V.current;z("sessions"),I(null);try{const ge=await gc(q);if(ne!==V.current)return;o(ge)}catch(ge){if(ne!==V.current)return;o([]),I(n("ui.settings.imports.error_sessions",{source:q,reason:Qe(ge)}))}finally{ne===V.current&&z(null)}},[]);l.useEffect(()=>{if(!a){o([]);return}o([]),d(new Set),p(null),_(null),A(null),T(null),v(!1),$(null),N(null),ee(a)},[a,ee]);const G=l.useCallback(q=>{d(q),v(!1),A(null),T(null),Q(null)},[]),X=l.useCallback(q=>{Z||(i(q),m(""))},[Z]),Te=l.useCallback(q=>{const ne=new Set(c);ne.has(q)?ne.delete(q):ne.add(q),G(ne)},[G,c]),Se=l.useCallback(()=>{const q=nc(r,u,c);G(q.selected),q.capped&&Q(n("ui.settings.imports.selection_limit",{max:Ss}))},[u,G,c,r]),ke=l.useCallback(()=>{G(new Set)},[G]),pe=l.useMemo(()=>tc(a,c),[a,c]),C=x!==null&&h!==pe,H=l.useCallback(async()=>{if(!a||c.size===0)return;const q=++B.current,ne=pe;z("preview"),I(null),T(null);try{const ge=await mc({sources:[a],sessionIds:{[a]:[...c].sort()}});if(q!==B.current)return;p(ge),_(ne)}catch(ge){if(q!==B.current)return;p(null),_(null),A(ne),T(n("ui.settings.imports.error_preview",{reason:Qe(ge)}))}finally{q===B.current&&z(null)}},[a,pe,c]);l.useEffect(()=>{if(!a||c.size===0||b||k||x&&h===pe||!x&&M===pe)return;const q=setTimeout(()=>{H()},250);return()=>clearTimeout(q)},[a,c,pe,x,h,M,b,k,H]);const L=l.useCallback(async()=>{if(!(!a||c.size===0||!x||C||!y||b)){z("start"),I(null),$(null);try{const q=await _c({sources:[a],sessionIds:{[a]:[...c].sort()}}),ne=Date.now()/1e3;N({jobId:q,state:"queued",phase:"queued",source:a,sessionId:"",completed:0,total:c.size,results:[],warnings:[],error:"",startedAt:ne,updatedAt:ne})}catch(q){I(n("ui.settings.imports.error_start",{reason:Qe(q)}))}finally{z(null)}}},[a,y,x,C,b,c]),ie=b?.jobId??null,re=b?.state??null;l.useEffect(()=>{if(!ie||!re||mt.has(re))return;let q=!0,ne;const ge=async()=>{try{const de=await pc(ie);if(!q)return;if(E.current){const F=E.current;E.current=null,I(oe=>oe===F?null:oe)}N(de),de.result&&$({...de.result,jobId:de.jobId}),mt.has(de.state)||(ne=setTimeout(ge,900))}catch(de){if(!q)return;const F=n("ui.settings.imports.error_job",{reason:Qe(de)});E.current=F,I(F),ne=setTimeout(ge,2e3)}};return ne=setTimeout(ge,K>0?0:700),()=>{q=!1,ne&&clearTimeout(ne)}},[ie,re,K]);const Be=l.useCallback(async()=>{if(!(!b||mt.has(b.state))){Y(!0),I(null);try{await fc(b.jobId)}catch(q){I(n("ui.settings.imports.error_cancel",{reason:Qe(q)}))}finally{Y(!1)}}},[b]),he=l.useCallback(()=>{d(new Set),p(null),_(null),A(null),T(null),v(!1),Q(null),$(null),N(null),I(null),a&&ee(a)},[a,ee]),Me=l.useCallback(async q=>{try{return await navigator.clipboard.writeText(q),!0}catch{return!1}},[]),Oe=l.useCallback(async()=>{Z||(Q(null),A(null),T(null),await J(),a&&await ee(a))},[a,Z,ee,J]),Ve=l.useCallback(()=>{if(Z){I(null),U(q=>q+1);return}A(null),T(null),Oe()},[Z,Oe]);return t.jsx(cc,{sources:e,activeSource:a,sessions:r,query:u,selected:c,preview:x,previewStale:C,previewError:g,confirmed:y,busy:w,error:S,progress:b,result:k,cancelling:W,onSelectSource:X,onQueryChange:m,onToggleSession:Te,onSelectAll:Se,onClearSelection:ke,onConfirmChange:v,onImport:()=>void L(),onCancel:()=>void Be(),onRetry:Ve,onImportAnother:he,onRefresh:Oe,selectionNotice:P,onCopyPath:Me})},xc=e=>{switch(e.id){case"panel.console":return n("ui.settings.shortcuts.row.console");case"panel.canvas":return n("ui.settings.shortcuts.row.canvas");case"panel.run":return n("ui.settings.shortcuts.row.execution");case"panel.ask":return n("ui.settings.shortcuts.row.asks");case"panel.browser":return n("ui.settings.shortcuts.row.browser");case"panel.code":return n("ui.settings.shortcuts.row.code_review")}},yc=({action:e})=>{se();const s=l.useId(),a=l.useRef(null),i=Ue(y=>y.shortcutBindings),r=i[e.id],o=Ue(y=>y.setShortcutBinding),u=Ue(y=>y.clearShortcutBinding),[m,c]=l.useState(!1),[d,x]=l.useState(null),p=l.useMemo(ia,[]),h=ni(e.id,i),_=xc(e);return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(Ie,{htmlFor:s,className:"w-32 text-body-sm text-ink",children:_}),t.jsx(De,{id:s,readOnly:!0,value:h===null?n("ui.settings.shortcuts.keyboard_shortcuts_section.no_shortcut"):si(h,p),"aria-label":n("ui.settings.shortcuts.keyboard_shortcuts_section.label_press_the_keys_you_want",{label:String(_)}),"data-shortcut-action":e.id,ref:a,className:ue("w-52",h===null?"text-body-sm":"font-mono text-body-sm"),onFocus:()=>c(!0),onBlur:()=>{c(!1),x(null)},onKeyDown:y=>{if(ra.has(y.key))return;if(oa.has(y.key)){c(!1),x(null);return}if(la.has(y.key)||y.nativeEvent.isComposing)return;const v=ca({key:y.key,metaKey:y.metaKey,ctrlKey:y.ctrlKey,altKey:y.altKey,shiftKey:y.shiftKey}),w=ai(v,e.id,i,p);if(w!==null){y.preventDefault(),c(!0),x(w);return}if(v===h){c(!0),x(null);return}y.preventDefault(),c(!0),x(null),v===e.defaultChord?o(e.id,null):v!==null&&o(e.id,v)}}),h!==null&&t.jsx(O,{variant:"secondary",size:"sm","aria-label":n("ui.settings.shortcuts.keyboard_shortcuts_section.clear_label_s_shortcut",{label:String(_)}),onClick:()=>{u(e.id),a.current?.focus()},children:n("ui.settings.shortcuts.keyboard_shortcuts_section.clear")}),r!==void 0&&t.jsx(O,{variant:"secondary",size:"sm","aria-label":n("ui.settings.shortcuts.keyboard_shortcuts_section.reset_label_to_its_default",{label:String(_)}),onClick:()=>{o(e.id,null),a.current?.focus()},children:n("ui.settings.shortcuts.keyboard_shortcuts_section.reset")})]}),m&&t.jsx("span",{className:"text-meta text-ink-dim",children:n("ui.settings.shortcuts.keyboard_shortcuts_section.press_the_keys_you_want_esc_cancels")}),d!==null&&t.jsx("output",{className:"text-meta text-danger",children:d})]})},vc=({sectionRef:e})=>(se(),t.jsx(ce,{title:n("ui.settings.shortcuts.keyboard_shortcuts_section.keyboard_shortcuts"),icon:xi,description:n("ui.settings.shortcuts.keyboard_shortcuts_section.shortcuts_for_the_panel_rail_focus_a_field_and_press_the_keys_you"),sectionRef:e,children:t.jsx("div",{className:"flex flex-col gap-4",children:ti.map(s=>t.jsx(yc,{action:s},s.id))})})),bc=[[[".claude.json"],"Claude Code"],[[".claude",".mcp.json"],"Claude Code"],[[".cursor","mcp.json"],"Cursor"],[[".vscode","mcp.json"],"VS Code"],[[".codex","config.toml"],"Codex CLI"]];function Es(e){if(!e)return null;const s=e.split("\\").join("/").split("/").filter(Boolean);for(const[a,i]of bc)if(!(s.length<a.length)&&s.slice(-a.length).join("/")===a.join("/"))return i;return null}const vt=e=>n("ui.settings.integrations.integration_model.tool_count",{count:e}),kc=e=>n("ui.settings.integrations.integration_model.integration_count",{count:e}),jc=["connected","needs_sign_in","not_started","connecting","error"],As=e=>jc.includes(e),Xe=(e,s)=>[...s].filter(a=>a.name===e&&a.status==="running").sort((a,i)=>i.created_at-a.created_at)[0]??null,wc={connectedAt:null,connectedToolCount:null,settledGroup:null,pinnedGroup:null,pinnedOperationId:null,needsKey:!1,needsSignIn:!1,disconnectedAt:null,holdUntil:null,lastDecisive:null},Nc=1e12,Sc=1e9,Mc=60*60*1e3,Is=(e,s=Date.now())=>{if(typeof e!="number"||!Number.isFinite(e))return null;const a=e>=Nc?e:e<Sc?null:e*1e3;return a===null||a>s+Mc?null:Math.min(a,s)},Ye=(e,s)=>e?.[s]??wc,lt=(e,s,a)=>Ac(e,s)??a?.lastDecisive??null,Cc=e=>({id:e.id,name:e.name,action:e.action,status:e.status,created_at:e.created_at,credential_removed:e.credential_removed,...e.message?{message:e.message}:{}}),mn=(e,s)=>e.status==="not_started"&&typeof e.tool_count=="number"&&(s.connectedAt!==null||e.status_basis==="stored"&&e.tool_count_basis==="last_seen"),Ec=(e,s)=>[...s].filter(a=>a.name===e).sort((a,i)=>i.created_at-a.created_at)[0]??null,Ac=(e,s)=>Ec(e,s.filter(a=>a.status!=="cancelled")),Mt=e=>e.actions.includes("set_key")||e.actions.includes("add_key");function Ic(e,s){const a=Math.max(0,Math.round((e-s)/1e3));if(a<60)return n("ui.settings.integrations.integration_model.just_now");const i=Math.round(a/60);if(i<60)return n("ui.settings.integrations.integration_model.minutes_min_ago",{minutes:i});const r=Math.round(i/60);return r<24?n("ui.settings.integrations.integration_model.hours_h_ago",{hours:r}):n("ui.settings.integrations.integration_model.days_ago",{days:Math.round(r/24)})}function Lt(e){if(!e)return null;const s=e.trim();if(!s||/^\/\w/.test(s)||/\/mcp\s+\w+/.test(s))return null;let a=s;for(let i=0;i<3;i+=1){const r=a.replace(/^(?:connection (?:closed|error|refused)|error|closed|failed)\s*:\s*/i,"").trim();if(r===a)break;a=r}return a=a.replace(/\s*\(\s*\d{3}\s*\)/g,"").replace(/\s+([.,;])/g,"$1").replace(/\s{2,}/g," ").trim(),a||null}function Rc(e,s=[],a,i=Date.now()){const r=Ye(a,e.name),o=Xe(e.name,s);if(o){if(o.action==="login"||o.action==="reauth")return{label:n("ui.settings.integrations.integration_model.signing_in"),tone:"info",detail:null,busy:!0};if(o.action==="logout")return{label:n("ui.settings.integrations.integration_model.signing_out"),tone:"info",detail:null,busy:!0}}if(!As(e.status))return{label:n("ui.settings.integrations.integration_model.status_unavailable"),tone:"neutral",detail:null,busy:!1};const u=lt(e.name,s,r),m=Ct(u)&&e.status!=="connected",c=mn(e,r),d=fn(u)&&e.status!=="connected",x=(u?.action==="login"||u?.action==="reauth")&&u.status==="failed";if(r.disconnectedAt!==null)return{label:n("ui.settings.integrations.integration_model.not_connected"),tone:"neutral",detail:null,busy:!1,explanation:n($n)};switch(e.status){case"connected":return{label:typeof e.tool_count=="number"?n("ui.settings.integrations.integration_model.connected_with_tools",{tools:String(vt(e.tool_count))}):n("ui.settings.integrations.integration_model.connected"),tone:"success",detail:null,busy:!1};case"connecting":return{label:n("ui.settings.integrations.integration_model.connecting"),tone:"info",detail:null,busy:!0};case"needs_sign_in":return{label:e.auth.kind==="api_key"||at(e,s,r)?n("ui.settings.integrations.integration_model.needs_a_key"):n("ui.settings.integrations.integration_model.needs_sign_in"),tone:"warning",detail:Lt(e.status_reason),busy:!1};case"error":return{label:n("ui.settings.integrations.integration_model.couldn_t_start"),tone:"danger",detail:Lt(e.status_reason)??n("ui.settings.integrations.integration_model.no_reason_was_given"),busy:!1};default:if(m)return{label:n("ui.settings.integrations.integration_model.signed_out"),tone:"warning",detail:null,busy:!1};if(d)return{label:n("ui.settings.integrations.integration_model.sign_out_didn_t_finish"),tone:"warning",detail:n("ui.settings.integrations.integration_model.the_sign_in_is_still_saved"),busy:!1};if(at(e,s,r))return{label:n("ui.settings.integrations.integration_model.needs_a_key"),tone:"warning",detail:null,busy:!1};if(x)return{label:n("ui.settings.integrations.integration_model.sign_in_didn_t_finish"),tone:"warning",detail:null,busy:!1};if(r.needsSignIn)return{label:e.auth.kind==="api_key"||at(e,s,r)?n("ui.settings.integrations.integration_model.needs_a_key"):n("ui.settings.integrations.integration_model.needs_sign_in"),tone:"warning",detail:Lt(e.status_reason),busy:!1};if(e.status_basis==="stored"&&c&&r.disconnectedAt===null){const p=r.connectedAt??Is(e.last_seen_at,i);return{label:p!==null?n("ui.settings.integrations.integration_model.worked_when_with_tools",{when:String(Ic(i,p)),tools:String(vt(e.tool_count))}):n("ui.settings.integrations.integration_model.worked_earlier_with_tools",{tools:String(vt(e.tool_count))}),tone:"success",detail:null,busy:!1}}return e.status_basis==="live"?{label:n("ui.settings.integrations.integration_model.not_connected"),tone:"neutral",detail:null,busy:!1,explanation:n($n)}:{label:n("ui.settings.integrations.integration_model.ready"),tone:"neutral",detail:null,busy:!1,explanation:n(Lc)}}}const Rs=e=>n("ui.settings.integrations.integration_model.replace_keys",{count:e}),Tc=/[,;]?\s*(?:or|and)?\s*add (?:its|a|the) key instead\.?\s*$/i;function Oc(e,s){const a=e?.trim()??"";if(!a)return null;if(s)return a;const i=a.replace(Tc,"").trim();return i?/\.$/.test(i)?i:`${i}.`:a}const Lc="ui.settings.integrations.integration_model.copy_ready_explanation",$n="ui.settings.integrations.integration_model.copy_not_connected_explanation",Fc=e=>e.transport==="local_command"?n("ui.settings.integrations.integration_model.local_command"):n("ui.settings.integrations.integration_model.remote_url");function Ts(e){switch(e.source.kind){case"local-operator":case"project-mcp-json":return null;case"claude-code":return n("ui.settings.integrations.integration_model.claude_code");case"cursor":return"Cursor";case"vscode":return n("ui.settings.integrations.integration_model.vs_code");case"codex":return n("ui.settings.integrations.integration_model.codex_cli");default:return Es(e.source.path)}}function Dc(e,s){const a=[{text:Fc(e),importSource:!1}];e.status!=="connected"&&e.tool_count_basis==="last_seen"&&typeof e.tool_count=="number"&&a.push({text:n("ui.settings.integrations.integration_model.tools_when_last_checked",{tools:String(vt(e.tool_count))}),importSource:!1}),s&&a.push({text:e.scope==="project"?n("ui.settings.integrations.integration_model.this_project"):n("ui.settings.integrations.integration_model.global"),importSource:!1});const i=Ts(e);return i?a.push({text:n("ui.settings.integrations.integration_model.imported_from_origin",{origin:String(i)}),importSource:!0}):e.source.editable||a.push({text:n("ui.settings.integrations.integration_model.imported_from_a_project_file"),importSource:!0}),a}const _n=(e,s)=>s.disconnectedAt!==null?"not_started":e.status;function pn(e,s=[],a){const i=Ye(a,e.name),r=Xe(e.name,s);if(r)return r.action==="login"||r.action==="reauth"?{kind:"sign_in",label:n("ui.settings.integrations.integration_model.continue_sign_in")}:null;const o=x=>e.actions.includes(x),u=Mt(e),m=at(e,s,i);if(!As(e.status))return o("test")?{kind:"test",label:n("ui.settings.integrations.integration_model.check_again")}:null;const c=lt(e.name,s,i),d=c?.status==="failed"&&ct(c);switch(_n(e,i)){case"connected":case"connecting":return null;case"needs_sign_in":return m?{kind:"set_key",label:n("ui.settings.integrations.integration_model.add_key")}:o("sign_in")?{kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")}:u?{kind:"set_key",label:n("ui.settings.integrations.integration_model.add_key")}:o("reauth")?{kind:"reauth",label:n("ui.settings.integrations.integration_model.sign_in_again")}:{kind:"fix",label:n("ui.settings.integrations.integration_model.fix")};case"error":return o("connect")?{kind:"connect",label:n("ui.settings.integrations.integration_model.reconnect")}:o("test")?{kind:"test",label:n("ui.settings.integrations.integration_model.retry")}:{kind:"fix",label:n("ui.settings.integrations.integration_model.fix")};default:{if(Ct(c)&&o("sign_in"))return{kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")};if(fn(c)&&o("sign_out"))return{kind:"sign_out",label:n("ui.settings.integrations.integration_model.sign_out_again")};if(i.disconnectedAt!==null&&o("connect"))return{kind:"connect",label:n("ui.settings.integrations.integration_model.connect")};if(i.needsSignIn){if(m&&u)return{kind:"set_key",label:n("ui.settings.integrations.integration_model.add_key")};if(o("sign_in"))return{kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")}}return m&&u?{kind:"set_key",label:n("ui.settings.integrations.integration_model.add_key")}:d&&o("sign_in")?{kind:"sign_in",label:n("ui.settings.integrations.integration_model.try_again")}:mn(e,i)&&!o("connect")?null:o("connect")?{kind:"connect",label:n("ui.settings.integrations.integration_model.connect"),...i.connectedAt===null&&e.status_basis!=="live"?{variant:"ghost"}:{}}:o("test")&&e.tool_count===null&&e.tool_count_basis===null?{kind:"test",label:n("ui.settings.integrations.integration_model.test"),variant:"ghost"}:null}}}const ct=e=>e.action==="login"||e.action==="reauth",Ct=e=>!!(e&&e.action==="logout"&&e.status==="complete"),fn=e=>!!(e&&e.action==="logout"&&e.status!=="running"&&e.status!=="complete"),Os=/no oauth authorization server/i;function at(e,s,a){if(!Mt(e))return!1;const i=lt(e.name,s,a);return i&&ct(i)&&i.status==="failed"&&Os.test(i.message??"")?!0:a.needsKey}function zc(e,s=[],a){const i=pn(e,s,a)?.kind,r=_n(e,Ye(a,e.name)),o=c=>e.actions.includes(c),u=[],m=Xe(e.name,s);if(m&&u.push({kind:"cancel",label:n("ui.settings.integrations.integration_model.cancel")}),!m&&o("test")&&i!=="test"&&u.push({kind:"test",label:n("ui.settings.integrations.integration_model.test_connection")}),o("connect")&&i!=="connect"&&r!=="connected"&&u.push({kind:"connect",label:n("ui.settings.integrations.integration_model.reconnect")}),!m&&o("sign_in")&&i!=="sign_in"&&r!=="connected"&&u.push({kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")}),o("reload")&&u.push({kind:"reload",label:n("ui.settings.integrations.integration_model.reload")}),!m&&o("reauth")&&i!=="reauth"&&u.push({kind:"reauth",label:n("ui.settings.integrations.integration_model.sign_in_again")}),Mt(e)&&i!=="set_key"&&u.push({kind:"set_key",label:e.auth.secret_refs.length>0?n("ui.settings.integrations.integration_model.update_key"):n("ui.settings.integrations.integration_model.add_key")}),o("sign_out")&&u.push({kind:"sign_out",label:n("ui.settings.integrations.integration_model.sign_out")}),o("disconnect")&&r==="connected"&&u.push({kind:"disconnect",label:n("ui.settings.integrations.integration_model.disconnect")}),o("copy_setup")&&e.setup_prompt&&u.push({kind:"copy_setup",label:n("ui.settings.integrations.integration_model.copy_setup_prompt")}),i!=="fix"&&u.push({kind:"open_config",label:n("ui.settings.integrations.integration_model.open_config_file")}),o("remove"))u.push({kind:"remove",label:n("ui.settings.integrations.integration_model.remove"),destructive:!0});else if(!e.source.editable){const c=Ts(e);u.push({kind:"remove_elsewhere",label:c?n("ui.settings.integrations.integration_model.remove_in_origin",{origin:String(c)}):n("ui.settings.integrations.integration_model.remove_in_its_own_file"),hint:c?n("ui.settings.integrations.integration_model.defined_in_origin_s_config_remove_it_there",{origin:String(c)}):n("ui.settings.integrations.integration_model.defined_in_a_file_this_app_doesn_t_write_remove_it_there")})}return u}const $c={get attention(){return n("ui.settings.integrations.integration_model.needs_attention")},get connected(){return n("ui.settings.integrations.integration_model.connected")},get ready(){return n("ui.settings.integrations.integration_model.available")}};function Ls(e,s=[],a){const i=Ye(a,e.name),r=Xe(e.name,s),o=_n(e,i);if(r&&i.pinnedGroup&&i.pinnedOperationId===r.id)return i.pinnedGroup;if(o==="needs_sign_in"||o==="error")return"attention";const u=lt(e.name,s,i);return Ct(u)&&o!=="connected"||fn(u)&&o!=="connected"?"attention":i.disconnectedAt!==null?"ready":at(e,s,i)||i.needsSignIn&&o!=="connected"||u?.status==="failed"&&ct(u)&&o!=="connected"?"attention":o==="connected"||e.status_basis==="stored"&&mn(e,i)?"connected":r&&r.action!=="test"?"attention":"ready"}function Pc(e,s=[],a){return["attention","connected","ready"].map(r=>({id:r,title:$c[r],rows:e.filter(o=>Ls(o,s,a)===r)})).filter(r=>r.rows.length>0)}function Kc(e,s,a=Date.now()){if(!s)return e??{};const i={};for(const r of s.servers){const o=Ye(e,r.name),u=Xe(r.name,s.operations),m=lt(r.name,s.operations,o),c=Ct(m),d=r.status==="connected"&&(r.status_basis==="probe"||r.status_basis==="live"),x=o.holdUntil!==null&&a<o.holdUntil,p=!x&&!c&&o.connectedAt===null&&r.status_basis==="stored"&&r.tool_count_basis==="last_seen"?Is(r.last_seen_at,a):null,h=!c,_=m?.status==="failed"&&ct(m)&&Os.test(m.message??""),y={connectedAt:d&&!x?a:p!==null?p:h?o.connectedAt:null,connectedToolCount:d&&!x||p!==null?r.tool_count??o.connectedToolCount:h?o.connectedToolCount:null,settledGroup:o.settledGroup,pinnedGroup:u&&o.pinnedOperationId===u.id?o.pinnedGroup:u?o.settledGroup:null,pinnedOperationId:u?u.id:null,needsKey:d?!1:o.needsKey||_,needsSignIn:d||c?!1:o.needsSignIn||r.status==="needs_sign_in",disconnectedAt:d&&!x?null:o.disconnectedAt,holdUntil:x?o.holdUntil:null,lastDecisive:m?Cc(m):null};u||(y.settledGroup=Ls(r,s.operations,{...i,[r.name]:y})),i[r.name]=y}return i}const Uc=(e,s)=>e!==null&&s===e,Zt="local-operator.settings.integrations.row-memory",Fs=(e,s)=>`${e}#${s}`;function Bc(e,s){const a={};if(!s)return a;for(const i of s.servers){const r=e[i.name];r&&(a[Fs(i.source.path,i.name)]=r)}return a}function Vc(e,s,a){if(!s)return e;let i=null;for(const r of s.servers){if(Object.prototype.hasOwnProperty.call(e,r.name))continue;const o=Gc(a[Fs(r.source.path,r.name)]);o&&(i=i??{...e},i[r.name]=o)}return i??e}const Hc=["attention","connected","ready"],Ds=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),hn=e=>typeof e=="number"&&Number.isFinite(e)?e:null,Pn=e=>Hc.includes(e)?e:null,Ft=e=>{const s=hn(e);return s!==null&&s>=1e12?s:null};function qc(e){if(!Ds(e)||typeof e.id!="string"||typeof e.name!="string")return null;const s=e.action,a=e.status;return s!=="login"&&s!=="logout"&&s!=="reauth"&&s!=="test"||a!=="running"&&a!=="complete"&&a!=="cancelled"&&a!=="failed"?null:{id:e.id,name:e.name,action:s,status:a,created_at:hn(e.created_at)??0,credential_removed:e.credential_removed===!0,...typeof e.message=="string"?{message:e.message}:{}}}function Gc(e){if(!Ds(e))return null;const s=Ft(e.connectedAt),a=Ft(e.disconnectedAt),i=e.needsKey===!0,r=e.needsSignIn===!0,o=qc(e.lastDecisive);return s===null&&a===null&&!i&&!r&&!o?null:{connectedAt:s,connectedToolCount:hn(e.connectedToolCount),settledGroup:Pn(e.settledGroup),pinnedGroup:Pn(e.pinnedGroup),pinnedOperationId:typeof e.pinnedOperationId=="string"?e.pinnedOperationId:null,needsKey:i,needsSignIn:r,disconnectedAt:a,holdUntil:Ft(e.holdUntil),lastDecisive:o}}const zs=2e3,Kn=8e3;function Yc(e){return e&&(e.servers.some(a=>a.status==="connecting")||e.operations.some(a=>a.status==="running"))?zs:!1}const Qc=/^[A-Za-z0-9_.:-]{1,100}$/,Wc=/:\/\//;function Zc(e,s){const a=e.trim();return a?Qc.test(a)?s.includes(a)?n("ui.settings.integrations.integration_model.an_integration_named_trimmed_already_exists",{trimmed:String(a)}):null:n("ui.settings.integrations.integration_model.use_letters_numbers_dots_dashes_underscores_or_colons_with_no_spa"):n("ui.settings.integrations.integration_model.give_it_a_name")}function Jc(e){const s=e.trim();if(!s)return n("ui.settings.integrations.integration_model.enter_the_server_s_url");let a;try{a=new URL(s)}catch{return n("ui.settings.integrations.integration_model.enter_a_full_url_like_https_mcp_example_com_mcp")}return a.protocol!=="https:"&&a.protocol!=="http:"?n("ui.settings.integrations.integration_model.the_url_must_start_with_https_or_http"):a.hostname?a.username||a.password?n("ui.settings.integrations.integration_model.remove_the_username_or_password_from_the_url_keys_are_added_after"):a.search||a.hash?n("ui.settings.integrations.integration_model.remove_the_or_part_of_the_url_keys_are_added_after_it_s_saved"):Wc.test(s.slice(a.protocol.length+2))?n("ui.settings.integrations.integration_model.this_looks_like_two_urls_pasted_together_enter_just_one"):null:n("ui.settings.integrations.integration_model.the_url_needs_a_host_name")}const Xc=e=>e.split(`
|
|
287
|
+
`).map(s=>s.trim()).filter(Boolean);function Jt(e,s){const a=!!e?.cold,i=(e?.servers??[]).map(r=>{const o=r.transport==="http",u=r.secret_refs??[],m=r.status==="connected"?"connected":r.status==="connecting"?"connecting":r.status==="auth-required"?"needs_sign_in":"not_started",c=[];m!=="connected"&&c.push("connect"),m==="connected"&&c.push("disconnect"),a||c.push("reload"),o&&r.transport_oauth_supported!==!1&&c.push("sign_in"),u.length>0&&c.push("set_key"),r.owned_scope&&c.push("remove"),r.setup?.text&&c.push("copy_setup");const d=Es(r.source);return{id:r.name,name:r.name,scope:r.owned_scope??"global",project_cwd:null,source:{kind:ed(r.source,d,r.owned_scope),path:r.source??"",editable:r.owned_scope!==null,owned_scope:r.owned_scope},transport:o?"remote_url":"local_command",endpoint:{command:null,url:null,endpoint_redacted:!1},status:m,status_reason:null,status_observed_at:null,last_seen_at:null,status_basis:a?"stored":"live",auth:{kind:u.length?"api_key":o?"unknown":"none",signed_in:null,secret_refs:u.map(x=>({id:x.id,state:"missing"}))},tool_count:typeof r.tool_count=="number"?r.tool_count:null,tool_count_basis:typeof r.tool_count=="number"?"live":null,actions:c,setup_prompt:r.setup?.text??null}});return{cwd:"",project_scope_available:i.some(r=>r.source.owned_scope==="project"),global_path:"",project_path:null,status_source:a?"config":"live",session_id:s,servers:i,operations:(e?.operations??[]).map(r=>({...r}))}}const ed=(e,s,a)=>s==="Claude Code"?"claude-code":s==="Cursor"?"cursor":s==="VS Code"?"vscode":s==="Codex CLI"?"codex":a?"local-operator":e?"project-mcp-json":"local-operator",Un={get invalid_config(){return n("ui.settings.integrations.integration_model.that_configuration_isn_t_valid_check_the_command_or_the_url_then_")},get operation_unavailable(){return n("ui.settings.integrations.integration_model.that_sign_in_or_test_isn_t_running_any_more_try_again")},get exists(){return n("ui.settings.integrations.integration_model.an_integration_with_this_name_already_exists_choose_another_name")},get not_owned(){return n("ui.settings.integrations.integration_model.it_s_defined_in_another_tool_s_config_so_it_can_t_be_changed_here")},get project_scope_unavailable(){return n("ui.settings.integrations.integration_model.there_s_no_separate_project_config_here_so_it_can_only_be_added_g")},get unknown_server(){return n("ui.settings.integrations.integration_model.it_no_longer_exists_the_list_has_been_refreshed")},get oauth_unsupported(){return n("ui.settings.integrations.integration_model.it_doesn_t_use_browser_sign_in")},get grant_running(){return n("ui.settings.integrations.integration_model.a_sign_in_or_test_is_already_running_wait_for_it_to_finish_or_can")},get too_many_operations(){return n("ui.settings.integrations.integration_model.too_many_sign_ins_and_tests_are_waiting_try_again_in_a_moment")},get write_failed(){return n("ui.settings.integrations.integration_model.the_config_file_couldn_t_be_written_check_that_it_isn_t_read_only")},get mcp_starting(){return n("ui.settings.integrations.integration_model.integrations_are_still_starting_try_again_in_a_moment")},get mcp_control_refused(){return n("ui.settings.integrations.integration_model.the_server_refused_it_so_nothing_was_changed")}},td="ui.settings.integrations.integration_model.copy_catalog_refusal_fallback";function _t(e,s,a){if(s instanceof rn&&s.status===409){const i=typeof s.code=="string"&&Object.prototype.hasOwnProperty.call(Un,s.code)?Un[s.code]:n(td);return`${da[e]}. ${i}`}return ua(e,s,a).message}const nd="ui.settings.integrations.add_integration_form.copy_add_integration_pickup_note",sd="ui.settings.integrations.add_integration_form.copy_transport_hint",ad=({existingNames:e,projectScopeAvailable:s,projectLabel:a,onSubmit:i,onCancel:r,initial:o})=>{se();const[u,m]=l.useState(o?.name??""),[c,d]=l.useState(o?.mode??"command"),[x,p]=l.useState(o?.command??""),[h,_]=l.useState(o?.args??""),[y,v]=l.useState(o?.url??""),[w,z]=l.useState("global"),[S,I]=l.useState(o?.touched?{name:!0,command:!0,url:!0}:{}),[b,N]=l.useState(!!o?.touched),[k,$]=l.useState(!1),[W,Y]=l.useState(null),P=l.useRef(null),Q=l.useRef(null),K=l.useRef(null);l.useEffect(()=>{P.current?.focus()},[]);const U=Zc(u,e),V=c==="command"&&!x.trim()?n("ui.settings.integrations.add_integration_form.enter_the_command_to_run"):null,B=c==="url"?Jc(y):null,M=E=>b||S[E],A=async E=>{if(E.preventDefault(),N(!0),U||V||B){U?P.current?.focus():V?Q.current?.focus():K.current?.focus();return}$(!0),Y(null);const Z=s?w:"global",J=c==="command"?{name:u.trim(),scope:Z,mode:c,command:x.trim(),args:Xc(h)}:{name:u.trim(),scope:Z,mode:c,url:y.trim()},ee=await i(J);$(!1),Y(ee)},g=(E,Z,J)=>Z&&M(J)?t.jsx("p",{id:E,className:"text-body-sm text-danger",children:Z}):null,T=E=>E.preventDefault();return t.jsxs("form",{noValidate:!0,"aria-label":n("ui.settings.integrations.add_integration_form.add_integration"),className:"flex flex-col gap-4 rounded-lg bg-surface p-4",onSubmit:E=>void A(E),onKeyDown:E=>{E.key==="Escape"&&(E.stopPropagation(),r())},children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Ie,{htmlFor:"integration-add-name",children:n("ui.settings.integrations.add_integration_form.name")}),t.jsx(De,{ref:P,id:"integration-add-name",value:u,placeholder:n("ui.settings.integrations.add_integration_form.e_g_notion"),autoComplete:"off","aria-invalid":!!(U&&M("name")),"aria-describedby":U&&M("name")?"integration-add-name-error":void 0,onChange:E=>m(E.target.value),onBlur:()=>I(E=>({...E,name:!0}))}),g("integration-add-name-error",U,"name")]}),t.jsxs(jt,{value:c,onValueChange:E=>d(E==="url"?"url":"command"),className:"flex flex-col gap-1.5",children:[t.jsx("span",{id:"integration-add-transport-label",className:"font-medium text-body-sm text-ink",children:n("ui.settings.integrations.add_integration_form.how_it_runs")}),t.jsxs(wt,{"aria-labelledby":"integration-add-transport-label",children:[t.jsx(We,{value:"command","data-integration-transport":"command",children:n("ui.settings.integrations.add_integration_form.local_command")}),t.jsx(We,{value:"url","data-integration-transport":"url",children:n("ui.settings.integrations.add_integration_form.remote_url")})]}),t.jsx("p",{className:"text-ink-dim text-meta",children:n(sd)}),t.jsxs(Sn,{value:"command",className:"mt-0 flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Ie,{htmlFor:"integration-add-command",children:n("ui.settings.integrations.add_integration_form.command")}),t.jsx(De,{ref:Q,id:"integration-add-command",value:x,placeholder:n("ui.settings.integrations.add_integration_form.e_g_npx"),autoComplete:"off",className:"font-mono","aria-invalid":!!(V&&M("command")),"aria-describedby":V&&M("command")?"integration-add-command-error":void 0,onChange:E=>p(E.target.value),onBlur:()=>I(E=>({...E,command:!0}))}),g("integration-add-command-error",V,"command")]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs(Ie,{htmlFor:"integration-add-args",children:[n("ui.settings.integrations.add_integration_form.arguments")," ",t.jsx("span",{className:"font-normal text-ink-dim",children:n("ui.settings.integrations.add_integration_form.one_per_line")})]}),t.jsx(fs,{id:"integration-add-args",value:h,rows:2,className:"font-mono",onChange:E=>_(E.target.value)})]})]}),t.jsx(Sn,{value:"url",className:"mt-0 flex flex-col gap-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Ie,{htmlFor:"integration-add-url",children:n("ui.settings.integrations.add_integration_form.url")}),t.jsx(De,{ref:K,id:"integration-add-url",type:"url",value:y,placeholder:n("ui.settings.integrations.add_integration_form.https_mcp_example_com_mcp"),autoComplete:"off",className:"font-mono","aria-invalid":!!(B&&M("url")),"aria-describedby":B&&M("url")?"integration-add-url-error":"integration-add-url-help",onChange:E=>v(E.target.value),onBlur:()=>I(E=>({...E,url:!0}))}),g("integration-add-url-error",B,"url")??t.jsx("p",{id:"integration-add-url-help",className:"text-ink-dim text-meta",children:n("ui.settings.integrations.add_integration_form.if_it_needs_a_sign_in_or_a_key_you_ll_be_asked_after_it_s_added")})]})})]}),s?t.jsxs(jt,{value:w,onValueChange:E=>z(E==="project"?"project":"global"),className:"flex flex-col gap-1.5",children:[t.jsx("span",{id:"integration-add-scope-label",className:"font-medium text-body-sm text-ink",children:n("ui.settings.integrations.add_integration_form.available_in")}),t.jsxs(wt,{"aria-labelledby":"integration-add-scope-label",children:[t.jsx(We,{value:"global","data-integration-scope":"global",children:n("ui.settings.integrations.add_integration_form.all_chats")}),t.jsx(We,{value:"project","data-integration-scope":"project",children:n("ui.settings.integrations.add_integration_form.this_project")})]}),a?t.jsx("p",{className:"text-ink-dim text-meta",children:w==="project"?n("ui.settings.integrations.add_integration_form.only_chats_working_in_projectlabel",{projectLabel:String(a)}):n("ui.settings.integrations.add_integration_form.every_chat_in_any_folder")}):null]}):null,W?t.jsx("p",{className:"text-body-sm text-danger",role:"alert",children:W}):null,t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("p",{className:ue("text-body-sm text-ink-dim"),children:n(nd)}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(O,{type:"button",variant:"ghost",size:"md",onMouseDown:T,onClick:r,children:n("ui.settings.integrations.add_integration_form.cancel")}),t.jsxs(O,{type:"submit",variant:"primary",size:"md",disabled:k,onMouseDown:T,children:[k?t.jsx(ye,{size:"xs"}):null,n("ui.settings.integrations.add_integration_form.add_integration")]})]})]})]})},id=4;function rd(e){return e.rowMoving?e.now+e.windowMs:Math.max(e.hold.until,e.lastMovingAt+e.windowMs)}function od(e){return e.now>e.hold.until||e.hold.reanchors>=id?"drop":e.hold.landedOn.isConnected&&(!e.candidate||e.candidate===e.hold.landedOn)?"settled":e.active&&e.active!==e.body&&e.active!==e.hold.landedOn?"drop":e.candidate?.isConnected?"restore":"drop"}function ld(e){const s=rd({hold:e.hold,now:e.now,windowMs:e.windowMs,rowMoving:e.rowMoving,lastMovingAt:e.lastMovingAt});if(e.now>s)return{hold:null,land:null};const a=e.hold.landedOn??null,i=e.candidate;if(!i)return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:a},land:null};if(!a)return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:i},land:i};const r=od({hold:{until:s,reanchors:e.hold.reanchors,landedOn:a},candidate:i,active:e.active,body:e.body,now:e.now});if(r==="settled")return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:a},land:null};if(r==="drop")return{hold:null,land:null};const o=!a.isConnected;return{hold:{until:o?e.now+e.windowMs:s,reanchors:o?e.hold.reanchors+1:e.hold.reanchors,landedOn:i},land:i}}function cd(e){const{row:s,target:a}=e;return!s||!a||typeof a.nodeType!="number"?!1:!s.contains(a)}const Bn=250;function Vn(e){return e?!e.disabled:!1}function dd(e){return Vn(e.primary)?e.primary??null:Vn(e.overflow)?e.overflow??null:null}function ud(e){return e.verdict==="finished"?null:e.watchMs}const $s="key";function gd(e){const{name:s,keyless:a,freeName:i,names:r,values:o,replace:u,canReplace:m}=e;if(a){const c=Xt(s,i);return{values:{[c]:(o[$s]??"").trim()},confirmedReplace:u&&m?[c]:[],header:i.trim()}}return{values:Object.fromEntries(r.map(c=>[c,(o[c]??"").trim()])),confirmedReplace:u&&m?r:[],header:void 0}}function Xt(e,s){const a=Hn(e),i=Hn(s);if(!i)return"";const r=[a,i].filter(Boolean).join("_"),o=/^[A-Za-z_]/.test(r)?r:`K_${r}`;if(o.length<=Dt)return o;const u=md(a),m=Dt-i.length-u.length-2,c=[a.slice(0,Math.max(m,0)),u,i].filter(Boolean).join("_");return c.length<=Dt?c:c.slice(-128)}const Dt=128,Hn=e=>e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,""),md=e=>{let s=2166136261;for(let a=0;a<e.length;a+=1)s^=e.charCodeAt(a),s=Math.imul(s,16777619)>>>0;return s.toString(36).toUpperCase().slice(0,5)},_d=({name:e,keyNames:s,keyless:a=!1,savedKeys:i=[],saving:r,failure:o,onSave:u,onClose:m})=>{se();const[c,d]=l.useState({}),[x,p]=l.useState(!1),[h,_]=l.useState(""),y=a?[Xt(e,h)]:[...s],v=a?[$s]:y,w=(a?Xt(e,h).length>0:!0)&&v.every(S=>(c[S]??"").trim()),z=y.some(S=>i.includes(S));return t.jsx(ss,{open:!0,onClose:m,maxWidth:"xs",title:n("ui.settings.integrations.integration_key_dialog.add_keys_heading",{count:a?1:s.length,name:e}),actions:t.jsxs(t.Fragment,{children:[t.jsx(Ut,{onClick:m,children:n("ui.settings.integrations.integration_key_dialog.cancel")}),t.jsx(Bt,{disabled:!w||r,onClick:()=>{const S=gd({name:e,keyless:a,freeName:h,names:y,values:c,replace:x,canReplace:z});u(S.values,S.confirmedReplace,S.header)},children:r?n("ui.settings.integrations.integration_key_dialog.saving"):n("ui.settings.integrations.integration_key_dialog.save_and_test")})]}),children:t.jsxs("div",{className:"flex flex-col gap-3 p-1.5 text-body text-ink-muted",children:[t.jsx("p",{className:"-mx-1.5",children:a?n("ui.settings.integrations.integration_key_dialog.keys_are_saved_encrypted_on_this_computer_this_one_is_stored_unde"):n("ui.settings.integrations.integration_key_dialog.keys_are_saved_encrypted_on_this_computer_other_integrations_that")}),a?t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Ie,{htmlFor:"integration-key-name",children:n("ui.settings.integrations.integration_key_dialog.the_header_this_server_wants_the_key_in")}),t.jsx(De,{id:"integration-key-name",autoComplete:"off",placeholder:n("ui.settings.integrations.integration_key_dialog.e_g_authorization_or_x_api_key"),value:h,onChange:S=>_(S.target.value)}),t.jsx("p",{className:"-mx-1.5 text-ink-dim text-meta",children:n("ui.settings.integrations.integration_key_dialog.this_server_declares_no_key_of_its_own_so_local_operator_adds_one")})]}):null,v.filter(S=>a!==!0||S.trim().length>0).map(S=>t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(Ie,{htmlFor:`integration-key-${S}`,className:"font-mono",children:a?"Key":S}),t.jsx(De,{id:`integration-key-${S}`,type:"password",autoComplete:"off",value:c[S]??"",onChange:I=>d(b=>({...b,[S]:I.target.value}))})]},S)),z?t.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[t.jsx(Gt,{id:"integration-key-replace",checked:x,onCheckedChange:S=>p(S===!0)}),t.jsx(Ie,{htmlFor:"integration-key-replace",className:"font-normal",children:Rs(y.length)})]}):null,o?t.jsx("p",{className:"-mx-1.5 text-body-sm text-danger",role:"alert",children:o}):null]})})},pd={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",neutral:"bg-ink-dim"},fd={success:"text-ink-muted",warning:"text-warning",danger:"text-danger",info:"text-ink-muted",neutral:"text-ink-dim"},hd=({row:e,operations:s,memories:a,now:i,projectScopeAvailable:r,highlighted:o=!1,rowRef:u,primaryRef:m,overflowRef:c,pending:d,failure:x,confirm:p,onPrimary:h,onOverflow:_,onConfirm:y,onCancelConfirm:v})=>{se();const w=Rc(e,s,a,i),z=o&&w.tone==="danger"?"text-ink":fd[w.tone],S=pn(e,s,a),I=zc(e,s,a),b=Dc(e,r),N=I.findIndex(k=>k.kind==="remove"||k.kind==="remove_elsewhere");return t.jsxs("li",{ref:u,"data-integration":e.name,"data-status":e.status,className:ue("flex min-h-14 flex-col justify-center gap-1 px-4 py-2.5",o&&"bg-row-selected"),onKeyDown:k=>{!p||k.key!=="Escape"||(k.stopPropagation(),v())},children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:w.busy?t.jsx(ye,{size:"xs"}):t.jsx("span",{"aria-hidden":"true","data-tone":w.tone,className:ue("size-2 rounded-full",pd[w.tone])})}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[t.jsx("span",{className:"truncate font-medium text-body text-ink",title:e.name,children:e.name}),t.jsx("span",{className:"truncate text-ink-dim text-meta",children:b.map((k,$)=>t.jsxs("span",{children:[$>0?" · ":null,k.importSource&&e.source.path?t.jsx(Je,{content:ii(e.source.path),children:t.jsx("span",{className:"underline decoration-dotted underline-offset-2",children:k.text})}):k.text]},k.text))})]}),w.explanation?t.jsx(Je,{content:w.explanation,children:t.jsx("span",{className:ue("shrink-0 text-body-sm",z),children:w.label})}):t.jsx("span",{className:ue("shrink-0 text-body-sm",z),children:w.label}),S?t.jsxs(O,{ref:m,variant:S.variant??"secondary",size:"sm","aria-label":`${S.label} ${e.name}`,disabled:d,"data-integration-action":S.kind,onClick:()=>h(S),children:[d?t.jsx(ye,{size:"xs"}):null,S.label]}):null,t.jsxs(zi,{children:[t.jsx($i,{asChild:!0,children:t.jsx(O,{ref:c,variant:"ghost",size:"icon-sm","aria-label":n("ui.settings.integrations.integration_row.more_actions_for_name",{name:String(e.name)}),disabled:d,children:t.jsx(ga,{"aria-hidden":"true"})})}),t.jsx(Pi,{align:"end",className:"min-w-48",children:I.map((k,$)=>t.jsx(xd,{item:k,separated:$===N&&$>0,onSelect:()=>_(k)},k.kind))})]})]}),w.detail?t.jsx("p",{className:ue("ps-7 text-body-sm",w.tone==="danger"?"text-ink-muted":"text-ink-dim"),children:w.detail}):null,x?t.jsx("p",{className:ue("ps-7 text-body-sm",o?"text-ink":"text-danger"),role:"alert",children:x}):null,p?t.jsxs("div",{className:"flex flex-wrap items-center gap-2 ps-7",children:[t.jsx("span",{className:"text-body-sm text-ink",children:p.kind==="remove"?n("ui.settings.integrations.integration_row.remove_name",{name:String(e.name)}):n("ui.settings.integrations.integration_row.sign_out_of_name",{name:String(e.name)})}),t.jsx("span",{className:"text-body-sm text-ink-muted",children:p.kind==="remove"?n("ui.settings.integrations.integration_row.agents_in_every_chat_lose_access_to_name",{name:String(e.name)}):e.auth.kind==="oauth"?n("ui.settings.integrations.integration_row.the_saved_sign_in_is_removed_too"):n("ui.settings.integrations.integration_row.its_saved_credential_is_removed_too")}),t.jsx(O,{variant:"danger",size:"sm",onClick:y,"data-integration-confirm":p.kind,children:p.kind==="remove"?n("ui.settings.integrations.integration_row.remove"):n("ui.settings.integrations.integration_row.sign_out")}),t.jsx(O,{variant:"ghost",size:"sm",onClick:v,children:n("ui.settings.integrations.integration_row.keep")})]}):null]})},xd=({item:e,separated:s,onSelect:a})=>(se(),t.jsxs(t.Fragment,{children:[s?t.jsx(Ki,{}):null,e.kind==="remove_elsewhere"?t.jsxs(Mn,{disabled:!0,className:"flex-col items-start gap-0.5",children:[t.jsx("span",{children:e.label}),t.jsx("span",{className:"text-meta text-ink-dim",children:e.hint})]}):t.jsx(Mn,{destructive:e.kind==="remove",onSelect:a,"data-integration-menu":e.kind,children:e.label})]}));function yd(e,s,a){return!s||s.status==="running"?s?.browser_opened===!0?{message:n("ui.settings.integrations.integration_sign_in_dialog.your_browser_opened_approve_access_to_name_there_then_come_back_h",{name:String(e)}),tone:"progress",link:s.authorization_url??null}:s?.browser_opened===!1?{message:s.authorization_url?n("ui.settings.integrations.integration_sign_in_dialog.your_browser_didn_t_open_open_this_link_to_approve_access"):n("ui.settings.integrations.integration_sign_in_dialog.your_browser_didn_t_open_and_no_link_was_provided_cancel_and_try_"),tone:"progress",link:s.authorization_url??null}:{message:n("ui.settings.integrations.integration_sign_in_dialog.waiting_for_you_to_approve_access_to_name",{name:String(e)}),tone:"progress",link:s?.authorization_url??null}:s.status==="complete"?{message:n("ui.settings.integrations.integration_sign_in_dialog.signed_in_to_name_agents_can_use_it_now",{name:String(e)}),tone:"success",link:null}:s.status==="cancelled"?{message:n("ui.settings.integrations.integration_sign_in_dialog.sign_in_cancelled"),tone:"failure",link:null,reason:null,nextStep:n("ui.settings.integrations.integration_sign_in_dialog.press_try_again_when_you_are_ready")}:{message:n("ui.settings.integrations.integration_sign_in_dialog.sign_in_didn_t_finish"),tone:"failure",link:null,reason:Oc(s.message,a)??n("ui.settings.integrations.integration_sign_in_dialog.the_server_didn_t_say_why"),nextStep:vd(s.message??null,a)}}function vd(e,s){const a=(e??"").toLowerCase();return a.includes("redirect")?s?n("ui.settings.integrations.integration_sign_in_dialog.this_server_may_not_accept_sign_ins_from_local_operator_check_the"):n("ui.settings.integrations.integration_sign_in_dialog.this_server_may_not_accept_sign_ins_from_local_operator_check_the_2"):a.includes("no oauth")||a.includes("authorization server")?s?n("ui.settings.integrations.integration_sign_in_dialog.this_server_doesn_t_publish_a_browser_sign_in_add_its_key_instead"):n("ui.settings.integrations.integration_sign_in_dialog.this_server_doesn_t_publish_a_browser_sign_in_check_the_server_s_"):a.includes("network")||a.includes("connect")?n("ui.settings.integrations.integration_sign_in_dialog.check_the_server_s_url_and_your_network_then_try_again"):n("ui.settings.integrations.integration_sign_in_dialog.check_the_server_s_settings_then_try_again")}function bd(e,s){return e.kind==="ready"?"ready":e.kind==="running"&&s&&s.tone!=="progress"?s.tone==="success"?"success":"failure":"running"}const kd=({name:e,action:s,keyRoute:a,phase:i,onStart:r,onCancel:o,onOpenLink:u,onClose:m})=>{se();const c=i.kind==="running"?i.operation:null,d=i.kind==="running"?yd(e,c,a):null,x=i.kind==="starting"||i.kind==="running"&&d?.tone==="progress",p=d&&d.tone!=="progress",h=l.useRef(null),_=l.useRef(!1),y=bd(i,d);l.useEffect(()=>{if(!_.current){_.current=!0;return}y&&h.current?.focus()},[y]);const v=()=>m(d?.tone==="success"?"signed-in":"dismissed");return t.jsx(ss,{open:!0,onClose:v,maxWidth:"xs",fullWidth:!0,title:n("ui.settings.integrations.integration_sign_in_dialog.sign_in_to_name",{name:String(e)}),dialogProps:{onOpenAutoFocus:w=>{w.preventDefault(),h.current?.focus()}},actions:t.jsxs(t.Fragment,{children:[x&&c?t.jsx(Ut,{ref:h,onClick:()=>o(c.id),children:n("ui.settings.integrations.integration_sign_in_dialog.cancel_sign_in")}):t.jsx(Ut,{ref:i.kind==="ready"?void 0:h,onClick:v,children:d?.tone==="success"?n("ui.settings.integrations.integration_sign_in_dialog.done"):n("ui.settings.integrations.integration_sign_in_dialog.close")}),i.kind==="ready"?t.jsx(Bt,{ref:h,onClick:r,children:n("ui.settings.integrations.integration_sign_in_dialog.continue_in_browser")}):null,i.kind==="refused"||d?.tone==="failure"?t.jsx(Bt,{ref:d?.tone==="failure"?h:void 0,onClick:r,children:n("ui.settings.integrations.integration_sign_in_dialog.try_again")}):null]}),children:t.jsxs("div",{className:"flex flex-col gap-3 p-1.5 text-body text-ink-muted","aria-live":"polite",children:[i.kind==="ready"?t.jsx("p",{className:"-mx-1.5",children:n("ui.settings.integrations.integration_sign_in_dialog.browser_approval_notice",{name:e,replaces:s==="reauth"?"yes":"no"})}):null,i.kind==="starting"?t.jsxs("p",{className:"-mx-1.5 flex items-center gap-2",children:[t.jsx(ye,{size:"xs"}),n("ui.settings.integrations.integration_sign_in_dialog.starting_sign_in")]}):null,d?t.jsxs("div",{className:"flex flex-col gap-1",role:p?"status":void 0,children:[t.jsxs("p",{className:(d.tone==="success","-mx-1.5 flex items-start gap-2 text-ink"),children:[d.tone==="progress"?t.jsx(ye,{size:"xs",className:"mt-0.5"}):null,d.tone==="failure"?t.jsx(Ui,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0 text-danger"}):null,t.jsx("span",{children:d.message})]}),d.reason?t.jsx("p",{className:"-mx-1.5 text-ink-muted",children:d.reason}):null,d.nextStep?t.jsx("p",{className:"-mx-1.5 text-ink-muted",children:d.nextStep}):null]}):null,d?.link&&d.tone==="progress"?t.jsxs("div",{className:"flex flex-col items-start gap-1",children:[t.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-ink-dim text-mono-sm",title:d.link,children:d.link}),t.jsx(O,{variant:"ghost",size:"icon-sm","aria-label":n("ui.settings.integrations.integration_sign_in_dialog.copy_the_sign_in_link"),title:n("ui.settings.integrations.integration_sign_in_dialog.copy_the_sign_in_link"),onClick:()=>{navigator.clipboard.writeText(d.link??"").then(()=>Vt(n("ui.settings.integrations.integration_sign_in_dialog.sign_in_link_copied"))).catch(()=>{})},children:t.jsx(ns,{"aria-hidden":"true"})})]}),t.jsx(O,{variant:"link",size:"sm",onClick:()=>u(d.link??""),children:n("ui.settings.integrations.integration_sign_in_dialog.open_the_sign_in_page")})]}):null,i.kind==="refused"?t.jsx("p",{className:"text-danger",role:"alert",children:i.message}):null]})})},jd=e=>e.reduce((s,a)=>s?(a.updated_at??0)>(s.updated_at??0)?a:s:a,null),wd=/^[A-Za-z]:[\\/]/,bt=e=>{const s=e?.trim();return s&&(s.startsWith("/")||wd.test(s))?s:null};function Nd(e){const r=e?.payload?.frontend?.snapshot?.cwd;return typeof r=="string"&&r.trim()?r:null}const rt="local-operator.settings.integrations.last-cwd";function Sd(e,s,a=typeof localStorage>"u"?null:localStorage){const i=bt(s);if(!(!e||!i||!a))try{const r=a.getItem(rt),o=r?JSON.parse(r):{};if(o[e]===i)return;a.setItem(rt,JSON.stringify({...o,[e]:i}))}catch{}}const Ps=()=>typeof localStorage>"u"?null:localStorage;function Ks(e=Ps()){if(!e)return{};try{const s=e.getItem(Zt);if(!s)return{};const a=JSON.parse(s);return!a||typeof a!="object"||Array.isArray(a)?{}:a}catch{return{}}}const qn=256;function Md(e,s=Ps()){if(s)try{const a={...Ks(s),...e},i=Object.keys(a);if(i.length>qn){const r={};for(const o of i.slice(-qn))r[o]=a[o];s.setItem(Zt,JSON.stringify(r));return}s.setItem(Zt,JSON.stringify(a))}catch{}}function Gn(e,s,a){if(e==="saved")return null;if(e==="replace_confirmation_required"){const r=Rs(Object.keys(a).length);return n("ui.settings.integrations.use_integrations.a_saved_value_already_exists_for_this_key_tick_label_to_overwrite",{label:String(r)})}if(e==="invalid_target")return n("ui.settings.integrations.use_integrations.that_header_can_t_carry_this_key_it_may_already_be_set_on_the_ser");const i=s.length?s:Object.keys(a);return n("ui.settings.integrations.use_integrations.keys_not_saved",{keys:String(i.join(", "))})}function Cd(e,s=typeof localStorage>"u"?null:localStorage){if(!(!e||!s))try{const a=s.getItem(rt);if(!a)return;const i=JSON.parse(a);if(!(e in i))return;const r={...i};delete r[e],s.setItem(rt,JSON.stringify(r))}catch{}}const Ed=e=>!!(e&&typeof e=="object"&&"code"in e&&e.code==="invalid_cwd"),Ad=(e,s)=>s!==null&&e===s?null:e;function Id(e,s=typeof localStorage>"u"?null:localStorage){if(!e||!s)return null;try{const a=s.getItem(rt);if(!a)return null;const r=JSON.parse(a)[e];return typeof r=="string"?r:null}catch{return null}}const Rd=e=>e.action==="disconnect"?"disconnected":"connected";function Td(e){switch(e.action){case"cancel":return{action:"cancel",operation_id:e.operationId};case"connect":case"disconnect":case"reload":return null;case"test":return{action:"test",name:e.name};default:return{...e,confirmed:!0}}}function Od(e){switch(e.action){case"cancel":return{action:"cancel",operation_id:e.operationId};case"test":case"connect":return{action:"connect",name:e.name};case"reload":return{action:"reload",name:e.name};case"add":return e;case"remove":return{...e,confirmed:!0};default:return{action:e.action,name:e.name,confirmed:!0}}}function Ld({sessionId:e}){const s=an(),a=kt(s.data,"mcp_catalog"),i=kt(s.data,"mcp"),r=a?"catalog":i?"session":null,[o,u]=l.useState(null),m=sn(),c=st(C=>C.sessions),d=st(C=>C.fetchSessions),x=st(C=>C.loading),p=l.useMemo(()=>c.find(C=>C.session_id===e)??null,[c,e]),h=l.useMemo(()=>r==="session"&&!e?jd(c):null,[r,e,c]),_=r==="session"?e??h?.session_id??null:null;l.useEffect(()=>{r!=="session"||e||c.length>0||d(ri)},[r,e,c.length,d]);const y=r==="catalog"?bt(p?.cwd):null,v=r==="catalog"&&!!e&&y===null,w=Re({queryKey:["desktop","session-cwd",e??""],queryFn:()=>_e({op:"sessions.get",sessionId:e??""}),enabled:v,staleTime:Number.POSITIVE_INFINITY,retry:!1}),z=v&&!w.isFetched,S=y??bt(Nd(w.data))??(w.isFetched?bt(Id(e)):null),I=Ad(S,o),b=r==="catalog"?I:null,N=r==="catalog"?e??null:null,k=ma.catalog(b,N);l.useEffect(()=>{r!=="catalog"||!e||!b||Sd(e,b)},[r,e,b]);const $=l.useRef(0),[W,Y]=l.useState(0),P=l.useRef(null),Q=l.useCallback((C,H)=>{const L=Date.now()+Kn;$.current=L,P.current={name:C,expect:H},Y(L)},[]),K=l.useCallback(C=>Date.now()<$.current?zs:Yc(C),[]),U=Re({queryKey:k,queryFn:()=>fa(b,N),enabled:r==="catalog"&&!z,staleTime:1e4,refetchInterval:C=>K(C.state.data)}),V=Ed(U.error);l.useEffect(()=>{!V||!S||o===S||(u(S),Cd(e))},[V,S,o,e]);const B=Re({queryKey:Ht.list(_??""),queryFn:()=>ha(_??""),enabled:r==="session"&&!!_,staleTime:1e4,refetchInterval:C=>K(C.state.data?Jt(C.state.data,_??""):void 0)}),M=l.useMemo(()=>{if(r==="catalog")return U.data;if(r==="session"&&B.data&&_)return Jt(B.data,_)},[r,U.data,B.data,_]),A=l.useCallback(()=>Fd({queryClient:m,route:r,catalogKey:k,sessionId:_}),[r,k,m,_]);l.useEffect(()=>{if(!W)return;const C=P.current;if(!C)return;const H=M?.servers.find(ie=>ie.name===C.name);!H||!(C.expect==="connected"?H.status==="connected":H.status_basis==="live"&&H.status!=="connected")||($.current=0,P.current=null,Y(0))},[M,W]);const g=l.useRef({}),[T,E]=l.useState(0),Z=l.useMemo(()=>(g.current=Kc(Vc(g.current,M,Ks()),M),g.current),[M,T]),J=l.useRef("");l.useEffect(()=>{const C=Bc(Z,M);if(!Object.keys(C).length)return;const H=JSON.stringify(C);H!==J.current&&(J.current=H,Md(C))},[Z,M]);const ee=l.useCallback(C=>{const H=Ye(g.current,C);H.needsKey||(g.current={...g.current,[C]:{...H,needsKey:!0}},E(L=>L+1))},[]),G=l.useCallback(C=>{if(C.action!=="disconnect"&&C.action!=="connect"&&C.action!=="reload")return;const H=Ye(g.current,C.name),L=Date.now()+Kn,ie=C.action==="disconnect"?{...H,connectedAt:null,disconnectedAt:Date.now(),holdUntil:L}:{...H,disconnectedAt:null,holdUntil:L};g.current={...g.current,[C.name]:ie},Q(C.name,Rd(C)),E(re=>re+1)},[Q]),X=l.useCallback(async C=>{if(r==="catalog"){const H=Td(C);if(!H)return null;try{const L=await _a(b,H);return m.setQueryData(k,L),G(C),L.operation?.id??null}catch(L){throw L instanceof rn&&L.status===409&&m.invalidateQueries({queryKey:k}),L}}if(r==="session"&&_){const H=await _e({op:"mcp.control",sessionId:_,control:Od(C)});G(C);const L=Ht.list(_),ie=H?.data;return ie&&"servers"in ie&&Array.isArray(ie.servers)?(m.setQueryData(L,ie),null):(m.invalidateQueries({queryKey:L}),ie&&"id"in ie&&typeof ie.id=="string"?ie.id:null)}return null},[r,b,k,m,_,G]),Te=l.useCallback(async C=>{if(r==="catalog"&&N&&(C.action==="connect"||C.action==="disconnect"||C.action==="reload")){try{await _e({op:"mcp.control",sessionId:N,control:{action:C.action,name:C.name,...C.action==="disconnect"?{confirmed:!0}:{}}})}catch(H){throw m.invalidateQueries({queryKey:k}),H}return G(C),await m.invalidateQueries({queryKey:k}),null}return X(C)},[r,N,m,k,X,G]),Se=l.useCallback(async(C,H,L,ie)=>{if(r==="catalog"){const re=await pa(b,C,H,L,ie);if(re.catalog&&m.setQueryData(k,re.catalog),re.code!=="saved")return{saved:!1,message:Gn(re.code,re.failed_ids,H)};try{await X({action:"test",name:C})}catch{}return{saved:!0,message:null}}if(r==="session"&&_){const re=await _e({op:"mcp.credentials.store",sessionId:_,name:C,values:H,confirmedReplace:L});if(re.data?.code!=="saved")return{saved:!1,message:Gn(re.data?.code,re.data?.failed_ids??[],H)};try{await X({action:"connect",name:C})}catch{}return{saved:!0,message:null}}return{saved:!1,message:null}},[r,b,k,m,X,_]),ke=r==="catalog"?U:B,pe=l.useCallback(()=>{ke.refetch()},[ke]);return{enabled:r!==null,route:r,sessionId:r==="catalog"?N:_,borrowed:h,noConversation:r==="session"&&!_&&!x,document:M,isLoading:s.isLoading||r==="catalog"&&(z||U.isLoading)||r==="session"&&(_?B.isLoading:x),isError:ke.isError,folderUnavailable:Uc(o,S),refetch:pe,readDocument:A,control:Te,storeKeys:Se,memories:Z,markNeedsKey:ee}}function Fd(e){if(e.route==="catalog")return e.queryClient.getQueryData(e.catalogKey);if(e.route==="session"&&e.sessionId){const s=e.queryClient.getQueryData(Ht.list(e.sessionId));return s?Jt(s,e.sessionId):void 0}}const Dd=(e,s)=>{const a=e?.trim();if(!a)return null;const i=ya(a,s);return i.kind==="auth"?{kind:"matched",name:i.name,unresolved:null}:{kind:"miss",asked:a}},zd=6,zt="ui.settings.integrations.mcp_management_section.copy_section_title",$d="ui.settings.integrations.mcp_management_section.copy_section_description",Pd={test:"test",connect:"reconnect",disconnect:"disconnect",reload:"reload",remove:"remove",sign_out:"disconnect",cancel:"cancel",login:"grant",reauth:"grant"},Kd=({sessionId:e,sectionRef:s,highlightServer:a})=>{se();const i=Ld({sessionId:e}),{document:r,control:o,readDocument:u}=i,m=cs(),c=r?.servers??[],d=r?.operations??[],x=r?.project_scope_available??!1,[p,h]=l.useState(!1),[_,y]=l.useState(""),[v,w]=l.useState(null),[z,S]=l.useState({}),[I,b]=l.useState(null),[N,k]=l.useState(null),[$,W]=l.useState({kind:"ready"}),[Y,P]=l.useState(null),[Q,K]=l.useState(null),[U,V]=l.useState(!1),B=l.useRef({}),M=l.useRef({}),A=l.useRef({}),g=l.useRef(0),T=l.useRef(null),E=l.useRef(null),Z=l.useRef(null),[J,ee]=l.useState(null),[G,X]=l.useState(null),[Te,Se]=l.useState(null),ke=l.useCallback(()=>{const f=Z.current;Z.current=null,k(null),P(null),window.setTimeout(()=>{f?.isConnected&&f.focus()},0)},[]),pe=l.useCallback(f=>{const j=window.document.activeElement;Z.current=j instanceof HTMLElement?j:null,k(f)},[]),C=l.useCallback((f,j)=>{X({name:f,waitForSignIn:j==="signed-in",until:Date.now()+nt,reanchors:0}),ke()},[ke]),H=l.useMemo(()=>Dd(a,c.map(f=>f.name)),[a,c]),L=H?.kind==="matched"?H.name:null,ie=l.useRef(null),re=l.useRef(null),Be=_.trim().toLowerCase(),he=l.useMemo(()=>Be?c.filter(f=>f.name.toLowerCase().includes(Be)):c,[c,Be]),Me=Pc(he,d,i.memories),Oe=N?.kind==="sign_in"?c.find(f=>f.name===N.name)??null:null;l.useEffect(()=>{!L||re.current===L||!_||y("")},[L,_]),l.useEffect(()=>{!L||re.current===L||he.some(f=>f.name===L)&&(re.current=L,ie.current?.scrollIntoView({block:"center",behavior:"smooth"}))},[L,he]),l.useEffect(()=>{if(!Y)return;const f=d.find(j=>j.id===Y)??null;W({kind:"running",operation:f})},[d,Y]);const Ve=d.some(f=>f.status==="running"),q=f=>{const j=window.document.activeElement;j&&j!==window.document.body&&j.isConnected||X({name:f,waitForSignIn:!1,until:Date.now()+nt,reanchors:0})},ne=async(f,j,D)=>{w(f),S(({[f]:$e,...Ee})=>Ee);let te=null,be=!1;try{te=await D()}catch($e){be=!0,S(Ee=>({...Ee,[f]:_t(Pd[j]??"status",$e,Ve)}))}finally{w(null),j!=="sign_out"&&(j!=="remove"||be)&&q(f)}return{operationId:te,failed:be}},ge=f=>c.find(j=>j.name===f),de=f=>{f.source.path&&va(f.source.path)},F=async(f,j)=>{W({kind:"starting"}),P(null);try{const D=await o({action:j,name:f});D?P(D):W({kind:"running",operation:null})}catch(D){D instanceof rn&&D.code==="oauth_unsupported"&&i.markNeedsKey(f),W({kind:"refused",message:_t("grant",D,Ve)})}},oe=(f,j)=>{switch(j.kind){case"sign_in":case"reauth":{const D=d.find(te=>te.name===f.name&&te.status==="running");D&&ct(D)?(W({kind:"running",operation:D}),P(D.id)):(W({kind:"ready"}),P(null)),pe({kind:"sign_in",name:f.name,action:j.kind==="reauth"?"reauth":"login"});return}case"set_key":K(null),pe({kind:"key",name:f.name,keyNames:f.auth.secret_refs.map(D=>D.id)});return;case"fix":de(f);return;case"sign_out":b({name:f.name,kind:"sign_out"});return;default:{const D=j.kind;ne(f.name,D,()=>o({action:D,name:f.name}))}}},le=(f,j)=>{switch(j.kind){case"remove":case"sign_out":b({name:f.name,kind:j.kind});return;case"sign_in":case"reauth":case"set_key":oe(f,{kind:j.kind,label:j.label});return;case"open_config":de(f);return;case"copy_setup":navigator.clipboard.writeText(f.setup_prompt??"").then(()=>Vt(n("ui.settings.integrations.mcp_management_section.setup_steps_copied_paste_them_into_a_chat"))).catch(()=>{});return;case"cancel":{const D=d.find(te=>te.name===f.name&&te.status==="running");D&&ne(f.name,"cancel",()=>o({action:"cancel",operationId:D.id}));return}case"test":case"connect":case"disconnect":case"reload":{const D=j.kind;ne(f.name,D,()=>o({action:D,name:f.name}));return}default:return}},ve=(f,j)=>{if(b(null),j==="remove"){const D=f.source.owned_scope;if(!D)return;const te=he.findIndex(be=>be.name===f.name);ne(f.name,"remove",()=>o({action:"remove",name:f.name,scope:D})).then(({operationId:be,failed:$e})=>{$e||be!==null||(Vt(n("ui.settings.integrations.mcp_management_section.removed_name",{name:String(f.name)})),te>=0&&Se({index:te}))});return}ne(f.name,"sign_out",()=>o({action:"logout",name:f.name})).then(()=>{X({name:f.name,waitForSignIn:!1,until:Date.now()+nt,reanchors:0})})},Le=async f=>{try{return await o({action:"add",name:f.name,scope:f.scope,...f.mode==="command"?{command:f.command,args:f.args}:{url:f.url}}),h(!1),ee(f.name),null}catch(j){return _t("add",j,!1)}},fe=t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("h2",{className:"text-heading text-ink",children:n(zt)}),t.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:n($d)})]}),i.enabled&&c.length>0&&!p?t.jsxs(O,{ref:T,variant:"secondary",size:"sm",onClick:()=>h(!0),"data-tour-tag":"mcp-add-server",children:[t.jsx(jn,{"aria-hidden":"true"}),n("ui.settings.integrations.mcp_management_section.add_integration")]}):null]});if(!i.enabled&&!i.isLoading)return t.jsx(ce,{title:n(zt),titleComponent:fe,sectionRef:s,children:t.jsx(ae,{variant:"warning",children:n("ui.settings.integrations.mcp_management_section.integrations_need_a_newer_local_operator_backend_update_it_and_re")})});const ze=t.jsx(ad,{existingNames:c.map(f=>f.name),projectScopeAvailable:x,projectLabel:r?.cwd?Bd(r.cwd):null,onSubmit:Le,onCancel:()=>{h(!1),window.setTimeout(()=>T.current?.focus(),0)}}),je=N?ge(N.name):void 0,He=Object.entries(z).filter(([f])=>!c.some(j=>j.name===f)),Ce=f=>S(({[f]:j,...D})=>D);l.useEffect(()=>{if(!J)return;const f=B.current[J];if(!f){c.some(j=>j.name===J)&&(M.current[J]?.focus(),ee(null));return}f.focus(),ee(null)},[J,c]),l.useEffect(()=>{if(!Te)return;const j=he[Math.min(Te.index,he.length-1)]??he.at(-1);if(j){const D=B.current[j.name]??M.current[j.name];if(!D)return;D.focus()}else T.current?.focus();Se(null)},[Te,he]);const we=l.useCallback((f,j)=>{const D=u()??r,te=D?.servers.find(Vs=>Vs.name===f.name),be=D?.operations??[],$e=te?te.status==="connecting"||Xe(te.name,be)!==null:!1;$e&&te&&(g.current=j);const Ee=te?pn(te,be,i.memories):null;if(te&&f.waitForSignIn&&(Ee?.kind==="sign_in"||Ee?.kind==="reauth"))return"kept";const Fe=ld({hold:f,now:j,windowMs:nt,rowMoving:$e,lastMovingAt:g.current,candidate:te?dd({primary:Ee?B.current[te.name]:null,overflow:M.current[te.name]}):void 0,active:window.document.activeElement,body:window.document.body});if(!Fe.hold)return X(null),"finished";if(!Fe.land)return"kept";X({name:f.name,waitForSignIn:!1,until:Fe.hold.until,landedOn:Fe.land,reanchors:Fe.hold.reanchors});const xn=Fe.land;return window.setTimeout(()=>{xn.isConnected&&xn.focus()},0),"landed"},[u,r,i.memories]);return l.useEffect(()=>{if(!G)return;we(G,Date.now());let f=0,j=!1;const D=()=>{if(j)return;const te=ud({verdict:we(G,Date.now()),watchMs:Bn});te!==null&&(f=window.setTimeout(D,te))};return f=window.setTimeout(D,Bn),()=>{j=!0,window.clearTimeout(f)}},[G,we]),l.useEffect(()=>{if(!G)return;const f=j=>{cd({target:j.target,row:A.current[G.name]})&&X(null)};return window.document.addEventListener("pointerdown",f,!0),()=>{window.document.removeEventListener("pointerdown",f,!0)}},[G]),t.jsxs(ce,{title:n(zt),titleComponent:fe,sectionRef:s,children:[t.jsxs("div",{className:"flex flex-col gap-4",children:[i.route==="session"&&i.borrowed?t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.integrations.mcp_management_section.borrowed_chat_notice",{chat:i.borrowed.title?.trim()||i.borrowed.session_id.slice(0,6)})}):null,i.noConversation?t.jsxs("div",{className:"flex flex-col items-start gap-2",children:[t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.integrations.mcp_management_section.integrations_can_be_managed_here_once_a_chat_has_started")}),t.jsx(O,{variant:"primary",size:"sm",onClick:()=>m("/chat"),children:n("ui.settings.integrations.mcp_management_section.start_a_chat")}),t.jsx("p",{className:"text-ink-dim text-meta",children:n("ui.settings.integrations.mcp_management_section.updating_local_operator_removes_this_step")})]}):null,i.isLoading?t.jsx("div",{className:"flex h-24 items-center justify-center",children:t.jsx(ye,{size:"lg",label:n("ui.settings.integrations.mcp_management_section.loading_integrations")})}):null,i.folderUnavailable?t.jsx(ae,{variant:"warning",children:t.jsx("span",{children:n("ui.settings.integrations.mcp_management_section.this_chat_s_folder_no_longer_exists_so_only_global_integrations_a")})}):null,i.isError?t.jsx(ae,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:n("ui.settings.integrations.mcp_management_section.integrations_couldn_t_be_loaded")}),t.jsx(O,{variant:"secondary",size:"sm",onClick:i.refetch,children:n("ui.settings.integrations.mcp_management_section.retry")})]})}):null,He.map(([f,j])=>t.jsx(ae,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:j}),t.jsx(O,{variant:"ghost",size:"sm",onClick:()=>Ce(f),children:n("ui.settings.integrations.mcp_management_section.dismiss")})]})},f)),p&&c.length>0?ze:null,c.length>=zd?t.jsxs("div",{className:"relative",children:[t.jsx(ts,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 start-3 size-4 -translate-y-1/2 text-ink-dim"}),t.jsx(De,{ref:E,value:_,onChange:f=>y(f.target.value),onKeyDown:f=>{f.key!=="Escape"||!_||(f.preventDefault(),y(""))},placeholder:n("ui.settings.integrations.mcp_management_section.search_integrations_placeholder",{integrations:kc(c.length)}),"aria-label":n("ui.settings.integrations.mcp_management_section.search_integrations"),className:"ps-9"})]}):null,H?.kind==="miss"&&c.length>0?t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.integrations.mcp_management_section.no_match_for_name",{asked:String(H.asked)})}):null,H?.kind==="matched"&&H.unresolved?t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.integrations.mcp_management_section.showing_fallback_for_unknown",{shown:String(H.name),asked:String(H.unresolved)})}):null,r&&c.length===0&&!i.isLoading?p?ze:t.jsxs("div",{className:"flex flex-col items-start gap-3 rounded-lg bg-surface p-6",children:[t.jsx(as,{"aria-hidden":"true",className:"size-5 text-ink-muted"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-heading text-ink",children:n("ui.settings.integrations.mcp_management_section.no_integrations_yet")}),t.jsx("p",{className:"max-w-xl text-body-sm text-ink-muted",children:n("ui.settings.integrations.mcp_management_section.integrations_let_agents_read_and_act_in_your_other_tools_like_not")})]}),t.jsxs(O,{variant:"primary",size:"md",onClick:()=>h(!0),"data-tour-tag":"mcp-add-server",children:[t.jsx(jn,{"aria-hidden":"true"}),n("ui.settings.integrations.mcp_management_section.add_integration")]})]}):null,c.length>0&&he.length===0?t.jsxs("div",{className:"flex flex-col items-start gap-2",children:[t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.integrations.mcp_management_section.no_integrations_match_this_search")}),t.jsx(O,{variant:"secondary",size:"sm",onClick:()=>{y(""),window.setTimeout(()=>{(E.current??T.current)?.focus()},0)},children:n("ui.settings.integrations.mcp_management_section.clear_search")})]}):null,Me.map(f=>t.jsxs("section",{"aria-labelledby":`integrations-group-${f.id}`,className:"flex flex-col gap-1.5",children:[t.jsxs("h3",{id:`integrations-group-${f.id}`,className:"px-1 text-ink-dim text-meta",children:[f.title," · ",f.rows.length]}),t.jsx("ul",{className:"flex flex-col divide-y divide-hairline overflow-hidden rounded-lg bg-surface",children:f.rows.map(j=>t.jsx(hd,{row:j,operations:d,memories:i.memories,projectScopeAvailable:x,highlighted:j.name===L,rowRef:D=>{A.current[j.name]=D,j.name===L&&(ie.current=D)},primaryRef:D=>{B.current[j.name]=D},overflowRef:D=>{M.current[j.name]=D},pending:v===j.name,failure:z[j.name]??null,confirm:I?.name===j.name?{kind:I.kind}:null,onPrimary:D=>oe(j,D),onOverflow:D=>le(j,D),onConfirm:()=>I&&ve(j,I.kind),onCancelConfirm:()=>{b(null),window.setTimeout(()=>{M.current[j.name]?.focus()},0)}},j.id))})]},f.id))]}),N?.kind==="sign_in"?t.jsx(kd,{name:N.name,action:N.action,keyRoute:Oe?Mt(Oe):!1,phase:$,onStart:()=>void F(N.name,N.action),onCancel:f=>void o({action:"cancel",operationId:f}).catch(()=>{}),onOpenLink:f=>void xa(f),onClose:f=>C(N.name,f)}):null,N?.kind==="key"?t.jsx(_d,{name:N.name,keyNames:N.keyNames.length?N.keyNames:je?.auth.secret_refs.map(f=>f.id)??[],keyless:N.keyNames.length===0,savedKeys:je?.auth.secret_refs.filter(f=>f.state==="encrypted").map(f=>f.id),saving:U,failure:Q,onClose:ke,onSave:(f,j,D)=>{V(!0),K(null),i.storeKeys(N.name,f,j,D).then(te=>{if(!te.saved){K(te.message);return}k(null),X({name:N.name,waitForSignIn:!1,until:Date.now()+nt,reanchors:0})}).catch(te=>K(_t("key",te,!1))).finally(()=>V(!1))}}):null]})},nt=4e3,Ud=/^\/(?:Users|home)\/[^/]+(?=\/|$)/,Bd=e=>e.replace(Ud,"~"),Vd=({verification:e})=>{se();const{prices:s}=ka(),a=e.grant_amount??s?.default_new_credits,{sentence:i,action:r}=ja(e.signup_grant,wa(a)),o=Na(e.claim_url,Sa);return t.jsxs("div",{className:"mt-8 flex items-start gap-3 rounded-sm border border-hairline bg-surface p-3",children:[t.jsx(St,{className:"mt-0.5 size-4 shrink-0 text-ink-muted","aria-hidden":"true"}),t.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-2",children:[t.jsx("p",{className:"text-body-sm text-ink",children:i}),t.jsx(O,{variant:"secondary",size:"sm",onClick:()=>Ma(o),children:r})]})]})},Hd=({onAfterCredentialUpdate:e})=>{se();const{isAuthenticated:s,user:a,isLoading:i,accountRead:r,signOut:o}=ba(),u=is(p=>p.isSigningOut),m=l.useCallback(async()=>{try{await o()}catch(p){console.error("Error signing out:",p)}},[o]),c=(()=>{if(!s||!a?.radientUser)return null;const{account:p,identity:h,verification:_}=a.radientUser,y=_!=null&&!_.email_verified&&_.signup_grant!=="claimed";return t.jsxs(t.Fragment,{children:[t.jsxs(ot,{children:[t.jsx(me,{label:n("ui.settings.account.radient_account_section.status"),value:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[n("ui.settings.account.radient_account_section.connected"),t.jsx(it,{variant:"success",className:"capitalize",children:p.status})]})}),t.jsx(me,{label:n("ui.settings.account.radient_account_section.name"),value:p.name||n("ui.settings.account.radient_account_section.not_provided")}),t.jsx(me,{label:n("ui.settings.account.radient_account_section.email"),value:p.email}),t.jsx(me,{label:n("ui.settings.account.radient_account_section.account_id"),value:t.jsx("span",{className:"text-mono-sm",children:p.id})}),t.jsx(me,{label:n("ui.settings.account.radient_account_section.tenant_id"),value:t.jsx("span",{className:"text-mono-sm",children:p.tenant_id})}),t.jsx(me,{label:n("ui.settings.account.radient_account_section.provider"),value:t.jsx("span",{className:"capitalize",children:h.provider})}),t.jsx(me,{label:n("ui.settings.account.radient_account_section.created"),value:rs(p.created_at)})]}),y&&_?t.jsx(Vd,{verification:_}):null,t.jsx("div",{className:"mt-8",children:t.jsx(yi,{offerSignIn:!0})}),t.jsxs("div",{className:"mt-8",children:[t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.account.radient_account_section.need_to_sign_out_or_switch_accounts")}),t.jsxs(O,{variant:"danger",className:"mt-3",onClick:m,children:[t.jsx(vi,{}),n("ui.settings.account.radient_account_section.sign_out_from_radient")]})]})]})})(),d=r==="refused"?n("ui.settings.account.radient_account_section.radient_refused_the_sign_in_this_app_is_holding_so_your_account_d"):os(r)?n("ui.settings.account.radient_account_section.your_radient_account_could_not_be_read_so_this_app_cannot_show_yo"):n("ui.settings.account.radient_account_section.you_are_not_currently_signed_in_to_radient"),x=s&&a?null:t.jsxs("div",{children:[t.jsxs("p",{className:"text-body-sm text-ink-muted",children:[d," ",n("ui.settings.account.radient_account_section.sign_in_to_access_your_account_details_or_sign_up_to_get_free_cre")]}),t.jsx("div",{className:"mt-6",children:t.jsx(Wi,{titleText:"",onAfterCredentialUpdate:e,descriptionText:"",onSignInSuccess:()=>{}})})]});return i||u?t.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center gap-3",children:[t.jsx(ye,{size:"lg",label:n("ui.settings.account.radient_account_section.loading_account")}),!u&&t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.settings.account.radient_account_section.loading_your_radient_account_details")})]}):s&&a?.radientUser?c:t.jsx("div",{className:"flex flex-col gap-4",children:x})};function qd({metric:e,data:s}){return se(),t.jsx(Ca,{title:"",heightClassName:"h-62",yAxisWidth:48,unit:e==="credits"?"credits":"tokens",srSummary:e==="credits"?n("ui.settings.account.settings_usage_chart.credits_summary",{days:s.length}):n("ui.settings.account.settings_usage_chart.tokens_summary",{days:s.length}),xTickFormatter:a=>a,yTickFormatter:a=>e==="credits"?`$${a.toFixed(2)}`:Ea(a),children:t.jsx(ml,{data:s,children:t.jsx(Xn,{type:"monotone",dataKey:"value",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:0},name:e==="credits"?n("ui.settings.account.settings_usage_chart.credits_consumed"):n("ui.settings.account.settings_usage_chart.tokens_used")})})})}const Gd={all:["desktop","tts-path-resolution"]};function Yd(e){return Re({queryKey:Gd.all,queryFn:()=>_e({op:"tts.paths"}),enabled:e,staleTime:Number.POSITIVE_INFINITY,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:oi})}const Qd=["speech.voice.gender","speech.voice.tone","speech.voice.expressiveness","speech.voice.pace","speech.voice.language","speech.voice.accent","speech.voice.instructions"];function Yn(e){const s=new Map(e.map(r=>[r.key,r])),a=[],i=[];for(const r of Qd){const o=s.get(r);o?a.push(o):i.push(r)}return{rows:a,missing:i}}const Wd=["provider_tts_radient","provider_tts_elevenlabs","provider_tts_openai","none"];function Qn(e){return typeof e=="string"&&Wd.includes(e)}function Zd(e){if(e===null||typeof e!="object")return null;const s=e;if(!Qn(s.path)||typeof s.reason!="string"||typeof s.servable!="boolean"||!Array.isArray(s.rungs))return null;const a=[];for(const i of s.rungs){if(i===null||typeof i!="object")return null;const r=i;if(!Qn(r.path)||typeof r.available!="boolean"||typeof r.reason!="string")return null;a.push({path:r.path,available:r.available,reason:r.reason})}return{path:s.path,reason:s.reason,servable:s.servable,rungs:a}}const Jd={get provider_tts_radient(){return n("ui.settings.speech.speech_settings_model.radient_pass")},provider_tts_elevenlabs:"ElevenLabs",provider_tts_openai:"OpenAI",get none(){return n("ui.settings.speech.speech_settings_model.no_provider")}};function Us(e){return Jd[e]}function Xd(e){return{servable:e.servable,serving:e.path==="none"?null:e.path,reason:e.reason,rungs:e.rungs.map(s=>({path:s.path,name:Us(s.path),available:s.available,reason:s.reason}))}}const eu="ui.settings.speech.speech_section.copy_backend_older_sentence",Bs="ui.settings.speech.speech_section.copy_unavailable_sentence",tu=({resetErrorBoundary:e})=>(se(),t.jsx(ae,{variant:"warning",children:t.jsxs("div",{className:"flex flex-col items-start gap-3",children:[t.jsx("span",{children:n(Bs)}),t.jsxs(O,{variant:"secondary",onClick:e,children:[t.jsx(Vi,{"aria-hidden":"true"}),n("ui.settings.speech.speech_section.try_again")]})]})}));function nu(e){return e==="enabled"?"ready":e==="below-version"?"older":"pairing"}const su=({sectionRef:e})=>{se();const s=an(),a=ls(),i=li(s.data,"tts"),r=nu(i),o=Re({queryKey:Kt.all,queryFn:()=>_e({op:"settings.list"}),enabled:r==="ready",staleTime:1e4}),u=Yd(r==="ready"),{hasRadientApiKey:m,hasRadientSession:c,speechBlock:d}=Aa(),x=`${c}:${m}`,p=l.useRef(x),h=u.refetch;l.useEffect(()=>{p.current!==x&&(p.current=x,h())},[x,h]);const _=o.data,y=l.useMemo(()=>Yn(_?.settings??[]),[_]),[v,w]=l.useState({}),[z,S]=l.useState({}),[I,b]=l.useState({});l.useEffect(()=>{_&&w(g=>{let T=!1;const E={...g};for(const Z of Yn(_.settings).rows){const J=g[Z.key];if(J&&J.value!==et(Z).value)continue;const ee=et(Z);J&&J.value===ee.value&&J.cascadeBase===ee.cascadeBase||(E[Z.key]=ee,T=!0)}return T?E:g})},[_]);const N=(g,T)=>S(E=>({...E,[g]:T})),k=(g,T)=>b(E=>({...E,[g]:T})),$=async g=>{const T=v[g.key];if(!T)return;const E=Ta(g,T);if(!E.ok){k(g.key,E.error);return}N(g.key,!0),k(g.key,null);try{await _e(E.request),N(g.key,!1);const J=(await o.refetch()).data?.settings.find(ee=>ee.key===g.key);J&&w(ee=>{const G=ee[g.key];return G&&G.value===T.value&&G.cascadeBase===T.cascadeBase?{...ee,[g.key]:et(J)}:ee})}catch(Z){N(g.key,!1),k(g.key,Z instanceof Error?Z.message:n("ui.settings.speech.speech_section.the_setting_could_not_be_saved"))}},W=async g=>{N(g.key,!0),k(g.key,null);try{await _e({op:"settings.reset",key:g.key}),w(T=>({...T,[g.key]:et({...g,value:g.default,is_default:!0})})),N(g.key,!1),await o.refetch()}catch(T){N(g.key,!1),k(g.key,T instanceof Error?T.message:n("ui.settings.speech.speech_section.the_setting_could_not_be_reset"))}},Y=l.useMemo(()=>Zd(u.data),[u.data]),P=Y?Xd(Y):null,Q=u.isSuccess&&Y===null,K=(s.data?null:s.error)??null,U=o.error,V=n("ui.settings.speech.speech_section.speech_voicing"),B=n("ui.settings.speech.speech_section.how_the_assistant_sounds_when_it_speaks_aloud");if(r==="pairing"){const{sentence:g}=qt(a??null,n("ui.settings.speech.speech_section.speech_settings_could_not_be_loaded"),K);return t.jsx(ce,{title:V,icon:dt,description:B,sectionRef:e,children:t.jsx(ae,{variant:"warning",children:g})})}if(r==="older")return t.jsx(ce,{title:V,icon:dt,description:B,sectionRef:e,children:t.jsx(ae,{variant:"warning",children:n(eu)})});if(U||!_){const{sentence:g,remedy:T}=qt(a??null,n("ui.settings.speech.speech_section.speech_settings_could_not_be_loaded"),U);return t.jsx(ce,{title:V,icon:dt,description:B,sectionRef:e,children:t.jsx(ae,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:g}),T&&t.jsx(O,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{o.refetch()},children:n("ui.settings.speech.speech_section.retry")})]})})})}const M=P?!P.servable:d==="offline",A=P?P.rungs.find(g=>g.path===P.serving)??null:null;return t.jsx(ce,{title:V,icon:dt,description:B,sectionRef:e,children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("section",{className:"flex flex-col gap-3",children:[u.isPending&&t.jsxs("p",{className:"flex items-center gap-2 text-body-sm text-ink-muted",children:[t.jsx(ye,{}),bn("checking")]}),(u.isError||Q)&&!P&&d!=="offline"&&t.jsx(ae,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("span",{children:[n(Bs)," ",u.error instanceof Error?u.error.message:""]}),t.jsx(O,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{u.refetch()},children:n("ui.settings.speech.speech_section.retry")})]})}),t.jsx(Bi,{fallbackRender:tu,resetKeys:[u.dataUpdatedAt],children:P&&t.jsxs(t.Fragment,{children:[t.jsxs(ot,{children:[t.jsx(me,{label:n("ui.settings.speech.speech_section.speaks_through"),value:P.serving?Us(P.serving):n("ui.settings.speech.speech_section.nothing_yet")}),t.jsx(me,{label:n("ui.settings.speech.speech_section.availability"),value:P.servable?n("ui.settings.speech.speech_section.ready"):n("ui.settings.speech.speech_section.no_provider")})]}),P.reason&&P.reason!==A?.reason&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:P.reason}),t.jsx("ul",{className:"flex flex-col gap-1",children:P.rungs.map(g=>t.jsxs("li",{className:"flex flex-col gap-0.5 text-body-sm",children:[t.jsxs("span",{className:g.path===P.serving?"text-ink":"text-ink-muted",children:[g.name,t.jsxs("span",{className:g.path===P.serving?"text-ink-muted":"text-ink-dim",children:[" ",g.available?n("ui.settings.speech.speech_section.available"):n("ui.settings.speech.speech_section.not_available")]})]}),t.jsx("span",{className:"text-meta text-ink-dim",children:g.reason})]},g.path))})]})})]}),M&&t.jsx(ae,{variant:"warning",children:bn(d)}),t.jsx("div",{className:"flex flex-col gap-1",children:y.rows.map(g=>t.jsx(Ia,{setting:g,draft:v[g.key]??et(g),tier:Ra(g),saving:!!z[g.key],error:I[g.key]??null,onDraftChange:T=>w(E=>({...E,[g.key]:T})),onSave:()=>{$(g)},onReset:()=>{W(g)}},g.key))}),y.missing.length>0&&t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.settings.speech.speech_section.missing_voice_rows",{count:y.missing.length,rows:y.missing.join(", ")})})]})})},au=()=>{se();const{data:e,isLoading:s,error:a,refetch:i}=dl(),r=ul(),[o,u]=l.useState(""),[m,c]=l.useState(!1);l.useEffect(()=>{u(e?.content??""),c(!1)},[e]);const d=y=>{const v=y.target.value;u(v),c(v!==(e?.content??""))},x=async()=>{if(!(!m||r.isPending))try{const y={content:o};await r.mutateAsync(y),await i(),c(!1)}catch(y){console.error("Error updating system prompt:",y)}},p=()=>{u(e?.content??""),c(!1)},h=r.isPending,_=()=>t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Ie,{htmlFor:"app-system-prompt",children:n("ui.settings.model.system_prompt.instructions")}),t.jsx(fs,{id:"app-system-prompt",name:"systemPrompt",value:o,onChange:d,placeholder:n("ui.settings.model.system_prompt.enter_instructions_for_how_all_agents_should_behave_and_respond_t"),className:"min-h-50"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(O,{variant:"primary",onClick:x,disabled:!m||h,children:[h?t.jsx(ye,{size:"sm"}):t.jsx(ms,{}),h?n("ui.settings.model.system_prompt.saving"):n("ui.settings.model.system_prompt.save_changes")]}),t.jsx(O,{onClick:p,disabled:!m||h,children:n("ui.settings.model.system_prompt.cancel")})]}),e?.last_modified&&t.jsxs("p",{className:"text-ink-dim text-meta",children:[n("ui.settings.model.system_prompt.last_modified")," ",t.jsx("span",{className:"font-mono text-mono-sm",children:nn(e.last_modified)})]})]});return t.jsx(ce,{title:n("ui.settings.model.system_prompt.system_prompt"),icon:Zi,description:n("ui.settings.model.system_prompt.every_local_operator_agent_receives_this_prompt_in_addition_to_it"),children:s?t.jsx("div",{className:"flex min-h-50 items-center justify-center",children:t.jsx(ye,{size:"lg",label:n("ui.settings.model.system_prompt.loading_system_prompt")})}):a?t.jsx(ae,{variant:"danger",children:n("ui.settings.model.system_prompt.load_failed",{reason:a instanceof Error?a.message:n("ui.settings.model.system_prompt.unknown_error")})}):_()})},iu=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],ru=e=>iu.includes(e),ou=e=>{const s=[];let a=0;for(const i of e){const r=Math.max(0,Math.floor(i.count)),o=Math.max(1,Math.floor(i.columns));for(let u=0;u<r;u+=o)s.push({start:a+u,count:Math.min(o,r-u)});a+=r}return s},lu=({index:e,key:s,groups:a})=>{const i=ou(a),r=i.reduce((o,u)=>o+u.count,0);if(!Number.isInteger(e)||e<0||e>=r)return e;switch(s){case"Home":return 0;case"End":return r-1;case"ArrowLeft":return Math.max(0,e-1);case"ArrowRight":return Math.min(r-1,e+1);case"ArrowUp":case"ArrowDown":{const o=i.findIndex(c=>e>=c.start&&e<c.start+c.count),u=i[o+(s==="ArrowDown"?1:-1)];if(!u)return e;const m=e-i[o].start;return u.start+Math.min(m,u.count-1)}default:return e}},cu={localOperatorDark:vo,localOperatorLight:Po,dracula:Ro,dune:Gr,sage:go,monokai:ki,tokyoNight:wo,iceberg:Oo,radient:io,neon:La,obsidian:hs,synth:lr,catppuccinMocha:Rr,catppuccinLatte:fo,tokyoNightStorm:wr,gruvbox:fr,nord:ll,oneDark:rr,solarizedDark:zo,rosePine:Zr,rosePineMoon:xo,rosePineDawn:Ar,alucard:Xr,gruvboxLight:$r,tokyoNightDay:ko,oneLight:_o,catppuccinFrappe:Dr,catppuccinMacchiato:oo,palenight:Oa,everforest:el,everforestLight:Jo,kanagawaWave:al,kanagawaLotus:Qr,ayuDark:Kr,ayuMirage:Br,ayuLight:Co,nightfox:Sr,duskfox:Vo,synthwave:So,matrix:dr,tron:kr,cyberpunk:bi,vaporwave:Wo,outrun:_r,neonNoir:nl,arcade:co,forest:Yo,ocean:Hr,desert:qo,autumn:rl,lavender:Fo,arctic:Cr,rosewood:so,solarizedLight:Uo,githubLight:to,paper:Ji,linen:Ao,highContrastLight:ar,mintLight:gr},Wn="bg-[color-mix(in_srgb,var(--color-accent)_8%,var(--color-accent-wash))]",du=({id:e})=>t.jsxs("div",{"data-theme":e,"aria-hidden":"true",className:"flex h-full bg-canvas",children:[t.jsxs("div",{className:"flex w-1/4 flex-col gap-1 bg-sunken p-1",children:[t.jsx("span",{className:"flex h-2.5 items-center rounded-xs bg-accent-wash px-1",children:t.jsx("span",{className:"h-1 w-full rounded-xs bg-accent"})}),t.jsx("span",{className:"mx-1 h-1 w-2/3 rounded-xs bg-ink-dim"}),t.jsx("span",{className:"mx-1 h-1 w-1/2 rounded-xs bg-ink-dim"})]}),t.jsxs("div",{className:"flex flex-1 flex-col justify-between p-1",children:[t.jsxs("div",{className:"flex flex-col gap-1 rounded-xs bg-surface p-1",children:[t.jsx("span",{className:"h-1 w-3/5 rounded-xs bg-ink"}),t.jsx("span",{className:"h-1 w-full rounded-xs bg-ink-dim"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"h-2.5 w-6 rounded-xs bg-elevated"}),t.jsx("span",{className:"h-2.5 w-5 rounded-xs bg-accent"}),t.jsx("span",{className:"h-2.5 w-4 rounded-xs bg-accent-alt"}),t.jsx("span",{className:"h-2.5 w-4 rounded-xs border border-control"})]})]})]}),uu=({id:e,name:s,description:a,isSelected:i,isTabStop:r,onSelect:o,onFocusTile:u})=>{const m=cu[e];return t.jsx(Je,{side:"bottom",align:"start",content:a,children:t.jsxs("button",{type:"button","data-theme-tile":e,"aria-pressed":i,tabIndex:r?0:-1,onFocus:u,onClick:o,className:ue("relative flex flex-col gap-1.5 rounded-md p-1 text-start transition-colors duration-fast ease-out-quart",i?Wn:"hover:bg-surface"),children:[t.jsxs("span",{className:ue("relative block h-10 overflow-hidden rounded-sm border transition-colors duration-fast ease-out-quart",i?"border-accent":"border-hairline"),children:[t.jsx(du,{id:e}),i&&t.jsx("span",{className:ue("pointer-events-none absolute top-0.5 end-0.5 flex h-4 w-4 items-center justify-center rounded-full",Wn),children:t.jsx(ps,{size:12,className:"text-accent","aria-hidden":"true"})})]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(m,{size:12,className:"shrink-0 text-ink-dim","aria-hidden":"true"}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-meta text-ink",children:s})]})]})})},gu=e=>[...e.querySelectorAll("[data-theme-grid]")].map(s=>{const a=[...s.querySelectorAll("[data-theme-tile]")],i=a[0]?.getBoundingClientRect().top??0;return{count:a.length,columns:Math.max(1,a.filter(r=>Math.abs(r.getBoundingClientRect().top-i)<1).length)}}),mu=()=>{se();const{themeName:e,setTheme:s}=Ue(),a=Object.values(Hs),i=[{label:n("ui.settings.appearance.theme_selector.dark"),items:a.filter(c=>c.theme.palette.mode==="dark")},{label:n("ui.settings.appearance.theme_selector.light"),items:a.filter(c=>c.theme.palette.mode==="light")}].filter(c=>c.items.length>0),[r,o]=l.useState(null),u=l.useMemo(()=>{const c=i.flatMap(d=>d.items.map(x=>x.id));return r&&c.includes(r)?r:c.includes(e)?e:c[0]},[i,r,e]),m=c=>{if(!ru(c.key))return;const d=[...c.currentTarget.querySelectorAll("[data-theme-tile]")],x=d.indexOf(c.target);if(x<0)return;c.preventDefault();const p=lu({index:x,key:c.key,groups:gu(c.currentTarget)});p!==x&&d[p]?.focus()};return t.jsx(Hi,{children:t.jsx("div",{onKeyDown:m,className:"flex flex-col gap-6",children:i.map(c=>t.jsxs("div",{children:[t.jsx("h3",{className:"px-1 pb-2 text-meta text-ink-dim",children:c.label}),t.jsx("div",{"data-theme-grid":c.label,className:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-2",children:c.items.map(({id:d,name:x,description:p})=>t.jsx(uu,{id:d,name:x,description:p,isSelected:d===e,isTabStop:d===u,onSelect:()=>s(d),onFocusTile:()=>o(d)},d))})]},c.label))})})},_u=({value:e,onChange:s})=>{se();const a=l.useId();return t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{id:a,className:"flex min-h-6 items-center text-body text-ink",children:n("ui.settings.appearance.transcript_display_mode_setting.transcript_display")}),t.jsx("p",{className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:n("ui.settings.appearance.transcript_display_mode_setting.by_turn_condenses_each_turn_to_its_answer_by_response_keeps_every")})]}),t.jsx("div",{className:"flex h-6 shrink-0 items-center",children:t.jsx(jt,{value:e,onValueChange:i=>s(ds(i)),children:t.jsx(wt,{"aria-labelledby":a,children:ci.map(i=>t.jsx(We,{value:i.value,children:i.value==="by-turn"?n("ui.settings.appearance.transcript_display_mode_setting.by_turn"):n("ui.settings.appearance.transcript_display_mode_setting.by_response")},i.value))})})})]})},pu=()=>{se();const{data:e,isLoading:s,error:a}=pl({enabled:!0});return t.jsxs("div",{children:[t.jsxs("h3",{className:"mb-3 flex items-center gap-2 text-heading text-ink",children:[t.jsx(Lr,{size:16,className:"shrink-0 text-ink-dim"}),n("ui.settings.account.settings_page.radient_pass")]}),s&&t.jsx(xe,{className:"h-6 w-36"}),a&&t.jsx(ae,{variant:"warning",children:n("ui.settings.account.settings_page.credit_balance_load_failed",{reason:a.message})}),e&&!s&&!a&&t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[t.jsxs("p",{className:"flex-1 text-body-sm text-ink-muted",children:[n("ui.settings.account.settings_page.available_credits")," ",t.jsx("span",{className:"font-medium text-ink",children:e.balance.toFixed(2)})]}),t.jsx(O,{variant:"secondary",size:"sm",asChild:!0,children:t.jsxs("a",{href:"https://console.radienthq.com/dashboard/billing",target:"_blank",rel:"noopener noreferrer",children:[t.jsx(vr,{}),n("ui.settings.account.settings_page.add_credits")]})})]})]})},fu=[{id:"credits",get label(){return n("ui.settings.account.settings_page.credits")}},{id:"tokens",get label(){return n("ui.settings.account.settings_page.tokens")}}],hu=()=>{se();const[e,s]=l.useState("credits"),a=l.useMemo(()=>{const m=new Date,c=gl(m);return{start_date:Cn(c),end_date:Cn(m),rollup:"daily"}},[]),{data:i,isLoading:r,error:o}=hl(a,{enabled:!0}),u=l.useMemo(()=>i?.data_points?[...i.data_points].sort((c,d)=>At(c.timestamp).getTime()-At(d.timestamp).getTime()).map(c=>({bucket:Va(tr(At(c.timestamp),"yyyy-MM-dd")),value:e==="credits"?Number.parseFloat(c.total_cost.toFixed(2)):c.total_tokens})):[],[i,e]);return t.jsxs("div",{children:[t.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("h3",{className:"flex items-center gap-2 text-heading text-ink",children:[t.jsx(xr,{size:16,className:"shrink-0 text-ink-dim"}),n("ui.settings.account.settings_page.usage_last_30_days")]}),t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:n("ui.settings.account.settings_page.usage_metric")}),t.jsx("div",{"data-glass-well":"",className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:fu.map(({id:m,label:c})=>t.jsx(O,{variant:"ghost",size:"sm","aria-pressed":e===m,onClick:()=>s(m),className:ue(e===m&&"bg-surface text-ink hover:bg-surface"),children:c},m))})]})]}),r&&t.jsx(xe,{className:"h-62 w-full"}),o&&t.jsx(ae,{variant:"warning",children:n("ui.settings.account.settings_page.usage_load_failed",{reason:o.message})}),!r&&!o&&i&&u.length>0&&t.jsx(qd,{metric:e,data:u}),!r&&!o&&(!i||u.length===0)&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.account.settings_page.no_usage_recorded_in_the_last_30_days")})]})},xu=()=>(se(),t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[t.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[t.jsx(Oi,{size:16,className:"shrink-0 text-ink-dim"}),n("ui.settings.account.settings_page.radient_account")]}),t.jsx(O,{variant:"secondary",size:"sm",className:"self-start sm:self-center",asChild:!0,children:t.jsxs("a",{href:"https://console.radienthq.com",target:"_blank",rel:"noopener noreferrer",children:[n("ui.settings.account.settings_page.go_to_radient_console"),t.jsx(Ha,{})]})})]})),Tu=()=>{se();const e=Fa(),s=Ue(F=>F.showAgentReasoning),a=Ue(F=>F.setShowAgentReasoning),i=Ue(F=>F.transcriptDisplayMode),r=Ue(F=>F.setTranscriptDisplayMode),{data:o,isLoading:u,isFetching:m,error:c,refetch:d}=Da(),{needsProvider:x}=za(),p=ls(),{sentence:h,remedy:_}=qt(p??null,n("ui.settings.navigation.settings_page.your_settings_could_not_be_loaded"),c),y=ji(),[v,w]=l.useState(null),z=is(),{isAuthenticated:S,accountRead:I,isFetching:b,isRefreshing:N,refreshUser:k}=tn(),$=st(F=>F.activeSessionId),W=st(F=>F.sessions),Y=Vl(),{accountId:P,snapshot:Q,model:K}=gs(),U=l.useRef(null);Q.status?U.current={accountId:P,status:Q.status}:Q.checking||(U.current=null);const V=Q.status??(U.current?.accountId===P?U.current.status:null),B=wl(Y),M=l.useMemo(()=>wi.filter(F=>F.id!=="agent-messages"||Y!=="absent"),[Y]),A=l.useCallback(()=>K.check("surface_open",!0),[K]),[g,T]=l.useState("general"),[E,Z]=l.useState(!1),J=l.useRef(null),ee=l.useRef(null),{startTour:G}=Ni(),X=di(),Te=cs(),{data:Se,refetch:ke}=$a(),{refreshModels:pe}=Pa(),C=l.useMemo(()=>Se?.keys?[...Se.keys].sort():[],[Se?.keys]),H=l.useRef({keys:"",hosting:void 0});l.useEffect(()=>{const F=C.join(","),oe=o?.values?.hosting;(H.current.keys!==F||H.current.hosting!==oe)&&(H.current={keys:F,hosting:oe},pe().catch(le=>{console.error("Failed to refresh models after credentials or hosting change:",le)}))},[C,o?.values?.hosting,pe]);const L=l.useRef({general:l.useRef(null),radient:l.useRef(null),integrations:l.useRef(null),appearance:l.useRef(null),speech:l.useRef(null),keyboard:l.useRef(null),providers:l.useRef(null),"agent-messages":l.useRef(null),backend:l.useRef(null),imports:l.useRef(null),updates:l.useRef(null)}).current,ie=l.useMemo(()=>new URLSearchParams(X.search).get("setting"),[X.search]),re=l.useMemo(()=>new URLSearchParams(X.search).get("filter")??"",[X.search]),Be=l.useMemo(()=>new URLSearchParams(X.search).get("mcp")??void 0,[X.search]),he=l.useMemo(()=>new URLSearchParams(X.search).get("provider"),[X.search]),Me=l.useCallback(F=>{T(F),Z(!0);const oe=L[F],le=ee.current;if(oe?.current&&le){const Le=oe.current.getBoundingClientRect().top-le.getBoundingClientRect().top;le.scrollHeight>le.clientHeight?le.scrollTo({top:Math.max(0,le.scrollTop+Le-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,oe.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout(J.current??void 0),J.current=setTimeout(()=>{Z(!1),J.current=null},800)}else Z(!1)},[L]);l.useEffect(()=>{const F=setTimeout(()=>{const oe=ee.current;if(!oe)return;const le=()=>{if(E)return;const ve=oe.getBoundingClientRect(),Le=ve.height;let fe="",ze=0;for(const[je,He]of Object.entries(L))if(He.current){const Ce=He.current.getBoundingClientRect(),we=ve.top,f=Ce.top-we,j=Ce.bottom-we,D=Ce.height,te=Math.max(0,f),be=Math.min(Le,j),Ee=Math.max(0,be-te)/D,Fe=Ee+(f<Le*.3?.1:0);Fe>ze&&Ee>.1&&(ze=Fe,fe=je)}fe&&fe!==g&&T(fe)};return le(),oe.addEventListener("scroll",le,{passive:!0}),()=>{oe.removeEventListener("scroll",le),clearTimeout(J.current??void 0)}},100);return()=>clearTimeout(F)},[L,g,E]),l.useEffect(()=>{const F=new URLSearchParams(X.search),oe=F.get("section"),le=F.get("setting"),ve=le?kn(le,"backend"):oe;if(ve==="agent-messages"&&!B)return;const Le=ve?L[ve]:void 0;if(!ve||!Le)return;let fe=!1,ze=Number.NaN,je=0;const He=window.setTimeout(()=>{fe||(fe=!0,we.disconnect(),Me(ve))},2e3),Ce=()=>{if(fe)return;const f=Le.current;if(!f){je=requestAnimationFrame(Ce);return}const j=Math.round(f.getBoundingClientRect().top+window.scrollY);if(j===ze&&j>0){fe=!0,we.disconnect(),window.clearTimeout(He),Me(ve);return}ze=j,je=requestAnimationFrame(Ce)},we=new ResizeObserver(()=>{fe||(cancelAnimationFrame(je),je=requestAnimationFrame(Ce))});return ee.current&&we.observe(ee.current),je=requestAnimationFrame(Ce),()=>{fe=!0,cancelAnimationFrame(je),we.disconnect(),window.clearTimeout(He)}},[X.search,L,Me,B]);const Oe=async(F,oe)=>{w(F);try{await y.mutateAsync({[F]:oe}),await d()}catch(le){console.error(`Error updating ${F}:`,le)}finally{w(null)}},Ve=u,q=I==="checking",ne=os(I),ge=I==="ready"||I==="checking"||b,de=us(Ve,4e3);return c?t.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:t.jsx(ae,{variant:"warning",className:"w-full max-w-xl",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:h}),_&&t.jsx(O,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void d(),disabled:m,children:m?n("ui.settings.navigation.settings_page.retrying"):n("ui.settings.navigation.settings_page.retry")})]})})}):Ve?t.jsxs("div",{role:"status",className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-canvas",children:[t.jsx(ye,{size:"lg",label:de?void 0:n("ui.settings.navigation.settings_page.loading_settings")}),de&&t.jsx("p",{className:"max-w-sm text-center text-body-sm text-ink-muted",children:n("ui.settings.navigation.settings_page.the_local_operator_server_is_taking_longer_than_usual_to_answer_i")})]}):o?t.jsxs("div",{"data-glass-region":"canvas","data-glass-split":"",className:"panel-flush flex min-h-0 flex-1 overflow-hidden bg-canvas",children:[t.jsx("div",{className:"w-12 shrink-0 overflow-y-auto min-[1040px]:w-55",children:t.jsx(Si,{activeSection:g,onSelectSection:Me,sections:M})}),t.jsx("div",{ref:ee,"data-settings-content":!0,"data-glass-region":"canvas-content","data-tour-tag":"settings-general-section",className:"panel-scroll flex-1 overflow-y-auto overflow-x-hidden p-4 sm:p-6 md:p-8",children:t.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-8 pb-8",children:[t.jsx(Li,{title:n("ui.settings.page.title"),icon:wn}),t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsxs("div",{ref:L.general,className:"flex flex-col gap-8",children:[t.jsx(Mi,{focus:ie===qi}),t.jsxs(ce,{title:n("ui.settings.profile.title"),icon:Ci,description:n(S?"ui.settings.profile.description_authenticated":"ui.settings.profile.description_anonymous"),children:[q&&t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.settings.profile.account_checking")}),ne&&t.jsx(ae,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:n(I==="refused"?"ui.settings.profile.account_read_failed_refused":"ui.settings.profile.account_read_failed_retry")}),t.jsx(O,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>k(),disabled:N,children:N?n("ui.settings.profile.retrying"):n("ui.settings.profile.retry")})]})}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Nn,{value:z.profile.name,label:n("ui.settings.profile.display_name.label"),placeholder:n("ui.settings.profile.display_name.placeholder"),isSaving:v==="user_name",onSave:async F=>{w("user_name");try{z.updateName(F)}finally{w(null)}},readOnly:ge}),t.jsx(Nn,{value:z.profile.email,label:n("ui.settings.profile.email.label"),placeholder:n("ui.settings.profile.email.placeholder"),isSaving:v==="user_email",onSave:async F=>{w("user_email");try{z.updateEmail(F)}finally{w(null)}},readOnly:ge})]})]}),t.jsx(ce,{title:n("ui.settings.tour.title"),description:n("ui.settings.tour.description"),children:t.jsxs(O,{variant:"secondary",onClick:()=>{G({forceModalCompleted:!0})},children:[t.jsx(Ka,{}),n("ui.settings.tour.action")]})}),t.jsx(ce,{id:"model-settings",title:n("ui.settings.model.settings_page.model_settings"),icon:Ei,description:n("ui.settings.model.settings_page.configure_the_default_ai_model_and_hosting_providers_used_for_gen"),children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Ai,{value:o.values.hosting,isSaving:v==="hosting",onSave:F=>Oe("hosting",F),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:n("ui.settings.model.settings_page.no_hosting_options")}),t.jsx(Ii,{value:o.values.model_name,hostingId:o.values.hosting,isSaving:v==="model_name",onSave:F=>Oe("model_name",F),allowCustom:!0,allowDefault:!1}),t.jsx(Jl,{hosting:o.values.hosting,modelName:o.values.model_name,focus:ie===pt}),x&&t.jsx(ae,{variant:"neutral",icon:t.jsx(St,{className:"size-4","aria-hidden":"true"}),children:t.jsxs("span",{children:[n("ui.settings.model.provider_callout.sentence"),t.jsx("button",{type:"button",className:"text-accent underline underline-offset-2",onClick:()=>{Me("providers"),L.providers.current?.focus({preventScroll:!0})},children:n("ui.settings.model.provider_callout.providers_link")}),"."]})})]})}),t.jsx(au,{}),t.jsx(ce,{title:n("ui.settings.configuration.settings_page.configuration_information"),icon:St,description:n("ui.settings.configuration.settings_page.system_information_about_the_current_configuration"),children:t.jsxs(ot,{children:[t.jsx(me,{label:n("ui.settings.configuration.settings_page.version"),value:t.jsx("span",{className:"text-mono-sm",children:o.version})}),t.jsx(me,{label:n("ui.settings.configuration.settings_page.created"),value:rs(o.metadata.created_at)}),t.jsx(me,{label:n("ui.settings.configuration.settings_page.last_modified"),value:nn(o.metadata.last_modified)}),t.jsx(me,{label:n("ui.settings.configuration.settings_page.description"),value:o.metadata.description||n("ui.settings.configuration.settings_page.no_description_available")})]})})]}),t.jsx(ce,{title:n("ui.settings.appearance.settings_page.appearance"),icon:hs,description:n("ui.settings.appearance.settings_page.customize_the_look_and_feel_of_local_operator"),sectionRef:L.appearance,dataTourTag:"settings-appearance-section",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(mu,{}),t.jsx(xs,{value:s,label:n("ui.settings.appearance.settings_page.show_agent_reasoning"),description:n("ui.settings.appearance.settings_page.adds_the_agent_s_reasoning_and_thinking_rows_to_conversations_the"),onChange:async F=>a(F)}),t.jsx(_u,{value:ds(i),onChange:F=>r(F)}),t.jsx(bl,{state:e.state,onChange:e.set})]})}),t.jsx(su,{sectionRef:L.speech}),t.jsx(vc,{sectionRef:L.keyboard}),t.jsx(ce,{title:n("ui.settings.model.settings_page.model_providers"),icon:as,description:n("ui.settings.navigation.settings_page.sign_in_to_the_services_your_agents_think_with_new_chats_use_your"),sectionRef:L.providers,id:"model-providers",className:"focus-visible:outline-none!",children:t.jsx(Ri,{initialProviderId:he,onChangeModel:()=>Me("general")})}),t.jsx(Kd,{sessionId:$??void 0,sectionRef:L.integrations,highlightServer:Be}),t.jsx(ce,{title:n("ui.settings.account.settings_page.radient_account"),titleComponent:t.jsx(xu,{}),description:n("ui.settings.account.settings_page.your_radient_account_radient_pass_details_and_credits_to_use_radi"),sectionRef:L.radient,dataTourTag:"settings-radient-account-section",children:t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsx(Hd,{onAfterCredentialUpdate:()=>{pe(),ke()}}),S&&t.jsxs(t.Fragment,{children:[t.jsx(pu,{}),t.jsx(hu,{})]})]})}),B&&t.jsx(ce,{title:n("ui.agentMessages.settings.section"),icon:Ti,description:n("ui.agentMessages.settings.description"),sectionRef:L["agent-messages"],id:"agent-messages",className:"border-b border-hairline pb-8",children:V?t.jsx(Rl,{availability:Y,status:V,accountId:P,refusal:Q.refusal,onRefreshStatus:A,sessions:W,focus:ie===Ua,onOpenSession:F=>{K.invalidateStatus(),qs(Te,F)}}):Q.refusal?t.jsxs(ae,{variant:"warning",children:[t.jsx(Nt,{children:n("ui.agentMessages.settings.error.title")}),t.jsxs(Ne,{children:[Q.refusal.code!=="client_unavailable"&&t.jsx("span",{className:"block",children:xt(Q.refusal)}),t.jsx("span",{className:"block",children:n("ui.agentMessages.settings.error.no_changes")}),t.jsx(O,{className:"mt-3",variant:"secondary",onClick:()=>void A(),children:n("ui.agentMessages.settings.error.retry")})]})]}):t.jsxs("div",{"aria-busy":"true",className:"flex flex-col gap-3",children:[t.jsx(xe,{className:"h-5 w-40"}),t.jsx(xe,{className:"h-4 w-full max-w-xl"})]})}),t.jsx(ce,{title:n("ui.settings.navigation.settings_page.backend_settings"),icon:wn,description:n("ui.settings.navigation.settings_page.every_setting_the_backend_registry_owns_searchable_with_typed_edi"),sectionRef:L.backend,children:t.jsx(Ba,{hideInterfaceLanguage:!0,hideModelEffort:!0,hideAgentMessages:!0,focusKey:ie&&kn(ie,"backend")==="backend"?ie:null,initialFilter:re})}),t.jsx("div",{ref:L.imports,children:t.jsx(hc,{})}),t.jsx("div",{ref:L.updates,children:t.jsx(Yl,{})})]})]})})]}):t.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:t.jsx(ae,{variant:"warning",className:"w-full max-w-xl",children:n("ui.settings.navigation.settings_page.your_settings_could_not_be_loaded")})})};export{Tu as SettingsPage};
|