@decocms/mesh 2.9.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DST9a9vh.js → AlertCircle-C-YsmNug.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DPtymxR-.js → ArrowLeft-I0eE0ajz.js} +1 -1
- package/dist/client/assets/{Check-B3jZM0OP.js → Check-Bn7iaq_h.js} +1 -1
- package/dist/client/assets/{ChevronDown-Bi1kqv-9.js → ChevronDown-CXsTFOR4.js} +1 -1
- package/dist/client/assets/{Clock-BynE89Zl.js → Clock-7YlOAEqw.js} +1 -1
- package/dist/client/assets/{Code01-BMUDEJ4t.js → Code01-Dp2-HwWV.js} +1 -1
- package/dist/client/assets/{Copy01-DUDgHeaT.js → Copy01-Cufxb7u1.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-DO21zZi8.js → DotsHorizontal-Cq3m_A8z.js} +1 -1
- package/dist/client/assets/{DotsVertical-DikAa5AR.js → DotsVertical-BIpduKLf.js} +1 -1
- package/dist/client/assets/{File06-7Osp6kua.js → File06-DD5RANl_.js} +1 -1
- package/dist/client/assets/{FilterLines-DieVG1pT.js → FilterLines-1Ine1y4n.js} +1 -1
- package/dist/client/assets/{FlipBackward-U1Nw6QGY.js → FlipBackward-DBqfxU3c.js} +1 -1
- package/dist/client/assets/{GitBranch01-CTCXO68x.js → GitBranch01-BHo3ByP2.js} +1 -1
- package/dist/client/assets/{Grid01-DI-Q2VEp.js → Grid01-C578o4mm.js} +1 -1
- package/dist/client/assets/{Inbox01-Cme2B_Za.js → Inbox01-BtHWN2dX.js} +1 -1
- package/dist/client/assets/{InfoCircle-Bz1TUoGx.js → InfoCircle-BkGKY7qc.js} +1 -1
- package/dist/client/assets/{Key01-COwuV6OE.js → Key01-DYP1HQKa.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BaHJAM0O.js → LinkExternal01-d5tCjGRk.js} +1 -1
- package/dist/client/assets/{Loading01-C5e9Xing.js → Loading01-BGeWv0Kv.js} +1 -1
- package/dist/client/assets/{Lock01-BLY_4cHD.js → Lock01-jWWo80rN.js} +1 -1
- package/dist/client/assets/{Play-BSr93GMI.js → Play-B3EbuXEZ.js} +1 -1
- package/dist/client/assets/{Plus-pmQCIiux.js → Plus-CgN71ZpK.js} +1 -1
- package/dist/client/assets/{SearchMd-C8MbVAuA.js → SearchMd-u2U3iAnY.js} +1 -1
- package/dist/client/assets/{Terminal-BSyq_KGG.js → Terminal-Fj__rdxn.js} +1 -1
- package/dist/client/assets/{Trash01-DqQrX192.js → Trash01-Vutqn1RC.js} +1 -1
- package/dist/client/assets/{X-CJAJyKbZ.js → X-P1RHfgBU.js} +1 -1
- package/dist/client/assets/{XClose-CF1lddkv.js → XClose-DeI9b46h.js} +1 -1
- package/dist/client/assets/{alert-dialog-BnwjYq4n.js → alert-dialog-BApkfnBU.js} +1 -1
- package/dist/client/assets/{auth-DhJcJDq8.js → auth-B4yoGafc.js} +1 -1
- package/dist/client/assets/{auth-catchall-C2IFDAAQ.js → auth-catchall-CbILVwsO.js} +1 -1
- package/dist/client/assets/{avatar-Cd72kdsa.js → avatar-HUmJyCrO.js} +1 -1
- package/dist/client/assets/{badge-iCoQ1dgD.js → badge-_9VZKl7s.js} +1 -1
- package/dist/client/assets/{card-CjWJyjfT.js → card-DUrBojml.js} +1 -1
- package/dist/client/assets/{checkbox-5O25feEA.js → checkbox-y4VvHU-Y.js} +1 -1
- package/dist/client/assets/{collection-detail-BCydbsMr.js → collection-detail-o5P4OEwm.js} +1 -1
- package/dist/client/assets/{collection-display-button-D1R0tnBY.js → collection-display-button-D_pspwv8.js} +1 -1
- package/dist/client/assets/{collection-header-0lxlEg2I.js → collection-header-DjAukiYw.js} +1 -1
- package/dist/client/assets/{collection-page-s3MvuRc-.js → collection-page-DUwIO-4_.js} +1 -1
- package/dist/client/assets/{collection-search-Btyw61UY.js → collection-search-C8qrPxpe.js} +1 -1
- package/dist/client/assets/{collection-tab-DWktiPIU.js → collection-tab-BtKR4Bs-.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-gfEw2g5n.js → collection-table-wrapper-m6-zCmZ8.js} +1 -1
- package/dist/client/assets/{connection-card-DfdBq4FD.js → connection-card-Bho36DLV.js} +1 -1
- package/dist/client/assets/{connection-detail--2aMjf2x.js → connection-detail-DzUkx3x6.js} +1 -1
- package/dist/client/assets/{connections-B3fFvefT.js → connections-CGjqBYcN.js} +1 -1
- package/dist/client/assets/constants-CDd5Bb9b.js +1 -0
- package/dist/client/assets/{create-organization-dialog-DWi5c4Eh.js → create-organization-dialog-DJCSaeq_.js} +1 -1
- package/dist/client/assets/{dialog-D76JDRim.js → dialog-DPjf1g07.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BjkFG8SE.js → dropdown-menu-JqpADJWR.js} +1 -1
- package/dist/client/assets/{empty-state-V7JRwEdF.js → empty-state-B1YgYZRX.js} +1 -1
- package/dist/client/assets/{env-vars-editor-BJ7tjYIq.js → env-vars-editor-58M0X5HW.js} +1 -1
- package/dist/client/assets/{error-boundary-D0j0sONw.js → error-boundary-swyLIuj9.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BrdC23jw.js → extract-connection-data-yHByD-hG.js} +1 -1
- package/dist/client/assets/{form-B8Xq72cU.js → form-BNePwzri.js} +1 -1
- package/dist/client/assets/{gateway-detail-5Qd5lfiW.js → gateway-detail-7_rs5-Bk.js} +1 -1
- package/dist/client/assets/{gateways-CEtb1fnf.js → gateways-LhzXTNdU.js} +1 -1
- package/dist/client/assets/{home-nnEPBFaz.js → home-Dge_UN-5.js} +1 -1
- package/dist/client/assets/{index-xkjtAq50.js → index-CZYkP-qE.js} +1 -1
- package/dist/client/assets/{index-Cqq-bHxo.js → index-D825aBGT.js} +2 -2
- package/dist/client/assets/{index-DdOgSb-W.js → index-Dd-uCtJP.js} +1 -1
- package/dist/client/assets/{index-B01CV87W.js → index-DfsK7wxC.js} +3 -3
- package/dist/client/assets/{index-Dv5zkaTK.js → index-sXi95TSr.js} +1 -1
- package/dist/client/assets/{input-DJ7wqUvo.js → input-CUSLU-5Y.js} +1 -1
- package/dist/client/assets/{layout-CfefGJu5.js → layout-DiLh4D4s.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-CaSijfHb.js → lazy-highlighter-Bva2qxQ8.js} +1 -1
- package/dist/client/assets/{localstorage-keys-TnX0RxDe.js → localstorage-keys-DCk__Bcu.js} +1 -1
- package/dist/client/assets/{login-CGyq3Vs1.js → login-5v9kcVjq.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CJD4q5rM.js → mcp-oauth-2LWG2fNF.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-CbOhDFHk.js → mcp-server-detail-Bl4-1OcQ.js} +1 -1
- package/dist/client/assets/{members-DLByeMDT.js → members-DUjkcn9b.js} +1 -1
- package/dist/client/assets/{monaco-editor-CoD_oW78.js → monaco-editor-CXJFCG3L.js} +1 -1
- package/dist/client/assets/{monitoring-5cDa-J-b.js → monitoring-BxS1M7G9.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cgb1o01u.js → oauth-callback-D352dL7W.js} +1 -1
- package/dist/client/assets/{page-COBajbLE.js → page-DJ2XmEDk.js} +1 -1
- package/dist/client/assets/{page-Dlp1hzYF.js → page-DlLPoWnp.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-Cp43fkli.js → pin-to-sidebar-button-CxO4Rtia.js} +1 -1
- package/dist/client/assets/{popover-mdWNDupQ.js → popover-CiuXmEMm.js} +1 -1
- package/dist/client/assets/{project-context-provider-Gi9sytDH.js → project-context-provider-Y7j1MLG3.js} +1 -1
- package/dist/client/assets/{resizable-BdJcZRXn.js → resizable-CpuhJlAj.js} +1 -1
- package/dist/client/assets/{resource-tabs-DlB9LUax.js → resource-tabs-DzYdyOT8.js} +1 -1
- package/dist/client/assets/{select-B5Ou5lZC.js → select-BiK6lA7A.js} +1 -1
- package/dist/client/assets/{settings-CjdyGe2Y.js → settings-BydLLEEd.js} +1 -1
- package/dist/client/assets/{shell-layout-DftkJMI3.js → shell-layout-hT1WnhFU.js} +1 -1
- package/dist/client/assets/{spinner-CchSlqhZ.js → spinner-D8JOERWZ.js} +1 -1
- package/dist/client/assets/{switch-17EJ9BZl.js → switch-CHSRGx1X.js} +1 -1
- package/dist/client/assets/{textarea-BngAuS5G.js → textarea-DA688jdJ.js} +1 -1
- package/dist/client/assets/{thread-history-popover-BNoPu7hE.js → thread-history-popover-d49eUsmE.js} +2 -2
- package/dist/client/assets/{tool-set-selector-ia7ItE5G.js → tool-set-selector-qCxd45H-.js} +1 -1
- package/dist/client/assets/{tools-list-HOpPAfsi.js → tools-list-aRycV8Sk.js} +1 -1
- package/dist/client/assets/{use-binding-iszUdbOZ.js → use-binding-pQGzNysE.js} +1 -1
- package/dist/client/assets/{use-connection-Dp5C8sLQ.js → use-connection-CJ5nWy0c.js} +1 -1
- package/dist/client/assets/{use-connection-resources-DU3H93Az.js → use-connection-resources-CrBNfIuI.js} +1 -1
- package/dist/client/assets/{use-gateway-CSxRa3Bg.js → use-gateway-Cov2sDNb.js} +1 -1
- package/dist/client/assets/{use-gateway-system-prompt-BqldEOSK.js → use-gateway-system-prompt-D3bv_TPR.js} +1 -1
- package/dist/client/assets/{use-list-state-FSUrDOEN.js → use-list-state-CUahB2OC.js} +1 -1
- package/dist/client/assets/{use-mcp-D5TIO_2s.js → use-mcp-Wds2Jlc5.js} +1 -1
- package/dist/client/assets/{use-members-DlA8UjAf.js → use-members-BlHxrgPJ.js} +1 -1
- package/dist/client/assets/{use-mobile-D6_iVdHq.js → use-mobile-DSucR6ge.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DVpbHPw1.js → use-organization-settings-zICyumVv.js} +1 -1
- package/dist/client/assets/{use-tool-call-DsLdhDUf.js → use-tool-call-CS4qR4o3.js} +1 -1
- package/dist/client/assets/useQuery-El_kGGDY.js +1 -0
- package/dist/client/assets/{value-Bc9uIuB3.js → value-BHNPJ9GX.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-ljeOi0U5.js → view-mode-toggle-Do1cIl7g.js} +1 -1
- package/dist/client/assets/{workflow-DOWIsfb9.js → workflow-C_xTbZed.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +3 -3
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/constants-CjRmBn5H.js +0 -1
- package/dist/client/assets/useQuery-UvQ_L9Pc.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as N,e as Xt,a as J,j as n,f as ke,t as K,c as p,R as Qt,T as es,D as ts,C as ss,P as ns,g as as,O as os,h as is,i as ls,k as bt,l as rs,d as jt,G as cs,m as ds,S as vt,n as ms,o as fs,N as us,p as hs,K as ps,q as St}from"./index-Cqq-bHxo.js";import{E as nt}from"./error-boundary-D0j0sONw.js";import{B as Z,c as O,I as xs}from"./input-DJ7wqUvo.js";import{P as Nt,a as wt,b as yt}from"./popover-mdWNDupQ.js";import{B as lt}from"./badge-iCoQ1dgD.js";import{i as Be}from"./Check-B3jZM0OP.js";import{n as rt}from"./Inbox01-Cme2B_Za.js";import{s as ct}from"./XClose-CF1lddkv.js";import{i as gs}from"./File06-7Osp6kua.js";import{i as _e}from"./X-CJAJyKbZ.js";import{u as Ie}from"./use-mobile-D6_iVdHq.js";import{T as Ct,a as _t,b as kt,c as It,u as He,L as dt,P as bs,O as js}from"./project-context-provider-Gi9sytDH.js";import{u as $t,a as vs}from"./use-organization-settings-DVpbHPw1.js";import{n as Ss,u as Ns,E as ws,I as mt}from"./use-connection-Dp5C8sLQ.js";import{i as tt}from"./use-gateway-CSxRa3Bg.js";import{C as ys}from"./create-organization-dialog-DWi5c4Eh.js";import{A as Q}from"./avatar-Cd72kdsa.js";import{c as Cs}from"./Grid01-DI-Q2VEp.js";import{D as _s,a as ks,b as Is,c as $s,u as zs,d as Ms,e as Os,C as P,f as ft,g as Ts,h as As,i as Rs,U as Es,G as Ls,M as Ps}from"./index-B01CV87W.js";import{D as Ds,a as Bs,b as Hs,c as Us,d as ut}from"./dropdown-menu-BjkFG8SE.js";import{a as zt}from"./Copy01-DUDgHeaT.js";import{n as ht}from"./LinkExternal01-BaHJAM0O.js";import{D as Gs,a as Fs,b as Vs,c as Ws,d as Ks}from"./dialog-D76JDRim.js";import{L as Zs}from"./form-B8Xq72cU.js";import{S as qs}from"./switch-17EJ9BZl.js";import{i as Ys}from"./Code01-BMUDEJ4t.js";import{u as Ue,L as Ge}from"./localstorage-keys-TnX0RxDe.js";import{u as Js,a as Xs,b as Qs,N as en,G as tn,T as sn,D as nn}from"./thread-history-popover-BNoPu7hE.js";import{R as Mt,a as an,b as on}from"./resizable-BdJcZRXn.js";import{i as ln}from"./Loading01-C5e9Xing.js";import{s as rn}from"./Plus-pmQCIiux.js";import{u as cn}from"./use-binding-iszUdbOZ.js";import"./alert-dialog-BnwjYq4n.js";import"./spinner-CchSlqhZ.js";import"./SearchMd-C8MbVAuA.js";import"./AlertCircle-DST9a9vh.js";import"./textarea-BngAuS5G.js";import"./Terminal-BSyq_KGG.js";import"./monaco-editor-CoD_oW78.js";import"./select-B5Ou5lZC.js";import"./ChevronDown-Bi1kqv-9.js";import"./InfoCircle-Bz1TUoGx.js";import"./useQuery-UvQ_L9Pc.js";import"./use-gateway-system-prompt-BqldEOSK.js";import"./well-known-mcp-D13f-8h2.js";import"./generate-id-Dyweu44Y.js";import"./Clock-BynE89Zl.js";import"./Trash01-DqQrX192.js";import"./auth-DhJcJDq8.js";const Ot=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));Ot.displayName="BarChart10";const Tt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));Tt.displayName="Building02";const At=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));At.displayName="ChevronSelectorVertical";const Rt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));Rt.displayName="Globe01";const Et=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M9 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));Et.displayName="Home02";const Lt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Lt.displayName="LayoutRight";const Pt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));Pt.displayName="LogOut01";const Dt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));Dt.displayName="Mail01";const at=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),N.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));at.displayName="Settings01";const Bt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Bt.displayName="Users01";const Ht=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));Ht.displayName="Zap";function dn({invitation:t,onStatusChange:e}){const[s,o]=N.useState(!1),[a,i]=N.useState(!1),l=ke(),c=async()=>{o(!0);try{const u=await J.organization.acceptInvitation({invitationId:t.id});if(u.error)K.error(u.error.message),o(!1);else{e(t.id,"accepted");const g=await J.organization.setActive({organizationId:t.organizationId});g?.data?.slug?(K.success("Invitation accepted!"),l({to:"/$org",params:{org:g.data.slug}})):(K.success("Invitation accepted! Redirecting..."),l({to:"/"}))}}catch{K.error("Failed to accept invitation"),o(!1)}},r=async()=>{i(!0);try{const u=await J.organization.rejectInvitation({invitationId:t.id});u.error?(K.error(u.error.message),i(!1)):(K.success("Invitation rejected"),e(t.id,"rejected"),i(!1))}catch{K.error("Failed to reject invitation"),i(!1)}},d=t.organizationName||t.organizationId,m=t.inviter?.name||t.inviter?.email||t.email||"Someone",f=t.status==="pending",h=t.status==="accepted",b=t.status==="rejected";return n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0 ${f?"":"opacity-50"}`,children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(Dt,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:[n.jsx("span",{className:"font-semibold inline-block max-w-[120px] truncate align-bottom",children:m})," invited you to join ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:f?n.jsxs(n.Fragment,{children:[n.jsx(Z,{variant:"ghost",size:"icon",onClick:r,disabled:s||a,className:"h-8 w-8",children:n.jsx(ct,{size:14})}),n.jsx(Z,{variant:"outline",size:"icon",onClick:c,disabled:s||a,className:"h-8 w-8",children:n.jsx(Be,{size:14})})]}):h?n.jsxs(lt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Be,{size:12}),"Accepted"]}):b?n.jsxs(lt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ct,{size:12}),"Declined"]}):null})]})}function mn(){const[t,e]=N.useState(!1),s=N.useContext(Xt),{data:o}=s.hooks.useListUserInvitations(),{data:a}=J.useListOrganizations(),[i,l]=N.useState({}),d=(o??[]).map(u=>{const g=(a??[]).find(x=>x.id===u.organizationId);return{...u,organizationSlug:g?.slug||u.organizationSlug,organizationName:g?.name||u.organizationName}}).map(u=>({...u,status:i[u.id]||u.status})),m=[...d].sort((u,g)=>{const x={pending:0,accepted:1,rejected:2};return(x[u.status]??999)-(x[g.status]??999)}),h=d.filter(u=>u.status==="pending").length>0,b=(u,g)=>{l(x=>({...x,[u]:g}))};return n.jsxs(Nt,{open:t,onOpenChange:e,children:[n.jsx(wt,{asChild:!0,children:n.jsxs(Z,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(rt,{size:18,className:"text-muted-foreground"}),h&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(yt,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:m.length>0?m.map(u=>n.jsx(dn,{invitation:u,onStatusChange:b},u.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(rt,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})}function fn(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(Qt,{"data-slot":"sheet",...s}),e[2]=s,e[3]=o):o=e[3],o}function un(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(ns,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=o):o=e[3],o}function hn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx(os,{"data-slot":"sheet-overlay",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function pn(t){const e=p.c(17);let s,o,a,i;e[0]!==t?({className:o,children:s,side:i,...a}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i):(s=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?"right":i;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(hn,{}),e[5]=c):c=e[5];const r=l==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=l==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=l==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=l==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let h;e[6]!==o||e[7]!==r||e[8]!==d||e[9]!==m||e[10]!==f?(h=O("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r,d,m,f,o),e[6]=o,e[7]=r,e[8]=d,e[9]=m,e[10]=f,e[11]=h):h=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(as,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n.jsx(_e,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=b):b=e[12];let u;return e[13]!==s||e[14]!==a||e[15]!==h?(u=n.jsxs(un,{children:[c,n.jsxs(ss,{"data-slot":"sheet-content",className:h,...a,children:[s,b]})]}),e[13]=s,e[14]=a,e[15]=h,e[16]=u):u=e[16],u}function xn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"sheet-header",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function gn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("text-foreground font-semibold",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx(es,{"data-slot":"sheet-title",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function bn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("text-muted-foreground text-sm",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx(ts,{"data-slot":"sheet-description",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Ut(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"skeleton",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const jn="sidebar_state",vn=3600*24*7,Sn="16rem",Nn="18rem",wn="3rem",yn="b",Gt=N.createContext(null);function ot(){const t=N.useContext(Gt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Cn(t){const e=p.c(21),{defaultOpen:s,open:o,onOpenChange:a,children:i}=t,l=s===void 0?!0:s,c=Ie(),[r,d]=N.useState(!1),[m,f]=N.useState(l),h=o??m;let b;e[0]!==h||e[1]!==a?(b=y=>{const w=typeof y=="function"?y(h):y;a?a(w):f(w),document.cookie=`${jn}=${w}; path=/; max-age=${vn}`},e[0]=h,e[1]=a,e[2]=b):b=e[2];const u=b;let g;e[3]!==c||e[4]!==u?(g=()=>c?d(kn):u(_n),e[3]=c,e[4]=u,e[5]=g):g=e[5];const x=g;let v,S;e[6]!==x?(v=()=>{const y=w=>{if(w.key===yn&&(w.metaKey||w.ctrlKey)){const j=w.target;if(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.isContentEditable)return;w.preventDefault(),x()}};return globalThis.addEventListener("keydown",y),()=>globalThis.removeEventListener("keydown",y)},S=[x],e[6]=x,e[7]=v,e[8]=S):(v=e[7],S=e[8]),N.useEffect(v,S);const C=h?"expanded":"collapsed";let k;e[9]!==c||e[10]!==h||e[11]!==r||e[12]!==u||e[13]!==C||e[14]!==x?(k={state:C,open:h,setOpen:u,isMobile:c,openMobile:r,setOpenMobile:d,toggleSidebar:x},e[9]=c,e[10]=h,e[11]=r,e[12]=u,e[13]=C,e[14]=x,e[15]=k):k=e[15];const I=k;let $;e[16]!==i?($=n.jsx(_t,{delayDuration:0,children:i}),e[16]=i,e[17]=$):$=e[17];let z;return e[18]!==I||e[19]!==$?(z=n.jsx(Gt.Provider,{value:I,children:$}),e[18]=I,e[19]=$,e[20]=z):z=e[20],z}function _n(t){return!t}function kn(t){return!t}function In(t){const e=p.c(14);let s,o,a,i;e[0]!==t?({className:o,style:i,children:s,...a}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i):(s=e[1],o=e[2],a=e[3],i=e[4]);let l;e[5]!==i?(l={"--sidebar-width":Sn,"--sidebar-width-icon":wn,...i},e[5]=i,e[6]=l):l=e[6];const c=l;let r;e[7]!==o?(r=O("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",o),e[7]=o,e[8]=r):r=e[8];let d;return e[9]!==s||e[10]!==a||e[11]!==c||e[12]!==r?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:c,className:r,...a,children:s}),e[9]=s,e[10]=a,e[11]=c,e[12]=r,e[13]=d):d=e[13],d}function $n(t){const e=p.c(46);let s,o,a,i,l,c;e[0]!==t?({side:i,variant:l,collapsible:c,className:o,children:s,...a}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=c):(s=e[1],o=e[2],a=e[3],i=e[4],l=e[5],c=e[6]);const r=i===void 0?"left":i,d=l===void 0?"sidebar":l,m=c===void 0?"offcanvas":c,{isMobile:f,state:h,openMobile:b,setOpenMobile:u}=ot();if(m==="none"){let w;e[7]!==o?(w=O("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),e[7]=o,e[8]=w):w=e[8];let j;return e[9]!==s||e[10]!==a||e[11]!==w?(j=n.jsx("div",{"data-slot":"sidebar",className:w,...a,children:s}),e[9]=s,e[10]=a,e[11]=w,e[12]=j):j=e[12],j}if(f){let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w={"--sidebar-width":Nn},e[13]=w):w=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsxs(xn,{className:"sr-only",children:[n.jsx(gn,{children:"Sidebar"}),n.jsx(bn,{children:"Displays the mobile sidebar."})]}),e[14]=j):j=e[14];let M;e[15]!==s?(M=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=M):M=e[16];let T;e[17]!==r||e[18]!==M?(T=n.jsxs(pn,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:w,side:r,children:[j,M]}),e[17]=r,e[18]=M,e[19]=T):T=e[19];let A;return e[20]!==b||e[21]!==a||e[22]!==u||e[23]!==T?(A=n.jsx(fn,{open:b,onOpenChange:u,...a,children:T}),e[20]=b,e[21]=a,e[22]=u,e[23]=T,e[24]=A):A=e[24],A}const g=h==="collapsed"?m:"",x=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let v;e[25]!==x?(v=O("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",x),e[25]=x,e[26]=v):v=e[26];let S;e[27]!==v?(S=n.jsx("div",{"data-slot":"sidebar-gap",className:v}),e[27]=v,e[28]=S):S=e[28];const C=r==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",k=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let I;e[29]!==o||e[30]!==C||e[31]!==k?(I=O("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",C,k,o),e[29]=o,e[30]=C,e[31]=k,e[32]=I):I=e[32];let $;e[33]!==s?($=n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=$):$=e[34];let z;e[35]!==a||e[36]!==I||e[37]!==$?(z=n.jsx("div",{"data-slot":"sidebar-container",className:I,...a,children:$}),e[35]=a,e[36]=I,e[37]=$,e[38]=z):z=e[38];let y;return e[39]!==r||e[40]!==h||e[41]!==z||e[42]!==g||e[43]!==S||e[44]!==d?(y=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":g,"data-variant":d,"data-side":r,"data-slot":"sidebar",children:[S,z]}),e[39]=r,e[40]=h,e[41]=z,e[42]=g,e[43]=S,e[44]=d,e[45]=y):y=e[45],y}function zn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("main",{"data-slot":"sidebar-inset",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Mn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("h-4 m-0! w-full",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-sidebar":"separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function On(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Tn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function An(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("w-full text-sm",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Rn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Fe(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("group/menu-item relative",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const En=is("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ft(t){const e=p.c(28);let s,o,a,i,l,c,r;e[0]!==t?({asChild:a,isActive:i,variant:l,size:c,tooltip:r,className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=c,e[7]=r):(s=e[1],o=e[2],a=e[3],i=e[4],l=e[5],c=e[6],r=e[7]);const d=a===void 0?!1:a,m=i===void 0?!1:i,f=l===void 0?"default":l,h=c===void 0?"default":c,b=d?ls:"button",{isMobile:u,state:g}=ot();let x;e[8]!==s||e[9]!==h||e[10]!==f?(x=O(En({variant:f,size:h}),s),e[8]=s,e[9]=h,e[10]=f,e[11]=x):x=e[11];let v;e[12]!==b||e[13]!==m||e[14]!==o||e[15]!==h||e[16]!==x?(v=n.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":m,className:x,...o}),e[12]=b,e[13]=m,e[14]=o,e[15]=h,e[16]=x,e[17]=v):v=e[17];const S=v;if(!r)return S;if(typeof r=="string"){let z;e[18]!==r?(z={children:r},e[18]=r,e[19]=z):z=e[19],r=z}let C;e[20]!==S?(C=n.jsx(kt,{asChild:!0,children:S}),e[20]=S,e[21]=C):C=e[21];const k=g!=="collapsed"||u;let I;e[22]!==k||e[23]!==r?(I=n.jsx(Ct,{side:"right",align:"center",hidden:k,...r}),e[22]=k,e[23]=r,e[24]=I):I=e[24];let $;return e[25]!==C||e[26]!==I?($=n.jsxs(It,{children:[C,I]}),e[25]=C,e[26]=I,e[27]=$):$=e[27],$}function Ln(t){const e=p.c(26),{item:s}=t,o=ke(),{org:a}=He(),i=$t(a.id),l=vs(a.id);let c;e[0]!==l.update||e[1]!==s.url||e[2]!==i?.sidebar_items?(c=async()=>{const k=(i?.sidebar_items||[]).filter(I=>I.url!==s.url);await l.update.mutateAsync({sidebar_items:k})},e[0]=l.update,e[1]=s.url,e[2]=i?.sidebar_items,e[3]=c):c=e[3];const r=c;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const f=m;let h;e[7]!==s.url||e[8]!==o?(h=()=>{o({to:s.url})},e[7]=s.url,e[8]=o,e[9]=h):h=e[9];const b=s.title;let u;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(u=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(gs,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=u):u=e[13];let g;e[14]!==s.title?(g=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=g):g=e[15];let x;e[16]!==g?(x=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:g})}),e[16]=g,e[17]=x):x=e[17];let v;e[18]!==r?(v=n.jsx(_e,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:C=>{C.preventDefault(),C.stopPropagation(),r()}}),e[18]=r,e[19]=v):v=e[19];let S;return e[20]!==s.title||e[21]!==h||e[22]!==u||e[23]!==x||e[24]!==v?(S=n.jsx(Fe,{children:n.jsxs(Ft,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:h,tooltip:b,children:[u,x,v]})}),e[20]=s.title,e[21]=h,e[22]=u,e[23]=x,e[24]=v,e[25]=S):S=e[25],S}function Pn(){const t=p.c(4),{org:e}=He(),o=$t(e.id)?.sidebar_items;if(!o?.length)return null;let a;t[0]!==o?(a=o.map(Dn),t[0]=o,t[1]=a):a=t[1];let i;return t[2]!==a?(i=n.jsx(Vt,{children:a}),t[2]=a,t[3]=i):i=t[3],i}function Dn(t){return n.jsx(Ln,{item:t},t.url)}function pt(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Fe,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Ut,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Vt(t){const e=p.c(4),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Mn,{className:"my-2 -ml-1"}),e[0]=o):o=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Fe,{children:n.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=a):a=e[1];let i;return e[2]!==s?(i=n.jsxs(n.Fragment,{children:[o,a,s]}),e[2]=s,e[3]=i):i=e[3],i}function Bn(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(N.Suspense,{fallback:n.jsxs(Vt,{children:[n.jsx(pt,{}),n.jsx(pt,{})]}),children:n.jsx(Pn,{})}),t[0]=e):e=t[0],e}function Hn(){const t=p.c(49),{locator:e}=He(),s=ke(),o=bt();let a;t[0]!==e?(a=dt.parse(e),t[0]=e,t[1]=a):a=t[1];const{org:i}=a;let l;t[2]!==e?(l=dt.isOrgAdminProject(e),t[2]=e,t[3]=l):l=t[3];const c=l,r=o.location.pathname===`/${i}`||o.location.pathname===`/${i}/`;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Et,{}),t[4]=d):d=t[4];let m;t[5]!==r||t[6]!==s||t[7]!==i?(m={key:"home",label:"Home",icon:d,onClick:()=>{r?window.dispatchEvent(new CustomEvent("reset-home-view")):s({to:"/$org",params:{org:i}})}},t[5]=r,t[6]=s,t[7]=i,t[8]=m):m=t[8];let f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Tt,{}),t[9]=f):f=t[9];let h;t[10]!==s||t[11]!==i?(h={key:"store",label:"Store",icon:f,onClick:()=>s({to:"/$org/store",params:{org:i}})},t[10]=s,t[11]=i,t[12]=h):h=t[12];let b;t[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Ss,{}),t[13]=b):b=t[13];let u;t[14]!==s||t[15]!==i?(u={key:"mcps",label:"Connections",icon:b,onClick:()=>s({to:"/$org/mcps",params:{org:i}})},t[14]=s,t[15]=i,t[16]=u):u=t[16];let g;t[17]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(tt,{}),t[17]=g):g=t[17];let x;t[18]!==s||t[19]!==i?(x={key:"gateways",label:"Agents",icon:g,onClick:()=>s({to:"/$org/gateways",params:{org:i}})},t[18]=s,t[19]=i,t[20]=x):x=t[20];let v;t[21]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ht,{}),t[21]=v):v=t[21];let S;t[22]!==s||t[23]!==i?(S={key:"workflow",label:"Workflows",icon:v,onClick:()=>s({to:"/$org/workflows",params:{org:i}})},t[22]=s,t[23]=i,t[24]=S):S=t[24];let C;t[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Ot,{}),t[25]=C):C=t[25];let k;t[26]!==s||t[27]!==i?(k={key:"monitoring",label:"Monitoring",icon:C,onClick:()=>s({to:"/$org/monitoring",params:{org:i}})},t[26]=s,t[27]=i,t[28]=k):k=t[28];let I;t[29]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(Bt,{}),t[29]=I):I=t[29];let $;t[30]!==s||t[31]!==i?($={key:"members",label:"Members",icon:I,onClick:()=>s({to:"/$org/members",params:{org:i}})},t[30]=s,t[31]=i,t[32]=$):$=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(at,{}),t[33]=z):z=t[33];let y;t[34]!==s||t[35]!==i?(y={key:"settings",label:"Settings",icon:z,onClick:()=>s({to:"/$org/settings",params:{org:i}})},t[34]=s,t[35]=i,t[36]=y):y=t[36];let w;t[37]!==S||t[38]!==k||t[39]!==$||t[40]!==y||t[41]!==m||t[42]!==h||t[43]!==u||t[44]!==x?(w=[m,h,u,x,S,k,$,y],t[37]=S,t[38]=k,t[39]=$,t[40]=y,t[41]=m,t[42]=h,t[43]=u,t[44]=x,t[45]=w):w=t[45];const j=w;let M;return t[46]!==j||t[47]!==c?(M=c?j:[],t[46]=j,t[47]=c,t[48]=M):M=t[48],M}function Wt(t){const e=p.c(10),{navigationItems:s,footer:o,additionalContent:a,variant:i,collapsible:l}=t,c=i===void 0?"sidebar":i,r=l===void 0?"icon":l;let d;e[0]!==s?(d=s.map(Un),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==a||e[3]!==d?(m=n.jsx(On,{className:"flex-1 overflow-x-hidden",children:n.jsx(Tn,{className:"font-medium",children:n.jsx(An,{children:n.jsxs(Rn,{className:"gap-0.5",children:[d,a]})})})}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==o||e[7]!==m||e[8]!==c?(f=n.jsxs($n,{variant:c,collapsible:r,children:[m,o]}),e[5]=r,e[6]=o,e[7]=m,e[8]=c,e[9]=f):f=e[9],f}function Un(t){return n.jsx(Fe,{children:n.jsxs(Ft,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Wt.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Ut,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Gn(){const t=p.c(3),e=Hn();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(n.Fragment,{children:n.jsx(nt,{children:n.jsx(N.Suspense,{fallback:null,children:n.jsx(Bn,{})})})}),t[0]=s):s=t[0];let o;return t[1]!==e?(o=n.jsx(Wt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=o):o=t[2],o}function Fn(t){const e=p.c(12);let s,o,a,i;e[0]!==t?({className:s,orientation:a,decorative:i,...o}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i):(s=e[1],o=e[2],a=e[3],i=e[4]);const l=a===void 0?"horizontal":a,c=i===void 0?!0:i;let r;e[5]!==s?(r=O("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=r):r=e[6];let d;return e[7]!==c||e[8]!==l||e[9]!==o||e[10]!==r?(d=n.jsx(rs,{"data-slot":"separator-root",decorative:c,orientation:l,className:r,...o}),e[7]=c,e[8]=l,e[9]=o,e[10]=r,e[11]=d):d=e[11],d}const Kt=N.createContext(null);function Vn(){const t=N.useContext(Kt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Wn(t){const e=p.c(10),{children:s,onItemHover:o}=t,[a,i]=N.useState(null);let l;e[0]!==o?(l=f=>{i(f),o?.(f)},e[0]=o,e[1]=l):l=e[1];const c=l;let r;e[2]!==a||e[3]!==c?(r={hoveredItem:a,setHoveredItem:c},e[2]=a,e[3]=c,e[4]=r):r=e[4];let d;e[5]!==s?(d=n.jsx(Nt,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=n.jsx(Kt.Provider,{value:r,children:d}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Kn(t){const e=p.c(6),{children:s,onClick:o}=t;let a;e[0]!==s||e[1]!==o?(a=n.jsx(Z,{variant:"link",className:"p-0.5 h-auto",onClick:o,type:"button",children:s}),e[0]=s,e[1]=o,e[2]=a):a=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(wt,{asChild:!0,children:n.jsx(Z,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(At,{size:16,className:"opacity-50"})})}),e[3]=i):i=e[3];let l;return e[4]!==a?(l=n.jsxs("div",{className:"flex items-center gap-1",children:[a,i]}),e[4]=a,e[5]=l):l=e[5],l}function Zn(t){const e=p.c(8),{item:s,fallback:o}=t,a=o===void 0?"":o,i=s?.avatarUrl??"",l=s?.name??a;let c;e[0]!==i||e[1]!==l?(c=n.jsx(Q,{url:i,fallback:l,size:"xs",objectFit:"contain"}),e[0]=i,e[1]=l,e[2]=c):c=e[2];const r=s?.name??a;let d;e[3]!==r?(d=n.jsx("span",{children:r}),e[3]=r,e[4]=d):d=e[4];let m;return e[5]!==c||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[c,d]}),e[5]=c,e[6]=d,e[7]=m):m=e[7],m}function qn(t){const e=p.c(6),{children:s,align:o}=t,a=o===void 0?"start":o,l=N.Children.toArray(s).filter(Yn).length===1?"280px":"480px";let c;e[0]!==l?(c={width:l},e[0]=l,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==s||e[4]!==c?(r=n.jsx(yt,{align:a,className:"p-0 flex items-start",style:c,children:s}),e[2]=a,e[3]=s,e[4]=c,e[5]=r):r=e[5],r}function Yn(t){return N.isValidElement(t)&&(t.type===qt||t.type===Zt)}function Zt(t){const e=p.c(5),{children:s,className:o}=t;let a;e[0]!==o?(a=O("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",o),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==s||e[3]!==a?(i=n.jsx("div",{className:a,children:s}),e[2]=s,e[3]=a,e[4]=i):i=e[4],i}const qt=Zt;function Jn(t){const e=p.c(6),{placeholder:s,value:o,onChange:a}=t,i=s===void 0?"Search...":s;let l;e[0]!==a?(l=r=>a(r.target.value),e[0]=a,e[1]=l):l=e[1];let c;return e[2]!==i||e[3]!==l||e[4]!==o?(c=n.jsx(xs,{placeholder:i,value:o,onChange:l,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=i,e[3]=l,e[4]=o,e[5]=c):c=e[5],c}function Xn(t){const e=p.c(6),{children:s,emptyMessage:o}=t,a=o===void 0?"No items found.":o,i=N.Children.count(s)>0;let l;e[0]!==a||e[1]!==i?(l=!i&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:a}),e[0]=a,e[1]=i,e[2]=l):l=e[2];let c;return e[3]!==s||e[4]!==l?(c=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[l,s]}),e[3]=s,e[4]=l,e[5]=c):c=e[5],c}function Qn(t){const e=p.c(15),{item:s,onClick:o,onHover:a,children:i}=t,l=Vn();let c;e[0]!==l||e[1]!==s||e[2]!==a?(c=()=>{l.setHoveredItem(s.slug),a?.(s)},e[0]=l,e[1]=s,e[2]=a,e[3]=c):c=e[3];const r=c;let d;e[4]!==s||e[5]!==o?(d=()=>o(s),e[4]=s,e[5]=o,e[6]=d):d=e[6];let m;e[7]!==i||e[8]!==s.avatarUrl||e[9]!==s.name?(m=i||n.jsxs(n.Fragment,{children:[n.jsx(Q,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=i,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==d||e[13]!==m?(f=n.jsx(Z,{onClick:d,onMouseEnter:r,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=r,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function ea(t){const e=p.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ta(t){const e=p.c(11),{onClick:s,icon:o,children:a,variant:i}=t,c=(i===void 0?"default":i)==="muted"&&"text-muted-foreground";let r;e[0]!==c?(r=O("w-full justify-start font-normal",c),e[0]=c,e[1]=r):r=e[1];let d;e[2]!==o?(d=o&&n.jsx("span",{className:"[&>svg]:size-4",children:o}),e[2]=o,e[3]=d):d=e[3];let m;e[4]!==a?(m=n.jsx("span",{children:a}),e[4]=a,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==r||e[8]!==d||e[9]!==m?(f=n.jsxs(Z,{variant:"ghost",size:"sm",className:r,onClick:s,children:[d,m]}),e[6]=s,e[7]=r,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function sa(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Fn,{}),t[0]=e):e=t[0],e}function na(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const U=Object.assign(Wn,{Trigger:Kn,CurrentItem:Zn,Content:qn,Panel:qt,Search:Jn,Items:Xn,Item:Qn,Actions:ea,Action:ta,Separator:sa,Skeleton:na});function st(){const t=p.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=jt(e),{data:o}=J.useListOrganizations(),a=ke();let i;t[1]!==s||t[2]!==o?(i=o?.find(R=>R.slug===s),t[1]=s,t[2]=o,t[3]=i):i=t[3];const l=i,[c,r]=N.useState(""),[d,m]=N.useState(!1);let f,h,b,u,g,x,v,S;if(t[4]!==l||t[5]!==a||t[6]!==s||t[7]!==c||t[8]!==o){const D=(o?(()=>{const G=o.filter(F=>F.name.toLowerCase().includes(c.toLowerCase()));if(s){const F=G.findIndex(X=>X.slug===s);if(F>0){const X=G[F];X&&(G.splice(F,1),G.unshift(X))}}return G})():[]).map(aa);let _;t[17]!==l?(_=l?{slug:l.slug,name:l.name,avatarUrl:l.logo}:void 0,t[17]=l,t[18]=_):_=t[18];const W=_;u=U;let E;t[19]!==a||t[20]!==s?(E=()=>a({to:"/$org",params:{org:s??""}}),t[19]=a,t[20]=s,t[21]=E):E=t[21];let B;t[22]!==W?(B=n.jsx(U.CurrentItem,{item:W}),t[22]=W,t[23]=B):B=t[23],t[24]!==E||t[25]!==B?(S=n.jsx(U.Trigger,{onClick:E,children:B}),t[24]=E,t[25]=B,t[26]=S):S=t[26],b=U.Content,h=U.Panel,t[27]!==c?(v=n.jsx(U.Search,{placeholder:"Search organizations...",value:c,onChange:r}),t[27]=c,t[28]=v):v=t[28],f=U.Items,g="No organizations found.";let H;t[29]!==a?(H=G=>n.jsx(U.Item,{item:G,onClick:F=>a({to:"/$org",params:{org:F.slug}})},G.slug),t[29]=a,t[30]=H):H=t[30],x=D.map(H),t[4]=l,t[5]=a,t[6]=s,t[7]=c,t[8]=o,t[9]=f,t[10]=h,t[11]=b,t[12]=u,t[13]=g,t[14]=x,t[15]=v,t[16]=S}else f=t[9],h=t[10],b=t[11],u=t[12],g=t[13],x=t[14],v=t[15],S=t[16];let C;t[31]!==f||t[32]!==g||t[33]!==x?(C=n.jsx(f,{emptyMessage:g,children:x}),t[31]=f,t[32]=g,t[33]=x,t[34]=C):C=t[34];let k,I;t[35]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(U.Actions,{children:n.jsx(U.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),I=n.jsx(U.Separator,{}),t[35]=k,t[36]=I):(k=t[35],I=t[36]);let $;t[37]!==a?($=()=>a({to:"/"}),t[37]=a,t[38]=$):$=t[38];let z;t[39]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Cs,{}),t[39]=z):z=t[39];let y;t[40]!==$?(y=n.jsx(U.Actions,{children:n.jsx(U.Action,{onClick:$,icon:z,children:"See all organizations"})}),t[40]=$,t[41]=y):y=t[41];let w;t[42]!==h||t[43]!==y||t[44]!==v||t[45]!==C?(w=n.jsxs(h,{children:[v,C,k,I,y]}),t[42]=h,t[43]=y,t[44]=v,t[45]=C,t[46]=w):w=t[46];let j;t[47]!==b||t[48]!==w?(j=n.jsx(b,{children:w}),t[47]=b,t[48]=w,t[49]=j):j=t[49];let M;t[50]!==u||t[51]!==j||t[52]!==S?(M=n.jsxs(u,{children:[S,j]}),t[50]=u,t[51]=j,t[52]=S,t[53]=M):M=t[53];let T;t[54]!==d?(T=n.jsx(ys,{open:d,onOpenChange:m}),t[54]=d,t[55]=T):T=t[55];let A;return t[56]!==M||t[57]!==T?(A=n.jsxs(n.Fragment,{children:[M,T]}),t[56]=M,t[57]=T,t[58]=A):A=t[58],A}function aa(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}st.Skeleton=U.Skeleton;const Yt=N.createContext({setOpen:()=>{}}),oa=()=>N.useContext(Yt),ia=t=>{const e=p.c(25);let s,o,a,i,l;e[0]!==t?({children:s,defaultOpen:o,open:i,onOpenChange:a,...l}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(s=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const c=o??!1;let r;e[6]!==a||e[7]!==i||e[8]!==c?(r={prop:i,defaultProp:c,onChange:a},e[6]=a,e[7]=i,e[8]=c,e[9]=r):r=e[9];const[d,m]=zs(r);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let h;e[12]!==s||e[13]!==d||e[14]!==l||e[15]!==m?(h=n.jsx(Ms,{open:d,onOpenChange:m,...l,children:s}),e[12]=s,e[13]=d,e[14]=l,e[15]=m,e[16]=h):h=e[16];let b;e[17]!==d||e[18]!==l||e[19]!==m||e[20]!==h?(b=n.jsx(Hs,{open:d,onOpenChange:m,...l,children:h}),e[17]=d,e[18]=l,e[19]=m,e[20]=h,e[21]=b):b=e[21];let u;return e[22]!==f||e[23]!==b?(u=n.jsx(Yt.Provider,{value:f,children:b}),e[22]=f,e[23]=b,e[24]=u):u=e[24],u},la=t=>{const{children:e,title:s,...o}=t,a=Ie(),{className:i,...l}=o;return a?n.jsxs(ks,{...l,children:[n.jsx(Is,{className:"hidden",children:n.jsx($s,{children:s})}),n.jsx("div",{className:O("flex flex-col gap-2 p-2 py-4",i),children:e})]}):n.jsx(Bs,{...o,children:e})},ra=t=>{const{children:e,...s}=t,{setOpen:o}=oa(),a=Ie(),{className:i,...l}=s;return a?n.jsx("div",{...l,onClick:c=>{o(!1);const{onClick:r}=l;r?.(c)},className:O("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),children:e}):n.jsx(Us,{...s,children:e})},ca=t=>{const e=p.c(7);let s,o;e[0]!==t?({children:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const a=Ie();let i;return e[3]!==s||e[4]!==a||e[5]!==o?(i=a?n.jsx(_s,{asChild:!0,children:s}):n.jsx(Ds,{...o,children:s}),e[3]=s,e[4]=a,e[5]=o,e[6]=i):i=e[6],i},da=t=>{const e=p.c(7);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const a=Ie();let i;return e[3]!==s||e[4]!==a||e[5]!==o?(i=a?n.jsx(ut,{className:O(s),...o}):n.jsx(ut,{className:O(s),...o}),e[3]=s,e[4]=a,e[5]=o,e[6]=i):i=e[6],i};function ma(t){const e=p.c(11),{user:s,trigger:o,align:a,children:i}=t,l=a===void 0?"start":a;let c;e[0]!==o||e[1]!==s?(c=o(s),e[0]=o,e[1]=s,e[2]=c):c=e[2];let r;e[3]!==c?(r=n.jsx(ca,{asChild:!0,children:n.jsx("div",{children:c})}),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==l||e[6]!==i?(d=n.jsx(la,{side:"top",align:l,className:"md:w-[240px]",children:i}),e[5]=l,e[6]=i,e[7]=d):d=e[7];let m;return e[8]!==r||e[9]!==d?(m=n.jsxs(ia,{children:[r,d]}),e[8]=r,e[9]=d,e[10]=m):m=e[10],m}function fa(t){const e=p.c(8),{children:s,onClick:o,className:a,asChild:i}=t;let l;e[0]!==i||e[1]!==s||e[2]!==o?(l=i?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:o,children:s}),e[0]=i,e[1]=s,e[2]=o,e[3]=l):l=e[3];let c;return e[4]!==i||e[5]!==a||e[6]!==l?(c=n.jsx(ra,{asChild:i,className:a,children:l}),e[4]=i,e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function ua(t){const e=p.c(2),{className:s}=t;let o;return e[0]!==s?(o=n.jsx(da,{className:s}),e[0]=s,e[1]=o):o=e[1],o}function ha(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Y=Object.assign(ma,{Item:fa,Separator:ua,Skeleton:ha});function pa(t){const e=p.c(48),{open:s,onOpenChange:o,user:a,userImage:i}=t,[l,c]=Os(),[r,d]=N.useState(!1);let m;e[0]!==a.id?(m=()=>{navigator.clipboard.writeText(a.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=a.id,e[1]=m):m=e[1];const f=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Gs,{className:"text-base",children:"Profile Settings"}),e[2]=h):h=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(Fs,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[h,n.jsxs(Vs,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(_e,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=b):b=e[3];const u=a.name||"U";let g;e[4]!==u||e[5]!==i?(g=n.jsx(Q,{url:i,fallback:u,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=u,e[5]=i,e[6]=g):g=e[6];const x=a.name||"User";let v;e[7]!==x?(v=n.jsx("span",{className:"text-base font-medium text-foreground",children:x}),e[7]=x,e[8]=v):v=e[8];let S;e[9]!==a.email?(S=n.jsx("span",{className:"text-sm text-muted-foreground",children:a.email}),e[9]=a.email,e[10]=S):S=e[10];let C;e[11]!==v||e[12]!==S?(C=n.jsxs("div",{className:"flex flex-col gap-1",children:[v,S]}),e[11]=v,e[12]=S,e[13]=C):C=e[13];let k;e[14]!==g||e[15]!==C?(k=n.jsxs("div",{className:"flex items-center gap-4",children:[g,C]}),e[14]=g,e[15]=C,e[16]=k):k=e[16];let I;e[17]!==l||e[18]!==c?(I=()=>c(!l),e[17]=l,e[18]=c,e[19]=I):I=e[19];let $;e[20]===Symbol.for("react.memo_cache_sentinel")?($=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(Zs,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(Ys,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=$):$=e[20];let z;e[21]!==l||e[22]!==c?(z=n.jsx("div",{onClick:xa,children:n.jsx(qs,{checked:l,onCheckedChange:c})}),e[21]=l,e[22]=c,e[23]=z):z=e[23];let y;e[24]!==I||e[25]!==z?(y=n.jsxs("button",{type:"button",onClick:I,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[$,z]}),e[24]=I,e[25]=z,e[26]=y):y=e[26];let w;e[27]!==k||e[28]!==y?(w=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[k,y]}),e[27]=k,e[28]=y,e[29]=w):w=e[29];let j;e[30]!==a.id?(j=n.jsx("span",{className:"font-mono text-xs",children:a.id}),e[30]=a.id,e[31]=j):j=e[31];let M;e[32]!==r?(M=r?n.jsx(Be,{size:14,className:"text-green-600"}):n.jsx(zt,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=r,e[33]=M):M=e[33];let T;e[34]!==f||e[35]!==j||e[36]!==M?(T=n.jsx(kt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:f,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[j,M]})}),e[34]=f,e[35]=j,e[36]=M,e[37]=T):T=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Ct,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=A):A=e[38];let R;e[39]!==T?(R=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(_t,{children:n.jsxs(It,{children:[T,A]})})}),e[39]=T,e[40]=R):R=e[40];let D;e[41]!==w||e[42]!==R?(D=n.jsxs(Ws,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[b,n.jsxs("div",{className:"flex flex-col",children:[w,R]})]}),e[41]=w,e[42]=R,e[43]=D):D=e[43];let _;return e[44]!==o||e[45]!==s||e[46]!==D?(_=n.jsx(Ks,{open:s,onOpenChange:o,children:D}),e[44]=o,e[45]=s,e[46]=D,e[47]=_):_=e[47],_}function xa(t){return t.stopPropagation()}function ga(t){const e=p.c(47),{user:s,userImage:o}=t,[a,i]=N.useState(!1),[l,c]=N.useState(!1);let r;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(r=()=>{const _=`ID: ${s.id}
|
|
1
|
+
import{r as N,e as Xt,a as J,j as n,f as ke,t as K,c as p,R as Qt,T as es,D as ts,C as ss,P as ns,g as as,O as os,h as is,i as ls,k as bt,l as rs,d as jt,G as cs,m as ds,S as vt,n as ms,o as fs,N as us,p as hs,K as ps,q as St}from"./index-D825aBGT.js";import{E as nt}from"./error-boundary-swyLIuj9.js";import{B as Z,c as O,I as xs}from"./input-CUSLU-5Y.js";import{P as Nt,a as wt,b as yt}from"./popover-CiuXmEMm.js";import{B as lt}from"./badge-_9VZKl7s.js";import{i as Be}from"./Check-Bn7iaq_h.js";import{n as rt}from"./Inbox01-BtHWN2dX.js";import{s as ct}from"./XClose-DeI9b46h.js";import{i as gs}from"./File06-DD5RANl_.js";import{i as _e}from"./X-P1RHfgBU.js";import{u as Ie}from"./use-mobile-DSucR6ge.js";import{T as Ct,a as _t,b as kt,c as It,u as He,L as dt,P as bs,O as js}from"./project-context-provider-Y7j1MLG3.js";import{u as $t,a as vs}from"./use-organization-settings-zICyumVv.js";import{n as Ss,u as Ns,E as ws,I as mt}from"./use-connection-CJ5nWy0c.js";import{i as tt}from"./use-gateway-Cov2sDNb.js";import{C as ys}from"./create-organization-dialog-DJCSaeq_.js";import{A as Q}from"./avatar-HUmJyCrO.js";import{c as Cs}from"./Grid01-C578o4mm.js";import{D as _s,a as ks,b as Is,c as $s,u as zs,d as Ms,e as Os,C as P,f as ft,g as Ts,h as As,i as Rs,U as Es,G as Ls,M as Ps}from"./index-DfsK7wxC.js";import{D as Ds,a as Bs,b as Hs,c as Us,d as ut}from"./dropdown-menu-JqpADJWR.js";import{a as zt}from"./Copy01-Cufxb7u1.js";import{n as ht}from"./LinkExternal01-d5tCjGRk.js";import{D as Gs,a as Fs,b as Vs,c as Ws,d as Ks}from"./dialog-DPjf1g07.js";import{L as Zs}from"./form-BNePwzri.js";import{S as qs}from"./switch-CHSRGx1X.js";import{i as Ys}from"./Code01-Dp2-HwWV.js";import{u as Ue,L as Ge}from"./localstorage-keys-DCk__Bcu.js";import{u as Js,a as Xs,b as Qs,N as en,G as tn,T as sn,D as nn}from"./thread-history-popover-d49eUsmE.js";import{R as Mt,a as an,b as on}from"./resizable-CpuhJlAj.js";import{i as ln}from"./Loading01-BGeWv0Kv.js";import{s as rn}from"./Plus-CgN71ZpK.js";import{u as cn}from"./use-binding-pQGzNysE.js";import"./alert-dialog-BApkfnBU.js";import"./spinner-D8JOERWZ.js";import"./SearchMd-u2U3iAnY.js";import"./AlertCircle-C-YsmNug.js";import"./textarea-DA688jdJ.js";import"./Terminal-Fj__rdxn.js";import"./monaco-editor-CXJFCG3L.js";import"./select-BiK6lA7A.js";import"./ChevronDown-CXsTFOR4.js";import"./InfoCircle-BkGKY7qc.js";import"./useQuery-El_kGGDY.js";import"./use-gateway-system-prompt-D3bv_TPR.js";import"./well-known-mcp-D13f-8h2.js";import"./generate-id-Dyweu44Y.js";import"./Clock-7YlOAEqw.js";import"./Trash01-Vutqn1RC.js";import"./auth-B4yoGafc.js";const Ot=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));Ot.displayName="BarChart10";const Tt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));Tt.displayName="Building02";const At=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));At.displayName="ChevronSelectorVertical";const Rt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));Rt.displayName="Globe01";const Et=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M9 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));Et.displayName="Home02";const Lt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Lt.displayName="LayoutRight";const Pt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));Pt.displayName="LogOut01";const Dt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));Dt.displayName="Mail01";const at=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),N.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));at.displayName="Settings01";const Bt=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Bt.displayName="Users01";const Ht=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));Ht.displayName="Zap";function dn({invitation:t,onStatusChange:e}){const[s,o]=N.useState(!1),[a,i]=N.useState(!1),l=ke(),c=async()=>{o(!0);try{const u=await J.organization.acceptInvitation({invitationId:t.id});if(u.error)K.error(u.error.message),o(!1);else{e(t.id,"accepted");const g=await J.organization.setActive({organizationId:t.organizationId});g?.data?.slug?(K.success("Invitation accepted!"),l({to:"/$org",params:{org:g.data.slug}})):(K.success("Invitation accepted! Redirecting..."),l({to:"/"}))}}catch{K.error("Failed to accept invitation"),o(!1)}},r=async()=>{i(!0);try{const u=await J.organization.rejectInvitation({invitationId:t.id});u.error?(K.error(u.error.message),i(!1)):(K.success("Invitation rejected"),e(t.id,"rejected"),i(!1))}catch{K.error("Failed to reject invitation"),i(!1)}},d=t.organizationName||t.organizationId,m=t.inviter?.name||t.inviter?.email||t.email||"Someone",f=t.status==="pending",h=t.status==="accepted",b=t.status==="rejected";return n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0 ${f?"":"opacity-50"}`,children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(Dt,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:[n.jsx("span",{className:"font-semibold inline-block max-w-[120px] truncate align-bottom",children:m})," invited you to join ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:f?n.jsxs(n.Fragment,{children:[n.jsx(Z,{variant:"ghost",size:"icon",onClick:r,disabled:s||a,className:"h-8 w-8",children:n.jsx(ct,{size:14})}),n.jsx(Z,{variant:"outline",size:"icon",onClick:c,disabled:s||a,className:"h-8 w-8",children:n.jsx(Be,{size:14})})]}):h?n.jsxs(lt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Be,{size:12}),"Accepted"]}):b?n.jsxs(lt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ct,{size:12}),"Declined"]}):null})]})}function mn(){const[t,e]=N.useState(!1),s=N.useContext(Xt),{data:o}=s.hooks.useListUserInvitations(),{data:a}=J.useListOrganizations(),[i,l]=N.useState({}),d=(o??[]).map(u=>{const g=(a??[]).find(x=>x.id===u.organizationId);return{...u,organizationSlug:g?.slug||u.organizationSlug,organizationName:g?.name||u.organizationName}}).map(u=>({...u,status:i[u.id]||u.status})),m=[...d].sort((u,g)=>{const x={pending:0,accepted:1,rejected:2};return(x[u.status]??999)-(x[g.status]??999)}),h=d.filter(u=>u.status==="pending").length>0,b=(u,g)=>{l(x=>({...x,[u]:g}))};return n.jsxs(Nt,{open:t,onOpenChange:e,children:[n.jsx(wt,{asChild:!0,children:n.jsxs(Z,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(rt,{size:18,className:"text-muted-foreground"}),h&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(yt,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:m.length>0?m.map(u=>n.jsx(dn,{invitation:u,onStatusChange:b},u.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(rt,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})}function fn(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(Qt,{"data-slot":"sheet",...s}),e[2]=s,e[3]=o):o=e[3],o}function un(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(ns,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=o):o=e[3],o}function hn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx(os,{"data-slot":"sheet-overlay",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function pn(t){const e=p.c(17);let s,o,a,i;e[0]!==t?({className:o,children:s,side:i,...a}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i):(s=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?"right":i;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(hn,{}),e[5]=c):c=e[5];const r=l==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=l==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=l==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=l==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let h;e[6]!==o||e[7]!==r||e[8]!==d||e[9]!==m||e[10]!==f?(h=O("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r,d,m,f,o),e[6]=o,e[7]=r,e[8]=d,e[9]=m,e[10]=f,e[11]=h):h=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(as,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n.jsx(_e,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=b):b=e[12];let u;return e[13]!==s||e[14]!==a||e[15]!==h?(u=n.jsxs(un,{children:[c,n.jsxs(ss,{"data-slot":"sheet-content",className:h,...a,children:[s,b]})]}),e[13]=s,e[14]=a,e[15]=h,e[16]=u):u=e[16],u}function xn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"sheet-header",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function gn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("text-foreground font-semibold",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx(es,{"data-slot":"sheet-title",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function bn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("text-muted-foreground text-sm",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx(ts,{"data-slot":"sheet-description",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Ut(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"skeleton",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const jn="sidebar_state",vn=3600*24*7,Sn="16rem",Nn="18rem",wn="3rem",yn="b",Gt=N.createContext(null);function ot(){const t=N.useContext(Gt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Cn(t){const e=p.c(21),{defaultOpen:s,open:o,onOpenChange:a,children:i}=t,l=s===void 0?!0:s,c=Ie(),[r,d]=N.useState(!1),[m,f]=N.useState(l),h=o??m;let b;e[0]!==h||e[1]!==a?(b=y=>{const w=typeof y=="function"?y(h):y;a?a(w):f(w),document.cookie=`${jn}=${w}; path=/; max-age=${vn}`},e[0]=h,e[1]=a,e[2]=b):b=e[2];const u=b;let g;e[3]!==c||e[4]!==u?(g=()=>c?d(kn):u(_n),e[3]=c,e[4]=u,e[5]=g):g=e[5];const x=g;let v,S;e[6]!==x?(v=()=>{const y=w=>{if(w.key===yn&&(w.metaKey||w.ctrlKey)){const j=w.target;if(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.isContentEditable)return;w.preventDefault(),x()}};return globalThis.addEventListener("keydown",y),()=>globalThis.removeEventListener("keydown",y)},S=[x],e[6]=x,e[7]=v,e[8]=S):(v=e[7],S=e[8]),N.useEffect(v,S);const C=h?"expanded":"collapsed";let k;e[9]!==c||e[10]!==h||e[11]!==r||e[12]!==u||e[13]!==C||e[14]!==x?(k={state:C,open:h,setOpen:u,isMobile:c,openMobile:r,setOpenMobile:d,toggleSidebar:x},e[9]=c,e[10]=h,e[11]=r,e[12]=u,e[13]=C,e[14]=x,e[15]=k):k=e[15];const I=k;let $;e[16]!==i?($=n.jsx(_t,{delayDuration:0,children:i}),e[16]=i,e[17]=$):$=e[17];let z;return e[18]!==I||e[19]!==$?(z=n.jsx(Gt.Provider,{value:I,children:$}),e[18]=I,e[19]=$,e[20]=z):z=e[20],z}function _n(t){return!t}function kn(t){return!t}function In(t){const e=p.c(14);let s,o,a,i;e[0]!==t?({className:o,style:i,children:s,...a}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i):(s=e[1],o=e[2],a=e[3],i=e[4]);let l;e[5]!==i?(l={"--sidebar-width":Sn,"--sidebar-width-icon":wn,...i},e[5]=i,e[6]=l):l=e[6];const c=l;let r;e[7]!==o?(r=O("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",o),e[7]=o,e[8]=r):r=e[8];let d;return e[9]!==s||e[10]!==a||e[11]!==c||e[12]!==r?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:c,className:r,...a,children:s}),e[9]=s,e[10]=a,e[11]=c,e[12]=r,e[13]=d):d=e[13],d}function $n(t){const e=p.c(46);let s,o,a,i,l,c;e[0]!==t?({side:i,variant:l,collapsible:c,className:o,children:s,...a}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=c):(s=e[1],o=e[2],a=e[3],i=e[4],l=e[5],c=e[6]);const r=i===void 0?"left":i,d=l===void 0?"sidebar":l,m=c===void 0?"offcanvas":c,{isMobile:f,state:h,openMobile:b,setOpenMobile:u}=ot();if(m==="none"){let w;e[7]!==o?(w=O("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),e[7]=o,e[8]=w):w=e[8];let j;return e[9]!==s||e[10]!==a||e[11]!==w?(j=n.jsx("div",{"data-slot":"sidebar",className:w,...a,children:s}),e[9]=s,e[10]=a,e[11]=w,e[12]=j):j=e[12],j}if(f){let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w={"--sidebar-width":Nn},e[13]=w):w=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsxs(xn,{className:"sr-only",children:[n.jsx(gn,{children:"Sidebar"}),n.jsx(bn,{children:"Displays the mobile sidebar."})]}),e[14]=j):j=e[14];let M;e[15]!==s?(M=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=M):M=e[16];let T;e[17]!==r||e[18]!==M?(T=n.jsxs(pn,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:w,side:r,children:[j,M]}),e[17]=r,e[18]=M,e[19]=T):T=e[19];let A;return e[20]!==b||e[21]!==a||e[22]!==u||e[23]!==T?(A=n.jsx(fn,{open:b,onOpenChange:u,...a,children:T}),e[20]=b,e[21]=a,e[22]=u,e[23]=T,e[24]=A):A=e[24],A}const g=h==="collapsed"?m:"",x=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let v;e[25]!==x?(v=O("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",x),e[25]=x,e[26]=v):v=e[26];let S;e[27]!==v?(S=n.jsx("div",{"data-slot":"sidebar-gap",className:v}),e[27]=v,e[28]=S):S=e[28];const C=r==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",k=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let I;e[29]!==o||e[30]!==C||e[31]!==k?(I=O("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",C,k,o),e[29]=o,e[30]=C,e[31]=k,e[32]=I):I=e[32];let $;e[33]!==s?($=n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=$):$=e[34];let z;e[35]!==a||e[36]!==I||e[37]!==$?(z=n.jsx("div",{"data-slot":"sidebar-container",className:I,...a,children:$}),e[35]=a,e[36]=I,e[37]=$,e[38]=z):z=e[38];let y;return e[39]!==r||e[40]!==h||e[41]!==z||e[42]!==g||e[43]!==S||e[44]!==d?(y=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":g,"data-variant":d,"data-side":r,"data-slot":"sidebar",children:[S,z]}),e[39]=r,e[40]=h,e[41]=z,e[42]=g,e[43]=S,e[44]=d,e[45]=y):y=e[45],y}function zn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("main",{"data-slot":"sidebar-inset",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Mn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("h-4 m-0! w-full",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-sidebar":"separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function On(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Tn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function An(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("w-full text-sm",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Rn(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Fe(t){const e=p.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let a;e[3]!==s?(a=O("group/menu-item relative",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const En=is("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ft(t){const e=p.c(28);let s,o,a,i,l,c,r;e[0]!==t?({asChild:a,isActive:i,variant:l,size:c,tooltip:r,className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=c,e[7]=r):(s=e[1],o=e[2],a=e[3],i=e[4],l=e[5],c=e[6],r=e[7]);const d=a===void 0?!1:a,m=i===void 0?!1:i,f=l===void 0?"default":l,h=c===void 0?"default":c,b=d?ls:"button",{isMobile:u,state:g}=ot();let x;e[8]!==s||e[9]!==h||e[10]!==f?(x=O(En({variant:f,size:h}),s),e[8]=s,e[9]=h,e[10]=f,e[11]=x):x=e[11];let v;e[12]!==b||e[13]!==m||e[14]!==o||e[15]!==h||e[16]!==x?(v=n.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":m,className:x,...o}),e[12]=b,e[13]=m,e[14]=o,e[15]=h,e[16]=x,e[17]=v):v=e[17];const S=v;if(!r)return S;if(typeof r=="string"){let z;e[18]!==r?(z={children:r},e[18]=r,e[19]=z):z=e[19],r=z}let C;e[20]!==S?(C=n.jsx(kt,{asChild:!0,children:S}),e[20]=S,e[21]=C):C=e[21];const k=g!=="collapsed"||u;let I;e[22]!==k||e[23]!==r?(I=n.jsx(Ct,{side:"right",align:"center",hidden:k,...r}),e[22]=k,e[23]=r,e[24]=I):I=e[24];let $;return e[25]!==C||e[26]!==I?($=n.jsxs(It,{children:[C,I]}),e[25]=C,e[26]=I,e[27]=$):$=e[27],$}function Ln(t){const e=p.c(26),{item:s}=t,o=ke(),{org:a}=He(),i=$t(a.id),l=vs(a.id);let c;e[0]!==l.update||e[1]!==s.url||e[2]!==i?.sidebar_items?(c=async()=>{const k=(i?.sidebar_items||[]).filter(I=>I.url!==s.url);await l.update.mutateAsync({sidebar_items:k})},e[0]=l.update,e[1]=s.url,e[2]=i?.sidebar_items,e[3]=c):c=e[3];const r=c;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const f=m;let h;e[7]!==s.url||e[8]!==o?(h=()=>{o({to:s.url})},e[7]=s.url,e[8]=o,e[9]=h):h=e[9];const b=s.title;let u;e[10]!==f||e[11]!==s.icon||e[12]!==s.title?(u=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(gs,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=s.icon,e[12]=s.title,e[13]=u):u=e[13];let g;e[14]!==s.title?(g=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=g):g=e[15];let x;e[16]!==g?(x=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:g})}),e[16]=g,e[17]=x):x=e[17];let v;e[18]!==r?(v=n.jsx(_e,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:C=>{C.preventDefault(),C.stopPropagation(),r()}}),e[18]=r,e[19]=v):v=e[19];let S;return e[20]!==s.title||e[21]!==h||e[22]!==u||e[23]!==x||e[24]!==v?(S=n.jsx(Fe,{children:n.jsxs(Ft,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:h,tooltip:b,children:[u,x,v]})}),e[20]=s.title,e[21]=h,e[22]=u,e[23]=x,e[24]=v,e[25]=S):S=e[25],S}function Pn(){const t=p.c(4),{org:e}=He(),o=$t(e.id)?.sidebar_items;if(!o?.length)return null;let a;t[0]!==o?(a=o.map(Dn),t[0]=o,t[1]=a):a=t[1];let i;return t[2]!==a?(i=n.jsx(Vt,{children:a}),t[2]=a,t[3]=i):i=t[3],i}function Dn(t){return n.jsx(Ln,{item:t},t.url)}function pt(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Fe,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Ut,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Vt(t){const e=p.c(4),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Mn,{className:"my-2 -ml-1"}),e[0]=o):o=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Fe,{children:n.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=a):a=e[1];let i;return e[2]!==s?(i=n.jsxs(n.Fragment,{children:[o,a,s]}),e[2]=s,e[3]=i):i=e[3],i}function Bn(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(N.Suspense,{fallback:n.jsxs(Vt,{children:[n.jsx(pt,{}),n.jsx(pt,{})]}),children:n.jsx(Pn,{})}),t[0]=e):e=t[0],e}function Hn(){const t=p.c(49),{locator:e}=He(),s=ke(),o=bt();let a;t[0]!==e?(a=dt.parse(e),t[0]=e,t[1]=a):a=t[1];const{org:i}=a;let l;t[2]!==e?(l=dt.isOrgAdminProject(e),t[2]=e,t[3]=l):l=t[3];const c=l,r=o.location.pathname===`/${i}`||o.location.pathname===`/${i}/`;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Et,{}),t[4]=d):d=t[4];let m;t[5]!==r||t[6]!==s||t[7]!==i?(m={key:"home",label:"Home",icon:d,onClick:()=>{r?window.dispatchEvent(new CustomEvent("reset-home-view")):s({to:"/$org",params:{org:i}})}},t[5]=r,t[6]=s,t[7]=i,t[8]=m):m=t[8];let f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Tt,{}),t[9]=f):f=t[9];let h;t[10]!==s||t[11]!==i?(h={key:"store",label:"Store",icon:f,onClick:()=>s({to:"/$org/store",params:{org:i}})},t[10]=s,t[11]=i,t[12]=h):h=t[12];let b;t[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Ss,{}),t[13]=b):b=t[13];let u;t[14]!==s||t[15]!==i?(u={key:"mcps",label:"Connections",icon:b,onClick:()=>s({to:"/$org/mcps",params:{org:i}})},t[14]=s,t[15]=i,t[16]=u):u=t[16];let g;t[17]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(tt,{}),t[17]=g):g=t[17];let x;t[18]!==s||t[19]!==i?(x={key:"gateways",label:"Agents",icon:g,onClick:()=>s({to:"/$org/gateways",params:{org:i}})},t[18]=s,t[19]=i,t[20]=x):x=t[20];let v;t[21]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ht,{}),t[21]=v):v=t[21];let S;t[22]!==s||t[23]!==i?(S={key:"workflow",label:"Workflows",icon:v,onClick:()=>s({to:"/$org/workflows",params:{org:i}})},t[22]=s,t[23]=i,t[24]=S):S=t[24];let C;t[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Ot,{}),t[25]=C):C=t[25];let k;t[26]!==s||t[27]!==i?(k={key:"monitoring",label:"Monitoring",icon:C,onClick:()=>s({to:"/$org/monitoring",params:{org:i}})},t[26]=s,t[27]=i,t[28]=k):k=t[28];let I;t[29]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(Bt,{}),t[29]=I):I=t[29];let $;t[30]!==s||t[31]!==i?($={key:"members",label:"Members",icon:I,onClick:()=>s({to:"/$org/members",params:{org:i}})},t[30]=s,t[31]=i,t[32]=$):$=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(at,{}),t[33]=z):z=t[33];let y;t[34]!==s||t[35]!==i?(y={key:"settings",label:"Settings",icon:z,onClick:()=>s({to:"/$org/settings",params:{org:i}})},t[34]=s,t[35]=i,t[36]=y):y=t[36];let w;t[37]!==S||t[38]!==k||t[39]!==$||t[40]!==y||t[41]!==m||t[42]!==h||t[43]!==u||t[44]!==x?(w=[m,h,u,x,S,k,$,y],t[37]=S,t[38]=k,t[39]=$,t[40]=y,t[41]=m,t[42]=h,t[43]=u,t[44]=x,t[45]=w):w=t[45];const j=w;let M;return t[46]!==j||t[47]!==c?(M=c?j:[],t[46]=j,t[47]=c,t[48]=M):M=t[48],M}function Wt(t){const e=p.c(10),{navigationItems:s,footer:o,additionalContent:a,variant:i,collapsible:l}=t,c=i===void 0?"sidebar":i,r=l===void 0?"icon":l;let d;e[0]!==s?(d=s.map(Un),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==a||e[3]!==d?(m=n.jsx(On,{className:"flex-1 overflow-x-hidden",children:n.jsx(Tn,{className:"font-medium",children:n.jsx(An,{children:n.jsxs(Rn,{className:"gap-0.5",children:[d,a]})})})}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==o||e[7]!==m||e[8]!==c?(f=n.jsxs($n,{variant:c,collapsible:r,children:[m,o]}),e[5]=r,e[6]=o,e[7]=m,e[8]=c,e[9]=f):f=e[9],f}function Un(t){return n.jsx(Fe,{children:n.jsxs(Ft,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Wt.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Ut,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Gn(){const t=p.c(3),e=Hn();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(n.Fragment,{children:n.jsx(nt,{children:n.jsx(N.Suspense,{fallback:null,children:n.jsx(Bn,{})})})}),t[0]=s):s=t[0];let o;return t[1]!==e?(o=n.jsx(Wt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=o):o=t[2],o}function Fn(t){const e=p.c(12);let s,o,a,i;e[0]!==t?({className:s,orientation:a,decorative:i,...o}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i):(s=e[1],o=e[2],a=e[3],i=e[4]);const l=a===void 0?"horizontal":a,c=i===void 0?!0:i;let r;e[5]!==s?(r=O("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=r):r=e[6];let d;return e[7]!==c||e[8]!==l||e[9]!==o||e[10]!==r?(d=n.jsx(rs,{"data-slot":"separator-root",decorative:c,orientation:l,className:r,...o}),e[7]=c,e[8]=l,e[9]=o,e[10]=r,e[11]=d):d=e[11],d}const Kt=N.createContext(null);function Vn(){const t=N.useContext(Kt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Wn(t){const e=p.c(10),{children:s,onItemHover:o}=t,[a,i]=N.useState(null);let l;e[0]!==o?(l=f=>{i(f),o?.(f)},e[0]=o,e[1]=l):l=e[1];const c=l;let r;e[2]!==a||e[3]!==c?(r={hoveredItem:a,setHoveredItem:c},e[2]=a,e[3]=c,e[4]=r):r=e[4];let d;e[5]!==s?(d=n.jsx(Nt,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==d?(m=n.jsx(Kt.Provider,{value:r,children:d}),e[7]=r,e[8]=d,e[9]=m):m=e[9],m}function Kn(t){const e=p.c(6),{children:s,onClick:o}=t;let a;e[0]!==s||e[1]!==o?(a=n.jsx(Z,{variant:"link",className:"p-0.5 h-auto",onClick:o,type:"button",children:s}),e[0]=s,e[1]=o,e[2]=a):a=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(wt,{asChild:!0,children:n.jsx(Z,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(At,{size:16,className:"opacity-50"})})}),e[3]=i):i=e[3];let l;return e[4]!==a?(l=n.jsxs("div",{className:"flex items-center gap-1",children:[a,i]}),e[4]=a,e[5]=l):l=e[5],l}function Zn(t){const e=p.c(8),{item:s,fallback:o}=t,a=o===void 0?"":o,i=s?.avatarUrl??"",l=s?.name??a;let c;e[0]!==i||e[1]!==l?(c=n.jsx(Q,{url:i,fallback:l,size:"xs",objectFit:"contain"}),e[0]=i,e[1]=l,e[2]=c):c=e[2];const r=s?.name??a;let d;e[3]!==r?(d=n.jsx("span",{children:r}),e[3]=r,e[4]=d):d=e[4];let m;return e[5]!==c||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[c,d]}),e[5]=c,e[6]=d,e[7]=m):m=e[7],m}function qn(t){const e=p.c(6),{children:s,align:o}=t,a=o===void 0?"start":o,l=N.Children.toArray(s).filter(Yn).length===1?"280px":"480px";let c;e[0]!==l?(c={width:l},e[0]=l,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==s||e[4]!==c?(r=n.jsx(yt,{align:a,className:"p-0 flex items-start",style:c,children:s}),e[2]=a,e[3]=s,e[4]=c,e[5]=r):r=e[5],r}function Yn(t){return N.isValidElement(t)&&(t.type===qt||t.type===Zt)}function Zt(t){const e=p.c(5),{children:s,className:o}=t;let a;e[0]!==o?(a=O("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",o),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==s||e[3]!==a?(i=n.jsx("div",{className:a,children:s}),e[2]=s,e[3]=a,e[4]=i):i=e[4],i}const qt=Zt;function Jn(t){const e=p.c(6),{placeholder:s,value:o,onChange:a}=t,i=s===void 0?"Search...":s;let l;e[0]!==a?(l=r=>a(r.target.value),e[0]=a,e[1]=l):l=e[1];let c;return e[2]!==i||e[3]!==l||e[4]!==o?(c=n.jsx(xs,{placeholder:i,value:o,onChange:l,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=i,e[3]=l,e[4]=o,e[5]=c):c=e[5],c}function Xn(t){const e=p.c(6),{children:s,emptyMessage:o}=t,a=o===void 0?"No items found.":o,i=N.Children.count(s)>0;let l;e[0]!==a||e[1]!==i?(l=!i&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:a}),e[0]=a,e[1]=i,e[2]=l):l=e[2];let c;return e[3]!==s||e[4]!==l?(c=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[l,s]}),e[3]=s,e[4]=l,e[5]=c):c=e[5],c}function Qn(t){const e=p.c(15),{item:s,onClick:o,onHover:a,children:i}=t,l=Vn();let c;e[0]!==l||e[1]!==s||e[2]!==a?(c=()=>{l.setHoveredItem(s.slug),a?.(s)},e[0]=l,e[1]=s,e[2]=a,e[3]=c):c=e[3];const r=c;let d;e[4]!==s||e[5]!==o?(d=()=>o(s),e[4]=s,e[5]=o,e[6]=d):d=e[6];let m;e[7]!==i||e[8]!==s.avatarUrl||e[9]!==s.name?(m=i||n.jsxs(n.Fragment,{children:[n.jsx(Q,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=i,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==d||e[13]!==m?(f=n.jsx(Z,{onClick:d,onMouseEnter:r,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=r,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function ea(t){const e=p.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ta(t){const e=p.c(11),{onClick:s,icon:o,children:a,variant:i}=t,c=(i===void 0?"default":i)==="muted"&&"text-muted-foreground";let r;e[0]!==c?(r=O("w-full justify-start font-normal",c),e[0]=c,e[1]=r):r=e[1];let d;e[2]!==o?(d=o&&n.jsx("span",{className:"[&>svg]:size-4",children:o}),e[2]=o,e[3]=d):d=e[3];let m;e[4]!==a?(m=n.jsx("span",{children:a}),e[4]=a,e[5]=m):m=e[5];let f;return e[6]!==s||e[7]!==r||e[8]!==d||e[9]!==m?(f=n.jsxs(Z,{variant:"ghost",size:"sm",className:r,onClick:s,children:[d,m]}),e[6]=s,e[7]=r,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function sa(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Fn,{}),t[0]=e):e=t[0],e}function na(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const U=Object.assign(Wn,{Trigger:Kn,CurrentItem:Zn,Content:qn,Panel:qt,Search:Jn,Items:Xn,Item:Qn,Actions:ea,Action:ta,Separator:sa,Skeleton:na});function st(){const t=p.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=jt(e),{data:o}=J.useListOrganizations(),a=ke();let i;t[1]!==s||t[2]!==o?(i=o?.find(R=>R.slug===s),t[1]=s,t[2]=o,t[3]=i):i=t[3];const l=i,[c,r]=N.useState(""),[d,m]=N.useState(!1);let f,h,b,u,g,x,v,S;if(t[4]!==l||t[5]!==a||t[6]!==s||t[7]!==c||t[8]!==o){const D=(o?(()=>{const G=o.filter(F=>F.name.toLowerCase().includes(c.toLowerCase()));if(s){const F=G.findIndex(X=>X.slug===s);if(F>0){const X=G[F];X&&(G.splice(F,1),G.unshift(X))}}return G})():[]).map(aa);let _;t[17]!==l?(_=l?{slug:l.slug,name:l.name,avatarUrl:l.logo}:void 0,t[17]=l,t[18]=_):_=t[18];const W=_;u=U;let E;t[19]!==a||t[20]!==s?(E=()=>a({to:"/$org",params:{org:s??""}}),t[19]=a,t[20]=s,t[21]=E):E=t[21];let B;t[22]!==W?(B=n.jsx(U.CurrentItem,{item:W}),t[22]=W,t[23]=B):B=t[23],t[24]!==E||t[25]!==B?(S=n.jsx(U.Trigger,{onClick:E,children:B}),t[24]=E,t[25]=B,t[26]=S):S=t[26],b=U.Content,h=U.Panel,t[27]!==c?(v=n.jsx(U.Search,{placeholder:"Search organizations...",value:c,onChange:r}),t[27]=c,t[28]=v):v=t[28],f=U.Items,g="No organizations found.";let H;t[29]!==a?(H=G=>n.jsx(U.Item,{item:G,onClick:F=>a({to:"/$org",params:{org:F.slug}})},G.slug),t[29]=a,t[30]=H):H=t[30],x=D.map(H),t[4]=l,t[5]=a,t[6]=s,t[7]=c,t[8]=o,t[9]=f,t[10]=h,t[11]=b,t[12]=u,t[13]=g,t[14]=x,t[15]=v,t[16]=S}else f=t[9],h=t[10],b=t[11],u=t[12],g=t[13],x=t[14],v=t[15],S=t[16];let C;t[31]!==f||t[32]!==g||t[33]!==x?(C=n.jsx(f,{emptyMessage:g,children:x}),t[31]=f,t[32]=g,t[33]=x,t[34]=C):C=t[34];let k,I;t[35]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(U.Actions,{children:n.jsx(U.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),I=n.jsx(U.Separator,{}),t[35]=k,t[36]=I):(k=t[35],I=t[36]);let $;t[37]!==a?($=()=>a({to:"/"}),t[37]=a,t[38]=$):$=t[38];let z;t[39]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Cs,{}),t[39]=z):z=t[39];let y;t[40]!==$?(y=n.jsx(U.Actions,{children:n.jsx(U.Action,{onClick:$,icon:z,children:"See all organizations"})}),t[40]=$,t[41]=y):y=t[41];let w;t[42]!==h||t[43]!==y||t[44]!==v||t[45]!==C?(w=n.jsxs(h,{children:[v,C,k,I,y]}),t[42]=h,t[43]=y,t[44]=v,t[45]=C,t[46]=w):w=t[46];let j;t[47]!==b||t[48]!==w?(j=n.jsx(b,{children:w}),t[47]=b,t[48]=w,t[49]=j):j=t[49];let M;t[50]!==u||t[51]!==j||t[52]!==S?(M=n.jsxs(u,{children:[S,j]}),t[50]=u,t[51]=j,t[52]=S,t[53]=M):M=t[53];let T;t[54]!==d?(T=n.jsx(ys,{open:d,onOpenChange:m}),t[54]=d,t[55]=T):T=t[55];let A;return t[56]!==M||t[57]!==T?(A=n.jsxs(n.Fragment,{children:[M,T]}),t[56]=M,t[57]=T,t[58]=A):A=t[58],A}function aa(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}st.Skeleton=U.Skeleton;const Yt=N.createContext({setOpen:()=>{}}),oa=()=>N.useContext(Yt),ia=t=>{const e=p.c(25);let s,o,a,i,l;e[0]!==t?({children:s,defaultOpen:o,open:i,onOpenChange:a,...l}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(s=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const c=o??!1;let r;e[6]!==a||e[7]!==i||e[8]!==c?(r={prop:i,defaultProp:c,onChange:a},e[6]=a,e[7]=i,e[8]=c,e[9]=r):r=e[9];const[d,m]=zs(r);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let h;e[12]!==s||e[13]!==d||e[14]!==l||e[15]!==m?(h=n.jsx(Ms,{open:d,onOpenChange:m,...l,children:s}),e[12]=s,e[13]=d,e[14]=l,e[15]=m,e[16]=h):h=e[16];let b;e[17]!==d||e[18]!==l||e[19]!==m||e[20]!==h?(b=n.jsx(Hs,{open:d,onOpenChange:m,...l,children:h}),e[17]=d,e[18]=l,e[19]=m,e[20]=h,e[21]=b):b=e[21];let u;return e[22]!==f||e[23]!==b?(u=n.jsx(Yt.Provider,{value:f,children:b}),e[22]=f,e[23]=b,e[24]=u):u=e[24],u},la=t=>{const{children:e,title:s,...o}=t,a=Ie(),{className:i,...l}=o;return a?n.jsxs(ks,{...l,children:[n.jsx(Is,{className:"hidden",children:n.jsx($s,{children:s})}),n.jsx("div",{className:O("flex flex-col gap-2 p-2 py-4",i),children:e})]}):n.jsx(Bs,{...o,children:e})},ra=t=>{const{children:e,...s}=t,{setOpen:o}=oa(),a=Ie(),{className:i,...l}=s;return a?n.jsx("div",{...l,onClick:c=>{o(!1);const{onClick:r}=l;r?.(c)},className:O("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),children:e}):n.jsx(Us,{...s,children:e})},ca=t=>{const e=p.c(7);let s,o;e[0]!==t?({children:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const a=Ie();let i;return e[3]!==s||e[4]!==a||e[5]!==o?(i=a?n.jsx(_s,{asChild:!0,children:s}):n.jsx(Ds,{...o,children:s}),e[3]=s,e[4]=a,e[5]=o,e[6]=i):i=e[6],i},da=t=>{const e=p.c(7);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const a=Ie();let i;return e[3]!==s||e[4]!==a||e[5]!==o?(i=a?n.jsx(ut,{className:O(s),...o}):n.jsx(ut,{className:O(s),...o}),e[3]=s,e[4]=a,e[5]=o,e[6]=i):i=e[6],i};function ma(t){const e=p.c(11),{user:s,trigger:o,align:a,children:i}=t,l=a===void 0?"start":a;let c;e[0]!==o||e[1]!==s?(c=o(s),e[0]=o,e[1]=s,e[2]=c):c=e[2];let r;e[3]!==c?(r=n.jsx(ca,{asChild:!0,children:n.jsx("div",{children:c})}),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==l||e[6]!==i?(d=n.jsx(la,{side:"top",align:l,className:"md:w-[240px]",children:i}),e[5]=l,e[6]=i,e[7]=d):d=e[7];let m;return e[8]!==r||e[9]!==d?(m=n.jsxs(ia,{children:[r,d]}),e[8]=r,e[9]=d,e[10]=m):m=e[10],m}function fa(t){const e=p.c(8),{children:s,onClick:o,className:a,asChild:i}=t;let l;e[0]!==i||e[1]!==s||e[2]!==o?(l=i?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:o,children:s}),e[0]=i,e[1]=s,e[2]=o,e[3]=l):l=e[3];let c;return e[4]!==i||e[5]!==a||e[6]!==l?(c=n.jsx(ra,{asChild:i,className:a,children:l}),e[4]=i,e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function ua(t){const e=p.c(2),{className:s}=t;let o;return e[0]!==s?(o=n.jsx(da,{className:s}),e[0]=s,e[1]=o):o=e[1],o}function ha(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Y=Object.assign(ma,{Item:fa,Separator:ua,Skeleton:ha});function pa(t){const e=p.c(48),{open:s,onOpenChange:o,user:a,userImage:i}=t,[l,c]=Os(),[r,d]=N.useState(!1);let m;e[0]!==a.id?(m=()=>{navigator.clipboard.writeText(a.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=a.id,e[1]=m):m=e[1];const f=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Gs,{className:"text-base",children:"Profile Settings"}),e[2]=h):h=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(Fs,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[h,n.jsxs(Vs,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(_e,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=b):b=e[3];const u=a.name||"U";let g;e[4]!==u||e[5]!==i?(g=n.jsx(Q,{url:i,fallback:u,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=u,e[5]=i,e[6]=g):g=e[6];const x=a.name||"User";let v;e[7]!==x?(v=n.jsx("span",{className:"text-base font-medium text-foreground",children:x}),e[7]=x,e[8]=v):v=e[8];let S;e[9]!==a.email?(S=n.jsx("span",{className:"text-sm text-muted-foreground",children:a.email}),e[9]=a.email,e[10]=S):S=e[10];let C;e[11]!==v||e[12]!==S?(C=n.jsxs("div",{className:"flex flex-col gap-1",children:[v,S]}),e[11]=v,e[12]=S,e[13]=C):C=e[13];let k;e[14]!==g||e[15]!==C?(k=n.jsxs("div",{className:"flex items-center gap-4",children:[g,C]}),e[14]=g,e[15]=C,e[16]=k):k=e[16];let I;e[17]!==l||e[18]!==c?(I=()=>c(!l),e[17]=l,e[18]=c,e[19]=I):I=e[19];let $;e[20]===Symbol.for("react.memo_cache_sentinel")?($=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(Zs,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(Ys,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=$):$=e[20];let z;e[21]!==l||e[22]!==c?(z=n.jsx("div",{onClick:xa,children:n.jsx(qs,{checked:l,onCheckedChange:c})}),e[21]=l,e[22]=c,e[23]=z):z=e[23];let y;e[24]!==I||e[25]!==z?(y=n.jsxs("button",{type:"button",onClick:I,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[$,z]}),e[24]=I,e[25]=z,e[26]=y):y=e[26];let w;e[27]!==k||e[28]!==y?(w=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[k,y]}),e[27]=k,e[28]=y,e[29]=w):w=e[29];let j;e[30]!==a.id?(j=n.jsx("span",{className:"font-mono text-xs",children:a.id}),e[30]=a.id,e[31]=j):j=e[31];let M;e[32]!==r?(M=r?n.jsx(Be,{size:14,className:"text-green-600"}):n.jsx(zt,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=r,e[33]=M):M=e[33];let T;e[34]!==f||e[35]!==j||e[36]!==M?(T=n.jsx(kt,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:f,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[j,M]})}),e[34]=f,e[35]=j,e[36]=M,e[37]=T):T=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Ct,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=A):A=e[38];let R;e[39]!==T?(R=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(_t,{children:n.jsxs(It,{children:[T,A]})})}),e[39]=T,e[40]=R):R=e[40];let D;e[41]!==w||e[42]!==R?(D=n.jsxs(Ws,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[b,n.jsxs("div",{className:"flex flex-col",children:[w,R]})]}),e[41]=w,e[42]=R,e[43]=D):D=e[43];let _;return e[44]!==o||e[45]!==s||e[46]!==D?(_=n.jsx(Ks,{open:s,onOpenChange:o,children:D}),e[44]=o,e[45]=s,e[46]=D,e[47]=_):_=e[47],_}function xa(t){return t.stopPropagation()}function ga(t){const e=p.c(47),{user:s,userImage:o}=t,[a,i]=N.useState(!1),[l,c]=N.useState(!1);let r;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(r=()=>{const _=`ID: ${s.id}
|
|
2
2
|
Name: ${s.name||"N/A"}
|
|
3
3
|
Email: ${s.email}`;navigator.clipboard.writeText(_),c(!0),K.success("User info copied to clipboard"),setTimeout(()=>c(!1),2e3)},e[0]=s.email,e[1]=s.id,e[2]=s.name,e[3]=r):r=e[3];const d=r;let m;e[4]!==s.email||e[5]!==s.name||e[6]!==o?(m=()=>n.jsx(Q,{url:o,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all h-7 w-7"}),e[4]=s.email,e[5]=s.name,e[6]=o,e[7]=m):m=e[7];const f=s.name||s.email||"U";let h;e[8]!==f||e[9]!==o?(h=n.jsx(Q,{url:o,fallback:f,shape:"circle",size:"sm"}),e[8]=f,e[9]=o,e[10]=h):h=e[10];const b=s.name||"User";let u;e[11]!==b?(u=n.jsx("div",{className:"text-sm font-medium truncate",children:b}),e[11]=b,e[12]=u):u=e[12];let g;e[13]!==s.email?(g=n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.email}),e[13]=s.email,e[14]=g):g=e[14];let x;e[15]!==u||e[16]!==g?(x=n.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[u,g]}),e[15]=u,e[16]=g,e[17]=x):x=e[17];let v;e[18]!==l?(v=n.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:l?n.jsx(Be,{size:16,className:"text-green-600"}):n.jsx(zt,{size:16,className:"text-muted-foreground"})}),e[18]=l,e[19]=v):v=e[19];let S;e[20]!==h||e[21]!==x||e[22]!==v?(S=n.jsxs("div",{className:"group flex items-center gap-3 w-full py-1",children:[h,x,v]}),e[20]=h,e[21]=x,e[22]=v,e[23]=S):S=e[23];let C;e[24]!==d||e[25]!==S?(C=n.jsx(Y.Item,{onClick:d,children:S}),e[24]=d,e[25]=S,e[26]=C):C=e[26];let k;e[27]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Y.Separator,{}),e[27]=k):k=e[27];let I,$;e[28]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsxs(Y.Item,{onClick:()=>i(!0),children:[n.jsx(at,{className:"text-muted-foreground",size:18}),"Profile Settings"]}),$=n.jsx(Y.Separator,{}),e[28]=I,e[29]=$):(I=e[28],$=e[29]);let z;e[30]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(cs,{className:"w-4 h-4 text-muted-foreground"}),e[30]=z):z=e[30];let y;e[31]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Y.Item,{asChild:!0,children:n.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[z,"decocms/admin",n.jsx(ht,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[31]=y):y=e[31];let w;e[32]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Rt,{className:"text-muted-foreground",size:18}),e[32]=w):w=e[32];let j,M;e[33]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Y.Item,{asChild:!0,children:n.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[w,"Homepage",n.jsx(ht,{size:18,className:"ml-auto text-muted-foreground"})]})}),M=n.jsx(Y.Separator,{}),e[33]=j,e[34]=M):(j=e[33],M=e[34]);let T;e[35]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsxs(Y.Item,{onClick:ba,children:[n.jsx(Pt,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[35]=T):T=e[35];let A;e[36]!==C||e[37]!==m||e[38]!==s?(A=n.jsxs(Y,{user:s,trigger:m,align:"end",children:[C,k,I,$,y,j,M,T]}),e[36]=C,e[37]=m,e[38]=s,e[39]=A):A=e[39];let R;e[40]!==a||e[41]!==s||e[42]!==o?(R=a&&n.jsx(pa,{open:a,onOpenChange:i,user:s,userImage:o}),e[40]=a,e[41]=s,e[42]=o,e[43]=R):R=e[43];let D;return e[44]!==A||e[45]!==R?(D=n.jsxs(n.Fragment,{children:[A,R]}),e[44]=A,e[45]=R,e[46]=D):D=e[46],D}function ba(){return J.signOut()}function ja(){const t=p.c(7),{data:e}=J.useSession();if(!e?.user){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Q,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=r):r=t[0],r}const s=e.user,o=s.name??void 0;let a;t[1]!==o||t[2]!==s?(a={...s,name:o},t[1]=o,t[2]=s,t[3]=a):a=t[3];const i=a,l=s.image;let c;return t[4]!==l||t[5]!==i?(c=n.jsx(ga,{user:i,userImage:l}),t[4]=l,t[5]=i,t[6]=c):c=t[6],c}function it(){const t=p.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Ge.decoChatOpen(),t[0]=e):e=t[0];const[s,o]=Ue(e,va);let a;return t[1]!==s||t[2]!==o?(a=[s,o],t[1]=s,t[2]=o,t[3]=a):a=t[3],a}function va(t){return!!(t??!1)}function Sa(t){const e=p.c(6),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ds,{children:n.jsx(vt,{})}),e[0]=o):o=e[0];let a;e[1]!==s?(a=n.jsx(ms,{children:s}),e[1]=s,e[2]=a):a=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(fs,{children:n.jsx(us,{to:"/login",replace:!0})}),e[3]=i):i=e[3];let l;return e[4]!==a?(l=n.jsxs(n.Fragment,{children:[o,a,i]}),e[4]=a,e[5]=l):l=e[5],l}function Na(t){const e=p.c(5),{children:s,className:o}=t;let a;e[0]!==o?(a=O("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",o),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==s||e[3]!==a?(i=n.jsx("div",{className:a,children:s}),e[2]=s,e[3]=a,e[4]=i):i=e[4],i}function wa(t){const e=p.c(5),{children:s,className:o}=t;let a;e[0]!==o?(a=O("flex items-center justify-center px-2.5 h-full border-r border-border",o),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==s||e[3]!==a?(i=n.jsx("div",{className:a,children:s}),e[2]=s,e[3]=a,e[4]=i):i=e[4],i}function ya(t){const e=p.c(5),{children:s,className:o}=t;let a;e[0]!==o?(a=O("flex items-center gap-2 px-2 h-full",o),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==s||e[3]!==a?(i=n.jsx("div",{className:a,children:s}),e[2]=s,e[3]=a,e[4]=i):i=e[4],i}function Ca(t){const e=p.c(5),{children:s,className:o}=t;let a;e[0]!==o?(a=O("flex items-center gap-2 px-2 h-full flex-1",o),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==s||e[3]!==a?(i=n.jsx("div",{className:a,children:s}),e[2]=s,e[3]=a,e[4]=i):i=e[4],i}function _a(t){const e=p.c(5),{children:s,className:o}=t;let a;e[0]!==o?(a=O("flex items-center gap-2 px-2 h-full ml-auto",o),e[0]=o,e[1]=a):a=e[1];let i;return e[2]!==s||e[3]!==a?(i=n.jsx("div",{className:a,children:s}),e[2]=s,e[3]=a,e[4]=i):i=e[4],i}function ka(){const t=p.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:n.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,s,n.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=o):o=t[2],o}const De=Object.assign(Na,{Sidebar:wa,Left:ya,Center:Ca,Right:_a,Skeleton:ka});function Jt(){const t=p.c(3),{toggleSidebar:e}=ot();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Lt,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:18}),t[0]=s):s=t[0];let o;return t[1]!==e?(o=n.jsx(n.Fragment,{children:n.jsx(Z,{onClick:e,size:"icon",variant:"ghost",className:"w-7 h-7 rounded-md",children:s})}),t[1]=e,t[2]=o):o=t[2],o}Jt.Skeleton=function(){return n.jsx("div",{className:"w-7 h-7 bg-muted rounded-md animate-pulse"})};function Ia(t,e){return t.find(e)??t[0]}function xt(t,e,s,o){const a=p.c(9),i=null,[l,c]=Ue(t,i);let r;a[0]!==s||a[1]!==l?(r=h=>l!==null?s(h,l):!1,a[0]=s,a[1]=l,a[2]=r):r=a[2];let d;a[3]!==e||a[4]!==r?(d=Ia(e,r),a[3]=e,a[4]=r,a[5]=d):d=a[5];const m=d;let f;return a[6]!==m||a[7]!==c?(f=[m,c],a[6]=m,a[7]=c,a[8]=f):f=a[8],f}const $a="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function za(){const t=p.c(137),{org:e,locator:s}=He(),{slug:o,id:a}=e,[,i]=it(),l=ke(),{data:c}=J.useSession(),r=c?.user,{createThread:d,activeThreadId:m,setActiveThreadId:f,hideThread:h}=ft(),{threads:b,refetch:u}=Ts(),g=As(),x=Rs(),v=Ns();let S;t[0]!==v?(S={connections:v,binding:"LLMS"},t[0]=v,t[1]=S):S=t[1];const[C]=cn(S),k=!!C,I=g.length>0,$=k&&I;let z;t[2]!==s?(z=Ge.chatSelectedModel(s),t[2]=s,t[3]=z):z=t[3];const[y,w]=xt(z,x,Oa),[j,M]=xt(`${s}:selected-gateway`,g,Ma),T=Js(j?.id),A=Xs();let R;t[4]!==d||t[5]!==j?.id?(R=L=>d({id:L.id,title:L.title,gatewayId:j?.id}),t[4]=d,t[5]=j?.id,t[6]=R):R=t[6];let D;t[7]!==m||t[8]!==A||t[9]!==T||t[10]!==R?(D={threadId:m,systemPrompt:T,onToolCall:A,onCreateThread:R},t[7]=m,t[8]=A,t[9]=T,t[10]=R,t[11]=D):D=t[11];const _=Qs(D),{inputValue:W,setInputValue:E,branchContext:B,clearBranch:H}=ft(),{isEmpty:G}=_;let F;t[12]!==B||t[13]!==H||t[14]!==f||t[15]!==E?(F=()=>{B&&(f(B.originalThreadId),H(),E(""))},t[12]=B,t[13]=H,t[14]=f,t[15]=E,t[16]=F):F=t[16];const X=F;let $e;t[17]!==m||t[18]!==_||t[19]!==H||t[20]!==j||t[21]!==y||t[22]!==E||t[23]!==r?.image||t[24]!==r?.name?($e=async L=>{if(!y){K.error("No model configured");return}if(!j?.id){K.error("No Agent configured");return}E(""),H();const q={created_at:new Date().toISOString(),thread_id:m,model:{id:y.id,connectionId:y.connectionId,provider:y.provider??void 0,limits:y.limits??void 0},gateway:{id:j.id},user:{avatar:r?.image??void 0,name:r?.name??"you"}};await _.sendMessage(L,q)},t[17]=m,t[18]=_,t[19]=H,t[20]=j,t[21]=y,t[22]=E,t[23]=r?.image,t[24]=r?.name,t[25]=$e):$e=t[25];const V=$e;let ze;t[26]!==w?(ze=L=>{w(L)},t[26]=w,t[27]=ze):ze=t[27];const Ve=ze;let Me;t[28]!==M?(Me=L=>{M({gatewayId:L})},t[28]=M,t[29]=Me):Me=t[29];const We=Me;if(!$){let L,q;!k&&!I?(L="Connect your providers",q="Connect an LLM provider and create an Agent to unlock AI-powered features."):k?(L="No Agents configured",q="Create an Agent to expose your MCP tools to the chat."):(L="No model provider connected",q="Connect to a model provider to unlock AI-powered features.");let Ee;t[30]===Symbol.for("react.memo_cache_sentinel")?(Ee=n.jsxs(P.Header.Left,{children:[n.jsx("img",{src:$a,alt:"deco chat",className:"size-5 rounded"}),n.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[30]=Ee):Ee=t[30];let we;t[31]!==i?(we=()=>i(!1),t[31]=i,t[32]=we):we=t[32];let Le;t[33]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[33]=Le):Le=t[33];let ye;t[34]!==we?(ye=n.jsxs(P.Header,{children:[Ee,n.jsx(P.Header.Right,{children:n.jsx("button",{type:"button",onClick:we,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Le})})]}),t[34]=we,t[35]=ye):ye=t[35];let Ce;t[36]!==v||t[37]!==q||t[38]!==k||t[39]!==l||t[40]!==a||t[41]!==o||t[42]!==L||t[43]!==r?.id?(Ce=n.jsx(P.Main,{className:"flex flex-col items-center",children:n.jsx(P.EmptyState,{children:k?n.jsx(ws,{title:L,description:q,actions:n.jsx(Z,{variant:"outline",onClick:()=>l({to:"/$org/mcps",params:{org:o},search:{action:"create"}}),children:"Custom Connection"})}):n.jsx(en,{title:L,description:q,orgSlug:o,orgId:a,userId:r?.id??"",allConnections:v,onInstallMcpServer:()=>l({to:"/$org/mcps",params:{org:o},search:{action:"create"}})})})}),t[36]=v,t[37]=q,t[38]=k,t[39]=l,t[40]=a,t[41]=o,t[42]=L,t[43]=r?.id,t[44]=Ce):Ce=t[44];let Pe;return t[45]!==ye||t[46]!==Ce?(Pe=n.jsxs(P,{children:[ye,Ce]}),t[45]=ye,t[46]=Ce,t[47]=Pe):Pe=t[47],Pe}const Ke=j?.icon,Ze=j?.title||"deco chat";let Oe;t[48]===Symbol.for("react.memo_cache_sentinel")?(Oe=n.jsx(tt,{size:12}),t[48]=Oe):Oe=t[48];let ee;t[49]!==Ze||t[50]!==Ke?(ee=n.jsx(mt,{icon:Ke,name:Ze,size:"xs",fallbackIcon:Oe}),t[49]=Ze,t[50]=Ke,t[51]=ee):ee=t[51];const qe=j?.title||"deco chat";let te;t[52]!==qe?(te=n.jsx("span",{className:"text-sm font-medium",children:qe}),t[52]=qe,t[53]=te):te=t[53];let se;t[54]!==ee||t[55]!==te?(se=n.jsxs(P.Header.Left,{children:[ee,te]}),t[54]=ee,t[55]=te,t[56]=se):se=t[56];let ne;t[57]!==d?(ne=()=>d(),t[57]=d,t[58]=ne):ne=t[58];let Te;t[59]===Symbol.for("react.memo_cache_sentinel")?(Te=n.jsx(rn,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[59]=Te):Te=t[59];let ae;t[60]!==ne?(ae=n.jsx("button",{type:"button",onClick:ne,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:Te}),t[60]=ne,t[61]=ae):ae=t[61];let oe;t[62]!==u?(oe=()=>u(),t[62]=u,t[63]=oe):oe=t[63];let ie;t[64]!==m||t[65]!==h||t[66]!==f||t[67]!==oe||t[68]!==b?(ie=n.jsx(sn,{threads:b,activeThreadId:m,onSelectThread:f,onRemoveThread:h,onOpen:oe}),t[64]=m,t[65]=h,t[66]=f,t[67]=oe,t[68]=b,t[69]=ie):ie=t[69];let le;t[70]!==i?(le=()=>i(!1),t[70]=i,t[71]=le):le=t[71];let Ae;t[72]===Symbol.for("react.memo_cache_sentinel")?(Ae=n.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[72]=Ae):Ae=t[72];let re;t[73]!==le?(re=n.jsx("button",{type:"button",onClick:le,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Ae}),t[73]=le,t[74]=re):re=t[74];let ce;t[75]!==ae||t[76]!==ie||t[77]!==re?(ce=n.jsxs(P.Header.Right,{children:[ae,ie,re]}),t[75]=ae,t[76]=ie,t[77]=re,t[78]=ce):ce=t[78];let de;t[79]!==se||t[80]!==ce?(de=n.jsxs(P.Header,{children:[se,ce]}),t[79]=se,t[80]=ce,t[81]=de):de=t[81];let me;t[82]!==_.messages||t[83]!==_.status||t[84]!==V||t[85]!==G||t[86]!==j?(me=n.jsx(P.Main,{children:G?n.jsx(P.EmptyState,{children:n.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[n.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[n.jsx(mt,{icon:j?.icon,name:j?.title||"deco chat",size:"lg",fallbackIcon:n.jsx(tt,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:j?.title||"Ask deco chat"}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:j?.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),j?.id&&n.jsx(nt,{fallback:null,children:n.jsx(N.Suspense,{fallback:n.jsx("div",{className:"flex justify-center",children:n.jsx(ln,{size:20,className:"animate-spin text-muted-foreground"})}),children:n.jsx(tn,{gatewayId:j.id,onSelect:L=>{V(L.description??L.name)}})})},j.id)]})}):n.jsx(P.Messages,{messages:_.messages,status:_.status,minHeightOffset:240})}),t[82]=_.messages,t[83]=_.status,t[84]=V,t[85]=G,t[86]=j,t[87]=me):me=t[87];let fe;t[88]!==_.error||t[89]!==V?(fe=()=>{_.error&&V(`I encountered this error: ${_.error.message}. Can you help me fix it?`)},t[88]=_.error,t[89]=V,t[90]=fe):fe=t[90];let ue;t[91]!==_.clearError||t[92]!==_.error||t[93]!==fe?(ue=n.jsx(P.ErrorBanner,{error:_.error,onFixInChat:fe,onDismiss:_.clearError}),t[91]=_.clearError,t[92]=_.error,t[93]=fe,t[94]=ue):ue=t[94];let he;t[95]!==V?(he=()=>{V("Please continue.")},t[95]=V,t[96]=he):he=t[96];let pe;t[97]!==_.clearFinishReason||t[98]!==_.finishReason||t[99]!==he?(pe=n.jsx(P.FinishReasonWarning,{finishReason:_.finishReason,onContinue:he,onDismiss:_.clearFinishReason}),t[97]=_.clearFinishReason,t[98]=_.finishReason,t[99]=he,t[100]=pe):pe=t[100];let xe;t[101]!==B||t[102]!==H||t[103]!==X||t[104]!==E?(xe=n.jsx(P.BranchPreview,{branchContext:B,clearBranchContext:H,onGoToOriginalMessage:X,setInputValue:E}),t[101]=B,t[102]=H,t[103]=X,t[104]=E,t[105]=xe):xe=t[105];let ge;t[106]!==V||t[107]!==W?(ge=async()=>{W.trim()&&await V(W.trim())},t[106]=V,t[107]=W,t[108]=ge):ge=t[108];const Ye=!y||!j?.id,Je=_.status==="submitted"||_.status==="streaming",Xe=y?"Ask anything or @ for context":"Select a model to start chatting",Qe=j?.id;let be;t[109]!==We||t[110]!==Qe?(be=n.jsx(Ls,{selectedGatewayId:Qe,onGatewayChange:We,placeholder:"Agent",variant:"borderless"}),t[109]=We,t[110]=Qe,t[111]=be):be=t[111];const et=y??void 0;let je;t[112]!==Ve||t[113]!==et?(je=n.jsx(Ps,{selectedModel:et,onModelChange:Ve,placeholder:"Model",variant:"borderless"}),t[112]=Ve,t[113]=et,t[114]=je):je=t[114];let ve;t[115]!==_.messages?(ve=n.jsx(Es,{messages:_.messages}),t[115]=_.messages,t[116]=ve):ve=t[116];let Se;t[117]!==_.stop||t[118]!==W||t[119]!==E||t[120]!==ge||t[121]!==Ye||t[122]!==Je||t[123]!==Xe||t[124]!==be||t[125]!==je||t[126]!==ve?(Se=n.jsxs(P.Input,{value:W,onChange:E,onSubmit:ge,onStop:_.stop,disabled:Ye,isStreaming:Je,placeholder:Xe,children:[be,je,ve]}),t[117]=_.stop,t[118]=W,t[119]=E,t[120]=ge,t[121]=Ye,t[122]=Je,t[123]=Xe,t[124]=be,t[125]=je,t[126]=ve,t[127]=Se):Se=t[127];let Ne;t[128]!==ue||t[129]!==pe||t[130]!==xe||t[131]!==Se?(Ne=n.jsx(P.Footer,{children:n.jsxs("div",{className:"flex flex-col gap-2",children:[ue,pe,xe,Se]})}),t[128]=ue,t[129]=pe,t[130]=xe,t[131]=Se,t[132]=Ne):Ne=t[132];let Re;return t[133]!==de||t[134]!==me||t[135]!==Ne?(Re=n.jsxs(P,{children:[de,me,Ne]}),t[133]=de,t[134]=me,t[135]=Ne,t[136]=Re):Re=t[136],Re}function Ma(t,e){return t.id===e.gatewayId}function Oa(t,e){return t.id===e.id&&t.connectionId===e.connectionId}function Ta(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(P.Provider,{children:n.jsx(za,{})}),t[0]=e):e=t[0],e}const Aa="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function gt({showSidebarToggle:t=!1,showOrgSwitcher:e=!1,showDecoChat:s=!1,disableDecoChat:o=!1}){const[a,i]=it(),l=N.useRef(o);o&&a&&l.current!==o&&i(!1),l.current=o;const c=()=>{o||i(r=>!r)};return n.jsxs(De,{children:[t&&n.jsx(De.Sidebar,{children:n.jsx(Jt,{})}),n.jsx(De.Left,{children:e&&n.jsx(N.Suspense,{fallback:n.jsx(st.Skeleton,{}),children:n.jsx(st,{})})}),n.jsxs(De.Right,{className:"gap-2",children:[n.jsx(mn,{}),s&&!o&&n.jsxs(Z,{size:"sm",variant:"default",onClick:c,className:"h-7",children:[n.jsx(Q,{url:Aa,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),n.jsx(ja,{})]})]})}function Ra(t){const e=p.c(10),{children:s,className:o}=t,[,a]=N.useTransition();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Ge.decoChatPanelWidth(),e[0]=i):i=e[0];const[l,c]=Ue(i,30);let r;e[1]!==c?(r=h=>a(()=>c(h)),e[1]=c,e[2]=r):r=e[2];const d=r;let m;e[3]!==o?(m=O("min-w-0",o),e[3]=o,e[4]=m):m=e[4];let f;return e[5]!==l||e[6]!==s||e[7]!==d||e[8]!==m?(f=n.jsx(Mt,{defaultSize:l,minSize:20,className:m,onResize:d,children:s}),e[5]=l,e[6]=s,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function Ea(t){const e=p.c(5),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Ge.sidebarOpen(),e[0]=o):o=e[0];const[a,i]=Ue(o,!0);let l;return e[1]!==s||e[2]!==i||e[3]!==a?(l=n.jsx(Cn,{open:a,onOpenChange:i,children:s}),e[1]=s,e[2]=i,e[3]=a,e[4]=l):l=e[4],l}function La(t){const e=p.c(10),{disableChat:s}=t,o=s===void 0?!1:s,[a]=it(),i=a&&!o;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Mt,{className:"bg-background",children:n.jsx(St,{})}),e[0]=l):l=e[0];let c;e[1]!==o||e[2]!==i?(c=!o&&n.jsx(an,{withHandle:i}),e[1]=o,e[2]=i,e[3]=c):c=e[3];const r=i?"max-w-none":"max-w-0";let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(nt,{children:n.jsx(N.Suspense,{fallback:n.jsx(nn,{}),children:n.jsx(Ta,{})})}),e[4]=d):d=e[4];let m;e[5]!==r?(m=n.jsx(Ra,{className:r,children:d}),e[5]=r,e[6]=m):m=e[6];let f;return e[7]!==c||e[8]!==m?(f=n.jsxs(on,{direction:"horizontal",children:[l,c,m]}),e[7]=c,e[8]=m,e[9]=f):f=e[9],f}function Pa(){const t=p.c(22);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=jt(e),o=bt(),a=o.location.pathname===`/${s}`||o.location.pathname===`/${s}/`;let i;t[1]!==s?(i=ps.activeOrganization(s),t[1]=s,t[2]=i):i=t[2];let l;t[3]!==s?(l=async()=>{if(!s)return null;const{data:g}=await J.organization.setActive({organizationSlug:s});return{org:g,project:{slug:js}}},t[3]=s,t[4]=l):l=t[4];let c;t[5]!==i||t[6]!==l?(c={queryKey:i,queryFn:l,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=i,t[6]=l,t[7]=c):c=t[7];const{data:r}=hs(c);if(!r){let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(gt,{}),t[8]=g):g=t[8];let x;return t[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs("div",{className:"min-h-screen bg-background",children:[g,n.jsx("div",{className:"pt-12",children:n.jsx(St,{})})]}),t[9]=x):x=t[9],x}let d;t[10]!==a?(d=n.jsx(gt,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0,disableDecoChat:a}),t[10]=a,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[12]=m):m=t[12];let f;t[13]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Gn,{}),t[13]=f):f=t[13];let h;t[14]!==a?(h=n.jsxs(In,{className:"flex-1 bg-sidebar",style:m,children:[f,n.jsx(zn,{className:"pt-12",children:n.jsx(La,{disableChat:a})})]}),t[14]=a,t[15]=h):h=t[15];let b;t[16]!==d||t[17]!==h?(b=n.jsx(Ea,{children:n.jsxs("div",{className:"flex flex-col h-screen",children:[d,h]})}),t[16]=d,t[17]=h,t[18]=b):b=t[18];let u;return t[19]!==r||t[20]!==b?(u=n.jsx(bs,{...r,children:b}),t[19]=r,t[20]=b,t[21]=u):u=t[21],u}function Ro(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Sa,{children:n.jsx(N.Suspense,{fallback:n.jsx(vt,{}),children:n.jsx(Pa,{})})}),t[0]=e):e=t[0],e}export{Ro as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C,h as d,j as a}from"./index-
|
|
1
|
+
import{c as C,h as d,j as a}from"./index-D825aBGT.js";import{c as m}from"./input-CUSLU-5Y.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function p(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{p as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,ac as B,j as i,ad as C,aa as y,ai as I,af as M,aT as H,aS as z,c as A}from"./index-
|
|
1
|
+
import{r as c,ac as B,j as i,ad as C,aa as y,ai as I,af as M,aT as H,aS as z,c as A}from"./index-D825aBGT.js";import{c as g}from"./input-CUSLU-5Y.js";var b="Switch",[U]=B(b),[q,L]=U(b),E=c.forwardRef((s,e)=>{const{__scopeSwitch:t,name:r,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=s,[p,h]=c.useState(null),v=y(e,m=>h(m)),S=c.useRef(!1),x=p?l||!!p.closest("form"):!0,[f,N]=I({prop:a,defaultProp:n??!1,onChange:k,caller:b});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:M(s.onClick,m=>{N(T=>!T),x&&(S.current=m.isPropagationStopped(),S.current||m.stopPropagation())})}),x&&i.jsx(_,{control:p,bubbles:!S.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=c.forwardRef((s,e)=>{const{__scopeSwitch:t,...r}=s,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:s,control:e,checked:t,bubbles:r=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=H(t),k=z(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(s){return s?"checked":"unchecked"}var $=E,D=R;function X(s){const e=A.c(9);let t,r;e[0]!==s?({className:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...r,children:n}),e[6]=r,e[7]=a,e[8]=o):o=e[8],o}export{X as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,j as n}from"./index-
|
|
1
|
+
import{c as o,j as n}from"./index-D825aBGT.js";import{c as l}from"./input-CUSLU-5Y.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
|
package/dist/client/assets/{thread-history-popover-BNoPu7hE.js → thread-history-popover-d49eUsmE.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{c as G,j as m,s as sa,d as ra,K as _t,t as Ze,E as na,F as oa,H as $,w as f,_ as Re,I as wt,J as ia,L as la,M as ca,Q as Z,U as be,V as Ee,v as M,W as x,X,Y as ua,Z as O,$ as da,a0 as pa,r as J,k as ma,p as ha,f as fa}from"./index-Cqq-bHxo.js";import{c as fe,B as Me}from"./input-DJ7wqUvo.js";import{u as Et,c as qe,b as Je,T as We,a as It}from"./project-context-provider-Gi9sytDH.js";import{E as ga}from"./use-binding-iszUdbOZ.js";import{l as va,m as ya,n as ba,o as xa}from"./index-B01CV87W.js";import{u as _a}from"./use-gateway-CSxRa3Bg.js";import{u as wa}from"./use-gateway-system-prompt-BqldEOSK.js";import{P as St,a as Nt,b as Tt}from"./popover-mdWNDupQ.js";import{a as Ea,E as Ia}from"./use-connection-Dp5C8sLQ.js";import{O as Sa,a as Na,g as Ta}from"./well-known-mcp-D13f-8h2.js";import{g as Aa}from"./generate-id-Dyweu44Y.js";import{s as Xe}from"./Clock-BynE89Zl.js";import{i as Ca}from"./SearchMd-C8MbVAuA.js";import{s as Ra}from"./Trash01-DqQrX192.js";function zr(){const t=G.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=a):a=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[a,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Te,{align:"right",width:"w-3/4"}),m.jsx(Te,{align:"left",width:"w-full",lines:3}),m.jsx(Te,{align:"right",width:"w-2/3"}),m.jsx(Te,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=r):r=t[3];let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=n):n=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=i):i=t[5];let o;return t[6]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[s,r,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[n,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[i,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=o):o=t[6],o}function Te(t){const e=G.c(22),{align:a,width:s,lines:r}=t,n=s===void 0?"w-full":s,i=r===void 0?1:r,o=a==="right"?"flex-row-reverse":"flex-row";let c;e[0]!==o?(c=fe("flex w-full gap-4 px-4 py-2",o),e[0]=o,e[1]=c):c=e[1];const l=a==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let p;e[2]!==l?(p=fe("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=p):p=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=d):d=e[4];const g=a==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==g||e[6]!==n?(h=fe("min-w-0 rounded-2xl p-4",g,n),e[5]=g,e[6]=n,e[7]=h):h=e[7];let v;e[8]!==i?(v=Array.from({length:i}),e[8]=i,e[9]=v):v=e[9];let b;e[10]!==i||e[11]!==v?(b=m.jsx("div",{className:"space-y-2",children:v.map((u,T)=>m.jsx("div",{className:fe("h-3 rounded bg-muted-foreground/20 animate-pulse",T===i-1?"w-3/4":"w-full"),style:{animationDelay:`${T*.1}s`}},T))}),e[10]=i,e[11]=v,e[12]=b):b=e[12];let y;e[13]!==b||e[14]!==h?(y=m.jsx("div",{className:h,children:b}),e[13]=b,e[14]=h,e[15]=y):y=e[15];let _;e[16]!==y||e[17]!==p?(_=m.jsxs("div",{className:p,children:[d,y]}),e[16]=y,e[17]=p,e[18]=_):_=e[18];let N;return e[19]!==_||e[20]!==c?(N=m.jsx("div",{className:c,children:_}),e[19]=_,e[20]=c,e[21]=N):N=e[21],N}var xe;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const n={};for(const i of r)n[i]=i;return n},t.getValidEnumValues=r=>{const n=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of n)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const n=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(i);return n},t.find=(r,n)=>{for(const i of r)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(xe||(xe={}));var Ke;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ke||(Ke={}));xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Oe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},s={_errors:[]},r=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let o=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(a(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof Oe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,xe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];a[n]=a[n]||[],a[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}Oe.create=t=>new Oe(t);var et;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(et||(et={}));var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));function Vr(){const t=G.c(5),e=sa(),{org:a}=Et();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const r=ra(s);let n;return t[1]!==a||t[2]!==r||t[3]!==e?(n=i=>{const c=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!c||!c[1])return;const l=c[1],p=r.connectionId;if(!p)return;e.invalidateQueries({queryKey:_t.collection(a.slug,p,l)});const d=l.toLowerCase().replace(/_/g," ");Ze.success(`${d} updated`)},t[1]=a,t[2]=r,t[3]=e,t[4]=n):n=t[4],n}var At="vercel.ai.error",Ma=Symbol.for(At),tt,at,ae=class Ct extends(at=Error,tt=Ma,at){constructor({name:e,message:a,cause:s}){super(a),this[tt]=!0,this.name=e,this.cause=s}static isInstance(e){return Ct.hasMarker(e,At)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function Rt(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Mt="AI_InvalidArgumentError",Ot=`vercel.ai.error.${Mt}`,Oa=Symbol.for(Ot),st,rt,ja=class extends(rt=ae,st=Oa,rt){constructor({message:t,cause:e,argument:a}){super({name:Mt,message:t,cause:e}),this[st]=!0,this.argument=a}static isInstance(t){return ae.hasMarker(t,Ot)}},jt="AI_JSONParseError",Pt=`vercel.ai.error.${jt}`,Pa=Symbol.for(Pt),nt,ot,it=class extends(ot=ae,nt=Pa,ot){constructor({text:t,cause:e}){super({name:jt,message:`JSON parsing failed: Text: ${t}.
|
|
1
|
+
import{c as G,j as m,s as sa,d as ra,K as _t,t as Ze,E as na,F as oa,H as $,w as f,_ as Re,I as wt,J as ia,L as la,M as ca,Q as Z,U as be,V as Ee,v as M,W as x,X,Y as ua,Z as O,$ as da,a0 as pa,r as J,k as ma,p as ha,f as fa}from"./index-D825aBGT.js";import{c as fe,B as Me}from"./input-CUSLU-5Y.js";import{u as Et,c as qe,b as Je,T as We,a as It}from"./project-context-provider-Y7j1MLG3.js";import{E as ga}from"./use-binding-pQGzNysE.js";import{l as va,m as ya,n as ba,o as xa}from"./index-DfsK7wxC.js";import{u as _a}from"./use-gateway-Cov2sDNb.js";import{u as wa}from"./use-gateway-system-prompt-D3bv_TPR.js";import{P as St,a as Nt,b as Tt}from"./popover-CiuXmEMm.js";import{a as Ea,E as Ia}from"./use-connection-CJ5nWy0c.js";import{O as Sa,a as Na,g as Ta}from"./well-known-mcp-D13f-8h2.js";import{g as Aa}from"./generate-id-Dyweu44Y.js";import{s as Xe}from"./Clock-7YlOAEqw.js";import{i as Ca}from"./SearchMd-u2U3iAnY.js";import{s as Ra}from"./Trash01-Vutqn1RC.js";function zr(){const t=G.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=a):a=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[a,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Te,{align:"right",width:"w-3/4"}),m.jsx(Te,{align:"left",width:"w-full",lines:3}),m.jsx(Te,{align:"right",width:"w-2/3"}),m.jsx(Te,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=r):r=t[3];let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=n):n=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=i):i=t[5];let o;return t[6]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[s,r,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[n,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[i,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=o):o=t[6],o}function Te(t){const e=G.c(22),{align:a,width:s,lines:r}=t,n=s===void 0?"w-full":s,i=r===void 0?1:r,o=a==="right"?"flex-row-reverse":"flex-row";let c;e[0]!==o?(c=fe("flex w-full gap-4 px-4 py-2",o),e[0]=o,e[1]=c):c=e[1];const l=a==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let p;e[2]!==l?(p=fe("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=p):p=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=d):d=e[4];const g=a==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==g||e[6]!==n?(h=fe("min-w-0 rounded-2xl p-4",g,n),e[5]=g,e[6]=n,e[7]=h):h=e[7];let v;e[8]!==i?(v=Array.from({length:i}),e[8]=i,e[9]=v):v=e[9];let b;e[10]!==i||e[11]!==v?(b=m.jsx("div",{className:"space-y-2",children:v.map((u,T)=>m.jsx("div",{className:fe("h-3 rounded bg-muted-foreground/20 animate-pulse",T===i-1?"w-3/4":"w-full"),style:{animationDelay:`${T*.1}s`}},T))}),e[10]=i,e[11]=v,e[12]=b):b=e[12];let y;e[13]!==b||e[14]!==h?(y=m.jsx("div",{className:h,children:b}),e[13]=b,e[14]=h,e[15]=y):y=e[15];let _;e[16]!==y||e[17]!==p?(_=m.jsxs("div",{className:p,children:[d,y]}),e[16]=y,e[17]=p,e[18]=_):_=e[18];let N;return e[19]!==_||e[20]!==c?(N=m.jsx("div",{className:c,children:_}),e[19]=_,e[20]=c,e[21]=N):N=e[21],N}var xe;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const n={};for(const i of r)n[i]=i;return n},t.getValidEnumValues=r=>{const n=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of n)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const n=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(i);return n},t.find=(r,n)=>{for(const i of r)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,n=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(xe||(xe={}));var Ke;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ke||(Ke={}));xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Oe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},s={_errors:[]},r=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let o=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(a(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof Oe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,xe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];a[n]=a[n]||[],a[n].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}Oe.create=t=>new Oe(t);var et;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(et||(et={}));var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));function Vr(){const t=G.c(5),e=sa(),{org:a}=Et();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const r=ra(s);let n;return t[1]!==a||t[2]!==r||t[3]!==e?(n=i=>{const c=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!c||!c[1])return;const l=c[1],p=r.connectionId;if(!p)return;e.invalidateQueries({queryKey:_t.collection(a.slug,p,l)});const d=l.toLowerCase().replace(/_/g," ");Ze.success(`${d} updated`)},t[1]=a,t[2]=r,t[3]=e,t[4]=n):n=t[4],n}var At="vercel.ai.error",Ma=Symbol.for(At),tt,at,ae=class Ct extends(at=Error,tt=Ma,at){constructor({name:e,message:a,cause:s}){super(a),this[tt]=!0,this.name=e,this.cause=s}static isInstance(e){return Ct.hasMarker(e,At)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function Rt(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Mt="AI_InvalidArgumentError",Ot=`vercel.ai.error.${Mt}`,Oa=Symbol.for(Ot),st,rt,ja=class extends(rt=ae,st=Oa,rt){constructor({message:t,cause:e,argument:a}){super({name:Mt,message:t,cause:e}),this[st]=!0,this.argument=a}static isInstance(t){return ae.hasMarker(t,Ot)}},jt="AI_JSONParseError",Pt=`vercel.ai.error.${jt}`,Pa=Symbol.for(Pt),nt,ot,it=class extends(ot=ae,nt=Pa,ot){constructor({text:t,cause:e}){super({name:jt,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${Rt(e)}`,cause:e}),this[nt]=!0,this.text=t}static isInstance(t){return ae.hasMarker(t,Pt)}},Dt="AI_TypeValidationError",kt=`vercel.ai.error.${Dt}`,Da=Symbol.for(kt),lt,ct,me=class $e extends(ct=ae,lt=Da,ct){constructor({value:e,cause:a}){super({name:Dt,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${Rt(a)}`,cause:a}),this[lt]=!0,this.value=e}static isInstance(e){return ae.hasMarker(e,kt)}static wrap({value:e,cause:a}){return $e.isInstance(a)&&a.value===e?a:new $e({value:e,cause:a})}},Ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:s="-"}={})=>{const r=()=>{const n=a.length,i=new Array(e);for(let o=0;o<e;o++)i[o]=a[Math.random()*n|0];return i.join("")};if(t==null)return r;if(a.includes(s))throw new ja({argument:"separator",message:`The separator "${s}" must not be part of the alphabet "${a}".`});return()=>`${t}${s}${r()}`},ka=Ie();function ut(t=globalThis){var e,a,s;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(s=(a=t.process)==null?void 0:a.versions)!=null&&s.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function ne(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((a,s)=>{e[s.toLowerCase()]=a});else{Array.isArray(t)||(t=Object.entries(t));for(const[a,s]of t)s!=null&&(e[a.toLowerCase()]=s)}return e}function dt(t,...e){const a=new Headers(ne(t)),s=a.get("user-agent")||"";return a.set("user-agent",[s,...e].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var Za=/"__proto__"\s*:/,$a=/"constructor"\s*:/;function pt(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Za.test(t)===!1&&$a.test(t)===!1?e:La(e)}function La(t){let e=[t];for(;e.length;){const a=e;e=[];for(const s of a){if(Object.prototype.hasOwnProperty.call(s,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const r in s){const n=s[r];n&&typeof n=="object"&&e.push(n)}}}return t}function Ua(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return pt(t)}try{return pt(t)}finally{Error.stackTraceLimit=e}}function Ye(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const s of Object.keys(a))a[s]=re(a[s])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(re):re(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(re)),t.allOf!=null&&(t.allOf=t.allOf.map(re)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(re));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=re(e[a]);return t}function re(t){return typeof t=="boolean"?t:Ye(t)}var Fa=Symbol("Let zodToJsonSchema decide on which parser to use"),mt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Ba=t=>typeof t=="string"?{...mt,name:t}:{...mt,...t};function F(){return{}}function za(t,e){var a,s,r;const n={type:"array"};return(a=t.type)!=null&&a._def&&((r=(s=t.type)==null?void 0:s._def)==null?void 0:r.typeName)!==w.ZodAny&&(n.items=R(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(n.minItems=t.minLength.value),t.maxLength&&(n.maxItems=t.maxLength.value),t.exactLength&&(n.minItems=t.exactLength.value,n.maxItems=t.exactLength.value),n}function Va(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function qa(){return{type:"boolean"}}function Zt(t,e){return R(t.type._def,e)}var Ja=(t,e)=>R(t.innerType._def,e);function $t(t,e,a){const s=a??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,n)=>$t(t,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Wa(t)}}var Wa=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Ya(t,e){return{...R(t.innerType._def,e),default:t.defaultValue()}}function Ga(t,e){return e.effectStrategy==="input"?R(t.schema._def,e):F()}function Ha(t){return{type:"string",enum:Array.from(t.values)}}var Qa=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Xa(t,e){const a=[R(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),R(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(r=>!!r),s=[];return a.forEach(r=>{if(Qa(r))s.push(...r.allOf);else{let n=r;if("additionalProperties"in r&&r.additionalProperties===!1){const{additionalProperties:i,...o}=r;n=o}s.push(n)}}),s.length?{allOf:s}:void 0}function Ka(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var Pe=void 0,V={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Pe===void 0&&(Pe=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Pe),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Lt(t,e){const a={type:"string"};if(t.checks)for(const s of t.checks)switch(s.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"email":switch(e.emailStrategy){case"format:email":q(a,"email",s.message,e);break;case"format:idn-email":q(a,"idn-email",s.message,e);break;case"pattern:zod":k(a,V.email,s.message,e);break}break;case"url":q(a,"uri",s.message,e);break;case"uuid":q(a,"uuid",s.message,e);break;case"regex":k(a,s.regex,s.message,e);break;case"cuid":k(a,V.cuid,s.message,e);break;case"cuid2":k(a,V.cuid2,s.message,e);break;case"startsWith":k(a,RegExp(`^${De(s.value,e)}`),s.message,e);break;case"endsWith":k(a,RegExp(`${De(s.value,e)}$`),s.message,e);break;case"datetime":q(a,"date-time",s.message,e);break;case"date":q(a,"date",s.message,e);break;case"time":q(a,"time",s.message,e);break;case"duration":q(a,"duration",s.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"includes":{k(a,RegExp(De(s.value,e)),s.message,e);break}case"ip":{s.version!=="v6"&&q(a,"ipv4",s.message,e),s.version!=="v4"&&q(a,"ipv6",s.message,e);break}case"base64url":k(a,V.base64url,s.message,e);break;case"jwt":k(a,V.jwt,s.message,e);break;case"cidr":{s.version!=="v6"&&k(a,V.ipv4Cidr,s.message,e),s.version!=="v4"&&k(a,V.ipv6Cidr,s.message,e);break}case"emoji":k(a,V.emoji(),s.message,e);break;case"ulid":{k(a,V.ulid,s.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{q(a,"binary",s.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{k(a,V.base64,s.message,e);break}}break}case"nanoid":k(a,V.nanoid,s.message,e)}return a}function De(t,e){return e.patternStrategy==="escape"?ts(t):t}var es=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ts(t){let e="";for(let a=0;a<t.length;a++)es.has(t[a])||(e+="\\"),e+=t[a];return e}function q(t,e,a,s){var r;t.format||(r=t.anyOf)!=null&&r.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&s.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function k(t,e,a,s){var r;t.pattern||(r=t.allOf)!=null&&r.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:ht(e,s),...a&&s.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=ht(e,s)}function ht(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const s={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},r=s.i?t.source.toLowerCase():t.source;let n="",i=!1,o=!1,c=!1;for(let l=0;l<r.length;l++){if(i){n+=r[l],i=!1;continue}if(s.i){if(o){if(r[l].match(/[a-z]/)){c?(n+=r[l],n+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&((a=r[l+2])!=null&&a.match(/[a-z]/))?(n+=r[l],c=!0):n+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){n+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(s.m){if(r[l]==="^"){n+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(r[l]==="$"){n+=`($|(?=[\r
|
|
5
5
|
]))`;continue}}if(s.s&&r[l]==="."){n+=o?`${r[l]}\r
|
|
6
6
|
`:`[${r[l]}\r
|
|
7
|
-
]`;continue}n+=r[l],r[l]==="\\"?i=!0:o&&r[l]==="]"?o=!1:!o&&r[l]==="["&&(o=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}function Ut(t,e){var a,s,r,n,i,o;const c={type:"object",additionalProperties:(a=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?a:e.allowedAdditionalProperties};if(((s=t.keyType)==null?void 0:s._def.typeName)===w.ZodString&&((r=t.keyType._def.checks)!=null&&r.length)){const{type:l,...p}=Lt(t.keyType._def,e);return{...c,propertyNames:p}}else{if(((n=t.keyType)==null?void 0:n._def.typeName)===w.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(((i=t.keyType)==null?void 0:i._def.typeName)===w.ZodBranded&&t.keyType._def.type._def.typeName===w.ZodString&&((o=t.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...p}=Zt(t.keyType._def,e);return{...c,propertyNames:p}}}return c}function as(t,e){if(e.mapStrategy==="record")return Ut(t,e);const a=R(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||F(),s=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||F();return{type:"array",maxItems:125,items:{type:"array",items:[a,s],minItems:2,maxItems:2}}}function ss(t){const e=t.values,s=Object.keys(t.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),r=Array.from(new Set(s.map(n=>typeof n)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function rs(){return{not:F()}}function ns(){return{type:"null"}}var Le={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function os(t,e){const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(s=>s._def.typeName in Le&&(!s._def.checks||!s._def.checks.length))){const s=a.reduce((r,n)=>{const i=Le[n._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:s.length>1?s:s[0]}}else if(a.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){const s=a.reduce((r,n)=>{const i=typeof n._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(n._def.value===null)return[...r,"null"];default:return r}},[]);if(s.length===a.length){const r=s.filter((n,i,o)=>o.indexOf(n)===i);return{type:r.length>1?r:r[0],enum:a.reduce((n,i)=>n.includes(i._def.value)?n:[...n,i._def.value],[])}}}else if(a.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((s,r)=>[...s,...r._def.values.filter(n=>!s.includes(n))],[])};return is(t,e)}var is=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((s,r)=>R(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return a.length?{anyOf:a}:void 0};function ls(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Le[t.innerType._def.typeName],"null"]};const a=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function cs(t){const e={type:"number"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"int":e.type="integer";break;case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function us(t,e){const a={type:"object",properties:{}},s=[],r=t.shape();for(const i in r){let o=r[i];if(o===void 0||o._def===void 0)continue;const c=ps(o),l=R(o._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(a.properties[i]=l,c||s.push(i))}s.length&&(a.required=s);const n=ds(t,e);return n!==void 0&&(a.additionalProperties=n),a}function ds(t,e){if(t.catchall._def.typeName!=="ZodNever")return R(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function ps(t){try{return t.isOptional()}catch{return!0}}var ms=(t,e)=>{var a;if(e.currentPath.toString()===((a=e.propertyPath)==null?void 0:a.toString()))return R(t.innerType._def,e);const s=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return s?{anyOf:[{not:F()},s]}:F()},hs=(t,e)=>{if(e.pipeStrategy==="input")return R(t.in._def,e);if(e.pipeStrategy==="output")return R(t.out._def,e);const a=R(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=R(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,s].filter(r=>r!==void 0)}};function fs(t,e){return R(t.type._def,e)}function gs(t,e){const s={type:"array",uniqueItems:!0,items:R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(s.minItems=t.minSize.value),t.maxSize&&(s.maxItems=t.maxSize.value),s}function vs(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[]),additionalItems:R(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[])}}function ys(){return{not:F()}}function bs(){return F()}var xs=(t,e)=>R(t.innerType._def,e),_s=(t,e,a)=>{switch(e){case w.ZodString:return Lt(t,a);case w.ZodNumber:return cs(t);case w.ZodObject:return us(t,a);case w.ZodBigInt:return Va(t);case w.ZodBoolean:return qa();case w.ZodDate:return $t(t,a);case w.ZodUndefined:return ys();case w.ZodNull:return ns();case w.ZodArray:return za(t,a);case w.ZodUnion:case w.ZodDiscriminatedUnion:return os(t,a);case w.ZodIntersection:return Xa(t,a);case w.ZodTuple:return vs(t,a);case w.ZodRecord:return Ut(t,a);case w.ZodLiteral:return Ka(t);case w.ZodEnum:return Ha(t);case w.ZodNativeEnum:return ss(t);case w.ZodNullable:return ls(t,a);case w.ZodOptional:return ms(t,a);case w.ZodMap:return as(t,a);case w.ZodSet:return gs(t,a);case w.ZodLazy:return()=>t.getter()._def;case w.ZodPromise:return fs(t,a);case w.ZodNaN:case w.ZodNever:return rs();case w.ZodEffects:return Ga(t,a);case w.ZodAny:return F();case w.ZodUnknown:return bs();case w.ZodDefault:return Ya(t,a);case w.ZodBranded:return Zt(t,a);case w.ZodReadonly:return xs(t,a);case w.ZodCatch:return Ja(t,a);case w.ZodPipeline:return hs(t,a);case w.ZodFunction:case w.ZodVoid:case w.ZodSymbol:return;default:return(s=>{})()}},ws=(t,e)=>{let a=0;for(;a<t.length&&a<e.length&&t[a]===e[a];a++);return[(t.length-a).toString(),...e.slice(a)].join("/")};function R(t,e,a=!1){var s;const r=e.seen.get(t);if(e.override){const c=(s=e.override)==null?void 0:s.call(e,t,e,r,a);if(c!==Fa)return c}if(r&&!a){const c=Es(r,e);if(c!==void 0)return c}const n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);const i=_s(t,t.typeName,e),o=typeof i=="function"?R(i(),e):i;if(o&&Is(t,e,o),e.postProcess){const c=e.postProcess(o,t,e);return n.jsonSchema=o,c}return n.jsonSchema=o,o}var Es=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:ws(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((a,s)=>e.currentPath[s]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),F()):e.$refStrategy==="seen"?F():void 0}},Is=(t,e,a)=>(t.description&&(a.description=t.description),a),Ss=t=>{const e=Ba(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}},Ns=(t,e)=>{var a;const s=Ss(e);let r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[p,d])=>{var g;return{...l,[p]:(g=R(d._def,{...s,currentPath:[...s.basePath,s.definitionPath,p]},!0))!=null?g:F()}},{}):void 0;const n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=(a=R(t._def,n===void 0?s:{...s,currentPath:[...s.basePath,s.definitionPath,n]},!1))!=null?a:F(),o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(i.title=o);const c=n===void 0?r?{...i,[s.definitionPath]:r}:i:{$ref:[...s.$refStrategy==="relative"?[]:s.basePath,s.definitionPath,n].join("/"),[s.definitionPath]:{...r,[n]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},Ue=Symbol.for("vercel.ai.schema");function Ts(t){let e;return()=>(e==null&&(e=t()),e)}function je(t,{validate:e}={}){return{[Ue]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function As(t){return typeof t=="object"&&t!==null&&Ue in t&&t[Ue]===!0&&"jsonSchema"in t&&"validate"in t}function Ge(t){return t==null?je({properties:{},additionalProperties:!1}):As(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Ft(t):Cs(t):t()}function Cs(t){return je(()=>Ye(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const a=await t["~standard"].validate(e);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new me({value:e,cause:a.issues})}}})}function Rs(t,e){var a;const s=(a=void 0)!=null?a:!1;return je(()=>Ns(t,{$refStrategy:s?"root":"none"}),{validate:async r=>{const n=await t.safeParseAsync(r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function Ms(t,e){var a;const s=(a=void 0)!=null?a:!1;return je(()=>Ye(oa(t,{target:"draft-7",io:"input",reused:s?"ref":"inline"})),{validate:async r=>{const n=await na(t,r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function Os(t){return"_zod"in t}function Ft(t,e){return Os(t)?Ms(t):Rs(t)}async function ft({value:t,schema:e}){const a=await _e({value:t,schema:e});if(!a.success)throw me.wrap({value:t,cause:a.error});return a.value}async function _e({value:t,schema:e}){const a=Ge(e);try{if(a.validate==null)return{success:!0,value:t,rawValue:t};const s=await a.validate(t);return s.success?{success:!0,value:s.value,rawValue:t}:{success:!1,error:me.wrap({value:t,cause:s.error}),rawValue:t}}catch(s){return{success:!1,error:me.wrap({value:t,cause:s}),rawValue:t}}}async function oe({text:t,schema:e}){try{const a=Ua(t);return e==null?{success:!0,value:a,rawValue:a}:await _e({value:a,schema:e})}catch(a){return{success:!1,error:it.isInstance(a)?a:new it({text:t,cause:a}),rawValue:void 0}}}function js({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new ga).pipeThrough(new TransformStream({async transform({data:a},s){a!=="[DONE]"&&s.enqueue(await oe({text:a,schema:e}))}}))}async function ee(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Ps=Object.defineProperty,Ds=(t,e)=>{for(var a in e)Ps(t,a,{get:e[a],enumerable:!0})},Bt="AI_NoObjectGeneratedError",zt=`vercel.ai.error.${Bt}`,ks=Symbol.for(zt),Vt,te=class extends ae{constructor({message:t="No object generated.",cause:e,text:a,response:s,usage:r,finishReason:n}){super({name:Bt,message:t,cause:e}),this[Vt]=!0,this.text=a,this.response=s,this.usage=r,this.finishReason=n}static isInstance(t){return ae.hasMarker(t,zt)}};Vt=ks;var gt="6.0.30",qt=$([f(),Re(Uint8Array),Re(ArrayBuffer),wt(t=>{var e,a;return(a=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?a:!1},{message:"Must be a Buffer"})]),we=ia(()=>$([la(),f(),ca(),Z(),be(f(),we.optional()),Ee(we)])),S=be(f(),be(f(),we.optional())),Jt=M({type:x("text"),text:f(),providerOptions:S.optional()}),Zs=M({type:x("image"),image:$([qt,Re(URL)]),mediaType:f().optional(),providerOptions:S.optional()}),Wt=M({type:x("file"),data:$([qt,Re(URL)]),filename:f().optional(),mediaType:f(),providerOptions:S.optional()}),$s=M({type:x("reasoning"),text:f(),providerOptions:S.optional()}),Ls=M({type:x("tool-call"),toolCallId:f(),toolName:f(),input:X(),providerOptions:S.optional(),providerExecuted:Z().optional()}),Us=ua("type",[M({type:x("text"),value:f(),providerOptions:S.optional()}),M({type:x("json"),value:we,providerOptions:S.optional()}),M({type:x("execution-denied"),reason:f().optional(),providerOptions:S.optional()}),M({type:x("error-text"),value:f(),providerOptions:S.optional()}),M({type:x("error-json"),value:we,providerOptions:S.optional()}),M({type:x("content"),value:Ee($([M({type:x("text"),text:f(),providerOptions:S.optional()}),M({type:x("media"),data:f(),mediaType:f()}),M({type:x("file-data"),data:f(),mediaType:f(),filename:f().optional(),providerOptions:S.optional()}),M({type:x("file-url"),url:f(),providerOptions:S.optional()}),M({type:x("file-id"),fileId:$([f(),be(f(),f())]),providerOptions:S.optional()}),M({type:x("image-data"),data:f(),mediaType:f(),providerOptions:S.optional()}),M({type:x("image-url"),url:f(),providerOptions:S.optional()}),M({type:x("image-file-id"),fileId:$([f(),be(f(),f())]),providerOptions:S.optional()}),M({type:x("custom"),providerOptions:S.optional()})]))})]),Yt=M({type:x("tool-result"),toolCallId:f(),toolName:f(),output:Us,providerOptions:S.optional()}),Fs=M({type:x("tool-approval-request"),approvalId:f(),toolCallId:f()}),Bs=M({type:x("tool-approval-response"),approvalId:f(),approved:Z(),reason:f().optional()}),zs=M({role:x("system"),content:f(),providerOptions:S.optional()}),Vs=M({role:x("user"),content:$([f(),Ee($([Jt,Zs,Wt]))]),providerOptions:S.optional()}),qs=M({role:x("assistant"),content:$([f(),Ee($([Jt,Wt,$s,Ls,Yt,Fs]))]),providerOptions:S.optional()}),Js=M({role:x("tool"),content:Ee($([Yt,Bs])),providerOptions:S.optional()});$([zs,Vs,qs,Js]);function Gt(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const a={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const r=e[s];if(r===void 0)continue;const n=s in t?t[s]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),o=n!=null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof Date)&&!(n instanceof RegExp);i&&o?a[s]=Gt(n,r):a[s]=r}return a}var Ws={};Ds(Ws,{array:()=>Qs,choice:()=>Xs,json:()=>Ks,object:()=>Hs,text:()=>Gs});function Ys(t){const e=["ROOT"];let a=-1,s=null;function r(c,l,p){switch(c){case'"':{a=l,e.pop(),e.push(p),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=l,s=l,e.pop(),e.push(p),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=l,e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"{":{a=l,e.pop(),e.push(p),e.push("INSIDE_OBJECT_START");break}case"[":{a=l,e.pop(),e.push(p),e.push("INSIDE_ARRAY_START");break}}}function n(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=l,e.pop();break}}}function i(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,e.pop();break}}}for(let c=0;c<t.length;c++){const l=t[c];switch(e[e.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{a=c,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{n(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),a=c;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:a=c}break}case"INSIDE_ARRAY_START":{l==="]"?(a=c,e.pop()):(a=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=c,e.pop();break}default:{a=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),a=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=c;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const d=t.substring(s,c+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?n(l,c):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c)):a=c;break}}}let o=t.slice(0,a+1);for(let c=e.length-1;c>=0;c--)switch(e[c]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const p=t.substring(s,t.length);"true".startsWith(p)?o+="true".slice(p.length):"false".startsWith(p)?o+="false".slice(p.length):"null".startsWith(p)&&(o+="null".slice(p.length))}}return o}async function Se(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await oe({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await oe({text:Ys(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Gs=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),Hs=({schema:t,name:e,description:a})=>{const s=Ge(t);return{name:"object",responseFormat:ee(s.jsonSchema).then(r=>({type:"json",schema:r,...e!=null&&{name:e},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},n){const i=await oe({text:r});if(!i.success)throw new te({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=await _e({value:i.value,schema:s});if(!o.success)throw new te({message:"No object generated: response did not match schema.",cause:o.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return o.value},async parsePartialOutput({text:r}){const n=await Se(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:n.value}}},createElementStreamTransform(){}}},Qs=({element:t,name:e,description:a})=>{const s=Ge(t);return{name:"array",responseFormat:ee(s.jsonSchema).then(r=>{const{$schema:n,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},n){const i=await oe({text:r});if(!i.success)throw new te({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=i.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))throw new te({message:"No object generated: response did not match schema.",cause:new me({value:o,cause:"response must be an object with an elements array"}),text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});for(const c of o.elements){const l=await _e({value:c,schema:s});if(!l.success)throw new te({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason})}return o.elements},async parsePartialOutput({text:r}){const n=await Se(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=n.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const o=n.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const l of o){const p=await _e({value:l,schema:s});p.success&&c.push(p.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:n},i){if(n!=null)for(;r<n.length;r++)i.enqueue(n[r])}})}}},Xs=({options:t,name:e,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}),async parseCompleteOutput({text:s},r){const n=await oe({text:s});if(!n.success)throw new te({message:"No object generated: could not parse the response.",cause:n.error,text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});const i=n.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!t.includes(i.result))throw new te({message:"No object generated: response did not match schema.",cause:new me({value:i,cause:"response must be an object that contains a choice value."}),text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:s}){const r=await Se(s);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const n=r.value;if(n==null||typeof n!="object"||!("result"in n)||typeof n.result!="string")return;const i=t.filter(o=>o.startsWith(n.result));return r.state==="successful-parse"?i.includes(n.result)?{partial:n.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),Ks=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:a},s){const r=await oe({text:a});if(!r.success)throw new te({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:s.response,usage:s.usage,finishReason:s.finishReason});return r.value},async parsePartialOutput({text:a}){const s=await Se(a);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return s.value===void 0?void 0:{partial:s.value}}},createElementStreamTransform(){}});Ie({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
7
|
+
]`;continue}n+=r[l],r[l]==="\\"?i=!0:o&&r[l]==="]"?o=!1:!o&&r[l]==="["&&(o=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}function Ut(t,e){var a,s,r,n,i,o;const c={type:"object",additionalProperties:(a=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?a:e.allowedAdditionalProperties};if(((s=t.keyType)==null?void 0:s._def.typeName)===w.ZodString&&((r=t.keyType._def.checks)!=null&&r.length)){const{type:l,...p}=Lt(t.keyType._def,e);return{...c,propertyNames:p}}else{if(((n=t.keyType)==null?void 0:n._def.typeName)===w.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(((i=t.keyType)==null?void 0:i._def.typeName)===w.ZodBranded&&t.keyType._def.type._def.typeName===w.ZodString&&((o=t.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...p}=Zt(t.keyType._def,e);return{...c,propertyNames:p}}}return c}function as(t,e){if(e.mapStrategy==="record")return Ut(t,e);const a=R(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||F(),s=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||F();return{type:"array",maxItems:125,items:{type:"array",items:[a,s],minItems:2,maxItems:2}}}function ss(t){const e=t.values,s=Object.keys(t.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),r=Array.from(new Set(s.map(n=>typeof n)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function rs(){return{not:F()}}function ns(){return{type:"null"}}var Le={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function os(t,e){const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(s=>s._def.typeName in Le&&(!s._def.checks||!s._def.checks.length))){const s=a.reduce((r,n)=>{const i=Le[n._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:s.length>1?s:s[0]}}else if(a.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){const s=a.reduce((r,n)=>{const i=typeof n._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(n._def.value===null)return[...r,"null"];default:return r}},[]);if(s.length===a.length){const r=s.filter((n,i,o)=>o.indexOf(n)===i);return{type:r.length>1?r:r[0],enum:a.reduce((n,i)=>n.includes(i._def.value)?n:[...n,i._def.value],[])}}}else if(a.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((s,r)=>[...s,...r._def.values.filter(n=>!s.includes(n))],[])};return is(t,e)}var is=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((s,r)=>R(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return a.length?{anyOf:a}:void 0};function ls(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Le[t.innerType._def.typeName],"null"]};const a=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function cs(t){const e={type:"number"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"int":e.type="integer";break;case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function us(t,e){const a={type:"object",properties:{}},s=[],r=t.shape();for(const i in r){let o=r[i];if(o===void 0||o._def===void 0)continue;const c=ps(o),l=R(o._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(a.properties[i]=l,c||s.push(i))}s.length&&(a.required=s);const n=ds(t,e);return n!==void 0&&(a.additionalProperties=n),a}function ds(t,e){if(t.catchall._def.typeName!=="ZodNever")return R(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function ps(t){try{return t.isOptional()}catch{return!0}}var ms=(t,e)=>{var a;if(e.currentPath.toString()===((a=e.propertyPath)==null?void 0:a.toString()))return R(t.innerType._def,e);const s=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return s?{anyOf:[{not:F()},s]}:F()},hs=(t,e)=>{if(e.pipeStrategy==="input")return R(t.in._def,e);if(e.pipeStrategy==="output")return R(t.out._def,e);const a=R(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=R(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,s].filter(r=>r!==void 0)}};function fs(t,e){return R(t.type._def,e)}function gs(t,e){const s={type:"array",uniqueItems:!0,items:R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(s.minItems=t.minSize.value),t.maxSize&&(s.maxItems=t.maxSize.value),s}function vs(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[]),additionalItems:R(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[])}}function ys(){return{not:F()}}function bs(){return F()}var xs=(t,e)=>R(t.innerType._def,e),_s=(t,e,a)=>{switch(e){case w.ZodString:return Lt(t,a);case w.ZodNumber:return cs(t);case w.ZodObject:return us(t,a);case w.ZodBigInt:return Va(t);case w.ZodBoolean:return qa();case w.ZodDate:return $t(t,a);case w.ZodUndefined:return ys();case w.ZodNull:return ns();case w.ZodArray:return za(t,a);case w.ZodUnion:case w.ZodDiscriminatedUnion:return os(t,a);case w.ZodIntersection:return Xa(t,a);case w.ZodTuple:return vs(t,a);case w.ZodRecord:return Ut(t,a);case w.ZodLiteral:return Ka(t);case w.ZodEnum:return Ha(t);case w.ZodNativeEnum:return ss(t);case w.ZodNullable:return ls(t,a);case w.ZodOptional:return ms(t,a);case w.ZodMap:return as(t,a);case w.ZodSet:return gs(t,a);case w.ZodLazy:return()=>t.getter()._def;case w.ZodPromise:return fs(t,a);case w.ZodNaN:case w.ZodNever:return rs();case w.ZodEffects:return Ga(t,a);case w.ZodAny:return F();case w.ZodUnknown:return bs();case w.ZodDefault:return Ya(t,a);case w.ZodBranded:return Zt(t,a);case w.ZodReadonly:return xs(t,a);case w.ZodCatch:return Ja(t,a);case w.ZodPipeline:return hs(t,a);case w.ZodFunction:case w.ZodVoid:case w.ZodSymbol:return;default:return(s=>{})()}},ws=(t,e)=>{let a=0;for(;a<t.length&&a<e.length&&t[a]===e[a];a++);return[(t.length-a).toString(),...e.slice(a)].join("/")};function R(t,e,a=!1){var s;const r=e.seen.get(t);if(e.override){const c=(s=e.override)==null?void 0:s.call(e,t,e,r,a);if(c!==Fa)return c}if(r&&!a){const c=Es(r,e);if(c!==void 0)return c}const n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);const i=_s(t,t.typeName,e),o=typeof i=="function"?R(i(),e):i;if(o&&Is(t,e,o),e.postProcess){const c=e.postProcess(o,t,e);return n.jsonSchema=o,c}return n.jsonSchema=o,o}var Es=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:ws(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((a,s)=>e.currentPath[s]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),F()):e.$refStrategy==="seen"?F():void 0}},Is=(t,e,a)=>(t.description&&(a.description=t.description),a),Ss=t=>{const e=Ba(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}},Ns=(t,e)=>{var a;const s=Ss(e);let r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[p,d])=>{var g;return{...l,[p]:(g=R(d._def,{...s,currentPath:[...s.basePath,s.definitionPath,p]},!0))!=null?g:F()}},{}):void 0;const n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=(a=R(t._def,n===void 0?s:{...s,currentPath:[...s.basePath,s.definitionPath,n]},!1))!=null?a:F(),o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(i.title=o);const c=n===void 0?r?{...i,[s.definitionPath]:r}:i:{$ref:[...s.$refStrategy==="relative"?[]:s.basePath,s.definitionPath,n].join("/"),[s.definitionPath]:{...r,[n]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},Ue=Symbol.for("vercel.ai.schema");function Ts(t){let e;return()=>(e==null&&(e=t()),e)}function je(t,{validate:e}={}){return{[Ue]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function As(t){return typeof t=="object"&&t!==null&&Ue in t&&t[Ue]===!0&&"jsonSchema"in t&&"validate"in t}function Ge(t){return t==null?je({properties:{},additionalProperties:!1}):As(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Ft(t):Cs(t):t()}function Cs(t){return je(()=>Ye(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const a=await t["~standard"].validate(e);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new me({value:e,cause:a.issues})}}})}function Rs(t,e){var a;const s=(a=void 0)!=null?a:!1;return je(()=>Ns(t,{$refStrategy:s?"root":"none"}),{validate:async r=>{const n=await t.safeParseAsync(r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function Ms(t,e){var a;const s=(a=void 0)!=null?a:!1;return je(()=>Ye(oa(t,{target:"draft-7",io:"input",reused:s?"ref":"inline"})),{validate:async r=>{const n=await na(t,r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function Os(t){return"_zod"in t}function Ft(t,e){return Os(t)?Ms(t):Rs(t)}async function ft({value:t,schema:e}){const a=await _e({value:t,schema:e});if(!a.success)throw me.wrap({value:t,cause:a.error});return a.value}async function _e({value:t,schema:e}){const a=Ge(e);try{if(a.validate==null)return{success:!0,value:t,rawValue:t};const s=await a.validate(t);return s.success?{success:!0,value:s.value,rawValue:t}:{success:!1,error:me.wrap({value:t,cause:s.error}),rawValue:t}}catch(s){return{success:!1,error:me.wrap({value:t,cause:s}),rawValue:t}}}async function oe({text:t,schema:e}){try{const a=Ua(t);return e==null?{success:!0,value:a,rawValue:a}:await _e({value:a,schema:e})}catch(a){return{success:!1,error:it.isInstance(a)?a:new it({text:t,cause:a}),rawValue:void 0}}}function js({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new ga).pipeThrough(new TransformStream({async transform({data:a},s){a!=="[DONE]"&&s.enqueue(await oe({text:a,schema:e}))}}))}async function ee(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var Ps=Object.defineProperty,Ds=(t,e)=>{for(var a in e)Ps(t,a,{get:e[a],enumerable:!0})},Bt="AI_NoObjectGeneratedError",zt=`vercel.ai.error.${Bt}`,ks=Symbol.for(zt),Vt,te=class extends ae{constructor({message:t="No object generated.",cause:e,text:a,response:s,usage:r,finishReason:n}){super({name:Bt,message:t,cause:e}),this[Vt]=!0,this.text=a,this.response=s,this.usage=r,this.finishReason=n}static isInstance(t){return ae.hasMarker(t,zt)}};Vt=ks;var gt="6.0.33",qt=$([f(),Re(Uint8Array),Re(ArrayBuffer),wt(t=>{var e,a;return(a=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?a:!1},{message:"Must be a Buffer"})]),we=ia(()=>$([la(),f(),ca(),Z(),be(f(),we.optional()),Ee(we)])),S=be(f(),be(f(),we.optional())),Jt=M({type:x("text"),text:f(),providerOptions:S.optional()}),Zs=M({type:x("image"),image:$([qt,Re(URL)]),mediaType:f().optional(),providerOptions:S.optional()}),Wt=M({type:x("file"),data:$([qt,Re(URL)]),filename:f().optional(),mediaType:f(),providerOptions:S.optional()}),$s=M({type:x("reasoning"),text:f(),providerOptions:S.optional()}),Ls=M({type:x("tool-call"),toolCallId:f(),toolName:f(),input:X(),providerOptions:S.optional(),providerExecuted:Z().optional()}),Us=ua("type",[M({type:x("text"),value:f(),providerOptions:S.optional()}),M({type:x("json"),value:we,providerOptions:S.optional()}),M({type:x("execution-denied"),reason:f().optional(),providerOptions:S.optional()}),M({type:x("error-text"),value:f(),providerOptions:S.optional()}),M({type:x("error-json"),value:we,providerOptions:S.optional()}),M({type:x("content"),value:Ee($([M({type:x("text"),text:f(),providerOptions:S.optional()}),M({type:x("media"),data:f(),mediaType:f()}),M({type:x("file-data"),data:f(),mediaType:f(),filename:f().optional(),providerOptions:S.optional()}),M({type:x("file-url"),url:f(),providerOptions:S.optional()}),M({type:x("file-id"),fileId:$([f(),be(f(),f())]),providerOptions:S.optional()}),M({type:x("image-data"),data:f(),mediaType:f(),providerOptions:S.optional()}),M({type:x("image-url"),url:f(),providerOptions:S.optional()}),M({type:x("image-file-id"),fileId:$([f(),be(f(),f())]),providerOptions:S.optional()}),M({type:x("custom"),providerOptions:S.optional()})]))})]),Yt=M({type:x("tool-result"),toolCallId:f(),toolName:f(),output:Us,providerOptions:S.optional()}),Fs=M({type:x("tool-approval-request"),approvalId:f(),toolCallId:f()}),Bs=M({type:x("tool-approval-response"),approvalId:f(),approved:Z(),reason:f().optional()}),zs=M({role:x("system"),content:f(),providerOptions:S.optional()}),Vs=M({role:x("user"),content:$([f(),Ee($([Jt,Zs,Wt]))]),providerOptions:S.optional()}),qs=M({role:x("assistant"),content:$([f(),Ee($([Jt,Wt,$s,Ls,Yt,Fs]))]),providerOptions:S.optional()}),Js=M({role:x("tool"),content:Ee($([Yt,Bs])),providerOptions:S.optional()});$([zs,Vs,qs,Js]);function Gt(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const a={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const r=e[s];if(r===void 0)continue;const n=s in t?t[s]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),o=n!=null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof Date)&&!(n instanceof RegExp);i&&o?a[s]=Gt(n,r):a[s]=r}return a}var Ws={};Ds(Ws,{array:()=>Qs,choice:()=>Xs,json:()=>Ks,object:()=>Hs,text:()=>Gs});function Ys(t){const e=["ROOT"];let a=-1,s=null;function r(c,l,p){switch(c){case'"':{a=l,e.pop(),e.push(p),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=l,s=l,e.pop(),e.push(p),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=l,e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"{":{a=l,e.pop(),e.push(p),e.push("INSIDE_OBJECT_START");break}case"[":{a=l,e.pop(),e.push(p),e.push("INSIDE_ARRAY_START");break}}}function n(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=l,e.pop();break}}}function i(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,e.pop();break}}}for(let c=0;c<t.length;c++){const l=t[c];switch(e[e.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{a=c,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{n(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),a=c;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:a=c}break}case"INSIDE_ARRAY_START":{l==="]"?(a=c,e.pop()):(a=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=c,e.pop();break}default:{a=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),a=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=c;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const d=t.substring(s,c+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?n(l,c):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c)):a=c;break}}}let o=t.slice(0,a+1);for(let c=e.length-1;c>=0;c--)switch(e[c]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const p=t.substring(s,t.length);"true".startsWith(p)?o+="true".slice(p.length):"false".startsWith(p)?o+="false".slice(p.length):"null".startsWith(p)&&(o+="null".slice(p.length))}}return o}async function Se(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await oe({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await oe({text:Ys(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Gs=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),Hs=({schema:t,name:e,description:a})=>{const s=Ge(t);return{name:"object",responseFormat:ee(s.jsonSchema).then(r=>({type:"json",schema:r,...e!=null&&{name:e},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},n){const i=await oe({text:r});if(!i.success)throw new te({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=await _e({value:i.value,schema:s});if(!o.success)throw new te({message:"No object generated: response did not match schema.",cause:o.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return o.value},async parsePartialOutput({text:r}){const n=await Se(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:n.value}}},createElementStreamTransform(){}}},Qs=({element:t,name:e,description:a})=>{const s=Ge(t);return{name:"array",responseFormat:ee(s.jsonSchema).then(r=>{const{$schema:n,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},n){const i=await oe({text:r});if(!i.success)throw new te({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=i.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))throw new te({message:"No object generated: response did not match schema.",cause:new me({value:o,cause:"response must be an object with an elements array"}),text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});for(const c of o.elements){const l=await _e({value:c,schema:s});if(!l.success)throw new te({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason})}return o.elements},async parsePartialOutput({text:r}){const n=await Se(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=n.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const o=n.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const l of o){const p=await _e({value:l,schema:s});p.success&&c.push(p.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:n},i){if(n!=null)for(;r<n.length;r++)i.enqueue(n[r])}})}}},Xs=({options:t,name:e,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}),async parseCompleteOutput({text:s},r){const n=await oe({text:s});if(!n.success)throw new te({message:"No object generated: could not parse the response.",cause:n.error,text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});const i=n.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!t.includes(i.result))throw new te({message:"No object generated: response did not match schema.",cause:new me({value:i,cause:"response must be an object that contains a choice value."}),text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:s}){const r=await Se(s);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const n=r.value;if(n==null||typeof n!="object"||!("result"in n)||typeof n.result!="string")return;const i=t.filter(o=>o.startsWith(n.result));return r.state==="successful-parse"?i.includes(n.result)?{partial:n.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),Ks=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:a},s){const r=await oe({text:a});if(!r.success)throw new te({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:s.response,usage:s.usage,finishReason:s.finishReason});return r.value},async parsePartialOutput({text:a}){const s=await Se(a);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return s.value===void 0?void 0:{partial:s.value}}},createElementStreamTransform(){}});Ie({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
8
8
|
|
|
9
9
|
`)},flush(t){t.enqueue(`data: [DONE]
|
|
10
10
|
|