decocms 4.83.3 → 4.83.4
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-BltJ6Mxy.js → AlertCircle-Dq71LScH.js} +1 -1
- package/dist/client/assets/{AreaChart-CpBmNFZZ.js → AreaChart-Ckq4JiBW.js} +1 -1
- package/dist/client/assets/{ArrowUp-CYTVD4i5.js → ArrowUp-CslVDVm8.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-KZXrl8RO.js → ArrowUpRight-Bi_HBNws.js} +1 -1
- package/dist/client/assets/{CheckCircle-DPOzFR6K.js → CheckCircle-1OiOtWDi.js} +1 -1
- package/dist/client/assets/{ChevronDown-C45MJhf-.js → ChevronDown-POdyuGhT.js} +1 -1
- package/dist/client/assets/{ChevronRight-CHR9w0WV.js → ChevronRight-DrB8B6LZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-CB-gUWaQ.js → ChevronUp-C8m0cJLX.js} +1 -1
- package/dist/client/assets/{Copy01-DZXV6WTp.js → Copy01-CYlj1vxU.js} +1 -1
- package/dist/client/assets/{DotsVertical-DSgUvQkr.js → DotsVertical-Ca7b3C0v.js} +1 -1
- package/dist/client/assets/{Eye-1BqSeJXv.js → Eye-DfJT3UtK.js} +1 -1
- package/dist/client/assets/{FilterLines-Cwm6xDCE.js → FilterLines-Dvf7tHzR.js} +1 -1
- package/dist/client/assets/{Globe01-wTQLyGwk.js → Globe01-Ien-1Tkv.js} +1 -1
- package/dist/client/assets/{Globe04-pANVCUtg.js → Globe04-3rh6FP_k.js} +1 -1
- package/dist/client/assets/{HardDrive-krN3qYvB.js → HardDrive-BE24e46v.js} +1 -1
- package/dist/client/assets/{Image01-CaxE9zUG.js → Image01-l_Ll_rDB.js} +1 -1
- package/dist/client/assets/{Key01-B9xdnc8x.js → Key01-Dt-Yhou_.js} +1 -1
- package/dist/client/assets/{LayoutLeft-RhfSEkSx.js → LayoutLeft-DxSTvRB2.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CGTGYK0h.js → LinkExternal01-CG1PRc3_.js} +1 -1
- package/dist/client/assets/{Monitor01-1VmWHG0k.js → Monitor01-GhZQ4Kev.js} +1 -1
- package/dist/client/assets/{Package-CBorSvDN.js → Package-B3tirBOc.js} +1 -1
- package/dist/client/assets/{Palette-DLXcT5Ip.js → Palette-DSb-jKRY.js} +1 -1
- package/dist/client/assets/{Play-Z-EfnT2J.js → Play-DYkfGaNO.js} +1 -1
- package/dist/client/assets/{Plus-ej4sfxWI.js → Plus-BUg9xI0h.js} +1 -1
- package/dist/client/assets/{SearchLg-COXRq0kg.js → SearchLg-DKMN0iwm.js} +1 -1
- package/dist/client/assets/{SearchMd-iOyrzKSR.js → SearchMd-C_pleyIU.js} +1 -1
- package/dist/client/assets/{Settings02-DO3c0hUy.js → Settings02-Cd8o3xNO.js} +1 -1
- package/dist/client/assets/{Shield01-BVDyEJiQ.js → Shield01-CwTanxWb.js} +1 -1
- package/dist/client/assets/{Star01-DvzIremA.js → Star01-D4N4byzx.js} +1 -1
- package/dist/client/assets/{Stars01-_V87SU19.js → Stars01-BGgTThTG.js} +1 -1
- package/dist/client/assets/{Stars02-B_knJhjE.js → Stars02-BJyIedKc.js} +1 -1
- package/dist/client/assets/{Sun-NA0W5K4z.js → Sun-DWhn4gR_.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-8mukXik8.js → SwitchHorizontal01-qLYK_wFI.js} +1 -1
- package/dist/client/assets/{Tool01-BKz30703.js → Tool01-CP_Ef4Y_.js} +1 -1
- package/dist/client/assets/{Tool02-DF4wEV0L.js → Tool02-D7oSQJgI.js} +1 -1
- package/dist/client/assets/{Trash01-DXhAjasB.js → Trash01-CxBlA1E7.js} +1 -1
- package/dist/client/assets/{TrendUp01-CdPwIZPG.js → TrendUp01-DuD7hG_1.js} +1 -1
- package/dist/client/assets/{Upload01-CMdpXxUq.js → Upload01-Cqn0OezE.js} +1 -1
- package/dist/client/assets/{User01-xcnOfGdh.js → User01-Byo1af9Z.js} +1 -1
- package/dist/client/assets/{Users01-DMgMrzjc.js → Users01-D5HJa4UA.js} +1 -1
- package/dist/client/assets/{Users03-CWA_havj.js → Users03-BWGlmViM.js} +1 -1
- package/dist/client/assets/{X-Cp0AjBA7.js → X-BlDFTg97.js} +1 -1
- package/dist/client/assets/{XCircle-BqELyRTX.js → XCircle-WQBMODEn.js} +1 -1
- package/dist/client/assets/{XClose-D0hPWJkK.js → XClose-CVZk1vk3.js} +1 -1
- package/dist/client/assets/{Zap-B6vin2-a.js → Zap-BDEn1Om0.js} +1 -1
- package/dist/client/assets/{ZapSquare-7Fs9X9Yr.js → ZapSquare-DALy5P51.js} +1 -1
- package/dist/client/assets/{ZoomOut-BZTnbhP5.js → ZoomOut-ByJ0JnTP.js} +1 -1
- package/dist/client/assets/{access-gate-BAdn8IKr.js → access-gate-ChLcg5Nd.js} +1 -1
- package/dist/client/assets/{add-section-modal-C7NHNNt8.js → add-section-modal-BlRNYZcb.js} +1 -1
- package/dist/client/assets/{agent-icon-CiTl48Lp.js → agent-icon-13Bvgd_j.js} +1 -1
- package/dist/client/assets/{agents-list-DXybhKZv.js → agents-list-Bak0EL7o.js} +1 -1
- package/dist/client/assets/{ai-providers-BbLHsSyx.js → ai-providers-wFCpAyP7.js} +1 -1
- package/dist/client/assets/{alert-CmpwLqbe.js → alert-BhdYjs4a.js} +1 -1
- package/dist/client/assets/{alert-dialog-DJrtDnJO.js → alert-dialog-CmXFyCvD.js} +1 -1
- package/dist/client/assets/{app-editor-bZcSnRmV.js → app-editor-0qR2Au3G.js} +1 -1
- package/dist/client/assets/{auth-XnxxEwr5.js → auth-D4pinPO_.js} +1 -1
- package/dist/client/assets/{auth-catchall-Cxl-yjdb.js → auth-catchall-BE9pEcVu.js} +1 -1
- package/dist/client/assets/{auth-entry-CUL8UkSt.js → auth-entry-_t1zy1On.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DG68ggR0.js → auth-split-layout-BrMRPVvG.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CnLRGoBM.js → authenticate-and-persist-oauth-C9wYzLvE.js} +1 -1
- package/dist/client/assets/{automation-list-row-Nkaziv9h.js → automation-list-row-CzUMlQAq.js} +1 -1
- package/dist/client/assets/{automation-runs-BenCurrg.js → automation-runs-OWgoSJa3.js} +1 -1
- package/dist/client/assets/{automations-CN2atgME.js → automations-BSThGLPn.js} +1 -1
- package/dist/client/assets/{autosend-CRJdeC5_.js → autosend-CHx4-yd0.js} +1 -1
- package/dist/client/assets/{avatar-DT0rqDqr.js → avatar-C1heVpGY.js} +1 -1
- package/dist/client/assets/{badge-D5s1860l.js → badge-BNRAw8Bb.js} +1 -1
- package/dist/client/assets/{block-document-BETOwKGe.js → block-document-ih0h-AsW.js} +1 -1
- package/dist/client/assets/{brand-context-FdUTKfJ5.js → brand-context-zAGFYiki.js} +1 -1
- package/dist/client/assets/{buckets-Cm0SFAz6.js → buckets-BEFMJJxn.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CAjGF-JB.js → bulk-category-panel-DOkQqtZ_.js} +1 -1
- package/dist/client/assets/{calendar-DiYxbOe7.js → calendar-DfaRfulu.js} +1 -1
- package/dist/client/assets/{capability-load-error-DBEbnF7l.js → capability-load-error-BRtl8R4o.js} +1 -1
- package/dist/client/assets/{card-CVF2Z9or.js → card-CQoP9MfL.js} +1 -1
- package/dist/client/assets/{category-editor-Bkgj4nFa.js → category-editor-DI2hqimO.js} +1 -1
- package/dist/client/assets/{chat-context-DScS8psZ.js → chat-context-BsaCa_DG.js} +1 -1
- package/dist/client/assets/{checkbox-CGSFVz1t.js → checkbox-C3x2xy3e.js} +1 -1
- package/dist/client/assets/{cli-auth-success-qa5qg70-.js → cli-auth-success-Fai5s8yh.js} +1 -1
- package/dist/client/assets/{collection-detail-CF8M49Qs.js → collection-detail-ennSOjUy.js} +1 -1
- package/dist/client/assets/{collection-display-button-CF7J4NNk.js → collection-display-button-D9w0IGfJ.js} +1 -1
- package/dist/client/assets/{collection-search-Bmr4mXA3.js → collection-search-CGK9Tjv1.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CxCCI34M.js → collection-table-wrapper-BZokjb7V.js} +1 -1
- package/dist/client/assets/{collection-tabs-DoS3HsFI.js → collection-tabs-D085OI97.js} +1 -1
- package/dist/client/assets/{command-D5O8bF71.js → command-BIwzkDTa.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-3IK04tR5.js → commerce-onboarding-CYR4Ibo2.js} +1 -1
- package/dist/client/assets/{companions-core-BSZhKLdK.js → companions-core-CXjW5j0k.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-WvKkzanr.js → connect-desktop-dialog-B6JSQZbl.js} +1 -1
- package/dist/client/assets/{connection-card-CXz46t4H.js → connection-card-ChdEy0aa.js} +1 -1
- package/dist/client/assets/{connection-detail-BFIeDvSU.js → connection-detail-BL9gs4gZ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D66YZrv9.js → connection-form-helpers-BW_OXgrR.js} +1 -1
- package/dist/client/assets/{connections-DQYFyP0N.js → connections-DZaGf7ri.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-fzCZV2FF.js → decopilot-sse-pool-DP5wFK-s.js} +1 -1
- package/dist/client/assets/{dialog-Bj2fsNVF.js → dialog-C_DVh6dL.js} +1 -1
- package/dist/client/assets/{domain-settings-D9TDhUUP.js → domain-settings-Cj-3tRjQ.js} +1 -1
- package/dist/client/assets/{drawer-hSJSV0VX.js → drawer-CSWG6-lE.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BmnVEK9j.js → dropdown-menu-BPdwP-Cq.js} +1 -1
- package/dist/client/assets/{empty-state-CrwQiRbh.js → empty-state-eym_qidP.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CLHklHMt.js → extract-connection-data-BDUkkovZ.js} +1 -1
- package/dist/client/assets/{file-explorer-JDQR3igJ.js → file-explorer-CRXt_uzp.js} +1 -1
- package/dist/client/assets/{file-type-icon-CjtW_EKu.js → file-type-icon-Dw6g3RvK.js} +1 -1
- package/dist/client/assets/{files-apXzYOOV.js → files-CrQJOLBS.js} +1 -1
- package/dist/client/assets/{form-B3ss7zyz.js → form-DbFG2gV9.js} +1 -1
- package/dist/client/assets/{general-CrEhsdbc.js → general-B-uXj50R.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CV_vV32R.js → github-repo-picker-mgwh4S43.js} +1 -1
- package/dist/client/assets/{hooks-DoJbaPOb.js → hooks-BbLNuUpJ.js} +1 -1
- package/dist/client/assets/{index-DiuL6IYC.js → index-B2pGTgfd.js} +1 -1
- package/dist/client/assets/{index-D2D4iP55.js → index-BJhuA1NC.js} +1 -1
- package/dist/client/assets/{index-DpwkyCAS.js → index-BK8QLtZw.js} +5 -5
- package/dist/client/assets/{index-ZkHeR0Y8.js → index-C-nnw44A.js} +1 -1
- package/dist/client/assets/{index-Bwr7A1e6.js → index-CVMmEe4k.js} +1 -1
- package/dist/client/assets/{index-ChwM9l4E.js → index-CXfpC-Ac.js} +1 -1
- package/dist/client/assets/{index-CRIurAz3.js → index-Cm_7pLUJ.js} +1 -1
- package/dist/client/assets/{index-C6VQmb5F.js → index-DChE5Bom.js} +2 -2
- package/dist/client/assets/{index-CXPjVFaQ.js → index-DPftLDJB.js} +1 -1
- package/dist/client/assets/{index-B33lgsZX.js → index-DeTt8kcD.js} +1 -1
- package/dist/client/assets/{index-DEs_ACwv.js → index-DhAwrPkw.js} +1 -1
- package/dist/client/assets/{index-CPw65aX_.js → index-Hhp9Cp4W.js} +1 -1
- package/dist/client/assets/{index-Cy6iEpAK.js → index-jpjInX7o.js} +1 -1
- package/dist/client/assets/{index-CPzeLvpv.js → index-qXbPtiGF.js} +3 -3
- package/dist/client/assets/{index-redirect-BPlGr-30.js → index-redirect-Dqyvvfcm.js} +1 -1
- package/dist/client/assets/{input-CFDlaaLx.js → input-C_tu8il1.js} +1 -1
- package/dist/client/assets/{integration-icon-NExukTTe.js → integration-icon-DSlodAQt.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BJLxJtbe.js → invite-member-dialog-CQTysMtI.js} +1 -1
- package/dist/client/assets/{label-Bgzv3znS.js → label-D3i55MXt.js} +1 -1
- package/dist/client/assets/{layout-DYGKorBw.js → layout-DJPD-zXs.js} +1 -1
- package/dist/client/assets/{login-Cvh9vDq0.js → login-DNzBnWQ5.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CWoNDceu.js → mcp-oauth-DoJRBeY3.js} +1 -1
- package/dist/client/assets/{members-B50cQweG.js → members-Dpg145Hf.js} +1 -1
- package/dist/client/assets/{monaco-editor-DtQbtFXR.js → monaco-editor-DcX3oP6C.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B1eJJCdW.js → monitoring-stats-row-LuHWjTET.js} +1 -1
- package/dist/client/assets/{multi-select-DrL-uXbn.js → multi-select-CYdmy4Og.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CprzbTec.js → oauth-callback-ai-provider-Dfpj5oWA.js} +1 -1
- package/dist/client/assets/{oauth-callback-CkwzDC9j.js → oauth-callback-pUkfQfMd.js} +1 -1
- package/dist/client/assets/{onboarding-DTua64Pc.js → onboarding-DNeHc1ru.js} +1 -1
- package/dist/client/assets/{org-install-DwOf4OfV.js → org-install-C3kI0mkw.js} +1 -1
- package/dist/client/assets/{org-layout-BDvFD0BL.js → org-layout-DNiDYiLp.js} +1 -1
- package/dist/client/assets/{organization-choice-ah0QzZh1.js → organization-choice-4CoDbXZP.js} +1 -1
- package/dist/client/assets/{orgs-ByzWwqO1.js → orgs-Dv5bUNJq.js} +1 -1
- package/dist/client/assets/{page-seo-form-CshzPKTn.js → page-seo-form-C0Sy1bZJ.js} +1 -1
- package/dist/client/assets/page-seo-sheet-C2UuWJZm.js +1 -0
- package/dist/client/assets/{popover-GLcqGwrV.js → popover-7b1YDSgF.js} +1 -1
- package/dist/client/assets/{post-editor-DpddhNpN.js → post-editor-BcH5jm4R.js} +1 -1
- package/dist/client/assets/{primitives-FkszfdyS.js → primitives-CZE3Zj9J.js} +1 -1
- package/dist/client/assets/{profile-CAD2WOKv.js → profile-De_kH3tl.js} +1 -1
- package/dist/client/assets/project-app-view-Bwb8NSAL.js +1 -0
- package/dist/client/assets/record-editor-DsxlLgFk.js +1 -0
- package/dist/client/assets/redirect-editor-CZaippfv.js +1 -0
- package/dist/client/assets/registry-D-PlHzAu.js +2 -0
- package/dist/client/assets/{registry-layout-CL3Ink_2.js → registry-layout-CnP4FzmH.js} +1 -1
- package/dist/client/assets/{reports-SAtCXsub.js → reports-D4omL7oj.js} +1 -1
- package/dist/client/assets/{require-capability-B1PN0eEj.js → require-capability-CTzhtp87.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DJoWkQKd.js → required-auth-layout-Zgv6tcuN.js} +1 -1
- package/dist/client/assets/{reset-password-CKUS_wS4.js → reset-password-C_wWsQNG.js} +1 -1
- package/dist/client/assets/{roles-HgnqbuYI.js → roles-D36jMnuu.js} +1 -1
- package/dist/client/assets/{search-input-DMH0FqNh.js → search-input-ao3k3c0D.js} +1 -1
- package/dist/client/assets/{secrets-BbPkTbrF.js → secrets-BjXUT4hY.js} +1 -1
- package/dist/client/assets/{sections-editor-7KIVS72T.js → sections-editor-DRAKYTV5.js} +1 -1
- package/dist/client/assets/{select-F9_kjFJU.js → select-1ex5I1Wu.js} +1 -1
- package/dist/client/assets/{select-model-BDck7HMW.js → select-model-DXud9cTq.js} +1 -1
- package/dist/client/assets/{self-tool-result-idl7McJq.js → self-tool-result-DTDV3Ahy.js} +1 -1
- package/dist/client/assets/{seo-editor-Idy1rbrU.js → seo-editor-DYgg4g3Y.js} +1 -1
- package/dist/client/assets/{settings-layout-jrS1vUNa.js → settings-layout-DXfugPpX.js} +1 -1
- package/dist/client/assets/{settings-section-LyNFY3FV.js → settings-section-DlT1IwEY.js} +1 -1
- package/dist/client/assets/{shell-controls-Av5g79-9.js → shell-controls-hiq_01H0.js} +1 -1
- package/dist/client/assets/{shell-layout-IGy4w-JV.js → shell-layout-CK8b_Pp9.js} +1 -1
- package/dist/client/assets/{sidebar-DxJ46dNl.js → sidebar-y-EH5KNk.js} +1 -1
- package/dist/client/assets/{skeleton-C637U3CZ.js → skeleton-C6ZVkGcB.js} +1 -1
- package/dist/client/assets/{sso-Bp6hOV1O.js → sso-5UVKnVh3.js} +1 -1
- package/dist/client/assets/{store-BDc_Jqkn.js → store-Z10-0DQr.js} +1 -1
- package/dist/client/assets/store-registry-JaoROLBU.js +2 -0
- package/dist/client/assets/{studio-tools-BiScRaZ9.js → studio-tools-DtJF9wPb.js} +1 -1
- package/dist/client/assets/{switch-D3PUOhLK.js → switch-COqizKS4.js} +1 -1
- package/dist/client/assets/{table-Bn_rEvE7.js → table-BgKMl0Qy.js} +1 -1
- package/dist/client/assets/{tabs-QJA2yUyz.js → tabs-DDIFUI8M.js} +1 -1
- package/dist/client/assets/{textarea-V8pv1dNk.js → textarea-DLQiN6V-.js} +1 -1
- package/dist/client/assets/{toggle-group-Bf4mxsLh.js → toggle-group-CJG0K9zW.js} +1 -1
- package/dist/client/assets/{toolbar-ZdT33O-6.js → toolbar-BLsTe09-.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-By0yIGM8.js → toolbar-icon-button-jaBG4ceL.js} +1 -1
- package/dist/client/assets/{tooltip-CvQZg4vG.js → tooltip-BpxP2DIm.js} +1 -1
- package/dist/client/assets/{use-ai-providers-D03RDptV.js → use-ai-providers-6fLuh8sV.js} +1 -1
- package/dist/client/assets/{use-automations-BvRj5P6v.js → use-automations-DnCJo6ng.js} +1 -1
- package/dist/client/assets/{use-autosave-BiViXaqh.js → use-autosave-CnJzANeu.js} +1 -1
- package/dist/client/assets/{use-capability-C-oXXYJQ.js → use-capability-eNg2RGCV.js} +1 -1
- package/dist/client/assets/{use-clock-tick-hXpFWi6j.js → use-clock-tick-BFPeLZ9c.js} +1 -1
- package/dist/client/assets/{use-collections-DYdGIg5l.js → use-collections-X_XL1Bcx.js} +1 -1
- package/dist/client/assets/{use-connection-BML2TUoy.js → use-connection-CN0lagty.js} +1 -1
- package/dist/client/assets/{use-copy-B5uGqyuR.js → use-copy-Brp3DVIx.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BcX_Kv1b.js → use-create-virtual-mcp-D-Vle1-t.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-lgc7ocLL.js → use-debounced-autosave-BL-2hHlb.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C2skJpvP.js → use-debounced-value-CdcEoo7h.js} +1 -1
- package/dist/client/assets/{use-deco-credits-sZO5ip0G.js → use-deco-credits-x20cNm88.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-QTK5Zo8O.js → use-decopilot-events-BxZWOpPz.js} +1 -1
- package/dist/client/assets/{use-delete-connection-C2Jvej_H.js → use-delete-connection-XFmtxA6F.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Bq6GrMmu.js → use-deployment-admin-CV5tUw0t.js} +1 -1
- package/dist/client/assets/{use-file-configs-CDTlNU2y.js → use-file-configs-CNLcWxP1.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Bs4b3CKK.js → use-infinite-scroll-B12bE3UU.js} +1 -1
- package/dist/client/assets/{use-join-requests-DJ8netHm.js → use-join-requests-BMFjJIIt.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BzksUW9C.js → use-mcp-auth-status-CZ1xNxZF.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cr0wl_bf.js → use-mcp-client-Cq4GaR34.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Csk7sq3g.js → use-mcp-tools-DMnQDeEU.js} +1 -1
- package/dist/client/assets/{use-members-DBIzFrsq.js → use-members-DFgtu823.js} +1 -1
- package/dist/client/assets/{use-mobile-8fjZ_ok-.js → use-mobile-CHEsWJnr.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CnqkxH4A.js → use-navigate-to-agent-CmyTZsoC.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C-dIfIJP.js → use-org-auth-client-BewuNLzq.js} +1 -1
- package/dist/client/assets/{use-org-sso-HcIGfZK6.js → use-org-sso-BBjCi5h1.js} +1 -1
- package/dist/client/assets/{use-organization-roles-D-ou5XCB.js → use-organization-roles-BfJmBw1Z.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CwpCXpKR.js → use-organization-settings-BmBx1BVI.js} +1 -1
- package/dist/client/assets/{use-registry-app-CGrH5ox5.js → use-registry-app-Dz5-9bc9.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CXPOqhcO.js → use-registry-connections-CT3gQtE0.js} +1 -1
- package/dist/client/assets/{use-secrets-D1Oh6QRL.js → use-secrets-BcQyOE4x.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DTrbbuq0.js → use-status-sounds-B14x8Nc1.js} +1 -1
- package/dist/client/assets/{use-view-mode-298quQE5.js → use-view-mode-CPxZs2eP.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-TVYmV-RO.js → use-virtual-mcp-Bb8jRLD4.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Buq4C2cO.js +1 -0
- package/dist/client/assets/{useRouterState-ccAaKn3U.js → useRouterState-pWHcFfTc.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C-bWKmpj.js +1 -0
- package/dist/client/assets/{users-B-K71hUj.js → users-BhqqauRQ.js} +1 -1
- package/dist/client/assets/{variant-calendar-FX999I3r.js → variant-calendar-5w1WI5ak.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Cisl2Dwz.js → view-mode-toggle-eXp0bn16.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +417 -417
- package/dist/server/migrate.js +91 -91
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/page-seo-sheet-CqFzDweu.js +0 -1
- package/dist/client/assets/project-app-view-BAu-8uvc.js +0 -1
- package/dist/client/assets/record-editor-C9c7AHCv.js +0 -1
- package/dist/client/assets/redirect-editor-DrMKfK1Y.js +0 -1
- package/dist/client/assets/registry-AFJkCX6L.js +0 -2
- package/dist/client/assets/store-registry-DyW2rI_N.js +0 -2
- package/dist/client/assets/useInfiniteQuery-gX0RVYjX.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bjo2O8qN.js +0 -1
package/dist/client/assets/{automation-list-row-Nkaziv9h.js → automation-list-row-CzUMlQAq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,r as F,l as $,j as t,B as K}from"./index-
|
|
1
|
+
import{c as E,r as F,l as $,j as t,B as K}from"./index-qXbPtiGF.js";import{b as O,d as B,e as I,g as L,c as H,A as V,a as q,f as G}from"./alert-dialog-CmXFyCvD.js";import{a as J,D as Q,c as U,d as W}from"./dropdown-menu-BPdwP-Cq.js";import{s as X}from"./Stars02-BJyIedKc.js";import{i as Y}from"./DotsVertical-Ca7b3C0v.js";import{s as Z}from"./Trash01-CxBlA1E7.js";import{i as ee}from"./Zap-BDEn1Om0.js";import{a as te}from"./use-virtual-mcp-Bb8jRLD4.js";import{A as se}from"./agent-icon-13Bvgd_j.js";import{u as ne}from"./use-automations-DnCJo6ng.js";function he(a){const e=E.c(53),{automation:s,showAgent:n,onClick:r}=a,{remove:i}=ne(),[P,S]=F.useState(!1),o=te(n?s.virtual_mcp_id:void 0);let D;e[0]!==s.id||e[1]!==i?(D=()=>{i.mutate(s.id),S(!1)},e[0]=s.id,e[1]=i,e[2]=D):D=e[2];const z=D;let A;e[3]!==r?(A=l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},e[3]=r,e[4]=A):A=e[4];const T=A,M=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let c;e[5]!==M?(c=$("inline-block size-2 rounded-full shrink-0",M),e[5]=M,e[6]=c):c=e[6];const R=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let m;e[7]!==c||e[8]!==R?(m=t.jsx("span",{className:c,"aria-label":R}),e[7]=c,e[8]=R,e[9]=m):m=e[9];let u;e[10]!==o?.icon||e[11]!==o?.title||e[12]!==s.name||e[13]!==n?(u=n&&t.jsx(se,{icon:o?.icon??null,name:o?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=o?.icon,e[11]=o?.title,e[12]=s.name,e[13]=n,e[14]=u):u=e[14];let d;e[15]!==s.name?(d=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=d):d=e[16];let g;e[17]!==o||e[18]!==n?(g=n&&o&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",o.title]}),e[17]=o,e[18]=n,e[19]=g):g=e[19];let f;e[20]!==d||e[21]!==g?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,g]}),e[20]=d,e[21]=g,e[22]=f):f=e[22];let x;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(x=t.jsx(oe,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=x):x=e[25];let p;e[26]!==f||e[27]!==x?(p=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[f,x]}),e[26]=f,e[27]=x,e[28]=p):p=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(J,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(Y,{size:16})})}),e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{onClick:ie,onKeyDown:re,role:"presentation",className:"shrink-0",children:t.jsxs(Q,{children:[N,t.jsx(U,{align:"end",children:t.jsxs(W,{variant:"destructive",onClick:l=>{l.stopPropagation(),S(!0)},children:[t.jsx(Z,{size:16}),"Delete"]})})]})}),e[30]=y):y=e[30];let h;e[31]!==T||e[32]!==r||e[33]!==p||e[34]!==m||e[35]!==u?(h=t.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:T,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m,u,p,y]}),e[31]=T,e[32]=r,e[33]=p,e[34]=m,e[35]=u,e[36]=h):h=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(H,{children:"Delete automation?"}),e[37]=w):w=e[37];let j;e[38]!==s.name?(j=t.jsxs(O,{children:[w,t.jsxs(B,{children:["This removes"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let C;e[40]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(V,{children:"Cancel"}),e[40]=C):C=e[40];let _;e[41]!==z||e[42]!==i.isPending?(_=t.jsxs(I,{children:[C,t.jsx(L,{onClick:z,disabled:i.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=z,e[42]=i.isPending,e[43]=_):_=e[43];let v;e[44]!==j||e[45]!==_?(v=t.jsxs(q,{children:[j,_]}),e[44]=j,e[45]=_,e[46]=v):v=e[46];let b;e[47]!==P||e[48]!==v?(b=t.jsx(G,{open:P,onOpenChange:S,children:v}),e[47]=P,e[48]=v,e[49]=b):b=e[49];let k;return e[50]!==h||e[51]!==b?(k=t.jsxs(t.Fragment,{children:[h,b]}),e[50]=h,e[51]=b,e[52]=k):k=e[52],k}function re(a){return a.stopPropagation()}function ie(a){return a.stopPropagation()}function oe(a){const e=E.c(4),{triggerCount:s,nextRunAt:n}=a;if(s===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=i):i=e[0],i}let r;return e[1]!==n||e[2]!==s?(r=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?t.jsxs(t.Fragment,{children:[t.jsx(X,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx(ee,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{he as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
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-CPzeLvpv.js";import{e as $i}from"./select-F9_kjFJU.js";import{u as Kr}from"./useInfiniteQuery-gX0RVYjX.js";import{a as Vr,u as Oi}from"./use-connection-BML2TUoy.js";import{h as Di,u as Ss,b as Hi,i as zi,a as Fi,S as Bi}from"./use-mcp-client-Cr0wl_bf.js";import{u as Ui}from"./use-virtual-mcp-TVYmV-RO.js";import{C as Wi}from"./card-CVF2Z9or.js";import{o as Gr,m as qr,p as js,q as ws}from"./sidebar-DxJ46dNl.js";import{c as Xr,d as Yr,a as Tn,e as ye,b as Qr,T as ve}from"./table-Bn_rEvE7.js";import{E as Qn}from"./empty-state-CrwQiRbh.js";import{u as Ts}from"./use-infinite-scroll-Bs4b3CKK.js";import{u as Ki}from"./use-members-DBIzFrsq.js";import{u as Jr,S as ct}from"./use-clock-tick-hXpFWi6j.js";import{e as Vi}from"./use-automations-BvRj5P6v.js";import{u as Zr}from"./studio-tools-BiScRaZ9.js";import{u as Gi}from"./useSuspenseInfiniteQuery-Bjo2O8qN.js";import{A as eo}from"./avatar-DT0rqDqr.js";import{t as Wt}from"./ChevronDown-C45MJhf-.js";import{i as Ns,n as Jn}from"./ChevronUp-CB-gUWaQ.js";import{t as qi,a as to,n as Cs}from"./Tool02-DF4wEV0L.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-CiTl48Lp.js";import{t as Nn}from"./Stars01-_V87SU19.js";import{i as ro,b as Rt}from"./XCircle-BqELyRTX.js";import{i as ur}from"./ChevronRight-CHR9w0WV.js";import{a as oo}from"./Copy01-DZXV6WTp.js";import{b as Ve,t as _s,c as dr}from"./format-time-BnbuEtat.js";import{u as io}from"./use-copy-B5uGqyuR.js";import{T as nt,a as st,b as rt}from"./tooltip-CvQZg4vG.js";import{M as As,I as ao,F as la}from"./file-type-icon-CjtW_EKu.js";import{R as ca,c as ua,r as da,g as fa}from"./hooks-DoJbaPOb.js";import{S as ma,h as pt,m as pa,c as Is,d as ha,b as ga}from"./chat-context-DScS8psZ.js";import{c as xa}from"./monaco-editor-DtQbtFXR.js";import{g as lo,M as ba}from"./index-D2D4iP55.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-DiYxbOe7.js";import{i as po}from"./AlertCircle-BltJ6Mxy.js";import{s as Va}from"./Eye-1BqSeJXv.js";import{s as Kt,t as ho}from"./Star01-DvzIremA.js";import{s as Ga}from"./XClose-D0hPWJkK.js";import{n as ts}from"./ZapSquare-7Fs9X9Yr.js";import{n as go,i as qa}from"./Globe01-wTQLyGwk.js";import{c as Xa,b as Ya}from"./Tool01-BKz30703.js";import{i as pr,a as Qa}from"./ZoomOut-BZTnbhP5.js";import{i as yt}from"./Monitor01-1VmWHG0k.js";import{i as Ja}from"./SearchMd-iOyrzKSR.js";import{i as Za}from"./Upload01-CMdpXxUq.js";import{u as el,a as tl}from"./shell-layout-IGy4w-JV.js";import{a as Pt}from"./Image01-CaxE9zUG.js";import{n as xo}from"./LinkExternal01-CGTGYK0h.js";import{I as qe}from"./integration-icon-NExukTTe.js";import{i as nl}from"./ArrowUpRight-KZXrl8RO.js";import{a as Ls}from"./Users03-CWA_havj.js";import{a as Me}from"./Palette-DLXcT5Ip.js";import{c as bo}from"./use-navigate-to-agent-CnqkxH4A.js";import{a as sl}from"./Stars02-B_knJhjE.js";import{g as rl}from"./AreaChart-CpBmNFZZ.js";import{a as ol,D as il,c as al,d as ll,e as cl}from"./dialog-Bj2fsNVF.js";import{a as ul,F as dl,b as fl,c as ml,d as pl,f as hl}from"./form-B3ss7zyz.js";import{I as gl}from"./input-CFDlaaLx.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(`
|
|
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-qXbPtiGF.js";import{e as $i}from"./select-1ex5I1Wu.js";import{u as Kr}from"./useInfiniteQuery-Buq4C2cO.js";import{a as Vr,u as Oi}from"./use-connection-CN0lagty.js";import{h as Di,u as Ss,b as Hi,i as zi,a as Fi,S as Bi}from"./use-mcp-client-Cq4GaR34.js";import{u as Ui}from"./use-virtual-mcp-Bb8jRLD4.js";import{C as Wi}from"./card-CQoP9MfL.js";import{o as Gr,m as qr,p as js,q as ws}from"./sidebar-y-EH5KNk.js";import{c as Xr,d as Yr,a as Tn,e as ye,b as Qr,T as ve}from"./table-BgKMl0Qy.js";import{E as Qn}from"./empty-state-eym_qidP.js";import{u as Ts}from"./use-infinite-scroll-B12bE3UU.js";import{u as Ki}from"./use-members-DFgtu823.js";import{u as Jr,S as ct}from"./use-clock-tick-BFPeLZ9c.js";import{e as Vi}from"./use-automations-DnCJo6ng.js";import{u as Zr}from"./studio-tools-DtJF9wPb.js";import{u as Gi}from"./useSuspenseInfiniteQuery-C-bWKmpj.js";import{A as eo}from"./avatar-C1heVpGY.js";import{t as Wt}from"./ChevronDown-POdyuGhT.js";import{i as Ns,n as Jn}from"./ChevronUp-C8m0cJLX.js";import{t as qi,a as to,n as Cs}from"./Tool02-D7oSQJgI.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-13Bvgd_j.js";import{t as Nn}from"./Stars01-BGgTThTG.js";import{i as ro,b as Rt}from"./XCircle-WQBMODEn.js";import{i as ur}from"./ChevronRight-DrB8B6LZ.js";import{a as oo}from"./Copy01-CYlj1vxU.js";import{b as Ve,t as _s,c as dr}from"./format-time-BnbuEtat.js";import{u as io}from"./use-copy-Brp3DVIx.js";import{T as nt,a as st,b as rt}from"./tooltip-BpxP2DIm.js";import{M as As,I as ao,F as la}from"./file-type-icon-Dw6g3RvK.js";import{R as ca,c as ua,r as da,g as fa}from"./hooks-BbLNuUpJ.js";import{S as ma,h as pt,m as pa,c as Is,d as ha,b as ga}from"./chat-context-BsaCa_DG.js";import{c as xa}from"./monaco-editor-DcX3oP6C.js";import{g as lo,M as ba}from"./index-BJhuA1NC.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-DfaRfulu.js";import{i as po}from"./AlertCircle-Dq71LScH.js";import{s as Va}from"./Eye-DfJT3UtK.js";import{s as Kt,t as ho}from"./Star01-D4N4byzx.js";import{s as Ga}from"./XClose-CVZk1vk3.js";import{n as ts}from"./ZapSquare-DALy5P51.js";import{n as go,i as qa}from"./Globe01-Ien-1Tkv.js";import{c as Xa,b as Ya}from"./Tool01-CP_Ef4Y_.js";import{i as pr,a as Qa}from"./ZoomOut-ByJ0JnTP.js";import{i as yt}from"./Monitor01-GhZQ4Kev.js";import{i as Ja}from"./SearchMd-C_pleyIU.js";import{i as Za}from"./Upload01-Cqn0OezE.js";import{u as el,a as tl}from"./shell-layout-CK8b_Pp9.js";import{a as Pt}from"./Image01-l_Ll_rDB.js";import{n as xo}from"./LinkExternal01-CG1PRc3_.js";import{I as qe}from"./integration-icon-DSlodAQt.js";import{i as nl}from"./ArrowUpRight-Bi_HBNws.js";import{a as Ls}from"./Users03-BWGlmViM.js";import{a as Me}from"./Palette-DSb-jKRY.js";import{c as bo}from"./use-navigate-to-agent-CmyTZsoC.js";import{a as sl}from"./Stars02-BJyIedKc.js";import{g as rl}from"./AreaChart-Ckq4JiBW.js";import{a as ol,D as il,c as al,d as ll,e as cl}from"./dialog-C_DVh6dL.js";import{a as ul,F as dl,b as fl,c as ml,d as pl,f as hl}from"./form-DbFG2gV9.js";import{I as gl}from"./input-C_tu8il1.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
2
|
`).map(d=>d.trim()===""?n:`${n} ${d}`);s.push(m.join(`
|
|
3
3
|
`))}),s.join(`
|
|
4
4
|
${n}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-
|
|
1
|
+
import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-qXbPtiGF.js";import{s as q}from"./Plus-BUg9xI0h.js";import{i as S}from"./Zap-BDEn1Om0.js";import{S as D}from"./search-input-ao3k3c0D.js";import{P as l}from"./index-Hhp9Cp4W.js";import{E as b}from"./empty-state-eym_qidP.js";import{c as O}from"./use-automations-DnCJo6ng.js";import{c as V}from"./use-navigate-to-agent-CmyTZsoC.js";import{A as F}from"./automation-list-row-CzUMlQAq.js";import{p as G}from"./use-mcp-client-Cq4GaR34.js";import{u as H}from"./use-virtual-mcp-Bb8jRLD4.js";import{R as J}from"./require-capability-CTzhtp87.js";import"./SearchMd-C_pleyIU.js";import"./sidebar-y-EH5KNk.js";import"./LayoutLeft-DxSTvRB2.js";import"./use-mobile-CHEsWJnr.js";import"./X-BlDFTg97.js";import"./tooltip-BpxP2DIm.js";import"./studio-tools-DtJF9wPb.js";import"./hooks-BbLNuUpJ.js";import"./decopilot-sse-pool-DP5wFK-s.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-CmXFyCvD.js";import"./dropdown-menu-BPdwP-Cq.js";import"./ChevronUp-C8m0cJLX.js";import"./ChevronRight-DrB8B6LZ.js";import"./DotsVertical-Ca7b3C0v.js";import"./Stars02-BJyIedKc.js";import"./Trash01-CxBlA1E7.js";import"./agent-icon-13Bvgd_j.js";import"./AlertCircle-Dq71LScH.js";import"./Tool01-CP_Ef4Y_.js";import"./ArrowUp-CslVDVm8.js";import"./Settings02-Cd8o3xNO.js";import"./Tool02-D7oSQJgI.js";import"./XCircle-WQBMODEn.js";import"./ArrowUpRight-Bi_HBNws.js";import"./TrendUp01-DuD7hG_1.js";import"./ZapSquare-DALy5P51.js";import"./ZoomOut-ByJ0JnTP.js";import"./Users03-BWGlmViM.js";import"./CheckCircle-1OiOtWDi.js";import"./ChevronDown-POdyuGhT.js";import"./Copy01-CYlj1vxU.js";import"./Globe01-Ien-1Tkv.js";import"./Eye-DfJT3UtK.js";import"./FilterLines-Dvf7tHzR.js";import"./Star01-D4N4byzx.js";import"./Globe04-3rh6FP_k.js";import"./SwitchHorizontal01-qLYK_wFI.js";import"./HardDrive-BE24e46v.js";import"./Image01-l_Ll_rDB.js";import"./Key01-Dt-Yhou_.js";import"./LinkExternal01-CG1PRc3_.js";import"./Monitor01-GhZQ4Kev.js";import"./Sun-DWhn4gR_.js";import"./Package-B3tirBOc.js";import"./Palette-DSb-jKRY.js";import"./Play-DYkfGaNO.js";import"./SearchLg-DKMN0iwm.js";import"./Shield01-CwTanxWb.js";import"./Stars01-BGgTThTG.js";import"./Upload01-Cqn0OezE.js";import"./User01-Byo1af9Z.js";import"./Users01-D5HJa4UA.js";import"./XClose-CVZk1vk3.js";import"./auth-D4pinPO_.js";import"./use-collections-X_XL1Bcx.js";import"./use-capability-eNg2RGCV.js";import"./access-gate-ChLcg5Nd.js";import"./capability-load-error-BRtl8R4o.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function fo(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{fo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as a}from"./index-
|
|
1
|
+
import{D as a}from"./index-qXbPtiGF.js";const i=1e4,m="true";function s(e,t){return a.chatAutosend(e,t)}function d(e){return e==="pending"||e==="sending"}function c(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}return!t||typeof t!="object"||typeof t.createdAt!="number"||typeof t.message!="object"||!d(t.status)?null:t}function A(e,t,r,o,u=Date.now()){const n={message:o,createdAt:u,status:"pending"};return e.setItem(s(t,r),JSON.stringify(n)),n}function f(e,t,r){const o=s(t,r),u=c(e.getItem(o));return u||(e.removeItem(o),null)}function S(e,t,r,o=Date.now()){const u=s(t,r),n=f(e,t,r);return!n||n.status!=="pending"?null:o-n.createdAt>=i?(e.removeItem(u),null):(e.setItem(u,JSON.stringify({...n,status:"sending"})),{message:n.message,createdAt:n.createdAt})}function p(e,t,r){e.removeItem(s(t,r))}export{m as A,p as a,S as c,A as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as i,l as m,bC as R,cI as S,cJ as V,cK as $}from"./index-
|
|
1
|
+
import{c as k,j as i,l as m,bC as R,cI as S,cJ as V,cK as $}from"./index-qXbPtiGF.js";import{s as O}from"./User01-Byo1af9Z.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(S,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const I=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function J(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function K(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(J,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}K.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{K as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,l as u,j as g,bd as v,bC as b}from"./index-
|
|
1
|
+
import{c as l,l as u,j as g,bd as v,bC as b}from"./index-qXbPtiGF.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as T,r as V,l as Y,j as l,K as xe,m as he,B as rt}from"./index-
|
|
1
|
+
import{c as T,r as V,l as Y,j as l,K as xe,m as he,B as rt}from"./index-qXbPtiGF.js";import{D as ot,T as ce,R as nt,I as it,E as at,F as Le,H as ie,K as Be,P as Ee,J as Pe,L as Re,M as De,N as ct,O as Oe,Q as ze,U as Fe,V as Ue,W as dt,X as ut,r as ft,S as mt,Y as pt,Z as gt}from"./index-BK8QLtZw.js";import{V as xt,C as ht,a6 as bt,a7 as yt,a8 as vt,e as be,w as jt}from"./agent-icon-13Bvgd_j.js";import{s as Ve}from"./Plus-BUg9xI0h.js";import{e as je,a as Nt,b as Ct,C as kt,d as St,c as wt}from"./command-BIwzkDTa.js";import{P as _t,a as At,b as Tt}from"./popover-7b1YDSgF.js";import{a as $t}from"./Copy01-CYlj1vxU.js";import{b as He}from"./ZoomOut-ByJ0JnTP.js";import{s as me}from"./Trash01-CxBlA1E7.js";import{u as It,f as Lt,d as Bt}from"./calendar-DfaRfulu.js";import{c as Et}from"./automation-runs-OWgoSJa3.js";import{I as X,F as ye,T as re,s as A,p as se,R as ee,A as te}from"./primitives-CZE3Zj9J.js";import{i as qe}from"./ChevronUp-C8m0cJLX.js";import{a as Pt}from"./Image01-l_Ll_rDB.js";import{a as Rt}from"./Package-B3tirBOc.js";import{s as Dt}from"./XClose-CVZk1vk3.js";import{L as ne}from"./label-D3i55MXt.js";import{S as Me}from"./chat-context-BsaCa_DG.js";import{D as Ot,a as zt,d as Ft,e as Ut}from"./dialog-C_DVh6dL.js";import{I as pe}from"./input-C_tu8il1.js";const ae=m=>typeof m=="string"?m:"",Vt=/\/blog\.tsx?$/;function Ge(m,e){for(const[t,r]of Object.entries(m)){if(t.includes("/")||!r||typeof r!="object"||Array.isArray(r))continue;const s=r;if(typeof s.__resolveType!="string"||!Vt.test(s.__resolveType))continue;const i=ae(s[e]);if(i)return i}return null}function Ht(m){return Ge(m,"pageSlug")}function qt(m){return Ge(m,"categorySlug")}function Mt(m){const e=m.categories;if(!Array.isArray(e)||e.length===0)return"";const t=e[0];return ae(t?.slug)}function Gt(m,e){let t=m;if(/:category\??/.test(t)){if(!e.category)return null;t=t.replace(/:category\??/g,encodeURIComponent(e.category))}if(/:slug\??/.test(t)){if(!e.slug)return null;t=t.replace(/:slug\??/g,encodeURIComponent(e.slug))}return t}const Jt=/:(?:categorySlug|category|slug)\??/,Kt=/:(?:categorySlug|category|slug)\??/g;function Yt(m,e){return Jt.test(m)?e?m.replace(Kt,encodeURIComponent(e)):null:m}function Cl({decofile:m,category:e,previewBaseUrl:t}){if(!t)return null;const r=qt(m);if(!r)return null;const s=Yt(r,ae(e.slug));if(!s)return null;try{return new URL(s,t).href}catch{return null}}function kl({decofile:m,post:e,previewBaseUrl:t}){if(!t)return null;const r=Ht(m);if(!r)return null;const s=Gt(r,{category:Mt(e),slug:ae(e.slug)});if(!s)return null;try{return new URL(s,t).href}catch{return null}}const Ne={app:"Blocks",site:"Custom blocks"};function Xt(m){const e=T.c(6),{iconName:t,iconUrl:r,alt:s}=m;let i;e[0]!==t?(i=ht(t)??xt,e[0]=t,e[1]=i):i=e[1];const n=i;let f;return e[2]!==n||e[3]!==s||e[4]!==r?(f=l.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md border bg-muted",children:r?l.jsx("img",{src:r,alt:s,className:"size-5 object-contain"}):l.jsx(n,{size:16,className:"text-muted-foreground"})}),e[2]=n,e[3]=s,e[4]=r,e[5]=f):f=e[5],f}function Ce(m){const e=T.c(19),{type:t,onInsert:r}=m,s=`${t.title} ${t.resolveType} ${t.description??""}`;let i;e[0]!==r||e[1]!==t.resolveType?(i=()=>r(t.resolveType),e[0]=r,e[1]=t.resolveType,e[2]=i):i=e[2];let n;e[3]!==t.iconName||e[4]!==t.iconUrl||e[5]!==t.title?(n=l.jsx(Xt,{iconName:t.iconName,iconUrl:t.iconUrl,alt:t.title}),e[3]=t.iconName,e[4]=t.iconUrl,e[5]=t.title,e[6]=n):n=e[6];let f;e[7]!==t.title?(f=l.jsx("span",{className:"text-sm font-medium",children:t.title}),e[7]=t.title,e[8]=f):f=e[8];let d;e[9]!==t.description?(d=t.description&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[9]=t.description,e[10]=d):d=e[10];let c;e[11]!==f||e[12]!==d?(c=l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[f,d]}),e[11]=f,e[12]=d,e[13]=c):c=e[13];let x;return e[14]!==s||e[15]!==i||e[16]!==n||e[17]!==c?(x=l.jsxs(Nt,{value:s,onSelect:i,className:"flex items-center gap-2.5",children:[n,c]}),e[14]=s,e[15]=i,e[16]=n,e[17]=c,e[18]=x):x=e[18],x}function ke(m){const e=T.c(28),{blockTypes:t,onInsert:r,alwaysShow:s}=m,i=s===void 0?!1:s,[n,f]=V.useState(!1);let d,c;if(e[0]!==t){d=[],c=[];for(const k of t)(k.source==="site"?c:d).push(k);e[0]=t,e[1]=d,e[2]=c}else d=e[1],c=e[2];let x;e[3]!==r?(x=k=>{r(k),f(!1)},e[3]=r,e[4]=x):x=e[4];const g=x,h=d.length>0&&c.length>0,o=i?"h-10":"";let a;e[5]!==o?(a=Y("group/insert relative flex h-6 items-center justify-center",o),e[5]=o,e[6]=a):a=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-border"}),e[7]=u):u=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=l.jsx(_t,{asChild:!0,children:l.jsx("button",{type:"button","aria-label":"Insert block",className:"relative z-10 flex h-6 w-6 items-center justify-center rounded-full border bg-background text-muted-foreground transition-all hover:border-primary hover:text-primary cursor-pointer",children:l.jsx(Ve,{size:14})})}),e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=l.jsx(Ct,{placeholder:"Search blocks…"}),e[9]=b):b=e[9];let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(kt,{children:"No blocks found."}),e[10]=y):y=e[10];let v;e[11]!==g||e[12]!==h||e[13]!==c?(v=c.length>0&&l.jsx(je,{heading:h?Ne.site:void 0,children:c.map(k=>l.jsx(Ce,{type:k,onInsert:g},k.resolveType))}),e[11]=g,e[12]=h,e[13]=c,e[14]=v):v=e[14];let N;e[15]!==d||e[16]!==g||e[17]!==h?(N=d.length>0&&l.jsx(je,{heading:h?Ne.app:void 0,children:d.map(k=>l.jsx(Ce,{type:k,onInsert:g},k.resolveType))}),e[15]=d,e[16]=g,e[17]=h,e[18]=N):N=e[18];let j;e[19]!==N||e[20]!==v?(j=l.jsx(At,{className:"w-80 p-0",align:"center",children:l.jsxs(St,{children:[b,l.jsxs(wt,{className:"max-h-80",children:[y,v,N]})]})}),e[19]=N,e[20]=v,e[21]=j):j=e[21];let C;e[22]!==n||e[23]!==j?(C=l.jsxs(Tt,{open:n,onOpenChange:f,children:[p,j]}),e[22]=n,e[23]=j,e[24]=C):C=e[24];let S;return e[25]!==C||e[26]!==a?(S=l.jsxs("div",{className:a,children:[u,C]}),e[25]=C,e[26]=a,e[27]=S):S=e[27],S}function Qt({html:m,placeholder:e,onChange:t}){const r=V.useRef(t);r.current=t;const[s,i]=V.useState(!1),n=It({extensions:[Et.configure({link:{HTMLAttributes:{}},heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,dropcursor:!1,gapcursor:!1}),ot.configure({placeholder:e??"Write something…"})],content:m||"",editorProps:{attributes:{class:Y("prose prose-sm dark:prose-invert max-w-none focus:outline-none","leading-relaxed [&_p]:my-0")}},onUpdate:({editor:d})=>{const c=d.getHTML();r.current(c==="<p></p>"?"":c)}}),f=Lt({editor:n,selector:({editor:d})=>({isFocused:d?.isFocused??!1,bold:d?.isActive("bold")??!1,italic:d?.isActive("italic")??!1,underline:d?.isActive("underline")??!1,link:d?.isActive("link")??!1})});return n?l.jsxs("div",{className:"relative",children:[(f.isFocused||s)&&l.jsxs("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:[l.jsx(ce,{active:f.bold,label:"Bold",onClick:()=>n.chain().focus().toggleBold().run(),children:l.jsx(bt,{size:14})}),l.jsx(ce,{active:f.italic,label:"Italic",onClick:()=>n.chain().focus().toggleItalic().run(),children:l.jsx(yt,{size:14})}),l.jsx(ce,{active:f.underline,label:"Underline",onClick:()=>n.chain().focus().toggleUnderline().run(),children:l.jsx(vt,{size:14})}),l.jsx(nt,{editor:n,active:f.link,open:s,onOpenChange:i})]}),l.jsx(Bt,{editor:n,className:"text-[15px] text-foreground"})]}):null}const Wt=["1","2","3"],Se={1:"text-3xl font-bold",2:"text-2xl font-bold",3:"text-xl font-semibold",4:"text-lg font-semibold",5:"text-base font-semibold",6:"text-sm font-semibold"};function Zt(m){const e=T.c(19),{text:t,level:r,onChange:s}=m,[i,n]=V.useState(!1),f=r||"2";let d;e[0]!==i||e[1]!==f||e[2]!==s||e[3]!==t?(d=i&&l.jsx(ye,{children:Wt.map(p=>l.jsxs(re,{active:f===p,label:`Heading ${p}`,onClick:()=>s({text:t,level:p}),children:["H",p]},p))}),e[0]=i,e[1]=f,e[2]=s,e[3]=t,e[4]=d):d=e[4];let c;e[5]!==f||e[6]!==s?(c=p=>s({text:p,level:f}),e[5]=f,e[6]=s,e[7]=c):c=e[7];let x,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=()=>n(!0),g=()=>n(!1),e[8]=x,e[9]=g):(x=e[8],g=e[9]);const h=Se[f]??Se[2];let o;e[10]!==h?(o=Y("text-foreground",h),e[10]=h,e[11]=o):o=e[11];let a;e[12]!==c||e[13]!==o||e[14]!==t?(a=l.jsx(X,{value:t,onChange:c,onFocus:x,onBlur:g,placeholder:"Heading",className:o}),e[12]=c,e[13]=o,e[14]=t,e[15]=a):a=e[15];let u;return e[16]!==d||e[17]!==a?(u=l.jsxs("div",{className:"relative",children:[d,a]}),e[16]=d,e[17]=a,e[18]=u):u=e[18],u}function es(m){const e=T.c(3),{quote:t,onChange:r}=m;let s;return e[0]!==r||e[1]!==t?(s=l.jsx("div",{className:"border-l-2 border-foreground/30 pl-4",children:l.jsx(X,{value:t,onChange:r,placeholder:"Quote",className:"text-lg italic text-foreground/90"})}),e[0]=r,e[1]=t,e[2]=s):s=e[2],s}function ts(m){const e=T.c(15),{code:t,language:r,onChange:s}=m;let i;e[0]!==t||e[1]!==s?(i=x=>s({code:t,language:x.target.value}),e[0]=t,e[1]=s,e[2]=i):i=e[2];let n;e[3]!==r||e[4]!==i?(n=l.jsx("input",{value:r,onChange:i,placeholder:"language",className:"w-full border-b bg-transparent px-3 py-1.5 font-mono text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50"}),e[3]=r,e[4]=i,e[5]=n):n=e[5];let f;e[6]!==r||e[7]!==s?(f=x=>s({code:x,language:r}),e[6]=r,e[7]=s,e[8]=f):f=e[8];let d;e[9]!==t||e[10]!==f?(d=l.jsx(X,{value:t,onChange:f,placeholder:"Code",spellCheck:!1,className:"px-3 py-2.5 font-mono text-sm text-foreground"}),e[9]=t,e[10]=f,e[11]=d):d=e[11];let c;return e[12]!==n||e[13]!==d?(c=l.jsxs("div",{className:"overflow-hidden rounded-md border bg-muted/50",children:[n,d]}),e[12]=n,e[13]=d,e[14]=c):c=e[14],c}function ss(m){const e=T.c(17),{items:t,style:r,onChange:s}=m,i=r==="ordered",n=t.length?t.split(`
|
|
2
2
|
`):[""],[f,d]=V.useState(!1),c=V.useRef([]);let x;e[0]!==s||e[1]!==r?(x=j=>s({items:j.join(`
|
|
3
3
|
`),style:r}),e[0]=s,e[1]=r,e[2]=x):x=e[2];const g=x,h=(j,C)=>requestAnimationFrame(()=>{const S=c.current[j];if(!S)return;S.focus();const k=C==="end"?S.value.length:0;S.setSelectionRange(k,k)}),o="relative";let a,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=()=>d(!0),u=j=>{j.currentTarget.contains(j.relatedTarget)||d(!1)},e[3]=a,e[4]=u):(a=e[3],u=e[4]);let p;e[5]!==f||e[6]!==t||e[7]!==s||e[8]!==i?(p=f&&l.jsxs(ye,{children:[l.jsx(re,{active:!i,label:"Bulleted",onClick:()=>s({items:t,style:"unordered"}),children:"•"}),l.jsx(re,{active:i,label:"Numbered",onClick:()=>s({items:t,style:"ordered"}),children:"1."})]}),e[5]=f,e[6]=t,e[7]=s,e[8]=i,e[9]=p):p=e[9];const b="space-y-1",y=n.map((j,C)=>l.jsxs("li",{className:"flex items-start gap-2.5",children:[l.jsx("span",{className:"min-w-5 shrink-0 select-none pt-px text-right text-[15px] leading-relaxed text-muted-foreground tabular-nums",children:i?`${C+1}.`:"•"}),l.jsx(X,{inputRef:S=>{c.current[C]=S},value:j,onChange:S=>{const k=[...n];k[C]=S,g(k)},onKeyDown:S=>{const k=S.currentTarget;if(S.key==="Enter"){S.preventDefault();const _=[...n];_.splice(C+1,0,""),g(_),h(C+1,"start")}else S.key==="Backspace"&&j===""&&n.length>1?(S.preventDefault(),g(n.filter((_,w)=>w!==C)),h(Math.max(0,C-1),"end")):S.key==="ArrowUp"&&k.selectionStart===0&&C>0?(S.preventDefault(),h(C-1,"end")):S.key==="ArrowDown"&&k.selectionEnd===j.length&&C<n.length-1&&(S.preventDefault(),h(C+1,"end"))},placeholder:"List item",className:"text-[15px] leading-relaxed text-foreground"})]},C));let v;e[10]!==y?(v=l.jsx("ul",{className:b,children:y}),e[10]=y,e[11]=v):v=e[11];let N;return e[12]!==a||e[13]!==u||e[14]!==p||e[15]!==v?(N=l.jsxs("div",{className:o,onFocus:a,onBlur:u,children:[p,v]}),e[12]=a,e[13]=u,e[14]=p,e[15]=v,e[16]=N):N=e[16],N}function ls(m){const e=T.c(37),{block:t,onChange:r}=m;let s;e[0]!==t.size?(s=A(t.size)||"normal",e[0]=t.size,e[1]=s):s=e[1];const i=s;let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n={type:"string",format:"image-uri",title:"Image"},e[2]=n):n=e[2];let f;e[3]!==t||e[4]!==r?(f=v=>r({...t,url:v}),e[3]=t,e[4]=r,e[5]=f):f=e[5];let d;e[6]!==t.url||e[7]!==f?(d=l.jsx(it,{schema:n,value:t.url,onChange:f,path:"block-image-url",label:"Image"}),e[6]=t.url,e[7]=f,e[8]=d):d=e[8];let c;e[9]!==t.caption?(c=A(t.caption),e[9]=t.caption,e[10]=c):c=e[10];let x;e[11]!==t||e[12]!==r?(x=v=>r({...t,caption:v}),e[11]=t,e[12]=r,e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==x?(g=l.jsx(X,{value:c,onChange:x,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=c,e[15]=x,e[16]=g):g=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=["normal","full"],e[17]=h):h=e[17];let o;e[18]!==t||e[19]!==r||e[20]!==i?(o=l.jsx("div",{className:"flex items-center gap-1",children:h.map(v=>l.jsx("button",{type:"button",onClick:()=>r({...t,size:v}),className:Y("rounded px-2 py-0.5 transition-colors cursor-pointer",i===v?"bg-accent text-accent-foreground":"hover:bg-muted"),children:v==="full"?"Full width":"Normal"},v))}),e[18]=t,e[19]=r,e[20]=i,e[21]=o):o=e[21];let a;e[22]!==t.alt?(a=A(t.alt),e[22]=t.alt,e[23]=a):a=e[23];let u;e[24]!==t||e[25]!==r?(u=v=>r({...t,alt:v.target.value}),e[24]=t,e[25]=r,e[26]=u):u=e[26];let p;e[27]!==a||e[28]!==u?(p=l.jsx("input",{value:a,onChange:u,placeholder:"Alt text (accessibility)",className:"flex-1 border-0 bg-transparent p-0 text-xs outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[27]=a,e[28]=u,e[29]=p):p=e[29];let b;e[30]!==p||e[31]!==o?(b=l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[o,p]}),e[30]=p,e[31]=o,e[32]=b):b=e[32];let y;return e[33]!==b||e[34]!==d||e[35]!==g?(y=l.jsxs("div",{className:"space-y-2",children:[d,g,b]}),e[33]=b,e[34]=d,e[35]=g,e[36]=y):y=e[36],y}function rs(m){const e=m.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/);if(e)return`https://www.youtube.com/embed/${e[1]}`;const t=m.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null}function os(m){const e=T.c(21),{url:t,caption:r,onChange:s}=m;let i;e[0]!==t?(i=rs(t),e[0]=t,e[1]=i):i=e[1];const n=i;let f;e[2]!==r||e[3]!==n?(f=n?l.jsx("div",{className:"relative aspect-video overflow-hidden rounded-md border bg-muted",children:l.jsx("iframe",{src:n,title:r||"Video",className:"absolute inset-0 h-full w-full border-0",allowFullScreen:!0})}):l.jsx("div",{className:"flex aspect-video items-center justify-center rounded-md border border-dashed bg-muted/40 text-xs text-muted-foreground",children:"Paste a YouTube or Vimeo URL to preview"}),e[2]=r,e[3]=n,e[4]=f):f=e[4];let d;e[5]!==r||e[6]!==s?(d=o=>s({url:o.target.value,caption:r}),e[5]=r,e[6]=s,e[7]=d):d=e[7];let c;e[8]!==d||e[9]!==t?(c=l.jsx("input",{value:t,onChange:d,placeholder:"https://youtube.com/watch?v=…",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[8]=d,e[9]=t,e[10]=c):c=e[10];let x;e[11]!==s||e[12]!==t?(x=o=>s({url:t,caption:o}),e[11]=s,e[12]=t,e[13]=x):x=e[13];let g;e[14]!==r||e[15]!==x?(g=l.jsx(X,{value:r,onChange:x,placeholder:"Add a caption…",className:"text-center text-sm italic text-muted-foreground"}),e[14]=r,e[15]=x,e[16]=g):g=e[16];let h;return e[17]!==f||e[18]!==c||e[19]!==g?(h=l.jsxs("div",{className:"space-y-2",children:[f,c,g]}),e[17]=f,e[18]=c,e[19]=g,e[20]=h):h=e[20],h}function ns(){const m=T.c(1);let e;return m[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("div",{className:"flex items-center py-3","aria-label":"Divider",children:l.jsx("span",{className:"h-px flex-1 bg-border"})}),m[0]=e):e=m[0],e}function is(m){const e=T.c(16),{text:t,href:r,onChange:s}=m;let i;e[0]!==r||e[1]!==s?(i=g=>s({text:g.target.value,href:r}),e[0]=r,e[1]=s,e[2]=i):i=e[2];const n=Math.max(t.length||11,8);let f;e[3]!==i||e[4]!==n||e[5]!==t?(f=l.jsx("div",{className:"inline-flex items-center rounded-full bg-primary px-6 py-2 text-sm font-semibold text-primary-foreground",children:l.jsx("input",{value:t,onChange:i,placeholder:"Button label",size:n,className:"border-0 bg-transparent p-0 text-center text-sm font-semibold text-primary-foreground outline-none placeholder:text-primary-foreground/60 focus:ring-0"})}),e[3]=i,e[4]=n,e[5]=t,e[6]=f):f=e[6];let d;e[7]!==s||e[8]!==t?(d=g=>s({text:t,href:g.target.value}),e[7]=s,e[8]=t,e[9]=d):d=e[9];let c;e[10]!==r||e[11]!==d?(c=l.jsx("input",{value:r,onChange:d,placeholder:"https://destination-url.com",className:"w-full max-w-sm border-0 bg-transparent p-0 text-center text-xs text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[10]=r,e[11]=d,e[12]=c):c=e[12];let x;return e[13]!==f||e[14]!==c?(x=l.jsxs("div",{className:"flex flex-col items-center gap-2 py-2",children:[f,c]}),e[13]=f,e[14]=c,e[15]=x):x=e[15],x}const de=[{value:"info",icon:"ℹ",color:"oklch(0.62 0.19 250)"},{value:"tip",icon:"✓",color:"oklch(0.65 0.17 150)"},{value:"warning",icon:"⚠",color:"oklch(0.75 0.15 75)"},{value:"product",icon:"★",color:"oklch(0.62 0.21 300)"}];function as(m){const e=T.c(45),{title:t,body:r,variant:s,onChange:i}=m,[n,f]=V.useState(!1);let d;e[0]!==s?(d=de.find(w=>w.value===s)??de[0],e[0]=s,e[1]=d):d=e[1];const c=d;let x,g;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=()=>f(!0),g=w=>{w.currentTarget.contains(w.relatedTarget)||f(!1)},e[2]=x,e[3]=g):(x=e[2],g=e[3]);let h;e[4]!==r||e[5]!==n||e[6]!==i||e[7]!==t||e[8]!==c.value?(h=n&&l.jsx(ye,{children:de.map(w=>l.jsx(re,{active:c.value===w.value,label:w.value,onClick:()=>i({title:t,body:r,variant:w.value}),children:l.jsx("span",{style:{color:w.color},children:w.icon})},w.value))}),e[4]=r,e[5]=n,e[6]=i,e[7]=t,e[8]=c.value,e[9]=h):h=e[9];const o=`3px solid ${c.color}`,a=`color-mix(in oklch, ${c.color} 8%, transparent)`;let u;e[10]!==o||e[11]!==a?(u={borderLeft:o,backgroundColor:a},e[10]=o,e[11]=a,e[12]=u):u=e[12];let p;e[13]!==c.color?(p={color:c.color},e[13]=c.color,e[14]=p):p=e[14];let b;e[15]!==c.icon?(b=l.jsx("span",{"aria-hidden":!0,className:"text-sm font-bold leading-none",children:c.icon}),e[15]=c.icon,e[16]=b):b=e[16];let y;e[17]!==r||e[18]!==i||e[19]!==s?(y=w=>i({title:w.target.value,body:r,variant:s}),e[17]=r,e[18]=i,e[19]=s,e[20]=y):y=e[20];let v;e[21]!==c.color?(v={color:c.color},e[21]=c.color,e[22]=v):v=e[22];let N;e[23]!==y||e[24]!==v||e[25]!==t?(N=l.jsx("input",{value:t,onChange:y,placeholder:"Callout title",className:"flex-1 border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none focus:ring-0",style:v}),e[23]=y,e[24]=v,e[25]=t,e[26]=N):N=e[26];let j;e[27]!==N||e[28]!==p||e[29]!==b?(j=l.jsxs("div",{className:"mb-1.5 flex items-center gap-2",style:p,children:[b,N]}),e[27]=N,e[28]=p,e[29]=b,e[30]=j):j=e[30];let C;e[31]!==i||e[32]!==t||e[33]!==s?(C=w=>i({title:t,body:w,variant:s}),e[31]=i,e[32]=t,e[33]=s,e[34]=C):C=e[34];let S;e[35]!==r||e[36]!==C?(S=l.jsx(X,{value:r,onChange:C,placeholder:"Callout text…",className:"text-[15px] leading-relaxed text-foreground"}),e[35]=r,e[36]=C,e[37]=S):S=e[37];let k;e[38]!==j||e[39]!==S||e[40]!==u?(k=l.jsxs("div",{className:"rounded-md py-4 pl-5 pr-4",style:u,children:[j,S]}),e[38]=j,e[39]=S,e[40]=u,e[41]=k):k=e[41];let _;return e[42]!==k||e[43]!==h?(_=l.jsxs("div",{className:"relative",onFocus:x,onBlur:g,children:[h,k]}),e[42]=k,e[43]=h,e[44]=_):_=e[44],_}function cs(m){const e=T.c(25),{value:t,label:r,description:s,onChange:i}=m;let n;e[0]!==s||e[1]!==r||e[2]!==i?(n=o=>i({value:o.target.value,label:r,description:s}),e[0]=s,e[1]=r,e[2]=i,e[3]=n):n=e[3];let f;e[4]!==n||e[5]!==t?(f=l.jsx("input",{value:t,onChange:n,placeholder:"42%",className:"w-full border-0 bg-transparent p-0 text-center text-4xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[4]=n,e[5]=t,e[6]=f):f=e[6];let d;e[7]!==s||e[8]!==i||e[9]!==t?(d=o=>i({value:t,label:o.target.value,description:s}),e[7]=s,e[8]=i,e[9]=t,e[10]=d):d=e[10];let c;e[11]!==r||e[12]!==d?(c=l.jsx("input",{value:r,onChange:d,placeholder:"Label",className:"w-full border-0 bg-transparent p-0 text-center text-xs font-semibold uppercase tracking-wide text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),e[11]=r,e[12]=d,e[13]=c):c=e[13];let x;e[14]!==r||e[15]!==i||e[16]!==t?(x=o=>i({value:t,label:r,description:o}),e[14]=r,e[15]=i,e[16]=t,e[17]=x):x=e[17];let g;e[18]!==s||e[19]!==x?(g=l.jsx(X,{value:s,onChange:x,placeholder:"Optional description",className:"max-w-md text-center text-sm text-muted-foreground"}),e[18]=s,e[19]=x,e[20]=g):g=e[20];let h;return e[21]!==f||e[22]!==c||e[23]!==g?(h=l.jsxs("div",{className:"flex flex-col items-center gap-1.5 border-y border-border/60 py-8 text-center",children:[f,c,g]}),e[21]=f,e[22]=c,e[23]=g,e[24]=h):h=e[24],h}function ds(m){const e=T.c(19),{cards:t,onChange:r}=m;let s,i,n,f,d;if(e[0]!==t||e[1]!==r){i=se(t);let h;e[7]!==r?(h=a=>r(JSON.stringify(a)),e[7]=r,e[8]=h):h=e[8],s=h;const o=(a,u)=>s(i.map((p,b)=>b===a?{...p,...u}:p));d="space-y-2",n="grid grid-cols-1 gap-3 sm:grid-cols-3",f=i.slice(0,3).map((a,u)=>l.jsxs("div",{className:"group/item relative flex flex-col gap-2 rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"absolute right-1 top-1",children:l.jsx(ee,{label:"Remove card",onClick:()=>s(i.filter((p,b)=>b!==u))})}),l.jsx("input",{value:A(a.icon),onChange:p=>o(u,{icon:p.target.value}),placeholder:"🎴",className:"flex h-9 w-9 items-center justify-center rounded-md border bg-background text-center text-lg outline-none focus:ring-0"}),l.jsx("input",{value:A(a.title),onChange:p=>o(u,{title:p.target.value}),placeholder:"Card title",className:"border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx(X,{value:A(a.body),onChange:p=>o(u,{body:p}),placeholder:"Card body",className:"text-sm text-muted-foreground"})]},u)),e[0]=t,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=f,e[6]=d}else s=e[2],i=e[3],n=e[4],f=e[5],d=e[6];let c;e[9]!==n||e[10]!==f?(c=l.jsx("div",{className:n,children:f}),e[9]=n,e[10]=f,e[11]=c):c=e[11];let x;e[12]!==s||e[13]!==i?(x=i.length<3&&l.jsx(te,{label:"Add card",onClick:()=>s([...i,{title:"",body:""}])}),e[12]=s,e[13]=i,e[14]=x):x=e[14];let g;return e[15]!==d||e[16]!==c||e[17]!==x?(g=l.jsxs("div",{className:d,children:[c,x]}),e[15]=d,e[16]=c,e[17]=x,e[18]=g):g=e[18],g}function us(m){const e=T.c(27),{title:t,items:r,onChange:s}=m;let i,n,f,d,c;if(e[0]!==r||e[1]!==s||e[2]!==t){n=se(r);let o;e[8]!==s||e[9]!==t?(o=u=>s({title:t,items:JSON.stringify(u)}),e[8]=s,e[9]=t,e[10]=o):o=e[10],i=o,d="space-y-2";let a;e[11]!==r||e[12]!==s?(a=u=>s({title:u.target.value,items:r}),e[11]=r,e[12]=s,e[13]=a):a=e[13],e[14]!==a||e[15]!==t?(c=l.jsx("input",{value:t,onChange:a,placeholder:"Checklist title (optional)",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[14]=a,e[15]=t,e[16]=c):c=e[16],f=n.map((u,p)=>l.jsxs("li",{className:"group/item flex items-start gap-3 border-b border-border/50 py-2.5",children:[l.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center text-primary",children:l.jsx(qe,{size:15})}),l.jsx(X,{value:u,onChange:b=>i(n.map((y,v)=>v===p?b:y)),placeholder:"Checklist item",className:"text-[15px] text-foreground"}),l.jsx(ee,{label:"Remove item",onClick:()=>i(n.filter((b,y)=>y!==p))})]},p)),e[0]=r,e[1]=s,e[2]=t,e[3]=i,e[4]=n,e[5]=f,e[6]=d,e[7]=c}else i=e[3],n=e[4],f=e[5],d=e[6],c=e[7];let x;e[17]!==f?(x=l.jsx("ul",{children:f}),e[17]=f,e[18]=x):x=e[18];let g;e[19]!==i||e[20]!==n?(g=l.jsx(te,{label:"Add item",onClick:()=>i([...n,""])}),e[19]=i,e[20]=n,e[21]=g):g=e[21];let h;return e[22]!==d||e[23]!==c||e[24]!==x||e[25]!==g?(h=l.jsxs("div",{className:d,children:[c,x,g]}),e[22]=d,e[23]=c,e[24]=x,e[25]=g,e[26]=h):h=e[26],h}function fs(m){const e=T.c(19),{stats:t,onChange:r}=m;let s,i,n,f,d;if(e[0]!==r||e[1]!==t){i=se(t);let h;e[7]!==r?(h=a=>r(JSON.stringify(a)),e[7]=r,e[8]=h):h=e[8],s=h;const o=(a,u)=>s(i.map((p,b)=>b===a?{...p,...u}:p));d="space-y-2",n="grid grid-cols-1 gap-3 sm:grid-cols-3",f=i.slice(0,3).map((a,u)=>l.jsxs("div",{className:"group/item relative rounded-lg border p-5 text-center",children:[l.jsx("div",{className:"absolute right-1 top-1",children:l.jsx(ee,{label:"Remove stat",onClick:()=>s(i.filter((p,b)=>b!==u))})}),l.jsx("input",{value:A(a.value),onChange:p=>o(u,{value:p.target.value}),placeholder:"99%",className:"w-full border-0 bg-transparent p-0 text-center text-3xl font-bold tabular-nums text-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"}),l.jsx("input",{value:A(a.label),onChange:p=>o(u,{label:p.target.value}),placeholder:"Label",className:"mt-1 w-full border-0 bg-transparent p-0 text-center text-sm text-muted-foreground outline-none placeholder:text-muted-foreground/40 focus:ring-0"})]},u)),e[0]=r,e[1]=t,e[2]=s,e[3]=i,e[4]=n,e[5]=f,e[6]=d}else s=e[2],i=e[3],n=e[4],f=e[5],d=e[6];let c;e[9]!==n||e[10]!==f?(c=l.jsx("div",{className:n,children:f}),e[9]=n,e[10]=f,e[11]=c):c=e[11];let x;e[12]!==s||e[13]!==i?(x=i.length<3&&l.jsx(te,{label:"Add stat",onClick:()=>s([...i,{value:"",label:""}])}),e[12]=s,e[13]=i,e[14]=x):x=e[14];let g;return e[15]!==d||e[16]!==c||e[17]!==x?(g=l.jsxs("div",{className:d,children:[c,x]}),e[15]=d,e[16]=c,e[17]=x,e[18]=g):g=e[18],g}function ms(m){const e=T.c(29),{title:t,steps:r,onChange:s}=m;let i,n,f,d,c,x;if(e[0]!==s||e[1]!==r||e[2]!==t){n=se(r);let a;e[9]!==s||e[10]!==t?(a=b=>s({title:t,steps:JSON.stringify(b)}),e[9]=s,e[10]=t,e[11]=a):a=e[11],i=a;const u=(b,y)=>i(n.map((v,N)=>N===b?{...v,...y}:v));c="space-y-2";let p;e[12]!==s||e[13]!==r?(p=b=>s({title:b.target.value,steps:r}),e[12]=s,e[13]=r,e[14]=p):p=e[14],e[15]!==p||e[16]!==t?(x=l.jsx("input",{value:t,onChange:p,placeholder:"Steps title (optional)",className:"w-full border-0 bg-transparent p-0 text-lg font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[15]=p,e[16]=t,e[17]=x):x=e[17],f="space-y-3",d=n.map((b,y)=>l.jsxs("li",{className:"group/item flex gap-4",children:[l.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border text-sm font-semibold text-muted-foreground",children:y+1}),l.jsxs("div",{className:"min-w-0 flex-1 space-y-1 pt-0.5",children:[l.jsx("input",{value:A(b.title),onChange:v=>u(y,{title:v.target.value}),placeholder:"Step title",className:"w-full border-0 bg-transparent p-0 text-[15px] font-semibold outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx(X,{value:A(b.description),onChange:v=>u(y,{description:v}),placeholder:"Step description",className:"text-sm text-muted-foreground"})]}),l.jsx(ee,{label:"Remove step",onClick:()=>i(n.filter((v,N)=>N!==y))})]},y)),e[0]=s,e[1]=r,e[2]=t,e[3]=i,e[4]=n,e[5]=f,e[6]=d,e[7]=c,e[8]=x}else i=e[3],n=e[4],f=e[5],d=e[6],c=e[7],x=e[8];let g;e[18]!==f||e[19]!==d?(g=l.jsx("ol",{className:f,children:d}),e[18]=f,e[19]=d,e[20]=g):g=e[20];let h;e[21]!==i||e[22]!==n?(h=l.jsx(te,{label:"Add step",onClick:()=>i([...n,{title:"",description:""}])}),e[21]=i,e[22]=n,e[23]=h):h=e[23];let o;return e[24]!==c||e[25]!==x||e[26]!==g||e[27]!==h?(o=l.jsxs("div",{className:c,children:[x,g,h]}),e[24]=c,e[25]=x,e[26]=g,e[27]=h,e[28]=o):o=e[28],o}function we(m,e){try{const t=JSON.parse(m||"{}");return{title:typeof t?.title=="string"?t.title:e,items:Array.isArray(t?.items)?t.items:[]}}catch{return{title:e,items:[]}}}function ps(m){const e=T.c(7),{left:t,right:r,onChange:s}=m;let i;if(e[0]!==t||e[1]!==s||e[2]!==r){const n={left:we(t,"Option A"),right:we(r,"Option B")},f=(g,h)=>s({left:g==="left"?JSON.stringify(h):t,right:g==="right"?JSON.stringify(h):r});let d;e[4]!==f?(d=(g,h,o)=>{const a=h.items??[];return l.jsxs("div",{className:"space-y-2 rounded-lg border p-4",children:[l.jsx("input",{value:A(h.title),onChange:u=>f(g,{...h,title:u.target.value}),placeholder:"Column title",className:"w-full border-0 bg-transparent p-0 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx("ul",{className:"space-y-1.5",children:a.map((u,p)=>l.jsxs("li",{className:"group/item flex items-start gap-2",children:[l.jsx("span",{"aria-hidden":!0,className:"mt-0.5 shrink-0 text-sm font-bold",style:{color:o},children:"✓"}),l.jsx(X,{value:u,onChange:b=>f(g,{...h,items:a.map((y,v)=>v===p?b:y)}),placeholder:"Item",className:"text-sm text-foreground"}),l.jsx(ee,{label:"Remove item",onClick:()=>f(g,{...h,items:a.filter((b,y)=>y!==p)})})]},p))}),l.jsx(te,{label:"Add item",onClick:()=>f(g,{...h,items:[...a,""]})})]})},e[4]=f,e[5]=d):d=e[5];const c=d;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=Y("grid grid-cols-1 gap-3 sm:grid-cols-2"),e[6]=x):x=e[6],i=l.jsxs("div",{className:x,children:[c("left",n.left,"oklch(0.65 0.17 150)"),c("right",n.right,"oklch(0.75 0.15 75)")]}),e[0]=t,e[1]=s,e[2]=r,e[3]=i}else i=e[3];return i}const gs="vtex/loaders/intelligentSearch/productList.ts";function Z(m){return m&&typeof m=="object"&&!Array.isArray(m)?m:null}function ue(m){return typeof m=="string"||typeof m=="number"?String(m):""}function fe(m){const e=Z(m);return!!e&&typeof e.__resolveType=="string"&&"productId"in e}function Je(m){if(Array.isArray(m))return m.map(r=>ue(Z(r)?.productId));const e=Z(m),t=Z(e?.props);return t&&Array.isArray(t.ids)?t.ids.map(ue):e&&"productId"in e?[ue(e.productId)]:[]}function xs(m){const e=Z(m)??{};return typeof e.__resolveType=="string"?e.__resolveType:gs}function Ke(m,e){if(Array.isArray(m)){const i=m.find(fe);if(i)return e.map((n,f)=>{const d=Z(m[f]);return{...fe(d)?d:{__resolveType:i.__resolveType},productId:n}})}const t=Z(m);if(fe(t)&&!Z(t.props)?.ids)return{...t,productId:e[0]??""};const r=Z(t?.props)??{},s=xs(m);return{...t??{},__resolveType:s,props:{...r,ids:e,simulationBehavior:r.simulationBehavior??"default"}}}const Ye="vtex/loaders/intelligentSearch/productList.ts",hs="vtex/loaders/categories/tree.ts",bs=24;function le(m){return m&&typeof m=="object"&&!Array.isArray(m)?m:null}function ys(m){return m.split("/").filter(Boolean).map((t,r)=>`category-${r+1}/${t}`).join("/")}function vs(m,e){const t=e.trim();if(!t)return[];const r=Ye,s=bs;if(m==="cluster")return[{resolveType:r,props:{collection:t,count:s}}];if(m==="category"){const d=ys(t);return d?[{resolveType:r,props:{facets:d,count:s}}]:[]}const i=[];/^\d+$/.test(t)&&i.push({resolveType:r,props:{ids:[t]}});const f=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return i.push({resolveType:r,props:{query:f,count:s}}),i}function js(){return{resolveType:hs,props:{}}}function Ns(m){return{resolveType:Ye,props:{ids:m}}}function _e(m){return typeof m=="string"||typeof m=="number"?String(m):""}function Xe(m){const e=le(m),t=Array.isArray(m)?m:Array.isArray(e?.products)?e.products:[],r=[],s=new Set;for(const i of t){const n=le(i);if(!n)continue;const f=_e(n.productID)||_e(n.sku);if(!f||s.has(f))continue;s.add(f);const d=le(n.isVariantOf),c=typeof d?.name=="string"&&d.name||typeof n.name=="string"&&n.name||f,x=Array.isArray(n.image)?le(n.image[0]):null,g=typeof x?.url=="string"?x.url:void 0;r.push({id:f,label:c,image:g})}return r}function Cs(m){if(typeof m!="string"||!m)return null;let e;try{e=new URL(m,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function ks(m){const e=[],t=new Set,r=(s,i)=>{const n=le(s);if(!n)return;const f=typeof n.name=="string"&&n.name?n.name:"",d=f?[...i,f]:i,c=Cs(n.url);if(c&&!t.has(c)&&(t.add(c),e.push({path:c,label:d.join(" › ")||c})),Array.isArray(n.children))for(const x of n.children)r(x,d)};if(Array.isArray(m))for(const s of m)r(s,[]);return e}function Ss(m,e,t=50){const r=e.trim().toLowerCase();return(r?m.filter(i=>i.label.toLowerCase().includes(r)||i.path.toLowerCase().includes(r)):m).slice(0,t)}const ws=1e4;async function ve(m,{resolveType:e,props:t}){const r=await fetch(at(m),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(ws)});if(!r.ok)throw new Error(`Failed to fetch (${r.status})`);return r.json()}function Qe(m,e){const t=T.c(20);let r;t[0]!==e?(r=new Set(e.filter(Boolean)),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==r?(s=[...r],t[2]=r,t[3]=s):s=t[3];const i=s;let n;t[4]!==i||t[5]!==m?(n=xe.sandboxInvoke(m?`${m.orgSlug}/${m.virtualMcpId}/${m.branch}`:"none",`blog-products-by-ids:${i.join(",")}`),t[4]=i,t[5]=m,t[6]=n):n=t[6];let f;t[7]!==i||t[8]!==m?(f=()=>ve(m,Ns(i)).then(Xe),t[7]=i,t[8]=m,t[9]=f):f=t[9];const d=!!m&&i.length>0;let c;t[10]!==n||t[11]!==f||t[12]!==d?(c={queryKey:n,queryFn:f,enabled:d,staleTime:6e4,retry:1},t[10]=n,t[11]=f,t[12]=d,t[13]=c):c=t[13];const x=he(c);let g;if(t[14]!==x.data){g=new Map;for(const o of x.data??[])g.set(o.id,o);t[14]=x.data,t[15]=g}else g=t[15];let h;return t[16]!==g||t[17]!==x.isError||t[18]!==x.isLoading?(h={byId:g,isLoading:x.isLoading,isError:x.isError},t[16]=g,t[17]=x.isError,t[18]=x.isLoading,t[19]=h):h=t[19],h}const _s=[{id:"search",label:"Search"},{id:"category",label:"Category"},{id:"cluster",label:"Cluster ID"}];async function As(m,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(n=>ve(m,n))),r=t.filter(n=>n.status==="fulfilled").map(n=>n.value);if(r.length===0){const n=t.find(f=>f.status==="rejected");throw n?n.reason:new Error("Failed to fetch products")}const s=[],i=new Set;for(const n of r)for(const f of Xe(n))i.has(f.id)||(i.add(f.id),s.push(f));return s}function Ae(m){const e=T.c(6),[t,r]=V.useState(""),[s,i]=V.useState(""),n=V.useRef(null);let f;e[0]!==m?(f=x=>{r(x),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>i(x),m)},e[0]=m,e[1]=f):f=e[1];const d=f;let c;return e[2]!==s||e[3]!==d||e[4]!==t?(c={value:t,debounced:s,onChange:d},e[2]=s,e[3]=d,e[4]=t,e[5]=c):c=e[5],c}function Ts(m){const e=T.c(23),{option:t,selected:r,onToggle:s}=m,i=r?"border-primary/40 bg-primary/5":"border-transparent hover:bg-muted/60";let n;e[0]!==i?(n=Y("flex w-full items-center gap-3 rounded-md border px-2 py-2 text-left transition-colors",i),e[0]=i,e[1]=n):n=e[1];let f;e[2]!==t.image?(f=l.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:t.image?l.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):l.jsx(be,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=f):f=e[3];let d;e[4]!==t.label?(d=l.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let c;e[6]!==t.id?(c=l.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=c):c=e[7];let x;e[8]!==d||e[9]!==c?(x=l.jsxs("span",{className:"min-w-0 flex-1",children:[d,c]}),e[8]=d,e[9]=c,e[10]=x):x=e[10];const g=r?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let h;e[11]!==g?(h=Y("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",g),e[11]=g,e[12]=h):h=e[12];let o;e[13]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(qe,{size:12}),e[13]=o):o=e[13];let a;e[14]!==h?(a=l.jsx("span",{className:h,children:o}),e[14]=h,e[15]=a):a=e[15];let u;return e[16]!==s||e[17]!==r||e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==x?(u=l.jsxs("button",{type:"button",onClick:s,"aria-pressed":r,className:n,children:[f,x,a]}),e[16]=s,e[17]=r,e[18]=a,e[19]=n,e[20]=f,e[21]=x,e[22]=u):u=e[22],u}function We(m){const e=T.c(6),{query:t,emptyLabel:r,loadingLabel:s}=m;if(t.isLoading){let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(Me,{size:"xs"}),e[0]=n):n=e[0];let f;return e[1]!==s?(f=l.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[n,s]}),e[1]=s,e[2]=f):f=e[2],f}if(t.isError){let n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:"Couldn’t load — is the dev server running?"}),e[3]=n):n=e[3],n}let i;return e[4]!==r?(i=l.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:r}),e[4]=r,e[5]=i):i=e[5],i}function Ze(m){return`${m.orgSlug}/${m.virtualMcpId}/${m.branch}`}function $s(m){const e=T.c(33),{sandboxRef:t,open:r,selected:s,onSelect:i}=m,[n,f]=V.useState("");let d;e[0]!==t?(d=xe.sandboxInvoke(Ze(t),"blog-category-tree"),e[0]=t,e[1]=d):d=e[1];let c;e[2]!==t?(c=()=>ve(t,js()).then(ks),e[2]=t,e[3]=c):c=e[3];const x=r&&!s;let g;e[4]!==d||e[5]!==c||e[6]!==x?(g={queryKey:d,queryFn:c,enabled:x,staleTime:6e4,retry:1},e[4]=d,e[5]=c,e[6]=x,e[7]=g):g=e[7];const h=he(g);if(s){let v;e[8]!==i?(v=()=>i(null),e[8]=i,e[9]=v):v=e[9];let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(jt,{size:14}),e[10]=N):N=e[10];let j;e[11]!==s.label?(j=l.jsxs("span",{className:"truncate",children:["Category: ",l.jsx("span",{className:"text-foreground",children:s.label})," — change"]}),e[11]=s.label,e[12]=j):j=e[12];let C;return e[13]!==v||e[14]!==j?(C=l.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[N,j]}),e[13]=v,e[14]=j,e[15]=C):C=e[15],C}let o,a,u,p;if(e[16]!==n||e[17]!==i||e[18]!==h){const v=Ss(h.data??[],n);u="space-y-2";let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=j=>f(j.target.value),e[23]=N):N=e[23],e[24]!==n?(p=l.jsx(pe,{value:n,onChange:N,placeholder:"Filter categories…",className:"h-9"}),e[24]=n,e[25]=p):p=e[25],o="h-48 overflow-y-auto rounded-md border",a=v.length===0?l.jsx(We,{query:h,loadingLabel:"Loading categories…",emptyLabel:"No categories."}):l.jsx("div",{className:"p-1",children:v.map(j=>l.jsx("button",{type:"button",onClick:()=>i(j),className:"block w-full truncate rounded px-2 py-1.5 text-left text-sm hover:bg-muted/60",children:j.label},j.path))}),e[16]=n,e[17]=i,e[18]=h,e[19]=o,e[20]=a,e[21]=u,e[22]=p}else o=e[19],a=e[20],u=e[21],p=e[22];let b;e[26]!==o||e[27]!==a?(b=l.jsx("div",{className:o,children:a}),e[26]=o,e[27]=a,e[28]=b):b=e[28];let y;return e[29]!==u||e[30]!==p||e[31]!==b?(y=l.jsxs("div",{className:u,children:[p,b]}),e[29]=u,e[30]=p,e[31]=b,e[32]=y):y=e[32],y}function et(m){const e=T.c(73),{open:t,onOpenChange:r,sandboxRef:s,selectedIds:i,onChange:n,multiple:f}=m,d=f===void 0?!0:f,[c,x]=V.useState("search"),g=Ae(300),h=Ae(300),[o,a]=V.useState(null),u=c==="search"?g.debounced:c==="cluster"?h.debounced:o?.path??"";let p;e[0]!==c||e[1]!==u?(p=vs(c,u),e[0]=c,e[1]=u,e[2]=p):p=e[2];const b=p;let y;e[3]!==c||e[4]!==s||e[5]!==u?(y=xe.sandboxInvoke(Ze(s),`blog-product:${c}:${u}`),e[3]=c,e[4]=s,e[5]=u,e[6]=y):y=e[6];let v;e[7]!==b||e[8]!==s?(v=()=>As(s,b),e[7]=b,e[8]=s,e[9]=v):v=e[9];const N=t&&b.length>0;let j;e[10]!==y||e[11]!==v||e[12]!==N?(j={queryKey:y,queryFn:v,enabled:N,staleTime:6e4,retry:1},e[10]=y,e[11]=v,e[12]=N,e[13]=j):j=e[13];const C=he(j);let S;e[14]!==i?(S=new Set(i.filter(Boolean)),e[14]=i,e[15]=S):S=e[15];const k=S;let _;e[16]!==d||e[17]!==n||e[18]!==k||e[19]!==i?(_=z=>{if(!d){n(k.has(z)?[]:[z]);return}k.has(z)?n(i.filter(lt=>lt!==z)):n([...i.filter(Boolean),z])},e[16]=d,e[17]=n,e[18]=k,e[19]=i,e[20]=_):_=e[20];const w=_;let I;e[21]!==C.data?(I=C.data??[],e[21]=C.data,e[22]=I):I=e[22];const P=I,O=b.length===0,W=d?"Add products":"Choose a product";let K;e[23]!==W?(K=l.jsx(Ot,{className:"border-b border-border px-4 py-3",children:l.jsx(zt,{className:"text-sm font-medium",children:W})}),e[23]=W,e[24]=K):K=e[24];let H;e[25]!==c?(H=_s.map(z=>l.jsx("button",{type:"button",onClick:()=>x(z.id),className:Y("rounded-md px-2.5 py-1 text-sm transition-colors",c===z.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:z.label},z.id)),e[25]=c,e[26]=H):H=e[26];let F;e[27]!==H?(F=l.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:H}),e[27]=H,e[28]=F):F=e[28];let M;e[29]!==c||e[30]!==g?(M=c==="search"&&l.jsx(pe,{autoFocus:!0,value:g.value,onChange:z=>g.onChange(z.target.value),placeholder:"Search products by name or ID…",className:"h-9"}),e[29]=c,e[30]=g,e[31]=M):M=e[31];let L;e[32]!==h||e[33]!==c?(L=c==="cluster"&&l.jsx(pe,{autoFocus:!0,value:h.value,onChange:z=>h.onChange(z.target.value),placeholder:"Collection / cluster ID (e.g. 2140)",className:"h-9"}),e[32]=h,e[33]=c,e[34]=L):L=e[34];let $;e[35]!==o||e[36]!==c||e[37]!==t||e[38]!==s?($=c==="category"&&l.jsx($s,{sandboxRef:s,open:t,selected:o,onSelect:a}),e[35]=o,e[36]=c,e[37]=t,e[38]=s,e[39]=$):$=e[39];let E;e[40]!==M||e[41]!==L||e[42]!==$?(E=l.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[M,L,$]}),e[40]=M,e[41]=L,e[42]=$,e[43]=E):E=e[43];let D;e[44]!==P||e[45]!==C||e[46]!==k||e[47]!==O||e[48]!==w?(D=P.length>0?P.map(z=>l.jsx(Ts,{option:z,selected:k.has(z.id),onToggle:()=>w(z.id)},z.id)):!O&&l.jsx(We,{query:C,loadingLabel:"Loading products…",emptyLabel:"No products found."}),e[44]=P,e[45]=C,e[46]=k,e[47]=O,e[48]=w,e[49]=D):D=e[49];let q;e[50]!==c||e[51]!==O?(q=O&&l.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:c==="category"?"Pick a category to see its products.":c==="cluster"?"Enter a collection or cluster ID.":"Type to search products."}),e[50]=c,e[51]=O,e[52]=q):q=e[52];let B;e[53]!==D||e[54]!==q?(B=l.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[D,q]}),e[53]=D,e[54]=q,e[55]=B):B=e[55];const U=k.size===0?"None selected":`${k.size} selected`;let R;e[56]!==U?(R=l.jsx("span",{className:"text-xs text-muted-foreground",children:U}),e[56]=U,e[57]=R):R=e[57];let G;e[58]!==r?(G=l.jsx(rt,{size:"sm",onClick:()=>r(!1),children:"Done"}),e[58]=r,e[59]=G):G=e[59];let Q;e[60]!==R||e[61]!==G?(Q=l.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[R,G]}),e[60]=R,e[61]=G,e[62]=Q):Q=e[62];let J;e[63]!==K||e[64]!==F||e[65]!==E||e[66]!==B||e[67]!==Q?(J=l.jsxs(Ft,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[K,F,E,B,Q]}),e[63]=K,e[64]=F,e[65]=E,e[66]=B,e[67]=Q,e[68]=J):J=e[68];let oe;return e[69]!==r||e[70]!==t||e[71]!==J?(oe=l.jsx(Ut,{open:t,onOpenChange:r,children:J}),e[69]=r,e[70]=t,e[71]=J,e[72]=oe):oe=e[72],oe}const Is=["normal","h1","h2","h3"],Ls=/^<(h[1-3])>([\s\S]*)<\/\1>$/i;function Bs(m){const e=m.match(Ls);return e?{level:e[1].toLowerCase(),text:e[2]}:{level:"normal",text:m}}function Te(m,e){return e?m==="normal"?e:`<${m}>${e}</${m}>`:""}const $e={normal:"Normal",h1:"H1",h2:"H2",h3:"H3"},Es={normal:"text-lg font-semibold",h1:"text-3xl font-bold",h2:"text-2xl font-bold",h3:"text-xl font-semibold"};function Ps(m){const e=T.c(23),{value:t,onChange:r}=m;let s,i,n,f,d;e[0]!==r||e[1]!==t?({level:s,text:d}=Bs(t),f="space-y-1.5",i="flex items-center gap-0.5",n=Is.map(u=>l.jsx(re,{active:s===u,label:$e[u],onClick:()=>r(Te(u,d)),children:$e[u]},u)),e[0]=r,e[1]=t,e[2]=s,e[3]=i,e[4]=n,e[5]=f,e[6]=d):(s=e[2],i=e[3],n=e[4],f=e[5],d=e[6]);let c;e[7]!==i||e[8]!==n?(c=l.jsx("div",{className:i,children:n}),e[7]=i,e[8]=n,e[9]=c):c=e[9];let x;e[10]!==s||e[11]!==r?(x=u=>r(Te(s,u.target.value)),e[10]=s,e[11]=r,e[12]=x):x=e[12];const g=Es[s];let h;e[13]!==g?(h=Y("w-full border-0 bg-transparent p-0 outline-none placeholder:text-muted-foreground/50 focus:ring-0",g),e[13]=g,e[14]=h):h=e[14];let o;e[15]!==x||e[16]!==h||e[17]!==d?(o=l.jsx("input",{value:d,onChange:x,placeholder:"Shelf title",className:h}),e[15]=x,e[16]=h,e[17]=d,e[18]=o):o=e[18];let a;return e[19]!==f||e[20]!==c||e[21]!==o?(a=l.jsxs("div",{className:f,children:[c,o]}),e[19]=f,e[20]=c,e[21]=o,e[22]=a):a=e[22],a}function tt(m){const e=T.c(4),{label:t,onClick:r}=m;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.jsx(be,{size:13}),e[0]=s):s=e[0];let i;return e[1]!==t||e[2]!==r?(i=l.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[s,t]}),e[1]=t,e[2]=r,e[3]=i):i=e[3],i}function st(m){const e=T.c(9),{option:t,loading:r,className:s,iconSize:i}=m,n=i===void 0?18:i;let f;e[0]!==s?(f=Y("flex items-center justify-center overflow-hidden bg-muted text-muted-foreground",s),e[0]=s,e[1]=f):f=e[1];let d;e[2]!==n||e[3]!==r||e[4]!==t?(d=t?.image?l.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-contain p-1.5"}):r?l.jsx(Me,{size:"xs"}):l.jsx(Pt,{size:n}),e[2]=n,e[3]=r,e[4]=t,e[5]=d):d=e[5];let c;return e[6]!==f||e[7]!==d?(c=l.jsx("span",{className:f,children:d}),e[6]=f,e[7]=d,e[8]=c):c=e[8],c}function Rs(m){const e=T.c(36),{id:t,option:r,loading:s,onRemove:i}=m;let n;e[0]!==t?(n={id:t},e[0]=t,e[1]=n):n=e[1];const{attributes:f,listeners:d,setNodeRef:c,transform:x,transition:g,isDragging:h}=Fe(n);let o;e[2]!==x?(o=Ue.Transform.toString(x),e[2]=x,e[3]=o):o=e[3];let a;e[4]!==o||e[5]!==g?(a={transform:o,transition:g},e[4]=o,e[5]=g,e[6]=a):a=e[6];const u=h&&"z-10 opacity-60";let p;e[7]!==u?(p=Y("group/card relative flex flex-col overflow-hidden rounded-md border bg-background",u),e[7]=u,e[8]=p):p=e[8];let b;e[9]!==s||e[10]!==r?(b=l.jsx(st,{option:r,loading:s,className:"h-full w-full"}),e[9]=s,e[10]=r,e[11]=b):b=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(He,{size:13}),e[12]=y):y=e[12];let v;e[13]!==f||e[14]!==d?(v=l.jsx("button",{type:"button","aria-label":"Drag to reorder",...f,...d,className:"absolute left-1 top-1 flex h-6 w-6 cursor-grab items-center justify-center rounded bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-foreground active:cursor-grabbing group-hover/card:opacity-100",children:y}),e[13]=f,e[14]=d,e[15]=v):v=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(Dt,{size:13}),e[16]=N):N=e[16];let j;e[17]!==i?(j=l.jsx("button",{type:"button","aria-label":"Remove product",onClick:i,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded bg-background/80 text-muted-foreground opacity-0 backdrop-blur-sm transition-opacity hover:text-destructive group-hover/card:opacity-100 cursor-pointer",children:N}),e[17]=i,e[18]=j):j=e[18];let C;e[19]!==j||e[20]!==b||e[21]!==v?(C=l.jsxs("div",{className:"relative aspect-square",children:[b,v,j]}),e[19]=j,e[20]=b,e[21]=v,e[22]=C):C=e[22];const S=r?.label??(s?"Loading…":`Product ${t}`);let k;e[23]!==S?(k=l.jsx("p",{className:"line-clamp-2 text-xs leading-tight text-foreground",children:S}),e[23]=S,e[24]=k):k=e[24];let _;e[25]!==t?(_=l.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["ID ",t]}),e[25]=t,e[26]=_):_=e[26];let w;e[27]!==k||e[28]!==_?(w=l.jsxs("div",{className:"flex flex-col gap-0.5 p-2",children:[k,_]}),e[27]=k,e[28]=_,e[29]=w):w=e[29];let I;return e[30]!==c||e[31]!==C||e[32]!==w||e[33]!==a||e[34]!==p?(I=l.jsxs("div",{ref:c,style:a,className:p,children:[C,w]}),e[30]=c,e[31]=C,e[32]=w,e[33]=a,e[34]=p,e[35]=I):I=e[35],I}function Ds(m){const e=T.c(21),{ids:t,lookup:r,onReorder:s,onRemove:i}=m;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:6}},e[0]=n):n=e[0];let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f={coordinateGetter:Pe},e[1]=f):f=e[1];const d=Le(ie(Ee,n),ie(Be,f));let c;e[2]!==t||e[3]!==s?(c=u=>{const{active:p,over:b}=u;if(!b||p.id===b.id)return;const y=t.indexOf(String(p.id)),v=t.indexOf(String(b.id));y===-1||v===-1||s(Re(t,y,v))},e[2]=t,e[3]=s,e[4]=c):c=e[4];const x=c;let g;if(e[5]!==t||e[6]!==r||e[7]!==i){let u;e[9]!==r||e[10]!==i?(u=p=>l.jsx(Rs,{id:p,option:r.byId.get(p),loading:r.isLoading&&!r.byId.get(p),onRemove:()=>i(p)},p),e[9]=r,e[10]=i,e[11]=u):u=e[11],g=t.map(u),e[5]=t,e[6]=r,e[7]=i,e[8]=g}else g=e[8];let h;e[12]!==g?(h=l.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:g}),e[12]=g,e[13]=h):h=e[13];let o;e[14]!==t||e[15]!==h?(o=l.jsx(De,{items:t,strategy:ct,children:h}),e[14]=t,e[15]=h,e[16]=o):o=e[16];let a;return e[17]!==x||e[18]!==d||e[19]!==o?(a=l.jsx(Oe,{sensors:d,collisionDetection:ze,onDragEnd:x,children:o}),e[17]=x,e[18]=d,e[19]=o,e[20]=a):a=e[20],a}function Os(m){const e=T.c(5),{onBrowse:t}=m;let r,s,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=l.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted text-muted-foreground",children:l.jsx(Rt,{size:16})}),s=l.jsx("span",{className:"text-sm font-medium text-foreground",children:"Add products"}),i=l.jsx("span",{className:"text-xs text-muted-foreground",children:"Search VTEX products, or pick a category or cluster"}),e[0]=r,e[1]=s,e[2]=i):(r=e[0],s=e[1],i=e[2]);let n;return e[3]!==t?(n=l.jsxs("button",{type:"button",onClick:t,className:"flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border border-dashed py-8 text-center transition-colors hover:border-foreground/30 hover:bg-muted/40 cursor-pointer",children:[r,s,i]}),e[3]=t,e[4]=n):n=e[4],n}function zs(m){const e=T.c(19),{ids:t,onChange:r}=m;let s;e[0]!==t||e[1]!==r?(s=(h,o)=>r(t.map((a,u)=>u===h?o:a)),e[0]=t,e[1]=r,e[2]=s):s=e[2];const i=s;let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(ne,{className:"text-xs text-muted-foreground",children:"VTEX product IDs"}),e[3]=n):n=e[3];let f;e[4]!==t.length?(f=t.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"Start the dev server to browse products, or add SKU ids below."}),e[4]=t.length,e[5]=f):f=e[5];let d;e[6]!==t||e[7]!==r||e[8]!==i?(d=t.map((h,o)=>l.jsxs("li",{className:"group/item flex items-center gap-3",children:[l.jsx("input",{value:h,onChange:a=>i(o,a.target.value),placeholder:"151331",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),l.jsx(ee,{label:"Remove product ID",onClick:()=>r(t.filter((a,u)=>u!==o))})]},o)),e[6]=t,e[7]=r,e[8]=i,e[9]=d):d=e[9];let c;e[10]!==d?(c=l.jsx("ul",{className:"space-y-2",children:d}),e[10]=d,e[11]=c):c=e[11];let x;e[12]!==t||e[13]!==r?(x=l.jsx(te,{label:"Add product ID",onClick:()=>r([...t,""])}),e[12]=t,e[13]=r,e[14]=x):x=e[14];let g;return e[15]!==f||e[16]!==c||e[17]!==x?(g=l.jsxs("div",{className:"space-y-2",children:[n,f,c,x]}),e[15]=f,e[16]=c,e[17]=x,e[18]=g):g=e[18],g}function Fs(m){const e=T.c(31),{block:t,onChange:r,sandboxRef:s}=m;let i,n;e[0]!==t.products?(i=Je(t.products),n=new Set(i.filter(Boolean)),e[0]=t.products,e[1]=i,e[2]=n):(i=e[1],n=e[2]);let f;e[3]!==n?(f=[...n],e[3]=n,e[4]=f):f=e[4];const d=f,[c,x]=V.useState(!1),g=Qe(s,d);let h;e[5]!==t||e[6]!==r?(h=N=>r({...t,products:Ke(t.products,N)}),e[5]=t,e[6]=r,e[7]=h):h=e[7];const o=h;let a;e[8]!==t.title?(a=A(t.title),e[8]=t.title,e[9]=a):a=e[9];let u;e[10]!==t||e[11]!==r?(u=N=>r({...t,title:N}),e[10]=t,e[11]=r,e[12]=u):u=e[12];let p;e[13]!==a||e[14]!==u?(p=l.jsx(Ps,{value:a,onChange:u}),e[13]=a,e[14]=u,e[15]=p):p=e[15];let b;e[16]!==d||e[17]!==g||e[18]!==i||e[19]!==s||e[20]!==o?(b=s?l.jsxs("div",{className:"space-y-3",children:[d.length>0&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:[d.length," ",d.length===1?"product":"products"]}),l.jsx(tt,{label:"Browse products",onClick:()=>x(!0)})]}),d.length===0?l.jsx(Os,{onBrowse:()=>x(!0)}):l.jsx(Ds,{ids:d,lookup:g,onReorder:o,onRemove:N=>o(d.filter(j=>j!==N))})]}):l.jsx(zs,{ids:i,onChange:o}),e[16]=d,e[17]=g,e[18]=i,e[19]=s,e[20]=o,e[21]=b):b=e[21];let y;e[22]!==d||e[23]!==c||e[24]!==s||e[25]!==o?(y=s&&l.jsx(et,{open:c,onOpenChange:x,sandboxRef:s,selectedIds:d,onChange:o}),e[22]=d,e[23]=c,e[24]=s,e[25]=o,e[26]=y):y=e[26];let v;return e[27]!==p||e[28]!==b||e[29]!==y?(v=l.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[p,b,y]}),e[27]=p,e[28]=b,e[29]=y,e[30]=v):v=e[30],v}function Us(m){const e=T.c(16),{id:t,option:r,loading:s,onRemove:i}=m;let n;e[0]!==s||e[1]!==r?(n=l.jsx(st,{option:r,loading:s,className:"h-11 w-11 shrink-0 rounded",iconSize:16}),e[0]=s,e[1]=r,e[2]=n):n=e[2];const f=r?.label??(s?"Loading…":`Product ${t}`);let d;e[3]!==f?(d=l.jsx("p",{className:"truncate text-sm text-foreground",children:f}),e[3]=f,e[4]=d):d=e[4];let c;e[5]!==t?(c=l.jsxs("p",{className:"text-xs text-muted-foreground",children:["ID ",t]}),e[5]=t,e[6]=c):c=e[6];let x;e[7]!==d||e[8]!==c?(x=l.jsxs("div",{className:"min-w-0 flex-1",children:[d,c]}),e[7]=d,e[8]=c,e[9]=x):x=e[9];let g;e[10]!==i?(g=l.jsx(ee,{label:"Remove product",onClick:i}),e[10]=i,e[11]=g):g=e[11];let h;return e[12]!==n||e[13]!==x||e[14]!==g?(h=l.jsxs("div",{className:"group/item flex items-center gap-3 rounded-md border bg-background p-2",children:[n,x,g]}),e[12]=n,e[13]=x,e[14]=g,e[15]=h):h=e[15],h}function Vs(m){const e=T.c(50),{block:t,onChange:r,sandboxRef:s}=m;let i;e[0]!==t.product?(i=Je(t.product).filter(Boolean)[0]??"",e[0]=t.product,e[1]=i):i=e[1];const n=i,[f,d]=V.useState(!1);let c;e[2]!==n?(c=n?[n]:[],e[2]=n,e[3]=c):c=e[3];const x=Qe(s,c);let g;e[4]!==t||e[5]!==r?(g=O=>r({...t,product:Ke(t.product,O)}),e[4]=t,e[5]=r,e[6]=g):g=e[6];const h=g;let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Product card"}),e[7]=o):o=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(ne,{htmlFor:"product-card-cta",className:"text-xs text-muted-foreground",children:"CTA label"}),e[8]=a):a=e[8];let u;e[9]!==t.textCta?(u=A(t.textCta),e[9]=t.textCta,e[10]=u):u=e[10];let p;e[11]!==t||e[12]!==r?(p=O=>r({...t,textCta:O.target.value}),e[11]=t,e[12]=r,e[13]=p):p=e[13];let b;e[14]!==u||e[15]!==p?(b=l.jsxs("div",{className:"space-y-2",children:[a,l.jsx("input",{id:"product-card-cta",value:u,onChange:p,placeholder:"Ver produto",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[14]=u,e[15]=p,e[16]=b):b=e[16];let y;e[17]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(ne,{htmlFor:"product-card-slug",className:"text-xs text-muted-foreground",children:"Product slug"}),e[17]=y):y=e[17];let v;e[18]!==t.productSlug?(v=A(t.productSlug),e[18]=t.productSlug,e[19]=v):v=e[19];let N;e[20]!==t||e[21]!==r?(N=O=>r({...t,productSlug:O.target.value}),e[20]=t,e[21]=r,e[22]=N):N=e[22];let j;e[23]!==v||e[24]!==N?(j=l.jsxs("div",{className:"space-y-2",children:[y,l.jsx("input",{id:"product-card-slug",value:v,onChange:N,placeholder:"product-slug",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"})]}),e[23]=v,e[24]=N,e[25]=j):j=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx(ne,{className:"text-xs text-muted-foreground",children:"Product"}),e[26]=C):C=e[26];let S;e[27]!==n||e[28]!==s?(S=s&&n&&l.jsx(tt,{label:"Change",onClick:()=>d(!0)}),e[27]=n,e[28]=s,e[29]=S):S=e[29];let k;e[30]!==S?(k=l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C,S]}),e[30]=S,e[31]=k):k=e[31];let _;e[32]!==x||e[33]!==n||e[34]!==s||e[35]!==h?(_=s?n?l.jsx(Us,{id:n,option:x.byId.get(n),loading:x.isLoading,onRemove:()=>h([])}):l.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed py-3 text-sm text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[l.jsx(be,{size:14}),"Choose a product"]}):l.jsx("input",{value:n,onChange:O=>h(O.target.value?[O.target.value]:[]),placeholder:"VTEX product ID (e.g. 151331)",className:"h-9 w-full rounded-md border bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50 focus:ring-0"}),e[32]=x,e[33]=n,e[34]=s,e[35]=h,e[36]=_):_=e[36];let w;e[37]!==k||e[38]!==_?(w=l.jsxs("div",{className:"space-y-2",children:[k,_]}),e[37]=k,e[38]=_,e[39]=w):w=e[39];let I;e[40]!==f||e[41]!==n||e[42]!==s||e[43]!==h?(I=s&&l.jsx(et,{open:f,onOpenChange:d,sandboxRef:s,selectedIds:n?[n]:[],onChange:h,multiple:!1}),e[40]=f,e[41]=n,e[42]=s,e[43]=h,e[44]=I):I=e[44];let P;return e[45]!==j||e[46]!==w||e[47]!==I||e[48]!==b?(P=l.jsxs("div",{className:"space-y-4 rounded-lg border bg-card p-4",children:[o,b,j,w,I]}),e[45]=j,e[46]=w,e[47]=I,e[48]=b,e[49]=P):P=e[49],P}const Hs=2,qs=2;function Ms(m){return se(m).map(A)}function Gs(m){return se(m).map(e=>Array.isArray(e)?e.map(A):[])}function Ie(m){return Array.from({length:m},()=>"")}function Js(m){const e=T.c(42),{headers:t,rows:r,onChange:s}=m;let i,n,f,d,c,x,g,h,o;if(e[0]!==t||e[1]!==s||e[2]!==r){const S=Ms(t),k=Gs(r),_=S.length===0&&k.length===0;f=_?Hs:Math.max(S.length,...k.map(Xs),1);const w=Array.from({length:f},(L,$)=>S[$]??"");d=_?Array.from({length:qs},()=>Ie(f)):k.map(L=>Array.from({length:f},($,E)=>L[E]??""));let I;e[12]!==s?(I=(L,$)=>s({headers:JSON.stringify(L.some(Ys)?L:[]),rows:JSON.stringify($)}),e[12]=s,e[13]=I):I=e[13];const P=I,O=(L,$)=>P(w.map((E,D)=>D===L?$:E),d),W=(L,$,E)=>P(w,d.map((D,q)=>q===L?D.map((B,U)=>U===$?E:B):D));n=()=>P(w,[...d,Ie(f)]);const K=L=>P(w,d.filter(($,E)=>E!==L));i=()=>P([...w,""],d.map(Ks));const H=L=>P(w.filter(($,E)=>E!==L),d.map($=>$.filter((E,D)=>D!==L)));o="space-y-2",h="overflow-x-auto rounded-lg border",x="w-full border-collapse";let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx("th",{className:"w-8 border-b"}),e[14]=F):F=e[14];const M=l.jsxs("tr",{className:"bg-muted/40",children:[w.map((L,$)=>l.jsxs("th",{className:"group/col relative border-b border-r p-0 last:border-r-0",children:[l.jsx("input",{value:L,onChange:E=>O($,E.target.value),placeholder:`Header ${$+1}`,className:"w-full border-0 bg-transparent py-2 pl-7 pr-3 text-xs font-semibold uppercase tracking-wide outline-none placeholder:text-muted-foreground/40 focus:bg-background focus:ring-0"}),f>1&&l.jsx("button",{type:"button","aria-label":`Remove column ${$+1}`,onClick:()=>H($),className:"absolute left-0.5 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground/50 opacity-0 transition-opacity hover:text-destructive group-hover/col:opacity-100 cursor-pointer",children:l.jsx(me,{size:12})})]},$)),F]});e[15]!==M?(g=l.jsx("thead",{children:M}),e[15]=M,e[16]=g):g=e[16],c=d.map((L,$)=>l.jsxs("tr",{className:"group/item border-b last:border-b-0",children:[L.map((E,D)=>l.jsx("td",{className:"border-r p-0 last:border-r-0",children:l.jsx("input",{value:E,onChange:q=>W($,D,q.target.value),placeholder:"—",className:"w-full border-0 bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/30 focus:bg-muted/30 focus:ring-0"})},D)),l.jsx("td",{className:"w-8 text-center align-middle",children:d.length>1&&l.jsx("button",{type:"button","aria-label":`Remove row ${$+1}`,onClick:()=>K($),className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer",children:l.jsx(me,{size:13})})})]},$)),e[0]=t,e[1]=s,e[2]=r,e[3]=i,e[4]=n,e[5]=f,e[6]=d,e[7]=c,e[8]=x,e[9]=g,e[10]=h,e[11]=o}else i=e[3],n=e[4],f=e[5],d=e[6],c=e[7],x=e[8],g=e[9],h=e[10],o=e[11];let a;e[17]!==f||e[18]!==d.length?(a=d.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:f+1,className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No rows yet — add one below."})}),e[17]=f,e[18]=d.length,e[19]=a):a=e[19];let u;e[20]!==c||e[21]!==a?(u=l.jsxs("tbody",{children:[c,a]}),e[20]=c,e[21]=a,e[22]=u):u=e[22];let p;e[23]!==x||e[24]!==g||e[25]!==u?(p=l.jsxs("table",{className:x,children:[g,u]}),e[23]=x,e[24]=g,e[25]=u,e[26]=p):p=e[26];let b;e[27]!==h||e[28]!==p?(b=l.jsx("div",{className:h,children:p}),e[27]=h,e[28]=p,e[29]=b):b=e[29];let y;e[30]!==n?(y=l.jsx(te,{label:"Add row",onClick:n}),e[30]=n,e[31]=y):y=e[31];let v;e[32]===Symbol.for("react.memo_cache_sentinel")?(v=l.jsx(Ve,{size:13}),e[32]=v):v=e[32];let N;e[33]!==i?(N=l.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-1.5 rounded-md border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground cursor-pointer",children:[v,"Add column"]}),e[33]=i,e[34]=N):N=e[34];let j;e[35]!==y||e[36]!==N?(j=l.jsxs("div",{className:"flex gap-2",children:[y,N]}),e[35]=y,e[36]=N,e[37]=j):j=e[37];let C;return e[38]!==j||e[39]!==o||e[40]!==b?(C=l.jsxs("div",{className:o,children:[b,j]}),e[38]=j,e[39]=o,e[40]=b,e[41]=C):C=e[41],C}function Ks(m){return[...m,""]}function Ys(m){return m.trim()!==""}function Xs(m){return m.length}function Qs(m){const e=T.c(182),{block:t,meta:r,onChange:s,sandboxRef:i}=m,n=t.__resolveType??"",f=dt(n);if(ut(n))switch(f){case"Paragraph":{let o;e[0]!==t.html?(o=A(t.html),e[0]=t.html,e[1]=o):o=e[1];let a;e[2]!==t||e[3]!==s?(a=p=>s({...t,html:p}),e[2]=t,e[3]=s,e[4]=a):a=e[4];let u;return e[5]!==o||e[6]!==a?(u=l.jsx(Qt,{html:o,placeholder:"Write something…",onChange:a}),e[5]=o,e[6]=a,e[7]=u):u=e[7],u}case"Heading":{let o;e[8]!==t.text?(o=A(t.text),e[8]=t.text,e[9]=o):o=e[9];let a;e[10]!==t.level?(a=A(t.level),e[10]=t.level,e[11]=a):a=e[11];let u;e[12]!==t||e[13]!==s?(u=b=>s({...t,...b}),e[12]=t,e[13]=s,e[14]=u):u=e[14];let p;return e[15]!==o||e[16]!==a||e[17]!==u?(p=l.jsx(Zt,{text:o,level:a,onChange:u}),e[15]=o,e[16]=a,e[17]=u,e[18]=p):p=e[18],p}case"Quote":{let o;e[19]!==t.quote?(o=A(t.quote),e[19]=t.quote,e[20]=o):o=e[20];let a;e[21]!==t||e[22]!==s?(a=p=>s({...t,quote:p}),e[21]=t,e[22]=s,e[23]=a):a=e[23];let u;return e[24]!==o||e[25]!==a?(u=l.jsx(es,{quote:o,onChange:a}),e[24]=o,e[25]=a,e[26]=u):u=e[26],u}case"Code":{let o;e[27]!==t.code?(o=A(t.code),e[27]=t.code,e[28]=o):o=e[28];let a;e[29]!==t.language?(a=A(t.language),e[29]=t.language,e[30]=a):a=e[30];let u;e[31]!==t||e[32]!==s?(u=b=>s({...t,...b}),e[31]=t,e[32]=s,e[33]=u):u=e[33];let p;return e[34]!==o||e[35]!==a||e[36]!==u?(p=l.jsx(ts,{code:o,language:a,onChange:u}),e[34]=o,e[35]=a,e[36]=u,e[37]=p):p=e[37],p}case"List":{let o;e[38]!==t.items?(o=A(t.items),e[38]=t.items,e[39]=o):o=e[39];let a;e[40]!==t.style?(a=A(t.style),e[40]=t.style,e[41]=a):a=e[41];let u;e[42]!==t||e[43]!==s?(u=b=>s({...t,...b}),e[42]=t,e[43]=s,e[44]=u):u=e[44];let p;return e[45]!==o||e[46]!==a||e[47]!==u?(p=l.jsx(ss,{items:o,style:a,onChange:u}),e[45]=o,e[46]=a,e[47]=u,e[48]=p):p=e[48],p}case"BlockImage":{let o;return e[49]!==t||e[50]!==s?(o=l.jsx(ls,{block:t,onChange:s}),e[49]=t,e[50]=s,e[51]=o):o=e[51],o}case"Video":{let o;e[52]!==t.url?(o=A(t.url),e[52]=t.url,e[53]=o):o=e[53];let a;e[54]!==t.caption?(a=A(t.caption),e[54]=t.caption,e[55]=a):a=e[55];let u;e[56]!==t||e[57]!==s?(u=b=>s({...t,...b}),e[56]=t,e[57]=s,e[58]=u):u=e[58];let p;return e[59]!==o||e[60]!==a||e[61]!==u?(p=l.jsx(os,{url:o,caption:a,onChange:u}),e[59]=o,e[60]=a,e[61]=u,e[62]=p):p=e[62],p}case"Divider":{let o;return e[63]===Symbol.for("react.memo_cache_sentinel")?(o=l.jsx(ns,{}),e[63]=o):o=e[63],o}case"Cta":{let o;e[64]!==t.text?(o=A(t.text),e[64]=t.text,e[65]=o):o=e[65];let a;e[66]!==t.href?(a=A(t.href),e[66]=t.href,e[67]=a):a=e[67];let u;e[68]!==t||e[69]!==s?(u=b=>s({...t,...b}),e[68]=t,e[69]=s,e[70]=u):u=e[70];let p;return e[71]!==o||e[72]!==a||e[73]!==u?(p=l.jsx(is,{text:o,href:a,onChange:u}),e[71]=o,e[72]=a,e[73]=u,e[74]=p):p=e[74],p}case"Callout":{let o;e[75]!==t.title?(o=A(t.title),e[75]=t.title,e[76]=o):o=e[76];let a;e[77]!==t.body?(a=A(t.body),e[77]=t.body,e[78]=a):a=e[78];let u;e[79]!==t.variant?(u=A(t.variant),e[79]=t.variant,e[80]=u):u=e[80];let p;e[81]!==t||e[82]!==s?(p=y=>s({...t,...y}),e[81]=t,e[82]=s,e[83]=p):p=e[83];let b;return e[84]!==o||e[85]!==a||e[86]!==u||e[87]!==p?(b=l.jsx(as,{title:o,body:a,variant:u,onChange:p}),e[84]=o,e[85]=a,e[86]=u,e[87]=p,e[88]=b):b=e[88],b}case"Stat":{let o;e[89]!==t.value?(o=A(t.value),e[89]=t.value,e[90]=o):o=e[90];let a;e[91]!==t.label?(a=A(t.label),e[91]=t.label,e[92]=a):a=e[92];let u;e[93]!==t.description?(u=A(t.description),e[93]=t.description,e[94]=u):u=e[94];let p;e[95]!==t||e[96]!==s?(p=y=>s({...t,...y}),e[95]=t,e[96]=s,e[97]=p):p=e[97];let b;return e[98]!==o||e[99]!==a||e[100]!==u||e[101]!==p?(b=l.jsx(cs,{value:o,label:a,description:u,onChange:p}),e[98]=o,e[99]=a,e[100]=u,e[101]=p,e[102]=b):b=e[102],b}case"StatGroup":{let o;e[103]!==t.stats?(o=A(t.stats),e[103]=t.stats,e[104]=o):o=e[104];let a;e[105]!==t||e[106]!==s?(a=p=>s({...t,stats:p}),e[105]=t,e[106]=s,e[107]=a):a=e[107];let u;return e[108]!==o||e[109]!==a?(u=l.jsx(fs,{stats:o,onChange:a}),e[108]=o,e[109]=a,e[110]=u):u=e[110],u}case"CardGroup":{let o;e[111]!==t.cards?(o=typeof t.cards=="string"?t.cards:JSON.stringify(t.cards??[]),e[111]=t.cards,e[112]=o):o=e[112];let a;e[113]!==t||e[114]!==s?(a=p=>s({...t,cards:p}),e[113]=t,e[114]=s,e[115]=a):a=e[115];let u;return e[116]!==o||e[117]!==a?(u=l.jsx(ds,{cards:o,onChange:a}),e[116]=o,e[117]=a,e[118]=u):u=e[118],u}case"Checklist":{let o;e[119]!==t.title?(o=A(t.title),e[119]=t.title,e[120]=o):o=e[120];let a;e[121]!==t.items?(a=A(t.items),e[121]=t.items,e[122]=a):a=e[122];let u;e[123]!==t||e[124]!==s?(u=b=>s({...t,...b}),e[123]=t,e[124]=s,e[125]=u):u=e[125];let p;return e[126]!==o||e[127]!==a||e[128]!==u?(p=l.jsx(us,{title:o,items:a,onChange:u}),e[126]=o,e[127]=a,e[128]=u,e[129]=p):p=e[129],p}case"Steps":{let o;e[130]!==t.title?(o=A(t.title),e[130]=t.title,e[131]=o):o=e[131];let a;e[132]!==t.steps?(a=A(t.steps),e[132]=t.steps,e[133]=a):a=e[133];let u;e[134]!==t||e[135]!==s?(u=b=>s({...t,...b}),e[134]=t,e[135]=s,e[136]=u):u=e[136];let p;return e[137]!==o||e[138]!==a||e[139]!==u?(p=l.jsx(ms,{title:o,steps:a,onChange:u}),e[137]=o,e[138]=a,e[139]=u,e[140]=p):p=e[140],p}case"Comparison":{let o;e[141]!==t.left?(o=A(t.left),e[141]=t.left,e[142]=o):o=e[142];let a;e[143]!==t.right?(a=A(t.right),e[143]=t.right,e[144]=a):a=e[144];let u;e[145]!==t||e[146]!==s?(u=b=>s({...t,...b}),e[145]=t,e[146]=s,e[147]=u):u=e[147];let p;return e[148]!==o||e[149]!==a||e[150]!==u?(p=l.jsx(ps,{left:o,right:a,onChange:u}),e[148]=o,e[149]=a,e[150]=u,e[151]=p):p=e[151],p}case"Table":{let o;e[152]!==t.headers?(o=typeof t.headers=="string"?t.headers:JSON.stringify(t.headers??[]),e[152]=t.headers,e[153]=o):o=e[153];let a;e[154]!==t.rows?(a=typeof t.rows=="string"?t.rows:JSON.stringify(t.rows??[]),e[154]=t.rows,e[155]=a):a=e[155];let u;e[156]!==t||e[157]!==s?(u=b=>s({...t,...b}),e[156]=t,e[157]=s,e[158]=u):u=e[158];let p;return e[159]!==o||e[160]!==a||e[161]!==u?(p=l.jsx(Js,{headers:o,rows:a,onChange:u}),e[159]=o,e[160]=a,e[161]=u,e[162]=p):p=e[162],p}case"ProductCard":{let o;return e[163]!==t||e[164]!==s||e[165]!==i?(o=l.jsx(Vs,{block:t,onChange:s,sandboxRef:i}),e[163]=t,e[164]=s,e[165]=i,e[166]=o):o=e[166],o}case"ProductShelf":{let o;return e[167]!==t||e[168]!==s||e[169]!==i?(o=l.jsx(Fs,{block:t,onChange:s,sandboxRef:i}),e[167]=t,e[168]=s,e[169]=i,e[170]=o):o=e[170],o}}let c;e[171]!==r||e[172]!==n?(c=n?ft(n,r):null,e[171]=r,e[172]=n,e[173]=c):c=e[173];const x=c;if(!x){const o=n?` (${n})`:"";let a;return e[174]!==o?(a=l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Unknown block type",o,"."]}),e[174]=o,e[175]=a):a=e[175],a}let g;e[176]!==s?(g=o=>s(o),e[176]=s,e[177]=g):g=e[177];let h;return e[178]!==t||e[179]!==x||e[180]!==g?(h=l.jsx(mt,{schema:x,value:t,onChange:g,basePath:""}),e[178]=t,e[179]=x,e[180]=g,e[181]=h):h=e[181],h}function Ws(m){const e=T.c(34),{id:t,block:r,meta:s,onChange:i,onDelete:n,onDuplicate:f,sandboxRef:d}=m;let c;e[0]!==t?(c={id:t},e[0]=t,e[1]=c):c=e[1];const{attributes:x,listeners:g,setNodeRef:h,transform:o,transition:a,isDragging:u}=Fe(c);let p;e[2]!==o?(p=Ue.Transform.toString(o),e[2]=o,e[3]=p):p=e[3];let b;e[4]!==p||e[5]!==a?(b={transform:p,transition:a},e[4]=p,e[5]=a,e[6]=b):b=e[6];const y=u&&"opacity-50";let v;e[7]!==y?(v=Y("group/row relative rounded-md py-1.5 pl-12 pr-2 transition-colors hover:bg-muted/40",y),e[7]=y,e[8]=v):v=e[8];let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=l.jsx(He,{size:14}),e[9]=N):N=e[9];let j;e[10]!==x||e[11]!==g?(j=l.jsx("button",{type:"button","aria-label":"Drag to reorder",className:"absolute left-1 top-1.5 flex h-6 w-6 cursor-grab items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground active:cursor-grabbing group-hover/row:opacity-100",...x,...g,children:N}),e[10]=x,e[11]=g,e[12]=j):j=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=l.jsx($t,{size:14}),e[13]=C):C=e[13];let S;e[14]!==f?(S=l.jsx("button",{type:"button","aria-label":"Duplicate block",onClick:f,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground cursor-pointer",children:C}),e[14]=f,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=l.jsx(me,{size:14}),e[16]=k):k=e[16];let _;e[17]!==n?(_=l.jsx("button",{type:"button","aria-label":"Delete block",onClick:n,className:"flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-destructive cursor-pointer",children:k}),e[17]=n,e[18]=_):_=e[18];let w;e[19]!==_||e[20]!==S?(w=l.jsxs("div",{className:"absolute right-1 top-1 z-10 flex flex-row gap-0.5 rounded-md bg-background/80 opacity-0 backdrop-blur-sm transition-opacity group-hover/row:opacity-100",children:[S,_]}),e[19]=_,e[20]=S,e[21]=w):w=e[21];let I;e[22]!==r||e[23]!==s||e[24]!==i||e[25]!==d?(I=l.jsx(Qs,{block:r,meta:s,onChange:i,sandboxRef:d}),e[22]=r,e[23]=s,e[24]=i,e[25]=d,e[26]=I):I=e[26];let P;return e[27]!==h||e[28]!==w||e[29]!==I||e[30]!==b||e[31]!==v||e[32]!==j?(P=l.jsxs("div",{ref:h,style:b,className:v,children:[j,w,I]}),e[27]=h,e[28]=w,e[29]=I,e[30]=b,e[31]=v,e[32]=j,e[33]=P):P=e[33],P}function Sl(m){return Array.isArray(m)?m:[]}function wl(m){const e=T.c(64),{value:t,onChange:r,meta:s,sandboxRef:i,emptyMessage:n}=m,f=n===void 0?"No content yet. Use ⊕ to add your first block.":n;let d;e[0]!==s?(d=pt(s),e[0]=s,e[1]=d):d=e[1];const c=d;let x;e[2]!==t?(x=()=>t.map(sl),e[2]=t,e[3]=x):x=e[3];const[g,h]=V.useState(x);let o;e[4]!==g?(o=g.map(tl),e[4]=g,e[5]=o):o=e[5];const a=o;let u;e[6]!==g?(u=g.map(el),e[6]=g,e[7]=u):u=e[7];const p=u;let b;e[8]!==r?(b=B=>{h(B),r(B.map(Zs))},e[8]=r,e[9]=b):b=e[9];const y=b;let v;e[10]!==g||e[11]!==y?(v=(B,U)=>{const R=[...g];R.splice(B,0,{id:ge(),block:{__resolveType:U}}),y(R)},e[10]=g,e[11]=y,e[12]=v):v=e[12];const N=v;let j;e[13]!==g||e[14]!==y?(j=(B,U)=>{y(g.map((R,G)=>G===B?{...R,block:U}:R))},e[13]=g,e[14]=y,e[15]=j):j=e[15];const C=j;let S;e[16]!==g||e[17]!==y?(S=B=>{y(g.filter((U,R)=>R!==B))},e[16]=g,e[17]=y,e[18]=S):S=e[18];const k=S;let _;e[19]!==g||e[20]!==y?(_=B=>{const U=g[B];if(!U)return;const R=[...g];R.splice(B+1,0,{id:ge(),block:structuredClone(U.block)}),y(R)},e[19]=g,e[20]=y,e[21]=_):_=e[21];const w=_;let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I={activationConstraint:{distance:6}},e[22]=I):I=e[22];let P;e[23]===Symbol.for("react.memo_cache_sentinel")?(P={coordinateGetter:Pe},e[23]=P):P=e[23];const O=Le(ie(Ee,I),ie(Be,P));let W;e[24]!==g||e[25]!==y?(W=B=>{const{active:U,over:R}=B;if(!R||U.id===R.id)return;const G=g.findIndex(J=>J.id===String(U.id)),Q=g.findIndex(J=>J.id===String(R.id));G===-1||Q===-1||y(Re(g,G,Q))},e[24]=g,e[25]=y,e[26]=W):W=e[26];const K=W;let H;e[27]!==p.length||e[28]!==f?(H=p.length===0&&l.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:f}),e[27]=p.length,e[28]=f,e[29]=H):H=e[29];let F;e[30]!==N?(F=B=>N(0,B),e[30]=N,e[31]=F):F=e[31];const M=p.length===0;let L;e[32]!==c||e[33]!==F||e[34]!==M?(L=l.jsx(ke,{blockTypes:c,onInsert:F,alwaysShow:M}),e[32]=c,e[33]=F,e[34]=M,e[35]=L):L=e[35];let $;if(e[36]!==g||e[37]!==c||e[38]!==w||e[39]!==N||e[40]!==s||e[41]!==k||e[42]!==i||e[43]!==C){let B;e[45]!==c||e[46]!==w||e[47]!==N||e[48]!==s||e[49]!==k||e[50]!==i||e[51]!==C?(B=(U,R)=>{const{id:G,block:Q}=U;return l.jsxs("div",{children:[l.jsx(Ws,{id:G,block:Q,meta:s,onChange:J=>C(R,J),onDelete:()=>k(R),onDuplicate:()=>w(R),sandboxRef:i}),l.jsx(ke,{blockTypes:c,onInsert:J=>N(R+1,J)})]},G)},e[45]=c,e[46]=w,e[47]=N,e[48]=s,e[49]=k,e[50]=i,e[51]=C,e[52]=B):B=e[52],$=g.map(B),e[36]=g,e[37]=c,e[38]=w,e[39]=N,e[40]=s,e[41]=k,e[42]=i,e[43]=C,e[44]=$}else $=e[44];let E;e[53]!==a||e[54]!==L||e[55]!==$?(E=l.jsxs(De,{items:a,strategy:gt,children:[L,$]}),e[53]=a,e[54]=L,e[55]=$,e[56]=E):E=e[56];let D;e[57]!==K||e[58]!==O||e[59]!==E?(D=l.jsx(Oe,{sensors:O,collisionDetection:ze,onDragEnd:K,children:E}),e[57]=K,e[58]=O,e[59]=E,e[60]=D):D=e[60];let q;return e[61]!==H||e[62]!==D?(q=l.jsxs("div",{className:"mt-2",children:[H,D]}),e[61]=H,e[62]=D,e[63]=q):q=e[63],q}function Zs(m){return m.block}function el(m){return m.block}function tl(m){return m.id}function sl(m){return{id:ge(),block:m}}function ge(){return crypto.randomUUID()}export{wl as B,Sl as a,kl as b,Cl as c};
|