local-operator-ui 0.34.52 → 0.34.53

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.
Files changed (89) hide show
  1. package/out/main/index.js +1616 -17
  2. package/out/preload/index.js +54 -0
  3. package/out/renderer/assets/{_basePickBy-jKP04X-l.js → _basePickBy-CvpcKweF.js} +1 -1
  4. package/out/renderer/assets/{_baseUniq-C1Tb5Z81.js → _baseUniq-D1oOSrqB.js} +1 -1
  5. package/out/renderer/assets/{agent-details-page-BXYnUttm.js → agent-details-page-Dbd7Qqbd.js} +1 -1
  6. package/out/renderer/assets/{agent-hub-page-SrDPuy2R.js → agent-hub-page-hB4xULfK.js} +2 -2
  7. package/out/renderer/assets/{agents-page-BGpbOr-D.js → agents-page-DfuX5-79.js} +3 -3
  8. package/out/renderer/assets/{arc-C60IJR4W.js → arc-BajJ7pje.js} +1 -1
  9. package/out/renderer/assets/{architectureDiagram-IEHRJDOE-CG2aUgQQ.js → architectureDiagram-IEHRJDOE-D1-CNSAD.js} +1 -1
  10. package/out/renderer/assets/{blockDiagram-JOT3LUYC-DG6vLb5j.js → blockDiagram-JOT3LUYC-CD5T8WZA.js} +1 -1
  11. package/out/renderer/assets/{book-open-CqpAQX_h.js → book-open-CfuxuX-l.js} +1 -1
  12. package/out/renderer/assets/browser-page-DbFH9sog.js +1 -0
  13. package/out/renderer/assets/{browser-webauthn-prompt-BICZWWTE.js → browser-webauthn-prompt-DW800ko_.js} +1 -1
  14. package/out/renderer/assets/{c4Diagram-VJAJSXHY-Dxl-T2ot.js → c4Diagram-VJAJSXHY-COKPfAva.js} +1 -1
  15. package/out/renderer/assets/channel-5khbBi1K.js +1 -0
  16. package/out/renderer/assets/{chunk-4BMEZGHF-BTZU1mmj.js → chunk-4BMEZGHF-iSOGNS5q.js} +1 -1
  17. package/out/renderer/assets/{chunk-A2AXSNBT-q4ATawsA.js → chunk-A2AXSNBT-B7eDvfbn.js} +1 -1
  18. package/out/renderer/assets/{chunk-AEK57VVT-ZenDipzf.js → chunk-AEK57VVT-CTtvvIx6.js} +1 -1
  19. package/out/renderer/assets/{chunk-D6G4REZN-LiclW27B.js → chunk-D6G4REZN-D89NRhvc.js} +1 -1
  20. package/out/renderer/assets/{chunk-RZ5BOZE2-rimlHqns.js → chunk-RZ5BOZE2-D9-5Iwp7.js} +1 -1
  21. package/out/renderer/assets/{chunk-XZIHB7SX-W4sbYp78.js → chunk-XZIHB7SX-Cdyx-enm.js} +1 -1
  22. package/out/renderer/assets/classDiagram-GIVACNV2-B_cQ6qiw.js +1 -0
  23. package/out/renderer/assets/classDiagram-v2-COTLJTTW-B_cQ6qiw.js +1 -0
  24. package/out/renderer/assets/clone-DUh4Smnq.js +1 -0
  25. package/out/renderer/assets/{console-mirror-CqKozfMV.js → console-mirror-D4VUczn2.js} +1 -1
  26. package/out/renderer/assets/{consoleCapture-Dt4bXfA5.js → consoleCapture-BZscABJW.js} +1 -1
  27. package/out/renderer/assets/{conversation-input-sync-Bud_iL2h.js → conversation-input-sync-Dlf10JWF.js} +259 -259
  28. package/out/renderer/assets/{dagre-OKDRZEBW-DReye3bj.js → dagre-OKDRZEBW-hOluomAX.js} +1 -1
  29. package/out/renderer/assets/{diagram-SSKATNLV-yQnXG8y9.js → diagram-SSKATNLV-BWdY9OnP.js} +1 -1
  30. package/out/renderer/assets/{diagram-VNBRO52H-Dy1ho1KJ.js → diagram-VNBRO52H-CUZoZ2hJ.js} +1 -1
  31. package/out/renderer/assets/{erDiagram-Q7BY3M3F-MvZHt7NH.js → erDiagram-Q7BY3M3F-BaXRnwVj.js} +1 -1
  32. package/out/renderer/assets/{error-boundary-CnAfZpXJ.js → error-boundary-BCQ7FGQc.js} +1 -1
  33. package/out/renderer/assets/{flowDiagram-4HSFHLVR-BSFgzIoa.js → flowDiagram-4HSFHLVR-D3gvS8EU.js} +1 -1
  34. package/out/renderer/assets/{ganttDiagram-APWFNJXF-Dedj3NlS.js → ganttDiagram-APWFNJXF-DRKxbsB1.js} +1 -1
  35. package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-Cu4jn0rm.js → gitGraphDiagram-7IBYFJ6S-B-6CMRoo.js} +1 -1
  36. package/out/renderer/assets/{graph-CQdRsT3g.js → graph-Bvgoe8Zc.js} +1 -1
  37. package/out/renderer/assets/{index-Dv4cmAE_.js → index-Bg8G2adf.js} +1 -1
  38. package/out/renderer/assets/index-C9huVbt8.js +57 -0
  39. package/out/renderer/assets/{index-gCeAf81g.js → index-DWZ82U8c.js} +1 -1
  40. package/out/renderer/assets/index-DxyRyuQP.css +1 -0
  41. package/out/renderer/assets/{index-Cq2MGZTE.js → index-dNBOt_b9.js} +193 -193
  42. package/out/renderer/assets/{infoDiagram-PH2N3AL5-CuAzIGSj.js → infoDiagram-PH2N3AL5-g5rZp0e7.js} +1 -1
  43. package/out/renderer/assets/{installer-CNLF7ICd.js → installer-BRjexwGb.js} +1 -1
  44. package/out/renderer/assets/{journeyDiagram-U35MCT3I-CWJ2JJ4t.js → journeyDiagram-U35MCT3I-CyyN61cm.js} +1 -1
  45. package/out/renderer/assets/{kanban-definition-NDS4AKOZ-E-V1z1_U.js → kanban-definition-NDS4AKOZ-BcYjcFGg.js} +1 -1
  46. package/out/renderer/assets/{layout-CpEZBnkZ.js → layout-DIrLHdoU.js} +1 -1
  47. package/out/renderer/assets/{legacy-agents-page-z45uS7-l.js → legacy-agents-page-C4087qcZ.js} +2 -2
  48. package/out/renderer/assets/{mermaid.core-DD0sotYo.js → mermaid.core-TBXZ6m8l.js} +5 -5
  49. package/out/renderer/assets/{mesh-page-BwlyEepu.js → mesh-page-Z6_brJoS.js} +1 -1
  50. package/out/renderer/assets/{mindmap-definition-ALO5MXBD-B83-pecE.js → mindmap-definition-ALO5MXBD-CDtMt6Do.js} +1 -1
  51. package/out/renderer/assets/{mini-DtTMJOfC.js → mini-DDoFzOhf.js} +1 -1
  52. package/out/renderer/assets/{notebook-pen-7O_-yyf1.js → notebook-pen-Dd0WXtBw.js} +1 -1
  53. package/out/renderer/assets/{org-access-CTWNNvUI.js → org-access-BVkMTwKq.js} +1 -1
  54. package/out/renderer/assets/{org-surface-gate-DqM2fDEM.js → org-surface-gate-CV-1baVy.js} +1 -1
  55. package/out/renderer/assets/{page-header-C9NIPdYQ.js → page-header-Dl5IO6UP.js} +1 -1
  56. package/out/renderer/assets/{pieDiagram-IB7DONF6-DdgrLAL8.js → pieDiagram-IB7DONF6-gmMGr-ui.js} +1 -1
  57. package/out/renderer/assets/projects-page-B4mpUcqQ.js +45 -0
  58. package/out/renderer/assets/{publication-validation-DxWRtzXi.js → publication-validation-cIO-Z0gj.js} +1 -1
  59. package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-DgXs6rcx.js → quadrantDiagram-7GDLP6J5-Ctwtym9P.js} +1 -1
  60. package/out/renderer/assets/{radar-MK3ICKWK-FIFs14Hm.js → radar-MK3ICKWK-CApF2ugX.js} +1 -1
  61. package/out/renderer/assets/{radient-auth-buttons-CjTgEezA.js → radient-auth-buttons-B1WkSc0e.js} +1 -1
  62. package/out/renderer/assets/{requirementDiagram-KVF5MWMF-DJ_fulOC.js → requirementDiagram-KVF5MWMF-DB3NXRpA.js} +1 -1
  63. package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-DkDkmgpo.js → sankeyDiagram-QLVOVGJD-lcLgzHR-.js} +1 -1
  64. package/out/renderer/assets/{schedules-page-BYp0ooeI.js → schedules-page-ByfZ04x2.js} +2 -2
  65. package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-DslLI_jv.js → sequenceDiagram-X6HHIX6F-C92s7I-3.js} +1 -1
  66. package/out/renderer/assets/settings-page-DaWmx0G_.js +292 -0
  67. package/out/renderer/assets/{stateDiagram-DGXRK772-WjXX5ZFj.js → stateDiagram-DGXRK772-D1MupxMG.js} +1 -1
  68. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-BsNwRWuq.js +1 -0
  69. package/out/renderer/assets/{timeline-definition-BDJGKUSR-B5dMwIwc.js → timeline-definition-BDJGKUSR-SK8QkNlF.js} +1 -1
  70. package/out/renderer/assets/{ui-preferences-store-C_k6yzj8.js → ui-preferences-store-BSjv1eml.js} +1 -1
  71. package/out/renderer/assets/{use-download-agent-mutation-Duu1Yzmd.js → use-download-agent-mutation-Bik5KhXj.js} +1 -1
  72. package/out/renderer/assets/{use-memberships-query-D0178BB5.js → use-memberships-query-CXnke9-r.js} +1 -1
  73. package/out/renderer/assets/{use-session-snapshot-DylLmksx.js → use-session-snapshot-D20-nQEA.js} +1 -1
  74. package/out/renderer/assets/{xychartDiagram-VJFVF3MP-ClyMBBI3.js → xychartDiagram-VJFVF3MP-_YTSS36c.js} +1 -1
  75. package/out/renderer/console-capture.html +5 -5
  76. package/out/renderer/index.html +7 -7
  77. package/out/renderer/installer.html +4 -4
  78. package/out/renderer/mini.html +7 -7
  79. package/package.json +4 -3
  80. package/out/renderer/assets/browser-page-C52F14Yv.js +0 -1
  81. package/out/renderer/assets/channel-Yjo7b_td.js +0 -1
  82. package/out/renderer/assets/classDiagram-GIVACNV2-Cdmkh24H.js +0 -1
  83. package/out/renderer/assets/classDiagram-v2-COTLJTTW-Cdmkh24H.js +0 -1
  84. package/out/renderer/assets/clone-BOQDMNRz.js +0 -1
  85. package/out/renderer/assets/index-CF-SqRCw.js +0 -57
  86. package/out/renderer/assets/index-CSvB6_Ie.css +0 -1
  87. package/out/renderer/assets/projects-page-Y9v0wFR-.js +0 -45
  88. package/out/renderer/assets/settings-page-CR012gt8.js +0 -292
  89. package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-DPmr9Ge_.js +0 -1
@@ -1,292 +0,0 @@
1
- import{r as l,t as n,j as t,c as de,d as $n,L as Ot}from"./index-CF-SqRCw.js";import{cr as _t,cs as Bn,ct as Lt,cu as ke,bM as Hn,C as je,ah as on,ai as jt,a4 as rn,u as cn,aG as Vn,aH as Gn,cv as qn,cw as Yn,cx as Zn,cy as Qn,cz as ln,cA as wt,af as dn,cB as Wn,aL as Jn,cC as Ft,ad as Xn,cD as es,cE as ts,cF as ns,cG as ss,Z as Nt,cH as is,cI as as,a3 as un,aN as gt,aO as mt,cJ as os,aS as rs,cK as cs,c6 as pt,a as _n,c as Dt,ar as Ze,cL as ls,cM as ds,cN as us,d as ve,cO as ht,cP as _s,cQ as gs,cR as ms,aJ as ps,bA as hs,cS as gn,cT as fs,cU as ys,cV as xs,B as ks,cW as mn,aM as pn,cX as hn,cY as vs,cZ as bs,c_ as js,c$ as ws,d0 as Ns,d1 as Ss,d2 as Ms,d3 as Cs,D as As,bH as fn,aT as Es,bh as Rs,d4 as De,d5 as ft,d6 as zt,d7 as Ts,d8 as Is,d9 as Os,da as Ls,db as yn,dc as Fs,bu as Ds,bP as zs,bO as Us,dd as Ps,de as Ks,df as $s,dg as Bs,dh as Hs,di as Vs}from"./conversation-input-sync-Bud_iL2h.js";import{K as Gs,u as be,n as qs,o as Ys,q as Zs,T as Qs,r as xn}from"./ui-preferences-store-C_k6yzj8.js";import{bh as kn,bi as Ws,bj as Js,bk as se,b1 as et,b2 as ce,bl as Xs,aH as Ut,bm as ei,bn as ti,bo as Ge,S as ni,b0 as si,bp as ii,bq as ai,br as oi,bs as ri,bt as ci,bu as li,aS as Pt,bv as di,aN as ui,aZ as Kt,bw as _i,a_ as gi,a$ as mi,bx as pi,by as hi}from"./index-Cq2MGZTE.js";import{P as fi}from"./page-header-C9NIPdYQ.js";import{c as w,u as G,B as U,S as ue,M as yi,F as xi,G as ki,H as vi,J as bi,K as ji,l as Ke,a0 as Xe,L as he,I as Ee,Y as yt,Z as xt,_ as Ue,ab as $t,T as vn,C as wi,q as Ni,r as Si,s as Mi,v as Ci,w as Bt,p as Ai,A as ie,z as Ei,E as Ri,ac as Ti,a4 as Ii,g as Oi,k as bn}from"./error-boundary-CnAfZpXJ.js";import{R as Li}from"./radient-auth-buttons-CjTgEezA.js";import{N as Fi}from"./notebook-pen-7O_-yyf1.js";import{B as Di}from"./book-open-CqpAQX_h.js";import{a as zi,p as ot}from"./parseISO-BHJWTxrA.js";import{i as Ui,a as Ae,f as Pi}from"./format-esAOn2VS.js";import{t as Ki}from"./en-US-CHJkXXr4.js";import"./console-mirror-CqKozfMV.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 $i=[["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"}]],Bi=w("aperture",$i);/**
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 Hi=[["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"}]],Vi=w("atom",Hi);/**
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 Gi=[["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"}]],qi=w("audio-waveform",Gi);/**
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 Yi=[["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"}]],Zi=w("binary",Yi);/**
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 Qi=[["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"}]],Wi=w("candy",Qi);/**
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 Ji=[["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"}]],Xi=w("car-front",Ji);/**
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 ea=[["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"}]],ta=w("cassette-tape",ea);/**
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 na=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],sa=w("chart-line",na);/**
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 ia=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],aa=w("circle-play",ia);/**
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 oa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],ra=w("circle-plus",oa);/**
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 ca=[["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"}]],la=w("circuit-board",ca);/**
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 da=[["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"}]],ua=w("cloud-lightning",da);/**
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 _a=[["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"}]],ga=w("cloud-moon",_a);/**
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 ma=[["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"}]],pa=w("cloud-snow",ma);/**
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 ha=[["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"}]],fa=w("cloud-sun",ha);/**
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 ya=[["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"}]],xa=w("coffee",ya);/**
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 ka=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 18a6 6 0 0 0 0-12v12z",key:"j4l70d"}]],jn=w("contrast",ka);/**
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 va=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],ba=w("credit-card",va);/**
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 ja=[["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"}]],wa=w("cup-soda",ja);/**
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 Na=[["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"}]],Sa=w("disc-3",Na);/**
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 Ma=[["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"}]],Ca=w("droplet",Ma);/**
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 Aa=[["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"}]],Ea=w("droplets",Aa);/**
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 Ra=[["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"}]],Ta=w("fish",Ra);/**
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 Ia=[["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"}]],Oa=w("flame",Ia);/**
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 La=[["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"}]],Fa=w("flower-2",La);/**
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 Da=[["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"}]],za=w("flower",Da);/**
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 Ua=[["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"}]],Pa=w("ghost",Ua);/**
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 Ka=[["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"}]],$a=w("github",Ka);/**
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 Ba=[["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"}]],Ha=w("guitar",Ba);/**
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 Va=[["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"}]],Ga=w("hexagon",Va);/**
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 qa=[["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"}]],Ya=w("ice-cream-bowl",qa);/**
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 Za=[["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"}]],Qa=w("joystick",Za);/**
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 Wa=[["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"}]],Ja=w("leaf",Wa);/**
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 Xa=[["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"}]],eo=w("lightbulb",Xa);/**
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 to=[["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=w("milk",to);/**
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"}]],io=w("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 ao=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],oo=w("moon",ao);/**
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 ro=[["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"}]],co=w("mountain-snow",ro);/**
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 lo=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],uo=w("mountain",lo);/**
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 _o=[["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"}]],go=w("radio",_o);/**
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 mo=[["path",{d:"M22 18H2a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4Z",key:"1404fh"}],["path",{d:"M21 14 10 2 3 14h18Z",key:"1nzg7v"}],["path",{d:"M10 2v16",key:"1labyt"}]],po=w("sailboat",mo);/**
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 ho=[["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"}]],fo=w("shirt",ho);/**
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 yo=[["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"}]],xo=w("skull",yo);/**
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 ko=[["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"}]],vo=w("snowflake",ko);/**
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 bo=[["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"}]],jo=w("sparkle",bo);/**
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 wo=[["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"}]],No=w("sun-dim",wo);/**
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 So=[["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"}]],Mo=w("sun",So);/**
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 Co=[["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"}]],Ao=w("sunrise",Co);/**
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 Eo=[["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"}]],Ro=w("sunset",Eo);/**
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 To=[["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"}]],Io=w("tent",To);/**
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 Oo=[["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"}]],Lo=w("tree-deciduous",Oo);/**
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 Fo=[["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"}]],Do=w("tree-palm",Fo);/**
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 zo=[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]],Uo=w("tree-pine",zo);/**
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 Po=[["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"}]],Ko=w("trees",Po);/**
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 $o=[["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"}]],Bo=w("umbrella",$o);/**
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 Ho=[["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"}]],Vo=w("waves",Ho);/**
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 Go=[["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"}]],qo=w("wheat",Go);/**
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 Yo=[["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"}]],Zo=w("wind",Yo),Qo=({appVersion:e=null,slowWaitHintMs:s})=>{G();const i="https://local-operator.com/download",[a,o]=l.useState(!1),r=kn(a,s??Ws),[d,g]=l.useState(!1),[c,_]=l.useState(null),[f,v]=l.useState("info"),[j,m]=l.useState(null),[p,A]=l.useState(null),M=e?.trim()?e.trim():null,q=l.useRef(!1),N=_t(O=>O.openDetail),H=l.useRef(!1),P=l.useRef(0),E=l.useRef(!1),C=l.useCallback((O,z)=>{H.current=!1,_(O),v(z),g(!0)},[]),Q=l.useCallback(O=>{H.current=!0,_(O),v("success"),g(!0)},[]),Z=l.useCallback(()=>{H.current&&(H.current=!1,g(!1),_(null))},[]),{clearDeferredUpdate:J}=Bn();l.useEffect(()=>{const O=window.api.updater.onUpdateError(h=>{q.current&&h.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:""}),H.current=!1,_(null),v("warning"),g(!0))}),z=window.api.updater.onBackendUpdateDevMode(h=>{q.current&&C(h,"info")}),L=()=>{E.current=!0,Z()},$=window.api.updater.onUpdateAvailable(L),B=window.api.updater.onUpdateNpxAvailable(L),ae=window.api.updater.onBackendUpdateAvailable(L);return()=>{O(),z(),$(),B(),ae()}},[Z,C]),l.useEffect(()=>{let O=!1;const z=()=>{window.api.updater.getLastInstallAttempt().then($=>{O||A($)}).catch(()=>{})};z();const L=window.api.updater.onUpdateInstallFailed(()=>z());return()=>{O=!0,L()}},[]);const T=async()=>{const O=++P.current;Z(),E.current=!1;try{o(!0),q.current=!0,J(ke.UI),J(ke.BACKEND);const z=await window.api.updater.checkForAllUpdates({manual:!0});if(O!==P.current)return;z.app==="available"&&N(ke.UI),z.server==="available"&&N(ke.BACKEND),z?.affirmation&&!E.current?Q(z.affirmation):Z()}catch(z){if(O!==P.current)return;console.warn(`Update check failed; the app-level alert owns the report: ${Js(z)}`)}finally{O===P.current&&o(!1),setTimeout(()=>{q.current=!1},2e3)}},te=()=>{H.current=!1,g(!1),_(null)};return t.jsxs(t.Fragment,{children:[p&&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"),p.targetVersion," ",n("ui.common.updates.check_for_updates_button.didn_t_finish"),p.attempts>1?n("ui.common.updates.check_for_updates_button.detail",{attempts:p.attempts,attemptsText:String(p.attempts)}):"",".",M?n("ui.common.updates.check_for_updates_button.version",{liveversion:String(M)}):null]}),t.jsxs("p",{className:"mt-1 text-meta text-ink-dim",children:[n("ui.common.updates.check_for_updates_button.detected")," ",p.detectedAt?new Date(p.detectedAt).toLocaleString():"at an unknown time",". ",p.detail]}),t.jsx(U,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>void window.api.openExternal(i),children:n("ui.common.updates.check_for_updates_button.download_a_fresh_copy")})]}),t.jsxs(U,{variant:"outline",onClick:()=>void T(),disabled:a,children:[a?t.jsx(ue,{size:"sm"}):null,a?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")}),j&&t.jsxs(Lt,{open:d,autoHideDuration:1e4,onClose:te,variant:"warning",children:[t.jsx("p",{className:"text-body-sm",children:j.message}),j.command&&t.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:j.command})]}),c&&f!=="danger"&&t.jsx(Lt,{open:d,autoHideDuration:6e3,onClose:te,variant:f,children:c})]})},Qe=["system-prompt"],Wo=()=>{const{shouldEnableQuery:e}=Hn();return je({enabled:e({bypassInternetCheck:!0}),queryKey:Qe,queryFn:async()=>{try{const i=await on(jt.baseUrl).config.getSystemPrompt();if(i===null)return null;if(i.status>=400)throw new Error(i.message||"Failed to fetch system prompt");return i.result}catch(s){const i=s instanceof Error?s.message:"An unknown error occurred while fetching system prompt";throw rn(i),s}},refetchOnWindowFocus:!1,staleTime:5e3})},Jo=()=>{const e=cn(),s=on(jt.baseUrl);return Vn({mutationFn:async i=>{try{const a=await s.config.updateSystemPrompt(i);if(a.status>=400)throw new Error(a.message||"Failed to update system prompt");return a.result}catch(a){const o=a instanceof Error?a.message:"An unknown error occurred while updating system prompt";throw rn(o),a}},onSuccess:async i=>{await e.invalidateQueries({queryKey:Qe,refetchType:"none"}),e.setQueryData(Qe,a=>a&&{...a,...i}),await e.refetchQueries({queryKey:Qe,type:"all"}),Gn("System prompt updated")},onError:i=>{console.error("Error updating system prompt:",i)}})},Xo=({value:e,label:s,description:i,onChange:a,icon:o,isSaving:r=!1})=>{const[d,g]=l.useState(e),c=l.useId(),_=`${c}-label`,f=`${c}-description`,v=async j=>{if(!r){g(j);try{await a(j)}catch(m){g(!j),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:_,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]}),i&&t.jsx("p",{id:f,className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:i})]}),t.jsx("div",{className:"flex h-6 shrink-0 items-center",children:r?t.jsx(ue,{size:"md",label:`Saving ${s}`}):t.jsx(yi,{checked:d,onCheckedChange:v,"aria-labelledby":_,"aria-describedby":i?f:void 0})})]})};function Ht(e,s){const i=Ki(e,s?.in);if(!Ui(i))throw new RangeError("Invalid time value");const a=Ae(i.getDate(),2),o=Ae(i.getMonth()+1,2),r=i.getFullYear(),d=Ae(i.getHours(),2),g=Ae(i.getMinutes(),2),c=Ae(i.getSeconds(),2);let _="",f="";const v=i.getTimezoneOffset();if(v!==0){const j=Math.abs(v),m=Ae(Math.trunc(j/60),2),p=Ae(j%60,2);f=`${v<0?"+":"-"}${m}:${p}`}else f="Z";return`${r}-${o}-${a}T${d}:${g}:${c}${_}${f}`}function er(e,s,i){return zi(e,-30,i)}var tr=qn({chartName:"LineChart",GraphicalChild:ln,axisComponents:[{axisType:"xAxis",AxisComp:Yn},{axisType:"yAxis",AxisComp:Zn}],formatAxisMap:Qn});const nr=["radient","creditBalance"],sr=e=>{const{user:s,isAuthenticated:i}=wt(),a=s?.account?.tenant_id,o=i&&!!a&&e?.enabled;return je({queryKey:[nr,a],queryFn:async()=>{if(!a)throw new Error("Tenant ID not available");const r=await dn({operation:"credits",tenantId:a});if(!r||typeof r.balance!="number")throw new Error("Invalid credit balance response format");return r},enabled:o,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},ir=["radient","usageRollup"],ar=(e,s)=>{const{user:i,isAuthenticated:a}=wt(),o=i?.account?.tenant_id,r=a&&!!o&&s?.enabled;return je({queryKey:[...ir,o,e],queryFn:async()=>{if(!o)throw new Error("Tenant ID not available");const d={};for(const[c,_]of Object.entries(e))_!=null&&(d[c]=String(_));const g=await dn({operation:"usage",tenantId:o,query:d});if(!g)throw new Error("Invalid usage rollup response format");return g},enabled:r,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},Vt={get[ke.UI](){return n("ui.settings.updates.update_following.application_updates")},get[ke.BACKEND](){return n("ui.settings.updates.update_following.server_updates")}},qe={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")}}},Gt=({type:e})=>{G();const s=_t(a=>a.followed[e]),i=_t(a=>a.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:Vt[e]}),t.jsx("div",{className:"mt-0.5 text-meta text-ink-muted",children:qe[s].description})]}),t.jsxs(xi,{value:s,onValueChange:a=>i(e,a),children:[t.jsx(ki,{"aria-label":n("ui.settings.updates.update_following.surface_choice",{surface:Vt[e],choice:qe[s].label}),className:"w-full sm:w-56","data-followed-segment":e,children:t.jsx(vi,{})}),t.jsx(bi,{children:Wn.map(a=>t.jsx(ji,{value:a,title:qe[a].description,children:qe[a].label},a))})]})]})},or=()=>(G(),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(Gt,{type:ke.UI}),t.jsx(Gt,{type:ke.BACKEND})]})]})),rr=({appVersion:e})=>t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(or,{}),t.jsx(Qo,{appVersion:e})]}),cr=e=>{if(!e)return null;try{return new URL(e).host}catch{return null}};function rt(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=()=>{G();const[e,s]=l.useState(null),[i,a]=l.useState({value:"Loading...",detail:null,degraded:!1}),[o,r]=l.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});l.useEffect(()=>{let g=!0;const c=m=>{if(!g)return;const p=cr(m.url);if(m.state==="connecting"){a({value:"Loading...",detail:null,degraded:!1});return}if(m.state==="detached"){a({value:"Not connected",detail:m.detail||null,degraded:!1});return}if(m.state==="wedged"){a({value:"Not attached",detail:m.detail||null,degraded:!1});return}const A=m.version||"Version unknown";a({value:p?`${A} · ${p}`:A,detail:m.detail||null,degraded:m.state==="degraded"})};let _=!1;const f=window.api?.backend?.onStatusChange(m=>{_=!0,c(m)}),v=async()=>{try{const[m,p]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);g&&(s(m),r(p))}catch(m){console.error("Error fetching app information:",m)}},j=async()=>{try{const m=window.api?.backend;if(m){const M=await m.getStatus();_||c(M);return}const p=await Ft.healthCheck(jt.baseUrl),A=Ft.getServerVersion(p);g&&a({value:A,detail:null,degraded:!1})}catch(m){console.error("Error fetching server version:",m),g&&a({value:"Unavailable",detail:null,degraded:!1})}};return v(),j(),()=>{g=!1,f?.()}},[]);const d=(g,c,_,f={})=>t.jsx(ce,{label:t.jsx(Ke,{content:_,children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(Xe,{size:12,className:"shrink-0"}),g]})}),valueClassName:f.valueClassName,value:t.jsxs(t.Fragment,{children:[f.valueTooltip?t.jsx(Ke,{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(se,{title:n("ui.settings.updates.app_updates_section.application_updates_and_info"),icon:Jn,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(et,{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"),rt(i.value),n("ui.settings.updates.app_updates_section.the_version_of_the_local_operator_api_server_backend_and_the_addr"),{valueTooltip:i.detail,valueHoverTarget:!0,statusNote:i.degraded?n("ui.settings.updates.app_updates_section.not_answering"):void 0,valueClassName:i.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"),rt(o.nodeVersion),n("ui.settings.updates.app_updates_section.the_javascript_runtime_environment_version")),d(n("ui.settings.updates.app_updates_section.electron_version"),rt(o.electronVersion),n("ui.settings.updates.app_updates_section.the_framework_version_enabling_this_desktop_application"))]}),t.jsx(rr,{appVersion:e})]})})},dr=e=>{const s=e.label.replace(/^Open\s+/,"");return s.charAt(0).toUpperCase()+s.slice(1)},ur=({action:e})=>{G();const s=l.useId(),i=l.useRef(null),a=be(p=>p.shortcutBindings),o=a[e.id],r=be(p=>p.setShortcutBinding),d=be(p=>p.clearShortcutBinding),[g,c]=l.useState(!1),[_,f]=l.useState(null),v=l.useMemo(Xn,[]),j=qs(e.id,a),m=dr(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(he,{htmlFor:s,className:"w-32 text-body-sm text-ink",children:m}),t.jsx(Ee,{id:s,readOnly:!0,value:j===null?n("ui.settings.shortcuts.keyboard_shortcuts_section.no_shortcut"):Ys(j,v),"aria-label":n("ui.settings.shortcuts.keyboard_shortcuts_section.label_press_the_keys_you_want",{label:String(m)}),"data-shortcut-action":e.id,ref:i,className:de("w-52",j===null?"text-body-sm":"font-mono text-body-sm"),onFocus:()=>c(!0),onBlur:()=>{c(!1),f(null)},onKeyDown:p=>{if(es.has(p.key))return;if(ts.has(p.key)){c(!1),f(null);return}if(ns.has(p.key)||p.nativeEvent.isComposing)return;const A=ss({key:p.key,metaKey:p.metaKey,ctrlKey:p.ctrlKey,altKey:p.altKey,shiftKey:p.shiftKey}),M=Zs(A,e.id,a,v);if(M!==null){p.preventDefault(),c(!0),f(M);return}if(A===j){c(!0),f(null);return}p.preventDefault(),c(!0),f(null),A===e.defaultChord?r(e.id,null):A!==null&&r(e.id,A)}}),j!==null&&t.jsx(U,{variant:"secondary",size:"sm","aria-label":n("ui.settings.shortcuts.keyboard_shortcuts_section.clear_label_s_shortcut",{label:String(m)}),onClick:()=>{d(e.id),i.current?.focus()},children:n("ui.settings.shortcuts.keyboard_shortcuts_section.clear")}),o!==void 0&&t.jsx(U,{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),i.current?.focus()},children:n("ui.settings.shortcuts.keyboard_shortcuts_section.reset")})]}),g&&t.jsx("span",{className:"text-meta text-ink-dim",children:n("ui.settings.shortcuts.keyboard_shortcuts_section.press_the_keys_you_want_esc_cancels")}),_!==null&&t.jsx("output",{className:"text-meta text-danger",children:_})]})},_r=({sectionRef:e})=>(G(),t.jsx(se,{title:n("ui.settings.shortcuts.keyboard_shortcuts_section.keyboard_shortcuts"),icon:Xs,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:Gs.map(s=>t.jsx(ur,{action:s},s.id))})})),gr=[[[".claude.json"],"Claude Code"],[[".claude",".mcp.json"],"Claude Code"],[[".cursor","mcp.json"],"Cursor"],[[".vscode","mcp.json"],"VS Code"],[[".codex","config.toml"],"Codex CLI"]];function wn(e){if(!e)return null;const s=e.split("\\").join("/").split("/").filter(Boolean);for(const[i,a]of gr)if(!(s.length<i.length)&&s.slice(-i.length).join("/")===i.join("/"))return a;return null}const We=e=>n("ui.settings.integrations.integration_model.tool_count",{count:e}),mr=e=>n("ui.settings.integrations.integration_model.integration_count",{count:e}),pr=["connected","needs_sign_in","not_started","connecting","error"],Nn=e=>pr.includes(e),Oe=(e,s)=>[...s].filter(i=>i.name===e&&i.status==="running").sort((i,a)=>a.created_at-i.created_at)[0]??null,hr={connectedAt:null,connectedToolCount:null,settledGroup:null,pinnedGroup:null,pinnedOperationId:null,needsKey:!1,needsSignIn:!1,disconnectedAt:null,holdUntil:null,lastDecisive:null},fr=1e12,yr=1e9,xr=60*60*1e3,Sn=(e,s=Date.now())=>{if(typeof e!="number"||!Number.isFinite(e))return null;const i=e>=fr?e:e<yr?null:e*1e3;return i===null||i>s+xr?null:Math.min(i,s)},Re=(e,s)=>e?.[s]??hr,Be=(e,s,i)=>br(e,s)??i?.lastDecisive??null,kr=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}:{}}),St=(e,s)=>e.status==="not_started"&&typeof e.tool_count=="number"&&(s.connectedAt!==null||e.status_basis==="stored"&&e.tool_count_basis==="last_seen"),vr=(e,s)=>[...s].filter(i=>i.name===e).sort((i,a)=>a.created_at-i.created_at)[0]??null,br=(e,s)=>vr(e,s.filter(i=>i.status!=="cancelled")),tt=e=>e.actions.includes("set_key")||e.actions.includes("add_key");function jr(e,s){const i=Math.max(0,Math.round((e-s)/1e3));if(i<60)return n("ui.settings.integrations.integration_model.just_now");const a=Math.round(i/60);if(a<60)return n("ui.settings.integrations.integration_model.minutes_min_ago",{minutes:a});const o=Math.round(a/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 ct(e){if(!e)return null;const s=e.trim();if(!s||/^\/\w/.test(s)||/\/mcp\s+\w+/.test(s))return null;let i=s;for(let a=0;a<3;a+=1){const o=i.replace(/^(?:connection (?:closed|error|refused)|error|closed|failed)\s*:\s*/i,"").trim();if(o===i)break;i=o}return i=i.replace(/\s*\(\s*\d{3}\s*\)/g,"").replace(/\s+([.,;])/g,"$1").replace(/\s{2,}/g," ").trim(),i||null}function wr(e,s=[],i,a=Date.now()){const o=Re(i,e.name),r=Oe(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(!Nn(e.status))return{label:n("ui.settings.integrations.integration_model.status_unavailable"),tone:"neutral",detail:null,busy:!1};const d=Be(e.name,s,o),g=nt(d)&&e.status!=="connected",c=St(e,o),_=At(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(We(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"||Pe(e,s,o)?n("ui.settings.integrations.integration_model.needs_a_key"):n("ui.settings.integrations.integration_model.needs_sign_in"),tone:"warning",detail:ct(e.status_reason),busy:!1};case"error":return{label:n("ui.settings.integrations.integration_model.couldn_t_start"),tone:"danger",detail:ct(e.status_reason)??n("ui.settings.integrations.integration_model.no_reason_was_given"),busy:!1};default:if(g)return{label:n("ui.settings.integrations.integration_model.signed_out"),tone:"warning",detail:null,busy:!1};if(_)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(Pe(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"||Pe(e,s,o)?n("ui.settings.integrations.integration_model.needs_a_key"):n("ui.settings.integrations.integration_model.needs_sign_in"),tone:"warning",detail:ct(e.status_reason),busy:!1};if(e.status_basis==="stored"&&c&&o.disconnectedAt===null){const v=o.connectedAt??Sn(e.last_seen_at,a);return{label:v!==null?n("ui.settings.integrations.integration_model.worked_when_with_tools",{when:String(jr(a,v)),tools:String(We(e.tool_count))}):n("ui.settings.integrations.integration_model.worked_earlier_with_tools",{tools:String(We(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 Mn=e=>n("ui.settings.integrations.integration_model.replace_keys",{count:e}),Nr=/[,;]?\s*(?:or|and)?\s*add (?:its|a|the) key instead\.?\s*$/i;function Sr(e,s){const i=e?.trim()??"";if(!i)return null;if(s)return i;const a=i.replace(Nr,"").trim();return a?/\.$/.test(a)?a:`${a}.`:i}const Mr="ui.settings.integrations.integration_model.copy_ready_explanation",Cr="ui.settings.integrations.integration_model.copy_not_connected_explanation",Ar=e=>e.transport==="local_command"?n("ui.settings.integrations.integration_model.local_command"):n("ui.settings.integrations.integration_model.remote_url");function Cn(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 wn(e.source.path)}}function Er(e,s){const i=[Ar(e)];e.status!=="connected"&&e.tool_count_basis==="last_seen"&&typeof e.tool_count=="number"&&i.push(n("ui.settings.integrations.integration_model.tools_when_last_checked",{tools:String(We(e.tool_count))})),s&&i.push(e.scope==="project"?n("ui.settings.integrations.integration_model.this_project"):n("ui.settings.integrations.integration_model.global"));const a=Cn(e);return a?i.push(n("ui.settings.integrations.integration_model.imported_from_origin",{origin:String(a)})):e.source.editable||i.push(n("ui.settings.integrations.integration_model.imported_from_a_project_file")),i}const Mt=(e,s)=>s.disconnectedAt!==null?"not_started":e.status;function Ct(e,s=[],i){const a=Re(i,e.name),o=Oe(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=tt(e),g=Pe(e,s,a);if(!Nn(e.status))return r("test")?{kind:"test",label:n("ui.settings.integrations.integration_model.check_again")}:null;const c=Be(e.name,s,a),_=c?.status==="failed"&&He(c);switch(Mt(e,a)){case"connected":case"connecting":return null;case"needs_sign_in":return g?{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(nt(c)&&r("sign_in"))return{kind:"sign_in",label:n("ui.settings.integrations.integration_model.sign_in")};if(At(c)&&r("sign_out"))return{kind:"sign_out",label:n("ui.settings.integrations.integration_model.sign_out_again")};if(a.disconnectedAt!==null&&r("connect"))return{kind:"connect",label:n("ui.settings.integrations.integration_model.connect")};if(a.needsSignIn){if(g&&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 g&&d?{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.try_again")}:St(e,a)&&!r("connect")?null:r("connect")?{kind:"connect",label:n("ui.settings.integrations.integration_model.connect"),...a.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 He=e=>e.action==="login"||e.action==="reauth",nt=e=>!!(e&&e.action==="logout"&&e.status==="complete"),At=e=>!!(e&&e.action==="logout"&&e.status!=="running"&&e.status!=="complete"),An=/no oauth authorization server/i;function Pe(e,s,i){if(!tt(e))return!1;const a=Be(e.name,s,i);return a&&He(a)&&a.status==="failed"&&An.test(a.message??"")?!0:i.needsKey}function Rr(e,s=[],i){const a=Ct(e,s,i)?.kind,o=Mt(e,Re(i,e.name)),r=c=>e.actions.includes(c),d=[],g=Oe(e.name,s);if(g&&d.push({kind:"cancel",label:n("ui.settings.integrations.integration_model.cancel")}),!g&&r("test")&&a!=="test"&&d.push({kind:"test",label:n("ui.settings.integrations.integration_model.test_connection")}),r("connect")&&a!=="connect"&&o!=="connected"&&d.push({kind:"connect",label:n("ui.settings.integrations.integration_model.reconnect")}),!g&&r("sign_in")&&a!=="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")}),!g&&r("reauth")&&a!=="reauth"&&d.push({kind:"reauth",label:n("ui.settings.integrations.integration_model.sign_in_again")}),tt(e)&&a!=="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")}),a!=="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=Cn(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 Tr={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 En(e,s=[],i){const a=Re(i,e.name),o=Oe(e.name,s),r=Mt(e,a);if(o&&a.pinnedGroup&&a.pinnedOperationId===o.id)return a.pinnedGroup;if(r==="needs_sign_in"||r==="error")return"attention";const d=Be(e.name,s,a);return nt(d)&&r!=="connected"||At(d)&&r!=="connected"?"attention":a.disconnectedAt!==null?"ready":Pe(e,s,a)||a.needsSignIn&&r!=="connected"||d?.status==="failed"&&He(d)&&r!=="connected"?"attention":r==="connected"||e.status_basis==="stored"&&St(e,a)?"connected":o&&o.action!=="test"?"attention":"ready"}function Ir(e,s=[],i){return["attention","connected","ready"].map(o=>({id:o,title:Tr[o],rows:e.filter(r=>En(r,s,i)===o)})).filter(o=>o.rows.length>0)}function Or(e,s,i=Date.now()){if(!s)return e??{};const a={};for(const o of s.servers){const r=Re(e,o.name),d=Oe(o.name,s.operations),g=Be(o.name,s.operations,r),c=nt(g),_=o.status==="connected"&&(o.status_basis==="probe"||o.status_basis==="live"),f=r.holdUntil!==null&&i<r.holdUntil,v=!f&&!c&&r.connectedAt===null&&o.status_basis==="stored"&&o.tool_count_basis==="last_seen"?Sn(o.last_seen_at,i):null,j=!c,m=g?.status==="failed"&&He(g)&&An.test(g.message??""),p={connectedAt:_&&!f?i:v!==null?v:j?r.connectedAt:null,connectedToolCount:_&&!f||v!==null?o.tool_count??r.connectedToolCount:j?r.connectedToolCount:null,settledGroup:r.settledGroup,pinnedGroup:d&&r.pinnedOperationId===d.id?r.pinnedGroup:d?r.settledGroup:null,pinnedOperationId:d?d.id:null,needsKey:_?!1:r.needsKey||m,needsSignIn:_||c?!1:r.needsSignIn||o.status==="needs_sign_in",disconnectedAt:_&&!f?null:r.disconnectedAt,holdUntil:f?r.holdUntil:null,lastDecisive:g?kr(g):null};d||(p.settledGroup=En(o,s.operations,{...a,[o.name]:p})),a[o.name]=p}return a}const Lr=(e,s)=>e!==null&&s===e,kt="local-operator.settings.integrations.row-memory",Rn=(e,s)=>`${e}#${s}`;function Fr(e,s){const i={};if(!s)return i;for(const a of s.servers){const o=e[a.name];o&&(i[Rn(a.source.path,a.name)]=o)}return i}function Dr(e,s,i){if(!s)return e;let a=null;for(const o of s.servers){if(Object.prototype.hasOwnProperty.call(e,o.name))continue;const r=Pr(i[Rn(o.source.path,o.name)]);r&&(a=a??{...e},a[o.name]=r)}return a??e}const zr=["attention","connected","ready"],Tn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Et=e=>typeof e=="number"&&Number.isFinite(e)?e:null,qt=e=>zr.includes(e)?e:null,lt=e=>{const s=Et(e);return s!==null&&s>=1e12?s:null};function Ur(e){if(!Tn(e)||typeof e.id!="string"||typeof e.name!="string")return null;const s=e.action,i=e.status;return s!=="login"&&s!=="logout"&&s!=="reauth"&&s!=="test"||i!=="running"&&i!=="complete"&&i!=="cancelled"&&i!=="failed"?null:{id:e.id,name:e.name,action:s,status:i,created_at:Et(e.created_at)??0,credential_removed:e.credential_removed===!0,...typeof e.message=="string"?{message:e.message}:{}}}function Pr(e){if(!Tn(e))return null;const s=lt(e.connectedAt),i=lt(e.disconnectedAt),a=e.needsKey===!0,o=e.needsSignIn===!0,r=Ur(e.lastDecisive);return s===null&&i===null&&!a&&!o&&!r?null:{connectedAt:s,connectedToolCount:Et(e.connectedToolCount),settledGroup:qt(e.settledGroup),pinnedGroup:qt(e.pinnedGroup),pinnedOperationId:typeof e.pinnedOperationId=="string"?e.pinnedOperationId:null,needsKey:a,needsSignIn:o,disconnectedAt:i,holdUntil:lt(e.holdUntil),lastDecisive:r}}const In=2e3,Yt=8e3;function Kr(e){return e&&(e.servers.some(i=>i.status==="connecting")||e.operations.some(i=>i.status==="running"))?In:!1}const $r=/^[A-Za-z0-9_.:-]{1,100}$/,Br=/:\/\//;function Hr(e,s){const i=e.trim();return i?$r.test(i)?s.includes(i)?n("ui.settings.integrations.integration_model.an_integration_named_trimmed_already_exists",{trimmed:String(i)}):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 Vr(e){const s=e.trim();if(!s)return n("ui.settings.integrations.integration_model.enter_the_server_s_url");let i;try{i=new URL(s)}catch{return n("ui.settings.integrations.integration_model.enter_a_full_url_like_https_mcp_example_com_mcp")}return i.protocol!=="https:"&&i.protocol!=="http:"?n("ui.settings.integrations.integration_model.the_url_must_start_with_https_or_http"):i.hostname?i.username||i.password?n("ui.settings.integrations.integration_model.remove_the_username_or_password_from_the_url_keys_are_added_after"):i.search||i.hash?n("ui.settings.integrations.integration_model.remove_the_or_part_of_the_url_keys_are_added_after_it_s_saved"):Br.test(s.slice(i.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 Gr=e=>e.split(`
292
- `).map(s=>s.trim()).filter(Boolean);function vt(e,s){const i=!!e?.cold,a=(e?.servers??[]).map(o=>{const r=o.transport==="http",d=o.secret_refs??[],g=o.status==="connected"?"connected":o.status==="connecting"?"connecting":o.status==="auth-required"?"needs_sign_in":"not_started",c=[];g!=="connected"&&c.push("connect"),g==="connected"&&c.push("disconnect"),i||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 _=wn(o.source);return{id:o.name,name:o.name,scope:o.owned_scope??"global",project_cwd:null,source:{kind:qr(o.source,_,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:g,status_reason:null,status_observed_at:null,last_seen_at:null,status_basis:i?"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:a.some(o=>o.source.owned_scope==="project"),global_path:"",project_path:null,status_source:i?"config":"live",session_id:s,servers:a,operations:(e?.operations??[]).map(o=>({...o}))}}const qr=(e,s,i)=>s==="Claude Code"?"claude-code":s==="Cursor"?"cursor":s==="VS Code"?"vscode":s==="Codex CLI"?"codex":i?"local-operator":e?"project-mcp-json":"local-operator",Zt={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")}},Yr="ui.settings.integrations.integration_model.copy_catalog_refusal_fallback";function Ye(e,s,i){if(s instanceof Nt&&s.status===409){const a=typeof s.code=="string"&&Object.prototype.hasOwnProperty.call(Zt,s.code)?Zt[s.code]:n(Yr);return`${is[e]}. ${a}`}return as(e,s,i).message}const Zr="ui.settings.integrations.add_integration_form.copy_add_integration_pickup_note",Qr="ui.settings.integrations.add_integration_form.copy_transport_hint",Wr=({existingNames:e,projectScopeAvailable:s,projectLabel:i,onSubmit:a,onCancel:o,initial:r})=>{G();const[d,g]=l.useState(r?.name??""),[c,_]=l.useState(r?.mode??"command"),[f,v]=l.useState(r?.command??""),[j,m]=l.useState(r?.args??""),[p,A]=l.useState(r?.url??""),[M,q]=l.useState("global"),[N,H]=l.useState(r?.touched?{name:!0,command:!0,url:!0}:{}),[P,E]=l.useState(!!r?.touched),[C,Q]=l.useState(!1),[Z,J]=l.useState(null),T=l.useRef(null),te=l.useRef(null),O=l.useRef(null);l.useEffect(()=>{T.current?.focus()},[]);const z=Hr(d,e),L=c==="command"&&!f.trim()?n("ui.settings.integrations.add_integration_form.enter_the_command_to_run"):null,$=c==="url"?Vr(p):null,B=k=>P||N[k],ae=async k=>{if(k.preventDefault(),E(!0),z||L||$){z?T.current?.focus():L?te.current?.focus():O.current?.focus();return}Q(!0),J(null);const V=s?M:"global",Y=c==="command"?{name:d.trim(),scope:V,mode:c,command:f.trim(),args:Gr(j)}:{name:d.trim(),scope:V,mode:c,url:p.trim()},X=await a(Y);Q(!1),J(X)},h=(k,V,Y)=>V&&B(Y)?t.jsx("p",{id:k,className:"text-body-sm text-danger",children:V}):null,I=k=>k.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:k=>void ae(k),onKeyDown:k=>{k.key==="Escape"&&(k.stopPropagation(),o())},children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(he,{htmlFor:"integration-add-name",children:n("ui.settings.integrations.add_integration_form.name")}),t.jsx(Ee,{ref:T,id:"integration-add-name",value:d,placeholder:n("ui.settings.integrations.add_integration_form.e_g_notion"),autoComplete:"off","aria-invalid":!!(z&&B("name")),"aria-describedby":z&&B("name")?"integration-add-name-error":void 0,onChange:k=>g(k.target.value),onBlur:()=>H(k=>({...k,name:!0}))}),h("integration-add-name-error",z,"name")]}),t.jsxs(yt,{value:c,onValueChange:k=>_(k==="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(xt,{"aria-labelledby":"integration-add-transport-label",children:[t.jsx(Ue,{value:"command","data-integration-transport":"command",children:n("ui.settings.integrations.add_integration_form.local_command")}),t.jsx(Ue,{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(Qr)}),t.jsxs($t,{value:"command",className:"mt-0 flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(he,{htmlFor:"integration-add-command",children:n("ui.settings.integrations.add_integration_form.command")}),t.jsx(Ee,{ref:te,id:"integration-add-command",value:f,placeholder:n("ui.settings.integrations.add_integration_form.e_g_npx"),autoComplete:"off",className:"font-mono","aria-invalid":!!(L&&B("command")),"aria-describedby":L&&B("command")?"integration-add-command-error":void 0,onChange:k=>v(k.target.value),onBlur:()=>H(k=>({...k,command:!0}))}),h("integration-add-command-error",L,"command")]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs(he,{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(vn,{id:"integration-add-args",value:j,rows:2,className:"font-mono",onChange:k=>m(k.target.value)})]})]}),t.jsx($t,{value:"url",className:"mt-0 flex flex-col gap-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(he,{htmlFor:"integration-add-url",children:n("ui.settings.integrations.add_integration_form.url")}),t.jsx(Ee,{ref:O,id:"integration-add-url",type:"url",value:p,placeholder:n("ui.settings.integrations.add_integration_form.https_mcp_example_com_mcp"),autoComplete:"off",className:"font-mono","aria-invalid":!!($&&B("url")),"aria-describedby":$&&B("url")?"integration-add-url-error":"integration-add-url-help",onChange:k=>A(k.target.value),onBlur:()=>H(k=>({...k,url:!0}))}),h("integration-add-url-error",$,"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(yt,{value:M,onValueChange:k=>q(k==="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(xt,{"aria-labelledby":"integration-add-scope-label",children:[t.jsx(Ue,{value:"global","data-integration-scope":"global",children:n("ui.settings.integrations.add_integration_form.all_chats")}),t.jsx(Ue,{value:"project","data-integration-scope":"project",children:n("ui.settings.integrations.add_integration_form.this_project")})]}),i?t.jsx("p",{className:"text-ink-dim text-meta",children:M==="project"?n("ui.settings.integrations.add_integration_form.only_chats_working_in_projectlabel",{projectLabel:String(i)}):n("ui.settings.integrations.add_integration_form.every_chat_in_any_folder")}):null]}):null,Z?t.jsx("p",{className:"text-body-sm text-danger",role:"alert",children:Z}):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(Zr)}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(U,{type:"button",variant:"ghost",size:"md",onMouseDown:I,onClick:o,children:n("ui.settings.integrations.add_integration_form.cancel")}),t.jsxs(U,{type:"submit",variant:"primary",size:"md",disabled:C,onMouseDown:I,children:[C?t.jsx(ue,{size:"xs"}):null,n("ui.settings.integrations.add_integration_form.add_integration")]})]})]})]})},Jr=4;function Xr(e){return e.rowMoving?e.now+e.windowMs:Math.max(e.hold.until,e.lastMovingAt+e.windowMs)}function ec(e){return e.now>e.hold.until||e.hold.reanchors>=Jr?"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 tc(e){const s=Xr({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 i=e.hold.landedOn??null,a=e.candidate;if(!a)return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:i},land:null};if(!i)return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:a},land:a};const o=ec({hold:{until:s,reanchors:e.hold.reanchors,landedOn:i},candidate:a,active:e.active,body:e.body,now:e.now});if(o==="settled")return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:i},land:null};if(o==="drop")return{hold:null,land:null};const r=!i.isConnected;return{hold:{until:r?e.now+e.windowMs:s,reanchors:r?e.hold.reanchors+1:e.hold.reanchors,landedOn:a},land:a}}function nc(e){const{row:s,target:i}=e;return!s||!i||typeof i.nodeType!="number"?!1:!s.contains(i)}const Qt=250;function Wt(e){return e?!e.disabled:!1}function sc(e){return Wt(e.primary)?e.primary??null:Wt(e.overflow)?e.overflow??null:null}function ic(e){return e.verdict==="finished"?null:e.watchMs}const On="key";function ac(e){const{name:s,keyless:i,freeName:a,names:o,values:r,replace:d,canReplace:g}=e;if(i){const c=bt(s,a);return{values:{[c]:(r[On]??"").trim()},confirmedReplace:d&&g?[c]:[],header:a.trim()}}return{values:Object.fromEntries(o.map(c=>[c,(r[c]??"").trim()])),confirmedReplace:d&&g?o:[],header:void 0}}function bt(e,s){const i=Jt(e),a=Jt(s);if(!a)return"";const o=[i,a].filter(Boolean).join("_"),r=/^[A-Za-z_]/.test(o)?o:`K_${o}`;if(r.length<=dt)return r;const d=oc(i),g=dt-a.length-d.length-2,c=[i.slice(0,Math.max(g,0)),d,a].filter(Boolean).join("_");return c.length<=dt?c:c.slice(-128)}const dt=128,Jt=e=>e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,""),oc=e=>{let s=2166136261;for(let i=0;i<e.length;i+=1)s^=e.charCodeAt(i),s=Math.imul(s,16777619)>>>0;return s.toString(36).toUpperCase().slice(0,5)},rc=({name:e,keyNames:s,keyless:i=!1,savedKeys:a=[],saving:o,failure:r,onSave:d,onClose:g})=>{G();const[c,_]=l.useState({}),[f,v]=l.useState(!1),[j,m]=l.useState(""),p=i?[bt(e,j)]:[...s],A=i?[On]:p,M=(i?bt(e,j).length>0:!0)&&A.every(N=>(c[N]??"").trim()),q=p.some(N=>a.includes(N));return t.jsx(un,{open:!0,onClose:g,maxWidth:"xs",title:n("ui.settings.integrations.integration_key_dialog.add_keys_heading",{count:i?1:s.length,name:e}),actions:t.jsxs(t.Fragment,{children:[t.jsx(gt,{onClick:g,children:n("ui.settings.integrations.integration_key_dialog.cancel")}),t.jsx(mt,{disabled:!M||o,onClick:()=>{const N=ac({name:e,keyless:i,freeName:j,names:p,values:c,replace:f,canReplace:q});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:i?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")}),i?t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(he,{htmlFor:"integration-key-name",children:n("ui.settings.integrations.integration_key_dialog.the_header_this_server_wants_the_key_in")}),t.jsx(Ee,{id:"integration-key-name",autoComplete:"off",placeholder:n("ui.settings.integrations.integration_key_dialog.e_g_authorization_or_x_api_key"),value:j,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=>i!==!0||N.trim().length>0).map(N=>t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(he,{htmlFor:`integration-key-${N}`,className:"font-mono",children:i?"Key":N}),t.jsx(Ee,{id:`integration-key-${N}`,type:"password",autoComplete:"off",value:c[N]??"",onChange:H=>_(P=>({...P,[N]:H.target.value}))})]},N)),q?t.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[t.jsx(wi,{id:"integration-key-replace",checked:f,onCheckedChange:N=>v(N===!0)}),t.jsx(he,{htmlFor:"integration-key-replace",className:"font-normal",children:Mn(p.length)})]}):null,r?t.jsx("p",{className:"-mx-1.5 text-body-sm text-danger",role:"alert",children:r}):null]})})},cc={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",neutral:"bg-ink-dim"},lc={success:"text-ink-muted",warning:"text-warning",danger:"text-danger",info:"text-ink-muted",neutral:"text-ink-dim"};function Xt(e){if(e===n("ui.settings.integrations.integration_model.ready"))return n(Mr);if(e===n("ui.settings.integrations.integration_model.not_connected"))return n(Cr)}const dc=({row:e,operations:s,memories:i,now:a,projectScopeAvailable:o,highlighted:r=!1,rowRef:d,primaryRef:g,overflowRef:c,pending:_,failure:f,confirm:v,onPrimary:j,onOverflow:m,onConfirm:p,onCancelConfirm:A})=>{G();const M=wr(e,s,i,a),q=r&&M.tone==="danger"?"text-ink":lc[M.tone],N=Ct(e,s,i),H=Rr(e,s,i),P=Er(e,o),E=H.findIndex(C=>C.kind==="remove"||C.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:C=>{!v||C.key!=="Escape"||(C.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:M.busy?t.jsx(ue,{size:"xs"}):t.jsx("span",{"aria-hidden":"true","data-tone":M.tone,className:de("size-2 rounded-full",cc[M.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:P.map((C,Q)=>t.jsxs("span",{children:[Q>0?" · ":null,C.startsWith("Imported from")&&e.source.path?t.jsx(Ke,{content:os(e.source.path),children:t.jsx("span",{className:"underline decoration-dotted underline-offset-2",children:C})}):C]},C))})]}),Xt(M.label)?t.jsx(Ke,{content:Xt(M.label),children:t.jsx("span",{className:de("shrink-0 text-body-sm",q),children:M.label})}):t.jsx("span",{className:de("shrink-0 text-body-sm",q),children:M.label}),N?t.jsxs(U,{ref:g,variant:N.variant??"secondary",size:"sm","aria-label":`${N.label} ${e.name}`,disabled:_,"data-integration-action":N.kind,onClick:()=>j(N),children:[_?t.jsx(ue,{size:"xs"}):null,N.label]}):null,t.jsxs(Ni,{children:[t.jsx(Si,{asChild:!0,children:t.jsx(U,{ref:c,variant:"ghost",size:"icon-sm","aria-label":n("ui.settings.integrations.integration_row.more_actions_for_name",{name:String(e.name)}),disabled:_,children:t.jsx(rs,{"aria-hidden":"true"})})}),t.jsx(Mi,{align:"end",className:"min-w-48",children:H.map((C,Q)=>t.jsx(uc,{item:C,separated:Q===E&&Q>0,onSelect:()=>m(C)},C.kind))})]})]}),M.detail?t.jsx("p",{className:de("pl-7 text-body-sm",M.tone==="danger"?"text-ink-muted":"text-ink-dim"),children:M.detail}):null,f?t.jsx("p",{className:de("pl-7 text-body-sm",r?"text-ink":"text-danger"),role:"alert",children:f}):null,v?t.jsxs("div",{className:"flex flex-wrap items-center gap-2 pl-7",children:[t.jsx("span",{className:"text-body-sm text-ink",children:v.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:v.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(U,{variant:"danger",size:"sm",onClick:p,"data-integration-confirm":v.kind,children:v.kind==="remove"?n("ui.settings.integrations.integration_row.remove"):n("ui.settings.integrations.integration_row.sign_out")}),t.jsx(U,{variant:"ghost",size:"sm",onClick:A,children:n("ui.settings.integrations.integration_row.keep")})]}):null]})},uc=({item:e,separated:s,onSelect:i})=>(G(),t.jsxs(t.Fragment,{children:[s?t.jsx(Ci,{}):null,e.kind==="remove_elsewhere"?t.jsxs(Bt,{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(Bt,{destructive:e.kind==="remove",onSelect:i,"data-integration-menu":e.kind,children:e.label})]}));function _c(e,s,i){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:Sr(s.message,i)??n("ui.settings.integrations.integration_sign_in_dialog.the_server_didn_t_say_why"),nextStep:gc(s.message??null,i)}}function gc(e,s){const i=(e??"").toLowerCase();return i.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"):i.includes("no oauth")||i.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_"):i.includes("network")||i.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 mc(e,s){return e.kind==="ready"?"ready":e.kind==="running"&&s&&s.tone!=="progress"?s.tone==="success"?"success":"failure":"running"}const pc=({name:e,action:s,keyRoute:i,phase:a,onStart:o,onCancel:r,onOpenLink:d,onClose:g})=>{G();const c=a.kind==="running"?a.operation:null,_=a.kind==="running"?_c(e,c,i):null,f=a.kind==="starting"||a.kind==="running"&&_?.tone==="progress",v=_&&_.tone!=="progress",j=l.useRef(null),m=l.useRef(!1),p=mc(a,_);l.useEffect(()=>{if(!m.current){m.current=!0;return}p&&j.current?.focus()},[p]);const A=()=>g(_?.tone==="success"?"signed-in":"dismissed");return t.jsx(un,{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:M=>{M.preventDefault(),j.current?.focus()}},actions:t.jsxs(t.Fragment,{children:[f&&c?t.jsx(gt,{ref:j,onClick:()=>r(c.id),children:n("ui.settings.integrations.integration_sign_in_dialog.cancel_sign_in")}):t.jsx(gt,{ref:a.kind==="ready"?void 0:j,onClick:A,children:_?.tone==="success"?n("ui.settings.integrations.integration_sign_in_dialog.done"):n("ui.settings.integrations.integration_sign_in_dialog.close")}),a.kind==="ready"?t.jsx(mt,{ref:j,onClick:o,children:n("ui.settings.integrations.integration_sign_in_dialog.continue_in_browser")}):null,a.kind==="refused"||_?.tone==="failure"?t.jsx(mt,{ref:_?.tone==="failure"?j: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:[a.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,a.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,_?t.jsxs("div",{className:"flex flex-col gap-1",role:v?"status":void 0,children:[t.jsxs("p",{className:(_.tone==="success","-mx-1.5 flex items-start gap-2 text-ink"),children:[_.tone==="progress"?t.jsx(ue,{size:"xs",className:"mt-0.5"}):null,_.tone==="failure"?t.jsx(Ai,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0 text-danger"}):null,t.jsx("span",{children:_.message})]}),_.reason?t.jsx("p",{className:"-mx-1.5 text-ink-muted",children:_.reason}):null,_.nextStep?t.jsx("p",{className:"-mx-1.5 text-ink-muted",children:_.nextStep}):null]}):null,_?.link&&_.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:_.link,children:_.link}),t.jsx(U,{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(_.link??"").then(()=>pt(n("ui.settings.integrations.integration_sign_in_dialog.sign_in_link_copied"))).catch(()=>{})},children:t.jsx(cs,{"aria-hidden":"true"})})]}),t.jsx(U,{variant:"link",size:"sm",onClick:()=>d(_.link??""),children:n("ui.settings.integrations.integration_sign_in_dialog.open_the_sign_in_page")})]}):null,a.kind==="refused"?t.jsx("p",{className:"text-danger",role:"alert",children:a.message}):null]})})},hc=e=>e.reduce((s,i)=>s?(i.updated_at??0)>(s.updated_at??0)?i:s:i,null),fc=/^[A-Za-z]:[\\/]/,Je=e=>{const s=e?.trim();return s&&(s.startsWith("/")||fc.test(s))?s:null};function yc(e){const o=e?.payload?.frontend?.snapshot?.cwd;return typeof o=="string"&&o.trim()?o:null}const $e="local-operator.settings.integrations.last-cwd";function xc(e,s,i=typeof localStorage>"u"?null:localStorage){const a=Je(s);if(!(!e||!a||!i))try{const o=i.getItem($e),r=o?JSON.parse(o):{};if(r[e]===a)return;i.setItem($e,JSON.stringify({...r,[e]:a}))}catch{}}const Ln=()=>typeof localStorage>"u"?null:localStorage;function Fn(e=Ln()){if(!e)return{};try{const s=e.getItem(kt);if(!s)return{};const i=JSON.parse(s);return!i||typeof i!="object"||Array.isArray(i)?{}:i}catch{return{}}}const en=256;function kc(e,s=Ln()){if(s)try{const i={...Fn(s),...e},a=Object.keys(i);if(a.length>en){const o={};for(const r of a.slice(-en))o[r]=i[r];s.setItem(kt,JSON.stringify(o));return}s.setItem(kt,JSON.stringify(i))}catch{}}function tn(e,s,i){if(e==="saved")return null;if(e==="replace_confirmation_required"){const o=Mn(Object.keys(i).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 a=s.length?s:Object.keys(i);return n("ui.settings.integrations.use_integrations.keys_not_saved",{keys:String(a.join(", "))})}function vc(e,s=typeof localStorage>"u"?null:localStorage){if(!(!e||!s))try{const i=s.getItem($e);if(!i)return;const a=JSON.parse(i);if(!(e in a))return;const o={...a};delete o[e],s.setItem($e,JSON.stringify(o))}catch{}}const bc=e=>!!(e&&typeof e=="object"&&"code"in e&&e.code==="invalid_cwd"),jc=(e,s)=>s!==null&&e===s?null:e;function wc(e,s=typeof localStorage>"u"?null:localStorage){if(!e||!s)return null;try{const i=s.getItem($e);if(!i)return null;const o=JSON.parse(i)[e];return typeof o=="string"?o:null}catch{return null}}const Nc=e=>e.action==="disconnect"?"disconnected":"connected";function Sc(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 Mc(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 Cc({sessionId:e}){const s=_n(),i=Dt(s.data,"mcp_catalog"),a=Dt(s.data,"mcp"),o=i?"catalog":a?"session":null,[r,d]=l.useState(null),g=cn(),c=Ze(b=>b.sessions),_=Ze(b=>b.fetchSessions),f=Ze(b=>b.loading),v=l.useMemo(()=>c.find(b=>b.session_id===e)??null,[c,e]),j=l.useMemo(()=>o==="session"&&!e?hc(c):null,[o,e,c]),m=o==="session"?e??j?.session_id??null:null;l.useEffect(()=>{o!=="session"||e||c.length>0||_(ls)},[o,e,c.length,_]);const p=o==="catalog"?Je(v?.cwd):null,A=o==="catalog"&&!!e&&p===null,M=je({queryKey:["desktop","session-cwd",e??""],queryFn:()=>ve({op:"sessions.get",sessionId:e??""}),enabled:A,staleTime:Number.POSITIVE_INFINITY,retry:!1}),q=A&&!M.isFetched,N=p??Je(yc(M.data))??(M.isFetched?Je(wc(e)):null),H=jc(N,r),P=o==="catalog"?H:null,E=o==="catalog"?e??null:null,C=ds.catalog(P,E);l.useEffect(()=>{o!=="catalog"||!e||!P||xc(e,P)},[o,e,P]);const Q=l.useRef(0),[Z,J]=l.useState(0),T=l.useRef(null),te=l.useCallback((b,R)=>{const y=Date.now()+Yt;Q.current=y,T.current={name:b,expect:R},J(y)},[]),O=l.useCallback(b=>Date.now()<Q.current?In:Kr(b),[]),z=je({queryKey:C,queryFn:()=>gs(P,E),enabled:o==="catalog"&&!q,staleTime:1e4,refetchInterval:b=>O(b.state.data)}),L=bc(z.error);l.useEffect(()=>{!L||!N||r===N||(d(N),vc(e))},[L,N,r,e]);const $=je({queryKey:ht.list(m??""),queryFn:()=>ms(m??""),enabled:o==="session"&&!!m,staleTime:1e4,refetchInterval:b=>O(b.state.data?vt(b.state.data,m??""):void 0)}),B=l.useMemo(()=>{if(o==="catalog")return z.data;if(o==="session"&&$.data&&m)return vt($.data,m)},[o,z.data,$.data,m]),ae=l.useCallback(()=>Ac({queryClient:g,route:o,catalogKey:C,sessionId:m}),[o,C,g,m]);l.useEffect(()=>{if(!Z)return;const b=T.current;if(!b)return;const R=B?.servers.find(F=>F.name===b.name);!R||!(b.expect==="connected"?R.status==="connected":R.status_basis==="live"&&R.status!=="connected")||(Q.current=0,T.current=null,J(0))},[B,Z]);const h=l.useRef({}),[I,k]=l.useState(0),V=l.useMemo(()=>(h.current=Or(Dr(h.current,B,Fn()),B),h.current),[B,I]),Y=l.useRef("");l.useEffect(()=>{const b=Fr(V,B);if(!Object.keys(b).length)return;const R=JSON.stringify(b);R!==Y.current&&(Y.current=R,kc(b))},[V,B]);const X=l.useCallback(b=>{const R=Re(h.current,b);R.needsKey||(h.current={...h.current,[b]:{...R,needsKey:!0}},k(y=>y+1))},[]),ee=l.useCallback(b=>{if(b.action!=="disconnect"&&b.action!=="connect"&&b.action!=="reload")return;const R=Re(h.current,b.name),y=Date.now()+Yt,F=b.action==="disconnect"?{...R,connectedAt:null,disconnectedAt:Date.now(),holdUntil:y}:{...R,disconnectedAt:null,holdUntil:y};h.current={...h.current,[b.name]:F},te(b.name,Nc(b)),k(D=>D+1)},[te]),W=l.useCallback(async b=>{if(o==="catalog"){const R=Sc(b);if(!R)return null;try{const y=await us(P,R);return g.setQueryData(C,y),ee(b),y.operation?.id??null}catch(y){throw y instanceof Nt&&y.status===409&&g.invalidateQueries({queryKey:C}),y}}if(o==="session"&&m){const R=await ve({op:"mcp.control",sessionId:m,control:Mc(b)});ee(b);const y=ht.list(m),F=R?.data;return F&&"servers"in F&&Array.isArray(F.servers)?(g.setQueryData(y,F),null):(g.invalidateQueries({queryKey:y}),F&&"id"in F&&typeof F.id=="string"?F.id:null)}return null},[o,P,C,g,m,ee]),fe=l.useCallback(async b=>{if(o==="catalog"&&E&&(b.action==="connect"||b.action==="disconnect"||b.action==="reload")){try{await ve({op:"mcp.control",sessionId:E,control:{action:b.action,name:b.name,...b.action==="disconnect"?{confirmed:!0}:{}}})}catch(R){throw g.invalidateQueries({queryKey:C}),R}return ee(b),await g.invalidateQueries({queryKey:C}),null}return W(b)},[o,E,g,C,W,ee]),we=l.useCallback(async(b,R,y,F)=>{if(o==="catalog"){const D=await _s(P,b,R,y,F);if(D.catalog&&g.setQueryData(C,D.catalog),D.code!=="saved")return{saved:!1,message:tn(D.code,D.failed_ids,R)};try{await W({action:"test",name:b})}catch{}return{saved:!0,message:null}}if(o==="session"&&m){const D=await ve({op:"mcp.credentials.store",sessionId:m,name:b,values:R,confirmedReplace:y});if(D.data?.code!=="saved")return{saved:!1,message:tn(D.data?.code,D.data?.failed_ids??[],R)};try{await W({action:"connect",name:b})}catch{}return{saved:!0,message:null}}return{saved:!1,message:null}},[o,P,C,g,W,m]),me=o==="catalog"?z:$,Te=l.useCallback(()=>{me.refetch()},[me]);return{enabled:o!==null,route:o,sessionId:o==="catalog"?E:m,borrowed:j,noConversation:o==="session"&&!m&&!f,document:B,isLoading:s.isLoading||o==="catalog"&&(q||z.isLoading)||o==="session"&&(m?$.isLoading:f),isError:me.isError,folderUnavailable:Lr(r,N),refetch:Te,readDocument:ae,control:fe,storeKeys:we,memories:V,markNeedsKey:X}}function Ac(e){if(e.route==="catalog")return e.queryClient.getQueryData(e.catalogKey);if(e.route==="session"&&e.sessionId){const s=e.queryClient.getQueryData(ht.list(e.sessionId));return s?vt(s,e.sessionId):void 0}}const Ec=(e,s)=>{const i=e?.trim();if(!i)return null;const a=ys(i,s);return a.kind==="auth"?{kind:"matched",name:a.name,unresolved:null}:{kind:"miss",asked:i}},Rc=6,ut="ui.settings.integrations.mcp_management_section.copy_section_title",Tc="ui.settings.integrations.mcp_management_section.copy_section_description",Ic={test:"test",connect:"reconnect",disconnect:"disconnect",reload:"reload",remove:"remove",sign_out:"disconnect",cancel:"cancel",login:"grant",reauth:"grant"},Oc=({sessionId:e,sectionRef:s,highlightServer:i})=>{G();const a=Cc({sessionId:e}),{document:o,control:r,readDocument:d}=a,g=ps(),c=o?.servers??[],_=o?.operations??[],f=o?.project_scope_available??!1,[v,j]=l.useState(!1),[m,p]=l.useState(""),[A,M]=l.useState(null),[q,N]=l.useState({}),[H,P]=l.useState(null),[E,C]=l.useState(null),[Q,Z]=l.useState({kind:"ready"}),[J,T]=l.useState(null),[te,O]=l.useState(null),[z,L]=l.useState(!1),$=l.useRef({}),B=l.useRef({}),ae=l.useRef({}),h=l.useRef(0),I=l.useRef(null),k=l.useRef(null),V=l.useRef(null),[Y,X]=l.useState(null),[ee,W]=l.useState(null),[fe,we]=l.useState(null),me=l.useCallback(()=>{const u=V.current;V.current=null,C(null),T(null),window.setTimeout(()=>{u?.isConnected&&u.focus()},0)},[]),Te=l.useCallback(u=>{const x=window.document.activeElement;V.current=x instanceof HTMLElement?x:null,C(u)},[]),b=l.useCallback((u,x)=>{W({name:u,waitForSignIn:x==="signed-in",until:Date.now()+ze,reanchors:0}),me()},[me]),R=l.useMemo(()=>Ec(i,c.map(u=>u.name)),[i,c]),y=R?.kind==="matched"?R.name:null,F=l.useRef(null),D=l.useRef(null),le=m.trim().toLowerCase(),ne=l.useMemo(()=>le?c.filter(u=>u.name.toLowerCase().includes(le)):c,[c,le]),oe=Ir(ne,_,a.memories),ye=E?.kind==="sign_in"?c.find(u=>u.name===E.name)??null:null;l.useEffect(()=>{!y||D.current===y||!m||p("")},[y,m]),l.useEffect(()=>{!y||D.current===y||ne.some(u=>u.name===y)&&(D.current=y,F.current?.scrollIntoView({block:"center",behavior:"smooth"}))},[y,ne]),l.useEffect(()=>{if(!J)return;const u=_.find(x=>x.id===J)??null;Z({kind:"running",operation:u})},[_,J]);const _e=_.some(u=>u.status==="running"),Ne=u=>{const x=window.document.activeElement;x&&x!==window.document.body&&x.isConnected||W({name:u,waitForSignIn:!1,until:Date.now()+ze,reanchors:0})},re=async(u,x,S)=>{M(u),N(({[u]:Me,...Ce})=>Ce);let K=null,ge=!1;try{K=await S()}catch(Me){ge=!0,N(Ce=>({...Ce,[u]:Ye(Ic[x]??"status",Me,_e)}))}finally{M(null),x!=="sign_out"&&(x!=="remove"||ge)&&Ne(u)}return{operationId:K,failed:ge}},pe=u=>c.find(x=>x.name===u),xe=u=>{u.source.path&&xs(u.source.path)},Se=async(u,x)=>{Z({kind:"starting"}),T(null);try{const S=await r({action:x,name:u});S?T(S):Z({kind:"running",operation:null})}catch(S){S instanceof Nt&&S.code==="oauth_unsupported"&&a.markNeedsKey(u),Z({kind:"refused",message:Ye("grant",S,_e)})}},Ve=(u,x)=>{switch(x.kind){case"sign_in":case"reauth":{const S=_.find(K=>K.name===u.name&&K.status==="running");S&&He(S)?(Z({kind:"running",operation:S}),T(S.id)):(Z({kind:"ready"}),T(null)),Te({kind:"sign_in",name:u.name,action:x.kind==="reauth"?"reauth":"login"});return}case"set_key":O(null),Te({kind:"key",name:u.name,keyNames:u.auth.secret_refs.map(S=>S.id)});return;case"fix":xe(u);return;case"sign_out":P({name:u.name,kind:"sign_out"});return;default:{const S=x.kind;re(u.name,S,()=>r({action:S,name:u.name}))}}},st=(u,x)=>{switch(x.kind){case"remove":case"sign_out":P({name:u.name,kind:x.kind});return;case"sign_in":case"reauth":case"set_key":Ve(u,{kind:x.kind,label:x.label});return;case"open_config":xe(u);return;case"copy_setup":navigator.clipboard.writeText(u.setup_prompt??"").then(()=>pt(n("ui.settings.integrations.mcp_management_section.setup_steps_copied_paste_them_into_a_chat"))).catch(()=>{});return;case"cancel":{const S=_.find(K=>K.name===u.name&&K.status==="running");S&&re(u.name,"cancel",()=>r({action:"cancel",operationId:S.id}));return}case"test":case"connect":case"disconnect":case"reload":{const S=x.kind;re(u.name,S,()=>r({action:S,name:u.name}));return}default:return}},it=(u,x)=>{if(P(null),x==="remove"){const S=u.source.owned_scope;if(!S)return;const K=ne.findIndex(ge=>ge.name===u.name);re(u.name,"remove",()=>r({action:"remove",name:u.name,scope:S})).then(({operationId:ge,failed:Me})=>{Me||ge!==null||(pt(n("ui.settings.integrations.mcp_management_section.removed_name",{name:String(u.name)})),K>=0&&we({index:K}))});return}re(u.name,"sign_out",()=>r({action:"logout",name:u.name})).then(()=>{W({name:u.name,waitForSignIn:!1,until:Date.now()+ze,reanchors:0})})},Rt=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}}),j(!1),X(u.name),null}catch(x){return Ye("add",x,!1)}},Le=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(ut)}),t.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:n(Tc)})]}),a.enabled&&c.length>0&&!v?t.jsxs(U,{ref:I,variant:"secondary",size:"sm",onClick:()=>j(!0),"data-tour-tag":"mcp-add-server",children:[t.jsx(Ut,{"aria-hidden":"true"}),n("ui.settings.integrations.mcp_management_section.add_integration")]}):null]});if(!a.enabled&&!a.isLoading)return t.jsx(se,{title:n(ut),titleComponent:Le,sectionRef:s,children:t.jsx(ie,{variant:"warning",children:n("ui.settings.integrations.mcp_management_section.integrations_need_a_newer_local_operator_backend_update_it_and_re")})});const Fe=t.jsx(Wr,{existingNames:c.map(u=>u.name),projectScopeAvailable:f,projectLabel:o?.cwd?Fc(o.cwd):null,onSubmit:Rt,onCancel:()=>{j(!1),window.setTimeout(()=>I.current?.focus(),0)}}),Tt=E?pe(E.name):void 0,Un=Object.entries(q).filter(([u])=>!c.some(x=>x.name===u)),Pn=u=>N(({[u]:x,...S})=>S);l.useEffect(()=>{if(!Y)return;const u=$.current[Y];if(!u){c.some(x=>x.name===Y)&&(B.current[Y]?.focus(),X(null));return}u.focus(),X(null)},[Y,c]),l.useEffect(()=>{if(!fe)return;const x=ne[Math.min(fe.index,ne.length-1)]??ne.at(-1);if(x){const S=$.current[x.name]??B.current[x.name];if(!S)return;S.focus()}else I.current?.focus();we(null)},[fe,ne]);const at=l.useCallback((u,x)=>{const S=d()??o,K=S?.servers.find(Kn=>Kn.name===u.name),ge=S?.operations??[],Me=K?K.status==="connecting"||Oe(K.name,ge)!==null:!1;Me&&K&&(h.current=x);const Ce=K?Ct(K,ge,a.memories):null;if(K&&u.waitForSignIn&&(Ce?.kind==="sign_in"||Ce?.kind==="reauth"))return"kept";const Ie=tc({hold:u,now:x,windowMs:ze,rowMoving:Me,lastMovingAt:h.current,candidate:K?sc({primary:Ce?$.current[K.name]:null,overflow:B.current[K.name]}):void 0,active:window.document.activeElement,body:window.document.body});if(!Ie.hold)return W(null),"finished";if(!Ie.land)return"kept";W({name:u.name,waitForSignIn:!1,until:Ie.hold.until,landedOn:Ie.land,reanchors:Ie.hold.reanchors});const It=Ie.land;return window.setTimeout(()=>{It.isConnected&&It.focus()},0),"landed"},[d,o,a.memories]);return l.useEffect(()=>{if(!ee)return;at(ee,Date.now());let u=0,x=!1;const S=()=>{if(x)return;const K=ic({verdict:at(ee,Date.now()),watchMs:Qt});K!==null&&(u=window.setTimeout(S,K))};return u=window.setTimeout(S,Qt),()=>{x=!0,window.clearTimeout(u)}},[ee,at]),l.useEffect(()=>{if(!ee)return;const u=x=>{nc({target:x.target,row:ae.current[ee.name]})&&W(null)};return window.document.addEventListener("pointerdown",u,!0),()=>{window.document.removeEventListener("pointerdown",u,!0)}},[ee]),t.jsxs(se,{title:n(ut),titleComponent:Le,sectionRef:s,children:[t.jsxs("div",{className:"flex flex-col gap-4",children:[a.route==="session"&&a.borrowed?t.jsx("p",{className:"text-body-sm text-ink-muted",children:n("ui.settings.integrations.mcp_management_section.borrowed_chat_notice",{chat:a.borrowed.title?.trim()||a.borrowed.session_id.slice(0,6)})}):null,a.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(U,{variant:"primary",size:"sm",onClick:()=>g("/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,a.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,a.folderUnavailable?t.jsx(ie,{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,a.isError?t.jsx(ie,{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(U,{variant:"secondary",size:"sm",onClick:a.refetch,children:n("ui.settings.integrations.mcp_management_section.retry")})]})}):null,Un.map(([u,x])=>t.jsx(ie,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:x}),t.jsx(U,{variant:"ghost",size:"sm",onClick:()=>Pn(u),children:n("ui.settings.integrations.mcp_management_section.dismiss")})]})},u)),v&&c.length>0?Fe:null,c.length>=Rc?t.jsxs("div",{className:"relative",children:[t.jsx(hs,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-ink-dim"}),t.jsx(Ee,{ref:k,value:m,onChange:u=>p(u.target.value),onKeyDown:u=>{u.key!=="Escape"||!m||(u.preventDefault(),p(""))},placeholder:n("ui.settings.integrations.mcp_management_section.search_integrations_placeholder",{integrations:mr(c.length)}),"aria-label":n("ui.settings.integrations.mcp_management_section.search_integrations"),className:"pl-9"})]}):null,R?.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(R.asked)})}):null,R?.kind==="matched"&&R.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(R.name),asked:String(R.unresolved)})}):null,o&&c.length===0&&!a.isLoading?v?Fe:t.jsxs("div",{className:"flex flex-col items-start gap-3 rounded-lg bg-surface p-6",children:[t.jsx(gn,{"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(U,{variant:"primary",size:"md",onClick:()=>j(!0),"data-tour-tag":"mcp-add-server",children:[t.jsx(Ut,{"aria-hidden":"true"}),n("ui.settings.integrations.mcp_management_section.add_integration")]})]}):null,c.length>0&&ne.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(U,{variant:"secondary",size:"sm",onClick:()=>{p(""),window.setTimeout(()=>{(k.current??I.current)?.focus()},0)},children:n("ui.settings.integrations.mcp_management_section.clear_search")})]}):null,oe.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(x=>t.jsx(dc,{row:x,operations:_,memories:a.memories,projectScopeAvailable:f,highlighted:x.name===y,rowRef:S=>{ae.current[x.name]=S,x.name===y&&(F.current=S)},primaryRef:S=>{$.current[x.name]=S},overflowRef:S=>{B.current[x.name]=S},pending:A===x.name,failure:q[x.name]??null,confirm:H?.name===x.name?{kind:H.kind}:null,onPrimary:S=>Ve(x,S),onOverflow:S=>st(x,S),onConfirm:()=>H&&it(x,H.kind),onCancelConfirm:()=>{P(null),window.setTimeout(()=>{B.current[x.name]?.focus()},0)}},x.id))})]},u.id))]}),E?.kind==="sign_in"?t.jsx(pc,{name:E.name,action:E.action,keyRoute:ye?tt(ye):!1,phase:Q,onStart:()=>void Se(E.name,E.action),onCancel:u=>void r({action:"cancel",operationId:u}).catch(()=>{}),onOpenLink:u=>void fs(u),onClose:u=>b(E.name,u)}):null,E?.kind==="key"?t.jsx(rc,{name:E.name,keyNames:E.keyNames.length?E.keyNames:Tt?.auth.secret_refs.map(u=>u.id)??[],keyless:E.keyNames.length===0,savedKeys:Tt?.auth.secret_refs.filter(u=>u.state==="encrypted").map(u=>u.id),saving:z,failure:te,onClose:me,onSave:(u,x,S)=>{L(!0),O(null),a.storeKeys(E.name,u,x,S).then(K=>{if(!K.saved){O(K.message);return}C(null),W({name:E.name,waitForSignIn:!1,until:Date.now()+ze,reanchors:0})}).catch(K=>O(Ye("key",K,!1))).finally(()=>L(!1))}}):null]})},ze=4e3,Lc=/^\/(?:Users|home)\/[^/]+(?=\/|$)/,Fc=e=>e.replace(Lc,"~"),Dc=({verification:e})=>{G();const{prices:s}=vs(),i=e.grant_amount??s?.default_new_credits,{sentence:a,action:o}=bs(e.signup_grant,js(i)),r=ws(e.claim_url,Ns);return t.jsxs("div",{className:"mt-8 flex items-start gap-3 rounded-sm border border-hairline bg-surface p-3",children:[t.jsx(Xe,{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:a}),t.jsx(U,{variant:"secondary",size:"sm",onClick:()=>Ss(r),children:o})]})]})},zc=({onAfterCredentialUpdate:e})=>{G();const{isAuthenticated:s,user:i,isLoading:a,accountRead:o,signOut:r}=ks(),d=mn(v=>v.isSigningOut),g=l.useCallback(async()=>{try{await r()}catch(v){console.error("Error signing out:",v)}},[r]),c=(()=>{if(!s||!i?.radientUser)return null;const{account:v,identity:j,verification:m}=i.radientUser,p=m!=null&&!m.email_verified&&m.signup_grant!=="claimed";return t.jsxs(t.Fragment,{children:[t.jsxs(et,{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(Ei,{variant:"success",className:"capitalize",children:v.status})]})}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.name"),value:v.name||n("ui.settings.account.radient_account_section.not_provided")}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.email"),value:v.email}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.account_id"),value:t.jsx("span",{className:"text-mono-sm",children:v.id})}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.tenant_id"),value:t.jsx("span",{className:"text-mono-sm",children:v.tenant_id})}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.provider"),value:t.jsx("span",{className:"capitalize",children:j.provider})}),t.jsx(ce,{label:n("ui.settings.account.radient_account_section.created"),value:pn(v.created_at)})]}),p&&m?t.jsx(Dc,{verification:m}):null,t.jsx("div",{className:"mt-8",children:t.jsx(ei,{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(U,{variant:"danger",className:"mt-3",onClick:g,children:[t.jsx(ti,{}),n("ui.settings.account.radient_account_section.sign_out_from_radient")]})]})]})})(),_=o==="refused"?n("ui.settings.account.radient_account_section.radient_refused_the_sign_in_this_app_is_holding_so_your_account_d"):hn(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&&i?null:t.jsxs("div",{children:[t.jsxs("p",{className:"text-body-sm text-ink-muted",children:[_," ",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(Li,{titleText:"",onAfterCredentialUpdate:e,descriptionText:"",onSignInSuccess:()=>{}})})]});return a||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&&i?.radientUser?c:t.jsx("div",{className:"flex flex-col gap-4",children:f})};function Uc({metric:e,data:s}){return G(),t.jsx(Ms,{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:i=>i,yTickFormatter:i=>e==="credits"?`$${i.toFixed(2)}`:Cs(i),children:t.jsx(tr,{data:s,children:t.jsx(ln,{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 Pc={all:["desktop","tts-path-resolution"]};function Kc(e){return je({queryKey:Pc.all,queryFn:()=>ve({op:"tts.paths"}),enabled:e,staleTime:Number.POSITIVE_INFINITY,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:As})}const $c=["speech.voice.gender","speech.voice.tone","speech.voice.expressiveness","speech.voice.pace","speech.voice.language","speech.voice.accent","speech.voice.instructions"];function nn(e){const s=new Map(e.map(o=>[o.key,o])),i=[],a=[];for(const o of $c){const r=s.get(o);r?i.push(r):a.push(o)}return{rows:i,missing:a}}const Bc=["provider_tts_radient","provider_tts_elevenlabs","provider_tts_openai","none"];function sn(e){return typeof e=="string"&&Bc.includes(e)}function Hc(e){if(e===null||typeof e!="object")return null;const s=e;if(!sn(s.path)||typeof s.reason!="string"||typeof s.servable!="boolean"||!Array.isArray(s.rungs))return null;const i=[];for(const a of s.rungs){if(a===null||typeof a!="object")return null;const o=a;if(!sn(o.path)||typeof o.available!="boolean"||typeof o.reason!="string")return null;i.push({path:o.path,available:o.available,reason:o.reason})}return{path:s.path,reason:s.reason,servable:s.servable,rungs:i}}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 Dn(e){return Vc[e]}function Gc(e){return{servable:e.servable,serving:e.path==="none"?null:e.path,reason:e.reason,rungs:e.rungs.map(s=>({path:s.path,name:Dn(s.path),available:s.available,reason:s.reason}))}}const qc="ui.settings.speech.speech_section.copy_backend_older_sentence",zn="ui.settings.speech.speech_section.copy_unavailable_sentence",Yc=({resetErrorBoundary:e})=>(G(),t.jsx(ie,{variant:"warning",children:t.jsxs("div",{className:"flex flex-col items-start gap-3",children:[t.jsx("span",{children:n(zn)}),t.jsxs(U,{variant:"secondary",onClick:e,children:[t.jsx(Ti,{"aria-hidden":"true"}),n("ui.settings.speech.speech_section.try_again")]})]})}));function Zc(e){return e==="enabled"?"ready":e==="below-version"?"older":"pairing"}const Qc=({sectionRef:e})=>{G();const s=_n(),i=fn(),a=Es(s.data,"tts"),o=Zc(a),r=je({queryKey:Ls.all,queryFn:()=>ve({op:"settings.list"}),enabled:o==="ready",staleTime:1e4}),d=Kc(o==="ready"),{hasRadientApiKey:g,hasRadientSession:c,speechBlock:_}=Rs(),f=`${c}:${g}`,v=l.useRef(f),j=d.refetch;l.useEffect(()=>{v.current!==f&&(v.current=f,j())},[f,j]);const m=r.data,p=l.useMemo(()=>nn(m?.settings??[]),[m]),[A,M]=l.useState({}),[q,N]=l.useState({}),[H,P]=l.useState({});l.useEffect(()=>{m&&M(h=>{let I=!1;const k={...h};for(const V of nn(m.settings).rows){const Y=h[V.key];if(Y&&Y.value!==De(V).value)continue;const X=De(V);Y&&Y.value===X.value&&Y.cascadeBase===X.cascadeBase||(k[V.key]=X,I=!0)}return I?k:h})},[m]);const E=(h,I)=>N(k=>({...k,[h]:I})),C=(h,I)=>P(k=>({...k,[h]:I})),Q=async h=>{const I=A[h.key];if(!I)return;const k=Os(h,I);if(!k.ok){C(h.key,k.error);return}E(h.key,!0),C(h.key,null);try{await ve(k.request),E(h.key,!1);const Y=(await r.refetch()).data?.settings.find(X=>X.key===h.key);Y&&M(X=>{const ee=X[h.key];return ee&&ee.value===I.value&&ee.cascadeBase===I.cascadeBase?{...X,[h.key]:De(Y)}:X})}catch(V){E(h.key,!1),C(h.key,V instanceof Error?V.message:n("ui.settings.speech.speech_section.the_setting_could_not_be_saved"))}},Z=async h=>{E(h.key,!0),C(h.key,null);try{await ve({op:"settings.reset",key:h.key}),M(I=>({...I,[h.key]:De({...h,value:h.default,is_default:!0})})),E(h.key,!1),await r.refetch()}catch(I){E(h.key,!1),C(h.key,I instanceof Error?I.message:n("ui.settings.speech.speech_section.the_setting_could_not_be_reset"))}},J=l.useMemo(()=>Hc(d.data),[d.data]),T=J?Gc(J):null,te=d.isSuccess&&J===null,O=(s.data?null:s.error)??null,z=r.error,L=n("ui.settings.speech.speech_section.speech_voicing"),$=n("ui.settings.speech.speech_section.how_the_assistant_sounds_when_it_speaks_aloud");if(o==="pairing"){const{sentence:h}=ft(i??null,n("ui.settings.speech.speech_section.speech_settings_could_not_be_loaded"),O);return t.jsx(se,{title:L,icon:Ge,description:$,sectionRef:e,children:t.jsx(ie,{variant:"warning",children:h})})}if(o==="older")return t.jsx(se,{title:L,icon:Ge,description:$,sectionRef:e,children:t.jsx(ie,{variant:"warning",children:n(qc)})});if(z||!m){const{sentence:h,remedy:I}=ft(i??null,n("ui.settings.speech.speech_section.speech_settings_could_not_be_loaded"),z);return t.jsx(se,{title:L,icon:Ge,description:$,sectionRef:e,children:t.jsx(ie,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:h}),I&&t.jsx(U,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{r.refetch()},children:n("ui.settings.speech.speech_section.retry")})]})})})}const B=T?!T.servable:_==="offline",ae=T?T.rungs.find(h=>h.path===T.serving)??null:null;return t.jsx(se,{title:L,icon:Ge,description:$,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,{}),zt("checking")]}),(d.isError||te)&&!T&&_!=="offline"&&t.jsx(ie,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("span",{children:[n(zn)," ",d.error instanceof Error?d.error.message:""]}),t.jsx(U,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>{d.refetch()},children:n("ui.settings.speech.speech_section.retry")})]})}),t.jsx(Ri,{fallbackRender:Yc,resetKeys:[d.dataUpdatedAt],children:T&&t.jsxs(t.Fragment,{children:[t.jsxs(et,{children:[t.jsx(ce,{label:n("ui.settings.speech.speech_section.speaks_through"),value:T.serving?Dn(T.serving):n("ui.settings.speech.speech_section.nothing_yet")}),t.jsx(ce,{label:n("ui.settings.speech.speech_section.availability"),value:T.servable?n("ui.settings.speech.speech_section.ready"):n("ui.settings.speech.speech_section.no_provider")})]}),T.reason&&T.reason!==ae?.reason&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:T.reason}),t.jsx("ul",{className:"flex flex-col gap-1",children:T.rungs.map(h=>t.jsxs("li",{className:"flex flex-col gap-0.5 text-body-sm",children:[t.jsxs("span",{className:h.path===T.serving?"text-ink":"text-ink-muted",children:[h.name,t.jsxs("span",{className:h.path===T.serving?"text-ink-muted":"text-ink-dim",children:[" ",h.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:h.reason})]},h.path))})]})})]}),B&&t.jsx(ie,{variant:"warning",children:zt(_)}),t.jsx("div",{className:"flex flex-col gap-1",children:p.rows.map(h=>t.jsx(Ts,{setting:h,draft:A[h.key]??De(h),tier:Is(h),saving:!!q[h.key],error:H[h.key]??null,onDraftChange:I=>M(k=>({...k,[h.key]:I})),onSave:()=>{Q(h)},onReset:()=>{Z(h)}},h.key))}),p.missing.length>0&&t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.settings.speech.speech_section.missing_voice_rows",{count:p.missing.length,rows:p.missing.join(", ")})})]})})},Wc=()=>{G();const{data:e,isLoading:s,error:i,refetch:a}=Wo(),o=Jo(),[r,d]=l.useState(""),[g,c]=l.useState(!1);l.useEffect(()=>{d(e?.content??""),c(!1)},[e]);const _=p=>{const A=p.target.value;d(A),c(A!==(e?.content??""))},f=async()=>{if(!(!g||o.isPending))try{const p={content:r};await o.mutateAsync(p),await a(),c(!1)}catch(p){console.error("Error updating system prompt:",p)}},v=()=>{d(e?.content??""),c(!1)},j=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(he,{htmlFor:"app-system-prompt",children:n("ui.settings.model.system_prompt.instructions")}),t.jsx(vn,{id:"app-system-prompt",name:"systemPrompt",value:r,onChange:_,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(U,{variant:"primary",onClick:f,disabled:!g||j,children:[j?t.jsx(ue,{size:"sm"}):t.jsx(ni,{}),j?n("ui.settings.model.system_prompt.saving"):n("ui.settings.model.system_prompt.save_changes")]}),t.jsx(U,{onClick:v,disabled:!g||j,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:yn(e.last_modified)})]})]});return t.jsx(se,{title:n("ui.settings.model.system_prompt.system_prompt"),icon:Fi,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")})}):i?t.jsx(ie,{variant:"danger",children:n("ui.settings.model.system_prompt.load_failed",{reason:i instanceof Error?i.message:n("ui.settings.model.system_prompt.unknown_error")})}):m()})},Jc=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Xc=e=>Jc.includes(e),el=e=>{const s=[];let i=0;for(const a of e){const o=Math.max(0,Math.floor(a.count)),r=Math.max(1,Math.floor(a.columns));for(let d=0;d<o;d+=r)s.push({start:i+d,count:Math.min(r,o-d)});i+=o}return s},tl=({index:e,key:s,groups:i})=>{const a=el(i),o=a.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=a.findIndex(c=>e>=c.start&&e<c.start+c.count),d=a[r+(s==="ArrowDown"?1:-1)];if(!d)return e;const g=e-a[r].start;return d.start+Math.min(g,d.count-1)}default:return e}},nl={localOperatorDark:oo,localOperatorLight:Mo,dracula:xo,dune:Oa,sage:Ja,monokai:ai,tokyoNight:uo,iceberg:vo,radient:Ga,neon:Fs,obsidian:jn,synth:qi,catppuccinMocha:xa,catppuccinLatte:no,tokyoNightStorm:ua,gruvbox:ta,nord:Zo,oneDark:Vi,solarizedDark:No,rosePine:za,rosePineMoon:io,rosePineDawn:fa,alucard:Pa,gruvboxLight:Sa,tokyoNightDay:co,oneLight:eo,catppuccinFrappe:wa,catppuccinMacchiato:Ya,palenight:ii,everforest:Ko,everforestLight:Uo,kanagawaWave:Vo,kanagawaLotus:Fa,ayuDark:Ca,ayuMirage:Ea,ayuLight:po,nightfox:ga,duskfox:Ro,synthwave:go,matrix:Zi,tron:la,cyberpunk:si,vaporwave:Do,outrun:Xi,neonNoir:Bo,arcade:Qa,forest:Lo,ocean:Ta,desert:Io,autumn:qo,lavender:jo,arctic:pa,rosewood:Ha,solarizedLight:Ao,githubLight:$a,paper:Di,linen:fo,highContrastLight:Bi,mintLight:Wi},an="bg-[color-mix(in_srgb,var(--color-accent)_8%,var(--color-accent-wash))]",sl=({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"})]})]})]}),il=({id:e,name:s,description:i,isSelected:a,isTabStop:o,onSelect:r,onFocusTile:d})=>{const g=nl[e];return t.jsx(Ke,{side:"bottom",align:"start",content:i,children:t.jsxs("button",{type:"button","data-theme-tile":e,"aria-pressed":a,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",a?an:"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",a?"border-accent":"border-hairline"),children:[t.jsx(sl,{id:e}),a&&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",an),children:t.jsx(Oi,{size:12,className:"text-accent","aria-hidden":"true"})})]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(g,{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})]})]})})},al=e=>[...e.querySelectorAll("[data-theme-grid]")].map(s=>{const i=[...s.querySelectorAll("[data-theme-tile]")],a=i[0]?.getBoundingClientRect().top??0;return{count:i.length,columns:Math.max(1,i.filter(o=>Math.abs(o.getBoundingClientRect().top-a)<1).length)}}),ol=()=>{G();const{themeName:e,setTheme:s}=be(),i=Object.values($n),a=[{label:n("ui.settings.appearance.theme_selector.dark"),items:i.filter(c=>c.theme.palette.mode==="dark")},{label:n("ui.settings.appearance.theme_selector.light"),items:i.filter(c=>c.theme.palette.mode==="light")}].filter(c=>c.items.length>0),[o,r]=l.useState(null),d=l.useMemo(()=>{const c=a.flatMap(_=>_.items.map(f=>f.id));return o&&c.includes(o)?o:c.includes(e)?e:c[0]},[a,o,e]),g=c=>{if(!Xc(c.key))return;const _=[...c.currentTarget.querySelectorAll("[data-theme-tile]")],f=_.indexOf(c.target);if(f<0)return;c.preventDefault();const v=tl({index:f,key:c.key,groups:al(c.currentTarget)});v!==f&&_[v]?.focus()};return t.jsx(Ii,{children:t.jsx("div",{onKeyDown:g,className:"flex flex-col gap-6",children:a.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:_,name:f,description:v})=>t.jsx(il,{id:_,name:f,description:v,isSelected:_===e,isTabStop:_===d,onSelect:()=>s(_),onFocusTile:()=>r(_)},_))})]},c.label))})})},rl=({value:e,onChange:s})=>{G();const i=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:i,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(yt,{value:e,onValueChange:a=>s(xn(a)),children:t.jsx(xt,{"aria-labelledby":i,children:Qs.map(a=>t.jsx(Ue,{value:a.value,children:a.value==="by-turn"?n("ui.settings.appearance.transcript_display_mode_setting.by_turn"):n("ui.settings.appearance.transcript_display_mode_setting.by_response")},a.value))})})})]})},cl=()=>{G();const{data:e,isLoading:s,error:i}=sr({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(ba,{size:16,className:"shrink-0 text-ink-dim"}),n("ui.settings.account.settings_page.radient_pass")]}),s&&t.jsx(bn,{className:"h-6 w-36"}),i&&t.jsx(ie,{variant:"warning",children:n("ui.settings.account.settings_page.credit_balance_load_failed",{reason:i.message})}),e&&!s&&!i&&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(U,{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(ra,{}),n("ui.settings.account.settings_page.add_credits")]})})]})]})},ll=[{id:"credits",get label(){return n("ui.settings.account.settings_page.credits")}},{id:"tokens",get label(){return n("ui.settings.account.settings_page.tokens")}}],dl=()=>{G();const[e,s]=l.useState("credits"),i=l.useMemo(()=>{const g=new Date,c=er(g);return{start_date:Ht(c),end_date:Ht(g),rollup:"daily"}},[]),{data:a,isLoading:o,error:r}=ar(i,{enabled:!0}),d=l.useMemo(()=>a?.data_points?[...a.data_points].sort((c,_)=>ot(c.timestamp).getTime()-ot(_.timestamp).getTime()).map(c=>({bucket:Hs(Pi(ot(c.timestamp),"yyyy-MM-dd")),value:e==="credits"?Number.parseFloat(c.total_cost.toFixed(2)):c.total_tokens})):[],[a,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(sa,{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",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:ll.map(({id:g,label:c})=>t.jsx(U,{variant:"ghost",size:"sm","aria-pressed":e===g,onClick:()=>s(g),className:de(e===g&&"bg-surface text-ink hover:bg-surface"),children:c},g))})]})]}),o&&t.jsx(bn,{className:"h-62 w-full"}),r&&t.jsx(ie,{variant:"warning",children:n("ui.settings.account.settings_page.usage_load_failed",{reason:r.message})}),!o&&!r&&a&&d.length>0&&t.jsx(Uc,{metric:e,data:d}),!o&&!r&&(!a||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")})]})},ul=()=>(G(),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(hi,{size:16,className:"shrink-0 text-ink-dim"}),n("ui.settings.account.settings_page.radient_account")]}),t.jsx(U,{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(Vs,{})]})})]})),Nl=()=>{G();const e=Ds("surface"),s=be(y=>y.showAgentReasoning),i=be(y=>y.setShowAgentReasoning),a=be(y=>y.transcriptDisplayMode),o=be(y=>y.setTranscriptDisplayMode),{data:r,isLoading:d,isFetching:g,error:c,refetch:_}=zs(),f=fn(),{sentence:v,remedy:j}=ft(f??null,n("ui.settings.navigation.settings_page.your_settings_could_not_be_loaded"),c),m=oi(),[p,A]=l.useState(null),M=mn(),{isAuthenticated:q,accountRead:N,isFetching:H,isRefreshing:P,refreshUser:E}=wt(),C=Ze(y=>y.activeSessionId),[Q,Z]=l.useState("general"),[J,T]=l.useState(!1),te=l.useRef(null),O=l.useRef(null),{startTour:z}=ri(),L=Us(),{data:$,refetch:B}=Ps(),{refreshModels:ae}=Ks(),h=l.useMemo(()=>$?.keys?[...$.keys].sort():[],[$?.keys]),I=l.useRef({keys:"",hosting:void 0});l.useEffect(()=>{const y=h.join(","),F=r?.values?.hosting;(I.current.keys!==y||I.current.hosting!==F)&&(I.current={keys:y,hosting:F},ae().catch(D=>{console.error("Failed to refresh models after credentials or hosting change:",D)}))},[h,r?.values?.hosting,ae]);const k=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,V=l.useMemo(()=>new URLSearchParams(L.search).get("setting"),[L.search]),Y=l.useMemo(()=>new URLSearchParams(L.search).get("filter")??"",[L.search]),X=l.useMemo(()=>new URLSearchParams(L.search).get("mcp")??void 0,[L.search]),ee=l.useMemo(()=>new URLSearchParams(L.search).get("provider"),[L.search]),W=l.useCallback(y=>{Z(y),T(!0);const F=k[y],D=O.current;if(F?.current&&D){const ne=F.current.getBoundingClientRect().top-D.getBoundingClientRect().top;D.scrollHeight>D.clientHeight?D.scrollTo({top:Math.max(0,D.scrollTop+ne-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,F.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout(te.current??void 0),te.current=setTimeout(()=>{T(!1),te.current=null},800)}else T(!1)},[k]);l.useEffect(()=>{const y=setTimeout(()=>{const F=O.current;if(!F)return;const D=()=>{if(J)return;const le=F.getBoundingClientRect(),ne=le.height;let oe="",ye=0;for(const[_e,Ne]of Object.entries(k))if(Ne.current){const re=Ne.current.getBoundingClientRect(),pe=le.top,xe=re.top-pe,Se=re.bottom-pe,Ve=re.height,st=Math.max(0,xe),it=Math.min(ne,Se),Le=Math.max(0,it-st)/Ve,Fe=Le+(xe<ne*.3?.1:0);Fe>ye&&Le>.1&&(ye=Fe,oe=_e)}oe&&oe!==Q&&Z(oe)};return D(),F.addEventListener("scroll",D,{passive:!0}),()=>{F.removeEventListener("scroll",D),clearTimeout(te.current??void 0)}},100);return()=>clearTimeout(y)},[k,Q,J]),l.useEffect(()=>{const y=new URLSearchParams(L.search),F=y.get("section"),D=y.get("setting"),le=D?$s(D,"backend"):F,ne=le?k[le]:void 0;if(!le||!ne)return;let oe=!1,ye=Number.NaN,_e=0;const Ne=window.setTimeout(()=>{oe||(oe=!0,pe.disconnect(),W(le))},2e3),re=()=>{if(oe)return;const xe=ne.current;if(!xe){_e=requestAnimationFrame(re);return}const Se=Math.round(xe.getBoundingClientRect().top+window.scrollY);if(Se===ye&&Se>0){oe=!0,pe.disconnect(),window.clearTimeout(Ne),W(le);return}ye=Se,_e=requestAnimationFrame(re)},pe=new ResizeObserver(()=>{oe||(cancelAnimationFrame(_e),_e=requestAnimationFrame(re))});return O.current&&pe.observe(O.current),_e=requestAnimationFrame(re),()=>{oe=!0,cancelAnimationFrame(_e),pe.disconnect(),window.clearTimeout(Ne)}},[L.search,k,W]);const fe=async(y,F)=>{A(y);try{await m.mutateAsync({[y]:F}),await _()}catch(D){console.error(`Error updating ${y}:`,D)}finally{A(null)}},we=d,me=N==="checking",Te=hn(N),b=N==="ready"||N==="checking"||H,R=kn(we,4e3);return c?t.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:t.jsx(ie,{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:v}),j&&t.jsx(U,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void _(),disabled:g,children:g?n("ui.settings.navigation.settings_page.retrying"):n("ui.settings.navigation.settings_page.retry")})]})})}):we?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:R?void 0:n("ui.settings.navigation.settings_page.loading_settings")}),R&&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")})]}):r?t.jsxs("div",{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(ci,{activeSection:Q,onSelectSection:W,sections:li})}),t.jsx("div",{ref:O,"data-settings-content":!0,"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(fi,{title:n("ui.settings.page.title"),icon:Pt}),t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsxs("div",{ref:k.general,className:"flex flex-col gap-8",children:[t.jsx(di,{focus:V===Ot}),t.jsxs(se,{title:n("ui.settings.profile.title"),icon:ui,description:n(q?"ui.settings.profile.description_authenticated":"ui.settings.profile.description_anonymous"),children:[me&&t.jsx("p",{className:"text-meta text-ink-dim",children:n("ui.settings.profile.account_checking")}),Te&&t.jsx(ie,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:n(N==="refused"?"ui.settings.profile.account_read_failed_refused":"ui.settings.profile.account_read_failed_retry")}),t.jsx(U,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>E(),disabled:P,children:P?n("ui.settings.profile.retrying"):n("ui.settings.profile.retry")})]})}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Kt,{value:M.profile.name,label:n("ui.settings.profile.display_name.label"),placeholder:n("ui.settings.profile.display_name.placeholder"),isSaving:p==="user_name",onSave:async y=>{A("user_name");try{M.updateName(y)}finally{A(null)}},readOnly:b}),t.jsx(Kt,{value:M.profile.email,label:n("ui.settings.profile.email.label"),placeholder:n("ui.settings.profile.email.placeholder"),isSaving:p==="user_email",onSave:async y=>{A("user_email");try{M.updateEmail(y)}finally{A(null)}},readOnly:b})]})]}),t.jsx(se,{title:n("ui.settings.tour.title"),description:n("ui.settings.tour.description"),children:t.jsxs(U,{variant:"secondary",onClick:()=>{z({forceModalCompleted:!0})},children:[t.jsx(aa,{}),n("ui.settings.tour.action")]})}),t.jsx(se,{id:"model-settings",title:n("ui.settings.model.settings_page.model_settings"),icon:_i,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(gi,{value:r.values.hosting,isSaving:p==="hosting",onSave:y=>fe("hosting",y),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:n("ui.settings.model.settings_page.no_hosting_options")}),t.jsx(mi,{value:r.values.model_name,hostingId:r.values.hosting,isSaving:p==="model_name",onSave:y=>fe("model_name",y),allowCustom:!0,allowDefault:!1}),t.jsx(ie,{variant:"neutral",icon:t.jsx(Xe,{className:"size-4","aria-hidden":"true"}),children:n("ui.settings.model.settings_page.you_need_a_radient_account_or_your_own_api_keys_to_reach_cloud_pr")})]})}),t.jsx(Wc,{}),t.jsx(se,{title:n("ui.settings.configuration.settings_page.configuration_information"),icon:Xe,description:n("ui.settings.configuration.settings_page.system_information_about_the_current_configuration"),children:t.jsxs(et,{children:[t.jsx(ce,{label:n("ui.settings.configuration.settings_page.version"),value:t.jsx("span",{className:"text-mono-sm",children:r.version})}),t.jsx(ce,{label:n("ui.settings.configuration.settings_page.created"),value:pn(r.metadata.created_at)}),t.jsx(ce,{label:n("ui.settings.configuration.settings_page.last_modified"),value:yn(r.metadata.last_modified)}),t.jsx(ce,{label:n("ui.settings.configuration.settings_page.description"),value:r.metadata.description||n("ui.settings.configuration.settings_page.no_description_available")})]})})]}),t.jsx(se,{title:n("ui.settings.appearance.settings_page.appearance"),icon:jn,description:n("ui.settings.appearance.settings_page.customize_the_look_and_feel_of_local_operator"),sectionRef:k.appearance,dataTourTag:"settings-appearance-section",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(ol,{}),t.jsx(Xo,{value:s,label:n("ui.settings.appearance.settings_page.show_agent_reasoning"),description:n("ui.settings.appearance.settings_page.adds_the_agent_s_reasoning_and_thinking_rows_to_conversations_the"),onChange:async y=>i(y)}),t.jsx(rl,{value:xn(a),onChange:y=>o(y)})]})}),t.jsx(Qc,{sectionRef:k.speech}),t.jsx(_r,{sectionRef:k.keyboard}),t.jsx(se,{title:n("ui.settings.model.settings_page.model_providers"),icon:gn,description:n("ui.settings.navigation.settings_page.sign_in_to_the_services_your_agents_think_with_new_chats_use_your"),sectionRef:k.providers,children:t.jsx(pi,{initialProviderId:ee,onChangeModel:()=>W("general")})}),t.jsx(Oc,{sessionId:C??void 0,sectionRef:k.integrations,highlightServer:X}),t.jsx(se,{title:n("ui.settings.account.settings_page.radient_account"),titleComponent:t.jsx(ul,{}),description:n("ui.settings.account.settings_page.your_radient_account_radient_pass_details_and_credits_to_use_radi"),sectionRef:k.radient,dataTourTag:"settings-radient-account-section",children:t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsx(zc,{onAfterCredentialUpdate:()=>{ae(),B()}}),q&&t.jsxs(t.Fragment,{children:[t.jsx(cl,{}),t.jsx(dl,{})]})]})}),t.jsx(se,{title:n("ui.settings.navigation.settings_page.backend_settings"),icon:Pt,description:n("ui.settings.navigation.settings_page.every_setting_the_backend_registry_owns_searchable_with_typed_edi"),sectionRef:k.backend,children:t.jsx(Bs,{hideInterfaceLanguage:!0,focusKey:V===Ot?null:V,initialFilter:Y})}),t.jsx("div",{ref:k.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(ie,{variant:"warning",className:"w-full max-w-xl",children:n("ui.settings.navigation.settings_page.your_settings_could_not_be_loaded")})})};export{Nl as SettingsPage};