limixbot 0.3.71 → 0.3.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/assets/{ActivityPanel-RhVpYfcN.js → ActivityPanel-CHgF8dMH.js} +1 -1
  2. package/dist/assets/{App-Cw7Q97gJ.js → App-5su0zJqK.js} +8 -8
  3. package/dist/assets/{AppEventEditor-Btah_c_2.js → AppEventEditor-B_qeymvm.js} +1 -1
  4. package/dist/assets/{BotSettingsDialog-86CEEBqv.js → BotSettingsDialog-CGS5fK_9.js} +1 -1
  5. package/dist/assets/{BrowserPanel-br1TVwLl.js → BrowserPanel-5v3fqqZx.js} +1 -1
  6. package/dist/assets/{BrowserProfilesManager-CFHWN-4r.js → BrowserProfilesManager-BYCypQbr.js} +1 -1
  7. package/dist/assets/{CloudAddDialog-Ir0qZH_R.js → CloudAddDialog-CAxNEsaw.js} +1 -1
  8. package/dist/assets/{ComputerFilesPane-IdxcdO3R.js → ComputerFilesPane-RGyX8G-b.js} +1 -1
  9. package/dist/assets/{ComputerPanel-DhsVAGkk.js → ComputerPanel-DJL5tdFb.js} +2 -2
  10. package/dist/assets/{DataPanel-DzShkWJM.js → DataPanel-Dtv5XSLY.js} +1 -1
  11. package/dist/assets/{FilesView-CXs0o7Ng.js → FilesView-U5tsQcOZ.js} +1 -1
  12. package/dist/assets/{GrokMoveDialog-ByVz0ZLd.js → GrokMoveDialog-Dyqzn1Bq.js} +1 -1
  13. package/dist/assets/{InspectorPanel-HDxbq3Em.js → InspectorPanel-CPNfTOnl.js} +1 -1
  14. package/dist/assets/{KeyboardShortcutsModal-_wmael6o.js → KeyboardShortcutsModal-C6T94kvb.js} +1 -1
  15. package/dist/assets/{LimixChannelReview-D3Vre_b5.js → LimixChannelReview-DEYWPDL1.js} +1 -1
  16. package/dist/assets/{LiveDesktop-DUNUN3ip.js → LiveDesktop-zpJFb_N4.js} +1 -1
  17. package/dist/assets/{LocalVmWorkspace-r8vQozIz.js → LocalVmWorkspace-B6o5MOvN.js} +1 -1
  18. package/dist/assets/{MacLocalControl-9eGCA-t2.js → MacLocalControl-CGtXA1EX.js} +1 -1
  19. package/dist/assets/{MarkdownFilePreview-r_b3CzP8.js → MarkdownFilePreview-Bz1iAIhj.js} +1 -1
  20. package/dist/assets/{NewBotDialog-JY8nCL-F.js → NewBotDialog-BTph9RYf.js} +1 -1
  21. package/dist/assets/{PhoneAppDialog-CquVzL0v.js → PhoneAppDialog-DPAINJ4i.js} +1 -1
  22. package/dist/assets/{PluginsPanel-2Li8_VD_.js → PluginsPanel-DMi-9axs.js} +1 -1
  23. package/dist/assets/{ProIntroduction-BrmG7l3N.js → ProIntroduction-BaMLV80Z.js} +1 -1
  24. package/dist/assets/{RemoteAgentSettingsPanel-BXvMgYlC.js → RemoteAgentSettingsPanel-6oChwaFz.js} +1 -1
  25. package/dist/assets/{RoomPanel-CAVyXzip.js → RoomPanel-ev3QDMbj.js} +1 -1
  26. package/dist/assets/{RoutinesPage-CusNYUVf.js → RoutinesPage-CsFk2Oza.js} +1 -1
  27. package/dist/assets/{SettingsModal-BhKWJU6g.js → SettingsModal-Cr8M0zhX.js} +1 -1
  28. package/dist/assets/{ShareTeamDialog-DyFOit3r.js → ShareTeamDialog-BQC22hfP.js} +1 -1
  29. package/dist/assets/{SignedInSites-CaJSD3FM.js → SignedInSites-D95WWvSj.js} +1 -1
  30. package/dist/assets/{TeamLibraryPanel-BSXhXzhC.js → TeamLibraryPanel-Bk4PbyP7.js} +1 -1
  31. package/dist/assets/{TeamMapPage-SRWVTLku.js → TeamMapPage-BeSNpxHw.js} +1 -1
  32. package/dist/assets/{TriggersPage-BJzUTKl-.js → TriggersPage-CNvHKFLb.js} +1 -1
  33. package/dist/assets/{VisibilitySection-D0dJqTuH.js → VisibilitySection-DhLlgVCi.js} +1 -1
  34. package/dist/assets/{WebhookTrigger-Ca8w_FmT.js → WebhookTrigger-maNR47wz.js} +1 -1
  35. package/dist/assets/{WorksOnGrid-B32J52xy.js → WorksOnGrid-BE8yfcYN.js} +1 -1
  36. package/dist/assets/{core-DX_0zk8q.js → core-DEmsLy1p.js} +1 -1
  37. package/dist/assets/{import-name-DVWIecdd.js → import-name-DDkEEwnu.js} +1 -1
  38. package/dist/assets/{index-DzysZUHS.js → index-C_C9DFrb.js} +2 -2
  39. package/dist/assets/{index-D2TZFrfq.js → index-DaC1P4Ff.js} +1 -1
  40. package/dist/assets/{mcp-servers-GF93s9SY.js → mcp-servers-CC7TjCjc.js} +1 -1
  41. package/dist/assets/{new-bot-BI0T02kV.js → new-bot-D0H-oXYW.js} +1 -1
  42. package/dist/assets/{org-library-CjxDoFor.js → org-library-D-dBE2U0.js} +1 -1
  43. package/dist/assets/{package-format-C42-bOdh.js → package-format-BflMJbMX.js} +1 -1
  44. package/dist/assets/{remote-desktop-panel-tFLOT6M5.js → remote-desktop-panel-DS1Luju9.js} +1 -1
  45. package/dist/index.html +1 -1
  46. package/dist-server/package.json +1 -1
  47. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/new-bot-BI0T02kV.js","assets/styles-BkKe8nrS.js","assets/styles-CDO5XxMJ.css","assets/PlacesRail-DeL2Iwjg.js","assets/monitor-LgR-tKnv.js","assets/RoutinesPage-CusNYUVf.js","assets/remote-desktop-DDRRx8uY.js","assets/ProIntroduction-BrmG7l3N.js","assets/MenuMotion-EDKcQmjm.js","assets/WebhookTrigger-Ca8w_FmT.js","assets/index-DzysZUHS.js","assets/AppEventEditor-Btah_c_2.js","assets/ActivityPanel-RhVpYfcN.js","assets/activity-DfgP8VPw.js","assets/BotSettingsDialog-86CEEBqv.js","assets/LimixChannelReview-D3Vre_b5.js","assets/VisibilitySection-D0dJqTuH.js","assets/org-library-CjxDoFor.js","assets/package-format-C42-bOdh.js","assets/mcp-servers-GF93s9SY.js","assets/WorksOnGrid-B32J52xy.js","assets/ComputerFilesPane-IdxcdO3R.js","assets/SignedInSites-CaJSD3FM.js","assets/ComputerPanel-DhsVAGkk.js","assets/desktop-viewer-CF-OpSo0.js","assets/MacLocalControl-9eGCA-t2.js","assets/BrowserPanel-br1TVwLl.js","assets/BrowserProfilesManager-CFHWN-4r.js","assets/minimize-B3xe7UnS.js","assets/file-up-QN25T_Ug.js","assets/FilesView-CXs0o7Ng.js","assets/InspectorPanel-HDxbq3Em.js","assets/KeyboardShortcutsModal-_wmael6o.js","assets/LocalVmWorkspace-r8vQozIz.js","assets/NewBotDialog-JY8nCL-F.js","assets/team-share-tMoIre3P.js","assets/PluginsPanel-2Li8_VD_.js","assets/RemoteAgentSettingsPanel-BXvMgYlC.js","assets/RoomPanel-CAVyXzip.js","assets/remote-desktop-panel-tFLOT6M5.js","assets/calendar-days-BJBCvVi1.js","assets/TriggersPage-BJzUTKl-.js","assets/SettingsModal-BhKWJU6g.js","assets/TeamMapPage-SRWVTLku.js","assets/CloudAddDialog-Ir0qZH_R.js","assets/PhoneAppDialog-CquVzL0v.js","assets/ShareTeamDialog-DyFOit3r.js","assets/GrokMoveDialog-ByVz0ZLd.js","assets/import-name-DVWIecdd.js","assets/TeamLibraryPanel-BSXhXzhC.js","assets/MarkdownFilePreview-r_b3CzP8.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/scss-D5BDwBP9.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/cpp-DddhVWhK.js","assets/c-BIGW1oBm.js","assets/ruby-Ct1eTYOr.js","assets/sql-CRqJ_cUM.js","assets/graphql-ChdNCCLP.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/bash-Yzrsuije.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/php-Csjmro_R.js","assets/json-Cp-IABpG.js","assets/core-DX_0zk8q.js","assets/mermaid.core-Bu-wU9fU.js","assets/step-CkmJJ7wq.js","assets/index-D2TZFrfq.js","assets/katex-HP8lGamR.js","assets/katex-BYZTj3zW.css","assets/embed-DIxSrDga.js","assets/linear-ChbPfC31.js","assets/init-Dmth1JHB.js","assets/defaultLocale-CzDG__Ur.js","assets/time-CZ0C3Dvk.js","assets/range-OtVwhkKS.js","assets/ordinal-BeghXfj9.js","assets/colors-Cc3OSVma.js","assets/arc-UbyzOkqk.js","assets/index-DVBvMn51.js"])))=>i.map(i=>d[i]);
2
- import{bc as gq,bd as bq,c as ce,r as f,H as td,s as Ls,ar as Fl,be as n7,t as l,e as Ia,a8 as s7,b as tt,am as yq,bf as kq,bg as vq,bh as f0,b9 as wq,ba as jq,b7 as pw,ao as Nq,bi as Sq,aq as Iq,bj as Cq,aC as Eq,aD as Aq,A as Tq,B as Mq,ai as a7,bk as r7,y as _q,z as Rq,p as zt,bl as $a,S as An,d as dx,G as et,j as s,_ as Oe,a as I,ae as jt,f as Se,X as Ae,i as dt,bm as Oq,ah as nt,n as Ef,bn as mw,ad as kr,C as vr,bo as Zg,bp as Lq,bq as zq,br as fw,l as Kn,a_ as ic,bs as i7,bt as Pq,bu as Dq,a$ as $q,b5 as hw,aE as yn,aA as Bq,az as Fq,R as Uq,L as xw,ag as gw,bv as d4,bw as qq,b6 as h0,ap as Hq,u as Wq,h as Ji,O as bw,bx as Af,o as o7,by as Kq,as as Vq,N as Gq,aJ as Yq,Z as Jq,bz as Qq,bA as Xq,aa as Zq,ac as eH,W as e1,V as tH,bB as nH,bC as sH,aQ as l7,bD as aH,bE as rH,bF as iH,bG as oH,q as c7,bH as lH,v as d7,bI as cH,m as dH}from"./styles-BkKe8nrS.js";import{n as x0,r as bo,h as uH,i as pH,E as wr,j as ui,S as g0,k as ux,p as yo,m as mH,q as fH,g as hH,v as xH,x as gH,y as bH,z as u7,A as yH,B as kH,D as yw,P as vH,F as wH,G as u4,H as jH,I as NH,u as kw,J as px,K as SH,L as p7,M as po,N as IH,O as CH,Q as EH}from"./index-DzysZUHS.js";import{ax as AH,ay as TH,a0 as t1,ae as Qr,az as mx,aA as vw,r as Ke,aB as m7,aC as f7,aD as MH,N as ca,aE as fx,B as Je,t as cs,L as ke,l as Ca,C as Qt,v as is,K as aa,aF as _H,O as RH,aG as OH,aH as LH,aI as h7,aJ as Tf,aK as x7,aL as ww,aM as zH,aN as PH,P as Mn,aO as DH,aP as $H,aQ as BH,aR as FH,R as UH,aS as qH,aT as HH,aU as p4,aV as WH,aW as Hd,aX as Wd,aY as KH,aZ as Cn,a_ as VH,a$ as Ua,b0 as $i,b as GH,b1 as n1,b2 as Rp,b3 as m4,a7 as YH,a8 as f4,a6 as JH,a5 as h4,b4 as sl,b5 as jw,b6 as ko,b7 as Mf,b8 as g7,b9 as b7,M as Jt,ba as oc,bb as Wu,aw as x4,bc as vo,bd as Vt,be as b0,bf as wd,bg as Bm,bh as _f,bi as Fm,bj as Kd,bk as na,bl as dl,bm as QH,bn as Xr,bo as XH,E as vs,c as y7,Q as k7,Y as jr,p as la,s as pi,W as hx,d as Yn,a as v7,bp as ZH,bq as eW,br as tW,bs as s1,A as nW,Z as wo,bt as Zr,bu as w7,bv as j7,bw as Sn,bx as sW,by as aW,bz as rW,bA as xx,g as Nw,e as iW,ap as N7,n as lc,bB as oW,u as Sw,bC as lW,aq as cW,o as dW,bD as uW,bE as pW,bF as mW,U as fW,bG as hW,bH as xW,bI as gW,bJ as S7,bK as bW,ar as yW,X as kW,bL as vW,bM as wW,bN as jW,bO as NW,bP as Vd,bQ as SW,D as IW,bR as CW,bS as EW,bT as AW,k as TW,bU as MW}from"./PlacesRail-DeL2Iwjg.js";import{M as jo}from"./monitor-LgR-tKnv.js";import{R as Tt,a as ys,C as it,u as No,K as _W,S as RW}from"./MenuMotion-EDKcQmjm.js";function g4(e){return gq(bq,e)}const OW=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Iw=ce("activity",OW);const LW=[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]],cc=ce("app-window",LW);const zW=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],PW=ce("archive-restore",zW);const DW=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ul=ce("archive",DW);const $W=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],I7=ce("arrow-down-to-line",$W);const BW=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ql=ce("arrow-down",BW);const FW=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],UW=ce("arrow-left-right",FW);const qW=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],HW=ce("arrow-left",qW);const WW=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],dc=ce("arrow-right-left",WW);const KW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],gx=ce("arrow-right",KW);const VW=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Hs=ce("arrow-up-right",VW);const GW=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ki=ce("arrow-up",GW);const YW=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],C7=ce("at-sign",YW);const JW=[["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"}]],QW=ce("atom",JW);const XW=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],ZW=ce("award",XW);const eK=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M13.916 2.314A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.74 7.327A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673 9 9 0 0 1-.585-.665",key:"1tip0g"}],["circle",{cx:"18",cy:"8",r:"3",key:"1g0gzu"}]],Rf=ce("bell-dot",eK);const tK=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],nK=ce("bell-off",tK);const sK=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Cw=ce("bell",sK);const aK=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],E7=ce("blocks",aK);const rK=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ew=ce("book-open",rK);const iK=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],oK=ce("book",iK);const lK=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]],cK=ce("bookmark-plus",lK);const dK=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Aw=ce("bot",dK);const uK=[["path",{d:"M21 8a2 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:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],A7=ce("box",uK);const pK=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],mK=ce("brain",pK);const fK=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],hK=ce("briefcase",fK);const xK=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],bx=ce("bug",xK);const gK=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]],bK=ce("calendar-check",gK);const yK=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Of=ce("calendar-clock",yK);const kK=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],T7=ce("calendar",kK);const vK=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],wK=ce("chart-column",vK);const jK=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],M7=ce("chart-no-axes-combined",jK);const NK=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Lf=ce("check-check",NK);const SK=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vi=ce("chevron-up",SK);const IK=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],CK=ce("chevrons-up-down",IK);const EK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ta=ce("circle-alert",EK);const AK=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],TK=ce("circle-check-big",AK);const MK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ur=ce("circle-check",MK);const _K=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],RK=ce("circle-dot",_K);const OK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_7=ce("circle-question-mark",OK);const LK=[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],R7=ce("circle-user-round",LK);const zK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Tw=ce("circle-x",zK);const PK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Mw=ce("circle",PK);const DK=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],Um=ce("clipboard-copy",DK);const $K=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],BK=ce("clipboard-list",$K);const FK=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],UK=ce("clipboard-paste",FK);const qK=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ku=ce("clock-3",qK);const HK=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Vu=ce("clock",HK);const WK=[["path",{d:"M12 12v4",key:"tww15h"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M17 18h.5a1 1 0 0 0 0-9h-1.79A7 7 0 1 0 7 17.708",key:"xsb5ju"}]],_w=ce("cloud-alert",WK);const KK=[["path",{d:"m17 15-5.5 5.5L9 18",key:"15q87x"}],["path",{d:"M5 17.743A7 7 0 1 1 15.71 10h1.79a4.5 4.5 0 0 1 1.5 8.742",key:"9ho6ki"}]],O7=ce("cloud-check",KK);const VK=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]],Rw=ce("cloud-off",VK);const GK=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],YK=ce("code-xml",GK);const JK=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],L7=ce("code",JK);const QK=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],XK=ce("compass",QK);const ZK=[["path",{d:"M16 2v2",key:"scm5qe"}],["path",{d:"M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2",key:"1waht3"}],["path",{d:"M8 2v2",key:"pbkmx"}],["circle",{cx:"12",cy:"11",r:"3",key:"itu57m"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]],eV=ce("contact",ZK);const tV=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],y0=ce("corner-down-right",tV);const nV=[["path",{d:"M20 20v-7a4 4 0 0 0-4-4H4",key:"1nkjon"}],["path",{d:"M9 14 4 9l5-5",key:"102s5s"}]],z7=ce("corner-up-left",nV);const sV=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],aV=ce("cpu",sV);const rV=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],b4=ce("credit-card",rV);const iV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],Ow=ce("crosshair",iV);const oV=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Nr=ce("crown",oV);const lV=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],cV=ce("database",lV);const dV=[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]],Lw=ce("dot",dV);const uV=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Rt=ce("download",uV);const pV=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],mV=ce("ellipsis-vertical",pV);const fV=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],zw=ce("eye-off",fV);const hV=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Za=ce("eye",hV);const xV=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],gV=ce("file-pen",xV);const bV=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],mo=ce("file-text",bV);const yV=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],zf=ce("file",yV);const kV=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],vV=ce("film",kV);const wV=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],jV=ce("fingerprint",wV);const NV=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],SV=ce("flask-conical",NV);const IV=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],P7=ce("folder-input",IV);const CV=[["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],D7=ce("folder-minus",CV);const EV=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],er=ce("folder-open",EV);const AV=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],lr=ce("folder-plus",AV);const TV=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Pf=ce("folder",TV);const MV=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Gu=ce("gauge",MV);const _V=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],$7=ce("gift",_V);const RV=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],OV=ce("git-branch",RV);const LV=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],zV=ce("git-commit-horizontal",LV);const PV=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],B7=ce("git-pull-request",PV);const DV=[["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"}]],$V=ce("github",DV);const BV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ra=ce("globe",BV);const FV=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],F7=ce("graduation-cap",FV);const UV=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],qV=ce("grip-vertical",UV);const HV=[["path",{d:"M11 12h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 14",key:"1j4xps"}],["path",{d:"m7 18 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"uospg8"}],["path",{d:"m2 13 6 6",key:"16e5sb"}]],WV=ce("hand-helping",HV);const KV=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],Pw=ce("hand",KV);const VV=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],GV=ce("hash",VV);const YV=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],JV=ce("history",YV);const QV=[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]],XV=ce("id-card",QV);const ZV=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],Gd=ce("image-off",ZV);const eG=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],tG=ce("image-plus",eG);const nG=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Yd=ce("image",nG);const sG=[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]],aG=ce("images",sG);const rG=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Jd=ce("inbox",rG);const iG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],wi=ce("info",iG);const oG=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],os=ce("key-round",oG);const lG=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],U7=ce("layers",lG);const cG=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],dG=ce("layout-grid",cG);const uG=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],pG=ce("layout-dashboard",uG);const mG=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],fG=ce("layout-template",mG);const hG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],q7=ce("life-buoy",hG);const xG=[["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"}]],Dw=ce("lightbulb",xG);const gG=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],$w=ce("link-2",gG);const bG=[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],H7=ce("link-2-off",bG);const yG=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],kG=ce("link",yG);const vG=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],Yu=ce("list-checks",vG);const wG=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],ei=ce("lock-keyhole",wG);const jG=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],Wa=ce("log-in",jG);const NG=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],uc=ce("mail",NG);const SG=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],IG=ce("map-pin",SG);const CG=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],EG=ce("map",CG);const AG=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Qd=ce("maximize-2",AG);const TG=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],MG=ce("megaphone",TG);const _G=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],RG=ce("menu",_G);const OG=[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]],LG=ce("merge",OG);const zG=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],PG=ce("message-square-plus",zG);const DG=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],$G=ce("message-square-text",DG);const BG=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],FG=ce("message-square",BG);const UG=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],Bw=ce("messages-square",UG);const qG=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],yx=ce("mic",qG);const HG=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],W7=ce("mic-off",HG);const WG=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],KG=ce("minimize-2",WG);const VG=[["path",{d:"M5 12h14",key:"1ays0h"}]],kx=ce("minus",VG);const GG=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],YG=ce("music",GG);const JG=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],QG=ce("network",JG);const XG=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],Fw=ce("newspaper",XG);const ZG=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],eY=ce("notebook-pen",ZG);const tY=[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]],nY=ce("notebook",tY);const sY=[["path",{d:"M12 22v-9",key:"x3hkom"}],["path",{d:"M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z",key:"2ntwy6"}],["path",{d:"M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13",key:"1pmm1c"}],["path",{d:"M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z",key:"12ttoo"}]],K7=ce("package-open",sY);const aY=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],V7=ce("paperclip",aY);const rY=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],iY=ce("party-popper",rY);const oY=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Ju=ce("pause",oY);const lY=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],cY=ce("pencil-line",lY);const dY=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],wa=ce("pencil",dY);const uY=[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]],Hl=ce("phone-off",uY);const pY=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Ya=ce("phone",pY);const mY=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],Ea=ce("pin-off",mY);const fY=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],$n=ce("pin",fY);const hY=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],pc=ce("play",hY);const xY=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],y4=ce("plug-zap",xY);const gY=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],G7=ce("plug",gY);const bY=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],vx=ce("puzzle",bY);const yY=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Y7=ce("quote",yY);const kY=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],vY=ce("repeat",kY);const wY=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],wx=ce("reply",wY);const jY=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],NY=ce("rocket",jY);const SY=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ma=ce("rotate-ccw",SY);const IY=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],jx=ce("rotate-cw",IY);const CY=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],EY=ce("scan-search",CY);const AY=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Qu=ce("settings",AY);const TY=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],J7=ce("share-2",TY);const MY=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],Uw=ce("share",MY);const _Y=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],RY=ce("shield-alert",_Y);const OY=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Nx=ce("shield-check",OY);const LY=[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]],Q7=ce("sliders-horizontal",LY);const zY=[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]],PY=ce("smile-plus",zY);const DY=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}]],$Y=ce("sparkle",DY);const BY=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Gn=ce("sparkles",BY);const FY=[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]],UY=ce("split",FY);const qY=[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],HY=ce("square-code",qY);const WY=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]],KY=ce("square-menu",WY);const VY=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],pr=ce("square-pen",VY);const GY=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],k0=ce("square-terminal",GY);const YY=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ar=ce("square",YY);const JY=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Xd=ce("star",JY);const QY=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],X7=ce("table-2",QY);const XY=[["rect",{width:"10",height:"14",x:"3",y:"8",rx:"2",key:"1vrsiq"}],["path",{d:"M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4",key:"1j4zmg"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],ZY=ce("tablet-smartphone",XY);const eJ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],qw=ce("target",eJ);const tJ=[["path",{d:"M17 6H3",key:"16j9eg"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 18H8",key:"1wfozv"}],["path",{d:"M3 12v6",key:"fv4c87"}]],nJ=ce("text-quote",tJ);const sJ=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],vn=ce("trash-2",sJ);const aJ=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ds=ce("triangle-alert",aJ);const rJ=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Z7=ce("undo-2",rJ);const iJ=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],eA=ce("upload",iJ);const oJ=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],lJ=ce("user-plus",oJ);const cJ=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],dJ=ce("user",cJ);const uJ=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Hw=ce("users-round",uJ);const pJ=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],_n=ce("users",pJ);const mJ=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Ww=ce("volume-2",mJ);const fJ=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],hJ=ce("wallet",fJ);const xJ=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],gJ=ce("wand-sparkles",xJ);const bJ=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],yJ=ce("webhook",bJ);const kJ=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],vJ=ce("wifi",kJ);const wJ=[["path",{d:"m16 16-2 2 2 2",key:"kkc6pm"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["path",{d:"M3 18h7",key:"sq21v6"}],["path",{d:"M3 6h18",key:"d0wm0j"}]],Zd=ce("wrap-text",wJ);const jJ=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],tA=ce("wrench",jJ);const NJ=[["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"}]],Sr=ce("zap",NJ);const SJ=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],IJ=ce("zoom-in",SJ),CJ="Limix Bot",So="https://github.com/leomieo/limix-bot",EJ=`${So}/tree/main/docs`,AJ=`${So}/blob/main/docs/approval-levels.md`,uDe="https://docs.openmausbot.com/docs/troubleshooting/google-sign-in-cloud-browser",TJ="https://zalo.me/0977242439",nA=`${So}/releases`,MJ="https://cloud.openmausbot.com/cloud",_J=`${So}/blob/main/LICENSE`,pDe="https://apps.apple.com/in/app/mausbot/id6803387923",mDe=`${So}/releases/download/android-v1.5.0/OpenMausBot.apk`;function ji(){return"0.3.71"}const RJ={darwin:"macOS",win32:"Windows",linux:"Linux"};function OJ(e){return(e&&RJ[e])??null}async function Dt(e){if(window.ogb?.openExternal){await window.ogb.openExternal(e);return}window.open(e,"_blank","noopener,noreferrer")}async function LJ(e){if(window.ogb)return Dt(e);window.location.href=e}const zJ="Shared chat",sA=["none","low","medium","high","xhigh","max"];function fDe(e){return typeof e=="string"&&sA.includes(e)}const aA=["green","blue","red","orange","purple","cyan","pink","yellow","teal","coral","silver","chrome"],hDe=/^[a-z0-9][a-z0-9_-]{0,80}$/,rA=/^[A-Z][A-Z0-9_]{0,127}$/,PJ=e=>e.helperModel===void 0||e.helperModel===!0,DJ="Historical excerpts in chronological order; newer corrections override older requests. These excerpts may omit earlier details.",nd=e=>e.role==="user"?!e.peerAsk:e.kind==="text"&&(e.turnTerminal===!0||!e.turnId);function Ja(e){return e.map((t,n)=>({task:t,index:n})).sort((t,n)=>{const a=+(n.task.pinned===!0)-+(t.task.pinned===!0);if(a)return a;const r=(n.task.lastThreadOrderAt??n.task.createdAt??0)-(t.task.lastThreadOrderAt??t.task.createdAt??0);return r||t.index-n.index}).map(t=>t.task)}const Sx=(e,t=Date.now())=>e.snoozedUntil!==void 0&&(e.snoozedUntil===0||e.snoozedUntil>t),xDe=["rows","toolbar"],Kw="openmausbot.sidebarDensity",Vw="openmausbot.sidebarToolsLayout",Ix="openmausbot.sidebarWidth",iA="openmausbot.sidebarWidth.simple",oA="openmausbot.sidebarAttentionPinned.v1",lA="openmausbot.sidebarCollapsedSections.v1",cA="openmausbot.sidebarSectionOrder.v1",dA="openmausbot.sidebarSectionOrder.simple.v1",Gw="openmausbot.pinnedCircles",Yw="openmausbot.universalPins",uA="openmausbot.pinnedCircleOrder.v1",pA="avatars";function $J(e){return e===pA?"icons":"comfortable"}function BJ(e){try{const t=e===void 0?globalThis.localStorage??null:e;return $J(t?.getItem(Kw)??null)}catch{return"comfortable"}}function FJ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(Kw,e==="icons"?pA:e)}catch{}}function UJ(e){switch(e){case"rows":case"toolbar":return e;default:return"rows"}}function mA(e){try{const t=e===void 0?globalThis.localStorage??null:e;return UJ(t?.getItem(Vw)??null)}catch{return"rows"}}function qJ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(Vw,e)}catch{}}let Jw;const sd=new Set;function HJ(){return Jw??BJ()}function fA(){for(const e of sd)e()}function k4(e){if(!(e.key!==Kw&&e.key!==null)){try{if(e.storageArea&&e.storageArea!==globalThis.localStorage)return}catch{return}Jw=void 0,fA()}}function WJ(e){return sd.add(e),sd.size===1&&typeof window<"u"&&window.addEventListener("storage",k4),()=>{sd.delete(e),sd.size===0&&typeof window<"u"&&window.removeEventListener("storage",k4)}}function v4(e){Jw=e,FJ(e),fA()}function KJ(){return f.useSyncExternalStore(WJ,HJ,()=>"comfortable")}let Qw;const ad=new Set;function VJ(){return Qw??mA()}function hA(){for(const e of ad)e()}function w4(e){if(!(e.key!==Vw&&e.key!==null)){try{if(e.storageArea&&e.storageArea!==globalThis.localStorage)return}catch{return}Qw=void 0,hA()}}function GJ(e){return ad.add(e),ad.size===1&&typeof window<"u"&&window.addEventListener("storage",w4),()=>{ad.delete(e),ad.size===0&&typeof window<"u"&&window.removeEventListener("storage",w4)}}function YJ(e){Qw=e,qJ(e),hA()}function JJ(){return f.useSyncExternalStore(GJ,VJ,()=>"rows")}const Cx=240;function QJ(e,t,n=480){return Math.max(Cx,Math.min(n,t-320,Math.round(e)))}function v0(e,t=Ix){try{const a=(e===void 0?globalThis.localStorage??null:e)?.getItem(t);if(a==null||!/^\d+$/.test(a))return null;const r=Number(a);return r>=Cx&&r<=480?r:null}catch{return null}}function XJ(e,t,n=Ix){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(n,String(e))}catch{}}function ZJ(e){return e==="true"}function eQ(e){try{const t=e===void 0?globalThis.localStorage??null:e;return ZJ(t?.getItem(oA)??null)}catch{return!1}}function tQ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(oA,String(e))}catch{}}function nQ(e){return e==="true"}let Df;const rd=new Set;function xA(){for(const e of rd)e()}function j4(e){e.key!==Gw&&e.key!==null||(Df=void 0,xA())}function sQ(e){return rd.add(e),rd.size===1&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("storage",j4),()=>{rd.delete(e),rd.size===0&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("storage",j4)}}function gA(e){if(e===void 0&&Df!==void 0)return Df;try{const t=e===void 0?globalThis.localStorage??null:e;return nQ(t?.getItem(Gw)??null)}catch{return!1}}function aQ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(Gw,e?"true":"false")}catch{}}function rQ(e){Df=e,aQ(e),xA()}function iQ(){return f.useSyncExternalStore(sQ,gA,()=>!1)}let bA;const w0=new Set;function oQ(e){return w0.add(e),()=>{w0.delete(e)}}function lQ(e){return Ex(uA,e)}function cQ(e,t){bA=Ax(uA,e,t);for(const n of w0)n()}const N4=()=>bA??=lQ();function yA(){return f.useSyncExternalStore(oQ,N4,N4)}function dQ(e){return e==="true"}let $f;const id=new Set;function kA(){for(const e of id)e()}function S4(e){e.key!==Yw&&e.key!==null||($f=void 0,kA())}function uQ(e){return id.add(e),id.size===1&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("storage",S4),()=>{id.delete(e),id.size===0&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("storage",S4)}}function vA(e){if(e===void 0&&$f!==void 0)return $f;try{const t=e===void 0?globalThis.localStorage??null:e;return dQ(t?.getItem(Yw)??null)}catch{return!1}}function pQ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(Yw,e?"true":"false")}catch{}}function mQ(e){$f=e,pQ(e),kA()}function fQ(){return f.useSyncExternalStore(uQ,vA,()=>!1)}const hQ=td(Ls().min(1).max(240));function xQ(e){if(!e)return[];try{const t=JSON.parse(e),n=hQ.safeParse(t);return n.success?[...new Set(n.data)].slice(0,100):[]}catch{return[]}}function Ex(e,t){try{const n=t===void 0?globalThis.localStorage??null:t;return xQ(n?.getItem(e)??null)}catch{return[]}}function Ax(e,t,n){const a=[...new Set(t.filter(r=>r.length>0&&r.length<=240))].slice(0,100);try{(n===void 0?globalThis.localStorage??null:n)?.setItem(e,JSON.stringify(a))}catch{}return a}function gQ(e){return Ex(lA,e)}function I4(e,t){Ax(lA,e,t)}function bQ(e,t){return e.includes(t)?e.filter(n=>n!==t):[...e,t]}function yQ(e){return Ex(cA,e)}function C4(e,t){Ax(cA,e,t)}function kQ(e){return Ex(dA,e)}function E4(e,t){Ax(dA,e,t)}const vQ=560,wQ=e=>e?280:320;function A4(e){if(typeof window>"u")return!0;const t=v0(void 0,e?iA:Ix),n=Math.max(Cx,t??wQ(e));return window.innerWidth>=n+vQ}function jQ(e){const[t,n]=f.useState(()=>A4(e));return f.useEffect(()=>{const a=()=>n(A4(e));a(),window.addEventListener("resize",a),window.addEventListener("storage",a);let r=null;const i=()=>{r?.removeEventListener("change",o),r=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),r.addEventListener("change",o)},o=()=>{a(),i()};i();const c=setInterval(a,2e3);return()=>{window.removeEventListener("resize",a),window.removeEventListener("storage",a),r?.removeEventListener("change",o),clearInterval(c)}},[e]),t}const NQ="x-omb-background",SQ="x-omb-cloud-power",IQ="/api/auth/session",j0=new Set;let eu=!1,N0=null;function Kr(){return eu}function Tx(e){return j0.add(e),()=>{j0.delete(e)}}function wA(e){if(eu!==e){eu=e;for(const t of j0)t(e)}}function Xw(){eu&&(fetch(IQ).catch(()=>{}),N0?.(),N0=null,wA(!1))}function jA(e=globalThis.window){if(eu||(wA(!0),!e))return;const t=()=>Xw(),n=["pointerdown","keydown","focus","touchstart"];for(const a of n)e.addEventListener(a,t,{capture:!0});N0=()=>{for(const a of n)e.removeEventListener(a,t,{capture:!0})}}function S0(){return typeof document<"u"&&document.visibilityState==="hidden"}function CQ(e){return S0()?new Promise((t,n)=>{const a=()=>{document.removeEventListener("visibilitychange",r),e?.removeEventListener("abort",i)},r=()=>{S0()||(a(),t())},i=()=>{a(),n(e?.reason??new DOMException("The request was aborted.","AbortError"))};if(e?.aborted){i();return}document.addEventListener("visibilitychange",r),e?.addEventListener("abort",i,{once:!0})}):Promise.resolve()}function EQ(e){return e.status===503&&e.headers.get(SQ)==="asleep"}function AQ(e){return e.kind==="power"&&e.state==="sleeping"}const T4=new Set;function NA(e){const t=Object(e);return t.status===403&&typeof t.message=="string"&&t.message.includes("lacks the admin scope")}async function Bf(e,t,n){if(T4.has(e))return n;try{return await t()}catch(a){if(!NA(a))throw a;return T4.add(e),n}}const TQ="bot_limit",MQ="bot_paused";function SA(e){return e.filter(t=>!t.defaultBot&&!t.hidden&&!t.movedTo).length}let I0=null,C0=null;const E0=new Set;function Zw(e,t=null){if(!(I0===e&&C0===t)){I0=e,C0=t;for(const n of E0)n()}}const _Q=()=>I0,RQ=()=>C0,tu=(e="bots")=>Zw(e),OQ=e=>Zw("created",e),LQ=()=>Zw(null),IA=e=>(E0.add(e),()=>{E0.delete(e)});function zQ(){return f.useSyncExternalStore(IA,_Q)}function PQ(){return f.useSyncExternalStore(IA,RQ)}function DQ(e,t){const n=t?.refusedAt;return e===null||n===void 0||n===e?{seen:e===null?n:e,show:null}:{seen:n,show:t?.refused??"tasks"}}function $Q(e){return e.filter(t=>SA([t])===1&&!t.chiefOfStaff)}function CA(e){const t=e.config?.botLimit;return t===void 0?null:Math.max(0,t-SA(e.bots))}function M4(e){return CA(e)!==0?!1:(tu(),!0)}function EA(e){return e?.body?.code===TQ}function BQ(e){return e?.body?.code===MQ}class ln extends Error{status;body;constructor(t,n,a){super(t),this.name="ApiError",this.status=n,this.body=a}}const Op=new Map;async function K(e,t){const{timeoutMs:n,signal:a,background:r,headers:i,...o}=t??{};if(r&&S0())return FQ(e,t);if(Kr()){if(r)throw new ln("My Cloud is asleep",503,{error:"asleep"});Xw()}const c=new Headers(i??{"content-type":"application/json"});r&&c.set(NQ,"1");const d=await fetch(e,{...o,headers:c,signal:n===void 0?a:a?AbortSignal.any([a,AbortSignal.timeout(n)]):AbortSignal.timeout(n)});EQ(d)&&jA();const u=await d.json().catch(()=>({}));if(!d.ok){const p=u?.error,m=typeof p=="string"?p:typeof p?.message=="string"?p.message:`${d.status} ${d.statusText}`,h=new ln(Fl(u,m),d.status,u);throw(d.status===401||d.status===403&&!NA(h))&&x0(),d.status===409&&EA(h)&&tu(),d.status===409&&BQ(h)&&tu("paused"),h}return u}function FQ(e,t){const n=(t.method??"GET").toUpperCase()==="GET"&&!t.signal,a=n?Op.get(e):void 0;if(a)return a;const r=CQ(t.signal??void 0).then(()=>K(e,t));return n&&(Op.set(e,r),r.finally(()=>{Op.get(e)===r&&Op.delete(e)}).catch(()=>{})),r}function Lp(e,...t){for(const n of t)if(!Array.isArray(e[n]))throw new Error(`Invalid snapshot: ${String(n)} is not a list`);return e}const _4=[2e3,5e3,15e3,3e4];function UQ(e,t){const n=a=>{t().catch(()=>{e()&&setTimeout(()=>n(a+1),_4[Math.min(a,_4.length-1)])})};n(0)}function qQ(e,t){const n=new Map(t.map((o,c)=>[o,c])),a=[];e.forEach((o,c)=>{n.has(o.id)&&a.push(c)});const r=a.map(o=>e[o]).sort((o,c)=>n.get(o.id)-n.get(c.id)),i=[...e];return a.forEach((o,c)=>{i[o]=r[c]}),i}function A0(e,t){const n=qQ(e,t);return n.some((a,r)=>a!==e[r])?n:null}const HQ=e=>e.trim().toLowerCase();function Ka(e){const t=e.defaultBot?.person?.trim()||e.reportsTo?.trim()||e.createdBy?.trim();return t?HQ(t):null}function Wl(e){const t=Ka(e);return t?`owner:${t}`:`section:${e.section?.trim()||""}`}function R4(e,t){const n=Wl(t);return e.map(a=>a.id===t.id||!a.chiefOfStaff||Wl(a)!==n?a:{...a,chiefOfStaff:!1})}function e2(e){const t=e.trim();return t.includes("@")?Mx(t):t}function Mx(e){return(e.split("@")[0]?.replace(/[._-]+/g," ").trim()||e).replace(new RegExp("(^|\\s)(\\p{L})","gu"),(n,a,r)=>`${a}${r.toUpperCase()}`)}const zp={pageSize:1024,chartMaxMarks:1e4},AA={sheet:e=>`/api/bots/${encodeURIComponent(e)}/data`,page:e=>`/api/bots/${encodeURIComponent(e)}/data/page`,run:e=>`/api/bots/${encodeURIComponent(e)}/data/run`,cancel:e=>`/api/bots/${encodeURIComponent(e)}/data/cancel`,card:(e,t)=>`/api/bots/${encodeURIComponent(e)}/data/cards/${encodeURIComponent(t)}`,stats:(e,t)=>`/api/bots/${encodeURIComponent(e)}/data/tables/${encodeURIComponent(t)}/stats`,histogram:(e,t,n)=>`/api/bots/${encodeURIComponent(e)}/data/tables/${encodeURIComponent(t)}/histogram?column=${encodeURIComponent(n)}`,export:e=>`/api/bots/${encodeURIComponent(e)}/data/export`,image:(e,t)=>`/api/bots/${encodeURIComponent(e)}/data/cards/${encodeURIComponent(t)}/image`},O4=500,WQ=new Set(["notificationsHydrated","notificationReceived","notificationRead","notificationsRead","notificationsMarkAllRead"]);function KQ(e){return WQ.has(e.type)}function VQ(e,t){switch(t.type){case"notificationsHydrated":{const n=new Set(t.notifications.map(a=>a.id));return[...e.filter(a=>!n.has(a.id)),...t.notifications].sort((a,r)=>r.at-a.at).slice(0,O4)}case"notificationReceived":return e.some(n=>n.id===t.entry.id)?e:[t.entry,...e].slice(0,O4);case"notificationRead":return e.map(n=>n.id===t.id&&!n.read?{...n,read:!0}:n);case"notificationsRead":{const n=new Set(t.ids);return e.map(a=>n.has(a.id)&&!a.read?{...a,read:!0}:a)}case"notificationsMarkAllRead":return e.map(n=>n.read?n:{...n,read:!0})}}function qm(e,t){if(!t)return e;const n=new Map((e??[]).map(a=>[a.threadId,a]));return t.map(a=>{const r=n.get(a.threadId);if(!r)return a;const i=r.updatedAt===void 0?a.updatedAt:Math.max(r.updatedAt,a.updatedAt??0),o=r.lastThreadOrderAt===void 0?a.lastThreadOrderAt:Math.max(r.lastThreadOrderAt,a.lastThreadOrderAt??0);return i===a.updatedAt&&o===a.lastThreadOrderAt?a:{...a,updatedAt:i,lastThreadOrderAt:o}})}function Rr(e,t,n,a=!1,r=n){if(!Number.isFinite(n))return e;const i=o=>o?.some(c=>c.threadId===t)?o.map(c=>c.threadId===t?{...c,updatedAt:Math.max(c.updatedAt??0,n),...a?{lastThreadOrderAt:Math.max(c.lastThreadOrderAt??0,r)}:{}}:c):o;return{...e,bots:e.bots.map(o=>{const c=i(o.tasks);return c===o.tasks?o:{...o,tasks:c}}),groups:e.groups.map(o=>{const c=i(o.tasks);return c===o.tasks?o:{...o,tasks:c}})}}function L4(e,t,n,a,r=a){const i=n.reduce((d,u)=>Math.max(d,u.at||0),a),o=n.reduce((d,u)=>nd(u)?Math.max(d,u.turnCompletedAt??u.at??0):d,r),c=d=>d?.map(u=>u.threadId===t?{...u,updatedAt:i,lastThreadOrderAt:o}:u);return{...e,bots:e.bots.map(d=>d.tasks?.some(u=>u.threadId===t)?{...d,tasks:c(d.tasks)}:d),groups:e.groups.map(d=>d.tasks?.some(u=>u.threadId===t)?{...d,tasks:c(d.tasks)}:d)}}const Ff="omb-notification-sounds",Uf="omb-notification-feed",qf="omb-finished-notifications",T0="omb-notification-tray-pinned";let nu,su,au;const od=new Set;function Qa(){try{return globalThis.localStorage}catch{return}}function t2(){if(nu!==void 0)return nu;try{return Qa()?.getItem(Ff)!=="0"}catch{return!0}}function _x(){for(const e of od)e()}function z4(e){e.key!==Ff&&e.key!==Uf&&e.key!==qf&&e.key!==null||e.storageArea&&e.storageArea!==Qa()||(nu=void 0,su=void 0,au=void 0,_x())}function n2(e){return od.add(e),od.size===1&&typeof window<"u"&&window.addEventListener("storage",z4),()=>{od.delete(e),od.size===0&&typeof window<"u"&&window.removeEventListener("storage",z4)}}function GQ(e){nu=e;try{const t=Qa(),n=e?"1":"0";t?.setItem(Ff,n),t?.getItem(Ff)===n&&(nu=void 0)}catch{}_x(),n7()}function gDe(){return f.useSyncExternalStore(n2,t2,()=>!0)}function TA(){if(su!==void 0)return su;try{return Qa()?.getItem(Uf)==="1"}catch{return!1}}function YQ(e){su=e;try{const t=Qa(),n=e?"1":"0";t?.setItem(Uf,n),t?.getItem(Uf)===n&&(su=void 0)}catch{}_x()}function JQ(){return f.useSyncExternalStore(n2,TA,()=>!1)}function s2(){if(au!==void 0)return au;try{return Qa()?.getItem(qf)!=="0"}catch{return!0}}function P4(e){au=e;try{const t=Qa(),n=e?"1":"0";t?.setItem(qf,n),t?.getItem(qf)===n&&(au=void 0)}catch{}_x()}function bDe(){return f.useSyncExternalStore(n2,s2,()=>!0)}function QQ(){try{return Qa()?.getItem(T0)==="1"}catch{return!1}}function XQ(e){try{e?Qa()?.setItem(T0,"1"):Qa()?.removeItem(T0)}catch{}}let Ps=null;const Hf=new Set;function ZQ(e){Hf.add(e)}function ul(e){Ps=e;for(const t of Hf)t()}function Ni(){return Ps}function eX(e,t){Ps?.teamId===e&&!Ps.opened?.includes(t)&&ul({...Ps,opened:[...Ps.opened??[],t]})}const MA=e=>!!(e&&Ps?.opened?.includes(e)),tX=e=>e.private===!0&&!e.routineRunId&&!e.openedBy&&!e.archivedAt&&!e.closedBy,nX=e=>[...e].sort((t,n)=>(n.updatedAt??n.createdAt??0)-(t.updatedAt??t.createdAt??0))[0];function _A(e,t){const n=(e.tasks??[]).filter(tX),a=new Set(t.opened??[]),r=t.member?n:n.filter(i=>a.has(i.threadId));return(n.find(i=>i.inbox===!0)??nX(r))?.threadId??null}const a1=new Set;function RA(e,t,n){const a=Ps;if(!a)return!1;if(a.opened===void 0){const i=()=>{Ps&&Ps.opened===void 0||(Hf.delete(i),Ps&&RA(e,t,n))};return Hf.add(i),!0}const r=_A(t,a);return r?(n(r),!0):t.yourAccess==="view"?!1:(a1.has(t.id)||(a1.add(t.id),K(`/api/bots/${t.id}/tasks`,{method:"POST",body:"{}"}).then(i=>{typeof i?.task?.threadId=="string"&&eX(a.teamId,i.task.threadId),i?.bot&&(e({type:"taskSwitched",bot:i.bot}),e({type:"select",id:t.id}))}).catch(i=>e({type:"error",message:i instanceof Error?i.message:String(i)})).finally(()=>a1.delete(t.id))),!0)}function OA(e){const t=e?.team;return typeof t?.id=="string"&&t.id?{id:t.id}:null}const LA=(e,t)=>({teamId:e,member:!t.scopes.includes("admin"),opened:t.openedThreads??[],...t.email?.trim()?{person:t.email.trim().toLowerCase()}:{}});function sX(){const e=Ps?.teamId;e&&bo().then(t=>{Ps?.teamId===e&&t.kind==="session"&&ul(LA(e,t))}).catch(()=>{})}function aX(e){const t=OA(e)?.id??null;f.useEffect(()=>{if(!t){ul(null);return}ul({teamId:t,member:!1});let n=!0;return bo().then(a=>{n&&ul(a.kind==="session"?LA(t,a):{teamId:t,member:!1,opened:[]})}).catch(()=>{n&&ul({teamId:t,member:!1,opened:[]})}),()=>{n=!1}},[t])}function Rx(e,t){if(e.defaultBot?.person)return"me";const n=e.tasks?.find(a=>a.threadId===t);return n?.sharedChat!==!0&&(n?.private===!0||MA(t))?"me":"team"}const zA=e=>e.defaultBot?.person?null:e.tasks?.find(t=>t.sharedChat===!0&&t.private!==!0)?.threadId??null,a2=(e,t)=>(e.tasks??[]).filter(n=>Rx(e,n.threadId)===t);function rX(e,t,n){return n==="team"?zA(e)!==null:!!e.defaultBot?.person||e.yourAccess!=="view"||_A(e,t)!==null}function iX(e,t){const n=Rx(e,e.threadId)===t,a=a2(e,t),r=n?{}:{busy:!1,activity:void 0,waitingForTeammates:!1,...e.messages?{messages:[]}:{}};return{...e,tasks:e.tasks&&a,unread:a.some(PA),...r}}const PA=e=>!!e.unread&&!e.routineRunId&&e.archivedAt===void 0;function r2(e,t,n,a){if(!n)return{switchable:!1,bots:e,groups:t,unread:{me:!1,team:!1}};const r=e.filter(m=>!m.hidden),i=m=>r.filter(h=>rX(h,n,m)),o=i("me"),c=i("team"),d=o.length>0&&c.length+t.length>0,u=m=>r.some(h=>a2(h,m).some(PA))||m==="team"&&t.some(h=>!!h.unread),p={me:u("me"),team:u("team")};return d?{switchable:d,bots:(a==="me"?o:c).map(m=>iX(m,a)),groups:a==="team"?t:[],unread:p}:{switchable:d,bots:e,groups:t,unread:p}}const i2=()=>typeof localStorage>"u"?null:localStorage,DA=e=>e.person?`omb.team-side.${e.teamId}.${e.person}`:null;let Kl=null,M0=0;const _0=new Set,o2=()=>{M0++;for(const e of _0)e()},Ox=e=>`${e.teamId}:${e.person??""}`;ZQ(()=>{const e=Ni();(!e||Ox(e)!==Kl?.page)&&(Kl=null),o2()});function $A(e=Ni(),t=i2()){const n=e&&DA(e);try{if(n&&t)return t.getItem(n)==="team"?"team":"me"}catch{}return"me"}function Xu(e=Ni(),t=i2()){return e?Kl?.page===Ox(e)?Kl.side:$A(e,t):"me"}function oX(e,t=Ni()){!t||Xu(t)===e||(Kl={page:Ox(t),side:e},o2())}function BA(e,t=Ni(),n=i2()){if(!t)return;const a=DA(t),r=Xu(t,n)!==e;try{a&&n&&$A(t,n)!==e&&n.setItem(a,e)}catch{}r&&(Kl={page:Ox(t),side:e},o2())}function Lx(){f.useSyncExternalStore(t=>(_0.add(t),()=>{_0.delete(t)}),()=>M0,()=>M0);const e=Ni();return{team:e,side:Xu(e)}}function lX(e,t){return t&&Xu(t)==="team"?zA(e):null}function cX(e){return e.activeView!=="chat"?null:e.bots.find(t=>t.id===e.selectedId)?.threadId??e.groups.find(t=>t.id===e.selectedId)?.threadId??null}function Io(e,t){const n=e.tasks?.find(r=>r.threadId===e.threadId),a=e.tasks?.find(r=>r.threadId===e.mainThreadId&&!r.botApi);if((!t||n?.botApi)&&a)return a.threadId;if(n?.botApi){const r=e.tasks?.find(i=>!i.botApi&&!i.routineRunId&&i.archivedAt===void 0);if(r)return r.threadId}return e.threadId}function FA(e,t){return!t&&Io(e,!1)!==e.threadId}function $t(e,t,n){const a=lX(t,Ni());if(a)return Qi(e,t,a,n);if(RA(e,t,i=>Qi(e,t,i,n)))return;const r=Io(t,n);if(t.tasks?.find(i=>i.threadId===r)?.botApi){e({type:"newTask",botId:t.id});return}r===t.threadId?e({type:"select",id:t.id}):Qi(e,t,r,n)}const dX=e=>e.routineRunId||e.botApi?null:e.activity==="waiting-on-you"?0:e.archivedAt!==void 0?null:e.unread?1:e.busy||e.activity==="working"?2:null;function uX(e,t){const n=Io(e,t),a=i=>i.updatedAt??i.createdAt??0;return(e.tasks??[]).flatMap(i=>{const o=dX(i);return o===null?[]:[{task:i,rank:o}]}).sort((i,o)=>i.rank-o.rank||+(o.task.threadId===n)-+(i.task.threadId===n)||a(o.task)-a(i.task))[0]?.task.threadId??null}function ru(e,t,n,a){const r=Ni()?null:uX(t,n);!r||r===Io(t,n)||a&&r===t.threadId?$t(e,t,n):Qi(e,t,r,n)}function Qi(e,t,n,a){(a||n===t.threadId)&&e({type:"select",id:t.id}),e({type:"switchTask",botId:t.id,threadId:n})}function UA(e,t,n){e({type:"select",id:t.groupId});const a=n.find(r=>r.id===t.groupId);t.threadId&&a?.tasks?.some(r=>r.threadId===t.threadId)&&e({type:"switchGroupTask",groupId:t.groupId,threadId:t.threadId})}function mn(e,t,n,a){const r=d=>d.threadId===t.threadId||(d.tasks??[]).some(u=>u.threadId===t.threadId),i=n.groups.find(r),o=i?void 0:n.bots.find(r),c=n.bots.find(d=>d.id===t.botId);return i?(e({type:"select",id:i.id}),i.threadId!==t.threadId&&e({type:"switchGroupTask",groupId:i.id,threadId:t.threadId})):o?Qi(e,o,t.threadId,a):c&&$t(e,c,a),e({type:"revealThread",threadId:t.threadId}),i||o?!0:(e({type:"notice",notice:{kind:"thread-gone",botName:c?.name??null}}),!1)}function al(e){return e.notificationsOpen&&!e.notificationsPinned?{...e,notificationsOpen:!1}:e}function D4(e,t,n){const a=[...e.bots,...e.groups].find(o=>o.id===t),r=a&&"switchingTo"in a?a.switchingTo??a.threadId:a?.threadId;return e.activeView==="chat"&&t===e.selectedId&&r===n?e:al(e)}function pX(e){return QQ()?{...e,notificationsPinned:!0}:e}function Pp(e,t,n,a){return{...e,groups:e.groups.map(r=>r.id!==t?r:{...r,tasks:(r.tasks??[]).map(i=>i.threadId===n?{...i,...a}:i)})}}const wl=e=>`optimistic-${e}`;function r1(e,t,n,a,r){return{id:wl(t),role:"user",kind:"text",text:e,at:Date.now(),parentId:a??null,replyToId:n,sendId:t,channelMode:r}}function mX(e,t){return!!e?.some(n=>n.sendId===t&&n.id!==wl(t))}const fX=[1e3,3e3];async function hX(e,t,n=a=>new Promise(r=>setTimeout(r,a))){for(let a=0;;a++)try{return{body:await e()}}catch(r){if(!(!(r instanceof ln)&&r?.name!=="AbortError"))throw r;if(t())return{arrived:!0};const o=fX[a];if(o===void 0)throw r;if(await n(o),t())return{arrived:!0}}}function xX({threadId:e,pinnedCwd:t,pinnedMessageId:n,usage:a,memberContext:r,busyBotId:i,turnStartedAt:o,...c}){return{...c,section:c.section}}function gX(e,t,n){const a=new Set(n.map(d=>d.id)),r=new Set(n.flatMap(d=>d.sendId?[d.sendId]:[])),i=new Map(e.filter(d=>!t.has(d)).map(d=>[d.id,d])),o=e.findIndex(d=>a.has(d.id)),c=e.filter((d,u)=>a.has(d.id)?!1:d.sendId&&d.id===wl(d.sendId)?!r.has(d.sendId):u>=o&&i.has(d.id));return[...n.map(d=>i.get(d.id)??d),...c]}function bX(e,t){const n=e.find(r=>r.id===t.id),a=n&&!t.messages&&typeof t.threadId=="string"&&t.threadId!==n.threadId?xX(t):t;return n?e.map(r=>r.id===a.id?{...r,...a,section:typeof a.threadId=="string"||Object.hasOwn(a,"section")?a.section:r.section,description:Object.hasOwn(a,"description")?a.description??void 0:r.description,tasks:a.tasks?qm(r.tasks,a.tasks):r.tasks,turnTimeoutMinutes:Object.hasOwn(a,"turnTimeoutMinutes")?a.turnTimeoutMinutes??void 0:r.turnTimeoutMinutes,messages:a.messages??r.messages,hasMore:a.messages?!!a.hasMore:r.hasMore}:r):[{...a.description===null?{...a,description:void 0}:a,messages:a.messages??[]},...e]}function yX(e,{group:t,since:n,heldAtStart:a}){if(!t.messages||!t.threadId)return t;if((e.transcriptGeneration[t.threadId]??0)!==(n[t.threadId]??0))return null;const r=e.groups.find(i=>i.id===t.id);return r?.threadId===t.threadId?{...t,messages:gX(r.messages,new Set(a),t.messages)}:t}function kX(e,t){const n=new Map;return(a,r)=>{const i=(n.get(a)??0)+(r?1:0);n.set(a,i);const{transcriptGeneration:o,groups:c}=e(),d=c.find(u=>u.id===a)?.messages??[];return u=>{u?.group&&n.get(a)===i&&t({type:"groupSnapshot",group:u.group,since:o,heldAtStart:d})}}}function vX(e,t){if("botId"in e){const o=t.bots.find(u=>u.id===e.botId);if(!o)return;const{messages:c,...d}=o;return{type:"botPatched",bot:d}}const n=t.groups?.find(o=>o.id===e.groupId);if(!n)return;const{messages:a,hasMore:r,...i}=n;return{type:"groupPatched",group:i}}const $4=new WeakMap;function zs(e){const t=e.activeLeafId;if(!t)return e.messages;const n=$4.get(e.messages);if(n?.leafId===t)return n.path;const a=new Map(e.messages.map(o=>[o.id,o]));if(!a.has(t))return e.messages;const r=[];let i=a.get(t);for(;i;)r.push(i),i=i.parentId?a.get(i.parentId):void 0;return r.reverse(),$4.set(e.messages,{leafId:t,path:r}),r}function B4(e,t,n){return e!==void 0&&(e.switchingTo!==void 0||(n[e.threadId]??0)!==(t?.[e.threadId]??0))}function qA(e,t,n){if(!n)return t;const a=new Set(t?.map(i=>i.threadId)),r=e?.filter(i=>!n.has(i.threadId)&&!a.has(i.threadId))??[];return r.length?[...t??[],...r]:t}function wX(e,t,n,a){return!n||!e?t:{...t,threadId:e.threadId,tasks:qA(e.tasks,t.tasks,a),switchingTo:e.switchingTo,awaitingThreadSnapshot:e.awaitingThreadSnapshot,messages:e.messages,hasMore:e.hasMore,activeLeafId:e.activeLeafId,pinnedMessageId:e.pinnedMessageId}}function jX(e,t,n,a){return!n||!e?t:{...t,threadId:e.threadId,tasks:qA(e.tasks,t.tasks,a),messages:e.messages,hasMore:e.hasMore,pinnedCwd:e.pinnedCwd,pinnedMessageId:e.pinnedMessageId,usage:e.usage,memberContext:e.memberContext,busyBotId:e.busyBotId,turnStartedAt:e.turnStartedAt}}const NX=["ask","edits","auto","full","custom"];function l2(e,t){return t==="custom"?e==="codex":t==="edits"?["claudeAgent","grokAgent","antigravityAgent","qwenAgent","geminiAgent"].includes(e??""):!0}function F4(e,t,n){return!l2(n,e)||e==="custom"&&t!==n}function SX(e){return["codex","claudeAgent","cursorAgent","grokAgent","qwenAgent"].includes(e??"")}function IX(e){return typeof e=="string"&&NX.includes(e)}const CX="full";let EX=CX;function En(e){const t=e.approvalGrant,n=t&&typeof t=="object"&&"threadOnly"in t&&t.threadOnly===!0&&"threadId"in t&&typeof t.threadId=="string"&&typeof e.threadId=="string"&&t.threadId!==e.threadId;return t&&!n?"ask":IX(e.approvalMode)?e.approvalMode:e.autoApprove===!0?"auto":e.approvalMode===void 0?EX:"ask"}function HA(e,t){return!e||!t?e===t:e.instanceId===t.instanceId&&e.model===t.model&&e.effort===t.effort&&e.variant===t.variant}function WA(e,t){return t.filter(n=>n.followsBotModel===!1&&!HA(n.modelSelection??e,e))}const zx=f.createContext(null);function KA(e){return e==="enable"||e==="disable"||e==="delete"}function c2(e){if(!(!e.preview||!e.sha256||!/^[a-f0-9]{64}$/i.test(e.sha256)))return e.sha256}function AX(e){const t=e.trim().toLowerCase();return["enable","turn on","turn off","delete","update","apply","allow","allow once","confirm","yes"].includes(t)?"allow":"deny"}function TX(e){const t={...Object.hasOwn(e,"toolScope")?{toolScope:e.toolScope}:{},...PJ(e)?{}:{helperModel:!1}};return{...e.visibility&&e.visibility!=="everyone"?{visibility:e.visibility}:{},...Object.keys(t).length?{settings:t}:{}}}function MX(e){return{name:`${e.name} copy`,title:e.title,description:e.description,soul:e.soul,notifications:e.notifications,modelSelection:e.modelSelection,computer:e.computer,cloudBackend:e.cloudBackend,autoStartVps:e.autoStartVps,vpsAlias:e.vpsAlias,avatarUrl:e.avatarUrl,avatarCrop:e.avatarCrop,avatarZoom:e.avatarZoom,avatarFocusX:e.avatarFocusX,avatarFocusY:e.avatarFocusY}}const VA=()=>globalThis.ogb?.companion??null,_X=()=>typeof window<"u"&&!!window.ogb?.companion&&window.ogb?.remoteClient?.active!==!0,Px="steer";function R0(e){if(!e.running)return null;if(!e.canSteer)return"queue";const t=e.preferred??Px;return e.alternate?t==="queue"?"steer":"queue":t}function RX(e,t){const n=R0({running:!0,alternate:!1,preferred:e,canSteer:t}),a=R0({running:!0,alternate:!0,preferred:e,canSteer:t});return[...new Set([n,a,"restart"])]}const O0=[{category:"Navigation",items:[{id:"command-palette",description:"Open command palette (switcher & transcript search)",macKeys:["⌘","K"],winKeys:["Ctrl","K"]},{id:"new-bot",description:"Create a new bot",macKeys:["⌘","N"],winKeys:["Ctrl","N"]},{id:"new-thread",description:"Start a new thread with the selected bot",macKeys:["⌘","⇧","N"],winKeys:["Ctrl","Shift","N"]},{id:"jump-bot",description:"Jump to bot 1–9 in the roster",macKeys:["⌘","1–9"],winKeys:["Ctrl","1–9"]},{id:"toggle-sidebar",description:"Collapse or expand the sidebar",macKeys:["⌘","\\"],winKeys:["Ctrl","\\"]},{id:"switch-bot",description:"Switch to previous / next bot",macKeys:["⌘","⇧","[ / ]"],winKeys:["Ctrl","Shift","[ / ]"]},{id:"find-conversation",description:"Find in conversation",macKeys:["⌘","F"],winKeys:["Ctrl","F"]}]},{category:"Chat & Composer",items:[{id:"send-message",description:"Send message",macKeys:["Return"],winKeys:["Enter"]},{id:"new-line",description:"Insert new line without sending",macKeys:["⇧","Return"],winKeys:["Shift","Enter"]},{id:"send-follow-up",description:"While a bot works: queue instead of steering, or the other way round",macKeys:["⌘","Return"],winKeys:["Ctrl","Enter"]},{id:"edit-last-message",description:"Edit last message (when composer is empty)",macKeys:["↑"],winKeys:["↑"]},{id:"close-panel",description:"Close active drawer, modal, or find bar",macKeys:["Esc"],winKeys:["Esc"]},{id:"shortcuts-cheat-sheet",description:"Show keyboard shortcuts cheat sheet",macKeys:["⌘","/"],winKeys:["Ctrl","/"]}]},{category:"Calls",items:[{id:"live-call-mute",description:"Mute or unmute a Live call",macKeys:["⌘","⇧","M"],winKeys:["Ctrl","Shift","M"]},{id:"live-call-hang-up",description:"Hang up a Live call",macKeys:["⌘","⇧","H"],winKeys:["Ctrl","Shift","H"]}]},{category:"Management & Groups",items:[{id:"save-bulletin",description:"Save group instruction changes",macKeys:["⌘","Return"],winKeys:["Ctrl","Enter"]},{id:"reorder-section",description:"Reorder sidebar sections (focus a section heading)",macKeys:["⌥","↑ / ↓"],winKeys:["Alt","↑ / ↓"]}]}],OX={Navigation:"shortcuts.category.navigation","Chat & Composer":"shortcuts.category.chat",Calls:"shortcuts.category.calls","Management & Groups":"shortcuts.category.groups"},LX=e=>{const t=`shortcuts.${e.id}`;return Object.hasOwn(Ia,t)?l(t):e.description},zX=e=>{const t=OX[e.category];return t?l(t):e.category},U4={macKeys:["Return"],winKeys:["Enter"]},PX={macKeys:["⇧","Return"],winKeys:["Shift","Enter"]},q4={macKeys:["⌘","Return"],winKeys:["Ctrl","Enter"]},DX={"shift-enter":[PX,U4,q4],"mod-enter":[q4,U4,{macKeys:["⌘","⇧","Return"],winKeys:["Ctrl","Shift","Enter"]}]};function yDe(e){if(e==="enter")return O0;const[t,n,a]=DX[e];return O0.map(r=>({...r,items:r.items.map(i=>i.id==="send-message"?{...i,...t}:i.id==="new-line"?{...i,...n}:i.id==="send-follow-up"?{...i,...a}:i)}))}function $X(e){return!e.defaultPrevented&&e.key==="\\"&&(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey}function BX(e){return e.key==="]"||e.key==="}"?1:e.key==="["||e.key==="{"?-1:null}function FX(e){if(e.defaultPrevented||e.isComposing||e.altKey)return!1;const t=e.key==="?"&&!e.metaKey&&!e.ctrlKey,n=e.key==="/"&&(e.metaKey||e.ctrlKey)&&!e.shiftKey;if(!t&&!n)return!1;const a=e.target;return!(a instanceof HTMLElement&&(a.isContentEditable||a.closest("input, textarea, select, dialog, [role=dialog]")))}function Tr(){return typeof window<"u"&&window.ogb?.platform?window.ogb.platform==="darwin":typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.includes("Mac"):!0}function GA(e,t=Tr()){return t?e.macKeys:e.winKeys}function kDe(e,t,n=Tr()){const a=t.trim().toLowerCase();return a?e.map(r=>{const i=r.items.filter(o=>{const c=GA(o,n).join(" ").toLowerCase();return LX(o).toLowerCase().includes(a)||zX(r).toLowerCase().includes(a)||c.includes(a)});return{...r,items:i}}).filter(r=>r.items.length>0):[...e]}const d2="omb-follow-up";function UX(e){return e==="queue"||e==="steer"?e:Px}function qX(e,t){const n=e.ctrlKey||e.metaKey;return t==="mod-enter"?n&&e.shiftKey:n}function HX(e,t=Tr()){const n=t?"⌘":"Ctrl";return e==="mod-enter"?`${n}+Shift+Enter`:`${n}+Enter`}let Wf;const pl=new Set;function u2(){try{return globalThis.localStorage}catch{return}}function YA(){if(Wf!==void 0)return Wf;try{return UX(u2()?.getItem(d2))}catch{return Px}}function H4(e){if(!(e.key!==d2&&e.key!==null)&&!(e.storageArea&&e.storageArea!==u2())){Wf=void 0;for(const t of pl)t()}}function WX(e){return pl.add(e),pl.size===1&&typeof window<"u"&&window.addEventListener("storage",H4),()=>{pl.delete(e),pl.size===0&&typeof window<"u"&&window.removeEventListener("storage",H4)}}function KX(e){Wf=e;try{u2()?.setItem(d2,e)}catch{}for(const t of pl)t()}function VX(){return f.useSyncExternalStore(WX,YA,()=>Px)}function iu(e){const t=[];let n=e.replace(/\r\n?/g,`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/new-bot-D0H-oXYW.js","assets/styles-BkKe8nrS.js","assets/styles-CDO5XxMJ.css","assets/PlacesRail-DeL2Iwjg.js","assets/monitor-LgR-tKnv.js","assets/RoutinesPage-CsFk2Oza.js","assets/remote-desktop-DDRRx8uY.js","assets/ProIntroduction-BaMLV80Z.js","assets/MenuMotion-EDKcQmjm.js","assets/WebhookTrigger-maNR47wz.js","assets/index-C_C9DFrb.js","assets/AppEventEditor-B_qeymvm.js","assets/ActivityPanel-CHgF8dMH.js","assets/activity-DfgP8VPw.js","assets/BotSettingsDialog-CGS5fK_9.js","assets/LimixChannelReview-DEYWPDL1.js","assets/VisibilitySection-DhLlgVCi.js","assets/org-library-D-dBE2U0.js","assets/package-format-BflMJbMX.js","assets/mcp-servers-CC7TjCjc.js","assets/WorksOnGrid-BE8yfcYN.js","assets/ComputerFilesPane-RGyX8G-b.js","assets/SignedInSites-D95WWvSj.js","assets/ComputerPanel-DJL5tdFb.js","assets/desktop-viewer-CF-OpSo0.js","assets/MacLocalControl-CGtXA1EX.js","assets/BrowserPanel-5v3fqqZx.js","assets/BrowserProfilesManager-BYCypQbr.js","assets/minimize-B3xe7UnS.js","assets/file-up-QN25T_Ug.js","assets/FilesView-U5tsQcOZ.js","assets/InspectorPanel-CPNfTOnl.js","assets/KeyboardShortcutsModal-C6T94kvb.js","assets/LocalVmWorkspace-B6o5MOvN.js","assets/NewBotDialog-BTph9RYf.js","assets/team-share-tMoIre3P.js","assets/PluginsPanel-DMi-9axs.js","assets/RemoteAgentSettingsPanel-6oChwaFz.js","assets/RoomPanel-ev3QDMbj.js","assets/remote-desktop-panel-DS1Luju9.js","assets/calendar-days-BJBCvVi1.js","assets/TriggersPage-CNvHKFLb.js","assets/SettingsModal-Cr8M0zhX.js","assets/TeamMapPage-BeSNpxHw.js","assets/CloudAddDialog-CAxNEsaw.js","assets/PhoneAppDialog-DPAINJ4i.js","assets/ShareTeamDialog-BQC22hfP.js","assets/GrokMoveDialog-Dyqzn1Bq.js","assets/import-name-DDkEEwnu.js","assets/TeamLibraryPanel-Bk4PbyP7.js","assets/MarkdownFilePreview-Bz1iAIhj.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/scss-D5BDwBP9.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/cpp-DddhVWhK.js","assets/c-BIGW1oBm.js","assets/ruby-Ct1eTYOr.js","assets/sql-CRqJ_cUM.js","assets/graphql-ChdNCCLP.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/bash-Yzrsuije.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/php-Csjmro_R.js","assets/json-Cp-IABpG.js","assets/core-DEmsLy1p.js","assets/mermaid.core-Bu-wU9fU.js","assets/step-CkmJJ7wq.js","assets/index-DaC1P4Ff.js","assets/katex-HP8lGamR.js","assets/katex-BYZTj3zW.css","assets/embed-DIxSrDga.js","assets/linear-ChbPfC31.js","assets/init-Dmth1JHB.js","assets/defaultLocale-CzDG__Ur.js","assets/time-CZ0C3Dvk.js","assets/range-OtVwhkKS.js","assets/ordinal-BeghXfj9.js","assets/colors-Cc3OSVma.js","assets/arc-UbyzOkqk.js","assets/index-DVBvMn51.js"])))=>i.map(i=>d[i]);
2
+ import{bc as gq,bd as bq,c as ce,r as f,H as td,s as Ls,ar as Fl,be as n7,t as l,e as Ia,a8 as s7,b as tt,am as yq,bf as kq,bg as vq,bh as f0,b9 as wq,ba as jq,b7 as pw,ao as Nq,bi as Sq,aq as Iq,bj as Cq,aC as Eq,aD as Aq,A as Tq,B as Mq,ai as a7,bk as r7,y as _q,z as Rq,p as zt,bl as $a,S as An,d as dx,G as et,j as s,_ as Oe,a as I,ae as jt,f as Se,X as Ae,i as dt,bm as Oq,ah as nt,n as Ef,bn as mw,ad as kr,C as vr,bo as Zg,bp as Lq,bq as zq,br as fw,l as Kn,a_ as ic,bs as i7,bt as Pq,bu as Dq,a$ as $q,b5 as hw,aE as yn,aA as Bq,az as Fq,R as Uq,L as xw,ag as gw,bv as d4,bw as qq,b6 as h0,ap as Hq,u as Wq,h as Ji,O as bw,bx as Af,o as o7,by as Kq,as as Vq,N as Gq,aJ as Yq,Z as Jq,bz as Qq,bA as Xq,aa as Zq,ac as eH,W as e1,V as tH,bB as nH,bC as sH,aQ as l7,bD as aH,bE as rH,bF as iH,bG as oH,q as c7,bH as lH,v as d7,bI as cH,m as dH}from"./styles-BkKe8nrS.js";import{n as x0,r as bo,h as uH,i as pH,E as wr,j as ui,S as g0,k as ux,p as yo,m as mH,q as fH,g as hH,v as xH,x as gH,y as bH,z as u7,A as yH,B as kH,D as yw,P as vH,F as wH,G as u4,H as jH,I as NH,u as kw,J as px,K as SH,L as p7,M as po,N as IH,O as CH,Q as EH}from"./index-C_C9DFrb.js";import{ax as AH,ay as TH,a0 as t1,ae as Qr,az as mx,aA as vw,r as Ke,aB as m7,aC as f7,aD as MH,N as ca,aE as fx,B as Je,t as cs,L as ke,l as Ca,C as Qt,v as is,K as aa,aF as _H,O as RH,aG as OH,aH as LH,aI as h7,aJ as Tf,aK as x7,aL as ww,aM as zH,aN as PH,P as Mn,aO as DH,aP as $H,aQ as BH,aR as FH,R as UH,aS as qH,aT as HH,aU as p4,aV as WH,aW as Hd,aX as Wd,aY as KH,aZ as Cn,a_ as VH,a$ as Ua,b0 as $i,b as GH,b1 as n1,b2 as Rp,b3 as m4,a7 as YH,a8 as f4,a6 as JH,a5 as h4,b4 as sl,b5 as jw,b6 as ko,b7 as Mf,b8 as g7,b9 as b7,M as Jt,ba as oc,bb as Wu,aw as x4,bc as vo,bd as Vt,be as b0,bf as wd,bg as Bm,bh as _f,bi as Fm,bj as Kd,bk as na,bl as dl,bm as QH,bn as Xr,bo as XH,E as vs,c as y7,Q as k7,Y as jr,p as la,s as pi,W as hx,d as Yn,a as v7,bp as ZH,bq as eW,br as tW,bs as s1,A as nW,Z as wo,bt as Zr,bu as w7,bv as j7,bw as Sn,bx as sW,by as aW,bz as rW,bA as xx,g as Nw,e as iW,ap as N7,n as lc,bB as oW,u as Sw,bC as lW,aq as cW,o as dW,bD as uW,bE as pW,bF as mW,U as fW,bG as hW,bH as xW,bI as gW,bJ as S7,bK as bW,ar as yW,X as kW,bL as vW,bM as wW,bN as jW,bO as NW,bP as Vd,bQ as SW,D as IW,bR as CW,bS as EW,bT as AW,k as TW,bU as MW}from"./PlacesRail-DeL2Iwjg.js";import{M as jo}from"./monitor-LgR-tKnv.js";import{R as Tt,a as ys,C as it,u as No,K as _W,S as RW}from"./MenuMotion-EDKcQmjm.js";function g4(e){return gq(bq,e)}const OW=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Iw=ce("activity",OW);const LW=[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]],cc=ce("app-window",LW);const zW=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],PW=ce("archive-restore",zW);const DW=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ul=ce("archive",DW);const $W=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],I7=ce("arrow-down-to-line",$W);const BW=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ql=ce("arrow-down",BW);const FW=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],UW=ce("arrow-left-right",FW);const qW=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],HW=ce("arrow-left",qW);const WW=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],dc=ce("arrow-right-left",WW);const KW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],gx=ce("arrow-right",KW);const VW=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Hs=ce("arrow-up-right",VW);const GW=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ki=ce("arrow-up",GW);const YW=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],C7=ce("at-sign",YW);const JW=[["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"}]],QW=ce("atom",JW);const XW=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],ZW=ce("award",XW);const eK=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M13.916 2.314A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.74 7.327A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673 9 9 0 0 1-.585-.665",key:"1tip0g"}],["circle",{cx:"18",cy:"8",r:"3",key:"1g0gzu"}]],Rf=ce("bell-dot",eK);const tK=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],nK=ce("bell-off",tK);const sK=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Cw=ce("bell",sK);const aK=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],E7=ce("blocks",aK);const rK=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ew=ce("book-open",rK);const iK=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],oK=ce("book",iK);const lK=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]],cK=ce("bookmark-plus",lK);const dK=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Aw=ce("bot",dK);const uK=[["path",{d:"M21 8a2 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:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],A7=ce("box",uK);const pK=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],mK=ce("brain",pK);const fK=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],hK=ce("briefcase",fK);const xK=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],bx=ce("bug",xK);const gK=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]],bK=ce("calendar-check",gK);const yK=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Of=ce("calendar-clock",yK);const kK=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],T7=ce("calendar",kK);const vK=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],wK=ce("chart-column",vK);const jK=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],M7=ce("chart-no-axes-combined",jK);const NK=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Lf=ce("check-check",NK);const SK=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vi=ce("chevron-up",SK);const IK=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],CK=ce("chevrons-up-down",IK);const EK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ta=ce("circle-alert",EK);const AK=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],TK=ce("circle-check-big",AK);const MK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ur=ce("circle-check",MK);const _K=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],RK=ce("circle-dot",_K);const OK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_7=ce("circle-question-mark",OK);const LK=[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],R7=ce("circle-user-round",LK);const zK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Tw=ce("circle-x",zK);const PK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Mw=ce("circle",PK);const DK=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],Um=ce("clipboard-copy",DK);const $K=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],BK=ce("clipboard-list",$K);const FK=[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]],UK=ce("clipboard-paste",FK);const qK=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ku=ce("clock-3",qK);const HK=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Vu=ce("clock",HK);const WK=[["path",{d:"M12 12v4",key:"tww15h"}],["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M17 18h.5a1 1 0 0 0 0-9h-1.79A7 7 0 1 0 7 17.708",key:"xsb5ju"}]],_w=ce("cloud-alert",WK);const KK=[["path",{d:"m17 15-5.5 5.5L9 18",key:"15q87x"}],["path",{d:"M5 17.743A7 7 0 1 1 15.71 10h1.79a4.5 4.5 0 0 1 1.5 8.742",key:"9ho6ki"}]],O7=ce("cloud-check",KK);const VK=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]],Rw=ce("cloud-off",VK);const GK=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],YK=ce("code-xml",GK);const JK=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],L7=ce("code",JK);const QK=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],XK=ce("compass",QK);const ZK=[["path",{d:"M16 2v2",key:"scm5qe"}],["path",{d:"M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2",key:"1waht3"}],["path",{d:"M8 2v2",key:"pbkmx"}],["circle",{cx:"12",cy:"11",r:"3",key:"itu57m"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]],eV=ce("contact",ZK);const tV=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],y0=ce("corner-down-right",tV);const nV=[["path",{d:"M20 20v-7a4 4 0 0 0-4-4H4",key:"1nkjon"}],["path",{d:"M9 14 4 9l5-5",key:"102s5s"}]],z7=ce("corner-up-left",nV);const sV=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],aV=ce("cpu",sV);const rV=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],b4=ce("credit-card",rV);const iV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],Ow=ce("crosshair",iV);const oV=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Nr=ce("crown",oV);const lV=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],cV=ce("database",lV);const dV=[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]],Lw=ce("dot",dV);const uV=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Rt=ce("download",uV);const pV=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],mV=ce("ellipsis-vertical",pV);const fV=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],zw=ce("eye-off",fV);const hV=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Za=ce("eye",hV);const xV=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],gV=ce("file-pen",xV);const bV=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],mo=ce("file-text",bV);const yV=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],zf=ce("file",yV);const kV=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],vV=ce("film",kV);const wV=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],jV=ce("fingerprint",wV);const NV=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],SV=ce("flask-conical",NV);const IV=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],P7=ce("folder-input",IV);const CV=[["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],D7=ce("folder-minus",CV);const EV=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],er=ce("folder-open",EV);const AV=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],lr=ce("folder-plus",AV);const TV=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Pf=ce("folder",TV);const MV=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Gu=ce("gauge",MV);const _V=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],$7=ce("gift",_V);const RV=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],OV=ce("git-branch",RV);const LV=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],zV=ce("git-commit-horizontal",LV);const PV=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],B7=ce("git-pull-request",PV);const DV=[["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"}]],$V=ce("github",DV);const BV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ra=ce("globe",BV);const FV=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],F7=ce("graduation-cap",FV);const UV=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],qV=ce("grip-vertical",UV);const HV=[["path",{d:"M11 12h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 14",key:"1j4xps"}],["path",{d:"m7 18 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"uospg8"}],["path",{d:"m2 13 6 6",key:"16e5sb"}]],WV=ce("hand-helping",HV);const KV=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],Pw=ce("hand",KV);const VV=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],GV=ce("hash",VV);const YV=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],JV=ce("history",YV);const QV=[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]],XV=ce("id-card",QV);const ZV=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],Gd=ce("image-off",ZV);const eG=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],tG=ce("image-plus",eG);const nG=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Yd=ce("image",nG);const sG=[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]],aG=ce("images",sG);const rG=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Jd=ce("inbox",rG);const iG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],wi=ce("info",iG);const oG=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],os=ce("key-round",oG);const lG=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],U7=ce("layers",lG);const cG=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],dG=ce("layout-grid",cG);const uG=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],pG=ce("layout-dashboard",uG);const mG=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],fG=ce("layout-template",mG);const hG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],q7=ce("life-buoy",hG);const xG=[["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"}]],Dw=ce("lightbulb",xG);const gG=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],$w=ce("link-2",gG);const bG=[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],H7=ce("link-2-off",bG);const yG=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],kG=ce("link",yG);const vG=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],Yu=ce("list-checks",vG);const wG=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],ei=ce("lock-keyhole",wG);const jG=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],Wa=ce("log-in",jG);const NG=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],uc=ce("mail",NG);const SG=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],IG=ce("map-pin",SG);const CG=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],EG=ce("map",CG);const AG=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Qd=ce("maximize-2",AG);const TG=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],MG=ce("megaphone",TG);const _G=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],RG=ce("menu",_G);const OG=[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]],LG=ce("merge",OG);const zG=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],PG=ce("message-square-plus",zG);const DG=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],$G=ce("message-square-text",DG);const BG=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],FG=ce("message-square",BG);const UG=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],Bw=ce("messages-square",UG);const qG=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],yx=ce("mic",qG);const HG=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],W7=ce("mic-off",HG);const WG=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],KG=ce("minimize-2",WG);const VG=[["path",{d:"M5 12h14",key:"1ays0h"}]],kx=ce("minus",VG);const GG=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],YG=ce("music",GG);const JG=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],QG=ce("network",JG);const XG=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],Fw=ce("newspaper",XG);const ZG=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],eY=ce("notebook-pen",ZG);const tY=[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]],nY=ce("notebook",tY);const sY=[["path",{d:"M12 22v-9",key:"x3hkom"}],["path",{d:"M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z",key:"2ntwy6"}],["path",{d:"M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13",key:"1pmm1c"}],["path",{d:"M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z",key:"12ttoo"}]],K7=ce("package-open",sY);const aY=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],V7=ce("paperclip",aY);const rY=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],iY=ce("party-popper",rY);const oY=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Ju=ce("pause",oY);const lY=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],cY=ce("pencil-line",lY);const dY=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],wa=ce("pencil",dY);const uY=[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]],Hl=ce("phone-off",uY);const pY=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Ya=ce("phone",pY);const mY=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],Ea=ce("pin-off",mY);const fY=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],$n=ce("pin",fY);const hY=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],pc=ce("play",hY);const xY=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],y4=ce("plug-zap",xY);const gY=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],G7=ce("plug",gY);const bY=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],vx=ce("puzzle",bY);const yY=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Y7=ce("quote",yY);const kY=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],vY=ce("repeat",kY);const wY=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],wx=ce("reply",wY);const jY=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],NY=ce("rocket",jY);const SY=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ma=ce("rotate-ccw",SY);const IY=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],jx=ce("rotate-cw",IY);const CY=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],EY=ce("scan-search",CY);const AY=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Qu=ce("settings",AY);const TY=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],J7=ce("share-2",TY);const MY=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],Uw=ce("share",MY);const _Y=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],RY=ce("shield-alert",_Y);const OY=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Nx=ce("shield-check",OY);const LY=[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]],Q7=ce("sliders-horizontal",LY);const zY=[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]],PY=ce("smile-plus",zY);const DY=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}]],$Y=ce("sparkle",DY);const BY=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Gn=ce("sparkles",BY);const FY=[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]],UY=ce("split",FY);const qY=[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],HY=ce("square-code",qY);const WY=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]],KY=ce("square-menu",WY);const VY=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],pr=ce("square-pen",VY);const GY=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],k0=ce("square-terminal",GY);const YY=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ar=ce("square",YY);const JY=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Xd=ce("star",JY);const QY=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],X7=ce("table-2",QY);const XY=[["rect",{width:"10",height:"14",x:"3",y:"8",rx:"2",key:"1vrsiq"}],["path",{d:"M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4",key:"1j4zmg"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],ZY=ce("tablet-smartphone",XY);const eJ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],qw=ce("target",eJ);const tJ=[["path",{d:"M17 6H3",key:"16j9eg"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 18H8",key:"1wfozv"}],["path",{d:"M3 12v6",key:"fv4c87"}]],nJ=ce("text-quote",tJ);const sJ=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],vn=ce("trash-2",sJ);const aJ=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ds=ce("triangle-alert",aJ);const rJ=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Z7=ce("undo-2",rJ);const iJ=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],eA=ce("upload",iJ);const oJ=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],lJ=ce("user-plus",oJ);const cJ=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],dJ=ce("user",cJ);const uJ=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Hw=ce("users-round",uJ);const pJ=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],_n=ce("users",pJ);const mJ=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Ww=ce("volume-2",mJ);const fJ=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],hJ=ce("wallet",fJ);const xJ=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],gJ=ce("wand-sparkles",xJ);const bJ=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],yJ=ce("webhook",bJ);const kJ=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],vJ=ce("wifi",kJ);const wJ=[["path",{d:"m16 16-2 2 2 2",key:"kkc6pm"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["path",{d:"M3 18h7",key:"sq21v6"}],["path",{d:"M3 6h18",key:"d0wm0j"}]],Zd=ce("wrap-text",wJ);const jJ=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],tA=ce("wrench",jJ);const NJ=[["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"}]],Sr=ce("zap",NJ);const SJ=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],IJ=ce("zoom-in",SJ),CJ="Limix Bot",So="https://github.com/leomieo/limix-bot",EJ=`${So}/tree/main/docs`,AJ=`${So}/blob/main/docs/approval-levels.md`,uDe="https://docs.openmausbot.com/docs/troubleshooting/google-sign-in-cloud-browser",TJ="https://zalo.me/0977242439",nA=`${So}/releases`,MJ="https://cloud.openmausbot.com/cloud",_J=`${So}/blob/main/LICENSE`,pDe="https://apps.apple.com/in/app/mausbot/id6803387923",mDe=`${So}/releases/download/android-v1.5.0/OpenMausBot.apk`;function ji(){return"0.3.73"}const RJ={darwin:"macOS",win32:"Windows",linux:"Linux"};function OJ(e){return(e&&RJ[e])??null}async function Dt(e){if(window.ogb?.openExternal){await window.ogb.openExternal(e);return}window.open(e,"_blank","noopener,noreferrer")}async function LJ(e){if(window.ogb)return Dt(e);window.location.href=e}const zJ="Shared chat",sA=["none","low","medium","high","xhigh","max"];function fDe(e){return typeof e=="string"&&sA.includes(e)}const aA=["green","blue","red","orange","purple","cyan","pink","yellow","teal","coral","silver","chrome"],hDe=/^[a-z0-9][a-z0-9_-]{0,80}$/,rA=/^[A-Z][A-Z0-9_]{0,127}$/,PJ=e=>e.helperModel===void 0||e.helperModel===!0,DJ="Historical excerpts in chronological order; newer corrections override older requests. These excerpts may omit earlier details.",nd=e=>e.role==="user"?!e.peerAsk:e.kind==="text"&&(e.turnTerminal===!0||!e.turnId);function Ja(e){return e.map((t,n)=>({task:t,index:n})).sort((t,n)=>{const a=+(n.task.pinned===!0)-+(t.task.pinned===!0);if(a)return a;const r=(n.task.lastThreadOrderAt??n.task.createdAt??0)-(t.task.lastThreadOrderAt??t.task.createdAt??0);return r||t.index-n.index}).map(t=>t.task)}const Sx=(e,t=Date.now())=>e.snoozedUntil!==void 0&&(e.snoozedUntil===0||e.snoozedUntil>t),xDe=["rows","toolbar"],Kw="openmausbot.sidebarDensity",Vw="openmausbot.sidebarToolsLayout",Ix="openmausbot.sidebarWidth",iA="openmausbot.sidebarWidth.simple",oA="openmausbot.sidebarAttentionPinned.v1",lA="openmausbot.sidebarCollapsedSections.v1",cA="openmausbot.sidebarSectionOrder.v1",dA="openmausbot.sidebarSectionOrder.simple.v1",Gw="openmausbot.pinnedCircles",Yw="openmausbot.universalPins",uA="openmausbot.pinnedCircleOrder.v1",pA="avatars";function $J(e){return e===pA?"icons":"comfortable"}function BJ(e){try{const t=e===void 0?globalThis.localStorage??null:e;return $J(t?.getItem(Kw)??null)}catch{return"comfortable"}}function FJ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(Kw,e==="icons"?pA:e)}catch{}}function UJ(e){switch(e){case"rows":case"toolbar":return e;default:return"rows"}}function mA(e){try{const t=e===void 0?globalThis.localStorage??null:e;return UJ(t?.getItem(Vw)??null)}catch{return"rows"}}function qJ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(Vw,e)}catch{}}let Jw;const sd=new Set;function HJ(){return Jw??BJ()}function fA(){for(const e of sd)e()}function k4(e){if(!(e.key!==Kw&&e.key!==null)){try{if(e.storageArea&&e.storageArea!==globalThis.localStorage)return}catch{return}Jw=void 0,fA()}}function WJ(e){return sd.add(e),sd.size===1&&typeof window<"u"&&window.addEventListener("storage",k4),()=>{sd.delete(e),sd.size===0&&typeof window<"u"&&window.removeEventListener("storage",k4)}}function v4(e){Jw=e,FJ(e),fA()}function KJ(){return f.useSyncExternalStore(WJ,HJ,()=>"comfortable")}let Qw;const ad=new Set;function VJ(){return Qw??mA()}function hA(){for(const e of ad)e()}function w4(e){if(!(e.key!==Vw&&e.key!==null)){try{if(e.storageArea&&e.storageArea!==globalThis.localStorage)return}catch{return}Qw=void 0,hA()}}function GJ(e){return ad.add(e),ad.size===1&&typeof window<"u"&&window.addEventListener("storage",w4),()=>{ad.delete(e),ad.size===0&&typeof window<"u"&&window.removeEventListener("storage",w4)}}function YJ(e){Qw=e,qJ(e),hA()}function JJ(){return f.useSyncExternalStore(GJ,VJ,()=>"rows")}const Cx=240;function QJ(e,t,n=480){return Math.max(Cx,Math.min(n,t-320,Math.round(e)))}function v0(e,t=Ix){try{const a=(e===void 0?globalThis.localStorage??null:e)?.getItem(t);if(a==null||!/^\d+$/.test(a))return null;const r=Number(a);return r>=Cx&&r<=480?r:null}catch{return null}}function XJ(e,t,n=Ix){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(n,String(e))}catch{}}function ZJ(e){return e==="true"}function eQ(e){try{const t=e===void 0?globalThis.localStorage??null:e;return ZJ(t?.getItem(oA)??null)}catch{return!1}}function tQ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(oA,String(e))}catch{}}function nQ(e){return e==="true"}let Df;const rd=new Set;function xA(){for(const e of rd)e()}function j4(e){e.key!==Gw&&e.key!==null||(Df=void 0,xA())}function sQ(e){return rd.add(e),rd.size===1&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("storage",j4),()=>{rd.delete(e),rd.size===0&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("storage",j4)}}function gA(e){if(e===void 0&&Df!==void 0)return Df;try{const t=e===void 0?globalThis.localStorage??null:e;return nQ(t?.getItem(Gw)??null)}catch{return!1}}function aQ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(Gw,e?"true":"false")}catch{}}function rQ(e){Df=e,aQ(e),xA()}function iQ(){return f.useSyncExternalStore(sQ,gA,()=>!1)}let bA;const w0=new Set;function oQ(e){return w0.add(e),()=>{w0.delete(e)}}function lQ(e){return Ex(uA,e)}function cQ(e,t){bA=Ax(uA,e,t);for(const n of w0)n()}const N4=()=>bA??=lQ();function yA(){return f.useSyncExternalStore(oQ,N4,N4)}function dQ(e){return e==="true"}let $f;const id=new Set;function kA(){for(const e of id)e()}function S4(e){e.key!==Yw&&e.key!==null||($f=void 0,kA())}function uQ(e){return id.add(e),id.size===1&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("storage",S4),()=>{id.delete(e),id.size===0&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("storage",S4)}}function vA(e){if(e===void 0&&$f!==void 0)return $f;try{const t=e===void 0?globalThis.localStorage??null:e;return dQ(t?.getItem(Yw)??null)}catch{return!1}}function pQ(e,t){try{(t===void 0?globalThis.localStorage??null:t)?.setItem(Yw,e?"true":"false")}catch{}}function mQ(e){$f=e,pQ(e),kA()}function fQ(){return f.useSyncExternalStore(uQ,vA,()=>!1)}const hQ=td(Ls().min(1).max(240));function xQ(e){if(!e)return[];try{const t=JSON.parse(e),n=hQ.safeParse(t);return n.success?[...new Set(n.data)].slice(0,100):[]}catch{return[]}}function Ex(e,t){try{const n=t===void 0?globalThis.localStorage??null:t;return xQ(n?.getItem(e)??null)}catch{return[]}}function Ax(e,t,n){const a=[...new Set(t.filter(r=>r.length>0&&r.length<=240))].slice(0,100);try{(n===void 0?globalThis.localStorage??null:n)?.setItem(e,JSON.stringify(a))}catch{}return a}function gQ(e){return Ex(lA,e)}function I4(e,t){Ax(lA,e,t)}function bQ(e,t){return e.includes(t)?e.filter(n=>n!==t):[...e,t]}function yQ(e){return Ex(cA,e)}function C4(e,t){Ax(cA,e,t)}function kQ(e){return Ex(dA,e)}function E4(e,t){Ax(dA,e,t)}const vQ=560,wQ=e=>e?280:320;function A4(e){if(typeof window>"u")return!0;const t=v0(void 0,e?iA:Ix),n=Math.max(Cx,t??wQ(e));return window.innerWidth>=n+vQ}function jQ(e){const[t,n]=f.useState(()=>A4(e));return f.useEffect(()=>{const a=()=>n(A4(e));a(),window.addEventListener("resize",a),window.addEventListener("storage",a);let r=null;const i=()=>{r?.removeEventListener("change",o),r=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),r.addEventListener("change",o)},o=()=>{a(),i()};i();const c=setInterval(a,2e3);return()=>{window.removeEventListener("resize",a),window.removeEventListener("storage",a),r?.removeEventListener("change",o),clearInterval(c)}},[e]),t}const NQ="x-omb-background",SQ="x-omb-cloud-power",IQ="/api/auth/session",j0=new Set;let eu=!1,N0=null;function Kr(){return eu}function Tx(e){return j0.add(e),()=>{j0.delete(e)}}function wA(e){if(eu!==e){eu=e;for(const t of j0)t(e)}}function Xw(){eu&&(fetch(IQ).catch(()=>{}),N0?.(),N0=null,wA(!1))}function jA(e=globalThis.window){if(eu||(wA(!0),!e))return;const t=()=>Xw(),n=["pointerdown","keydown","focus","touchstart"];for(const a of n)e.addEventListener(a,t,{capture:!0});N0=()=>{for(const a of n)e.removeEventListener(a,t,{capture:!0})}}function S0(){return typeof document<"u"&&document.visibilityState==="hidden"}function CQ(e){return S0()?new Promise((t,n)=>{const a=()=>{document.removeEventListener("visibilitychange",r),e?.removeEventListener("abort",i)},r=()=>{S0()||(a(),t())},i=()=>{a(),n(e?.reason??new DOMException("The request was aborted.","AbortError"))};if(e?.aborted){i();return}document.addEventListener("visibilitychange",r),e?.addEventListener("abort",i,{once:!0})}):Promise.resolve()}function EQ(e){return e.status===503&&e.headers.get(SQ)==="asleep"}function AQ(e){return e.kind==="power"&&e.state==="sleeping"}const T4=new Set;function NA(e){const t=Object(e);return t.status===403&&typeof t.message=="string"&&t.message.includes("lacks the admin scope")}async function Bf(e,t,n){if(T4.has(e))return n;try{return await t()}catch(a){if(!NA(a))throw a;return T4.add(e),n}}const TQ="bot_limit",MQ="bot_paused";function SA(e){return e.filter(t=>!t.defaultBot&&!t.hidden&&!t.movedTo).length}let I0=null,C0=null;const E0=new Set;function Zw(e,t=null){if(!(I0===e&&C0===t)){I0=e,C0=t;for(const n of E0)n()}}const _Q=()=>I0,RQ=()=>C0,tu=(e="bots")=>Zw(e),OQ=e=>Zw("created",e),LQ=()=>Zw(null),IA=e=>(E0.add(e),()=>{E0.delete(e)});function zQ(){return f.useSyncExternalStore(IA,_Q)}function PQ(){return f.useSyncExternalStore(IA,RQ)}function DQ(e,t){const n=t?.refusedAt;return e===null||n===void 0||n===e?{seen:e===null?n:e,show:null}:{seen:n,show:t?.refused??"tasks"}}function $Q(e){return e.filter(t=>SA([t])===1&&!t.chiefOfStaff)}function CA(e){const t=e.config?.botLimit;return t===void 0?null:Math.max(0,t-SA(e.bots))}function M4(e){return CA(e)!==0?!1:(tu(),!0)}function EA(e){return e?.body?.code===TQ}function BQ(e){return e?.body?.code===MQ}class ln extends Error{status;body;constructor(t,n,a){super(t),this.name="ApiError",this.status=n,this.body=a}}const Op=new Map;async function K(e,t){const{timeoutMs:n,signal:a,background:r,headers:i,...o}=t??{};if(r&&S0())return FQ(e,t);if(Kr()){if(r)throw new ln("My Cloud is asleep",503,{error:"asleep"});Xw()}const c=new Headers(i??{"content-type":"application/json"});r&&c.set(NQ,"1");const d=await fetch(e,{...o,headers:c,signal:n===void 0?a:a?AbortSignal.any([a,AbortSignal.timeout(n)]):AbortSignal.timeout(n)});EQ(d)&&jA();const u=await d.json().catch(()=>({}));if(!d.ok){const p=u?.error,m=typeof p=="string"?p:typeof p?.message=="string"?p.message:`${d.status} ${d.statusText}`,h=new ln(Fl(u,m),d.status,u);throw(d.status===401||d.status===403&&!NA(h))&&x0(),d.status===409&&EA(h)&&tu(),d.status===409&&BQ(h)&&tu("paused"),h}return u}function FQ(e,t){const n=(t.method??"GET").toUpperCase()==="GET"&&!t.signal,a=n?Op.get(e):void 0;if(a)return a;const r=CQ(t.signal??void 0).then(()=>K(e,t));return n&&(Op.set(e,r),r.finally(()=>{Op.get(e)===r&&Op.delete(e)}).catch(()=>{})),r}function Lp(e,...t){for(const n of t)if(!Array.isArray(e[n]))throw new Error(`Invalid snapshot: ${String(n)} is not a list`);return e}const _4=[2e3,5e3,15e3,3e4];function UQ(e,t){const n=a=>{t().catch(()=>{e()&&setTimeout(()=>n(a+1),_4[Math.min(a,_4.length-1)])})};n(0)}function qQ(e,t){const n=new Map(t.map((o,c)=>[o,c])),a=[];e.forEach((o,c)=>{n.has(o.id)&&a.push(c)});const r=a.map(o=>e[o]).sort((o,c)=>n.get(o.id)-n.get(c.id)),i=[...e];return a.forEach((o,c)=>{i[o]=r[c]}),i}function A0(e,t){const n=qQ(e,t);return n.some((a,r)=>a!==e[r])?n:null}const HQ=e=>e.trim().toLowerCase();function Ka(e){const t=e.defaultBot?.person?.trim()||e.reportsTo?.trim()||e.createdBy?.trim();return t?HQ(t):null}function Wl(e){const t=Ka(e);return t?`owner:${t}`:`section:${e.section?.trim()||""}`}function R4(e,t){const n=Wl(t);return e.map(a=>a.id===t.id||!a.chiefOfStaff||Wl(a)!==n?a:{...a,chiefOfStaff:!1})}function e2(e){const t=e.trim();return t.includes("@")?Mx(t):t}function Mx(e){return(e.split("@")[0]?.replace(/[._-]+/g," ").trim()||e).replace(new RegExp("(^|\\s)(\\p{L})","gu"),(n,a,r)=>`${a}${r.toUpperCase()}`)}const zp={pageSize:1024,chartMaxMarks:1e4},AA={sheet:e=>`/api/bots/${encodeURIComponent(e)}/data`,page:e=>`/api/bots/${encodeURIComponent(e)}/data/page`,run:e=>`/api/bots/${encodeURIComponent(e)}/data/run`,cancel:e=>`/api/bots/${encodeURIComponent(e)}/data/cancel`,card:(e,t)=>`/api/bots/${encodeURIComponent(e)}/data/cards/${encodeURIComponent(t)}`,stats:(e,t)=>`/api/bots/${encodeURIComponent(e)}/data/tables/${encodeURIComponent(t)}/stats`,histogram:(e,t,n)=>`/api/bots/${encodeURIComponent(e)}/data/tables/${encodeURIComponent(t)}/histogram?column=${encodeURIComponent(n)}`,export:e=>`/api/bots/${encodeURIComponent(e)}/data/export`,image:(e,t)=>`/api/bots/${encodeURIComponent(e)}/data/cards/${encodeURIComponent(t)}/image`},O4=500,WQ=new Set(["notificationsHydrated","notificationReceived","notificationRead","notificationsRead","notificationsMarkAllRead"]);function KQ(e){return WQ.has(e.type)}function VQ(e,t){switch(t.type){case"notificationsHydrated":{const n=new Set(t.notifications.map(a=>a.id));return[...e.filter(a=>!n.has(a.id)),...t.notifications].sort((a,r)=>r.at-a.at).slice(0,O4)}case"notificationReceived":return e.some(n=>n.id===t.entry.id)?e:[t.entry,...e].slice(0,O4);case"notificationRead":return e.map(n=>n.id===t.id&&!n.read?{...n,read:!0}:n);case"notificationsRead":{const n=new Set(t.ids);return e.map(a=>n.has(a.id)&&!a.read?{...a,read:!0}:a)}case"notificationsMarkAllRead":return e.map(n=>n.read?n:{...n,read:!0})}}function qm(e,t){if(!t)return e;const n=new Map((e??[]).map(a=>[a.threadId,a]));return t.map(a=>{const r=n.get(a.threadId);if(!r)return a;const i=r.updatedAt===void 0?a.updatedAt:Math.max(r.updatedAt,a.updatedAt??0),o=r.lastThreadOrderAt===void 0?a.lastThreadOrderAt:Math.max(r.lastThreadOrderAt,a.lastThreadOrderAt??0);return i===a.updatedAt&&o===a.lastThreadOrderAt?a:{...a,updatedAt:i,lastThreadOrderAt:o}})}function Rr(e,t,n,a=!1,r=n){if(!Number.isFinite(n))return e;const i=o=>o?.some(c=>c.threadId===t)?o.map(c=>c.threadId===t?{...c,updatedAt:Math.max(c.updatedAt??0,n),...a?{lastThreadOrderAt:Math.max(c.lastThreadOrderAt??0,r)}:{}}:c):o;return{...e,bots:e.bots.map(o=>{const c=i(o.tasks);return c===o.tasks?o:{...o,tasks:c}}),groups:e.groups.map(o=>{const c=i(o.tasks);return c===o.tasks?o:{...o,tasks:c}})}}function L4(e,t,n,a,r=a){const i=n.reduce((d,u)=>Math.max(d,u.at||0),a),o=n.reduce((d,u)=>nd(u)?Math.max(d,u.turnCompletedAt??u.at??0):d,r),c=d=>d?.map(u=>u.threadId===t?{...u,updatedAt:i,lastThreadOrderAt:o}:u);return{...e,bots:e.bots.map(d=>d.tasks?.some(u=>u.threadId===t)?{...d,tasks:c(d.tasks)}:d),groups:e.groups.map(d=>d.tasks?.some(u=>u.threadId===t)?{...d,tasks:c(d.tasks)}:d)}}const Ff="omb-notification-sounds",Uf="omb-notification-feed",qf="omb-finished-notifications",T0="omb-notification-tray-pinned";let nu,su,au;const od=new Set;function Qa(){try{return globalThis.localStorage}catch{return}}function t2(){if(nu!==void 0)return nu;try{return Qa()?.getItem(Ff)!=="0"}catch{return!0}}function _x(){for(const e of od)e()}function z4(e){e.key!==Ff&&e.key!==Uf&&e.key!==qf&&e.key!==null||e.storageArea&&e.storageArea!==Qa()||(nu=void 0,su=void 0,au=void 0,_x())}function n2(e){return od.add(e),od.size===1&&typeof window<"u"&&window.addEventListener("storage",z4),()=>{od.delete(e),od.size===0&&typeof window<"u"&&window.removeEventListener("storage",z4)}}function GQ(e){nu=e;try{const t=Qa(),n=e?"1":"0";t?.setItem(Ff,n),t?.getItem(Ff)===n&&(nu=void 0)}catch{}_x(),n7()}function gDe(){return f.useSyncExternalStore(n2,t2,()=>!0)}function TA(){if(su!==void 0)return su;try{return Qa()?.getItem(Uf)==="1"}catch{return!1}}function YQ(e){su=e;try{const t=Qa(),n=e?"1":"0";t?.setItem(Uf,n),t?.getItem(Uf)===n&&(su=void 0)}catch{}_x()}function JQ(){return f.useSyncExternalStore(n2,TA,()=>!1)}function s2(){if(au!==void 0)return au;try{return Qa()?.getItem(qf)!=="0"}catch{return!0}}function P4(e){au=e;try{const t=Qa(),n=e?"1":"0";t?.setItem(qf,n),t?.getItem(qf)===n&&(au=void 0)}catch{}_x()}function bDe(){return f.useSyncExternalStore(n2,s2,()=>!0)}function QQ(){try{return Qa()?.getItem(T0)==="1"}catch{return!1}}function XQ(e){try{e?Qa()?.setItem(T0,"1"):Qa()?.removeItem(T0)}catch{}}let Ps=null;const Hf=new Set;function ZQ(e){Hf.add(e)}function ul(e){Ps=e;for(const t of Hf)t()}function Ni(){return Ps}function eX(e,t){Ps?.teamId===e&&!Ps.opened?.includes(t)&&ul({...Ps,opened:[...Ps.opened??[],t]})}const MA=e=>!!(e&&Ps?.opened?.includes(e)),tX=e=>e.private===!0&&!e.routineRunId&&!e.openedBy&&!e.archivedAt&&!e.closedBy,nX=e=>[...e].sort((t,n)=>(n.updatedAt??n.createdAt??0)-(t.updatedAt??t.createdAt??0))[0];function _A(e,t){const n=(e.tasks??[]).filter(tX),a=new Set(t.opened??[]),r=t.member?n:n.filter(i=>a.has(i.threadId));return(n.find(i=>i.inbox===!0)??nX(r))?.threadId??null}const a1=new Set;function RA(e,t,n){const a=Ps;if(!a)return!1;if(a.opened===void 0){const i=()=>{Ps&&Ps.opened===void 0||(Hf.delete(i),Ps&&RA(e,t,n))};return Hf.add(i),!0}const r=_A(t,a);return r?(n(r),!0):t.yourAccess==="view"?!1:(a1.has(t.id)||(a1.add(t.id),K(`/api/bots/${t.id}/tasks`,{method:"POST",body:"{}"}).then(i=>{typeof i?.task?.threadId=="string"&&eX(a.teamId,i.task.threadId),i?.bot&&(e({type:"taskSwitched",bot:i.bot}),e({type:"select",id:t.id}))}).catch(i=>e({type:"error",message:i instanceof Error?i.message:String(i)})).finally(()=>a1.delete(t.id))),!0)}function OA(e){const t=e?.team;return typeof t?.id=="string"&&t.id?{id:t.id}:null}const LA=(e,t)=>({teamId:e,member:!t.scopes.includes("admin"),opened:t.openedThreads??[],...t.email?.trim()?{person:t.email.trim().toLowerCase()}:{}});function sX(){const e=Ps?.teamId;e&&bo().then(t=>{Ps?.teamId===e&&t.kind==="session"&&ul(LA(e,t))}).catch(()=>{})}function aX(e){const t=OA(e)?.id??null;f.useEffect(()=>{if(!t){ul(null);return}ul({teamId:t,member:!1});let n=!0;return bo().then(a=>{n&&ul(a.kind==="session"?LA(t,a):{teamId:t,member:!1,opened:[]})}).catch(()=>{n&&ul({teamId:t,member:!1,opened:[]})}),()=>{n=!1}},[t])}function Rx(e,t){if(e.defaultBot?.person)return"me";const n=e.tasks?.find(a=>a.threadId===t);return n?.sharedChat!==!0&&(n?.private===!0||MA(t))?"me":"team"}const zA=e=>e.defaultBot?.person?null:e.tasks?.find(t=>t.sharedChat===!0&&t.private!==!0)?.threadId??null,a2=(e,t)=>(e.tasks??[]).filter(n=>Rx(e,n.threadId)===t);function rX(e,t,n){return n==="team"?zA(e)!==null:!!e.defaultBot?.person||e.yourAccess!=="view"||_A(e,t)!==null}function iX(e,t){const n=Rx(e,e.threadId)===t,a=a2(e,t),r=n?{}:{busy:!1,activity:void 0,waitingForTeammates:!1,...e.messages?{messages:[]}:{}};return{...e,tasks:e.tasks&&a,unread:a.some(PA),...r}}const PA=e=>!!e.unread&&!e.routineRunId&&e.archivedAt===void 0;function r2(e,t,n,a){if(!n)return{switchable:!1,bots:e,groups:t,unread:{me:!1,team:!1}};const r=e.filter(m=>!m.hidden),i=m=>r.filter(h=>rX(h,n,m)),o=i("me"),c=i("team"),d=o.length>0&&c.length+t.length>0,u=m=>r.some(h=>a2(h,m).some(PA))||m==="team"&&t.some(h=>!!h.unread),p={me:u("me"),team:u("team")};return d?{switchable:d,bots:(a==="me"?o:c).map(m=>iX(m,a)),groups:a==="team"?t:[],unread:p}:{switchable:d,bots:e,groups:t,unread:p}}const i2=()=>typeof localStorage>"u"?null:localStorage,DA=e=>e.person?`omb.team-side.${e.teamId}.${e.person}`:null;let Kl=null,M0=0;const _0=new Set,o2=()=>{M0++;for(const e of _0)e()},Ox=e=>`${e.teamId}:${e.person??""}`;ZQ(()=>{const e=Ni();(!e||Ox(e)!==Kl?.page)&&(Kl=null),o2()});function $A(e=Ni(),t=i2()){const n=e&&DA(e);try{if(n&&t)return t.getItem(n)==="team"?"team":"me"}catch{}return"me"}function Xu(e=Ni(),t=i2()){return e?Kl?.page===Ox(e)?Kl.side:$A(e,t):"me"}function oX(e,t=Ni()){!t||Xu(t)===e||(Kl={page:Ox(t),side:e},o2())}function BA(e,t=Ni(),n=i2()){if(!t)return;const a=DA(t),r=Xu(t,n)!==e;try{a&&n&&$A(t,n)!==e&&n.setItem(a,e)}catch{}r&&(Kl={page:Ox(t),side:e},o2())}function Lx(){f.useSyncExternalStore(t=>(_0.add(t),()=>{_0.delete(t)}),()=>M0,()=>M0);const e=Ni();return{team:e,side:Xu(e)}}function lX(e,t){return t&&Xu(t)==="team"?zA(e):null}function cX(e){return e.activeView!=="chat"?null:e.bots.find(t=>t.id===e.selectedId)?.threadId??e.groups.find(t=>t.id===e.selectedId)?.threadId??null}function Io(e,t){const n=e.tasks?.find(r=>r.threadId===e.threadId),a=e.tasks?.find(r=>r.threadId===e.mainThreadId&&!r.botApi);if((!t||n?.botApi)&&a)return a.threadId;if(n?.botApi){const r=e.tasks?.find(i=>!i.botApi&&!i.routineRunId&&i.archivedAt===void 0);if(r)return r.threadId}return e.threadId}function FA(e,t){return!t&&Io(e,!1)!==e.threadId}function $t(e,t,n){const a=lX(t,Ni());if(a)return Qi(e,t,a,n);if(RA(e,t,i=>Qi(e,t,i,n)))return;const r=Io(t,n);if(t.tasks?.find(i=>i.threadId===r)?.botApi){e({type:"newTask",botId:t.id});return}r===t.threadId?e({type:"select",id:t.id}):Qi(e,t,r,n)}const dX=e=>e.routineRunId||e.botApi?null:e.activity==="waiting-on-you"?0:e.archivedAt!==void 0?null:e.unread?1:e.busy||e.activity==="working"?2:null;function uX(e,t){const n=Io(e,t),a=i=>i.updatedAt??i.createdAt??0;return(e.tasks??[]).flatMap(i=>{const o=dX(i);return o===null?[]:[{task:i,rank:o}]}).sort((i,o)=>i.rank-o.rank||+(o.task.threadId===n)-+(i.task.threadId===n)||a(o.task)-a(i.task))[0]?.task.threadId??null}function ru(e,t,n,a){const r=Ni()?null:uX(t,n);!r||r===Io(t,n)||a&&r===t.threadId?$t(e,t,n):Qi(e,t,r,n)}function Qi(e,t,n,a){(a||n===t.threadId)&&e({type:"select",id:t.id}),e({type:"switchTask",botId:t.id,threadId:n})}function UA(e,t,n){e({type:"select",id:t.groupId});const a=n.find(r=>r.id===t.groupId);t.threadId&&a?.tasks?.some(r=>r.threadId===t.threadId)&&e({type:"switchGroupTask",groupId:t.groupId,threadId:t.threadId})}function mn(e,t,n,a){const r=d=>d.threadId===t.threadId||(d.tasks??[]).some(u=>u.threadId===t.threadId),i=n.groups.find(r),o=i?void 0:n.bots.find(r),c=n.bots.find(d=>d.id===t.botId);return i?(e({type:"select",id:i.id}),i.threadId!==t.threadId&&e({type:"switchGroupTask",groupId:i.id,threadId:t.threadId})):o?Qi(e,o,t.threadId,a):c&&$t(e,c,a),e({type:"revealThread",threadId:t.threadId}),i||o?!0:(e({type:"notice",notice:{kind:"thread-gone",botName:c?.name??null}}),!1)}function al(e){return e.notificationsOpen&&!e.notificationsPinned?{...e,notificationsOpen:!1}:e}function D4(e,t,n){const a=[...e.bots,...e.groups].find(o=>o.id===t),r=a&&"switchingTo"in a?a.switchingTo??a.threadId:a?.threadId;return e.activeView==="chat"&&t===e.selectedId&&r===n?e:al(e)}function pX(e){return QQ()?{...e,notificationsPinned:!0}:e}function Pp(e,t,n,a){return{...e,groups:e.groups.map(r=>r.id!==t?r:{...r,tasks:(r.tasks??[]).map(i=>i.threadId===n?{...i,...a}:i)})}}const wl=e=>`optimistic-${e}`;function r1(e,t,n,a,r){return{id:wl(t),role:"user",kind:"text",text:e,at:Date.now(),parentId:a??null,replyToId:n,sendId:t,channelMode:r}}function mX(e,t){return!!e?.some(n=>n.sendId===t&&n.id!==wl(t))}const fX=[1e3,3e3];async function hX(e,t,n=a=>new Promise(r=>setTimeout(r,a))){for(let a=0;;a++)try{return{body:await e()}}catch(r){if(!(!(r instanceof ln)&&r?.name!=="AbortError"))throw r;if(t())return{arrived:!0};const o=fX[a];if(o===void 0)throw r;if(await n(o),t())return{arrived:!0}}}function xX({threadId:e,pinnedCwd:t,pinnedMessageId:n,usage:a,memberContext:r,busyBotId:i,turnStartedAt:o,...c}){return{...c,section:c.section}}function gX(e,t,n){const a=new Set(n.map(d=>d.id)),r=new Set(n.flatMap(d=>d.sendId?[d.sendId]:[])),i=new Map(e.filter(d=>!t.has(d)).map(d=>[d.id,d])),o=e.findIndex(d=>a.has(d.id)),c=e.filter((d,u)=>a.has(d.id)?!1:d.sendId&&d.id===wl(d.sendId)?!r.has(d.sendId):u>=o&&i.has(d.id));return[...n.map(d=>i.get(d.id)??d),...c]}function bX(e,t){const n=e.find(r=>r.id===t.id),a=n&&!t.messages&&typeof t.threadId=="string"&&t.threadId!==n.threadId?xX(t):t;return n?e.map(r=>r.id===a.id?{...r,...a,section:typeof a.threadId=="string"||Object.hasOwn(a,"section")?a.section:r.section,description:Object.hasOwn(a,"description")?a.description??void 0:r.description,tasks:a.tasks?qm(r.tasks,a.tasks):r.tasks,turnTimeoutMinutes:Object.hasOwn(a,"turnTimeoutMinutes")?a.turnTimeoutMinutes??void 0:r.turnTimeoutMinutes,messages:a.messages??r.messages,hasMore:a.messages?!!a.hasMore:r.hasMore}:r):[{...a.description===null?{...a,description:void 0}:a,messages:a.messages??[]},...e]}function yX(e,{group:t,since:n,heldAtStart:a}){if(!t.messages||!t.threadId)return t;if((e.transcriptGeneration[t.threadId]??0)!==(n[t.threadId]??0))return null;const r=e.groups.find(i=>i.id===t.id);return r?.threadId===t.threadId?{...t,messages:gX(r.messages,new Set(a),t.messages)}:t}function kX(e,t){const n=new Map;return(a,r)=>{const i=(n.get(a)??0)+(r?1:0);n.set(a,i);const{transcriptGeneration:o,groups:c}=e(),d=c.find(u=>u.id===a)?.messages??[];return u=>{u?.group&&n.get(a)===i&&t({type:"groupSnapshot",group:u.group,since:o,heldAtStart:d})}}}function vX(e,t){if("botId"in e){const o=t.bots.find(u=>u.id===e.botId);if(!o)return;const{messages:c,...d}=o;return{type:"botPatched",bot:d}}const n=t.groups?.find(o=>o.id===e.groupId);if(!n)return;const{messages:a,hasMore:r,...i}=n;return{type:"groupPatched",group:i}}const $4=new WeakMap;function zs(e){const t=e.activeLeafId;if(!t)return e.messages;const n=$4.get(e.messages);if(n?.leafId===t)return n.path;const a=new Map(e.messages.map(o=>[o.id,o]));if(!a.has(t))return e.messages;const r=[];let i=a.get(t);for(;i;)r.push(i),i=i.parentId?a.get(i.parentId):void 0;return r.reverse(),$4.set(e.messages,{leafId:t,path:r}),r}function B4(e,t,n){return e!==void 0&&(e.switchingTo!==void 0||(n[e.threadId]??0)!==(t?.[e.threadId]??0))}function qA(e,t,n){if(!n)return t;const a=new Set(t?.map(i=>i.threadId)),r=e?.filter(i=>!n.has(i.threadId)&&!a.has(i.threadId))??[];return r.length?[...t??[],...r]:t}function wX(e,t,n,a){return!n||!e?t:{...t,threadId:e.threadId,tasks:qA(e.tasks,t.tasks,a),switchingTo:e.switchingTo,awaitingThreadSnapshot:e.awaitingThreadSnapshot,messages:e.messages,hasMore:e.hasMore,activeLeafId:e.activeLeafId,pinnedMessageId:e.pinnedMessageId}}function jX(e,t,n,a){return!n||!e?t:{...t,threadId:e.threadId,tasks:qA(e.tasks,t.tasks,a),messages:e.messages,hasMore:e.hasMore,pinnedCwd:e.pinnedCwd,pinnedMessageId:e.pinnedMessageId,usage:e.usage,memberContext:e.memberContext,busyBotId:e.busyBotId,turnStartedAt:e.turnStartedAt}}const NX=["ask","edits","auto","full","custom"];function l2(e,t){return t==="custom"?e==="codex":t==="edits"?["claudeAgent","grokAgent","antigravityAgent","qwenAgent","geminiAgent"].includes(e??""):!0}function F4(e,t,n){return!l2(n,e)||e==="custom"&&t!==n}function SX(e){return["codex","claudeAgent","cursorAgent","grokAgent","qwenAgent"].includes(e??"")}function IX(e){return typeof e=="string"&&NX.includes(e)}const CX="full";let EX=CX;function En(e){const t=e.approvalGrant,n=t&&typeof t=="object"&&"threadOnly"in t&&t.threadOnly===!0&&"threadId"in t&&typeof t.threadId=="string"&&typeof e.threadId=="string"&&t.threadId!==e.threadId;return t&&!n?"ask":IX(e.approvalMode)?e.approvalMode:e.autoApprove===!0?"auto":e.approvalMode===void 0?EX:"ask"}function HA(e,t){return!e||!t?e===t:e.instanceId===t.instanceId&&e.model===t.model&&e.effort===t.effort&&e.variant===t.variant}function WA(e,t){return t.filter(n=>n.followsBotModel===!1&&!HA(n.modelSelection??e,e))}const zx=f.createContext(null);function KA(e){return e==="enable"||e==="disable"||e==="delete"}function c2(e){if(!(!e.preview||!e.sha256||!/^[a-f0-9]{64}$/i.test(e.sha256)))return e.sha256}function AX(e){const t=e.trim().toLowerCase();return["enable","turn on","turn off","delete","update","apply","allow","allow once","confirm","yes"].includes(t)?"allow":"deny"}function TX(e){const t={...Object.hasOwn(e,"toolScope")?{toolScope:e.toolScope}:{},...PJ(e)?{}:{helperModel:!1}};return{...e.visibility&&e.visibility!=="everyone"?{visibility:e.visibility}:{},...Object.keys(t).length?{settings:t}:{}}}function MX(e){return{name:`${e.name} copy`,title:e.title,description:e.description,soul:e.soul,notifications:e.notifications,modelSelection:e.modelSelection,computer:e.computer,cloudBackend:e.cloudBackend,autoStartVps:e.autoStartVps,vpsAlias:e.vpsAlias,avatarUrl:e.avatarUrl,avatarCrop:e.avatarCrop,avatarZoom:e.avatarZoom,avatarFocusX:e.avatarFocusX,avatarFocusY:e.avatarFocusY}}const VA=()=>globalThis.ogb?.companion??null,_X=()=>typeof window<"u"&&!!window.ogb?.companion&&window.ogb?.remoteClient?.active!==!0,Px="steer";function R0(e){if(!e.running)return null;if(!e.canSteer)return"queue";const t=e.preferred??Px;return e.alternate?t==="queue"?"steer":"queue":t}function RX(e,t){const n=R0({running:!0,alternate:!1,preferred:e,canSteer:t}),a=R0({running:!0,alternate:!0,preferred:e,canSteer:t});return[...new Set([n,a,"restart"])]}const O0=[{category:"Navigation",items:[{id:"command-palette",description:"Open command palette (switcher & transcript search)",macKeys:["⌘","K"],winKeys:["Ctrl","K"]},{id:"new-bot",description:"Create a new bot",macKeys:["⌘","N"],winKeys:["Ctrl","N"]},{id:"new-thread",description:"Start a new thread with the selected bot",macKeys:["⌘","⇧","N"],winKeys:["Ctrl","Shift","N"]},{id:"jump-bot",description:"Jump to bot 1–9 in the roster",macKeys:["⌘","1–9"],winKeys:["Ctrl","1–9"]},{id:"toggle-sidebar",description:"Collapse or expand the sidebar",macKeys:["⌘","\\"],winKeys:["Ctrl","\\"]},{id:"switch-bot",description:"Switch to previous / next bot",macKeys:["⌘","⇧","[ / ]"],winKeys:["Ctrl","Shift","[ / ]"]},{id:"find-conversation",description:"Find in conversation",macKeys:["⌘","F"],winKeys:["Ctrl","F"]}]},{category:"Chat & Composer",items:[{id:"send-message",description:"Send message",macKeys:["Return"],winKeys:["Enter"]},{id:"new-line",description:"Insert new line without sending",macKeys:["⇧","Return"],winKeys:["Shift","Enter"]},{id:"send-follow-up",description:"While a bot works: queue instead of steering, or the other way round",macKeys:["⌘","Return"],winKeys:["Ctrl","Enter"]},{id:"edit-last-message",description:"Edit last message (when composer is empty)",macKeys:["↑"],winKeys:["↑"]},{id:"close-panel",description:"Close active drawer, modal, or find bar",macKeys:["Esc"],winKeys:["Esc"]},{id:"shortcuts-cheat-sheet",description:"Show keyboard shortcuts cheat sheet",macKeys:["⌘","/"],winKeys:["Ctrl","/"]}]},{category:"Calls",items:[{id:"live-call-mute",description:"Mute or unmute a Live call",macKeys:["⌘","⇧","M"],winKeys:["Ctrl","Shift","M"]},{id:"live-call-hang-up",description:"Hang up a Live call",macKeys:["⌘","⇧","H"],winKeys:["Ctrl","Shift","H"]}]},{category:"Management & Groups",items:[{id:"save-bulletin",description:"Save group instruction changes",macKeys:["⌘","Return"],winKeys:["Ctrl","Enter"]},{id:"reorder-section",description:"Reorder sidebar sections (focus a section heading)",macKeys:["⌥","↑ / ↓"],winKeys:["Alt","↑ / ↓"]}]}],OX={Navigation:"shortcuts.category.navigation","Chat & Composer":"shortcuts.category.chat",Calls:"shortcuts.category.calls","Management & Groups":"shortcuts.category.groups"},LX=e=>{const t=`shortcuts.${e.id}`;return Object.hasOwn(Ia,t)?l(t):e.description},zX=e=>{const t=OX[e.category];return t?l(t):e.category},U4={macKeys:["Return"],winKeys:["Enter"]},PX={macKeys:["⇧","Return"],winKeys:["Shift","Enter"]},q4={macKeys:["⌘","Return"],winKeys:["Ctrl","Enter"]},DX={"shift-enter":[PX,U4,q4],"mod-enter":[q4,U4,{macKeys:["⌘","⇧","Return"],winKeys:["Ctrl","Shift","Enter"]}]};function yDe(e){if(e==="enter")return O0;const[t,n,a]=DX[e];return O0.map(r=>({...r,items:r.items.map(i=>i.id==="send-message"?{...i,...t}:i.id==="new-line"?{...i,...n}:i.id==="send-follow-up"?{...i,...a}:i)}))}function $X(e){return!e.defaultPrevented&&e.key==="\\"&&(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey}function BX(e){return e.key==="]"||e.key==="}"?1:e.key==="["||e.key==="{"?-1:null}function FX(e){if(e.defaultPrevented||e.isComposing||e.altKey)return!1;const t=e.key==="?"&&!e.metaKey&&!e.ctrlKey,n=e.key==="/"&&(e.metaKey||e.ctrlKey)&&!e.shiftKey;if(!t&&!n)return!1;const a=e.target;return!(a instanceof HTMLElement&&(a.isContentEditable||a.closest("input, textarea, select, dialog, [role=dialog]")))}function Tr(){return typeof window<"u"&&window.ogb?.platform?window.ogb.platform==="darwin":typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.includes("Mac"):!0}function GA(e,t=Tr()){return t?e.macKeys:e.winKeys}function kDe(e,t,n=Tr()){const a=t.trim().toLowerCase();return a?e.map(r=>{const i=r.items.filter(o=>{const c=GA(o,n).join(" ").toLowerCase();return LX(o).toLowerCase().includes(a)||zX(r).toLowerCase().includes(a)||c.includes(a)});return{...r,items:i}}).filter(r=>r.items.length>0):[...e]}const d2="omb-follow-up";function UX(e){return e==="queue"||e==="steer"?e:Px}function qX(e,t){const n=e.ctrlKey||e.metaKey;return t==="mod-enter"?n&&e.shiftKey:n}function HX(e,t=Tr()){const n=t?"⌘":"Ctrl";return e==="mod-enter"?`${n}+Shift+Enter`:`${n}+Enter`}let Wf;const pl=new Set;function u2(){try{return globalThis.localStorage}catch{return}}function YA(){if(Wf!==void 0)return Wf;try{return UX(u2()?.getItem(d2))}catch{return Px}}function H4(e){if(!(e.key!==d2&&e.key!==null)&&!(e.storageArea&&e.storageArea!==u2())){Wf=void 0;for(const t of pl)t()}}function WX(e){return pl.add(e),pl.size===1&&typeof window<"u"&&window.addEventListener("storage",H4),()=>{pl.delete(e),pl.size===0&&typeof window<"u"&&window.removeEventListener("storage",H4)}}function KX(e){Wf=e;try{u2()?.setItem(d2,e)}catch{}for(const t of pl)t()}function VX(){return f.useSyncExternalStore(WX,YA,()=>Px)}function iu(e){const t=[];let n=e.replace(/\r\n?/g,`
3
3
  `).replace(/\\([\\`*_{}[\]()#+\-.!|>~])/g,(i,o)=>(t.push(o),`${t.length-1}`));const a=[],r=i=>(a.push(i.replace(/\uE000(\d+)\uE001/g,(o,c)=>`\\${t[Number(c)]??""}`)),`${a.length-1}`);return n=n.replace(/^[ \t]*((`|~)\2{2,})[^\n]*(?:\n([\s\S]*?))?(?:\n[ \t]*\1\2*[ \t]*(?=\n|$(?![\s\S]))|$(?![\s\S]))/gm,(i,o,c,d)=>`
4
4
  ${r(d??"")}
5
5
  `),n=n.replace(/(`+)([^`]*?)\1/g,(i,o,c)=>r(c)),n=n.replace(/!\[([^\]]*)\]\((?:[^()]|\([^)]*\))*\)/g,"$1"),n=n.replace(/!\[([^\]]*)\]\[[^\]]*\]/g,"$1"),n=n.replace(/\[([^\]]+)\]\((?:[^()]|\([^)]*\))*\)/g,"$1"),n=n.replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1"),n=n.replace(/^[ \t]{0,3}\[[^\]]+\]:[ \t]+\S+.*$/gm,""),n=n.replace(/<((?:https?|mailto):[^>\s]+)>/gi,"$1"),n=n.replace(/<br\s*\/?>/gi," "),n=n.replace(/<\/?(?:b|strong|i|em|u|s|del|ins|mark|code|kbd|sub|sup|small|span|p|div)\b[^>]*>/gi,""),n=n.replace(/^[ \t]{0,3}#{1,6}[ \t]+/gm,""),n=n.replace(/^[ \t]{0,3}#{1,6}[ \t]*$/gm,""),n=n.replace(/^[ \t]*(?:>[ \t]?)+/gm,""),n=n.replace(/^[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/gm,""),n=n.replace(/^[ \t]*\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)*\|?[ \t]*$/gm,""),n=n.replace(/^[ \t]{0,3}(?:[-*_][ \t]*){3,}$/gm,""),n=n.replace(/^[ \t]*\|(.*)\|[ \t]*$/gm,(i,o)=>o.split("|").map(c=>c.trim()).filter(Boolean).join(" ")),n=n.replace(/(\*{1,3})(?=\S)([\s\S]*?\S)\1/gu,"$2"),n=n.replace(/(_{1,3})(?=\S)([\s\S]*?\S)\1(?![\p{L}\p{N}])/gu,(i,o,c,d,u)=>/[\p{L}\p{N}]$/u.test(u.slice(0,d))?i:c),n=n.replace(/~~(?=\S)([\s\S]*?\S)~~/g,"$1"),n=n.replace(/\*\*+|`{3,}|~~/g,""),n=n.replace(/\uE002(\d+)\uE003/g,(i,o)=>a[Number(o)]??""),n=n.replace(/\uE000(\d+)\uE001/g,(i,o)=>t[Number(o)]??""),n.replace(/\s+/g," ").trim()}let L0=null;function GX(e){L0=e}async function YX(){if(typeof Notification>"u")return null;try{return Notification.permission==="default"?await Notification.requestPermission():Notification.permission}catch{return Notification.permission}}function JX(e){return{tag:`openmausbot:${e.id}`,icon:e.avatarUrl??void 0}}function QX(e,t,n,a){if(typeof Notification>"u"||e.kind==="done"&&!s2())return;const r=e.kind==="spend";if(!r&&document.hasFocus()&&a===e.threadId||Notification.permission!=="granted")return;const i=L0?`${L0} · ${e.title}`:e.title,o=iu(e.body),c={body:o,...JX({id:e.botId,avatarUrl:n}),...r?{tag:"openmausbot:spend",icon:void 0}:{},...t2()?{}:{silent:!0}},d=()=>{new Notification(i,c).onclick=()=>{window.focus(),t({botId:e.botId,threadId:e.threadId})}},u=window.ogb?.desktopNotifications;if(!u)return d();u.show({title:i,body:o,tag:c.tag,silent:c.silent===!0,picture:c.icon,botId:e.botId,threadId:e.threadId}).then(p=>{p||d()},d)}let ou=null,W4=!1;const z0=new Set;function Dx(){const e=typeof window>"u"||window.ogb?.remoteClient?.active?void 0:window.ogb?.workspaces;return e?.look?e:void 0}function JA(e){ou=e;for(const t of z0)t(ou)}function i1(){const e=Dx();return e?.look?e.look().then(t=>JA(t??null),()=>{}):Promise.resolve()}function XX(){W4||(W4=!0,Dx()?.onChanged?.(()=>{i1()}),window.addEventListener("focus",()=>{i1()}),i1())}function QA(){const[e,t]=f.useState(ou);return f.useEffect(()=>{if(Dx())return z0.add(t),XX(),t(ou),()=>{z0.delete(t)}},[]),e}async function ZX(e){const t=Dx();if(!t?.color)return"failed";const n=await t.color(e).catch(()=>null);return n?(JA(n.look??ou),n.outcome):"failed"}function eZ(e){const t=s7(e);return t?{"--place-tint":`var(--identity-${t})`}:null}const p2="omb-send-key";function m2(e=tt()){return e==="ja"||e.startsWith("ja-")?"mod-enter":"enter"}function tZ(e,t=m2()){return yq.find(n=>n===e)??t}function qs(e){return e.isComposing||e.keyCode===229}function $x(e,t){return e.key!=="Enter"||qs(e)?!1:e.ctrlKey||e.metaKey?!0:t==="enter"?!e.shiftKey:t==="shift-enter"&&e.shiftKey}function f2(e,t=Tr()){return e==="enter"?"Enter":e==="shift-enter"?"Shift+Enter":t?"⌘+Enter":"Ctrl+Enter"}let Kf;const ld=new Set;function h2(){try{return globalThis.localStorage}catch{return}}function XA(){if(Kf!==void 0)return Kf;try{return tZ(h2()?.getItem(p2))}catch{return m2()}}function ZA(){for(const e of ld)e()}function K4(e){e.key!==p2&&e.key!==null||e.storageArea&&e.storageArea!==h2()||(Kf=void 0,ZA())}function nZ(e){return ld.add(e),ld.size===1&&typeof window<"u"&&window.addEventListener("storage",K4),()=>{ld.delete(e),ld.size===0&&typeof window<"u"&&window.removeEventListener("storage",K4)}}function sZ(e){Kf=e;try{h2()?.setItem(p2,e)}catch{}ZA(),n7()}function Zu(){return f.useSyncExternalStore(nZ,XA,()=>m2())}const x2="omb-color-user-bubbles";let Vf;const cd=new Set;function g2(){try{return globalThis.localStorage}catch{return}}function P0(){if(Vf!==void 0)return Vf;try{return g2()?.getItem(x2)!=="0"}catch{return!0}}function eT(){for(const e of cd)e()}function V4(e){e.key!==x2&&e.key!==null||e.storageArea&&e.storageArea!==g2()||(Vf=void 0,eT())}function aZ(e){return cd.add(e),cd.size===1&&typeof window<"u"&&window.addEventListener("storage",V4),()=>{cd.delete(e),cd.size===0&&typeof window<"u"&&window.removeEventListener("storage",V4)}}function rZ(e){Vf=e;try{g2()?.setItem(x2,e?"1":"0")}catch{}eT()}function iZ(){return f.useSyncExternalStore(aZ,P0,P0)}const Js=()=>typeof window>"u"?void 0:window.ogb,Gf=()=>_X()?VA():null,o1=e=>({read:async()=>(await Gf()?.state())?.routes?.[e]?.on,write:t=>{const n=Gf();if(n)return e==="tailscale"?n.setTailscale?n.setTailscale(t):t?n.refreshTailscale():n.state():n.setRoute?n.setRoute(e,t):t?n.start([e]):n.state()}}),D0={"appearance.skin":{read:()=>Rq(),write:e=>_q(e)},"appearance.advanced":{read:()=>r7(),write:e=>a7(e)},"appearance.font":{read:()=>Mq(),write:e=>Tq(e)},"appearance.chatWidth":{read:()=>Aq(),write:e=>Eq(e)},"general.sendKey":{read:()=>XA(),write:e=>sZ(e)},"general.notificationSounds":{read:()=>t2(),write:e=>GQ(e)},"appearance.userBubbles":{read:()=>P0(),write:e=>rZ(e)},"appearance.runCard":{read:()=>Cq(),write:e=>Iq(e)},"appearance.showThreads":{read:()=>Sq(),write:e=>Nq(e)},"appearance.toolsLayout":{read:()=>mA(),write:e=>YJ(e)},"appearance.pinnedCircles":{read:()=>gA(),write:e=>rQ(e)},"appearance.universalPins":{read:()=>vA(),write:e=>mQ(e)},"appearance.pinnedPages":{read:()=>f0().flatMap(e=>e.url===void 0?[]:[{name:e.name,url:e.url}]),write:e=>{const t=f0().filter(n=>n.url===void 0);for(const n of e){const a=wq(n,window.location.origin);if(!a.ok)return;t.push({id:jq(t),name:a.name,url:a.url})}pw(t)}},"appearance.showComputers":{read:async()=>{const e=await Js()?.rail?.state?.();return e?.available?!e.hidden:void 0},write:e=>Js()?.rail?.setHidden?.(!e)},"appearance.windowFrame":{read:async()=>(await Js()?.windowFrame?.state())?.on,write:e=>Js()?.windowFrame?.set(e)},"appearance.sidebarColor":{read:async()=>{const t=await(Js()?.remoteClient?.active?void 0:Js()?.workspaces)?.look?.();return t?.change?t.swatch??"none":void 0},write:e=>ZX(e==="none"?null:e)},"general.followUp":{read:()=>YA(),write:e=>KX(e)},"general.finishedNotifications":{read:()=>s2(),write:async e=>{if(!e)return P4(!1);await YX()==="granted"&&P4(!0)}},"general.notificationFeed":{read:()=>TA(),write:e=>YQ(e)},"general.analytics":{read:()=>TH(),write:e=>AH(e)},"general.openAtLogin":{read:async()=>{const e=await Js()?.openAtLogin?.state();return e?.available?e.on:void 0},write:e=>Js()?.openAtLogin?.set(e)},"general.talkShortcut":{read:async()=>{const e=await Js()?.talkShortcut?.state();return e?.available?{enabled:e.enabled,key:e.key}:void 0},write:e=>Js()?.talkShortcut?.set(e)},"account.productEmails":{read:async()=>{const e=await Js()?.updatesConsent?.state();return e?.available?e.status==="opted_in":void 0},write:e=>Js()?.updatesConsent?.choose({status:e?"opted_in":"withdrawn"})},"remote.wifi":o1("wifi"),"remote.relay":o1("relay"),"remote.tailscale":o1("tailscale"),"remote.keepAwake":{read:async()=>(await Gf()?.state())?.keepAwake,write:e=>Gf()?.keepAwake(e)}};function oZ(e){const t=vq[e.id]?.safeParse(e.value);t?.success&&Promise.resolve(D0[e.id].write(t.data)).catch(()=>{}).finally(tT)}async function lZ(){const e=Object.keys(D0),t=await Promise.all(e.map(n=>Promise.resolve().then(()=>D0[n].read()).catch(()=>{})));return Object.fromEntries(e.flatMap((n,a)=>t[a]===void 0?[]:[[n,t[a]]]))}let Dp=null;function tT(){typeof fetch!="function"||typeof window>"u"||(Dp&&clearTimeout(Dp),Dp=setTimeout(()=>{Dp=null,lZ().then(e=>fetch("/api/window-prefs",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({values:e})})).catch(()=>{})},200))}kq(tT);const cZ=/^\[(?:From @([^·\]]+?) \(bot\) · (message|assignment) · |(Message from|Delegated by|Thread opened by) @([^,\]]+), another bot in this OpenMausBot workspace)[^\]]*\]\s*/,dZ={message:"ask_bot",assignment:"delegate_bot","Message from":"ask_bot","Delegated by":"delegate_bot","Thread opened by":"start_thread"};function Ws(e){if(e.role!=="user")return null;const t=e.text??"",n=cZ.exec(t),a=e.peerAsk?.name??(n?.[1]??n?.[4])?.trim();return a?{botId:e.peerAsk?.botId,name:a,delivery:n&&dZ[n[2]??n[3]??""]||"ask_bot",body:n?t.slice(n[0].length):t,...e.peerAsk?.unattended?{unattended:!0}:{}}:null}function lu(e,t){if(e.role!=="bot"||e.roomRequest?.phase!=="request")return null;const n=e.from;return!n?.name||n.botId===t?null:{botId:n.botId,name:n.name,delivery:"coordinate_bots",body:e.text??""}}const uZ=e=>e.role==="user"&&!Ws(e);function pZ(e,t){let n=-1;for(let a=e.length-1;a>=0&&n<0;a--)uZ(e[a])&&(n=a);return t&&(n=Math.max(n,e.findIndex(a=>a.id===t))),n<0?null:e[n+1]?.id??null}function nT(e,t,n,a){const r=pZ(t,n);return r?{threadId:e,messageId:r}:a?{threadId:e,messageId:null,lastReadMessageId:n}:null}function Hm(e,t,n,a){return!e||e.threadId!==t||e.messageId?e:nT(t,n,e.lastReadMessageId,a)}function G4(e){return e.tasks?.find(t=>t.threadId===e.threadId)?.lastReadMessageId}function sT(e,t){if(!t)return null;const n=e.findIndex(a=>a.id===t);return n<0?null:new Set(e.slice(n).map(a=>a.id))}function Y4(e){const t=e.tasks?.find(n=>n.threadId===e.threadId);return t?.routineRunId?!1:!!(t?.unread??e.unread)}const mZ=1200,aT=480,fZ=new Set(["browser","local","vm","cloud"]);function rT(e){const t=e;if(!t||typeof t!="object")return null;const{botId:n,threadId:a,messageId:r,site:i,place:o}=t;return typeof n=="string"&&typeof a=="string"&&typeof r=="string"&&typeof i=="string"&&typeof o=="string"&&fZ.has(o)?{botId:n,threadId:a,messageId:r,site:i,place:o}:null}async function vDe(e){const{action:t,syncNativeBrowser:n,requestControl:a,setNativeBrowserControl:r}=e;if(t==="take"&&n&&!await r(!0))throw new Error(l("computer.err.pauseBrowser",{app:zt()}));const i=await a(t);if(i.held!==(t==="take"))throw new Error(l(t==="take"?"computer.err.confirmControl":"computer.err.releaseControl",{app:zt()}));if(t==="release"&&n&&!await r(!1))throw new Error(l("computer.err.browserStillPaused"));return i}const hZ="The user closed this question without answering. Use your best judgment and continue.",J4=120,b2=2e3;function xZ(e){return!!(e&&(e.requestType==="question"||e.questionRequest||!e.requestType&&!e.tool&&!e.routineRequest&&!e.skillRequest&&!e.profileRequest&&!e.modelRequest&&!e.teamSetupRequest))}function Q4(e,t){if(typeof e!="string")return;const n=e.trim();return n?n.slice(0,t).trim():void 0}function gZ(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bZ=5;function yZ(e,t=bZ){if(!Array.isArray(e))return;const n=[],a=new Set;for(const r of e){const i=typeof r=="string"?Q4(r,J4):gZ(r)?Q4(r.label,J4):void 0;if(!(!i||a.has(i))&&(a.add(i),n.push(i),n.length===t))break}return n.length?n:void 0}function kZ(e){if(e.length!==1)return;const t=e[0];if(!(t.multiSelect||t.options.length<2))return t.options.map(n=>n.label)}const Yf="The user answered your questions.",$0=`${Yf}
@@ -15,7 +15,7 @@ A: ${r}`).join(`
15
15
  `)?e.slice(Yf.length+2):e}function vZ(e,t){return wZ(e,t.map(n=>({id:n.question,question:n})))}function wZ(e,t){const n=Object.create(null),a=new Map,r=new Set;for(const{id:u,question:p}of t){if(a.has(p.question)){r.add(p.question);continue}a.set(p.question,u)}if(e.startsWith($0)){let u;try{u=JSON.parse(e.slice($0.length))}catch{return{}}if(!Array.isArray(u)||!u.every(p=>Array.isArray(p)&&p.length===2&&p.every(m=>typeof m=="string")))return{};for(const[p,m]of u){const h=a.get(p);h&&!r.has(p)&&m.trim()&&(n[h]=m)}return n}const i=e.matchAll(/(?:^|\n\n)Q: ([\s\S]+?)\nA: ([\s\S]*?)(?=\n\nQ: |$)/g);let o=!1;for(const u of i){o=!0;const p=u[1].trim();if(r.has(p))continue;const m=a.get(p),h=u[2].trim();m&&h&&(n[m]=h)}if(Object.keys(n).length)return n;if(o)return{};const c=t.length===1?t[0]:void 0,d=e.trim();return c&&d?{[c.id]:d}:{}}function jZ(e,t){return e.tool?{behavior:t==="Deny"?"deny":"allow"}:{behavior:"answer",message:t}}function iT(e){return e.tool?{behavior:"deny",message:"Dismissed by user."}:{behavior:"answer",message:hZ,dismiss:!0}}const X4="error:";function _a(e){return e.startsWith(X4)?e.slice(X4.length).trim():null}const oT="stopped:",lT=`${oT} You stopped this.`;function Bx(e){return e.startsWith(oT)}const NZ=/^provider returned a(?: streaming)? completion error:\s*/i,SZ=[/^context\s+canceled\.?$/i,/^(?:context\s+canceled)?\s*the\s+request\s+was\s+cancell?ed\s+by\s+the\s+client\.?$/i,/^(?:(?:the|this)\s+)?operation\s+was\s+aborted\.?$/i,/^(?:the\s+)?request\s+was\s+aborted\.?$/i,/^the\s+user\s+aborted\s+a\s+request\.?$/i];function IZ(e){const t=e.trim().replace(NZ,"").trim();return t&&SZ.some(n=>n.test(t))?t:null}function cu(e){return IZ(e)!==null}function Vl(e){return e.role==="user"?!1:e.kind==="text"?!e.attachments?.length&&cu(e.text??""):e.kind==="activity"&&e.tool?Bx(e.tool.name)||cu(_a(e.tool.name)??""):!1}const CZ=1e3,ti=new Map,F0=new Map,$p=new Map,cT=new Map,U0=new Set,Jf=()=>{for(const e of Array.from(U0))e()},dT=e=>(U0.add(e),()=>{U0.delete(e)});function EZ(e){if(e.turnId){if(e.type==="turn.started")ti.set(e.threadId,e.turnId),F0.set(e.threadId,(F0.get(e.threadId)??0)+1);else if(e.type==="turn.completed"&&ti.get(e.threadId)===e.turnId)ti.delete(e.threadId);else return;Jf()}}function AZ(){ti.clear(),Jf()}function uT(e){return F0.get(e)??0}function TZ(e){return f.useSyncExternalStore(dT,()=>ti.get(e),()=>{})}function MZ(e,t,n){const a=t.threadId??`bot:${t.botId}`,r=Date.now(),i=$p.get(a);if(i!==void 0&&r-i<CZ)return;$p.set(a,r);const o=t.threadId?ti.get(t.threadId):void 0;e(`/api/bots/${t.botId}/interrupt`,{method:"POST",body:t.threadId?JSON.stringify({threadId:t.threadId,...o?{turnId:o}:{}}):void 0}).then(c=>{const d=c?.outcome==="already-stopped";!d&&t.threadId&&(cT.set(t.threadId,r),Jf()),d&&t.threadId&&ti.get(t.threadId)===o&&(ti.delete(t.threadId),Jf())}).catch(c=>{$p.get(a)===r&&$p.delete(a),n(c),t.onError?.()})}function _Z(e){return f.useSyncExternalStore(dT,()=>cT.get(e),()=>{})}function RZ(e,t,n){if(n||t===void 0)return!1;const a=e.findLastIndex(r=>r.role==="user");return a<0||e[a].at>t?!1:!e.slice(a+1).some(r=>r.kind==="text"||Vl(r))}const pT="openmausbot.lastConversation.v1";function OZ(){try{return globalThis.localStorage?.getItem(pT)?.trim()||null}catch{return null}}function LZ(e){try{globalThis.localStorage?.setItem(pT,e)}catch{}}const mT="openmausbot.lastBotSection.v1",zZ=["overview","identity","slack","soul","skills","memory","library","routines","access","model","permissions","voice","visibility","history","usage"];function PZ(){try{const e=globalThis.localStorage?.getItem(mT);return e&&zZ.includes(e)?e:null}catch{return null}}function DZ(e){try{globalThis.localStorage?.setItem(mT,e)}catch{}}function ya(){const e=globalThis.crypto;if(typeof e?.randomUUID=="function")return e.randomUUID();const t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let a=0;a<t.length;a+=1)t[a]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=Array.from(t,a=>a.toString(16).padStart(2,"0"));return`${n.slice(0,4).join("")}-${n.slice(4,6).join("")}-${n.slice(6,8).join("")}-${n.slice(8,10).join("")}-${n.slice(10).join("")}`}const $Z=/^«redacted \d+ chars»$/,Or=e=>$Z.test(e)?e:`«redacted ${e.length} chars»`,fT=[/\bom[dg]_[A-Za-z0-9_-]{43}(?![A-Za-z0-9_-])/g,/\bsk-(?:ant-|proj-|live-|test-)?[A-Za-z0-9_-]{16,}/g,/\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{16,}/g,/\bxai-[A-Za-z0-9_-]{20,}/g,/\bgsk_[A-Za-z0-9]{40,}/g,/\bcsk-[A-Za-z0-9]{32,}/g,/\bLLM\|\d{6,}\|[A-Za-z0-9_-]{16,}/g,/\bhf_[A-Za-z0-9]{30,}/g,/\bpypi-AgE[A-Za-z0-9_-]{82,}/g,/\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{20,}/g,/\bgithub_pat_[A-Za-z0-9_]{20,}/g,/\bgl(?:pat|dt|rtr?)-[A-Za-z0-9_-]{20,}(?:\.[A-Za-z0-9_-]+)*/g,/\bxox[abposr]-[A-Za-z0-9-]{20,}/g,/\bxapp-\d-[A-Za-z0-9-]{20,}/g,/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,/\bAIza[0-9A-Za-z_-]{30,}/g,/\bnpm_[A-Za-z0-9]{20,}/g,/\bwhsec_[A-Za-z0-9_-]{20,}/g,/\bSG\.[A-Za-z0-9_-]{22}\.[A-Za-z0-9_-]{43}(?![A-Za-z0-9_-])/g,/\bbak_[A-Za-z0-9_-]{20,}/g,/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g];fT.map(e=>new RegExp(e.source));const BZ=/(\bBearer\s+)([A-Za-z0-9._~+/=-]{12,})/g,FZ=/(\bAuthorization["']?\s*[:=]\s*["']?Basic\s+)([A-Za-z0-9+/]{4,}={0,2})(?![A-Za-z0-9._~+/=-])/gi,UZ=/(-----BEGIN [A-Z ]*PRIVATE KEY-----)([\s\S]*?)(-----END [A-Z ]*PRIVATE KEY-----)/g,qZ=/\b((?:[A-Za-z0-9_-]*_)?(?:api[_-]?key|apikey|secret|token|password|passwd|authorization|auth[_-]?token|access[_-]?key|private[_-]?key)s?)(["']?\s*[=:]\s*)(["']?)([A-Za-z0-9._~+/=-]{8,})\3/gi,HZ=/\b([A-Za-z][A-Za-z0-9_-]*[_-]key)s?(=)(["']?)([A-Za-z0-9._~+/=-]+)\3/gi,WZ=/(--(?:token|password|passwd|api-key|apikey|secret|access-key|auth-token)(?:=|\s+))(["']?)(?!-)([A-Za-z0-9._~+/=-]+)\2/gi,KZ=/(\b[a-z][a-z0-9+.-]*:\/\/[^\s/:@'"]+:)([^\s/@'"«»]+)(@)/gi,Z4=new Set;function VZ(e){if(!e||Z4.size===0)return e;let t=e;for(const n of Z4)t=n(t);return t}function GZ(e){if(!e)return e;const t=VZ(e);if(t.length<8)return t;let n=t;n=n.replace(UZ,(a,r,i,o)=>`${r}
16
16
  ${Or(i.trim())}
17
17
  ${o}`);for(const a of fT)n=n.replace(a,r=>Or(r));return n=n.replace(BZ,(a,r,i)=>`${r}${Or(i)}`),n=n.replace(FZ,(a,r,i)=>`${r}${Or(i)}`),n=n.replace(qZ,(a,r,i,o,c)=>`${r}${i}${o}${Or(c)}${o}`),n=n.replace(HZ,(a,r,i,o,c)=>`${r}${i}${o}${Or(c)}${o}`),n=n.replace(WZ,(a,r,i,o)=>`${r}${i}${Or(o)}${i}`),n=n.replace(KZ,(a,r,i,o)=>`${r}${Or(i)}${o}`),n}function hT(e){return $a().source==="file"?!1:!e||e.team?!0:!e.companyModelsOnly&&(e.allowedEngines==="all"||e.allowedEngines.includes("modelgo"))}const k2="https://modelgo.ai/?utm_source=openmausbot&utm_medium=sponsorship&utm_content=app&campaign_id=openmausbot&ad_group_id=app",YZ=[{id:"ai",titleKey:"keys.section.ai",purposeKey:"keys.section.ai.purpose"},{id:"servers",titleKey:"keys.section.servers",purposeKey:"keys.section.servers.purpose"},{id:"voice",titleKey:"keys.section.voice",purposeKey:"keys.section.voice.purpose"},{id:"computers",titleKey:"keys.section.computers",purposeKey:"keys.section.computers.purpose"},{id:"apps",titleKey:"keys.section.apps",purposeKey:"keys.section.apps.purpose"},{id:"helpers",titleKey:"keys.section.helpers",purposeKey:"keys.section.helpers.purpose"}];function Nn(e){return{configured:e?.configured===!0,...e?.configured&&e.last4?{last4:e.last4}:{}}}function ma(e,t){return{patch:n=>({[e]:{key:n}}),saved:n=>Nn(n[e]),...t}}const l1=/^sk-(proj|svcacct|admin)-/,Xn=(e,t)=>({driverKind:e,...t?{preset:t}:{}}),xT=[{id:"openai",section:"ai",labelKey:"keys.openai.label",purposeKey:"keys.purpose.openaiModelsVoice",name:"OpenAI",env:["OMB_OPENAI_API_KEY"],words:["openai","chatgpt","gpt","live calls"],mark:Xn("openai-compat","openai"),kind:"key",target:ma("openai",{slot:"openaiApiKey",placeholder:"sk-…",href:"https://platform.openai.com/api-keys",test:"openai",analytics:"openai",shape:l1,noteKey:"keys.openai.note"})},{id:"anthropic",section:"ai",labelKey:"keys.anthropic.label",purposeKey:"keys.purpose.anthropic",name:"Anthropic",env:["OMB_ANTHROPIC_API_KEY"],words:["anthropic","claude"],mark:Xn("claudeAgent","anthropic"),kind:"key",target:{patch:(e,t)=>({anthropic:{key:e,...t&&e?{everyClaudeBot:!1}:{}}}),saved:e=>Nn(e.anthropic),slot:"anthropicApiKey",storeOptions:(e,t)=>t&&e?{everyClaudeBot:!1}:void 0,placeholder:"sk-ant-…",href:"https://console.anthropic.com/settings/keys",test:"anthropic",analytics:"anthropic",shape:/^sk-ant-/}},{id:"xai",section:"ai",labelKey:"keys.xai.label",purposeKey:"keys.purpose.xai",name:"xAI",env:["XAI_API_KEY"],words:["xai","grok","pictures","images"],mark:Xn("grok","xai"),kind:"key",target:ma("xai",{slot:"xaiApiKey",placeholder:"xai-…",href:"https://console.x.ai",test:"xai",analytics:"xai",shape:/^xai-/})},{id:"openrouter",section:"ai",labelKey:"keys.openrouter.label",purposeKey:"keys.purpose.openrouter",name:"OpenRouter",env:["OMB_OPENROUTER_API_KEY"],words:["openrouter","router","models"],mark:Xn("openai-compat","openrouter"),kind:"key",target:ma("openrouter",{slot:"openrouterApiKey",placeholder:"sk-or-v1-…",href:"https://openrouter.ai/keys",test:"openrouter",analytics:"openrouter",shape:/^sk-or-/})},{id:"mistral",section:"ai",labelKey:"keys.mistral.label",purposeKey:"keys.purpose.mistral",name:"Mistral",env:["MISTRAL_API_KEY"],words:["mistral"],mark:Xn("mistral","mistral"),kind:"key",target:ma("mistral",{slot:"mistralApiKey",placeholder:"…",placeholderKey:"keys.mistral.placeholder",href:"https://console.mistral.ai/api-keys",test:"mistral",analytics:"mistral"})},{id:"cerebras",section:"ai",labelKey:"keys.cerebras.label",purposeKey:"keys.purpose.cerebras",name:"Cerebras",env:["CEREBRAS_API_KEY"],words:["cerebras","fast"],mark:Xn("cerebras"),kind:"key",target:ma("cerebras",{slot:"cerebrasApiKey",placeholder:"csk-…",href:"https://cloud.cerebras.ai/",test:"cerebras",analytics:"cerebras",shape:/^csk-/})},{id:"groq",section:"ai",labelKey:"keys.groq.label",purposeKey:"keys.purpose.groq",name:"Groq",env:["OMB_GROQ_API_KEY"],words:["groq","fast"],mark:Xn("groq"),kind:"key",target:ma("groq",{slot:"groqApiKey",placeholder:"gsk_…",href:"https://console.groq.com/keys",test:"groq",analytics:"groq",shape:/^gsk_/})},{id:"greenference",section:"ai",labelKey:"keys.greenference.label",purposeKey:"keys.purpose.greenference",name:"Greenference",env:["OMB_GREENFERENCE_API_KEY"],words:["greenference","green","open models"],mark:Xn("greenference"),kind:"key",target:ma("greenference",{slot:"greenferenceApiKey",placeholder:"…",placeholderKey:"keys.greenference.placeholder",href:"https://greenference.com/dashboard/tokens",test:"greenference",analytics:"greenference"})},{id:"modelgo",section:"ai",labelKey:"keys.modelgo.label",purposeKey:"keys.purpose.modelgo",name:"ModelGo",env:["OMB_MODELGO_API_KEY"],words:["modelgo","model go","one key","sponsor"],mark:Xn("modelgo"),kind:"key",target:ma("modelgo",{slot:"modelgoApiKey",placeholder:"…",placeholderKey:"keys.modelgo.placeholder",href:k2,test:"modelgo",analytics:"modelgo",noteKey:"keys.modelgo.note",settingsEvent:e=>void 0})},{id:"meta",section:"ai",labelKey:"keys.meta.label",purposeKey:"keys.purpose.meta",name:"Meta",env:["OMB_META_API_KEY"],words:["meta","muse","llama"],mark:Xn("meta","meta"),kind:"key",target:ma("meta",{slot:"metaApiKey",placeholder:"LLM|…",href:"https://dev.meta.ai/docs/authentication",test:"meta",analytics:"meta",shape:/^LLM\|/})},{id:"deepseek",section:"ai",labelKey:"keys.deepseek.label",purposeKey:"keys.purpose.deepseek",name:"DeepSeek",env:["OMB_DEEPSEEK_API_KEY"],words:["deepseek","dsh","harness"],mark:Xn("deepseekAgent","deepseek"),kind:"key",target:ma("deepseek",{slot:"deepseekApiKey",placeholder:"sk-…",href:"https://platform.deepseek.com/api_keys",analytics:"deepseek"})},{id:"opencodeGo",section:"ai",labelKey:"keys.opencode.label",purposeKey:"keys.purpose.opencodeGo",name:"OpenCode",env:["OPENCODE_API_KEY"],words:["opencode","zen","go"],mark:Xn("opencodeGo"),kind:"key",target:{patch:e=>({opencodeGo:{apiKey:e}}),slot:"opencodeGoApiKey",saved:e=>Nn(e.opencodeGo),placeholder:"…",placeholderKey:"keys.opencode.placeholder",href:"https://opencode.ai/docs/providers/",analytics:"opencode_go"}},{id:"opencodeProviders",section:"ai",labelKey:"keys.opencode.otherProviders.title",purposeKey:"keys.purpose.opencodeProviders",name:"OpenCode",env:[],words:["opencode","venice","providers","provider keys"],mark:Xn("opencodeGo"),kind:"panel",status:e=>({configured:(e.opencodeGo?.providerKeys?.length??0)>0})},{id:"ollama",section:"servers",labelKey:"ollama.title",purposeKey:"keys.purpose.ollama",name:"Ollama",env:[],words:["ollama","local","llama","ollama pull"],mark:Xn("openai-compat","ollama"),kind:"panel"},{id:"lmStudio",section:"servers",labelKey:"lmStudio.title",purposeKey:"keys.purpose.lmStudio",name:"LM Studio",env:[],words:["lm studio","lmstudio","llm studio","local","bionic"],mark:{icon:t1},kind:"panel"},{id:"openaiCompat",section:"servers",labelKey:"keys.openaiCompat.label",purposeKey:"keys.purpose.openaiCompat",name:"OpenAI-compatible",env:["OPENAI_COMPAT_API_KEY","OPENAI_COMPAT_URL"],words:["openai-compatible","openai compatible","together","gemini","google ai studio","base url","server","endpoint"],mark:{icon:t1},kind:"key",target:{patch:e=>({openaiCompat:{key:e}}),slot:"openaiCompatApiKey",saved:e=>Nn(e.openaiCompat),placeholder:"…",placeholderKey:"keys.openaiCompat.placeholder",href:"https://platform.openai.com/docs/api-reference",test:"openaiCompat",analytics:"openai_compat"}},{id:"liveCalls",section:"voice",labelKey:"call.live.key",purposeKey:"keys.purpose.liveCalls",name:"OpenAI",env:[],words:["openai","live calls","calls","voice","talk","gpt-live","read aloud","speech","tts"],mark:{icon:Ya},kind:"uses",uses:"openai"},{id:"liveKey",section:"voice",labelKey:"keys.label.liveKey",purposeKey:"keys.purpose.liveKey",name:"OpenAI",env:["OMB_OPENAI_LIVE_KEY"],words:["openai","live calls","calls","voice","gpt-live","azure","foundry"],mark:{icon:Ya},kind:"key",target:{patch:e=>({live:{key:e}}),slot:"openaiLiveKey",saved:e=>Nn(e.savedKeys?.openaiLiveKey??{configured:e.live?.keySource==="live"}),placeholder:"sk-…",href:"https://platform.openai.com/api-keys",analytics:"openai_live",shape:l1}},{id:"elevenlabs",section:"voice",labelKey:"keys.label.elevenlabs",purposeKey:"keys.purpose.elevenlabs",name:"ElevenLabs",env:["OMB_TTS_KEY"],words:["elevenlabs","eleven labs","voice","voices","speech","tts"],mark:{icon:Qr},kind:"key",target:{patch:e=>({tts:{key:e}}),slot:"ttsKey",verifiedOnSave:!0,saved:e=>({...Nn(e.savedKeys?.ttsKey??{configured:e.tts?.provider==="elevenlabs"&&e.tts.configured&&!e.tts.included}),...e.tts?.included?{included:!0}:{}}),placeholder:"sk_…",href:"https://elevenlabs.io/app/settings/api-keys",analytics:"elevenlabs",shape:/^sk_/}},{id:"geminiTts",section:"voice",labelKey:"keys.label.geminiTts",purposeKey:"keys.purpose.geminiTts",name:"Gemini",env:["OMB_GEMINI_API_KEY"],words:["google","gemini","speech","voice","tts"],mark:{icon:Qr},kind:"key",target:{patch:e=>({tts:{geminiKey:e}}),slot:"geminiTtsKey",saved:e=>Nn(e.savedKeys?.geminiTtsKey),placeholderKey:"voice.gemini.keyPlaceholder",placeholder:"...",href:"https://aistudio.google.com/api-keys",analytics:"gemini_tts"}},{id:"fishAudio",section:"voice",labelKey:"keys.label.fishAudio",purposeKey:"keys.purpose.fishAudio",name:"Fish Audio",env:["OMB_FISH_AUDIO_API_KEY"],words:["fish","fish audio","voice","voices","speech","tts"],mark:{icon:Qr},kind:"key",target:{patch:e=>({tts:{fishKey:e}}),slot:"fishAudioKey",verifiedOnSave:!0,saved:e=>Nn(e.savedKeys?.fishAudioKey??{configured:e.tts?.provider==="fish"&&e.tts.configured}),placeholder:"…",placeholderKey:"voice.fish.keyPlaceholder",href:"https://fish.audio/app/api-keys/",analytics:"fish_audio"}},{id:"box",section:"computers",labelKey:"keys.boat.label",purposeKey:"keys.purpose.box",name:"boat.dev / Instabox",env:["BOX_TOKEN"],words:["boat","instabox","box","cloud desktop","cloud computer","computer","sandbox"],mark:{icon:jo},kind:"key",target:{patch:e=>({box:{token:e}}),slot:"boxToken",verifiedOnSave:!0,saved:e=>({...Nn(e.box?.included?void 0:e.box),...e.box?.included?{included:!0}:{}}),placeholder:"boat_… / ibk_…",href:"https://docs.boat.dev/api-keys",analytics:"boat",shape:/^(boat|box|ibk)_/,warningKey:"keys.boat.warning",serviceLinks:[{service:"Boat",href:"https://docs.boat.dev/api-keys"},{service:"Instabox",href:"https://dashboard.instabox.sh/dashboard/api-keys"}]}},{id:"vps",section:"computers",labelKey:"keys.vps.label",purposeKey:"keys.purpose.vps",name:"VPS",env:[],words:["vps","ssh","server","self-hosted","computer","docker"],mark:{icon:t1},kind:"panel",status:e=>({configured:e.vps?.configured===!0})},{id:"onePassword",section:"computers",labelKey:"settings.logins.onePassword.title",purposeKey:"keys.purpose.onePassword",name:"1Password",env:[],words:["1password","one password","logins","passwords","vault","service account"],mark:{icon:ei},kind:"elsewhere",opens:"logins",whereKey:"keys.where.vault"},{id:"composio",section:"apps",labelKey:"keys.composio.label",purposeKey:"keys.purpose.composio",name:"Composio",env:["COMPOSIO_API_KEY"],words:["composio","connected apps","apps","gmail","slack","github","notion","self-host"],mark:{icon:E7},kind:"key",target:{patch:e=>({composio:{apiKey:e}}),slot:"composioApiKey",verifiedOnSave:!0,saved:e=>({...Nn((e.composio?.mode??"self-hosted")==="self-hosted"?e.composio:void 0),...e.composio?.mode==="managed"?{included:!0}:{}}),placeholder:"ak_…",href:"https://dashboard.composio.dev/~/project/settings/api-keys",analytics:"composio",shape:/^ak_/}},{id:"treg",section:"apps",labelKey:"keys.treg.label",purposeKey:"keys.purpose.treg",name:"treg",env:["OMB_TREG_KEY"],words:["treg","research","x","twitter","companies","people","funding","news"],mark:{icon:An},kind:"key",target:{...ma("treg",{slot:"tregApiKey",placeholder:"…",placeholderKey:"keys.treg.placeholder",href:"https://treg.to",test:"treg",analytics:"treg"}),saved:e=>({...Nn(e.treg),...e.xResearch?.included&&!e.treg?.configured?{included:!0}:{}})}},{id:"postiz",section:"apps",labelKey:"keys.postiz.label",purposeKey:"keys.purpose.postiz",name:"Postiz",env:["OMB_POSTIZ_API_KEY"],words:["postiz","social","social media","posts","schedule","linkedin","instagram","x","twitter"],mark:{icon:Of},kind:"key",target:{patch:e=>({postiz:{key:e}}),slot:"postizApiKey",verifiedOnSave:!0,saved:e=>Nn(e.postiz),placeholder:"…",placeholderKey:"keys.postiz.placeholder",href:"https://platform.postiz.com/settings",analytics:"postiz"}},{id:"jev",section:"helpers",labelKey:"decider.key.label",purposeKey:"keys.purpose.jev",name:"Jev",env:["OMB_JEV_API_KEY"],words:["jev","typesafe","decisions","extraction","helper","rooms"],mark:{icon:Sr},kind:"key",target:{patch:e=>({decider:{key:e}}),slot:"jevApiKey",verifiedOnSave:!0,saved:e=>({...Nn(e.savedKeys?.jevApiKey??{configured:e.helpers?.own.jev===!0}),...e.decider?.included?{included:!0}:{}}),placeholder:"…",placeholderKey:"decider.key.placeholder",href:"https://typesafe.ai",analytics:"jev"}},{id:"openrouterHelper",section:"helpers",labelKey:"keys.label.openrouterHelper",purposeKey:"keys.purpose.openrouterHelper",name:"OpenRouter",env:["OMB_OPENROUTER_DECIDER_KEY"],words:["openrouter","decisions","helper"],mark:Xn("openai-compat","openrouter"),kind:"key",target:{patch:e=>({decider:{openrouterKey:e}}),slot:"openrouterDeciderKey",verifiedOnSave:!0,saved:e=>Nn(e.savedKeys?.openrouterDeciderKey??{configured:e.helpers?.own.openrouter===!0}),placeholder:"sk-or-v1-…",href:"https://openrouter.ai/keys",analytics:"openrouter_decider",shape:/^sk-or-/}},{id:"workersAi",section:"helpers",labelKey:"decider.workersAi.title",purposeKey:"keys.purpose.workersAi",name:"Cloudflare",env:["OMB_WORKERS_AI_TOKEN"],words:["cloudflare","workers ai","clef","clairic","decisions","helper"],mark:{icon:Sr},kind:"elsewhere",opens:"decisionModel",whereKey:"keys.where.decisions",status:e=>Nn(e.savedKeys?.workersAiToken??{configured:e.helpers?.own.workersAi===!0})},{id:"imageOpenai",section:"helpers",labelKey:"keys.label.imageOpenai",purposeKey:"keys.purpose.imageOpenai",name:"OpenAI",env:["OMB_OPENAI_IMAGE_KEY"],words:["openai","image","images","pictures","avatar","gpt image"],mark:{icon:Yd},kind:"key",target:{patch:e=>({imageGen:{key:e}}),slot:"openaiImageApiKey",saved:e=>Nn(e.savedKeys?.openaiImageApiKey??{configured:e.imageGen?.openaiConfigured===!0}),placeholder:"sk-…",href:"https://platform.openai.com/api-keys",analytics:"openai_image",shape:l1}},{id:"imageGemini",section:"helpers",labelKey:"keys.label.imageGemini",purposeKey:"keys.purpose.imageGemini",name:"Gemini",env:["OMB_GEMINI_IMAGE_KEY"],words:["gemini","google","nano banana","image","images","pictures"],mark:{icon:Yd},kind:"elsewhere",opens:"imageGeneration",whereKey:"keys.where.imageGeneration",status:e=>Nn(e.savedKeys?.geminiImageApiKey??{configured:e.imageGen?.geminiConfigured===!0})},{id:"imageCustom",section:"helpers",labelKey:"keys.label.imageCustom",purposeKey:"keys.purpose.imageCustom",name:"Custom",env:["OMB_CUSTOM_IMAGE_KEY"],words:["image","images","pictures","avatar","custom"],mark:{icon:jV},kind:"elsewhere",opens:"imageGeneration",whereKey:"keys.where.imageGeneration",status:e=>Nn(e.savedKeys?.customImageApiKey??{configured:e.imageGen?.customKeyConfigured===!0})}];function Co(e){const t=xT.find(n=>n.id===e);if(!t)throw new Error(`no key ${e}`);return t}function eN(e,t){const n=Co(e);if(e!=="liveKey"||t?.live?.provider!=="azure"||!n.target)return n;const{shape:a,...r}=n.target;return{...n,name:"Azure OpenAI",labelKey:"call.live.azureKeyField",purposeKey:"keys.purpose.liveKeyAzure",target:{...r,placeholder:"…",href:"https://portal.azure.com"}}}function JZ(e){return YZ.find(t=>t.id===e.section)}function Fx(e,t){return t?e.uses?Fx(Co(e.uses),t):e.target?.saved(t)??e.status?.(t)??{configured:!1}:{configured:!1}}function wDe(e,t){const n=t.trim().toLowerCase();return n?[l(e.labelKey),l(e.purposeKey),l(JZ(e).titleKey),e.name,...e.words].some(a=>a.toLowerCase().includes(n)):!0}function tN(e,t){const n=t.trim(),a=e.uses?Co(e.uses):e;return!n||a.target?.shape?.test(n)?null:xT.find(r=>r.name!==a.name&&r.target?.shape?.test(n))??null}const QZ={openai:"openai",claudeApi:"anthropic",xaiApi:"xai",grok:"xai",openrouter:"openrouter",mistral:"mistral",cerebras:"cerebras",groq:"groq",greenference:"greenference",modelgo:"modelgo",meta:"meta",deepseek:"deepseek",opencodeGo:"opencodeGo",openaiCompat:"openaiCompat"};function du(e){return e?QZ[e]:void 0}const v2=16e3,gT=1024,bT=gT/v2*1e3,yT=.015,kT=3,XZ=400,ZZ=400,eee=6e4,tee=5*6e4,nee=7e4;function see(e){let t=0;for(const n of e)t+=n*n;return Math.sqrt(t/(e.length||1))}function aee(e,t=bT){const n=e===void 0?tee:eee;let a=0,r=0,i=0,o=!1;return c=>(i+=t,c>yT?(a+=1,r=0,a>=kT&&(o=!0)):(a=0,o&&(r+=t)),i>=n||e!==void 0&&o&&r>=e?"done":o?"speaking":"waiting")}function ree(e=bT){const t=Math.ceil(XZ/e)+kT,n=Math.ceil(ZZ/e);let a=[],r=!1,i=-1;return{push(o,c,d){a.push(o),!r&&d==="waiting"&&a.length>t&&(a=a.slice(-t)),d!=="waiting"&&(r=!0),c>yT&&(i=a.length-1)},get spoke(){return r},frames:()=>r?a.slice(0,i+1+n):[]}}function iee(e,t=v2){const n=e.reduce((o,c)=>o+c.length,0),a=new DataView(new ArrayBuffer(44+n*2)),r=(o,c)=>[...c].forEach((d,u)=>a.setUint8(o+u,d.charCodeAt(0)));r(0,"RIFF"),a.setUint32(4,36+n*2,!0),r(8,"WAVEfmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,t*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),r(36,"data"),a.setUint32(40,n*2,!0);let i=44;for(const o of e)for(const c of o){const d=Math.max(-1,Math.min(1,c));a.setInt16(i,d<0?d*32768:d*32767,!0),i+=2}return new Uint8Array(a.buffer)}const q0=new Set,H0=new Set;let cr=0,Wn={phase:"idle"};const vT=e=>Array.from(q0).forEach(t=>t(e)),uu=e=>Array.from(H0).forEach(t=>t(e)),w2=()=>({code:0,reason:"completed"});function j2(e){e.processor.onaudioprocess=null,e.source.disconnect(),e.processor.disconnect();for(const t of e.stream.getTracks())t.stop();e.context.close().catch(()=>{})}function c1(){cr+=1,Wn.phase==="listening"&&j2(Wn.mic),Wn.phase==="transcribing"&&Wn.abort.abort(),Wn={phase:"idle"}}function oee(e){const t=e?.name;return t==="NotAllowedError"?{code:1,reason:"microphone-blocked",message:l("call.live.micBlocked")}:t==="NotFoundError"?{code:1,reason:"microphone-missing",message:l("call.live.micMissing")}:{code:1,reason:"microphone-failed"}}async function lee(e,t,n){try{const{text:a}=await K("/api/tts/transcribe",{method:"POST",body:iee(t),headers:{"content-type":"audio/wav"},signal:n.signal,timeoutMs:nee});if(e!==cr)return;Wn={phase:"idle"},a?.trim()&&vT({partial:!1,text:a}),uu(w2())}catch(a){if(e!==cr)return;Wn={phase:"idle"},uu({code:1,reason:"transcribe-failed",...a instanceof ln?{message:a.message}:{}})}}function nN(e){if(e!==cr||Wn.phase!=="listening")return;const{mic:t,clip:n}=Wn;if(j2(t),!n.spoke)return Wn={phase:"idle"},uu(w2());const a=new AbortController;Wn={phase:"transcribing",abort:a},lee(e,n.frames(),a)}const W0={async speechStart(e){c1();const t=cr;Wn={phase:"opening"};let n,a;try{n=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});const d=new AudioContext({sampleRate:v2});a={stream:n,context:d,source:d.createMediaStreamSource(n),processor:d.createScriptProcessor(gT,1,1)}}catch(d){return n?.getTracks().forEach(u=>u.stop()),t!==cr?void 0:(Wn={phase:"idle"},uu(oee(d)))}if(t!==cr)return j2(a);const r=e?.endpointMs!==void 0,i=aee(e?.endpointMs),o=ree();let c=!1;a.processor.onaudioprocess=d=>{if(t!==cr)return;const u=new Float32Array(d.inputBuffer.getChannelData(0)),p=see(u),m=i(p);o.push(u,p,m),r&&!c&&m!=="waiting"&&(c=!0,vT({partial:!0,text:"…"})),m==="done"&&nN(t)},a.source.connect(a.processor),a.processor.connect(a.context.destination),a.context.resume().catch(()=>{}),Wn={phase:"listening",mic:a,clip:o}},async speechStop(){c1()},async speechFinish(){if(Wn.phase==="listening")return nN(cr);Wn.phase==="opening"&&(c1(),uu(w2()))},onSpeechTranscript(e){return q0.add(e),()=>q0.delete(e)},onSpeechEnd(e){return H0.add(e),()=>H0.delete(e)}};function ss(){return mx().dictation.engine==="fish-audio"?W0:globalThis.window?.ogb}function N2(e){return Fx(Co("fishAudio"),e).configured}function S2(e,t){return e.dictation.available&&(e.dictation.engine!=="fish-audio"||N2(t))}const wT="openmausbot.remote-voice.v1";function jT(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function Ux(){try{const e=jT()?.getItem(wT);if(!e)return{};const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function NT(e){try{jT()?.setItem(wT,JSON.stringify(e))}catch{}}function qx(){return typeof window<"u"&&window.ogb?.remoteClient?.active===!0&&window.ogb?.platform==="darwin"&&typeof window.speechSynthesis<"u"&&typeof window.SpeechSynthesisUtterance<"u"}function ST(){return Ux().provider==="host"?"host":"system"}function cee(e){NT({...Ux(),provider:e})}function K0(e){return e?Ux().voices?.[e]??"":""}function dee(e,t){const n=Ux();NT({...n,voices:{...n.voices,[e]:t}})}function pu(){return qx()&&ST()==="system"}function uee(){return qx()?window.speechSynthesis.getVoices().map(e=>({id:e.voiceURI,label:e.name,description:e.lang||void 0})):[]}function pee(e){return!qx()||!e?null:window.speechSynthesis.getVoices().find(t=>t.voiceURI===e||t.name===e)??null}const mee="__ombVoiceProbe",ep=()=>{if(typeof window>"u")return null;const e=window[mee];return Array.isArray(e)?e:null},tp=()=>performance.now(),Hx=(e,t)=>{const n=e.find(r=>r.messageId===t);if(n)return n;const a={messageId:t,blocks:[]};return e.push(a),a},jd=new Map;function fee(e){if(ep()){if(e.type==="turn.started"){jd.delete(e.threadId);return}e.type!=="content.delta"||e.streamKind!=="assistant_text"||jd.has(e.threadId)||jd.set(e.threadId,tp())}}function hee(e,t){const n=ep();if(!n)return;const a=jd.get(t);jd.delete(t);const r=Hx(n,e.id);r.messageFrameAt===void 0&&(r.messageFrameAt=tp()),r.firstDeltaAt===void 0&&a!==void 0&&(r.firstDeltaAt=a),r.textChars===void 0&&typeof e.text=="string"&&(r.textChars=[...e.text].length)}function xee(e){const t=ep();if(!t||!e)return;const n=Hx(t,e);n.speakEnterAt===void 0&&(n.speakEnterAt=tp())}function gee(e,t){const n=ep();if(!n||!e)return;const a=Hx(n,e);a.preparedAt===void 0&&(a.preparedAt=tp()),a.blockCount=t}function Bp(e,t,n){const a=ep();if(!a||!e)return;const r=Hx(a,e);for(;r.blocks.length<=t;)r.blocks.push({});const i=r.blocks[t],o=tp();n==="renderStart"&&i.renderStartAt===void 0?i.renderStartAt=o:n==="renderDone"&&i.renderDoneAt===void 0?i.renderDoneAt=o:n==="audioStart"&&i.startAt===void 0?i.startAt=o:n==="audioEnd"&&i.endAt===void 0&&(i.endAt=o)}const fa={status:"idle"},bee=3;class yee{snapshot=fa;watchers=new Set;token=0;audio=null;objectUrl=null;settlePlayback=null;request=null;localUtterance=null;settleLocalSpeech=null;externalClaim=null;subscribe(t){return this.watchers.add(t),t(this.snapshot),()=>this.watchers.delete(t)}get state(){return this.snapshot}set(t){this.snapshot=t;for(const n of Array.from(this.watchers))n(t)}isSpeaking(t){return this.snapshot.status==="idle"?!1:t?this.snapshot.messageId===t:!0}stop(){this.token+=1;const t=this.externalClaim;this.externalClaim=null,t?.pause(),this.request?.abort(),this.request=null,this.settleLocalSpeech?.(!1),this.settleLocalSpeech=null,this.localUtterance=null,typeof window<"u"&&window.speechSynthesis?.cancel(),this.settlePlayback?this.settlePlayback(!1):this.teardownAudio(),(this.snapshot.status!=="idle"||this.snapshot.error)&&this.set(fa)}claimExternalVoice(t){this.stop();const n={pause:t};this.externalClaim=n;let a=!1;return()=>{a||(a=!0,this.externalClaim===n&&(this.externalClaim=null))}}teardownAudio(){this.audio&&(this.audio.pause(),this.audio.src="",this.audio=null),this.objectUrl&&(URL.revokeObjectURL(this.objectUrl),this.objectUrl=null)}async speak(t,n={}){const a=this.begin(n);let r;try{r=await a.prepare(t)}catch(i){a.fail(i instanceof Error?i.message:String(i));return}for(const i of r)a.push(i);await a.end()}begin(t={}){xee(t.messageId),this.stop();const n=this.token,a=new AbortController;this.request=a;const r=()=>this.token===n&&!a.signal.aborted;return this.set({status:"preparing",botId:t.botId,messageId:t.messageId}),pu()?this.localStream(t,r,a):this.networkStream(t,r,a)}adoptMessageId(t,n,a){t.messageId=a,n()&&this.snapshot.status!=="idle"&&this.set({...this.snapshot,messageId:a})}localStream(t,n,a){let r=Promise.resolve(),i=!1,o=!1;return{push:c=>{i||!c||!n()||(o=!0,r=r.then(()=>n()?this.speakWithLocalSystem(c,t,n):void 0))},end:async()=>{i=!0,await r,!o&&n()&&this.set(fa),this.request===a&&(this.request=null)},prepare:async c=>[c],identify:c=>this.adoptMessageId(t,n,c),cancel:()=>{n()&&this.stop()},fail:c=>{i=!0,n()&&(a.abort(),this.set({...fa,error:c})),this.request===a&&(this.request=null)}}}networkStream(t,n,a){const r=[];let i=!1,o=!1,c=!1,d=null,u=()=>{};const p=new Promise(v=>{u=v}),m=()=>{o||(o=!0,i=!0,d?.(),u())},h=(v,y)=>(Bp(t.messageId,y,"renderStart"),this.render(v,t.voiceId,a.signal).then(w=>(Bp(t.messageId,y,"renderDone"),{blob:w}),w=>({error:w}))),x=async()=>{const v=[];let y=0,w=!1;for(;;){for(;v.length<bee&&y+v.length<r.length;){const A=y+v.length;v.push(h(r[A],A))}if(!v.length){if(i||!n()){w=i;break}await new Promise(A=>{d=A}),d=null;continue}const b=v.shift(),k=y;y+=1;const j=await b;if("error"in j){n()&&this.set({...fa,error:j.error instanceof Error?j.error.message:String(j.error)}),a.abort();return}if(!n()){a.abort();return}if(this.set({status:"speaking",botId:t.botId,messageId:t.messageId,caption:r[k]}),!await this.play(j.blob,n,t.messageId,k)||!n()){n()&&this.set({...fa,error:l("voice.error.clip")}),a.abort();return}}w&&n()&&!o&&this.set(fa),this.request===a&&(this.request=null)},g=()=>{o||(d?.(),!(c||!r.length&&!i)&&(c=!0,Promise.resolve().then(x).finally(()=>{c=!1,m()})))};return{push:v=>{o||!v||(r.push(v),g())},end:()=>(i=!0,g(),p),prepare:async v=>{const y=await this.prepare(v,t.voiceId,a.signal);return gee(t.messageId,y.length),y},identify:v=>this.adoptMessageId(t,n,v),cancel:()=>{n()&&this.stop()},fail:v=>{if(o)return;const y=n();a.abort(),y&&(this.settlePlayback?this.settlePlayback(!1):this.teardownAudio(),this.set({...fa,error:v})),this.request===a&&(this.request=null),m()}}}speakWithLocalSystem(t,n,a){if(!a())return Promise.resolve();const r=t.trim();if(!r)return this.set(fa),Promise.resolve();const i=window.speechSynthesis,o=new window.SpeechSynthesisUtterance(r),c=pee(K0(n.botId));return c&&(o.voice=c),this.localUtterance=o,new Promise(d=>{let u=!1;const p=(m,h)=>{u||(u=!0,o.onstart=null,o.onend=null,o.onerror=null,this.localUtterance===o&&(this.localUtterance=null),this.settleLocalSpeech===p&&(this.settleLocalSpeech=null),a()&&this.set(m?fa:{...fa,...h?{error:h}:{}}),d())};this.settleLocalSpeech=p,o.onstart=()=>{a()&&this.set({status:"speaking",botId:n.botId,messageId:n.messageId,caption:r})},o.onend=()=>p(!0),o.onerror=m=>{const h=m.error==="canceled"||m.error==="interrupted";p(!1,h?void 0:l("voice.error.macPlay"))};try{i.speak(o)}catch{p(!1,l("voice.error.macStart"))}})}async prepare(t,n,a){const r=await fetch("/api/tts/prepare",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,voiceId:n}),signal:a}),i=await r.json().catch(()=>({}));if(!r.ok)throw new Error(Fl(i,i.error??l("voice.error.service",{status:r.status})));if(!i.ready)throw new Error(l("voice.error.notReady"));return i.utterances??[]}async render(t,n,a){const r=await fetch("/api/tts/speak",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,voiceId:n}),signal:a});if(!r.ok){const i=await r.json().catch(()=>({})),o=i.errorKey?.startsWith("voice.openai.error.")?i.errorKey:void 0;throw new Error(Fl(i,dx(o,i.error)??l("voice.error.service",{status:r.status})))}return r.blob()}play(t,n,a,r){return new Promise(i=>{if(!n())return i(!1);this.teardownAudio();const o=URL.createObjectURL(t),c=new Audio(o);this.audio=c,this.objectUrl=o;let d=!1;const u=p=>{d||(d=!0,c.onended=null,c.onerror=null,a!==void 0&&r!==void 0&&Bp(a,r,"audioEnd"),this.settlePlayback===u&&(this.settlePlayback=null),this.audio===c&&this.teardownAudio(),i(p))};this.settlePlayback=u,c.onended=()=>u(!0),c.onerror=()=>u(!1),c.play().then(()=>{a!==void 0&&r!==void 0&&Bp(a,r,"audioStart")},()=>u(!1))})}}const Gt=new yee;let ni=null;const V0=new Set;function IT(){for(const e of Array.from(V0))e()}function zn(){return ni}function CT(e){ni!==e&&(Gt.stop(),ss()?.speechStop?.(),ni=e,IT())}function mr(e){return e&&ni!==e||ni===null?!1:(ni=null,Gt.stop(),ss()?.speechStop?.(),IT(),!0)}function ET(e,t){queueMicrotask(()=>{t()||mr(e)})}function mc(){return f.useSyncExternalStore(e=>(V0.add(e),()=>V0.delete(e)),()=>ni,()=>ni)}function sN(e,t){const n=e.bots.find(r=>r.threadId===t||r.tasks?.some(i=>i.threadId===t)),a=e.liveCall;return!n?.speakReplies||zn()!==null||a&&a.status!=="ended"&&a.botId===n.id?null:{botId:n.id,voiceId:n.voice}}function aN(e){const t=GZ(e);for(const n of t.matchAll(/-----BEGIN [A-Z ]*PRIVATE KEY-----/g)){const a=t.slice(n.index+n[0].length);if(!/-----END [A-Z ]*PRIVATE KEY-----/.test(a))return t.slice(0,n.index)}return t}const d1=(e,t)=>e.turnId===void 0||t===void 0||e.turnId===t;class kee{constructor(t){this.speech=t}speech;turns=new Map;onRuntimeEvent(t,n){if(t.type==="turn.started"){const a=this.turns.get(t.threadId);a&&this.drop(a);return}if(t.type==="turn.completed"){this.finishTurn(t.threadId,t.turnId,t.ok);return}t.type==="content.delta"&&t.streamKind==="assistant_text"&&n&&this.appendDelta(t.threadId,t.turnId,t.delta,n)}onLiveCall(t){if(!(!t||t.status==="ended"))for(const n of this.turns.values())n.botId===t.botId&&(this.turns.delete(n.threadId),n.ended=!0,n.authoritative=null,n.dirty=!1,n.stream.cancel())}completeBotText(t,n,a,r,i){const o=this.turns.get(t);if(o&&d1(o,n)){if(!r){this.turns.delete(t),o.ended=!0,o.stream.cancel();return}o.stream.identify(i),o.authoritativeCut=o.buffer.length,o.authoritative=a,this.pump(o);return}if(!r||!a.trim())return;const c={threadId:t,botId:r.botId,turnId:n,stream:this.speech.begin({botId:r.botId,voiceId:r.voiceId,messageId:i}),buffer:"",authoritativeCut:0,spoken:[],authoritative:a,pumping:!1,dirty:!1,ended:!1};this.turns.set(t,c),this.pump(c),this.finishTurn(t,n,!0)}appendDelta(t,n,a,r){const i=this.turns.get(t);if(i&&d1(i,n)){i.buffer+=a,i.dirty=!0,this.pump(i);return}i&&this.drop(i);const o={threadId:t,botId:r.botId,turnId:n,stream:this.speech.begin({botId:r.botId,voiceId:r.voiceId}),buffer:a,authoritativeCut:0,spoken:[],authoritative:null,pumping:!1,dirty:!0,ended:!1};this.turns.set(t,o),this.pump(o)}drop(t){this.turns.get(t.threadId)===t&&(this.turns.delete(t.threadId),t.ended=!0,t.stream.end())}finishTurn(t,n,a){const r=this.turns.get(t);if(!(!r||!d1(r,n))){if(!a){this.turns.delete(t),r.ended=!0,r.stream.cancel();return}r.ended=!0,this.pump(r)}}pump(t){if(t.pumping){t.dirty=!0;return}t.pumping=!0,(async()=>{try{for(;;){if(t.authoritative!==null){const n=t.authoritative;t.authoritative=null;const a=t.spoken;t.spoken=[],t.buffer=t.buffer.slice(t.authoritativeCut),t.authoritativeCut=0,t.buffer&&(t.dirty=!0);const r=await t.stream.prepare(aN(n));let i=0;for(;i<a.length&&i<r.length&&a[i]===r[i];)i+=1;for(const o of r.slice(i))t.stream.push(o);continue}if(t.dirty&&!t.ended){t.dirty=!1;const a=(await t.stream.prepare(aN(t.buffer))).slice(0,-1);for(const r of a.slice(t.spoken.length))t.stream.push(r);t.spoken=a;continue}break}}catch(n){this.turns.get(t.threadId)===t&&this.turns.delete(t.threadId),t.stream.fail(n instanceof Error?n.message:String(n));return}t.pumping=!1,t.ended&&this.turns.get(t.threadId)===t&&(this.turns.delete(t.threadId),t.stream.end())})()}}const u1=new kee(Gt),Fp=e=>Object.keys(e).length>0,Up=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),vee=e=>!!(e&&typeof e=="object"&&e.name==="AbortError"),p1=e=>{const{acknowledgeLocalAuto:t,applyToAllThreads:n,keepThreadModels:a,threadId:r,mainThreadChoice:i,cwd:o,computer:c,connectorTools:d,connectorScopes:u,phoneApps:p,...m}=e,h={...m};return o===null?h.cwd=void 0:o!==void 0&&(h.cwd=o),c===null?h.computer=void 0:c!==void 0&&(h.computer=c),d===null?h.connectorTools=void 0:d!==void 0&&(h.connectorTools=d),u===null?h.connectorScopes=void 0:u!==void 0&&(h.connectorScopes=u),p===null?h.phoneApps=void 0:p!==void 0&&(h.phoneApps=p),typeof i=="string"&&(h.mainThreadId=i),h};function wee(e){const t=new Map,n=e.delayMs??400;let a=!1;const r=c=>{if(!(c.running||c.timer!==null||Fp(c.pending))){t.delete(c.botId);for(const d of c.idleWaiters.splice(0))d(c.fallback)}},i=async(c,d=!1)=>{if(a||c.running||c.timer!==null||!Fp(c.pending))return;c.running=!0;const u=c.pending;c.pending={},c.inFlight=u;const p=new AbortController;c.controller=p;try{const m=await e.send(c.botId,u,p.signal,c.fallback,d);if(a||c.cancelled)return;c.fallback=m,e.onAuthoritative(m,p1(c.pending))}catch(m){if(!a&&!c.cancelled){if(p.signal.aborted&&Up(c.pending,"approvalMode")&&vee(m))return;c.inFlight={};let x=c.fallback;try{x=await e.reconcile(c.botId,p.signal),x&&(c.fallback=x)}catch{}if(a||c.cancelled)return;x&&e.onAuthoritative(x,p1(c.pending)),e.onError(m instanceof Error?m:new Error(String(m)))}}finally{c.controller=null,c.inFlight={},c.running=!1,!a&&!c.cancelled&&(Fp(c.pending)&&c.timer===null&&i(c),r(c))}},o=c=>{c.timer!==null&&clearTimeout(c.timer),c.timer=setTimeout(()=>{c.timer=null,i(c)},n)};return{enqueue(c,d,u){if(a||!Fp(d))return;const p=t.get(c)??{botId:c,fallback:u,pending:{},inFlight:{},timer:null,running:!1,controller:null,cancelled:!1,idleWaiters:[]};t.set(c,p),p.pending={...p.pending,...d},Up(d,"approvalMode")&&!Up(d,"applyToAllThreads")&&delete p.pending.applyToAllThreads;const m=p.inFlight.approvalMode;p.running&&(m==="full"||m==="custom")&&Up(d,"approvalMode")&&d.approvalMode!==m&&p.controller?.abort(),Object.prototype.hasOwnProperty.call(d,"approvalMode")||Object.prototype.hasOwnProperty.call(d,"modelSelection")||Object.prototype.hasOwnProperty.call(d,"connectorTools")?(p.timer!==null&&clearTimeout(p.timer),p.timer=null,i(p)):o(p)},flush(c){const d=t.get(c);if(!d)return Promise.resolve(null);d.timer!==null&&(clearTimeout(d.timer),d.timer=null);const u=new Promise(p=>d.idleWaiters.push(p));return i(d),r(d),u},flushAll(){for(const c of t.values())c.timer!==null&&(clearTimeout(c.timer),c.timer=null,i(c,!0))},overlayFor(c){const d=t.get(c);return d?p1({...d.inFlight,...d.pending}):{}},cancel(c){const d=t.get(c);if(d){d.cancelled=!0,d.timer!==null&&clearTimeout(d.timer),d.controller?.abort(),t.delete(c);for(const u of d.idleWaiters.splice(0))u(null)}},revive(){a=!1},dispose(){a=!0;for(const c of t.values()){c.cancelled=!0,c.timer!==null&&clearTimeout(c.timer),c.controller?.abort();for(const d of c.idleWaiters.splice(0))d(null)}t.clear()}}}const jee=e=>new TextEncoder().encode(e).length<6e4;function Nee(e,t){const n=()=>e.flushAll();return t.addEventListener("pagehide",n),t.addEventListener("beforeunload",n),()=>{t.removeEventListener("pagehide",n),t.removeEventListener("beforeunload",n)}}function See(){const e=new Map;return(t,n)=>{const a=e.get(t.botId);if(a&&a.projectId===t.projectId&&a.cwd===t.cwd)return a.outcome.then(o=>o===null?t.onCreated?.():t.onError?.(o)),null;if(a)return a.outcome.then(()=>n()),null;let r=()=>{};const i=new Promise(o=>{r=c=>{e.delete(t.botId),o(c)}});return e.set(t.botId,{projectId:t.projectId,cwd:t.cwd,outcome:i}),r}}function G0(e){if(!e||typeof e!="object"||!Object.prototype.hasOwnProperty.call(e,"call"))return null;const t=Reflect.get(e,"call");if(t===null)return{call:null};if(!t||typeof t!="object")return null;const n=t;return typeof n.callId!="string"||typeof n.botId!="string"||typeof n.threadId!="string"||typeof n.status!="string"?null:{call:t}}let rN=0;function AT(){return rN+=1,rN}const Iee=6e3;function Cee(e){return e instanceof ln&&e.body?.code==="no_ai"}function Eee(e,t){f.useEffect(()=>{if(!e)return;const n=setTimeout(t,Iee);return()=>clearTimeout(n)},[e,t])}const Y0=1024,iN=1024*Y0;function TT(e){return typeof e!="number"||!Number.isFinite(e)||e<Y0?null:e<iN?{unit:"kb",count:Math.floor(e/Y0)}:{unit:"mb",count:Math.floor(e/iN*10)/10}}function oN(e){const t=TT(e.bytes),n=e.quiet?`${e.quiet.kind}${e.quiet.kind==="output"?`@${e.quiet.at}`:""}`:"";return[e.turnId??"",e.itemId??"",e.activity,e.tool??"",e.file??"",t?`${t.count}${t.unit}`:"",e.target??"",e.detail??"",n,(e.tail??[]).join(`
18
- `)].join("|")}const Aee={ended:!1,status:null},Tee=500,$r=new Map,Wm=new Map;function Mee(e,t){return e===t?!0:!e||!t?!1:("bytes"in e?e.bytes:void 0)===("bytes"in t?t.bytes:void 0)&&oN(e)===oN(t)}function Oi(e,t){const n=$r.get(e);if(!(n&&n.turnId===t.turnId&&n.ended===t.ended&&Mee(n.status,t.status))){$r.delete(e),$r.set(e,t),$r.size>Tee&&$r.delete($r.keys().next().value);for(const a of Array.from(Wm.get(e)??[]))a()}}function _ee(e){const{threadId:t}=e,n=$r.get(t),a=n&&(!e.turnId||e.turnId===n.turnId),r=e.turnId??n?.turnId,i=a?n:{turnId:r,ended:!1,status:null};switch(e.type){case"turn.started":return Oi(t,{turnId:r,ended:!1,status:null});case"turn.completed":case"cap.exhausted":case"session.exited":return Oi(t,{turnId:r,ended:!0,status:null});case"turn.progress":{const{activity:o,tool:c,file:d,bytes:u,itemId:p,target:m,detail:h,quiet:x,tail:g}=e;return Oi(t,{turnId:r,ended:!1,status:{activity:o,...c?{tool:c}:{},...d?{file:d}:{},...u!==void 0?{bytes:u}:{},...p?{itemId:p}:{},...m?{target:m}:{},...h?{detail:h}:{},...x?{quiet:x}:{},...g?.length?{tail:g}:{}}})}case"content.delta":return Oi(t,{turnId:r,ended:!1,status:{activity:e.streamKind==="reasoning_text"?"thinking":"reply"}});case"item.started":return Oi(t,{...i,ended:!1,status:i.status?.itemId&&i.status.itemId===e.itemId?i.status:null});case"item.completed":case"request.opened":return Oi(t,{...i,status:null});default:i!==n&&Oi(t,i)}}function lN(e){return e&&$r.get(e)||Aee}function Ree(e,t){if(!e)return()=>{};let n=Wm.get(e);return n||Wm.set(e,n=new Set),n.add(t),()=>{n.delete(t),n.size===0&&Wm.delete(e)}}function I2(e){return f.useSyncExternalStore(t=>Ree(e,t),()=>lN(e),()=>lN(e))}const Oee="/api/events",MT=4e4,Lee=500,zee=1e4,J0="omb:retry-live-events";function Pee(){window.dispatchEvent(new Event(J0))}function Dee(e){const t=new URLSearchParams;return e?.since&&t.set("since",e.since),e?.screens===!1&&t.set("screens","off"),t.set("window","1"),`${Oee}?${t}`}const mu=new Set,Qf=new Set,Ui=()=>[...mu].some(e=>e.screens);function Wx(e){const t=Ui();if(mu.add(e),Ui()!==t)for(const n of Qf)n();return()=>{const n=Ui();if(mu.delete(e),Ui()!==n)for(const a of Qf)a()}}function $ee(e){if(e.kind!=="screen")return e;const{png:t,...n}=e;return{...n,png:""}}function Bee(e){for(const t of mu)t.onFrame(e)}function Fee(){for(const e of mu)e.onMissedFrames?.()}function Uee(e){return e.kind==="ping"}function qee(e,t,n=MT){return t-e>=n}function Hee(e){let t;try{t=JSON.parse(e)}catch{return null}if(!t||Array.isArray(t)||Object(t)!==t)return null;const n=t;return n.kind!==String(n.kind)||n.cursor!==void 0&&n.cursor!==String(n.cursor)||n.resumed!==void 0&&n.resumed!==!!n.resumed?null:n}function Wee(e){e.kind==="runtime"?(_ee(e.event),fee(e.event)):e.kind==="message"&&e.message?.role==="bot"&&e.message?.kind==="text"&&hee(e.message,e.threadId)}function Kee(e){const t=globalThis.EventSource,n=e.createEventSource??(t?i=>{const o=new t(i),c={onopen:null,onerror:null,onmessage:null,close:()=>o.close()};return o.onopen=()=>c.onopen?.(),o.onerror=()=>c.onerror?.(),o.onmessage=d=>c.onmessage?.(d),c}:void 0);if(!n)return null;const a=globalThis.window,r=globalThis.document;return{createEventSource:n,windowTarget:e.windowTarget??(a?{addEventListener:(i,o)=>a.addEventListener(i,o),removeEventListener:(i,o)=>a.removeEventListener(i,o)}:void 0),documentTarget:e.documentTarget??(r?{addEventListener:(i,o)=>r.addEventListener(i,o),removeEventListener:(i,o)=>r.removeEventListener(i,o)}:void 0),isVisible:e.isVisible??(()=>!r||r.visibilityState==="visible"),isOnline:e.isOnline??(()=>globalThis.navigator?.onLine!==!1),now:e.now??Date.now}}function Vee(e,t={}){const n=Kee(t);if(!n)return e.onError?.(),()=>{};const a=e.staleMs??MT,r=Math.max(1,e.retryMinMs??Lee),i=Math.max(r,e.retryMaxMs??zee),o=Math.min(1e4,Math.max(250,a/2));let c=!1,d=null,u=Ui(),p=null,m=0,h=null,x=n.now(),g=0,v=null;const y=()=>{p!==null&&(clearTimeout(p),p=null)},w=()=>{const z=d;d=null,z&&(v?.source===z&&(g+=1,v=null),z.onopen=null,z.onerror=null,z.onmessage=null,z.close())};let b;const k=()=>{if(c||p!==null||!n.isOnline()||!n.isVisible()||Kr())return;const z=Math.min(m,20),P=Math.min(i,r*2**z);m+=1,p=setTimeout(()=>{p=null,n.isVisible()&&b()},P)},j=z=>{c||d!==z||(w(),e.onError?.(),k())};b=()=>{if(c||d||!n.isOnline()||Kr())return;let z;try{u=Ui(),z=n.createEventSource(Dee({since:h,screens:u}))}catch{e.onError?.(),k();return}d=z,x=n.now(),z.onopen=()=>{c||d!==z||(x=n.now(),e.onOpen?.())},z.onerror=()=>j(z),z.onmessage=P=>{if(c||d!==z)return;x=n.now();const $=Hee(P.data);if($){if(Uee($)){m=0;return}if($.kind==="hello"){if($.resumed===!1){const _=++g;v={generation:_,source:z,boundaryCursor:$.cursor||null,newestFrameCursor:null},(async()=>{let B=!1;try{B=await e.onSnapshotRequired()}catch{B=!1}const W=v;if(!(c||d!==z||!W||W.generation!==_)){if(!B){v=null,j(z);return}h=W.newestFrameCursor??W.boundaryCursor,v=null,O()}})()}}else P.lastEventId&&(v?.source===z?v.newestFrameCursor=P.lastEventId:h=P.lastEventId);if(AQ($)){y(),w(),jA();return}$.kind!=="hello"&&(Wee($),e.onFrame($))}}};const N=z=>{c||!n.isOnline()||(y(),d&&(w(),z&&e.onError?.()),b())},A=()=>{c||!n.isOnline()||!n.isVisible()||Kr()||(!d||qee(x,n.now(),a))&&N(d!==null)},T=()=>A(),M=()=>{n.isVisible()&&A()},S=()=>{n.isVisible()&&A()},C=()=>{n.isVisible()&&!Kr()&&N(!0)},O=()=>queueMicrotask(()=>{d&&h&&!v&&Ui()!==u&&N(!1)});Qf.add(O),b();const L=setInterval(A,o),D=Tx(z=>{z||N(!1)});return n.windowTarget?.addEventListener("online",T),n.windowTarget?.addEventListener("focus",M),n.windowTarget?.addEventListener(J0,C),n.documentTarget?.addEventListener("visibilitychange",S),()=>{c||(c=!0,Qf.delete(O),D(),clearInterval(L),y(),w(),n.windowTarget?.removeEventListener("online",T),n.windowTarget?.removeEventListener("focus",M),n.windowTarget?.removeEventListener(J0,C),n.documentTarget?.removeEventListener("visibilitychange",S))}}const cN=2e3,dN=new Set(["queued","running","waiting"]);function Q0(e){const t=[...e].sort((r,i)=>i.scheduledFor-r.scheduledFor);if(t.length<=cN)return t;const n=t.reduce((r,i)=>r+(dN.has(i.status)?1:0),0);let a=Math.max(0,cN-n);return t.filter(r=>dN.has(r.status)?!0:a===0?!1:(a-=1,!0))}const Gee=336*60*6e4;function Yee(e,t){const n=new Set(e.map(a=>a.id));return Q0([...e,...t.filter(a=>!n.has(a.id))])}function Jee(e,t){return e===null||t.from===void 0||t.to===void 0||t.to<e?e:Math.min(e,t.from)}const Qee=64;function jl(e,t){const n={...e,[t]:!0},a=Object.keys(n).length-Qee;if(a>0)for(const r of Object.keys(n).slice(0,a))delete n[r];return n}function qp(e,t){const n=[];for(const o of t)for(const c of o.messages??[])c.queueId&&n.push({queueId:c.queueId,at:c.at});if(n.length===0)return e;const a=new Set(n.map(o=>o.queueId)),r={};for(const[o,c]of Object.entries(e.pendingQueued)){const d=c.filter(u=>!a.has(u.queueId));d.length>0&&(r[o]=d)}let i={};n.sort((o,c)=>o.at-c.at);for(const o of n)i=jl(i,o.queueId);for(const o of Object.keys(e.consumedQueueIds))i=jl(i,o);return{...e,pendingQueued:r,consumedQueueIds:i}}function uN(e,t){const n=new Set(e.groups.flatMap(o=>[o.threadId,...(o.tasks??[]).map(c=>c.threadId)])),a=new Set(Object.values(t).flatMap(o=>o.map(c=>c.queueId))),r={...t};let i=e.consumedQueueIds;for(const[o,c]of Object.entries(e.pendingQueued))if(n.has(o))r[o]=c;else for(const d of c)a.has(d.queueId)||(i=jl(i,d.queueId));return{...e,pendingQueued:r,consumedQueueIds:i}}function Xee(e){return{xai:e.xai,mistral:e.mistral,cerebras:e.cerebras,groq:e.groq,greenference:e.greenference,modelgo:e.modelgo,deepseek:e.deepseek,meta:e.meta,xResearch:e.xResearch,treg:e.treg,postiz:e.postiz,anthropic:e.anthropic,openai:e.openai,openrouter:e.openrouter,openaiCompat:e.openaiCompat,fleet:e.fleet,toolGroups:e.toolGroups,composio:e.composio,box:e.box,vps:e.vps,rooms:e.rooms,mcp:e.mcp,threads:e.threads,automaticRecovery:e.automaticRecovery,cacheKeepWarm:e.cacheKeepWarm,localVm:e.localVm,opencodeGo:e.opencodeGo,tts:e.tts,decider:e.decider,helpers:e.helpers,imageGen:e.imageGen,live:e.live,savedKeys:e.savedKeys,profile:e.profile,everyBotRules:e.everyBotRules,language:e.language,features:e.features,onboarding:e.onboarding,browserEngine:e.browserEngine,browserProfiles:e.browserProfiles,edition:e.edition,budgets:e.budgets,billing:e.billing,managedPolicy:e.managedPolicy,...e.cloudHome?{cloudHome:!0}:{},...e.team?{team:e.team}:{},...e.awakeLimit!==void 0?{awakeLimit:e.awakeLimit}:{},...e.pausedBots?{pausedBots:e.pausedBots}:{},...e.workspaceBanner?{workspaceBanner:e.workspaceBanner}:{}}}function _T(e){return(e.tasks??[]).map(t=>En({approvalMode:t.approvalMode??(t.autoApprove===void 0?e.approvalMode:void 0),autoApprove:t.autoApprove??e.autoApprove}))}function rs(e,t=e.threadId){const n=e.tasks?.find(a=>a.threadId===t);return n?{...e,threadId:t,modelSelection:n.modelSelection??e.modelSelection,approvalMode:n.approvalMode??(n.autoApprove===void 0?e.approvalMode:void 0),autoApprove:n.autoApprove??e.autoApprove,alwaysAllow:n.alwaysAllow??e.alwaysAllow,activity:n.activity??e.activity,busy:n.busy??(n.activity?n.activity==="working"||n.activity==="waiting-on-you":e.busy),unread:n.unread??e.unread,pinnedMessageId:n.pinnedMessageId,turnStartedAt:n.turnStartedAt??null,waitingForTeammates:n.waitingForTeammates??!1}:e}function RT(e){const{acknowledgeLocalAuto:t,updateBotDefault:n,resetApprovalToAsk:a,projectId:r,archivedAt:i,snoozedUntil:o,surface:c,pinned:d,link:u,...p}=e;return{...p,...a?{approvalMode:"ask",autoApprove:!1,alwaysAllow:[]}:{},...r===void 0?{}:{projectId:r??void 0},...i===void 0?{}:{archivedAt:i??void 0},...o===void 0?{}:{snoozedUntil:o??void 0},...c===void 0?{}:{surface:c??void 0,surfaceAuto:void 0},...d===void 0?{}:{pinned:d?!0:void 0},...u===void 0?{}:{link:u??void 0}}}function m1(e,t,n,a,r,i){return n?nT(t,a,r,i):Hm(e.unreadDivider?.threadId===t?e.unreadDivider:null,t,a,!!i)}function _c(e){const t=Object.entries(e.modelVariantSessions),n=t.filter(([a,r])=>{const i=e.bots.find(c=>c.threadId===a||c.tasks?.some(d=>d.threadId===a));if(!i)return!1;const o=rs(i,a).modelSelection;return o.instanceId===r.instanceId&&o.model===r.model});return n.length===t.length?e:{...e,modelVariantSessions:Object.fromEntries(n)}}function Zee(e,t){if(!("botId"in e)||"threadId"in e&&e.threadId||!["send","interrupt","editMessage","switchBranch","answerCard","dismissCard","cancelQueued","steerQueued"].includes(e.type))return e;const n=e.botId,a=t.find(r=>r.id===n)?.threadId;return{...e,threadId:a}}function Hp(e,t){return t?{...e,transcriptGeneration:{...e.transcriptGeneration,[t]:(e.transcriptGeneration[t]??0)+1}}:e}function sn(e,t,n){return{...e,bots:e.bots.map(a=>a.id===t?n(a):a)}}function Qs(e,t,n){return{...e,mascotMotion:{botId:t,nonce:(e.mascotMotion?.nonce??0)+1,kind:n}}}function OT(e,t,n){return e.map(a=>a.id===t&&a.card?{...a,card:{...a.card,...n}}:a)}function Km(e,t,n,a){return sn(e,t,r=>({...r,messages:OT(r.messages,n,a)}))}function f1(e,t,n,a){return{...e,groups:e.groups.map(r=>r.id===t?{...r,messages:OT(r.messages,n,a)}:r)}}function LT(e){return e.messages.find(t=>t.kind==="options"&&t.card&&!t.card.requestId&&!t.card.dismissed)}function ete(e,t){const n=e.bots.find(r=>r.id===t),a=n?LT(n):void 0;return a?Km(e,t,a.id,{dismissed:!0}):e}const pN={type:"toggleAppSettings",open:!0,section:"cloudAccount",cloudLink:!0};function Pa(e,t){if((t.type==="messageAdded"||t.type==="messagePatched"||t.type==="threadActive"||t.type==="optimisticMessageRemoved")&&e.bots.find(a=>(a.threadId!==t.threadId||a.awaitingThreadSnapshot)&&a.tasks?.some(r=>r.threadId===t.threadId))){const a=[...e.backgroundThreadEvents[t.threadId]??[],t].slice(-256),r={...e,backgroundThreadEvents:{...e.backgroundThreadEvents,[t.threadId]:a}};return(t.type==="messageAdded"||t.type==="messagePatched")&&nd(t.message)?Rr(r,t.threadId,t.message.at,!0,t.message.turnCompletedAt??t.message.at):t.type==="messageAdded"?Rr(r,t.threadId,t.message.at):r}if(KQ(t))return{...e,notifications:VQ(e.notifications,t)};switch(t.type){case"hydrate":{const n=d=>t.bots.some(u=>u.id===d)||t.groups.some(u=>u.id===d),a=t.resumeId,r=a&&(t.bots.some(d=>d.id===a&&!d.hidden)||t.groups.some(d=>d.id===a))?a:"",i=e.selectedId&&n(e.selectedId)?e.selectedId:r||(t.bots[0]?.id??""),o={...e,bots:t.bots.map(d=>{const u=d.messages?d:{...d,messages:[]},p=e.bots.find(m=>m.id===u.id);return wX(p,p?{...u,tasks:qm(p.tasks,u.tasks)}:u,t.preserveNavigation===!0&&B4(p,t.navigationSince,e.transcriptGeneration),t.taskIdsAtStart)}),groups:t.groups.map(d=>{const u=e.groups.find(m=>m.id===d.id),p=u?{...d,tasks:qm(u.tasks,d.tasks)}:d;return p.description===null&&(p.description=void 0),jX(u,p,t.preserveNavigation===!0&&B4(u,t.navigationSince,e.transcriptGeneration),t.taskIdsAtStart)}),sections:t.sections??[],computerControl:t.computerControl,selectedId:i,hydrated:!0,backgroundThreadEvents:{},loadingOlder:{},transcriptGeneration:{},modelVariantSessions:{}},c=[...o.bots,...o.groups].find(d=>d.threadId===e.unreadDivider?.threadId);return c&&(o.unreadDivider=Hm(e.unreadDivider,c.threadId,zs(c),!!c.hasMore)),qp(t.botQueuedMessages?uN(o,t.botQueuedMessages):o,[...t.bots,...t.groups])}case"loadOlderMessages":return e.loadingOlder[t.threadId]?e:{...e,loadingOlder:{...e.loadingOlder,[t.threadId]:!0}};case"olderMessages":{const{[t.threadId]:n,...a}=e.loadingOlder;if((e.transcriptGeneration[t.threadId]??0)!==t.generation)return{...e,loadingOlder:a};const r=u=>{const p=new Set(u.messages.map(m=>m.id));return{...u,messages:[...t.messages.filter(m=>!p.has(m.id)),...u.messages],hasMore:t.hasMore}},i=e.bots.map(u=>u.threadId===t.threadId?r(u):u),o=e.groups.map(u=>u.threadId===t.threadId?r(u):u),c=[...i,...o].find(u=>u.threadId===t.threadId),d=Hm(e.unreadDivider,t.threadId,c?zs(c):[],t.hasMore);return{...e,loadingOlder:a,bots:i,groups:o,unreadDivider:d}}case"sectionDeleted":return{...e,sections:t.sections,bots:e.bots.map(n=>n.section===t.section?{...n,section:void 0}:n),groups:e.groups.map(n=>n.section===t.section?{...n,section:void 0}:n)};case"sections":return{...e,sections:t.sections};case"botsOrdered":{const n=A0(e.bots,t.botIds);return n?{...e,bots:n}:e}case"groupsOrdered":{const n=A0(e.groups,t.groupIds);return n?{...e,groups:n}:e}case"botQueues":return qp(uN(e,t.queues),[...e.bots,...e.groups]);case"showRoutines":return{...e,activeView:"routines",routinesFocus:{section:t.section,view:t.view,botId:t.botId,routineId:t.routineId,runStatus:t.runStatus,nonce:e.routinesFocus.nonce+1},settingsOpen:!1,computerOpen:!1,inspectorOpen:!1,activityOpen:!1,notificationsOpen:!1,appSettingsOpen:!1,pluginsOpen:!1};case"showChat":return e.activeView==="chat"?e:{...e,activeView:"chat"};case"showTeamMap":case"showFiles":case"showWebPanel":return{...e,activeView:t.type==="showFiles"?"files":t.type==="showWebPanel"?"web-panel":"team-map",filesSuggest:t.type==="showFiles"&&t.suggest?.length?t.suggest:null,webPanelId:t.type==="showWebPanel"?t.id:e.webPanelId,settingsOpen:!1,computerOpen:!1,inspectorOpen:!1,activityOpen:!1,appSettingsOpen:!1,pluginsOpen:!1};case"routinesHydrated":return{...e,routines:t.routines,routineRuns:Q0(t.runs),routineRunsSince:t.since??null,routinesLoadState:"ready"};case"routinesLoadFailed":return{...e,routinesLoadState:"error"};case"routinePatched":{const n=e.routines.find(a=>a.id===t.routine.id);return n&&n.updatedAt>t.routine.updatedAt?e:{...e,routines:n?e.routines.map(a=>a.id===t.routine.id?t.routine:a):[t.routine,...e.routines]}}case"routineDeleted":return{...e,routines:e.routines.filter(n=>n.id!==t.routineId)};case"routineRunPatched":{const a=e.routineRuns.some(r=>r.id===t.run.id)?e.routineRuns.map(r=>r.id===t.run.id?t.run:r):[t.run,...e.routineRuns];return{...e,routineRuns:Q0(a)}}case"routineRunsLoaded":return{...e,routineRuns:Yee(e.routineRuns,t.runs),routineRunsSince:Jee(e.routineRunsSince,t)};case"webhooksHydrated":return{...e,webhooks:t.webhooks,webhookAttempts:t.attempts,webhookIngress:t.ingress};case"webhookPatched":{const n=e.webhooks.some(a=>a.id===t.webhook.id);return{...e,webhooks:n?e.webhooks.map(a=>a.id===t.webhook.id?t.webhook:a):[t.webhook,...e.webhooks]}}case"webhookDeleted":return{...e,webhooks:e.webhooks.filter(n=>n.id!==t.webhookId),webhookAttempts:e.webhookAttempts.filter(n=>n.webhookId!==t.webhookId)};case"webhookAttempted":{const n=e.webhookAttempts.some(a=>a.id===t.attempt.id)?e.webhookAttempts.map(a=>a.id===t.attempt.id?t.attempt:a):[...e.webhookAttempts,t.attempt];return{...e,webhookAttempts:n.slice(-2e3)}}case"groupPatched":{const n=t.group.messages?Hp(e,t.group.threadId):e,a=bX(e.groups,t.group),r=t.group.messages&&a.find(i=>i.id===t.group.id&&i.threadId===e.unreadDivider?.threadId);return{...n,groups:a,...r?{unreadDivider:Hm(e.unreadDivider,r.threadId,zs(r),!!r.hasMore)}:{}}}case"groupSnapshot":{const n=yX(e,t);return n?Pa(e,{type:"groupPatched",group:n}):e}case"groupDeleted":{const n=e.groups.filter(r=>r.id!==t.groupId),a=e.selectedId===t.groupId?e.bots[0]?.id??"":e.selectedId;return{...e,groups:n,selectedId:a}}case"instances":return{...e,instances:t.instances};case"configStatus":return{...e,config:t.config};case"liveCall":return{...e,liveCall:t.call,liveCallVersion:e.liveCallVersion+1};case"liveCallLookup":return t.since===e.liveCallVersion&&t.seq>e.liveCallLookupSeq?{...e,liveCall:t.call,liveCallLookupSeq:t.seq}:e;case"profileSaved":return e.config?{...e,config:{...e.config,profile:{name:"",email:"",...e.config.profile,...t.profile}}}:e;case"select":{const n=e.groups.find(r=>r.id===t.id);if(n)return{...t.id===e.selectedId&&e.activeView==="chat"?e:al(e),unreadDivider:m1(e,n.threadId,n.unread,n.messages,n.lastReadMessageId,n.hasMore),activeView:"chat",selectedId:t.id,groups:e.groups.map(r=>r.id===t.id?{...r,unread:!1}:r)};const a=e.bots.find(r=>r.id===t.id);return sn(Qs({...t.id===e.selectedId&&e.activeView==="chat"?e:al(e),unreadDivider:a?m1(e,a.threadId,Y4(a),zs(a),G4(a),a.hasMore):e.unreadDivider,activeView:"chat",selectedId:t.id},t.id,"switch"),t.id,r=>({...r,unread:!!r.tasks?.some(i=>i.threadId!==r.threadId&&i.unread),tasks:r.tasks?.map(i=>i.threadId===r.threadId?{...i,unread:!1}:i)}))}case"answerCard":{if(t.groupId){const r=e.groups.find(i=>i.id===t.groupId)?.messages.find(i=>i.id===t.messageId)?.card;return f1(e,t.groupId,t.messageId,{answered:t.answer,...r?.requestId?{pendingAnswer:t.answer}:{}})}const a=e.bots.find(r=>r.id===t.botId)?.messages.find(r=>r.id===t.messageId)?.card;return Qs(Km(e,t.botId,t.messageId,{answered:t.answer,...a?.requestId?{pendingAnswer:t.answer}:{dismissed:!0}}),t.botId,"working")}case"answerCardFailed":{if((t.groupId?e.groups.find(i=>i.id===t.groupId):e.bots.find(i=>i.id===t.botId))?.messages.find(i=>i.id===t.messageId)?.card?.pendingAnswer!==t.answer)return e;const r={answered:void 0,pendingAnswer:void 0};return t.groupId?f1(e,t.groupId,t.messageId,r):Km(e,t.botId,t.messageId,r)}case"dismissCard":return t.groupId?f1(e,t.groupId,t.messageId,{dismissed:!0}):Km(e,t.botId,t.messageId,{dismissed:!0});case"decideRequest":return e;case"botAdded":return Qs({...t.preserveSelection||t.bot.id===e.selectedId?e:al(e),bots:[t.bot.messages?t.bot:{...t.bot,messages:[]},...e.bots.filter(n=>n.id!==t.bot.id)],...t.preserveSelection?{}:{activeView:"chat",selectedId:t.bot.id}},t.bot.id,"arrive");case"deleteBot":{const n=e.bots.filter(o=>o.id!==t.botId),a=e.selectedId===t.botId?n.find(o=>!o.hidden)?.id??n[0]?.id??"":e.selectedId,{[t.botId]:r,...i}=e.deletingBots;return _c({...e,bots:n,selectedId:a,deletingBots:i})}case"botDeletionPending":{if(t.on)return e.deletingBots[t.botId]?e:{...e,deletingBots:{...e.deletingBots,[t.botId]:!0}};if(!e.deletingBots[t.botId])return e;const{[t.botId]:n,...a}=e.deletingBots;return{...e,deletingBots:a}}case"markUnread":return sn(Qs(e,t.botId,"surprise"),t.botId,n=>({...n,unread:!0}));case"botPatched":{const n=e.bots.find(p=>p.id===t.bot.id);if(!n){const p={...e,bots:[{...t.bot,messages:t.bot.messages??[]},...e.bots]};return qp(p,[t.bot])}const a=t.bot.unread&&!n?.unread?"surprise":t.bot.busy===!0&&!n?.busy?"working":t.bot.busy===!1&&n?.busy?"celebrate":null,r=a?Qs(e,t.bot.id,a):e,i=t.bot.busy===!1&&n?.busy&&r.computerStarts[t.bot.id]?Pa(r,{type:"computerStart",botId:t.bot.id,start:null}):r,o=t.bot.chiefOfStaff?{...i,bots:R4(i.bots,t.bot)}:i,c=typeof t.bot.threadId=="string"&&t.bot.threadId!==n.threadId&&!t.bot.tasks?.some(p=>p.threadId===n.threadId);let d=o;if(c){const{[t.bot.threadId]:p,...m}=o.backgroundThreadEvents;d={...o,backgroundThreadEvents:m}}if((c||n.awaitingThreadSnapshot&&t.bot.threadId===n.threadId)&&Array.isArray(t.bot.messages))return Pa(d,{type:"taskSwitched",bot:{...n,...t.bot,computer:t.bot.computer,section:t.bot.section,toolScope:t.bot.toolScope,managedSections:t.bot.managedSections,messages:t.bot.messages,browserProfile:t.bot.browserProfile,vpsAlias:t.bot.vpsAlias,phoneApps:t.bot.phoneApps,onlyPeopleAdded:t.bot.onlyPeopleAdded}});const u=sn(d,t.bot.id,p=>({...p,...t.bot,threadId:c?t.bot.threadId:p.threadId,activeLeafId:c?null:p.activeLeafId,awaitingThreadSnapshot:c||p.awaitingThreadSnapshot,browserProfile:t.bot.browserProfile,computer:t.bot.computer,toolScope:t.bot.toolScope,section:t.bot.section,managedSections:t.bot.managedSections,vpsAlias:t.bot.vpsAlias,phoneApps:t.bot.phoneApps,onlyPeopleAdded:t.bot.onlyPeopleAdded,tasks:t.bot.tasks?qm(p.tasks,t.bot.tasks):p.tasks,messages:c?[]:p.messages,hasMore:c?void 0:p.hasMore}));return _c(u)}case"messageAdded":{const n=e.bots.find(u=>u.threadId===t.threadId);if(!n){const u=e.groups.find(h=>h.threadId===t.threadId||h.tasks?.some(x=>x.threadId===t.threadId));if(!u||u.threadId===t.threadId&&u.messages.some(h=>h.id===t.message.id))return e;const p=Rr(e,t.threadId,t.message.at,nd(t.message),t.message.turnCompletedAt??t.message.at);if(u.threadId!==t.threadId)return p;const m=t.message.sendId?u.messages.findIndex(h=>h.id===wl(t.message.sendId)):-1;return{...p,groups:p.groups.map(h=>h.id===u.id?{...h,messages:m>=0?h.messages.map((x,g)=>g===m?t.message:x):[...h.messages,t.message]}:h)}}if(n.messages.some(u=>u.id===t.message.id))return e;const a=Rr(e,t.threadId,t.message.at,nd(t.message),t.message.turnCompletedAt??t.message.at),r=t.message.sendId?wl(t.message.sendId):null,i=r?n.messages.findIndex(u=>u.id===r):-1;if(i>=0)return sn(a,n.id,u=>({...u,messages:u.messages.map((p,m)=>m===i?t.message:p),activeLeafId:u.activeLeafId===r?t.message.id:u.activeLeafId}));const o=sn(a,n.id,u=>{const p=(t.message.parentId??null)===(u.activeLeafId??null);return{...u,messages:[...u.messages,t.message],activeLeafId:p?t.message.id:u.activeLeafId}}),c=t.message.role==="user"&&t.message.kind==="text"&&t.message.queueId?"working":t.message.kind==="options"?"thinking":t.message.kind==="activity"?t.message.tool?.ok===!1?"failure":t.message.tool?.ok===!0?"success":"working":t.message.role==="bot"&&t.message.kind==="text"?"blink":null;return c?Qs(o,n.id,c):o}case"optimisticMessageRemoved":{const n=wl(t.sendId),a=(p,m)=>p.filter(h=>h.id!==n).map(h=>h.optimisticThreadOrderAt===m.at?{...h,optimisticThreadOrderAt:m.optimisticThreadOrderAt}:h),r=e.bots.find(p=>p.threadId===t.threadId);if(r){const p=r.messages.find(g=>g.id===n);if(!p)return e;const m=sn(e,r.id,g=>({...g,messages:a(g.messages,p),activeLeafId:g.activeLeafId===n?t.restoreLeafId!==void 0?t.restoreLeafId:p.parentId??null:g.activeLeafId})),h=r.tasks?.find(g=>g.threadId===t.threadId),x=m.bots.find(g=>g.id===r.id)?.messages??[];return L4(m,t.threadId,x,h?.createdAt??0,r.hasMore?p.optimisticThreadOrderAt:void 0)}const i=e.groups.find(p=>p.threadId===t.threadId),o=i?.messages.find(p=>p.id===n);if(!i||!o)return e;const c={...e,groups:e.groups.map(p=>p.id===i.id?{...p,messages:a(p.messages,o)}:p)},d=i.tasks?.find(p=>p.threadId===t.threadId),u=c.groups.find(p=>p.id===i.id)?.messages??[];return L4(c,t.threadId,u,d?.createdAt??i.createdAt,i.hasMore?o.optimisticThreadOrderAt:void 0)}case"messagePatched":{const n=nd(t.message)?Rr(e,t.threadId,t.message.at,!0,t.message.turnCompletedAt??t.message.at):e,a=n.bots.find(o=>o.threadId===t.threadId);if(!a){const o=n.groups.find(c=>c.threadId===t.threadId);return o?{...n,groups:n.groups.map(c=>c.id===o.id?{...c,messages:c.messages.map(d=>d.id===t.message.id?t.message:d)}:c)}:n}const r=t.message.kind==="activity"?t.message.tool?.ok===!1?"failure":t.message.tool?.ok===!0?"success":"working":null,i=r?Qs(n,a.id,r):n;return sn(i,a.id,o=>({...o,messages:o.messages.map(c=>c.id===t.message.id?t.message:c)}))}case"computerStart":{const{[t.botId]:n,...a}=e.computerStarts;return{...t.start?Qs(e,t.botId,"launch"):e,computerStarts:t.start?{...a,[t.botId]:t.start}:a}}case"computerControl":return{...e,computerControl:{...e.computerControl,[t.botId]:{held:t.held,helpReason:t.helpReason,help:t.help??null}}};case"modelVariantRuntime":{const n=t.event;if(!n.turnId)return e;const a=e.bots.find(o=>o.threadId===n.threadId||o.tasks?.some(c=>c.threadId===n.threadId));if(!a)return e;const r=rs(a,n.threadId).modelSelection;if(r.instanceId!==n.providerInstanceId||!e.instances.find(o=>o.instanceId===r.instanceId)?.capabilities?.modelVariants)return e;const i=e.modelVariantSessions[n.threadId];return n.type==="turn.started"?i&&(i.turnId===n.turnId||Date.parse(i.startedAt)>Date.parse(n.createdAt))?e:{...e,modelVariantSessions:{...e.modelVariantSessions,[n.threadId]:{instanceId:r.instanceId,model:r.model,turnId:n.turnId,startedAt:n.createdAt,acceptingUpdates:!0}}}:!i?.acceptingUpdates||i.turnId!==n.turnId||i.instanceId!==r.instanceId||i.model!==r.model?e:n.type==="session.model-variants"&&n.model===r.model?{...e,modelVariantSessions:{...e.modelVariantSessions,[n.threadId]:{...i,variants:n.variants}}}:n.type==="turn.completed"?{...e,modelVariantSessions:{...e.modelVariantSessions,[n.threadId]:{...i,acceptingUpdates:!1}}}:e}case"setModel":if(t.threadId){const n=Pa(e,{type:"updateTask",botId:t.botId,threadId:t.threadId,patch:{modelSelection:t.selection,resetApprovalToAsk:t.resetApprovalToAsk}});return sn(n,t.botId,a=>({...a,tasks:a.tasks?.map(r=>r.threadId!==t.threadId?r:{...r,followsBotModel:!!t.updateBotDefault||HA(t.selection,a.modelSelection)})}))}return _c(sn(e,t.botId,n=>({...n,modelSelection:t.selection})));case"updateTask":{const n=RT(t.patch);return _c(sn(e,t.botId,a=>({...a,tasks:(a.tasks??[{threadId:a.threadId,title:"New thread",createdAt:Date.now()}]).map(r=>r.threadId===t.threadId?{...r,...n}:r)})))}case"connected":return{...e,connected:t.value};case"error":return{...t.message&&e.selectedId?Qs(e,e.selectedId,"alert"):e,error:t.message};case"toggleSettings":{if(t.botId!==void 0&&!e.bots.some(o=>o.id===t.botId&&!o.hidden))return e;const n=t.botId??e.selectedId,a=t.open??(t.botId!==void 0||!e.settingsOpen),r=a&&!e.settingsOpen,i=t.section!==void 0;return{...e,selectedId:n,settingsOpen:a,activityOpen:a?!1:e.activityOpen,botSettingsSection:t.section??e.botSettingsSection,botSettingsExpandAccordion:a?i||r&&e.botSettingsSectionStored:!1,botSettingsExpandRemembered:a?!i&&r&&e.botSettingsSectionStored:!1,botSettingsSectionStored:i||e.botSettingsSectionStored,appSettingsOpen:a?!1:e.appSettingsOpen}}case"togglePlugins":{const n=t.open??!e.pluginsOpen;return{...e,pluginsOpen:n,pluginsSurface:t.surface??e.pluginsSurface,...n?{settingsOpen:!1,appSettingsOpen:!1,shortcutsOpen:!1}:{}}}case"botCreationPending":return{...e,botCreationPending:t.on};case"notice":return{...e,notice:t.notice};case"revealThread":return{...e,appSettingsOpen:!1,shortcutsOpen:!1,pluginsOpen:!1,revealThread:{threadId:t.threadId,nonce:(e.revealThread?.nonce??0)+1}};case"focusMessage":return{...e,focusMessage:{threadId:t.threadId,messageId:t.messageId,matchText:t.matchText,nonce:(e.focusMessage?.nonce??0)+1,consumed:!1}};case"focusMessageConsumed":return!e.focusMessage||e.focusMessage.nonce!==t.nonce?e:{...e,focusMessage:{...e.focusMessage,consumed:!0}};case"unreadDividerDone":return e.unreadDivider?.threadId===t.threadId?{...e,unreadDivider:null}:e;case"openDataResult":return e.bots.some(a=>a.id===t.botId)?{...Pa(Pa(e,{type:"select",id:t.botId}),{type:"toggleComputer",open:!0}),dataResultFocus:{botId:t.botId,id:t.cardId,requestId:(e.dataResultFocus?.requestId??0)+1,consumed:!1}}:e;case"dataResultFocusConsumed":return e.dataResultFocus?.requestId===t.requestId?{...e,dataResultFocus:{...e.dataResultFocus,consumed:!0}}:e;case"openSignIn":{if(!e.bots.some(i=>i.id===t.botId))return e;const n=Pa(Pa(e,{type:"select",id:t.botId}),{type:"toggleComputer",open:!0}),{type:a,...r}=t;return{...n,signInFocus:{...r,requestId:(e.signInFocus?.requestId??0)+1,consumed:!1}}}case"signInFocusConsumed":return e.signInFocus?.requestId===t.requestId?{...e,signInFocus:{...e.signInFocus,consumed:!0}}:e;case"toggleComputer":{const n=t.open??!e.computerOpen;return{...e,selectedId:t.botId!==void 0&&e.bots.some(a=>a.id===t.botId)?t.botId:e.selectedId,computerOpen:n,settingsOpen:n?!1:e.settingsOpen,inspectorOpen:n?!1:e.inspectorOpen,activityOpen:n?!1:e.activityOpen,appSettingsOpen:n?!1:e.appSettingsOpen,notificationsOpen:n&&!e.notificationsPinned?!1:e.notificationsOpen}}case"toggleInspector":{const n=t.open??!e.inspectorOpen;return{...e,inspectorOpen:n,settingsOpen:n?!1:e.settingsOpen,computerOpen:n?!1:e.computerOpen,activityOpen:n?!1:e.activityOpen,appSettingsOpen:n?!1:e.appSettingsOpen,notificationsOpen:n&&!e.notificationsPinned?!1:e.notificationsOpen}}case"toggleActivity":{const n=t.open??!e.activityOpen;return{...e,activityOpen:n,settingsOpen:n?!1:e.settingsOpen,computerOpen:n?!1:e.computerOpen,inspectorOpen:n?!1:e.inspectorOpen,appSettingsOpen:n?!1:e.appSettingsOpen,notificationsOpen:n&&!e.notificationsPinned?!1:e.notificationsOpen}}case"toggleNotifications":{const n=t.open??!e.notificationsOpen;return{...e,notificationsOpen:n,settingsOpen:n?!1:e.settingsOpen,computerOpen:n?!1:e.computerOpen,inspectorOpen:n?!1:e.inspectorOpen,activityOpen:n?!1:e.activityOpen,appSettingsOpen:n?!1:e.appSettingsOpen}}case"toggleNotificationsPinned":return{...e,notificationsPinned:t.pinned??!e.notificationsPinned};case"toggleAppSettings":{const n=t.open??!e.appSettingsOpen;return{...e,appSettingsOpen:n,activityOpen:n?!1:e.activityOpen,appSettingsSection:t.section??e.appSettingsSection,appSettingsCloudLink:t.cloudLink&&n?e.appSettingsCloudLink+1:0,appSettingsPhonePairing:t.phonePairing&&n?e.appSettingsPhonePairing+1:0,settingsOpen:n?!1:e.settingsOpen,computerOpen:n?!1:e.computerOpen,inspectorOpen:n?!1:e.inspectorOpen,pluginsOpen:n?!1:e.pluginsOpen,notificationsOpen:n&&!e.notificationsPinned?!1:e.notificationsOpen}}case"toggleShortcuts":{const n=t.open??!e.shortcutsOpen;return{...e,shortcutsOpen:n}}case"openCloudAdd":return e.cloudHowTo?{...e,cloudHowTo:!1}:e;case"closeCloudAdd":return e.cloudAdd?{...e,cloudAdd:null}:e;case"cloudHowTo":return e.cloudHowTo===t.open?e:{...e,cloudHowTo:t.open};case"toggleTour":{const n=t.open??!e.tourOpen;return{...e,tourOpen:n,appSettingsOpen:n?!1:e.appSettingsOpen}}case"toggleWelcome":{const n=t.open??!e.welcomeOpen;return{...e,welcomeOpen:n,appSettingsOpen:n?!1:e.appSettingsOpen,shortcutsOpen:n?!1:e.shortcutsOpen}}case"updateBot":{const a=Object.prototype.hasOwnProperty.call(t.patch,"color")||Object.prototype.hasOwnProperty.call(t.patch,"mascotExpression")?Qs(e,t.botId,"customize"):e,r=a.bots.find(b=>b.id===t.botId),i=t.patch.chiefOfStaff?{...a,bots:R4(a.bots,{...r,...t.patch,id:t.botId})}:a,{acknowledgeLocalAuto:o,applyToAllThreads:c,keepThreadModels:d,threadId:u,mainThreadChoice:p,computer:m,connectorTools:h,connectorScopes:x,phoneApps:g,cwd:v,...y}=t.patch,w={...y,...v!==void 0&&{cwd:v??void 0},...g!==void 0&&{phoneApps:g??void 0},...typeof p=="string"&&{mainThreadId:p}};return m===null?w.computer=void 0:m!==void 0&&(w.computer=m),h===null?w.connectorTools=void 0:h!==void 0&&(w.connectorTools=h),x===null?w.connectorScopes=void 0:x!==void 0&&(w.connectorScopes=x),sn(i,t.botId,b=>({...b,...w}))}case"threadActive":{const n=e.bots.find(a=>a.threadId===t.threadId);return n?sn(Hp(e,t.threadId),n.id,a=>({...a,activeLeafId:t.activeLeafId})):e}case"switchBranch":{const n=e.bots.find(r=>r.id===t.botId);if(!n)return e;let a=t.messageId;for(;;){const r=n.messages.filter(i=>i.parentId===a);if(!r.length)break;a=r.reduce((i,o)=>o.at>=i.at?o:i).id}return sn(Hp(e,n.threadId),t.botId,r=>({...r,activeLeafId:a}))}case"patchGroup":return{...e,groups:e.groups.map(n=>n.id===t.groupId?{...n,...t.patch}:n)};case"pendingQueued":{if(e.consumedQueueIds[t.queueId]){const a={...e.consumedQueueIds};return delete a[t.queueId],{...e,consumedQueueIds:a}}const n=e.pendingQueued[t.threadId]??[];return n.some(a=>a.queueId===t.queueId)?e:{...e,pendingQueued:{...e.pendingQueued,[t.threadId]:[...n,{queueId:t.queueId,text:t.text,...t.reason?{reason:t.reason}:{}}]}}}case"consumePendingQueued":{const n=e.pendingQueued[t.threadId]??[],a=n.findIndex(o=>o.queueId===t.queueId);if(a<0)return{...e,consumedQueueIds:jl(e.consumedQueueIds,t.queueId)};const r=n.filter((o,c)=>c!==a),i={...e.pendingQueued};return r.length?i[t.threadId]=r:delete i[t.threadId],{...e,pendingQueued:i,consumedQueueIds:jl(e.consumedQueueIds,t.queueId)}}case"cancelQueued":{const n=e.bots.find(c=>c.id===t.botId);if(!n)return e;const a=t.threadId??n.threadId,i=(e.pendingQueued[a]??[]).filter(c=>c.queueId!==t.queueId),o={...e.pendingQueued};return i.length?o[a]=i:delete o[a],{...e,pendingQueued:o,consumedQueueIds:jl(e.consumedQueueIds,t.queueId)}}case"steerQueued":return e;case"cancelGroupQueued":{const n=e.pendingQueued[t.threadId]??[],a=n.filter(i=>i.queueId!==t.queueId);if(a.length===n.length)return e;const r={...e.pendingQueued};return a.length?r[t.threadId]=a:delete r[t.threadId],{...e,pendingQueued:r}}case"send":{const n=Qs(ete(e,t.botId),t.botId,"working");if(!t.sendId)return n;const a=n.bots.find(o=>o.id===t.botId),r=t.threadId??a?.threadId;if(!a||r!==a.threadId||a.messages.some(o=>o.sendId===t.sendId))return n;const i=r1(t.text,t.sendId,t.replyToId,a.activeLeafId);return i.optimisticThreadOrderAt=a.tasks?.find(o=>o.threadId===r)?.lastThreadOrderAt,Rr(sn(n,a.id,o=>({...o,messages:[...o.messages,i],activeLeafId:i.id})),r,i.at,!0)}case"editMessage":{const n=Qs(e,t.botId,"working");if(!t.sendId)return n;const a=n.bots.find(c=>c.id===t.botId),r=t.threadId??a?.threadId;if(!a||r!==a.threadId||a.messages.some(c=>c.sendId===t.sendId))return n;const i=a.messages.find(c=>c.id===t.messageId);if(!i||i.role!=="user"||i.kind!=="text")return n;const o=r1(t.text.trim(),t.sendId,i.replyToId,i.parentId??null);return o.optimisticThreadOrderAt=a.tasks?.find(c=>c.threadId===r)?.lastThreadOrderAt,Rr(sn(n,a.id,c=>({...c,messages:[...c.messages,o],activeLeafId:o.id})),r,o.at,!0)}case"switchGroupTask":return e.selectedId===t.groupId&&e.activeView==="chat"?D4(e,t.groupId,t.threadId):e;case"newGroupTask":return e.selectedId===t.groupId&&e.activeView==="chat"?al(e):e;case"deleteTask":case"deleteGroupTask":case"regenerateTaskTitle":return e;case"newTask":return t.cwd!==void 0?e:{...al(e),selectedId:t.botId,activeView:"chat"};case"switchTask":{const{[t.threadId]:n,...a}=e.backgroundThreadEvents;return sn({...D4(e,t.botId,t.threadId),backgroundThreadEvents:a,selectedId:t.botId,activeView:"chat",revealThread:{threadId:t.threadId,nonce:(e.revealThread?.nonce??0)+1}},t.botId,r=>({...r,switchingTo:t.threadId}))}case"switchTaskFailed":return sn(e,t.botId,n=>n.switchingTo===t.threadId?{...n,switchingTo:void 0}:n);case"renameTask":return sn(e,t.botId,n=>({...n,tasks:(n.tasks??[]).map(a=>a.threadId===t.threadId?{...a,title:t.title}:a)}));case"renameGroupTask":return Pp(e,t.groupId,t.threadId,{title:t.title});case"pinGroupTask":return Pp(e,t.groupId,t.threadId,{pinned:t.pinned?!0:void 0});case"archiveGroupTask":return Pp(e,t.groupId,t.threadId,{archivedAt:t.archivedAt??void 0});case"setConversationTurnLimit":return t.dm?{...e,groups:e.groups.map(n=>n.id===t.groupId?{...n,turnTimeoutMinutes:t.minutes??void 0}:n)}:Pp(e,t.groupId,t.threadId,{turnTimeoutMinutes:t.minutes??void 0});case"taskSwitched":{let n=sn(Hp(e,t.bot.threadId),t.bot.id,o=>({...o,...t.bot,computer:t.bot.computer,toolScope:t.bot.toolScope,managedSections:t.bot.managedSections,vpsAlias:t.bot.vpsAlias,messages:t.bot.messages??[],hasMore:t.bot.hasMore,awaitingThreadSnapshot:!1,switchingTo:void 0}));for(const o of e.backgroundThreadEvents[t.bot.threadId]??[])n=Pa(n,o);const{[t.bot.threadId]:a,...r}=n.backgroundThreadEvents;n={...n,backgroundThreadEvents:r};const i=n.bots.find(o=>o.id===t.bot.id);return i&&i.id===n.selectedId&&(n={...n,unreadDivider:m1(n,i.threadId,Y4(i),zs(i),G4(i),i.hasMore)},n.activeView==="chat"&&(n=sn(n,i.id,o=>({...o,unread:!!o.tasks?.some(c=>c.threadId!==o.threadId&&c.unread),tasks:o.tasks?.map(c=>c.threadId===o.threadId?{...c,unread:!1}:c)})))),_c(qp(n,[t.bot]))}case"newBot":return t.preserveSelection?e:{...e,settingsOpen:!1,appSettingsOpen:!1,pluginsOpen:!1,shortcutsOpen:!1};case"duplicateBot":case"createProject":case"updateProject":case"deleteProject":case"reorderProjects":case"interrupt":case"createGroup":case"deleteGroup":case"interruptGroup":case"setGroupHold":case"steerGroupQueued":case"createRoutine":case"updateRoutine":case"deleteRoutine":case"runRoutine":case"cancelRoutineRun":case"markRoutineRunSeen":case"markAllRoutineRunsSeen":case"refreshTaskPermissions":case"followBotModel":case"loadDataSheet":return e;case"dataSheet":return{...e,dataSheets:{...e.dataSheets,[t.sheet.botId]:t.sheet},...t.tables?{dataTables:{...e.dataTables,[t.sheet.botId]:t.tables}}:{}};case"dataView":return{...e,dataView:t.view};case"sendGroup":{if(!t.sendId)return e;const n=e.groups.find(o=>o.id===t.groupId);if(!n)return e;const a=t.threadId??n.threadId;if(a===n.threadId&&n.messages.some(o=>o.sendId===t.sendId))return e;const r=r1(t.text,t.sendId,t.replyToId,null,t.mode??"chat");r.optimisticThreadOrderAt=n.tasks?.find(o=>o.threadId===a)?.lastThreadOrderAt;const i=Rr(e,a,r.at,a===n.threadId);return a!==n.threadId?i:{...i,groups:i.groups.map(o=>o.id===n.id?{...o,messages:[...o.messages,r]}:o)}}}}function tte(e){const t=e&&typeof e=="object"&&"tables"in e?e.tables:void 0;return Array.isArray(t)?t.filter(n=>n&&typeof n.name=="string"):[]}function nte(e,t){const n=e&&typeof e=="object"&&"sheet"in e?e.sheet:e;if(n&&typeof n=="object"&&Array.isArray(n.cards)){const a=n;return{...a,botId:a.botId||t,sources:Array.isArray(a.sources)?a.sources:[]}}return{version:1,botId:t,cards:[],sources:[],updatedAt:new Date(0).toISOString()}}const ste={modelVariantSessions:{},backgroundThreadEvents:{},loadingOlder:{},transcriptGeneration:{},bots:[],groups:[],sections:[],instances:[],config:null,liveCall:null,liveCallVersion:0,liveCallLookupSeq:0,selectedId:"",activeView:"chat",routines:[],routineRuns:[],routineRunsSince:null,routinesLoadState:"loading",routinesFocus:{nonce:0},filesSuggest:null,webhooks:[],webhookAttempts:[],webhookIngress:null,settingsOpen:!1,pluginsOpen:!1,pluginsSurface:"apps",botCreationPending:!1,computerOpen:!1,inspectorOpen:!1,activityOpen:!1,notificationsOpen:!1,notificationsPinned:!1,notifications:[],appSettingsOpen:!1,appSettingsSection:"general",appSettingsCloudLink:0,appSettingsPhonePairing:0,shortcutsOpen:!1,cloudAdd:null,cloudHowTo:!1,welcomeOpen:!1,tourOpen:!1,botSettingsSection:"overview",botSettingsExpandAccordion:!1,botSettingsSectionStored:!1,botSettingsExpandRemembered:!1,computerStarts:{},deletingBots:{},computerControl:{},dataSheets:{},dataTables:{},dataResultFocus:null,signInFocus:null,dataView:null,focusMessage:null,unreadDivider:null,connected:!1,error:null,notice:null,revealThread:null,mascotMotion:null,pendingQueued:{},consumedQueueIds:{}},dd=200,mN=80;function Nd(){if(!(typeof window>"u"||!window.ogb?.approvals))return mx().host.packaged?window.ogb.approvals:void 0}async function ate(e,t,n,a,r=K){const{approvalMode:i,autoApprove:o,acknowledgeLocalAuto:c,...d}=n,u=i??(o===void 0?void 0:o?"auto":"ask");if(u==="custom"&&!a)throw new Error(l("approvalMode.needsDesktopApp"));return u&&a?(Object.keys(d).length&&await r(`/api/bots/${e}/tasks/${t}`,{method:"PATCH",body:JSON.stringify(d)}),a.setMode(e,u,{threadId:t,threadOnly:!0,acknowledgeLocalAuto:c===!0})):(await r(`/api/bots/${e}/tasks/${t}`,{method:"PATCH",body:JSON.stringify({...d,approvalMode:i,autoApprove:o,acknowledgeLocalAuto:c})})).bot}async function zT(e,t,n,a=K,r=Nd(),i,o=!1){const{approvalMode:c,applyToAllThreads:d,...u}=t,p=c!==void 0&&c!=="custom"&&(En(i??{})==="custom"||d===!0&&_T(i??{}).includes("custom"));if(!(c==="custom"||p||c==="full"&&r!==void 0)){const v=JSON.stringify(c===void 0?u:{...u,approvalMode:c,...d?{applyToAllThreads:!0}:{}});return(await a(`/api/bots/${e}`,{method:"PATCH",body:v,signal:n,keepalive:o&&jee(v)})).bot}if(!r||c===void 0)throw new Error(l("approvalMode.levelNeedsDesktopApp"));const h={acknowledgeLocalAuto:u.acknowledgeLocalAuto===!0,...d?{allThreads:!0}:{}},x=async()=>{if(n.aborted){if(c==="full"||c==="custom")try{await r.setMode(e,"ask",{acknowledgeLocalAuto:!1,...d?{allThreads:!0}:{}})}catch(v){throw new Error(l("approvalMode.revokeFailed",{mode:l(c==="full"?"approvalMode.full.label":"approvalMode.custom.name"),error:v instanceof Error?v.message:String(v)}))}throw new DOMException("The bot update was cancelled","AbortError")}};if(p){const v=await r.setMode(e,c,h);return await x(),Object.keys(u).length===0?v:(await a(`/api/bots/${e}`,{method:"PATCH",body:JSON.stringify(u),signal:n})).bot}if(Object.keys(u).length>0&&await a(`/api/bots/${e}`,{method:"PATCH",body:JSON.stringify(u),signal:n}),n.aborted)throw new DOMException("The bot update was cancelled","AbortError");const g=await r.setMode(e,c,h);return await x(),g}const Wp=new Map;async function rte(e,t,n){const a=Wp.get(e);if(a)return a;const r=(async()=>{n(e,await t(e))})();Wp.set(e,r);try{await r}finally{Wp.get(e)===r&&Wp.delete(e)}}function PT(e){return e instanceof Error?e:new Error(String(e))}async function ite(e,t,n){const[a,...r]=await Promise.allSettled([e(),...t.map(i=>i.load())]);return r.forEach((i,o)=>{i.status==="rejected"&&n(t[o],PT(i.reason))}),a.status==="fulfilled"}function ote(e){return EZ(e),e.type==="turn.started"||e.type==="session.model-variants"||e.type==="turn.completed"?{type:"modelVariantRuntime",event:e}:null}const np=f.createContext(null);function lte(e){const t=PZ();return t?{...e,botSettingsSection:t,botSettingsSectionStored:!0}:e}function cte({children:e}){const t=f.useRef(new Map).current,n=j=>({...j,tasks:j.tasks?.map(N=>({...N,...RT(t.get(N.threadId)?.patch??{})}))}),[a,r]=f.useReducer(Pa,ste,j=>pX(lte(j))),i=f.useRef(a),o=f.useRef(0);i.current=a;const c=et(),d=f.useRef(c);d.current=c;const u=f.useCallback(()=>{r({type:"error",message:null})},[]);Eee(a.error,u),f.useEffect(()=>{a.selectedId&&LZ(a.selectedId)},[a.selectedId]),f.useEffect(()=>{a.settingsOpen&&a.botSettingsExpandAccordion&&DZ(a.botSettingsSection)},[a.settingsOpen,a.botSettingsExpandAccordion,a.botSettingsSection]);const p=f.useMemo(()=>wee({send:(j,N,A,T,M)=>zT(j,N,A,K,Nd(),T,M),reconcile:async(j,N)=>(await K(`/api/bots?messages=${dd}`,{signal:N})).bots.find(T=>T.id===j)??null,onAuthoritative:(j,N)=>{r({type:"botPatched",bot:n({...j,...N})})},onError:j=>{r({type:"error",message:j.message})}}),[]);f.useEffect(()=>{p.revive();const j=Nee(p,window);return()=>{j(),p.dispose()}},[p]);const m=f.useMemo(()=>{const j=new Map,N=kX(()=>i.current,r),A=new Set,T=See();let M=!1;const S=_=>{EA(_)||(Cee(_)?$({type:"notice",notice:{kind:"note",botName:null,text:_.message}}):r({type:"error",message:_ instanceof Error?_.message:String(_)}))},C=_=>B=>{S(B),K("/api/bots?messages=0").then(W=>{const R=vX(_,W);R?.type==="botPatched"?r({...R,bot:n({...R.bot,...p.overlayFor(R.bot.id)})}):R&&r(R)}).catch(()=>{})},O=_=>{const B=_.groupId?i.current.groups.find(W=>W.id===_.groupId):i.current.bots.find(W=>W.id===_.botId);return{host:B,card:B?.messages.find(W=>W.id===_.messageId)?.card,inRoom:!!_.groupId}},L=(_,B,W)=>{fetch(`/api/bots/${_}/cards/${B}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(W)}).catch(()=>{})},D=async(_,B)=>{const W=B?t.get(B)?.execution:void 0,R=[...t.values()].filter(q=>q.updatesDefault&&_.some(F=>F.id===q.botId));await Promise.all([W,...R.map(q=>q.execution),..._.map(async q=>{const F=await p.flush(q.id);if(!F)return;const E=q.modelSelection;if(En(F)!==En(q)||F.memoryEnabled!==!1!=(q.memoryEnabled!==!1)||F.modelSelection.instanceId!==E.instanceId||F.modelSelection.model!==E.model||F.modelSelection.effort!==E.effort||F.modelSelection.variant!==E.variant)throw new Error(l("approvalMode.settingsNotSaved"))})]),B&&await t.get(B)?.execution},z=(_,B,W)=>{const R=t.get(B),q=W.updateBotDefault||W.approvalMode!==void 0?[...t.values()].filter(U=>U.botId===_):[],F=Promise.all([R?.promise,...q.map(U=>U.promise)].map(U=>U?.catch(()=>{}))).then(async()=>{const U=W.resetApprovalToAsk?vw():void 0;return U?U.setMode(_,"ask",{threadId:B,modelSelection:W.modelSelection,updateBotDefault:!!W.updateBotDefault}):ate(_,B,W,Nd())}),E=Promise.all([R?.execution,F]);E.catch(()=>{});const H={botId:_,updatesDefault:!!(W.updateBotDefault||R?.updatesDefault),patch:{...R?.patch,...W},promise:F,execution:E};t.set(B,H),H.promise.then(U=>{t.get(B)===H&&(t.delete(B),U&&r({type:"botPatched",bot:n(U)}))}).catch(U=>{S(U),t.get(B)===H&&(H.patch={},UQ(()=>t.get(B)===H,()=>K(`/api/bots?messages=${dd}`).then(({bots:V})=>{const G=t.get(B)===H?V.find(Q=>Q.id===_):void 0;G&&(r({type:"botPatched",bot:n(G)}),t.delete(B))})))})},P=_=>{const B=i.current,W=new Set;for(const R of B.bots)(R.threadId===_||R.tasks?.some(q=>q.threadId===_))&&W.add(R.id);for(const R of B.groups)if(R.threadId===_||R.tasks?.some(q=>q.threadId===_))for(const q of R.memberIds)W.add(q);return B.bots.filter(R=>W.has(R.id))},$=_=>{["select","newTask","switchTask","newGroupTask","switchGroupTask","showChat","showRoutines","showTeamMap","showFiles","showWebPanel"].includes(_.type)&&o.current++,_=Zee(_,i.current.bots),_.type==="taskSwitched"&&(_={..._,bot:n(_.bot)}),_.type==="botPatched"&&(_={..._,bot:n(_.bot)}),(_.type==="send"||_.type==="sendGroup"||_.type==="editMessage")&&!_.sendId&&(_={..._,sendId:ya()});const B=_.type==="updateBot"||_.type==="setModel"?i.current.bots.find(E=>E.id===_.botId):void 0,W=_.type==="send"?i.current.bots.find(E=>E.id===_.botId):void 0,R=_.type==="editMessage"?i.current.bots.find(E=>E.id===_.botId)?.activeLeafId??null:null,q=(()=>{if(_.type==="editMessage"||_.type==="answerCard"){const E=i.current.bots.find(H=>H.id===_.botId);return E?[E]:[]}if(_.type==="decideRequest"){const E=P(_.threadId);if(!_.alwaysAllow||E.some(U=>U.id===_.alwaysAllow?.botId))return E;const H=i.current.bots.find(U=>U.id===_.alwaysAllow?.botId);return H?[...E,H]:E}if(_.type==="sendGroup"){const E=i.current.groups.find(H=>H.id===_.groupId)?.memberIds??[];return i.current.bots.filter(H=>E.includes(H.id))}if(_.type==="runRoutine"){const E=i.current.routines.find(U=>U.id===_.routineId);if(!E)return[];const H=new Set([E.botId]);if(E.target==="room-goal"&&E.groupId){const U=i.current.groups.find(V=>V.id===E.groupId);for(const V of U?.memberIds??[])H.add(V)}return i.current.bots.filter(U=>H.has(U.id))}return[]})(),F=(()=>{if(_.type==="send")return W?LT(W):void 0})();switch(_.type!=="cancelQueued"&&_.type!=="cancelGroupQueued"&&_.type!=="deleteBot"&&r(_),_.type){case"loadOlderMessages":{if(A.has(_.threadId))break;A.add(_.threadId);const E=i.current,U=[...E.bots,...E.groups].find(G=>G.threadId===_.threadId)?.messages[0]?.id,V=E.transcriptGeneration[_.threadId]??0;if(!U){A.delete(_.threadId),r({type:"olderMessages",threadId:_.threadId,generation:V,messages:[],hasMore:!1});break}K(`/api/threads/${_.threadId}/messages?limit=${dd}&before=${encodeURIComponent(U)}`).finally(()=>A.delete(_.threadId)).then(G=>r({type:"olderMessages",threadId:_.threadId,generation:V,messages:G.messages??[],hasMore:!!G.hasMore})).catch(G=>{r({type:"olderMessages",threadId:_.threadId,generation:V,messages:[],hasMore:!0}),S(G)});break}case"notice":_.notice&&setTimeout(()=>r({type:"notice",notice:null}),_.notice.kind==="note"?2e4:6e3);break;case"createRoutine":K("/api/routines",{method:"POST",body:JSON.stringify(_.input)}).catch(S);break;case"updateRoutine":K(`/api/routines/${_.routineId}`,{method:"PATCH",body:JSON.stringify(_.patch)}).then(({routine:E})=>r({type:"routinePatched",routine:E}),S);break;case"deleteRoutine":K(`/api/routines/${_.routineId}`,{method:"DELETE"}).catch(S);break;case"runRoutine":D(q).then(()=>K(`/api/routines/${_.routineId}/run`,{method:"POST"})).then(({run:E})=>_.onStarted?.(E)).catch(E=>{_.onError?_.onError(E):S(E)}).finally(()=>_.onSettled?.());break;case"cancelRoutineRun":K(`/api/routine-runs/${_.runId}/cancel`,{method:"POST"}).catch(S);break;case"loadDataSheet":K(AA.sheet(_.botId)).then(E=>r({type:"dataSheet",sheet:nte(E,_.botId),tables:tte(E)})).catch(E=>(_.onError??S)(E instanceof Error?E.message:String(E)));break;case"markRoutineRunSeen":K(`/api/routine-runs/${_.runId}/seen`,{method:"POST"}).catch(S);break;case"markAllRoutineRunsSeen":K("/api/routine-runs/seen-all",{method:"POST"}).catch(S);break;case"cancelQueued":K(`/api/bots/${_.botId}/queue/${_.queueId}`,{method:"DELETE",body:JSON.stringify({threadId:_.threadId})}).then(()=>{r(_),_.onCancelled?.()}).catch(S);break;case"steerQueued":K(`/api/bots/${_.botId}/queue/${_.queueId}/steer`,{method:"POST",body:JSON.stringify({threadId:_.threadId})}).then(E=>{if(E?.steered===!0&&Array.isArray(E.messages)&&typeof E.threadId=="string"){for(const H of E.messages)r({type:"messageAdded",threadId:E.threadId,message:H});for(const H of E.queueIds??[])r({type:"consumePendingQueued",threadId:E.threadId,queueId:H})}else E?.queued===!0&&E.blockedBy==="images"&&$({type:"notice",notice:{kind:"steer-images",botName:null}});_.onSettled?.()}).catch(E=>{S(E),_.onError?.()});break;case"cancelGroupQueued":K(`/api/groups/${_.groupId}/queue/${_.queueId}`,{method:"DELETE"}).then(()=>{r(_),_.onCancelled?.()}).catch(S);break;case"steerGroupQueued":K(`/api/groups/${_.groupId}/queue/${_.queueId}/steer`,{method:"POST",body:JSON.stringify({threadId:_.threadId})}).then(E=>{if(E?.steered===!0&&Array.isArray(E.messages)&&typeof E.threadId=="string"){for(const H of E.messages)r({type:"messageAdded",threadId:E.threadId,message:H});for(const H of E.queueIds??[])r({type:"consumePendingQueued",threadId:E.threadId,queueId:H})}else E?.queued===!0&&E.blockedBy==="images"&&$({type:"notice",notice:{kind:"steer-images",botName:null}});_.onSettled?.()}).catch(E=>{S(E),_.onError?.()});break;case"send":{F&&L(_.botId,F.id,{dismissed:!0});const E=_.threadId??i.current.bots.find(V=>V.id===_.botId)?.threadId,H=_.sendId??ya(),U=()=>mX(i.current.bots.find(V=>V.id===_.botId&&V.threadId===E)?.messages,H);D(W?[W]:[],E).then(()=>hX(()=>K(`/api/bots/${_.botId}/messages`,{method:"POST",body:JSON.stringify({text:_.text,replyToId:_.replyToId,threadId:E,sendId:H,..._.dataContext?{dataContext:_.dataContext}:{},..._.pointed?.length?{pointed:_.pointed}:{},..._.openPage?{openPage:_.openPage}:{},..._.mode==="goal"?{mode:"goal"}:{},..._.followUp?{followUp:_.followUp}:{},..._.mentions?.length?{mentions:_.mentions}:{}})}),U)).then(V=>{if(!("body"in V))return;const G=V.body;G?.message&&typeof G.threadId=="string"&&r({type:"messageAdded",threadId:G.threadId,message:G.message}),G?.queued&&typeof G.threadId=="string"&&typeof G.queueId=="string"&&(r({type:"optimisticMessageRemoved",threadId:G.threadId,sendId:H}),r({type:"pendingQueued",threadId:G.threadId,queueId:G.queueId,text:_.text,reason:G.reason==="capacity"||G.reason==="group-turn"?G.reason:void 0}))}).catch(V=>{E&&r({type:"optimisticMessageRemoved",threadId:E,sendId:H}),S(V),_.onError?.()});break}case"editMessage":{const E=_.threadId??i.current.bots.find(U=>U.id===_.botId)?.threadId,H=_.sendId??ya();D(q,E).then(()=>K(`/api/bots/${_.botId}/messages/${_.messageId}/edit`,{method:"POST",body:JSON.stringify({text:_.text.trim(),threadId:E,sendId:H})})).then(U=>{U?.message&&E&&r({type:"messageAdded",threadId:E,message:U.message})}).catch(U=>{E&&r({type:"optimisticMessageRemoved",threadId:E,sendId:H,restoreLeafId:R}),S(U)});break}case"switchBranch":K(`/api/bots/${_.botId}/active-branch`,{method:"POST",body:JSON.stringify({messageId:_.messageId,threadId:_.threadId})}).catch(S);break;case"decideRequest":{const E=()=>K(`/api/threads/${_.threadId}/respond`,{method:"POST",body:JSON.stringify({requestId:_.requestId,behavior:_.behavior,message:_.message,reviewedSha256:_.reviewedSha256,always:_.always,rememberCommand:_.rememberCommand,..._.room===!1?{room:!1}:{}})});D(q,_.threadId).then(async()=>{if(_.alwaysAllow){const U=i.current.bots.find(Q=>Q.id===_.alwaysAllow?.botId),V=U?.tasks?.some(Q=>Q.threadId===_.threadId),G=[...new Set([...U?rs(U,_.threadId).alwaysAllow??[]:[],_.alwaysAllow.key])];try{await K(V?`/api/bots/${_.alwaysAllow.botId}/always-allow`:`/api/bots/${_.alwaysAllow.botId}`,{method:V?"POST":"PATCH",body:JSON.stringify(V?{threadId:_.threadId,allowKey:_.alwaysAllow.key}:{alwaysAllow:G})})}catch(Q){S(Q)}}const H=await E();H?.settlementPending&&typeof H.message=="string"&&S(new Error(H.message))}).catch(H=>{S(H),_.onError?.(H instanceof Error?H.message:String(H))});break}case"answerCard":{const{host:E,card:H,inRoom:U}=O(_);D(q,_.threadId).then(()=>{if(H?.requestId&&E){const V=H.skillRequest?{behavior:AX(_.answer)}:jZ(H,_.answer);return K(`/api/threads/${_.threadId??E.threadId}/respond`,{method:"POST",body:JSON.stringify({requestId:H.requestId,...V,reviewedSha256:V.behavior==="allow"&&H.skillRequest?c2(H.skillRequest):void 0})})}if(!U)return L(_.botId,_.messageId,{answered:_.answer,dismissed:!0}),K(`/api/bots/${_.botId}/messages`,{method:"POST",body:JSON.stringify({text:_.answer,threadId:_.threadId})})}).catch(V=>{H?.requestId&&E&&r({type:"answerCardFailed",botId:_.botId,messageId:_.messageId,answer:_.answer,groupId:_.groupId}),S(V)});break}case"dismissCard":{const{host:E,card:H,inRoom:U}=O(_);H?.requestId&&E?K(`/api/threads/${_.threadId??E.threadId}/respond`,{method:"POST",body:JSON.stringify({requestId:H.requestId,...iT(H)})}).catch(()=>{}):U||L(_.botId,_.messageId,{dismissed:!0});break}case"newBot":{if(M4(i.current)||M||i.current.botCreationPending)break;M=!0,r({type:"botCreationPending",on:!0}),Oe(async()=>{const{makeNewBot:E}=await import("./new-bot-BI0T02kV.js").then(H=>H.n);return{makeNewBot:E}},__vite__mapDeps([0,1,2,3,4])).then(({makeNewBot:E})=>E(_,i.current.bots,$,d.current)).catch(S).finally(()=>{M=!1,r({type:"botCreationPending",on:!1})});break}case"duplicateBot":{if(M4(i.current))break;const E=i.current.bots.find(U=>U.id===_.botId);if(!E)break;const H=MX(E);K("/api/bots",{method:"POST",body:JSON.stringify(TX(E))}).then(({bot:U,paused:V})=>K(`/api/bots/${U.id}`,{method:"PATCH",body:JSON.stringify(H)}).then(({bot:G})=>{r({type:"botAdded",bot:{...U,...G,messages:U.messages}}),V&&OQ(U.id)})).catch(S);break}case"deleteBot":r({type:"botDeletionPending",botId:_.botId,on:!0}),rte(_.botId,async E=>(await p.flush(E),K(`/api/bots/${E}`,{method:"DELETE"})),(E,H)=>{p.cancel(E),r({type:"deleteBot",botId:E}),H?.notice&&$({type:"notice",notice:{kind:"note",botName:null,text:H.notice}})}).catch(S).finally(()=>r({type:"botDeletionPending",botId:_.botId,on:!1}));break;case"markUnread":K(`/api/bots/${_.botId}`,{method:"PATCH",body:JSON.stringify({unread:!0})}).catch(()=>{});break;case"openDataResult":case"select":{const E=_.type==="select"?_.id:_.botId,H=i.current.bots.find(V=>V.id===E),U=i.current.groups.find(V=>V.id===E);H?.unread?K(`/api/bots/${E}/read`,{method:"POST",body:JSON.stringify({threadId:H.threadId})}).catch(()=>{}):U?.unread&&K(`/api/groups/${E}/read`,{method:"POST"}).catch(()=>{});break}case"createGroup":K("/api/groups",{method:"POST",body:JSON.stringify({memberIds:_.memberIds,name:_.name,section:_.section,...window.ogb?.remoteClient?.active?{setup:{bulletin:"",defaultResponder:{kind:"mentions"}}}:{}})}).then(({group:E})=>{r({type:"groupPatched",group:E}),r({type:"select",id:E.id})}).catch(S);break;case"sendGroup":{const E=_.threadId??i.current.groups.find(U=>U.id===_.groupId)?.threadId,H=_.sendId??ya();D(q).then(()=>K(`/api/groups/${_.groupId}/messages`,{method:"POST",body:JSON.stringify({text:_.text,replyToId:_.replyToId,threadId:E,sendId:H,mode:_.mode??"chat",..._.mentions?.length?{mentions:_.mentions}:{}})})).then(U=>{U?.message&&typeof U.threadId=="string"&&r({type:"messageAdded",threadId:U.threadId,message:U.message}),U?.queued&&typeof U.threadId=="string"&&typeof U.queueId=="string"&&(r({type:"optimisticMessageRemoved",threadId:U.threadId,sendId:H}),r({type:"pendingQueued",threadId:U.threadId,queueId:U.queueId,text:_.text}))}).catch(U=>{E&&r({type:"optimisticMessageRemoved",threadId:E,sendId:H}),S(U),_.onError?.()});break}case"patchGroup":K(`/api/groups/${_.groupId}`,{method:"PATCH",body:JSON.stringify(_.patch)}).catch(C({groupId:_.groupId}));break;case"deleteGroup":K(`/api/groups/${_.groupId}`,{method:"DELETE"}).catch(S);break;case"setModel":if(_.threadId){z(_.botId,_.threadId,{modelSelection:_.selection,..._.updateBotDefault?{updateBotDefault:!0}:{},..._.resetApprovalToAsk?{resetApprovalToAsk:!0}:{}});break}B&&p.enqueue(_.botId,{modelSelection:_.selection,threadId:B.switchingTo??B.threadId},B);break;case"updateTask":z(_.botId,_.threadId,_.patch);break;case"refreshTaskPermissions":{const E=i.current.bots.find(X=>X.id===_.botId),H=E?.tasks?.find(X=>X.threadId===_.threadId);if(!E||!H){S(new Error(l("task.threadGone")));break}const U=En(E),V=En(rs(E,_.threadId)),G=_.acknowledgeLocalAuto===!0,Q=Nd();(U==="custom"||V==="custom"||U==="full"&&Q!==void 0?Q?Q.setMode(_.botId,U,{threadId:_.threadId,threadOnly:!0,refreshPermissions:!0,acknowledgeLocalAuto:G}):Promise.reject(new Error(l("approvalMode.needsDesktopApp"))):K(`/api/bots/${_.botId}/tasks/${_.threadId}`,{method:"PATCH",body:JSON.stringify({refreshPermissions:!0,...G?{acknowledgeLocalAuto:!0}:{}})}).then(X=>X.bot)).then(X=>{X&&r({type:"botPatched",bot:n(X)})}).catch(S);break}case"followBotModel":K(`/api/bots/${_.botId}/threads/follow-model`,{method:"POST",body:"{}"}).then(({bot:E,busy:H})=>{r({type:"botPatched",bot:n(E)}),_.onSettled?.({busy:H??0})}).catch(S);break;case"createProject":K(`/api/bots/${_.botId}/projects`,{method:"POST",body:JSON.stringify({name:_.name,emoji:_.emoji})}).then(({bot:E,project:H})=>{m({type:"botPatched",bot:E}),_.onCreated?.(H)}).catch(E=>{S(E),_.onError?.(E instanceof Error?E.message:String(E))});break;case"updateProject":K(`/api/bots/${_.botId}/projects/${_.projectId}`,{method:"PATCH",body:JSON.stringify(_.patch)}).then(({bot:E})=>{m({type:"botPatched",bot:E}),_.onSaved?.()}).catch(E=>{S(E),_.onError?.(E instanceof Error?E.message:String(E))});break;case"deleteProject":K(`/api/bots/${_.botId}/projects/${_.projectId}`,{method:"DELETE"}).then(({bot:E})=>{m({type:"botPatched",bot:E}),_.onDeleted?.()}).catch(E=>{S(E),_.onError?.(E instanceof Error?E.message:String(E))});break;case"reorderProjects":K(`/api/bots/${_.botId}/projects/order`,{method:"PATCH",body:JSON.stringify({projectIds:_.projectIds})}).then(({bot:E})=>{m({type:"botPatched",bot:E}),_.onSaved?.()}).catch(E=>{S(E),_.onError?.(E instanceof Error?E.message:String(E))});break;case"interrupt":MZ(K,_,S);break;case"newTask":case"switchTask":{const E=_.type==="newTask"?T(_,()=>m(_)):()=>{};if(!E)break;const H=(j.get(_.botId)??0)+1;j.set(_.botId,H);const U=o.current;(_.type==="newTask"?p.flush(_.botId):Promise.resolve()).then(()=>K(_.type==="newTask"?`/api/bots/${_.botId}/tasks`:`/api/bots/${_.botId}/tasks/${_.threadId}${_.whole?"":`?messages=${mN}`}`,{method:"POST",body:JSON.stringify(_.type==="newTask"?{projectId:_.projectId,cwd:_.cwd}:{})})).then(G=>{if(_.type==="newTask"&&(E(null),_.onCreated?.()),j.get(_.botId)!==H)return;if(!G?.bot){_.type==="switchTask"&&r({type:"switchTaskFailed",botId:_.botId,threadId:_.threadId});return}const Q=_.type==="newTask"&&_.cwd!==void 0;Q&&o.current!==U||(m({type:"taskSwitched",bot:G.bot}),Q&&r({type:"select",id:_.botId}))}).catch(G=>{_.type==="switchTask"&&j.get(_.botId)===H&&r({type:"switchTaskFailed",botId:_.botId,threadId:_.threadId});const Q=G instanceof Error?G.message:String(G);E(Q),_.type==="newTask"&&_.onError?_.onError(Q):S(G)});break}case"renameTask":K(`/api/bots/${_.botId}/tasks/${_.threadId}`,{method:"PATCH",body:JSON.stringify({title:_.title})}).catch(C({botId:_.botId}));break;case"regenerateTaskTitle":K(`/api/bots/${_.botId}/tasks/${_.threadId}/title`,{method:"POST"}).then(()=>_.onSettled?.(!0)).catch(E=>{S(E),_.onSettled?.(!1)});break;case"deleteTask":K(`/api/bots/${_.botId}/tasks/${_.threadId}`,{method:"DELETE"}).then(E=>E?.bot&&m({type:"botPatched",bot:E.bot})).catch(S);break;case"newGroupTask":K(`/api/groups/${_.groupId}/tasks`,{method:"POST",body:"{}"}).then(N(_.groupId,!0)).catch(S);break;case"switchGroupTask":K(`/api/groups/${_.groupId}/tasks/${_.threadId}?messages=${mN}`,{method:"POST"}).then(N(_.groupId,!0)).catch(S);break;case"renameGroupTask":case"pinGroupTask":case"archiveGroupTask":case"setConversationTurnLimit":{const E=_.type==="renameGroupTask"?{title:_.title}:_.type==="pinGroupTask"?{pinned:_.pinned,title:_.title}:_.type==="archiveGroupTask"?{archivedAt:_.archivedAt}:{turnTimeoutMinutes:_.minutes},H=_.type==="setConversationTurnLimit"&&_.dm?`/api/groups/${_.groupId}`:`/api/groups/${_.groupId}/tasks/${_.threadId}`;K(H,{method:"PATCH",body:JSON.stringify(E)}).catch(C({groupId:_.groupId}));break}case"deleteGroupTask":K(`/api/groups/${_.groupId}/tasks/${_.threadId}`,{method:"DELETE"}).then(N(_.groupId,!1)).catch(S);break;case"setGroupHold":K(`/api/groups/${_.groupId}/holds`,{method:"POST",body:JSON.stringify({botId:_.botId,held:_.held})}).then(N(_.groupId,!1)).catch(S);break;case"interruptGroup":K(`/api/groups/${_.groupId}/interrupt`,{method:"POST",body:_.threadId?JSON.stringify({threadId:_.threadId}):void 0}).catch(E=>{S(E),_.onError?.()});break;case"updateBot":{B&&p.enqueue(_.botId,_.patch,B);break}}};return $},[p]),h=f.useRef(!1);f.useEffect(()=>{if(!a.hydrated||h.current)return;h.current=!0;const j=a.bots.find(N=>N.id===a.selectedId);j&&a.activeView==="chat"&&Io(j,c)!==j.threadId&&$t(m,j,c)},[a.hydrated,a.bots,a.selectedId,a.activeView,c,m]),f.useEffect(()=>{let j=!0;const N=new Map,A=E=>{let H=N.get(E);return H||(H={attempt:0,generation:0,timer:null,version:0},N.set(E,H)),H},T=[{key:"instances",request:async()=>{const E=await Bf("/api/instances",async()=>Lp(await K("/api/instances"),"instances"),null);return()=>{E&&r({type:"instances",instances:E.instances})}}},{key:"config",request:async()=>{const E=await K("/api/config");return()=>r({type:"configStatus",config:E})}},{key:"routines",request:async()=>{const E=Date.now()-Gee,{routines:H,runs:U}=Lp(await K(`/api/routines?since=${E}`),"routines","runs");return()=>r({type:"routinesHydrated",routines:H,runs:U,since:E})}},{key:"notifications",request:async()=>{const{notifications:E}=await K("/api/notifications");return()=>r({type:"notificationsHydrated",notifications:Array.isArray(E)?E:[]})}},...window.ogb?.remoteClient?.active?[]:[{key:"webhooks",request:async()=>{const{webhooks:E,attempts:H,ingress:U}=Lp(await K("/api/webhooks"),"webhooks");return()=>r({type:"webhooksHydrated",webhooks:E,attempts:H??[],ingress:U})}}]],M=new Map(T.map(E=>[E.key,E])),S=(E,H)=>{if(!j)return;const U=A(E.key);if(U.timer)return;H!==void 0&&(E.key==="routines"&&r({type:"routinesLoadFailed"}),console.warn(`snapshot: ${E.key} refresh failed; retrying`,H));const V=Math.min(3e4,1e3*2**Math.min(U.attempt,5));U.attempt+=1,U.timer=setTimeout(()=>{U.timer=null;const G=()=>{C(E,!0).catch(Y=>S(E,Y))};if(!Kr())return G();const Q=Tx(Y=>{Y||(Q(),j&&G())})},V)},C=async(E,H)=>{const U=A(E.key);U.timer&&(clearTimeout(U.timer),U.timer=null);const V=++U.generation,G=U.version;try{const Q=await E.request();if(!j||U.generation!==V)return;if(H&&U.version!==G){S(E);return}Q(),U.attempt=0}catch(Q){if(!j||U.generation!==V)return;throw PT(Q)}},O=(...E)=>{for(const H of E)A(H).version+=1},L=async()=>{const E=o.current,H=i.current.transcriptGeneration,U=new Set([...i.current.bots,...i.current.groups].flatMap(X=>X.tasks?.map(J=>J.threadId)??[])),V=i.current.liveCallVersion,G=AT();Bf("/api/live/call",()=>K("/api/live/call"),null).then(X=>{const J=G0(X);j&&J&&Ke.flushSync(()=>r({type:"liveCallLookup",call:J.call,since:V,seq:G}))}).catch(()=>{});const Q=()=>K(`/api/bots?messages=${dd}`).then(X=>Lp(X,"bots")).then(({bots:X,groups:J,sections:pe,computerControl:se,botQueuedMessages:ee})=>{j&&r({type:"hydrate",bots:X,groups:J??[],sections:pe??[],computerControl:se??{},botQueuedMessages:ee,preserveNavigation:o.current!==E,navigationSince:H,taskIdsAtStart:U,resumeId:OZ()??void 0})}),Y=T.map(X=>({key:X.key,load:()=>C(X,!1)})),oe=await ite(Q,Y,(X,J)=>{const pe=M.get(X.key);pe&&S(pe,J)});return j&&oe};let D=!1,z=null,P=!1;const $=[];let _;const B=()=>z?(P=!0,z):(D=!1,z=(async()=>{let E=!1;do P=!1,E=await L();while(j&&P);if(!j||!E)return!1;D=!0;for(const H of $.splice(0))_(H);return!0})().finally(()=>{z=null}),z),W=setTimeout(B,1e3),R=new Map,q=(E,H,U,V)=>{R.set(U,{covers:V,again:!1}),fetch(`/api/bots/${E}/read`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:H})}).catch(()=>{}).finally(()=>{const G=R.get(U);R.delete(U),G?.again&&j&&q(E,H,U,G.covers)})};_=E=>{switch(E.kind==="config"?O("config","instances"):E.kind==="routine"||E.kind==="routine.deleted"||E.kind==="routine.run"?O("routines"):(E.kind==="webhook"||E.kind==="webhook.attempt"||E.kind==="webhook.deleted")&&O("webhooks"),E.kind){case"sections":r({type:"sections",sections:E.sections});break;case"bots.order":r({type:"botsOrdered",botIds:E.botIds});break;case"groups.order":r({type:"groupsOrdered",groupIds:E.groupIds});break;case"bot.queued":r({type:"botQueues",queues:E.queues});break;case"message":{if(r({type:"messageAdded",threadId:E.threadId,message:E.message}),E.message?.role==="user"&&typeof E.message.queueId=="string"&&r({type:"consumePendingQueued",threadId:E.threadId,queueId:E.message.queueId}),E.message?.role==="bot"&&E.message?.kind==="text"){const H=sN(i.current,E.threadId);u1.completeBotText(E.threadId,E.message.turnId,E.message.text??"",H,E.message.id)}break}case"message.patch":r({type:"messagePatched",threadId:E.threadId,message:E.message});break;case"thread":r({type:"threadActive",threadId:E.threadId,activeLeafId:E.activeLeafId});break;case"bot":{const H=E.bot,U=i.current.bots.find(Q=>Q.id===H.id),V=U?.switchingTo??U?.threadId,G=H.tasks?.find(Q=>Q.threadId===V);if(H.id===i.current.selectedId&&i.current.activeView==="chat"&&document.hasFocus()&&(G?.unread||!H.tasks&&H.unread)){G&&(G.unread=!1),H.unread=m7(H);const Q=`${H.id}:${V}`,Y=G?.updatedAt??0,oe=R.get(Q);oe?Y>oe.covers&&R.set(Q,{covers:Y,again:!0}):q(H.id,V,Q,Y)}r({type:"botPatched",bot:n({...H,...p.overlayFor(H.id)})});break}case"group":{const H=E.group;H.unread&&H.id===i.current.selectedId&&document.hasFocus()&&(H.unread=!1,fetch(`/api/groups/${H.id}/read`,{method:"POST"}).catch(()=>{})),r({type:"groupPatched",group:H});break}case"notify":QX(E.notification,H=>mn(m,H,i.current,d.current),i.current.bots.find(H=>H.id===E.notification.botId)?.avatarUrl,cX(i.current)),r({type:"notificationReceived",entry:E.notification});break;case"notifications.read":O("notifications"),r({type:"notificationsRead",ids:E.ids});break;case"group.deleted":r({type:"groupDeleted",groupId:E.groupId});break;case"routine":r({type:"routinePatched",routine:E.routine});break;case"routine.deleted":r({type:"routineDeleted",routineId:E.routineId});break;case"routine.run":r({type:"routineRunPatched",run:E.run});break;case"webhook":r({type:"webhookPatched",webhook:E.webhook});break;case"webhook.attempt":r({type:"webhookAttempted",attempt:E.attempt});break;case"webhook.deleted":r({type:"webhookDeleted",webhookId:E.webhookId});break;case"runtime":{u1.onRuntimeEvent(E.event,sN(i.current,E.event.threadId));const H=ote(E.event);H&&r(H);break}case"screen":i.current.computerStarts[E.botId]&&r({type:"computerStart",botId:E.botId,start:null});break;case"computer":r({type:"computerStart",botId:E.botId,start:{state:E.state,...E.place?{place:E.place}:{}}});break;case"computer-control":r({type:"computerControl",botId:E.botId,held:E.held===!0,helpReason:typeof E.helpReason=="string"?E.helpReason:null,help:rT(E.help)});break;case"data":r({type:"dataSheet",sheet:E.sheet});break;case"bot.deleted":p.cancel(E.botId),r({type:"deleteBot",botId:E.botId});break;case"live.call":{const H=G0(E);H&&(u1.onLiveCall(H.call),Ke.flushSync(()=>r({type:"liveCall",call:H.call})));break}case"window-pref":oZ(E);break;case"theme":uH(E);break;case"config":r({type:"configStatus",config:Xee(E)});{const H=M.get("instances");H&&C(H,!0).catch(U=>S(H,U))}break}};const F=Vee({onOpen:()=>r({type:"connected",value:!0}),onError:()=>r({type:"connected",value:!1}),onSnapshotRequired:()=>(clearTimeout(W),Fee(),$.splice(0),AZ(),B()),onFrame:E=>{Bee(E),D?_(E):$.push($ee(E))}});return()=>{j=!1,clearTimeout(W);for(const E of N.values())E.timer&&clearTimeout(E.timer);F()}},[]);const x=f.useRef(new Map),g=f.useCallback(async j=>{const N=j?.cached?"/api/instances":"/api/instances?fresh=1",A=x.current,T=A.get(N)??K(N,{timeoutMs:12e4}).then(({instances:M})=>{if(!Array.isArray(M))throw new Error(l("engineSetup.invalidStatus"));r({type:"instances",instances:M})});A.set(N,T),await T.catch(M=>{if(j?.reportErrors)throw M}).finally(()=>{A.get(N)===T&&A.delete(N)})},[]),v=f.useCallback(async j=>{const{instances:N}=await K(`/api/instances/${encodeURIComponent(j)}/refresh-models`,{method:"POST"});r({type:"instances",instances:N})},[]),y=f.useRef(0);f.useEffect(()=>{const j=()=>{const A=Date.now();A-y.current<3e4||(y.current=A,g({cached:!0}))};window.addEventListener("focus",j);const N=()=>{document.visibilityState==="visible"&&j()};return document.addEventListener("visibilitychange",N),()=>{window.removeEventListener("focus",j),document.removeEventListener("visibilitychange",N)}},[g]);const w=f.useCallback(j=>p.flush(j),[p]),b=f.useMemo(()=>({state:a,dispatch:m,flushBotPatches:w,refreshInstances:g,refreshModels:v}),[a,m,w,g,v]),k=f.useMemo(()=>({dispatch:m,state:()=>i.current}),[m]);return s.jsx(zx,{value:k,children:s.jsx(np.Provider,{value:b,children:e})})}function re(){const e=f.useContext(np);if(!e)throw new Error("useStore outside provider");return e}function jDe({value:e,children:t}){return s.jsx(zx,{value:null,children:s.jsx(np.Provider,{value:e,children:t})})}function dte(e){if(!e)return[];const t=[...e.querySelectorAll("[data-sidebar-bot-row]")].map(n=>n.dataset.sidebarBotRow??"");return[...new Set(t.filter(Boolean))]}function ute(e,t){if(t.length===0)return[...e];const n=new Map(e.map(a=>[a.id,a]));return t.flatMap(a=>n.get(a)??[])}function pte(e,t,n){if(e.length===0)return;const a=e.findIndex(r=>r.id===t);return a===-1?n>0?e[0]:e.at(-1):e[(a+n+e.length)%e.length]}const C2="omb.onboarding.welcomeDraft";function mte(){try{const e=localStorage.getItem(C2),t=e?JSON.parse(e):null;return!t||typeof t!="object"||t.version!==f7?null:MH.includes(t.beat)?{beat:t.beat}:null}catch{return null}}function fte(e){try{localStorage.setItem(C2,JSON.stringify({version:f7,beat:e.beat}))}catch{}}function DT(){try{localStorage.removeItem(C2)}catch{}}const $T="omb.onboarding.sharedWorkspaceHint";function hte(){try{return localStorage.getItem($T)==="1"}catch{return!1}}function xte(){try{localStorage.setItem($T,"1")}catch{}}function gte({replay:e,onClose:t}){const[n,a]=f.useState(hte),r=f.useId();if(n&&!e)return null;const i=()=>{xte(),a(!0),t()};return s.jsxs("aside",{"aria-labelledby":r,className:"fixed left-[calc(var(--rail-beside,0px)_+_0.75rem)] right-3 top-14 z-40 flex items-start gap-3 rounded-2xl border border-hairline/50 bg-panel p-3.5 shadow-[0_24px_60px_-20px_rgba(0,0,0,0.6)] sm:inset-x-auto sm:right-5 sm:top-16 sm:w-[360px]",children:[s.jsx("div",{className:"shrink-0",children:s.jsx(ca,{color:"green",state:"happy",size:36,trackPointer:!1})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{id:r,className:"text-[14px] font-semibold text-ink",children:l("onboarding.shared.title")}),s.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:l("onboarding.shared.body")}),s.jsx("button",{type:"button",onClick:i,className:"mt-2.5 rounded-lg bg-accent px-3 py-1.5 text-[13px] font-medium text-white transition-transform duration-150 active:scale-[0.98]",children:l("onboarding.spot.gotIt")})]})]})}const fu="Trợ Lý Limix",X0=e=>e.defaultBot?.person?.trim().toLowerCase()??"";function bte(e,t){const n=t?.trim().toLowerCase()??"";return(n?e.find(a=>a.defaultBot&&X0(a)===n):void 0)??e.find(a=>a.defaultBot&&!X0(a))}let Z0;const ey=new Set;let fN=!1;function yte(){fN||(fN=!0,K("/api/auth/session",{timeoutMs:1e4,background:!0}).then(e=>{Z0=typeof e.email=="string"?e.email.trim().toLowerCase():null}).catch(()=>{Z0=null}).finally(()=>{for(const e of ey)e()}))}function Eo(){return f.useSyncExternalStore(e=>(ey.add(e),yte(),()=>ey.delete(e)),()=>Z0,()=>{})}function BT(e,t){const n=X0(e);return!!(e.defaultBot&&n&&n!==(t??""))}function E2(e,t){return!!e.sidebarHidden||BT(e,t)}function fc(e,t){return t===void 0?void 0:bte(e,t)}function FT(e,t){const n=Wl(t??{});return e.find(a=>a.chiefOfStaff&&!a.hidden&&Wl(a)===n)}function kte(e,t,n){const a=Wl(t??{});return e.filter(r=>!r.defaultBot&&!r.hidden&&!E2(r,n)&&Wl(r)===a)}function vte(e,t){if(!t||t.welcomed||t.hidden)return!1;const n=FT(e,t);return!n||n.id===t.id}let ty=!1;const ny=new Set;function hN(e){if(ty!==e){ty=e;for(const t of ny)t()}}function UT(){return f.useSyncExternalStore(e=>(ny.add(e),()=>ny.delete(e)),()=>ty,()=>!1)}function wte(e,t){return{welcomed:!0,...e.sidebarHidden?{sidebarHidden:!1}:{},...t?{}:{chiefOfStaff:!0}}}function jte(e){if(e.team)return[];const t=e.ownBots===0;return[...e.aiReady?[]:["ai"],...t?["bots","apps","phone"]:[]]}const Nte=3;function Ste(e){if(e.team)return[];const t=e.ownBots===0;return[...e.aiReady?[]:["ai"],...t&&!e.appsConnected?["apps"]:[],...t&&e.importFound?["import"]:[],...t&&!e.phonePaired?["phone"]:[]]}let sy=null;const ay=new Set;function Vr(e){if(sy!==e){sy=e;for(const t of ay)t()}}function qT(){return f.useSyncExternalStore(e=>(ay.add(e),()=>ay.delete(e)),()=>sy,()=>null)}let HT=null;function WT(e){HT=e}function Ite(e){return HT===e}const Cte=640,Vm=700,Ete="cubic-bezier(0.22, 1, 0.36, 1)",Ate="cubic-bezier(0.3, 0.7, 0.4, 1)";function xN(e){const t=new Map;for(const n of e.querySelectorAll("[data-sidebar-bot-row], [data-section]")){const a=n.dataset.sidebarBotRow?`bot:${n.dataset.sidebarBotRow}`:`section:${n.dataset.section}`;let r=a;for(let i=2;t.has(r);i++)r=`${a}#${i}`;t.set(r,n)}return t}const gN=(e,t)=>e.width>0&&e.height>0&&e.bottom>0&&e.top<t;function KT({from:e,botId:t,reduced:n,commit:a,root:r=document}){const i=r.defaultView?.innerHeight??0,o=new Map([...xN(r)].map(([b,k])=>[b,k.getBoundingClientRect().top])),c=e?.getBoundingClientRect();Ke.flushSync(a);const d=xN(r),u=d.get(`bot:${t}`);if(!u||!gN(u.getBoundingClientRect(),i))return;if(n||!e||!c){u.animate([{opacity:0},{opacity:1}],{duration:180,easing:"linear"});return}const p={duration:Vm+100,easing:"linear"};for(const[b,k]of d){if(k===u)continue;const j=k.getBoundingClientRect();if(!gN(j,i))continue;const N=o.get(b);N===void 0?k.animate([{opacity:0},{opacity:0,offset:.5},{opacity:1}],p):Math.abs(N-j.top)>=.5&&k.animate([{transform:`translateY(${N-j.top}px)`},{transform:"translateY(0)"}],{duration:Cte,easing:Ete})}u.animate([{opacity:0},{opacity:0,offset:.72},{opacity:1}],p);const m=(u.querySelector("svg, img")??u).getBoundingClientRect(),h=e.cloneNode(!0);Object.assign(h.style,{position:"fixed",left:`${c.left}px`,top:`${c.top}px`,width:`${c.width}px`,height:`${c.height}px`,margin:"0",zIndex:"60",pointerEvents:"none",transformOrigin:"top left",filter:"none"}),h.setAttribute("aria-hidden","true"),r.body.appendChild(h),e.style.visibility="hidden";const x=m.width/Math.max(c.width,1),[g,v]=[m.left-c.left,m.top-c.top],y=h.animate([{transform:"translate(0, 0) scale(1)"},{transform:`translate(${g*.5}px, ${v*.5-24}px) scale(${(1+x)/2})`,offset:.5},{transform:`translate(${g}px, ${v}px) scale(${x})`}],{duration:Vm,easing:Ate,fill:"forwards"}),w=()=>h.remove();y.onfinish=()=>{const b=h.animate([{opacity:1},{opacity:0}],{duration:120,easing:"linear",fill:"forwards"});b.onfinish=w,b.oncancel=w},y.oncancel=w,r.defaultView?.setTimeout(w,Vm+600)}const Tte=300,h1=150,bN=64,yN="ui-button ui-button-pill",kN="ui-button ui-button-pill ui-button-primary";function Mte(){return s.jsx("span",{"aria-hidden":"true","data-chief-badge":"",className:"absolute bottom-0 right-0 flex size-4 items-center justify-center rounded-full bg-[#E8993A] text-white ring-2 ring-menu",children:s.jsx(Nr,{size:9,strokeWidth:2.5,fill:"currentColor"})})}function vN(e,t){return!!e.chiefOfStaff||t.find(n=>n.instanceId===e.modelSelection.instanceId)?.capabilities?.agentsMcp===!0}function _te({replay:e,onDone:t,onLeave:n}){const{state:a,dispatch:r}=re(),i=fx(),o=Eo(),c=fc(a.bots,o),d=FT(a.bots,c),u=kte(a.bots,c,o),[p,m]=f.useState(!1),[h,x]=f.useState(null),[g,v]=f.useState(!1),y=f.useRef(null),w=f.useRef(null),b=f.useRef(!1);f.useEffect(()=>{const C=setTimeout(()=>{b.current=!0},Tte);return()=>clearTimeout(C)},[]),f.useEffect(()=>{if(c)return Vr(c.id),()=>Vr(null)},[c?.id]),f.useEffect(()=>{(y.current?.querySelector(p?"[role=radio][tabindex='0']":"[data-primary]")??y.current)?.focus({preventScroll:!0})},[p]);const k=C=>{b.current||(C.preventDefault(),C.stopPropagation())},j=(C,O)=>{v(!0),n?.(),y.current?.animate([{opacity:1},{opacity:0}],{duration:h1,fill:"forwards"}),setTimeout(()=>t(C),O)},N=()=>{if(g||!c)return;const C=wte(c,d);e||WT(c.id),KT({from:w.current,botId:c.id,reduced:i,commit:()=>{Vr(null),r({type:"updateBot",botId:c.id,patch:C})}}),j(c.id,i?h1:Vm)},A=C=>{g||(Vr(null),c&&!c.welcomed&&r({type:"updateBot",botId:c.id,patch:{welcomed:!0}}),C.chiefOfStaff||r({type:"updateBot",botId:C.id,patch:{chiefOfStaff:!0}}),j(C.id,h1))},T=u.filter(C=>vN(C,a.instances)),M=T.find(C=>C.id===h),S=C=>{if(C.key==="Escape"){C.preventDefault(),p&&m(!1);return}if(!p||!["ArrowDown","ArrowUp"].includes(C.key)||!T.length)return;C.preventDefault();const O=T.findIndex(D=>D.id===h),L=T[(O+(C.key==="ArrowDown"?1:T.length-1))%T.length];x(L.id),y.current?.querySelector(`[data-chief-choice="${L.id}"]`)?.focus()};return s.jsx("div",{ref:y,role:"dialog","aria-modal":"true","aria-labelledby":"chief-intro-title",tabIndex:-1,onKeyDown:S,onClickCapture:k,onKeyDownCapture:C=>(C.key==="Enter"||C.key===" ")&&k(C),"data-chief-intro":p?"choose":"intro",className:I("ui-modal animate-pop-in w-[min(440px,calc(100vw-32px))] border-0 outline-none",g&&"pointer-events-none"),children:p?s.jsxs("div",{className:"p-4",children:[s.jsx("h2",{id:"chief-intro-title",className:"text-[14px] font-medium leading-5 text-ink",children:l("onboarding.chief.chooseTitle")}),s.jsx("div",{role:"radiogroup","aria-labelledby":"chief-intro-title",className:"-mx-2 mt-2 max-h-[282px] overflow-y-auto px-2 [scrollbar-width:thin]",children:u.map(C=>{const O=vN(C,a.instances),L=h===C.id;return s.jsxs("div",{role:"radio","aria-checked":L,"aria-disabled":!O||void 0,title:O?void 0:l("sidebar.bot.chiefNeedsEngine"),tabIndex:L||!M&&C.id===T[0]?.id?0:-1,"data-chief-choice":C.id,onClick:()=>O&&x(C.id),onKeyDown:D=>{O&&(D.key===" "||D.key==="Enter")&&(D.preventDefault(),x(C.id))},className:I("flex min-h-10 items-center gap-2 rounded-lg p-2 transition-colors focus-visible:outline-offset-[-2px]",O?"cursor-pointer hover:bg-ink/[0.06]":"opacity-40",L&&"bg-ink/[0.06]"),children:[s.jsx(Je,{bot:C,size:24}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] leading-[18px] text-ink",children:C.name}),s.jsx("span",{"aria-hidden":"true",className:I("size-4 shrink-0 rounded-full border-[1.5px]",L?"border-ink bg-ink shadow-[inset_0_0_0_3px_var(--color-menu)]":"border-ink/30")})]},C.id)})}),s.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[s.jsx("button",{type:"button",onClick:()=>m(!1),className:yN,children:l("onboarding.back")}),s.jsx("button",{type:"button","data-chief-confirm":"",disabled:!M||g,onClick:()=>M&&A(M),className:kN,children:l("onboarding.chief.confirm")})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 pb-4 pt-6 text-center",children:[s.jsxs("span",{ref:w,className:"relative flex",children:[c?s.jsx(Je,{bot:c,size:bN,motion:"arrive"}):s.jsx(ca,{color:"chrome",size:bN,label:fu}),s.jsx(Mte,{})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h2",{id:"chief-intro-title",className:"text-[17px] font-medium leading-6 tracking-[-0.008em] text-ink",children:l("onboarding.chief.title")}),s.jsx("p",{className:"text-[14px] leading-5 text-ink-secondary",children:l("onboarding.chief.body")})]})]}),s.jsxs("div",{className:I("p-4",u.length>0&&"grid grid-cols-2 gap-2"),children:[u.length>0&&s.jsx("button",{type:"button","data-chief-choose":"",onClick:()=>{x(null),m(!0)},className:I(yN,"min-w-0"),children:s.jsx("span",{className:"truncate",children:l("onboarding.chief.choose")})}),s.jsx("button",{type:"button","data-primary":"","data-chief-create":"",onClick:N,disabled:!c,className:I(kN,"w-full min-w-0"),children:s.jsx("span",{className:"truncate",children:l("onboarding.chief.create")})})]})]})})}const VT="omb-engine-updated-seen";function wN(){try{const e=JSON.parse(localStorage.getItem(VT)??"{}");return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function Rte(e){const t=e.autoUpdated?.version??null,[n,a]=f.useState(null);return f.useEffect(()=>{if(!(t===null||wN()[e.driverKind]===t)){a(t);try{localStorage.setItem(VT,JSON.stringify({...wN(),[e.driverKind]:t}))}catch{}}},[e.driverKind,t]),n}function Ote({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:I("text-ink",t),"aria-hidden":!0,children:[s.jsx("path",{d:"M5.938 12.835c.127-.039.285.02.373.143.028.038.036.092.046.14.003.014-.02.033-.04.05-.124-.098-.24-.194-.354-.291-.011-.01-.016-.027-.025-.042zM8.396 9.412c.195-.032.39-.06.588-.05a.54.54 0 01.148.026c.202.071.402.147.601.224.028.01.05.036.075.055l-.013.027a9.203 9.203 0 01-.26-.089c-.115-.038-.213-.077-.315-.098-.25-.05-.25-.046-.292-.014l.574.144c.275.139.55.276.823.417.042.022.09.057.107.098.026.06.063.076.117.072.066-.006.132-.017.213-.027l-.04.086c.051.08.142.02.216.064-.074.13-.247.09-.334.199l.061.074-.12.087c0 .106-.038.168-.306.243l.026.085-.196.042.07.124h-.25l-.007.137c-.081-.01-.161-.018-.244-.027l-.053.123c-.027-.008-.052-.011-.073-.023-.067-.038-.128-.056-.195.006-.019.017-.063.014-.093.008-.026-.006-.05-.029-.07-.042-.11.095-.11.095-.208.003-.057.046-.12.074-.186.011-.063.027-.123-.02-.178-.014-.07.007-.097-.035-.133-.07l-.13.033c-.013-.236-.194-.19-.34-.203.005-.072.05-.092.095-.094a.474.474 0 01.159.022c.164.05.32.12.496.138.203.021.405.029.601-.015.265-.059.52-.149.707-.365.049-.056.083-.127.117-.195.019-.038.02-.084-.02-.116a1.397 1.397 0 00-.382-.217c.024.12-.031.182-.115.221 0 .014-.004.025 0 .03.08.115.084.16-.007.267a1.39 1.39 0 01-.218.211.477.477 0 01-.641-.05 1.36 1.36 0 01-.133-.152c-.078-.107-.076-.108-.033-.236-.165-.08-.128-.226-.104-.364.008-.05.028-.096.049-.163-.04.014-.067.017-.087.032a.897.897 0 00-.316.357c-.007.016-.01.034-.02.047-.012.015-.034.038-.045.035-.02-.006-.037-.027-.05-.045-.008-.012-.007-.032-.012-.057h-.126l.053-.172a14.82 14.82 0 00-.039-.049l.11-.284c-.06.026-.091.044-.124.051-.03.007-.064 0-.095 0 0-.031-.01-.07.004-.092.149-.22.305-.428.593-.476z"}),s.jsx("path",{d:"M8.06 10.788c-.003-.038-.004-.075.037-.062.016.006.034.048.028.067-.01.04-.038.032-.064-.005z"}),s.jsx("path",{clipRule:"evenodd",d:"M11.981.009c.226-.012.453-.011.679 0 .247.01.495.024.74.062.401.064.798.157 1.19.273.463.138.92.299 1.356.511a7.31 7.31 0 012.948 2.642c.292.469.536.963.739 1.479.219.556.446 1.11.623 1.683.204.654.329 1.326.458 1.997.097.504.182 1.01.29 1.511.156.722.329 1.44.494 2.16.186.812.4 1.615.63 2.415.102.355.193.713.282 1.072.11.436.202.876.254 1.323.031.278.066.557.073.837a7.56 7.56 0 01-.017.88c-.037.413-.1.818-.226 1.212a5.017 5.017 0 01-.915 1.649l-.13.156.018.023c.043-.023.088-.041.127-.068.2-.138.373-.307.531-.49.4-.46.721-.973.975-1.529a3.59 3.59 0 00.325-1.72c-.024-.424-.097-.834-.3-1.213-.013-.027-.015-.06-.03-.121.05.035.082.048.101.072.107.13.22.258.315.398.33.494.46 1.052.486 1.64a3.75 3.75 0 01-.47 1.97c-.36.655-.887 1.14-1.526 1.506-.193.111-.394.21-.595.308-.157.078-.248.211-.318.365a.522.522 0 00-.033.406.359.359 0 01.013.139c-.005.077-.077.155-.14.162-.054.006-.125-.043-.15-.116a1.206 1.206 0 01-.06-.233c-.04-.314-.155-.6-.308-.87a3.906 3.906 0 00-.73-.91 2.129 2.129 0 00-.897-.524 4.093 4.093 0 00-.692-.131c-.075-.008-.15-.04-.22.01.18.06.363.11.538.18.434.173.82.43 1.18.728.308.255.58.543.794.884.098.155.186.315.227.496.027.123.042.25.067.375.013.062-.002.109-.053.144-.047.033-.122.034-.163-.01a.455.455 0 01-.08-.14c-.03-.073-.038-.159-.078-.225a7.314 7.314 0 00-1.423-1.664c-.16-.137-.329-.26-.537-.323-.376-.114-.753-.203-1.15-.154-.213.025-.427.032-.64.053a1.6 1.6 0 00-.736.278 5.14 5.14 0 00-.834.72c-.329.342-.642.699-.955 1.055-.136.155-.264.319-.314.531a5.227 5.227 0 00-.012.051.096.096 0 01-.09.076h-.31c-.046 0-.082-.048-.072-.094.023-.108.045-.216.07-.324.075-.325.19-.635.368-.917.024-.039.04-.088.104-.08l.01.049.027.077c.28-.435.571-.834.996-1.135.283-.204.584-.378.89-.55a.196.196 0 00-.098-.002c-.162.043-.325.084-.485.134-.402.124-.764.33-1.11.566-.147.1-.298.193-.414.333a7.314 7.314 0 00-1.07 1.767.845.845 0 00-.04.12.075.075 0 01-.072.056h-.494c-.04 0-.062-.051-.036-.082.123-.14.246-.282.377-.415.275-.281.58-.532.777-.884.027-.048.063-.09.095-.135.238-.333.54-.607.818-.902.082-.086.175-.16.26-.24.029-.027.053-.057.079-.085l-.018-.025-.135.041c-.034.017-.07.031-.102.05-.248.144-.494.292-.743.433-.408.23-.825.439-1.209.711-.281.2-.591.358-.889.533-.02.012-.044.015-.08.028-.015-.135.143-.201.108-.336-.033.014-.064.02-.085.038-.111.096-.227.19-.328.296-.148.157-.284.325-.425.488-.125.143-.25.286-.373.431A.153.153 0 019.89 24H8.762a.316.316 0 00.016-.042c.028-.09.085-.172.083-.28-.091-.018-.162.001-.212.077a4.45 4.45 0 00-.136.215c-.01.016-.024.03-.042.03h-.093c-.019 0-.029-.022-.017-.037.071-.088.14-.178.209-.268.001-.002-.006-.012-.012-.024-.014.004-.03.006-.045.013-.176.09-.352.181-.527.274a.363.363 0 01-.168.042H5.202c-.026 0-.039-.036-.019-.053.21-.178.402-.374.558-.605.335-.496.538-1.047.667-1.629.004-.02-.003-.043-.006-.091-.037.048-.059.072-.076.1a1.943 1.943 0 01-.334.415c-.28.258-.59.448-.983.464-.297.012-.588 0-.865-.127-.46-.21-.722-.57-.794-1.072-.025-.17-.017-.171-.182-.219A3.513 3.513 0 011.97 20.6a2.286 2.286 0 01-.808-1.13 3.569 3.569 0 01-.16-1.245c.002-.034.016-.067.024-.1.032.023.046.043.05.066.033.153.059.308.096.46.086.355.257.664.516.92.258.256.571.419.91.532.358.118.717.138 1.07-.016a1.89 1.89 0 00.621-.452c.328-.348.533-.76.648-1.223.009-.034.005-.071.007-.11-.015.006-.026.006-.03.011-.031.05-.064.1-.093.152-.284.502-.679.887-1.196 1.135-.351.17-.718.255-1.11.159a1.607 1.607 0 01-.971-.64 2.006 2.006 0 01-.368-.924 2.903 2.903 0 01.02-.886c.05-.439.466-1.17.742-1.271-.02.063-.035.112-.053.16-.043.116-.097.227-.13.345a1.901 1.901 0 00-.05.82c.033.212.09.416.204.6.147.236.346.407.62.465.11.023.225.014.338.018a.576.576 0 00.386-.131c.164-.128.282-.292.366-.481.168-.375.24-.777.309-1.179.05-.296.093-.594.133-.893.039-.281.071-.563.104-.845.026-.232.048-.464.074-.696.024-.228.052-.455.076-.683.024-.227.047-.455.069-.683.013-.14.022-.28.034-.42l.037-.417c.022-.25.041-.5.065-.748.008-.082-.02-.132-.09-.177a2.46 2.46 0 01-.492-.418c-.1-.109-.188-.228-.282-.342-.035-.042-.056-.097-.116-.118a2.084 2.084 0 00.275.597c.06.092.131.176.196.265.063.086.182.115.234.226-.028.003-.046.01-.06.006a4.74 4.74 0 01-.22-.057 2.71 2.71 0 01-1.287-.819c-.435-.487-.656-1.076-.71-1.723a5.206 5.206 0 01.014-1.06c.072-.602.22-1.186.45-1.745.155-.376.338-.741.526-1.102.205-.393.466-.75.765-1.076.512-.559 1.104-1.024 1.726-1.448.717-.49 1.478-.898 2.277-1.233C8.244.828 8.767.632 9.31.494c.655-.166 1.31-.33 1.982-.415.229-.03.458-.058.688-.07zm-1.847 22.82c-.07.06-.147.111-.207.18-.238.27-.464.549-.668.869l-.044.108a.177.177 0 00.093-.057c.174-.19.351-.378.519-.574.104-.122.195-.255.288-.386.024-.034.03-.08.046-.12l-.027-.02zm1.65-3.695a5.51 5.51 0 00-.653.593l-.37.386a.963.963 0 01-.377.25 1.372 1.372 0 01-.467.09c-.044 0-.087.006-.151.012.028.058.043.097.064.131.15.242.301.482.45.724.136.22.276.438.399.666.068.125.105.267.156.404.077.027.14-.018.202-.048.29-.135.579-.274.867-.412.213-.101.437-.186.636-.31.347-.215.68-.455 1.018-.685.015-.01.026-.028.042-.046-.023-.019-.038-.037-.056-.044-.287-.111-.527-.3-.77-.482a5.319 5.319 0 01-.506-.42 1.757 1.757 0 01-.41-.653c-.019-.049-.045-.095-.075-.156zm-5.847.264c-.06.096-.097.194-.132.293a3.38 3.38 0 01-.555 1.01c-.2.25-.455.412-.762.493-.23.06-.464.076-.7.07-.048-.002-.097.002-.158.005.016.04.021.066.035.085.1.145.23.246.4.295.157.046.316.034.498.023.181-.037.343-.115.485-.234.238-.199.402-.454.536-.732.175-.363.264-.751.342-1.144.01-.053.008-.11.011-.164zm14.945-4.586c.008.029.016.057.027.107.024.155.051.31.072.464.03.219.067.437.078.657.017.344.027.689-.014 1.033-.037.315-.063.633-.116.946a6.153 6.153 0 01-.46 1.518c-.008.018-.01.039-.02.082.047-.03.077-.042.098-.064.085-.083.17-.167.248-.255.271-.305.458-.66.596-1.043.18-.498.228-1.011.145-1.531-.103-.65-.33-1.263-.597-1.881a9.055 9.055 0 00-.024-.055l-.033.022zM5.797 8.29a.26.26 0 00.018.153c.124.251.25.501.379.75.025.049.066.09.03.163-.284.06-.578.119-.88.255.059.038.097.06.132.087.042.032.112.058.09.12-.01.033-.075.048-.117.072.017.01.043.021.067.036.166.102.33.207.447.368.138.192.229.404.188.644-.079.469-.306.85-.69 1.132-.054.04-.106.083-.161.122a.243.243 0 00-.103.245.77.77 0 00.055.195c.083.196.22.35.375.492.083.076.159.164.222.257a.37.37 0 01.025.377c-.023.05-.05.099-.076.148-.03.06-.028.111.022.162.041.042.08.089.112.138.038.058.078.079.147.05a.486.486 0 01.333-.006c.16.046.302.126.444.21.13.077.264.149.4.219.067.035.14.05.219.026.071-.022.124.01.145.076.02.064-.003.108-.074.139-.07.03-.137.063-.209.088-.1.035-.201.073-.314.077-.013-.107.11-.088.127-.159-.206-.126-.643-.145-.801-.034.063.112.035.21-.096.313-.13-.1-.025-.202.002-.3a.209.209 0 00-.249.17c-.015.101.067.216.178.224.108.007.218-.005.326-.012.06-.005.12-.027.199 0-.103.123-.248.127-.357.19.002.05.07.086.019.131-.053.048-.095-.001-.132-.03-.08-.063-.16-.126-.231-.197a.474.474 0 01-.157-.311.52.52 0 00-.043-.172c-.032-.074-.032-.137.033-.19-.018-.03-.028-.053-.045-.072a1.222 1.222 0 01-.196-.369c-.053-.137-.046-.264.048-.381.024-.03.05-.06.064-.095a.664.664 0 00.047-.168c.017-.165-.064-.287-.182-.387-.186-.156-.36-.322-.46-.551-.005-.011-.024-.017-.037-.026-.011.017-.024.027-.025.038-.019.185-.045.37-.052.557-.014.377.058.743.162 1.104.118.41.289.798.488 1.173.267.502.537 1.002.812 1.5.055.098.13.189.208.27.198.202.452.272.724.273.202 0 .404-.006.605-.026.295-.03.59-.073.884-.113.183-.025.365-.057.548-.08.21-.026.38.073.522.21.16.156.305.327.447.5.22.265.397.56.554.867.05.098.07.1.147.03.13-.121.26-.242.394-.36.067-.059.088-.12.067-.213a3.535 3.535 0 01-.085-.796c.002-.157.006-.314.018-.471.015-.224.03-.45.06-.672a59.114 59.114 0 01.362-2.298c.087-.493.182-.984.268-1.477.06-.347.118-.694.162-1.043.034-.273.055-.55.063-.825.011-.332.003-.665.002-.998 0-.077.004-.155-.01-.23-.028-.142-.01-.155-.162-.19a5.826 5.826 0 00-.607-.107c-.146-.018-.207-.053-.221-.19-.006-.049-.025-.098-.041-.146-.009-.025-.024-.048-.046-.09l-.025.264c-.009.096-.029.116-.127.115-.055 0-.11-.008-.164-.008-.476 0-.952-.008-1.426.032-.095.008-.173-.015-.226-.103-.04-.066-.088-.126-.134-.186-.063-.084-.086-.093-.182-.06-.195.068-.388.138-.582.21a2.71 2.71 0 00-.675.394.986.986 0 01-.323.168c-.033.01-.07.008-.127.013.02-.066.024-.114.047-.15.064-.105.135-.205.205-.306.023-.033.049-.063.073-.095l-.015-.023-.201.037c-.146.04-.296.07-.437.122-.148.053-.266.023-.386-.072a3.623 3.623 0 01-.733-.786l-.093-.132zm8.592 8.963l-.147.09c-.22.134-.44.266-.659.402-.093.058-.184.12-.27.188-.085.07-.124.161-.072.272.047.1.093.2.147.294.047.08.124.138.213.147.11.01.228.012.336-.012.217-.05.372-.205.528-.357a.291.291 0 00.087-.308c-.046-.18-.079-.365-.118-.547-.011-.052-.027-.103-.045-.169zm-.257-2.409c-.12.291-.205.597-.325.91-.151.433-.294.87-.435 1.323.036-.01.054-.01.067-.018.261-.16.522-.324.785-.484.054-.033.071-.078.065-.138-.012-.13-.024-.262-.034-.393l-.068-.886c-.008-.103-.02-.206-.029-.31-.009 0-.017-.002-.026-.004zm3.081-8.13l.099.285c.08.231.159.463.24.714l.58 1.952c.187.63.372 1.262.558 1.893.114.382.235.762.343 1.146.072.257.126.519.186.799.044.206.087.413.127.64.034.106.023.226.077.325l.025-.006-.068-.362c-.038-.206-.077-.412-.113-.638-.015-.07-.029-.141-.046-.211-.095-.396-.177-.796-.29-1.187-.196-.685-.413-1.364-.618-2.046-.165-.549-.322-1.1-.488-1.648-.069-.227-.15-.45-.226-.695l-.117-.336c-.037-.107-.075-.216-.115-.322-.04-.106-.084-.21-.127-.314a7.558 7.558 0 01-.027.01zM6.225 14.304c-.063-.001-.115.014-.134.083a.35.35 0 00.41.012 4.533 4.533 0 00-.276-.095zM5.23 11.98c-.026-.027-.057-.048-.075.002-.012.032-.007.07-.01.113.082-.037.082-.037.085-.115zm.062-1.189a.135.135 0 00-.088.056.197.197 0 00-.025.11c.005.152.01.306.026.457a.751.751 0 00.066.218c.061.136.157.167.288.101.055-.027.06-.054.025-.11a4.52 4.52 0 01-.129-.211c-.015-.068-.066-.131-.033-.207.04-.09-.076-.116-.074-.19V10.874c-.003-.038-.006-.087-.056-.083zm-.017-.968a.867.867 0 00-.467.127c-.076.045-.084.07-.05.158.034.087.07.173.115.254.064.117.09.125.21.077a.657.657 0 01.336-.053c.202.022.357.136.504.264l.092.077c.007-.006.014-.013.022-.018-.019-.105-.035-.226-.149-.264-.157-.053-.324-.075-.508-.117l-.24-.005c.24-.169.452-.044.687.009-.063-.115-.153-.147-.23-.193-.082-.05-.17-.092-.25-.144-.06-.037-.12-.08-.072-.172zm10.233.325c-.23-.01-.427.08-.608.211-.034.026-.06.065-.105.117.087.026.15.046.232.065.044-.015.088-.03.13-.046.306-.114.61-.115.904.031.126.063.237.04.366-.005-.02-.031-.03-.054-.045-.071a.986.986 0 00-.448-.273c-.14-.044-.284-.024-.426-.03zM7.99 6.483a.308.308 0 00.002.133c.08.321.156.643.242.962.104.387.27.75.456 1.103.02.037.061.08.098.087a.404.404 0 00.253-.051l-.472-.84c-.23-.448-.405-.92-.579-1.394zM10.397.497c-.2-.008-.405.004-.603.034-.236.035-.47.087-.7.152-.287.08-.569.18-.852.273-.04.013-.074.038-.11.058.028.014.05.018.07.014.287-.068.58-.085.873-.09.134-.002.269.009.402.025.19.024.382.048.57.09.456.104.874.3 1.265.556.464.306.888.66 1.257 1.078.205.232.395.475.56.739.17.274.315.561.449.856.273.601.456 1.232.6 1.876.04.173.07.348.1.524.017.104.065.167.17.19.122.028.2.105.22.251-.003.102-.06.174-.129.24a1.065 1.065 0 00-.268.358.164.164 0 00.083-.039c.08-.086.162-.172.235-.265a.56.56 0 00.13-.333c.009-.05.022-.1.024-.15.007-.124-.017-.15-.143-.168-.025-.004-.049-.014-.073-.015-.082-.007-.125-.063-.137-.131-.033-.198-.004-.355.247-.408.086-.018.174-.03.26-.042.158-.023.315-.053.473-.067.14-.012.19.033.226.167.008.029.018.057.021.087.019.179-.008.225-.141.288-.027.013-.055.024-.078.042a.148.148 0 00-.051.067c-.039.144.073.382.206.445l.673.32c.023.011.05.015.075.023l.018-.026c-.015-.008-.032-.013-.044-.024a2.27 2.27 0 00-.544-.32 4.898 4.898 0 00-.173-.075.203.203 0 01-.126-.191c-.003-.085.045-.154.128-.187l.059-.025c.099-.044.118-.076.112-.187a.384.384 0 00-.008-.063c-.067-.294-.123-.59-.205-.88a9.478 9.478 0 00-.826-2.036 7.465 7.465 0 00-1.39-1.805 4.536 4.536 0 00-1.177-.824 3.656 3.656 0 00-1.016-.328 6.155 6.155 0 00-.712-.074zm6.719 5.955c.01.014.018.028.038.034l-.022-.044-.016.01zM4.103 3.917a.062.062 0 01-.03.012.455.455 0 01-.04.039c-.01.01-.02.02-.045.04l-.363.354c-.088.085-.17.178-.266.253-.284.22-.425.53-.544.855a.132.132 0 00-.007.071c.013.055.033.108.052.168l.074.026c-.017.056-.03.105-.047.152-.058.164-.118.327-.175.491-.005.015.008.036.019.077.08-.175.158-.33.225-.489.228-.544.484-1.074.819-1.561.09-.133.182-.266.283-.401.004-.006.007-.013.022-.03.001-.016.003-.032.015-.04l.008-.017zm12.976 2.408a.023.023 0 01.009.019.073.073 0 00-.006.01.188.188 0 00.007.02l.018.022c.002-.007.007-.016.005-.021-.003-.01-.012-.018-.02-.038a1.331 1.331 0 01-.013-.012zM4.199 4.48c-.003.004-.008.008-.027.014-.005.013-.011.025-.031.047a2.085 2.085 0 01-.124.167c-.048.07-.116.055-.181.041-.134-.028-.228.016-.287.143-.089.187-.187.37-.273.56-.049.108-.11.216-.118.36.081.003.154.007.228.008h.228a2.563 2.563 0 01-.079.264c-.01.052-.022.103-.033.155l.02.004c.018-.046.037-.092.067-.153.066-.142.13-.285.2-.426.02-.04.034-.1.116-.092 0 .043.004.084 0 .124-.005.045-.017.09-.028.143.141.043.086.174.115.269.102-.022.104-.195.248-.144v.205l.017.002.439-1.059c-.13 0-.246-.02-.358.033-.024.011-.058-.001-.108-.004.075-.15.139-.278.211-.417a.128.128 0 01.025-.036c0-.015-.001-.03.008-.038l.006-.02c-.005.006-.01.011-.028.017-.004.012-.009.024-.026.045a.085.085 0 01-.032.033c-.123.157-.09.164-.258.106-.079-.027-.078-.028-.047-.144.028-.046.056-.093.098-.15 0-.016-.001-.032.007-.042L4.2 4.48zm2.073-.67c-.003.006-.007.011-.027.016-.094.125-.194.246-.28.377-.155.238-.301.481-.451.723-.14.224-.345.368-.575.481-.017.008-.04.006-.079.011.012-.059.016-.109.033-.153a6.076 6.076 0 01.229-.518l-.007-.02a.138.138 0 01-.035.025c-.028.05-.055.1-.093.164-.26.424-.443.817-.442.95.024.004.048.011.073.013.177.013.188.007.26-.165.03-.07.077-.12.147-.15l.175-.07c.044-.018.085-.057.146-.032.003.05-.01.11.014.145.042.062.044.125.047.193.002.049.017.098.026.147.029-.034.039-.065.05-.097.142-.39.277-.782.428-1.17.1-.256.22-.504.33-.756.013-.03.013-.067.03-.092V3.81zm3.987-.34c0 .045.01.084.021.123.042.16.094.318.124.48.024.133.023.27.028.406 0 .033-.019.067-.032.11-.094-.058-.047-.158-.106-.215h-.125c-.015.072-.01.152-.046.2-.066.085-.155.154-.236.227-.043.038-.078.018-.103-.025l-.046-.087c-.065.035-.117.069-.172.093-.116.051-.235.095-.35.147-.085.038-.09.053-.07.147.014.075.034.148.047.223.013.072.05.109.123.124.233.05.462.115.657.265.058-.102.058-.102.168-.151.03-.014.06-.03.092-.042.08-.03.115-.017.15.06.023.048.041.098.066.158.06-.14-.042-.267.017-.416.157.18.24.39.375.567a.235.235 0 00.022-.098c.002-.124 0-.247.002-.371 0-.034.013-.067.02-.1l.032-.003c.11.155.13.354.226.52a3.036 3.036 0 00-.01-.392c-.004-.045 0-.074.05-.088.08.036.116.14.215.158-.03-.275-.423-1.137-.798-1.635-.114-.127-.2-.28-.34-.386zm-2.667.696c-.019.034-.03.05-.037.067-.061.185-.125.37-.18.556-.031.105-.087.169-.195.19-.09.019-.178.052-.268.073-.038.009-.089.015-.118-.003-.024-.016-.025-.069-.036-.106-.064.076-.082.087-.17.047-.133-.062-.262-.135-.393-.201-.048-.025-.093-.063-.17-.03-.043.12-.091.25-.137.382-.099.28-.087.242.095.453.046.048.102.03.154.023.054-.009.106-.03.16-.036.13-.013.26-.08.367-.015.204-.064.387-.122.571-.178.05-.015.089.005.114.054.022.042.034.093.082.121.038-.056-.013-.128.063-.178l.14.241-.042-1.46zm.278.358c-.096-.01-.107.01-.11.108-.002.038-.003.078.002.115.03.2.099.386.174.57.002.006.012.01.022.015l.078-.05c.052.036.081.088.153.088.205-.002.41.014.616.012.099-.001.158.042.205.12.018.03.024.077.088.066l-.08-.394c-.05-.195-.085-.395-.172-.589-.057.057-.114.068-.18.046a.72.72 0 00-.135-.028c-.22-.028-.44-.059-.66-.08zm10.254-1.727c.089.163.155.316.139.491-.016.168.026.342-.044.516-.047-.033-.088-.082-.112-.075-.117.035-.164-.057-.227-.115a4.772 4.772 0 01-.286-.29l-.104-.113a4.856 4.856 0 01-.023.019c.035.046.07.093.11.156.04.064.084.127.122.193.034.058.065.118.031.205-.082-.01-.164-.019-.246-.032-.06-.01-.101 0-.124.07-.031.098-.037.096-.15.09.02.042.036.08.057.116.041.074.03.138-.03.196-.06.06-.118.122-.178.181a.175.175 0 01-.185.046c-.222-.061-.447-.113-.67-.174-.032-.009-.063-.04-.086-.068-.03-.04-.052-.087-.08-.13-.044-.07-.09-.138-.136-.207a.18.18 0 00-.014.105c.012.127.03.253.035.38.005.1-.024.12-.121.104-.104-.017-.206-.04-.31-.058-.064-.012-.131-.028-.202.03l.081.208c.09 0 .166-.01.237.002a.819.819 0 01.458.251c.078.083.154.168.241.26l.018-.005c-.004-.006-.008-.013-.01-.04.014-.056-.062-.118.018-.178.031.03.064.057.088.09.058.078.111.159.169.257l.089.141.024-.013a2093.819 2093.819 0 01-.427-.934c.055.007.083.007.108.016.193.07.385.142.577.216.074.028.147.06.219.094.062.028.112.018.157-.033.05-.056.102-.112.154-.167.05-.051.095-.046.132.014.016.025.026.053.04.08.071.138.143.277.217.433l.159.308.025-.011c-.044-.106-.07-.218-.138-.334-.057-.182-.168-.346-.206-.545.136.034.362.326.567.732l.057.074.018-.011a1.563 1.563 0 01-.052-.127c-.046-.145-.097-.29-.136-.436-.022-.083-.036-.173.022-.26l.109.058-.026-.207.027-.016c.022.02.05.036.065.06.073.108.143.22.215.33.01.016.029.029.043.043-.036-.217-.2-.38-.229-.626l.155.112c.014-.166.012-.319.042-.465.032-.158-.023-.297-.063-.445.024.004.036.006.055.025.092.124.183.249.277.371.02.027.05.047.069.087l.04.063.019-.015a.293.293 0 01-.053-.082 27.922 27.922 0 01-.332-.49c-.221-.311-.363-.467-.485-.521zm-6.57.327c-.003.161.092.275.069.415l-.368.087c.09.139.032.237-.052.331-.05.057-.092.122-.143.178-.037.04-.046.078-.018.126l.16.275c.029.048.072.066.128.064.076-.003.152 0 .228-.001.116-.003.216.022.275.137.006.014.02.024.044.052.004-.059-.003-.098.01-.13.016-.04.04-.099.072-.108.084-.023.173-.024.26-.03.013-.001.027.018.04.029l.071.065c.019-.11-.082-.198-.024-.31l.126.04c-.026-.123-.07-.245-.071-.366 0-.123.051-.243.115-.36.107.062.16.156.234.253.183.265.36.533.494.834.165-.078.27.068.407.088-.003-.106-.133-.441-.197-.492a.142.142 0 00-.102-.028c-.06.011-.119.039-.191.063-.025-.039-.056-.078-.077-.122a3.936 3.936 0 00-.473-.783c-.076-.094-.16-.182-.228-.26l-.391.285c-.049.035-.094.03-.132-.017l-.169-.207c-.025-.03-.053-.059-.097-.108z"})]})}function Lte({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:s.jsx("path",{d:"M4 2.2 20.6 12 12.7 13.9 10.4 21.8z"})})}const zte="M69.7784 34.9999C69.7784 39.871 68.7523 44.7296 66.7851 49.1832C64.9333 53.3744 62.2559 57.1874 58.9467 60.3483C55.8445 63.3119 52.1983 65.6915 48.2409 67.3356C44.5469 68.8705 40.5934 69.7611 36.6016 69.9583C32.8943 70.1403 29.1612 69.7256 25.5837 68.7326C22.2821 67.8153 19.1179 66.4087 16.2238 64.5701C6.14513 58.167 0 46.9674 0 34.9999C0 30.1288 1.0261 25.2701 2.99334 20.8165C7.82793 9.87552 17.9696 2.13463 29.7702 0.378474C33.1587 -0.126158 36.6197 -0.126158 40.0082 0.378474C43.6802 0.925238 47.2606 2.06281 50.5756 3.73662C54.1464 5.5397 57.4013 7.96136 60.157 10.8656C63.1112 13.9777 65.4831 17.6355 67.122 21.6056C68.8707 25.8408 69.7784 30.416 69.7784 34.9999ZM45.0815 25.5794C45.4136 26.1492 45.6484 26.7544 45.7315 27.4122C46.0379 29.8319 44.3112 32.0065 41.8829 32.2163C41.3665 32.2613 40.8425 32.2134 40.3414 32.0803C39.3229 31.8093 38.4123 31.185 37.7852 30.3366C37.496 29.9449 37.2574 29.5121 36.9996 29.1013C35.8351 27.2465 34.6239 25.4224 33.361 23.6346C32.9707 23.0802 32.5745 22.5296 32.1727 21.9829C31.8825 21.5864 31.5647 21.2024 31.347 20.7581C30.8163 19.679 30.845 18.3997 31.4282 17.3473C32.7244 15.008 36.0136 14.5091 38.1575 15.9273C38.8008 16.3534 39.2408 16.9404 39.6904 17.5532C40.0417 18.031 40.3881 18.5117 40.7308 18.9953C41.7388 20.4163 42.7133 21.8603 43.6583 23.3234C44.1403 24.0694 44.6348 24.8124 45.0815 25.5794ZM60.3288 19.2126C60.6056 19.7766 60.8261 20.3636 60.933 20.9851C61.1697 22.3515 60.786 24.0856 59.1232 24.1718C58.8398 24.1862 58.5553 24.1469 58.2814 24.0732C57.8595 23.9583 57.4624 23.762 57.0968 23.5216C56.2464 22.9634 55.5515 22.1686 55.0418 21.2905C54.8432 20.9468 54.6724 20.5867 54.4853 20.2363C54.1951 19.6905 53.8925 19.1514 53.5795 18.618C52.2536 16.3677 50.7092 14.2956 49.0159 12.3134C48.2838 11.4564 47.2348 9.80561 48.1426 8.71974C48.5234 8.26395 49.1429 8.11553 49.7118 8.11457C50.8963 8.11361 52.0685 8.64601 53.0306 9.30194C54.2037 10.1034 55.0971 11.2448 55.9667 12.3537C57.6323 14.4775 59.1385 16.7843 60.3288 19.2126Z";function Pte({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 70 70",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:zte})})}const Dte=new Set(["claudeAgent","mistral","meta","museCode","kimiAgent","qwenAgent","deepseekAgent","greenference","modelgo","kiroAgent"]),$te=new Set(["openai","xai","ollama"]);function Bte(e){return e.icon?.kind==="custom"?"brand":e.icon?.kind==="preset"?$te.has(e.icon.preset)?"mono":"brand":Dte.has(e.driverKind)?"brand":"mono"}const Fte={brand:"opacity-60 group-hover:opacity-100 group-focus-within:opacity-100 touch:opacity-60",mono:"[--color-ink:var(--color-ink-tertiary)] [--color-ink-secondary:var(--color-ink-tertiary)] group-hover:[--color-ink:inherit] group-hover:[--color-ink-secondary:inherit] group-focus-within:[--color-ink:inherit] group-focus-within:[--color-ink-secondary:inherit]"};function A2({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),children:[s.jsx("path",{d:"M9.26905 15.284L17.2479 9.36086C17.6391 9.07047 18.1981 9.18374 18.3845 9.63478C19.3655 12.0135 18.9272 14.8721 16.9755 16.8349C15.0238 18.7976 12.3082 19.228 9.8261 18.2477L7.1146 19.5102C11.0037 22.1834 15.7263 21.5223 18.6774 18.5525C21.0182 16.1985 21.7432 12.9897 21.0653 10.0961L21.0714 10.1023C20.0884 5.85143 21.3131 4.15233 23.8218 0.677913C23.8812 0.595532 23.9406 0.513151 24 0.428711L20.6987 3.74866V3.73836L9.267 15.2861"}),s.jsx("path",{d:"M7.62249 16.7237C4.83113 14.0422 5.3124 9.89222 7.69417 7.49905C9.45541 5.72786 12.341 5.00497 14.86 6.06768L17.5653 4.81138C17.0779 4.45714 16.4533 4.07613 15.7365 3.80839C12.4966 2.46764 8.6178 3.13492 5.98413 5.78141C3.45081 8.32904 2.65415 12.2463 4.02219 15.5889C5.04412 18.0871 3.36889 19.8541 1.68137 21.6377C1.08337 22.2699 0.483318 22.9022 0 23.5716L7.62045 16.7257"})]})}function T2({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 256 257",preserveAspectRatio:"xMidYMid",className:I("fill-[#d97757]",t),children:s.jsx("path",{d:"m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z"})})}function hc({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 256 260",preserveAspectRatio:"xMidYMid",className:I("fill-[var(--color-ink)]",t),children:s.jsx("path",{d:"M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z"})})}function M2({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:[s.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z",fill:"#1783FF"}),s.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z",fill:"var(--color-ink)"})]})}function Ute({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 508 508",className:t,"aria-hidden":!0,children:s.jsx("path",{fill:"var(--color-ink)",d:"M321.997 150.712C321.401 150.568 320.844 150.299 320.363 149.925C319.883 149.551 319.491 149.08 319.215 148.544C318.938 148.008 318.783 147.42 318.76 146.821C318.738 146.22 318.848 145.624 319.084 145.07C327.226 125.716 330.819 110.23 325.021 103.747C309.666 86.5471 248.085 120.749 228.451 132.333C227.925 132.642 227.337 132.837 226.728 132.903C226.118 132.969 225.501 132.906 224.918 132.719C224.336 132.531 223.801 132.223 223.351 131.815C222.902 131.407 222.548 130.909 222.313 130.356C214.06 111.043 205.384 97.6094 196.589 97.0268C173.279 95.4688 154.491 162.187 148.991 183.932C148.844 184.515 148.57 185.06 148.188 185.528C147.805 185.998 147.323 186.381 146.775 186.651C146.227 186.921 145.626 187.072 145.012 187.094C144.399 187.116 143.788 187.009 143.221 186.778C123.406 178.825 107.545 175.316 100.914 180.98C83.305 195.978 118.315 256.126 130.175 275.304C130.492 275.816 130.692 276.391 130.76 276.987C130.829 277.582 130.765 278.186 130.573 278.755C130.381 279.325 130.065 279.847 129.647 280.286C129.228 280.725 128.718 281.07 128.15 281.298C108.384 289.359 94.6306 297.834 94.0272 306.424C92.439 329.192 160.74 347.544 183.01 352.916C183.605 353.061 184.16 353.33 184.64 353.704C185.118 354.077 185.509 354.548 185.785 355.083C186.061 355.618 186.215 356.205 186.237 356.803C186.26 357.402 186.151 357.998 185.916 358.551C177.773 377.905 174.181 393.398 179.979 399.874C195.334 417.074 256.921 382.877 276.556 371.293C277.081 370.984 277.67 370.789 278.28 370.722C278.889 370.655 279.507 370.717 280.09 370.905C280.673 371.093 281.207 371.402 281.657 371.81C282.106 372.219 282.46 372.717 282.694 373.271C290.947 392.578 299.616 406.012 308.417 406.601C331.728 408.153 350.516 341.44 356.009 319.688C356.157 319.106 356.432 318.562 356.816 318.094C357.2 317.625 357.682 317.243 358.231 316.974C358.779 316.705 359.381 316.554 359.995 316.533C360.608 316.511 361.219 316.619 361.786 316.85C381.601 324.803 397.455 328.304 404.093 322.648C421.702 307.65 386.684 247.495 374.825 228.317C374.51 227.804 374.312 227.229 374.245 226.634C374.177 226.039 374.242 225.436 374.434 224.868C374.626 224.299 374.941 223.777 375.358 223.338C375.775 222.899 376.284 222.552 376.85 222.323C396.623 214.261 410.376 205.786 410.973 197.196C412.568 174.428 344.26 156.078 321.997 150.712ZM295.254 128.885C299.734 136.73 276.646 189 259.474 225.561C259.186 226.172 258.715 226.682 258.121 227.024C257.528 227.365 256.842 227.521 256.155 227.47C255.468 227.419 254.814 227.164 254.28 226.739C253.746 226.314 253.358 225.739 253.169 225.093C246.234 201.322 238.306 173.392 229.824 149.683C229.491 148.752 229.508 147.736 229.871 146.817C230.235 145.897 230.921 145.133 231.808 144.662C252.989 133.363 289.234 118.358 295.254 128.885ZM193.746 135.355C202.589 137.807 224.103 190.714 238.424 228.426C238.664 229.056 238.699 229.742 238.527 230.393C238.354 231.044 237.983 231.627 237.461 232.065C236.939 232.503 236.292 232.775 235.608 232.844C234.923 232.913 234.234 232.775 233.632 232.45C211.501 220.453 185.694 206.159 162.529 195.253C161.622 194.823 160.901 194.093 160.493 193.192C160.085 192.292 160.018 191.279 160.303 190.335C167.12 167.736 181.865 132.069 193.746 135.355ZM126.652 210.04C134.676 205.664 188.197 228.216 225.621 244.989C226.248 245.269 226.771 245.73 227.12 246.31C227.47 246.889 227.629 247.56 227.577 248.23C227.524 248.901 227.264 249.54 226.828 250.062C226.393 250.582 225.805 250.962 225.143 251.147C200.813 257.921 172.211 265.664 147.937 273.949C146.985 274.272 145.946 274.255 145.007 273.9C144.067 273.545 143.286 272.876 142.805 272.011C131.257 251.322 115.867 215.92 126.652 210.04ZM133.275 309.188C135.779 300.551 189.952 279.537 228.562 265.548C229.207 265.315 229.91 265.28 230.576 265.448C231.243 265.617 231.84 265.98 232.288 266.49C232.736 266.999 233.015 267.631 233.085 268.299C233.155 268.968 233.015 269.641 232.682 270.23C220.392 291.846 205.758 317.053 194.592 339.672C194.156 340.561 193.409 341.269 192.486 341.668C191.563 342.068 190.525 342.134 189.557 341.853C166.42 335.235 129.905 320.792 133.275 309.188ZM209.739 374.722C205.252 366.884 228.347 314.608 245.519 278.054C245.806 277.442 246.279 276.931 246.872 276.59C247.465 276.249 248.151 276.093 248.838 276.144C249.525 276.194 250.179 276.45 250.713 276.875C251.247 277.3 251.634 277.874 251.824 278.521C258.759 302.285 266.686 330.222 275.169 353.932C275.499 354.862 275.481 355.877 275.117 356.795C274.752 357.713 274.064 358.475 273.178 358.945C252.004 370.223 215.752 385.256 209.76 374.722H209.739ZM311.247 368.252C302.397 365.807 280.883 312.894 266.562 275.182C266.322 274.55 266.285 273.862 266.458 273.21C266.63 272.559 267.003 271.974 267.526 271.536C268.049 271.097 268.697 270.826 269.382 270.758C270.068 270.69 270.759 270.83 271.361 271.157C293.485 283.154 319.299 297.455 342.457 308.362C343.366 308.789 344.089 309.519 344.497 310.42C344.905 311.321 344.971 312.335 344.683 313.28C337.872 335.912 323.128 371.544 311.247 368.252ZM378.341 293.566C370.31 297.949 316.795 275.391 279.365 258.618C278.738 258.338 278.215 257.877 277.866 257.297C277.516 256.718 277.357 256.047 277.409 255.377C277.461 254.706 277.722 254.067 278.158 253.546C278.593 253.025 279.181 252.646 279.843 252.461C304.18 245.687 332.775 237.943 357.049 229.658C358.003 229.335 359.043 229.353 359.984 229.709C360.925 230.065 361.706 230.737 362.188 231.603C373.729 252.285 389.119 287.693 378.341 293.566ZM371.718 194.419C369.207 203.063 315.041 224.077 276.431 238.066C275.784 238.3 275.08 238.335 274.413 238.167C273.746 237.999 273.148 237.635 272.698 237.124C272.249 236.613 271.972 235.98 271.903 235.31C271.833 234.641 271.975 233.966 272.311 233.377C284.594 211.768 299.228 186.554 310.394 163.935C310.833 163.048 311.58 162.343 312.502 161.945C313.425 161.546 314.462 161.481 315.429 161.76C338.566 168.413 375.081 182.815 371.718 194.419Z"})})}function qte({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:s.jsx("path",{fillRule:"evenodd",d:"M21.751 22.607c1.34 1.005 3.35.335 1.508-1.508C17.73 15.74 18.904 1 12.037 1 5.17 1 6.342 15.74.815 21.1c-2.01 2.009.167 2.511 1.507 1.506 5.192-3.517 4.857-9.714 9.715-9.714 4.857 0 4.522 6.197 9.714 9.715z"})})}function Hte({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:s.jsx("path",{fillRule:"evenodd",d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function GT({size:e=16,className:t}){const n="omb-qwen-mark";return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":!0,children:[s.jsx("path",{fill:`url(#${n})`,fillRule:"nonzero",d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:n,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[s.jsx("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:.92}),s.jsx("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:.92})]})})]})}function Wte({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 800 800",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:[s.jsx("path",{fillRule:"evenodd",d:"M165.29 165.29 H517.36 V400 H400 V517.36 H282.65 V634.72 H165.29 Z M282.65 282.65 V400 H400 V282.65 Z"}),s.jsx("path",{d:"M517.36 400 H634.72 V634.72 H517.36 Z"})]})}function _2({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:s.jsx("path",{fill:"#5786FE",d:"M23.748 4.651c-.254-.124-.364.113-.512.233-.423.437-.857.794-1.51.763-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.789-.347-1.077-.626-1.26-1.424-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323l-.266.833c-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-1.06-1.024-1.97-2.183-3.286-2.93-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-1.27.006-2.312.621-3.152.821a9.6 9.6 0 0 0-2.883-.101c-3.75.419-5.994 3.589-5.757 7.395.218 3.496 2.247 6.521 5.258 8.037 2.52 1.269 5.649 1.474 8.484-.924.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 2.056-2.431 3.44-5.604 3.392-7.847-.004-.171.035-.238.23-.257 2.371-.246 3.642-1.764 3.838-3.992.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-2.919-1.718-4.443-4.959-4.6-7.788-.02-.385.094-.522.477-.592 2.602-.471 5.025.581 6.997 2.736 1.652 1.807 2.631 4.049 4.682 5.785.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 1 1 .614.001.306.306 0 0 1-.614 0m3.11 1.596c-.494.199-.931.222-1.389-.094-.274-.23-.47-.358-.551-.758-.122-.602.111-.903-.223-1.315-.188-.156-.426-.199-.689-.199-.454 0-.553-.298-.368-.636.356-.422.859-.442 1.338-.29.72.294 1.319 1.129 1.706 1.743.176.264.336.536.446.848.066.194-.02.353-.25.45"})})}function YT({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:s.jsx("path",{fill:"var(--color-ink)",d:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"})})}function Kte({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:[s.jsx("rect",{width:"24",height:"24",rx:"6",fill:"var(--color-ink)"}),s.jsx("path",{stroke:"var(--color-panel)",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",transform:"translate(4.8 4.8) scale(0.6)",d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"})]})}function JT({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:[s.jsx("path",{fill:"#7B3FE4",d:"M12 2a7.5 7.5 0 0 0-7.5 7.5V22l2.5-1.8 2.5 1.8 2.5-1.8 2.5 1.8 2.5-1.8 2.5 1.8V9.5A7.5 7.5 0 0 0 12 2Z"}),s.jsx("circle",{cx:"9.3",cy:"10",r:"1.5",fill:"var(--color-panel)"}),s.jsx("circle",{cx:"14.7",cy:"10",r:"1.5",fill:"var(--color-panel)"})]})}function QT({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"4 2 24 24",className:t,"aria-hidden":"true",children:[s.jsx("path",{stroke:"#407A84",strokeWidth:1.7,d:"M16 16V7M16 16l-8 5M16 16l8 5"}),s.jsxs("g",{fill:"#407A84",children:[s.jsx("circle",{cx:"16",cy:"7",r:"2.4"}),s.jsx("circle",{cx:"8",cy:"21",r:"2.4"}),s.jsx("circle",{cx:"24",cy:"21",r:"2.4"}),s.jsx("circle",{cx:"16",cy:"16",r:"3.8"})]})]})}function Kx({size:e=16,className:t}){const n=f.useId().replace(/\W/gu,"");return s.jsxs("svg",{width:e,height:e,viewBox:"0 18.09 31 31",fill:"none",className:t,"aria-hidden":"true",children:[s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:`${n}a`,x1:"10.5179",y1:"25.8892",x2:"2.29751",y2:"41.3335",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#5071FF"}),s.jsx("stop",{offset:"1",stopColor:"#0410FF"})]}),s.jsxs("linearGradient",{id:`${n}b`,x1:"14",y1:"29.5894",x2:"17",y2:"32.5894",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#2563EB"}),s.jsx("stop",{offset:"1",stopColor:"#16C784"})]}),s.jsxs("linearGradient",{id:`${n}c`,x1:"24.9101",y1:"35.7894",x2:"12.7635",y2:"41.9022",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#13DA74"}),s.jsx("stop",{offset:"1",stopColor:"#1F83CD"})]})]}),s.jsx("path",{fill:`url(#${n}a)`,d:"M6.31271 27.713C7.94898 25.3277 11.1777 24.7425 13.5241 26.4059C15.8703 28.0693 16.446 31.3509 14.8099 33.7361L9.42862 41.5814C7.79234 43.9665 4.56361 44.5517 2.21725 42.8885C-0.129169 41.2252 -0.704765 37.9429 0.931485 35.5577L6.31271 27.713ZM13.0071 29.9972C12.0826 28.0346 9.41394 27.8263 8.2057 29.6228L2.7953 37.6672C2.1197 38.6719 2.36677 40.0427 3.34879 40.7389L3.51215 40.8544C4.49397 41.5504 5.84429 41.3127 6.53837 40.3214L13.2065 30.7957C13.2716 30.7027 13.2818 30.581 13.2334 30.478L13.0071 29.9972Z"}),s.jsx("path",{fill:"#16C784",d:"M23.7889 27.7173C22.1526 25.3321 18.924 24.7469 16.5775 26.4103C14.2313 28.0737 13.6556 31.3559 15.2917 33.7411L21.1882 42.336C22.8245 44.7212 26.0526 45.3064 28.399 43.6431C30.7454 41.9798 31.3214 38.6981 29.6853 36.3128L23.7889 27.7173ZM17.2344 30.2879C18.159 28.3251 20.8276 28.1169 22.0359 29.9134L27.4463 37.9578C28.1218 38.9625 27.8752 40.3328 26.8934 41.0289L26.73 41.1451C25.7482 41.8411 24.3979 41.6029 23.7038 40.6115L17.0351 31.0858C16.9701 30.9928 16.9597 30.871 17.0082 30.7681L17.2344 30.2879Z"}),s.jsx("path",{fill:`url(#${n}b)`,d:"M15.6385 34.2402L15.1611 33.5552L16.944 30.958L17.3932 31.6002L15.6385 34.2402Z"}),s.jsx("path",{fill:"#16C784",d:"M19.9475 40.5176L19.5264 39.8753L21.3513 37.1641L21.7724 37.7348L19.9475 40.5176Z"}),s.jsx("path",{fill:`url(#${n}c)`,d:"M18.0466 25.5876C20.1674 24.8708 22.585 25.6165 23.9285 27.5749L29.824 36.1696C31.2186 38.2028 31.0051 40.8864 29.4587 42.6647C29.1679 43.0226 28.827 43.3488 28.4353 43.6286C26.0801 45.3106 22.8295 44.7337 21.1746 42.3395L19.8152 40.3727C19.7017 40.2086 19.5993 40.0397 19.5066 39.8678L17.9372 42.2028C16.2924 44.5816 13.0617 45.1548 10.7214 43.4831C8.38107 41.8111 7.81697 38.5263 9.46166 36.1471L15.3884 27.5739C16.064 26.5967 17.0076 25.925 18.0466 25.5876ZM26.0671 36.6413C25.269 35.4872 23.7017 35.2084 22.5662 36.0192L21.6599 36.6667L21.3845 37.0749C21.382 37.1637 21.4066 37.2543 21.4607 37.3327L23.7488 40.6422C24.4093 41.5977 25.7063 41.8282 26.6462 41.1569C27.5862 40.4854 27.8125 39.1661 27.1521 38.2106L26.0671 36.6413ZM19.7917 28.9792C18.9257 28.944 18.0396 29.3246 17.4734 30.1579L12.0144 38.196C11.3768 39.1348 11.603 40.4208 12.5212 41.0768C13.4392 41.7324 14.706 41.5139 15.3591 40.5866L19.5124 34.7692C19.8833 34.0834 20.4104 33.4711 21.0828 32.9909C21.7305 32.5282 22.446 32.2362 23.1775 32.1061L21.8943 30.1989C21.3772 29.4303 20.5925 29.0301 19.7917 28.9762V28.9792Z"})]})}function R2({driverKind:e,size:t,className:n}){switch(e){case"grok":case"grokAgent":return s.jsx(A2,{size:t,className:n});case"claudeAgent":return s.jsx(T2,{size:t,className:n});case"mistral":return s.jsx(ry,{preset:"mistral",size:t,className:n});case"meta":case"museCode":return s.jsx(ry,{preset:"meta",size:t,className:n});case"codex":return s.jsx(hc,{size:t,className:n});case"kimiAgent":return s.jsx(M2,{size:t,className:n});case"droidAgent":return s.jsx(Ute,{size:t,className:n});case"cursorAgent":return s.jsx(Lte,{size:t,className:n});case"antigravityAgent":return s.jsx(qte,{size:t,className:n});case"opencodeGo":return s.jsx(Hte,{size:t,className:n});case"qwenAgent":return s.jsx(GT,{size:t,className:n});case"hermesAgent":return s.jsx(Ote,{size:t,className:n});case"deepseekAgent":return s.jsx(_2,{size:t,className:n});case"piAgent":return s.jsx(Wte,{size:t,className:n});case"copilotAgent":return s.jsx(YT,{size:t,className:n});case"commandCodeAgent":return s.jsx(Kte,{size:t,className:n});case"kiroAgent":return s.jsx(JT,{size:t,className:n});case"greenference":return s.jsx(QT,{size:t,className:n});case"modelgo":return s.jsx(Kx,{size:t,className:n});default:return s.jsx("span",{className:I("flex size-full items-center justify-center text-[10px] font-semibold tracking-tight text-ink-secondary",n),children:(e.replace(/Agent$/i,"").slice(0,1)||"?").toUpperCase()})}}function ry({preset:e,size:t=16,className:n}){switch(e){case"openai":return s.jsx(hc,{size:t,className:n});case"anthropic":return s.jsx(T2,{size:t,className:n});case"xai":return s.jsx(A2,{size:t,className:n});case"qwen":return s.jsx(GT,{size:t,className:n});case"moonshot":return s.jsx(M2,{size:t,className:n});case"google":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#8E75B2",d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"})});case"azure":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#0089D6",d:"M22.379 23.343a1.62 1.62 0 0 0 1.536-2.14v.002L17.35 1.76A1.62 1.62 0 0 0 15.816.657H8.184A1.62 1.62 0 0 0 6.65 1.76L.086 21.204a1.62 1.62 0 0 0 1.536 2.139h4.741a1.62 1.62 0 0 0 1.535-1.103l.977-2.892 4.947 3.675c.28.208.618.32.966.32m-3.084-12.531 3.624 10.739a.54.54 0 0 1-.51.713v-.001h-.03a.54.54 0 0 1-.322-.106l-9.287-6.9h4.853m6.313 7.006c.116-.326.13-.694.007-1.058L9.79 1.76a1.722 1.722 0 0 0-.007-.02h6.034a.54.54 0 0 1 .512.366l6.562 19.445a.54.54 0 0 1-.338.684"})});case"aws":return s.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:[s.jsx("path",{fill:"var(--color-ink)",d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272-.184.08-.32.12-.407.12-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28.04-.056.112-.112.224-.167.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167z"}),s.jsx("path",{fill:"#FF9900",d:"M21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zm1.094-1.246c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"})]});case"meta":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#0467DF",d:"M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973.14.605.228.654.636 1.621.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.942-1.664.183.3 2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843 1.175-.99 1.671-2.573 1.671-5.018 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c1.19-1.85 2.25-2.929 3.569-2.929zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-1.17 0-1.847-1.04-1.847-2.84 0-2.221.63-4.535 1.66-6.088.824-1.245 1.697-1.818 2.621-1.818z"})});case"mistral":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#FA520F",d:"M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z"})});case"cohere":return s.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:[s.jsx("path",{fill:"#39594D",fillRule:"evenodd",d:"M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z"}),s.jsx("path",{fill:"#D18EE2",fillRule:"evenodd",d:"M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z"}),s.jsx("path",{fill:"#FF7759",d:"M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z"})]});case"openrouter":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#94A3B8",d:"M16.778 1.844v1.919q-.569-.026-1.138-.032-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.792.447-2.497.904-3.936 1.131v4.229c1.31.184 2.908.627 3.795 1.132 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918L24 15.038l-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z"})});case"deepseek":return s.jsx(_2,{size:t,className:n});case"ollama":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"var(--color-ink)",d:"M16.361 10.26a.894.894 0 0 0-.558.47l-.072.148.001.207c0 .193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86 0 0 0 .517-.436.752.752 0 0 0 .08-.498c-.064-.453-.33-.782-.724-.897a1.06 1.06 0 0 0-.466 0zm-9.203.005c-.305.096-.533.32-.65.639a1.187 1.187 0 0 0-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894 0 0 0-.565-.472 1.02 1.02 0 0 0-.474.007Zm4.184 2c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365 0 0 0-.175-.48.394.394 0 0 0-.181-.033c-.126 0-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396 0 0 0-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589 1.226-1.787 2.114-.04.176-.045.234-.045.53 0 .294.005.357.043.524.264 1.16 1.332 2.017 2.714 2.173.3.033 1.596.033 1.896 0 1.11-.125 2.064-.727 2.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523 0-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873 6.873 0 0 0-.855-.031zm.645.937a3.283 3.283 0 0 1 1.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115 3.115 0 0 1-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46 1.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653 1.653 0 0 0-.683.298C5.617.74 5.173 1.666 4.985 2.819c-.07.436-.119 1.04-.119 1.503 0 .544.064 1.24.155 1.721.02.107.031.202.023.208a8.12 8.12 0 0 1-.187.152 5.324 5.324 0 0 0-.949 1.02 5.49 5.49 0 0 0-.94 2.339 6.625 6.625 0 0 0-.023 1.357c.091.78.325 1.438.727 2.04l.13.195-.037.064c-.269.452-.498 1.105-.605 1.732-.084.496-.095.629-.095 1.294 0 .67.009.803.088 1.266.095.555.288 1.143.503 1.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405 7.405 0 0 0-.548 1.873c-.062.417-.071.552-.071.991 0 .56.031.832.148 1.279L3.42 24h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915 0 0 0-.194-.25 1.74 1.74 0 0 1-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787 0 0 0 .223-.531c0-.195-.07-.355-.224-.522a3.136 3.136 0 0 1-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814 1.353-1.336 2.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467 1.352-.561.17-.035.25-.04.569-.04.319 0 .398.005.569.04a4.07 4.07 0 0 1 1.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016 1.144.23 2.14 1.173 2.581 2.437.385 1.108.276 2.267-.296 3.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001 1.053.493.539.801 1.866.708 3.036-.062.772-.26 1.463-.533 1.854a2.096 2.096 0 0 1-.224.258.916.916 0 0 0-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498 1.295.253 1.008.231 2.01-.059 2.581a.845.845 0 0 0-.044.098c0 .006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016 0-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378 0-1.628-.083-.645-.182-1.082-.348-1.525a6.083 6.083 0 0 0-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625 6.625 0 0 0-.024-1.358 5.512 5.512 0 0 0-.939-2.339 5.325 5.325 0 0 0-.95-1.02 8.097 8.097 0 0 1-.186-.152.692.692 0 0 1 .023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8 1.205-2.116 3.01a6.805 6.805 0 0 0-.097.726c0 .036-.007.066-.015.066a.96.96 0 0 1-.149-.078A4.857 4.857 0 0 0 12 3.03c-.832 0-1.687.243-2.456.698a.958.958 0 0 1-.148.078c-.008 0-.015-.03-.015-.066a6.71 6.71 0 0 0-.097-.725C8.997 1.392 8.337.319 7.46.048a2.096 2.096 0 0 0-.585-.041Zm.293 1.402c.248.197.523.759.682 1.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102 1.24l.002.475-.12.175-.118.178h-.278c-.324 0-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438 8.438 0 0 1 .016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36 2.028.212 3.145-.019.14-.024.151-.057.144l-.238-.06a3.693 3.693 0 0 0-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z"})})}}function $s({instance:e,size:t=16,className:n,subtle:a=!1}){if(a){const r=Bte(e);return s.jsx("span",{"data-provider-mark":r,className:I("inline-flex shrink-0 transition-opacity",Fte[r],n),style:{width:t,height:t},children:s.jsx($s,{instance:e,size:t})})}return e.icon?.kind==="custom"?s.jsx(Vte,{dataUrl:e.icon.dataUrl,driverKind:e.driverKind,size:t,className:n},e.icon.dataUrl):e.icon?.kind==="preset"?s.jsx(ry,{preset:e.icon.preset,size:t,className:n}):s.jsx(R2,{driverKind:e.driverKind,size:t,className:n})}function Vte({dataUrl:e,driverKind:t,size:n=16,className:a}){const[r,i]=f.useState(!1);return r?s.jsx(R2,{driverKind:t,size:n,className:a}):s.jsx("img",{src:e,alt:"",width:n,height:n,onError:()=>i(!0),className:I("rounded-[22%] object-cover",a)})}function on(e){return e.driverKind==="clineAgent"?e.snapshot.state==="available"&&e.snapshot.authenticated===!0:e.snapshot.state==="available"&&(e.access==="custom"||e.snapshot.authenticated!==!1)}const Gte={claudeAgent:"Anthropic",codex:"OpenAI",grok:"xAI",grokAgent:"xAI",kimiAgent:"Moonshot AI",droidAgent:"Factory",cursorAgent:"Cursor",antigravityAgent:"Google",opencodeGo:"OpenCode",qwenAgent:"Qwen",hermesAgent:"Nous Research",clineAgent:"Cline",copilotAgent:"GitHub",commandCodeAgent:"Command Code",kiroAgent:"Amazon Web Services",piAgent:"pi.dev",mistral:"Mistral AI",cerebras:"Cerebras",groq:"Groq",greenference:"Greenference",modelgo:"ModelGo",meta:"Meta",museCode:"Meta",deepseekAgent:"DeepSeek"};function Yte(e){return Gte[e.driverKind]??e.driverKind}function NDe({instance:e,children:t,summary:n,bare:a=!1}){if(a)return s.jsx("div",{"data-engine-card":e.instanceId,className:"min-w-0",children:t});const r=n?.ready??on(e),i=e.snapshot.authenticated===!0?e.snapshot.account?.email:void 0,o=n?.title??e.displayName,c=n?.subtitle??i??(e.access==="custom"?l("engines.library.custom"):Yte(e)),d=e.snapshot.version?.match(/\d+\.\d+(?:\.\d+)?(?:[-+][\w.-]+)?/)?.[0],u=Rte(e);return s.jsxs("details",{"data-engine-card":e.instanceId,className:"group/engine min-w-0 rounded-2xl border border-hairline/40 bg-card transition-colors open:col-span-full open:border-hairline/70 hover:border-hairline/70",children:[s.jsxs("summary",{className:"cursor-pointer list-none rounded-2xl p-4 outline-none focus-visible:ring-2 focus-visible:ring-accent [&::-webkit-details-marker]:hidden",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("span",{"aria-hidden":"true",className:"flex size-12 shrink-0 items-center justify-center rounded-xl border border-hairline/30 bg-panel",children:s.jsx($s,{instance:e,size:28})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"truncate text-[15px] font-semibold tracking-[-0.015em] text-ink",title:o,children:o}),s.jsx("div",{className:"mt-1 truncate text-[12px] text-ink-secondary",title:c,children:c})]}),s.jsx(jt,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary transition-transform group-open/engine:rotate-180 motion-reduce:transition-none"})]}),s.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("span",{className:I("inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium",r?"bg-success/10 text-success":"bg-control text-ink-secondary"),children:[r?s.jsx(Se,{size:12,"aria-hidden":"true"}):s.jsx("span",{className:"size-1.5 rounded-full bg-warning","aria-hidden":"true"}),n?.status??(r?l("onboarding.engines.ready"):e.snapshot.state==="available"&&e.snapshot.authenticated===!1?l("model.signInRequired"):l("onboarding.engines.needsSetup"))]}),n?s.jsx("span",{className:I("text-[11px] font-medium",r?"text-ink-secondary":"text-accent-text"),children:n.action}):r?s.jsx("span",{className:"text-[11px] tabular-nums text-ink-secondary",children:u?l("engines.updatedTo",{version:u}):d?`v${d}`:l("engines.library.manage")}):s.jsxs("span",{className:"inline-flex items-center gap-1 text-[12px] font-semibold text-accent-text",children:[l("engines.library.setup"),s.jsx(Hs,{size:13,"aria-hidden":"true"})]})]})]}),s.jsx("div",{className:"min-w-0 border-t border-hairline/40 p-4",children:t})]})}function SDe({instances:e,renderEngine:t,isReady:n=on}){return s.jsxs("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,280px),1fr))] items-start gap-3",children:[[!0,!1].flatMap(a=>{const r=e.filter(o=>n(o)===a);if(!r.length)return[];const i=l(a?"onboarding.engines.ready":"onboarding.engines.needsSetup");return[s.jsxs("div",{className:I("col-span-full flex items-center justify-between gap-3 px-4",!a&&e.some(n)&&"mt-4"),children:[s.jsx("h2",{className:"text-[12px] font-semibold text-ink-secondary",children:i}),s.jsx("span",{className:"text-[11px] tabular-nums text-ink-secondary",children:l(r.length===1?"engines.library.countOne":"engines.library.count",{count:r.length})})]},`heading-${a}`),...r.map(o=>s.jsx("div",{className:"contents",children:t(o)},o.instanceId))]}),e.length===0&&s.jsx("p",{className:"col-span-full py-4 text-[13px] text-ink-secondary",children:l("engines.none")})]})}function XT(){const{refreshInstances:e}=re(),[t,n]=f.useState(!1),[a,r]=f.useState(null),[i,o]=f.useState(!1);return s.jsxs("div",{children:[s.jsxs("button",{type:"button",disabled:t,onClick:async()=>{n(!0),r(null),o(!1);try{await e({reportErrors:!0}),o(!0)}catch(c){r(c instanceof Error?c.message:String(c))}finally{n(!1)}},className:"inline-flex shrink-0 items-center gap-1.5 rounded-lg px-2.5 py-2 text-[12px] font-medium text-ink-secondary hover:bg-control hover:text-ink focus-visible:outline-2 focus-visible:outline-accent disabled:opacity-50",children:[s.jsx(Tt,{size:13,"aria-hidden":"true",className:I(t&&"animate-spin")}),t?l("common.checking"):l("engines.library.refresh")]}),a&&s.jsx("p",{role:"alert",className:"mt-1 text-[12px] text-danger",children:l("engineSetup.checkFailed",{reason:a})}),i&&s.jsx("p",{role:"status",className:"mt-1 text-[11px] text-ink-secondary",children:l("engineSetup.checked")})]})}function ye(e,t){return tt().toLowerCase().startsWith("vi")?e:t}const jN={claudeApi:"engines.defaultName.claudeApi",chatgpt:"engines.defaultName.chatgpt",openaiCompat:"engines.defaultName.openaiCompat"};function gt(e){const t=Object.hasOwn(jN,e.instanceId)?jN[e.instanceId]:void 0;return t&&e.displayName===Ia[t]?l(t):e.displayName}const IDe=["everyday","work","writing","design","sales","personal"],x1=[1,2,3,4,5],Rc=(e,t,n,a)=>({name:e,prompt:t,schedule:{type:"daily",time:n,weekdays:a},enabled:!1,overlap:"skip"}),Jte=[{id:"assistant",category:"everyday",name:"Assistant",title:"General assistant",description:"Trả lời câu hỏi, soạn văn bản và nhận mọi việc bạn giao.",soul:["You are a capable, plain-spoken assistant.","Ask one clarifying question when a request is ambiguous; otherwise do the work and show the result.","Lead with the answer, then the detail. Keep replies short and concrete, and use lists only when they help.","Say plainly when you are unsure or could not check something, and never present a guess as a fact.","When a task will take several steps, say what you are about to do in one line before doing it."].join(`
18
+ `)].join("|")}const Aee={ended:!1,status:null},Tee=500,$r=new Map,Wm=new Map;function Mee(e,t){return e===t?!0:!e||!t?!1:("bytes"in e?e.bytes:void 0)===("bytes"in t?t.bytes:void 0)&&oN(e)===oN(t)}function Oi(e,t){const n=$r.get(e);if(!(n&&n.turnId===t.turnId&&n.ended===t.ended&&Mee(n.status,t.status))){$r.delete(e),$r.set(e,t),$r.size>Tee&&$r.delete($r.keys().next().value);for(const a of Array.from(Wm.get(e)??[]))a()}}function _ee(e){const{threadId:t}=e,n=$r.get(t),a=n&&(!e.turnId||e.turnId===n.turnId),r=e.turnId??n?.turnId,i=a?n:{turnId:r,ended:!1,status:null};switch(e.type){case"turn.started":return Oi(t,{turnId:r,ended:!1,status:null});case"turn.completed":case"cap.exhausted":case"session.exited":return Oi(t,{turnId:r,ended:!0,status:null});case"turn.progress":{const{activity:o,tool:c,file:d,bytes:u,itemId:p,target:m,detail:h,quiet:x,tail:g}=e;return Oi(t,{turnId:r,ended:!1,status:{activity:o,...c?{tool:c}:{},...d?{file:d}:{},...u!==void 0?{bytes:u}:{},...p?{itemId:p}:{},...m?{target:m}:{},...h?{detail:h}:{},...x?{quiet:x}:{},...g?.length?{tail:g}:{}}})}case"content.delta":return Oi(t,{turnId:r,ended:!1,status:{activity:e.streamKind==="reasoning_text"?"thinking":"reply"}});case"item.started":return Oi(t,{...i,ended:!1,status:i.status?.itemId&&i.status.itemId===e.itemId?i.status:null});case"item.completed":case"request.opened":return Oi(t,{...i,status:null});default:i!==n&&Oi(t,i)}}function lN(e){return e&&$r.get(e)||Aee}function Ree(e,t){if(!e)return()=>{};let n=Wm.get(e);return n||Wm.set(e,n=new Set),n.add(t),()=>{n.delete(t),n.size===0&&Wm.delete(e)}}function I2(e){return f.useSyncExternalStore(t=>Ree(e,t),()=>lN(e),()=>lN(e))}const Oee="/api/events",MT=4e4,Lee=500,zee=1e4,J0="omb:retry-live-events";function Pee(){window.dispatchEvent(new Event(J0))}function Dee(e){const t=new URLSearchParams;return e?.since&&t.set("since",e.since),e?.screens===!1&&t.set("screens","off"),t.set("window","1"),`${Oee}?${t}`}const mu=new Set,Qf=new Set,Ui=()=>[...mu].some(e=>e.screens);function Wx(e){const t=Ui();if(mu.add(e),Ui()!==t)for(const n of Qf)n();return()=>{const n=Ui();if(mu.delete(e),Ui()!==n)for(const a of Qf)a()}}function $ee(e){if(e.kind!=="screen")return e;const{png:t,...n}=e;return{...n,png:""}}function Bee(e){for(const t of mu)t.onFrame(e)}function Fee(){for(const e of mu)e.onMissedFrames?.()}function Uee(e){return e.kind==="ping"}function qee(e,t,n=MT){return t-e>=n}function Hee(e){let t;try{t=JSON.parse(e)}catch{return null}if(!t||Array.isArray(t)||Object(t)!==t)return null;const n=t;return n.kind!==String(n.kind)||n.cursor!==void 0&&n.cursor!==String(n.cursor)||n.resumed!==void 0&&n.resumed!==!!n.resumed?null:n}function Wee(e){e.kind==="runtime"?(_ee(e.event),fee(e.event)):e.kind==="message"&&e.message?.role==="bot"&&e.message?.kind==="text"&&hee(e.message,e.threadId)}function Kee(e){const t=globalThis.EventSource,n=e.createEventSource??(t?i=>{const o=new t(i),c={onopen:null,onerror:null,onmessage:null,close:()=>o.close()};return o.onopen=()=>c.onopen?.(),o.onerror=()=>c.onerror?.(),o.onmessage=d=>c.onmessage?.(d),c}:void 0);if(!n)return null;const a=globalThis.window,r=globalThis.document;return{createEventSource:n,windowTarget:e.windowTarget??(a?{addEventListener:(i,o)=>a.addEventListener(i,o),removeEventListener:(i,o)=>a.removeEventListener(i,o)}:void 0),documentTarget:e.documentTarget??(r?{addEventListener:(i,o)=>r.addEventListener(i,o),removeEventListener:(i,o)=>r.removeEventListener(i,o)}:void 0),isVisible:e.isVisible??(()=>!r||r.visibilityState==="visible"),isOnline:e.isOnline??(()=>globalThis.navigator?.onLine!==!1),now:e.now??Date.now}}function Vee(e,t={}){const n=Kee(t);if(!n)return e.onError?.(),()=>{};const a=e.staleMs??MT,r=Math.max(1,e.retryMinMs??Lee),i=Math.max(r,e.retryMaxMs??zee),o=Math.min(1e4,Math.max(250,a/2));let c=!1,d=null,u=Ui(),p=null,m=0,h=null,x=n.now(),g=0,v=null;const y=()=>{p!==null&&(clearTimeout(p),p=null)},w=()=>{const z=d;d=null,z&&(v?.source===z&&(g+=1,v=null),z.onopen=null,z.onerror=null,z.onmessage=null,z.close())};let b;const k=()=>{if(c||p!==null||!n.isOnline()||!n.isVisible()||Kr())return;const z=Math.min(m,20),P=Math.min(i,r*2**z);m+=1,p=setTimeout(()=>{p=null,n.isVisible()&&b()},P)},j=z=>{c||d!==z||(w(),e.onError?.(),k())};b=()=>{if(c||d||!n.isOnline()||Kr())return;let z;try{u=Ui(),z=n.createEventSource(Dee({since:h,screens:u}))}catch{e.onError?.(),k();return}d=z,x=n.now(),z.onopen=()=>{c||d!==z||(x=n.now(),e.onOpen?.())},z.onerror=()=>j(z),z.onmessage=P=>{if(c||d!==z)return;x=n.now();const $=Hee(P.data);if($){if(Uee($)){m=0;return}if($.kind==="hello"){if($.resumed===!1){const _=++g;v={generation:_,source:z,boundaryCursor:$.cursor||null,newestFrameCursor:null},(async()=>{let B=!1;try{B=await e.onSnapshotRequired()}catch{B=!1}const W=v;if(!(c||d!==z||!W||W.generation!==_)){if(!B){v=null,j(z);return}h=W.newestFrameCursor??W.boundaryCursor,v=null,O()}})()}}else P.lastEventId&&(v?.source===z?v.newestFrameCursor=P.lastEventId:h=P.lastEventId);if(AQ($)){y(),w(),jA();return}$.kind!=="hello"&&(Wee($),e.onFrame($))}}};const N=z=>{c||!n.isOnline()||(y(),d&&(w(),z&&e.onError?.()),b())},A=()=>{c||!n.isOnline()||!n.isVisible()||Kr()||(!d||qee(x,n.now(),a))&&N(d!==null)},T=()=>A(),M=()=>{n.isVisible()&&A()},S=()=>{n.isVisible()&&A()},C=()=>{n.isVisible()&&!Kr()&&N(!0)},O=()=>queueMicrotask(()=>{d&&h&&!v&&Ui()!==u&&N(!1)});Qf.add(O),b();const L=setInterval(A,o),D=Tx(z=>{z||N(!1)});return n.windowTarget?.addEventListener("online",T),n.windowTarget?.addEventListener("focus",M),n.windowTarget?.addEventListener(J0,C),n.documentTarget?.addEventListener("visibilitychange",S),()=>{c||(c=!0,Qf.delete(O),D(),clearInterval(L),y(),w(),n.windowTarget?.removeEventListener("online",T),n.windowTarget?.removeEventListener("focus",M),n.windowTarget?.removeEventListener(J0,C),n.documentTarget?.removeEventListener("visibilitychange",S))}}const cN=2e3,dN=new Set(["queued","running","waiting"]);function Q0(e){const t=[...e].sort((r,i)=>i.scheduledFor-r.scheduledFor);if(t.length<=cN)return t;const n=t.reduce((r,i)=>r+(dN.has(i.status)?1:0),0);let a=Math.max(0,cN-n);return t.filter(r=>dN.has(r.status)?!0:a===0?!1:(a-=1,!0))}const Gee=336*60*6e4;function Yee(e,t){const n=new Set(e.map(a=>a.id));return Q0([...e,...t.filter(a=>!n.has(a.id))])}function Jee(e,t){return e===null||t.from===void 0||t.to===void 0||t.to<e?e:Math.min(e,t.from)}const Qee=64;function jl(e,t){const n={...e,[t]:!0},a=Object.keys(n).length-Qee;if(a>0)for(const r of Object.keys(n).slice(0,a))delete n[r];return n}function qp(e,t){const n=[];for(const o of t)for(const c of o.messages??[])c.queueId&&n.push({queueId:c.queueId,at:c.at});if(n.length===0)return e;const a=new Set(n.map(o=>o.queueId)),r={};for(const[o,c]of Object.entries(e.pendingQueued)){const d=c.filter(u=>!a.has(u.queueId));d.length>0&&(r[o]=d)}let i={};n.sort((o,c)=>o.at-c.at);for(const o of n)i=jl(i,o.queueId);for(const o of Object.keys(e.consumedQueueIds))i=jl(i,o);return{...e,pendingQueued:r,consumedQueueIds:i}}function uN(e,t){const n=new Set(e.groups.flatMap(o=>[o.threadId,...(o.tasks??[]).map(c=>c.threadId)])),a=new Set(Object.values(t).flatMap(o=>o.map(c=>c.queueId))),r={...t};let i=e.consumedQueueIds;for(const[o,c]of Object.entries(e.pendingQueued))if(n.has(o))r[o]=c;else for(const d of c)a.has(d.queueId)||(i=jl(i,d.queueId));return{...e,pendingQueued:r,consumedQueueIds:i}}function Xee(e){return{xai:e.xai,mistral:e.mistral,cerebras:e.cerebras,groq:e.groq,greenference:e.greenference,modelgo:e.modelgo,deepseek:e.deepseek,meta:e.meta,xResearch:e.xResearch,treg:e.treg,postiz:e.postiz,anthropic:e.anthropic,openai:e.openai,openrouter:e.openrouter,openaiCompat:e.openaiCompat,fleet:e.fleet,toolGroups:e.toolGroups,composio:e.composio,box:e.box,vps:e.vps,rooms:e.rooms,mcp:e.mcp,threads:e.threads,automaticRecovery:e.automaticRecovery,cacheKeepWarm:e.cacheKeepWarm,localVm:e.localVm,opencodeGo:e.opencodeGo,tts:e.tts,decider:e.decider,helpers:e.helpers,imageGen:e.imageGen,live:e.live,savedKeys:e.savedKeys,profile:e.profile,everyBotRules:e.everyBotRules,language:e.language,features:e.features,onboarding:e.onboarding,browserEngine:e.browserEngine,browserProfiles:e.browserProfiles,edition:e.edition,budgets:e.budgets,billing:e.billing,managedPolicy:e.managedPolicy,...e.cloudHome?{cloudHome:!0}:{},...e.team?{team:e.team}:{},...e.awakeLimit!==void 0?{awakeLimit:e.awakeLimit}:{},...e.pausedBots?{pausedBots:e.pausedBots}:{},...e.workspaceBanner?{workspaceBanner:e.workspaceBanner}:{}}}function _T(e){return(e.tasks??[]).map(t=>En({approvalMode:t.approvalMode??(t.autoApprove===void 0?e.approvalMode:void 0),autoApprove:t.autoApprove??e.autoApprove}))}function rs(e,t=e.threadId){const n=e.tasks?.find(a=>a.threadId===t);return n?{...e,threadId:t,modelSelection:n.modelSelection??e.modelSelection,approvalMode:n.approvalMode??(n.autoApprove===void 0?e.approvalMode:void 0),autoApprove:n.autoApprove??e.autoApprove,alwaysAllow:n.alwaysAllow??e.alwaysAllow,activity:n.activity??e.activity,busy:n.busy??(n.activity?n.activity==="working"||n.activity==="waiting-on-you":e.busy),unread:n.unread??e.unread,pinnedMessageId:n.pinnedMessageId,turnStartedAt:n.turnStartedAt??null,waitingForTeammates:n.waitingForTeammates??!1}:e}function RT(e){const{acknowledgeLocalAuto:t,updateBotDefault:n,resetApprovalToAsk:a,projectId:r,archivedAt:i,snoozedUntil:o,surface:c,pinned:d,link:u,...p}=e;return{...p,...a?{approvalMode:"ask",autoApprove:!1,alwaysAllow:[]}:{},...r===void 0?{}:{projectId:r??void 0},...i===void 0?{}:{archivedAt:i??void 0},...o===void 0?{}:{snoozedUntil:o??void 0},...c===void 0?{}:{surface:c??void 0,surfaceAuto:void 0},...d===void 0?{}:{pinned:d?!0:void 0},...u===void 0?{}:{link:u??void 0}}}function m1(e,t,n,a,r,i){return n?nT(t,a,r,i):Hm(e.unreadDivider?.threadId===t?e.unreadDivider:null,t,a,!!i)}function _c(e){const t=Object.entries(e.modelVariantSessions),n=t.filter(([a,r])=>{const i=e.bots.find(c=>c.threadId===a||c.tasks?.some(d=>d.threadId===a));if(!i)return!1;const o=rs(i,a).modelSelection;return o.instanceId===r.instanceId&&o.model===r.model});return n.length===t.length?e:{...e,modelVariantSessions:Object.fromEntries(n)}}function Zee(e,t){if(!("botId"in e)||"threadId"in e&&e.threadId||!["send","interrupt","editMessage","switchBranch","answerCard","dismissCard","cancelQueued","steerQueued"].includes(e.type))return e;const n=e.botId,a=t.find(r=>r.id===n)?.threadId;return{...e,threadId:a}}function Hp(e,t){return t?{...e,transcriptGeneration:{...e.transcriptGeneration,[t]:(e.transcriptGeneration[t]??0)+1}}:e}function sn(e,t,n){return{...e,bots:e.bots.map(a=>a.id===t?n(a):a)}}function Qs(e,t,n){return{...e,mascotMotion:{botId:t,nonce:(e.mascotMotion?.nonce??0)+1,kind:n}}}function OT(e,t,n){return e.map(a=>a.id===t&&a.card?{...a,card:{...a.card,...n}}:a)}function Km(e,t,n,a){return sn(e,t,r=>({...r,messages:OT(r.messages,n,a)}))}function f1(e,t,n,a){return{...e,groups:e.groups.map(r=>r.id===t?{...r,messages:OT(r.messages,n,a)}:r)}}function LT(e){return e.messages.find(t=>t.kind==="options"&&t.card&&!t.card.requestId&&!t.card.dismissed)}function ete(e,t){const n=e.bots.find(r=>r.id===t),a=n?LT(n):void 0;return a?Km(e,t,a.id,{dismissed:!0}):e}const pN={type:"toggleAppSettings",open:!0,section:"cloudAccount",cloudLink:!0};function Pa(e,t){if((t.type==="messageAdded"||t.type==="messagePatched"||t.type==="threadActive"||t.type==="optimisticMessageRemoved")&&e.bots.find(a=>(a.threadId!==t.threadId||a.awaitingThreadSnapshot)&&a.tasks?.some(r=>r.threadId===t.threadId))){const a=[...e.backgroundThreadEvents[t.threadId]??[],t].slice(-256),r={...e,backgroundThreadEvents:{...e.backgroundThreadEvents,[t.threadId]:a}};return(t.type==="messageAdded"||t.type==="messagePatched")&&nd(t.message)?Rr(r,t.threadId,t.message.at,!0,t.message.turnCompletedAt??t.message.at):t.type==="messageAdded"?Rr(r,t.threadId,t.message.at):r}if(KQ(t))return{...e,notifications:VQ(e.notifications,t)};switch(t.type){case"hydrate":{const n=d=>t.bots.some(u=>u.id===d)||t.groups.some(u=>u.id===d),a=t.resumeId,r=a&&(t.bots.some(d=>d.id===a&&!d.hidden)||t.groups.some(d=>d.id===a))?a:"",i=e.selectedId&&n(e.selectedId)?e.selectedId:r||(t.bots[0]?.id??""),o={...e,bots:t.bots.map(d=>{const u=d.messages?d:{...d,messages:[]},p=e.bots.find(m=>m.id===u.id);return wX(p,p?{...u,tasks:qm(p.tasks,u.tasks)}:u,t.preserveNavigation===!0&&B4(p,t.navigationSince,e.transcriptGeneration),t.taskIdsAtStart)}),groups:t.groups.map(d=>{const u=e.groups.find(m=>m.id===d.id),p=u?{...d,tasks:qm(u.tasks,d.tasks)}:d;return p.description===null&&(p.description=void 0),jX(u,p,t.preserveNavigation===!0&&B4(u,t.navigationSince,e.transcriptGeneration),t.taskIdsAtStart)}),sections:t.sections??[],computerControl:t.computerControl,selectedId:i,hydrated:!0,backgroundThreadEvents:{},loadingOlder:{},transcriptGeneration:{},modelVariantSessions:{}},c=[...o.bots,...o.groups].find(d=>d.threadId===e.unreadDivider?.threadId);return c&&(o.unreadDivider=Hm(e.unreadDivider,c.threadId,zs(c),!!c.hasMore)),qp(t.botQueuedMessages?uN(o,t.botQueuedMessages):o,[...t.bots,...t.groups])}case"loadOlderMessages":return e.loadingOlder[t.threadId]?e:{...e,loadingOlder:{...e.loadingOlder,[t.threadId]:!0}};case"olderMessages":{const{[t.threadId]:n,...a}=e.loadingOlder;if((e.transcriptGeneration[t.threadId]??0)!==t.generation)return{...e,loadingOlder:a};const r=u=>{const p=new Set(u.messages.map(m=>m.id));return{...u,messages:[...t.messages.filter(m=>!p.has(m.id)),...u.messages],hasMore:t.hasMore}},i=e.bots.map(u=>u.threadId===t.threadId?r(u):u),o=e.groups.map(u=>u.threadId===t.threadId?r(u):u),c=[...i,...o].find(u=>u.threadId===t.threadId),d=Hm(e.unreadDivider,t.threadId,c?zs(c):[],t.hasMore);return{...e,loadingOlder:a,bots:i,groups:o,unreadDivider:d}}case"sectionDeleted":return{...e,sections:t.sections,bots:e.bots.map(n=>n.section===t.section?{...n,section:void 0}:n),groups:e.groups.map(n=>n.section===t.section?{...n,section:void 0}:n)};case"sections":return{...e,sections:t.sections};case"botsOrdered":{const n=A0(e.bots,t.botIds);return n?{...e,bots:n}:e}case"groupsOrdered":{const n=A0(e.groups,t.groupIds);return n?{...e,groups:n}:e}case"botQueues":return qp(uN(e,t.queues),[...e.bots,...e.groups]);case"showRoutines":return{...e,activeView:"routines",routinesFocus:{section:t.section,view:t.view,botId:t.botId,routineId:t.routineId,runStatus:t.runStatus,nonce:e.routinesFocus.nonce+1},settingsOpen:!1,computerOpen:!1,inspectorOpen:!1,activityOpen:!1,notificationsOpen:!1,appSettingsOpen:!1,pluginsOpen:!1};case"showChat":return e.activeView==="chat"?e:{...e,activeView:"chat"};case"showTeamMap":case"showFiles":case"showWebPanel":return{...e,activeView:t.type==="showFiles"?"files":t.type==="showWebPanel"?"web-panel":"team-map",filesSuggest:t.type==="showFiles"&&t.suggest?.length?t.suggest:null,webPanelId:t.type==="showWebPanel"?t.id:e.webPanelId,settingsOpen:!1,computerOpen:!1,inspectorOpen:!1,activityOpen:!1,appSettingsOpen:!1,pluginsOpen:!1};case"routinesHydrated":return{...e,routines:t.routines,routineRuns:Q0(t.runs),routineRunsSince:t.since??null,routinesLoadState:"ready"};case"routinesLoadFailed":return{...e,routinesLoadState:"error"};case"routinePatched":{const n=e.routines.find(a=>a.id===t.routine.id);return n&&n.updatedAt>t.routine.updatedAt?e:{...e,routines:n?e.routines.map(a=>a.id===t.routine.id?t.routine:a):[t.routine,...e.routines]}}case"routineDeleted":return{...e,routines:e.routines.filter(n=>n.id!==t.routineId)};case"routineRunPatched":{const a=e.routineRuns.some(r=>r.id===t.run.id)?e.routineRuns.map(r=>r.id===t.run.id?t.run:r):[t.run,...e.routineRuns];return{...e,routineRuns:Q0(a)}}case"routineRunsLoaded":return{...e,routineRuns:Yee(e.routineRuns,t.runs),routineRunsSince:Jee(e.routineRunsSince,t)};case"webhooksHydrated":return{...e,webhooks:t.webhooks,webhookAttempts:t.attempts,webhookIngress:t.ingress};case"webhookPatched":{const n=e.webhooks.some(a=>a.id===t.webhook.id);return{...e,webhooks:n?e.webhooks.map(a=>a.id===t.webhook.id?t.webhook:a):[t.webhook,...e.webhooks]}}case"webhookDeleted":return{...e,webhooks:e.webhooks.filter(n=>n.id!==t.webhookId),webhookAttempts:e.webhookAttempts.filter(n=>n.webhookId!==t.webhookId)};case"webhookAttempted":{const n=e.webhookAttempts.some(a=>a.id===t.attempt.id)?e.webhookAttempts.map(a=>a.id===t.attempt.id?t.attempt:a):[...e.webhookAttempts,t.attempt];return{...e,webhookAttempts:n.slice(-2e3)}}case"groupPatched":{const n=t.group.messages?Hp(e,t.group.threadId):e,a=bX(e.groups,t.group),r=t.group.messages&&a.find(i=>i.id===t.group.id&&i.threadId===e.unreadDivider?.threadId);return{...n,groups:a,...r?{unreadDivider:Hm(e.unreadDivider,r.threadId,zs(r),!!r.hasMore)}:{}}}case"groupSnapshot":{const n=yX(e,t);return n?Pa(e,{type:"groupPatched",group:n}):e}case"groupDeleted":{const n=e.groups.filter(r=>r.id!==t.groupId),a=e.selectedId===t.groupId?e.bots[0]?.id??"":e.selectedId;return{...e,groups:n,selectedId:a}}case"instances":return{...e,instances:t.instances};case"configStatus":return{...e,config:t.config};case"liveCall":return{...e,liveCall:t.call,liveCallVersion:e.liveCallVersion+1};case"liveCallLookup":return t.since===e.liveCallVersion&&t.seq>e.liveCallLookupSeq?{...e,liveCall:t.call,liveCallLookupSeq:t.seq}:e;case"profileSaved":return e.config?{...e,config:{...e.config,profile:{name:"",email:"",...e.config.profile,...t.profile}}}:e;case"select":{const n=e.groups.find(r=>r.id===t.id);if(n)return{...t.id===e.selectedId&&e.activeView==="chat"?e:al(e),unreadDivider:m1(e,n.threadId,n.unread,n.messages,n.lastReadMessageId,n.hasMore),activeView:"chat",selectedId:t.id,groups:e.groups.map(r=>r.id===t.id?{...r,unread:!1}:r)};const a=e.bots.find(r=>r.id===t.id);return sn(Qs({...t.id===e.selectedId&&e.activeView==="chat"?e:al(e),unreadDivider:a?m1(e,a.threadId,Y4(a),zs(a),G4(a),a.hasMore):e.unreadDivider,activeView:"chat",selectedId:t.id},t.id,"switch"),t.id,r=>({...r,unread:!!r.tasks?.some(i=>i.threadId!==r.threadId&&i.unread),tasks:r.tasks?.map(i=>i.threadId===r.threadId?{...i,unread:!1}:i)}))}case"answerCard":{if(t.groupId){const r=e.groups.find(i=>i.id===t.groupId)?.messages.find(i=>i.id===t.messageId)?.card;return f1(e,t.groupId,t.messageId,{answered:t.answer,...r?.requestId?{pendingAnswer:t.answer}:{}})}const a=e.bots.find(r=>r.id===t.botId)?.messages.find(r=>r.id===t.messageId)?.card;return Qs(Km(e,t.botId,t.messageId,{answered:t.answer,...a?.requestId?{pendingAnswer:t.answer}:{dismissed:!0}}),t.botId,"working")}case"answerCardFailed":{if((t.groupId?e.groups.find(i=>i.id===t.groupId):e.bots.find(i=>i.id===t.botId))?.messages.find(i=>i.id===t.messageId)?.card?.pendingAnswer!==t.answer)return e;const r={answered:void 0,pendingAnswer:void 0};return t.groupId?f1(e,t.groupId,t.messageId,r):Km(e,t.botId,t.messageId,r)}case"dismissCard":return t.groupId?f1(e,t.groupId,t.messageId,{dismissed:!0}):Km(e,t.botId,t.messageId,{dismissed:!0});case"decideRequest":return e;case"botAdded":return Qs({...t.preserveSelection||t.bot.id===e.selectedId?e:al(e),bots:[t.bot.messages?t.bot:{...t.bot,messages:[]},...e.bots.filter(n=>n.id!==t.bot.id)],...t.preserveSelection?{}:{activeView:"chat",selectedId:t.bot.id}},t.bot.id,"arrive");case"deleteBot":{const n=e.bots.filter(o=>o.id!==t.botId),a=e.selectedId===t.botId?n.find(o=>!o.hidden)?.id??n[0]?.id??"":e.selectedId,{[t.botId]:r,...i}=e.deletingBots;return _c({...e,bots:n,selectedId:a,deletingBots:i})}case"botDeletionPending":{if(t.on)return e.deletingBots[t.botId]?e:{...e,deletingBots:{...e.deletingBots,[t.botId]:!0}};if(!e.deletingBots[t.botId])return e;const{[t.botId]:n,...a}=e.deletingBots;return{...e,deletingBots:a}}case"markUnread":return sn(Qs(e,t.botId,"surprise"),t.botId,n=>({...n,unread:!0}));case"botPatched":{const n=e.bots.find(p=>p.id===t.bot.id);if(!n){const p={...e,bots:[{...t.bot,messages:t.bot.messages??[]},...e.bots]};return qp(p,[t.bot])}const a=t.bot.unread&&!n?.unread?"surprise":t.bot.busy===!0&&!n?.busy?"working":t.bot.busy===!1&&n?.busy?"celebrate":null,r=a?Qs(e,t.bot.id,a):e,i=t.bot.busy===!1&&n?.busy&&r.computerStarts[t.bot.id]?Pa(r,{type:"computerStart",botId:t.bot.id,start:null}):r,o=t.bot.chiefOfStaff?{...i,bots:R4(i.bots,t.bot)}:i,c=typeof t.bot.threadId=="string"&&t.bot.threadId!==n.threadId&&!t.bot.tasks?.some(p=>p.threadId===n.threadId);let d=o;if(c){const{[t.bot.threadId]:p,...m}=o.backgroundThreadEvents;d={...o,backgroundThreadEvents:m}}if((c||n.awaitingThreadSnapshot&&t.bot.threadId===n.threadId)&&Array.isArray(t.bot.messages))return Pa(d,{type:"taskSwitched",bot:{...n,...t.bot,computer:t.bot.computer,section:t.bot.section,toolScope:t.bot.toolScope,managedSections:t.bot.managedSections,messages:t.bot.messages,browserProfile:t.bot.browserProfile,vpsAlias:t.bot.vpsAlias,phoneApps:t.bot.phoneApps,onlyPeopleAdded:t.bot.onlyPeopleAdded}});const u=sn(d,t.bot.id,p=>({...p,...t.bot,threadId:c?t.bot.threadId:p.threadId,activeLeafId:c?null:p.activeLeafId,awaitingThreadSnapshot:c||p.awaitingThreadSnapshot,browserProfile:t.bot.browserProfile,computer:t.bot.computer,toolScope:t.bot.toolScope,section:t.bot.section,managedSections:t.bot.managedSections,vpsAlias:t.bot.vpsAlias,phoneApps:t.bot.phoneApps,onlyPeopleAdded:t.bot.onlyPeopleAdded,tasks:t.bot.tasks?qm(p.tasks,t.bot.tasks):p.tasks,messages:c?[]:p.messages,hasMore:c?void 0:p.hasMore}));return _c(u)}case"messageAdded":{const n=e.bots.find(u=>u.threadId===t.threadId);if(!n){const u=e.groups.find(h=>h.threadId===t.threadId||h.tasks?.some(x=>x.threadId===t.threadId));if(!u||u.threadId===t.threadId&&u.messages.some(h=>h.id===t.message.id))return e;const p=Rr(e,t.threadId,t.message.at,nd(t.message),t.message.turnCompletedAt??t.message.at);if(u.threadId!==t.threadId)return p;const m=t.message.sendId?u.messages.findIndex(h=>h.id===wl(t.message.sendId)):-1;return{...p,groups:p.groups.map(h=>h.id===u.id?{...h,messages:m>=0?h.messages.map((x,g)=>g===m?t.message:x):[...h.messages,t.message]}:h)}}if(n.messages.some(u=>u.id===t.message.id))return e;const a=Rr(e,t.threadId,t.message.at,nd(t.message),t.message.turnCompletedAt??t.message.at),r=t.message.sendId?wl(t.message.sendId):null,i=r?n.messages.findIndex(u=>u.id===r):-1;if(i>=0)return sn(a,n.id,u=>({...u,messages:u.messages.map((p,m)=>m===i?t.message:p),activeLeafId:u.activeLeafId===r?t.message.id:u.activeLeafId}));const o=sn(a,n.id,u=>{const p=(t.message.parentId??null)===(u.activeLeafId??null);return{...u,messages:[...u.messages,t.message],activeLeafId:p?t.message.id:u.activeLeafId}}),c=t.message.role==="user"&&t.message.kind==="text"&&t.message.queueId?"working":t.message.kind==="options"?"thinking":t.message.kind==="activity"?t.message.tool?.ok===!1?"failure":t.message.tool?.ok===!0?"success":"working":t.message.role==="bot"&&t.message.kind==="text"?"blink":null;return c?Qs(o,n.id,c):o}case"optimisticMessageRemoved":{const n=wl(t.sendId),a=(p,m)=>p.filter(h=>h.id!==n).map(h=>h.optimisticThreadOrderAt===m.at?{...h,optimisticThreadOrderAt:m.optimisticThreadOrderAt}:h),r=e.bots.find(p=>p.threadId===t.threadId);if(r){const p=r.messages.find(g=>g.id===n);if(!p)return e;const m=sn(e,r.id,g=>({...g,messages:a(g.messages,p),activeLeafId:g.activeLeafId===n?t.restoreLeafId!==void 0?t.restoreLeafId:p.parentId??null:g.activeLeafId})),h=r.tasks?.find(g=>g.threadId===t.threadId),x=m.bots.find(g=>g.id===r.id)?.messages??[];return L4(m,t.threadId,x,h?.createdAt??0,r.hasMore?p.optimisticThreadOrderAt:void 0)}const i=e.groups.find(p=>p.threadId===t.threadId),o=i?.messages.find(p=>p.id===n);if(!i||!o)return e;const c={...e,groups:e.groups.map(p=>p.id===i.id?{...p,messages:a(p.messages,o)}:p)},d=i.tasks?.find(p=>p.threadId===t.threadId),u=c.groups.find(p=>p.id===i.id)?.messages??[];return L4(c,t.threadId,u,d?.createdAt??i.createdAt,i.hasMore?o.optimisticThreadOrderAt:void 0)}case"messagePatched":{const n=nd(t.message)?Rr(e,t.threadId,t.message.at,!0,t.message.turnCompletedAt??t.message.at):e,a=n.bots.find(o=>o.threadId===t.threadId);if(!a){const o=n.groups.find(c=>c.threadId===t.threadId);return o?{...n,groups:n.groups.map(c=>c.id===o.id?{...c,messages:c.messages.map(d=>d.id===t.message.id?t.message:d)}:c)}:n}const r=t.message.kind==="activity"?t.message.tool?.ok===!1?"failure":t.message.tool?.ok===!0?"success":"working":null,i=r?Qs(n,a.id,r):n;return sn(i,a.id,o=>({...o,messages:o.messages.map(c=>c.id===t.message.id?t.message:c)}))}case"computerStart":{const{[t.botId]:n,...a}=e.computerStarts;return{...t.start?Qs(e,t.botId,"launch"):e,computerStarts:t.start?{...a,[t.botId]:t.start}:a}}case"computerControl":return{...e,computerControl:{...e.computerControl,[t.botId]:{held:t.held,helpReason:t.helpReason,help:t.help??null}}};case"modelVariantRuntime":{const n=t.event;if(!n.turnId)return e;const a=e.bots.find(o=>o.threadId===n.threadId||o.tasks?.some(c=>c.threadId===n.threadId));if(!a)return e;const r=rs(a,n.threadId).modelSelection;if(r.instanceId!==n.providerInstanceId||!e.instances.find(o=>o.instanceId===r.instanceId)?.capabilities?.modelVariants)return e;const i=e.modelVariantSessions[n.threadId];return n.type==="turn.started"?i&&(i.turnId===n.turnId||Date.parse(i.startedAt)>Date.parse(n.createdAt))?e:{...e,modelVariantSessions:{...e.modelVariantSessions,[n.threadId]:{instanceId:r.instanceId,model:r.model,turnId:n.turnId,startedAt:n.createdAt,acceptingUpdates:!0}}}:!i?.acceptingUpdates||i.turnId!==n.turnId||i.instanceId!==r.instanceId||i.model!==r.model?e:n.type==="session.model-variants"&&n.model===r.model?{...e,modelVariantSessions:{...e.modelVariantSessions,[n.threadId]:{...i,variants:n.variants}}}:n.type==="turn.completed"?{...e,modelVariantSessions:{...e.modelVariantSessions,[n.threadId]:{...i,acceptingUpdates:!1}}}:e}case"setModel":if(t.threadId){const n=Pa(e,{type:"updateTask",botId:t.botId,threadId:t.threadId,patch:{modelSelection:t.selection,resetApprovalToAsk:t.resetApprovalToAsk}});return sn(n,t.botId,a=>({...a,tasks:a.tasks?.map(r=>r.threadId!==t.threadId?r:{...r,followsBotModel:!!t.updateBotDefault||HA(t.selection,a.modelSelection)})}))}return _c(sn(e,t.botId,n=>({...n,modelSelection:t.selection})));case"updateTask":{const n=RT(t.patch);return _c(sn(e,t.botId,a=>({...a,tasks:(a.tasks??[{threadId:a.threadId,title:"New thread",createdAt:Date.now()}]).map(r=>r.threadId===t.threadId?{...r,...n}:r)})))}case"connected":return{...e,connected:t.value};case"error":return{...t.message&&e.selectedId?Qs(e,e.selectedId,"alert"):e,error:t.message};case"toggleSettings":{if(t.botId!==void 0&&!e.bots.some(o=>o.id===t.botId&&!o.hidden))return e;const n=t.botId??e.selectedId,a=t.open??(t.botId!==void 0||!e.settingsOpen),r=a&&!e.settingsOpen,i=t.section!==void 0;return{...e,selectedId:n,settingsOpen:a,activityOpen:a?!1:e.activityOpen,botSettingsSection:t.section??e.botSettingsSection,botSettingsExpandAccordion:a?i||r&&e.botSettingsSectionStored:!1,botSettingsExpandRemembered:a?!i&&r&&e.botSettingsSectionStored:!1,botSettingsSectionStored:i||e.botSettingsSectionStored,appSettingsOpen:a?!1:e.appSettingsOpen}}case"togglePlugins":{const n=t.open??!e.pluginsOpen;return{...e,pluginsOpen:n,pluginsSurface:t.surface??e.pluginsSurface,...n?{settingsOpen:!1,appSettingsOpen:!1,shortcutsOpen:!1}:{}}}case"botCreationPending":return{...e,botCreationPending:t.on};case"notice":return{...e,notice:t.notice};case"revealThread":return{...e,appSettingsOpen:!1,shortcutsOpen:!1,pluginsOpen:!1,revealThread:{threadId:t.threadId,nonce:(e.revealThread?.nonce??0)+1}};case"focusMessage":return{...e,focusMessage:{threadId:t.threadId,messageId:t.messageId,matchText:t.matchText,nonce:(e.focusMessage?.nonce??0)+1,consumed:!1}};case"focusMessageConsumed":return!e.focusMessage||e.focusMessage.nonce!==t.nonce?e:{...e,focusMessage:{...e.focusMessage,consumed:!0}};case"unreadDividerDone":return e.unreadDivider?.threadId===t.threadId?{...e,unreadDivider:null}:e;case"openDataResult":return e.bots.some(a=>a.id===t.botId)?{...Pa(Pa(e,{type:"select",id:t.botId}),{type:"toggleComputer",open:!0}),dataResultFocus:{botId:t.botId,id:t.cardId,requestId:(e.dataResultFocus?.requestId??0)+1,consumed:!1}}:e;case"dataResultFocusConsumed":return e.dataResultFocus?.requestId===t.requestId?{...e,dataResultFocus:{...e.dataResultFocus,consumed:!0}}:e;case"openSignIn":{if(!e.bots.some(i=>i.id===t.botId))return e;const n=Pa(Pa(e,{type:"select",id:t.botId}),{type:"toggleComputer",open:!0}),{type:a,...r}=t;return{...n,signInFocus:{...r,requestId:(e.signInFocus?.requestId??0)+1,consumed:!1}}}case"signInFocusConsumed":return e.signInFocus?.requestId===t.requestId?{...e,signInFocus:{...e.signInFocus,consumed:!0}}:e;case"toggleComputer":{const n=t.open??!e.computerOpen;return{...e,selectedId:t.botId!==void 0&&e.bots.some(a=>a.id===t.botId)?t.botId:e.selectedId,computerOpen:n,settingsOpen:n?!1:e.settingsOpen,inspectorOpen:n?!1:e.inspectorOpen,activityOpen:n?!1:e.activityOpen,appSettingsOpen:n?!1:e.appSettingsOpen,notificationsOpen:n&&!e.notificationsPinned?!1:e.notificationsOpen}}case"toggleInspector":{const n=t.open??!e.inspectorOpen;return{...e,inspectorOpen:n,settingsOpen:n?!1:e.settingsOpen,computerOpen:n?!1:e.computerOpen,activityOpen:n?!1:e.activityOpen,appSettingsOpen:n?!1:e.appSettingsOpen,notificationsOpen:n&&!e.notificationsPinned?!1:e.notificationsOpen}}case"toggleActivity":{const n=t.open??!e.activityOpen;return{...e,activityOpen:n,settingsOpen:n?!1:e.settingsOpen,computerOpen:n?!1:e.computerOpen,inspectorOpen:n?!1:e.inspectorOpen,appSettingsOpen:n?!1:e.appSettingsOpen,notificationsOpen:n&&!e.notificationsPinned?!1:e.notificationsOpen}}case"toggleNotifications":{const n=t.open??!e.notificationsOpen;return{...e,notificationsOpen:n,settingsOpen:n?!1:e.settingsOpen,computerOpen:n?!1:e.computerOpen,inspectorOpen:n?!1:e.inspectorOpen,activityOpen:n?!1:e.activityOpen,appSettingsOpen:n?!1:e.appSettingsOpen}}case"toggleNotificationsPinned":return{...e,notificationsPinned:t.pinned??!e.notificationsPinned};case"toggleAppSettings":{const n=t.open??!e.appSettingsOpen;return{...e,appSettingsOpen:n,activityOpen:n?!1:e.activityOpen,appSettingsSection:t.section??e.appSettingsSection,appSettingsCloudLink:t.cloudLink&&n?e.appSettingsCloudLink+1:0,appSettingsPhonePairing:t.phonePairing&&n?e.appSettingsPhonePairing+1:0,settingsOpen:n?!1:e.settingsOpen,computerOpen:n?!1:e.computerOpen,inspectorOpen:n?!1:e.inspectorOpen,pluginsOpen:n?!1:e.pluginsOpen,notificationsOpen:n&&!e.notificationsPinned?!1:e.notificationsOpen}}case"toggleShortcuts":{const n=t.open??!e.shortcutsOpen;return{...e,shortcutsOpen:n}}case"openCloudAdd":return e.cloudHowTo?{...e,cloudHowTo:!1}:e;case"closeCloudAdd":return e.cloudAdd?{...e,cloudAdd:null}:e;case"cloudHowTo":return e.cloudHowTo===t.open?e:{...e,cloudHowTo:t.open};case"toggleTour":{const n=t.open??!e.tourOpen;return{...e,tourOpen:n,appSettingsOpen:n?!1:e.appSettingsOpen}}case"toggleWelcome":{const n=t.open??!e.welcomeOpen;return{...e,welcomeOpen:n,appSettingsOpen:n?!1:e.appSettingsOpen,shortcutsOpen:n?!1:e.shortcutsOpen}}case"updateBot":{const a=Object.prototype.hasOwnProperty.call(t.patch,"color")||Object.prototype.hasOwnProperty.call(t.patch,"mascotExpression")?Qs(e,t.botId,"customize"):e,r=a.bots.find(b=>b.id===t.botId),i=t.patch.chiefOfStaff?{...a,bots:R4(a.bots,{...r,...t.patch,id:t.botId})}:a,{acknowledgeLocalAuto:o,applyToAllThreads:c,keepThreadModels:d,threadId:u,mainThreadChoice:p,computer:m,connectorTools:h,connectorScopes:x,phoneApps:g,cwd:v,...y}=t.patch,w={...y,...v!==void 0&&{cwd:v??void 0},...g!==void 0&&{phoneApps:g??void 0},...typeof p=="string"&&{mainThreadId:p}};return m===null?w.computer=void 0:m!==void 0&&(w.computer=m),h===null?w.connectorTools=void 0:h!==void 0&&(w.connectorTools=h),x===null?w.connectorScopes=void 0:x!==void 0&&(w.connectorScopes=x),sn(i,t.botId,b=>({...b,...w}))}case"threadActive":{const n=e.bots.find(a=>a.threadId===t.threadId);return n?sn(Hp(e,t.threadId),n.id,a=>({...a,activeLeafId:t.activeLeafId})):e}case"switchBranch":{const n=e.bots.find(r=>r.id===t.botId);if(!n)return e;let a=t.messageId;for(;;){const r=n.messages.filter(i=>i.parentId===a);if(!r.length)break;a=r.reduce((i,o)=>o.at>=i.at?o:i).id}return sn(Hp(e,n.threadId),t.botId,r=>({...r,activeLeafId:a}))}case"patchGroup":return{...e,groups:e.groups.map(n=>n.id===t.groupId?{...n,...t.patch}:n)};case"pendingQueued":{if(e.consumedQueueIds[t.queueId]){const a={...e.consumedQueueIds};return delete a[t.queueId],{...e,consumedQueueIds:a}}const n=e.pendingQueued[t.threadId]??[];return n.some(a=>a.queueId===t.queueId)?e:{...e,pendingQueued:{...e.pendingQueued,[t.threadId]:[...n,{queueId:t.queueId,text:t.text,...t.reason?{reason:t.reason}:{}}]}}}case"consumePendingQueued":{const n=e.pendingQueued[t.threadId]??[],a=n.findIndex(o=>o.queueId===t.queueId);if(a<0)return{...e,consumedQueueIds:jl(e.consumedQueueIds,t.queueId)};const r=n.filter((o,c)=>c!==a),i={...e.pendingQueued};return r.length?i[t.threadId]=r:delete i[t.threadId],{...e,pendingQueued:i,consumedQueueIds:jl(e.consumedQueueIds,t.queueId)}}case"cancelQueued":{const n=e.bots.find(c=>c.id===t.botId);if(!n)return e;const a=t.threadId??n.threadId,i=(e.pendingQueued[a]??[]).filter(c=>c.queueId!==t.queueId),o={...e.pendingQueued};return i.length?o[a]=i:delete o[a],{...e,pendingQueued:o,consumedQueueIds:jl(e.consumedQueueIds,t.queueId)}}case"steerQueued":return e;case"cancelGroupQueued":{const n=e.pendingQueued[t.threadId]??[],a=n.filter(i=>i.queueId!==t.queueId);if(a.length===n.length)return e;const r={...e.pendingQueued};return a.length?r[t.threadId]=a:delete r[t.threadId],{...e,pendingQueued:r}}case"send":{const n=Qs(ete(e,t.botId),t.botId,"working");if(!t.sendId)return n;const a=n.bots.find(o=>o.id===t.botId),r=t.threadId??a?.threadId;if(!a||r!==a.threadId||a.messages.some(o=>o.sendId===t.sendId))return n;const i=r1(t.text,t.sendId,t.replyToId,a.activeLeafId);return i.optimisticThreadOrderAt=a.tasks?.find(o=>o.threadId===r)?.lastThreadOrderAt,Rr(sn(n,a.id,o=>({...o,messages:[...o.messages,i],activeLeafId:i.id})),r,i.at,!0)}case"editMessage":{const n=Qs(e,t.botId,"working");if(!t.sendId)return n;const a=n.bots.find(c=>c.id===t.botId),r=t.threadId??a?.threadId;if(!a||r!==a.threadId||a.messages.some(c=>c.sendId===t.sendId))return n;const i=a.messages.find(c=>c.id===t.messageId);if(!i||i.role!=="user"||i.kind!=="text")return n;const o=r1(t.text.trim(),t.sendId,i.replyToId,i.parentId??null);return o.optimisticThreadOrderAt=a.tasks?.find(c=>c.threadId===r)?.lastThreadOrderAt,Rr(sn(n,a.id,c=>({...c,messages:[...c.messages,o],activeLeafId:o.id})),r,o.at,!0)}case"switchGroupTask":return e.selectedId===t.groupId&&e.activeView==="chat"?D4(e,t.groupId,t.threadId):e;case"newGroupTask":return e.selectedId===t.groupId&&e.activeView==="chat"?al(e):e;case"deleteTask":case"deleteGroupTask":case"regenerateTaskTitle":return e;case"newTask":return t.cwd!==void 0?e:{...al(e),selectedId:t.botId,activeView:"chat"};case"switchTask":{const{[t.threadId]:n,...a}=e.backgroundThreadEvents;return sn({...D4(e,t.botId,t.threadId),backgroundThreadEvents:a,selectedId:t.botId,activeView:"chat",revealThread:{threadId:t.threadId,nonce:(e.revealThread?.nonce??0)+1}},t.botId,r=>({...r,switchingTo:t.threadId}))}case"switchTaskFailed":return sn(e,t.botId,n=>n.switchingTo===t.threadId?{...n,switchingTo:void 0}:n);case"renameTask":return sn(e,t.botId,n=>({...n,tasks:(n.tasks??[]).map(a=>a.threadId===t.threadId?{...a,title:t.title}:a)}));case"renameGroupTask":return Pp(e,t.groupId,t.threadId,{title:t.title});case"pinGroupTask":return Pp(e,t.groupId,t.threadId,{pinned:t.pinned?!0:void 0});case"archiveGroupTask":return Pp(e,t.groupId,t.threadId,{archivedAt:t.archivedAt??void 0});case"setConversationTurnLimit":return t.dm?{...e,groups:e.groups.map(n=>n.id===t.groupId?{...n,turnTimeoutMinutes:t.minutes??void 0}:n)}:Pp(e,t.groupId,t.threadId,{turnTimeoutMinutes:t.minutes??void 0});case"taskSwitched":{let n=sn(Hp(e,t.bot.threadId),t.bot.id,o=>({...o,...t.bot,computer:t.bot.computer,toolScope:t.bot.toolScope,managedSections:t.bot.managedSections,vpsAlias:t.bot.vpsAlias,messages:t.bot.messages??[],hasMore:t.bot.hasMore,awaitingThreadSnapshot:!1,switchingTo:void 0}));for(const o of e.backgroundThreadEvents[t.bot.threadId]??[])n=Pa(n,o);const{[t.bot.threadId]:a,...r}=n.backgroundThreadEvents;n={...n,backgroundThreadEvents:r};const i=n.bots.find(o=>o.id===t.bot.id);return i&&i.id===n.selectedId&&(n={...n,unreadDivider:m1(n,i.threadId,Y4(i),zs(i),G4(i),i.hasMore)},n.activeView==="chat"&&(n=sn(n,i.id,o=>({...o,unread:!!o.tasks?.some(c=>c.threadId!==o.threadId&&c.unread),tasks:o.tasks?.map(c=>c.threadId===o.threadId?{...c,unread:!1}:c)})))),_c(qp(n,[t.bot]))}case"newBot":return t.preserveSelection?e:{...e,settingsOpen:!1,appSettingsOpen:!1,pluginsOpen:!1,shortcutsOpen:!1};case"duplicateBot":case"createProject":case"updateProject":case"deleteProject":case"reorderProjects":case"interrupt":case"createGroup":case"deleteGroup":case"interruptGroup":case"setGroupHold":case"steerGroupQueued":case"createRoutine":case"updateRoutine":case"deleteRoutine":case"runRoutine":case"cancelRoutineRun":case"markRoutineRunSeen":case"markAllRoutineRunsSeen":case"refreshTaskPermissions":case"followBotModel":case"loadDataSheet":return e;case"dataSheet":return{...e,dataSheets:{...e.dataSheets,[t.sheet.botId]:t.sheet},...t.tables?{dataTables:{...e.dataTables,[t.sheet.botId]:t.tables}}:{}};case"dataView":return{...e,dataView:t.view};case"sendGroup":{if(!t.sendId)return e;const n=e.groups.find(o=>o.id===t.groupId);if(!n)return e;const a=t.threadId??n.threadId;if(a===n.threadId&&n.messages.some(o=>o.sendId===t.sendId))return e;const r=r1(t.text,t.sendId,t.replyToId,null,t.mode??"chat");r.optimisticThreadOrderAt=n.tasks?.find(o=>o.threadId===a)?.lastThreadOrderAt;const i=Rr(e,a,r.at,a===n.threadId);return a!==n.threadId?i:{...i,groups:i.groups.map(o=>o.id===n.id?{...o,messages:[...o.messages,r]}:o)}}}}function tte(e){const t=e&&typeof e=="object"&&"tables"in e?e.tables:void 0;return Array.isArray(t)?t.filter(n=>n&&typeof n.name=="string"):[]}function nte(e,t){const n=e&&typeof e=="object"&&"sheet"in e?e.sheet:e;if(n&&typeof n=="object"&&Array.isArray(n.cards)){const a=n;return{...a,botId:a.botId||t,sources:Array.isArray(a.sources)?a.sources:[]}}return{version:1,botId:t,cards:[],sources:[],updatedAt:new Date(0).toISOString()}}const ste={modelVariantSessions:{},backgroundThreadEvents:{},loadingOlder:{},transcriptGeneration:{},bots:[],groups:[],sections:[],instances:[],config:null,liveCall:null,liveCallVersion:0,liveCallLookupSeq:0,selectedId:"",activeView:"chat",routines:[],routineRuns:[],routineRunsSince:null,routinesLoadState:"loading",routinesFocus:{nonce:0},filesSuggest:null,webhooks:[],webhookAttempts:[],webhookIngress:null,settingsOpen:!1,pluginsOpen:!1,pluginsSurface:"apps",botCreationPending:!1,computerOpen:!1,inspectorOpen:!1,activityOpen:!1,notificationsOpen:!1,notificationsPinned:!1,notifications:[],appSettingsOpen:!1,appSettingsSection:"general",appSettingsCloudLink:0,appSettingsPhonePairing:0,shortcutsOpen:!1,cloudAdd:null,cloudHowTo:!1,welcomeOpen:!1,tourOpen:!1,botSettingsSection:"overview",botSettingsExpandAccordion:!1,botSettingsSectionStored:!1,botSettingsExpandRemembered:!1,computerStarts:{},deletingBots:{},computerControl:{},dataSheets:{},dataTables:{},dataResultFocus:null,signInFocus:null,dataView:null,focusMessage:null,unreadDivider:null,connected:!1,error:null,notice:null,revealThread:null,mascotMotion:null,pendingQueued:{},consumedQueueIds:{}},dd=200,mN=80;function Nd(){if(!(typeof window>"u"||!window.ogb?.approvals))return mx().host.packaged?window.ogb.approvals:void 0}async function ate(e,t,n,a,r=K){const{approvalMode:i,autoApprove:o,acknowledgeLocalAuto:c,...d}=n,u=i??(o===void 0?void 0:o?"auto":"ask");if(u==="custom"&&!a)throw new Error(l("approvalMode.needsDesktopApp"));return u&&a?(Object.keys(d).length&&await r(`/api/bots/${e}/tasks/${t}`,{method:"PATCH",body:JSON.stringify(d)}),a.setMode(e,u,{threadId:t,threadOnly:!0,acknowledgeLocalAuto:c===!0})):(await r(`/api/bots/${e}/tasks/${t}`,{method:"PATCH",body:JSON.stringify({...d,approvalMode:i,autoApprove:o,acknowledgeLocalAuto:c})})).bot}async function zT(e,t,n,a=K,r=Nd(),i,o=!1){const{approvalMode:c,applyToAllThreads:d,...u}=t,p=c!==void 0&&c!=="custom"&&(En(i??{})==="custom"||d===!0&&_T(i??{}).includes("custom"));if(!(c==="custom"||p||c==="full"&&r!==void 0)){const v=JSON.stringify(c===void 0?u:{...u,approvalMode:c,...d?{applyToAllThreads:!0}:{}});return(await a(`/api/bots/${e}`,{method:"PATCH",body:v,signal:n,keepalive:o&&jee(v)})).bot}if(!r||c===void 0)throw new Error(l("approvalMode.levelNeedsDesktopApp"));const h={acknowledgeLocalAuto:u.acknowledgeLocalAuto===!0,...d?{allThreads:!0}:{}},x=async()=>{if(n.aborted){if(c==="full"||c==="custom")try{await r.setMode(e,"ask",{acknowledgeLocalAuto:!1,...d?{allThreads:!0}:{}})}catch(v){throw new Error(l("approvalMode.revokeFailed",{mode:l(c==="full"?"approvalMode.full.label":"approvalMode.custom.name"),error:v instanceof Error?v.message:String(v)}))}throw new DOMException("The bot update was cancelled","AbortError")}};if(p){const v=await r.setMode(e,c,h);return await x(),Object.keys(u).length===0?v:(await a(`/api/bots/${e}`,{method:"PATCH",body:JSON.stringify(u),signal:n})).bot}if(Object.keys(u).length>0&&await a(`/api/bots/${e}`,{method:"PATCH",body:JSON.stringify(u),signal:n}),n.aborted)throw new DOMException("The bot update was cancelled","AbortError");const g=await r.setMode(e,c,h);return await x(),g}const Wp=new Map;async function rte(e,t,n){const a=Wp.get(e);if(a)return a;const r=(async()=>{n(e,await t(e))})();Wp.set(e,r);try{await r}finally{Wp.get(e)===r&&Wp.delete(e)}}function PT(e){return e instanceof Error?e:new Error(String(e))}async function ite(e,t,n){const[a,...r]=await Promise.allSettled([e(),...t.map(i=>i.load())]);return r.forEach((i,o)=>{i.status==="rejected"&&n(t[o],PT(i.reason))}),a.status==="fulfilled"}function ote(e){return EZ(e),e.type==="turn.started"||e.type==="session.model-variants"||e.type==="turn.completed"?{type:"modelVariantRuntime",event:e}:null}const np=f.createContext(null);function lte(e){const t=PZ();return t?{...e,botSettingsSection:t,botSettingsSectionStored:!0}:e}function cte({children:e}){const t=f.useRef(new Map).current,n=j=>({...j,tasks:j.tasks?.map(N=>({...N,...RT(t.get(N.threadId)?.patch??{})}))}),[a,r]=f.useReducer(Pa,ste,j=>pX(lte(j))),i=f.useRef(a),o=f.useRef(0);i.current=a;const c=et(),d=f.useRef(c);d.current=c;const u=f.useCallback(()=>{r({type:"error",message:null})},[]);Eee(a.error,u),f.useEffect(()=>{a.selectedId&&LZ(a.selectedId)},[a.selectedId]),f.useEffect(()=>{a.settingsOpen&&a.botSettingsExpandAccordion&&DZ(a.botSettingsSection)},[a.settingsOpen,a.botSettingsExpandAccordion,a.botSettingsSection]);const p=f.useMemo(()=>wee({send:(j,N,A,T,M)=>zT(j,N,A,K,Nd(),T,M),reconcile:async(j,N)=>(await K(`/api/bots?messages=${dd}`,{signal:N})).bots.find(T=>T.id===j)??null,onAuthoritative:(j,N)=>{r({type:"botPatched",bot:n({...j,...N})})},onError:j=>{r({type:"error",message:j.message})}}),[]);f.useEffect(()=>{p.revive();const j=Nee(p,window);return()=>{j(),p.dispose()}},[p]);const m=f.useMemo(()=>{const j=new Map,N=kX(()=>i.current,r),A=new Set,T=See();let M=!1;const S=_=>{EA(_)||(Cee(_)?$({type:"notice",notice:{kind:"note",botName:null,text:_.message}}):r({type:"error",message:_ instanceof Error?_.message:String(_)}))},C=_=>B=>{S(B),K("/api/bots?messages=0").then(W=>{const R=vX(_,W);R?.type==="botPatched"?r({...R,bot:n({...R.bot,...p.overlayFor(R.bot.id)})}):R&&r(R)}).catch(()=>{})},O=_=>{const B=_.groupId?i.current.groups.find(W=>W.id===_.groupId):i.current.bots.find(W=>W.id===_.botId);return{host:B,card:B?.messages.find(W=>W.id===_.messageId)?.card,inRoom:!!_.groupId}},L=(_,B,W)=>{fetch(`/api/bots/${_}/cards/${B}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(W)}).catch(()=>{})},D=async(_,B)=>{const W=B?t.get(B)?.execution:void 0,R=[...t.values()].filter(q=>q.updatesDefault&&_.some(F=>F.id===q.botId));await Promise.all([W,...R.map(q=>q.execution),..._.map(async q=>{const F=await p.flush(q.id);if(!F)return;const E=q.modelSelection;if(En(F)!==En(q)||F.memoryEnabled!==!1!=(q.memoryEnabled!==!1)||F.modelSelection.instanceId!==E.instanceId||F.modelSelection.model!==E.model||F.modelSelection.effort!==E.effort||F.modelSelection.variant!==E.variant)throw new Error(l("approvalMode.settingsNotSaved"))})]),B&&await t.get(B)?.execution},z=(_,B,W)=>{const R=t.get(B),q=W.updateBotDefault||W.approvalMode!==void 0?[...t.values()].filter(U=>U.botId===_):[],F=Promise.all([R?.promise,...q.map(U=>U.promise)].map(U=>U?.catch(()=>{}))).then(async()=>{const U=W.resetApprovalToAsk?vw():void 0;return U?U.setMode(_,"ask",{threadId:B,modelSelection:W.modelSelection,updateBotDefault:!!W.updateBotDefault}):ate(_,B,W,Nd())}),E=Promise.all([R?.execution,F]);E.catch(()=>{});const H={botId:_,updatesDefault:!!(W.updateBotDefault||R?.updatesDefault),patch:{...R?.patch,...W},promise:F,execution:E};t.set(B,H),H.promise.then(U=>{t.get(B)===H&&(t.delete(B),U&&r({type:"botPatched",bot:n(U)}))}).catch(U=>{S(U),t.get(B)===H&&(H.patch={},UQ(()=>t.get(B)===H,()=>K(`/api/bots?messages=${dd}`).then(({bots:V})=>{const G=t.get(B)===H?V.find(Q=>Q.id===_):void 0;G&&(r({type:"botPatched",bot:n(G)}),t.delete(B))})))})},P=_=>{const B=i.current,W=new Set;for(const R of B.bots)(R.threadId===_||R.tasks?.some(q=>q.threadId===_))&&W.add(R.id);for(const R of B.groups)if(R.threadId===_||R.tasks?.some(q=>q.threadId===_))for(const q of R.memberIds)W.add(q);return B.bots.filter(R=>W.has(R.id))},$=_=>{["select","newTask","switchTask","newGroupTask","switchGroupTask","showChat","showRoutines","showTeamMap","showFiles","showWebPanel"].includes(_.type)&&o.current++,_=Zee(_,i.current.bots),_.type==="taskSwitched"&&(_={..._,bot:n(_.bot)}),_.type==="botPatched"&&(_={..._,bot:n(_.bot)}),(_.type==="send"||_.type==="sendGroup"||_.type==="editMessage")&&!_.sendId&&(_={..._,sendId:ya()});const B=_.type==="updateBot"||_.type==="setModel"?i.current.bots.find(E=>E.id===_.botId):void 0,W=_.type==="send"?i.current.bots.find(E=>E.id===_.botId):void 0,R=_.type==="editMessage"?i.current.bots.find(E=>E.id===_.botId)?.activeLeafId??null:null,q=(()=>{if(_.type==="editMessage"||_.type==="answerCard"){const E=i.current.bots.find(H=>H.id===_.botId);return E?[E]:[]}if(_.type==="decideRequest"){const E=P(_.threadId);if(!_.alwaysAllow||E.some(U=>U.id===_.alwaysAllow?.botId))return E;const H=i.current.bots.find(U=>U.id===_.alwaysAllow?.botId);return H?[...E,H]:E}if(_.type==="sendGroup"){const E=i.current.groups.find(H=>H.id===_.groupId)?.memberIds??[];return i.current.bots.filter(H=>E.includes(H.id))}if(_.type==="runRoutine"){const E=i.current.routines.find(U=>U.id===_.routineId);if(!E)return[];const H=new Set([E.botId]);if(E.target==="room-goal"&&E.groupId){const U=i.current.groups.find(V=>V.id===E.groupId);for(const V of U?.memberIds??[])H.add(V)}return i.current.bots.filter(U=>H.has(U.id))}return[]})(),F=(()=>{if(_.type==="send")return W?LT(W):void 0})();switch(_.type!=="cancelQueued"&&_.type!=="cancelGroupQueued"&&_.type!=="deleteBot"&&r(_),_.type){case"loadOlderMessages":{if(A.has(_.threadId))break;A.add(_.threadId);const E=i.current,U=[...E.bots,...E.groups].find(G=>G.threadId===_.threadId)?.messages[0]?.id,V=E.transcriptGeneration[_.threadId]??0;if(!U){A.delete(_.threadId),r({type:"olderMessages",threadId:_.threadId,generation:V,messages:[],hasMore:!1});break}K(`/api/threads/${_.threadId}/messages?limit=${dd}&before=${encodeURIComponent(U)}`).finally(()=>A.delete(_.threadId)).then(G=>r({type:"olderMessages",threadId:_.threadId,generation:V,messages:G.messages??[],hasMore:!!G.hasMore})).catch(G=>{r({type:"olderMessages",threadId:_.threadId,generation:V,messages:[],hasMore:!0}),S(G)});break}case"notice":_.notice&&setTimeout(()=>r({type:"notice",notice:null}),_.notice.kind==="note"?2e4:6e3);break;case"createRoutine":K("/api/routines",{method:"POST",body:JSON.stringify(_.input)}).catch(S);break;case"updateRoutine":K(`/api/routines/${_.routineId}`,{method:"PATCH",body:JSON.stringify(_.patch)}).then(({routine:E})=>r({type:"routinePatched",routine:E}),S);break;case"deleteRoutine":K(`/api/routines/${_.routineId}`,{method:"DELETE"}).catch(S);break;case"runRoutine":D(q).then(()=>K(`/api/routines/${_.routineId}/run`,{method:"POST"})).then(({run:E})=>_.onStarted?.(E)).catch(E=>{_.onError?_.onError(E):S(E)}).finally(()=>_.onSettled?.());break;case"cancelRoutineRun":K(`/api/routine-runs/${_.runId}/cancel`,{method:"POST"}).catch(S);break;case"loadDataSheet":K(AA.sheet(_.botId)).then(E=>r({type:"dataSheet",sheet:nte(E,_.botId),tables:tte(E)})).catch(E=>(_.onError??S)(E instanceof Error?E.message:String(E)));break;case"markRoutineRunSeen":K(`/api/routine-runs/${_.runId}/seen`,{method:"POST"}).catch(S);break;case"markAllRoutineRunsSeen":K("/api/routine-runs/seen-all",{method:"POST"}).catch(S);break;case"cancelQueued":K(`/api/bots/${_.botId}/queue/${_.queueId}`,{method:"DELETE",body:JSON.stringify({threadId:_.threadId})}).then(()=>{r(_),_.onCancelled?.()}).catch(S);break;case"steerQueued":K(`/api/bots/${_.botId}/queue/${_.queueId}/steer`,{method:"POST",body:JSON.stringify({threadId:_.threadId})}).then(E=>{if(E?.steered===!0&&Array.isArray(E.messages)&&typeof E.threadId=="string"){for(const H of E.messages)r({type:"messageAdded",threadId:E.threadId,message:H});for(const H of E.queueIds??[])r({type:"consumePendingQueued",threadId:E.threadId,queueId:H})}else E?.queued===!0&&E.blockedBy==="images"&&$({type:"notice",notice:{kind:"steer-images",botName:null}});_.onSettled?.()}).catch(E=>{S(E),_.onError?.()});break;case"cancelGroupQueued":K(`/api/groups/${_.groupId}/queue/${_.queueId}`,{method:"DELETE"}).then(()=>{r(_),_.onCancelled?.()}).catch(S);break;case"steerGroupQueued":K(`/api/groups/${_.groupId}/queue/${_.queueId}/steer`,{method:"POST",body:JSON.stringify({threadId:_.threadId})}).then(E=>{if(E?.steered===!0&&Array.isArray(E.messages)&&typeof E.threadId=="string"){for(const H of E.messages)r({type:"messageAdded",threadId:E.threadId,message:H});for(const H of E.queueIds??[])r({type:"consumePendingQueued",threadId:E.threadId,queueId:H})}else E?.queued===!0&&E.blockedBy==="images"&&$({type:"notice",notice:{kind:"steer-images",botName:null}});_.onSettled?.()}).catch(E=>{S(E),_.onError?.()});break;case"send":{F&&L(_.botId,F.id,{dismissed:!0});const E=_.threadId??i.current.bots.find(V=>V.id===_.botId)?.threadId,H=_.sendId??ya(),U=()=>mX(i.current.bots.find(V=>V.id===_.botId&&V.threadId===E)?.messages,H);D(W?[W]:[],E).then(()=>hX(()=>K(`/api/bots/${_.botId}/messages`,{method:"POST",body:JSON.stringify({text:_.text,replyToId:_.replyToId,threadId:E,sendId:H,..._.dataContext?{dataContext:_.dataContext}:{},..._.pointed?.length?{pointed:_.pointed}:{},..._.openPage?{openPage:_.openPage}:{},..._.mode==="goal"?{mode:"goal"}:{},..._.followUp?{followUp:_.followUp}:{},..._.mentions?.length?{mentions:_.mentions}:{}})}),U)).then(V=>{if(!("body"in V))return;const G=V.body;G?.message&&typeof G.threadId=="string"&&r({type:"messageAdded",threadId:G.threadId,message:G.message}),G?.queued&&typeof G.threadId=="string"&&typeof G.queueId=="string"&&(r({type:"optimisticMessageRemoved",threadId:G.threadId,sendId:H}),r({type:"pendingQueued",threadId:G.threadId,queueId:G.queueId,text:_.text,reason:G.reason==="capacity"||G.reason==="group-turn"?G.reason:void 0}))}).catch(V=>{E&&r({type:"optimisticMessageRemoved",threadId:E,sendId:H}),S(V),_.onError?.()});break}case"editMessage":{const E=_.threadId??i.current.bots.find(U=>U.id===_.botId)?.threadId,H=_.sendId??ya();D(q,E).then(()=>K(`/api/bots/${_.botId}/messages/${_.messageId}/edit`,{method:"POST",body:JSON.stringify({text:_.text.trim(),threadId:E,sendId:H})})).then(U=>{U?.message&&E&&r({type:"messageAdded",threadId:E,message:U.message})}).catch(U=>{E&&r({type:"optimisticMessageRemoved",threadId:E,sendId:H,restoreLeafId:R}),S(U)});break}case"switchBranch":K(`/api/bots/${_.botId}/active-branch`,{method:"POST",body:JSON.stringify({messageId:_.messageId,threadId:_.threadId})}).catch(S);break;case"decideRequest":{const E=()=>K(`/api/threads/${_.threadId}/respond`,{method:"POST",body:JSON.stringify({requestId:_.requestId,behavior:_.behavior,message:_.message,reviewedSha256:_.reviewedSha256,always:_.always,rememberCommand:_.rememberCommand,..._.room===!1?{room:!1}:{}})});D(q,_.threadId).then(async()=>{if(_.alwaysAllow){const U=i.current.bots.find(Q=>Q.id===_.alwaysAllow?.botId),V=U?.tasks?.some(Q=>Q.threadId===_.threadId),G=[...new Set([...U?rs(U,_.threadId).alwaysAllow??[]:[],_.alwaysAllow.key])];try{await K(V?`/api/bots/${_.alwaysAllow.botId}/always-allow`:`/api/bots/${_.alwaysAllow.botId}`,{method:V?"POST":"PATCH",body:JSON.stringify(V?{threadId:_.threadId,allowKey:_.alwaysAllow.key}:{alwaysAllow:G})})}catch(Q){S(Q)}}const H=await E();H?.settlementPending&&typeof H.message=="string"&&S(new Error(H.message))}).catch(H=>{S(H),_.onError?.(H instanceof Error?H.message:String(H))});break}case"answerCard":{const{host:E,card:H,inRoom:U}=O(_);D(q,_.threadId).then(()=>{if(H?.requestId&&E){const V=H.skillRequest?{behavior:AX(_.answer)}:jZ(H,_.answer);return K(`/api/threads/${_.threadId??E.threadId}/respond`,{method:"POST",body:JSON.stringify({requestId:H.requestId,...V,reviewedSha256:V.behavior==="allow"&&H.skillRequest?c2(H.skillRequest):void 0})})}if(!U)return L(_.botId,_.messageId,{answered:_.answer,dismissed:!0}),K(`/api/bots/${_.botId}/messages`,{method:"POST",body:JSON.stringify({text:_.answer,threadId:_.threadId})})}).catch(V=>{H?.requestId&&E&&r({type:"answerCardFailed",botId:_.botId,messageId:_.messageId,answer:_.answer,groupId:_.groupId}),S(V)});break}case"dismissCard":{const{host:E,card:H,inRoom:U}=O(_);H?.requestId&&E?K(`/api/threads/${_.threadId??E.threadId}/respond`,{method:"POST",body:JSON.stringify({requestId:H.requestId,...iT(H)})}).catch(()=>{}):U||L(_.botId,_.messageId,{dismissed:!0});break}case"newBot":{if(M4(i.current)||M||i.current.botCreationPending)break;M=!0,r({type:"botCreationPending",on:!0}),Oe(async()=>{const{makeNewBot:E}=await import("./new-bot-D0H-oXYW.js").then(H=>H.n);return{makeNewBot:E}},__vite__mapDeps([0,1,2,3,4])).then(({makeNewBot:E})=>E(_,i.current.bots,$,d.current)).catch(S).finally(()=>{M=!1,r({type:"botCreationPending",on:!1})});break}case"duplicateBot":{if(M4(i.current))break;const E=i.current.bots.find(U=>U.id===_.botId);if(!E)break;const H=MX(E);K("/api/bots",{method:"POST",body:JSON.stringify(TX(E))}).then(({bot:U,paused:V})=>K(`/api/bots/${U.id}`,{method:"PATCH",body:JSON.stringify(H)}).then(({bot:G})=>{r({type:"botAdded",bot:{...U,...G,messages:U.messages}}),V&&OQ(U.id)})).catch(S);break}case"deleteBot":r({type:"botDeletionPending",botId:_.botId,on:!0}),rte(_.botId,async E=>(await p.flush(E),K(`/api/bots/${E}`,{method:"DELETE"})),(E,H)=>{p.cancel(E),r({type:"deleteBot",botId:E}),H?.notice&&$({type:"notice",notice:{kind:"note",botName:null,text:H.notice}})}).catch(S).finally(()=>r({type:"botDeletionPending",botId:_.botId,on:!1}));break;case"markUnread":K(`/api/bots/${_.botId}`,{method:"PATCH",body:JSON.stringify({unread:!0})}).catch(()=>{});break;case"openDataResult":case"select":{const E=_.type==="select"?_.id:_.botId,H=i.current.bots.find(V=>V.id===E),U=i.current.groups.find(V=>V.id===E);H?.unread?K(`/api/bots/${E}/read`,{method:"POST",body:JSON.stringify({threadId:H.threadId})}).catch(()=>{}):U?.unread&&K(`/api/groups/${E}/read`,{method:"POST"}).catch(()=>{});break}case"createGroup":K("/api/groups",{method:"POST",body:JSON.stringify({memberIds:_.memberIds,name:_.name,section:_.section,...window.ogb?.remoteClient?.active?{setup:{bulletin:"",defaultResponder:{kind:"mentions"}}}:{}})}).then(({group:E})=>{r({type:"groupPatched",group:E}),r({type:"select",id:E.id})}).catch(S);break;case"sendGroup":{const E=_.threadId??i.current.groups.find(U=>U.id===_.groupId)?.threadId,H=_.sendId??ya();D(q).then(()=>K(`/api/groups/${_.groupId}/messages`,{method:"POST",body:JSON.stringify({text:_.text,replyToId:_.replyToId,threadId:E,sendId:H,mode:_.mode??"chat",..._.mentions?.length?{mentions:_.mentions}:{}})})).then(U=>{U?.message&&typeof U.threadId=="string"&&r({type:"messageAdded",threadId:U.threadId,message:U.message}),U?.queued&&typeof U.threadId=="string"&&typeof U.queueId=="string"&&(r({type:"optimisticMessageRemoved",threadId:U.threadId,sendId:H}),r({type:"pendingQueued",threadId:U.threadId,queueId:U.queueId,text:_.text}))}).catch(U=>{E&&r({type:"optimisticMessageRemoved",threadId:E,sendId:H}),S(U),_.onError?.()});break}case"patchGroup":K(`/api/groups/${_.groupId}`,{method:"PATCH",body:JSON.stringify(_.patch)}).catch(C({groupId:_.groupId}));break;case"deleteGroup":K(`/api/groups/${_.groupId}`,{method:"DELETE"}).catch(S);break;case"setModel":if(_.threadId){z(_.botId,_.threadId,{modelSelection:_.selection,..._.updateBotDefault?{updateBotDefault:!0}:{},..._.resetApprovalToAsk?{resetApprovalToAsk:!0}:{}});break}B&&p.enqueue(_.botId,{modelSelection:_.selection,threadId:B.switchingTo??B.threadId},B);break;case"updateTask":z(_.botId,_.threadId,_.patch);break;case"refreshTaskPermissions":{const E=i.current.bots.find(X=>X.id===_.botId),H=E?.tasks?.find(X=>X.threadId===_.threadId);if(!E||!H){S(new Error(l("task.threadGone")));break}const U=En(E),V=En(rs(E,_.threadId)),G=_.acknowledgeLocalAuto===!0,Q=Nd();(U==="custom"||V==="custom"||U==="full"&&Q!==void 0?Q?Q.setMode(_.botId,U,{threadId:_.threadId,threadOnly:!0,refreshPermissions:!0,acknowledgeLocalAuto:G}):Promise.reject(new Error(l("approvalMode.needsDesktopApp"))):K(`/api/bots/${_.botId}/tasks/${_.threadId}`,{method:"PATCH",body:JSON.stringify({refreshPermissions:!0,...G?{acknowledgeLocalAuto:!0}:{}})}).then(X=>X.bot)).then(X=>{X&&r({type:"botPatched",bot:n(X)})}).catch(S);break}case"followBotModel":K(`/api/bots/${_.botId}/threads/follow-model`,{method:"POST",body:"{}"}).then(({bot:E,busy:H})=>{r({type:"botPatched",bot:n(E)}),_.onSettled?.({busy:H??0})}).catch(S);break;case"createProject":K(`/api/bots/${_.botId}/projects`,{method:"POST",body:JSON.stringify({name:_.name,emoji:_.emoji})}).then(({bot:E,project:H})=>{m({type:"botPatched",bot:E}),_.onCreated?.(H)}).catch(E=>{S(E),_.onError?.(E instanceof Error?E.message:String(E))});break;case"updateProject":K(`/api/bots/${_.botId}/projects/${_.projectId}`,{method:"PATCH",body:JSON.stringify(_.patch)}).then(({bot:E})=>{m({type:"botPatched",bot:E}),_.onSaved?.()}).catch(E=>{S(E),_.onError?.(E instanceof Error?E.message:String(E))});break;case"deleteProject":K(`/api/bots/${_.botId}/projects/${_.projectId}`,{method:"DELETE"}).then(({bot:E})=>{m({type:"botPatched",bot:E}),_.onDeleted?.()}).catch(E=>{S(E),_.onError?.(E instanceof Error?E.message:String(E))});break;case"reorderProjects":K(`/api/bots/${_.botId}/projects/order`,{method:"PATCH",body:JSON.stringify({projectIds:_.projectIds})}).then(({bot:E})=>{m({type:"botPatched",bot:E}),_.onSaved?.()}).catch(E=>{S(E),_.onError?.(E instanceof Error?E.message:String(E))});break;case"interrupt":MZ(K,_,S);break;case"newTask":case"switchTask":{const E=_.type==="newTask"?T(_,()=>m(_)):()=>{};if(!E)break;const H=(j.get(_.botId)??0)+1;j.set(_.botId,H);const U=o.current;(_.type==="newTask"?p.flush(_.botId):Promise.resolve()).then(()=>K(_.type==="newTask"?`/api/bots/${_.botId}/tasks`:`/api/bots/${_.botId}/tasks/${_.threadId}${_.whole?"":`?messages=${mN}`}`,{method:"POST",body:JSON.stringify(_.type==="newTask"?{projectId:_.projectId,cwd:_.cwd}:{})})).then(G=>{if(_.type==="newTask"&&(E(null),_.onCreated?.()),j.get(_.botId)!==H)return;if(!G?.bot){_.type==="switchTask"&&r({type:"switchTaskFailed",botId:_.botId,threadId:_.threadId});return}const Q=_.type==="newTask"&&_.cwd!==void 0;Q&&o.current!==U||(m({type:"taskSwitched",bot:G.bot}),Q&&r({type:"select",id:_.botId}))}).catch(G=>{_.type==="switchTask"&&j.get(_.botId)===H&&r({type:"switchTaskFailed",botId:_.botId,threadId:_.threadId});const Q=G instanceof Error?G.message:String(G);E(Q),_.type==="newTask"&&_.onError?_.onError(Q):S(G)});break}case"renameTask":K(`/api/bots/${_.botId}/tasks/${_.threadId}`,{method:"PATCH",body:JSON.stringify({title:_.title})}).catch(C({botId:_.botId}));break;case"regenerateTaskTitle":K(`/api/bots/${_.botId}/tasks/${_.threadId}/title`,{method:"POST"}).then(()=>_.onSettled?.(!0)).catch(E=>{S(E),_.onSettled?.(!1)});break;case"deleteTask":K(`/api/bots/${_.botId}/tasks/${_.threadId}`,{method:"DELETE"}).then(E=>E?.bot&&m({type:"botPatched",bot:E.bot})).catch(S);break;case"newGroupTask":K(`/api/groups/${_.groupId}/tasks`,{method:"POST",body:"{}"}).then(N(_.groupId,!0)).catch(S);break;case"switchGroupTask":K(`/api/groups/${_.groupId}/tasks/${_.threadId}?messages=${mN}`,{method:"POST"}).then(N(_.groupId,!0)).catch(S);break;case"renameGroupTask":case"pinGroupTask":case"archiveGroupTask":case"setConversationTurnLimit":{const E=_.type==="renameGroupTask"?{title:_.title}:_.type==="pinGroupTask"?{pinned:_.pinned,title:_.title}:_.type==="archiveGroupTask"?{archivedAt:_.archivedAt}:{turnTimeoutMinutes:_.minutes},H=_.type==="setConversationTurnLimit"&&_.dm?`/api/groups/${_.groupId}`:`/api/groups/${_.groupId}/tasks/${_.threadId}`;K(H,{method:"PATCH",body:JSON.stringify(E)}).catch(C({groupId:_.groupId}));break}case"deleteGroupTask":K(`/api/groups/${_.groupId}/tasks/${_.threadId}`,{method:"DELETE"}).then(N(_.groupId,!1)).catch(S);break;case"setGroupHold":K(`/api/groups/${_.groupId}/holds`,{method:"POST",body:JSON.stringify({botId:_.botId,held:_.held})}).then(N(_.groupId,!1)).catch(S);break;case"interruptGroup":K(`/api/groups/${_.groupId}/interrupt`,{method:"POST",body:_.threadId?JSON.stringify({threadId:_.threadId}):void 0}).catch(E=>{S(E),_.onError?.()});break;case"updateBot":{B&&p.enqueue(_.botId,_.patch,B);break}}};return $},[p]),h=f.useRef(!1);f.useEffect(()=>{if(!a.hydrated||h.current)return;h.current=!0;const j=a.bots.find(N=>N.id===a.selectedId);j&&a.activeView==="chat"&&Io(j,c)!==j.threadId&&$t(m,j,c)},[a.hydrated,a.bots,a.selectedId,a.activeView,c,m]),f.useEffect(()=>{let j=!0;const N=new Map,A=E=>{let H=N.get(E);return H||(H={attempt:0,generation:0,timer:null,version:0},N.set(E,H)),H},T=[{key:"instances",request:async()=>{const E=await Bf("/api/instances",async()=>Lp(await K("/api/instances"),"instances"),null);return()=>{E&&r({type:"instances",instances:E.instances})}}},{key:"config",request:async()=>{const E=await K("/api/config");return()=>r({type:"configStatus",config:E})}},{key:"routines",request:async()=>{const E=Date.now()-Gee,{routines:H,runs:U}=Lp(await K(`/api/routines?since=${E}`),"routines","runs");return()=>r({type:"routinesHydrated",routines:H,runs:U,since:E})}},{key:"notifications",request:async()=>{const{notifications:E}=await K("/api/notifications");return()=>r({type:"notificationsHydrated",notifications:Array.isArray(E)?E:[]})}},...window.ogb?.remoteClient?.active?[]:[{key:"webhooks",request:async()=>{const{webhooks:E,attempts:H,ingress:U}=Lp(await K("/api/webhooks"),"webhooks");return()=>r({type:"webhooksHydrated",webhooks:E,attempts:H??[],ingress:U})}}]],M=new Map(T.map(E=>[E.key,E])),S=(E,H)=>{if(!j)return;const U=A(E.key);if(U.timer)return;H!==void 0&&(E.key==="routines"&&r({type:"routinesLoadFailed"}),console.warn(`snapshot: ${E.key} refresh failed; retrying`,H));const V=Math.min(3e4,1e3*2**Math.min(U.attempt,5));U.attempt+=1,U.timer=setTimeout(()=>{U.timer=null;const G=()=>{C(E,!0).catch(Y=>S(E,Y))};if(!Kr())return G();const Q=Tx(Y=>{Y||(Q(),j&&G())})},V)},C=async(E,H)=>{const U=A(E.key);U.timer&&(clearTimeout(U.timer),U.timer=null);const V=++U.generation,G=U.version;try{const Q=await E.request();if(!j||U.generation!==V)return;if(H&&U.version!==G){S(E);return}Q(),U.attempt=0}catch(Q){if(!j||U.generation!==V)return;throw PT(Q)}},O=(...E)=>{for(const H of E)A(H).version+=1},L=async()=>{const E=o.current,H=i.current.transcriptGeneration,U=new Set([...i.current.bots,...i.current.groups].flatMap(X=>X.tasks?.map(J=>J.threadId)??[])),V=i.current.liveCallVersion,G=AT();Bf("/api/live/call",()=>K("/api/live/call"),null).then(X=>{const J=G0(X);j&&J&&Ke.flushSync(()=>r({type:"liveCallLookup",call:J.call,since:V,seq:G}))}).catch(()=>{});const Q=()=>K(`/api/bots?messages=${dd}`).then(X=>Lp(X,"bots")).then(({bots:X,groups:J,sections:pe,computerControl:se,botQueuedMessages:ee})=>{j&&r({type:"hydrate",bots:X,groups:J??[],sections:pe??[],computerControl:se??{},botQueuedMessages:ee,preserveNavigation:o.current!==E,navigationSince:H,taskIdsAtStart:U,resumeId:OZ()??void 0})}),Y=T.map(X=>({key:X.key,load:()=>C(X,!1)})),oe=await ite(Q,Y,(X,J)=>{const pe=M.get(X.key);pe&&S(pe,J)});return j&&oe};let D=!1,z=null,P=!1;const $=[];let _;const B=()=>z?(P=!0,z):(D=!1,z=(async()=>{let E=!1;do P=!1,E=await L();while(j&&P);if(!j||!E)return!1;D=!0;for(const H of $.splice(0))_(H);return!0})().finally(()=>{z=null}),z),W=setTimeout(B,1e3),R=new Map,q=(E,H,U,V)=>{R.set(U,{covers:V,again:!1}),fetch(`/api/bots/${E}/read`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({threadId:H})}).catch(()=>{}).finally(()=>{const G=R.get(U);R.delete(U),G?.again&&j&&q(E,H,U,G.covers)})};_=E=>{switch(E.kind==="config"?O("config","instances"):E.kind==="routine"||E.kind==="routine.deleted"||E.kind==="routine.run"?O("routines"):(E.kind==="webhook"||E.kind==="webhook.attempt"||E.kind==="webhook.deleted")&&O("webhooks"),E.kind){case"sections":r({type:"sections",sections:E.sections});break;case"bots.order":r({type:"botsOrdered",botIds:E.botIds});break;case"groups.order":r({type:"groupsOrdered",groupIds:E.groupIds});break;case"bot.queued":r({type:"botQueues",queues:E.queues});break;case"message":{if(r({type:"messageAdded",threadId:E.threadId,message:E.message}),E.message?.role==="user"&&typeof E.message.queueId=="string"&&r({type:"consumePendingQueued",threadId:E.threadId,queueId:E.message.queueId}),E.message?.role==="bot"&&E.message?.kind==="text"){const H=sN(i.current,E.threadId);u1.completeBotText(E.threadId,E.message.turnId,E.message.text??"",H,E.message.id)}break}case"message.patch":r({type:"messagePatched",threadId:E.threadId,message:E.message});break;case"thread":r({type:"threadActive",threadId:E.threadId,activeLeafId:E.activeLeafId});break;case"bot":{const H=E.bot,U=i.current.bots.find(Q=>Q.id===H.id),V=U?.switchingTo??U?.threadId,G=H.tasks?.find(Q=>Q.threadId===V);if(H.id===i.current.selectedId&&i.current.activeView==="chat"&&document.hasFocus()&&(G?.unread||!H.tasks&&H.unread)){G&&(G.unread=!1),H.unread=m7(H);const Q=`${H.id}:${V}`,Y=G?.updatedAt??0,oe=R.get(Q);oe?Y>oe.covers&&R.set(Q,{covers:Y,again:!0}):q(H.id,V,Q,Y)}r({type:"botPatched",bot:n({...H,...p.overlayFor(H.id)})});break}case"group":{const H=E.group;H.unread&&H.id===i.current.selectedId&&document.hasFocus()&&(H.unread=!1,fetch(`/api/groups/${H.id}/read`,{method:"POST"}).catch(()=>{})),r({type:"groupPatched",group:H});break}case"notify":QX(E.notification,H=>mn(m,H,i.current,d.current),i.current.bots.find(H=>H.id===E.notification.botId)?.avatarUrl,cX(i.current)),r({type:"notificationReceived",entry:E.notification});break;case"notifications.read":O("notifications"),r({type:"notificationsRead",ids:E.ids});break;case"group.deleted":r({type:"groupDeleted",groupId:E.groupId});break;case"routine":r({type:"routinePatched",routine:E.routine});break;case"routine.deleted":r({type:"routineDeleted",routineId:E.routineId});break;case"routine.run":r({type:"routineRunPatched",run:E.run});break;case"webhook":r({type:"webhookPatched",webhook:E.webhook});break;case"webhook.attempt":r({type:"webhookAttempted",attempt:E.attempt});break;case"webhook.deleted":r({type:"webhookDeleted",webhookId:E.webhookId});break;case"runtime":{u1.onRuntimeEvent(E.event,sN(i.current,E.event.threadId));const H=ote(E.event);H&&r(H);break}case"screen":i.current.computerStarts[E.botId]&&r({type:"computerStart",botId:E.botId,start:null});break;case"computer":r({type:"computerStart",botId:E.botId,start:{state:E.state,...E.place?{place:E.place}:{}}});break;case"computer-control":r({type:"computerControl",botId:E.botId,held:E.held===!0,helpReason:typeof E.helpReason=="string"?E.helpReason:null,help:rT(E.help)});break;case"data":r({type:"dataSheet",sheet:E.sheet});break;case"bot.deleted":p.cancel(E.botId),r({type:"deleteBot",botId:E.botId});break;case"live.call":{const H=G0(E);H&&(u1.onLiveCall(H.call),Ke.flushSync(()=>r({type:"liveCall",call:H.call})));break}case"window-pref":oZ(E);break;case"theme":uH(E);break;case"config":r({type:"configStatus",config:Xee(E)});{const H=M.get("instances");H&&C(H,!0).catch(U=>S(H,U))}break}};const F=Vee({onOpen:()=>r({type:"connected",value:!0}),onError:()=>r({type:"connected",value:!1}),onSnapshotRequired:()=>(clearTimeout(W),Fee(),$.splice(0),AZ(),B()),onFrame:E=>{Bee(E),D?_(E):$.push($ee(E))}});return()=>{j=!1,clearTimeout(W);for(const E of N.values())E.timer&&clearTimeout(E.timer);F()}},[]);const x=f.useRef(new Map),g=f.useCallback(async j=>{const N=j?.cached?"/api/instances":"/api/instances?fresh=1",A=x.current,T=A.get(N)??K(N,{timeoutMs:12e4}).then(({instances:M})=>{if(!Array.isArray(M))throw new Error(l("engineSetup.invalidStatus"));r({type:"instances",instances:M})});A.set(N,T),await T.catch(M=>{if(j?.reportErrors)throw M}).finally(()=>{A.get(N)===T&&A.delete(N)})},[]),v=f.useCallback(async j=>{const{instances:N}=await K(`/api/instances/${encodeURIComponent(j)}/refresh-models`,{method:"POST"});r({type:"instances",instances:N})},[]),y=f.useRef(0);f.useEffect(()=>{const j=()=>{const A=Date.now();A-y.current<3e4||(y.current=A,g({cached:!0}))};window.addEventListener("focus",j);const N=()=>{document.visibilityState==="visible"&&j()};return document.addEventListener("visibilitychange",N),()=>{window.removeEventListener("focus",j),document.removeEventListener("visibilitychange",N)}},[g]);const w=f.useCallback(j=>p.flush(j),[p]),b=f.useMemo(()=>({state:a,dispatch:m,flushBotPatches:w,refreshInstances:g,refreshModels:v}),[a,m,w,g,v]),k=f.useMemo(()=>({dispatch:m,state:()=>i.current}),[m]);return s.jsx(zx,{value:k,children:s.jsx(np.Provider,{value:b,children:e})})}function re(){const e=f.useContext(np);if(!e)throw new Error("useStore outside provider");return e}function jDe({value:e,children:t}){return s.jsx(zx,{value:null,children:s.jsx(np.Provider,{value:e,children:t})})}function dte(e){if(!e)return[];const t=[...e.querySelectorAll("[data-sidebar-bot-row]")].map(n=>n.dataset.sidebarBotRow??"");return[...new Set(t.filter(Boolean))]}function ute(e,t){if(t.length===0)return[...e];const n=new Map(e.map(a=>[a.id,a]));return t.flatMap(a=>n.get(a)??[])}function pte(e,t,n){if(e.length===0)return;const a=e.findIndex(r=>r.id===t);return a===-1?n>0?e[0]:e.at(-1):e[(a+n+e.length)%e.length]}const C2="omb.onboarding.welcomeDraft";function mte(){try{const e=localStorage.getItem(C2),t=e?JSON.parse(e):null;return!t||typeof t!="object"||t.version!==f7?null:MH.includes(t.beat)?{beat:t.beat}:null}catch{return null}}function fte(e){try{localStorage.setItem(C2,JSON.stringify({version:f7,beat:e.beat}))}catch{}}function DT(){try{localStorage.removeItem(C2)}catch{}}const $T="omb.onboarding.sharedWorkspaceHint";function hte(){try{return localStorage.getItem($T)==="1"}catch{return!1}}function xte(){try{localStorage.setItem($T,"1")}catch{}}function gte({replay:e,onClose:t}){const[n,a]=f.useState(hte),r=f.useId();if(n&&!e)return null;const i=()=>{xte(),a(!0),t()};return s.jsxs("aside",{"aria-labelledby":r,className:"fixed left-[calc(var(--rail-beside,0px)_+_0.75rem)] right-3 top-14 z-40 flex items-start gap-3 rounded-2xl border border-hairline/50 bg-panel p-3.5 shadow-[0_24px_60px_-20px_rgba(0,0,0,0.6)] sm:inset-x-auto sm:right-5 sm:top-16 sm:w-[360px]",children:[s.jsx("div",{className:"shrink-0",children:s.jsx(ca,{color:"green",state:"happy",size:36,trackPointer:!1})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{id:r,className:"text-[14px] font-semibold text-ink",children:l("onboarding.shared.title")}),s.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:l("onboarding.shared.body")}),s.jsx("button",{type:"button",onClick:i,className:"mt-2.5 rounded-lg bg-accent px-3 py-1.5 text-[13px] font-medium text-white transition-transform duration-150 active:scale-[0.98]",children:l("onboarding.spot.gotIt")})]})]})}const fu="Trợ Lý Limix",X0=e=>e.defaultBot?.person?.trim().toLowerCase()??"";function bte(e,t){const n=t?.trim().toLowerCase()??"";return(n?e.find(a=>a.defaultBot&&X0(a)===n):void 0)??e.find(a=>a.defaultBot&&!X0(a))}let Z0;const ey=new Set;let fN=!1;function yte(){fN||(fN=!0,K("/api/auth/session",{timeoutMs:1e4,background:!0}).then(e=>{Z0=typeof e.email=="string"?e.email.trim().toLowerCase():null}).catch(()=>{Z0=null}).finally(()=>{for(const e of ey)e()}))}function Eo(){return f.useSyncExternalStore(e=>(ey.add(e),yte(),()=>ey.delete(e)),()=>Z0,()=>{})}function BT(e,t){const n=X0(e);return!!(e.defaultBot&&n&&n!==(t??""))}function E2(e,t){return!!e.sidebarHidden||BT(e,t)}function fc(e,t){return t===void 0?void 0:bte(e,t)}function FT(e,t){const n=Wl(t??{});return e.find(a=>a.chiefOfStaff&&!a.hidden&&Wl(a)===n)}function kte(e,t,n){const a=Wl(t??{});return e.filter(r=>!r.defaultBot&&!r.hidden&&!E2(r,n)&&Wl(r)===a)}function vte(e,t){if(!t||t.welcomed||t.hidden)return!1;const n=FT(e,t);return!n||n.id===t.id}let ty=!1;const ny=new Set;function hN(e){if(ty!==e){ty=e;for(const t of ny)t()}}function UT(){return f.useSyncExternalStore(e=>(ny.add(e),()=>ny.delete(e)),()=>ty,()=>!1)}function wte(e,t){return{welcomed:!0,...e.sidebarHidden?{sidebarHidden:!1}:{},...t?{}:{chiefOfStaff:!0}}}function jte(e){if(e.team)return[];const t=e.ownBots===0;return[...e.aiReady?[]:["ai"],...t?["bots","apps","phone"]:[]]}const Nte=3;function Ste(e){if(e.team)return[];const t=e.ownBots===0;return[...e.aiReady?[]:["ai"],...t&&!e.appsConnected?["apps"]:[],...t&&e.importFound?["import"]:[],...t&&!e.phonePaired?["phone"]:[]]}let sy=null;const ay=new Set;function Vr(e){if(sy!==e){sy=e;for(const t of ay)t()}}function qT(){return f.useSyncExternalStore(e=>(ay.add(e),()=>ay.delete(e)),()=>sy,()=>null)}let HT=null;function WT(e){HT=e}function Ite(e){return HT===e}const Cte=640,Vm=700,Ete="cubic-bezier(0.22, 1, 0.36, 1)",Ate="cubic-bezier(0.3, 0.7, 0.4, 1)";function xN(e){const t=new Map;for(const n of e.querySelectorAll("[data-sidebar-bot-row], [data-section]")){const a=n.dataset.sidebarBotRow?`bot:${n.dataset.sidebarBotRow}`:`section:${n.dataset.section}`;let r=a;for(let i=2;t.has(r);i++)r=`${a}#${i}`;t.set(r,n)}return t}const gN=(e,t)=>e.width>0&&e.height>0&&e.bottom>0&&e.top<t;function KT({from:e,botId:t,reduced:n,commit:a,root:r=document}){const i=r.defaultView?.innerHeight??0,o=new Map([...xN(r)].map(([b,k])=>[b,k.getBoundingClientRect().top])),c=e?.getBoundingClientRect();Ke.flushSync(a);const d=xN(r),u=d.get(`bot:${t}`);if(!u||!gN(u.getBoundingClientRect(),i))return;if(n||!e||!c){u.animate([{opacity:0},{opacity:1}],{duration:180,easing:"linear"});return}const p={duration:Vm+100,easing:"linear"};for(const[b,k]of d){if(k===u)continue;const j=k.getBoundingClientRect();if(!gN(j,i))continue;const N=o.get(b);N===void 0?k.animate([{opacity:0},{opacity:0,offset:.5},{opacity:1}],p):Math.abs(N-j.top)>=.5&&k.animate([{transform:`translateY(${N-j.top}px)`},{transform:"translateY(0)"}],{duration:Cte,easing:Ete})}u.animate([{opacity:0},{opacity:0,offset:.72},{opacity:1}],p);const m=(u.querySelector("svg, img")??u).getBoundingClientRect(),h=e.cloneNode(!0);Object.assign(h.style,{position:"fixed",left:`${c.left}px`,top:`${c.top}px`,width:`${c.width}px`,height:`${c.height}px`,margin:"0",zIndex:"60",pointerEvents:"none",transformOrigin:"top left",filter:"none"}),h.setAttribute("aria-hidden","true"),r.body.appendChild(h),e.style.visibility="hidden";const x=m.width/Math.max(c.width,1),[g,v]=[m.left-c.left,m.top-c.top],y=h.animate([{transform:"translate(0, 0) scale(1)"},{transform:`translate(${g*.5}px, ${v*.5-24}px) scale(${(1+x)/2})`,offset:.5},{transform:`translate(${g}px, ${v}px) scale(${x})`}],{duration:Vm,easing:Ate,fill:"forwards"}),w=()=>h.remove();y.onfinish=()=>{const b=h.animate([{opacity:1},{opacity:0}],{duration:120,easing:"linear",fill:"forwards"});b.onfinish=w,b.oncancel=w},y.oncancel=w,r.defaultView?.setTimeout(w,Vm+600)}const Tte=300,h1=150,bN=64,yN="ui-button ui-button-pill",kN="ui-button ui-button-pill ui-button-primary";function Mte(){return s.jsx("span",{"aria-hidden":"true","data-chief-badge":"",className:"absolute bottom-0 right-0 flex size-4 items-center justify-center rounded-full bg-[#E8993A] text-white ring-2 ring-menu",children:s.jsx(Nr,{size:9,strokeWidth:2.5,fill:"currentColor"})})}function vN(e,t){return!!e.chiefOfStaff||t.find(n=>n.instanceId===e.modelSelection.instanceId)?.capabilities?.agentsMcp===!0}function _te({replay:e,onDone:t,onLeave:n}){const{state:a,dispatch:r}=re(),i=fx(),o=Eo(),c=fc(a.bots,o),d=FT(a.bots,c),u=kte(a.bots,c,o),[p,m]=f.useState(!1),[h,x]=f.useState(null),[g,v]=f.useState(!1),y=f.useRef(null),w=f.useRef(null),b=f.useRef(!1);f.useEffect(()=>{const C=setTimeout(()=>{b.current=!0},Tte);return()=>clearTimeout(C)},[]),f.useEffect(()=>{if(c)return Vr(c.id),()=>Vr(null)},[c?.id]),f.useEffect(()=>{(y.current?.querySelector(p?"[role=radio][tabindex='0']":"[data-primary]")??y.current)?.focus({preventScroll:!0})},[p]);const k=C=>{b.current||(C.preventDefault(),C.stopPropagation())},j=(C,O)=>{v(!0),n?.(),y.current?.animate([{opacity:1},{opacity:0}],{duration:h1,fill:"forwards"}),setTimeout(()=>t(C),O)},N=()=>{if(g||!c)return;const C=wte(c,d);e||WT(c.id),KT({from:w.current,botId:c.id,reduced:i,commit:()=>{Vr(null),r({type:"updateBot",botId:c.id,patch:C})}}),j(c.id,i?h1:Vm)},A=C=>{g||(Vr(null),c&&!c.welcomed&&r({type:"updateBot",botId:c.id,patch:{welcomed:!0}}),C.chiefOfStaff||r({type:"updateBot",botId:C.id,patch:{chiefOfStaff:!0}}),j(C.id,h1))},T=u.filter(C=>vN(C,a.instances)),M=T.find(C=>C.id===h),S=C=>{if(C.key==="Escape"){C.preventDefault(),p&&m(!1);return}if(!p||!["ArrowDown","ArrowUp"].includes(C.key)||!T.length)return;C.preventDefault();const O=T.findIndex(D=>D.id===h),L=T[(O+(C.key==="ArrowDown"?1:T.length-1))%T.length];x(L.id),y.current?.querySelector(`[data-chief-choice="${L.id}"]`)?.focus()};return s.jsx("div",{ref:y,role:"dialog","aria-modal":"true","aria-labelledby":"chief-intro-title",tabIndex:-1,onKeyDown:S,onClickCapture:k,onKeyDownCapture:C=>(C.key==="Enter"||C.key===" ")&&k(C),"data-chief-intro":p?"choose":"intro",className:I("ui-modal animate-pop-in w-[min(440px,calc(100vw-32px))] border-0 outline-none",g&&"pointer-events-none"),children:p?s.jsxs("div",{className:"p-4",children:[s.jsx("h2",{id:"chief-intro-title",className:"text-[14px] font-medium leading-5 text-ink",children:l("onboarding.chief.chooseTitle")}),s.jsx("div",{role:"radiogroup","aria-labelledby":"chief-intro-title",className:"-mx-2 mt-2 max-h-[282px] overflow-y-auto px-2 [scrollbar-width:thin]",children:u.map(C=>{const O=vN(C,a.instances),L=h===C.id;return s.jsxs("div",{role:"radio","aria-checked":L,"aria-disabled":!O||void 0,title:O?void 0:l("sidebar.bot.chiefNeedsEngine"),tabIndex:L||!M&&C.id===T[0]?.id?0:-1,"data-chief-choice":C.id,onClick:()=>O&&x(C.id),onKeyDown:D=>{O&&(D.key===" "||D.key==="Enter")&&(D.preventDefault(),x(C.id))},className:I("flex min-h-10 items-center gap-2 rounded-lg p-2 transition-colors focus-visible:outline-offset-[-2px]",O?"cursor-pointer hover:bg-ink/[0.06]":"opacity-40",L&&"bg-ink/[0.06]"),children:[s.jsx(Je,{bot:C,size:24}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] leading-[18px] text-ink",children:C.name}),s.jsx("span",{"aria-hidden":"true",className:I("size-4 shrink-0 rounded-full border-[1.5px]",L?"border-ink bg-ink shadow-[inset_0_0_0_3px_var(--color-menu)]":"border-ink/30")})]},C.id)})}),s.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[s.jsx("button",{type:"button",onClick:()=>m(!1),className:yN,children:l("onboarding.back")}),s.jsx("button",{type:"button","data-chief-confirm":"",disabled:!M||g,onClick:()=>M&&A(M),className:kN,children:l("onboarding.chief.confirm")})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 pb-4 pt-6 text-center",children:[s.jsxs("span",{ref:w,className:"relative flex",children:[c?s.jsx(Je,{bot:c,size:bN,motion:"arrive"}):s.jsx(ca,{color:"chrome",size:bN,label:fu}),s.jsx(Mte,{})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h2",{id:"chief-intro-title",className:"text-[17px] font-medium leading-6 tracking-[-0.008em] text-ink",children:l("onboarding.chief.title")}),s.jsx("p",{className:"text-[14px] leading-5 text-ink-secondary",children:l("onboarding.chief.body")})]})]}),s.jsxs("div",{className:I("p-4",u.length>0&&"grid grid-cols-2 gap-2"),children:[u.length>0&&s.jsx("button",{type:"button","data-chief-choose":"",onClick:()=>{x(null),m(!0)},className:I(yN,"min-w-0"),children:s.jsx("span",{className:"truncate",children:l("onboarding.chief.choose")})}),s.jsx("button",{type:"button","data-primary":"","data-chief-create":"",onClick:N,disabled:!c,className:I(kN,"w-full min-w-0"),children:s.jsx("span",{className:"truncate",children:l("onboarding.chief.create")})})]})]})})}const VT="omb-engine-updated-seen";function wN(){try{const e=JSON.parse(localStorage.getItem(VT)??"{}");return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function Rte(e){const t=e.autoUpdated?.version??null,[n,a]=f.useState(null);return f.useEffect(()=>{if(!(t===null||wN()[e.driverKind]===t)){a(t);try{localStorage.setItem(VT,JSON.stringify({...wN(),[e.driverKind]:t}))}catch{}}},[e.driverKind,t]),n}function Ote({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:I("text-ink",t),"aria-hidden":!0,children:[s.jsx("path",{d:"M5.938 12.835c.127-.039.285.02.373.143.028.038.036.092.046.14.003.014-.02.033-.04.05-.124-.098-.24-.194-.354-.291-.011-.01-.016-.027-.025-.042zM8.396 9.412c.195-.032.39-.06.588-.05a.54.54 0 01.148.026c.202.071.402.147.601.224.028.01.05.036.075.055l-.013.027a9.203 9.203 0 01-.26-.089c-.115-.038-.213-.077-.315-.098-.25-.05-.25-.046-.292-.014l.574.144c.275.139.55.276.823.417.042.022.09.057.107.098.026.06.063.076.117.072.066-.006.132-.017.213-.027l-.04.086c.051.08.142.02.216.064-.074.13-.247.09-.334.199l.061.074-.12.087c0 .106-.038.168-.306.243l.026.085-.196.042.07.124h-.25l-.007.137c-.081-.01-.161-.018-.244-.027l-.053.123c-.027-.008-.052-.011-.073-.023-.067-.038-.128-.056-.195.006-.019.017-.063.014-.093.008-.026-.006-.05-.029-.07-.042-.11.095-.11.095-.208.003-.057.046-.12.074-.186.011-.063.027-.123-.02-.178-.014-.07.007-.097-.035-.133-.07l-.13.033c-.013-.236-.194-.19-.34-.203.005-.072.05-.092.095-.094a.474.474 0 01.159.022c.164.05.32.12.496.138.203.021.405.029.601-.015.265-.059.52-.149.707-.365.049-.056.083-.127.117-.195.019-.038.02-.084-.02-.116a1.397 1.397 0 00-.382-.217c.024.12-.031.182-.115.221 0 .014-.004.025 0 .03.08.115.084.16-.007.267a1.39 1.39 0 01-.218.211.477.477 0 01-.641-.05 1.36 1.36 0 01-.133-.152c-.078-.107-.076-.108-.033-.236-.165-.08-.128-.226-.104-.364.008-.05.028-.096.049-.163-.04.014-.067.017-.087.032a.897.897 0 00-.316.357c-.007.016-.01.034-.02.047-.012.015-.034.038-.045.035-.02-.006-.037-.027-.05-.045-.008-.012-.007-.032-.012-.057h-.126l.053-.172a14.82 14.82 0 00-.039-.049l.11-.284c-.06.026-.091.044-.124.051-.03.007-.064 0-.095 0 0-.031-.01-.07.004-.092.149-.22.305-.428.593-.476z"}),s.jsx("path",{d:"M8.06 10.788c-.003-.038-.004-.075.037-.062.016.006.034.048.028.067-.01.04-.038.032-.064-.005z"}),s.jsx("path",{clipRule:"evenodd",d:"M11.981.009c.226-.012.453-.011.679 0 .247.01.495.024.74.062.401.064.798.157 1.19.273.463.138.92.299 1.356.511a7.31 7.31 0 012.948 2.642c.292.469.536.963.739 1.479.219.556.446 1.11.623 1.683.204.654.329 1.326.458 1.997.097.504.182 1.01.29 1.511.156.722.329 1.44.494 2.16.186.812.4 1.615.63 2.415.102.355.193.713.282 1.072.11.436.202.876.254 1.323.031.278.066.557.073.837a7.56 7.56 0 01-.017.88c-.037.413-.1.818-.226 1.212a5.017 5.017 0 01-.915 1.649l-.13.156.018.023c.043-.023.088-.041.127-.068.2-.138.373-.307.531-.49.4-.46.721-.973.975-1.529a3.59 3.59 0 00.325-1.72c-.024-.424-.097-.834-.3-1.213-.013-.027-.015-.06-.03-.121.05.035.082.048.101.072.107.13.22.258.315.398.33.494.46 1.052.486 1.64a3.75 3.75 0 01-.47 1.97c-.36.655-.887 1.14-1.526 1.506-.193.111-.394.21-.595.308-.157.078-.248.211-.318.365a.522.522 0 00-.033.406.359.359 0 01.013.139c-.005.077-.077.155-.14.162-.054.006-.125-.043-.15-.116a1.206 1.206 0 01-.06-.233c-.04-.314-.155-.6-.308-.87a3.906 3.906 0 00-.73-.91 2.129 2.129 0 00-.897-.524 4.093 4.093 0 00-.692-.131c-.075-.008-.15-.04-.22.01.18.06.363.11.538.18.434.173.82.43 1.18.728.308.255.58.543.794.884.098.155.186.315.227.496.027.123.042.25.067.375.013.062-.002.109-.053.144-.047.033-.122.034-.163-.01a.455.455 0 01-.08-.14c-.03-.073-.038-.159-.078-.225a7.314 7.314 0 00-1.423-1.664c-.16-.137-.329-.26-.537-.323-.376-.114-.753-.203-1.15-.154-.213.025-.427.032-.64.053a1.6 1.6 0 00-.736.278 5.14 5.14 0 00-.834.72c-.329.342-.642.699-.955 1.055-.136.155-.264.319-.314.531a5.227 5.227 0 00-.012.051.096.096 0 01-.09.076h-.31c-.046 0-.082-.048-.072-.094.023-.108.045-.216.07-.324.075-.325.19-.635.368-.917.024-.039.04-.088.104-.08l.01.049.027.077c.28-.435.571-.834.996-1.135.283-.204.584-.378.89-.55a.196.196 0 00-.098-.002c-.162.043-.325.084-.485.134-.402.124-.764.33-1.11.566-.147.1-.298.193-.414.333a7.314 7.314 0 00-1.07 1.767.845.845 0 00-.04.12.075.075 0 01-.072.056h-.494c-.04 0-.062-.051-.036-.082.123-.14.246-.282.377-.415.275-.281.58-.532.777-.884.027-.048.063-.09.095-.135.238-.333.54-.607.818-.902.082-.086.175-.16.26-.24.029-.027.053-.057.079-.085l-.018-.025-.135.041c-.034.017-.07.031-.102.05-.248.144-.494.292-.743.433-.408.23-.825.439-1.209.711-.281.2-.591.358-.889.533-.02.012-.044.015-.08.028-.015-.135.143-.201.108-.336-.033.014-.064.02-.085.038-.111.096-.227.19-.328.296-.148.157-.284.325-.425.488-.125.143-.25.286-.373.431A.153.153 0 019.89 24H8.762a.316.316 0 00.016-.042c.028-.09.085-.172.083-.28-.091-.018-.162.001-.212.077a4.45 4.45 0 00-.136.215c-.01.016-.024.03-.042.03h-.093c-.019 0-.029-.022-.017-.037.071-.088.14-.178.209-.268.001-.002-.006-.012-.012-.024-.014.004-.03.006-.045.013-.176.09-.352.181-.527.274a.363.363 0 01-.168.042H5.202c-.026 0-.039-.036-.019-.053.21-.178.402-.374.558-.605.335-.496.538-1.047.667-1.629.004-.02-.003-.043-.006-.091-.037.048-.059.072-.076.1a1.943 1.943 0 01-.334.415c-.28.258-.59.448-.983.464-.297.012-.588 0-.865-.127-.46-.21-.722-.57-.794-1.072-.025-.17-.017-.171-.182-.219A3.513 3.513 0 011.97 20.6a2.286 2.286 0 01-.808-1.13 3.569 3.569 0 01-.16-1.245c.002-.034.016-.067.024-.1.032.023.046.043.05.066.033.153.059.308.096.46.086.355.257.664.516.92.258.256.571.419.91.532.358.118.717.138 1.07-.016a1.89 1.89 0 00.621-.452c.328-.348.533-.76.648-1.223.009-.034.005-.071.007-.11-.015.006-.026.006-.03.011-.031.05-.064.1-.093.152-.284.502-.679.887-1.196 1.135-.351.17-.718.255-1.11.159a1.607 1.607 0 01-.971-.64 2.006 2.006 0 01-.368-.924 2.903 2.903 0 01.02-.886c.05-.439.466-1.17.742-1.271-.02.063-.035.112-.053.16-.043.116-.097.227-.13.345a1.901 1.901 0 00-.05.82c.033.212.09.416.204.6.147.236.346.407.62.465.11.023.225.014.338.018a.576.576 0 00.386-.131c.164-.128.282-.292.366-.481.168-.375.24-.777.309-1.179.05-.296.093-.594.133-.893.039-.281.071-.563.104-.845.026-.232.048-.464.074-.696.024-.228.052-.455.076-.683.024-.227.047-.455.069-.683.013-.14.022-.28.034-.42l.037-.417c.022-.25.041-.5.065-.748.008-.082-.02-.132-.09-.177a2.46 2.46 0 01-.492-.418c-.1-.109-.188-.228-.282-.342-.035-.042-.056-.097-.116-.118a2.084 2.084 0 00.275.597c.06.092.131.176.196.265.063.086.182.115.234.226-.028.003-.046.01-.06.006a4.74 4.74 0 01-.22-.057 2.71 2.71 0 01-1.287-.819c-.435-.487-.656-1.076-.71-1.723a5.206 5.206 0 01.014-1.06c.072-.602.22-1.186.45-1.745.155-.376.338-.741.526-1.102.205-.393.466-.75.765-1.076.512-.559 1.104-1.024 1.726-1.448.717-.49 1.478-.898 2.277-1.233C8.244.828 8.767.632 9.31.494c.655-.166 1.31-.33 1.982-.415.229-.03.458-.058.688-.07zm-1.847 22.82c-.07.06-.147.111-.207.18-.238.27-.464.549-.668.869l-.044.108a.177.177 0 00.093-.057c.174-.19.351-.378.519-.574.104-.122.195-.255.288-.386.024-.034.03-.08.046-.12l-.027-.02zm1.65-3.695a5.51 5.51 0 00-.653.593l-.37.386a.963.963 0 01-.377.25 1.372 1.372 0 01-.467.09c-.044 0-.087.006-.151.012.028.058.043.097.064.131.15.242.301.482.45.724.136.22.276.438.399.666.068.125.105.267.156.404.077.027.14-.018.202-.048.29-.135.579-.274.867-.412.213-.101.437-.186.636-.31.347-.215.68-.455 1.018-.685.015-.01.026-.028.042-.046-.023-.019-.038-.037-.056-.044-.287-.111-.527-.3-.77-.482a5.319 5.319 0 01-.506-.42 1.757 1.757 0 01-.41-.653c-.019-.049-.045-.095-.075-.156zm-5.847.264c-.06.096-.097.194-.132.293a3.38 3.38 0 01-.555 1.01c-.2.25-.455.412-.762.493-.23.06-.464.076-.7.07-.048-.002-.097.002-.158.005.016.04.021.066.035.085.1.145.23.246.4.295.157.046.316.034.498.023.181-.037.343-.115.485-.234.238-.199.402-.454.536-.732.175-.363.264-.751.342-1.144.01-.053.008-.11.011-.164zm14.945-4.586c.008.029.016.057.027.107.024.155.051.31.072.464.03.219.067.437.078.657.017.344.027.689-.014 1.033-.037.315-.063.633-.116.946a6.153 6.153 0 01-.46 1.518c-.008.018-.01.039-.02.082.047-.03.077-.042.098-.064.085-.083.17-.167.248-.255.271-.305.458-.66.596-1.043.18-.498.228-1.011.145-1.531-.103-.65-.33-1.263-.597-1.881a9.055 9.055 0 00-.024-.055l-.033.022zM5.797 8.29a.26.26 0 00.018.153c.124.251.25.501.379.75.025.049.066.09.03.163-.284.06-.578.119-.88.255.059.038.097.06.132.087.042.032.112.058.09.12-.01.033-.075.048-.117.072.017.01.043.021.067.036.166.102.33.207.447.368.138.192.229.404.188.644-.079.469-.306.85-.69 1.132-.054.04-.106.083-.161.122a.243.243 0 00-.103.245.77.77 0 00.055.195c.083.196.22.35.375.492.083.076.159.164.222.257a.37.37 0 01.025.377c-.023.05-.05.099-.076.148-.03.06-.028.111.022.162.041.042.08.089.112.138.038.058.078.079.147.05a.486.486 0 01.333-.006c.16.046.302.126.444.21.13.077.264.149.4.219.067.035.14.05.219.026.071-.022.124.01.145.076.02.064-.003.108-.074.139-.07.03-.137.063-.209.088-.1.035-.201.073-.314.077-.013-.107.11-.088.127-.159-.206-.126-.643-.145-.801-.034.063.112.035.21-.096.313-.13-.1-.025-.202.002-.3a.209.209 0 00-.249.17c-.015.101.067.216.178.224.108.007.218-.005.326-.012.06-.005.12-.027.199 0-.103.123-.248.127-.357.19.002.05.07.086.019.131-.053.048-.095-.001-.132-.03-.08-.063-.16-.126-.231-.197a.474.474 0 01-.157-.311.52.52 0 00-.043-.172c-.032-.074-.032-.137.033-.19-.018-.03-.028-.053-.045-.072a1.222 1.222 0 01-.196-.369c-.053-.137-.046-.264.048-.381.024-.03.05-.06.064-.095a.664.664 0 00.047-.168c.017-.165-.064-.287-.182-.387-.186-.156-.36-.322-.46-.551-.005-.011-.024-.017-.037-.026-.011.017-.024.027-.025.038-.019.185-.045.37-.052.557-.014.377.058.743.162 1.104.118.41.289.798.488 1.173.267.502.537 1.002.812 1.5.055.098.13.189.208.27.198.202.452.272.724.273.202 0 .404-.006.605-.026.295-.03.59-.073.884-.113.183-.025.365-.057.548-.08.21-.026.38.073.522.21.16.156.305.327.447.5.22.265.397.56.554.867.05.098.07.1.147.03.13-.121.26-.242.394-.36.067-.059.088-.12.067-.213a3.535 3.535 0 01-.085-.796c.002-.157.006-.314.018-.471.015-.224.03-.45.06-.672a59.114 59.114 0 01.362-2.298c.087-.493.182-.984.268-1.477.06-.347.118-.694.162-1.043.034-.273.055-.55.063-.825.011-.332.003-.665.002-.998 0-.077.004-.155-.01-.23-.028-.142-.01-.155-.162-.19a5.826 5.826 0 00-.607-.107c-.146-.018-.207-.053-.221-.19-.006-.049-.025-.098-.041-.146-.009-.025-.024-.048-.046-.09l-.025.264c-.009.096-.029.116-.127.115-.055 0-.11-.008-.164-.008-.476 0-.952-.008-1.426.032-.095.008-.173-.015-.226-.103-.04-.066-.088-.126-.134-.186-.063-.084-.086-.093-.182-.06-.195.068-.388.138-.582.21a2.71 2.71 0 00-.675.394.986.986 0 01-.323.168c-.033.01-.07.008-.127.013.02-.066.024-.114.047-.15.064-.105.135-.205.205-.306.023-.033.049-.063.073-.095l-.015-.023-.201.037c-.146.04-.296.07-.437.122-.148.053-.266.023-.386-.072a3.623 3.623 0 01-.733-.786l-.093-.132zm8.592 8.963l-.147.09c-.22.134-.44.266-.659.402-.093.058-.184.12-.27.188-.085.07-.124.161-.072.272.047.1.093.2.147.294.047.08.124.138.213.147.11.01.228.012.336-.012.217-.05.372-.205.528-.357a.291.291 0 00.087-.308c-.046-.18-.079-.365-.118-.547-.011-.052-.027-.103-.045-.169zm-.257-2.409c-.12.291-.205.597-.325.91-.151.433-.294.87-.435 1.323.036-.01.054-.01.067-.018.261-.16.522-.324.785-.484.054-.033.071-.078.065-.138-.012-.13-.024-.262-.034-.393l-.068-.886c-.008-.103-.02-.206-.029-.31-.009 0-.017-.002-.026-.004zm3.081-8.13l.099.285c.08.231.159.463.24.714l.58 1.952c.187.63.372 1.262.558 1.893.114.382.235.762.343 1.146.072.257.126.519.186.799.044.206.087.413.127.64.034.106.023.226.077.325l.025-.006-.068-.362c-.038-.206-.077-.412-.113-.638-.015-.07-.029-.141-.046-.211-.095-.396-.177-.796-.29-1.187-.196-.685-.413-1.364-.618-2.046-.165-.549-.322-1.1-.488-1.648-.069-.227-.15-.45-.226-.695l-.117-.336c-.037-.107-.075-.216-.115-.322-.04-.106-.084-.21-.127-.314a7.558 7.558 0 01-.027.01zM6.225 14.304c-.063-.001-.115.014-.134.083a.35.35 0 00.41.012 4.533 4.533 0 00-.276-.095zM5.23 11.98c-.026-.027-.057-.048-.075.002-.012.032-.007.07-.01.113.082-.037.082-.037.085-.115zm.062-1.189a.135.135 0 00-.088.056.197.197 0 00-.025.11c.005.152.01.306.026.457a.751.751 0 00.066.218c.061.136.157.167.288.101.055-.027.06-.054.025-.11a4.52 4.52 0 01-.129-.211c-.015-.068-.066-.131-.033-.207.04-.09-.076-.116-.074-.19V10.874c-.003-.038-.006-.087-.056-.083zm-.017-.968a.867.867 0 00-.467.127c-.076.045-.084.07-.05.158.034.087.07.173.115.254.064.117.09.125.21.077a.657.657 0 01.336-.053c.202.022.357.136.504.264l.092.077c.007-.006.014-.013.022-.018-.019-.105-.035-.226-.149-.264-.157-.053-.324-.075-.508-.117l-.24-.005c.24-.169.452-.044.687.009-.063-.115-.153-.147-.23-.193-.082-.05-.17-.092-.25-.144-.06-.037-.12-.08-.072-.172zm10.233.325c-.23-.01-.427.08-.608.211-.034.026-.06.065-.105.117.087.026.15.046.232.065.044-.015.088-.03.13-.046.306-.114.61-.115.904.031.126.063.237.04.366-.005-.02-.031-.03-.054-.045-.071a.986.986 0 00-.448-.273c-.14-.044-.284-.024-.426-.03zM7.99 6.483a.308.308 0 00.002.133c.08.321.156.643.242.962.104.387.27.75.456 1.103.02.037.061.08.098.087a.404.404 0 00.253-.051l-.472-.84c-.23-.448-.405-.92-.579-1.394zM10.397.497c-.2-.008-.405.004-.603.034-.236.035-.47.087-.7.152-.287.08-.569.18-.852.273-.04.013-.074.038-.11.058.028.014.05.018.07.014.287-.068.58-.085.873-.09.134-.002.269.009.402.025.19.024.382.048.57.09.456.104.874.3 1.265.556.464.306.888.66 1.257 1.078.205.232.395.475.56.739.17.274.315.561.449.856.273.601.456 1.232.6 1.876.04.173.07.348.1.524.017.104.065.167.17.19.122.028.2.105.22.251-.003.102-.06.174-.129.24a1.065 1.065 0 00-.268.358.164.164 0 00.083-.039c.08-.086.162-.172.235-.265a.56.56 0 00.13-.333c.009-.05.022-.1.024-.15.007-.124-.017-.15-.143-.168-.025-.004-.049-.014-.073-.015-.082-.007-.125-.063-.137-.131-.033-.198-.004-.355.247-.408.086-.018.174-.03.26-.042.158-.023.315-.053.473-.067.14-.012.19.033.226.167.008.029.018.057.021.087.019.179-.008.225-.141.288-.027.013-.055.024-.078.042a.148.148 0 00-.051.067c-.039.144.073.382.206.445l.673.32c.023.011.05.015.075.023l.018-.026c-.015-.008-.032-.013-.044-.024a2.27 2.27 0 00-.544-.32 4.898 4.898 0 00-.173-.075.203.203 0 01-.126-.191c-.003-.085.045-.154.128-.187l.059-.025c.099-.044.118-.076.112-.187a.384.384 0 00-.008-.063c-.067-.294-.123-.59-.205-.88a9.478 9.478 0 00-.826-2.036 7.465 7.465 0 00-1.39-1.805 4.536 4.536 0 00-1.177-.824 3.656 3.656 0 00-1.016-.328 6.155 6.155 0 00-.712-.074zm6.719 5.955c.01.014.018.028.038.034l-.022-.044-.016.01zM4.103 3.917a.062.062 0 01-.03.012.455.455 0 01-.04.039c-.01.01-.02.02-.045.04l-.363.354c-.088.085-.17.178-.266.253-.284.22-.425.53-.544.855a.132.132 0 00-.007.071c.013.055.033.108.052.168l.074.026c-.017.056-.03.105-.047.152-.058.164-.118.327-.175.491-.005.015.008.036.019.077.08-.175.158-.33.225-.489.228-.544.484-1.074.819-1.561.09-.133.182-.266.283-.401.004-.006.007-.013.022-.03.001-.016.003-.032.015-.04l.008-.017zm12.976 2.408a.023.023 0 01.009.019.073.073 0 00-.006.01.188.188 0 00.007.02l.018.022c.002-.007.007-.016.005-.021-.003-.01-.012-.018-.02-.038a1.331 1.331 0 01-.013-.012zM4.199 4.48c-.003.004-.008.008-.027.014-.005.013-.011.025-.031.047a2.085 2.085 0 01-.124.167c-.048.07-.116.055-.181.041-.134-.028-.228.016-.287.143-.089.187-.187.37-.273.56-.049.108-.11.216-.118.36.081.003.154.007.228.008h.228a2.563 2.563 0 01-.079.264c-.01.052-.022.103-.033.155l.02.004c.018-.046.037-.092.067-.153.066-.142.13-.285.2-.426.02-.04.034-.1.116-.092 0 .043.004.084 0 .124-.005.045-.017.09-.028.143.141.043.086.174.115.269.102-.022.104-.195.248-.144v.205l.017.002.439-1.059c-.13 0-.246-.02-.358.033-.024.011-.058-.001-.108-.004.075-.15.139-.278.211-.417a.128.128 0 01.025-.036c0-.015-.001-.03.008-.038l.006-.02c-.005.006-.01.011-.028.017-.004.012-.009.024-.026.045a.085.085 0 01-.032.033c-.123.157-.09.164-.258.106-.079-.027-.078-.028-.047-.144.028-.046.056-.093.098-.15 0-.016-.001-.032.007-.042L4.2 4.48zm2.073-.67c-.003.006-.007.011-.027.016-.094.125-.194.246-.28.377-.155.238-.301.481-.451.723-.14.224-.345.368-.575.481-.017.008-.04.006-.079.011.012-.059.016-.109.033-.153a6.076 6.076 0 01.229-.518l-.007-.02a.138.138 0 01-.035.025c-.028.05-.055.1-.093.164-.26.424-.443.817-.442.95.024.004.048.011.073.013.177.013.188.007.26-.165.03-.07.077-.12.147-.15l.175-.07c.044-.018.085-.057.146-.032.003.05-.01.11.014.145.042.062.044.125.047.193.002.049.017.098.026.147.029-.034.039-.065.05-.097.142-.39.277-.782.428-1.17.1-.256.22-.504.33-.756.013-.03.013-.067.03-.092V3.81zm3.987-.34c0 .045.01.084.021.123.042.16.094.318.124.48.024.133.023.27.028.406 0 .033-.019.067-.032.11-.094-.058-.047-.158-.106-.215h-.125c-.015.072-.01.152-.046.2-.066.085-.155.154-.236.227-.043.038-.078.018-.103-.025l-.046-.087c-.065.035-.117.069-.172.093-.116.051-.235.095-.35.147-.085.038-.09.053-.07.147.014.075.034.148.047.223.013.072.05.109.123.124.233.05.462.115.657.265.058-.102.058-.102.168-.151.03-.014.06-.03.092-.042.08-.03.115-.017.15.06.023.048.041.098.066.158.06-.14-.042-.267.017-.416.157.18.24.39.375.567a.235.235 0 00.022-.098c.002-.124 0-.247.002-.371 0-.034.013-.067.02-.1l.032-.003c.11.155.13.354.226.52a3.036 3.036 0 00-.01-.392c-.004-.045 0-.074.05-.088.08.036.116.14.215.158-.03-.275-.423-1.137-.798-1.635-.114-.127-.2-.28-.34-.386zm-2.667.696c-.019.034-.03.05-.037.067-.061.185-.125.37-.18.556-.031.105-.087.169-.195.19-.09.019-.178.052-.268.073-.038.009-.089.015-.118-.003-.024-.016-.025-.069-.036-.106-.064.076-.082.087-.17.047-.133-.062-.262-.135-.393-.201-.048-.025-.093-.063-.17-.03-.043.12-.091.25-.137.382-.099.28-.087.242.095.453.046.048.102.03.154.023.054-.009.106-.03.16-.036.13-.013.26-.08.367-.015.204-.064.387-.122.571-.178.05-.015.089.005.114.054.022.042.034.093.082.121.038-.056-.013-.128.063-.178l.14.241-.042-1.46zm.278.358c-.096-.01-.107.01-.11.108-.002.038-.003.078.002.115.03.2.099.386.174.57.002.006.012.01.022.015l.078-.05c.052.036.081.088.153.088.205-.002.41.014.616.012.099-.001.158.042.205.12.018.03.024.077.088.066l-.08-.394c-.05-.195-.085-.395-.172-.589-.057.057-.114.068-.18.046a.72.72 0 00-.135-.028c-.22-.028-.44-.059-.66-.08zm10.254-1.727c.089.163.155.316.139.491-.016.168.026.342-.044.516-.047-.033-.088-.082-.112-.075-.117.035-.164-.057-.227-.115a4.772 4.772 0 01-.286-.29l-.104-.113a4.856 4.856 0 01-.023.019c.035.046.07.093.11.156.04.064.084.127.122.193.034.058.065.118.031.205-.082-.01-.164-.019-.246-.032-.06-.01-.101 0-.124.07-.031.098-.037.096-.15.09.02.042.036.08.057.116.041.074.03.138-.03.196-.06.06-.118.122-.178.181a.175.175 0 01-.185.046c-.222-.061-.447-.113-.67-.174-.032-.009-.063-.04-.086-.068-.03-.04-.052-.087-.08-.13-.044-.07-.09-.138-.136-.207a.18.18 0 00-.014.105c.012.127.03.253.035.38.005.1-.024.12-.121.104-.104-.017-.206-.04-.31-.058-.064-.012-.131-.028-.202.03l.081.208c.09 0 .166-.01.237.002a.819.819 0 01.458.251c.078.083.154.168.241.26l.018-.005c-.004-.006-.008-.013-.01-.04.014-.056-.062-.118.018-.178.031.03.064.057.088.09.058.078.111.159.169.257l.089.141.024-.013a2093.819 2093.819 0 01-.427-.934c.055.007.083.007.108.016.193.07.385.142.577.216.074.028.147.06.219.094.062.028.112.018.157-.033.05-.056.102-.112.154-.167.05-.051.095-.046.132.014.016.025.026.053.04.08.071.138.143.277.217.433l.159.308.025-.011c-.044-.106-.07-.218-.138-.334-.057-.182-.168-.346-.206-.545.136.034.362.326.567.732l.057.074.018-.011a1.563 1.563 0 01-.052-.127c-.046-.145-.097-.29-.136-.436-.022-.083-.036-.173.022-.26l.109.058-.026-.207.027-.016c.022.02.05.036.065.06.073.108.143.22.215.33.01.016.029.029.043.043-.036-.217-.2-.38-.229-.626l.155.112c.014-.166.012-.319.042-.465.032-.158-.023-.297-.063-.445.024.004.036.006.055.025.092.124.183.249.277.371.02.027.05.047.069.087l.04.063.019-.015a.293.293 0 01-.053-.082 27.922 27.922 0 01-.332-.49c-.221-.311-.363-.467-.485-.521zm-6.57.327c-.003.161.092.275.069.415l-.368.087c.09.139.032.237-.052.331-.05.057-.092.122-.143.178-.037.04-.046.078-.018.126l.16.275c.029.048.072.066.128.064.076-.003.152 0 .228-.001.116-.003.216.022.275.137.006.014.02.024.044.052.004-.059-.003-.098.01-.13.016-.04.04-.099.072-.108.084-.023.173-.024.26-.03.013-.001.027.018.04.029l.071.065c.019-.11-.082-.198-.024-.31l.126.04c-.026-.123-.07-.245-.071-.366 0-.123.051-.243.115-.36.107.062.16.156.234.253.183.265.36.533.494.834.165-.078.27.068.407.088-.003-.106-.133-.441-.197-.492a.142.142 0 00-.102-.028c-.06.011-.119.039-.191.063-.025-.039-.056-.078-.077-.122a3.936 3.936 0 00-.473-.783c-.076-.094-.16-.182-.228-.26l-.391.285c-.049.035-.094.03-.132-.017l-.169-.207c-.025-.03-.053-.059-.097-.108z"})]})}function Lte({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:s.jsx("path",{d:"M4 2.2 20.6 12 12.7 13.9 10.4 21.8z"})})}const zte="M69.7784 34.9999C69.7784 39.871 68.7523 44.7296 66.7851 49.1832C64.9333 53.3744 62.2559 57.1874 58.9467 60.3483C55.8445 63.3119 52.1983 65.6915 48.2409 67.3356C44.5469 68.8705 40.5934 69.7611 36.6016 69.9583C32.8943 70.1403 29.1612 69.7256 25.5837 68.7326C22.2821 67.8153 19.1179 66.4087 16.2238 64.5701C6.14513 58.167 0 46.9674 0 34.9999C0 30.1288 1.0261 25.2701 2.99334 20.8165C7.82793 9.87552 17.9696 2.13463 29.7702 0.378474C33.1587 -0.126158 36.6197 -0.126158 40.0082 0.378474C43.6802 0.925238 47.2606 2.06281 50.5756 3.73662C54.1464 5.5397 57.4013 7.96136 60.157 10.8656C63.1112 13.9777 65.4831 17.6355 67.122 21.6056C68.8707 25.8408 69.7784 30.416 69.7784 34.9999ZM45.0815 25.5794C45.4136 26.1492 45.6484 26.7544 45.7315 27.4122C46.0379 29.8319 44.3112 32.0065 41.8829 32.2163C41.3665 32.2613 40.8425 32.2134 40.3414 32.0803C39.3229 31.8093 38.4123 31.185 37.7852 30.3366C37.496 29.9449 37.2574 29.5121 36.9996 29.1013C35.8351 27.2465 34.6239 25.4224 33.361 23.6346C32.9707 23.0802 32.5745 22.5296 32.1727 21.9829C31.8825 21.5864 31.5647 21.2024 31.347 20.7581C30.8163 19.679 30.845 18.3997 31.4282 17.3473C32.7244 15.008 36.0136 14.5091 38.1575 15.9273C38.8008 16.3534 39.2408 16.9404 39.6904 17.5532C40.0417 18.031 40.3881 18.5117 40.7308 18.9953C41.7388 20.4163 42.7133 21.8603 43.6583 23.3234C44.1403 24.0694 44.6348 24.8124 45.0815 25.5794ZM60.3288 19.2126C60.6056 19.7766 60.8261 20.3636 60.933 20.9851C61.1697 22.3515 60.786 24.0856 59.1232 24.1718C58.8398 24.1862 58.5553 24.1469 58.2814 24.0732C57.8595 23.9583 57.4624 23.762 57.0968 23.5216C56.2464 22.9634 55.5515 22.1686 55.0418 21.2905C54.8432 20.9468 54.6724 20.5867 54.4853 20.2363C54.1951 19.6905 53.8925 19.1514 53.5795 18.618C52.2536 16.3677 50.7092 14.2956 49.0159 12.3134C48.2838 11.4564 47.2348 9.80561 48.1426 8.71974C48.5234 8.26395 49.1429 8.11553 49.7118 8.11457C50.8963 8.11361 52.0685 8.64601 53.0306 9.30194C54.2037 10.1034 55.0971 11.2448 55.9667 12.3537C57.6323 14.4775 59.1385 16.7843 60.3288 19.2126Z";function Pte({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 70 70",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:zte})})}const Dte=new Set(["claudeAgent","mistral","meta","museCode","kimiAgent","qwenAgent","deepseekAgent","greenference","modelgo","kiroAgent"]),$te=new Set(["openai","xai","ollama"]);function Bte(e){return e.icon?.kind==="custom"?"brand":e.icon?.kind==="preset"?$te.has(e.icon.preset)?"mono":"brand":Dte.has(e.driverKind)?"brand":"mono"}const Fte={brand:"opacity-60 group-hover:opacity-100 group-focus-within:opacity-100 touch:opacity-60",mono:"[--color-ink:var(--color-ink-tertiary)] [--color-ink-secondary:var(--color-ink-tertiary)] group-hover:[--color-ink:inherit] group-hover:[--color-ink-secondary:inherit] group-focus-within:[--color-ink:inherit] group-focus-within:[--color-ink-secondary:inherit]"};function A2({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),children:[s.jsx("path",{d:"M9.26905 15.284L17.2479 9.36086C17.6391 9.07047 18.1981 9.18374 18.3845 9.63478C19.3655 12.0135 18.9272 14.8721 16.9755 16.8349C15.0238 18.7976 12.3082 19.228 9.8261 18.2477L7.1146 19.5102C11.0037 22.1834 15.7263 21.5223 18.6774 18.5525C21.0182 16.1985 21.7432 12.9897 21.0653 10.0961L21.0714 10.1023C20.0884 5.85143 21.3131 4.15233 23.8218 0.677913C23.8812 0.595532 23.9406 0.513151 24 0.428711L20.6987 3.74866V3.73836L9.267 15.2861"}),s.jsx("path",{d:"M7.62249 16.7237C4.83113 14.0422 5.3124 9.89222 7.69417 7.49905C9.45541 5.72786 12.341 5.00497 14.86 6.06768L17.5653 4.81138C17.0779 4.45714 16.4533 4.07613 15.7365 3.80839C12.4966 2.46764 8.6178 3.13492 5.98413 5.78141C3.45081 8.32904 2.65415 12.2463 4.02219 15.5889C5.04412 18.0871 3.36889 19.8541 1.68137 21.6377C1.08337 22.2699 0.483318 22.9022 0 23.5716L7.62045 16.7257"})]})}function T2({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 256 257",preserveAspectRatio:"xMidYMid",className:I("fill-[#d97757]",t),children:s.jsx("path",{d:"m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z"})})}function hc({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 256 260",preserveAspectRatio:"xMidYMid",className:I("fill-[var(--color-ink)]",t),children:s.jsx("path",{d:"M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z"})})}function M2({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:[s.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z",fill:"#1783FF"}),s.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z",fill:"var(--color-ink)"})]})}function Ute({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 508 508",className:t,"aria-hidden":!0,children:s.jsx("path",{fill:"var(--color-ink)",d:"M321.997 150.712C321.401 150.568 320.844 150.299 320.363 149.925C319.883 149.551 319.491 149.08 319.215 148.544C318.938 148.008 318.783 147.42 318.76 146.821C318.738 146.22 318.848 145.624 319.084 145.07C327.226 125.716 330.819 110.23 325.021 103.747C309.666 86.5471 248.085 120.749 228.451 132.333C227.925 132.642 227.337 132.837 226.728 132.903C226.118 132.969 225.501 132.906 224.918 132.719C224.336 132.531 223.801 132.223 223.351 131.815C222.902 131.407 222.548 130.909 222.313 130.356C214.06 111.043 205.384 97.6094 196.589 97.0268C173.279 95.4688 154.491 162.187 148.991 183.932C148.844 184.515 148.57 185.06 148.188 185.528C147.805 185.998 147.323 186.381 146.775 186.651C146.227 186.921 145.626 187.072 145.012 187.094C144.399 187.116 143.788 187.009 143.221 186.778C123.406 178.825 107.545 175.316 100.914 180.98C83.305 195.978 118.315 256.126 130.175 275.304C130.492 275.816 130.692 276.391 130.76 276.987C130.829 277.582 130.765 278.186 130.573 278.755C130.381 279.325 130.065 279.847 129.647 280.286C129.228 280.725 128.718 281.07 128.15 281.298C108.384 289.359 94.6306 297.834 94.0272 306.424C92.439 329.192 160.74 347.544 183.01 352.916C183.605 353.061 184.16 353.33 184.64 353.704C185.118 354.077 185.509 354.548 185.785 355.083C186.061 355.618 186.215 356.205 186.237 356.803C186.26 357.402 186.151 357.998 185.916 358.551C177.773 377.905 174.181 393.398 179.979 399.874C195.334 417.074 256.921 382.877 276.556 371.293C277.081 370.984 277.67 370.789 278.28 370.722C278.889 370.655 279.507 370.717 280.09 370.905C280.673 371.093 281.207 371.402 281.657 371.81C282.106 372.219 282.46 372.717 282.694 373.271C290.947 392.578 299.616 406.012 308.417 406.601C331.728 408.153 350.516 341.44 356.009 319.688C356.157 319.106 356.432 318.562 356.816 318.094C357.2 317.625 357.682 317.243 358.231 316.974C358.779 316.705 359.381 316.554 359.995 316.533C360.608 316.511 361.219 316.619 361.786 316.85C381.601 324.803 397.455 328.304 404.093 322.648C421.702 307.65 386.684 247.495 374.825 228.317C374.51 227.804 374.312 227.229 374.245 226.634C374.177 226.039 374.242 225.436 374.434 224.868C374.626 224.299 374.941 223.777 375.358 223.338C375.775 222.899 376.284 222.552 376.85 222.323C396.623 214.261 410.376 205.786 410.973 197.196C412.568 174.428 344.26 156.078 321.997 150.712ZM295.254 128.885C299.734 136.73 276.646 189 259.474 225.561C259.186 226.172 258.715 226.682 258.121 227.024C257.528 227.365 256.842 227.521 256.155 227.47C255.468 227.419 254.814 227.164 254.28 226.739C253.746 226.314 253.358 225.739 253.169 225.093C246.234 201.322 238.306 173.392 229.824 149.683C229.491 148.752 229.508 147.736 229.871 146.817C230.235 145.897 230.921 145.133 231.808 144.662C252.989 133.363 289.234 118.358 295.254 128.885ZM193.746 135.355C202.589 137.807 224.103 190.714 238.424 228.426C238.664 229.056 238.699 229.742 238.527 230.393C238.354 231.044 237.983 231.627 237.461 232.065C236.939 232.503 236.292 232.775 235.608 232.844C234.923 232.913 234.234 232.775 233.632 232.45C211.501 220.453 185.694 206.159 162.529 195.253C161.622 194.823 160.901 194.093 160.493 193.192C160.085 192.292 160.018 191.279 160.303 190.335C167.12 167.736 181.865 132.069 193.746 135.355ZM126.652 210.04C134.676 205.664 188.197 228.216 225.621 244.989C226.248 245.269 226.771 245.73 227.12 246.31C227.47 246.889 227.629 247.56 227.577 248.23C227.524 248.901 227.264 249.54 226.828 250.062C226.393 250.582 225.805 250.962 225.143 251.147C200.813 257.921 172.211 265.664 147.937 273.949C146.985 274.272 145.946 274.255 145.007 273.9C144.067 273.545 143.286 272.876 142.805 272.011C131.257 251.322 115.867 215.92 126.652 210.04ZM133.275 309.188C135.779 300.551 189.952 279.537 228.562 265.548C229.207 265.315 229.91 265.28 230.576 265.448C231.243 265.617 231.84 265.98 232.288 266.49C232.736 266.999 233.015 267.631 233.085 268.299C233.155 268.968 233.015 269.641 232.682 270.23C220.392 291.846 205.758 317.053 194.592 339.672C194.156 340.561 193.409 341.269 192.486 341.668C191.563 342.068 190.525 342.134 189.557 341.853C166.42 335.235 129.905 320.792 133.275 309.188ZM209.739 374.722C205.252 366.884 228.347 314.608 245.519 278.054C245.806 277.442 246.279 276.931 246.872 276.59C247.465 276.249 248.151 276.093 248.838 276.144C249.525 276.194 250.179 276.45 250.713 276.875C251.247 277.3 251.634 277.874 251.824 278.521C258.759 302.285 266.686 330.222 275.169 353.932C275.499 354.862 275.481 355.877 275.117 356.795C274.752 357.713 274.064 358.475 273.178 358.945C252.004 370.223 215.752 385.256 209.76 374.722H209.739ZM311.247 368.252C302.397 365.807 280.883 312.894 266.562 275.182C266.322 274.55 266.285 273.862 266.458 273.21C266.63 272.559 267.003 271.974 267.526 271.536C268.049 271.097 268.697 270.826 269.382 270.758C270.068 270.69 270.759 270.83 271.361 271.157C293.485 283.154 319.299 297.455 342.457 308.362C343.366 308.789 344.089 309.519 344.497 310.42C344.905 311.321 344.971 312.335 344.683 313.28C337.872 335.912 323.128 371.544 311.247 368.252ZM378.341 293.566C370.31 297.949 316.795 275.391 279.365 258.618C278.738 258.338 278.215 257.877 277.866 257.297C277.516 256.718 277.357 256.047 277.409 255.377C277.461 254.706 277.722 254.067 278.158 253.546C278.593 253.025 279.181 252.646 279.843 252.461C304.18 245.687 332.775 237.943 357.049 229.658C358.003 229.335 359.043 229.353 359.984 229.709C360.925 230.065 361.706 230.737 362.188 231.603C373.729 252.285 389.119 287.693 378.341 293.566ZM371.718 194.419C369.207 203.063 315.041 224.077 276.431 238.066C275.784 238.3 275.08 238.335 274.413 238.167C273.746 237.999 273.148 237.635 272.698 237.124C272.249 236.613 271.972 235.98 271.903 235.31C271.833 234.641 271.975 233.966 272.311 233.377C284.594 211.768 299.228 186.554 310.394 163.935C310.833 163.048 311.58 162.343 312.502 161.945C313.425 161.546 314.462 161.481 315.429 161.76C338.566 168.413 375.081 182.815 371.718 194.419Z"})})}function qte({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:s.jsx("path",{fillRule:"evenodd",d:"M21.751 22.607c1.34 1.005 3.35.335 1.508-1.508C17.73 15.74 18.904 1 12.037 1 5.17 1 6.342 15.74.815 21.1c-2.01 2.009.167 2.511 1.507 1.506 5.192-3.517 4.857-9.714 9.715-9.714 4.857 0 4.522 6.197 9.714 9.715z"})})}function Hte({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:s.jsx("path",{fillRule:"evenodd",d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function GT({size:e=16,className:t}){const n="omb-qwen-mark";return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":!0,children:[s.jsx("path",{fill:`url(#${n})`,fillRule:"nonzero",d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:n,x1:"0%",x2:"100%",y1:"0%",y2:"0%",children:[s.jsx("stop",{offset:"0%",stopColor:"#6336E7",stopOpacity:.92}),s.jsx("stop",{offset:"100%",stopColor:"#6F69F7",stopOpacity:.92})]})})]})}function Wte({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 800 800",className:I("fill-[var(--color-ink)]",t),"aria-hidden":!0,children:[s.jsx("path",{fillRule:"evenodd",d:"M165.29 165.29 H517.36 V400 H400 V517.36 H282.65 V634.72 H165.29 Z M282.65 282.65 V400 H400 V282.65 Z"}),s.jsx("path",{d:"M517.36 400 H634.72 V634.72 H517.36 Z"})]})}function _2({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:s.jsx("path",{fill:"#5786FE",d:"M23.748 4.651c-.254-.124-.364.113-.512.233-.423.437-.857.794-1.51.763-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.789-.347-1.077-.626-1.26-1.424-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323l-.266.833c-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-1.06-1.024-1.97-2.183-3.286-2.93-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-1.27.006-2.312.621-3.152.821a9.6 9.6 0 0 0-2.883-.101c-3.75.419-5.994 3.589-5.757 7.395.218 3.496 2.247 6.521 5.258 8.037 2.52 1.269 5.649 1.474 8.484-.924.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 2.056-2.431 3.44-5.604 3.392-7.847-.004-.171.035-.238.23-.257 2.371-.246 3.642-1.764 3.838-3.992.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-2.919-1.718-4.443-4.959-4.6-7.788-.02-.385.094-.522.477-.592 2.602-.471 5.025.581 6.997 2.736 1.652 1.807 2.631 4.049 4.682 5.785.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 1 1 .614.001.306.306 0 0 1-.614 0m3.11 1.596c-.494.199-.931.222-1.389-.094-.274-.23-.47-.358-.551-.758-.122-.602.111-.903-.223-1.315-.188-.156-.426-.199-.689-.199-.454 0-.553-.298-.368-.636.356-.422.859-.442 1.338-.29.72.294 1.319 1.129 1.706 1.743.176.264.336.536.446.848.066.194-.02.353-.25.45"})})}function YT({size:e=16,className:t}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:s.jsx("path",{fill:"var(--color-ink)",d:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"})})}function Kte({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:[s.jsx("rect",{width:"24",height:"24",rx:"6",fill:"var(--color-ink)"}),s.jsx("path",{stroke:"var(--color-panel)",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",transform:"translate(4.8 4.8) scale(0.6)",d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"})]})}function JT({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",className:t,"aria-hidden":"true",children:[s.jsx("path",{fill:"#7B3FE4",d:"M12 2a7.5 7.5 0 0 0-7.5 7.5V22l2.5-1.8 2.5 1.8 2.5-1.8 2.5 1.8 2.5-1.8 2.5 1.8V9.5A7.5 7.5 0 0 0 12 2Z"}),s.jsx("circle",{cx:"9.3",cy:"10",r:"1.5",fill:"var(--color-panel)"}),s.jsx("circle",{cx:"14.7",cy:"10",r:"1.5",fill:"var(--color-panel)"})]})}function QT({size:e=16,className:t}){return s.jsxs("svg",{width:e,height:e,viewBox:"4 2 24 24",className:t,"aria-hidden":"true",children:[s.jsx("path",{stroke:"#407A84",strokeWidth:1.7,d:"M16 16V7M16 16l-8 5M16 16l8 5"}),s.jsxs("g",{fill:"#407A84",children:[s.jsx("circle",{cx:"16",cy:"7",r:"2.4"}),s.jsx("circle",{cx:"8",cy:"21",r:"2.4"}),s.jsx("circle",{cx:"24",cy:"21",r:"2.4"}),s.jsx("circle",{cx:"16",cy:"16",r:"3.8"})]})]})}function Kx({size:e=16,className:t}){const n=f.useId().replace(/\W/gu,"");return s.jsxs("svg",{width:e,height:e,viewBox:"0 18.09 31 31",fill:"none",className:t,"aria-hidden":"true",children:[s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:`${n}a`,x1:"10.5179",y1:"25.8892",x2:"2.29751",y2:"41.3335",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#5071FF"}),s.jsx("stop",{offset:"1",stopColor:"#0410FF"})]}),s.jsxs("linearGradient",{id:`${n}b`,x1:"14",y1:"29.5894",x2:"17",y2:"32.5894",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#2563EB"}),s.jsx("stop",{offset:"1",stopColor:"#16C784"})]}),s.jsxs("linearGradient",{id:`${n}c`,x1:"24.9101",y1:"35.7894",x2:"12.7635",y2:"41.9022",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#13DA74"}),s.jsx("stop",{offset:"1",stopColor:"#1F83CD"})]})]}),s.jsx("path",{fill:`url(#${n}a)`,d:"M6.31271 27.713C7.94898 25.3277 11.1777 24.7425 13.5241 26.4059C15.8703 28.0693 16.446 31.3509 14.8099 33.7361L9.42862 41.5814C7.79234 43.9665 4.56361 44.5517 2.21725 42.8885C-0.129169 41.2252 -0.704765 37.9429 0.931485 35.5577L6.31271 27.713ZM13.0071 29.9972C12.0826 28.0346 9.41394 27.8263 8.2057 29.6228L2.7953 37.6672C2.1197 38.6719 2.36677 40.0427 3.34879 40.7389L3.51215 40.8544C4.49397 41.5504 5.84429 41.3127 6.53837 40.3214L13.2065 30.7957C13.2716 30.7027 13.2818 30.581 13.2334 30.478L13.0071 29.9972Z"}),s.jsx("path",{fill:"#16C784",d:"M23.7889 27.7173C22.1526 25.3321 18.924 24.7469 16.5775 26.4103C14.2313 28.0737 13.6556 31.3559 15.2917 33.7411L21.1882 42.336C22.8245 44.7212 26.0526 45.3064 28.399 43.6431C30.7454 41.9798 31.3214 38.6981 29.6853 36.3128L23.7889 27.7173ZM17.2344 30.2879C18.159 28.3251 20.8276 28.1169 22.0359 29.9134L27.4463 37.9578C28.1218 38.9625 27.8752 40.3328 26.8934 41.0289L26.73 41.1451C25.7482 41.8411 24.3979 41.6029 23.7038 40.6115L17.0351 31.0858C16.9701 30.9928 16.9597 30.871 17.0082 30.7681L17.2344 30.2879Z"}),s.jsx("path",{fill:`url(#${n}b)`,d:"M15.6385 34.2402L15.1611 33.5552L16.944 30.958L17.3932 31.6002L15.6385 34.2402Z"}),s.jsx("path",{fill:"#16C784",d:"M19.9475 40.5176L19.5264 39.8753L21.3513 37.1641L21.7724 37.7348L19.9475 40.5176Z"}),s.jsx("path",{fill:`url(#${n}c)`,d:"M18.0466 25.5876C20.1674 24.8708 22.585 25.6165 23.9285 27.5749L29.824 36.1696C31.2186 38.2028 31.0051 40.8864 29.4587 42.6647C29.1679 43.0226 28.827 43.3488 28.4353 43.6286C26.0801 45.3106 22.8295 44.7337 21.1746 42.3395L19.8152 40.3727C19.7017 40.2086 19.5993 40.0397 19.5066 39.8678L17.9372 42.2028C16.2924 44.5816 13.0617 45.1548 10.7214 43.4831C8.38107 41.8111 7.81697 38.5263 9.46166 36.1471L15.3884 27.5739C16.064 26.5967 17.0076 25.925 18.0466 25.5876ZM26.0671 36.6413C25.269 35.4872 23.7017 35.2084 22.5662 36.0192L21.6599 36.6667L21.3845 37.0749C21.382 37.1637 21.4066 37.2543 21.4607 37.3327L23.7488 40.6422C24.4093 41.5977 25.7063 41.8282 26.6462 41.1569C27.5862 40.4854 27.8125 39.1661 27.1521 38.2106L26.0671 36.6413ZM19.7917 28.9792C18.9257 28.944 18.0396 29.3246 17.4734 30.1579L12.0144 38.196C11.3768 39.1348 11.603 40.4208 12.5212 41.0768C13.4392 41.7324 14.706 41.5139 15.3591 40.5866L19.5124 34.7692C19.8833 34.0834 20.4104 33.4711 21.0828 32.9909C21.7305 32.5282 22.446 32.2362 23.1775 32.1061L21.8943 30.1989C21.3772 29.4303 20.5925 29.0301 19.7917 28.9762V28.9792Z"})]})}function R2({driverKind:e,size:t,className:n}){switch(e){case"grok":case"grokAgent":return s.jsx(A2,{size:t,className:n});case"claudeAgent":return s.jsx(T2,{size:t,className:n});case"mistral":return s.jsx(ry,{preset:"mistral",size:t,className:n});case"meta":case"museCode":return s.jsx(ry,{preset:"meta",size:t,className:n});case"codex":return s.jsx(hc,{size:t,className:n});case"kimiAgent":return s.jsx(M2,{size:t,className:n});case"droidAgent":return s.jsx(Ute,{size:t,className:n});case"cursorAgent":return s.jsx(Lte,{size:t,className:n});case"antigravityAgent":return s.jsx(qte,{size:t,className:n});case"opencodeGo":return s.jsx(Hte,{size:t,className:n});case"qwenAgent":return s.jsx(GT,{size:t,className:n});case"hermesAgent":return s.jsx(Ote,{size:t,className:n});case"deepseekAgent":return s.jsx(_2,{size:t,className:n});case"piAgent":return s.jsx(Wte,{size:t,className:n});case"copilotAgent":return s.jsx(YT,{size:t,className:n});case"commandCodeAgent":return s.jsx(Kte,{size:t,className:n});case"kiroAgent":return s.jsx(JT,{size:t,className:n});case"greenference":return s.jsx(QT,{size:t,className:n});case"modelgo":return s.jsx(Kx,{size:t,className:n});default:return s.jsx("span",{className:I("flex size-full items-center justify-center text-[10px] font-semibold tracking-tight text-ink-secondary",n),children:(e.replace(/Agent$/i,"").slice(0,1)||"?").toUpperCase()})}}function ry({preset:e,size:t=16,className:n}){switch(e){case"openai":return s.jsx(hc,{size:t,className:n});case"anthropic":return s.jsx(T2,{size:t,className:n});case"xai":return s.jsx(A2,{size:t,className:n});case"qwen":return s.jsx(GT,{size:t,className:n});case"moonshot":return s.jsx(M2,{size:t,className:n});case"google":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#8E75B2",d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"})});case"azure":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#0089D6",d:"M22.379 23.343a1.62 1.62 0 0 0 1.536-2.14v.002L17.35 1.76A1.62 1.62 0 0 0 15.816.657H8.184A1.62 1.62 0 0 0 6.65 1.76L.086 21.204a1.62 1.62 0 0 0 1.536 2.139h4.741a1.62 1.62 0 0 0 1.535-1.103l.977-2.892 4.947 3.675c.28.208.618.32.966.32m-3.084-12.531 3.624 10.739a.54.54 0 0 1-.51.713v-.001h-.03a.54.54 0 0 1-.322-.106l-9.287-6.9h4.853m6.313 7.006c.116-.326.13-.694.007-1.058L9.79 1.76a1.722 1.722 0 0 0-.007-.02h6.034a.54.54 0 0 1 .512.366l6.562 19.445a.54.54 0 0 1-.338.684"})});case"aws":return s.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:[s.jsx("path",{fill:"var(--color-ink)",d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272-.184.08-.32.12-.407.12-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28.04-.056.112-.112.224-.167.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167z"}),s.jsx("path",{fill:"#FF9900",d:"M21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zm1.094-1.246c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"})]});case"meta":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#0467DF",d:"M6.915 4.03c-1.968 0-3.683 1.28-4.871 3.113C.704 9.208 0 11.883 0 14.449c0 .706.07 1.369.21 1.973.14.605.228.654.636 1.621.696 1.159 1.818 1.927 3.593 1.927 1.497 0 2.633-.671 3.965-2.444.76-1.012 1.144-1.626 2.663-4.32l.942-1.664.183.3 2.152 3.595c.724 1.21 1.665 2.556 2.47 3.314 1.046.987 1.992 1.22 3.06 1.22 1.075 0 1.876-.355 2.455-.843 1.175-.99 1.671-2.573 1.671-5.018 0-2.72-.681-5.357-2.084-7.45-1.282-1.912-2.957-2.93-4.716-2.93-1.047 0-2.088.467-3.053 1.308-.652.57-1.257 1.29-1.82 2.05-.69-.875-1.335-1.547-1.958-2.056-1.182-.966-2.315-1.303-3.454-1.303zm10.16 2.053c1.147 0 2.188.758 2.992 1.999 1.132 1.748 1.647 4.195 1.647 6.4 0 1.548-.368 2.9-1.839 2.9-.58 0-1.027-.23-1.664-1.004-.496-.601-1.343-1.878-2.832-4.358l-.617-1.028a44.908 44.908 0 0 0-1.255-1.98c1.19-1.85 2.25-2.929 3.569-2.929zm-10.201.553c1.265 0 2.058.791 2.675 1.446.307.327.737.871 1.234 1.579l-1.02 1.566c-.757 1.163-1.882 3.017-2.837 4.338-1.191 1.649-1.81 1.817-2.486 1.817-1.17 0-1.847-1.04-1.847-2.84 0-2.221.63-4.535 1.66-6.088.824-1.245 1.697-1.818 2.621-1.818z"})});case"mistral":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#FA520F",d:"M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z"})});case"cohere":return s.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:[s.jsx("path",{fill:"#39594D",fillRule:"evenodd",d:"M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z"}),s.jsx("path",{fill:"#D18EE2",fillRule:"evenodd",d:"M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z"}),s.jsx("path",{fill:"#FF7759",d:"M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z"})]});case"openrouter":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"#94A3B8",d:"M16.778 1.844v1.919q-.569-.026-1.138-.032-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.792.447-2.497.904-3.936 1.131v4.229c1.31.184 2.908.627 3.795 1.132 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918L24 15.038l-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z"})});case"deepseek":return s.jsx(_2,{size:t,className:n});case"ollama":return s.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",className:n,"aria-hidden":"true",children:s.jsx("path",{fill:"var(--color-ink)",d:"M16.361 10.26a.894.894 0 0 0-.558.47l-.072.148.001.207c0 .193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86 0 0 0 .517-.436.752.752 0 0 0 .08-.498c-.064-.453-.33-.782-.724-.897a1.06 1.06 0 0 0-.466 0zm-9.203.005c-.305.096-.533.32-.65.639a1.187 1.187 0 0 0-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894 0 0 0-.565-.472 1.02 1.02 0 0 0-.474.007Zm4.184 2c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365 0 0 0-.175-.48.394.394 0 0 0-.181-.033c-.126 0-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396 0 0 0-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589 1.226-1.787 2.114-.04.176-.045.234-.045.53 0 .294.005.357.043.524.264 1.16 1.332 2.017 2.714 2.173.3.033 1.596.033 1.896 0 1.11-.125 2.064-.727 2.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523 0-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873 6.873 0 0 0-.855-.031zm.645.937a3.283 3.283 0 0 1 1.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115 3.115 0 0 1-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46 1.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653 1.653 0 0 0-.683.298C5.617.74 5.173 1.666 4.985 2.819c-.07.436-.119 1.04-.119 1.503 0 .544.064 1.24.155 1.721.02.107.031.202.023.208a8.12 8.12 0 0 1-.187.152 5.324 5.324 0 0 0-.949 1.02 5.49 5.49 0 0 0-.94 2.339 6.625 6.625 0 0 0-.023 1.357c.091.78.325 1.438.727 2.04l.13.195-.037.064c-.269.452-.498 1.105-.605 1.732-.084.496-.095.629-.095 1.294 0 .67.009.803.088 1.266.095.555.288 1.143.503 1.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405 7.405 0 0 0-.548 1.873c-.062.417-.071.552-.071.991 0 .56.031.832.148 1.279L3.42 24h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915 0 0 0-.194-.25 1.74 1.74 0 0 1-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787 0 0 0 .223-.531c0-.195-.07-.355-.224-.522a3.136 3.136 0 0 1-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814 1.353-1.336 2.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467 1.352-.561.17-.035.25-.04.569-.04.319 0 .398.005.569.04a4.07 4.07 0 0 1 1.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016 1.144.23 2.14 1.173 2.581 2.437.385 1.108.276 2.267-.296 3.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001 1.053.493.539.801 1.866.708 3.036-.062.772-.26 1.463-.533 1.854a2.096 2.096 0 0 1-.224.258.916.916 0 0 0-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498 1.295.253 1.008.231 2.01-.059 2.581a.845.845 0 0 0-.044.098c0 .006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016 0-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378 0-1.628-.083-.645-.182-1.082-.348-1.525a6.083 6.083 0 0 0-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625 6.625 0 0 0-.024-1.358 5.512 5.512 0 0 0-.939-2.339 5.325 5.325 0 0 0-.95-1.02 8.097 8.097 0 0 1-.186-.152.692.692 0 0 1 .023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8 1.205-2.116 3.01a6.805 6.805 0 0 0-.097.726c0 .036-.007.066-.015.066a.96.96 0 0 1-.149-.078A4.857 4.857 0 0 0 12 3.03c-.832 0-1.687.243-2.456.698a.958.958 0 0 1-.148.078c-.008 0-.015-.03-.015-.066a6.71 6.71 0 0 0-.097-.725C8.997 1.392 8.337.319 7.46.048a2.096 2.096 0 0 0-.585-.041Zm.293 1.402c.248.197.523.759.682 1.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102 1.24l.002.475-.12.175-.118.178h-.278c-.324 0-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438 8.438 0 0 1 .016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36 2.028.212 3.145-.019.14-.024.151-.057.144l-.238-.06a3.693 3.693 0 0 0-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z"})})}}function $s({instance:e,size:t=16,className:n,subtle:a=!1}){if(a){const r=Bte(e);return s.jsx("span",{"data-provider-mark":r,className:I("inline-flex shrink-0 transition-opacity",Fte[r],n),style:{width:t,height:t},children:s.jsx($s,{instance:e,size:t})})}return e.icon?.kind==="custom"?s.jsx(Vte,{dataUrl:e.icon.dataUrl,driverKind:e.driverKind,size:t,className:n},e.icon.dataUrl):e.icon?.kind==="preset"?s.jsx(ry,{preset:e.icon.preset,size:t,className:n}):s.jsx(R2,{driverKind:e.driverKind,size:t,className:n})}function Vte({dataUrl:e,driverKind:t,size:n=16,className:a}){const[r,i]=f.useState(!1);return r?s.jsx(R2,{driverKind:t,size:n,className:a}):s.jsx("img",{src:e,alt:"",width:n,height:n,onError:()=>i(!0),className:I("rounded-[22%] object-cover",a)})}function on(e){return e.driverKind==="clineAgent"?e.snapshot.state==="available"&&e.snapshot.authenticated===!0:e.snapshot.state==="available"&&(e.access==="custom"||e.snapshot.authenticated!==!1)}const Gte={claudeAgent:"Anthropic",codex:"OpenAI",grok:"xAI",grokAgent:"xAI",kimiAgent:"Moonshot AI",droidAgent:"Factory",cursorAgent:"Cursor",antigravityAgent:"Google",opencodeGo:"OpenCode",qwenAgent:"Qwen",hermesAgent:"Nous Research",clineAgent:"Cline",copilotAgent:"GitHub",commandCodeAgent:"Command Code",kiroAgent:"Amazon Web Services",piAgent:"pi.dev",mistral:"Mistral AI",cerebras:"Cerebras",groq:"Groq",greenference:"Greenference",modelgo:"ModelGo",meta:"Meta",museCode:"Meta",deepseekAgent:"DeepSeek"};function Yte(e){return Gte[e.driverKind]??e.driverKind}function NDe({instance:e,children:t,summary:n,bare:a=!1}){if(a)return s.jsx("div",{"data-engine-card":e.instanceId,className:"min-w-0",children:t});const r=n?.ready??on(e),i=e.snapshot.authenticated===!0?e.snapshot.account?.email:void 0,o=n?.title??e.displayName,c=n?.subtitle??i??(e.access==="custom"?l("engines.library.custom"):Yte(e)),d=e.snapshot.version?.match(/\d+\.\d+(?:\.\d+)?(?:[-+][\w.-]+)?/)?.[0],u=Rte(e);return s.jsxs("details",{"data-engine-card":e.instanceId,className:"group/engine min-w-0 rounded-2xl border border-hairline/40 bg-card transition-colors open:col-span-full open:border-hairline/70 hover:border-hairline/70",children:[s.jsxs("summary",{className:"cursor-pointer list-none rounded-2xl p-4 outline-none focus-visible:ring-2 focus-visible:ring-accent [&::-webkit-details-marker]:hidden",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("span",{"aria-hidden":"true",className:"flex size-12 shrink-0 items-center justify-center rounded-xl border border-hairline/30 bg-panel",children:s.jsx($s,{instance:e,size:28})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"truncate text-[15px] font-semibold tracking-[-0.015em] text-ink",title:o,children:o}),s.jsx("div",{className:"mt-1 truncate text-[12px] text-ink-secondary",title:c,children:c})]}),s.jsx(jt,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary transition-transform group-open/engine:rotate-180 motion-reduce:transition-none"})]}),s.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("span",{className:I("inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] font-medium",r?"bg-success/10 text-success":"bg-control text-ink-secondary"),children:[r?s.jsx(Se,{size:12,"aria-hidden":"true"}):s.jsx("span",{className:"size-1.5 rounded-full bg-warning","aria-hidden":"true"}),n?.status??(r?l("onboarding.engines.ready"):e.snapshot.state==="available"&&e.snapshot.authenticated===!1?l("model.signInRequired"):l("onboarding.engines.needsSetup"))]}),n?s.jsx("span",{className:I("text-[11px] font-medium",r?"text-ink-secondary":"text-accent-text"),children:n.action}):r?s.jsx("span",{className:"text-[11px] tabular-nums text-ink-secondary",children:u?l("engines.updatedTo",{version:u}):d?`v${d}`:l("engines.library.manage")}):s.jsxs("span",{className:"inline-flex items-center gap-1 text-[12px] font-semibold text-accent-text",children:[l("engines.library.setup"),s.jsx(Hs,{size:13,"aria-hidden":"true"})]})]})]}),s.jsx("div",{className:"min-w-0 border-t border-hairline/40 p-4",children:t})]})}function SDe({instances:e,renderEngine:t,isReady:n=on}){return s.jsxs("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,280px),1fr))] items-start gap-3",children:[[!0,!1].flatMap(a=>{const r=e.filter(o=>n(o)===a);if(!r.length)return[];const i=l(a?"onboarding.engines.ready":"onboarding.engines.needsSetup");return[s.jsxs("div",{className:I("col-span-full flex items-center justify-between gap-3 px-4",!a&&e.some(n)&&"mt-4"),children:[s.jsx("h2",{className:"text-[12px] font-semibold text-ink-secondary",children:i}),s.jsx("span",{className:"text-[11px] tabular-nums text-ink-secondary",children:l(r.length===1?"engines.library.countOne":"engines.library.count",{count:r.length})})]},`heading-${a}`),...r.map(o=>s.jsx("div",{className:"contents",children:t(o)},o.instanceId))]}),e.length===0&&s.jsx("p",{className:"col-span-full py-4 text-[13px] text-ink-secondary",children:l("engines.none")})]})}function XT(){const{refreshInstances:e}=re(),[t,n]=f.useState(!1),[a,r]=f.useState(null),[i,o]=f.useState(!1);return s.jsxs("div",{children:[s.jsxs("button",{type:"button",disabled:t,onClick:async()=>{n(!0),r(null),o(!1);try{await e({reportErrors:!0}),o(!0)}catch(c){r(c instanceof Error?c.message:String(c))}finally{n(!1)}},className:"inline-flex shrink-0 items-center gap-1.5 rounded-lg px-2.5 py-2 text-[12px] font-medium text-ink-secondary hover:bg-control hover:text-ink focus-visible:outline-2 focus-visible:outline-accent disabled:opacity-50",children:[s.jsx(Tt,{size:13,"aria-hidden":"true",className:I(t&&"animate-spin")}),t?l("common.checking"):l("engines.library.refresh")]}),a&&s.jsx("p",{role:"alert",className:"mt-1 text-[12px] text-danger",children:l("engineSetup.checkFailed",{reason:a})}),i&&s.jsx("p",{role:"status",className:"mt-1 text-[11px] text-ink-secondary",children:l("engineSetup.checked")})]})}function ye(e,t){return tt().toLowerCase().startsWith("vi")?e:t}const jN={claudeApi:"engines.defaultName.claudeApi",chatgpt:"engines.defaultName.chatgpt",openaiCompat:"engines.defaultName.openaiCompat"};function gt(e){const t=Object.hasOwn(jN,e.instanceId)?jN[e.instanceId]:void 0;return t&&e.displayName===Ia[t]?l(t):e.displayName}const IDe=["everyday","work","writing","design","sales","personal"],x1=[1,2,3,4,5],Rc=(e,t,n,a)=>({name:e,prompt:t,schedule:{type:"daily",time:n,weekdays:a},enabled:!1,overlap:"skip"}),Jte=[{id:"assistant",category:"everyday",name:"Assistant",title:"General assistant",description:"Trả lời câu hỏi, soạn văn bản và nhận mọi việc bạn giao.",soul:["You are a capable, plain-spoken assistant.","Ask one clarifying question when a request is ambiguous; otherwise do the work and show the result.","Lead with the answer, then the detail. Keep replies short and concrete, and use lists only when they help.","Say plainly when you are unsure or could not check something, and never present a guess as a fact.","When a task will take several steps, say what you are about to do in one line before doing it."].join(`
19
19
  `),look:{color:"green",mascotBody:"cursor"},tryAsking:["Plan my week from this list of to-dos","Explain this contract clause in plain English","Draft a polite reply declining this meeting"],apps:[]},{id:"inbox",category:"work",name:"Inbox",title:"Email triage",description:"Đọc hộp thư, đánh dấu những gì cần bạn và soạn câu trả lời để bạn duyệt.",soul:["You manage the user's email.","Each run: list unread mail and group it into Needs a reply, FYI, and Noise, in that order, with one line per message (sender, subject, why it is in that group).","Draft replies for anything that needs one, in the user's tone, and show them for approval. Never send without approval.","Never unsubscribe, delete, archive, or forward mail on your own.","Note recurring senders and the user's preferences in memory so each triage gets sharper."].join(`
20
20
  `),look:{color:"blue",mascotBody:"squircle"},tryAsking:["What in my inbox needs me today?","Draft replies to the three most urgent emails","Who have I not answered in over a week?"],apps:["gmail"],routines:[Rc("Morning inbox triage","Triage my unread email and draft replies for anything that needs one.","08:30",x1)]},{id:"research",category:"everyday",name:"Scout",title:"Researcher",description:"Tìm hiểu trên web và trong tệp của bạn, rồi trả về bản tóm tắt có dẫn nguồn.",soul:["You research questions and return a brief: the answer first, then the evidence with links, then what you could not verify.","Prefer primary sources and date every claim that can change. Say clearly when sources disagree, and show both sides.","Never present a guess as a finding. If the evidence is thin, say so and suggest what would settle it.","Keep briefs scannable: a three-line summary, then sections, then sources."].join(`
21
21
  `),look:{color:"purple",mascotBody:"diamond"},tryAsking:["What changed in EU AI rules this year? Sources please","Compare the top three note-taking apps for a small team","Fact-check the claims in this paragraph"],apps:[]},{id:"coder",category:"work",name:"Dev",title:"Coding partner",description:"Làm việc trong thư mục dự án: đọc, sửa, chạy test, giải thích thay đổi.",soul:["You are a careful engineer working in the user's project folder.","Read before you edit, and follow the project's existing style. Keep diffs small and focused on what was asked.","Run the project's tests after changes and report the real output, including failures.","Explain what changed and why in a few lines. Never push, publish, or delete branches unless told to."].join(`
@@ -109,9 +109,9 @@ ${a.text}
109
109
 
110
110
  `)){const a=(n.split(`
111
111
  `)[0]??"").trim();if(!a)return[];const r=a.indexOf(" · ");if(r<0){t.push({app:null,label:a});continue}const i=a.slice(0,r).trim(),o=a.slice(r+3).trim();if(!i||!o)return[];t.push({app:i,label:o})}return t}function voe(e){if(!e.outboundRequest)return[];const t=e.outboundRequest.calls;return t&&t.length>0?t:koe(e.subtitle)}function woe(e){return e.length===0||e.some(n=>!n.app)?null:new Set(e.map(n=>n.app)).size===1?e[0].app:null}function joe(e,t){const n=[],a=new Map;for(const c of e){const d=JSON.stringify([c.app,c.label]);a.has(d)||n.push(c),a.set(d,(a.get(d)??0)+1)}const r=n.slice(0,yoe).map(c=>{const d=t&&c.app?`${c.app} · ${c.label}`:c.label,u=a.get(JSON.stringify([c.app,c.label]))??1;return u>1?`${d} ×${u}`:d}),i=r.join(", "),o=n.length-r.length;return o>0?`${i}, ${l("approval.outbound.more",{count:o})}`:i}const Noe="COMPOSIO_PROXY_EXECUTE";function p3(e){if(!e.outboundRequest)return;const t=voe(e),n=woe(t);return e.outboundRequest.tool===Noe?{headline:l("approval.outbound.runCode",{app:n??e.outboundRequest.app??"Composio"}),summary:"",opaque:!0}:{headline:n?l("approval.outbound.sendTo",{app:n}):l("approval.outbound.sendOnBehalf"),summary:joe(t,n===null)}}const Soe=/^[A-Z][A-Z0-9]+_([A-Z0-9_]+)$/;function LM(e){const t=Soe.exec(e);if(t)return t[1].replace(/_+/g," ").trim().toLowerCase()||void 0}function Lc(e){return Date.UTC(e.y,e.m-1,e.d,e.h,e.i,e.s)}function I1(e,t){return e.y===t.y&&e.m===t.m&&e.d===t.d&&e.h===t.h&&e.i===t.i&&e.s===t.s}function Ioe(e,t){let n=new Date(Date.parse(e));if(isNaN(n))throw new Error("Invalid ISO8601 passed to timezone parser.");let a=e.substring(9);return a.includes("Z")||a.includes("+")||a.includes("-")?Cy(n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),"Etc/UTC"):Cy(n.getFullYear(),n.getMonth()+1,n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),t)}function QN(e,t,n){return zM(Ioe(e,t),n)}function zM(e,t){let n=new Date(Lc(e)),a=ud(n,e.tz),r=Lc(e),i=Lc(a),o=r-i,c=new Date(n.getTime()+o),d=ud(c,e.tz);if(I1(d,e)){let m=new Date(c.getTime()-36e5),h=ud(m,e.tz);return I1(h,e)?m:c}let u=new Date(c.getTime()+Lc(e)-Lc(d)),p=ud(u,e.tz);if(I1(p,e))return u;if(t)throw new Error("Invalid date passed to fromTZ()");return c.getTime()>u.getTime()?c:u}function ud(e,t){let n,a;try{n=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}),a=n.formatToParts(e)}catch(i){let o=i instanceof Error?i.message:String(i);throw new RangeError(`toTZ: Invalid timezone '${t}' or date. Please provide a valid IANA timezone (e.g., 'America/New_York', 'Europe/Stockholm'). Original error: ${o}`)}let r={year:0,month:0,day:0,hour:0,minute:0,second:0};for(let i of a)(i.type==="year"||i.type==="month"||i.type==="day"||i.type==="hour"||i.type==="minute"||i.type==="second")&&(r[i.type]=parseInt(i.value,10));if(isNaN(r.year)||isNaN(r.month)||isNaN(r.day)||isNaN(r.hour)||isNaN(r.minute)||isNaN(r.second))throw new Error(`toTZ: Failed to parse all date components from timezone '${t}'. This may indicate an invalid date or timezone configuration. Parsed components: ${JSON.stringify(r)}`);return r.hour===24&&(r.hour=0),{y:r.year,m:r.month,d:r.day,h:r.hour,i:r.minute,s:r.second,tz:t}}function Cy(e,t,n,a,r,i,o){return{y:e,m:t,d:n,h:a,i:r,s:i,tz:o}}var PM=[1,2,4,8,16],XN=class{pattern;timezone;mode;alternativeWeekdays;sloppyRanges;second;minute;hour;day;month;dayOfWeek;year;lastDayOfMonth;lastWeekday;nearestWeekdays;starDOM;starDOW;starYear;useAndLogic;constructor(e,t,n){this.pattern=e,this.timezone=t,this.mode=n?.mode??"auto",this.alternativeWeekdays=n?.alternativeWeekdays??!1,this.sloppyRanges=n?.sloppyRanges??!1,this.second=Array(60).fill(0),this.minute=Array(60).fill(0),this.hour=Array(24).fill(0),this.day=Array(31).fill(0),this.month=Array(12).fill(0),this.dayOfWeek=Array(7).fill(0),this.year=Array(1e4).fill(0),this.lastDayOfMonth=!1,this.lastWeekday=!1,this.nearestWeekdays=Array(31).fill(0),this.starDOM=!1,this.starDOW=!1,this.starYear=!1,this.useAndLogic=!1,this.parse()}parse(){if(!(typeof this.pattern=="string"||this.pattern instanceof String))throw new TypeError("CronPattern: Pattern has to be of type string.");this.pattern.indexOf("@")>=0&&(this.pattern=this.handleNicknames(this.pattern).trim());let e=this.pattern.match(/\S+/g)||[""],t=e.length;if(e.length<5||e.length>7)throw new TypeError("CronPattern: invalid configuration format ('"+this.pattern+"'), exactly five, six, or seven space separated parts are required.");if(this.mode!=="auto"){let a;switch(this.mode){case"5-part":a=5;break;case"6-part":a=6;break;case"7-part":a=7;break;case"5-or-6-parts":a=[5,6];break;case"6-or-7-parts":a=[6,7];break;default:a=0}if(!(Array.isArray(a)?a.includes(t):t===a)){let r=Array.isArray(a)?a.join(" or "):a.toString();throw new TypeError(`CronPattern: mode '${this.mode}' requires exactly ${r} parts, but pattern '${this.pattern}' has ${t} parts.`)}}if(e.length===5&&e.unshift("0"),e.length===6&&e.push("*"),e[3].toUpperCase()==="LW"?(this.lastWeekday=!0,e[3]=""):e[3].toUpperCase().indexOf("L")>=0&&(e[3]=e[3].replace(/L/gi,""),this.lastDayOfMonth=!0),e[3]=="*"&&(this.starDOM=!0),e[6]=="*"&&(this.starYear=!0),e[4].length>=3&&(e[4]=this.replaceAlphaMonths(e[4])),e[5].length>=3&&(e[5]=this.alternativeWeekdays?this.replaceAlphaDaysQuartz(e[5]):this.replaceAlphaDays(e[5])),e[5].startsWith("+")&&(this.useAndLogic=!0,e[5]=e[5].substring(1),e[5]===""))throw new TypeError("CronPattern: Day-of-week field cannot be empty after '+' modifier.");switch(e[5]=="*"&&(this.starDOW=!0),this.pattern.indexOf("?")>=0&&(e[0]=e[0].replace(/\?/g,"*"),e[1]=e[1].replace(/\?/g,"*"),e[2]=e[2].replace(/\?/g,"*"),e[3]=e[3].replace(/\?/g,"*"),e[4]=e[4].replace(/\?/g,"*"),e[5]=e[5].replace(/\?/g,"*"),e[6]&&(e[6]=e[6].replace(/\?/g,"*"))),this.mode){case"5-part":e[0]="0",e[6]="*";break;case"6-part":e[6]="*";break;case"5-or-6-parts":e[6]="*";break}this.throwAtIllegalCharacters(e),this.partToArray("second",e[0],0,1),this.partToArray("minute",e[1],0,1),this.partToArray("hour",e[2],0,1),this.partToArray("day",e[3],-1,1),this.partToArray("month",e[4],-1,1);let n=this.alternativeWeekdays?-1:0;this.partToArray("dayOfWeek",e[5],n,63),this.partToArray("year",e[6],0,1),!this.alternativeWeekdays&&this.dayOfWeek[7]&&(this.dayOfWeek[0]=this.dayOfWeek[7])}partToArray(e,t,n,a){let r=this[e],i=e==="day"&&this.lastDayOfMonth,o=e==="day"&&this.lastWeekday;if(t===""&&!i&&!o)throw new TypeError("CronPattern: configuration entry "+e+" ("+t+") is empty, check for trailing spaces.");if(t==="*")return r.fill(a);let c=t.split(",");if(c.length>1)for(let d=0;d<c.length;d++)this.partToArray(e,c[d],n,a);else t.indexOf("-")!==-1&&t.indexOf("/")!==-1?this.handleRangeWithStepping(t,e,n,a):t.indexOf("-")!==-1?this.handleRange(t,e,n,a):t.indexOf("/")!==-1?this.handleStepping(t,e,n,a):t!==""&&this.handleNumber(t,e,n,a)}throwAtIllegalCharacters(e){for(let t=0;t<e.length;t++)if((t===3?/[^/*0-9,\-WwLl]+/:t===5?/[^/*0-9,\-#Ll]+/:/[^/*0-9,\-]+/).test(e[t]))throw new TypeError("CronPattern: configuration entry "+t+" ("+e[t]+") contains illegal characters.")}handleNumber(e,t,n,a){let r=this.extractNth(e,t),i=e.toUpperCase().includes("W");if(t!=="day"&&i)throw new TypeError("CronPattern: Nearest weekday modifier (W) only allowed in day-of-month.");i&&(t="nearestWeekdays");let o=parseInt(r[0],10)+n;if(isNaN(o))throw new TypeError("CronPattern: "+t+" is not a number: '"+e+"'");this.setPart(t,o,r[1]||a)}setPart(e,t,n){if(!Object.prototype.hasOwnProperty.call(this,e))throw new TypeError("CronPattern: Invalid part specified: "+e);if(e==="dayOfWeek"){if(t===7&&(t=0),t<0||t>6)throw new RangeError("CronPattern: Invalid value for dayOfWeek: "+t);this.setNthWeekdayOfMonth(t,n);return}if(e==="second"||e==="minute"){if(t<0||t>=60)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="hour"){if(t<0||t>=24)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="day"||e==="nearestWeekdays"){if(t<0||t>=31)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="month"){if(t<0||t>=12)throw new RangeError("CronPattern: Invalid value for "+e+": "+t)}else if(e==="year"&&(t<1||t>=1e4))throw new RangeError("CronPattern: Invalid value for "+e+": "+t+" (supported range: 1-9999)");this[e][t]=n}validateNotNaN(e,t){if(isNaN(e))throw new TypeError(t)}validateRange(e,t,n,a,r){if(e>t)throw new TypeError("CronPattern: From value is larger than to value: '"+r+"'");if(n!==void 0){if(n===0)throw new TypeError("CronPattern: Syntax error, illegal stepping: 0");if(n>this[a].length)throw new TypeError("CronPattern: Syntax error, steps cannot be greater than maximum value of part ("+this[a].length+")")}}handleRangeWithStepping(e,t,n,a){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in ranges with stepping.");let r=this.extractNth(e,t),i=r[0].match(/^(\d+)-(\d+)\/(\d+)$/);if(i===null)throw new TypeError("CronPattern: Syntax error, illegal range with stepping: '"+e+"'");let[,o,c,d]=i,u=parseInt(o,10)+n,p=parseInt(c,10)+n,m=parseInt(d,10);this.validateNotNaN(u,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(p,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateNotNaN(m,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(u,p,m,t,e);for(let h=u;h<=p;h+=m)this.setPart(t,h,r[1]||a)}extractNth(e,t){let n=e,a;if(n.includes("#")){if(t!=="dayOfWeek")throw new Error("CronPattern: nth (#) only allowed in day-of-week field");a=n.split("#")[1],n=n.split("#")[0]}else if(n.toUpperCase().endsWith("L")){if(t!=="dayOfWeek")throw new Error("CronPattern: L modifier only allowed in day-of-week field (use L alone for day-of-month)");a="L",n=n.slice(0,-1)}return[n,a]}handleRange(e,t,n,a){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in a range.");let r=this.extractNth(e,t),i=r[0].split("-");if(i.length!==2)throw new TypeError("CronPattern: Syntax error, illegal range: '"+e+"'");let o=parseInt(i[0],10)+n,c=parseInt(i[1],10)+n;this.validateNotNaN(o,"CronPattern: Syntax error, illegal lower range (NaN)"),this.validateNotNaN(c,"CronPattern: Syntax error, illegal upper range (NaN)"),this.validateRange(o,c,void 0,t,e);for(let d=o;d<=c;d++)this.setPart(t,d,r[1]||a)}handleStepping(e,t,n,a){if(e.toUpperCase().includes("W"))throw new TypeError("CronPattern: Syntax error, W is not allowed in parts with stepping.");let r=this.extractNth(e,t),i=r[0].split("/");if(i.length!==2)throw new TypeError("CronPattern: Syntax error, illegal stepping: '"+e+"'");if(this.sloppyRanges)i[0]===""&&(i[0]="*");else{if(i[0]==="")throw new TypeError("CronPattern: Syntax error, stepping with missing prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.");if(i[0]!=="*")throw new TypeError("CronPattern: Syntax error, stepping with numeric prefix ('"+e+"') is not allowed. Use wildcard (*/step) or range (min-max/step) instead.")}let o=0;i[0]!=="*"&&(o=parseInt(i[0],10)+n);let c=parseInt(i[1],10);this.validateNotNaN(c,"CronPattern: Syntax error, illegal stepping: (NaN)"),this.validateRange(0,this[t].length-1,c,t,e);for(let d=o;d<this[t].length;d+=c)this.setPart(t,d,r[1]||a)}replaceAlphaDays(e){return e.replace(/-sun/gi,"-7").replace(/sun/gi,"0").replace(/mon/gi,"1").replace(/tue/gi,"2").replace(/wed/gi,"3").replace(/thu/gi,"4").replace(/fri/gi,"5").replace(/sat/gi,"6")}replaceAlphaDaysQuartz(e){return e.replace(/sun/gi,"1").replace(/mon/gi,"2").replace(/tue/gi,"3").replace(/wed/gi,"4").replace(/thu/gi,"5").replace(/fri/gi,"6").replace(/sat/gi,"7")}replaceAlphaMonths(e){return e.replace(/jan/gi,"1").replace(/feb/gi,"2").replace(/mar/gi,"3").replace(/apr/gi,"4").replace(/may/gi,"5").replace(/jun/gi,"6").replace(/jul/gi,"7").replace(/aug/gi,"8").replace(/sep/gi,"9").replace(/oct/gi,"10").replace(/nov/gi,"11").replace(/dec/gi,"12")}handleNicknames(e){let t=e.trim().toLowerCase();if(t==="@yearly"||t==="@annually")return"0 0 1 1 *";if(t==="@monthly")return"0 0 1 * *";if(t==="@weekly")return"0 0 * * 0";if(t==="@daily"||t==="@midnight")return"0 0 * * *";if(t==="@hourly")return"0 * * * *";if(t==="@reboot")throw new TypeError("CronPattern: @reboot is not supported in this environment. This is an event-based trigger that requires system startup detection.");return e}setNthWeekdayOfMonth(e,t){if(typeof t!="number"&&t.toUpperCase()==="L")this.dayOfWeek[e]=this.dayOfWeek[e]|32;else if(t===63)this.dayOfWeek[e]=63;else if(t<6&&t>0)this.dayOfWeek[e]=this.dayOfWeek[e]|PM[t-1];else throw new TypeError(`CronPattern: nth weekday out of range, should be 1-5 or L. Value: ${t}, Type: ${typeof t}`)}},C1=[31,28,31,30,31,30,31,31,30,31,30,31],Lt=[["month","year",0],["day","month",-1],["hour","day",0],["minute","hour",0],["second","minute",0]],Ln=class DM{tz;ms;second;minute;hour;day;month;year;constructor(t,n){if(this.tz=n,t&&t instanceof Date)if(!isNaN(t))this.fromDate(t);else throw new TypeError("CronDate: Invalid date passed to CronDate constructor");else if(t==null)this.fromDate(new Date);else if(t&&typeof t=="string")this.fromString(t);else if(t instanceof DM)this.fromCronDate(t);else throw new TypeError("CronDate: Invalid type ("+typeof t+") passed to CronDate constructor")}getLastDayOfMonth(t,n){return n!==1?C1[n]:new Date(Date.UTC(t,n+1,0)).getUTCDate()}getLastWeekday(t,n){let a=this.getLastDayOfMonth(t,n),r=new Date(Date.UTC(t,n,a)).getUTCDay();return r===0?a-2:r===6?a-1:a}getNearestWeekday(t,n,a){let r=this.getLastDayOfMonth(t,n);if(a>r)return-1;let i=new Date(Date.UTC(t,n,a)).getUTCDay();return i===0?a===r?a-2:a+1:i===6?a===1?a+2:a-1:a}isNthWeekdayOfMonth(t,n,a,r){let i=new Date(Date.UTC(t,n,a)).getUTCDay(),o=0;for(let c=1;c<=a;c++)new Date(Date.UTC(t,n,c)).getUTCDay()===i&&o++;if(r&63&&PM[o-1]&r)return!0;if(r&32){let c=this.getLastDayOfMonth(t,n);for(let d=a+1;d<=c;d++)if(new Date(Date.UTC(t,n,d)).getUTCDay()===i)return!1;return!0}return!1}fromDate(t){if(this.tz!==void 0)if(typeof this.tz=="number")this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes()+this.tz,this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),this.apply();else try{let n=ud(t,this.tz);this.ms=t.getMilliseconds(),this.second=n.s,this.minute=n.i,this.hour=n.h,this.day=n.d,this.month=n.m-1,this.year=n.y}catch(n){let a=n instanceof Error?n.message:String(n);throw new TypeError(`CronDate: Failed to convert date to timezone '${this.tz}'. This may happen with invalid timezone names or dates. Original error: ${a}`)}else this.ms=t.getMilliseconds(),this.second=t.getSeconds(),this.minute=t.getMinutes(),this.hour=t.getHours(),this.day=t.getDate(),this.month=t.getMonth(),this.year=t.getFullYear()}fromCronDate(t){this.tz=t.tz,this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.ms=t.ms}apply(){if(this.month>11||this.month<0||this.day>C1[this.month]||this.day<1||this.hour>59||this.minute>59||this.second>59||this.hour<0||this.minute<0||this.second<0){let t=new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms));return this.ms=t.getUTCMilliseconds(),this.second=t.getUTCSeconds(),this.minute=t.getUTCMinutes(),this.hour=t.getUTCHours(),this.day=t.getUTCDate(),this.month=t.getUTCMonth(),this.year=t.getUTCFullYear(),!0}else return!1}fromString(t){if(typeof this.tz=="number"){let n=QN(t);this.ms=n.getUTCMilliseconds(),this.second=n.getUTCSeconds(),this.minute=n.getUTCMinutes(),this.hour=n.getUTCHours(),this.day=n.getUTCDate(),this.month=n.getUTCMonth(),this.year=n.getUTCFullYear(),this.apply()}else return this.fromDate(QN(t,this.tz))}findNext(t,n,a,r){return this._findMatch(t,n,a,r,1)}_findMatch(t,n,a,r,i){let o=this[n],c;a.lastDayOfMonth&&(c=this.getLastDayOfMonth(this.year,this.month));let d=!a.starDOW&&n=="day"?new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay():void 0,u=this[n]+r,p=i===1?m=>m<a[n].length:m=>m>=0;for(let m=u;p(m);m+=i){let h=a[n][m];if(n==="day"&&!h){for(let x=0;x<a.nearestWeekdays.length;x++)if(a.nearestWeekdays[x]){let g=this.getNearestWeekday(this.year,this.month,x-r);if(g===-1)continue;if(g===m-r){h=1;break}}}if(n==="day"&&a.lastWeekday){let x=this.getLastWeekday(this.year,this.month);m-r===x&&(h=1)}if(n==="day"&&a.lastDayOfMonth&&m-r==c&&(h=1),n==="day"&&!a.starDOW){let x=a.dayOfWeek[(d+(m-r-1))%7];if(x&&x&63)x=this.isNthWeekdayOfMonth(this.year,this.month,m-r,x)?1:0;else if(x)throw new Error(`CronDate: Invalid value for dayOfWeek encountered. ${x}`);a.useAndLogic?h=h&&x:!t.domAndDow&&!a.starDOM?h=h||x:h=h&&x}if(h)return this[n]=m-r,o!==this[n]?2:1}return 3}recurse(t,n,a){if(a===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let i=-1;for(let o=this.year+1;o<t.year.length&&o<1e4;o++)if(t.year[o]===1){i=o;break}if(i===-1)return null;this.year=i,this.month=0,this.day=1,this.hour=0,this.minute=0,this.second=0,this.ms=0}if(this.year>=1e4)return null}let r=this.findNext(n,Lt[a][0],t,Lt[a][2]);if(r>1){let i=a+1;for(;i<Lt.length;)this[Lt[i][0]]=-Lt[i][2],i++;if(r===3){if(this[Lt[a][1]]++,this[Lt[a][0]]=-Lt[a][2],this.apply(),a===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0&&this.year<1e4;)this.year++;if(this.year>=1e4||this.year>=t.year.length)return null}return this.recurse(t,n,0)}else if(this.apply())return this.recurse(t,n,a-1)}return a+=1,a>=Lt.length?this:(t.starYear?this.year>=3e3:this.year>=1e4)?null:this.recurse(t,n,a)}increment(t,n,a){return this.second+=n.interval!==void 0&&n.interval>1&&a?n.interval:1,this.ms=0,this.apply(),this.recurse(t,n,0)}decrement(t,n){return this.second-=n.interval!==void 0&&n.interval>1?n.interval:1,this.ms=0,this.apply(),this.recurseBackward(t,n,0,0)}recurseBackward(t,n,a,r=0){if(r>1e4)return null;if(a===0&&!t.starYear){if(this.year>=0&&this.year<t.year.length&&t.year[this.year]===0){let o=-1;for(let c=this.year-1;c>=0;c--)if(t.year[c]===1){o=c;break}if(o===-1)return null;this.year=o,this.month=11,this.day=31,this.hour=23,this.minute=59,this.second=59,this.ms=0}if(this.year<0)return null}let i=this.findPrevious(n,Lt[a][0],t,Lt[a][2]);if(i>1){let o=a+1;for(;o<Lt.length;){let c=Lt[o][0],d=Lt[o][2],u=this.getMaxPatternValue(c,t,d);this[c]=u,o++}if(i===3){if(this[Lt[a][1]]--,a===0){let p=this.getLastDayOfMonth(this.year,this.month);this.day>p&&(this.day=p)}if(a===1)if(this.day<=0)this.day=1;else{let p=this.year,m=this.month;for(;m<0;)m+=12,p--;for(;m>11;)m-=12,p++;let h=m!==1?C1[m]:new Date(Date.UTC(p,m+1,0)).getUTCDate();this.day>h&&(this.day=h)}this.apply();let c=Lt[a][0],d=Lt[a][2],u=this.getMaxPatternValue(c,t,d);if(c==="day"){let p=this.getLastDayOfMonth(this.year,this.month);this[c]=Math.min(u,p)}else this[c]=u;if(this.apply(),a===0){let p=Lt[1][2],m=this.getMaxPatternValue("day",t,p),h=this.getLastDayOfMonth(this.year,this.month),x=Math.min(m,h);x!==this.day&&(this.day=x,this.hour=this.getMaxPatternValue("hour",t,Lt[2][2]),this.minute=this.getMaxPatternValue("minute",t,Lt[3][2]),this.second=this.getMaxPatternValue("second",t,Lt[4][2]))}if(a===0&&!t.starYear){for(;this.year>=0&&this.year<t.year.length&&t.year[this.year]===0;)this.year--;if(this.year<0)return null}return this.recurseBackward(t,n,0,r+1)}else if(this.apply())return this.recurseBackward(t,n,a-1,r+1)}return a+=1,a>=Lt.length?this:this.year<0?null:this.recurseBackward(t,n,a,r+1)}getMaxPatternValue(t,n,a){if(t==="day"&&n.lastDayOfMonth)return this.getLastDayOfMonth(this.year,this.month);if(t==="day"&&!n.starDOW)return this.getLastDayOfMonth(this.year,this.month);for(let r=n[t].length-1;r>=0;r--)if(n[t][r])return r-a;return n[t].length-1-a}findPrevious(t,n,a,r){return this._findMatch(t,n,a,r,-1)}getDate(t){return t||this.tz===void 0?new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.ms):typeof this.tz=="number"?new Date(Date.UTC(this.year,this.month,this.day,this.hour,this.minute-this.tz,this.second,this.ms)):zM(Cy(this.year,this.month+1,this.day,this.hour,this.minute,this.second,this.tz),!1)}getTime(){return this.getDate(!1).getTime()}match(t,n){if(!t.starYear&&(this.year<0||this.year>=t.year.length||t.year[this.year]===0))return!1;for(let a=0;a<Lt.length;a++){let r=Lt[a][0],i=Lt[a][2],o=this[r];if(o+i<0||o+i>=t[r].length)return!1;let c=t[r][o+i];if(r==="day"){if(!c){for(let d=0;d<t.nearestWeekdays.length;d++)if(t.nearestWeekdays[d]){let u=this.getNearestWeekday(this.year,this.month,d-i);if(u!==-1&&u===o){c=1;break}}}if(t.lastWeekday){let d=this.getLastWeekday(this.year,this.month);o===d&&(c=1)}if(t.lastDayOfMonth){let d=this.getLastDayOfMonth(this.year,this.month);o===d&&(c=1)}if(!t.starDOW){let d=new Date(Date.UTC(this.year,this.month,1,0,0,0,0)).getUTCDay(),u=t.dayOfWeek[(d+(o-1))%7];u&&u&63&&(u=this.isNthWeekdayOfMonth(this.year,this.month,o,u)?1:0),t.useAndLogic?c=c&&u:!n.domAndDow&&!t.starDOM?c=c||u:c=c&&u}}if(!c)return!1}return!0}};function Coe(e){if(e===void 0&&(e={}),delete e.name,e.legacyMode!==void 0&&e.domAndDow===void 0?e.domAndDow=!e.legacyMode:e.domAndDow===void 0&&(e.domAndDow=!1),e.legacyMode=!e.domAndDow,e.paused=e.paused===void 0?!1:e.paused,e.maxRuns=e.maxRuns===void 0?1/0:e.maxRuns,e.catch=e.catch===void 0?!1:e.catch,e.interval=e.interval===void 0?0:parseInt(e.interval.toString(),10),e.utcOffset=e.utcOffset===void 0?void 0:parseInt(e.utcOffset.toString(),10),e.dayOffset=e.dayOffset===void 0?0:parseInt(e.dayOffset.toString(),10),e.unref=e.unref===void 0?!1:e.unref,e.mode=e.mode===void 0?"auto":e.mode,e.alternativeWeekdays=e.alternativeWeekdays===void 0?!1:e.alternativeWeekdays,e.sloppyRanges=e.sloppyRanges===void 0?!1:e.sloppyRanges,!["auto","5-part","6-part","7-part","5-or-6-parts","6-or-7-parts"].includes(e.mode))throw new Error("CronOptions: mode must be one of 'auto', '5-part', '6-part', '7-part', '5-or-6-parts', or '6-or-7-parts'.");if(e.startAt&&(e.startAt=new Ln(e.startAt,e.timezone)),e.stopAt&&(e.stopAt=new Ln(e.stopAt,e.timezone)),e.interval!==null){if(isNaN(e.interval))throw new Error("CronOptions: Supplied value for interval is not a number");if(e.interval<0)throw new Error("CronOptions: Supplied value for interval can not be negative")}if(e.utcOffset!==void 0){if(isNaN(e.utcOffset))throw new Error("CronOptions: Invalid value passed for utcOffset, should be number representing minutes offset from UTC.");if(e.utcOffset<-870||e.utcOffset>870)throw new Error("CronOptions: utcOffset out of bounds.");if(e.utcOffset!==void 0&&e.timezone)throw new Error("CronOptions: Combining 'utcOffset' with 'timezone' is not allowed.")}if(e.unref!==!0&&e.unref!==!1)throw new Error("CronOptions: Unref should be either true, false or undefined(false).");if(e.dayOffset!==void 0&&e.dayOffset!==0&&isNaN(e.dayOffset))throw new Error("CronOptions: Invalid value passed for dayOffset, should be a number representing days to offset.");return e}function pd(e){return Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function}function Eoe(e){return pd(e)}function Aoe(e){typeof Deno<"u"&&typeof Deno.unrefTimer<"u"?Deno.unrefTimer(e):e&&typeof e.unref<"u"&&e.unref()}var ZN=30*1e3,Qp=[],Toe=class{name;options;_states;fn;getTz(){return this.options.timezone||this.options.utcOffset}applyDayOffset(e){if(this.options.dayOffset!==void 0&&this.options.dayOffset!==0){let t=this.options.dayOffset*24*60*60*1e3;return new Date(e.getTime()+t)}return e}constructor(e,t,n){let a,r;if(pd(t))r=t;else if(typeof t=="object")a=t;else if(t!==void 0)throw new Error("Cron: Invalid argument passed for optionsIn. Should be one of function, or object (options).");if(pd(n))r=n;else if(typeof n=="object")a=n;else if(n!==void 0)throw new Error("Cron: Invalid argument passed for funcIn. Should be one of function, or object (options).");if(this.name=a?.name,this.options=Coe(a),this._states={kill:!1,blocking:!1,previousRun:void 0,currentRun:void 0,once:void 0,currentTimeout:void 0,maxRuns:a?a.maxRuns:void 0,paused:a?a.paused:!1,pattern:new XN("* * * * *",void 0,{mode:"auto"})},e&&(e instanceof Date||typeof e=="string"&&e.indexOf(":")>0)?this._states.once=new Ln(e,this.getTz()):this._states.pattern=new XN(e,this.options.timezone,{mode:this.options.mode,alternativeWeekdays:this.options.alternativeWeekdays,sloppyRanges:this.options.sloppyRanges}),this.name){if(Qp.find(i=>i.name===this.name))throw new Error("Cron: Tried to initialize new named job '"+this.name+"', but name already taken.");Qp.push(this)}return r!==void 0&&Eoe(r)&&(this.fn=r,this.schedule()),this}nextRun(e){let t=this._next(e);return t?this.applyDayOffset(t.getDate(!1)):null}nextRuns(e,t){this._states.maxRuns!==void 0&&e>this._states.maxRuns&&(e=this._states.maxRuns);let n=t||this._states.currentRun||void 0;return this._enumerateRuns(e,n,"next")}previousRuns(e,t){return this._enumerateRuns(e,t||void 0,"previous")}_enumerateRuns(e,t,n){let a=[],r=t?new Ln(t,this.getTz()):null,i=n==="next"?this._next:this._previous;for(;e--;){let o=i.call(this,r);if(!o)break;let c=o.getDate(!1);a.push(this.applyDayOffset(c)),r=o}return a}match(e){if(this._states.once){let n=new Ln(e,this.getTz());n.ms=0;let a=new Ln(this._states.once,this.getTz());return a.ms=0,n.getTime()===a.getTime()}let t=new Ln(e,this.getTz());return t.ms=0,t.match(this._states.pattern,this.options)}getPattern(){if(!this._states.once)return this._states.pattern?this._states.pattern.pattern:void 0}getOnce(){return this._states.once?this._states.once.getDate():null}isRunning(){let e=this.nextRun(this._states.currentRun),t=!this._states.paused,n=this.fn!==void 0,a=!this._states.kill;return t&&n&&a&&e!==null}isStopped(){return this._states.kill}isBusy(){return this._states.blocking}currentRun(){return this._states.currentRun?this._states.currentRun.getDate():null}previousRun(){return this._states.previousRun?this._states.previousRun.getDate():null}msToNext(e){let t=this._next(e);return t?e instanceof Ln||e instanceof Date?t.getTime()-e.getTime():t.getTime()-new Ln(e).getTime():null}stop(){this._states.kill=!0,this._states.currentTimeout&&clearTimeout(this._states.currentTimeout);let e=Qp.indexOf(this);e>=0&&Qp.splice(e,1)}pause(){return this._states.paused=!0,!this._states.kill}resume(){return this._states.paused=!1,!this._states.kill}schedule(e){if(e&&this.fn)throw new Error("Cron: It is not allowed to schedule two functions using the same Croner instance.");e&&(this.fn=e);let t=this.msToNext(),n=this.nextRun(this._states.currentRun);return t==null||isNaN(t)||n===null?this:(t>ZN&&(t=ZN),this._states.currentTimeout=setTimeout(()=>this._checkTrigger(n),t),this._states.currentTimeout&&this.options.unref&&Aoe(this._states.currentTimeout),this)}async _trigger(e){this._states.blocking=!0,this._states.currentRun=new Ln(void 0,this.getTz());try{if(this.options.catch)try{this.fn!==void 0&&await this.fn(this,this.options.context)}catch(t){if(pd(this.options.catch))try{this.options.catch(t,this)}catch{}}else this.fn!==void 0&&await this.fn(this,this.options.context)}finally{this._states.previousRun=new Ln(e,this.getTz()),this._states.blocking=!1}}async trigger(){await this._trigger()}runsLeft(){return this._states.maxRuns}_checkTrigger(e){let t=new Date,n=!this._states.paused&&t.getTime()>=e.getTime(),a=this._states.blocking&&this.options.protect;n&&!a?(this._states.maxRuns!==void 0&&this._states.maxRuns--,this._trigger()):n&&a&&pd(this.options.protect)&&setTimeout(()=>this.options.protect(this),0),this.schedule()}_next(e){let t=!!(e||this._states.currentRun),n=!1;!e&&this.options.startAt&&this.options.interval&&([e,t]=this._calculatePreviousRun(e,t),n=!e),e=new Ln(e,this.getTz()),this.options.startAt&&e&&e.getTime()<this.options.startAt.getTime()&&(e=this.options.startAt);let a=this._states.once||new Ln(e,this.getTz());return!n&&a!==this._states.once&&(a=a.increment(this._states.pattern,this.options,t)),this._states.once&&this._states.once.getTime()<=e.getTime()||a===null||this._states.maxRuns!==void 0&&this._states.maxRuns<=0||this._states.kill||this.options.stopAt&&a.getTime()>=this.options.stopAt.getTime()?null:a}_previous(e){let t=new Ln(e,this.getTz());this.options.stopAt&&t.getTime()>this.options.stopAt.getTime()&&(t=this.options.stopAt);let n=new Ln(t,this.getTz());return this._states.once?this._states.once.getTime()<t.getTime()?this._states.once:null:(n=n.decrement(this._states.pattern,this.options),n===null||this.options.startAt&&n.getTime()<this.options.startAt.getTime()?null:n)}_calculatePreviousRun(e,t){let n=new Ln(void 0,this.getTz()),a=e;if(this.options.startAt.getTime()<=n.getTime()){a=this.options.startAt;let r=a.getTime()+this.options.interval*1e3;for(;r<=n.getTime();)a=new Ln(a,this.getTz()).increment(this._states.pattern,this.options,!0),r=a.getTime()+this.options.interval*1e3;t=!0}return a===null&&(a=void 0),[a,t]}};const Moe=256,_oe=1e3;function $M(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Choose a valid cron schedule");const t=e;if(t.type!=="cron"||typeof t.expression!="string")throw new Error("Choose a valid cron schedule");if(Object.keys(t).some(r=>!["type","expression","timeZone"].includes(r)))throw new Error("Cron schedules accept only type, expression and timeZone; start/end dates and other restrictions are not supported");const n=t.expression.trim().replace(/\s+/g," ");if(n.length>Moe||n.split(" ").length!==5||n.includes("@"))throw new Error("Cron must have five fields: minute hour day-of-month month weekday (no seconds, year, or macros)");const a=typeof t.timeZone=="string"?t.timeZone.trim():"";if(a.length>128||!(a==="UTC"||/^[A-Za-z][A-Za-z0-9_+-]*(?:\/[A-Za-z0-9_+-]+)+$/.test(a)))throw new Error("Choose an IANA timezone such as America/New_York, Asia/Kolkata, or UTC");try{new Intl.DateTimeFormat("en-US",{timeZone:a}).format(0)}catch{throw new Error("Choose a valid IANA timezone such as America/New_York, Asia/Kolkata, or UTC")}try{const r=new Toe(n,{timezone:a,mode:"5-part",paused:!0});return{schedule:{type:"cron",expression:n,timeZone:a},cron:r}}catch(r){throw new Error(`Invalid cron expression: ${r.message}`)}}function Roe(e){const t=new Date(e);if(!Number.isFinite(e)||!Number.isFinite(t.getTime()))throw new Error("Choose a valid cron preview date");return t}function BM(e,t,n){const a=Roe(t),r=n+1440;let i=n;for(;;){const o=e.nextRuns(i,a),c=[];for(const d of o){const u=d.getTime();if(!Number.isFinite(u))throw new Error("The cron schedule produced an invalid date");if(u>(c.at(-1)??t)&&c.push(u),c.length===n)return c}if(o.length<i||i===r)return c;i=Math.min(r,i*2)}}function o$e(e,t=Date.now()){const{schedule:n,cron:a}=$M(e);if(!BM(a,t,1).length)throw new Error("This cron expression has no future runs. Choose dates that exist.");return n}function Ooe(e,t,n){if(!Number.isInteger(n)||n<1||n>_oe)throw new Error("Choose between 1 and 1000 cron preview runs");const{cron:a}=$M(e);return BM(a,t,n)}const Loe=5,zc=30,zoe=12,Poe=12;function Xi(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function Cd(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n.getTime()}function l$e(e){const t=new Date(Xi(e));return t.setDate(t.getDate()-(t.getDay()+6)%7),t.getTime()}function m3(e,t){const[n,a]=t.split(":").map(Number),r=new Date(e);return r.setHours(n,a,0,0),r.getTime()}function Doe(e){return new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,10)}function FM(e){return new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(11,16)}function c$e(e,t,n){return n!=null&&e===Doe(n)&&t===FM(n)?n:new Date(`${e}T${t}`).getTime()}function $oe(e,t){return Math.ceil((e+t*6e4)/6e4)*6e4}function Boe(e,t,n){return n?.everyMinutes===t?n.anchorAt:$oe(e,t)}function d$e(e,t,n){const a=Boe(e,t,n);if(a>e)return a;const r=t*6e4;return a+(Math.floor((e-a)/r)+1)*r}function Foe(e,t=Loe){return Math.max(0,Math.min(1440-t,Math.round(e/t)*t))}function u$e(e){const t=r=>r.at+Math.max(15,r.durationMinutes)*6e4,n=[...e].sort((r,i)=>r.at-i.at||t(r)-t(i)||r.id.localeCompare(i.id)),a=new Map;for(let r=0;r<n.length;){const i=[];let o=n[r].at;for(;r<n.length;){const p=n[r];if(i.length>0&&p.at>=o)break;i.push(p),o=Math.max(o,t(p)),r+=1}const c=[],d=i.map(p=>{const m=c.findIndex(x=>x<=p.at),h=m===-1?c.length:m;return c[h]=t(p),{id:p.id,column:h}}),u=Math.max(1,c.length);for(const p of d)a.set(p.id,{column:p.column,columns:u})}return a}function p$e(e){if(e===0)return"GMT+0";const t=e>0?"+":"-",n=Math.abs(e),a=Math.floor(n/60),r=n%60;return`GMT${t}${a}${r?`:${String(r).padStart(2,"0")}`:""}`}function m$e(e,t,n,a){const r=Foe((t-n)/a*60),i=new Date(e);return i.setHours(Math.floor(r/60),r%60,0,0),i.getTime()}function f$e(e,t,n){if(e.type==="cron")throw new Error(l("routines.cron.editToMove"));if(e.type==="once"||e.type==="limit_reset")return{type:"once",at:n};if(e.type==="interval")return{...e,anchorAt:e.anchorAt+(n-t)};const a=Math.round((Xi(n)-Xi(t))/864e5);return{type:"daily",time:FM(n),weekdays:e.weekdays.map(r=>((r+a)%7+7)%7).sort()}}function h$e(e,t,n,a){const r=new Map(e.map(u=>[u.id,u])),i=new Map,c=t.filter(u=>u.scheduledFor>=n&&u.scheduledFor<a).sort((u,p)=>p.scheduledFor-u.scheduledFor).filter(u=>{if(u.status==="queued"||u.status==="running"||u.status==="waiting")return!0;const p=i.get(u.routineId)??0;return p>=zoe?!1:(i.set(u.routineId,p+1),!0)}).map(u=>({id:`run-${u.id}`,at:u.scheduledFor,durationMinutes:zc,routine:r.get(u.routineId)??null,run:u})),d=(u,p)=>t.some(m=>m.routineId===u&&Math.abs(m.scheduledFor-p)<6e4);for(const u of e)if(u.enabled){if(u.schedule.type==="cron"){if(u.nextRunAt==null)continue;for(let p=Xi(Math.max(n,u.nextRunAt));p<a;p=Cd(p,1)){const m=Math.max(p,n,u.createdAt,u.nextRunAt)-1,h=Ooe(u.schedule,m,Poe);if(!h.length||h[0]>=a)break;p=Xi(h[0]);const x=Math.min(a,Cd(p,1));for(const g of h){if(g>=x)break;d(u.id,g)||c.push({id:`next-${u.id}-${g}`,at:g,durationMinutes:zc,routine:u,run:null})}}continue}if(u.schedule.type==="once"){const p=u.schedule.at;p>=n&&p<a&&!d(u.id,p)&&c.push({id:`next-${u.id}-${p}`,at:p,durationMinutes:zc,routine:u,run:null});continue}if(u.schedule.type==="interval"||u.schedule.type==="limit_reset"){const p=u.nextRunAt;p!=null&&p>=n&&p<a&&!d(u.id,p)&&c.push({id:`next-${u.id}-${p}`,at:p,durationMinutes:zc,routine:u,run:null});continue}for(let p=Xi(n);p<a;p=Cd(p,1)){if(!u.schedule.weekdays.includes(new Date(p).getDay()))continue;const m=m3(p,u.schedule.time);m>=n&&m<a&&m>=u.createdAt&&!d(u.id,m)&&c.push({id:`next-${u.id}-${m}`,at:m,durationMinutes:zc,routine:u,run:null})}}return c.sort((u,p)=>u.at-p.at)}function x$e(e,t){const n=Cd(e,t-1),a=new Date(e),r=new Date(n);if(t===1)return a.toLocaleDateString(dt(),{month:"long",day:"numeric",year:"numeric"});const i=a.getMonth()===r.getMonth()?"long":"short";return new Intl.DateTimeFormat(dt(),{month:i,day:"numeric",year:"numeric"}).formatRange(a,r)}function g$e(e,t,n){const a=[];for(const r of e){if(r.schedule.type==="once"){r.schedule.at>=t&&r.schedule.at<n&&a.push({id:`call-${r.id}-${r.schedule.at}`,at:r.schedule.at,durationMinutes:r.durationMinutes,call:r});continue}for(let i=Xi(t);i<n;i=Cd(i,1)){if(!r.schedule.weekdays.includes(new Date(i).getDay()))continue;const o=m3(i,r.schedule.time);o>=t&&o<n&&o>=r.createdAt&&a.push({id:`call-${r.id}-${o}`,at:o,durationMinutes:r.durationMinutes,call:r})}}return a.sort((r,i)=>r.at-i.at)}const eS={"Europe/London":"UK time","Europe/Belfast":"UK time","America/Phoenix":"Arizona time","Asia/Dubai":"UAE time"},Uoe=/^(?:Etc\/)?(?:UTC|UCT|GMT|Universal|Zulu|Greenwich)(?:[+-]0)?$/i,qoe=/^(?:[A-Z]{1,5}|GMT.*|UTC.*)$/;function tS(e,t,n){try{const a=new Intl.DateTimeFormat(t,{timeZone:e,timeZoneName:n}).formatToParts(new Date).find(r=>r.type==="timeZoneName")?.value;return a&&!qoe.test(a)?a:null}catch{return null}}function Hoe(e,t="en"){const n=t.toLowerCase().startsWith("en");if(Uoe.test(e.trim()))return"UTC";if(n&&eS[e])return eS[e];const a=tS(e,t,"shortGeneric")??tS(e,t,"longGeneric");if(a)return n?a.replace(/ Time$/," time"):a;const r=e.split("/").at(-1)?.replaceAll("_"," ").trim();return r?`${r} time`:e}const nS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],UM=["January","February","March","April","May","June","July","August","September","October","November","December"],Woe={1:"first",2:"second",3:"third",4:"fourth",5:"fifth",last:"last"};function qM(e){const[t,n,a,r,i]=e.trim().split(/\s+/);if(!/^\d+$/.test(t??"")||!/^\d+$/.test(n??""))return null;const o=`${n.padStart(2,"0")}:${t.padStart(2,"0")}`,c=/^\d+$/.test(a??"")?Number(a):null;if(i==="*"&&r==="*")return a==="*"?{kind:"everyDay",time:o}:a==="L"?{kind:"monthlyLastDay",time:o}:c===null?null:{kind:"monthlyDay",day:c,time:o};if(i==="*"&&/^\d+$/.test(r??"")&&c!==null)return UM[Number(r)-1]?{kind:"yearly",month:Number(r)-1,day:c,time:o}:null;if(a!=="*"||r!=="*")return null;if(i==="1-5"||i?.toUpperCase()==="MON-FRI")return{kind:"weekdays",time:o};if(/^[0-7]$/.test(i??""))return{kind:"weekly",weekday:Number(i)%7,time:o};const d=/^([0-7])#([1-5]|L)$/i.exec(i??"");return d?{kind:"monthlyNth",nth:d[2].toUpperCase()==="L"?"last":Number(d[2]),weekday:Number(d[1])%7,time:o}:null}function Koe(e){const t=e.time.replace(/^0(?=\d:)/,"");switch(e.kind){case"everyDay":return`Every day at ${t}`;case"monthlyLastDay":return`Monthly on the last day at ${t}`;case"monthlyDay":return`Monthly on day ${e.day} at ${t}`;case"yearly":return`Yearly on ${UM[e.month]} ${e.day} at ${t}`;case"weekdays":return`Every weekday at ${t}`;case"weekly":return`Weekly on ${nS[e.weekday]} at ${t}`;case"monthlyNth":return`Monthly on the ${Woe[e.nth]} ${nS[e.weekday]} at ${t}`}}function Voe(e){const t=qM(e.expression);return`${t?Koe(t):`Cron ${e.expression}`} ${Hoe(e.timeZone)}`}const Goe={1:"routines.cron.nth.first",2:"routines.cron.nth.second",3:"routines.cron.nth.third",4:"routines.cron.nth.fourth",5:"routines.cron.nth.fifth",last:"routines.cron.nth.last"},Yoe={1:"routines.cron.nthWeekend.first",2:"routines.cron.nthWeekend.second",3:"routines.cron.nthWeekend.third",4:"routines.cron.nthWeekend.fourth",5:"routines.cron.nthWeekend.fifth",last:"routines.cron.nthWeekend.last"},sS=e=>e===0||e===6,aS=e=>new Intl.DateTimeFormat(Ef(),{weekday:"long",timeZone:"UTC"}).format(Date.UTC(2023,0,1+e)),Joe=e=>new Intl.DateTimeFormat(Ef(),{month:"long",timeZone:"UTC"}).format(Date.UTC(2023,e,1));function Qoe(e){const t=tt()==="en"?e.time.replace(/^0(?=\d:)/,""):e.time;switch(e.kind){case"everyDay":return l("routines.cron.everyDay",{time:t});case"monthlyLastDay":return l("routines.cron.monthlyLastDay",{time:t});case"monthlyDay":return l("routines.cron.monthlyDay",{day:e.day,time:t});case"yearly":return l("routines.cron.yearly",{month:Joe(e.month),day:e.day,time:t});case"weekdays":return l("routines.cron.weekdays",{time:t});case"weekly":return l(sS(e.weekday)?"routines.cron.weeklySaturdaySunday":"routines.cron.weekly",{weekday:aS(e.weekday),time:t});case"monthlyNth":{const n=sS(e.weekday)?Yoe:Goe;return l(n[e.nth],{weekday:aS(e.weekday),time:t})}}}function f3(e){const t=qM(e.expression);return t?Qoe(t):null}function h3(e){return tt()==="en"?Voe(e):`${f3(e)??l("routines.cron.raw",{expression:e.expression})} · ${e.timeZone}`}const Xoe=6e4,HM=90;function WM(e){return e.blocked||(e.usedPercent??0)>=HM}const Zoe=6e4,KM=new Map;let Zi=null,E1=null,Xp=null;const Zm=new Set;function ele(e){return KM.get(e)??e.charAt(0).toUpperCase()+e.slice(1)}function VM(e){Zi={checkedAt:e?.checkedAt??0,engines:Array.isArray(e?.engines)?e.engines:[]};for(const t of Zi.engines)KM.set(t.engine,t.name);for(const t of Zm)t(Zi)}function rS(e){return Bf("/api/limit-resets",e,null).then(t=>{t&&VM(t)},()=>{})}function Ey(e=!1){return e?rS(()=>K("/api/limit-resets?refresh=1")):(E1??=rS(()=>K("/api/limit-resets",{background:!0})).finally(()=>{E1=null}),E1)}async function tle(e){VM(await K("/api/limit-resets/release",{method:"POST",body:JSON.stringify({engine:e})}))}const nle=()=>Zi?.checkedAt??0;function sle(){const[e,t]=f.useState(()=>Zi?.engines??[]);return f.useEffect(()=>{const n=a=>t(a.engines);return Zm.add(n),Zi&&t(Zi.engines),Ey(),Xp??=setInterval(()=>{Ey()},Zoe),()=>{Zm.delete(n),!Zm.size&&Xp&&(clearInterval(Xp),Xp=null)}},[]),e}function x3(e,t=Date.now()){const n=new Date(e),a=n.toDateString()===new Date(t).toDateString();return n.toLocaleString(dt(),a?{hour:"numeric",minute:"2-digit"}:{weekday:"short",hour:"numeric",minute:"2-digit"})}function GM(e,t=Date.now(),n=" · "){const a=e.blocked?l("limits.atLimit",{engine:e.name}):l("limits.used",{engine:e.name,percent:Math.round(e.usedPercent??0)});return e.resetsAt!==null&&e.resetsAt>t?`${a}${n}${l("limits.resets",{time:x3(e.resetsAt,t)})}`:a}const b$e=e=>e.filter(WM),ef=4,YM=e=>!!(e&&(e.blocked||e.usedPercent!==null));function lp(e){return e.blocked||(e.usedPercent??0)>=100?"out":WM(e)?"near":"fine"}function ale(e){const t=lp(e);if(t!=="fine")return t==="near"?1:0;const n=100-HM,a=(100-n)/3,r=100-(e.usedPercent??0);return r>n+2*a?4:r>n+a?3:2}function rle(e){const t=e.windows?.length?e.windows:YM(e)?[{window:e.window??"other",usedPercent:e.usedPercent??100,resetsAt:e.resetsAt}]:[],n=t.some(a=>a.window===e.window)?e.window:t[0]?.window;return t.map(a=>{const r=e.blocked&&a.window===n,i=r?"out":lp({usedPercent:a.usedPercent,blocked:!1});return{window:a.window,left:i==="out"?0:Math.max(0,100-Math.round(a.usedPercent)),resetsAt:r?e.resetsAt:a.resetsAt,tone:i}})}function ile(e){return e==="5-hour"?l("planUsage.fiveHour"):e==="weekly"?l("planUsage.weekly"):l("usage.title")}function y$e(e,t,n,a=Date.now()){return e.flatMap(r=>r.resetsAt!==null&&r.resetsAt>=Math.max(t,a)&&r.resetsAt<n?[{engine:r.engine,name:r.name,at:r.resetsAt}]:[])}function k$e(e,t,n,a=Date.now()){return n.resetsAt===null||n.resetsAt<=a?[]:e.filter(r=>r.enabled&&r.schedule.type!=="limit_reset"&&r.nextRunAt!==null&&r.nextRunAt<n.resetsAt+Xoe&&t(r.botId)===n.engine)}function JM(e){return l(e.repeat==="every_reset"?"automations.when.everyLimitReset":"automations.when.limitReset",{engine:ele(e.engine)})}const v$e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Ay(e){return new Date(2026,0,4+e).toLocaleDateString(dt(),{weekday:"short"})}function Zl(e){return new Date(e).toLocaleTimeString(dt(),mw(dt()))}function QM(e){return new Date(e).toLocaleDateString(dt(),{weekday:"long",month:"long",day:"numeric"})}function w$e(e){const t=new Date(e);return new Date().toDateString()===t.toDateString()?Zl(e):t.toLocaleDateString(dt(),{month:"short",day:"numeric"})}function j$e(e){return e<60?l("routines.duration.minutes",{minutes:e}):e%60===0?l("routines.duration.hours",{hours:e/60}):l("routines.duration.hoursMinutes",{hours:Math.floor(e/60),minutes:e%60})}function ole(e){return e<60?l("routines.interval.minutes",{minutes:e}):e===60?l("routines.interval.hour"):e%60===0?l("routines.interval.hours",{hours:e/60}):l("routines.interval.hoursMinutes",{hours:Math.floor(e/60),minutes:e%60})}function lle(e){const t=[];if(e.weekdays&&e.weekdays.length<7&&t.push(e.weekdays.join(",")==="1,2,3,4,5"?l("routines.schedule.weekdays"):e.weekdays.map(Ay).join(", ")),e.window){const n=a=>{const[r,i]=a.split(":").map(Number);return Zl(new Date(2e3,0,1,r,i).getTime())};t.push(`${n(e.window.start)}–${n(e.window.end)}`)}return e.endsAt!=null&&t.push(l("routines.schedule.until",{date:new Date(e.endsAt).toLocaleDateString(dt(),{month:"short",day:"numeric",year:"numeric"})})),t}function A1(e){if(e.type==="cron")return h3(e);if(e.type==="limit_reset")return JM(e);if(e.type==="once")return`${QM(e.at)}, ${Zl(e.at)}`;if(e.type==="interval")return[ole(e.everyMinutes),...lle(e)].join(" · ");const t=e.weekdays,n=t.length===7?l("routines.repeat.daily"):t.join(",")==="1,2,3,4,5"?l("routines.schedule.everyWeekday"):t.length===1?l("routines.schedule.weeklyOn",{day:Ay(t[0])}):t.map(Ay).join(", ");return l("routines.schedule.at",{label:n,time:Zl(m3(Date.now(),e.time))})}const cle=["name","title","description","soul","cwd","notifications","speakReplies"],XM=new Set(["ogb","computer","agents","composio","data","browser","email","device","phone","dweb","openmausbot_connectors","openmausbot_phone"]);function dle(e){const t=e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,32).replace(/-+$/,"");return/^[a-z]/.test(t)?t:t?`mcp-${t}`.slice(0,32).replace(/-+$/,""):""}function N$e(e){const t=dle(e);return XM.has(t)?`mcp-${t}`.slice(0,32):t}const ule=["failed","missed"],ple="Waiting for work it handed on to finish";function mle(e){return ule.includes(e.status)}const S$e="just-me",ZM="GMAIL_NEW_GMAIL_MESSAGE";function fle(e){const t=Object.entries(e).find(([n,a])=>/channel/i.test(n)&&typeof a=="string"&&a.trim())?.[1];if(t)return t.startsWith("#")||/^[CGD][A-Z0-9]{6,}$/.test(t)?t:`#${t}`}function hle(e){const t=e.filter??{},n=e.app==="slack"?fle(e.config):void 0,a=[n&&l("automations.app.in",{value:n}),t.from&&l("automations.app.from",{value:t.from}),t.subject&&l("automations.app.about",{value:t.subject}),t.label&&l("automations.app.labeled",{value:t.label}),t.text&&l("automations.app.mentioning",{value:t.text})].filter(Boolean),r=a.length?` ${a.join(" ")}`:"";return e.event===ZM?l("automations.app.when.email",{details:r}):e.app==="slack"&&/MESSAGE/.test(e.event)?l("automations.app.when.slack",{details:r}):l("automations.app.when.event",{event:e.eventName,app:e.appName,details:r})}function xle(e){return e.problem?.kind==="reconnect"?{reason:l("automations.reason.reconnect",{app:e.appName}),fix:"reconnect"}:e.problem?.kind==="error"?{reason:l("automations.reason.appError",{app:e.appName,error:e.problem.text}),fix:"edit"}:null}function e_(e,t){const n=[];return e.delivery==="poll"&&n.push(l("automations.app.checks")),!t&&!e.lastEventAt&&n.push(l(e.event===ZM?"automations.app.waitingEmail":"automations.app.waiting")),n}function gle(e){const t=e_(e,!1).join(" · ");return t.charAt(0).toLocaleUpperCase()+t.slice(1)}function ble(e,t=Date.now()){const n=e.skipped;if(!n||n.day!==new Date(t).toISOString().slice(0,10))return null;const a=[["dailyLimit",n.dailyLimit,"automations.skip.dailyLimit"],["queueFull",n.queueFull,"automations.skip.queueFull"],["expired",n.expired,"automations.skip.expired"],["tooMany",n.tooMany,"automations.skip.tooMany"]],r=a.reduce((o,[,c])=>o+c,0);if(!r)return null;const i=[...a].sort((o,c)=>c[1]-o[1])[0];return l("automations.panel.skippedToday",{count:r,reason:l(i[2])})}const yle={started:"automations.event.started",joined:"automations.event.joined",filtered:"automations.event.filtered",duplicate:"automations.event.duplicate",skipped:"automations.event.skipped",rejected:"automations.event.rejected"};function I$e(e){return{mark:e.outcome==="started"||e.outcome==="joined"?"✓":e.outcome==="rejected"?"✗":"·",text:[l(yle[e.outcome]),e.preview].filter(Boolean).join(" · ")}}function iS(e){return e.createdAt||e.startedAt||e.scheduledFor}function C$e(e,t){return t.filter(n=>n.routineId===e).reduce((n,a)=>!n||iS(a)>iS(n)?a:n,void 0)}function eg(e){return e.status==="failed"&&e.partial===!0&&!e.goalStatus}function E$e(e){if(e.goalStatus)return l(`routines.goal.${e.goalStatus}`);const t=l(eg(e)?"routines.status.partial":`routines.status.${e.status}`);return e.retried&&e.status!=="queued"?l(`routines.retried.${e.retried}`,{status:t}):t}function A$e(e){return e.status==="waiting"||eg(e)||["needs-input","limit-reached","paused"].includes(e.goalStatus??"")?"text-warning":["failed","missed"].includes(e.status)||["failed","blocked"].includes(e.goalStatus??"")?"text-danger":e.status==="running"?"text-accent":e.status==="completed"&&(!e.goalStatus||e.goalStatus==="completed")?"text-success":"text-ink-secondary"}function t_(e){return new Date(e).toLocaleString(tt(),{month:"short",day:"numeric",...mw(tt())})}function kle(e){return e.schedule.type==="once"&&e.nextRunAt==null&&e.schedule.at<=Date.now()}function vle(e){return kle(e)?l("routines.finishedSchedule"):e.enabled?l("routines.activeSchedule"):l("routines.pausedSchedule")}function T$e(e){return e.heldFor?l(`routines.heldFor.${e.heldFor}`):null}function M$e(e){return e.enabled?e.nextRunAt==null?l("routines.noNextRun"):l("routines.nextRun",{time:t_(e.nextRunAt)}):vle(e)}function _$e({roomGoal:e,runOn:t,computer:n,cloudHome:a}){const r=l(a?"routines.runsOn.cloudHomeHint":"routines.runsOn.localHint");return e?{label:l(a?"routines.runsOn.teamCloudHome":"routines.runsOn.team"),hint:r}:t==="cloud"?{label:l("routines.runsOn.boat"),hint:l(a?"routines.runsOn.boatHintCloudHome":"routines.runsOn.boatHint")}:n==="cloud"?{label:l("routines.runsOn.botCloud"),hint:r}:n==="vm"&&!a?{label:l("routines.runsOn.botVm"),hint:r}:{label:l(a?"routines.runsOn.cloudHome":"routines.runsOn.local"),hint:r}}function R$e(e,t){const n=e[t]??"";return t==="output"?si(e.outputCode,n):t==="error"?si(e.errorCode,n,e.errorParams):si(e.attentionCode,n,e.attentionParams)}const wu=e=>e.startedAt??e.scheduledFor??e.createdAt,wle=(e,t)=>wu(t)-wu(e);function n_(e){const t=a=>e.runs.filter(r=>r.routineId===a).sort(wle),n=e.bots&&new Set(e.bots.map(a=>a.id));return[...e.routines.map(a=>({kind:"schedule",id:a.id,name:a.name,botId:a.botId,instructions:a.prompt,enabled:a.enabled,schedule:a.schedule,nextRunAt:a.enabled?a.nextRunAt:null,runs:t(a.id),...a.checkedAt!==void 0?{checkedAt:a.checkedAt}:{},...a.checkTrouble?{checkTrouble:a.checkTrouble,...a.checkTroubleCode?{checkTroubleCode:a.checkTroubleCode}:{}}:{},...a.access==="read-and-draft"?{readsAndDrafts:!0}:{}})),...e.webhooks.map(a=>({kind:"webhook",id:a.id,name:a.name,botId:a.botId,instructions:a.prompt,enabled:a.enabled,eventTypes:a.eventTypes,nextRunAt:null,runs:t(a.id)})),...(e.appTriggers??[]).map(a=>({kind:"app",id:a.id,name:a.name,botId:a.botId,instructions:a.prompt,enabled:a.enabled,appTrigger:a,nextRunAt:null,runs:t(a.id)}))].filter(a=>!n||n.has(a.botId))}function jle(e){return e.some(t=>t.runs.some(n=>mle(n)&&!n.seenAt))}function Nle(e,t){return n_({routines:e.kind==="schedule"?t.routines.filter(n=>n.id===e.id):[],webhooks:e.kind==="webhook"?t.webhooks.filter(n=>n.id===e.id):[],appTriggers:e.kind==="app"?(t.appTriggers??[]).filter(n=>n.id===e.id):[],runs:t.runs,bots:t.bots})[0]??null}function s_(e){if(!e.autoApplied||e.answered!=="allow"||e.held)return null;const t=e.routineRequest;if(t?.operation.action==="create"&&t.resultId)return{kind:"schedule",id:t.resultId};const n=e.webhookRequest;if(n?.operation.action==="create"&&n.resultId)return{kind:"webhook",id:n.resultId};const a=e.appTriggerRequest;return a?.operation.action==="create"&&a.resultId?{kind:"app",id:a.resultId}:null}const a_=1440*6e4,oh=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()},Aa=()=>tt();function eo(e,t=!1){const n=new Date(e);return n.toLocaleTimeString(Aa(),mw(Aa(),t&&n.getMinutes()===0))}function lh(e,t=Date.now()){const n=Math.round((oh(t)-oh(e))/a_);return n<=0?l("automations.time.today",{time:eo(e)}):n===1?l("automations.time.yesterday"):n<7?l("automations.time.dayAt",{day:new Date(e).toLocaleDateString(Aa(),{weekday:"short"}),time:eo(e)}):new Date(e).toLocaleDateString(Aa(),{month:"short",day:"numeric"})}function g3(e,t=Date.now()){const n=Math.round((oh(e)-oh(t))/a_);return n<=0?l("automations.time.today",{time:eo(e)}):n===1?l("automations.time.tomorrow",{time:eo(e)}):n<7?l("automations.time.dayAt",{day:new Date(e).toLocaleDateString(Aa(),{weekday:"long"}),time:eo(e)}):new Date(e).toLocaleDateString(Aa(),{month:"short",day:"numeric"})}const r_=e=>e.charAt(0).toLocaleUpperCase(Aa())+e.slice(1),T1=e=>{const[t,n]=e.split(":").map(Number),a=new Date;return a.setHours(t??0,n??0,0,0),eo(a.getTime(),!0)},Sle=(e,t)=>new Date(2026,0,4+e).toLocaleDateString(Aa(),{weekday:t});function i_(e){if(e.type==="limit_reset")return JM(e);if(e.type==="once")return l("automations.when.once",{date:new Date(e.at).toLocaleDateString(Aa(),{weekday:"long",month:"long",day:"numeric"}),time:eo(e.at,!0)});if(e.type==="cron"){const r=/^\*\/([1-5]?\d) \* \* \* \*$/.exec(e.expression.trim())?.[1];return r&&Number(r)>=2?l("automations.when.everyMinutes",{count:Number(r)}):f3(e)?h3(e):l("automations.when.custom")}if(e.type==="interval"){const r=e.everyMinutes;let i=r===60?l("automations.when.everyHour"):r%60===0?l("automations.when.everyHours",{count:r/60}):l("automations.when.everyMinutes",{count:r});return e.weekdays?.join(",")==="1,2,3,4,5"&&(i=l("automations.when.onWeekdays",{when:i})),e.window&&(i=l("automations.when.between",{when:i,start:T1(e.window.start),end:T1(e.window.end)})),i}const t=T1(e.time),n=e.weekdays;if(n.length===7)return l("automations.when.everyDay",{time:t});if(n.join(",")==="1,2,3,4,5")return l("automations.when.everyWeekday",{time:t});const a=n.map(r=>Sle(r,n.length===1?"long":"short"));return l("automations.when.everyDays",{days:new Intl.ListFormat(Aa(),{type:"conjunction"}).format(a),time:t})}const oS={have:"has",do:"does",go:"goes",be:"is"},Ile=new Set(["if","when","whenever","every","each","please","the","a","an","you","i","we","my","our","your","this","that","on","at","for","after","before"]),M1=60,Cle="add|archive|book|check|create|draft|email|file|flag|forward|label|list|message|move|notify|open|ping|post|reply|report|review|save|schedule|send|share|summarize|tell|update|write";function lS(e){const t=e.toLowerCase();return oS[t]?oS[t]:/(s|sh|ch|x|z|o)$/.test(t)?`${t}es`:/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:`${t}s`}const cS=e=>new RegExp("\\p{Lu}","u").test(e.slice(1)),Ele=/\s+(?:in|from|of|inside)\s+(?:the\s+)?(?:(?:incoming|webhook|trigger|app)\s+)?(?:event(?:'s)?(?:\s+(?:data|payload|body))?|payload|webhook(?:\s+(?:data|body|payload|call))?|trigger(?:\s+(?:data|payload))?)$/i;function Ale(e,t=tt().startsWith("en")){let n=e.replace(/^\s*please\s+/i,"").split(/[.:;!?\n]|\s[—–-]\s/)[0]?.trim().replace(Ele,"")??"";if(!n)return l("automations.does.default");if(t){n=n.replace(/\bme\b/gi,"you").replace(/\bmy\b/gi,"your").replace(/\bmine\b/gi,"yours").replace(/\bI\b/g,"you");const[r="",...i]=n.split(/\s+/);n=cS(r)?n:/^[A-Za-z]+$/.test(r)&&!Ile.has(r.toLowerCase())?[lS(r),...i].join(" ").replace(new RegExp(`\\b(and|then) (${Cle})\\b`,"g"),(o,c,d)=>`${c} ${lS(d)}`):n.charAt(0).toLowerCase()+n.slice(1)}else cS(n.split(/\s/)[0]??"")||(n=n.charAt(0).toLocaleLowerCase(Aa())+n.slice(1));if(n.length<=M1)return n;const a=n.slice(0,M1);return`${a.slice(0,a.lastIndexOf(" ")>20?a.lastIndexOf(" "):M1).trimEnd()}…`}const dS=new Set(["lead","leads","trigger","triggers","webhook","webhooks","hook","hooks","event","events","call","calls","request","requests","message","messages","notification","notifications","update","updates"]),Tle=/\b(form|forms|app|site|website|store|shop|crm|inbox|sheet|zapier|typeform|tally|jotform|stripe|github|gitlab|shopify|hubspot|salesforce|slack|gmail|calendar|notion|airtable|webflow|wordpress|n8n|ifttt|make)\b/i;function Mle(e){const t=e.trim().split(/\s+/).filter(Boolean);for(;t.length&&dS.has(t.at(-1).toLowerCase());)t.pop();for(;t.length&&dS.has(t[0].toLowerCase());)t.shift();return!t.length||t.length>4||t.some(n=>/\d/.test(n))||!Tle.test(t.join(" "))?l("automations.source.other"):(t.length>1&&/^[A-Z][a-z]+$/.test(t[0])&&(t[0]=t[0].toLowerCase()),l("automations.source.named",{name:t.join(" ")}))}function o_(e,t){const n=Ale(e.instructions);return e.kind==="app"&&e.appTrigger?l("automations.sentence.appEvent",{when:hle(e.appTrigger),bot:t,does:n}):e.kind==="schedule"&&e.schedule?l("automations.sentence.schedule",{when:i_(e.schedule),bot:t,does:n}):l("automations.sentence.app",{source:Mle(e.name),bot:t,does:n})}const Ty=e=>e.status==="failed"||e.status==="missed",l_=/sign(ed)?[ -]?(in|out)\b|log(ged)?[ -]?(in|out)\b|unauthori[sz]ed|\b401\b|not authenticated|authentication (failed|required)|(token|session|credential)s? (has |have )?expired|expired (token|session|credential)|invalid api key|reconnect/i,_le=/credit|quota|billing|payment|insufficient|out of tokens|usage limit|rate.?limit|\b429\b|limit (reached|exceeded)|plan limit/i,Rle=/run limit|time limit|timed out|minute limit/i;function c_(e){const t=`${e.error??""} ${e.goalStatus==="limit-reached"?"run limit":""}`;return l_.test(t)?{reason:l("automations.reason.signIn"),fix:"sign-in"}:Rle.test(t)?{reason:l("automations.reason.timeLimit"),fix:"edit"}:_le.test(t)?{reason:l("automations.reason.usage"),fix:"usage"}:null}const d_=e=>e.target==="bot"&&e.attention===ple;function Ole(e){const t=e.find(n=>n.status!=="cancelled"&&n.status!=="queued"&&!(n.status==="waiting"&&d_(n)));return t?.status==="waiting"?t:void 0}function tg(e,t=Date.now()){if(!e.enabled)return Lle(e,t)?{state:"done"}:{state:"paused"};const n=e.appTrigger&&xle(e.appTrigger);if(n)return{state:"needs-you",...n};if(e.checkTrouble)return{state:"needs-you",reason:si(e.checkTroubleCode,e.checkTrouble),fix:l_.test(e.checkTrouble)?"reconnect":"run"};const a=e.runs.filter(i=>i.status!=="cancelled"&&i.status!=="queued"),r=a[0];if(Ole(a))return{state:"needs-you",reason:l("automations.reason.answer"),fix:"answer"};if(r&&Ty(r)){const i=c_(r);if(i)return{state:"needs-you",...i};let o=0;for(const c of a){if(!Ty(c))break;o+=1}if(o>=2)return{state:"needs-you",reason:l("automations.reason.repeated",{count:o}),fix:"run"}}return{state:"working"}}const Lle=(e,t=Date.now())=>e.schedule?.type==="once"&&e.schedule.at<=t||e.schedule?.type==="limit_reset"&&e.schedule.repeat==="once"&&e.schedule.at!==null&&e.schedule.at<=t,zle={working:"automations.status.working",paused:"automations.status.paused","needs-you":"automations.status.needsYou",done:"automations.status.done"},Ple={"needs-you":0,working:1,paused:2,done:3};function O$e(e){return e.map(t=>({automation:t,rank:Ple[tg(t).state]})).sort((t,n)=>t.rank-n.rank||(t.automation.nextRunAt??1/0)-(n.automation.nextRunAt??1/0)||t.automation.name.localeCompare(n.automation.name)).map(({automation:t})=>t)}function u_(e,t=Date.now()){return e.nextRunAt==null||e.appTrigger||e.checkedAt!==void 0||tg(e,t).state!=="working"||e.runs.some(n=>n.status!=="queued")?null:l("automations.firstRun",{when:g3(e.nextRunAt,t)})}function L$e(e,t=Date.now()){const n=u_(e,t);if(n)return e.readsAndDrafts?`${n} · ${l("automations.readsAndDrafts")}`:n;const a=tg(e,t),r=e.runs.find(o=>o.status!=="queued"),i=[l(zle[a.state])];return r?.status==="running"?i.push(l("automations.runningNow")):e.checkedAt!==void 0&&(!r||e.checkedAt>=(r.finishedAt??wu(r)))?i.push(l("automations.checkedNothingNew",{when:lh(e.checkedAt,t)})):r?i.push(`${l("automations.lastRan",{when:lh(wu(r),t)})}${eg(r)?" !":Ty(r)?" ✗":""}`):e.appTrigger||i.push(l("automations.notRunYet")),e.appTrigger&&i.push(...e_(e.appTrigger,!!r),...[ble(e.appTrigger,t)??[]].flat()),e.nextRunAt!=null&&i.push(l("automations.next",{when:g3(e.nextRunAt,t)})),e.readsAndDrafts?i.push(l("automations.readsAndDrafts")):e.enabled&&e.schedule?.type==="limit_reset"&&i.push(l("automations.limit.timeUnknown")),i.join(" · ")}function uS(e,t=Date.now()){const n=o=>(o??"").split(`
112
- `).map(c=>c.trim()).find(Boolean)??"",a=o=>o.length>110?`${o.slice(0,109).trimEnd()}…`:o,r=r_(lh(wu(e),t));if(e.status==="completed")return{when:r,mark:"✓",text:e.report?.state==="quiet"?l("automations.run.nothingNew"):a(n(e.output))||l("automations.run.done")};if(e.status==="waiting")return d_(e)?{when:r,mark:"…",text:l("automations.run.waitingOnTeam")}:{when:r,mark:"!",text:l("automations.reason.answer")};if(e.status==="running"||e.status==="queued")return{when:r,mark:"…",text:l("automations.runningNow")};if(e.status==="cancelled"){const o=a(n(e.error&&si(e.errorCode,e.error,e.errorParams)));return{when:r,mark:"✗",text:o?l("automations.run.stoppedBecause",{reason:o}):l("automations.run.stopped")}}const i=a(n(e.error&&si(e.errorCode,e.error,e.errorParams)));return eg(e)?{when:r,mark:"!",text:l("automations.run.partial",{reason:i})}:{when:r,mark:"✗",text:c_(e)?.reason??(i||l("automations.run.failed"))}}const z$e={answer:"automations.fix.answer","sign-in":"automations.fix.signIn",usage:"automations.fix.usage",edit:"automations.fix.edit",run:"automations.fix.run",reconnect:"automations.fix.reconnect"},Dle=30,$le=240;function Ble(e){if(e.outcome==="accepted")return{ok:!0,reason:l("automations.calls.received")};if(e.outcome==="captured")return{ok:!0,reason:l("automations.calls.test")};if(e.outcome==="duplicate")return{ok:!1,reason:l("automations.calls.duplicate")};if(e.outcome==="ignored")return{ok:!1,reason:e.eventName?l("automations.calls.skipped",{kind:e.eventName}):l("automations.calls.noKind")};const t=Number(/\((\d+) requests\)/.exec(e.reason??"")?.[1]??1);return e.statusCode===401?{ok:!1,reason:t>1?l("automations.calls.wrongSecretTimes",{count:t}):l("automations.calls.wrongSecret")}:e.statusCode===409?{ok:!1,reason:l("automations.calls.paused")}:e.statusCode===410?{ok:!1,reason:l("automations.calls.botGone")}:e.statusCode===429?{ok:!1,reason:/rate limit/i.test(e.reason??"")?l("automations.calls.tooFast"):l("automations.calls.tooMany")}:e.statusCode===413?{ok:!1,reason:l("automations.calls.tooLarge")}:e.statusCode===400?{ok:!1,reason:l("automations.calls.unreadable")}:{ok:!1,reason:l("automations.calls.refused")}}function P$e(e,t){return t.filter(n=>n.webhookId===e).sort((n,a)=>a.receivedAt-n.receivedAt).slice(0,Dle).map(n=>({id:n.id,at:n.receivedAt,...Ble(n),preview:(n.preview??"").slice(0,$le)}))}function D$e(e,t){const n=t.filter(a=>a.webhookId===e.id&&a.outcome!=="rejected"&&a.preview).reduce((a,r)=>!a||r.receivedAt>a.receivedAt?r:a,null);return n?{at:n.receivedAt,preview:n.preview}:e.verificationSample?.preview?{at:e.verificationSample.receivedAt,preview:e.verificationSample.preview}:null}function $$e(e,t){return e.kind==="schedule"&&e.schedule?`${i_(e.schedule)} · ${t}`:o_(e,t)}const Fle=1e4;let Il=null,_1=!1,ch=null;const xl=new Set;function p_(){if(ch=null,!(Il!==null||_1||!xl.size)){if(typeof window<"u"&&window.ogb?.remoteClient?.active===!0){Il=!0;for(const e of xl)e(!0);return}_1=!0,bo().then(e=>e.kind==="unreachable"?null:pH(e),()=>null).then(e=>{_1=!1,e!==null&&(Il=e);for(const t of xl)t(e??!1);e===null&&xl.size&&(ch=setTimeout(p_,Fle))})}}function Ks(){const[e,t]=f.useState(Il??(ch?!1:null));return f.useEffect(()=>(xl.add(t),Il!==null?t(Il):ch?t(!1):p_(),()=>{xl.delete(t)}),[]),e}const Ule="Limix Bot can't use this computer yet — ",m_={chrome:"Chrome","google chrome":"Chrome",chromium:"Chromium",safari:"Safari",firefox:"Firefox","mozilla firefox":"Firefox",edge:"Edge","microsoft edge":"Edge",msedge:"Edge",brave:"Brave","brave browser":"Brave",arc:"Arc",opera:"Opera",vivaldi:"Vivaldi"};function qle(e){if(typeof e!="string")return;const t=e.trim().replace(/\.(?:app|exe)$/i,"");if(!(!t||t.length>28||t.split(" ").length>3||!/^[\p{L}\p{N}](?:[\p{L}\p{N}&'+-]| (?! ))*$/u.test(t)))return m_[t.toLowerCase()]??t}function Hle(e){if(typeof e!="string"||e.length>253)return;const t=e.trim().toLowerCase().replace(/^www\./,"");return/^(?=.{1,100}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$/.test(t)?t:void 0}function Wle(e={}){const t=qle(e.app),n=Hle(e.site),a=t&&Object.values(m_).includes(t)?t:void 0;return a&&n?{key:"approval.yourComputer.browserSite",params:{app:a,site:n}}:a?{key:"approval.yourComputer.browser",params:{app:a}}:n?{key:"approval.yourComputer.site",params:{site:n}}:t?{key:"approval.yourComputer.app",params:{app:t}}:{key:"approval.yourComputer.screen",params:{}}}function b3(e,t){if(!e?.yourComputer)return;const{key:n,params:a}=Wle(e.yourComputer);return{line:l(n,a),detail:l("approval.yourComputer.detail",{name:t})}}function Kle(e){return e==="computer"?l("vm.host.computer"):e}const Vle="https://www.openmausbot.com/download";function Gle(e){return e==="paused"||e==="permissions"||e==="blocked"||e==="off"||e==="not-running"||e==="terminal-off"}function Yle(e){return e==="closed"||e==="never"||e==="update"}const Jle={screen:"computerAsk.want.screen",folders:"computerAsk.want.folders",terminal:"computerAsk.want.terminal"};function Qle(e){return{key:Jle[e.need],params:{device:e.device}}}function Xle(e,t){const n={device:e.device,name:t};switch(e.reason){case"paused":return{key:"computerAsk.reason.paused",params:n};case"starting":return{key:"computerAsk.reason.starting",params:n};case"permissions":return{key:"computerAsk.reason.permissions",params:n};case"blocked":return{key:e.device==="PC"?"computerAsk.reason.blockedPc":"computerAsk.reason.blocked",params:n};case"off":return{key:"computerAsk.reason.off",params:n};case"unsupported":return{key:"computerAsk.reason.unsupported",params:n};case"terminal-off":return{key:"computerAsk.reason.terminalOff",params:n};case"closed":return{key:"computerAsk.reason.closed",params:n};case"never":return{key:"computerAsk.reason.never",params:n};case"update":return{key:"computerAsk.reason.update",params:n};default:return{key:"computerAsk.reason.notRunning",params:n}}}const Zle={"turning-on":"computerAsk.state.turningOn",on:"computerAsk.state.on",declined:"computerAsk.state.declined",ended:"computerAsk.state.ended"};function ng(e,t){const n=e?.computerAsk;if(!n)return;const a=Qle(n),r=Xle(n,t),i=n.state==="failed",o=Zle[n.state],c=Kle(n.device);return{line:l(a.key,{...a.params,device:c,name:t}),...n.why?{why:n.why}:{},reason:`${i?`${l("computerAsk.state.failed")} `:""}${l(r.key,{...r.params,device:c})}`,...Gle(n.reason)?{turnOn:l(i?"computerAsk.action.tryAgain":"computerAsk.action.turnOn")}:{},...Yle(n.reason)?{getApp:l("computerAsk.action.getApp")}:{},...o?{outcome:l(o,{name:t})}:{}}}const ece={enable:"mcp.turnOn",update:"mcp.request.change",remove:"mcp.request.remove"};function f_(e){return l(ece[e])}const y3="omb-webhook-credentials";function tce(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return[t.endpointUrl,t.secret,t.url].every(n=>typeof n=="string"&&n.length>0)}function k3(e){try{const t=e?.getItem(y3),n=t?JSON.parse(t):null;return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(a=>tce(a[1])))}catch{return{}}}function My(e,t,n){const a=k3(e);a[t]=n;try{e?.setItem(y3,JSON.stringify(a))}catch{}}function nce(e,t){const n=k3(e);delete n[t];try{e?.setItem(y3,JSON.stringify(n))}catch{}}function md(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}const h_={loaded:!1,triggers:[],attempts:[],service:null};let Zs=h_;const _y=new Set;let pS=!1,R1=null;function fd(e){Zs=e;for(const t of _y)t()}function x_(e){fd({loaded:!0,triggers:e.triggers,attempts:e.attempts.slice(-2e3),service:e.service})}function v3(e){if(e.kind==="app-trigger"){const t=Zs.triggers.some(n=>n.id===e.trigger.id);fd({...Zs,triggers:t?Zs.triggers.map(n=>n.id===e.trigger.id?e.trigger:n):[e.trigger,...Zs.triggers]})}else e.kind==="app-trigger.deleted"?fd({...Zs,triggers:Zs.triggers.filter(t=>t.id!==e.triggerId),attempts:Zs.attempts.filter(t=>t.triggerId!==e.triggerId)}):e.kind==="app-trigger.attempt"?fd({...Zs,attempts:[...Zs.attempts.filter(t=>t.id!==e.attempt.id),e.attempt].slice(-2e3)}):e.kind==="app-trigger.service"&&fd({...Zs,service:e.service})}function mS(){return R1??=K("/api/app-triggers").then(x_).catch(()=>{}).finally(()=>{R1=null}),R1}function sce(){pS||typeof window<"u"&&window.ogb?.remoteClient?.active||(pS=!0,Wx({onFrame:v3,onMissedFrames:()=>{mS()}}),mS())}function g_(){return f.useEffect(sce,[]),f.useSyncExternalStore(e=>(_y.add(e),()=>_y.delete(e)),()=>Zs,()=>h_)}const fS=e=>v3({kind:"app-trigger",botId:e.botId,trigger:e}),O1={events:e=>K(`/api/app-triggers/events?${new URLSearchParams({botId:e})}`),async create(e){const{trigger:t}=await K("/api/app-triggers",{method:"POST",body:JSON.stringify(e)});return fS(t),t},async update(e,t){const{trigger:n}=await K(`/api/app-triggers/${e}`,{method:"PATCH",body:JSON.stringify(t)});return fS(n),n},async remove(e){await K(`/api/app-triggers/${e}`,{method:"DELETE"}),v3({kind:"app-trigger.deleted",triggerId:e})},test:e=>K(`/api/app-triggers/${e}/test`,{method:"POST"}),async sync(){x_(await K("/api/app-triggers/sync",{method:"POST"}))}};function ace(){const{state:e,dispatch:t}=re(),n=et(),[a,r]=f.useState(null),[i,o]=f.useState(""),[c,d]=f.useState(null),[u,p]=f.useState(null),m=async(b,k)=>{if(!a){r(b),o(""),d(null);try{await k()}catch(j){o(j instanceof Error?j.message:String(j)),d(b)}finally{r(null)}}};return{busy:a,error:i,errorFor:c,setError:o,copied:u,toggle:b=>m(`toggle:${b.id}`,async()=>{if(b.kind==="schedule"){const j=await K(`/api/routines/${b.id}`,{method:"PATCH",body:JSON.stringify({enabled:!b.enabled})});t({type:"routinePatched",routine:j.routine});return}const k=await K(`/api/webhooks/${b.id}`,{method:"PATCH",body:JSON.stringify({enabled:!b.enabled,verificationPending:!1})});t({type:"webhookPatched",webhook:k.webhook})}),runNow:b=>m(`run:${b.id}`,()=>b.kind==="schedule"?new Promise((k,j)=>t({type:"runRoutine",routineId:b.id,onStarted:()=>k(),onError:j})):K(`/api/webhooks/${b.id}/test`,{method:"POST",body:JSON.stringify({event:"openmaus.test",message:"A test run from Automations"})})),remove:async(b,k)=>window.confirm(k)?b.kind==="schedule"?(t({type:"deleteRoutine",routineId:b.id}),!0):(await m(`delete:${b.id}`,async()=>{await K(`/api/webhooks/${b.id}`,{method:"DELETE"}),t({type:"webhookDeleted",webhookId:b.id}),nce(md(),b.id)}),!0):!1,copyAddress:(b,k=!1)=>m(`copy:${b}`,async()=>{let j;if(k||(j=await K(`/api/webhooks/${b}/address`).then(N=>N.credential,()=>{})??k3(md())[b],j&&My(md(),b,j)),!j){const N=await K(`/api/webhooks/${b}/rotate`,{method:"POST"});j=N.credential,t({type:"webhookPatched",webhook:N.webhook}),My(md(),b,j)}if(await aa(j.url)!=="copied")throw new Error(l("automations.address.copyAddressFailed"));p(b),setTimeout(()=>p(N=>N===b?null:N),1800)}),openRun:(b,k)=>{const j=e.bots.find(N=>N.id===b.botId);j&&k?.threadId&&Qi(t,j,k.threadId,n)},cancelRun:(b,k)=>m(`cancel:${b.id}`,async()=>{const j=await K(`/api/routine-runs/${k.id}/cancel`,{method:"POST"});j.run&&t({type:"routineRunPatched",run:j.run})})}}function rce(){const e=ace(),[t,n]=f.useState(null),[a,r]=f.useState(""),i=async(o,c)=>{if(!(t||e.busy)){n(o),r("");try{await c()}catch(d){r(d instanceof Error?d.message:String(d))}finally{n(null)}}};return{...e,busy:t??e.busy,error:a||e.error,setError:o=>{r(o),e.setError(o)},toggle:o=>o.kind==="app"?void i(`toggle:${o.id}`,()=>O1.update(o.id,{enabled:!o.enabled})):e.toggle(o),runNow:o=>o.kind==="app"?i(`run:${o.id}`,()=>O1.test(o.id)):e.runNow(o),remove:async(o,c)=>o.kind!=="app"?e.remove(o,c):window.confirm(c)?(await i(`delete:${o.id}`,()=>O1.remove(o.id)),!0):!1}}const ice=f.lazy(async()=>({default:(await Oe(async()=>{const{RoutineEditor:e}=await import("./RoutinesPage-CusNYUVf.js").then(t=>t.c);return{RoutineEditor:e}},__vite__mapDeps([5,1,2,6,3,4,7,8]))).RoutineEditor})),oce=f.lazy(async()=>({default:(await Oe(async()=>{const{WebhookEditor:e}=await import("./WebhookTrigger-Ca8w_FmT.js");return{WebhookEditor:e}},__vite__mapDeps([9,1,2,3,4,6,10,8]))).WebhookEditor})),lce=f.lazy(async()=>({default:(await Oe(async()=>{const{AppEventEditor:e}=await import("./AppEventEditor-Btah_c_2.js");return{AppEventEditor:e}},__vite__mapDeps([11,1,2,3,4,9,6,10,8]))).AppEventEditor})),Zp="rounded-md px-1.5 py-0.5 font-medium hover:bg-inset focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50";function cce({card:e,threadId:t}){const{state:n,dispatch:a}=re(),r=rce(),i=g_(),[o,c]=f.useState(!1),[d,u]=f.useState(!1),[p,m]=f.useState(),h=s_(e);if(!h)return null;const x=Nle(h,{routines:n.routines,webhooks:n.webhooks,appTriggers:i.triggers,runs:n.routineRuns,bots:n.bots}),g=e.routineRequest?.undo?.name??e.webhookRequest?.undo?.name??e.appTriggerRequest?.undo?.name??e.title;if(e.undone||!x)return!e.undone&&h.kind==="schedule"&&n.routinesLoadState==="loading"||!e.undone&&h.kind==="app"&&!i.loaded?null:s.jsxs("div",{"data-trigger-card":h.id,className:"flex w-full max-w-[840px] items-center gap-2 text-[13px] text-ink-tertiary",children:[e.undone?s.jsx(Z7,{size:13}):s.jsx(Sr,{size:13}),s.jsx("span",{children:e.undone?l("automations.card.removed"):`${l("automations.card.gone")} · ${g}`})]});const v=n.bots.find(M=>M.id===x.botId)?.name??l("routines.unavailableBot"),y=o_(x,v),w=tg(x),b=x.runs.find(M=>M.status!=="queued"),k=x.nextRunAt!=null?g3(x.nextRunAt):null,j=b&&`${l("automations.card.lastRan",{when:lh(b.startedAt??b.scheduledFor)})} ${uS(b).mark} ${uS(b).text}`;let N;w.state==="paused"?N=l("automations.status.paused"):w.state==="done"?N=[l("automations.status.done"),j].filter(Boolean).join(" · "):w.state==="needs-you"?N=l("automations.needsYou",{reason:w.reason??""}):j?N=[j,k&&l("automations.next",{when:k})].filter(Boolean).join(" · "):N=u_(x)??(k?l("automations.card.next",{when:k}):x.appTrigger?gle(x.appTrigger):r_(l("automations.notRunYet")));const A=()=>{!t||!e.requestId||d||(u(!0),m(void 0),K(`/api/threads/${t}/undo`,{method:"POST",body:JSON.stringify({requestId:e.requestId})}).catch(M=>m(M instanceof ln&&M.body?.code==="changed-since"?l("automations.card.changedSince"):M instanceof Error?M.message:String(M))).finally(()=>u(!1)))},T=n.bots.filter(M=>!M.hidden);return s.jsxs("section",{"data-trigger-card":x.id,"data-automation-status":w.state,"aria-label":y,className:"w-full max-w-[640px] rounded-xl border border-hairline/45 bg-card px-3.5 py-2.5 text-[13px]",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Sr,{size:14,className:I("mt-0.5 shrink-0",w.state==="needs-you"?"text-warning":x.enabled?"text-accent":"text-ink-tertiary")}),s.jsx("button",{type:"button",onClick:()=>a({type:"showRoutines",view:"list",routineId:x.id}),className:"min-w-0 text-left font-medium leading-snug text-ink hover:text-accent-text",children:l("automations.card.setUp",{sentence:y})})]}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 pl-[22px] text-[12px]",children:[s.jsx("span",{className:I("min-w-0 flex-1 basis-48 truncate",w.state==="needs-you"?"text-warning":"text-ink-secondary"),title:N,children:N}),s.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-ink-secondary",children:[w.state!=="done"&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",disabled:!!r.busy,onClick:()=>{r.toggle(x)},className:Zp,children:x.enabled?l("automations.pause"):l("automations.resume")}),s.jsx("span",{"aria-hidden":"true",children:"·"})]}),s.jsx("button",{type:"button",onClick:()=>c(!0),className:Zp,children:l("automations.edit")}),x.kind==="webhook"&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",children:"·"}),s.jsx("button",{type:"button",disabled:!!r.busy,onClick:()=>{r.copyAddress(x.id)},className:Zp,children:r.copied===x.id?l("automations.address.copied"):l("automations.address.copy")})]}),t&&e.requestId&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",children:"·"}),s.jsx("button",{type:"button",onClick:A,disabled:d,className:I(Zp,"text-accent"),children:d?l("automations.card.undoing"):l("automations.card.undo")})]})]})]}),(p||r.error)&&s.jsx("div",{role:"alert",className:"mt-1 pl-[22px] text-[12px] text-warning",children:p??r.error}),o&&Ke.createPortal(s.jsx(f.Suspense,{fallback:null,children:x.kind==="app"?s.jsx(lce,{trigger:x.appTrigger,bots:T,onClose:()=>c(!1)}):x.kind==="schedule"?s.jsx(ice,{routine:n.routines.find(M=>M.id===x.id),bots:T,plain:!0,onClose:()=>c(!1)}):s.jsx(oce,{webhook:n.webhooks.find(M=>M.id===x.id),bots:T,onClose:()=>c(!1),onCredential:(M,S)=>My(md(),S,M)})}),document.body)]})}const dce={"spot.approval":"onboarding.hint.approval","spot.connector":"onboarding.hint.connector"},hS=new Set;function uce(){try{return re()}catch{return null}}function b_({id:e}){const t=uce(),n=t?.dispatch,a=nt(),r=t?.state.config?.onboarding,[i]=f.useState(()=>!!n&&!a&&!!r?.completedAt&&!Cn(r,e)&&!hS.has(e));return f.useEffect(()=>{if(!i)return;hS.add(e);const o=ko(r,e);o&&K("/api/config",{method:"PUT",body:JSON.stringify(o)}).then(c=>n?.({type:"configStatus",config:c})).catch(()=>{})},[i]),i?s.jsx("p",{"data-card-hint":e,className:"text-[12px] leading-4 text-ink-secondary",children:l(dce[e])}):null}const pce={create:"approval.status.routineScheduled",update:"approval.status.routineUpdated",pause:"approval.status.routinePaused",resume:"approval.status.routineResumed",run_now:"approval.status.routineRunQueued",delete:"approval.status.routineDeleted"},mce={create:"approval.status.skillEnabled",update:"approval.status.skillUpdated",enable:"approval.status.skillTurnedOn",disable:"approval.status.skillTurnedOff",delete:"approval.status.skillDeleted"},xS={create:"approval.applied.automation.create",update:"approval.applied.automation.update",pause:"approval.applied.automation.pause",resume:"approval.applied.automation.resume",run_now:"approval.applied.automation.runNow",delete:"approval.applied.automation.delete"},fce={waiting:"approval.applied.wait",fired:"approval.applied.waitFired",expired:"approval.applied.waitExpired",cancelled:"approval.applied.waitCancelled"},hce={create:"approval.applied.skill.create",update:"approval.applied.skill.update",enable:"approval.applied.skill.enable",disable:"approval.applied.skill.disable",delete:"approval.applied.skill.delete"},xce={name:"approval.applied.field.name",title:"approval.applied.field.title",description:"approval.applied.field.description",soul:"approval.applied.field.soul",cwd:"approval.applied.field.cwd",notifications:"approval.applied.field.notifications",speakReplies:"approval.applied.field.speakReplies"},y_=e=>!!(e.routineRequest&&!e.answered),Ii=e=>!!(e?.teamSetupRequest||e?.mcpRequest||e?.lendingLift||KA(e?.skillRequest?.action));function k_(e){return e.mcpRequest?f_(e.mcpRequest.action):e.teamSetupRequest?l(e.teamSetupRequest.deletion?"approval.action.deleteBot":"approval.action.applySetup"):e.options[0]??l("approval.action.confirm")}function w3(e){const t=!!(e.routineRequest||e.skillRequest||e.profileRequest||e.modelRequest||Ii(e));if(e.expired===!0||y_(e))return l(t||!e.tool?"approval.status.expired":"approval.status.timedOut");if(!e.answered)return;if(e.undone===!0)return l("approval.status.undone");if(e.answered!=="allow")return t?l("approval.status.cancelled"):l("approval.status.denied");if(e.teamSetupRequest)return l(e.teamSetupRequest.deletion?"approval.status.botDeleted":"approval.status.teamApplied");const n=e.routineRequest?.operation.action;if(n)return l(pce[n]);const a=e.skillRequest?.action;return a?l(mce[a]):e.profileRequest?l("approval.status.profileUpdated"):e.modelRequest?l("approval.status.modelChanged"):e.routineRequest?l("approval.status.routineConfirmed"):e.skillRequest?l("approval.status.skillConfirmed"):l("approval.status.allowed")}function Wi(e){if(!e)return l("approval.tool.takeAction");const t=e.startsWith("mcp__")?e.split("__"):void 0,n=t?.[1],a=(t?t.slice(2).join("__"):e).replace(/_/g," "),i={Bash:"approval.tool.runCommand",Read:"approval.tool.readFile",Write:"approval.tool.writeFile",Edit:"approval.tool.editFile",WebFetch:"approval.tool.fetchWebPage",WebSearch:"approval.tool.searchWeb",schedule_routine:"approval.tool.scheduleRoutine",manage_routine:"approval.tool.changeRoutine",stage_skill:"approval.tool.enableSkill",update_skill:"approval.tool.updateSkill",update_profile:"approval.tool.updateProfile",shell:"approval.tool.runCommand",edit:"approval.tool.editFile",read:"approval.tool.readFile",fetch:"approval.tool.fetchWebPage",delete:"approval.tool.deleteFile",think:"approval.tool.think",other:"approval.tool.takeAction",tool:"approval.tool.useTool"}[e];if(i)return l(i);const o=t?LM(t.slice(2).join("__"))??a:a;return n&&!XM.has(n)?`${n} · ${o}`:o}function gce(e){return e.type==="once"?new Date(e.at).toDateString()===new Date().toDateString()?l("approval.applied.today",{time:Zl(e.at)}):`${QM(e.at)}, ${Zl(e.at)}`:e.type==="cron"?f3(e)?h3(e):"":e.type==="interval"?A1({...e,anchorAt:e.anchorAt??0}):e.type==="limit_reset"?A1({...e,at:null}):A1(e)}function bce(e,t){const n=e.appSettingRequest;if(n)return{line:l("approval.applied.appSetting",{name:t,title:`${n.label}: ${Xl(e)}`}),canUndo:!0};const a=e.routineRequest;if(a){const p=a.operation,m=a.undo,h=m?.schedule&&p.action!=="pause"&&p.action!=="delete"&&p.action!=="run_now"?gce(m.schedule):"",x=[m?.name??(p.action==="create"?p.routine.name:""),p.forBot?l("approval.applied.forBot",{target:`@${p.forBot.name}`}):""].filter(Boolean).join(" · ")+(h?`, ${h}`:""),g=p.action==="create"?!!a.resultId:p.action==="update"?!!(m?.before&&m.appliedUpdatedAt!==void 0):p.action==="pause"||p.action==="resume"?m?.appliedUpdatedAt!==void 0:p.action==="delete"?!!m?.before:!1;return{line:l(xS[p.action],{name:t,title:x}),canUndo:g}}const r=e.waitRequest;if(r)return{line:l(fce[r.settled??"waiting"],{name:t,title:r.label}),canUndo:!r.settled,cancels:!0};const i=e.webhookRequest;if(i){const p=i.operation.forBot?` · ${l("approval.applied.forBot",{target:`@${i.operation.forBot.name}`})}`:"";return{line:l(xS[i.operation.action],{name:t,title:`${i.undo?.name??""}${p}`}),canUndo:i.operation.action!=="run_now"}}const o=e.skillRequest;if(o)return{line:l(hce[o.action],{name:t,title:o.name}),canUndo:o.action==="create"||o.action==="enable"||o.action==="disable"||!!o.previous};const c=e.profileRequest;if(c){const p=cle.filter(h=>c.changes[h]!==void 0).map(h=>l(xce[h])).join(", ");return{line:c.targetBotId===c.botId?l("approval.applied.profileOwn",{name:t,title:p}):l("approval.applied.profileOther",{name:t,target:`@${c.targetName}`,title:p}),canUndo:!!c.undo}}const d=e.modelRequest;if(d){const p=d.selection.model;return{line:d.targetBotId===d.botId?l("approval.applied.modelOwn",{name:t,title:p}):l("approval.applied.modelOther",{name:t,target:`@${d.targetName}`,title:p}),canUndo:!0}}const u=e.teamSetupRequest;if(u?.deletion)return{line:l("approval.applied.botDeleted",{name:t,target:`@${u.deletion.name}`}),canUndo:!1};if(u?.result){const p=h=>u.result.bots.filter(x=>x.action===h).map(x=>`@${x.name}`).join(", "),m=[p("created")&&l("approval.applied.teamAdded",{names:p("created")}),p("updated")&&l("approval.applied.teamUpdated",{names:p("updated")}),u.result.room&&ye(`tạo nhóm chat "${u.result.room.name}"`,`created the group chat "${u.result.room.name}"`)].filter(Boolean).join("; ");return{line:l("approval.applied.teamSetup",{name:t,title:m}),canUndo:!!u.undo}}if(e.teamMemoryRequest)return{line:l("approval.applied.teamMemory",{name:t,title:e.subtitle.split(" — ")[0]??""}),canUndo:!!e.teamMemoryRequest.revision}}function yce({card:e,name:t,originalName:n,threadId:a,summary:r}){const[i,o]=f.useState(!1),[c,d]=f.useState(!1),[u,p]=f.useState(),[m,h]=f.useState(!1),[x,g]=f.useState(),v=f.useContext(np)?.state.config??null,y=Ks()!==!1,w=r.canUndo&&(!e.teamMemoryRequest||y),b=e.undone===!0,k=r.cancels===!0,j=e.skillRequest,N=!b&&(j?.action==="create"||j?.action==="update"),A=j?.shared??(x&&x.requestId===e.requestId?x.shared:void 0),T=!!(j&&!KA(j.action)&&!A&&!b&&a&&e.requestId)&&roe(v)==="ask",M=()=>{const L=e.requestId;!a||!L||m||(h(!0),p(void 0),K(`/api/threads/${a}/share-skill`,{method:"POST",body:JSON.stringify({requestId:L})}).then(D=>g({requestId:L,shared:D.shared})).catch(D=>{p(l("approval.applied.shareFailed",{error:D instanceof Error?D.message:String(D)}))}).finally(()=>h(!1)))},S=A?.assigned.filter(L=>L.botId!==j?.botId).map(L=>L.name)??[],C=A?.skipped.map(L=>L.name)??[],O=()=>{!a||!e.requestId||c||(d(!0),p(void 0),K(`/api/threads/${a}/undo`,{method:"POST",body:JSON.stringify({requestId:e.requestId})}).catch(L=>{k&&L instanceof ln&&L.status===409||p(L instanceof ln&&L.body?.code==="changed-since"?l("approval.applied.changedSince"):k?l("approval.applied.cancelFailed",{name:t}):l("approval.applied.undoFailed",{error:L instanceof Error?L.message:String(L)}))}).finally(()=>d(!1)))};return s.jsxs("div",{className:"w-full max-w-[840px] text-[13px] text-ink-tertiary","data-applied-change":t,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 leading-5",children:[b?s.jsx(Z7,{size:13,className:"shrink-0 self-center"}):N?s.jsx(Gn,{size:13,className:"shrink-0 self-center text-[#f2c94c]"}):s.jsx(Se,{size:13,className:"shrink-0 self-center text-success/80"}),s.jsxs("span",{className:"min-w-0 break-words",children:[s.jsx("span",{className:N?"limix-gold-text":void 0,children:r.line}),A&&!b&&s.jsxs("span",{children:[" · ",S.length?l("approval.applied.sharedSkill",{names:S.join(", ")}):l("approval.applied.sharedSkillNobody")]}),b&&!k&&s.jsxs("span",{children:[" · ",l("approval.applied.undone")]})]}),!b&&w&&a&&s.jsx("button",{type:"button",onClick:O,disabled:c,className:I(Ry,"text-accent disabled:opacity-60"),children:k?l(c?"approval.applied.cancelling":"common.cancel"):l(c?"approval.applied.undoing":"approval.applied.undo")}),T&&s.jsx("button",{type:"button",onClick:M,disabled:m,className:"rounded-md px-1.5 py-0.5 font-medium text-accent hover:bg-inset disabled:opacity-60",children:m?l("approval.applied.sharingSkill"):l("approval.applied.shareSkill")}),s.jsx("button",{type:"button","aria-expanded":i,onClick:()=>o(L=>!L),className:I(Ry,"text-ink-tertiary hover:text-ink-secondary"),children:i?l("approval.applied.hideDetails"):l("approval.applied.details")})]}),A&&!b&&C.length>0&&s.jsx("div",{className:"mt-1 text-[13px] text-ink-tertiary",children:l("approval.applied.shareSkipped",{names:C.join(", ")})}),!u&&!A&&!b&&j?.shareError&&s.jsx("div",{className:"mt-1 text-[13px] text-warning",children:l("approval.applied.shareFailed",{error:j.shareError})}),u&&s.jsx("div",{role:"alert",className:"mt-1 text-[13px] text-warning",children:u}),i&&s.jsx("pre",{tabIndex:0,"aria-label":l("approval.aria.appliedDetails"),className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-2xl bg-inset px-4 py-3 font-mono text-[13px] leading-relaxed text-ink",children:tt()!=="en"&&e.waitRequest?l("approval.applied.waitFollowUp",{name:n??t,followUp:e.waitRequest.followUp??""}):e.subtitle})]})}const kce="inline-flex min-w-0 max-w-full items-baseline rounded-full bg-inset px-2 pb-px pt-[3px] font-mono text-[13px] leading-5 text-ink",Ry="inline-flex h-6 items-center rounded-full px-2 hover:bg-inset focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus";function vce(e){const t=e.split(`
112
+ `).map(c=>c.trim()).find(Boolean)??"",a=o=>o.length>110?`${o.slice(0,109).trimEnd()}…`:o,r=r_(lh(wu(e),t));if(e.status==="completed")return{when:r,mark:"✓",text:e.report?.state==="quiet"?l("automations.run.nothingNew"):a(n(e.output))||l("automations.run.done")};if(e.status==="waiting")return d_(e)?{when:r,mark:"…",text:l("automations.run.waitingOnTeam")}:{when:r,mark:"!",text:l("automations.reason.answer")};if(e.status==="running"||e.status==="queued")return{when:r,mark:"…",text:l("automations.runningNow")};if(e.status==="cancelled"){const o=a(n(e.error&&si(e.errorCode,e.error,e.errorParams)));return{when:r,mark:"✗",text:o?l("automations.run.stoppedBecause",{reason:o}):l("automations.run.stopped")}}const i=a(n(e.error&&si(e.errorCode,e.error,e.errorParams)));return eg(e)?{when:r,mark:"!",text:l("automations.run.partial",{reason:i})}:{when:r,mark:"✗",text:c_(e)?.reason??(i||l("automations.run.failed"))}}const z$e={answer:"automations.fix.answer","sign-in":"automations.fix.signIn",usage:"automations.fix.usage",edit:"automations.fix.edit",run:"automations.fix.run",reconnect:"automations.fix.reconnect"},Dle=30,$le=240;function Ble(e){if(e.outcome==="accepted")return{ok:!0,reason:l("automations.calls.received")};if(e.outcome==="captured")return{ok:!0,reason:l("automations.calls.test")};if(e.outcome==="duplicate")return{ok:!1,reason:l("automations.calls.duplicate")};if(e.outcome==="ignored")return{ok:!1,reason:e.eventName?l("automations.calls.skipped",{kind:e.eventName}):l("automations.calls.noKind")};const t=Number(/\((\d+) requests\)/.exec(e.reason??"")?.[1]??1);return e.statusCode===401?{ok:!1,reason:t>1?l("automations.calls.wrongSecretTimes",{count:t}):l("automations.calls.wrongSecret")}:e.statusCode===409?{ok:!1,reason:l("automations.calls.paused")}:e.statusCode===410?{ok:!1,reason:l("automations.calls.botGone")}:e.statusCode===429?{ok:!1,reason:/rate limit/i.test(e.reason??"")?l("automations.calls.tooFast"):l("automations.calls.tooMany")}:e.statusCode===413?{ok:!1,reason:l("automations.calls.tooLarge")}:e.statusCode===400?{ok:!1,reason:l("automations.calls.unreadable")}:{ok:!1,reason:l("automations.calls.refused")}}function P$e(e,t){return t.filter(n=>n.webhookId===e).sort((n,a)=>a.receivedAt-n.receivedAt).slice(0,Dle).map(n=>({id:n.id,at:n.receivedAt,...Ble(n),preview:(n.preview??"").slice(0,$le)}))}function D$e(e,t){const n=t.filter(a=>a.webhookId===e.id&&a.outcome!=="rejected"&&a.preview).reduce((a,r)=>!a||r.receivedAt>a.receivedAt?r:a,null);return n?{at:n.receivedAt,preview:n.preview}:e.verificationSample?.preview?{at:e.verificationSample.receivedAt,preview:e.verificationSample.preview}:null}function $$e(e,t){return e.kind==="schedule"&&e.schedule?`${i_(e.schedule)} · ${t}`:o_(e,t)}const Fle=1e4;let Il=null,_1=!1,ch=null;const xl=new Set;function p_(){if(ch=null,!(Il!==null||_1||!xl.size)){if(typeof window<"u"&&window.ogb?.remoteClient?.active===!0){Il=!0;for(const e of xl)e(!0);return}_1=!0,bo().then(e=>e.kind==="unreachable"?null:pH(e),()=>null).then(e=>{_1=!1,e!==null&&(Il=e);for(const t of xl)t(e??!1);e===null&&xl.size&&(ch=setTimeout(p_,Fle))})}}function Ks(){const[e,t]=f.useState(Il??(ch?!1:null));return f.useEffect(()=>(xl.add(t),Il!==null?t(Il):ch?t(!1):p_(),()=>{xl.delete(t)}),[]),e}const Ule="Limix Bot can't use this computer yet — ",m_={chrome:"Chrome","google chrome":"Chrome",chromium:"Chromium",safari:"Safari",firefox:"Firefox","mozilla firefox":"Firefox",edge:"Edge","microsoft edge":"Edge",msedge:"Edge",brave:"Brave","brave browser":"Brave",arc:"Arc",opera:"Opera",vivaldi:"Vivaldi"};function qle(e){if(typeof e!="string")return;const t=e.trim().replace(/\.(?:app|exe)$/i,"");if(!(!t||t.length>28||t.split(" ").length>3||!/^[\p{L}\p{N}](?:[\p{L}\p{N}&'+-]| (?! ))*$/u.test(t)))return m_[t.toLowerCase()]??t}function Hle(e){if(typeof e!="string"||e.length>253)return;const t=e.trim().toLowerCase().replace(/^www\./,"");return/^(?=.{1,100}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$/.test(t)?t:void 0}function Wle(e={}){const t=qle(e.app),n=Hle(e.site),a=t&&Object.values(m_).includes(t)?t:void 0;return a&&n?{key:"approval.yourComputer.browserSite",params:{app:a,site:n}}:a?{key:"approval.yourComputer.browser",params:{app:a}}:n?{key:"approval.yourComputer.site",params:{site:n}}:t?{key:"approval.yourComputer.app",params:{app:t}}:{key:"approval.yourComputer.screen",params:{}}}function b3(e,t){if(!e?.yourComputer)return;const{key:n,params:a}=Wle(e.yourComputer);return{line:l(n,a),detail:l("approval.yourComputer.detail",{name:t})}}function Kle(e){return e==="computer"?l("vm.host.computer"):e}const Vle="https://www.openmausbot.com/download";function Gle(e){return e==="paused"||e==="permissions"||e==="blocked"||e==="off"||e==="not-running"||e==="terminal-off"}function Yle(e){return e==="closed"||e==="never"||e==="update"}const Jle={screen:"computerAsk.want.screen",folders:"computerAsk.want.folders",terminal:"computerAsk.want.terminal"};function Qle(e){return{key:Jle[e.need],params:{device:e.device}}}function Xle(e,t){const n={device:e.device,name:t};switch(e.reason){case"paused":return{key:"computerAsk.reason.paused",params:n};case"starting":return{key:"computerAsk.reason.starting",params:n};case"permissions":return{key:"computerAsk.reason.permissions",params:n};case"blocked":return{key:e.device==="PC"?"computerAsk.reason.blockedPc":"computerAsk.reason.blocked",params:n};case"off":return{key:"computerAsk.reason.off",params:n};case"unsupported":return{key:"computerAsk.reason.unsupported",params:n};case"terminal-off":return{key:"computerAsk.reason.terminalOff",params:n};case"closed":return{key:"computerAsk.reason.closed",params:n};case"never":return{key:"computerAsk.reason.never",params:n};case"update":return{key:"computerAsk.reason.update",params:n};default:return{key:"computerAsk.reason.notRunning",params:n}}}const Zle={"turning-on":"computerAsk.state.turningOn",on:"computerAsk.state.on",declined:"computerAsk.state.declined",ended:"computerAsk.state.ended"};function ng(e,t){const n=e?.computerAsk;if(!n)return;const a=Qle(n),r=Xle(n,t),i=n.state==="failed",o=Zle[n.state],c=Kle(n.device);return{line:l(a.key,{...a.params,device:c,name:t}),...n.why?{why:n.why}:{},reason:`${i?`${l("computerAsk.state.failed")} `:""}${l(r.key,{...r.params,device:c})}`,...Gle(n.reason)?{turnOn:l(i?"computerAsk.action.tryAgain":"computerAsk.action.turnOn")}:{},...Yle(n.reason)?{getApp:l("computerAsk.action.getApp")}:{},...o?{outcome:l(o,{name:t})}:{}}}const ece={enable:"mcp.turnOn",update:"mcp.request.change",remove:"mcp.request.remove"};function f_(e){return l(ece[e])}const y3="omb-webhook-credentials";function tce(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return[t.endpointUrl,t.secret,t.url].every(n=>typeof n=="string"&&n.length>0)}function k3(e){try{const t=e?.getItem(y3),n=t?JSON.parse(t):null;return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(a=>tce(a[1])))}catch{return{}}}function My(e,t,n){const a=k3(e);a[t]=n;try{e?.setItem(y3,JSON.stringify(a))}catch{}}function nce(e,t){const n=k3(e);delete n[t];try{e?.setItem(y3,JSON.stringify(n))}catch{}}function md(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}const h_={loaded:!1,triggers:[],attempts:[],service:null};let Zs=h_;const _y=new Set;let pS=!1,R1=null;function fd(e){Zs=e;for(const t of _y)t()}function x_(e){fd({loaded:!0,triggers:e.triggers,attempts:e.attempts.slice(-2e3),service:e.service})}function v3(e){if(e.kind==="app-trigger"){const t=Zs.triggers.some(n=>n.id===e.trigger.id);fd({...Zs,triggers:t?Zs.triggers.map(n=>n.id===e.trigger.id?e.trigger:n):[e.trigger,...Zs.triggers]})}else e.kind==="app-trigger.deleted"?fd({...Zs,triggers:Zs.triggers.filter(t=>t.id!==e.triggerId),attempts:Zs.attempts.filter(t=>t.triggerId!==e.triggerId)}):e.kind==="app-trigger.attempt"?fd({...Zs,attempts:[...Zs.attempts.filter(t=>t.id!==e.attempt.id),e.attempt].slice(-2e3)}):e.kind==="app-trigger.service"&&fd({...Zs,service:e.service})}function mS(){return R1??=K("/api/app-triggers").then(x_).catch(()=>{}).finally(()=>{R1=null}),R1}function sce(){pS||typeof window<"u"&&window.ogb?.remoteClient?.active||(pS=!0,Wx({onFrame:v3,onMissedFrames:()=>{mS()}}),mS())}function g_(){return f.useEffect(sce,[]),f.useSyncExternalStore(e=>(_y.add(e),()=>_y.delete(e)),()=>Zs,()=>h_)}const fS=e=>v3({kind:"app-trigger",botId:e.botId,trigger:e}),O1={events:e=>K(`/api/app-triggers/events?${new URLSearchParams({botId:e})}`),async create(e){const{trigger:t}=await K("/api/app-triggers",{method:"POST",body:JSON.stringify(e)});return fS(t),t},async update(e,t){const{trigger:n}=await K(`/api/app-triggers/${e}`,{method:"PATCH",body:JSON.stringify(t)});return fS(n),n},async remove(e){await K(`/api/app-triggers/${e}`,{method:"DELETE"}),v3({kind:"app-trigger.deleted",triggerId:e})},test:e=>K(`/api/app-triggers/${e}/test`,{method:"POST"}),async sync(){x_(await K("/api/app-triggers/sync",{method:"POST"}))}};function ace(){const{state:e,dispatch:t}=re(),n=et(),[a,r]=f.useState(null),[i,o]=f.useState(""),[c,d]=f.useState(null),[u,p]=f.useState(null),m=async(b,k)=>{if(!a){r(b),o(""),d(null);try{await k()}catch(j){o(j instanceof Error?j.message:String(j)),d(b)}finally{r(null)}}};return{busy:a,error:i,errorFor:c,setError:o,copied:u,toggle:b=>m(`toggle:${b.id}`,async()=>{if(b.kind==="schedule"){const j=await K(`/api/routines/${b.id}`,{method:"PATCH",body:JSON.stringify({enabled:!b.enabled})});t({type:"routinePatched",routine:j.routine});return}const k=await K(`/api/webhooks/${b.id}`,{method:"PATCH",body:JSON.stringify({enabled:!b.enabled,verificationPending:!1})});t({type:"webhookPatched",webhook:k.webhook})}),runNow:b=>m(`run:${b.id}`,()=>b.kind==="schedule"?new Promise((k,j)=>t({type:"runRoutine",routineId:b.id,onStarted:()=>k(),onError:j})):K(`/api/webhooks/${b.id}/test`,{method:"POST",body:JSON.stringify({event:"openmaus.test",message:"A test run from Automations"})})),remove:async(b,k)=>window.confirm(k)?b.kind==="schedule"?(t({type:"deleteRoutine",routineId:b.id}),!0):(await m(`delete:${b.id}`,async()=>{await K(`/api/webhooks/${b.id}`,{method:"DELETE"}),t({type:"webhookDeleted",webhookId:b.id}),nce(md(),b.id)}),!0):!1,copyAddress:(b,k=!1)=>m(`copy:${b}`,async()=>{let j;if(k||(j=await K(`/api/webhooks/${b}/address`).then(N=>N.credential,()=>{})??k3(md())[b],j&&My(md(),b,j)),!j){const N=await K(`/api/webhooks/${b}/rotate`,{method:"POST"});j=N.credential,t({type:"webhookPatched",webhook:N.webhook}),My(md(),b,j)}if(await aa(j.url)!=="copied")throw new Error(l("automations.address.copyAddressFailed"));p(b),setTimeout(()=>p(N=>N===b?null:N),1800)}),openRun:(b,k)=>{const j=e.bots.find(N=>N.id===b.botId);j&&k?.threadId&&Qi(t,j,k.threadId,n)},cancelRun:(b,k)=>m(`cancel:${b.id}`,async()=>{const j=await K(`/api/routine-runs/${k.id}/cancel`,{method:"POST"});j.run&&t({type:"routineRunPatched",run:j.run})})}}function rce(){const e=ace(),[t,n]=f.useState(null),[a,r]=f.useState(""),i=async(o,c)=>{if(!(t||e.busy)){n(o),r("");try{await c()}catch(d){r(d instanceof Error?d.message:String(d))}finally{n(null)}}};return{...e,busy:t??e.busy,error:a||e.error,setError:o=>{r(o),e.setError(o)},toggle:o=>o.kind==="app"?void i(`toggle:${o.id}`,()=>O1.update(o.id,{enabled:!o.enabled})):e.toggle(o),runNow:o=>o.kind==="app"?i(`run:${o.id}`,()=>O1.test(o.id)):e.runNow(o),remove:async(o,c)=>o.kind!=="app"?e.remove(o,c):window.confirm(c)?(await i(`delete:${o.id}`,()=>O1.remove(o.id)),!0):!1}}const ice=f.lazy(async()=>({default:(await Oe(async()=>{const{RoutineEditor:e}=await import("./RoutinesPage-CsFk2Oza.js").then(t=>t.c);return{RoutineEditor:e}},__vite__mapDeps([5,1,2,6,3,4,7,8]))).RoutineEditor})),oce=f.lazy(async()=>({default:(await Oe(async()=>{const{WebhookEditor:e}=await import("./WebhookTrigger-maNR47wz.js");return{WebhookEditor:e}},__vite__mapDeps([9,1,2,3,4,6,10,8]))).WebhookEditor})),lce=f.lazy(async()=>({default:(await Oe(async()=>{const{AppEventEditor:e}=await import("./AppEventEditor-B_qeymvm.js");return{AppEventEditor:e}},__vite__mapDeps([11,1,2,3,4,9,6,10,8]))).AppEventEditor})),Zp="rounded-md px-1.5 py-0.5 font-medium hover:bg-inset focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50";function cce({card:e,threadId:t}){const{state:n,dispatch:a}=re(),r=rce(),i=g_(),[o,c]=f.useState(!1),[d,u]=f.useState(!1),[p,m]=f.useState(),h=s_(e);if(!h)return null;const x=Nle(h,{routines:n.routines,webhooks:n.webhooks,appTriggers:i.triggers,runs:n.routineRuns,bots:n.bots}),g=e.routineRequest?.undo?.name??e.webhookRequest?.undo?.name??e.appTriggerRequest?.undo?.name??e.title;if(e.undone||!x)return!e.undone&&h.kind==="schedule"&&n.routinesLoadState==="loading"||!e.undone&&h.kind==="app"&&!i.loaded?null:s.jsxs("div",{"data-trigger-card":h.id,className:"flex w-full max-w-[840px] items-center gap-2 text-[13px] text-ink-tertiary",children:[e.undone?s.jsx(Z7,{size:13}):s.jsx(Sr,{size:13}),s.jsx("span",{children:e.undone?l("automations.card.removed"):`${l("automations.card.gone")} · ${g}`})]});const v=n.bots.find(M=>M.id===x.botId)?.name??l("routines.unavailableBot"),y=o_(x,v),w=tg(x),b=x.runs.find(M=>M.status!=="queued"),k=x.nextRunAt!=null?g3(x.nextRunAt):null,j=b&&`${l("automations.card.lastRan",{when:lh(b.startedAt??b.scheduledFor)})} ${uS(b).mark} ${uS(b).text}`;let N;w.state==="paused"?N=l("automations.status.paused"):w.state==="done"?N=[l("automations.status.done"),j].filter(Boolean).join(" · "):w.state==="needs-you"?N=l("automations.needsYou",{reason:w.reason??""}):j?N=[j,k&&l("automations.next",{when:k})].filter(Boolean).join(" · "):N=u_(x)??(k?l("automations.card.next",{when:k}):x.appTrigger?gle(x.appTrigger):r_(l("automations.notRunYet")));const A=()=>{!t||!e.requestId||d||(u(!0),m(void 0),K(`/api/threads/${t}/undo`,{method:"POST",body:JSON.stringify({requestId:e.requestId})}).catch(M=>m(M instanceof ln&&M.body?.code==="changed-since"?l("automations.card.changedSince"):M instanceof Error?M.message:String(M))).finally(()=>u(!1)))},T=n.bots.filter(M=>!M.hidden);return s.jsxs("section",{"data-trigger-card":x.id,"data-automation-status":w.state,"aria-label":y,className:"w-full max-w-[640px] rounded-xl border border-hairline/45 bg-card px-3.5 py-2.5 text-[13px]",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Sr,{size:14,className:I("mt-0.5 shrink-0",w.state==="needs-you"?"text-warning":x.enabled?"text-accent":"text-ink-tertiary")}),s.jsx("button",{type:"button",onClick:()=>a({type:"showRoutines",view:"list",routineId:x.id}),className:"min-w-0 text-left font-medium leading-snug text-ink hover:text-accent-text",children:l("automations.card.setUp",{sentence:y})})]}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 pl-[22px] text-[12px]",children:[s.jsx("span",{className:I("min-w-0 flex-1 basis-48 truncate",w.state==="needs-you"?"text-warning":"text-ink-secondary"),title:N,children:N}),s.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-ink-secondary",children:[w.state!=="done"&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",disabled:!!r.busy,onClick:()=>{r.toggle(x)},className:Zp,children:x.enabled?l("automations.pause"):l("automations.resume")}),s.jsx("span",{"aria-hidden":"true",children:"·"})]}),s.jsx("button",{type:"button",onClick:()=>c(!0),className:Zp,children:l("automations.edit")}),x.kind==="webhook"&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",children:"·"}),s.jsx("button",{type:"button",disabled:!!r.busy,onClick:()=>{r.copyAddress(x.id)},className:Zp,children:r.copied===x.id?l("automations.address.copied"):l("automations.address.copy")})]}),t&&e.requestId&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":"true",children:"·"}),s.jsx("button",{type:"button",onClick:A,disabled:d,className:I(Zp,"text-accent"),children:d?l("automations.card.undoing"):l("automations.card.undo")})]})]})]}),(p||r.error)&&s.jsx("div",{role:"alert",className:"mt-1 pl-[22px] text-[12px] text-warning",children:p??r.error}),o&&Ke.createPortal(s.jsx(f.Suspense,{fallback:null,children:x.kind==="app"?s.jsx(lce,{trigger:x.appTrigger,bots:T,onClose:()=>c(!1)}):x.kind==="schedule"?s.jsx(ice,{routine:n.routines.find(M=>M.id===x.id),bots:T,plain:!0,onClose:()=>c(!1)}):s.jsx(oce,{webhook:n.webhooks.find(M=>M.id===x.id),bots:T,onClose:()=>c(!1),onCredential:(M,S)=>My(md(),S,M)})}),document.body)]})}const dce={"spot.approval":"onboarding.hint.approval","spot.connector":"onboarding.hint.connector"},hS=new Set;function uce(){try{return re()}catch{return null}}function b_({id:e}){const t=uce(),n=t?.dispatch,a=nt(),r=t?.state.config?.onboarding,[i]=f.useState(()=>!!n&&!a&&!!r?.completedAt&&!Cn(r,e)&&!hS.has(e));return f.useEffect(()=>{if(!i)return;hS.add(e);const o=ko(r,e);o&&K("/api/config",{method:"PUT",body:JSON.stringify(o)}).then(c=>n?.({type:"configStatus",config:c})).catch(()=>{})},[i]),i?s.jsx("p",{"data-card-hint":e,className:"text-[12px] leading-4 text-ink-secondary",children:l(dce[e])}):null}const pce={create:"approval.status.routineScheduled",update:"approval.status.routineUpdated",pause:"approval.status.routinePaused",resume:"approval.status.routineResumed",run_now:"approval.status.routineRunQueued",delete:"approval.status.routineDeleted"},mce={create:"approval.status.skillEnabled",update:"approval.status.skillUpdated",enable:"approval.status.skillTurnedOn",disable:"approval.status.skillTurnedOff",delete:"approval.status.skillDeleted"},xS={create:"approval.applied.automation.create",update:"approval.applied.automation.update",pause:"approval.applied.automation.pause",resume:"approval.applied.automation.resume",run_now:"approval.applied.automation.runNow",delete:"approval.applied.automation.delete"},fce={waiting:"approval.applied.wait",fired:"approval.applied.waitFired",expired:"approval.applied.waitExpired",cancelled:"approval.applied.waitCancelled"},hce={create:"approval.applied.skill.create",update:"approval.applied.skill.update",enable:"approval.applied.skill.enable",disable:"approval.applied.skill.disable",delete:"approval.applied.skill.delete"},xce={name:"approval.applied.field.name",title:"approval.applied.field.title",description:"approval.applied.field.description",soul:"approval.applied.field.soul",cwd:"approval.applied.field.cwd",notifications:"approval.applied.field.notifications",speakReplies:"approval.applied.field.speakReplies"},y_=e=>!!(e.routineRequest&&!e.answered),Ii=e=>!!(e?.teamSetupRequest||e?.mcpRequest||e?.lendingLift||KA(e?.skillRequest?.action));function k_(e){return e.mcpRequest?f_(e.mcpRequest.action):e.teamSetupRequest?l(e.teamSetupRequest.deletion?"approval.action.deleteBot":"approval.action.applySetup"):e.options[0]??l("approval.action.confirm")}function w3(e){const t=!!(e.routineRequest||e.skillRequest||e.profileRequest||e.modelRequest||Ii(e));if(e.expired===!0||y_(e))return l(t||!e.tool?"approval.status.expired":"approval.status.timedOut");if(!e.answered)return;if(e.undone===!0)return l("approval.status.undone");if(e.answered!=="allow")return t?l("approval.status.cancelled"):l("approval.status.denied");if(e.teamSetupRequest)return l(e.teamSetupRequest.deletion?"approval.status.botDeleted":"approval.status.teamApplied");const n=e.routineRequest?.operation.action;if(n)return l(pce[n]);const a=e.skillRequest?.action;return a?l(mce[a]):e.profileRequest?l("approval.status.profileUpdated"):e.modelRequest?l("approval.status.modelChanged"):e.routineRequest?l("approval.status.routineConfirmed"):e.skillRequest?l("approval.status.skillConfirmed"):l("approval.status.allowed")}function Wi(e){if(!e)return l("approval.tool.takeAction");const t=e.startsWith("mcp__")?e.split("__"):void 0,n=t?.[1],a=(t?t.slice(2).join("__"):e).replace(/_/g," "),i={Bash:"approval.tool.runCommand",Read:"approval.tool.readFile",Write:"approval.tool.writeFile",Edit:"approval.tool.editFile",WebFetch:"approval.tool.fetchWebPage",WebSearch:"approval.tool.searchWeb",schedule_routine:"approval.tool.scheduleRoutine",manage_routine:"approval.tool.changeRoutine",stage_skill:"approval.tool.enableSkill",update_skill:"approval.tool.updateSkill",update_profile:"approval.tool.updateProfile",shell:"approval.tool.runCommand",edit:"approval.tool.editFile",read:"approval.tool.readFile",fetch:"approval.tool.fetchWebPage",delete:"approval.tool.deleteFile",think:"approval.tool.think",other:"approval.tool.takeAction",tool:"approval.tool.useTool"}[e];if(i)return l(i);const o=t?LM(t.slice(2).join("__"))??a:a;return n&&!XM.has(n)?`${n} · ${o}`:o}function gce(e){return e.type==="once"?new Date(e.at).toDateString()===new Date().toDateString()?l("approval.applied.today",{time:Zl(e.at)}):`${QM(e.at)}, ${Zl(e.at)}`:e.type==="cron"?f3(e)?h3(e):"":e.type==="interval"?A1({...e,anchorAt:e.anchorAt??0}):e.type==="limit_reset"?A1({...e,at:null}):A1(e)}function bce(e,t){const n=e.appSettingRequest;if(n)return{line:l("approval.applied.appSetting",{name:t,title:`${n.label}: ${Xl(e)}`}),canUndo:!0};const a=e.routineRequest;if(a){const p=a.operation,m=a.undo,h=m?.schedule&&p.action!=="pause"&&p.action!=="delete"&&p.action!=="run_now"?gce(m.schedule):"",x=[m?.name??(p.action==="create"?p.routine.name:""),p.forBot?l("approval.applied.forBot",{target:`@${p.forBot.name}`}):""].filter(Boolean).join(" · ")+(h?`, ${h}`:""),g=p.action==="create"?!!a.resultId:p.action==="update"?!!(m?.before&&m.appliedUpdatedAt!==void 0):p.action==="pause"||p.action==="resume"?m?.appliedUpdatedAt!==void 0:p.action==="delete"?!!m?.before:!1;return{line:l(xS[p.action],{name:t,title:x}),canUndo:g}}const r=e.waitRequest;if(r)return{line:l(fce[r.settled??"waiting"],{name:t,title:r.label}),canUndo:!r.settled,cancels:!0};const i=e.webhookRequest;if(i){const p=i.operation.forBot?` · ${l("approval.applied.forBot",{target:`@${i.operation.forBot.name}`})}`:"";return{line:l(xS[i.operation.action],{name:t,title:`${i.undo?.name??""}${p}`}),canUndo:i.operation.action!=="run_now"}}const o=e.skillRequest;if(o)return{line:l(hce[o.action],{name:t,title:o.name}),canUndo:o.action==="create"||o.action==="enable"||o.action==="disable"||!!o.previous};const c=e.profileRequest;if(c){const p=cle.filter(h=>c.changes[h]!==void 0).map(h=>l(xce[h])).join(", ");return{line:c.targetBotId===c.botId?l("approval.applied.profileOwn",{name:t,title:p}):l("approval.applied.profileOther",{name:t,target:`@${c.targetName}`,title:p}),canUndo:!!c.undo}}const d=e.modelRequest;if(d){const p=d.selection.model;return{line:d.targetBotId===d.botId?l("approval.applied.modelOwn",{name:t,title:p}):l("approval.applied.modelOther",{name:t,target:`@${d.targetName}`,title:p}),canUndo:!0}}const u=e.teamSetupRequest;if(u?.deletion)return{line:l("approval.applied.botDeleted",{name:t,target:`@${u.deletion.name}`}),canUndo:!1};if(u?.result){const p=h=>u.result.bots.filter(x=>x.action===h).map(x=>`@${x.name}`).join(", "),m=[p("created")&&l("approval.applied.teamAdded",{names:p("created")}),p("updated")&&l("approval.applied.teamUpdated",{names:p("updated")}),u.result.room&&ye(`tạo nhóm chat "${u.result.room.name}"`,`created the group chat "${u.result.room.name}"`)].filter(Boolean).join("; ");return{line:l("approval.applied.teamSetup",{name:t,title:m}),canUndo:!!u.undo}}if(e.teamMemoryRequest)return{line:l("approval.applied.teamMemory",{name:t,title:e.subtitle.split(" — ")[0]??""}),canUndo:!!e.teamMemoryRequest.revision}}function yce({card:e,name:t,originalName:n,threadId:a,summary:r}){const[i,o]=f.useState(!1),[c,d]=f.useState(!1),[u,p]=f.useState(),[m,h]=f.useState(!1),[x,g]=f.useState(),v=f.useContext(np)?.state.config??null,y=Ks()!==!1,w=r.canUndo&&(!e.teamMemoryRequest||y),b=e.undone===!0,k=r.cancels===!0,j=e.skillRequest,N=!b&&(j?.action==="create"||j?.action==="update"),A=j?.shared??(x&&x.requestId===e.requestId?x.shared:void 0),T=!!(j&&!KA(j.action)&&!A&&!b&&a&&e.requestId)&&roe(v)==="ask",M=()=>{const L=e.requestId;!a||!L||m||(h(!0),p(void 0),K(`/api/threads/${a}/share-skill`,{method:"POST",body:JSON.stringify({requestId:L})}).then(D=>g({requestId:L,shared:D.shared})).catch(D=>{p(l("approval.applied.shareFailed",{error:D instanceof Error?D.message:String(D)}))}).finally(()=>h(!1)))},S=A?.assigned.filter(L=>L.botId!==j?.botId).map(L=>L.name)??[],C=A?.skipped.map(L=>L.name)??[],O=()=>{!a||!e.requestId||c||(d(!0),p(void 0),K(`/api/threads/${a}/undo`,{method:"POST",body:JSON.stringify({requestId:e.requestId})}).catch(L=>{k&&L instanceof ln&&L.status===409||p(L instanceof ln&&L.body?.code==="changed-since"?l("approval.applied.changedSince"):k?l("approval.applied.cancelFailed",{name:t}):l("approval.applied.undoFailed",{error:L instanceof Error?L.message:String(L)}))}).finally(()=>d(!1)))};return s.jsxs("div",{className:"w-full max-w-[840px] text-[13px] text-ink-tertiary","data-applied-change":t,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-1 leading-5",children:[b?s.jsx(Z7,{size:13,className:"shrink-0 self-center"}):N?s.jsx(Gn,{size:13,className:"shrink-0 self-center text-[#f2c94c]"}):s.jsx(Se,{size:13,className:"shrink-0 self-center text-success/80"}),s.jsxs("span",{className:"min-w-0 break-words",children:[s.jsx("span",{className:N?"limix-gold-text":void 0,children:r.line}),A&&!b&&s.jsxs("span",{children:[" · ",S.length?l("approval.applied.sharedSkill",{names:S.join(", ")}):l("approval.applied.sharedSkillNobody")]}),b&&!k&&s.jsxs("span",{children:[" · ",l("approval.applied.undone")]})]}),!b&&w&&a&&s.jsx("button",{type:"button",onClick:O,disabled:c,className:I(Ry,"text-accent disabled:opacity-60"),children:k?l(c?"approval.applied.cancelling":"common.cancel"):l(c?"approval.applied.undoing":"approval.applied.undo")}),T&&s.jsx("button",{type:"button",onClick:M,disabled:m,className:"rounded-md px-1.5 py-0.5 font-medium text-accent hover:bg-inset disabled:opacity-60",children:m?l("approval.applied.sharingSkill"):l("approval.applied.shareSkill")}),s.jsx("button",{type:"button","aria-expanded":i,onClick:()=>o(L=>!L),className:I(Ry,"text-ink-tertiary hover:text-ink-secondary"),children:i?l("approval.applied.hideDetails"):l("approval.applied.details")})]}),A&&!b&&C.length>0&&s.jsx("div",{className:"mt-1 text-[13px] text-ink-tertiary",children:l("approval.applied.shareSkipped",{names:C.join(", ")})}),!u&&!A&&!b&&j?.shareError&&s.jsx("div",{className:"mt-1 text-[13px] text-warning",children:l("approval.applied.shareFailed",{error:j.shareError})}),u&&s.jsx("div",{role:"alert",className:"mt-1 text-[13px] text-warning",children:u}),i&&s.jsx("pre",{tabIndex:0,"aria-label":l("approval.aria.appliedDetails"),className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-2xl bg-inset px-4 py-3 font-mono text-[13px] leading-relaxed text-ink",children:tt()!=="en"&&e.waitRequest?l("approval.applied.waitFollowUp",{name:n??t,followUp:e.waitRequest.followUp??""}):e.subtitle})]})}const kce="inline-flex min-w-0 max-w-full items-baseline rounded-full bg-inset px-2 pb-px pt-[3px] font-mono text-[13px] leading-5 text-ink",Ry="inline-flex h-6 items-center rounded-full px-2 hover:bg-inset focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus";function vce(e){const t=e.split(`
113
113
  `,1)[0]??"";return t.length>80?`${t.slice(0,79)}…`:t}function gS({header:e,summary:t,detail:n,showDetailInline:a,outcome:r,allowed:i,expired:o=!1,byVoice:c,waiting:d,answeredBelow:u}){const[p,m]=f.useState(!1),h=()=>m(x=>!x);return d&&u?s.jsxs("div",{"data-approval-row":"pending",className:"sr-only",children:[e,t?` ${t}`:"",n&&a?` ${vce(n)}`:"",". ",l("approval.status.waitingAnswer")]}):s.jsxs("div",{"data-tour":d?"approval":void 0,"data-approval-row":d?"pending":"settled",className:I("w-full max-w-[840px] text-[13px]",d?"text-ink-secondary":"text-ink-tertiary"),children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 leading-5",children:[d?s.jsx(Nx,{size:14,className:"shrink-0 self-center text-accent","aria-hidden":"true"}):i?s.jsx(Se,{size:14,className:"shrink-0 self-center text-success","aria-hidden":"true"}):o?s.jsx(Ku,{size:14,className:"shrink-0 self-center","aria-hidden":"true"}):s.jsx(Ae,{size:14,className:"shrink-0 self-center","aria-hidden":"true"}),s.jsx("span",{className:I("min-w-0 break-words",d&&"text-ink"),children:e}),t&&s.jsx("span",{className:"min-w-0 break-words",children:d?t:`· ${t}`}),n&&a&&s.jsx("span",{role:"group","aria-label":l("approval.aria.details"),className:"min-w-0 max-w-full",children:s.jsx("button",{type:"button","aria-expanded":p,title:n,onClick:h,className:I(kce,"text-left hover:bg-control focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus"),children:s.jsx("span",{className:"truncate",children:n})})}),s.jsxs("span",{className:"shrink-0","aria-live":"polite",children:["· ",r??l("approval.status.waitingAnswer")]}),c,n&&!a&&s.jsx("button",{type:"button","aria-expanded":p,onClick:h,className:I(Ry,"text-ink-tertiary hover:text-ink-secondary"),children:p?l("approval.applied.hideDetails"):l("approval.applied.details")})]}),p&&s.jsx("pre",{tabIndex:0,"aria-label":l("approval.aria.details"),className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-2xl bg-inset px-4 py-3 font-mono text-[12px] leading-relaxed text-ink",children:n})]})}function v_({bot:e,message:t,threadId:n}){const a=t.card;if(!a)return null;if(s_(a))return s.jsx(cce,{card:a,threadId:n});const r=a.autoApplied===!0&&a.answered==="allow"&&!a.held?bce(a,e?.name??l("approval.someone")):void 0;if(r)return s.jsx(yce,{card:a,name:e?.name??l("approval.someone"),originalName:t.from?.name,threadId:n,summary:r});const i=a.answered,o=a.expired===!0||y_(a),c=a.answeredBy?.via,d=c?s.jsxs("span",{className:"text-ink-tertiary",children:["· ",l(c==="call"?"approval.status.byVoice":"approval.status.byReaction")]}):null,u=!!a.routineRequest,p=!!a.skillRequest,m=!!a.profileRequest,h=Ii(a),x=a.routineRequest?.operation.action,g=a.skillRequest?.action,v=dx(a.heldCode,a.held),y=w3(a),w=p3(a),b=u?x==="create"?"schedule_routine":"manage_routine":p?g==="update"?"update_skill":"stage_skill":m?"update_profile":(!a.tool||a.tool==="tool")&&(a.title??"").startsWith("mcp__")?a.title:a.tool,k=m&&a.profileRequest?a.profileRequest.targetBotId===a.profileRequest.botId?l("approval.card.profileWantsToOwn",{name:e?.name??l("approval.someone")}):l("approval.card.profileWantsToOther",{name:e?.name??l("approval.someone"),target:a.profileRequest.targetName}):void 0,j=ng(a,e?.name??l("approval.someone"));if(j){const N=a.computerAsk?.state,A=N==="asking"||N==="failed";return s.jsx("div",{"data-computer-ask":N,className:"w-full",children:s.jsx(gS,{header:j.line,summary:A?j.reason:void 0,detail:"",showDetailInline:!1,outcome:j.outcome,allowed:N==="on"||N==="turning-on",byVoice:d,waiting:A,answeredBelow:A&&!a.dismissed})})}if(!u&&!p&&!m&&!h&&!a.modelRequest){const N=!i&&!o,A=b3(a,e?.name??l("approval.someone")),T=A?A.line:w?N?w.headline:w.headline.replace(/\s*[??]$/,""):e?l("approval.card.namedWantsTo",{name:e.name,action:Wi(b)}):l("approval.card.wantsTo",{action:Wi(b)}),M=s.jsx(gS,{header:T,summary:w?.summary||void 0,detail:A?.detail??Xl(a),showDetailInline:!w,outcome:y,allowed:i==="allow"&&!o,expired:o,byVoice:d,waiting:N,answeredBelow:!!(a.requestId&&a.tool&&!a.dismissed)});return N&&a.requestId&&a.tool?s.jsxs("div",{className:"flex w-full flex-col gap-1",children:[M,s.jsx(b_,{id:"spot.approval"})]}):M}return s.jsxs("div",{"data-tour":i||o?void 0:"approval",className:I("w-full max-w-[840px] rounded-2xl border bg-card p-4",i||o?"border-hairline/30 opacity-70":"border-accent/40"),children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[s.jsx("div",{className:"text-[15px] font-semibold text-ink",children:h?a.title:w?w.headline:k??s.jsx(s.Fragment,{children:e?l("approval.card.namedWantsTo",{name:e.name,action:Wi(b)}):l("approval.card.wantsTo",{action:Wi(b)})})}),b&&!h&&!w&&s.jsx("span",{className:"shrink-0 font-mono text-[11px] text-ink-secondary",children:b})]}),w?.summary&&s.jsx("div",{className:"mt-0.5 text-[13px] text-ink-secondary",children:w.summary}),s.jsx("pre",{tabIndex:0,"aria-label":u?l("approval.aria.routineDetails"):p?l("approval.aria.skillDetails"):m?l("approval.aria.profileChange"):l("approval.aria.details"),className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-inset px-3 py-2 font-mono text-[13px] leading-relaxed text-ink",children:Xl(a)}),a.skillRequest&&s.jsx(MM,{request:a.skillRequest}),v&&s.jsx("div",{className:"mt-2 rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-[13px] text-warning",children:v}),s.jsx("div",{className:"mt-3 flex items-center gap-1.5 text-[13px] text-ink-secondary",children:y?s.jsxs(s.Fragment,{children:[i==="allow"&&!o?s.jsx(Se,{size:14,className:"text-success"}):s.jsx(Ae,{size:14})," ",y,d]}):s.jsxs(s.Fragment,{children:[s.jsx(Nx,{size:14,className:"text-accent"}),u||p||m||h?l("approval.status.waitingConfirmation"):l("approval.status.waitingAnswer")]})})]})}const wce=/^This message is too large for (.+)\. Start a new chat or pick a model that accepts more\.$/;function jce(e){return wce.exec(e.trim())?.[1]??null}const w_=/^(?:TypeError:\s*)?(?:Failed to fetch|NetworkError when attempting to fetch resource\.?|Load failed|fetch failed)$/i,Nce=/^(?:TimeoutError:\s*)?(?:The operation was aborted due to timeout|signal timed out|The operation timed out\.?)$/i,Sce=[w_,Nce,/^\d{3}(?: [A-Za-z][\w '-]*)?$/,/[{[]\s*"[\w$-]+"\s*:/,/\n\s+at \S/,/^[A-Z][a-z]+Error: /,/\b(?:E(?:CONNRESET|CONNREFUSED|CONNABORTED|NOTFOUND|AI_AGAIN|TIMEDOUT|PIPE|ACCES|PERM|NOENT|ADDRINUSE|HOSTUNREACH|NETUNREACH)|ERR_[A-Z_]{3,})\b/,/^(?:[\w-]+ ){0,2}(?:API Error|HTTP|status(?: code)?)[:\s]+\d{3}\b/i,/Unexpected token .* in JSON|is not valid JSON|Unexpected end of JSON input/,/^\S+(?: \S+){0,2} exited (?:with code )?(?:-?\d+|null|SIG[A-Z0-9]+)\b/,/^[a-z]+(?:_[a-z0-9]+)+$/],Ice=[[w_,"error.plain.unreachable"],[/\b429\b|rate.?limit|too many requests/i,"error.plain.rateLimited"],[/overloaded|\b529\b|\b503\b|capacity|service unavailable/i,"error.plain.busy"],[/ECONNRESET|ECONNREFUSED|ECONNABORTED|EPIPE|ENOTFOUND|EAI_AGAIN|EHOSTUNREACH|ENETUNREACH|socket hang up|connection (?:reset|refused)/i,"error.plain.connection"],[/timeout|timed out|ETIMEDOUT/i,"error.plain.timeout"],[/\b(?:EACCES|EPERM)\b/,"error.plain.permission"],[/\b40[13]\b|unauthori[sz]ed|forbidden/i,"error.plain.access"],[/\b404\b|not found|ENOENT/i,"error.plain.notFound"],[/\b413\b|too large/i,"error.plain.tooLarge"],[/\b5\d\d\b|internal server error|bad gateway/i,"error.plain.server"]];function bS(e){const t=e.trim();return!!t&&Sce.some(n=>n.test(t))}const Cce=/^(?:[\w-]+ ){0,2}(?:API Error|HTTP|status(?: code)?)[:\s]+\d{3}\b[\s:.-]*/i,Ece=/^(?:[A-Z][a-z]+ ?){1,4}\.?$/;function j3(e){const t=jce(e);if(t)return l("chat.error.requestTooLarge",{model:t});if(!bS(e))return;const n=e.trim(),a=n.replace(Cce,"").trim();if(a!==n&&/[A-Za-z]+\s+[A-Za-z]+/.test(a)&&!Ece.test(a)&&!bS(a))return a;const r=Ice.find(([i])=>i.test(n))?.[1]??"error.plain.generic";return l(r)}const Ace={bash:"toolStep.runCommand",shell:"toolStep.runCommand",terminal:"toolStep.runCommand",run_command:"toolStep.runCommand",execute:"toolStep.runCommand",computer_exec:"toolStep.runCommand",read:"toolStep.readFile",read_file:"toolStep.readFile",view:"toolStep.readFile",write:"toolStep.writeFile",create_file:"toolStep.writeFile",edit:"toolStep.editFile",multiedit:"toolStep.editFile",str_replace:"toolStep.editFile",apply_patch:"toolStep.editFile",notebookedit:"toolStep.editFile",delete:"toolStep.deleteFile",grep:"toolStep.searchFiles",glob:"toolStep.searchFiles",find:"toolStep.searchFiles",search:"toolStep.searchFiles",ls:"toolStep.searchFiles",websearch:"toolStep.searchWeb",web_search:"toolStep.searchWeb",webfetch:"toolStep.openWebPage",web_fetch:"toolStep.openWebPage",fetch:"toolStep.openWebPage",open_url:"toolStep.openWebPage",screenshot:"toolStep.lookAtScreen",computer_screenshot:"toolStep.lookAtScreen",click:"toolStep.useComputer",type_text:"toolStep.useComputer",press_key:"toolStep.useComputer",scroll:"toolStep.useComputer",computer_batch:"toolStep.useComputer",todowrite:"toolStep.updatePlan",update_plan:"toolStep.updatePlan",task:"toolStep.askHelper",agent:"toolStep.askHelper",think:"toolStep.think",list_bots:"toolStep.checkTeam",trigger:"toolStep.manageAutomations",trigger_info:"toolStep.checkAutomations",tool:"toolStep.useTool",other:"toolStep.useTool",mcp:"toolStep.useTool"};function yS(e){const t=e.replace(/\s+/g," ").trim();return t&&t[0].toLocaleUpperCase()+t.slice(1)}function j_(e,t){return t.whose?`${e} · ${l("toolStep.usingWhose",{person:t.whose.person,app:t.whose.app})}`:e}function ec(e){return j_(Tce(e),e)}function Tce(e){const{name:t}=e;if(e.label)return e.label;if(e.summary)return l("toolStep.runCommand");if(Ao(e.nameCode))return hi(e,t);if(/\s/.test(t))return t;const n=t.replace(/^mcp__.+?__(?=.)/,"");if(/(?:^|_)browser_/i.test(n))return l("toolStep.useBrowser");const a=Ace[n.toLowerCase()];if(a)return l(a);const r=LM(n);if(r)return yS(r);const i=n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-.:]+/g," ").toLowerCase();return yS(i)||l("toolStep.useTool")}const tf=/^(?:recovery|notice):\s*/;function N_(e){return!!e?.snapshot&&Xne(e)}function S_(e,t){return e.setup&&!e.claudeUpdate&&N_(t)?t:void 0}function Mce(e){return e?.driverKind==="claudeAgent"&&!e.readOnly?e:void 0}function N3(e,t){return e&&t.find(n=>n.instanceId===e.modelSelection.instanceId)}function I_(e){const t=_a(e.name)??e.name;return{cause:t,notice:Ao(e.nameCode)?hi(e,t):null}}function _ce(e,t){return Ao(e.nameCode)?hi(e,t):j3(t)??t}function C_(e,t,n,a=!1){if(n)return n.title;if(Bx(e.name))return l("chat.turnStopped");const r=_a(e.name);if(r!==null&&cu(r))return l("chat.turnStopped");if(r!==null&&e.partial)return l("chat.error.partialPreview");if(r===null&&Ao(e.nameCode))return hi(e,e.name.replace(tf,""));if(r===null)return a?e.name:tf.test(e.name)?e.name.replace(tf,""):ec(e);const i=S_(e,t);return i?l("sidebar.preview.signedOut",{name:i.displayName}):_ce(e,r)}const Cl="builtin:pinned",ju="builtin:channels",Nu="builtin:bot-chats",Gr="builtin:bots",kS="builtin:attention",vS="builtin:pinned-threads",wS="builtin:tools",Oy="section:",Rce={working:"routines.goal.working",completed:"routines.goal.completed","needs-input":"routines.goal.needs-input",blocked:"routines.goal.blocked","limit-reached":"routines.goal.limit-reached",paused:"routines.goal.paused",stopped:"routines.goal.stopped",failed:"routines.goal.failed"};function dh(e){return[...new Set(e.filter(Boolean))]}function Ly(e){return`${Oy}${e}`}function S3(e){return e.startsWith(Oy)?e.slice(Oy.length):null}function Oce(e){return e===Cl?"Pinned":e===ju?"Group chats":e===Nu?"Bot threads":e===Gr?"Bots":S3(e)??e}function Lce(e){const t=e.detail?.replace(/\s+/g," ").trim(),n=e.goal.replace(/\s+/g," ").trim(),a=t||n,r=l(Rce[e.status]);return a?`${r}: ${a}`:r}function E_(e,t){if(e.dismissed)return e.label;const n=e.status==="connected"?"connectors.card.connected":e.status==="authorizing"?"connectors.card.waiting":"connectors.card.connectSecurely";return`${e.label} · ${t(n)}`}function A_(e,t){return e!=="icons"&&t.trim().length===0}function zce(e,t,n,a){return A_(n,a)&&t.includes(e)}function Pce(e,t,n){return e&&t!=="icons"&&n>0}function Dce(e,t){const n=t?.universalPins===!0,a=m=>!E2(m,t?.viewerEmail)||t?.searching===!0&&!!m.defaultBot&&!BT(m,t.viewerEmail),r=e.filter(m=>!m.hidden&&a(m)&&m.id!==t?.welcoming),i=r.filter(m=>!!m.pinned&&(n||!m.chiefOfStaff||!!m.section)),o=new Set(i.map(m=>m.id)),c=r.find(m=>m.chiefOfStaff&&!m.section&&!o.has(m.id))??null,d=r.filter(m=>m.chiefOfStaff&&!!m.section&&!o.has(m.id)),u=r.filter(m=>!m.chiefOfStaff&&!!m.section&&!o.has(m.id)),p=r.filter(m=>(!m.chiefOfStaff||t?.searching===!0&&m!==c)&&!m.section&&!o.has(m.id));return{unsectionedChief:c,pinnedBots:i,sectionChiefs:d,sectionedBots:u,unsectionedBots:p}}function $ce(e,t){const n=e.unsectionedChief??e.pinnedBots.find(r=>r.chiefOfStaff&&!r.section)??[...e.pinnedBots,...e.unsectionedBots].find(r=>r.id===t)??null;if(!n)return{...e,primary:n};const a=r=>r.filter(i=>i.id!==n.id);return{...e,primary:n,unsectionedChief:null,pinnedBots:a(e.pinnedBots),unsectionedBots:a(e.unsectionedBots)}}function Bce(e,t){const n=a=>{const r=a.map(t);return[...a.filter((i,o)=>r[o]),...a.filter((i,o)=>!r[o])]};return{pinnedBots:n(e.pinnedBots),sectionedBots:n(e.sectionedBots),unsectionedBots:n(e.unsectionedBots)}}function Fce(e){const t=e.filter(i=>!!i.dm),n=e.filter(i=>!i.dm),a=n.filter(i=>!!i.section),r=n.filter(i=>!i.section);return{botChats:t,sectionedRooms:a,unsectionedRooms:r}}function T_(e,t){const n=dh(e),a=new Set(n),r=dh(t).filter(i=>a.has(i));if(r.length===0)return n;for(const i of n){if(r.includes(i))continue;const o=n.indexOf(i),c=n.slice(0,o).reverse(),d=n.slice(o+1),u=c.find(x=>r.includes(x)),p=d.find(x=>r.includes(x)),m=u?r.indexOf(u):-1,h=p?r.indexOf(p):-1;m>=0&&(h<0||m<h)?r.splice(m+1,0,i):h>=0?r.splice(h,0,i):r.push(i)}return r}const jS=[Cl,Gr,ju,Nu];function Uce(e){return[...jS.filter(t=>e.includes(t)),...e.filter(t=>!jS.includes(t))]}function qce(e,t){return T_(Uce(e),t)}function Hce(e,t,n){const a=e.indexOf(t),r=a+n;if(a<0||r<0||r>=e.length)return e;const i=[...e],[o]=i.splice(a,1);return i.splice(r,0,o),i}function Wce(e,t,n,a){if(t===n||!e.includes(t)||!e.includes(n))return e;const r=e.filter(o=>o!==t);let i=r.indexOf(n);return a==="after"&&(i+=1),r.splice(i,0,t),r}function Kce(e,t){const n=dh(e),a=dh(t),r=new Set(a);for(let i=0;i<n.length;i+=1){const o=n[i];if(r.has(o))continue;let c=a.length,d=!1;for(let u=i-1;u>=0;u-=1){const p=a.indexOf(n[u]);if(p>=0){c=p+1,d=!0;break}}if(!d)for(let u=i+1;u<n.length;u+=1){const p=a.indexOf(n[u]);if(p>=0){c=p;break}}a.splice(c,0,o),r.add(o)}return a}function NS(e,t){return e.length===t.length&&e.every((n,a)=>n===t[a])}function M_(e){return!!e&&(typeof e.working=="boolean"||e.busyBotId!==void 0)}function __(e,t){return e.tasks?.find(n=>n.threadId===t)}function cp(e,t){const n=__(e,t);return M_(n)?!!(n.working||n.busyBotId):t===e.threadId&&!!(e.working||e.busyBotId)}function I3(e,t){const n=__(e,t);return M_(n)?n.busyBotId??null:t===e.threadId?e.busyBotId??null:null}function R_(e){const t=[e.busyBotId,...(e.tasks??[]).map(n=>n.busyBotId)].filter(n=>typeof n=="string"&&n.length>0);return[...new Set(t)]}function Vce(e){return(e.tasks??[]).filter(t=>t.threadId!==e.threadId&&cp(e,t.threadId)).length}function O_(e,t){return(e.queue??[]).filter(n=>n.threadId===t&&n.state==="queued")}function C3(e,t){const n=e.waitingForBotId?t(e.waitingForBotId):void 0;return n?l("room.queue.waitingFor",{name:n,position:e.position,of:e.of}):l("room.queue.waiting",{position:e.position,of:e.of})}function Gce(e,t){const n=e.busyBotId??R_(e)[0],a=(e.queue??[]).filter(r=>r.state==="queued");if(n){const r=t(n)??l("sidebar.preview.aBot");return a.length?l("sidebar.preview.botWorkingQueued",{name:r,count:a.length}):l("sidebar.preview.botWorking",{name:r})}if(a[0])return l("room.queue.member",{name:t(a[0].botId)??l("sidebar.preview.aBot"),status:C3(a[0],t)})}const Yce=["value","label","title","caption"],Jce=/^(?:brief|chat\.notice|server\.meetings)\.[\w.]{1,80}$/,Qce=new Set(["clock","bareClock","longDate","shortDate"]),Xce=8,Zce=3,ede=400,uh=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);function tde(e,t){if(typeof e=="string")return e.slice(0,ede);if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(uh(e))return typeof e.at=="number"&&Number.isFinite(e.at)&&Qce.has(e.style)?{at:e.at,style:e.style,...typeof e.zone=="string"&&e.zone.length<=64?{zone:e.zone}:{}}:L_(e,t+1)}function L_(e,t){if(!uh(e)||typeof e.key!="string"||!Jce.test(e.key)||t>Zce)return;if(e.params===void 0)return{key:e.key};if(!uh(e.params))return;const n=Object.entries(e.params).slice(0,Xce).map(([a,r])=>[a,tde(r,t)]);if(!n.some(([a,r])=>r===void 0||!/^\w{1,32}$/.test(a)))return{key:e.key,params:Object.fromEntries(n)}}function nde(e){if(!uh(e))return;const t={};for(const n of Yce){const a=L_(e[n],0);a&&(t[n]=a)}return Object.keys(t).length?t:void 0}const sde={clock:{hour:"2-digit",minute:"2-digit"},bareClock:{hour:"2-digit",minute:"2-digit"},longDate:{weekday:"long",month:"long",day:"numeric"},shortDate:{weekday:"short",month:"short",day:"numeric"}};function ade(e){const t=new Intl.DateTimeFormat(dt(),{...sde[e.style],timeZone:e.zone??"UTC"}).format(e.at);return e.style==="clock"&&!e.zone?`${t} UTC`:t}function rde(e){return typeof e!="object"?e:"at"in e?ade(e):z_(e)}function z_(e){if(e.key.startsWith("chat.notice.")){if(Object.values(e.params??{}).some(r=>typeof r=="object"))throw new Error(`notice ${e.key} takes flat params`);return OM(e.key,e.params)}if(!e.key.startsWith("brief.")||!Object.hasOwn(Ia,e.key))throw new Error(`unknown card text ${e.key}`);const t=Object.fromEntries(Object.entries(e.params??{}).map(([r,i])=>[r,rde(i)]));if(e.key.startsWith("brief.inbox.")&&typeof t.amountValue=="string"&&Number.isFinite(Number(t.amountValue))&&(t.amount=new Intl.NumberFormat(dt()).format(Number(t.amountValue))),e.key.startsWith("brief.inbox.")&&typeof t.deadline=="string"&&/^\d{4}-\d{2}-\d{2}(?:T.*)?$/.test(t.deadline)){const r=new Date(t.deadline),i=new Date(t.deadline.slice(0,10));Number.isFinite(r.getTime())&&Number.isFinite(i.getTime())&&i.toISOString().slice(0,10)===t.deadline.slice(0,10)&&(t.deadline=new Intl.DateTimeFormat(dt(),{dateStyle:"medium",...t.deadline.length===10?{timeZone:"UTC"}:{}}).format(r))}if([...l(e.key).matchAll(/\{(\w+)\}/g)].some(([,r])=>!Object.hasOwn(t,r)))throw new Error(`card text ${e.key} lacks a param`);return l(e.key,t)}function P_(e){const t=nde(e.i18n),n={...e};for(const[a,r]of Object.entries(t??{}))try{n[a]=z_(r)}catch{continue}return e.children&&(n.children=e.children.map(P_)),n}function D_(e,t,n=tt()){return!t||n==="en"?e:{...e,root:P_(e.root)}}const fo={label:80,fieldValue:2e3,fallback:1500},L1=/^[\w-]{1,128}$/;function ide(e){if(e.type!=="open_thread"||!ai(e.payload))return;const{botId:t,groupId:n,threadId:a}=e.payload;if(!(typeof a!="string"||!L1.test(a))){if(typeof t=="string"&&L1.test(t)&&n===void 0)return{botId:t,threadId:a};if(typeof n=="string"&&L1.test(n)&&t===void 0)return{groupId:n,threadId:a}}}const $_="open_phone_pairing",ode=e=>e.type==="open_url"||e.type==="open_thread"||e.type===$_,lde=new Set(["Select","DatePicker","TimePicker","DayPicker","Checkbox","RadioGroup","Input","Textarea"]),Ur=["mon","tue","wed","thu","fri","sat","sun"];function ai(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function B_(e){return e.allowOther===!0&&(e.type==="Select"||e.type==="RadioGroup"||e.type==="ListView"&&typeof e.name=="string")}const Le=(e,t)=>typeof e[t]=="string"?e[t]:void 0,qt=(e,t)=>typeof e[t]=="number"?e[t]:void 0;function F_(e,t){const n=e[t];return ai(n)&&typeof n.label=="string"&&ai(n.action)?n:void 0}function tc(e,t,n=[]){t(e,n);const a=[...n,e];for(const r of Array.isArray(e.children)?e.children:[])ai(r)&&tc(r,t,a)}function zy(e,t){for(let n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function SS(e){let t="";return tc(e,n=>{t||n.type!=="Title"&&n.type!=="Text"||typeof n.value!="string"||typeof n.width=="number"||(t=n.value.replace(/\s+/g," ").trim().slice(0,fo.label))}),t}function cde(e,t){const n=[];tc(e,(r,i)=>{if(r.type==="Button"){if(r.disabled===!0)return;const o=zy(i,m=>m.type==="Form"),c=ai(r.onClickAction)?r.onClickAction:void 0,d=r.submit===!0&&ai(o?.onSubmitAction)?o.onSubmitAction:void 0,u=c??d;if(!u)return;const p=zy(i,m=>m.type==="ListViewItem"||m.type==="Table.Row"||m.type==="Row");n.push({ref:r.id,label:Le(r,"label")??"",action:u,kind:"button",...r.submit===!0?{tone:"submit"}:{},...p?{row:SS(p)}:{}})}else r.type==="ListViewItem"&&ai(r.onClickAction)&&n.push({ref:r.id,label:SS(r),action:r.onClickAction,kind:"item"})});for(const r of["confirm","cancel"]){const i=F_(e,r);i&&n.push({ref:r,label:i.label,action:i.action,tone:r,kind:r})}const a=new Map;for(const r of n)a.set(r.label,(a.get(r.label)??0)+1);return n.map(({row:r,...i})=>({...i,...ode(i.action)?{client:!0}:{},label:r&&i.label&&(a.get(i.label)??0)>1?`${i.label}: ${r}`.slice(0,fo.label*2):i.label}))}function dde(e){return cde(e)}function ude(e,t){let n=e;return tc(e,(a,r)=>{a.id===t&&(n=zy(r,i=>i.type==="Form")??e)}),n}function Py(e,t=e){const n=new Map;tc(t,r=>{r.type==="Label"&&typeof r.fieldName=="string"&&typeof r.value=="string"&&n.set(r.fieldName,r.value)});const a=[];return tc(e,r=>{if(typeof r.name!="string"||!(lde.has(r.type)||r.type==="ListView"))return;const i=r.type==="ListView"?Le(r,"title"):Le(r,"label");a.push({name:r.name,type:r.type,node:r,label:n.get(r.name)??i??r.name})}),a}function pde(e){const t={};for(const n of Py(e))t[n.name]=n.type==="Checkbox"?n.node.defaultChecked===!0:Le(n.node,"defaultValue")??"";return t}function mde(e){const t=e.split(",").filter(Boolean);if(t.length===7)return"Every day";if(t.join(",")==="mon,tue,wed,thu,fri")return"Weekdays";if(t.join(",")==="sat,sun")return"Weekends";const n={mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",sun:"Sun"};return t.map(a=>n[a]??a).join(", ")}function nf(e){switch(e.type){case"Text":case"Title":case"Caption":case"Label":return Le(e,"value")??"";case"Markdown":return(Le(e,"value")??"").replace(/\s+/g," ");case"Badge":return Le(e,"label")??"";case"Button":return e.label?`[${String(e.label)}]`:"";case"Image":return e.alt?`[image: ${String(e.alt)}]`:"[image]";case"Progress":return[Le(e,"label"),`${Math.round((qt(e,"value")??0)*100)}%`].filter(Boolean).join(" ");case"Chart":return`[chart: ${(Array.isArray(e.series)?e.series:[]).map(t=>t.label??t.dataKey).join(", ")}]`;case"Checkbox":return`[ ] ${Le(e,"label")??String(e.name)}`;case"Select":case"RadioGroup":return`(${(Array.isArray(e.options)?e.options:[]).slice(0,6).map(t=>t.label).join(" / ")})`;case"DayPicker":return`[${typeof e.defaultValue=="string"?mde(e.defaultValue):"days"}]`;case"Input":case"Textarea":case"DatePicker":case"TimePicker":return`[${Le(e,"placeholder")??String(e.name)}]`;default:return(Array.isArray(e.children)?e.children:[]).map(nf).filter(Boolean).join(" · ")}}function U_(e){const t=Array.isArray(e.children)?e.children:[];return e.type==="ListViewItem"?[`- ${nf(e)}`]:e.type==="Table"?t.map(a=>(Array.isArray(a.children)?a.children:[]).map(nf).join(" | ")):e.type==="Markdown"?[Le(e,"value")??""]:e.type==="Col"||e.type==="Form"||e.type==="Transition"||e.type==="Box"&&e.direction!=="row"?t.flatMap(U_):[nf(e)]}function fde(e){const t=[],n=ai(e.status)&&typeof e.status.text=="string"?e.status.text:"";n&&t.push(n);const a=Le(e,"title"),r=[a?`**${a}**`:"",Le(e,"caption"),Le(e,"meta")].filter(Boolean).join(" · ");r&&t.push(r);for(const c of Array.isArray(e.children)?e.children:[])t.push(...U_(c));const i=["confirm","cancel"].map(c=>F_(e,c)?.label).filter(Boolean).map(c=>`[${c}]`).join(" ");i&&t.push(i);const o=t.map(c=>c.trimEnd()).filter(Boolean).join(`
114
- `);return o.length<=fo.fallback?o:`${o.slice(0,fo.fallback-1).trimEnd()}…`}function q_(e){return e?.findLast(t=>!g7(t)&&t.kind!=="screen")}function H_(e,t,n,a){return e.activity==="waiting-on-you"?l("sidebar.preview.waiting"):e.waitingForTeammates?l("sidebar.preview.waitingOnTeammate"):e.busy?l("sidebar.preview.working"):xde(e,t,n,a)}function hde(e){const t=e.kind==="activity"?e.tool:void 0;return!!t&&!e.dataResult&&_a(t.name)===null&&!Bx(t.name)&&!tf.test(t.name)}function W_(e,t,n){if(n||!hde(t))return t;for(let a=e.length-1;a>=0;a--){const r=e[a];if(r.role==="user")break;if(r.kind!=="activity"&&!g7(r)&&r.kind!=="screen")return r}return t}function xde(e,t,n,a){const r=q_(t);if(!r)return"";const i=W_(t,r,a);if(i.kind==="options"&&i.card)return i.helperIntro?l(a?"helperIntro.title":e.chiefOfStaff?"helperIntro.hello":"helperIntro.hi.helper",{name:e.name}):i.card.requestId&&i.card.tool&&!i.card.questionRequest&&w3(i.card)||i.card.title;if(i.kind==="activity"&&i.tool)return C_(i.tool,N3(e,n),i.dataResult,a);if(i.kind==="connector"&&i.connector)return E_(i.connector,l);if(i.kind==="routine.run"&&i.routineRun)return yde(i.routineRun);const o=Ws(i);return o?`${o.name}: ${iu(o.body)}`:i.role!=="user"&&cu(i.text??"")?l("chat.turnStopped"):iu(ap(gde(i)??i.text??""))}function gde(e){if(e.kind!=="widget"||!e.widget?.root||e.serverCard!==!0)return;const t=D_(e.widget,!0);return t===e.widget?void 0:fde(t.root)}const bde={completed:"automations.preview.finished",failed:"automations.preview.failed",waiting:"automations.preview.needsYou",cancelled:"automations.preview.stopped",missed:"automations.preview.missed",running:"automations.preview.running",queued:"automations.preview.running"};function yde(e){return l(bde[e.status],{name:e.routineName})}function kde(e,t,n,a){const r=Gce(e,u=>t.find(p=>p.id===u)?.name);if(r)return r;if(e.working)return l("sidebar.preview.teamWorking");const i=q_(e.messages);if(!i)return l("sidebar.preview.noMessages");const o=W_(e.messages,i,a);if(o.kind==="text"&&o.role!=="user"&&cu(o.text??"")){const u=l("chat.turnStopped");return o.from?`${o.from.name}: ${u}`:u}const c=o.kind==="activity"&&o.tool?C_(o.tool,N3(t.find(u=>u.id===o.from?.botId),n),o.dataResult,a):o.kind==="goal.run"&&o.goalRun?Lce(o.goalRun):o.kind==="connector"&&o.connector?E_(o.connector,l):o.text??"",d=iu(ap(c));return o.role==="user"?l("sidebar.preview.you",{text:d}):o.from?`${o.from.name}: ${d}`:d}const vde={bots:[],departments:[]},wde=e=>e?.pausedByPerson??vde;function K_(e,t,n){const a=wde(e);return t==="bot"?a.bots.includes(n):a.departments.includes(n.trim())}const V_=(e,t)=>e?.heldBots?.includes(t)===!0;async function G_(e,t,n){return K("/api/paused",{method:"POST",body:JSON.stringify({kind:e,id:t,paused:n}),timeoutMs:6e4})}function oa(e){const{open:t,onCancel:n,returnFocusRef:a}=e,r=f.useRef(null),i=f.useRef(null),o=f.useRef(n);return o.current=n,f.useEffect(()=>{if(!t)return;const c=document.activeElement instanceof HTMLElement?document.activeElement:null;i.current?.focus();const d=u=>{if(u.key==="Escape"){u.preventDefault(),o.current();return}if(u.key==="Tab"){const p=r.current?.querySelectorAll("button:not([disabled])");if(!p?.length){u.preventDefault(),r.current?.focus();return}const m=p[0],h=p[p.length-1];u.shiftKey&&document.activeElement===m?(u.preventDefault(),h.focus()):!u.shiftKey&&document.activeElement===h&&(u.preventDefault(),m.focus())}};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d),(c?.isConnected&&c!==document.body?c:a?.current)?.focus()}},[t,a]),f.useEffect(()=>{t&&(e.pending?r.current?.focus():i.current?.focus())},[t,e.pending]),t?Ke.createPortal(s.jsx("div",{className:`fixed inset-0 ${e.layer??"z-50"} flex items-center justify-center bg-black/55 p-6`,onMouseDown:c=>c.stopPropagation(),children:s.jsx(jde,{ref:r,cancelRef:i,...e})}),document.body):null}function jde({ref:e,cancelRef:t,title:n,body:a,confirmLabel:r,cancelLabel:i=l("common.cancel"),tone:o="danger",icon:c,onCancel:d,onConfirm:u,alternative:p,pending:m=!1}){const h=o==="danger";return s.jsxs("div",{ref:e,role:"alertdialog","data-look":"dialog",tabIndex:-1,"aria-modal":"true","aria-busy":m,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-body",className:I("w-full max-w-[420px] rounded-2xl border bg-panel p-5 shadow-2xl",h?"border-danger/30":"border-hairline/50"),children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:I("mt-0.5 shrink-0",h?"text-danger":"text-warning"),children:c??s.jsx(Ds,{size:18})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h2",{id:"confirm-dialog-title",className:"text-[15px] font-semibold text-ink",children:n}),s.jsx("p",{id:"confirm-dialog-body",className:"mt-1.5 text-[13px] leading-relaxed text-ink-secondary",children:a})]})]}),s.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[s.jsx("button",{ref:t,type:"button",onClick:d,disabled:m,className:"rounded-xl px-4 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",children:i}),p&&s.jsx("button",{type:"button","data-confirm-alternative":!0,onClick:p.onClick,disabled:m,className:"rounded-xl bg-accent px-4 py-2 text-[13px] font-medium text-accent-ink hover:brightness-110",children:p.label}),s.jsx("button",{type:"button",onClick:u,disabled:m,className:I("rounded-xl px-4 py-2 text-[13px] font-medium",h?"bg-danger text-white hover:brightness-110":"bg-accent text-accent-ink hover:brightness-110"),children:r})]})]})}const Nde=200,Sde=864e5,To=e=>e.activity!=="working"&&!e.busy;function Ide(e,t){const n=new Set(e);return n.delete(t)||n.add(t),n}function Cde(e,t,n,a,r){const i=new Set(e),o=t.findIndex(p=>p.threadId===a);if(o<0)return i;const c=n===null?-1:t.findIndex(p=>p.threadId===n),[d,u]=c<0?[o,o]:[Math.min(c,o),Math.max(c,o)];for(const p of t.slice(d,u+1))To(p)&&(r?i.add(p.threadId):i.delete(p.threadId));return i}function Ede(e,t,n,a,r){return r&&n!==null?Cde(e,t,n,a,!e.has(a)):Ide(e,a)}const Ade=e=>{if(typeof e.updatedAt=="number"&&Number.isFinite(e.updatedAt)&&e.updatedAt>0)return e.updatedAt;if(typeof e.createdAt=="number"&&Number.isFinite(e.createdAt)&&e.createdAt>0)return e.createdAt};function Tde(e,t,n){const a=n-t*Sde;return e.filter(r=>{const i=Ade(r);return i!==void 0&&i<a&&r.pinned!==!0&&To(r)}).map(r=>r.threadId)}const Mde=e=>e.filter(t=>t.archivedAt!==void 0&&t.pinned!==!0&&To(t)).map(t=>t.threadId),_de=e=>new Set(e.filter(To).map(t=>t.threadId)),Y_=()=>new Set;function Rde(e,t=Nde){const n=[];for(let a=0;a<e.length;a+=t)n.push(e.slice(a,a+t));return n}function Ode(e){const t={deleted:0,busy:0,missing:0};for(const n of e){t.deleted+=n.deleted.length;for(const a of n.refused)a.reason==="busy"?t.busy++:t.missing++}return t}const Lde=(e,t,n)=>!n&&(e==="ContextMenu"||t&&e==="F10");async function E3(e,t,n){const a="botId"in e?`/api/bots/${e.botId}/tasks/delete`:`/api/groups/${e.groupId}/tasks/delete`,r=[];try{for(const i of Rde(t)){const o=await K(a,{method:"POST",body:JSON.stringify({threadIds:i})});r.push(o),o.bot&&n({type:"botPatched",bot:o.bot}),o.group&&n({type:"groupPatched",group:o.group})}return{responses:r}}catch(i){const o=i instanceof Error?i.message:String(i);return n({type:"error",message:o}),{responses:r,error:o}}}function J_(e,t,n){const a=e.filter(i=>t.has(i.threadId)&&i.pinned===!0).length,r=e.length>0&&e.every(i=>t.has(i.threadId));return[l("task.bulk.confirmBody"),a>0?l("task.bulk.pinnedNote",{count:a}):null,n&&r?l("task.bulk.freshNote"):null].filter(Boolean).join(" ")}function Q_(e){const t=Ode(e.responses);return[l("task.bulk.result",{count:t.deleted}),t.busy>0?l("task.bulk.resultBusy",{count:t.busy}):null,t.missing>0?l("task.bulk.resultMissing",{count:t.missing}):null,e.error?l("task.bulk.resultError",{message:e.error}):null].filter(Boolean).join(" ")}const IS=30,em="rounded-full border border-hairline/50 px-2.5 py-0.5 text-[11px] text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-40";function X_(){const[e,t]=f.useState(!1),[n,a]=f.useState(new Set),r=f.useRef(null),i=f.useRef([]),o=f.useCallback((p,m)=>{const h=r.current;r.current=p.threadId,a(x=>Ede(x,i.current,h,p.threadId,m))},[]),c=f.useCallback(()=>t(!0),[]),d=f.useCallback(()=>{t(!1),a(new Set),r.current=null},[]);return{active:e,start:c,finish:d,forRows:p=>(i.current=p,new Set(p.filter(m=>n.has(m.threadId)&&To(m)).map(m=>m.threadId))),setSelected:a,toggle:o}}function Z_({rows:e,selected:t,now:n,onChange:a,onDone:r}){const i=o=>a(new Set([...t,...o]));return s.jsxs("div",{className:"flex flex-wrap items-center gap-1 px-2 pb-1.5 pt-1",role:"group","aria-label":l("task.bulk.select"),children:[s.jsx("button",{type:"button",className:em,onClick:()=>a(_de(e)),children:l("task.bulk.selectAll")}),s.jsx("button",{type:"button",className:em,onClick:()=>i(Tde(e,IS,n)),children:l("task.bulk.older",{days:IS})}),s.jsx("button",{type:"button",className:em,onClick:()=>i(Mde(e)),children:l("task.bulk.archived")}),s.jsx("button",{type:"button",className:em,disabled:t.size===0,onClick:()=>a(Y_()),children:l("task.bulk.clear")}),s.jsx("button",{type:"button",onClick:r,className:"ml-auto rounded px-1.5 py-0.5 text-[11px] font-medium text-accent hover:underline",children:l("task.bulk.done")})]})}function zde({rows:e,selected:t,maxDeletable:n,freshConversation:a,onChange:r,onDelete:i}){const[o,c]=f.useState(!1),[d,u]=f.useState(!1),[p,m]=f.useState(null),h=t.size,x=n!==void 0&&h>n,g=J_(e,t,a),v=()=>{const y=[...t];u(!0),m(null),i(y).then(w=>{const b=new Set(w.responses.flatMap(k=>k.deleted));r(k=>new Set([...k].filter(j=>!b.has(j)))),m(Q_(w)),u(!1),c(!1)})};return s.jsxs("div",{className:"sticky bottom-0 z-10 -mx-1 border-t border-hairline/40 bg-panel px-2 py-1.5",children:[s.jsx("span",{role:"status",className:"block text-[11px] text-ink-secondary",children:p??(x?l("task.bulk.channelLimit"):"")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] font-medium text-ink",children:l("task.bulk.selected",{count:h})}),s.jsx("button",{type:"button",disabled:h===0||d,onClick:()=>r(Y_()),className:"rounded-md px-2.5 py-1 text-[12px] text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-40",children:l("task.bulk.cancel")}),s.jsx("button",{type:"button",disabled:h===0||x||d,"aria-busy":d||void 0,onClick:()=>c(!0),className:"rounded-md bg-danger px-2.5 py-1 text-[12px] font-medium text-white hover:brightness-110 disabled:opacity-40",children:d?l("task.bulk.deleting"):l("task.bulk.delete",{count:h})})]}),s.jsx(oa,{open:o,title:l("task.bulk.confirmTitle",{count:h}),body:g,confirmLabel:l("task.bulk.delete",{count:h}),pending:d,onCancel:()=>{d||c(!1)},onConfirm:v})]})}function eR({bulk:e,rows:t,selected:n,total:a,canShowAll:r,canSelect:i,onShowAll:o,maxDeletable:c,freshConversation:d,onDelete:u}){if(e.active)return s.jsx(zde,{rows:t,selected:n,maxDeletable:c,freshConversation:d,onChange:e.setSelected,onDelete:u});if(!r&&!i)return null;const p="inline-flex h-7 items-center text-[13px] font-medium leading-4 text-ink-secondary hover:text-ink";return s.jsxs("div",{className:"flex items-center justify-between pl-6 pr-2",children:[r?s.jsx("button",{type:"button",onClick:o,className:p,children:l("task.showAll",{count:a})}):s.jsx("span",{}),i&&s.jsx("button",{type:"button",onClick:e.start,className:p,children:l("task.bulk.select")})]})}function Pde({members:e,density:t,large:n=!1}){const a=t==="icons",r=a?"size-12":n?"size-9":"size-8",i=a?44:n?36:32;if(e.length<=1){const d=e[0];return s.jsx("div",{className:I("flex shrink-0 items-center justify-center",r),children:d?s.jsx(Je,{bot:d,state:"happy",size:i,animated:!1}):s.jsx(_n,{size:24,className:"text-ink-secondary"})})}const o=e.slice(0,2),c=e.length-o.length;return s.jsx("div",{className:I("flex shrink-0 items-center justify-center",r),children:s.jsxs("div",{className:"flex items-center -space-x-2.5",children:[o.map(d=>s.jsx(Je,{bot:d,state:"happy",size:a?30:n?26:20,animated:!1},d.id)),c>0&&s.jsxs("span",{className:"z-10 flex size-4 items-center justify-center rounded-full border border-hairline/40 bg-raised text-[9px] font-medium text-ink-secondary",children:["+",c]})]})})}function A3({open:e,onCancel:t,onConfirm:n}){const a=f.useRef(null);return f.useEffect(()=>{if(!e)return;a.current?.focus();const r=i=>{i.key==="Escape"&&(i.preventDefault(),t())};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,t]),e?s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6",onMouseDown:r=>r.stopPropagation(),children:s.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"local-auto-warning-title","aria-describedby":"local-auto-warning-body",className:"w-full max-w-[420px] rounded-2xl border border-hairline/50 bg-panel p-5 shadow-2xl",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Ds,{size:18,className:"mt-0.5 shrink-0 text-warning"}),s.jsxs("div",{children:[s.jsx("h2",{id:"local-auto-warning-title",className:"text-[15px] font-semibold text-ink",children:l("permissions.localAuto.title")}),s.jsx("p",{id:"local-auto-warning-body",className:"mt-1.5 text-[13px] leading-relaxed text-ink-secondary",children:l("permissions.localAuto.body")})]})]}),s.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[s.jsx("button",{type:"button",onClick:t,className:"rounded-xl px-4 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",children:l("common.cancel")}),s.jsx("button",{ref:a,type:"button",onClick:n,className:"rounded-xl bg-accent px-4 py-2 text-[13px] font-medium text-white hover:brightness-110",children:l("common.ok")})]})]})}):null}function dp(e,t){const n=t.trim();return!n||n===e?null:n}const z1=["ring-2","ring-accent/70","rounded-2xl","transition-shadow"];async function Dde(e,t,n,a){if(!e.hasMore||e.messages.some(d=>d.id===t))return;const r=[];let i=e.messages[0]?.id,o=!0,c=!1;for(;i&&o&&!c;){const d=await K(`/api/threads/${e.threadId}/messages?limit=${dd}&before=${encodeURIComponent(i)}`),u=d.messages??[];r.unshift(...u),c=u.some(p=>p.id===t),o=!!d.hasMore&&u.length>0,i=u[0]?.id}r.length&&a({type:"olderMessages",threadId:e.threadId,generation:n,messages:r,hasMore:o})}async function T3(e,t,n,a){const r=e.botId??e.groupId,i=e.botId?t.bots.find(u=>u.id===e.botId):void 0,o=e.groupId?t.groups.find(u=>u.id===e.groupId):void 0;if(!r||!i&&!o)throw new Error(l("chat.conversationGone"));const c=i&&i.threadId!==e.threadId&&!a?i:void 0;if(c||n({type:"select",id:r}),i&&i.threadId!==e.threadId&&!c){const u=await K(`/api/bots/${i.id}/tasks/${e.threadId}`,{method:"POST"});u?.bot&&n({type:"taskSwitched",bot:u.bot})}if(o&&o.threadId!==e.threadId){const u=await K(`/api/groups/${o.id}/tasks/${e.threadId}`,{method:"POST"});u?.group&&n({type:"groupPatched",group:u.group})}const d=i?.threadId===e.threadId?i:o?.threadId===e.threadId?o:void 0;if(d&&await Dde(d,e.messageId,t.transcriptGeneration[e.threadId]??0,n),i&&!e.onActivePath){const u=await K(`/api/bots/${i.id}/active-branch`,{method:"POST",body:JSON.stringify({messageId:e.messageId,threadId:e.threadId})});u?.activeLeafId&&n({type:"threadActive",threadId:e.threadId,activeLeafId:u.activeLeafId})}c&&n({type:"switchTask",botId:c.id,threadId:e.threadId,whole:!0}),n({type:"focusMessage",threadId:e.threadId,messageId:e.messageId,matchText:e.snippet.slice(e.matchStart,e.matchStart+e.matchLength)})}function $de(e,t){const n=t.trim();if(!n)return null;const a=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let i="";for(;r.nextNode();){const p=r.currentNode;a.push(p),i+=p.data}const o=n.split(/\s+/).map(p=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("\\s+"),c=new RegExp(o,"iu").exec(i);if(!c)return null;const d=document.createRange();let u=0;for(const p of a){const m=u+p.length;if(c.index>=u&&c.index<m&&d.setStart(p,c.index-u),c.index+c[0].length<=m)return d.setEnd(p,c.index+c[0].length-u),d;u=m}return null}function Bde(e,t){const{state:n,dispatch:a}=re(),r=n.focusMessage;f.useEffect(()=>{if(!r||r.consumed||r.threadId!==e||!t)return;let i=0,o=!1,c=null,d=null,u=null,p=null,m=null;const h=()=>{if(o)return;const g=document.querySelector(`[data-mid="${CSS.escape(r.messageId)}"]`)?.lastElementChild;if(p=r.matchText?g?.querySelector("[data-chat-bubble]")??g:g,!p){i++<20&&(c=setTimeout(h,100));return}const v=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;p.scrollIntoView({block:"center",behavior:v?"auto":"smooth"}),p.classList.add(...z1);const y=p.querySelectorAll(".chat-md, .chat-text"),w=[];for(let k=0;k<y.length;k++){const j=y.item(k);j&&!j.closest?.("[data-reply-quote]")&&w.push(j)}let b=null;for(const k of w.length?w:[p])if(b=$de(k,r.matchText??""))break;b&&CSS.highlights&&(m=new Highlight(b),CSS.highlights.set("search-result-text",m),u=requestAnimationFrame(()=>{const k=p?.closest(".overflow-y-auto");if(!k)return;const j=b.getBoundingClientRect(),N=k.getBoundingClientRect();k.scrollTop+=j.top+j.height/2-N.top-N.height/2})),a({type:"focusMessageConsumed",nonce:r.nonce}),d=setTimeout(()=>p?.classList.remove(...z1),1800)};return h(),()=>{o=!0,c&&clearTimeout(c),d&&clearTimeout(d),u!==null&&cancelAnimationFrame(u),p?.classList.remove(...z1),m&&CSS.highlights.get("search-result-text")===m&&CSS.highlights.delete("search-result-text")}},[a,r?.nonce,r?.threadId,r?.messageId,e,t])}const Dy=2,Fde=250;function Ude({query:e,onLanded:t}){const{state:n,dispatch:a}=re(),r=et(),[i,o]=f.useState(null),[c,d]=f.useState(null),u=e.trim();if(f.useEffect(()=>{if(u.length<Dy){o(null),d(null);return}o(null),d(null);let m=!0;const h=setTimeout(()=>{K(`/api/search?q=${encodeURIComponent(u)}&limit=40`).then(x=>m&&(o(x.hits),d(null))).catch(x=>m&&d(x instanceof Error?x.message:String(x)))},Fde);return()=>{m=!1,clearTimeout(h)}},[u]),u.length<Dy)return null;const p=async m=>{try{await T3(m,n,a,r),t()}catch(h){a({type:"error",message:h instanceof Error?h.message:String(h)})}};return s.jsxs("div",{className:"mt-2 border-t border-hairline/40 pt-2",children:[s.jsx("div",{className:"px-3 pb-1 text-[11px] font-medium uppercase tracking-wide text-ink-secondary",children:i?l("search.messagesCount",{count:`${i.length}${i.length===40?"+":""}`}):l("search.messages")}),c&&s.jsx("div",{className:"px-3 py-2 text-[13px] text-danger",children:l("search.failed",{error:c})}),i&&i.length===0&&!c&&s.jsx("div",{className:"px-3 py-3 text-[13px] text-ink-secondary",children:l("search.noMatch",{query:u})}),i?.map(m=>{const h=m.botId?n.bots.find(y=>y.id===m.botId):void 0,x=m.snippet.slice(0,m.matchStart),g=m.snippet.slice(m.matchStart,m.matchStart+m.matchLength),v=m.snippet.slice(m.matchStart+m.matchLength);return s.jsxs("button",{onClick:()=>{p(m)},className:"flex w-full items-start gap-2.5 rounded-lg px-3 py-2 text-left hover:bg-raised/60",children:[h?s.jsx(Je,{bot:h,state:"idle",size:26,animated:!1}):s.jsx("span",{className:"flex size-[26px] shrink-0 items-center justify-center rounded-full bg-raised text-[11px] text-ink-secondary",children:"#"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"flex items-baseline gap-1.5 text-[12px] text-ink-secondary",children:[s.jsx("span",{className:"truncate font-medium text-ink",children:m.from??m.name}),m.task?s.jsxs("span",{className:"truncate",children:["· ",m.task]}):null,s.jsx("span",{className:"ml-auto shrink-0 tabular-nums",children:kr(m.at)})]}),s.jsxs("span",{dir:"auto",className:I("mt-0.5 line-clamp-2 text-[13px] leading-snug",m.role==="user"?"text-ink":"text-ink-secondary"),children:[m.kind==="activity"&&s.jsx(tA,{size:11,className:"mr-1 inline text-ink-secondary"}),x,s.jsx("mark",{className:"rounded-sm bg-accent/25 px-0.5 text-ink",children:g}),v]}),!m.onActivePath&&s.jsxs("span",{className:"mt-0.5 flex items-center gap-1 text-[11px] text-ink-secondary",children:[s.jsx(OV,{size:10})," ",l("search.otherVersion")]})]})]},`${m.threadId}:${m.messageId}`)})]})}function fn(e,t){let n,a;const r=()=>a??=t().then(o=>n=o,o=>{throw a=void 0,console.warn(`[lazy-screens] ${e} could not be loaded; reloading the window fetches it again.`,o),o});function i(o){const[c,d]=f.useState(()=>n),[u,p]=f.useState(!1);return f.useEffect(()=>{if(c)return;let m=!0;return r().then(h=>{m&&d(()=>h)},()=>{m&&p(!0)}),()=>{m=!1}},[c]),c?s.jsx(c,{...o}):u?s.jsx(qde,{}):null}return Object.assign(i,{preload:r})}function qde(){return Ke.createPortal(s.jsxs("div",{role:"alert","data-screen-unavailable":!0,className:"fixed bottom-4 left-1/2 z-[100] flex max-w-[calc(100vw-2rem)] -translate-x-1/2 items-center gap-3 rounded-xl border border-danger/30 bg-card px-3.5 py-2.5 text-[13px] text-danger shadow-xl",children:[s.jsx("span",{children:l("screenLoad.failed")}),s.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"shrink-0 rounded-md px-1.5 py-0.5 font-medium text-accent hover:bg-raised",children:l("screenLoad.reload")})]}),document.body)}const tR=fn("ActivityPanel",async()=>(await Oe(async()=>{const{ActivityPanel:e}=await import("./ActivityPanel-RhVpYfcN.js");return{ActivityPanel:e}},__vite__mapDeps([12,1,2,3,4,13,8,10]))).ActivityPanel),nR=fn("BotSettingsDialog",async()=>(await Oe(async()=>{const{BotSettingsDialog:e}=await import("./BotSettingsDialog-86CEEBqv.js");return{BotSettingsDialog:e}},__vite__mapDeps([14,1,2,3,4,15,8,16,17,18,19,20,7,21,5,6,22,10]))).BotSettingsDialog),sR=fn("ComputerPanel",async()=>(await Oe(async()=>{const{ComputerPanel:e}=await import("./ComputerPanel-DhsVAGkk.js");return{ComputerPanel:e}},__vite__mapDeps([23,1,2,6,24,25,3,4,21,5,7,8,26,27,10,22,28,29,20]))).ComputerPanel),aR=fn("FilesView",async()=>(await Oe(async()=>{const{FilesView:e}=await import("./FilesView-CXs0o7Ng.js");return{FilesView:e}},__vite__mapDeps([30,1,2,3,4,10,8]))).FilesView),rR=fn("InspectorPanel",async()=>(await Oe(async()=>{const{InspectorPanel:e}=await import("./InspectorPanel-HDxbq3Em.js");return{InspectorPanel:e}},__vite__mapDeps([31,1,2,3,4,8,10]))).InspectorPanel),iR=fn("KeyboardShortcutsModal",async()=>(await Oe(async()=>{const{KeyboardShortcutsModal:e}=await import("./KeyboardShortcutsModal-_wmael6o.js");return{KeyboardShortcutsModal:e}},__vite__mapDeps([32,1,2,8,10,3,4]))).KeyboardShortcutsModal),oR=fn("LocalVmWorkspace",async()=>(await Oe(async()=>{const{LocalVmWorkspace:e}=await import("./LocalVmWorkspace-r8vQozIz.js");return{LocalVmWorkspace:e}},__vite__mapDeps([33,1,2,3,4,8,10]))).LocalVmWorkspace),Hde=fn("NewBotDialog",async()=>(await Oe(async()=>{const{NewBotDialog:e}=await import("./NewBotDialog-JY8nCL-F.js").then(t=>t.f);return{NewBotDialog:e}},__vite__mapDeps([34,1,2,0,3,4,10,16,17,18,19,20,7,8,5,6,35,27,22]))).NewBotDialog),lR=fn("PluginsPanel",async()=>(await Oe(async()=>{const{PluginsPanel:e}=await import("./PluginsPanel-2Li8_VD_.js");return{PluginsPanel:e}},__vite__mapDeps([36,1,2,3,4,19,8,7,10]))).PluginsPanel),cR=fn("RemoteAgentSettingsPanel",async()=>(await Oe(async()=>{const{RemoteAgentSettingsPanel:e}=await import("./RemoteAgentSettingsPanel-BXvMgYlC.js");return{RemoteAgentSettingsPanel:e}},__vite__mapDeps([37,1,2,3,4,10,8]))).RemoteAgentSettingsPanel),dR=fn("RoomPanel",async()=>(await Oe(async()=>{const{RoomPanel:e}=await import("./RoomPanel-CAVyXzip.js");return{RoomPanel:e}},__vite__mapDeps([38,1,2,3,4,8,10]))).RoomPanel),uR=fn("RemoteDesktopPanel",async()=>(await Oe(async()=>{const{RemoteDesktopPanel:e}=await import("./remote-desktop-panel-tFLOT6M5.js");return{RemoteDesktopPanel:e}},__vite__mapDeps([39,1,2,6,3,4,26,27,10,22,28,29,5,7,8,40]))).RemoteDesktopPanel),pR=fn("TriggersPage",async()=>(await Oe(async()=>{const{TriggersPage:e}=await import("./TriggersPage-BJzUTKl-.js");return{TriggersPage:e}},__vite__mapDeps([41,1,2,3,4,11,9,6,10,8,5,7]))).TriggersPage),M3=fn("SettingsModal",async()=>(await Oe(async()=>{const{SettingsModal:e}=await import("./SettingsModal-BhKWJU6g.js");return{SettingsModal:e}},__vite__mapDeps([42,1,2,3,4,8,15,25,16,17,18,19,20,7,10,13,34,0,5,6,35,27,22]))).SettingsModal),mR=fn("TeamMapPage",async()=>(await Oe(async()=>{const{TeamMapPage:e}=await import("./TeamMapPage-SRWVTLku.js");return{TeamMapPage:e}},__vite__mapDeps([43,1,2,3,4,8,10]))).TeamMapPage),Wde=fn("CloudAddDialog",async()=>(await Oe(async()=>{const{CloudAddDialog:e}=await import("./CloudAddDialog-Ir0qZH_R.js");return{CloudAddDialog:e}},__vite__mapDeps([44,1,2,3,4,10,8]))).CloudAddDialog);fn("PhoneAppDialog",async()=>(await Oe(async()=>{const{PhoneAppDialog:e}=await import("./PhoneAppDialog-CquVzL0v.js");return{PhoneAppDialog:e}},__vite__mapDeps([45,1,2,3,4,10,8]))).PhoneAppDialog);const Kde=fn("ShareTeamDialog",async()=>(await Oe(async()=>{const{ShareTeamDialog:e}=await import("./ShareTeamDialog-DyFOit3r.js");return{ShareTeamDialog:e}},__vite__mapDeps([46,1,2,3,4,35,10,8]))).ShareTeamDialog),Vde=fn("GrokMoveDialog",async()=>(await Oe(async()=>{const{GrokMoveDialog:e}=await import("./GrokMoveDialog-ByVz0ZLd.js");return{GrokMoveDialog:e}},__vite__mapDeps([47,1,2,3,4,48,18,29,10,8]))).GrokMoveDialog),fR=fn("TeamLibraryPanel",async()=>(await Oe(async()=>{const{TeamLibraryPanel:e}=await import("./TeamLibraryPanel-BSXhXzhC.js");return{TeamLibraryPanel:e}},__vite__mapDeps([49,1,2,3,4,17,18,48,46,35,10,8]))).TeamLibraryPanel),Gde=[M3,nR,lR,sR,pR,tR,aR,rR,iR,oR,Hde,cR,uR,dR,mR];typeof location<"u"&&new URLSearchParams(location.search).has("desktop-settings")&&M3.preload().catch(()=>{});const Yde=new Set(["127.0.0.1","localhost","[::1]"]),Jde=5e3;function Qde(e=location.hostname){if(Yde.has(e))return()=>{};let t=!1,n=()=>{};const a=o=>{if(typeof requestIdleCallback=="function"){const c=requestIdleCallback(o,{timeout:2e3});n=()=>cancelIdleCallback(c)}else{const c=setTimeout(o,1e3);n=()=>clearTimeout(c)}},r=o=>{const c=Gde[o];c&&a(()=>{c.preload().catch(()=>{}).then(()=>{t||r(o+1)})})},i=setTimeout(()=>r(0),Jde);return n=()=>clearTimeout(i),()=>{t=!0,n()}}function $y(e,t){const n=t.trim().toLowerCase();if(!n)return[...e];const a=[],r=[];for(const i of e){const o=i.name.toLowerCase();o.startsWith(n)?a.push(i):o.includes(n)&&r.push(i)}return[...a,...r]}function _3(e){return e.key==="Escape"&&!e.defaultPrevented&&!e.isComposing}function Xde(e,t){if(!e||!t)return!1;const n=e.closest;return typeof n=="function"&&n.call(e,"[data-tour-card]")?!1:!t.contains(e)}function Ir(e,t,n){const a=f.useRef(n);a.current=n,f.useEffect(()=>{if(!e)return;const r=o=>{_3(o)&&(o.preventDefault(),a.current())},i=o=>{Xde(o.target,t.current)&&a.current()};return window.addEventListener("keydown",r),window.addEventListener("pointerdown",i),()=>{window.removeEventListener("keydown",r),window.removeEventListener("pointerdown",i)}},[e,t])}const Zde=320,eue=360,sf=8,tue=56,nue=480;function CS(e,t,n=!1){const a={left:0,width:t,floating:!1};if(!e)return a;const r=n?e.left:t-e.right;if(r<Zde)return a;const i=Math.min(eue,r-2*sf);return{left:n?e.left-sf-i:e.right+sf,width:i,floating:!0}}function ES(e){return Math.max(160,Math.min(nue,e-tue-2*sf))}function sue(e){return e.title?.trim()||e.description?.trim().split(`
114
+ `);return o.length<=fo.fallback?o:`${o.slice(0,fo.fallback-1).trimEnd()}…`}function q_(e){return e?.findLast(t=>!g7(t)&&t.kind!=="screen")}function H_(e,t,n,a){return e.activity==="waiting-on-you"?l("sidebar.preview.waiting"):e.waitingForTeammates?l("sidebar.preview.waitingOnTeammate"):e.busy?l("sidebar.preview.working"):xde(e,t,n,a)}function hde(e){const t=e.kind==="activity"?e.tool:void 0;return!!t&&!e.dataResult&&_a(t.name)===null&&!Bx(t.name)&&!tf.test(t.name)}function W_(e,t,n){if(n||!hde(t))return t;for(let a=e.length-1;a>=0;a--){const r=e[a];if(r.role==="user")break;if(r.kind!=="activity"&&!g7(r)&&r.kind!=="screen")return r}return t}function xde(e,t,n,a){const r=q_(t);if(!r)return"";const i=W_(t,r,a);if(i.kind==="options"&&i.card)return i.helperIntro?l(a?"helperIntro.title":e.chiefOfStaff?"helperIntro.hello":"helperIntro.hi.helper",{name:e.name}):i.card.requestId&&i.card.tool&&!i.card.questionRequest&&w3(i.card)||i.card.title;if(i.kind==="activity"&&i.tool)return C_(i.tool,N3(e,n),i.dataResult,a);if(i.kind==="connector"&&i.connector)return E_(i.connector,l);if(i.kind==="routine.run"&&i.routineRun)return yde(i.routineRun);const o=Ws(i);return o?`${o.name}: ${iu(o.body)}`:i.role!=="user"&&cu(i.text??"")?l("chat.turnStopped"):iu(ap(gde(i)??i.text??""))}function gde(e){if(e.kind!=="widget"||!e.widget?.root||e.serverCard!==!0)return;const t=D_(e.widget,!0);return t===e.widget?void 0:fde(t.root)}const bde={completed:"automations.preview.finished",failed:"automations.preview.failed",waiting:"automations.preview.needsYou",cancelled:"automations.preview.stopped",missed:"automations.preview.missed",running:"automations.preview.running",queued:"automations.preview.running"};function yde(e){return l(bde[e.status],{name:e.routineName})}function kde(e,t,n,a){const r=Gce(e,u=>t.find(p=>p.id===u)?.name);if(r)return r;if(e.working)return l("sidebar.preview.teamWorking");const i=q_(e.messages);if(!i)return l("sidebar.preview.noMessages");const o=W_(e.messages,i,a);if(o.kind==="text"&&o.role!=="user"&&cu(o.text??"")){const u=l("chat.turnStopped");return o.from?`${o.from.name}: ${u}`:u}const c=o.kind==="activity"&&o.tool?C_(o.tool,N3(t.find(u=>u.id===o.from?.botId),n),o.dataResult,a):o.kind==="goal.run"&&o.goalRun?Lce(o.goalRun):o.kind==="connector"&&o.connector?E_(o.connector,l):o.text??"",d=iu(ap(c));return o.role==="user"?l("sidebar.preview.you",{text:d}):o.from?`${o.from.name}: ${d}`:d}const vde={bots:[],departments:[]},wde=e=>e?.pausedByPerson??vde;function K_(e,t,n){const a=wde(e);return t==="bot"?a.bots.includes(n):a.departments.includes(n.trim())}const V_=(e,t)=>e?.heldBots?.includes(t)===!0;async function G_(e,t,n){return K("/api/paused",{method:"POST",body:JSON.stringify({kind:e,id:t,paused:n}),timeoutMs:6e4})}function oa(e){const{open:t,onCancel:n,returnFocusRef:a}=e,r=f.useRef(null),i=f.useRef(null),o=f.useRef(n);return o.current=n,f.useEffect(()=>{if(!t)return;const c=document.activeElement instanceof HTMLElement?document.activeElement:null;i.current?.focus();const d=u=>{if(u.key==="Escape"){u.preventDefault(),o.current();return}if(u.key==="Tab"){const p=r.current?.querySelectorAll("button:not([disabled])");if(!p?.length){u.preventDefault(),r.current?.focus();return}const m=p[0],h=p[p.length-1];u.shiftKey&&document.activeElement===m?(u.preventDefault(),h.focus()):!u.shiftKey&&document.activeElement===h&&(u.preventDefault(),m.focus())}};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d),(c?.isConnected&&c!==document.body?c:a?.current)?.focus()}},[t,a]),f.useEffect(()=>{t&&(e.pending?r.current?.focus():i.current?.focus())},[t,e.pending]),t?Ke.createPortal(s.jsx("div",{className:`fixed inset-0 ${e.layer??"z-50"} flex items-center justify-center bg-black/55 p-6`,onMouseDown:c=>c.stopPropagation(),children:s.jsx(jde,{ref:r,cancelRef:i,...e})}),document.body):null}function jde({ref:e,cancelRef:t,title:n,body:a,confirmLabel:r,cancelLabel:i=l("common.cancel"),tone:o="danger",icon:c,onCancel:d,onConfirm:u,alternative:p,pending:m=!1}){const h=o==="danger";return s.jsxs("div",{ref:e,role:"alertdialog","data-look":"dialog",tabIndex:-1,"aria-modal":"true","aria-busy":m,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-body",className:I("w-full max-w-[420px] rounded-2xl border bg-panel p-5 shadow-2xl",h?"border-danger/30":"border-hairline/50"),children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:I("mt-0.5 shrink-0",h?"text-danger":"text-warning"),children:c??s.jsx(Ds,{size:18})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h2",{id:"confirm-dialog-title",className:"text-[15px] font-semibold text-ink",children:n}),s.jsx("p",{id:"confirm-dialog-body",className:"mt-1.5 text-[13px] leading-relaxed text-ink-secondary",children:a})]})]}),s.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[s.jsx("button",{ref:t,type:"button",onClick:d,disabled:m,className:"rounded-xl px-4 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",children:i}),p&&s.jsx("button",{type:"button","data-confirm-alternative":!0,onClick:p.onClick,disabled:m,className:"rounded-xl bg-accent px-4 py-2 text-[13px] font-medium text-accent-ink hover:brightness-110",children:p.label}),s.jsx("button",{type:"button",onClick:u,disabled:m,className:I("rounded-xl px-4 py-2 text-[13px] font-medium",h?"bg-danger text-white hover:brightness-110":"bg-accent text-accent-ink hover:brightness-110"),children:r})]})]})}const Nde=200,Sde=864e5,To=e=>e.activity!=="working"&&!e.busy;function Ide(e,t){const n=new Set(e);return n.delete(t)||n.add(t),n}function Cde(e,t,n,a,r){const i=new Set(e),o=t.findIndex(p=>p.threadId===a);if(o<0)return i;const c=n===null?-1:t.findIndex(p=>p.threadId===n),[d,u]=c<0?[o,o]:[Math.min(c,o),Math.max(c,o)];for(const p of t.slice(d,u+1))To(p)&&(r?i.add(p.threadId):i.delete(p.threadId));return i}function Ede(e,t,n,a,r){return r&&n!==null?Cde(e,t,n,a,!e.has(a)):Ide(e,a)}const Ade=e=>{if(typeof e.updatedAt=="number"&&Number.isFinite(e.updatedAt)&&e.updatedAt>0)return e.updatedAt;if(typeof e.createdAt=="number"&&Number.isFinite(e.createdAt)&&e.createdAt>0)return e.createdAt};function Tde(e,t,n){const a=n-t*Sde;return e.filter(r=>{const i=Ade(r);return i!==void 0&&i<a&&r.pinned!==!0&&To(r)}).map(r=>r.threadId)}const Mde=e=>e.filter(t=>t.archivedAt!==void 0&&t.pinned!==!0&&To(t)).map(t=>t.threadId),_de=e=>new Set(e.filter(To).map(t=>t.threadId)),Y_=()=>new Set;function Rde(e,t=Nde){const n=[];for(let a=0;a<e.length;a+=t)n.push(e.slice(a,a+t));return n}function Ode(e){const t={deleted:0,busy:0,missing:0};for(const n of e){t.deleted+=n.deleted.length;for(const a of n.refused)a.reason==="busy"?t.busy++:t.missing++}return t}const Lde=(e,t,n)=>!n&&(e==="ContextMenu"||t&&e==="F10");async function E3(e,t,n){const a="botId"in e?`/api/bots/${e.botId}/tasks/delete`:`/api/groups/${e.groupId}/tasks/delete`,r=[];try{for(const i of Rde(t)){const o=await K(a,{method:"POST",body:JSON.stringify({threadIds:i})});r.push(o),o.bot&&n({type:"botPatched",bot:o.bot}),o.group&&n({type:"groupPatched",group:o.group})}return{responses:r}}catch(i){const o=i instanceof Error?i.message:String(i);return n({type:"error",message:o}),{responses:r,error:o}}}function J_(e,t,n){const a=e.filter(i=>t.has(i.threadId)&&i.pinned===!0).length,r=e.length>0&&e.every(i=>t.has(i.threadId));return[l("task.bulk.confirmBody"),a>0?l("task.bulk.pinnedNote",{count:a}):null,n&&r?l("task.bulk.freshNote"):null].filter(Boolean).join(" ")}function Q_(e){const t=Ode(e.responses);return[l("task.bulk.result",{count:t.deleted}),t.busy>0?l("task.bulk.resultBusy",{count:t.busy}):null,t.missing>0?l("task.bulk.resultMissing",{count:t.missing}):null,e.error?l("task.bulk.resultError",{message:e.error}):null].filter(Boolean).join(" ")}const IS=30,em="rounded-full border border-hairline/50 px-2.5 py-0.5 text-[11px] text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-40";function X_(){const[e,t]=f.useState(!1),[n,a]=f.useState(new Set),r=f.useRef(null),i=f.useRef([]),o=f.useCallback((p,m)=>{const h=r.current;r.current=p.threadId,a(x=>Ede(x,i.current,h,p.threadId,m))},[]),c=f.useCallback(()=>t(!0),[]),d=f.useCallback(()=>{t(!1),a(new Set),r.current=null},[]);return{active:e,start:c,finish:d,forRows:p=>(i.current=p,new Set(p.filter(m=>n.has(m.threadId)&&To(m)).map(m=>m.threadId))),setSelected:a,toggle:o}}function Z_({rows:e,selected:t,now:n,onChange:a,onDone:r}){const i=o=>a(new Set([...t,...o]));return s.jsxs("div",{className:"flex flex-wrap items-center gap-1 px-2 pb-1.5 pt-1",role:"group","aria-label":l("task.bulk.select"),children:[s.jsx("button",{type:"button",className:em,onClick:()=>a(_de(e)),children:l("task.bulk.selectAll")}),s.jsx("button",{type:"button",className:em,onClick:()=>i(Tde(e,IS,n)),children:l("task.bulk.older",{days:IS})}),s.jsx("button",{type:"button",className:em,onClick:()=>i(Mde(e)),children:l("task.bulk.archived")}),s.jsx("button",{type:"button",className:em,disabled:t.size===0,onClick:()=>a(Y_()),children:l("task.bulk.clear")}),s.jsx("button",{type:"button",onClick:r,className:"ml-auto rounded px-1.5 py-0.5 text-[11px] font-medium text-accent hover:underline",children:l("task.bulk.done")})]})}function zde({rows:e,selected:t,maxDeletable:n,freshConversation:a,onChange:r,onDelete:i}){const[o,c]=f.useState(!1),[d,u]=f.useState(!1),[p,m]=f.useState(null),h=t.size,x=n!==void 0&&h>n,g=J_(e,t,a),v=()=>{const y=[...t];u(!0),m(null),i(y).then(w=>{const b=new Set(w.responses.flatMap(k=>k.deleted));r(k=>new Set([...k].filter(j=>!b.has(j)))),m(Q_(w)),u(!1),c(!1)})};return s.jsxs("div",{className:"sticky bottom-0 z-10 -mx-1 border-t border-hairline/40 bg-panel px-2 py-1.5",children:[s.jsx("span",{role:"status",className:"block text-[11px] text-ink-secondary",children:p??(x?l("task.bulk.channelLimit"):"")}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-[12px] font-medium text-ink",children:l("task.bulk.selected",{count:h})}),s.jsx("button",{type:"button",disabled:h===0||d,onClick:()=>r(Y_()),className:"rounded-md px-2.5 py-1 text-[12px] text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-40",children:l("task.bulk.cancel")}),s.jsx("button",{type:"button",disabled:h===0||x||d,"aria-busy":d||void 0,onClick:()=>c(!0),className:"rounded-md bg-danger px-2.5 py-1 text-[12px] font-medium text-white hover:brightness-110 disabled:opacity-40",children:d?l("task.bulk.deleting"):l("task.bulk.delete",{count:h})})]}),s.jsx(oa,{open:o,title:l("task.bulk.confirmTitle",{count:h}),body:g,confirmLabel:l("task.bulk.delete",{count:h}),pending:d,onCancel:()=>{d||c(!1)},onConfirm:v})]})}function eR({bulk:e,rows:t,selected:n,total:a,canShowAll:r,canSelect:i,onShowAll:o,maxDeletable:c,freshConversation:d,onDelete:u}){if(e.active)return s.jsx(zde,{rows:t,selected:n,maxDeletable:c,freshConversation:d,onChange:e.setSelected,onDelete:u});if(!r&&!i)return null;const p="inline-flex h-7 items-center text-[13px] font-medium leading-4 text-ink-secondary hover:text-ink";return s.jsxs("div",{className:"flex items-center justify-between pl-6 pr-2",children:[r?s.jsx("button",{type:"button",onClick:o,className:p,children:l("task.showAll",{count:a})}):s.jsx("span",{}),i&&s.jsx("button",{type:"button",onClick:e.start,className:p,children:l("task.bulk.select")})]})}function Pde({members:e,density:t,large:n=!1}){const a=t==="icons",r=a?"size-12":n?"size-9":"size-8",i=a?44:n?36:32;if(e.length<=1){const d=e[0];return s.jsx("div",{className:I("flex shrink-0 items-center justify-center",r),children:d?s.jsx(Je,{bot:d,state:"happy",size:i,animated:!1}):s.jsx(_n,{size:24,className:"text-ink-secondary"})})}const o=e.slice(0,2),c=e.length-o.length;return s.jsx("div",{className:I("flex shrink-0 items-center justify-center",r),children:s.jsxs("div",{className:"flex items-center -space-x-2.5",children:[o.map(d=>s.jsx(Je,{bot:d,state:"happy",size:a?30:n?26:20,animated:!1},d.id)),c>0&&s.jsxs("span",{className:"z-10 flex size-4 items-center justify-center rounded-full border border-hairline/40 bg-raised text-[9px] font-medium text-ink-secondary",children:["+",c]})]})})}function A3({open:e,onCancel:t,onConfirm:n}){const a=f.useRef(null);return f.useEffect(()=>{if(!e)return;a.current?.focus();const r=i=>{i.key==="Escape"&&(i.preventDefault(),t())};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,t]),e?s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-6",onMouseDown:r=>r.stopPropagation(),children:s.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"local-auto-warning-title","aria-describedby":"local-auto-warning-body",className:"w-full max-w-[420px] rounded-2xl border border-hairline/50 bg-panel p-5 shadow-2xl",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Ds,{size:18,className:"mt-0.5 shrink-0 text-warning"}),s.jsxs("div",{children:[s.jsx("h2",{id:"local-auto-warning-title",className:"text-[15px] font-semibold text-ink",children:l("permissions.localAuto.title")}),s.jsx("p",{id:"local-auto-warning-body",className:"mt-1.5 text-[13px] leading-relaxed text-ink-secondary",children:l("permissions.localAuto.body")})]})]}),s.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[s.jsx("button",{type:"button",onClick:t,className:"rounded-xl px-4 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",children:l("common.cancel")}),s.jsx("button",{ref:a,type:"button",onClick:n,className:"rounded-xl bg-accent px-4 py-2 text-[13px] font-medium text-white hover:brightness-110",children:l("common.ok")})]})]})}):null}function dp(e,t){const n=t.trim();return!n||n===e?null:n}const z1=["ring-2","ring-accent/70","rounded-2xl","transition-shadow"];async function Dde(e,t,n,a){if(!e.hasMore||e.messages.some(d=>d.id===t))return;const r=[];let i=e.messages[0]?.id,o=!0,c=!1;for(;i&&o&&!c;){const d=await K(`/api/threads/${e.threadId}/messages?limit=${dd}&before=${encodeURIComponent(i)}`),u=d.messages??[];r.unshift(...u),c=u.some(p=>p.id===t),o=!!d.hasMore&&u.length>0,i=u[0]?.id}r.length&&a({type:"olderMessages",threadId:e.threadId,generation:n,messages:r,hasMore:o})}async function T3(e,t,n,a){const r=e.botId??e.groupId,i=e.botId?t.bots.find(u=>u.id===e.botId):void 0,o=e.groupId?t.groups.find(u=>u.id===e.groupId):void 0;if(!r||!i&&!o)throw new Error(l("chat.conversationGone"));const c=i&&i.threadId!==e.threadId&&!a?i:void 0;if(c||n({type:"select",id:r}),i&&i.threadId!==e.threadId&&!c){const u=await K(`/api/bots/${i.id}/tasks/${e.threadId}`,{method:"POST"});u?.bot&&n({type:"taskSwitched",bot:u.bot})}if(o&&o.threadId!==e.threadId){const u=await K(`/api/groups/${o.id}/tasks/${e.threadId}`,{method:"POST"});u?.group&&n({type:"groupPatched",group:u.group})}const d=i?.threadId===e.threadId?i:o?.threadId===e.threadId?o:void 0;if(d&&await Dde(d,e.messageId,t.transcriptGeneration[e.threadId]??0,n),i&&!e.onActivePath){const u=await K(`/api/bots/${i.id}/active-branch`,{method:"POST",body:JSON.stringify({messageId:e.messageId,threadId:e.threadId})});u?.activeLeafId&&n({type:"threadActive",threadId:e.threadId,activeLeafId:u.activeLeafId})}c&&n({type:"switchTask",botId:c.id,threadId:e.threadId,whole:!0}),n({type:"focusMessage",threadId:e.threadId,messageId:e.messageId,matchText:e.snippet.slice(e.matchStart,e.matchStart+e.matchLength)})}function $de(e,t){const n=t.trim();if(!n)return null;const a=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let i="";for(;r.nextNode();){const p=r.currentNode;a.push(p),i+=p.data}const o=n.split(/\s+/).map(p=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("\\s+"),c=new RegExp(o,"iu").exec(i);if(!c)return null;const d=document.createRange();let u=0;for(const p of a){const m=u+p.length;if(c.index>=u&&c.index<m&&d.setStart(p,c.index-u),c.index+c[0].length<=m)return d.setEnd(p,c.index+c[0].length-u),d;u=m}return null}function Bde(e,t){const{state:n,dispatch:a}=re(),r=n.focusMessage;f.useEffect(()=>{if(!r||r.consumed||r.threadId!==e||!t)return;let i=0,o=!1,c=null,d=null,u=null,p=null,m=null;const h=()=>{if(o)return;const g=document.querySelector(`[data-mid="${CSS.escape(r.messageId)}"]`)?.lastElementChild;if(p=r.matchText?g?.querySelector("[data-chat-bubble]")??g:g,!p){i++<20&&(c=setTimeout(h,100));return}const v=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;p.scrollIntoView({block:"center",behavior:v?"auto":"smooth"}),p.classList.add(...z1);const y=p.querySelectorAll(".chat-md, .chat-text"),w=[];for(let k=0;k<y.length;k++){const j=y.item(k);j&&!j.closest?.("[data-reply-quote]")&&w.push(j)}let b=null;for(const k of w.length?w:[p])if(b=$de(k,r.matchText??""))break;b&&CSS.highlights&&(m=new Highlight(b),CSS.highlights.set("search-result-text",m),u=requestAnimationFrame(()=>{const k=p?.closest(".overflow-y-auto");if(!k)return;const j=b.getBoundingClientRect(),N=k.getBoundingClientRect();k.scrollTop+=j.top+j.height/2-N.top-N.height/2})),a({type:"focusMessageConsumed",nonce:r.nonce}),d=setTimeout(()=>p?.classList.remove(...z1),1800)};return h(),()=>{o=!0,c&&clearTimeout(c),d&&clearTimeout(d),u!==null&&cancelAnimationFrame(u),p?.classList.remove(...z1),m&&CSS.highlights.get("search-result-text")===m&&CSS.highlights.delete("search-result-text")}},[a,r?.nonce,r?.threadId,r?.messageId,e,t])}const Dy=2,Fde=250;function Ude({query:e,onLanded:t}){const{state:n,dispatch:a}=re(),r=et(),[i,o]=f.useState(null),[c,d]=f.useState(null),u=e.trim();if(f.useEffect(()=>{if(u.length<Dy){o(null),d(null);return}o(null),d(null);let m=!0;const h=setTimeout(()=>{K(`/api/search?q=${encodeURIComponent(u)}&limit=40`).then(x=>m&&(o(x.hits),d(null))).catch(x=>m&&d(x instanceof Error?x.message:String(x)))},Fde);return()=>{m=!1,clearTimeout(h)}},[u]),u.length<Dy)return null;const p=async m=>{try{await T3(m,n,a,r),t()}catch(h){a({type:"error",message:h instanceof Error?h.message:String(h)})}};return s.jsxs("div",{className:"mt-2 border-t border-hairline/40 pt-2",children:[s.jsx("div",{className:"px-3 pb-1 text-[11px] font-medium uppercase tracking-wide text-ink-secondary",children:i?l("search.messagesCount",{count:`${i.length}${i.length===40?"+":""}`}):l("search.messages")}),c&&s.jsx("div",{className:"px-3 py-2 text-[13px] text-danger",children:l("search.failed",{error:c})}),i&&i.length===0&&!c&&s.jsx("div",{className:"px-3 py-3 text-[13px] text-ink-secondary",children:l("search.noMatch",{query:u})}),i?.map(m=>{const h=m.botId?n.bots.find(y=>y.id===m.botId):void 0,x=m.snippet.slice(0,m.matchStart),g=m.snippet.slice(m.matchStart,m.matchStart+m.matchLength),v=m.snippet.slice(m.matchStart+m.matchLength);return s.jsxs("button",{onClick:()=>{p(m)},className:"flex w-full items-start gap-2.5 rounded-lg px-3 py-2 text-left hover:bg-raised/60",children:[h?s.jsx(Je,{bot:h,state:"idle",size:26,animated:!1}):s.jsx("span",{className:"flex size-[26px] shrink-0 items-center justify-center rounded-full bg-raised text-[11px] text-ink-secondary",children:"#"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsxs("span",{className:"flex items-baseline gap-1.5 text-[12px] text-ink-secondary",children:[s.jsx("span",{className:"truncate font-medium text-ink",children:m.from??m.name}),m.task?s.jsxs("span",{className:"truncate",children:["· ",m.task]}):null,s.jsx("span",{className:"ml-auto shrink-0 tabular-nums",children:kr(m.at)})]}),s.jsxs("span",{dir:"auto",className:I("mt-0.5 line-clamp-2 text-[13px] leading-snug",m.role==="user"?"text-ink":"text-ink-secondary"),children:[m.kind==="activity"&&s.jsx(tA,{size:11,className:"mr-1 inline text-ink-secondary"}),x,s.jsx("mark",{className:"rounded-sm bg-accent/25 px-0.5 text-ink",children:g}),v]}),!m.onActivePath&&s.jsxs("span",{className:"mt-0.5 flex items-center gap-1 text-[11px] text-ink-secondary",children:[s.jsx(OV,{size:10})," ",l("search.otherVersion")]})]})]},`${m.threadId}:${m.messageId}`)})]})}function fn(e,t){let n,a;const r=()=>a??=t().then(o=>n=o,o=>{throw a=void 0,console.warn(`[lazy-screens] ${e} could not be loaded; reloading the window fetches it again.`,o),o});function i(o){const[c,d]=f.useState(()=>n),[u,p]=f.useState(!1);return f.useEffect(()=>{if(c)return;let m=!0;return r().then(h=>{m&&d(()=>h)},()=>{m&&p(!0)}),()=>{m=!1}},[c]),c?s.jsx(c,{...o}):u?s.jsx(qde,{}):null}return Object.assign(i,{preload:r})}function qde(){return Ke.createPortal(s.jsxs("div",{role:"alert","data-screen-unavailable":!0,className:"fixed bottom-4 left-1/2 z-[100] flex max-w-[calc(100vw-2rem)] -translate-x-1/2 items-center gap-3 rounded-xl border border-danger/30 bg-card px-3.5 py-2.5 text-[13px] text-danger shadow-xl",children:[s.jsx("span",{children:l("screenLoad.failed")}),s.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"shrink-0 rounded-md px-1.5 py-0.5 font-medium text-accent hover:bg-raised",children:l("screenLoad.reload")})]}),document.body)}const tR=fn("ActivityPanel",async()=>(await Oe(async()=>{const{ActivityPanel:e}=await import("./ActivityPanel-CHgF8dMH.js");return{ActivityPanel:e}},__vite__mapDeps([12,1,2,3,4,13,8,10]))).ActivityPanel),nR=fn("BotSettingsDialog",async()=>(await Oe(async()=>{const{BotSettingsDialog:e}=await import("./BotSettingsDialog-CGS5fK_9.js");return{BotSettingsDialog:e}},__vite__mapDeps([14,1,2,3,4,15,8,16,17,18,19,20,7,21,5,6,22,10]))).BotSettingsDialog),sR=fn("ComputerPanel",async()=>(await Oe(async()=>{const{ComputerPanel:e}=await import("./ComputerPanel-DJL5tdFb.js");return{ComputerPanel:e}},__vite__mapDeps([23,1,2,6,24,25,3,4,21,5,7,8,26,27,10,22,28,29,20]))).ComputerPanel),aR=fn("FilesView",async()=>(await Oe(async()=>{const{FilesView:e}=await import("./FilesView-U5tsQcOZ.js");return{FilesView:e}},__vite__mapDeps([30,1,2,3,4,10,8]))).FilesView),rR=fn("InspectorPanel",async()=>(await Oe(async()=>{const{InspectorPanel:e}=await import("./InspectorPanel-CPNfTOnl.js");return{InspectorPanel:e}},__vite__mapDeps([31,1,2,3,4,8,10]))).InspectorPanel),iR=fn("KeyboardShortcutsModal",async()=>(await Oe(async()=>{const{KeyboardShortcutsModal:e}=await import("./KeyboardShortcutsModal-C6T94kvb.js");return{KeyboardShortcutsModal:e}},__vite__mapDeps([32,1,2,8,10,3,4]))).KeyboardShortcutsModal),oR=fn("LocalVmWorkspace",async()=>(await Oe(async()=>{const{LocalVmWorkspace:e}=await import("./LocalVmWorkspace-B6o5MOvN.js");return{LocalVmWorkspace:e}},__vite__mapDeps([33,1,2,3,4,8,10]))).LocalVmWorkspace),Hde=fn("NewBotDialog",async()=>(await Oe(async()=>{const{NewBotDialog:e}=await import("./NewBotDialog-BTph9RYf.js").then(t=>t.f);return{NewBotDialog:e}},__vite__mapDeps([34,1,2,0,3,4,10,16,17,18,19,20,7,8,5,6,35,27,22]))).NewBotDialog),lR=fn("PluginsPanel",async()=>(await Oe(async()=>{const{PluginsPanel:e}=await import("./PluginsPanel-DMi-9axs.js");return{PluginsPanel:e}},__vite__mapDeps([36,1,2,3,4,19,8,7,10]))).PluginsPanel),cR=fn("RemoteAgentSettingsPanel",async()=>(await Oe(async()=>{const{RemoteAgentSettingsPanel:e}=await import("./RemoteAgentSettingsPanel-6oChwaFz.js");return{RemoteAgentSettingsPanel:e}},__vite__mapDeps([37,1,2,3,4,10,8]))).RemoteAgentSettingsPanel),dR=fn("RoomPanel",async()=>(await Oe(async()=>{const{RoomPanel:e}=await import("./RoomPanel-ev3QDMbj.js");return{RoomPanel:e}},__vite__mapDeps([38,1,2,3,4,8,10]))).RoomPanel),uR=fn("RemoteDesktopPanel",async()=>(await Oe(async()=>{const{RemoteDesktopPanel:e}=await import("./remote-desktop-panel-DS1Luju9.js");return{RemoteDesktopPanel:e}},__vite__mapDeps([39,1,2,6,3,4,26,27,10,22,28,29,5,7,8,40]))).RemoteDesktopPanel),pR=fn("TriggersPage",async()=>(await Oe(async()=>{const{TriggersPage:e}=await import("./TriggersPage-CNvHKFLb.js");return{TriggersPage:e}},__vite__mapDeps([41,1,2,3,4,11,9,6,10,8,5,7]))).TriggersPage),M3=fn("SettingsModal",async()=>(await Oe(async()=>{const{SettingsModal:e}=await import("./SettingsModal-Cr8M0zhX.js");return{SettingsModal:e}},__vite__mapDeps([42,1,2,3,4,8,15,25,16,17,18,19,20,7,10,13,34,0,5,6,35,27,22]))).SettingsModal),mR=fn("TeamMapPage",async()=>(await Oe(async()=>{const{TeamMapPage:e}=await import("./TeamMapPage-BeSNpxHw.js");return{TeamMapPage:e}},__vite__mapDeps([43,1,2,3,4,8,10]))).TeamMapPage),Wde=fn("CloudAddDialog",async()=>(await Oe(async()=>{const{CloudAddDialog:e}=await import("./CloudAddDialog-CAxNEsaw.js");return{CloudAddDialog:e}},__vite__mapDeps([44,1,2,3,4,10,8]))).CloudAddDialog);fn("PhoneAppDialog",async()=>(await Oe(async()=>{const{PhoneAppDialog:e}=await import("./PhoneAppDialog-DPAINJ4i.js");return{PhoneAppDialog:e}},__vite__mapDeps([45,1,2,3,4,10,8]))).PhoneAppDialog);const Kde=fn("ShareTeamDialog",async()=>(await Oe(async()=>{const{ShareTeamDialog:e}=await import("./ShareTeamDialog-BQC22hfP.js");return{ShareTeamDialog:e}},__vite__mapDeps([46,1,2,3,4,35,10,8]))).ShareTeamDialog),Vde=fn("GrokMoveDialog",async()=>(await Oe(async()=>{const{GrokMoveDialog:e}=await import("./GrokMoveDialog-Dyqzn1Bq.js");return{GrokMoveDialog:e}},__vite__mapDeps([47,1,2,3,4,48,18,29,10,8]))).GrokMoveDialog),fR=fn("TeamLibraryPanel",async()=>(await Oe(async()=>{const{TeamLibraryPanel:e}=await import("./TeamLibraryPanel-Bk4PbyP7.js");return{TeamLibraryPanel:e}},__vite__mapDeps([49,1,2,3,4,17,18,48,46,35,10,8]))).TeamLibraryPanel),Gde=[M3,nR,lR,sR,pR,tR,aR,rR,iR,oR,Hde,cR,uR,dR,mR];typeof location<"u"&&new URLSearchParams(location.search).has("desktop-settings")&&M3.preload().catch(()=>{});const Yde=new Set(["127.0.0.1","localhost","[::1]"]),Jde=5e3;function Qde(e=location.hostname){if(Yde.has(e))return()=>{};let t=!1,n=()=>{};const a=o=>{if(typeof requestIdleCallback=="function"){const c=requestIdleCallback(o,{timeout:2e3});n=()=>cancelIdleCallback(c)}else{const c=setTimeout(o,1e3);n=()=>clearTimeout(c)}},r=o=>{const c=Gde[o];c&&a(()=>{c.preload().catch(()=>{}).then(()=>{t||r(o+1)})})},i=setTimeout(()=>r(0),Jde);return n=()=>clearTimeout(i),()=>{t=!0,n()}}function $y(e,t){const n=t.trim().toLowerCase();if(!n)return[...e];const a=[],r=[];for(const i of e){const o=i.name.toLowerCase();o.startsWith(n)?a.push(i):o.includes(n)&&r.push(i)}return[...a,...r]}function _3(e){return e.key==="Escape"&&!e.defaultPrevented&&!e.isComposing}function Xde(e,t){if(!e||!t)return!1;const n=e.closest;return typeof n=="function"&&n.call(e,"[data-tour-card]")?!1:!t.contains(e)}function Ir(e,t,n){const a=f.useRef(n);a.current=n,f.useEffect(()=>{if(!e)return;const r=o=>{_3(o)&&(o.preventDefault(),a.current())},i=o=>{Xde(o.target,t.current)&&a.current()};return window.addEventListener("keydown",r),window.addEventListener("pointerdown",i),()=>{window.removeEventListener("keydown",r),window.removeEventListener("pointerdown",i)}},[e,t])}const Zde=320,eue=360,sf=8,tue=56,nue=480;function CS(e,t,n=!1){const a={left:0,width:t,floating:!1};if(!e)return a;const r=n?e.left:t-e.right;if(r<Zde)return a;const i=Math.min(eue,r-2*sf);return{left:n?e.left-sf-i:e.right+sf,width:i,floating:!0}}function ES(e){return Math.max(160,Math.min(nue,e-tue-2*sf))}function sue(e){return e.title?.trim()||e.description?.trim().split(`
115
115
  `)[0]?.trim()||""}function aue({anchor:e,onClose:t,onNewBot:n,onNewGroup:a,style:r}){const{state:i,dispatch:o}=re(),c=et(),[d,u]=f.useState(""),[p,m]=f.useState(n?2:1),[h,x]=f.useState(()=>CS(null,typeof window>"u"?0:window.innerWidth)),[g,v]=f.useState(()=>ES(typeof window>"u"?0:window.innerHeight)),y=f.useRef(null),w=f.useRef(null);Ir(!0,y,t),f.useLayoutEffect(()=>{const O=()=>x(CS(e?e.getBoundingClientRect():null,window.innerWidth,e?getComputedStyle(e).direction==="rtl":!1)),L=()=>{O(),v(ES(window.innerHeight))};L(),window.addEventListener("resize",L);const D=e&&typeof ResizeObserver<"u"?new ResizeObserver(O):null;return e&&D?.observe(e),()=>{window.removeEventListener("resize",L),D?.disconnect()}},[e]),f.useLayoutEffect(()=>{w.current?.scrollIntoView({block:"nearest"})},[p]);const b=$y(i.bots.filter(O=>!O.hidden),d),k=[...n?[{key:"bot",icon:s.jsx(Mn,{size:16}),label:l("sidebar.newChat.createBot"),run:n}]:[],{key:"group",icon:s.jsx(_n,{size:16}),label:l("sidebar.newChat.createGroup"),run:a}],j=k.length+b.length,N=p<k.length?p:b.length?Math.min(p,j-1):-1,A=c?l("sidebar.newChat.start"):l("sidebar.newChat.open"),T=O=>{c?o({type:"newTask",botId:O.id}):$t(o,O,!1),t()},M=O=>{if(O<k.length)k[O]?.run();else{const L=b[O-k.length];L&&T(L)}},S=O=>{O.nativeEvent.isComposing||(O.key==="ArrowDown"?(O.preventDefault(),m(N<0?0:(N+1)%j)):O.key==="ArrowUp"?(O.preventDefault(),m(N<0?k.length-1:(N-1+j)%j)):O.key==="Enter"&&O.target instanceof HTMLInputElement&&(O.preventDefault(),N>=0&&M(N)))},C=O=>I("flex h-12 w-full items-center gap-3 rounded-2xl px-3 text-start text-[14px] text-ink outline-none focus-visible:bg-raised-hover",O===N&&"bg-raised-hover");return s.jsxs("div",{ref:y,role:"dialog","aria-modal":"false","aria-label":l("sidebar.newChat.title"),"data-new-chat-panel":"","data-native-view-overlay":"","data-floating":h.floating?"":void 0,onKeyDown:S,style:{...r,left:h.left,width:h.width},className:I("fixed top-0 z-40 flex animate-panel-in flex-col",!h.floating&&"bottom-0 border-e border-hairline/40 bg-app shadow-2xl shadow-black/40"),children:[s.jsxs("div",{className:I("flex h-12 shrink-0 items-center gap-2 px-4",h.floating&&"rounded-b-2xl bg-app"),children:[s.jsx("label",{htmlFor:"new-chat-to",className:"shrink-0 text-[14px] text-ink-secondary",children:l("sidebar.newChat.to")}),s.jsx("input",{id:"new-chat-to",autoFocus:!0,dir:"auto",value:d,onChange:O=>{u(O.target.value),m(k.length)},placeholder:l("sidebar.newChat.placeholder"),"aria-label":l("sidebar.newChat.placeholder"),"aria-controls":"new-chat-bots",autoComplete:"off",spellCheck:!1,className:"h-7 min-w-0 flex-1 bg-transparent text-[14px] text-ink placeholder:text-ink-secondary focus:outline-none"}),s.jsx("button",{type:"button",onClick:t,"aria-label":l("common.close"),title:l("common.close"),className:"-me-2 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-secondary outline-none hover:bg-raised hover:text-ink focus-visible:bg-raised",children:s.jsx(Ae,{size:16})})]}),s.jsxs("div",{id:"new-chat-bots",role:"list",style:{maxHeight:g},className:"mx-3 mt-2 min-h-0 overflow-y-auto rounded-2xl border border-hairline/60 bg-composer p-1.5 shadow-xl shadow-black/25 [scrollbar-width:thin]",children:[k.map((O,L)=>s.jsx("div",{role:"listitem",children:s.jsxs("button",{type:"button",ref:L===N?w:void 0,onClick:O.run,onMouseMove:()=>m(L),className:C(L),children:[s.jsx("span",{"aria-hidden":"true",className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-raised-hover text-ink-secondary",children:O.icon}),s.jsx("span",{className:"truncate",children:O.label})]})},O.key)),i.bots.every(O=>O.hidden)?s.jsx("div",{className:"px-3 py-4 text-center text-[13px] text-ink-secondary",children:l("sidebar.newChannel.emptyHint")}):b.length===0?s.jsx("div",{className:"px-3 py-4 text-center text-[13px] text-ink-secondary",children:l("sidebar.newChat.noMatch",{query:d.trim()})}):b.map((O,L)=>{const D=k.length+L,z=sue(O);return s.jsx("div",{role:"listitem",children:s.jsxs("button",{type:"button",ref:D===N?w:void 0,onClick:()=>T(O),onMouseMove:()=>m(D),"aria-label":`${O.name}${z?`, ${z}`:""}. ${A}`,title:z||void 0,className:C(D),children:[s.jsx(Je,{bot:O,state:"happy",size:32,animated:!1}),s.jsx("span",{dir:"auto",className:"min-w-0 flex-1 truncate",children:O.name})]})},O.id)})]})]})}const By="omb:open-command-palette";function AS(){window.dispatchEvent(new Event(By))}function rue({onOpenChange:e}){const{state:t,dispatch:n}=re(),a=et(),[r,i]=f.useState(!1),[o,c]=f.useState(""),[d,u]=f.useState([]),[p,m]=f.useState(0),h=f.useRef(null);f.useEffect(()=>{const T=S=>{(S.metaKey||S.ctrlKey)&&S.key.toLowerCase()==="k"&&!S.shiftKey&&!S.altKey&&(S.preventDefault(),i(C=>!C))},M=()=>i(!0);return window.addEventListener("keydown",T),window.addEventListener(By,M),()=>{window.removeEventListener("keydown",T),window.removeEventListener(By,M)}},[]),f.useEffect(()=>{r&&(c(""),u([]),m(0))},[r]),f.useEffect(()=>{e?.(r)},[e,r]);const x=o.trim().toLowerCase();if(f.useEffect(()=>{if(!r||!x){u([]);return}u([]);let T=!0;const M=setTimeout(()=>{K(`/api/search?q=${encodeURIComponent(x)}&limit=12`).then(S=>T&&u(S.hits??[])).catch(()=>T&&u([]))},150);return()=>{T=!1,clearTimeout(M)}},[r,x]),f.useEffect(()=>m(0),[x]),f.useEffect(()=>{h.current?.scrollIntoView({block:"nearest"})},[p,d]),!r)return null;const g=$y(t.bots.filter(T=>!T.hidden),x),v=$y(t.groups,x),y=[...g.map(T=>({kind:"bot",bot:T})),...v.map(T=>({kind:"room",group:T})),...x?d.map(T=>({kind:"message",hit:T})):[]],w=y.length?Math.min(p,y.length-1):0,b=async T=>{if(T.kind==="message"){const M=T.hit;try{await T3(M,t,n,a)}catch(S){n({type:"error",message:S instanceof Error?S.message:String(S)})}}else T.kind==="bot"?$t(n,T.bot,a):n({type:"select",id:T.group.id});i(!1)},k=T=>{if(qs(T.nativeEvent)){T.stopPropagation();return}if(T.key==="Escape")T.preventDefault(),T.stopPropagation(),i(!1);else if(T.key==="ArrowDown")T.preventDefault(),m(y.length?(w+1)%y.length:0);else if(T.key==="ArrowUp")T.preventDefault(),m(y.length?(w-1+y.length)%y.length:0);else if(T.key==="Enter"){T.preventDefault();const M=y[w];M&&b(M)}},j=g.length,N=g.length+v.length,A=(T,M,S,C,O=!1)=>s.jsx("button",{ref:M===w?h:void 0,onClick:S,onMouseMove:()=>m(M),className:I("flex min-h-10 w-full items-center gap-3 rounded-lg px-3 py-2 text-left",O&&"flex-col items-stretch gap-0.5",M===w?"bg-menu-active":"hover:bg-menu-hover"),children:C},T);return s.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-6 pt-[14vh] [:root[data-skin=daylight]_&]:bg-black/[0.18]",onMouseDown:T=>T.stopPropagation(),onKeyDown:k,children:s.jsxs("div",{role:"dialog","data-look":"dialog","aria-modal":"true","aria-label":l("palette.label"),className:"popover-surface flex max-h-[min(480px,70vh)] w-full max-w-[560px] flex-col overflow-hidden rounded-[var(--radius-menu)] border border-hairline/50 bg-menu shadow-2xl shadow-black/60",children:[s.jsxs("div",{className:"flex items-center gap-3 border-b border-hairline/40 px-4 py-3",children:[s.jsx(An,{size:16,className:"shrink-0 text-ink-secondary"}),s.jsx("input",{autoFocus:!0,value:o,onChange:T=>c(T.target.value),"aria-label":l("commandPalette.searchLabel"),placeholder:l("commandPalette.searchPlaceholder"),className:"w-full bg-transparent text-[14px] text-ink placeholder:text-ink-secondary focus:outline-none"}),s.jsx("kbd",{className:"shrink-0 rounded-md border border-hairline/40 px-1.5 py-0.5 text-[11px] text-ink-secondary",children:"esc"})]}),s.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:[y.length===0&&s.jsx("div",{className:"px-3 py-6 text-center text-[13px] text-ink-secondary",children:x?l("sidebar.noMatch",{query:o}):l("palette.empty")}),g.length>0&&s.jsx("div",{className:"px-3 pb-1 pt-1.5 text-[12px] font-medium text-ink-tertiary",children:l("palette.bots")}),g.map((T,M)=>A(`bot:${T.id}`,M,()=>{b({kind:"bot",bot:T})},s.jsxs(s.Fragment,{children:[s.jsx(Je,{bot:T,state:"happy",size:22,animated:!1}),s.jsx("span",{className:"truncate text-[14px] text-ink",children:T.name}),T.title&&s.jsx("span",{className:"min-w-0 truncate text-[13px] text-ink-secondary",children:T.title})]}))),v.length>0&&s.jsx("div",{className:"px-3 pb-1 pt-2 text-[12px] font-medium text-ink-tertiary",children:l("palette.groups")}),v.map((T,M)=>A(`room:${T.id}`,j+M,()=>{b({kind:"room",group:T})},s.jsxs(s.Fragment,{children:[s.jsx(_n,{size:16,strokeWidth:1.75,className:"mx-[3px] shrink-0 text-ink-secondary"}),s.jsx("span",{className:"truncate text-[14px] text-ink",children:T.name})]}))),x&&d.length>0&&s.jsx("div",{className:"px-3 pb-1 pt-2 text-[12px] font-medium text-ink-tertiary",children:l("palette.messages")}),x&&d.map((T,M)=>{const S=T.snippet.slice(0,T.matchStart),C=T.snippet.slice(T.matchStart,T.matchStart+T.matchLength),O=T.snippet.slice(T.matchStart+T.matchLength);return A(`msg:${T.threadId}:${T.messageId}`,N+M,()=>{b({kind:"message",hit:T})},s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"flex items-center gap-2 truncate text-[13px] font-medium text-ink",children:[s.jsx(FG,{size:13,className:"shrink-0 text-ink-secondary"}),T.name,T.task?s.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",T.task]}):null]}),s.jsxs("span",{className:"line-clamp-2 text-[13px] text-ink-secondary",children:[S,s.jsx("mark",{className:"rounded-sm bg-accent/25 px-0.5 text-ink",children:C}),O]})]}),!0)})]})]})})}const iue=["none","view","chat","edit"],TS=e=>iue.indexOf(e??"none"),hR=(e,t)=>TS(e)>=TS(t),oue=(e,t)=>hR(e,t)?e:t;function lue(e){return e===void 0||e==="everyone"?{everyone:"chat",people:{}}:e==="admins"?{everyone:"none",people:{}}:{everyone:"none",people:Object.fromEntries(e.people.map(t=>[t.trim().toLowerCase(),"chat"]))}}function cue(e,t){return e.startsWith("@")?t.endsWith(e)&&t.length>e.length:e===t}function B$e(e,t){const n=t.trim().toLowerCase();let a=e.everyone;if(!n)return a;for(const[r,i]of Object.entries(e.people))cue(r,n)&&(a=oue(a,i));return a}function due(e,t){const n=Object.entries(e.people),a=t.people;return e.everyone===t.everyone&&n.length===Object.keys(a).length&&n.every(([r,i])=>a[r]===i)}function xR(e){return e.access??lue(e.visibility)}const uue=e=>e.yourAccess==="edit",pue=e=>e==="edit"?null:"chat";function mue(e,t,n,a){const r=a.trim().toLowerCase();return e.people.filter(i=>i.role==="member"&&i.email!==n&&!Object.hasOwn(t.people,i.email)).filter(i=>!r||i.name.toLowerCase().includes(r)||i.email.includes(r)).sort((i,o)=>i.name.localeCompare(o.name))}function Fy(e,t,n){const a={...e.people};return n?a[t]=n:delete a[t],{everyone:e.everyone,people:a}}const gR=(e,t)=>t?.people.find(n=>n.email===e)??null,tm=(e,t)=>gR(e,t)?.name??e;async function fue(e,t){return(await K(`/api/bots/${e}/reports-to`,{method:"PUT",body:JSON.stringify({email:t})})).bot}async function R3(e,t){return(await K(`/api/bots/${e}/access`,{method:"PUT",body:JSON.stringify(t)})).bot}function hue(e,t){const n=t.trim();return e.filter(a=>!a.hidden&&(a.section?.trim()||"")===n)}const O3=(e,t)=>t.find(n=>n.instanceId===e.modelSelection.instanceId);function xue(e,t){return l2(e,t)&&!(e==="antigravityAgent"&&t==="auto")}function gue(e,t){const n=new Map,a=new Set;for(const r of e){const i=O3(r,t);if(!i||a.has(i.instanceId))continue;a.add(i.instanceId);const o=[i.models.default,...i.models.options.filter(c=>!c.orgBlocked&&!c.needsCliUpdate).map(c=>c.id)].filter(c=>c.trim());for(const c of new Set(o)){const d=i.models.options.find(p=>p.id===c)?.label??c,u=n.get(c)??{id:c,label:d,engines:[]};u.engines.includes(i.displayName)||u.engines.push(i.displayName),n.set(c,u)}}return[...n.values()].sort((r,i)=>r.label.localeCompare(i.label))}function bue(e,t,n){const a=new Set;for(const r of e){const i=O3(r,t);if(!i?.capabilities?.modelVariants)for(const o of i?.capabilities?.effortLevels??[])a.add(o)}return n.filter(r=>a.has(r))}function bR(e,t){if(e.defaultBot?.person)return{bot:e,status:"skip",reason:l("teamSettings.skip.ownMausBot")};if(e.yourAccess!=="edit")return{bot:e,status:"skip",reason:l("teamSettings.skip.cantShare")};const n=xR(e);let a=t.everyone?{...n,everyone:t.everyone}:n;const r=t.person,i=!r||r.email===Ka(e)||r.level&&hR(n.people[r.email],r.level);return r&&!i&&(a={...a,...Fy(a,r.email,r.level)}),due(n,a)?{bot:e,status:"unchanged"}:{bot:e,status:"apply",access:a}}function yue(e,t,n){return e.map(a=>{if(n.kind==="access")return bR(a,n);if(n.kind==="workspace")return a.cwd===n.cwd?{bot:a,status:"unchanged"}:a.busy?{bot:a,status:"skip",reason:l("teamSettings.skip.busy")}:{bot:a,status:"apply",patch:{cwd:n.cwd}};const r=O3(a,t),i=r?.displayName??a.modelSelection.instanceId;if(n.kind==="approval")return[En(a),..._T(a)].every(p=>p===n.mode)?{bot:a,status:"unchanged"}:xue(r?.driverKind,n.mode)?{bot:a,status:"apply",patch:{approvalMode:n.mode,applyToAllThreads:!0}}:{bot:a,status:"skip",reason:l("teamSettings.skip.modeUnsupported",{engine:i})};const o=a.modelSelection;if(!r)return{bot:a,status:"skip",reason:l("teamSettings.skip.engineMissing")};const c=n.model??o.model;if(!(c===r.models.default||r.models.options.some(p=>p.id===c&&!p.orgBlocked&&!p.needsCliUpdate)))return{bot:a,status:"skip",reason:l("teamSettings.skip.modelUnsupported",{engine:i,model:c})};const u={instanceId:o.instanceId,model:c};if(o.variant&&c===o.model&&(u.variant=o.variant),n.effort===void 0)o.effort&&(u.effort=o.effort);else if(n.effort!==null){if(r.capabilities?.modelVariants)return{bot:a,status:"skip",reason:l("teamSettings.skip.variantsOnly",{engine:i})};if(!(r.capabilities?.effortLevels??[]).includes(n.effort))return{bot:a,status:"skip",reason:l("teamSettings.skip.effortUnsupported",{engine:i})};u.effort=n.effort,delete u.variant}return u.model===o.model&&u.effort===o.effort&&u.variant===o.variant?{bot:a,status:"unchanged"}:a.busy?{bot:a,status:"skip",reason:l("teamSettings.skip.busy")}:{bot:a,status:"apply",patch:{modelSelection:u,keepThreadModels:!0}}})}function kue(e){return e.some(t=>t.status==="apply"&&"patch"in t&&t.patch.approvalMode==="auto"&&t.bot.computer==="local")}async function vue(e,t,n={}){const a=[];for(const r of e){if(r.status==="unchanged")a.push({bot:r.bot,status:"unchanged"});else if(r.status==="skip")a.push({bot:r.bot,status:"skipped",reason:r.reason});else{const i="access"in r?null:n.acknowledgeLocalAuto&&r.patch.approvalMode==="auto"&&r.bot.computer==="local"?{...r.patch,acknowledgeLocalAuto:!0}:r.patch;try{let o;if(i)await t(r.bot,i);else if("access"in r&&n.share)o=await n.share(r.bot,r.access);else throw new Error(l("teamSettings.skip.cantShare"));a.push({bot:r.bot,status:o==="unchanged"?"unchanged":"applied"})}catch(o){a.push({bot:r.bot,status:"skipped",reason:o instanceof Error?o.message:String(o)})}}n.onProgress?.(a.length)}return a}function wue(e){return{applied:e.filter(t=>t.status==="applied").length,unchanged:e.filter(t=>t.status==="unchanged").length,skipped:e.filter(t=>t.status==="skipped").length}}let Fs=null;const Uy=new Set;function yR(e){Fs=e;for(const t of Uy)t()}const up=yR;function jue(){return Fs}function hn(){return f.useSyncExternalStore(e=>(Uy.add(e),()=>Uy.delete(e)),()=>Fs,()=>Fs)}function L3(){const e=hn();return f.useMemo(()=>{const t=e?.people??[],n=aie(t.map(a=>({key:a.email,name:a.name}))).flatMap(a=>a.names.map(r=>({name:r,person:!0})));return{people:t.filter(a=>!a.you),peers:n}},[e?.people])}function Nue(e,t){return e.pictureUrl??t?.people.find(n=>n.email===e.email)?.pictureUrl}function Mo(e,t){const n=Ka(e);return n?t?.people.find(a=>a.email===n)??{email:n,name:Mx(n),role:"member"}:null}function Sue(e,t){if(!t||e.length===0)return null;const n=e.map(r=>Mo(r,t)),a=n[0];return a&&n.every(r=>r?.email===a.email)?a:null}function MS(e,t){const n=e.defaultBot?.person?.trim().toLowerCase();if(!n||!t||t.me?.email.toLowerCase()===n)return e.name;const a=t.people.find(r=>r.email.toLowerCase()===n);return`${e.name} · ${a?.name||Mx(n)}`}function F$e(e,t,n){const a=t?.me?.email.toLowerCase();return e.filter(r=>r.id===n||!r.hidden&&(!t||(r.yourAccess===void 0||r.yourAccess==="chat"||r.yourAccess==="edit")&&(!r.defaultBot?.person||r.defaultBot.person.trim().toLowerCase()===a)))}function ph(e,t){return!!(t&&!e.defaultBot?.person&&(t.admin||t.me&&Ka(e)===t.me.email))}function Iue(e,t,n){return!n||t?.private?null:Mo(e,n)}async function z3(){const e=await K("/api/team/people",{background:!0}),t=Array.isArray(e?.people)?e.people:[];return{people:t,me:t.find(n=>n.you)??null,presence:t.some(n=>typeof n.here=="boolean")}}const kR=e=>e.kind==="session"?e.scopes.includes("admin"):e.kind==="loopback";async function vR(){const e=await K("/api/needs-you",{background:!0});return Array.isArray(e?.items)?e.items:[]}let P1=null;function P3(){!Fs||P1||(P1=setTimeout(()=>{P1=null,vR().then(e=>{Fs&&up({...Fs,needsYou:e})}).catch(()=>{})},800))}function Cue(e,t,n){const a=r=>`${r.id}:${r.reportsTo??""}:${r.activity??""}:${(r.tasks??[]).filter(i=>i.activity==="waiting-on-you").length}:${(r.tasks??[]).filter(i=>i.unread).length}:${b7(r)}`;return`${e.map(a).join("|")}|${t.filter(r=>r.unread).length}|${n.length}:${n.filter(r=>!r.read).length}`}let D1=null;function Eue(){!Fs||D1||(D1=setTimeout(()=>{D1=null,z3().then(e=>{Fs&&up({...Fs,...e})}).catch(()=>{})},800))}function qy(){Fs&&Promise.all([z3(),bo()]).then(([e,t])=>{Fs&&up({...Fs,...e,admin:kR(t)})}).catch(()=>{})}let Hy="ready";const Wy=new Set;function af(e){Hy=e;for(const t of Wy)t()}function Aue(){return f.useSyncExternalStore(e=>(Wy.add(e),()=>Wy.delete(e)),()=>Hy,()=>Hy)}let Ed=0;function wR(){const e=++Ed;af("loading"),Promise.all([z3(),bo(),vR()]).then(([t,n,a])=>{e===Ed&&(up({...t,admin:kR(n),needsYou:a}),af("ready"))}).catch(()=>{e===Ed&&af("failed")})}const Tue=wR;function Mue(e,t){const n=OA(e)?.id??null;f.useEffect(()=>{if(!n){Ed+=1,up(null),af("ready");return}return wR(),()=>{Ed+=1}},[n]),f.useEffect(()=>{n&&P3()},[n,t]),f.useEffect(()=>{n&&Eue()},[n,e])}function D3(){P3()}const _ue=250,_S=300;function $1(e,t,n){return(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y)}function Rue(e,t,n){const a=e.x<=n.left?n.left:n.right,r={x:a,y:n.top},i={x:a,y:n.bottom},o=$1(t,e,r),c=$1(t,r,i),d=$1(t,i,e),u=o<0||c<0||d<0,p=o>0||c>0||d>0;return!(u&&p)}const Oue={set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)};function jR({open:e,close:t,submenuBox:n,timers:a=Oue}){let r=null,i=null,o=null,c=null;const d=()=>{i&&a.clear(i.handle),i=null},u=()=>{o&&a.clear(o),o=null},p=()=>{u(),r!==null&&(r=null,c=null,t())},m=x=>{d(),u(),r!==x&&(r=x,e(x))},h=x=>{const g=n();return!!(c&&g&&Rue(c,x,g))};return{enterRow(x,g,v){if(d(),r!==null&&x===r){u(),c=v;return}r!==null&&(h(v)?o??=a.set(p,_S):p()),g&&(i={key:x,handle:a.set(()=>m(x),_ue)})},leaveRow(x){i?.key===x&&d()},move(x,g){if(g){c=x;return}o&&!h(x)&&p()},leaveMenu(){d(),r!==null&&(o??=a.set(p,_S))},enterSubmenu(){u()},openNow:m,closeNow:p,reset(){d(),u(),r=null,c=null},get openKey(){return r}}}const Lue=80,zue=250,Pue=237,RS=320,an=8,OS=6;function Due(e,t,n,a=!1,r="start"){const i=Math.max(an,n.width-t.width-an),c=Math.min(Math.max((r==="end"?!a:a)?e.right-t.width:e.left,an),i),d=e.top-OS-t.height,u=e.bottom+OS,p=u+t.height<=n.height-an,m=r==="end"?p||d<an?u:d:d>=an?d:u,h=Math.max(an,n.height-t.height-an);return{left:c,top:Math.min(Math.max(m,an),h)}}function NR(e,t,n,a,r=!1){const o=r?e.left-4-n.width:e.right+4,c=r?e.right+4:e.left-4-n.width,d=h=>h>=an&&h+n.width<=a.width-an,u=d(o)?o:d(c)?c:o,p=Math.max(an,a.width-n.width-an),m=Math.max(an,a.height-n.height-an);return{left:Math.min(Math.max(u,an),p),top:Math.min(Math.max(t.top-6,an),m)}}const B1=e=>typeof getComputedStyle=="function"&&e?getComputedStyle(e).direction==="rtl":!1,F1=e=>e?[...e.querySelectorAll(':scope > div > [role^="menuitem"]:not(:disabled)')]:[];function mh(e,t,n){if(n===0)return null;switch(e){case"ArrowDown":return t<0?0:(t+1)%n;case"ArrowUp":return t<0?n-1:(t-1+n)%n;case"Home":return 0;case"End":return n-1;default:return null}}function LS({items:e,openSubmenu:t,engaged:n=!1,onItem:a,onRowEnter:r,onRowLeave:i}){return s.jsx(s.Fragment,{children:e.map(o=>s.jsxs("div",{className:"flex flex-col gap-1",children:[o.separatorBefore&&s.jsx("div",{role:"separator",className:oc}),o.heading&&s.jsx("div",{className:Wu,children:o.heading}),s.jsxs("button",{type:"button",role:o.checked===void 0?"menuitem":"menuitemradio","aria-checked":o.checked,"data-tour":o.tourId,"data-menu-key":o.key,title:o.title,disabled:o.disabled,"aria-haspopup":o.submenu?"menu":void 0,"aria-expanded":o.submenu?t===o.key:void 0,onClick:c=>a(o,c.currentTarget,c.detail===0),onPointerEnter:c=>r?.(o,c.currentTarget,{x:c.clientX,y:c.clientY}),onPointerLeave:()=>i?.(o),className:I("flex min-h-[30px] w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[14px] leading-[18px] disabled:opacity-60 focus-visible:bg-menu-hover focus-visible:outline-none",o.active||o.submenu&&t===o.key&&n?"bg-menu-active text-ink":"text-ink hover:bg-menu-hover"),children:[o.icon&&s.jsx("span",{className:I("flex size-4 shrink-0 items-center justify-center [&>svg]:size-4",o.wrap&&"h-[18px] self-start",o.active?"text-accent":"text-ink-secondary"),children:o.icon}),o.subtitle||o.note?s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:o.wrap?"break-words":"truncate",children:o.label}),o.subtitle&&s.jsx("span",{className:"truncate text-[12px] font-normal leading-4 text-ink-secondary",children:o.subtitle}),o.note&&s.jsx("span",{className:"text-[12px] font-normal leading-snug text-ink-tertiary",children:o.note})]}):s.jsx("span",{className:I("flex-1",o.wrap?"min-w-0 break-words":"truncate"),children:o.label}),o.value&&s.jsx("span",{className:"shrink-0 text-[13px] font-normal leading-[18px] tabular-nums text-ink-secondary",children:o.value}),o.trailing,o.attention&&s.jsx("span",{className:I("size-2 shrink-0 rounded-full",o.attentionTone==="accent"?"bg-accent":"bg-danger")}),(o.submenu||o.chevron)&&s.jsx(it,{size:14,"aria-hidden":!0,className:"-me-0.5 shrink-0 text-ink-secondary rtl:-scale-x-100"})]})]},o.key))})}const zS=e=>_3({key:e.key,defaultPrevented:e.defaultPrevented,isComposing:e.nativeEvent.isComposing});function Vs({items:e,ariaLabel:t,openOnHover:n=!1,placement:a="above",align:r="start",triggerClassName:i="w-full",triggerTitle:o,triggerLabel:c,triggerTour:d,onOpenChange:u,renderTrigger:p}){const[m,h]=f.useState(!1),[x,g]=f.useState(!1),[v,y]=f.useState(null),[w,b]=f.useState(null),[k,j]=f.useState(null),N=f.useRef(null),A=f.useRef(null),T=f.useRef(null),M=f.useRef(null),S=f.useRef(null),C=f.useRef(new Map),[O,L]=f.useState(!1),D=f.useRef(null);D.current??=jR({open:ee=>{S.current=C.current.get(ee)??null,j(null),y(ee)},close:()=>{y(null),L(!1)},submenuBox:()=>M.current?.getBoundingClientRect()??null});const z=D.current,P=f.useRef(!1),$=f.useRef(null),_=f.useRef(null),B=f.useId(),W=ys(m),R=a==="above",q=f.useRef(u);q.current=u,f.useEffect(()=>{q.current?.(m)},[m]);const F=()=>{$.current&&clearTimeout($.current),_.current&&clearTimeout(_.current),$.current=null,_.current=null};f.useEffect(()=>()=>{F(),D.current?.reset()},[]);const E=()=>{!n||x||(F(),$.current=setTimeout(()=>h(!0),Lue))},H=()=>{!n||x||(F(),_.current=setTimeout(()=>h(!1),zue))},U=f.useCallback((ee=!1)=>{F(),D.current?.reset(),g(!1),h(!1),y(null),L(!1),ee&&A.current?.focus()},[]),V=f.useRef({contains:ee=>[N.current,T.current,M.current].some(ie=>ie?.contains(ee))});Ir(m,V,()=>U(R)),f.useLayoutEffect(()=>{if(!W.shown)return;const ee=()=>{const ie=A.current,ge=T.current;if(!ie||!ge)return;const Z={width:window.innerWidth,height:window.innerHeight};R&&b(Due(ie.getBoundingClientRect(),{width:ge.offsetWidth,height:ge.offsetHeight},Z,B1(ie),r));const le=M.current,de=S.current;le&&de&&j(NR(ge.getBoundingClientRect(),de.getBoundingClientRect(),{width:le.offsetWidth,height:le.offsetHeight},Z,B1(ie)))};return ee(),window.addEventListener("resize",ee),window.addEventListener("scroll",ee,!0),()=>{window.removeEventListener("resize",ee),window.removeEventListener("scroll",ee,!0)}},[R,r,W.shown,v,e.length]),f.useEffect(()=>{!m||!P.current||R&&!w||(P.current=!1,F1(T.current)[0]?.focus())},[m,R,w]);const G=(ee,ie,ge=!1)=>{C.current.set(ee.key,ie),z.openNow(ee.key),ge&&requestAnimationFrame(()=>F1(M.current)[0]?.focus())},Q=(ee=!1)=>{z.closeNow(),ee&&S.current?.focus()},Y=(ee,ie,ge)=>{if(ee.submenu){v===ee.key?Q():G(ee,ie,ge);return}ee.onSelect(),ee.keepOpen||U(R)},oe=(ee,ie)=>{const ge=ee.currentTarget,Z=F1(ge),le=Z.indexOf(document.activeElement),de=mh(ee.key,le,Z.length);if(de!=null){ee.preventDefault(),Z[de]?.focus();return}const Ie=B1(ge),_e=Ie?"ArrowLeft":"ArrowRight",te=Ie?"ArrowRight":"ArrowLeft",he=Z[le],we=he?e.find(ae=>ae.key===he.dataset.menuKey):void 0;!ie&&ee.key===_e&&we?.submenu&&he?(ee.preventDefault(),G(we,he,!0)):ie&&(ee.key===te||ee.key==="Escape")?(ee.preventDefault(),ee.stopPropagation(),Q(!0)):!ie&&zS(ee)?(ee.preventDefault(),ee.stopPropagation(),U(!0)):ee.key==="Tab"&&R&&(ee.preventDefault(),U(!0))},X=v?e.find(ee=>ee.key===v):void 0,J=I(Jt,"overflow-hidden"),pe=W.shown&&s.jsx("div",{ref:T,id:B,role:"menu","aria-label":t,"data-sidebar-popover-menu":R?"anchored":void 0,...W.exitProps,onKeyDown:ee=>oe(ee,!1),onPointerMove:ee=>z.move({x:ee.clientX,y:ee.clientY},!!(v&&S.current?.contains(ee.target))),onPointerLeave:()=>z.leaveMenu(),style:R?{position:"fixed",left:w?.left??0,top:w?.top??0,minWidth:Pue,width:"max-content",maxWidth:`min(${RS}px, calc(100vw - ${an*2}px))`,maxHeight:`calc(100vh - ${an*2}px)`,visibility:w?void 0:"hidden"}:void 0,className:I(J,R?"z-[60] overflow-y-auto":"absolute z-40",a==="below"&&"top-full right-0 mt-1 w-72 max-w-[calc(100vw-2rem)]",W.className),children:s.jsx(LS,{items:e,openSubmenu:v,engaged:O,onItem:Y,onRowEnter:(ee,ie,ge)=>{ee.submenu&&C.current.set(ee.key,ie),z.enterRow(ee.key,!!ee.submenu,ge)},onRowLeave:ee=>z.leaveRow(ee.key)})}),se=W.shown&&X?.submenu&&s.jsx("div",{ref:M,role:"menu","aria-label":X.label,"data-sidebar-popover-submenu":!0,onKeyDown:ee=>oe(ee,!0),onPointerEnter:()=>{z.enterSubmenu(),L(!0)},onPointerLeave:()=>L(!1),onFocus:()=>L(!0),onBlur:ee=>{ee.relatedTarget instanceof Node&&ee.currentTarget.contains(ee.relatedTarget)||L(!1)},style:{position:"fixed",left:k?.left??0,top:k?.top??0,minWidth:200,width:"max-content",maxWidth:`min(${RS}px, calc(100vw - ${an*2}px))`,maxHeight:`calc(100vh - ${an*2}px)`,visibility:k?void 0:"hidden"},className:I(J,"z-[61] animate-pop-in overflow-y-auto"),children:s.jsx(LS,{items:X.submenu,onItem:ee=>{ee.onSelect(),ee.keepOpen||U(!0)}})});return s.jsxs("div",{ref:N,className:"relative",onPointerEnter:E,onPointerLeave:H,onFocus:()=>n&&h(!0),onBlur:ee=>{x||(!ee.relatedTarget||!V.current.contains(ee.relatedTarget))&&h(!1)},children:[s.jsx("button",{ref:A,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?B:void 0,"aria-label":c??t,title:o,"data-tour":d,onClick:ee=>{F(),m&&(x||!n)?U():(P.current=R&&ee.detail===0,g(!0),h(!0))},onKeyDown:ee=>{if(m&&zS(ee)){ee.preventDefault(),ee.stopPropagation(),U(!0);return}!R||m||ee.key!=="ArrowUp"&&ee.key!=="ArrowDown"||(ee.preventDefault(),P.current=!0,g(!0),h(!0))},className:i,children:p({open:m})}),R?typeof document<"u"&&pe?Ke.createPortal(s.jsxs(s.Fragment,{children:[pe,se]}),document.body):null:s.jsxs(s.Fragment,{children:[pe,typeof document<"u"&&se?Ke.createPortal(se,document.body):null]})]})}function $ue(e){for(const t of e){const n=t.tasks?.find(a=>a.inbox);if(n)return`${t.id}:${n.threadId}:${n.inboxChangedAt??0}:${n.openAsks??0}`}return null}function $3(e){let t=e;const n=new Set;return{get:()=>t,set(a){t=a;for(const r of n)r()},subscribe(a){return n.add(a),()=>{n.delete(a)}}}}const Va=$3(null),B3=()=>f.useSyncExternalStore(Va.subscribe,Va.get,Va.get),PS=()=>Va.get()!==null,Bue=()=>f.useSyncExternalStore(Va.subscribe,PS,PS),to=$3("unknown"),F3=()=>f.useSyncExternalStore(to.subscribe,to.get,to.get);let U3=0,Ky=0;const SR=(e,t)=>{e<Ky||(Ky=e,Va.set(t),to.set("yes"))};let Pc=null,U1=!1;function nc(){return Pc?(U1=!0,Pc):(Pc=(async()=>{try{do{U1=!1;const e=++U3,t=await K("/api/inbox",{background:!0}).catch(n=>(n.status===404&&(Va.set(null),to.set("no")),null));t&&Array.isArray(t.rows)&&SR(e,t)}while(U1)}finally{Pc=null}})(),Pc)}function Fue(e){f.useEffect(()=>{to.get()!=="no"&&nc()},[e]),f.useEffect(()=>{const t=()=>{to.get()!=="no"&&nc()};return window.addEventListener("focus",t),()=>window.removeEventListener("focus",t)},[])}const sg=(e,t)=>{Ky=++U3;const n=Va.get();n&&Va.set({...n,rows:n.rows.map(a=>a.id===e?{...a,...t}:a)})};async function IR(e,t,n){const a=++U3,r=await K(`/api/inbox/${e}/${t}`,{method:"POST",background:!0}).catch(()=>null);if(r&&Array.isArray(r.rows))return SR(a,r);sg(e,n),nc()}function no(e){e.unread&&(sg(e.id,{unread:!1}),IR(e.id,"read",{unread:!0}))}const Uue=e=>sg(e.id,{tab:"done",unread:!1});function que(e){const t=Va.get()?.rows.find(n=>n.id===e.id);sg(e.id,{tab:"done",unread:!1}),IR(e.id,"done",t?{tab:t.tab,unread:t.unread}:{})}async function Hue(e,t,n){const a=e.threadId?null:t.origin,r=a?.groupId?`/api/groups/${a.groupId}/messages`:`/api/bots/${a?.botId??e.botId}/messages`;await K(r,{method:"POST",body:JSON.stringify({text:n,threadId:a?.threadId??e.threadId,replyToId:t.id,sendId:ya()})}),nc()}const ja=$3({open:!1,reading:null}),q3=()=>f.useSyncExternalStore(ja.subscribe,ja.get,ja.get);function sc(e={}){ja.set({...ja.get(),open:!0,reading:e.reading??null}),nc()}const fh=()=>ja.set({...ja.get(),open:!1,reading:null}),rf=e=>ja.set({...ja.get(),reading:e}),Wue=e=>ja.set({...ja.get(),wide:e}),of=[];function CR(e){of.at(-1)?.(e)}function Kue(){const[e,t]=f.useState(null);f.useEffect(()=>(of.push(t),()=>{of.splice(of.lastIndexOf(t),1)}),[]);const n=f.useCallback(()=>t(null),[]);return s.jsx(Yue,{target:e,onClose:n})}const Vue=e=>e.name.trim().charAt(0).toUpperCase()||"?",DS=["bg-[#5B8DEF]","bg-[#E0745B]","bg-[#4FAF7F]","bg-[#B26BD9]","bg-[#D9A23B]","bg-[#3BA7B8]"],Gue=e=>DS[[...e].reduce((t,n)=>t+n.charCodeAt(0),0)%DS.length];function da({person:e,size:t=18}){const n=Nue(e,hn()),[a,r]=f.useState(null);return n&&a!==n?s.jsx("img",{...x4("person","picture"),src:n,alt:"","aria-hidden":"true",draggable:!1,"data-person-picture":e.email,onError:()=>r(n),style:{width:t,height:t},className:"inline-block shrink-0 rounded-full bg-raised object-cover"}):s.jsx("span",{...x4("person","initials"),"aria-hidden":"true",style:{width:t,height:t,fontSize:Math.round(t*.55)},className:I("inline-flex shrink-0 items-center justify-center rounded-full font-semibold leading-none text-white",Gue(e.email)),children:Vue(e)})}function Yue({target:e,onClose:t}){const{dispatch:n}=re(),a=hn(),r=No(e),i=r.value,[o,c]=f.useState(!1);if(f.useEffect(()=>{if(!e)return;const m=x=>{(!(x.target instanceof Element)||!x.target.closest("[data-owner-picker]"))&&t()},h=x=>{x.key==="Escape"&&t()};return window.addEventListener("mousedown",m),window.addEventListener("keydown",h),()=>{window.removeEventListener("mousedown",m),window.removeEventListener("keydown",h)}},[e,t]),!r.shown||!i||!a)return null;const d=async m=>{c(!0);try{if(i.botIds.length===1){const h=await K(`/api/bots/${i.botIds[0]}/reports-to`,{method:"PUT",body:JSON.stringify({email:m.email})});h?.bot&&n({type:"botPatched",bot:h.bot})}else{const h=await K("/api/team/reports-to",{method:"PUT",body:JSON.stringify({botIds:i.botIds,email:m.email})});for(const x of h?.bots??[])n({type:"botPatched",bot:x})}D3(),t()}catch(h){n({type:"error",message:h instanceof Error?h.message:String(h)})}finally{c(!1)}},u=Math.max(8,Math.min(i.y,window.innerHeight-320)),p=Math.max(8,Math.min(i.x,window.innerWidth-260));return Ke.createPortal(s.jsxs("div",{"data-owner-picker":!0,role:"menu","aria-label":i.title,style:{top:u,left:p},className:I("fixed z-50 w-[248px] overflow-hidden",Jt,r.className),...r.exitProps,children:[s.jsx("div",{className:Wu,children:i.title}),s.jsx("div",{className:"flex max-h-[260px] flex-col gap-1 overflow-y-auto",children:a.people.map(m=>s.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":m.email===i.current,disabled:o,onClick:()=>{d(m)},className:I("flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink",m.email===i.current?"bg-menu-active":"hover:bg-menu-hover"),children:[s.jsx(da,{person:m,size:20}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate",children:m.you?l("owner.you",{name:m.name}):m.name}),s.jsx("span",{className:"block truncate text-[11px] text-ink-secondary",children:m.email})]}),m.email===i.current&&s.jsx(Se,{size:14,className:"shrink-0 text-accent"})]},m.email))}),s.jsx("div",{className:"px-2 pb-1 text-[12px] leading-4 text-ink-tertiary",children:l("lookedAfter.pickHint")})]}),document.body)}function $S(e,t){const n=Mo(e,t);return n?l("lookedAfter.menu",{name:n.name}):l("lookedAfter.menuNone")}function Vy(e,t,n){if(!e.length)return;const a=e.length===1&&n.name===void 0?l("lookedAfter.pickTitle"):l("lookedAfter.setForAllTitle",{name:n.name??""}),r=e.length===1?Mo(e[0],t)?.email??null:Sue(e,t)?.email??null;CR({botIds:e.map(i=>i.id),title:a,current:r,x:n.x,y:n.y})}function Jue(e,t,n){const a=e.find(r=>r.threadId===n||r.tasks?.some(i=>i.threadId===n));(a?K(`/api/groups/${a.id}/read`,{method:"POST"}):K(`/api/bots/${t}/read`,{method:"POST",body:JSON.stringify({threadId:n})})).then(()=>P3()).catch(()=>{})}function Que({item:e,title:t}){const n=e.kind==="message"&&e.fromEmail?{email:e.fromEmail,name:e.from,role:"member"}:null;return n?s.jsxs("span",{className:"flex w-full min-w-0 items-center gap-1.5 text-[13px] text-ink",children:[s.jsx(da,{person:n,size:16}),s.jsx("span",{className:"min-w-0 truncate",children:t})]}):s.jsx("span",{className:"w-full truncate text-[13px] text-ink",children:t})}function ER({item:e,onOpened:t}){const{state:n,dispatch:a}=re(),r=et(),i=u=>n.bots.find(p=>p.id===u)?.name??l("needsYou.aBot"),o="botId"in e?e.botId:e.botIds[0],c=e.kind==="message"?l("needsYou.message",{name:e.from}):e.kind==="question"?l("needsYou.asking",{bot:i(o)}):l("needsYou.fix",{bot:i(o)}),d="text"in e?e.text:"";return s.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{t?.(),e.threadId&&(mn(a,{botId:o,threadId:e.threadId},n,r),e.kind==="message"&&Jue(n.groups,o,e.threadId))},className:"flex w-full flex-col items-start rounded-md px-2 py-1.5 text-left hover:bg-menu-hover",children:[s.jsx(Que,{item:e,title:c}),d&&s.jsx("span",{className:"w-full truncate text-[12px] text-ink-secondary",children:d})]})}function Xue({compact:e=!1}){const t=hn(),n=F3(),[a,r]=f.useState(!1);f.useEffect(()=>{if(!a)return;const c=d=>{(!(d.target instanceof Element)||!d.target.closest("[data-needs-you]"))&&r(!1)};return window.addEventListener("mousedown",c),()=>window.removeEventListener("mousedown",c)},[a]);const i=t?.needsYou??[];if(n!=="no"||!t||i.length===0)return null;const o=l("needsYou.count",{count:i.length});return s.jsxs("div",{"data-needs-you":!0,className:I("relative",e?"px-1":"px-2 pb-1"),children:[s.jsxs("button",{type:"button","aria-expanded":a,"aria-haspopup":"menu","aria-label":o,title:o,onClick:()=>r(c=>!c),className:"flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-[13px] font-medium text-warning hover:bg-raised/60",children:[s.jsx(Cw,{size:15,"aria-hidden":"true",className:"shrink-0"}),!e&&s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l("needsYou.title")}),s.jsx("span",{className:"rounded-full bg-warning px-1.5 text-[11px] font-semibold tabular-nums text-panel",children:i.length})]}),a&&s.jsx("div",{role:"menu","aria-label":l("needsYou.title"),className:I("absolute left-2 right-2 top-full z-40 mt-1 max-h-[340px] overflow-y-auto",Jt),children:i.map(c=>s.jsx(ER,{item:c,onOpened:()=>r(!1)},`${c.kind}:${c.id}`))})]})}function Zue({botId:e,threadId:t}){const n=hn(),{state:a}=re(),r=a.bots.find(o=>o.id===e);if(!n||!r)return null;const i=Iue(r,r.tasks?.find(o=>o.threadId===t),n);return i?s.jsxs("div",{"data-asking":i.email,className:"mb-1.5 flex items-center gap-1.5 text-[12px] text-ink-secondary",children:[s.jsx(da,{person:i,size:14}),i.you?l("owner.askingYou"):l("owner.asking",{name:i.name})]}):null}const Gy=e=>e?s.jsx(Se,{size:14,"aria-hidden":"true"}):s.jsx("span",{"aria-hidden":"true"});function AR({label:e,shown:t,items:n,align:a="end",className:r}){return s.jsx(Vs,{items:n,ariaLabel:e,align:a,triggerClassName:I("flex max-w-full items-center gap-1 rounded-md px-2 py-1 text-[13px] leading-[18px] hover:bg-ink/[0.06] aria-expanded:bg-ink/[0.06]",r??"text-ink-secondary hover:text-ink"),renderTrigger:()=>s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate",children:t}),s.jsx(jt,{size:14,"aria-hidden":"true",className:"shrink-0 opacity-70"})]})})}const BS=(e,t,n,a,r={})=>({key:e,label:t,checked:n,icon:Gy(n),onSelect:a,...r});function epe({disabled:e=!1,label:t,onRemove:n,onMakeOwner:a,makeOwnerLabel:r}){const i=[];return a&&i.push({key:"owner",label:r??"",icon:Gy(!1),disabled:e,onSelect:a}),i.push({key:"remove",label:l("botAccess.remove"),icon:Gy(!1),separatorBefore:!!a,disabled:e,onSelect:n}),s.jsx(AR,{label:t,shown:l("botAccess.added"),items:i})}function TR({person:e,size:t}){return e?s.jsx(da,{person:e,size:t}):s.jsx("span",{"aria-hidden":"true",style:{width:t,height:t},className:"inline-flex shrink-0 items-center justify-center rounded-full bg-ink/[0.08] text-ink-secondary",children:s.jsx(C7,{size:Math.round(t/2)})})}function tpe({bot:e,teamName:t,onClose:n,onChanged:a,headerMenu:r}){const i=hn(),{dispatch:o}=re(),c=f.useRef(null),[d,u]=f.useState(""),[p,m]=f.useState(!1),[h,x]=f.useState(null),g=xR(e),v=i?Mo(e,i):null,y=uue(e),w=ph(e,i);f.useEffect(()=>{const T=document.activeElement instanceof HTMLElement?document.activeElement:null;return c.current?.focus(),()=>{T?.isConnected&&T.focus()}},[]),f.useEffect(()=>{document.activeElement===document.body&&c.current?.focus()},[e.access,e.reportsTo,h]);const b=async T=>{if(!p){m(!0),u("");try{await T()}catch(M){u(M instanceof Error?M.message:String(M))}finally{m(!1)}}},k=(T,M)=>b(async()=>{await R3(e.id,T),a({before:g,after:T,text:M})}),j=T=>b(async()=>{o({type:"botPatched",bot:await fue(e.id,T.email)}),D3(),x(null)}),N=()=>{u(""),x(null)},A=!y&&i?.me&&e.yourAccess&&e.yourAccess!=="none"?s.jsx(q1,{person:i.me,you:!0,"data-share-yours":!0,trailing:null}):null;return Ke.createPortal(s.jsx("div",{className:"ui-scrim fixed inset-0 z-[60] flex items-center justify-center p-4",onMouseDown:T=>T.stopPropagation(),children:s.jsx("div",{ref:c,role:"dialog","aria-modal":"true","aria-labelledby":"share-bot-title",tabIndex:-1,"data-share-bot":e.id,className:"ui-modal flex max-h-full w-full max-w-[480px] flex-col text-ink shadow-2xl outline-none",onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&!T.defaultPrevented&&(h?N():n()),T.key==="Tab"&&npe(T,c.current)},children:h?s.jsx(spe,{person:h,bot:e,busy:p,error:d,onCancel:N,onConfirm:()=>{j(h)}}):s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"flex items-center justify-between gap-3 px-5 pb-3 pt-4",children:[s.jsx("h2",{id:"share-bot-title",className:"min-w-0 truncate text-[17px] font-semibold",children:l("botAccess.title",{bot:e.name})}),r]}),y&&i&&s.jsx("div",{className:"relative z-10 shrink-0 px-5 pb-1",children:s.jsx(rpe,{team:i,access:g,owner:Ka(e),disabled:p,onAdd:(T,M)=>{k(Fy(g,T.email,M),l("botAccess.toast.addedPlain",{name:T.name}))}})}),s.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 pb-2 pt-3",children:[s.jsx("h3",{className:"mb-1 text-[13px] font-semibold",children:l("botAccess.people")}),s.jsxs("ul",{"data-share-people":!0,className:"flex max-h-[min(264px,40vh)] flex-col overflow-y-auto",children:[v&&s.jsx(q1,{person:v,you:v.you===!0,trailing:s.jsx("span",{className:"px-2 text-[13px] text-ink-secondary",children:l("lookedAfter.badge")})}),A,y&&Object.keys(g.people).sort((T,M)=>tm(T,i).localeCompare(tm(M,i))).map(T=>{const M=gR(T,i);return s.jsx(q1,{entry:T,person:M,you:i?.me?.email===T,trailing:s.jsx(epe,{disabled:p,label:l("botAccess.personMenu",{name:tm(T,i)}),onMakeOwner:w&&M?()=>{u(""),x(M)}:void 0,makeOwnerLabel:M?l("lookedAfter.make",{name:M.name}):void 0,onRemove:()=>{k(Fy(g,T,null),l("botAccess.toast.removed",{name:tm(T,i)}))}})},T)})]}),s.jsx("p",{className:"mt-1.5 text-[12px] leading-relaxed text-ink-secondary",children:l("botAccess.admins")}),y&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"mb-1.5 mt-4 text-[13px] font-semibold",children:l("botAccess.general")}),s.jsx(ape,{access:g,teamName:t,disabled:p,onChange:T=>{k({everyone:T,people:g.people},T==="none"?l("botAccess.toast.onlyAdded"):l("botAccess.toast.everyoneUse",{team:t}))}})]}),d&&s.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:d})]}),s.jsx("footer",{className:"flex shrink-0 justify-end px-5 pb-4 pt-3",children:s.jsx("button",{type:"button",onClick:n,className:"ui-button ui-button-primary rounded-full px-4",children:l("common.done")})})]})})}),document.body)}function npe(e,t){const n=t?.querySelectorAll("input:enabled, button:enabled");if(!n?.length)return;const a=n[0],r=n[n.length-1];e.shiftKey&&document.activeElement===a?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),a.focus())}function spe({person:e,bot:t,busy:n,error:a,onCancel:r,onConfirm:i}){return s.jsxs("div",{"data-share-make-owner":e.email,className:"px-5 pb-4 pt-4",children:[s.jsx("h2",{id:"share-bot-title",className:"text-[17px] font-semibold",children:l("lookedAfter.makeTitle",{name:e.name,bot:t.name})}),s.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-ink-secondary",children:l("lookedAfter.makeBody",{name:e.name,bot:t.name})}),a&&s.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:a}),s.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[s.jsx("button",{type:"button",autoFocus:!0,disabled:n,onClick:r,className:"ui-button rounded-full px-4",children:l("common.cancel")}),s.jsx("button",{type:"button",disabled:n,onClick:i,className:"ui-button ui-button-primary rounded-full px-4",children:l("lookedAfter.make",{name:e.name})})]})]})}function q1({person:e,entry:t,you:n,trailing:a,...r}){const i=e?.name??t??"";return s.jsxs("li",{className:"flex min-h-[40px] shrink-0 items-center gap-3 py-1","data-share-person":e?.email??t,...r,children:[s.jsx(TR,{person:e,size:32}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-[14px] leading-[18px] text-ink",children:n?l("botAccess.you",{name:i}):i}),e&&s.jsx("span",{className:"block truncate text-[12px] leading-4 text-ink-secondary",children:e.email})]}),s.jsx("span",{className:"min-w-0 shrink-0",children:a})]})}function ape({access:e,teamName:t,disabled:n,onChange:a}){const r=e.everyone!=="none",i=e.everyone==="view"?l("botAccess.everyoneHint.view",{team:t}):e.everyone==="chat"?l("botAccess.everyoneHint.chat",{team:t}):e.everyone==="edit"?l("botAccess.everyoneHint.edit",{team:t}):l("botAccess.onlyAddedHint"),o=l("botAccess.onlyAdded"),c=l("botAccess.everyoneUse",{team:t});return s.jsxs("div",{className:"flex items-center gap-3","data-share-general":e.everyone,children:[s.jsx("span",{"aria-hidden":"true",className:I("inline-flex size-8 shrink-0 items-center justify-center rounded-full",r?"bg-accent/15 text-accent":"bg-ink/[0.08] text-ink-secondary"),children:r?s.jsx(_n,{size:16}):s.jsx(vo,{size:16})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"-ms-2 flex",children:s.jsx(AR,{label:l("botAccess.general"),shown:r?c:o,align:"start",className:"font-medium text-ink",items:[BS("none",o,!r,()=>{r&&a("none")},{disabled:n}),BS("everyone",c,r,()=>{r||a("chat")},{disabled:n})]})}),s.jsx("p",{className:"text-[12px] leading-4 text-ink-secondary",children:i})]})]})}function rpe({team:e,access:t,owner:n,disabled:a,onAdd:r}){const[i,o]=f.useState(""),[c,d]=f.useState(!1),[u,p]=f.useState(0),m=f.useId(),h=f.useRef(null),x=pue(t.everyone),g=f.useMemo(()=>mue(e,t,n,i),[e,t,n,i]),v=Math.min(u,g.length-1),y=c&&g.length>0;if(f.useEffect(()=>{y&&h.current?.querySelector('[aria-selected="true"]')?.scrollIntoView?.({block:"nearest"})},[y,v]),!x)return s.jsx("p",{className:"py-1 text-[13px] text-ink-secondary",children:l("botAccess.everyoneEdits")});const w=k=>{a||(r(k,x),o(""),p(0),d(!1))},b=k=>{if(!c){d(!0);return}g.length&&p((v+k+g.length)%g.length)};return s.jsxs(s.Fragment,{children:[s.jsx("input",{value:i,placeholder:l("botAccess.addPlaceholder"),"aria-label":l("botAccess.addPlaceholder"),role:"combobox","aria-expanded":y,"aria-controls":m,"aria-autocomplete":"list","aria-activedescendant":y?`${m}-${v}`:void 0,onChange:k=>{o(k.target.value),p(0),d(!0)},onClick:()=>d(!0),onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:k=>{k.key==="ArrowDown"&&(k.preventDefault(),b(1)),k.key==="ArrowUp"&&(k.preventDefault(),b(-1)),k.key==="Enter"&&y&&(k.preventDefault(),w(g[v])),k.key==="Escape"&&c&&(k.preventDefault(),d(!1))},className:"w-full rounded-lg border border-hairline/50 bg-transparent px-3 py-2 text-[14px] text-ink placeholder:text-ink-secondary focus:border-focus focus:outline-none"}),c&&s.jsx("ul",{ref:h,id:m,role:"listbox",onMouseDown:k=>k.preventDefault(),className:I(Jt,"absolute inset-x-5 top-full max-h-[min(240px,40vh)] overflow-y-auto"),children:g.length===0?s.jsx("li",{className:"px-2 py-1.5 text-[13px] text-ink-secondary",children:i.trim()?l("botAccess.noMatch"):l("botAccess.nobodyLeft")}):g.map((k,j)=>s.jsxs("li",{id:`${m}-${j}`,role:"option","aria-selected":j===v,"data-share-suggestion":k.email,onMouseEnter:()=>p(j),onMouseDown:()=>w(k),className:I("flex shrink-0 cursor-pointer items-center gap-3 rounded-md px-2 py-1",j===v&&"bg-menu-hover"),children:[s.jsx(TR,{person:k,size:32}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-[14px] leading-[18px] text-ink",children:k.name}),s.jsx("span",{className:"block truncate text-[12px] leading-4 text-ink-secondary",children:k.email})]})]},k.email))})]})}const ipe=6e3;function H3(){const{state:e}=re(),t=e.config?.team;return typeof t?.name=="string"&&t.name?t.name:null}function ope({bot:e,className:t,headerMenu:n,iconSize:a=16}){const r=H3(),[i,o]=f.useState(!1),[c,d]=f.useState(null),u=f.useCallback(()=>d(null),[]);return r?s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button","data-panel-share":!0,"data-share-bot-button":!0,"aria-label":l("botAccess.share"),title:l("botAccess.share"),"aria-haspopup":"dialog",onClick:()=>o(!0),className:t,children:s.jsx(Uw,{size:a,"aria-hidden":"true",className:"pointer-events-none"})}),i&&s.jsx(tpe,{bot:e,teamName:r,onClose:()=>o(!1),onChanged:d,headerMenu:n}),c&&s.jsx(MR,{text:c.text,onUndo:()=>R3(e.id,c.before),onDone:u},`${c.text}:${JSON.stringify(c.after)}`)]}):null}function MR({text:e,onUndo:t,onDone:n,actionLabel:a=l("common.undo")}){const[r,i]=f.useState(!1);return f.useEffect(()=>{const o=window.setTimeout(n,ipe);return()=>window.clearTimeout(o)},[n]),Ke.createPortal(s.jsxs("div",{role:"status","data-access-toast":!0,className:"fixed bottom-5 left-1/2 z-[70] flex max-w-[min(420px,calc(100vw-32px))] -translate-x-1/2 items-center gap-3 rounded-xl border border-hairline/50 bg-card px-3.5 py-2.5 text-[13px] text-ink shadow-xl",children:[s.jsx("span",{className:"min-w-0 flex-1",children:r?l("botAccess.undoFailed"):e}),!r&&s.jsx("button",{type:"button",onClick:()=>{t().then(n,()=>i(!0))},className:"shrink-0 rounded-md px-1.5 py-0.5 font-medium text-accent hover:bg-raised",children:a})]}),document.body)}const lpe=[{mode:"ask",labelKey:"approvalMode.ask.label",chipKey:"approvalMode.ask.chip",descriptionKey:"approvalMode.ask.desc",Icon:Pw},{mode:"edits",labelKey:"approvalMode.edits.label",chipKey:"approvalMode.edits.chip",descriptionKey:"approvalMode.edits.desc",Icon:gV},{mode:"auto",labelKey:"approvalMode.auto.label",chipKey:"approvalMode.auto.chip",descriptionKey:"approvalMode.auto.desc",Icon:Nx},{mode:"full",labelKey:"approvalMode.full.label",chipKey:"approvalMode.full.chip",descriptionKey:"approvalMode.full.desc",Icon:RY},{mode:"custom",labelKey:"approvalMode.custom.label",chipKey:"approvalMode.custom.chip",descriptionKey:"approvalMode.custom.desc",Icon:Qu}],cpe={ask:"botSettings.simple.ask",edits:"approvalMode.edits.label",auto:"botSettings.simple.decide",full:"botSettings.simple.justDoIt",custom:"botSettings.simple.custom"};function dpe(e,t){return l(cpe[t==="antigravityAgent"&&e==="full"?"auto":e])}function ag(){return lpe.map(({mode:e,labelKey:t,chipKey:n,descriptionKey:a,Icon:r})=>({mode:e,label:l(t),chip:l(n),description:l(a),Icon:r}))}function hh(e,t=!0){return ag().filter(n=>l2(e,n.mode)&&(e!=="antigravityAgent"||n.mode!=="auto")&&(t||n.mode!=="custom")).map(n=>e==="antigravityAgent"&&n.mode==="full"?{...n,label:l("approvalMode.antigravity.label"),chip:l("approvalMode.auto.chip"),description:l("approvalMode.antigravity.desc")}:n.mode==="auto"&&!SX(e)?{...n,description:l("approvalMode.noNativeReview")}:n)}function _R(e,t){return e==="custom"&&!t}function RR(e,t){return e==="antigravityAgent"&&t==="auto"?"ask":t}function upe({approvalMode:e,autoApprove:t,providerName:n,driverKind:a,onSelect:r,align:i="left",menuDirection:o="up",wide:c=!1,busy:d=!1,trustedModesAvailable:u=!0,trustedModesNotice:p,onManageCommandAllowlist:m}){const[h,x]=f.useState(!1),g=ys(h),v=f.useRef(null),y=f.useRef(null),w=RR(a,En({approvalMode:e,autoApprove:t})),b=ag(),k=hh(a).find(S=>S.mode===w)??b.find(S=>S.mode===w)??b[0],j=hh(a,u),N=_R(w,u);f.useEffect(()=>{function S(C){v.current&&!v.current.contains(C.target)&&x(!1)}return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),f.useEffect(()=>{if(!h)return;const S=C=>{C.key==="Escape"&&x(!1)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[h]);const A=k.Icon,T=N,M=m&&s.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{x(!1),y.current?.focus(),m()},className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] text-ink hover:bg-menu-hover",children:[s.jsx(Yu,{size:16,className:"shrink-0 text-ink-secondary"}),l("commandAllowlist.title")]});return s.jsxs("div",{className:I("relative flex items-center",c&&"w-full"),ref:v,children:[s.jsxs("button",{ref:y,type:"button","aria-haspopup":"menu","aria-expanded":h,"aria-label":l("approvalMode.triggerAria",{mode:k.label,provider:n}),title:c?void 0:k.chip,onClick:()=>x(S=>!S),className:I(c?"flex h-10 w-full items-center justify-between rounded-lg border border-hairline/40 bg-inset px-3.5 text-[13px] text-ink hover:bg-raised":"flex size-8 shrink-0 items-center justify-center rounded-full text-ink-secondary hover:bg-control hover:text-ink"),children:[c?s.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(A,{size:14,className:"shrink-0 opacity-70"}),s.jsx("span",{className:"truncate",children:k.label})]}):s.jsx(A,{size:16,className:"shrink-0 opacity-80"}),c&&s.jsx(jt,{size:14,"aria-hidden":!0,className:"shrink-0 text-ink-secondary"})]}),g.shown&&s.jsxs("div",{role:"menu","aria-label":l("approvalMode.menuAria",{provider:n}),...g.exitProps,className:I("absolute z-40 w-[340px] overflow-hidden",Jt,o==="up"?"bottom-full mb-2":"top-full mt-2",i==="right"?"right-0":"left-0",c&&"w-full min-w-[340px]",g.className),children:[s.jsxs("div",{className:"px-2 pb-1 pt-1.5",children:[s.jsx("div",{className:"text-[14px] font-medium text-ink",children:l("approvalMode.question",{provider:n})}),d&&s.jsx("p",{role:"status",className:"mt-1 text-[12px] leading-snug text-ink-secondary",children:l("approvalMode.whileWorking")}),s.jsx("button",{type:"button",onClick:()=>{Dt(AJ)},className:"mt-1 text-[12px] text-ink-secondary underline underline-offset-2 hover:text-ink",children:l("approvalMode.learnMore")})]}),s.jsx("div",{role:"separator",className:oc}),s.jsxs("div",{className:"flex flex-col gap-1",children:[j.map(S=>{const C=S.mode===w,O=S.Icon;return s.jsxs(f.Fragment,{children:[s.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":C,disabled:T,title:N?l("approvalMode.customLocalOnly"):void 0,onClick:()=>{T||(r(S.mode),x(!1))},className:I("flex items-start gap-2 rounded-md px-2 py-1.5 text-left hover:bg-menu-hover",T&&"cursor-not-allowed opacity-45 hover:bg-transparent"),children:[s.jsx(O,{size:16,className:"mt-px shrink-0 text-ink-secondary"}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsxs("span",{className:"flex items-center justify-between gap-3 text-[14px] text-ink",children:[S.label,C&&s.jsx(Se,{size:14,className:"shrink-0"})]}),s.jsx("span",{className:"text-[13px] leading-snug text-ink-secondary",children:S.description})]})]}),S.mode==="full"&&M]},S.mode)}),!j.some(S=>S.mode==="full")&&M,!u&&(p||a==="codex"||N)&&s.jsx("div",{className:"px-2 py-1.5 text-[12px] leading-snug text-ink-tertiary",children:p??l("approvalMode.customLocalOnlyDot")})]})]})]})}function ppe(e,t){return e.filter(n=>n.instanceId===t||n.snapshot.state==="available"&&(n.models.options.length>0||n.snapshot.chatgptPlan===!0))}function qr(e){return e?.access==="custom"}function mpe(e){return e?.modelsUnconfirmed===!0&&e.snapshot.state==="available"&&e.snapshot.authenticated!==!1}function qn(e){if(!(!e||e.access==="api")){if(e.driverKind==="claudeAgent")return"claude";if(e.driverKind==="codex")return"openai"}}const W3={claude:"Claude",openai:"OpenAI"};function Br(e){return qn(e)==="claude"}function K3(e){const t=[],n=[],a=[];for(const r of e){const i=r.access;i==="custom"?a.push(r):i==="api"?n.push(r):t.push(r)}return{subscription:t,api:n,custom:a}}function ri(e){return e.id==="agent-default"&&e.label==="Agent default"?l("model.agentDefault"):e.label}function nm(e,t){const n=e?.models.options.find(a=>a.id===t);return n?ri(n):t}function sm(e,t){return e?.models.options.find(n=>n.id===t)?.provider}function Yy(e,t){const n=t.trim().toLowerCase();return n?e.filter(a=>a.label.toLowerCase().includes(n)||a.id.toLowerCase().includes(n)||(a.provider?.toLowerCase().includes(n)??!1)):[...e]}function OR(e){const t=[],n=[];for(const a of e)a.loaded?t.push(a):n.push(a);return{pinned:t,rest:n}}function LR(e,t,n,a=5){const r=[],i=new Set,o=c=>{!c||i.has(c.id)||r.length>=a||(i.add(c.id),r.push(c))};o(n?e.find(c=>c.id===n):void 0),o(e.find(c=>c.id===t));for(const c of e)o(c);return r}const zR="omb-favorite-models",Jy=new Set,Qy=new Set;let rl=null;const V3=(e,t)=>`${e}
116
116
  ${t}`;function G3(){if(rl)return rl;try{const e=JSON.parse(localStorage.getItem(zR)??"[]");rl=Array.isArray(e)?new Set(e.filter(t=>typeof t=="string")):Jy}catch{rl=Jy}return rl}const fpe=G3;function hpe(e,t){const n=V3(e,t),a=new Set(G3());a.delete(n)||a.add(n),rl=a;try{localStorage.setItem(zR,JSON.stringify([...a]))}catch{}for(const r of Qy)r()}function xpe(){return f.useSyncExternalStore(e=>(Qy.add(e),()=>{Qy.delete(e)}),G3,()=>Jy)}function gpe(e,t,n=!1){return n||!t||/\d/.test(e)||e.toLowerCase().startsWith(t.toLowerCase())?e:`${t} ${e}`}function bpe(e,t){const n=`${t} `;if(!t||e.slice(0,n.length).toLowerCase()!==n.toLowerCase())return e;const a=e.slice(n.length).trimStart();return new RegExp("^\\p{L}{2}","u").test(a)?a:e}const Xy="typed::",ype=/^[A-Za-z0-9][\w.-]{0,63}\/[A-Za-z0-9][\w.:@+/-]{0,199}$/u;function PR(e){const t=e.trim();return ype.test(t)&&!t.endsWith("/")?t:null}function kpe(e){const t=PR(e);return t?`${Xy}${t}`:null}function H1(e){if(!e?.startsWith(Xy))return null;const t=e.slice(Xy.length);return PR(t)===t?t:null}function Y3(e,t){return e.driverKind!=="antigravityAgent"?[...t]:t.flatMap(n=>n.variants?.length?n.variants.map(a=>({...n,id:JSON.stringify([n.id,a.id]),label:`${n.label} · ${a.label}`,nativeModel:n.id,variant:a.id})):[n])}function so(e,t){return(e.nativeModel??e.id)===t.model&&e.variant===t.variant}function vpe(e,t,n){const a={instanceId:t.instanceId,model:n};return t.instanceId===e.instanceId&&(t.capabilities?.modelVariants&&n===e.model&&e.variant!==void 0?a.variant=e.variant:!t.capabilities?.modelVariants&&e.effort&&(a.effort=e.effort)),a}function J3(e){return e?.driverKind==="opencodeGo"}function wpe(e,t,n){return e.map(a=>{if(!J3(a))return a;const r=d=>a.models.options.some(u=>u.id===d),i=a.instanceId===t.instanceId&&H1(t.model)?t.model:null,o=kpe(n),c=[i,o&&!r(H1(o))?o:null].filter((d,u,p)=>d!==null&&!r(d)&&p.indexOf(d)===u);return c.length?{...a,models:{...a.models,options:[...a.models.options,...c.map(d=>({id:d,label:l("model.typedByHand",{id:H1(d)})}))]}}:a})}const jpe=12,Npe=4,Spe=3;function DR(e){const t=qn(e);return t?W3[t]:e.access!=="api"?gt(e):gt(e).replace(/\s*\((?:API key|API|chave de API)\)$/i,"")||gt(e)}function xh(e,t,n){const a=e?.models.options.find(o=>o.id===t);if(!e||!a||n===void 0)return"";const i=Y3(e,[a]).some(o=>so(o,{instanceId:e.instanceId,model:t,variant:n}))?a.variants?.find(o=>o.id===n)?.label:void 0;return i?` · ${i}`:""}function Zy(e,t,n){const a=e?.models.options.find(r=>r.id===t);return!e||!a?t:gpe(ri(a),DR(e),a.custom)+xh(e,t,n)}function Ipe(e){const t=new Set,n=new Set;for(const a of e)(t.has(a.label)?n:t).add(a.label);return n}function Cpe(e){const t=!qr(e)&&ia(e),n=qr(e)||t?[]:Y3(e,e.models.options.filter(r=>!r.custom)),a=OR(e.models.options.filter(r=>r.custom));return{signedOut:t,own:n,all:[...n,...a.pinned,...a.rest]}}function FS(e,t){if(!t)return null;const n=e.findIndex(a=>a.option.custom);return n>=0&&e.slice(n).every(a=>a.option.custom)?n:null}function Epe(e,t){const n=DR(e),a=qn(e);if(e.serverKind==="ollama")return{label:n,provider:n};if(e.access==="api")return{label:`${n} · ${l("model.simple.apiKey")}`,provider:n};const i=a!==void 0&&t.filter(o=>qn(o)===a).length>1&&gt(e)!==n?gt(e):void 0;return{label:i?`${n} · ${i}`:n,provider:n,account:i}}function Ape(e){const{instances:t,selection:n,bot:a,loading:r}=e,i=t.find(h=>h.instanceId===n.instanceId),o=i?.models.options.find(h=>h.id===n.model),c=o?ri(o):n.model,d=B2(o?.local),u={instance:i,label:Zy(i,n.model,n.variant),title:`${i?`${gt(i)} · ${c}${xh(i,n.model,n.variant)}`:c}${d?` · ${d}`:""}`,warning:!1,pending:!1};if(!i)return r?{...u,pending:!0}:{...u,meta:l("model.simple.unavailable"),warning:!0};if(!o&&e.refreshing===i.instanceId)return{...u,pending:!0};if(o?.orgBlocked)return{...u,meta:l("model.orgBlocked"),warning:!0,blocked:!0};if(o?.needsCliUpdate)return{...u,meta:l("engines.updateClaude"),warning:!0,blocked:!0};if(i.policy)return{...u,meta:l("policy.managedBy",{organization:i.policy.organizationName}),warning:!0};if(ts(i))return{...u,meta:l("model.setupRequired"),warning:!0};if(ia(i)&&!qr(i)&&!o?.custom)return{...u,meta:l("model.signInRequired"),warning:!0};if(a.follows===!0)return{...u,meta:l(e.updatesBotDefault?"model.simple.botsModelScope":"model.simple.botsModel",{name:a.name})};const p=qn(i);return(p?t.filter(h=>qn(h)===p).length:0)>1||i.snapshot.chatgptPlan?{...u,meta:gt(i)}:o?.provider||d?{...u,meta:o?.provider??d}:u}function Tpe(e){const{listed:t,selection:n,bot:a,expanded:r,probing:i}=e,o=new Map(t.map(w=>[w.instanceId,Cpe(w)])),d=t.filter(w=>!w.policy&&!ts(w)).reduce((w,b)=>w+o.get(b.instanceId).all.length,0)>jpe||t.some(w=>J3(w)&&!w.policy&&!ts(w)),u=d?e.query.trim():"",{subscription:p,api:m,custom:h}=K3(t),x=[...p,...m,...h],g=x.find(w=>w.instanceId===n.instanceId);function v(w,b){if(w.policy)return u?null:{kind:"policy",organization:w.policy.organizationName,...w.policy.team?{team:!0}:{}};if(ts(w))return u?null:{kind:"setUp"};const{signedOut:k,own:j,all:N}=o.get(w.instanceId);if(N.length===0)return u?null:k?{kind:"signIn"}:{kind:"empty",loading:e.refreshing===w.instanceId};const A=w.instanceId===n.instanceId?n:void 0,T=Ipe(N),M=a.follows===!1&&a.selection.instanceId===w.instanceId?a.selection:void 0,S=R=>{const q=B2(R.local);return{option:R,...R.nativeModel?{model:R.nativeModel}:{},...R.variant?{variant:R.variant}:{},label:bpe(ri(R),b),...T.has(R.label)&&R.provider?{route:R.provider}:{},...q?{detail:q}:{},current:A?so(R,A):!1,blocked:R.orgBlocked===!0||R.needsCliUpdate!==void 0}},C=j.length>0&&j.length<N.length;if(u){const R=Yy(N,u).map(S);return R.length===0?null:{kind:"models",rows:R,total:N.length,toggle:null,localFrom:FS(R,C),signInForOwn:!1,probing:!1}}const O=N.filter(R=>(!A||!so(R,A))&&(!M||!so(R,M))),L=fpe(),D=O.filter(R=>L.has(V3(w.instanceId,R.id))),z=A===void 0?Spe:Npe,P=[...D,...LR(O.filter(R=>!D.includes(R)),w.models.default,void 0,Math.max(0,z-D.length))],$=O.filter(R=>!P.includes(R)),B=(r.has(w.instanceId)||$.length===1?[...P,...$]:P).map(S),W=i.has(w.instanceId)&&j.length===N.length;return B.length===0&&!k&&!W?null:{kind:"models",rows:B,total:N.length,toggle:$.length>1?r.has(w.instanceId)?"less":"more":null,localFrom:FS(B,C),signInForOwn:k,probing:W}}const y=(g?[g,...x.filter(w=>w!==g)]:x).flatMap(w=>{const b=Epe(w,t),k=v(w,b.provider);return k?[{instance:w,...b,body:k}]:[]});return{current:u?null:Ape(e),follow:!u&&a.follows===!1,groups:y,search:d,query:u,results:u?y.reduce((w,b)=>w+(b.body.kind==="models"?b.body.rows.length:0),0):null,empty:t.length>0?null:e.loading?"loading":"none",busy:e.loading||e.refreshing!=null}}const am=6,Go=8,Mpe=480;function _pe(e,t,n,a,r=Mpe){const i=a?.edge??((e.left+e.right)/2>n.width/2?"right":"left"),o=Math.max(0,Math.min(t.width,n.width-Go*2)),c=i==="right"?e.right-o:e.left,d=Math.min(Math.max(c,Go),Math.max(Go,n.width-o-Go)),u=n.height-e.bottom-am-Go,p=e.top-am-Go,m=a?.vertical??(t.height<=u||u>=p?"below":"above"),h=Math.max(0,Math.min(r,m==="below"?u:p)),x=`${m==="below"?"top":"bottom"} ${i}`;return m==="below"?{vertical:m,edge:i,left:d,width:o,top:e.bottom+am,maxHeight:h,origin:x}:{vertical:m,edge:i,left:d,width:o,bottom:n.height-e.top+am,maxHeight:h,origin:x}}const Rpe=5e3;function Ope(e,t,n=Rpe){return new Promise(a=>{const r=setTimeout(a,n);t(e).catch(()=>{}).finally(()=>{clearTimeout(r),a()})})}function US(e,t){return e?t>0||e.driverKind==="claudeAgent"&&!ts(e)&&!e.policy:!1}const $R="https://chatgpt.com/settings/usage";function BR({href:e,className:t,children:n}){return s.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:t,onClick:a=>{window.ogb?.openExternal&&(a.preventDefault(),Dt(e))},children:[l("engineSetup.chatgpt.manageUsage"),n]})}function Lpe({instanceId:e,welcome:t=!0}){const n=`omb:chatgpt-plan-welcome:${e}`,[a,r]=f.useState(()=>{if(!t)return!0;try{return localStorage.getItem(n)==="1"}catch{return!1}}),i=f.useRef(null),o=f.useId();f.useEffect(()=>{!a&&!document.querySelector("dialog[data-chatgpt-plan-welcome][open]")&&i.current?.showModal()},[a]);const c=()=>{try{localStorage.setItem(n,"1")}catch{}i.current?.close(),r(!0)};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{"data-chatgpt-plan-status":!0,className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-ink-secondary",children:[s.jsx("span",{children:l("engineSetup.chatgpt.using")}),s.jsx(BR,{href:$R,className:"inline-flex items-center gap-1 text-accent hover:underline",children:s.jsx(is,{size:11})})]}),!a&&s.jsxs("dialog",{ref:i,"data-chatgpt-plan-welcome":!0,"aria-labelledby":o,className:"m-auto w-[min(420px,calc(100vw-32px))] rounded-2xl border border-hairline bg-panel p-6 text-ink shadow-2xl backdrop:bg-black/50",onKeyDown:d=>{d.key==="Escape"&&d.stopPropagation()},onCancel:d=>{d.preventDefault(),c()},children:[s.jsx(hc,{size:28}),s.jsx("h2",{id:o,className:"mt-4 text-lg font-semibold",children:l("engineSetup.chatgpt.welcome")}),s.jsx("p",{className:"mt-2 text-[13px] leading-relaxed text-ink-secondary",children:l("engineSetup.chatgpt.welcomeBody")}),s.jsx("form",{method:"dialog",onSubmit:d=>{d.preventDefault(),c()},children:s.jsx("button",{type:"submit",className:"mt-5 w-full rounded-lg bg-ink px-4 py-2 text-[13px] font-semibold text-app",children:l("onboarding.spot.gotIt")})})]})]})}const hs=({children:e})=>s.jsx("span",{className:QH,children:e}),ek=()=>s.jsx(it,{size:16,strokeWidth:Vt,className:Xr,"aria-hidden":"true"});function tk({label:e,children:t}){return s.jsxs("span",{"data-simple-model-text":!0,className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"truncate",children:e}),t]})}function zpe({instanceId:e,model:t,name:n}){const a=xpe().has(V3(e,t));return s.jsx("button",{type:"button","data-model-favorite":!0,tabIndex:-1,"aria-pressed":a,"aria-label":l(a?"model.favorite.remove":"model.favorite.add",{name:n}),title:l(a?"model.favorite.remove":"model.favorite.add",{name:n}),onClick:()=>hpe(e,t),className:I("absolute end-1.5 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-md text-ink-tertiary hover:text-ink",a?"opacity-100":"opacity-0 group-hover/model:opacity-100 touch:opacity-100 focus-visible:opacity-100 peer-focus-visible/row:opacity-100"),children:s.jsx(Xd,{size:13,"aria-hidden":"true",className:I(a&&"fill-current")})})}function Ppe({instance:e,row:t,onPick:n}){const{option:a}=t,r=t.blocked?l(a.needsCliUpdate?"chat.claudeUpdate.offer":"model.orgBlocked"):void 0;return s.jsxs("div",{className:"group/model relative",children:[s.jsxs("button",{type:"button","data-menu-row":!0,"data-org-blocked":t.blocked||void 0,disabled:t.blocked,"aria-pressed":t.current,"aria-label":[ri(a),a.provider,t.detail,r].filter(Boolean).join(" · "),title:[ri(a),a.provider,t.detail,r].filter(Boolean).join(" · "),tabIndex:-1,onClick:()=>n(e,t.model??a.id,t.variant),className:I(b0,"peer/row pe-8"),children:[s.jsx(hs,{}),s.jsxs(tk,{label:t.label,children:[t.route&&s.jsx("span",{"data-simple-route":!0,className:wd,children:t.route}),t.detail&&s.jsx("span",{"data-simple-model-detail":!0,className:wd,children:t.detail}),r&&s.jsx("span",{"data-simple-org-blocked":!0,className:wd,children:r})]}),t.current&&s.jsx(Se,{size:14,className:"shrink-0 text-ink","aria-hidden":"true"})]}),!t.blocked&&s.jsx(zpe,{instanceId:e.instanceId,model:a.id,name:ri(a)})]})}function Dpe({group:e,props:t}){const{instance:n,body:a}=e;switch(a.kind){case"policy":return s.jsxs("div",{"data-simple-policy":!0,className:"flex flex-col gap-0.5 py-1 pl-8 pr-2",children:[s.jsx("p",{className:"text-[13px] leading-[18px] text-ink-secondary",children:l("policy.managedBy",{organization:a.organization})}),s.jsx("p",{className:"text-[12px] leading-4 text-ink-tertiary",children:l(a.team?"policy.teamModelBlocked":"policy.modelBlocked",{organization:a.organization})})]});case"setUp":case"signIn":return s.jsxs("button",{type:"button","data-menu-row":!0,"data-simple-set-up":!0,tabIndex:-1,onClick:r=>t.onSetUp(n,r.detail===0),title:l("model.simple.needsSetup",{name:e.account??e.provider}),className:na,children:[s.jsx(hs,{children:a.kind==="setUp"?s.jsx(Rt,{size:16,strokeWidth:Vt,className:dl,"aria-hidden":"true"}):s.jsx(Wa,{size:16,strokeWidth:Vt,className:dl,"aria-hidden":"true"})}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.kind==="setUp"?l("model.simple.setUp"):l("model.simple.signIn")}),s.jsx(ek,{})]});case"empty":return a.loading?s.jsxs("div",{role:"status",className:I(Kd,"text-ink-tertiary"),children:[s.jsx(hs,{children:s.jsx(ke,{size:14,className:"animate-spin","aria-hidden":"true"})}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l("model.loadingModels",{name:e.provider})})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:I(Fm,"pl-8"),children:l("model.simple.noModels")}),s.jsxs("button",{type:"button","data-menu-row":!0,"data-simple-refresh":!0,tabIndex:-1,disabled:t.menu.busy,onClick:()=>t.onCheckAgain(n),className:na,children:[s.jsx(hs,{children:t.menu.busy?s.jsx(ke,{size:14,className:"animate-spin text-ink-secondary","aria-hidden":"true"}):s.jsx(Tt,{size:16,strokeWidth:Vt,className:dl,"aria-hidden":"true"})}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l("common.checkAgain")})]})]});case"models":return s.jsxs(s.Fragment,{children:[a.rows.map((r,i)=>s.jsxs("div",{className:"contents",children:[i===a.localFrom&&s.jsx("div",{className:I(_f,"pl-8 font-normal"),children:l("model.localModels")}),s.jsx(Ppe,{instance:n,row:r,onPick:t.onPick})]},r.option.id)),a.probing&&s.jsxs("div",{role:"status",className:I(Kd,"text-ink-tertiary"),children:[s.jsx(hs,{children:s.jsx(ke,{size:14,className:"animate-spin","aria-hidden":"true"})}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l("model.lookingLocal")})]}),a.signInForOwn&&s.jsxs("button",{type:"button","data-menu-row":!0,"data-simple-sign-in":!0,tabIndex:-1,onClick:r=>t.onSetUp(n,r.detail===0),className:na,children:[s.jsx(hs,{children:s.jsx(Wa,{size:16,strokeWidth:Vt,className:dl,"aria-hidden":"true"})}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l("model.simple.signInForOwn",{name:e.provider})}),s.jsx(ek,{})]}),a.toggle&&s.jsx("div",{className:I(a.toggle==="less"&&"sticky bottom-0 z-[1] -mx-1.5 bg-linear-to-b from-transparent to-menu to-[12px] px-1.5 pt-3"),children:s.jsxs("button",{type:"button","data-menu-row":!0,"data-simple-show-all":!0,tabIndex:-1,"aria-expanded":a.toggle==="less",onClick:()=>t.onToggle(n),className:I(na,"text-ink-secondary hover:text-ink focus:text-ink"),children:[s.jsx(hs,{}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.toggle==="less"?l("model.showSuggested"):l("model.showAll",{count:a.total})}),a.toggle==="less"?s.jsx(vi,{size:16,strokeWidth:Vt,className:Xr,"aria-hidden":"true"}):s.jsx(jt,{size:16,strokeWidth:Vt,className:Xr,"aria-hidden":"true"})]})})]})}}function $pe({thinking:e,labelId:t}){const[n,a]=f.useState(!1);if("variants"in e)return s.jsx("div",{"data-simple-thinking":!0,children:e.variants});const r=e,i=r.current===void 0,o=c=>I("h-8 min-w-0 truncate rounded-full px-1.5 text-[13px] leading-4 transition-colors",c?"bg-ink/[0.1] font-medium text-ink":"text-ink-secondary hover:text-ink");return s.jsxs("div",{"data-simple-thinking":!0,className:"flex flex-col",children:[s.jsxs("button",{type:"button","data-menu-row":!0,"data-simple-thinking-toggle":!0,tabIndex:-1,"aria-expanded":n,"aria-controls":`${t}-steps`,onClick:()=>a(!n),className:I(na,n&&"hover:bg-transparent focus:bg-transparent"),children:[s.jsx(hs,{children:s.jsx(Dw,{size:16,strokeWidth:Vt,className:dl,"aria-hidden":"true"})}),s.jsx("span",{id:t,className:"min-w-0 flex-1 truncate",children:l("botSettings.simple.thinking")}),!n&&s.jsx("span",{className:"shrink-0 text-ink-secondary",children:i?l("model.simple.auto"):fr(r.current)}),n?s.jsx(vi,{size:16,strokeWidth:Vt,className:Xr,"aria-hidden":"true"}):s.jsx(jt,{size:16,strokeWidth:Vt,className:Xr,"aria-hidden":"true"})]}),s.jsxs("div",{id:`${t}-steps`,hidden:!n,children:[s.jsxs("div",{"data-simple-effort":!0,role:"group","aria-labelledby":t,className:"m-1 grid rounded-full bg-ink/[0.05] p-[3px]",style:{gridTemplateColumns:`repeat(${r.levels.length+1}, auto)`},children:[s.jsx("button",{type:"button","data-effort-pill":!0,"data-effort-auto":!0,"aria-pressed":i,tabIndex:i?0:-1,title:l("model.simple.thinkingDefault"),onClick:r.onReset,className:o(i),children:l("model.simple.auto")}),r.levels.map(c=>s.jsx("button",{type:"button","data-effort-pill":!0,"aria-pressed":r.current===c,tabIndex:r.current===c?0:-1,title:l("model.simple.thinkingLevel",{level:fr(c)}),onClick:()=>r.onPick(c),className:o(r.current===c),children:fr(c)},c))]}),s.jsx("p",{"data-simple-effort-auto":i||void 0,className:"px-2 pb-1 text-[12px] leading-4 text-ink-tertiary",children:i?l("model.simple.thinkingAuto"):l(`model.simple.effortHint.${r.current}`)})]})]})}function Bpe(e){const{menu:t,query:n,idPrefix:a}=e,r=t.current,i=!!(r||t.follow);return s.jsxs("div",{"data-simple-model-menu":!0,className:"flex min-h-0 flex-1 flex-col",children:[t.search&&s.jsxs("div",{"data-simple-model-search":!0,className:"group/search flex h-9 shrink-0 items-center gap-2 border-b-[0.5px] border-ink/10 pl-3.5 pr-2",children:[s.jsx(An,{size:16,strokeWidth:Vt,className:"shrink-0 text-ink-tertiary group-focus-within/search:text-ink-secondary","aria-hidden":"true"}),s.jsx("input",{"data-menu-search":!0,value:n,onChange:o=>e.onQuery(o.target.value),placeholder:l("model.search"),"aria-label":t.groups.every(o=>o.instance.access==="custom")?l("model.searchLocal"):l("model.search"),className:"min-w-0 flex-1 bg-transparent text-[13px] leading-[18px] text-ink outline-none placeholder:text-ink-tertiary"}),n&&s.jsx("button",{type:"button","aria-label":l("model.simple.clearSearch"),onClick:()=>e.onQuery(""),className:"flex size-5 shrink-0 items-center justify-center rounded-full text-ink-tertiary hover:bg-ink/[0.06] hover:text-ink",children:s.jsx(Ae,{size:14,strokeWidth:Vt,"aria-hidden":"true"})}),t.results!==null&&s.jsx("span",{role:"status",className:"sr-only",children:l("model.results",{count:t.results})})]}),s.jsx("div",{"data-simple-models":!0,className:I("min-h-0 flex-1 overflow-y-auto overscroll-contain",t.groups.some(o=>o.body.kind==="models"&&o.body.toggle==="less")&&"scroll-pt-8 scroll-pb-12"),children:s.jsxs("div",{className:"flex flex-col gap-0.5 p-1.5",children:[r&&s.jsxs("button",{type:"button","data-menu-row":!0,"data-current-model":!0,"aria-pressed":"true",title:r.title,onClick:o=>{const c=r.warning&&r.instance&&!r.instance.policy&&!r.blocked?r.instance:void 0;c?e.onSetUp(c,o.detail===0):e.onPickCurrent()},className:b0,children:[s.jsx(hs,{children:r.instance?s.jsx($s,{instance:r.instance,size:14,subtle:!0}):s.jsx("span",{className:"size-3.5 rounded-full bg-ink/[0.08]","aria-hidden":"true"})}),s.jsx(tk,{label:r.label,children:r.meta&&s.jsx("span",{className:I(wd,r.warning&&"text-warning"),children:r.meta})}),r.pending&&s.jsx(ke,{size:14,className:"shrink-0 animate-spin text-ink-tertiary","aria-hidden":"true"}),s.jsx(Se,{size:14,className:"shrink-0 text-ink","aria-hidden":"true"})]}),t.follow&&s.jsxs("button",{type:"button","data-menu-row":!0,"data-follow-bot-model":!0,"aria-pressed":"false",tabIndex:-1,title:e.botModel.title,onClick:e.onFollowBot,className:b0,children:[s.jsx(hs,{children:s.jsx(Je,{bot:e.bot,size:16,state:"happy",animated:!1,label:""})}),s.jsx(tk,{label:l("model.useBotModel",{name:e.bot.name}),children:s.jsx("span",{className:wd,children:e.botModel.label})})]}),i&&t.groups.length>0&&s.jsx("div",{role:"separator",className:Bm}),t.groups.map((o,c)=>{const d=`${a}-group-${c}`,u=o.body.kind==="models"&&o.body.toggle==="less";return s.jsxs("div",{role:"group","aria-labelledby":d,"data-simple-provider":o.instance.instanceId,className:I("flex flex-col gap-0.5",c>0&&"mt-1"),children:[s.jsxs("div",{id:d,className:I(_f,u&&"sticky top-0 z-[1] -mx-1.5 bg-menu px-3.5"),children:[s.jsx(hs,{children:s.jsx($s,{instance:o.instance,size:14,subtle:!0})}),s.jsx("span",{className:"min-w-0 truncate",children:o.label})]}),o.note&&s.jsx("p",{className:I(Fm,"pl-8 pt-0"),children:o.note}),s.jsx(Dpe,{group:o,props:e})]},o.instance.instanceId)}),t.empty==="loading"&&s.jsxs("div",{role:"status",className:I(Kd,"text-ink-tertiary"),children:[s.jsx(hs,{children:s.jsx(ke,{size:14,className:"animate-spin","aria-hidden":"true"})}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l("model.simple.lookingModels")})]}),t.empty==="none"&&s.jsx("p",{className:I(Fm,!i&&"pt-2"),children:l("model.noProviders")}),t.results===0&&s.jsx("p",{className:I(Fm,"py-2"),children:l("model.noMatch",{query:t.query})})]})}),(e.thinking||e.onResetVariant||e.onManage)&&s.jsxs("div",{"data-simple-effort-band":!0,className:"flex shrink-0 flex-col gap-0.5 p-1.5 pt-0",children:[s.jsx("div",{role:"separator",className:Bm}),e.thinking&&s.jsxs(s.Fragment,{children:[s.jsx($pe,{thinking:e.thinking,labelId:`${a}-thinking`}),(e.onResetVariant||e.onManage)&&s.jsx("div",{role:"separator",className:Bm})]}),e.onResetVariant&&s.jsxs("button",{type:"button","data-menu-row":!0,"data-simple-variant-default":!0,onClick:e.onResetVariant,className:na,children:[s.jsx(hs,{}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l("model.variant.session")})]}),e.onManage&&s.jsxs("button",{type:"button","data-menu-row":!0,"data-simple-manage":!0,onClick:e.onManage,className:na,children:[s.jsx(hs,{children:s.jsx(Qu,{size:16,strokeWidth:Vt,className:dl,"aria-hidden":"true"})}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:l("model.simple.manage")}),s.jsx(ek,{})]})]})]})}const Fpe={field:"rounded-lg border border-hairline/40 bg-inset text-ink",pill:"h-8 rounded-full border border-hairline/40 bg-raised/60 font-medium text-ink hover:bg-raised",ghost:"h-7 rounded-lg border-[0.5px] [border-color:var(--settings-edge,color-mix(in_srgb,var(--color-ink)_8%,transparent))] bg-transparent text-ink hover:bg-ink/[0.06] [field-sizing:content]",quiet:"rounded-md bg-ink/[0.05] text-ink outline-none hover:bg-ink/[0.08] focus-visible:ring-[1.5px] focus-visible:ring-focus"},qS={select:"pl-2.5 pr-[18px] text-[13px]",chevron:"right-1"},HS={lg:{select:"py-2.5 pl-3 pr-9 text-[15px]",chevron:"right-2"},md:{select:"py-2 pl-3 pr-9 text-[13px]",chevron:"right-2"},sm:{select:"py-1.5 pl-2.5 pr-8 text-[13px]",chevron:"right-1.5"}};function rn({className:e,variant:t="field",size:n="md",...a}){return s.jsxs("div",{className:I("relative inline-flex min-w-0",e),children:[s.jsx("select",{...a,"data-look":"select",className:I("peer w-full min-w-0 cursor-pointer appearance-none truncate [color-scheme:var(--code-color-scheme)] [&_option]:bg-menu [&_option]:text-ink disabled:cursor-default disabled:opacity-50",Fpe[t],t==="ghost"?qS.select:HS[n].select)}),s.jsx(jt,{size:t==="ghost"?12:14,"aria-hidden":!0,className:I("pointer-events-none absolute top-1/2 -translate-y-1/2 text-ink-secondary peer-disabled:opacity-50",t==="ghost"?qS.chevron:HS[n].chevron)})]})}function FR(e){return ts(e)?l("model.setupRequired"):ia(e)?l("model.signInRequired"):e.snapshot.version??l("model.ready")}function nk(e){return l(e.some(b9)?"model.addOrChangeApiKeys":"model.addApiKeys")}function Upe({option:e,current:t,defaultId:n,botModel:a=!1,onPick:r}){const i=e.needsCliUpdate!==void 0,o=e.orgBlocked===!0||i,c=i?l("chat.claudeUpdate.offer"):l("model.orgBlocked"),d=i?l("engines.updateClaude"):o?c:[e.provider,e.id===n?l("model.effort.default"):void 0].filter(Boolean).join(" · ");return s.jsxs("button",{type:"button","data-menu-row":!0,"data-current-model":t||void 0,"data-org-blocked":o||void 0,disabled:o,"aria-pressed":t,"aria-label":o?`${e.label} · ${c}`:void 0,title:o?c:e.provider?l("model.provider",{name:e.provider}):void 0,onClick:r,className:na,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:ri(e)}),a&&s.jsx("span",{"data-bot-model":!0,className:"shrink-0 text-[12px] leading-4 text-ink-tertiary",children:l("model.botModelTag")}),d&&s.jsx("span",{className:XH,children:d}),e.loaded&&s.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[12px] leading-4 text-ink-tertiary",children:[s.jsx("span",{className:"size-1.5 rounded-full bg-success","aria-hidden":"true"}),l("model.loadedNow")]}),t&&s.jsx(Se,{size:14,className:"shrink-0 text-ink","aria-hidden":"true"})]})}function qpe({name:e,model:t,follows:n,onPick:a}){return s.jsxs("button",{type:"button","data-follow-bot-model":!0,"data-menu-row":!0,"aria-pressed":n,onClick:a,className:"flex h-9 w-full shrink-0 items-center justify-between gap-2 border-b-[0.5px] border-ink/10 px-3.5 text-left text-[13px] leading-[18px] text-ink hover:bg-ink/[0.06] focus:bg-ink/[0.06]",children:[s.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[s.jsx("span",{className:"shrink-0 font-medium",children:l("model.useBotModel",{name:e})}),s.jsx("span",{className:"truncate text-[12px] leading-4 text-ink-tertiary",children:t})]}),n&&s.jsx(Se,{size:14,className:"shrink-0 text-ink","aria-hidden":"true"})]})}function Hpe({value:e,onChange:t,local:n}){return s.jsxs("div",{className:"group/search flex h-9 shrink-0 items-center gap-2 border-b-[0.5px] border-ink/10 px-3.5",children:[s.jsx(An,{size:16,strokeWidth:Vt,className:"shrink-0 text-ink-tertiary group-focus-within/search:text-ink-secondary","aria-hidden":"true"}),s.jsx("input",{"data-menu-search":!0,value:e,onChange:a=>t(a.target.value),placeholder:l("model.search"),"aria-label":n?l("model.searchLocal"):l("model.search"),className:"min-w-0 flex-1 bg-transparent text-[13px] leading-[18px] text-ink outline-none placeholder:text-ink-tertiary"})]})}function Wpe(e,t,n,a){const r={claude:e.find(m=>Br(m)&&m.claudeAccount?.isDefault)??e.find(Br),openai:e.find(m=>qn(m)==="openai")},i={claude:n,openai:a},o=e.filter(m=>{const h=qn(m);return!h||m===r[h]}),c=m=>{const h=qn(m);return{instance:m,target:h?i[h]??m:m,label:h?W3[h]:gt(m),selected:h?qn(t)===h:m.instanceId===t?.instanceId}},{subscription:d,api:u,custom:p}=K3(o);return{subscription:d.map(c),api:u.map(c),custom:p.map(c)}}const W1="pb-0.5 text-center text-[11px] leading-[14px] text-ink-tertiary";function Kpe({instances:e,selectedInstance:t,claudeInstance:n,openaiInstance:a,onSelect:r,onAddApiKeys:i}){const{subscription:o,api:c,custom:d}=Wpe(e,t,n,a),u=({instance:p,target:m,selected:h,label:x})=>{const g=ts(m)||ia(m)||!!m.snapshot.update,v=m.policy?l("policy.managedBy",{organization:m.policy.organizationName}):void 0;return s.jsxs("button",{type:"button",onClick:()=>r(m),"aria-label":v?`${x} · ${v}`:x,"aria-pressed":h,title:`${x} · ${v??FR(m)}`,className:I("group relative flex size-9 shrink-0 items-center justify-center rounded-[8px]",h?"bg-ink/[0.08]":"hover:bg-ink/[0.06]",v&&"opacity-40"),children:[s.jsx($s,{instance:m,size:18,subtle:!h}),m.access==="api"&&s.jsx("span",{"data-rail-key-badge":!0,className:"absolute bottom-0 left-0 flex size-3.5 items-center justify-center rounded-full bg-menu text-ink-secondary",children:s.jsx(os,{size:9,"aria-hidden":"true"})}),g&&s.jsx("span",{className:"absolute bottom-0.5 right-0.5 size-1.5 rounded-full bg-warning ring-2 ring-menu"})]},p.instanceId)};return s.jsxs("div",{className:"flex w-14 shrink-0 flex-col gap-1 overflow-y-auto border-r-[0.5px] border-ink/10 p-2",children:[o.length>0&&s.jsx("div",{className:I(W1,"pt-0.5"),children:l("model.rail.cloud")}),o.map(u),(c.length>0||i)&&s.jsx("div",{className:I(W1,o.length>0?"pt-2":"pt-0.5"),children:l("model.rail.apiKeys")}),c.map(u),i&&s.jsx("button",{type:"button","data-rail-add-api-key":!0,onClick:i,"aria-label":nk(e),title:nk(e),className:"flex size-9 shrink-0 items-center justify-center rounded-[8px] border border-dashed border-ink/20 text-ink-tertiary hover:bg-ink/[0.06] hover:text-ink",children:s.jsx(Mn,{size:16,strokeWidth:Vt,"aria-hidden":"true"})}),d.length>0&&s.jsx("div",{className:I(W1,"pt-2"),children:l("model.rail.local")}),d.map(u)]})}function WS({accounts:e,selectedId:t,onSelect:n}){return s.jsxs("label",{className:"mt-2 flex min-w-0 items-center gap-2 text-[12px] leading-4 text-ink-secondary",children:[s.jsxs("span",{children:[l("model.account"),":"]}),s.jsx(rn,{size:"sm",variant:"quiet",className:"flex-1","aria-label":l("model.account"),value:t,onChange:a=>{const r=e.find(i=>i.instanceId===a.target.value);r&&n(r)},children:e.map(a=>s.jsx("option",{value:a.instanceId,children:gt(a)},a.instanceId))})]})}const UR=500;function Vpe(e,t,n){return{text:e&&n-e.at<UR?e.text+t:t,at:n}}function Gpe(e,t,n){const a=n.toLowerCase(),r=[...a].every(c=>c===a[0]),i=r?a.slice(0,1):a,o=r?t+1:Math.max(t,0);for(let c=0;c<e.length;c++){const d=(o+c)%e.length;if(e[d].trim().toLowerCase().startsWith(i))return d}return null}function Ype(e){return e.key.length===1&&e.key!==" "&&!e.ctrlKey&&!e.metaKey&&!e.altKey}const Jpe="button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex]",Qpe="[data-simple-set-up], [data-simple-sign-in], [data-simple-manage], [data-model-local-entry]";function Xpe(e,{query:t,typed:n,close:a}){if(!(e.target instanceof HTMLElement))return;const r=e.currentTarget,i=e.target,o=()=>{e.preventDefault(),e.stopPropagation()};if(e.key==="Tab"){const A=[...r.querySelectorAll(Jpe)].filter(M=>M!==i&&M.tabIndex>=0&&!M.closest("[hidden]")),T=(M,S)=>!!(M.compareDocumentPosition(S)&Node.DOCUMENT_POSITION_FOLLOWING);A.some(M=>e.shiftKey?T(M,i):T(i,M))||(o(),a());return}if(i instanceof HTMLSelectElement)return;const c=getComputedStyle(r).direction==="rtl",d=i.closest("[data-simple-effort]");if(d){const A=[...d.querySelectorAll("button:not(:disabled)")],T={ArrowRight:c?"ArrowUp":"ArrowDown",ArrowLeft:c?"ArrowDown":"ArrowUp",Home:"Home",End:"End"}[e.key],M=T?mh(T,A.indexOf(i),A.length):null;M!==null&&(o(),A[M]?.focus());return}const u=c?"ArrowLeft":"ArrowRight",p=i.matches("[data-model-favorite]")?i:null,m=p?.parentElement?.querySelector("[data-menu-row]")??null;if(p){if(!m||e.key==="Enter"||e.key===" ")return;if(e.key===(c?"ArrowRight":"ArrowLeft")){o(),m.focus({preventScroll:!0});return}}else if(e.key===u&&i.matches("[data-menu-row]")){const A=i.parentElement?.querySelector(":scope > [data-model-favorite]");if(A){o(),A.focus({preventScroll:!0});return}}const h=m??i,x=r.querySelector("[data-menu-search]");if(i instanceof HTMLInputElement&&i!==x)return;const g=[...r.querySelectorAll("[data-menu-row]:not(:disabled)")],v=x?g.filter(A=>x.compareDocumentPosition(A)&Node.DOCUMENT_POSITION_FOLLOWING):[],y=x?g.filter(A=>!v.includes(A)):[],w=A=>{o(),A?.focus({preventScroll:!0}),A?.scrollIntoView?.({block:"nearest"})};if(i===x){e.key==="ArrowDown"?w(v[0]):e.key==="ArrowUp"&&y.length>0?w(y.at(-1)):e.key==="Enter"&&(o(),t.trim()&&g.find(A=>A.hasAttribute("aria-pressed")&&!A.hasAttribute("data-follow-bot-model"))?.click());return}const b=g.indexOf(h);if(b<0&&h!==r)return;if(e.key==="Enter"&&b>=0){o(),h.click();return}if(x&&(e.key==="ArrowUp"&&h===v[0]||e.key==="ArrowDown"&&h===y.at(-1)))return w(x);const k=mh(e.key,b,g.length);if(k!==null)return w(g[k]);if(e.key===(c?"ArrowLeft":"ArrowRight")&&b>=0&&g[b].matches(Qpe)){o(),g[b].click();return}const j=e.key===" "&&n.current!==null&&e.timeStamp-n.current.at<UR;if(!Ype(e)&&!j)return;if(x){x.focus();return}j&&o(),n.current=Vpe(n.current,e.key,e.timeStamp);const N=Gpe(g.map(A=>A.textContent??""),b,n.current.text);N!==null&&w(g[N])}function Zpe(e){if(e.pointerType!=="mouse"||!(e.target instanceof Element))return;const t=e.target.closest("[data-menu-row]"),n=document.activeElement;!t||t===n||t.matches(":disabled")||!(n instanceof HTMLElement)||n.matches("[data-menu-row]")&&e.currentTarget.contains(n)&&t.focus({preventScroll:!0})}const KS={off:"model.effort.off",on:"model.variant.on",none:"model.effort.none",low:"model.effort.low",medium:"model.effort.medium",high:"model.effort.high",xhigh:"model.effort.xhigh",max:"model.effort.max"},hd=(e,t)=>e.id==="default"&&t==="opencodeGo"?l("model.variant.openCodeDefault"):t==="openai-compat"&&Object.hasOwn(KS,e.id)?l(KS[e.id]):e.label;function Q3(e,t,n){const a=e.instances.find(c=>c.instanceId===t.instanceId);if(!a?.capabilities?.modelVariants)return null;const r=n===void 0?void 0:e.modelVariantSessions[n],i=r?.instanceId===t.instanceId&&r.model===t.model?r.variants:void 0,o=i?.options??a.models.options.find(c=>c.id===t.model)?.variants??[];return!o.length&&t.variant===void 0?null:{instance:a,reported:i,options:o}}function qR(e,t,n,a){return t.capabilities?.modelVariants?!!Q3(e,n,a):!!t.capabilities?.effortLevels?.length}function eme(e,t,n,a){if(!t.busy)return!1;const r=n?void 0:e.instances.find(i=>i.instanceId===t.modelSelection.instanceId);return!(r&&qR(e,r,t.modelSelection,a??t.threadId))}function tme(e,t,n,a){const r=f.useRef(!1);return f.useEffect(()=>{if(!r.current)return;r.current=!1;const i=e.current;!t||!i||i.contains(document.activeElement)||(i.querySelector(':not([hidden]) > [data-simple-effort] [tabindex="0"]')??i).focus({preventScroll:!0})},[n,a,t,e]),()=>{r.current=!0}}function nme({bot:e,threadId:t,updateBotDefault:n,variants:a}){return s.jsxs("div",{"data-model-busy":!0,className:"flex flex-col py-1",children:[s.jsx(tO,{compact:!0,bot:e,threadId:t,updateBotDefault:n,className:"px-3.5 py-[5px]",label:s.jsx("span",{className:"text-[13px] leading-[18px] text-ink",children:a?l("model.simple.reasoning"):l("model.section.effort")})}),t&&s.jsx("p",{"data-model-busy-scope":!0,className:"px-3.5 py-1 text-[12px] leading-4 text-ink-tertiary",children:l(n?"model.scope.botHelp":"model.scope.threadHelp")}),s.jsx("p",{className:"px-3.5 py-1 text-[12px] leading-4 text-ink-tertiary",children:l("model.reasoningNextTurn")}),s.jsx("p",{className:"px-3.5 py-1 text-[12px] leading-4 text-ink-tertiary",children:l(t?"model.threadBusy":"model.busy")})]})}const X3="@max-4xl/chathead:size-[30px] @max-4xl/chathead:justify-center @max-4xl/chathead:gap-0 @max-4xl/chathead:p-0",sme="@max-4xl/chathead:size-[30px] @max-4xl/chathead:justify-center @max-4xl/chathead:gap-0 @max-4xl/chathead:rounded-md @max-4xl/chathead:p-0",ame=500,rme=8;let Ki=null,Hr=new Map,ime=0;const ome=e=>`${e.botId}
117
117
  ${e.threadId}`,El=(e,t)=>{const n=new Map(Hr);t?n.set(e,{...t,version:++ime}):n.delete(e),Hr=n,Z3()};let lme=0;const sk=new Set,ak=new Set,Z3=()=>{for(const e of Array.from(ak))e()},HR=e=>(ak.add(e),()=>{ak.delete(e)}),WR=e=>`${e.threadId}
@@ -181,14 +181,14 @@ ${i}`:t.push(i)};for(const i of e.split(`
181
181
  `);var W=0,R=!1;this.parse=function(q,F,E){if(typeof q!="string")throw new Error("Input must be a string");var H=q.length,U=S.length,V=C.length,G=O.length,Q=T(L),Y=[],oe=[],X=[],J=W=0;if(!q)return he();if(z||z!==!1&&q.indexOf(_)===-1){for(var pe=q.split(C),se=0;se<pe.length;se++){if(X=pe[se],W+=X.length,se!==pe.length-1)W+=C.length;else if(E)return he();if(!O||X.substring(0,G)!==O){if(Q){if(Y=[],de(X.split(S)),we(),R)return he()}else de(X.split(S));if(D&&D<=se)return Y=Y.slice(0,D),he(!0)}}return he()}for(var ee=q.indexOf(S,W),ie=q.indexOf(C,W),ge=new RegExp(y(B)+y(_),"g"),Z=q.indexOf(_,W);;)if(q[W]===_)for(Z=W,W++;;){if((Z=q.indexOf(_,Z+1))===-1)return E||oe.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Y.length,index:W}),_e();if(Z===H-1)return _e(q.substring(W,Z).replace(ge,_));if(_===B&&q[Z+1]===B)Z++;else if(_===B||Z===0||q[Z-1]!==B){ee!==-1&&ee<Z+1&&(ee=q.indexOf(S,Z+1));var le=Ie((ie=ie!==-1&&ie<Z+1?q.indexOf(C,Z+1):ie)===-1?ee:Math.min(ee,ie));if(q.substr(Z+1+le,U)===S){X.push(q.substring(W,Z).replace(ge,_)),q[W=Z+1+le+U]!==_&&(Z=q.indexOf(_,W)),ee=q.indexOf(S,W),ie=q.indexOf(C,W);break}if(le=Ie(ie),q.substring(Z+1+le,Z+1+le+V)===C){if(X.push(q.substring(W,Z).replace(ge,_)),te(Z+1+le+V),ee=q.indexOf(S,W),Z=q.indexOf(_,W),Q&&(we(),R))return he();if(D&&Y.length>=D)return he(!0);break}oe.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Y.length,index:W}),Z++}}else if(O&&X.length===0&&q.substring(W,W+G)===O){if(ie===-1)return he();W=ie+V,ie=q.indexOf(C,W),ee=q.indexOf(S,W)}else if(ee!==-1&&(ee<ie||ie===-1))X.push(q.substring(W,ee)),W=ee+U,ee=q.indexOf(S,W);else{if(ie===-1)break;if(X.push(q.substring(W,ie)),te(ie+V),Q&&(we(),R))return he();if(D&&Y.length>=D)return he(!0)}return _e();function de(ae){Y.push(ae),J=W}function Ie(ae){var fe=0;return fe=ae!==-1&&(ae=q.substring(Z+1,ae))&&ae.trim()===""?ae.length:fe}function _e(ae){return E||(ae===void 0&&(ae=q.substring(W)),X.push(ae),W=H,de(X),Q&&we()),he()}function te(ae){W=ae,de(X),X=[],ie=q.indexOf(C,W)}function he(ae){if(M.header&&!F&&Y.length&&!$){var fe=Y[0],je=Object.create(null),Me=new Set(fe);let me=!1;for(let Ne=0;Ne<fe.length;Ne++){let ve=u(fe[Ne]);if(je[ve=T(M.transformHeader)?M.transformHeader(ve,Ne):ve]){let be,Te=je[ve];for(;be=ve+"_"+Te,Te++,Me.has(be););Me.add(be),fe[Ne]=be,je[ve]++,me=!0,(P=P===null?{}:P)[be]=ve}else je[ve]=1,fe[Ne]=ve;Me.add(ve)}me&&console.warn("Duplicate headers found and renamed."),$=!0}return{data:Y,errors:oe,meta:{delimiter:S,linebreak:C,aborted:R,truncated:!!ae,cursor:J+(F||0),renamedHeaders:P}}}function we(){L(he()),Y=[],oe=[]}},this.abort=function(){R=!0},this.getCharIndex=function(){return W}}function b(M){var S=M.data,C=o[S.workerId],O=!1;if(S.error)C.userError(S.error,S.file);else if(S.results&&S.results.data){var L={abort:function(){O=!0,k(S.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:j,resume:j};if(T(C.userStep)){for(var D=0;D<S.results.data.length&&(C.userStep({data:S.results.data[D],errors:S.results.errors,meta:S.results.meta},L),!O);D++);delete S.results}else T(C.userChunk)&&(C.userChunk(S.results,L,S.file),delete S.results)}S.finished&&!O&&k(S.workerId,S.results)}function k(M,S){var C=o[M];T(C.userComplete)&&C.userComplete(S),C.terminate(),delete o[M]}function j(){throw new Error("Not implemented.")}function N(M){if(typeof M!="object"||M===null)return M;var S,C=Array.isArray(M)?[]:{};for(S in M)C[S]=N(M[S]);return C}function A(M,S){return function(){M.apply(S,arguments)}}function T(M){return typeof M=="function"}return d.parse=function(M,S){var C=(S=S||{}).dynamicTyping||!1;if(T(C)&&(S.dynamicTypingFunction=C,C={}),S.dynamicTyping=C,S.transform=!!T(S.transform)&&S.transform,S.downloadTimeout!==void 0){var C=parseInt(S.downloadTimeout);if(isNaN(C))throw new Error("Config downloadTimeout value ("+S.downloadTimeout+") not parsable by parseInt(val).");S.downloadTimeout=C}if(!S.worker||!d.WORKERS_SUPPORTED)return C=null,d.NODE_STREAM_INPUT,typeof M=="string"?(M=u(M),C=new(S.download?m:x)(S)):M.readable===!0&&T(M.read)&&T(M.on)?C=new g(S):(a.File&&M instanceof File||M instanceof Object)&&(C=new h(S)),C.stream(M);(C=(()=>{var O;return!!d.WORKERS_SUPPORTED&&(O=(()=>{var L=a.URL||a.webkitURL||null,D=n.toString();return d.BLOB_URL||(d.BLOB_URL=L.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",D,")();"],{type:"text/javascript"})))})(),(O=new a.Worker(O)).onmessage=b,O.id=c++,o[O.id]=O)})()).userStep=S.step,C.userChunk=S.chunk,C.userComplete=S.complete,C.userError=S.error,S.step=T(S.step),S.chunk=T(S.chunk),S.complete=T(S.complete),S.error=T(S.error),delete S.worker,C.postMessage({input:M,config:S,workerId:C.id})},d.unparse=function(M,S){var C=!1,O=!0,L=",",D=`\r
182
182
  `,z='"',P=z+z,$=!1,_=null,B=!1,W=((()=>{if(typeof S=="object"){if(typeof S.delimiter!="string"||d.BAD_DELIMITERS.filter(function(F){return S.delimiter.indexOf(F)!==-1}).length||(L=S.delimiter),typeof S.quotes!="boolean"&&typeof S.quotes!="function"&&!Array.isArray(S.quotes)||(C=S.quotes),typeof S.skipEmptyLines!="boolean"&&typeof S.skipEmptyLines!="string"||($=S.skipEmptyLines),typeof S.newline=="string"&&(D=S.newline),typeof S.quoteChar=="string"&&(z=S.quoteChar,P=z+z),typeof S.header=="boolean"&&(O=S.header),Array.isArray(S.columns)){if(S.columns.length===0)throw new Error("Option columns is empty");_=S.columns}S.escapeChar!==void 0&&(P=S.escapeChar+z),S.escapeFormulae instanceof RegExp?B=S.escapeFormulae:typeof S.escapeFormulae=="boolean"&&S.escapeFormulae&&(B=/^[=+\-@\t\r].*$/)}})(),new RegExp(y(z),"g"));if(typeof M=="string"&&(M=JSON.parse(M)),Array.isArray(M)){if(!M.length||Array.isArray(M[0]))return R(null,M,$);if(typeof M[0]=="object")return R(_||Object.keys(M[0]),M,$)}else if(typeof M=="object")return typeof M.data=="string"&&(M.data=JSON.parse(M.data)),Array.isArray(M.data)&&(M.fields||(M.fields=M.meta&&M.meta.fields||_),M.fields||(M.fields=Array.isArray(M.data[0])?M.fields:typeof M.data[0]=="object"?Object.keys(M.data[0]):[]),Array.isArray(M.data[0])||typeof M.data[0]=="object"||(M.data=[M.data])),R(M.fields||[],M.data||[],$);throw new Error("Unable to serialize unrecognized input");function R(F,E,H){var U="",V=(typeof F=="string"&&(F=JSON.parse(F)),typeof E=="string"&&(E=JSON.parse(E)),Array.isArray(F)&&0<F.length),G=!Array.isArray(E[0]);if(V&&O){for(var Q=0;Q<F.length;Q++)0<Q&&(U+=L),U+=q(F[Q],Q);0<E.length&&(U+=D)}for(var Y=0;Y<E.length;Y++){var oe=(V?F:E[Y]).length,X=!1,J=V?Object.keys(E[Y]).length===0:E[Y].length===0;if(H&&!V&&(X=H==="greedy"?E[Y].join("").trim()==="":E[Y].length===1&&E[Y][0].length===0),H==="greedy"&&V){for(var pe=[],se=0;se<oe;se++){var ee=G?F[se]:se;pe.push(E[Y][ee])}X=pe.join("").trim()===""}if(!X){for(var ie=0;ie<oe;ie++){0<ie&&!J&&(U+=L);var ge=V&&G?F[ie]:ie;U+=q(E[Y][ge],ie)}Y<E.length-1&&(!H||0<oe&&!J)&&(U+=D)}}return U}function q(F,E){var H,U,V;return F==null?"":F.constructor===Date?isNaN(F.getTime())?"":F.toISOString():(V=!1,B&&typeof F=="string"&&B.test(F)&&(F="'"+F,V=!0),U=(H=F.toString()).replace(W,P),(V=V||C===!0||typeof C=="function"&&C(F,E)||Array.isArray(C)&&C[E]||((G,Q)=>{for(var Y=0;Y<Q.length;Y++)if(-1<G.indexOf(Q[Y]))return!0;return!1})(U,d.BAD_DELIMITERS)||-1<U.indexOf(L)||-1<H.indexOf(z)||U.charAt(0)===" "||U.charAt(U.length-1)===" ")?z+U+z:U)}},d.RECORD_SEP="",d.UNIT_SEP="",d.BYTE_ORDER_MARK="\uFEFF",d.BAD_DELIMITERS=["\r",`
183
183
  `,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!r&&!!a.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=w,d.ParserHandle=v,d.NetworkStreamer=m,d.FileStreamer=h,d.StringStreamer=x,d.ReadableStreamStreamer=g,i&&(a.onmessage=function(M){M=M.data,d.WORKER_ID===void 0&&M&&(d.WORKER_ID=M.workerId),typeof M.input=="string"?a.postMessage({workerId:d.WORKER_ID,results:d.parse(M.input,M.config),finished:!0}):(a.File&&M.input instanceof File||M.input instanceof Object)&&(M=d.parse(M.input,M.config))&&a.postMessage({workerId:d.WORKER_ID,results:M,finished:!0})}),(m.prototype=Object.create(p.prototype)).constructor=m,(h.prototype=Object.create(p.prototype)).constructor=h,(x.prototype=Object.create(x.prototype)).constructor=x,(g.prototype=Object.create(p.prototype)).constructor=g,d})})(yf)),yf.exports}var P4e=z4e();const D4e=gw(P4e),$4e=10*1024*1024;function rC(e){return/\.csv$/i.test(e)?",":/\.tsv$/i.test(e)?" ":null}const iC=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),B4e=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;function ov(e){return B4e.test(e.trim())}const F4e=/^[+-]?[$€£¥₹]?\d{1,3}(?:,?\d{3})*(?:\.\d+)?%?$/;function U4e(e){return ov(e)||F4e.test(e.trim())}function q4e(e,t,n){const a=t.trim().toLocaleLowerCase(),r=e.flatMap((i,o)=>!a||i.some(c=>c.toLocaleLowerCase().includes(a))?[o]:[]);return n&&r.sort((i,o)=>{const c=e[i][n.column]??"",d=e[o][n.column]??"";if(!c.trim()||!d.trim())return+!c.trim()-+!d.trim()||i-o;const u=ov(c)&&ov(d);let p;if(u&&/^[+-]?\d+$/.test(c.trim())&&/^[+-]?\d+$/.test(d.trim())){const m=BigInt(c.trim()),h=BigInt(d.trim());p=m<h?-1:m>h?1:0}else p=u?Number(c)-Number(d):iC.compare(c,d);return(Number.isFinite(p)?p:iC.compare(c,d))*(n.descending?-1:1)||i-o}),r}const H4e=/^(?![+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$)[=+\-@\t\r]/i;function W4e(e,t){return D4e.unparse([e,...t],{newline:`\r
184
- `,escapeFormulae:H4e})}const K4e=4,V4e=12,G4e=7.5,Y4e=100;function J4e(e,t){return e.map((n,a)=>{let r=0;for(const i of[n,...t.slice(0,Y4e).map(o=>o[a]??"")])for(const o of i.split(/\s+/))r=Math.max(r,[...o].length);return Math.round(Math.min(V4e,Math.max(K4e,r))*G4e)})}const Q4e=24;function X4e({wrap:e,virtual:t,minimums:n=[],available:a=null}){return!e||t?!1:a===null||n.reduce((r,i)=>r+i+Q4e,0)<=a}function g5({title:e,onClose:t,children:n,returnFocus:a}){const r=f.useRef(null),i=f.useId();return f.useEffect(()=>{const o=r.current;return o.showModal(),()=>{o.close(),a?.isConnected&&a.focus()}},[a]),Ke.createPortal(s.jsxs("dialog",{ref:r,"aria-labelledby":i,onCancel:t,onClose:t,onKeyDown:o=>{o.key==="Escape"&&o.stopPropagation()},className:"m-auto flex max-h-[94dvh] w-[min(96vw,1400px)] max-w-none flex-col overflow-hidden rounded-2xl border border-hairline bg-panel p-0 text-ink shadow-2xl backdrop:bg-black/55",children:[s.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-hairline/40 px-4 py-3",children:[s.jsx("h2",{id:i,className:"min-w-0 truncate text-sm font-medium",children:e}),s.jsx("button",{type:"button",autoFocus:!0,onClick:t,className:"table-action","aria-label":l("table.close"),children:s.jsx(Ae,{size:16})})]}),s.jsx("div",{className:"min-h-0 overflow-auto p-3 sm:p-5",children:n})]}),document.body)}const oC=8,Z4e="group/table relative w-fit min-w-[min(100%,20rem)] max-w-full overflow-hidden rounded-[18px] bg-card text-ink touch:pt-11";function b5({columns:e,rows:t,name:n=l("table.title"),expanded:a=!1,direction:r="ltr",headless:i=!1,card:o=!0}){const c=!nt(),[d,u]=f.useState(""),p=f.useDeferredValue(d),[m,h]=f.useState(null),[x,g]=f.useState(!0),[v,y]=f.useState(!1),w=f.useRef(null),[b,k]=f.useState("idle"),j=f.useMemo(()=>t.map(z=>z.map(P=>P.text)),[t]),N=f.useMemo(()=>q4e(j,p,m),[j,p,m]);f.useEffect(()=>{if(b==="idle")return;const z=setTimeout(()=>k("idle"),2500);return()=>clearTimeout(z)},[b]);const A=()=>W4e(e.map(z=>z.text),N.map(z=>j[z])),T=async()=>{const z=await aa(A());z!=="empty"&&k(z)},M=()=>{const z=URL.createObjectURL(new Blob(["\uFEFF",A()],{type:"text/csv;charset=utf-8"})),P=document.createElement("a");P.href=z,P.download=`${n.replace(/\.(csv|tsv)$/i,"").replace(/[\\/:*?"<>|]/g,"_").slice(0,150)||"table"}.csv`,P.click(),setTimeout(()=>URL.revokeObjectURL(z),1e3)},S=b!=="idle"&&s.jsx("span",{role:b==="failed"?"alert":"status",className:"sr-only",children:l(b==="failed"?"table.copyFailed":"table.copied")}),C=z=>s.jsxs("label",{className:z,children:[s.jsx(An,{size:13,"aria-hidden":"true"}),s.jsx("input",{value:d,onChange:P=>u(P.target.value),"aria-label":l("table.search"),placeholder:l("table.search"),className:"w-full min-w-0 bg-transparent py-1 text-xs text-ink outline-none placeholder:text-ink-tertiary focus-visible:ring-1 focus-visible:ring-accent"})]}),O=z=>h(m?.column!==z?{column:z,descending:!1}:m.descending?null:{column:z,descending:!0}),L=()=>s.jsxs("div",{"data-table-card":!0,className:Z4e,dir:"ltr",children:[s.jsxs("div",{className:"table-plate absolute end-1.5 top-1.5 z-20 flex items-center gap-0.5 rounded-full bg-composer p-0.5 opacity-0 ring-[0.5px] ring-ink/10 transition-opacity focus-within:opacity-100 group-hover/table:opacity-100 touch:end-1 touch:top-0 touch:bg-transparent touch:p-0 touch:opacity-100 touch:ring-0",children:[s.jsx("button",{type:"button",className:"table-action !rounded-full","aria-label":l("table.copyPlain"),title:l("table.copyPlain"),onClick:()=>{T()},children:b==="copied"?s.jsx(Se,{size:14}):s.jsx(Qt,{size:14})}),s.jsx("button",{type:"button",className:"table-action !rounded-full","aria-label":l("table.download"),title:l("table.download"),onClick:M,children:s.jsx(Rt,{size:14})}),s.jsx("button",{type:"button",className:"table-action !rounded-full","aria-label":l("table.expand"),title:l("table.expand"),onClick:z=>{w.current=z.currentTarget,y(!0)},children:s.jsx(Qd,{size:14})})]}),t.length>oC&&s.jsxs("div",{className:"flex items-center gap-2 px-4 pb-1.5 text-ink-tertiary",children:[C("flex min-w-24 flex-1 items-center gap-2"),s.jsx("span",{role:"status",className:"shrink-0 text-[12px] tabular-nums",children:l("table.count",{shown:N.length.toLocaleString(),total:t.length.toLocaleString(),columns:e.length})})]}),s.jsx(lC,{columns:e,rows:t,order:N,name:n,wrap:x,large:!1,sort:m,direction:r,headless:i,look:"card",onSort:O}),S]}),D=z=>{if(c&&o&&!z)return L();const P=!z&&t.length<=oC,$=s.jsxs(s.Fragment,{children:[!P&&s.jsx("button",{type:"button",className:"table-action","aria-label":l("table.wrap"),title:l("table.wrap"),"aria-pressed":x,onClick:()=>g(!x),children:s.jsx(Zd,{size:14})}),s.jsx("button",{type:"button",className:"table-action","aria-label":l("table.copy"),title:l("table.copy"),onClick:()=>{T()},children:b==="copied"?s.jsx(Se,{size:14}):s.jsx(Qt,{size:14})}),s.jsx("button",{type:"button",className:"table-action","aria-label":l("table.download"),title:l("table.download"),onClick:M,children:s.jsx(Rt,{size:14})}),!z&&s.jsx("button",{type:"button",className:"table-action","aria-label":l("table.expand"),title:l("table.expand"),onClick:_=>{w.current=_.currentTarget,y(!0)},children:s.jsx(Qd,{size:14})})]});return s.jsxs("div",{className:I("rich-table w-fit min-w-[min(100%,var(--chat-prose-max))] max-w-full overflow-hidden rounded-xl border border-hairline/50 text-ink",c?"bg-composer":"bg-panel"),dir:"ltr",children:[!P&&s.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-hairline/40 px-2 py-1.5",children:[C("flex min-w-24 flex-1 items-center gap-2 px-1 text-ink-secondary"),$]}),s.jsx(lC,{columns:e,rows:t,order:N,name:n,wrap:x,large:z,sort:m,direction:r,headless:i,look:c?"quiet":"panel",onSort:O}),s.jsxs("footer",{className:P?"flex items-center justify-end gap-0.5 border-t border-hairline/30 px-1.5 py-1 text-[11px] text-ink-tertiary":"flex flex-wrap items-center justify-between gap-2 border-t border-hairline/40 px-3 py-2 text-[11px] text-ink-secondary",children:[!P&&s.jsx("span",{role:"status",children:l("table.count",{shown:N.length.toLocaleString(dt()),total:t.length.toLocaleString(dt()),columns:e.length})}),b!=="idle"&&s.jsx("span",{role:b==="failed"?"alert":"status",className:P?"me-auto ps-1.5":void 0,children:l(b==="failed"?"table.copyFailed":"table.copied")}),P&&$]})]})};return s.jsxs(s.Fragment,{children:[s.jsx("div",{hidden:v,className:"chat-table",children:D(a)}),v&&s.jsx(g5,{title:n,returnFocus:w.current,onClose:()=>y(!1),children:D(!0)})]})}function lC({columns:e,rows:t,order:n,name:a,wrap:r,large:i,sort:o,onSort:c,direction:d,headless:u=!1,look:p="panel"}){const m=p==="card",h=f.useRef(null),x=f.useRef(null),[g,v]=f.useState(40);f.useEffect(()=>{if(!x.current)return;const $=new ResizeObserver(([_])=>{_&&v(_.target.getBoundingClientRect().height)});return $.observe(x.current),()=>$.disconnect()},[]);const y=n.length>80,w=f.useMemo(()=>J4e(e.map($=>$.text),t.map($=>$.map(_=>_.text))),[e,t]),[b,k]=f.useState(null);f.useEffect(()=>{const $=h.current;if(!$||typeof ResizeObserver>"u")return;const _=new ResizeObserver(()=>k($.clientWidth||null));return _.observe($),()=>_.disconnect()},[]);const j=X4e({wrap:r,virtual:y,minimums:w,available:b}),N=f.useMemo(()=>e.map(($,_)=>$.width??Math.min(320,Math.max(140,Math.max($.text.length,...t.slice(0,100).map(B=>Math.min(40,B[_]?.text.length??0)))*7+40))),[e,t]),A=f.useMemo(()=>e.map(($,_)=>{const B=t.slice(0,200).map(W=>W[_]?.text.trim()??"").filter(Boolean);return B.length>0&&B.every(U4e)}),[e,t]),T=O4e({count:n.length,getScrollElement:()=>h.current,estimateSize:()=>42,getItemKey:$=>n[$],overscan:6,enabled:y,initialRect:{width:800,height:400},scrollMargin:g});f.useEffect(()=>{h.current&&(h.current.scrollTop=0)},[n]),f.useEffect(()=>{T.measure()},[r,N,T]);const M=y?T.getVirtualItems():n.map(($,_)=>({key:$,index:_,start:0,end:0})),S=y&&M.length?Math.max(0,M[0].start-g):0,C=y&&M.length?Math.max(0,T.getTotalSize()-M.at(-1).end+g):0,O=($,_)=>$.align??(A[_]||d==="rtl"?"right":"left"),L=($,_)=>l("table.sort",{column:$.text||_+1}),D=($,_)=>$.content??($.text||l("table.column",{number:_+1})),z=($,_)=>o?.column===$&&o.descending?s.jsx(ql,{size:12,className:_}):s.jsx(ki,{size:12,className:I(_,o?.column!==$&&!m&&"opacity-35")}),P=$=>z($,I("shrink-0 text-ink-tertiary transition-opacity",o?.column===$?"opacity-100":"opacity-0 group-hover/th:opacity-100 group-focus-within/th:opacity-100 touch:opacity-100"));return s.jsxs("div",{ref:h,tabIndex:0,role:"region","aria-label":a,className:I("overflow-auto overscroll-x-contain focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/60",m&&!j&&"[mask-image:linear-gradient(90deg,#000_calc(100%-40px),transparent)]"),style:{maxHeight:i?"65dvh":y||!r?400:void 0},"data-fit":j||void 0,children:[s.jsxs("table",{dir:d,"aria-label":a,"aria-rowcount":n.length+1,className:I("w-full border-separate border-spacing-0 text-[14px]",j?"table-auto":"table-fixed",m&&"leading-5"),style:j?void 0:{minWidth:N.reduce(($,_)=>$+_,0)},children:[!j&&s.jsx("colgroup",{children:N.map(($,_)=>s.jsx("col",{style:{width:$}},_))}),s.jsx("thead",{ref:x,hidden:u,className:I("sticky top-0 z-10",p==="panel"?"bg-raised":p==="card"?"bg-card":"bg-composer"),children:s.jsx("tr",{"aria-rowindex":1,children:e.map(($,_)=>s.jsx("th",{scope:"col","aria-sort":o?.column===_?o.descending?"descending":"ascending":"none",className:m?"px-4 py-2.5 align-bottom font-semibold":"h-10 border-b border-hairline/60 px-3 py-2 font-medium",style:{textAlign:O($,_)},children:s.jsx("div",{className:"break-words [overflow-wrap:anywhere]",style:j?{minWidth:w[_]}:void 0,children:m?s.jsxs("button",{type:"button",className:"group/th inline-flex max-w-full items-center gap-1 align-top text-start font-semibold [text-align:inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60","aria-label":L($,_),title:L($,_),onClick:()=>c(_),children:[O($,_)==="right"&&P(_),s.jsx("span",{dir:"auto",children:D($,_)}),O($,_)!=="right"&&P(_)]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{dir:"auto",children:D($,_)}),s.jsx("button",{type:"button",className:"table-action ms-1 inline-flex align-middle","aria-label":L($,_),title:L($,_),onClick:()=>c(_),children:z(_)})]})})},_))})}),s.jsxs("tbody",{children:[S>0&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:e.length,style:{height:S,padding:0}})}),M.map($=>s.jsx("tr",{"data-index":$.index,ref:y?T.measureElement:void 0,"aria-rowindex":$.index+2,className:m?void 0:$.index%2?I(p==="quiet"?"bg-ink/[0.03]":"bg-inset/35","hover:bg-raised/70"):"hover:bg-raised/70",children:e.map((_,B)=>{const W=t[n[$.index]][B];return s.jsx("td",{className:m?"border-t-[0.5px] border-ink/[0.07] px-4 py-2.5 align-top tabular-nums":"border-b border-hairline/20 px-3 py-2.5 align-top tabular-nums",style:{textAlign:W?.align??O(_,B),verticalAlign:W?.vAlign},children:s.jsx("div",{dir:"auto",title:r?void 0:W?.text,className:r?"whitespace-pre-wrap break-words [overflow-wrap:anywhere]":"truncate",children:W?.content??W?.text})},B)})},$.key)),C>0&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:e.length,style:{height:C,padding:0}})})]})]}),n.length===0&&s.jsx("p",{className:"p-8 text-center text-sm text-ink-secondary",children:l(t.length?"table.noResults":"table.empty")})]})}async function cD(e,t,n=$4e,a){if(Number(e.headers.get("content-length"))>n)throw await e.body?.cancel().catch(()=>{}),new Error("size");const r=e.body?.getReader();if(!r)return"";const i=[];let o=0;try{for(;;){t.throwIfAborted();const d=await r.read();if(d.done)break;if(o+=d.value.byteLength,o>n)throw new Error("size");i.push(d.value)}}finally{await r.cancel().catch(()=>{}),r.releaseLock()}const c=new Uint8Array(await new Blob(i).arrayBuffer());try{return new TextDecoder("utf-8",{fatal:!0}).decode(c)}catch(d){if(!a||c.includes(0))throw d;return new TextDecoder(a).decode(c)}}function eNe({path:e,name:t,message:n}){const[a,r]=f.useState(!1),i=f.useRef(null),o=rC(t)??rC(e);return o?s.jsxs(s.Fragment,{children:[s.jsx("button",{ref:i,type:"button",className:"table-action",title:l("table.preview",{name:t}),"aria-label":l("table.preview",{name:t}),onClick:()=>r(!0),children:s.jsx(X7,{size:14})}),a&&s.jsx(g5,{title:t,returnFocus:i.current,onClose:()=>r(!1),children:s.jsx(tNe,{path:e,name:t,message:n,delimiter:o},`${n.threadId}:${n.messageId}:${e}`)})]}):null}function tNe({path:e,name:t,message:n,delimiter:a}){const[r,i]=f.useState(0),[o,c]=f.useState(null),[d,u]=f.useState(null);f.useEffect(()=>{const m=new AbortController;let h;u(null),c(null);const x=g=>{m.signal.aborted||u(g),h?.terminate()};return(async()=>{try{const g=await wp(e,n,m.signal),v=await cD(g,m.signal);m.signal.throwIfAborted(),h=new Worker(new URL("/assets/table-file.worker-KkMx-SNx.js",import.meta.url),{type:"module"}),h.onmessage=y=>{y.data.error?x(y.data.error):!m.signal.aborted&&y.data.table&&c(y.data.table),h?.terminate()},h.onerror=()=>x("format"),h.postMessage({text:v,delimiter:a})}catch(g){x(g instanceof Error&&g.message==="size"?"size":"load")}})(),()=>{m.abort(),h?.terminate()}},[e,n.threadId,n.messageId,a,r]);const p=f.useMemo(()=>o&&{columns:o.headers.map(m=>({text:m})),rows:o.rows.map(m=>m.map(h=>({text:h})))},[o]);return d?s.jsxs("div",{className:"p-8 text-center text-sm",children:[s.jsx("p",{role:"alert",className:"mb-3 text-ink-secondary",children:l(d==="size"?"table.tooLarge":d==="columns"||d==="format"?"table.invalid":"table.loadFailed")}),s.jsx("button",{type:"button",className:"rounded-lg border border-hairline px-3 py-2 hover:bg-raised",onClick:()=>i(r+1),children:l("chat.retry")})]}):p?s.jsx(b5,{...p,name:t,expanded:!0}):s.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary",children:[s.jsx(ke,{size:16,className:"animate-spin"}),l("table.loading")]})}const nNe=2*1024*1024,sNe="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:; media-src data:";function qh(e){return/\.html?$/i.test(e)}function cC(e){return/\.(md|markdown)$/i.test(e)}const aNe=f.lazy(()=>Oe(()=>import("./MarkdownFilePreview-r_b3CzP8.js"),__vite__mapDeps([50,1,2,3,4,10,8])));class rNe extends f.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?s.jsxs("div",{className:"p-8 text-center text-sm",children:[s.jsx("p",{role:"alert",className:"mb-3 text-ink-secondary",children:l("markdown.loadFailed")}),s.jsx("button",{type:"button",className:"rounded-lg border border-hairline px-3 py-2 hover:bg-raised",onClick:()=>location.reload(),children:l("page.broken.reload")})]}):this.props.children}}function iNe(e){return`<meta http-equiv="Content-Security-Policy" content="${sNe}"><base target="_blank">${e}`}function oNe(){const e=typeof window>"u"?void 0:window.ogb;return e?.remoteClient?.active?void 0:e?.openHtmlInBrowser}function y5(e,t,n){const[a,r]=f.useState(!1),i=f.useRef(null),o=n===void 0?null:qh(t)||qh(e)?"html":cC(t)||cC(e)?"markdown":null,c=n?`${n.threadId}:${n.messageId}:${e}`:"";return{opens:o!==null,label:l(o==="markdown"?"markdown.preview":"html.preview",{name:t}),show:d=>{i.current=d.currentTarget,r(!0)},dialog:o&&a&&n?s.jsx(g5,{title:t,returnFocus:i.current,onClose:()=>r(!1),children:o==="html"?s.jsx(dNe,{path:e,name:t,message:n},c):s.jsx(rNe,{children:s.jsx(f.Suspense,{fallback:s.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary",children:[s.jsx(ke,{size:16,className:"animate-spin"}),l("markdown.loading")]}),children:s.jsx(aNe,{path:e,name:t,message:n},c)})})}):null}}function lNe({path:e,name:t,message:n}){const a=y5(e,t,n);return s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"table-action",title:a.label,"aria-label":a.label,onClick:a.show,children:s.jsx(Za,{size:14})}),a.dialog]})}function dD(e,t,n,a){return e.opens?{onClick:e.show,disabled:!1,"aria-label":e.label}:{onClick:()=>{t.save()},disabled:t.state==="saving","aria-label":a?l("attach.retrySaveAria",{name:n}):l("attach.saveAria",{name:n})}}function k5({name:e,save:t,retryable:n}){const a=n?l("attach.retrySaveAria",{name:e}):l("attach.saveAria",{name:e});return s.jsx("button",{type:"button",className:"table-action","aria-label":a,title:a,disabled:t.state==="saving",onClick:()=>{t.save()},children:t.state==="saving"?s.jsx(ke,{size:14,className:"animate-spin","aria-hidden":"true"}):t.state==="saved"?s.jsx(Se,{size:14,className:"text-success","aria-hidden":"true"}):n?s.jsx(Ma,{size:14,className:"text-danger","aria-hidden":"true"}):s.jsx(Rt,{size:14,"aria-hidden":"true"})})}function cNe({source:e,name:t,onError:n}){const a=oNe();if(!a)return null;const r=l("html.openInBrowser",{name:t});return s.jsx("button",{type:"button",className:"table-action","aria-label":r,title:r,onClick:()=>{n(""),a(e,t).catch(i=>n(i instanceof Error&&i.message?i.message:l("html.openFailed")))},children:s.jsx(is,{size:14})})}function dNe({path:e,name:t,message:n}){const[a,r]=f.useState(0),[i,o]=f.useState(null),[c,d]=f.useState(null),[u,p]=f.useState(!1),[m,h]=f.useState(""),x=Mg(e,t,n);return f.useEffect(()=>{const g=new AbortController;return d(null),o(null),(async()=>{try{const v=await wp(e,n,g.signal),y=await cD(v,g.signal,nNe);g.signal.aborted||o(y)}catch(v){g.signal.aborted||d(v instanceof Error&&v.message==="size"?"size":"load")}})(),()=>g.abort()},[e,n.threadId,n.messageId,a]),c?s.jsxs("div",{className:"p-8 text-center text-sm",children:[s.jsx("p",{role:"alert",className:"mb-3 text-ink-secondary",children:l(c==="size"?"html.tooLarge":"html.loadFailed")}),s.jsx("button",{type:"button",className:"rounded-lg border border-hairline px-3 py-2 hover:bg-raised",onClick:()=>r(a+1),children:l("chat.retry")})]}):i===null?s.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary",children:[s.jsx(ke,{size:16,className:"animate-spin"}),l("html.loading")]}):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsx("button",{type:"button",className:"table-action","aria-pressed":u,"aria-label":l(u?"html.rendered":"html.source"),title:l(u?"html.rendered":"html.source"),onClick:()=>p(!u),children:u?s.jsx(Za,{size:14}):s.jsx(YK,{size:14})}),s.jsx("button",{type:"button",className:"table-action","aria-label":l("html.reload"),title:l("html.reload"),onClick:()=>r(a+1),children:s.jsx(Ma,{size:14})}),s.jsx(cNe,{source:i,name:t,onError:h}),s.jsx("button",{type:"button",className:"table-action","aria-label":l("attach.saveAria",{name:t}),title:l("attach.saveAria",{name:t}),disabled:x.state==="saving",onClick:()=>{x.save()},children:s.jsx(Rt,{size:14})})]}),x.state==="failed"&&s.jsx("p",{role:"alert",className:"text-end text-[12px] text-danger",children:x.reason}),m&&s.jsx("p",{role:"alert",className:"text-end text-[12px] text-danger",children:m}),u?s.jsx("pre",{className:"h-[72dvh] overflow-auto rounded-lg border border-hairline/40 bg-inset p-3 text-[12px] leading-5 whitespace-pre-wrap break-words text-ink",children:i}):s.jsx(uNe,{source:i,name:t})]})}function uNe({source:e,name:t}){return s.jsx("iframe",{sandbox:"",referrerPolicy:"no-referrer",srcDoc:iNe(e),title:l("html.frameTitle",{name:t}),className:"h-[72dvh] w-full rounded-lg border border-hairline/40 bg-white"})}function v5({path:e,name:t,message:n}){return qh(t)||qh(e)?s.jsx(lNe,{path:e,name:t,message:n}):s.jsx(eNe,{path:e,name:t,message:n})}const dC=new Map;function uD(e,t,n=0){let a=dC.get(n);if(!a){const o=new Map;a={observer:new IntersectionObserver(d=>{for(const u of d)o.get(u.target)?.(u.isIntersecting)},n?{rootMargin:`${n}px 0px`,scrollMargin:`${n}px 0px`}:void 0),watchers:o},dC.set(n,a)}const{observer:r,watchers:i}=a;return i.set(e,t),r.observe(e),()=>{i.delete(e),r.unobserve(e)}}function pNe(e){const[t,n]=f.useState(!1);return f.useEffect(()=>{const a=e.current;if(a)return typeof IntersectionObserver>"u"?n(!0):uD(a,n)},[e]),t}const mNe=800;function fNe(e){const[t,n]=f.useState(()=>typeof IntersectionObserver>"u");return f.useEffect(()=>{const a=e.current;if(!(t||!a))return uD(a,r=>r&&n(!0),mNe)},[e,t]),t}function pD({name:e,className:t}){const n=f.useRef(null),a=pNe(n);return s.jsxs("span",{ref:n,className:I("flex items-center justify-center",a&&"animate-pulse",t),role:"status",children:[s.jsx(ke,{size:17,className:I("text-ink-tertiary",a&&"animate-spin")}),s.jsx("span",{className:"sr-only",children:l("attach.loadingName",{name:e})})]})}const mD=/^(?:\/(?!\/)|[a-zA-Z]:[\\/])/,hNe=`${Sn} text-ink hover:bg-menu-hover [&>svg]:text-ink-secondary`;function fD(){const e=typeof window>"u"?void 0:window.ogb;return e?.remoteClient?.active?void 0:e?.revealInFolder}async function xNe(e,t=gNe()){if(!t||!mD.test(e))return!1;try{return await t(e)==="opened"}catch{return!1}}function gNe(){const e=typeof window>"u"?void 0:window.ogb;return e?.remoteClient?.active?void 0:e?.openFolder}function bNe(e,t=fD()){return!!t&&typeof e=="string"&&mD.test(e)}function yNe(e){return l(e==="darwin"?"attach.showInFinder":"attach.showInFolder")}async function kNe(e,t){try{const n=await t(e);return n==="shown"?"":l(n==="missing"?"attach.originalMissing":"attach.revealFailed")}catch{return l("attach.revealFailed")}}function hD(){const[e,t]=f.useState(null),n=f.useRef(null),a=f.useRef(null),r=()=>{t(null);const d=a.current;a.current=null,d?.isConnected&&d.focus()};f.useEffect(()=>{if(!e)return;n.current?.querySelector("button")?.focus();const d=u=>{u.target instanceof Node&&n.current?.contains(u.target)||t(null)};return window.addEventListener("mousedown",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("mousedown",d),window.removeEventListener("scroll",d,!0)}},[e]);const i=fD(),o=yNe(typeof window>"u"?void 0:window.ogb?.platform),c=async d=>{const u=i?await kNe(d,i):l("attach.revealFailed");if(!u&&n.current?.contains(document.activeElement))return r();t(p=>p?.source!==d?p:u?{...p,problem:u}:null)};return{targetProps:d=>bNe(d,i)?{onContextMenu:u=>{u.preventDefault(),u.stopPropagation();const p=document.activeElement;a.current=p instanceof HTMLElement&&p!==document.body?p:u.currentTarget,t({left:Math.max(8,Math.min(u.clientX,window.innerWidth-268)),top:Math.max(8,Math.min(u.clientY,window.innerHeight-110)),source:d})}}:{},menu:e&&Ke.createPortal(s.jsxs("div",{ref:n,role:"group","aria-label":o,style:{left:e.left,top:e.top},className:I("fixed z-50 w-[260px]",Jt),onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),r())},children:[s.jsxs("button",{type:"button",onClick:()=>{c(e.source)},title:e.source,className:hNe,children:[s.jsx(er,{size:16}),o]}),e.problem&&s.jsx("p",{role:"alert",className:"px-2 pb-1 text-[13px] leading-[18px] text-danger",children:e.problem})]}),document.body)}}function xD(e,t=xs(e)){const n=yy(e);return n?{src:n,name:t,downloadUrl:n,downloadName:vp({fallback:t,source:e})}:null}function vNe(e,t,n){return n<=0?0:(e+t+n)%n}function wNe(e,t){return e==="Escape"?"close":t>1&&e==="ArrowLeft"?"previous":t>1&&e==="ArrowRight"?"next":null}const jNe={"image/avif":"avif","image/bmp":"bmp","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/tiff":"tiff","image/webp":"webp"},NNe=new Set(["avif","bmp","gif","heic","heif","jpeg","jpg","png","tif","tiff","webp"]);function zd(e){const n=((e??"").split(/[\\/]/).at(-1)??"").normalize("NFC").replace(/[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g,"").replace(/[<>:"|?*]/g,"_").trim().replace(/[. ]+$/g,""),a=Array.from(n).filter(i=>{const o=i.charCodeAt(0);return i.length>1||o<55296||o>57343}).slice(0,180).join("");if(!a)return"download";const r=a.split(".",1)[0].toUpperCase();return/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/.test(r)?`_${a}`:a}function SNe(e){if(!e)return null;const t=/(?:^|;)\s*filename\*\s*=\s*(?:UTF-8'[^']*')?([^;]*)/i.exec(e)?.[1]?.trim();if(t){const r=t.replace(/^"|"$/g,"");try{return zd(decodeURIComponent(r))}catch{}}const n=/(?:^|;)\s*filename\s*=\s*"((?:\\.|[^"\\])*)"/i.exec(e)?.[1];if(n!==void 0)return zd(n.replace(/\\(.)/g,"$1"));const a=/(?:^|;)\s*filename\s*=\s*([^;]*)/i.exec(e)?.[1]?.trim();return a?zd(a):null}function INe(e){if(!e)return null;let t=e;try{t=decodeURIComponent(new URL(e,"https://openmausbot.invalid").pathname)}catch{t=e.split(/[?#]/,1)[0]??e}const n=/\.([a-z0-9]+)$/i.exec(t)?.[1]?.toLowerCase();return n&&NNe.has(n)?n:null}function CNe(e,t){const n=`.${t}`,a=e.replace(/\.[^.]*$/,"")||"image",r=Math.max(1,180-Array.from(n).length);return`${Array.from(a).slice(0,r).join("")}${n}`}function vp({contentDisposition:e,fallback:t,source:n,mime:a}){const r=SNe(e??null)??zd(t),i=a?.split(";",1)[0]?.trim().toLowerCase()??"",o=jNe[i]??INe(n);return o?CNe(r,o):r}function ENe(e){const n=e.trim().replace(/[\t\n\r]/g,"").replace(/\\/g,"/");return n.startsWith("//")||/^https?:/i.test(n)}function ANe(e,t){return`/api/threads/${encodeURIComponent(e.threadId)}/messages/${encodeURIComponent(e.messageId)}/file?preview=1&ref=${t}`}async function TNe(e){try{const t=await fetch(e,{cache:"no-store"});return t.ok?(await t.body?.cancel(),!1):(await t.json().catch(()=>null))?.code==="outside_workspace"}catch{return!1}}function MNe(e){setTimeout(()=>URL.revokeObjectURL(e),0)}async function wp(e,t,n,a){const r=await fetch(`/api/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}/file`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,...a?.entry!==void 0?{entry:a.entry}:a?.list?{listFolder:!0}:{}}),signal:n});if(!r.ok){const i=await r.json().catch(()=>null);throw Object.assign(new Error(Fl(i,i?.error??l("attach.downloadFailed"))),{code:i?.code})}return r}function Mg(e,t,n,a){const[r,i]=f.useState("idle"),[o,c]=f.useState(null),[d,u]=f.useState(""),[p,m]=f.useState(""),[h,x]=f.useState(void 0),g=f.useRef(null),v=f.useRef(null),y=f.useRef(!1),w=f.useRef(!0);f.useEffect(()=>(w.current=!0,()=>{w.current=!1,v.current?.abort(),g.current&&clearTimeout(g.current)}),[]),f.useEffect(()=>{v.current?.abort(),v.current=null,y.current=!1,u(""),m(""),x(void 0),c(null),i("idle")},[e,a,n?.messageId,n?.threadId]);const b=f.useCallback(async()=>{if(y.current)return;if(!n){u(l("attach.unavailableOld")),i("failed");return}y.current=!0,g.current&&(clearTimeout(g.current),g.current=null),u(""),x(void 0),i("saving"),v.current?.abort();const j=new AbortController;v.current=j;try{const N=await wp(e,n,j.signal,a===void 0?{list:!0}:{entry:a});if(N.headers.get("x-openmausbot-folder")==="1"){const S=await N.json();if(!w.current||j.signal.aborted)return;i("idle"),!await xNe(e)&&!j.signal.aborted&&c(S);return}const A=await N.blob();if(!w.current||j.signal.aborted)return;const T=URL.createObjectURL(A),M=vp({contentDisposition:N.headers.get("content-disposition"),fallback:t||a||xs(e),source:e,mime:A.type||N.headers.get("content-type")});try{const S=document.createElement("a");S.href=T,S.download=M,S.style.display="none",document.body.append(S);try{S.click()}finally{S.remove()}}finally{MNe(T)}if(!w.current||j.signal.aborted)return;m(M),i("saved"),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{w.current&&i("idle")},4e3)}catch(N){if(!w.current||j.signal.aborted)return;u(N instanceof Error?N.message:l("attach.saveFailed")),x(N?.code),i("failed")}finally{v.current===j&&(v.current=null,y.current=!1)}},[e,a,n?.messageId,n?.threadId,t]),k=h==="outside_workspace";return{state:r,reason:d,savedTo:p,outsideWorkspace:k,retryable:r==="failed"&&!k&&h!=="file_too_large",folder:o,save:b}}function w5(e){return e.outsideWorkspace?l("attach.outsideWorkspace"):e.reason}function _Ne(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/(1024*102.4))/10} MB`}function RNe({folderPath:e,name:t,bytes:n,message:a}){const r=Mg(e,t,a,t);return s.jsxs("li",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5",children:[s.jsxs("button",{type:"button",onClick:()=>{r.save()},disabled:r.state==="saving","aria-label":l("attach.saveAria",{name:t}),className:"inline-flex min-h-8 min-w-0 items-center gap-1 break-all text-start text-accent underline decoration-accent/40 hover:decoration-accent disabled:cursor-wait",children:[r.state==="saving"?s.jsx(ke,{size:12,className:"shrink-0 animate-spin","aria-hidden":"true"}):r.state==="saved"?s.jsx(Se,{size:12,className:"shrink-0 text-success","aria-hidden":"true"}):s.jsx(mo,{size:12,className:"shrink-0","aria-hidden":"true"}),t]}),s.jsx("span",{className:"text-ink-secondary",children:_Ne(n)}),r.state==="failed"&&s.jsx("span",{role:"alert",className:"text-danger",children:r.reason})]})}function ONe({folderPath:e,listing:t,message:n}){return s.jsxs("span",{dir:"ltr",className:"block w-full text-[12px] [unicode-bidi:isolate]",children:[t.entries.length===0?s.jsx("span",{className:"text-ink-secondary",children:l("attach.folderEmpty")}):s.jsx("ul",{"aria-label":l("attach.folderFilesAria",{name:t.name}),className:"flex flex-col gap-0.5 ps-1",children:t.entries.map(a=>s.jsx(RNe,{folderPath:e,name:a.name,bytes:a.bytes,message:n},a.name))}),t.truncated&&s.jsx("span",{className:"text-ink-secondary",children:l("attach.folderTruncated")})]})}const LNe=/^(?:\/(?!\/)|[a-zA-Z]:[\\/])/;function zNe(){const e=typeof window>"u"?void 0:window.ogb;return e?.remoteClient?.active?void 0:e?.revealInFolder}function j5({filePath:e}){const[t,n]=f.useState(""),a=zNe();if(!a||!LNe.test(e))return s.jsx("code",{title:l("attach.outsideWorkspacePath"),className:"select-all break-all text-ink",children:e});const r=async()=>{n("");try{const i=await a(e);i==="missing"?n(l("attach.revealMissing")):i!=="shown"&&n(l("attach.revealFailed"))}catch{n(l("attach.revealFailed"))}};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>{r()},title:e,className:"inline-flex items-center gap-1 text-accent underline decoration-accent/40 hover:decoration-accent",children:[s.jsx(er,{size:12,className:"shrink-0","aria-hidden":"true"}),l("attach.showInFolder")]}),t&&s.jsx("span",{role:"alert",className:"text-danger",children:t})]})}function _g({image:e,images:t,initialIndex:n=0,onClose:a}){const r=t?.length?t:[e],[i,o]=f.useState(()=>Math.min(Math.max(n,0),r.length-1)),c=r[i]??e,d=f.useRef(null),u=f.useRef(a),[p,m]=f.useState(()=>new Set),[h,x]=f.useState(null),[g,v]=f.useState(0);f.useLayoutEffect(()=>{u.current=a},[a]);const y=f.useCallback(j=>{o(N=>vNe(N,j,r.length)),x(null)},[r.length]);f.useEffect(()=>{const j=document.activeElement instanceof HTMLElement?document.activeElement:null;d.current?.focus();const N=A=>{const T=wNe(A.key,r.length);if(T){A.preventDefault(),A.stopPropagation(),T==="close"?u.current():y(T==="previous"?-1:1);return}if(A.key!=="Tab")return;const M=d.current;if(!M)return;const S=[...M.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')];if(S.length===0){A.preventDefault(),M.focus();return}const C=S[0],O=S[S.length-1];A.shiftKey&&(document.activeElement===M||document.activeElement===C)?(A.preventDefault(),O.focus()):!A.shiftKey&&document.activeElement===O&&(A.preventDefault(),C.focus())};return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N),j?.focus()}},[r.length,y]);const w=p.has(c.src),b=h===c.src,k=()=>{x(null),m(j=>{const N=new Set(j);return N.delete(c.src),N}),v(j=>j+1)};return Ke.createPortal(s.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/80 p-3 backdrop-blur-sm sm:p-6",onMouseDown:j=>j.stopPropagation(),children:s.jsxs("div",{ref:d,role:"dialog","aria-modal":"true","aria-label":l("attach.previewAria",{name:c.name}),tabIndex:-1,className:"animate-pop-in flex h-full max-h-[900px] w-full max-w-[1200px] flex-col overflow-hidden rounded-2xl border border-white/15 bg-black/70 shadow-2xl outline-none",children:[s.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-white/10 bg-black/45 px-4 py-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate text-[13px] font-medium text-white",children:c.name}),s.jsx("div",{className:"text-[11px] text-white/50",children:r.length>1?l("attach.position",{index:i+1,count:r.length}):l("attach.imagePreview")})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.downloadUrl&&s.jsx("a",{href:c.downloadUrl,download:c.downloadName??vp({fallback:c.name,source:c.downloadUrl}),className:"flex size-9 items-center justify-center rounded-lg text-white/65 hover:bg-white/10 hover:text-white","aria-label":l("attach.downloadAria",{name:c.name}),title:l("attach.download"),children:s.jsx(Rt,{size:17})}),c.openUrl&&s.jsx("a",{href:c.openUrl,target:"_blank",rel:"noreferrer",className:"flex size-9 items-center justify-center rounded-lg text-white/65 hover:bg-white/10 hover:text-white","aria-label":l("attach.openOriginalAria",{name:c.name}),title:l("attach.openOriginal"),children:s.jsx(is,{size:17})}),s.jsx("button",{onClick:a,className:"flex size-9 items-center justify-center rounded-lg text-white/65 hover:bg-white/10 hover:text-white","aria-label":l("attach.close"),children:s.jsx(Ae,{size:19})})]})]}),s.jsxs("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4 sm:p-8",children:[!w&&!b&&s.jsx("div",{className:"absolute inset-4 flex animate-pulse items-center justify-center rounded-xl bg-white/[0.055] sm:inset-8",role:"status",children:s.jsxs("span",{className:"flex items-center gap-2 text-[13px] text-white/55",children:[s.jsx(ke,{size:17,className:"animate-spin"})," ",l("attach.imageLoading")]})}),b?s.jsxs("div",{className:"flex flex-col items-center gap-3 text-white/60",role:"alert",children:[s.jsx(Gd,{size:34}),s.jsx("span",{className:"text-[13px]",children:l("attach.imageFailed")}),s.jsxs("button",{type:"button",onClick:k,className:"flex items-center gap-1.5 rounded-lg border border-white/15 bg-white/10 px-3 py-1.5 text-[12px] text-white hover:bg-white/15",children:[s.jsx(Ma,{size:13})," ",l("chat.retry")]})]}):s.jsx("img",{src:c.src,alt:c.name,onLoad:()=>m(j=>new Set(j).add(c.src)),onError:()=>x(c.src),className:I("block max-h-full max-w-full rounded-lg object-contain shadow-2xl transition-opacity duration-150",w?"opacity-100":"opacity-0")},`${c.src}:${g}`),r.length>1&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",onClick:()=>y(-1),"aria-label":l("attach.previous"),className:"absolute left-2 top-1/2 flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/55 text-white/80 backdrop-blur-sm hover:bg-black/75 hover:text-white sm:left-4",children:s.jsx(vr,{size:21})}),s.jsx("button",{type:"button",onClick:()=>y(1),"aria-label":l("attach.next"),className:"absolute right-2 top-1/2 flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/55 text-white/80 backdrop-blur-sm hover:bg-black/75 hover:text-white sm:right-4",children:s.jsx(it,{size:21})})]})]})]})}),document.body)}function lv({image:e,onPreview:t,className:n,eager:a=!1,explainRefusal:r=!1}){const[i,o]=f.useState("loading"),[c,d]=f.useState(0),[u,p]=f.useState(!1),[m,h]=f.useState(null);return s.jsxs("span",{style:m?{aspectRatio:String(m)}:void 0,className:I("group/image relative block aspect-[4/3] min-w-0 overflow-hidden rounded-xl border border-hairline/40 bg-inset",n),children:[i==="loading"&&s.jsx(pD,{name:e.name,className:"absolute inset-0 bg-raised/65"}),i==="failed"?s.jsxs("span",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 px-3 text-center text-ink-secondary",role:"alert",children:[s.jsx(Gd,{size:22}),u?s.jsx("span",{className:"max-w-full text-[12px]",children:l("attach.imageOutsideWorkspace")}):s.jsx("span",{className:"max-w-full truncate text-[12px]",children:l("attach.imageUnavailable")}),!u&&s.jsxs("span",{role:"button",tabIndex:0,onClick:x=>{x.preventDefault(),x.stopPropagation(),o("loading"),d(g=>g+1)},onKeyDown:x=>{x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),x.stopPropagation(),o("loading"),d(g=>g+1))},className:"flex items-center gap-1 rounded-md border border-hairline/50 bg-panel px-2 py-1 text-[11px] text-ink hover:bg-raised","aria-label":l("attach.retryAria",{name:e.name}),children:[s.jsx(Ma,{size:11})," ",l("chat.retry")]})]}):s.jsxs("span",{role:"button",tabIndex:i==="ready"?0:-1,"aria-disabled":i!=="ready",onClick:x=>{x.preventDefault(),x.stopPropagation(),i==="ready"&&t()},onKeyDown:x=>{i==="ready"&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),t())},className:"absolute inset-0 block size-full cursor-pointer text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/60 aria-disabled:cursor-default","aria-label":l("attach.previewImageAria",{name:e.name}),title:l("attach.previewAria",{name:e.name}),children:[s.jsx("img",{src:e.src,alt:e.name,loading:a?"eager":"lazy",fetchPriority:a?"high":void 0,onLoad:x=>{const{naturalWidth:g,naturalHeight:v}=x.currentTarget;g>0&&v>0&&h(Math.min(Math.max(g/v,.6),2.4)),o("ready")},onError:()=>{o("failed"),r&&TNe(e.src).then(p)},className:I("block size-full object-cover transition duration-200 group-hover/image:scale-[1.015]",i==="ready"?"opacity-100":"opacity-0")},`${e.src}:${c}`),s.jsx("span",{className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-full bg-black/55 text-white opacity-0 backdrop-blur-sm transition-opacity group-hover/image:opacity-100 group-focus-within/image:opacity-100",children:s.jsx(Qd,{size:13})})]})]})}function PNe({src:e,name:t,openUrl:n,message:a,filePath:r,sourceOffset:i}){const[o,c]=f.useState(!1),d=f.useRef(null),u=a?.threadId,p=a?.messageId,m=typeof i=="number"&&Number.isSafeInteger(i)&&i>=0?i:null,h=!!(r&&u&&p&&m!==null),x=h?`${u}\0${p}\0${m}`:null,[g,v]=f.useState(null),y=!r&&ENe(e),[w,b]=f.useState(null);f.useEffect(()=>{if(!x)return;const T=d.current;if(!T||typeof IntersectionObserver>"u"){v(x);return}v(null);const M=new IntersectionObserver(([S])=>{S?.isIntersecting&&(v(x),M.disconnect())},{rootMargin:"320px 0px"});return M.observe(T),()=>M.disconnect()},[x]);const k=h&&(g===x||o),j=!y||w===e,N=j?h?k&&r&&u&&p&&m!==null?ANe({threadId:u,messageId:p},m):null:e:null,A={src:N??"",name:t,openUrl:n,downloadUrl:h?N??void 0:void 0,downloadName:h?vp({fallback:t,source:r}):void 0};return s.jsxs(s.Fragment,{children:[s.jsxs("span",{ref:d,className:"my-2 block w-[min(36rem,70vw)] max-w-full",children:[y&&!j?s.jsxs("span",{className:"flex aspect-[4/3] max-h-96 flex-col items-center justify-center gap-2 rounded-xl border border-hairline/40 bg-inset px-4 text-center text-[12px] text-ink-secondary",children:[s.jsx(Gd,{size:20}),s.jsx("span",{children:l("attach.externalHidden")}),s.jsx("button",{type:"button",className:"rounded-md border border-hairline/50 bg-panel px-2.5 py-1 text-ink hover:bg-raised",onClick:T=>{T.preventDefault(),T.stopPropagation(),b(e)},children:l("attach.loadImage")})]}):r&&(!u||!p||m===null)?s.jsxs("span",{className:"flex aspect-[4/3] max-h-96 items-center justify-center gap-2 rounded-xl border border-hairline/40 bg-inset text-[12px] text-ink-secondary",role:"alert",children:[s.jsx(Gd,{size:17})," ",l("attach.oldImage")]}):N?s.jsx(lv,{image:A,onPreview:()=>c(!0),className:"max-h-96",eager:!0,explainRefusal:h},A.src):s.jsx(pD,{name:t,className:"aspect-[4/3] max-h-96 rounded-xl border border-hairline/40 bg-inset"}),n&&s.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"mt-1 inline-flex text-[11px] text-accent hover:underline",children:l("attach.openOriginal")})]}),o&&N&&s.jsx(_g,{image:A,onClose:()=>c(!1)})]})}function cv({file:e,message:t,linked:n=!1,compact:a=!1,className:r}){const i=Mg(e.path,e.name,t),o=y5(e.path,e.name,t),c=i.state==="failed";return a?s.jsx(DNe,{file:e,message:t,linked:n,save:i,preview:o,className:r}):!t||!e.private&&!n?s.jsxs("div",{title:l("attach.legacyFile",{name:e.name}),className:I("flex max-w-[280px] items-center gap-2 overflow-hidden rounded-lg border border-hairline/40 bg-inset/70 px-2.5 py-2 text-[12px] text-ink-secondary",r),children:[s.jsx(mo,{size:14,className:"shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:e.name}),s.jsx("span",{className:"text-[11px]",children:l("attach.unavailable")})]}):s.jsxs("div",{title:i.state==="saved"&&i.savedTo?l("attach.savedTo",{path:i.savedTo}):e.name,className:I("max-w-[280px] overflow-hidden rounded-lg border border-hairline/40 bg-inset/70 text-[12px] text-ink-secondary",r),children:[s.jsxs("div",{className:"flex items-center pe-1",children:[s.jsxs("button",{type:"button",...dD(o,i,e.name,i.retryable),className:"flex min-h-10 min-w-0 flex-1 items-center gap-2 px-2.5 py-2 text-left transition-colors hover:bg-raised/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/60 disabled:cursor-wait disabled:hover:bg-transparent",children:[s.jsx(mo,{size:14,className:"shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:e.name}),o.opens?s.jsx(Za,{size:13,className:"shrink-0"}):i.state==="saving"?s.jsx(ke,{size:13,className:"shrink-0 animate-spin"}):i.state==="saved"?s.jsx(Se,{size:13,className:"shrink-0 text-success"}):c?i.retryable&&s.jsx(Ma,{size:13,className:"shrink-0 text-danger"}):s.jsx(Rt,{size:13,className:"shrink-0"})]}),o.opens?s.jsx(k5,{name:e.name,save:i,retryable:i.retryable}):s.jsx(v5,{path:e.path,name:e.name,message:t}),o.dialog]}),i.state!=="idle"&&s.jsxs("div",{role:c?"alert":"status",className:I("border-t border-hairline/30 px-2.5 py-1.5 text-[11px]",c?"text-danger":i.state==="saved"?"text-success":"text-ink-secondary"),children:[i.state==="saving"?l("attach.downloading"):i.state==="saved"?l("attach.downloaded"):w5(i),c&&i.outsideWorkspace&&s.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-1.5",children:s.jsx(j5,{filePath:e.path})})]})]})}const uC="inline-flex h-7 max-w-[16rem] items-center rounded-full bg-ink/[0.06] text-[13px] leading-none text-ink-secondary";function DNe({file:e,message:t,linked:n,save:a,preview:r,className:i}){const o=a.state==="failed",c=s.jsx("span",{dir:"auto",className:"min-w-0 truncate text-ink [unicode-bidi:isolate]",children:e.name});return!t||!e.private&&!n?s.jsxs("span",{title:l("attach.legacyFile",{name:e.name}),className:I(uC,"gap-1.5 px-2.5",i),children:[s.jsx(mo,{size:14,strokeWidth:1.75,className:"shrink-0","aria-hidden":"true"}),c,s.jsx("span",{className:"shrink-0 text-[12px]",children:l("attach.unavailable")})]}):s.jsxs("span",{className:"inline-flex max-w-full flex-col items-start gap-1",children:[s.jsxs("span",{title:a.state==="saved"&&a.savedTo?l("attach.savedTo",{path:a.savedTo}):e.name,className:I(uC,"file-chip pe-0.5",i),children:[s.jsxs("button",{type:"button",...dD(r,a,e.name,a.retryable),className:"inline-flex h-7 min-w-0 items-center gap-1.5 rounded-full ps-2.5 pe-2 transition-colors hover:bg-ink/[0.06] hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:cursor-wait",children:[s.jsx(mo,{size:14,strokeWidth:1.75,className:"shrink-0","aria-hidden":"true"}),c,r.opens?s.jsx(Za,{size:13,strokeWidth:1.75,className:"shrink-0","aria-hidden":"true"}):a.state==="saving"?s.jsx(ke,{size:13,className:"shrink-0 animate-spin","aria-hidden":"true"}):a.state==="saved"?s.jsx(Se,{size:13,className:"shrink-0 text-success","aria-hidden":"true"}):o?a.retryable&&s.jsx(Ma,{size:13,className:"shrink-0 text-danger","aria-hidden":"true"}):s.jsx(Rt,{size:13,strokeWidth:1.75,className:"shrink-0","aria-hidden":"true"})]}),r.opens?s.jsx(k5,{name:e.name,save:a,retryable:a.retryable}):s.jsx(v5,{path:e.path,name:e.name,message:t}),r.dialog]}),a.state!=="idle"&&a.state!=="saved"&&s.jsxs("span",{role:o?"alert":"status",className:I("px-2.5 text-[12px]",o?"text-danger":"text-ink-secondary"),children:[a.state==="saving"?l("attach.downloading"):w5(a),o&&a.outsideWorkspace&&s.jsx("span",{className:"ms-1.5 inline-flex flex-wrap items-center gap-x-1.5",children:s.jsx(j5,{filePath:e.path})})]}),a.state==="saved"&&s.jsx("span",{role:"status",className:"sr-only",children:l("attach.downloaded")})]})}const Gc=e=>f.Children.toArray(e).filter(f.isValidElement);function dv(e){if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(dv).join("");if(!f.isValidElement(e))return"";const t=e;return t.type==="br"?`
185
- `:dv(t.props.children)||t.props.alt||""}function $Ne({children:e,direction:t}){const n=f.useMemo(()=>{const a=Gc(e),r=a.find(u=>u.type==="thead"),i=a.find(u=>u.type==="tbody"),o=u=>({text:dv(u.props.children),content:u.props.children}),c=Gc(Gc(r?.props.children)[0]?.props.children).map(u=>({...o(u),align:u.props.align==="left"||u.props.align==="right"||u.props.align==="center"?u.props.align:void 0})),d=Gc(i?.props.children).map(u=>Gc(u.props.children).map(o));return{columns:c,rows:d}},[e]);return s.jsx(b5,{...n,direction:t})}const Fi=new Map,BNe=200,pC=4*1024*1024;function FNe(e,t){if(t.length>pC)return;Fi.set(e,t);let n=0;for(const a of Fi.values())n+=a.length;for(const[a,r]of Fi){if(Fi.size<=BNe&&n<=pC)break;Fi.delete(a),n-=r.length}}const gD=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)},UNe="github-light-default",qNe="github-dark-default",bD={javascript:()=>Oe(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>Oe(()=>import("./jsx-g9-lgVsj.js"),[]),typescript:()=>Oe(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>Oe(()=>import("./tsx-COt5Ahok.js"),[]),json:()=>Oe(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Oe(()=>import("./jsonc-Des-eS-w.js"),[]),json5:()=>Oe(()=>import("./json5-C9tS-k6U.js"),[]),bash:()=>Oe(()=>import("./bash-Yzrsuije.js"),[]),powershell:()=>Oe(()=>import("./powershell-BmBUJMz7.js"),[]),fish:()=>Oe(()=>import("./fish-BvzEVeQv.js"),[]),python:()=>Oe(()=>import("./python-B6aJPvgy.js"),[]),html:()=>Oe(()=>import("./html-pp8916En.js"),__vite__mapDeps([51,52,53])),css:()=>Oe(()=>import("./css-CLj8gQPS.js"),[]),scss:()=>Oe(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([54,53])),sass:()=>Oe(()=>import("./sass-Cj5Yp3dK.js"),[]),less:()=>Oe(()=>import("./less-B1dDrJ26.js"),[]),markdown:()=>Oe(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>Oe(()=>import("./mdx-Cmh6b_Ma.js"),[]),yaml:()=>Oe(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>Oe(()=>import("./toml-vGWfd6FD.js"),[]),xml:()=>Oe(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([55,56])),c:()=>Oe(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Oe(()=>import("./cpp-DddhVWhK.js"),__vite__mapDeps([57,58])),csharp:()=>Oe(()=>import("./csharp-DSvCPggb.js"),[]),rust:()=>Oe(()=>import("./rust-B1yitclQ.js"),[]),go:()=>Oe(()=>import("./go-C27-OAKa.js"),[]),ruby:()=>Oe(()=>import("./ruby-Ct1eTYOr.js"),__vite__mapDeps([59,51,52,53,55,56,60,61,62,63,64,57,58,65,66,67])),php:()=>Oe(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([68,51,52,53,55,56,60,69])),java:()=>Oe(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>Oe(()=>import("./kotlin-BdnUsdx6.js"),[]),swift:()=>Oe(()=>import("./swift-C2oV4EkX.js"),[]),dart:()=>Oe(()=>import("./dart-bE4Kk8sk.js"),[]),r:()=>Oe(()=>import("./r-Cf5RLm7j.js"),[]),lua:()=>Oe(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([66,58])),sql:()=>Oe(()=>import("./sql-CRqJ_cUM.js"),[]),graphql:()=>Oe(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([61,52,62,63,64])),proto:()=>Oe(()=>import("./proto-C7zT0LnQ.js"),[]),dockerfile:()=>Oe(()=>import("./dockerfile-BcOcwvcX.js"),[]),makefile:()=>Oe(()=>import("./makefile-CHLpvVh8.js"),[]),diff:()=>Oe(()=>import("./diff-D97Zzqfu.js"),[]),wasm:()=>Oe(()=>import("./wasm-MzD3tlZU.js"),[])},HNe={js:"javascript",node:"javascript",ts:"typescript",sh:"bash",zsh:"bash",shell:"bash",ps1:"powershell",py:"python",htm:"html",yml:"yaml",md:"markdown",svg:"xml","c++":"cpp",cc:"cpp",cxx:"cpp",cs:"csharp","c#":"csharp",rs:"rust",golang:"go",rb:"ruby",kt:"kotlin",gql:"graphql",protobuf:"proto",docker:"dockerfile",make:"makefile"},WNe=new Set(["","text","txt","plaintext","plain"]);let wm;const Db=new Map;function KNe(e){const t=HNe[e];return t||(Object.prototype.hasOwnProperty.call(bD,e)?e:void 0)}function VNe(){if(wm)return wm;const e=(async()=>{const{createHighlighterCore:t}=await Oe(async()=>{const{createHighlighterCore:a}=await import("./core-DX_0zk8q.js");return{createHighlighterCore:a}},__vite__mapDeps([70,1,2,10,3,4,8])),{createJavaScriptRegexEngine:n}=await Oe(async()=>{const{createJavaScriptRegexEngine:a}=await import("./engine-javascript-D5Xfc425.js");return{createJavaScriptRegexEngine:a}},[]);return t({themes:[Oe(()=>import("./github-light-default-D7oLnXFd.js"),[]).then(a=>a.default),Oe(()=>import("./github-dark-default-Cuk6v7N8.js"),[]).then(a=>a.default)],langs:[],engine:n()})})().catch(t=>{throw wm=void 0,t});return wm=e,e}function GNe(e,t){const n=Db.get(t);if(n)return n;const a=bD[t]().then(r=>e.loadLanguage(r.default)).catch(r=>{throw Db.delete(t),r});return Db.set(t,a),a}async function YNe(e,t){const n=await VNe(),a=t.trim().toLowerCase(),r=WNe.has(a),i=r?void 0:KNe(a);if(!r&&!i)throw new Error(`No bundled grammar for ${a}`);return i&&await GNe(n,i),n.codeToHtml(e,{lang:i??"text",themes:{light:UNe,dark:qNe},defaultColor:"light-dark()"})}const mC=(e,t)=>`${e}:${gD(t)}`,JNe=1e5,fC="inline-flex size-7 touch:size-11 items-center justify-center rounded-full text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60";function yD({copied:e,onCopy:t,copyLabel:n,items:a}){return s.jsxs("div",{"data-code-plate":!0,className:"absolute end-1 top-1 z-[1] flex gap-0.5 rounded-full bg-composer p-0.5 opacity-0 ring-[0.5px] ring-ink/10 transition-opacity focus-within:opacity-100 group-hover/code:opacity-100 touch:opacity-100 has-[[aria-expanded=true]]:opacity-100",children:[s.jsx("button",{type:"button",onClick:t,className:fC,title:e==="copied"?l("code.copiedTitle"):e==="failed"?l("common.copyFailed"):n,"aria-label":e==="copied"?l("code.copiedTitle"):e==="failed"?l("common.copyFailed"):n,children:e==="failed"?s.jsx(Ae,{size:14,className:"text-danger","aria-hidden":"true"}):e==="copied"?s.jsx(Se,{size:14,className:"text-success","aria-hidden":"true"}):s.jsx(Qt,{size:14,"aria-hidden":"true"})}),e!=="idle"&&s.jsx("span",{role:"status",className:"sr-only",children:e==="failed"?l("common.copyFailed"):l("code.copiedTitle")}),s.jsx(Vs,{items:a,ariaLabel:l("chat.more"),placement:"above",align:"end",triggerTitle:l("chat.more"),triggerClassName:"rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60",renderTrigger:()=>s.jsx("span",{className:fC,children:s.jsx(vs,{size:14,"aria-hidden":"true"})})})]})}function QNe({code:e,lang:t,initialWrap:n=!1}){const a=!nt(),r=f.useRef(null),i=fNe(r),o=e.length<=JNe,[c,d]=f.useState(()=>o&&i?Fi.get(mC(t,e))??null:null),u=f.useMemo(()=>c?{__html:c}:null,[c]),{state:p,copy:m}=Ca(e),[h,x]=f.useState(n);f.useEffect(()=>{x(n)},[n]),f.useEffect(()=>{if(!o)return d(null);if(!i)return;const b=mC(t,e),k=Fi.get(b);if(k)return d(k);let j=!0;return YNe(e,t||"text").then(N=>{j&&(FNe(b,N),d(N))}).catch(()=>{}),()=>{j=!1}},[e,t,o,i]);const g=()=>{const b=w5e(t);j5e(b,e)},v=y5e(t),y=k5e(e),w=(b,k)=>u?s.jsx("div",{className:I(`text-[13px] [&_pre]:!bg-transparent [&_pre]:m-0 ${b}`,h?"whitespace-pre-wrap break-words overflow-x-hidden [&_pre]:!whitespace-pre-wrap [&_pre]:!break-words [&_code]:!whitespace-pre-wrap [&_code]:!break-words":"overflow-x-auto"),dangerouslySetInnerHTML:u}):s.jsx("pre",{className:I(`text-[13px] ${b.replaceAll("[&_pre]:","")}`,k,h?"whitespace-pre-wrap break-words overflow-x-hidden":"overflow-x-auto"),children:e});return a?s.jsxs("div",{ref:r,dir:"ltr","data-look":"code-block",className:"chat-code-block group/code relative my-2.5 overflow-hidden rounded-xl bg-ink/[0.04]",children:[s.jsx(yD,{copied:p,onCopy:m,copyLabel:l("code.copyTitle"),items:[{key:"wrap",label:l("code.wrapLines"),icon:s.jsx(Zd,{size:14,"aria-hidden":"true"}),active:h,onSelect:()=>x(b=>!b)},{key:"save",label:l("code.saveAsFile"),icon:s.jsx(Rt,{size:14,"aria-hidden":"true"}),onSelect:g},{key:"about",label:l("code.caption",{language:v,lines:VI(y)}),disabled:!0,separatorBefore:!0,onSelect:()=>{}}]}),w("leading-5 [&_pre]:px-3 [&_pre]:py-2","text-ink-secondary")]}):s.jsxs("div",{ref:r,dir:"ltr","data-look":"code-block",className:"chat-code-block my-2 overflow-hidden rounded-lg border border-hairline/40 bg-inset",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-hairline/30 bg-raised/30 px-3 py-1.5 text-xs",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx("span",{title:v,className:"min-w-0 truncate rounded border border-hairline/40 bg-raised px-1.5 py-0.5 text-[11px] font-medium tracking-wide text-ink select-none",children:v}),y>0&&s.jsx("span",{className:"shrink-0 whitespace-nowrap text-[11px] text-ink-secondary select-none",children:VI(y)})]}),s.jsxs("div",{className:"chat-code-actions flex shrink-0 items-center gap-1 whitespace-nowrap",children:[s.jsxs("button",{type:"button",onClick:()=>x(b=>!b),className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] transition-colors ${h?"bg-accent/15 text-accent font-medium":"text-ink-secondary hover:bg-raised hover:text-ink"}`,title:h?l("code.unwrapLong"):l("code.wrapLong"),"aria-label":h?l("code.unwrapLong"):l("code.wrapLong"),"aria-pressed":h,children:[s.jsx(Zd,{size:12,"aria-hidden":"true"}),s.jsx("span",{children:h?l("code.unwrap"):l("code.wrap")})]}),s.jsxs("button",{type:"button",onClick:g,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-ink-secondary hover:bg-raised hover:text-ink transition-colors",title:l("code.saveTitle"),"aria-label":l("code.saveTitle"),children:[s.jsx(Rt,{size:12,"aria-hidden":"true"}),s.jsx("span",{children:l("code.save")})]}),s.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-ink-secondary hover:bg-raised hover:text-ink transition-colors",title:p==="copied"?l("code.copiedTitle"):p==="failed"?l("common.copyFailed"):l("code.copyTitle"),"aria-label":p==="copied"?l("code.copiedAria"):p==="failed"?l("common.copyFailed"):l("code.copyAria"),children:[p==="failed"?s.jsx(Ae,{size:12,className:"text-danger","aria-hidden":"true"}):p==="copied"?s.jsx(Se,{size:12,className:"text-success","aria-hidden":"true"}):s.jsx(Qt,{size:12,"aria-hidden":"true"}),s.jsx("span",{"aria-hidden":"true",className:"hidden max-sm:inline touch:inline",children:l("code.copy")}),s.jsx("span",{role:"status",className:`max-sm:sr-only touch:sr-only ${p==="failed"?"text-danger font-medium":p==="copied"?"text-success font-medium":""}`,children:p==="failed"?l("common.copyFailed"):p==="copied"?l("code.copied"):l("code.copy")})]})]})]}),w("leading-relaxed [&_pre]:p-3","text-ink")]})}const Xo=new Map,XNe=50;let hC=0;const xC=(e,t)=>`${e}:${gD(t)}`,kD=/^[a-zA-Z]:[\\/]/,gC=e=>e.startsWith("/")||kD.test(e)?e:null,jp=e=>{if(!e)return null;if(/^file:\/\//i.test(e))try{const n=new URL(e);if(n.username||n.password||n.port||n.search||n.hash)return null;const a=decodeURIComponent(n.pathname);return n.hostname&&n.hostname!=="localhost"?`//${n.hostname}${a}`:/^\/[a-z]:[\\/]/i.test(a)?a.slice(1):gC(a)}catch{return null}if(e.startsWith("\\\\"))return e;if(e.startsWith("//"))return null;const t=gC(e);return t||(e.startsWith("#")||/^[a-z][a-z\d+.-]*:/i.test(e)?null:e)};function ZNe(e,t="href"){if(xM(e)||nD(e))return e;const n=/^(?:[a-zA-Z]:%5C|%5C%5C)/i.test(e)?e.replace(/%5C/gi,"\\"):e;return/^file:\/\//i.test(n)||kD.test(n)||n.startsWith("\\\\")?jp(n)?n:"":t==="href"&&/^obsidian:\/\//i.test(e)?e:CP(e)}function eSe(){const e=this.data();(e.fromMarkdownExtensions??=[]).push(h5)}function tSe(){return(e,t)=>{typeof t.value=="string"&&q5e(e,t.value)}}const uv={},vD={singleTilde:!1};XP.call({data:()=>uv},vD);const nSe={extensions:uv.micromarkExtensions,mdastExtensions:[...uv.fromMarkdownExtensions??[],h5]};function sSe(){return e=>{const t=n=>{n.children&&(n.children=n.children.flatMap(a=>a?.type!=="text"||!a.value.includes(`
184
+ `,escapeFormulae:H4e})}const K4e=4,V4e=12,G4e=7.5,Y4e=100;function J4e(e,t){return e.map((n,a)=>{let r=0;for(const i of[n,...t.slice(0,Y4e).map(o=>o[a]??"")])for(const o of i.split(/\s+/))r=Math.max(r,[...o].length);return Math.round(Math.min(V4e,Math.max(K4e,r))*G4e)})}const Q4e=24;function X4e({wrap:e,virtual:t,minimums:n=[],available:a=null}){return!e||t?!1:a===null||n.reduce((r,i)=>r+i+Q4e,0)<=a}function g5({title:e,onClose:t,children:n,returnFocus:a}){const r=f.useRef(null),i=f.useId();return f.useEffect(()=>{const o=r.current;return o.showModal(),()=>{o.close(),a?.isConnected&&a.focus()}},[a]),Ke.createPortal(s.jsxs("dialog",{ref:r,"aria-labelledby":i,onCancel:t,onClose:t,onKeyDown:o=>{o.key==="Escape"&&o.stopPropagation()},className:"m-auto flex max-h-[94dvh] w-[min(96vw,1400px)] max-w-none flex-col overflow-hidden rounded-2xl border border-hairline bg-panel p-0 text-ink shadow-2xl backdrop:bg-black/55",children:[s.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-hairline/40 px-4 py-3",children:[s.jsx("h2",{id:i,className:"min-w-0 truncate text-sm font-medium",children:e}),s.jsx("button",{type:"button",autoFocus:!0,onClick:t,className:"table-action","aria-label":l("table.close"),children:s.jsx(Ae,{size:16})})]}),s.jsx("div",{className:"min-h-0 overflow-auto p-3 sm:p-5",children:n})]}),document.body)}const oC=8,Z4e="group/table relative w-fit min-w-[min(100%,20rem)] max-w-full overflow-hidden rounded-[18px] bg-card text-ink touch:pt-11";function b5({columns:e,rows:t,name:n=l("table.title"),expanded:a=!1,direction:r="ltr",headless:i=!1,card:o=!0}){const c=!nt(),[d,u]=f.useState(""),p=f.useDeferredValue(d),[m,h]=f.useState(null),[x,g]=f.useState(!0),[v,y]=f.useState(!1),w=f.useRef(null),[b,k]=f.useState("idle"),j=f.useMemo(()=>t.map(z=>z.map(P=>P.text)),[t]),N=f.useMemo(()=>q4e(j,p,m),[j,p,m]);f.useEffect(()=>{if(b==="idle")return;const z=setTimeout(()=>k("idle"),2500);return()=>clearTimeout(z)},[b]);const A=()=>W4e(e.map(z=>z.text),N.map(z=>j[z])),T=async()=>{const z=await aa(A());z!=="empty"&&k(z)},M=()=>{const z=URL.createObjectURL(new Blob(["\uFEFF",A()],{type:"text/csv;charset=utf-8"})),P=document.createElement("a");P.href=z,P.download=`${n.replace(/\.(csv|tsv)$/i,"").replace(/[\\/:*?"<>|]/g,"_").slice(0,150)||"table"}.csv`,P.click(),setTimeout(()=>URL.revokeObjectURL(z),1e3)},S=b!=="idle"&&s.jsx("span",{role:b==="failed"?"alert":"status",className:"sr-only",children:l(b==="failed"?"table.copyFailed":"table.copied")}),C=z=>s.jsxs("label",{className:z,children:[s.jsx(An,{size:13,"aria-hidden":"true"}),s.jsx("input",{value:d,onChange:P=>u(P.target.value),"aria-label":l("table.search"),placeholder:l("table.search"),className:"w-full min-w-0 bg-transparent py-1 text-xs text-ink outline-none placeholder:text-ink-tertiary focus-visible:ring-1 focus-visible:ring-accent"})]}),O=z=>h(m?.column!==z?{column:z,descending:!1}:m.descending?null:{column:z,descending:!0}),L=()=>s.jsxs("div",{"data-table-card":!0,className:Z4e,dir:"ltr",children:[s.jsxs("div",{className:"table-plate absolute end-1.5 top-1.5 z-20 flex items-center gap-0.5 rounded-full bg-composer p-0.5 opacity-0 ring-[0.5px] ring-ink/10 transition-opacity focus-within:opacity-100 group-hover/table:opacity-100 touch:end-1 touch:top-0 touch:bg-transparent touch:p-0 touch:opacity-100 touch:ring-0",children:[s.jsx("button",{type:"button",className:"table-action !rounded-full","aria-label":l("table.copyPlain"),title:l("table.copyPlain"),onClick:()=>{T()},children:b==="copied"?s.jsx(Se,{size:14}):s.jsx(Qt,{size:14})}),s.jsx("button",{type:"button",className:"table-action !rounded-full","aria-label":l("table.download"),title:l("table.download"),onClick:M,children:s.jsx(Rt,{size:14})}),s.jsx("button",{type:"button",className:"table-action !rounded-full","aria-label":l("table.expand"),title:l("table.expand"),onClick:z=>{w.current=z.currentTarget,y(!0)},children:s.jsx(Qd,{size:14})})]}),t.length>oC&&s.jsxs("div",{className:"flex items-center gap-2 px-4 pb-1.5 text-ink-tertiary",children:[C("flex min-w-24 flex-1 items-center gap-2"),s.jsx("span",{role:"status",className:"shrink-0 text-[12px] tabular-nums",children:l("table.count",{shown:N.length.toLocaleString(),total:t.length.toLocaleString(),columns:e.length})})]}),s.jsx(lC,{columns:e,rows:t,order:N,name:n,wrap:x,large:!1,sort:m,direction:r,headless:i,look:"card",onSort:O}),S]}),D=z=>{if(c&&o&&!z)return L();const P=!z&&t.length<=oC,$=s.jsxs(s.Fragment,{children:[!P&&s.jsx("button",{type:"button",className:"table-action","aria-label":l("table.wrap"),title:l("table.wrap"),"aria-pressed":x,onClick:()=>g(!x),children:s.jsx(Zd,{size:14})}),s.jsx("button",{type:"button",className:"table-action","aria-label":l("table.copy"),title:l("table.copy"),onClick:()=>{T()},children:b==="copied"?s.jsx(Se,{size:14}):s.jsx(Qt,{size:14})}),s.jsx("button",{type:"button",className:"table-action","aria-label":l("table.download"),title:l("table.download"),onClick:M,children:s.jsx(Rt,{size:14})}),!z&&s.jsx("button",{type:"button",className:"table-action","aria-label":l("table.expand"),title:l("table.expand"),onClick:_=>{w.current=_.currentTarget,y(!0)},children:s.jsx(Qd,{size:14})})]});return s.jsxs("div",{className:I("rich-table w-fit min-w-[min(100%,var(--chat-prose-max))] max-w-full overflow-hidden rounded-xl border border-hairline/50 text-ink",c?"bg-composer":"bg-panel"),dir:"ltr",children:[!P&&s.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-hairline/40 px-2 py-1.5",children:[C("flex min-w-24 flex-1 items-center gap-2 px-1 text-ink-secondary"),$]}),s.jsx(lC,{columns:e,rows:t,order:N,name:n,wrap:x,large:z,sort:m,direction:r,headless:i,look:c?"quiet":"panel",onSort:O}),s.jsxs("footer",{className:P?"flex items-center justify-end gap-0.5 border-t border-hairline/30 px-1.5 py-1 text-[11px] text-ink-tertiary":"flex flex-wrap items-center justify-between gap-2 border-t border-hairline/40 px-3 py-2 text-[11px] text-ink-secondary",children:[!P&&s.jsx("span",{role:"status",children:l("table.count",{shown:N.length.toLocaleString(dt()),total:t.length.toLocaleString(dt()),columns:e.length})}),b!=="idle"&&s.jsx("span",{role:b==="failed"?"alert":"status",className:P?"me-auto ps-1.5":void 0,children:l(b==="failed"?"table.copyFailed":"table.copied")}),P&&$]})]})};return s.jsxs(s.Fragment,{children:[s.jsx("div",{hidden:v,className:"chat-table",children:D(a)}),v&&s.jsx(g5,{title:n,returnFocus:w.current,onClose:()=>y(!1),children:D(!0)})]})}function lC({columns:e,rows:t,order:n,name:a,wrap:r,large:i,sort:o,onSort:c,direction:d,headless:u=!1,look:p="panel"}){const m=p==="card",h=f.useRef(null),x=f.useRef(null),[g,v]=f.useState(40);f.useEffect(()=>{if(!x.current)return;const $=new ResizeObserver(([_])=>{_&&v(_.target.getBoundingClientRect().height)});return $.observe(x.current),()=>$.disconnect()},[]);const y=n.length>80,w=f.useMemo(()=>J4e(e.map($=>$.text),t.map($=>$.map(_=>_.text))),[e,t]),[b,k]=f.useState(null);f.useEffect(()=>{const $=h.current;if(!$||typeof ResizeObserver>"u")return;const _=new ResizeObserver(()=>k($.clientWidth||null));return _.observe($),()=>_.disconnect()},[]);const j=X4e({wrap:r,virtual:y,minimums:w,available:b}),N=f.useMemo(()=>e.map(($,_)=>$.width??Math.min(320,Math.max(140,Math.max($.text.length,...t.slice(0,100).map(B=>Math.min(40,B[_]?.text.length??0)))*7+40))),[e,t]),A=f.useMemo(()=>e.map(($,_)=>{const B=t.slice(0,200).map(W=>W[_]?.text.trim()??"").filter(Boolean);return B.length>0&&B.every(U4e)}),[e,t]),T=O4e({count:n.length,getScrollElement:()=>h.current,estimateSize:()=>42,getItemKey:$=>n[$],overscan:6,enabled:y,initialRect:{width:800,height:400},scrollMargin:g});f.useEffect(()=>{h.current&&(h.current.scrollTop=0)},[n]),f.useEffect(()=>{T.measure()},[r,N,T]);const M=y?T.getVirtualItems():n.map(($,_)=>({key:$,index:_,start:0,end:0})),S=y&&M.length?Math.max(0,M[0].start-g):0,C=y&&M.length?Math.max(0,T.getTotalSize()-M.at(-1).end+g):0,O=($,_)=>$.align??(A[_]||d==="rtl"?"right":"left"),L=($,_)=>l("table.sort",{column:$.text||_+1}),D=($,_)=>$.content??($.text||l("table.column",{number:_+1})),z=($,_)=>o?.column===$&&o.descending?s.jsx(ql,{size:12,className:_}):s.jsx(ki,{size:12,className:I(_,o?.column!==$&&!m&&"opacity-35")}),P=$=>z($,I("shrink-0 text-ink-tertiary transition-opacity",o?.column===$?"opacity-100":"opacity-0 group-hover/th:opacity-100 group-focus-within/th:opacity-100 touch:opacity-100"));return s.jsxs("div",{ref:h,tabIndex:0,role:"region","aria-label":a,className:I("overflow-auto overscroll-x-contain focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/60",m&&!j&&"[mask-image:linear-gradient(90deg,#000_calc(100%-40px),transparent)]"),style:{maxHeight:i?"65dvh":y||!r?400:void 0},"data-fit":j||void 0,children:[s.jsxs("table",{dir:d,"aria-label":a,"aria-rowcount":n.length+1,className:I("w-full border-separate border-spacing-0 text-[14px]",j?"table-auto":"table-fixed",m&&"leading-5"),style:j?void 0:{minWidth:N.reduce(($,_)=>$+_,0)},children:[!j&&s.jsx("colgroup",{children:N.map(($,_)=>s.jsx("col",{style:{width:$}},_))}),s.jsx("thead",{ref:x,hidden:u,className:I("sticky top-0 z-10",p==="panel"?"bg-raised":p==="card"?"bg-card":"bg-composer"),children:s.jsx("tr",{"aria-rowindex":1,children:e.map(($,_)=>s.jsx("th",{scope:"col","aria-sort":o?.column===_?o.descending?"descending":"ascending":"none",className:m?"px-4 py-2.5 align-bottom font-semibold":"h-10 border-b border-hairline/60 px-3 py-2 font-medium",style:{textAlign:O($,_)},children:s.jsx("div",{className:"break-words [overflow-wrap:anywhere]",style:j?{minWidth:w[_]}:void 0,children:m?s.jsxs("button",{type:"button",className:"group/th inline-flex max-w-full items-center gap-1 align-top text-start font-semibold [text-align:inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60","aria-label":L($,_),title:L($,_),onClick:()=>c(_),children:[O($,_)==="right"&&P(_),s.jsx("span",{dir:"auto",children:D($,_)}),O($,_)!=="right"&&P(_)]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{dir:"auto",children:D($,_)}),s.jsx("button",{type:"button",className:"table-action ms-1 inline-flex align-middle","aria-label":L($,_),title:L($,_),onClick:()=>c(_),children:z(_)})]})})},_))})}),s.jsxs("tbody",{children:[S>0&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:e.length,style:{height:S,padding:0}})}),M.map($=>s.jsx("tr",{"data-index":$.index,ref:y?T.measureElement:void 0,"aria-rowindex":$.index+2,className:m?void 0:$.index%2?I(p==="quiet"?"bg-ink/[0.03]":"bg-inset/35","hover:bg-raised/70"):"hover:bg-raised/70",children:e.map((_,B)=>{const W=t[n[$.index]][B];return s.jsx("td",{className:m?"border-t-[0.5px] border-ink/[0.07] px-4 py-2.5 align-top tabular-nums":"border-b border-hairline/20 px-3 py-2.5 align-top tabular-nums",style:{textAlign:W?.align??O(_,B),verticalAlign:W?.vAlign},children:s.jsx("div",{dir:"auto",title:r?void 0:W?.text,className:r?"whitespace-pre-wrap break-words [overflow-wrap:anywhere]":"truncate",children:W?.content??W?.text})},B)})},$.key)),C>0&&s.jsx("tr",{"aria-hidden":"true",children:s.jsx("td",{colSpan:e.length,style:{height:C,padding:0}})})]})]}),n.length===0&&s.jsx("p",{className:"p-8 text-center text-sm text-ink-secondary",children:l(t.length?"table.noResults":"table.empty")})]})}async function cD(e,t,n=$4e,a){if(Number(e.headers.get("content-length"))>n)throw await e.body?.cancel().catch(()=>{}),new Error("size");const r=e.body?.getReader();if(!r)return"";const i=[];let o=0;try{for(;;){t.throwIfAborted();const d=await r.read();if(d.done)break;if(o+=d.value.byteLength,o>n)throw new Error("size");i.push(d.value)}}finally{await r.cancel().catch(()=>{}),r.releaseLock()}const c=new Uint8Array(await new Blob(i).arrayBuffer());try{return new TextDecoder("utf-8",{fatal:!0}).decode(c)}catch(d){if(!a||c.includes(0))throw d;return new TextDecoder(a).decode(c)}}function eNe({path:e,name:t,message:n}){const[a,r]=f.useState(!1),i=f.useRef(null),o=rC(t)??rC(e);return o?s.jsxs(s.Fragment,{children:[s.jsx("button",{ref:i,type:"button",className:"table-action",title:l("table.preview",{name:t}),"aria-label":l("table.preview",{name:t}),onClick:()=>r(!0),children:s.jsx(X7,{size:14})}),a&&s.jsx(g5,{title:t,returnFocus:i.current,onClose:()=>r(!1),children:s.jsx(tNe,{path:e,name:t,message:n,delimiter:o},`${n.threadId}:${n.messageId}:${e}`)})]}):null}function tNe({path:e,name:t,message:n,delimiter:a}){const[r,i]=f.useState(0),[o,c]=f.useState(null),[d,u]=f.useState(null);f.useEffect(()=>{const m=new AbortController;let h;u(null),c(null);const x=g=>{m.signal.aborted||u(g),h?.terminate()};return(async()=>{try{const g=await wp(e,n,m.signal),v=await cD(g,m.signal);m.signal.throwIfAborted(),h=new Worker(new URL("/assets/table-file.worker-KkMx-SNx.js",import.meta.url),{type:"module"}),h.onmessage=y=>{y.data.error?x(y.data.error):!m.signal.aborted&&y.data.table&&c(y.data.table),h?.terminate()},h.onerror=()=>x("format"),h.postMessage({text:v,delimiter:a})}catch(g){x(g instanceof Error&&g.message==="size"?"size":"load")}})(),()=>{m.abort(),h?.terminate()}},[e,n.threadId,n.messageId,a,r]);const p=f.useMemo(()=>o&&{columns:o.headers.map(m=>({text:m})),rows:o.rows.map(m=>m.map(h=>({text:h})))},[o]);return d?s.jsxs("div",{className:"p-8 text-center text-sm",children:[s.jsx("p",{role:"alert",className:"mb-3 text-ink-secondary",children:l(d==="size"?"table.tooLarge":d==="columns"||d==="format"?"table.invalid":"table.loadFailed")}),s.jsx("button",{type:"button",className:"rounded-lg border border-hairline px-3 py-2 hover:bg-raised",onClick:()=>i(r+1),children:l("chat.retry")})]}):p?s.jsx(b5,{...p,name:t,expanded:!0}):s.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary",children:[s.jsx(ke,{size:16,className:"animate-spin"}),l("table.loading")]})}const nNe=2*1024*1024,sNe="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:; media-src data:";function qh(e){return/\.html?$/i.test(e)}function cC(e){return/\.(md|markdown)$/i.test(e)}const aNe=f.lazy(()=>Oe(()=>import("./MarkdownFilePreview-Bz1iAIhj.js"),__vite__mapDeps([50,1,2,3,4,10,8])));class rNe extends f.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?s.jsxs("div",{className:"p-8 text-center text-sm",children:[s.jsx("p",{role:"alert",className:"mb-3 text-ink-secondary",children:l("markdown.loadFailed")}),s.jsx("button",{type:"button",className:"rounded-lg border border-hairline px-3 py-2 hover:bg-raised",onClick:()=>location.reload(),children:l("page.broken.reload")})]}):this.props.children}}function iNe(e){return`<meta http-equiv="Content-Security-Policy" content="${sNe}"><base target="_blank">${e}`}function oNe(){const e=typeof window>"u"?void 0:window.ogb;return e?.remoteClient?.active?void 0:e?.openHtmlInBrowser}function y5(e,t,n){const[a,r]=f.useState(!1),i=f.useRef(null),o=n===void 0?null:qh(t)||qh(e)?"html":cC(t)||cC(e)?"markdown":null,c=n?`${n.threadId}:${n.messageId}:${e}`:"";return{opens:o!==null,label:l(o==="markdown"?"markdown.preview":"html.preview",{name:t}),show:d=>{i.current=d.currentTarget,r(!0)},dialog:o&&a&&n?s.jsx(g5,{title:t,returnFocus:i.current,onClose:()=>r(!1),children:o==="html"?s.jsx(dNe,{path:e,name:t,message:n},c):s.jsx(rNe,{children:s.jsx(f.Suspense,{fallback:s.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary",children:[s.jsx(ke,{size:16,className:"animate-spin"}),l("markdown.loading")]}),children:s.jsx(aNe,{path:e,name:t,message:n},c)})})}):null}}function lNe({path:e,name:t,message:n}){const a=y5(e,t,n);return s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:"table-action",title:a.label,"aria-label":a.label,onClick:a.show,children:s.jsx(Za,{size:14})}),a.dialog]})}function dD(e,t,n,a){return e.opens?{onClick:e.show,disabled:!1,"aria-label":e.label}:{onClick:()=>{t.save()},disabled:t.state==="saving","aria-label":a?l("attach.retrySaveAria",{name:n}):l("attach.saveAria",{name:n})}}function k5({name:e,save:t,retryable:n}){const a=n?l("attach.retrySaveAria",{name:e}):l("attach.saveAria",{name:e});return s.jsx("button",{type:"button",className:"table-action","aria-label":a,title:a,disabled:t.state==="saving",onClick:()=>{t.save()},children:t.state==="saving"?s.jsx(ke,{size:14,className:"animate-spin","aria-hidden":"true"}):t.state==="saved"?s.jsx(Se,{size:14,className:"text-success","aria-hidden":"true"}):n?s.jsx(Ma,{size:14,className:"text-danger","aria-hidden":"true"}):s.jsx(Rt,{size:14,"aria-hidden":"true"})})}function cNe({source:e,name:t,onError:n}){const a=oNe();if(!a)return null;const r=l("html.openInBrowser",{name:t});return s.jsx("button",{type:"button",className:"table-action","aria-label":r,title:r,onClick:()=>{n(""),a(e,t).catch(i=>n(i instanceof Error&&i.message?i.message:l("html.openFailed")))},children:s.jsx(is,{size:14})})}function dNe({path:e,name:t,message:n}){const[a,r]=f.useState(0),[i,o]=f.useState(null),[c,d]=f.useState(null),[u,p]=f.useState(!1),[m,h]=f.useState(""),x=Mg(e,t,n);return f.useEffect(()=>{const g=new AbortController;return d(null),o(null),(async()=>{try{const v=await wp(e,n,g.signal),y=await cD(v,g.signal,nNe);g.signal.aborted||o(y)}catch(v){g.signal.aborted||d(v instanceof Error&&v.message==="size"?"size":"load")}})(),()=>g.abort()},[e,n.threadId,n.messageId,a]),c?s.jsxs("div",{className:"p-8 text-center text-sm",children:[s.jsx("p",{role:"alert",className:"mb-3 text-ink-secondary",children:l(c==="size"?"html.tooLarge":"html.loadFailed")}),s.jsx("button",{type:"button",className:"rounded-lg border border-hairline px-3 py-2 hover:bg-raised",onClick:()=>r(a+1),children:l("chat.retry")})]}):i===null?s.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary",children:[s.jsx(ke,{size:16,className:"animate-spin"}),l("html.loading")]}):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsx("button",{type:"button",className:"table-action","aria-pressed":u,"aria-label":l(u?"html.rendered":"html.source"),title:l(u?"html.rendered":"html.source"),onClick:()=>p(!u),children:u?s.jsx(Za,{size:14}):s.jsx(YK,{size:14})}),s.jsx("button",{type:"button",className:"table-action","aria-label":l("html.reload"),title:l("html.reload"),onClick:()=>r(a+1),children:s.jsx(Ma,{size:14})}),s.jsx(cNe,{source:i,name:t,onError:h}),s.jsx("button",{type:"button",className:"table-action","aria-label":l("attach.saveAria",{name:t}),title:l("attach.saveAria",{name:t}),disabled:x.state==="saving",onClick:()=>{x.save()},children:s.jsx(Rt,{size:14})})]}),x.state==="failed"&&s.jsx("p",{role:"alert",className:"text-end text-[12px] text-danger",children:x.reason}),m&&s.jsx("p",{role:"alert",className:"text-end text-[12px] text-danger",children:m}),u?s.jsx("pre",{className:"h-[72dvh] overflow-auto rounded-lg border border-hairline/40 bg-inset p-3 text-[12px] leading-5 whitespace-pre-wrap break-words text-ink",children:i}):s.jsx(uNe,{source:i,name:t})]})}function uNe({source:e,name:t}){return s.jsx("iframe",{sandbox:"",referrerPolicy:"no-referrer",srcDoc:iNe(e),title:l("html.frameTitle",{name:t}),className:"h-[72dvh] w-full rounded-lg border border-hairline/40 bg-white"})}function v5({path:e,name:t,message:n}){return qh(t)||qh(e)?s.jsx(lNe,{path:e,name:t,message:n}):s.jsx(eNe,{path:e,name:t,message:n})}const dC=new Map;function uD(e,t,n=0){let a=dC.get(n);if(!a){const o=new Map;a={observer:new IntersectionObserver(d=>{for(const u of d)o.get(u.target)?.(u.isIntersecting)},n?{rootMargin:`${n}px 0px`,scrollMargin:`${n}px 0px`}:void 0),watchers:o},dC.set(n,a)}const{observer:r,watchers:i}=a;return i.set(e,t),r.observe(e),()=>{i.delete(e),r.unobserve(e)}}function pNe(e){const[t,n]=f.useState(!1);return f.useEffect(()=>{const a=e.current;if(a)return typeof IntersectionObserver>"u"?n(!0):uD(a,n)},[e]),t}const mNe=800;function fNe(e){const[t,n]=f.useState(()=>typeof IntersectionObserver>"u");return f.useEffect(()=>{const a=e.current;if(!(t||!a))return uD(a,r=>r&&n(!0),mNe)},[e,t]),t}function pD({name:e,className:t}){const n=f.useRef(null),a=pNe(n);return s.jsxs("span",{ref:n,className:I("flex items-center justify-center",a&&"animate-pulse",t),role:"status",children:[s.jsx(ke,{size:17,className:I("text-ink-tertiary",a&&"animate-spin")}),s.jsx("span",{className:"sr-only",children:l("attach.loadingName",{name:e})})]})}const mD=/^(?:\/(?!\/)|[a-zA-Z]:[\\/])/,hNe=`${Sn} text-ink hover:bg-menu-hover [&>svg]:text-ink-secondary`;function fD(){const e=typeof window>"u"?void 0:window.ogb;return e?.remoteClient?.active?void 0:e?.revealInFolder}async function xNe(e,t=gNe()){if(!t||!mD.test(e))return!1;try{return await t(e)==="opened"}catch{return!1}}function gNe(){const e=typeof window>"u"?void 0:window.ogb;return e?.remoteClient?.active?void 0:e?.openFolder}function bNe(e,t=fD()){return!!t&&typeof e=="string"&&mD.test(e)}function yNe(e){return l(e==="darwin"?"attach.showInFinder":"attach.showInFolder")}async function kNe(e,t){try{const n=await t(e);return n==="shown"?"":l(n==="missing"?"attach.originalMissing":"attach.revealFailed")}catch{return l("attach.revealFailed")}}function hD(){const[e,t]=f.useState(null),n=f.useRef(null),a=f.useRef(null),r=()=>{t(null);const d=a.current;a.current=null,d?.isConnected&&d.focus()};f.useEffect(()=>{if(!e)return;n.current?.querySelector("button")?.focus();const d=u=>{u.target instanceof Node&&n.current?.contains(u.target)||t(null)};return window.addEventListener("mousedown",d),window.addEventListener("scroll",d,!0),()=>{window.removeEventListener("mousedown",d),window.removeEventListener("scroll",d,!0)}},[e]);const i=fD(),o=yNe(typeof window>"u"?void 0:window.ogb?.platform),c=async d=>{const u=i?await kNe(d,i):l("attach.revealFailed");if(!u&&n.current?.contains(document.activeElement))return r();t(p=>p?.source!==d?p:u?{...p,problem:u}:null)};return{targetProps:d=>bNe(d,i)?{onContextMenu:u=>{u.preventDefault(),u.stopPropagation();const p=document.activeElement;a.current=p instanceof HTMLElement&&p!==document.body?p:u.currentTarget,t({left:Math.max(8,Math.min(u.clientX,window.innerWidth-268)),top:Math.max(8,Math.min(u.clientY,window.innerHeight-110)),source:d})}}:{},menu:e&&Ke.createPortal(s.jsxs("div",{ref:n,role:"group","aria-label":o,style:{left:e.left,top:e.top},className:I("fixed z-50 w-[260px]",Jt),onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),r())},children:[s.jsxs("button",{type:"button",onClick:()=>{c(e.source)},title:e.source,className:hNe,children:[s.jsx(er,{size:16}),o]}),e.problem&&s.jsx("p",{role:"alert",className:"px-2 pb-1 text-[13px] leading-[18px] text-danger",children:e.problem})]}),document.body)}}function xD(e,t=xs(e)){const n=yy(e);return n?{src:n,name:t,downloadUrl:n,downloadName:vp({fallback:t,source:e})}:null}function vNe(e,t,n){return n<=0?0:(e+t+n)%n}function wNe(e,t){return e==="Escape"?"close":t>1&&e==="ArrowLeft"?"previous":t>1&&e==="ArrowRight"?"next":null}const jNe={"image/avif":"avif","image/bmp":"bmp","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/tiff":"tiff","image/webp":"webp"},NNe=new Set(["avif","bmp","gif","heic","heif","jpeg","jpg","png","tif","tiff","webp"]);function zd(e){const n=((e??"").split(/[\\/]/).at(-1)??"").normalize("NFC").replace(/[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/g,"").replace(/[<>:"|?*]/g,"_").trim().replace(/[. ]+$/g,""),a=Array.from(n).filter(i=>{const o=i.charCodeAt(0);return i.length>1||o<55296||o>57343}).slice(0,180).join("");if(!a)return"download";const r=a.split(".",1)[0].toUpperCase();return/^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/.test(r)?`_${a}`:a}function SNe(e){if(!e)return null;const t=/(?:^|;)\s*filename\*\s*=\s*(?:UTF-8'[^']*')?([^;]*)/i.exec(e)?.[1]?.trim();if(t){const r=t.replace(/^"|"$/g,"");try{return zd(decodeURIComponent(r))}catch{}}const n=/(?:^|;)\s*filename\s*=\s*"((?:\\.|[^"\\])*)"/i.exec(e)?.[1];if(n!==void 0)return zd(n.replace(/\\(.)/g,"$1"));const a=/(?:^|;)\s*filename\s*=\s*([^;]*)/i.exec(e)?.[1]?.trim();return a?zd(a):null}function INe(e){if(!e)return null;let t=e;try{t=decodeURIComponent(new URL(e,"https://openmausbot.invalid").pathname)}catch{t=e.split(/[?#]/,1)[0]??e}const n=/\.([a-z0-9]+)$/i.exec(t)?.[1]?.toLowerCase();return n&&NNe.has(n)?n:null}function CNe(e,t){const n=`.${t}`,a=e.replace(/\.[^.]*$/,"")||"image",r=Math.max(1,180-Array.from(n).length);return`${Array.from(a).slice(0,r).join("")}${n}`}function vp({contentDisposition:e,fallback:t,source:n,mime:a}){const r=SNe(e??null)??zd(t),i=a?.split(";",1)[0]?.trim().toLowerCase()??"",o=jNe[i]??INe(n);return o?CNe(r,o):r}function ENe(e){const n=e.trim().replace(/[\t\n\r]/g,"").replace(/\\/g,"/");return n.startsWith("//")||/^https?:/i.test(n)}function ANe(e,t){return`/api/threads/${encodeURIComponent(e.threadId)}/messages/${encodeURIComponent(e.messageId)}/file?preview=1&ref=${t}`}async function TNe(e){try{const t=await fetch(e,{cache:"no-store"});return t.ok?(await t.body?.cancel(),!1):(await t.json().catch(()=>null))?.code==="outside_workspace"}catch{return!1}}function MNe(e){setTimeout(()=>URL.revokeObjectURL(e),0)}async function wp(e,t,n,a){const r=await fetch(`/api/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}/file`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,...a?.entry!==void 0?{entry:a.entry}:a?.list?{listFolder:!0}:{}}),signal:n});if(!r.ok){const i=await r.json().catch(()=>null);throw Object.assign(new Error(Fl(i,i?.error??l("attach.downloadFailed"))),{code:i?.code})}return r}function Mg(e,t,n,a){const[r,i]=f.useState("idle"),[o,c]=f.useState(null),[d,u]=f.useState(""),[p,m]=f.useState(""),[h,x]=f.useState(void 0),g=f.useRef(null),v=f.useRef(null),y=f.useRef(!1),w=f.useRef(!0);f.useEffect(()=>(w.current=!0,()=>{w.current=!1,v.current?.abort(),g.current&&clearTimeout(g.current)}),[]),f.useEffect(()=>{v.current?.abort(),v.current=null,y.current=!1,u(""),m(""),x(void 0),c(null),i("idle")},[e,a,n?.messageId,n?.threadId]);const b=f.useCallback(async()=>{if(y.current)return;if(!n){u(l("attach.unavailableOld")),i("failed");return}y.current=!0,g.current&&(clearTimeout(g.current),g.current=null),u(""),x(void 0),i("saving"),v.current?.abort();const j=new AbortController;v.current=j;try{const N=await wp(e,n,j.signal,a===void 0?{list:!0}:{entry:a});if(N.headers.get("x-openmausbot-folder")==="1"){const S=await N.json();if(!w.current||j.signal.aborted)return;i("idle"),!await xNe(e)&&!j.signal.aborted&&c(S);return}const A=await N.blob();if(!w.current||j.signal.aborted)return;const T=URL.createObjectURL(A),M=vp({contentDisposition:N.headers.get("content-disposition"),fallback:t||a||xs(e),source:e,mime:A.type||N.headers.get("content-type")});try{const S=document.createElement("a");S.href=T,S.download=M,S.style.display="none",document.body.append(S);try{S.click()}finally{S.remove()}}finally{MNe(T)}if(!w.current||j.signal.aborted)return;m(M),i("saved"),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{w.current&&i("idle")},4e3)}catch(N){if(!w.current||j.signal.aborted)return;u(N instanceof Error?N.message:l("attach.saveFailed")),x(N?.code),i("failed")}finally{v.current===j&&(v.current=null,y.current=!1)}},[e,a,n?.messageId,n?.threadId,t]),k=h==="outside_workspace";return{state:r,reason:d,savedTo:p,outsideWorkspace:k,retryable:r==="failed"&&!k&&h!=="file_too_large",folder:o,save:b}}function w5(e){return e.outsideWorkspace?l("attach.outsideWorkspace"):e.reason}function _Ne(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/(1024*102.4))/10} MB`}function RNe({folderPath:e,name:t,bytes:n,message:a}){const r=Mg(e,t,a,t);return s.jsxs("li",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5",children:[s.jsxs("button",{type:"button",onClick:()=>{r.save()},disabled:r.state==="saving","aria-label":l("attach.saveAria",{name:t}),className:"inline-flex min-h-8 min-w-0 items-center gap-1 break-all text-start text-accent underline decoration-accent/40 hover:decoration-accent disabled:cursor-wait",children:[r.state==="saving"?s.jsx(ke,{size:12,className:"shrink-0 animate-spin","aria-hidden":"true"}):r.state==="saved"?s.jsx(Se,{size:12,className:"shrink-0 text-success","aria-hidden":"true"}):s.jsx(mo,{size:12,className:"shrink-0","aria-hidden":"true"}),t]}),s.jsx("span",{className:"text-ink-secondary",children:_Ne(n)}),r.state==="failed"&&s.jsx("span",{role:"alert",className:"text-danger",children:r.reason})]})}function ONe({folderPath:e,listing:t,message:n}){return s.jsxs("span",{dir:"ltr",className:"block w-full text-[12px] [unicode-bidi:isolate]",children:[t.entries.length===0?s.jsx("span",{className:"text-ink-secondary",children:l("attach.folderEmpty")}):s.jsx("ul",{"aria-label":l("attach.folderFilesAria",{name:t.name}),className:"flex flex-col gap-0.5 ps-1",children:t.entries.map(a=>s.jsx(RNe,{folderPath:e,name:a.name,bytes:a.bytes,message:n},a.name))}),t.truncated&&s.jsx("span",{className:"text-ink-secondary",children:l("attach.folderTruncated")})]})}const LNe=/^(?:\/(?!\/)|[a-zA-Z]:[\\/])/;function zNe(){const e=typeof window>"u"?void 0:window.ogb;return e?.remoteClient?.active?void 0:e?.revealInFolder}function j5({filePath:e}){const[t,n]=f.useState(""),a=zNe();if(!a||!LNe.test(e))return s.jsx("code",{title:l("attach.outsideWorkspacePath"),className:"select-all break-all text-ink",children:e});const r=async()=>{n("");try{const i=await a(e);i==="missing"?n(l("attach.revealMissing")):i!=="shown"&&n(l("attach.revealFailed"))}catch{n(l("attach.revealFailed"))}};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>{r()},title:e,className:"inline-flex items-center gap-1 text-accent underline decoration-accent/40 hover:decoration-accent",children:[s.jsx(er,{size:12,className:"shrink-0","aria-hidden":"true"}),l("attach.showInFolder")]}),t&&s.jsx("span",{role:"alert",className:"text-danger",children:t})]})}function _g({image:e,images:t,initialIndex:n=0,onClose:a}){const r=t?.length?t:[e],[i,o]=f.useState(()=>Math.min(Math.max(n,0),r.length-1)),c=r[i]??e,d=f.useRef(null),u=f.useRef(a),[p,m]=f.useState(()=>new Set),[h,x]=f.useState(null),[g,v]=f.useState(0);f.useLayoutEffect(()=>{u.current=a},[a]);const y=f.useCallback(j=>{o(N=>vNe(N,j,r.length)),x(null)},[r.length]);f.useEffect(()=>{const j=document.activeElement instanceof HTMLElement?document.activeElement:null;d.current?.focus();const N=A=>{const T=wNe(A.key,r.length);if(T){A.preventDefault(),A.stopPropagation(),T==="close"?u.current():y(T==="previous"?-1:1);return}if(A.key!=="Tab")return;const M=d.current;if(!M)return;const S=[...M.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')];if(S.length===0){A.preventDefault(),M.focus();return}const C=S[0],O=S[S.length-1];A.shiftKey&&(document.activeElement===M||document.activeElement===C)?(A.preventDefault(),O.focus()):!A.shiftKey&&document.activeElement===O&&(A.preventDefault(),C.focus())};return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N),j?.focus()}},[r.length,y]);const w=p.has(c.src),b=h===c.src,k=()=>{x(null),m(j=>{const N=new Set(j);return N.delete(c.src),N}),v(j=>j+1)};return Ke.createPortal(s.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/80 p-3 backdrop-blur-sm sm:p-6",onMouseDown:j=>j.stopPropagation(),children:s.jsxs("div",{ref:d,role:"dialog","aria-modal":"true","aria-label":l("attach.previewAria",{name:c.name}),tabIndex:-1,className:"animate-pop-in flex h-full max-h-[900px] w-full max-w-[1200px] flex-col overflow-hidden rounded-2xl border border-white/15 bg-black/70 shadow-2xl outline-none",children:[s.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-white/10 bg-black/45 px-4 py-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate text-[13px] font-medium text-white",children:c.name}),s.jsx("div",{className:"text-[11px] text-white/50",children:r.length>1?l("attach.position",{index:i+1,count:r.length}):l("attach.imagePreview")})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.downloadUrl&&s.jsx("a",{href:c.downloadUrl,download:c.downloadName??vp({fallback:c.name,source:c.downloadUrl}),className:"flex size-9 items-center justify-center rounded-lg text-white/65 hover:bg-white/10 hover:text-white","aria-label":l("attach.downloadAria",{name:c.name}),title:l("attach.download"),children:s.jsx(Rt,{size:17})}),c.openUrl&&s.jsx("a",{href:c.openUrl,target:"_blank",rel:"noreferrer",className:"flex size-9 items-center justify-center rounded-lg text-white/65 hover:bg-white/10 hover:text-white","aria-label":l("attach.openOriginalAria",{name:c.name}),title:l("attach.openOriginal"),children:s.jsx(is,{size:17})}),s.jsx("button",{onClick:a,className:"flex size-9 items-center justify-center rounded-lg text-white/65 hover:bg-white/10 hover:text-white","aria-label":l("attach.close"),children:s.jsx(Ae,{size:19})})]})]}),s.jsxs("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden p-4 sm:p-8",children:[!w&&!b&&s.jsx("div",{className:"absolute inset-4 flex animate-pulse items-center justify-center rounded-xl bg-white/[0.055] sm:inset-8",role:"status",children:s.jsxs("span",{className:"flex items-center gap-2 text-[13px] text-white/55",children:[s.jsx(ke,{size:17,className:"animate-spin"})," ",l("attach.imageLoading")]})}),b?s.jsxs("div",{className:"flex flex-col items-center gap-3 text-white/60",role:"alert",children:[s.jsx(Gd,{size:34}),s.jsx("span",{className:"text-[13px]",children:l("attach.imageFailed")}),s.jsxs("button",{type:"button",onClick:k,className:"flex items-center gap-1.5 rounded-lg border border-white/15 bg-white/10 px-3 py-1.5 text-[12px] text-white hover:bg-white/15",children:[s.jsx(Ma,{size:13})," ",l("chat.retry")]})]}):s.jsx("img",{src:c.src,alt:c.name,onLoad:()=>m(j=>new Set(j).add(c.src)),onError:()=>x(c.src),className:I("block max-h-full max-w-full rounded-lg object-contain shadow-2xl transition-opacity duration-150",w?"opacity-100":"opacity-0")},`${c.src}:${g}`),r.length>1&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",onClick:()=>y(-1),"aria-label":l("attach.previous"),className:"absolute left-2 top-1/2 flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/55 text-white/80 backdrop-blur-sm hover:bg-black/75 hover:text-white sm:left-4",children:s.jsx(vr,{size:21})}),s.jsx("button",{type:"button",onClick:()=>y(1),"aria-label":l("attach.next"),className:"absolute right-2 top-1/2 flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/55 text-white/80 backdrop-blur-sm hover:bg-black/75 hover:text-white sm:right-4",children:s.jsx(it,{size:21})})]})]})]})}),document.body)}function lv({image:e,onPreview:t,className:n,eager:a=!1,explainRefusal:r=!1}){const[i,o]=f.useState("loading"),[c,d]=f.useState(0),[u,p]=f.useState(!1),[m,h]=f.useState(null);return s.jsxs("span",{style:m?{aspectRatio:String(m)}:void 0,className:I("group/image relative block aspect-[4/3] min-w-0 overflow-hidden rounded-xl border border-hairline/40 bg-inset",n),children:[i==="loading"&&s.jsx(pD,{name:e.name,className:"absolute inset-0 bg-raised/65"}),i==="failed"?s.jsxs("span",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 px-3 text-center text-ink-secondary",role:"alert",children:[s.jsx(Gd,{size:22}),u?s.jsx("span",{className:"max-w-full text-[12px]",children:l("attach.imageOutsideWorkspace")}):s.jsx("span",{className:"max-w-full truncate text-[12px]",children:l("attach.imageUnavailable")}),!u&&s.jsxs("span",{role:"button",tabIndex:0,onClick:x=>{x.preventDefault(),x.stopPropagation(),o("loading"),d(g=>g+1)},onKeyDown:x=>{x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),x.stopPropagation(),o("loading"),d(g=>g+1))},className:"flex items-center gap-1 rounded-md border border-hairline/50 bg-panel px-2 py-1 text-[11px] text-ink hover:bg-raised","aria-label":l("attach.retryAria",{name:e.name}),children:[s.jsx(Ma,{size:11})," ",l("chat.retry")]})]}):s.jsxs("span",{role:"button",tabIndex:i==="ready"?0:-1,"aria-disabled":i!=="ready",onClick:x=>{x.preventDefault(),x.stopPropagation(),i==="ready"&&t()},onKeyDown:x=>{i==="ready"&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),t())},className:"absolute inset-0 block size-full cursor-pointer text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/60 aria-disabled:cursor-default","aria-label":l("attach.previewImageAria",{name:e.name}),title:l("attach.previewAria",{name:e.name}),children:[s.jsx("img",{src:e.src,alt:e.name,loading:a?"eager":"lazy",fetchPriority:a?"high":void 0,onLoad:x=>{const{naturalWidth:g,naturalHeight:v}=x.currentTarget;g>0&&v>0&&h(Math.min(Math.max(g/v,.6),2.4)),o("ready")},onError:()=>{o("failed"),r&&TNe(e.src).then(p)},className:I("block size-full object-cover transition duration-200 group-hover/image:scale-[1.015]",i==="ready"?"opacity-100":"opacity-0")},`${e.src}:${c}`),s.jsx("span",{className:"absolute right-2 top-2 flex size-7 items-center justify-center rounded-full bg-black/55 text-white opacity-0 backdrop-blur-sm transition-opacity group-hover/image:opacity-100 group-focus-within/image:opacity-100",children:s.jsx(Qd,{size:13})})]})]})}function PNe({src:e,name:t,openUrl:n,message:a,filePath:r,sourceOffset:i}){const[o,c]=f.useState(!1),d=f.useRef(null),u=a?.threadId,p=a?.messageId,m=typeof i=="number"&&Number.isSafeInteger(i)&&i>=0?i:null,h=!!(r&&u&&p&&m!==null),x=h?`${u}\0${p}\0${m}`:null,[g,v]=f.useState(null),y=!r&&ENe(e),[w,b]=f.useState(null);f.useEffect(()=>{if(!x)return;const T=d.current;if(!T||typeof IntersectionObserver>"u"){v(x);return}v(null);const M=new IntersectionObserver(([S])=>{S?.isIntersecting&&(v(x),M.disconnect())},{rootMargin:"320px 0px"});return M.observe(T),()=>M.disconnect()},[x]);const k=h&&(g===x||o),j=!y||w===e,N=j?h?k&&r&&u&&p&&m!==null?ANe({threadId:u,messageId:p},m):null:e:null,A={src:N??"",name:t,openUrl:n,downloadUrl:h?N??void 0:void 0,downloadName:h?vp({fallback:t,source:r}):void 0};return s.jsxs(s.Fragment,{children:[s.jsxs("span",{ref:d,className:"my-2 block w-[min(36rem,70vw)] max-w-full",children:[y&&!j?s.jsxs("span",{className:"flex aspect-[4/3] max-h-96 flex-col items-center justify-center gap-2 rounded-xl border border-hairline/40 bg-inset px-4 text-center text-[12px] text-ink-secondary",children:[s.jsx(Gd,{size:20}),s.jsx("span",{children:l("attach.externalHidden")}),s.jsx("button",{type:"button",className:"rounded-md border border-hairline/50 bg-panel px-2.5 py-1 text-ink hover:bg-raised",onClick:T=>{T.preventDefault(),T.stopPropagation(),b(e)},children:l("attach.loadImage")})]}):r&&(!u||!p||m===null)?s.jsxs("span",{className:"flex aspect-[4/3] max-h-96 items-center justify-center gap-2 rounded-xl border border-hairline/40 bg-inset text-[12px] text-ink-secondary",role:"alert",children:[s.jsx(Gd,{size:17})," ",l("attach.oldImage")]}):N?s.jsx(lv,{image:A,onPreview:()=>c(!0),className:"max-h-96",eager:!0,explainRefusal:h},A.src):s.jsx(pD,{name:t,className:"aspect-[4/3] max-h-96 rounded-xl border border-hairline/40 bg-inset"}),n&&s.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"mt-1 inline-flex text-[11px] text-accent hover:underline",children:l("attach.openOriginal")})]}),o&&N&&s.jsx(_g,{image:A,onClose:()=>c(!1)})]})}function cv({file:e,message:t,linked:n=!1,compact:a=!1,className:r}){const i=Mg(e.path,e.name,t),o=y5(e.path,e.name,t),c=i.state==="failed";return a?s.jsx(DNe,{file:e,message:t,linked:n,save:i,preview:o,className:r}):!t||!e.private&&!n?s.jsxs("div",{title:l("attach.legacyFile",{name:e.name}),className:I("flex max-w-[280px] items-center gap-2 overflow-hidden rounded-lg border border-hairline/40 bg-inset/70 px-2.5 py-2 text-[12px] text-ink-secondary",r),children:[s.jsx(mo,{size:14,className:"shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:e.name}),s.jsx("span",{className:"text-[11px]",children:l("attach.unavailable")})]}):s.jsxs("div",{title:i.state==="saved"&&i.savedTo?l("attach.savedTo",{path:i.savedTo}):e.name,className:I("max-w-[280px] overflow-hidden rounded-lg border border-hairline/40 bg-inset/70 text-[12px] text-ink-secondary",r),children:[s.jsxs("div",{className:"flex items-center pe-1",children:[s.jsxs("button",{type:"button",...dD(o,i,e.name,i.retryable),className:"flex min-h-10 min-w-0 flex-1 items-center gap-2 px-2.5 py-2 text-left transition-colors hover:bg-raised/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent/60 disabled:cursor-wait disabled:hover:bg-transparent",children:[s.jsx(mo,{size:14,className:"shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:e.name}),o.opens?s.jsx(Za,{size:13,className:"shrink-0"}):i.state==="saving"?s.jsx(ke,{size:13,className:"shrink-0 animate-spin"}):i.state==="saved"?s.jsx(Se,{size:13,className:"shrink-0 text-success"}):c?i.retryable&&s.jsx(Ma,{size:13,className:"shrink-0 text-danger"}):s.jsx(Rt,{size:13,className:"shrink-0"})]}),o.opens?s.jsx(k5,{name:e.name,save:i,retryable:i.retryable}):s.jsx(v5,{path:e.path,name:e.name,message:t}),o.dialog]}),i.state!=="idle"&&s.jsxs("div",{role:c?"alert":"status",className:I("border-t border-hairline/30 px-2.5 py-1.5 text-[11px]",c?"text-danger":i.state==="saved"?"text-success":"text-ink-secondary"),children:[i.state==="saving"?l("attach.downloading"):i.state==="saved"?l("attach.downloaded"):w5(i),c&&i.outsideWorkspace&&s.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-1.5",children:s.jsx(j5,{filePath:e.path})})]})]})}const uC="inline-flex h-7 max-w-[16rem] items-center rounded-full bg-ink/[0.06] text-[13px] leading-none text-ink-secondary";function DNe({file:e,message:t,linked:n,save:a,preview:r,className:i}){const o=a.state==="failed",c=s.jsx("span",{dir:"auto",className:"min-w-0 truncate text-ink [unicode-bidi:isolate]",children:e.name});return!t||!e.private&&!n?s.jsxs("span",{title:l("attach.legacyFile",{name:e.name}),className:I(uC,"gap-1.5 px-2.5",i),children:[s.jsx(mo,{size:14,strokeWidth:1.75,className:"shrink-0","aria-hidden":"true"}),c,s.jsx("span",{className:"shrink-0 text-[12px]",children:l("attach.unavailable")})]}):s.jsxs("span",{className:"inline-flex max-w-full flex-col items-start gap-1",children:[s.jsxs("span",{title:a.state==="saved"&&a.savedTo?l("attach.savedTo",{path:a.savedTo}):e.name,className:I(uC,"file-chip pe-0.5",i),children:[s.jsxs("button",{type:"button",...dD(r,a,e.name,a.retryable),className:"inline-flex h-7 min-w-0 items-center gap-1.5 rounded-full ps-2.5 pe-2 transition-colors hover:bg-ink/[0.06] hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:cursor-wait",children:[s.jsx(mo,{size:14,strokeWidth:1.75,className:"shrink-0","aria-hidden":"true"}),c,r.opens?s.jsx(Za,{size:13,strokeWidth:1.75,className:"shrink-0","aria-hidden":"true"}):a.state==="saving"?s.jsx(ke,{size:13,className:"shrink-0 animate-spin","aria-hidden":"true"}):a.state==="saved"?s.jsx(Se,{size:13,className:"shrink-0 text-success","aria-hidden":"true"}):o?a.retryable&&s.jsx(Ma,{size:13,className:"shrink-0 text-danger","aria-hidden":"true"}):s.jsx(Rt,{size:13,strokeWidth:1.75,className:"shrink-0","aria-hidden":"true"})]}),r.opens?s.jsx(k5,{name:e.name,save:a,retryable:a.retryable}):s.jsx(v5,{path:e.path,name:e.name,message:t}),r.dialog]}),a.state!=="idle"&&a.state!=="saved"&&s.jsxs("span",{role:o?"alert":"status",className:I("px-2.5 text-[12px]",o?"text-danger":"text-ink-secondary"),children:[a.state==="saving"?l("attach.downloading"):w5(a),o&&a.outsideWorkspace&&s.jsx("span",{className:"ms-1.5 inline-flex flex-wrap items-center gap-x-1.5",children:s.jsx(j5,{filePath:e.path})})]}),a.state==="saved"&&s.jsx("span",{role:"status",className:"sr-only",children:l("attach.downloaded")})]})}const Gc=e=>f.Children.toArray(e).filter(f.isValidElement);function dv(e){if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(dv).join("");if(!f.isValidElement(e))return"";const t=e;return t.type==="br"?`
185
+ `:dv(t.props.children)||t.props.alt||""}function $Ne({children:e,direction:t}){const n=f.useMemo(()=>{const a=Gc(e),r=a.find(u=>u.type==="thead"),i=a.find(u=>u.type==="tbody"),o=u=>({text:dv(u.props.children),content:u.props.children}),c=Gc(Gc(r?.props.children)[0]?.props.children).map(u=>({...o(u),align:u.props.align==="left"||u.props.align==="right"||u.props.align==="center"?u.props.align:void 0})),d=Gc(i?.props.children).map(u=>Gc(u.props.children).map(o));return{columns:c,rows:d}},[e]);return s.jsx(b5,{...n,direction:t})}const Fi=new Map,BNe=200,pC=4*1024*1024;function FNe(e,t){if(t.length>pC)return;Fi.set(e,t);let n=0;for(const a of Fi.values())n+=a.length;for(const[a,r]of Fi){if(Fi.size<=BNe&&n<=pC)break;Fi.delete(a),n-=r.length}}const gD=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)},UNe="github-light-default",qNe="github-dark-default",bD={javascript:()=>Oe(()=>import("./javascript-wDzz0qaB.js"),[]),jsx:()=>Oe(()=>import("./jsx-g9-lgVsj.js"),[]),typescript:()=>Oe(()=>import("./typescript-BPQ3VLAy.js"),[]),tsx:()=>Oe(()=>import("./tsx-COt5Ahok.js"),[]),json:()=>Oe(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Oe(()=>import("./jsonc-Des-eS-w.js"),[]),json5:()=>Oe(()=>import("./json5-C9tS-k6U.js"),[]),bash:()=>Oe(()=>import("./bash-Yzrsuije.js"),[]),powershell:()=>Oe(()=>import("./powershell-BmBUJMz7.js"),[]),fish:()=>Oe(()=>import("./fish-BvzEVeQv.js"),[]),python:()=>Oe(()=>import("./python-B6aJPvgy.js"),[]),html:()=>Oe(()=>import("./html-pp8916En.js"),__vite__mapDeps([51,52,53])),css:()=>Oe(()=>import("./css-CLj8gQPS.js"),[]),scss:()=>Oe(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([54,53])),sass:()=>Oe(()=>import("./sass-Cj5Yp3dK.js"),[]),less:()=>Oe(()=>import("./less-B1dDrJ26.js"),[]),markdown:()=>Oe(()=>import("./markdown-Cvjx9yec.js"),[]),mdx:()=>Oe(()=>import("./mdx-Cmh6b_Ma.js"),[]),yaml:()=>Oe(()=>import("./yaml-Buea-lGh.js"),[]),toml:()=>Oe(()=>import("./toml-vGWfd6FD.js"),[]),xml:()=>Oe(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([55,56])),c:()=>Oe(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Oe(()=>import("./cpp-DddhVWhK.js"),__vite__mapDeps([57,58])),csharp:()=>Oe(()=>import("./csharp-DSvCPggb.js"),[]),rust:()=>Oe(()=>import("./rust-B1yitclQ.js"),[]),go:()=>Oe(()=>import("./go-C27-OAKa.js"),[]),ruby:()=>Oe(()=>import("./ruby-Ct1eTYOr.js"),__vite__mapDeps([59,51,52,53,55,56,60,61,62,63,64,57,58,65,66,67])),php:()=>Oe(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([68,51,52,53,55,56,60,69])),java:()=>Oe(()=>import("./java-CylS5w8V.js"),[]),kotlin:()=>Oe(()=>import("./kotlin-BdnUsdx6.js"),[]),swift:()=>Oe(()=>import("./swift-C2oV4EkX.js"),[]),dart:()=>Oe(()=>import("./dart-bE4Kk8sk.js"),[]),r:()=>Oe(()=>import("./r-Cf5RLm7j.js"),[]),lua:()=>Oe(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([66,58])),sql:()=>Oe(()=>import("./sql-CRqJ_cUM.js"),[]),graphql:()=>Oe(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([61,52,62,63,64])),proto:()=>Oe(()=>import("./proto-C7zT0LnQ.js"),[]),dockerfile:()=>Oe(()=>import("./dockerfile-BcOcwvcX.js"),[]),makefile:()=>Oe(()=>import("./makefile-CHLpvVh8.js"),[]),diff:()=>Oe(()=>import("./diff-D97Zzqfu.js"),[]),wasm:()=>Oe(()=>import("./wasm-MzD3tlZU.js"),[])},HNe={js:"javascript",node:"javascript",ts:"typescript",sh:"bash",zsh:"bash",shell:"bash",ps1:"powershell",py:"python",htm:"html",yml:"yaml",md:"markdown",svg:"xml","c++":"cpp",cc:"cpp",cxx:"cpp",cs:"csharp","c#":"csharp",rs:"rust",golang:"go",rb:"ruby",kt:"kotlin",gql:"graphql",protobuf:"proto",docker:"dockerfile",make:"makefile"},WNe=new Set(["","text","txt","plaintext","plain"]);let wm;const Db=new Map;function KNe(e){const t=HNe[e];return t||(Object.prototype.hasOwnProperty.call(bD,e)?e:void 0)}function VNe(){if(wm)return wm;const e=(async()=>{const{createHighlighterCore:t}=await Oe(async()=>{const{createHighlighterCore:a}=await import("./core-DEmsLy1p.js");return{createHighlighterCore:a}},__vite__mapDeps([70,1,2,10,3,4,8])),{createJavaScriptRegexEngine:n}=await Oe(async()=>{const{createJavaScriptRegexEngine:a}=await import("./engine-javascript-D5Xfc425.js");return{createJavaScriptRegexEngine:a}},[]);return t({themes:[Oe(()=>import("./github-light-default-D7oLnXFd.js"),[]).then(a=>a.default),Oe(()=>import("./github-dark-default-Cuk6v7N8.js"),[]).then(a=>a.default)],langs:[],engine:n()})})().catch(t=>{throw wm=void 0,t});return wm=e,e}function GNe(e,t){const n=Db.get(t);if(n)return n;const a=bD[t]().then(r=>e.loadLanguage(r.default)).catch(r=>{throw Db.delete(t),r});return Db.set(t,a),a}async function YNe(e,t){const n=await VNe(),a=t.trim().toLowerCase(),r=WNe.has(a),i=r?void 0:KNe(a);if(!r&&!i)throw new Error(`No bundled grammar for ${a}`);return i&&await GNe(n,i),n.codeToHtml(e,{lang:i??"text",themes:{light:UNe,dark:qNe},defaultColor:"light-dark()"})}const mC=(e,t)=>`${e}:${gD(t)}`,JNe=1e5,fC="inline-flex size-7 touch:size-11 items-center justify-center rounded-full text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60";function yD({copied:e,onCopy:t,copyLabel:n,items:a}){return s.jsxs("div",{"data-code-plate":!0,className:"absolute end-1 top-1 z-[1] flex gap-0.5 rounded-full bg-composer p-0.5 opacity-0 ring-[0.5px] ring-ink/10 transition-opacity focus-within:opacity-100 group-hover/code:opacity-100 touch:opacity-100 has-[[aria-expanded=true]]:opacity-100",children:[s.jsx("button",{type:"button",onClick:t,className:fC,title:e==="copied"?l("code.copiedTitle"):e==="failed"?l("common.copyFailed"):n,"aria-label":e==="copied"?l("code.copiedTitle"):e==="failed"?l("common.copyFailed"):n,children:e==="failed"?s.jsx(Ae,{size:14,className:"text-danger","aria-hidden":"true"}):e==="copied"?s.jsx(Se,{size:14,className:"text-success","aria-hidden":"true"}):s.jsx(Qt,{size:14,"aria-hidden":"true"})}),e!=="idle"&&s.jsx("span",{role:"status",className:"sr-only",children:e==="failed"?l("common.copyFailed"):l("code.copiedTitle")}),s.jsx(Vs,{items:a,ariaLabel:l("chat.more"),placement:"above",align:"end",triggerTitle:l("chat.more"),triggerClassName:"rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60",renderTrigger:()=>s.jsx("span",{className:fC,children:s.jsx(vs,{size:14,"aria-hidden":"true"})})})]})}function QNe({code:e,lang:t,initialWrap:n=!1}){const a=!nt(),r=f.useRef(null),i=fNe(r),o=e.length<=JNe,[c,d]=f.useState(()=>o&&i?Fi.get(mC(t,e))??null:null),u=f.useMemo(()=>c?{__html:c}:null,[c]),{state:p,copy:m}=Ca(e),[h,x]=f.useState(n);f.useEffect(()=>{x(n)},[n]),f.useEffect(()=>{if(!o)return d(null);if(!i)return;const b=mC(t,e),k=Fi.get(b);if(k)return d(k);let j=!0;return YNe(e,t||"text").then(N=>{j&&(FNe(b,N),d(N))}).catch(()=>{}),()=>{j=!1}},[e,t,o,i]);const g=()=>{const b=w5e(t);j5e(b,e)},v=y5e(t),y=k5e(e),w=(b,k)=>u?s.jsx("div",{className:I(`text-[13px] [&_pre]:!bg-transparent [&_pre]:m-0 ${b}`,h?"whitespace-pre-wrap break-words overflow-x-hidden [&_pre]:!whitespace-pre-wrap [&_pre]:!break-words [&_code]:!whitespace-pre-wrap [&_code]:!break-words":"overflow-x-auto"),dangerouslySetInnerHTML:u}):s.jsx("pre",{className:I(`text-[13px] ${b.replaceAll("[&_pre]:","")}`,k,h?"whitespace-pre-wrap break-words overflow-x-hidden":"overflow-x-auto"),children:e});return a?s.jsxs("div",{ref:r,dir:"ltr","data-look":"code-block",className:"chat-code-block group/code relative my-2.5 overflow-hidden rounded-xl bg-ink/[0.04]",children:[s.jsx(yD,{copied:p,onCopy:m,copyLabel:l("code.copyTitle"),items:[{key:"wrap",label:l("code.wrapLines"),icon:s.jsx(Zd,{size:14,"aria-hidden":"true"}),active:h,onSelect:()=>x(b=>!b)},{key:"save",label:l("code.saveAsFile"),icon:s.jsx(Rt,{size:14,"aria-hidden":"true"}),onSelect:g},{key:"about",label:l("code.caption",{language:v,lines:VI(y)}),disabled:!0,separatorBefore:!0,onSelect:()=>{}}]}),w("leading-5 [&_pre]:px-3 [&_pre]:py-2","text-ink-secondary")]}):s.jsxs("div",{ref:r,dir:"ltr","data-look":"code-block",className:"chat-code-block my-2 overflow-hidden rounded-lg border border-hairline/40 bg-inset",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-hairline/30 bg-raised/30 px-3 py-1.5 text-xs",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[s.jsx("span",{title:v,className:"min-w-0 truncate rounded border border-hairline/40 bg-raised px-1.5 py-0.5 text-[11px] font-medium tracking-wide text-ink select-none",children:v}),y>0&&s.jsx("span",{className:"shrink-0 whitespace-nowrap text-[11px] text-ink-secondary select-none",children:VI(y)})]}),s.jsxs("div",{className:"chat-code-actions flex shrink-0 items-center gap-1 whitespace-nowrap",children:[s.jsxs("button",{type:"button",onClick:()=>x(b=>!b),className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] transition-colors ${h?"bg-accent/15 text-accent font-medium":"text-ink-secondary hover:bg-raised hover:text-ink"}`,title:h?l("code.unwrapLong"):l("code.wrapLong"),"aria-label":h?l("code.unwrapLong"):l("code.wrapLong"),"aria-pressed":h,children:[s.jsx(Zd,{size:12,"aria-hidden":"true"}),s.jsx("span",{children:h?l("code.unwrap"):l("code.wrap")})]}),s.jsxs("button",{type:"button",onClick:g,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-ink-secondary hover:bg-raised hover:text-ink transition-colors",title:l("code.saveTitle"),"aria-label":l("code.saveTitle"),children:[s.jsx(Rt,{size:12,"aria-hidden":"true"}),s.jsx("span",{children:l("code.save")})]}),s.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-ink-secondary hover:bg-raised hover:text-ink transition-colors",title:p==="copied"?l("code.copiedTitle"):p==="failed"?l("common.copyFailed"):l("code.copyTitle"),"aria-label":p==="copied"?l("code.copiedAria"):p==="failed"?l("common.copyFailed"):l("code.copyAria"),children:[p==="failed"?s.jsx(Ae,{size:12,className:"text-danger","aria-hidden":"true"}):p==="copied"?s.jsx(Se,{size:12,className:"text-success","aria-hidden":"true"}):s.jsx(Qt,{size:12,"aria-hidden":"true"}),s.jsx("span",{"aria-hidden":"true",className:"hidden max-sm:inline touch:inline",children:l("code.copy")}),s.jsx("span",{role:"status",className:`max-sm:sr-only touch:sr-only ${p==="failed"?"text-danger font-medium":p==="copied"?"text-success font-medium":""}`,children:p==="failed"?l("common.copyFailed"):p==="copied"?l("code.copied"):l("code.copy")})]})]})]}),w("leading-relaxed [&_pre]:p-3","text-ink")]})}const Xo=new Map,XNe=50;let hC=0;const xC=(e,t)=>`${e}:${gD(t)}`,kD=/^[a-zA-Z]:[\\/]/,gC=e=>e.startsWith("/")||kD.test(e)?e:null,jp=e=>{if(!e)return null;if(/^file:\/\//i.test(e))try{const n=new URL(e);if(n.username||n.password||n.port||n.search||n.hash)return null;const a=decodeURIComponent(n.pathname);return n.hostname&&n.hostname!=="localhost"?`//${n.hostname}${a}`:/^\/[a-z]:[\\/]/i.test(a)?a.slice(1):gC(a)}catch{return null}if(e.startsWith("\\\\"))return e;if(e.startsWith("//"))return null;const t=gC(e);return t||(e.startsWith("#")||/^[a-z][a-z\d+.-]*:/i.test(e)?null:e)};function ZNe(e,t="href"){if(xM(e)||nD(e))return e;const n=/^(?:[a-zA-Z]:%5C|%5C%5C)/i.test(e)?e.replace(/%5C/gi,"\\"):e;return/^file:\/\//i.test(n)||kD.test(n)||n.startsWith("\\\\")?jp(n)?n:"":t==="href"&&/^obsidian:\/\//i.test(e)?e:CP(e)}function eSe(){const e=this.data();(e.fromMarkdownExtensions??=[]).push(h5)}function tSe(){return(e,t)=>{typeof t.value=="string"&&q5e(e,t.value)}}const uv={},vD={singleTilde:!1};XP.call({data:()=>uv},vD);const nSe={extensions:uv.micromarkExtensions,mdastExtensions:[...uv.fromMarkdownExtensions??[],h5]};function sSe(){return e=>{const t=n=>{n.children&&(n.children=n.children.flatMap(a=>a?.type!=="text"||!a.value.includes(`
186
186
  `)?(t(a),[a]):a.value.split(`
187
187
  `).flatMap((r,i)=>[...i?[{type:"break"}]:[],...r?[{type:"text",value:r}]:[]])))};t(e)}}function aSe(){return e=>{const t=n=>{n.children&&(n.children=n.children.map(a=>{if(a?.type==="link"&&a.children?.length===1&&a.children[0]?.type==="image"){const r=a.children[0];return{...r,data:{...r.data,hProperties:{...r.data?.hProperties,"data-open-url":a.url}}}}return t(a),a}))};t(e)}}const rSe=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u{10800}-\u{10FFF}\u{1E800}-\u{1EFFF}]/u;function iSe(e){const t=new RegExp("\\p{Letter}","u").exec(e);return t&&rSe.test(t[0])?"rtl":"ltr"}function wD(e){return e?e.type==="text"?e.value??"":e.tagName==="code"||e.tagName==="pre"?"":(e.children??[]).map(wD).join(""):""}function ha(e){return iSe(wD(e))}function bC(e){if(!e||typeof window>"u"||typeof window.getComputedStyle!="function")return"dark";try{return window.getComputedStyle(e).getPropertyValue("--code-color-scheme").trim()==="light"?"light":"dark"}catch{return"dark"}}const oSe='"Inter", -apple-system, BlinkMacSystemFont, "SF UI Text", "Segoe UI", system-ui, sans-serif';function lSe({code:e}){const t=f.useRef(null),[n,a]=f.useState(0),[r,i]=f.useState(()=>Xo.get(xC(bC(typeof document>"u"?null:document.documentElement),e))??null),o=f.useMemo(()=>r?{__html:r}:null,[r]),[c,d]=f.useState(null),[u,p]=f.useState(!1),{state:m,copy:h}=Ca(e),x=!nt();f.useEffect(()=>{if(typeof MutationObserver>"u"||typeof document>"u")return;const v=new MutationObserver(()=>a(y=>y+1));return v.observe(document.documentElement,{subtree:!0,attributeFilter:["data-skin"]}),()=>v.disconnect()},[]),f.useEffect(()=>{const v=bC(t.current),y=xC(v,e),w=Xo.get(y);if(w){i(w),d(null);return}let b=!0;return Oe(()=>import("./mermaid.core-Bu-wU9fU.js").then(k=>k.b6),__vite__mapDeps([71,1,2,72])).then(k=>(hC+=1,k.default.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:v==="light"?"default":"dark",fontFamily:oSe}),k.default.render(`omb-mermaid-${hC}`,e))).then(k=>{if(b){if(Xo.size>=XNe){const j=Xo.keys().next().value;j&&Xo.delete(j)}Xo.set(y,k.svg),i(k.svg),d(null)}}).catch(k=>{if(!b)return;const j=k instanceof Error?k.message:String(k);d(j.length>300?`${j.slice(0,300)}…`:j)}),()=>{b=!1}},[e,n]);const g=s.jsxs(s.Fragment,{children:[c&&s.jsx("p",{role:"alert",className:"px-3 pt-2 text-[12px] text-danger",children:l("chat.mermaid.failed",{error:c})}),o&&s.jsx("div",{className:"overflow-x-auto p-3 [&_svg]:!max-w-full",dangerouslySetInnerHTML:o}),(u||!r||c)&&s.jsx("pre",{className:I("overflow-x-auto text-[13px]",x?"px-3 py-2 leading-5 text-ink-secondary":"p-3 leading-relaxed text-ink"),children:e})]});return x?s.jsxs("div",{ref:t,dir:"ltr",className:"group/code relative my-2.5 overflow-hidden rounded-xl bg-ink/[0.04]",children:[s.jsx(yD,{copied:m,onCopy:h,copyLabel:l("code.copySource"),items:[{key:"source",label:l(u?"code.hideSource":"code.showSource"),icon:s.jsx(Zd,{size:14,"aria-hidden":"true"}),active:u,onSelect:()=>p(v=>!v)},{key:"about",label:l("code.mermaid"),disabled:!0,separatorBefore:!0,onSelect:()=>{}}]}),g]}):s.jsxs("div",{ref:t,dir:"ltr",className:"my-2 overflow-hidden rounded-lg border border-hairline/40 bg-inset",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-hairline/30 bg-raised/30 px-3 py-1.5 text-xs",children:[s.jsx("span",{title:l("chat.mermaid.title"),className:"min-w-0 truncate rounded border border-hairline/40 bg-raised px-1.5 py-0.5 text-[11px] font-medium tracking-wide text-ink select-none",children:l("chat.mermaid.title")}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1 whitespace-nowrap",children:[s.jsxs("button",{type:"button",onClick:()=>p(v=>!v),className:`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] transition-colors ${u?"bg-accent/15 text-accent font-medium":"text-ink-secondary hover:bg-raised hover:text-ink"}`,title:l(u?"chat.mermaid.hideSourceTitle":"chat.mermaid.showSourceTitle"),"aria-label":l(u?"chat.mermaid.hideSourceTitle":"chat.mermaid.showSourceTitle"),"aria-pressed":u,children:[s.jsx(Zd,{size:12,"aria-hidden":"true"}),s.jsx("span",{className:"hidden sm:inline",children:l(u?"chat.mermaid.hideSource":"chat.mermaid.showSource")})]}),s.jsx("button",{type:"button",onClick:h,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[11px] text-ink-secondary hover:bg-raised hover:text-ink transition-colors",title:m==="copied"?l("chat.code.copied"):m==="failed"?l("common.copyFailed"):l("chat.mermaid.copy"),"aria-label":m==="copied"?l("chat.mermaid.copiedLabel"):m==="failed"?l("common.copyFailed"):l("chat.mermaid.copyLabel"),children:m==="failed"?s.jsxs(s.Fragment,{children:[s.jsx(Ae,{size:12,className:"text-danger","aria-hidden":"true"}),s.jsx("span",{className:"text-danger font-medium hidden sm:inline",children:l("common.copyFailed")})]}):m==="copied"?s.jsxs(s.Fragment,{children:[s.jsx(Se,{size:12,className:"text-success","aria-hidden":"true"}),s.jsx("span",{className:"text-success font-medium hidden sm:inline",children:l("chat.code.copiedShort")})]}):s.jsxs(s.Fragment,{children:[s.jsx(Qt,{size:12,"aria-hidden":"true"}),s.jsx("span",{className:"hidden sm:inline",children:l("common.copy")})]})})]})]}),g]})}function cSe({filePath:e,name:t,source:n,children:a,message:r}){const i=Mg(e,t,r),o=y5(e,t??Ml(e),r),c=hD();if(!r)return s.jsx("span",{title:l("chat.file.legacy"),className:"break-words text-ink-secondary",children:a});const d=i.state==="saving"?l("common.saving"):i.state==="saved"?l("common.saved"):i.state==="failed"?l("chat.retry"):null;return s.jsxs("span",{dir:"ltr",className:"inline-flex flex-wrap items-center gap-x-1.5 [unicode-bidi:isolate]",...c.targetProps(n),children:[c.menu,o.opens?s.jsx(k5,{name:t??Ml(e),save:i,retryable:i.retryable}):s.jsx(v5,{path:e,name:t??Ml(e),message:r}),s.jsxs("button",{type:"button",onClick:o.opens?o.show:()=>{i.save()},disabled:!o.opens&&i.state==="saving",title:o.opens?o.label:l("chat.file.saveCopy"),className:"inline-flex items-center gap-1 break-words text-start text-accent underline decoration-accent/40 hover:decoration-accent disabled:cursor-wait",children:[a,o.opens?s.jsx(Za,{size:12,className:"shrink-0","aria-hidden":"true"}):i.state==="saving"?s.jsx(ke,{size:12,className:"shrink-0 animate-spin","aria-hidden":"true"}):i.state==="saved"?s.jsx(Se,{size:12,className:"shrink-0 text-success","aria-hidden":"true"}):i.state==="failed"?i.retryable&&s.jsx(Ma,{size:12,className:"shrink-0","aria-hidden":"true"}):s.jsx(Rt,{size:12,className:"shrink-0","aria-hidden":"true"})]}),d&&s.jsx("span",{role:i.state==="failed"?"alert":"status",title:i.state==="saved"?i.savedTo:void 0,className:`text-[12px] ${i.state==="saved"?"text-success":i.state==="failed"?"text-danger":"text-ink-secondary"}`,children:i.state==="failed"?w5(i):d}),i.state==="failed"&&i.outsideWorkspace&&s.jsx("span",{className:"inline-flex flex-wrap items-center gap-x-1.5 text-[12px]",children:s.jsx(j5,{filePath:e})}),i.folder&&s.jsx(ONe,{folderPath:e,listing:i.folder,message:r}),o.dialog]})}function dSe({children:e}){const[t,n]=f.useState(!1);return t?s.jsxs("span",{className:"mx-px inline rounded px-1 py-px text-[13px] leading-relaxed text-ink underline decoration-dotted decoration-hairline underline-offset-2",children:[e,s.jsx("button",{type:"button","aria-label":l("chat.spoiler.hide"),title:l("chat.spoiler.hide"),onClick:()=>n(!1),className:"ms-1 rounded px-0.5 text-[11px] text-ink-secondary hover:text-ink",children:l("chat.spoiler.hideShort")})]}):s.jsxs("span",{className:"relative mx-px inline-block rounded px-1 py-px",children:[s.jsx("span",{"aria-hidden":"true",className:"pointer-events-none select-none bg-raised text-transparent [&_*]:!text-transparent [&_a]:!no-underline",children:e}),s.jsx("button",{type:"button","aria-label":l("chat.spoiler.reveal"),title:l("chat.spoiler.reveal"),onClick:()=>n(!0),className:"absolute inset-0 rounded bg-raised/90"})]})}const pv=[],uSe="![",pSe=new RegExp("(?<![$\\p{L}\\p{N}])(?:R|US|AU|A|CA|C|NZ|HK|SG|S|MX|NT|BZ|Z)\\$(?=[ \\t\\u00a0]?\\d)","gu");function mSe(e){const t=[],n=e.replace(/\$\$[\s\S]*?\$\$/g,c=>`\0OMB_MATH_${t.push(c)-1}\0`).replace(pSe,c=>`${c.slice(0,-1)}\\$`),a=new Set,r=[];for(let c=0;c<n.length;c++)n[c]==="\\"?c++:n[c]==="$"&&r.push(c);let i=null;for(const c of r){if(i!==null){if(!/\s/.test(n[c-1])&&!/\d/.test(n[c+1]??"")&&!/\n[ \t]*\n/.test(n.slice(i,c))){i=null;continue}a.add(i)}i=/\S/.test(n[c+1]??"")?c:null,i===null&&a.add(c)}i!==null&&a.add(i);let o="";for(let c=0;c<n.length;c++)o+=a.has(c)?"\\$":n[c];return t.forEach((c,d)=>{o=o.split(`\0OMB_MATH_${d}\0`).join(c)}),o}function fSe(e,t){const n=[],a=(u,p)=>{const m=`\0OMB_CODE_${n.length}\0`;return n.push({value:u,sourceOffset:p}),m},r=[],i=[],o=(u,p=!1)=>{const m=u.position?.start.offset,h=u.position?.end.offset,x=u.type==="image"||u.type==="imageReference";x&&m!==void 0&&i.push(m);const g=u.type==="link"&&m!==void 0&&e[m]==="["?u.children?.at(-1)?.position?.end.offset:void 0,v=u.type==="code"||u.type==="inlineCode"||u.type==="definition"||u.type==="linkReference"||u.type==="link"||t!==void 0&&x;!p&&v&&m!==void 0&&h!==void 0&&r.push({start:g??m,end:h}),u.children?.forEach(y=>o(y,p||v&&g===void 0))};o(Cg(e,nSe));for(const{start:u,end:p}of r.sort((m,h)=>h.start-m.start))e=e.slice(0,u)+a(e.slice(u,p),u)+e.slice(p);let c=e.replace(/\\\[([\s\S]*?)\\\]/g,(u,p)=>`$$
188
188
  ${p}
189
189
  $$`).replace(/\\\(([\s\S]*?)\\\)/g,(u,p)=>`$${p.trim()}$`).replace(/\$\$[ \t]*([^\n][\s\S]*?)[ \t]*\$\$/g,(u,p)=>`$$
190
190
  ${p}
191
- $$`);c=mSe(c);let d=0;return c=c.replace(/\u0000OMB_CODE_(\d+)\u0000/g,(u,p,m)=>{const h=n[Number(p)];if(!h)return u;const{value:x,sourceOffset:g}=h;for(const v of i)v>=g&&v<g+x.length&&t?.set(m+d+v-g,v);return d+=x.length-u.length,x}),c}const Yc=new Map,hSe=bi*2;function xSe(e){const t=Yc.get(e);if(t)return t;const n=e.includes(uSe)?new Map:void 0,a=fSe(n?e:T5e(e),n);if(Yc.size>=hSe){const i=Yc.keys().next().value;i!==void 0&&Yc.delete(i)}const r={source:a,imageOffsets:n};return Yc.set(e,r),r}let Pd=null,$b=null;function gSe(){return Pd?Promise.resolve():($b??=Oe(()=>import("./index-D2TZFrfq.js"),__vite__mapDeps([73,74,1,2,10,3,4,8])).then(async e=>{typeof document<"u"&&await Oe(()=>Promise.resolve({}),__vite__mapDeps([75])),Pd=e.default}).catch(e=>{throw $b=null,e}),$b)}function bSe(e){for(let t=0;t<e.length;t++){if(e.charCodeAt(t)===92){t+=1;continue}if(e[t]!=="$")continue;const n=e[t+1];if(n===void 0)return!1;if(n==="$"){if(e.indexOf("$$",t+2)!==-1)return!0;t+=1;continue}return e.indexOf("$",t+1)!==-1}return!1}const Ml=e=>e.split(/[\\/]/).at(-1)??e,N5=f.createContext({threads:[]});function ySe({node:e,children:t}){const n=Array.isArray(t)?t[0]:t,a=n?.props?.className??"",{lang:r,wrap:i}=N5e(/language-([^\s]+)/.exec(a)?.[1]??"",e?.children?.[0]?.data?.meta),o=d=>typeof d=="string"?d:Array.isArray(d)?d.map(o).join(""):d?.props?.children?o(d.props.children):"",c=o(n?.props?.children).replace(/\n$/,"");return r.trim().toLowerCase()==="mermaid"?s.jsx(lSe,{code:c}):s.jsx(QNe,{code:c,lang:r,initialWrap:i})}function kSe(e){const{message:t,imageOffsets:n}=f.useContext(N5),{src:a,alt:r}=e;if(!a)return s.jsx("span",{className:"text-[12px] text-danger",role:"alert",children:l("attach.imageUnavailable")});const i=jp(a)??void 0,o=e.node?.position?.start.offset;return s.jsx(PNe,{src:a,name:S5e(a,r),openUrl:I5e(typeof e["data-open-url"]=="string"?String(e["data-open-url"]):a),filePath:i,message:i?t:void 0,sourceOffset:o===void 0?void 0:n?.get(o)??o})}function vSe({href:e,children:t,...n}){const a=n,{threads:r,currentBotId:i,message:o,delivered:c,originals:d}=f.useContext(N5),u=Rbe(e),p=x5();if(!e)return s.jsx("span",{className:"break-words",children:t});if(nD(e))return s.jsx(e4e,{children:t});const m=vu(e),h=m?Zx(r,m,i):null;if(h)return s.jsx(s3,{target:h,ambiguous:h.ambiguous,children:t});if(m||xM(e))return s.jsx("span",{className:"break-words",children:t});const x=jp(e);if(x){const y=c&&Object.hasOwn(c,Ml(x))?c[Ml(x)]:void 0,w=y&&d&&Object.hasOwn(d,y)?d[y]:void 0;return s.jsx(cSe,{filePath:y??x,name:y?Ml(x):void 0,source:w,message:o,children:t})}if(!/^https?:\/\//i.test(e))return s.jsx("a",{href:e,target:"_blank",rel:"noreferrer",dir:"auto",className:XI,children:t});const g=c4e(a,e),v=g?oD[g.kind]:null;return s.jsx(x4e,{href:e,github:g,children:y=>{const w=X5e(e,p,u.onContextMenu?{...y,onContextMenu:u.onContextMenu}:y);return s.jsxs(s.Fragment,{children:[u.menu,v?s.jsxs("a",{...w,href:e,target:"_blank",rel:"noreferrer",dir:"ltr",title:e,"data-github-ref":g.kind,className:Z5e,children:[s.jsx(v,{size:13,"aria-hidden":"true",className:"shrink-0 self-center text-ink-tertiary"}),s.jsx("span",{children:t})]}):s.jsx("a",{...w,href:e,target:"_blank",rel:"noreferrer",dir:"auto",className:XI,children:t})]})}})}const wSe={pre:ySe,img:kSe,code({children:e}){return s.jsx("code",{dir:"ltr",className:"ui-code-chip break-words [unicode-bidi:isolate]",children:e})},span(e){const t=Fie(e);if(t)return s.jsx(s3,{target:t.target,ambiguous:t.ambiguous,children:e.children});const{node:n,children:a,...r}=e;return s.jsx("span",{...r,children:a})},a:vSe,table({node:e,children:t}){return s.jsx($Ne,{direction:ha(e),children:t})},th({children:e}){return s.jsx("th",{className:"border-b border-hairline/40 px-2 py-1.5 text-start font-semibold",children:e})},td({children:e}){return s.jsx("td",{className:"border-b border-hairline/20 px-2 py-1.5 align-top",children:e})},p({node:e,children:t}){return s.jsx("p",{dir:ha(e),children:t})},ul({node:e,children:t}){return s.jsx("ul",{dir:ha(e),className:"list-disc space-y-1 ps-5",children:t})},ol({node:e,children:t}){return s.jsx("ol",{dir:ha(e),className:"list-decimal space-y-1 ps-5",children:t})},h1({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"md-heading mt-3 text-[20px] font-semibold leading-[26px] tracking-[-0.01em]",children:t})},h2({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"md-heading mt-2 text-[17px] font-semibold leading-6 tracking-[-0.005em]",children:t})},h3({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"mt-1.5 font-semibold",children:t})},h4({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"mt-1.5 font-semibold",children:t})},h5({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"mt-1.5 text-[14px] font-semibold",children:t})},h6({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"mt-1.5 text-[14px] font-semibold text-ink-secondary",children:t})},blockquote({node:e,children:t}){return s.jsx("blockquote",{dir:ha(e),className:"border-s-2 border-hairline ps-3 text-ink-secondary",children:t})},del({children:e}){return s.jsx(dSe,{children:e})},hr(){return s.jsx("hr",{className:"border-hairline/40"})}},jSe=/#[^\s#]|openmausbot/i,NSe={threads:[]},SSe=[[XP,vD],f5e,eSe,tSe,aSe,sSe,l4e],ISe=[];let Bb=null;const CSe=e=>e?(Bb?.plugin!==e&&(Bb={plugin:e,list:[e]}),Bb.list):ISe,ESe=b5e(),yC=new WeakMap,ASe=e=>{let t=yC.get(e);return t===void 0&&(t=e.map(n=>`${n.name}${n.hidden?1:0}${n.person?1:0}${n.color??""}`).join(""),yC.set(e,t)),t},kC=new WeakMap;let TSe=0;const MSe=e=>{let t=kC.get(e);return t===void 0&&kC.set(e,t=++TSe),t};function _Se({text:e,message:t,mentionPeers:n=pv,everyone:a=!1,mentionPerson:r,delivered:i,originals:o}){const{threads:c,currentBotId:d}=jSe.test(e)?f.use(n3):NSe,{source:u,imageOffsets:p}=xSe(e),m=bSe(u),[h,x]=f.useState(()=>Pd!==null);f.useEffect(()=>{if(!m)return;if(Pd){x(!0);return}let k=!0;return gSe().then(()=>{k&&x(!0)},()=>{}),()=>{k=!1}},[m]);const g=m&&h?Pd:null,v=u.includes("@"),y=c.length>0,w=`${g?"math":""}${v?`${ASe(n)}${a?1:0}${r?.profileName??""}`:""}${y?`${MSe(c)}${d??""}`:""}`,b=ESe.render(e,w,()=>{const k=[...SSe];return v&&k.push([kie,{peers:n,everyone:a,person:r}]),y&&k.push(Pie(c,d)),V2e({children:u,remarkPlugins:k,rehypePlugins:CSe(g),urlTransform:ZNe,components:wSe})});return s.jsx(N5.Provider,{value:{message:t,imageOffsets:p,threads:c,currentBotId:d,delivered:i,originals:o},children:s.jsx("div",{"data-look":"bot-text",className:"chat-md min-w-0 [&>*+*]:mt-2",children:b})})}function RSe(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,a)=>{const r=t[a];return n.name===r.name&&n.hidden===r.hidden&&n.color===r.color&&n.person===r.person})}const xr=f.memo(_Se,(e,t)=>e.text===t.text&&RSe(e.mentionPeers??pv,t.mentionPeers??pv)&&e.everyone===t.everyone&&xie(e.mentionPerson,t.mentionPerson)&&e.message?.threadId===t.message?.threadId&&e.message?.messageId===t.message?.messageId&&vC(e.delivered,t.delivered)&&vC(e.originals,t.originals));function vC(e,t){if(e===t)return!0;const n=Object.entries(e??{}),a=t??{};return n.length===Object.keys(a).length&&n.every(([r,i])=>a[r]===i)}const wC=new Set;function OSe(e,t){if(!t?.busy||!Number.isFinite(t.turnStartedAt)||t.turnStartedAt==null)return wC;const n=new Set(e.filter(r=>r.turnId&&(r.turnTerminal||r.turnCompletedAt!=null)).map(r=>r.turnId)),a=new Set;for(const r of e)r.kind==="activity"&&r.at>=t.turnStartedAt&&!r.turnTerminal&&r.turnCompletedAt==null&&(!r.turnId||!n.has(r.turnId))&&a.add(r.id);return a.size===0?wC:a}const jD=f.createContext(new Set),LSe=(e,t)=>e.size===t.size&&[...e].every(n=>t.has(n));function ND(e,t){const n=f.useRef(null),{busy:a,turnStartedAt:r}=t;return f.useMemo(()=>{const i=OSe(e,{busy:a,turnStartedAt:r});return n.current&&LSe(n.current,i)?n.current:n.current=i},[e,a,r])}function jC(e){if(!Number.isFinite(e)||e<=0)return"0:00";const t=Math.floor(e);return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function SD({attachment:e,className:t}){const n=Hae(e.path),a=f.useRef(null),r=f.useRef(null),[i,o]=f.useState(!1),[c,d]=f.useState(typeof e.durationMs=="number"&&e.durationMs>0?e.durationMs/1e3:null),[u,p]=f.useState(0),[m,h]=f.useState(!1),x=e.text?.trim()??"",g=js(nr().phase);if(f.useEffect(()=>()=>r.current?.(),[]),!n)return null;const v=b=>{b&&r.current!==b||(r.current?.(),r.current=null)},y=()=>{const b=a.current;if(!b)return;if(!b.paused){b.pause();return}if(g)return;r.current?.();const k=Gt.claimExternalVoice(()=>b.pause());r.current=k,b.play().catch(()=>v(k))},w=b=>{const k=a.current;k&&Number.isFinite(b)&&(k.currentTime=b),p(b)};return s.jsxs("div",{className:I("flex w-full flex-col rounded-xl bg-inset/60 px-3 py-2",t),"data-test-voice-note":"",children:[s.jsxs("div",{className:"flex w-full items-center gap-3",children:[s.jsx("audio",{ref:a,src:n,preload:"metadata",onLoadedMetadata:b=>{const k=b.currentTarget.duration;Number.isFinite(k)&&k>0&&d(k)},onTimeUpdate:b=>p(b.currentTarget.currentTime),onPlay:()=>o(!0),onPause:b=>{b.currentTarget.paused&&(o(!1),v())},onEnded:()=>{o(!1),v()}}),s.jsx("button",{type:"button",onClick:y,disabled:g&&!i,"aria-label":i?l("chat.voiceNote.pause"):g?l("chat.voiceNote.onLiveCall"):l("chat.voiceNote.play"),title:i?l("chat.voiceNote.pause"):g?l("chat.voiceNote.onLiveCall"):l("chat.voiceNote.play"),className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-accent text-white transition-opacity hover:opacity-90 disabled:opacity-40",children:i?s.jsx(Ju,{size:13,className:"fill-current"}):s.jsx(pc,{size:13,className:"translate-x-px fill-current"})}),s.jsx("input",{type:"range","aria-label":l("chat.voiceNote.seek"),min:0,max:c??0,step:.1,value:Math.min(u,c??u),onChange:b=>w(Number(b.currentTarget.value)),disabled:!c,className:"h-1 flex-1 accent-accent"}),s.jsxs("span",{className:"shrink-0 text-[11px] tabular-nums text-ink-secondary",children:[jC(u)," / ",c===null?"--:--":jC(c)]})]}),x&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>h(b=>!b),"data-test-voice-note-transcript":"","aria-expanded":m,className:"mt-1 flex items-center gap-0.5 self-start text-[12px] text-ink-secondary transition-colors hover:text-ink",children:[s.jsx(it,{size:12,"aria-hidden":"true",className:I("transition-transform duration-150",m&&"rotate-90")}),l("chat.voiceNote.transcript")]}),m&&s.jsx("p",{className:"mt-1 whitespace-pre-wrap text-[13px] leading-snug text-ink",children:x})]})]})}function ID({active:e,onToggle:t,className:n}){const a=l(e?"chat.showRenderedMarkdown":"chat.showRawMarkdown");return s.jsx("button",{type:"button",onClick:t,"aria-label":a,"aria-pressed":e,title:a,className:I("rounded-md p-1.5 transition-opacity focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 touch:opacity-100",e?"bg-raised text-accent opacity-100":"text-ink-secondary opacity-0 hover:bg-raised hover:text-ink",n),children:e?s.jsx(Za,{...Yt,"aria-hidden":"true"}):s.jsx(L7,{...Yt,"aria-hidden":"true"})})}function CD({text:e,className:t}){return s.jsx("pre",{dir:"auto","data-testid":"raw-markdown-view",tabIndex:0,className:I("max-h-[36rem] overflow-auto whitespace-pre-wrap break-words rounded-lg border border-hairline/30 bg-inset/50 p-3 font-mono text-[13px] leading-relaxed text-ink select-text",t),children:e})}const NC=140;function zSe(e){if(e.roomRequest?.phase!=="result")return null;const t=e.tool?.output?.trim();if(!t)return null;const[n="",...a]=t.split(`
191
+ $$`);c=mSe(c);let d=0;return c=c.replace(/\u0000OMB_CODE_(\d+)\u0000/g,(u,p,m)=>{const h=n[Number(p)];if(!h)return u;const{value:x,sourceOffset:g}=h;for(const v of i)v>=g&&v<g+x.length&&t?.set(m+d+v-g,v);return d+=x.length-u.length,x}),c}const Yc=new Map,hSe=bi*2;function xSe(e){const t=Yc.get(e);if(t)return t;const n=e.includes(uSe)?new Map:void 0,a=fSe(n?e:T5e(e),n);if(Yc.size>=hSe){const i=Yc.keys().next().value;i!==void 0&&Yc.delete(i)}const r={source:a,imageOffsets:n};return Yc.set(e,r),r}let Pd=null,$b=null;function gSe(){return Pd?Promise.resolve():($b??=Oe(()=>import("./index-DaC1P4Ff.js"),__vite__mapDeps([73,74,1,2,10,3,4,8])).then(async e=>{typeof document<"u"&&await Oe(()=>Promise.resolve({}),__vite__mapDeps([75])),Pd=e.default}).catch(e=>{throw $b=null,e}),$b)}function bSe(e){for(let t=0;t<e.length;t++){if(e.charCodeAt(t)===92){t+=1;continue}if(e[t]!=="$")continue;const n=e[t+1];if(n===void 0)return!1;if(n==="$"){if(e.indexOf("$$",t+2)!==-1)return!0;t+=1;continue}return e.indexOf("$",t+1)!==-1}return!1}const Ml=e=>e.split(/[\\/]/).at(-1)??e,N5=f.createContext({threads:[]});function ySe({node:e,children:t}){const n=Array.isArray(t)?t[0]:t,a=n?.props?.className??"",{lang:r,wrap:i}=N5e(/language-([^\s]+)/.exec(a)?.[1]??"",e?.children?.[0]?.data?.meta),o=d=>typeof d=="string"?d:Array.isArray(d)?d.map(o).join(""):d?.props?.children?o(d.props.children):"",c=o(n?.props?.children).replace(/\n$/,"");return r.trim().toLowerCase()==="mermaid"?s.jsx(lSe,{code:c}):s.jsx(QNe,{code:c,lang:r,initialWrap:i})}function kSe(e){const{message:t,imageOffsets:n}=f.useContext(N5),{src:a,alt:r}=e;if(!a)return s.jsx("span",{className:"text-[12px] text-danger",role:"alert",children:l("attach.imageUnavailable")});const i=jp(a)??void 0,o=e.node?.position?.start.offset;return s.jsx(PNe,{src:a,name:S5e(a,r),openUrl:I5e(typeof e["data-open-url"]=="string"?String(e["data-open-url"]):a),filePath:i,message:i?t:void 0,sourceOffset:o===void 0?void 0:n?.get(o)??o})}function vSe({href:e,children:t,...n}){const a=n,{threads:r,currentBotId:i,message:o,delivered:c,originals:d}=f.useContext(N5),u=Rbe(e),p=x5();if(!e)return s.jsx("span",{className:"break-words",children:t});if(nD(e))return s.jsx(e4e,{children:t});const m=vu(e),h=m?Zx(r,m,i):null;if(h)return s.jsx(s3,{target:h,ambiguous:h.ambiguous,children:t});if(m||xM(e))return s.jsx("span",{className:"break-words",children:t});const x=jp(e);if(x){const y=c&&Object.hasOwn(c,Ml(x))?c[Ml(x)]:void 0,w=y&&d&&Object.hasOwn(d,y)?d[y]:void 0;return s.jsx(cSe,{filePath:y??x,name:y?Ml(x):void 0,source:w,message:o,children:t})}if(!/^https?:\/\//i.test(e))return s.jsx("a",{href:e,target:"_blank",rel:"noreferrer",dir:"auto",className:XI,children:t});const g=c4e(a,e),v=g?oD[g.kind]:null;return s.jsx(x4e,{href:e,github:g,children:y=>{const w=X5e(e,p,u.onContextMenu?{...y,onContextMenu:u.onContextMenu}:y);return s.jsxs(s.Fragment,{children:[u.menu,v?s.jsxs("a",{...w,href:e,target:"_blank",rel:"noreferrer",dir:"ltr",title:e,"data-github-ref":g.kind,className:Z5e,children:[s.jsx(v,{size:13,"aria-hidden":"true",className:"shrink-0 self-center text-ink-tertiary"}),s.jsx("span",{children:t})]}):s.jsx("a",{...w,href:e,target:"_blank",rel:"noreferrer",dir:"auto",className:XI,children:t})]})}})}const wSe={pre:ySe,img:kSe,code({children:e}){return s.jsx("code",{dir:"ltr",className:"ui-code-chip break-words [unicode-bidi:isolate]",children:e})},span(e){const t=Fie(e);if(t)return s.jsx(s3,{target:t.target,ambiguous:t.ambiguous,children:e.children});const{node:n,children:a,...r}=e;return s.jsx("span",{...r,children:a})},a:vSe,table({node:e,children:t}){return s.jsx($Ne,{direction:ha(e),children:t})},th({children:e}){return s.jsx("th",{className:"border-b border-hairline/40 px-2 py-1.5 text-start font-semibold",children:e})},td({children:e}){return s.jsx("td",{className:"border-b border-hairline/20 px-2 py-1.5 align-top",children:e})},p({node:e,children:t}){return s.jsx("p",{dir:ha(e),children:t})},ul({node:e,children:t}){return s.jsx("ul",{dir:ha(e),className:"list-disc space-y-1 ps-5",children:t})},ol({node:e,children:t}){return s.jsx("ol",{dir:ha(e),className:"list-decimal space-y-1 ps-5",children:t})},h1({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"md-heading mt-3 text-[20px] font-semibold leading-[26px] tracking-[-0.01em]",children:t})},h2({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"md-heading mt-2 text-[17px] font-semibold leading-6 tracking-[-0.005em]",children:t})},h3({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"mt-1.5 font-semibold",children:t})},h4({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"mt-1.5 font-semibold",children:t})},h5({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"mt-1.5 text-[14px] font-semibold",children:t})},h6({node:e,children:t}){return s.jsx("div",{dir:ha(e),className:"mt-1.5 text-[14px] font-semibold text-ink-secondary",children:t})},blockquote({node:e,children:t}){return s.jsx("blockquote",{dir:ha(e),className:"border-s-2 border-hairline ps-3 text-ink-secondary",children:t})},del({children:e}){return s.jsx(dSe,{children:e})},hr(){return s.jsx("hr",{className:"border-hairline/40"})}},jSe=/#[^\s#]|openmausbot/i,NSe={threads:[]},SSe=[[XP,vD],f5e,eSe,tSe,aSe,sSe,l4e],ISe=[];let Bb=null;const CSe=e=>e?(Bb?.plugin!==e&&(Bb={plugin:e,list:[e]}),Bb.list):ISe,ESe=b5e(),yC=new WeakMap,ASe=e=>{let t=yC.get(e);return t===void 0&&(t=e.map(n=>`${n.name}${n.hidden?1:0}${n.person?1:0}${n.color??""}`).join(""),yC.set(e,t)),t},kC=new WeakMap;let TSe=0;const MSe=e=>{let t=kC.get(e);return t===void 0&&kC.set(e,t=++TSe),t};function _Se({text:e,message:t,mentionPeers:n=pv,everyone:a=!1,mentionPerson:r,delivered:i,originals:o}){const{threads:c,currentBotId:d}=jSe.test(e)?f.use(n3):NSe,{source:u,imageOffsets:p}=xSe(e),m=bSe(u),[h,x]=f.useState(()=>Pd!==null);f.useEffect(()=>{if(!m)return;if(Pd){x(!0);return}let k=!0;return gSe().then(()=>{k&&x(!0)},()=>{}),()=>{k=!1}},[m]);const g=m&&h?Pd:null,v=u.includes("@"),y=c.length>0,w=`${g?"math":""}${v?`${ASe(n)}${a?1:0}${r?.profileName??""}`:""}${y?`${MSe(c)}${d??""}`:""}`,b=ESe.render(e,w,()=>{const k=[...SSe];return v&&k.push([kie,{peers:n,everyone:a,person:r}]),y&&k.push(Pie(c,d)),V2e({children:u,remarkPlugins:k,rehypePlugins:CSe(g),urlTransform:ZNe,components:wSe})});return s.jsx(N5.Provider,{value:{message:t,imageOffsets:p,threads:c,currentBotId:d,delivered:i,originals:o},children:s.jsx("div",{"data-look":"bot-text",className:"chat-md min-w-0 [&>*+*]:mt-2",children:b})})}function RSe(e,t){return e===t?!0:e.length!==t.length?!1:e.every((n,a)=>{const r=t[a];return n.name===r.name&&n.hidden===r.hidden&&n.color===r.color&&n.person===r.person})}const xr=f.memo(_Se,(e,t)=>e.text===t.text&&RSe(e.mentionPeers??pv,t.mentionPeers??pv)&&e.everyone===t.everyone&&xie(e.mentionPerson,t.mentionPerson)&&e.message?.threadId===t.message?.threadId&&e.message?.messageId===t.message?.messageId&&vC(e.delivered,t.delivered)&&vC(e.originals,t.originals));function vC(e,t){if(e===t)return!0;const n=Object.entries(e??{}),a=t??{};return n.length===Object.keys(a).length&&n.every(([r,i])=>a[r]===i)}const wC=new Set;function OSe(e,t){if(!t?.busy||!Number.isFinite(t.turnStartedAt)||t.turnStartedAt==null)return wC;const n=new Set(e.filter(r=>r.turnId&&(r.turnTerminal||r.turnCompletedAt!=null)).map(r=>r.turnId)),a=new Set;for(const r of e)r.kind==="activity"&&r.at>=t.turnStartedAt&&!r.turnTerminal&&r.turnCompletedAt==null&&(!r.turnId||!n.has(r.turnId))&&a.add(r.id);return a.size===0?wC:a}const jD=f.createContext(new Set),LSe=(e,t)=>e.size===t.size&&[...e].every(n=>t.has(n));function ND(e,t){const n=f.useRef(null),{busy:a,turnStartedAt:r}=t;return f.useMemo(()=>{const i=OSe(e,{busy:a,turnStartedAt:r});return n.current&&LSe(n.current,i)?n.current:n.current=i},[e,a,r])}function jC(e){if(!Number.isFinite(e)||e<=0)return"0:00";const t=Math.floor(e);return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function SD({attachment:e,className:t}){const n=Hae(e.path),a=f.useRef(null),r=f.useRef(null),[i,o]=f.useState(!1),[c,d]=f.useState(typeof e.durationMs=="number"&&e.durationMs>0?e.durationMs/1e3:null),[u,p]=f.useState(0),[m,h]=f.useState(!1),x=e.text?.trim()??"",g=js(nr().phase);if(f.useEffect(()=>()=>r.current?.(),[]),!n)return null;const v=b=>{b&&r.current!==b||(r.current?.(),r.current=null)},y=()=>{const b=a.current;if(!b)return;if(!b.paused){b.pause();return}if(g)return;r.current?.();const k=Gt.claimExternalVoice(()=>b.pause());r.current=k,b.play().catch(()=>v(k))},w=b=>{const k=a.current;k&&Number.isFinite(b)&&(k.currentTime=b),p(b)};return s.jsxs("div",{className:I("flex w-full flex-col rounded-xl bg-inset/60 px-3 py-2",t),"data-test-voice-note":"",children:[s.jsxs("div",{className:"flex w-full items-center gap-3",children:[s.jsx("audio",{ref:a,src:n,preload:"metadata",onLoadedMetadata:b=>{const k=b.currentTarget.duration;Number.isFinite(k)&&k>0&&d(k)},onTimeUpdate:b=>p(b.currentTarget.currentTime),onPlay:()=>o(!0),onPause:b=>{b.currentTarget.paused&&(o(!1),v())},onEnded:()=>{o(!1),v()}}),s.jsx("button",{type:"button",onClick:y,disabled:g&&!i,"aria-label":i?l("chat.voiceNote.pause"):g?l("chat.voiceNote.onLiveCall"):l("chat.voiceNote.play"),title:i?l("chat.voiceNote.pause"):g?l("chat.voiceNote.onLiveCall"):l("chat.voiceNote.play"),className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-accent text-white transition-opacity hover:opacity-90 disabled:opacity-40",children:i?s.jsx(Ju,{size:13,className:"fill-current"}):s.jsx(pc,{size:13,className:"translate-x-px fill-current"})}),s.jsx("input",{type:"range","aria-label":l("chat.voiceNote.seek"),min:0,max:c??0,step:.1,value:Math.min(u,c??u),onChange:b=>w(Number(b.currentTarget.value)),disabled:!c,className:"h-1 flex-1 accent-accent"}),s.jsxs("span",{className:"shrink-0 text-[11px] tabular-nums text-ink-secondary",children:[jC(u)," / ",c===null?"--:--":jC(c)]})]}),x&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>h(b=>!b),"data-test-voice-note-transcript":"","aria-expanded":m,className:"mt-1 flex items-center gap-0.5 self-start text-[12px] text-ink-secondary transition-colors hover:text-ink",children:[s.jsx(it,{size:12,"aria-hidden":"true",className:I("transition-transform duration-150",m&&"rotate-90")}),l("chat.voiceNote.transcript")]}),m&&s.jsx("p",{className:"mt-1 whitespace-pre-wrap text-[13px] leading-snug text-ink",children:x})]})]})}function ID({active:e,onToggle:t,className:n}){const a=l(e?"chat.showRenderedMarkdown":"chat.showRawMarkdown");return s.jsx("button",{type:"button",onClick:t,"aria-label":a,"aria-pressed":e,title:a,className:I("rounded-md p-1.5 transition-opacity focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 touch:opacity-100",e?"bg-raised text-accent opacity-100":"text-ink-secondary opacity-0 hover:bg-raised hover:text-ink",n),children:e?s.jsx(Za,{...Yt,"aria-hidden":"true"}):s.jsx(L7,{...Yt,"aria-hidden":"true"})})}function CD({text:e,className:t}){return s.jsx("pre",{dir:"auto","data-testid":"raw-markdown-view",tabIndex:0,className:I("max-h-[36rem] overflow-auto whitespace-pre-wrap break-words rounded-lg border border-hairline/30 bg-inset/50 p-3 font-mono text-[13px] leading-relaxed text-ink select-text",t),children:e})}const NC=140;function zSe(e){if(e.roomRequest?.phase!=="result")return null;const t=e.tool?.output?.trim();if(!t)return null;const[n="",...a]=t.split(`
192
192
  `),r=n.trim();if(r.length>NC)return{preview:`${r.slice(0,NC-1).trimEnd()}…`,more:t};const i=a.join(`
193
193
  `).trim();return{preview:r,more:i||null}}function ED({message:e,children:t}){const n=zSe(e),a=e.doneWhen?.trim();return a?s.jsxs("div",{className:"flex flex-col items-start gap-1",children:[t,s.jsx("p",{"data-handoff-done-when":!0,className:"max-w-[min(38rem,100%)] truncate px-3 text-[12px] text-ink-secondary",title:a,children:l("chat.handoffDoneWhen",{criteria:a})})]}):n?s.jsxs("div",{className:"flex flex-col items-start gap-1","data-handoff-reply":e.roomRequest?.id,children:[t,n.more===null?s.jsx("p",{className:"max-w-[min(38rem,100%)] rounded-xl border border-hairline/40 bg-panel px-3 py-1.5 text-[13px] break-words text-ink-secondary",children:n.preview}):s.jsxs("details",{className:"group/reply w-fit max-w-full rounded-xl border border-hairline/40 bg-panel text-[13px] open:w-[min(38rem,100%)]",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-2 rounded-xl px-3 py-1.5 text-ink-secondary hover:bg-raised focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent [&::-webkit-details-marker]:hidden",children:[s.jsx("span",{className:"min-w-0 max-w-[34rem] truncate",children:n.preview}),s.jsx(it,{size:13,className:"ml-auto shrink-0 group-open/reply:rotate-90","aria-hidden":"true"})]}),s.jsx("p",{className:"max-h-80 overflow-auto border-t border-hairline/40 px-3 py-2 whitespace-pre-wrap break-words text-ink",children:n.more})]})]}):s.jsx("div",{className:"flex justify-start",children:t})}function AD({message:e,bots:t,title:n,onClick:a}){const r=e.comm;if(!r||!e.tool)return null;const i=t.find(o=>o.id===r.withBotId);return s.jsx(ED,{message:e,children:s.jsxs("button",{type:"button",onClick:a,title:n,className:I("ui-pill",e.tool.ok===!1&&"text-danger"),children:[s.jsx(Je,{bot:i??{name:r.withName,color:r.withColor},state:"happy",size:16,animated:!1}),s.jsx("span",{className:"max-w-[480px] truncate",children:e.tool.name}),s.jsx(it,{size:13})]})})}function TD({message:e}){const{state:t,dispatch:n}=re(),a=et(),r=e.threadRef,i=e.tool;if(!r||!i)return null;const o=t.bots.find(u=>u.id===r.botId),c=e.sentDirectly,d=c?c.room?l("chat.sentDirectlyNotInRoom",{name:c.name,room:c.room}):l("chat.sentDirectly",{name:c.name}):hi(i,i.name);return s.jsx(ED,{message:e,children:s.jsxs("button",{type:"button","data-thread-chip":r.threadId,onClick:()=>mn(n,r,t,a),title:l("chat.openThread",{title:r.title}),className:I("ui-pill",i.ok===!1&&"text-danger"),children:[o?s.jsx(Je,{bot:o,state:"happy",size:16,animated:!1}):s.jsx(Bw,{size:13,"aria-hidden":"true"}),s.jsx("span",{className:"max-w-[480px] truncate",children:d}),s.jsx(it,{size:13})]})})}function MD({message:e}){const t=e.relay;if(!t||t.kind!=="told")return null;const n=e.tool?.output?.trim();return s.jsxs("div",{className:"flex flex-col items-start gap-1","data-relay":"told",children:[s.jsxs("span",{className:"ui-pill",title:l("relay.toldHint",{name:t.name}),children:[s.jsx(da,{person:{email:t.email,name:t.name,role:"member"},size:16}),s.jsx("span",{className:"max-w-[480px] truncate",children:l("relay.told",{name:t.name})})]}),n&&s.jsx("p",{className:"max-w-[min(38rem,100%)] rounded-xl border border-hairline/40 bg-panel px-3 py-1.5 text-[13px] whitespace-pre-wrap break-words text-ink-secondary",children:n})]})}function PSe({bot:e}){const t=hn(),[n,a]=f.useState(null),[r,i]=f.useState(!1),[o,c]=f.useState("");if(!t)return null;const d=Ka(e),u=t.people.find(h=>h.email===d),p=h=>h.length===1?h[0].name:l("botAccess.theAdmins");if(n)return s.jsx("span",{role:"status","data-ask-to-chat":"asked",className:"shrink-0 text-[13px] text-ink-secondary",children:l("botAccess.asked",{name:p(n)})});const m=async()=>{i(!0),c("");try{const h=await K(`/api/bots/${e.id}/access-request`,{method:"POST",body:"{}"});a(h.asked??[])}catch(h){c(h instanceof Error?h.message:String(h))}finally{i(!1)}};return s.jsxs(s.Fragment,{children:[o&&s.jsx("span",{role:"alert",className:"min-w-0 text-[12px] text-danger",children:o}),s.jsx("button",{type:"button","data-ask-to-chat":!0,disabled:r,onClick:()=>{m()},className:"shrink-0 rounded-full bg-accent px-3 py-1 text-[13px] font-medium text-white hover:brightness-110 disabled:opacity-60",children:u?l("botAccess.ask",{name:u.name}):l("botAccess.askAdmins")})]})}function _D({bot:e,room:t=!1,onNew:n}){return e?.yourAccess==="view"?s.jsxs("div",{className:"pointer-events-auto mx-5 mb-4 flex flex-wrap items-center gap-3 rounded-2xl border border-hairline/60 bg-raised px-4 py-3","data-testid":"view-only-composer",children:[s.jsx(Za,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary"}),s.jsx("p",{className:"min-w-0 flex-1 text-[13px] text-ink-secondary",children:l(t?"botAccess.viewOnlyRoom":"botAccess.viewOnly",{bot:e.name})}),s.jsx(PSe,{bot:e})]}):s.jsxs("div",{className:"pointer-events-auto mx-5 mb-4 flex items-center justify-between gap-3 rounded-2xl border border-hairline/60 bg-raised px-4 py-3","data-testid":"cloud-guest-composer",children:[s.jsx("p",{className:"text-[13px] text-ink-secondary",children:l("chat.cloudGuest.notYours")}),s.jsx("button",{type:"button",onClick:n,className:"shrink-0 rounded-full bg-accent px-3 py-1 text-[13px] font-medium text-white",children:l("chat.cloudGuest.newConversation")})]})}function DSe(e){return/[\s/]/.test(e)}function $Se(e){return e.kind==="activity"&&e.tool?.summary||void 0}const RD=/\s*(?:&&|\|\||;|\||\r?\n)\s*/,BSe=/^[A-Za-z_][A-Za-z0-9_]*=/,FSe=new Set(["env","sudo"]),USe=new Set(["-u","-g","-C"]),OD=new Set(["pnpm","npm","yarn","bun"]),LD=new Set(["run","exec","-s","--silent","-r","--"]),qSe=new Set(["node","npx","tsx"]),HSe=/^control:[\w-]+$/,WSe=/^control-[\w-]+\.(?:mjs|ts|js|cjs)$/,zD=/^\d*[<>]/,PD=/^[a-z][a-z0-9+.-]*:\/\//i,KSe=/^--[^=]+$/,DD=/(?:^|\s)--dry-run(?:=|\s|$)/,gr=e=>e.replace(/^['"`]+|['"`]+$/g,""),S5=e=>{const t=gr(e);return t.split(/[\\/]/).pop()||t};function mv(e,t){let n=0;for(;n<e.length;){const a=e[n];if(BSe.test(a))n+=1;else if(a==="timeout"||a==="cd")n+=2;else if(FSe.has(a))for(n+=1;n<e.length&&e[n].startsWith("-");)n+=USe.has(e[n])?2:1;else if(t)if(a==="deno")n+=e[n+1]==="run"?2:1;else if(OD.has(a))for(n+=1;n<e.length&&LD.has(e[n]);)n+=1;else if(qSe.has(a))for(n+=1;n<e.length&&e[n].startsWith("-");)n+=1;else break;else break}return e.slice(n)}function VSe(e){const t=gr(e);if(HSe.test(t))return t;const n=S5(t);return WSe.test(n)?n:void 0}function GSe(e,t){let n=!1;for(const a of e){const r=gr(a);if(r.startsWith("-"))n=KSe.test(r)&&r!=="--dry-run";else if(n)n=!1;else if(r&&!zD.test(r)&&!PD.test(r))return r}return t}function YSe(e){for(const t of e.split(RD)){const n=mv(t.split(/\s+/).filter(Boolean),!0),a=n.length>0?VSe(n[0]):void 0;if(a)return{subcommand:GSe(n.slice(1),a),dryRun:DD.test(t)}}}const JSe=new Set(["cat","less","more","head","tail","wc","stat","file","du","df","ls","tree","find","which","type","where","whereis","pwd","echo","printf","printenv","env","ps","pgrep","top","grep","rg","ag","ack","fgrep","egrep","awk","cut","sort","uniq","tr","diff","cmp","md5","shasum","sha256sum","jq","yq","column","export","unset","alias","true","false",":","sleep","exit"]),QSe=new Set(["status","log","diff","show","blame","branch","tag","ls-files","rev-parse","remote","describe","shortlog","reflog"]),$D=new Set(["-C","-c"]),XSe=new Set(["pr view","pr list","pr checks","pr diff","issue view","issue list","run view","run list"]),BD=new Set(["-R","--repo"]),ZSe=new Set,e6e=/^(?:-[a-zA-Z]*i|--in-place)/,SC=/^(?:POST|PUT|PATCH|DELETE)$/i,t6e=/^(?:-X|--request|--method)(?:=(.*))?$/,n6e=/^-X(\w+)$/,s6e=/^(?:-d|--data(?:-\w+)?|-F|--form|-T|--upload-file|-o|--output|-O|--remote-name|--output-document|--post-data|--post-file)(?:=|$)/,a6e=/^(?:-f|-F|--field|--raw-field)(?:=|$)/;function fv(e,t){const n=[];for(let a=0;a<e.length;a+=1){const r=gr(e[a]);if(t.has(r))a+=1;else{if(r.startsWith("-")||zD.test(r)||PD.test(r)||!r)continue;n.push(r)}}return n}function IC(e){for(let t=0;t<e.length;t+=1){const n=gr(e[t]),a=n6e.exec(n);if(a){if(SC.test(a[1]))return!0;continue}const r=t6e.exec(n);if(!r)continue;const i=r[1]??gr(e[t+1]??"");if(SC.test(i))return!0}return!1}function r6e(e){if(e.length===0)return!0;const t=S5(e[0]);if(JSe.has(t))return!0;const n=e.slice(1);switch(t){case"sed":return!n.some(a=>e6e.test(gr(a)));case"git":{const[a]=fv(n,$D);return a===void 0||QSe.has(a)}case"gh":{const[a,r]=fv(n,BD);return a==="api"?!IC(n)&&!n.some(i=>a6e.test(gr(i))):a===void 0||XSe.has(`${a} ${r}`)}case"curl":case"wget":return!IC(n)&&!n.some(a=>s6e.test(gr(a)));default:return!1}}const i6e=new Set(["git","gh","npm","pnpm","docker","kubectl"]);function o6e(e){const t=S5(e[0]);if(!i6e.has(t))return t;const n=OD.has(t)?e.slice(1).filter(r=>!LD.has(r)):e.slice(1),[a]=fv(n,t==="git"?$D:t==="gh"?BD:ZSe);return a?`${t} ${a}`:t}function l6e(e){const t=YSe(e);if(t)return{label:t.subcommand,verified:!0,dryRun:t.dryRun};for(const n of e.split(RD)){const a=mv(n.split(/\s+/).filter(Boolean),!1);if(!r6e(mv(a,!0)))return{label:o6e(a),verified:!1,dryRun:DD.test(n)}}}function FD(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.role==="user"&&n.kind==="text"&&n.text?.trim())return t}return-1}function c6e(e){const t=FD(e);if(t<0)return;const n=e[t].text.trim().split(/\r?\n/,1)[0].trim();return n?n.slice(0,300):void 0}function d6e(e,t=new Set){const n=[];for(const a of e.slice(FD(e)+1)){const r=$Se(a),i=r?l6e(r):void 0;if(!r||!i)continue;const o=a.tool?.ok;n.push({id:a.id,command:r,...i,status:o===void 0?t.has(a.id)?"running":"unverified":o?"passed":"failed"})}return n}function u6e(e){return e.some(t=>t.verified)||e.length>=2}function UD(e){const t={total:e.length,verified:0,passed:0,failed:0,running:0,unverified:0,dryRuns:0};for(const a of e)a.verified&&(t.verified+=1),a.dryRun&&["passed","failed"].includes(a.status)?t.dryRuns+=1:t[a.status]+=1;const n=[t.total===1?l("chat.verify.stepsOne"):l("chat.verify.stepsMany",{count:t.total}),t.verified>0&&l("chat.verify.verifiedCount",{count:t.verified}),t.failed>0&&l("chat.verify.failed",{count:t.failed}),t.running>0&&l("chat.verify.running",{count:t.running}),t.unverified>0&&l("chat.verify.unverified",{count:t.unverified}),t.dryRuns===1?l("chat.verify.dryRunOne"):t.dryRuns>1&&l("chat.verify.dryRunMany",{count:t.dryRuns})].filter(Boolean).join(" · ");return{...t,label:n}}function p6e(e,t){const n=t[0];if(!n)return null;const a=e.findIndex(i=>i.id===n.id);if(a<0)return null;const r=e.slice(a+1).findLast(i=>i.kind==="options"&&i.card?.skillRequest!==void 0)?.card;return!r||r.undone?null:r.answered==="allow"?"saved":r.answered||r.dismissed||r.expired?null:"pending"}const m6e={passed:"✓",failed:"✗",running:"…",unverified:"?"},f6e=e=>`${e.dryRun?"[dry run]":m6e[e.status]} ${e.label} — ${e.command}${e.verified?" (verified)":""}`;function h6e(e,t){return[...e.some(a=>a.verified)?["Create a verification skill from the run below.",...t?[`Goal: ${t}`]:[],"Do not re-run these steps; their results are in this thread. Use the passing ones as the recipe with their exact commands and note the failed ones as gotchas."]:[M9,`Goal: ${t??"the run below"}`,"Keep the exact commands and note the failed ones as gotchas. Do not re-run anything."],"",...e.map(f6e),"",""].join(`
194
194
  `)}function x6e({status:e}){const t="size-4 shrink-0";switch(e){case"running":return s.jsx(ke,{"aria-hidden":"true",className:I(t,"animate-spin text-accent")});case"passed":return s.jsx(ur,{"aria-hidden":"true",className:I(t,"text-success")});case"failed":return s.jsx(Tw,{"aria-hidden":"true",className:I(t,"text-danger")});case"unverified":return s.jsx(Mw,{"aria-hidden":"true",className:I(t,"text-ink-secondary")})}}const CC="flex size-7 shrink-0 items-center justify-center rounded-lg text-ink-secondary outline-none hover:bg-raised-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-accent/60";function g6e({steps:e,canSave:t,skill:n,onDismiss:a,onSave:r}){const i=e.length>6,[o,c]=f.useState(i);if(e.length===0)return null;const d=o?l("chat.verify.expand"):l("chat.verify.collapse");return s.jsxs("section",{"aria-label":l("chat.verify.aria"),className:"pointer-events-auto w-[22rem] max-w-full rounded-2xl border border-hairline/40 bg-raised/95 text-ink shadow-lg backdrop-blur-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[s.jsx(Yu,{size:14,className:"shrink-0 text-accent","aria-hidden":"true"}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"text-[13px] font-medium",children:l("chat.verify.title")}),s.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"text-[12px] text-ink-secondary",children:UD(e).label})]}),s.jsx("button",{type:"button",onClick:()=>c(u=>!u),"aria-expanded":!o,"aria-label":d,title:d,className:CC,children:o?s.jsx(vi,{size:14,"aria-hidden":"true"}):s.jsx(jt,{size:14,"aria-hidden":"true"})}),s.jsx("button",{type:"button",onClick:a,"aria-label":l("chat.verify.dismiss"),title:l("chat.verify.dismiss"),className:CC,children:s.jsx(Ae,{size:14,"aria-hidden":"true"})})]}),!o&&s.jsxs(s.Fragment,{children:[s.jsx("ol",{tabIndex:0,"aria-label":l("chat.verify.steps"),className:"max-h-56 overflow-y-auto border-t border-hairline/25 px-3 py-1.5 outline-none focus-visible:ring-2 focus-visible:ring-accent/60",children:e.map(u=>s.jsxs("li",{className:"flex min-w-0 items-center gap-2 py-1",children:[s.jsx(x6e,{status:u.status}),s.jsx("span",{className:"shrink-0 text-[13px] font-medium",children:u.label}),u.verified&&s.jsx("span",{className:"shrink-0 text-[11px] uppercase tracking-wide text-success",children:l("chat.verify.verifiedTag")}),s.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-[12px] text-ink-secondary",title:u.command,children:u.command})]},u.id))}),n?s.jsx("div",{className:"border-t border-hairline/25 px-3 py-2 text-[12px] text-ink-secondary",children:l(n==="saved"?"chat.verify.saved":"chat.verify.staged")}):t&&s.jsxs("div",{className:"flex flex-col items-end gap-1 border-t border-hairline/25 px-3 py-2",children:[s.jsxs("button",{type:"button",onClick:r,className:"flex h-7 shrink-0 items-center gap-1.5 rounded-lg px-2.5 text-[13px] font-medium text-ink-secondary outline-none hover:bg-raised-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-accent/60",children:[s.jsx(cK,{size:13,"aria-hidden":"true"}),l("chat.verify.save")]}),s.jsx("span",{className:"text-[12px] text-ink-secondary",children:l("chat.verify.saveHint")})]})]})]})}const b6e=/^#([0-9a-f]{6})$/i;function Hh(e){const t=b6e.exec(e.trim())?.[1];if(!t)throw new Error(`not a 6-digit hex colour: ${e}`);return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function qD({r:e,g:t,b:n}){const a=r=>Math.max(0,Math.min(255,Math.round(r))).toString(16).padStart(2,"0");return`#${a(e)}${a(t)}${a(n)}`}function _l(e){const t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function EC(e){const{r:t,g:n,b:a}=Hh(e);return .2126*_l(t)+.7152*_l(n)+.0722*_l(a)}function pn(e,t){const n=EC(e),a=EC(t),r=Math.max(n,a),i=Math.min(n,a);return(r+.05)/(i+.05)}function Wh(e){const{r:t,g:n,b:a}=Hh(e),[r,i,o]=[_l(t),_l(n),_l(a)],c=Math.cbrt(.4122214708*r+.5363325363*i+.0514459929*o),d=Math.cbrt(.2119034982*r+.6806995451*i+.1073969566*o),u=Math.cbrt(.0883024619*r+.2817188376*i+.6299787005*o),p=1.9779984951*c-2.428592205*d+.4505937099*u,m=.0259040371*c+.7827717662*d-.808675766*u;return{l:.2104542553*c+.793617785*d-.0040720468*u,c:Math.hypot(p,m),h:(Math.atan2(m,p)*180/Math.PI+360)%360}}function AC(e,t,n){const a=t*Math.cos(n*Math.PI/180),r=t*Math.sin(n*Math.PI/180),i=(e+.3963377774*a+.2158037573*r)**3,o=(e-.1055613458*a-.0638541728*r)**3,c=(e-.0894841775*a-1.291485548*r)**3;return[4.0767416621*i-3.3077115913*o+.2309699292*c,-1.2684380046*i+2.6097574011*o-.3413193965*c,-.0041960863*i-.7034186147*o+1.707614701*c]}function _u({l:e,c:t,h:n}){const a=u=>AC(e,u,n).every(p=>p>=-1e-4&&p<=1.0001);let r=t;if(!a(t)){let u=0,p=t;for(let m=0;m<30;m+=1){const h=(u+p)/2;a(h)?u=h:p=h}r=u}const i=u=>{const p=Math.min(1,Math.max(0,u));return 255*(p<=.0031308?12.92*p:1.055*p**(1/2.4)-.055)},[o,c,d]=AC(e,r,n).map(i);return qD({r:o,g:c,b:d})}function Hn(e,t,n){const a=Hh(e),r=Hh(t),i=(o,c)=>o*n+c*(1-n);return qD({r:i(a.r,r.r),g:i(a.g,r.g),b:i(a.b,r.b)})}const bn="#ffffff",xa="#101410",un=4.5,HD=3,y6e=4.6,k6e=.35,v6e=.55,TC={from:65,to:115};function WD(e,t,n,a){if(pn(t,n)>=a)return t;let r=0,i=1,o=e;for(let c=0;c<22;c+=1){const d=(r+i)/2,u=Hn(e,t,d);pn(u,n)>=a?(o=u,i=d):r=d}return pn(o,n)>=a?o:e}const Zo=(e,t,n)=>WD(bn,e,t,n),jm=(e,t,n)=>WD(xa,e,t,n);function Kh(e,t,n){let a=0,r=1,i=e;for(let o=0;o<22;o+=1){const c=(a+r)/2,d=Hn(e,t,c);pn(d,t)>=n?(i=d,r=c):a=c}return pn(i,t)>=n?i:e}function Rl(e){return pn(xa,e)>=un?xa:bn}function w6e(e,t,n){let a=.2,r=.95,i=_u({l:a,c:t,h:n});for(let o=0;o<24;o+=1){const c=(a+r)/2,d=_u({l:c,c:t,h:n});pn(d,e)>=y6e?(i=d,a=c):r=c}return i}function KD(e,t){return`linear-gradient(to bottom left, ${e}, ${t})`}function j6e(e){const{c:t,h:n}=Wh(e),a=n<90?-8:n>=270?-12:12,r=pn(bn,e)>=un?e:w6e(bn,t*1.05,n-a/2),i=_u({l:Wh(r).l-.09,c:t*(n<90?1.1:1.25),h:n+a}),o=Kh(bn,r,Math.min(6.2,Math.max(un,pn(bn,r)-.6)));let c=Kh(bn,r,un);pn(c,r)>pn(o,r)&&(c=o);let d=Hn("#000000",r,.2);pn(bn,d)<un&&(d=r),pn(o,d)<un&&(d=r);const u=Hn(d,r,.45);let p=Hn(bn,r,.1);pn(bn,p)<un&&(p=r);let m=Hn(bn,r,.16);pn(bn,m)<un&&(m=p);const h=Zo(Hn(bn,r,.45),r,HD);let x=Zo(e,r,un);pn(x,p)<un&&(x=Zo(x,p,un)),pn(xa,x)<un&&(x=Zo(x,xa,un));const g=Zo("#ff6d80",r,un),v=Zo("#7ddead",r,un);return{background:r,deep:i,gradient:KD(r,i),ink:bn,secondary:o,tertiary:c,panel:u,inset:d,raised:p,raisedHover:m,control:p,hairline:h,accent:x,accentText:x,accentInk:Rl(x),focus:x,danger:g,dangerInk:Rl(g),success:v,successInk:Rl(v),selection:S6e(r),selectionInk:bn}}function N6e(e){const{c:t,h:n}=Wh(e),a=_u({l:.8,c:t*1.1,h:n+2}),r=_u({l:.72,c:t*1.25,h:n-16}),i=Kh(xa,r,Math.min(6.2,Math.max(un,pn(xa,r)-.6)));let o=Kh(xa,r,un);pn(o,r)>pn(i,r)&&(o=i);const c=Hn(bn,r,.35),d=Hn(bn,r,.18),u=jm(e,r,un),p=jm("#c02b3a",r,un),m=jm("#1f7a4d",r,un);return{background:a,deep:r,gradient:KD(a,r),ink:xa,secondary:i,tertiary:o,panel:Hn(c,r,.45),inset:c,raised:d,raisedHover:Hn(bn,r,.28),control:d,hairline:jm(Hn(xa,r,.35),r,HD),accent:u,accentText:u,accentInk:Rl(u),focus:u,danger:p,dangerInk:Rl(p),success:m,successInk:Rl(m),selection:Hn(bn,a,v6e),selectionInk:xa}}function VD(e){const t=Mf[e],{h:n}=Wh(t);return n>=TC.from&&n<=TC.to?N6e(t):j6e(t)}function S6e(e){return Hn("#000000",e,k6e)}function I6e(e,{flat:t=!1}={}){const n=VD(e);return{backgroundColor:n.background,backgroundImage:t?"none":n.gradient,"--color-bubble-user":n.background,"--color-bubble-user-ink":n.ink,"--color-ink":n.ink,"--color-ink-secondary":n.secondary,"--color-ink-tertiary":n.tertiary,"--color-panel":n.panel,"--color-inset":n.inset,"--color-raised":n.raised,"--color-raised-hover":n.raisedHover,"--color-control":n.control,"--color-hairline":n.hairline,"--color-accent":n.accent,"--color-accent-text":n.accentText,"--color-accent-ink":n.accentInk,"--color-focus":n.focus,"--color-danger":n.danger,"--color-danger-ink":n.dangerInk,"--color-success":n.success,"--color-success-ink":n.successInk,"--bubble-selection":n.selection,"--bubble-selection-ink":n.selectionInk}}function C6e(e){return e!=="local"&&e!=="vm"}const E6e=new Set(["screenshot","click","type_text","press_key","key_press","scroll","computer_batch","open_url","browser_click","browser_fill","browser_navigate","browser_type","browser_press","browser_scroll","browser_hover","browser_drag","browser_select_option","browser_back","browser_forward","browser_screenshot","agent_browser_open","agent_browser_click","agent_browser_fill","agent_browser_type","agent_browser_press","agent_browser_select","agent_browser_check","agent_browser_screenshot","agent_browser_hover","agent_browser_upload","agent_browser_navigate","agent_browser_drag","agent_browser_scroll","agent_browser_tabs","agent_browser_dialog","agent_browser_eval","double_click","right_click","drag","hotkey","move_cursor","launch_app","bring_to_front","zoom"]),A6e=/^(?:mcp__.+?|[a-z][a-z0-9_-]{0,31})__/;function T6e(e){const t=e.toLowerCase();if(t.startsWith("mcp__browser__")||t.startsWith("browser__"))return"browser";if(t.startsWith("mcp__computer__")||t.startsWith("computer__")||t.startsWith("computer_"))return"computer";const n=t.replace(A6e,"");return n==="browser_click"||n==="browser_fill"?"computer":n.startsWith("agent_browser_")||n.startsWith("browser_")?"browser":E6e.has(n)?"computer":null}const GD=["cloud","vm","local","browser"];function MC(e,t){return!t?.cloudHome||C6e(e)}function Rg(e,t){return e.computer==="off"?"off":t?.surface??e.computer??"auto"}function YD(e){return e?.surfaceAuto?void 0:e?.surface}function M6e(e){return e==="cloud"||e==="vm"||e==="local"}function li(e){return`place.${e}`}function JD(e,t){const n=T6e(e);return n==="browser"?"browser":n==="computer"&&M6e(t)?t:null}function _6e(e,t,n){let a=t.size;for(let r=e.length-1;r>=0&&a>0;r--){const i=e[r];if(!t.has(i.id))continue;a--;const o=i.tool&&i.tool.ok===void 0?JD(i.tool.name,n):null;if(o)return o}return null}const R6e={cloud:Kn,vm:A7,local:jo,browser:ra,auto:Gn,off:iW};function ci({place:e,...t}){const n=R6e[e];return s.jsx(n,{...t})}function QD({tool:e,place:t=null,live:n=!1,source:a}){const[r,i]=f.useState(!1),o=O6e(r&&e.clipped?a:void 0,e.output),c=o.output??e.output,d=e.ok===!1,u=nt(),p=Ao(e.nameCode),m=si(e.summaryCode,e.summary??"",e.summaryParams),h=d?e.problem:void 0,x=h??(u&&!p?e.label??e.name:ec(e)),g=e.ok===void 0?n?l("toolDetail.running"):l("toolDetail.unverified"):d?l("toolDetail.failed"):l("toolDetail.completed");return s.jsxs("details",{onToggle:v=>i(v.currentTarget.open),className:"group/tool w-fit max-w-full rounded-xl border border-hairline/40 bg-panel text-[13px] open:w-[min(38rem,100%)]","data-testid":"tool-activity",children:[s.jsxs("summary",{role:"button","aria-expanded":r,"aria-label":l("toolDetail.label",{name:x,status:g}),className:I("flex min-h-8 cursor-pointer list-none items-center gap-2 rounded-xl px-3 py-1.5 hover:bg-raised focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent [&::-webkit-details-marker]:hidden",d?"text-danger":"text-ink-secondary"),children:[s.jsx("span",{className:"shrink-0","aria-hidden":"true",children:e.ok===void 0?n?s.jsx(tj,{size:3.5}):s.jsx(Mw,{size:13}):d?s.jsx(Ae,{size:13}):s.jsx(Se,{size:13,className:"text-success"})}),t&&s.jsx(ci,{place:t,size:13,className:"shrink-0 opacity-70",role:"img","aria-label":l(li(t)),"data-testid":"tool-place"}),s.jsx("span",{className:I("min-w-0 max-w-[30rem]",!h&&"truncate","leading-5",u&&!p&&!h?"font-mono":"font-medium"),children:x}),u&&e.summary&&e.summary!==e.name&&!DSe(e.name)&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",title:m,children:m}),s.jsx(it,{size:13,className:"ml-auto shrink-0 group-open/tool:rotate-90","aria-hidden":"true"})]}),s.jsxs("div",{className:"space-y-3 border-t border-hairline/40 p-3 text-ink-secondary",children:[s.jsx("div",{className:I("text-[11px] font-medium",d&&"text-danger"),children:g}),x!==e.name&&!p&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-[11px] font-medium",children:l("toolDetail.tool")}),s.jsx("p",{dir:"ltr",className:"break-words font-mono text-xs text-ink","data-testid":"tool-name",children:e.name})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-[11px] font-medium",children:l("toolDetail.input")}),s.jsx("pre",{dir:"ltr",className:"max-h-52 overflow-auto rounded-lg bg-inset p-2.5 font-mono text-xs whitespace-pre-wrap break-words text-ink",children:e.input??(e.summary?m:p?x:e.name)})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-[11px] font-medium",children:l("toolDetail.output")}),c?s.jsx("pre",{dir:"ltr",className:"max-h-64 overflow-auto rounded-lg bg-inset p-2.5 font-mono text-xs whitespace-pre-wrap break-words text-ink",children:c}):s.jsx("p",{className:"text-xs",children:e.ok===void 0?n?l("toolDetail.waiting"):l("toolDetail.unverified"):l("toolDetail.noOutput")})]}),(o.state==="loading"||o.state==="failed")&&s.jsx("p",{className:"text-[11px] text-ink-secondary",role:"status",children:l(o.state==="loading"?"toolDetail.loadingFull":"toolDetail.partial")}),s.jsx("p",{className:"text-[11px] text-ink-secondary",children:l("toolDetail.previewHint")})]})]})}function O6e(e,t){const n=e&&`/api/threads/${encodeURIComponent(e.threadId)}/messages/${encodeURIComponent(e.messageId)}/tool`,a=n&&`${n}#${t?.length??0}`,[r,i]=f.useState({state:"idle"}),o=r.key===a&&r.state==="done";return f.useEffect(()=>{if(!n||o)return;let c=!0;const d=new AbortController;return i({state:"loading",key:a}),K(n,{signal:d.signal}).then(u=>{c&&i({state:"done",key:a,output:u.output})}).catch(()=>{c&&i({state:"failed",key:a})}),()=>{c=!1,d.abort()}},[n,a,o]),r.key===a?r:{state:"idle"}}const el='"Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif',_C=["#3b82f6","#ea580c","#059669","#c026d3","#a16207","#8b5cf6","#0d9488","#e11d48","#4d7c0f","#6b7280"],L6e={dark:{text:"#fcfcfc",muted:"#a3a3a3",hairline:"#333333",surface:"#111111"},light:{text:"#1a1a18",muted:"#6b6559",hairline:"#c8bda8",surface:"#fbf8f2"}};function XD(e){const t=L6e[e],n={font:el,labelFont:el,titleFont:el,labelFontSize:11,titleFontSize:11,titleFontWeight:500};return{background:"transparent",font:el,padding:8,view:{stroke:null},title:{color:t.text,subtitleColor:t.muted,font:el,fontSize:13,fontWeight:600,anchor:"start",offset:12},axis:{...n,labelColor:t.muted,titleColor:t.muted,titlePadding:8,labelPadding:6,domainColor:t.hairline,domainWidth:1,tickColor:t.hairline,tickSize:4,gridColor:t.hairline,gridWidth:1,gridOpacity:.6},axisX:{grid:!1},axisY:{grid:!0,domain:!1,ticks:!1},legend:{...n,labelColor:t.muted,titleColor:t.muted,symbolSize:60,symbolType:"circle",labelLimit:140,padding:0,rowPadding:2,columnPadding:8,offset:12},range:{category:[..._C],heatmap:{scheme:e==="dark"?"viridis":"blues"},ramp:{scheme:e==="dark"?"viridis":"blues"}},mark:{color:_C[0]},line:{strokeWidth:2,strokeJoin:"round",strokeCap:"round"},area:{opacity:.75,line:!1},point:{filled:!0,size:36,opacity:.8},circle:{size:36,opacity:.8},arc:{stroke:t.surface,strokeWidth:1},rect:{stroke:t.surface,strokeWidth:1},text:{color:t.text,font:el},scale:{bandPaddingInner:.25}}}function ZD(e){return/^(?:U?(?:TINY|SMALL|BIG|HUGE)?INT(?:EGER)?|DECIMAL|NUMERIC|DOUBLE|FLOAT|REAL)\b/i.test(e.trim())}function z6e(e){return/^(?:DATE|TIME|TIMESTAMP|INTERVAL)/i.test(e.trim())}function e$(e){return e==null?"":typeof e=="boolean"?e?"true":"false":String(e)}function P6e(e){if(e==null||e==="")return null;if(typeof e=="number")return e;if(typeof e=="boolean")return e?1:0;const t=Number(e);return Number.isFinite(t)?t:null}function D6e(e,t){const n=e.map(a=>ZD(a.type));return t.map(a=>{const r={};return e.forEach((i,o)=>{const c=a[o]??null;r[i.name]=n[o]?P6e(c):c}),r})}function JBe(e,t){const n=a=>a.replace(/[\t\r\n]+/g," ");return[e.map(n).join(" "),...t.map(a=>a.map(r=>n(e$(r))).join(" "))].join(`