local-operator-ui 0.34.55 → 0.35.0
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 +571 -45
- package/out/preload/index.js +50 -1
- package/out/renderer/assets/{_basePickBy-Be_5LfVS.js → _basePickBy-DXcdlCne.js} +1 -1
- package/out/renderer/assets/{_baseUniq-hdy9kmQQ.js → _baseUniq-59s2A3Xi.js} +1 -1
- package/out/renderer/assets/{agent-details-page-CLbcLEwm.js → agent-details-page-DzCMByBi.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-Bf5Aw-Jn.js → agent-hub-page-DJCaMoAj.js} +1 -1
- package/out/renderer/assets/{agents-page-BpaQBOFJ.js → agents-page-jAx30gRr.js} +3 -3
- package/out/renderer/assets/{arc-CgN-UZqL.js → arc-DTGY_Lgi.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-DowMu2Qf.js → architectureDiagram-IEHRJDOE-C1eZGb9i.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-DgKTIFqt.js → blockDiagram-JOT3LUYC-DcFFqP3h.js} +1 -1
- package/out/renderer/assets/{book-open-yKrSTgbR.js → book-open-Bi2GxPj-.js} +1 -1
- package/out/renderer/assets/browser-page-Bnzl2Fck.js +1 -0
- package/out/renderer/assets/{browser-webauthn-prompt-CJ6FJJMN.js → browser-webauthn-prompt-DcHbqaLn.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-Ctyv3nA_.js → c4Diagram-VJAJSXHY-CzUO0Dxd.js} +1 -1
- package/out/renderer/assets/channel-CBLzxDK-.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-CW43fWPt.js → chunk-4BMEZGHF-mCAjVMxO.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-BfdEIIIg.js → chunk-A2AXSNBT-D6-zo_Fr.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-Bx4nZ-57.js → chunk-AEK57VVT-B3ngikm8.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-BA6hwejS.js → chunk-D6G4REZN-ChTXeHBQ.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-Civ6_Z-P.js → chunk-RZ5BOZE2-D2c3_Jya.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-BVPRrS8K.js → chunk-XZIHB7SX-BTrxUgxT.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-BnE_q2SF.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-BnE_q2SF.js +1 -0
- package/out/renderer/assets/clone-Ctta4hua.js +1 -0
- package/out/renderer/assets/{console-mirror-D12eLWy7.js → console-mirror-Dc1bE9Vm.js} +1 -1
- package/out/renderer/assets/{consoleCapture-B5s47GGM.js → consoleCapture-Wr6s4sLo.js} +1 -1
- package/out/renderer/assets/{conversation-input-sync-oIWpPfzj.js → conversation-input-sync-C-0MXqyt.js} +140 -140
- package/out/renderer/assets/{dagre-OKDRZEBW-CayNWWG3.js → dagre-OKDRZEBW-B9TiRiqo.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-CNrEYtm4.js → diagram-SSKATNLV-1SfE1-5B.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-jzZ7n3uT.js → diagram-VNBRO52H-l4dzkACu.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-9BaZ6ZkV.js → erDiagram-Q7BY3M3F-CUgpeoFK.js} +1 -1
- package/out/renderer/assets/{error-boundary-BfL6ia-P.js → error-boundary-C9PRNlmT.js} +2 -2
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-CptBIl13.js → flowDiagram-4HSFHLVR-T5JJ4Xtw.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-CgcFEyO7.js → ganttDiagram-APWFNJXF-DQ2mySlQ.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-cmMetjXL.js → gitGraphDiagram-7IBYFJ6S-C9DZfwGd.js} +1 -1
- package/out/renderer/assets/{graph-R1Ok41yA.js → graph-TsL6qeA-.js} +1 -1
- package/out/renderer/assets/index-8yv29dzU.js +57 -0
- package/out/renderer/assets/index-Bk16DqRh.css +1 -0
- package/out/renderer/assets/{index-CNvEPxPr.js → index-D8u5NmIa.js} +177 -162
- package/out/renderer/assets/{index-Dsm4DzII.js → index-P4i-q0KF.js} +1 -1
- package/out/renderer/assets/{index-BFzgup69.js → index-rSXvFxM8.js} +1 -1
- package/out/renderer/assets/{infoDiagram-PH2N3AL5-DeSmG1nL.js → infoDiagram-PH2N3AL5-U47NbuL3.js} +1 -1
- package/out/renderer/assets/{installer-BM-QRi7Y.js → installer-fluCVssE.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I--ZNfC2qt.js → journeyDiagram-U35MCT3I-Bo7dozG5.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-kUi3-HdL.js → kanban-definition-NDS4AKOZ-Bn0hKA3l.js} +1 -1
- package/out/renderer/assets/{layout-DQq3NfPk.js → layout-CnIEnr3t.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-D0vembfV.js → legacy-agents-page-pxEj7cjk.js} +1 -1
- package/out/renderer/assets/{mermaid.core-kSHzKq9G.js → mermaid.core-lUsLZpuU.js} +5 -5
- package/out/renderer/assets/{mesh-page-BhfRHXQS.js → mesh-page-vihuNvox.js} +1 -1
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-BsJiNdkz.js → mindmap-definition-ALO5MXBD-DtB-t5TL.js} +1 -1
- package/out/renderer/assets/{mini-DngBC0gl.js → mini--p2d2BoB.js} +1 -1
- package/out/renderer/assets/{notebook-pen-BbGvgaYT.js → notebook-pen-C-602S82.js} +1 -1
- package/out/renderer/assets/{org-access-DVLt_Z75.js → org-access-DwKpT4sY.js} +1 -1
- package/out/renderer/assets/{org-surface-gate-J1G29FUu.js → org-surface-gate--inYykb1.js} +1 -1
- package/out/renderer/assets/{page-header-BSVtXSul.js → page-header-Cz4WU8y6.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-D9NPKlbA.js → pieDiagram-IB7DONF6-kHXX0Qj3.js} +1 -1
- package/out/renderer/assets/{projects-page-CV3ap9Ch.js → projects-page-B9Y4di7i.js} +1 -1
- package/out/renderer/assets/{publication-validation-CXXK8RMX.js → publication-validation-LQ7dKLdu.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-Dp6sSgy_.js → quadrantDiagram-7GDLP6J5-Da2X85Fu.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-BdYaxH9C.js → radar-MK3ICKWK-C0d75XBo.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-2gyRX5Xg.js → radient-auth-buttons-DQVWpG8o.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-CSxZpxDc.js → requirementDiagram-KVF5MWMF-CL-Kku_X.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-DNfJtnGS.js → sankeyDiagram-QLVOVGJD-DWUg1eAE.js} +1 -1
- package/out/renderer/assets/{schedules-page-BMY6s4UJ.js → schedules-page-B7tSQfbG.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-wP1VuU8h.js → sequenceDiagram-X6HHIX6F-Bn0FlGHo.js} +1 -1
- package/out/renderer/assets/settings-page-Dty0ZTmK.js +292 -0
- package/out/renderer/assets/{stateDiagram-DGXRK772-BRguDCdq.js → stateDiagram-DGXRK772-CkdY_hLZ.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CWy168Js.js +1 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-Sovor235.js → timeline-definition-BDJGKUSR-DodPShzl.js} +1 -1
- package/out/renderer/assets/ui-preferences-store-B_KwjcMZ.js +1 -0
- package/out/renderer/assets/{use-download-agent-mutation-CKVzPGPY.js → use-download-agent-mutation-CIiU8sRW.js} +1 -1
- package/out/renderer/assets/{use-memberships-query-BgAi_tHu.js → use-memberships-query-BMOJPwWD.js} +1 -1
- package/out/renderer/assets/{use-session-snapshot-Ba7FspxL.js → use-session-snapshot-B0aCKABJ.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-BBlbpFBv.js → xychartDiagram-VJFVF3MP-BRifY3vn.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +7 -7
- package/out/renderer/installer.html +4 -4
- package/out/renderer/mini.html +7 -7
- package/package.json +2 -2
- package/out/renderer/assets/browser-page-CKyYrwF0.js +0 -1
- package/out/renderer/assets/channel-DaruqAQQ.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-D8vhGZVf.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-D8vhGZVf.js +0 -1
- package/out/renderer/assets/clone-HcmO38Fx.js +0 -1
- package/out/renderer/assets/index-CsR1USrT.js +0 -57
- package/out/renderer/assets/index-pufheB69.css +0 -1
- package/out/renderer/assets/settings-page-CVUD4U35.js +0 -292
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CqO4MBYu.js +0 -1
- package/out/renderer/assets/ui-preferences-store-g6-xQ9NA.js +0 -1
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
import{r as l,t as n,j as t,c as de,e as Xn,L as es}from"./index-CsR1USrT.js";import{cw as bt,cx as ts,cy as Vt,cz as je,bQ as ns,C as xe,ah as fn,ai as It,a4 as yn,u as Lt,aK as ss,aL as as,cA as is,cB as os,cC as rs,cD as ls,cE as xn,cF as Ot,af as kn,cG as cs,cH as ds,aP as us,cI as Gt,cJ as Le,a as Ft,c as wt,cK as gs,cL as et,cM as _s,bm as ms,cN as ps,cO as hs,cP as fs,cQ as ys,d as ye,cR as jt,ad as xs,cS as ks,cT as vs,cU as bs,cV as ws,Z as Dt,cW as js,cX as Ns,a3 as vn,aR as Nt,aS as St,cY as Ss,aW as Cs,cZ as Ms,cb as Ct,ar as tt,c_ as As,c$ as Es,d0 as Rs,d1 as Mt,d2 as Ts,d3 as Is,d4 as Ls,aN as Os,bE as Fs,d5 as bn,d6 as Ds,d7 as zs,d8 as Ps,B as Us,d9 as wn,aQ as jn,da as Nn,db as Ks,dc as $s,dd as Bs,de as Hs,df as Vs,dg as Gs,dh as qs,di as Ys,D as Qs,bL as Sn,aX as Ws,bl as Zs,dj as Ke,dk as At,dl as qt,dm as Js,dn as Xs,dp as ea,dq as Cn,dr as ta,by as na,ds as sa,bT as aa,dt as ia,bS as oa,du as ra,dv as la,dw as Yt,dx as ca,dy as da,dz as ua}from"./conversation-input-sync-oIWpPfzj.js";import{K as ga,u as Ne,n as _a,o as ma,q as pa,T as ha,r as Mn}from"./ui-preferences-store-g6-xQ9NA.js";import{bh as An,bi as fa,bj as ya,bk as ie,b1 as ct,b2 as ce,bl as xa,bm as ka,aH as Qt,bn as va,bo as ba,bp as We,S as wa,b0 as ja,bq as Na,br as Sa,bs as Ca,bt as Ma,bu as Aa,bv as Ea,aS as Wt,bw as Ra,aN as Ta,aZ as Zt,bx as Ia,a_ as La,a$ as Oa,by as Fa,bz as Da}from"./index-CNvEPxPr.js";import{P as za}from"./page-header-BSVtXSul.js";import{c as b,u as Q,B,S as ue,M as Pa,Y as ot,Z as rt,_ as ze,F as Ua,G as Ka,H as $a,J as Ba,K as Ha,l as He,a0 as lt,N as Va,L as ve,I as Oe,ab as Jt,T as En,C as Ga,q as qa,r as Ya,s as Qa,v as Wa,w as Xt,p as Za,A as oe,z as Ja,E as Xa,ac as ei,a4 as ti,g as ni,k as Rn}from"./error-boundary-BfL6ia-P.js";import{R as si}from"./radient-auth-buttons-2gyRX5Xg.js";import{N as ai}from"./notebook-pen-BbGvgaYT.js";import{B as ii}from"./book-open-yKrSTgbR.js";import{a as oi,p as ht}from"./parseISO-BHJWTxrA.js";import{i as ri,a as Ie,f as li}from"./format-esAOn2VS.js";import{t as ci}from"./en-US-CHJkXXr4.js";import"./console-mirror-D12eLWy7.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 di=[["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"}]],ui=b("aperture",di);/**
|
|
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 gi=[["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"}]],_i=b("atom",gi);/**
|
|
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 mi=[["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"}]],pi=b("audio-waveform",mi);/**
|
|
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 hi=[["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"}]],fi=b("binary",hi);/**
|
|
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 yi=[["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"}]],xi=b("candy",yi);/**
|
|
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 ki=[["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"}]],vi=b("car-front",ki);/**
|
|
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 bi=[["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"}]],wi=b("cassette-tape",bi);/**
|
|
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 ji=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],Ni=b("chart-line",ji);/**
|
|
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 Si=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],Ci=b("circle-play",Si);/**
|
|
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 Mi=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Ai=b("circle-plus",Mi);/**
|
|
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 Ei=[["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"}]],Ri=b("circuit-board",Ei);/**
|
|
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 Ti=[["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"}]],Ii=b("cloud-lightning",Ti);/**
|
|
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 Li=[["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"}]],Oi=b("cloud-moon",Li);/**
|
|
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 Fi=[["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"}]],Di=b("cloud-snow",Fi);/**
|
|
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 zi=[["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"}]],Pi=b("cloud-sun",zi);/**
|
|
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 Ui=[["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"}]],Ki=b("coffee",Ui);/**
|
|
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 $i=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],Tn=b("contrast",$i);/**
|
|
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 Bi=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Hi=b("credit-card",Bi);/**
|
|
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 Vi=[["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"}]],Gi=b("cup-soda",Vi);/**
|
|
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 qi=[["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"}]],Yi=b("disc-3",qi);/**
|
|
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 Qi=[["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"}]],Wi=b("droplet",Qi);/**
|
|
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 Zi=[["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"}]],Ji=b("droplets",Zi);/**
|
|
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 Xi=[["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"}]],eo=b("fish",Xi);/**
|
|
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 to=[["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"}]],no=b("flame",to);/**
|
|
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 so=[["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"}]],ao=b("flower-2",so);/**
|
|
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 io=[["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"}]],oo=b("flower",io);/**
|
|
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 ro=[["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"}]],lo=b("ghost",ro);/**
|
|
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 co=[["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"}]],uo=b("github",co);/**
|
|
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 go=[["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"}]],_o=b("guitar",go);/**
|
|
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 mo=[["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"}]],po=b("hexagon",mo);/**
|
|
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 ho=[["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"}]],fo=b("ice-cream-bowl",ho);/**
|
|
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 yo=[["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"}]],xo=b("joystick",yo);/**
|
|
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 ko=[["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"}]],vo=b("leaf",ko);/**
|
|
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 bo=[["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"}]],wo=b("lightbulb",bo);/**
|
|
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 jo=[["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"}]],No=b("milk",jo);/**
|
|
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 So=[["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"}]],Co=b("moon-star",So);/**
|
|
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 Mo=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Ao=b("moon",Mo);/**
|
|
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 Eo=[["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"}]],Ro=b("mountain-snow",Eo);/**
|
|
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 To=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],Io=b("mountain",To);/**
|
|
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 Lo=[["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"}]],Oo=b("radio",Lo);/**
|
|
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 Fo=[["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"}]],Do=b("sailboat",Fo);/**
|
|
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 zo=[["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"}]],Po=b("shirt",zo);/**
|
|
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 Uo=[["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"}]],Ko=b("skull",Uo);/**
|
|
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 $o=[["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"}]],Bo=b("snowflake",$o);/**
|
|
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 Ho=[["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"}]],Vo=b("sparkle",Ho);/**
|
|
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 Go=[["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"}]],qo=b("sun-dim",Go);/**
|
|
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 Yo=[["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"}]],Qo=b("sun",Yo);/**
|
|
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 Wo=[["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"}]],Zo=b("sunrise",Wo);/**
|
|
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 Jo=[["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"}]],Xo=b("sunset",Jo);/**
|
|
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 er=[["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"}]],tr=b("tent",er);/**
|
|
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 nr=[["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"}]],sr=b("tree-deciduous",nr);/**
|
|
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 ar=[["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"}]],ir=b("tree-palm",ar);/**
|
|
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 or=[["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"}]],rr=b("tree-pine",or);/**
|
|
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 lr=[["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"}]],cr=b("trees",lr);/**
|
|
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 dr=[["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"}]],ur=b("umbrella",dr);/**
|
|
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 gr=[["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"}]],_r=b("waves",gr);/**
|
|
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 mr=[["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"}]],pr=b("wheat",mr);/**
|
|
287
|
-
* @license lucide-react v0.507.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const hr=[["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"}]],fr=b("wind",hr),yr=({appVersion:e=null,slowWaitHintMs:s})=>{Q();const a="https://local-operator.com/download",[i,o]=l.useState(!1),r=An(i,s??fa),[d,_]=l.useState(!1),[c,g]=l.useState(null),[f,x]=l.useState("info"),[y,m]=l.useState(null),[h,A]=l.useState(null),C=e?.trim()?e.trim():null,H=l.useRef(!1),N=bt(U=>U.openDetail),K=l.useRef(!1),D=l.useRef(0),E=l.useRef(!1),M=l.useCallback((U,L)=>{K.current=!1,g(U),x(L),_(!0)},[]),Z=l.useCallback(U=>{K.current=!0,g(U),x("success"),_(!0)},[]),J=l.useCallback(()=>{K.current&&(K.current=!1,_(!1),g(null))},[]),{clearDeferredUpdate:X}=ts();l.useEffect(()=>{const U=window.api.updater.onUpdateError(p=>{H.current&&p.includes("manually")&&(m({message:n("ui.common.updates.check_for_updates_button.the_server_is_installed_outside_the_app_so_use_the_tool_you_insta"),command:""}),K.current=!1,g(null),x("warning"),_(!0))}),L=window.api.updater.onBackendUpdateDevMode(p=>{H.current&&M(p,"info")}),$=()=>{E.current=!0,J()},V=window.api.updater.onUpdateAvailable($),R=window.api.updater.onUpdateNpxAvailable($),ee=window.api.updater.onBackendUpdateAvailable($);return()=>{U(),L(),V(),R(),ee()}},[J,M]),l.useEffect(()=>{let U=!1;const L=()=>{window.api.updater.getLastInstallAttempt().then(V=>{U||A(V)}).catch(()=>{})};L();const $=window.api.updater.onUpdateInstallFailed(()=>L());return()=>{U=!0,$()}},[]);const I=async()=>{const U=++D.current;J(),E.current=!1;try{o(!0),H.current=!0,X(je.UI),X(je.BACKEND);const L=await window.api.updater.checkForAllUpdates({manual:!0});if(U!==D.current)return;L.app==="available"&&N(je.UI),L.server==="available"&&N(je.BACKEND),L?.affirmation&&!E.current?Z(L.affirmation):J()}catch(L){if(U!==D.current)return;console.warn(`Update check failed; the app-level alert owns the report: ${ya(L)}`)}finally{U===D.current&&o(!1),setTimeout(()=>{H.current=!1},2e3)}},se=()=>{K.current=!1,_(!1),g(null)};return t.jsxs(t.Fragment,{children:[h&&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"),h.targetVersion," ",n("ui.common.updates.check_for_updates_button.didn_t_finish"),h.attempts>1?n("ui.common.updates.check_for_updates_button.detail",{attempts:h.attempts,attemptsText:String(h.attempts)}):"",".",C?n("ui.common.updates.check_for_updates_button.version",{liveversion:String(C)}):null]}),t.jsxs("p",{className:"mt-1 text-meta text-ink-dim",children:[n("ui.common.updates.check_for_updates_button.detected")," ",h.detectedAt?new Date(h.detectedAt).toLocaleString():"at an unknown time",". ",h.detail]}),t.jsx(B,{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(B,{variant:"outline",onClick:()=>void I(),disabled:i,children:[i?t.jsx(ue,{size:"sm"}):null,i?n("ui.common.updates.check_for_updates_button.checking"):n("ui.common.updates.check_for_updates_button.check_for_updates")]}),r&&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")}),y&&t.jsxs(Vt,{open:d,autoHideDuration:1e4,onClose:se,variant:"warning",children:[t.jsx("p",{className:"text-body-sm",children:y.message}),y.command&&t.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:y.command})]}),c&&f!=="danger"&&t.jsx(Vt,{open:d,autoHideDuration:6e3,onClose:se,variant:f,children:c})]})},nt=["system-prompt"],xr=()=>{const{shouldEnableQuery:e}=ns();return xe({enabled:e({bypassInternetCheck:!0}),queryKey:nt,queryFn:async()=>{try{const a=await fn(It.baseUrl).config.getSystemPrompt();if(a===null)return null;if(a.status>=400)throw new Error(a.message||"Failed to fetch system prompt");return a.result}catch(s){const a=s instanceof Error?s.message:"An unknown error occurred while fetching system prompt";throw yn(a),s}},refetchOnWindowFocus:!1,staleTime:5e3})},kr=()=>{const e=Lt(),s=fn(It.baseUrl);return ss({mutationFn:async a=>{try{const i=await s.config.updateSystemPrompt(a);if(i.status>=400)throw new Error(i.message||"Failed to update system prompt");return i.result}catch(i){const o=i instanceof Error?i.message:"An unknown error occurred while updating system prompt";throw yn(o),i}},onSuccess:async a=>{await e.invalidateQueries({queryKey:nt,refetchType:"none"}),e.setQueryData(nt,i=>i&&{...i,...a}),await e.refetchQueries({queryKey:nt,type:"all"}),as("System prompt updated")},onError:a=>{console.error("Error updating system prompt:",a)}})},In=({value:e,label:s,description:a,onChange:i,icon:o,isSaving:r=!1})=>{const[d,_]=l.useState(e),c=l.useId(),g=`${c}-label`,f=`${c}-description`,x=async y=>{if(!r){_(y);try{await i(y)}catch(m){_(!y),console.error("Error toggling setting:",m)}}};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:g,className:"flex min-h-6 items-center gap-2 text-body text-ink",children:[o&&t.jsx(o,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-dim"}),s]}),a&&t.jsx("p",{id:f,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:r?t.jsx(ue,{size:"md",label:`Saving ${s}`}):t.jsx(Pa,{checked:d,onCheckedChange:x,"aria-labelledby":g,"aria-describedby":a?f:void 0})})]})};function en(e,s){const a=ci(e,s?.in);if(!ri(a))throw new RangeError("Invalid time value");const i=Ie(a.getDate(),2),o=Ie(a.getMonth()+1,2),r=a.getFullYear(),d=Ie(a.getHours(),2),_=Ie(a.getMinutes(),2),c=Ie(a.getSeconds(),2);let g="",f="";const x=a.getTimezoneOffset();if(x!==0){const y=Math.abs(x),m=Ie(Math.trunc(y/60),2),h=Ie(y%60,2);f=`${x<0?"+":"-"}${m}:${h}`}else f="Z";return`${r}-${o}-${i}T${d}:${_}:${c}${g}${f}`}function vr(e,s,a){return oi(e,-30,a)}var br=is({chartName:"LineChart",GraphicalChild:xn,axisComponents:[{axisType:"xAxis",AxisComp:os},{axisType:"yAxis",AxisComp:rs}],formatAxisMap:ls});const wr=["radient","creditBalance"],jr=e=>{const{user:s,isAuthenticated:a}=Ot(),i=s?.account?.tenant_id,o=a&&!!i&&e?.enabled;return xe({queryKey:[wr,i],queryFn:async()=>{if(!i)throw new Error("Tenant ID not available");const r=await kn({operation:"credits",tenantId:i});if(!r||typeof r.balance!="number")throw new Error("Invalid credit balance response format");return r},enabled:o,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},Nr=["radient","usageRollup"],Sr=(e,s)=>{const{user:a,isAuthenticated:i}=Ot(),o=a?.account?.tenant_id,r=i&&!!o&&s?.enabled;return xe({queryKey:[...Nr,o,e],queryFn:async()=>{if(!o)throw new Error("Tenant ID not available");const d={};for(const[c,g]of Object.entries(e))g!=null&&(d[c]=String(g));const _=await kn({operation:"usage",tenantId:o,query:d});if(!_)throw new Error("Invalid usage rollup response format");return _},enabled:r,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},Cr=e=>e==="sidebars"?n("ui.settings.appearance.window_glass.coverage_sidebars"):n("ui.settings.appearance.window_glass.coverage_full"),Mr=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")}},Ar=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"linux-no-native-blur":return n("ui.settings.appearance.window_glass.unsupported_linux");default:return n("ui.settings.appearance.window_glass.unsupported_other")}},tn=({label:e,description:s,value:a,onValueChange:i,options:o})=>{const r=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:r,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(ot,{value:a,onValueChange:i,children:t.jsx(rt,{"aria-labelledby":r,children:o.map(d=>t.jsx(ze,{value:d.value,children:d.label},d.value))})})})]})},Er=({state:e,onChange:s})=>{Q();const a=l.useId(),i=`${a}-description`,[o,r]=l.useState(null),d=l.useRef(!1),_=l.useRef(null),c=e?.settings.intensity??0;if(!e)return null;if(!e.capability.supported)return t.jsx("p",{"data-glass-unsupported":e.capability.reason,className:"max-w-2xl text-body-sm text-ink-muted",children:Ar(e.capability.reason)});const g=async y=>{if(d.current){_.current=y;return}d.current=!0;try{await s({intensity:y})}finally{d.current=!1;const m=_.current;_.current=null,m!==null&&m!==y?g(m):r(null)}},f=e.settings.enabled,x=o??c;return t.jsxs("div",{className:"flex flex-col gap-4","data-window-glass":"",children:[t.jsx(In,{value:f,label:n("ui.settings.appearance.window_glass.label"),description:n("ui.settings.appearance.window_glass.description"),onChange:async y=>s({enabled:y})}),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")}),f&&t.jsxs(t.Fragment,{children:[t.jsx(tn,{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:cs.map(y=>({value:y,label:Cr(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(x)})})]}),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:x,"aria-describedby":i,"aria-valuetext":n("ui.settings.appearance.window_glass.intensity_value",{value:String(x)}),onChange:y=>{const m=Number(y.target.value);r(m),g(m)},style:{"--fill":`${x}%`},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(tn,{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:Mr(y)}))})]})]})},nn={get[je.UI](){return n("ui.settings.updates.update_following.application_updates")},get[je.BACKEND](){return n("ui.settings.updates.update_following.server_updates")}},Ze={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")}}},sn=({type:e})=>{Q();const s=bt(i=>i.followed[e]),a=bt(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:nn[e]}),t.jsx("div",{className:"mt-0.5 text-meta text-ink-muted",children:Ze[s].description})]}),t.jsxs(Ua,{value:s,onValueChange:i=>a(e,i),children:[t.jsx(Ka,{"aria-label":n("ui.settings.updates.update_following.surface_choice",{surface:nn[e],choice:Ze[s].label}),className:"w-full sm:w-56","data-followed-segment":e,children:t.jsx($a,{})}),t.jsx(Ba,{children:ds.map(i=>t.jsx(Ha,{value:i,title:Ze[i].description,children:Ze[i].label},i))})]})]})},Rr=()=>(Q(),t.jsxs("div",{className:de("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(sn,{type:je.UI}),t.jsx(sn,{type:je.BACKEND})]})]})),Tr=({appVersion:e})=>t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(Rr,{}),t.jsx(yr,{appVersion:e})]}),Ir=e=>{if(!e)return null;try{return new URL(e).host}catch{return null}};function ft(e){switch(e){case"Loading...":return n("ui.settings.updates.app_updates_section.state_loading");case"Not connected":return n("ui.settings.updates.app_updates_section.state_not_connected");case"Not attached":return n("ui.settings.updates.app_updates_section.state_not_attached");case"Version unknown":return n("ui.settings.updates.app_updates_section.state_version_unknown");case"Unavailable":return n("ui.settings.updates.app_updates_section.state_unavailable");default:return e}}const Lr=()=>{Q();const[e,s]=l.useState(null),[a,i]=l.useState({value:"Loading...",detail:null,degraded:!1}),[o,r]=l.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});l.useEffect(()=>{let _=!0;const c=m=>{if(!_)return;const h=Ir(m.url);if(m.state==="connecting"){i({value:"Loading...",detail:null,degraded:!1});return}if(m.state==="detached"){i({value:"Not connected",detail:m.detail||null,degraded:!1});return}if(m.state==="wedged"){i({value:"Not attached",detail:m.detail||null,degraded:!1});return}const A=m.version||"Version unknown";i({value:h?`${A} · ${h}`:A,detail:m.detail||null,degraded:m.state==="degraded"})};let g=!1;const f=window.api?.backend?.onStatusChange(m=>{g=!0,c(m)}),x=async()=>{try{const[m,h]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);_&&(s(m),r(h))}catch(m){console.error("Error fetching app information:",m)}},y=async()=>{try{const m=window.api?.backend;if(m){const C=await m.getStatus();g||c(C);return}const h=await Gt.healthCheck(It.baseUrl),A=Gt.getServerVersion(h);_&&i({value:A,detail:null,degraded:!1})}catch(m){console.error("Error fetching server version:",m),_&&i({value:"Unavailable",detail:null,degraded:!1})}};return x(),y(),()=>{_=!1,f?.()}},[]);const d=(_,c,g,f={})=>t.jsx(ce,{label:t.jsx(He,{content:g,children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(lt,{size:12,className:"shrink-0"}),_]})}),valueClassName:f.valueClassName,value:t.jsxs(t.Fragment,{children:[f.valueTooltip?t.jsx(He,{content:f.valueTooltip,children:t.jsx("span",{"data-backend-version":f.valueHoverTarget?"":void 0,children:c})}):c,f.statusNote?t.jsx("span",{className:"mt-0.5 block text-meta text-ink-dim",children:f.statusNote}):null]})});return t.jsx(ie,{title:n("ui.settings.updates.app_updates_section.application_updates_and_info"),icon:us,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(ct,{children:[d(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")),d(n("ui.settings.updates.app_updates_section.server_version"),ft(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}),d(n("ui.settings.updates.app_updates_section.platform"),`${o.platform} (${o.arch})`,n("ui.settings.updates.app_updates_section.the_operating_system_and_architecture_your_application_is_running")),d(n("ui.settings.updates.app_updates_section.node_js_version"),ft(o.nodeVersion),n("ui.settings.updates.app_updates_section.the_javascript_runtime_environment_version")),d(n("ui.settings.updates.app_updates_section.electron_version"),ft(o.electronVersion),n("ui.settings.updates.app_updates_section.the_framework_version_enabling_this_desktop_application"))]}),t.jsx(Tr,{appVersion:e})]})})};function Ln(e){const s={id:"",name:n("ui.settings.model.default_effort.model_default")};return e.resolvedLevel&&e.stored.trim()===""&&zt(e.resolvedLevel,e.storable)!==null&&(s.description=n("ui.settings.model.default_effort.model_default_resolves",{level:Le(e.resolvedLevel)})),[s,...On(e.ladder,e.storable)]}function zt(e,s){const a=e.trim().toLowerCase();return a===""?null:s.find(i=>i.trim().toLowerCase()===a)??null}function On(e,s){return e.flatMap(a=>{const i=zt(a,s);return i===null?[]:[{id:i,name:Le(a)}]})}function Or(e,s){const a=e.trim().toLowerCase();return a!==""&&s.some(i=>i.toLowerCase()===a)?s.find(i=>i.toLowerCase()===a)??"":""}function Fr(e){if(!e.resolved||e.ladder===null)return null;const s=e.stored.trim().toLowerCase();if(s===""||e.ladder.some(o=>o.toLowerCase()===s))return null;const a=(e.resolvedLevel??"").trim(),i=a===""?"":zt(a,e.storable)??"";return i.trim().toLowerCase()===s?null:i}const st="\0unread";function Je(e){return e.trim()===""?"":st}function Dr(e){if(!e.supported)return{kind:"unsupported",options:[],selectedId:"",disabled:!0,helper:""};if(!e.hasHome)return we("no-home",n("ui.settings.model.default_effort.no_home"));if(!e.hasModel)return we("no-model",n("ui.settings.model.default_effort.no_model"),st);if(e.settings==="loading")return we("settings-loading",n("ui.settings.model.default_effort.settings_loading"),st);if(e.settings==="error")return we("settings-error",n("ui.settings.model.default_effort.settings_error"),st);if(e.preview==="loading")return we("loading",n("ui.settings.model.default_effort.loading"),Je(e.stored));if(e.preview==="error")return we("error",n("ui.settings.model.default_effort.error"),Je(e.stored));if(e.ladder===null||!e.specResolved)return we("unresolved",n("ui.settings.model.default_effort.unresolved"),Je(e.stored));const s=e.ladder;if(s.length===0)return we("empty",n("ui.settings.model.default_effort.empty"),Je(e.stored));const a=On(s,e.storable);if(a.length===0){const i=Le(s[0]),o=s.length===1&&s[0].trim().toLowerCase()==="auto";return{kind:"one-level",options:[{id:"",name:i}],selectedId:"",disabled:!0,helper:o?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:Ln({ladder:s,resolvedLevel:e.resolvedLevel,stored:e.stored,storable:e.storable}),selectedId:Or(e.stored,a.map(i=>i.id)),disabled:!1,helper:n("ui.settings.model.default_effort.helper_ready")}}function we(e,s,a=""){return{kind:e,options:Ln({ladder:[],resolvedLevel:null,stored:"",storable:[]}),selectedId:a,disabled:!0,helper:s}}const zr=({hosting:e,modelName:s,focus:a=!1})=>{Q();const i=Ft(),o=wt(i.data,"draft_preview"),r=gs(),d=e!==""&&s!=="",_=xe({queryKey:jt.all,queryFn:()=>ye({op:"settings.list"}),enabled:o,staleTime:1e4}),c=_.data?.settings.find(z=>z.key===et),g=typeof c?.value=="string"?c.value:"",f=(c?.choices??[]).map(z=>z.value).filter(z=>typeof z=="string"),x={cwd:r??"",model:d?{provider:e,model_id:s,reasoning_effort:null}:null},y=_.isSuccess?g:null,m=xe({...ms(x),queryKey:[..._s(x),"model_effort",y],enabled:o&&!!r&&d}),h=m.isSuccess&&!m.isPlaceholderData,A=h?ps(m.data?.snapshot,null).effort:null,C=h&&Array.isArray(A?.reasoning_efforts)?hs(A):null,H=h?fs(A):null,N=A!==null&&!ys(A),[K,D]=l.useState(!1),[E,M]=l.useState(!1),[Z,J]=l.useState(null),[X,I]=l.useState(null),se=`${e}\0${s}`,U=Lt(),L=l.useRef(null),$=l.useRef(!1),V=l.useCallback(async(z,te)=>{D(!0),J(z),M(!1),te===null&&I(null);try{await ye({op:"settings.edit",key:et,value:z}),await U.invalidateQueries({queryKey:jt.all}),te!==null&&I(te)}catch{M(!0)}finally{D(!1),J(null)}},[U]),R=typeof A?.display_name=="string"&&A.display_name.trim()||s,ee=Dr({supported:o,hasHome:!!r,hasModel:d,settings:_.isError?"error":_.isSuccess?"ready":"loading",preview:m.isError?"error":h?"ready":"loading",ladder:C,specResolved:N,stored:g,resolvedLevel:H,storable:f}),p=Fr({stored:g,ladder:C,resolvedLevel:H,resolved:h&&N&&_.isSuccess,storable:f}),F=l.useRef(null);l.useEffect(()=>{if(p===null||K)return;const z=`${e}\0${s}\0${g}\0${p}`;if(F.current===z)return;F.current=z;const te=p===""?n("ui.settings.model.default_effort.clamped_unset",{level:Le(g),model:R}):n("ui.settings.model.default_effort.clamped",{level:Le(g),model:R,resolved:Le(p)});V(p,{text:te,model:se})},[p,g,K,V,e,s,R,se]);const j=l.useMemo(()=>ee.options.map(Pr),[ee.options]);l.useEffect(()=>{if(!a){$.current=!1;return}ee.disabled||$.current||(L.current?.querySelector("[role=combobox]")?.focus(),$.current=!0)},[a,ee.disabled]);const q=Z??ee.selectedId,T=j.find(z=>z.id===q)??(Z!==null?{id:Z,name:Le(Z)}:null),W=t.jsxs("span",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{children:ee.helper}),E&&t.jsx("span",{className:"text-danger",children:n("ui.settings.model.default_effort.save_failed")}),t.jsx("output",{"aria-live":"polite",children:X?.model===se?X.text:""})]});return ee.kind==="unsupported"?null:t.jsx("div",{ref:L,"data-setting-key":et,children:t.jsx(Va,{label:n("ui.settings.model.default_effort.label"),icon:t.jsx(xa,{size:16,"aria-hidden":"true"}),placeholder:n("ui.settings.model.default_effort.placeholder"),options:j,selected:T,onSelect:z=>{V(z.id,null)},helperText:W,busy:K,busyLabel:n("ui.settings.model.default_effort.busy"),disabled:ee.disabled||K})})};function Pr(e){return{id:e.id,name:e.name,description:e.description}}const Ur=e=>{const s=e.label.replace(/^Open\s+/,"");return s.charAt(0).toUpperCase()+s.slice(1)},Kr=({action:e})=>{Q();const s=l.useId(),a=l.useRef(null),i=Ne(h=>h.shortcutBindings),o=i[e.id],r=Ne(h=>h.setShortcutBinding),d=Ne(h=>h.clearShortcutBinding),[_,c]=l.useState(!1),[g,f]=l.useState(null),x=l.useMemo(xs,[]),y=_a(e.id,i),m=Ur(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(ve,{htmlFor:s,className:"w-32 text-body-sm text-ink",children:m}),t.jsx(Oe,{id:s,readOnly:!0,value:y===null?n("ui.settings.shortcuts.keyboard_shortcuts_section.no_shortcut"):ma(y,x),"aria-label":n("ui.settings.shortcuts.keyboard_shortcuts_section.label_press_the_keys_you_want",{label:String(m)}),"data-shortcut-action":e.id,ref:a,className:de("w-52",y===null?"text-body-sm":"font-mono text-body-sm"),onFocus:()=>c(!0),onBlur:()=>{c(!1),f(null)},onKeyDown:h=>{if(ks.has(h.key))return;if(vs.has(h.key)){c(!1),f(null);return}if(bs.has(h.key)||h.nativeEvent.isComposing)return;const A=ws({key:h.key,metaKey:h.metaKey,ctrlKey:h.ctrlKey,altKey:h.altKey,shiftKey:h.shiftKey}),C=pa(A,e.id,i,x);if(C!==null){h.preventDefault(),c(!0),f(C);return}if(A===y){c(!0),f(null);return}h.preventDefault(),c(!0),f(null),A===e.defaultChord?r(e.id,null):A!==null&&r(e.id,A)}}),y!==null&&t.jsx(B,{variant:"secondary",size:"sm","aria-label":n("ui.settings.shortcuts.keyboard_shortcuts_section.clear_label_s_shortcut",{label:String(m)}),onClick:()=>{d(e.id),a.current?.focus()},children:n("ui.settings.shortcuts.keyboard_shortcuts_section.clear")}),o!==void 0&&t.jsx(B,{variant:"secondary",size:"sm","aria-label":n("ui.settings.shortcuts.keyboard_shortcuts_section.reset_label_to_its_default",{label:String(m)}),onClick:()=>{r(e.id,null),a.current?.focus()},children:n("ui.settings.shortcuts.keyboard_shortcuts_section.reset")})]}),_&&t.jsx("span",{className:"text-meta text-ink-dim",children:n("ui.settings.shortcuts.keyboard_shortcuts_section.press_the_keys_you_want_esc_cancels")}),g!==null&&t.jsx("output",{className:"text-meta text-danger",children:g})]})},$r=({sectionRef:e})=>(Q(),t.jsx(ie,{title:n("ui.settings.shortcuts.keyboard_shortcuts_section.keyboard_shortcuts"),icon:ka,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:ga.map(s=>t.jsx(Kr,{action:s},s.id))})})),Br=[[[".claude.json"],"Claude Code"],[[".claude",".mcp.json"],"Claude Code"],[[".cursor","mcp.json"],"Cursor"],[[".vscode","mcp.json"],"VS Code"],[[".codex","config.toml"],"Codex CLI"]];function Fn(e){if(!e)return null;const s=e.split("\\").join("/").split("/").filter(Boolean);for(const[a,i]of Br)if(!(s.length<a.length)&&s.slice(-a.length).join("/")===a.join("/"))return i;return null}const at=e=>n("ui.settings.integrations.integration_model.tool_count",{count:e}),Hr=e=>n("ui.settings.integrations.integration_model.integration_count",{count:e}),Vr=["connected","needs_sign_in","not_started","connecting","error"],Dn=e=>Vr.includes(e),Pe=(e,s)=>[...s].filter(a=>a.name===e&&a.status==="running").sort((a,i)=>i.created_at-a.created_at)[0]??null,Gr={connectedAt:null,connectedToolCount:null,settledGroup:null,pinnedGroup:null,pinnedOperationId:null,needsKey:!1,needsSignIn:!1,disconnectedAt:null,holdUntil:null,lastDecisive:null},qr=1e12,Yr=1e9,Qr=60*60*1e3,zn=(e,s=Date.now())=>{if(typeof e!="number"||!Number.isFinite(e))return null;const a=e>=qr?e:e<Yr?null:e*1e3;return a===null||a>s+Qr?null:Math.min(a,s)},Fe=(e,s)=>e?.[s]??Gr,Ge=(e,s,a)=>Jr(e,s)??a?.lastDecisive??null,Wr=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}:{}}),Pt=(e,s)=>e.status==="not_started"&&typeof e.tool_count=="number"&&(s.connectedAt!==null||e.status_basis==="stored"&&e.tool_count_basis==="last_seen"),Zr=(e,s)=>[...s].filter(a=>a.name===e).sort((a,i)=>i.created_at-a.created_at)[0]??null,Jr=(e,s)=>Zr(e,s.filter(a=>a.status!=="cancelled")),dt=e=>e.actions.includes("set_key")||e.actions.includes("add_key");function Xr(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 o=Math.round(i/60);return o<24?n("ui.settings.integrations.integration_model.hours_h_ago",{hours:o}):n("ui.settings.integrations.integration_model.days_ago",{days:Math.round(o/24)})}function yt(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 o=a.replace(/^(?:connection (?:closed|error|refused)|error|closed|failed)\s*:\s*/i,"").trim();if(o===a)break;a=o}return a=a.replace(/\s*\(\s*\d{3}\s*\)/g,"").replace(/\s+([.,;])/g,"$1").replace(/\s{2,}/g," ").trim(),a||null}function el(e,s=[],a,i=Date.now()){const o=Fe(a,e.name),r=Pe(e.name,s);if(r){if(r.action==="login"||r.action==="reauth")return{label:n("ui.settings.integrations.integration_model.signing_in"),tone:"info",detail:null,busy:!0};if(r.action==="logout")return{label:n("ui.settings.integrations.integration_model.signing_out"),tone:"info",detail:null,busy:!0}}if(!Dn(e.status))return{label:n("ui.settings.integrations.integration_model.status_unavailable"),tone:"neutral",detail:null,busy:!1};const d=Ge(e.name,s,o),_=ut(d)&&e.status!=="connected",c=Pt(e,o),g=$t(d)&&e.status!=="connected",f=(d?.action==="login"||d?.action==="reauth")&&d.status==="failed";if(o.disconnectedAt!==null)return{label:n("ui.settings.integrations.integration_model.not_connected"),tone:"neutral",detail:null,busy:!1};switch(e.status){case"connected":return{label:typeof e.tool_count=="number"?n("ui.settings.integrations.integration_model.connected_with_tools",{tools:String(at(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"||Be(e,s,o)?n("ui.settings.integrations.integration_model.needs_a_key"):n("ui.settings.integrations.integration_model.needs_sign_in"),tone:"warning",detail:yt(e.status_reason),busy:!1};case"error":return{label:n("ui.settings.integrations.integration_model.couldn_t_start"),tone:"danger",detail:yt(e.status_reason)??n("ui.settings.integrations.integration_model.no_reason_was_given"),busy:!1};default:if(_)return{label:n("ui.settings.integrations.integration_model.signed_out"),tone:"warning",detail:null,busy:!1};if(g)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(Be(e,s,o))return{label:n("ui.settings.integrations.integration_model.needs_a_key"),tone:"warning",detail:null,busy:!1};if(f)return{label:n("ui.settings.integrations.integration_model.sign_in_didn_t_finish"),tone:"warning",detail:null,busy:!1};if(o.needsSignIn)return{label:e.auth.kind==="api_key"||Be(e,s,o)?n("ui.settings.integrations.integration_model.needs_a_key"):n("ui.settings.integrations.integration_model.needs_sign_in"),tone:"warning",detail:yt(e.status_reason),busy:!1};if(e.status_basis==="stored"&&c&&o.disconnectedAt===null){const x=o.connectedAt??zn(e.last_seen_at,i);return{label:x!==null?n("ui.settings.integrations.integration_model.worked_when_with_tools",{when:String(Xr(i,x)),tools:String(at(e.tool_count))}):n("ui.settings.integrations.integration_model.worked_earlier_with_tools",{tools:String(at(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}:{label:n("ui.settings.integrations.integration_model.ready"),tone:"neutral",detail:null,busy:!1}}}const Pn=e=>n("ui.settings.integrations.integration_model.replace_keys",{count:e}),tl=/[,;]?\s*(?:or|and)?\s*add (?:its|a|the) key instead\.?\s*$/i;function nl(e,s){const a=e?.trim()??"";if(!a)return null;if(s)return a;const i=a.replace(tl,"").trim();return i?/\.$/.test(i)?i:`${i}.`:a}const sl="ui.settings.integrations.integration_model.copy_ready_explanation",al="ui.settings.integrations.integration_model.copy_not_connected_explanation",il=e=>e.transport==="local_command"?n("ui.settings.integrations.integration_model.local_command"):n("ui.settings.integrations.integration_model.remote_url");function Un(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 Fn(e.source.path)}}function ol(e,s){const a=[il(e)];e.status!=="connected"&&e.tool_count_basis==="last_seen"&&typeof e.tool_count=="number"&&a.push(n("ui.settings.integrations.integration_model.tools_when_last_checked",{tools:String(at(e.tool_count))})),s&&a.push(e.scope==="project"?n("ui.settings.integrations.integration_model.this_project"):n("ui.settings.integrations.integration_model.global"));const i=Un(e);return i?a.push(n("ui.settings.integrations.integration_model.imported_from_origin",{origin:String(i)})):e.source.editable||a.push(n("ui.settings.integrations.integration_model.imported_from_a_project_file")),a}const Ut=(e,s)=>s.disconnectedAt!==null?"not_started":e.status;function Kt(e,s=[],a){const i=Fe(a,e.name),o=Pe(e.name,s);if(o)return o.action==="login"||o.action==="reauth"?{kind:"sign_in",label:n("ui.settings.integrations.integration_model.continue_sign_in")}:null;const r=f=>e.actions.includes(f),d=dt(e),_=Be(e,s,i);if(!Dn(e.status))return r("test")?{kind:"test",label:n("ui.settings.integrations.integration_model.check_again")}:null;const c=Ge(e.name,s,i),g=c?.status==="failed"&&qe(c);switch(Ut(e,i)){case"connected":case"connecting":return null;case"needs_sign_in":return _?{kind:"set_key",label:n("ui.settings.integrations.integration_model.add_key")}:r("sign_in")?{kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")}:d?{kind:"set_key",label:n("ui.settings.integrations.integration_model.add_key")}:r("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 r("connect")?{kind:"connect",label:n("ui.settings.integrations.integration_model.reconnect")}:r("test")?{kind:"test",label:n("ui.settings.integrations.integration_model.retry")}:{kind:"fix",label:n("ui.settings.integrations.integration_model.fix")};default:{if(ut(c)&&r("sign_in"))return{kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")};if($t(c)&&r("sign_out"))return{kind:"sign_out",label:n("ui.settings.integrations.integration_model.sign_out_again")};if(i.disconnectedAt!==null&&r("connect"))return{kind:"connect",label:n("ui.settings.integrations.integration_model.connect")};if(i.needsSignIn){if(_&&d)return{kind:"set_key",label:n("ui.settings.integrations.integration_model.add_key")};if(r("sign_in"))return{kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")}}return _&&d?{kind:"set_key",label:n("ui.settings.integrations.integration_model.add_key")}:g&&r("sign_in")?{kind:"sign_in",label:n("ui.settings.integrations.integration_model.try_again")}:Pt(e,i)&&!r("connect")?null:r("connect")?{kind:"connect",label:n("ui.settings.integrations.integration_model.connect"),...i.connectedAt===null&&e.status_basis!=="live"?{variant:"ghost"}:{}}:r("test")&&e.tool_count===null&&e.tool_count_basis===null?{kind:"test",label:n("ui.settings.integrations.integration_model.test"),variant:"ghost"}:null}}}const qe=e=>e.action==="login"||e.action==="reauth",ut=e=>!!(e&&e.action==="logout"&&e.status==="complete"),$t=e=>!!(e&&e.action==="logout"&&e.status!=="running"&&e.status!=="complete"),Kn=/no oauth authorization server/i;function Be(e,s,a){if(!dt(e))return!1;const i=Ge(e.name,s,a);return i&&qe(i)&&i.status==="failed"&&Kn.test(i.message??"")?!0:a.needsKey}function rl(e,s=[],a){const i=Kt(e,s,a)?.kind,o=Ut(e,Fe(a,e.name)),r=c=>e.actions.includes(c),d=[],_=Pe(e.name,s);if(_&&d.push({kind:"cancel",label:n("ui.settings.integrations.integration_model.cancel")}),!_&&r("test")&&i!=="test"&&d.push({kind:"test",label:n("ui.settings.integrations.integration_model.test_connection")}),r("connect")&&i!=="connect"&&o!=="connected"&&d.push({kind:"connect",label:n("ui.settings.integrations.integration_model.reconnect")}),!_&&r("sign_in")&&i!=="sign_in"&&o!=="connected"&&d.push({kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")}),r("reload")&&d.push({kind:"reload",label:n("ui.settings.integrations.integration_model.reload")}),!_&&r("reauth")&&i!=="reauth"&&d.push({kind:"reauth",label:n("ui.settings.integrations.integration_model.sign_in_again")}),dt(e)&&i!=="set_key"&&d.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")}),r("sign_out")&&d.push({kind:"sign_out",label:n("ui.settings.integrations.integration_model.sign_out")}),r("disconnect")&&o==="connected"&&d.push({kind:"disconnect",label:n("ui.settings.integrations.integration_model.disconnect")}),r("copy_setup")&&e.setup_prompt&&d.push({kind:"copy_setup",label:n("ui.settings.integrations.integration_model.copy_setup_prompt")}),i!=="fix"&&d.push({kind:"open_config",label:n("ui.settings.integrations.integration_model.open_config_file")}),r("remove"))d.push({kind:"remove",label:n("ui.settings.integrations.integration_model.remove"),destructive:!0});else if(!e.source.editable){const c=Un(e);d.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 d}const ll={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 $n(e,s=[],a){const i=Fe(a,e.name),o=Pe(e.name,s),r=Ut(e,i);if(o&&i.pinnedGroup&&i.pinnedOperationId===o.id)return i.pinnedGroup;if(r==="needs_sign_in"||r==="error")return"attention";const d=Ge(e.name,s,i);return ut(d)&&r!=="connected"||$t(d)&&r!=="connected"?"attention":i.disconnectedAt!==null?"ready":Be(e,s,i)||i.needsSignIn&&r!=="connected"||d?.status==="failed"&&qe(d)&&r!=="connected"?"attention":r==="connected"||e.status_basis==="stored"&&Pt(e,i)?"connected":o&&o.action!=="test"?"attention":"ready"}function cl(e,s=[],a){return["attention","connected","ready"].map(o=>({id:o,title:ll[o],rows:e.filter(r=>$n(r,s,a)===o)})).filter(o=>o.rows.length>0)}function dl(e,s,a=Date.now()){if(!s)return e??{};const i={};for(const o of s.servers){const r=Fe(e,o.name),d=Pe(o.name,s.operations),_=Ge(o.name,s.operations,r),c=ut(_),g=o.status==="connected"&&(o.status_basis==="probe"||o.status_basis==="live"),f=r.holdUntil!==null&&a<r.holdUntil,x=!f&&!c&&r.connectedAt===null&&o.status_basis==="stored"&&o.tool_count_basis==="last_seen"?zn(o.last_seen_at,a):null,y=!c,m=_?.status==="failed"&&qe(_)&&Kn.test(_.message??""),h={connectedAt:g&&!f?a:x!==null?x:y?r.connectedAt:null,connectedToolCount:g&&!f||x!==null?o.tool_count??r.connectedToolCount:y?r.connectedToolCount:null,settledGroup:r.settledGroup,pinnedGroup:d&&r.pinnedOperationId===d.id?r.pinnedGroup:d?r.settledGroup:null,pinnedOperationId:d?d.id:null,needsKey:g?!1:r.needsKey||m,needsSignIn:g||c?!1:r.needsSignIn||o.status==="needs_sign_in",disconnectedAt:g&&!f?null:r.disconnectedAt,holdUntil:f?r.holdUntil:null,lastDecisive:_?Wr(_):null};d||(h.settledGroup=$n(o,s.operations,{...i,[o.name]:h})),i[o.name]=h}return i}const ul=(e,s)=>e!==null&&s===e,Et="local-operator.settings.integrations.row-memory",Bn=(e,s)=>`${e}#${s}`;function gl(e,s){const a={};if(!s)return a;for(const i of s.servers){const o=e[i.name];o&&(a[Bn(i.source.path,i.name)]=o)}return a}function _l(e,s,a){if(!s)return e;let i=null;for(const o of s.servers){if(Object.prototype.hasOwnProperty.call(e,o.name))continue;const r=hl(a[Bn(o.source.path,o.name)]);r&&(i=i??{...e},i[o.name]=r)}return i??e}const ml=["attention","connected","ready"],Hn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Bt=e=>typeof e=="number"&&Number.isFinite(e)?e:null,an=e=>ml.includes(e)?e:null,xt=e=>{const s=Bt(e);return s!==null&&s>=1e12?s:null};function pl(e){if(!Hn(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:Bt(e.created_at)??0,credential_removed:e.credential_removed===!0,...typeof e.message=="string"?{message:e.message}:{}}}function hl(e){if(!Hn(e))return null;const s=xt(e.connectedAt),a=xt(e.disconnectedAt),i=e.needsKey===!0,o=e.needsSignIn===!0,r=pl(e.lastDecisive);return s===null&&a===null&&!i&&!o&&!r?null:{connectedAt:s,connectedToolCount:Bt(e.connectedToolCount),settledGroup:an(e.settledGroup),pinnedGroup:an(e.pinnedGroup),pinnedOperationId:typeof e.pinnedOperationId=="string"?e.pinnedOperationId:null,needsKey:i,needsSignIn:o,disconnectedAt:a,holdUntil:xt(e.holdUntil),lastDecisive:r}}const Vn=2e3,on=8e3;function fl(e){return e&&(e.servers.some(a=>a.status==="connecting")||e.operations.some(a=>a.status==="running"))?Vn:!1}const yl=/^[A-Za-z0-9_.:-]{1,100}$/,xl=/:\/\//;function kl(e,s){const a=e.trim();return a?yl.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 vl(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"):xl.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 bl=e=>e.split(`
|
|
292
|
-
`).map(s=>s.trim()).filter(Boolean);function Rt(e,s){const a=!!e?.cold,i=(e?.servers??[]).map(o=>{const r=o.transport==="http",d=o.secret_refs??[],_=o.status==="connected"?"connected":o.status==="connecting"?"connecting":o.status==="auth-required"?"needs_sign_in":"not_started",c=[];_!=="connected"&&c.push("connect"),_==="connected"&&c.push("disconnect"),a||c.push("reload"),r&&o.transport_oauth_supported!==!1&&c.push("sign_in"),d.length>0&&c.push("set_key"),o.owned_scope&&c.push("remove"),o.setup?.text&&c.push("copy_setup");const g=Fn(o.source);return{id:o.name,name:o.name,scope:o.owned_scope??"global",project_cwd:null,source:{kind:wl(o.source,g,o.owned_scope),path:o.source??"",editable:o.owned_scope!==null,owned_scope:o.owned_scope},transport:r?"remote_url":"local_command",endpoint:{command:null,url:null,endpoint_redacted:!1},status:_,status_reason:null,status_observed_at:null,last_seen_at:null,status_basis:a?"stored":"live",auth:{kind:d.length?"api_key":r?"unknown":"none",signed_in:null,secret_refs:d.map(f=>({id:f.id,state:"missing"}))},tool_count:typeof o.tool_count=="number"?o.tool_count:null,tool_count_basis:typeof o.tool_count=="number"?"live":null,actions:c,setup_prompt:o.setup?.text??null}});return{cwd:"",project_scope_available:i.some(o=>o.source.owned_scope==="project"),global_path:"",project_path:null,status_source:a?"config":"live",session_id:s,servers:i,operations:(e?.operations??[]).map(o=>({...o}))}}const wl=(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",rn={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")}},jl="ui.settings.integrations.integration_model.copy_catalog_refusal_fallback";function Xe(e,s,a){if(s instanceof Dt&&s.status===409){const i=typeof s.code=="string"&&Object.prototype.hasOwnProperty.call(rn,s.code)?rn[s.code]:n(jl);return`${js[e]}. ${i}`}return Ns(e,s,a).message}const Nl="ui.settings.integrations.add_integration_form.copy_add_integration_pickup_note",Sl="ui.settings.integrations.add_integration_form.copy_transport_hint",Cl=({existingNames:e,projectScopeAvailable:s,projectLabel:a,onSubmit:i,onCancel:o,initial:r})=>{Q();const[d,_]=l.useState(r?.name??""),[c,g]=l.useState(r?.mode??"command"),[f,x]=l.useState(r?.command??""),[y,m]=l.useState(r?.args??""),[h,A]=l.useState(r?.url??""),[C,H]=l.useState("global"),[N,K]=l.useState(r?.touched?{name:!0,command:!0,url:!0}:{}),[D,E]=l.useState(!!r?.touched),[M,Z]=l.useState(!1),[J,X]=l.useState(null),I=l.useRef(null),se=l.useRef(null),U=l.useRef(null);l.useEffect(()=>{I.current?.focus()},[]);const L=kl(d,e),$=c==="command"&&!f.trim()?n("ui.settings.integrations.add_integration_form.enter_the_command_to_run"):null,V=c==="url"?vl(h):null,R=j=>D||N[j],ee=async j=>{if(j.preventDefault(),E(!0),L||$||V){L?I.current?.focus():$?se.current?.focus():U.current?.focus();return}Z(!0),X(null);const q=s?C:"global",T=c==="command"?{name:d.trim(),scope:q,mode:c,command:f.trim(),args:bl(y)}:{name:d.trim(),scope:q,mode:c,url:h.trim()},W=await i(T);Z(!1),X(W)},p=(j,q,T)=>q&&R(T)?t.jsx("p",{id:j,className:"text-body-sm text-danger",children:q}):null,F=j=>j.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:j=>void ee(j),onKeyDown:j=>{j.key==="Escape"&&(j.stopPropagation(),o())},children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ve,{htmlFor:"integration-add-name",children:n("ui.settings.integrations.add_integration_form.name")}),t.jsx(Oe,{ref:I,id:"integration-add-name",value:d,placeholder:n("ui.settings.integrations.add_integration_form.e_g_notion"),autoComplete:"off","aria-invalid":!!(L&&R("name")),"aria-describedby":L&&R("name")?"integration-add-name-error":void 0,onChange:j=>_(j.target.value),onBlur:()=>K(j=>({...j,name:!0}))}),p("integration-add-name-error",L,"name")]}),t.jsxs(ot,{value:c,onValueChange:j=>g(j==="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(rt,{"aria-labelledby":"integration-add-transport-label",children:[t.jsx(ze,{value:"command","data-integration-transport":"command",children:n("ui.settings.integrations.add_integration_form.local_command")}),t.jsx(ze,{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(Sl)}),t.jsxs(Jt,{value:"command",className:"mt-0 flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ve,{htmlFor:"integration-add-command",children:n("ui.settings.integrations.add_integration_form.command")}),t.jsx(Oe,{ref:se,id:"integration-add-command",value:f,placeholder:n("ui.settings.integrations.add_integration_form.e_g_npx"),autoComplete:"off",className:"font-mono","aria-invalid":!!($&&R("command")),"aria-describedby":$&&R("command")?"integration-add-command-error":void 0,onChange:j=>x(j.target.value),onBlur:()=>K(j=>({...j,command:!0}))}),p("integration-add-command-error",$,"command")]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs(ve,{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(En,{id:"integration-add-args",value:y,rows:2,className:"font-mono",onChange:j=>m(j.target.value)})]})]}),t.jsx(Jt,{value:"url",className:"mt-0 flex flex-col gap-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ve,{htmlFor:"integration-add-url",children:n("ui.settings.integrations.add_integration_form.url")}),t.jsx(Oe,{ref:U,id:"integration-add-url",type:"url",value:h,placeholder:n("ui.settings.integrations.add_integration_form.https_mcp_example_com_mcp"),autoComplete:"off",className:"font-mono","aria-invalid":!!(V&&R("url")),"aria-describedby":V&&R("url")?"integration-add-url-error":"integration-add-url-help",onChange:j=>A(j.target.value),onBlur:()=>K(j=>({...j,url:!0}))}),p("integration-add-url-error",V,"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(ot,{value:C,onValueChange:j=>H(j==="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(rt,{"aria-labelledby":"integration-add-scope-label",children:[t.jsx(ze,{value:"global","data-integration-scope":"global",children:n("ui.settings.integrations.add_integration_form.all_chats")}),t.jsx(ze,{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:C==="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,J?t.jsx("p",{className:"text-body-sm text-danger",role:"alert",children:J}):null,t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("p",{className:de("text-body-sm text-ink-dim"),children:n(Nl)}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(B,{type:"button",variant:"ghost",size:"md",onMouseDown:F,onClick:o,children:n("ui.settings.integrations.add_integration_form.cancel")}),t.jsxs(B,{type:"submit",variant:"primary",size:"md",disabled:M,onMouseDown:F,children:[M?t.jsx(ue,{size:"xs"}):null,n("ui.settings.integrations.add_integration_form.add_integration")]})]})]})]})},Ml=4;function Al(e){return e.rowMoving?e.now+e.windowMs:Math.max(e.hold.until,e.lastMovingAt+e.windowMs)}function El(e){return e.now>e.hold.until||e.hold.reanchors>=Ml?"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 Rl(e){const s=Al({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 o=El({hold:{until:s,reanchors:e.hold.reanchors,landedOn:a},candidate:i,active:e.active,body:e.body,now:e.now});if(o==="settled")return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:a},land:null};if(o==="drop")return{hold:null,land:null};const r=!a.isConnected;return{hold:{until:r?e.now+e.windowMs:s,reanchors:r?e.hold.reanchors+1:e.hold.reanchors,landedOn:i},land:i}}function Tl(e){const{row:s,target:a}=e;return!s||!a||typeof a.nodeType!="number"?!1:!s.contains(a)}const ln=250;function cn(e){return e?!e.disabled:!1}function Il(e){return cn(e.primary)?e.primary??null:cn(e.overflow)?e.overflow??null:null}function Ll(e){return e.verdict==="finished"?null:e.watchMs}const Gn="key";function Ol(e){const{name:s,keyless:a,freeName:i,names:o,values:r,replace:d,canReplace:_}=e;if(a){const c=Tt(s,i);return{values:{[c]:(r[Gn]??"").trim()},confirmedReplace:d&&_?[c]:[],header:i.trim()}}return{values:Object.fromEntries(o.map(c=>[c,(r[c]??"").trim()])),confirmedReplace:d&&_?o:[],header:void 0}}function Tt(e,s){const a=dn(e),i=dn(s);if(!i)return"";const o=[a,i].filter(Boolean).join("_"),r=/^[A-Za-z_]/.test(o)?o:`K_${o}`;if(r.length<=kt)return r;const d=Fl(a),_=kt-i.length-d.length-2,c=[a.slice(0,Math.max(_,0)),d,i].filter(Boolean).join("_");return c.length<=kt?c:c.slice(-128)}const kt=128,dn=e=>e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,""),Fl=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)},Dl=({name:e,keyNames:s,keyless:a=!1,savedKeys:i=[],saving:o,failure:r,onSave:d,onClose:_})=>{Q();const[c,g]=l.useState({}),[f,x]=l.useState(!1),[y,m]=l.useState(""),h=a?[Tt(e,y)]:[...s],A=a?[Gn]:h,C=(a?Tt(e,y).length>0:!0)&&A.every(N=>(c[N]??"").trim()),H=h.some(N=>i.includes(N));return t.jsx(vn,{open:!0,onClose:_,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(Nt,{onClick:_,children:n("ui.settings.integrations.integration_key_dialog.cancel")}),t.jsx(St,{disabled:!C||o,onClick:()=>{const N=Ol({name:e,keyless:a,freeName:y,names:h,values:c,replace:f,canReplace:H});d(N.values,N.confirmedReplace,N.header)},children:o?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(ve,{htmlFor:"integration-key-name",children:n("ui.settings.integrations.integration_key_dialog.the_header_this_server_wants_the_key_in")}),t.jsx(Oe,{id:"integration-key-name",autoComplete:"off",placeholder:n("ui.settings.integrations.integration_key_dialog.e_g_authorization_or_x_api_key"),value:y,onChange:N=>m(N.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,A.filter(N=>a!==!0||N.trim().length>0).map(N=>t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(ve,{htmlFor:`integration-key-${N}`,className:"font-mono",children:a?"Key":N}),t.jsx(Oe,{id:`integration-key-${N}`,type:"password",autoComplete:"off",value:c[N]??"",onChange:K=>g(D=>({...D,[N]:K.target.value}))})]},N)),H?t.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[t.jsx(Ga,{id:"integration-key-replace",checked:f,onCheckedChange:N=>x(N===!0)}),t.jsx(ve,{htmlFor:"integration-key-replace",className:"font-normal",children:Pn(h.length)})]}):null,r?t.jsx("p",{className:"-mx-1.5 text-body-sm text-danger",role:"alert",children:r}):null]})})},zl={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",neutral:"bg-ink-dim"},Pl={success:"text-ink-muted",warning:"text-warning",danger:"text-danger",info:"text-ink-muted",neutral:"text-ink-dim"};function un(e){if(e===n("ui.settings.integrations.integration_model.ready"))return n(sl);if(e===n("ui.settings.integrations.integration_model.not_connected"))return n(al)}const Ul=({row:e,operations:s,memories:a,now:i,projectScopeAvailable:o,highlighted:r=!1,rowRef:d,primaryRef:_,overflowRef:c,pending:g,failure:f,confirm:x,onPrimary:y,onOverflow:m,onConfirm:h,onCancelConfirm:A})=>{Q();const C=el(e,s,a,i),H=r&&C.tone==="danger"?"text-ink":Pl[C.tone],N=Kt(e,s,a),K=rl(e,s,a),D=ol(e,o),E=K.findIndex(M=>M.kind==="remove"||M.kind==="remove_elsewhere");return t.jsxs("li",{ref:d,"data-integration":e.name,"data-status":e.status,className:de("flex min-h-14 flex-col justify-center gap-1 px-4 py-2.5",r&&"bg-row-selected"),onKeyDown:M=>{!x||M.key!=="Escape"||(M.stopPropagation(),A())},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:C.busy?t.jsx(ue,{size:"xs"}):t.jsx("span",{"aria-hidden":"true","data-tone":C.tone,className:de("size-2 rounded-full",zl[C.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:D.map((M,Z)=>t.jsxs("span",{children:[Z>0?" · ":null,M.startsWith("Imported from")&&e.source.path?t.jsx(He,{content:Ss(e.source.path),children:t.jsx("span",{className:"underline decoration-dotted underline-offset-2",children:M})}):M]},M))})]}),un(C.label)?t.jsx(He,{content:un(C.label),children:t.jsx("span",{className:de("shrink-0 text-body-sm",H),children:C.label})}):t.jsx("span",{className:de("shrink-0 text-body-sm",H),children:C.label}),N?t.jsxs(B,{ref:_,variant:N.variant??"secondary",size:"sm","aria-label":`${N.label} ${e.name}`,disabled:g,"data-integration-action":N.kind,onClick:()=>y(N),children:[g?t.jsx(ue,{size:"xs"}):null,N.label]}):null,t.jsxs(qa,{children:[t.jsx(Ya,{asChild:!0,children:t.jsx(B,{ref:c,variant:"ghost",size:"icon-sm","aria-label":n("ui.settings.integrations.integration_row.more_actions_for_name",{name:String(e.name)}),disabled:g,children:t.jsx(Cs,{"aria-hidden":"true"})})}),t.jsx(Qa,{align:"end",className:"min-w-48",children:K.map((M,Z)=>t.jsx(Kl,{item:M,separated:Z===E&&Z>0,onSelect:()=>m(M)},M.kind))})]})]}),C.detail?t.jsx("p",{className:de("pl-7 text-body-sm",C.tone==="danger"?"text-ink-muted":"text-ink-dim"),children:C.detail}):null,f?t.jsx("p",{className:de("pl-7 text-body-sm",r?"text-ink":"text-danger"),role:"alert",children:f}):null,x?t.jsxs("div",{className:"flex flex-wrap items-center gap-2 pl-7",children:[t.jsx("span",{className:"text-body-sm text-ink",children:x.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:x.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(B,{variant:"danger",size:"sm",onClick:h,"data-integration-confirm":x.kind,children:x.kind==="remove"?n("ui.settings.integrations.integration_row.remove"):n("ui.settings.integrations.integration_row.sign_out")}),t.jsx(B,{variant:"ghost",size:"sm",onClick:A,children:n("ui.settings.integrations.integration_row.keep")})]}):null]})},Kl=({item:e,separated:s,onSelect:a})=>(Q(),t.jsxs(t.Fragment,{children:[s?t.jsx(Wa,{}):null,e.kind==="remove_elsewhere"?t.jsxs(Xt,{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(Xt,{destructive:e.kind==="remove",onSelect:a,"data-integration-menu":e.kind,children:e.label})]}));function $l(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:nl(s.message,a)??n("ui.settings.integrations.integration_sign_in_dialog.the_server_didn_t_say_why"),nextStep:Bl(s.message??null,a)}}function Bl(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 Hl(e,s){return e.kind==="ready"?"ready":e.kind==="running"&&s&&s.tone!=="progress"?s.tone==="success"?"success":"failure":"running"}const Vl=({name:e,action:s,keyRoute:a,phase:i,onStart:o,onCancel:r,onOpenLink:d,onClose:_})=>{Q();const c=i.kind==="running"?i.operation:null,g=i.kind==="running"?$l(e,c,a):null,f=i.kind==="starting"||i.kind==="running"&&g?.tone==="progress",x=g&&g.tone!=="progress",y=l.useRef(null),m=l.useRef(!1),h=Hl(i,g);l.useEffect(()=>{if(!m.current){m.current=!0;return}h&&y.current?.focus()},[h]);const A=()=>_(g?.tone==="success"?"signed-in":"dismissed");return t.jsx(vn,{open:!0,onClose:A,maxWidth:"xs",fullWidth:!0,title:n("ui.settings.integrations.integration_sign_in_dialog.sign_in_to_name",{name:String(e)}),dialogProps:{onOpenAutoFocus:C=>{C.preventDefault(),y.current?.focus()}},actions:t.jsxs(t.Fragment,{children:[f&&c?t.jsx(Nt,{ref:y,onClick:()=>r(c.id),children:n("ui.settings.integrations.integration_sign_in_dialog.cancel_sign_in")}):t.jsx(Nt,{ref:i.kind==="ready"?void 0:y,onClick:A,children:g?.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(St,{ref:y,onClick:o,children:n("ui.settings.integrations.integration_sign_in_dialog.continue_in_browser")}):null,i.kind==="refused"||g?.tone==="failure"?t.jsx(St,{ref:g?.tone==="failure"?y:void 0,onClick:o,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(ue,{size:"xs"}),n("ui.settings.integrations.integration_sign_in_dialog.starting_sign_in")]}):null,g?t.jsxs("div",{className:"flex flex-col gap-1",role:x?"status":void 0,children:[t.jsxs("p",{className:(g.tone==="success","-mx-1.5 flex items-start gap-2 text-ink"),children:[g.tone==="progress"?t.jsx(ue,{size:"xs",className:"mt-0.5"}):null,g.tone==="failure"?t.jsx(Za,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0 text-danger"}):null,t.jsx("span",{children:g.message})]}),g.reason?t.jsx("p",{className:"-mx-1.5 text-ink-muted",children:g.reason}):null,g.nextStep?t.jsx("p",{className:"-mx-1.5 text-ink-muted",children:g.nextStep}):null]}):null,g?.link&&g.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:g.link,children:g.link}),t.jsx(B,{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(g.link??"").then(()=>Ct(n("ui.settings.integrations.integration_sign_in_dialog.sign_in_link_copied"))).catch(()=>{})},children:t.jsx(Ms,{"aria-hidden":"true"})})]}),t.jsx(B,{variant:"link",size:"sm",onClick:()=>d(g.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]})})},Gl=e=>e.reduce((s,a)=>s?(a.updated_at??0)>(s.updated_at??0)?a:s:a,null),ql=/^[A-Za-z]:[\\/]/,it=e=>{const s=e?.trim();return s&&(s.startsWith("/")||ql.test(s))?s:null};function Yl(e){const o=e?.payload?.frontend?.snapshot?.cwd;return typeof o=="string"&&o.trim()?o:null}const Ve="local-operator.settings.integrations.last-cwd";function Ql(e,s,a=typeof localStorage>"u"?null:localStorage){const i=it(s);if(!(!e||!i||!a))try{const o=a.getItem(Ve),r=o?JSON.parse(o):{};if(r[e]===i)return;a.setItem(Ve,JSON.stringify({...r,[e]:i}))}catch{}}const qn=()=>typeof localStorage>"u"?null:localStorage;function Yn(e=qn()){if(!e)return{};try{const s=e.getItem(Et);if(!s)return{};const a=JSON.parse(s);return!a||typeof a!="object"||Array.isArray(a)?{}:a}catch{return{}}}const gn=256;function Wl(e,s=qn()){if(s)try{const a={...Yn(s),...e},i=Object.keys(a);if(i.length>gn){const o={};for(const r of i.slice(-gn))o[r]=a[r];s.setItem(Et,JSON.stringify(o));return}s.setItem(Et,JSON.stringify(a))}catch{}}function _n(e,s,a){if(e==="saved")return null;if(e==="replace_confirmation_required"){const o=Pn(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(o)})}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 Zl(e,s=typeof localStorage>"u"?null:localStorage){if(!(!e||!s))try{const a=s.getItem(Ve);if(!a)return;const i=JSON.parse(a);if(!(e in i))return;const o={...i};delete o[e],s.setItem(Ve,JSON.stringify(o))}catch{}}const Jl=e=>!!(e&&typeof e=="object"&&"code"in e&&e.code==="invalid_cwd"),Xl=(e,s)=>s!==null&&e===s?null:e;function ec(e,s=typeof localStorage>"u"?null:localStorage){if(!e||!s)return null;try{const a=s.getItem(Ve);if(!a)return null;const o=JSON.parse(a)[e];return typeof o=="string"?o:null}catch{return null}}const tc=e=>e.action==="disconnect"?"disconnected":"connected";function nc(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 sc(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 ac({sessionId:e}){const s=Ft(),a=wt(s.data,"mcp_catalog"),i=wt(s.data,"mcp"),o=a?"catalog":i?"session":null,[r,d]=l.useState(null),_=Lt(),c=tt(v=>v.sessions),g=tt(v=>v.fetchSessions),f=tt(v=>v.loading),x=l.useMemo(()=>c.find(v=>v.session_id===e)??null,[c,e]),y=l.useMemo(()=>o==="session"&&!e?Gl(c):null,[o,e,c]),m=o==="session"?e??y?.session_id??null:null;l.useEffect(()=>{o!=="session"||e||c.length>0||g(As)},[o,e,c.length,g]);const h=o==="catalog"?it(x?.cwd):null,A=o==="catalog"&&!!e&&h===null,C=xe({queryKey:["desktop","session-cwd",e??""],queryFn:()=>ye({op:"sessions.get",sessionId:e??""}),enabled:A,staleTime:Number.POSITIVE_INFINITY,retry:!1}),H=A&&!C.isFetched,N=h??it(Yl(C.data))??(C.isFetched?it(ec(e)):null),K=Xl(N,r),D=o==="catalog"?K:null,E=o==="catalog"?e??null:null,M=Es.catalog(D,E);l.useEffect(()=>{o!=="catalog"||!e||!D||Ql(e,D)},[o,e,D]);const Z=l.useRef(0),[J,X]=l.useState(0),I=l.useRef(null),se=l.useCallback((v,O)=>{const P=Date.now()+on;Z.current=P,I.current={name:v,expect:O},X(P)},[]),U=l.useCallback(v=>Date.now()<Z.current?Vn:fl(v),[]),L=xe({queryKey:M,queryFn:()=>Is(D,E),enabled:o==="catalog"&&!H,staleTime:1e4,refetchInterval:v=>U(v.state.data)}),$=Jl(L.error);l.useEffect(()=>{!$||!N||r===N||(d(N),Zl(e))},[$,N,r,e]);const V=xe({queryKey:Mt.list(m??""),queryFn:()=>Ls(m??""),enabled:o==="session"&&!!m,staleTime:1e4,refetchInterval:v=>U(v.state.data?Rt(v.state.data,m??""):void 0)}),R=l.useMemo(()=>{if(o==="catalog")return L.data;if(o==="session"&&V.data&&m)return Rt(V.data,m)},[o,L.data,V.data,m]),ee=l.useCallback(()=>ic({queryClient:_,route:o,catalogKey:M,sessionId:m}),[o,M,_,m]);l.useEffect(()=>{if(!J)return;const v=I.current;if(!v)return;const O=R?.servers.find(ne=>ne.name===v.name);!O||!(v.expect==="connected"?O.status==="connected":O.status_basis==="live"&&O.status!=="connected")||(Z.current=0,I.current=null,X(0))},[R,J]);const p=l.useRef({}),[F,j]=l.useState(0),q=l.useMemo(()=>(p.current=dl(_l(p.current,R,Yn()),R),p.current),[R,F]),T=l.useRef("");l.useEffect(()=>{const v=gl(q,R);if(!Object.keys(v).length)return;const O=JSON.stringify(v);O!==T.current&&(T.current=O,Wl(v))},[q,R]);const W=l.useCallback(v=>{const O=Fe(p.current,v);O.needsKey||(p.current={...p.current,[v]:{...O,needsKey:!0}},j(P=>P+1))},[]),z=l.useCallback(v=>{if(v.action!=="disconnect"&&v.action!=="connect"&&v.action!=="reload")return;const O=Fe(p.current,v.name),P=Date.now()+on,ne=v.action==="disconnect"?{...O,connectedAt:null,disconnectedAt:Date.now(),holdUntil:P}:{...O,disconnectedAt:null,holdUntil:P};p.current={...p.current,[v.name]:ne},se(v.name,tc(v)),j(w=>w+1)},[se]),te=l.useCallback(async v=>{if(o==="catalog"){const O=nc(v);if(!O)return null;try{const P=await Rs(D,O);return _.setQueryData(M,P),z(v),P.operation?.id??null}catch(P){throw P instanceof Dt&&P.status===409&&_.invalidateQueries({queryKey:M}),P}}if(o==="session"&&m){const O=await ye({op:"mcp.control",sessionId:m,control:sc(v)});z(v);const P=Mt.list(m),ne=O?.data;return ne&&"servers"in ne&&Array.isArray(ne.servers)?(_.setQueryData(P,ne),null):(_.invalidateQueries({queryKey:P}),ne&&"id"in ne&&typeof ne.id=="string"?ne.id:null)}return null},[o,D,M,_,m,z]),Se=l.useCallback(async v=>{if(o==="catalog"&&E&&(v.action==="connect"||v.action==="disconnect"||v.action==="reload")){try{await ye({op:"mcp.control",sessionId:E,control:{action:v.action,name:v.name,...v.action==="disconnect"?{confirmed:!0}:{}}})}catch(O){throw _.invalidateQueries({queryKey:M}),O}return z(v),await _.invalidateQueries({queryKey:M}),null}return te(v)},[o,E,_,M,te,z]),ge=l.useCallback(async(v,O,P,ne)=>{if(o==="catalog"){const w=await Ts(D,v,O,P,ne);if(w.catalog&&_.setQueryData(M,w.catalog),w.code!=="saved")return{saved:!1,message:_n(w.code,w.failed_ids,O)};try{await te({action:"test",name:v})}catch{}return{saved:!0,message:null}}if(o==="session"&&m){const w=await ye({op:"mcp.credentials.store",sessionId:m,name:v,values:O,confirmedReplace:P});if(w.data?.code!=="saved")return{saved:!1,message:_n(w.data?.code,w.data?.failed_ids??[],O)};try{await te({action:"connect",name:v})}catch{}return{saved:!0,message:null}}return{saved:!1,message:null}},[o,D,M,_,te,m]),pe=o==="catalog"?L:V,Ce=l.useCallback(()=>{pe.refetch()},[pe]);return{enabled:o!==null,route:o,sessionId:o==="catalog"?E:m,borrowed:y,noConversation:o==="session"&&!m&&!f,document:R,isLoading:s.isLoading||o==="catalog"&&(H||L.isLoading)||o==="session"&&(m?V.isLoading:f),isError:pe.isError,folderUnavailable:ul(r,N),refetch:Ce,readDocument:ee,control:Se,storeKeys:ge,memories:q,markNeedsKey:W}}function ic(e){if(e.route==="catalog")return e.queryClient.getQueryData(e.catalogKey);if(e.route==="session"&&e.sessionId){const s=e.queryClient.getQueryData(Mt.list(e.sessionId));return s?Rt(s,e.sessionId):void 0}}const oc=(e,s)=>{const a=e?.trim();if(!a)return null;const i=zs(a,s);return i.kind==="auth"?{kind:"matched",name:i.name,unresolved:null}:{kind:"miss",asked:a}},rc=6,vt="ui.settings.integrations.mcp_management_section.copy_section_title",lc="ui.settings.integrations.mcp_management_section.copy_section_description",cc={test:"test",connect:"reconnect",disconnect:"disconnect",reload:"reload",remove:"remove",sign_out:"disconnect",cancel:"cancel",login:"grant",reauth:"grant"},dc=({sessionId:e,sectionRef:s,highlightServer:a})=>{Q();const i=ac({sessionId:e}),{document:o,control:r,readDocument:d}=i,_=Os(),c=o?.servers??[],g=o?.operations??[],f=o?.project_scope_available??!1,[x,y]=l.useState(!1),[m,h]=l.useState(""),[A,C]=l.useState(null),[H,N]=l.useState({}),[K,D]=l.useState(null),[E,M]=l.useState(null),[Z,J]=l.useState({kind:"ready"}),[X,I]=l.useState(null),[se,U]=l.useState(null),[L,$]=l.useState(!1),V=l.useRef({}),R=l.useRef({}),ee=l.useRef({}),p=l.useRef(0),F=l.useRef(null),j=l.useRef(null),q=l.useRef(null),[T,W]=l.useState(null),[z,te]=l.useState(null),[Se,ge]=l.useState(null),pe=l.useCallback(()=>{const u=q.current;q.current=null,M(null),I(null),window.setTimeout(()=>{u?.isConnected&&u.focus()},0)},[]),Ce=l.useCallback(u=>{const k=window.document.activeElement;q.current=k instanceof HTMLElement?k:null,M(u)},[]),v=l.useCallback((u,k)=>{te({name:u,waitForSignIn:k==="signed-in",until:Date.now()+$e,reanchors:0}),pe()},[pe]),O=l.useMemo(()=>oc(a,c.map(u=>u.name)),[a,c]),P=O?.kind==="matched"?O.name:null,ne=l.useRef(null),w=l.useRef(null),ae=m.trim().toLowerCase(),Y=l.useMemo(()=>ae?c.filter(u=>u.name.toLowerCase().includes(ae)):c,[c,ae]),_e=cl(Y,g,i.memories),he=E?.kind==="sign_in"?c.find(u=>u.name===E.name)??null:null;l.useEffect(()=>{!P||w.current===P||!m||h("")},[P,m]),l.useEffect(()=>{!P||w.current===P||Y.some(u=>u.name===P)&&(w.current=P,ne.current?.scrollIntoView({block:"center",behavior:"smooth"}))},[P,Y]),l.useEffect(()=>{if(!X)return;const u=g.find(k=>k.id===X)??null;J({kind:"running",operation:u})},[g,X]);const re=g.some(u=>u.status==="running"),Me=u=>{const k=window.document.activeElement;k&&k!==window.document.body&&k.isConnected||te({name:u,waitForSignIn:!1,until:Date.now()+$e,reanchors:0})},le=async(u,k,S)=>{C(u),N(({[u]:Re,...Te})=>Te);let G=null,fe=!1;try{G=await S()}catch(Re){fe=!0,N(Te=>({...Te,[u]:Xe(cc[k]??"status",Re,re)}))}finally{C(null),k!=="sign_out"&&(k!=="remove"||fe)&&Me(u)}return{operationId:G,failed:fe}},Ae=u=>c.find(k=>k.name===u),me=u=>{u.source.path&&Ps(u.source.path)},ke=async(u,k)=>{J({kind:"starting"}),I(null);try{const S=await r({action:k,name:u});S?I(S):J({kind:"running",operation:null})}catch(S){S instanceof Dt&&S.code==="oauth_unsupported"&&i.markNeedsKey(u),J({kind:"refused",message:Xe("grant",S,re)})}},be=(u,k)=>{switch(k.kind){case"sign_in":case"reauth":{const S=g.find(G=>G.name===u.name&&G.status==="running");S&&qe(S)?(J({kind:"running",operation:S}),I(S.id)):(J({kind:"ready"}),I(null)),Ce({kind:"sign_in",name:u.name,action:k.kind==="reauth"?"reauth":"login"});return}case"set_key":U(null),Ce({kind:"key",name:u.name,keyNames:u.auth.secret_refs.map(S=>S.id)});return;case"fix":me(u);return;case"sign_out":D({name:u.name,kind:"sign_out"});return;default:{const S=k.kind;le(u.name,S,()=>r({action:S,name:u.name}))}}},Ee=(u,k)=>{switch(k.kind){case"remove":case"sign_out":D({name:u.name,kind:k.kind});return;case"sign_in":case"reauth":case"set_key":be(u,{kind:k.kind,label:k.label});return;case"open_config":me(u);return;case"copy_setup":navigator.clipboard.writeText(u.setup_prompt??"").then(()=>Ct(n("ui.settings.integrations.mcp_management_section.setup_steps_copied_paste_them_into_a_chat"))).catch(()=>{});return;case"cancel":{const S=g.find(G=>G.name===u.name&&G.status==="running");S&&le(u.name,"cancel",()=>r({action:"cancel",operationId:S.id}));return}case"test":case"connect":case"disconnect":case"reload":{const S=k.kind;le(u.name,S,()=>r({action:S,name:u.name}));return}default:return}},gt=(u,k)=>{if(D(null),k==="remove"){const S=u.source.owned_scope;if(!S)return;const G=Y.findIndex(fe=>fe.name===u.name);le(u.name,"remove",()=>r({action:"remove",name:u.name,scope:S})).then(({operationId:fe,failed:Re})=>{Re||fe!==null||(Ct(n("ui.settings.integrations.mcp_management_section.removed_name",{name:String(u.name)})),G>=0&&ge({index:G}))});return}le(u.name,"sign_out",()=>r({action:"logout",name:u.name})).then(()=>{te({name:u.name,waitForSignIn:!1,until:Date.now()+$e,reanchors:0})})},_t=async u=>{try{return await r({action:"add",name:u.name,scope:u.scope,...u.mode==="command"?{command:u.command,args:u.args}:{url:u.url}}),y(!1),W(u.name),null}catch(k){return Xe("add",k,!1)}},Ye=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(vt)}),t.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:n(lc)})]}),i.enabled&&c.length>0&&!x?t.jsxs(B,{ref:F,variant:"secondary",size:"sm",onClick:()=>y(!0),"data-tour-tag":"mcp-add-server",children:[t.jsx(Qt,{"aria-hidden":"true"}),n("ui.settings.integrations.mcp_management_section.add_integration")]}):null]});if(!i.enabled&&!i.isLoading)return t.jsx(ie,{title:n(vt),titleComponent:Ye,sectionRef:s,children:t.jsx(oe,{variant:"warning",children:n("ui.settings.integrations.mcp_management_section.integrations_need_a_newer_local_operator_backend_update_it_and_re")})});const mt=t.jsx(Cl,{existingNames:c.map(u=>u.name),projectScopeAvailable:f,projectLabel:o?.cwd?gc(o.cwd):null,onSubmit:_t,onCancel:()=>{y(!1),window.setTimeout(()=>F.current?.focus(),0)}}),Ue=E?Ae(E.name):void 0,Qe=Object.entries(H).filter(([u])=>!c.some(k=>k.name===u)),Zn=u=>N(({[u]:k,...S})=>S);l.useEffect(()=>{if(!T)return;const u=V.current[T];if(!u){c.some(k=>k.name===T)&&(R.current[T]?.focus(),W(null));return}u.focus(),W(null)},[T,c]),l.useEffect(()=>{if(!Se)return;const k=Y[Math.min(Se.index,Y.length-1)]??Y.at(-1);if(k){const S=V.current[k.name]??R.current[k.name];if(!S)return;S.focus()}else F.current?.focus();ge(null)},[Se,Y]);const pt=l.useCallback((u,k)=>{const S=d()??o,G=S?.servers.find(Jn=>Jn.name===u.name),fe=S?.operations??[],Re=G?G.status==="connecting"||Pe(G.name,fe)!==null:!1;Re&&G&&(p.current=k);const Te=G?Kt(G,fe,i.memories):null;if(G&&u.waitForSignIn&&(Te?.kind==="sign_in"||Te?.kind==="reauth"))return"kept";const De=Rl({hold:u,now:k,windowMs:$e,rowMoving:Re,lastMovingAt:p.current,candidate:G?Il({primary:Te?V.current[G.name]:null,overflow:R.current[G.name]}):void 0,active:window.document.activeElement,body:window.document.body});if(!De.hold)return te(null),"finished";if(!De.land)return"kept";te({name:u.name,waitForSignIn:!1,until:De.hold.until,landedOn:De.land,reanchors:De.hold.reanchors});const Ht=De.land;return window.setTimeout(()=>{Ht.isConnected&&Ht.focus()},0),"landed"},[d,o,i.memories]);return l.useEffect(()=>{if(!z)return;pt(z,Date.now());let u=0,k=!1;const S=()=>{if(k)return;const G=Ll({verdict:pt(z,Date.now()),watchMs:ln});G!==null&&(u=window.setTimeout(S,G))};return u=window.setTimeout(S,ln),()=>{k=!0,window.clearTimeout(u)}},[z,pt]),l.useEffect(()=>{if(!z)return;const u=k=>{Tl({target:k.target,row:ee.current[z.name]})&&te(null)};return window.document.addEventListener("pointerdown",u,!0),()=>{window.document.removeEventListener("pointerdown",u,!0)}},[z]),t.jsxs(ie,{title:n(vt),titleComponent:Ye,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(B,{variant:"primary",size:"sm",onClick:()=>_("/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(ue,{size:"lg",label:n("ui.settings.integrations.mcp_management_section.loading_integrations")})}):null,i.folderUnavailable?t.jsx(oe,{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(oe,{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(B,{variant:"secondary",size:"sm",onClick:i.refetch,children:n("ui.settings.integrations.mcp_management_section.retry")})]})}):null,Qe.map(([u,k])=>t.jsx(oe,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:k}),t.jsx(B,{variant:"ghost",size:"sm",onClick:()=>Zn(u),children:n("ui.settings.integrations.mcp_management_section.dismiss")})]})},u)),x&&c.length>0?mt:null,c.length>=rc?t.jsxs("div",{className:"relative",children:[t.jsx(Fs,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-ink-dim"}),t.jsx(Oe,{ref:j,value:m,onChange:u=>h(u.target.value),onKeyDown:u=>{u.key!=="Escape"||!m||(u.preventDefault(),h(""))},placeholder:n("ui.settings.integrations.mcp_management_section.search_integrations_placeholder",{integrations:Hr(c.length)}),"aria-label":n("ui.settings.integrations.mcp_management_section.search_integrations"),className:"pl-9"})]}):null,O?.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(O.asked)})}):null,O?.kind==="matched"&&O.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(O.name),asked:String(O.unresolved)})}):null,o&&c.length===0&&!i.isLoading?x?mt:t.jsxs("div",{className:"flex flex-col items-start gap-3 rounded-lg bg-surface p-6",children:[t.jsx(bn,{"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(B,{variant:"primary",size:"md",onClick:()=>y(!0),"data-tour-tag":"mcp-add-server",children:[t.jsx(Qt,{"aria-hidden":"true"}),n("ui.settings.integrations.mcp_management_section.add_integration")]})]}):null,c.length>0&&Y.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(B,{variant:"secondary",size:"sm",onClick:()=>{h(""),window.setTimeout(()=>{(j.current??F.current)?.focus()},0)},children:n("ui.settings.integrations.mcp_management_section.clear_search")})]}):null,_e.map(u=>t.jsxs("section",{"aria-labelledby":`integrations-group-${u.id}`,className:"flex flex-col gap-1.5",children:[t.jsxs("h3",{id:`integrations-group-${u.id}`,className:"px-1 text-ink-dim text-meta",children:[u.title," · ",u.rows.length]}),t.jsx("ul",{className:"flex flex-col divide-y divide-hairline overflow-hidden rounded-lg bg-surface",children:u.rows.map(k=>t.jsx(Ul,{row:k,operations:g,memories:i.memories,projectScopeAvailable:f,highlighted:k.name===P,rowRef:S=>{ee.current[k.name]=S,k.name===P&&(ne.current=S)},primaryRef:S=>{V.current[k.name]=S},overflowRef:S=>{R.current[k.name]=S},pending:A===k.name,failure:H[k.name]??null,confirm:K?.name===k.name?{kind:K.kind}:null,onPrimary:S=>be(k,S),onOverflow:S=>Ee(k,S),onConfirm:()=>K&>(k,K.kind),onCancelConfirm:()=>{D(null),window.setTimeout(()=>{R.current[k.name]?.focus()},0)}},k.id))})]},u.id))]}),E?.kind==="sign_in"?t.jsx(Vl,{name:E.name,action:E.action,keyRoute:he?dt(he):!1,phase:Z,onStart:()=>void ke(E.name,E.action),onCancel:u=>void r({action:"cancel",operationId:u}).catch(()=>{}),onOpenLink:u=>void Ds(u),onClose:u=>v(E.name,u)}):null,E?.kind==="key"?t.jsx(Dl,{name:E.name,keyNames:E.keyNames.length?E.keyNames:Ue?.auth.secret_refs.map(u=>u.id)??[],keyless:E.keyNames.length===0,savedKeys:Ue?.auth.secret_refs.filter(u=>u.state==="encrypted").map(u=>u.id),saving:L,failure:se,onClose:pe,onSave:(u,k,S)=>{$(!0),U(null),i.storeKeys(E.name,u,k,S).then(G=>{if(!G.saved){U(G.message);return}M(null),te({name:E.name,waitForSignIn:!1,until:Date.now()+$e,reanchors:0})}).catch(G=>U(Xe("key",G,!1))).finally(()=>$(!1))}}):null]})},$e=4e3,uc=/^\/(?:Users|home)\/[^/]+(?=\/|$)/,gc=e=>e.replace(uc,"~"),_c=({verification:e})=>{Q();const{prices:s}=Ks(),a=e.grant_amount??s?.default_new_credits,{sentence:i,action:o}=$s(e.signup_grant,Bs(a)),r=Hs(e.claim_url,Vs);return t.jsxs("div",{className:"mt-8 flex items-start gap-3 rounded-sm border border-hairline bg-surface p-3",children:[t.jsx(lt,{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(B,{variant:"secondary",size:"sm",onClick:()=>Gs(r),children:o})]})]})},mc=({onAfterCredentialUpdate:e})=>{Q();const{isAuthenticated:s,user:a,isLoading:i,accountRead:o,signOut:r}=Us(),d=wn(x=>x.isSigningOut),_=l.useCallback(async()=>{try{await r()}catch(x){console.error("Error signing out:",x)}},[r]),c=(()=>{if(!s||!a?.radientUser)return null;const{account:x,identity:y,verification:m}=a.radientUser,h=m!=null&&!m.email_verified&&m.signup_grant!=="claimed";return t.jsxs(t.Fragment,{children:[t.jsxs(ct,{children:[t.jsx(ce,{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(Ja,{variant:"success",className:"capitalize",children:x.status})]})}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.name"),value:x.name||n("ui.settings.account.radient_account_section.not_provided")}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.email"),value:x.email}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.account_id"),value:t.jsx("span",{className:"text-mono-sm",children:x.id})}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.tenant_id"),value:t.jsx("span",{className:"text-mono-sm",children:x.tenant_id})}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.provider"),value:t.jsx("span",{className:"capitalize",children:y.provider})}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.created"),value:jn(x.created_at)})]}),h&&m?t.jsx(_c,{verification:m}):null,t.jsx("div",{className:"mt-8",children:t.jsx(va,{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(B,{variant:"danger",className:"mt-3",onClick:_,children:[t.jsx(ba,{}),n("ui.settings.account.radient_account_section.sign_out_from_radient")]})]})]})})(),g=o==="refused"?n("ui.settings.account.radient_account_section.radient_refused_the_sign_in_this_app_is_holding_so_your_account_d"):Nn(o)?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"),f=s&&a?null:t.jsxs("div",{children:[t.jsxs("p",{className:"text-body-sm text-ink-muted",children:[g," ",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(si,{titleText:"",onAfterCredentialUpdate:e,descriptionText:"",onSignInSuccess:()=>{}})})]});return i||d?t.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center gap-3",children:[t.jsx(ue,{size:"lg",label:n("ui.settings.account.radient_account_section.loading_account")}),!d&&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:f})};function pc({metric:e,data:s}){return Q(),t.jsx(qs,{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)}`:Ys(a),children:t.jsx(br,{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 hc={all:["desktop","tts-path-resolution"]};function fc(e){return xe({queryKey:hc.all,queryFn:()=>ye({op:"tts.paths"}),enabled:e,staleTime:Number.POSITIVE_INFINITY,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:Qs})}const yc=["speech.voice.gender","speech.voice.tone","speech.voice.expressiveness","speech.voice.pace","speech.voice.language","speech.voice.accent","speech.voice.instructions"];function mn(e){const s=new Map(e.map(o=>[o.key,o])),a=[],i=[];for(const o of yc){const r=s.get(o);r?a.push(r):i.push(o)}return{rows:a,missing:i}}const xc=["provider_tts_radient","provider_tts_elevenlabs","provider_tts_openai","none"];function pn(e){return typeof e=="string"&&xc.includes(e)}function kc(e){if(e===null||typeof e!="object")return null;const s=e;if(!pn(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 o=i;if(!pn(o.path)||typeof o.available!="boolean"||typeof o.reason!="string")return null;a.push({path:o.path,available:o.available,reason:o.reason})}return{path:s.path,reason:s.reason,servable:s.servable,rungs:a}}const vc={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 Qn(e){return vc[e]}function bc(e){return{servable:e.servable,serving:e.path==="none"?null:e.path,reason:e.reason,rungs:e.rungs.map(s=>({path:s.path,name:Qn(s.path),available:s.available,reason:s.reason}))}}const wc="ui.settings.speech.speech_section.copy_backend_older_sentence",Wn="ui.settings.speech.speech_section.copy_unavailable_sentence",jc=({resetErrorBoundary:e})=>(Q(),t.jsx(oe,{variant:"warning",children:t.jsxs("div",{className:"flex flex-col items-start gap-3",children:[t.jsx("span",{children:n(Wn)}),t.jsxs(B,{variant:"secondary",onClick:e,children:[t.jsx(ei,{"aria-hidden":"true"}),n("ui.settings.speech.speech_section.try_again")]})]})}));function Nc(e){return e==="enabled"?"ready":e==="below-version"?"older":"pairing"}const Sc=({sectionRef:e})=>{Q();const s=Ft(),a=Sn(),i=Ws(s.data,"tts"),o=Nc(i),r=xe({queryKey:jt.all,queryFn:()=>ye({op:"settings.list"}),enabled:o==="ready",staleTime:1e4}),d=fc(o==="ready"),{hasRadientApiKey:_,hasRadientSession:c,speechBlock:g}=Zs(),f=`${c}:${_}`,x=l.useRef(f),y=d.refetch;l.useEffect(()=>{x.current!==f&&(x.current=f,y())},[f,y]);const m=r.data,h=l.useMemo(()=>mn(m?.settings??[]),[m]),[A,C]=l.useState({}),[H,N]=l.useState({}),[K,D]=l.useState({});l.useEffect(()=>{m&&C(p=>{let F=!1;const j={...p};for(const q of mn(m.settings).rows){const T=p[q.key];if(T&&T.value!==Ke(q).value)continue;const W=Ke(q);T&&T.value===W.value&&T.cascadeBase===W.cascadeBase||(j[q.key]=W,F=!0)}return F?j:p})},[m]);const E=(p,F)=>N(j=>({...j,[p]:F})),M=(p,F)=>D(j=>({...j,[p]:F})),Z=async p=>{const F=A[p.key];if(!F)return;const j=ea(p,F);if(!j.ok){M(p.key,j.error);return}E(p.key,!0),M(p.key,null);try{await ye(j.request),E(p.key,!1);const T=(await r.refetch()).data?.settings.find(W=>W.key===p.key);T&&C(W=>{const z=W[p.key];return z&&z.value===F.value&&z.cascadeBase===F.cascadeBase?{...W,[p.key]:Ke(T)}:W})}catch(q){E(p.key,!1),M(p.key,q instanceof Error?q.message:n("ui.settings.speech.speech_section.the_setting_could_not_be_saved"))}},J=async p=>{E(p.key,!0),M(p.key,null);try{await ye({op:"settings.reset",key:p.key}),C(F=>({...F,[p.key]:Ke({...p,value:p.default,is_default:!0})})),E(p.key,!1),await r.refetch()}catch(F){E(p.key,!1),M(p.key,F instanceof Error?F.message:n("ui.settings.speech.speech_section.the_setting_could_not_be_reset"))}},X=l.useMemo(()=>kc(d.data),[d.data]),I=X?bc(X):null,se=d.isSuccess&&X===null,U=(s.data?null:s.error)??null,L=r.error,$=n("ui.settings.speech.speech_section.speech_voicing"),V=n("ui.settings.speech.speech_section.how_the_assistant_sounds_when_it_speaks_aloud");if(o==="pairing"){const{sentence:p}=At(a??null,n("ui.settings.speech.speech_section.speech_settings_could_not_be_loaded"),U);return t.jsx(ie,{title:$,icon:We,description:V,sectionRef:e,children:t.jsx(oe,{variant:"warning",children:p})})}if(o==="older")return t.jsx(ie,{title:$,icon:We,description:V,sectionRef:e,children:t.jsx(oe,{variant:"warning",children:n(wc)})});if(L||!m){const{sentence:p,remedy:F}=At(a??null,n("ui.settings.speech.speech_section.speech_settings_could_not_be_loaded"),L);return t.jsx(ie,{title:$,icon:We,description:V,sectionRef:e,children:t.jsx(oe,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:p}),F&&t.jsx(B,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{r.refetch()},children:n("ui.settings.speech.speech_section.retry")})]})})})}const R=I?!I.servable:g==="offline",ee=I?I.rungs.find(p=>p.path===I.serving)??null:null;return t.jsx(ie,{title:$,icon:We,description:V,sectionRef:e,children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("section",{className:"flex flex-col gap-3",children:[d.isPending&&t.jsxs("p",{className:"flex items-center gap-2 text-body-sm text-ink-muted",children:[t.jsx(ue,{}),qt("checking")]}),(d.isError||se)&&!I&&g!=="offline"&&t.jsx(oe,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("span",{children:[n(Wn)," ",d.error instanceof Error?d.error.message:""]}),t.jsx(B,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{d.refetch()},children:n("ui.settings.speech.speech_section.retry")})]})}),t.jsx(Xa,{fallbackRender:jc,resetKeys:[d.dataUpdatedAt],children:I&&t.jsxs(t.Fragment,{children:[t.jsxs(ct,{children:[t.jsx(ce,{label:n("ui.settings.speech.speech_section.speaks_through"),value:I.serving?Qn(I.serving):n("ui.settings.speech.speech_section.nothing_yet")}),t.jsx(ce,{label:n("ui.settings.speech.speech_section.availability"),value:I.servable?n("ui.settings.speech.speech_section.ready"):n("ui.settings.speech.speech_section.no_provider")})]}),I.reason&&I.reason!==ee?.reason&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:I.reason}),t.jsx("ul",{className:"flex flex-col gap-1",children:I.rungs.map(p=>t.jsxs("li",{className:"flex flex-col gap-0.5 text-body-sm",children:[t.jsxs("span",{className:p.path===I.serving?"text-ink":"text-ink-muted",children:[p.name,t.jsxs("span",{className:p.path===I.serving?"text-ink-muted":"text-ink-dim",children:[" ",p.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:p.reason})]},p.path))})]})})]}),R&&t.jsx(oe,{variant:"warning",children:qt(g)}),t.jsx("div",{className:"flex flex-col gap-1",children:h.rows.map(p=>t.jsx(Js,{setting:p,draft:A[p.key]??Ke(p),tier:Xs(p),saving:!!H[p.key],error:K[p.key]??null,onDraftChange:F=>C(j=>({...j,[p.key]:F})),onSave:()=>{Z(p)},onReset:()=>{J(p)}},p.key))}),h.missing.length>0&&t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.settings.speech.speech_section.missing_voice_rows",{count:h.missing.length,rows:h.missing.join(", ")})})]})})},Cc=()=>{Q();const{data:e,isLoading:s,error:a,refetch:i}=xr(),o=kr(),[r,d]=l.useState(""),[_,c]=l.useState(!1);l.useEffect(()=>{d(e?.content??""),c(!1)},[e]);const g=h=>{const A=h.target.value;d(A),c(A!==(e?.content??""))},f=async()=>{if(!(!_||o.isPending))try{const h={content:r};await o.mutateAsync(h),await i(),c(!1)}catch(h){console.error("Error updating system prompt:",h)}},x=()=>{d(e?.content??""),c(!1)},y=o.isPending,m=()=>t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(ve,{htmlFor:"app-system-prompt",children:n("ui.settings.model.system_prompt.instructions")}),t.jsx(En,{id:"app-system-prompt",name:"systemPrompt",value:r,onChange:g,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(B,{variant:"primary",onClick:f,disabled:!_||y,children:[y?t.jsx(ue,{size:"sm"}):t.jsx(wa,{}),y?n("ui.settings.model.system_prompt.saving"):n("ui.settings.model.system_prompt.save_changes")]}),t.jsx(B,{onClick:x,disabled:!_||y,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:Cn(e.last_modified)})]})]});return t.jsx(ie,{title:n("ui.settings.model.system_prompt.system_prompt"),icon:ai,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(ue,{size:"lg",label:n("ui.settings.model.system_prompt.loading_system_prompt")})}):a?t.jsx(oe,{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")})}):m()})},Mc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Ac=e=>Mc.includes(e),Ec=e=>{const s=[];let a=0;for(const i of e){const o=Math.max(0,Math.floor(i.count)),r=Math.max(1,Math.floor(i.columns));for(let d=0;d<o;d+=r)s.push({start:a+d,count:Math.min(r,o-d)});a+=o}return s},Rc=({index:e,key:s,groups:a})=>{const i=Ec(a),o=i.reduce((r,d)=>r+d.count,0);if(!Number.isInteger(e)||e<0||e>=o)return e;switch(s){case"Home":return 0;case"End":return o-1;case"ArrowLeft":return Math.max(0,e-1);case"ArrowRight":return Math.min(o-1,e+1);case"ArrowUp":case"ArrowDown":{const r=i.findIndex(c=>e>=c.start&&e<c.start+c.count),d=i[r+(s==="ArrowDown"?1:-1)];if(!d)return e;const _=e-i[r].start;return d.start+Math.min(_,d.count-1)}default:return e}},Tc={localOperatorDark:Ao,localOperatorLight:Qo,dracula:Ko,dune:no,sage:vo,monokai:Sa,tokyoNight:Io,iceberg:Bo,radient:po,neon:ta,obsidian:Tn,synth:pi,catppuccinMocha:Ki,catppuccinLatte:No,tokyoNightStorm:Ii,gruvbox:wi,nord:fr,oneDark:_i,solarizedDark:qo,rosePine:oo,rosePineMoon:Co,rosePineDawn:Pi,alucard:lo,gruvboxLight:Yi,tokyoNightDay:Ro,oneLight:wo,catppuccinFrappe:Gi,catppuccinMacchiato:fo,palenight:Na,everforest:cr,everforestLight:rr,kanagawaWave:_r,kanagawaLotus:ao,ayuDark:Wi,ayuMirage:Ji,ayuLight:Do,nightfox:Oi,duskfox:Xo,synthwave:Oo,matrix:fi,tron:Ri,cyberpunk:ja,vaporwave:ir,outrun:vi,neonNoir:ur,arcade:xo,forest:sr,ocean:eo,desert:tr,autumn:pr,lavender:Vo,arctic:Di,rosewood:_o,solarizedLight:Zo,githubLight:uo,paper:ii,linen:Po,highContrastLight:ui,mintLight:xi},hn="bg-[color-mix(in_srgb,var(--color-accent)_8%,var(--color-accent-wash))]",Ic=({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"})]})]})]}),Lc=({id:e,name:s,description:a,isSelected:i,isTabStop:o,onSelect:r,onFocusTile:d})=>{const _=Tc[e];return t.jsx(He,{side:"bottom",align:"start",content:a,children:t.jsxs("button",{type:"button","data-theme-tile":e,"aria-pressed":i,tabIndex:o?0:-1,onFocus:d,onClick:r,className:de("relative flex flex-col gap-1.5 rounded-md p-1 text-left transition-colors duration-fast ease-out-quart",i?hn:"hover:bg-surface"),children:[t.jsxs("span",{className:de("relative block h-10 overflow-hidden rounded-sm border transition-colors duration-fast ease-out-quart",i?"border-accent":"border-hairline"),children:[t.jsx(Ic,{id:e}),i&&t.jsx("span",{className:de("pointer-events-none absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full",hn),children:t.jsx(ni,{size:12,className:"text-accent","aria-hidden":"true"})})]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(_,{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})]})]})})},Oc=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(o=>Math.abs(o.getBoundingClientRect().top-i)<1).length)}}),Fc=()=>{Q();const{themeName:e,setTheme:s}=Ne(),a=Object.values(Xn),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),[o,r]=l.useState(null),d=l.useMemo(()=>{const c=i.flatMap(g=>g.items.map(f=>f.id));return o&&c.includes(o)?o:c.includes(e)?e:c[0]},[i,o,e]),_=c=>{if(!Ac(c.key))return;const g=[...c.currentTarget.querySelectorAll("[data-theme-tile]")],f=g.indexOf(c.target);if(f<0)return;c.preventDefault();const x=Rc({index:f,key:c.key,groups:Oc(c.currentTarget)});x!==f&&g[x]?.focus()};return t.jsx(ti,{children:t.jsx("div",{onKeyDown:_,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:g,name:f,description:x})=>t.jsx(Lc,{id:g,name:f,description:x,isSelected:g===e,isTabStop:g===d,onSelect:()=>s(g),onFocusTile:()=>r(g)},g))})]},c.label))})})},Dc=({value:e,onChange:s})=>{Q();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(ot,{value:e,onValueChange:i=>s(Mn(i)),children:t.jsx(rt,{"aria-labelledby":a,children:ha.map(i=>t.jsx(ze,{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))})})})]})},zc=()=>{Q();const{data:e,isLoading:s,error:a}=jr({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(Hi,{size:16,className:"shrink-0 text-ink-dim"}),n("ui.settings.account.settings_page.radient_pass")]}),s&&t.jsx(Rn,{className:"h-6 w-36"}),a&&t.jsx(oe,{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(B,{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(Ai,{}),n("ui.settings.account.settings_page.add_credits")]})})]})]})},Pc=[{id:"credits",get label(){return n("ui.settings.account.settings_page.credits")}},{id:"tokens",get label(){return n("ui.settings.account.settings_page.tokens")}}],Uc=()=>{Q();const[e,s]=l.useState("credits"),a=l.useMemo(()=>{const _=new Date,c=vr(_);return{start_date:en(c),end_date:en(_),rollup:"daily"}},[]),{data:i,isLoading:o,error:r}=Sr(a,{enabled:!0}),d=l.useMemo(()=>i?.data_points?[...i.data_points].sort((c,g)=>ht(c.timestamp).getTime()-ht(g.timestamp).getTime()).map(c=>({bucket:da(li(ht(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(Ni,{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:Pc.map(({id:_,label:c})=>t.jsx(B,{variant:"ghost",size:"sm","aria-pressed":e===_,onClick:()=>s(_),className:de(e===_&&"bg-surface text-ink hover:bg-surface"),children:c},_))})]})]}),o&&t.jsx(Rn,{className:"h-62 w-full"}),r&&t.jsx(oe,{variant:"warning",children:n("ui.settings.account.settings_page.usage_load_failed",{reason:r.message})}),!o&&!r&&i&&d.length>0&&t.jsx(pc,{metric:e,data:d}),!o&&!r&&(!i||d.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")})]})},Kc=()=>(Q(),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(Da,{size:16,className:"shrink-0 text-ink-dim"}),n("ui.settings.account.settings_page.radient_account")]}),t.jsx(B,{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(ua,{})]})})]})),td=()=>{Q();const e=na("surface"),s=sa(),a=Ne(w=>w.showAgentReasoning),i=Ne(w=>w.setShowAgentReasoning),o=Ne(w=>w.transcriptDisplayMode),r=Ne(w=>w.setTranscriptDisplayMode),{data:d,isLoading:_,isFetching:c,error:g,refetch:f}=aa(),{needsProvider:x}=ia(),y=Sn(),{sentence:m,remedy:h}=At(y??null,n("ui.settings.navigation.settings_page.your_settings_could_not_be_loaded"),g),A=Ca(),[C,H]=l.useState(null),N=wn(),{isAuthenticated:K,accountRead:D,isFetching:E,isRefreshing:M,refreshUser:Z}=Ot(),J=tt(w=>w.activeSessionId),[X,I]=l.useState("general"),[se,U]=l.useState(!1),L=l.useRef(null),$=l.useRef(null),{startTour:V}=Ma(),R=oa(),{data:ee,refetch:p}=ra(),{refreshModels:F}=la(),j=l.useMemo(()=>ee?.keys?[...ee.keys].sort():[],[ee?.keys]),q=l.useRef({keys:"",hosting:void 0});l.useEffect(()=>{const w=j.join(","),ae=d?.values?.hosting;(q.current.keys!==w||q.current.hosting!==ae)&&(q.current={keys:w,hosting:ae},F().catch(Y=>{console.error("Failed to refresh models after credentials or hosting change:",Y)}))},[j,d?.values?.hosting,F]);const T=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),backend:l.useRef(null),updates:l.useRef(null)}).current,W=l.useMemo(()=>new URLSearchParams(R.search).get("setting"),[R.search]),z=l.useMemo(()=>new URLSearchParams(R.search).get("filter")??"",[R.search]),te=l.useMemo(()=>new URLSearchParams(R.search).get("mcp")??void 0,[R.search]),Se=l.useMemo(()=>new URLSearchParams(R.search).get("provider"),[R.search]),ge=l.useCallback(w=>{I(w),U(!0);const ae=T[w],Y=$.current;if(ae?.current&&Y){const he=ae.current.getBoundingClientRect().top-Y.getBoundingClientRect().top;Y.scrollHeight>Y.clientHeight?Y.scrollTo({top:Math.max(0,Y.scrollTop+he-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,ae.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout(L.current??void 0),L.current=setTimeout(()=>{U(!1),L.current=null},800)}else U(!1)},[T]);l.useEffect(()=>{const w=setTimeout(()=>{const ae=$.current;if(!ae)return;const Y=()=>{if(se)return;const _e=ae.getBoundingClientRect(),he=_e.height;let re="",Me=0;for(const[le,Ae]of Object.entries(T))if(Ae.current){const me=Ae.current.getBoundingClientRect(),ke=_e.top,be=me.top-ke,Ee=me.bottom-ke,gt=me.height,_t=Math.max(0,be),Ye=Math.min(he,Ee),Ue=Math.max(0,Ye-_t)/gt,Qe=Ue+(be<he*.3?.1:0);Qe>Me&&Ue>.1&&(Me=Qe,re=le)}re&&re!==X&&I(re)};return Y(),ae.addEventListener("scroll",Y,{passive:!0}),()=>{ae.removeEventListener("scroll",Y),clearTimeout(L.current??void 0)}},100);return()=>clearTimeout(w)},[T,X,se]),l.useEffect(()=>{const w=new URLSearchParams(R.search),ae=w.get("section"),Y=w.get("setting"),_e=Y?Yt(Y,"backend"):ae,he=_e?T[_e]:void 0;if(!_e||!he)return;let re=!1,Me=Number.NaN,le=0;const Ae=window.setTimeout(()=>{re||(re=!0,ke.disconnect(),ge(_e))},2e3),me=()=>{if(re)return;const be=he.current;if(!be){le=requestAnimationFrame(me);return}const Ee=Math.round(be.getBoundingClientRect().top+window.scrollY);if(Ee===Me&&Ee>0){re=!0,ke.disconnect(),window.clearTimeout(Ae),ge(_e);return}Me=Ee,le=requestAnimationFrame(me)},ke=new ResizeObserver(()=>{re||(cancelAnimationFrame(le),le=requestAnimationFrame(me))});return $.current&&ke.observe($.current),le=requestAnimationFrame(me),()=>{re=!0,cancelAnimationFrame(le),ke.disconnect(),window.clearTimeout(Ae)}},[R.search,T,ge]);const pe=async(w,ae)=>{H(w);try{await A.mutateAsync({[w]:ae}),await f()}catch(Y){console.error(`Error updating ${w}:`,Y)}finally{H(null)}},Ce=_,v=D==="checking",O=Nn(D),P=D==="ready"||D==="checking"||E,ne=An(Ce,4e3);return g?t.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:t.jsx(oe,{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:m}),h&&t.jsx(B,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void f(),disabled:c,children:c?n("ui.settings.navigation.settings_page.retrying"):n("ui.settings.navigation.settings_page.retry")})]})})}):Ce?t.jsxs("div",{role:"status",className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-canvas",children:[t.jsx(ue,{size:"lg",label:ne?void 0:n("ui.settings.navigation.settings_page.loading_settings")}),ne&&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")})]}):d?t.jsxs("div",{"data-glass-region":"canvas","data-glass-split":"",className:"flex h-full w-full overflow-hidden bg-canvas",children:[t.jsx("div",{ref:e,className:"w-12 shrink-0 overflow-y-auto min-[1040px]:w-55",children:t.jsx(Aa,{activeSection:X,onSelectSection:ge,sections:Ea})}),t.jsx("div",{ref:$,"data-settings-content":!0,"data-glass-region":"canvas-content","data-tour-tag":"settings-general-section",className:"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(za,{title:n("ui.settings.page.title"),icon:Wt}),t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsxs("div",{ref:T.general,className:"flex flex-col gap-8",children:[t.jsx(Ra,{focus:W===es}),t.jsxs(ie,{title:n("ui.settings.profile.title"),icon:Ta,description:n(K?"ui.settings.profile.description_authenticated":"ui.settings.profile.description_anonymous"),children:[v&&t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.settings.profile.account_checking")}),O&&t.jsx(oe,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:n(D==="refused"?"ui.settings.profile.account_read_failed_refused":"ui.settings.profile.account_read_failed_retry")}),t.jsx(B,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>Z(),disabled:M,children:M?n("ui.settings.profile.retrying"):n("ui.settings.profile.retry")})]})}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Zt,{value:N.profile.name,label:n("ui.settings.profile.display_name.label"),placeholder:n("ui.settings.profile.display_name.placeholder"),isSaving:C==="user_name",onSave:async w=>{H("user_name");try{N.updateName(w)}finally{H(null)}},readOnly:P}),t.jsx(Zt,{value:N.profile.email,label:n("ui.settings.profile.email.label"),placeholder:n("ui.settings.profile.email.placeholder"),isSaving:C==="user_email",onSave:async w=>{H("user_email");try{N.updateEmail(w)}finally{H(null)}},readOnly:P})]})]}),t.jsx(ie,{title:n("ui.settings.tour.title"),description:n("ui.settings.tour.description"),children:t.jsxs(B,{variant:"secondary",onClick:()=>{V({forceModalCompleted:!0})},children:[t.jsx(Ci,{}),n("ui.settings.tour.action")]})}),t.jsx(ie,{id:"model-settings",title:n("ui.settings.model.settings_page.model_settings"),icon:Ia,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(La,{value:d.values.hosting,isSaving:C==="hosting",onSave:w=>pe("hosting",w),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:n("ui.settings.model.settings_page.no_hosting_options")}),t.jsx(Oa,{value:d.values.model_name,hostingId:d.values.hosting,isSaving:C==="model_name",onSave:w=>pe("model_name",w),allowCustom:!0,allowDefault:!1}),t.jsx(zr,{hosting:d.values.hosting,modelName:d.values.model_name,focus:W===et}),x&&t.jsx(oe,{variant:"neutral",icon:t.jsx(lt,{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:()=>{ge("providers"),T.providers.current?.focus({preventScroll:!0})},children:n("ui.settings.model.provider_callout.providers_link")}),"."]})})]})}),t.jsx(Cc,{}),t.jsx(ie,{title:n("ui.settings.configuration.settings_page.configuration_information"),icon:lt,description:n("ui.settings.configuration.settings_page.system_information_about_the_current_configuration"),children:t.jsxs(ct,{children:[t.jsx(ce,{label:n("ui.settings.configuration.settings_page.version"),value:t.jsx("span",{className:"text-mono-sm",children:d.version})}),t.jsx(ce,{label:n("ui.settings.configuration.settings_page.created"),value:jn(d.metadata.created_at)}),t.jsx(ce,{label:n("ui.settings.configuration.settings_page.last_modified"),value:Cn(d.metadata.last_modified)}),t.jsx(ce,{label:n("ui.settings.configuration.settings_page.description"),value:d.metadata.description||n("ui.settings.configuration.settings_page.no_description_available")})]})})]}),t.jsx(ie,{title:n("ui.settings.appearance.settings_page.appearance"),icon:Tn,description:n("ui.settings.appearance.settings_page.customize_the_look_and_feel_of_local_operator"),sectionRef:T.appearance,dataTourTag:"settings-appearance-section",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Fc,{}),t.jsx(In,{value:a,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 w=>i(w)}),t.jsx(Dc,{value:Mn(o),onChange:w=>r(w)}),t.jsx(Er,{state:s.state,onChange:s.set})]})}),t.jsx(Sc,{sectionRef:T.speech}),t.jsx($r,{sectionRef:T.keyboard}),t.jsx(ie,{title:n("ui.settings.model.settings_page.model_providers"),icon:bn,description:n("ui.settings.navigation.settings_page.sign_in_to_the_services_your_agents_think_with_new_chats_use_your"),sectionRef:T.providers,id:"model-providers",className:"focus-visible:outline-none!",children:t.jsx(Fa,{initialProviderId:Se,onChangeModel:()=>ge("general")})}),t.jsx(dc,{sessionId:J??void 0,sectionRef:T.integrations,highlightServer:te}),t.jsx(ie,{title:n("ui.settings.account.settings_page.radient_account"),titleComponent:t.jsx(Kc,{}),description:n("ui.settings.account.settings_page.your_radient_account_radient_pass_details_and_credits_to_use_radi"),sectionRef:T.radient,dataTourTag:"settings-radient-account-section",children:t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsx(mc,{onAfterCredentialUpdate:()=>{F(),p()}}),K&&t.jsxs(t.Fragment,{children:[t.jsx(zc,{}),t.jsx(Uc,{})]})]})}),t.jsx(ie,{title:n("ui.settings.navigation.settings_page.backend_settings"),icon:Wt,description:n("ui.settings.navigation.settings_page.every_setting_the_backend_registry_owns_searchable_with_typed_edi"),sectionRef:T.backend,children:t.jsx(ca,{hideInterfaceLanguage:!0,hideModelEffort:!0,focusKey:W&&Yt(W,"backend")==="backend"?W:null,initialFilter:z})}),t.jsx("div",{ref:T.updates,children:t.jsx(Lr,{})})]})]})})]}):t.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:t.jsx(oe,{variant:"warning",className:"w-full max-w-xl",children:n("ui.settings.navigation.settings_page.your_settings_could_not_be_loaded")})})};export{td as SettingsPage};
|