decocms 4.86.0 → 4.86.2
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-DriHvGW8.js → AlertCircle-DfZqGdIO.js} +1 -1
- package/dist/client/assets/{AreaChart-BU465nht.js → AreaChart-DXIhupUU.js} +1 -1
- package/dist/client/assets/{ArrowUp-BHLBiz0J.js → ArrowUp-mYUQI3ny.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CsopTrXA.js → ArrowUpRight-D7jEUphZ.js} +1 -1
- package/dist/client/assets/{CheckCircle-BSSfIVDh.js → CheckCircle-BA3THiSr.js} +1 -1
- package/dist/client/assets/{ChevronDown-DnuZlbXl.js → ChevronDown-BpKPHxDG.js} +1 -1
- package/dist/client/assets/{ChevronRight-D8z61LL4.js → ChevronRight-ByVxw7yb.js} +1 -1
- package/dist/client/assets/{ChevronUp-SvG4tBeC.js → ChevronUp-DKgNoV7g.js} +1 -1
- package/dist/client/assets/{Copy01-8RoWdlIb.js → Copy01-AuaMhdvh.js} +1 -1
- package/dist/client/assets/{DotsVertical-ByzWfjph.js → DotsVertical-Ctyi_Fcj.js} +1 -1
- package/dist/client/assets/{Eye-BMB6Dsvc.js → Eye-CaHkvWGU.js} +1 -1
- package/dist/client/assets/{FilterLines-Cb5gzr5c.js → FilterLines-B_F076bt.js} +1 -1
- package/dist/client/assets/{Globe01-C6g7oQ38.js → Globe01-9M3ZtnRh.js} +1 -1
- package/dist/client/assets/{Globe04-CYEWS6xQ.js → Globe04-BBu3oRiw.js} +1 -1
- package/dist/client/assets/{HardDrive-Dv77s3h5.js → HardDrive-Czo8EXKT.js} +1 -1
- package/dist/client/assets/{Image01-YE-JCd5P.js → Image01-C8aqMMC0.js} +1 -1
- package/dist/client/assets/{Key01-C9Hax98L.js → Key01-HpKP7kjq.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CoMgIDfR.js → LayoutLeft-BZQmnN4U.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BYMM_QSD.js → LinkExternal01-wLaoE2BO.js} +1 -1
- package/dist/client/assets/{Monitor01-CDUuvvya.js → Monitor01-CCqvvSCN.js} +1 -1
- package/dist/client/assets/{Package-BwfmB-wY.js → Package-DXwLO7TZ.js} +1 -1
- package/dist/client/assets/{Palette-wIBeqOmX.js → Palette-BOYYX-x4.js} +1 -1
- package/dist/client/assets/{Play-CmeXDhbv.js → Play-Bhc_0wGz.js} +1 -1
- package/dist/client/assets/{Plus-DErQhYMo.js → Plus-BFo0Fsne.js} +1 -1
- package/dist/client/assets/{SearchLg-BcyXaR5Z.js → SearchLg-D_s4Wx9C.js} +1 -1
- package/dist/client/assets/{SearchMd-B2xdLkpr.js → SearchMd-DnmtefV6.js} +1 -1
- package/dist/client/assets/{Settings02-BQIoToME.js → Settings02-DcvdDwJo.js} +1 -1
- package/dist/client/assets/{Shield01-BnV0ErmL.js → Shield01-hx04AF4i.js} +1 -1
- package/dist/client/assets/{Star01-BvPb97r4.js → Star01-DVFgs_0J.js} +1 -1
- package/dist/client/assets/{Stars01-Dq_ij1vd.js → Stars01-B5Wh8soo.js} +1 -1
- package/dist/client/assets/{Stars02-D0dtbcP0.js → Stars02-PuKOl8z5.js} +1 -1
- package/dist/client/assets/{Sun-BNn7fIcF.js → Sun-Cw5YUhig.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B5xg5r1q.js → SwitchHorizontal01-DYptKpyt.js} +1 -1
- package/dist/client/assets/{Tool01-1JY4WdfO.js → Tool01-CpROxlr0.js} +1 -1
- package/dist/client/assets/{Tool02-CJRfU6-e.js → Tool02-C8iwn6Q8.js} +1 -1
- package/dist/client/assets/{Trash01-D68y5OFq.js → Trash01-zPnxi6aE.js} +1 -1
- package/dist/client/assets/{TrendUp01-Be3cv-nx.js → TrendUp01-ryekGRAe.js} +1 -1
- package/dist/client/assets/{Upload01-CPQnKMdb.js → Upload01-L8Z9Doey.js} +1 -1
- package/dist/client/assets/{User01-BErqEcB8.js → User01-DewcmwdK.js} +1 -1
- package/dist/client/assets/{Users01-CdOl2233.js → Users01-Dc2haknw.js} +1 -1
- package/dist/client/assets/{Users03-01ZOLPet.js → Users03-DmiDj7OC.js} +1 -1
- package/dist/client/assets/{X-DXgmI1I4.js → X-DvSaCzV-.js} +1 -1
- package/dist/client/assets/{XCircle-DY497Rjn.js → XCircle-C6mRHoZP.js} +1 -1
- package/dist/client/assets/{XClose-C4EmtqAA.js → XClose-CnDiE4wN.js} +1 -1
- package/dist/client/assets/{Zap-BPdmVchQ.js → Zap-B7fiN40E.js} +1 -1
- package/dist/client/assets/{ZapSquare-DiXc_WiU.js → ZapSquare-BAQcu1iA.js} +1 -1
- package/dist/client/assets/{ZoomOut-DO1ABQMU.js → ZoomOut-shbGcJgg.js} +1 -1
- package/dist/client/assets/{access-gate-Du5lQEFN.js → access-gate-BQ5nV9CM.js} +1 -1
- package/dist/client/assets/{add-section-modal-Cj2upX49.js → add-section-modal-CDMDYlK5.js} +1 -1
- package/dist/client/assets/{agent-icon-D4a2yQAy.js → agent-icon-CzJVw_PS.js} +1 -1
- package/dist/client/assets/{agents-list-CbWCKvO8.js → agents-list-CdJFtIq2.js} +1 -1
- package/dist/client/assets/{ai-providers-CTkmKKCc.js → ai-providers-DluYZyyW.js} +1 -1
- package/dist/client/assets/{alert-dialog-C0dmYQwl.js → alert-dialog-Y1XXElMo.js} +1 -1
- package/dist/client/assets/{alert-ZjKFCE6g.js → alert-j08TigIF.js} +1 -1
- package/dist/client/assets/{app-editor-C9vstOJe.js → app-editor-D8GIAPUq.js} +1 -1
- package/dist/client/assets/{auth-z6bL2iLM.js → auth-DGbJKtcV.js} +1 -1
- package/dist/client/assets/{auth-catchall-CTUsNjBA.js → auth-catchall-CiycU9Fr.js} +1 -1
- package/dist/client/assets/{auth-entry-DhkhuzaY.js → auth-entry-CYNZqOOw.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BlG-p1RQ.js → auth-split-layout-BrESDdg5.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-C7P5en8H.js → authenticate-and-persist-oauth-tUtbW76M.js} +1 -1
- package/dist/client/assets/{automation-list-row-Bu9C738j.js → automation-list-row-Ci-vo0Ok.js} +1 -1
- package/dist/client/assets/automation-runs-BdqIedR2.js +87 -0
- package/dist/client/assets/{automations-Bnj3R1rO.js → automations-B5nmIsQw.js} +1 -1
- package/dist/client/assets/{autosend-DViO44x-.js → autosend-C5LHLeko.js} +1 -1
- package/dist/client/assets/{avatar-f9PWmWko.js → avatar-DBnOObMJ.js} +1 -1
- package/dist/client/assets/{badge-D-j0sOs9.js → badge-C6MoaNaP.js} +1 -1
- package/dist/client/assets/{block-document-Bp1KtsqP.js → block-document-aXxr97-G.js} +1 -1
- package/dist/client/assets/{brand-context-Ce4eNHs8.js → brand-context-CtFfSAiC.js} +1 -1
- package/dist/client/assets/{buckets-DFmFwZCi.js → buckets-BGwcc7oD.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CkjZ2spD.js → bulk-category-panel-C8XqXeAU.js} +1 -1
- package/dist/client/assets/{calendar-CL1lHfJI.js → calendar-DX2eI8nn.js} +1 -1
- package/dist/client/assets/{capability-load-error-DifNtXec.js → capability-load-error-C6Zz4eJ1.js} +1 -1
- package/dist/client/assets/{card-D4CJeQSR.js → card-CMA-4CeN.js} +1 -1
- package/dist/client/assets/{category-editor-DPATJKY9.js → category-editor-C6Be1dfI.js} +1 -1
- package/dist/client/assets/{chat-context-0yEIHZ6c.js → chat-context-CWKEbJVu.js} +1 -1
- package/dist/client/assets/{checkbox-JCl8QP8q.js → checkbox-BZmlCGR-.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BfTlukPl.js → cli-auth-success-D834jweo.js} +1 -1
- package/dist/client/assets/{collection-detail-Bd8G9LY3.js → collection-detail-jPNP5mzy.js} +1 -1
- package/dist/client/assets/{collection-display-button-DRoGXo78.js → collection-display-button-DrgpSLTZ.js} +1 -1
- package/dist/client/assets/{collection-search-C0RNwRHs.js → collection-search-CwZ01sWP.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-ByMEj5PE.js → collection-table-wrapper-DaIANWjI.js} +1 -1
- package/dist/client/assets/{collection-tabs-Dhx2wMNU.js → collection-tabs-BtxGuG1G.js} +1 -1
- package/dist/client/assets/{command-DjqCY9Vi.js → command-Sec7WA_A.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-D5J7bOeb.js → commerce-onboarding-DOH59RlG.js} +1 -1
- package/dist/client/assets/{companions-core-Bn5T5Kw9.js → companions-core-CXq5b4GI.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-D_e_16jN.js → connect-desktop-dialog-aCqZE31x.js} +1 -1
- package/dist/client/assets/{connection-card-FP7DKtbx.js → connection-card-DNDrESB-.js} +1 -1
- package/dist/client/assets/{connection-detail-Cr17GhO0.js → connection-detail-CPrWbBFM.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C7V7pVnH.js → connection-form-helpers-l_ijwaHD.js} +1 -1
- package/dist/client/assets/{connections-WWFvOY1G.js → connections-F5mve2lg.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BNj5yLz-.js → decopilot-sse-pool-BOQSRcee.js} +1 -1
- package/dist/client/assets/{dialog-pxztKdM4.js → dialog-CvsnsHc6.js} +1 -1
- package/dist/client/assets/{domain-settings-IJTQ43bo.js → domain-settings-B9EhJQUW.js} +1 -1
- package/dist/client/assets/{drawer-eINF-fuO.js → drawer-D8dHZiX8.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CRae2C9x.js → dropdown-menu-C1qlOMZ7.js} +1 -1
- package/dist/client/assets/{empty-state-DvObzH8u.js → empty-state-DA8bHc-1.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CeFGCUkk.js → extract-connection-data-CTvABTjg.js} +1 -1
- package/dist/client/assets/{file-explorer-3SJ4vb--.js → file-explorer-DLyQqFEm.js} +1 -1
- package/dist/client/assets/{file-type-icon-zSQ0dOtZ.js → file-type-icon-DnyFLF_v.js} +1 -1
- package/dist/client/assets/{files-CjIuQ02f.js → files-SyN3ok5O.js} +1 -1
- package/dist/client/assets/{form--yMAb3ro.js → form-DWLFR7nn.js} +1 -1
- package/dist/client/assets/{general-B9pSq-fb.js → general-CBHFRb3j.js} +1 -1
- package/dist/client/assets/{github-repo-picker-Cgx6amzW.js → github-repo-picker-BnPj766W.js} +1 -1
- package/dist/client/assets/{hooks-C8ac-vFI.js → hooks-DPnPW1Ib.js} +1 -1
- package/dist/client/assets/{index-Bb03HxpV.js → index-B4M08Kup.js} +1 -1
- package/dist/client/assets/{index-SNB4eexL.js → index-BOTjGzy-.js} +1 -1
- package/dist/client/assets/{index-BeXgUXox.js → index-BP1MoKqU.js} +2 -2
- package/dist/client/assets/{index-CDvq8kTD.js → index-BS_H3vZJ.js} +1 -1
- package/dist/client/assets/{index-BSVi3cEY.js → index-BvCHxsMv.js} +1 -1
- package/dist/client/assets/{index-32Z_4GES.js → index-C2u4siS5.js} +3 -3
- package/dist/client/assets/{index-CmqIldWF.js → index-C652yWgR.js} +1 -1
- package/dist/client/assets/{index-xVsqSBJP.js → index-C8qWG1s1.js} +1 -1
- package/dist/client/assets/{index-BsOcdcPy.js → index-CfPj3M1l.js} +1 -1
- package/dist/client/assets/{index-CyCC6Kib.js → index-Cg3sR771.js} +5 -5
- package/dist/client/assets/{index-Cx9R0N8d.js → index-CnYXLAS2.js} +1 -1
- package/dist/client/assets/{index-3nwYTcZz.js → index-CuO_-GZV.js} +1 -1
- package/dist/client/assets/{index-BFiY8eXY.js → index-D3xpdmzO.js} +1 -1
- package/dist/client/assets/{index-ZgzVcEPr.js → index-gs_-K8Xc.js} +1 -1
- package/dist/client/assets/{index-redirect-CiTCXVUI.js → index-redirect-B0vIbjhT.js} +1 -1
- package/dist/client/assets/{input-DNRaDhXk.js → input-Cb7CGqPN.js} +1 -1
- package/dist/client/assets/{integration-icon-Bj_L5G59.js → integration-icon-J19ZNMb3.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DTrnC4Ns.js → invite-member-dialog-BktkDK4v.js} +1 -1
- package/dist/client/assets/{label-DqJN0Zl6.js → label-DhK5GRHz.js} +1 -1
- package/dist/client/assets/{layout-BkG06DbR.js → layout-mvz0VkGf.js} +1 -1
- package/dist/client/assets/{login-C9VxLGwl.js → login-DnHBlyYy.js} +1 -1
- package/dist/client/assets/{mcp-oauth-ClvvvmOF.js → mcp-oauth-BC7utMST.js} +1 -1
- package/dist/client/assets/{members-CkIyByQ6.js → members-CtWVlKsQ.js} +1 -1
- package/dist/client/assets/{monaco-editor-D20TtRkQ.js → monaco-editor-BIYcRCql.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DZJthgJ6.js → monitoring-stats-row-IQKypVBe.js} +1 -1
- package/dist/client/assets/{multi-select-DypU6S8g.js → multi-select-34xx2CMv.js} +1 -1
- package/dist/client/assets/{oauth-callback-CU0eKEdH.js → oauth-callback-BGOH4D8o.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-4FUqXMlc.js → oauth-callback-ai-provider-PRHGkPfW.js} +1 -1
- package/dist/client/assets/{onboarding-C98UvNP1.js → onboarding-DLxx1gWn.js} +1 -1
- package/dist/client/assets/{org-install-DxjPueVj.js → org-install-Dwpb1igA.js} +1 -1
- package/dist/client/assets/{org-layout--0dYF5Rt.js → org-layout-bdr-vVje.js} +1 -1
- package/dist/client/assets/{organization-choice-BtDkbSqS.js → organization-choice-CIPEZcwe.js} +1 -1
- package/dist/client/assets/{orgs-Cau5_2Ta.js → orgs-od-Pv3L_.js} +1 -1
- package/dist/client/assets/{page-seo-form-DUIIg46E.js → page-seo-form-Dki7TfnI.js} +1 -1
- package/dist/client/assets/page-seo-sheet-IGjlhmAS.js +1 -0
- package/dist/client/assets/{popover-RIaRL7oB.js → popover-DfzsvCwC.js} +1 -1
- package/dist/client/assets/{post-editor-CSFQcBXM.js → post-editor-D9D6bmBX.js} +1 -1
- package/dist/client/assets/{primitives-CcasBN-m.js → primitives-BldH5G0Y.js} +1 -1
- package/dist/client/assets/{profile-CGP5jgHZ.js → profile-p6-RhyAf.js} +1 -1
- package/dist/client/assets/project-app-view-jcmOJAzs.js +1 -0
- package/dist/client/assets/record-editor-mYDnFPKa.js +1 -0
- package/dist/client/assets/redirect-editor-DDOBLKqx.js +1 -0
- package/dist/client/assets/registry-Cwg8k1bk.js +2 -0
- package/dist/client/assets/{registry-layout-DTfv4xqc.js → registry-layout-B0C8DhKi.js} +1 -1
- package/dist/client/assets/{reports-CGJDic-D.js → reports-zyK4duNr.js} +1 -1
- package/dist/client/assets/{require-capability-Dl7MMUtS.js → require-capability-1lcUjA-x.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BN9gLlS8.js → required-auth-layout-B1JMkrdm.js} +1 -1
- package/dist/client/assets/{reset-password-Btk86aOM.js → reset-password-BqQSf4XO.js} +1 -1
- package/dist/client/assets/{roles-p1k02HxK.js → roles-lEZwMitt.js} +1 -1
- package/dist/client/assets/{search-input-DrcJxljH.js → search-input-CFD2CbeL.js} +1 -1
- package/dist/client/assets/{secrets-tpvThXzx.js → secrets-Duyv1ctC.js} +1 -1
- package/dist/client/assets/{sections-editor-BuHOy4hR.js → sections-editor-BvKO1Jmq.js} +1 -1
- package/dist/client/assets/{select-B_NF3ir8.js → select-DMy4CZEM.js} +1 -1
- package/dist/client/assets/{select-model-CD-bNwFP.js → select-model-CeH3eiDd.js} +1 -1
- package/dist/client/assets/{self-tool-result-CQ9Oidp5.js → self-tool-result-CrTztwJC.js} +1 -1
- package/dist/client/assets/{seo-editor-tD1KbIp4.js → seo-editor-C8dIZ0r1.js} +1 -1
- package/dist/client/assets/{settings-layout-CIwY5Rcg.js → settings-layout-DYLu6KAT.js} +1 -1
- package/dist/client/assets/{settings-section-qHo4Kia8.js → settings-section-C9wxXn_P.js} +1 -1
- package/dist/client/assets/{shell-controls-DJ7fzt-b.js → shell-controls-Dn6r6Au7.js} +1 -1
- package/dist/client/assets/{shell-layout-gqjfXR2N.js → shell-layout-BBgOrDIL.js} +1 -1
- package/dist/client/assets/{sidebar-ChQMKige.js → sidebar-odBC32K5.js} +1 -1
- package/dist/client/assets/{skeleton-TPY4BgOd.js → skeleton-BTXeFNOv.js} +1 -1
- package/dist/client/assets/{sso-DwXA1_HM.js → sso-_Rhk71dv.js} +1 -1
- package/dist/client/assets/{store-DrJy9eqh.js → store-BHQI7MeI.js} +1 -1
- package/dist/client/assets/store-registry-E2glxuZA.js +2 -0
- package/dist/client/assets/{studio-tools-n8590dlO.js → studio-tools-DScMFawl.js} +1 -1
- package/dist/client/assets/{switch-Vi8KqJDK.js → switch-Ds8K2Lh_.js} +1 -1
- package/dist/client/assets/{table-4z3VGMcV.js → table-BW9KHE3_.js} +1 -1
- package/dist/client/assets/{tabs-C1aAnItW.js → tabs-DVwZBWMX.js} +1 -1
- package/dist/client/assets/{textarea-BIQq3kPx.js → textarea-CTeZ2lal.js} +1 -1
- package/dist/client/assets/{toggle-group-Buak4Ijq.js → toggle-group-BSTIOzYn.js} +1 -1
- package/dist/client/assets/{toolbar-ChkgagFk.js → toolbar-CgZE309S.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D0eZmrE1.js → toolbar-icon-button-8zS2muhz.js} +1 -1
- package/dist/client/assets/{tooltip-CpOqB12v.js → tooltip-DK2r83_Q.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DcaGLvIS.js → use-ai-providers-DHwTb1GL.js} +1 -1
- package/dist/client/assets/{use-automations-CuxMc1af.js → use-automations-BJ1_8SDs.js} +1 -1
- package/dist/client/assets/{use-autosave-CKpQpnkI.js → use-autosave-CY_dkvOM.js} +1 -1
- package/dist/client/assets/{use-capability-x8vfxJ7c.js → use-capability-ML8qbFhc.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BXhg46lH.js → use-clock-tick-D6R8tdxE.js} +1 -1
- package/dist/client/assets/{use-collections-CRs3mssF.js → use-collections-D6OYG-wc.js} +1 -1
- package/dist/client/assets/{use-connection-TbmZTa2Q.js → use-connection-B5YB38XE.js} +1 -1
- package/dist/client/assets/{use-copy-GJ89hYnU.js → use-copy-BkTOsha4.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D4A9sXWT.js → use-create-virtual-mcp-mhzGZuKh.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DxPGO2nZ.js → use-debounced-autosave-sFFdGAPI.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D3KV6ORm.js → use-debounced-value-BWIL-1on.js} +1 -1
- package/dist/client/assets/{use-deco-credits-FWA0HDvb.js → use-deco-credits-Sg-ppvw1.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BAuSsk9W.js → use-decopilot-events-D35HEWEA.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DP2vl3YF.js → use-delete-connection-Cv3MGM8b.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DxJ9HX0C.js → use-deployment-admin-C3okapNs.js} +1 -1
- package/dist/client/assets/{use-file-configs-CuD4x2Qa.js → use-file-configs-BCPI-hCq.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DDA5AXOs.js → use-infinite-scroll-CAmtVNGd.js} +1 -1
- package/dist/client/assets/{use-join-requests-Bv2XJLBI.js → use-join-requests-mb4WWMEm.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DlG18-0i.js → use-mcp-auth-status-AcbyV1My.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Y-YAGLhv.js → use-mcp-client-ioNtd9Ao.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-UKnbu9YR.js → use-mcp-tools-DC9bMhqt.js} +1 -1
- package/dist/client/assets/{use-members-DSdmplcs.js → use-members-C5fA1N1j.js} +1 -1
- package/dist/client/assets/{use-mobile-Dfj2nxpB.js → use-mobile-Xv_R9Qvv.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DYHGQgra.js → use-navigate-to-agent-6EBjGP72.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DSB0aKlT.js → use-org-auth-client-17utjSn0.js} +1 -1
- package/dist/client/assets/{use-org-sso-e8s6CsXn.js → use-org-sso-DL3XEgfJ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bq0KJEFt.js → use-organization-roles-CNET-j1d.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bj1mes2i.js → use-organization-settings-AW4Wtsqe.js} +1 -1
- package/dist/client/assets/{use-registry-app-UpQczPyM.js → use-registry-app-DboVWLxl.js} +1 -1
- package/dist/client/assets/{use-registry-connections-HQz0dDkM.js → use-registry-connections-Chwp5-AC.js} +1 -1
- package/dist/client/assets/{use-secrets-CyDme1l0.js → use-secrets-oaZoGdZ_.js} +1 -1
- package/dist/client/assets/{use-status-sounds-t_gRyaZh.js → use-status-sounds-DBpucGQh.js} +1 -1
- package/dist/client/assets/{use-view-mode-BE4pCHrP.js → use-view-mode-BVrJNwcR.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-1CuGEk-Q.js → use-virtual-mcp-ak6oQOpL.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DNnEgm4S.js +1 -0
- package/dist/client/assets/{useRouterState-B5TWQiWs.js → useRouterState-Dx8mQ23z.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BX2_Qxr6.js +1 -0
- package/dist/client/assets/{users-BcJP-c4R.js → users-CCS1SYP5.js} +1 -1
- package/dist/client/assets/{variant-calendar-Caqpyytx.js → variant-calendar-WXrlvvRY.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DhFesbxw.js → view-mode-toggle-DoOv5WAT.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +195 -195
- package/dist/server/server.js +159 -159
- package/package.json +1 -1
- package/dist/client/assets/automation-runs-B-V_i0FR.js +0 -87
- package/dist/client/assets/page-seo-sheet-ta7l_YbU.js +0 -1
- package/dist/client/assets/project-app-view-DmcoaFOE.js +0 -1
- package/dist/client/assets/record-editor-Dd2x-h5p.js +0 -1
- package/dist/client/assets/redirect-editor-CNwZ4fIt.js +0 -1
- package/dist/client/assets/registry-BLbhzFCc.js +0 -2
- package/dist/client/assets/store-registry-Bsp3lSub.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BYifa8Cc.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CgX7veRN.js +0 -1
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import{r as _,c as P,J as Ci,j as a,B as tt,I as cr,H as _i,M as Ai,l as q,p as Ii,aR as Ei,aO as Ge,aV as Li,aU as Ke,ba as Et,aS as it,bJ as Fr,aQ as Br,C as He,n as Mi,d as Ri,K as ke,t as Yn,m as Lt,b as mt,E as Ur,aL as Wr,bK as ks,aT as Pi,bL as Qe}from"./index-32Z_4GES.js";import{e as $i}from"./select-B_NF3ir8.js";import{u as Kr}from"./useInfiniteQuery-BYifa8Cc.js";import{a as Vr,u as Oi}from"./use-connection-TbmZTa2Q.js";import{j as Di,u as Ss,b as Hi,i as zi,a as Fi,S as Bi}from"./use-mcp-client-Y-YAGLhv.js";import{u as Ui}from"./use-virtual-mcp-1CuGEk-Q.js";import{C as Wi}from"./card-D4CJeQSR.js";import{o as Gr,m as qr,p as js,q as ws}from"./sidebar-ChQMKige.js";import{c as Xr,d as Yr,a as Tn,e as ye,b as Qr,T as ve}from"./table-4z3VGMcV.js";import{E as Qn}from"./empty-state-DvObzH8u.js";import{u as Ts}from"./use-infinite-scroll-DDA5AXOs.js";import{u as Ki}from"./use-members-DSdmplcs.js";import{u as Jr,S as ct}from"./use-clock-tick-BXhg46lH.js";import{e as Vi}from"./use-automations-CuxMc1af.js";import{u as Zr}from"./studio-tools-n8590dlO.js";import{u as Gi}from"./useSuspenseInfiniteQuery-CgX7veRN.js";import{A as eo}from"./avatar-f9PWmWko.js";import{t as Wt}from"./ChevronDown-DnuZlbXl.js";import{i as Ns,n as Jn}from"./ChevronUp-SvG4tBeC.js";import{t as qi,a as to,n as Cs}from"./Tool02-CJRfU6-e.js";import{f as Xi,aA as Yi,aB as Qi,Z as Ji,x as Zi,aC as ea,a4 as ta,ak as na,k as sa,ay as no,aD as ra,aE as oa,A as so,aF as Le,aG as ia,n as aa}from"./agent-icon-D4a2yQAy.js";import{t as Nn}from"./Stars01-Dq_ij1vd.js";import{i as ro,b as Rt}from"./XCircle-DY497Rjn.js";import{i as ur}from"./ChevronRight-D8z61LL4.js";import{a as oo}from"./Copy01-8RoWdlIb.js";import{b as Ve,t as _s,c as dr}from"./format-time-BnbuEtat.js";import{u as io}from"./use-copy-GJ89hYnU.js";import{T as nt,a as st,b as rt}from"./tooltip-CpOqB12v.js";import{M as As,I as ao,F as la}from"./file-type-icon-zSQ0dOtZ.js";import{R as ca,c as ua,r as da,g as fa}from"./hooks-C8ac-vFI.js";import{S as ma,h as pt,m as pa,c as Is,d as ha,b as ga}from"./chat-context-0yEIHZ6c.js";import{c as xa}from"./monaco-editor-D20TtRkQ.js";import{g as lo,M as ba}from"./index-SNB4eexL.js";import{f as ya,n as va,o as ka}from"./tab-id-BijBBRwE.js";import{N as fe,R as Sa,k as ja,a as Se,l as wa,F as fr,S as co,T as Ze,m as Ta,n as Es,D as Nt,h as Cn,o as Ct,P as Te,p as Na,e as Ne,q as Ca,r as _a,s as Aa,v as uo,w as ut,x as ae,y as ht,z as ot,A as dt,B as Zn,G as Ia,H as Ea,I as La,J as Ma,K as Ra,L as Pa,O as $a,Q as fo,U as es,V as Oa,W as Da,X as mo,Y as Ha,Z as za,_ as mr,t as Fa,$ as Ce,a0 as gt,c as Ba,u as Ua,M as Wa,d as Ka}from"./calendar-CL1lHfJI.js";import{i as po}from"./AlertCircle-DriHvGW8.js";import{s as Va}from"./Eye-BMB6Dsvc.js";import{s as Kt,t as ho}from"./Star01-BvPb97r4.js";import{s as Ga}from"./XClose-C4EmtqAA.js";import{n as ts}from"./ZapSquare-DiXc_WiU.js";import{n as go,i as qa}from"./Globe01-C6g7oQ38.js";import{c as Xa,b as Ya}from"./Tool01-1JY4WdfO.js";import{i as pr,a as Qa}from"./ZoomOut-DO1ABQMU.js";import{i as yt}from"./Monitor01-CDUuvvya.js";import{i as Ja}from"./SearchMd-B2xdLkpr.js";import{i as Za}from"./Upload01-CPQnKMdb.js";import{u as el,a as tl}from"./shell-layout-gqjfXR2N.js";import{a as Pt}from"./Image01-YE-JCd5P.js";import{n as xo}from"./LinkExternal01-BYMM_QSD.js";import{I as qe}from"./integration-icon-Bj_L5G59.js";import{i as nl}from"./ArrowUpRight-CsopTrXA.js";import{a as Ls}from"./Users03-01ZOLPet.js";import{a as Me}from"./Palette-wIBeqOmX.js";import{c as bo}from"./use-navigate-to-agent-DYHGQgra.js";import{a as sl}from"./Stars02-D0dtbcP0.js";import{g as rl}from"./AreaChart-BU465nht.js";import{a as ol,D as il,c as al,d as ll,e as cl}from"./dialog-pxztKdM4.js";import{a as ul,F as dl,b as fl,c as ml,d as pl,f as hl}from"./form--yMAb3ro.js";import{I as gl}from"./input-DNRaDhXk.js";const xl={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 yo(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(xl)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function vo(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function ko(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,s=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+yo(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+s}}function Mp(t){return t.reduce((e,n)=>ko(e,n.metadata?.usage),vo())}const bl={damping:.7,stiffness:.05,mass:1.25},yl=70,vl=1e3/60,kl=350;let _n=!1;globalThis.document?.addEventListener("mousedown",()=>{_n=!0});globalThis.document?.addEventListener("mouseup",()=>{_n=!1});globalThis.document?.addEventListener("click",()=>{_n=!1});const Sl=(t={})=>{const[e,n]=_.useState(!1),[s,r]=_.useState(t.initial!==!1),[o,i]=_.useState(!1),l=_.useRef(null);l.current=t;const u=_.useCallback(()=>{if(!_n)return!1;const y=window.getSelection();if(!y||!y.rangeCount)return!1;const v=y.getRangeAt(0);return v.commonAncestorContainer.contains(x.current)||x.current?.contains(v.commonAncestorContainer)},[]),c=_.useCallback(y=>{d.isAtBottom=y,r(y)},[]),m=_.useCallback(y=>{d.escapedFromLock=y,n(y)},[]),d=_.useMemo(()=>{let y;return{escapedFromLock:e,isAtBottom:s,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return x.current?.scrollTop??0},set scrollTop(v){if(x.current){const{scrollBehavior:k}=getComputedStyle(x.current);k!=="auto"&&(x.current.style.scrollBehavior="auto"),x.current.scrollTop=v,d.ignoreScrollToTop=x.current.scrollTop,k!=="auto"&&(x.current.style.scrollBehavior=k)}},get targetScrollTop(){return!x.current||!b.current?0:x.current.scrollHeight-1-x.current.clientHeight},get calculatedTargetScrollTop(){if(!x.current||!b.current)return 0;const{targetScrollTop:v}=this;if(!t.targetScrollTop)return v;if(y?.targetScrollTop===v)return y.calculatedScrollTop;const k=Math.max(Math.min(t.targetScrollTop(v,{scrollElement:x.current,contentElement:b.current}),v),0);return y={targetScrollTop:v,calculatedScrollTop:k},requestAnimationFrame(()=>{y=void 0}),k},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=yl}}},[]),f=_.useCallback((y={})=>{typeof y=="string"&&(y={animation:y}),y.preserveScrollPosition||c(!0);const v=Date.now()+(Number(y.wait)||0),k=On(l.current,y.animation),{ignoreEscapes:j=!1}=y;let S,w=d.calculatedTargetScrollTop;y.duration instanceof Promise?y.duration.finally(()=>{S=Date.now()}):S=v+(y.duration??0);const T=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:C}=d,I=performance.now(),M=(I-(d.lastTick??I))/vl;if(d.animation||(d.animation={behavior:k,promise:N,ignoreEscapes:j}),d.animation.behavior===k&&(d.lastTick=I),u()||v>Date.now())return T();if(C<Math.min(w,d.calculatedTargetScrollTop)){if(d.animation?.behavior===k){if(k==="instant")return d.scrollTop=d.calculatedTargetScrollTop,T();d.velocity=(k.damping*d.velocity+k.stiffness*d.scrollDifference)/k.mass,d.accumulated+=d.velocity*M,d.scrollTop+=d.accumulated,d.scrollTop!==C&&(d.accumulated=0)}return T()}return S>Date.now()?(w=d.calculatedTargetScrollTop,T()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:On(l.current,l.current.resize),ignoreEscapes:j,duration:Math.max(0,S-Date.now())||void 0}):d.isAtBottom)});return N.then(C=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),C))};return y.wait!==!0&&(d.animation=void 0),d.animation?.behavior===k?d.animation.promise:T()},[c,u,d]),p=_.useCallback(()=>{m(!0),c(!1)},[m,c]),h=_.useCallback(({target:y})=>{if(y!==x.current)return;const{scrollTop:v,ignoreScrollToTop:k}=d;let{lastScrollTop:j=v}=d;d.lastScrollTop=v,d.ignoreScrollToTop=void 0,k&&k>v&&(j=k),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||v===k)return;if(u()){m(!0),c(!1);return}const S=v>j,w=v<j;if(d.animation?.ignoreEscapes){d.scrollTop=j;return}w&&(m(!0),c(!1)),S&&m(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[m,c,u,d]),g=_.useCallback(({target:y,deltaY:v})=>{let k=y;for(;!["scroll","auto"].includes(getComputedStyle(k).overflow);){if(!k.parentElement)return;k=k.parentElement}k===x.current&&v<0&&x.current.scrollHeight>x.current.clientHeight&&!d.animation?.ignoreEscapes&&(m(!0),c(!1))},[m,c,d]),x=hr(y=>{x.current?.removeEventListener("scroll",h),x.current?.removeEventListener("wheel",g),y?.addEventListener("scroll",h,{passive:!0}),y?.addEventListener("wheel",g,{passive:!0})},[]),b=hr(y=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!y)return;let v;d.resizeObserver=new ResizeObserver(([k])=>{const{height:j}=k.contentRect,S=j-(v??j);if(d.resizeDifference=S,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),S>=0){const w=On(l.current,v?l.current.resize:l.current.initial);f({animation:w,wait:!0,preserveScrollPosition:!0,duration:w==="instant"?void 0:kl})}else d.isNearBottom&&(m(!1),c(!0));v=j,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===S&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(y)},[]);return{contentRef:b,scrollRef:x,scrollToBottom:f,stopScroll:p,isAtBottom:s||o,isNearBottom:o,escapedFromLock:e,state:d}};function hr(t,e){const n=_.useCallback(s=>(n.current=s,t(s)),e);return n}const $n=new Map;function On(...t){const e={...bl};let n=!1;for(const r of t){if(r==="instant"){n=!0;continue}typeof r=="object"&&(n=!1,e.damping=r.damping??e.damping,e.stiffness=r.stiffness??e.stiffness,e.mass=r.mass??e.mass)}const s=JSON.stringify(e);return $n.has(s)||$n.set(s,Object.freeze(e)),n?"instant":$n.get(s)}function jl(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Ms(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Rs(t,e){if(!e)return t;const n=`${jl(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function wl(t,e){return Rs(t,e).replace(/[_-]/g," ").toLowerCase()}function Tl(t){const e={};for(const n of t?.arguments??[])e[n.name]=n.required?cr().min(1,"Required"):cr();return _i(e)}function Nl(t,e){const n={};for(const s of t.arguments??[])n[s.name]=e?.[s.name]??"";return n}function Cl(t){const e=P.c(67),{prompt:n,setPrompt:s,onSubmit:r,defaultValues:o}=t,i=_.useId();let l,u;if(e[0]!==n){const R=Tl(n);u=Ai,l=Ci(R),e[0]=n,e[1]=l,e[2]=u}else l=e[1],u=e[2];let c;e[3]!==o||e[4]!==n?(c=n?Nl(n,o):{},e[3]=o,e[4]=n,e[5]=c):c=e[5];let m;e[6]!==l||e[7]!==c?(m={resolver:l,defaultValues:c,mode:"onChange"},e[6]=l,e[7]=c,e[8]=m):m=e[8];const d=u(m);let f;e[9]!==n?.arguments?(f=n?.arguments??[],e[9]=n?.arguments,e[10]=f):f=e[10];const p=f;let h;e[11]!==d||e[12]!==r||e[13]!==s?(h=async R=>{await r(R),s(null),d.reset()},e[11]=d,e[12]=r,e[13]=s,e[14]=h):h=e[14];const g=h;let x;e[15]!==d||e[16]!==s?(x=R=>{R||(d.reset(),s(null))},e[15]=d,e[16]=s,e[17]=x):x=e[17];const b=x;if(!n)return null;let y;e[18]!==n._meta||e[19]!==n.name||e[20]!==n.title?(y=n.title||wl(n.name,Ms(n._meta)),e[18]=n._meta,e[19]=n.name,e[20]=n.title,e[21]=y):y=e[21];let v;e[22]!==y?(v=a.jsx(ol,{children:a.jsx("span",{className:"capitalize",children:y})}),e[22]=y,e[23]=v):v=e[23];let k;e[24]!==n.description?(k=n.description&&a.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=k):k=e[25];let j;e[26]!==k||e[27]!==v?(j=a.jsxs(il,{children:[v,k]}),e[26]=k,e[27]=v,e[28]=j):j=e[28];let S;e[29]!==d||e[30]!==g?(S=R=>{R.stopPropagation(),d.handleSubmit(g)(R)},e[29]=d,e[30]=g,e[31]=S):S=e[31];let w;if(e[32]!==p||e[33]!==d.control||e[34]!==d.formState.isSubmitting){let R;e[36]!==d.control||e[37]!==d.formState.isSubmitting?(R=D=>a.jsx(dl,{control:d.control,name:D.name,render:H=>{const{field:F}=H;return a.jsxs(fl,{children:[a.jsxs(ml,{className:"text-xs",children:[D.name,D.required?null:a.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),a.jsx(pl,{children:a.jsx(gl,{...F,value:F.value??"",required:D.required,placeholder:D.description??"",className:"h-9",disabled:d.formState.isSubmitting})}),a.jsx(hl,{})]})}},D.name),e[36]=d.control,e[37]=d.formState.isSubmitting,e[38]=R):R=e[38],w=p.map(R),e[32]=p,e[33]=d.control,e[34]=d.formState.isSubmitting,e[35]=w}else w=e[35];let T;e[39]!==b?(T=()=>b(!1),e[39]=b,e[40]=T):T=e[40];let N;e[41]!==d.formState.isSubmitting||e[42]!==T?(N=a.jsx(tt,{type:"button",variant:"ghost",onClick:T,disabled:d.formState.isSubmitting,children:"Cancel"}),e[41]=d.formState.isSubmitting,e[42]=T,e[43]=N):N=e[43];let C;e[44]!==d.formState.isSubmitting?(C=d.formState.isSubmitting?a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(ma,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=d.formState.isSubmitting,e[45]=C):C=e[45];let I;e[46]!==d.formState.isSubmitting||e[47]!==i||e[48]!==C?(I=a.jsx(tt,{type:"submit",form:i,disabled:d.formState.isSubmitting,children:C}),e[46]=d.formState.isSubmitting,e[47]=i,e[48]=C,e[49]=I):I=e[49];let M;e[50]!==N||e[51]!==I?(M=a.jsxs(al,{children:[N,I]}),e[50]=N,e[51]=I,e[52]=M):M=e[52];let A;e[53]!==i||e[54]!==S||e[55]!==w||e[56]!==M?(A=a.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[w,M]}),e[53]=i,e[54]=S,e[55]=w,e[56]=M,e[57]=A):A=e[57];let $;e[58]!==d||e[59]!==A?($=a.jsx(ul,{...d,children:A}),e[58]=d,e[59]=A,e[60]=$):$=e[60];let E;e[61]!==j||e[62]!==$?(E=a.jsxs(ll,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[j,$]}),e[61]=j,e[62]=$,e[63]=E):E=e[63];let O;return e[64]!==b||e[65]!==E?(O=a.jsx(cl,{open:!0,onOpenChange:b,children:E}),e[64]=b,e[65]=E,e[66]=O):O=e[66],O}const _l=/^mcp__[a-zA-Z0-9_-]+__/;function So(t){return t.replace(_l,"")}function An(t){const e=P.c(18),{id:n,part:s,copyable:r,extraActions:o,alwaysShowActions:i,animate:l}=t,u=r===void 0?!1:r,c=i===void 0?!1:i,m=l===void 0?!1:l,{handleCopy:d}=io(),[f,p]=_.useState(!1);let h;e[0]!==d||e[1]!==n||e[2]!==s.text?(h=async()=>{Ii("chat_message_copied",{message_id:n,chars:s.text.length}),await d(s.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=d,e[1]=n,e[2]=s.text,e[3]=h):h=e[3];const g=h,x=u&&o,b=x||o;let y;e[4]!==m||e[5]!==n||e[6]!==s.text?(y=a.jsx(As,{id:n,text:s.text,animate:m}),e[4]=m,e[5]=n,e[6]=s.text,e[7]=y):y=e[7];let v;e[8]!==c||e[9]!==o||e[10]!==g||e[11]!==f||e[12]!==b||e[13]!==x?(v=b&&a.jsxs("div",{className:q("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",c?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[o,x&&o&&a.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),x&&a.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:f?a.jsx(Ns,{className:"size-4"}):a.jsx(oo,{className:"size-4"})})]}),e[8]=c,e[9]=o,e[10]=g,e[11]=f,e[12]=b,e[13]=x,e[14]=v):v=e[14];let k;return e[15]!==y||e[16]!==v?(k=a.jsxs("div",{className:"group/part relative",children:[y,v]}),e[15]=y,e[16]=v,e[17]=k):k=e[17],k}function Rp(t,e,n){t.chain().focus().insertContentAt(e,[Al(n),{type:"text",text:" "}]).run()}function Al(t){return{type:"file",attrs:t}}function Il(t){const e=P.c(17),{node:n,selected:s,view:r}=t,{name:o,mimeType:i,data:l}=n.attrs,u=s&&r.editable;let c;e[0]!==i?(c=i.startsWith("image/"),e[0]=i,e[1]=c):c=e[1];const m=c,d=u&&"outline-2 outline-blue-300 outline-offset-0";let f;e[2]!==d?(f=q("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",d),e[2]=d,e[3]=f):f=e[3];let p;e[4]!==o?(p=a.jsx(nt,{asChild:!0,children:a.jsx("span",{children:o})}),e[4]=o,e[5]=p):p=e[5];let h;e[6]!==l||e[7]!==m||e[8]!==i||e[9]!==o?(h=a.jsx(st,{side:"top",className:"max-w-sm p-1.5",children:m?a.jsx("img",{src:`data:${i};base64,${l}`,alt:o,className:"max-w-full max-h-64 object-contain rounded"}):a.jsxs("div",{className:"text-xs",children:[a.jsx("div",{className:"font-medium",children:o}),a.jsx("div",{className:"text-muted-foreground mt-1",children:i})]})}),e[6]=l,e[7]=m,e[8]=i,e[9]=o,e[10]=h):h=e[10];let g;e[11]!==p||e[12]!==h?(g=a.jsxs(rt,{children:[p,h]}),e[11]=p,e[12]=h,e[13]=g):g=e[13];let x;return e[14]!==f||e[15]!==g?(x=a.jsx(ja,{className:f,children:g}),e[14]=f,e[15]=g,e[16]=x):x=e[16],x}const El=fe.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id")||null,renderHTML:t=>t.id?{"data-id":t.id}:{}},name:{default:null,parseHTML:t=>t.getAttribute("data-name")||null,renderHTML:t=>t.name?{"data-name":t.name}:{}},mimeType:{default:null,parseHTML:t=>t.getAttribute("data-mime-type")||null,renderHTML:t=>t.mimeType?{"data-mime-type":t.mimeType}:{}},size:{default:0,parseHTML:t=>{const e=t.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:t=>t.size?{"data-size":String(t.size)}:{}},data:{default:null,parseHTML:t=>t.getAttribute("data-data")||null,renderHTML:t=>t.data?{"data-data":t.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:t,HTMLAttributes:e}){const n={"data-type":"file"};return t.attrs.id&&(n["data-id"]=t.attrs.id),t.attrs.name&&(n["data-name"]=t.attrs.name),t.attrs.mimeType&&(n["data-mime-type"]=t.attrs.mimeType),t.attrs.size&&(n["data-size"]=String(t.attrs.size)),t.attrs.data&&(n["data-data"]=t.attrs.data),["span",{...e,...n}]},renderText({node:t}){return`[${t.attrs.name??""}]`},addNodeView(){return Sa(Il)}});function Ll(t={}){return new Se({view(e){return new Ml(e,t)}})}class Ml{constructor(e,n){var s;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(s=n.width)!==null&&s!==void 0?s:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let o=i=>{this[r](i)};return e.dom.addEventListener(r,o),{name:r,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,s,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,l=o.height/r.offsetHeight;if(n){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let h=p.getBoundingClientRect(),g=d?h.bottom:h.top;d&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let x=this.width/2*l;s={left:h.left,right:h.right,top:g-x,bottom:g+x}}}}if(!s){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*i;s={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,m;if(!u||u==document.body&&getComputedStyle(u).position=="static")c=-pageXOffset,m=-pageYOffset;else{let d=u.getBoundingClientRect(),f=d.width/u.offsetWidth,p=d.height/u.offsetHeight;c=d.left-u.scrollLeft*f,m=d.top-u.scrollTop*p}this.element.style.left=(s.left-c)/i+"px",this.element.style.top=(s.top-m)/l+"px",this.element.style.width=(s.right-s.left)/i+"px",this.element.style.height=(s.bottom-s.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),s=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=s&&s.type.spec.disableDropCursor,o=typeof r=="function"?r(this.editorView,n,e):r;if(n&&!o){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=wa(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class oe extends Ct{constructor(e){super(e,e)}map(e,n){let s=e.resolve(n.map(this.head));return oe.valid(s)?new oe(s):Ct.near(s)}content(){return co.empty}eq(e){return e instanceof oe&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new oe(e.resolve(n.pos))}getBookmark(){return new Ps(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!Rl(e)||!Pl(e))return!1;let s=n.type.spec.allowGapCursor;if(s!=null)return s;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,s=!1){e:for(;;){if(!s&&oe.valid(e))return e;let r=e.pos,o=null;for(let i=e.depth;;i--){let l=e.node(i);if(n>0?e.indexAfter(i)<l.childCount:e.index(i)>0){o=l.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;r+=n;let u=e.doc.resolve(r);if(oe.valid(u))return u}for(;;){let i=n>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Es.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*n),s=!1;continue e}break}o=i,r+=n;let l=e.doc.resolve(r);if(oe.valid(l))return l}return null}}}oe.prototype.visible=!1;oe.findFrom=oe.findGapCursorFrom;Ct.jsonID("gapcursor",oe);class Ps{constructor(e){this.pos=e}map(e){return new Ps(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return oe.valid(n)?new oe(n):Ct.near(n)}}function jo(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function Rl(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),s=t.node(e);if(n==0){if(s.type.spec.isolating)return!0;continue}for(let r=s.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||jo(r.type))return!0;if(r.inlineContent)return!1}}return!0}function Pl(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),s=t.node(e);if(n==s.childCount){if(s.type.spec.isolating)return!0;continue}for(let r=s.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||jo(r.type))return!0;if(r.inlineContent)return!1}}return!0}function $l(){return new Se({props:{decorations:zl,createSelectionBetween(t,e,n){return e.pos==n.pos&&oe.valid(n)?new oe(n):null},handleClick:Dl,handleKeyDown:Ol,handleDOMEvents:{beforeinput:Hl}}})}const Ol=Ta({ArrowLeft:$t("horiz",-1),ArrowRight:$t("horiz",1),ArrowUp:$t("vert",-1),ArrowDown:$t("vert",1)});function $t(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(s,r,o){let i=s.selection,l=e>0?i.$to:i.$from,u=i.empty;if(i instanceof Ze){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=s.doc.resolve(e>0?l.after():l.before())}let c=oe.findGapCursorFrom(l,e,u);return c?(r&&r(s.tr.setSelection(new oe(c))),!0):!1}}function Dl(t,e,n){if(!t||!t.editable)return!1;let s=t.state.doc.resolve(e);if(!oe.valid(s))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&Es.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new oe(s))),!0)}function Hl(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof oe))return!1;let{$from:n}=t.state.selection,s=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!s)return!1;let r=fr.empty;for(let i=s.length-1;i>=0;i--)r=fr.from(s[i].createAndFill(null,r));let o=t.state.tr.replace(n.pos,n.pos,new co(r,0,0));return o.setSelection(Ze.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function zl(t){if(!(t.selection instanceof oe))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Nt.create(t.doc,[Cn.widget(t.selection.head,e,{key:"gapcursor"})])}var Vt=200,le=function(){};le.prototype.append=function(e){return e.length?(e=le.from(e),!this.length&&e||e.length<Vt&&this.leafAppend(e)||this.length<Vt&&e.leafPrepend(this)||this.appendInner(e)):this};le.prototype.prepend=function(e){return e.length?le.from(e).append(this):this};le.prototype.appendInner=function(e){return new Fl(this,e)};le.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?le.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};le.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};le.prototype.forEach=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length),n<=s?this.forEachInner(e,n,s,0):this.forEachInvertedInner(e,n,s,0)};le.prototype.map=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length);var r=[];return this.forEach(function(o,i){return r.push(e(o,i))},n,s),r};le.from=function(e){return e instanceof le?e:e&&e.length?new wo(e):le.empty};var wo=(function(t){function e(s){t.call(this),this.values=s}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,i,l){for(var u=o;u<i;u++)if(r(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,l){for(var u=o-1;u>=i;u--)if(r(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Vt)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Vt)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(le);le.empty=new wo([]);var Fl=(function(t){function e(n,s){t.call(this),this.left=n,this.right=s,this.length=n.length+s.length,this.depth=Math.max(n.depth,s.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(s){return s<this.left.length?this.left.get(s):this.right.get(s-this.left.length)},e.prototype.forEachInner=function(s,r,o,i){var l=this.left.length;if(r<l&&this.left.forEachInner(s,r,Math.min(o,l),i)===!1||o>l&&this.right.forEachInner(s,Math.max(r-l,0),Math.min(this.length,o)-l,i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(s,r,o,i){var l=this.left.length;if(r>l&&this.right.forEachInvertedInner(s,r-l,Math.max(o,l)-l,i+l)===!1||o<l&&this.left.forEachInvertedInner(s,Math.min(r,l),o,i)===!1)return!1},e.prototype.sliceInner=function(s,r){if(s==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(s,r):s>=o?this.right.slice(s-o,r-o):this.left.slice(s,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(s){var r=this.right.leafAppend(s);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(s){var r=this.left.leafPrepend(s);if(r)return new e(r,this.right)},e.prototype.appendInner=function(s){return this.left.depth>=Math.max(this.right.depth,s.depth)+1?new e(this.left,new e(this.right,s)):new e(this,s)},e})(le);const Bl=500;class we{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}let r,o;n&&(r=this.remapping(s,this.items.length),o=r.maps.length);let i=e.tr,l,u,c=[],m=[];return this.items.forEach((d,f)=>{if(!d.step){r||(r=this.remapping(s,f+1),o=r.maps.length),o--,m.push(d);return}if(r){m.push(new Ae(d.map));let p=d.step.map(r.slice(o)),h;p&&i.maybeStep(p).doc&&(h=i.mapping.maps[i.mapping.maps.length-1],c.push(new Ae(h,void 0,void 0,c.length+m.length))),o--,h&&r.appendMap(h,o)}else i.maybeStep(d.step);if(d.selection)return l=r?d.selection.map(r.slice(o)):d.selection,u=new we(this.items.slice(0,s).append(m.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:i,selection:l}}addTransform(e,n,s,r){let o=[],i=this.eventCount,l=this.items,u=!r&&l.length?l.get(l.length-1):null;for(let m=0;m<e.steps.length;m++){let d=e.steps[m].invert(e.docs[m]),f=new Ae(e.mapping.maps[m],d,n),p;(p=u&&u.merge(f))&&(f=p,m?o.pop():l=l.slice(0,l.length-1)),o.push(f),n&&(i++,n=void 0),r||(u=f)}let c=i-s.depth;return c>Wl&&(l=Ul(l,c),i-=c),new we(l.append(o),i)}remapping(e,n){let s=new Na;return this.items.forEach((r,o)=>{let i=r.mirrorOffset!=null&&o-r.mirrorOffset>=e?s.maps.length-r.mirrorOffset:void 0;s.appendMap(r.map,i)},e,n),s}addMaps(e){return this.eventCount==0?this:new we(this.items.append(e.map(n=>new Ae(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let s=[],r=Math.max(0,this.items.length-n),o=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},r);let u=n;this.items.forEach(f=>{let p=o.getMirror(--u);if(p==null)return;i=Math.min(i,p);let h=o.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),x=f.selection&&f.selection.map(o.slice(u+1,p));x&&l++,s.push(new Ae(h,g,x))}else s.push(new Ae(h))},r);let c=[];for(let f=n;f<i;f++)c.push(new Ae(o.maps[f]));let m=this.items.slice(0,r).append(c).append(s),d=new we(m,l);return d.emptyItemCount()>Bl&&(d=d.compress(this.items.length-s.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),s=n.maps.length,r=[],o=0;return this.items.forEach((i,l)=>{if(l>=e)r.push(i),i.selection&&o++;else if(i.step){let u=i.step.map(n.slice(s)),c=u&&u.getMap();if(s--,c&&n.appendMap(c,s),u){let m=i.selection&&i.selection.map(n.slice(s));m&&o++;let d=new Ae(c.invert(),u,m),f,p=r.length-1;(f=r.length&&r[p].merge(d))?r[p]=f:r.push(d)}}else i.map&&s--},this.items.length,0),new we(le.from(r.reverse()),o)}}we.empty=new we(le.empty,0);function Ul(t,e){let n;return t.forEach((s,r)=>{if(s.selection&&e--==0)return n=r,!1}),t.slice(n)}class Ae{constructor(e,n,s,r){this.map=e,this.step=n,this.selection=s,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Ae(n.getMap().invert(),n,this.selection)}}}class Be{constructor(e,n,s,r,o){this.done=e,this.undone=n,this.prevRanges=s,this.prevTime=r,this.prevComposition=o}}const Wl=20;function Kl(t,e,n,s){let r=n.getMeta(et),o;if(r)return r.historyState;n.getMeta(ql)&&(t=new Be(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(et))return i.getMeta(et).redo?new Be(t.done.addTransform(n,void 0,s,Bt(e)),t.undone,gr(n.mapping.maps),t.prevTime,t.prevComposition):new Be(t.done,t.undone.addTransform(n,void 0,s,Bt(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!i&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-s.newGroupDelay||!Vl(n,t.prevRanges)),c=i?Dn(t.prevRanges,n.mapping):gr(n.mapping.maps);return new Be(t.done.addTransform(n,u?e.selection.getBookmark():void 0,s,Bt(e)),we.empty,c,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Be(t.done.rebased(n,o),t.undone.rebased(n,o),Dn(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Be(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Dn(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Vl(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((s,r)=>{for(let o=0;o<e.length;o+=2)s<=e[o+1]&&r>=e[o]&&(n=!0)}),n}function gr(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((s,r,o,i)=>e.push(o,i));return e}function Dn(t,e){if(!t)return null;let n=[];for(let s=0;s<t.length;s+=2){let r=e.map(t[s],1),o=e.map(t[s+1],-1);r<=o&&n.push(r,o)}return n}function Gl(t,e,n){let s=Bt(e),r=et.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,s);if(!o)return null;let i=o.selection.resolve(o.transform.doc),l=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),r,s),u=new Be(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(i).setMeta(et,{redo:n,historyState:u})}let Hn=!1,xr=null;function Bt(t){let e=t.plugins;if(xr!=e){Hn=!1,xr=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Hn=!0;break}}return Hn}const et=new Te("history"),ql=new Te("closeHistory");function Xl(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Se({key:et,state:{init(){return new Be(we.empty,we.empty,null,0,-1)},apply(e,n,s){return Kl(n,s,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let s=n.inputType,r=s=="historyUndo"?No:s=="historyRedo"?Co:null;return!r||!e.editable?!1:(n.preventDefault(),r(e.state,e.dispatch))}}}})}function To(t,e){return(n,s)=>{let r=et.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(s){let o=Gl(r,n,t);o&&s(e?o.scrollIntoView():o)}return!0}}const No=To(!1,!0),Co=To(!0,!0);Ne.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const s=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(s)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Se({key:new Te("characterCount"),appendTransaction:(e,n,s)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const o=this.storage.characters({node:s.doc});if(o>r){const i=o-r,l=0,u=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const c=s.tr.deleteRange(l,u);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const s=this.options.limit;if(!e.docChanged||s===0||s===null||s===void 0)return!0;const r=this.storage.characters({node:n.doc}),o=this.storage.characters({node:e.doc});if(o<=s||r>s&&o>s&&o<=r)return!0;if(r>s&&o>s&&o>r||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=o-s,c=l-u,m=l;return e.deleteRange(c,m),!(this.storage.characters({node:e.doc})>s)}})]}});var Yl=Ne.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Ll(this.options)]}});Ne.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Se({key:new Te("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:s}=this.editor,{anchor:r}=e,o=[];if(!n||!s)return Nt.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((u,c)=>{if(u.isText)return;if(!(r>=c&&r<=c+u.nodeSize-1))return!1;i+=1});let l=0;return t.descendants((u,c)=>{if(u.isText||!(r>=c&&r<=c+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(Cn.node(c,c+u.nodeSize,{class:this.options.className}))}),Nt.create(t,o)}}})]}});var Ql=Ne.create({name:"gapCursor",addProseMirrorPlugins(){return[$l()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=_a(Aa(t,"allowGapCursor",n)))!=null?e:null}}}),br="placeholder";function Jl(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var Pp=Ne.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:br,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${Jl(this.options.dataAttribute)}`:`data-${br}`;return[new Se({key:new Te("placeholder"),props:{decorations:({doc:e,selection:n})=>{const s=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=n,o=[];if(!s)return null;const i=this.editor.isEmpty;return e.descendants((l,u)=>{const c=r>=u&&r<=u+l.nodeSize,m=!l.isLeaf&&Ca(l);if((c||!this.options.showOnlyCurrent)&&m){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const f=Cn.node(u,u+l.nodeSize,{class:d.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:u,hasAnchor:c}):this.options.placeholder});o.push(f)}return this.options.includeChildren}),Nt.create(e,o)}}})]}});Ne.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Se({key:new Te("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||uo(n.selection)||t.view.dragging?null:Nt.create(n.doc,[Cn.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function yr({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var Zl=Ne.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Te(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",s=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(n).includes(r.name));return[new Se({key:e,appendTransaction:(r,o,i)=>{const{doc:l,tr:u,schema:c}=i,m=e.getState(i),d=l.content.size,f=c.nodes[n];if(m)return u.insert(d,f.create())},state:{init:(r,o)=>{const i=o.tr.doc.lastChild;return!yr({node:i,types:s})},apply:(r,o)=>{if(!r.docChanged||r.getMeta("__uniqueIDTransaction"))return o;const i=r.doc.lastChild;return!yr({node:i,types:s})}}})]}}),ec=Ne.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>No(t,e),redo:()=>({state:t,dispatch:e})=>Co(t,e)}},addProseMirrorPlugins(){return[Xl(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Gt=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...s}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,s,n]},tc=/^\s*>\s$/,nc=fe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Gt("blockquote",{...ae(this.options.HTMLAttributes,t),children:Gt("slot",{})})},parseMarkdown:(t,e)=>{var n;const s=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,s(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",s=[];return t.content.forEach((r,o)=>{var i,l;const m=((l=(i=e.renderChild)==null?void 0:i.call(e,r,o))!=null?l:e.renderChildren([r])).split(`
|
|
2
|
-
`).map(d=>d.trim()===""?n:`${n} ${d}`);s.push(m.join(`
|
|
3
|
-
`))}),s.join(`
|
|
4
|
-
${n}
|
|
5
|
-
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ut({find:tc,type:this.type})]}}),sc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,rc=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,oc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ic=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ac=ht.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Gt("strong",{...ae(this.options.HTMLAttributes,t),children:Gt("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[dt({find:sc,type:this.type}),dt({find:oc,type:this.type})]},addPasteRules(){return[ot({find:rc,type:this.type}),ot({find:ic,type:this.type})]}}),lc=/(^|[^`])`([^`]+)`(?!`)$/,cc=/(^|[^`])`([^`]+)`(?!`)/g,uc=ht.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ae(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[dt({find:lc,type:this.type})]},addPasteRules(){return[ot({find:cc,type:this.type})]}}),zn=4,dc=/^```([a-z]+)?[\s\n]$/,fc=/^~~~([a-z]+)?[\s\n]$/,mc=fe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:zn,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const o=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ae(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,s;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((s=t.raw)==null?void 0:s.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let s="";const r=((n=t.attrs)==null?void 0:n.language)||"";return t.content?s=[`\`\`\`${r}`,e.renderChildren(t.content),"```"].join(`
|
|
6
|
-
`):s=`\`\`\`${r}
|
|
7
|
-
|
|
8
|
-
\`\`\``,s},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:zn,{state:s}=t,{selection:r}=s,{$from:o,empty:i}=r;if(o.parent.type!==this.type)return!1;const l=" ".repeat(n);return i?t.commands.insertContent(l):t.commands.command(({tr:u})=>{const{from:c,to:m}=r,p=s.doc.textBetween(c,m,`
|
|
9
|
-
`,`
|
|
10
|
-
`).split(`
|
|
11
|
-
`).map(h=>l+h).join(`
|
|
12
|
-
`);return u.replaceWith(c,m,s.schema.text(p)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:zn,{state:s}=t,{selection:r}=s,{$from:o,empty:i}=r;return o.parent.type!==this.type?!1:i?t.commands.command(({tr:l})=>{var u;const{pos:c}=o,m=o.start(),d=o.end(),p=s.doc.textBetween(m,d,`
|
|
13
|
-
`,`
|
|
14
|
-
`).split(`
|
|
15
|
-
`);let h=0,g=0;const x=c-m;for(let S=0;S<p.length;S+=1){if(g+p[S].length>=x){h=S;break}g+=p[S].length+1}const y=((u=p[h].match(/^ */))==null?void 0:u[0])||"",v=Math.min(y.length,n);if(v===0)return!0;let k=m;for(let S=0;S<h;S+=1)k+=p[S].length+1;return l.delete(k,k+v),c-k<=v&&l.setSelection(Ze.create(l.doc,k)),!0}):t.commands.command(({tr:l})=>{const{from:u,to:c}=r,f=s.doc.textBetween(u,c,`
|
|
16
|
-
`,`
|
|
17
|
-
`).split(`
|
|
18
|
-
`).map(p=>{var h;const g=((h=p.match(/^ */))==null?void 0:h[0])||"",x=Math.min(g.length,n);return p.slice(x)}).join(`
|
|
19
|
-
`);return l.replaceWith(u,c,s.schema.text(f)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:s,empty:r}=n;if(!r||s.parent.type!==this.type)return!1;const o=s.parentOffset===s.parent.nodeSize-2,i=s.parent.textContent.endsWith(`
|
|
20
|
-
|
|
21
|
-
`);return!o||!i?!1:t.chain().command(({tr:l})=>(l.delete(s.pos-2,s.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:s}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const l=r.after();return l===void 0?!1:s.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(Ct.near(s.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[Zn({find:dc,type:this.type,getAttributes:t=>({language:t[1]})}),Zn({find:fc,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Se({key:new Te("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),s=e.clipboardData.getData("vscode-editor-data"),r=s?JSON.parse(s):void 0,o=r?.mode;if(!n||!o)return!1;const{tr:i,schema:l}=t.state,u=l.text(n.replace(/\r\n?/g,`
|
|
22
|
-
`));return i.replaceSelectionWith(this.type.create({language:o},u)),i.selection.$from.parent.type!==this.type&&i.setSelection(Ze.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),pc=fe.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
23
|
-
|
|
24
|
-
`):""}),hc=fe.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ae(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
25
|
-
`},renderMarkdown:()=>`
|
|
26
|
-
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:s})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:o}=n;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:l}=s.extensionManager,u=o||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:m})=>{if(m&&u&&i){const d=u.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),gc=fe.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ae(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const s=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,r="#".repeat(s);return t.content?`${r} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Zn({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),xc=fe.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ae(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Ea(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:s}=n,r=t();return uo(n)?r.insertContentAt(s.pos,{type:this.name}):r.insertContent({type:this.name}),r.command(({state:o,tr:i,dispatch:l})=>{if(l){const{$to:u}=i.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?i.setSelection(Ze.create(i.doc,u.pos+1)):u.nodeAfter.isBlock?i.setSelection(Es.create(i.doc,u.pos)):i.setSelection(Ze.create(i.doc,u.pos));else{const m=o.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,d=m?.create();d&&(i.insert(c,d),i.setSelection(Ze.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Ia({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),bc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,yc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,vc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,kc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Sc=ht.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ae(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[dt({find:bc,type:this.type}),dt({find:vc,type:this.type})]},addPasteRules(){return[ot({find:yc,type:this.type}),ot({find:kc,type:this.type})]}});const jc="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",wc="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",ns="numeric",ss="ascii",rs="alpha",vt="asciinumeric",bt="alphanumeric",os="domain",_o="emoji",Tc="scheme",Nc="slashscheme",Fn="whitespace";function Cc(t,e){return t in e||(e[t]=[]),e[t]}function Je(t,e,n){e[ns]&&(e[vt]=!0,e[bt]=!0),e[ss]&&(e[vt]=!0,e[rs]=!0),e[vt]&&(e[bt]=!0),e[rs]&&(e[bt]=!0),e[bt]&&(e[os]=!0),e[_o]&&(e[os]=!0);for(const s in e){const r=Cc(s,n);r.indexOf(t)<0&&r.push(t)}}function _c(t,e){const n={};for(const s in e)e[s].indexOf(t)>=0&&(n[s]=!0);return n}function de(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}de.groups={};de.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let s=0;s<e.jr.length;s++){const r=e.jr[s][0],o=e.jr[s][1];if(o&&r.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,s){for(let r=0;r<t.length;r++)this.tt(t[r],e,n,s)},tr(t,e,n,s){s=s||de.groups;let r;return e&&e.j?r=e:(r=new de(e),n&&s&&Je(e,n,s)),this.jr.push([t,r]),r},ts(t,e,n,s){let r=this;const o=t.length;if(!o)return r;for(let i=0;i<o-1;i++)r=r.tt(t[i]);return r.tt(t[o-1],e,n,s)},tt(t,e,n,s){s=s||de.groups;const r=this;if(e&&e.j)return r.j[t]=e,e;const o=e;let i,l=r.go(t);if(l?(i=new de,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new de,o){if(s)if(i.t&&typeof i.t=="string"){const u=Object.assign(_c(i.t,s),n);Je(o,u,s)}else n&&Je(o,n,s);i.t=o}return r.j[t]=i,i}};const W=(t,e,n,s,r)=>t.ta(e,n,s,r),re=(t,e,n,s,r)=>t.tr(e,n,s,r),vr=(t,e,n,s,r)=>t.ts(e,n,s,r),L=(t,e,n,s,r)=>t.tt(e,n,s,r),De="WORD",is="UWORD",Ao="ASCIINUMERICAL",Io="ALPHANUMERICAL",_t="LOCALHOST",as="TLD",ls="UTLD",Ut="SCHEME",at="SLASH_SCHEME",$s="NUM",cs="WS",Os="NL",kt="OPENBRACE",St="CLOSEBRACE",qt="OPENBRACKET",Xt="CLOSEBRACKET",Yt="OPENPAREN",Qt="CLOSEPAREN",Jt="OPENANGLEBRACKET",Zt="CLOSEANGLEBRACKET",en="FULLWIDTHLEFTPAREN",tn="FULLWIDTHRIGHTPAREN",nn="LEFTCORNERBRACKET",sn="RIGHTCORNERBRACKET",rn="LEFTWHITECORNERBRACKET",on="RIGHTWHITECORNERBRACKET",an="FULLWIDTHLESSTHAN",ln="FULLWIDTHGREATERTHAN",cn="AMPERSAND",un="APOSTROPHE",dn="ASTERISK",Ue="AT",fn="BACKSLASH",mn="BACKTICK",pn="CARET",We="COLON",Ds="COMMA",hn="DOLLAR",Ie="DOT",gn="EQUALS",Hs="EXCLAMATION",be="HYPHEN",jt="PERCENT",xn="PIPE",bn="PLUS",yn="POUND",wt="QUERY",zs="QUOTE",Eo="FULLWIDTHMIDDLEDOT",Fs="SEMI",Ee="SLASH",Tt="TILDE",vn="UNDERSCORE",Lo="EMOJI",kn="SYM";var Mo=Object.freeze({__proto__:null,ALPHANUMERICAL:Io,AMPERSAND:cn,APOSTROPHE:un,ASCIINUMERICAL:Ao,ASTERISK:dn,AT:Ue,BACKSLASH:fn,BACKTICK:mn,CARET:pn,CLOSEANGLEBRACKET:Zt,CLOSEBRACE:St,CLOSEBRACKET:Xt,CLOSEPAREN:Qt,COLON:We,COMMA:Ds,DOLLAR:hn,DOT:Ie,EMOJI:Lo,EQUALS:gn,EXCLAMATION:Hs,FULLWIDTHGREATERTHAN:ln,FULLWIDTHLEFTPAREN:en,FULLWIDTHLESSTHAN:an,FULLWIDTHMIDDLEDOT:Eo,FULLWIDTHRIGHTPAREN:tn,HYPHEN:be,LEFTCORNERBRACKET:nn,LEFTWHITECORNERBRACKET:rn,LOCALHOST:_t,NL:Os,NUM:$s,OPENANGLEBRACKET:Jt,OPENBRACE:kt,OPENBRACKET:qt,OPENPAREN:Yt,PERCENT:jt,PIPE:xn,PLUS:bn,POUND:yn,QUERY:wt,QUOTE:zs,RIGHTCORNERBRACKET:sn,RIGHTWHITECORNERBRACKET:on,SCHEME:Ut,SEMI:Fs,SLASH:Ee,SLASH_SCHEME:at,SYM:kn,TILDE:Tt,TLD:as,UNDERSCORE:vn,UTLD:ls,UWORD:is,WORD:De,WS:cs});const $e=/[a-z]/,xt=new RegExp("\\p{L}","u"),Bn=new RegExp("\\p{Emoji}","u"),Oe=/\d/,Un=/\s/,kr="\r",Wn=`
|
|
27
|
-
`,Ac="️",Ic="",Kn="";let Ot=null,Dt=null;function Ec(t=[]){const e={};de.groups=e;const n=new de;Ot==null&&(Ot=Sr(jc)),Dt==null&&(Dt=Sr(wc)),L(n,"'",un),L(n,"{",kt),L(n,"}",St),L(n,"[",qt),L(n,"]",Xt),L(n,"(",Yt),L(n,")",Qt),L(n,"<",Jt),L(n,">",Zt),L(n,"(",en),L(n,")",tn),L(n,"「",nn),L(n,"」",sn),L(n,"『",rn),L(n,"』",on),L(n,"<",an),L(n,">",ln),L(n,"&",cn),L(n,"*",dn),L(n,"@",Ue),L(n,"`",mn),L(n,"^",pn),L(n,":",We),L(n,",",Ds),L(n,"$",hn),L(n,".",Ie),L(n,"=",gn),L(n,"!",Hs),L(n,"-",be),L(n,"%",jt),L(n,"|",xn),L(n,"+",bn),L(n,"#",yn),L(n,"?",wt),L(n,'"',zs),L(n,"/",Ee),L(n,";",Fs),L(n,"~",Tt),L(n,"_",vn),L(n,"\\",fn),L(n,"・",Eo);const s=re(n,Oe,$s,{[ns]:!0});re(s,Oe,s);const r=re(s,$e,Ao,{[vt]:!0}),o=re(s,xt,Io,{[bt]:!0}),i=re(n,$e,De,{[ss]:!0});re(i,Oe,r),re(i,$e,i),re(r,Oe,r),re(r,$e,r);const l=re(n,xt,is,{[rs]:!0});re(l,$e),re(l,Oe,o),re(l,xt,l),re(o,Oe,o),re(o,$e),re(o,xt,o);const u=L(n,Wn,Os,{[Fn]:!0}),c=L(n,kr,cs,{[Fn]:!0}),m=re(n,Un,cs,{[Fn]:!0});L(n,Kn,m),L(c,Wn,u),L(c,Kn,m),re(c,Un,m),L(m,kr),L(m,Wn),re(m,Un,m),L(m,Kn,m);const d=re(n,Bn,Lo,{[_o]:!0});L(d,"#"),re(d,Bn,d),L(d,Ac,d);const f=L(d,Ic);L(f,"#"),re(f,Bn,d);const p=[[$e,i],[Oe,r]],h=[[$e,null],[xt,l],[Oe,o]];for(let g=0;g<Ot.length;g++)Fe(n,Ot[g],as,De,p);for(let g=0;g<Dt.length;g++)Fe(n,Dt[g],ls,is,h);Je(as,{tld:!0,ascii:!0},e),Je(ls,{utld:!0,alpha:!0},e),Fe(n,"file",Ut,De,p),Fe(n,"mailto",Ut,De,p),Fe(n,"http",at,De,p),Fe(n,"https",at,De,p),Fe(n,"ftp",at,De,p),Fe(n,"ftps",at,De,p),Je(Ut,{scheme:!0,ascii:!0},e),Je(at,{slashscheme:!0,ascii:!0},e),t=t.sort((g,x)=>g[0]>x[0]?1:-1);for(let g=0;g<t.length;g++){const x=t[g][0],y=t[g][1]?{[Tc]:!0}:{[Nc]:!0};x.indexOf("-")>=0?y[os]=!0:$e.test(x)?Oe.test(x)?y[vt]=!0:y[ss]=!0:y[ns]=!0,vr(n,x,x,y)}return vr(n,"localhost",_t,{ascii:!0}),n.jd=new de(kn),{start:n,tokens:Object.assign({groups:e},Mo)}}function Ro(t,e){const n=Lc(e.replace(/[A-Z]/g,l=>l.toLowerCase())),s=n.length,r=[];let o=0,i=0;for(;i<s;){let l=t,u=null,c=0,m=null,d=-1,f=-1;for(;i<s&&(u=l.go(n[i]));)l=u,l.accepts()?(d=0,f=0,m=l):d>=0&&(d+=n[i].length,f++),c+=n[i].length,o+=n[i].length,i++;o-=d,i-=f,c-=d,r.push({t:m.t,v:e.slice(o-c,o),s:o-c,e:o})}return r}function Lc(t){const e=[],n=t.length;let s=0;for(;s<n;){let r=t.charCodeAt(s),o,i=r<55296||r>56319||s+1===n||(o=t.charCodeAt(s+1))<56320||o>57343?t[s]:t.slice(s,s+2);e.push(i),s+=i.length}return e}function Fe(t,e,n,s,r){let o;const i=e.length;for(let l=0;l<i-1;l++){const u=e[l];t.j[u]?o=t.j[u]:(o=new de(s),o.jr=r.slice(),t.j[u]=o),t=o}return o=new de(n),o.jr=r.slice(),t.j[e[i-1]]=o,o}function Sr(t){const e=[],n=[];let s=0,r="0123456789";for(;s<t.length;){let o=0;for(;r.indexOf(t[s+o])>=0;)o++;if(o>0){e.push(n.join(""));for(let i=parseInt(t.substring(s,s+o),10);i>0;i--)n.pop();s+=o}else n.push(t[s]),s++}return e}const At={defaultProtocol:"http",events:null,format:jr,formatHref:jr,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Bs(t,e=null){let n=Object.assign({},At);t&&(n=Object.assign(n,t instanceof Bs?t.o:t));const s=n.ignoreTags,r=[];for(let o=0;o<s.length;o++)r.push(s[o].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=r}Bs.prototype={o:At,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const s=e!=null;let r=this.o[t];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:At[t],typeof r=="function"&&s&&(r=r(e,n))):typeof r=="function"&&s&&(r=r(e,n.t,n)),r)},getObj(t,e,n){let s=this.o[t];return typeof s=="function"&&e!=null&&(s=s(e,n.t,n)),s},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function jr(t){return t}function Po(t,e){this.t="token",this.v=t,this.tk=e}Po.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),s=t.get("format",e,this);return n&&s.length>n?s.substring(0,n)+"…":s},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=At.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),s=t.get("formatHref",n,this),r=t.get("tagName",n,e),o=this.toFormattedString(t),i={},l=t.get("className",n,e),u=t.get("target",n,e),c=t.get("rel",n,e),m=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return i.href=s,l&&(i.class=l),u&&(i.target=u),c&&(i.rel=c),m&&Object.assign(i,m),{tagName:r,attributes:i,content:o,eventListeners:d}}};function In(t,e){class n extends Po{constructor(r,o){super(r,o),this.t=t}}for(const s in e)n.prototype[s]=e[s];return n.t=t,n}const wr=In("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Tr=In("text"),Mc=In("nl"),Ht=In("url",{isLink:!0,toHref(t=At.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==_t&&t[1].t===We}}),xe=t=>new de(t);function Rc({groups:t}){const e=t.domain.concat([cn,dn,Ue,fn,mn,pn,hn,gn,be,$s,jt,xn,bn,yn,Ee,kn,Tt,vn]),n=[un,We,Ds,Ie,Hs,jt,wt,zs,Fs,Jt,Zt,kt,St,Xt,qt,Yt,Qt,en,tn,nn,sn,rn,on,an,ln],s=[cn,un,dn,fn,mn,pn,hn,gn,be,kt,St,jt,xn,bn,yn,wt,Ee,kn,Tt,vn],r=xe(),o=L(r,Tt);W(o,s,o),W(o,t.domain,o);const i=xe(),l=xe(),u=xe();W(r,t.domain,i),W(r,t.scheme,l),W(r,t.slashscheme,u),W(i,s,o),W(i,t.domain,i);const c=L(i,Ue);L(o,Ue,c),L(l,Ue,c),L(u,Ue,c);const m=L(o,Ie);W(m,s,o),W(m,t.domain,o);const d=xe();W(c,t.domain,d),W(d,t.domain,d);const f=L(d,Ie);W(f,t.domain,d);const p=xe(wr);W(f,t.tld,p),W(f,t.utld,p),L(c,_t,p);const h=L(d,be);L(h,be,h),W(h,t.domain,d),W(p,t.domain,d),L(p,Ie,f),L(p,be,h);const g=L(p,We);W(g,t.numeric,wr);const x=L(i,be),b=L(i,Ie);L(x,be,x),W(x,t.domain,i),W(b,s,o),W(b,t.domain,i);const y=xe(Ht);W(b,t.tld,y),W(b,t.utld,y),W(y,t.domain,i),W(y,s,o),L(y,Ie,b),L(y,be,x),L(y,Ue,c);const v=L(y,We),k=xe(Ht);W(v,t.numeric,k);const j=xe(Ht),S=xe();W(j,e,j),W(j,n,S),W(S,e,j),W(S,n,S),L(y,Ee,j),L(k,Ee,j);const w=L(l,We),T=L(u,We),N=L(T,Ee),C=L(N,Ee);W(l,t.domain,i),L(l,Ie,b),L(l,be,x),W(u,t.domain,i),L(u,Ie,b),L(u,be,x),W(w,t.domain,j),L(w,Ee,j),L(w,wt,j),W(C,t.domain,j),W(C,e,j),L(C,Ee,j);const I=[[kt,St],[qt,Xt],[Yt,Qt],[Jt,Zt],[en,tn],[nn,sn],[rn,on],[an,ln]];for(let M=0;M<I.length;M++){const[A,$]=I[M],E=L(j,A);L(S,A,E),L(E,$,j);const O=xe(Ht);W(E,e,O);const R=xe();W(E,n),W(O,e,O),W(O,n,R),W(R,e,O),W(R,n,R),L(O,$,j),L(R,$,j)}return L(r,_t,y),L(r,Os,Mc),{start:r,tokens:Mo}}function Pc(t,e,n){let s=n.length,r=0,o=[],i=[];for(;r<s;){let l=t,u=null,c=null,m=0,d=null,f=-1;for(;r<s&&!(u=l.go(n[r].t));)i.push(n[r++]);for(;r<s&&(c=u||l.go(n[r].t));)u=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,r++,m++;if(f<0)r-=m,r<s&&(i.push(n[r]),r++);else{i.length>0&&(o.push(Vn(Tr,e,i)),i=[]),r-=f,m-=f;const p=d.t,h=n.slice(r-m,r);o.push(Vn(p,e,h))}}return i.length>0&&o.push(Vn(Tr,e,i)),o}function Vn(t,e,n){const s=n[0].s,r=n[n.length-1].e,o=e.slice(s,r);return new t(o,n)}const $c=typeof console<"u"&&console&&console.warn||(()=>{}),Oc="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",te={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Dc(){return de.groups={},te.scanner=null,te.parser=null,te.tokenQueue=[],te.pluginQueue=[],te.customSchemes=[],te.initialized=!1,te}function Nr(t,e=!1){if(te.initialized&&$c(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Oc}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
28
|
-
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
29
|
-
2. Cannot start or end with "-"
|
|
30
|
-
3. "-" cannot repeat`);te.customSchemes.push([t,e])}function Hc(){te.scanner=Ec(te.customSchemes);for(let t=0;t<te.tokenQueue.length;t++)te.tokenQueue[t][1]({scanner:te.scanner});te.parser=Rc(te.scanner.tokens);for(let t=0;t<te.pluginQueue.length;t++)te.pluginQueue[t][1]({scanner:te.scanner,parser:te.parser});return te.initialized=!0,te}function Us(t){return te.initialized||Hc(),Pc(te.parser.start,t,Ro(te.scanner.start,t))}Us.scan=Ro;function $o(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const s=new Bs(n),r=Us(t),o=[];for(let i=0;i<r.length;i++){const l=r[i];l.isLink&&(!e||l.t===e)&&s.check(l)&&o.push(l.toFormattedObject(s))}return o}var Ws="[\0- -\u2029 ]",zc=new RegExp(Ws),Fc=new RegExp(`${Ws}$`),Bc=new RegExp(Ws,"g");function Uc(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function Wc(t){return new Se({key:new Te("autolink"),appendTransaction:(e,n,s)=>{const r=e.some(c=>c.docChanged)&&!n.doc.eq(s.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!r||o)return;const{tr:i}=s,l=La(n.doc,[...e]);if(Ma(l).forEach(({newRange:c})=>{const m=Ra(s.doc,c,p=>p.isTextblock);let d,f;if(m.length>1)d=m[0],f=s.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(m.length){const p=s.doc.textBetween(c.from,c.to," "," ");if(!Fc.test(p))return;d=m[0],f=s.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&f){const p=f.split(zc).filter(Boolean);if(p.length<=0)return!1;const h=p[p.length-1],g=d.pos+f.lastIndexOf(h);if(!h)return!1;const x=Us(h).map(b=>b.toObject(t.defaultProtocol));if(!Uc(x))return!1;x.filter(b=>b.isLink).map(b=>({...b,from:g+b.start+1,to:g+b.end+1})).filter(b=>s.schema.marks.code?!s.doc.rangeHasMark(b.from,b.to,s.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{Pa(b.from,b.to,s.doc).some(y=>y.mark.type===t.type)||i.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!i.steps.length)return i}})}function Kc(t){return new Se({key:new Te("handleClickLink"),props:{handleClick:(e,n,s)=>{var r,o;if(s.button!==0||!e.editable)return!1;let i=null;if(s.target instanceof HTMLAnchorElement)i=s.target;else{const u=s.target;if(!u)return!1;const c=t.editor.view.dom;i=u.closest("a"),i&&!c.contains(i)&&(i=null)}if(!i)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const u=$a(e.state,t.type.name),c=(r=i.href)!=null?r:u.href,m=(o=i.target)!=null?o:u.target;c&&(window.open(c,m),l=!0)}return l}}})}function Vc(t){return new Se({key:new Te("handlePasteLink"),props:{handlePaste:(e,n,s)=>{const{shouldAutoLink:r}=t,{state:o}=e,{selection:i}=o,{empty:l}=i;if(l)return!1;let u="";s.content.forEach(m=>{u+=m.textContent});const c=$o(u,{defaultProtocol:t.defaultProtocol}).find(m=>m.isLink&&m.value===u);return!u||!c||r!==void 0&&!r(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function Xe(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(s=>{const r=typeof s=="string"?s:s.scheme;r&&n.push(r)}),!t||t.replace(Bc,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Gc=ht.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Nr(t);return}Nr(t.scheme,t.optionalSlashes)})},onDestroy(){Dc()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Xe(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const r=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Xe(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Xe(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ae(this.options.HTMLAttributes,t),0]:["a",ae(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,s,r,o;const i=(s=(n=t.attrs)==null?void 0:n.href)!=null?s:"",l=(o=(r=t.attrs)==null?void 0:r.title)!=null?o:"",u=e.renderChildren(t);return l?`[${u}](${i} "${l}")`:`[${u}](${i})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:s=>!!Xe(s,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:s=>!!Xe(s,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ot({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:s}=this.options,r=$o(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:i=>!!Xe(i,n),protocols:n,defaultProtocol:s}));r.length&&r.forEach(o=>{this.options.shouldAutoLink(o.value)&&e.push({text:o.value,data:{href:o.href},index:o.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(Wc({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:s=>this.options.isAllowedUri(s,{defaultValidate:r=>!!Xe(r,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(Kc({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(Vc({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),qc=Object.defineProperty,Xc=(t,e)=>{for(var n in e)qc(t,n,{get:e[n],enumerable:!0})},Yc="listItem",Cr="textStyle",_r=/^\s*([-+*])\s$/,Oo=fe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ae(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
31
|
-
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Yc,this.editor.getAttributes(Cr)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ut({find:_r,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ut({find:_r,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Cr),editor:this.editor})),[t]}}),Do=fe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ae(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const s=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let r=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(i=>i.type==="paragraph"))r=s(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(r=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const u=t.tokens.slice(1),c=s(u);r.push(...c)}}else r=s(t.tokens)}return r.length===0&&(r=[{type:"paragraph",content:[]}]),{type:"listItem",content:r}},renderMarkdown:(t,e,n)=>fo(t,e,s=>{var r,o;return s.parentType==="bulletList"?"- ":s.parentType==="orderedList"?`${(((o=(r=s.meta)==null?void 0:r.parentAttrs)==null?void 0:o.start)||1)+s.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Qc={};Xc(Qc,{findListItemPos:()=>Mt,getNextListDepth:()=>Ks,handleBackspace:()=>us,handleDelete:()=>ds,hasListBefore:()=>Ho,hasListItemAfter:()=>Jc,hasListItemBefore:()=>zo,listItemHasSubList:()=>Fo,nextListIsDeeper:()=>Bo,nextListIsHigher:()=>Uo});var Mt=(t,e)=>{const{$from:n}=e.selection,s=mo(t,e.schema);let r=null,o=n.depth,i=n.pos,l=null;for(;o>0&&l===null;)r=n.node(o),r.type===s?l=o:(o-=1,i-=1);return l===null?null:{$pos:e.doc.resolve(i),depth:l}},Ks=(t,e)=>{const n=Mt(t,e);if(!n)return!1;const[,s]=Ha(e,t,n.$pos.pos+4);return s},Ho=(t,e,n)=>{const{$anchor:s}=t.selection,r=Math.max(0,s.pos-2),o=t.doc.resolve(r).node();return!(!o||!n.includes(o.type.name))},zo=(t,e)=>{var n;const{$anchor:s}=e.selection,r=e.doc.resolve(s.pos-2);return!(r.index()===0||((n=r.nodeBefore)==null?void 0:n.type.name)!==t)},Fo=(t,e,n)=>{if(!n)return!1;const s=mo(t,e.schema);let r=!1;return n.descendants(o=>{o.type===s&&(r=!0)}),r},us=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!es(t.state,e)&&Ho(t.state,e,n)){const{$anchor:l}=t.state.selection,u=t.state.doc.resolve(l.before()-1),c=[];u.node().descendants((f,p)=>{f.type.name===e&&c.push({node:f,pos:p})});const m=c.at(-1);if(!m)return!1;const d=t.state.doc.resolve(u.start()+m.pos+1);return t.chain().cut({from:l.start()-1,to:l.end()+1},d.end()).joinForward().run()}if(!es(t.state,e)||!Oa(t.state))return!1;const s=Mt(e,t.state);if(!s)return!1;const o=t.state.doc.resolve(s.$pos.pos-2).node(s.depth),i=Fo(e,t.state,o);return zo(e,t.state)&&!i?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},Bo=(t,e)=>{const n=Ks(t,e),s=Mt(t,e);return!s||!n?!1:n>s.depth},Uo=(t,e)=>{const n=Ks(t,e),s=Mt(t,e);return!s||!n?!1:n<s.depth},ds=(t,e)=>{if(!es(t.state,e)||!Da(t.state,e))return!1;const{selection:n}=t.state,{$from:s,$to:r}=n;return!n.empty&&s.sameParent(r)?!1:Bo(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():Uo(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},Jc=(t,e)=>{var n;const{$anchor:s}=e.selection,r=e.doc.resolve(s.pos-s.parentOffset-2);return!(r.index()===r.parent.childCount-1||((n=r.nodeAfter)==null?void 0:n.type.name)!==t)},Wo=Ne.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&ds(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&ds(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:s})=>{t.state.schema.nodes[n]!==void 0&&us(t,n,s)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:s})=>{t.state.schema.nodes[n]!==void 0&&us(t,n,s)&&(e=!0)}),e}}}}),Ar=/^(\s*)(\d+)\.\s+(.*)$/,Zc=/^\s/;function eu(t){const e=[];let n=0,s=0;for(;n<t.length;){const r=t[n],o=r.match(Ar);if(!o)break;const[,i,l,u]=o,c=i.length;let m=u,d=n+1;const f=[r];for(;d<t.length;){const p=t[d];if(p.match(Ar))break;if(p.trim()==="")f.push(p),m+=`
|
|
32
|
-
`,d+=1;else if(p.match(Zc))f.push(p),m+=`
|
|
33
|
-
${p.slice(c+2)}`,d+=1;else break}e.push({indent:c,number:parseInt(l,10),content:m.trim(),raw:f.join(`
|
|
34
|
-
`)}),s=d,n=d}return[e,s]}function Ko(t,e,n){var s;const r=[];let o=0;for(;o<t.length;){const i=t[o];if(i.indent===e){const l=i.content.split(`
|
|
35
|
-
`),u=((s=l[0])==null?void 0:s.trim())||"",c=[];u&&c.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const m=l.slice(1).join(`
|
|
36
|
-
`).trim();if(m){const p=n.blockTokens(m);c.push(...p)}let d=o+1;const f=[];for(;d<t.length&&t[d].indent>e;)f.push(t[d]),d+=1;if(f.length>0){const p=Math.min(...f.map(g=>g.indent)),h=Ko(f,p,n);c.push({type:"list",ordered:!0,start:f[0].number,items:h,raw:f.map(g=>g.raw).join(`
|
|
37
|
-
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=d}else o+=1}return r}function tu(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const s=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(r=>{if(r.type==="paragraph"||r.type==="list"||r.type==="blockquote"||r.type==="code")s.push(...e.parseChildren([r]));else if(r.type==="text"&&r.tokens){const o=e.parseChildren([r]);s.push({type:"paragraph",content:o})}else{const o=e.parseChildren([r]);o.length>0&&s.push(...o)}}),{type:"listItem",content:s}})}var nu="listItem",Ir="textStyle",Er=/^(\d+)\.\s$/,Vo=fe.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",ae(this.options.HTMLAttributes,n),0]:["ol",ae(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,s=t.items?tu(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:s}:{type:"orderedList",content:s}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
38
|
-
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e?.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var s;const r=t.split(`
|
|
39
|
-
`),[o,i]=eu(r);if(o.length===0)return;const l=Ko(o,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((s=o[0])==null?void 0:s.number)||1,items:l,raw:r.slice(0,i).join(`
|
|
40
|
-
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(nu,this.editor.getAttributes(Ir)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ut({find:Er,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ut({find:Er,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Ir)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),su=/^\s*(\[([( |x])?\])\s$/,ru=fe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ae(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const s=e.parseChildren(t.nestedTokens);n.push(...s)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const r=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return fo(t,e,r)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:s})=>{const r=document.createElement("li"),o=document.createElement("label"),i=document.createElement("span"),l=document.createElement("input"),u=document.createElement("div"),c=d=>{var f,p;l.ariaLabel=((p=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:p.call(f,d,l.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};c(t),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",d=>d.preventDefault()),l.addEventListener("change",d=>{if(!s.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=d.target;s.isEditable&&typeof n=="function"&&s.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const h=n();if(typeof h!="number")return!1;const g=p.doc.nodeAt(h);return p.setNodeMarkup(h,void 0,{...g?.attrs,checked:f}),!0}).run(),!s.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{r.setAttribute(d,f)}),r.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,o.append(l,i),r.append(o,u),Object.entries(e).forEach(([d,f])=>{r.setAttribute(d,f)});let m=new Set(Object.keys(e));return{dom:r,contentDOM:u,update:d=>{if(d.type!==this.type)return!1;r.dataset.checked=d.attrs.checked,l.checked=d.attrs.checked,c(d);const f=s.extensionManager.attributes,p=za(d,f),h=new Set(Object.keys(p)),g=this.options.HTMLAttributes;return m.forEach(x=>{h.has(x)||(x in g?r.setAttribute(x,g[x]):r.removeAttribute(x))}),Object.entries(p).forEach(([x,b])=>{b==null?x in g?r.setAttribute(x,g[x]):r.removeAttribute(x):r.setAttribute(x,b)}),m=h,!0}}}},addInputRules(){return[ut({find:su,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),ou=fe.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ae(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
41
|
-
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const s=o=>{const i=mr(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,u)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:u}),customNestedParser:s},n);return i?[{type:"taskList",raw:i.raw,items:i.items}]:n.blockTokens(o)},r=mr(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,i)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:i}),customNestedParser:s},n);if(r)return{type:"taskList",raw:r.raw,items:r.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ne.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(Oo.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Do.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Wo.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Vo.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(ru.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(ou.configure(this.options.taskList)),t}});var Lr=" ",iu=" ",au=fe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ae(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const s=e.parseInline(n);return s.length===1&&s[0].type==="text"&&(s[0].text===Lr||s[0].text===iu)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,s)},renderMarkdown:(t,e,n)=>{var s,r;if(!t)return"";const o=Array.isArray(t.content)?t.content:[];if(o.length===0){const i=Array.isArray((s=n?.previousNode)==null?void 0:s.content)?n.previousNode.content:[];return((r=n?.previousNode)==null?void 0:r.type)==="paragraph"&&i.length===0?Lr:""}return e.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),lu=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,cu=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,uu=ht.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ae(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[dt({find:lu,type:this.type})]},addPasteRules(){return[ot({find:cu,type:this.type})]}}),du=fe.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),fu=ht.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ae(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;const o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),mu=Ne.create({name:"starterKit",addExtensions(){var t,e,n,s;const r=[];return this.options.bold!==!1&&r.push(ac.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(nc.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(Oo.configure(this.options.bulletList)),this.options.code!==!1&&r.push(uc.configure(this.options.code)),this.options.codeBlock!==!1&&r.push(mc.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(pc.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(Yl.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(Ql.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(hc.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(gc.configure(this.options.heading)),this.options.undoRedo!==!1&&r.push(ec.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&r.push(xc.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(Sc.configure(this.options.italic)),this.options.listItem!==!1&&r.push(Do.configure(this.options.listItem)),this.options.listKeymap!==!1&&r.push(Wo.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&r.push(Gc.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&r.push(Vo.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(au.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(uu.configure(this.options.strike)),this.options.text!==!1&&r.push(du.configure(this.options.text)),this.options.underline!==!1&&r.push(fu.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&r.push(Zl.configure((s=this.options)==null?void 0:s.trailingNode)),r}}),pu=mu;const Ye=16,fs=2.5,ms=(Ye-fs)/2,Gn=2*Math.PI*ms;function Go(t){const e=P.c(31),{usage:n}=t;if(!n)return null;const{totalTokens:s,inputTokens:r,outputTokens:o,cost:i}=n;if(!s&&!r&&!o)return null;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(Xi,{size:12}),e[0]=l):l=e[0];let u;e[1]!==i||e[2]!==s?(u=i>0?`$${i.toFixed(4)}`:s.toLocaleString(),e[1]=i,e[2]=s,e[3]=u):u=e[3];let c;e[4]!==u?(c=a.jsx(nt,{asChild:!0,children:a.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[l,a.jsx("span",{className:"text-sm font-mono tabular-nums",children:u})]})}),e[4]=u,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx("span",{className:"text-muted",children:"in"}),e[7]=d):d=e[7];let f;e[8]!==r?(f=r.toLocaleString(),e[8]=r,e[9]=f):f=e[9];let p;e[10]!==f?(p=a.jsx("span",{className:"text-right tabular-nums",children:f}),e[10]=f,e[11]=p):p=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=a.jsx("span",{className:"text-muted",children:"out"}),e[12]=h):h=e[12];const g=o-(n.reasoningTokens??0);let x;e[13]!==g?(x=g.toLocaleString(),e[13]=g,e[14]=x):x=e[14];let b;e[15]!==x?(b=a.jsx("span",{className:"text-right tabular-nums",children:x}),e[15]=x,e[16]=b):b=e[16];let y;e[17]!==r||e[18]!==n.cacheReadTokens||e[19]!==n.cacheWriteTokens?(y=(n.cacheReadTokens>0||n.cacheWriteTokens>0)&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-muted",children:"cache hit"}),a.jsx("span",{className:"text-right tabular-nums",children:r>0?`${(n.cacheReadTokens/r*100).toFixed(0)}%`:"0%"})]}),e[17]=r,e[18]=n.cacheReadTokens,e[19]=n.cacheWriteTokens,e[20]=y):y=e[20];let v;e[21]!==i?(v=i>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-muted",children:"cost"}),a.jsxs("span",{className:"text-right tabular-nums",children:["$",i.toFixed(4)]})]}),e[21]=i,e[22]=v):v=e[22];let k;e[23]!==b||e[24]!==y||e[25]!==v||e[26]!==p?(k=a.jsxs(st,{side:"top",className:"font-mono text-[11px]",children:[m,a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[d,p,h,b,y,v]})]}),e[23]=b,e[24]=y,e[25]=v,e[26]=p,e[27]=k):k=e[27];let j;return e[28]!==k||e[29]!==c?(j=a.jsxs(rt,{children:[c,k]}),e[28]=k,e[29]=c,e[30]=j):j=e[30],j}function hu(t){const e=P.c(19),{usage:n,duration:s}=t,r=s!=null&&s>0,o=n!=null&&(n.cost??0)>0,i=n!=null&&(n.totalTokens??0)>0;if(!r&&!o&&!i)return null;let l;e[0]!==s||e[1]!==r?(l=r?Ve(s/1e3):null,e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l;let c;e[3]!==s||e[4]!==u||e[5]!==n?(c=u&&a.jsxs(rt,{children:[a.jsx(nt,{asChild:!0,children:a.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:u})}),a.jsxs(st,{side:"top",className:"font-mono text-[11px]",children:[a.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),a.jsx("span",{className:"tabular-nums",children:Ve(s/1e3)}),(n?.reasoningTokens??0)>0&&a.jsxs("span",{className:"ml-2 opacity-50",children:[n.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=s,e[4]=u,e[5]=n,e[6]=c):c=e[6];let m;e[7]!==o||e[8]!==r||e[9]!==i?(m=r&&(o||i)&&a.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=o,e[8]=r,e[9]=i,e[10]=m):m=e[10];let d;e[11]!==o||e[12]!==i||e[13]!==n?(d=(o||i)&&a.jsxs(rt,{children:[a.jsx(nt,{asChild:!0,children:a.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:o?`$${n.cost.toFixed(4)}`:`${n.totalTokens.toLocaleString()} tok`})}),a.jsxs(st,{side:"top",className:"font-mono text-[11px]",children:[a.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[a.jsx("span",{className:"opacity-60",children:"in"}),a.jsx("span",{className:"text-right tabular-nums",children:(n.inputTokens??0).toLocaleString()}),a.jsx("span",{className:"opacity-60",children:"out"}),a.jsx("span",{className:"text-right tabular-nums",children:((n.outputTokens??0)-(n?.reasoningTokens??0)).toLocaleString()}),(n?.reasoningTokens??0)>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-60",children:"think"}),a.jsx("span",{className:"text-right tabular-nums",children:n.reasoningTokens.toLocaleString()})]}),((n?.cacheReadTokens??0)>0||(n?.cacheWriteTokens??0)>0)&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-60",children:"cache hit"}),a.jsx("span",{className:"text-right tabular-nums",children:(n?.inputTokens??0)>0?`${((n?.cacheReadTokens??0)/n.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=o,e[12]=i,e[13]=n,e[14]=d):d=e[14];let f;return e[15]!==c||e[16]!==m||e[17]!==d?(f=a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,m,d]}),e[15]=c,e[16]=m,e[17]=d,e[18]=f):f=e[18],f}function $p(t){const e=P.c(51),{usage:n,totalTokens:s,contextWindow:r,onOpenContextPanel:o}=t,i=Math.min(s/r*100,100),l=Gn-i/100*Gn,u=n?.cost??0,c=n?.inputTokens??0,m=n?.outputTokens??0;let d;e[0]!==i?(d=i.toFixed(0),e[0]=i,e[1]=d):d=e[1];let f;e[2]!==u?(f=u>0?`, $${u.toFixed(2)}`:"",e[2]=u,e[3]=f):f=e[3];const p=`Context usage: ${d}%${f}`,h=o?"cursor-pointer":"cursor-default";let g;e[4]!==h?(g=q("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",h),e[4]=h,e[5]=g):g=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx("circle",{cx:Ye/2,cy:Ye/2,r:ms,fill:"none",stroke:"currentColor",strokeWidth:fs,className:"opacity-15"}),e[6]=x):x=e[6];const b=i>90?"text-destructive":i>70?"text-warning":"text-muted-foreground";let y;e[7]!==b?(y=q(b),e[7]=b,e[8]=y):y=e[8];let v;e[9]!==l||e[10]!==y?(v=a.jsxs("svg",{width:Ye,height:Ye,className:"-rotate-90",children:[x,a.jsx("circle",{cx:Ye/2,cy:Ye/2,r:ms,fill:"none",stroke:"currentColor",strokeWidth:fs,strokeDasharray:Gn,strokeDashoffset:l,strokeLinecap:"round",className:y})]}),e[9]=l,e[10]=y,e[11]=v):v=e[11];let k;e[12]!==i?(k=i.toFixed(0),e[12]=i,e[13]=k):k=e[13];let j;e[14]!==u?(j=u>0?` · $${u.toFixed(2)}`:"",e[14]=u,e[15]=j):j=e[15];let S;e[16]!==k||e[17]!==j?(S=a.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[k,"%",j]}),e[16]=k,e[17]=j,e[18]=S):S=e[18];let w;e[19]!==o||e[20]!==S||e[21]!==p||e[22]!==g||e[23]!==v?(w=a.jsx(nt,{asChild:!0,children:a.jsxs("button",{type:"button",onClick:o,"aria-label":p,className:g,children:[v,S]})}),e[19]=o,e[20]=S,e[21]=p,e[22]=g,e[23]=v,e[24]=w):w=e[24];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=a.jsx("span",{className:"text-muted",children:"context"}),e[25]=T):T=e[25];let N;e[26]!==s?(N=s.toLocaleString(),e[26]=s,e[27]=N):N=e[27];let C;e[28]!==r?(C=r.toLocaleString(),e[28]=r,e[29]=C):C=e[29];let I;e[30]!==i?(I=i.toFixed(1),e[30]=i,e[31]=I):I=e[31];let M;e[32]!==N||e[33]!==C||e[34]!==I?(M=a.jsxs("span",{className:"text-right tabular-nums",children:[N," / ",C," (",I,"%)"]}),e[32]=N,e[33]=C,e[34]=I,e[35]=M):M=e[35];let A;e[36]!==u||e[37]!==c||e[38]!==m?(A=u>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-muted",children:"cost"}),a.jsxs("span",{className:"text-right tabular-nums",children:["$",u.toFixed(4)]}),a.jsx("span",{className:"text-muted",children:"in"}),a.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),a.jsx("span",{className:"text-muted",children:"out"}),a.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=u,e[37]=c,e[38]=m,e[39]=A):A=e[39];let $;e[40]!==c||e[41]!==n?.cacheReadTokens||e[42]!==n?.cacheWriteTokens?($=((n?.cacheReadTokens??0)>0||(n?.cacheWriteTokens??0)>0)&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-muted",children:"cache hit"}),a.jsx("span",{className:"text-right tabular-nums",children:c>0?`${((n?.cacheReadTokens??0)/c*100).toFixed(0)}%`:"0%"})]}),e[40]=c,e[41]=n?.cacheReadTokens,e[42]=n?.cacheWriteTokens,e[43]=$):$=e[43];let E;e[44]!==M||e[45]!==A||e[46]!==$?(E=a.jsx(st,{side:"top",className:"font-mono text-[11px]",children:a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[T,M,A,$]})}),e[44]=M,e[45]=A,e[46]=$,e[47]=E):E=e[47];let O;return e[48]!==w||e[49]!==E?(O=a.jsxs(rt,{children:[w,E]}),e[48]=w,e[49]=E,e[50]=O):O=e[50],O}var En="Collapsible",[gu,Op]=Br(En),[xu,Vs]=gu(En),qo=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:s,defaultOpen:r,disabled:o,onOpenChange:i,...l}=t,[u,c]=Ei({prop:s,defaultProp:r??!1,onChange:i,caller:En});return a.jsx(xu,{scope:n,disabled:o,contentId:Li(),open:u,onOpenToggle:_.useCallback(()=>c(m=>!m),[c]),children:a.jsx(Ge.div,{"data-state":Ys(u),"data-disabled":o?"":void 0,...l,ref:e})})});qo.displayName=En;var Xo="CollapsibleTrigger",Gs=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...s}=t,r=Vs(Xo,n);return a.jsx(Ge.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Ys(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...s,ref:e,onClick:Ke(t.onClick,r.onOpenToggle)})});Gs.displayName=Xo;var qs="CollapsibleContent",Xs=_.forwardRef((t,e)=>{const{forceMount:n,...s}=t,r=Vs(qs,t.__scopeCollapsible);return a.jsx(Et,{present:n||r.open,children:({present:o})=>a.jsx(bu,{...s,ref:e,present:o})})});Xs.displayName=qs;var bu=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:s,children:r,...o}=t,i=Vs(qs,n),[l,u]=_.useState(s),c=_.useRef(null),m=it(e,c),d=_.useRef(0),f=d.current,p=_.useRef(0),h=p.current,g=i.open||l,x=_.useRef(g),b=_.useRef(void 0);return _.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),Fr(()=>{const y=c.current;if(y){b.current=b.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const v=y.getBoundingClientRect();d.current=v.height,p.current=v.width,x.current||(y.style.transitionDuration=b.current.transitionDuration,y.style.animationName=b.current.animationName),u(s)}},[i.open,s]),a.jsx(Ge.div,{"data-state":Ys(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...o,ref:m,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...t.style},children:g&&r})});function Ys(t){return t?"open":"closed"}var yu=qo,Dp=Gs,Hp=Xs;function vu(t){const e=P.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=a.jsx(yu,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=s):s=e[3],s}function ku(t){const e=P.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=a.jsx(Gs,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function Su(t){const e=P.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=a.jsx(Xs,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=s):s=e[3],s}function G({icon:t,title:e,usage:n,latency:s,summary:r,state:o,detail:i,detailVariant:l="code",forceOpen:u,variant:c="default",trailing:m,iconDestructive:d,alwaysChevron:f,defaultOpen:p,children:h}){const[g,x]=_.useState(p??!1),{handleCopy:b,copied:y}=io(),v=o==="loading",k=o==="error",S=!!(i&&i.trim())||!!h,w=c==="subtask",T=(u??!1)||g,N=Sl({initial:v?"instant":!1}),C=a.jsxs(vu,{open:T,onOpenChange:u?void 0:x,className:"min-w-0",children:[a.jsxs(ku,{disabled:!S,className:q("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",S&&"[@media(hover:hover)]:hover:bg-accent/30",!S&&"cursor-default",v&&"shimmer"),"aria-disabled":!S,children:[a.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:f?a.jsx(ur,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",T&&"rotate-90")}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:q("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",d?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",S&&(T?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),S&&a.jsx("div",{className:q("absolute inset-0 flex items-center justify-center transition-opacity duration-150",T?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:a.jsx(ur,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",T&&"rotate-90")})})]})}),a.jsx("span",{className:q("shrink-0 text-[14px] font-normal",k?"text-warning/80":"text-foreground"),children:e}),r?a.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:r})}):a.jsx("div",{className:"flex-1"}),m&&a.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:m}),a.jsx(Go,{usage:n})]}),S&&a.jsx(Su,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:h||(l==="prose"?a.jsx("div",{className:"mt-1 mb-1",children:a.jsx("div",{ref:N.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:a.jsx("p",{ref:N.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:i})})}):a.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:a.jsx("div",{ref:N.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:a.jsxs("div",{ref:N.contentRef,className:"flex items-start justify-between gap-2",children:[a.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:a.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:i})}),a.jsx("button",{type:"button",onClick:()=>b(i),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:y?a.jsx(Ns,{className:"size-3.5"}):a.jsx(oo,{className:"size-3.5"})})]})})}))})]});return w?a.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:C}):C}function ue(t){const e=P.c(4),{latency:n}=t;if(n==null||n<=0)return null;let s;e[0]!==n?(s=Ve(n),e[0]=n,e[1]=s):s=e[1];let r;return e[2]!==s?(r=a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:s}),e[2]=s,e[3]=r):r=e[3],r}const Yo=4;function Qo(t){const e=P.c(5),{count:n,noun:s,onClick:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(ro,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=o):o=e[0];let i;return e[1]!==n||e[2]!==s||e[3]!==r?(i=a.jsxs("button",{type:"button",onClick:r,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",n," ",s,o]}),e[1]=n,e[2]=s,e[3]=r,e[4]=i):i=e[4],i}function Jo(t){const e=P.c(12),{message:n,className:s}=t,r=n.created_at??n.metadata?.created_at??null;let o,i,l,u;if(e[0]!==s||e[1]!==r){u=Symbol.for("react.early_return_sentinel");e:{const m=_s(r);if(m===null){u=null;break e}const d=new Date(m);o=d.toLocaleString(),e[6]!==s?(i=q("text-[11px] text-muted-foreground/60 select-none",s),e[6]=s,e[7]=i):i=e[7],l=d.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=s,e[1]=r,e[2]=o,e[3]=i,e[4]=l,e[5]=u}else o=e[2],i=e[3],l=e[4],u=e[5];if(u!==Symbol.for("react.early_return_sentinel"))return u;let c;return e[8]!==o||e[9]!==i||e[10]!==l?(c=a.jsx("span",{title:o,className:i,children:l}),e[8]=o,e[9]=i,e[10]=l,e[11]=c):c=e[11],c}function ps(t){const e=P.c(9),{since:n}=t;let s;e[0]!==n?(s=()=>dr(n,Date.now()),e[0]=n,e[1]=s):s=e[1];const[r,o]=_.useState(s);let i,l;e[2]!==n?(i=()=>{const d=setInterval(()=>o(dr(n,Date.now())),100);return()=>clearInterval(d)},l=[n],e[2]=n,e[3]=i,e[4]=l):(i=e[3],l=e[4]),_.useEffect(i,l);const u=r/1e3;let c;e[5]!==u?(c=Ve(u),e[5]=u,e[6]=c):c=e[6];let m;return e[7]!==c?(m=a.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:c}),e[7]=c,e[8]=m):m=e[8],m}const Zo=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function ju(){const t=P.c(5),[e]=_.useState(wu);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},t[0]=n):n=t[0];let s;t[1]!==e?(s=Zo.map((o,i)=>{const{delay:l}=o;return a.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[i],animation:"grid-ripple 1s ease infinite",animationDelay:`${l}ms`}},i)}),t[1]=e,t[2]=s):s=t[2];let r;return t[3]!==s?(r=a.jsx("div",{className:"grid",style:n,children:s}),t[3]=s,t[4]=r):r=t[4],r}function wu(){const t=`var(--chart-${Math.ceil(Math.random()*5)})`;return Zo.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":t)}const Tu={planning:{icon:a.jsx(Qi,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves",detail:"Deciding how to approach the request"},thinking:{icon:a.jsx(Nn,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking",detail:"Working through the next response"}},Nu=1200;function hs(t){const e=P.c(9),{icon:n,title:s,summary:r,detail:o,state:i,detailVariant:l,latency:u,trailing:c}=t,m=l===void 0?"prose":l;let d;return e[0]!==o||e[1]!==m||e[2]!==n||e[3]!==u||e[4]!==i||e[5]!==r||e[6]!==s||e[7]!==c?(d=a.jsx(G,{icon:n,title:s,summary:r,detail:o,state:i,detailVariant:m,latency:u,trailing:c}),e[0]=o,e[1]=m,e[2]=n,e[3]=u,e[4]=i,e[5]=r,e[6]=s,e[7]=c,e[8]=d):d=e[8],d}function Cu(t){const e=P.c(17),{startedAt:n}=t,s=pt()?.runStatusStage??null,[r,o]=_.useState("planning");let i,l;if(e[0]!==s?(i=()=>{if(s!==null)return;const f=setTimeout(()=>{o("thinking")},Nu);return()=>{clearTimeout(f)}},l=[s],e[0]=s,e[1]=i,e[2]=l):(i=e[1],l=e[2]),_.useEffect(i,l),s!==null){const f=ca[s];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(Nn,{className:"size-4"}),e[3]=p):p=e[3];const h=`${f.label}...`;let g;e[4]!==n?(g=n!==null&&a.jsx(ps,{since:n}),e[4]=n,e[5]=g):g=e[5];let x;return e[6]!==f.detail||e[7]!==h||e[8]!==g?(x=a.jsx(hs,{icon:p,title:h,summary:f.detail,state:"loading",trailing:g}),e[6]=f.detail,e[7]=h,e[8]=g,e[9]=x):x=e[9],x}const u=Tu[r],c=`${u.label}...`;let m;e[10]!==n?(m=n!==null&&a.jsx(ps,{since:n}),e[10]=n,e[11]=m):m=e[11];let d;return e[12]!==u.detail||e[13]!==u.icon||e[14]!==c||e[15]!==m?(d=a.jsx(hs,{icon:u.icon,title:c,summary:u.detail,state:"loading",trailing:m}),e[12]=u.detail,e[13]=u.icon,e[14]=c,e[15]=m,e[16]=d):d=e[16],d}function _u(t){const e=P.c(3),{startedAt:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(ju,{}),e[0]=s):s=e[0];let r;return e[1]!==n?(r=a.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[s,a.jsx(ps,{since:n})]}),e[1]=n,e[2]=r):r=e[2],r}const Au=2e4;function Iu(t){const e=P.c(8),{startedAt:n}=t;Jr(1e3);const s=pt(),o=(n!==null?Date.now()-n:0)>=Au;let i;e[0]!==n?(i=a.jsx(Cu,{startedAt:n}),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==o||e[3]!==s?(l=o&&s?.stop&&a.jsxs("div",{className:"flex items-center gap-2 pb-1 text-[13px] text-muted-foreground/60",children:[a.jsx("span",{children:"This is taking longer than usual."}),a.jsx("button",{type:"button",onClick:()=>s.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:"Cancel"})]}),e[2]=o,e[3]=s,e[4]=l):l=e[4];let u;return e[5]!==i||e[6]!==l?(u=a.jsxs("div",{className:"flex flex-col gap-0.5",children:[i,l]}),e[5]=i,e[6]=l,e[7]=u):u=e[7],u}function Eu(t){const e=P.c(20),{duration:n,parts:s,isStreaming:r}=t;let o;e[0]!==s?(o=s.every(Ru),e[0]=s,e[1]=o):o=e[1];const i=o;let l;e[2]!==n?(l=n&&n/1e3>1?`Thought for ${Ve(n/1e3)}`:"Thought",e[2]=n,e[3]=l):l=e[3];const u=l;let c;if(e[4]!==i||e[5]!==r||e[6]!==s){const v=s.map(Mu).join(`
|
|
42
|
-
`).trim().split(`
|
|
43
|
-
`).filter(Boolean),k=r?v[v.length-1]??"":v[0]??"";c=!i&&k?k.length>100?k.slice(0,100)+"…":k:void 0,e[4]=i,e[5]=r,e[6]=s,e[7]=c}else c=e[7];const m=c;let d;if(e[8]!==i||e[9]!==s){const y=s.map(Lu).join(`
|
|
44
|
-
|
|
45
|
-
`);d=!i&&y.trim()?y:null,e[8]=i,e[9]=s,e[10]=d}else d=e[10];const f=d,p=!r&&n!=null?n/1e3:void 0;let h;e[11]!==r?(h=r?a.jsx(Nn,{className:"size-4"}):a.jsx(Yi,{className:"size-4"}),e[11]=r,e[12]=h):h=e[12];const g=r?"Thinking...":u,x=r?"loading":"idle";let b;return e[13]!==f||e[14]!==p||e[15]!==m||e[16]!==h||e[17]!==g||e[18]!==x?(b=a.jsx(hs,{icon:h,title:g,summary:m,detail:f,state:x,detailVariant:"prose",latency:p}),e[13]=f,e[14]=p,e[15]=m,e[16]=h,e[17]=g,e[18]=x,e[19]=b):b=e[19],b}function Lu(t){return t.text??""}function Mu(t){return t.text??""}function Ru(t){return t.text?.includes("REDACTED")}function Pu(t){const e=P.c(24),{org:n}=He(),s=Mi(),r=ua(),o=Zr();let i;e[0]!==o||e[1]!==t?(i=async g=>{if(!t)throw new Error("useTaskExpandedTools: no task in context");const b=(await o.call("COLLECTION_THREADS_GET",{id:t})).item?.metadata??{},v=(b.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);v.push({...g,expandedAt:new Date().toISOString()});const k={...b,expanded_tools:v};return await o.call("COLLECTION_THREADS_UPDATE",{id:t,data:{metadata:k}}),v},e[0]=o,e[1]=t,e[2]=i):i=e[2];let l,u,c;e[3]!==n||e[4]!==s||e[5]!==t?(l=async g=>{const x=ke.ensureTask(n.id,t??"");await s.cancelQueries({queryKey:x});const b=s.getQueryData(x),v=(b?.metadata?.expanded_tools??[]).filter(k=>k.toolName!==g.toolName);return v.push({...g,expandedAt:new Date().toISOString()}),s.setQueryData(x,k=>k&&{...k,metadata:{...k.metadata??{},expanded_tools:v}}),{previous:b}},u=()=>{s.invalidateQueries({queryKey:ke.ensureTask(n.id,t??"")})},c=(g,x,b)=>{const y=ke.ensureTask(n.id,t??"");b?.previous===void 0?s.removeQueries({queryKey:y,exact:!0}):s.setQueryData(y,b.previous),Yn.error(g instanceof Error?g.message:"Failed to expand tool")},e[3]=n,e[4]=s,e[5]=t,e[6]=l,e[7]=u,e[8]=c):(l=e[6],u=e[7],c=e[8]);let m;e[9]!==i||e[10]!==l||e[11]!==u||e[12]!==c?(m={mutationFn:i,onMutate:l,onSuccess:u,onError:c},e[9]=i,e[10]=l,e[11]=u,e[12]=c,e[13]=m):m=e[13];const d=Ri(m);let f;e[14]!==r||e[15]!==d||e[16]!==n||e[17]!==s||e[18]!==t?(f=g=>{if(!t||!r)return;const x=ke.ensureTask(n.id,t),b=s.getQueryData(x),v=(b?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);v.push({...g,expandedAt:new Date().toISOString()});const k={...b?.metadata??{},expanded_tools:v};s.setQueryData(x,j=>j&&{...j,metadata:k}),r.patchThread({id:t,metadata:k}),d.mutate(g)},e[14]=r,e[15]=d,e[16]=n,e[17]=s,e[18]=t,e[19]=f):f=e[19];const p=f;let h;return e[20]!==p||e[21]!==d.isPending||e[22]!==d.mutate?(h={addOrReplace:d.mutate,addOrReplaceEager:p,isPending:d.isPending},e[20]=p,e[21]=d.isPending,e[22]=d.mutate,e[23]=h):h=e[23],h}function $u(t){if(t<1024)return`${t} B`;if(t<1024*1024){const n=t/1024;return n<10?`${n.toFixed(1)} KB`:`${Math.round(n)} KB`}const e=t/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function Ou(t,e,n,s){const{data:r,isLoading:o}=Lt({queryKey:ke.toolDefinitionLookup(e,n,t),queryFn:async()=>{if(!t||!e)return null;const i=await Di({connectionId:e,orgId:n,orgSlug:s});try{const{tools:l}=await i.listTools(),u=So(t);return l.find(c=>c.name===u)??null}finally{await i.close().catch(()=>{})}},enabled:!!t&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:r??void 0,isLoading:o}}const Du={read:{icon:pr,label:"Read File"},write:{icon:Ya,label:"Write File"},edit:{icon:sa,label:"Edit File"},grep:{icon:Ja,label:"Search Content"},glob:{icon:Qa,label:"Find Files"},bash:{icon:na,label:"Run Command"},read_tool_output:{icon:pr,label:"Read Tool Output"},read_resource:{icon:ta,label:"Read Resource"},read_prompt:{icon:ts,label:"Read Prompt"},skill:{icon:ts,label:"Load Skill"},enable_tool:{icon:Xa,label:"Enable Tool"},open_in_agent:{icon:ea,label:"Open in Agent"},sandbox:{icon:Zi,label:"Run Code"},copy_to_sandbox:{icon:go,label:"Load File"},share_with_user:{icon:Za,label:"Share with User"},take_screenshot:{icon:yt,label:"Take Screenshot"},scrape_url:{icon:Kt,label:"Scrape URL"},inspect_page:{icon:Ji,label:"Inspect Page"}},Hu="bash-sleep-start:";function zu(t){const e=Hu+t;try{const n=sessionStorage.getItem(e);if(n!==null){const r=Number.parseInt(n,10);if(Number.isFinite(r))return r}const s=Date.now();return sessionStorage.setItem(e,String(s)),s}catch{return Date.now()}}function Fu(t,e){const n=P.c(2);let s;n[0]!==t?(s=()=>zu(t),n[0]=t,n[1]=s):s=n[1];const r=_.useState(s)[0];return e??r}function Bu(t){const e=Math.ceil(t/1e3);if(e<60)return`${e}s`;const n=Math.floor(e/60),s=e%60;return s?`${n}m ${s}s`:`${n}m`}function Uu(t){const e=P.c(4),{toolCallId:n,durationMs:s,anchorMs:r}=t;Jr(1e3);const i=Fu(n,r)+s-Date.now();let l;e[0]!==i?(l=i>0?`Waiting ${Bu(i)}`:"Wrapping up…",e[0]=i,e[1]=l):l=e[1];let u;return e[2]!==l?(u=a.jsx("span",{className:"tabular-nums",children:l}),e[2]=l,e[3]=u):u=e[3],u}const Wu={s:1e3,m:6e4,h:36e5,d:864e5};function Ku(t){const e=/(?:^|[\s;&|(])sleep((?:\s+[\d.]+[smhd]?)+)/g;let n=0,s=!1;for(const r of t.matchAll(e))for(const o of r[1].trim().split(/\s+/)){const i=/^([\d.]+)([smhd]?)$/.exec(o);if(!i)continue;const l=Number.parseFloat(i[1]);Number.isFinite(l)&&(n+=l*(Wu[i[2]||"s"]??1e3),s=!0)}return s?n:null}function Ln(t,e="An unknown error occurred"){return"errorText"in t&&typeof t.errorText=="string"?t.errorText:e}function lt(t){if(t==null)return"";try{return JSON.stringify(t)}catch{return"[Non-serializable value]"}}function Sn(t){const e=lt(t);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Vu=t=>t.type==="dynamic-tool"||t.type.startsWith("tool-");function Gu(t){if(!t||typeof t!="object")return null;const e=t;if(!Array.isArray(e.parts))return null;const n=[];for(const s of e.parts)if(s.type==="text"&&typeof s.text=="string")n.push(s.text);else if(s.type==="reasoning")n.push(`## Reasoning
|
|
46
|
-
${s.text}`);else if(s.type==="source-url")n.push(`## Source URL
|
|
47
|
-
${s.url}`);else if(s.type==="source-document")n.push(`## Source Document
|
|
48
|
-
${s.title}`);else if(s.type==="file")n.push(`## File
|
|
49
|
-
${s.filename??s.url}`);else if(s.type!=="step-start"){if(Vu(s)){const r=s.type.startsWith("tool-")?s.type.slice(5):s.toolName;if(s.state==="input-streaming")n.push(`## ${r}
|
|
50
|
-
Input streaming...`);else if(s.state==="input-available"){const o=lt(s.input).slice(0,20);n.push(`## ${r}
|
|
51
|
-
### Input
|
|
52
|
-
${o||"[No input]"}...`)}else if(s.state==="approval-requested")n.push(`## ${r}
|
|
53
|
-
Approval requested...`);else if(s.state==="approval-responded")n.push(`## ${r}
|
|
54
|
-
Approval responded...`);else if(s.state==="output-available"){const o=lt(s.input).slice(0,40),i=lt(s.output).slice(0,40);n.push(s.output!=null?`## ${r}
|
|
55
|
-
Input: ${o||"[No input]"}...
|
|
56
|
-
Output: ${i||"[No output]"}...`:`## ${r}
|
|
57
|
-
Input: ${o||"[No input]"}...
|
|
58
|
-
Output: Tool responded with no output`)}else if(s.state==="output-error"){const o=lt(s.input).slice(0,40);n.push(s.errorText?`## ${r}
|
|
59
|
-
Input: ${o||"[No input]"}...
|
|
60
|
-
Error: ${s.errorText}`:`## ${r}
|
|
61
|
-
Input: ${o||"[No input]"}...
|
|
62
|
-
Error: Tool responded with an error`)}else if(s.state==="output-denied"){const o=lt(s.input).slice(0,40);n.push(`## ${r}
|
|
63
|
-
Input: ${o||"[No input]"}...
|
|
64
|
-
Output: Tool execution was denied`)}}}return n.length>0?n.join(`
|
|
65
|
-
|
|
66
|
-
`):null}function qu(t){const e=t&&typeof t=="object"&&"created_at"in t?t.created_at:void 0;return typeof e=="string"||e instanceof Date?_s(e):null}function Xu(t){const e=t&&typeof t=="object"&&"timeout"in t?t.timeout:void 0;return Math.min(typeof e=="number"?e:3e4,12e4)}function zt(t){const e=P.c(7),{icon:n,label:s}=t;let r;e[0]!==n?(r=a.jsx(nt,{asChild:!0,children:a.jsx("span",{className:"flex items-center",children:n})}),e[0]=n,e[1]=r):r=e[1];let o;e[2]!==s?(o=a.jsx(st,{side:"top",children:s}),e[2]=s,e[3]=o):o=e[3];let i;return e[4]!==r||e[5]!==o?(i=a.jsxs(rt,{children:[r,o]}),e[4]=r,e[5]=o,e[6]=i):i=e[6],i}function Yu(t){const e=P.c(15),{annotations:n,toolMeta:s}=t;let r;e[0]!==s?(r=lo(s),e[0]=s,e[1]=r):r=e[1];const o=!!r;if(!n&&!o)return null;let i;e[2]!==o?(i=o&&a.jsx(zt,{icon:a.jsx(no,{}),label:"Interactive"}),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==n?.readOnlyHint?(l=n?.readOnlyHint&&a.jsx(zt,{icon:a.jsx(Va,{}),label:"Read-only — no side effects"}),e[4]=n?.readOnlyHint,e[5]=l):l=e[5];let u;e[6]!==n?.destructiveHint?(u=n?.destructiveHint&&a.jsx(zt,{icon:a.jsx(po,{}),label:"May modify or delete data"}),e[6]=n?.destructiveHint,e[7]=u):u=e[7];let c;e[8]!==n?.openWorldHint?(c=n?.openWorldHint&&a.jsx(zt,{icon:a.jsx(Kt,{}),label:"Reaches outside this system"}),e[8]=n?.openWorldHint,e[9]=c):c=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==u||e[13]!==c?(m=a.jsxs(a.Fragment,{children:[i,l,u,c]}),e[10]=i,e[11]=l,e[12]=u,e[13]=c,e[14]=m):m=e[14],m}function Qu(t){return t<1?`${Math.round(t*1e3)}ms`:t<10?`${t.toFixed(1)}s`:`${Math.round(t)}s`}function Ju(t){const e=P.c(13),{latency:n,outputBytes:s}=t,r=typeof n=="number"&&n>0,o=typeof s=="number"&&s>=0;if(!r&&!o)return null;let i;e[0]!==r||e[1]!==n?(i=r&&a.jsx("span",{children:Qu(n)}),e[0]=r,e[1]=n,e[2]=i):i=e[2];let l;e[3]!==o||e[4]!==r?(l=r&&o&&a.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[3]=o,e[4]=r,e[5]=l):l=e[5];let u;e[6]!==o||e[7]!==s?(u=o&&a.jsx("span",{children:$u(s)}),e[6]=o,e[7]=s,e[8]=u):u=e[8];let c;return e[9]!==i||e[10]!==l||e[11]!==u?(c=a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-mono tabular-nums text-muted-foreground/60 px-1 leading-none",children:[i,l,u]}),e[9]=i,e[10]=l,e[11]=u,e[12]=c):c=e[12],c}function Zu(t,e,n){switch(t){case"input-streaming":case"input-available":return"Preparing...";case"approval-requested":return"Waiting for your approval";case"output-denied":return"Cancelled";case"output-error":return n??"Failed";case"output-available":{if(e==null)return"Done";if(typeof e=="string"){const s=e.trim();return s.length>100?s.slice(0,100)+"…":s}if(typeof e=="object"){for(const s of Object.keys(e)){const r=e[s];if(typeof r=="string"&&r.trim()){const o=r.trim();return o.length>100?o.slice(0,100)+"…":o}}return""}return String(e).slice(0,100)}default:return""}}function Mr(t){const e=P.c(74),{part:n,annotations:s,latency:r,outputBytes:o,isLastMessage:i,toolMeta:l}=t,u="toolName"in n&&typeof n.toolName=="string"?n.toolName:n.type==="dynamic-tool"?"Dynamic Tool":n.type.replace("tool-","")||"Tool",c=So(u),m=pt(),d=pa(),{org:f}=He(),{openSidePanel:p}=el(),h=Is()?.taskId??null,{addOrReplaceEager:g}=Pu(h),x=mt(),b=l&&typeof l=="object"&&l!==null&&"connectionId"in l&&l.connectionId!=null&&l.connectionId!==""?String(l.connectionId):d?.selectedVirtualMcp?.id??null,{toolDef:y}=Ou(b?u:null,b,f.id,f.slug),v=y?._meta??l,k=Ms(v),j=Rs(c,k),S=Du[j],w=y?.title??S?.label??Fa(j);let T;e[0]!==v?(T=lo(v),e[0]=v,e[1]=T):T=e[1];const N=T,C=!!N&&n.state==="output-available",I=b?`${b}:${u}`:null,M=!!s?.destructiveHint,A=C&&!!b&&!M&&!!h;let $;e[2]!==g||e[3]!==b||e[4]!==x||e[5]!==n||e[6]!==u?($=()=>{if(!b)return;const U="input"in n&&n.input&&typeof n.input=="object"?n.input:{};g({toolName:u,appId:b,args:U}),x({to:".",search:Z=>({...Z,main:ya(b,u)}),replace:!0})},e[2]=g,e[3]=b,e[4]=x,e[5]=n,e[6]=u,e[7]=$):$=e[7];const E=$;let O;e[8]!==A||e[9]!==E?(O=U=>U==="fullscreen"&&A?(E(),"fullscreen"):"inline",e[8]=A,e[9]=E,e[10]=O):O=e[10];const R=O;let D;e[11]!==m||e[12]!==p?(D=U=>{const Z=xa(U.content);Z.content.length>0&&(p("chat"),m?.sendMessage(Z))},e[11]=m,e[12]=p,e[13]=D):D=e[13];const H=D,F=n.state==="approval-requested"&&i===!1,K=n.state==="output-denied"||F,B=n.state==="output-available"&&typeof n.output=="object"&&n.output!=null&&"isError"in n.output&&n.output.isError===!0;let V;e[14]!==n.state?(V=Ce(n.state),e[14]=n.state,e[15]=V):V=e[15];const Y=V,Q=F||Y==="approval"?"idle":B?"error":Y;let J,ee;if(e[16]!==Q||e[17]!==B||e[18]!==F||e[19]!==n||e[20]!==j){J=n.state==="output-error"?Ln(n):void 0;const U=j==="bash"&&Q==="loading"&&n.input&&typeof n.input=="object"&&typeof n.input.command=="string"?n.input.command:null;let Z;e[23]!==U?(Z=U!==null?Ku(U):null,e[23]=U,e[24]=Z):Z=e[24];const ne=Z;let _e;e[25]!==n.input||e[26]!==ne?(_e=ne!==null?Math.min(ne,Xu(n.input)):null,e[25]=n.input,e[26]=ne,e[27]=_e):_e=e[27];const lr=_e,Ni="toolCallId"in n?n.toolCallId:"";ee=lr!==null?a.jsx(Uu,{toolCallId:Ni,durationMs:lr,anchorMs:qu(n)}):F?"Cancelled":B?"Failed":Zu(n.state,n.output,J),e[16]=Q,e[17]=B,e[18]=F,e[19]=n,e[20]=j,e[21]=J,e[22]=ee}else J=e[21],ee=e[22];const ce=ee;let z="";n.input!==void 0&&(z=`# Input
|
|
67
|
-
`+Sn(n.input)),n.state==="output-error"?(z&&(z=z+`
|
|
68
|
-
|
|
69
|
-
`),z=z+(`# Error
|
|
70
|
-
`+(J??""))):n.output!==void 0&&!C&&(z&&(z=z+`
|
|
71
|
-
|
|
72
|
-
`),z=z+(`# Output
|
|
73
|
-
`+Sn(n.output)));let X;e:{if(K){let ne;e[28]===Symbol.for("react.memo_cache_sentinel")?(ne=a.jsx(Ga,{}),e[28]=ne):ne=e[28],X=ne;break e}if(C){let ne;e[29]===Symbol.for("react.memo_cache_sentinel")?(ne=a.jsx(no,{className:"size-4 text-muted-foreground"}),e[29]=ne):ne=e[29],X=ne;break e}const U=S?.icon;if(U){let ne;e[30]!==U?(ne=a.jsx(U,{className:"size-4 text-muted-foreground"}),e[30]=U,e[31]=ne):ne=e[31],X=ne;break e}let Z;e[32]===Symbol.for("react.memo_cache_sentinel")?(Z=a.jsx(ra,{className:"size-4 text-muted-foreground"}),e[32]=Z):Z=e[32],X=Z}let se;e[33]!==s||e[34]!==l?(se=a.jsx(Yu,{annotations:s,toolMeta:l}),e[33]=s,e[34]=l,e[35]=se):se=e[35];let ie;e[36]!==r||e[37]!==o?(ie=a.jsx(Ju,{latency:r,outputBytes:o}),e[36]=r,e[37]=o,e[38]=ie):ie=e[38];let me;e[39]!==se||e[40]!==ie?(me=a.jsxs(a.Fragment,{children:[se,ie]}),e[39]=se,e[40]=ie,e[41]=me):me=e[41];const ze=z||null;let pe;e[42]!==Q||e[43]!==w||e[44]!==K||e[45]!==r||e[46]!==ce||e[47]!==me||e[48]!==ze||e[49]!==X?(pe=a.jsx(G,{icon:X,iconDestructive:K,trailing:me,title:w,latency:r,summary:ce,state:Q,detail:ze}),e[42]=Q,e[43]=w,e[44]=K,e[45]=r,e[46]=ce,e[47]=me,e[48]=ze,e[49]=X,e[50]=pe):pe=e[50];let he;e[51]!==A||e[52]!==E?(he=A&&a.jsx("div",{className:"flex justify-end mt-1.5 mb-1",children:a.jsxs("button",{type:"button",onClick:E,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground rounded-md [@media(hover:hover)]:hover:bg-accent/50 [@media(hover:hover)]:hover:text-foreground transition-colors",children:[a.jsx(oa,{className:"size-3.5"}),"Open in panel"]})}),e[51]=A,e[52]=E,e[53]=he):he=e[53];let ge;e[54]!==A||e[55]!==d||e[56]!==b||e[57]!==w||e[58]!==H||e[59]!==R||e[60]!==C||e[61]!==v||e[62]!==f.id||e[63]!==f.slug||e[64]!==n.input||e[65]!==n.output||e[66]!==I||e[67]!==j||e[68]!==N?(ge=C&&N&&b&&f?.id&&a.jsx(a.Fragment,{children:a.jsx(Ur,{fallback:U=>{const{resetError:Z}=U;return a.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-2.5 border border-dashed border-destructive/30 bg-destructive/5 rounded-lg",children:[a.jsx(po,{size:16,className:"shrink-0 text-destructive"}),a.jsxs("span",{className:"flex-1 text-xs text-destructive font-medium",children:["Failed to load"," ",a.jsx("span",{className:"font-mono",children:w})," app"]}),a.jsxs(tt,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5 shrink-0",onClick:Z,children:[a.jsx(Wr,{className:"size-3.5"}),"Retry"]})]})},children:a.jsx(_.Suspense,{fallback:a.jsx("div",{className:"mt-2 flex items-center justify-center h-12 border border-border/75 rounded-lg overflow-hidden p-3",children:a.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),a.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:a.jsx(nd,{uiResourceUri:N,connectionId:b,orgId:f.id,orgSlug:f.slug,toolName:j,toolInput:n.input,toolResult:n.output,toolMeta:v,onMessage:H,onUpdateModelContext:I&&d?U=>d.setAppContext(I,U):void 0,onTeardown:I&&d?()=>d.clearAppContext(I):void 0,onRequestDisplayMode:A?R:void 0})})})}),e[54]=A,e[55]=d,e[56]=b,e[57]=w,e[58]=H,e[59]=R,e[60]=C,e[61]=v,e[62]=f.id,e[63]=f.slug,e[64]=n.input,e[65]=n.output,e[66]=I,e[67]=j,e[68]=N,e[69]=ge):ge=e[69];let Pe;return e[70]!==pe||e[71]!==he||e[72]!==ge?(Pe=a.jsxs("div",{children:[pe,he,ge]}),e[70]=pe,e[71]=he,e[72]=ge,e[73]=Pe):Pe=e[73],Pe}function ei(t){return typeof t=="object"&&t!=null&&"type"in t&&t.type==="mcpToolCall"}function ed(t){if(t!=null)return ei(t)?t.arguments??void 0:t}function td(t){if(t==null)return;if(ei(t)&&t.result!=null)return t.result;if(typeof t=="object"&&"content"in t&&Array.isArray(t.content)){const n=t.content;if(n.length>0&&typeof n[0]=="object"&&n[0]!=null&&"type"in n[0])return t}const e=typeof t=="string"?t:JSON.stringify(t);return{structuredContent:typeof t=="object"&&!Array.isArray(t)?t:void 0,content:[{type:"text",text:e}]}}function nd(t){const e=P.c(27),{uiResourceUri:n,connectionId:s,orgId:r,orgSlug:o,toolName:i,toolInput:l,toolResult:u,toolMeta:c,onMessage:m,onUpdateModelContext:d,onTeardown:f,onRequestDisplayMode:p}=t;let h;e[0]!==s||e[1]!==r||e[2]!==o?(h={connectionId:s,orgId:r,orgSlug:o},e[0]=s,e[1]=r,e[2]=o,e[3]=h):h=e[3];const g=Ss(h);let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x={type:"object"},e[4]=x):x=e[4];let b;e[5]!==c?(b=c!=null&&{_meta:c},e[5]=c,e[6]=b):b=e[6];let y;e[7]!==b||e[8]!==i?(y={name:i,inputSchema:x,...b},e[7]=b,e[8]=i,e[9]=y):y=e[9];const v=y;let k;e[10]!==v?(k={tool:v},e[10]=v,e[11]=k):k=e[11];let j;e[12]!==l?(j=ed(l),e[12]=l,e[13]=j):j=e[13];let S;e[14]!==u?(S=td(u),e[14]=u,e[15]=S):S=e[15];let w;return e[16]!==g||e[17]!==m||e[18]!==p||e[19]!==f||e[20]!==d||e[21]!==r||e[22]!==k||e[23]!==j||e[24]!==S||e[25]!==n?(w=a.jsx("div",{className:"mt-2 border border-border/75 rounded-lg overflow-hidden p-3",children:a.jsx(ba,{resourceURI:n,orgId:r,toolInfo:k,toolInput:j,toolResult:S,client:g,onMessage:m,onUpdateModelContext:d,onTeardown:f,onRequestDisplayMode:p})}),e[16]=g,e[17]=m,e[18]=p,e[19]=f,e[20]=d,e[21]=r,e[22]=k,e[23]=j,e[24]=S,e[25]=n,e[26]=w):w=e[26],w}const Rr="studio-storage://",Pr="mesh-storage://";function Mn(t){return t.startsWith(Rr)?t.slice(Rr.length):t.startsWith(Pr)?t.slice(Pr.length):null}function ti(t,e){const n=Mn(t);return n!==null?`/api/${e}/files/${n}`:t}function sd(t){if(!t?.usage)return null;const e=t.usage.inputTokens??0,n=t.usage.outputTokens??0,s=e+n;return s?{inputTokens:e,outputTokens:n,reasoningTokens:0,totalTokens:s,cost:0,cacheReadTokens:0,cacheWriteTokens:0}:null}function rd(t){const e=P.c(13),{uri:n,orgSlug:s}=t;let r;e[0]!==s||e[1]!==n?(r=ti(n,s),e[0]=s,e[1]=n,e[2]=r):r=e[2];const o=r;let i;e[3]!==n?(i=Mn(n)!==null?n.slice(n.lastIndexOf("/")+1):"reference",e[3]=n,e[4]=i):i=e[4];const l=i;let u;e[5]!==l?(u=a.jsx(nt,{asChild:!0,children:a.jsx("span",{className:"inline-flex items-center gap-1 px-1 py-0.5 rounded bg-muted text-muted-foreground text-xs cursor-default select-none",children:l})}),e[5]=l,e[6]=u):u=e[6];let c;e[7]!==l||e[8]!==o?(c=a.jsx(st,{side:"top",className:"max-w-sm p-1.5",children:a.jsx("img",{src:o,alt:l,className:"max-w-full max-h-64 object-contain rounded"})}),e[7]=l,e[8]=o,e[9]=c):c=e[9];let m;return e[10]!==u||e[11]!==c?(m=a.jsxs(rt,{children:[u,c]}),e[10]=u,e[11]=c,e[12]=m):m=e[12],m}function od(t){const e=P.c(76),{part:n,latency:s}=t,r=ks();let o;e[0]!==n.state?(o=Ce(n.state),e[0]=n.state,e[1]=o):o=e[1];const i=o,l=n.input,u=n.output,c=u?.images;let m;e[2]!==u?(m=sd(u),e[2]=u,e[3]=m):m=e[3];const d=m,f=u?.model;let p,h,g,x,b,y,v,k,j,S,w,T;if(e[4]!==c||e[5]!==l||e[6]!==s||e[7]!==f||e[8]!==r||e[9]!==n||e[10]!==u||e[11]!==i||e[12]!==d){b=Symbol.for("react.early_return_sentinel");e:{const $=Array.isArray(l?.referenceImages)?l.referenceImages.filter(id):void 0;let E;e[25]!==s?(E=s!=null&&s>0?a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:Ve(s)}):null,e[25]=s,e[26]=E):E=e[26];const O=E;if(i==="loading"){let R;e[27]===Symbol.for("react.memo_cache_sentinel")?(R=a.jsx(Pt,{size:14}),e[27]=R):R=e[27];let D;e[28]!==l?(D=l?.prompt?`"${l.prompt.slice(0,80)}…"`:void 0,e[28]=l,e[29]=D):D=e[29];let H;e[30]!==D?(H=a.jsx(G,{icon:R,title:"Generating image",summary:D,state:"loading"}),e[30]=D,e[31]=H):H=e[31],b=H;break e}if(u?.background){let R;e[32]===Symbol.for("react.memo_cache_sentinel")?(R=a.jsx(Pt,{size:14}),e[32]=R):R=e[32];let D;e[33]!==l?(D=l?.prompt?`"${l.prompt.slice(0,80)}…"`:void 0,e[33]=l,e[34]=D):D=e[34];let H;e[35]!==D?(H=a.jsx(G,{icon:R,title:"Image queued — generating in the background",summary:D,state:"idle"}),e[35]=D,e[36]=H):H=e[36],b=H;break e}if(i==="error"||!c||c.length===0){let R;e[37]!==n||e[38]!==i?(R=i==="error"?Ln(n):void 0,e[37]=n,e[38]=i,e[39]=R):R=e[39];const D=R;let H="";l!==void 0&&(H=`# Input
|
|
74
|
-
`+Sn(l)),D?(H&&(H=H+`
|
|
75
|
-
|
|
76
|
-
`),H=H+(`# Error
|
|
77
|
-
`+D)):u!==void 0&&(H&&(H=H+`
|
|
78
|
-
|
|
79
|
-
`),H=H+(`# Output
|
|
80
|
-
`+Sn(u)));let F;e[40]===Symbol.for("react.memo_cache_sentinel")?(F=a.jsx(Pt,{size:14}),e[40]=F):F=e[40];const K=i==="error"?"Failed":"No images generated",B=i==="error"?"error":"idle",V=H||null;let Y;e[41]!==O||e[42]!==K||e[43]!==B||e[44]!==V||e[45]!==d?(Y=a.jsx(G,{icon:F,title:"Image generation",summary:K,state:B,usage:d,trailing:O,detail:V}),e[41]=O,e[42]=K,e[43]=B,e[44]=V,e[45]=d,e[46]=Y):Y=e[46],b=Y;break e}x="flex flex-col gap-2",p=G,e[47]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(Pt,{size:14,className:"text-pink-500"}),e[47]=j):j=e[47],S="Generated image",w=f,T="idle",h=d,g=O,y="flex flex-col gap-1 pb-2 pl-6",e[48]!==l?(v=l?.prompt&&a.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:l.prompt}),e[48]=l,e[49]=v):v=e[49],k=$&&$.length>0&&a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"text-[11px] text-muted-foreground/50",children:"references:"}),$.map((R,D)=>{const H=R.uri??R.url;return a.jsx(rd,{uri:H,orgSlug:r.slug},D)})]})}e[4]=c,e[5]=l,e[6]=s,e[7]=f,e[8]=r,e[9]=n,e[10]=u,e[11]=i,e[12]=d,e[13]=p,e[14]=h,e[15]=g,e[16]=x,e[17]=b,e[18]=y,e[19]=v,e[20]=k,e[21]=j,e[22]=S,e[23]=w,e[24]=T}else p=e[13],h=e[14],g=e[15],x=e[16],b=e[17],y=e[18],v=e[19],k=e[20],j=e[21],S=e[22],w=e[23],T=e[24];if(b!==Symbol.for("react.early_return_sentinel"))return b;let N;e[50]!==y||e[51]!==v||e[52]!==k?(N=a.jsxs("div",{className:y,children:[v,k]}),e[50]=y,e[51]=v,e[52]=k,e[53]=N):N=e[53];let C;e[54]!==p||e[55]!==h||e[56]!==g||e[57]!==N||e[58]!==j||e[59]!==S||e[60]!==w||e[61]!==T?(C=a.jsx(p,{icon:j,title:S,summary:w,state:T,usage:h,trailing:g,children:N}),e[54]=p,e[55]=h,e[56]=g,e[57]=N,e[58]=j,e[59]=S,e[60]=w,e[61]=T,e[62]=C):C=e[62];let I;if(e[63]!==c||e[64]!==l?.prompt||e[65]!==r){let $;e[67]!==l?.prompt||e[68]!==r?($=(E,O)=>{const R=E.uri??E.url;if(!R)return null;const D=ti(R,r.slug);return a.jsx(ao,{src:D,alt:l?.prompt??"Generated image",children:a.jsx("img",{src:D,alt:l?.prompt??"Generated image",className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"})},O)},e[67]=l?.prompt,e[68]=r,e[69]=$):$=e[69],I=c.map($),e[63]=c,e[64]=l?.prompt,e[65]=r,e[66]=I}else I=e[66];let M;e[70]!==I?(M=a.jsx("div",{className:"flex flex-wrap gap-2",children:I}),e[70]=I,e[71]=M):M=e[71];let A;return e[72]!==x||e[73]!==C||e[74]!==M?(A=a.jsxs("div",{className:x,children:[C,M]}),e[72]=x,e[73]=C,e[74]=M,e[75]=A):A=e[75],A}function id(t){return t.uri??t.url}function ad(t,e){const n=Mn(t);return n!==null?`/api/${e}/files/${n}`:t}function ld(t){const e=P.c(26),{part:n,latency:s}=t,r=ks(),o=Ce(n.state),i=n.input,l=n.output,u=l?.image?.uri,c=l?.url??i?.url;let m;e[0]!==s?(m=s!=null&&s>0?a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:Ve(s)}):null,e[0]=s,e[1]=m):m=e[1];const d=m;if(o==="loading"){let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(yt,{size:14}),e[2]=j):j=e[2];let S;return e[3]!==c?(S=a.jsx(G,{icon:j,title:"Taking screenshot",summary:c,state:"loading"}),e[3]=c,e[4]=S):S=e[4],S}if(o==="error"||l?.success===!1||!u){let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(yt,{size:14}),e[5]=j):j=e[5];const S=l?.error??"Failed";let w;return e[6]!==d||e[7]!==S?(w=a.jsx(G,{icon:j,title:"Take screenshot",summary:S,state:"error",trailing:d}),e[6]=d,e[7]=S,e[8]=w):w=e[8],w}let f;e[9]!==r.slug||e[10]!==u?(f=ad(u,r.slug),e[9]=r.slug,e[10]=u,e[11]=f):f=e[11];const p=f;let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=a.jsx(yt,{size:14,className:"text-blue-500"}),e[12]=h):h=e[12];let g;e[13]!==d||e[14]!==c?(g=a.jsx(G,{icon:h,title:"Screenshot",summary:c,state:"idle",trailing:d}),e[13]=d,e[14]=c,e[15]=g):g=e[15];const x=c??"Screenshot",b=c??"Screenshot";let y;e[16]!==p||e[17]!==b?(y=a.jsx("img",{src:p,alt:b,className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"}),e[16]=p,e[17]=b,e[18]=y):y=e[18];let v;e[19]!==p||e[20]!==x||e[21]!==y?(v=a.jsx("div",{className:"flex flex-wrap gap-2",children:a.jsx(ao,{src:p,alt:x,children:y})}),e[19]=p,e[20]=x,e[21]=y,e[22]=v):v=e[22];let k;return e[23]!==g||e[24]!==v?(k=a.jsxs("div",{className:"flex flex-col gap-2",children:[g,v]}),e[23]=g,e[24]=v,e[25]=k):k=e[25],k}function cd(t,e){const n=Mn(t);return n!==null?`/api/${e}/files/${n}`:t}function ud(t){if(!t?.usage)return null;const e=t.usage.inputTokens??0,n=t.usage.outputTokens??0,s=e+n;if(!s)return null;const r={providerMetadata:t.usage.providerMetadata};return{inputTokens:e,outputTokens:n,reasoningTokens:0,totalTokens:s,cost:yo(r),cacheReadTokens:0,cacheWriteTokens:0}}function dd(t){try{return new URL(t).hostname.replace(/^www\./,"")}catch{return t}}function fd(t){try{return`${new URL(t).origin}/favicon.ico`}catch{return""}}function md(t){const e=P.c(16),{citation:n,index:s}=t;let r;e[0]!==n.url?(r=dd(n.url),e[0]=n.url,e[1]=r):r=e[1];const o=r;let i;e[2]!==n.url?(i=fd(n.url),e[2]=n.url,e[3]=i):i=e[3];const l=i,u=n.title||o;let c;e[4]!==l?(c=a.jsx("img",{src:l,alt:"",className:"size-3.5 rounded-sm shrink-0",onError:pd}),e[4]=l,e[5]=c):c=e[5];let m;e[6]!==u?(m=a.jsx("span",{className:"truncate max-w-[180px]",children:u}),e[6]=u,e[7]=m):m=e[7];const d=s+1;let f;e[8]!==d?(f=a.jsxs("span",{className:"text-[10px] text-muted-foreground/50 tabular-nums shrink-0",children:["[",d,"]"]}),e[8]=d,e[9]=f):f=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(xo,{size:10,className:"shrink-0 opacity-0 group-hover/src:opacity-100 transition-opacity"}),e[10]=p):p=e[10];let h;return e[11]!==n.url||e[12]!==c||e[13]!==m||e[14]!==f?(h=a.jsxs("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"group/src inline-flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:[c,m,f,p]}),e[11]=n.url,e[12]=c,e[13]=m,e[14]=f,e[15]=h):h=e[15],h}function pd(t){t.target.style.display="none"}function hd(t,e){return t.replace(/\[(\d+)\]/g,(n,s)=>{const r=parseInt(s,10)-1,o=e[r];return o?`[\\[${s}\\]](${o.url})`:n})}const qn=5;function gd(t){const e=P.c(12),{citations:n}=t,[s,r]=_.useState(!1),o=n.length>qn;let i;e[0]!==n||e[1]!==s?(i=s?n:n.slice(0,qn),e[0]=n,e[1]=s,e[2]=i):i=e[2];const l=i;let u;e[3]!==l?(u=l.map(bd),e[3]=l,e[4]=u):u=e[4];let c;e[5]!==n.length||e[6]!==s||e[7]!==o?(c=o&&a.jsx("button",{type:"button",onClick:()=>r(xd),className:"inline-flex items-center rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:s?"show less":`+${n.length-qn} more`}),e[5]=n.length,e[6]=s,e[7]=o,e[8]=c):c=e[8];let m;return e[9]!==u||e[10]!==c?(m=a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[u,c]}),e[9]=u,e[10]=c,e[11]=m):m=e[11],m}function xd(t){return!t}function bd(t,e){return a.jsx(md,{citation:t,index:e},t.url)}function yd(t){const e=P.c(51),{part:n,latency:s,streamingText:r}=t,o=ks();let i;e[0]!==n.state?(i=Ce(n.state),e[0]=n.state,e[1]=i):i=e[1];const l=i,u=n.input,c=n.output;let m,d,f;e[2]!==o||e[3]!==c?(m=c?.uri?cd(c.uri,o.slug):void 0,f=Lt,d=ke.webSearchBlob(m??""),e[2]=o,e[3]=c,e[4]=m,e[5]=d,e[6]=f):(m=e[4],d=e[5],f=e[6]);let p;e[7]!==m?(p=async()=>{const B=await fetch(m);if(!B.ok)throw new Error(`Failed to fetch: ${B.status}`);return B.text()},e[7]=m,e[8]=p):p=e[8];const h=!!m;let g;e[9]!==d||e[10]!==p||e[11]!==h?(g={queryKey:d,queryFn:p,enabled:h,staleTime:1/0},e[9]=d,e[10]=p,e[11]=h,e[12]=g):g=e[12];const{data:x}=f(g),b=l==="loading",y=l!=="loading"&&l!=="error",v=c?.citations;let k;e[13]!==c?(k=ud(c),e[13]=c,e[14]=k):k=e[14];const j=k,S=c?.content??x??r;let w;e[15]!==v||e[16]!==S?(w=S&&v?.length?hd(S,v):S,e[15]=v,e[16]=S,e[17]=w):w=e[17];const T=w;let N;e[18]!==s?(N=s!=null&&s>0?a.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:Ve(s)}):null,e[18]=s,e[19]=N):N=e[19];const C=N;if(l==="error"){let B;e[20]===Symbol.for("react.memo_cache_sentinel")?(B=a.jsx(Kt,{size:14}),e[20]=B):B=e[20];let V;return e[21]!==C||e[22]!==j?(V=a.jsx(G,{icon:B,title:"Web search",summary:"Failed",state:"error",usage:j,trailing:C}),e[21]=C,e[22]=j,e[23]=V):V=e[23],V}const I=b?"animate-pulse":"text-blue-500";let M;e[24]!==I?(M=q(I),e[24]=I,e[25]=M):M=e[25];let A;e[26]!==M?(A=a.jsx(Kt,{size:14,className:M}),e[26]=M,e[27]=A):A=e[27];const $=b?"Researching...":"Web search";let E;e[28]!==u||e[29]!==y||e[30]!==c?.model?(E=y?c?.model??u?.query?.slice(0,60):u?.query?`"${u.query.slice(0,80)}"`:void 0,e[28]=u,e[29]=y,e[30]=c?.model,e[31]=E):E=e[31];const O=b?"loading":"idle";let R;e[32]!==u?(R=u?.query&&a.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u.query}),e[32]=u,e[33]=R):R=e[33];let D;e[34]!==T||e[35]!==n.toolCallId?(D=T?a.jsx("div",{className:"max-h-96 overflow-y-auto overflow-x-hidden rounded-lg border border-border/40 bg-muted/20 px-4 py-3 min-w-0",children:a.jsx("div",{className:"prose prose-sm prose-neutral dark:prose-invert max-w-none text-[13px] leading-relaxed break-words",children:a.jsx(As,{id:n.toolCallId,text:T})})}):a.jsx("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-4 py-3",children:a.jsxs("div",{className:"space-y-2 animate-pulse",children:[a.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-3/4"}),a.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-1/2"})]})}),e[34]=T,e[35]=n.toolCallId,e[36]=D):D=e[36];let H;e[37]!==v?(H=v&&v.length>0&&a.jsx(gd,{citations:v}),e[37]=v,e[38]=H):H=e[38];let F;e[39]!==R||e[40]!==D||e[41]!==H?(F=a.jsxs("div",{className:"pl-6 pb-3 flex flex-col gap-1 min-w-0",children:[R,D,H]}),e[39]=R,e[40]=D,e[41]=H,e[42]=F):F=e[42];let K;return e[43]!==C||e[44]!==A||e[45]!==$||e[46]!==E||e[47]!==O||e[48]!==F||e[49]!==j?(K=a.jsx(G,{icon:A,title:$,summary:E,state:O,usage:j,trailing:C,defaultOpen:!0,children:F}),e[43]=C,e[44]=A,e[45]=$,e[46]=E,e[47]=O,e[48]=F,e[49]=j,e[50]=K):K=e[50],K}function vd(t){const e=P.c(14),{part:n}=t;if(!n.state.startsWith("output-"))return null;let s;e[0]!==n.input?.prompt?(s=n.input?.prompt?.trim()||"Question",e[0]=n.input?.prompt,e[1]=s):s=e[1];const r=s,o=n.state==="output-error"||n.state==="output-denied",i=n.state==="output-denied";let l;e[2]!==i||e[3]!==n?(l=i?"Skipped":n.state==="output-error"?Ln(n)??"Error":n.output?.response??"",e[2]=i,e[3]=n,e[4]=l):l=e[4];const u=l;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(qi,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[5]=c):c=e[5];let m;e[6]!==r?(m=a.jsxs("div",{className:"flex items-start gap-2",children:[c,a.jsx("span",{className:"text-[14px] text-muted-foreground leading-snug",children:r})]}),e[6]=r,e[7]=m):m=e[7];let d;e[8]!==u||e[9]!==o?(d=u&&a.jsx("div",{className:"ml-6 pl-2 border-l border-border/50",children:a.jsx("span",{className:q("text-[14px] leading-snug",o?"text-muted-foreground/50 italic":"text-foreground/70"),children:u})}),e[8]=u,e[9]=o,e[10]=d):d=e[10];let f;return e[11]!==m||e[12]!==d?(f=a.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,d]}),e[11]=m,e[12]=d,e[13]=f):f=e[13],f}const ni=_.createContext(new Map);function zp(t){const e=P.c(5),{messages:n,children:s}=t;let r;if(e[0]!==n){r=new Map;for(const i of n){const l=i.metadata?.subtaskJobId;if(!l)continue;const u=r.get(l);u?u.push(i):r.set(l,[i])}e[0]=n,e[1]=r}else r=e[1];let o;return e[2]!==r||e[3]!==s?(o=a.jsx(ni.Provider,{value:r,children:s}),e[2]=r,e[3]=s,e[4]=o):o=e[4],o}function kd(t){const e=P.c(3),n=_.useContext(ni);let s;return e[0]!==t||e[1]!==n?(s=t?n.get(t)??[]:[],e[0]=t,e[1]=n,e[2]=s):s=e[2],s}function Sd(t){return new ReadableStream({async start(e){const n=t.getReader(),s=new TextDecoder;let r="";try{for(;;){const{done:o,value:i}=await n.read();if(o)break;r+=s.decode(i,{stream:!0});let l;for(;(l=r.indexOf(`
|
|
81
|
-
|
|
82
|
-
`))!==-1;){const u=r.slice(0,l);r=r.slice(l+2);const c=u.split(`
|
|
83
|
-
`).filter(m=>m.startsWith("data:")).map(m=>m.slice(5).trim()).join(`
|
|
84
|
-
`);if(c)try{e.enqueue(JSON.parse(c))}catch{}}}}finally{n.releaseLock(),e.close()}}})}function jd(t){const{orgSlug:e,threadId:n,jobId:s,enabled:r}=t,[o,i]=_.useState([]),[l,u]=_.useState(!1);return _.useEffect(()=>{if(!r||!s)return;const c=new AbortController;return i([]),u(!0),(async()=>{try{const m=await fetch(`/api/${encodeURIComponent(e)}/decopilot/threads/${encodeURIComponent(n)}/jobs/${encodeURIComponent(s)}/stream`,{headers:{accept:"text/event-stream"},credentials:"include",signal:c.signal});if(!m.ok||!m.body)return;for await(const d of da({stream:fa(Sd(m.body),void 0)})){if(c.signal.aborted)return;i([d])}}catch{}finally{c.signal.aborted||u(!1)}})(),()=>c.abort()},[r,s,n,e]),{messages:o,streaming:l}}function wd(t){if(t&&typeof t=="object"&&!Array.isArray(t)){const e=t;if(typeof e.text=="string"||typeof e.error=="string"||typeof e.finishReason=="string"){if(typeof e.error=="string"&&e.error.length>0)return`Subtask failed: ${e.error}`;const s=typeof e.text=="string"?e.text.trim():"",r=e.finishReason==="length";return s?(r?`[Subtask hit step limit — partial result below; consider narrowing the task.]
|
|
85
|
-
|
|
86
|
-
`:"")+s:r?"[Subtask hit step limit before producing a final report. The subagent did work but ran out of steps. Narrow the task or increase the budget.]":"Subtask completed (no output)."}}return Gu(t)}function si(t){return!!t&&typeof t=="object"&&t.background===!0}function ri({part:t,subtaskMeta:e}){const n=t.state==="input-streaming"||t.state==="input-available",s=t.state==="output-available"&&t.preliminary===!0,r=t.state==="output-available"&&!t.preliminary,o=t.state==="output-error",i=Ce(t.state,"preliminary"in t?t.preliminary:!1),l=i==="approval"?"idle":i,u=n?"Starting subtask...":s?"Subtask running...":r?"Subtask completed":o?"Subtask failed":"Subtask",c=t.input?.prompt??"",m=t.state==="approval-requested"?"Awaiting approval...":c.length>120?c.slice(0,120)+"…":c;return{fallbackTitle:u,summary:m,usage:e?.usage,state:l}}function Qs(t){const e=P.c(45),{icon:n,title:s,summary:r,state:o,usage:i,onOpenChange:l,children:u}=t,[c,m]=_.useState(!1);let d;e[0]!==l?(d=D=>{m(D),l?.(D)},e[0]=l,e[1]=d):d=e[1];const f=d,p=o==="loading",h=o==="error";let g;e[2]!==f?(g=()=>f(!0),e[2]=f,e[3]=g):g=e[3];const x=p&&"shimmer";let b;e[4]!==x?(b=q("group/tool flex items-center gap-2 w-full py-2.5 text-left rounded-md transition-colors","[@media(hover:hover)]:hover:bg-accent/30",x),e[4]=x,e[5]=b):b=e[5];const y=h?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75";let v;e[6]!==y?(v=q("relative shrink-0 size-4 flex items-center justify-center [&>svg]:size-4",y),e[6]=y,e[7]=v):v=e[7];let k;e[8]!==n||e[9]!==v?(k=a.jsx("div",{className:v,children:n}),e[8]=n,e[9]=v,e[10]=k):k=e[10];const j=h?"text-warning/80":"text-foreground";let S;e[11]!==j?(S=q("shrink-0 text-[14px] font-normal",j),e[11]=j,e[12]=S):S=e[12];let w;e[13]!==S||e[14]!==s?(w=a.jsx("span",{className:S,children:s}),e[13]=S,e[14]=s,e[15]=w):w=e[15];let T;e[16]!==r?(T=r?a.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:r})}):a.jsx("div",{className:"flex-1"}),e[16]=r,e[17]=T):T=e[17];let N;e[18]===Symbol.for("react.memo_cache_sentinel")?(N=a.jsx(nl,{className:"size-3.5 shrink-0 text-muted-foreground/40 opacity-0 transition-opacity [@media(hover:hover)]:group-hover/tool:opacity-100"}),e[18]=N):N=e[18];let C;e[19]!==i?(C=a.jsx(Go,{usage:i}),e[19]=i,e[20]=C):C=e[20];let I;e[21]!==w||e[22]!==T||e[23]!==C||e[24]!==g||e[25]!==b||e[26]!==k?(I=a.jsxs("button",{type:"button",onClick:g,className:b,children:[k,w,T,N,C]}),e[21]=w,e[22]=T,e[23]=C,e[24]=g,e[25]=b,e[26]=k,e[27]=I):I=e[27];let M;e[28]!==n?(M=a.jsx("span",{className:"flex items-center [&>svg]:size-4 [&>svg]:text-muted-foreground/75",children:n}),e[28]=n,e[29]=M):M=e[29];let A;e[30]!==M||e[31]!==s?(A=a.jsx(Gr,{className:"px-4 py-3 border-b border-border shrink-0",children:a.jsxs(qr,{className:"flex items-center gap-2 text-sm font-medium",children:[M,s]})}),e[30]=M,e[31]=s,e[32]=A):A=e[32];let $;e[33]!==u?($=a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 py-4",children:u}),e[33]=u,e[34]=$):$=e[34];let E;e[35]!==A||e[36]!==$?(E=a.jsxs(js,{side:"right",className:"w-full sm:max-w-2xl flex flex-col p-0 gap-0",children:[A,$]}),e[35]=A,e[36]=$,e[37]=E):E=e[37];let O;e[38]!==c||e[39]!==f||e[40]!==E?(O=a.jsx(ws,{open:c,onOpenChange:f,children:E}),e[38]=c,e[39]=f,e[40]=E,e[41]=O):O=e[41];let R;return e[42]!==I||e[43]!==O?(R=a.jsxs(a.Fragment,{children:[I,O]}),e[42]=I,e[43]=O,e[44]=R):R=e[44],R}function oi(t){const e=P.c(9),{part:n}=t,s=n.state==="output-error",r=n.input?.prompt??"No prompt provided";let o;if(e[0]!==s||e[1]!==n||e[2]!==r){const i=s?Ln(n):wd(n.output)??"";let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:"Task"}),e[4]=l):l=e[4];let u;e[5]!==r?(u=a.jsxs("section",{children:[l,a.jsx("p",{className:"text-[13px] text-foreground/90 whitespace-pre-wrap wrap-break-word",children:r})]}),e[5]=r,e[6]=u):u=e[6];const c=s?"Error":"Result";let m;e[7]!==c?(m=a.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:c}),e[7]=c,e[8]=m):m=e[8],o=a.jsxs("div",{className:"flex flex-col gap-4",children:[u,a.jsxs("section",{children:[m,i.trim()?a.jsx(As,{id:`${n.toolCallId}-result`,text:i}):a.jsx("p",{className:"text-[13px] text-muted-foreground/60 italic",children:"Running…"})]})]}),e[0]=s,e[1]=n,e[2]=r,e[3]=o}else o=e[3];return o}const Xn=600;function Td(t){const e=P.c(12),{part:n}=t,s=n.type??"";let r;e[0]!==n.toolName||e[1]!==s?(r=s==="dynamic-tool"?n.toolName??"tool":s.slice(5),e[0]=n.toolName,e[1]=s,e[2]=r):r=e[2];const o=r;let i;if(e[3]!==n.input){const f=n.input!=null?JSON.stringify(n.input):"";i=f.length>80?`${f.slice(0,80)}…`:f||void 0,e[3]=n.input,e[4]=i}else i=e[4];const l=i;let u;if(e[5]!==n.input){const f=n.input!=null?JSON.stringify(n.input,null,2):null;u=f&&f.length>Xn?`${f.slice(0,Xn)}
|
|
87
|
-
… (${f.length-Xn} more characters)`:f,e[5]=n.input,e[6]=u}else u=e[6];const c=u;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(to,{}),e[7]=m):m=e[7];let d;return e[8]!==c||e[9]!==o||e[10]!==l?(d=a.jsx(G,{icon:m,title:o,summary:l,state:"idle",detail:c,detailVariant:"code"}),e[8]=c,e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function Nd(t){const e=P.c(12),{jobId:n,prompt:s,items:r,streaming:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("h3",{className:"text-xs font-medium text-muted-foreground/70 mb-1.5",children:"Task"}),e[0]=i):i=e[0];let l;e[1]!==s?(l=a.jsxs("section",{children:[i,a.jsx("p",{className:"text-[13px] text-foreground/90 whitespace-pre-wrap wrap-break-word",children:s})]}),e[1]=s,e[2]=l):l=e[2];let u;e[3]!==r||e[4]!==n||e[5]!==o?(u=r.length===0?a.jsx("p",{className:"text-[13px] text-muted-foreground/60 italic py-1",children:"Running in the background…"}):r.map((d,f)=>{const p=d,h=p.type??"";return h==="text"?p.text?.trim()?a.jsx(An,{id:`${n}-sub-${f}`,part:d,animate:o},`${n}-sub-${f}`):null:h==="dynamic-tool"||h.startsWith("tool-")&&h!=="tool-todo_write"&&h!=="tool-update_interests"?a.jsx(Td,{part:p},`${n}-sub-${f}`):null}),e[3]=r,e[4]=n,e[5]=o,e[6]=u):u=e[6];let c;e[7]!==u?(c=a.jsx("section",{className:"flex flex-col gap-3 sm:gap-2",children:u}),e[7]=u,e[8]=c):c=e[8];let m;return e[9]!==l||e[10]!==c?(m=a.jsxs("div",{className:"flex flex-col gap-4",children:[l,c]}),e[9]=l,e[10]=c,e[11]=m):m=e[11],m}function ii(t){const e=P.c(21),{part:n}=t,s=n.output?.jobId,{taskId:r}=ha(),{org:o}=He(),[i,l]=_.useState(!1),u=kd(s);let c;e[0]!==s||e[1]!==i||e[2]!==o.slug||e[3]!==r?(c={orgSlug:o.slug,threadId:r,jobId:s,enabled:i},e[0]=s,e[1]=i,e[2]=o.slug,e[3]=r,e[4]=c):c=e[4];const m=jd(c);let d;e[5]!==m.messages?(d=m.messages.flatMap(_d),e[5]=m.messages,e[6]=d):d=e[6];const f=d;let p;e[7]!==u?(p=u.flatMap(Cd),e[7]=u,e[8]=p):p=e[8];const h=p,g=f.length>0?f:h,x=n.input?.prompt??"No prompt provided";let b;e[9]!==x?(b=x.length>120?`${x.slice(0,120)}…`:x,e[9]=x,e[10]=b):b=e[10];const y=b,v=u.length===0;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(qe,{icon:void 0,name:"Subtask",size:"2xs",className:"rounded-xs",fallbackIcon:a.jsx(Ls,{})}),e[11]=k):k=e[11];const j=v?"loading":"idle",S=m.streaming||v;let w;e[12]!==g||e[13]!==s||e[14]!==x||e[15]!==S?(w=a.jsx(Nd,{jobId:s,prompt:x,items:g,streaming:S}),e[12]=g,e[13]=s,e[14]=x,e[15]=S,e[16]=w):w=e[16];let T;return e[17]!==y||e[18]!==j||e[19]!==w?(T=a.jsx(Qs,{icon:k,title:"Subtask",summary:y,state:j,onOpenChange:l,children:w}),e[17]=y,e[18]=j,e[19]=w,e[20]=T):T=e[20],T}function Cd(t){return t.parts??[]}function _d(t){return t.parts??[]}function Ad(t){const e=P.c(13);if(si(t.part.output)){let m;return e[0]!==t?(m=a.jsx(ii,{...t}),e[0]=t,e[1]=m):m=e[1],m}let n;e[2]!==t?(n=ri(t),e[2]=t,e[3]=n):n=e[3];const{fallbackTitle:s,summary:r,usage:o,state:i}=n;let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(qe,{icon:void 0,name:"Subtask",size:"2xs",className:"rounded-xs",fallbackIcon:a.jsx(Ls,{})}),e[4]=l):l=e[4];let u;e[5]!==t.part?(u=a.jsx(oi,{part:t.part}),e[5]=t.part,e[6]=u):u=e[6];let c;return e[7]!==s||e[8]!==i||e[9]!==r||e[10]!==u||e[11]!==o?(c=a.jsx(Qs,{icon:l,title:s,summary:r,state:i,usage:o,children:u}),e[7]=s,e[8]=i,e[9]=r,e[10]=u,e[11]=o,e[12]=c):c=e[12],c}function Id(t){const e=P.c(17),n=Vr(t.part.input?.agent_id);if(si(t.part.output)){let g;return e[0]!==t?(g=a.jsx(ii,{...t}),e[0]=t,e[1]=g):g=e[1],g}let s;e[2]!==t?(s=ri(t),e[2]=t,e[3]=s):s=e[3];const{fallbackTitle:r,summary:o,usage:i,state:l}=s,u=n?.icon,c=n?.title??"Subtask";let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Ls,{}),e[4]=m):m=e[4];let d;e[5]!==u||e[6]!==c?(d=a.jsx(qe,{icon:u,name:c,size:"2xs",className:"rounded-xs",fallbackIcon:m}),e[5]=u,e[6]=c,e[7]=d):d=e[7];const f=n?.title??r;let p;e[8]!==t.part?(p=a.jsx(oi,{part:t.part}),e[8]=t.part,e[9]=p):p=e[9];let h;return e[10]!==l||e[11]!==o||e[12]!==d||e[13]!==f||e[14]!==p||e[15]!==i?(h=a.jsx(Qs,{icon:d,title:f,summary:o,state:l,usage:i,children:p}),e[10]=l,e[11]=o,e[12]=d,e[13]=f,e[14]=p,e[15]=i,e[16]=h):h=e[16],h}function Ed(t){const e=P.c(16),{part:n}=t;if(!n.state.startsWith("output-"))return null;const s=n.input?.plan??"",o=n.output?.approved===!0;let i,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(ts,{className:"size-4 text-purple-500 shrink-0"}),l=a.jsx("span",{className:"text-[14px] font-medium text-foreground/80",children:"Implementation Plan"}),e[0]=i,e[1]=l):(i=e[0],l=e[1]);let u;e[2]!==o?(u=o&&a.jsxs("span",{className:"flex items-center gap-1 text-xs text-success bg-success/10 px-1.5 py-0.5 rounded-md",children:[a.jsx(Ns,{size:12}),"Approved"]}),e[2]=o,e[3]=u):u=e[3];let c;e[4]!==o||e[5]!==n.state?(c=!o&&n.state==="output-available"&&a.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:"Rejected"}),e[4]=o,e[5]=n.state,e[6]=c):c=e[6];let m;e[7]!==u||e[8]!==c?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[i,l,u,c]}),e[7]=u,e[8]=c,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"View plan"}),e[10]=d):d=e[10];let f;e[11]!==s?(f=a.jsxs("details",{className:"ml-6",children:[d,a.jsx("div",{className:"mt-1 pl-2 border-l-2 border-purple-500/30 prose prose-sm max-w-none text-sm",children:a.jsx(An,{id:"plan-content",part:{type:"text",text:s}})})]}),e[11]=s,e[12]=f):f=e[12];let p;return e[13]!==m||e[14]!==f?(p=a.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,f]}),e[13]=m,e[14]=f,e[15]=p):p=e[15],p}const Js={primary:"Primary",secondary:"Secondary",accent:"Accent",background:"Background",foreground:"Foreground"};function Ld(t){return t.startsWith("http")?t:`https://${t}`}function $r(t){const e=P.c(2),{children:n}=t;let s;return e[0]!==n?(s=a.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[0]=n,e[1]=s):s=e[1],s}function Md(t){const e=P.c(12),{name:n,value:s}=t;let r;e[0]!==s?(r=a.jsx("span",{className:"size-7 shrink-0 rounded-md border border-border",style:{backgroundColor:s},"aria-hidden":!0}),e[0]=s,e[1]=r):r=e[1];let o;e[2]!==n?(o=a.jsx("span",{className:"text-sm text-foreground",children:n}),e[2]=n,e[3]=o):o=e[3];let i;e[4]!==s?(i=a.jsx("span",{className:"text-xs font-mono tabular-nums text-muted-foreground",children:s}),e[4]=s,e[5]=i):i=e[5];let l;e[6]!==o||e[7]!==i?(l=a.jsxs("div",{className:"flex flex-col leading-tight min-w-0",children:[o,i]}),e[6]=o,e[7]=i,e[8]=l):l=e[8];let u;return e[9]!==r||e[10]!==l?(u=a.jsxs("div",{className:"flex items-center gap-2.5",children:[r,l]}),e[9]=r,e[10]=l,e[11]=u):u=e[11],u}function Rd(t){const e=P.c(15),{role:n,family:s}=t;let r;e[0]!==s?(r=a.jsx("span",{className:"text-2xl font-medium leading-none text-foreground shrink-0",style:{fontFamily:s},"aria-hidden":!0,children:"Aa"}),e[0]=s,e[1]=r):r=e[1];let o;e[2]!==n?(o=a.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[2]=n,e[3]=o):o=e[3];let i;e[4]!==s?(i={fontFamily:s},e[4]=s,e[5]=i):i=e[5];let l;e[6]!==s||e[7]!==i?(l=a.jsx("span",{className:"text-sm text-foreground",style:i,children:s}),e[6]=s,e[7]=i,e[8]=l):l=e[8];let u;e[9]!==o||e[10]!==l?(u=a.jsxs("div",{className:"flex flex-col leading-tight",children:[o,l]}),e[9]=o,e[10]=l,e[11]=u):u=e[11];let c;return e[12]!==r||e[13]!==u?(c=a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted px-4 py-3",children:[r,u]}),e[12]=r,e[13]=u,e[14]=c):c=e[14],c}function Pd(t){const e=P.c(3),{logo:n,favicon:s,name:r}=t,o=n??s;if(!o)return null;const i=r?`${r} logo`:"";let l;return e[0]!==o||e[1]!==i?(l=a.jsx("img",{src:o,alt:i,className:"size-16 shrink-0 rounded-lg border border-border bg-background object-contain p-2",onError:$d}),e[0]=o,e[1]=i,e[2]=l):l=e[2],l}function $d(t){t.target.style.display="none"}function ai(t){const e=P.c(4),{colors:n}=t;let s;e[0]!==n?(s=Object.entries(n).filter(Dd),e[0]=n,e[1]=s):s=e[1];const r=s;if(r.length===0)return null;let o;return e[2]!==r?(o=a.jsx("div",{className:"flex h-1.5",children:r.map(Od)}),e[2]=r,e[3]=o):o=e[3],o}function Od(t){const[e,n]=t;return a.jsx("span",{className:"flex-1",style:{backgroundColor:n},title:`${Js[e]}: ${n}`,"aria-hidden":!0},e)}function Dd(t){const[,e]=t;return typeof e=="string"&&e.trim().length>0}function li(t){const e=P.c(36),{logo:n,favicon:s,name:r,domain:o,overview:i,colors:l,fonts:u,showDefaultBadge:c,isDefault:m}=t;let d;e[0]!==l?(d=l?Object.entries(l).filter(Bd):[],e[0]=l,e[1]=d):d=e[1];const f=d;let p;e[2]!==u?(p=u?Object.entries(u).filter(Fd):[],e[2]=u,e[3]=p):p=e[3];const h=p;let g;e[4]!==l?(g=l&&a.jsx(ai,{colors:l}),e[4]=l,e[5]=g):g=e[5];let x;e[6]!==s||e[7]!==n||e[8]!==r?(x=a.jsx(Pd,{logo:n,favicon:s,name:r}),e[6]=s,e[7]=n,e[8]=r,e[9]=x):x=e[9];let b;e[10]!==m||e[11]!==r||e[12]!==c?(b=r&&a.jsxs("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-foreground truncate",children:[r,c&&m&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[a.jsx(ho,{className:"size-3 text-amber-500"}),"default"]})]}),e[10]=m,e[11]=r,e[12]=c,e[13]=b):b=e[13];let y;e[14]!==o?(y=o&&a.jsxs("a",{href:Ld(o),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[o,a.jsx(xo,{className:"size-3 shrink-0"})]}),e[14]=o,e[15]=y):y=e[15];let v;e[16]!==b||e[17]!==y?(v=a.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[b,y]}),e[16]=b,e[17]=y,e[18]=v):v=e[18];let k;e[19]!==x||e[20]!==v?(k=a.jsxs("div",{className:"flex items-center gap-4",children:[x,v]}),e[19]=x,e[20]=v,e[21]=k):k=e[21];let j;e[22]!==i?(j=i&&a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:i}),e[22]=i,e[23]=j):j=e[23];let S;e[24]!==f?(S=f.length>0&&a.jsxs("div",{className:"flex flex-col gap-3",children:[a.jsx($r,{children:"Colors"}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3",children:f.map(zd)})]}),e[24]=f,e[25]=S):S=e[25];let w;e[26]!==h?(w=h.length>0&&a.jsxs("div",{className:"flex flex-col gap-3",children:[a.jsx($r,{children:"Typography"}),a.jsx("div",{className:"flex flex-wrap gap-2.5",children:h.map(Hd)})]}),e[26]=h,e[27]=w):w=e[27];let T;e[28]!==S||e[29]!==w||e[30]!==k||e[31]!==j?(T=a.jsxs("div",{className:"p-5 flex flex-col gap-6",children:[k,j,S,w]}),e[28]=S,e[29]=w,e[30]=k,e[31]=j,e[32]=T):T=e[32];let N;return e[33]!==T||e[34]!==g?(N=a.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden border border-border",children:[g,T]}),e[33]=T,e[34]=g,e[35]=N):N=e[35],N}function Hd(t){const[e,n]=t;return a.jsx(Rd,{role:e,family:n},e)}function zd(t){const[e,n]=t;return a.jsx(Md,{name:Js[e],value:n},e)}function Fd(t){const[,e]=t;return typeof e=="string"&&e.trim().length>0}function Bd(t){const[,e]=t;return typeof e=="string"&&e.trim().length>0}function Ud(t){const e=P.c(29),{part:n,latency:s}=t,r=Ce(n.state);let o;e[0]!==n.output?(o=gt(n.output),e[0]=n.output,e[1]=o):o=e[1];const i=o,l=r==="loading",u=r==="error"||i&&i.success===!1;if(l){const w=n.input;let T;e[2]===Symbol.for("react.memo_cache_sentinel")?(T=a.jsx(Me,{className:"animate-pulse"}),e[2]=T):T=e[2];const N=w?.domain?`from ${w.domain}`:void 0;let C;return e[3]!==N?(C=a.jsx(G,{icon:T,title:"Extracting brand",summary:N,state:"loading",defaultOpen:!0}),e[3]=N,e[4]=C):C=e[4],C}if(u){let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Me,{}),e[5]=w):w=e[5];const T=i?.error??"Unknown error";let N;e[6]!==s?(N=a.jsx(ue,{latency:s}),e[6]=s,e[7]=N):N=e[7];let C;return e[8]!==T||e[9]!==N?(C=a.jsx(G,{icon:w,title:"Brand extraction failed",summary:T,state:"error",trailing:N}),e[8]=T,e[9]=N,e[10]=C):C=e[10],C}let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(Me,{className:"text-fuchsia-500"}),e[11]=c):c=e[11];const m=i?.name?`Brand set: ${i.name}`:"Brand context set",d=i?.domain;let f;e[12]!==s?(f=a.jsx(ue,{latency:s}),e[12]=s,e[13]=f):f=e[13];let p;e[14]!==m||e[15]!==d||e[16]!==f?(p=a.jsx(G,{icon:c,title:m,summary:d,state:"idle",trailing:f}),e[14]=m,e[15]=d,e[16]=f,e[17]=p):p=e[17];const h=i?.logo,g=i?.favicon,x=i?.name,b=i?.domain,y=i?.overview,v=i?.colors,k=i?.fonts;let j;e[18]!==b||e[19]!==y||e[20]!==v||e[21]!==k||e[22]!==h||e[23]!==g||e[24]!==x?(j=a.jsx(li,{logo:h,favicon:g,name:x,domain:b,overview:y,colors:v,fonts:k}),e[18]=b,e[19]=y,e[20]=v,e[21]=k,e[22]=h,e[23]=g,e[24]=x,e[25]=j):j=e[25];let S;return e[26]!==j||e[27]!==p?(S=a.jsxs(a.Fragment,{children:[p,j]}),e[26]=j,e[27]=p,e[28]=S):S=e[28],S}function Wd(t){const e=P.c(25),{part:n,latency:s}=t,r=Ce(n.state);let o;e[0]!==n.output?(o=gt(n.output),e[0]=n.output,e[1]=o):o=e[1];const i=o,l=r==="loading",u=r==="error"||i&&i.success===!1;if(l){let g;return e[2]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(G,{icon:a.jsx(Me,{className:"animate-pulse"}),title:"Loading brand",state:"loading"}),e[2]=g):g=e[2],g}if(u||!i){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(Me,{}),e[3]=g):g=e[3];let x;return e[4]!==s?(x=a.jsx(G,{icon:g,title:"Couldn't load brand",state:"error",trailing:a.jsx(ue,{latency:s})}),e[4]=s,e[5]=x):x=e[5],x}let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(Me,{className:"text-fuchsia-500"}),e[6]=c):c=e[6];const m=i.name?`Brand · ${i.name}`:"Brand";let d;e[7]!==s?(d=a.jsx(ue,{latency:s}),e[7]=s,e[8]=d):d=e[8];let f;e[9]!==i.domain||e[10]!==m||e[11]!==d?(f=a.jsx(G,{icon:c,title:m,summary:i.domain,state:"idle",trailing:d}),e[9]=i.domain,e[10]=m,e[11]=d,e[12]=f):f=e[12];let p;e[13]!==i.colors||e[14]!==i.domain||e[15]!==i.favicon||e[16]!==i.fonts||e[17]!==i.isDefault||e[18]!==i.logo||e[19]!==i.name||e[20]!==i.overview?(p=a.jsx(li,{logo:i.logo,favicon:i.favicon,name:i.name,domain:i.domain,overview:i.overview,colors:i.colors,fonts:i.fonts,showDefaultBadge:!0,isDefault:i.isDefault}),e[13]=i.colors,e[14]=i.domain,e[15]=i.favicon,e[16]=i.fonts,e[17]=i.isDefault,e[18]=i.logo,e[19]=i.name,e[20]=i.overview,e[21]=p):p=e[21];let h;return e[22]!==f||e[23]!==p?(h=a.jsxs(a.Fragment,{children:[f,p]}),e[22]=f,e[23]=p,e[24]=h):h=e[24],h}function Kd(t){const e=P.c(28),{part:n,latency:s}=t;let r;e[0]!==n.state?(r=Ce(n.state),e[0]=n.state,e[1]=r):r=e[1];const o=r;let i,l,u,c;if(e[2]!==s||e[3]!==n.output||e[4]!==o){c=Symbol.for("react.early_return_sentinel");e:{const f=gt(n.output),p=Array.isArray(f?.items)?f.items:[],h=o==="loading",g=o==="error";if(h){let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(G,{icon:a.jsx(Me,{className:"animate-pulse"}),title:"Loading brands",state:"loading"}),e[9]=v):v=e[9],c=v;break e}if(g){let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Me,{}),e[10]=v):v=e[10];let k;e[11]!==s?(k=a.jsx(G,{icon:v,title:"Couldn't load brands",state:"error",trailing:a.jsx(ue,{latency:s})}),e[11]=s,e[12]=k):k=e[12],c=k;break e}if(p.length===0){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Me,{}),e[13]=v):v=e[13];let k;e[14]!==s?(k=a.jsx(G,{icon:v,title:"No brands yet",summary:"The organization hasn't set up any brand context.",state:"idle",trailing:a.jsx(ue,{latency:s})}),e[14]=s,e[15]=k):k=e[15],c=k;break e}let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(Me,{className:"text-fuchsia-500"}),e[16]=x):x=e[16];const b=p.length===1?"1 brand":`${p.length} brands`;let y;e[17]!==s?(y=a.jsx(ue,{latency:s}),e[17]=s,e[18]=y):y=e[18],e[19]!==b||e[20]!==y?(u=a.jsx(G,{icon:x,title:b,state:"idle",trailing:y}),e[19]=b,e[20]=y,e[21]=u):u=e[21],i="mt-2 flex flex-col gap-1.5",l=p.map(Vd)}e[2]=s,e[3]=n.output,e[4]=o,e[5]=i,e[6]=l,e[7]=u,e[8]=c}else i=e[5],l=e[6],u=e[7],c=e[8];if(c!==Symbol.for("react.early_return_sentinel"))return c;let m;e[22]!==i||e[23]!==l?(m=a.jsx("div",{className:i,children:l}),e[22]=i,e[23]=l,e[24]=m):m=e[24];let d;return e[25]!==u||e[26]!==m?(d=a.jsxs(a.Fragment,{children:[u,m]}),e[25]=u,e[26]=m,e[27]=d):d=e[27],d}function Vd(t){const e=t.colors?Object.entries(t.colors).filter(Xd):[];return a.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[t.colors&&a.jsx(ai,{colors:t.colors}),a.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[(t.logo||t.favicon)&&a.jsx("img",{src:t.logo??t.favicon??void 0,alt:"",className:"size-8 shrink-0 rounded-md border border-border bg-background object-contain p-0.5",onError:qd}),a.jsxs("div",{className:"flex flex-col leading-tight min-w-0 flex-1",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground truncate",children:[t.name??"Untitled",t.isDefault&&a.jsx(ho,{className:"size-3 text-amber-500 shrink-0"})]}),t.domain&&a.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:t.domain})]}),e.length>0&&a.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:e.slice(0,5).map(Gd)})]})]},t.id??`${t.name}-${t.domain}`)}function Gd(t){const[e,n]=t;return a.jsx("span",{className:"size-3 rounded-full border border-border",style:{backgroundColor:n},title:`${Js[e]}: ${n}`,"aria-hidden":!0},e)}function qd(t){t.target.style.display="none"}function Xd(t){const[,e]=t;return typeof e=="string"&&e.trim().length>0}function gs(t){const e=P.c(4),{connection_id:n,iconSize:s}=t,r=s===void 0?"xs":s,o=Vr(n);if(!o)return null;let i;return e[0]!==o.icon||e[1]!==o.title||e[2]!==r?(i=a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx(qe,{icon:o.icon,name:o.title,size:r})}),e[0]=o.icon,e[1]=o.title,e[2]=r,e[3]=i):i=e[3],i}gs.Fallback=function({iconSize:e="xs"}){const n=e==="sm"?"size-6":"size-5";return a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx("div",{className:q(n,"rounded bg-muted animate-pulse")})})};function It(t){const e=P.c(18),{connectionIds:n,maxVisibleIcons:s,iconSize:r,className:o}=t,i=s===void 0?2:s,l=r===void 0?"xs":r;if(n.length===0)return null;let u,c,m;if(e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==i){const p=n.slice(0,i);u=n.length-i,e[7]!==o?(c=q("flex items-center justify-end -space-x-2",o),e[7]=o,e[8]=c):c=e[8];let h;e[9]!==l?(h=g=>a.jsx(_.Suspense,{fallback:a.jsx(gs.Fallback,{iconSize:l}),children:a.jsx(gs,{connection_id:g,iconSize:l})},g),e[9]=l,e[10]=h):h=e[10],m=p.map(h),e[0]=o,e[1]=n,e[2]=l,e[3]=i,e[4]=u,e[5]=c,e[6]=m}else u=e[4],c=e[5],m=e[6];let d;e[11]!==l||e[12]!==u?(d=u>0&&a.jsx("div",{className:q("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",l==="sm"?"size-8":"size-6"),children:a.jsxs("span",{className:q(l==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${u} more`,children:["+",u]})}),e[11]=l,e[12]=u,e[13]=d):d=e[13];let f;return e[14]!==c||e[15]!==m||e[16]!==d?(f=a.jsxs("div",{className:c,children:[m,d]}),e[14]=c,e[15]=m,e[16]=d,e[17]=f):f=e[17],f}It.Fallback=function({maxVisibleIcons:e=2,totalCount:n,iconSize:s="xs"}){const r=s==="sm"?"size-6":"size-5",o=s==="sm"?"size-8":"size-6",i=n!==void 0&&n>e;return a.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((l,u)=>a.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:a.jsx("div",{className:q(r,"rounded bg-muted animate-pulse")})},u)),i&&a.jsx("div",{className:q("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",o),children:a.jsx("div",{className:q(s==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const Yd="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",Or=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function Qd(t){const e=P.c(64),{part:n,latency:s}=t,r=bo(),o=Ce(n.state),i=_.useRef(null),l=_.useRef(null),u=_.useRef(null),c=_.useRef(null),m=_.useRef(null);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{Or?.matches||(m.current=i.current?.getBoundingClientRect()??null,i.current&&(i.current.style.willChange="transform"))},e[0]=d):d=e[0];const f=d;let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=z=>{if(Or?.matches)return;const X=m.current,se=i.current;if(!X||!se)return;const ie=(z.clientX-X.left)/X.width*100,me=(z.clientY-X.top)/X.height*100;se.style.transform=`perspective(800px) rotateY(${(ie-50)*.05}deg) rotateX(${(me-50)*-.05}deg)`,l.current&&(l.current.style.opacity="1",l.current.style.transform=`translate(${(ie-50)*.15}px, ${(me-50)*.15}px)`),u.current&&(u.current.style.opacity="0.45"),c.current&&(c.current.style.opacity="0.45")},e[1]=p):p=e[1];const h=p;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{const z=i.current;z&&(z.style.transform="none",z.style.willChange="auto"),l.current&&(l.current.style.opacity="0.4",l.current.style.transform="translate(0, 0)"),u.current&&(u.current.style.opacity="0.3"),c.current&&(c.current.style.opacity="0.3"),m.current=null},e[2]=g):g=e[2];const x=g;if(o==="loading"){let z;return e[3]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(G,{icon:a.jsx(Le,{className:"animate-pulse"}),title:"Creating agent",state:"loading",defaultOpen:!0}),e[3]=z):z=e[3],z}if(o==="approval"){let z;return e[4]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(G,{icon:a.jsx(Le,{}),title:"Create agent",state:"idle"}),e[4]=z):z=e[4],z}if(o==="error"){let z;e[5]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(Le,{}),e[5]=z):z=e[5];const X=n.state==="output-denied"?"Agent creation cancelled":"Couldn't create agent";let se;e[6]!==s?(se=a.jsx(ue,{latency:s}),e[6]=s,e[7]=se):se=e[7];let ie;return e[8]!==X||e[9]!==se?(ie=a.jsx(G,{icon:z,title:X,state:"error",trailing:se}),e[8]=X,e[9]=se,e[10]=ie):ie=e[10],ie}let b,y,v;if(e[11]!==s||e[12]!==n.output){v=Symbol.for("react.early_return_sentinel");e:{if(b=gt(n.output)?.item,!b?.id||!b?.title){let z;e[16]===Symbol.for("react.memo_cache_sentinel")?(z=a.jsx(Le,{}),e[16]=z):z=e[16];let X;e[17]!==s?(X=a.jsx(G,{icon:z,title:"Agent created",state:"idle",trailing:a.jsx(ue,{latency:s})}),e[17]=s,e[18]=X):X=e[18],v=X;break e}y=(b.connections??[]).map(Jd)}e[11]=s,e[12]=n.output,e[13]=b,e[14]=y,e[15]=v}else b=e[13],y=e[14],v=e[15];if(v!==Symbol.for("react.early_return_sentinel"))return v;const k=y;let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx(Le,{className:"text-success"}),e[19]=j):j=e[19];const S=`Agent created: ${b.title}`;let w;e[20]!==s?(w=a.jsx(ue,{latency:s}),e[20]=s,e[21]=w):w=e[21];let T;e[22]!==S||e[23]!==w?(T=a.jsx(G,{icon:j,title:S,state:"idle",trailing:w}),e[22]=S,e[23]=w,e[24]=T):T=e[24];let N;e[25]===Symbol.for("react.memo_cache_sentinel")?(N={transition:"transform 0.3s ease-out"},e[25]=N):N=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx("div",{ref:l,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[26]=C):C=e[26];let I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I={textAlign:"justify",wordBreak:"break-all"},e[27]=I):I=e[27];let M,A;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=a.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:I,"aria-hidden":"true",children:Yd.repeat(6)}),A=a.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[28]=M,e[29]=A):(M=e[28],A=e[29]);let $;e[30]===Symbol.for("react.memo_cache_sentinel")?($=a.jsx("img",{ref:u,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[30]=$):$=e[30];let E;e[31]===Symbol.for("react.memo_cache_sentinel")?(E=a.jsx("img",{ref:c,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[31]=E):E=e[31];let O;e[32]!==b.icon||e[33]!==b.title?(O=a.jsx(so,{icon:b.icon,name:b.title,size:"md"}),e[32]=b.icon,e[33]=b.title,e[34]=O):O=e[34];let R;e[35]!==b.title?(R=a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:b.title})}),e[35]=b.title,e[36]=R):R=e[36];let D;e[37]!==O||e[38]!==R?(D=a.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[O,R]}),e[37]=O,e[38]=R,e[39]=D):D=e[39];let H;e[40]!==b.description?(H=b.description&&a.jsx("div",{className:"px-2 pt-1 pr-16",children:a.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:b.description})}),e[40]=b.description,e[41]=H):H=e[41];let F;e[42]!==D||e[43]!==H?(F=a.jsxs("div",{className:"relative",children:[D,H]}),e[42]=D,e[43]=H,e[44]=F):F=e[44];let K;e[45]!==k?(K=k.length>0&&a.jsx(_.Suspense,{fallback:a.jsx(It.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:k.length}),children:a.jsx(It,{connectionIds:k,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})}),e[45]=k,e[46]=K):K=e[46];let B;e[47]!==K?(B=a.jsx("div",{className:"flex-1 min-w-0",children:K}),e[47]=K,e[48]=B):B=e[48];let V;e[49]!==b.id||e[50]!==r?(V=()=>r(b.id),e[49]=b.id,e[50]=r,e[51]=V):V=e[51];const Y=`See agent: ${b.title}`;let Q;e[52]!==V||e[53]!==Y?(Q=a.jsx("div",{className:"flex items-center gap-2 shrink-0",children:a.jsx(tt,{size:"sm",className:"h-7",onClick:V,"aria-label":Y,children:"See agent"})}),e[52]=V,e[53]=Y,e[54]=Q):Q=e[54];let J;e[55]!==B||e[56]!==Q?(J=a.jsxs("div",{className:"relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1",children:[B,Q]}),e[55]=B,e[56]=Q,e[57]=J):J=e[57];let ee;e[58]!==F||e[59]!==J?(ee=a.jsx("div",{className:"mt-2 overflow-hidden rounded-xl border-[0.5px] border-border bg-card p-2.5",children:a.jsxs("div",{ref:i,className:"relative overflow-hidden rounded-lg bg-accent/25 p-2",style:N,onMouseEnter:f,onMouseMove:h,onMouseLeave:x,children:[C,M,A,$,E,F,J]})}),e[58]=F,e[59]=J,e[60]=ee):ee=e[60];let ce;return e[61]!==ee||e[62]!==T?(ce=a.jsxs(a.Fragment,{children:[T,ee]}),e[61]=ee,e[62]=T,e[63]=ce):ce=e[63],ce}function Jd(t){return t.connection_id}function Zd(t){const e=P.c(24),{agent:n}=t,s=bo();if(!n.id)return null;let r;e[0]!==n.connections?(r=n.connections??[],e[0]=n.connections,e[1]=r):r=e[1];let o;e[2]!==r?(o=r.map(ef),e[2]=r,e[3]=o):o=e[3];const i=o;let l;e[4]!==n.id||e[5]!==s?(l=()=>s(n.id),e[4]=n.id,e[5]=s,e[6]=l):l=e[6];let u;e[7]!==n.icon||e[8]!==n.title?(u=a.jsx(so,{icon:n.icon,name:n.title,size:"sm"}),e[7]=n.icon,e[8]=n.title,e[9]=u):u=e[9];let c;e[10]!==n.title?(c=a.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:n.title}),e[10]=n.title,e[11]=c):c=e[11];let m;e[12]!==n.description?(m=n.description&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:n.description}),e[12]=n.description,e[13]=m):m=e[13];let d;e[14]!==c||e[15]!==m?(d=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[c,m]}),e[14]=c,e[15]=m,e[16]=d):d=e[16];let f;e[17]!==i?(f=i.length>0&&a.jsx(_.Suspense,{fallback:a.jsx(It.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:i.length}),children:a.jsx(It,{connectionIds:i,iconSize:"xs",maxVisibleIcons:3})}),e[17]=i,e[18]=f):f=e[18];let p;return e[19]!==l||e[20]!==u||e[21]!==d||e[22]!==f?(p=a.jsxs("button",{type:"button",onClick:l,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[u,d,f]}),e[19]=l,e[20]=u,e[21]=d,e[22]=f,e[23]=p):p=e[23],p}function ef(t){return t.connection_id}function tf(t){const e=P.c(41),{part:n,latency:s}=t,r=mt(),{org:o}=He();let i;e[0]!==n.state?(i=Ce(n.state),e[0]=n.state,e[1]=i):i=e[1];const l=i;let u,c,m,d,f,p;if(e[2]!==s||e[3]!==n.output||e[4]!==n.state||e[5]!==l){p=Symbol.for("react.early_return_sentinel");e:{const b=gt(n.output);if(c=Array.isArray(b?.items)?b.items:[],l==="loading"){let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(G,{icon:a.jsx(Le,{className:"animate-pulse"}),title:"Loading agents",state:"loading"}),e[12]=S):S=e[12],p=S;break e}if(l==="approval"){let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(G,{icon:a.jsx(Le,{}),title:"List agents",state:"idle"}),e[13]=S):S=e[13],p=S;break e}if(l==="error"){let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Le,{}),e[14]=S):S=e[14];const w=n.state==="output-denied"?"Agent list unavailable":"Couldn't load agents";let T;e[15]!==s?(T=a.jsx(ue,{latency:s}),e[15]=s,e[16]=T):T=e[16];let N;e[17]!==w||e[18]!==T?(N=a.jsx(G,{icon:S,title:w,state:"error",trailing:T}),e[17]=w,e[18]=T,e[19]=N):N=e[19],p=N;break e}if(c.length===0){let S;e[20]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Le,{}),e[20]=S):S=e[20];let w;e[21]!==s?(w=a.jsx(G,{icon:S,title:"No agents yet",summary:"This organization hasn't created any agents.",state:"idle",trailing:a.jsx(ue,{latency:s})}),e[21]=s,e[22]=w):w=e[22],p=w;break e}const y=c.slice(0,Yo);u=c.length-y.length;let v;e[23]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Le,{className:"text-success"}),e[23]=v):v=e[23];const k=c.length===1?"1 agent":`${c.length} agents`;let j;e[24]!==s?(j=a.jsx(ue,{latency:s}),e[24]=s,e[25]=j):j=e[25],e[26]!==k||e[27]!==j?(f=a.jsx(G,{icon:v,title:k,state:"idle",trailing:j}),e[26]=k,e[27]=j,e[28]=f):f=e[28],m="mt-2 flex flex-col gap-1.5",d=y.map(nf)}e[2]=s,e[3]=n.output,e[4]=n.state,e[5]=l,e[6]=u,e[7]=c,e[8]=m,e[9]=d,e[10]=f,e[11]=p}else u=e[6],c=e[7],m=e[8],d=e[9],f=e[10],p=e[11];if(p!==Symbol.for("react.early_return_sentinel"))return p;let h;e[29]!==u||e[30]!==c||e[31]!==r||e[32]!==o?(h=u>0&&a.jsx(Qo,{count:c.length,noun:"agents",onClick:()=>r({to:"/$org/settings/agents",params:{org:o.slug}})}),e[29]=u,e[30]=c,e[31]=r,e[32]=o,e[33]=h):h=e[33];let g;e[34]!==m||e[35]!==d||e[36]!==h?(g=a.jsxs("div",{className:m,children:[d,h]}),e[34]=m,e[35]=d,e[36]=h,e[37]=g):g=e[37];let x;return e[38]!==f||e[39]!==g?(x=a.jsxs(a.Fragment,{children:[f,g]}),e[38]=f,e[39]=g,e[40]=x):x=e[40],x}function nf(t){return a.jsx(Zd,{agent:t},t.id)}const sf={active:"bg-success",inactive:"bg-muted-foreground",error:"bg-destructive"};function rf(t){const e=P.c(27),{connection:n}=t,s=mt(),{org:r}=He(),o=n.slug,i=n.description||n.app_name,l=!o||void 0;let u;e[0]!==s||e[1]!==r||e[2]!==o?(u=()=>o&&s({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:o}}),e[0]=s,e[1]=r,e[2]=o,e[3]=u):u=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=a.jsx(qe,{icon:n.icon,name:n.title,size:"sm"}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let m;e[7]!==n.title?(m=a.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:n.title}),e[7]=n.title,e[8]=m):m=e[8];let d;e[9]!==i?(d=i&&a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:i}),e[9]=i,e[10]=d):d=e[10];let f;e[11]!==m||e[12]!==d?(f=a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[m,d]}),e[11]=m,e[12]=d,e[13]=f):f=e[13];const p=sf[n.status]??"bg-muted-foreground";let h;e[14]!==p?(h=q("size-2 shrink-0 rounded-full",p),e[14]=p,e[15]=h):h=e[15];let g;e[16]!==h?(g=a.jsx("span",{className:h,"aria-hidden":"true"}),e[16]=h,e[17]=g):g=e[17];let x;e[18]!==n.status?(x=a.jsx("span",{className:"sr-only",children:n.status}),e[18]=n.status,e[19]=x):x=e[19];let b;return e[20]!==l||e[21]!==x||e[22]!==u||e[23]!==c||e[24]!==f||e[25]!==g?(b=a.jsxs("button",{type:"button","aria-disabled":l,onClick:u,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[c,f,g,x]}),e[20]=l,e[21]=x,e[22]=u,e[23]=c,e[24]=f,e[25]=g,e[26]=b):b=e[26],b}function of(t){const e=P.c(40),{part:n,latency:s}=t,r=mt(),{org:o}=He();let i;e[0]!==n.state?(i=Ce(n.state),e[0]=n.state,e[1]=i):i=e[1];const l=i;let u,c,m,d,f,p;if(e[2]!==s||e[3]!==n.output||e[4]!==n.state||e[5]!==l){p=Symbol.for("react.early_return_sentinel");e:{const b=gt(n.output);if(c=(Array.isArray(b?.items)?b.items:[]).filter(lf),l==="loading"||l==="approval"){let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(G,{icon:a.jsx(Rt,{className:"animate-pulse"}),title:"Loading connections",state:"loading"}),e[12]=S):S=e[12],p=S;break e}if(l==="error"){let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Rt,{}),e[13]=S):S=e[13];const w=n.state==="output-denied"?"Connection list unavailable":"Couldn't load connections";let T;e[14]!==s?(T=a.jsx(ue,{latency:s}),e[14]=s,e[15]=T):T=e[15];let N;e[16]!==w||e[17]!==T?(N=a.jsx(G,{icon:S,title:w,state:"error",trailing:T}),e[16]=w,e[17]=T,e[18]=N):N=e[18],p=N;break e}if(c.length===0){let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(Rt,{}),e[19]=S):S=e[19];let w;e[20]!==s?(w=a.jsx(G,{icon:S,title:"No connections yet",summary:"This organization hasn't connected any MCPs.",state:"idle",trailing:a.jsx(ue,{latency:s})}),e[20]=s,e[21]=w):w=e[21],p=w;break e}const y=c.slice(0,Yo);u=c.length-y.length;let v;e[22]===Symbol.for("react.memo_cache_sentinel")?(v=a.jsx(Rt,{className:"text-success"}),e[22]=v):v=e[22];const k=c.length===1?"1 connection":`${c.length} connections`;let j;e[23]!==s?(j=a.jsx(ue,{latency:s}),e[23]=s,e[24]=j):j=e[24],e[25]!==k||e[26]!==j?(f=a.jsx(G,{icon:v,title:k,state:"idle",trailing:j}),e[25]=k,e[26]=j,e[27]=f):f=e[27],m="mt-2 flex flex-col gap-1.5",d=y.map(af)}e[2]=s,e[3]=n.output,e[4]=n.state,e[5]=l,e[6]=u,e[7]=c,e[8]=m,e[9]=d,e[10]=f,e[11]=p}else u=e[6],c=e[7],m=e[8],d=e[9],f=e[10],p=e[11];if(p!==Symbol.for("react.early_return_sentinel"))return p;let h;e[28]!==u||e[29]!==c||e[30]!==r||e[31]!==o?(h=u>0&&a.jsx(Qo,{count:c.length,noun:"connections",onClick:()=>r({to:"/$org/settings/connections",params:{org:o.slug}})}),e[28]=u,e[29]=c,e[30]=r,e[31]=o,e[32]=h):h=e[32];let g;e[33]!==m||e[34]!==d||e[35]!==h?(g=a.jsxs("div",{className:m,children:[d,h]}),e[33]=m,e[34]=d,e[35]=h,e[36]=g):g=e[36];let x;return e[37]!==f||e[38]!==g?(x=a.jsxs(a.Fragment,{children:[f,g]}),e[37]=f,e[38]=g,e[39]=x):x=e[39],x}function af(t){return a.jsx(rf,{connection:t},t.id)}function lf(t){return t.connection_type!=="VIRTUAL"}function cf(){const t=P.c(37),e=Is(),{sendMessage:n,isStreaming:s,messages:r}=ga(),{org:o}=He(),i=e?.virtualMcpId,{prompts:l}=tl(o.slug),u=i??null;let c;t[0]!==o.id||t[1]!==o.slug||t[2]!==u?(c={connectionId:u,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=u,t[3]=c):c=t[3];const m=Ss(c),[d,f]=_.useState(null);if(!i||s||!Hi(i)||!r.some(uf))return null;let h;if(t[4]!==l||t[5]!==i){let A;t[7]!==i?(A=$=>$.agentId===i&&$.promptName,t[7]=i,t[8]=A):A=t[8],h=l.find(A),t[4]=l,t[5]=i,t[6]=h}else h=t[6];const g=h;if(!g)return null;let x;t[9]!==m||t[10]!==n?(x=async(A,$)=>{if(!m){Yn.error("MCP client not available");return}try{const E=await rl(m,A.name,$);await n({type:"doc",content:[{type:"paragraph",content:[Ba({id:A.name,name:Rs(A.name,Ms(A._meta)),metadata:E.messages,char:"/",kind:"prompt",args:$}),{type:"text",text:" "}]}]})}catch(E){console.error("[next-action-chip] failed",E),Yn.error("Failed to load prompt. Please try again.")}},t[9]=m,t[10]=n,t[11]=x):x=t[11];const b=x;let y;t[12]!==g._meta||t[13]!==g.arguments||t[14]!==g.description||t[15]!==g.promptName||t[16]!==g.title||t[17]!==b?(y=()=>{const A={name:g.promptName,title:g.title,description:g.description,arguments:g.arguments,_meta:g._meta};if(A.arguments&&A.arguments.length>0){f(A);return}b(A)},t[12]=g._meta,t[13]=g.arguments,t[14]=g.description,t[15]=g.promptName,t[16]=g.title,t[17]=b,t[18]=y):y=t[18];const v=y;let k,j;t[19]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(sl,{size:12,className:"shrink-0 text-purple-500"}),j=a.jsx("span",{className:"font-medium text-foreground/80",children:"Next:"}),t[19]=k,t[20]=j):(k=t[19],j=t[20]);let S;t[21]!==g.title?(S=a.jsx("span",{className:"truncate",children:g.title}),t[21]=g.title,t[22]=S):S=t[22];let w;t[23]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(ro,{size:12,className:"shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),t[23]=w):w=t[23];let T;t[24]!==v||t[25]!==S?(T=a.jsxs("button",{type:"button",onClick:v,className:"group mt-3 flex items-center gap-2 self-start rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:border-border hover:bg-accent/40 hover:text-foreground",children:[k,j,S,w]}),t[24]=v,t[25]=S,t[26]=T):T=t[26];let N;t[27]===Symbol.for("react.memo_cache_sentinel")?(N=A=>f(A),t[27]=N):N=t[27];let C;t[28]!==d||t[29]!==b?(C=async A=>{const $=d;f(null),$&&await b($,A)},t[28]=d,t[29]=b,t[30]=C):C=t[30];let I;t[31]!==d||t[32]!==C?(I=a.jsx(Cl,{prompt:d,setPrompt:N,onSubmit:C}),t[31]=d,t[32]=C,t[33]=I):I=t[33];let M;return t[34]!==I||t[35]!==T?(M=a.jsxs(a.Fragment,{children:[T,I]}),t[34]=I,t[35]=T,t[36]=M):M=t[36],M}function uf(t){return t.role==="user"||t.parts.some(df)}function df(t){return t.type==="tool-user_ask"&&t.state==="output-available"}function ff(t){const e=new Map;for(let n=t.length-1;n>=0;n--){const s=t[n]?.parts;if(s)for(const r of s){const o=r;if(o.type!=="data-deck-updated")continue;const i=o.data;if(!i?.path)continue;const l=`deck:${i.path}`;e.has(l)||e.set(l,{tabId:va(i.path),label:i.name||i.path,kind:i.kind==="page"?"page":"deck"})}}return Array.from(e.values())}function mf(){const t=P.c(9),e=mt(),n=pt()?.messages??[],s=ff(n);if(s.length===0)return null;const r=s.some(hf),o=s.some(pf),i=r?o?"Slides & pages in this chat":"Slides in this chat":"Pages in this chat",l="flex flex-col gap-1.5 py-2";let u;t[0]!==i?(u=a.jsx("div",{className:"text-[12px] text-muted-foreground/70 uppercase tracking-wide",children:i}),t[0]=i,t[1]=u):u=t[1];const c="flex flex-wrap gap-2";let m;t[2]!==e?(m=h=>a.jsxs("button",{type:"button",onClick:()=>e({to:".",search:g=>({...g,main:h.tabId}),replace:!0}),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-muted/30 hover:bg-muted/60 text-[13px] transition-colors",children:[h.kind==="deck"?a.jsx(yt,{className:"size-3.5 shrink-0 text-muted-foreground"}):a.jsx(qa,{className:"size-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"font-medium text-foreground",children:h.label})]},h.tabId),t[2]=e,t[3]=m):m=t[3];const d=s.map(m);let f;t[4]!==d?(f=a.jsx("div",{className:c,children:d}),t[4]=d,t[5]=f):f=t[5];let p;return t[6]!==u||t[7]!==f?(p=a.jsxs("div",{className:l,children:[u,f]}),t[6]=u,t[7]=f,t[8]=p):p=t[8],p}function pf(t){return t.kind==="page"}function hf(t){return t.kind==="deck"}async function gf(t,e){const n=await fetch(`/api/${e}/threads/${encodeURIComponent(t)}/outputs`,{credentials:"include"});if(!n.ok)throw new Error(`Failed to fetch thread outputs: ${n.status}`);return(await n.json()).objects??[]}function Fp(){const t=P.c(2),e=pt()?.messages??[];let n;return t[0]!==e?(n=e.some(xf),t[0]=e,t[1]=n):n=t[1],n}function xf(t){return t.parts?.some(bf)}function bf(t){const e=t;return(e.type==="tool-share_with_user"||e.type==="tool-bash"||e.type==="tool-write")&&e.state==="output-available"}function yf(t,e){const n=P.c(9),{org:s}=He();let r;n[0]!==t?(r=ke.threadOutputs(t??""),n[0]=t,n[1]=r):r=n[1];let o;n[2]!==s||n[3]!==t?(o=()=>gf(t??"",s.slug),n[2]=s,n[3]=t,n[4]=o):o=n[4];const i=!!t&&(e?.enabled??!0);let l;return n[5]!==r||n[6]!==o||n[7]!==i?(l={queryKey:r,queryFn:o,enabled:i,staleTime:0},n[5]=r,n[6]=o,n[7]=i,n[8]=l):l=n[8],Lt(l)}function vf(t){const e=P.c(20),{file:n}=t,s=mt();let r;e[0]!==n.key||e[1]!==s?(r=()=>s({to:".",search:p=>({...p,main:ka(n.key)}),replace:!0}),e[0]=n.key,e[1]=s,e[2]=r):r=e[2];const o=r;let i;e[3]!==n.filename?(i=a.jsx(la,{filename:n.filename,className:"h-5 w-4 shrink-0"}),e[3]=n.filename,e[4]=i):i=e[4];let l;e[5]!==n.filename||e[6]!==o?(l=a.jsx("button",{type:"button",onClick:o,className:"min-w-0 flex-1 truncate text-left text-[13px] font-medium text-foreground hover:underline",title:n.filename,children:n.filename}),e[5]=n.filename,e[6]=o,e[7]=l):l=e[7];const u=`Download ${n.filename}`;let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=a.jsx(go,{className:"size-3.5"}),e[8]=c):c=e[8];let m;e[9]!==n.downloadUrl||e[10]!==n.filename||e[11]!==u?(m=a.jsx("a",{href:n.downloadUrl,download:n.filename,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block",title:"Download","aria-label":u,children:c}),e[9]=n.downloadUrl,e[10]=n.filename,e[11]=u,e[12]=m):m=e[12];let d;e[13]!==o?(d=a.jsx(tt,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:o,children:"Open"}),e[13]=o,e[14]=d):d=e[14];let f;return e[15]!==i||e[16]!==l||e[17]!==m||e[18]!==d?(f=a.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[i,l,m,d]}),e[15]=i,e[16]=l,e[17]=m,e[18]=d,e[19]=f):f=e[19],f}function Dr(t){return t.split("/").pop()??t}const kf=/(^|\/)output\//;function Sf(t){const e=new Set;for(const n of t.parts??[]){const s=n;if(s.state==="output-available"){if(s.type==="tool-share_with_user"){const r=s.output?.filename??s.input?.name??(s.input?.source?Dr(s.input.source):null);r&&e.add(r)}else if(s.type==="tool-write"){const r=s.input?.path;r&&kf.test(r)&&e.add(Dr(r))}}}return e}function jf(t){const e=P.c(4),{threadId:n,message:s}=t,r=Sf(s),o=r.size>0;let i;e[0]!==o?(i={enabled:o},e[0]=o,e[1]=i):i=e[1];const{data:l}=yf(n,i);if(r.size===0)return null;const u=(l??[]).filter(f=>r.has(f.filename));if(u.length===0)return null;const c="flex flex-col gap-1.5 py-2",m=u.map(wf);let d;return e[2]!==m?(d=a.jsx("div",{className:c,children:m}),e[2]=m,e[3]=d):d=e[3],d}function wf(t){return a.jsx(vf,{file:t},t.key)}function Tf(t){return t.type==="reasoning"}function Nf(t){const e=[],n=new Set,s=new Map,r=new Map,o=new Map;if(t){let l=null;for(let u=0;u<t.parts.length;u++){const c=t.parts[u];if(Tf(c)){l||(l={parts:[],startIndex:u},e.push(l)),l.parts.push(c),n.add(u);continue}if(l=null,c.type==="data-tool-metadata"&&"id"in c&&"data"in c){const m=c.data,d={};m.annotations&&(d.annotations=m.annotations),typeof m.latencyMs=="number"&&Number.isFinite(m.latencyMs)&&(d.latencySeconds=m.latencyMs/1e3),typeof m.outputBytes=="number"&&Number.isFinite(m.outputBytes)&&m.outputBytes>=0&&(d.outputBytes=m.outputBytes),m._meta&&typeof m._meta=="object"&&(d._meta=m._meta),s.set(c.id,d);continue}if(c.type==="data-tool-subtask-metadata"&&"id"in c){r.set(c.id,c.data);continue}if(c.type==="data-web-search"&&"id"in c&&"data"in c){const m=c.id,d=c.data;o.set(m,d.text??"");continue}}}const i=[];if(t)for(let l=0;l<t.parts.length;l++){const u=t.parts[l];if(u.type!=="step-start"){if(n.has(l)){const c=e.find(m=>m.startIndex===l);c&&i.push({kind:"reasoning-group",group:c});continue}u.type.startsWith("data-")||i.push({kind:"part",index:l})}}return{reasoningGroups:e,renderOrder:i,dataParts:{toolMetadata:s,toolSubtaskMetadata:r,webSearchStreaming:o}}}const Cf=3;function _f(t,e){let n=-1;for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.kind==="part"&&e[r.index]?.type==="text"){n=s;break}}return n===-1?{collapsed:[],tail:t}:{collapsed:t.slice(0,n),tail:t.slice(n)}}function Af(t,e){let n=0,s=0;for(const r of t)if(r.kind==="reasoning-group")s++;else{const o=e[r.index]?.type;o==="text"?s++:(o==="dynamic-tool"||o?.startsWith("tool-"))&&o!=="tool-todo_write"&&o!=="tool-update_interests"&&n++}return{toolCalls:n,messages:s}}function If(t){const e=P.c(8),{toolCalls:n,messages:s}=t;let r;e[0]!==s||e[1]!==n?(r=n>0&&a.jsxs(a.Fragment,{children:[a.jsx(to,{className:"size-3.5 shrink-0"}),a.jsxs("span",{children:[n," tool call",n===1?"":"s",s>0?",":""]})]}),e[0]=s,e[1]=n,e[2]=r):r=e[2];let o;e[3]!==s?(o=s>0&&a.jsxs(a.Fragment,{children:[a.jsx(ia,{className:"size-3.5 shrink-0"}),a.jsxs("span",{children:[s," message",s===1?"":"s"]})]}),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=a.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[r,o]}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function Ef(t){const e=P.c(28),{items:n,message:s,reasoningGroups:r,isReasoningActive:o,totalDuration:i,dataParts:l,isLoading:u,isLast:c}=t;let m;e[0]!==n||e[1]!==s.parts?(m=Af(n,s.parts),e[0]=n,e[1]=s.parts,e[2]=m):m=e[2];const{toolCalls:d,messages:f}=m;if(d===0&&f===0)return null;let p;e[3]!==f||e[4]!==d?(p=a.jsx(If,{toolCalls:d,messages:f}),e[3]=f,e[4]=d,e[5]=p):p=e[5];let h;if(e[6]!==l||e[7]!==c||e[8]!==u||e[9]!==o||e[10]!==n||e[11]!==s||e[12]!==r||e[13]!==i){let b;e[15]!==l||e[16]!==c||e[17]!==u||e[18]!==o||e[19]!==s||e[20]!==r||e[21]!==i?(b=(y,v)=>ci({item:y,renderIndex:v,message:s,reasoningGroups:r,isReasoningActive:o,totalDuration:i,dataParts:l,isLoading:u,isLast:c,isLastVisiblePart:!1}),e[15]=l,e[16]=c,e[17]=u,e[18]=o,e[19]=s,e[20]=r,e[21]=i,e[22]=b):b=e[22],h=n.map(b),e[6]=l,e[7]=c,e[8]=u,e[9]=o,e[10]=n,e[11]=s,e[12]=r,e[13]=i,e[14]=h}else h=e[14];let g;e[23]!==h?(g=a.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:h}),e[23]=h,e[24]=g):g=e[24];let x;return e[25]!==p||e[26]!==g?(x=a.jsx(G,{icon:null,alwaysChevron:!0,title:p,state:"idle",children:g}),e[25]=p,e[26]=g,e[27]=x):x=e[27],x}function ci({item:t,renderIndex:e,message:n,reasoningGroups:s,isReasoningActive:r,totalDuration:o,dataParts:i,isLoading:l,isLast:u,isLastVisiblePart:c,renderOrder:m}){if(t.kind==="reasoning-group"){const{group:h}=t,g=h===s[s.length-1],x=r&&g;if(!h.parts.some(v=>v.text?.trim())&&!x)return null;const y=s.length===1?o:null;return a.jsx(Eu,{duration:y,parts:h.parts,isStreaming:x},`${n.id}-reasoning-${h.startIndex}`)}const d=n.parts[t.index],f=c||(m?m.findLastIndex(h=>h.kind==="part")===e:!1),p=f?ko(vo(),n.metadata?.usage):null;return a.jsx(Lf,{part:d,id:n.id,usageStats:f&&a.jsx(hu,{usage:p,duration:o}),dataParts:i,isLoading:l,isLastMessage:u},`${n.id}-${t.index}`)}function Lf(t){const e=P.c(121),{part:n,id:s,usageStats:r,dataParts:o,isLoading:i,isLastMessage:l}=t;let u;e[0]!==o.toolMetadata?(u=f=>o.toolMetadata.get(f),e[0]=o.toolMetadata,e[1]=u):u=e[1];const c=u;let m;e[2]!==o.toolSubtaskMetadata?(m=f=>o.toolSubtaskMetadata.get(f),e[2]=o.toolSubtaskMetadata,e[3]=m):m=e[3];const d=m;switch(n.type){case"dynamic-tool":{let f;e[4]!==c||e[5]!==n.toolCallId?(f=c(n.toolCallId)?.annotations,e[4]=c,e[5]=n.toolCallId,e[6]=f):f=e[6];let p;e[7]!==c||e[8]!==n.toolCallId?(p=c(n.toolCallId)?.latencySeconds,e[7]=c,e[8]=n.toolCallId,e[9]=p):p=e[9];let h;e[10]!==c||e[11]!==n.toolCallId?(h=c(n.toolCallId)?.outputBytes,e[10]=c,e[11]=n.toolCallId,e[12]=h):h=e[12];let g;e[13]!==c||e[14]!==n.toolCallId?(g=c(n.toolCallId)?._meta,e[13]=c,e[14]=n.toolCallId,e[15]=g):g=e[15];let x;return e[16]!==l||e[17]!==n||e[18]!==f||e[19]!==p||e[20]!==h||e[21]!==g?(x=a.jsx(Mr,{part:n,annotations:f,latency:p,outputBytes:h,isLastMessage:l,toolMeta:g}),e[16]=l,e[17]=n,e[18]=f,e[19]=p,e[20]=h,e[21]=g,e[22]=x):x=e[22],x}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let f;e[23]!==c||e[24]!==n.toolCallId?(f=c(n.toolCallId)?.latencySeconds,e[23]=c,e[24]=n.toolCallId,e[25]=f):f=e[25];let p;return e[26]!==n||e[27]!==f?(p=a.jsx(vd,{part:n,latency:f}),e[26]=n,e[27]=f,e[28]=p):p=e[28],p}case"tool-propose_plan":{let f;return e[29]!==n?(f=a.jsx(Ed,{part:n}),e[29]=n,e[30]=f):f=e[30],f}case"tool-generate_image":{let f;e[31]!==c||e[32]!==n.toolCallId?(f=c(n.toolCallId)?.latencySeconds,e[31]=c,e[32]=n.toolCallId,e[33]=f):f=e[33];let p;return e[34]!==n||e[35]!==f?(p=a.jsx(od,{part:n,latency:f}),e[34]=n,e[35]=f,e[36]=p):p=e[36],p}case"tool-take_screenshot":{let f;e[37]!==c||e[38]!==n.toolCallId?(f=c(n.toolCallId)?.latencySeconds,e[37]=c,e[38]=n.toolCallId,e[39]=f):f=e[39];let p;return e[40]!==n||e[41]!==f?(p=a.jsx(ld,{part:n,latency:f}),e[40]=n,e[41]=f,e[42]=p):p=e[42],p}case"tool-web_search":case"tool-deep_research":{let f;e[43]!==c||e[44]!==n.toolCallId?(f=c(n.toolCallId)?.latencySeconds,e[43]=c,e[44]=n.toolCallId,e[45]=f):f=e[45];let p;e[46]!==o.webSearchStreaming||e[47]!==n.toolCallId?(p=o.webSearchStreaming.get(n.toolCallId),e[46]=o.webSearchStreaming,e[47]=n.toolCallId,e[48]=p):p=e[48];let h;return e[49]!==n||e[50]!==f||e[51]!==p?(h=a.jsx(yd,{part:n,latency:f,streamingText:p}),e[49]=n,e[50]=f,e[51]=p,e[52]=h):h=e[52],h}case"tool-subtask":{let f;e[53]!==d||e[54]!==n.toolCallId?(f=d(n.toolCallId),e[53]=d,e[54]=n.toolCallId,e[55]=f):f=e[55];let p;e[56]!==c||e[57]!==n.toolCallId?(p=c(n.toolCallId)?.annotations,e[56]=c,e[57]=n.toolCallId,e[58]=p):p=e[58];let h;e[59]!==c||e[60]!==n.toolCallId?(h=c(n.toolCallId)?.latencySeconds,e[59]=c,e[60]=n.toolCallId,e[61]=h):h=e[61];let g;e[62]!==n||e[63]!==f||e[64]!==p||e[65]!==h?(g={part:n,subtaskMeta:f,annotations:p,latency:h},e[62]=n,e[63]=f,e[64]=p,e[65]=h,e[66]=g):g=e[66];const x=g;let b;return e[67]!==x?(b=a.jsx(_.Suspense,{fallback:a.jsx(Ad,{...x}),children:a.jsx(Id,{...x})}),e[67]=x,e[68]=b):b=e[68],b}case"text":{const f=!!r&&!i,p=i&&l;let h;return e[69]!==s||e[70]!==n||e[71]!==f||e[72]!==p||e[73]!==r?(h=a.jsx(An,{id:s,part:n,extraActions:r,copyable:!0,alwaysShowActions:f,animate:p}),e[69]=s,e[70]=n,e[71]=f,e[72]=p,e[73]=r,e[74]=h):h=e[74],h}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const f=n;if(f.type==="tool-brand_context_setup"||f.type==="tool-BRAND_CONTEXT_EXTRACT"){let p;e[75]!==f.toolCallId||e[76]!==c?(p=c(f.toolCallId)?.latencySeconds,e[75]=f.toolCallId,e[76]=c,e[77]=p):p=e[77];let h;return e[78]!==f||e[79]!==p?(h=a.jsx(Ud,{part:f,latency:p}),e[78]=f,e[79]=p,e[80]=h):h=e[80],h}if(f.type==="tool-BRAND_CONTEXT_GET"){let p;e[81]!==f.toolCallId||e[82]!==c?(p=c(f.toolCallId)?.latencySeconds,e[81]=f.toolCallId,e[82]=c,e[83]=p):p=e[83];let h;return e[84]!==f||e[85]!==p?(h=a.jsx(Wd,{part:f,latency:p}),e[84]=f,e[85]=p,e[86]=h):h=e[86],h}if(f.type==="tool-BRAND_CONTEXT_LIST"){let p;e[87]!==f.toolCallId||e[88]!==c?(p=c(f.toolCallId)?.latencySeconds,e[87]=f.toolCallId,e[88]=c,e[89]=p):p=e[89];let h;return e[90]!==f||e[91]!==p?(h=a.jsx(Kd,{part:f,latency:p}),e[90]=f,e[91]=p,e[92]=h):h=e[92],h}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let p;e[93]!==f.toolCallId||e[94]!==c?(p=c(f.toolCallId)?.latencySeconds,e[93]=f.toolCallId,e[94]=c,e[95]=p):p=e[95];let h;return e[96]!==f||e[97]!==p?(h=a.jsx(Qd,{part:f,latency:p}),e[96]=f,e[97]=p,e[98]=h):h=e[98],h}if(f.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let p;e[99]!==f.toolCallId||e[100]!==c?(p=c(f.toolCallId)?.latencySeconds,e[99]=f.toolCallId,e[100]=c,e[101]=p):p=e[101];let h;return e[102]!==f||e[103]!==p?(h=a.jsx(tf,{part:f,latency:p}),e[102]=f,e[103]=p,e[104]=h):h=e[104],h}if(f.type==="tool-COLLECTION_CONNECTIONS_LIST"){let p;e[105]!==f.toolCallId||e[106]!==c?(p=c(f.toolCallId)?.latencySeconds,e[105]=f.toolCallId,e[106]=c,e[107]=p):p=e[107];let h;return e[108]!==f||e[109]!==p?(h=a.jsx(of,{part:f,latency:p}),e[108]=f,e[109]=p,e[110]=h):h=e[110],h}if(f.type.startsWith("tool-")){const p=f.toolCallId;let h;e[111]!==o.toolMetadata||e[112]!==p?(h=o.toolMetadata.get(p),e[111]=o.toolMetadata,e[112]=p,e[113]=h):h=e[113];const g=h,x=g?.annotations,b=g?.latencySeconds,y=g?.outputBytes,v=g?._meta;let k;return e[114]!==f||e[115]!==l||e[116]!==x||e[117]!==b||e[118]!==y||e[119]!==v?(k=a.jsx(Mr,{part:f,annotations:x,latency:b,outputBytes:y,isLastMessage:l,toolMeta:v}),e[114]=f,e[115]=l,e[116]=x,e[117]=b,e[118]=y,e[119]=v,e[120]=k):k=e[120],k}if(f.type.startsWith("data-"))return null;throw new Error(`Unknown part type: ${f.type}`)}}}function Mf(t){const e=P.c(2),{isRunInProgress:n}=t;if(n){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx(Nn,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),a.jsx("span",{className:"text-[14px] text-muted-foreground shimmer",children:"Resuming task..."})]})}),e[0]=r):r=e[0],r}let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx("div",{className:"text-[14px] text-muted-foreground/60 py-2",children:"No response was generated"}),e[1]=s):s=e[1],s}function Rf(t){const e=P.c(7),{className:n,children:s}=t;let r;e[0]!==n?(r=q("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",n),e[0]=n,e[1]=r):r=e[1];let o;e[2]!==s?(o=a.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:a.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[14px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:s})}),e[2]=s,e[3]=o):o=e[3];let i;return e[4]!==r||e[5]!==o?(i=a.jsx("div",{className:r,children:o}),e[4]=r,e[5]=o,e[6]=i):i=e[6],i}function Pf(t){const e=P.c(31),{message:n,turnStartedAt:s,status:r,className:o,isLast:i}=t,l=i===void 0?!1:i,{isRunInProgress:u}=pt()??{},c=u===void 0?!1:u,m=Is()?.taskId??null,d=r==="streaming",p=d||r==="submitted";let h;e[0]!==s?(h=_s(s),e[0]=s,e[1]=h):h=e[1];const g=h;let x;e[2]!==p?(x=()=>p?Date.now():null,e[2]=p,e[3]=x):x=e[3];const[b,y]=_.useState(x),[v,k]=_.useState(p);v!==p&&(k(p),y(p?Date.now():null));const j=g??b,{reasoningGroups:S,renderOrder:w,dataParts:T}=Nf(n),N=n!==null&&w.length>0,C=n&&n.parts.length>0?n.parts[n.parts.length-1]:null,I=d&&C?.type==="reasoning";let M;if(e[4]!==n){const H=n?.metadata?.reasoning_start_at?new Date(n.metadata.reasoning_start_at):null,F=n?.metadata?.reasoning_end_at?new Date(n.metadata.reasoning_end_at):new Date;M=H!==null?F.getTime()-H.getTime():null,e[4]=n,e[5]=M}else M=e[5];const A=M;let $;e[6]!==l||e[7]!==n?($=!l||!n||!n.parts.some(Of),e[6]=l,e[7]=n,e[8]=$):$=e[8];const E=$;let O;e[9]!==N||e[10]!==p||e[11]!==E||e[12]!==n||e[13]!==w?(O=!p&&N&&E&&(()=>{let H=0;for(const F of w)if(F.kind==="part"){const K=n.parts[F.index]?.type;(K==="dynamic-tool"||K?.startsWith("tool-"))&&H++}return H>=Cf})(),e[9]=N,e[10]=p,e[11]=E,e[12]=n,e[13]=w,e[14]=O):O=e[14];const R=O;let D;if(e[15]!==o||e[16]!==T||e[17]!==N||e[18]!==l||e[19]!==p||e[20]!==I||e[21]!==c||e[22]!==E||e[23]!==n||e[24]!==S||e[25]!==w||e[26]!==R||e[27]!==j||e[28]!==m||e[29]!==A){const{collapsed:H,tail:F}=R?_f(w,n.parts):{collapsed:[],tail:w};D=a.jsx(Rf,{className:o,children:N?a.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[n.metadata?.resumedFromBackground&&a.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground/60 select-none",children:[a.jsx(Wr,{className:"size-3 shrink-0"}),a.jsx("span",{children:"Resumed — background task completed"})]}),H.length>0&&a.jsx(Ef,{items:H,message:n,reasoningGroups:S,isReasoningActive:I,totalDuration:A,dataParts:T,isLoading:p,isLast:l}),F.map((K,B)=>{const V=H.length+B,Y=F.findLastIndex($f)===B;return ci({item:K,renderIndex:V,message:n,reasoningGroups:S,isReasoningActive:I,totalDuration:A,dataParts:T,isLoading:p,isLast:l,isLastVisiblePart:Y,renderOrder:w})}),m&&a.jsx(jf,{threadId:m,message:n}),l&&p&&j!==null&&a.jsx(_u,{startedAt:j}),l&&!p&&m&&a.jsxs(a.Fragment,{children:[a.jsx(mf,{}),E&&a.jsx(cf,{})]}),!p&&a.jsx(Jo,{message:n})]}):p?a.jsx(Iu,{startedAt:j}):a.jsx(Mf,{isRunInProgress:l&&c})}),e[15]=o,e[16]=T,e[17]=N,e[18]=l,e[19]=p,e[20]=I,e[21]=c,e[22]=E,e[23]=n,e[24]=S,e[25]=w,e[26]=R,e[27]=j,e[28]=m,e[29]=A,e[30]=D}else D=e[30];return D}function $f(t){return t.kind==="part"}function Of(t){const e=t.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const n=t.state;return n==="input-streaming"||n==="input-available"||n==="approval-requested"}function Df(t){const e=P.c(21),{event:n}=t,[s,r]=_.useState(!1);let o;e[0]!==n.data?(o=JSON.stringify(n.data,null,2),e[0]=n.data,e[1]=o):o=e[1];const i=o;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(Hf),e[2]=l):l=e[2];let u,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(aa,{className:"size-4 shrink-0 text-muted-foreground"}),c=a.jsx("span",{className:"font-medium",children:"Triggered by event"}),e[3]=u,e[4]=c):(u=e[3],c=e[4]);let m;e[5]!==n.type?(m=a.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:n.type}),e[5]=n.type,e[6]=m):m=e[6];const d=s&&"rotate-180";let f;e[7]!==d?(f=q("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",d),e[7]=d,e[8]=f):f=e[8];let p;e[9]!==f?(p=a.jsx(Wt,{className:f}),e[9]=f,e[10]=p):p=e[10];let h;e[11]!==m||e[12]!==p?(h=a.jsxs("button",{type:"button",onClick:l,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[u,c,m,p]}),e[11]=m,e[12]=p,e[13]=h):h=e[13];let g;e[14]!==n.source||e[15]!==s||e[16]!==i?(g=s&&a.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[a.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:n.source}),a.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:i})]}),e[14]=n.source,e[15]=s,e[16]=i,e[17]=g):g=e[17];let x;return e[18]!==g||e[19]!==h?(x=a.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[h,g]}),e[18]=g,e[19]=h,e[20]=x):x=e[20],x}function Hf(t){return!t}const zf=[pu.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),Wa,El];function Ff(t){const e=P.c(5),{tiptapDoc:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=s):s=e[0];let r;e[1]!==n?(r={extensions:zf,content:n,editable:!1,editorProps:s},e[1]=n,e[2]=r):r=e[2];const o=Ua(r);if(!o)return null;let i;return e[3]!==o?(i=a.jsx(Ka,{editor:o,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=o,e[4]=i):i=e[4],i}function Bf(t){const e=P.c(38),{message:n,className:s,onScrollToPair:r}=t,{id:o,parts:i,metadata:l}=n,[u,c]=_.useState(!1),[m,d]=_.useState(!1),f=_.useRef(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=E=>{E&&!f.current&&(f.current=!0,d(E.scrollHeight>E.clientHeight))},e[0]=p):p=e[0];const h=p;if(!i||i.length===0)return null;let g;e[1]!==r?(g=()=>{c(!0),r?.()},e[1]=r,e[2]=g):g=e[2];const x=g,b=l?.tiptapDoc;let y;e[3]!==s?(y=q("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",s),e[3]=s,e[4]=y):y=e[4];let v,k;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=()=>c(!0),k=()=>c(!1),e[5]=v,e[6]=k):(v=e[5],k=e[6]);let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=j):j=e[7];let S;e[8]!==u||e[9]!==m?(S=q("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",u?"max-h-[50vh] overflow-auto opacity-100":q("max-h-[84px] overflow-hidden opacity-99",m&&"mask-b-from-1%")),e[8]=u,e[9]=m,e[10]=S):S=e[10];let w;if(e[11]!==o||e[12]!==i){let E;e[14]!==o?(E=(O,R)=>O.type==="data-trigger-event"?a.jsx(Df,{event:O.data},`${o}-${R}`):null,e[14]=o,e[15]=E):E=e[15],w=i.map(E),e[11]=o,e[12]=i,e[13]=w}else w=e[13];let T;e[16]!==b||e[17]!==o||e[18]!==l||e[19]!==i?(T=b?a.jsx(Ff,{tiptapDoc:l.tiptapDoc}):i.map((E,O)=>E.type==="text"?i[O-1]?.type==="data-trigger-event"?null:a.jsx(An,{id:o,part:E},`${o}-${O}`):null),e[16]=b,e[17]=o,e[18]=l,e[19]=i,e[20]=T):T=e[20];let N;e[21]!==w||e[22]!==T?(N=a.jsxs("div",{className:"flex flex-col gap-2",children:[w,T]}),e[21]=w,e[22]=T,e[23]=N):N=e[23];let C;e[24]!==N||e[25]!==S?(C=a.jsx("div",{ref:h,className:S,children:N}),e[24]=N,e[25]=S,e[26]=C):C=e[26];let I;e[27]!==x||e[28]!==C?(I=a.jsxs("div",{tabIndex:0,onClick:x,onFocus:v,onBlur:k,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-[14px] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[j,C]}),e[27]=x,e[28]=C,e[29]=I):I=e[29];let M;e[30]!==n?(M=a.jsx(Jo,{message:n,className:"mt-1 mr-1 self-end"}),e[30]=n,e[31]=M):M=e[31];let A;e[32]!==I||e[33]!==M?(A=a.jsxs("div",{className:"w-full min-w-0 flex flex-col",children:[I,M]}),e[32]=I,e[33]=M,e[34]=A):A=e[34];let $;return e[35]!==A||e[36]!==y?($=a.jsx(a.Fragment,{children:a.jsx("div",{className:y,children:A})}),e[35]=A,e[36]=y,e[37]=$):$=e[37],$}function Uf(t){const e=[],n=t.filter(s=>s.role!=="system"&&!s.metadata?.internal&&!s.metadata?.subtaskJobId);for(let s=0;s<n.length;s++){const r=n[s];if(r)if(r.role==="user"){const o=n[s+1];o&&o.role==="assistant"?(e.push({user:r,assistant:o}),s++):e.push({user:r,assistant:null})}else r.role==="assistant"&&e.push({user:null,assistant:r})}return e}function Wf(t){const e=P.c(19),{pair:n,isLastPair:s,status:r}=t,o=_.useRef(null),i=_.useRef(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current&&o.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=l):l=e[0];const u=l;let c;e[1]!==s||e[2]!==n.assistant?.metadata?.resumedFromBackground||e[3]!==r?(c=b=>{if(o.current=b,!s||!b||i.current||(i.current=!0,n.assistant?.metadata?.resumedFromBackground))return;if(r==="submitted"||r==="streaming"){b.scrollIntoView({behavior:"smooth",block:"start"});return}const y=b.closest("[data-chat-scroller]");y?y.scrollTop=y.scrollHeight:b.scrollIntoView({behavior:"instant",block:"start"})},e[1]=s,e[2]=n.assistant?.metadata?.resumedFromBackground,e[3]=r,e[4]=c):c=e[4];const m=c,d=!n.user&&"pt-8 sm:pt-6";let f;e[5]!==d?(f=q("flex flex-col pb-2 sm:pb-2",d),e[5]=d,e[6]=f):f=e[6];let p;e[7]!==n.user?(p=n.user&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),a.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:a.jsx(Bf,{message:n.user,onScrollToPair:u})})]}),e[7]=n.user,e[8]=p):p=e[8];const h=n.user?.created_at??null;let g;e[9]!==s||e[10]!==n.assistant||e[11]!==r||e[12]!==h?(g=a.jsx(Pf,{message:n.assistant,turnStartedAt:h,status:r,isLast:s}),e[9]=s,e[10]=n.assistant,e[11]=r,e[12]=h,e[13]=g):g=e[13];let x;return e[14]!==m||e[15]!==f||e[16]!==p||e[17]!==g?(x=a.jsxs("div",{ref:m,className:f,children:[p,g]}),e[14]=m,e[15]=f,e[16]=p,e[17]=g,e[18]=x):x=e[18],x}function Kf(t,e){return _.useReducer((n,s)=>e[n][s]??n,t)}var Zs="ScrollArea",[ui]=Br(Zs),[Vf,je]=ui(Zs),di=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:s="hover",dir:r,scrollHideDelay:o=600,...i}=t,[l,u]=_.useState(null),[c,m]=_.useState(null),[d,f]=_.useState(null),[p,h]=_.useState(null),[g,x]=_.useState(null),[b,y]=_.useState(0),[v,k]=_.useState(0),[j,S]=_.useState(!1),[w,T]=_.useState(!1),N=it(e,I=>u(I)),C=Pi(r);return a.jsx(Vf,{scope:n,type:s,dir:C,scrollHideDelay:o,scrollArea:l,viewport:c,onViewportChange:m,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:h,scrollbarXEnabled:j,onScrollbarXEnabledChange:S,scrollbarY:g,onScrollbarYChange:x,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:k,children:a.jsx(Ge.div,{dir:C,...i,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":v+"px",...t.style}})})});di.displayName=Zs;var fi="ScrollAreaViewport",mi=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:s,nonce:r,...o}=t,i=je(fi,n),l=_.useRef(null),u=it(e,l,i.onViewportChange);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(Ge.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style},children:a.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});mi.displayName=fi;var Re="ScrollAreaScrollbar",pi=_.forwardRef((t,e)=>{const{forceMount:n,...s}=t,r=je(Re,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=r,l=t.orientation==="horizontal";return _.useEffect(()=>(l?o(!0):i(!0),()=>{l?o(!1):i(!1)}),[l,o,i]),r.type==="hover"?a.jsx(Gf,{...s,ref:e,forceMount:n}):r.type==="scroll"?a.jsx(qf,{...s,ref:e,forceMount:n}):r.type==="auto"?a.jsx(hi,{...s,ref:e,forceMount:n}):r.type==="always"?a.jsx(er,{...s,ref:e}):null});pi.displayName=Re;var Gf=_.forwardRef((t,e)=>{const{forceMount:n,...s}=t,r=je(Re,t.__scopeScrollArea),[o,i]=_.useState(!1);return _.useEffect(()=>{const l=r.scrollArea;let u=0;if(l){const c=()=>{window.clearTimeout(u),i(!0)},m=()=>{u=window.setTimeout(()=>i(!1),r.scrollHideDelay)};return l.addEventListener("pointerenter",c),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",c),l.removeEventListener("pointerleave",m)}}},[r.scrollArea,r.scrollHideDelay]),a.jsx(Et,{present:n||o,children:a.jsx(hi,{"data-state":o?"visible":"hidden",...s,ref:e})})}),qf=_.forwardRef((t,e)=>{const{forceMount:n,...s}=t,r=je(Re,t.__scopeScrollArea),o=t.orientation==="horizontal",i=Pn(()=>u("SCROLL_END"),100),[l,u]=Kf("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(l==="idle"){const c=window.setTimeout(()=>u("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(c)}},[l,r.scrollHideDelay,u]),_.useEffect(()=>{const c=r.viewport,m=o?"scrollLeft":"scrollTop";if(c){let d=c[m];const f=()=>{const p=c[m];d!==p&&(u("SCROLL"),i()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[r.viewport,o,u,i]),a.jsx(Et,{present:n||l!=="hidden",children:a.jsx(er,{"data-state":l==="hidden"?"hidden":"visible",...s,ref:e,onPointerEnter:Ke(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ke(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),hi=_.forwardRef((t,e)=>{const n=je(Re,t.__scopeScrollArea),{forceMount:s,...r}=t,[o,i]=_.useState(!1),l=t.orientation==="horizontal",u=Pn(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?c:m)}},10);return ft(n.viewport,u),ft(n.content,u),a.jsx(Et,{present:s||o,children:a.jsx(er,{"data-state":o?"visible":"hidden",...r,ref:e})})}),er=_.forwardRef((t,e)=>{const{orientation:n="vertical",...s}=t,r=je(Re,t.__scopeScrollArea),o=_.useRef(null),i=_.useRef(0),[l,u]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=vi(l.viewport,l.content),m={...s,sizes:l,onSizesChange:u,hasThumb:c>0&&c<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function d(f,p){return em(f,i.current,l,p)}return n==="horizontal"?a.jsx(Xf,{...m,ref:e,onThumbPositionChange:()=>{if(r.viewport&&o.current){const f=r.viewport.scrollLeft,p=Hr(f,l,r.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{r.viewport&&(r.viewport.scrollLeft=f)},onDragScroll:f=>{r.viewport&&(r.viewport.scrollLeft=d(f,r.dir))}}):n==="vertical"?a.jsx(Yf,{...m,ref:e,onThumbPositionChange:()=>{if(r.viewport&&o.current){const f=r.viewport.scrollTop,p=Hr(f,l);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{r.viewport&&(r.viewport.scrollTop=f)},onDragScroll:f=>{r.viewport&&(r.viewport.scrollTop=d(f))}}):null}),Xf=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:s,...r}=t,o=je(Re,t.__scopeScrollArea),[i,l]=_.useState(),u=_.useRef(null),c=it(e,u,o.onScrollbarXChange);return _.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),a.jsx(xi,{"data-orientation":"horizontal",...r,ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Rn(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.x),onDragScroll:m=>t.onDragScroll(m.x),onWheelScroll:(m,d)=>{if(o.viewport){const f=o.viewport.scrollLeft+m.deltaX;t.onWheelScroll(f),Si(f,d)&&m.preventDefault()}},onResize:()=>{u.current&&o.viewport&&i&&s({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:wn(i.paddingLeft),paddingEnd:wn(i.paddingRight)}})}})}),Yf=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:s,...r}=t,o=je(Re,t.__scopeScrollArea),[i,l]=_.useState(),u=_.useRef(null),c=it(e,u,o.onScrollbarYChange);return _.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),a.jsx(xi,{"data-orientation":"vertical",...r,ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Rn(n)+"px",...t.style},onThumbPointerDown:m=>t.onThumbPointerDown(m.y),onDragScroll:m=>t.onDragScroll(m.y),onWheelScroll:(m,d)=>{if(o.viewport){const f=o.viewport.scrollTop+m.deltaY;t.onWheelScroll(f),Si(f,d)&&m.preventDefault()}},onResize:()=>{u.current&&o.viewport&&i&&s({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:wn(i.paddingTop),paddingEnd:wn(i.paddingBottom)}})}})}),[Qf,gi]=ui(Re),xi=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:c,onWheelScroll:m,onResize:d,...f}=t,p=je(Re,n),[h,g]=_.useState(null),x=it(e,N=>g(N)),b=_.useRef(null),y=_.useRef(""),v=p.viewport,k=s.content-s.viewport,j=Qe(m),S=Qe(u),w=Pn(d,10);function T(N){if(b.current){const C=N.clientX-b.current.left,I=N.clientY-b.current.top;c({x:C,y:I})}}return _.useEffect(()=>{const N=C=>{const I=C.target;h?.contains(I)&&j(C,k)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[v,h,k,j]),_.useEffect(S,[s,S]),ft(h,w),ft(p.content,w),a.jsx(Qf,{scope:n,scrollbar:h,hasThumb:r,onThumbChange:Qe(o),onThumbPointerUp:Qe(i),onThumbPositionChange:S,onThumbPointerDown:Qe(l),children:a.jsx(Ge.div,{...f,ref:x,style:{position:"absolute",...f.style},onPointerDown:Ke(t.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),b.current=h.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),T(N))}),onPointerMove:Ke(t.onPointerMove,T),onPointerUp:Ke(t.onPointerUp,N=>{const C=N.target;C.hasPointerCapture(N.pointerId)&&C.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),jn="ScrollAreaThumb",bi=_.forwardRef((t,e)=>{const{forceMount:n,...s}=t,r=gi(jn,t.__scopeScrollArea);return a.jsx(Et,{present:n||r.hasThumb,children:a.jsx(Jf,{ref:e,...s})})}),Jf=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:s,...r}=t,o=je(jn,n),i=gi(jn,n),{onThumbPositionChange:l}=i,u=it(e,d=>i.onThumbChange(d)),c=_.useRef(void 0),m=Pn(()=>{c.current&&(c.current(),c.current=void 0)},100);return _.useEffect(()=>{const d=o.viewport;if(d){const f=()=>{if(m(),!c.current){const p=tm(d,l);c.current=p,l()}};return l(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,m,l]),a.jsx(Ge.div,{"data-state":i.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Ke(t.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),h=d.clientX-p.left,g=d.clientY-p.top;i.onThumbPointerDown({x:h,y:g})}),onPointerUp:Ke(t.onPointerUp,i.onThumbPointerUp)})});bi.displayName=jn;var tr="ScrollAreaCorner",yi=_.forwardRef((t,e)=>{const n=je(tr,t.__scopeScrollArea),s=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&s?a.jsx(Zf,{...t,ref:e}):null});yi.displayName=tr;var Zf=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,...s}=t,r=je(tr,n),[o,i]=_.useState(0),[l,u]=_.useState(0),c=!!(o&&l);return ft(r.scrollbarX,()=>{const m=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(m),u(m)}),ft(r.scrollbarY,()=>{const m=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(m),i(m)}),c?a.jsx(Ge.div,{...s,ref:e,style:{width:o,height:l,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function wn(t){return t?parseInt(t,10):0}function vi(t,e){const n=t/e;return isNaN(n)?0:n}function Rn(t){const e=vi(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=(t.scrollbar.size-n)*e;return Math.max(s,18)}function em(t,e,n,s="ltr"){const r=Rn(n),o=r/2,i=e||o,l=r-i,u=n.scrollbar.paddingStart+i,c=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,d=s==="ltr"?[0,m]:[m*-1,0];return ki([u,c],d)(t)}function Hr(t,e,n="ltr"){const s=Rn(e),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-r,i=e.content-e.viewport,l=o-s,u=n==="ltr"?[0,i]:[i*-1,0],c=$i(t,u);return ki([0,i],[0,l])(c)}function ki(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const s=(e[1]-e[0])/(t[1]-t[0]);return e[0]+s*(n-t[0])}}function Si(t,e){return t>0&&t<e}var tm=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},s=0;return(function r(){const o={left:t.scrollLeft,top:t.scrollTop},i=n.left!==o.left,l=n.top!==o.top;(i||l)&&e(),n=o,s=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(s)};function Pn(t,e){const n=Qe(t),s=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(s.current),[]),_.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(n,e)},[n,e])}function ft(t,e){const n=Qe(e);Fr(()=>{let s=0;if(t){const r=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(n)});return r.observe(t),()=>{window.cancelAnimationFrame(s),r.unobserve(t)}}},[t,n])}var nm=di,sm=mi,rm=yi;function Bp(t){const e=P.c(17);let n,s,r,o;e[0]!==t?({className:s,children:n,hideScrollbar:o,...r}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=o):(n=e[1],s=e[2],r=e[3],o=e[4]);const i=o===void 0?!1:o;let l;e[5]!==s?(l=q("relative h-full w-full",s),e[5]=s,e[6]=l):l=e[6];let u;e[7]!==n?(u=a.jsx(sm,{"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:a.jsx("div",{className:"flex min-w-0 flex-col",children:n})}),e[7]=n,e[8]=u):u=e[8];let c;e[9]!==i?(c=a.jsx(om,{hideScrollbar:i}),e[9]=i,e[10]=c):c=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(rm,{}),e[11]=m):m=e[11];let d;return e[12]!==r||e[13]!==l||e[14]!==u||e[15]!==c?(d=a.jsxs(nm,{"data-slot":"scroll-area",className:l,...r,children:[u,c,m]}),e[12]=r,e[13]=l,e[14]=u,e[15]=c,e[16]=d):d=e[16],d}function om(t){const e=P.c(15);let n,s,r,o;e[0]!==t?({className:n,orientation:r,hideScrollbar:o,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=r,e[4]=o):(n=e[1],s=e[2],r=e[3],o=e[4]);const i=r===void 0?"vertical":r,l=o===void 0?!1:o,u=i==="vertical"&&"h-full w-2.5 border-l border-l-transparent",c=i==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",m=l&&"hidden";let d;e[5]!==n||e[6]!==u||e[7]!==c||e[8]!==m?(d=q("select-none touch-none p-px transition-colors",u,c,m,n),e[5]=n,e[6]=u,e[7]=c,e[8]=m,e[9]=d):d=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(bi,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let p;return e[11]!==i||e[12]!==s||e[13]!==d?(p=a.jsx(pi,{"data-slot":"scroll-area-scrollbar",orientation:i,className:d,...s,children:f}),e[11]=i,e[12]=s,e[13]=d,e[14]=p):p=e[14],p}const ji=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],im=40;function Up(t){const n=(t.endDate.getTime()-t.startDate.getTime())/im;return ji.find(r=>r.ms>=n)?.label??"1d"}function nr(t){const e=ji.find(o=>o.label===t);if(e)return e.ms;const n=/^(\d+)([mhd])$/.exec(t);if(!n)return 6e4;const s=parseInt(n[1],10),r=n[2];return r==="h"?s*36e5:r==="d"?s*864e5:s*6e4}function am(t,e){const n=new Date(t);return nr(e)>=864e5?n.toLocaleDateString([],{month:"short",day:"numeric"}):n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function zr(t,e){const n=nr(e);return new Date(Math.floor(t.getTime()/n)*n)}function lm(t){return t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`}function sr(t){return Number.isFinite(t)?t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:Math.round(t).toLocaleString():"0"}function rr(t){return Number.isFinite(t)?`$${t.toFixed(t<1?4:2)}`:"$0.00"}function Wp(t,e,n){const s=nr(n),r=zr(e.startDate,n).getTime(),o=e.endDate.getTime(),i=new Map(t.map(u=>[zr(new Date(u.timestamp),n).getTime(),u])),l=[];for(let u=r;u<=o;u+=s){const c=i.get(u),m=new Date(u).toISOString();l.push({t:m,ts:u,label:am(m,n),calls:c?.calls??0,errors:c?.errors??0,errorRate:c?.errorRate??0,avg:c?.avg??0,p50:c?.p50??0,p95:c?.p95??0,inputTokens:c?.inputTokens??0,outputTokens:c?.outputTokens??0,totalTokens:c?.totalTokens??0,costUsd:c?.costUsd??0})}return l}function Kp(t,e){return e==="requests"?t.calls:e==="errors"?t.errorRate:t.avgDurationMs}function Vp(t,e){return e==="requests"?t.calls.toLocaleString():e==="errors"?`${t.errorRate.toFixed(1)}%`:lm(t.avgDurationMs)}function or(t){return(t.run_config??{}).agent?.id??(t.virtual_mcp_id||null)}function ir(t,e,n,s){if(!t)return s;const r=e.find(i=>i.id===t)??n?.find(i=>i.id===t);if(r?.title)return r.title;const o=zi(t);return o?Fi(o).title??s:t}function ar(t,e,n){return t?(e.find(r=>r.id===t)??n?.find(r=>r.id===t))?.icon??null:null}function wi(t){return t?.data?.members??[]}function xs(t){const e=P.c(33),{thread:n,connections:s,virtualMcps:r,selectedIndex:o,total:i,onPrev:l,onNext:u}=t;let c,m;if(e[0]!==s||e[1]!==n||e[2]!==r){const I=or(n);c=ir(I,r,s,""),m=ar(I,r,s),e[0]=s,e[1]=n,e[2]=r,e[3]=c,e[4]=m}else c=e[3],m=e[4];const d=m,f=c||n.title;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(Cs,{}),e[5]=p):p=e[5];let h;e[6]!==d||e[7]!==f?(h=a.jsx(qe,{icon:d,name:f,size:"sm",fallbackIcon:p,className:"shadow-sm shrink-0 rounded-md"}),e[6]=d,e[7]=f,e[8]=h):h=e[8];let g;e[9]!==n.title?(g=a.jsx(qr,{className:"text-sm leading-snug truncate",children:n.title}),e[9]=n.title,e[10]=g):g=e[10];let x;e[11]!==c?(x=c&&a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:c}),e[11]=c,e[12]=x):x=e[12];let b;e[13]!==g||e[14]!==x?(b=a.jsxs("div",{className:"min-w-0",children:[g,x]}),e[13]=g,e[14]=x,e[15]=b):b=e[15];let y;e[16]!==h||e[17]!==b?(y=a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[h,b]}),e[16]=h,e[17]=b,e[18]=y):y=e[18];const v=o===0;let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(Jn,{size:14}),e[19]=k):k=e[19];let j;e[20]!==l||e[21]!==v?(j=a.jsx(tt,{size:"icon",variant:"ghost",onClick:l,disabled:v,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous chat",children:k}),e[20]=l,e[21]=v,e[22]=j):j=e[22];const S=o===i-1;let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Wt,{size:14}),e[23]=w):w=e[23];let T;e[24]!==u||e[25]!==S?(T=a.jsx(tt,{size:"icon",variant:"ghost",onClick:u,disabled:S,className:"h-7 w-7 text-muted-foreground","aria-label":"Next chat",children:w}),e[24]=u,e[25]=S,e[26]=T):T=e[26];let N;e[27]!==j||e[28]!==T?(N=a.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[j,T]}),e[27]=j,e[28]=T,e[29]=N):N=e[29];let C;return e[30]!==N||e[31]!==y?(C=a.jsx(Gr,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:a.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[y,N]})}),e[30]=N,e[31]=y,e[32]=C):C=e[32],C}function cm(t){const e=P.c(48),{thread:n,connections:s,virtualMcps:r,members:o}=t;let i,l;if(e[0]!==s||e[1]!==n||e[2]!==r){const E=or(n);i=ir(E,r,s,""),l=ar(E,r,s),e[0]=s,e[1]=n,e[2]=r,e[3]=i,e[4]=l}else i=e[3],l=e[4];const u=l;let c;if(e[5]!==o||e[6]!==n.created_by){const E=wi(o);let O;e[8]!==n.created_by?(O=R=>R.userId===n.created_by,e[8]=n.created_by,e[9]=O):O=e[9],c=E.find(O),e[5]=o,e[6]=n.created_by,e[7]=c}else c=e[7];const m=c;let d;e[10]!==m?.user.email||e[11]!==m?.user.name||e[12]!==n.created_by?(d=m?.user.name??m?.user.email??n.created_by?.substring(0,8)??"—",e[10]=m?.user.email,e[11]=m?.user.name,e[12]=n.created_by,e[13]=d):d=e[13];const f=d,p=m?.user.image??void 0;let h;e[14]!==n.created_at?(h=new Date(n.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=n.created_at,e[15]=h):h=e[15];const g=h,x=ct[n.status]??ct.completed,b=x.icon;let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Status"}),e[16]=y):y=e[16];let v;e[17]!==b||e[18]!==x.iconClassName?(v=a.jsx(b,{size:13,className:x.iconClassName}),e[17]=b,e[18]=x.iconClassName,e[19]=v):v=e[19];let k;e[20]!==x.labelColor?(k=q("text-sm",x.labelColor),e[20]=x.labelColor,e[21]=k):k=e[21];let j;e[22]!==x.label||e[23]!==k?(j=a.jsx("span",{className:k,children:x.label}),e[22]=x.label,e[23]=k,e[24]=j):j=e[24];let S;e[25]!==v||e[26]!==j?(S=a.jsxs("div",{children:[y,a.jsxs("div",{className:"flex items-center gap-1.5",children:[v,j]})]}),e[25]=v,e[26]=j,e[27]=S):S=e[27];let w;e[28]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Date"}),e[28]=w):w=e[28];let T;e[29]!==g?(T=a.jsxs("div",{children:[w,a.jsx("div",{className:"text-sm text-foreground",children:g})]}),e[29]=g,e[30]=T):T=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[31]=N):N=e[31];let C;e[32]!==p||e[33]!==f?(C=a.jsx(eo,{url:p,fallback:f,shape:"circle",size:"2xs",className:"shrink-0"}),e[32]=p,e[33]=f,e[34]=C):C=e[34];let I;e[35]!==f?(I=a.jsx("span",{className:"text-sm text-foreground",children:f}),e[35]=f,e[36]=I):I=e[36];let M;e[37]!==C||e[38]!==I?(M=a.jsxs("div",{children:[N,a.jsxs("div",{className:"flex items-center gap-2",children:[C,I]})]}),e[37]=C,e[38]=I,e[39]=M):M=e[39];let A;e[40]!==u||e[41]!==i?(A=i&&a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qe,{icon:u,name:i,size:"xs",fallbackIcon:a.jsx(Cs,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),a.jsx("span",{className:"text-sm text-foreground",children:i})]})]}),e[40]=u,e[41]=i,e[42]=A):A=e[42];let $;return e[43]!==T||e[44]!==M||e[45]!==A||e[46]!==S?($=a.jsxs("div",{className:"px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm",children:[S,T,M,A]}),e[43]=T,e[44]=M,e[45]=A,e[46]=S,e[47]=$):$=e[47],$}function um(t){const e=P.c(72),{thread:n,usage:s,members:r,connections:o,virtualMcps:i,onClick:l,lastRowRef:u}=t;let c,m;if(e[0]!==o||e[1]!==n||e[2]!==i){const J=or(n);c=ir(J,i,o,"—"),m=ar(J,i,o),e[0]=o,e[1]=n,e[2]=i,e[3]=c,e[4]=m}else c=e[3],m=e[4];const d=m;let f;if(e[5]!==r||e[6]!==n.created_by){const J=wi(r);let ee;e[8]!==n.created_by?(ee=ce=>ce.userId===n.created_by,e[8]=n.created_by,e[9]=ee):ee=e[9],f=J.find(ee),e[5]=r,e[6]=n.created_by,e[7]=f}else f=e[7];const p=f;let h;e[10]!==p?.user.email||e[11]!==p?.user.name||e[12]!==n.created_by?(h=p?.user.name??p?.user.email??n.created_by?.substring(0,8)??"—",e[10]=p?.user.email,e[11]=p?.user.name,e[12]=n.created_by,e[13]=h):h=e[13];const g=h,x=p?.user.image??void 0;let b,y;if(e[14]!==n.created_at){const J=new Date(n.created_at);b=J.toLocaleDateString("en-US",{month:"short",day:"numeric"}),y=J.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[14]=n.created_at,e[15]=b,e[16]=y}else b=e[15],y=e[16];const v=y,k=ct[n.status]??ct.completed,j=k.icon;let S;e[17]!==n.title?(S=a.jsx(ve,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:a.jsx("div",{className:"font-medium text-foreground truncate",children:n.title})}),e[17]=n.title,e[18]=S):S=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Cs,{}),e[19]=w):w=e[19];let T;e[20]!==d||e[21]!==c?(T=a.jsx(qe,{icon:d,name:c,size:"xs",fallbackIcon:w,className:"shrink-0 size-5! min-w-5! rounded-md"}),e[20]=d,e[21]=c,e[22]=T):T=e[22];let N;e[23]!==c?(N=a.jsx("span",{className:"truncate",children:c}),e[23]=c,e[24]=N):N=e[24];let C;e[25]!==T||e[26]!==N?(C=a.jsx(ve,{className:"w-36 px-3 text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[T,N]})}),e[25]=T,e[26]=N,e[27]=C):C=e[27];let I;e[28]!==x||e[29]!==g?(I=a.jsx(eo,{url:x,fallback:g,shape:"circle",size:"2xs",className:"shrink-0"}),e[28]=x,e[29]=g,e[30]=I):I=e[30];let M;e[31]!==g?(M=a.jsx("span",{className:"truncate",children:g}),e[31]=g,e[32]=M):M=e[32];let A;e[33]!==I||e[34]!==M?(A=a.jsx(ve,{className:"w-28 px-3 text-muted-foreground",children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,M]})}),e[33]=I,e[34]=M,e[35]=A):A=e[35];let $;e[36]!==j||e[37]!==k.iconClassName?($=a.jsx(j,{size:14,className:k.iconClassName}),e[36]=j,e[37]=k.iconClassName,e[38]=$):$=e[38];let E;e[39]!==k.labelColor?(E=q("text-sm",k.labelColor),e[39]=k.labelColor,e[40]=E):E=e[40];let O;e[41]!==k.label||e[42]!==E?(O=a.jsx("span",{className:E,children:k.label}),e[41]=k.label,e[42]=E,e[43]=O):O=e[43];let R;e[44]!==$||e[45]!==O?(R=a.jsx(ve,{className:"w-24 px-3",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[$,O]})}),e[44]=$,e[45]=O,e[46]=R):R=e[46];let D;e[47]!==s?(D=s?sr(s.totalTokens):"—",e[47]=s,e[48]=D):D=e[48];let H;e[49]!==D?(H=a.jsx(ve,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:D}),e[49]=D,e[50]=H):H=e[50];let F;e[51]!==s?(F=s&&s.costUsd>0?rr(s.costUsd):"—",e[51]=s,e[52]=F):F=e[52];let K;e[53]!==F?(K=a.jsx(ve,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:F}),e[53]=F,e[54]=K):K=e[54];let B;e[55]!==b?(B=a.jsx("div",{children:b}),e[55]=b,e[56]=B):B=e[56];let V;e[57]!==v?(V=a.jsx("div",{className:"text-xs text-muted-foreground/60",children:v}),e[57]=v,e[58]=V):V=e[58];let Y;e[59]!==B||e[60]!==V?(Y=a.jsxs(ve,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[B,V]}),e[59]=B,e[60]=V,e[61]=Y):Y=e[61];let Q;return e[62]!==u||e[63]!==l||e[64]!==A||e[65]!==R||e[66]!==H||e[67]!==K||e[68]!==Y||e[69]!==S||e[70]!==C?(Q=a.jsxs(Tn,{ref:u,className:"h-14 md:h-16 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:l,children:[S,C,A,R,H,K,Y]}),e[62]=u,e[63]=l,e[64]=A,e[65]=R,e[66]=H,e[67]=K,e[68]=Y,e[69]=S,e[70]=C,e[71]=Q):Q=e[71],Q}const bs=100;function dm(t){const e=P.c(37),{client:n,locator:s,thread:r,connections:o,virtualMcps:i,members:l,selectedIndex:u,total:c,onPrev:m,onNext:d}=t;let f;e[0]!==s||e[1]!==r.id?(f=ke.threadMessages(s,r.id),e[0]=s,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==n||e[4]!==r.id?(p=async M=>{const{pageParam:A}=M,$=A===void 0?0:A;if(!n)throw new Error("MCP client is not available");const E=await n.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:r.id,limit:bs,offset:$}});return E.structuredContent??E},e[3]=n,e[4]=r.id,e[5]=p):p=e[5];let h;e[6]!==f||e[7]!==p?(h={queryKey:f,queryFn:p,initialPageParam:0,getNextPageParam:pm,staleTime:6e4},e[6]=f,e[7]=p,e[8]=h):h=e[8];const{data:g,fetchNextPage:x,hasNextPage:b,isFetchingNextPage:y}=Gi(h);let v;e[9]!==g.pages?(v=g.pages.flatMap(mm).filter(fm),e[9]=g.pages,e[10]=v):v=e[10];const k=v,j=Uf(k);let S;e[11]!==x||e[12]!==b||e[13]!==y?(S=()=>{b&&!y&&x()},e[11]=x,e[12]=b,e[13]=y,e[14]=S):S=e[14];const w=Ts(S,b??!1,y);let T;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==u||e[19]!==r||e[20]!==c||e[21]!==i?(T=a.jsx(xs,{thread:r,connections:o,virtualMcps:i,selectedIndex:u,total:c,onPrev:m,onNext:d}),e[15]=o,e[16]=d,e[17]=m,e[18]=u,e[19]=r,e[20]=c,e[21]=i,e[22]=T):T=e[22];let N;e[23]!==o||e[24]!==l||e[25]!==r||e[26]!==i?(N=a.jsx(cm,{thread:r,connections:o,virtualMcps:i,members:l}),e[23]=o,e[24]=l,e[25]=r,e[26]=i,e[27]=N):N=e[27];let C;e[28]!==y||e[29]!==w||e[30]!==j||e[31]!==k.length?(C=k.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No messages in this chat"}):a.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:a.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[j.map((M,A)=>a.jsx("div",{ref:A===j.length-1?w:void 0,children:a.jsx(Wf,{pair:M,isLastPair:A===j.length-1,status:"ready"})},`pair-${M.user?.id??M.assistant?.id}`)),y&&a.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"Loading more\\u2026"})]})}),e[28]=y,e[29]=w,e[30]=j,e[31]=k.length,e[32]=C):C=e[32];let I;return e[33]!==T||e[34]!==N||e[35]!==C?(I=a.jsxs(a.Fragment,{children:[T,N,C]}),e[33]=T,e[34]=N,e[35]=C,e[36]=I):I=e[36],I}function fm(t){return t.role==="user"||t.role==="assistant"}function mm(t){return t.items??[]}function pm(t,e){const n=t,s=e;if(!((n?.items?.length??0)<bs))return s.length*bs}function Ti(t){const e=P.c(39),{thread:n,client:s,locator:r,connections:o,virtualMcps:i,members:l,selectedIndex:u,total:c,onPrev:m,onNext:d}=t;let f;e[0]!==o||e[1]!==d||e[2]!==m||e[3]!==u||e[4]!==n||e[5]!==c||e[6]!==i?(f=a.jsx(xs,{thread:n,connections:o,virtualMcps:i,selectedIndex:u,total:c,onPrev:m,onNext:d}),e[0]=o,e[1]=d,e[2]=m,e[3]=u,e[4]=n,e[5]=c,e[6]=i,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Failed to load messages"}),e[8]=p):p=e[8];let h;e[9]!==f?(h=a.jsxs(a.Fragment,{children:[f,p]}),e[9]=f,e[10]=h):h=e[10];let g;e[11]!==o||e[12]!==d||e[13]!==m||e[14]!==u||e[15]!==n||e[16]!==c||e[17]!==i?(g=a.jsx(xs,{thread:n,connections:o,virtualMcps:i,selectedIndex:u,total:c,onPrev:m,onNext:d}),e[11]=o,e[12]=d,e[13]=m,e[14]=u,e[15]=n,e[16]=c,e[17]=i,e[18]=g):g=e[18];let x;e[19]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Loading conversation\\u2026"}),e[19]=x):x=e[19];let b;e[20]!==g?(b=a.jsxs(a.Fragment,{children:[g,x]}),e[20]=g,e[21]=b):b=e[21];let y;e[22]!==s||e[23]!==o||e[24]!==r||e[25]!==l||e[26]!==d||e[27]!==m||e[28]!==u||e[29]!==n||e[30]!==c||e[31]!==i?(y=a.jsx(dm,{client:s,locator:r,thread:n,connections:o,virtualMcps:i,members:l,selectedIndex:u,total:c,onPrev:m,onNext:d}),e[22]=s,e[23]=o,e[24]=r,e[25]=l,e[26]=d,e[27]=m,e[28]=u,e[29]=n,e[30]=c,e[31]=i,e[32]=y):y=e[32];let v;e[33]!==b||e[34]!==y?(v=a.jsx(_.Suspense,{fallback:b,children:y}),e[33]=b,e[34]=y,e[35]=v):v=e[35];let k;return e[36]!==h||e[37]!==v?(k=a.jsx(Ur,{fallback:h,children:v}),e[36]=h,e[37]=v,e[38]=k):k=e[38],k}const ys=50;function Gp(t){const e=P.c(29),{client:n,locator:s,membersData:r,allConnections:o,allVirtualMcps:i,dateRange:l,searchQuery:u,filterAgentIds:c,filterUserIds:m,filterStatus:d}=t,[f,p]=_.useState(null),h=l.startDate.toISOString(),g=l.endDate.toISOString(),x=JSON.stringify({startDate:h,endDate:g,search:u,agentIds:c,userIds:m,status:d}),{data:b,fetchNextPage:y,hasNextPage:v,isFetchingNextPage:k,isLoading:j}=Kr({queryKey:ke.threadsInfinite(s,x),queryFn:async U=>{const{pageParam:Z}=U,ne=Z===void 0?0:Z;if(!n)throw new Error("MCP client is not available");const _e=await n.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:ys,offset:ne,startDate:h,endDate:g,...u?{search:u}:{},...c&&c.length>0?{agentId:c[0]}:{},...m&&m.length>0?{userId:m[0]}:{},...d&&d!=="all"?{status:d}:{}}});return _e.structuredContent??_e},initialPageParam:0,getNextPageParam:vm,staleTime:3e4}),S=(b?.pages??[]).flatMap(ym),w=S.map(bm),{data:T}=Lt({queryKey:ke.monitoringThreadUsage(s,JSON.stringify({ids:w,startDate:h,endDate:g})),queryFn:async()=>{if(!n)throw new Error("MCP client is not available");const U=await n.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:w,startDate:h,endDate:g}});return U.structuredContent??U},enabled:!!n&&w.length>0,staleTime:3e4}),N=new Map((T?.items??[]).map(xm)),[C,I]=_.useState(null),[M,A]=_.useState("desc");let $;e[0]!==C?($=U=>{C===U?A(gm):(I(U),A("desc"))},e[0]=C,e[1]=$):$=e[1];const E=$,O=U=>{const Z=N.get(U);return Z?C==="cost"?Z.costUsd:Z.totalTokens:0},R=C?[...S].sort((U,Z)=>{const ne=O(U.id),_e=O(Z.id);return M==="desc"?_e-ne:ne-_e}):S,D=f!==null?R[f]??null:null;let H;e[2]!==y||e[3]!==v||e[4]!==k?(H=()=>{v&&!k&&y()},e[2]=y,e[3]=v,e[4]=k,e[5]=H):H=e[5];const K=Ts(H,v??!1,k),B=!!u||(c?.length??0)>0||(m?.length??0)>0||d&&d!=="all";let V;e[6]===Symbol.for("react.memo_cache_sentinel")?(V=()=>p(hm),e[6]=V):V=e[6];const Y=V,Q=()=>p(U=>U!==null&&U<R.length-1?U+1:U),J="flex-1 flex flex-col overflow-auto min-w-0",ee="mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",ce="flex-1 flex flex-col min-w-0",z="flex-1 min-w-0 pt-1",X="min-w-0",se=j?a.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})}):S.length===0?a.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:a.jsx(Qn,{title:B?"No matching chats":"No chats in this time range",description:B?"Try adjusting your filters or search query.":"Try expanding the time range to see older chats."})}):a.jsxs(a.Fragment,{children:[a.jsxs(Xr,{className:"w-full border-collapse",children:[a.jsx(Yr,{className:"border-b-0 z-20",children:a.jsxs(Tn,{className:"h-9 hover:bg-transparent border-b border-border",children:[a.jsx(ye,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Title"}),a.jsx(ye,{className:"w-36 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),a.jsx(ye,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),a.jsx(ye,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),a.jsx(ye,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a.jsxs("button",{type:"button",onClick:()=>E("tokens"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Tokens",C==="tokens"&&(M==="desc"?a.jsx(Wt,{size:12}):a.jsx(Jn,{size:12}))]})}),a.jsx(ye,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a.jsxs("button",{type:"button",onClick:()=>E("cost"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Cost",C==="cost"&&(M==="desc"?a.jsx(Wt,{size:12}):a.jsx(Jn,{size:12}))]})}),a.jsx(ye,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"})]})}),a.jsx(Qr,{children:R.map((U,Z)=>a.jsx(um,{thread:U,usage:N.get(U.id),members:r,connections:o,virtualMcps:i,onClick:()=>p(Z),lastRowRef:Z===R.length-1?K:void 0},U.id))})]}),k&&a.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more..."})]});let ie;e[7]!==se?(ie=a.jsx("div",{className:ee,children:a.jsx("div",{className:ce,children:a.jsx("div",{className:z,children:a.jsx("div",{className:X,children:se})})})}),e[7]=se,e[8]=ie):ie=e[8];const me=f!==null;let ze;e[9]===Symbol.for("react.memo_cache_sentinel")?(ze=U=>{U||p(null)},e[9]=ze):ze=e[9];let pe;e[10]!==o||e[11]!==i||e[12]!==n||e[13]!==R||e[14]!==Q||e[15]!==Y||e[16]!==s||e[17]!==r||e[18]!==D||e[19]!==f?(pe=D&&f!==null&&a.jsx(Ti,{thread:D,client:n,locator:s,connections:o,virtualMcps:i,members:r,selectedIndex:f,total:R.length,onPrev:Y,onNext:Q}),e[10]=o,e[11]=i,e[12]=n,e[13]=R,e[14]=Q,e[15]=Y,e[16]=s,e[17]=r,e[18]=D,e[19]=f,e[20]=pe):pe=e[20];let he;e[21]!==pe?(he=a.jsx(js,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:pe}),e[21]=pe,e[22]=he):he=e[22];let ge;e[23]!==me||e[24]!==he?(ge=a.jsx(ws,{open:me,onOpenChange:ze,children:he}),e[23]=me,e[24]=he,e[25]=ge):ge=e[25];let Pe;return e[26]!==ie||e[27]!==ge?(Pe=a.jsxs("div",{className:J,children:[ie,ge]}),e[26]=ie,e[27]=ge,e[28]=Pe):Pe=e[28],Pe}function hm(t){return t!==null&&t>0?t-1:t}function gm(t){return t==="desc"?"asc":"desc"}function xm(t){return[t.threadId,{calls:t.calls,inputTokens:t.inputTokens,outputTokens:t.outputTokens,totalTokens:t.totalTokens,costUsd:t.costUsd}]}function bm(t){return t.id}function ym(t){return t.items??[]}function vm(t,e){const n=t,s=e;if(!((n?.items?.length??0)<ys))return s.length*ys}const vs=50;function Ft(t){const e=P.c(10),{title:n,value:s,subtitle:r}=t;let o;e[0]!==n?(o=a.jsx("span",{className:"text-sm text-foreground/70",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==s?(i=a.jsx("span",{className:"text-3xl font-normal tabular-nums",children:s}),e[2]=s,e[3]=i):i=e[3];let l;e[4]!==r?(l=r&&a.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=l):l=e[5];let u;return e[6]!==o||e[7]!==i||e[8]!==l?(u=a.jsxs(Wi,{className:"pt-4 px-4 pb-5 gap-1",children:[o,i,l]}),e[6]=o,e[7]=i,e[8]=l,e[9]=u):u=e[9],u}function km(t){const e=P.c(27),{automationId:n,range:s}=t,{data:r,isLoading:o}=Vi(n,s),i=r?.runs,l=r?.usage;let u;e[0]!==i?(u=i&&i.total>0?`${Math.round(i.completed/i.total*100)}%`:"—",e[0]=i,e[1]=u):u=e[1];const c=u,m=l&&l.truncated?`last ${l.sampledRuns} runs`:void 0;let d;e[2]!==o||e[3]!==i?.total?(d=o?"…":i?.total.toLocaleString()??"0",e[2]=o,e[3]=i?.total,e[4]=d):d=e[4];const f=i?`${i.completed} ok · ${i.failed} failed${i.inProgress>0?` · ${i.inProgress} running`:""}`:void 0;let p;e[5]!==d||e[6]!==f?(p=a.jsx(Ft,{title:"Runs",value:d,subtitle:f}),e[5]=d,e[6]=f,e[7]=p):p=e[7];const h=o?"…":c;let g;e[8]!==h?(g=a.jsx(Ft,{title:"Success rate",value:h}),e[8]=h,e[9]=g):g=e[9];let x;e[10]!==o||e[11]!==l?.totalTokens?(x=o?"…":sr(l?.totalTokens??0),e[10]=o,e[11]=l?.totalTokens,e[12]=x):x=e[12];let b;e[13]!==x||e[14]!==m?(b=a.jsx(Ft,{title:"Tokens",value:x,subtitle:m}),e[13]=x,e[14]=m,e[15]=b):b=e[15];let y;e[16]!==o||e[17]!==l?(y=o?"…":l&&l.costUsd>0?rr(l.costUsd):"—",e[16]=o,e[17]=l,e[18]=y):y=e[18];let v;e[19]!==y||e[20]!==m?(v=a.jsx(Ft,{title:"Cost",value:y,subtitle:m}),e[19]=y,e[20]=m,e[21]=v):v=e[21];let k;return e[22]!==v||e[23]!==p||e[24]!==g||e[25]!==b?(k=a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[p,g,b,v]}),e[22]=v,e[23]=p,e[24]=g,e[25]=b,e[26]=k):k=e[26],k}function Sm(t){const e=P.c(39),{run:n,usage:s,onClick:r,lastRowRef:o}=t;let i,l;if(e[0]!==n.created_at){const T=new Date(n.created_at);i=T.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=T.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[0]=n.created_at,e[1]=i,e[2]=l}else i=e[1],l=e[2];const u=l,c=ct[n.status]??ct.completed,m=c.icon;let d;e[3]!==n.title?(d=a.jsx(ve,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:a.jsx("div",{className:"font-medium text-foreground truncate",children:n.title})}),e[3]=n.title,e[4]=d):d=e[4];let f;e[5]!==m||e[6]!==c.iconClassName?(f=a.jsx(m,{size:14,className:c.iconClassName}),e[5]=m,e[6]=c.iconClassName,e[7]=f):f=e[7];let p;e[8]!==c.labelColor?(p=q("text-sm",c.labelColor),e[8]=c.labelColor,e[9]=p):p=e[9];let h;e[10]!==c.label||e[11]!==p?(h=a.jsx("span",{className:p,children:c.label}),e[10]=c.label,e[11]=p,e[12]=h):h=e[12];let g;e[13]!==f||e[14]!==h?(g=a.jsx(ve,{className:"w-28 px-3",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[f,h]})}),e[13]=f,e[14]=h,e[15]=g):g=e[15];let x;e[16]!==s?(x=s?sr(s.totalTokens):"—",e[16]=s,e[17]=x):x=e[17];let b;e[18]!==x?(b=a.jsx(ve,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:x}),e[18]=x,e[19]=b):b=e[19];let y;e[20]!==s?(y=s&&s.costUsd>0?rr(s.costUsd):"—",e[20]=s,e[21]=y):y=e[21];let v;e[22]!==y?(v=a.jsx(ve,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:y}),e[22]=y,e[23]=v):v=e[23];let k;e[24]!==i?(k=a.jsx("div",{children:i}),e[24]=i,e[25]=k):k=e[25];let j;e[26]!==u?(j=a.jsx("div",{className:"text-xs text-muted-foreground/60",children:u}),e[26]=u,e[27]=j):j=e[27];let S;e[28]!==k||e[29]!==j?(S=a.jsxs(ve,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[k,j]}),e[28]=k,e[29]=j,e[30]=S):S=e[30];let w;return e[31]!==o||e[32]!==r||e[33]!==v||e[34]!==S||e[35]!==d||e[36]!==g||e[37]!==b?(w=a.jsxs(Tn,{ref:o,className:"h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:r,children:[d,g,b,v,S]}),e[31]=o,e[32]=r,e[33]=v,e[34]=S,e[35]=d,e[36]=g,e[37]=b,e[38]=w):w=e[38],w}function qp(t){const e=P.c(48),{automationId:n,triggerIds:s,range:r}=t,{org:o,locator:i}=He();let l;e[0]!==o.id||e[1]!==o.slug?(l={connectionId:Bi,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=l):l=e[2];const u=Ss(l),c=Zr(),m=Oi(),d=Ui(),{data:f}=Ki(),[p,h]=_.useState(null),g=s.length>0;let x;e[3]!==n||e[4]!==o.id||e[5]!==s?(x=ke.automationRuns(o.id,n,s),e[3]=n,e[4]=o.id,e[5]=s,e[6]=x):x=e[6];let b;e[7]!==c||e[8]!==s?(b=async z=>{const{pageParam:X}=z,se=X===void 0?0:X;return await c.call("COLLECTION_THREADS_LIST",{limit:vs,offset:se,where:{trigger_ids:s}})},e[7]=c,e[8]=s,e[9]=b):b=e[9];let y;e[10]!==g||e[11]!==x||e[12]!==b?(y={queryKey:x,queryFn:b,initialPageParam:0,getNextPageParam:Cm,enabled:g,staleTime:3e4},e[10]=g,e[11]=x,e[12]=b,e[13]=y):y=e[13];const{data:v,fetchNextPage:k,hasNextPage:j,isFetchingNextPage:S,isLoading:w}=Kr(y),T=(v?.pages??[]).flatMap(Nm),N=T.map(Tm),{data:C}=Lt({queryKey:ke.monitoringThreadUsage(i,JSON.stringify({ids:N,...r})),queryFn:async()=>await c.call("MONITORING_THREAD_USAGE",{threadIds:N,...r.startDate?{startDate:r.startDate}:{},...r.endDate?{endDate:r.endDate}:{}}),enabled:N.length>0,staleTime:3e4});let I;e[14]!==C?.items?(I=new Map((C?.items??[]).map(wm)),e[14]=C?.items,e[15]=I):I=e[15];const M=I;let A;e[16]!==k||e[17]!==j||e[18]!==S?(A=()=>{j&&!S&&k()},e[16]=k,e[17]=j,e[18]=S,e[19]=A):A=e[19];const $=Ts(A,j??!1,S),E=p!==null?T[p]??null:null;let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=()=>h(jm),e[20]=O):O=e[20];const R=O,D=()=>h(z=>z!==null&&z<T.length-1?z+1:z),H="flex flex-col gap-5";let F;e[21]!==n||e[22]!==r?(F=a.jsx(km,{automationId:n,range:r}),e[21]=n,e[22]=r,e[23]=F):F=e[23];const K=g?w?a.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading runs…"}):T.length===0?a.jsx("div",{className:"py-16",children:a.jsx(Qn,{title:"No runs yet",description:"This automation hasn't run yet. Trigger it or wait for a starter to fire."})}):a.jsxs(Xr,{className:"w-full border-collapse",children:[a.jsx(Yr,{className:"border-b-0",children:a.jsxs(Tn,{className:"h-9 hover:bg-transparent border-b border-border",children:[a.jsx(ye,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Run"}),a.jsx(ye,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),a.jsx(ye,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Tokens"}),a.jsx(ye,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Cost"}),a.jsx(ye,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Started"})]})}),a.jsx(Qr,{children:T.map((z,X)=>a.jsx(Sm,{run:z,usage:M.get(z.id),onClick:()=>h(X),lastRowRef:X===T.length-1?$:void 0},z.id))})]}):a.jsx("div",{className:"py-16",children:a.jsx(Qn,{title:"No starters yet",description:"Add a starter (cron, event, or webhook) to start collecting runs."})});let B;e[24]!==S?(B=S&&a.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more…"}),e[24]=S,e[25]=B):B=e[25];const V=p!==null;let Y;e[26]===Symbol.for("react.memo_cache_sentinel")?(Y=z=>{z||h(null)},e[26]=Y):Y=e[26];let Q;e[27]!==m||e[28]!==d||e[29]!==u||e[30]!==D||e[31]!==R||e[32]!==i||e[33]!==f||e[34]!==T||e[35]!==E||e[36]!==p?(Q=E&&p!==null&&a.jsx(Ti,{thread:E,client:u,locator:i,connections:m,virtualMcps:d,members:f,selectedIndex:p,total:T.length,onPrev:R,onNext:D}),e[27]=m,e[28]=d,e[29]=u,e[30]=D,e[31]=R,e[32]=i,e[33]=f,e[34]=T,e[35]=E,e[36]=p,e[37]=Q):Q=e[37];let J;e[38]!==Q?(J=a.jsx(js,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:Q}),e[38]=Q,e[39]=J):J=e[39];let ee;e[40]!==V||e[41]!==J?(ee=a.jsx(ws,{open:V,onOpenChange:Y,children:J}),e[40]=V,e[41]=J,e[42]=ee):ee=e[42];let ce;return e[43]!==K||e[44]!==B||e[45]!==ee||e[46]!==F?(ce=a.jsxs("div",{className:H,children:[F,K,B,ee]}),e[43]=K,e[44]=B,e[45]=ee,e[46]=F,e[47]=ce):ce=e[47],ce}function jm(t){return t!==null&&t>0?t-1:t}function wm(t){return[t.threadId,{calls:t.calls,inputTokens:t.inputTokens,outputTokens:t.outputTokens,totalTokens:t.totalTokens,costUsd:t.costUsd}]}function Tm(t){return t.id}function Nm(t){return t.items??[]}function Cm(t,e){const n=t,s=e;if(!((n?.items?.length??0)<vs))return s.length*vs}export{qp as A,Kp as B,Hp as C,wi as D,Gp as E,El as F,ju as G,An as M,vf as O,Cl as P,yu as R,$p as S,Dp as T,So as a,Pp as b,pu as c,wl as d,Mp as e,Sl as f,Ms as g,zp as h,Rp as i,Wf as j,Fp as k,yf as l,Bp as m,Op as n,vu as o,ku as p,Su as q,$u as r,Rs as s,Up as t,Uf as u,Wp as v,sr as w,rr as x,lm as y,Vp as z};
|