local-operator-ui 0.31.18 → 0.31.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/out/main/index.js +149 -8
- package/out/renderer/assets/{_basePickBy-D1XXNWdy.js → _basePickBy-BjXXwW6E.js} +1 -1
- package/out/renderer/assets/{_baseUniq-DD_DKvaU.js → _baseUniq-xIg3idQF.js} +1 -1
- package/out/renderer/assets/{agent-details-page-Q8dgdQp2.js → agent-details-page-D2QdVqJp.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-CBHsotVj.js → agent-hub-page-BitfELv8.js} +2 -2
- package/out/renderer/assets/agents-page-Cl1j7rwO.js +2 -0
- package/out/renderer/assets/{renderer-platform-RsXXlY5x.js → aida-control-BqbEHtVs.js} +19 -19
- package/out/renderer/assets/{arc-BII0LAll.js → arc-Ceouzeia.js} +1 -1
- package/out/renderer/assets/architectureDiagram-IEHRJDOE-BGSLJh-o.js +36 -0
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-BsfIO03o.js → blockDiagram-JOT3LUYC-BmQJgCM-.js} +6 -6
- package/out/renderer/assets/{book-open-Bau36KjM.js → book-open-tLP18D-k.js} +1 -1
- package/out/renderer/assets/browser-page-ChmnhnuO.js +1 -0
- package/out/renderer/assets/browser-webauthn-prompt-k5jzjWeZ.js +1 -0
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-CHKu8u4B.js → c4Diagram-VJAJSXHY-Yk9CQYyQ.js} +1 -1
- package/out/renderer/assets/channel-CoXp_5DQ.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-Do_SeY3I.js → chunk-4BMEZGHF-DizR_fDb.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-C7_NoYUm.js → chunk-A2AXSNBT-BtTz6zUt.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-C3I1E4qy.js → chunk-AEK57VVT-D1a4VfuY.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-BEkTCb-4.js → chunk-D6G4REZN-bed23kTE.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-Ccs-Kaym.js → chunk-RZ5BOZE2-KfGYL-ag.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-Db28vmME.js → chunk-XZIHB7SX-B1igQQgc.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-DLxyNS1q.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-DLxyNS1q.js +1 -0
- package/out/renderer/assets/clone-1ZAhWRhd.js +1 -0
- package/out/renderer/assets/{console-mirror-CUQyeXIE.js → console-mirror-CqlxE8VR.js} +1 -1
- package/out/renderer/assets/{consoleCapture-emgU7WyW.js → consoleCapture-Bgq6O6hd.js} +1 -1
- package/out/renderer/assets/dagre-OKDRZEBW-BlwfTwwA.js +4 -0
- package/out/renderer/assets/diagram-SSKATNLV-jsDlGkgc.js +43 -0
- package/out/renderer/assets/diagram-VNBRO52H-DP8qnarm.js +24 -0
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-BYRglvp5.js → erDiagram-Q7BY3M3F-Tc8DPglp.js} +1 -1
- package/out/renderer/assets/{error-boundary-BFYdHP26.js → error-boundary-X9vF0zez.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-C6ReCJC9.js → flowDiagram-4HSFHLVR-C0iWuz_e.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-CMDShfzg.js → ganttDiagram-APWFNJXF-CXzAhOwO.js} +3 -3
- package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-c3OKkh69.js +65 -0
- package/out/renderer/assets/{graph-BK-Vf19N.js → graph-BNpclJqw.js} +1 -1
- package/out/renderer/assets/index-BgDCWTEy.js +7 -0
- package/out/renderer/assets/{index-BDPyvriR.js → index-BsveCKct.js} +385 -375
- package/out/renderer/assets/index-D4_JjH_R.js +1 -0
- package/out/renderer/assets/index-R0cHU6YS.css +1 -0
- package/out/renderer/assets/infoDiagram-PH2N3AL5-C6rpQuUJ.js +2 -0
- package/out/renderer/assets/{installer-DfFRjYBs.js → installer-Durl4Nt6.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-CeBVrNEA.js → journeyDiagram-U35MCT3I-DdWl9wJG.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-DnIH3R0V.js → kanban-definition-NDS4AKOZ-D6rkiZvG.js} +1 -1
- package/out/renderer/assets/{layout-IqcTjCQI.js → layout-BQqWsgv9.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-DbLTVwq0.js → legacy-agents-page-xSUV6wUg.js} +3 -3
- package/out/renderer/assets/{mermaid.core-BrRc254F.js → mermaid.core-DLc2GDBk.js} +5 -5
- package/out/renderer/assets/mesh-page-D1Hn61zc.js +2 -0
- package/out/renderer/assets/mindmap-definition-ALO5MXBD-BPp31SFM.js +95 -0
- package/out/renderer/assets/mini-dIYd4lBf.js +1 -0
- package/out/renderer/assets/org-surface-gate-CQZDYvz1.js +1 -0
- package/out/renderer/assets/{page-header-BtO13sx8.js → page-header-Ct_E4hXM.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-CnRMxjLj.js → pieDiagram-IB7DONF6-InajJAb7.js} +1 -1
- package/out/renderer/assets/{projects-page-BgRRDkEz.js → projects-page-Cq4-43oz.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-bRLUBm5r.js → quadrantDiagram-7GDLP6J5-DllpcIGZ.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-BV3WfB2Y.js → radar-MK3ICKWK-o49sXvJd.js} +1 -1
- package/out/renderer/assets/radient-auth-buttons-DCKuV_IZ.js +1 -0
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-Bzqys165.js → requirementDiagram-KVF5MWMF-DEB_P2Er.js} +1 -1
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD-1sqsEoj5.js +10 -0
- package/out/renderer/assets/{schedules-page-CbOATI1U.js → schedules-page-D6uKCgBE.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-bfcEv3LN.js → sequenceDiagram-X6HHIX6F-DBKLSCMO.js} +1 -1
- package/out/renderer/assets/settings-page-DuO8dHwe.js +297 -0
- package/out/renderer/assets/{settings-section-BXGO9Lv0.js → settings-section-yg8wX_kN.js} +1 -1
- package/out/renderer/assets/stateDiagram-DGXRK772-CirIxYQ4.js +1 -0
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-BektpfMe.js +1 -0
- package/out/renderer/assets/{textarea-B83uQCj2.js → textarea-CPyoWJfR.js} +1 -1
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-BlN_DgVS.js → timeline-definition-BDJGKUSR-HxrDshvA.js} +1 -1
- package/out/renderer/assets/{ui-preferences-store-DzXZGWGz.js → ui-preferences-store-CyKvDymq.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-DrENBWNa.js → use-download-agent-mutation-CJP2OhpP.js} +2 -2
- package/out/renderer/assets/use-memberships-query-Q96GogTV.js +1 -0
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-C1DOS4ES.js → xychartDiagram-VJFVF3MP-BXsPMfju.js} +1 -1
- package/out/renderer/console-capture.html +5 -5
- package/out/renderer/index.html +8 -8
- package/out/renderer/installer.html +5 -5
- package/out/renderer/mini.html +6 -6
- package/package.json +2 -2
- package/out/renderer/assets/agents-page-9zkhLfa8.js +0 -2
- package/out/renderer/assets/architectureDiagram-IEHRJDOE-Yh4i0oDy.js +0 -36
- package/out/renderer/assets/browser-page-CrHmmBk0.js +0 -1
- package/out/renderer/assets/browser-webauthn-prompt-_nNd3iSK.js +0 -1
- package/out/renderer/assets/channel-DXiH5yDB.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-D2MG4USX.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-D2MG4USX.js +0 -1
- package/out/renderer/assets/clone-BDi6ICAs.js +0 -1
- package/out/renderer/assets/dagre-OKDRZEBW-k4D1AM8X.js +0 -4
- package/out/renderer/assets/diagram-SSKATNLV-B0DOtyf9.js +0 -43
- package/out/renderer/assets/diagram-VNBRO52H-BmzuI3Lr.js +0 -24
- package/out/renderer/assets/gitGraphDiagram-7IBYFJ6S-pvPc8CHP.js +0 -65
- package/out/renderer/assets/index-B5DwqFlK.js +0 -7
- package/out/renderer/assets/index-DITdBETY.css +0 -1
- package/out/renderer/assets/index-_oyU7kmX.js +0 -1
- package/out/renderer/assets/infoDiagram-PH2N3AL5-COePE42k.js +0 -2
- package/out/renderer/assets/mesh-page-W9oV_bPF.js +0 -2
- package/out/renderer/assets/mindmap-definition-ALO5MXBD-BMHndK7E.js +0 -95
- package/out/renderer/assets/mini-CbmMlUkq.js +0 -1
- package/out/renderer/assets/org-surface-gate-BgtTWHt3.js +0 -1
- package/out/renderer/assets/radient-auth-buttons-Briy2cZb.js +0 -1
- package/out/renderer/assets/sankeyDiagram-QLVOVGJD--IgSaXgN.js +0 -10
- package/out/renderer/assets/settings-page-Bn87mGZ1.js +0 -307
- package/out/renderer/assets/stateDiagram-DGXRK772-CDJAoYUf.js +0 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-Di7PMVrt.js +0 -1
- package/out/renderer/assets/use-memberships-query-C2Yus1QJ.js +0 -1
- /package/out/renderer/assets/{index-CDaH3A1m.js → index-C17iOszj.js} +0 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import{r as i,j as t,c as ce,t as jn}from"./index-C17iOszj.js";import{c6 as Gt,c7 as _n,c8 as Nn,c9 as jt,ca as _t,cb as Cn,by as Sn,bz as Vt,a4 as qt,aa as Mn,ab as An,cc as Rn,cd as Tn,ce as In,cf as Ln,cg as Yt,ch as lt,ci as Wt,ah as En,cj as Nt,ck as On,cl as Fn,a3 as Zt,aj as tt,ak as nt,aG as $n,am as Dn,cm as st,cn as at,co as Un,e as zn,P as Ct,bE as Pn,cp as Qt,cq as Hn,cr as Kn,cs as Bn,a9 as Gn,ct as Jt,ai as Xt,cu as Vn,cv as en,cw as qn,cx as Yn,cy as Wn,ac as Zn,cz as tn,bK as Qn,cA as Jn,cB as Xn,u as es,bH as ts,aY as ns,cC as ss,cD as as,bB as os,cE as rs,cF as is,cG as cs,cH as ls,bu as St,bn as ds,bG as Mt,cI as us,bI as ms,bJ as hs,cJ as ps,cK as fs,cL as gs,cM as ys,cN as xs}from"./index-BsveCKct.js";import{b as Ne,i as dt,a as nn,D as ut,a5 as ks,e as ve,u as vs,d as At,c as ze,a6 as bs,a7 as ws}from"./aida-control-BqbEHtVs.js";import{P as js}from"./page-header-Ct_E4hXM.js";import{c as y,B as F,S as oe,a1 as _s,g as Re,H as Be,L as he,I as Ce,_ as Rt,$ as Tt,a0 as De,a2 as It,a as sn,M as Ns,v as Cs,w as Ss,x as Ms,z as As,E as Lt,T as Rs,A as le,F as Ts,N as Is,j as Ls,f as an}from"./textarea-CPyoWJfR.js";import{u as ot}from"./ui-preferences-store-CyKvDymq.js";import{S as se,I as mt,a as ae,N as Es}from"./settings-section-yg8wX_kN.js";import{R as Os}from"./radient-auth-buttons-DCKuV_IZ.js";import{B as Fs}from"./book-open-tLP18D-k.js";import{i as $s,a as ke,b as Ds,p as Ze,f as Us}from"./parseISO-BWtr7JL9.js";import{t as zs}from"./en-US-BkS8Ixxl.js";import"./error-boundary-X9vF0zez.js";import"./console-mirror-CqlxE8VR.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 Ps=[["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"}]],Hs=y("aperture",Ps);/**
|
|
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 Ks=[["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"}]],Bs=y("atom",Ks);/**
|
|
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 Gs=[["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"}]],Vs=y("audio-waveform",Gs);/**
|
|
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 qs=[["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"}]],Ys=y("binary",qs);/**
|
|
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 Ws=[["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"}]],Zs=y("candy",Ws);/**
|
|
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 Qs=[["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"}]],Js=y("car-front",Qs);/**
|
|
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 Xs=[["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"}]],ea=y("cassette-tape",Xs);/**
|
|
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 ta=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],na=y("chart-line",ta);/**
|
|
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 sa=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],aa=y("circle-play",sa);/**
|
|
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=y("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 ia=[["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"}]],ca=y("circuit-board",ia);/**
|
|
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 la=[["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"}]],da=y("cloud-lightning",la);/**
|
|
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 ua=[["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"}]],ma=y("cloud-moon",ua);/**
|
|
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 ha=[["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=y("cloud-snow",ha);/**
|
|
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 fa=[["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"}]],ga=y("cloud-sun",fa);/**
|
|
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=y("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"}]],on=y("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=y("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 wa=[["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"}]],ja=y("cup-soda",wa);/**
|
|
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 _a=[["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"}]],Na=y("disc-3",_a);/**
|
|
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 Ca=[["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"}]],Sa=y("droplet",Ca);/**
|
|
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 Ma=[["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"}]],Aa=y("droplets",Ma);/**
|
|
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=y("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"}]],La=y("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 Ea=[["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"}]],Oa=y("flower-2",Ea);/**
|
|
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 Fa=[["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"}]],$a=y("flower",Fa);/**
|
|
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 Da=[["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"}]],Ua=y("ghost",Da);/**
|
|
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 za=[["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"}]],Pa=y("github",za);/**
|
|
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 Ha=[["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"}]],Ka=y("guitar",Ha);/**
|
|
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 Ba=[["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=y("hexagon",Ba);/**
|
|
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 Va=[["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"}]],qa=y("ice-cream-bowl",Va);/**
|
|
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 Ya=[["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"}]],Wa=y("joystick",Ya);/**
|
|
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 Za=[["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"}]],Qa=y("leaf",Za);/**
|
|
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 Ja=[["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"}]],Xa=y("lightbulb",Ja);/**
|
|
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 eo=[["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"}]],to=y("milk",eo);/**
|
|
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 no=[["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"}]],so=y("moon-star",no);/**
|
|
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=y("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"}]],io=y("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 co=[["path",{d:"m8 3 4 8 5-5 5 15H2L8 3z",key:"otkl63"}]],lo=y("mountain",co);/**
|
|
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 uo=[["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"}]],mo=y("radio",uo);/**
|
|
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 ho=[["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=y("sailboat",ho);/**
|
|
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 fo=[["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"}]],go=y("shirt",fo);/**
|
|
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=y("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=y("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"}]],wo=y("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 jo=[["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"}]],_o=y("sun-dim",jo);/**
|
|
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 No=[["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"}]],Co=y("sun",No);/**
|
|
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 So=[["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"}]],Mo=y("sunrise",So);/**
|
|
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 Ao=[["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=y("sunset",Ao);/**
|
|
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=y("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 Lo=[["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"}]],Eo=y("tree-deciduous",Lo);/**
|
|
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 Oo=[["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"}]],Fo=y("tree-palm",Oo);/**
|
|
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 $o=[["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"}]],Do=y("tree-pine",$o);/**
|
|
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 Uo=[["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"}]],zo=y("trees",Uo);/**
|
|
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 Po=[["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"}]],Ho=y("umbrella",Po);/**
|
|
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 Ko=[["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"}]],Bo=y("waves",Ko);/**
|
|
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"}]],Vo=y("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 qo=[["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"}]],Yo=y("wind",qo);/**
|
|
292
|
+
* @license lucide-react v0.507.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const Wo=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Zo=y("zap",Wo),Qo=({appVersion:e=null,slowWaitHintMs:s})=>{const n="https://local-operator.com/download",[a,o]=i.useState(!1),r=Gt(a,s??_n),[u,d]=i.useState(!1),[c,m]=i.useState(null),[g,b]=i.useState("info"),[k,p]=i.useState(null),[x,I]=i.useState(null),N=e?.trim()?e.trim():null,B=i.useRef(!1),_=i.useRef(!1),U=i.useRef(0),O=i.useRef(!1),M=i.useCallback((P,A)=>{_.current=!1,m(P),b(A),d(!0)},[]),C=i.useCallback(P=>{_.current=!0,m(P),b("success"),d(!0)},[]),H=i.useCallback(()=>{_.current&&(_.current=!1,d(!1),m(null))},[]),{clearDeferredUpdate:V}=Nn();i.useEffect(()=>{const P=window.api.updater.onUpdateError(J=>{B.current&&J.includes("manually")&&(p({message:"The server is installed outside the app, so use the tool you installed it with - uv, pipx or pip.",command:""}),_.current=!1,m(null),b("warning"),d(!0))}),A=window.api.updater.onBackendUpdateDevMode(J=>{B.current&&M(J,"info")}),D=()=>{O.current=!0,H()},q=window.api.updater.onUpdateAvailable(D),K=window.api.updater.onUpdateNpxAvailable(D),L=window.api.updater.onBackendUpdateAvailable(D);return()=>{P(),A(),q(),K(),L()}},[H,M]),i.useEffect(()=>{let P=!1;const A=()=>{window.api.updater.getLastInstallAttempt().then(q=>{P||I(q)}).catch(()=>{})};A();const D=window.api.updater.onUpdateInstallFailed(()=>A());return()=>{P=!0,D()}},[]);const Y=async()=>{const P=++U.current;H(),O.current=!1;try{o(!0),B.current=!0,V(_t.UI),V(_t.BACKEND);const A=await window.api.updater.checkForAllUpdates({manual:!0});if(P!==U.current)return;A?.affirmation&&!O.current?C(A.affirmation):H()}catch(A){if(P!==U.current)return;console.warn(`Update check failed; the app-level alert owns the report: ${Cn(A)}`)}finally{P===U.current&&o(!1),setTimeout(()=>{B.current=!1},2e3)}},z=()=>{_.current=!1,d(!1),m(null)};return t.jsxs(t.Fragment,{children:[x&&t.jsxs("div",{className:"mb-3 rounded-sm bg-sunken p-3",children:[t.jsxs("p",{className:"text-body-sm text-ink",children:["The last update to version ",x.targetVersion," didn't finish",x.attempts>1?` (${x.attempts} attempts)`:"",".",N?` Version ${N} is running.`:null]}),t.jsxs("p",{className:"mt-1 text-meta text-ink-dim",children:["Detected"," ",x.detectedAt?new Date(x.detectedAt).toLocaleString():"at an unknown time",". ",x.detail]}),t.jsx(F,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>void window.api.openExternal(n),children:"Download a fresh copy"})]}),t.jsxs(F,{variant:"outline",onClick:()=>void Y(),disabled:a,children:[a?t.jsx(oe,{size:"sm"}):null,a?"Checking...":"Check for updates"]}),r&&t.jsx("p",{className:"mt-2 text-meta text-ink-muted",children:"Still checking. A slow or stalled connection can hold this for about a minute and a half - the app stops waiting on its own."}),k&&t.jsxs(jt,{open:u,autoHideDuration:1e4,onClose:z,variant:"warning",children:[t.jsx("p",{className:"text-body-sm",children:k.message}),k.command&&t.jsx("code",{className:"mt-2 block rounded-sm bg-sunken p-2 text-mono-sm text-ink",children:k.command})]}),c&&g!=="danger"&&t.jsx(jt,{open:u,autoHideDuration:6e3,onClose:z,variant:g,children:c})]})},Pe=["system-prompt"],Jo=()=>{const{shouldEnableQuery:e}=Sn();return Ne({enabled:e({bypassInternetCheck:!0}),queryKey:Pe,queryFn:async()=>{try{const n=await Vt(dt.baseUrl).config.getSystemPrompt();if(n===null)return null;if(n.status>=400)throw new Error(n.message||"Failed to fetch system prompt");return n.result}catch(s){const n=s instanceof Error?s.message:"An unknown error occurred while fetching system prompt";throw qt(n),s}},refetchOnWindowFocus:!1,staleTime:5e3})},Xo=()=>{const e=nn(),s=Vt(dt.baseUrl);return Mn({mutationFn:async n=>{try{const a=await s.config.updateSystemPrompt(n);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 qt(o),a}},onSuccess:async n=>{await e.invalidateQueries({queryKey:Pe,refetchType:"none"}),e.setQueryData(Pe,a=>a&&{...a,...n}),await e.refetchQueries({queryKey:Pe,type:"all"}),An("System prompt updated")},onError:n=>{console.error("Error updating system prompt:",n)}})},er=({value:e,label:s,description:n,onChange:a,icon:o,isSaving:r=!1})=>{const[u,d]=i.useState(e),c=i.useId(),m=`${c}-label`,g=`${c}-description`,b=async k=>{if(!r){d(k);try{await a(k)}catch(p){d(!k),console.error("Error toggling setting:",p)}}};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:m,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]}),n&&t.jsx("p",{id:g,className:"mt-0.5 max-w-2xl text-body-sm text-ink-muted",children:n})]}),t.jsx("div",{className:"flex h-6 shrink-0 items-center",children:r?t.jsx(oe,{size:"md",label:`Saving ${s}`}):t.jsx(_s,{checked:u,onCheckedChange:b,"aria-labelledby":m,"aria-describedby":n?g:void 0})})]})};var tr=Rn({chartName:"LineChart",GraphicalChild:Yt,axisComponents:[{axisType:"xAxis",AxisComp:Tn},{axisType:"yAxis",AxisComp:In}],formatAxisMap:Ln});function Et(e,s){const n=zs(e,s?.in);if(!$s(n))throw new RangeError("Invalid time value");const a=ke(n.getDate(),2),o=ke(n.getMonth()+1,2),r=n.getFullYear(),u=ke(n.getHours(),2),d=ke(n.getMinutes(),2),c=ke(n.getSeconds(),2);let m="",g="";const b=n.getTimezoneOffset();if(b!==0){const k=Math.abs(b),p=ke(Math.trunc(k/60),2),x=ke(k%60,2);g=`${b<0?"+":"-"}${p}:${x}`}else g="Z";return`${r}-${o}-${a}T${u}:${d}:${c}${m}${g}`}function nr(e,s,n){return Ds(e,-30,n)}const sr=["radient","creditBalance"],ar=e=>{const{user:s,isAuthenticated:n}=lt(),a=s?.account?.tenant_id,o=n&&!!a&&e?.enabled;return Ne({queryKey:[sr,a],queryFn:async()=>{if(!a)throw new Error("Tenant ID not available");const r=await Wt({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})},or=["radient","usageRollup"],rr=(e,s)=>{const{user:n,isAuthenticated:a}=lt(),o=n?.account?.tenant_id,r=a&&!!o&&s?.enabled;return Ne({queryKey:[...or,o,e],queryFn:async()=>{if(!o)throw new Error("Tenant ID not available");const u={};for(const[c,m]of Object.entries(e))m!=null&&(u[c]=String(m));const d=await Wt({operation:"usage",tenantId:o,query:u});if(!d)throw new Error("Invalid usage rollup response format");return d},enabled:r,staleTime:5*60*1e3,refetchOnWindowFocus:!0})},ir=({appVersion:e})=>t.jsx(Qo,{appVersion:e}),cr=e=>{if(!e)return null;try{return new URL(e).host}catch{return null}},lr=()=>{const[e,s]=i.useState(null),[n,a]=i.useState({value:"Loading...",detail:null,degraded:!1}),[o,r]=i.useState({platform:"Loading...",arch:"...",nodeVersion:"Loading...",electronVersion:"Loading...",chromeVersion:"Loading..."});i.useEffect(()=>{let d=!0;const c=p=>{if(!d)return;const x=cr(p.url);if(p.state==="connecting"){a({value:"Loading...",detail:null,degraded:!1});return}if(p.state==="detached"){a({value:"Not connected",detail:p.detail||null,degraded:!1});return}if(p.state==="wedged"){a({value:"Not attached",detail:p.detail||null,degraded:!1});return}const I=p.version||"Version unknown";a({value:x?`${I} · ${x}`:I,detail:p.detail||null,degraded:p.state==="degraded"})};let m=!1;const g=window.api?.backend?.onStatusChange(p=>{m=!0,c(p)}),b=async()=>{try{const[p,x]=await Promise.all([window.api.systemInfo.getAppVersion(),window.api.systemInfo.getPlatformInfo()]);d&&(s(p),r(x))}catch(p){console.error("Error fetching app information:",p)}},k=async()=>{try{const p=window.api?.backend;if(p){const N=await p.getStatus();m||c(N);return}const x=await Nt.healthCheck(dt.baseUrl),I=Nt.getServerVersion(x);d&&a({value:I,detail:null,degraded:!1})}catch(p){console.error("Error fetching server version:",p),d&&a({value:"Unavailable",detail:null,degraded:!1})}};return b(),k(),()=>{d=!1,g?.()}},[]);const u=(d,c,m,g={})=>t.jsx(ae,{label:t.jsx(Re,{content:m,children:t.jsxs("span",{className:"inline-flex cursor-help items-center gap-1.5",children:[t.jsx(Be,{size:12,className:"shrink-0"}),d]})}),valueClassName:g.valueClassName,value:t.jsxs(t.Fragment,{children:[g.valueTooltip?t.jsx(Re,{content:g.valueTooltip,children:t.jsx("span",{"data-backend-version":g.valueHoverTarget?"":void 0,className:"cursor-help",children:c})}):c,g.statusNote?t.jsx("span",{className:"mt-0.5 block text-meta text-ink-dim",children:g.statusNote}):null]})});return t.jsx(se,{title:"Application updates and info",icon:En,description:"Check for updates and view information about your Local Operator installation.",dataTourTag:"settings-app-updates-section",children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs(mt,{children:[u("Application version",e??"Loading...","The version of the Local Operator user interface application."),u("Server version",n.value,"The version of the Local Operator API server backend, and the address of the daemon it was read from.",{valueTooltip:n.detail,valueHoverTarget:!0,statusNote:n.degraded?"Not answering":void 0,valueClassName:n.degraded?"text-ink-muted":void 0}),u("Platform",`${o.platform} (${o.arch})`,"The operating system and architecture your application is running on."),u("Node.js version",o.nodeVersion,"The JavaScript runtime environment version."),u("Electron version",o.electronVersion,"The framework version enabling this desktop application.")]}),t.jsx(ir,{appVersion:e})]})})},dr=[[[".claude.json"],"Claude Code"],[[".claude",".mcp.json"],"Claude Code"],[[".cursor","mcp.json"],"Cursor"],[[".vscode","mcp.json"],"VS Code"],[[".codex","config.toml"],"Codex CLI"]];function rn(e){if(!e)return null;const s=e.split("\\").join("/").split("/").filter(Boolean);for(const[n,a]of dr)if(!(s.length<n.length)&&s.slice(-n.length).join("/")===n.join("/"))return a;return null}const He=e=>`${e} ${e===1?"tool":"tools"}`,ur=e=>`${e} ${e===1?"integration":"integrations"}`,mr=["connected","needs_sign_in","not_started","connecting","error"],cn=e=>mr.includes(e),Se=(e,s)=>[...s].filter(n=>n.name===e&&n.status==="running").sort((n,a)=>a.created_at-n.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},pr=1e12,fr=1e9,gr=60*60*1e3,ln=(e,s=Date.now())=>{if(typeof e!="number"||!Number.isFinite(e))return null;const n=e>=pr?e:e<fr?null:e*1e3;return n===null||n>s+gr?null:Math.min(n,s)},be=(e,s)=>e?.[s]??hr,Ie=(e,s,n)=>kr(e,s)??n?.lastDecisive??null,yr=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}:{}}),ht=(e,s)=>e.status==="not_started"&&typeof e.tool_count=="number"&&(s.connectedAt!==null||e.status_basis==="stored"&&e.tool_count_basis==="last_seen"),xr=(e,s)=>[...s].filter(n=>n.name===e).sort((n,a)=>a.created_at-n.created_at)[0]??null,kr=(e,s)=>xr(e,s.filter(n=>n.status!=="cancelled")),Ge=e=>e.actions.includes("set_key")||e.actions.includes("add_key");function vr(e,s){const n=Math.max(0,Math.round((e-s)/1e3));if(n<60)return"just now";const a=Math.round(n/60);if(a<60)return`${a} min ago`;const o=Math.round(a/60);return o<24?`${o} h ago`:`${Math.round(o/24)} d ago`}function Qe(e){if(!e)return null;const s=e.trim();if(!s||/^\/\w/.test(s)||/\/mcp\s+\w+/.test(s))return null;let n=s;for(let a=0;a<3;a+=1){const o=n.replace(/^(?:connection (?:closed|error|refused)|error|closed|failed)\s*:\s*/i,"").trim();if(o===n)break;n=o}return n=n.replace(/\s*\(\s*\d{3}\s*\)/g,"").replace(/\s+([.,;])/g,"$1").replace(/\s{2,}/g," ").trim(),n||null}function br(e,s=[],n,a=Date.now()){const o=be(n,e.name),r=Se(e.name,s);if(r){if(r.action==="login"||r.action==="reauth")return{label:"Signing in…",tone:"info",detail:null,busy:!0};if(r.action==="logout")return{label:"Signing out…",tone:"info",detail:null,busy:!0}}if(!cn(e.status))return{label:"Status unavailable",tone:"neutral",detail:null,busy:!1};const u=Ie(e.name,s,o),d=Ve(u)&&e.status!=="connected",c=ht(e,o),m=gt(u)&&e.status!=="connected",g=(u?.action==="login"||u?.action==="reauth")&&u.status==="failed";if(o.disconnectedAt!==null)return{label:"Not connected",tone:"neutral",detail:null,busy:!1};switch(e.status){case"connected":return{label:typeof e.tool_count=="number"?`Connected · ${He(e.tool_count)}`:"Connected",tone:"success",detail:null,busy:!1};case"connecting":return{label:"Connecting…",tone:"info",detail:null,busy:!0};case"needs_sign_in":return{label:e.auth.kind==="api_key"||Ae(e,s,o)?"Needs a key":"Needs sign-in",tone:"warning",detail:Qe(e.status_reason),busy:!1};case"error":return{label:"Couldn't start",tone:"danger",detail:Qe(e.status_reason)??"No reason was given.",busy:!1};default:if(d)return{label:"Signed out",tone:"warning",detail:null,busy:!1};if(m)return{label:"Sign-out didn't finish",tone:"warning",detail:"The sign-in is still saved.",busy:!1};if(Ae(e,s,o))return{label:"Needs a key",tone:"warning",detail:null,busy:!1};if(g)return{label:"Sign-in didn't finish",tone:"warning",detail:null,busy:!1};if(o.needsSignIn)return{label:e.auth.kind==="api_key"||Ae(e,s,o)?"Needs a key":"Needs sign-in",tone:"warning",detail:Qe(e.status_reason),busy:!1};if(e.status_basis==="stored"&&c&&o.disconnectedAt===null){const b=o.connectedAt??ln(e.last_seen_at,a);return{label:b!==null?`Worked ${vr(a,b)} · ${He(e.tool_count)}`:`Worked earlier · ${He(e.tool_count)}`,tone:"success",detail:null,busy:!1}}return e.status_basis==="live"?{label:"Not connected",tone:"neutral",detail:null,busy:!1}:{label:"Ready",tone:"neutral",detail:null,busy:!1}}}const dn=e=>e===1?"Replace the saved key":"Replace saved keys",wr=/[,;]?\s*(?:or|and)?\s*add (?:its|a|the) key instead\.?\s*$/i;function jr(e,s){const n=e?.trim()??"";if(!n)return null;if(s)return n;const a=n.replace(wr,"").trim();return a?/\.$/.test(a)?a:`${a}.`:n}const _r="Nothing is wrong. It starts when a chat uses it.",Nr="Not running in this chat.",Cr=e=>e.transport==="local_command"?"Local command":"Remote URL";function un(e){switch(e.source.kind){case"local-operator":case"project-mcp-json":return null;case"claude-code":return"Claude Code";case"cursor":return"Cursor";case"vscode":return"VS Code";case"codex":return"Codex CLI";default:return rn(e.source.path)}}function Sr(e,s){const n=[Cr(e)];e.status!=="connected"&&e.tool_count_basis==="last_seen"&&typeof e.tool_count=="number"&&n.push(`${He(e.tool_count)} when last checked`),s&&n.push(e.scope==="project"?"This project":"Global");const a=un(e);return a?n.push(`Imported from ${a}`):e.source.editable||n.push("Imported from a project file"),n}const pt=(e,s)=>s.disconnectedAt!==null?"not_started":e.status;function ft(e,s=[],n){const a=be(n,e.name),o=Se(e.name,s);if(o)return o.action==="login"||o.action==="reauth"?{kind:"sign_in",label:"Continue sign-in"}:null;const r=g=>e.actions.includes(g),u=Ge(e),d=Ae(e,s,a);if(!cn(e.status))return r("test")?{kind:"test",label:"Check again"}:null;const c=Ie(e.name,s,a),m=c?.status==="failed"&&Le(c);switch(pt(e,a)){case"connected":case"connecting":return null;case"needs_sign_in":return d?{kind:"set_key",label:"Add key"}:r("sign_in")?{kind:"sign_in",label:"Sign in"}:u?{kind:"set_key",label:"Add key"}:r("reauth")?{kind:"reauth",label:"Sign in again"}:{kind:"fix",label:"Fix"};case"error":return r("connect")?{kind:"connect",label:"Reconnect"}:r("test")?{kind:"test",label:"Retry"}:{kind:"fix",label:"Fix"};default:{if(Ve(c)&&r("sign_in"))return{kind:"sign_in",label:"Sign in"};if(gt(c)&&r("sign_out"))return{kind:"sign_out",label:"Sign out again"};if(a.disconnectedAt!==null&&r("connect"))return{kind:"connect",label:"Connect"};if(a.needsSignIn){if(d&&u)return{kind:"set_key",label:"Add key"};if(r("sign_in"))return{kind:"sign_in",label:"Sign in"}}return d&&u?{kind:"set_key",label:"Add key"}:m&&r("sign_in")?{kind:"sign_in",label:"Try again"}:ht(e,a)&&!r("connect")?null:r("connect")?{kind:"connect",label:"Connect",...a.connectedAt===null&&e.status_basis!=="live"?{variant:"ghost"}:{}}:r("test")&&e.tool_count===null&&e.tool_count_basis===null?{kind:"test",label:"Test",variant:"ghost"}:null}}}const Le=e=>e.action==="login"||e.action==="reauth",Ve=e=>!!(e&&e.action==="logout"&&e.status==="complete"),gt=e=>!!(e&&e.action==="logout"&&e.status!=="running"&&e.status!=="complete"),mn=/no oauth authorization server/i;function Ae(e,s,n){if(!Ge(e))return!1;const a=Ie(e.name,s,n);return a&&Le(a)&&a.status==="failed"&&mn.test(a.message??"")?!0:n.needsKey}function Mr(e,s=[],n){const a=ft(e,s,n)?.kind,o=pt(e,be(n,e.name)),r=c=>e.actions.includes(c),u=[],d=Se(e.name,s);if(d&&u.push({kind:"cancel",label:"Cancel"}),!d&&r("test")&&a!=="test"&&u.push({kind:"test",label:"Test connection"}),r("connect")&&a!=="connect"&&o!=="connected"&&u.push({kind:"connect",label:"Reconnect"}),!d&&r("sign_in")&&a!=="sign_in"&&o!=="connected"&&u.push({kind:"sign_in",label:"Sign in"}),r("reload")&&u.push({kind:"reload",label:"Reload"}),!d&&r("reauth")&&a!=="reauth"&&u.push({kind:"reauth",label:"Sign in again"}),Ge(e)&&a!=="set_key"&&u.push({kind:"set_key",label:e.auth.secret_refs.length>0?"Update key":"Add key"}),r("sign_out")&&u.push({kind:"sign_out",label:"Sign out"}),r("disconnect")&&o==="connected"&&u.push({kind:"disconnect",label:"Disconnect"}),r("copy_setup")&&e.setup_prompt&&u.push({kind:"copy_setup",label:"Copy setup prompt"}),a!=="fix"&&u.push({kind:"open_config",label:"Open config file"}),r("remove"))u.push({kind:"remove",label:"Remove",destructive:!0});else if(!e.source.editable){const c=un(e);u.push({kind:"remove_elsewhere",label:c?`Remove in ${c}`:"Remove in its own file",hint:c?`Defined in ${c}'s config. Remove it there.`:"Defined in a file this app doesn't write. Remove it there."})}return u}const Ar={attention:"Needs attention",connected:"Connected",ready:"Available"};function hn(e,s=[],n){const a=be(n,e.name),o=Se(e.name,s),r=pt(e,a);if(o&&a.pinnedGroup&&a.pinnedOperationId===o.id)return a.pinnedGroup;if(r==="needs_sign_in"||r==="error")return"attention";const u=Ie(e.name,s,a);return Ve(u)&&r!=="connected"||gt(u)&&r!=="connected"?"attention":a.disconnectedAt!==null?"ready":Ae(e,s,a)||a.needsSignIn&&r!=="connected"||u?.status==="failed"&&Le(u)&&r!=="connected"?"attention":r==="connected"||e.status_basis==="stored"&&ht(e,a)?"connected":o&&o.action!=="test"?"attention":"ready"}function Rr(e,s=[],n){return["attention","connected","ready"].map(o=>({id:o,title:Ar[o],rows:e.filter(r=>hn(r,s,n)===o)})).filter(o=>o.rows.length>0)}function Tr(e,s,n=Date.now()){if(!s)return e??{};const a={};for(const o of s.servers){const r=be(e,o.name),u=Se(o.name,s.operations),d=Ie(o.name,s.operations,r),c=Ve(d),m=o.status==="connected"&&(o.status_basis==="probe"||o.status_basis==="live"),g=r.holdUntil!==null&&n<r.holdUntil,b=!g&&!c&&r.connectedAt===null&&o.status_basis==="stored"&&o.tool_count_basis==="last_seen"?ln(o.last_seen_at,n):null,k=!c,p=d?.status==="failed"&&Le(d)&&mn.test(d.message??""),x={connectedAt:m&&!g?n:b!==null?b:k?r.connectedAt:null,connectedToolCount:m&&!g||b!==null?o.tool_count??r.connectedToolCount:k?r.connectedToolCount:null,settledGroup:r.settledGroup,pinnedGroup:u&&r.pinnedOperationId===u.id?r.pinnedGroup:u?r.settledGroup:null,pinnedOperationId:u?u.id:null,needsKey:m?!1:r.needsKey||p,needsSignIn:m||c?!1:r.needsSignIn||o.status==="needs_sign_in",disconnectedAt:m&&!g?null:r.disconnectedAt,holdUntil:g?r.holdUntil:null,lastDecisive:d?yr(d):null};u||(x.settledGroup=hn(o,s.operations,{...a,[o.name]:x})),a[o.name]=x}return a}const Ir=(e,s)=>e!==null&&s===e,rt="local-operator.settings.integrations.row-memory",pn=(e,s)=>`${e}#${s}`;function Lr(e,s){const n={};if(!s)return n;for(const a of s.servers){const o=e[a.name];o&&(n[pn(a.source.path,a.name)]=o)}return n}function Er(e,s,n){if(!s)return e;let a=null;for(const o of s.servers){if(Object.prototype.hasOwnProperty.call(e,o.name))continue;const r=$r(n[pn(o.source.path,o.name)]);r&&(a=a??{...e},a[o.name]=r)}return a??e}const Or=["attention","connected","ready"],fn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),yt=e=>typeof e=="number"&&Number.isFinite(e)?e:null,Ot=e=>Or.includes(e)?e:null,Je=e=>{const s=yt(e);return s!==null&&s>=1e12?s:null};function Fr(e){if(!fn(e)||typeof e.id!="string"||typeof e.name!="string")return null;const s=e.action,n=e.status;return s!=="login"&&s!=="logout"&&s!=="reauth"&&s!=="test"||n!=="running"&&n!=="complete"&&n!=="cancelled"&&n!=="failed"?null:{id:e.id,name:e.name,action:s,status:n,created_at:yt(e.created_at)??0,credential_removed:e.credential_removed===!0,...typeof e.message=="string"?{message:e.message}:{}}}function $r(e){if(!fn(e))return null;const s=Je(e.connectedAt),n=Je(e.disconnectedAt),a=e.needsKey===!0,o=e.needsSignIn===!0,r=Fr(e.lastDecisive);return s===null&&n===null&&!a&&!o&&!r?null:{connectedAt:s,connectedToolCount:yt(e.connectedToolCount),settledGroup:Ot(e.settledGroup),pinnedGroup:Ot(e.pinnedGroup),pinnedOperationId:typeof e.pinnedOperationId=="string"?e.pinnedOperationId:null,needsKey:a,needsSignIn:o,disconnectedAt:n,holdUntil:Je(e.holdUntil),lastDecisive:r}}const gn=2e3,Ft=8e3;function Dr(e){return e&&(e.servers.some(n=>n.status==="connecting")||e.operations.some(n=>n.status==="running"))?gn:!1}const Ur=/^[A-Za-z0-9_.:-]{1,100}$/,zr=/:\/\//;function Pr(e,s){const n=e.trim();return n?Ur.test(n)?s.includes(n)?`An integration named ${n} already exists.`:null:"Use letters, numbers, dots, dashes, underscores or colons, with no spaces.":"Give it a name."}function Hr(e){const s=e.trim();if(!s)return"Enter the server's URL.";let n;try{n=new URL(s)}catch{return"Enter a full URL, like https://mcp.example.com/mcp."}return n.protocol!=="https:"&&n.protocol!=="http:"?"The URL must start with https:// or http://.":n.hostname?n.username||n.password?"Remove the username or password from the URL. Keys are added after it's saved.":n.search||n.hash?"Remove the ? or # part of the URL. Keys are added after it's saved.":zr.test(s.slice(n.protocol.length+2))?"This looks like two URLs pasted together. Enter just one.":null:"The URL needs a host name."}const Kr=e=>e.split(`
|
|
297
|
+
`).map(s=>s.trim()).filter(Boolean);function it(e,s){const n=!!e?.cold,a=(e?.servers??[]).map(o=>{const r=o.transport==="http",u=o.secret_refs??[],d=o.status==="connected"?"connected":o.status==="connecting"?"connecting":o.status==="auth-required"?"needs_sign_in":"not_started",c=[];d!=="connected"&&c.push("connect"),d==="connected"&&c.push("disconnect"),n||c.push("reload"),r&&o.transport_oauth_supported!==!1&&c.push("sign_in"),u.length>0&&c.push("set_key"),o.owned_scope&&c.push("remove"),o.setup?.text&&c.push("copy_setup");const m=rn(o.source);return{id:o.name,name:o.name,scope:o.owned_scope??"global",project_cwd:null,source:{kind:Br(o.source,m,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:d,status_reason:null,status_observed_at:null,last_seen_at:null,status_basis:n?"stored":"live",auth:{kind:u.length?"api_key":r?"unknown":"none",signed_in:null,secret_refs:u.map(g=>({id:g.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:n?"config":"live",session_id:s,servers:a,operations:(e?.operations??[]).map(o=>({...o}))}}const Br=(e,s,n)=>s==="Claude Code"?"claude-code":s==="Cursor"?"cursor":s==="VS Code"?"vscode":s==="Codex CLI"?"codex":n?"local-operator":e?"project-mcp-json":"local-operator",$t={invalid_config:"That configuration isn't valid. Check the command or the URL, then try again.",operation_unavailable:"That sign-in or test isn't running any more. Try again.",exists:"An integration with this name already exists. Choose another name.",not_owned:"It's defined in another tool's config, so it can't be changed here. Edit it in that file.",project_scope_unavailable:"There's no separate project config here, so it can only be added globally.",unknown_server:"It no longer exists. The list has been refreshed.",oauth_unsupported:"It doesn't use browser sign-in.",grant_running:"A sign-in or test is already running. Wait for it to finish, or cancel it.",too_many_operations:"Too many sign-ins and tests are waiting. Try again in a moment.",write_failed:"The config file couldn't be written. Check that it isn't read-only.",mcp_starting:"Integrations are still starting. Try again in a moment.",mcp_control_refused:"The server refused it, so nothing was changed."},Gr="The server refused it, so nothing was changed. Try again.";function Ue(e,s,n){if(s instanceof ut&&s.status===409){const a=typeof s.code=="string"&&Object.prototype.hasOwnProperty.call($t,s.code)?$t[s.code]:Gr;return`${On[e]}. ${a}`}return Fn(e,s,n).message}const Vr="New chats can use it right away. Open chats pick it up when you start a new chat or reload integrations there.",qr="Most services give you a URL. Use Local command when their setup says npx or uvx.",Yr=({existingNames:e,projectScopeAvailable:s,projectLabel:n,onSubmit:a,onCancel:o,initial:r})=>{const[u,d]=i.useState(r?.name??""),[c,m]=i.useState(r?.mode??"command"),[g,b]=i.useState(r?.command??""),[k,p]=i.useState(r?.args??""),[x,I]=i.useState(r?.url??""),[N,B]=i.useState("global"),[_,U]=i.useState(r?.touched?{name:!0,command:!0,url:!0}:{}),[O,M]=i.useState(!!r?.touched),[C,H]=i.useState(!1),[V,Y]=i.useState(null),z=i.useRef(null),P=i.useRef(null),A=i.useRef(null);i.useEffect(()=>{z.current?.focus()},[]);const D=Pr(u,e),q=c==="command"&&!g.trim()?"Enter the command to run.":null,K=c==="url"?Hr(x):null,L=S=>O||_[S],J=async S=>{if(S.preventDefault(),M(!0),D||q||K){D?z.current?.focus():q?P.current?.focus():A.current?.focus();return}H(!0),Y(null);const Q=s?N:"global",X=c==="command"?{name:u.trim(),scope:Q,mode:c,command:g.trim(),args:Kr(k)}:{name:u.trim(),scope:Q,mode:c,url:x.trim()},ee=await a(X);H(!1),Y(ee)},R=(S,Q,X)=>Q&&L(X)?t.jsx("p",{id:S,className:"text-body-sm text-danger",children:Q}):null,re=S=>S.preventDefault();return t.jsxs("form",{noValidate:!0,"aria-label":"Add integration",className:"flex flex-col gap-4 rounded-lg bg-surface p-4",onSubmit:S=>void J(S),onKeyDown:S=>{S.key==="Escape"&&(S.stopPropagation(),o())},children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(he,{htmlFor:"integration-add-name",children:"Name"}),t.jsx(Ce,{ref:z,id:"integration-add-name",value:u,placeholder:"e.g. notion",autoComplete:"off","aria-invalid":!!(D&&L("name")),"aria-describedby":D&&L("name")?"integration-add-name-error":void 0,onChange:S=>d(S.target.value),onBlur:()=>U(S=>({...S,name:!0}))}),R("integration-add-name-error",D,"name")]}),t.jsxs(Rt,{value:c,onValueChange:S=>m(S==="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:"How it runs"}),t.jsxs(Tt,{"aria-labelledby":"integration-add-transport-label",children:[t.jsx(De,{value:"command","data-integration-transport":"command",children:"Local command"}),t.jsx(De,{value:"url","data-integration-transport":"url",children:"Remote URL"})]}),t.jsx("p",{className:"text-ink-dim text-meta",children:qr}),t.jsxs(It,{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:"Command"}),t.jsx(Ce,{ref:P,id:"integration-add-command",value:g,placeholder:"e.g. npx",autoComplete:"off",className:"font-mono","aria-invalid":!!(q&&L("command")),"aria-describedby":q&&L("command")?"integration-add-command-error":void 0,onChange:S=>b(S.target.value),onBlur:()=>U(S=>({...S,command:!0}))}),R("integration-add-command-error",q,"command")]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs(he,{htmlFor:"integration-add-args",children:["Arguments"," ",t.jsx("span",{className:"font-normal text-ink-dim",children:"(one per line)"})]}),t.jsx(sn,{id:"integration-add-args",value:k,rows:2,className:"font-mono",onChange:S=>p(S.target.value)})]})]}),t.jsx(It,{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:"URL"}),t.jsx(Ce,{ref:A,id:"integration-add-url",type:"url",value:x,placeholder:"https://mcp.example.com/mcp",autoComplete:"off",className:"font-mono","aria-invalid":!!(K&&L("url")),"aria-describedby":K&&L("url")?"integration-add-url-error":"integration-add-url-help",onChange:S=>I(S.target.value),onBlur:()=>U(S=>({...S,url:!0}))}),R("integration-add-url-error",K,"url")??t.jsx("p",{id:"integration-add-url-help",className:"text-ink-dim text-meta",children:"If it needs a sign-in or a key, you'll be asked after it's added."})]})})]}),s?t.jsxs(Rt,{value:N,onValueChange:S=>B(S==="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:"Available in"}),t.jsxs(Tt,{"aria-labelledby":"integration-add-scope-label",children:[t.jsx(De,{value:"global","data-integration-scope":"global",children:"All chats"}),t.jsx(De,{value:"project","data-integration-scope":"project",children:"This project"})]}),n?t.jsx("p",{className:"text-ink-dim text-meta",children:N==="project"?`Only chats working in ${n}.`:"Every chat, in any folder."}):null]}):null,V?t.jsx("p",{className:"text-body-sm text-danger",role:"alert",children:V}):null,t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("p",{className:ce("text-body-sm text-ink-dim"),children:Vr}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(F,{type:"button",variant:"ghost",size:"md",onMouseDown:re,onClick:o,children:"Cancel"}),t.jsxs(F,{type:"submit",variant:"primary",size:"md",disabled:C,onMouseDown:re,children:[C?t.jsx(oe,{size:"xs"}):null,"Add integration"]})]})]})]})},Wr=4;function Zr(e){return e.rowMoving?e.now+e.windowMs:Math.max(e.hold.until,e.lastMovingAt+e.windowMs)}function Qr(e){return e.now>e.hold.until||e.hold.reanchors>=Wr?"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 Jr(e){const s=Zr({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 n=e.hold.landedOn??null,a=e.candidate;if(!a)return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:n},land:null};if(!n)return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:a},land:a};const o=Qr({hold:{until:s,reanchors:e.hold.reanchors,landedOn:n},candidate:a,active:e.active,body:e.body,now:e.now});if(o==="settled")return{hold:{until:s,reanchors:e.hold.reanchors,landedOn:n},land:null};if(o==="drop")return{hold:null,land:null};const r=!n.isConnected;return{hold:{until:r?e.now+e.windowMs:s,reanchors:r?e.hold.reanchors+1:e.hold.reanchors,landedOn:a},land:a}}function Xr(e){const{row:s,target:n}=e;return!s||!n||typeof n.nodeType!="number"?!1:!s.contains(n)}const Dt=250;function Ut(e){return e?!e.disabled:!1}function ei(e){return Ut(e.primary)?e.primary??null:Ut(e.overflow)?e.overflow??null:null}function ti(e){return e.verdict==="finished"?null:e.watchMs}const yn="key";function ni(e){const{name:s,keyless:n,freeName:a,names:o,values:r,replace:u,canReplace:d}=e;if(n){const c=ct(s,a);return{values:{[c]:(r[yn]??"").trim()},confirmedReplace:u&&d?[c]:[],header:a.trim()}}return{values:Object.fromEntries(o.map(c=>[c,(r[c]??"").trim()])),confirmedReplace:u&&d?o:[],header:void 0}}function ct(e,s){const n=zt(e),a=zt(s);if(!a)return"";const o=[n,a].filter(Boolean).join("_"),r=/^[A-Za-z_]/.test(o)?o:`K_${o}`;if(r.length<=Xe)return r;const u=si(n),d=Xe-a.length-u.length-2,c=[n.slice(0,Math.max(d,0)),u,a].filter(Boolean).join("_");return c.length<=Xe?c:c.slice(-128)}const Xe=128,zt=e=>e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,""),si=e=>{let s=2166136261;for(let n=0;n<e.length;n+=1)s^=e.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s.toString(36).toUpperCase().slice(0,5)},ai=({name:e,keyNames:s,keyless:n=!1,savedKeys:a=[],saving:o,failure:r,onSave:u,onClose:d})=>{const[c,m]=i.useState({}),[g,b]=i.useState(!1),[k,p]=i.useState(""),x=n?[ct(e,k)]:[...s],I=n?[yn]:x,N=(n?ct(e,k).length>0:!0)&&I.every(_=>(c[_]??"").trim()),B=x.some(_=>a.includes(_));return t.jsx(Zt,{open:!0,onClose:d,maxWidth:"xs",title:n||s.length===1?`Add the key for ${e}`:`Add keys for ${e}`,actions:t.jsxs(t.Fragment,{children:[t.jsx(tt,{onClick:d,children:"Cancel"}),t.jsx(nt,{disabled:!N||o,onClick:()=>{const _=ni({name:e,keyless:n,freeName:k,names:x,values:c,replace:g,canReplace:B});u(_.values,_.confirmedReplace,_.header)},children:o?"Saving…":"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:n?"Keys are saved encrypted on this computer. This one is stored under a name derived from this integration, so no other server shares it.":"Keys are saved encrypted on this computer. Other integrations that use the same key name share it."}),n?t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(he,{htmlFor:"integration-key-name",children:"The header this server wants the key in"}),t.jsx(Ce,{id:"integration-key-name",autoComplete:"off",placeholder:"e.g. Authorization or X-Api-Key",value:k,onChange:_=>p(_.target.value)}),t.jsx("p",{className:"-mx-1.5 text-ink-dim text-meta",children:"This server declares no key of its own, so Local Operator adds one to its config for you."})]}):null,I.filter(_=>n!==!0||_.trim().length>0).map(_=>t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(he,{htmlFor:`integration-key-${_}`,className:"font-mono",children:n?"Key":_}),t.jsx(Ce,{id:`integration-key-${_}`,type:"password",autoComplete:"off",value:c[_]??"",onChange:U=>m(O=>({...O,[_]:U.target.value}))})]},_)),B?t.jsxs("div",{className:"flex items-center gap-2 text-body-sm",children:[t.jsx(Ns,{id:"integration-key-replace",checked:g,onCheckedChange:_=>b(_===!0)}),t.jsx(he,{htmlFor:"integration-key-replace",className:"font-normal",children:dn(x.length)})]}):null,r?t.jsx("p",{className:"-mx-1.5 text-body-sm text-danger",role:"alert",children:r}):null]})})},oi={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",neutral:"bg-ink-dim"},ri={success:"text-ink-muted",warning:"text-warning",danger:"text-danger",info:"text-ink-muted",neutral:"text-ink-dim"},Pt={Ready:_r,"Not connected":Nr},ii=({row:e,operations:s,memories:n,now:a,projectScopeAvailable:o,highlighted:r=!1,rowRef:u,primaryRef:d,overflowRef:c,pending:m,failure:g,confirm:b,onPrimary:k,onOverflow:p,onConfirm:x,onCancelConfirm:I})=>{const N=br(e,s,n,a),B=r&&N.tone==="danger"?"text-ink":ri[N.tone],_=ft(e,s,n),U=Mr(e,s,n),O=Sr(e,o),M=U.findIndex(C=>C.kind==="remove"||C.kind==="remove_elsewhere");return t.jsxs("li",{ref:u,"data-integration":e.name,"data-status":e.status,className:ce("flex min-h-14 flex-col justify-center gap-1 px-4 py-2.5",r&&"bg-row-selected"),onKeyDown:C=>{!b||C.key!=="Escape"||(C.stopPropagation(),I())},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:N.busy?t.jsx(oe,{size:"xs"}):t.jsx("span",{"aria-hidden":"true","data-tone":N.tone,className:ce("size-2 rounded-full",oi[N.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:O.map((C,H)=>t.jsxs("span",{children:[H>0?" · ":null,C.startsWith("Imported from")&&e.source.path?t.jsx(Re,{content:ks(e.source.path),children:t.jsx("span",{className:"underline decoration-dotted underline-offset-2",children:C})}):C]},C))})]}),Pt[N.label]?t.jsx(Re,{content:Pt[N.label],children:t.jsx("span",{className:ce("shrink-0 text-body-sm",B),children:N.label})}):t.jsx("span",{className:ce("shrink-0 text-body-sm",B),children:N.label}),_?t.jsxs(F,{ref:d,variant:_.variant??"secondary",size:"sm","aria-label":`${_.label} ${e.name}`,disabled:m,"data-integration-action":_.kind,onClick:()=>k(_),children:[m?t.jsx(oe,{size:"xs"}):null,_.label]}):null,t.jsxs(Cs,{children:[t.jsx(Ss,{asChild:!0,children:t.jsx(F,{ref:c,variant:"ghost",size:"icon-sm","aria-label":`More actions for ${e.name}`,disabled:m,children:t.jsx($n,{"aria-hidden":"true"})})}),t.jsx(Ms,{align:"end",className:"min-w-48",children:U.map((C,H)=>t.jsx(ci,{item:C,separated:H===M&&H>0,onSelect:()=>p(C)},C.kind))})]})]}),N.detail?t.jsx("p",{className:ce("pl-7 text-body-sm",N.tone==="danger"?"text-ink-muted":"text-ink-dim"),children:N.detail}):null,g?t.jsx("p",{className:ce("pl-7 text-body-sm",r?"text-ink":"text-danger"),role:"alert",children:g}):null,b?t.jsxs("div",{className:"flex flex-wrap items-center gap-2 pl-7",children:[t.jsx("span",{className:"text-body-sm text-ink",children:b.kind==="remove"?`Remove ${e.name}?`:`Sign out of ${e.name}?`}),t.jsx("span",{className:"text-body-sm text-ink-muted",children:b.kind==="remove"?`Agents in every chat lose access to ${e.name}.`:e.auth.kind==="oauth"?"The saved sign-in is removed too.":"Its saved credential is removed too."}),t.jsx(F,{variant:"danger",size:"sm",onClick:x,"data-integration-confirm":b.kind,children:b.kind==="remove"?"Remove":"Sign out"}),t.jsx(F,{variant:"ghost",size:"sm",onClick:I,children:"Keep"})]}):null]})},ci=({item:e,separated:s,onSelect:n})=>t.jsxs(t.Fragment,{children:[s?t.jsx(As,{}):null,e.kind==="remove_elsewhere"?t.jsxs(Lt,{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(Lt,{destructive:e.kind==="remove",onSelect:n,"data-integration-menu":e.kind,children:e.label})]});function li(e,s,n){return!s||s.status==="running"?s?.browser_opened===!0?{message:`Your browser opened. Approve access to ${e} there, then come back here.`,tone:"progress",link:s.authorization_url??null}:s?.browser_opened===!1?{message:s.authorization_url?"Your browser didn't open. Open this link to approve access:":"Your browser didn't open, and no link was provided. Cancel and try again.",tone:"progress",link:s.authorization_url??null}:{message:`Waiting for you to approve access to ${e}…`,tone:"progress",link:s?.authorization_url??null}:s.status==="complete"?{message:`Signed in to ${e}. Agents can use it now.`,tone:"success",link:null}:s.status==="cancelled"?{message:"Sign-in cancelled.",tone:"failure",link:null,reason:null,nextStep:"Press Try again when you are ready."}:{message:"Sign-in didn't finish.",tone:"failure",link:null,reason:jr(s.message,n)??"The server didn't say why.",nextStep:di(s.message??null,n)}}function di(e,s){const n=(e??"").toLowerCase();return n.includes("redirect")?s?"This server may not accept sign-ins from Local Operator. Check the server's settings, or add a key instead.":"This server may not accept sign-ins from Local Operator. Check the server's settings, then try again.":n.includes("no oauth")||n.includes("authorization server")?s?"This server doesn't publish a browser sign-in. Add its key instead.":"This server doesn't publish a browser sign-in. Check the server's settings, then try again.":n.includes("network")||n.includes("connect")?"Check the server's URL and your network, then try again.":"Check the server's settings, then try again."}function ui(e,s){return e.kind==="ready"?"ready":e.kind==="running"&&s&&s.tone!=="progress"?s.tone==="success"?"success":"failure":"running"}const mi=({name:e,action:s,keyRoute:n,phase:a,onStart:o,onCancel:r,onOpenLink:u,onClose:d})=>{const c=a.kind==="running"?a.operation:null,m=a.kind==="running"?li(e,c,n):null,g=a.kind==="starting"||a.kind==="running"&&m?.tone==="progress",b=m&&m.tone!=="progress",k=i.useRef(null),p=i.useRef(!1),x=ui(a,m);i.useEffect(()=>{if(!p.current){p.current=!0;return}x&&k.current?.focus()},[x]);const I=()=>d(m?.tone==="success"?"signed-in":"dismissed");return t.jsx(Zt,{open:!0,onClose:I,maxWidth:"xs",fullWidth:!0,title:`Sign in to ${e}`,dialogProps:{onOpenAutoFocus:N=>{N.preventDefault(),k.current?.focus()}},actions:t.jsxs(t.Fragment,{children:[g&&c?t.jsx(tt,{ref:k,onClick:()=>r(c.id),children:"Cancel sign-in"}):t.jsx(tt,{ref:a.kind==="ready"?void 0:k,onClick:I,children:m?.tone==="success"?"Done":"Close"}),a.kind==="ready"?t.jsx(nt,{ref:k,onClick:o,children:"Continue in browser"}):null,a.kind==="refused"||m?.tone==="failure"?t.jsx(nt,{ref:m?.tone==="failure"?k:void 0,onClick:o,children:"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.jsxs("p",{className:"-mx-1.5",children:["Local Operator opens your browser so you can approve access to"," ",e,".",s==="reauth"?" This replaces the sign-in it has now.":""]}):null,a.kind==="starting"?t.jsxs("p",{className:"-mx-1.5 flex items-center gap-2",children:[t.jsx(oe,{size:"xs"}),"Starting sign-in…"]}):null,m?t.jsxs("div",{className:"flex flex-col gap-1",role:b?"status":void 0,children:[t.jsxs("p",{className:(m.tone==="success","-mx-1.5 flex items-start gap-2 text-ink"),children:[m.tone==="progress"?t.jsx(oe,{size:"xs",className:"mt-0.5"}):null,m.tone==="failure"?t.jsx(Rs,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0 text-danger"}):null,t.jsx("span",{children:m.message})]}),m.reason?t.jsx("p",{className:"-mx-1.5 text-ink-muted",children:m.reason}):null,m.nextStep?t.jsx("p",{className:"-mx-1.5 text-ink-muted",children:m.nextStep}):null]}):null,m?.link&&m.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:m.link,children:m.link}),t.jsx(F,{variant:"ghost",size:"icon-sm","aria-label":"Copy the sign-in link",title:"Copy the sign-in link",onClick:()=>{navigator.clipboard.writeText(m.link??"").then(()=>st("Sign-in link copied.")).catch(()=>{})},children:t.jsx(Dn,{"aria-hidden":"true"})})]}),t.jsx(F,{variant:"link",size:"sm",onClick:()=>u(m.link??""),children:"Open the sign-in page"})]}):null,a.kind==="refused"?t.jsx("p",{className:"text-danger",role:"alert",children:a.message}):null]})})},hi={catalog:(e,s)=>["desktop","mcp-catalog",e??"",s??""],all:["desktop","mcp-catalog"]},pi=async(e,s)=>(await ve({op:"mcp.catalog",...e?{cwd:e}:{},...s?{sessionId:s}:{}})).data,fi=async(e,s)=>(await ve({op:"mcp.catalog.control",...e?{cwd:e}:{},control:s})).data,gi=async(e,s,n,a,o)=>(await ve({op:"mcp.catalog.credentials",...e?{cwd:e}:{},name:s,values:n,confirmedReplace:a,...o?{header:o}:{}})).data,yi=e=>e.reduce((s,n)=>s?(n.updated_at??0)>(s.updated_at??0)?n:s:n,null),xi=/^[A-Za-z]:[\\/]/,Ke=e=>{const s=e?.trim();return s&&(s.startsWith("/")||xi.test(s))?s:null};function ki(e){const o=e?.payload?.frontend?.snapshot?.cwd;return typeof o=="string"&&o.trim()?o:null}const Te="local-operator.settings.integrations.last-cwd";function vi(e,s,n=typeof localStorage>"u"?null:localStorage){const a=Ke(s);if(!(!e||!a||!n))try{const o=n.getItem(Te),r=o?JSON.parse(o):{};if(r[e]===a)return;n.setItem(Te,JSON.stringify({...r,[e]:a}))}catch{}}const xn=()=>typeof localStorage>"u"?null:localStorage;function kn(e=xn()){if(!e)return{};try{const s=e.getItem(rt);if(!s)return{};const n=JSON.parse(s);return!n||typeof n!="object"||Array.isArray(n)?{}:n}catch{return{}}}const Ht=256;function bi(e,s=xn()){if(s)try{const n={...kn(s),...e},a=Object.keys(n);if(a.length>Ht){const o={};for(const r of a.slice(-Ht))o[r]=n[r];s.setItem(rt,JSON.stringify(o));return}s.setItem(rt,JSON.stringify(n))}catch{}}function Kt(e,s,n){return e==="saved"?null:e==="replace_confirmation_required"?`A saved value already exists for this key. Tick “${dn(Object.keys(n).length)}” to overwrite it.`:e==="invalid_target"?"That header can't carry this key. It may already be set on the server, or belong to the transport - try a different header name. Nothing was saved.":`Not saved: ${(s.length?s:Object.keys(n)).join(", ")}. The encrypted store may be locked.`}function wi(e,s=typeof localStorage>"u"?null:localStorage){if(!(!e||!s))try{const n=s.getItem(Te);if(!n)return;const a=JSON.parse(n);if(!(e in a))return;const o={...a};delete o[e],s.setItem(Te,JSON.stringify(o))}catch{}}const ji=e=>!!(e&&typeof e=="object"&&"code"in e&&e.code==="invalid_cwd"),_i=(e,s)=>s!==null&&e===s?null:e;function Ni(e,s=typeof localStorage>"u"?null:localStorage){if(!e||!s)return null;try{const n=s.getItem(Te);if(!n)return null;const o=JSON.parse(n)[e];return typeof o=="string"?o:null}catch{return null}}const Ci=e=>e.action==="disconnect"?"disconnected":"connected";function Si(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 Mi(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 Ai({sessionId:e}){const s=vs(),n=At(s.data,"mcp_catalog"),a=At(s.data,"mcp"),o=n?"catalog":a?"session":null,[r,u]=i.useState(null),d=nn(),c=ze(h=>h.sessions),m=ze(h=>h.fetchSessions),g=ze(h=>h.loading),b=i.useMemo(()=>c.find(h=>h.session_id===e)??null,[c,e]),k=i.useMemo(()=>o==="session"&&!e?yi(c):null,[o,e,c]),p=o==="session"?e??k?.session_id??null:null;i.useEffect(()=>{o!=="session"||e||c.length>0||m(bs)},[o,e,c.length,m]);const x=o==="catalog"?Ke(b?.cwd):null,I=o==="catalog"&&!!e&&x===null,N=Ne({queryKey:["desktop","session-cwd",e??""],queryFn:()=>ve({op:"sessions.get",sessionId:e??""}),enabled:I,staleTime:Number.POSITIVE_INFINITY,retry:!1}),B=I&&!N.isFetched,_=x??Ke(ki(N.data))??(N.isFetched?Ke(Ni(e)):null),U=_i(_,r),O=o==="catalog"?U:null,M=o==="catalog"?e??null:null,C=hi.catalog(O,M);i.useEffect(()=>{o!=="catalog"||!e||!O||vi(e,O)},[o,e,O]);const H=i.useRef(0),[V,Y]=i.useState(0),z=i.useRef(null),P=i.useCallback((h,w)=>{const v=Date.now()+Ft;H.current=v,z.current={name:h,expect:w},Y(v)},[]),A=i.useCallback(h=>Date.now()<H.current?gn:Dr(h),[]),D=Ne({queryKey:C,queryFn:()=>pi(O,M),enabled:o==="catalog"&&!B,staleTime:1e4,refetchInterval:h=>A(h.state.data)}),q=ji(D.error);i.useEffect(()=>{!q||!_||r===_||(u(_),wi(e))},[q,_,r,e]);const K=Ne({queryKey:at.list(p??""),queryFn:()=>Un(p??""),enabled:o==="session"&&!!p,staleTime:1e4,refetchInterval:h=>A(h.state.data?it(h.state.data,p??""):void 0)}),L=i.useMemo(()=>{if(o==="catalog")return D.data;if(o==="session"&&K.data&&p)return it(K.data,p)},[o,D.data,K.data,p]),J=i.useCallback(()=>Ri({queryClient:d,route:o,catalogKey:C,sessionId:p}),[o,C,d,p]);i.useEffect(()=>{if(!V)return;const h=z.current;if(!h)return;const w=L?.servers.find($=>$.name===h.name);!w||!(h.expect==="connected"?w.status==="connected":w.status_basis==="live"&&w.status!=="connected")||(H.current=0,z.current=null,Y(0))},[L,V]);const R=i.useRef({}),[re,S]=i.useState(0),Q=i.useMemo(()=>(R.current=Tr(Er(R.current,L,kn()),L),R.current),[L,re]),X=i.useRef("");i.useEffect(()=>{const h=Lr(Q,L);if(!Object.keys(h).length)return;const w=JSON.stringify(h);w!==X.current&&(X.current=w,bi(h))},[Q,L]);const ee=i.useCallback(h=>{const w=be(R.current,h);w.needsKey||(R.current={...R.current,[h]:{...w,needsKey:!0}},S(v=>v+1))},[]),W=i.useCallback(h=>{if(h.action!=="disconnect"&&h.action!=="connect"&&h.action!=="reload")return;const w=be(R.current,h.name),v=Date.now()+Ft,$=h.action==="disconnect"?{...w,connectedAt:null,disconnectedAt:Date.now(),holdUntil:v}:{...w,disconnectedAt:null,holdUntil:v};R.current={...R.current,[h.name]:$},P(h.name,Ci(h)),S(E=>E+1)},[P]),Z=i.useCallback(async h=>{if(o==="catalog"){const w=Si(h);if(!w)return null;try{const v=await fi(O,w);return d.setQueryData(C,v),W(h),v.operation?.id??null}catch(v){throw v instanceof ut&&v.status===409&&d.invalidateQueries({queryKey:C}),v}}if(o==="session"&&p){const w=await ve({op:"mcp.control",sessionId:p,control:Mi(h)});W(h);const v=at.list(p),$=w?.data;return $&&"servers"in $&&Array.isArray($.servers)?(d.setQueryData(v,$),null):(d.invalidateQueries({queryKey:v}),$&&"id"in $&&typeof $.id=="string"?$.id:null)}return null},[o,O,C,d,p,W]),pe=i.useCallback(async h=>{if(o==="catalog"&&M&&(h.action==="connect"||h.action==="disconnect"||h.action==="reload")){try{await ve({op:"mcp.control",sessionId:M,control:{action:h.action,name:h.name,...h.action==="disconnect"?{confirmed:!0}:{}}})}catch(w){throw d.invalidateQueries({queryKey:C}),w}return W(h),await d.invalidateQueries({queryKey:C}),null}return Z(h)},[o,M,d,C,Z,W]),we=i.useCallback(async(h,w,v,$)=>{if(o==="catalog"){const E=await gi(O,h,w,v,$);if(E.catalog&&d.setQueryData(C,E.catalog),E.code!=="saved")return{saved:!1,message:Kt(E.code,E.failed_ids,w)};try{await Z({action:"test",name:h})}catch{}return{saved:!0,message:null}}if(o==="session"&&p){const E=await ve({op:"mcp.credentials.store",sessionId:p,name:h,values:w,confirmedReplace:v});if(E.data?.code!=="saved")return{saved:!1,message:Kt(E.data?.code,E.data?.failed_ids??[],w)};try{await Z({action:"connect",name:h})}catch{}return{saved:!0,message:null}}return{saved:!1,message:null}},[o,O,C,d,Z,p]),de=o==="catalog"?D:K,fe=i.useCallback(()=>{de.refetch()},[de]);return{enabled:o!==null,route:o,sessionId:o==="catalog"?M:p,borrowed:k,noConversation:o==="session"&&!p&&!g,document:L,isLoading:s.isLoading||o==="catalog"&&(B||D.isLoading)||o==="session"&&(p?K.isLoading:g),isError:de.isError,folderUnavailable:Ir(r,_),refetch:fe,readDocument:J,control:pe,storeKeys:we,memories:Q,markNeedsKey:ee}}function Ri(e){if(e.route==="catalog")return e.queryClient.getQueryData(e.catalogKey);if(e.route==="session"&&e.sessionId){const s=e.queryClient.getQueryData(at.list(e.sessionId));return s?it(s,e.sessionId):void 0}}const Ti=(e,s)=>{const n=e?.trim();if(!n)return null;const a=Kn(n,s);return a.kind==="auth"?{kind:"matched",name:a.name,unresolved:null}:{kind:"miss",asked:n}},Ii=6,et="Integrations",Li="Let agents use your tools and accounts, like Notion, Linear or GitHub.",Ei={test:"test",connect:"reconnect",disconnect:"disconnect",reload:"reload",remove:"remove",sign_out:"disconnect",cancel:"cancel",login:"grant",reauth:"grant"},Oi=({sessionId:e,sectionRef:s,highlightServer:n})=>{const a=Ai({sessionId:e}),{document:o,control:r,readDocument:u}=a,d=zn(),c=o?.servers??[],m=o?.operations??[],g=o?.project_scope_available??!1,[b,k]=i.useState(!1),[p,x]=i.useState(""),[I,N]=i.useState(null),[B,_]=i.useState({}),[U,O]=i.useState(null),[M,C]=i.useState(null),[H,V]=i.useState({kind:"ready"}),[Y,z]=i.useState(null),[P,A]=i.useState(null),[D,q]=i.useState(!1),K=i.useRef({}),L=i.useRef({}),J=i.useRef({}),R=i.useRef(0),re=i.useRef(null),S=i.useRef(null),Q=i.useRef(null),[X,ee]=i.useState(null),[W,Z]=i.useState(null),[pe,we]=i.useState(null),de=i.useCallback(()=>{const l=Q.current;Q.current=null,C(null),z(null),window.setTimeout(()=>{l?.isConnected&&l.focus()},0)},[]),fe=i.useCallback(l=>{const f=window.document.activeElement;Q.current=f instanceof HTMLElement?f:null,C(l)},[]),h=i.useCallback((l,f)=>{Z({name:l,waitForSignIn:f==="signed-in",until:Date.now()+Me,reanchors:0}),de()},[de]),w=i.useMemo(()=>Ti(n,c.map(l=>l.name)),[n,c]),v=w?.kind==="matched"?w.name:null,$=i.useRef(null),E=i.useRef(null),te=p.trim().toLowerCase(),G=i.useMemo(()=>te?c.filter(l=>l.name.toLowerCase().includes(te)):c,[c,te]),je=i.useMemo(()=>Rr(G,m,a.memories),[G,m,a.memories]),ue=M?.kind==="sign_in"?c.find(l=>l.name===M.name)??null:null;i.useEffect(()=>{!v||E.current===v||!p||x("")},[v,p]),i.useEffect(()=>{!v||E.current===v||G.some(l=>l.name===v)&&(E.current=v,$.current?.scrollIntoView({block:"center",behavior:"smooth"}))},[v,G]),i.useEffect(()=>{if(!Y)return;const l=m.find(f=>f.id===Y)??null;V({kind:"running",operation:l})},[m,Y]);const ie=m.some(l=>l.status==="running"),ge=l=>{const f=window.document.activeElement;f&&f!==window.document.body&&f.isConnected||Z({name:l,waitForSignIn:!1,until:Date.now()+Me,reanchors:0})},ne=async(l,f,j)=>{N(l),_(({[l]:ye,...xe})=>xe);let T=null,me=!1;try{T=await j()}catch(ye){me=!0,_(xe=>({...xe,[l]:Ue(Ei[f]??"status",ye,ie)}))}finally{N(null),f!=="sign_out"&&(f!=="remove"||me)&&ge(l)}return{operationId:T,failed:me}},qe=l=>c.find(f=>f.name===l),Ee=l=>{l.source.path&&Bn(l.source.path)},Ye=async(l,f)=>{V({kind:"starting"}),z(null);try{const j=await r({action:f,name:l});j?z(j):V({kind:"running",operation:null})}catch(j){j instanceof ut&&j.code==="oauth_unsupported"&&a.markNeedsKey(l),V({kind:"refused",message:Ue("grant",j,ie)})}},Oe=(l,f)=>{switch(f.kind){case"sign_in":case"reauth":{const j=m.find(T=>T.name===l.name&&T.status==="running");j&&Le(j)?(V({kind:"running",operation:j}),z(j.id)):(V({kind:"ready"}),z(null)),fe({kind:"sign_in",name:l.name,action:f.kind==="reauth"?"reauth":"login"});return}case"set_key":A(null),fe({kind:"key",name:l.name,keyNames:l.auth.secret_refs.map(j=>j.id)});return;case"fix":Ee(l);return;case"sign_out":O({name:l.name,kind:"sign_out"});return;default:{const j=f.kind;ne(l.name,j,()=>r({action:j,name:l.name}))}}},xt=(l,f)=>{switch(f.kind){case"remove":case"sign_out":O({name:l.name,kind:f.kind});return;case"sign_in":case"reauth":case"set_key":Oe(l,{kind:f.kind,label:f.label});return;case"open_config":Ee(l);return;case"copy_setup":navigator.clipboard.writeText(l.setup_prompt??"").then(()=>st("Setup steps copied. Paste them into a chat.")).catch(()=>{});return;case"cancel":{const j=m.find(T=>T.name===l.name&&T.status==="running");j&&ne(l.name,"cancel",()=>r({action:"cancel",operationId:j.id}));return}case"test":case"connect":case"disconnect":case"reload":{const j=f.kind;ne(l.name,j,()=>r({action:j,name:l.name}));return}default:return}},Fe=(l,f)=>{if(O(null),f==="remove"){const j=l.source.owned_scope;if(!j)return;const T=G.findIndex(me=>me.name===l.name);ne(l.name,"remove",()=>r({action:"remove",name:l.name,scope:j})).then(({operationId:me,failed:ye})=>{ye||me!==null||(st(`Removed ${l.name}.`),T>=0&&we({index:T}))});return}ne(l.name,"sign_out",()=>r({action:"logout",name:l.name})).then(()=>{Z({name:l.name,waitForSignIn:!1,until:Date.now()+Me,reanchors:0})})},$e=async l=>{try{return await r({action:"add",name:l.name,scope:l.scope,...l.mode==="command"?{command:l.command,args:l.args}:{url:l.url}}),k(!1),ee(l.name),null}catch(f){return Ue("add",f,!1)}},kt=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:et}),t.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:Li})]}),a.enabled&&c.length>0&&!b?t.jsxs(F,{ref:re,variant:"secondary",size:"sm",onClick:()=>k(!0),"data-tour-tag":"mcp-add-server",children:[t.jsx(Ct,{"aria-hidden":"true"}),"Add integration"]}):null]});if(!a.enabled&&!a.isLoading)return t.jsx(se,{title:et,titleComponent:kt,sectionRef:s,children:t.jsx(le,{variant:"warning",children:"Integrations need a newer Local Operator backend. Update it and restart the app to manage them here."})});const vt=t.jsx(Yr,{existingNames:c.map(l=>l.name),projectScopeAvailable:g,projectLabel:o?.cwd?$i(o.cwd):null,onSubmit:$e,onCancel:()=>{k(!1),window.setTimeout(()=>re.current?.focus(),0)}}),bt=M?qe(M.name):void 0,vn=Object.entries(B).filter(([l])=>!c.some(f=>f.name===l)),bn=l=>_(({[l]:f,...j})=>j);i.useEffect(()=>{if(!X)return;const l=K.current[X];if(!l){c.some(f=>f.name===X)&&(L.current[X]?.focus(),ee(null));return}l.focus(),ee(null)},[X,c]),i.useEffect(()=>{if(!pe)return;const f=G[Math.min(pe.index,G.length-1)]??G.at(-1);if(f){const j=K.current[f.name]??L.current[f.name];if(!j)return;j.focus()}else re.current?.focus();we(null)},[pe,G]);const We=i.useCallback((l,f)=>{const j=u()??o,T=j?.servers.find(wn=>wn.name===l.name),me=j?.operations??[],ye=T?T.status==="connecting"||Se(T.name,me)!==null:!1;ye&&T&&(R.current=f);const xe=T?ft(T,me,a.memories):null;if(T&&l.waitForSignIn&&(xe?.kind==="sign_in"||xe?.kind==="reauth"))return"kept";const _e=Jr({hold:l,now:f,windowMs:Me,rowMoving:ye,lastMovingAt:R.current,candidate:T?ei({primary:xe?K.current[T.name]:null,overflow:L.current[T.name]}):void 0,active:window.document.activeElement,body:window.document.body});if(!_e.hold)return Z(null),"finished";if(!_e.land)return"kept";Z({name:l.name,waitForSignIn:!1,until:_e.hold.until,landedOn:_e.land,reanchors:_e.hold.reanchors});const wt=_e.land;return window.setTimeout(()=>{wt.isConnected&&wt.focus()},0),"landed"},[u,o,a.memories]);return i.useEffect(()=>{if(!W)return;We(W,Date.now());let l=0,f=!1;const j=()=>{if(f)return;const T=ti({verdict:We(W,Date.now()),watchMs:Dt});T!==null&&(l=window.setTimeout(j,T))};return l=window.setTimeout(j,Dt),()=>{f=!0,window.clearTimeout(l)}},[W,We]),i.useEffect(()=>{if(!W)return;const l=f=>{Xr({target:f.target,row:J.current[W.name]})&&Z(null)};return window.document.addEventListener("pointerdown",l,!0),()=>{window.document.removeEventListener("pointerdown",l,!0)}},[W]),t.jsxs(se,{title:et,titleComponent:kt,sectionRef:s,children:[t.jsxs("div",{className:"flex flex-col gap-4",children:[a.route==="session"&&a.borrowed?t.jsxs("p",{className:"text-body-sm text-ink-muted",children:["Showing the integrations for"," ",a.borrowed.title?.trim()||a.borrowed.session_id.slice(0,6),", your most recent chat."]}):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:"Integrations can be managed here once a chat has started."}),t.jsx(F,{variant:"primary",size:"sm",onClick:()=>d("/chat"),children:"Start a chat"}),t.jsx("p",{className:"text-ink-dim text-meta",children:"Updating Local Operator removes this step."})]}):null,a.isLoading?t.jsx("div",{className:"flex h-24 items-center justify-center",children:t.jsx(oe,{size:"lg",label:"Loading integrations"})}):null,a.folderUnavailable?t.jsx(le,{variant:"warning",children:t.jsx("span",{children:"This chat's folder no longer exists, so only global integrations are shown."})}):null,a.isError?t.jsx(le,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:"Integrations couldn't be loaded."}),t.jsx(F,{variant:"secondary",size:"sm",onClick:a.refetch,children:"Retry"})]})}):null,vn.map(([l,f])=>t.jsx(le,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:f}),t.jsx(F,{variant:"ghost",size:"sm",onClick:()=>bn(l),children:"Dismiss"})]})},l)),b&&c.length>0?vt:null,c.length>=Ii?t.jsxs("div",{className:"relative",children:[t.jsx(Pn,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-ink-dim"}),t.jsx(Ce,{ref:S,value:p,onChange:l=>x(l.target.value),onKeyDown:l=>{l.key!=="Escape"||!p||(l.preventDefault(),x(""))},placeholder:`Search ${ur(c.length)}`,"aria-label":"Search integrations",className:"pl-9"})]}):null,w?.kind==="miss"&&c.length>0?t.jsx("p",{className:"text-body-sm text-ink-muted",children:`No integration matches "${w.asked}".`}):null,w?.kind==="matched"&&w.unresolved?t.jsx("p",{className:"text-body-sm text-ink-muted",children:`Showing "${w.name}" — "${w.unresolved}" is not one of your integrations.`}):null,o&&c.length===0&&!a.isLoading?b?vt:t.jsxs("div",{className:"flex flex-col items-start gap-3 rounded-lg bg-surface p-6",children:[t.jsx(Qt,{"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:"No integrations yet"}),t.jsx("p",{className:"max-w-xl text-body-sm text-ink-muted",children:"Integrations let agents read and act in your other tools, like Notion or Linear. Add one with a command that runs on this computer, or a server's URL."})]}),t.jsxs(F,{variant:"primary",size:"md",onClick:()=>k(!0),"data-tour-tag":"mcp-add-server",children:[t.jsx(Ct,{"aria-hidden":"true"}),"Add integration"]})]}):null,c.length>0&&G.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:"No integrations match this search."}),t.jsx(F,{variant:"secondary",size:"sm",onClick:()=>{x(""),window.setTimeout(()=>{(S.current??re.current)?.focus()},0)},children:"Clear search"})]}):null,je.map(l=>t.jsxs("section",{"aria-labelledby":`integrations-group-${l.id}`,className:"flex flex-col gap-1.5",children:[t.jsxs("h3",{id:`integrations-group-${l.id}`,className:"px-1 text-ink-dim text-meta",children:[l.title," · ",l.rows.length]}),t.jsx("ul",{className:"flex flex-col divide-y divide-hairline overflow-hidden rounded-lg bg-surface",children:l.rows.map(f=>t.jsx(ii,{row:f,operations:m,memories:a.memories,projectScopeAvailable:g,highlighted:f.name===v,rowRef:j=>{J.current[f.name]=j,f.name===v&&($.current=j)},primaryRef:j=>{K.current[f.name]=j},overflowRef:j=>{L.current[f.name]=j},pending:I===f.name,failure:B[f.name]??null,confirm:U?.name===f.name?{kind:U.kind}:null,onPrimary:j=>Oe(f,j),onOverflow:j=>xt(f,j),onConfirm:()=>U&&Fe(f,U.kind),onCancelConfirm:()=>{O(null),window.setTimeout(()=>{L.current[f.name]?.focus()},0)}},f.id))})]},l.id))]}),M?.kind==="sign_in"?t.jsx(mi,{name:M.name,action:M.action,keyRoute:ue?Ge(ue):!1,phase:H,onStart:()=>void Ye(M.name,M.action),onCancel:l=>void r({action:"cancel",operationId:l}).catch(()=>{}),onOpenLink:l=>void Hn(l),onClose:l=>h(M.name,l)}):null,M?.kind==="key"?t.jsx(ai,{name:M.name,keyNames:M.keyNames.length?M.keyNames:bt?.auth.secret_refs.map(l=>l.id)??[],keyless:M.keyNames.length===0,savedKeys:bt?.auth.secret_refs.filter(l=>l.state==="encrypted").map(l=>l.id),saving:D,failure:P,onClose:de,onSave:(l,f,j)=>{q(!0),A(null),a.storeKeys(M.name,l,f,j).then(T=>{if(!T.saved){A(T.message);return}C(null),Z({name:M.name,waitForSignIn:!1,until:Date.now()+Me,reanchors:0})}).catch(T=>A(Ue("key",T,!1))).finally(()=>q(!1))}}):null]})},Me=4e3,Fi=/^\/(?:Users|home)\/[^/]+(?=\/|$)/,$i=e=>e.replace(Fi,"~"),Di=e=>typeof e!="number"||!Number.isFinite(e)?"your free credits":`$${e.toFixed(2)} in free credits`,Ui="https://console.radienthq.com/dashboard/verification",zi=(e,s)=>e==="pending"?{sentence:`Verify your email to claim ${s}. Check your inbox for the link Radient sent.`,action:"Open verification page"}:e==="expired"?{sentence:`The link to claim ${s} has expired. Request a new one from the verification page.`,action:"Request a new link"}:{sentence:"No signup grant is attached to this account. Open the verification page to check the account.",action:"Open verification page"},Pi=({verification:e})=>{const{prices:s}=qn(),n=e.grant_amount??s?.default_new_credits,{sentence:a,action:o}=zi(e.signup_grant,Di(n)),r=e.claim_url||Ui;return t.jsxs("div",{className:"mt-8 flex items-start gap-3 rounded-sm border border-hairline bg-surface p-3",children:[t.jsx(Be,{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(F,{variant:"secondary",size:"sm",onClick:()=>{window.api?.openExternal?window.api.openExternal(r):window.open(r,"_blank")},children:o})]})]})},Hi=({onAfterCredentialUpdate:e})=>{const{isAuthenticated:s,user:n,isLoading:a,accountRead:o,signOut:r}=Gn(),u=Jt(b=>b.isSigningOut),d=i.useCallback(async()=>{try{await r()}catch(b){console.error("Error signing out:",b)}},[r]),c=i.useMemo(()=>{if(!s||!n?.radientUser)return null;const{account:b,identity:k,verification:p}=n.radientUser,x=p!=null&&!p.email_verified&&p.signup_grant!=="claimed";return t.jsxs(t.Fragment,{children:[t.jsxs(mt,{children:[t.jsx(ae,{label:"Status",value:t.jsxs("span",{className:"inline-flex items-center gap-2",children:["Connected",t.jsx(Ts,{variant:"success",className:"capitalize",children:b.status})]})}),t.jsx(ae,{label:"Name",value:b.name||"Not provided"}),t.jsx(ae,{label:"Email",value:b.email}),t.jsx(ae,{label:"Account ID",value:t.jsx("span",{className:"text-mono-sm",children:b.id})}),t.jsx(ae,{label:"Tenant ID",value:t.jsx("span",{className:"text-mono-sm",children:b.tenant_id})}),t.jsx(ae,{label:"Provider",value:t.jsx("span",{className:"capitalize",children:k.provider})}),t.jsx(ae,{label:"Created",value:Xt(b.created_at)})]}),x&&p?t.jsx(Pi,{verification:p}):null,t.jsxs("div",{className:"mt-8",children:[t.jsx("p",{className:"text-body-sm text-ink-muted",children:"Need to sign out or switch accounts?"}),t.jsxs(F,{variant:"danger",className:"mt-3",onClick:d,children:[t.jsx(Vn,{}),"Sign out from Radient"]})]})]})},[s,n?.radientUser,d]),m=i.useMemo(()=>o==="refused"?"Radient refused the sign-in this app is holding, so your account details could not be read. Signing in again below replaces it.":en(o)?"Your Radient account could not be read, so this app cannot show your account details.":"You are not currently signed in to Radient.",[o]),g=i.useMemo(()=>s&&n?null:t.jsxs("div",{children:[t.jsxs("p",{className:"text-body-sm text-ink-muted",children:[m," Sign in to access your account details or sign up to get free credits and unified access to models, tools, and more with Radient Pass. Radient's automatic model router will automatically select the best model for your agents to balance cost and performance. It is often cheaper to use Radient Pass than to use single AI providers due to automatic cost optimization."]}),t.jsx("div",{className:"mt-6",children:t.jsx(Os,{titleText:"",onAfterCredentialUpdate:e,descriptionText:"",onSignInSuccess:()=>{}})})]}),[s,n,m,e]);return a||u?t.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center gap-3",children:[t.jsx(oe,{size:"lg",label:"Loading account"}),!u&&t.jsx("p",{className:"text-meta text-ink-dim",children:"Loading your Radient account details…"})]}):s&&n?.radientUser?c:t.jsx("div",{className:"flex flex-col gap-4",children:g})};function Ki({metric:e,data:s}){return t.jsx(Yn,{title:"",heightClassName:"h-62",yAxisWidth:48,unit:e==="credits"?"credits":"tokens",srSummary:`${e==="credits"?"Credits consumed":"Tokens used"} over the last 30 days, plotted per day across ${s.length} days.`,xTickFormatter:n=>n,yTickFormatter:n=>e==="credits"?`$${n.toFixed(2)}`:Wn(n),children:t.jsx(tr,{data:s,children:t.jsx(Yt,{type:"monotone",dataKey:"value",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:0},name:e==="credits"?"Credits consumed":"Tokens used"})})})}const Bi=()=>{const{data:e,isLoading:s,error:n,refetch:a}=Jo(),o=Xo(),[r,u]=i.useState(""),[d,c]=i.useState(!1);i.useEffect(()=>{u(e?.content??""),c(!1)},[e]);const m=x=>{const I=x.target.value;u(I),c(I!==(e?.content??""))},g=async()=>{if(!(!d||o.isPending))try{const x={content:r};await o.mutateAsync(x),await a(),c(!1)}catch(x){console.error("Error updating system prompt:",x)}},b=()=>{u(e?.content??""),c(!1)},k=o.isPending,p=()=>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:"Instructions"}),t.jsx(sn,{id:"app-system-prompt",name:"systemPrompt",value:r,onChange:m,placeholder:"Enter instructions for how all agents should behave and respond to your requests...",className:"min-h-50"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(F,{variant:"primary",onClick:g,disabled:!d||k,children:[k?t.jsx(oe,{size:"sm"}):t.jsx(Zn,{}),k?"Saving...":"Save changes"]}),t.jsx(F,{onClick:b,disabled:!d||k,children:"Cancel"})]}),e?.last_modified&&t.jsxs("p",{className:"text-ink-dim text-meta",children:["Last modified:"," ",t.jsx("span",{className:"font-mono text-mono-sm",children:tn(e.last_modified)})]})]});return t.jsx(se,{title:"System prompt",icon:Es,description:"Every Local Operator agent receives this prompt in addition to its own instructions, so it is the place for baseline expectations and for details you want every agent to know about you, such as your name, location, or preferences. It is sent to your selected hosting provider.",children:s?t.jsx("div",{className:"flex min-h-50 items-center justify-center",children:t.jsx(oe,{size:"lg",label:"Loading system prompt"})}):n?t.jsxs(le,{variant:"danger",children:["Failed to load system prompt:"," ",n instanceof Error?n.message:"Unknown error"]}):p()})},Gi=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Vi=e=>Gi.includes(e),qi=e=>{const s=[];let n=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 u=0;u<o;u+=r)s.push({start:n+u,count:Math.min(r,o-u)});n+=o}return s},Yi=({index:e,key:s,groups:n})=>{const a=qi(n),o=a.reduce((r,u)=>r+u.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),u=a[r+(s==="ArrowDown"?1:-1)];if(!u)return e;const d=e-a[r].start;return u.start+Math.min(d,u.count-1)}default:return e}},Wi={localOperatorDark:oo,localOperatorLight:Co,dracula:xo,dune:La,sage:Qa,monokai:Xn,tokyoNight:lo,iceberg:vo,radient:Ga,neon:Zo,obsidian:on,synth:Vs,catppuccinMocha:xa,catppuccinLatte:to,tokyoNightStorm:da,gruvbox:ea,nord:Yo,oneDark:Bs,solarizedDark:_o,rosePine:$a,rosePineMoon:so,rosePineDawn:ga,alucard:Ua,gruvboxLight:Na,tokyoNightDay:io,oneLight:Xa,catppuccinFrappe:ja,catppuccinMacchiato:qa,palenight:Jn,everforest:zo,everforestLight:Do,kanagawaWave:Bo,kanagawaLotus:Oa,ayuDark:Sa,ayuMirage:Aa,ayuLight:po,nightfox:ma,duskfox:Ro,synthwave:mo,matrix:Ys,tron:ca,cyberpunk:Qn,vaporwave:Fo,outrun:Js,neonNoir:Ho,arcade:Wa,forest:Eo,ocean:Ta,desert:Io,autumn:Vo,lavender:wo,arctic:pa,rosewood:Ka,solarizedLight:Mo,githubLight:Pa,paper:Fs,linen:go,highContrastLight:Hs,mintLight:Zs},Bt="bg-[color-mix(in_srgb,var(--color-accent)_8%,var(--color-accent-wash))]",Zi=({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"})]})]})]}),Qi=({id:e,name:s,description:n,isSelected:a,isTabStop:o,onSelect:r,onFocusTile:u})=>{const d=Wi[e];return t.jsx(Re,{side:"bottom",align:"start",content:n,children:t.jsxs("button",{type:"button","data-theme-tile":e,"aria-pressed":a,tabIndex:o?0:-1,onFocus:u,onClick:r,className:ce("relative flex flex-col gap-1.5 rounded-md p-1 text-left transition-colors duration-fast ease-out-quart",a?Bt:"hover:bg-surface"),children:[t.jsxs("span",{className:ce("relative block h-10 overflow-hidden rounded-sm border transition-colors duration-fast ease-out-quart",a?"border-accent":"border-hairline"),children:[t.jsx(Zi,{id:e}),a&&t.jsx("span",{className:ce("pointer-events-none absolute top-0.5 right-0.5 flex h-4 w-4 items-center justify-center rounded-full",Bt),children:t.jsx(Ls,{size:12,className:"text-accent","aria-hidden":"true"})})]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx(d,{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})]})]})})},Ji=e=>[...e.querySelectorAll("[data-theme-grid]")].map(s=>{const n=[...s.querySelectorAll("[data-theme-tile]")],a=n[0]?.getBoundingClientRect().top??0;return{count:n.length,columns:Math.max(1,n.filter(o=>Math.abs(o.getBoundingClientRect().top-a)<1).length)}}),Xi=()=>{const{themeName:e,setTheme:s}=ot(),n=i.useMemo(()=>{const d=Object.values(jn);return[{label:"Dark",items:d.filter(c=>c.theme.palette.mode==="dark")},{label:"Light",items:d.filter(c=>c.theme.palette.mode==="light")}].filter(c=>c.items.length>0)},[]),[a,o]=i.useState(null),r=i.useMemo(()=>{const d=n.flatMap(c=>c.items.map(m=>m.id));return a&&d.includes(a)?a:d.includes(e)?e:d[0]},[n,a,e]),u=d=>{if(!Vi(d.key))return;const c=[...d.currentTarget.querySelectorAll("[data-theme-tile]")],m=c.indexOf(d.target);if(m<0)return;d.preventDefault();const g=Yi({index:m,key:d.key,groups:Ji(d.currentTarget)});g!==m&&c[g]?.focus()};return t.jsx(Is,{children:t.jsx("div",{onKeyDown:u,className:"flex flex-col gap-6",children:n.map(d=>t.jsxs("div",{children:[t.jsx("h3",{className:"px-1 pb-2 text-meta text-ink-dim",children:d.label}),t.jsx("div",{"data-theme-grid":d.label,className:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-2",children:d.items.map(({id:c,name:m,description:g})=>t.jsx(Qi,{id:c,name:m,description:g,isSelected:c===e,isTabStop:c===r,onSelect:()=>s(c),onFocusTile:()=>o(c)},c))})]},d.label))})})},ec=()=>{const{data:e,isLoading:s,error:n}=ar({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"}),"Radient Pass"]}),s&&t.jsx(an,{className:"h-6 w-36"}),n&&t.jsxs(le,{variant:"warning",children:["Could not load your credit balance. ",n.message]}),e&&!s&&!n&&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:["Available credits"," ",t.jsx("span",{className:"font-medium text-ink",children:e.balance.toFixed(2)})]}),t.jsx(F,{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,{}),"Add credits"]})})]})]})},tc=[{id:"credits",label:"Credits"},{id:"tokens",label:"Tokens"}],nc=()=>{const[e,s]=i.useState("credits"),n=i.useMemo(()=>{const d=new Date,c=nr(d);return{start_date:Et(c),end_date:Et(d),rollup:"daily"}},[]),{data:a,isLoading:o,error:r}=rr(n,{enabled:!0}),u=i.useMemo(()=>a?.data_points?[...a.data_points].sort((c,m)=>Ze(c.timestamp).getTime()-Ze(m.timestamp).getTime()).map(c=>({bucket:gs(Us(Ze(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(na,{size:16,className:"shrink-0 text-ink-dim"}),"Usage (last 30 days)"]}),t.jsxs("fieldset",{className:"m-0 w-fit border-0 p-0",children:[t.jsx("legend",{className:"sr-only",children:"Usage metric"}),t.jsx("div",{className:"flex gap-0.5 rounded-md bg-sunken p-0.5",children:tc.map(({id:d,label:c})=>t.jsx(F,{variant:"ghost",size:"sm","aria-pressed":e===d,onClick:()=>s(d),className:ce(e===d&&"bg-surface text-ink hover:bg-surface"),children:c},d))})]})]}),o&&t.jsx(an,{className:"h-62 w-full"}),r&&t.jsxs(le,{variant:"warning",children:["Could not load your usage data. ",r.message]}),!o&&!r&&a&&u.length>0&&t.jsx(Ki,{metric:e,data:u}),!o&&!r&&(!a||u.length===0)&&t.jsx("p",{className:"text-body-sm text-ink-muted",children:"No usage recorded in the last 30 days."})]})},sc=()=>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(ys,{size:16,className:"shrink-0 text-ink-dim"}),"Radient account"]}),t.jsx(F,{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:["Go to Radient console",t.jsx(xs,{})]})})]}),yc=()=>{const e=es(),s=ot(h=>h.showAgentReasoning),n=ot(h=>h.setShowAgentReasoning),{data:a,isLoading:o,isFetching:r,error:u,refetch:d}=ts(),c=ns(),{sentence:m,remedy:g}=ws(c,"Your settings could not be loaded.",u),b=ss(),[k,p]=i.useState(null),x=Jt(),{isAuthenticated:I,accountRead:N,isFetching:B,isRefreshing:_,refreshUser:U}=lt(),O=ze(h=>h.activeSessionId),[M,C]=i.useState("general"),[H,V]=i.useState(!1),Y=i.useRef(null),z=i.useRef(null),{startTour:P}=as(),A=os(),{data:D,refetch:q}=rs(),{refreshModels:K}=is(),L=i.useMemo(()=>D?.keys?[...D.keys].sort():[],[D?.keys]),J=i.useRef({keys:"",hosting:void 0});i.useEffect(()=>{const h=L.join(","),w=a?.values?.hosting;(J.current.keys!==h||J.current.hosting!==w)&&(J.current={keys:h,hosting:w},K().catch(v=>{console.error("Failed to refresh models after credentials or hosting change:",v)}))},[L,a?.values?.hosting,K]);const R=i.useRef({general:i.useRef(null),radient:i.useRef(null),integrations:i.useRef(null),appearance:i.useRef(null),providers:i.useRef(null),backend:i.useRef(null),updates:i.useRef(null)}).current,re=i.useMemo(()=>new URLSearchParams(A.search).get("setting"),[A.search]),S=i.useMemo(()=>new URLSearchParams(A.search).get("filter")??"",[A.search]),Q=i.useMemo(()=>new URLSearchParams(A.search).get("mcp")??void 0,[A.search]),X=i.useMemo(()=>new URLSearchParams(A.search).get("provider"),[A.search]),ee=i.useCallback(h=>{C(h),V(!0);const w=R[h],v=z.current;if(w?.current&&v){const E=w.current.getBoundingClientRect().top-v.getBoundingClientRect().top;v.scrollHeight>v.clientHeight?v.scrollTo({top:Math.max(0,v.scrollTop+E-80),behavior:"smooth"}):window.scrollTo({top:Math.max(0,w.current.getBoundingClientRect().top+window.scrollY-80),behavior:"smooth"}),clearTimeout(Y.current??void 0),Y.current=setTimeout(()=>{V(!1),Y.current=null},800)}else V(!1)},[R]);i.useEffect(()=>{const h=setTimeout(()=>{const w=z.current;if(!w)return;const v=()=>{if(H)return;const $=w.getBoundingClientRect(),E=$.height;let te="",G=0;for(const[je,ue]of Object.entries(R))if(ue.current){const ie=ue.current.getBoundingClientRect(),ge=$.top,ne=ie.top-ge,qe=ie.bottom-ge,Ee=ie.height,Ye=Math.max(0,ne),Oe=Math.min(E,qe),Fe=Math.max(0,Oe-Ye)/Ee,$e=Fe+(ne<E*.3?.1:0);$e>G&&Fe>.1&&(G=$e,te=je)}te&&te!==M&&C(te)};return v(),w.addEventListener("scroll",v,{passive:!0}),()=>{w.removeEventListener("scroll",v),clearTimeout(Y.current??void 0)}},100);return()=>clearTimeout(h)},[R,M,H]),i.useEffect(()=>{const h=new URLSearchParams(A.search),w=h.get("section"),v=h.get("setting")?"backend":w,$=v?R[v]:void 0;if(!v||!$)return;let E=!1,te=Number.NaN,G=0;const je=window.setTimeout(()=>{E||(E=!0,ie.disconnect(),ee(v))},2e3),ue=()=>{if(E)return;const ge=$.current;if(!ge){G=requestAnimationFrame(ue);return}const ne=Math.round(ge.getBoundingClientRect().top+window.scrollY);if(ne===te&&ne>0){E=!0,ie.disconnect(),window.clearTimeout(je),ee(v);return}te=ne,G=requestAnimationFrame(ue)},ie=new ResizeObserver(()=>{E||(cancelAnimationFrame(G),G=requestAnimationFrame(ue))});return z.current&&ie.observe(z.current),G=requestAnimationFrame(ue),()=>{E=!0,cancelAnimationFrame(G),ie.disconnect(),window.clearTimeout(je)}},[A.search,R,ee]);const W=async(h,w)=>{p(h);try{await b.mutateAsync({[h]:w}),await d()}catch(v){console.error(`Error updating ${h}:`,v)}finally{p(null)}},Z=o,pe=N==="checking",we=en(N),de=N==="ready"||N==="checking"||B,fe=Gt(Z,4e3);return u?t.jsx("div",{className:"flex h-full w-full items-center justify-center bg-canvas p-6",children:t.jsx(le,{variant:"warning",className:"w-full max-w-xl",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{children:m}),g&&t.jsx(F,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>void d(),disabled:r,children:r?"Retrying":"Retry"})]})})}):Z?t.jsxs("div",{role:"status",className:"flex h-full w-full flex-col items-center justify-center gap-3 bg-canvas",children:[t.jsx(oe,{size:"lg",label:fe?void 0:"Loading settings"}),fe&&t.jsx("p",{className:"max-w-sm text-center text-body-sm text-ink-muted",children:"The Local Operator server is taking longer than usual to answer. If it does not respond, you will be able to retry from here."})]}):a?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 border-r border-hairline min-[1040px]:w-55",children:t.jsx(cs,{activeSection:M,onSelectSection:ee,sections:ls})}),t.jsx("div",{ref:z,"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(js,{title:"Settings",icon:St}),t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsxs("div",{ref:R.general,className:"flex flex-col gap-8",children:[t.jsxs(se,{title:"User profile",icon:ds,description:`Your user profile information displayed in the application. This information is not provided to the agents. ${I?"These details are provided through your Radient account.":""}`,children:[pe&&t.jsx("p",{className:"text-meta text-ink-dim",children:"Checking your Radient account…"}),we&&t.jsx(le,{variant:"warning",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("span",{children:["Your Radient account could not be read, so the name and email below are placeholders rather than your account details.",N==="refused"?" Retry, or sign in to Radient again.":" Retry."]}),t.jsx(F,{variant:"secondary",size:"sm",className:"shrink-0",onClick:()=>U(),disabled:_,children:_?"Retrying":"Retry"})]})}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Mt,{value:x.profile.name,label:"Display name",placeholder:"Enter your name...",isSaving:k==="user_name",onSave:async h=>{p("user_name");try{x.updateName(h)}finally{p(null)}},readOnly:de}),t.jsx(Mt,{value:x.profile.email,label:"Email address",placeholder:"Enter your email...",isSaving:k==="user_email",onSave:async h=>{p("user_email");try{x.updateEmail(h)}finally{p(null)}},readOnly:de})]})]}),t.jsx(se,{title:"Application tour",description:"Missed the application onboarding tour or want a refresher? Start it again here.",children:t.jsxs(F,{variant:"secondary",onClick:()=>{P({forceModalCompleted:!0})},children:[t.jsx(aa,{}),"Take the tour"]})}),t.jsx(se,{id:"model-settings",title:"Model settings",icon:us,description:"Configure the default AI model and hosting providers used for generating responses. This will be used for all agents that don't have a specific model or hosting provider configured. You can override these settings for individual agents in the agent settings.",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(ms,{value:a.values.hosting,isSaving:k==="hosting",onSave:h=>W("hosting",h),filterByCredentials:!0,allowCustom:!0,allowDefault:!1,emptyHelperText:"No hosting providers available. Sign in to a provider, or add a provider's API key below, under Providers."}),t.jsx(hs,{value:a.values.model_name,hostingId:a.values.hosting,isSaving:k==="model_name",onSave:h=>W("model_name",h),allowCustom:!0,allowDefault:!1}),t.jsx(le,{variant:"neutral",icon:t.jsx(Be,{className:"size-4","aria-hidden":"true"}),children:"You need a Radient account or your own API keys to reach cloud providers. If you don't see more hosting providers and models here, sign in to Radient, or add a provider's API key below, under Providers."})]})}),t.jsx(Bi,{}),t.jsx(se,{title:"Configuration information",icon:Be,description:"System information about the current configuration.",children:t.jsxs(mt,{children:[t.jsx(ae,{label:"Version",value:t.jsx("span",{className:"text-mono-sm",children:a.version})}),t.jsx(ae,{label:"Created",value:Xt(a.metadata.created_at)}),t.jsx(ae,{label:"Last modified",value:tn(a.metadata.last_modified)}),t.jsx(ae,{label:"Description",value:a.metadata.description||"No description available"})]})})]}),t.jsx(se,{title:"Appearance",icon:on,description:"Customize the look and feel of Local Operator",sectionRef:R.appearance,dataTourTag:"settings-appearance-section",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Xi,{}),t.jsx(er,{value:s,label:"Show agent reasoning",description:"Adds the agent's Reasoning and Thinking rows to conversations. They stay closed until you open one.",onChange:async h=>n(h)})]})}),t.jsx(se,{title:"Model providers",icon:Qt,description:"Sign in to the services your agents think with. New chats use your default model.",sectionRef:R.providers,children:t.jsx(ps,{initialProviderId:X,onChangeModel:()=>ee("general")})}),t.jsx(Oi,{sessionId:O??void 0,sectionRef:R.integrations,highlightServer:Q}),t.jsx(se,{title:"Radient account",titleComponent:t.jsx(sc,{}),description:"Your Radient account, Radient Pass details and credits. To use Radient models, sign in under Model providers.",sectionRef:R.radient,dataTourTag:"settings-radient-account-section",children:t.jsxs("div",{className:"flex flex-col gap-8",children:[t.jsx(Hi,{onAfterCredentialUpdate:()=>{K(),q()}}),I&&t.jsxs(t.Fragment,{children:[t.jsx(ec,{}),t.jsx(nc,{})]})]})}),t.jsx(se,{title:"Backend settings",icon:St,description:"Every setting the backend registry owns, searchable, with typed editors and scopes.",sectionRef:R.backend,children:t.jsx(fs,{focusKey:re,initialFilter:S})}),t.jsx("div",{ref:R.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(le,{variant:"warning",className:"w-full max-w-xl",children:"Your settings could not be loaded."})})};export{yc as SettingsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as r}from"./textarea-
|
|
1
|
+
import{c as r}from"./textarea-CPyoWJfR.js";import{j as e,c as i}from"./index-C17iOszj.js";/**
|
|
2
2
|
* @license lucide-react v0.507.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as W,a as C,S as N}from"./chunk-AEK57VVT-D1a4VfuY.js";import{_ as u,c as t,d as H,l as S,e as P,k as z,u as U}from"./mermaid.core-DLc2GDBk.js";import{G as F}from"./graph-BNpclJqw.js";import{l as O}from"./layout-BQqWsgv9.js";import{C as D,D as J}from"./index-BsveCKct.js";import"./chunk-RZ5BOZE2-KfGYL-ag.js";import"./index-C17iOszj.js";import"./_baseUniq-xIg3idQF.js";import"./_basePickBy-BjXXwW6E.js";import"./aida-control-BqbEHtVs.js";import"./ui-preferences-store-CyKvDymq.js";import"./textarea-CPyoWJfR.js";import"./error-boundary-X9vF0zez.js";import"./console-mirror-CqlxE8VR.js";var L={},X=u((e,i)=>{L[e]=i},"set"),Y=u(e=>L[e],"get"),G=u(()=>Object.keys(L),"keys"),I=u(()=>G().length,"size"),$={get:Y,set:X,keys:G,size:I},j=u(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),q=u(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Z=u((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),o=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o.width+2*t().state.padding).attr("height",o.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),K=u((e,i)=>{const d=u(function(l,B,m){const k=l.append("tspan").attr("x",2*t().state.padding).text(B);m||k.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),g=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",g+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(l){a||(d(x,l,s),s=!1),a=!1});const y=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+g+t().state.dividerMargin/2).attr("y2",t().state.padding+g+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),c=Math.max(p.width,n.width);return y.attr("x2",c+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c+2*t().state.padding).attr("height",p.height+g+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),Q=u((e,i,d)=>{const o=t().state.padding,n=2*t().state.padding,g=e.node().getBBox(),x=g.width,a=g.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let c=Math.max(p,x);c===x&&(c=c+n);let l;const B=e.node().getBBox();i.doc,l=a-o,p>x&&(l=(x-c)/2+o),Math.abs(a-B.x)<o&&p>x&&(l=a-(p-x)/2);const m=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",l).attr("y",m).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",B.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",l+o),p<=x&&s.attr("x",a+(c-n)/2-p/2+o),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",l).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",c).attr("height",B.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),V=u(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),tt=u((e,i)=>{let d=t().state.forkWidth,o=t().state.forkHeight;if(i.parentId){let n=d;d=o,o=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",o).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),et=u((e,i,d,o)=>{let n=0;const g=o.append("text");g.style("text-anchor","start"),g.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const y of a){const p=y.trim();if(p.length>0){const c=g.append("tspan");if(c.text(p),s===0){const l=c.node().getBBox();s+=l.height}n+=s,c.attr("x",i+t().state.noteMargin),c.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:g.node().getBBox().width,textHeight:n}},"_drawLongText"),at=u((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),o=i.append("g"),{textWidth:n,textHeight:g}=et(e,0,0,o);return d.attr("height",g+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),_=u(function(e,i){const d=i.id,o={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&j(n),i.type==="end"&&V(n),(i.type==="fork"||i.type==="join")&&tt(n,i),i.type==="note"&&at(i.note.text,n),i.type==="divider"&&q(n),i.type==="default"&&i.descriptions.length===0&&Z(n,i),i.type==="default"&&i.descriptions.length>0&&K(n,i);const g=n.node().getBBox();return o.width=g.width+2*t().state.padding,o.height=g.height+2*t().state.padding,$.set(d,o),o},"drawState"),A=0,it=u(function(e,i,d){const o=u(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,g=D().x(function(s){return s.x}).y(function(s){return s.y}).curve(J),x=e.append("path").attr("d",g(n)).attr("id","edge"+A).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,a=a.replace(/\(/g,"\\("),a=a.replace(/\)/g,"\\)")),x.attr("marker-end","url("+a+"#"+o(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:y,y:p}=U.calcLabelPosition(i.points),c=z.getRows(d.title);let l=0;const B=[];let m=0,k=0;for(let f=0;f<=c.length;f++){const h=s.append("text").attr("text-anchor","middle").text(c[f]).attr("x",y).attr("y",p+l),w=h.node().getBBox();m=Math.max(m,w.width),k=Math.min(k,w.x),S.info(w.x,y,p+l),l===0&&(l=h.node().getBBox().height,S.info("Title height",l,p)),B.push(h)}let E=l*c.length;if(c.length>1){const f=(c.length-1)*l*.5;B.forEach((h,w)=>h.attr("y",p+w*l-f)),E=l*c.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",y-m/2-t().state.padding/2).attr("y",p-E/2-t().state.padding/2-3.5).attr("width",m+t().state.padding).attr("height",E+t().state.padding),S.info(r)}A++},"drawEdge"),b,T={},rt=u(function(){},"setConf"),nt=u(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),st=u(function(e,i,d,o){b=t().state;const n=t().securityLevel;let g;n==="sandbox"&&(g=H("#i"+i));const x=n==="sandbox"?H(g.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?g.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);nt(s);const y=o.db.getRootDoc();R(y,s,void 0,!1,x,a,o);const p=b.padding,c=s.node().getBBox(),l=c.width+p*2,B=c.height+p*2,m=l*1.75;P(s,B,m,b.useMaxWidth),s.attr("viewBox",`${c.x-b.padding} ${c.y-b.padding} `+l+" "+B)},"draw"),dt=u(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),R=u((e,i,d,o,n,g,x)=>{const a=new F({compound:!0,multigraph:!0});let s,y=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){y=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:b.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),c=x.db.getRelations(),l=Object.keys(p);for(const r of l){const f=p[r];d&&(f.parentId=d);let h;if(f.doc){let w=i.append("g").attr("id",f.id).attr("class","stateGroup");h=R(f.doc,w,f.id,!o,n,g,x);{w=Q(w,f,o);let v=w.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,T[f.id]={y:b.compositTitleSize}}}else h=_(i,f,a);if(f.note){const w={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},v=_(i,w,a);f.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let B=0;c.forEach(function(r){B++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:dt(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+B)}),O(a),S.debug("Graph after layout",a.nodes());const m=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+m.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+m.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),g.querySelectorAll("#"+m.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let v=0,M=0;w&&(w.parentElement&&(v=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let k=m.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),it(i,a.edge(r),a.edge(r).relation))}),k=m.getBBox();const E={id:d||"root",label:d||"root",width:0,height:0};return E.width=k.width+2*b.padding,E.height=k.height+2*b.padding,S.debug("Doc rendered",E,a),E},"renderDoc"),ot={setConf:rt,draw:st},vt={parser:C,get db(){return new N(1)},renderer:ot,styles:W,init:u(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{vt as diagram};
|