@decocms/mesh 1.13.4 → 2.0.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-CmTLFfTW.js → AlertCircle-BnQOnIUK.js} +1 -1
- package/dist/client/assets/{ArrowLeft-kUb-nLpp.js → ArrowLeft-s2LVd4Jh.js} +1 -1
- package/dist/client/assets/{ChevronDown-BIixgdXr.js → ChevronDown-DLHFQDss.js} +1 -1
- package/dist/client/assets/{ChevronRight-XFvS51AW.js → ChevronRight-Df7vxLuO.js} +1 -1
- package/dist/client/assets/{Copy01-Bbnq-cRP.js → Copy01-Cg-zZNgL.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-Wp9Jfd-l.js → DotsHorizontal-S6AK1qMQ.js} +1 -1
- package/dist/client/assets/{DotsVertical-BWJddsCE.js → DotsVertical-DL1BOVox.js} +1 -1
- package/dist/client/assets/{File06-AO49hgxj.js → File06-BXoByNkx.js} +1 -1
- package/dist/client/assets/{FilterLines-D_oBG_mT.js → FilterLines-D-86Z5xi.js} +1 -1
- package/dist/client/assets/{FlipBackward-v3DJy5dX.js → FlipBackward-ZBsKqLYA.js} +1 -1
- package/dist/client/assets/{GitBranch01-Bg8OxNYr.js → GitBranch01-BU4xfNWf.js} +1 -1
- package/dist/client/assets/{Grid01-D8szKORD.js → Grid01-DTA7Ao9S.js} +1 -1
- package/dist/client/assets/{Inbox01-DKJqmGhJ.js → Inbox01-BMVbBJQA.js} +1 -1
- package/dist/client/assets/{InfoCircle-DQgIwXgE.js → InfoCircle-DrzBjG0U.js} +1 -1
- package/dist/client/assets/{Key01-j8Px8dQ3.js → Key01-DHDQn1LD.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DtwuKg3k.js → LinkExternal01-cG3zQluY.js} +1 -1
- package/dist/client/assets/{Loading01-BFMDuD9f.js → Loading01-ev_d5Ul8.js} +1 -1
- package/dist/client/assets/{Lock01-B2Dlj0_A.js → Lock01-SYpb-IcY.js} +1 -1
- package/dist/client/assets/{Play-DZwkJO6F.js → Play-vz5syF_s.js} +1 -1
- package/dist/client/assets/{Plus-DCJuRkSA.js → Plus-CoA7veNR.js} +1 -1
- package/dist/client/assets/{Terminal-BgBiWCRz.js → Terminal-DmwCXCux.js} +1 -1
- package/dist/client/assets/{Trash01-DXJjsatW.js → Trash01-D5qtjx0n.js} +1 -1
- package/dist/client/assets/{X-DO5JCiO9.js → X-ucqgpLkV.js} +1 -1
- package/dist/client/assets/{XClose-yLguPztf.js → XClose-DDYQu1Ds.js} +1 -1
- package/dist/client/assets/{alert-dialog-BFj8FHOj.js → alert-dialog-IBFLzL1S.js} +1 -1
- package/dist/client/assets/{auth-CS1Cey1o.js → auth-ClQTpskF.js} +1 -1
- package/dist/client/assets/{auth-catchall-BbJfiMLS.js → auth-catchall-C5Hc-_dX.js} +1 -1
- package/dist/client/assets/{avatar-Cw7f7Fm7.js → avatar-DyfHzlT3.js} +1 -1
- package/dist/client/assets/{badge-cip1W12x.js → badge-CU1xq8P4.js} +1 -1
- package/dist/client/assets/{card-D7kEypvP.js → card-A0j-GQek.js} +1 -1
- package/dist/client/assets/{checkbox-DWLQD46M.js → checkbox-CKmzIgh_.js} +1 -1
- package/dist/client/assets/{collection-detail-BnPZ4P9Q.js → collection-detail-DfA_YTCa.js} +2 -2
- package/dist/client/assets/{collection-display-button-6se5sKw0.js → collection-display-button-CWAu-kzM.js} +1 -1
- package/dist/client/assets/{collection-header-BAGohiuL.js → collection-header-BwSc-_Kq.js} +1 -1
- package/dist/client/assets/{collection-page-BIjUaFrN.js → collection-page-DtIcDiZ6.js} +1 -1
- package/dist/client/assets/{collection-search-Bt7hJb44.js → collection-search-B9hWcULz.js} +1 -1
- package/dist/client/assets/{collection-tab-DofbhRON.js → collection-tab-B_R97p8f.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Nus9WkY9.js → collection-table-wrapper-DQxK8uYh.js} +1 -1
- package/dist/client/assets/{connection-card-D6p9Apdb.js → connection-card-sB7DQoNm.js} +1 -1
- package/dist/client/assets/connection-detail-YVncur0H.js +1 -0
- package/dist/client/assets/connections-BXFZ3wvT.js +1 -0
- package/dist/client/assets/constants-C6wB7wau.js +1 -0
- package/dist/client/assets/{create-organization-dialog-D4ZZBa08.js → create-organization-dialog-Ekn1e0rk.js} +1 -1
- package/dist/client/assets/{dialog-BPRbMnap.js → dialog-BfmlLeqD.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DH78LFXJ.js → dropdown-menu-B32DxAz8.js} +1 -1
- package/dist/client/assets/{empty-state-ZbNFSrHa.js → empty-state-B95c-kPA.js} +1 -1
- package/dist/client/assets/{env-vars-editor-HOD_p6bM.js → env-vars-editor-DWx6qXJH.js} +1 -1
- package/dist/client/assets/{error-boundary-CSDpN3IU.js → error-boundary-CeUty1fN.js} +1 -1
- package/dist/client/assets/extract-connection-data-BVC8xFla.js +1 -0
- package/dist/client/assets/{form-BWvfCr5W.js → form-JhtOrW0K.js} +1 -1
- package/dist/client/assets/{formatDistanceToNow-CUtIwGZO.js → formatDistanceToNow-Dn3t8R_C.js} +1 -1
- package/dist/client/assets/{gateway-detail-BVUnhnv6.js → gateway-detail-CFSYfSyg.js} +1 -1
- package/dist/client/assets/{gateway-selector-C6BhGNmC.js → gateway-selector-Dbt9ey6W.js} +1 -1
- package/dist/client/assets/{gateways-CUY_RF0g.js → gateways-DHNzyrkl.js} +1 -1
- package/dist/client/assets/github-icon-Dp3wHhYE.js +1 -0
- package/dist/client/assets/{home-BDMCtoFs.js → home-WYDr7ETr.js} +1 -1
- package/dist/client/assets/{index-CFqw5CAk.js → index-C1mekZiH.js} +2 -2
- package/dist/client/assets/index-D34hcbGg.js +25 -0
- package/dist/client/assets/{index-B1wnL3pV.css → index-DU53zBhA.css} +1 -1
- package/dist/client/assets/{index-m-YmB4ph.js → index-DfTxjkaX.js} +1 -1
- package/dist/client/assets/{input-BSDBSyke.js → input-DaU0Ki86.js} +1 -1
- package/dist/client/assets/{layout-C_WJLL2S.js → layout-BExJva29.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-QHCwZ7Bv.js → lazy-highlighter-DaSVftiO.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DnYi5wZr.js → localstorage-keys-D0etzHKS.js} +1 -1
- package/dist/client/assets/{login-unmsX_CR.js → login-CxcGRpej.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D1oibR_i.js → mcp-oauth-BIn8BXP3.js} +1 -1
- package/dist/client/assets/mcp-server-detail-D6DvDFSK.js +1 -0
- package/dist/client/assets/{members-CgDxC8dY.js → members-D37gJv0X.js} +1 -1
- package/dist/client/assets/{monaco-editor-18l2E7lk.js → monaco-editor-Y-NWUHaI.js} +1 -1
- package/dist/client/assets/{monitoring-BS_WM-ML.js → monitoring-DlVue9UD.js} +1 -1
- package/dist/client/assets/{oauth-callback-tcEVQW2m.js → oauth-callback-WdcYmBNI.js} +1 -1
- package/dist/client/assets/{page-C_wcQFSa.js → page-BJvhqDxS.js} +1 -1
- package/dist/client/assets/page-CHJwayw7.js +1 -0
- package/dist/client/assets/{pin-to-sidebar-button-rUjoaKt7.js → pin-to-sidebar-button-byXh4q4H.js} +1 -1
- package/dist/client/assets/{popover-DGwJ1U8B.js → popover-DBs4BqBC.js} +1 -1
- package/dist/client/assets/{project-context-provider-C7-HmBKu.js → project-context-provider-CNg0H4Fo.js} +1 -1
- package/dist/client/assets/registry-utils-B7t_ZBUi.js +1 -0
- package/dist/client/assets/{resizable-BkJdAL7l.js → resizable-CTcl5OQf.js} +1 -1
- package/dist/client/assets/{resource-tabs-DhNIXHvE.js → resource-tabs-Bo8pm6CQ.js} +1 -1
- package/dist/client/assets/{select-DLPmxXDW.js → select-DbMbYBva.js} +1 -1
- package/dist/client/assets/{settings-Dg4J4piv.js → settings-7IN1gw1l.js} +1 -1
- package/dist/client/assets/{shell-layout-CW_3D6wx.js → shell-layout-nmRRj6_B.js} +1 -1
- package/dist/client/assets/{spinner-PGFal9m1.js → spinner-BGNFnmXu.js} +1 -1
- package/dist/client/assets/{switch-Fn7If0Ti.js → switch-CmxXnJyM.js} +1 -1
- package/dist/client/assets/{textarea-CbNfP826.js → textarea-DAtAmtc7.js} +1 -1
- package/dist/client/assets/{thread-history-popover-BW6o5miO.js → thread-history-popover-zKy_UgQq.js} +3 -3
- package/dist/client/assets/{tools-list-BMbd7IEa.js → tools-list-DN6AGQNR.js} +1 -1
- package/dist/client/assets/{use-binding-D77gExDp.js → use-binding-DgpwpEbl.js} +1 -1
- package/dist/client/assets/{use-connection-BPzhCo7m.js → use-connection-CqruT03A.js} +1 -1
- package/dist/client/assets/{use-connection-resources-CQGT27SN.js → use-connection-resources-CkpuXaD-.js} +1 -1
- package/dist/client/assets/{use-gateway-C8QVevg7.js → use-gateway-B1dIUnIy.js} +1 -1
- package/dist/client/assets/{use-list-state-BzeiRpp0.js → use-list-state-JWYeEYSc.js} +1 -1
- package/dist/client/assets/{use-mcp-D2cijL_p.js → use-mcp-JvlAYa3Y.js} +1 -1
- package/dist/client/assets/{use-members-CTyXRW-K.js → use-members-Do0dz7W-.js} +1 -1
- package/dist/client/assets/{use-mobile-BTxzaR4j.js → use-mobile-BtDidYAZ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-aN8k0KJJ.js → use-organization-settings-BptZoa_W.js} +1 -1
- package/dist/client/assets/{use-tool-call-C4GcZMyW.js → use-tool-call-C_3QXJhb.js} +1 -1
- package/dist/client/assets/useQuery-BDFKN3rX.js +1 -0
- package/dist/client/assets/{value-DVG0CnkT.js → value-Dr4SJDBJ.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DPmK0pgy.js → view-mode-toggle-D5v_tsuM.js} +1 -1
- package/dist/client/assets/{workflow-Dkm9OUwf.js → workflow-D697ZMd-.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +108 -108
- package/dist/server/server.js +104 -104
- package/package.json +1 -1
- package/dist/client/assets/connection-detail-CkpomsVk.js +0 -1
- package/dist/client/assets/connections-X3ifJgj8.js +0 -1
- package/dist/client/assets/constants-B627FiQ3.js +0 -1
- package/dist/client/assets/extract-connection-data-BVRaMREC.js +0 -1
- package/dist/client/assets/github-icon-BrF3LMLL.js +0 -1
- package/dist/client/assets/index-2YBxks23.js +0 -25
- package/dist/client/assets/mcp-server-detail-5ueNKLNi.js +0 -1
- package/dist/client/assets/page-Bm0QzKLN.js +0 -1
- package/dist/client/assets/useQuery-DV_L-E86.js +0 -1
package/dist/client/assets/{thread-history-popover-BW6o5miO.js → thread-history-popover-zKy_UgQq.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-
|
|
2
|
-
import{r as V,c as W,j as m,B as $i,p as Yi,K as Me,d as yc,t as Ei,E as Ac,F as kc,H as Ve,v as Y,_ as xr,I as gu,J as Cc,L as Ic,M as Sc,Q as je,V as $n,W as Zn,s as Ee,X as G,Y as Ct,Z as Nc,$ as ye,a0 as wc,a1 as qi,a2 as Rc,h as Oc}from"./index-CFqw5CAk.js";import{c as le,u as jt,B as We,I as Lc}from"./input-BSDBSyke.js";import{u as Dt,c as dn,b as fn,T as hn,a as Eu,i as sn}from"./project-context-provider-C7-HmBKu.js";import{E as Dc,u as vc}from"./use-binding-D77gExDp.js";import{P as bu,a as Tu,b as xu}from"./popover-DGwJ1U8B.js";import{i as _u}from"./AlertCircle-CmTLFfTW.js";import{i as Pc}from"./error-boundary-CSDpN3IU.js";import{i as Mc}from"./X-DO5JCiO9.js";import{i as Bc,c as Fc}from"./Grid01-D8szKORD.js";import{i as Uc,R as Hc,f as jc,g as zc,h as $c}from"./gateway-selector-C6BhGNmC.js";import{T as Yc}from"./textarea-CbNfP826.js";import{u as qc,L as Vc}from"./localstorage-keys-DnYi5wZr.js";import{i as yu}from"./ChevronRight-XFvS51AW.js";import{a as Vi}from"./Copy01-Bbnq-cRP.js";import{i as Wc}from"./Terminal-BgBiWCRz.js";import{M as Au,s as Ra}from"./monaco-editor-18l2E7lk.js";import{b as Qc,c as Gc,d as Xc,A as Zc,a as Kc,e as Jc,g as ed,f as td}from"./alert-dialog-BFj8FHOj.js";import{i as nd}from"./File06-AO49hgxj.js";import{i as rd}from"./InfoCircle-DQgIwXgE.js";import{U as id,a as ad,c as sd,u as ud,i as Wi,b as od,E as ld}from"./use-connection-BPzhCo7m.js";import{O as cd,a as dd,g as fd}from"./well-known-mcp-D13f-8h2.js";import{g as hd}from"./generate-id-Dyweu44Y.js";import{s as pd}from"./Trash01-DXJjsatW.js";const ku=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));ku.displayName="Coins01";const Cu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));Cu.displayName="CornerUpLeft";const Iu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));Iu.displayName="CurrencyDollar";const Su=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));Su.displayName="Edit02";const Nu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.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 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.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));Nu.displayName="Image01";const wu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));wu.displayName="Lightbulb01";const Ru=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Ru.displayName="LogOut04";const Or=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));Or.displayName="Stars01";const Ou=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Ou.displayName="Target04";function a_(){const t=W.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 n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=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:[n,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]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=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(ur,{align:"right",width:"w-3/4"}),m.jsx(ur,{align:"left",width:"w-full",lines:3}),m.jsx(ur,{align:"right",width:"w-2/3"}),m.jsx(ur,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=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]=a):a=t[4];let s;t[5]===Symbol.for("react.memo_cache_sentinel")?(s=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]=s):s=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,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:[a,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[s,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]=u):u=t[6],u}function ur(t){const e=W.c(22),{align:n,width:r,lines:i}=t,a=r===void 0?"w-full":r,s=i===void 0?1:i,u=n==="right"?"flex-row-reverse":"flex-row";let o;e[0]!==u?(o=le("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=o):o=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=le("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==a?(h=le("min-w-0 rounded-2xl p-4",p,a),e[5]=p,e[6]=a,e[7]=h):h=e[7];let g;e[8]!==s?(g=Array.from({length:s}),e[8]=s,e[9]=g):g=e[9];let _;e[10]!==s||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((E,R)=>m.jsx("div",{className:le("h-3 rounded bg-muted-foreground/20 animate-pulse",R===s-1?"w-3/4":"w-full"),style:{animationDelay:`${R*.1}s`}},R))}),e[10]=s,e[11]=g,e[12]=_):_=e[12];let y;e[13]!==_||e[14]!==h?(y=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=y):y=e[15];let T;e[16]!==y||e[17]!==d?(T=m.jsxs("div",{className:d,children:[f,y]}),e[16]=y,e[17]=d,e[18]=T):T=e[18];let I;return e[19]!==T||e[20]!==o?(I=m.jsx("div",{className:o,children:T}),e[19]=T,e[20]=o,e[21]=I):I=e[21],I}var Yn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),s={};for(const u of a)s[u]=i[u];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Yn||(Yn={}));var Oa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Oa||(Oa={}));Yn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Yn.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 _r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(s))):u[l]=u[l]||{_errors:[]},u=u[l],o++}}};return i(this),r}static assert(e){if(!(e instanceof _r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}_r.create=t=>new _r(t);var La;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(La||(La={}));var ee;(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"})(ee||(ee={}));function Yt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function md(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Yt(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>r().then(s=>a(s.transaction(e,i).objectStore(e)))}let Qr;function Lr(){return Qr||(Qr=md("keyval-store","keyval")),Qr}function Qi(t,e=Lr()){return e("readonly",n=>Yt(n.get(t)))}function Dn(t,e,n=Lr()){return n("readwrite",r=>(r.put(e,t),Yt(r.transaction)))}function Lu(t,e=Lr()){return e("readwrite",n=>(n.delete(t),Yt(n.transaction)))}function gd(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Yt(t.transaction)}function Du(t=Lr()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Yt(e.getAllKeys()),Yt(e.getAll())]).then(([r,i])=>r.map((a,s)=>[a,i[s]]));const n=[];return t("readonly",r=>gd(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Ed(t,e){const n=`${t}:threads:${e}`;return await Qi(n)??null}async function bd(t){const e=`${t}:threads:`;return(await Du()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,a)=>String(a.updated_at).localeCompare(String(i.updated_at)))}function vu(t,e){const n=`${t}:messages:`;return Du().then(r=>r.filter(([a])=>typeof a=="string"&&a.startsWith(n)).map(([,a])=>a).filter(a=>a.metadata?.thread_id===e||a.threadId===e).sort((a,s)=>{const u=a.metadata?.created_at||a.createdAt||"",o=s.metadata?.created_at||s.createdAt||"";return String(u).localeCompare(String(o))}))}function s_(t){const e=W.c(14),{locator:n}=Dt(),r=t?.gatewayId;let i;e[0]!==r||e[1]!==n?(i=Me.threads(n),e[0]=r,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==r||e[4]!==n?(a=async()=>await bd(n),e[3]=r,e[4]=n,e[5]=a):a=e[5];let s;e[6]!==i||e[7]!==a?(s={queryKey:i,queryFn:a,staleTime:3e4},e[6]=i,e[7]=a,e[8]=s):s=e[8];const{data:u,refetch:o}=Yi(s);let l;e[9]!==u?(l=u??[],e[9]=u,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d={threads:l,refetch:o},e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function Td(t){const e=W.c(11),{locator:n}=Dt();let r;e[0]!==n||e[1]!==t?(r=Me.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>vu(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r||e[7]!==i?(a={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=a):a=e[8];const{data:s}=Yi(a);let u;return e[9]!==s?(u=s??[],e[9]=s,e[10]=u):u=e[10],u}function Gi(){const t=W.c(28),{locator:e}=Dt(),n=$i();let r;t[0]!==e?(r=async y=>{const T=`${e}:threads:${y.id}`;return await Dn(T,y),y},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=y=>{n.invalidateQueries({queryKey:Me.threads(e)}),y.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,y.gatewayId)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=jt(a);let u;t[8]!==e?(u=async y=>{const{id:T,updates:I}=y,E=`${e}:threads:${T}`,R=await Qi(E);if(!R)throw new Error(`Thread ${T} not found`);const O={...R,...I};return await Dn(E,O),O},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=y=>{n.invalidateQueries({queryKey:Me.threads(e)}),n.invalidateQueries({queryKey:Me.thread(e,y.id)}),y.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,y.gatewayId)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const d=jt(l);let f;t[16]!==e?(f=async y=>{const T=`${e}:threads:${y}`;return await Lu(T),y},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=()=>{n.invalidateQueries({queryKey:Me.threads(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=jt(h);let _;return t[24]!==g||t[25]!==s||t[26]!==d?(_={insert:s,update:d,delete:g},t[24]=g,t[25]=s,t[26]=d,t[27]=_):_=t[27],_}function Pu(){const t=W.c(37),{locator:e}=Dt(),n=$i();let r;t[0]!==e?(r=async R=>{const O=`${e}:messages:${R.id}`;return await Dn(O,R),R},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=R=>{const O=R.metadata?.thread_id||R.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=jt(a);let u;t[8]!==e?(u=async R=>(await Promise.all(R.map(O=>{const S=`${e}:messages:${O.id}`;return Dn(S,O)})),R),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=R=>{const O=new Set;for(const S of R){const v=S.metadata?.thread_id||S.threadId;v&&O.add(v)}for(const S of O)n.invalidateQueries({queryKey:Me.threadMessages(e,S)});n.invalidateQueries({queryKey:Me.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const d=jt(l);let f;t[16]!==e?(f=async R=>{const{id:O,updates:S}=R,v=`${e}:messages:${O}`,B=await Qi(v);if(!B)throw new Error(`Message ${O} not found`);const z={...B,...S};return await Dn(v,z),z},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=R=>{const O=R.metadata?.thread_id||R.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.messages(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=jt(h);let _;t[24]!==e?(_=async R=>{const O=`${e}:messages:${R}`;return await Lu(O),R},t[24]=e,t[25]=_):_=t[25];let y;t[26]!==e||t[27]!==n?(y=()=>{n.invalidateQueries({queryKey:Me.messages(e)})},t[26]=e,t[27]=n,t[28]=y):y=t[28];let T;t[29]!==y||t[30]!==_?(T={mutationFn:_,onSuccess:y},t[29]=y,t[30]=_,t[31]=T):T=t[31];const I=jt(T);let E;return t[32]!==I||t[33]!==s||t[34]!==d||t[35]!==g?(E={insert:s,insertMany:d,update:g,delete:I},t[32]=I,t[33]=s,t[34]=d,t[35]=g,t[36]=E):E=t[36],E}function u_(){const t=W.c(5),e=$i(),{org:n}=Dt();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const i=yc(r);let a;return t[1]!==n||t[2]!==i||t[3]!==e?(a=s=>{const o=s.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!o||!o[1])return;const l=o[1],d=i.connectionId;if(!d)return;e.invalidateQueries({queryKey:Me.collection(n.slug,d,l)});const f=l.toLowerCase().replace(/_/g," ");Ei.success(`${f} updated`)},t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var Mu="vercel.ai.error",xd=Symbol.for(Mu),Da,va,Lt=class Bu extends(va=Error,Da=xd,va){constructor({name:e,message:n,cause:r}){super(n),this[Da]=!0,this.name=e,this.cause=r}static isInstance(e){return Bu.hasMarker(e,Mu)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Fu(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Uu="AI_InvalidArgumentError",Hu=`vercel.ai.error.${Uu}`,_d=Symbol.for(Hu),Pa,Ma,yd=class extends(Ma=Lt,Pa=_d,Ma){constructor({message:t,cause:e,argument:n}){super({name:Uu,message:t,cause:e}),this[Pa]=!0,this.argument=n}static isInstance(t){return Lt.hasMarker(t,Hu)}},ju="AI_JSONParseError",zu=`vercel.ai.error.${ju}`,Ad=Symbol.for(zu),Ba,Fa,Ua=class extends(Fa=Lt,Ba=Ad,Fa){constructor({text:t,cause:e}){super({name:ju,message:`JSON parsing failed: Text: ${t}.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-DaSVftiO.js","assets/index-C1mekZiH.js","assets/index-DU53zBhA.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as V,c as W,j as m,B as $i,p as Yi,K as Me,d as yc,t as Ei,E as Ac,F as kc,H as Ve,v as Y,_ as xr,I as gu,J as Cc,L as Ic,M as Sc,Q as je,V as $n,W as Zn,s as Ee,X as G,Y as Ct,Z as Nc,$ as ye,a0 as wc,a1 as qi,a2 as Rc,h as Oc}from"./index-C1mekZiH.js";import{c as le,u as jt,B as We,I as Lc}from"./input-DaU0Ki86.js";import{u as Dt,c as dn,b as fn,T as hn,a as Eu,i as sn}from"./project-context-provider-CNg0H4Fo.js";import{E as Dc,u as vc}from"./use-binding-DgpwpEbl.js";import{P as bu,a as Tu,b as xu}from"./popover-DBs4BqBC.js";import{i as _u}from"./AlertCircle-BnQOnIUK.js";import{i as Pc}from"./error-boundary-CeUty1fN.js";import{i as Mc}from"./X-ucqgpLkV.js";import{i as Bc,c as Fc}from"./Grid01-DTA7Ao9S.js";import{i as Uc,R as Hc,f as jc,g as zc,h as $c}from"./gateway-selector-Dbt9ey6W.js";import{T as Yc}from"./textarea-DAtAmtc7.js";import{u as qc,L as Vc}from"./localstorage-keys-D0etzHKS.js";import{i as yu}from"./ChevronRight-Df7vxLuO.js";import{a as Vi}from"./Copy01-Cg-zZNgL.js";import{i as Wc}from"./Terminal-DmwCXCux.js";import{M as Au,s as Ra}from"./monaco-editor-Y-NWUHaI.js";import{b as Qc,c as Gc,d as Xc,A as Zc,a as Kc,e as Jc,g as ed,f as td}from"./alert-dialog-IBFLzL1S.js";import{i as nd}from"./File06-BXoByNkx.js";import{i as rd}from"./InfoCircle-DrzBjG0U.js";import{U as id,a as ad,c as sd,u as ud,i as Wi,b as od,E as ld}from"./use-connection-CqruT03A.js";import{O as cd,a as dd,g as fd}from"./well-known-mcp-D13f-8h2.js";import{g as hd}from"./generate-id-Dyweu44Y.js";import{s as pd}from"./Trash01-D5qtjx0n.js";const ku=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));ku.displayName="Coins01";const Cu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));Cu.displayName="CornerUpLeft";const Iu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));Iu.displayName="CurrencyDollar";const Su=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));Su.displayName="Edit02";const Nu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.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 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.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));Nu.displayName="Image01";const wu=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));wu.displayName="Lightbulb01";const Ru=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));Ru.displayName="LogOut04";const Or=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));Or.displayName="Stars01";const Ou=({size:t=24,color:e="currentColor",...n})=>V.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},V.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));Ou.displayName="Target04";function a_(){const t=W.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 n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=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:[n,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]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=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(ur,{align:"right",width:"w-3/4"}),m.jsx(ur,{align:"left",width:"w-full",lines:3}),m.jsx(ur,{align:"right",width:"w-2/3"}),m.jsx(ur,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let a;t[4]===Symbol.for("react.memo_cache_sentinel")?(a=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]=a):a=t[4];let s;t[5]===Symbol.for("react.memo_cache_sentinel")?(s=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]=s):s=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,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:[a,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[s,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]=u):u=t[6],u}function ur(t){const e=W.c(22),{align:n,width:r,lines:i}=t,a=r===void 0?"w-full":r,s=i===void 0?1:i,u=n==="right"?"flex-row-reverse":"flex-row";let o;e[0]!==u?(o=le("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=o):o=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=le("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==a?(h=le("min-w-0 rounded-2xl p-4",p,a),e[5]=p,e[6]=a,e[7]=h):h=e[7];let g;e[8]!==s?(g=Array.from({length:s}),e[8]=s,e[9]=g):g=e[9];let _;e[10]!==s||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((E,R)=>m.jsx("div",{className:le("h-3 rounded bg-muted-foreground/20 animate-pulse",R===s-1?"w-3/4":"w-full"),style:{animationDelay:`${R*.1}s`}},R))}),e[10]=s,e[11]=g,e[12]=_):_=e[12];let y;e[13]!==_||e[14]!==h?(y=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=y):y=e[15];let T;e[16]!==y||e[17]!==d?(T=m.jsxs("div",{className:d,children:[f,y]}),e[16]=y,e[17]=d,e[18]=T):T=e[18];let I;return e[19]!==T||e[20]!==o?(I=m.jsx("div",{className:o,children:T}),e[19]=T,e[20]=o,e[21]=I):I=e[21],I}var Yn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),s={};for(const u of a)s[u]=i[u];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Yn||(Yn={}));var Oa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Oa||(Oa={}));Yn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Yn.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 _r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let u=r,o=0;for(;o<s.path.length;){const l=s.path[o];o===s.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(s))):u[l]=u[l]||{_errors:[]},u=u[l],o++}}};return i(this),r}static assert(e){if(!(e instanceof _r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}_r.create=t=>new _r(t);var La;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(La||(La={}));var ee;(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"})(ee||(ee={}));function Yt(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function md(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=Yt(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>r().then(s=>a(s.transaction(e,i).objectStore(e)))}let Qr;function Lr(){return Qr||(Qr=md("keyval-store","keyval")),Qr}function Qi(t,e=Lr()){return e("readonly",n=>Yt(n.get(t)))}function Dn(t,e,n=Lr()){return n("readwrite",r=>(r.put(e,t),Yt(r.transaction)))}function Lu(t,e=Lr()){return e("readwrite",n=>(n.delete(t),Yt(n.transaction)))}function gd(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Yt(t.transaction)}function Du(t=Lr()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Yt(e.getAllKeys()),Yt(e.getAll())]).then(([r,i])=>r.map((a,s)=>[a,i[s]]));const n=[];return t("readonly",r=>gd(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Ed(t,e){const n=`${t}:threads:${e}`;return await Qi(n)??null}async function bd(t){const e=`${t}:threads:`;return(await Du()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,a)=>String(a.updated_at).localeCompare(String(i.updated_at)))}function vu(t,e){const n=`${t}:messages:`;return Du().then(r=>r.filter(([a])=>typeof a=="string"&&a.startsWith(n)).map(([,a])=>a).filter(a=>a.metadata?.thread_id===e||a.threadId===e).sort((a,s)=>{const u=a.metadata?.created_at||a.createdAt||"",o=s.metadata?.created_at||s.createdAt||"";return String(u).localeCompare(String(o))}))}function s_(t){const e=W.c(14),{locator:n}=Dt(),r=t?.gatewayId;let i;e[0]!==r||e[1]!==n?(i=Me.threads(n),e[0]=r,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==r||e[4]!==n?(a=async()=>await bd(n),e[3]=r,e[4]=n,e[5]=a):a=e[5];let s;e[6]!==i||e[7]!==a?(s={queryKey:i,queryFn:a,staleTime:3e4},e[6]=i,e[7]=a,e[8]=s):s=e[8];const{data:u,refetch:o}=Yi(s);let l;e[9]!==u?(l=u??[],e[9]=u,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d={threads:l,refetch:o},e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function Td(t){const e=W.c(11),{locator:n}=Dt();let r;e[0]!==n||e[1]!==t?(r=Me.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>vu(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r||e[7]!==i?(a={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=a):a=e[8];const{data:s}=Yi(a);let u;return e[9]!==s?(u=s??[],e[9]=s,e[10]=u):u=e[10],u}function Gi(){const t=W.c(28),{locator:e}=Dt(),n=$i();let r;t[0]!==e?(r=async y=>{const T=`${e}:threads:${y.id}`;return await Dn(T,y),y},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=y=>{n.invalidateQueries({queryKey:Me.threads(e)}),y.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,y.gatewayId)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=jt(a);let u;t[8]!==e?(u=async y=>{const{id:T,updates:I}=y,E=`${e}:threads:${T}`,R=await Qi(E);if(!R)throw new Error(`Thread ${T} not found`);const O={...R,...I};return await Dn(E,O),O},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=y=>{n.invalidateQueries({queryKey:Me.threads(e)}),n.invalidateQueries({queryKey:Me.thread(e,y.id)}),y.gatewayId&&n.invalidateQueries({queryKey:Me.gatewayThreads(e,y.gatewayId)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const d=jt(l);let f;t[16]!==e?(f=async y=>{const T=`${e}:threads:${y}`;return await Lu(T),y},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=()=>{n.invalidateQueries({queryKey:Me.threads(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=jt(h);let _;return t[24]!==g||t[25]!==s||t[26]!==d?(_={insert:s,update:d,delete:g},t[24]=g,t[25]=s,t[26]=d,t[27]=_):_=t[27],_}function Pu(){const t=W.c(37),{locator:e}=Dt(),n=$i();let r;t[0]!==e?(r=async R=>{const O=`${e}:messages:${R.id}`;return await Dn(O,R),R},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=R=>{const O=R.metadata?.thread_id||R.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=jt(a);let u;t[8]!==e?(u=async R=>(await Promise.all(R.map(O=>{const S=`${e}:messages:${O.id}`;return Dn(S,O)})),R),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=R=>{const O=new Set;for(const S of R){const v=S.metadata?.thread_id||S.threadId;v&&O.add(v)}for(const S of O)n.invalidateQueries({queryKey:Me.threadMessages(e,S)});n.invalidateQueries({queryKey:Me.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const d=jt(l);let f;t[16]!==e?(f=async R=>{const{id:O,updates:S}=R,v=`${e}:messages:${O}`,B=await Qi(v);if(!B)throw new Error(`Message ${O} not found`);const z={...B,...S};return await Dn(v,z),z},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=R=>{const O=R.metadata?.thread_id||R.threadId;O&&n.invalidateQueries({queryKey:Me.threadMessages(e,O)}),n.invalidateQueries({queryKey:Me.messages(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=jt(h);let _;t[24]!==e?(_=async R=>{const O=`${e}:messages:${R}`;return await Lu(O),R},t[24]=e,t[25]=_):_=t[25];let y;t[26]!==e||t[27]!==n?(y=()=>{n.invalidateQueries({queryKey:Me.messages(e)})},t[26]=e,t[27]=n,t[28]=y):y=t[28];let T;t[29]!==y||t[30]!==_?(T={mutationFn:_,onSuccess:y},t[29]=y,t[30]=_,t[31]=T):T=t[31];const I=jt(T);let E;return t[32]!==I||t[33]!==s||t[34]!==d||t[35]!==g?(E={insert:s,insertMany:d,update:g,delete:I},t[32]=I,t[33]=s,t[34]=d,t[35]=g,t[36]=E):E=t[36],E}function u_(){const t=W.c(5),e=$i(),{org:n}=Dt();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const i=yc(r);let a;return t[1]!==n||t[2]!==i||t[3]!==e?(a=s=>{const o=s.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!o||!o[1])return;const l=o[1],d=i.connectionId;if(!d)return;e.invalidateQueries({queryKey:Me.collection(n.slug,d,l)});const f=l.toLowerCase().replace(/_/g," ");Ei.success(`${f} updated`)},t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var Mu="vercel.ai.error",xd=Symbol.for(Mu),Da,va,Lt=class Bu extends(va=Error,Da=xd,va){constructor({name:e,message:n,cause:r}){super(n),this[Da]=!0,this.name=e,this.cause=r}static isInstance(e){return Bu.hasMarker(e,Mu)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Fu(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Uu="AI_InvalidArgumentError",Hu=`vercel.ai.error.${Uu}`,_d=Symbol.for(Hu),Pa,Ma,yd=class extends(Ma=Lt,Pa=_d,Ma){constructor({message:t,cause:e,argument:n}){super({name:Uu,message:t,cause:e}),this[Pa]=!0,this.argument=n}static isInstance(t){return Lt.hasMarker(t,Hu)}},ju="AI_JSONParseError",zu=`vercel.ai.error.${ju}`,Ad=Symbol.for(zu),Ba,Fa,Ua=class extends(Fa=Lt,Ba=Ad,Fa){constructor({text:t,cause:e}){super({name:ju,message:`JSON parsing failed: Text: ${t}.
|
|
3
3
|
Error message: ${Fu(e)}`,cause:e}),this[Ba]=!0,this.text=t}static isInstance(t){return Lt.hasMarker(t,zu)}},$u="AI_TypeValidationError",Yu=`vercel.ai.error.${$u}`,kd=Symbol.for(Yu),Ha,ja,un=class bi extends(ja=Lt,Ha=kd,ja){constructor({value:e,cause:n}){super({name:$u,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
4
4
|
Error message: ${Fu(n)}`,cause:n}),this[Ha]=!0,this.value=e}static isInstance(e){return Lt.hasMarker(e,Yu)}static wrap({value:e,cause:n}){return bi.isInstance(n)&&n.value===e?n:new bi({value:e,cause:n})}},Kn=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const a=n.length,s=new Array(e);for(let u=0;u<e;u++)s[u]=n[Math.random()*a|0];return s.join("")};if(t==null)return i;if(n.includes(r))throw new yd({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},Cd=Kn();function za(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Ht(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function $a(t,...e){const n=new Headers(Ht(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Id=/"__proto__"\s*:/,Sd=/"constructor"\s*:/;function Ya(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Id.test(t)===!1&&Sd.test(t)===!1?e:Nd(e)}function Nd(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const a=r[i];a&&typeof a=="object"&&e.push(a)}}}return t}function wd(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ya(t)}try{return Ya(t)}finally{Error.stackTraceLimit=e}}function qu(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=Ft(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(Ft):Ft(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(Ft)),t.allOf!=null&&(t.allOf=t.allOf.map(Ft)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(Ft));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=Ft(e[n]);return t}function Ft(t){return typeof t=="boolean"?t:qu(t)}var Rd=Symbol("Let zodToJsonSchema decide on which parser to use"),qa={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"},Od=t=>typeof t=="string"?{...qa,name:t}:{...qa,...t};function Ke(){return{}}function Ld(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==ee.ZodAny&&(a.items=pe(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(a.minItems=t.minLength.value),t.maxLength&&(a.maxItems=t.maxLength.value),t.exactLength&&(a.minItems=t.exactLength.value,a.maxItems=t.exactLength.value),a}function Dd(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function vd(){return{type:"boolean"}}function Vu(t,e){return pe(t.type._def,e)}var Pd=(t,e)=>pe(t.innerType._def,e);function Wu(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>Wu(t,e,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Md(t)}}var Md=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function Bd(t,e){return{...pe(t.innerType._def,e),default:t.defaultValue()}}function Fd(t,e){return e.effectStrategy==="input"?pe(t.schema._def,e):Ke()}function Ud(t){return{type:"string",enum:Array.from(t.values)}}var Hd=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function jd(t,e){const n=[pe(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),pe(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(Hd(i))r.push(...i.allOf);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...u}=i;a=u}r.push(a)}}),r.length?{allOf:r}:void 0}function zd(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 Gr=void 0,it={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:()=>(Gr===void 0&&(Gr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Gr),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 Qu(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":at(n,"email",r.message,e);break;case"format:idn-email":at(n,"idn-email",r.message,e);break;case"pattern:zod":He(n,it.email,r.message,e);break}break;case"url":at(n,"uri",r.message,e);break;case"uuid":at(n,"uuid",r.message,e);break;case"regex":He(n,r.regex,r.message,e);break;case"cuid":He(n,it.cuid,r.message,e);break;case"cuid2":He(n,it.cuid2,r.message,e);break;case"startsWith":He(n,RegExp(`^${Xr(r.value,e)}`),r.message,e);break;case"endsWith":He(n,RegExp(`${Xr(r.value,e)}$`),r.message,e);break;case"datetime":at(n,"date-time",r.message,e);break;case"date":at(n,"date",r.message,e);break;case"time":at(n,"time",r.message,e);break;case"duration":at(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{He(n,RegExp(Xr(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&at(n,"ipv4",r.message,e),r.version!=="v4"&&at(n,"ipv6",r.message,e);break}case"base64url":He(n,it.base64url,r.message,e);break;case"jwt":He(n,it.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&He(n,it.ipv4Cidr,r.message,e),r.version!=="v4"&&He(n,it.ipv6Cidr,r.message,e);break}case"emoji":He(n,it.emoji(),r.message,e);break;case"ulid":{He(n,it.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{at(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{He(n,it.base64,r.message,e);break}}break}case"nanoid":He(n,it.nanoid,r.message,e)}return n}function Xr(t,e){return e.patternStrategy==="escape"?Yd(t):t}var $d=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Yd(t){let e="";for(let n=0;n<t.length;n++)$d.has(t[n])||(e+="\\"),e+=t[n];return e}function at(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(a=>a.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function He(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(a=>a.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Va(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Va(e,r)}function Va(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source;let a="",s=!1,u=!1,o=!1;for(let l=0;l<i.length;l++){if(s){a+=i[l],s=!1;continue}if(r.i){if(u){if(i[l].match(/[a-z]/)){o?(a+=i[l],a+=`${i[l-2]}-${i[l]}`.toUpperCase(),o=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(a+=i[l],o=!0):a+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){a+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){a+=`(^|(?<=[\r
|
|
5
5
|
]))`;continue}else if(i[l]==="$"){a+=`($|(?=[\r
|
|
@@ -93,6 +93,6 @@ Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An err
|
|
|
93
93
|
`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),o=n.enter("phrasing");a.move(s+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
|
|
94
94
|
`,...a.current()});return/^[\t ]/.test(l)&&(l=Xn(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),o(),u(),l}ql.peek=AT;function ql(t){return t.value||""}function AT(){return"<"}Vl.peek=kT;function Vl(t,e,n,r){const i=ka(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const o=n.createTracker(r);let l=o.move("![");return l+=o.move(n.safe(t.alt,{before:l,after:"]",...o.current()})),l+=o.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(t.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(t.url,{before:l,after:t.title?" ":")",...o.current()}))),u(),t.title&&(u=n.enter(`title${a}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),l+=o.move(")"),s(),l}function kT(){return"!"}Wl.peek=CT;function Wl(t,e,n,r){const i=t.referenceType,a=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("![");const l=n.safe(t.alt,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=d,a(),i==="full"||!l||l!==f?o+=u.move(f+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function CT(){return"!"}Ql.peek=IT;function Ql(t,e,n){let r=t.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const s=n.unsafe[a],u=n.compilePattern(s);let o;if(s.atBreak)for(;o=u.exec(r);){let l=o.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(o.index+1)}}return i+r+i}function IT(){return"`"}function Gl(t,e){const n=ca(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Xl.peek=ST;function Xl(t,e,n,r){const i=ka(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,o;if(Gl(t,n)){const d=n.stack;n.stack=[],u=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),u(),n.stack=d,f}u=n.enter("link"),o=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(o=n.enter("destinationRaw"),l+=s.move(n.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),o(),t.title&&(o=n.enter(`title${a}`),l+=s.move(" "+i),l+=s.move(n.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),o()),l+=s.move(")"),u(),l}function ST(t,e,n){return Gl(t,n)?"<":"["}Zl.peek=NT;function Zl(t,e,n,r){const i=t.referenceType,a=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("[");const l=n.containerPhrasing(t,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const d=n.stack;n.stack=[],s=n.enter("reference");const f=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=d,a(),i==="full"||!l||l!==f?o+=u.move(f+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function NT(){return"["}function Ca(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function wT(t){const e=Ca(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function RT(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Kl(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function OT(t,e,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=t.ordered?RT(n):Ca(n);const u=t.ordered?s==="."?")":".":wT(n);let o=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(o=!0),Kl(n)===s&&d){let f=-1;for(;++f<t.children.length;){const p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(s=u),n.bulletCurrent=s;const l=n.containerFlow(t,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),l}function LT(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function DT(t,e,n,r){const i=LT(n);let a=n.bulletCurrent||Ca(n);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(s-a.length)),u.shift(s);const o=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,u.current()),d);return o(),l;function d(f,p,h){return p?(h?"":" ".repeat(s))+f:(h?a:a+" ".repeat(s-a.length))+f}}function vT(t,e,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,r);return a(),i(),s}const PT=jr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function MT(t,e,n,r){return(t.children.some(function(s){return PT(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function BT(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Jl.peek=FT;function Jl(t,e,n,r){const i=BT(n),a=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let o=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const l=o.charCodeAt(0),d=Rr(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(o=Xn(l)+o.slice(1));const f=o.charCodeAt(o.length-1),p=Rr(r.after.charCodeAt(0),f,i);p.inside&&(o=o.slice(0,-1)+Xn(f));const h=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},u+o+h}function FT(t,e,n){return n.options.strong||"*"}function UT(t,e,n,r){return n.safe(t.value,r)}function HT(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function jT(t,e,n){const r=(Kl(n)+(n.options.ruleSpaces?" ":"")).repeat(HT(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ec={blockquote:cT,break:lu,code:gT,definition:bT,emphasis:Yl,hardBreak:lu,heading:yT,html:ql,image:Vl,imageReference:Wl,inlineCode:Ql,link:Xl,linkReference:Zl,list:OT,listItem:DT,paragraph:vT,root:MT,strong:Jl,text:UT,thematicBreak:jT};function zT(){return{enter:{table:$T,tableData:cu,tableHeader:cu,tableRow:qT},exit:{codeText:VT,table:YT,tableData:gi,tableHeader:gi,tableRow:gi}}}function $T(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function YT(t){this.exit(t),this.data.inTable=void 0}function qT(t){this.enter({type:"tableRow",children:[]},t)}function gi(t){this.exit(t)}function cu(t){this.enter({type:"tableCell",children:[]},t)}function VT(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,WT));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function WT(t,e){return e==="|"?e:t}function QT(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
95
95
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:o,tableRow:u}};function s(h,g,_,y){return l(d(h,_,y),h.align)}function u(h,g,_,y){const T=f(h,_,y),I=l([T]);return I.slice(0,I.indexOf(`
|
|
96
|
-
`))}function o(h,g,_,y){const T=_.enter("tableCell"),I=_.enter("phrasing"),E=_.containerPhrasing(h,{...y,before:a,after:a});return I(),T(),E}function l(h,g){return oT(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(h,g,_){const y=h.children;let T=-1;const I=[],E=g.enter("table");for(;++T<y.length;)I[T]=f(y[T],g,_);return E(),I}function f(h,g,_){const y=h.children;let T=-1;const I=[],E=g.enter("tableRow");for(;++T<y.length;)I[T]=o(y[T],h,g,_);return E(),I}function p(h,g,_){let y=ec.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function GT(){return{exit:{taskListCheckValueChecked:du,taskListCheckValueUnchecked:du,paragraph:ZT}}}function XT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:KT}}}function du(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function ZT(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function KT(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=ec.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(d){return d+s}}function JT(){return[O2(),K2(),nT(),zT(),GT()]}function ex(t){return{extensions:[L2(),J2(t),rT(),QT(t),XT()]}}const tx={tokenize:ux,partial:!0},tc={tokenize:ox,partial:!0},nc={tokenize:lx,partial:!0},rc={tokenize:cx,partial:!0},nx={tokenize:dx,partial:!0},ic={name:"wwwAutolink",tokenize:ax,previous:sc},ac={name:"protocolAutolink",tokenize:sx,previous:uc},_t={name:"emailAutolink",tokenize:ix,previous:oc},pt={};function rx(){return{text:pt}}let Ut=48;for(;Ut<123;)pt[Ut]=_t,Ut++,Ut===58?Ut=65:Ut===91&&(Ut=97);pt[43]=_t;pt[45]=_t;pt[46]=_t;pt[95]=_t;pt[72]=[_t,ac];pt[104]=[_t,ac];pt[87]=[_t,ic];pt[119]=[_t,ic];function ix(t,e,n){const r=this;let i,a;return s;function s(f){return!zi(f)||!oc.call(r,r.previous)||Ia(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return zi(f)?(t.consume(f),u):f===64?(t.consume(f),o):n(f)}function o(f){return f===46?t.check(nx,d,l)(f):f===45||f===95||Be(f)?(a=!0,t.consume(f),o):d(f)}function l(f){return t.consume(f),i=!0,o}function d(f){return a&&i&&ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function ax(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!sc.call(r,r.previous)||Ia(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(tx,t.attempt(tc,t.attempt(nc,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function sx(t,e,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&uc.call(r,r.previous)&&!Ia(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(ze(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),o}return n(f)}function o(f){return f===47?(t.consume(f),a?l:(a=!0,o)):n(f)}function l(f){return f===null||Cr(f)||be(f)||Wt(f)||Fr(f)?n(f):t.attempt(tc,t.attempt(nc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function ux(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function ox(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(rc,o,u)(l):l===null||be(l)||Wt(l)||l!==45&&Fr(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function lx(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(rc,e,a)(s):s===null||be(s)||Wt(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function cx(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||be(u)||Wt(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||be(u)||Wt(u)?e(u):r(u)}function a(u){return ze(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):ze(u)?(t.consume(u),s):n(u)}}function dx(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return Be(a)?n(a):e(a)}}function sc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||be(t)}function uc(t){return!ze(t)}function oc(t){return!(t===47||zi(t))}function zi(t){return t===43||t===45||t===46||t===95||Be(t)}function Ia(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const fx={tokenize:xx,partial:!0};function hx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ex,continuation:{tokenize:bx},exit:Tx}},text:{91:{name:"gfmFootnoteCall",tokenize:gx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:px,resolveTo:mx}}}}function px(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=st(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function mx(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function gx(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),o}function o(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(a>999||f===93&&!s||f===null||f===91||be(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(st(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return be(f)||(s=!0),a++,t.consume(f),f===92?d:l}function d(f){return f===91||f===92||f===93?(t.consume(f),a++,l):l(f)}}function Ex(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(s>999||g===93&&!u||g===null||g===91||be(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return a=st(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return be(g)||(u=!0),s++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),s++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),oe(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function bx(t,e,n){return t.check(rr,e,t.attempt(fx,e,n))}function Tx(t){t.exit("gfmFootnoteDefinition")}function xx(t,e,n){const r=this;return oe(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function _x(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},p=[["enter",d,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&Ze(p,p.length,0,Ur(h,s.slice(l+1,o),u)),Ze(p,p.length,0,[["exit",f,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",d,u]]),Ze(s,l-1,o-l+3,p),o=l+p.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,d=this.events;let f=0;return p;function p(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=on(l);if(g===126)return f>1?o(g):(s.consume(g),f++,h);if(f<2&&!n)return o(g);const y=s.exit("strikethroughSequenceTemporary"),T=on(g);return y._open=!T||T===2&&!!_,y._close=!_||_===2&&!!T,u(g)}}}class yx{constructor(){this.map=[]}add(e,n,r){Ax(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const a of i)e.push(a);i=r.pop()}this.map.length=0}}function Ax(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function kx(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function Cx(){return{flow:{null:{name:"table",tokenize:Ix,resolveAll:Sx}}}}function Ix(t,e,n){const r=this;let i=0,a=0,s;return u;function u(N){let F=r.events.length-1;for(;F>-1;){const q=r.events[F][1].type;if(q==="lineEnding"||q==="linePrefix")F--;else break}const P=F>-1?r.events[F][1].type:null,X=P==="tableHead"||P==="tableRow"?S:o;return X===S&&r.parser.lazy[r.now().line]?n(N):X(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),d(N)}function d(N){return N===null?n(N):Q(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),h):n(N):ie(N)?oe(t,d,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,d):(t.enter("data"),f(N)))}function f(N){return N===null||N===124||be(N)?(t.exit("data"),d(N)):(t.consume(N),N===92?p:f)}function p(N){return N===92||N===124?(t.consume(N),f):f(N)}function h(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,ie(N)?oe(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?y(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),_):O(N)}function _(N){return ie(N)?oe(t,y,"whitespace")(N):y(N)}function y(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),T):N===45?(a+=1,T(N)):N===null||Q(N)?R(N):O(N)}function T(N){return N===45?(t.enter("tableDelimiterFiller"),I(N)):O(N)}function I(N){return N===45?(t.consume(N),I):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):(t.exit("tableDelimiterFiller"),E(N))}function E(N){return ie(N)?oe(t,R,"whitespace")(N):R(N)}function R(N){return N===124?g(N):N===null||Q(N)?!s||i!==a?O(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):O(N)}function O(N){return n(N)}function S(N){return t.enter("tableRow"),v(N)}function v(N){return N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),v):N===null||Q(N)?(t.exit("tableRow"),e(N)):ie(N)?oe(t,v,"whitespace")(N):(t.enter("data"),B(N))}function B(N){return N===null||N===124||be(N)?(t.exit("data"),v(N)):(t.consume(N),N===92?z:B)}function z(N){return N===92||N===124?(t.consume(N),B):B(N)}}function Sx(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,d,f;const p=new yx;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(fu(p,e,o,l,d),d=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=hr(p,e,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=hr(p,e,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],f=hr(p,e,a,i,n,f)):s[1]!==0&&(f=hr(p,e,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&fu(p,e,o,l,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=kx(e.events,n))}return t}function hr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},nn(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=nn(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=nn(e.events,n[2]),d=nn(e.events,n[3]),f={type:u,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(a.end=Object.assign({},nn(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function fu(t,e,n,r,i){const a=[],s=nn(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function nn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const Nx={name:"tasklistCheck",tokenize:Rx};function wx(){return{text:{91:Nx}}}function Rx(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return be(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return Q(o)?e(o):ie(o)?t.check({tokenize:Ox},e,n)(o):n(o)}}function Ox(t,e,n){return oe(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function Lx(t){return Bo([rx(),hx(),_x(t),Cx(),wx()])}const Dx={};function vx(t){const e=this,n=t||Dx,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Lx(n)),a.push(JT()),s.push(ex(n))}const Px=V.lazy(()=>Rc(()=>import("./lazy-highlighter-QHCwZ7Bv.js"),__vite__mapDeps([0,1,2])));function lc(){const t=W.c(3),[e,n]=V.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function Mx(){const t=W.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(Bx)}),t[1]=r):r=t[1],r}function Bx(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function Fx(t){const e=W.c(12),n=V.useRef(null),{handleCopy:r,copied:i}=lc(),a=Ux;let s;e[0]!==r?(s=async()=>{const p=a(n.current);await r(p)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(sn,{size:12}):m.jsx(Vi,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(We,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==l||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[l,d]}),e[9]=l,e[10]=d,e[11]=f):f=e[11],f}function Ux(t){return t?Array.from(t.querySelectorAll("tr")).map(Hx).join(`
|
|
96
|
+
`))}function o(h,g,_,y){const T=_.enter("tableCell"),I=_.enter("phrasing"),E=_.containerPhrasing(h,{...y,before:a,after:a});return I(),T(),E}function l(h,g){return oT(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(h,g,_){const y=h.children;let T=-1;const I=[],E=g.enter("table");for(;++T<y.length;)I[T]=f(y[T],g,_);return E(),I}function f(h,g,_){const y=h.children;let T=-1;const I=[],E=g.enter("tableRow");for(;++T<y.length;)I[T]=o(y[T],h,g,_);return E(),I}function p(h,g,_){let y=ec.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function GT(){return{exit:{taskListCheckValueChecked:du,taskListCheckValueUnchecked:du,paragraph:ZT}}}function XT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:KT}}}function du(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function ZT(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function KT(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=ec.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(d){return d+s}}function JT(){return[O2(),K2(),nT(),zT(),GT()]}function ex(t){return{extensions:[L2(),J2(t),rT(),QT(t),XT()]}}const tx={tokenize:ux,partial:!0},tc={tokenize:ox,partial:!0},nc={tokenize:lx,partial:!0},rc={tokenize:cx,partial:!0},nx={tokenize:dx,partial:!0},ic={name:"wwwAutolink",tokenize:ax,previous:sc},ac={name:"protocolAutolink",tokenize:sx,previous:uc},_t={name:"emailAutolink",tokenize:ix,previous:oc},pt={};function rx(){return{text:pt}}let Ut=48;for(;Ut<123;)pt[Ut]=_t,Ut++,Ut===58?Ut=65:Ut===91&&(Ut=97);pt[43]=_t;pt[45]=_t;pt[46]=_t;pt[95]=_t;pt[72]=[_t,ac];pt[104]=[_t,ac];pt[87]=[_t,ic];pt[119]=[_t,ic];function ix(t,e,n){const r=this;let i,a;return s;function s(f){return!zi(f)||!oc.call(r,r.previous)||Ia(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return zi(f)?(t.consume(f),u):f===64?(t.consume(f),o):n(f)}function o(f){return f===46?t.check(nx,d,l)(f):f===45||f===95||Be(f)?(a=!0,t.consume(f),o):d(f)}function l(f){return t.consume(f),i=!0,o}function d(f){return a&&i&&ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function ax(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!sc.call(r,r.previous)||Ia(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(tx,t.attempt(tc,t.attempt(nc,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function sx(t,e,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&uc.call(r,r.previous)&&!Ia(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(ze(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),o}return n(f)}function o(f){return f===47?(t.consume(f),a?l:(a=!0,o)):n(f)}function l(f){return f===null||Cr(f)||be(f)||Wt(f)||Fr(f)?n(f):t.attempt(tc,t.attempt(nc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function ux(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function ox(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(rc,o,u)(l):l===null||be(l)||Wt(l)||l!==45&&Fr(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function lx(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(rc,e,a)(s):s===null||be(s)||Wt(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function cx(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||be(u)||Wt(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||be(u)||Wt(u)?e(u):r(u)}function a(u){return ze(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):ze(u)?(t.consume(u),s):n(u)}}function dx(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return Be(a)?n(a):e(a)}}function sc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||be(t)}function uc(t){return!ze(t)}function oc(t){return!(t===47||zi(t))}function zi(t){return t===43||t===45||t===46||t===95||Be(t)}function Ia(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const fx={tokenize:xx,partial:!0};function hx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ex,continuation:{tokenize:bx},exit:Tx}},text:{91:{name:"gfmFootnoteCall",tokenize:gx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:px,resolveTo:mx}}}}function px(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=st(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function mx(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function gx(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),o}function o(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(a>999||f===93&&!s||f===null||f===91||be(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(st(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return be(f)||(s=!0),a++,t.consume(f),f===92?d:l}function d(f){return f===91||f===92||f===93?(t.consume(f),a++,l):l(f)}}function Ex(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(s>999||g===93&&!u||g===null||g===91||be(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return a=st(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return be(g)||(u=!0),s++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),s++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),oe(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function bx(t,e,n){return t.check(rr,e,t.attempt(fx,e,n))}function Tx(t){t.exit("gfmFootnoteDefinition")}function xx(t,e,n){const r=this;return oe(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function _x(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},p=[["enter",d,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&&Ze(p,p.length,0,Ur(h,s.slice(l+1,o),u)),Ze(p,p.length,0,[["exit",f,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",d,u]]),Ze(s,l-1,o-l+3,p),o=l+p.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,d=this.events;let f=0;return p;function p(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?o(g):(s.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=on(l);if(g===126)return f>1?o(g):(s.consume(g),f++,h);if(f<2&&!n)return o(g);const y=s.exit("strikethroughSequenceTemporary"),T=on(g);return y._open=!T||T===2&&!!_,y._close=!_||_===2&&!!T,u(g)}}}class yx{constructor(){this.map=[]}add(e,n,r){Ax(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const a of i)e.push(a);i=r.pop()}this.map.length=0}}function Ax(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function kx(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function Cx(){return{flow:{null:{name:"table",tokenize:Ix,resolveAll:Sx}}}}function Ix(t,e,n){const r=this;let i=0,a=0,s;return u;function u(N){let F=r.events.length-1;for(;F>-1;){const q=r.events[F][1].type;if(q==="lineEnding"||q==="linePrefix")F--;else break}const P=F>-1?r.events[F][1].type:null,X=P==="tableHead"||P==="tableRow"?S:o;return X===S&&r.parser.lazy[r.now().line]?n(N):X(N)}function o(N){return t.enter("tableHead"),t.enter("tableRow"),l(N)}function l(N){return N===124||(s=!0,a+=1),d(N)}function d(N){return N===null?n(N):Q(N)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),h):n(N):ie(N)?oe(t,d,"whitespace")(N):(a+=1,s&&(s=!1,i+=1),N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),s=!0,d):(t.enter("data"),f(N)))}function f(N){return N===null||N===124||be(N)?(t.exit("data"),d(N)):(t.consume(N),N===92?p:f)}function p(N){return N===92||N===124?(t.consume(N),f):f(N)}function h(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(t.enter("tableDelimiterRow"),s=!1,ie(N)?oe(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?y(N):N===124?(s=!0,t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),_):O(N)}function _(N){return ie(N)?oe(t,y,"whitespace")(N):y(N)}function y(N){return N===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),T):N===45?(a+=1,T(N)):N===null||Q(N)?R(N):O(N)}function T(N){return N===45?(t.enter("tableDelimiterFiller"),I(N)):O(N)}function I(N){return N===45?(t.consume(N),I):N===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(N),t.exit("tableDelimiterMarker"),E):(t.exit("tableDelimiterFiller"),E(N))}function E(N){return ie(N)?oe(t,R,"whitespace")(N):R(N)}function R(N){return N===124?g(N):N===null||Q(N)?!s||i!==a?O(N):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(N)):O(N)}function O(N){return n(N)}function S(N){return t.enter("tableRow"),v(N)}function v(N){return N===124?(t.enter("tableCellDivider"),t.consume(N),t.exit("tableCellDivider"),v):N===null||Q(N)?(t.exit("tableRow"),e(N)):ie(N)?oe(t,v,"whitespace")(N):(t.enter("data"),B(N))}function B(N){return N===null||N===124||be(N)?(t.exit("data"),v(N)):(t.consume(N),N===92?z:B)}function z(N){return N===92||N===124?(t.consume(N),B):B(N)}}function Sx(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,d,f;const p=new yx;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,o!==0&&(fu(p,e,o,l,d),d=void 0,o=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=hr(p,e,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=hr(p,e,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):g.type==="tableHead"?(u=!0,o=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],f=hr(p,e,a,i,n,f)):s[1]!==0&&(f=hr(p,e,s,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&fu(p,e,o,l,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=kx(e.events,n))}return t}function hr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},nn(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=nn(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=nn(e.events,n[2]),d=nn(e.events,n[3]),f={type:u,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return i!==void 0&&(a.end=Object.assign({},nn(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function fu(t,e,n,r,i){const a=[],s=nn(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function nn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const Nx={name:"tasklistCheck",tokenize:Rx};function wx(){return{text:{91:Nx}}}function Rx(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return be(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return Q(o)?e(o):ie(o)?t.check({tokenize:Ox},e,n)(o):n(o)}}function Ox(t,e,n){return oe(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function Lx(t){return Bo([rx(),hx(),_x(t),Cx(),wx()])}const Dx={};function vx(t){const e=this,n=t||Dx,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Lx(n)),a.push(JT()),s.push(ex(n))}const Px=V.lazy(()=>Rc(()=>import("./lazy-highlighter-DaSVftiO.js"),__vite__mapDeps([0,1,2])));function lc(){const t=W.c(3),[e,n]=V.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function Mx(){const t=W.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(Bx)}),t[1]=r):r=t[1],r}function Bx(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function Fx(t){const e=W.c(12),n=V.useRef(null),{handleCopy:r,copied:i}=lc(),a=Ux;let s;e[0]!==r?(s=async()=>{const p=a(n.current);await r(p)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?m.jsx(sn,{size:12}):m.jsx(Vi,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(We,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==l||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[l,d]}),e[9]=l,e[10]=d,e[11]=f):f=e[11],f}function Ux(t){return t?Array.from(t.querySelectorAll("tr")).map(Hx).join(`
|
|
97
97
|
`):""}function Hx(t){return Array.from(t.querySelectorAll("th,td")).map(jx).join(",")}function jx(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const zx=[vx],$x=[C2],Yx={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-sm mb-2 last:mb-0"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-sm"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-sm font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-sm font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(Fx,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},cc=V.memo(t=>{const e=W.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(lg,{remarkPlugins:zx,rehypePlugins:$x,components:Yx,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function qx(t){const e=W.c(20),{language:n,content:r}=t,{handleCopy:i,copied:a}=lc(),s=n||"text";let u;e[0]!==s?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:s}),e[0]=s,e[1]=u):u=e[1];let o;e[2]!==r||e[3]!==i?(o=()=>i(r),e[2]=r,e[3]=i,e[4]=o):o=e[4];let l;e[5]!==a?(l=a?m.jsx(sn,{size:14}):m.jsx(Vi,{size:14}),e[5]=a,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=m.jsx(We,{size:"icon",variant:"ghost",onClick:o,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:l}),e[7]=o,e[8]=l,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(Mx,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(V.Suspense,{fallback:p,children:m.jsx(Px,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}cc.displayName="MemoizedMarkdownBlock";const Sa=t=>{const e=W.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=he.lexer(r),e[0]=r,e[1]=i):i=e[1];const a=i;let s;if(e[2]!==a||e[3]!==n){let u;e[5]!==n?(u=(o,l)=>o.type==="code"?m.jsx(qx,{language:o.lang,content:o.text},`${n}-block_${l}`):m.jsx(cc,{content:o.raw},`${n}-block_${l}`),e[5]=n,e[6]=u):u=e[6],s=a.map(u),e[2]=a,e[3]=n,e[4]=s}else s=e[4];return s};Sa.displayName="MemoizedMarkdown";function dc(t){const e=W.c(18),{id:n,part:r,copyable:i,extraActions:a,hasToolCallAfter:s}=t,u=i===void 0?!1:i,o=s===void 0?!1:s,{handleCopy:l}=xh(),[d,f]=V.useState(!1);let p;e[0]!==l||e[1]!==r.text?(p=async()=>{await l(r.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=l,e[1]=r.text,e[2]=p):p=e[2];const h=p,g=u&&a,_=g||a,y=!o&&"mb-2";let T;e[3]!==y?(T=le("group/part relative",y),e[3]=y,e[4]=T):T=e[4];let I;e[5]!==n||e[6]!==r.text?(I=m.jsx(Sa,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=I):I=e[7];let E;e[8]!==a||e[9]!==h||e[10]!==d||e[11]!==_||e[12]!==g?(E=_&&m.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(We,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:d?m.jsx(sn,{size:12}):m.jsx(Vi,{size:12})}),a]})}),e[8]=a,e[9]=h,e[10]=d,e[11]=_,e[12]=g,e[13]=E):E=e[13];let R;return e[14]!==T||e[15]!==I||e[16]!==E?(R=m.jsxs("div",{className:T,children:[I,E]}),e[14]=T,e[15]=I,e[16]=E,e[17]=R):R=e[17],R}function Vx(t){const e=W.c(4),{output:n}=t;let r;if(e[0]!==n){const s=JSON.stringify(n,null,2);r=s.length>2e3?s.slice(0,2e3)+"...[TRUNCATED]":s,e[0]=n,e[1]=r}else r=e[1];const i=r;let a;return e[2]!==i?(a=m.jsx("div",{className:"h-full",children:m.jsx(Au,{code:i,language:"json",height:"100%",readOnly:!0})}),e[2]=i,e[3]=a):a=e[3],a}function hu(t){const e=W.c(35),{part:n}=t,{state:r}=n;let i;e[0]!==n?(i="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=i):i=e[1];const a=i,[s,u]=V.useState(!1),o=(r==="input-streaming"||r==="input-available"||r==="output-available")&&!!n.input,l=r==="output-available",d=r==="output-error";let f;e[2]!==s?(f=()=>u(!s),e[2]=s,e[3]=f):f=e[3];let p;e[4]!==r?(p=r==="output-error"?m.jsx(_u,{className:"size-4 text-destructive shrink-0"}):m.jsx(Wc,{className:le("size-4 text-muted-foreground shrink-0",(r==="input-streaming"||r==="input-available")&&"shimmer")}),e[4]=r,e[5]=p):p=e[5];const h=r==="output-error"&&"text-destructive/90",g=(r==="input-streaming"||r==="input-available")&&"shimmer";let _;e[6]!==h||e[7]!==g?(_=le("text-xs font-medium text-muted-foreground truncate",h,g),e[6]=h,e[7]=g,e[8]=_):_=e[8];const y=r==="input-streaming"&&`Streaming ${a} arguments`,T=r==="input-available"&&`Calling ${a}`,I=r==="output-available"&&`Called ${a}`,E=r==="output-error"&&`Error calling ${a}`;let R;e[9]!==E||e[10]!==_||e[11]!==y||e[12]!==T||e[13]!==I?(R=m.jsxs("span",{className:_,children:[y,T,I,E]}),e[9]=E,e[10]=_,e[11]=y,e[12]=T,e[13]=I,e[14]=R):R=e[14];let O;e[15]!==R||e[16]!==p?(O=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[p,R]}),e[15]=R,e[16]=p,e[17]=O):O=e[17];const S=s&&"rotate-90";let v;e[18]!==S?(v=le("size-4 text-muted-foreground transition-transform",S),e[18]=S,e[19]=v):v=e[19];let B;e[20]!==v?(B=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(yu,{className:v})}),e[20]=v,e[21]=B):B=e[21];let z;e[22]!==O||e[23]!==B||e[24]!==f?(z=m.jsxs("button",{type:"button",onClick:f,className:"flex items-center gap-2 w-full cursor-pointer p-3",children:[O,B]}),e[22]=O,e[23]=B,e[24]=f,e[25]=z):z=e[25];let N;e[26]!==s||e[27]!==n||e[28]!==d||e[29]!==o||e[30]!==l?(N=s&&m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[o&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:m.jsx(Au,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),l&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:m.jsx(Vx,{output:n.output})})]}),d&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]})]})]}),e[26]=s,e[27]=n,e[28]=d,e[29]=o,e[30]=l,e[31]=N):N=e[31];let F;return e[32]!==z||e[33]!==N?(F=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[z,N]})}),e[32]=z,e[33]=N,e[34]=F):F=e[34],F}const Wx={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function Qx(t){if(!t?.providerMetadata)return null;for(const e of Object.values(Wx)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function Gx(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+(Qx(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Xx(t){const e=W.c(38),{messages:n}=t;let r,i,a,s,u,o,l,d,f,p,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const R=Gx(n);if(!R){g=null;break e}const{totalTokens:O,inputTokens:S,outputTokens:v,cost:B}=R;if(a=B,!O&&!S&&!v){g=null;break e}i=dn;let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=m.jsx(ku,{size:12}),e[13]=z):z=e[13];const N=m.jsxs(We,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[z,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:O.toLocaleString()})]});e[14]!==N?(h=m.jsx(fn,{asChild:!0,children:N}),e[14]=N,e[15]=h):h=e[15],r=hn,f="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=o):o=e[16],l=m.jsx("span",{children:S.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=e[17],s=v.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=s,e[5]=u,e[6]=o,e[7]=l,e[8]=d,e[9]=f,e[10]=p,e[11]=h,e[12]=g}else r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],o=e[6],l=e[7],d=e[8],f=e[9],p=e[10],h=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let _;e[18]!==s?(_=m.jsx("span",{children:s}),e[18]=s,e[19]=_):_=e[19];let y;e[20]!==a?(y=a>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",a.toFixed(4)]})]}),e[20]=a,e[21]=y):y=e[21];let T;e[22]!==_||e[23]!==y||e[24]!==u||e[25]!==o||e[26]!==l||e[27]!==d?(T=m.jsxs("div",{className:u,children:[o,l,d,_,y]}),e[22]=_,e[23]=y,e[24]=u,e[25]=o,e[26]=l,e[27]=d,e[28]=T):T=e[28];let I;e[29]!==r||e[30]!==T||e[31]!==f||e[32]!==p?(I=m.jsx(r,{side:f,className:p,children:T}),e[29]=r,e[30]=T,e[31]=f,e[32]=p,e[33]=I):I=e[33];let E;return e[34]!==i||e[35]!==I||e[36]!==h?(E=m.jsxs(i,{children:[h,I]}),e[34]=i,e[35]=I,e[36]=h,e[37]=E):E=e[37],E}const Zx={planning:{icon:m.jsx(Ou,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(Or,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},Kx=1200;function Jx(){const t=W.c(7),[e,n]=V.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},Kx);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),V.useEffect(r,i);const a=Zx[e];let s;t[2]!==a.label?(s=m.jsxs("span",{className:"text-xs text-muted-foreground shimmer",children:[a.label,"..."]}),t[2]=a.label,t[3]=s):s=t[3];let u;return t[4]!==a.icon||t[5]!==s?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[a.icon,s]})}),t[4]=a.icon,t[5]=s,t[6]=u):u=t[6],u}function e3(t){const e=W.c(10),{duration:n,parts:r,id:i}=t,a=n/1e3;let s;e[0]!==a?(s=a.toFixed(1),e[0]=a,e[1]=s):s=e[1];const u=s,[o,l]=V.useState(!1),[d,f]=V.useState(!1);let p;if(e[2]!==i||e[3]!==d||e[4]!==o||e[5]!==r||e[6]!==u){const h=r.filter(n3),g=h.some(t3),_=g||d;let y,T;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),T=()=>l(!1),e[8]=y,e[9]=T):(y=e[8],T=e[9]),p=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&f(!d),onMouseEnter:y,onMouseLeave:T,className:le("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(Or,{className:"text-muted-foreground shrink-0 shimmer",size:14}):o?m.jsx(yu,{className:le("text-muted-foreground transition-transform shrink-0",d&&"rotate-90"),size:14}):m.jsx(wu,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:le("text-xs text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),_&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:h.map((I,E)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(Sa,{id:`${i}-reasoning-${E}`,text:I.text})},`${i}-reasoning-${E}`))})]}),e[2]=i,e[3]=d,e[4]=o,e[5]=r,e[6]=u,e[7]=p}else p=e[7];return p}function t3(t){return t.state==="streaming"}function n3(t){return t.type==="reasoning"}function r3(t){const e=W.c(11),{part:n,id:r,usageStats:i,isFollowedByToolCall:a}=t;switch(n.type){case"dynamic-tool":{let s;return e[0]!==r||e[1]!==n?(s=m.jsx(hu,{part:n,id:r}),e[0]=r,e[1]=n,e[2]=s):s=e[2],s}case"text":{let s;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==i?(s=m.jsx(dc,{id:r,part:n,extraActions:i,copyable:!0,hasToolCallAfter:a}),e[3]=r,e[4]=a,e[5]=n,e[6]=i,e[7]=s):s=e[7],s}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const s=n;let u;return e[8]!==r||e[9]!==s?(u=m.jsx(hu,{part:s,id:r}),e[8]=r,e[9]=s,e[10]=u):u=e[10],u}}throw new Error(`Unknown part type: ${n.type}`)}function i3(t){const e=W.c(32),{message:n,status:r,className:i}=t,{id:a,parts:s}=n,l=r==="streaming"||r==="submitted",d=V.useRef(null);let f;e[0]!==a?(f=()=>{const q=localStorage.getItem(`msg-duration-${a}`);return q?Number(q):null},e[0]=a,e[1]=f):f=e[1];const[p,h]=V.useState(f);let g,_;e[2]!==l?(g=()=>{l&&d.current===null&&(d.current=Date.now())},_=[l],e[2]=l,e[3]=g,e[4]=_):(g=e[3],_=e[4]),V.useEffect(g,_);let y,T;e[5]!==p||e[6]!==a||e[7]!==s.length?(y=()=>{if(s.length>0&&p===null&&d.current!==null){const q=Date.now()-d.current;h(q),localStorage.setItem(`msg-duration-${a}`,q.toString())}},T=[s.length,p,a],e[5]=p,e[6]=a,e[7]=s.length,e[8]=y,e[9]=T):(y=e[8],T=e[9]),V.useEffect(y,T);const I=s.length>0;let E;e[10]!==s?(E=s.some(s3),e[10]=s,e[11]=E):E=e[11];const R=E;let O;e[12]!==l||e[13]!==s?(O=l&&s.some(a3),e[12]=l,e[13]=s,e[14]=O):O=e[14];const v=I&&(R||O)&&p!==null;let B;e[15]!==n?(B=m.jsx(Xx,{messages:[n]}),e[15]=n,e[16]=B):B=e[16];const z=B;let N;e[17]!==i?(N=le("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[17]=i,e[18]=N):N=e[18];let F;e[19]!==p||e[20]!==I||e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==v||e[25]!==z?(F=I?m.jsxs(m.Fragment,{children:[v&&m.jsx(e3,{duration:p,parts:s,id:a}),s.map((q,j)=>{const Z=s[j+1],te=Z&&(Z.type==="dynamic-tool"||Z.type.startsWith("tool-"));return m.jsx(r3,{part:q,id:a,usageStats:j===s.length-1?z:void 0,isFollowedByToolCall:te},`${a}-${j}`)})]}):l?m.jsx(Jx,{}):null,e[19]=p,e[20]=I,e[21]=a,e[22]=l,e[23]=s,e[24]=v,e[25]=z,e[26]=F):F=e[26];let P;e[27]!==F?(P=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-sm wrap-break-word overflow-wrap-anywhere bg-transparent",children:F})}),e[27]=F,e[28]=P):P=e[28];let X;return e[29]!==P||e[30]!==N?(X=m.jsx("div",{className:N,children:P}),e[29]=P,e[30]=N,e[31]=X):X=e[31],X}function a3(t){return t.type==="reasoning"&&t.state==="streaming"}function s3(t){return t.type==="reasoning"}const fc=V.createContext(null);function hc(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function u3(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!V.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const a=t[n-1],s=V.isValidElement(a)&&a.props?.message?.role,u=a&&V.isValidElement(a)&&s==="user"?a:null;e.push({user:u,assistant:r})}}return e}function o3(t){const e=W.c(27),{children:n,className:r,minHeightOffset:i}=t,a=V.useRef(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const u=V.useRef(s);let o,l,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const I=V.Children.toArray(n),E=I[I.length-1];l=E&&V.isValidElement(E)&&E.type===hc?E:null;const R=l?I.slice(0,-1):I,O=u3(R);let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=B=>{const z=u.current[B];if(z&&a.current){const N=a.current.offsetTop,F=z.offsetTop;a.current.scrollTo({top:F-N,behavior:"smooth"})}},e[11]=S):S=e[11];const v=S;o=fc.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:v},e[12]=g):g=e[12],p=a,e[13]!==r?(h=le("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=O.map((B,z)=>{const N=z===O.length-1;return m.jsxs("div",{ref:F=>{u.current[z]=F},className:"flex flex-col pb-2",style:N&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:B.user&&V.isValidElement(B.user)?V.cloneElement(B.user,{pairIndex:z}):B.user}),B.assistant]},z)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else o=e[4],l=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let _;e[15]!==l||e[16]!==d||e[17]!==f?(_=m.jsxs("div",{className:d,children:[f,l]}),e[15]=l,e[16]=d,e[17]=f,e[18]=_):_=e[18];let y;e[19]!==p||e[20]!==h||e[21]!==_?(y=m.jsx("div",{ref:p,className:h,children:_}),e[19]=p,e[20]=h,e[21]=_,e[22]=y):y=e[22];let T;return e[23]!==o||e[24]!==g||e[25]!==y?(T=m.jsx(o,{value:g,children:y}),e[23]=o,e[24]=g,e[25]=y,e[26]=T):T=e[26],T}function l3(t){const e=W.c(5),{locator:n}=Dt(),r=Pu(),i=Gi();let a;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==i?(a=async(u,o,l)=>{const d=await vu(n,l),f=d.findIndex(y=>y.id===u);if(f===-1){console.warn(`[branch] Message ${u} not found in thread ${l}`);return}const p=d.slice(0,f).filter(c3),h=crypto.randomUUID(),g=new Date().toISOString(),_={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await i.insert.mutateAsync(_),p.length>0){const y=p.map(T=>({...T,id:crypto.randomUUID(),metadata:{...T.metadata,thread_id:h,created_at:T.metadata?.created_at||g}}));await r.insertMany.mutateAsync(y)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=i,e[4]=a):a=e[4],a}function c3(t){return t.role!=="system"}function d3(t){const e=W.c(18),{messageId:n,parts:r}=t,[i,a]=V.useState(!1),{setInputValue:s,startBranch:u,setActiveThreadId:o,activeThreadId:l}=ph(),d=l3(o);let f;e[0]!==r?(f=r.filter(h3).map(f3).join(`
|
|
98
98
|
`),e[0]=r,e[1]=f):f=e[1];const p=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=S=>{S.stopPropagation(),a(!0)},e[2]=h):h=e[2];const g=h;let _;e[3]!==l||e[4]!==d||e[5]!==n||e[6]!==p||e[7]!==s||e[8]!==u?(_=async()=>{await d(n,p,l),s(p),u({originalThreadId:l,originalMessageId:n,originalMessageText:p}),a(!1)},e[3]=l,e[4]=d,e[5]=n,e[6]=p,e[7]=s,e[8]=u,e[9]=_):_=e[9];const y=_;let T;e[10]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(dn,{children:[m.jsx(fn,{asChild:!0,children:m.jsx(We,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(Su,{size:16,className:"p-0.5"})})}),m.jsx(hn,{side:"bottom",children:"Edit message"})]})}),e[10]=T):T=e[10];let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsxs(Qc,{children:[m.jsx(Gc,{children:"Edit message?"}),m.jsx(Xc,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=I):I=e[11];let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Zc,{children:"Cancel"}),e[12]=E):E=e[12];let R;e[13]!==y?(R=m.jsxs(Kc,{children:[I,m.jsxs(Jc,{children:[E,m.jsx(ed,{onClick:y,children:"Confirm"})]})]}),e[13]=y,e[14]=R):R=e[14];let O;return e[15]!==i||e[16]!==R?(O=m.jsxs(m.Fragment,{children:[T,m.jsx(td,{open:i,onOpenChange:a,children:R})]}),e[15]=i,e[16]=R,e[17]=O):O=e[17],O}function f3(t){return t.text}function h3(t){return t.type==="text"}function p3(t){const e=W.c(29),{message:n,className:r,pairIndex:i}=t,{id:a,parts:s}=n,u=V.useContext(fc),[o,l]=V.useState(!1);if(!s||s.length===0)return null;let d;e[0]!==u||e[1]!==i?(d=()=>{l(!0),i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=d):d=e[2];const f=d;let p;e[3]!==r?(p=le("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=p):p=e[4];let h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>l(!0),g=()=>l(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const _=o?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let y;e[7]!==_?(y=le("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",_),e[7]=_,e[8]=y):y=e[8];let T;if(e[9]!==a||e[10]!==s){let v;e[12]!==a?(v=(B,z)=>B.type==="text"?m.jsx(dc,{id:a,part:B},`${a}-${z}`):null,e[12]=a,e[13]=v):v=e[13],T=s.map(v),e[9]=a,e[10]=s,e[11]=T}else T=e[11];let I;e[14]!==T?(I=m.jsx("div",{children:T}),e[14]=T,e[15]=I):I=e[15];let E;e[16]!==y||e[17]!==I?(E=m.jsx("div",{className:y,children:I}),e[16]=y,e[17]=I,e[18]=E):E=e[18];let R;e[19]!==a||e[20]!==s?(R=m.jsx(d3,{messageId:a,parts:s}),e[19]=a,e[20]=s,e[21]=R):R=e[21];let O;e[22]!==f||e[23]!==R||e[24]!==E?(O=m.jsxs("div",{tabIndex:0,onClick:f,onFocus:h,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[E,R]}),e[22]=f,e[23]=R,e[24]=E,e[25]=O):O=e[25];let S;return e[26]!==O||e[27]!==p?(S=m.jsx(m.Fragment,{children:m.jsx("div",{className:p,children:O})}),e[26]=O,e[27]=p,e[28]=S):S=e[28],S}function m3(t,e){const n=W.c(4);let r;n[0]!==e?(r=e===void 0?{}:e,n[0]=e,n[1]=r):r=n[1];const i=r,a=t??id;let s;return n[2]!==a?(s=sd(a),n[2]=a,n[3]=s):s=n[3],ad(a,"LLM",s,i)}function g3(){const t=W.c(9),e=ud();let n;t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1];const[r]=vc(n);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={pageSize:999},t[2]=i):i=t[2];const a=m3(r?.id,i);if(!a||!r){let u;return t[3]===Symbol.for("react.memo_cache_sentinel")?(u=[],t[3]=u):u=t[3],u}let s;if(t[4]!==r||t[5]!==a){let u;t[7]!==r?(u=o=>({...o,name:o.title,contextWindow:o.limits?.contextWindow,outputLimit:o.limits?.maxOutputTokens,inputCost:o.costs?.input,outputCost:o.costs?.output,provider:o.provider,connectionId:r.id,connectionName:r.title}),t[7]=r,t[8]=u):u=t[8],s=a.map(u).sort(E3),t[4]=r,t[5]=a,t[6]=s}else s=t[6];return s}function E3(t,e){return t.name.localeCompare(e.name)}const b3={reasoning:{icon:m.jsx(Or,{className:"size-4"}),bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:m.jsx(Nu,{className:"size-4"}),bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:m.jsx(nd,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:m.jsx(Wi,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},pc=V.memo(function(e){const n=W.c(11),{capability:r}=e,i=b3[r];let a;n[0]!==r||n[1]!==i?(a=i||{icon:m.jsx(sn,{className:"size-4"}),bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=a):a=n[2];const s=a,u=`flex items-center justify-center h-6 w-6 rounded-sm ${s.bg} ${s.text}`;let o;n[3]!==s.icon||n[4]!==u?(o=m.jsx(fn,{asChild:!0,children:m.jsx("div",{className:u,children:s.icon})}),n[3]=s.icon,n[4]=u,n[5]=o):o=n[5];let l;n[6]!==s.label?(l=m.jsx(hn,{children:m.jsx("p",{children:s.label})}),n[6]=s.label,n[7]=l):l=n[7];let d;return n[8]!==o||n[9]!==l?(d=m.jsxs(dn,{children:[o,l]}),n[8]=o,n[9]=l,n[10]=d):d=n[10],d}),pu=V.memo(function(e){const n=W.c(54),{model:r,compact:i}=e,a=i===void 0?!1:i;if(!r){let T;return n[0]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=T):T=n[0],T}const s=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!s&&!a){let T;n[1]!==r.logo||n[2]!==r.name?(T=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[1]=r.logo,n[2]=r.name,n[3]=T):T=n[3];let I;n[4]!==r.name?(I=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=I):I=n[5];let E;n[6]!==T||n[7]!==I?(E=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,I]}),n[6]=T,n[7]=I,n[8]=E):E=n[8];let R;n[9]!==r.description?(R=r.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=R):R=n[10];let O;return n[11]!==E||n[12]!==R?(O=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[E,R]}),n[11]=E,n[12]=R,n[13]=O):O=n[13],O}if(!s&&a)return null;if(a){let T;n[14]!==r.contextWindow?(T=r.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[14]=r.contextWindow,n[15]=T):T=n[15];let I;n[16]!==r.inputCost?(I=r.inputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.inputCost.toFixed(2)," / 1M"]})]}),n[16]=r.inputCost,n[17]=I):I=n[17];let E;n[18]!==r.outputCost?(E=r.outputCost&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",r.outputCost.toFixed(2)," / 1M"]})]}),n[18]=r.outputCost,n[19]=E):E=n[19];let R;n[20]!==r.outputLimit?(R=r.outputLimit&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[r.outputLimit.toLocaleString()," tokens"]})]}),n[20]=r.outputLimit,n[21]=R):R=n[21];let O;return n[22]!==T||n[23]!==I||n[24]!==E||n[25]!==R?(O=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[T,I,E,R]}),n[22]=T,n[23]=I,n[24]=E,n[25]=R,n[26]=O):O=n[26],O}let u;n[27]!==r.logo||n[28]!==r.name?(u=r.logo&&m.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[27]=r.logo,n[28]=r.name,n[29]=u):u=n[29];let o;n[30]!==r.name?(o=m.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=o):o=n[31];let l;n[32]!==u||n[33]!==o?(l=m.jsxs("div",{className:"flex items-center gap-3",children:[u,o]}),n[32]=u,n[33]=o,n[34]=l):l=n[34];let d;n[35]!==r.capabilities?(d=r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(_3)}),n[35]=r.capabilities,n[36]=d):d=n[36];let f;n[37]!==l||n[38]!==d?(f=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,d]}),n[37]=l,n[38]=d,n[39]=f):f=n[39];let p;n[40]!==r.contextWindow?(p=r.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Fc,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[40]=r.contextWindow,n[41]=p):p=n[41];let h;n[42]!==r.inputCost||n[43]!==r.outputCost?(h=(r.inputCost||r.outputCost)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Iu,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.inputCost!==null&&r.inputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.inputCost.toFixed(2)," / 1M tokens (input)"]}),r.outputCost!==null&&r.outputCost!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.outputCost.toFixed(2)," / 1M tokens (output)"]})]})]}),n[42]=r.inputCost,n[43]=r.outputCost,n[44]=h):h=n[44];let g;n[45]!==r.outputLimit?(g=r.outputLimit&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Ru,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.outputLimit.toLocaleString()," token limit"]})]}),n[45]=r.outputLimit,n[46]=g):g=n[46];let _;n[47]!==p||n[48]!==h||n[49]!==g?(_=m.jsxs("div",{className:"flex flex-col gap-4",children:[p,h,g]}),n[47]=p,n[48]=h,n[49]=g,n[50]=_):_=n[50];let y;return n[51]!==_||n[52]!==f?(y=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[f,_]}),n[51]=_,n[52]=f,n[53]=y):y=n[53],y}),T3=V.memo(function(e){const n=W.c(27),{model:r,onHover:i,isSelected:a,hasExpandedInfo:s}=e,u=s?"rounded-t-lg":"rounded-lg";let o;n[0]!==u?(o=le("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",u),n[0]=u,n[1]=o):o=n[1];let l;n[2]!==r||n[3]!==i?(l=()=>i(r),n[2]=r,n[3]=i,n[4]=l):l=n[4];let d;n[5]!==r.logo||n[6]!==r.name?(d=r.logo&&m.jsx("img",{src:r.logo,className:"w-5 h-5 shrink-0",alt:r.name}),n[5]=r.logo,n[6]=r.name,n[7]=d):d=n[7];let f;n[8]!==r.name?(f=m.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=f):f=n[9];let p;n[10]!==s||n[11]!==r.capabilities?(p=s&&r.capabilities&&r.capabilities.length>0&&m.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(y3)}),n[10]=s,n[11]=r.capabilities,n[12]=p):p=n[12];let h;n[13]!==s||n[14]!==a?(h=a&&!s&&m.jsx(sn,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=s,n[14]=a,n[15]=h):h=n[15];let g;n[16]!==s||n[17]!==a?(g=a&&s&&m.jsx(sn,{className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=s,n[17]=a,n[18]=g):g=n[18];let _;return n[19]!==o||n[20]!==l||n[21]!==d||n[22]!==f||n[23]!==p||n[24]!==h||n[25]!==g?(_=m.jsxs("div",{className:o,onMouseEnter:l,children:[d,f,p,h,g]}),n[19]=o,n[20]=l,n[21]=d,n[22]=f,n[23]=p,n[24]=h,n[25]=g,n[26]=_):_=n[26],_});function x3(t){const e=W.c(9),{model:n}=t;if(!n){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=s):s=e[0],s}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.name}),e[1]=n.logo,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let a;return e[6]!==r||e[7]!==i?(a=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[r,i]}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function d_(t){const e=W.c(67),{selectedModel:n,onModelChange:r,variant:i,className:a,placeholder:s}=t,u=i===void 0?"borderless":i,o=s===void 0?"Select model":s,[l,d]=V.useState(!1),[f,p]=V.useState(null),[h,g]=V.useState(!1),[_,y]=V.useState(""),T=V.useRef(null),I=g3();let E,R;e[0]!==l?(E=()=>{l&&setTimeout(()=>{T.current?.focus()},0)},R=[l],e[0]=l,e[1]=E,e[2]=R):(E=e[1],R=e[2]),V.useEffect(E,R);let O;e[3]!==I||e[4]!==n?(O=n?I.find(fe=>fe.id===n.id&&fe.connectionId===n.connectionId)?.id:void 0,e[3]=I,e[4]=n,e[5]=O):O=e[5];const S=O;let v;if(e[6]!==I||e[7]!==S){let fe;e[9]!==S?(fe=Je=>Je.id===S,e[9]=S,e[10]=fe):fe=e[10],v=I.find(fe),e[6]=I,e[7]=S,e[8]=v}else v=e[8];const B=v;let z;e:{if(!_.trim()){z=I;break e}let fe;if(e[11]!==I||e[12]!==_){const Je=_.toLowerCase();fe=I.filter(At=>At.name.toLowerCase().includes(Je)||At.provider?.toLowerCase().includes(Je)||At.description?.toLowerCase().includes(Je)),e[11]=I,e[12]=_,e[13]=fe}else fe=e[13];z=fe}const N=z;let F;e[14]!==I||e[15]!==r?(F=fe=>{const Je=I.find(At=>At.id===fe);Je&&(r({id:Je.id,connectionId:Je.connectionId,provider:Je.provider??void 0}),y(""),d(!1))},e[14]=I,e[15]=r,e[16]=F):F=e[16];const P=F;let X;e[17]===Symbol.for("react.memo_cache_sentinel")?(X=fe=>{d(fe),fe||y("")},e[17]=X):X=e[17];const q=X;if(I.length===0)return null;const j=S||"",Z=u==="borderless"&&"md:border-none";let te;e[18]!==a||e[19]!==Z?(te=le("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",Z,a),e[18]=a,e[19]=Z,e[20]=te):te=e[20];let K;e[21]!==B?(K=m.jsx(x3,{model:B}),e[21]=B,e[22]=K):K=e[22];let ce;e[23]!==o||e[24]!==K?(ce=m.jsx(Hc,{placeholder:o,className:"min-w-0 max-w-full",children:K}),e[23]=o,e[24]=K,e[25]=ce):ce=e[25];let k;e[26]!==te||e[27]!==ce?(k=m.jsx(jc,{size:"sm",className:te,children:ce}),e[26]=te,e[27]=ce,e[28]=k):k=e[28];let ae;e[29]!==h?(ae=()=>g(!h),e[29]=h,e[30]=ae):ae=e[30];const xe=h?"text-foreground":"text-muted-foreground";let C;e[31]!==xe?(C=le("w-5 h-5 transition-colors",xe),e[31]=xe,e[32]=C):C=e[32];let ke;e[33]!==C?(ke=m.jsx(rd,{className:C}),e[33]=C,e[34]=ke):ke=e[34];let Ie;e[35]!==ae||e[36]!==ke?(Ie=m.jsx("button",{type:"button",onClick:ae,className:"md:hidden flex items-center justify-center h-8 w-8 rounded-lg hover:bg-accent transition-colors","aria-label":"Toggle model info",children:ke}),e[35]=ae,e[36]=ke,e[37]=Ie):Ie=e[37];let me;e[38]===Symbol.for("react.memo_cache_sentinel")?(me=m.jsx(Wi,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[38]=me):me=e[38];let Ne;e[39]===Symbol.for("react.memo_cache_sentinel")?(Ne=fe=>y(fe.target.value),e[39]=Ne):Ne=e[39];let _e;e[40]!==_?(_e=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"relative",children:[me,m.jsx(Lc,{ref:T,type:"text",placeholder:"Search for a model...",value:_,onChange:Ne,className:"pl-9 h-9 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"})]})}),e[40]=_,e[41]=_e):_e=e[41];let we;e[42]!==N||e[43]!==P||e[44]!==S||e[45]!==h?(we=N.length>0?N.map(fe=>m.jsxs("div",{onClick:()=>P(fe.id),className:le("rounded-lg mb-1",fe.id===S&&"bg-accent"),children:[m.jsx(T3,{model:fe,onHover:p,isSelected:fe.id===S,hasExpandedInfo:h}),h&&m.jsx("div",{className:"md:hidden",children:m.jsx(pu,{model:fe,compact:!0})})]},fe.id)):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[42]=N,e[43]=P,e[44]=S,e[45]=h,e[46]=we):we=e[46];let Se;e[47]!==we?(Se=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5",children:we}),e[47]=we,e[48]=Se):Se=e[48];let Oe;e[49]!==_e||e[50]!==Se?(Oe=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r",children:[_e,Se]}),e[49]=_e,e[50]=Se,e[51]=Oe):Oe=e[51];const ot=f||B||null;let De;e[52]!==ot?(De=m.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:m.jsx(pu,{model:ot})}),e[52]=ot,e[53]=De):De=e[53];let yt;e[54]!==Oe||e[55]!==De?(yt=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[Oe,De]}),e[54]=Oe,e[55]=De,e[56]=yt):yt=e[56];let mt;e[57]!==o||e[58]!==Ie||e[59]!==yt?(mt=m.jsx(zc,{title:o,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Ie,children:yt}),e[57]=o,e[58]=Ie,e[59]=yt,e[60]=mt):mt=e[60];let Mt;return e[61]!==P||e[62]!==l||e[63]!==j||e[64]!==k||e[65]!==mt?(Mt=m.jsxs($c,{open:l,onOpenChange:q,value:j,onValueChange:P,children:[k,mt]}),e[61]=P,e[62]=l,e[63]=j,e[64]=k,e[65]=mt,e[66]=Mt):Mt=e[66],Mt}function _3(t){return m.jsx(pc,{capability:t},t)}function y3(t){return m.jsx(pc,{capability:t},t)}function A3({messageCount:t,sentinelRef:e}){const n=V.useRef(t),r=V.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function mu(t,e){const n=V.Children.toArray(t);for(const r of n)if(V.isValidElement(r)&&r.type===e)return r;return null}function k3(t){const e=W.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=le("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==r||e[3]!==i?(a=m.jsx("div",{className:i,children:r}),e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function C3(t){const e=W.c(11),{children:n}=t;let r;e[0]!==n?(r=mu(n,mc),e[0]=n,e[1]=r):r=e[1];const i=r;let a;e[2]!==n?(a=mu(n,gc),e[2]=n,e[3]=a):a=e[3];const s=a,u=i?.props.children;let o;e[4]!==u?(o=m.jsx("div",{className:"flex items-center gap-2",children:u}),e[4]=u,e[5]=o):o=e[5];const l=s?.props.children;let d;e[6]!==l?(d=m.jsx("div",{className:"flex items-center gap-1",children:l}),e[6]=l,e[7]=d):d=e[7];let f;return e[8]!==o||e[9]!==d?(f=m.jsxs("div",{className:"flex h-12 items-center justify-between border-b border-border px-4 flex-none",children:[o,d]}),e[8]=o,e[9]=d,e[10]=f):f=e[10],f}function mc(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function gc(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function I3(t){const e=W.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=le("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function S3(t){const e=W.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function N3(t){const e=W.c(12),{messages:n,status:r,minHeightOffset:i}=t,a=i===void 0?240:i,s=V.useRef(null);let u;e[0]!==n.length?(u={messageCount:n.length,sentinelRef:s},e[0]=n.length,e[1]=u):u=e[1],A3(u);let o;if(e[2]!==n||e[3]!==r){let f;e[5]!==n.length||e[6]!==r?(f=(p,h)=>p.role==="user"?m.jsx(p3,{message:p},p.id):p.role==="assistant"?m.jsx(i3,{message:p,status:h===n.length-1?r:void 0},p.id):null,e[5]=n.length,e[6]=r,e[7]=f):f=e[7],o=n.map(f),e[2]=n,e[3]=r,e[4]=o}else o=e[4];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(hc,{children:m.jsx("div",{ref:s,className:"h-0"})}),e[8]=l):l=e[8];let d;return e[9]!==a||e[10]!==o?(d=m.jsxs(o3,{minHeightOffset:a,children:[o,l]}),e[9]=a,e[10]=o,e[11]=d):d=e[11],d}function w3(t){const e=W.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=le("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=m.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Na(t){const e=W.c(24),{title:n,description:r,icon:i,variant:a,onDismiss:s,children:u}=t,o=a===void 0?"default":a;let l,d,f,p,h;if(e[0]!==u||e[1]!==r||e[2]!==i||e[3]!==n||e[4]!==o){const E={default:{container:"border-muted-foreground/30 bg-muted/50 hover:bg-muted transition-colors",icon:"text-muted-foreground",title:"text-muted-foreground",description:"text-muted-foreground/70"},danger:{container:"border-destructive/30 bg-destructive/5",icon:"text-destructive",title:"text-destructive font-medium",description:"text-muted-foreground"},warning:{container:"border-amber-500/30 bg-amber-500/5",icon:"text-amber-600 dark:text-amber-500",title:"text-amber-600 dark:text-amber-500 font-medium",description:"text-muted-foreground"}}[o];p=le("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",E.container),h=i&&m.jsx("div",{className:le("mt-0.5 shrink-0",E.icon),children:i}),l="flex-1 min-w-0",d=n&&m.jsx("div",{className:le("text-xs mb-1",E.title),children:n}),f=r&&m.jsx("div",{className:le("text-xs line-clamp-2",E.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=i,e[3]=n,e[4]=o,e[5]=l,e[6]=d,e[7]=f,e[8]=p,e[9]=h}else l=e[5],d=e[6],f=e[7],p=e[8],h=e[9];let g;e[10]!==u?(g=u&&m.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let _;e[12]!==l||e[13]!==d||e[14]!==f||e[15]!==g?(_=m.jsxs("div",{className:l,children:[d,f,g]}),e[12]=l,e[13]=d,e[14]=f,e[15]=g,e[16]=_):_=e[16];let y;e[17]!==s?(y=s&&m.jsx("button",{type:"button",onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:m.jsx(Mc,{size:14})}),e[17]=s,e[18]=y):y=e[18];let T;return e[19]!==p||e[20]!==h||e[21]!==_||e[22]!==y?(T=m.jsxs("div",{className:p,children:[h,_,y]}),e[19]=p,e[20]=h,e[21]=_,e[22]=y,e[23]=T):T=e[23],T}function R3(t){const e=W.c(10),{branchContext:n,clearBranchContext:r,onGoToOriginalMessage:i,setInputValue:a}=t;if(!n)return null;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(Cu,{size:14}),e[0]=s):s=e[0];let u;e[1]!==r||e[2]!==a?(u=()=>{r(),a("")},e[1]=r,e[2]=a,e[3]=u):u=e[3];let o;e[4]!==i?(o=m.jsx(We,{size:"sm",variant:"outline",onClick:i,className:"h-7 text-xs",children:"View original"}),e[4]=i,e[5]=o):o=e[5];let l;return e[6]!==n.originalMessageText||e[7]!==u||e[8]!==o?(l=m.jsx(Na,{variant:"default",title:"Editing message (click to view original)",description:n.originalMessageText,icon:s,onDismiss:u,children:o}),e[6]=n.originalMessageText,e[7]=u,e[8]=o,e[9]=l):l=e[9],l}function O3(t){const e=W.c(8),{error:n,onFixInChat:r,onDismiss:i}=t;if(!n)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(_u,{size:16}),e[0]=a):a=e[0];let s;e[1]!==r?(s=m.jsx(We,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Fix in chat"}),e[1]=r,e[2]=s):s=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(We,{size:"sm",variant:"outline",disabled:!0,className:"h-7 text-xs",children:"Report"}),e[3]=u):u=e[3];let o;return e[4]!==n.message||e[5]!==i||e[6]!==s?(o=m.jsxs(Na,{variant:"danger",title:"Error occurred",description:n.message,icon:a,onDismiss:i,children:[s,u]}),e[4]=n.message,e[5]=i,e[6]=s,e[7]=o):o=e[7],o}function L3(t){const e=W.c(7),{finishReason:n,onContinue:r,onDismiss:i}=t;if(!n||n==="stop")return null;const s=D3(n);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Pc,{size:16}),e[0]=u):u=e[0];let o;e[1]!==r?(o=m.jsx(We,{size:"sm",variant:"outline",onClick:r,className:"h-7 text-xs",children:"Continue"}),e[1]=r,e[2]=o):o=e[2];let l;return e[3]!==i||e[4]!==s||e[5]!==o?(l=m.jsx(Na,{variant:"warning",title:"Response incomplete",description:s,icon:u,onDismiss:i,children:o}),e[3]=i,e[4]=s,e[5]=o,e[6]=l):l=e[6],l}function D3(t){switch(t){case"length":return"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.";case"content-filter":return"Response was filtered due to content policy.";case"tool-calls":return"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working.";default:return`Response stopped unexpectedly: ${t}`}}const f_=Object.assign(k3,{Header:Object.assign(C3,{Left:mc,Right:gc}),Main:I3,Messages:N3,EmptyState:S3,Footer:w3,Input:Th,BranchPreview:R3,ErrorBanner:O3,FinishReasonWarning:L3,Provider:fh});function h_({title:t="No model provider connected",description:e="Connect to a model provider to unlock AI-powered features.",orgSlug:n,orgId:r,userId:i,allConnections:a,onInstallMcpServer:s}){const[u,o]=V.useState(!1),l=od(),d=Oc(),f=async()=>{if(!r||!i){Ei.error("Not authenticated");return}o(!0);try{const p=a?.find(_=>_.connection_url===dd);if(p){d({to:"/$org/mcps/$connectionId",params:{org:n,connectionId:p.id}});return}const h=fd({id:hd("conn")}),g=await l.create.mutateAsync(h);d({to:"/$org/mcps/$connectionId",params:{org:n,connectionId:g.id}})}catch(p){Ei.error(`Failed to connect OpenRouter: ${p instanceof Error?p.message:String(p)}`)}finally{o(!1)}};return m.jsx(ld,{image:m.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),title:t,description:e,actions:m.jsxs(m.Fragment,{children:[m.jsxs(We,{variant:"outline",onClick:f,disabled:u,children:[m.jsx("img",{src:cd,alt:"OpenRouter",className:"size-4"}),u?"Installing...":"Install OpenRouter"]}),m.jsx(We,{variant:"outline",onClick:s,children:"Install Connection"})]})})}function v3(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5);return i<1?"now":i<60?`${i}m`:`${a}h`}function P3(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),i=new Date(n.getTime()-7*864e5),a=new Date(n.getTime()-30*864e5),s=[],u=[],o=[],l=[],d=[];for(const p of t){const h=new Date(p.updated_at);h>=n?s.push(p):h>=r?u.push(p):h>=i?o.push(p):h>=a?l.push(p):d.push(p)}const f=[];return s.length>0&&f.push({label:"Today",threads:s,showRelativeTime:!0}),u.length>0&&f.push({label:"Yesterday",threads:u,showRelativeTime:!1}),o.length>0&&f.push({label:"7 days ago",threads:o,showRelativeTime:!1}),l.length>0&&f.push({label:"30 days ago",threads:l,showRelativeTime:!1}),d.length>0&&f.push({label:"Older",threads:d,showRelativeTime:!1}),f}function p_(t){const e=W.c(49),{threads:n,activeThreadId:r,onSelectThread:i,onRemoveThread:a,onOpen:s,variant:u}=t,o=u===void 0?"icon":u,[l,d]=V.useState("");let f,p,h,g,_,y,T,I,E,R,O,S;if(e[0]!==r||e[1]!==s||e[2]!==a||e[3]!==i||e[4]!==l||e[5]!==n||e[6]!==o){const P=l.trim()?n.filter(K=>(K.title||"New chat").toLowerCase().includes(l.toLowerCase())):n,X=P3(P);let q;e[19]!==s?(q=K=>{K?s?.():d("")},e[19]=s,e[20]=q):q=e[20];const j=q;g=Eu,h=dn,p=bu,R=j,e[21]!==o?(O=m.jsx(fn,{asChild:!0,children:m.jsx(Tu,{asChild:!0,children:o==="outline"?m.jsx(We,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input","aria-label":"Chat history",children:m.jsx(Ra,{size:16})}):m.jsx(We,{type:"button",variant:"ghost",size:"icon",className:"size-6 p-1 hover:bg-transparent","aria-label":"Chat history",children:m.jsx(Ra,{size:16,className:"text-muted-foreground hover:text-foreground transition-colors"})})})}),e[21]=o,e[22]=O):O=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx(hn,{children:"Chat history"}),e[23]=S):S=e[23],f=xu,T="end",I="w-80 p-0";let Z;e[24]===Symbol.for("react.memo_cache_sentinel")?(Z=m.jsx(Wi,{size:16,className:"text-muted-foreground shrink-0"}),e[24]=Z):Z=e[24];let te;e[25]===Symbol.for("react.memo_cache_sentinel")?(te=K=>d(K.target.value),e[25]=te):te=e[25],e[26]!==l?(E=m.jsx("div",{className:"border-b",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[Z,m.jsx("input",{type:"text",placeholder:"Search chats...",value:l,onChange:te,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[26]=l,e[27]=E):E=e[27],_="max-h-[300px] overflow-y-auto",y=P.length===0?m.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:l.trim()?"No chats found":"No chats yet"}):X.map((K,ce)=>m.jsxs("div",{children:[ce>0&&m.jsx("div",{className:"border-t mx-3"}),m.jsx("div",{className:"px-3 py-1",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:K.label})}),K.threads.map(k=>{const ae=k.id===r;return m.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${ae?"bg-accent/50":""}`,onClick:()=>i(k.id),children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm truncate",children:k.title||"New chat"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:ae?"current":K.showRelativeTime?v3(k.updated_at):null})]}),m.jsx("button",{type:"button",onClick:xe=>{xe.stopPropagation(),a(k.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:m.jsx(pd,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},k.id)})]},K.label)),e[0]=r,e[1]=s,e[2]=a,e[3]=i,e[4]=l,e[5]=n,e[6]=o,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=_,e[12]=y,e[13]=T,e[14]=I,e[15]=E,e[16]=R,e[17]=O,e[18]=S}else f=e[7],p=e[8],h=e[9],g=e[10],_=e[11],y=e[12],T=e[13],I=e[14],E=e[15],R=e[16],O=e[17],S=e[18];let v;e[28]!==_||e[29]!==y?(v=m.jsx("div",{className:_,children:y}),e[28]=_,e[29]=y,e[30]=v):v=e[30];let B;e[31]!==f||e[32]!==v||e[33]!==T||e[34]!==I||e[35]!==E?(B=m.jsxs(f,{align:T,className:I,children:[E,v]}),e[31]=f,e[32]=v,e[33]=T,e[34]=I,e[35]=E,e[36]=B):B=e[36];let z;e[37]!==p||e[38]!==B||e[39]!==R||e[40]!==O||e[41]!==S?(z=m.jsxs(p,{onOpenChange:R,children:[O,S,B]}),e[37]=p,e[38]=B,e[39]=R,e[40]=O,e[41]=S,e[42]=z):z=e[42];let N;e[43]!==h||e[44]!==z?(N=m.jsx(h,{children:z}),e[43]=h,e[44]=z,e[45]=N):N=e[45];let F;return e[46]!==g||e[47]!==N?(F=m.jsx(g,{children:N}),e[46]=g,e[47]=N,e[48]=F):F=e[48],F}export{f_ as C,a_ as D,c_ as G,d_ as M,h_ as N,p_ as T,Xx as U,s_ as a,g3 as b,u_ as c,l_ as d,fh as e,Th as f,ph as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as B,j as t,c as O,h as Q,r as k}from"./index-
|
|
1
|
+
import{K as B,j as t,c as O,h as Q,r as k}from"./index-C1mekZiH.js";import{u as U}from"./useQuery-BDFKN3rX.js";import{i as W}from"./File06-BXoByNkx.js";import{i as Y}from"./Loading01-ev_d5Ul8.js";import{e as J}from"./github-icon-Dp3wHhYE.js";import{C as P}from"./collection-display-button-CWAu-kzM.js";import{C as X}from"./collection-search-B9hWcULz.js";import{C as Z}from"./collection-table-wrapper-DQxK8uYh.js";import{E as z,I as ee}from"./use-connection-CqruT03A.js";import{C as te}from"./card-A0j-GQek.js";import{V as se}from"./layout-BExJva29.js";function oe(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function re(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,i)=>i.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${i} target="_blank" rel="noopener noreferrer">`)}function ne(s){let e=oe(s);return e=re(e),e}function we({repository:s}){const e=s?J(s):null,{data:i,isLoading:c}=U({queryKey:B.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const l=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!l.ok){if(l.status===404)return null;throw new Error(`Failed to fetch README: ${l.statusText}`)}const m=await l.text();return ne(m)}catch(l){return console.error("Error fetching README:",l),null}},enabled:!!e&&!!s,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}):i?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:i}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(W,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function ve(s){const e=O.c(39),{tools:i,connectionId:c,org:l,onToolClick:m,showToolbar:L,emptyMessage:M}=s,D=L===void 0?!0:L,j=M===void 0?"This connection doesn't have any tools yet.":M,I=Q(),[n,$]=k.useState(""),[d,H]=k.useState("table"),[r,A]=k.useState("name"),[a,_]=k.useState("asc");let y;e[0]!==a||e[1]!==r?(y=o=>{r===o?(_(me),a==="desc"&&A(void 0)):(A(o),_("asc"))},e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y;let N;e[3]!==c||e[4]!==I||e[5]!==m||e[6]!==l?(N=o=>{m?m(o):c&&l&&I({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=c,e[4]=I,e[5]=m,e[6]=l,e[7]=N):N=e[7];const w=N;let v;if(e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==i){const o=!i||i.length===0?[]:n.trim()?(()=>{const R=n.toLowerCase();return i.filter(b=>b.name.toLowerCase().includes(R)||b.description&&b.description.toLowerCase().includes(R))})():i;v=!r||!a?o:[...o].sort((R,b)=>{const q=R[r]||"",G=b[r]||"",K=String(q).localeCompare(String(G));return a==="asc"?K:-K}),e[8]=n,e[9]=a,e[10]=r,e[11]=i,e[12]=v}else v=e[12];const g=v;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=[{id:"name",header:"Name",render:ce,sortable:!0},{id:"description",header:"Description",render:le,cellClassName:"flex-1",sortable:!0}],e[13]=C):C=e[13];const V=C;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=V.filter(ie).map(ae),e[14]=S):S=e[14];const F=S;let f;e[15]!==u||e[16]!==D||e[17]!==a||e[18]!==r||e[19]!==d?(f=D&&t.jsx(se,{children:t.jsx(P,{viewMode:d,onViewModeChange:H,sortKey:r,sortDirection:a,onSort:u,sortOptions:F})}),e[15]=u,e[16]=D,e[17]=a,e[18]=r,e[19]=d,e[20]=f):f=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=o=>{o.key==="Escape"&&($(""),o.target.blur())},e[21]=E):E=e[21];let p;e[22]!==n?(p=t.jsx(X,{value:n,onChange:$,placeholder:"Search tools...",onKeyDown:E}),e[22]=n,e[23]=p):p=e[23];let h;e[24]!==j||e[25]!==u||e[26]!==w||e[27]!==n||e[28]!==a||e[29]!==r||e[30]!==g||e[31]!==d?(h=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:g.length===0?t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:g.map(o=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>w(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(Z,{columns:V,data:g,isLoading:!1,sortKey:r,sortDirection:a,onSort:u,onRowClick:o=>w(o),emptyState:t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j})}),e[24]=j,e[25]=u,e[26]=w,e[27]=n,e[28]=a,e[29]=r,e[30]=g,e[31]=d,e[32]=h):h=e[32];let x;e[33]!==p||e[34]!==h?(x=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p,h]}),e[33]=p,e[34]=h,e[35]=x):x=e[35];let T;return e[36]!==x||e[37]!==f?(T=t.jsxs(t.Fragment,{children:[f,x]}),e[36]=x,e[37]=f,e[38]=T):T=e[38],T}function ae(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ie(s){return s.sortable}function le(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ce(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function me(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{we as R,ve as T};
|