decocms 4.514.4 → 4.514.6
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/{ActiveShapeUtils-nFzQGM_y.js → ActiveShapeUtils-DV40gvcg.js} +1 -1
- package/dist/client/assets/{AlertCircle-BKEHXsE7.js → AlertCircle-Ctbquk5a.js} +1 -1
- package/dist/client/assets/{AreaChart-CW_cA_el.js → AreaChart-C_4ebEom.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D81aL8fM.js → ArrowLeft-DZ0mAFgb.js} +1 -1
- package/dist/client/assets/{ArrowUp-DfLaoCfv.js → ArrowUp-bYg1aEOe.js} +1 -1
- package/dist/client/assets/{BarChart-D0FGQ4Mg.js → BarChart-DfTtCBDv.js} +1 -1
- package/dist/client/assets/{Building02-CfaCzC7T.js → Building02-BHIVlbfK.js} +1 -1
- package/dist/client/assets/{CartesianChart-8wmktLTV.js → CartesianChart-uNdbRuTj.js} +1 -1
- package/dist/client/assets/{CategoricalChart-zXV0drbf.js → CategoricalChart-CRSSpo7X.js} +1 -1
- package/dist/client/assets/{CheckCircle-pswqe0yQ.js → CheckCircle-C2ndOEUO.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-yLR6uZzh.js → ChevronSelectorVertical-DaUdbCWk.js} +1 -1
- package/dist/client/assets/{ChevronUp-DtK5u9ST.js → ChevronUp-C8mqlnDX.js} +1 -1
- package/dist/client/assets/{Copy01-LCHR9m-G.js → Copy01-DC8f0fwU.js} +1 -1
- package/dist/client/assets/{CreditCard01-DDybX_8i.js → CreditCard01-P7j8oDkg.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dl2HDAjP.js → DotsVertical-BvwGTDkC.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DE4zTG89.js → ErrorBarContext-KwnilJkg.js} +1 -1
- package/dist/client/assets/{Globe04-C3qOiXr7.js → Globe04-D6C-ihBU.js} +1 -1
- package/dist/client/assets/{Image01-t87ZE04W.js → Image01-D7F4wuKx.js} +1 -1
- package/dist/client/assets/{Key01-S4YXCnrO.js → Key01-u4HXXUPa.js} +1 -1
- package/dist/client/assets/{Link01-nrYS0m93.js → Link01-BoUupQbW.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CjyqnNbo.js → LinkBroken01-BJx0R97x.js} +1 -1
- package/dist/client/assets/{Minus-Q9-Po73D.js → Minus-C1PMcNV0.js} +1 -1
- package/dist/client/assets/{Monitor01-BmtAT73A.js → Monitor01-D3VwU2ni.js} +1 -1
- package/dist/client/assets/{Play-B5do76Ow.js → Play-DxsFk4r2.js} +1 -1
- package/dist/client/assets/{Plus-DEIwMEqz.js → Plus-BDveVGJf.js} +1 -1
- package/dist/client/assets/{ReferenceLine-DwjozkX7.js → ReferenceLine-ILm1GG8J.js} +1 -1
- package/dist/client/assets/{SearchMd-UGgqPivi.js → SearchMd-Cuf45jFP.js} +1 -1
- package/dist/client/assets/{Sector-C2CduweT.js → Sector-D2xOkxuc.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-BvYm46M_.js → ShoppingBag01-BMRnsG58.js} +1 -1
- package/dist/client/assets/{Sun-rxG-ROZD.js → Sun-sKGpeIhM.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BUQctc0G.js → SwitchHorizontal01-CshMTQzi.js} +1 -1
- package/dist/client/assets/{Tool01-BjWCTgWh.js → Tool01-BM29_KWq.js} +1 -1
- package/dist/client/assets/{Trash01-CIzl9L8e.js → Trash01-D92WhXf2.js} +1 -1
- package/dist/client/assets/{Upload01-BZdlKO8o.js → Upload01-BSDy4f7m.js} +1 -1
- package/dist/client/assets/{User01-C-yKb_Na.js → User01-Cn3JqTjv.js} +1 -1
- package/dist/client/assets/{UserSquare-BX_UIOch.js → UserSquare-Drp4z0v0.js} +1 -1
- package/dist/client/assets/{Users01-BAB4CQHt.js → Users01-Cxbx87gg.js} +1 -1
- package/dist/client/assets/{XClose-BW8V9Mau.js → XClose-dOW_RI9u.js} +1 -1
- package/dist/client/assets/{ZoomOut-BaK1kO8c.js → ZoomOut-BfQx-fBr.js} +1 -1
- package/dist/client/assets/{access-gate-R9-SDKyD.js → access-gate-BjUA5Gw_.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-bYFWev7Q.js → add-connection-dialog-B0vtW1sl.js} +1 -1
- package/dist/client/assets/{agent-analytics-BgXU0CmI.js → agent-analytics-D74l8HWB.js} +1 -1
- package/dist/client/assets/agent-app-CEBVAZwO.js +1 -0
- package/dist/client/assets/{agent-assets-BJZg8qhR.js → agent-assets-Bwo-LFkg.js} +1 -1
- package/dist/client/assets/{agent-automation--X0QS-Gl.js → agent-automation-Cc45Az0m.js} +1 -1
- package/dist/client/assets/{agent-automations-eEPMDBMc.js → agent-automations-Du82D3qr.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-CRXebciL.js → agent-connect-sources-mK6fw0FS.js} +1 -1
- package/dist/client/assets/agent-deck-BZZHzjdZ.js +1 -0
- package/dist/client/assets/{agent-e2e-DJ0skb34.js → agent-e2e-D6ovLSkg.js} +1 -1
- package/dist/client/assets/{agent-experiments-DjAzPErc.js → agent-experiments-Bf1OqB1m.js} +1 -1
- package/dist/client/assets/agent-file-CzvpBEaK.js +1 -0
- package/dist/client/assets/{agent-hosting-DudPkaIg.js → agent-hosting-6te_9jdz.js} +1 -1
- package/dist/client/assets/{agent-icon-rZeVl9Rl.js → agent-icon-U4gZaLOQ.js} +1 -1
- package/dist/client/assets/agent-library-BOSIxUYz.js +1 -0
- package/dist/client/assets/agent-library-file-C0RqJ45T.js +1 -0
- package/dist/client/assets/{agent-monitor-ayWTyLig.js → agent-monitor-C3Fta9kk.js} +1 -1
- package/dist/client/assets/{agent-overview-BXPfkXp6.js → agent-overview-NPCMkyDB.js} +1 -1
- package/dist/client/assets/{agent-releases-BHf3P0zv.js → agent-releases-COSsnWfe.js} +1 -1
- package/dist/client/assets/agent-settings-DDIl5jyz.js +1 -0
- package/dist/client/assets/{agent-site-editor-BUjwQa1T.js → agent-site-editor-DlN_1OE1.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-ByOIwjcy.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DSEuxkJh.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-pw2RBbYs.js +1 -0
- package/dist/client/assets/agent-view-IbmF6KBh.js +1 -0
- package/dist/client/assets/{agent-view-guard-BpxxI-Li.js → agent-view-guard-Bk4OTT2f.js} +1 -1
- package/dist/client/assets/{agents-list-BqVe9HeB.js → agents-list-B_j46cpj.js} +1 -1
- package/dist/client/assets/{ai-providers-Cbeufjse.js → ai-providers-Cb4AWs2D.js} +1 -1
- package/dist/client/assets/{alert-Ge1PvRkU.js → alert-B29bfkXd.js} +1 -1
- package/dist/client/assets/{alert-dialog-DGPL6Sul.js → alert-dialog-CKDHmJ-l.js} +1 -1
- package/dist/client/assets/{analytics-sections-DfU-HPHE.js → analytics-sections-wgH0NLyS.js} +1 -1
- package/dist/client/assets/api-keys-CiMyiLjo.js +1 -0
- package/dist/client/assets/{api-keys-CGj2gphX.js → api-keys-Xjw7lgqR.js} +1 -1
- package/dist/client/assets/{app-editor-Bnf2IFBn.js → app-editor-DgdEdwhZ.js} +1 -1
- package/dist/client/assets/{asset-utils-BfDmoNac.js → asset-utils-DrTFUoo_.js} +1 -1
- package/dist/client/assets/{auth-catchall-szGfHVda.js → auth-catchall-CIV9IiTJ.js} +1 -1
- package/dist/client/assets/{auth-entry-CfqU_pp2.js → auth-entry-ctrK7teX.js} +1 -1
- package/dist/client/assets/{auth-dECedNaO.js → auth-hgpoCSIS.js} +1 -1
- package/dist/client/assets/{auth-split-layout-zFJVMQW0.js → auth-split-layout-DkyooQGo.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BI5fpBCJ.js → authenticate-and-persist-oauth-jn1R1qId.js} +1 -1
- package/dist/client/assets/{automation-list-row-nTIicn2r.js → automation-list-row-qFFhCtZo.js} +1 -1
- package/dist/client/assets/{automation-runs-C_Fenz8y.js → automation-runs-C367-v6a.js} +1 -1
- package/dist/client/assets/{automations-C3HG2AUA.js → automations-8JKgpNEK.js} +1 -1
- package/dist/client/assets/{autosend-CUbKy0s-.js → autosend-BZOm698U.js} +1 -1
- package/dist/client/assets/{avatar-Bwp-Xc5s.js → avatar-RpIBVCkY.js} +1 -1
- package/dist/client/assets/{badge-dosB_-4a.js → badge-Cnnepvq1.js} +1 -1
- package/dist/client/assets/{block-document-SqlzHipw.js → block-document-baEM6UJG.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-J4LmPADm.js → blocks-preview-workspace-context-Ca46yWEV.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-DKkBL3yJ.js → blocks-tab-states-jGeS9iVz.js} +3 -3
- package/dist/client/assets/{blog-schema-DrvA3-E7.js → blog-schema-CUOOV4a2.js} +1 -1
- package/dist/client/assets/{buckets-MFDKP_DD.js → buckets-p2Fiyc0f.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CmyFLmXV.js → build-improve-prompt-doc-ClmcYJRa.js} +1 -1
- package/dist/client/assets/{calendar-CS0FMW9V.js → calendar-DqVFnL9A.js} +1 -1
- package/dist/client/assets/{capability-load-error-DwR-XbDb.js → capability-load-error-DdN4o47w.js} +1 -1
- package/dist/client/assets/{category-editor-BH1u-0CE.js → category-editor-Gr46SDP4.js} +1 -1
- package/dist/client/assets/{chart-CK7GPIHE.js → chart-B5vy2nis.js} +1 -1
- package/dist/client/assets/{chat-context-DGKtupvP.js → chat-context-_d3c57p1.js} +1 -1
- package/dist/client/assets/{chat-draft-CR7qKiZW.js → chat-draft-CKcHhXuF.js} +1 -1
- package/dist/client/assets/{checkbox-CSo6M-6b.js → checkbox-CUzk21sc.js} +1 -1
- package/dist/client/assets/{choose-editor-D9oQ3uFZ.js → choose-editor-BFcNvSv4.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DLlz7zNV.js → cli-auth-success-BolfyrKO.js} +1 -1
- package/dist/client/assets/{client-icons-Cu_VeKS2.js → client-icons-50FpZDWK.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CxJ3W3GB.js +1 -0
- package/dist/client/assets/{collapsible-82CZUSRZ.js → collapsible-CeBZpglT.js} +1 -1
- package/dist/client/assets/{collection-detail-DFiz0PNq.js → collection-detail-BXVqh2XU.js} +1 -1
- package/dist/client/assets/{collection-display-button-u8azE1jK.js → collection-display-button-El-xnsaW.js} +1 -1
- package/dist/client/assets/{collection-search-JLOqgXSU.js → collection-search-gW4FCqmq.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-xzcEzLCL.js → collection-table-wrapper-CB0t7kAl.js} +1 -1
- package/dist/client/assets/{collection-tabs-ClvmGOqD.js → collection-tabs-DIFXv7hR.js} +1 -1
- package/dist/client/assets/{column-rules-BuMug1kg.js → column-rules-o-DlIK_-.js} +1 -1
- package/dist/client/assets/{combobox-TZ4RmWfI.js → combobox-DlpsfK7m.js} +1 -1
- package/dist/client/assets/{coming-soon-page-BrWbdSFq.js → coming-soon-page-ZTZUbFgV.js} +1 -1
- package/dist/client/assets/{command-YtmkYLwE.js → command-C7n5qLsN.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DmfKGx8E.js → companion-mcps-section-C2rDEgkL.js} +1 -1
- package/dist/client/assets/{config-BXEb6qjV.js → config-BCpfsSBB.js} +1 -1
- package/dist/client/assets/{connect-Dk5dqwe8.js → connect-Du_rXIM1.js} +1 -1
- package/dist/client/assets/{connect-layout-CAq5B13E.js → connect-layout-DyGwITyt.js} +1 -1
- package/dist/client/assets/{connection-CU2PwZyg.js → connection-Dik4epzq.js} +1 -1
- package/dist/client/assets/{connection-card-Bf6UkDd9.js → connection-card-DCnmTKpJ.js} +1 -1
- package/dist/client/assets/{connection-detail-CS3q9gzr.js → connection-detail-CaTyUBlA.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B_xUWFll.js → connection-form-helpers-ta2yIvIb.js} +1 -1
- package/dist/client/assets/{connections--l3N3T2i.js → connections-Dy2qa1bG.js} +1 -1
- package/dist/client/assets/{content-tab-tOKm2eMX.js → content-tab-YH7YYY48.js} +3 -3
- package/dist/client/assets/{context-DkeFELTS.js → context-3twD8BEv.js} +1 -1
- package/dist/client/assets/{context-menu-3z4rcXzD.js → context-menu-BUZj1ZG7.js} +1 -1
- package/dist/client/assets/{context-shell-CMaJQRGG.js → context-shell-CWF9i3Vt.js} +3 -3
- package/dist/client/assets/{core.esm-DeTgmZgN.js → core.esm-DNra8pgf.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CuiwUtLx.js → create-organization-dialog-BkJvAp86.js} +1 -1
- package/dist/client/assets/{daily-pulse-BEmMTzG-.js → daily-pulse-DYjhyf3I.js} +1 -1
- package/dist/client/assets/{discover-G4Np02u5.js → discover-nnC5Qnas.js} +1 -1
- package/dist/client/assets/{domain-settings--EwUJ9iT.js → domain-settings-CpxFWOzU.js} +1 -1
- package/dist/client/assets/{drawer-COuxoIPq.js → drawer-ZlYTI3Z6.js} +1 -1
- package/dist/client/assets/{editor-CT6aDT4h.js → editor-BFHySd1K.js} +1 -1
- package/dist/client/assets/{editor-classes-C5mmUd_p.js → editor-classes-DPi5BWR5.js} +1 -1
- package/dist/client/assets/{empty-state-BJ_BjmBA.js → empty-state-Bok1L2hc.js} +1 -1
- package/dist/client/assets/{empty-state-DjiRKbHi.js → empty-state-Cu20Qj3-.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DCoskE6n.js → extract-connection-data-CNLani4P.js} +1 -1
- package/dist/client/assets/{feature-gate-DZNUWe0P.js → feature-gate-dfnyrtcC.js} +1 -1
- package/dist/client/assets/{feature-paywall-BaUYa8qG.js → feature-paywall-D-GfxA1X.js} +1 -1
- package/dist/client/assets/{file-explorer-DogEkKeq.js → file-explorer-DOlx1A5r.js} +1 -1
- package/dist/client/assets/{file-preview-DI0eRAl3.js → file-preview-DSIiiWjA.js} +1 -1
- package/dist/client/assets/{file-share-button-CcxRIY2R.js → file-share-button-CB7fcIJI.js} +1 -1
- package/dist/client/assets/{file-type-icon-Fh4lxmRD.js → file-type-icon-DPqHd815.js} +1 -1
- package/dist/client/assets/{folder-icon-DucOOoml.js → folder-icon-qexQSaYN.js} +1 -1
- package/dist/client/assets/{form-6kVfawT3.js → form-Dpwt-9St.js} +1 -1
- package/dist/client/assets/{general-DqtTv7tP.js → general-DJuGMWNv.js} +1 -1
- package/dist/client/assets/{home-m8gee_-f.js → home-D9ErGwHG.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-spvj7jCb.js → hosted-publish-feedback-9IsLIhi6.js} +1 -1
- package/dist/client/assets/{icon-button-B0NXCYZw.js → icon-button-CwrVRVUS.js} +1 -1
- package/dist/client/assets/{index-DVLeW6hW.js → index-2uBqLA9S.js} +1 -1
- package/dist/client/assets/{index-DwjOqgVq.js → index-BRzGXE32.js} +1 -1
- package/dist/client/assets/{index-CjiOeyZB.js → index-BWUABroT.js} +1 -1
- package/dist/client/assets/{index-DKt3w3pV.js → index-BpRXpcv4.js} +1 -1
- package/dist/client/assets/index-BqS2UmN9.css +1 -0
- package/dist/client/assets/{index-OmMe1wxV.js → index-C9OgV5Vt.js} +1 -1
- package/dist/client/assets/{index-BDYGqdZJ.js → index-CJu3ft8V.js} +1 -1
- package/dist/client/assets/{index-BpE9ALKU.js → index-CaH7O3hJ.js} +2 -2
- package/dist/client/assets/{index-DTn--46s.js → index-Cd_jqW-G.js} +1 -1
- package/dist/client/assets/{index-CVrQhouC.js → index-DJM5MV7l.js} +1 -1
- package/dist/client/assets/{index-BnQcNfAh.js → index-DK4LlU65.js} +1 -1
- package/dist/client/assets/{index-DpoGKrcE.js → index-DLuP-oy3.js} +1 -1
- package/dist/client/assets/{index-BdqvPq_I.js → index-DPulqOQn.js} +1 -1
- package/dist/client/assets/{index-BeRT15sS.js → index-DUXVtfV1.js} +1 -1
- package/dist/client/assets/{index-4mqxQ_CF.js → index-DzppA2EQ.js} +1 -1
- package/dist/client/assets/{index-DzUJHy5n.js → index-TNsA6rsO.js} +1 -1
- package/dist/client/assets/{index-redirect-B4nMcc4Y.js → index-redirect-CLzDU0fe.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CUzkqvrD.js → infiniteQueryObserver-u-Zd7Oxq.js} +1 -1
- package/dist/client/assets/{infra-billing-DhxORp3B.js → infra-billing-DkMlIjvS.js} +1 -1
- package/dist/client/assets/{input-Hbd41rUw.js → input-D2sd1bar.js} +3 -3
- package/dist/client/assets/{input-DSXv99TZ.js → input-DN6U5jAj.js} +1 -1
- package/dist/client/assets/{integration-icon-Ilfqyxys.js → integration-icon-DCiBepJw.js} +1 -1
- package/dist/client/assets/{jira-icon-tlwupM6f.js → jira-icon-DoiJbCfx.js} +1 -1
- package/dist/client/assets/{label-Byb6HWZH.js → label-Cnc4HQwP.js} +1 -1
- package/dist/client/assets/{layout-voCKlRfq.js → layout-BVW5q62A.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DUEMoq7I.js → legacy-agents-deep-DMfsC9-u.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DCXAudzh.js → legacy-main-redirect-mSx9JMxj.js} +1 -1
- package/dist/client/assets/library-BNARKbpY.js +1 -0
- package/dist/client/assets/{login-HOxtRiGZ.js → login-CN9ueiIT.js} +1 -1
- package/dist/client/assets/{markdown-Dej9RATS.js → markdown-CA3yd3L6.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CQ1qp5-9.js → mcp-app-renderer-Xaw0krD3.js} +1 -1
- package/dist/client/assets/{mcp-oauth-oGpWuhVi.js → mcp-oauth-3Gakbc_U.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BG-oWBlL.js → mcp-oauth-CxgfM8zh.js} +1 -1
- package/dist/client/assets/{members-B_G0pbYI.js → members-54kLIghY.js} +1 -1
- package/dist/client/assets/{memory-BPjaQ4Kh.js → memory-CQX6dqQP.js} +1 -1
- package/dist/client/assets/{mini-report-page-abzNXw_Q.js → mini-report-page-DCq4FNu-.js} +1 -1
- package/dist/client/assets/{mock-board-CaXwh2tM.js → mock-board-CrlDKQvj.js} +3 -3
- package/dist/client/assets/{monaco-editor-CdL13Ko4.js → monaco-editor-C7rmyhBT.js} +1 -1
- package/dist/client/assets/monitoring-DX0mWeP-.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-CGXhSW6L.js → monitoring-stats-row-Bhxzz0Gz.js} +1 -1
- package/dist/client/assets/{multi-select-Ca36UGU7.js → multi-select-DtSzZ5RJ.js} +1 -1
- package/dist/client/assets/{mustache-HR1Haumz.js → mustache-BxPGtFxk.js} +1 -1
- package/dist/client/assets/{new-project-dialog-Doo7kyhT.js → new-project-dialog-DpHJ0D5s.js} +1 -1
- package/dist/client/assets/{oauth-callback-BDajeWC8.js → oauth-callback-ChXsONZm.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BrXBkfFZ.js → oauth-callback-ai-provider-BnJfOlsF.js} +1 -1
- package/dist/client/assets/{onboarding-BRNk4bDG.js → onboarding-CuSBfoiA.js} +1 -1
- package/dist/client/assets/{openai-conversation-Cp4VzKaN.js → openai-conversation-B0QRsRtq.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DfS24tBi.js → optimistic-project-sidebar-views-Cgq6MsN2.js} +1 -1
- package/dist/client/assets/{order-monitor-day-BUGNDHbx.js → order-monitor-day-BHpHKh9K.js} +1 -1
- package/dist/client/assets/{organization-choice-vWQUgFdw.js → organization-choice-hoXHHizl.js} +1 -1
- package/dist/client/assets/{orgs-BLAeoNKy.js → orgs-CsgsGgsX.js} +1 -1
- package/dist/client/assets/{page-seo-form-DVnVZHhC.js → page-seo-form-PX_1VQkb.js} +1 -1
- package/dist/client/assets/{pair-nOzQH_7U.js → pair-5gOZrfkD.js} +1 -1
- package/dist/client/assets/plan-BnqYpKp5.js +1 -0
- package/dist/client/assets/{plan-ladder-Bo1QCqxw.js → plan-ladder-BydnH1hR.js} +1 -1
- package/dist/client/assets/{popover-c8imB8ZN.js → popover-DSRFfUdL.js} +1 -1
- package/dist/client/assets/{post-calendar-DFyAd_qH.js → post-calendar-D_8Ms9Cq.js} +1 -1
- package/dist/client/assets/{post-editor-D0lVlOEr.js → post-editor-lU8h7ku9.js} +1 -1
- package/dist/client/assets/{preview-content-Cp2YMUQv.js → preview-content-hWNiqB3L.js} +1 -1
- package/dist/client/assets/{preview-dialog-MFyGLxAK.js → preview-dialog-HJF1l34b.js} +1 -1
- package/dist/client/assets/{preview-panel-D-U4T9gu.js → preview-panel-PigPEt4W.js} +1 -1
- package/dist/client/assets/{preview-tab-CRczEj8G.js → preview-tab-B-uX9H3E.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-ukCeHMzo.js → product-picker-dialog-BUcziHgK.js} +1 -1
- package/dist/client/assets/{profile-CmgN3YJp.js → profile-D-LHzn9e.js} +1 -1
- package/dist/client/assets/{project-app-view-C0zebxGj.js → project-app-view-CGbP48WX.js} +1 -1
- package/dist/client/assets/{project-apps-BAHY134E.js → project-apps-CajNRGrz.js} +1 -1
- package/dist/client/assets/{project-feed-CKWqMBF-.js → project-feed-uKBIzmIi.js} +1 -1
- package/dist/client/assets/{project-icon-xn6KKGaE.js → project-icon-njec1yh1.js} +1 -1
- package/dist/client/assets/project-reports-BwZ6fxIs.js +1 -0
- package/dist/client/assets/project-tasks-zYigtiRn.js +1 -0
- package/dist/client/assets/{projects-BqBJC9d2.js → projects-OJnagyMB.js} +1 -1
- package/dist/client/assets/{projects-empty-state-D55m_jaW.js → projects-empty-state-C9IhB7We.js} +1 -1
- package/dist/client/assets/{prompts-COT0cmpR.js → prompts-B590L6x_.js} +1 -1
- package/dist/client/assets/record-editor-BxllIkC_.js +1 -0
- package/dist/client/assets/{redirect-editor-C0Vt0bpp.js → redirect-editor-CTLxiYxe.js} +1 -1
- package/dist/client/assets/reports-CJqSx9sD.js +1 -0
- package/dist/client/assets/{reports-CeCMlBXV.js → reports-DBL7SnEu.js} +1 -1
- package/dist/client/assets/{reports-onboarding-sIGyoIIM.js → reports-onboarding-Be9p494r.js} +1 -1
- package/dist/client/assets/{reports-tab-B2Gjt8_e.js → reports-tab-B0M7UKAQ.js} +2 -2
- package/dist/client/assets/{repositories-DhflHwKe.js → repositories-BEFfDE3p.js} +1 -1
- package/dist/client/assets/repositories-DceuH_GA.js +1 -0
- package/dist/client/assets/{repository-binding-3oH3TnyD.js → repository-binding-BLgLcT4o.js} +1 -1
- package/dist/client/assets/{repository-import-picker-C-BHOdIZ.js → repository-import-picker-lphgZTGu.js} +1 -1
- package/dist/client/assets/{repository-picker-D2zUBg0A.js → repository-picker-Dadd-3sc.js} +1 -1
- package/dist/client/assets/{require-capability-DGAfsfb0.js → require-capability-D4hkdMxt.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D4q3UHWX.js → required-auth-layout-e3_y0Tns.js} +1 -1
- package/dist/client/assets/{reset-password-CjXG8DCL.js → reset-password-DPAO5WIu.js} +1 -1
- package/dist/client/assets/{resizable-D0sQwLi7.js → resizable-D4wP3vt7.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-Bsy-SAnr.js → resolve-tab-icon-CE5OwNrK.js} +1 -1
- package/dist/client/assets/{review-settings-CqIcqOZz.js → review-settings-BJK_0aY-.js} +1 -1
- package/dist/client/assets/{roles-CwfZN2Zs.js → roles-CJ569tPn.js} +1 -1
- package/dist/client/assets/{route-1Hputyx-.js → route-Bzf1UEGL.js} +1 -1
- package/dist/client/assets/route-CG_vDQP9.js +1 -0
- package/dist/client/assets/{route-BaysvQtq.js → route-Dfqmjwjm.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-BxTbwuaV.js → sandbox-lifecycle-context-v9W7lV1M.js} +1 -1
- package/dist/client/assets/{schema-Cdnttv65.js → schema-BdFq22Hl.js} +1 -1
- package/dist/client/assets/{schema-CrOnn79s.js → schema-Cx9ZLa-H.js} +1 -1
- package/dist/client/assets/{scroll-area-D2nZWmkP.js → scroll-area-Bnrys5oj.js} +1 -1
- package/dist/client/assets/{search-input-CRQ84Rcs.js → search-input-CXQLMhKZ.js} +1 -1
- package/dist/client/assets/{search-toggle-DJe6aOx6.js → search-toggle-DxUZFRWy.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-DFEUxQ2Q.js → secret-ciphertext-DZr2qcb4.js} +1 -1
- package/dist/client/assets/{secret-picker-BLAtxBgC.js → secret-picker-HHgZv9y6.js} +1 -1
- package/dist/client/assets/{secrets-DZqnvevo.js → secrets-Cm2ZaKef.js} +1 -1
- package/dist/client/assets/{sections-QfQgZ0Fk.js → sections-DT5ozPKC.js} +1 -1
- package/dist/client/assets/{sections-editor-Dju5cdx3.js → sections-editor-CkId24Js.js} +1 -1
- package/dist/client/assets/{select-DbboDM2Y.js → select-CSQbGY9x.js} +1 -1
- package/dist/client/assets/{select-model-CkEgdTiU.js → select-model-NUb0C_oX.js} +1 -1
- package/dist/client/assets/{seo-editor-Bgqf8Wvw.js → seo-editor-D886xssW.js} +1 -1
- package/dist/client/assets/{separator-3Nzbh-2_.js → separator-CjiQChVR.js} +1 -1
- package/dist/client/assets/settings-tab-BmEKDSFe.js +1 -0
- package/dist/client/assets/{sheet-IZSv9mMV.js → sheet-C-yunzji.js} +1 -1
- package/dist/client/assets/{shell-layout-o5EDGsgV.js → shell-layout-vQvYndIW.js} +1 -1
- package/dist/client/assets/site-editor-1ZGqBXbh.js +1 -0
- package/dist/client/assets/{site-editor-toast-CMmEyjwn.js → site-editor-toast-BtFL0E4q.js} +1 -1
- package/dist/client/assets/{skills-C1ZfhZ8l.js → skills-9HRxIPqn.js} +1 -1
- package/dist/client/assets/{slider-Da5umJzS.js → slider-DB0IY-tO.js} +1 -1
- package/dist/client/assets/{sortable.esm-DygwBK0K.js → sortable.esm-C1zl1f3P.js} +1 -1
- package/dist/client/assets/{sso-CfMlD7Ei.js → sso-PqsQn3xP.js} +1 -1
- package/dist/client/assets/{suggestion-16V23GET.js → suggestion-Wgq7DDQo.js} +1 -1
- package/dist/client/assets/{switch-B3SL4byd.js → switch-DYA2xfHU.js} +1 -1
- package/dist/client/assets/{symbol-DjFHt_qH.js → symbol-B8wQ7lKk.js} +1 -1
- package/dist/client/assets/{synced-repos-Cq5hQBT3.js → synced-repos-mXhCt1sQ.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DygpknPW.js → tab-icon-glyph-BpaLtZlY.js} +1 -1
- package/dist/client/assets/{table-B20C_A4l.js → table-BQLxO2Sb.js} +1 -1
- package/dist/client/assets/{tabs-z8w4lUhq.js → tabs-2NCCfhSA.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-DwrkOT2r.js → task-assignee-avatar-FdiZZP36.js} +1 -1
- package/dist/client/assets/{task-board-BllghPg4.js → task-board-DRNr9Dsj.js} +1 -1
- package/dist/client/assets/{task-route-7R43gp5A.js → task-route-BaANwBST.js} +1 -1
- package/dist/client/assets/{task-status-D5NZV4J9.js → task-status-VcYcBtq_.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-Du8PW_1F.js → taskboard-analytics-RJkelUr8.js} +1 -1
- package/dist/client/assets/{tasks-Dum2n8yE.js → tasks-COZY0QCJ.js} +1 -1
- package/dist/client/assets/tasks-CYZeHeAX.js +1 -0
- package/dist/client/assets/{textarea-DIB5tw4r.js → textarea-CxhXyMKI.js} +1 -1
- package/dist/client/assets/{thread-analytics-DWvPjsmt.js → thread-analytics-BGQNbVS2.js} +1 -1
- package/dist/client/assets/{thread-intent-BZm-EFCO.js → thread-intent-DKuqiaG7.js} +1 -1
- package/dist/client/assets/{thread-route-Cqps-enJ.js → thread-route-CQ0phZyI.js} +1 -1
- package/dist/client/assets/{thread-route-Be_GBqtE.js → thread-route-jNELZX1N.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-owT2bQp5.js → thread-sheet-body-Cdv_wHnA.js} +1 -1
- package/dist/client/assets/{time-range-picker-CMWhorHO.js → time-range-picker-DEciYFPf.js} +1 -1
- package/dist/client/assets/{toggle-group-DwqOZ4MY.js → toggle-group-CtdhsZGp.js} +1 -1
- package/dist/client/assets/{tool-namespace-Cg8zLvjP.js → tool-namespace-DTl3so75.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B3HvaLAv.js → toolbar-icon-button-BPY5dUh9.js} +1 -1
- package/dist/client/assets/{tooltip-BVI2BtDO.js → tooltip-B5RmO6BW.js} +1 -1
- package/dist/client/assets/{tooltipContext-DWII1oNN.js → tooltipContext-C93Q6WFf.js} +1 -1
- package/dist/client/assets/{track-9VatN5GC.js → track-BBpplM-4.js} +1 -1
- package/dist/client/assets/{types-DGEWLhFA.js → types-Bt5yyj-z.js} +1 -1
- package/dist/client/assets/{url-slug-BxAIS32w.js → url-slug-B41xLFy_.js} +1 -1
- package/dist/client/assets/{usage-stats-RC7HVDz7.js → usage-stats-BkcKNXzu.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CwDx9RGv.js → use-ai-providers-D1TJRnIR.js} +1 -1
- package/dist/client/assets/{use-automations-esI-a9ei.js → use-automations-B9eI7BBQ.js} +1 -1
- package/dist/client/assets/{use-autosave-BlJaWBoS.js → use-autosave-D3uy94Wi.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-Bp6y46wP.js → use-chat-layout-state-BNudmQ0u.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CcmqI1TT.js → use-clock-tick-D3FoyBXt.js} +1 -1
- package/dist/client/assets/{use-connect-companion-EK_tBR0R.js → use-connect-companion-BLomLbPK.js} +1 -1
- package/dist/client/assets/{use-connection-C5PJp5ki.js → use-connection-BwU_KLSF.js} +1 -1
- package/dist/client/assets/{use-content-sync-CT_R89DD.js → use-content-sync-BgOMBs5q.js} +1 -1
- package/dist/client/assets/{use-copy-CHLOIJ7B.js → use-copy-d7X6hrKI.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CjupUFBL.js → use-create-virtual-mcp-OUIvni0u.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-mo7KqOi2.js → use-date-fns-locale-BuGEMgXR.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B_tNUqHF.js → use-debounced-autosave-KHVF-MyQ.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DRcqPkU3.js → use-debounced-value-DJkh4QSx.js} +1 -1
- package/dist/client/assets/{use-deco-credits-kpB_ljAl.js → use-deco-credits-Dx8wT8P5.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-7DVNLqw5.js → use-decopilot-events-AlKmmETJ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BJGj8-x3.js → use-delete-connection-BQjQHz64.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CfS1pvxP.js → use-deployment-admin-BIA7CHLS.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-M1Pf_Hev.js → use-fast-preview-draft-url-5oeXM-kY.js} +1 -1
- package/dist/client/assets/{use-file-configs-D_kctJ5n.js → use-file-configs-tsH4be9V.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-VSLuhS60.js → use-inbox-feed-bGge9UaE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-RN9jGFYf.js → use-infinite-scroll-BO0n6TVn.js} +1 -1
- package/dist/client/assets/{use-join-requests-BCOdXbZZ.js → use-join-requests-DqhkfI-R.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CXxVz1ce.js → use-main-panel-tabs-BrJK-bL3.js} +1 -1
- package/dist/client/assets/{use-main-schema-v8-B2SCuhcn.js → use-main-schema-v8-CZLsOlEV.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-aacZjJ6n.js → use-mcp-auth-status-DmZSbEuf.js} +1 -1
- package/dist/client/assets/{use-mcp-client-J1ndEcf9.js → use-mcp-client-MRThuZpK.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DNJWm8dw.js → use-mcp-prompts-DHm-ZTib.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D4L1wGVI.js → use-mcp-tools-DiCKzhUm.js} +1 -1
- package/dist/client/assets/{use-members-B24eH4jf.js → use-members-h3MYd8gX.js} +1 -1
- package/dist/client/assets/{use-mobile-Tr1QHP7F.js → use-mobile-DCpa1RnA.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DF_GAhPU.js → use-navigate-to-agent-Bt0oZ-ou.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CRea1MGx.js → use-open-billing-url-B2NuYLXS.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BvXF9uek.js → use-org-auth-client-CL0a2tPL.js} +1 -1
- package/dist/client/assets/{use-org-fs-NBkzIlLN.js → use-org-fs-D_4Q985K.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DJQ1Emm8.js → use-org-repo-syncs-CC0BNhdO.js} +1 -1
- package/dist/client/assets/{use-org-sso-D6QGk2qX.js → use-org-sso-LC63-uuA.js} +1 -1
- package/dist/client/assets/{use-organization-roles-cAP4d5Qj.js → use-organization-roles-D1Q7317o.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CvNS5uqj.js → use-organization-settings-DhvN44pQ.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-xzho_IdK.js → use-panel-navigate-DoD4Atgz.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-B1sZ244h.js → use-project-native-view-presence-DF_1PP5b.js} +1 -1
- package/dist/client/assets/{use-project-scope-BL_T_B-0.js → use-project-scope-Cq4vb2Sy.js} +1 -1
- package/dist/client/assets/{use-recent-apps-uKwF1ZKT.js → use-recent-apps-CeIVmzp8.js} +1 -1
- package/dist/client/assets/{use-releases-BRWfch3N.js → use-releases-DQ--CsAF.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-PHzF2U7A.js → use-reports-diagnostic-CWir9L_Y.js} +1 -1
- package/dist/client/assets/{use-secrets-Fjq05jIs.js → use-secrets-D6tUoaJC.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C5Y0tyB9.js → use-section-preview-base-Ca45yoz9.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-DEH_3BJ7.js → use-sidebar-collapsed-DPHQfMII.js} +1 -1
- package/dist/client/assets/{use-tags-B8VFTGb1.js → use-tags-DE48pnzl.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-e_iVjVgI.js → use-task-board-analytics-DlTk43Uu.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Bi71rM-b.js → use-task-board-events-CSRq29Tm.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CKLjOfFC.js → use-task-board-item-prs-BsxjjcBf.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CJXzsRtm.js → use-task-metadata-ToXrxOCT.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-C4-tdyMf.js → use-thread-analytics-Bu_i1v9r.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BRyva6jJ.js → use-thread-outputs-jyAHyZHI.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-ZoWXsJcj.js +1 -0
- package/dist/client/assets/{useQueries-CXXzgfBx.js → useQueries-CddGJ3VE.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D2W70ffp.js +1 -0
- package/dist/client/assets/{users-d19YD92D.js → users-2guAvf9G.js} +1 -1
- package/dist/client/assets/{utils-DZ5cUVcx.js → utils-DzhKsxx8.js} +1 -1
- package/dist/client/assets/{variant-calendar-DF0w82xq.js → variant-calendar-Bdj0O-mA.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-5TG4p4cZ.js → variant-draft-pointer-_apEPqxm.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BYkH2aU6.js → virtual-mcp-CMZ8dHEU.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-D4CyjfYE.js → watch-sse-pool-DwBbAQ97.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Caj60l9D.js +0 -1
- package/dist/client/assets/agent-deck-C__HnZM1.js +0 -1
- package/dist/client/assets/agent-file-BeBp8n5C.js +0 -1
- package/dist/client/assets/agent-library-DdVopENE.js +0 -1
- package/dist/client/assets/agent-library-file-uDNgnKii.js +0 -1
- package/dist/client/assets/agent-settings-DU_TfnoX.js +0 -1
- package/dist/client/assets/agent-site-editor-code-C-6QY89K.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BxY50t8F.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-oopH768H.js +0 -1
- package/dist/client/assets/agent-view-BReXQMze.js +0 -1
- package/dist/client/assets/api-keys-N7gnHDXr.js +0 -1
- package/dist/client/assets/cms-settings-editor-Bn9fRyLD.js +0 -1
- package/dist/client/assets/index-CWfwo1z9.css +0 -1
- package/dist/client/assets/library-C4bjd1Q1.js +0 -1
- package/dist/client/assets/monitoring-DplmubBN.js +0 -1
- package/dist/client/assets/plan-UUfA5CZ5.js +0 -1
- package/dist/client/assets/project-reports-a-FYZHJz.js +0 -1
- package/dist/client/assets/project-tasks-Ci9CnGcj.js +0 -1
- package/dist/client/assets/record-editor-BzL4Kfgp.js +0 -1
- package/dist/client/assets/reports-BrsdMCkM.js +0 -1
- package/dist/client/assets/repositories-PPuEUfpS.js +0 -1
- package/dist/client/assets/route-CeQaMp2n.js +0 -1
- package/dist/client/assets/settings-tab-BvyLrsti.js +0 -1
- package/dist/client/assets/site-editor-bo0E_jA0.js +0 -1
- package/dist/client/assets/tasks-jHi238nZ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-B6hNZdP6.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BLScoOeo.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-
|
|
2
|
-
import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aZ as Ye,aG as Ne,q as Os,D as Ds,K as Bs,s as Fs,v as Ms,e as Ir,h as gt,I as rs,w as Ur,a_ as Hr,a2 as Sn,a$ as Vr,aY as qr,au as as,aw as os,a5 as Wr,P as is,y as Gr,t as cn,o as Jr,m as Yr}from"./index-BpE9ALKU.js";import{u as $s,g as Qr,c as Xr,B as dn,P as Zr,r as ea,R as ta,a as na,b as Ks,d as zs,i as sa,S as ra,e as aa,f as oa,C as ia,h as la,j as ca,l as da,m as ua,p as fa,k as ma,n as un,N as pa}from"./blocks-tab-states-DKkBL3yJ.js";import{b as ha,c as It,r as Is,l as Us,f as ga,g as va,w as xa}from"./chat-context-DGKtupvP.js";import{t as ba}from"./ChevronUp-DtK5u9ST.js";import{V as ya,W as wa,L as Hs,X as ka,b as Sa,Y as Pa,Z as Ea,_ as ja,$ as Na,a0 as ls,a1 as Ta}from"./agent-icon-rZeVl9Rl.js";import{a as Ca}from"./UserSquare-BX_UIOch.js";import{s as Ra}from"./Plus-DEIwMEqz.js";import{P as La,a as _a,b as Aa}from"./popover-c8imB8ZN.js";import{a as mt,b as pt,c as Vs,d as qs,e as Ws,C as Gs}from"./command-YtmkYLwE.js";import{c as Oa,a as Da}from"./repository-binding-3oH3TnyD.js";import{b as Pn}from"./sandbox-lifecycle-context-BxTbwuaV.js";import{e as Ba}from"./backoff-CrEUbyZT.js";import{f as Fa}from"./thread-intent-BZm-EFCO.js";import{a as Js}from"./input-Hbd41rUw.js";import{S as Ys,A as Ma,B as $a,C as Ka,F as za,G as Ia,H as Ua,I as Ha,u as En,J as jn,K as bn,L as Va,M as qa,N as Wa,c as Ga,b as Qs,O as Ja,P as Qe,z as Ya,Q as Qa,R as Xa,U as Za,x as eo,V as cs,w as to,W as no,e as so}from"./site-editor-toast-CMmEyjwn.js";import{u as ro}from"./use-mobile-Tr1QHP7F.js";import{c as fn,T as mn,a as pn}from"./tooltip-BVI2BtDO.js";import{T as ct}from"./toolbar-icon-button-B3HvaLAv.js";import{b as ao,w as At,a as ds,i as oo}from"./variant-draft-pointer-5TG4p4cZ.js";import{h as io,s as lo,L as co,R as Kt,j as us,N as uo,k as fo,l as ht,n as Nn,m as Xs,f as Fe,v as Zs,o as mo,q as po,r as ho,t as go,u as vo,w as fs,d as xo}from"./secret-ciphertext-DFEUxQ2Q.js";import{r as bo,D as ms,w as ps,b as hs,a as yo}from"./section-preview-url-7zfngvgW.js";import{u as wo}from"./use-fast-preview-draft-url-M1Pf_Hev.js";import{a as ko,c as er}from"./shell-layout-o5EDGsgV.js";import{u as tr,b as So}from"./index-BDYGqdZJ.js";import{u as yn}from"./useQueries-CXXzgfBx.js";import{i as Po}from"./LinkBroken01-CjyqnNbo.js";import{u as nr}from"./blocks-preview-workspace-context-J4LmPADm.js";import{MonacoCodeEditor as Eo}from"./monaco-editor-CdL13Ko4.js";import{a as jo}from"./utils-DZ5cUVcx.js";import{R as gs,a as Ot,b as vs}from"./resizable-D0sQwLi7.js";import{u as No,a as hn}from"./use-main-schema-v8-B2SCuhcn.js";import{w as xs}from"./device-hint-SeLRi17j.js";import{r as To}from"./virtual-mcp-BYkH2aU6.js";import{d as Co}from"./delay-CnY5UFtP.js";import{E as Ro}from"./empty-state-BJ_BjmBA.js";import{G as bs}from"./repository-picker-D2zUBg0A.js";import{R as Lo}from"./repository-import-picker-C-BHOdIZ.js";import{r as _o}from"./preview-source-BsRLGWUP.js";import{A as Ao,a as Oo,b as Do}from"./alert-Ge1PvRkU.js";import{u as Bo}from"./use-task-metadata-CJXzsRtm.js";function Fo(t){const e=ne.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(ya,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(wa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function Mo(t){const e=ne.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Mt("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let b;e[14]!==i.command?(b=i.command&&s.jsx(io,{command:i.command}),e[14]=i.command,e[15]=b):b=e[15];let v;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==b?(v=s.jsxs("div",{className:m,children:[f,b,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=b,e[20]=v):v=e[20];let E;return e[21]!==a||e[22]!==d||e[23]!==v?(E=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,v]}),e[21]=a,e[22]=d,e[23]=v,e[24]=E):E=e[24],E}const $o=[];function zt(t){const e=ne.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?$o:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let b;e[0]!==i?(b=s.jsx(Fo,{waiting:i}),e[0]=i,e[1]=b):b=e[1];let v;e[2]!==m||e[3]!==n?(v=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=v):v=e[4];let E;e[5]!==r?(E=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=E):E=e[6];let g;e[7]!==f||e[8]!==b||e[9]!==v||e[10]!==E?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[b,v,E]}),e[7]=f,e[8]=b,e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,x)=>s.jsx(Mo,{index:x+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let j;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(j=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=j):j=e[19],j}function Ko(t){const e=ne.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=_e();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(Ao,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(Oo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(Do,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let B;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(B=lo(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=B):B=e[6];const{title:R,body:D}=B;let O;e[7]!==D?(O=s.jsx(Kt,{text:D}),e[7]=D,e[8]=O):O=e[8];let F;e[9]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(us,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=F):F=e[9];let _;return e[10]!==l||e[11]!==O||e[12]!==R?(_=s.jsx(zt,{headingLevel:2,waiting:!1,title:R,lead:O,alerts:l,footer:F}),e[10]=l,e[11]=O,e[12]=R,e[13]=_):_=e[13],_}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let b;e[18]!==l||e[19]!==n.kind?(b=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(co,{})]}),e[18]=l,e[19]=n.kind,e[20]=b):b=e[20];let v;e[21]!==a?(v=a("decoServe.guide.step1.title"),e[21]=a,e[22]=v):v=e[22];let E;e[23]!==a?(E=a("decoServe.guide.step1.body"),e[23]=a,e[24]=E):E=e[24];let g;e[25]!==E?(g=s.jsx(Kt,{text:E}),e[25]=E,e[26]=g):g=e[26];let k;e[27]!==v||e[28]!==g?(k={title:v,body:g,command:Ys},e[27]=v,e[28]=g,e[29]=k):k=e[29];let j;e[30]!==a?(j=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=j):j=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let x;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(x=n.kind==="needs-gesture"?s.jsx(Xe,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=x):x=e[40];let w;e[41]!==j||e[42]!==y||e[43]!==x?(w={title:j,body:y,after:x},e[41]=j,e[42]=y,e[43]=x,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(us,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==b?(N=s.jsx(zt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:b,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=b,e[54]=N):N=e[54],N}function zo(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const Io=15e3,Uo=3e3;function Ho(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(x,w)=>setTimeout(x,w),clearTimer:o=x=>clearTimeout(x),timeoutMs:l=Uo}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,b=null,v=null;const E=()=>u.visibilityState==="hidden",g=x=>{d={...d,...x},i(d)},k=async x=>{v=new AbortController;const w=v,T=a(()=>w.abort(),l);try{return await n(x,w.signal),!0}catch(P){if(p)return!1;const N=$a(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:x}}):d.problem?.endpoint===x&&g({problem:null}),!1}finally{o(T),v=null}},j=async()=>{if(b=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(E()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const x of e){if(p)break;if(await k(x)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(x);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),E()){g({status:"paused"});return}b=a(()=>{j()},Ma(f,Io))}}};function y(){if(!p){if(E()){b!==null&&(o(b),b=null),m||g({status:"paused"});return}b!==null&&o(b),f=0,j()}}return u.addEventListener("visibilitychange",y),i(d),j(),()=>{p=!0,b!==null&&o(b),v?.abort(),u.removeEventListener("visibilitychange",y)}}function Vo(t,e){return za(Ia({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const qo=["loopback-network","local-network-access"];async function Wo(){if(Ka(window.location.origin))return null;for(const t of qo)try{return await navigator.permissions.query({name:t})}catch{}return null}let sr=null,ys=!1;const gn=new Set;function Go(t){if(gn.add(t),!ys){ys=!0;const e=n=>{sr=n;for(const r of gn)r()};Wo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>gn.delete(t)}const Jo={status:"stopped",firstRoundDone:!1,problem:null},vn=new Map;function Yo(t){const e=vn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=Ho({candidates:t.split(" "),probe:Vo,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,vn.delete(t))})};return vn.set(t,u),u}function rr(){return S.useSyncExternalStore(Go,ks,ks)}const Qo=()=>()=>{},ws=()=>Jo,ks=()=>sr;function Pc(t){const e=ne.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=rr(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Yo(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Qo,d?.getSnapshot??ws,d?.getSnapshot??ws),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let b;return e[5]!==a||e[6]!==p||e[7]!==m?(b={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=b):b=e[8],b}const Ss={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Xo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...Ss,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ss:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Zo=1e4,ei=1e3,ti=3e4;function ni({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Zo)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const b=Ba(ti,ei,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const v=t.current,E=a.current;!v||!E||!o.current||(v.src=E,d())},b)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const si=1500,ri=500;function ai({iframe:t,reload:e,waitMs:n=si,confirmMs:r=ri}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const oi=$t({tag:Ne(),id:Ne(),classes:Ne(),text:Ne(),html:Ne(),manifestKey:Ne().nullable(),componentName:Ne().nullable(),parents:Ne(),url:Ne(),path:Ne(),viewport:$t({width:Ye(),height:Ye()}),position:$t({x:Ye(),y:Ye()})}),ii=`(function() {
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-CkId24Js.js","assets/index-CaH7O3hJ.js","assets/index-BqS2UmN9.css","assets/chat-context-_d3c57p1.js","assets/use-panel-navigate-DoD4Atgz.js","assets/thread-route-CQ0phZyI.js","assets/use-project-scope-Cq4vb2Sy.js","assets/repository-binding-BLgLcT4o.js","assets/use-mcp-client-MRThuZpK.js","assets/auth-hgpoCSIS.js","assets/autosend-BZOm698U.js","assets/thread-intent-DKuqiaG7.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-DwBbAQ97.js","assets/task-board-DRNr9Dsj.js","assets/schema-BdFq22Hl.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-AlKmmETJ.js","assets/use-ai-providers-D1TJRnIR.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-DhvN44pQ.js","assets/blocks-tab-states-jGeS9iVz.js","assets/site-editor-toast-BtFL0E4q.js","assets/input-D2sd1bar.js","assets/usage-stats-BkcKNXzu.js","assets/tool-namespace-DTl3so75.js","assets/form-Dpwt-9St.js","assets/label-Cnc4HQwP.js","assets/utils-CVEq3hMx.js","assets/markdown-CA3yd3L6.js","assets/use-copy-d7X6hrKI.js","assets/Copy01-DC8f0fwU.js","assets/ZoomOut-BfQx-fBr.js","assets/use-mobile-DCpa1RnA.js","assets/tooltip-B5RmO6BW.js","assets/index-C9OgV5Vt.js","assets/agent-icon-U4gZaLOQ.js","assets/AlertCircle-Ctbquk5a.js","assets/Tool01-BM29_KWq.js","assets/ArrowUp-bYg1aEOe.js","assets/ArrowLeft-DZ0mAFgb.js","assets/LinkBroken01-BJx0R97x.js","assets/ShoppingBag01-BMRnsG58.js","assets/Building02-BHIVlbfK.js","assets/CheckCircle-C2ndOEUO.js","assets/ChevronUp-C8mqlnDX.js","assets/ChevronSelectorVertical-DaUdbCWk.js","assets/UserSquare-Drp4z0v0.js","assets/CreditCard01-P7j8oDkg.js","assets/DotsVertical-BvwGTDkC.js","assets/Image01-D7F4wuKx.js","assets/Globe04-D6C-ihBU.js","assets/SwitchHorizontal01-CshMTQzi.js","assets/Key01-u4HXXUPa.js","assets/Link01-BoUupQbW.js","assets/Minus-C1PMcNV0.js","assets/Monitor01-D3VwU2ni.js","assets/Sun-sKGpeIhM.js","assets/Play-DxsFk4r2.js","assets/Plus-BDveVGJf.js","assets/SearchMd-Cuf45jFP.js","assets/Trash01-D92WhXf2.js","assets/Upload01-BSDy4f7m.js","assets/User01-Cn3JqTjv.js","assets/Users01-Cxbx87gg.js","assets/XClose-dOW_RI9u.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/icon-button-CwrVRVUS.js","assets/file-type-icon-DPqHd815.js","assets/shell-layout-vQvYndIW.js","assets/avatar-RpIBVCkY.js","assets/use-clock-tick-D3FoyBXt.js","assets/command-C7n5qLsN.js","assets/index-DK4LlU65.js","assets/integration-icon-DCiBepJw.js","assets/project-icon-njec1yh1.js","assets/new-project-dialog-DpHJ0D5s.js","assets/repository-import-picker-lphgZTGu.js","assets/use-navigate-to-agent-Bt0oZ-ou.js","assets/repository-picker-Dadd-3sc.js","assets/useInfiniteQuery-ZoWXsJcj.js","assets/infiniteQueryObserver-u-Zd7Oxq.js","assets/collection-search-gW4FCqmq.js","assets/use-debounced-value-DJkh4QSx.js","assets/required-auth-layout-e3_y0Tns.js","assets/use-org-sso-LC63-uuA.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-CKcHhXuF.js","assets/select-CSQbGY9x.js","assets/index-BdQq_4o_.js","assets/tabs-2NCCfhSA.js","assets/active-indicator-CCMhAsc_.js","assets/use-deco-credits-Dx8wT8P5.js","assets/toggle-group-CtdhsZGp.js","assets/use-open-billing-url-B2NuYLXS.js","assets/index-BpRXpcv4.js","assets/checkbox-CUzk21sc.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-DSRFfUdL.js","assets/drawer-ZlYTI3Z6.js","assets/input-DN6U5jAj.js","assets/suggestion-Wgq7DDQo.js","assets/use-mcp-prompts-DHm-ZTib.js","assets/use-org-fs-D_4Q985K.js","assets/question-004-sINsf4GQ.js","assets/use-members-h3MYd8gX.js","assets/use-org-auth-client-CL0a2tPL.js","assets/feature-paywall-D-GfxA1X.js","assets/plan-ladder-BydnH1hR.js","assets/add-connection-dialog-B0vtW1sl.js","assets/extract-connection-data-CNLani4P.js","assets/metadata-D72DunRR.js","assets/connection-Dik4epzq.js","assets/url-slug-B41xLFy_.js","assets/connection-card-DCnmTKpJ.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-CxhXyMKI.js","assets/use-connection-BwU_KLSF.js","assets/schema-Cx9ZLa-H.js","assets/connection-form-helpers-ta2yIvIb.js","assets/authenticate-and-persist-oauth-jn1R1qId.js","assets/mcp-oauth-3Gakbc_U.js","assets/mcp-oauth-CxgfM8zh.js","assets/collection-tabs-DIFXv7hR.js","assets/badge-Cnnepvq1.js","assets/use-infinite-scroll-BO0n6TVn.js","assets/useSuspenseInfiniteQuery-D2W70ffp.js","assets/use-task-board-events-CSRq29Tm.js","assets/use-chat-layout-state-BNudmQ0u.js","assets/input-Bwd_JSM8.css","assets/use-main-schema-v8-CZLsOlEV.js","assets/sandbox-url-D3mC8qhT.js","assets/utils-DzhKsxx8.js","assets/index-CJu3ft8V.js","assets/pair-5gOZrfkD.js","assets/collapsible-CeBZpglT.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-Xaw0krD3.js","assets/types-Bt5yyj-z.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-C-yunzji.js","assets/use-thread-outputs-jyAHyZHI.js","assets/sandbox-git-api-CRxdlhrN.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/secret-ciphertext-DZr2qcb4.js","assets/alert-B29bfkXd.js","assets/switch-DYA2xfHU.js","assets/scroll-area-Bnrys5oj.js","assets/monaco-editor-C7rmyhBT.js","assets/editor-BFHySd1K.js","assets/calendar-DqVFnL9A.js","assets/editor-classes-DPi5BWR5.js","assets/core.esm-DNra8pgf.js","assets/sortable.esm-C1zl1f3P.js","assets/combobox-DlpsfK7m.js","assets/alert-dialog-CKDHmJ-l.js","assets/search-input-CXQLMhKZ.js","assets/use-file-configs-tsH4be9V.js","assets/asset-utils-DrTFUoo_.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/empty-state-Bok1L2hc.js","assets/mustache-BxPGtFxk.js","assets/use-section-preview-base-Ca45yoz9.js","assets/section-preview-url-7zfngvgW.js","assets/page-seo-form-PX_1VQkb.js","assets/variant-draft-pointer-_apEPqxm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aZ as Ye,aG as Ne,q as Os,D as Ds,K as Bs,s as Fs,v as Ms,e as Ir,h as gt,I as rs,w as Ur,a_ as Hr,a2 as Sn,a$ as Vr,aY as qr,au as as,aw as os,a5 as Wr,P as is,y as Gr,t as cn,o as Jr,m as Yr}from"./index-CaH7O3hJ.js";import{u as $s,g as Qr,c as Xr,B as dn,P as Zr,r as ea,R as ta,a as na,b as Ks,d as zs,i as sa,S as ra,e as aa,f as oa,C as ia,h as la,j as ca,l as da,m as ua,p as fa,k as ma,n as un,N as pa}from"./blocks-tab-states-jGeS9iVz.js";import{b as ha,c as It,r as Is,l as Us,f as ga,g as va,w as xa}from"./chat-context-_d3c57p1.js";import{t as ba}from"./ChevronUp-C8mqlnDX.js";import{V as ya,W as wa,L as Hs,X as ka,b as Sa,Y as Pa,Z as Ea,_ as ja,$ as Na,a0 as ls,a1 as Ta}from"./agent-icon-U4gZaLOQ.js";import{a as Ca}from"./UserSquare-Drp4z0v0.js";import{s as Ra}from"./Plus-BDveVGJf.js";import{P as La,a as _a,b as Aa}from"./popover-DSRFfUdL.js";import{a as mt,b as pt,c as Vs,d as qs,e as Ws,C as Gs}from"./command-C7n5qLsN.js";import{c as Oa,a as Da}from"./repository-binding-BLgLcT4o.js";import{b as Pn}from"./sandbox-lifecycle-context-v9W7lV1M.js";import{e as Ba}from"./backoff-CrEUbyZT.js";import{f as Fa}from"./thread-intent-DKuqiaG7.js";import{a as Js}from"./input-D2sd1bar.js";import{S as Ys,A as Ma,B as $a,C as Ka,F as za,G as Ia,H as Ua,I as Ha,u as En,J as jn,K as bn,L as Va,M as qa,N as Wa,c as Ga,b as Qs,O as Ja,P as Qe,z as Ya,Q as Qa,R as Xa,U as Za,x as eo,V as cs,w as to,W as no,e as so}from"./site-editor-toast-BtFL0E4q.js";import{u as ro}from"./use-mobile-DCpa1RnA.js";import{c as fn,T as mn,a as pn}from"./tooltip-B5RmO6BW.js";import{T as ct}from"./toolbar-icon-button-BPY5dUh9.js";import{b as ao,w as At,a as ds,i as oo}from"./variant-draft-pointer-_apEPqxm.js";import{h as io,s as lo,L as co,R as Kt,j as us,N as uo,k as fo,l as ht,n as Nn,m as Xs,f as Fe,v as Zs,o as mo,q as po,r as ho,t as go,u as vo,w as fs,d as xo}from"./secret-ciphertext-DZr2qcb4.js";import{r as bo,D as ms,w as ps,b as hs,a as yo}from"./section-preview-url-7zfngvgW.js";import{u as wo}from"./use-fast-preview-draft-url-5oeXM-kY.js";import{a as ko,c as er}from"./shell-layout-vQvYndIW.js";import{u as tr,b as So}from"./index-CJu3ft8V.js";import{u as yn}from"./useQueries-CddGJ3VE.js";import{i as Po}from"./LinkBroken01-BJx0R97x.js";import{u as nr}from"./blocks-preview-workspace-context-Ca46yWEV.js";import{MonacoCodeEditor as Eo}from"./monaco-editor-C7rmyhBT.js";import{a as jo}from"./utils-DzhKsxx8.js";import{R as gs,a as Ot,b as vs}from"./resizable-D4wP3vt7.js";import{u as No,a as hn}from"./use-main-schema-v8-CZLsOlEV.js";import{w as xs}from"./device-hint-SeLRi17j.js";import{r as To}from"./virtual-mcp-CMZ8dHEU.js";import{d as Co}from"./delay-CnY5UFtP.js";import{E as Ro}from"./empty-state-Bok1L2hc.js";import{G as bs}from"./repository-picker-Dadd-3sc.js";import{R as Lo}from"./repository-import-picker-lphgZTGu.js";import{r as _o}from"./preview-source-BsRLGWUP.js";import{A as Ao,a as Oo,b as Do}from"./alert-B29bfkXd.js";import{u as Bo}from"./use-task-metadata-ToXrxOCT.js";function Fo(t){const e=ne.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(ya,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(wa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function Mo(t){const e=ne.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Mt("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let b;e[14]!==i.command?(b=i.command&&s.jsx(io,{command:i.command}),e[14]=i.command,e[15]=b):b=e[15];let v;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==b?(v=s.jsxs("div",{className:m,children:[f,b,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=b,e[20]=v):v=e[20];let E;return e[21]!==a||e[22]!==d||e[23]!==v?(E=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,v]}),e[21]=a,e[22]=d,e[23]=v,e[24]=E):E=e[24],E}const $o=[];function zt(t){const e=ne.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?$o:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let b;e[0]!==i?(b=s.jsx(Fo,{waiting:i}),e[0]=i,e[1]=b):b=e[1];let v;e[2]!==m||e[3]!==n?(v=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=v):v=e[4];let E;e[5]!==r?(E=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=E):E=e[6];let g;e[7]!==f||e[8]!==b||e[9]!==v||e[10]!==E?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[b,v,E]}),e[7]=f,e[8]=b,e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,x)=>s.jsx(Mo,{index:x+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let j;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(j=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=j):j=e[19],j}function Ko(t){const e=ne.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=_e();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(Ao,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(Oo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(Do,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let B;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(B=lo(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=B):B=e[6];const{title:R,body:D}=B;let O;e[7]!==D?(O=s.jsx(Kt,{text:D}),e[7]=D,e[8]=O):O=e[8];let F;e[9]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(us,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=F):F=e[9];let _;return e[10]!==l||e[11]!==O||e[12]!==R?(_=s.jsx(zt,{headingLevel:2,waiting:!1,title:R,lead:O,alerts:l,footer:F}),e[10]=l,e[11]=O,e[12]=R,e[13]=_):_=e[13],_}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let b;e[18]!==l||e[19]!==n.kind?(b=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(co,{})]}),e[18]=l,e[19]=n.kind,e[20]=b):b=e[20];let v;e[21]!==a?(v=a("decoServe.guide.step1.title"),e[21]=a,e[22]=v):v=e[22];let E;e[23]!==a?(E=a("decoServe.guide.step1.body"),e[23]=a,e[24]=E):E=e[24];let g;e[25]!==E?(g=s.jsx(Kt,{text:E}),e[25]=E,e[26]=g):g=e[26];let k;e[27]!==v||e[28]!==g?(k={title:v,body:g,command:Ys},e[27]=v,e[28]=g,e[29]=k):k=e[29];let j;e[30]!==a?(j=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=j):j=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let x;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(x=n.kind==="needs-gesture"?s.jsx(Xe,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=x):x=e[40];let w;e[41]!==j||e[42]!==y||e[43]!==x?(w={title:j,body:y,after:x},e[41]=j,e[42]=y,e[43]=x,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(us,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==b?(N=s.jsx(zt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:b,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=b,e[54]=N):N=e[54],N}function zo(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const Io=15e3,Uo=3e3;function Ho(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(x,w)=>setTimeout(x,w),clearTimer:o=x=>clearTimeout(x),timeoutMs:l=Uo}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,b=null,v=null;const E=()=>u.visibilityState==="hidden",g=x=>{d={...d,...x},i(d)},k=async x=>{v=new AbortController;const w=v,T=a(()=>w.abort(),l);try{return await n(x,w.signal),!0}catch(P){if(p)return!1;const N=$a(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:x}}):d.problem?.endpoint===x&&g({problem:null}),!1}finally{o(T),v=null}},j=async()=>{if(b=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(E()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const x of e){if(p)break;if(await k(x)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(x);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),E()){g({status:"paused"});return}b=a(()=>{j()},Ma(f,Io))}}};function y(){if(!p){if(E()){b!==null&&(o(b),b=null),m||g({status:"paused"});return}b!==null&&o(b),f=0,j()}}return u.addEventListener("visibilitychange",y),i(d),j(),()=>{p=!0,b!==null&&o(b),v?.abort(),u.removeEventListener("visibilitychange",y)}}function Vo(t,e){return za(Ia({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const qo=["loopback-network","local-network-access"];async function Wo(){if(Ka(window.location.origin))return null;for(const t of qo)try{return await navigator.permissions.query({name:t})}catch{}return null}let sr=null,ys=!1;const gn=new Set;function Go(t){if(gn.add(t),!ys){ys=!0;const e=n=>{sr=n;for(const r of gn)r()};Wo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>gn.delete(t)}const Jo={status:"stopped",firstRoundDone:!1,problem:null},vn=new Map;function Yo(t){const e=vn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=Ho({candidates:t.split(" "),probe:Vo,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,vn.delete(t))})};return vn.set(t,u),u}function rr(){return S.useSyncExternalStore(Go,ks,ks)}const Qo=()=>()=>{},ws=()=>Jo,ks=()=>sr;function Pc(t){const e=ne.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=rr(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Yo(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Qo,d?.getSnapshot??ws,d?.getSnapshot??ws),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let b;return e[5]!==a||e[6]!==p||e[7]!==m?(b={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=b):b=e[8],b}const Ss={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Xo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...Ss,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ss:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Zo=1e4,ei=1e3,ti=3e4;function ni({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Zo)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const b=Ba(ti,ei,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const v=t.current,E=a.current;!v||!E||!o.current||(v.src=E,d())},b)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const si=1500,ri=500;function ai({iframe:t,reload:e,waitMs:n=si,confirmMs:r=ri}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const oi=$t({tag:Ne(),id:Ne(),classes:Ne(),text:Ne(),html:Ne(),manifestKey:Ne().nullable(),componentName:Ne().nullable(),parents:Ne(),url:Ne(),path:Ne(),viewport:$t({width:Ye(),height:Ye()}),position:$t({x:Ye(),y:Ye()})}),ii=`(function() {
|
|
3
3
|
if (window.__visualEditorActive) return;
|
|
4
4
|
window.__visualEditorActive = true;
|
|
5
5
|
|
|
@@ -548,4 +548,4 @@ import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aZ as Ye,aG as Ne,
|
|
|
548
548
|
}
|
|
549
549
|
});
|
|
550
550
|
})();`;function wn(t,e){let n=t,r=typeof n?.__resolveType=="string"?n.__resolveType:"";for(let i=0;r&&i<5;i++){const u=e[r];if(u&&typeof u=="object"&&"__resolveType"in u){const a=u.__resolveType;if(typeof a=="string"&&a&&a!==r){n=u,r=a;continue}}break}if(!r)return[];if(r.includes("flags/multivariate")){const i=Array.isArray(n.variants)?n.variants:[];if(i.length===0||i.every(o=>o?.rule?.__resolveType===uo))return null;const a=[];for(const o of i){const l=o?.value;if(l&&typeof l=="object")for(const d of wn(l,e)??[])a.includes(d)||a.push(d)}return a}if(fo(r)){const i=n.section&&typeof n.section=="object"?wn(n.section,e):[];return i===null?null:i.length?[r,...i]:[r]}return[r]}function Je(t){return t.replace(/[`*_]/g,"\\$&")}function di(t,e){const n=[`The user selected an element on the live preview and asked: **"${Je(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&n.push(`**Section resolveType:** \`${Je(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const r=`<${t.tag}${t.classes?` class="${Je(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${r}\``),t.parents&&n.push(`**DOM breadcrumb:** ${Je(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${Je(t.text)}"`),t.componentName&&n.push(`**Component name:** ${Je(t.componentName)}`);const i=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",i,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
|
|
551
|
-
`)}function ui(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function fi(t){const e=ne.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=ha(),{openSidePanel:l}=ko(),d=_e();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const U=di(n,i);l(),o({parts:[{type:"text",text:U}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=ui(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const b=f,v=`${b.leftPct}%`,E=`${b.topPct}%`;let g;e[9]!==v||e[10]!==E?(g={left:v,top:E,width:"320px"},e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==m?(k=U=>{U.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=U=>u(U.target.value),e[14]=j):j=e[14];let y;e[15]!==r?(y=U=>{U.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let x;e[17]!==d?(x=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=x):x=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==x?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:j,onKeyDown:y,placeholder:x,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=x,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let B;e[27]!==d?(B=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=B):B=e[28];let R;e[29]!==B?(R=s.jsx("title",{children:B}),e[29]=B,e[30]=R):R=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=D):D=e[31];let O;e[32]!==R?(O=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,D]}),e[32]=R,e[33]=O):O=e[33];let F;e[34]!==P||e[35]!==N||e[36]!==O?(F=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:O}),e[34]=P,e[35]=N,e[36]=O,e[37]=F):F=e[37];let _;e[38]!==w||e[39]!==F||e[40]!==k?(_=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:k,children:[w,F]}),e[38]=w,e[39]=F,e[40]=k,e[41]=_):_=e[41];let I;return e[42]!==_||e[43]!==g?(I=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:_}),e[42]=_,e[43]=g,e[44]=I):I=e[44],I}const Es="site-links",mi=/details?page|\bpdp\b/i,pi=/listingpage|\bplp\b/i;function hi(t,e,n){const r=new Set;for(const o of n)mi.test(o)&&r.add("product"),pi.test(o)&&r.add("category");const i=ht(Nn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const gi=["rosa","preto","pink","black"];function Dt(t,e){const n=e.trim();return n?t(n):gi.flatMap(r=>t(r))}function vi(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const ar=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Tn(t){return t.split("/")[0]??""}function xi(t){const e=new Set;for(const n of t){const r=Tn(n);ar.has(r)&&e.add(r)}return e}function bi(t,e){const n=Tn(t);return!ar.has(n)||e.size===0?!0:e.has(n)}const yi=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Dt(n=>vi(t,n),e),optionsFromPayload:Bt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:Ni}];function wi(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of yi){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&bi(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Tn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(ki(t.has("category")?"category":"product")),a}function ki(t){return{kind:t,id:Es,resolveType:Es,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>_i(e,n)}}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Si(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=Ie(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=Ie(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function or(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function ir(t){try{return decodeURIComponent(t)}catch{return t}}function Pi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=Pi(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function lr(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=ht(Nn(e)),{pattern:u,order:a}=Ei(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?ir(d):null}function Bt(t,e){const n=Ie(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=Ie(a);if(!o)continue;const l=lr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=Ie(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?Ie(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function ji(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?ir(n):null}function Ni(t){const e=[],n=new Set,r=(i,u)=>{const a=Ie(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=ji(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const Ti=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function Ci(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function Ri(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function Li(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function _i(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=lr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&Ti.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:Ci(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of Li(t))i(u,a,"product",o);for(const{href:u,text:a}of Ri(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function dt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const cr=1e4;function Ai(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function Oi(t,{resolveType:e,props:n}){const r=await fetch(Ua(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(cr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function js(t,e){const n=await fetch(Ha(t,e),{signal:AbortSignal.timeout(cr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function Di(t,e,n){const r=e.optionsFromPayload(await js(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Fe(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await js(t,u),n).filter(o=>o.kind==="product");return or([r,a])}catch{return r}}function Bi(t,e,n){return Bs.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function Fi(t,e,n,r){if(e.homepageLinks)return Di(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>Oi(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return or(a.map(o=>e.optionsFromPayload(o,r)))}function kn(t,e,n,r,i){return{queryKey:Bi(t,e,n),queryFn:()=>Fi(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function ut(t){const e=ne.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(Hs,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Fe(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(mt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Ns(t){const e=ne.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Mi(t){const e=ne.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=_e(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[b,v]=S.useState(""),E=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=Ai(l),y=[...new Set(n.map(M=>k[M.kind].noun))].join(" or ");let x;e[0]!==l||e[1]!==y?(x=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=x):x=e[2];const w=x,T={template:r,paramName:i};let P;e[3]!==m?(P=(M,G)=>({source:M,query:G,options:M.clientFilter?dt(G.data??[],m):G.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,B=n.filter(qi),R=n.filter(Vi),D=yn({queries:B.map(M=>kn(a,M,b,T,d))});let O;e[5]!==D||e[6]!==N?(O=(M,G)=>N(M,D[G]),e[5]=D,e[6]=N,e[7]=O):O=e[7];const F=B.map(O),_=F.length===0||F.every(Hi),I=yn({queries:R.map(M=>kn(a,M,b,T,d&&_))});let U;e[8]!==I||e[9]!==N?(U=(M,G)=>N(M,I[G]),e[8]=I,e[9]=N,e[10]=U):U=e[10];const Z=R.map(U),z=_?Z:F,q=z.length===1&&z[0]?.source.homepageLinks?z[0]:null,ee=q&&!q.query.isLoading&&!q.query.isError?q?.query.data??[]:[],ce=dt(ee.filter(Ui),m),C=dt(ee.filter(Ii),m),H=ce.length>0&&C.length>0,A=M=>{p(M),E.current&&clearTimeout(E.current),f(M?u:""),v(M?u:"")};let J;e[11]===Symbol.for("react.memo_cache_sentinel")?(J=M=>{f(M),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{v(M)},300)},e[11]=J):J=e[11];const Y=J,Q=M=>{o(M),A(!1)},he=Xs(m),se=Fe(r,{[i]:he}),W=Ds,oe=Os,we="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",de=zi;let re;e[12]!==g||e[13]!==l?(re=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=re):re=e[14];let ue;e[15]!==re?(ue=s.jsx(Fs,{className:"sr-only",children:s.jsx(Ms,{children:re})}),e[15]=re,e[16]=ue):ue=e[16];let ke;e[17]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Hs,{size:16,className:"shrink-0 text-foreground"}),e[17]=ke):ke=e[17];let ae;e[18]!==l?(ae=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=ae):ae=e[19];let fe;e[20]!==g?(fe=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:g}),e[20]=g,e[21]=fe):fe=e[21];let ie;e[22]!==ae||e[23]!==fe?(ie=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ke,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ae," ",fe]})]}),e[22]=ae,e[23]=fe,e[24]=ie):ie=e[24];const Te=qs,Se=!1,Me="min-h-0 flex-1";let ge;e[25]!==w||e[26]!==m?(ge=s.jsx(Ws,{autoFocus:!0,placeholder:w,value:m,onValueChange:Y}),e[25]=w,e[26]=m,e[27]=ge):ge=e[27];const Ze=Vs,vt="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Be;e[28]!==l?(Be=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Be):Be=e[29];let Ae;e[30]!==Be?(Ae=s.jsx(Gs,{children:Be}),e[30]=Be,e[31]=Ae):Ae=e[31];const xe=he&&s.jsx(mt,{className:"shrink-0",children:s.jsxs(pt,{value:`__raw__:${he}`,className:"gap-3 py-2",onSelect:()=>Q(he),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Po,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:he,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:se})]})]})}),$e=H?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:ce,template:r,paramName:i,keyPrefix:`${q?.source.id}:cat`,onSelect:Q})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${q?.source.id}:prod`,onSelect:Q})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:z.map(M=>{const{source:G,query:Ke,options:et}=M,{noun:Ue}=k[G.kind];if(Ke.isLoading)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.loading",{noun:Ue})},G.id);if(Ke.isError)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},G.id);if(G.homepageLinks){const xt=Ke.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:dt(xt.filter(Ki),m),template:r,paramName:i,keyPrefix:`${G.id}:cat`,onSelect:Q}),s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:dt(xt.filter($i),m),template:r,paramName:i,keyPrefix:`${G.id}:prod`,onSelect:Q})]},G.id)}return s.jsx(ut,{heading:z.length>1?k[G.kind].heading:void 0,iconKind:G.kind,options:et,template:r,paramName:i,keyPrefix:G.id,onSelect:Q},G.id)})});let Ce;e[32]!==Ze||e[33]!==Ae||e[34]!==xe||e[35]!==$e?(Ce=s.jsxs(Ze,{className:vt,children:[Ae,xe,$e]}),e[32]=Ze,e[33]=Ae,e[34]=xe,e[35]=$e,e[36]=Ce):Ce=e[36];let Re;e[37]!==Te||e[38]!==ge||e[39]!==Ce?(Re=s.jsxs(Te,{shouldFilter:Se,className:Me,children:[ge,Ce]}),e[37]=Te,e[38]=ge,e[39]=Ce,e[40]=Re):Re=e[40];let Pe;e[41]!==oe||e[42]!==ue||e[43]!==ie||e[44]!==Re||e[45]!==de?(Pe=s.jsxs(oe,{className:we,onClick:de,children:[ue,ie,Re]}),e[41]=oe,e[42]=ue,e[43]=ie,e[44]=Re,e[45]=de,e[46]=Pe):Pe=e[46];let be;return e[47]!==W||e[48]!==A||e[49]!==d||e[50]!==Pe?(be=s.jsx(W,{open:d,onOpenChange:A,children:Pe}),e[47]=W,e[48]=A,e[49]=d,e[50]=Pe,e[51]=be):be=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:M=>{M.stopPropagation(),A(!0)},children:u||g}),be]})}function $i(t){return t.kind==="product"}function Ki(t){return t.kind!=="product"}function zi(t){return t.stopPropagation()}function Ii(t){return t.kind==="product"}function Ui(t){return t.kind!=="product"}function Hi(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Vi(t){return t.isFallback}function qi(t){return!t.isFallback}function Wi(t){const e=ne.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const b={template:r,paramName:i},v=n.filter(Gi);l=yn,o=v.map(E=>kn(u,E,"",b,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const b of p){if(b.isLoading)break;const v=b.data?.[0];if(v){f(!0),queueMicrotask(()=>a(v.value));break}}return null}function Gi(t){return!t.isFallback}function Ji(t){const e=ne.c(31),{name:n,value:r,onCommit:i}=t,u=_e(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,b=a||f;let v;e[3]!==b?(v=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:b}),e[3]=b,e[4]=v):v=e[4];let E;e[5]!==f||e[6]!==u?(E=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=E):E=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let j;e[10]!==r?(j=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=j):j=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=Xs(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let x;e[16]!==a||e[17]!==f||e[18]!==E||e[19]!==j||e[20]!==y?(x=s.jsx("input",{type:"text",value:a,placeholder:f,title:E,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Yi,onChange:g,onFocus:k,onKeyDown:j,onBlur:y}),e[16]=a,e[17]=f,e[18]=E,e[19]=j,e[20]=y,e[21]=x):x=e[21];let w;e[22]!==v||e[23]!==x?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,x]}),e[22]=v,e[23]=x,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[s.jsx(ka,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Yi(t){return t.stopPropagation()}function Qi(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Xi(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Zi(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function el(t){const e=ne.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=$s(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const d=Qr(a),p=l?{...l,name:a,path:o}:Xr(a,o);return await r.mutateAsync({blockKey:d,data:p}),{key:d,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],Ir(i)}function tl(t){const e=ne.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=_e();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let b;e[2]!==d?(b=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=b):b=e[3];const[v,E]=S.useState(b),[g,k]=S.useState(dn),[j,y]=S.useState(null),[x,w]=S.useState(n);n!==x&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),E(d("sectionsEditor.createPageModal.defaultPagePath")),k(dn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=ae=>{!ae&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let B;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==v||e[11]!==T||e[12]!==g?(B=async ae=>{ae.preventDefault();const fe=m.trim(),ie=v.trim();if(!fe||!ie||l)return;const Te=Zs(ie);if(Te){y(Te);return}y(null),await o({name:fe,path:ie,templateKey:T&&g!==dn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=v,e[11]=T,e[12]=g,e[13]=B):B=e[13];const R=B,D=j??u;let O;e[14]!==d?(O=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=O):O=e[15];let F;e[16]!==O?(F=s.jsx(Fs,{children:s.jsx(Ms,{children:O})}),e[16]=O,e[17]=F):F=e[17];let _;e[18]!==d?(_=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=_):_=e[19];let I;e[20]!==_?(I=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=I):I=e[21];let U;e[22]===Symbol.for("react.memo_cache_sentinel")?(U=ae=>f(ae.target.value),e[22]=U):U=e[22];let Z;e[23]!==d?(Z=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=Z):Z=e[24];let z;e[25]!==l||e[26]!==m||e[27]!==Z?(z=s.jsx(rs,{id:"new-page-name",value:m,onChange:U,placeholder:Z,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=Z,e[28]=z):z=e[28];let q;e[29]!==z||e[30]!==I?(q=s.jsxs("div",{className:"space-y-1.5",children:[I,z]}),e[29]=z,e[30]=I,e[31]=q):q=e[31];let te;e[32]!==d?(te=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=te):te=e[33];let ee;e[34]!==te?(ee=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:te}),e[34]=te,e[35]=ee):ee=e[35];let ce;e[36]===Symbol.for("react.memo_cache_sentinel")?(ce=ae=>E(ae.target.value),e[36]=ce):ce=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let H;e[39]!==l||e[40]!==v||e[41]!==C?(H=s.jsx(rs,{id:"new-page-path",value:v,onChange:ce,placeholder:C,disabled:l}),e[39]=l,e[40]=v,e[41]=C,e[42]=H):H=e[42];let A;e[43]!==ee||e[44]!==H?(A=s.jsxs("div",{className:"space-y-1.5",children:[ee,H]}),e[43]=ee,e[44]=H,e[45]=A):A=e[45];let J;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(J=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(Zr,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=J):J=e[51];let Y;e[52]!==D?(Y=D&&s.jsx("p",{className:"text-xs text-destructive",children:D}),e[52]=D,e[53]=Y):Y=e[53];let Q;e[54]!==q||e[55]!==A||e[56]!==J||e[57]!==Y?(Q=s.jsxs("div",{className:"space-y-4 py-4",children:[q,A,J,Y]}),e[54]=q,e[55]=A,e[56]=J,e[57]=Y,e[58]=Q):Q=e[58];let he;e[59]!==r?(he=()=>r(!1),e[59]=r,e[60]=he):he=e[60];let se;e[61]!==d?(se=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=se):se=e[62];let W;e[63]!==l||e[64]!==he||e[65]!==se?(W=s.jsx(Xe,{type:"button",variant:"outline",onClick:he,disabled:l,children:se}),e[63]=l,e[64]=he,e[65]=se,e[66]=W):W=e[66];let oe;e[67]!==l||e[68]!==m||e[69]!==v?(oe=!m.trim()||!v.trim()||l,e[67]=l,e[68]=m,e[69]=v,e[70]=oe):oe=e[70];let we;e[71]!==l||e[72]!==d?(we=l?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=we):we=e[73];let de;e[74]!==oe||e[75]!==we?(de=s.jsx(Xe,{type:"submit",disabled:oe,children:we}),e[74]=oe,e[75]=we,e[76]=de):de=e[76];let re;e[77]!==W||e[78]!==de?(re=s.jsxs(Ur,{children:[W,de]}),e[77]=W,e[78]=de,e[79]=re):re=e[79];let ue;e[80]!==R||e[81]!==Q||e[82]!==re||e[83]!==F?(ue=s.jsx(Os,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[F,Q,re]})}),e[80]=R,e[81]=Q,e[82]=re,e[83]=F,e[84]=ue):ue=e[84];let ke;return e[85]!==N||e[86]!==n||e[87]!==ue?(ke=s.jsx(Ds,{open:n,onOpenChange:N,children:ue}),e[85]=N,e[86]=n,e[87]=ue,e[88]=ke):ke=e[88],ke}function nl(t){const e=ne.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=_e();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=$s(p);let f;e[4]!==m?(f=na((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const b=f;let v;e[6]!==l||e[7]!==o?(v=ea(o,l),e[6]=l,e[7]=o,e[8]=v):v=e[8];const{resolveType:E,props:g,title:k}=v;if(!E){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const j=`loader:${l}`;let y;e[13]!==l||e[14]!==E||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:E,title:k},e[13]=l,e[14]=E,e[15]=k,e[16]=y):y=e[16];let x;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==b||e[25]!==j||e[26]!==y||e[27]!==r?(x=s.jsx(ta,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:sl,onSaveReferencedBlock:b,showRun:!1},j),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=b,e[25]=j,e[26]=y,e[27]=r,e[28]=x):x=e[28],x}async function sl(){}function rl(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Ts(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:rl(t.error)}}function al(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function ol(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=al(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(i=>i.status==="error"&&!i.hasData&&i.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const il=S.lazy(()=>Hr(()=>import("./sections-editor-Dju5cdx3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167])).then(t=>({default:t.SectionsEditor})));function Cs(t){const e=ne.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=Sn(),{currentBranch:o,taskId:l}=It(),d=tr(),p=Pn(),m=nr(),f=d.lifecycle.phase==="running",b=p.previewUrl;let v;e[0]!==o||e[1]!==a||e[2]!==b||e[3]!==l||e[4]!==n?(v=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:b}:null,e[0]=o,e[1]=a,e[2]=b,e[3]=l,e[4]=n,e[5]=v):v=e[5];const E=v,g=En(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const j=jn(E,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const x=Ks(E,y),w=ol({lifecyclePhase:d.lifecycle.phase,decofile:Ts(j),meta:Ts(x),hasEditableContent:mo(j.data,x.data),fastPreviewActive:Js(n).runtime==="cms"||bn(g)}),T=zs()===void 0,P=ll;if(sa(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(oa,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(ia,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Vr,{})),e[13]=C):C=e[13],C}if(j.data&&Va(x.data)){const C=m.state.target,H=C?.kind==="page"||C?.kind==="section"?C.key:null,A=H??"",J=o??"";let Y;return e[14]!==j.data||e[15]!==H||e[16]!==a.slug||e[17]!==A||e[18]!==J||e[19]!==n?(Y=P(s.jsx(ra,{orgSlug:a.slug,virtualMcpId:n,branch:J,decofile:j.data,initialKey:H,compact:!0},A)),e[14]=j.data,e[15]=H,e[16]=a.slug,e[17]=A,e[18]=J,e[19]=n,e[20]=Y):Y=e[20],Y}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(la,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==j||e[23]!==p||e[24]!==x||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([j.refetch(),x.refetch()])},e[22]=j,e[23]=p,e[24]=x,e[25]=w.source,e[26]=C):C=e[26];const H=C;let A;return e[27]!==H||e[28]!==w.source?(A=P(s.jsx(aa,{source:w.source,onRetry:H})),e[27]=H,e[28]=w.source,e[29]=A):A=e[29],A}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const B=N,R=m.state.target;if(R?.kind==="loader"&&j.data&&x.data){const C=o??"",H=b??null;let A;return e[31]!==j.data||e[32]!==x.data||e[33]!==a.slug||e[34]!==C||e[35]!==H||e[36]!==R.key||e[37]!==n?(A=B(s.jsx(nl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:H,meta:x.data,decofile:j.data,blockKey:R.key})),e[31]=j.data,e[32]=x.data,e[33]=a.slug,e[34]=C,e[35]=H,e[36]=R.key,e[37]=n,e[38]=A):A=e[38],A}let D;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(D=R||!o?null:Is(Us(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=D):D=e[43];const O=D;let F="/",_=null,I=null;R?.kind==="page"?(F=R.path,_=R.key):R?.kind==="section"?I=R.key:O&&(F=O.path,_=O.pageKey);const U=_?`page:${_}`:I?`section:${I}`:`path:${F}`;let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=Z):Z=e[44];const z=o??"",q=b??void 0,te=I?null:u,ee=!!_&&m.state.editSeoPageKey===_;let ce;return e[45]!==I||e[46]!==_||e[47]!==F||e[48]!==U||e[49]!==i||e[50]!==a.slug||e[51]!==te||e[52]!==ee||e[53]!==z||e[54]!==q||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ce=B(s.jsx(S.Suspense,{fallback:Z,children:s.jsx(il,{orgSlug:a.slug,virtualMcpId:n,branch:z,previewReady:!0,previewUrl:q,currentPath:F,activePageBlockKey:_,activeGlobalBlockKey:I,externalSelection:te,initialEditSeo:ee,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},U)})),e[45]=I,e[46]=_,e[47]=F,e[48]=U,e[49]=i,e[50]=a.slug,e[51]=te,e[52]=ee,e[53]=z,e[54]=q,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ce):ce=e[59],ce}function ll(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Rs(t){const e=ne.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=_e(),o=zs(),l=o===!0,d=qa(n);let p;e[0]!==d||e[1]!==r?(p=Wa(d,jo(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=Sn(),{currentBranch:b,taskId:v}=It(),g=Pn().previewUrl;let k;e[3]!==b||e[4]!==f.slug||e[5]!==g||e[6]!==v||e[7]!==n?(k=b?{orgSlug:f.slug,virtualMcpId:n,branch:b,threadId:v??null,previewUrl:g}:null,e[3]=b,e[4]=f.slug,e[5]=g,e[6]=v,e[7]=n,e[8]=k):k=e[8];const y=jn(k),x=b??"";let w;e[9]!==f.slug||e[10]!==x||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:x},e[9]=f.slug,e[10]=x,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=ca(w),N=y.data?.[r],B=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,D=!b||R||B;let O;e[13]!==N?(O=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=O):O=e[14];const F=O;let _;e[15]!==r||e[16]!==D||e[17]!==T?(_=te=>{if(D)return;let ee;try{ee=JSON.parse(te)}catch{return}ee===null||typeof ee!="object"||Array.isArray(ee)||T(r,ee)},e[15]=r,e[16]=D,e[17]=T,e[18]=_):_=e[18];const I=_;let U;e[19]!==P?(U=()=>({flush:P}),e[19]=P,e[20]=U):U=e[20],S.useImperativeHandle(u,U);let Z;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(Z=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Xe,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:s.jsx(qr,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=Z):Z=e[25];let z;e[26]!==y.data||e[27]!==P||e[28]!==F||e[29]!==B||e[30]!==R||e[31]!==r||e[32]!==D||e[33]!==I||e[34]!==a?(z=B?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Eo,{code:F,language:"json",readOnly:D,height:"100%",onChange:te=>I(te??""),onSave:te=>{I(te),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=F,e[29]=B,e[30]=R,e[31]=r,e[32]=D,e[33]=I,e[34]=a,e[35]=z):z=e[35];let q;return e[36]!==Z||e[37]!==z?(q=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,z]}),e[36]=Z,e[37]=z,e[38]=q):q=e[38],q}function dr(t){return t.contentEditingEnabled&&!t.isMobile}function cl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function dl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ul(t){return dr({contentEditingEnabled:er(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function fl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}const ml=15e3;function pl(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Ls(t){return t.loading?{...t,loading:!1}:t}const hl=500,gl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},_s=1,Ft=["desktop","mobile","tablet"],vl=["preview","visual","blocks"],As={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function xl(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function ft(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function xn(t,e){try{return new URL(t,e).href}catch{return null}}function bl(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function yl(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wl(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function kl(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sl({virtualMcpId:t}){const e=_e(),n=ro(),{currentBranch:r,taskId:i,virtualMcpId:u}=It(),a=!!ga(),o=nr(),l=Oa(u===t?t:null),d=Js(t),p=To(l?.metadata?.ui?.layout??null),m=er(p),f=dr({contentEditingEnabled:m,isMobile:n}),[b]=S.useState(()=>ul({cmsMode:p,isMobile:n})),[v,E]=as(os.previewEditingMode(t),c=>c&&vl.includes(c)?c:null),g=v??b,[k,j]=as(os.previewDeviceSize(t),c=>c&&Ft.includes(c)?c:"desktop"),[y,x]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[B,R]=S.useState(!1),D=S.useRef(null),O=()=>{D.current?.flush(),R(!1)},F=()=>R(c=>(c&&D.current?.flush(),!c)),[_,I]=S.useState({width:0,height:0}),[U,Z]=S.useState(!1),[z,q]=S.useState(""),te=S.useRef(null),[ee,ce]=S.useState(!1),[C,H]=S.useState(),[A,J]=S.useState(null),[Y,Q]=S.useState(null),[he,se]=S.useState(null),[W,oe]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[we,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[re,ue]=S.useState({}),[ke,ae]=S.useState(!1),fe=S.useRef(null),ie=()=>{ae(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>ae(!1),15e3)},Te=()=>{fe.current&&(clearTimeout(fe.current),fe.current=null),ae(!1)},{org:Se}=Sn(),Me=tr(),ge=Pn(),Ze=ge.vmEntry,vt=Me.lifecycle.phase,{url:Be,undecided:Ae}=Ga(t),xe=En(t,r),{connection:$e}=Qs(t),Ce=No(t),Re=Ja({hasServeConnection:!!$e,runtime:d.runtime}),Pe=Ae||Re==="github"&&(Ce==="loading"||Ce==="error"),be=!bn(xe)&&!Pe&&!(Re==="github"&&xe.kind==="pending"),M=Qe(xe)??Be,G=M??ge.previewUrl,Ke=!!M||vt==="running",et=l?.id===t?Fa(l.metadata):null,Ue=!M&&!Ae&&l?.id===t&&d.runtime==="cms",xt=d.projectDefault==="cms",tt=be?bo({sandboxUrl:G,previewServerUrl:et,fastPreviewActive:Ue}):null,Cn=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:G}:null,Rn=jn(Cn,{fetchEnabled:Ke}),Ln=Ks(Cn,{fetchEnabled:Ke}),X=Rn.data,ve=Ln.data,He=X?po(X,ve).sort((c,h)=>c.name.localeCompare(h.name)):[],_n=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r}:null,An=el(_n),Ut=X&&ve?ho(X,ve):[],On=be&&X&&ve?da(ve,X,"loaders"):[],Dn=z?(()=>{const c=z.toLowerCase();return He.map(h=>({page:h,score:wl(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,L)=>L.score-h.score||h.page.path.length-L.page.path.length).map(({page:h})=>h)})():He,Bn=Ut.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),Fn=f?On:[],Mn=Fn.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),bt=Y?On.find(c=>c.key===Y)??null:null,Le=Nn,Ht=A||Y?null:go(He,W,we),V=Ht?.key??null,Ve=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??V,yt=Ht?.path??null,qe=(V?re[V]:void 0)??{},ye=Fe(W,qe),Vt={};if(be&&Ke&&G&&ve&&X){const c=ua(ve,"loaders"),h=V?X[V]:void 0,L=Si(h,X,le=>c.has(le)),$=xi(L);for(const le of ht(W)){if(le.type!=="param")continue;const De=hi(W,le.name,L),je=wi(De,c,$);je.length>0&&(Vt[le.name]=je)}}const wt=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,$n=X&&V?vo(X,V,0):[],Kn=X?fa($n,X):[],qt=Kn.map(c=>c.isSavedBlock?c.label:""),Wt=Kn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),Gt=$n.map(c=>wn(c,X??{})),kt=S.useRef(null),Ee=S.useRef(null),ur=Me.status.state==="paused",Jt=Me.phase,zn=ma({claimPhase:Jt,lifecycle:Me.lifecycle}),ze=ge.previewState,fr=ge.userStopped,mr=Ya(Se.slug,t??""),{url:Oe}=wo(Ue&&t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,previewServerUrl:et??null,path:ye}:null),pr=xt&&d.runtime==="sandbox",Yt=Qa(xe,Re,Ce),K=Xo({previewState:ze,progressStatus:zn.status,previewServerUrl:et,fastPreviewActive:Ue,fastPreviewReady:!!Oe,codingSession:pr,localPreviewUrl:M,hostedDraft:Yt,deciding:Pe}),hr=K.showWakingPill||Yt&&K.mode==="production"&&!Oe,nt=K.mode!=="none",gr=K.mode==="production"&&K.iframeBase?ft(K.iframeBase):null,We=K.mode==="production"?gr:ft(G),vr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,st=be?M?K.mode==="sandbox"&&f&&g==="blocks":K.mode==="production"&&Ue&&vr&&f&&g==="blocks":!1,In=S.useRef(null),{pin:xr,effective:br}=bl(In.current,{inPlaceRenderActive:st,draftPreviewUrl:Oe,resolvedPath:ye});In.current=xr;const Un=o.state.variantOverride??[],St=be?Un:[],Qt=be?[]:Un,yr=$e&&Qe(xe)?ao($e.endpoint,Qt)??ms:null,Ge=xl(K.mode==="sandbox"?At(xs(ps(he??xn(ye,K.iframeBase)??K.iframeBase,yr),k),St):K.mode==="production"?At(xs(ds(ps(he??br??xn(ye,K.iframeBase)??K.iframeBase,hr?ms:null),Qt),k),St):null),Hn=Oe??(K.iframeBase?xn(ye,K.iframeBase):null),wr=K.mode==="production"?Hn?At(ds(Hn,Qt),St):null:Ge??K.iframeBase,kr=()=>{const c=wr;c&&window.open(c,"_blank","noopener")},rt=t&&r?Us(Se.slug,t,r):null,at=c=>{rt&&xa(rt,c)},me=o.state.target;S.useEffect(()=>{if(!(!me||!tt||!ve))if(me.kind==="page"){const c=re[me.key]??{};Ee.current=Fe(me.path,c),J(null),Q(null),se(null),de(me.key),oe(me.path),at({path:me.path,pageKey:me.key,params:c})}else if(me.kind==="loader")Ee.current=null,J(null),Q(me.key),se(null);else{const c=Ut.find(h=>h.key===me.key);if(c){Ee.current=null;const h=fs(ve);Q(null),J(c),se(hs(tt,h,c.key))}}},[me,tt,ve,re]),S.useEffect(()=>{!V||yt===null||me?.kind==="page"&&me.key===V&&me.path===yt||o.selectTarget({kind:"page",key:V,path:yt})},[V,yt,me]);const[Vn,Sr]=S.useState(null);if(ze.kind==="iframe"&&Vn!==ze.previewUrl){const c=Vn!==null;Sr(ze.previewUrl);const h=rt?Is(rt):null;if(h){if(Ee.current=Fe(h.path,h.params),oe(h.path),de(h.pageKey),se(null),J(null),Q(null),h.pageKey&&Object.keys(h.params).length>0){const L=h.pageKey;ue($=>({...$,[L]:h.params}))}}else c&&(Ee.current=null,oe("/"),se(null),de(null),J(null),Q(null))}kt.current=Ge;const Pr=K.mode==="production"&&!!Oe&&!M,[qn,Xt]=S.useState({src:Ge??void 0,loading:!1}),Pt=pl(qn,Ge??void 0,Pr);Pt!==qn&&Xt(Pt);const ot=Pt.src,Wn=Pt.loading,Gn=ni({iframeRef:P,src:K.mode==="sandbox"?Ge:null,active:K.mode==="sandbox"}),Jn=S.useRef(null);S.useEffect(()=>{const c=Wn?setTimeout(()=>Xt(Ls),ml):null,h=()=>{c&&clearTimeout(c)};if(!Oe||!ot||Jn.current===Oe)return h;Jn.current=Oe;const L=P.current;return L&&L.getAttribute("src")!==ot&&(ie(),L.src=ot),h},[Oe,ot,Wn]);const Yn=()=>{const c=P.current?.contentWindow,h=We;if(!c||!h||!X||!V)return;const L=X[V];if(!L||typeof L!="object")return;const $=yo({previewBaseUrl:h,pageBlock:L,decofile:X,path:ye,pathTemplate:W});if(!$)return;const le=At($.src,oo(St,V));c.postMessage({type:"cms-editor::render",src:le,body:$.body},h)},Zt=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){Zt.current=null;return}const c={nav:JSON.stringify({page:V,path:ye,pathTemplate:W}),content:JSON.stringify(X)},h=yl(Zt.current,c);Zt.current=c,h&&Yn()},[X,st,A,Y,V,ye,W]);const en=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){en.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=en.current;en.current={page:V,sig:c},!(!h||h.page!==V||h.sig===c)&&Yn()},[o.state.variantOverride,st,A,Y,V]);const Er=!!t&&!!r&&!Me.notFound&&!fr&&!ur&&(Jt?.kind==="ready"||vt!=="idle"),pe=fl({editingMode:g,sandboxDisplay:K.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=We;if(!c)return;const h=L=>{if(L.origin===c)if(L.data?.type==="visual-editor::element-clicked"){const $=oi.safeParse(L.data.payload);$.success&&x($.data)}else if(L.data?.type==="cms-editor::section-clicked"){const $=ci.safeParse(L.data.payload);$.success&&T({index:$.data.sectionIndex,seq:$.data.clickSeq})}else L.data?.type==="cms-editor::render-start"?ie():L.data?.type==="cms-editor::render-end"?(Te(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},c)):L.data?.type==="cms-editor::render-error"&&Te()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[We,qt,Wt,Gt]);const Qn=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::activate",script:ii},h)},jr=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},tn=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage(K.mode==="production"||M?{type:"editor::inject",args:{script:Ps}}:{type:"visual-editor::activate",script:Ps},h),c.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},h))},Nr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Tr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},Et=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),E(c),x(null),T(null),c!=="blocks"&&Q(null),h==="visual"&&jr(),c==="visual"&&Qn(),h==="blocks"&&c!=="blocks"&&Nr(),c==="blocks"&&tn()},Cr=()=>{Et(cl(g,f))},Rr=()=>{Et(dl(g,f))},nn=()=>{const c=P.current;if(!c)return;ie();const h=document.activeElement,L=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),kl(c,kt.current);let $;const le=()=>{clearTimeout($),c.tabIndex=L,c.style.pointerEvents="";const De=document.activeElement;(!De||De===document.body||De===c)&&h?.focus(),c.removeEventListener("load",le)};c.addEventListener("load",le),$=setTimeout(le,3e3)};So(nn);const jt=Xa(Se.slug,t??""),Nt=Yt&&nt&&!!t,Xn=S.useRef(null);S.useEffect(()=>{if(Nt)return Za(jt)},[Nt,jt]);const{reload:it}=eo(Se.slug,t??""),Zn=S.useRef(it.seq);S.useEffect(()=>{if(Zn.current!==it.seq&&(Zn.current=it.seq,!!Nt&&Xn.current===kt.current)){if(it.navigates){cs(jt);return}nn()}},[it.seq]);const Lr=to(_n),lt=no(Qe(xe)?Lr:""),es=S.useRef(lt);S.useEffect(()=>{const c=es.current;if(es.current=lt,!c||!lt||c===lt)return;const h=P.current;if(h)return ai({iframe:h,reload:nn})},[lt]);const _r=()=>{const c=Ft.indexOf(k);j(Ft[(c+1)%Ft.length])},sn=(c,h)=>{if(!V)return;const L=V,$={...qe,[c]:h};Ee.current=Fe(W,$),ue(le=>({...le,[L]:$})),at({path:W,pageKey:L,params:$})},Ar=Qi({iframeBase:K.iframeBase,resolvedPath:ye,activeGlobalSectionName:A?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),rn=c=>{const h=re[c.key]??{},L=Fe(c.path,h);(A||Le(L)!==Le(ye))&&ie(),Ee.current=L,J(null),Q(null),se(null),T(null),de(c.key),oe(c.path),at({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};va(rt,c=>{(A||Le(c)!==Le(ye))&&ie(),Ee.current=c,J(null),Q(null),se(null),T(null),de(null),oe(c),at({path:c,pageKey:null,params:{}})});const Or=c=>{if(bn(xe)){const $=X?xo(X,c.key,ve):null;$?rn($):cn.info(e("sandbox.preview.blockOnNoPage"));return}if(!tt||!ve){cn.error(e("sandbox.preview.previewMetadataNotReady"));return}ie(),Ee.current=null;const h=fs(ve),L=hs(tt,h,c.key);J(c),Q(null),se(L),T(null),o.selectTarget({kind:"section",key:c.key})},Dr=c=>{f&&(J(null),Q(c.key),se(null),Et("blocks"),o.selectTarget({kind:"loader",key:c.key}))},Br=async({name:c,path:h,templateKey:L})=>{if(!t||!r)return;const $=Zs(h);if($){H($);return}const le=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(He.some(je=>Le(je.path)===Le(le))){H(e("sandbox.preview.pageAlreadyExists",{path:le}));return}let De;if(L&&(De=X?.[L],!De)){H(e("sandbox.preview.templateNoLongerExists"));return}H(void 0);try{const je=await An.mutateAsync({name:c,path:le,template:De});ce(!1),cn.success(e("sandbox.preview.pageCreated",{name:c})),await Co(hl),rn({key:je.key,name:je.name,path:je.path}),Et("blocks")}catch(je){H(je instanceof Error?je.message:e("sandbox.preview.failedToCreatePage"))}},Tt=Xi({previewSurfaceActive:nt,daemonReady:Er,production:K.mode==="production",servePreviewUrl:Qe(xe)}),Fr=Zi({showPreviewToolbar:Tt,contentEditingEnabled:m}),Ct=()=>{Z(!1),q("")},an=A?.name??bt?.title??Ht?.name,on=Rn.isPending||Ln.isPending,ln=on?ft(K.iframeBase):an,Rt=A?`section:${A.key}`:Y?`loader:${Y}`:V?`page:${V}`:void 0,Mr=Tt?Fr?s.jsxs(La,{open:U,onOpenChange:c=>{Z(c),c||q("")},children:[s.jsx(_a,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:on?ln??void 0:A||bt?an:[an,W].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[A&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(Sa,{size:11}),e("sandbox.preview.globalBadge")]}),bt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[s.jsx(Pa,{size:11}),e("sandbox.preview.loaderBadge")]}),ln&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ln}),!on&&!A&&!bt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:W}),s.jsx(ba,{size:12,className:Mt("shrink-0 transition-transform",U&&"rotate-180")})]})})}),s.jsxs(Aa,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(qs,{shouldFilter:!1,defaultValue:Rt,children:[s.jsx(Ws,{value:z,onValueChange:c=>{q(c),te.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(Vs,{ref:te,className:"max-h-80",children:[s.jsx(Gs,{children:He.length===0&&Ut.length===0&&Fn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Dn.length>0&&s.jsx(mt,{children:Dn.map(c=>s.jsxs(pt,{value:`page:${c.key}`,"aria-current":Rt===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Ct(),rn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Bn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalComponents"),children:Bn.map(c=>s.jsx(pt,{value:`section:${c.key}`,"aria-current":Rt===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Or(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Mn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalLoaders"),children:Mn.map(c=>s.jsx(pt,{value:`loader:${c.key}`,"aria-current":Rt===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Dr(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!A&&!Y&&ht(W).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:ht(W).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const L=Vt[c.name];return L&&wt?s.jsx(Mi,{sources:L,template:W,paramName:c.name,value:qe[c.name]??"",sandboxRef:wt,onCommit:$=>sn(c.name,$)},`${V}:${c.name}`):s.jsx(Ji,{name:c.name,value:qe[c.name]??"",onCommit:$=>sn(c.name,$)},`${V}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Xe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ct(),H(void 0),ce(!0)},children:[s.jsx(Ra,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Ar}):null,ts=Tt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:_r,"aria-label":e(As[k]),children:k==="mobile"?s.jsx(Ea,{size:16}):k==="tablet"?s.jsx(ja,{size:16}):s.jsx(Na,{size:16})})}),s.jsx(pn,{children:e(As[k])})]}),Mr,s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.jsx(ct,{onClick:kr,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(Wr,{size:16})})})]}):null,$r=(be||a)&&K.mode==="sandbox",Lt=gl[k],_t=k==="desktop"&&(_.width===0||_.width>=Lt.width+2*_s),ns=_t?1:Math.min(_.width>0?_.width/(Lt.width+2*_s):1,1),Kr=_t?{width:"100%",height:"100%"}:{width:`${Lt.width}px`,height:_.height>0?`${_.height/ns}px`:`${Lt.height}px`,transform:`scale(${ns})`,transformOrigin:"top center"},ss=s.jsxs(s.Fragment,{children:[$r&&(Tt||m)&&s.jsx(ct,{onClick:Cr,"aria-pressed":pe==="visual","aria-label":e("sandbox.preview.visualEditor"),active:pe==="visual",children:s.jsx(ls,{size:16})}),f&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:Rr,"aria-pressed":pe==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:pe==="blocks",children:s.jsx(Ca,{size:16})})}),s.jsx(pn,{children:e("sandbox.preview.blocksEditor")})]}),Ve&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:F,"aria-pressed":B,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:B,children:s.jsx(Ta,{size:16})})}),s.jsx(pn,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),zr=!!Y&&pe==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(Vt).map(([c,h])=>(qe[c]??"")===""?s.jsx(Wi,{sources:h,template:W,paramName:c,sandboxRef:wt,onFill:L=>sn(c,L)},`${V}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(is.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:ts}),children:ts}),s.jsx(is.Toolbar.Right.Portal,{fallback:ss,children:ss})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:zr?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F}),B&&Ve&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]}):s.jsxs(gs,{orientation:"horizontal",disabled:pe!=="blocks",className:"relative isolate",children:[s.jsx(Ot,{ref:N,id:"preview-blocks-editor",defaultSize:pe==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:pe==="blocks"&&s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F})}),pe==="blocks"&&s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-canvas",defaultSize:pe==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(gs,{orientation:"horizontal",disabled:!(B&&Ve),children:[s.jsx(Ot,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>I($=>$.width===c.clientWidth&&$.height===c.clientHeight?$:{width:c.clientWidth,height:c.clientHeight});h();const L=new ResizeObserver(h);return L.observe(c),()=>L.disconnect()},className:Mt("h-full relative overflow-clip flex justify-center",nt&&!_t&&"bg-muted/30"),children:[(ke||mr)&&nt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),K.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),K.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"starting",progress:zn,claimPhase:Jt})}),!M&&!Pe&&ze.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"suspended",onResume:ge.resume})}),!M&&!Pe&&ze.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"errored",error:ze.error,onRetry:ge.retry,connectionsHref:`/${Se.slug}/settings/connections`})}),K.showWakingPill&&s.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[s.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),pe==="visual"&&!y&&s.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(ls,{size:12}),e("sandbox.preview.clickElementToAsk")]}),pe==="visual"&&y&&s.jsx(fi,{element:y,onDismiss:()=>x(null)}),nt&&Ge&&s.jsx("div",{className:Mt("shrink-0",!_t&&"bg-background shadow-edge"),style:Kr,onMouseLeave:Tr,children:s.jsx("iframe",{ref:P,src:ot,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Gn.handleError,onLoad:()=>{if(Xt(Ls),Gn.handleLoad(),Te(),Xn.current=kt.current,Nt&&cs(jt),K.mode!=="sandbox"||M){(K.mode==="production"&&!K.showWakingPill||M)&&pe==="blocks"&&tn();return}if(Gr("vm_preview_loaded",{view_mode:pe,vm_id:Ze?.sandboxHandle??null}),!A)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ee.current;if(h!==null&&(Ee.current=null,Le(c)!==Le(h))||Le(c)===Le(ye))return;oe(c),at({path:c,pageKey:we,params:qe})}catch{}pe==="visual"&&Qn(),pe==="blocks"&&tn()}},K.iframeBase)})]})}),B&&Ve&&s.jsxs(s.Fragment,{children:[s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]})]})})]})}),s.jsx(tl,{open:ee,onOpenChange:ce,isPending:An.isPending,error:C,templates:He,onSubmit:Br})]})}const Pl=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},El=1e4,jl=1e4,Nl=5e3,Tl=2;function Cl(t,e){return t&&e===0?jl:Math.min(1e3*2**Math.max(0,e-1),Nl)}function Rl(t,e,n){return e?!0:t===!0&&n<Tl}function Ll(t,e){const n=ne.c(11),r=Pl,i=Jr();let u;n[0]!==t?(u=Bs.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,b=new AbortController,v=()=>b.abort();f.addEventListener("abort",v);const E=setTimeout(v,El),g=await r(t,b.signal).catch(Al);clearTimeout(E),f.removeEventListener("abort",v);const k=i.getQueryData(a),j=g?0:(k?.failures??0)+1;return{up:Rl(k?.up??null,g,j),failures:j}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:_l},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=Yr(d);return t?p?.up??null:null}function _l(t){return t.state.data?Cl(t.state.data.up,t.state.data.failures):!1}function Al(){return!1}function Ol(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Ec(t){const e=ne.c(48),{virtualMcpId:n}=t,r=_e(),i=Da(n),{connection:u}=Qs(n),{activeTask:a,taskId:o,currentBranch:l}=It(),d=Bo(o),[p,m]=S.useState(!1),f=En(n,l);let b;e[0]!==f||e[1]!==u?(b=u?Qe(f):null,e[0]=f,e[1]=u,e[2]=b):b=e[2];const v=b,E=Ll(v),g=rr();if(_o({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:hn(i?.metadata),threadHasRepo:hn(d)||hn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(bs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let x;e[4]!==r?(x=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=x):x=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(bs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let B;e[12]!==N?(B=s.jsxs(Xe,{onClick:T,children:[P,N]}),e[12]=N,e[13]=B):B=e[13];let R;e[14]!==x||e[15]!==w||e[16]!==B?(R=s.jsx(Ro,{className:"h-full",image:y,title:x,description:w,actions:B}),e[14]=x,e[15]=w,e[16]=B,e[17]=R):R=e[17];let D;e[18]!==p?(D=s.jsx(Lo,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=D):D=e[19];let O;return e[20]!==D||e[21]!==R?(O=s.jsxs(s.Fragment,{children:[R,D]}),e[20]=D,e[21]=R,e[22]=O):O=e[22],O}if(u&&i&&!Qe(f)){let y;e[23]!==g||e[24]!==f?(y=Ol({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let x;e[26]!==u.endpoint?(x=so(u.endpoint),e[26]=u.endpoint,e[27]=x):x=e[27];let w;return e[28]!==y||e[29]!==x?(w=s.jsx(Bl,{status:y,host:x}),e[28]=y,e[29]=x,e[30]=w):w=e[30],w}if(v&&E!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let x;e[33]!==v||e[34]!==r?(x=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Dl(v)}),e[33]=v,e[34]=r,e[35]=x):x=e[35];let w;e[36]!==x?(w=s.jsx(Kt,{text:x}),e[36]=x,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(zt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let j;return e[46]!==n?(j=s.jsx(pa,{children:s.jsx(Sl,{virtualMcpId:n})}),e[46]=n,e[47]=j):j=e[47],j}function Dl(t){try{return new URL(t).host}catch{return t}}function Bl(t){const e=ne.c(20),{status:n,host:r}=t,i=_e();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Kt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${Ys} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(zt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=zo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(Ko,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{Ko as L,Ec as P,zt as S,Pc as u};
|
|
551
|
+
`)}function ui(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function fi(t){const e=ne.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=ha(),{openSidePanel:l}=ko(),d=_e();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const U=di(n,i);l(),o({parts:[{type:"text",text:U}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=ui(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const b=f,v=`${b.leftPct}%`,E=`${b.topPct}%`;let g;e[9]!==v||e[10]!==E?(g={left:v,top:E,width:"320px"},e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==m?(k=U=>{U.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=U=>u(U.target.value),e[14]=j):j=e[14];let y;e[15]!==r?(y=U=>{U.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let x;e[17]!==d?(x=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=x):x=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==x?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:j,onKeyDown:y,placeholder:x,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=x,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let B;e[27]!==d?(B=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=B):B=e[28];let R;e[29]!==B?(R=s.jsx("title",{children:B}),e[29]=B,e[30]=R):R=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=D):D=e[31];let O;e[32]!==R?(O=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,D]}),e[32]=R,e[33]=O):O=e[33];let F;e[34]!==P||e[35]!==N||e[36]!==O?(F=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:O}),e[34]=P,e[35]=N,e[36]=O,e[37]=F):F=e[37];let _;e[38]!==w||e[39]!==F||e[40]!==k?(_=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:k,children:[w,F]}),e[38]=w,e[39]=F,e[40]=k,e[41]=_):_=e[41];let I;return e[42]!==_||e[43]!==g?(I=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:_}),e[42]=_,e[43]=g,e[44]=I):I=e[44],I}const Es="site-links",mi=/details?page|\bpdp\b/i,pi=/listingpage|\bplp\b/i;function hi(t,e,n){const r=new Set;for(const o of n)mi.test(o)&&r.add("product"),pi.test(o)&&r.add("category");const i=ht(Nn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const gi=["rosa","preto","pink","black"];function Dt(t,e){const n=e.trim();return n?t(n):gi.flatMap(r=>t(r))}function vi(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const ar=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Tn(t){return t.split("/")[0]??""}function xi(t){const e=new Set;for(const n of t){const r=Tn(n);ar.has(r)&&e.add(r)}return e}function bi(t,e){const n=Tn(t);return!ar.has(n)||e.size===0?!0:e.has(n)}const yi=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Dt(n=>vi(t,n),e),optionsFromPayload:Bt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:Ni}];function wi(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of yi){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&bi(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Tn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(ki(t.has("category")?"category":"product")),a}function ki(t){return{kind:t,id:Es,resolveType:Es,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>_i(e,n)}}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Si(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=Ie(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=Ie(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function or(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function ir(t){try{return decodeURIComponent(t)}catch{return t}}function Pi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=Pi(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function lr(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=ht(Nn(e)),{pattern:u,order:a}=Ei(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?ir(d):null}function Bt(t,e){const n=Ie(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=Ie(a);if(!o)continue;const l=lr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=Ie(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?Ie(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function ji(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?ir(n):null}function Ni(t){const e=[],n=new Set,r=(i,u)=>{const a=Ie(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=ji(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const Ti=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function Ci(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function Ri(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function Li(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function _i(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=lr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&Ti.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:Ci(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of Li(t))i(u,a,"product",o);for(const{href:u,text:a}of Ri(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function dt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const cr=1e4;function Ai(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function Oi(t,{resolveType:e,props:n}){const r=await fetch(Ua(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(cr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function js(t,e){const n=await fetch(Ha(t,e),{signal:AbortSignal.timeout(cr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function Di(t,e,n){const r=e.optionsFromPayload(await js(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Fe(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await js(t,u),n).filter(o=>o.kind==="product");return or([r,a])}catch{return r}}function Bi(t,e,n){return Bs.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function Fi(t,e,n,r){if(e.homepageLinks)return Di(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>Oi(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return or(a.map(o=>e.optionsFromPayload(o,r)))}function kn(t,e,n,r,i){return{queryKey:Bi(t,e,n),queryFn:()=>Fi(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function ut(t){const e=ne.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(Hs,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Fe(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(mt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Ns(t){const e=ne.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Mi(t){const e=ne.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=_e(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[b,v]=S.useState(""),E=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=Ai(l),y=[...new Set(n.map(M=>k[M.kind].noun))].join(" or ");let x;e[0]!==l||e[1]!==y?(x=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=x):x=e[2];const w=x,T={template:r,paramName:i};let P;e[3]!==m?(P=(M,G)=>({source:M,query:G,options:M.clientFilter?dt(G.data??[],m):G.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,B=n.filter(qi),R=n.filter(Vi),D=yn({queries:B.map(M=>kn(a,M,b,T,d))});let O;e[5]!==D||e[6]!==N?(O=(M,G)=>N(M,D[G]),e[5]=D,e[6]=N,e[7]=O):O=e[7];const F=B.map(O),_=F.length===0||F.every(Hi),I=yn({queries:R.map(M=>kn(a,M,b,T,d&&_))});let U;e[8]!==I||e[9]!==N?(U=(M,G)=>N(M,I[G]),e[8]=I,e[9]=N,e[10]=U):U=e[10];const Z=R.map(U),z=_?Z:F,q=z.length===1&&z[0]?.source.homepageLinks?z[0]:null,ee=q&&!q.query.isLoading&&!q.query.isError?q?.query.data??[]:[],ce=dt(ee.filter(Ui),m),C=dt(ee.filter(Ii),m),H=ce.length>0&&C.length>0,A=M=>{p(M),E.current&&clearTimeout(E.current),f(M?u:""),v(M?u:"")};let J;e[11]===Symbol.for("react.memo_cache_sentinel")?(J=M=>{f(M),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{v(M)},300)},e[11]=J):J=e[11];const Y=J,Q=M=>{o(M),A(!1)},he=Xs(m),se=Fe(r,{[i]:he}),W=Ds,oe=Os,we="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",de=zi;let re;e[12]!==g||e[13]!==l?(re=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=re):re=e[14];let ue;e[15]!==re?(ue=s.jsx(Fs,{className:"sr-only",children:s.jsx(Ms,{children:re})}),e[15]=re,e[16]=ue):ue=e[16];let ke;e[17]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Hs,{size:16,className:"shrink-0 text-foreground"}),e[17]=ke):ke=e[17];let ae;e[18]!==l?(ae=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=ae):ae=e[19];let fe;e[20]!==g?(fe=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:g}),e[20]=g,e[21]=fe):fe=e[21];let ie;e[22]!==ae||e[23]!==fe?(ie=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ke,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ae," ",fe]})]}),e[22]=ae,e[23]=fe,e[24]=ie):ie=e[24];const Te=qs,Se=!1,Me="min-h-0 flex-1";let ge;e[25]!==w||e[26]!==m?(ge=s.jsx(Ws,{autoFocus:!0,placeholder:w,value:m,onValueChange:Y}),e[25]=w,e[26]=m,e[27]=ge):ge=e[27];const Ze=Vs,vt="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Be;e[28]!==l?(Be=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Be):Be=e[29];let Ae;e[30]!==Be?(Ae=s.jsx(Gs,{children:Be}),e[30]=Be,e[31]=Ae):Ae=e[31];const xe=he&&s.jsx(mt,{className:"shrink-0",children:s.jsxs(pt,{value:`__raw__:${he}`,className:"gap-3 py-2",onSelect:()=>Q(he),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Po,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:he,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:se})]})]})}),$e=H?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:ce,template:r,paramName:i,keyPrefix:`${q?.source.id}:cat`,onSelect:Q})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${q?.source.id}:prod`,onSelect:Q})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:z.map(M=>{const{source:G,query:Ke,options:et}=M,{noun:Ue}=k[G.kind];if(Ke.isLoading)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.loading",{noun:Ue})},G.id);if(Ke.isError)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},G.id);if(G.homepageLinks){const xt=Ke.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:dt(xt.filter(Ki),m),template:r,paramName:i,keyPrefix:`${G.id}:cat`,onSelect:Q}),s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:dt(xt.filter($i),m),template:r,paramName:i,keyPrefix:`${G.id}:prod`,onSelect:Q})]},G.id)}return s.jsx(ut,{heading:z.length>1?k[G.kind].heading:void 0,iconKind:G.kind,options:et,template:r,paramName:i,keyPrefix:G.id,onSelect:Q},G.id)})});let Ce;e[32]!==Ze||e[33]!==Ae||e[34]!==xe||e[35]!==$e?(Ce=s.jsxs(Ze,{className:vt,children:[Ae,xe,$e]}),e[32]=Ze,e[33]=Ae,e[34]=xe,e[35]=$e,e[36]=Ce):Ce=e[36];let Re;e[37]!==Te||e[38]!==ge||e[39]!==Ce?(Re=s.jsxs(Te,{shouldFilter:Se,className:Me,children:[ge,Ce]}),e[37]=Te,e[38]=ge,e[39]=Ce,e[40]=Re):Re=e[40];let Pe;e[41]!==oe||e[42]!==ue||e[43]!==ie||e[44]!==Re||e[45]!==de?(Pe=s.jsxs(oe,{className:we,onClick:de,children:[ue,ie,Re]}),e[41]=oe,e[42]=ue,e[43]=ie,e[44]=Re,e[45]=de,e[46]=Pe):Pe=e[46];let be;return e[47]!==W||e[48]!==A||e[49]!==d||e[50]!==Pe?(be=s.jsx(W,{open:d,onOpenChange:A,children:Pe}),e[47]=W,e[48]=A,e[49]=d,e[50]=Pe,e[51]=be):be=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:M=>{M.stopPropagation(),A(!0)},children:u||g}),be]})}function $i(t){return t.kind==="product"}function Ki(t){return t.kind!=="product"}function zi(t){return t.stopPropagation()}function Ii(t){return t.kind==="product"}function Ui(t){return t.kind!=="product"}function Hi(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Vi(t){return t.isFallback}function qi(t){return!t.isFallback}function Wi(t){const e=ne.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const b={template:r,paramName:i},v=n.filter(Gi);l=yn,o=v.map(E=>kn(u,E,"",b,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const b of p){if(b.isLoading)break;const v=b.data?.[0];if(v){f(!0),queueMicrotask(()=>a(v.value));break}}return null}function Gi(t){return!t.isFallback}function Ji(t){const e=ne.c(31),{name:n,value:r,onCommit:i}=t,u=_e(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,b=a||f;let v;e[3]!==b?(v=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:b}),e[3]=b,e[4]=v):v=e[4];let E;e[5]!==f||e[6]!==u?(E=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=E):E=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let j;e[10]!==r?(j=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=j):j=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=Xs(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let x;e[16]!==a||e[17]!==f||e[18]!==E||e[19]!==j||e[20]!==y?(x=s.jsx("input",{type:"text",value:a,placeholder:f,title:E,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Yi,onChange:g,onFocus:k,onKeyDown:j,onBlur:y}),e[16]=a,e[17]=f,e[18]=E,e[19]=j,e[20]=y,e[21]=x):x=e[21];let w;e[22]!==v||e[23]!==x?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,x]}),e[22]=v,e[23]=x,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[s.jsx(ka,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Yi(t){return t.stopPropagation()}function Qi(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Xi(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Zi(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function el(t){const e=ne.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=$s(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const d=Qr(a),p=l?{...l,name:a,path:o}:Xr(a,o);return await r.mutateAsync({blockKey:d,data:p}),{key:d,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],Ir(i)}function tl(t){const e=ne.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=_e();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let b;e[2]!==d?(b=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=b):b=e[3];const[v,E]=S.useState(b),[g,k]=S.useState(dn),[j,y]=S.useState(null),[x,w]=S.useState(n);n!==x&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),E(d("sectionsEditor.createPageModal.defaultPagePath")),k(dn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=ae=>{!ae&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let B;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==v||e[11]!==T||e[12]!==g?(B=async ae=>{ae.preventDefault();const fe=m.trim(),ie=v.trim();if(!fe||!ie||l)return;const Te=Zs(ie);if(Te){y(Te);return}y(null),await o({name:fe,path:ie,templateKey:T&&g!==dn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=v,e[11]=T,e[12]=g,e[13]=B):B=e[13];const R=B,D=j??u;let O;e[14]!==d?(O=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=O):O=e[15];let F;e[16]!==O?(F=s.jsx(Fs,{children:s.jsx(Ms,{children:O})}),e[16]=O,e[17]=F):F=e[17];let _;e[18]!==d?(_=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=_):_=e[19];let I;e[20]!==_?(I=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=I):I=e[21];let U;e[22]===Symbol.for("react.memo_cache_sentinel")?(U=ae=>f(ae.target.value),e[22]=U):U=e[22];let Z;e[23]!==d?(Z=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=Z):Z=e[24];let z;e[25]!==l||e[26]!==m||e[27]!==Z?(z=s.jsx(rs,{id:"new-page-name",value:m,onChange:U,placeholder:Z,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=Z,e[28]=z):z=e[28];let q;e[29]!==z||e[30]!==I?(q=s.jsxs("div",{className:"space-y-1.5",children:[I,z]}),e[29]=z,e[30]=I,e[31]=q):q=e[31];let te;e[32]!==d?(te=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=te):te=e[33];let ee;e[34]!==te?(ee=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:te}),e[34]=te,e[35]=ee):ee=e[35];let ce;e[36]===Symbol.for("react.memo_cache_sentinel")?(ce=ae=>E(ae.target.value),e[36]=ce):ce=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let H;e[39]!==l||e[40]!==v||e[41]!==C?(H=s.jsx(rs,{id:"new-page-path",value:v,onChange:ce,placeholder:C,disabled:l}),e[39]=l,e[40]=v,e[41]=C,e[42]=H):H=e[42];let A;e[43]!==ee||e[44]!==H?(A=s.jsxs("div",{className:"space-y-1.5",children:[ee,H]}),e[43]=ee,e[44]=H,e[45]=A):A=e[45];let J;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(J=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(Zr,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=J):J=e[51];let Y;e[52]!==D?(Y=D&&s.jsx("p",{className:"text-xs text-destructive",children:D}),e[52]=D,e[53]=Y):Y=e[53];let Q;e[54]!==q||e[55]!==A||e[56]!==J||e[57]!==Y?(Q=s.jsxs("div",{className:"space-y-4 py-4",children:[q,A,J,Y]}),e[54]=q,e[55]=A,e[56]=J,e[57]=Y,e[58]=Q):Q=e[58];let he;e[59]!==r?(he=()=>r(!1),e[59]=r,e[60]=he):he=e[60];let se;e[61]!==d?(se=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=se):se=e[62];let W;e[63]!==l||e[64]!==he||e[65]!==se?(W=s.jsx(Xe,{type:"button",variant:"outline",onClick:he,disabled:l,children:se}),e[63]=l,e[64]=he,e[65]=se,e[66]=W):W=e[66];let oe;e[67]!==l||e[68]!==m||e[69]!==v?(oe=!m.trim()||!v.trim()||l,e[67]=l,e[68]=m,e[69]=v,e[70]=oe):oe=e[70];let we;e[71]!==l||e[72]!==d?(we=l?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=we):we=e[73];let de;e[74]!==oe||e[75]!==we?(de=s.jsx(Xe,{type:"submit",disabled:oe,children:we}),e[74]=oe,e[75]=we,e[76]=de):de=e[76];let re;e[77]!==W||e[78]!==de?(re=s.jsxs(Ur,{children:[W,de]}),e[77]=W,e[78]=de,e[79]=re):re=e[79];let ue;e[80]!==R||e[81]!==Q||e[82]!==re||e[83]!==F?(ue=s.jsx(Os,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[F,Q,re]})}),e[80]=R,e[81]=Q,e[82]=re,e[83]=F,e[84]=ue):ue=e[84];let ke;return e[85]!==N||e[86]!==n||e[87]!==ue?(ke=s.jsx(Ds,{open:n,onOpenChange:N,children:ue}),e[85]=N,e[86]=n,e[87]=ue,e[88]=ke):ke=e[88],ke}function nl(t){const e=ne.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=_e();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=$s(p);let f;e[4]!==m?(f=na((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const b=f;let v;e[6]!==l||e[7]!==o?(v=ea(o,l),e[6]=l,e[7]=o,e[8]=v):v=e[8];const{resolveType:E,props:g,title:k}=v;if(!E){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const j=`loader:${l}`;let y;e[13]!==l||e[14]!==E||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:E,title:k},e[13]=l,e[14]=E,e[15]=k,e[16]=y):y=e[16];let x;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==b||e[25]!==j||e[26]!==y||e[27]!==r?(x=s.jsx(ta,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:sl,onSaveReferencedBlock:b,showRun:!1},j),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=b,e[25]=j,e[26]=y,e[27]=r,e[28]=x):x=e[28],x}async function sl(){}function rl(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Ts(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:rl(t.error)}}function al(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function ol(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=al(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(i=>i.status==="error"&&!i.hasData&&i.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const il=S.lazy(()=>Hr(()=>import("./sections-editor-CkId24Js.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167])).then(t=>({default:t.SectionsEditor})));function Cs(t){const e=ne.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=Sn(),{currentBranch:o,taskId:l}=It(),d=tr(),p=Pn(),m=nr(),f=d.lifecycle.phase==="running",b=p.previewUrl;let v;e[0]!==o||e[1]!==a||e[2]!==b||e[3]!==l||e[4]!==n?(v=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:b}:null,e[0]=o,e[1]=a,e[2]=b,e[3]=l,e[4]=n,e[5]=v):v=e[5];const E=v,g=En(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const j=jn(E,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const x=Ks(E,y),w=ol({lifecyclePhase:d.lifecycle.phase,decofile:Ts(j),meta:Ts(x),hasEditableContent:mo(j.data,x.data),fastPreviewActive:Js(n).runtime==="cms"||bn(g)}),T=zs()===void 0,P=ll;if(sa(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(oa,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(ia,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Vr,{})),e[13]=C):C=e[13],C}if(j.data&&Va(x.data)){const C=m.state.target,H=C?.kind==="page"||C?.kind==="section"?C.key:null,A=H??"",J=o??"";let Y;return e[14]!==j.data||e[15]!==H||e[16]!==a.slug||e[17]!==A||e[18]!==J||e[19]!==n?(Y=P(s.jsx(ra,{orgSlug:a.slug,virtualMcpId:n,branch:J,decofile:j.data,initialKey:H,compact:!0},A)),e[14]=j.data,e[15]=H,e[16]=a.slug,e[17]=A,e[18]=J,e[19]=n,e[20]=Y):Y=e[20],Y}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(la,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==j||e[23]!==p||e[24]!==x||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([j.refetch(),x.refetch()])},e[22]=j,e[23]=p,e[24]=x,e[25]=w.source,e[26]=C):C=e[26];const H=C;let A;return e[27]!==H||e[28]!==w.source?(A=P(s.jsx(aa,{source:w.source,onRetry:H})),e[27]=H,e[28]=w.source,e[29]=A):A=e[29],A}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const B=N,R=m.state.target;if(R?.kind==="loader"&&j.data&&x.data){const C=o??"",H=b??null;let A;return e[31]!==j.data||e[32]!==x.data||e[33]!==a.slug||e[34]!==C||e[35]!==H||e[36]!==R.key||e[37]!==n?(A=B(s.jsx(nl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:H,meta:x.data,decofile:j.data,blockKey:R.key})),e[31]=j.data,e[32]=x.data,e[33]=a.slug,e[34]=C,e[35]=H,e[36]=R.key,e[37]=n,e[38]=A):A=e[38],A}let D;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(D=R||!o?null:Is(Us(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=D):D=e[43];const O=D;let F="/",_=null,I=null;R?.kind==="page"?(F=R.path,_=R.key):R?.kind==="section"?I=R.key:O&&(F=O.path,_=O.pageKey);const U=_?`page:${_}`:I?`section:${I}`:`path:${F}`;let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=Z):Z=e[44];const z=o??"",q=b??void 0,te=I?null:u,ee=!!_&&m.state.editSeoPageKey===_;let ce;return e[45]!==I||e[46]!==_||e[47]!==F||e[48]!==U||e[49]!==i||e[50]!==a.slug||e[51]!==te||e[52]!==ee||e[53]!==z||e[54]!==q||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ce=B(s.jsx(S.Suspense,{fallback:Z,children:s.jsx(il,{orgSlug:a.slug,virtualMcpId:n,branch:z,previewReady:!0,previewUrl:q,currentPath:F,activePageBlockKey:_,activeGlobalBlockKey:I,externalSelection:te,initialEditSeo:ee,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},U)})),e[45]=I,e[46]=_,e[47]=F,e[48]=U,e[49]=i,e[50]=a.slug,e[51]=te,e[52]=ee,e[53]=z,e[54]=q,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ce):ce=e[59],ce}function ll(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Rs(t){const e=ne.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=_e(),o=zs(),l=o===!0,d=qa(n);let p;e[0]!==d||e[1]!==r?(p=Wa(d,jo(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=Sn(),{currentBranch:b,taskId:v}=It(),g=Pn().previewUrl;let k;e[3]!==b||e[4]!==f.slug||e[5]!==g||e[6]!==v||e[7]!==n?(k=b?{orgSlug:f.slug,virtualMcpId:n,branch:b,threadId:v??null,previewUrl:g}:null,e[3]=b,e[4]=f.slug,e[5]=g,e[6]=v,e[7]=n,e[8]=k):k=e[8];const y=jn(k),x=b??"";let w;e[9]!==f.slug||e[10]!==x||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:x},e[9]=f.slug,e[10]=x,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=ca(w),N=y.data?.[r],B=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,D=!b||R||B;let O;e[13]!==N?(O=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=O):O=e[14];const F=O;let _;e[15]!==r||e[16]!==D||e[17]!==T?(_=te=>{if(D)return;let ee;try{ee=JSON.parse(te)}catch{return}ee===null||typeof ee!="object"||Array.isArray(ee)||T(r,ee)},e[15]=r,e[16]=D,e[17]=T,e[18]=_):_=e[18];const I=_;let U;e[19]!==P?(U=()=>({flush:P}),e[19]=P,e[20]=U):U=e[20],S.useImperativeHandle(u,U);let Z;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(Z=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Xe,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:s.jsx(qr,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=Z):Z=e[25];let z;e[26]!==y.data||e[27]!==P||e[28]!==F||e[29]!==B||e[30]!==R||e[31]!==r||e[32]!==D||e[33]!==I||e[34]!==a?(z=B?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Eo,{code:F,language:"json",readOnly:D,height:"100%",onChange:te=>I(te??""),onSave:te=>{I(te),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=F,e[29]=B,e[30]=R,e[31]=r,e[32]=D,e[33]=I,e[34]=a,e[35]=z):z=e[35];let q;return e[36]!==Z||e[37]!==z?(q=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,z]}),e[36]=Z,e[37]=z,e[38]=q):q=e[38],q}function dr(t){return t.contentEditingEnabled&&!t.isMobile}function cl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function dl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ul(t){return dr({contentEditingEnabled:er(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function fl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}const ml=15e3;function pl(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Ls(t){return t.loading?{...t,loading:!1}:t}const hl=500,gl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},_s=1,Ft=["desktop","mobile","tablet"],vl=["preview","visual","blocks"],As={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function xl(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function ft(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function xn(t,e){try{return new URL(t,e).href}catch{return null}}function bl(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function yl(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wl(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function kl(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sl({virtualMcpId:t}){const e=_e(),n=ro(),{currentBranch:r,taskId:i,virtualMcpId:u}=It(),a=!!ga(),o=nr(),l=Oa(u===t?t:null),d=Js(t),p=To(l?.metadata?.ui?.layout??null),m=er(p),f=dr({contentEditingEnabled:m,isMobile:n}),[b]=S.useState(()=>ul({cmsMode:p,isMobile:n})),[v,E]=as(os.previewEditingMode(t),c=>c&&vl.includes(c)?c:null),g=v??b,[k,j]=as(os.previewDeviceSize(t),c=>c&&Ft.includes(c)?c:"desktop"),[y,x]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[B,R]=S.useState(!1),D=S.useRef(null),O=()=>{D.current?.flush(),R(!1)},F=()=>R(c=>(c&&D.current?.flush(),!c)),[_,I]=S.useState({width:0,height:0}),[U,Z]=S.useState(!1),[z,q]=S.useState(""),te=S.useRef(null),[ee,ce]=S.useState(!1),[C,H]=S.useState(),[A,J]=S.useState(null),[Y,Q]=S.useState(null),[he,se]=S.useState(null),[W,oe]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[we,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[re,ue]=S.useState({}),[ke,ae]=S.useState(!1),fe=S.useRef(null),ie=()=>{ae(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>ae(!1),15e3)},Te=()=>{fe.current&&(clearTimeout(fe.current),fe.current=null),ae(!1)},{org:Se}=Sn(),Me=tr(),ge=Pn(),Ze=ge.vmEntry,vt=Me.lifecycle.phase,{url:Be,undecided:Ae}=Ga(t),xe=En(t,r),{connection:$e}=Qs(t),Ce=No(t),Re=Ja({hasServeConnection:!!$e,runtime:d.runtime}),Pe=Ae||Re==="github"&&(Ce==="loading"||Ce==="error"),be=!bn(xe)&&!Pe&&!(Re==="github"&&xe.kind==="pending"),M=Qe(xe)??Be,G=M??ge.previewUrl,Ke=!!M||vt==="running",et=l?.id===t?Fa(l.metadata):null,Ue=!M&&!Ae&&l?.id===t&&d.runtime==="cms",xt=d.projectDefault==="cms",tt=be?bo({sandboxUrl:G,previewServerUrl:et,fastPreviewActive:Ue}):null,Cn=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:G}:null,Rn=jn(Cn,{fetchEnabled:Ke}),Ln=Ks(Cn,{fetchEnabled:Ke}),X=Rn.data,ve=Ln.data,He=X?po(X,ve).sort((c,h)=>c.name.localeCompare(h.name)):[],_n=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r}:null,An=el(_n),Ut=X&&ve?ho(X,ve):[],On=be&&X&&ve?da(ve,X,"loaders"):[],Dn=z?(()=>{const c=z.toLowerCase();return He.map(h=>({page:h,score:wl(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,L)=>L.score-h.score||h.page.path.length-L.page.path.length).map(({page:h})=>h)})():He,Bn=Ut.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),Fn=f?On:[],Mn=Fn.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),bt=Y?On.find(c=>c.key===Y)??null:null,Le=Nn,Ht=A||Y?null:go(He,W,we),V=Ht?.key??null,Ve=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??V,yt=Ht?.path??null,qe=(V?re[V]:void 0)??{},ye=Fe(W,qe),Vt={};if(be&&Ke&&G&&ve&&X){const c=ua(ve,"loaders"),h=V?X[V]:void 0,L=Si(h,X,le=>c.has(le)),$=xi(L);for(const le of ht(W)){if(le.type!=="param")continue;const De=hi(W,le.name,L),je=wi(De,c,$);je.length>0&&(Vt[le.name]=je)}}const wt=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,$n=X&&V?vo(X,V,0):[],Kn=X?fa($n,X):[],qt=Kn.map(c=>c.isSavedBlock?c.label:""),Wt=Kn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),Gt=$n.map(c=>wn(c,X??{})),kt=S.useRef(null),Ee=S.useRef(null),ur=Me.status.state==="paused",Jt=Me.phase,zn=ma({claimPhase:Jt,lifecycle:Me.lifecycle}),ze=ge.previewState,fr=ge.userStopped,mr=Ya(Se.slug,t??""),{url:Oe}=wo(Ue&&t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,previewServerUrl:et??null,path:ye}:null),pr=xt&&d.runtime==="sandbox",Yt=Qa(xe,Re,Ce),K=Xo({previewState:ze,progressStatus:zn.status,previewServerUrl:et,fastPreviewActive:Ue,fastPreviewReady:!!Oe,codingSession:pr,localPreviewUrl:M,hostedDraft:Yt,deciding:Pe}),hr=K.showWakingPill||Yt&&K.mode==="production"&&!Oe,nt=K.mode!=="none",gr=K.mode==="production"&&K.iframeBase?ft(K.iframeBase):null,We=K.mode==="production"?gr:ft(G),vr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,st=be?M?K.mode==="sandbox"&&f&&g==="blocks":K.mode==="production"&&Ue&&vr&&f&&g==="blocks":!1,In=S.useRef(null),{pin:xr,effective:br}=bl(In.current,{inPlaceRenderActive:st,draftPreviewUrl:Oe,resolvedPath:ye});In.current=xr;const Un=o.state.variantOverride??[],St=be?Un:[],Qt=be?[]:Un,yr=$e&&Qe(xe)?ao($e.endpoint,Qt)??ms:null,Ge=xl(K.mode==="sandbox"?At(xs(ps(he??xn(ye,K.iframeBase)??K.iframeBase,yr),k),St):K.mode==="production"?At(xs(ds(ps(he??br??xn(ye,K.iframeBase)??K.iframeBase,hr?ms:null),Qt),k),St):null),Hn=Oe??(K.iframeBase?xn(ye,K.iframeBase):null),wr=K.mode==="production"?Hn?At(ds(Hn,Qt),St):null:Ge??K.iframeBase,kr=()=>{const c=wr;c&&window.open(c,"_blank","noopener")},rt=t&&r?Us(Se.slug,t,r):null,at=c=>{rt&&xa(rt,c)},me=o.state.target;S.useEffect(()=>{if(!(!me||!tt||!ve))if(me.kind==="page"){const c=re[me.key]??{};Ee.current=Fe(me.path,c),J(null),Q(null),se(null),de(me.key),oe(me.path),at({path:me.path,pageKey:me.key,params:c})}else if(me.kind==="loader")Ee.current=null,J(null),Q(me.key),se(null);else{const c=Ut.find(h=>h.key===me.key);if(c){Ee.current=null;const h=fs(ve);Q(null),J(c),se(hs(tt,h,c.key))}}},[me,tt,ve,re]),S.useEffect(()=>{!V||yt===null||me?.kind==="page"&&me.key===V&&me.path===yt||o.selectTarget({kind:"page",key:V,path:yt})},[V,yt,me]);const[Vn,Sr]=S.useState(null);if(ze.kind==="iframe"&&Vn!==ze.previewUrl){const c=Vn!==null;Sr(ze.previewUrl);const h=rt?Is(rt):null;if(h){if(Ee.current=Fe(h.path,h.params),oe(h.path),de(h.pageKey),se(null),J(null),Q(null),h.pageKey&&Object.keys(h.params).length>0){const L=h.pageKey;ue($=>({...$,[L]:h.params}))}}else c&&(Ee.current=null,oe("/"),se(null),de(null),J(null),Q(null))}kt.current=Ge;const Pr=K.mode==="production"&&!!Oe&&!M,[qn,Xt]=S.useState({src:Ge??void 0,loading:!1}),Pt=pl(qn,Ge??void 0,Pr);Pt!==qn&&Xt(Pt);const ot=Pt.src,Wn=Pt.loading,Gn=ni({iframeRef:P,src:K.mode==="sandbox"?Ge:null,active:K.mode==="sandbox"}),Jn=S.useRef(null);S.useEffect(()=>{const c=Wn?setTimeout(()=>Xt(Ls),ml):null,h=()=>{c&&clearTimeout(c)};if(!Oe||!ot||Jn.current===Oe)return h;Jn.current=Oe;const L=P.current;return L&&L.getAttribute("src")!==ot&&(ie(),L.src=ot),h},[Oe,ot,Wn]);const Yn=()=>{const c=P.current?.contentWindow,h=We;if(!c||!h||!X||!V)return;const L=X[V];if(!L||typeof L!="object")return;const $=yo({previewBaseUrl:h,pageBlock:L,decofile:X,path:ye,pathTemplate:W});if(!$)return;const le=At($.src,oo(St,V));c.postMessage({type:"cms-editor::render",src:le,body:$.body},h)},Zt=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){Zt.current=null;return}const c={nav:JSON.stringify({page:V,path:ye,pathTemplate:W}),content:JSON.stringify(X)},h=yl(Zt.current,c);Zt.current=c,h&&Yn()},[X,st,A,Y,V,ye,W]);const en=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){en.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=en.current;en.current={page:V,sig:c},!(!h||h.page!==V||h.sig===c)&&Yn()},[o.state.variantOverride,st,A,Y,V]);const Er=!!t&&!!r&&!Me.notFound&&!fr&&!ur&&(Jt?.kind==="ready"||vt!=="idle"),pe=fl({editingMode:g,sandboxDisplay:K.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=We;if(!c)return;const h=L=>{if(L.origin===c)if(L.data?.type==="visual-editor::element-clicked"){const $=oi.safeParse(L.data.payload);$.success&&x($.data)}else if(L.data?.type==="cms-editor::section-clicked"){const $=ci.safeParse(L.data.payload);$.success&&T({index:$.data.sectionIndex,seq:$.data.clickSeq})}else L.data?.type==="cms-editor::render-start"?ie():L.data?.type==="cms-editor::render-end"?(Te(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},c)):L.data?.type==="cms-editor::render-error"&&Te()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[We,qt,Wt,Gt]);const Qn=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::activate",script:ii},h)},jr=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},tn=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage(K.mode==="production"||M?{type:"editor::inject",args:{script:Ps}}:{type:"visual-editor::activate",script:Ps},h),c.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},h))},Nr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Tr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},Et=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),E(c),x(null),T(null),c!=="blocks"&&Q(null),h==="visual"&&jr(),c==="visual"&&Qn(),h==="blocks"&&c!=="blocks"&&Nr(),c==="blocks"&&tn()},Cr=()=>{Et(cl(g,f))},Rr=()=>{Et(dl(g,f))},nn=()=>{const c=P.current;if(!c)return;ie();const h=document.activeElement,L=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),kl(c,kt.current);let $;const le=()=>{clearTimeout($),c.tabIndex=L,c.style.pointerEvents="";const De=document.activeElement;(!De||De===document.body||De===c)&&h?.focus(),c.removeEventListener("load",le)};c.addEventListener("load",le),$=setTimeout(le,3e3)};So(nn);const jt=Xa(Se.slug,t??""),Nt=Yt&&nt&&!!t,Xn=S.useRef(null);S.useEffect(()=>{if(Nt)return Za(jt)},[Nt,jt]);const{reload:it}=eo(Se.slug,t??""),Zn=S.useRef(it.seq);S.useEffect(()=>{if(Zn.current!==it.seq&&(Zn.current=it.seq,!!Nt&&Xn.current===kt.current)){if(it.navigates){cs(jt);return}nn()}},[it.seq]);const Lr=to(_n),lt=no(Qe(xe)?Lr:""),es=S.useRef(lt);S.useEffect(()=>{const c=es.current;if(es.current=lt,!c||!lt||c===lt)return;const h=P.current;if(h)return ai({iframe:h,reload:nn})},[lt]);const _r=()=>{const c=Ft.indexOf(k);j(Ft[(c+1)%Ft.length])},sn=(c,h)=>{if(!V)return;const L=V,$={...qe,[c]:h};Ee.current=Fe(W,$),ue(le=>({...le,[L]:$})),at({path:W,pageKey:L,params:$})},Ar=Qi({iframeBase:K.iframeBase,resolvedPath:ye,activeGlobalSectionName:A?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),rn=c=>{const h=re[c.key]??{},L=Fe(c.path,h);(A||Le(L)!==Le(ye))&&ie(),Ee.current=L,J(null),Q(null),se(null),T(null),de(c.key),oe(c.path),at({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};va(rt,c=>{(A||Le(c)!==Le(ye))&&ie(),Ee.current=c,J(null),Q(null),se(null),T(null),de(null),oe(c),at({path:c,pageKey:null,params:{}})});const Or=c=>{if(bn(xe)){const $=X?xo(X,c.key,ve):null;$?rn($):cn.info(e("sandbox.preview.blockOnNoPage"));return}if(!tt||!ve){cn.error(e("sandbox.preview.previewMetadataNotReady"));return}ie(),Ee.current=null;const h=fs(ve),L=hs(tt,h,c.key);J(c),Q(null),se(L),T(null),o.selectTarget({kind:"section",key:c.key})},Dr=c=>{f&&(J(null),Q(c.key),se(null),Et("blocks"),o.selectTarget({kind:"loader",key:c.key}))},Br=async({name:c,path:h,templateKey:L})=>{if(!t||!r)return;const $=Zs(h);if($){H($);return}const le=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(He.some(je=>Le(je.path)===Le(le))){H(e("sandbox.preview.pageAlreadyExists",{path:le}));return}let De;if(L&&(De=X?.[L],!De)){H(e("sandbox.preview.templateNoLongerExists"));return}H(void 0);try{const je=await An.mutateAsync({name:c,path:le,template:De});ce(!1),cn.success(e("sandbox.preview.pageCreated",{name:c})),await Co(hl),rn({key:je.key,name:je.name,path:je.path}),Et("blocks")}catch(je){H(je instanceof Error?je.message:e("sandbox.preview.failedToCreatePage"))}},Tt=Xi({previewSurfaceActive:nt,daemonReady:Er,production:K.mode==="production",servePreviewUrl:Qe(xe)}),Fr=Zi({showPreviewToolbar:Tt,contentEditingEnabled:m}),Ct=()=>{Z(!1),q("")},an=A?.name??bt?.title??Ht?.name,on=Rn.isPending||Ln.isPending,ln=on?ft(K.iframeBase):an,Rt=A?`section:${A.key}`:Y?`loader:${Y}`:V?`page:${V}`:void 0,Mr=Tt?Fr?s.jsxs(La,{open:U,onOpenChange:c=>{Z(c),c||q("")},children:[s.jsx(_a,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:on?ln??void 0:A||bt?an:[an,W].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[A&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(Sa,{size:11}),e("sandbox.preview.globalBadge")]}),bt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[s.jsx(Pa,{size:11}),e("sandbox.preview.loaderBadge")]}),ln&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ln}),!on&&!A&&!bt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:W}),s.jsx(ba,{size:12,className:Mt("shrink-0 transition-transform",U&&"rotate-180")})]})})}),s.jsxs(Aa,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(qs,{shouldFilter:!1,defaultValue:Rt,children:[s.jsx(Ws,{value:z,onValueChange:c=>{q(c),te.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(Vs,{ref:te,className:"max-h-80",children:[s.jsx(Gs,{children:He.length===0&&Ut.length===0&&Fn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Dn.length>0&&s.jsx(mt,{children:Dn.map(c=>s.jsxs(pt,{value:`page:${c.key}`,"aria-current":Rt===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Ct(),rn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Bn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalComponents"),children:Bn.map(c=>s.jsx(pt,{value:`section:${c.key}`,"aria-current":Rt===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Or(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Mn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalLoaders"),children:Mn.map(c=>s.jsx(pt,{value:`loader:${c.key}`,"aria-current":Rt===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Dr(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!A&&!Y&&ht(W).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:ht(W).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const L=Vt[c.name];return L&&wt?s.jsx(Mi,{sources:L,template:W,paramName:c.name,value:qe[c.name]??"",sandboxRef:wt,onCommit:$=>sn(c.name,$)},`${V}:${c.name}`):s.jsx(Ji,{name:c.name,value:qe[c.name]??"",onCommit:$=>sn(c.name,$)},`${V}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Xe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ct(),H(void 0),ce(!0)},children:[s.jsx(Ra,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Ar}):null,ts=Tt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:_r,"aria-label":e(As[k]),children:k==="mobile"?s.jsx(Ea,{size:16}):k==="tablet"?s.jsx(ja,{size:16}):s.jsx(Na,{size:16})})}),s.jsx(pn,{children:e(As[k])})]}),Mr,s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.jsx(ct,{onClick:kr,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(Wr,{size:16})})})]}):null,$r=(be||a)&&K.mode==="sandbox",Lt=gl[k],_t=k==="desktop"&&(_.width===0||_.width>=Lt.width+2*_s),ns=_t?1:Math.min(_.width>0?_.width/(Lt.width+2*_s):1,1),Kr=_t?{width:"100%",height:"100%"}:{width:`${Lt.width}px`,height:_.height>0?`${_.height/ns}px`:`${Lt.height}px`,transform:`scale(${ns})`,transformOrigin:"top center"},ss=s.jsxs(s.Fragment,{children:[$r&&(Tt||m)&&s.jsx(ct,{onClick:Cr,"aria-pressed":pe==="visual","aria-label":e("sandbox.preview.visualEditor"),active:pe==="visual",children:s.jsx(ls,{size:16})}),f&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:Rr,"aria-pressed":pe==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:pe==="blocks",children:s.jsx(Ca,{size:16})})}),s.jsx(pn,{children:e("sandbox.preview.blocksEditor")})]}),Ve&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:F,"aria-pressed":B,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:B,children:s.jsx(Ta,{size:16})})}),s.jsx(pn,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),zr=!!Y&&pe==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(Vt).map(([c,h])=>(qe[c]??"")===""?s.jsx(Wi,{sources:h,template:W,paramName:c,sandboxRef:wt,onFill:L=>sn(c,L)},`${V}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(is.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:ts}),children:ts}),s.jsx(is.Toolbar.Right.Portal,{fallback:ss,children:ss})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:zr?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F}),B&&Ve&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]}):s.jsxs(gs,{orientation:"horizontal",disabled:pe!=="blocks",className:"relative isolate",children:[s.jsx(Ot,{ref:N,id:"preview-blocks-editor",defaultSize:pe==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:pe==="blocks"&&s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F})}),pe==="blocks"&&s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-canvas",defaultSize:pe==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(gs,{orientation:"horizontal",disabled:!(B&&Ve),children:[s.jsx(Ot,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>I($=>$.width===c.clientWidth&&$.height===c.clientHeight?$:{width:c.clientWidth,height:c.clientHeight});h();const L=new ResizeObserver(h);return L.observe(c),()=>L.disconnect()},className:Mt("h-full relative overflow-clip flex justify-center",nt&&!_t&&"bg-muted/30"),children:[(ke||mr)&&nt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),K.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),K.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"starting",progress:zn,claimPhase:Jt})}),!M&&!Pe&&ze.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"suspended",onResume:ge.resume})}),!M&&!Pe&&ze.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"errored",error:ze.error,onRetry:ge.retry,connectionsHref:`/${Se.slug}/settings/connections`})}),K.showWakingPill&&s.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[s.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),pe==="visual"&&!y&&s.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(ls,{size:12}),e("sandbox.preview.clickElementToAsk")]}),pe==="visual"&&y&&s.jsx(fi,{element:y,onDismiss:()=>x(null)}),nt&&Ge&&s.jsx("div",{className:Mt("shrink-0",!_t&&"bg-background shadow-edge"),style:Kr,onMouseLeave:Tr,children:s.jsx("iframe",{ref:P,src:ot,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Gn.handleError,onLoad:()=>{if(Xt(Ls),Gn.handleLoad(),Te(),Xn.current=kt.current,Nt&&cs(jt),K.mode!=="sandbox"||M){(K.mode==="production"&&!K.showWakingPill||M)&&pe==="blocks"&&tn();return}if(Gr("vm_preview_loaded",{view_mode:pe,vm_id:Ze?.sandboxHandle??null}),!A)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ee.current;if(h!==null&&(Ee.current=null,Le(c)!==Le(h))||Le(c)===Le(ye))return;oe(c),at({path:c,pageKey:we,params:qe})}catch{}pe==="visual"&&Qn(),pe==="blocks"&&tn()}},K.iframeBase)})]})}),B&&Ve&&s.jsxs(s.Fragment,{children:[s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]})]})})]})}),s.jsx(tl,{open:ee,onOpenChange:ce,isPending:An.isPending,error:C,templates:He,onSubmit:Br})]})}const Pl=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},El=1e4,jl=1e4,Nl=5e3,Tl=2;function Cl(t,e){return t&&e===0?jl:Math.min(1e3*2**Math.max(0,e-1),Nl)}function Rl(t,e,n){return e?!0:t===!0&&n<Tl}function Ll(t,e){const n=ne.c(11),r=Pl,i=Jr();let u;n[0]!==t?(u=Bs.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,b=new AbortController,v=()=>b.abort();f.addEventListener("abort",v);const E=setTimeout(v,El),g=await r(t,b.signal).catch(Al);clearTimeout(E),f.removeEventListener("abort",v);const k=i.getQueryData(a),j=g?0:(k?.failures??0)+1;return{up:Rl(k?.up??null,g,j),failures:j}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:_l},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=Yr(d);return t?p?.up??null:null}function _l(t){return t.state.data?Cl(t.state.data.up,t.state.data.failures):!1}function Al(){return!1}function Ol(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Ec(t){const e=ne.c(48),{virtualMcpId:n}=t,r=_e(),i=Da(n),{connection:u}=Qs(n),{activeTask:a,taskId:o,currentBranch:l}=It(),d=Bo(o),[p,m]=S.useState(!1),f=En(n,l);let b;e[0]!==f||e[1]!==u?(b=u?Qe(f):null,e[0]=f,e[1]=u,e[2]=b):b=e[2];const v=b,E=Ll(v),g=rr();if(_o({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:hn(i?.metadata),threadHasRepo:hn(d)||hn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(bs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let x;e[4]!==r?(x=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=x):x=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(bs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let B;e[12]!==N?(B=s.jsxs(Xe,{onClick:T,children:[P,N]}),e[12]=N,e[13]=B):B=e[13];let R;e[14]!==x||e[15]!==w||e[16]!==B?(R=s.jsx(Ro,{className:"h-full",image:y,title:x,description:w,actions:B}),e[14]=x,e[15]=w,e[16]=B,e[17]=R):R=e[17];let D;e[18]!==p?(D=s.jsx(Lo,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=D):D=e[19];let O;return e[20]!==D||e[21]!==R?(O=s.jsxs(s.Fragment,{children:[R,D]}),e[20]=D,e[21]=R,e[22]=O):O=e[22],O}if(u&&i&&!Qe(f)){let y;e[23]!==g||e[24]!==f?(y=Ol({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let x;e[26]!==u.endpoint?(x=so(u.endpoint),e[26]=u.endpoint,e[27]=x):x=e[27];let w;return e[28]!==y||e[29]!==x?(w=s.jsx(Bl,{status:y,host:x}),e[28]=y,e[29]=x,e[30]=w):w=e[30],w}if(v&&E!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let x;e[33]!==v||e[34]!==r?(x=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Dl(v)}),e[33]=v,e[34]=r,e[35]=x):x=e[35];let w;e[36]!==x?(w=s.jsx(Kt,{text:x}),e[36]=x,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(zt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let j;return e[46]!==n?(j=s.jsx(pa,{children:s.jsx(Sl,{virtualMcpId:n})}),e[46]=n,e[47]=j):j=e[47],j}function Dl(t){try{return new URL(t).host}catch{return t}}function Bl(t){const e=ne.c(20),{status:n,host:r}=t,i=_e();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Kt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${Ys} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(zt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=zo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(Ko,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{Ko as L,Ec as P,zt as S,Pc as u};
|
package/dist/client/assets/{product-picker-dialog-ukCeHMzo.js → product-picker-dialog-BUcziHgK.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ye}from"./thread-intent-BZm-EFCO.js";import{c as w,K as ie,m as ae,b as se,j as f,h as xe,r as H,l as re,I as le,af as be,s as je,v as Pe,B as ke,q as ve,D as Se}from"./index-BpE9ALKU.js";import{L as Ce,G as we}from"./agent-icon-rZeVl9Rl.js";import{aq as Ne}from"./site-editor-toast-CMmEyjwn.js";const De="https://placeholder.invalid";function Je(s,e){const t=(s??"").trim();if(!t)return"";const o=ye((e??"").trim());if(!o)return"";try{const i=new URL(t,De),a=new URL(o);return a.pathname=i.pathname,a.search=i.search,a.hash=i.hash,a.href}catch{return""}}const fe="vtex/loaders/intelligentSearch/productList.ts",Te="vtex/loaders/categories/tree.ts",Ee=24;function G(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Le(s){return s.split("/").filter(Boolean).map((t,o)=>`category-${o+1}/${t}`).join("/")}function $e(s,e){const t=e.trim(),o=fe,i=Ee;if(s==="cluster")return t?[{resolveType:o,props:{collection:t,count:i}}]:[];if(s==="category"){if(!t)return[];const d=Le(t);return d?[{resolveType:o,props:{facets:d,count:i}}]:[]}if(!t)return[{resolveType:o,props:{query:"",count:i}}];const a=[];/^\d+$/.test(t)&&a.push({resolveType:o,props:{ids:[t]}});const l=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return a.push({resolveType:o,props:{query:l,count:i}}),a}function Ie(){return{resolveType:Te,props:{}}}function _e(s){return{resolveType:fe,props:{ids:s}}}function de(s){return typeof s=="string"||typeof s=="number"?String(s):""}function pe(s){const e=G(s),t=Array.isArray(s)?s:Array.isArray(e?.products)?e.products:[],o=[],i=new Set;for(const a of t){const r=G(a);if(!r)continue;const l=de(r.productID)||de(r.sku);if(!l||i.has(l))continue;i.add(l);const d=G(r.isVariantOf),u=typeof d?.name=="string"&&d.name||typeof r.name=="string"&&r.name||l,n=qe(r.image),c=n[0],m=typeof r.url=="string"&&r.url||typeof d?.url=="string"&&d.url||void 0;o.push({id:l,label:u,image:c,images:n,url:m,category:Ae(r.category),description:Fe(r,d)})}return o}function qe(s){if(!Array.isArray(s))return[];const e=[];for(const t of s){const o=G(t),i=typeof o?.url=="string"?o.url:"";i&&!e.includes(i)&&e.push(i)}return e}function Ae(s){return typeof s!="string"||!s.trim()?void 0:s.split(/[>/]/).map(t=>t.trim()).filter(Boolean).pop()||void 0}function Fe(s,e){const o=(typeof s.description=="string"&&s.description||typeof e?.description=="string"&&e.description||"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();if(o)return o.length>400?`${o.slice(0,400).trimEnd()}…`:o}function Oe(s){if(typeof s!="string"||!s)return null;let e;try{e=new URL(s,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function Re(s){const e=[],t=new Set,o=(i,a)=>{const r=G(i);if(!r)return;const l=typeof r.name=="string"&&r.name?r.name:"",d=l?[...a,l]:a,u=Oe(r.url);if(u&&!t.has(u)&&(t.add(u),e.push({path:u,label:d.join(" › ")||u,url:typeof r.url=="string"?r.url:`/${u}`})),Array.isArray(r.children))for(const n of r.children)o(n,d)};if(Array.isArray(s))for(const i of s)o(i,[]);return e}function Ke(s,e,t=50){const o=e.trim().toLowerCase();return(o?s.filter(a=>a.label.toLowerCase().includes(o)||a.path.toLowerCase().includes(o)):s).slice(0,t)}const ze=1e4;async function ce(s,{resolveType:e,props:t}){const o=await fetch(Ne(s),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(ze)});if(!o.ok)throw new Error(`Failed to fetch (${o.status})`);return o.json()}function We(s,e){const t=w.c(20);let o;t[0]!==e?(o=new Set(e.filter(Boolean)),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==o?(i=[...o],t[2]=o,t[3]=i):i=t[3];const a=i;let r;t[4]!==a||t[5]!==s?(r=ie.sandboxInvoke(s?`${s.orgSlug}/${s.virtualMcpId}/${s.branch}`:"none",`blog-products-by-ids:${a.join(",")}`),t[4]=a,t[5]=s,t[6]=r):r=t[6];let l;t[7]!==a||t[8]!==s?(l=()=>ce(s,_e(a)).then(pe),t[7]=a,t[8]=s,t[9]=l):l=t[9];const d=!!s&&a.length>0;let u;t[10]!==r||t[11]!==l||t[12]!==d?(u={queryKey:r,queryFn:l,enabled:d,staleTime:6e4,retry:1},t[10]=r,t[11]=l,t[12]=d,t[13]=u):u=t[13];const n=ae(u);let c;if(t[14]!==n.data){c=new Map;for(const p of n.data??[])c.set(p.id,p);t[14]=n.data,t[15]=c}else c=t[15];let m;return t[16]!==c||t[17]!==n.isError||t[18]!==n.isLoading?(m={byId:c,isLoading:n.isLoading,isError:n.isError},t[16]=c,t[17]=n.isError,t[18]=n.isLoading,t[19]=m):m=t[19],m}function me(s){return`${s.orgSlug}/${s.virtualMcpId}/${s.branch}`}function ge(s){const e=w.c(9),{query:t,emptyLabel:o,loadingLabel:i}=s,a=se();if(t.isLoading){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=f.jsx(xe,{size:"xs"}),e[0]=l):l=e[0];let d;return e[1]!==i?(d=f.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[l,i]}),e[1]=i,e[2]=d):d=e[2],d}if(t.isError){let l;e[3]!==a?(l=a("sandbox.productPickerDialog.couldNotLoad"),e[3]=a,e[4]=l):l=e[4];let d;return e[5]!==l?(d=f.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:l}),e[5]=l,e[6]=d):d=e[6],d}let r;return e[7]!==o?(r=f.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:o}),e[7]=o,e[8]=r):r=e[8],r}function Be(s){const e=w.c(32),{sandboxRef:t,enabled:o,onSelect:i,className:a}=s,r=se(),[l,d]=H.useState("");let u;e[0]!==t?(u=ie.sandboxInvoke(me(t),"blog-category-tree"),e[0]=t,e[1]=u):u=e[1];let n;e[2]!==t?(n=()=>ce(t,Ie()).then(Re),e[2]=t,e[3]=n):n=e[3];let c;e[4]!==o||e[5]!==u||e[6]!==n?(c={queryKey:u,queryFn:n,enabled:o,staleTime:6e4,retry:1},e[4]=o,e[5]=u,e[6]=n,e[7]=c):c=e[7];const m=ae(c);let p,g,h,P;if(e[8]!==a||e[9]!==l||e[10]!==i||e[11]!==m||e[12]!==r){const C=Ke(m.data??[],l);h="space-y-2";let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=S=>d(S.target.value),e[17]=j):j=e[17];let b;e[18]!==r?(b=r("sandbox.productPickerDialog.filterCategoriesPlaceholder"),e[18]=r,e[19]=b):b=e[19],e[20]!==l||e[21]!==b?(P=f.jsx(le,{value:l,onChange:j,placeholder:b,className:"h-9"}),e[20]=l,e[21]=b,e[22]=P):P=e[22],e[23]!==a?(p=re("overflow-y-auto rounded-md border",a),e[23]=a,e[24]=p):p=e[24],g=C.length===0?f.jsx(ge,{query:m,loadingLabel:r("sandbox.productPickerDialog.loadingCategories"),emptyLabel:r("sandbox.productPickerDialog.noCategories")}):f.jsx("div",{className:"p-1",children:C.map(S=>f.jsx("button",{type:"button",onClick:()=>i(S),className:"block w-full truncate px-2 py-1.5 text-left text-sm hover:bg-accent rounded-lg",children:S.label},S.path))}),e[8]=a,e[9]=l,e[10]=i,e[11]=m,e[12]=r,e[13]=p,e[14]=g,e[15]=h,e[16]=P}else p=e[13],g=e[14],h=e[15],P=e[16];let x;e[25]!==p||e[26]!==g?(x=f.jsx("div",{className:p,children:g}),e[25]=p,e[26]=g,e[27]=x):x=e[27];let v;return e[28]!==h||e[29]!==P||e[30]!==x?(v=f.jsxs("div",{className:h,children:[P,x]}),e[28]=h,e[29]=P,e[30]=x,e[31]=v):v=e[31],v}const Ue=[{id:"search",labelKey:"sandbox.productPickerDialog.modeSearch"},{id:"category",labelKey:"sandbox.productPickerDialog.modeCategory"},{id:"cluster",labelKey:"sandbox.productPickerDialog.modeClusterId"}];async function Me(s,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(r=>ce(s,r))),o=t.filter(r=>r.status==="fulfilled").map(r=>r.value);if(o.length===0){const r=t.find(l=>l.status==="rejected");throw r?r.reason:new Error("Failed to fetch products")}const i=[],a=new Set;for(const r of o)for(const l of pe(r))a.has(l.id)||(a.add(l.id),i.push(l));return i}function ue(s){const e=w.c(6),[t,o]=H.useState(""),[i,a]=H.useState(""),r=H.useRef(null);let l;e[0]!==s?(l=n=>{o(n),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>a(n),s)},e[0]=s,e[1]=l):l=e[1];const d=l;let u;return e[2]!==i||e[3]!==d||e[4]!==t?(u={value:t,debounced:i,onChange:d},e[2]=i,e[3]=d,e[4]=t,e[5]=u):u=e[5],u}function Ve(s){const e=w.c(23),{option:t,selected:o,onToggle:i}=s,a=o?"border-primary/40 bg-primary/5":"border-transparent hover:bg-accent";let r;e[0]!==a?(r=re("flex w-full items-center gap-3 rounded-lg border px-2 py-2 text-left transition-colors",a),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==t.image?(l=f.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?f.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):f.jsx(Ce,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=l):l=e[3];let d;e[4]!==t.label?(d=f.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let u;e[6]!==t.id?(u=f.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=u):u=e[7];let n;e[8]!==d||e[9]!==u?(n=f.jsxs("span",{className:"min-w-0 flex-1",children:[d,u]}),e[8]=d,e[9]=u,e[10]=n):n=e[10];const c=o?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let m;e[11]!==c?(m=re("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",c),e[11]=c,e[12]=m):m=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=f.jsx(be,{size:12}),e[13]=p):p=e[13];let g;e[14]!==m?(g=f.jsx("span",{className:m,children:p}),e[14]=m,e[15]=g):g=e[15];let h;return e[16]!==i||e[17]!==o||e[18]!==g||e[19]!==r||e[20]!==l||e[21]!==n?(h=f.jsxs("button",{type:"button",onClick:i,"aria-pressed":o,className:r,children:[l,n,g]}),e[16]=i,e[17]=o,e[18]=g,e[19]=r,e[20]=l,e[21]=n,e[22]=h):h=e[22],h}function Ye(s){const e=w.c(20),{sandboxRef:t,open:o,selected:i,onSelect:a}=s,r=se();if(i){let d;e[0]!==a?(d=()=>a(null),e[0]=a,e[1]=d):d=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=f.jsx(we,{size:14}),e[2]=u):u=e[2];let n;e[3]!==r?(n=r("sandbox.productPickerDialog.categoryLabel"),e[3]=r,e[4]=n):n=e[4];let c;e[5]!==i.label?(c=f.jsx("span",{className:"text-foreground",children:i.label}),e[5]=i.label,e[6]=c):c=e[6];let m;e[7]!==r?(m=r("sandbox.productPickerDialog.change"),e[7]=r,e[8]=m):m=e[8];let p;e[9]!==n||e[10]!==c||e[11]!==m?(p=f.jsxs("span",{className:"truncate",children:[n,c," —",m]}),e[9]=n,e[10]=c,e[11]=m,e[12]=p):p=e[12];let g;return e[13]!==d||e[14]!==p?(g=f.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-foreground",children:[u,p]}),e[13]=d,e[14]=p,e[15]=g):g=e[15],g}let l;return e[16]!==a||e[17]!==o||e[18]!==t?(l=f.jsx(Be,{sandboxRef:t,enabled:o,onSelect:a,className:"h-48"}),e[16]=a,e[17]=o,e[18]=t,e[19]=l):l=e[19],l}function Ze(s){const e=w.c(90),{open:t,onOpenChange:o,sandboxRef:i,selectedIds:a,onChange:r,onPicked:l,multiple:d}=s,u=d===void 0?!0:d,n=se(),[c,m]=H.useState("search"),p=ue(300),g=ue(300),[h,P]=H.useState(null),x=c==="search"?p.debounced:c==="cluster"?g.debounced:h?.path??"";let v;e[0]!==c||e[1]!==x?(v=$e(c,x),e[0]=c,e[1]=x,e[2]=v):v=e[2];const C=v;let j;e[3]!==c||e[4]!==i||e[5]!==x?(j=ie.sandboxInvoke(me(i),`blog-product:${c}:${x}`),e[3]=c,e[4]=i,e[5]=x,e[6]=j):j=e[6];let b;e[7]!==C||e[8]!==i?(b=()=>Me(i,C),e[7]=C,e[8]=i,e[9]=b):b=e[9];const S=t&&C.length>0;let Q;e[10]!==j||e[11]!==b||e[12]!==S?(Q={queryKey:j,queryFn:b,enabled:S,staleTime:6e4,retry:1},e[10]=j,e[11]=b,e[12]=S,e[13]=Q):Q=e[13];const N=ae(Q);let X;e[14]!==a?(X=new Set(a.filter(Boolean)),e[14]=a,e[15]=X):X=e[15];const k=X;let J;e[16]!==u||e[17]!==r||e[18]!==l||e[19]!==k||e[20]!==a?(J=y=>{const te=y.id,ne=k.has(te);if(l){l(y,!ne);return}r(u?ne?a.filter(he=>he!==te):[...a.filter(Boolean),te]:ne?[]:[te])},e[16]=u,e[17]=r,e[18]=l,e[19]=k,e[20]=a,e[21]=J):J=e[21];const oe=J;let W;e[22]!==N.data?(W=N.data??[],e[22]=N.data,e[23]=W):W=e[23];const Z=W,D=C.length===0;let T;e[24]!==u||e[25]!==n?(T=n(u?"sandbox.productPickerDialog.addProducts":"sandbox.productPickerDialog.chooseProduct"),e[24]=u,e[25]=n,e[26]=T):T=e[26];let E;e[27]!==T?(E=f.jsx(je,{className:"border-b border-border px-4 py-3",children:f.jsx(Pe,{className:"text-sm font-medium",children:T})}),e[27]=T,e[28]=E):E=e[28];let L;e[29]!==c||e[30]!==n?(L=Ue.map(y=>f.jsx("button",{type:"button",onClick:()=>m(y.id),className:re("rounded-lg px-2.5 py-1 text-sm transition-colors",c===y.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:n(y.labelKey)},y.id)),e[29]=c,e[30]=n,e[31]=L):L=e[31];let $;e[32]!==L?($=f.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:L}),e[32]=L,e[33]=$):$=e[33];let I;e[34]!==c||e[35]!==p||e[36]!==n?(I=c==="search"&&f.jsx(le,{autoFocus:!0,value:p.value,onChange:y=>p.onChange(y.target.value),placeholder:n("sandbox.productPickerDialog.searchProductsPlaceholder"),className:"h-9"}),e[34]=c,e[35]=p,e[36]=n,e[37]=I):I=e[37];let _;e[38]!==g||e[39]!==c||e[40]!==n?(_=c==="cluster"&&f.jsx(le,{autoFocus:!0,value:g.value,onChange:y=>g.onChange(y.target.value),placeholder:n("sandbox.productPickerDialog.clusterIdPlaceholder"),className:"h-9"}),e[38]=g,e[39]=c,e[40]=n,e[41]=_):_=e[41];let q;e[42]!==h||e[43]!==c||e[44]!==t||e[45]!==i?(q=c==="category"&&f.jsx(Ye,{sandboxRef:i,open:t,selected:h,onSelect:P}),e[42]=h,e[43]=c,e[44]=t,e[45]=i,e[46]=q):q=e[46];let A;e[47]!==I||e[48]!==_||e[49]!==q?(A=f.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[I,_,q]}),e[47]=I,e[48]=_,e[49]=q,e[50]=A):A=e[50];let F;e[51]!==Z||e[52]!==N||e[53]!==k||e[54]!==D||e[55]!==n||e[56]!==oe?(F=Z.length>0?Z.map(y=>f.jsx(Ve,{option:y,selected:k.has(y.id),onToggle:()=>oe(y)},y.id)):!D&&f.jsx(ge,{query:N,loadingLabel:n("sandbox.productPickerDialog.loadingProducts"),emptyLabel:n("sandbox.productPickerDialog.noProductsFound")}),e[51]=Z,e[52]=N,e[53]=k,e[54]=D,e[55]=n,e[56]=oe,e[57]=F):F=e[57];let O;e[58]!==c||e[59]!==D||e[60]!==n?(O=D&&f.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:n(c==="category"?"sandbox.productPickerDialog.pickCategoryPrompt":"sandbox.productPickerDialog.enterClusterPrompt")}),e[58]=c,e[59]=D,e[60]=n,e[61]=O):O=e[61];let R;e[62]!==F||e[63]!==O?(R=f.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[F,O]}),e[62]=F,e[63]=O,e[64]=R):R=e[64];let K;e[65]!==k.size||e[66]!==n?(K=k.size===0?n("sandbox.productPickerDialog.noneSelected"):n("sandbox.productPickerDialog.selectedCount",{count:String(k.size)}),e[65]=k.size,e[66]=n,e[67]=K):K=e[67];let z;e[68]!==K?(z=f.jsx("span",{className:"text-xs text-muted-foreground",children:K}),e[68]=K,e[69]=z):z=e[69];let B;e[70]!==o?(B=()=>o(!1),e[70]=o,e[71]=B):B=e[71];let U;e[72]!==n?(U=n("sandbox.productPickerDialog.done"),e[72]=n,e[73]=U):U=e[73];let M;e[74]!==B||e[75]!==U?(M=f.jsx(ke,{size:"sm",onClick:B,children:U}),e[74]=B,e[75]=U,e[76]=M):M=e[76];let V;e[77]!==z||e[78]!==M?(V=f.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[z,M]}),e[77]=z,e[78]=M,e[79]=V):V=e[79];let Y;e[80]!==E||e[81]!==$||e[82]!==A||e[83]!==R||e[84]!==V?(Y=f.jsxs(ve,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[E,$,A,R,V]}),e[80]=E,e[81]=$,e[82]=A,e[83]=R,e[84]=V,e[85]=Y):Y=e[85];let ee;return e[86]!==o||e[87]!==t||e[88]!==Y?(ee=f.jsx(Se,{open:t,onOpenChange:o,children:Y}),e[86]=o,e[87]=t,e[88]=Y,e[89]=ee):ee=e[89],ee}export{Be as C,Ze as P,$e as b,ce as i,pe as p,Je as r,We as u};
|
|
1
|
+
import{s as ye}from"./thread-intent-DKuqiaG7.js";import{c as w,K as ie,m as ae,b as se,j as f,h as xe,r as H,l as re,I as le,af as be,s as je,v as Pe,B as ke,q as ve,D as Se}from"./index-CaH7O3hJ.js";import{L as Ce,G as we}from"./agent-icon-U4gZaLOQ.js";import{aq as Ne}from"./site-editor-toast-BtFL0E4q.js";const De="https://placeholder.invalid";function Je(s,e){const t=(s??"").trim();if(!t)return"";const o=ye((e??"").trim());if(!o)return"";try{const i=new URL(t,De),a=new URL(o);return a.pathname=i.pathname,a.search=i.search,a.hash=i.hash,a.href}catch{return""}}const fe="vtex/loaders/intelligentSearch/productList.ts",Te="vtex/loaders/categories/tree.ts",Ee=24;function G(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Le(s){return s.split("/").filter(Boolean).map((t,o)=>`category-${o+1}/${t}`).join("/")}function $e(s,e){const t=e.trim(),o=fe,i=Ee;if(s==="cluster")return t?[{resolveType:o,props:{collection:t,count:i}}]:[];if(s==="category"){if(!t)return[];const d=Le(t);return d?[{resolveType:o,props:{facets:d,count:i}}]:[]}if(!t)return[{resolveType:o,props:{query:"",count:i}}];const a=[];/^\d+$/.test(t)&&a.push({resolveType:o,props:{ids:[t]}});const l=t.includes("-")&&!/\s/.test(t)?t.replace(/-+/g," "):t;return a.push({resolveType:o,props:{query:l,count:i}}),a}function Ie(){return{resolveType:Te,props:{}}}function _e(s){return{resolveType:fe,props:{ids:s}}}function de(s){return typeof s=="string"||typeof s=="number"?String(s):""}function pe(s){const e=G(s),t=Array.isArray(s)?s:Array.isArray(e?.products)?e.products:[],o=[],i=new Set;for(const a of t){const r=G(a);if(!r)continue;const l=de(r.productID)||de(r.sku);if(!l||i.has(l))continue;i.add(l);const d=G(r.isVariantOf),u=typeof d?.name=="string"&&d.name||typeof r.name=="string"&&r.name||l,n=qe(r.image),c=n[0],m=typeof r.url=="string"&&r.url||typeof d?.url=="string"&&d.url||void 0;o.push({id:l,label:u,image:c,images:n,url:m,category:Ae(r.category),description:Fe(r,d)})}return o}function qe(s){if(!Array.isArray(s))return[];const e=[];for(const t of s){const o=G(t),i=typeof o?.url=="string"?o.url:"";i&&!e.includes(i)&&e.push(i)}return e}function Ae(s){return typeof s!="string"||!s.trim()?void 0:s.split(/[>/]/).map(t=>t.trim()).filter(Boolean).pop()||void 0}function Fe(s,e){const o=(typeof s.description=="string"&&s.description||typeof e?.description=="string"&&e.description||"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();if(o)return o.length>400?`${o.slice(0,400).trimEnd()}…`:o}function Oe(s){if(typeof s!="string"||!s)return null;let e;try{e=new URL(s,"https://placeholder.invalid").pathname}catch{return null}return e.replace(/^\/+|\/+$/g,"")||null}function Re(s){const e=[],t=new Set,o=(i,a)=>{const r=G(i);if(!r)return;const l=typeof r.name=="string"&&r.name?r.name:"",d=l?[...a,l]:a,u=Oe(r.url);if(u&&!t.has(u)&&(t.add(u),e.push({path:u,label:d.join(" › ")||u,url:typeof r.url=="string"?r.url:`/${u}`})),Array.isArray(r.children))for(const n of r.children)o(n,d)};if(Array.isArray(s))for(const i of s)o(i,[]);return e}function Ke(s,e,t=50){const o=e.trim().toLowerCase();return(o?s.filter(a=>a.label.toLowerCase().includes(o)||a.path.toLowerCase().includes(o)):s).slice(0,t)}const ze=1e4;async function ce(s,{resolveType:e,props:t}){const o=await fetch(Ne(s),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...t}),signal:AbortSignal.timeout(ze)});if(!o.ok)throw new Error(`Failed to fetch (${o.status})`);return o.json()}function We(s,e){const t=w.c(20);let o;t[0]!==e?(o=new Set(e.filter(Boolean)),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==o?(i=[...o],t[2]=o,t[3]=i):i=t[3];const a=i;let r;t[4]!==a||t[5]!==s?(r=ie.sandboxInvoke(s?`${s.orgSlug}/${s.virtualMcpId}/${s.branch}`:"none",`blog-products-by-ids:${a.join(",")}`),t[4]=a,t[5]=s,t[6]=r):r=t[6];let l;t[7]!==a||t[8]!==s?(l=()=>ce(s,_e(a)).then(pe),t[7]=a,t[8]=s,t[9]=l):l=t[9];const d=!!s&&a.length>0;let u;t[10]!==r||t[11]!==l||t[12]!==d?(u={queryKey:r,queryFn:l,enabled:d,staleTime:6e4,retry:1},t[10]=r,t[11]=l,t[12]=d,t[13]=u):u=t[13];const n=ae(u);let c;if(t[14]!==n.data){c=new Map;for(const p of n.data??[])c.set(p.id,p);t[14]=n.data,t[15]=c}else c=t[15];let m;return t[16]!==c||t[17]!==n.isError||t[18]!==n.isLoading?(m={byId:c,isLoading:n.isLoading,isError:n.isError},t[16]=c,t[17]=n.isError,t[18]=n.isLoading,t[19]=m):m=t[19],m}function me(s){return`${s.orgSlug}/${s.virtualMcpId}/${s.branch}`}function ge(s){const e=w.c(9),{query:t,emptyLabel:o,loadingLabel:i}=s,a=se();if(t.isLoading){let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=f.jsx(xe,{size:"xs"}),e[0]=l):l=e[0];let d;return e[1]!==i?(d=f.jsxs("div",{className:"flex items-center gap-2 px-2 py-6 text-sm text-muted-foreground",children:[l,i]}),e[1]=i,e[2]=d):d=e[2],d}if(t.isError){let l;e[3]!==a?(l=a("sandbox.productPickerDialog.couldNotLoad"),e[3]=a,e[4]=l):l=e[4];let d;return e[5]!==l?(d=f.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:l}),e[5]=l,e[6]=d):d=e[6],d}let r;return e[7]!==o?(r=f.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:o}),e[7]=o,e[8]=r):r=e[8],r}function Be(s){const e=w.c(32),{sandboxRef:t,enabled:o,onSelect:i,className:a}=s,r=se(),[l,d]=H.useState("");let u;e[0]!==t?(u=ie.sandboxInvoke(me(t),"blog-category-tree"),e[0]=t,e[1]=u):u=e[1];let n;e[2]!==t?(n=()=>ce(t,Ie()).then(Re),e[2]=t,e[3]=n):n=e[3];let c;e[4]!==o||e[5]!==u||e[6]!==n?(c={queryKey:u,queryFn:n,enabled:o,staleTime:6e4,retry:1},e[4]=o,e[5]=u,e[6]=n,e[7]=c):c=e[7];const m=ae(c);let p,g,h,P;if(e[8]!==a||e[9]!==l||e[10]!==i||e[11]!==m||e[12]!==r){const C=Ke(m.data??[],l);h="space-y-2";let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=S=>d(S.target.value),e[17]=j):j=e[17];let b;e[18]!==r?(b=r("sandbox.productPickerDialog.filterCategoriesPlaceholder"),e[18]=r,e[19]=b):b=e[19],e[20]!==l||e[21]!==b?(P=f.jsx(le,{value:l,onChange:j,placeholder:b,className:"h-9"}),e[20]=l,e[21]=b,e[22]=P):P=e[22],e[23]!==a?(p=re("overflow-y-auto rounded-md border",a),e[23]=a,e[24]=p):p=e[24],g=C.length===0?f.jsx(ge,{query:m,loadingLabel:r("sandbox.productPickerDialog.loadingCategories"),emptyLabel:r("sandbox.productPickerDialog.noCategories")}):f.jsx("div",{className:"p-1",children:C.map(S=>f.jsx("button",{type:"button",onClick:()=>i(S),className:"block w-full truncate px-2 py-1.5 text-left text-sm hover:bg-accent rounded-lg",children:S.label},S.path))}),e[8]=a,e[9]=l,e[10]=i,e[11]=m,e[12]=r,e[13]=p,e[14]=g,e[15]=h,e[16]=P}else p=e[13],g=e[14],h=e[15],P=e[16];let x;e[25]!==p||e[26]!==g?(x=f.jsx("div",{className:p,children:g}),e[25]=p,e[26]=g,e[27]=x):x=e[27];let v;return e[28]!==h||e[29]!==P||e[30]!==x?(v=f.jsxs("div",{className:h,children:[P,x]}),e[28]=h,e[29]=P,e[30]=x,e[31]=v):v=e[31],v}const Ue=[{id:"search",labelKey:"sandbox.productPickerDialog.modeSearch"},{id:"category",labelKey:"sandbox.productPickerDialog.modeCategory"},{id:"cluster",labelKey:"sandbox.productPickerDialog.modeClusterId"}];async function Me(s,e){if(e.length===0)return[];const t=await Promise.allSettled(e.map(r=>ce(s,r))),o=t.filter(r=>r.status==="fulfilled").map(r=>r.value);if(o.length===0){const r=t.find(l=>l.status==="rejected");throw r?r.reason:new Error("Failed to fetch products")}const i=[],a=new Set;for(const r of o)for(const l of pe(r))a.has(l.id)||(a.add(l.id),i.push(l));return i}function ue(s){const e=w.c(6),[t,o]=H.useState(""),[i,a]=H.useState(""),r=H.useRef(null);let l;e[0]!==s?(l=n=>{o(n),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>a(n),s)},e[0]=s,e[1]=l):l=e[1];const d=l;let u;return e[2]!==i||e[3]!==d||e[4]!==t?(u={value:t,debounced:i,onChange:d},e[2]=i,e[3]=d,e[4]=t,e[5]=u):u=e[5],u}function Ve(s){const e=w.c(23),{option:t,selected:o,onToggle:i}=s,a=o?"border-primary/40 bg-primary/5":"border-transparent hover:bg-accent";let r;e[0]!==a?(r=re("flex w-full items-center gap-3 rounded-lg border px-2 py-2 text-left transition-colors",a),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==t.image?(l=f.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?f.jsx("img",{src:t.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):f.jsx(Ce,{size:14,className:"text-muted-foreground"})}),e[2]=t.image,e[3]=l):l=e[3];let d;e[4]!==t.label?(d=f.jsx("span",{className:"line-clamp-2 text-sm",children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let u;e[6]!==t.id?(u=f.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:["ID ",t.id]}),e[6]=t.id,e[7]=u):u=e[7];let n;e[8]!==d||e[9]!==u?(n=f.jsxs("span",{className:"min-w-0 flex-1",children:[d,u]}),e[8]=d,e[9]=u,e[10]=n):n=e[10];const c=o?"border-primary bg-primary text-primary-foreground":"border-border text-transparent";let m;e[11]!==c?(m=re("flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",c),e[11]=c,e[12]=m):m=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=f.jsx(be,{size:12}),e[13]=p):p=e[13];let g;e[14]!==m?(g=f.jsx("span",{className:m,children:p}),e[14]=m,e[15]=g):g=e[15];let h;return e[16]!==i||e[17]!==o||e[18]!==g||e[19]!==r||e[20]!==l||e[21]!==n?(h=f.jsxs("button",{type:"button",onClick:i,"aria-pressed":o,className:r,children:[l,n,g]}),e[16]=i,e[17]=o,e[18]=g,e[19]=r,e[20]=l,e[21]=n,e[22]=h):h=e[22],h}function Ye(s){const e=w.c(20),{sandboxRef:t,open:o,selected:i,onSelect:a}=s,r=se();if(i){let d;e[0]!==a?(d=()=>a(null),e[0]=a,e[1]=d):d=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=f.jsx(we,{size:14}),e[2]=u):u=e[2];let n;e[3]!==r?(n=r("sandbox.productPickerDialog.categoryLabel"),e[3]=r,e[4]=n):n=e[4];let c;e[5]!==i.label?(c=f.jsx("span",{className:"text-foreground",children:i.label}),e[5]=i.label,e[6]=c):c=e[6];let m;e[7]!==r?(m=r("sandbox.productPickerDialog.change"),e[7]=r,e[8]=m):m=e[8];let p;e[9]!==n||e[10]!==c||e[11]!==m?(p=f.jsxs("span",{className:"truncate",children:[n,c," —",m]}),e[9]=n,e[10]=c,e[11]=m,e[12]=p):p=e[12];let g;return e[13]!==d||e[14]!==p?(g=f.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-foreground",children:[u,p]}),e[13]=d,e[14]=p,e[15]=g):g=e[15],g}let l;return e[16]!==a||e[17]!==o||e[18]!==t?(l=f.jsx(Be,{sandboxRef:t,enabled:o,onSelect:a,className:"h-48"}),e[16]=a,e[17]=o,e[18]=t,e[19]=l):l=e[19],l}function Ze(s){const e=w.c(90),{open:t,onOpenChange:o,sandboxRef:i,selectedIds:a,onChange:r,onPicked:l,multiple:d}=s,u=d===void 0?!0:d,n=se(),[c,m]=H.useState("search"),p=ue(300),g=ue(300),[h,P]=H.useState(null),x=c==="search"?p.debounced:c==="cluster"?g.debounced:h?.path??"";let v;e[0]!==c||e[1]!==x?(v=$e(c,x),e[0]=c,e[1]=x,e[2]=v):v=e[2];const C=v;let j;e[3]!==c||e[4]!==i||e[5]!==x?(j=ie.sandboxInvoke(me(i),`blog-product:${c}:${x}`),e[3]=c,e[4]=i,e[5]=x,e[6]=j):j=e[6];let b;e[7]!==C||e[8]!==i?(b=()=>Me(i,C),e[7]=C,e[8]=i,e[9]=b):b=e[9];const S=t&&C.length>0;let Q;e[10]!==j||e[11]!==b||e[12]!==S?(Q={queryKey:j,queryFn:b,enabled:S,staleTime:6e4,retry:1},e[10]=j,e[11]=b,e[12]=S,e[13]=Q):Q=e[13];const N=ae(Q);let X;e[14]!==a?(X=new Set(a.filter(Boolean)),e[14]=a,e[15]=X):X=e[15];const k=X;let J;e[16]!==u||e[17]!==r||e[18]!==l||e[19]!==k||e[20]!==a?(J=y=>{const te=y.id,ne=k.has(te);if(l){l(y,!ne);return}r(u?ne?a.filter(he=>he!==te):[...a.filter(Boolean),te]:ne?[]:[te])},e[16]=u,e[17]=r,e[18]=l,e[19]=k,e[20]=a,e[21]=J):J=e[21];const oe=J;let W;e[22]!==N.data?(W=N.data??[],e[22]=N.data,e[23]=W):W=e[23];const Z=W,D=C.length===0;let T;e[24]!==u||e[25]!==n?(T=n(u?"sandbox.productPickerDialog.addProducts":"sandbox.productPickerDialog.chooseProduct"),e[24]=u,e[25]=n,e[26]=T):T=e[26];let E;e[27]!==T?(E=f.jsx(je,{className:"border-b border-border px-4 py-3",children:f.jsx(Pe,{className:"text-sm font-medium",children:T})}),e[27]=T,e[28]=E):E=e[28];let L;e[29]!==c||e[30]!==n?(L=Ue.map(y=>f.jsx("button",{type:"button",onClick:()=>m(y.id),className:re("rounded-lg px-2.5 py-1 text-sm transition-colors",c===y.id?"bg-muted font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:n(y.labelKey)},y.id)),e[29]=c,e[30]=n,e[31]=L):L=e[31];let $;e[32]!==L?($=f.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-4 py-2",children:L}),e[32]=L,e[33]=$):$=e[33];let I;e[34]!==c||e[35]!==p||e[36]!==n?(I=c==="search"&&f.jsx(le,{autoFocus:!0,value:p.value,onChange:y=>p.onChange(y.target.value),placeholder:n("sandbox.productPickerDialog.searchProductsPlaceholder"),className:"h-9"}),e[34]=c,e[35]=p,e[36]=n,e[37]=I):I=e[37];let _;e[38]!==g||e[39]!==c||e[40]!==n?(_=c==="cluster"&&f.jsx(le,{autoFocus:!0,value:g.value,onChange:y=>g.onChange(y.target.value),placeholder:n("sandbox.productPickerDialog.clusterIdPlaceholder"),className:"h-9"}),e[38]=g,e[39]=c,e[40]=n,e[41]=_):_=e[41];let q;e[42]!==h||e[43]!==c||e[44]!==t||e[45]!==i?(q=c==="category"&&f.jsx(Ye,{sandboxRef:i,open:t,selected:h,onSelect:P}),e[42]=h,e[43]=c,e[44]=t,e[45]=i,e[46]=q):q=e[46];let A;e[47]!==I||e[48]!==_||e[49]!==q?(A=f.jsxs("div",{className:"shrink-0 space-y-2 px-4 py-3",children:[I,_,q]}),e[47]=I,e[48]=_,e[49]=q,e[50]=A):A=e[50];let F;e[51]!==Z||e[52]!==N||e[53]!==k||e[54]!==D||e[55]!==n||e[56]!==oe?(F=Z.length>0?Z.map(y=>f.jsx(Ve,{option:y,selected:k.has(y.id),onToggle:()=>oe(y)},y.id)):!D&&f.jsx(ge,{query:N,loadingLabel:n("sandbox.productPickerDialog.loadingProducts"),emptyLabel:n("sandbox.productPickerDialog.noProductsFound")}),e[51]=Z,e[52]=N,e[53]=k,e[54]=D,e[55]=n,e[56]=oe,e[57]=F):F=e[57];let O;e[58]!==c||e[59]!==D||e[60]!==n?(O=D&&f.jsx("p",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:n(c==="category"?"sandbox.productPickerDialog.pickCategoryPrompt":"sandbox.productPickerDialog.enterClusterPrompt")}),e[58]=c,e[59]=D,e[60]=n,e[61]=O):O=e[61];let R;e[62]!==F||e[63]!==O?(R=f.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto border-t border-border px-3 py-2",children:[F,O]}),e[62]=F,e[63]=O,e[64]=R):R=e[64];let K;e[65]!==k.size||e[66]!==n?(K=k.size===0?n("sandbox.productPickerDialog.noneSelected"):n("sandbox.productPickerDialog.selectedCount",{count:String(k.size)}),e[65]=k.size,e[66]=n,e[67]=K):K=e[67];let z;e[68]!==K?(z=f.jsx("span",{className:"text-xs text-muted-foreground",children:K}),e[68]=K,e[69]=z):z=e[69];let B;e[70]!==o?(B=()=>o(!1),e[70]=o,e[71]=B):B=e[71];let U;e[72]!==n?(U=n("sandbox.productPickerDialog.done"),e[72]=n,e[73]=U):U=e[73];let M;e[74]!==B||e[75]!==U?(M=f.jsx(ke,{size:"sm",onClick:B,children:U}),e[74]=B,e[75]=U,e[76]=M):M=e[76];let V;e[77]!==z||e[78]!==M?(V=f.jsxs("div",{className:"flex shrink-0 items-center justify-between border-t border-border px-4 py-3",children:[z,M]}),e[77]=z,e[78]=M,e[79]=V):V=e[79];let Y;e[80]!==E||e[81]!==$||e[82]!==A||e[83]!==R||e[84]!==V?(Y=f.jsxs(ve,{className:"flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[560px] sm:max-w-[560px]",children:[E,$,A,R,V]}),e[80]=E,e[81]=$,e[82]=A,e[83]=R,e[84]=V,e[85]=Y):Y=e[85];let ee;return e[86]!==o||e[87]!==t||e[88]!==Y?(ee=f.jsx(Se,{open:t,onOpenChange:o,children:Y}),e[86]=o,e[87]=t,e[88]=Y,e[89]=ee):ee=e[89],ee}export{Be as C,Ze as P,$e as b,ce as i,pe as p,Je as r,We as u};
|