decocms 4.389.3 → 4.390.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/dist/client/assets/{AlertCircle-CZgJU8hk.js → AlertCircle-DIleECAO.js} +1 -1
  2. package/dist/client/assets/{AreaChart-4r4BNLYX.js → AreaChart-Dcvvxh7Y.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DhxCKHos.js → ArrowLeft-BQdhx2Mc.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-_xtmiHEF.js → ArrowRight-C0GCvnPO.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BwaH-bh6.js → ArrowUp-BMtV26Mz.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-BMUOPwI_.js → CartesianChart-fEiWB8Dp.js} +1 -1
  7. package/dist/client/assets/{Check-CtmIaXgC.js → Check-DRrZD4Sq.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-D2P1mu3F.js → CheckCircle-Bo8c4lL0.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CyyD7MJn.js → ChevronUp-BN0TeZdP.js} +1 -1
  10. package/dist/client/assets/{Copy01-B3IMMOKh.js → Copy01-BT6z7ZQQ.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-md1P0gzk.js → CreditCard01-DVV_ZsCa.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CCR-YCOc.js → DotsVertical-DfMw3lkW.js} +1 -1
  13. package/dist/client/assets/{Download01-DvdgweoY.js → Download01-BmFUB2xE.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-kTZLTiOh.js → ErrorBarContext-DMVbXYkP.js} +1 -1
  15. package/dist/client/assets/{Eye-tQWA9lCZ.js → Eye-DXw_s1Cm.js} +1 -1
  16. package/dist/client/assets/{Globe04-D2iVj_TG.js → Globe04-ugZLbuIE.js} +1 -1
  17. package/dist/client/assets/{Image01-CwALg1a4.js → Image01-DDFibjE3.js} +1 -1
  18. package/dist/client/assets/{Key01-CGZM8V37.js → Key01-BPjkSgKb.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft--CSq68Va.js → LayoutLeft-B94Wve5b.js} +1 -1
  20. package/dist/client/assets/{Line-x5_dqhML.js → Line-C_3dc8Fz.js} +1 -1
  21. package/dist/client/assets/{Link01-CpHtaXY6.js → Link01-O7jcIMgL.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-JGVFU9rY.js → LinkExternal01-B1unTZnq.js} +1 -1
  23. package/dist/client/assets/{Monitor01-B4CSzOr6.js → Monitor01-a2J2JKd5.js} +1 -1
  24. package/dist/client/assets/{Package-B-4JMCkY.js → Package-CdoCtMvg.js} +1 -1
  25. package/dist/client/assets/{Palette-B4w2mE4d.js → Palette-CycMgJho.js} +1 -1
  26. package/dist/client/assets/{Plus-DOI9wakW.js → Plus-D1cZZn8U.js} +1 -1
  27. package/dist/client/assets/{SearchLg-0fHGMTGh.js → SearchLg-O_9EykPH.js} +1 -1
  28. package/dist/client/assets/{SearchMd-BoetaL4Y.js → SearchMd-DrIRniNc.js} +1 -1
  29. package/dist/client/assets/{Sector-Cvr3MZNh.js → Sector-T4EO3BRZ.js} +1 -1
  30. package/dist/client/assets/{Share07-Dx4iZESB.js → Share07-CveFLZ1M.js} +1 -1
  31. package/dist/client/assets/{Stars01-Dm3CFp2u.js → Stars01-Did1svMN.js} +1 -1
  32. package/dist/client/assets/{Sun-Bq352qjl.js → Sun-32REGP_l.js} +1 -1
  33. package/dist/client/assets/{Tool01-4DAbUoNs.js → Tool01-CfuRDLuO.js} +1 -1
  34. package/dist/client/assets/{Trash01-BiPmRbe2.js → Trash01-UuilHlOp.js} +1 -1
  35. package/dist/client/assets/{Upload01-DL0grgTa.js → Upload01-DWdtMUnK.js} +1 -1
  36. package/dist/client/assets/{User01-jL_Upcq0.js → User01-BH-9UAFf.js} +1 -1
  37. package/dist/client/assets/{UserSquare-CG9zonIL.js → UserSquare-DNofESoQ.js} +1 -1
  38. package/dist/client/assets/{Users01-BZ_Cu-tk.js → Users01-88zgeg9Z.js} +1 -1
  39. package/dist/client/assets/{X-BXzWjoaJ.js → X-B9qowSuy.js} +1 -1
  40. package/dist/client/assets/{XCircle-D-Aq9OMT.js → XCircle-BaLe-WrJ.js} +1 -1
  41. package/dist/client/assets/{XClose-ZnbMEO-2.js → XClose-CZ8QMEvw.js} +1 -1
  42. package/dist/client/assets/{Zap-D8xM5bbr.js → Zap-B_Jp5KVu.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-CEOwwH34.js → ZoomOut-B1ZE8qec.js} +1 -1
  44. package/dist/client/assets/{access-gate-gTVIdkvk.js → access-gate-DscR-bsQ.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-B_OoIhEU.js → add-connection-dialog-QXnYSLA7.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-BVuZU0kp.js → agent-analytics-Dzc2ZAZd.js} +1 -1
  47. package/dist/client/assets/agent-app-Ce-w0zKY.js +1 -0
  48. package/dist/client/assets/{agent-assets-DunxHoUt.js → agent-assets-B6nLETiH.js} +1 -1
  49. package/dist/client/assets/{agent-automation-itWhmy47.js → agent-automation-Cn5vrcNs.js} +1 -1
  50. package/dist/client/assets/{agent-automations-B_iqWE-s.js → agent-automations-CgWEH9q3.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-DJiZA-eT.js → agent-connect-sources-BLb45__q.js} +1 -1
  52. package/dist/client/assets/agent-deck-DLPNS7GA.js +1 -0
  53. package/dist/client/assets/{agent-e2e-C6_2yKrt.js → agent-e2e-TmVf9IYe.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-B-KHbmuz.js → agent-experiments-Liv-zbXM.js} +1 -1
  55. package/dist/client/assets/agent-file-D6Zh386o.js +1 -0
  56. package/dist/client/assets/{agent-git-CtPSRwK-.js → agent-git-C2HJviFO.js} +1 -1
  57. package/dist/client/assets/{agent-hosting-CDmmWeCe.js → agent-hosting-Bg_TtJeb.js} +1 -1
  58. package/dist/client/assets/{agent-icon-lfrVH-OK.js → agent-icon-BXDfHtVM.js} +1 -1
  59. package/dist/client/assets/agent-library-file-CH6771FT.js +1 -0
  60. package/dist/client/assets/{agent-monitor-DAUmzJS6.js → agent-monitor-qJHIu9n-.js} +1 -1
  61. package/dist/client/assets/{agent-overview-CIAbKs8U.js → agent-overview-Dd76Hmnc.js} +1 -1
  62. package/dist/client/assets/agent-settings-CRbKxksO.js +1 -0
  63. package/dist/client/assets/agent-site-editor-9Y3R_xpF.js +24 -0
  64. package/dist/client/assets/agent-site-editor-code-_YVH4S1b.js +2 -0
  65. package/dist/client/assets/{agent-site-editor-content-B3_V1yDe.js → agent-site-editor-content-DpMCNbyj.js} +2 -2
  66. package/dist/client/assets/agent-site-editor-preview-CmLpHkzD.js +518 -0
  67. package/dist/client/assets/agent-view-Do6pchh4.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-BKjvc_rQ.js → agent-view-guard-B4f7H4-v.js} +1 -1
  69. package/dist/client/assets/{agents-list-CtZRmfpt.js → agents-list-Cr-Kq4ri.js} +1 -1
  70. package/dist/client/assets/{ai-providers-NVm8dOEA.js → ai-providers-w2Ei6Gov.js} +1 -1
  71. package/dist/client/assets/{alert-IyATCOkZ.js → alert-CAeIKgsg.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-C09wZ9of.js → alert-dialog-BQ7YDqVG.js} +1 -1
  73. package/dist/client/assets/{api-keys-EG9PbK9N.js → api-keys-BvXXeUsu.js} +1 -1
  74. package/dist/client/assets/api-keys-DHEfnLkb.js +1 -0
  75. package/dist/client/assets/app-editor-BXR-njir.js +1 -0
  76. package/dist/client/assets/{asset-utils-C6cJmK0c.js → asset-utils-C9X-Z7A6.js} +1 -1
  77. package/dist/client/assets/{auth-wbn4hkw_.js → auth-BnlPL6eu.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-BRxbWGOj.js → auth-catchall-C-aCQhS4.js} +1 -1
  79. package/dist/client/assets/{auth-entry-DHjilC9Z.js → auth-entry-D9wUFcoV.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-BvLbYHT9.js → auth-split-layout-WiP6i-LQ.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-B3tNLMug.js → authenticate-and-persist-oauth-iiuO4guj.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-D1K6muCb.js → automation-list-row-C-XwD7WY.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DNXERnn5.js → automation-runs-2c2OE9Nu.js} +1 -1
  84. package/dist/client/assets/{automations-CHbvpFyN.js → automations-EdtP3Z09.js} +1 -1
  85. package/dist/client/assets/{autosend-YcrMa2dL.js → autosend-Cg2v6B4Z.js} +1 -1
  86. package/dist/client/assets/{avatar-BGUOlD6Z.js → avatar-BQNxscJa.js} +1 -1
  87. package/dist/client/assets/{badge-B0klsi-0.js → badge-BwVbjdvl.js} +1 -1
  88. package/dist/client/assets/{block-document-Dl37vVpL.js → block-document-DCky20wU.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-PuE-5QVF.js → blocks-preview-workspace-context-B2yuR6jc.js} +1 -1
  90. package/dist/client/assets/{breadcrumb-Ccg4yCGn.js → breadcrumb-NkW-PGNe.js} +1 -1
  91. package/dist/client/assets/{buckets-DY7b2y6B.js → buckets-_QRhoG0L.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-CGLnUwL5.js → build-improve-prompt-doc-Bl7SRn0M.js} +1 -1
  93. package/dist/client/assets/{bulk-category-panel-D24OMSIK.js → bulk-category-panel-COyTAhey.js} +1 -1
  94. package/dist/client/assets/{calendar-DObs1MgB.js → calendar-CB1zm3q3.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-BaSTFNnb.js → capability-load-error-a5Vi87rX.js} +1 -1
  96. package/dist/client/assets/{category-editor-DUbNzg8f.js → category-editor-DuIz6r3J.js} +1 -1
  97. package/dist/client/assets/{chart-pGd0wMOK.js → chart-C00MAPcg.js} +1 -1
  98. package/dist/client/assets/{chat-context-D_-xGMp5.js → chat-context-BCloL478.js} +6 -6
  99. package/dist/client/assets/{chat-draft-BhXkcd-9.js → chat-draft-D4RLSZai.js} +1 -1
  100. package/dist/client/assets/{checkbox-CmtLPtxw.js → checkbox-C6TuRBhm.js} +1 -1
  101. package/dist/client/assets/{choose-editor-XS5QyhMo.js → choose-editor-DoxQsH9F.js} +1 -1
  102. package/dist/client/assets/claim-phase-copy-BrfTfUkY.js +1 -0
  103. package/dist/client/assets/{cli-auth-success--H9V4y3S.js → cli-auth-success-CbhZdN7_.js} +1 -1
  104. package/dist/client/assets/{client-icons-DFwFvPlp.js → client-icons-C_XzNrl0.js} +1 -1
  105. package/dist/client/assets/{collapsible-B4ohHlAo.js → collapsible-fDF6O7Qh.js} +1 -1
  106. package/dist/client/assets/{collection-detail-CzRYOslO.js → collection-detail-DFwFjmQm.js} +1 -1
  107. package/dist/client/assets/{collection-display-button-CLhaDLux.js → collection-display-button-UjSGWnur.js} +1 -1
  108. package/dist/client/assets/{collection-search-DORJq6xs.js → collection-search-BBLgZGH_.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-DJCXLoEN.js → collection-table-wrapper-DuiXZpDA.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-B28RcavJ.js → collection-tabs-CDbg0gxV.js} +1 -1
  111. package/dist/client/assets/{combobox-DaZGX68U.js → combobox-DrG06POx.js} +1 -1
  112. package/dist/client/assets/{command-DBTJz5xT.js → command-DbXMp-zX.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-BgVGYduQ.js → companion-mcps-section-DjhCGdN7.js} +1 -1
  114. package/dist/client/assets/{connect-C2kiAMas.js → connect-CS03cs0S.js} +1 -1
  115. package/dist/client/assets/{connect-layout-B1XKesPQ.js → connect-layout-DrxsZ_Kp.js} +1 -1
  116. package/dist/client/assets/{connection-BQDj1IIX.js → connection-Bh_KNjcC.js} +1 -1
  117. package/dist/client/assets/{connection-card-B_7fwBDU.js → connection-card-D4W0euzL.js} +1 -1
  118. package/dist/client/assets/{connection-detail-BET8tkPI.js → connection-detail-DQLpxW1H.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-Dw-dC2Mh.js → connection-form-helpers--Om_HgOd.js} +1 -1
  120. package/dist/client/assets/{connections-DajVIO20.js → connections-CRYBNaFW.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-6sXTaltD.js → create-organization-dialog-BNFSXECP.js} +1 -1
  122. package/dist/client/assets/{decofile-api-DajycMLz.js → decofile-api-DjA_ep2W.js} +1 -1
  123. package/dist/client/assets/{decopilot-BlfgUUGT.js → decopilot-CFOirYff.js} +1 -1
  124. package/dist/client/assets/{dialog-kum5ViQ6.js → dialog-CoPZcZvZ.js} +1 -1
  125. package/dist/client/assets/{discover-CdnCzK0t.js → discover-Dp0lLVuP.js} +1 -1
  126. package/dist/client/assets/{domain-settings-Cp82M0VS.js → domain-settings-Dk6tS1Ge.js} +1 -1
  127. package/dist/client/assets/{download-app-dialog-DkOZub51.js → download-app-dialog-ASxiCVBK.js} +1 -1
  128. package/dist/client/assets/{drawer-48frnv4M.js → drawer-yj-3Wmq7.js} +1 -1
  129. package/dist/client/assets/{editor-CII3_h7L.js → editor-HOIPs2p0.js} +1 -1
  130. package/dist/client/assets/{empty-state-ClB_soQ9.js → empty-state-B-udIfuU.js} +1 -1
  131. package/dist/client/assets/{empty-state-Cqqx2czS.js → empty-state-BLD4BbT5.js} +1 -1
  132. package/dist/client/assets/{extract-connection-data-iZD-iMqD.js → extract-connection-data-BzpEGbr4.js} +1 -1
  133. package/dist/client/assets/{feature-gate-6ADR60zr.js → feature-gate-BakylUBw.js} +1 -1
  134. package/dist/client/assets/{feature-paywall-DlJm-QYo.js → feature-paywall-CXCuIyTC.js} +1 -1
  135. package/dist/client/assets/{file-explorer-BVi3hxRi.js → file-explorer-25MWkjJR.js} +1 -1
  136. package/dist/client/assets/{file-preview-BNa_FqIH.js → file-preview-Bm_PoMVX.js} +1 -1
  137. package/dist/client/assets/{file-share-button-K_cIesJO.js → file-share-button-C6jErFPW.js} +1 -1
  138. package/dist/client/assets/{file-type-icon-9fuGMe23.js → file-type-icon-CbcYnV8z.js} +1 -1
  139. package/dist/client/assets/{folder-icon-DxjYTKMQ.js → folder-icon-CRvZWqsn.js} +1 -1
  140. package/dist/client/assets/{form-09c7do_j.js → form-BDgKH2cq.js} +1 -1
  141. package/dist/client/assets/{gateway-client-DKjtU5zk.js → gateway-client-WQKWr_oj.js} +1 -1
  142. package/dist/client/assets/{general-ChUWdZ51.js → general-C2eNiDBv.js} +1 -1
  143. package/dist/client/assets/{github-icon-D9PaNh_w.js → github-icon-DGq1LUIO.js} +1 -1
  144. package/dist/client/assets/{home-Dwq6GRIZ.js → home-C4n_K9Tw.js} +1 -1
  145. package/dist/client/assets/{hooks-CG4YUOnh.js → hooks-BEvLe8iO.js} +1 -1
  146. package/dist/client/assets/{hooks-0UwJeoRz.js → hooks-D6Fhyr-1.js} +1 -1
  147. package/dist/client/assets/{icon-button-Dxgka1SG.js → icon-button-ByKq6hZV.js} +1 -1
  148. package/dist/client/assets/{index-BzW7m_Q3.js → index--lqKO6Xr.js} +1 -1
  149. package/dist/client/assets/{index-ekfvnFP1.js → index-BU8SPACW.js} +1 -1
  150. package/dist/client/assets/{index-BQlthii9.js → index-BVKEwYqd.js} +1 -1
  151. package/dist/client/assets/{index-DaVnrnUl.js → index-BlyOa4OJ.js} +1 -1
  152. package/dist/client/assets/{index-55En7ztP.js → index-BrgfjVMm.js} +5 -5
  153. package/dist/client/assets/{index-CwAQ_Jyl.js → index-C6QhwzBW.js} +1 -1
  154. package/dist/client/assets/{index-C8QVc4YQ.js → index-CBwF-MmM.js} +1 -1
  155. package/dist/client/assets/{index-Cpb95l7m.js → index-CQlW-Wjq.js} +1 -1
  156. package/dist/client/assets/{index-3QjKRG5m.js → index-DAOhRawo.js} +1 -1
  157. package/dist/client/assets/{index-BEGGXvaS.js → index-DHKUv2tb.js} +1 -1
  158. package/dist/client/assets/{index-CkSi5n2n.js → index-FY1Y-vNV.js} +1 -1
  159. package/dist/client/assets/{index-AKCMPzOF.js → index-bKUiQGmM.js} +1 -1
  160. package/dist/client/assets/{index-DwODaveX.js → index-k01YNVxK.js} +1 -1
  161. package/dist/client/assets/{index-BTCIcCLc.js → index-plsXo8Nf.js} +1 -1
  162. package/dist/client/assets/{index-redirect-BfRleCFQ.js → index-redirect-B-719u6E.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-fVH2Dw3y.js → infiniteQueryObserver-CxlBrBav.js} +1 -1
  164. package/dist/client/assets/{infra-billing-Dc0HtmBi.js → infra-billing-CjRSOrP0.js} +1 -1
  165. package/dist/client/assets/{input-CXnRgD2G.js → input-B7CzAD4A.js} +1 -1
  166. package/dist/client/assets/{input-Bj2zRNKL.js → input-BBx6QcTy.js} +1 -1
  167. package/dist/client/assets/{input-DgRtooZL.js → input-DoDcn4Oa.js} +1 -1
  168. package/dist/client/assets/{integration-icon-CaSnOIi_.js → integration-icon-EpYn4ywU.js} +1 -1
  169. package/dist/client/assets/{label-BepsqMnw.js → label-oKE-JKCp.js} +1 -1
  170. package/dist/client/assets/{last-preview-page-DOgw82fm.js → last-preview-page-Cc4Ym6RB.js} +1 -1
  171. package/dist/client/assets/{layout-DYo6Qlq2.js → layout-CuwYS5iG.js} +1 -1
  172. package/dist/client/assets/{legacy-agents-deep-2pwHmCG2.js → legacy-agents-deep-W4CULte7.js} +1 -1
  173. package/dist/client/assets/{legacy-main-redirect-D4nvpeVi.js → legacy-main-redirect-DvOkkI-9.js} +1 -1
  174. package/dist/client/assets/{library-NDPchOoX.js → library-Du7aP9ab.js} +1 -1
  175. package/dist/client/assets/{login-B3dyclR0.js → login-C6o8E5Gx.js} +1 -1
  176. package/dist/client/assets/{markdown-qaw6jPt8.js → markdown-CMmcIMuG.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-BgUDujTC.js → mcp-app-renderer-CSgBYpWQ.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-D6HBYDLd.js → mcp-oauth-Ck4K80JQ.js} +1 -1
  179. package/dist/client/assets/{members-Cz7UTuaA.js → members-BXYPHyZl.js} +1 -1
  180. package/dist/client/assets/{message-templates-2orH35QR.js → message-templates-CofSWui8.js} +1 -1
  181. package/dist/client/assets/{mini-report-page-B2C8igIJ.js → mini-report-page-DA_m7gUn.js} +1 -1
  182. package/dist/client/assets/{mock-board-C5DMkSqP.js → mock-board-CIhU-pLr.js} +3 -3
  183. package/dist/client/assets/{monaco-editor-v2aLs7Br.js → monaco-editor-COmvGX00.js} +1 -1
  184. package/dist/client/assets/{monitoring-stats-row-B3qZ-HwL.js → monitoring-stats-row-zGcKxoaO.js} +1 -1
  185. package/dist/client/assets/{multi-select-gZtCAbvo.js → multi-select-Cjbu02fk.js} +1 -1
  186. package/dist/client/assets/{mustache-BT1EOW0h.js → mustache-AusOr2G7.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-z4PNptQ8.js → oauth-callback-YbJ6w3tz.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-Cr6puX-Q.js → oauth-callback-ai-provider-Bh5e0eL5.js} +1 -1
  189. package/dist/client/assets/{onboarding-HOit4zEm.js → onboarding-DeIWJUIk.js} +1 -1
  190. package/dist/client/assets/{optimistic-project-sidebar-views-DqMQv58w.js → optimistic-project-sidebar-views-CSpV1PYs.js} +1 -1
  191. package/dist/client/assets/{org-file-open-context-KDqfp9le.js → org-file-open-context-DtguTW2M.js} +1 -1
  192. package/dist/client/assets/{organization-choice-odzJfMK6.js → organization-choice-3GQF-2Bb.js} +1 -1
  193. package/dist/client/assets/{orgs-CIDSoW6d.js → orgs-C_tHFmcZ.js} +1 -1
  194. package/dist/client/assets/{page-seo-form-DHROvvdF.js → page-seo-form-C3J0sk3-.js} +1 -1
  195. package/dist/client/assets/{pair-CZkvDIZx.js → pair-B_E-hb3r.js} +1 -1
  196. package/dist/client/assets/{plan-ladder-j_b5lpk5.js → plan-ladder-Bszl-ys6.js} +1 -1
  197. package/dist/client/assets/{popover-pc7q2SI0.js → popover-Cwq-F3vl.js} +1 -1
  198. package/dist/client/assets/{post-calendar-BJSAtZmf.js → post-calendar-DQYHE3Nh.js} +1 -1
  199. package/dist/client/assets/{post-editor-CNsN05tS.js → post-editor-DnkSlyHR.js} +1 -1
  200. package/dist/client/assets/{preview-content-C3fgMWjf.js → preview-content-BoYJe_7h.js} +1 -1
  201. package/dist/client/assets/{preview-dialog-B6BYSj3U.js → preview-dialog-z6N6ouNl.js} +1 -1
  202. package/dist/client/assets/{primitives-DZxO5Qxs.js → primitives-t91zENNC.js} +1 -1
  203. package/dist/client/assets/{profile-_NJFJY29.js → profile-eImNDdTy.js} +1 -1
  204. package/dist/client/assets/{project-app-view-DQbgmbUs.js → project-app-view-BYJkyb_c.js} +1 -1
  205. package/dist/client/assets/{project-feed-DEP9hHr5.js → project-feed-B-I0fPIu.js} +1 -1
  206. package/dist/client/assets/{project-icon-DubTvgka.js → project-icon-C2OHTgfV.js} +1 -1
  207. package/dist/client/assets/project-reports-Dy4BB8vp.js +1 -0
  208. package/dist/client/assets/project-tasks-B-UjiYHE.js +1 -0
  209. package/dist/client/assets/{prompts-BePqJf1K.js → prompts-CWvC6THk.js} +1 -1
  210. package/dist/client/assets/record-editor-Cs7FEG1a.js +1 -0
  211. package/dist/client/assets/redirect-editor-BF7iTO_7.js +1 -0
  212. package/dist/client/assets/reports-D-OGcMpS.js +1 -0
  213. package/dist/client/assets/{reports-Ck-7VKvR.js → reports-OiTIgU_P.js} +1 -1
  214. package/dist/client/assets/{reports-onboarding-BVMnkqvF.js → reports-onboarding-DvV1L9mk.js} +1 -1
  215. package/dist/client/assets/{reports-tab-ByVgNc4C.js → reports-tab-VlkWO_eI.js} +2 -2
  216. package/dist/client/assets/{repositories-D__oH-ow.js → repositories-Ds-D0ZV_.js} +1 -1
  217. package/dist/client/assets/{repository-import-picker-C8WVxDC5.js → repository-import-picker-Bb-cM2jZ.js} +1 -1
  218. package/dist/client/assets/{repository-picker-Y34qL3TL.js → repository-picker-Bnx8U6PV.js} +1 -1
  219. package/dist/client/assets/{require-capability-B5oQvqNV.js → require-capability-DW8CuaB_.js} +1 -1
  220. package/dist/client/assets/{required-auth-layout-DnKdwzJB.js → required-auth-layout-BskWaDcO.js} +1 -1
  221. package/dist/client/assets/{reset-password-DENZExd1.js → reset-password-CfSOYcZN.js} +1 -1
  222. package/dist/client/assets/{resizable-CkTcbT7d.js → resizable-u5ZPWzxP.js} +1 -1
  223. package/dist/client/assets/{review-settings-C9sa13P0.js → review-settings-B1Xgo_eg.js} +1 -1
  224. package/dist/client/assets/{rich-text-link-control-BeQAyGLm.js → rich-text-link-control-CDOF3pGO.js} +1 -1
  225. package/dist/client/assets/{roles-Duw5_ecT.js → roles-BNtiAGZJ.js} +1 -1
  226. package/dist/client/assets/{route-lutBopBm.js → route-BwMVq_-V.js} +1 -1
  227. package/dist/client/assets/{route-DkNnjECu.js → route-DF9rTtAl.js} +1 -1
  228. package/dist/client/assets/{route-page-header-B6MAx63Q.js → route-page-header-BUANMI6P.js} +1 -1
  229. package/dist/client/assets/{route-B8JZ5d0m.js → route-yVxRc46E.js} +1 -1
  230. package/dist/client/assets/{runnable-block-editor-Dx2trdx_.js → runnable-block-editor-BnvgMObN.js} +4 -4
  231. package/dist/client/assets/{sandbox-lifecycle-context-UujXRAe9.js → sandbox-lifecycle-context-DjYBSKDf.js} +1 -1
  232. package/dist/client/assets/{schema-Di8O1fzp.js → schema--qI-6j1O.js} +1 -1
  233. package/dist/client/assets/{scroll-area-UewHMYBQ.js → scroll-area-DuY7fxFW.js} +1 -1
  234. package/dist/client/assets/{search-input-M4nbN9Zq.js → search-input-CBCVX3eV.js} +1 -1
  235. package/dist/client/assets/{search-toggle-n2DhDitt.js → search-toggle-Cw4tE4HV.js} +1 -1
  236. package/dist/client/assets/{secret-picker-Cq0CTh5L.js → secret-picker-CUPNAGhK.js} +1 -1
  237. package/dist/client/assets/{secrets-DjT_tWBd.js → secrets-Bf7-cFVq.js} +1 -1
  238. package/dist/client/assets/{sections-editor-BXoS4qpd.js → sections-editor-Dqex_kiD.js} +1 -1
  239. package/dist/client/assets/{select-CfMWBPIY.js → select-BAj8GDmF.js} +1 -1
  240. package/dist/client/assets/{select-model-CSrQiEM7.js → select-model-BKT2mXow.js} +1 -1
  241. package/dist/client/assets/{seo-editor-Cyyy8cxJ.js → seo-editor--WzhnEwD.js} +1 -1
  242. package/dist/client/assets/{separator-Cwe0WWDx.js → separator-DVzSnA7b.js} +1 -1
  243. package/dist/client/assets/{settings-tab-7IoSTW3Q.js → settings-tab-RuDovaRa.js} +1 -1
  244. package/dist/client/assets/{sheet-DbGZdyBF.js → sheet-SUCO-1Zs.js} +1 -1
  245. package/dist/client/assets/{shell-layout-BaG46qK7.js → shell-layout-DQ3b0lWe.js} +1 -1
  246. package/dist/client/assets/{sidebar-D4j5YraK.js → sidebar-DVrzkoEH.js} +1 -1
  247. package/dist/client/assets/{skill-preview-o_wxsmRr.js → skill-preview-CFM4rZU7.js} +1 -1
  248. package/dist/client/assets/{skills-Cv2g9fxx.js → skills-Cm46QsJv.js} +1 -1
  249. package/dist/client/assets/{sso-DOLQj3tc.js → sso-8oyCIxbf.js} +1 -1
  250. package/dist/client/assets/{switch-Cl6BoZlN.js → switch-D2AGp3q0.js} +1 -1
  251. package/dist/client/assets/{synced-repos-CmKn7pi4.js → synced-repos-CD_WTV4s.js} +1 -1
  252. package/dist/client/assets/{table-D9BGz2ED.js → table-WeehGDhl.js} +1 -1
  253. package/dist/client/assets/{tabs-wqWmr8FS.js → tabs-5x2EsLv4.js} +1 -1
  254. package/dist/client/assets/{task-board-BMNympDy.js → task-board-C50ImE2y.js} +1 -1
  255. package/dist/client/assets/{task-route-DEUopKQn.js → task-route-CkyJIDOx.js} +1 -1
  256. package/dist/client/assets/{task-status-CZomK1I7.js → task-status-UHslF33v.js} +1 -1
  257. package/dist/client/assets/{taskboard-analytics-Cc5fJo76.js → taskboard-analytics-DSSLMdFb.js} +1 -1
  258. package/dist/client/assets/{tasks-CyeL5eYk.js → tasks-DHYecYax.js} +1 -1
  259. package/dist/client/assets/tasks-DjWeZ1IA.js +1 -0
  260. package/dist/client/assets/{textarea-loJj3FNw.js → textarea-BnU6QmoE.js} +1 -1
  261. package/dist/client/assets/{thread-button-D9hEh4sJ.js → thread-button-B3xx0VtU.js} +1 -1
  262. package/dist/client/assets/{thread-intent-CkzD5zg6.js → thread-intent-C6XSh_D3.js} +1 -1
  263. package/dist/client/assets/{thread-route-BYtQhHIh.js → thread-route-BmzRXaVx.js} +1 -1
  264. package/dist/client/assets/{thread-route-CYWfWYe4.js → thread-route-CJrLA-ee.js} +1 -1
  265. package/dist/client/assets/{thread-sheet-body-DCqWZI77.js → thread-sheet-body-D0E1gQpO.js} +1 -1
  266. package/dist/client/assets/{toggle-group-BlcpLDIu.js → toggle-group-JO1JgH5a.js} +1 -1
  267. package/dist/client/assets/{toolbar-icon-button-BIut-xjk.js → toolbar-icon-button-DXNOeW_z.js} +1 -1
  268. package/dist/client/assets/{tooltip-DMVFyQ4S.js → tooltip-WzWLbyZq.js} +1 -1
  269. package/dist/client/assets/{track-D6dTuuTR.js → track-D7IKOGBR.js} +1 -1
  270. package/dist/client/assets/{types-CDh5aMDK.js → types-RaQT_IEX.js} +1 -1
  271. package/dist/client/assets/{usage-stats-iZJwd_tX.js → usage-stats-BaxngK_D.js} +1 -1
  272. package/dist/client/assets/{use-ai-providers-Cv_1DCZ7.js → use-ai-providers-Dq0Ep_3l.js} +1 -1
  273. package/dist/client/assets/{use-automations-BcyiJnyn.js → use-automations-COX0fcgz.js} +1 -1
  274. package/dist/client/assets/{use-autosave-BRI-zN8N.js → use-autosave-BERNHhO9.js} +1 -1
  275. package/dist/client/assets/{use-connect-companion-CBFf90_T.js → use-connect-companion-D_BJZumX.js} +1 -1
  276. package/dist/client/assets/{use-connection-Cu39vpqH.js → use-connection-B11x8Y5V.js} +1 -1
  277. package/dist/client/assets/{use-copy-BEeiF0AV.js → use-copy-DwTK-qVh.js} +1 -1
  278. package/dist/client/assets/{use-create-virtual-mcp-DgYCB3bn.js → use-create-virtual-mcp-BRTcRrPf.js} +1 -1
  279. package/dist/client/assets/{use-date-fns-locale-DaYGwzEJ.js → use-date-fns-locale-nt6p03GG.js} +1 -1
  280. package/dist/client/assets/{use-debounced-autosave-Dw8B_54l.js → use-debounced-autosave-BpSPbeao.js} +1 -1
  281. package/dist/client/assets/{use-debounced-value-D6zpu8Hv.js → use-debounced-value-CjsHq8Vl.js} +1 -1
  282. package/dist/client/assets/{use-deco-credits-oTQTNk97.js → use-deco-credits-DXfzxvoO.js} +1 -1
  283. package/dist/client/assets/{use-decopilot-events-CdxW1w8H.js → use-decopilot-events-64DqQFG6.js} +1 -1
  284. package/dist/client/assets/{use-delete-connection-DeSRt0JP.js → use-delete-connection-8S4pYk4a.js} +1 -1
  285. package/dist/client/assets/{use-deployment-admin-CNnh-Kkd.js → use-deployment-admin-CCJWqCfM.js} +1 -1
  286. package/dist/client/assets/{use-entitlements-z6xQqbdd.js → use-entitlements-g7KOEkrp.js} +1 -1
  287. package/dist/client/assets/{use-fast-preview-draft-url-1t1weqx-.js → use-fast-preview-draft-url-DCCeUHpe.js} +1 -1
  288. package/dist/client/assets/{use-file-configs-69h6r6L4.js → use-file-configs-BD0IRTDw.js} +1 -1
  289. package/dist/client/assets/{use-in-settings-BSMhLH6O.js → use-in-settings-GUedr1XF.js} +1 -1
  290. package/dist/client/assets/{use-infinite-scroll-RAuxlSZ2.js → use-infinite-scroll-vxoiRb7T.js} +1 -1
  291. package/dist/client/assets/{use-join-requests-D6i8ToOA.js → use-join-requests-BuoeDzuz.js} +1 -1
  292. package/dist/client/assets/{use-main-panel-tabs-B6vDMnVR.js → use-main-panel-tabs-BQ8rOQGV.js} +1 -1
  293. package/dist/client/assets/{use-mcp-auth-status-BhesqFqQ.js → use-mcp-auth-status-8HzRdmmW.js} +1 -1
  294. package/dist/client/assets/{use-mcp-client-Cms886Jn.js → use-mcp-client-Db5zI8Z3.js} +1 -1
  295. package/dist/client/assets/{use-mcp-prompts-BBWdCqCu.js → use-mcp-prompts-CqP9Y1Vz.js} +1 -1
  296. package/dist/client/assets/{use-mcp-tools-CjaqPJIF.js → use-mcp-tools-BdsJuvQS.js} +1 -1
  297. package/dist/client/assets/{use-members-th9IwsK9.js → use-members-xI_s8ZPd.js} +1 -1
  298. package/dist/client/assets/{use-mobile-Dn9gA5u7.js → use-mobile-COTn4qeO.js} +1 -1
  299. package/dist/client/assets/{use-navigate-to-agent-DuSknbWt.js → use-navigate-to-agent-Hc1nbYTr.js} +1 -1
  300. package/dist/client/assets/{use-open-billing-url-DxXFNXWq.js → use-open-billing-url-BkxX6uwx.js} +1 -1
  301. package/dist/client/assets/{use-org-auth-client-djm1iguw.js → use-org-auth-client-BiZspqgA.js} +1 -1
  302. package/dist/client/assets/{use-org-fs-lSldslaf.js → use-org-fs-Di8X4LFM.js} +1 -1
  303. package/dist/client/assets/{use-org-repo-syncs-CEGNAE63.js → use-org-repo-syncs-RBKt533u.js} +1 -1
  304. package/dist/client/assets/{use-org-sso-CjKBHTz5.js → use-org-sso-BotkztEO.js} +1 -1
  305. package/dist/client/assets/{use-organization-roles-B0boiYIQ.js → use-organization-roles-CTBz_OMd.js} +1 -1
  306. package/dist/client/assets/{use-organization-settings-l5kLl_Rb.js → use-organization-settings-DeroNipc.js} +1 -1
  307. package/dist/client/assets/{use-panel-navigate-DnMcaOE4.js → use-panel-navigate-CHXWRsa2.js} +1 -1
  308. package/dist/client/assets/{use-project-native-view-presence-DdJNWqKh.js → use-project-native-view-presence-B42AMjjw.js} +1 -1
  309. package/dist/client/assets/{use-project-scope-anVSXtPA.js → use-project-scope-Cboqds94.js} +1 -1
  310. package/dist/client/assets/{use-releases-DqroGUSq.js → use-releases-yOjVhqYk.js} +1 -1
  311. package/dist/client/assets/{use-reports-diagnostic-Weuz2RQY.js → use-reports-diagnostic-ChAtElJm.js} +1 -1
  312. package/dist/client/assets/{use-route-default-main-ecqvw_nG.js → use-route-default-main-kOms9vXt.js} +1 -1
  313. package/dist/client/assets/{use-secrets-CO2Ng5ro.js → use-secrets-C5liL9o_.js} +1 -1
  314. package/dist/client/assets/use-section-preview-base-BA6oFsyg.js +1 -0
  315. package/dist/client/assets/{use-session-runtime-DCV4jSue.js → use-session-runtime-DCYLvb6V.js} +1 -1
  316. package/dist/client/assets/{use-tags-OS8YpN_d.js → use-tags-CgoYqsxT.js} +1 -1
  317. package/dist/client/assets/{use-task-board-analytics-x4yi31c7.js → use-task-board-analytics-D9300BWY.js} +1 -1
  318. package/dist/client/assets/{use-task-metadata-uvO1hPiJ.js → use-task-metadata-BYwpD1kd.js} +1 -1
  319. package/dist/client/assets/{use-thread-outputs-BrSxP-rL.js → use-thread-outputs-BpKQ7Zo1.js} +1 -1
  320. package/dist/client/assets/{use-virtual-mcp-JkVFc3Nc.js → use-virtual-mcp-Dtuvom2e.js} +1 -1
  321. package/dist/client/assets/useInfiniteQuery-D679Q3IA.js +1 -0
  322. package/dist/client/assets/{useQueries-D_O3UpnN.js → useQueries-BnlFxjw5.js} +1 -1
  323. package/dist/client/assets/useSuspenseInfiniteQuery-zdGPgEpV.js +1 -0
  324. package/dist/client/assets/{users-CkxFGFKM.js → users-Du6MU5ru.js} +1 -1
  325. package/dist/client/assets/{utils-zN7F5jln.js → utils-DsrrQ-SY.js} +1 -1
  326. package/dist/client/assets/{variant-calendar-CrJC2OUE.js → variant-calendar-DAhQEdUF.js} +1 -1
  327. package/dist/client/assets/{variant-matcher-override-CfKcmjaW.js → variant-matcher-override-DA3Efdln.js} +1 -1
  328. package/dist/client/assets/{view-mode-toggle-ByVPlcgG.js → view-mode-toggle-1hCOtltg.js} +1 -1
  329. package/dist/client/assets/{virtual-mcp-BQxhkmTI.js → virtual-mcp-BTvprhOr.js} +1 -1
  330. package/dist/client/index.html +1 -1
  331. package/dist/server/cli.js +1 -1
  332. package/dist/server/server.js +1 -1
  333. package/package.json +1 -1
  334. package/dist/client/assets/agent-app-BXB3XN3v.js +0 -1
  335. package/dist/client/assets/agent-deck-CzLJRubt.js +0 -1
  336. package/dist/client/assets/agent-file-VZhv6TvC.js +0 -1
  337. package/dist/client/assets/agent-library-file-D5Og66K3.js +0 -1
  338. package/dist/client/assets/agent-settings-DwVrYhYt.js +0 -1
  339. package/dist/client/assets/agent-site-editor-code-BgSRUkKU.js +0 -2
  340. package/dist/client/assets/agent-site-editor-preview-Bq8zCN6_.js +0 -518
  341. package/dist/client/assets/agent-site-editor-xOue0iMF.js +0 -24
  342. package/dist/client/assets/agent-view-DAVUldzg.js +0 -1
  343. package/dist/client/assets/api-keys-BdE9rbFS.js +0 -1
  344. package/dist/client/assets/app-editor-BZ3EuDKB.js +0 -1
  345. package/dist/client/assets/claim-phase-copy-njXeDF0h.js +0 -1
  346. package/dist/client/assets/project-reports-CDxQFME9.js +0 -1
  347. package/dist/client/assets/project-tasks-BAb79xXs.js +0 -1
  348. package/dist/client/assets/record-editor-XjmYcMaR.js +0 -1
  349. package/dist/client/assets/redirect-editor-ByXGFOJi.js +0 -1
  350. package/dist/client/assets/reports-CuuyZeE7.js +0 -1
  351. package/dist/client/assets/tasks-DVlOtz5d.js +0 -1
  352. package/dist/client/assets/use-section-preview-base-BTzlqbB_.js +0 -1
  353. package/dist/client/assets/useInfiniteQuery-CwWQ4nTA.js +0 -1
  354. package/dist/client/assets/useSuspenseInfiniteQuery-C8z5Z2Bp.js +0 -1
@@ -1,518 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-BXoS4qpd.js","assets/index-55En7ztP.js","assets/index-B88q0man.css","assets/chat-context-D_-xGMp5.js","assets/use-panel-navigate-DnMcaOE4.js","assets/thread-route-BYtQhHIh.js","assets/use-project-scope-anVSXtPA.js","assets/use-virtual-mcp-JkVFc3Nc.js","assets/use-mcp-client-Cms886Jn.js","assets/auth-wbn4hkw_.js","assets/github-repo-BknN0SVI.js","assets/autosend-YcrMa2dL.js","assets/thread-intent-CkzD5zg6.js","assets/slugify-CEUa2lfQ.js","assets/hooks-0UwJeoRz.js","assets/backoff-8mStPHYB.js","assets/task-board-BMNympDy.js","assets/schema-Di8O1fzp.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-entitlements-z6xQqbdd.js","assets/use-ai-providers-Cv_1DCZ7.js","assets/location-oTTXFrSF.js","assets/use-decopilot-events-CdxW1w8H.js","assets/use-organization-settings-l5kLl_Rb.js","assets/runnable-block-editor-Dx2trdx_.js","assets/use-session-runtime-DCV4jSue.js","assets/decofile-api-DajycMLz.js","assets/utils-zN7F5jln.js","assets/ZoomOut-CEOwwH34.js","assets/Image01-CwALg1a4.js","assets/sandbox-url-D3mC8qhT.js","assets/claim-phase-copy-njXeDF0h.js","assets/agent-icon-lfrVH-OK.js","assets/AlertCircle-CZgJU8hk.js","assets/Tool01-4DAbUoNs.js","assets/ArrowUp-BwaH-bh6.js","assets/ArrowLeft-DhxCKHos.js","assets/ArrowRight-_xtmiHEF.js","assets/XCircle-D-Aq9OMT.js","assets/Globe04-D2iVj_TG.js","assets/CheckCircle-D2P1mu3F.js","assets/Check-CtmIaXgC.js","assets/ChevronUp-CyyD7MJn.js","assets/UserSquare-CG9zonIL.js","assets/Copy01-B3IMMOKh.js","assets/CreditCard01-md1P0gzk.js","assets/DotsVertical-CCR-YCOc.js","assets/Download01-DvdgweoY.js","assets/Eye-tQWA9lCZ.js","assets/Share07-Dx4iZESB.js","assets/XClose-ZnbMEO-2.js","assets/Key01-CGZM8V37.js","assets/LayoutLeft--CSq68Va.js","assets/Link01-CpHtaXY6.js","assets/LinkExternal01-JGVFU9rY.js","assets/Monitor01-B4CSzOr6.js","assets/Sun-Bq352qjl.js","assets/Package-B-4JMCkY.js","assets/Palette-B4w2mE4d.js","assets/Plus-DOI9wakW.js","assets/SearchLg-0fHGMTGh.js","assets/SearchMd-BoetaL4Y.js","assets/Stars01-Dm3CFp2u.js","assets/Trash01-BiPmRbe2.js","assets/Upload01-DL0grgTa.js","assets/User01-jL_Upcq0.js","assets/Users01-BZ_Cu-tk.js","assets/X-BXzWjoaJ.js","assets/Zap-D8xM5bbr.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-CZkvDIZx.js","assets/format-time-BtXRrtv4.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-B4ohHlAo.js","assets/use-copy-BEeiF0AV.js","assets/usage-stats-iZJwd_tX.js","assets/markdown-qaw6jPt8.js","assets/dialog-kum5ViQ6.js","assets/org-file-open-context-KDqfp9le.js","assets/use-mobile-Dn9gA5u7.js","assets/tooltip-DMVFyQ4S.js","assets/index-C8QVc4YQ.js","assets/shell-layout-BaG46qK7.js","assets/avatar-BGUOlD6Z.js","assets/download-app-dialog-DkOZub51.js","assets/command-DBTJz5xT.js","assets/index-BQlthii9.js","assets/integration-icon-CaSnOIi_.js","assets/project-icon-DubTvgka.js","assets/required-auth-layout-DnKdwzJB.js","assets/use-org-sso-CjKBHTz5.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-BgUDujTC.js","assets/types-CDh5aMDK.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-DKjtU5zk.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/sheet-DbGZdyBF.js","assets/use-connection-Cu39vpqH.js","assets/use-navigate-to-agent-DuSknbWt.js","assets/use-mcp-prompts-BBWdCqCu.js","assets/index-ekfvnFP1.js","assets/form-09c7do_j.js","assets/label-BepsqMnw.js","assets/input-CXnRgD2G.js","assets/use-thread-outputs-BrSxP-rL.js","assets/file-type-icon-9fuGMe23.js","assets/popover-pc7q2SI0.js","assets/scroll-area-UewHMYBQ.js","assets/select-CfMWBPIY.js","assets/monaco-editor-v2aLs7Br.js","assets/editor-CII3_h7L.js","assets/calendar-DObs1MgB.js","assets/textarea-loJj3FNw.js","assets/rich-text-link-control-BeQAyGLm.js","assets/switch-Cl6BoZlN.js","assets/combobox-DaZGX68U.js","assets/alert-dialog-C09wZ9of.js","assets/search-input-M4nbN9Zq.js","assets/tabs-wqWmr8FS.js","assets/use-debounced-value-D6zpu8Hv.js","assets/use-file-configs-69h6r6L4.js","assets/asset-utils-C6cJmK0c.js","assets/useInfiniteQuery-CwWQ4nTA.js","assets/infiniteQueryObserver-fVH2Dw3y.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/toggle-group-BlcpLDIu.js","assets/sandbox-git-api-B1R0585s.js","assets/mustache-BT1EOW0h.js","assets/page-seo-form-DHROvvdF.js","assets/use-section-preview-base-BTzlqbB_.js","assets/section-preview-url-Csj0_ZDg.js","assets/variant-matcher-override-CfKcmjaW.js"])))=>i.map(i=>d[i]);
2
- import{r as x,ap as Mt,aH as rt,aq as Ee,c as ue,b as Le,j as n,K as lr,e as cr,h as zt,B as Xe,aI as dr,a0 as hn,aJ as ur,Z as fs,l as Ke,aG as mr,P as Xt,q as pr,t as Wn}from"./index-55En7ztP.js";import{A as fr}from"./agent-view-guard-BKjvc_rQ.js";import{F as hr}from"./feature-gate-6ADR60zr.js";import{a as gr,b as It}from"./chat-context-D_-xGMp5.js";import{t as Vn}from"./ChevronUp-CyyD7MJn.js";import{v as hs,D as vr,E as xr,F as en,G as qn,H as Gn,I as Jn,z as Yn,J as tn,x as br}from"./agent-icon-lfrVH-OK.js";import{i as nn}from"./Share07-Dx4iZESB.js";import{n as un}from"./LinkExternal01-JGVFU9rY.js";import{s as Qn}from"./Plus-DOI9wakW.js";import{i as yr}from"./SearchLg-0fHGMTGh.js";import{P as wr,a as kr,b as Pr}from"./popover-pc7q2SI0.js";import{a as gt,b as vt,c as gs,d as vs,e as xs,C as bs}from"./command-DBTJz5xT.js";import{d as Sr,a as jr}from"./use-virtual-mcp-JkVFc3Nc.js";import{c as ys,d as gn,f as Er}from"./sandbox-lifecycle-context-UujXRAe9.js";import{e as Nr,d as Cr}from"./backoff-8mStPHYB.js";import{a as Rr}from"./thread-intent-CkzD5zg6.js";import{u as ws}from"./use-session-runtime-DCV4jSue.js";import{u as Tr}from"./use-mobile-Dn9gA5u7.js";import{c as Je,T as Ye,a as Qe}from"./tooltip-DMVFyQ4S.js";import{T as $e}from"./toolbar-icon-button-BIut-xjk.js";import{b as Lr,a as Or,u as ks,g as _r,c as Ar,B as sn,P as Dr,r as $r,R as Fr,d as Br,e as vn,f as Ps,h as Mr,i as zr,j as Ir,l as Kr,m as Hr,k as Ur,p as Wr,n as Vr,S as rn}from"./runnable-block-editor-Dx2trdx_.js";import{w as Dt}from"./variant-matcher-override-CfKcmjaW.js";import{N as qr,b as Gr,s as at,n as xn,c as Ss,f as He,v as js,h as Jr,e as Yr,d as Qr,j as Zr,k as Zn}from"./claim-phase-copy-njXeDF0h.js";import{r as Xr,w as ea,D as ta,b as Xn,a as na}from"./section-preview-url-Csj0_ZDg.js";import{u as sa}from"./use-fast-preview-draft-url-1t1weqx-.js";import{r as Es,l as Ns,u as ra,w as aa}from"./last-preview-page-DOgw82fm.js";import{u as ia}from"./use-is-desktop-app-BNujXJc_.js";import{a as oa,d as Cs}from"./shell-layout-BaG46qK7.js";import{u as mn}from"./useQueries-D_O3UpnN.js";import{i as la}from"./ArrowRight-_xtmiHEF.js";import{b as Rs,D as Ts,c as Ls,d as Os,e as ca}from"./dialog-kum5ViQ6.js";import{I as es}from"./input-CXnRgD2G.js";import{u as _s}from"./blocks-preview-workspace-context-PuE-5QVF.js";import{i as da}from"./AlertCircle-CZgJU8hk.js";import{E as bn}from"./empty-state-ClB_soQ9.js";import{i as ua}from"./X-BXzWjoaJ.js";import{M as ma}from"./monaco-editor-v2aLs7Br.js";import{a as pa}from"./utils-zN7F5jln.js";import{R as ts,a as mt,b as an}from"./resizable-CkTcbT7d.js";import{r as fa}from"./virtual-mcp-BQxhkmTI.js";import{b as on}from"./use-project-scope-anVSXtPA.js";import{G as ns}from"./github-icon-D9PaNh_w.js";import{R as ha}from"./repository-import-picker-C8WVxDC5.js";import{r as ga}from"./use-main-panel-tabs-B6vDMnVR.js";import{u as va}from"./use-task-metadata-uvO1hPiJ.js";import{b as xa}from"./thread-route-BYtQhHIh.js";import"./use-panel-navigate-DnMcaOE4.js";import"./feature-paywall-DlJm-QYo.js";import"./Check-CtmIaXgC.js";import"./plan-ladder-j_b5lpk5.js";import"./use-entitlements-z6xQqbdd.js";import"./autosend-YcrMa2dL.js";import"./hooks-0UwJeoRz.js";import"./use-mcp-client-Cms886Jn.js";import"./auth-wbn4hkw_.js";import"./task-board-BMNympDy.js";import"./schema-Di8O1fzp.js";import"./use-ai-providers-Cv_1DCZ7.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-CdxW1w8H.js";import"./use-organization-settings-l5kLl_Rb.js";import"./Tool01-4DAbUoNs.js";import"./ArrowUp-BwaH-bh6.js";import"./ArrowLeft-DhxCKHos.js";import"./XCircle-D-Aq9OMT.js";import"./ZoomOut-CEOwwH34.js";import"./Globe04-D2iVj_TG.js";import"./CheckCircle-D2P1mu3F.js";import"./UserSquare-CG9zonIL.js";import"./Copy01-B3IMMOKh.js";import"./CreditCard01-md1P0gzk.js";import"./DotsVertical-CCR-YCOc.js";import"./Download01-DvdgweoY.js";import"./Eye-tQWA9lCZ.js";import"./XClose-ZnbMEO-2.js";import"./Image01-CwALg1a4.js";import"./Key01-CGZM8V37.js";import"./LayoutLeft--CSq68Va.js";import"./Link01-CpHtaXY6.js";import"./Monitor01-B4CSzOr6.js";import"./Sun-Bq352qjl.js";import"./Package-B-4JMCkY.js";import"./Palette-B4w2mE4d.js";import"./SearchMd-BoetaL4Y.js";import"./Stars01-Dm3CFp2u.js";import"./Trash01-BiPmRbe2.js";import"./Upload01-DL0grgTa.js";import"./User01-jL_Upcq0.js";import"./Users01-BZ_Cu-tk.js";import"./Zap-D8xM5bbr.js";import"./index-BQlthii9.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./slugify-CEUa2lfQ.js";import"./index-C8QVc4YQ.js";import"./decofile-api-DajycMLz.js";import"./pair-CZkvDIZx.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-B4ohHlAo.js";import"./use-copy-BEeiF0AV.js";import"./usage-stats-iZJwd_tX.js";import"./markdown-qaw6jPt8.js";import"./org-file-open-context-KDqfp9le.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BgUDujTC.js";import"./types-CDh5aMDK.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-DKjtU5zk.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./sheet-DbGZdyBF.js";import"./integration-icon-CaSnOIi_.js";import"./use-connection-Cu39vpqH.js";import"./use-navigate-to-agent-DuSknbWt.js";import"./github-repo-BknN0SVI.js";import"./use-mcp-prompts-BBWdCqCu.js";import"./index-ekfvnFP1.js";import"./form-09c7do_j.js";import"./label-BepsqMnw.js";import"./use-thread-outputs-BrSxP-rL.js";import"./file-type-icon-9fuGMe23.js";import"./scroll-area-UewHMYBQ.js";import"./select-CfMWBPIY.js";import"./calendar-DObs1MgB.js";import"./textarea-loJj3FNw.js";import"./rich-text-link-control-BeQAyGLm.js";import"./switch-Cl6BoZlN.js";import"./combobox-DaZGX68U.js";import"./alert-dialog-C09wZ9of.js";import"./search-input-M4nbN9Zq.js";import"./tabs-wqWmr8FS.js";import"./use-debounced-value-D6zpu8Hv.js";import"./use-file-configs-69h6r6L4.js";import"./asset-utils-C6cJmK0c.js";import"./useInfiniteQuery-CwWQ4nTA.js";import"./infiniteQueryObserver-fVH2Dw3y.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-BlcpLDIu.js";import"./sandbox-git-api-B1R0585s.js";import"./avatar-BGUOlD6Z.js";import"./download-app-dialog-DkOZub51.js";import"./project-icon-DubTvgka.js";import"./required-auth-layout-DnKdwzJB.js";import"./use-org-sso-CjKBHTz5.js";import"./editor-CII3_h7L.js";import"./repository-picker-Y34qL3TL.js";import"./collection-search-DORJq6xs.js";import"./use-route-default-main-ecqvw_nG.js";import"./use-mcp-tools-CjaqPJIF.js";import"./index-AKCMPzOF.js";import"./drawer-48frnv4M.js";import"./input-DgRtooZL.js";import"./chat-draft-BhXkcd-9.js";import"./use-deco-credits-oTQTNk97.js";import"./use-open-billing-url-DxXFNXWq.js";import"./decopilot-BlfgUUGT.js";import"./checkbox-CmtLPtxw.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-BTCIcCLc.js";import"./input-Bj2zRNKL.js";import"./hooks-CG4YUOnh.js";import"./use-org-fs-lSldslaf.js";import"./question-004-sINsf4GQ.js";import"./use-members-th9IwsK9.js";import"./use-org-auth-client-djm1iguw.js";import"./add-connection-dialog-B_OoIhEU.js";import"./extract-connection-data-iZD-iMqD.js";import"./metadata-D72DunRR.js";import"./connection-BQDj1IIX.js";import"./connection-card-B_7fwBDU.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-Dw-dC2Mh.js";import"./authenticate-and-persist-oauth-B3tNLMug.js";import"./mcp-oauth-D6HBYDLd.js";import"./collection-tabs-B28RcavJ.js";import"./badge-B0klsi-0.js";import"./use-infinite-scroll-RAuxlSZ2.js";import"./useSuspenseInfiniteQuery-C8z5Z2Bp.js";import"./use-project-native-view-presence-DdJNWqKh.js";import"./site-slug-uya6Wp4-.js";const ba={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function ya(t){const{previewState:e,progressStatus:r,fastPreviewActive:s=!1,fastPreviewReady:i=!1,codingSession:u=!1}=t,c=u?null:t.previewServerUrl;return e.kind==="suspended"||e.kind==="errored"?ba:s&&i&&c?{mode:"production",iframeBase:c,showBlockingOverlay:!1,showWakingPill:!1}:!s&&e.kind==="iframe"&&r!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:c?{mode:"production",iframeBase:c,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const wa=1e4,ka=1e3,Pa=3e4;function Sa({iframeRef:t,src:e,active:r}){const s=x.useRef(0),i=x.useRef(null),u=x.useRef(null),c=x.useRef(e),d=x.useRef(r);c.current=e,d.current=r;const o=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},l=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,h()},wa)},h=()=>{if(!d.current||!c.current)return;u.current&&clearTimeout(u.current);const P=Nr(Pa,ka,s.current,2,.5);s.current+=1,u.current=setTimeout(()=>{u.current=null;const g=t.current,k=c.current;!g||!k||!d.current||(g.src=k,l())},P)},p=()=>{s.current=0,o()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),h()};return x.useEffect(()=>{if(o(),s.current=0,!(!r||!e))return l(),o},[e,r]),{handleLoad:p,handleError:f}}var ss;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WINDOW_SUSPENDED="tauri://suspended",t.WINDOW_RESUMED="tauri://resumed",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(ss||(ss={}));const ja=Mt({tag:Ee(),id:Ee(),classes:Ee(),text:Ee(),html:Ee(),manifestKey:Ee().nullable(),componentName:Ee().nullable(),parents:Ee(),url:Ee(),path:Ee(),viewport:Mt({width:rt(),height:rt()}),position:Mt({x:rt(),y:rt()})}),Ea=`(function() {
3
- if (window.__visualEditorActive) return;
4
- window.__visualEditorActive = true;
5
-
6
- var cursorStyle = document.createElement("style");
7
- cursorStyle.textContent = "* { cursor: default !important; }";
8
- document.head.appendChild(cursorStyle);
9
-
10
- var highlight = document.createElement("div");
11
- highlight.style.cssText = "position:fixed;pointer-events:none;outline:2px solid #a855f7;background:rgba(168,85,247,0.08);border-radius:2px;z-index:2147483647;display:none;";
12
- document.body.appendChild(highlight);
13
-
14
- var badge = document.createElement("div");
15
- badge.style.cssText = "position:fixed;pointer-events:none;background:#a855f7;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
16
- document.body.appendChild(badge);
17
-
18
- var lastTarget = null;
19
- var rafPending = false;
20
- var moveHandler = function(e) {
21
- if (rafPending) return;
22
- rafPending = true;
23
- var target = e.target;
24
- requestAnimationFrame(function() {
25
- rafPending = false;
26
- var el = target;
27
- if (!el || el === highlight || el === badge) return;
28
- if (el === lastTarget) return;
29
- lastTarget = el;
30
- var r = el.getBoundingClientRect();
31
- highlight.style.display = "block";
32
- highlight.style.top = r.top + "px";
33
- highlight.style.left = r.left + "px";
34
- highlight.style.width = r.width + "px";
35
- highlight.style.height = r.height + "px";
36
- var tag = el.tagName.toLowerCase();
37
- var id = el.id ? "#" + el.id : "";
38
- var cls = el.className && typeof el.className === "string"
39
- ? "." + el.className.trim().split(/\\s+/).slice(0, 2).join(".")
40
- : "";
41
- badge.textContent = tag + id + cls;
42
- badge.style.display = "block";
43
- badge.style.top = Math.max(0, r.top - 20) + "px";
44
- badge.style.left = r.left + "px";
45
- });
46
- };
47
- document.addEventListener("mousemove", moveHandler, true);
48
-
49
- var outHandler = function(e) {
50
- if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
51
- highlight.style.display = "none";
52
- badge.style.display = "none";
53
- lastTarget = null;
54
- }
55
- };
56
- document.addEventListener("mouseout", outHandler, true);
57
-
58
- var clickHandler = function(e) {
59
- e.preventDefault();
60
- e.stopImmediatePropagation();
61
- var el = e.target;
62
- if (!el || el === highlight || el === badge) return;
63
-
64
- highlight.style.outline = "2px solid #a855f7";
65
- highlight.style.background = "rgba(168,85,247,0.15)";
66
- setTimeout(function() {
67
- highlight.style.outline = "2px solid #a855f7";
68
- highlight.style.background = "rgba(168,85,247,0.08)";
69
- }, 400);
70
-
71
- var tag = el.tagName.toLowerCase();
72
- var id = el.id || "";
73
- var classes = el.className && typeof el.className === "string" ? el.className.trim() : "";
74
- var text = (el.textContent || "").trim().slice(0, 200);
75
- var html = (el.outerHTML || "").slice(0, 800).replace(/\\svalue=("[^"]*"|'[^']*'|\\S+)/gi, "");
76
-
77
- var closestSection = el.closest("section[data-manifest-key]");
78
- var manifestKey = closestSection ? closestSection.getAttribute("data-manifest-key") : null;
79
-
80
- var ancestor = el;
81
- var componentName = null;
82
- for (var i = 0; i < 10 && ancestor; i++) {
83
- if (ancestor.dataset) componentName = ancestor.dataset.componentName || componentName;
84
- ancestor = ancestor.parentElement;
85
- }
86
-
87
- var parents = [];
88
- var p = el.parentElement;
89
- for (var j = 0; j < 4 && p && p !== document.body; j++) {
90
- var pTag = p.tagName ? p.tagName.toLowerCase() : "";
91
- var pId = p.id ? "#" + p.id : "";
92
- var pCls = p.className && typeof p.className === "string"
93
- ? "." + p.className.trim().split(/\\s+/)[0]
94
- : "";
95
- parents.unshift(pTag + pId + pCls);
96
- p = p.parentElement;
97
- }
98
-
99
- window.parent.postMessage({
100
- type: "visual-editor::element-clicked",
101
- payload: {
102
- tag: tag, id: id, classes: classes, text: text, html: html,
103
- manifestKey: manifestKey, componentName: componentName,
104
- parents: parents.join(" > "),
105
- url: window.location.href, path: window.location.pathname,
106
- viewport: { width: window.innerWidth, height: window.innerHeight },
107
- position: { x: Math.round(e.clientX), y: Math.round(e.clientY) }
108
- }
109
- }, "*");
110
- };
111
- document.addEventListener("click", clickHandler, true);
112
-
113
- window.addEventListener("message", function(e) {
114
- // Only Studio's own postMessage (source === this frame's parent) may drive the bridge — a nested/downstream frame's forged message can't deactivate the editor.
115
- if (e.source !== window.parent) return;
116
- // Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
117
- if (e.data && e.data.type === "visual-editor::clear-hover") {
118
- highlight.style.display = "none";
119
- badge.style.display = "none";
120
- lastTarget = null;
121
- return;
122
- }
123
- if (e.data && e.data.type === "visual-editor::deactivate") {
124
- highlight.remove();
125
- badge.remove();
126
- cursorStyle.remove();
127
- document.removeEventListener("mousemove", moveHandler, true);
128
- document.removeEventListener("mouseout", outHandler, true);
129
- document.removeEventListener("click", clickHandler, true);
130
- window.__visualEditorActive = false;
131
- }
132
- });
133
- })();`;function Na(t,e){const r=t.map(()=>null),s=[];for(let f=0;f<t.length;f++)t[f]!==null&&s.push(f);const i=s.length,u=e.length;if(!i||!u)return r;const c=(f,P)=>{const g=t[s[f]??0];return!g||!g.length?1:g.indexOf(e[P]??"")>=0?2:0},d=[],o=[];for(let f=0;f<=i;f++)d.push(new Array(u+1).fill(0)),o.push(new Array(u+1).fill(2));for(let f=1;f<=i;f++){const P=d[f-1]??[],g=d[f]??[],k=o[f]??[];for(let b=1;b<=u;b++){let v=P[b]??0,C=2;const y=g[b-1]??0;y>v&&(v=y,C=0);const w=c(f-1,b-1),S=(P[b-1]??0)+w;w>0&&S>v&&(v=S,C=1),g[b]=v,k[b]=C}}let l=0,h=i,p=u;for(;h>0&&p>0;){const f=o[h]?.[p]??2;f===1?(r[s[h-1]??0]=p-1,l++,h--,p--):f===0?p--:h--}if(l===0&&u===i)for(let f=0;f<i;f++)r[s[f]??0]=f;return r}const Ca=Mt({sectionIndex:rt(),manifestKey:Ee(),clickSeq:rt()}),rs=`(function() {
134
- if (window.__cmsEditorActive) return;
135
- window.__cmsEditorActive = true;
136
-
137
- // Preserve scroll across variant-override navigations and save-reloads.
138
- // Selecting a variant rebuilds the iframe src (new x-deco-matchers-override)
139
- // or reloads it, which would otherwise jump to the top. We persist the scroll
140
- // offset to sessionStorage (survives reload, same-origin) keyed by pathname
141
- // (the override only changes the query, so the key is stable), then restore it
142
- // on the next load — retried for ~1s so it outlasts re-hydration and lazy
143
- // sections that grow the page after load. The recency guard avoids restoring a
144
- // stale offset on a genuinely fresh visit.
145
- var SCROLL_KEY = "__cms_preview_scroll:" + location.pathname;
146
- var saveScroll = function() {
147
- try {
148
- sessionStorage.setItem(SCROLL_KEY, JSON.stringify({
149
- x: window.scrollX, y: window.scrollY, t: Date.now()
150
- }));
151
- } catch (_) {}
152
- };
153
- var saveScrollPending = false;
154
- window.addEventListener("scroll", function() {
155
- if (saveScrollPending) return;
156
- saveScrollPending = true;
157
- requestAnimationFrame(function() { saveScrollPending = false; saveScroll(); });
158
- }, { passive: true });
159
- (function restoreScroll() {
160
- var raw = null;
161
- try { raw = sessionStorage.getItem(SCROLL_KEY); } catch (_) {}
162
- if (!raw) return;
163
- var saved = null;
164
- try { saved = JSON.parse(raw); } catch (_) { return; }
165
- if (!saved || (Date.now() - saved.t) > 10000) return;
166
- if (!saved.x && !saved.y) return;
167
- var attempts = 0;
168
- var apply = function() {
169
- attempts++;
170
- window.scrollTo(saved.x || 0, saved.y || 0);
171
- if (attempts < 8) setTimeout(apply, 120);
172
- };
173
- apply();
174
- })();
175
-
176
- var highlight = document.createElement("div");
177
- highlight.style.cssText = "position:absolute;pointer-events:none;outline:2px solid #06b6d4;background:rgba(6,182,212,0.06);border-radius:2px;z-index:2147483647;display:none;";
178
- document.body.appendChild(highlight);
179
-
180
- var badge = document.createElement("div");
181
- badge.style.cssText = "position:absolute;pointer-events:none;background:#06b6d4;color:white;font:11px/1 monospace;padding:2px 6px;border-radius:2px;z-index:2147483647;display:none;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis;";
182
- document.body.appendChild(badge);
183
-
184
- var isTopLevelSection = function(el) {
185
- return el && el.parentElement
186
- ? !el.parentElement.closest("section[data-manifest-key]")
187
- : true;
188
- };
189
-
190
- // All top-level page sections in DOM order (deco renders page sections as
191
- // <section data-manifest-key>; nested islands/sections carry the attribute
192
- // too, hence the top-level filter). This is the full DOM run, framework
193
- // sections included — getAllSections() narrows it to the editable window.
194
- var topLevelSections = function() {
195
- return Array.from(document.querySelectorAll("section[data-manifest-key]"))
196
- .filter(isTopLevelSection);
197
- };
198
-
199
- // Acceptable DOM keys per section; [] = wildcard, null = renders nothing.
200
- var sectionCandidates = [];
201
-
202
- // Stringified from section-alignment.ts so both sides share one copy.
203
- var alignSections = ${Na.toString()};
204
-
205
- // Indexed like the decofile array; unmapped entries stay null (not clickable).
206
- var computeAlignment = function(tops) {
207
- var domKeys = tops.map(function(s) { return s.getAttribute("data-manifest-key"); });
208
- return alignSections(sectionCandidates, domKeys).map(function(idx) {
209
- return idx === null ? null : tops[idx];
210
- });
211
- };
212
-
213
- // Editable sections, indexed to match the decofile array the panel uses.
214
- // Recomputed from the live DOM each call (cheap, rAF-throttled) so it
215
- // self-heals as client-rendered/lazy sections mount. Until the editor sends
216
- // candidates, fall back to the full top-level run.
217
- var getAllSections = function() {
218
- var tops = topLevelSections();
219
- return sectionCandidates.length ? computeAlignment(tops) : tops;
220
- };
221
-
222
- // Resolve to the OUTERMOST page-level section (clicking nested content still
223
- // maps to the top-level section the panel indexes); null if it isn't in the
224
- // aligned editable set (a framework section deco injected).
225
- var findSection = function(el, out) {
226
- var node = el;
227
- var found = null;
228
- while (node && node !== document.body) {
229
- if (node.tagName === "SECTION" && node.hasAttribute && node.hasAttribute("data-manifest-key")) {
230
- found = node;
231
- }
232
- node = node.parentElement;
233
- }
234
- if (!found) return null;
235
- var sections = getAllSections();
236
- if (out) out.sections = sections;
237
- return sections.indexOf(found) >= 0 ? found : null;
238
- };
239
-
240
- // A Lazy wrapper's key is just the loader — show the inner section's instead.
241
- var LAZY_KEYS = [
242
- "website/sections/Rendering/Lazy.tsx",
243
- "website/sections/Rendering/SingleDeferred.tsx"
244
- ];
245
- var isLazyKey = function(key) {
246
- return LAZY_KEYS.some(function(s) { return key.endsWith(s); });
247
- };
248
- var displayKey = function(section) {
249
- var key = section.getAttribute("data-manifest-key") || "section";
250
- if (isLazyKey(key)) {
251
- var inner = section.querySelector("section[data-manifest-key]");
252
- if (inner) return inner.getAttribute("data-manifest-key") || key;
253
- }
254
- return key;
255
- };
256
-
257
- // Per-section metadata sent by the editor, aligned by index with
258
- // getAllSections(). labels: names the DOM can't carry (a global section or a
259
- // global inside async rendering); kinds: section type that drives the color.
260
- var sectionLabels = [];
261
- var sectionKinds = [];
262
- var labelFor = function(section, sections) {
263
- var idx = (sections || getAllSections()).indexOf(section);
264
- if (idx >= 0 && sectionLabels[idx]) return sectionLabels[idx];
265
- return displayKey(section);
266
- };
267
- var kindFor = function(section, sections) {
268
- var idx = (sections || getAllSections()).indexOf(section);
269
- return (idx >= 0 && sectionKinds[idx]) || "normal";
270
- };
271
-
272
- // Highlight palette by section kind: global = light purple, variant = green,
273
- // normal = blue.
274
- var COLORS = {
275
- normal: { solid: "#06b6d4", bg: "rgba(6,182,212,0.06)", active: "rgba(6,182,212,0.18)" },
276
- global: { solid: "#c084fc", bg: "rgba(192,132,252,0.10)", active: "rgba(192,132,252,0.22)" },
277
- variant: { solid: "#22c55e", bg: "rgba(34,197,94,0.08)", active: "rgba(34,197,94,0.20)" }
278
- };
279
- var applyColor = function(kind) {
280
- var c = COLORS[kind] || COLORS.normal;
281
- highlight.style.outline = "2px solid " + c.solid;
282
- highlight.style.background = c.bg;
283
- badge.style.background = c.solid;
284
- };
285
-
286
- var lastSection = null;
287
- var lastLabel = "";
288
- var lastKind = "normal";
289
- var rafPending = false;
290
- // True while an in-place render fetch/swap is in flight; suppresses hover so it can't re-show the overlay right before the swap snapshots it.
291
- var renderPending = false;
292
-
293
- // Document-relative coordinates (rect + scroll) on absolutely-positioned
294
- // nodes, so the browser scrolls the highlight together with the page
295
- // natively — no per-frame JS repositioning, no scroll lag.
296
- var positionHighlight = function(section) {
297
- var r = section.getBoundingClientRect();
298
- var top = r.top + window.scrollY;
299
- var left = r.left + window.scrollX;
300
- highlight.style.display = "block";
301
- highlight.style.top = top + "px";
302
- highlight.style.left = left + "px";
303
- highlight.style.width = r.width + "px";
304
- highlight.style.height = r.height + "px";
305
- badge.textContent = lastLabel || displayKey(section);
306
- badge.style.display = "block";
307
- badge.style.top = Math.max(0, top - 20) + "px";
308
- badge.style.left = left + "px";
309
- };
310
-
311
- var moveHandler = function(e) {
312
- if (renderPending || rafPending) return;
313
- rafPending = true;
314
- var target = e.target;
315
- requestAnimationFrame(function() {
316
- rafPending = false;
317
- if (renderPending) return;
318
- if (!target || target === highlight || target === badge) return;
319
- var out = {};
320
- var section = findSection(target, out);
321
- if (section === lastSection) return;
322
- lastSection = section;
323
- if (!section) {
324
- highlight.style.display = "none";
325
- badge.style.display = "none";
326
- return;
327
- }
328
- lastLabel = labelFor(section, out.sections);
329
- lastKind = kindFor(section, out.sections);
330
- applyColor(lastKind);
331
- positionHighlight(section);
332
- });
333
- };
334
- document.addEventListener("mousemove", moveHandler, true);
335
-
336
- // Window scroll is handled natively by the absolute positioning above; this
337
- // only re-syncs on resize and on scrolls inside nested scroll containers
338
- // (capture=true catches those), where document coordinates do shift.
339
- var reposition = function() {
340
- if (!lastSection || highlight.style.display === "none") return;
341
- if (rafPending) return;
342
- rafPending = true;
343
- requestAnimationFrame(function() {
344
- rafPending = false;
345
- if (lastSection && highlight.style.display !== "none") positionHighlight(lastSection);
346
- });
347
- };
348
- window.addEventListener("scroll", reposition, { capture: true, passive: true });
349
- window.addEventListener("resize", reposition, { passive: true });
350
-
351
- var outHandler = function(e) {
352
- if (!e.relatedTarget || e.relatedTarget === document.documentElement) {
353
- highlight.style.display = "none";
354
- badge.style.display = "none";
355
- lastSection = null;
356
- }
357
- };
358
- document.addEventListener("mouseout", outHandler, true);
359
-
360
- var clickSeq = 0;
361
-
362
- // Blocks observes clicks to select sections in the side panel; it must not
363
- // cancel the iframe page's own handlers or native control behavior.
364
- var clickHandler = function(e) {
365
- var target = e.target;
366
- if (!target || target === highlight || target === badge) return;
367
- var out = {};
368
- var section = findSection(target, out);
369
- if (!section) return;
370
-
371
- var sectionIndex = out.sections.indexOf(section);
372
- var manifestKey = section.getAttribute("data-manifest-key") || "";
373
-
374
- var c = COLORS[lastKind] || COLORS.normal;
375
- highlight.style.outline = "2px solid " + c.solid;
376
- highlight.style.background = c.active;
377
- setTimeout(function() {
378
- highlight.style.background = c.bg;
379
- }, 400);
380
-
381
- clickSeq++;
382
- window.parent.postMessage({
383
- type: "cms-editor::section-clicked",
384
- payload: { sectionIndex: sectionIndex, manifestKey: manifestKey, clickSeq: clickSeq }
385
- }, "*");
386
- };
387
- document.addEventListener("click", clickHandler, true);
388
-
389
- /**
390
- * Navigation is disabled while editing: leaving the page would leave the
391
- * panel editing the previous page's sections. Only the default action of a
392
- * real navigation is cancelled, never propagation — in-page controls must
393
- * keep working (#5567).
394
- */
395
- var isNavigatingAnchor = function(a) {
396
- if (!a) return false;
397
- var href = a.getAttribute("href");
398
- if (!href) return false;
399
- var trimmed = href.trim();
400
- if (!trimmed || trimmed.charAt(0) === "#") return false;
401
- if (/^javascript:/i.test(trimmed)) return false;
402
- // Same document + fragment only scrolls.
403
- try {
404
- var url = new URL(a.href, location.href);
405
- if (url.href.split("#")[0] === location.href.split("#")[0]) return false;
406
- } catch (_) {}
407
- return true;
408
- };
409
- var navBlocker = function(e) {
410
- var el = e.target;
411
- var a = el && el.closest ? el.closest("a") : null;
412
- if (!isNavigatingAnchor(a)) return;
413
- e.preventDefault();
414
- };
415
- document.addEventListener("click", navBlocker, true);
416
-
417
- var submitBlocker = function(e) { e.preventDefault(); };
418
- document.addEventListener("submit", submitBlocker, true);
419
-
420
- // Fast Preview in-place render: POST merged decofile to /live/previews, swap the HTML in (document/window listeners survive; overlay nodes get re-attached).
421
- var renderCtrl = null;
422
- var renderQueue = Promise.resolve();
423
- var TRANSITION_TAG =
424
- "<style id=\\"deco-disable-transitions\\">* { transition: none !important; }</style></head>";
425
- var renderInPlace = function(src, body) {
426
- if (renderCtrl) renderCtrl.abort();
427
- var ctrl = new AbortController();
428
- renderCtrl = ctrl;
429
- renderPending = true;
430
- highlight.style.display = "none";
431
- badge.style.display = "none";
432
- window.parent.postMessage({ type: "cms-editor::render-start" }, "*");
433
- renderQueue = renderQueue.then(function() {
434
- return fetch(src, {
435
- method: "POST",
436
- body: body,
437
- signal: ctrl.signal,
438
- headers: { accept: "text/html", "content-type": "application/json" }
439
- }).then(function(res) {
440
- if (!res.ok) throw new Error("render " + res.status);
441
- return res.text();
442
- }).then(function(html) {
443
- var swap = function() {
444
- document.documentElement.innerHTML = html.replace("</head>", TRANSITION_TAG);
445
- document.body.appendChild(highlight);
446
- document.body.appendChild(badge);
447
- // Old section is gone; hide the overlay until the next hover repositions it.
448
- highlight.style.display = "none";
449
- badge.style.display = "none";
450
- lastSection = null;
451
- };
452
- var headHtml = html.slice(html.indexOf("<head>"), html.indexOf("</head>") + 7);
453
- var doc = new DOMParser().parseFromString(headHtml, "text/html");
454
- var sheets = Array.prototype.map.call(
455
- doc.head.querySelectorAll("link[rel=\\"stylesheet\\"]"),
456
- function(el) { return el.href ? fetch(el.href).catch(function() {}) : null; }
457
- );
458
- return Promise.all(sheets).then(function() {
459
- if (typeof document.startViewTransition === "function") {
460
- return document.startViewTransition(swap).finished;
461
- }
462
- swap();
463
- });
464
- }).then(function() {
465
- var t = document.getElementById("deco-disable-transitions");
466
- if (t) t.remove();
467
- if (ctrl === renderCtrl) renderPending = false;
468
- window.parent.postMessage({ type: "cms-editor::render-end" }, "*");
469
- }).catch(function(err) {
470
- if (ctrl === renderCtrl) renderPending = false;
471
- if (err && err.name === "AbortError") return;
472
- window.parent.postMessage({ type: "cms-editor::render-error" }, "*");
473
- });
474
- });
475
- };
476
-
477
- window.addEventListener("message", function(e) {
478
- // Only Studio's own postMessage (source === this frame's parent) may drive the bridge — forged senders can't trigger the render fetch/swap.
479
- if (e.source !== window.parent) return;
480
- if (e.data && e.data.type === "cms-editor::render" && typeof e.data.src === "string") {
481
- renderInPlace(e.data.src, e.data.body);
482
- return;
483
- }
484
- if (e.data && e.data.type === "cms-editor::set-labels" && Array.isArray(e.data.labels)) {
485
- sectionLabels = e.data.labels;
486
- if (Array.isArray(e.data.kinds)) sectionKinds = e.data.kinds;
487
- if (Array.isArray(e.data.keys)) sectionCandidates = e.data.keys;
488
- if (lastSection) {
489
- lastLabel = labelFor(lastSection);
490
- lastKind = kindFor(lastSection);
491
- applyColor(lastKind);
492
- if (highlight.style.display !== "none") positionHighlight(lastSection);
493
- }
494
- return;
495
- }
496
- // Parent-driven clear: the cross-origin iframe can't self-detect a frame exit.
497
- if (e.data && e.data.type === "cms-editor::clear-hover") {
498
- highlight.style.display = "none";
499
- badge.style.display = "none";
500
- lastSection = null;
501
- return;
502
- }
503
- if (e.data && e.data.type === "cms-editor::deactivate") {
504
- highlight.remove();
505
- badge.remove();
506
- document.removeEventListener("mousemove", moveHandler, true);
507
- document.removeEventListener("mouseout", outHandler, true);
508
- document.removeEventListener("click", clickHandler, true);
509
- // Or the page stays unnavigable after leaving Blocks mode.
510
- document.removeEventListener("click", navBlocker, true);
511
- document.removeEventListener("submit", submitBlocker, true);
512
- window.removeEventListener("scroll", reposition, { capture: true });
513
- window.removeEventListener("resize", reposition);
514
- window.__cmsEditorActive = false;
515
- }
516
- });
517
- })();`;function pn(t,e){let r=t,s=typeof r?.__resolveType=="string"?r.__resolveType:"";for(let i=0;s&&i<5;i++){const u=e[s];if(u&&typeof u=="object"&&"__resolveType"in u){const c=u.__resolveType;if(typeof c=="string"&&c&&c!==s){r=u,s=c;continue}}break}if(!s)return[];if(s.includes("flags/multivariate")){const i=Array.isArray(r.variants)?r.variants:[];if(i.length===0||i.every(d=>d?.rule?.__resolveType===qr))return null;const c=[];for(const d of i){const o=d?.value;if(o&&typeof o=="object")for(const l of pn(o,e)??[])c.includes(l)||c.push(l)}return c}if(Gr(s)){const i=r.section&&typeof r.section=="object"?pn(r.section,e):[];return i===null?null:i.length?[s,...i]:[s]}return[s]}function st(t){return t.replace(/[`*_]/g,"\\$&")}function Ra(t,e){const r=[`The user selected an element on the live preview and asked: **"${st(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&&r.push(`**Section resolveType:** \`${st(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 s=`<${t.tag}${t.classes?` class="${st(t.classes)}"`:""}>`;r.push(`**Clicked element:** \`${s}\``),t.parents&&r.push(`**DOM breadcrumb:** ${st(t.parents)} > ${t.tag}`),t.text&&r.push(`**Text content:** "${st(t.text)}"`),t.componentName&&r.push(`**Component name:** ${st(t.componentName)}`);const i=t.html.replace(/```/g,"`` `");return r.push("","**HTML snippet:**","```html",i,"```"),r.push("","Please read the source file, locate the element, and apply the requested change."),r.join(`
518
- `)}function Ta(t,e,r=320,s=44,i=12){const{x:u,y:c}=t,{width:d,height:o}=e,l=Math.max(i,Math.min(u-r/2,d-r-i)),p=c/o>.68?Math.max(i,c-s-18):Math.min(c+18,o-s-i);return{leftPct:l/d*100,topPct:p/o*100}}function La(t){const e=ue.c(45),{element:r,onDismiss:s}=t,[i,u]=x.useState(""),c=x.useRef(null),{sendMessage:d}=gr(),{openSidePanel:o}=oa(),l=Le();let h;e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o||e[4]!==d?(h=()=>{if(!i.trim())return;const M=Ra(r,i);o(),d({parts:[{type:"text",text:M}]}),s()},e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=d,e[5]=h):h=e[5];const p=h;let f;e[6]!==r.position||e[7]!==r.viewport?(f=Ta(r.position,r.viewport),e[6]=r.position,e[7]=r.viewport,e[8]=f):f=e[8];const P=f,g=`${P.leftPct}%`,k=`${P.topPct}%`;let b;e[9]!==g||e[10]!==k?(b={left:g,top:k,width:"320px"},e[9]=g,e[10]=k,e[11]=b):b=e[11];let v;e[12]!==p?(v=M=>{M.preventDefault(),p()},e[12]=p,e[13]=v):v=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=M=>u(M.target.value),e[14]=C):C=e[14];let y;e[15]!==s?(y=M=>{M.key==="Escape"&&s()},e[15]=s,e[16]=y):y=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let S;e[19]!==i||e[20]!==y||e[21]!==w?(S=n.jsx("input",{ref:c,autoFocus:!0,type:"text",value:i,onChange:C,onKeyDown:y,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=w,e[22]=S):S=e[22];let j;e[23]!==i?(j=i.trim(),e[23]=i,e[24]=j):j=e[24];const R=!j;let E;e[25]!==l?(E=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=E):E=e[26];let F;e[27]!==l?(F=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=F):F=e[28];let U;e[29]!==F?(U=n.jsx("title",{children:F}),e[29]=F,e[30]=U):U=e[30];let B;e[31]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=B):B=e[31];let O;e[32]!==U?(O=n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[U,B]}),e[32]=U,e[33]=O):O=e[33];let _;e[34]!==R||e[35]!==E||e[36]!==O?(_=n.jsx("button",{type:"submit",disabled:R,className:"flex h-6 w-6 shrink-0 items-center justify-center classic:rounded-full compact:rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:E,children:O}),e[34]=R,e[35]=E,e[36]=O,e[37]=_):_=e[37];let D;e[38]!==S||e[39]!==_||e[40]!==v?(D=n.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:v,children:[S,_]}),e[38]=S,e[39]=_,e[40]=v,e[41]=D):D=e[41];let W;return e[42]!==D||e[43]!==b?(W=n.jsx("div",{className:"absolute z-30 pointer-events-none",style:b,children:D}),e[42]=D,e[43]=b,e[44]=W):W=e[44],W}const as="site-links",Oa=/details?page|\bpdp\b/i,_a=/listingpage|\bplp\b/i;function Aa(t,e,r){const s=new Set;for(const d of r)Oa.test(d)&&s.add("product"),_a.test(d)&&s.add("category");const i=at(xn(t)),u=i[i.length-1],c=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&c?.type==="param"&&c.name===e&&s.add("product"),e==="*"&&i.some(d=>d.type==="param"&&d.name==="*")&&s.add("category"),s}const Da=["rosa","preto","pink","black"];function $t(t,e){const r=e.trim();return r?t(r):Da.flatMap(s=>t(s))}function $a(t,e){const r=e.trim(),s=[];/^\d+$/.test(r)&&s.push({resolveType:t,props:{ids:[r]}});const u=r.includes("-")&&!/\s/.test(r)?r.replace(/-+/g," "):r;return s.push({resolveType:t,props:{query:u,count:10}}),s}const As=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function yn(t){return t.split("/")[0]??""}function Fa(t){const e=new Set;for(const r of t){const s=yn(r);As.has(s)&&e.add(s)}return e}function Ba(t,e){const r=yn(t);return!As.has(r)||e.size===0?!0:e.has(r)}const Ma=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>$t(r=>$a(t,r),e),optionsFromPayload:Ft},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>$t(r=>[{resolveType:t,props:{props:{search:r,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Ft},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>$t(r=>[{resolveType:t,props:{term:r,hitsPerPage:10}}],e),optionsFromPayload:Ft},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>$t(r=>[{resolveType:t,props:{query:r,term:r,count:10,hitsPerPage:10}}],e),optionsFromPayload:Ft},{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:Va}];function za(t,e,r=new Set){const s=[...e],i=d=>{const o=[];for(const l of Ma){if(l.kind!==d)continue;const h=s.find(p=>l.test(p)&&Ba(p,r));h&&o.push({cand:l,resolveType:h})}return o.find(l=>r.has(yn(l.resolveType)))??o[0]},u=(d,o,l)=>({kind:d.kind,id:`${d.kind}:${o}`,resolveType:o,clientFilter:d.clientFilter,isFallback:l,buildRequests:h=>d.buildRequests(o,h),optionsFromPayload:d.optionsFromPayload}),c=[];for(const d of["product","category"]){if(!t.has(d))continue;const o=i(d);o&&c.push(u(o.cand,o.resolveType,!1))}return t.size>0&&c.push(Ia(t.has("category")?"category":"product")),c}function Ia(t){return{kind:t,id:as,resolveType:as,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,r)=>Qa(e,r)}}function Ze(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Ka(t,e,r){const s=new Set,i=new Set,u=c=>{if(Array.isArray(c)){for(const l of c)u(l);return}const d=Ze(c);if(!d)return;const o=d.__resolveType;if(typeof o=="string"){if(r(o))s.add(o);else if(o in e&&!i.has(o)){i.add(o);const l=Ze(e[o])?.__resolveType;typeof l=="string"&&r(l)&&s.add(o),u(e[o])}}for(const l of Object.values(d))u(l)};return u(t),s}function Ds(t){const e=new Set,r=[];for(const s of t)for(const i of s)e.has(i.value)||(e.add(i.value),r.push(i));return r}function $s(t){try{return decodeURIComponent(t)}catch{return t}}function Ha(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ua(t){const e=[];let r="^";for(const s of t)s.type==="text"?r+=Ha(s.text):(e.push(s.name),r+=s.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${r}$`),order:e}}function Fs(t,e,r){if(typeof t!="string"||!t)return null;let s;try{s=new URL(t,"https://placeholder.invalid").pathname}catch{return null}s=s.replace(/\/+$/,"");const i=at(xn(e)),{pattern:u,order:c}=Ua(i),d=c.indexOf(r);if(d===-1)return null;const o=s.match(u);if(!o)return null;const l=o[d+1]?.replace(/^\/+|\/+$/g,"");return l?$s(l):null}function Ft(t,e){const r=Ze(t),s=Array.isArray(t)?t:Array.isArray(r?.products)?r.products:Array.isArray(r?.list)?r.list:[],i=[],u=new Set;for(const c of s){const d=Ze(c);if(!d)continue;const o=Fs(d.url,e.template,e.paramName);if(!o||u.has(o))continue;u.add(o);const l=Ze(d.isVariantOf),h=typeof l?.name=="string"&&l.name||typeof d.name=="string"&&d.name||o,p=Array.isArray(d.image)?Ze(d.image[0]):null,f=typeof p?.url=="string"?p.url:void 0;i.push({value:o,label:h,image:f})}return i}function Wa(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const r=e.replace(/^\/+|\/+$/g,"");return r?$s(r):null}function Va(t){const e=[],r=new Set,s=(i,u)=>{const c=Ze(i);if(!c)return;const d=typeof c.name=="string"&&c.name?c.name:"",o=d?[...u,d]:u,l=Wa(c.url);if(l&&!r.has(l)&&(r.add(l),e.push({value:l,label:o.join(" › ")||l})),Array.isArray(c.children))for(const h of c.children)s(h,o)};if(Array.isArray(t))for(const i of t)s(i,[]);return e}const qa=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 Ga(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,r=>r.toUpperCase())}function Ja(t){if(typeof t!="string"||!t)return[];const e=[],r=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let s,i=0;for(;(s=r.exec(t))!==null&&i++<5e3;){const u=s[1]??"",c=(s[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:c})}return e}function Ya(t){if(typeof t!="string"||!t)return[];const e=[],r=new Set,s=/"@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,c=0;for(;(u=s.exec(t))!==null&&c++<3e3;){const d=(u[1]??"").replace(/\\\//g,"/");if(!d||r.has(d))continue;r.add(d);const o=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:d,name:u[2]??"",image:o||void 0})}return e}function Qa(t,e){const r=[],s=new Set,i=(u,c,d,o)=>{if(r.length>=200)return;const l=Fs(u,e.template,e.paramName);!l||s.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||d==="category"&&qa.has(l.split("/")[0]??"")||(s.add(l),r.push({value:l,label:c&&c.length<=80?c:Ga(l),kind:d,image:o}))};for(const{url:u,name:c,image:d}of Ya(t))i(u,c,"product",d);for(const{href:u,text:c}of Ja(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,c,"category");return r}function pt(t,e,r=50){const s=e.trim().toLowerCase();return(s?t.filter(u=>u.label.toLowerCase().includes(s)||u.value.toLowerCase().includes(s)):t).slice(0,r)}const Bs=1e4;function Za(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 Xa(t,{resolveType:e,props:r}){const s=await fetch(Lr(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...r}),signal:AbortSignal.timeout(Bs)});if(!s.ok)throw new Error(`Failed to fetch options: ${s.status}`);return s.json()}async function is(t,e){const r=await fetch(Or(t,e),{signal:AbortSignal.timeout(Bs)});if(!r.ok)throw new Error(`Failed to fetch page: ${r.status}`);return r.text()}async function ei(t,e,r){const s=e.optionsFromPayload(await is(t,"/"),r),i=s.find(c=>c.kind==="category");if(!i)return s;const u=He(r.template,{[r.paramName]:i.value});if(u==="/")return s;try{const c=e.optionsFromPayload(await is(t,u),r).filter(d=>d.kind==="product");return Ds([s,c])}catch{return s}}function ti(t,e,r){return lr.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":r}`)}async function ni(t,e,r,s){if(e.homepageLinks)return ei(t,e,s);const i=e.buildRequests?.(r)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(d=>Xa(t,d))),c=u.filter(d=>d.status==="fulfilled").map(d=>d.value);if(c.length===0){const d=u.find(o=>o.status==="rejected");throw d?d.reason:new Error("Failed to fetch options")}return Ds(c.map(d=>e.optionsFromPayload(d,s)))}function fn(t,e,r,s,i){return{queryKey:ti(t,e,r),queryFn:()=>ni(t,e,r,s),enabled:i,staleTime:6e4,retry:1}}function ft(t){const e=ue.c(16),{heading:r,iconKind:s,options:i,template:u,paramName:c,keyPrefix:d,onSelect:o}=t;if(i.length===0)return null;let l;if(e[0]!==s||e[1]!==d||e[2]!==o||e[3]!==i||e[4]!==c||e[5]!==u){let p;e[7]!==s||e[8]!==d||e[9]!==o||e[10]!==c||e[11]!==u?(p=f=>n.jsxs(vt,{value:`${d}:${f.value}`,className:"gap-3 py-2",onSelect:()=>o(f.value),children:[s==="product"&&n.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?n.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):n.jsx(hs,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:f.label}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:He(u,{[c]:f.value})})]})]},`${d}:${f.value}`),e[7]=s,e[8]=d,e[9]=o,e[10]=c,e[11]=u,e[12]=p):p=e[12],l=i.map(p),e[0]=s,e[1]=d,e[2]=o,e[3]=i,e[4]=c,e[5]=u,e[6]=l}else l=e[6];let h;return e[13]!==r||e[14]!==l?(h=n.jsx(gt,{heading:r,children:l}),e[13]=r,e[14]=l,e[15]=h):h=e[15],h}function os(t){const e=ue.c(2),{text:r}=t;let s;return e[0]!==r?(s=n.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:r}),e[0]=r,e[1]=s):s=e[1],s}function ls(t){const e=ue.c(52),{sources:r,template:s,paramName:i,value:u,sandboxRef:c,onCommit:d}=t,o=Le(),[l,h]=x.useState(!1),[p,f]=x.useState(""),[P,g]=x.useState(""),k=x.useRef(null),b=i==="*"?o("sandbox.preview.catchAllParamLabel"):`:${i}`,v=Za(o),y=[...new Set(r.map(q=>v[q.kind].noun))].join(" or ");let w;e[0]!==o||e[1]!==y?(w=o("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=o,e[1]=y,e[2]=w):w=e[2];const S=w,j={template:s,paramName:i};let R;e[3]!==p?(R=(q,Z)=>({source:q,query:Z,options:q.clientFilter?pt(Z.data??[],p):Z.data??[]}),e[3]=p,e[4]=R):R=e[4];const E=R,F=r.filter(di),U=r.filter(ci),B=mn({queries:F.map(q=>fn(c,q,P,j,l))});let O;e[5]!==B||e[6]!==E?(O=(q,Z)=>E(q,B[Z]),e[5]=B,e[6]=E,e[7]=O):O=e[7];const _=F.map(O),D=_.length===0||_.every(li),W=mn({queries:U.map(q=>fn(c,q,P,j,l&&D))});let M;e[8]!==W||e[9]!==E?(M=(q,Z)=>E(q,W[Z]),e[8]=W,e[9]=E,e[10]=M):M=e[10];const X=U.map(M),V=D?X:_,A=V.length===1&&V[0]?.source.homepageLinks?V[0]:null,T=A&&!A.query.isLoading&&!A.query.isError?A?.query.data??[]:[],ae=pt(T.filter(oi),p),Y=pt(T.filter(ii),p),Ne=ae.length>0&&Y.length>0,ee=q=>{h(q),k.current&&clearTimeout(k.current),f(q?u:""),g(q?u:"")};let $;e[11]===Symbol.for("react.memo_cache_sentinel")?($=q=>{f(q),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{g(q)},300)},e[11]=$):$=e[11];const ie=$,G=q=>{d(q),ee(!1)},Q=Ss(p),we=He(s,{[i]:Q}),te=Ts,I=Rs,me="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",fe=ai;let ne;e[12]!==b||e[13]!==o?(ne=o("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:b}),e[12]=b,e[13]=o,e[14]=ne):ne=e[14];let se;e[15]!==ne?(se=n.jsx(Ls,{className:"sr-only",children:n.jsx(Os,{children:ne})}),e[15]=ne,e[16]=se):se=e[16];let xe;e[17]===Symbol.for("react.memo_cache_sentinel")?(xe=n.jsx(hs,{size:16,className:"shrink-0 text-foreground"}),e[17]=xe):xe=e[17];let ce;e[18]!==o?(ce=o("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=o,e[19]=ce):ce=e[19];let he;e[20]!==b?(he=n.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-[12px] text-special",children:b}),e[20]=b,e[21]=he):he=e[21];let oe;e[22]!==ce||e[23]!==he?(oe=n.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[xe,n.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ce," ",he]})]}),e[22]=ce,e[23]=he,e[24]=oe):oe=e[24];const ge=vs,it=!1,Oe="min-h-0 flex-1";let be;e[25]!==S||e[26]!==p?(be=n.jsx(xs,{autoFocus:!0,placeholder:S,value:p,onValueChange:ie}),e[25]=S,e[26]=p,e[27]=be):be=e[27];const Ce=gs,Kt="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let pe;e[28]!==o?(pe=o("sandbox.pathParamPickerChip.noResults"),e[28]=o,e[29]=pe):pe=e[29];let _e;e[30]!==pe?(_e=n.jsx(bs,{children:pe}),e[30]=pe,e[31]=_e):_e=e[31];const Ue=Q&&n.jsx(gt,{className:"shrink-0",children:n.jsxs(vt,{value:`__raw__:${Q}`,className:"gap-3 py-2",onSelect:()=>G(Q),children:[n.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:n.jsx(la,{size:14,className:"text-muted-foreground"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm",children:o("sandbox.pathParamPickerChip.useRawValue",{rawTerm:Q,paramLabel:b})}),n.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:we})]})]})}),Fe=Ne?n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:n.jsx(ft,{heading:v.category.heading,iconKind:"category",options:ae,template:s,paramName:i,keyPrefix:`${A?.source.id}:cat`,onSelect:G})}),n.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:n.jsx(ft,{heading:v.product.heading,iconKind:"product",options:Y,template:s,paramName:i,keyPrefix:`${A?.source.id}:prod`,onSelect:G})})]}):n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:V.map(q=>{const{source:Z,query:J,options:ve}=q,{noun:Ae}=v[Z.kind];if(J.isLoading)return n.jsx(os,{text:o("sandbox.pathParamPickerChip.loading",{noun:Ae})},Z.id);if(J.isError)return n.jsx(os,{text:o("sandbox.pathParamPickerChip.couldNotLoad")},Z.id);if(Z.homepageLinks){const xt=J.data??[];return n.jsxs(x.Fragment,{children:[n.jsx(ft,{heading:v.category.heading,iconKind:"category",options:pt(xt.filter(ri),p),template:s,paramName:i,keyPrefix:`${Z.id}:cat`,onSelect:G}),n.jsx(ft,{heading:v.product.heading,iconKind:"product",options:pt(xt.filter(si),p),template:s,paramName:i,keyPrefix:`${Z.id}:prod`,onSelect:G})]},Z.id)}return n.jsx(ft,{heading:V.length>1?v[Z.kind].heading:void 0,iconKind:Z.kind,options:ve,template:s,paramName:i,keyPrefix:Z.id,onSelect:G},Z.id)})});let ke;e[32]!==Ce||e[33]!==_e||e[34]!==Ue||e[35]!==Fe?(ke=n.jsxs(Ce,{className:Kt,children:[_e,Ue,Fe]}),e[32]=Ce,e[33]=_e,e[34]=Ue,e[35]=Fe,e[36]=ke):ke=e[36];let Be;e[37]!==ge||e[38]!==be||e[39]!==ke?(Be=n.jsxs(ge,{shouldFilter:it,className:Oe,children:[be,ke]}),e[37]=ge,e[38]=be,e[39]=ke,e[40]=Be):Be=e[40];let ye;e[41]!==I||e[42]!==se||e[43]!==oe||e[44]!==Be||e[45]!==fe?(ye=n.jsxs(I,{className:me,onClick:fe,children:[se,oe,Be]}),e[41]=I,e[42]=se,e[43]=oe,e[44]=Be,e[45]=fe,e[46]=ye):ye=e[46];let We;return e[47]!==te||e[48]!==ee||e[49]!==l||e[50]!==ye?(We=n.jsx(te,{open:l,onOpenChange:ee,children:ye}),e[47]=te,e[48]=ee,e[49]=l,e[50]=ye,e[51]=We):We=e[51],n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",title:o("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:b}),className:"max-w-64 shrink-0 cursor-pointer truncate classic:rounded-sm compact:rounded-lg bg-special/15 px-1 py-0.5 text-[12px] text-special hover:bg-special/25",onClick:q=>{q.stopPropagation(),ee(!0)},children:u||b}),We]})}function si(t){return t.kind==="product"}function ri(t){return t.kind!=="product"}function ai(t){return t.stopPropagation()}function ii(t){return t.kind==="product"}function oi(t){return t.kind!=="product"}function li(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function ci(t){return t.isFallback}function di(t){return!t.isFallback}function ui(t){const e=ue.c(8),{sources:r,template:s,paramName:i,sandboxRef:u,onFill:c}=t;let d,o;if(e[0]!==i||e[1]!==u||e[2]!==r||e[3]!==s){const P={template:s,paramName:i},g=r.filter(mi);o=mn,d=g.map(k=>fn(u,k,"",P,!0)),e[0]=i,e[1]=u,e[2]=r,e[3]=s,e[4]=d,e[5]=o}else d=e[4],o=e[5];let l;e[6]!==d?(l={queries:d},e[6]=d,e[7]=l):l=e[7];const h=o(l),[p,f]=x.useState(!1);if(!p)for(const P of h){if(P.isLoading)break;const g=P.data?.[0];if(g){f(!0),queueMicrotask(()=>c(g.value));break}}return null}function mi(t){return!t.isFallback}function cs(t){const e=ue.c(31),{name:r,value:s,onCommit:i}=t,u=Le(),[c,d]=x.useState(s),[o,l]=x.useState(!1),h=x.useRef(!1);let p;e[0]!==r||e[1]!==u?(p=r==="*"?u("sandbox.preview.catchAllParamLabel"):`:${r}`,e[0]=r,e[1]=u,e[2]=p):p=e[2];const f=p,P=c||f;let g;e[3]!==P?(g=n.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-[12px]",children:P}),e[3]=P,e[4]=g):g=e[4];let k;e[5]!==f||e[6]!==u?(k=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=k):k=e[7];let b,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=E=>d(E.target.value),v=()=>l(!0),e[8]=b,e[9]=v):(b=e[8],v=e[9]);let C;e[10]!==s?(C=E=>{E.key==="Enter"&&E.currentTarget.blur(),E.key==="Escape"&&(h.current=!0,d(s),E.currentTarget.blur())},e[10]=s,e[11]=C):C=e[11];let y;e[12]!==c||e[13]!==i||e[14]!==s?(y=()=>{if(l(!1),h.current){h.current=!1;return}const E=Ss(c);d(E),E!==s&&i(E)},e[12]=c,e[13]=i,e[14]=s,e[15]=y):y=e[15];let w;e[16]!==c||e[17]!==f||e[18]!==k||e[19]!==C||e[20]!==y?(w=n.jsx("input",{type:"text",value:c,placeholder:f,title:k,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-[12px] text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:pi,onChange:b,onFocus:v,onKeyDown:C,onBlur:y}),e[16]=c,e[17]=f,e[18]=k,e[19]=C,e[20]=y,e[21]=w):w=e[21];let S;e[22]!==g||e[23]!==w?(S=n.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[g,w]}),e[22]=g,e[23]=w,e[24]=S):S=e[24];let j;e[25]!==o||e[26]!==u?(j=o&&n.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-[10px] text-muted-foreground",children:[n.jsx(vr,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=o,e[26]=u,e[27]=j):j=e[27];let R;return e[28]!==j||e[29]!==S?(R=n.jsxs(n.Fragment,{children:[S,j]}),e[28]=j,e[29]=S,e[30]=R):R=e[30],R}function pi(t){return t.stopPropagation()}function fi(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const r=new URL(e),s=t.resolvedPath==="/"?"":t.resolvedPath;return`${r.host}${s}`}catch{return e}}function hi(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function gi(t){const e=ue.c(5);let r;e[0]!==t?(r=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=r):r=e[1];const s=ks(r);let i;return e[2]!==t||e[3]!==s?(i={mutationFn:async u=>{const{name:c,path:d,template:o}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const l=_r(c),h=o?{...o,name:c,path:d}:Ar(c,d);return await s.mutateAsync({blockKey:l,data:h}),{key:l,name:c,path:d}}},e[2]=t,e[3]=s,e[4]=i):i=e[4],cr(i)}function vi(t){const e=ue.c(89),{open:r,onOpenChange:s,isPending:i,error:u,templates:c,onSubmit:d}=t,o=i===void 0?!1:i,l=Le();let h;e[0]!==l?(h=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=h):h=e[1];const[p,f]=x.useState(h);let P;e[2]!==l?(P=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=P):P=e[3];const[g,k]=x.useState(P),[b,v]=x.useState(sn),[C,y]=x.useState(null),[w,S]=x.useState(r);r!==w&&(S(r),r&&(f(l("sectionsEditor.createPageModal.defaultPageName")),k(l("sectionsEditor.createPageModal.defaultPagePath")),v(sn),y(null)));const j=!!c?.length;let R;e[4]!==o||e[5]!==s?(R=ce=>{!ce&&!o&&(y(null),s(!1))},e[4]=o,e[5]=s,e[6]=R):R=e[6];const E=R;let F;e[7]!==o||e[8]!==p||e[9]!==d||e[10]!==g||e[11]!==j||e[12]!==b?(F=async ce=>{ce.preventDefault();const he=p.trim(),oe=g.trim();if(!he||!oe||o)return;const ge=js(oe);if(ge){y(ge);return}y(null),await d({name:he,path:oe,templateKey:j&&b!==sn?b:null})},e[7]=o,e[8]=p,e[9]=d,e[10]=g,e[11]=j,e[12]=b,e[13]=F):F=e[13];const U=F,B=C??u;let O;e[14]!==l?(O=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=O):O=e[15];let _;e[16]!==O?(_=n.jsx(Ls,{children:n.jsx(Os,{children:O})}),e[16]=O,e[17]=_):_=e[17];let D;e[18]!==l?(D=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=D):D=e[19];let W;e[20]!==D?(W=n.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:D}),e[20]=D,e[21]=W):W=e[21];let M;e[22]===Symbol.for("react.memo_cache_sentinel")?(M=ce=>f(ce.target.value),e[22]=M):M=e[22];let X;e[23]!==l?(X=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=X):X=e[24];let V;e[25]!==o||e[26]!==p||e[27]!==X?(V=n.jsx(es,{id:"new-page-name",value:p,onChange:M,placeholder:X,autoFocus:!0,disabled:o}),e[25]=o,e[26]=p,e[27]=X,e[28]=V):V=e[28];let A;e[29]!==V||e[30]!==W?(A=n.jsxs("div",{className:"space-y-1.5",children:[W,V]}),e[29]=V,e[30]=W,e[31]=A):A=e[31];let H;e[32]!==l?(H=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=H):H=e[33];let T;e[34]!==H?(T=n.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:H}),e[34]=H,e[35]=T):T=e[35];let ae;e[36]===Symbol.for("react.memo_cache_sentinel")?(ae=ce=>k(ce.target.value),e[36]=ae):ae=e[36];let Y;e[37]!==l?(Y=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=Y):Y=e[38];let Ne;e[39]!==o||e[40]!==g||e[41]!==Y?(Ne=n.jsx(es,{id:"new-page-path",value:g,onChange:ae,placeholder:Y,disabled:o}),e[39]=o,e[40]=g,e[41]=Y,e[42]=Ne):Ne=e[42];let ee;e[43]!==T||e[44]!==Ne?(ee=n.jsxs("div",{className:"space-y-1.5",children:[T,Ne]}),e[43]=T,e[44]=Ne,e[45]=ee):ee=e[45];let $;e[46]!==o||e[47]!==j||e[48]!==l||e[49]!==b||e[50]!==c?($=j&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),n.jsx(Dr,{id:"new-page-template",value:b,onChange:v,templates:c??[],disabled:o})]}),e[46]=o,e[47]=j,e[48]=l,e[49]=b,e[50]=c,e[51]=$):$=e[51];let ie;e[52]!==B?(ie=B&&n.jsx("p",{className:"text-xs text-destructive",children:B}),e[52]=B,e[53]=ie):ie=e[53];let G;e[54]!==A||e[55]!==ee||e[56]!==$||e[57]!==ie?(G=n.jsxs("div",{className:"space-y-4 py-4",children:[A,ee,$,ie]}),e[54]=A,e[55]=ee,e[56]=$,e[57]=ie,e[58]=G):G=e[58];let Q;e[59]!==s?(Q=()=>s(!1),e[59]=s,e[60]=Q):Q=e[60];let we;e[61]!==l?(we=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=we):we=e[62];let te;e[63]!==o||e[64]!==Q||e[65]!==we?(te=n.jsx(Xe,{type:"button",variant:"outline",onClick:Q,disabled:o,children:we}),e[63]=o,e[64]=Q,e[65]=we,e[66]=te):te=e[66];let I;e[67]!==o||e[68]!==p||e[69]!==g?(I=!p.trim()||!g.trim()||o,e[67]=o,e[68]=p,e[69]=g,e[70]=I):I=e[70];let me;e[71]!==o||e[72]!==l?(me=o?n.jsxs(n.Fragment,{children:[n.jsx(zt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=o,e[72]=l,e[73]=me):me=e[73];let fe;e[74]!==I||e[75]!==me?(fe=n.jsx(Xe,{type:"submit",disabled:I,children:me}),e[74]=I,e[75]=me,e[76]=fe):fe=e[76];let ne;e[77]!==te||e[78]!==fe?(ne=n.jsxs(ca,{children:[te,fe]}),e[77]=te,e[78]=fe,e[79]=ne):ne=e[79];let se;e[80]!==U||e[81]!==G||e[82]!==ne||e[83]!==_?(se=n.jsx(Rs,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:U,children:[_,G,ne]})}),e[80]=U,e[81]=G,e[82]=ne,e[83]=_,e[84]=se):se=e[84];let xe;return e[85]!==E||e[86]!==r||e[87]!==se?(xe=n.jsx(Ts,{open:r,onOpenChange:E,children:se}),e[85]=E,e[86]=r,e[87]=se,e[88]=xe):xe=e[88],xe}function xi(t){const e=ue.c(29),{orgSlug:r,virtualMcpId:s,branch:i,previewUrl:u,meta:c,decofile:d,blockKey:o}=t,l=Le();let h;e[0]!==i||e[1]!==r||e[2]!==s?(h={orgSlug:r,virtualMcpId:s,branch:i},e[0]=i,e[1]=r,e[2]=s,e[3]=h):h=e[3];const p=ks(h);let f;e[4]!==p?(f=Br((S,j)=>p.mutate({blockKey:S,data:j})),e[4]=p,e[5]=f):f=e[5];const P=f;let g;e[6]!==o||e[7]!==d?(g=$r(d,o),e[6]=o,e[7]=d,e[8]=g):g=e[8];const{resolveType:k,props:b,title:v}=g;if(!k){let S;e[9]!==l?(S=l("sandbox.preview.loaderNoLongerExists"),e[9]=l,e[10]=S):S=e[10];let j;return e[11]!==S?(j=n.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:S}),e[11]=S,e[12]=j):j=e[12],j}const C=`loader:${o}`;let y;e[13]!==o||e[14]!==k||e[15]!==v?(y={mode:"saved",blockKey:o,resolveType:k,title:v},e[13]=o,e[14]=k,e[15]=v,e[16]=y):y=e[16];let w;return e[17]!==i||e[18]!==d||e[19]!==c||e[20]!==r||e[21]!==u||e[22]!==b||e[23]!==p.isPending||e[24]!==P||e[25]!==C||e[26]!==y||e[27]!==s?(w=n.jsx(Fr,{orgSlug:r,virtualMcpId:s,branch:i,previewUrl:u,meta:c,decofile:d,kind:"loaders",target:y,initialValue:b,isCreating:p.isPending,onCreate:bi,onSaveReferencedBlock:P,showRun:!1},C),e[17]=i,e[18]=d,e[19]=c,e[20]=r,e[21]=u,e[22]=b,e[23]=p.isPending,e[24]=P,e[25]=C,e[26]=y,e[27]=s,e[28]=w):w=e[28],w}async function bi(){}function yi(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function ds(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:yi(t.error)}}function wi(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 ki(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=wi(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const r=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return r&&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"}:r?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 Pi="https://github.com/decocms/blocks";function Si(){const t=ue.c(14),e=Le();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(xr,{size:48,className:"text-muted-foreground"}),t[0]=r):r=t[0];let s;t[1]!==e?(s=e("mainPanelTabs.blocksTabStates.emptyStateTitle"),t[1]=e,t[2]=s):s=t[2];let i;t[3]!==e?(i=e("mainPanelTabs.blocksTabStates.emptyStateDescription"),t[3]=e,t[4]=i):i=t[4];let u;t[5]!==e?(u=e("mainPanelTabs.blocksTabStates.setupContentEditing"),t[5]=e,t[6]=u):u=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(un,{size:14}),t[7]=c):c=t[7];let d;t[8]!==u?(d=n.jsx(Xe,{size:"sm",asChild:!0,children:n.jsxs("a",{href:Pi,target:"_blank",rel:"noreferrer",children:[u,c]})}),t[8]=u,t[9]=d):d=t[9];let o;return t[10]!==s||t[11]!==i||t[12]!==d?(o=n.jsx(bn,{className:"h-full w-full",image:r,title:s,description:i,actions:d}),t[10]=s,t[11]=i,t[12]=d,t[13]=o):o=t[13],o}function ji(t){const e=ue.c(15),{source:r,onRetry:s}=t,i=Le();let u;e[0]!==r||e[1]!==i?(u=i(r==="sandbox"?"mainPanelTabs.blocksTabStates.errorStateSandbox":"mainPanelTabs.blocksTabStates.errorStateData"),e[0]=r,e[1]=i,e[2]=u):u=e[2];const c=u;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(da,{size:48,className:"text-muted-foreground"}),e[3]=d):d=e[3];let o;e[4]!==i?(o=i("mainPanelTabs.blocksTabStates.errorStateTitle"),e[4]=i,e[5]=o):o=e[5];let l;e[6]!==i?(l=i("mainPanelTabs.blocksTabStates.retry"),e[6]=i,e[7]=l):l=e[7];let h;e[8]!==s||e[9]!==l?(h=n.jsx(Xe,{variant:"outline",size:"sm",onClick:s,children:l}),e[8]=s,e[9]=l,e[10]=h):h=e[10];let p;return e[11]!==c||e[12]!==o||e[13]!==h?(p=n.jsx(bn,{image:d,title:o,description:c,actions:h}),e[11]=c,e[12]=o,e[13]=h,e[14]=p):p=e[14],p}const Ei=x.lazy(()=>dr(()=>import("./sections-editor-BXoS4qpd.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])).then(t=>({default:t.SectionsEditor})));function us(t){const e=ue.c(50),{virtualMcpId:r,externalSelection:s,onViewJsonFile:i}=t,u=s===void 0?null:s,{org:c}=hn(),{currentBranch:d,taskId:o}=It(),l=ys(),h=gn(),p=_s(),f=l.lifecycle.phase==="running",P=h.previewUrl;let g;e[0]!==d||e[1]!==c||e[2]!==P||e[3]!==o||e[4]!==r?(g=d?{orgSlug:c.slug,virtualMcpId:r,branch:d,threadId:o??null,previewUrl:P}:null,e[0]=d,e[1]=c,e[2]=P,e[3]=o,e[4]=r,e[5]=g):g=e[5];const k=g;let b;e[6]!==f?(b={fetchEnabled:f},e[6]=f,e[7]=b):b=e[7];const v=vn(k,b);let C;e[8]!==f?(C={fetchEnabled:f},e[8]=f,e[9]=C):C=e[9];const y=Ps(k,C),w=ki({lifecyclePhase:l.lifecycle.phase,decofile:ds(v),meta:ds(y),hasEditableContent:Jr(v.data,y.data),fastPreviewActive:ws(r).runtime==="cms"}),S=Ni;if(w.kind==="loading"){let T;return e[10]===Symbol.for("react.memo_cache_sentinel")?(T=S(n.jsx(ur,{})),e[10]=T):T=e[10],T}if(w.kind==="empty"){let T;return e[11]===Symbol.for("react.memo_cache_sentinel")?(T=S(n.jsx(Si,{})),e[11]=T):T=e[11],T}if(w.kind==="error"){let T;e[12]!==v||e[13]!==h||e[14]!==y||e[15]!==w.source?(T=()=>{if(w.source==="sandbox"){h.retry();return}Promise.all([v.refetch(),y.refetch()])},e[12]=v,e[13]=h,e[14]=y,e[15]=w.source,e[16]=T):T=e[16];const ae=T;let Y;return e[17]!==ae||e[18]!==w.source?(Y=S(n.jsx(ji,{source:w.source,onRetry:ae})),e[17]=ae,e[18]=w.source,e[19]=Y):Y=e[19],Y}let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=T=>S(n.jsx("div",{className:"h-full min-h-0",children:T})),e[20]=j):j=e[20];const R=j,E=p.state.target;if(E?.kind==="loader"&&v.data&&y.data){const T=d??"",ae=P??null;let Y;return e[21]!==v.data||e[22]!==y.data||e[23]!==c.slug||e[24]!==T||e[25]!==ae||e[26]!==E.key||e[27]!==r?(Y=R(n.jsx(xi,{orgSlug:c.slug,virtualMcpId:r,branch:T,previewUrl:ae,meta:y.data,decofile:v.data,blockKey:E.key})),e[21]=v.data,e[22]=y.data,e[23]=c.slug,e[24]=T,e[25]=ae,e[26]=E.key,e[27]=r,e[28]=Y):Y=e[28],Y}let F;e[29]!==d||e[30]!==c.slug||e[31]!==E||e[32]!==r?(F=E||!d?null:Es(Ns(c.slug,r,d)),e[29]=d,e[30]=c.slug,e[31]=E,e[32]=r,e[33]=F):F=e[33];const U=F;let B="/",O=null,_=null;E?.kind==="page"?(B=E.path,O=E.key):E?.kind==="section"?_=E.key:U&&(B=U.path,O=U.pageKey);const D=O?`page:${O}`:_?`section:${_}`:`path:${B}`;let W;e[34]===Symbol.for("react.memo_cache_sentinel")?(W=n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(zt,{className:"size-5 text-muted-foreground"})}),e[34]=W):W=e[34];const M=d??"",X=P??void 0,V=_?null:u,A=!!O&&p.state.editSeoPageKey===O;let H;return e[35]!==_||e[36]!==O||e[37]!==B||e[38]!==D||e[39]!==i||e[40]!==c.slug||e[41]!==V||e[42]!==A||e[43]!==M||e[44]!==X||e[45]!==r||e[46]!==p.consumeEditSeo||e[47]!==p.setFocusedBlock||e[48]!==p.setVariantOverride?(H=R(n.jsx(x.Suspense,{fallback:W,children:n.jsx(Ei,{orgSlug:c.slug,virtualMcpId:r,branch:M,previewReady:!0,previewUrl:X,currentPath:B,activePageBlockKey:O,activeGlobalBlockKey:_,externalSelection:V,initialEditSeo:A,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:i},D)})),e[35]=_,e[36]=O,e[37]=B,e[38]=D,e[39]=i,e[40]=c.slug,e[41]=V,e[42]=A,e[43]=M,e[44]=X,e[45]=r,e[46]=p.consumeEditSeo,e[47]=p.setFocusedBlock,e[48]=p.setVariantOverride,e[49]=H):H=e[49],H}function Ni(t){return n.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function ln(t){const e=ue.c(39),{virtualMcpId:r,pageKey:s,onClose:i,ref:u}=t,c=Le(),d=fs(),o=Mr(r);let l;e[0]!==o||e[1]!==s?(l=zr(o,pa(s)),e[0]=o,e[1]=s,e[2]=l):l=e[2];const h=l,{org:p}=hn(),{currentBranch:f,taskId:P}=It(),k=gn().previewUrl;let b;e[3]!==f||e[4]!==p.slug||e[5]!==k||e[6]!==P||e[7]!==r?(b=f?{orgSlug:p.slug,virtualMcpId:r,branch:f,threadId:P??null,previewUrl:k}:null,e[3]=f,e[4]=p.slug,e[5]=k,e[6]=P,e[7]=r,e[8]=b):b=e[8];const C=vn(b),y=f??"";let w;e[9]!==p.slug||e[10]!==y||e[11]!==r?(w={orgSlug:p.slug,virtualMcpId:r,branch:y},e[9]=p.slug,e[10]=y,e[11]=r,e[12]=w):w=e[12];const{save:S,flush:j}=Ir(w),R=C.data?.[s],E=C.data===void 0&&C.isLoading,F=C.data!==void 0&&R===void 0,U=!f||F||E;let B;e[13]!==R?(B=R===void 0?"":JSON.stringify(R,null,2),e[13]=R,e[14]=B):B=e[14];const O=B;let _;e[15]!==s||e[16]!==U||e[17]!==S?(_=A=>{if(U)return;let H;try{H=JSON.parse(A)}catch{return}H===null||typeof H!="object"||Array.isArray(H)||S(s,H)},e[15]=s,e[16]=U,e[17]=S,e[18]=_):_=e[18];const D=_;let W;e[19]!==j?(W=()=>({flush:j}),e[19]=j,e[20]=W):W=e[20],x.useImperativeHandle(u,W);let M;e[21]!==h||e[22]!==d||e[23]!==i||e[24]!==c?(M=d?n.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:n.jsx("span",{title:h,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:h})}):n.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:c("sectionsEditor.pageJsonDialog.titleShort")}),n.jsx(Xe,{variant:"ghost",size:"icon",onClick:i,"aria-label":c("sectionsEditor.pageJsonDialog.close"),className:"size-7 shrink-0",children:n.jsx(ua,{size:14})})]}),e[21]=h,e[22]=d,e[23]=i,e[24]=c,e[25]=M):M=e[25];let X;e[26]!==C.data||e[27]!==j||e[28]!==O||e[29]!==E||e[30]!==F||e[31]!==s||e[32]!==U||e[33]!==D||e[34]!==c?(X=E?n.jsx("div",{className:"flex flex-1 items-center justify-center",children:n.jsx(zt,{className:"size-5 text-muted-foreground"})}):F?n.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",c("sectionsEditor.pageJsonDialog.pageNotFound")]}):n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(ma,{code:O,language:"json",readOnly:U,height:"100%",onChange:A=>D(A??""),onSave:A=>{D(A),j()}},`${s}:${C.data===void 0?"loading":"ready"}`)}),e[26]=C.data,e[27]=j,e[28]=O,e[29]=E,e[30]=F,e[31]=s,e[32]=U,e[33]=D,e[34]=c,e[35]=X):X=e[35];let V;return e[36]!==M||e[37]!==X?(V=n.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[M,X]}),e[36]=M,e[37]=X,e[38]=V):V=e[38],V}function Ms(t){return t.contentEditingEnabled&&!t.isMobile}function Ci(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Ri(t,e){return t==="blocks"?"preview":e?"blocks":t}function Ti(t){return Ms({contentEditingEnabled:Cs(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function Li(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}const Oi=500,_i={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},ms=1,cn=["desktop","mobile","tablet"],Bt={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function ps(t,e){try{const r=new URL(t,window.location.href);return r.searchParams.set("deviceHint",e),r.href}catch{return t}}function Ai(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 ht(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function dn(t,e){try{return new URL(t,e).href}catch{return null}}function Di(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 r={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:r,effective:r.url}}return{pin:t,effective:t?.url??null}}function $i(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Fi(t,e,r){const s=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),c=o=>{if(o===r)return 100;const l=o.indexOf(r);if(l===-1)return 0;let h=40;return l===0?h+=30:/[\s/-]/.test(o[l-1]??"")&&(h+=20),h+=Math.round(r.length/o.length*20),h};let d=Math.max(c(s),c(i));return u.at(-1)===r?d=Math.max(d,95):u.includes(r)&&(d=Math.max(d,90)),d}function Bi(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Mi({virtualMcpId:t}){const e=fs(),r=x.useRef(null),s=Le(),i=ia(),u=Tr(),{currentBranch:c,taskId:d,virtualMcpId:o}=It(),l=_s(),h=Sr(o===t?t:null),p=ws(t),f=fa(h?.metadata?.ui?.layout??null),P=Cs(f),g=Ms({contentEditingEnabled:P,isMobile:u}),[k,b]=x.useState(()=>Ti({cmsMode:f,isMobile:u})),[v,C]=x.useState("desktop"),[y,w]=x.useState(null),[S,j]=x.useState(null),R=x.useRef(null),E=x.useRef(null),[F,U]=x.useState(!1),B=x.useRef(null),O=()=>{B.current?.flush(),U(!1)},_=()=>U(a=>(a&&B.current?.flush(),!a)),[D,W]=x.useState({width:0,height:0}),[M,X]=x.useState(null),[V,A]=x.useState(!1),[H,T]=x.useState(""),[ae,Y]=x.useState(!1),[Ne,ee]=x.useState(),[$,ie]=x.useState(null),[G,Q]=x.useState(null),[we,te]=x.useState(null),[I,me]=x.useState(()=>l.state.target?.kind==="page"?l.state.target.path:"/"),[fe,ne]=x.useState(()=>l.state.target?.kind==="page"?l.state.target.key:null),[se,xe]=x.useState({}),[ce,he]=x.useState(!1),oe=x.useRef(null),ge=()=>{he(!0),oe.current&&clearTimeout(oe.current),oe.current=setTimeout(()=>he(!1),15e3)},it=()=>{oe.current&&(clearTimeout(oe.current),oe.current=null),he(!1)},{org:Oe}=hn(),be=ys(),Ce=gn(),Kt=Ce.vmEntry,pe=Ce.previewUrl,_e=be.lifecycle.phase,Ue=_e==="running",Fe=h?.id===t?Rr(h.metadata):null,ke=h?.id===t&&p.runtime==="cms",Be=p.projectDefault==="cms",ye=Xr({sandboxUrl:pe,previewServerUrl:Fe,fastPreviewActive:ke}),We=t&&c?{orgSlug:Oe.slug,virtualMcpId:t,branch:c,threadId:d??null,previewUrl:pe}:null,q=vn(We,{fetchEnabled:Ue}),Z=Ps(We,{fetchEnabled:Ue}),J=q.data,ve=Z.data,Ae=J?Yr(J).sort((a,m)=>a.name.localeCompare(m.name)):[],xt=t&&c?{orgSlug:Oe.slug,virtualMcpId:t,branch:c}:null,wn=gi(xt),bt=J&&ve?Qr(J,ve):[],kn=J&&ve?Kr(ve,J,"loaders"):[],Me=H?(()=>{const a=H.toLowerCase();return Ae.map(m=>({page:m,score:Fi(m.name,m.path,a)})).filter(({score:m})=>m>0).sort((m,N)=>N.score-m.score||m.page.path.length-N.page.path.length).map(({page:m})=>m)})():Ae,et=bt.filter(a=>{if(!H)return!0;const m=H.toLowerCase();return a.name.toLowerCase().includes(m)||a.key.toLowerCase().includes(m)||a.resolveType.toLowerCase().includes(m)}),Ht=g?kn:[],ot=Ht.filter(a=>{if(!H)return!0;const m=H.toLowerCase();return a.title.toLowerCase().includes(m)||a.key.toLowerCase().includes(m)||a.resolveType.toLowerCase().includes(m)}),Ve=G?kn.find(a=>a.key===G)??null:null,Re=xn,yt=$||G?null:Zr(Ae,I,fe),Ut=$?$.name:Ve?.title??yt?.name,K=yt?.key??null,ze=l.state.target?.kind==="section"?l.state.target.key:l.state.focusedBlockKey??K,wt=yt?.path??null,Ie=(K?se[K]:void 0)??{},Pe=He(I,Ie),kt={};if(Ue&&pe&&ve&&J){const a=Hr(ve,"loaders"),m=K?J[K]:void 0,N=Ka(m,J,le=>a.has(le)),L=Fa(N);for(const le of at(I)){if(le.type!=="param")continue;const De=Aa(I,le.name,N),je=za(De,a,L);je.length>0&&(kt[le.name]=je)}}const tt=t&&c?{orgSlug:Oe.slug,virtualMcpId:t,branch:c,threadId:d??null}:null,Pn=J&&K?Ur(J,K,0):[],Sn=J?Wr(Pn,J):[],Wt=Sn.map(a=>a.isSavedBlock?a.label:""),Vt=Sn.map(a=>a.isSavedBlock?"global":a.isMultivariate?"variant":"normal"),qt=Pn.map(a=>pn(a,J??{})),jn=x.useRef(null),Te=x.useRef(null),zs=be.status.state==="paused",Gt=be.phase,En=Vr({claimPhase:Gt,lifecycle:be.lifecycle}),qe=Ce.previewState,Is=Ce.userStopped,Ks=ra(Oe.slug,t??"",c??""),{url:Ge}=sa(ke&&t&&c?{orgSlug:Oe.slug,virtualMcpId:t,branch:c,previewServerUrl:Fe??null,path:Pe}:null),Hs=Be&&p.runtime==="sandbox",z=ya({previewState:qe,progressStatus:En.status,previewServerUrl:Fe,fastPreviewActive:ke,fastPreviewReady:!!Ge,codingSession:Hs}),lt=z.mode!=="none",Nn=z.mode==="production"&&z.iframeBase?ht(z.iframeBase):null,Us=!i,nt=z.mode==="production"?Nn:ht(pe),Ws=h?.id===t&&h.metadata?.fastPreviewInPlace===!0,ct=z.mode==="production"&&ke&&Ws&&g&&k==="blocks",Cn=x.useRef(null),{pin:Vs,effective:qs}=Di(Cn.current,{inPlaceRenderActive:ct,draftPreviewUrl:Ge,resolvedPath:Pe});Cn.current=Vs;const Se=Ai(z.mode==="sandbox"?Dt(ps(we??dn(Pe,z.iframeBase)??z.iframeBase,v),l.state.variantOverride??[]):z.mode==="production"&&Us?Dt(ps(ea(we??qs??dn(Pe,z.iframeBase)??z.iframeBase,z.showWakingPill?ta:null),v),l.state.variantOverride??[]):null);x.useEffect(()=>{},[i,Nn,M]);const Jt="sandbox.preview.openInNewTab",Rn=Ge??(z.iframeBase?dn(Pe,z.iframeBase):null),Gs=z.mode==="production"?Rn?Dt(Rn,l.state.variantOverride??[]):null:Se??z.iframeBase,Tn=async()=>{const a=Gs;if(a){window.open(a,"_blank","noopener");return}},Pt=t&&c?Ns(Oe.slug,t,c):null,St=a=>{Pt&&aa(Pt,a)},de=l.state.target;x.useEffect(()=>{if(!(!de||!ye||!ve))if(de.kind==="page"){const a=se[de.key]??{};Te.current=He(de.path,a),ie(null),Q(null),te(null),ne(de.key),me(de.path),St({path:de.path,pageKey:de.key,params:a})}else if(de.kind==="loader")Te.current=null,ie(null),Q(de.key),te(null);else{const a=bt.find(m=>m.key===de.key);if(a){Te.current=null;const m=Zn(ve);Q(null),ie(a),te(Xn(ye,m,a.key))}}},[de,ye,ve,se]),x.useEffect(()=>{!K||wt===null||de?.kind==="page"&&de.key===K&&de.path===wt||l.selectTarget({kind:"page",key:K,path:wt})},[K,wt,de]);const[Ln,Js]=x.useState(null);if(qe.kind==="iframe"&&Ln!==qe.previewUrl){const a=Ln!==null;Js(qe.previewUrl);const m=Pt?Es(Pt):null;if(m){if(Te.current=He(m.path,m.params),me(m.path),ne(m.pageKey),te(null),ie(null),Q(null),m.pageKey&&Object.keys(m.params).length>0){const N=m.pageKey;xe(L=>({...L,[N]:m.params}))}}else a&&(Te.current=null,me("/"),te(null),ne(null),ie(null),Q(null))}jn.current=Se;const On=Sa({iframeRef:R,src:z.mode==="sandbox"?Se:null,active:z.mode==="sandbox"}),_n=x.useRef(null);x.useEffect(()=>{if(!Ge||!Se||_n.current===Ge)return;_n.current=Ge;const a=R.current;a&&a.getAttribute("src")!==Se&&(ge(),a.src=Se)},[Ge,Se]);const An=()=>{const a=R.current?.contentWindow,m=nt;if(!a||!m||!J||!K)return;const N=J[K];if(!N||typeof N!="object")return;const L=na({previewBaseUrl:m,pageBlock:N,decofile:J,path:Pe,pathTemplate:I});if(!L)return;const le=Dt(L.src,l.state.variantOverride??[]);a.postMessage({type:"cms-editor::render",src:le,body:L.body},m)},Yt=x.useRef(null);x.useEffect(()=>{if(!ct||$||G||!K||!J){Yt.current=null;return}const a={nav:JSON.stringify({page:K,path:Pe,pathTemplate:I}),content:JSON.stringify(J)},m=$i(Yt.current,a);Yt.current=a,m&&An()},[J,ct,$,G,K,Pe,I]);const Qt=x.useRef(null);x.useEffect(()=>{if(!ct||$||G||!K||!J){Qt.current=null;return}const a=JSON.stringify(l.state.variantOverride??null),m=Qt.current;Qt.current={page:K,sig:a},!(!m||m.page!==K||m.sig===a)&&An()},[l.state.variantOverride,ct,$,G,K]);const Ys=!!t&&!!c&&!be.notFound&&!Is&&!zs&&(Gt?.kind==="ready"||_e!=="idle"),re=Li({editingMode:k,sandboxDisplay:z.mode==="sandbox",blocksEditingEnabled:g});x.useEffect(()=>{const a=nt;if(!a)return;const m=N=>{if(N.origin===a)if(N.data?.type==="visual-editor::element-clicked"){const L=ja.safeParse(N.data.payload);L.success&&w(L.data)}else if(N.data?.type==="cms-editor::section-clicked"){const L=Ca.safeParse(N.data.payload);L.success&&j({index:L.data.sectionIndex,seq:L.data.clickSeq})}else N.data?.type==="cms-editor::render-start"?ge():N.data?.type==="cms-editor::render-end"?(it(),R.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:Wt,kinds:Vt,keys:qt},a)):N.data?.type==="cms-editor::render-error"&&it()};return window.addEventListener("message",m),()=>window.removeEventListener("message",m)},[nt,Wt,Vt,qt]);const Dn=()=>{const a=R.current?.contentWindow,m=ht(pe);!a||!m||a.postMessage({type:"visual-editor::activate",script:Ea},m)},Qs=()=>{const a=R.current?.contentWindow,m=ht(pe);!a||!m||a.postMessage({type:"visual-editor::deactivate"},m)},Zt=()=>{const a=R.current?.contentWindow,m=nt;!a||!m||(a.postMessage(z.mode==="production"?{type:"editor::inject",args:{script:rs}}:{type:"visual-editor::activate",script:rs},m),a.postMessage({type:"cms-editor::set-labels",labels:Wt,kinds:Vt,keys:qt},m))},Zs=()=>{const a=R.current?.contentWindow,m=nt;!a||!m||a.postMessage({type:"cms-editor::deactivate"},m)},Xs=()=>{const a=R.current?.contentWindow,m=nt;!a||!m||(a.postMessage({type:"cms-editor::clear-hover"},m),a.postMessage({type:"visual-editor::clear-hover"},m))},jt=a=>{if(a==="blocks"&&!g)return;const m=k;!u&&a!==m&&(a==="blocks"?E.current?.resize("30%"):E.current?.collapse()),b(a),w(null),j(null),a!=="blocks"&&Q(null),m==="visual"&&Qs(),a==="visual"&&Dn(),m==="blocks"&&a!=="blocks"&&Zs(),a==="blocks"&&Zt()},$n=()=>{jt(Ci(k,g))},er=()=>{jt(Ri(k,g))},tr=()=>{if(!R.current||!Se)return;ge();const a=R.current;a.src=Se};Er(()=>{const a=R.current;if(!a)return;ge();const m=document.activeElement,N=a.tabIndex;a.tabIndex=-1,a.style.pointerEvents="none",a.blur(),Bi(a,jn.current);let L;const le=()=>{clearTimeout(L),a.tabIndex=N,a.style.pointerEvents="";const De=document.activeElement;(!De||De===document.body||De===a)&&m?.focus(),a.removeEventListener("load",le)};a.addEventListener("load",le),L=setTimeout(le,3e3)});const Fn=()=>{const a=cn.indexOf(v);C(cn[(a+1)%cn.length])},dt=(a,m)=>{if(!K)return;const N=K,L={...Ie,[a]:m};Te.current=He(I,L),xe(le=>({...le,[N]:L})),St({path:I,pageKey:N,params:L})},Et=fi({iframeBase:z.iframeBase,resolvedPath:Pe,activeGlobalSectionName:$?.name??null,noServerLabel:s("sandbox.preview.noServerRunning")}),Nt=a=>{const m=se[a.key]??{},N=He(a.path,m);($||Re(N)!==Re(Pe))&&ge(),Te.current=N,ie(null),Q(null),te(null),j(null),ne(a.key),me(a.path),St({path:a.path,pageKey:a.key,params:m}),l.selectTarget({kind:"page",key:a.key,path:a.path})},Bn=a=>{if(!ye||!ve){Wn.error(s("sandbox.preview.previewMetadataNotReady"));return}ge(),Te.current=null;const m=Zn(ve),N=Xn(ye,m,a.key);ie(a),Q(null),te(N),j(null),l.selectTarget({kind:"section",key:a.key})},Mn=a=>{g&&(ie(null),Q(a.key),te(null),jt("blocks"),l.selectTarget({kind:"loader",key:a.key}))},nr=async({name:a,path:m,templateKey:N})=>{if(!t||!c)return;const L=js(m);if(L){ee(L);return}const le=m.trim().startsWith("/")?m.trim():`/${m.trim()}`;if(Ae.some(je=>Re(je.path)===Re(le))){ee(s("sandbox.preview.pageAlreadyExists",{path:le}));return}let De;if(N&&(De=J?.[N],!De)){ee(s("sandbox.preview.templateNoLongerExists"));return}ee(void 0);try{const je=await wn.mutateAsync({name:a,path:le,template:De});Y(!1),Wn.success(s("sandbox.preview.pageCreated",{name:a})),await Cr(Oi),Nt({key:je.key,name:je.name,path:je.path}),jt("blocks")}catch(je){ee(je instanceof Error?je.message:s("sandbox.preview.failedToCreatePage"))}},ut=lt&&(Ys||z.mode==="production"),zn=hi({showPreviewToolbar:ut,contentEditingEnabled:P}),Ct=()=>{A(!1),T("")},Rt=ht(Fe??pe),Tt=$?.name??Ve?.title??yt?.name,Lt=$?`section:${$.key}`:G?`loader:${G}`:K?`page:${K}`:void 0,sr=ut?zn?n.jsxs(wr,{open:V,onOpenChange:a=>{A(a),a||T("")},children:[n.jsx(kr,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":s("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:$||Ve?Tt:[Rt,Tt,I].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-0 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-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[!$&&!Ve&&Rt&&n.jsx("span",{"data-testid":"preview-page-origin",className:"flex min-w-0 max-w-56 items-center border-r border-border/60 bg-muted/60 px-2 font-mono text-muted-foreground @max-xl/panel-toolbar:max-w-1/4",children:n.jsx("span",{className:"truncate",children:Rt})}),n.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:[$&&n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[n.jsx(nn,{size:11}),s("sandbox.preview.globalBadge")]}),Ve&&n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:[n.jsx(en,{size:11}),s("sandbox.preview.loaderBadge")]}),(Tt||!Rt)&&n.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:Tt??Et}),!$&&!Ve&&n.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:I}),n.jsx(Vn,{size:12,className:Ke("shrink-0 transition-transform",V&&"rotate-180")})]})]})}),n.jsxs(Pr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[n.jsxs(vs,{shouldFilter:!1,defaultValue:Lt,children:[n.jsx(xs,{value:H,onValueChange:T,placeholder:s("sandbox.preview.searchPagesAndComponents")}),n.jsxs(gs,{className:"max-h-80",children:[n.jsx(bs,{children:Ae.length===0&&bt.length===0&&Ht.length===0?s("sandbox.preview.noPagesFound"):s("sandbox.preview.noSearchResults")}),Me.length>0&&n.jsx(gt,{children:Me.map(a=>n.jsxs(vt,{value:`page:${a.key}`,"aria-current":Lt===`page:${a.key}`||void 0,title:`${a.name} · ${a.path}`,onSelect:()=>{Ct(),Nt(a)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:a.name}),n.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:a.path})]},a.key))}),et.length>0&&n.jsx(gt,{heading:s("sandbox.preview.globalComponents"),children:et.map(a=>n.jsx(vt,{value:`section:${a.key}`,"aria-current":Lt===`section:${a.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Bn(a)},children:n.jsx("span",{className:"truncate",children:a.name})},a.key))}),ot.length>0&&n.jsx(gt,{heading:s("sandbox.preview.globalLoaders"),children:ot.map(a=>n.jsx(vt,{value:`loader:${a.key}`,"aria-current":Lt===`loader:${a.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Mn(a)},children:n.jsx("span",{className:"truncate",children:a.title})},a.key))})]})]}),!$&&!G&&at(I).some(a=>a.type!=="text")&&n.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:at(I).map((a,m)=>{if(a.type==="text")return n.jsx("span",{children:a.text},`text-${m}`);const N=kt[a.name];return N&&tt?n.jsx(ls,{sources:N,template:I,paramName:a.name,value:Ie[a.name]??"",sandboxRef:tt,onCommit:L=>dt(a.name,L)},`${K}:${a.name}`):n.jsx(cs,{name:a.name,value:Ie[a.name]??"",onCommit:L=>dt(a.name,L)},`${K}:${a.name}`)})}),n.jsx("div",{className:"border-t p-1.5",children:n.jsxs(Xe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ct(),ee(void 0),Y(!0)},children:[n.jsx(Qn,{size:16}),s("sandbox.preview.createNewPage")]})})]})]}):n.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Et}):null,In=ut||P?n.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[n.jsxs(Je,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx($e,{onClick:Fn,"aria-label":s(Bt[v]),children:v==="mobile"?n.jsx(qn,{size:16}):v==="tablet"?n.jsx(Gn,{size:16}):n.jsx(Jn,{size:16})})}),n.jsx(Qe,{children:s(Bt[v])})]}),sr,n.jsx("div",{className:"flex shrink-0 items-center gap-1",children:n.jsx($e,{onClick:()=>{Tn()},"aria-label":s(Jt),children:n.jsx(un,{size:16})})})]}):null,Ot=!e&&ut?n.jsxs(n.Fragment,{children:[n.jsxs(Je,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx($e,{onClick:tr,"aria-label":s("sandbox.preview.refresh"),children:n.jsx(mr,{size:16})})}),n.jsx(Qe,{side:"bottom",children:s("sandbox.preview.refresh")})]}),zn?n.jsxs("div",{ref:r,className:"relative min-w-0 w-64 shrink",children:[n.jsxs("div",{className:"flex h-7 w-full min-w-0 items-center rounded-md border border-border bg-background transition-colors duration-200 hover:bg-accent",children:[n.jsxs("div",{className:"flex h-full min-w-0 flex-1 cursor-pointer items-center gap-1 pl-2 pr-1",onClick:()=>A(a=>!a),children:[$&&n.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[n.jsx(nn,{size:11}),s("sandbox.preview.globalBadge")]}),Ve&&n.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:[n.jsx(en,{size:11}),s("sandbox.preview.loaderBadge")]}),n.jsx("span",{className:Ke("text-[13px] font-medium text-foreground",Ut==null?"min-w-0 flex-1 truncate":"min-w-0 shrink truncate"),children:Ut??Et}),!$&&!G&&Ut!=null&&I&&n.jsx("span",{className:"flex min-w-0 flex-1 items-center overflow-hidden whitespace-nowrap text-[12px] text-muted-foreground",children:at(I).map((a,m)=>{if(a.type==="text")return n.jsx("span",{className:Ke(m===0?"min-w-0 truncate":"shrink-0"),children:a.text},`text-${m}`);const N=kt[a.name];return N&&tt?n.jsx(ls,{sources:N,template:I,paramName:a.name,value:Ie[a.name]??"",sandboxRef:tt,onCommit:L=>dt(a.name,L)},`${K}:${a.name}`):n.jsx(cs,{name:a.name,value:Ie[a.name]??"",onCommit:L=>dt(a.name,L)},`${K}:${a.name}`)})})]}),n.jsx("button",{type:"button",className:"flex h-full shrink-0 items-center pl-1 pr-2",onClick:()=>A(a=>!a),"aria-label":s("sandbox.preview.choosePage"),"aria-expanded":V,children:n.jsx(Vn,{size:12,className:Ke("shrink-0 text-muted-foreground transition-transform",V&&"rotate-180")})})]}),V&&n.jsxs("div",{className:"absolute left-1/2 top-full z-50 mt-1.5 w-[500px] max-w-[calc(100vw-2rem)] -translate-x-1/2 overflow-hidden rounded-lg border bg-popover shadow-lg",children:[n.jsxs("div",{className:"px-2 h-10 flex items-center gap-2 border-b",children:[n.jsx(yr,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),n.jsx("input",{type:"text",value:H,onChange:a=>T(a.target.value),onKeyDown:a=>{if(a.key!=="Enter")return;const m=H.trim();if(!m)return;const N=Me.find(L=>Re(L.path)===Re(m));N&&(a.preventDefault(),A(!1),T(""),Nt(N))},placeholder:s("sandbox.preview.searchPagesAndComponents"),className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground",autoFocus:!0})]}),n.jsx("div",{className:"p-1.5 border-b",children:n.jsxs("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:a=>{a.preventDefault(),A(!1),T(""),ee(void 0),Y(!0)},children:[n.jsx(Qn,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"flex-1 font-medium",children:s("sandbox.preview.createNewPage")})]})}),Me.length===0&&et.length===0&&ot.length===0?n.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:Ae.length===0&&bt.length===0&&Ht.length===0?s("sandbox.preview.noPagesFound"):s("sandbox.preview.noSearchResults")}):n.jsxs("div",{className:"max-h-80 overflow-y-auto overscroll-contain",children:[Me.length>0&&n.jsx("div",{className:"p-1.5",children:Me.map(a=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:m=>{m.preventDefault(),A(!1),T(""),Nt(a)},children:[n.jsx(Yn,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:a.name}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.path})]},a.key))}),et.length>0&&n.jsxs("div",{className:Ke("p-1.5",Me.length>0&&"border-t"),children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:s("sandbox.preview.globalComponents")}),et.map(a=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:m=>{m.preventDefault(),A(!1),T(""),Bn(a)},children:[n.jsx(nn,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:a.name}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.resolveType.split("/").pop()?.replace(/\.tsx?$/,"")})]},a.key))]}),ot.length>0&&n.jsxs("div",{className:Ke("p-1.5",(Me.length>0||et.length>0)&&"border-t"),children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:s("sandbox.preview.globalLoaders")}),ot.map(a=>n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",onMouseDown:m=>{m.preventDefault(),A(!1),T(""),Mn(a)},children:[n.jsx(en,{size:16,className:"shrink-0 text-muted-foreground"}),n.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:a.title}),n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.resolveType.split("/").pop()?.replace(/\.tsx?$/,"")})]},a.key))]})]})]})]}):n.jsx("span",{className:"min-w-0 truncate px-2 text-[13px] text-muted-foreground",children:Et}),n.jsxs(Je,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx($e,{"aria-label":s(Jt),onClick:()=>{Tn()},children:n.jsx(un,{size:16})})}),n.jsx(Qe,{side:"bottom",children:s(Jt)})]})]}):null,rr=Ot?n.jsx("div",{className:"flex min-w-0 items-center gap-0.5",children:Ot}):null,Kn=z.mode==="sandbox",_t=_i[v],At=v==="desktop"&&(D.width===0||D.width>=_t.width+2*ms),Hn=At?1:Math.min(D.width>0?D.width/(_t.width+2*ms):1,1),ar=At?{width:"100%",height:"100%"}:{width:`${_t.width}px`,height:D.height>0?`${D.height/Hn}px`:`${_t.height}px`,transform:`scale(${Hn})`,transformOrigin:"top center"},Un=n.jsxs(n.Fragment,{children:[Kn&&(ut||P)&&n.jsx($e,{onClick:$n,"aria-pressed":re==="visual","aria-label":s("sandbox.preview.visualEditor"),active:re==="visual",children:n.jsx(tn,{size:16})}),g&&n.jsxs(Je,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx($e,{onClick:er,"aria-pressed":re==="blocks","aria-label":s("sandbox.preview.blocksEditor"),active:re==="blocks",children:n.jsx(Yn,{size:16})})}),n.jsx(Qe,{children:s("sandbox.preview.blocksEditor")})]}),ze&&n.jsxs(Je,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx($e,{onClick:_,"aria-pressed":F,"aria-label":s("sectionsEditor.sectionsEditor.viewJson"),active:F,children:n.jsx(br,{size:16})})}),n.jsx(Qe,{children:s("sectionsEditor.sectionsEditor.viewJson")})]})]}),ir=!e&&lt?n.jsx("div",{className:"absolute bottom-4 left-1/2 z-20 -translate-x-1/2 scale-125",children:n.jsxs("div",{className:"flex items-center gap-0.5 rounded-full border bg-background/60 p-1 shadow-lg backdrop-blur-md",children:[Kn&&n.jsxs(n.Fragment,{children:[n.jsxs(Je,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx($e,{onClick:$n,"aria-pressed":re==="visual","aria-label":s("sandbox.preview.visualEditor"),active:re==="visual",className:"rounded-full",children:n.jsx(tn,{size:16})})}),n.jsx(Qe,{side:"top",children:s("sandbox.preview.visualEditor")})]}),n.jsx("div",{className:"mx-0.5 h-5 w-px bg-border"})]}),n.jsxs(Je,{children:[n.jsx(Ye,{asChild:!0,children:n.jsx($e,{onClick:Fn,"aria-label":s(Bt[v]),className:"rounded-full",children:n.jsxs("span",{className:"flex items-center justify-center animate-device-icon-pop",children:[v==="mobile"&&n.jsx(qn,{size:16}),v==="tablet"&&n.jsx(Gn,{size:16}),v==="desktop"&&n.jsx(Jn,{size:16})]},v)})}),n.jsx(Qe,{side:"top",children:s(Bt[v])})]})]})}):null,or=!!G&&re==="blocks";return n.jsxs("div",{className:"flex flex-col w-full h-full",children:[tt&&Object.entries(kt).map(([a,m])=>(Ie[a]??"")===""?n.jsx(ui,{sources:m,template:I,paramName:a,sandboxRef:tt,onFill:N=>dt(a,N)},`${K}:${a}`):null),e?n.jsxs(n.Fragment,{children:[n.jsx(Xt.Toolbar.Center.Portal,{fallback:n.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:In}),children:In}),n.jsx(Xt.Toolbar.Right.Portal,{fallback:Un,children:Un})]}):n.jsx(n.Fragment,{children:n.jsx(Xt.Topbar.Center.Portal,{fallback:Ot&&n.jsxs("div",{className:"@container/panel-header relative flex h-12 shrink-0 items-center gap-2 border-b border-border/60 px-3 md:px-4",children:[n.jsx("div",{className:"flex-1"}),n.jsx("div",{className:"flex min-w-0 shrink items-center justify-center gap-0.5",children:Ot}),n.jsx("div",{className:"flex-1"})]}),children:rr})}),n.jsx("div",{className:"flex-1 overflow-hidden compact:relative",children:or?n.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[n.jsx(us,{virtualMcpId:t,externalSelection:S,onViewJsonFile:_}),F&&ze&&n.jsx("div",{className:"absolute inset-0 z-10",children:n.jsx(ln,{ref:B,virtualMcpId:t,pageKey:ze,onClose:O})})]}):n.jsxs(ts,{orientation:"horizontal",disabled:re!=="blocks",className:"relative isolate",children:[n.jsx(mt,{ref:E,id:"preview-blocks-editor",defaultSize:re==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:re==="blocks"&&n.jsx(us,{virtualMcpId:t,externalSelection:S,onViewJsonFile:_})}),re==="blocks"&&n.jsx(an,{withHandle:!0}),n.jsx(mt,{id:"preview-canvas",defaultSize:re==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden compact:relative compact:z-0",children:n.jsxs(ts,{orientation:"horizontal",disabled:!(F&&ze),children:[!e&&F&&ze&&n.jsxs(n.Fragment,{children:[n.jsx(mt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:n.jsx(ln,{ref:B,virtualMcpId:t,pageKey:ze,onClose:O})}),n.jsx(an,{withHandle:!0})]}),n.jsx(mt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:n.jsxs("div",{ref:a=>{if(!a)return;const m=()=>W(L=>L.width===a.clientWidth&&L.height===a.clientHeight?L:{width:a.clientWidth,height:a.clientHeight});m();const N=new ResizeObserver(m);return N.observe(a),()=>N.disconnect()},className:Ke("h-full relative overflow-clip flex justify-center",lt&&!At&&"bg-muted/30"),children:[(ce||Ks)&&lt&&n.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:n.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),z.showBlockingOverlay&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(rn,{kind:"starting",progress:En,claimPhase:Gt})}),qe.kind==="suspended"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(rn,{kind:"suspended",onResume:Ce.resume})}),qe.kind==="errored"&&n.jsx("div",{className:"absolute inset-0 z-30",children:n.jsx(rn,{kind:"errored",error:qe.error,onRetry:Ce.retry,connectionsHref:`/${Oe.slug}/settings/connections`})}),z.showWakingPill&&n.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 border border-border bg-muted px-4 py-3 shadow-lg pointer-events-none select-none",children:[n.jsx(zt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-sm font-medium text-foreground",children:s("sandbox.preview.startingPreview")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:s("sandbox.preview.startingPreviewHint")})]})]}),re==="visual"&&!y&&n.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-violet-400/40 bg-violet-500/90 px-3 py-1 text-xs font-medium text-white shadow-md backdrop-blur-sm pointer-events-none select-none",children:[n.jsx(tn,{size:12}),s("sandbox.preview.clickElementToAsk")]}),re==="visual"&&y&&n.jsx(La,{element:y,onDismiss:()=>w(null)}),ir,lt&&Se&&n.jsx("div",{className:Ke("shrink-0",!At&&"border-x border-border bg-background shadow-sm"),style:ar,onMouseLeave:Xs,children:n.jsx("iframe",{ref:R,src:Se,className:"w-full h-full border-0",title:s("sandbox.preview.devServerPreviewTitle"),onError:On.handleError,onLoad:()=>{if(On.handleLoad(),it(),z.mode!=="sandbox"){z.mode==="production"&&!z.showWakingPill&&re==="blocks"&&Zt();return}if(pr("vm_preview_loaded",{view_mode:re,vm_id:Kt?.sandboxHandle??null}),!$)try{const a=R.current?.contentWindow?.location?.pathname;if(!a)return;const m=Te.current;if(m!==null&&(Te.current=null,Re(a)!==Re(m))||Re(a)===Re(Pe))return;me(a),St({path:a,pageKey:fe,params:Ie})}catch{}re==="visual"&&Dn(),re==="blocks"&&Zt()}},z.iframeBase)})]})}),e&&F&&ze&&n.jsxs(n.Fragment,{children:[n.jsx(an,{withHandle:!0}),n.jsx(mt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:n.jsx(ln,{ref:B,virtualMcpId:t,pageKey:ze,onClose:O})})]})]})})]})}),n.jsx(vi,{open:ae,onOpenChange:Y,isPending:wn.isPending,error:Ne,templates:Ae,onSubmit:nr})]})}function zi(t){const e=ue.c(22),{virtualMcpId:r}=t,s=Le(),i=jr(r),{activeTask:u,taskId:c,currentBranch:d}=It(),o=va(c),[l,h]=x.useState(!1);if(ga({threadId:c,sandboxBranch:u?.branch??d,agentHasRepo:on(i?.metadata),threadHasRepo:on(o)||on(u?.metadata)})==="none"){let P;e[0]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:n.jsx(ns,{className:"size-7 text-foreground"})}),e[0]=P):P=e[0];let g;e[1]!==s?(g=s("mainPanelTabs.previewTab.noSourceToPreview"),e[1]=s,e[2]=g):g=e[2];let k;e[3]!==s?(k=s("mainPanelTabs.previewTab.connectGithubDescription"),e[3]=s,e[4]=k):k=e[4];let b,v;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=()=>h(!0),v=n.jsx(ns,{className:"size-4"}),e[5]=b,e[6]=v):(b=e[5],v=e[6]);let C;e[7]!==s?(C=s("mainPanelTabs.previewTab.connectGithub"),e[7]=s,e[8]=C):C=e[8];let y;e[9]!==C?(y=n.jsxs(Xe,{onClick:b,children:[v,C]}),e[9]=C,e[10]=y):y=e[10];let w;e[11]!==g||e[12]!==k||e[13]!==y?(w=n.jsx(bn,{className:"h-full",image:P,title:g,description:k,actions:y}),e[11]=g,e[12]=k,e[13]=y,e[14]=w):w=e[14];let S;e[15]!==l?(S=n.jsx(ha,{open:l,onOpenChange:h,mode:"agent"}),e[15]=l,e[16]=S):S=e[16];let j;return e[17]!==w||e[18]!==S?(j=n.jsxs(n.Fragment,{children:[w,S]}),e[17]=w,e[18]=S,e[19]=j):j=e[19],j}let f;return e[20]!==r?(f=n.jsx(Mi,{virtualMcpId:r}),e[20]=r,e[21]=f):f=e[21],f}function ld(){const t=ue.c(2),e=xa();let r;return t[0]!==e?(r=n.jsx(fr,{tabId:"site-editor",children:n.jsx(hr,{feature:"cms",children:n.jsx(zi,{virtualMcpId:e})})}),t[0]=e,t[1]=r):r=t[1],r}export{ld as default};