decocms 4.518.0 → 4.518.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (412) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-DC4ySNWR.js → ActiveShapeUtils-EYkJV7tD.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-DgnxHqxe.js → AlertCircle-CzTXJ0ax.js} +1 -1
  3. package/dist/client/assets/{AreaChart-Ccsbdjec.js → AreaChart-8lCOmLfE.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BJ1448l4.js → ArrowLeft-BQThfb60.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-723TVuFG.js → ArrowUp-DUhCibLH.js} +1 -1
  6. package/dist/client/assets/{BarChart-BdOKvWnK.js → BarChart-2wCpTPJ2.js} +1 -1
  7. package/dist/client/assets/{Building02-DU823ZCw.js → Building02-BOLEL9nK.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-3-g5kX2i.js → CartesianChart-CmRg3x8T.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-CinaMpxG.js → CategoricalChart-BtQQT8Ex.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-C7csYE-y.js → CheckCircle-OCgBlAwW.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-B0Z7parR.js → ChevronSelectorVertical-DaDJpoIU.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-DiTVmUiH.js → ChevronUp-DtSKb4be.js} +1 -1
  13. package/dist/client/assets/{Copy01-DRNuKy-h.js → Copy01-DVWv3lef.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-C3f2i_qY.js → CreditCard01-Bw5uGiku.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-eX97dPc6.js → DotsVertical-CEoX1VVK.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-CCb5UZ88.js → ErrorBarContext-i8geYMQV.js} +1 -1
  17. package/dist/client/assets/{Globe04-ByvV2bPX.js → Globe04-CMBPkECo.js} +1 -1
  18. package/dist/client/assets/{Image01-QuVxFosz.js → Image01-D_y3XkIW.js} +1 -1
  19. package/dist/client/assets/{Key01-C-QXsN23.js → Key01-p2EsnMlr.js} +1 -1
  20. package/dist/client/assets/{Link01-CbpFxbNY.js → Link01-D28gAr0F.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-DDgMbBWJ.js → LinkBroken01-Dz2vlPBe.js} +1 -1
  22. package/dist/client/assets/{Minus-DnJ8wbLv.js → Minus-DNpWuD14.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DD5_JCl8.js → Monitor01-CYm-wjzD.js} +1 -1
  24. package/dist/client/assets/{Play-BgEaB30r.js → Play-cNq95jJS.js} +1 -1
  25. package/dist/client/assets/{Plus-BnqPSlPj.js → Plus-C4rGoU1F.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-PgVE-Dmr.js → ReferenceLine-BvmA07RC.js} +1 -1
  27. package/dist/client/assets/{SearchMd-GQAKwnQD.js → SearchMd-BYCOzBqa.js} +1 -1
  28. package/dist/client/assets/{Sector-DG1U_Qdd.js → Sector-23KRNcXn.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-DVHnZchK.js → ShoppingBag01-DvN3FHxE.js} +1 -1
  30. package/dist/client/assets/{Sun-Ct5gftPt.js → Sun-DFIh8Vd-.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-_kdH1ete.js → SwitchHorizontal01-D6mwjnXs.js} +1 -1
  32. package/dist/client/assets/{Tool01-rTZNmFct.js → Tool01-_CVpzZpk.js} +1 -1
  33. package/dist/client/assets/{Trash01-TPK4gSsp.js → Trash01-CgNTH-jr.js} +1 -1
  34. package/dist/client/assets/{Upload01-D6tRQTgc.js → Upload01-CiTZ5ZQQ.js} +1 -1
  35. package/dist/client/assets/{User01-1q78INo2.js → User01-vLr2BfmM.js} +1 -1
  36. package/dist/client/assets/{UserSquare-B_yRFcN6.js → UserSquare-B7fe7FYj.js} +1 -1
  37. package/dist/client/assets/{Users01-D5MhP5r0.js → Users01-BgSWeeD_.js} +1 -1
  38. package/dist/client/assets/{XClose-DOXmYMF_.js → XClose-B_rQyiiY.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-DLICjI1h.js → ZoomOut-DzrH576O.js} +1 -1
  40. package/dist/client/assets/{access-gate-p2OBWc28.js → access-gate-CjdHb0j3.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-BluC5xOJ.js → add-connection-dialog-DyCA7E5B.js} +1 -1
  42. package/dist/client/assets/agent-analytics-C_1r2ktq.js +1 -0
  43. package/dist/client/assets/agent-app-DADhKCUS.js +1 -0
  44. package/dist/client/assets/{agent-assets-CsYWD2CR.js → agent-assets-AUU4xJcf.js} +1 -1
  45. package/dist/client/assets/{agent-automation-J7szToQ3.js → agent-automation-H4qJ1HOM.js} +1 -1
  46. package/dist/client/assets/{agent-automations-tGwSufFx.js → agent-automations-BCHMa4q1.js} +1 -1
  47. package/dist/client/assets/agent-calendar-BIC31eZQ.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-Bf7YpJtB.js → agent-connect-sources-DO6Zn3Mx.js} +1 -1
  49. package/dist/client/assets/agent-deck-DfcsXmVh.js +1 -0
  50. package/dist/client/assets/{agent-e2e-B01kqUsN.js → agent-e2e-BswlcjA7.js} +1 -1
  51. package/dist/client/assets/agent-experiments-DacDH6n9.js +1 -0
  52. package/dist/client/assets/agent-file-DvvjQBtI.js +1 -0
  53. package/dist/client/assets/{agent-hosting-8jYjdLhJ.js → agent-hosting-CgIJCVf2.js} +1 -1
  54. package/dist/client/assets/{agent-icon-g2PIrjzs.js → agent-icon-BVqmbz-P.js} +1 -1
  55. package/dist/client/assets/agent-library-D07m5-2P.js +1 -0
  56. package/dist/client/assets/agent-library-file-CKXkh_Ag.js +1 -0
  57. package/dist/client/assets/agent-monitor-T2Kisepj.js +1 -0
  58. package/dist/client/assets/{agent-overview-uVNzU6d3.js → agent-overview-BnCn329o.js} +1 -1
  59. package/dist/client/assets/{agent-releases-DVFEJ-Ad.js → agent-releases-PaWDRDlN.js} +1 -1
  60. package/dist/client/assets/agent-settings-CtpQVMq0.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-DI9lfD7X.js → agent-site-editor-Dgv9OUYF.js} +1 -1
  62. package/dist/client/assets/agent-site-editor-code-DEyTlk7z.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-CO78zdWN.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-C8DxePtH.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-Bhzmxyux.js → agent-view-guard-CIz__L_S.js} +1 -1
  66. package/dist/client/assets/agent-view-zDoYJpqf.js +1 -0
  67. package/dist/client/assets/{agents-list-CbFcTa4A.js → agents-list-B9ydQIh8.js} +1 -1
  68. package/dist/client/assets/{ai-providers-Da7yjmwG.js → ai-providers-BvGFGpkW.js} +1 -1
  69. package/dist/client/assets/{alert-kpgdNVxk.js → alert-COKmPgNZ.js} +1 -1
  70. package/dist/client/assets/{alert-dialog-KKnJELoX.js → alert-dialog-Bbqu21pF.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-DlComRmC.js → analytics-sections-CXA9Djw5.js} +1 -1
  72. package/dist/client/assets/{analytics-tab-B_HbOlqF.js → analytics-tab-CNbGVSyT.js} +2 -2
  73. package/dist/client/assets/api-keys-rvaVQMbg.js +1 -0
  74. package/dist/client/assets/{api-keys-DNrkQCkt.js → api-keys-zMWE0eW-.js} +1 -1
  75. package/dist/client/assets/{app-editor-CKdeak5r.js → app-editor-BnLt2HBc.js} +1 -1
  76. package/dist/client/assets/{asset-utils-CYyNDrFK.js → asset-utils-CQBKR3VN.js} +1 -1
  77. package/dist/client/assets/{auth-DHZfBLZ5.js → auth-BypL5L1O.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-BS8FAipd.js → auth-catchall-BeibfVV0.js} +1 -1
  79. package/dist/client/assets/{auth-entry-34SQAdx9.js → auth-entry-DgsnWxp_.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-DF-Z-sUB.js → auth-split-layout-Daxd6Ypw.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-CbgraxNg.js → authenticate-and-persist-oauth-ClTAD7nN.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DtCSZcdc.js → automation-list-row-CvwYuhxk.js} +1 -1
  83. package/dist/client/assets/{automation-runs-Lelpmww0.js → automation-runs-CApbL_Sf.js} +1 -1
  84. package/dist/client/assets/{automations-CV4vMVkc.js → automations-Di1Er6hW.js} +1 -1
  85. package/dist/client/assets/{autosend-Cwww7_9j.js → autosend-B4f5gabb.js} +1 -1
  86. package/dist/client/assets/{avatar-BRRGslVN.js → avatar-CFO-sRGJ.js} +1 -1
  87. package/dist/client/assets/{badge-DmeqGssZ.js → badge-CYEiaJVw.js} +1 -1
  88. package/dist/client/assets/{block-document-DtA_3M8z.js → block-document-C4MOQYjr.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context--o78Y3yp.js → blocks-preview-workspace-context-Bq9hpUEB.js} +1 -1
  90. package/dist/client/assets/{blocks-tab-states-Dps89GrH.js → blocks-tab-states-CwfYFgj9.js} +1 -1
  91. package/dist/client/assets/{blog-schema-CEYO8j-N.js → blog-schema-CgYPJyE9.js} +1 -1
  92. package/dist/client/assets/{buckets-CXMlDLcD.js → buckets-DoEfEinO.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-C7S9lWPM.js → build-improve-prompt-doc-BByi4O7Q.js} +1 -1
  94. package/dist/client/assets/{calendar-B6BpOXfC.js → calendar-AEesHfNc.js} +1 -1
  95. package/dist/client/assets/{campaigns-view-DtQvcOC6.js → campaigns-view-DTbZCmg6.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-CDC4LjDf.js → capability-load-error-BfKRzvUM.js} +1 -1
  97. package/dist/client/assets/{category-editor-BvoAtPRs.js → category-editor-sR05FPNS.js} +1 -1
  98. package/dist/client/assets/cdn-tab-9RYVl35J.js +1 -0
  99. package/dist/client/assets/{chart-CTinHp-8.js → chart-D7lvPdFx.js} +1 -1
  100. package/dist/client/assets/{chat-context-DLezfYEa.js → chat-context-DqNUlJMY.js} +1 -1
  101. package/dist/client/assets/{chat-draft-BlRnwK9v.js → chat-draft-DeylAkNb.js} +1 -1
  102. package/dist/client/assets/{checkbox-BlB_jfat.js → checkbox-JO6XiJJq.js} +1 -1
  103. package/dist/client/assets/{choose-editor-DHZGPvHu.js → choose-editor-CQPIEsfr.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-DFaLHvgO.js → cli-auth-success-DksDQz1c.js} +1 -1
  105. package/dist/client/assets/{client-icons-CpqRIiQr.js → client-icons-DbBtP136.js} +1 -1
  106. package/dist/client/assets/cms-settings-editor-CD6Fhdzj.js +1 -0
  107. package/dist/client/assets/{collapsible-DZTt-UAc.js → collapsible-CXUiqrZ3.js} +1 -1
  108. package/dist/client/assets/{collection-detail-BjUkXIkv.js → collection-detail-BXm00G6J.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-Dmr1DpXh.js → collection-display-button-BYX1WGsT.js} +1 -1
  110. package/dist/client/assets/{collection-search-DcBOG84t.js → collection-search-CVvFJ5Bb.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-CBLUEZ5z.js → collection-table-wrapper-_tytodYv.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-D5lfCRgo.js → collection-tabs-8dvqqnDR.js} +1 -1
  113. package/dist/client/assets/{column-rules-B3eVnEiY.js → column-rules-iw7Orhw0.js} +1 -1
  114. package/dist/client/assets/{combobox-CVTULN6N.js → combobox-CS_HItwQ.js} +1 -1
  115. package/dist/client/assets/{command-R1e1yMQ9.js → command-C9iGFbUT.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-hGQWfzwk.js → companion-mcps-section-DuvDeify.js} +1 -1
  117. package/dist/client/assets/{config-BWrcU7H3.js → config-Ba5RPb40.js} +1 -1
  118. package/dist/client/assets/{connect-CNN0l2XT.js → connect-Q-Yb-tbQ.js} +1 -1
  119. package/dist/client/assets/{connect-layout-DiWD8YTg.js → connect-layout-BsURWVqR.js} +1 -1
  120. package/dist/client/assets/{connect-source-dialog-xgaD8LgG.js → connect-source-dialog-Cugh2Kwq.js} +1 -1
  121. package/dist/client/assets/{connection-card-DnICQFn9.js → connection-card-C_97TUuR.js} +1 -1
  122. package/dist/client/assets/{connection-detail-C0OJOuef.js → connection-detail-B2pboQAc.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-CBYCAzPl.js → connection-form-helpers-B61Y3llL.js} +1 -1
  124. package/dist/client/assets/{connection-WJRbuDz1.js → connection-y8T_LUE4.js} +1 -1
  125. package/dist/client/assets/{connections-DjwbhWNZ.js → connections-BtM211zd.js} +1 -1
  126. package/dist/client/assets/{content-tab-CAJ559-P.js → content-tab-6aM6SPfn.js} +3 -3
  127. package/dist/client/assets/{context-BkZJrbqd.js → context-Dhzbo3rE.js} +1 -1
  128. package/dist/client/assets/{context-menu-B7wqDsW2.js → context-menu-DvfYSbOF.js} +1 -1
  129. package/dist/client/assets/{context-shell-DkaK_BOn.js → context-shell-DQlTMTgZ.js} +3 -3
  130. package/dist/client/assets/{core.esm-DHAYYfZu.js → core.esm-Bnj1keGH.js} +1 -1
  131. package/dist/client/assets/{create-organization-dialog-u0Ud2kaY.js → create-organization-dialog-BJw0GqGQ.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-DRJB1hcS.js → daily-pulse-ambOqGdx.js} +1 -1
  133. package/dist/client/assets/{discover-gZu3Sfan.js → discover-BaCG_0h-.js} +1 -1
  134. package/dist/client/assets/{domain-settings-USbT8NUs.js → domain-settings-DvRELpY-.js} +1 -1
  135. package/dist/client/assets/{drawer-C9bfrQZ2.js → drawer-txFUQcqx.js} +1 -1
  136. package/dist/client/assets/{editor-4LyrkCqm.js → editor-DxbkHv3R.js} +1 -1
  137. package/dist/client/assets/{editor-classes-_dczAbCq.js → editor-classes-C__SrxMV.js} +1 -1
  138. package/dist/client/assets/{empty-state-4Hlytpdt.js → empty-state-BCgDvmX-.js} +1 -1
  139. package/dist/client/assets/{empty-state-_a1QMwjl.js → empty-state-bJzQYitF.js} +1 -1
  140. package/dist/client/assets/experiments-tab-DmhKoZxz.js +1 -0
  141. package/dist/client/assets/{experiments-tab-choice-C9wWsYd4.js → experiments-tab-choice-Ie5k_O6x.js} +1 -1
  142. package/dist/client/assets/{extract-connection-data-mbA-zNaE.js → extract-connection-data-DrQExIK1.js} +1 -1
  143. package/dist/client/assets/{feature-gate-iJnsMeBr.js → feature-gate-Q2dMtYpF.js} +1 -1
  144. package/dist/client/assets/{feature-paywall-DcguOiJA.js → feature-paywall-XpETcjbv.js} +1 -1
  145. package/dist/client/assets/{file-explorer-B_iKC9bp.js → file-explorer-CfVYwLoJ.js} +1 -1
  146. package/dist/client/assets/{file-preview-Dy07kmgf.js → file-preview-Dd06GGvy.js} +1 -1
  147. package/dist/client/assets/{file-share-button-DOM1SplI.js → file-share-button-BxZcqmJb.js} +1 -1
  148. package/dist/client/assets/{file-type-icon-CP6Bm0Pm.js → file-type-icon-CIdo5ojc.js} +1 -1
  149. package/dist/client/assets/{folder-icon-D_8O1LWU.js → folder-icon-EiO3M0UC.js} +1 -1
  150. package/dist/client/assets/{form-B2fhil9l.js → form-uqsH1s-y.js} +1 -1
  151. package/dist/client/assets/{general-BE0anzP1.js → general-Vd-hJfIm.js} +1 -1
  152. package/dist/client/assets/{home-Bb5YZQHS.js → home-HWe4c99-.js} +1 -1
  153. package/dist/client/assets/{icon-button-BQwa115u.js → icon-button-BUDG7R_U.js} +1 -1
  154. package/dist/client/assets/{index-Ccma-e_l.js → index-7jvcir73.js} +1 -1
  155. package/dist/client/assets/{index-DXMlJvYf.js → index-B4zmwgCj.js} +8 -8
  156. package/dist/client/assets/{index-CYHGIatu.js → index-B7PBSrog.js} +1 -1
  157. package/dist/client/assets/{index-Cs4qaYPX.js → index-BCGh3XTH.js} +1 -1
  158. package/dist/client/assets/{index-rKWXOhdZ.js → index-BP0spIbU.js} +1 -1
  159. package/dist/client/assets/{index-D2MFYEzD.js → index-BphI8pNH.js} +39 -39
  160. package/dist/client/assets/{index-B4yeJC5N.js → index-BtufcGJ5.js} +1 -1
  161. package/dist/client/assets/{index-CXWqnDP7.js → index-C5xgscqu.js} +1 -1
  162. package/dist/client/assets/{index-R_qB4INp.js → index-CW0mTKOH.js} +1 -1
  163. package/dist/client/assets/{index-DU8BFhZD.js → index-C_7vDyVA.js} +1 -1
  164. package/dist/client/assets/{index-CK40JGB6.js → index-Codsxxmu.js} +1 -1
  165. package/dist/client/assets/index-DDtLrgkt.js +1 -0
  166. package/dist/client/assets/index-MPdUOMBb.css +1 -0
  167. package/dist/client/assets/{index-CeLGzS5y.js → index-kjyiSPIZ.js} +1 -1
  168. package/dist/client/assets/{index-redirect-D2LQ3n9D.js → index-redirect-TlUNx3Dt.js} +1 -1
  169. package/dist/client/assets/{index-BWgOKGMR.js → index-unPBFo0y.js} +1 -1
  170. package/dist/client/assets/{index-DiVZA6vr.js → index-v9zzzqiT.js} +1 -1
  171. package/dist/client/assets/{infiniteQueryObserver-CaSjeDsE.js → infiniteQueryObserver-CD6zPv_B.js} +1 -1
  172. package/dist/client/assets/{infra-billing-_cCsUnUO.js → infra-billing-gJ1Pxkhj.js} +1 -1
  173. package/dist/client/assets/{input-D43D11gI.js → input-DeNGl9cT.js} +1 -1
  174. package/dist/client/assets/{input-D9iDAvwy.js → input-otZYQGEr.js} +3 -3
  175. package/dist/client/assets/{integration-icon-CqbOWyvX.js → integration-icon-C-_9oW7G.js} +1 -1
  176. package/dist/client/assets/{jira-icon-Y_2uACKb.js → jira-icon-7kZdJvHs.js} +1 -1
  177. package/dist/client/assets/{label-3hTmrxoy.js → label-BXumUTqC.js} +1 -1
  178. package/dist/client/assets/{layout-EYuYXIPk.js → layout-Ba0KZf90.js} +1 -1
  179. package/dist/client/assets/{legacy-agents-deep-Y0g29rl5.js → legacy-agents-deep-D4pxgM1l.js} +1 -1
  180. package/dist/client/assets/legacy-main-redirect-BQ_7LpiD.js +1 -0
  181. package/dist/client/assets/library-1V2C8s_K.js +1 -0
  182. package/dist/client/assets/{login-DTF43M9h.js → login-CtcB6JMd.js} +1 -1
  183. package/dist/client/assets/{markdown-BeKN4MPt.js → markdown-Bqq3R66p.js} +3 -3
  184. package/dist/client/assets/{mcp-app-renderer-DcbWj_cd.js → mcp-app-renderer-tCfKhIA1.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-BVLnM3ir.js → mcp-oauth-CaTRnuQU.js} +1 -1
  186. package/dist/client/assets/{mcp-oauth-DQ__DCEs.js → mcp-oauth-ZxlBJ_T6.js} +1 -1
  187. package/dist/client/assets/{members-DdYed_-G.js → members-Ds3beXMQ.js} +1 -1
  188. package/dist/client/assets/{memory-CbDGJpdj.js → memory-CgI9n1je.js} +1 -1
  189. package/dist/client/assets/{mini-report-page-I5w2A9ue.js → mini-report-page-C4CjzrcA.js} +1 -1
  190. package/dist/client/assets/{mock-board-D64wFJ9x.js → mock-board-x9OA1kIr.js} +3 -3
  191. package/dist/client/assets/{monaco-editor-DEU78sxw.js → monaco-editor-DZ2Rp_C7.js} +1 -1
  192. package/dist/client/assets/monitoring-BkpBpvIZ.js +1 -0
  193. package/dist/client/assets/{monitoring-stats-row-BLFmMtG4.js → monitoring-stats-row-tdOtylzh.js} +1 -1
  194. package/dist/client/assets/{multi-select-DxNv8sxt.js → multi-select-BnYAqN90.js} +1 -1
  195. package/dist/client/assets/{mustache-Cm6mC1mo.js → mustache-DuPMqXPT.js} +1 -1
  196. package/dist/client/assets/{named-rule-uses-BBN_5zyZ.js → named-rule-uses-BFHY2QY4.js} +1 -1
  197. package/dist/client/assets/{named-rule-view-Dgj56LCZ.js → named-rule-view-DHbEzjpv.js} +1 -1
  198. package/dist/client/assets/{new-project-dialog-qMTAvOP0.js → new-project-dialog-Cs8HMQlb.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-DzKW1jLM.js → oauth-callback-DSM8XE33.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-ai-provider-BhTg9J9_.js → oauth-callback-ai-provider-DgCpBfDW.js} +1 -1
  201. package/dist/client/assets/{onboarding-CcHHvf_v.js → onboarding-DeVuIfK9.js} +1 -1
  202. package/dist/client/assets/{openai-conversation-X6iReX5A.js → openai-conversation-CXYNFSGC.js} +1 -1
  203. package/dist/client/assets/{optimistic-project-sidebar-views-Wa4vMG32.js → optimistic-project-sidebar-views-VOTXYU3D.js} +1 -1
  204. package/dist/client/assets/{order-monitor-day-d8yh4cv8.js → order-monitor-day-Bxp4gXEu.js} +1 -1
  205. package/dist/client/assets/{organization-choice-DKOeafiU.js → organization-choice-BhCIGMjr.js} +1 -1
  206. package/dist/client/assets/{orgs-CReR2HvS.js → orgs-BPDKksL2.js} +1 -1
  207. package/dist/client/assets/{page-seo-form-BTZBPUqn.js → page-seo-form-WBlhJY38.js} +1 -1
  208. package/dist/client/assets/{pair-DSps2zoM.js → pair-DRaIXAj-.js} +1 -1
  209. package/dist/client/assets/{parse-sections-Bc_lvOtq.js → parse-sections-ClqXxi6i.js} +1 -1
  210. package/dist/client/assets/{plan-CxnMa3En.js → plan-DVQ6L_2j.js} +1 -1
  211. package/dist/client/assets/{plan-ladder-7wUcVwfI.js → plan-ladder-BJOn0tjJ.js} +1 -1
  212. package/dist/client/assets/{popover-Dm_x8CV9.js → popover-D-MLGIKG.js} +1 -1
  213. package/dist/client/assets/{post-calendar-BtFE-61n.js → post-calendar-Ywpfpf68.js} +1 -1
  214. package/dist/client/assets/{post-editor-QChnOq6Y.js → post-editor-tA48ONL1.js} +1 -1
  215. package/dist/client/assets/{preview-content-BUlAqj-X.js → preview-content-0nJULLLy.js} +1 -1
  216. package/dist/client/assets/{preview-dialog-39V6ZO2Y.js → preview-dialog-DweVJd_n.js} +1 -1
  217. package/dist/client/assets/{preview-panel-BvoYfTNF.js → preview-panel-BJ3KrhDy.js} +1 -1
  218. package/dist/client/assets/{preview-tab-jmFSMM-R.js → preview-tab-C3IiVwf1.js} +3 -3
  219. package/dist/client/assets/{product-picker-dialog-iaXbdjia.js → product-picker-dialog-CCIg354O.js} +1 -1
  220. package/dist/client/assets/{profile-IgWNvITK.js → profile-ZCnKsIdj.js} +1 -1
  221. package/dist/client/assets/{project-app-view-Bc-wof7y.js → project-app-view-BLZBQKeL.js} +1 -1
  222. package/dist/client/assets/{project-apps-DVzn0z1g.js → project-apps-FJ0TrEc6.js} +1 -1
  223. package/dist/client/assets/{project-feed-BIwmxSQY.js → project-feed-CZ6ECbBu.js} +1 -1
  224. package/dist/client/assets/{project-icon-CJmvnLdz.js → project-icon-J_TfV9WN.js} +1 -1
  225. package/dist/client/assets/project-reports-IwgSFkuk.js +1 -0
  226. package/dist/client/assets/project-tasks-DIh-1w8l.js +1 -0
  227. package/dist/client/assets/{projects-D8Cbhxnj.js → projects-BGlrrPvQ.js} +1 -1
  228. package/dist/client/assets/{projects-empty-state-CmtOjsbv.js → projects-empty-state-B699jX9t.js} +1 -1
  229. package/dist/client/assets/{prompts-BFb-SeSC.js → prompts-CL3pb_We.js} +1 -1
  230. package/dist/client/assets/record-editor-v6loIaK5.js +1 -0
  231. package/dist/client/assets/{redirect-editor-XmMaGVJV.js → redirect-editor-DwpwMdsP.js} +1 -1
  232. package/dist/client/assets/{releases-api-AYZ93qlv.js → releases-api-DX2L3yOb.js} +1 -1
  233. package/dist/client/assets/reports-VklqwHN4.js +1 -0
  234. package/dist/client/assets/{reports-AyOb4hhI.js → reports-fz3ShzPV.js} +1 -1
  235. package/dist/client/assets/{reports-onboarding-BDPMVaDo.js → reports-onboarding-mTQFH_iA.js} +1 -1
  236. package/dist/client/assets/{reports-tab-D2iADtiN.js → reports-tab-Bon4oiNK.js} +2 -2
  237. package/dist/client/assets/repositories-DVBlDnPs.js +1 -0
  238. package/dist/client/assets/{repositories-BNDNB0vE.js → repositories-Pjwn0cqi.js} +1 -1
  239. package/dist/client/assets/{repository-binding-4nTgXz1S.js → repository-binding-CqjA7Tko.js} +1 -1
  240. package/dist/client/assets/{repository-import-picker-De4sf2Gs.js → repository-import-picker-DRcn5MCM.js} +1 -1
  241. package/dist/client/assets/{repository-picker-HOHNvmaE.js → repository-picker-BL6xlIly.js} +1 -1
  242. package/dist/client/assets/{require-capability-ChTCz2WH.js → require-capability-gPmNE28i.js} +1 -1
  243. package/dist/client/assets/{required-auth-layout-BZllo6Io.js → required-auth-layout-BA3Gxw_5.js} +1 -1
  244. package/dist/client/assets/{reset-password-Ui3G6CJw.js → reset-password-qyVzV1QI.js} +1 -1
  245. package/dist/client/assets/{resizable-DAXTAODq.js → resizable-Bu3AyxKl.js} +1 -1
  246. package/dist/client/assets/{resolve-tab-icon-CAixh6_W.js → resolve-tab-icon-DXt8FU1X.js} +1 -1
  247. package/dist/client/assets/{review-settings-BDP4bMe5.js → review-settings-O8K_mvh6.js} +1 -1
  248. package/dist/client/assets/{roles-Clx4HYW_.js → roles-CCLRm2p0.js} +1 -1
  249. package/dist/client/assets/{route-B9jYymiu.js → route-DMrkbv9t.js} +1 -1
  250. package/dist/client/assets/{route-CaI6hSyT.js → route-DaeLPCnk.js} +1 -1
  251. package/dist/client/assets/route-jSSJr7H8.js +1 -0
  252. package/dist/client/assets/{runnable-block-editor-LQjhwiX1.js → runnable-block-editor-DXVt1mRj.js} +3 -3
  253. package/dist/client/assets/{sandbox-lifecycle-context-CJodiAqU.js → sandbox-lifecycle-context-CAD11jz7.js} +1 -1
  254. package/dist/client/assets/{schema-xPkTs0YZ.js → schema-BKLQwKnK.js} +1 -1
  255. package/dist/client/assets/{schema-DrNvzI26.js → schema-Ddw2ah-q.js} +1 -1
  256. package/dist/client/assets/{scroll-area-BBBDJLpH.js → scroll-area-GNWuujdQ.js} +1 -1
  257. package/dist/client/assets/{search-input-DSx8LWNe.js → search-input-i8DAXvnS.js} +1 -1
  258. package/dist/client/assets/{search-toggle-B9X5GBEJ.js → search-toggle-C2BWIs4O.js} +1 -1
  259. package/dist/client/assets/{secret-ciphertext-qv17emf3.js → secret-ciphertext-BA15G7qe.js} +1 -1
  260. package/dist/client/assets/{secret-picker-DBs-gr5P.js → secret-picker-CwZHe4Yx.js} +1 -1
  261. package/dist/client/assets/{secrets-5nLK_pSH.js → secrets-BWNDO0aL.js} +1 -1
  262. package/dist/client/assets/{sections-ALAbnAYY.js → sections-DhRieK41.js} +1 -1
  263. package/dist/client/assets/{sections-editor-DVqxZTWF.js → sections-editor-TqSLQIU8.js} +1 -1
  264. package/dist/client/assets/{select-C9_0SSgH.js → select-BAxIwkW7.js} +1 -1
  265. package/dist/client/assets/{select-model-BaxH4IRV.js → select-model-DKcSOpKv.js} +1 -1
  266. package/dist/client/assets/{seo-editor-Cd-ANp55.js → seo-editor-BhgypNCN.js} +1 -1
  267. package/dist/client/assets/{separator-DXuISWBW.js → separator-gKWGw3ec.js} +1 -1
  268. package/dist/client/assets/settings-tab-Cp66Lx0x.js +1 -0
  269. package/dist/client/assets/{sheet-BQCLSAhw.js → sheet-Dy9d78N0.js} +1 -1
  270. package/dist/client/assets/{shell-layout-CnXya3zZ.js → shell-layout-DPflSDI7.js} +1 -1
  271. package/dist/client/assets/{site-draft-actions-BG_Fzxj9.js → site-draft-actions-BjAr6xi6.js} +1 -1
  272. package/dist/client/assets/site-draft-view-Bpwq-4Im.js +2 -0
  273. package/dist/client/assets/site-editor-CP2FSMmX.js +1 -0
  274. package/dist/client/assets/{site-editor-toast-BKVRfpA8.js → site-editor-toast-n7tT-SpR.js} +1 -1
  275. package/dist/client/assets/{skills-mFhfnuy4.js → skills-C-lfUnzb.js} +1 -1
  276. package/dist/client/assets/{slider-DTKLr6aL.js → slider-DMzP4oef.js} +1 -1
  277. package/dist/client/assets/{sortable.esm-D2---7Ab.js → sortable.esm-BEpH5tbt.js} +1 -1
  278. package/dist/client/assets/{sso-DrhiuaNt.js → sso-Bdl8tzvn.js} +1 -1
  279. package/dist/client/assets/{suggestion-B0A7rwRG.js → suggestion-BfzPP8A_.js} +1 -1
  280. package/dist/client/assets/{switch-CESJ2RZK.js → switch-B0lPkF5_.js} +1 -1
  281. package/dist/client/assets/{symbol-CYXY7_SE.js → symbol-CcauWbN2.js} +1 -1
  282. package/dist/client/assets/{synced-repos--pWS_C_z.js → synced-repos-cKAzeg2x.js} +1 -1
  283. package/dist/client/assets/{tab-icon-glyph-Cjt9sANI.js → tab-icon-glyph-C2nHjzae.js} +1 -1
  284. package/dist/client/assets/{table-BkZK8rXZ.js → table-CeULXNQ2.js} +1 -1
  285. package/dist/client/assets/{tabs-B6EQUSl_.js → tabs-fkqYJpP8.js} +1 -1
  286. package/dist/client/assets/{task-assignee-avatar-Dodx9W4w.js → task-assignee-avatar-BuSQPIHq.js} +1 -1
  287. package/dist/client/assets/{task-board-6nf7vbPi.js → task-board-Cv7D_3uN.js} +1 -1
  288. package/dist/client/assets/{task-route-BvbHuTGP.js → task-route-dMm35uIv.js} +1 -1
  289. package/dist/client/assets/{task-status-GUWtXwyC.js → task-status-D3EaEAgF.js} +1 -1
  290. package/dist/client/assets/{taskboard-analytics-BXSTC1m2.js → taskboard-analytics-C2Yib8gP.js} +1 -1
  291. package/dist/client/assets/tasks-5wUjot9O.js +1 -0
  292. package/dist/client/assets/{tasks-DEvPbHif.js → tasks-Cx6Zd4fY.js} +1 -1
  293. package/dist/client/assets/{textarea-DG3FcnmS.js → textarea-aGNI5bvN.js} +1 -1
  294. package/dist/client/assets/{thread-analytics-BUqostwA.js → thread-analytics-B9HcTgTh.js} +1 -1
  295. package/dist/client/assets/{thread-intent-Ds79TVrW.js → thread-intent-BQGp3MKl.js} +1 -1
  296. package/dist/client/assets/{thread-route-UuA5SD5X.js → thread-route-BEIPJEss.js} +1 -1
  297. package/dist/client/assets/{thread-route-Cf5GTfDW.js → thread-route-D147zL8e.js} +1 -1
  298. package/dist/client/assets/{thread-sheet-body-p9veuPgz.js → thread-sheet-body-i2u8ULqW.js} +1 -1
  299. package/dist/client/assets/{time-range-picker-Bo0eqMw9.js → time-range-picker-0kVuNsQb.js} +1 -1
  300. package/dist/client/assets/{toggle-group-C7NFln-0.js → toggle-group-DaYieoyW.js} +1 -1
  301. package/dist/client/assets/{tool-namespace-CMW8ZB5L.js → tool-namespace-DqsoHKmd.js} +1 -1
  302. package/dist/client/assets/{toolbar-icon-button-BiR5ntfC.js → toolbar-icon-button-3blDPoB6.js} +1 -1
  303. package/dist/client/assets/{tooltip-bQVm_Ope.js → tooltip-2YCPx1DM.js} +1 -1
  304. package/dist/client/assets/{tooltipContext-CMDZ9J9X.js → tooltipContext-CgeI21sB.js} +1 -1
  305. package/dist/client/assets/{track-COIlf0dl.js → track-DO9rvMbw.js} +1 -1
  306. package/dist/client/assets/{types-DLna4BAB.js → types-6BxgL_uJ.js} +1 -1
  307. package/dist/client/assets/{url-slug-BWq-dgp6.js → url-slug-DxJ8K4M_.js} +1 -1
  308. package/dist/client/assets/{usage-stats-CvT3PVJT.js → usage-stats-BHO2m1GZ.js} +1 -1
  309. package/dist/client/assets/{use-ai-providers-CzmKfSB9.js → use-ai-providers-D11veeve.js} +1 -1
  310. package/dist/client/assets/{use-apply-named-rule-BLEqLp1R.js → use-apply-named-rule-B4OGys4b.js} +1 -1
  311. package/dist/client/assets/{use-automations-DHA5_uZh.js → use-automations-tbwaowTj.js} +1 -1
  312. package/dist/client/assets/{use-autosave-BlShc4A-.js → use-autosave-DfMGkaud.js} +1 -1
  313. package/dist/client/assets/{use-chat-layout-state-BV7ldzPe.js → use-chat-layout-state-CIyU-XxO.js} +1 -1
  314. package/dist/client/assets/{use-clock-tick-C61VlTs_.js → use-clock-tick-DRqivY5H.js} +1 -1
  315. package/dist/client/assets/{use-connect-companion-DxCCqNf4.js → use-connect-companion-pRfQU03M.js} +1 -1
  316. package/dist/client/assets/{use-connection-DTSe3r1K.js → use-connection-hBtWetVy.js} +1 -1
  317. package/dist/client/assets/{use-content-sync-Dj6rb1LD.js → use-content-sync-DTts1O7D.js} +1 -1
  318. package/dist/client/assets/{use-copy-Bc8JMSws.js → use-copy-Ctyjo3u8.js} +1 -1
  319. package/dist/client/assets/{use-create-virtual-mcp-Dpe8iA_9.js → use-create-virtual-mcp-BoVnWYo_.js} +1 -1
  320. package/dist/client/assets/{use-date-fns-locale-BGkTB4Mm.js → use-date-fns-locale-BL151nA9.js} +1 -1
  321. package/dist/client/assets/{use-debounced-autosave-BhCHbQGN.js → use-debounced-autosave-XfpamUxh.js} +1 -1
  322. package/dist/client/assets/{use-debounced-value-Cm7nwcam.js → use-debounced-value-DppuiHxU.js} +1 -1
  323. package/dist/client/assets/{use-deco-credits-BgLGkCcl.js → use-deco-credits-DAnq8bae.js} +1 -1
  324. package/dist/client/assets/{use-decopilot-events-C_BQo06W.js → use-decopilot-events-CmWo-JmL.js} +1 -1
  325. package/dist/client/assets/{use-delete-connection-BEv8pmzy.js → use-delete-connection-D4L5Nbwc.js} +1 -1
  326. package/dist/client/assets/{use-deployment-admin-Ck9xx8zz.js → use-deployment-admin-CqRFItVm.js} +1 -1
  327. package/dist/client/assets/{use-fast-preview-draft-url-B7ECUHMP.js → use-fast-preview-draft-url-6n7ATrzr.js} +1 -1
  328. package/dist/client/assets/{use-file-configs-C7kUU5_U.js → use-file-configs-BukUB2a7.js} +1 -1
  329. package/dist/client/assets/{use-inbox-feed-U2BOY_0m.js → use-inbox-feed-DWwwp0yB.js} +1 -1
  330. package/dist/client/assets/{use-infinite-scroll-CpvqXWve.js → use-infinite-scroll-CAGEOw6T.js} +1 -1
  331. package/dist/client/assets/{use-join-requests-ldwvbhU3.js → use-join-requests-C5RVOca9.js} +1 -1
  332. package/dist/client/assets/{use-main-panel-tabs-BvDesOKd.js → use-main-panel-tabs-C_SiePFc.js} +1 -1
  333. package/dist/client/assets/{use-mcp-auth-status-D6FLEMEz.js → use-mcp-auth-status-CPaTWfZe.js} +1 -1
  334. package/dist/client/assets/{use-mcp-client-Cby5XqT6.js → use-mcp-client-DsrOnW9o.js} +1 -1
  335. package/dist/client/assets/{use-mcp-prompts-DpGHOlEI.js → use-mcp-prompts-B5RvuVy4.js} +1 -1
  336. package/dist/client/assets/{use-mcp-tools-7EpnWJvB.js → use-mcp-tools-oOqD73aG.js} +1 -1
  337. package/dist/client/assets/{use-members-oF45MDF1.js → use-members-DQZYP7Cb.js} +1 -1
  338. package/dist/client/assets/{use-mobile-h4hHhZkm.js → use-mobile-DruvZ2zF.js} +1 -1
  339. package/dist/client/assets/{use-move-blocks-DFQHiQ1n.js → use-move-blocks-C7t8R0hh.js} +1 -1
  340. package/dist/client/assets/{use-navigate-to-agent-DwJfjSMG.js → use-navigate-to-agent-CfXi671z.js} +1 -1
  341. package/dist/client/assets/{use-open-billing-url-CjWCFQM1.js → use-open-billing-url-0u6Rqj8b.js} +1 -1
  342. package/dist/client/assets/{use-org-auth-client-BFDehTsp.js → use-org-auth-client-CSFZu3Wj.js} +1 -1
  343. package/dist/client/assets/{use-org-fs-CyxFz8rw.js → use-org-fs-Bndw9m25.js} +1 -1
  344. package/dist/client/assets/{use-org-repo-syncs-BsUWjWH7.js → use-org-repo-syncs-DgWzYW9F.js} +1 -1
  345. package/dist/client/assets/{use-org-sso-D5M4Sxwu.js → use-org-sso-B7o6rhq2.js} +1 -1
  346. package/dist/client/assets/{use-organization-roles-t12r77qZ.js → use-organization-roles-DPfq-0hG.js} +1 -1
  347. package/dist/client/assets/{use-organization-settings-NOur1Lvu.js → use-organization-settings-B2e749tN.js} +1 -1
  348. package/dist/client/assets/{use-panel-navigate-DxGjTjIo.js → use-panel-navigate-C-ip5ing.js} +1 -1
  349. package/dist/client/assets/{use-project-native-view-presence-USh7_bNt.js → use-project-native-view-presence-iEIqgCZR.js} +1 -1
  350. package/dist/client/assets/{use-project-scope-CBw0FSEz.js → use-project-scope-DN9qkINS.js} +1 -1
  351. package/dist/client/assets/{use-recent-apps-B2LVD6z4.js → use-recent-apps-Dieru2LM.js} +1 -1
  352. package/dist/client/assets/{use-releases-x9nrIfuE.js → use-releases-DJrTmfLZ.js} +1 -1
  353. package/dist/client/assets/{use-reports-diagnostic-qSw4HttT.js → use-reports-diagnostic-BdDNwhZy.js} +1 -1
  354. package/dist/client/assets/{use-sandbox-events-D98uWMd_.js → use-sandbox-events-B-rKhgAE.js} +1 -1
  355. package/dist/client/assets/{use-secrets-CvBGDTuP.js → use-secrets-C3hSYvUx.js} +1 -1
  356. package/dist/client/assets/{use-section-preview-base-DmjOJ885.js → use-section-preview-base-NrYdhHI5.js} +1 -1
  357. package/dist/client/assets/{use-session-runtime-BrkTaSa6.js → use-session-runtime-RS_ZeJDS.js} +1 -1
  358. package/dist/client/assets/{use-sidebar-collapsed-Bijbdhqq.js → use-sidebar-collapsed-C9KH2wzy.js} +1 -1
  359. package/dist/client/assets/{use-tags-BMQZw2TW.js → use-tags-DBJgOg0Z.js} +1 -1
  360. package/dist/client/assets/{use-task-board-analytics-DdtvZ4ju.js → use-task-board-analytics-Bl-3jKgS.js} +1 -1
  361. package/dist/client/assets/{use-task-board-events-B5yNhg5i.js → use-task-board-events-CemAfTjA.js} +1 -1
  362. package/dist/client/assets/{use-task-board-item-prs-D9gfgNig.js → use-task-board-item-prs-83sFKoAa.js} +1 -1
  363. package/dist/client/assets/{use-task-metadata-DuF2rBuH.js → use-task-metadata-DYSGuNJN.js} +1 -1
  364. package/dist/client/assets/{use-thread-analytics-B03W7aQi.js → use-thread-analytics-B-gfPcTz.js} +1 -1
  365. package/dist/client/assets/{use-thread-outputs-D_k8NizM.js → use-thread-outputs-9KkInEd1.js} +1 -1
  366. package/dist/client/assets/useInfiniteQuery-Ctv8zOi3.js +1 -0
  367. package/dist/client/assets/{useQueries-BSehCBUp.js → useQueries-BRUig2bT.js} +1 -1
  368. package/dist/client/assets/useSuspenseInfiniteQuery-DRLUIOlU.js +1 -0
  369. package/dist/client/assets/{users-Cej3U7P5.js → users-zGj6iqQJ.js} +1 -1
  370. package/dist/client/assets/{utils-CkwBhBMS.js → utils-DnxtSQ0E.js} +1 -1
  371. package/dist/client/assets/{variant-calendar-kJB8Qi3I.js → variant-calendar-DzngKeid.js} +1 -1
  372. package/dist/client/assets/{variant-matcher-override-XY7K79P5.js → variant-matcher-override-BvLc7beb.js} +1 -1
  373. package/dist/client/assets/{virtual-mcp-BzmRbmfQ.js → virtual-mcp-CKcyAjRE.js} +1 -1
  374. package/dist/client/assets/{watch-sse-pool-CmsmQLFo.js → watch-sse-pool-B6MhK1l7.js} +1 -1
  375. package/dist/client/index.html +2 -2
  376. package/dist/server/server.js +417 -417
  377. package/package.json +1 -1
  378. package/dist/client/assets/agent-analytics-D7PovqhV.js +0 -1
  379. package/dist/client/assets/agent-app-DEsjnzHy.js +0 -1
  380. package/dist/client/assets/agent-calendar-Co4HNR_x.js +0 -1
  381. package/dist/client/assets/agent-deck-Bra-oqcr.js +0 -1
  382. package/dist/client/assets/agent-experiments-W5vP2PHw.js +0 -1
  383. package/dist/client/assets/agent-file-_hkGq1Y2.js +0 -1
  384. package/dist/client/assets/agent-library-BTKjZMW2.js +0 -1
  385. package/dist/client/assets/agent-library-file-ClGbfS7a.js +0 -1
  386. package/dist/client/assets/agent-monitor-Dtdyok8Z.js +0 -1
  387. package/dist/client/assets/agent-settings-DQDpgZ05.js +0 -1
  388. package/dist/client/assets/agent-site-editor-code-CiWALb3j.js +0 -2
  389. package/dist/client/assets/agent-site-editor-content-BrDlLQPy.js +0 -1
  390. package/dist/client/assets/agent-site-editor-preview-Da7g0LlC.js +0 -1
  391. package/dist/client/assets/agent-view-l1LYqbmp.js +0 -1
  392. package/dist/client/assets/api-keys-kxUaur7Y.js +0 -1
  393. package/dist/client/assets/cms-settings-editor-Dh-qBReE.js +0 -1
  394. package/dist/client/assets/experiments-tab-DdHl8yk7.js +0 -1
  395. package/dist/client/assets/index-CO7uP6ut.js +0 -1
  396. package/dist/client/assets/index-DjdMnw7p.css +0 -1
  397. package/dist/client/assets/legacy-main-redirect-Pt1vRyf-.js +0 -1
  398. package/dist/client/assets/library-DJ51ehEw.js +0 -1
  399. package/dist/client/assets/monitor-v8-CHgzPfyd.js +0 -1
  400. package/dist/client/assets/monitoring-Bklr39Mh.js +0 -1
  401. package/dist/client/assets/project-reports-DnaQ9nW_.js +0 -1
  402. package/dist/client/assets/project-tasks-cwxXGcyN.js +0 -1
  403. package/dist/client/assets/record-editor-hWJJMGCG.js +0 -1
  404. package/dist/client/assets/reports-BQij5juA.js +0 -1
  405. package/dist/client/assets/repositories-BiNU-Xfn.js +0 -1
  406. package/dist/client/assets/route-BjK3qzB4.js +0 -1
  407. package/dist/client/assets/settings-tab-D_D1vl9t.js +0 -1
  408. package/dist/client/assets/site-draft-view-BYdCjysm.js +0 -2
  409. package/dist/client/assets/site-editor-B7kc0tIQ.js +0 -1
  410. package/dist/client/assets/tasks-Cd3DKWnU.js +0 -1
  411. package/dist/client/assets/useInfiniteQuery-Dobhsojg.js +0 -1
  412. package/dist/client/assets/useSuspenseInfiniteQuery-CqyfVE9R.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-DVqxZTWF.js","assets/index-D2MFYEzD.js","assets/index-DjdMnw7p.css","assets/chat-context-DLezfYEa.js","assets/use-panel-navigate-DxGjTjIo.js","assets/thread-route-UuA5SD5X.js","assets/use-project-scope-CBw0FSEz.js","assets/repository-binding-4nTgXz1S.js","assets/use-mcp-client-Cby5XqT6.js","assets/auth-DHZfBLZ5.js","assets/autosend-Cwww7_9j.js","assets/thread-intent-Ds79TVrW.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CmsmQLFo.js","assets/task-board-6nf7vbPi.js","assets/schema-DrNvzI26.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-C_BQo06W.js","assets/use-ai-providers-CzmKfSB9.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-NOur1Lvu.js","assets/runnable-block-editor-LQjhwiX1.js","assets/utils-CkwBhBMS.js","assets/ZoomOut-DLICjI1h.js","assets/Image01-QuVxFosz.js","assets/agent-icon-g2PIrjzs.js","assets/AlertCircle-DgnxHqxe.js","assets/Tool01-rTZNmFct.js","assets/ArrowUp-723TVuFG.js","assets/ArrowLeft-BJ1448l4.js","assets/LinkBroken01-DDgMbBWJ.js","assets/ShoppingBag01-DVHnZchK.js","assets/Building02-DU823ZCw.js","assets/CheckCircle-C7csYE-y.js","assets/ChevronUp-DiTVmUiH.js","assets/ChevronSelectorVertical-B0Z7parR.js","assets/UserSquare-B_yRFcN6.js","assets/Copy01-DRNuKy-h.js","assets/CreditCard01-C3f2i_qY.js","assets/DotsVertical-eX97dPc6.js","assets/Globe04-ByvV2bPX.js","assets/SwitchHorizontal01-_kdH1ete.js","assets/Key01-C-QXsN23.js","assets/Link01-CbpFxbNY.js","assets/Minus-DnJ8wbLv.js","assets/Monitor01-DD5_JCl8.js","assets/Sun-Ct5gftPt.js","assets/Play-BgEaB30r.js","assets/Plus-BnqPSlPj.js","assets/SearchMd-GQAKwnQD.js","assets/Trash01-TPK4gSsp.js","assets/Upload01-D6tRQTgc.js","assets/User01-1q78INo2.js","assets/Users01-D5MhP5r0.js","assets/XClose-DOXmYMF_.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-DSps2zoM.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-DZTt-UAc.js","assets/use-copy-Bc8JMSws.js","assets/usage-stats-CvT3PVJT.js","assets/tool-namespace-CMW8ZB5L.js","assets/form-B2fhil9l.js","assets/label-3hTmrxoy.js","assets/utils-CVEq3hMx.js","assets/markdown-BeKN4MPt.js","assets/use-mobile-h4hHhZkm.js","assets/tooltip-bQVm_Ope.js","assets/index-CXWqnDP7.js","assets/use-clock-tick-C61VlTs_.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-DcbWj_cd.js","assets/types-DLna4BAB.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-CnXya3zZ.js","assets/avatar-BRRGslVN.js","assets/command-R1e1yMQ9.js","assets/index-R_qB4INp.js","assets/integration-icon-CqbOWyvX.js","assets/project-icon-CJmvnLdz.js","assets/new-project-dialog-qMTAvOP0.js","assets/repository-import-picker-De4sf2Gs.js","assets/use-navigate-to-agent-DwJfjSMG.js","assets/repository-picker-HOHNvmaE.js","assets/useInfiniteQuery-Dobhsojg.js","assets/infiniteQueryObserver-CaSjeDsE.js","assets/collection-search-DcBOG84t.js","assets/use-debounced-value-Cm7nwcam.js","assets/required-auth-layout-BZllo6Io.js","assets/use-org-sso-D5M4Sxwu.js","assets/shell-layout-CE2Eihra.css","assets/sheet-BQCLSAhw.js","assets/use-connection-DTSe3r1K.js","assets/use-mcp-prompts-DpGHOlEI.js","assets/use-thread-outputs-D_k8NizM.js","assets/file-type-icon-CP6Bm0Pm.js","assets/secret-ciphertext-qv17emf3.js","assets/alert-kpgdNVxk.js","assets/parse-sections-Bc_lvOtq.js","assets/switch-CESJ2RZK.js","assets/textarea-DG3FcnmS.js","assets/site-editor-toast-BKVRfpA8.js","assets/use-session-runtime-BrkTaSa6.js","assets/experiments-tab-choice-C9wWsYd4.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-D98uWMd_.js","assets/sandbox-git-api-CH_-QFpD.js","assets/popover-Dm_x8CV9.js","assets/blocks-tab-states-Dps89GrH.js","assets/slider-DTKLr6aL.js","assets/index-BWgOKGMR.js","assets/index-BdQq_4o_.js","assets/tooltipContext-CMDZ9J9X.js","assets/CategoricalChart-CinaMpxG.js","assets/index-CeLGzS5y.js","assets/ActiveShapeUtils-DC4ySNWR.js","assets/Sector-DG1U_Qdd.js","assets/symbol-CYXY7_SE.js","assets/empty-state-_a1QMwjl.js","assets/scroll-area-BBBDJLpH.js","assets/monaco-editor-DEU78sxw.js","assets/editor-4LyrkCqm.js","assets/calendar-B6BpOXfC.js","assets/select-C9_0SSgH.js","assets/editor-classes-_dczAbCq.js","assets/core.esm-DHAYYfZu.js","assets/sortable.esm-D2---7Ab.js","assets/toggle-group-C7NFln-0.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-CVTULN6N.js","assets/alert-dialog-KKnJELoX.js","assets/search-input-DSx8LWNe.js","assets/tabs-B6EQUSl_.js","assets/use-file-configs-C7kUU5_U.js","assets/asset-utils-CYyNDrFK.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-Cm6mC1mo.js","assets/use-section-preview-base-DmjOJ885.js","assets/section-preview-url-7zfngvgW.js","assets/use-members-oF45MDF1.js","assets/use-org-auth-client-BFDehTsp.js","assets/page-seo-form-BTZBPUqn.js","assets/use-apply-named-rule-BLEqLp1R.js","assets/use-move-blocks-DFQHiQ1n.js","assets/variant-matcher-override-XY7K79P5.js","assets/variant-draft-pointer-BeAKcq_c.js"])))=>i.map(i=>d[i]);
2
- import{c as ce,j as s,r as S,l as Ht,b as Ce,B as Ie,aF as qt,aW as rt,aG as Te,q as Xs,D as Zs,K as er,s as tr,v as nr,e as ua,h as Pt,I as Tn,w as fa,aX as ma,a2 as _n,aY as pa,aU as ha,au as ys,aw as ws,a5 as ga,P as ks,y as va,t as yn,o as xa,m as ba}from"./index-D2MFYEzD.js";import{u as sr,g as ya,c as Ss,B as wn,P as wa,r as ka,R as Sa,a as Pa,b as rr,S as ja,d as Ea,l as Na,m as Ta,e as Ca,f as kn,N as Ra}from"./runnable-block-editor-LQjhwiX1.js";import{b as La,c as Xt,r as ar,l as ir,f as Aa,g as _a,w as Oa}from"./chat-context-DLezfYEa.js";import{t as Da}from"./ChevronUp-DiTVmUiH.js";import{T as Ba,U as Fa,M as or,V as Ma,W as $a,b as za,X as Ka,Y as Ia,Z as Ua,_ as Va,$ as Ps,a0 as Ha}from"./agent-icon-g2PIrjzs.js";import{a as qa}from"./UserSquare-B_yRFcN6.js";import{s as Wa}from"./Plus-BnqPSlPj.js";import{a as lr,b as cr,P as dr}from"./popover-Dm_x8CV9.js";import{a as wt,b as kt,c as ur,d as fr,e as mr,C as pr}from"./command-R1e1yMQ9.js";import{c as Ga,a as Ja}from"./repository-binding-4nTgXz1S.js";import{a as On}from"./sandbox-lifecycle-context-CJodiAqU.js";import{e as Ya}from"./backoff-CrEUbyZT.js";import{r as Qa}from"./thread-intent-Ds79TVrW.js";import{u as hr}from"./use-session-runtime-BrkTaSa6.js";import{S as gr,d as Xa,f as Za,i as ei,g as ti,h as ni,j as si,k as ri,u as Dn,l as Bn,m as nt,n as ai,o as ii,q as oi,c as li,b as vr,t as ci,v as Ve,w as di,x as ui,y as fi,z as js,A as mi,B as pi,C as Es,D as hi,E as gi,e as vi}from"./site-editor-toast-BKVRfpA8.js";import{u as xi}from"./use-mobile-h4hHhZkm.js";import{T as Wt,a as Gt,c as Jt}from"./tooltip-bQVm_Ope.js";import{T as st}from"./toolbar-icon-button-BiR5ntfC.js";import{w as zt,i as bi}from"./variant-matcher-override-XY7K79P5.js";import{b as yi,w as Ns}from"./variant-draft-pointer-BeAKcq_c.js";import{u as xr,i as wi,B as ki,S as Si,C as Pi,a as ji,b as Ei,l as Ni,D as Ti}from"./blocks-tab-states-Dps89GrH.js";import{i as Ci,a as Ri,v as Li,b as Ai,s as St,n as Fn,c as br,f as Ke,d as yr,h as _i,e as Oi,g as Di,j as Bi,k as Fi,p as Mi,N as $i,l as zi,r as Ki,m as Ts,o as Ii}from"./parse-sections-Bc_lvOtq.js";import{r as Ui,D as Cs,w as Rs,b as Ls,a as Vi}from"./section-preview-url-7zfngvgW.js";import{p as Hi,a as qi,u as Wi,b as As}from"./use-fast-preview-draft-url-B7ECUHMP.js";import{a as Gi,c as wr}from"./shell-layout-CnXya3zZ.js";import{u as kr,b as Ji}from"./use-sandbox-events-D98uWMd_.js";import{u as Cn}from"./useQueries-BSehCBUp.js";import{i as Yi}from"./LinkBroken01-DDgMbBWJ.js";import{u as Sr}from"./blocks-preview-workspace-context--o78Y3yp.js";import{MonacoCodeEditor as Qi}from"./monaco-editor-DEU78sxw.js";import{d as Xi}from"./utils-CkwBhBMS.js";import{R as _s,a as Kt,b as Os}from"./resizable-DAXTAODq.js";import{u as Zi,a as Sn}from"./experiments-tab-choice-C9wWsYd4.js";import{w as Rn}from"./device-hint-SeLRi17j.js";import{L as eo}from"./label-3hTmrxoy.js";import{a as to,T as Ds}from"./toggle-group-C7NFln-0.js";import{h as Pr,w as no,a as Bs}from"./preview-link-C762yHOt.js";import{r as so}from"./virtual-mcp-BzmRbmfQ.js";import{d as ro}from"./delay-CnY5UFtP.js";import{E as ao}from"./empty-state-_a1QMwjl.js";import{G as Fs}from"./repository-picker-HOHNvmaE.js";import{R as io}from"./repository-import-picker-De4sf2Gs.js";import{r as oo}from"./preview-source-BsRLGWUP.js";import{C as lo,s as co,L as uo,R as Yt,D as Ms}from"./secret-ciphertext-qv17emf3.js";import{A as fo,a as mo,b as po}from"./alert-kpgdNVxk.js";import{u as ho}from"./use-task-metadata-DuF2rBuH.js";function go(t){const e=ce.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(Ba,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(Fa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function vo(t){const e=ce.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Ht("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let x;e[14]!==i.command?(x=i.command&&s.jsx(lo,{command:i.command}),e[14]=i.command,e[15]=x):x=e[15];let b;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==x?(b=s.jsxs("div",{className:m,children:[f,x,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=x,e[20]=b):b=e[20];let j;return e[21]!==a||e[22]!==d||e[23]!==b?(j=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,b]}),e[21]=a,e[22]=d,e[23]=b,e[24]=j):j=e[24],j}const xo=[];function Qt(t){const e=ce.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?xo:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let x;e[0]!==i?(x=s.jsx(go,{waiting:i}),e[0]=i,e[1]=x):x=e[1];let b;e[2]!==m||e[3]!==n?(b=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=b):b=e[4];let j;e[5]!==r?(j=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=j):j=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==b||e[10]!==j?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,b,j]}),e[7]=f,e[8]=x,e[9]=b,e[10]=j,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,v)=>s.jsx(vo,{index:v+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let E;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(E=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=E):E=e[19],E}function bo(t){const e=ce.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=Ce();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(fo,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(mo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(po,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let O;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(O=co(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=O):O=e[6];const{title:R,body:_}=O;let A;e[7]!==_?(A=s.jsx(Yt,{text:_}),e[7]=_,e[8]=A):A=e[8];let B;e[9]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Ms,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=B):B=e[9];let L;return e[10]!==l||e[11]!==A||e[12]!==R?(L=s.jsx(Qt,{headingLevel:2,waiting:!1,title:R,lead:A,alerts:l,footer:B}),e[10]=l,e[11]=A,e[12]=R,e[13]=L):L=e[13],L}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let x;e[18]!==l||e[19]!==n.kind?(x=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(uo,{})]}),e[18]=l,e[19]=n.kind,e[20]=x):x=e[20];let b;e[21]!==a?(b=a("decoServe.guide.step1.title"),e[21]=a,e[22]=b):b=e[22];let j;e[23]!==a?(j=a("decoServe.guide.step1.body"),e[23]=a,e[24]=j):j=e[24];let g;e[25]!==j?(g=s.jsx(Yt,{text:j}),e[25]=j,e[26]=g):g=e[26];let k;e[27]!==b||e[28]!==g?(k={title:b,body:g,command:gr},e[27]=b,e[28]=g,e[29]=k):k=e[29];let E;e[30]!==a?(E=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=E):E=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let v;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(v=n.kind==="needs-gesture"?s.jsx(Ie,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=v):v=e[40];let w;e[41]!==E||e[42]!==y||e[43]!==v?(w={title:E,body:y,after:v},e[41]=E,e[42]=y,e[43]=v,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(Ms,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==x?(N=s.jsx(Qt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:x,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=x,e[54]=N):N=e[54],N}function yo(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const wo=15e3,ko=3e3;function So(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(v,w)=>setTimeout(v,w),clearTimer:o=v=>clearTimeout(v),timeoutMs:l=ko}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,x=null,b=null;const j=()=>u.visibilityState==="hidden",g=v=>{d={...d,...v},i(d)},k=async v=>{b=new AbortController;const w=b,T=a(()=>w.abort(),l);try{return await n(v,w.signal),!0}catch(P){if(p)return!1;const N=Za(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:v}}):d.problem?.endpoint===v&&g({problem:null}),!1}finally{o(T),b=null}},E=async()=>{if(x=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(j()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const v of e){if(p)break;if(await k(v)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(v);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),j()){g({status:"paused"});return}x=a(()=>{E()},Xa(f,wo))}}};function y(){if(!p){if(j()){x!==null&&(o(x),x=null),m||g({status:"paused"});return}x!==null&&o(x),f=0,E()}}return u.addEventListener("visibilitychange",y),i(d),E(),()=>{p=!0,x!==null&&o(x),b?.abort(),u.removeEventListener("visibilitychange",y)}}function Po(t,e){return ti(ni({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const jo=["loopback-network","local-network-access"];async function Eo(){if(ei(window.location.origin))return null;for(const t of jo)try{return await navigator.permissions.query({name:t})}catch{}return null}let jr=null,$s=!1;const Pn=new Set;function No(t){if(Pn.add(t),!$s){$s=!0;const e=n=>{jr=n;for(const r of Pn)r()};Eo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Pn.delete(t)}const To={status:"stopped",firstRoundDone:!1,problem:null},jn=new Map;function Co(t){const e=jn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=So({candidates:t.split(" "),probe:Po,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,jn.delete(t))})};return jn.set(t,u),u}function Er(){return S.useSyncExternalStore(No,Ks,Ks)}const Ro=()=>()=>{},zs=()=>To,Ks=()=>jr;function md(t){const e=ce.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=Er(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Co(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Ro,d?.getSnapshot??zs,d?.getSnapshot??zs),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let x;return e[5]!==a||e[6]!==p||e[7]!==m?(x={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=x):x=e[8],x}const En={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Lo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...En,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?En:a&&t.hostedPointerPending&&!i?{...En,showDecidingLoader:!0}:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ao=1e4,_o=1e3,Oo=3e4;function Do({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Ao)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const x=Ya(Oo,_o,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const b=t.current,j=a.current;!b||!j||!o.current||(b.src=j,d())},x)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const Bo=1500,Fo=500;function Mo({iframe:t,reload:e,waitMs:n=Bo,confirmMs:r=Fo}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const $o=qt({tag:Te(),id:Te(),classes:Te(),text:Te(),html:Te(),manifestKey:Te().nullable(),componentName:Te().nullable(),parents:Te(),url:Te(),path:Te(),viewport:qt({width:rt(),height:rt()}),position:qt({x:rt(),y:rt()})}),zo=`(function() {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-TqSLQIU8.js","assets/index-BphI8pNH.js","assets/index-MPdUOMBb.css","assets/chat-context-DqNUlJMY.js","assets/use-panel-navigate-C-ip5ing.js","assets/thread-route-BEIPJEss.js","assets/use-project-scope-DN9qkINS.js","assets/repository-binding-CqjA7Tko.js","assets/use-mcp-client-DsrOnW9o.js","assets/auth-BypL5L1O.js","assets/autosend-B4f5gabb.js","assets/thread-intent-BQGp3MKl.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-B6MhK1l7.js","assets/task-board-Cv7D_3uN.js","assets/schema-Ddw2ah-q.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-CmWo-JmL.js","assets/use-ai-providers-D11veeve.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-B2e749tN.js","assets/runnable-block-editor-DXVt1mRj.js","assets/utils-DnxtSQ0E.js","assets/ZoomOut-DzrH576O.js","assets/Image01-D_y3XkIW.js","assets/agent-icon-BVqmbz-P.js","assets/AlertCircle-CzTXJ0ax.js","assets/Tool01-_CVpzZpk.js","assets/ArrowUp-DUhCibLH.js","assets/ArrowLeft-BQThfb60.js","assets/LinkBroken01-Dz2vlPBe.js","assets/ShoppingBag01-DvN3FHxE.js","assets/Building02-BOLEL9nK.js","assets/CheckCircle-OCgBlAwW.js","assets/ChevronUp-DtSKb4be.js","assets/ChevronSelectorVertical-DaDJpoIU.js","assets/UserSquare-B7fe7FYj.js","assets/Copy01-DVWv3lef.js","assets/CreditCard01-Bw5uGiku.js","assets/DotsVertical-CEoX1VVK.js","assets/Globe04-CMBPkECo.js","assets/SwitchHorizontal01-D6mwjnXs.js","assets/Key01-p2EsnMlr.js","assets/Link01-D28gAr0F.js","assets/Minus-DNpWuD14.js","assets/Monitor01-CYm-wjzD.js","assets/Sun-DFIh8Vd-.js","assets/Play-cNq95jJS.js","assets/Plus-C4rGoU1F.js","assets/SearchMd-BYCOzBqa.js","assets/Trash01-CgNTH-jr.js","assets/Upload01-CiTZ5ZQQ.js","assets/User01-vLr2BfmM.js","assets/Users01-BgSWeeD_.js","assets/XClose-B_rQyiiY.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-DRaIXAj-.js","assets/format-time-Cq80KKvY.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-CXUiqrZ3.js","assets/use-copy-Ctyjo3u8.js","assets/usage-stats-BHO2m1GZ.js","assets/tool-namespace-DqsoHKmd.js","assets/form-uqsH1s-y.js","assets/label-BXumUTqC.js","assets/utils-CVEq3hMx.js","assets/markdown-Bqq3R66p.js","assets/use-mobile-DruvZ2zF.js","assets/tooltip-2YCPx1DM.js","assets/index-C5xgscqu.js","assets/use-clock-tick-DRqivY5H.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-tCfKhIA1.js","assets/types-6BxgL_uJ.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/shell-layout-DPflSDI7.js","assets/avatar-CFO-sRGJ.js","assets/command-C9iGFbUT.js","assets/index-CW0mTKOH.js","assets/integration-icon-C-_9oW7G.js","assets/project-icon-J_TfV9WN.js","assets/new-project-dialog-Cs8HMQlb.js","assets/repository-import-picker-DRcn5MCM.js","assets/use-navigate-to-agent-CfXi671z.js","assets/repository-picker-BL6xlIly.js","assets/useInfiniteQuery-Ctv8zOi3.js","assets/infiniteQueryObserver-CD6zPv_B.js","assets/collection-search-CVvFJ5Bb.js","assets/use-debounced-value-DppuiHxU.js","assets/required-auth-layout-BA3Gxw_5.js","assets/use-org-sso-B7o6rhq2.js","assets/shell-layout-CE2Eihra.css","assets/sheet-Dy9d78N0.js","assets/use-connection-hBtWetVy.js","assets/use-mcp-prompts-B5RvuVy4.js","assets/use-thread-outputs-9KkInEd1.js","assets/file-type-icon-CIdo5ojc.js","assets/secret-ciphertext-BA15G7qe.js","assets/alert-COKmPgNZ.js","assets/parse-sections-ClqXxi6i.js","assets/switch-B0lPkF5_.js","assets/textarea-aGNI5bvN.js","assets/site-editor-toast-n7tT-SpR.js","assets/use-session-runtime-RS_ZeJDS.js","assets/experiments-tab-choice-Ie5k_O6x.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-B-rKhgAE.js","assets/sandbox-git-api-CH_-QFpD.js","assets/popover-D-MLGIKG.js","assets/blocks-tab-states-CwfYFgj9.js","assets/slider-DMzP4oef.js","assets/index-unPBFo0y.js","assets/index-BdQq_4o_.js","assets/tooltipContext-CgeI21sB.js","assets/CategoricalChart-BtQQT8Ex.js","assets/index-kjyiSPIZ.js","assets/ActiveShapeUtils-EYkJV7tD.js","assets/Sector-23KRNcXn.js","assets/symbol-CcauWbN2.js","assets/empty-state-bJzQYitF.js","assets/scroll-area-GNWuujdQ.js","assets/monaco-editor-DZ2Rp_C7.js","assets/editor-DxbkHv3R.js","assets/calendar-AEesHfNc.js","assets/select-BAxIwkW7.js","assets/editor-classes-C__SrxMV.js","assets/core.esm-Bnj1keGH.js","assets/sortable.esm-BEpH5tbt.js","assets/toggle-group-DaYieoyW.js","assets/active-indicator-CCMhAsc_.js","assets/combobox-CS_HItwQ.js","assets/alert-dialog-Bbqu21pF.js","assets/search-input-i8DAXvnS.js","assets/tabs-fkqYJpP8.js","assets/use-file-configs-BukUB2a7.js","assets/asset-utils-CQBKR3VN.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/mustache-DuPMqXPT.js","assets/use-section-preview-base-NrYdhHI5.js","assets/section-preview-url-7zfngvgW.js","assets/use-members-DQZYP7Cb.js","assets/use-org-auth-client-CSFZu3Wj.js","assets/page-seo-form-WBlhJY38.js","assets/use-apply-named-rule-B4OGys4b.js","assets/use-move-blocks-C7t8R0hh.js","assets/variant-matcher-override-BvLc7beb.js","assets/variant-draft-pointer-BeAKcq_c.js"])))=>i.map(i=>d[i]);
2
+ import{c as ce,j as s,r as S,l as Ht,b as Ce,B as Ie,aF as qt,aW as rt,aG as Te,q as Xs,D as Zs,K as er,s as tr,v as nr,e as ua,h as Pt,I as Tn,w as fa,aX as ma,a2 as _n,aY as pa,aU as ha,au as ys,aw as ws,a5 as ga,P as ks,y as va,t as yn,o as xa,m as ba}from"./index-BphI8pNH.js";import{u as sr,g as ya,c as Ss,B as wn,P as wa,r as ka,R as Sa,a as Pa,b as rr,S as ja,d as Ea,l as Na,m as Ta,e as Ca,f as kn,N as Ra}from"./runnable-block-editor-DXVt1mRj.js";import{b as La,c as Xt,r as ar,l as ir,f as Aa,g as _a,w as Oa}from"./chat-context-DqNUlJMY.js";import{t as Da}from"./ChevronUp-DtSKb4be.js";import{T as Ba,U as Fa,M as or,V as Ma,W as $a,b as za,X as Ka,Y as Ia,Z as Ua,_ as Va,$ as Ps,a0 as Ha}from"./agent-icon-BVqmbz-P.js";import{a as qa}from"./UserSquare-B7fe7FYj.js";import{s as Wa}from"./Plus-C4rGoU1F.js";import{a as lr,b as cr,P as dr}from"./popover-D-MLGIKG.js";import{a as wt,b as kt,c as ur,d as fr,e as mr,C as pr}from"./command-C9iGFbUT.js";import{c as Ga,a as Ja}from"./repository-binding-CqjA7Tko.js";import{a as On}from"./sandbox-lifecycle-context-CAD11jz7.js";import{e as Ya}from"./backoff-CrEUbyZT.js";import{r as Qa}from"./thread-intent-BQGp3MKl.js";import{u as hr}from"./use-session-runtime-RS_ZeJDS.js";import{S as gr,d as Xa,f as Za,i as ei,g as ti,h as ni,j as si,k as ri,u as Dn,l as Bn,m as nt,n as ai,o as ii,q as oi,c as li,b as vr,t as ci,v as Ve,w as di,x as ui,y as fi,z as js,A as mi,B as pi,C as Es,D as hi,E as gi,e as vi}from"./site-editor-toast-n7tT-SpR.js";import{u as xi}from"./use-mobile-DruvZ2zF.js";import{T as Wt,a as Gt,c as Jt}from"./tooltip-2YCPx1DM.js";import{T as st}from"./toolbar-icon-button-3blDPoB6.js";import{w as zt,i as bi}from"./variant-matcher-override-BvLc7beb.js";import{b as yi,w as Ns}from"./variant-draft-pointer-BeAKcq_c.js";import{u as xr,i as wi,B as ki,S as Si,C as Pi,a as ji,b as Ei,l as Ni,D as Ti}from"./blocks-tab-states-CwfYFgj9.js";import{i as Ci,a as Ri,v as Li,b as Ai,s as St,n as Fn,c as br,f as Ke,d as yr,h as _i,e as Oi,g as Di,j as Bi,k as Fi,p as Mi,N as $i,l as zi,r as Ki,m as Ts,o as Ii}from"./parse-sections-ClqXxi6i.js";import{r as Ui,D as Cs,w as Rs,b as Ls,a as Vi}from"./section-preview-url-7zfngvgW.js";import{p as Hi,a as qi,u as Wi,b as As}from"./use-fast-preview-draft-url-6n7ATrzr.js";import{a as Gi,c as wr}from"./shell-layout-DPflSDI7.js";import{u as kr,b as Ji}from"./use-sandbox-events-B-rKhgAE.js";import{u as Cn}from"./useQueries-BRUig2bT.js";import{i as Yi}from"./LinkBroken01-Dz2vlPBe.js";import{u as Sr}from"./blocks-preview-workspace-context-Bq9hpUEB.js";import{MonacoCodeEditor as Qi}from"./monaco-editor-DZ2Rp_C7.js";import{d as Xi}from"./utils-DnxtSQ0E.js";import{R as _s,a as Kt,b as Os}from"./resizable-Bu3AyxKl.js";import{u as Zi,a as Sn}from"./experiments-tab-choice-Ie5k_O6x.js";import{w as Rn}from"./device-hint-SeLRi17j.js";import{L as eo}from"./label-BXumUTqC.js";import{a as to,T as Ds}from"./toggle-group-DaYieoyW.js";import{h as Pr,w as no,a as Bs}from"./preview-link-C762yHOt.js";import{r as so}from"./virtual-mcp-CKcyAjRE.js";import{d as ro}from"./delay-CnY5UFtP.js";import{E as ao}from"./empty-state-bJzQYitF.js";import{G as Fs}from"./repository-picker-BL6xlIly.js";import{R as io}from"./repository-import-picker-DRcn5MCM.js";import{r as oo}from"./preview-source-BsRLGWUP.js";import{C as lo,s as co,L as uo,R as Yt,D as Ms}from"./secret-ciphertext-BA15G7qe.js";import{A as fo,a as mo,b as po}from"./alert-COKmPgNZ.js";import{u as ho}from"./use-task-metadata-DYSGuNJN.js";function go(t){const e=ce.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(Ba,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(Fa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function vo(t){const e=ce.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Ht("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let x;e[14]!==i.command?(x=i.command&&s.jsx(lo,{command:i.command}),e[14]=i.command,e[15]=x):x=e[15];let b;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==x?(b=s.jsxs("div",{className:m,children:[f,x,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=x,e[20]=b):b=e[20];let j;return e[21]!==a||e[22]!==d||e[23]!==b?(j=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,b]}),e[21]=a,e[22]=d,e[23]=b,e[24]=j):j=e[24],j}const xo=[];function Qt(t){const e=ce.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?xo:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let x;e[0]!==i?(x=s.jsx(go,{waiting:i}),e[0]=i,e[1]=x):x=e[1];let b;e[2]!==m||e[3]!==n?(b=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=b):b=e[4];let j;e[5]!==r?(j=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=j):j=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==b||e[10]!==j?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,b,j]}),e[7]=f,e[8]=x,e[9]=b,e[10]=j,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,v)=>s.jsx(vo,{index:v+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let E;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(E=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=E):E=e[19],E}function bo(t){const e=ce.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=Ce();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(fo,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(mo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(po,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let O;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(O=co(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=O):O=e[6];const{title:R,body:_}=O;let A;e[7]!==_?(A=s.jsx(Yt,{text:_}),e[7]=_,e[8]=A):A=e[8];let B;e[9]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Ms,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=B):B=e[9];let L;return e[10]!==l||e[11]!==A||e[12]!==R?(L=s.jsx(Qt,{headingLevel:2,waiting:!1,title:R,lead:A,alerts:l,footer:B}),e[10]=l,e[11]=A,e[12]=R,e[13]=L):L=e[13],L}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let x;e[18]!==l||e[19]!==n.kind?(x=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(uo,{})]}),e[18]=l,e[19]=n.kind,e[20]=x):x=e[20];let b;e[21]!==a?(b=a("decoServe.guide.step1.title"),e[21]=a,e[22]=b):b=e[22];let j;e[23]!==a?(j=a("decoServe.guide.step1.body"),e[23]=a,e[24]=j):j=e[24];let g;e[25]!==j?(g=s.jsx(Yt,{text:j}),e[25]=j,e[26]=g):g=e[26];let k;e[27]!==b||e[28]!==g?(k={title:b,body:g,command:gr},e[27]=b,e[28]=g,e[29]=k):k=e[29];let E;e[30]!==a?(E=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=E):E=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let v;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(v=n.kind==="needs-gesture"?s.jsx(Ie,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=v):v=e[40];let w;e[41]!==E||e[42]!==y||e[43]!==v?(w={title:E,body:y,after:v},e[41]=E,e[42]=y,e[43]=v,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(Ms,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==x?(N=s.jsx(Qt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:x,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=x,e[54]=N):N=e[54],N}function yo(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const wo=15e3,ko=3e3;function So(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(v,w)=>setTimeout(v,w),clearTimer:o=v=>clearTimeout(v),timeoutMs:l=ko}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,x=null,b=null;const j=()=>u.visibilityState==="hidden",g=v=>{d={...d,...v},i(d)},k=async v=>{b=new AbortController;const w=b,T=a(()=>w.abort(),l);try{return await n(v,w.signal),!0}catch(P){if(p)return!1;const N=Za(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:v}}):d.problem?.endpoint===v&&g({problem:null}),!1}finally{o(T),b=null}},E=async()=>{if(x=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(j()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const v of e){if(p)break;if(await k(v)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(v);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),j()){g({status:"paused"});return}x=a(()=>{E()},Xa(f,wo))}}};function y(){if(!p){if(j()){x!==null&&(o(x),x=null),m||g({status:"paused"});return}x!==null&&o(x),f=0,E()}}return u.addEventListener("visibilitychange",y),i(d),E(),()=>{p=!0,x!==null&&o(x),b?.abort(),u.removeEventListener("visibilitychange",y)}}function Po(t,e){return ti(ni({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const jo=["loopback-network","local-network-access"];async function Eo(){if(ei(window.location.origin))return null;for(const t of jo)try{return await navigator.permissions.query({name:t})}catch{}return null}let jr=null,$s=!1;const Pn=new Set;function No(t){if(Pn.add(t),!$s){$s=!0;const e=n=>{jr=n;for(const r of Pn)r()};Eo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>Pn.delete(t)}const To={status:"stopped",firstRoundDone:!1,problem:null},jn=new Map;function Co(t){const e=jn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=So({candidates:t.split(" "),probe:Po,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,jn.delete(t))})};return jn.set(t,u),u}function Er(){return S.useSyncExternalStore(No,Ks,Ks)}const Ro=()=>()=>{},zs=()=>To,Ks=()=>jr;function md(t){const e=ce.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=Er(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Co(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Ro,d?.getSnapshot??zs,d?.getSnapshot??zs),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let x;return e[5]!==a||e[6]!==p||e[7]!==m?(x={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=x):x=e[8],x}const En={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Lo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...En,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?En:a&&t.hostedPointerPending&&!i?{...En,showDecidingLoader:!0}:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ao=1e4,_o=1e3,Oo=3e4;function Do({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Ao)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const x=Ya(Oo,_o,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const b=t.current,j=a.current;!b||!j||!o.current||(b.src=j,d())},x)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const Bo=1500,Fo=500;function Mo({iframe:t,reload:e,waitMs:n=Bo,confirmMs:r=Fo}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const $o=qt({tag:Te(),id:Te(),classes:Te(),text:Te(),html:Te(),manifestKey:Te().nullable(),componentName:Te().nullable(),parents:Te(),url:Te(),path:Te(),viewport:qt({width:rt(),height:rt()}),position:qt({x:rt(),y:rt()})}),zo=`(function() {
3
3
  if (window.__visualEditorActive) return;
4
4
  window.__visualEditorActive = true;
5
5
 
@@ -548,4 +548,4 @@ import{c as ce,j as s,r as S,l as Ht,b as Ce,B as Ie,aF as qt,aW as rt,aG as Te,
548
548
  }
549
549
  });
550
550
  })();`;function Ln(t,e,n=!1){let r=t,i=typeof r?.__resolveType=="string"?r.__resolveType:"";for(let u=0;i&&u<5;u++){const a=e[i];if(a&&typeof a=="object"&&"__resolveType"in a){const o=a.__resolveType;if(typeof o=="string"&&o&&o!==i){r=a,i=o;continue}}break}if(!i)return[];if(i.includes("flags/multivariate")||n&&Ci(i,n)){const u=Array.isArray(r.variants)?r.variants:[];if(u.length===0||u.every(l=>{const d=l?.rule;return Ri(d?.__resolveType,n)}))return null;const o=[];for(const l of u){const d=Li(l,n);if(d&&typeof d=="object")for(const p of Ln(d,e,n)??[])o.includes(p)||o.push(p)}return o}if(Ai(i)){const u=r.section&&typeof r.section=="object"?Ln(r.section,e,n):[];return u===null?null:u.length?[i,...u]:[i]}return[i]}function tt(t){return t.replace(/[`*_]/g,"\\$&")}function Uo(t,e){const n=[`The user selected an element on the live preview and asked: **"${tt(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&n.push(`**Section resolveType:** \`${tt(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const r=`<${t.tag}${t.classes?` class="${tt(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${r}\``),t.parents&&n.push(`**DOM breadcrumb:** ${tt(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${tt(t.text)}"`),t.componentName&&n.push(`**Component name:** ${tt(t.componentName)}`);const i=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",i,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
551
- `)}function Vo(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function Ho(t){const e=ce.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=La(),{openSidePanel:l}=Gi(),d=Ce();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const $=Uo(n,i);l(),o({parts:[{type:"text",text:$}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=Vo(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const x=f,b=`${x.leftPct}%`,j=`${x.topPct}%`;let g;e[9]!==b||e[10]!==j?(g={left:b,top:j,width:"320px"},e[9]=b,e[10]=j,e[11]=g):g=e[11];let k;e[12]!==m?(k=$=>{$.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E=$=>u($.target.value),e[14]=E):E=e[14];let y;e[15]!==r?(y=$=>{$.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let v;e[17]!==d?(v=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=v):v=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==v?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:E,onKeyDown:y,placeholder:v,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=v,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let O;e[27]!==d?(O=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=O):O=e[28];let R;e[29]!==O?(R=s.jsx("title",{children:O}),e[29]=O,e[30]=R):R=e[30];let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=_):_=e[31];let A;e[32]!==R?(A=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,_]}),e[32]=R,e[33]=A):A=e[33];let B;e[34]!==P||e[35]!==N||e[36]!==A?(B=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:A}),e[34]=P,e[35]=N,e[36]=A,e[37]=B):B=e[37];let L;e[38]!==w||e[39]!==B||e[40]!==k?(L=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:k,children:[w,B]}),e[38]=w,e[39]=B,e[40]=k,e[41]=L):L=e[41];let U;return e[42]!==L||e[43]!==g?(U=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:L}),e[42]=L,e[43]=g,e[44]=U):U=e[44],U}const Us="site-links",qo=/details?page|\bpdp\b/i,Wo=/listingpage|\bplp\b/i;function Go(t,e,n){const r=new Set;for(const o of n)qo.test(o)&&r.add("product"),Wo.test(o)&&r.add("category");const i=St(Fn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const Jo=["rosa","preto","pink","black"];function It(t,e){const n=e.trim();return n?t(n):Jo.flatMap(r=>t(r))}function Yo(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const Nr=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Mn(t){return t.split("/")[0]??""}function Qo(t){const e=new Set;for(const n of t){const r=Mn(n);Nr.has(r)&&e.add(r)}return e}function Xo(t,e){const n=Mn(t);return!Nr.has(n)||e.size===0?!0:e.has(n)}const Zo=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>It(n=>Yo(t,n),e),optionsFromPayload:Ut},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Ut},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Ut},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Ut},{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:il}];function el(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of Zo){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&Xo(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Mn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(tl(t.has("category")?"category":"product")),a}function tl(t){return{kind:t,id:Us,resolveType:Us,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>ul(e,n)}}function He(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function nl(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=He(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=He(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function Tr(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function Cr(t){try{return decodeURIComponent(t)}catch{return t}}function sl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rl(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=sl(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function Rr(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=St(Fn(e)),{pattern:u,order:a}=rl(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?Cr(d):null}function Ut(t,e){const n=He(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=He(a);if(!o)continue;const l=Rr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=He(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?He(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function al(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?Cr(n):null}function il(t){const e=[],n=new Set,r=(i,u)=>{const a=He(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=al(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const ol=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 ll(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function cl(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function dl(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function ul(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=Rr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&ol.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:ll(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of dl(t))i(u,a,"product",o);for(const{href:u,text:a}of cl(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function xt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const Lr=1e4;function fl(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 ml(t,{resolveType:e,props:n}){const r=await fetch(si(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(Lr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function Vs(t,e){const n=await fetch(ri(t,e),{signal:AbortSignal.timeout(Lr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function pl(t,e,n){const r=e.optionsFromPayload(await Vs(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Ke(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await Vs(t,u),n).filter(o=>o.kind==="product");return Tr([r,a])}catch{return r}}function hl(t,e,n){return er.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function gl(t,e,n,r){if(e.homepageLinks)return pl(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>ml(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return Tr(a.map(o=>e.optionsFromPayload(o,r)))}function An(t,e,n,r,i){return{queryKey:hl(t,e,n),queryFn:()=>gl(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function bt(t){const e=ce.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(kt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(or,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ke(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(wt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Hs(t){const e=ce.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function vl(t){const e=ce.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=Ce(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[x,b]=S.useState(""),j=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=fl(l),y=[...new Set(n.map(Q=>k[Q.kind].noun))].join(" or ");let v;e[0]!==l||e[1]!==y?(v=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=v):v=e[2];const w=v,T={template:r,paramName:i};let P;e[3]!==m?(P=(Q,se)=>({source:Q,query:se,options:Q.clientFilter?xt(se.data??[],m):se.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,O=n.filter(jl),R=n.filter(Pl),_=Cn({queries:O.map(Q=>An(a,Q,x,T,d))});let A;e[5]!==_||e[6]!==N?(A=(Q,se)=>N(Q,_[se]),e[5]=_,e[6]=N,e[7]=A):A=e[7];const B=O.map(A),L=B.length===0||B.every(Sl),U=Cn({queries:R.map(Q=>An(a,Q,x,T,d&&L))});let $;e[8]!==U||e[9]!==N?($=(Q,se)=>N(Q,U[se]),e[8]=U,e[9]=N,e[10]=$):$=e[10];const G=R.map($),V=L?G:B,W=V.length===1&&V[0]?.source.homepageLinks?V[0]:null,J=W&&!W.query.isLoading&&!W.query.isError?W?.query.data??[]:[],ae=xt(J.filter(kl),m),C=xt(J.filter(wl),m),q=ae.length>0&&C.length>0,K=Q=>{p(Q),j.current&&clearTimeout(j.current),f(Q?u:""),b(Q?u:"")};let X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>{f(Q),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{b(Q)},300)},e[11]=X):X=e[11];const M=X,Y=Q=>{o(Q),K(!1)},Z=br(m),I=Ke(r,{[i]:Z}),ie=Zs,ne=Xs,ee="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",le=yl;let pe;e[12]!==g||e[13]!==l?(pe=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=pe):pe=e[14];let de;e[15]!==pe?(de=s.jsx(tr,{className:"sr-only",children:s.jsx(nr,{children:pe})}),e[15]=pe,e[16]=de):de=e[16];let be;e[17]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(or,{size:16,className:"shrink-0 text-foreground"}),e[17]=be):be=e[17];let fe;e[18]!==l?(fe=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=fe):fe=e[19];let je;e[20]!==g?(je=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:g}),e[20]=g,e[21]=je):je=e[21];let ye;e[22]!==fe||e[23]!==je?(ye=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[be,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[fe," ",je]})]}),e[22]=fe,e[23]=je,e[24]=ye):ye=e[24];const we=fr,De=!1,at="min-h-0 flex-1";let ue;e[25]!==w||e[26]!==m?(ue=s.jsx(mr,{autoFocus:!0,placeholder:w,value:m,onValueChange:M}),e[25]=w,e[26]=m,e[27]=ue):ue=e[27];const Ae=ur,Be="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Fe;e[28]!==l?(Fe=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Fe):Fe=e[29];let _e;e[30]!==Fe?(_e=s.jsx(pr,{children:Fe}),e[30]=Fe,e[31]=_e):_e=e[31];const it=Z&&s.jsx(wt,{className:"shrink-0",children:s.jsxs(kt,{value:`__raw__:${Z}`,className:"gap-3 py-2",onSelect:()=>Y(Z),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Yi,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:Z,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:I})]})]})}),qe=q?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(bt,{heading:k.category.heading,iconKind:"category",options:ae,template:r,paramName:i,keyPrefix:`${W?.source.id}:cat`,onSelect:Y})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(bt,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${W?.source.id}:prod`,onSelect:Y})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:V.map(Q=>{const{source:se,query:ve,options:$e}=Q,{noun:ot}=k[se.kind];if(ve.isLoading)return s.jsx(Hs,{text:l("sandbox.pathParamPickerChip.loading",{noun:ot})},se.id);if(ve.isError)return s.jsx(Hs,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},se.id);if(se.homepageLinks){const We=ve.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(bt,{heading:k.category.heading,iconKind:"category",options:xt(We.filter(bl),m),template:r,paramName:i,keyPrefix:`${se.id}:cat`,onSelect:Y}),s.jsx(bt,{heading:k.product.heading,iconKind:"product",options:xt(We.filter(xl),m),template:r,paramName:i,keyPrefix:`${se.id}:prod`,onSelect:Y})]},se.id)}return s.jsx(bt,{heading:V.length>1?k[se.kind].heading:void 0,iconKind:se.kind,options:$e,template:r,paramName:i,keyPrefix:se.id,onSelect:Y},se.id)})});let oe;e[32]!==Ae||e[33]!==_e||e[34]!==it||e[35]!==qe?(oe=s.jsxs(Ae,{className:Be,children:[_e,it,qe]}),e[32]=Ae,e[33]=_e,e[34]=it,e[35]=qe,e[36]=oe):oe=e[36];let Ee;e[37]!==we||e[38]!==ue||e[39]!==oe?(Ee=s.jsxs(we,{shouldFilter:De,className:at,children:[ue,oe]}),e[37]=we,e[38]=ue,e[39]=oe,e[40]=Ee):Ee=e[40];let Re;e[41]!==ne||e[42]!==de||e[43]!==ye||e[44]!==Ee||e[45]!==le?(Re=s.jsxs(ne,{className:ee,onClick:le,children:[de,ye,Ee]}),e[41]=ne,e[42]=de,e[43]=ye,e[44]=Ee,e[45]=le,e[46]=Re):Re=e[46];let Me;return e[47]!==ie||e[48]!==K||e[49]!==d||e[50]!==Re?(Me=s.jsx(ie,{open:d,onOpenChange:K,children:Re}),e[47]=ie,e[48]=K,e[49]=d,e[50]=Re,e[51]=Me):Me=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:Q=>{Q.stopPropagation(),K(!0)},children:u||g}),Me]})}function xl(t){return t.kind==="product"}function bl(t){return t.kind!=="product"}function yl(t){return t.stopPropagation()}function wl(t){return t.kind==="product"}function kl(t){return t.kind!=="product"}function Sl(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Pl(t){return t.isFallback}function jl(t){return!t.isFallback}function El(t){const e=ce.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const x={template:r,paramName:i},b=n.filter(Nl);l=Cn,o=b.map(j=>An(u,j,"",x,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const x of p){if(x.isLoading)break;const b=x.data?.[0];if(b){f(!0),queueMicrotask(()=>a(b.value));break}}return null}function Nl(t){return!t.isFallback}function Tl(t){const e=ce.c(31),{name:n,value:r,onCommit:i}=t,u=Ce(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,x=a||f;let b;e[3]!==x?(b=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:x}),e[3]=x,e[4]=b):b=e[4];let j;e[5]!==f||e[6]!==u?(j=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=j):j=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let E;e[10]!==r?(E=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=E):E=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=br(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let v;e[16]!==a||e[17]!==f||e[18]!==j||e[19]!==E||e[20]!==y?(v=s.jsx("input",{type:"text",value:a,placeholder:f,title:j,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Cl,onChange:g,onFocus:k,onKeyDown:E,onBlur:y}),e[16]=a,e[17]=f,e[18]=j,e[19]=E,e[20]=y,e[21]=v):v=e[21];let w;e[22]!==b||e[23]!==v?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[b,v]}),e[22]=b,e[23]=v,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[s.jsx(Ma,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Cl(t){return t.stopPropagation()}function Rl(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Ll(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Al(t){return t.showPreviewToolbar&&t.contentEditingEnabled}class Ar extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function _l(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new Ar;return n}async function Ol(t,e,n){return n?Ss(t,e,await _l(n.meta,n.loadMeta)):Ss(t,e)}function Dl(t){const e=ce.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=sr(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l,schema:d}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const p=ya(a),m=l?{...l,name:a,path:o}:await Ol(a,o,d);return await r.mutateAsync({blockKey:p,data:m}),{key:p,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],ua(i)}function Bl(t){const e=ce.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=Ce();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let x;e[2]!==d?(x=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=x):x=e[3];const[b,j]=S.useState(x),[g,k]=S.useState(wn),[E,y]=S.useState(null),[v,w]=S.useState(n);n!==v&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),j(d("sectionsEditor.createPageModal.defaultPagePath")),k(wn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=fe=>{!fe&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let O;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==b||e[11]!==T||e[12]!==g?(O=async fe=>{fe.preventDefault();const je=m.trim(),ye=b.trim();if(!je||!ye||l)return;const we=yr(ye);if(we){y(we);return}y(null),await o({name:je,path:ye,templateKey:T&&g!==wn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=b,e[11]=T,e[12]=g,e[13]=O):O=e[13];const R=O,_=E??u;let A;e[14]!==d?(A=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=A):A=e[15];let B;e[16]!==A?(B=s.jsx(tr,{children:s.jsx(nr,{children:A})}),e[16]=A,e[17]=B):B=e[17];let L;e[18]!==d?(L=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=L):L=e[19];let U;e[20]!==L?(U=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:L}),e[20]=L,e[21]=U):U=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=fe=>f(fe.target.value),e[22]=$):$=e[22];let G;e[23]!==d?(G=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=G):G=e[24];let V;e[25]!==l||e[26]!==m||e[27]!==G?(V=s.jsx(Tn,{id:"new-page-name",value:m,onChange:$,placeholder:G,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=G,e[28]=V):V=e[28];let W;e[29]!==V||e[30]!==U?(W=s.jsxs("div",{className:"space-y-1.5",children:[U,V]}),e[29]=V,e[30]=U,e[31]=W):W=e[31];let H;e[32]!==d?(H=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=H):H=e[33];let J;e[34]!==H?(J=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:H}),e[34]=H,e[35]=J):J=e[35];let ae;e[36]===Symbol.for("react.memo_cache_sentinel")?(ae=fe=>j(fe.target.value),e[36]=ae):ae=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let q;e[39]!==l||e[40]!==b||e[41]!==C?(q=s.jsx(Tn,{id:"new-page-path",value:b,onChange:ae,placeholder:C,disabled:l}),e[39]=l,e[40]=b,e[41]=C,e[42]=q):q=e[42];let K;e[43]!==J||e[44]!==q?(K=s.jsxs("div",{className:"space-y-1.5",children:[J,q]}),e[43]=J,e[44]=q,e[45]=K):K=e[45];let X;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(X=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(wa,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=X):X=e[51];let M;e[52]!==_?(M=_&&s.jsx("p",{className:"text-xs text-destructive",children:_}),e[52]=_,e[53]=M):M=e[53];let Y;e[54]!==W||e[55]!==K||e[56]!==X||e[57]!==M?(Y=s.jsxs("div",{className:"space-y-4 py-4",children:[W,K,X,M]}),e[54]=W,e[55]=K,e[56]=X,e[57]=M,e[58]=Y):Y=e[58];let Z;e[59]!==r?(Z=()=>r(!1),e[59]=r,e[60]=Z):Z=e[60];let I;e[61]!==d?(I=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=I):I=e[62];let ie;e[63]!==l||e[64]!==Z||e[65]!==I?(ie=s.jsx(Ie,{type:"button",variant:"outline",onClick:Z,disabled:l,children:I}),e[63]=l,e[64]=Z,e[65]=I,e[66]=ie):ie=e[66];let ne;e[67]!==l||e[68]!==m||e[69]!==b?(ne=!m.trim()||!b.trim()||l,e[67]=l,e[68]=m,e[69]=b,e[70]=ne):ne=e[70];let ee;e[71]!==l||e[72]!==d?(ee=l?s.jsxs(s.Fragment,{children:[s.jsx(Pt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=ee):ee=e[73];let le;e[74]!==ne||e[75]!==ee?(le=s.jsx(Ie,{type:"submit",disabled:ne,children:ee}),e[74]=ne,e[75]=ee,e[76]=le):le=e[76];let pe;e[77]!==ie||e[78]!==le?(pe=s.jsxs(fa,{children:[ie,le]}),e[77]=ie,e[78]=le,e[79]=pe):pe=e[79];let de;e[80]!==R||e[81]!==Y||e[82]!==pe||e[83]!==B?(de=s.jsx(Xs,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[B,Y,pe]})}),e[80]=R,e[81]=Y,e[82]=pe,e[83]=B,e[84]=de):de=e[84];let be;return e[85]!==N||e[86]!==n||e[87]!==de?(be=s.jsx(Zs,{open:n,onOpenChange:N,children:de}),e[85]=N,e[86]=n,e[87]=de,e[88]=be):be=e[88],be}function Fl(t){const e=ce.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=Ce();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=sr(p);let f;e[4]!==m?(f=Pa((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const x=f;let b;e[6]!==l||e[7]!==o?(b=ka(o,l),e[6]=l,e[7]=o,e[8]=b):b=e[8];const{resolveType:j,props:g,title:k}=b;if(!j){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const E=`loader:${l}`;let y;e[13]!==l||e[14]!==j||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:j,title:k},e[13]=l,e[14]=j,e[15]=k,e[16]=y):y=e[16];let v;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==x||e[25]!==E||e[26]!==y||e[27]!==r?(v=s.jsx(Sa,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:Ml,onSaveReferencedBlock:x,showRun:!1},E),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=x,e[25]=E,e[26]=y,e[27]=r,e[28]=v):v=e[28],v}async function Ml(){}function $l(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function qs(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:$l(t.error)}}function zl(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 Kl(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=zl(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(i=>i.status==="error"&&!i.hasData&&i.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const Il=S.lazy(()=>ma(()=>import("./sections-editor-DVqxZTWF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147])).then(t=>({default:t.SectionsEditor})));function Ws(t){const e=ce.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=_n(),{currentBranch:o,taskId:l}=Xt(),d=kr(),p=On(),m=Sr(),f=d.lifecycle.phase==="running",x=p.previewUrl;let b;e[0]!==o||e[1]!==a||e[2]!==x||e[3]!==l||e[4]!==n?(b=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:x}:null,e[0]=o,e[1]=a,e[2]=x,e[3]=l,e[4]=n,e[5]=b):b=e[5];const j=b,g=Dn(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const E=Bn(j,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const v=xr(j,y),w=Kl({lifecyclePhase:d.lifecycle.phase,decofile:qs(E),meta:qs(v),hasEditableContent:_i(E.data,v.data),fastPreviewActive:hr(n).runtime==="cms"||nt(g)}),T=rr()===void 0,P=Ul;if(wi(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Si,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(Pi,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(pa,{})),e[13]=C):C=e[13],C}if(E.data&&ai(v.data)){const C=m.state.target,q=C?.kind==="page"||C?.kind==="section"?C.key:null,K=q??"",X=o??"";let M;return e[14]!==E.data||e[15]!==q||e[16]!==a.slug||e[17]!==K||e[18]!==X||e[19]!==n?(M=P(s.jsx(ja,{orgSlug:a.slug,virtualMcpId:n,branch:X,decofile:E.data,initialKey:q,compact:!0},K)),e[14]=E.data,e[15]=q,e[16]=a.slug,e[17]=K,e[18]=X,e[19]=n,e[20]=M):M=e[20],M}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(ji,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==E||e[23]!==p||e[24]!==v||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([E.refetch(),v.refetch()])},e[22]=E,e[23]=p,e[24]=v,e[25]=w.source,e[26]=C):C=e[26];const q=C;let K;return e[27]!==q||e[28]!==w.source?(K=P(s.jsx(ki,{source:w.source,onRetry:q})),e[27]=q,e[28]=w.source,e[29]=K):K=e[29],K}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const O=N,R=m.state.target;if(R?.kind==="loader"&&E.data&&v.data){const C=o??"",q=x??null;let K;return e[31]!==E.data||e[32]!==v.data||e[33]!==a.slug||e[34]!==C||e[35]!==q||e[36]!==R.key||e[37]!==n?(K=O(s.jsx(Fl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:q,meta:v.data,decofile:E.data,blockKey:R.key})),e[31]=E.data,e[32]=v.data,e[33]=a.slug,e[34]=C,e[35]=q,e[36]=R.key,e[37]=n,e[38]=K):K=e[38],K}let _;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(_=R||!o?null:ar(ir(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=_):_=e[43];const A=_;let B="/",L=null,U=null;R?.kind==="page"?(B=R.path,L=R.key):R?.kind==="section"?U=R.key:A&&(B=A.path,L=A.pageKey);const $=L?`page:${L}`:U?`section:${U}`:`path:${B}`;let G;e[44]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}),e[44]=G):G=e[44];const V=o??"",W=x??void 0,H=U?null:u,J=!!L&&m.state.editSeoPageKey===L;let ae;return e[45]!==U||e[46]!==L||e[47]!==B||e[48]!==$||e[49]!==i||e[50]!==a.slug||e[51]!==H||e[52]!==J||e[53]!==V||e[54]!==W||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ae=O(s.jsx(S.Suspense,{fallback:G,children:s.jsx(Il,{orgSlug:a.slug,virtualMcpId:n,branch:V,previewReady:!0,previewUrl:W,currentPath:B,activePageBlockKey:L,activeGlobalBlockKey:U,externalSelection:H,initialEditSeo:J,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},$)})),e[45]=U,e[46]=L,e[47]=B,e[48]=$,e[49]=i,e[50]=a.slug,e[51]=H,e[52]=J,e[53]=V,e[54]=W,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ae):ae=e[59],ae}function Ul(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Gs(t){const e=ce.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=Ce(),o=rr(),l=o===!0,d=ii(n);let p;e[0]!==d||e[1]!==r?(p=oi(d,Xi(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=_n(),{currentBranch:x,taskId:b}=Xt(),g=On().previewUrl;let k;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==b||e[7]!==n?(k=x?{orgSlug:f.slug,virtualMcpId:n,branch:x,threadId:b??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=b,e[7]=n,e[8]=k):k=e[8];const y=Bn(k),v=x??"";let w;e[9]!==f.slug||e[10]!==v||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:v},e[9]=f.slug,e[10]=v,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=Ea(w),N=y.data?.[r],O=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,_=!x||R||O;let A;e[13]!==N?(A=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=A):A=e[14];const B=A;let L;e[15]!==r||e[16]!==_||e[17]!==T?(L=H=>{if(_)return;let J;try{J=JSON.parse(H)}catch{return}J===null||typeof J!="object"||Array.isArray(J)||T(r,J)},e[15]=r,e[16]=_,e[17]=T,e[18]=L):L=e[18];const U=L;let $;e[19]!==P?($=()=>({flush:P}),e[19]=P,e[20]=$):$=e[20],S.useImperativeHandle(u,$);let G;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(G=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Ie,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:s.jsx(ha,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=G):G=e[25];let V;e[26]!==y.data||e[27]!==P||e[28]!==B||e[29]!==O||e[30]!==R||e[31]!==r||e[32]!==_||e[33]!==U||e[34]!==a?(V=O?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Qi,{code:B,language:"json",readOnly:_,height:"100%",onChange:H=>U(H??""),onSave:H=>{U(H),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=B,e[29]=O,e[30]=R,e[31]=r,e[32]=_,e[33]=U,e[34]=a,e[35]=V):V=e[35];let W;return e[36]!==G||e[37]!==V?(W=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[G,V]}),e[36]=G,e[37]=V,e[38]=W):W=e[38],W}function _r(t){return t.contentEditingEnabled&&!t.isMobile}function Vl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Hl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ql(t){return _r({contentEditingEnabled:wr(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function Wl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function Gl(t){const e=Hi(t),{display:n}=t;let r=null;if(n.mode==="production"&&n.iframeBase)try{r=new URL(t.path,n.iframeBase).href}catch{r=null}const i=qi(r,e);return{value:e,frame:i?Rn(i,t.device):null,newTab:i}}function Jl(t){const e=ce.c(90),{tests:n,options:r,onChange:i,available:u}=t,a=Ce();let o;e[0]!==r?(o=Pr(r),e[0]=r,e[1]=o):o=e[1];const l=o;let d;e[2]!==r.tests?(d=r.tests??{},e[2]=r.tests,e[3]=d):d=e[3];const p=d;let m;e[4]!==i||e[5]!==r?(m=I=>{const ie=I?Ni(I):null,{at:ne,...ee}=r;i(ie?{...ee,at:ie}:ee)},e[4]=i,e[5]=r,e[6]=m):m=e[6];const f=m;let x;e[7]!==p||e[8]!==i||e[9]!==r?(x=(I,ie)=>{const ne={...p};ie==="on"?ne[I]=!0:ie==="off"?ne[I]=!1:delete ne[I];const{tests:ee,...le}=r;i(Object.keys(ne).length>0?{...le,tests:ne}:le)},e[7]=p,e[8]=i,e[9]=r,e[10]=x):x=e[10];const b=x;let j;e[11]!==a?(j=a("sandbox.previewAs.label"),e[11]=a,e[12]=j):j=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($a,{size:16}),e[13]=g):g=e[13];let k;e[14]!==l||e[15]!==j?(k=s.jsx(Wt,{asChild:!0,children:s.jsx(lr,{asChild:!0,children:s.jsx(st,{"aria-label":j,active:l,"data-testid":"preview-as-trigger",children:g})})}),e[14]=l,e[15]=j,e[16]=k):k=e[16];let E;e[17]!==a?(E=a("sandbox.previewAs.label"),e[17]=a,e[18]=E):E=e[18];let y;e[19]!==E?(y=s.jsx(Gt,{children:E}),e[19]=E,e[20]=y):y=e[20];let v;e[21]!==k||e[22]!==y?(v=s.jsxs(Jt,{children:[k,y]}),e[21]=k,e[22]=y,e[23]=v):v=e[23];let w;e[24]!==a?(w=a("sandbox.previewAs.label"),e[24]=a,e[25]=w):w=e[25];let T;e[26]!==w?(T=s.jsx("h3",{className:"text-sm font-medium",children:w}),e[26]=w,e[27]=T):T=e[27];let P;e[28]!==u||e[29]!==a?(P=a(u?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[28]=u,e[29]=a,e[30]=P):P=e[30];let N;e[31]!==P?(N=s.jsx("p",{className:"text-xs text-muted-foreground",children:P}),e[31]=P,e[32]=N):N=e[32];let O;e[33]!==T||e[34]!==N?(O=s.jsxs("div",{className:"flex flex-col gap-1",children:[T,N]}),e[33]=T,e[34]=N,e[35]=O):O=e[35];let R;e[36]!==a?(R=a("sandbox.previewAs.momentLabel"),e[36]=a,e[37]=R):R=e[37];let _;e[38]!==R?(_=s.jsx(eo,{htmlFor:"preview-as-moment",children:R}),e[38]=R,e[39]=_):_=e[39];let A;e[40]!==r.at?(A=Ei(r.at),e[40]=r.at,e[41]=A):A=e[41];let B;e[42]!==f?(B=I=>f(I.target.value),e[42]=f,e[43]=B):B=e[43];let L;e[44]!==A||e[45]!==B?(L=s.jsx(Tn,{id:"preview-as-moment",type:"datetime-local",className:Ti,value:A,onChange:B}),e[44]=A,e[45]=B,e[46]=L):L=e[46];const U=r.at===void 0;let $;e[47]!==f?($=()=>f(""),e[47]=f,e[48]=$):$=e[48];let G;e[49]!==a?(G=a("sandbox.previewAs.now"),e[49]=a,e[50]=G):G=e[50];let V;e[51]!==U||e[52]!==$||e[53]!==G?(V=s.jsx(Ie,{type:"button",variant:"ghost",size:"sm",disabled:U,onClick:$,children:G}),e[51]=U,e[52]=$,e[53]=G,e[54]=V):V=e[54];let W;e[55]!==L||e[56]!==V?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[L,V]}),e[55]=L,e[56]=V,e[57]=W):W=e[57];let H;e[58]!==a?(H=a("sandbox.previewAs.momentHint"),e[58]=a,e[59]=H):H=e[59];let J;e[60]!==H?(J=s.jsx("p",{className:"text-xs text-muted-foreground",children:H}),e[60]=H,e[61]=J):J=e[61];let ae;e[62]!==_||e[63]!==W||e[64]!==J?(ae=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,W,J]}),e[62]=_,e[63]=W,e[64]=J,e[65]=ae):ae=e[65];let C;e[66]!==a?(C=a("sandbox.previewAs.testsLabel"),e[66]=a,e[67]=C):C=e[67];let q;e[68]!==C?(q=s.jsx("span",{className:"text-sm font-medium",children:C}),e[68]=C,e[69]=q):q=e[69];let K;e[70]!==p||e[71]!==b||e[72]!==a||e[73]!==n?(K=n.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.noTests")}):s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(I=>s.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[s.jsx("span",{className:"min-w-0 truncate text-sm",children:I}),s.jsxs(to,{type:"single",variant:"outline",size:"sm",value:p[I]===void 0?"":p[I]?"on":"off",onValueChange:ie=>b(I,ie),"aria-label":I,children:[s.jsx(Ds,{value:"off",children:a("sandbox.previewAs.off")}),s.jsx(Ds,{value:"on",children:a("sandbox.previewAs.on")})]})]},I))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsHint")})]}),e[70]=p,e[71]=b,e[72]=a,e[73]=n,e[74]=K):K=e[74];let X;e[75]!==q||e[76]!==K?(X=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,K]}),e[75]=q,e[76]=K,e[77]=X):X=e[77];let M;e[78]!==l||e[79]!==i||e[80]!==a?(M=l&&s.jsx(Ie,{type:"button",variant:"outline",size:"sm",onClick:()=>i({}),children:a("sandbox.previewAs.reset")}),e[78]=l,e[79]=i,e[80]=a,e[81]=M):M=e[81];let Y;e[82]!==O||e[83]!==ae||e[84]!==X||e[85]!==M?(Y=s.jsxs(cr,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[O,ae,X,M]}),e[82]=O,e[83]=ae,e[84]=X,e[85]=M,e[86]=Y):Y=e[86];let Z;return e[87]!==v||e[88]!==Y?(Z=s.jsxs(dr,{children:[v,Y]}),e[87]=v,e[88]=Y,e[89]=Z):Z=e[89],Z}const Yl=15e3;function Ql(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Js(t){return t.loading?{...t,loading:!1}:t}const Xl=500,Zl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},Ys=1,Vt=["desktop","mobile","tablet"],ec=["preview","visual","blocks"],Qs={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function tc(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 yt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Nn(t,e){try{return new URL(t,e).href}catch{return null}}function nc(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function sc(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function rc(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function ac(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function ic({virtualMcpId:t}){const e=Ce(),n=xi(),{currentBranch:r,taskId:i,virtualMcpId:u}=Xt(),a=!!Aa(),o=Sr(),l=Ga(u===t?t:null),d=hr(t),p=so(l?.metadata?.ui?.layout??null),m=wr(p),f=_r({contentEditingEnabled:m,isMobile:n}),[x]=S.useState(()=>ql({cmsMode:p,isMobile:n})),[b,j]=ys(ws.previewEditingMode(t),c=>c&&ec.includes(c)?c:null),g=b??x,[k,E]=ys(ws.previewDeviceSize(t),c=>c&&Vt.includes(c)?c:"desktop"),[y,v]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[O,R]=S.useState(!1),_=S.useRef(null),A=()=>{_.current?.flush(),R(!1)},B=()=>R(c=>(c&&_.current?.flush(),!c)),[L,U]=S.useState({width:0,height:0}),[$,G]=S.useState(!1),[V,W]=S.useState({}),[H,J]=S.useState(""),ae=S.useRef(null),[C,q]=S.useState(!1),[K,X]=S.useState(),[M,Y]=S.useState(null),[Z,I]=S.useState(null),[ie,ne]=S.useState(null),[ee,le]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[pe,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[be,fe]=S.useState({}),[je,ye]=S.useState(!1),we=S.useRef(null),De=()=>{ye(!0),we.current&&clearTimeout(we.current),we.current=setTimeout(()=>ye(!1),15e3)},at=()=>{we.current&&(clearTimeout(we.current),we.current=null),ye(!1)},{org:ue}=_n(),Ae=kr(),Be=On(),Fe=Be.vmEntry,_e=Ae.lifecycle.phase,{url:it,undecided:qe}=li(t),oe=Dn(t,r),{connection:Ee}=vr(t),Re=Zi(t),Me=ci({hasServeConnection:!!Ee,runtime:d.runtime}),Q=qe||Me==="github"&&(Re==="loading"||Re==="error"),se=!nt(oe)&&!Q&&!(Me==="github"&&oe.kind==="pending"),ve=Ve(oe)??it,$e=ve??Be.previewUrl,ot=!!ve||_e==="running",We=l?.id===t?Qa(l.metadata):null,lt=!ve&&!qe&&l?.id===t&&d.runtime==="cms",Or=d.projectDefault==="cms",ct=se?Ui({sandboxUrl:$e,previewServerUrl:We,fastPreviewActive:lt}):null,$n=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:$e}:null,zn=Bn($n,{fetchEnabled:ot}),Zt=xr($n,{fetchEnabled:ot}),re=zn.data,xe=Zt.data,Ge=re?Oi(re,xe).sort((c,h)=>c.name.localeCompare(h.name)):[],Kn=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r}:null,In=Dl(Kn),en=re&&xe?Di(re,xe):[],Un=se&&re&&xe?Na(xe,re,"loaders"):[],Vn=H?(()=>{const c=H.toLowerCase();return Ge.map(h=>({page:h,score:rc(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,D)=>D.score-h.score||h.page.path.length-D.page.path.length).map(({page:h})=>h)})():Ge,Hn=en.filter(c=>{if(!H)return!0;const h=H.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),qn=f?Un:[],Wn=qn.filter(c=>{if(!H)return!0;const h=H.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),jt=Z?Un.find(c=>c.key===Z)??null:null,Le=Fn,tn=M||Z?null:Bi(Ge,ee,pe),te=tn?.key??null,Je=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??te,Et=tn?.path??null,Ye=(te?be[te]:void 0)??{},ke=Ke(ee,Ye),nn={};if(se&&ot&&$e&&xe&&re){const c=Ta(xe,"loaders"),h=te?re[te]:void 0,D=nl(h,re,me=>c.has(me)),z=Qo(D);for(const me of St(ee)){if(me.type!=="param")continue;const Oe=Go(ee,me.name,D),Pe=el(Oe,c,z);Pe.length>0&&(nn[me.name]=Pe)}}const Nt=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,Gn=re&&te?Fi(re,te,0):[],Jn=nt(oe),Yn=re?Mi(Gn,re,Jn):[],sn=Yn.map(c=>c.isSavedBlock?c.label:""),rn=Yn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),an=Gn.map(c=>Ln(c,re??{},Jn)),Tt=S.useRef(null),Ne=S.useRef(null),Dr=Ae.status.state==="paused",on=Ae.phase,Qn=Ca({claimPhase:on,lifecycle:Ae.lifecycle}),Ue=Be.previewState,Br=Be.userStopped,Fr=di(ue.slug,t??""),{url:ze}=Wi(lt&&t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,previewServerUrl:We??null,path:ke}:null),Mr=Or&&d.runtime==="sandbox",Se=ui(oe,Me,Re),Xn=fi(Se&&lt&&oe.kind==="protocol"&&t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r}:null),Zn=Se?Xn.pointer:null,F=Lo({previewState:Ue,progressStatus:Qn.status,previewServerUrl:We,fastPreviewActive:lt,fastPreviewReady:!!ze,codingSession:Mr,localPreviewUrl:ve,hostedDraft:Se,hostedPointerPending:Se&&(oe.kind==="pending"||Xn.pending),deciding:Q}),es=F.showWakingPill||Se&&F.mode==="production"&&!Zn,dt=F.mode!=="none",$r=F.mode==="production"&&F.iframeBase?yt(F.iframeBase):null,Qe=F.mode==="production"?$r:yt($e),zr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,ut=se?ve?F.mode==="sandbox"&&f&&g==="blocks":F.mode==="production"&&lt&&zr&&f&&g==="blocks":!1,ts=S.useRef(null),{pin:Kr,effective:Ir}=nc(ts.current,{inPlaceRenderActive:ut,draftPreviewUrl:ze,resolvedPath:ke});ts.current=Kr;const ns=o.state.variantOverride??[],Ct=se?ns:[],ft=se?[]:ns,ln=nt(oe)&&$i.some(c=>zi(xe,c)==="available"),Xe=ln?V:{},ss=Pr(Xe),Ur=ln&&re?Object.keys(Ki(re).experiments):[],Rt=Se?Gl({display:F,path:ke,pointer:Zn,device:k,forcedVariants:ft,previewOptions:Xe}):null,Ze=t?js(ue.slug,t):null,rs=JSON.stringify([ft,Xe]);S.useEffect(()=>{if(!Se||!Ze)return;const[c,h]=JSON.parse(rs);As(Ze,{forcedVariants:c,previewOptions:h})},[Se,Ze,rs]),S.useEffect(()=>{if(!(!Se||!Ze))return()=>As(Ze,null)},[Se,Ze]);const cn=Ee&&Ve(oe)?yi(Ee.endpoint,ft,ss):null,Vr=Ee&&Ve(oe)?cn?no(cn,Xe):Cs:null,et=tc(F.mode==="sandbox"?zt(Rn(Rs(ie??Nn(ke,F.iframeBase)??F.iframeBase,Vr),k),Ct):F.mode==="production"&&Rt?.frame?Rt.frame:F.mode==="production"?zt(Rn(Bs(Ns(Rs(ie??Ir??Nn(ke,F.iframeBase)??F.iframeBase,es?Cs:null),ft),Xe),k),Ct):null),as=ze??(F.iframeBase?Nn(ke,F.iframeBase):null),is=F.mode==="production"&&Rt?Rt.newTab:F.mode==="production"?as?zt(Bs(Ns(as,ft),Xe),Ct):null:et??F.iframeBase,Hr=()=>{const c=is;c&&window.open(c,"_blank","noopener")},mt=t&&r?ir(ue.slug,t,r):null,pt=c=>{mt&&Oa(mt,c)},he=o.state.target;S.useEffect(()=>{if(!(!he||!ct||!xe))if(he.kind==="page"){const c=be[he.key]??{};Ne.current=Ke(he.path,c),Y(null),I(null),ne(null),de(he.key),le(he.path),pt({path:he.path,pageKey:he.key,params:c})}else if(he.kind==="loader")Ne.current=null,Y(null),I(he.key),ne(null);else{const c=en.find(h=>h.key===he.key);if(c){Ne.current=null;const h=Ts(xe);I(null),Y(c),ne(Ls(ct,h,c.key))}}},[he,ct,xe,be]),S.useEffect(()=>{!te||Et===null||he?.kind==="page"&&he.key===te&&he.path===Et||o.selectTarget({kind:"page",key:te,path:Et})},[te,Et,he]);const[os,qr]=S.useState(null);if(Ue.kind==="iframe"&&os!==Ue.previewUrl){const c=os!==null;qr(Ue.previewUrl);const h=mt?ar(mt):null;if(h){if(Ne.current=Ke(h.path,h.params),le(h.path),de(h.pageKey),ne(null),Y(null),I(null),h.pageKey&&Object.keys(h.params).length>0){const D=h.pageKey;fe(z=>({...z,[D]:h.params}))}}else c&&(Ne.current=null,le("/"),ne(null),de(null),Y(null),I(null))}Tt.current=et;const Wr=F.mode==="production"&&!!ze&&!ve,[ls,dn]=S.useState({src:et??void 0,loading:!1}),Lt=Ql(ls,et??void 0,Wr);Lt!==ls&&dn(Lt);const ht=Lt.src,cs=Lt.loading,ds=Do({iframeRef:P,src:F.mode==="sandbox"?et:null,active:F.mode==="sandbox"}),us=S.useRef(null);S.useEffect(()=>{const c=cs?setTimeout(()=>dn(Js),Yl):null,h=()=>{c&&clearTimeout(c)};if(!ze||!ht||us.current===ze)return h;us.current=ze;const D=P.current;return D&&D.getAttribute("src")!==ht&&(De(),D.src=ht),h},[ze,ht,cs]);const fs=()=>{const c=P.current?.contentWindow,h=Qe;if(!c||!h||!re||!te)return;const D=re[te];if(!D||typeof D!="object")return;const z=Vi({previewBaseUrl:h,pageBlock:D,decofile:re,path:ke,pathTemplate:ee});if(!z)return;const me=zt(z.src,bi(Ct,te));c.postMessage({type:"cms-editor::render",src:me,body:z.body},h)},un=S.useRef(null);S.useEffect(()=>{if(!ut||M||Z||!te||!re){un.current=null;return}const c={nav:JSON.stringify({page:te,path:ke,pathTemplate:ee}),content:JSON.stringify(re)},h=sc(un.current,c);un.current=c,h&&fs()},[re,ut,M,Z,te,ke,ee]);const fn=S.useRef(null);S.useEffect(()=>{if(!ut||M||Z||!te||!re){fn.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=fn.current;fn.current={page:te,sig:c},!(!h||h.page!==te||h.sig===c)&&fs()},[o.state.variantOverride,ut,M,Z,te]);const Gr=!!t&&!!r&&!Ae.notFound&&!Br&&!Dr&&(on?.kind==="ready"||_e!=="idle"),ge=Wl({editingMode:g,sandboxDisplay:F.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=Qe;if(!c)return;const h=D=>{if(D.origin===c)if(D.data?.type==="visual-editor::element-clicked"){const z=$o.safeParse(D.data.payload);z.success&&v(z.data)}else if(D.data?.type==="cms-editor::section-clicked"){const z=Io.safeParse(D.data.payload);z.success&&T({index:z.data.sectionIndex,seq:z.data.clickSeq})}else D.data?.type==="cms-editor::render-start"?De():D.data?.type==="cms-editor::render-end"?(at(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:sn,kinds:rn,keys:an},c)):D.data?.type==="cms-editor::render-error"&&at()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[Qe,sn,rn,an]);const ms=()=>{const c=P.current?.contentWindow,h=yt($e);!c||!h||c.postMessage({type:"visual-editor::activate",script:zo},h)},Jr=()=>{const c=P.current?.contentWindow,h=yt($e);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},mn=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||(c.postMessage(F.mode==="production"||ve?{type:"editor::inject",args:{script:Is}}:{type:"visual-editor::activate",script:Is},h),c.postMessage({type:"cms-editor::set-labels",labels:sn,kinds:rn,keys:an},h))},Yr=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Qr=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},At=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),j(c),v(null),T(null),c!=="blocks"&&I(null),h==="visual"&&Jr(),c==="visual"&&ms(),h==="blocks"&&c!=="blocks"&&Yr(),c==="blocks"&&mn()},Xr=()=>{At(Vl(g,f))},Zr=()=>{At(Hl(g,f))},pn=()=>{const c=P.current;if(!c)return;De();const h=document.activeElement,D=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),ac(c,Tt.current);let z;const me=()=>{clearTimeout(z),c.tabIndex=D,c.style.pointerEvents="";const Oe=document.activeElement;(!Oe||Oe===document.body||Oe===c)&&h?.focus(),c.removeEventListener("load",me)};c.addEventListener("load",me),z=setTimeout(me,3e3)};Ji(pn);const _t=js(ue.slug,t??""),Ot=Se&&dt&&!!t,ps=S.useRef(null);S.useEffect(()=>{if(Ot)return mi(_t)},[Ot,_t]);const{reload:gt}=pi(ue.slug,t??""),hs=S.useRef(gt.seq);S.useEffect(()=>{if(hs.current!==gt.seq&&(hs.current=gt.seq,!!Ot&&ps.current===Tt.current)){if(gt.navigates){Es(_t);return}pn()}},[gt.seq]);const ea=hi(Kn),vt=gi(Ve(oe)?ea:""),gs=S.useRef(vt);S.useEffect(()=>{const c=gs.current;if(gs.current=vt,!c||!vt||c===vt)return;const h=P.current;if(h)return Mo({iframe:h,reload:pn})},[vt]);const ta=()=>{const c=Vt.indexOf(k);E(Vt[(c+1)%Vt.length])},hn=(c,h)=>{if(!te)return;const D=te,z={...Ye,[c]:h};Ne.current=Ke(ee,z),fe(me=>({...me,[D]:z})),pt({path:ee,pageKey:D,params:z})},na=Rl({iframeBase:F.iframeBase,resolvedPath:ke,activeGlobalSectionName:M?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),gn=c=>{const h=be[c.key]??{},D=Ke(c.path,h);(M||Le(D)!==Le(ke))&&De(),Ne.current=D,Y(null),I(null),ne(null),T(null),de(c.key),le(c.path),pt({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};_a(mt,c=>{(M||Le(c)!==Le(ke))&&De(),Ne.current=c,Y(null),I(null),ne(null),T(null),de(null),le(c),pt({path:c,pageKey:null,params:{}})});const sa=c=>{if(nt(oe)){const z=re?Ii(re,c.key,xe):null;z?gn(z):yn.info(e("sandbox.preview.blockOnNoPage"));return}if(!ct||!xe){yn.error(e("sandbox.preview.previewMetadataNotReady"));return}De(),Ne.current=null;const h=Ts(xe),D=Ls(ct,h,c.key);Y(c),I(null),ne(D),T(null),o.selectTarget({kind:"section",key:c.key})},ra=c=>{f&&(Y(null),I(c.key),ne(null),At("blocks"),o.selectTarget({kind:"loader",key:c.key}))},aa=async({name:c,path:h,templateKey:D})=>{if(!t||!r)return;const z=yr(h);if(z){X(z);return}const me=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(Ge.some(Pe=>Le(Pe.path)===Le(me))){X(e("sandbox.preview.pageAlreadyExists",{path:me}));return}let Oe;if(D&&(Oe=re?.[D],!Oe)){X(e("sandbox.preview.templateNoLongerExists"));return}X(void 0);try{const Pe=await In.mutateAsync({name:c,path:me,template:Oe,schema:nt(oe)?{meta:xe,loadMeta:async()=>(await Zt.refetch()).data}:void 0});q(!1),yn.success(e("sandbox.preview.pageCreated",{name:c})),await ro(Xl),gn({key:Pe.key,name:Pe.name,path:Pe.path}),At("blocks")}catch(Pe){X(Pe instanceof Ar?e("sandbox.preview.pageSchemaNotReady"):Pe instanceof Error?Pe.message:e("sandbox.preview.failedToCreatePage"))}},Dt=Ll({previewSurfaceActive:dt,daemonReady:Gr,production:F.mode==="production",servePreviewUrl:Ve(oe)}),ia=Al({showPreviewToolbar:Dt,contentEditingEnabled:m}),Bt=()=>{G(!1),J("")},vn=M?.name??jt?.title??tn?.name,xn=zn.isPending||Zt.isPending,bn=xn?yt(F.iframeBase):vn,Ft=M?`section:${M.key}`:Z?`loader:${Z}`:te?`page:${te}`:void 0,oa=Dt?ia?s.jsxs(dr,{open:$,onOpenChange:c=>{G(c),c||J("")},children:[s.jsx(lr,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:xn?bn??void 0:M||jt?vn:[vn,ee].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[M&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(za,{size:11}),e("sandbox.preview.globalBadge")]}),jt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[s.jsx(Ka,{size:11}),e("sandbox.preview.loaderBadge")]}),bn&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:bn}),!xn&&!M&&!jt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:ee}),s.jsx(Da,{size:12,className:Ht("shrink-0 transition-transform",$&&"rotate-180")})]})})}),s.jsxs(cr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(fr,{shouldFilter:!1,defaultValue:Ft,children:[s.jsx(mr,{value:H,onValueChange:c=>{J(c),ae.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(ur,{ref:ae,className:"max-h-80",children:[s.jsx(pr,{children:Ge.length===0&&en.length===0&&qn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Vn.length>0&&s.jsx(wt,{children:Vn.map(c=>s.jsxs(kt,{value:`page:${c.key}`,"aria-current":Ft===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Bt(),gn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Hn.length>0&&s.jsx(wt,{heading:e("sandbox.preview.globalComponents"),children:Hn.map(c=>s.jsx(kt,{value:`section:${c.key}`,"aria-current":Ft===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),sa(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Wn.length>0&&s.jsx(wt,{heading:e("sandbox.preview.globalLoaders"),children:Wn.map(c=>s.jsx(kt,{value:`loader:${c.key}`,"aria-current":Ft===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),ra(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!M&&!Z&&St(ee).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:St(ee).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const D=nn[c.name];return D&&Nt?s.jsx(vl,{sources:D,template:ee,paramName:c.name,value:Ye[c.name]??"",sandboxRef:Nt,onCommit:z=>hn(c.name,z)},`${te}:${c.name}`):s.jsx(Tl,{name:c.name,value:Ye[c.name]??"",onCommit:z=>hn(c.name,z)},`${te}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Ie,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Bt(),X(void 0),q(!0)},children:[s.jsx(Wa,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:na}):null,vs=Dt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:ta,"aria-label":e(Qs[k]),children:k==="mobile"?s.jsx(Ia,{size:16}):k==="tablet"?s.jsx(Ua,{size:16}):s.jsx(Va,{size:16})})}),s.jsx(Gt,{children:e(Qs[k])})]}),oa,s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[ln&&s.jsx(Jl,{tests:Ur,options:V,onChange:W,available:!!cn||!es||!ss}),s.jsx(st,{onClick:Hr,disabled:Se&&!is,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(ga,{size:16})})]})]}):null,la=(se||a)&&F.mode==="sandbox",Mt=Zl[k],$t=k==="desktop"&&(L.width===0||L.width>=Mt.width+2*Ys),xs=$t?1:Math.min(L.width>0?L.width/(Mt.width+2*Ys):1,1),ca=$t?{width:"100%",height:"100%"}:{width:`${Mt.width}px`,height:L.height>0?`${L.height/xs}px`:`${Mt.height}px`,transform:`scale(${xs})`,transformOrigin:"top center"},bs=s.jsxs(s.Fragment,{children:[la&&(Dt||m)&&s.jsx(st,{onClick:Xr,"aria-pressed":ge==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ge==="visual",children:s.jsx(Ps,{size:16})}),f&&s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:Zr,"aria-pressed":ge==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ge==="blocks",children:s.jsx(qa,{size:16})})}),s.jsx(Gt,{children:e("sandbox.preview.blocksEditor")})]}),Je&&s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:B,"aria-pressed":O,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:O,children:s.jsx(Ha,{size:16})})}),s.jsx(Gt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),da=!!Z&&ge==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[Nt&&Object.entries(nn).map(([c,h])=>(Ye[c]??"")===""?s.jsx(El,{sources:h,template:ee,paramName:c,sandboxRef:Nt,onFill:D=>hn(c,D)},`${te}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(ks.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:vs}),children:vs}),s.jsx(ks.Toolbar.Right.Portal,{fallback:bs,children:bs})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:da?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Ws,{virtualMcpId:t,externalSelection:w,onViewJsonFile:B}),O&&Je&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Gs,{ref:_,virtualMcpId:t,pageKey:Je,onClose:A})})]}):s.jsxs(_s,{orientation:"horizontal",disabled:ge!=="blocks",className:"relative isolate",children:[s.jsx(Kt,{ref:N,id:"preview-blocks-editor",defaultSize:ge==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ge==="blocks"&&s.jsx(Ws,{virtualMcpId:t,externalSelection:w,onViewJsonFile:B})}),ge==="blocks"&&s.jsx(Os,{withHandle:!0}),s.jsx(Kt,{id:"preview-canvas",defaultSize:ge==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(_s,{orientation:"horizontal",disabled:!(O&&Je),children:[s.jsx(Kt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>U(z=>z.width===c.clientWidth&&z.height===c.clientHeight?z:{width:c.clientWidth,height:c.clientHeight});h();const D=new ResizeObserver(h);return D.observe(c),()=>D.disconnect()},className:Ht("h-full relative overflow-clip flex justify-center",dt&&!$t&&"bg-muted/30"),children:[(je||Fr)&&dt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),F.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}),F.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"starting",progress:Qn,claimPhase:on})}),!ve&&!Q&&Ue.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"suspended",onResume:Be.resume})}),!ve&&!Q&&Ue.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"errored",error:Ue.error,onRetry:Be.retry,connectionsHref:`/${ue.slug}/settings/connections`})}),F.showWakingPill&&s.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[s.jsx(Pt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ge==="visual"&&!y&&s.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(Ps,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ge==="visual"&&y&&s.jsx(Ho,{element:y,onDismiss:()=>v(null)}),dt&&et&&s.jsx("div",{className:Ht("shrink-0",!$t&&"bg-background shadow-edge"),style:ca,onMouseLeave:Qr,children:s.jsx("iframe",{ref:P,src:ht,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:ds.handleError,onLoad:()=>{if(dn(Js),ds.handleLoad(),at(),ps.current=Tt.current,Ot&&Es(_t),F.mode!=="sandbox"||ve){(F.mode==="production"&&!F.showWakingPill||ve)&&ge==="blocks"&&mn();return}if(va("vm_preview_loaded",{view_mode:ge,vm_id:Fe?.sandboxHandle??null}),!M)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ne.current;if(h!==null&&(Ne.current=null,Le(c)!==Le(h))||Le(c)===Le(ke))return;le(c),pt({path:c,pageKey:pe,params:Ye})}catch{}ge==="visual"&&ms(),ge==="blocks"&&mn()}},F.iframeBase)})]})}),O&&Je&&s.jsxs(s.Fragment,{children:[s.jsx(Os,{withHandle:!0}),s.jsx(Kt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Gs,{ref:_,virtualMcpId:t,pageKey:Je,onClose:A})})]})]})})]})}),s.jsx(Bl,{open:C,onOpenChange:q,isPending:In.isPending,error:K,templates:Ge,onSubmit:aa})]})}const oc=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},lc=1e4,cc=1e4,dc=5e3,uc=2;function fc(t,e){return t&&e===0?cc:Math.min(1e3*2**Math.max(0,e-1),dc)}function mc(t,e,n){return e?!0:t===!0&&n<uc}function pc(t,e){const n=ce.c(11),r=oc,i=xa();let u;n[0]!==t?(u=er.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,x=new AbortController,b=()=>x.abort();f.addEventListener("abort",b);const j=setTimeout(b,lc),g=await r(t,x.signal).catch(gc);clearTimeout(j),f.removeEventListener("abort",b);const k=i.getQueryData(a),E=g?0:(k?.failures??0)+1;return{up:mc(k?.up??null,g,E),failures:E}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:hc},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=ba(d);return t?p?.up??null:null}function hc(t){return t.state.data?fc(t.state.data.up,t.state.data.failures):!1}function gc(){return!1}function vc(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function pd(t){const e=ce.c(48),{virtualMcpId:n}=t,r=Ce(),i=Ja(n),{connection:u}=vr(n),{activeTask:a,taskId:o,currentBranch:l}=Xt(),d=ho(o),[p,m]=S.useState(!1),f=Dn(n,l);let x;e[0]!==f||e[1]!==u?(x=u?Ve(f):null,e[0]=f,e[1]=u,e[2]=x):x=e[2];const b=x,j=pc(b),g=Er();if(oo({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:Sn(i?.metadata),threadHasRepo:Sn(d)||Sn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(Fs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let v;e[4]!==r?(v=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=v):v=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(Fs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let O;e[12]!==N?(O=s.jsxs(Ie,{onClick:T,children:[P,N]}),e[12]=N,e[13]=O):O=e[13];let R;e[14]!==v||e[15]!==w||e[16]!==O?(R=s.jsx(ao,{className:"h-full",image:y,title:v,description:w,actions:O}),e[14]=v,e[15]=w,e[16]=O,e[17]=R):R=e[17];let _;e[18]!==p?(_=s.jsx(io,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=_):_=e[19];let A;return e[20]!==_||e[21]!==R?(A=s.jsxs(s.Fragment,{children:[R,_]}),e[20]=_,e[21]=R,e[22]=A):A=e[22],A}if(u&&i&&!Ve(f)){let y;e[23]!==g||e[24]!==f?(y=vc({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let v;e[26]!==u.endpoint?(v=vi(u.endpoint),e[26]=u.endpoint,e[27]=v):v=e[27];let w;return e[28]!==y||e[29]!==v?(w=s.jsx(bc,{status:y,host:v}),e[28]=y,e[29]=v,e[30]=w):w=e[30],w}if(b&&j!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let v;e[33]!==b||e[34]!==r?(v=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:xc(b)}),e[33]=b,e[34]=r,e[35]=v):v=e[35];let w;e[36]!==v?(w=s.jsx(Yt,{text:v}),e[36]=v,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(Qt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let E;return e[46]!==n?(E=s.jsx(Ra,{children:s.jsx(ic,{virtualMcpId:n})}),e[46]=n,e[47]=E):E=e[47],E}function xc(t){try{return new URL(t).host}catch{return t}}function bc(t){const e=ce.c(20),{status:n,host:r}=t,i=Ce();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Yt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${gr} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(Qt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=yo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(bo,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{bo as L,pd as P,Qt as S,md as u};
551
+ `)}function Vo(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function Ho(t){const e=ce.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=La(),{openSidePanel:l}=Gi(),d=Ce();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const $=Uo(n,i);l(),o({parts:[{type:"text",text:$}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=Vo(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const x=f,b=`${x.leftPct}%`,j=`${x.topPct}%`;let g;e[9]!==b||e[10]!==j?(g={left:b,top:j,width:"320px"},e[9]=b,e[10]=j,e[11]=g):g=e[11];let k;e[12]!==m?(k=$=>{$.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E=$=>u($.target.value),e[14]=E):E=e[14];let y;e[15]!==r?(y=$=>{$.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let v;e[17]!==d?(v=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=v):v=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==v?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:E,onKeyDown:y,placeholder:v,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=v,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let O;e[27]!==d?(O=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=O):O=e[28];let R;e[29]!==O?(R=s.jsx("title",{children:O}),e[29]=O,e[30]=R):R=e[30];let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=_):_=e[31];let A;e[32]!==R?(A=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,_]}),e[32]=R,e[33]=A):A=e[33];let B;e[34]!==P||e[35]!==N||e[36]!==A?(B=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:A}),e[34]=P,e[35]=N,e[36]=A,e[37]=B):B=e[37];let L;e[38]!==w||e[39]!==B||e[40]!==k?(L=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:k,children:[w,B]}),e[38]=w,e[39]=B,e[40]=k,e[41]=L):L=e[41];let U;return e[42]!==L||e[43]!==g?(U=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:L}),e[42]=L,e[43]=g,e[44]=U):U=e[44],U}const Us="site-links",qo=/details?page|\bpdp\b/i,Wo=/listingpage|\bplp\b/i;function Go(t,e,n){const r=new Set;for(const o of n)qo.test(o)&&r.add("product"),Wo.test(o)&&r.add("category");const i=St(Fn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const Jo=["rosa","preto","pink","black"];function It(t,e){const n=e.trim();return n?t(n):Jo.flatMap(r=>t(r))}function Yo(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const Nr=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Mn(t){return t.split("/")[0]??""}function Qo(t){const e=new Set;for(const n of t){const r=Mn(n);Nr.has(r)&&e.add(r)}return e}function Xo(t,e){const n=Mn(t);return!Nr.has(n)||e.size===0?!0:e.has(n)}const Zo=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>It(n=>Yo(t,n),e),optionsFromPayload:Ut},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Ut},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Ut},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>It(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Ut},{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:il}];function el(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of Zo){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&Xo(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Mn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(tl(t.has("category")?"category":"product")),a}function tl(t){return{kind:t,id:Us,resolveType:Us,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>ul(e,n)}}function He(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function nl(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=He(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=He(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function Tr(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function Cr(t){try{return decodeURIComponent(t)}catch{return t}}function sl(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rl(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=sl(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function Rr(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=St(Fn(e)),{pattern:u,order:a}=rl(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?Cr(d):null}function Ut(t,e){const n=He(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=He(a);if(!o)continue;const l=Rr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=He(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?He(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function al(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?Cr(n):null}function il(t){const e=[],n=new Set,r=(i,u)=>{const a=He(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=al(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const ol=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 ll(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function cl(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function dl(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function ul(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=Rr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&ol.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:ll(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of dl(t))i(u,a,"product",o);for(const{href:u,text:a}of cl(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function xt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const Lr=1e4;function fl(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 ml(t,{resolveType:e,props:n}){const r=await fetch(si(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(Lr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function Vs(t,e){const n=await fetch(ri(t,e),{signal:AbortSignal.timeout(Lr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function pl(t,e,n){const r=e.optionsFromPayload(await Vs(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Ke(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await Vs(t,u),n).filter(o=>o.kind==="product");return Tr([r,a])}catch{return r}}function hl(t,e,n){return er.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function gl(t,e,n,r){if(e.homepageLinks)return pl(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>ml(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return Tr(a.map(o=>e.optionsFromPayload(o,r)))}function An(t,e,n,r,i){return{queryKey:hl(t,e,n),queryFn:()=>gl(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function bt(t){const e=ce.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(kt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(or,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ke(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(wt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Hs(t){const e=ce.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function vl(t){const e=ce.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=Ce(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[x,b]=S.useState(""),j=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=fl(l),y=[...new Set(n.map(Q=>k[Q.kind].noun))].join(" or ");let v;e[0]!==l||e[1]!==y?(v=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=v):v=e[2];const w=v,T={template:r,paramName:i};let P;e[3]!==m?(P=(Q,se)=>({source:Q,query:se,options:Q.clientFilter?xt(se.data??[],m):se.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,O=n.filter(jl),R=n.filter(Pl),_=Cn({queries:O.map(Q=>An(a,Q,x,T,d))});let A;e[5]!==_||e[6]!==N?(A=(Q,se)=>N(Q,_[se]),e[5]=_,e[6]=N,e[7]=A):A=e[7];const B=O.map(A),L=B.length===0||B.every(Sl),U=Cn({queries:R.map(Q=>An(a,Q,x,T,d&&L))});let $;e[8]!==U||e[9]!==N?($=(Q,se)=>N(Q,U[se]),e[8]=U,e[9]=N,e[10]=$):$=e[10];const G=R.map($),V=L?G:B,W=V.length===1&&V[0]?.source.homepageLinks?V[0]:null,J=W&&!W.query.isLoading&&!W.query.isError?W?.query.data??[]:[],ae=xt(J.filter(kl),m),C=xt(J.filter(wl),m),q=ae.length>0&&C.length>0,K=Q=>{p(Q),j.current&&clearTimeout(j.current),f(Q?u:""),b(Q?u:"")};let X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>{f(Q),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{b(Q)},300)},e[11]=X):X=e[11];const M=X,Y=Q=>{o(Q),K(!1)},Z=br(m),I=Ke(r,{[i]:Z}),ie=Zs,ne=Xs,ee="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",le=yl;let pe;e[12]!==g||e[13]!==l?(pe=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=pe):pe=e[14];let de;e[15]!==pe?(de=s.jsx(tr,{className:"sr-only",children:s.jsx(nr,{children:pe})}),e[15]=pe,e[16]=de):de=e[16];let be;e[17]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(or,{size:16,className:"shrink-0 text-foreground"}),e[17]=be):be=e[17];let fe;e[18]!==l?(fe=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=fe):fe=e[19];let je;e[20]!==g?(je=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:g}),e[20]=g,e[21]=je):je=e[21];let ye;e[22]!==fe||e[23]!==je?(ye=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[be,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[fe," ",je]})]}),e[22]=fe,e[23]=je,e[24]=ye):ye=e[24];const we=fr,De=!1,at="min-h-0 flex-1";let ue;e[25]!==w||e[26]!==m?(ue=s.jsx(mr,{autoFocus:!0,placeholder:w,value:m,onValueChange:M}),e[25]=w,e[26]=m,e[27]=ue):ue=e[27];const Ae=ur,Be="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Fe;e[28]!==l?(Fe=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Fe):Fe=e[29];let _e;e[30]!==Fe?(_e=s.jsx(pr,{children:Fe}),e[30]=Fe,e[31]=_e):_e=e[31];const it=Z&&s.jsx(wt,{className:"shrink-0",children:s.jsxs(kt,{value:`__raw__:${Z}`,className:"gap-3 py-2",onSelect:()=>Y(Z),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Yi,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:Z,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:I})]})]})}),qe=q?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(bt,{heading:k.category.heading,iconKind:"category",options:ae,template:r,paramName:i,keyPrefix:`${W?.source.id}:cat`,onSelect:Y})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(bt,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${W?.source.id}:prod`,onSelect:Y})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:V.map(Q=>{const{source:se,query:ve,options:$e}=Q,{noun:ot}=k[se.kind];if(ve.isLoading)return s.jsx(Hs,{text:l("sandbox.pathParamPickerChip.loading",{noun:ot})},se.id);if(ve.isError)return s.jsx(Hs,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},se.id);if(se.homepageLinks){const We=ve.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(bt,{heading:k.category.heading,iconKind:"category",options:xt(We.filter(bl),m),template:r,paramName:i,keyPrefix:`${se.id}:cat`,onSelect:Y}),s.jsx(bt,{heading:k.product.heading,iconKind:"product",options:xt(We.filter(xl),m),template:r,paramName:i,keyPrefix:`${se.id}:prod`,onSelect:Y})]},se.id)}return s.jsx(bt,{heading:V.length>1?k[se.kind].heading:void 0,iconKind:se.kind,options:$e,template:r,paramName:i,keyPrefix:se.id,onSelect:Y},se.id)})});let oe;e[32]!==Ae||e[33]!==_e||e[34]!==it||e[35]!==qe?(oe=s.jsxs(Ae,{className:Be,children:[_e,it,qe]}),e[32]=Ae,e[33]=_e,e[34]=it,e[35]=qe,e[36]=oe):oe=e[36];let Ee;e[37]!==we||e[38]!==ue||e[39]!==oe?(Ee=s.jsxs(we,{shouldFilter:De,className:at,children:[ue,oe]}),e[37]=we,e[38]=ue,e[39]=oe,e[40]=Ee):Ee=e[40];let Re;e[41]!==ne||e[42]!==de||e[43]!==ye||e[44]!==Ee||e[45]!==le?(Re=s.jsxs(ne,{className:ee,onClick:le,children:[de,ye,Ee]}),e[41]=ne,e[42]=de,e[43]=ye,e[44]=Ee,e[45]=le,e[46]=Re):Re=e[46];let Me;return e[47]!==ie||e[48]!==K||e[49]!==d||e[50]!==Re?(Me=s.jsx(ie,{open:d,onOpenChange:K,children:Re}),e[47]=ie,e[48]=K,e[49]=d,e[50]=Re,e[51]=Me):Me=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:Q=>{Q.stopPropagation(),K(!0)},children:u||g}),Me]})}function xl(t){return t.kind==="product"}function bl(t){return t.kind!=="product"}function yl(t){return t.stopPropagation()}function wl(t){return t.kind==="product"}function kl(t){return t.kind!=="product"}function Sl(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Pl(t){return t.isFallback}function jl(t){return!t.isFallback}function El(t){const e=ce.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const x={template:r,paramName:i},b=n.filter(Nl);l=Cn,o=b.map(j=>An(u,j,"",x,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const x of p){if(x.isLoading)break;const b=x.data?.[0];if(b){f(!0),queueMicrotask(()=>a(b.value));break}}return null}function Nl(t){return!t.isFallback}function Tl(t){const e=ce.c(31),{name:n,value:r,onCommit:i}=t,u=Ce(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,x=a||f;let b;e[3]!==x?(b=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:x}),e[3]=x,e[4]=b):b=e[4];let j;e[5]!==f||e[6]!==u?(j=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=j):j=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let E;e[10]!==r?(E=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=E):E=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=br(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let v;e[16]!==a||e[17]!==f||e[18]!==j||e[19]!==E||e[20]!==y?(v=s.jsx("input",{type:"text",value:a,placeholder:f,title:j,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Cl,onChange:g,onFocus:k,onKeyDown:E,onBlur:y}),e[16]=a,e[17]=f,e[18]=j,e[19]=E,e[20]=y,e[21]=v):v=e[21];let w;e[22]!==b||e[23]!==v?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[b,v]}),e[22]=b,e[23]=v,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[s.jsx(Ma,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Cl(t){return t.stopPropagation()}function Rl(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Ll(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Al(t){return t.showPreviewToolbar&&t.contentEditingEnabled}class Ar extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function _l(t,e){if(t)return t;const n=await e?.().catch(()=>null);if(!n)throw new Ar;return n}async function Ol(t,e,n){return n?Ss(t,e,await _l(n.meta,n.loadMeta)):Ss(t,e)}function Dl(t){const e=ce.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=sr(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l,schema:d}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const p=ya(a),m=l?{...l,name:a,path:o}:await Ol(a,o,d);return await r.mutateAsync({blockKey:p,data:m}),{key:p,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],ua(i)}function Bl(t){const e=ce.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=Ce();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let x;e[2]!==d?(x=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=x):x=e[3];const[b,j]=S.useState(x),[g,k]=S.useState(wn),[E,y]=S.useState(null),[v,w]=S.useState(n);n!==v&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),j(d("sectionsEditor.createPageModal.defaultPagePath")),k(wn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=fe=>{!fe&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let O;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==b||e[11]!==T||e[12]!==g?(O=async fe=>{fe.preventDefault();const je=m.trim(),ye=b.trim();if(!je||!ye||l)return;const we=yr(ye);if(we){y(we);return}y(null),await o({name:je,path:ye,templateKey:T&&g!==wn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=b,e[11]=T,e[12]=g,e[13]=O):O=e[13];const R=O,_=E??u;let A;e[14]!==d?(A=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=A):A=e[15];let B;e[16]!==A?(B=s.jsx(tr,{children:s.jsx(nr,{children:A})}),e[16]=A,e[17]=B):B=e[17];let L;e[18]!==d?(L=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=L):L=e[19];let U;e[20]!==L?(U=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:L}),e[20]=L,e[21]=U):U=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=fe=>f(fe.target.value),e[22]=$):$=e[22];let G;e[23]!==d?(G=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=G):G=e[24];let V;e[25]!==l||e[26]!==m||e[27]!==G?(V=s.jsx(Tn,{id:"new-page-name",value:m,onChange:$,placeholder:G,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=G,e[28]=V):V=e[28];let W;e[29]!==V||e[30]!==U?(W=s.jsxs("div",{className:"space-y-1.5",children:[U,V]}),e[29]=V,e[30]=U,e[31]=W):W=e[31];let H;e[32]!==d?(H=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=H):H=e[33];let J;e[34]!==H?(J=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:H}),e[34]=H,e[35]=J):J=e[35];let ae;e[36]===Symbol.for("react.memo_cache_sentinel")?(ae=fe=>j(fe.target.value),e[36]=ae):ae=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let q;e[39]!==l||e[40]!==b||e[41]!==C?(q=s.jsx(Tn,{id:"new-page-path",value:b,onChange:ae,placeholder:C,disabled:l}),e[39]=l,e[40]=b,e[41]=C,e[42]=q):q=e[42];let K;e[43]!==J||e[44]!==q?(K=s.jsxs("div",{className:"space-y-1.5",children:[J,q]}),e[43]=J,e[44]=q,e[45]=K):K=e[45];let X;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(X=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(wa,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=X):X=e[51];let M;e[52]!==_?(M=_&&s.jsx("p",{className:"text-xs text-destructive",children:_}),e[52]=_,e[53]=M):M=e[53];let Y;e[54]!==W||e[55]!==K||e[56]!==X||e[57]!==M?(Y=s.jsxs("div",{className:"space-y-4 py-4",children:[W,K,X,M]}),e[54]=W,e[55]=K,e[56]=X,e[57]=M,e[58]=Y):Y=e[58];let Z;e[59]!==r?(Z=()=>r(!1),e[59]=r,e[60]=Z):Z=e[60];let I;e[61]!==d?(I=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=I):I=e[62];let ie;e[63]!==l||e[64]!==Z||e[65]!==I?(ie=s.jsx(Ie,{type:"button",variant:"outline",onClick:Z,disabled:l,children:I}),e[63]=l,e[64]=Z,e[65]=I,e[66]=ie):ie=e[66];let ne;e[67]!==l||e[68]!==m||e[69]!==b?(ne=!m.trim()||!b.trim()||l,e[67]=l,e[68]=m,e[69]=b,e[70]=ne):ne=e[70];let ee;e[71]!==l||e[72]!==d?(ee=l?s.jsxs(s.Fragment,{children:[s.jsx(Pt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=ee):ee=e[73];let le;e[74]!==ne||e[75]!==ee?(le=s.jsx(Ie,{type:"submit",disabled:ne,children:ee}),e[74]=ne,e[75]=ee,e[76]=le):le=e[76];let pe;e[77]!==ie||e[78]!==le?(pe=s.jsxs(fa,{children:[ie,le]}),e[77]=ie,e[78]=le,e[79]=pe):pe=e[79];let de;e[80]!==R||e[81]!==Y||e[82]!==pe||e[83]!==B?(de=s.jsx(Xs,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[B,Y,pe]})}),e[80]=R,e[81]=Y,e[82]=pe,e[83]=B,e[84]=de):de=e[84];let be;return e[85]!==N||e[86]!==n||e[87]!==de?(be=s.jsx(Zs,{open:n,onOpenChange:N,children:de}),e[85]=N,e[86]=n,e[87]=de,e[88]=be):be=e[88],be}function Fl(t){const e=ce.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=Ce();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=sr(p);let f;e[4]!==m?(f=Pa((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const x=f;let b;e[6]!==l||e[7]!==o?(b=ka(o,l),e[6]=l,e[7]=o,e[8]=b):b=e[8];const{resolveType:j,props:g,title:k}=b;if(!j){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const E=`loader:${l}`;let y;e[13]!==l||e[14]!==j||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:j,title:k},e[13]=l,e[14]=j,e[15]=k,e[16]=y):y=e[16];let v;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==x||e[25]!==E||e[26]!==y||e[27]!==r?(v=s.jsx(Sa,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:Ml,onSaveReferencedBlock:x,showRun:!1},E),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=x,e[25]=E,e[26]=y,e[27]=r,e[28]=v):v=e[28],v}async function Ml(){}function $l(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function qs(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:$l(t.error)}}function zl(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 Kl(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=zl(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(i=>i.status==="error"&&!i.hasData&&i.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const Il=S.lazy(()=>ma(()=>import("./sections-editor-TqSLQIU8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147])).then(t=>({default:t.SectionsEditor})));function Ws(t){const e=ce.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=_n(),{currentBranch:o,taskId:l}=Xt(),d=kr(),p=On(),m=Sr(),f=d.lifecycle.phase==="running",x=p.previewUrl;let b;e[0]!==o||e[1]!==a||e[2]!==x||e[3]!==l||e[4]!==n?(b=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:x}:null,e[0]=o,e[1]=a,e[2]=x,e[3]=l,e[4]=n,e[5]=b):b=e[5];const j=b,g=Dn(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const E=Bn(j,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const v=xr(j,y),w=Kl({lifecyclePhase:d.lifecycle.phase,decofile:qs(E),meta:qs(v),hasEditableContent:_i(E.data,v.data),fastPreviewActive:hr(n).runtime==="cms"||nt(g)}),T=rr()===void 0,P=Ul;if(wi(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Si,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(Pi,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(pa,{})),e[13]=C):C=e[13],C}if(E.data&&ai(v.data)){const C=m.state.target,q=C?.kind==="page"||C?.kind==="section"?C.key:null,K=q??"",X=o??"";let M;return e[14]!==E.data||e[15]!==q||e[16]!==a.slug||e[17]!==K||e[18]!==X||e[19]!==n?(M=P(s.jsx(ja,{orgSlug:a.slug,virtualMcpId:n,branch:X,decofile:E.data,initialKey:q,compact:!0},K)),e[14]=E.data,e[15]=q,e[16]=a.slug,e[17]=K,e[18]=X,e[19]=n,e[20]=M):M=e[20],M}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(ji,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==E||e[23]!==p||e[24]!==v||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([E.refetch(),v.refetch()])},e[22]=E,e[23]=p,e[24]=v,e[25]=w.source,e[26]=C):C=e[26];const q=C;let K;return e[27]!==q||e[28]!==w.source?(K=P(s.jsx(ki,{source:w.source,onRetry:q})),e[27]=q,e[28]=w.source,e[29]=K):K=e[29],K}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const O=N,R=m.state.target;if(R?.kind==="loader"&&E.data&&v.data){const C=o??"",q=x??null;let K;return e[31]!==E.data||e[32]!==v.data||e[33]!==a.slug||e[34]!==C||e[35]!==q||e[36]!==R.key||e[37]!==n?(K=O(s.jsx(Fl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:q,meta:v.data,decofile:E.data,blockKey:R.key})),e[31]=E.data,e[32]=v.data,e[33]=a.slug,e[34]=C,e[35]=q,e[36]=R.key,e[37]=n,e[38]=K):K=e[38],K}let _;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(_=R||!o?null:ar(ir(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=_):_=e[43];const A=_;let B="/",L=null,U=null;R?.kind==="page"?(B=R.path,L=R.key):R?.kind==="section"?U=R.key:A&&(B=A.path,L=A.pageKey);const $=L?`page:${L}`:U?`section:${U}`:`path:${B}`;let G;e[44]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}),e[44]=G):G=e[44];const V=o??"",W=x??void 0,H=U?null:u,J=!!L&&m.state.editSeoPageKey===L;let ae;return e[45]!==U||e[46]!==L||e[47]!==B||e[48]!==$||e[49]!==i||e[50]!==a.slug||e[51]!==H||e[52]!==J||e[53]!==V||e[54]!==W||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ae=O(s.jsx(S.Suspense,{fallback:G,children:s.jsx(Il,{orgSlug:a.slug,virtualMcpId:n,branch:V,previewReady:!0,previewUrl:W,currentPath:B,activePageBlockKey:L,activeGlobalBlockKey:U,externalSelection:H,initialEditSeo:J,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},$)})),e[45]=U,e[46]=L,e[47]=B,e[48]=$,e[49]=i,e[50]=a.slug,e[51]=H,e[52]=J,e[53]=V,e[54]=W,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ae):ae=e[59],ae}function Ul(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Gs(t){const e=ce.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=Ce(),o=rr(),l=o===!0,d=ii(n);let p;e[0]!==d||e[1]!==r?(p=oi(d,Xi(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=_n(),{currentBranch:x,taskId:b}=Xt(),g=On().previewUrl;let k;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==b||e[7]!==n?(k=x?{orgSlug:f.slug,virtualMcpId:n,branch:x,threadId:b??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=b,e[7]=n,e[8]=k):k=e[8];const y=Bn(k),v=x??"";let w;e[9]!==f.slug||e[10]!==v||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:v},e[9]=f.slug,e[10]=v,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=Ea(w),N=y.data?.[r],O=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,_=!x||R||O;let A;e[13]!==N?(A=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=A):A=e[14];const B=A;let L;e[15]!==r||e[16]!==_||e[17]!==T?(L=H=>{if(_)return;let J;try{J=JSON.parse(H)}catch{return}J===null||typeof J!="object"||Array.isArray(J)||T(r,J)},e[15]=r,e[16]=_,e[17]=T,e[18]=L):L=e[18];const U=L;let $;e[19]!==P?($=()=>({flush:P}),e[19]=P,e[20]=$):$=e[20],S.useImperativeHandle(u,$);let G;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(G=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Ie,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:s.jsx(ha,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=G):G=e[25];let V;e[26]!==y.data||e[27]!==P||e[28]!==B||e[29]!==O||e[30]!==R||e[31]!==r||e[32]!==_||e[33]!==U||e[34]!==a?(V=O?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Qi,{code:B,language:"json",readOnly:_,height:"100%",onChange:H=>U(H??""),onSave:H=>{U(H),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=B,e[29]=O,e[30]=R,e[31]=r,e[32]=_,e[33]=U,e[34]=a,e[35]=V):V=e[35];let W;return e[36]!==G||e[37]!==V?(W=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[G,V]}),e[36]=G,e[37]=V,e[38]=W):W=e[38],W}function _r(t){return t.contentEditingEnabled&&!t.isMobile}function Vl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function Hl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ql(t){return _r({contentEditingEnabled:wr(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function Wl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function Gl(t){const e=Hi(t),{display:n}=t;let r=null;if(n.mode==="production"&&n.iframeBase)try{r=new URL(t.path,n.iframeBase).href}catch{r=null}const i=qi(r,e);return{value:e,frame:i?Rn(i,t.device):null,newTab:i}}function Jl(t){const e=ce.c(90),{tests:n,options:r,onChange:i,available:u}=t,a=Ce();let o;e[0]!==r?(o=Pr(r),e[0]=r,e[1]=o):o=e[1];const l=o;let d;e[2]!==r.tests?(d=r.tests??{},e[2]=r.tests,e[3]=d):d=e[3];const p=d;let m;e[4]!==i||e[5]!==r?(m=I=>{const ie=I?Ni(I):null,{at:ne,...ee}=r;i(ie?{...ee,at:ie}:ee)},e[4]=i,e[5]=r,e[6]=m):m=e[6];const f=m;let x;e[7]!==p||e[8]!==i||e[9]!==r?(x=(I,ie)=>{const ne={...p};ie==="on"?ne[I]=!0:ie==="off"?ne[I]=!1:delete ne[I];const{tests:ee,...le}=r;i(Object.keys(ne).length>0?{...le,tests:ne}:le)},e[7]=p,e[8]=i,e[9]=r,e[10]=x):x=e[10];const b=x;let j;e[11]!==a?(j=a("sandbox.previewAs.label"),e[11]=a,e[12]=j):j=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($a,{size:16}),e[13]=g):g=e[13];let k;e[14]!==l||e[15]!==j?(k=s.jsx(Wt,{asChild:!0,children:s.jsx(lr,{asChild:!0,children:s.jsx(st,{"aria-label":j,active:l,"data-testid":"preview-as-trigger",children:g})})}),e[14]=l,e[15]=j,e[16]=k):k=e[16];let E;e[17]!==a?(E=a("sandbox.previewAs.label"),e[17]=a,e[18]=E):E=e[18];let y;e[19]!==E?(y=s.jsx(Gt,{children:E}),e[19]=E,e[20]=y):y=e[20];let v;e[21]!==k||e[22]!==y?(v=s.jsxs(Jt,{children:[k,y]}),e[21]=k,e[22]=y,e[23]=v):v=e[23];let w;e[24]!==a?(w=a("sandbox.previewAs.label"),e[24]=a,e[25]=w):w=e[25];let T;e[26]!==w?(T=s.jsx("h3",{className:"text-sm font-medium",children:w}),e[26]=w,e[27]=T):T=e[27];let P;e[28]!==u||e[29]!==a?(P=a(u?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[28]=u,e[29]=a,e[30]=P):P=e[30];let N;e[31]!==P?(N=s.jsx("p",{className:"text-xs text-muted-foreground",children:P}),e[31]=P,e[32]=N):N=e[32];let O;e[33]!==T||e[34]!==N?(O=s.jsxs("div",{className:"flex flex-col gap-1",children:[T,N]}),e[33]=T,e[34]=N,e[35]=O):O=e[35];let R;e[36]!==a?(R=a("sandbox.previewAs.momentLabel"),e[36]=a,e[37]=R):R=e[37];let _;e[38]!==R?(_=s.jsx(eo,{htmlFor:"preview-as-moment",children:R}),e[38]=R,e[39]=_):_=e[39];let A;e[40]!==r.at?(A=Ei(r.at),e[40]=r.at,e[41]=A):A=e[41];let B;e[42]!==f?(B=I=>f(I.target.value),e[42]=f,e[43]=B):B=e[43];let L;e[44]!==A||e[45]!==B?(L=s.jsx(Tn,{id:"preview-as-moment",type:"datetime-local",className:Ti,value:A,onChange:B}),e[44]=A,e[45]=B,e[46]=L):L=e[46];const U=r.at===void 0;let $;e[47]!==f?($=()=>f(""),e[47]=f,e[48]=$):$=e[48];let G;e[49]!==a?(G=a("sandbox.previewAs.now"),e[49]=a,e[50]=G):G=e[50];let V;e[51]!==U||e[52]!==$||e[53]!==G?(V=s.jsx(Ie,{type:"button",variant:"ghost",size:"sm",disabled:U,onClick:$,children:G}),e[51]=U,e[52]=$,e[53]=G,e[54]=V):V=e[54];let W;e[55]!==L||e[56]!==V?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[L,V]}),e[55]=L,e[56]=V,e[57]=W):W=e[57];let H;e[58]!==a?(H=a("sandbox.previewAs.momentHint"),e[58]=a,e[59]=H):H=e[59];let J;e[60]!==H?(J=s.jsx("p",{className:"text-xs text-muted-foreground",children:H}),e[60]=H,e[61]=J):J=e[61];let ae;e[62]!==_||e[63]!==W||e[64]!==J?(ae=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,W,J]}),e[62]=_,e[63]=W,e[64]=J,e[65]=ae):ae=e[65];let C;e[66]!==a?(C=a("sandbox.previewAs.testsLabel"),e[66]=a,e[67]=C):C=e[67];let q;e[68]!==C?(q=s.jsx("span",{className:"text-sm font-medium",children:C}),e[68]=C,e[69]=q):q=e[69];let K;e[70]!==p||e[71]!==b||e[72]!==a||e[73]!==n?(K=n.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.noTests")}):s.jsxs(s.Fragment,{children:[s.jsx("ul",{className:"flex flex-col gap-1.5",children:n.map(I=>s.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[s.jsx("span",{className:"min-w-0 truncate text-sm",children:I}),s.jsxs(to,{type:"single",variant:"outline",size:"sm",value:p[I]===void 0?"":p[I]?"on":"off",onValueChange:ie=>b(I,ie),"aria-label":I,children:[s.jsx(Ds,{value:"off",children:a("sandbox.previewAs.off")}),s.jsx(Ds,{value:"on",children:a("sandbox.previewAs.on")})]})]},I))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsHint")})]}),e[70]=p,e[71]=b,e[72]=a,e[73]=n,e[74]=K):K=e[74];let X;e[75]!==q||e[76]!==K?(X=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,K]}),e[75]=q,e[76]=K,e[77]=X):X=e[77];let M;e[78]!==l||e[79]!==i||e[80]!==a?(M=l&&s.jsx(Ie,{type:"button",variant:"outline",size:"sm",onClick:()=>i({}),children:a("sandbox.previewAs.reset")}),e[78]=l,e[79]=i,e[80]=a,e[81]=M):M=e[81];let Y;e[82]!==O||e[83]!==ae||e[84]!==X||e[85]!==M?(Y=s.jsxs(cr,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[O,ae,X,M]}),e[82]=O,e[83]=ae,e[84]=X,e[85]=M,e[86]=Y):Y=e[86];let Z;return e[87]!==v||e[88]!==Y?(Z=s.jsxs(dr,{children:[v,Y]}),e[87]=v,e[88]=Y,e[89]=Z):Z=e[89],Z}const Yl=15e3;function Ql(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Js(t){return t.loading?{...t,loading:!1}:t}const Xl=500,Zl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},Ys=1,Vt=["desktop","mobile","tablet"],ec=["preview","visual","blocks"],Qs={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function tc(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 yt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Nn(t,e){try{return new URL(t,e).href}catch{return null}}function nc(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function sc(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function rc(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function ac(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function ic({virtualMcpId:t}){const e=Ce(),n=xi(),{currentBranch:r,taskId:i,virtualMcpId:u}=Xt(),a=!!Aa(),o=Sr(),l=Ga(u===t?t:null),d=hr(t),p=so(l?.metadata?.ui?.layout??null),m=wr(p),f=_r({contentEditingEnabled:m,isMobile:n}),[x]=S.useState(()=>ql({cmsMode:p,isMobile:n})),[b,j]=ys(ws.previewEditingMode(t),c=>c&&ec.includes(c)?c:null),g=b??x,[k,E]=ys(ws.previewDeviceSize(t),c=>c&&Vt.includes(c)?c:"desktop"),[y,v]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[O,R]=S.useState(!1),_=S.useRef(null),A=()=>{_.current?.flush(),R(!1)},B=()=>R(c=>(c&&_.current?.flush(),!c)),[L,U]=S.useState({width:0,height:0}),[$,G]=S.useState(!1),[V,W]=S.useState({}),[H,J]=S.useState(""),ae=S.useRef(null),[C,q]=S.useState(!1),[K,X]=S.useState(),[M,Y]=S.useState(null),[Z,I]=S.useState(null),[ie,ne]=S.useState(null),[ee,le]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[pe,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[be,fe]=S.useState({}),[je,ye]=S.useState(!1),we=S.useRef(null),De=()=>{ye(!0),we.current&&clearTimeout(we.current),we.current=setTimeout(()=>ye(!1),15e3)},at=()=>{we.current&&(clearTimeout(we.current),we.current=null),ye(!1)},{org:ue}=_n(),Ae=kr(),Be=On(),Fe=Be.vmEntry,_e=Ae.lifecycle.phase,{url:it,undecided:qe}=li(t),oe=Dn(t,r),{connection:Ee}=vr(t),Re=Zi(t),Me=ci({hasServeConnection:!!Ee,runtime:d.runtime}),Q=qe||Me==="github"&&(Re==="loading"||Re==="error"),se=!nt(oe)&&!Q&&!(Me==="github"&&oe.kind==="pending"),ve=Ve(oe)??it,$e=ve??Be.previewUrl,ot=!!ve||_e==="running",We=l?.id===t?Qa(l.metadata):null,lt=!ve&&!qe&&l?.id===t&&d.runtime==="cms",Or=d.projectDefault==="cms",ct=se?Ui({sandboxUrl:$e,previewServerUrl:We,fastPreviewActive:lt}):null,$n=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:$e}:null,zn=Bn($n,{fetchEnabled:ot}),Zt=xr($n,{fetchEnabled:ot}),re=zn.data,xe=Zt.data,Ge=re?Oi(re,xe).sort((c,h)=>c.name.localeCompare(h.name)):[],Kn=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r}:null,In=Dl(Kn),en=re&&xe?Di(re,xe):[],Un=se&&re&&xe?Na(xe,re,"loaders"):[],Vn=H?(()=>{const c=H.toLowerCase();return Ge.map(h=>({page:h,score:rc(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,D)=>D.score-h.score||h.page.path.length-D.page.path.length).map(({page:h})=>h)})():Ge,Hn=en.filter(c=>{if(!H)return!0;const h=H.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),qn=f?Un:[],Wn=qn.filter(c=>{if(!H)return!0;const h=H.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),jt=Z?Un.find(c=>c.key===Z)??null:null,Le=Fn,tn=M||Z?null:Bi(Ge,ee,pe),te=tn?.key??null,Je=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??te,Et=tn?.path??null,Ye=(te?be[te]:void 0)??{},ke=Ke(ee,Ye),nn={};if(se&&ot&&$e&&xe&&re){const c=Ta(xe,"loaders"),h=te?re[te]:void 0,D=nl(h,re,me=>c.has(me)),z=Qo(D);for(const me of St(ee)){if(me.type!=="param")continue;const Oe=Go(ee,me.name,D),Pe=el(Oe,c,z);Pe.length>0&&(nn[me.name]=Pe)}}const Nt=t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,Gn=re&&te?Fi(re,te,0):[],Jn=nt(oe),Yn=re?Mi(Gn,re,Jn):[],sn=Yn.map(c=>c.isSavedBlock?c.label:""),rn=Yn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),an=Gn.map(c=>Ln(c,re??{},Jn)),Tt=S.useRef(null),Ne=S.useRef(null),Dr=Ae.status.state==="paused",on=Ae.phase,Qn=Ca({claimPhase:on,lifecycle:Ae.lifecycle}),Ue=Be.previewState,Br=Be.userStopped,Fr=di(ue.slug,t??""),{url:ze}=Wi(lt&&t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r,previewServerUrl:We??null,path:ke}:null),Mr=Or&&d.runtime==="sandbox",Se=ui(oe,Me,Re),Xn=fi(Se&&lt&&oe.kind==="protocol"&&t&&r?{orgSlug:ue.slug,virtualMcpId:t,branch:r}:null),Zn=Se?Xn.pointer:null,F=Lo({previewState:Ue,progressStatus:Qn.status,previewServerUrl:We,fastPreviewActive:lt,fastPreviewReady:!!ze,codingSession:Mr,localPreviewUrl:ve,hostedDraft:Se,hostedPointerPending:Se&&(oe.kind==="pending"||Xn.pending),deciding:Q}),es=F.showWakingPill||Se&&F.mode==="production"&&!Zn,dt=F.mode!=="none",$r=F.mode==="production"&&F.iframeBase?yt(F.iframeBase):null,Qe=F.mode==="production"?$r:yt($e),zr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,ut=se?ve?F.mode==="sandbox"&&f&&g==="blocks":F.mode==="production"&&lt&&zr&&f&&g==="blocks":!1,ts=S.useRef(null),{pin:Kr,effective:Ir}=nc(ts.current,{inPlaceRenderActive:ut,draftPreviewUrl:ze,resolvedPath:ke});ts.current=Kr;const ns=o.state.variantOverride??[],Ct=se?ns:[],ft=se?[]:ns,ln=nt(oe)&&$i.some(c=>zi(xe,c)==="available"),Xe=ln?V:{},ss=Pr(Xe),Ur=ln&&re?Object.keys(Ki(re).experiments):[],Rt=Se?Gl({display:F,path:ke,pointer:Zn,device:k,forcedVariants:ft,previewOptions:Xe}):null,Ze=t?js(ue.slug,t):null,rs=JSON.stringify([ft,Xe]);S.useEffect(()=>{if(!Se||!Ze)return;const[c,h]=JSON.parse(rs);As(Ze,{forcedVariants:c,previewOptions:h})},[Se,Ze,rs]),S.useEffect(()=>{if(!(!Se||!Ze))return()=>As(Ze,null)},[Se,Ze]);const cn=Ee&&Ve(oe)?yi(Ee.endpoint,ft,ss):null,Vr=Ee&&Ve(oe)?cn?no(cn,Xe):Cs:null,et=tc(F.mode==="sandbox"?zt(Rn(Rs(ie??Nn(ke,F.iframeBase)??F.iframeBase,Vr),k),Ct):F.mode==="production"&&Rt?.frame?Rt.frame:F.mode==="production"?zt(Rn(Bs(Ns(Rs(ie??Ir??Nn(ke,F.iframeBase)??F.iframeBase,es?Cs:null),ft),Xe),k),Ct):null),as=ze??(F.iframeBase?Nn(ke,F.iframeBase):null),is=F.mode==="production"&&Rt?Rt.newTab:F.mode==="production"?as?zt(Bs(Ns(as,ft),Xe),Ct):null:et??F.iframeBase,Hr=()=>{const c=is;c&&window.open(c,"_blank","noopener")},mt=t&&r?ir(ue.slug,t,r):null,pt=c=>{mt&&Oa(mt,c)},he=o.state.target;S.useEffect(()=>{if(!(!he||!ct||!xe))if(he.kind==="page"){const c=be[he.key]??{};Ne.current=Ke(he.path,c),Y(null),I(null),ne(null),de(he.key),le(he.path),pt({path:he.path,pageKey:he.key,params:c})}else if(he.kind==="loader")Ne.current=null,Y(null),I(he.key),ne(null);else{const c=en.find(h=>h.key===he.key);if(c){Ne.current=null;const h=Ts(xe);I(null),Y(c),ne(Ls(ct,h,c.key))}}},[he,ct,xe,be]),S.useEffect(()=>{!te||Et===null||he?.kind==="page"&&he.key===te&&he.path===Et||o.selectTarget({kind:"page",key:te,path:Et})},[te,Et,he]);const[os,qr]=S.useState(null);if(Ue.kind==="iframe"&&os!==Ue.previewUrl){const c=os!==null;qr(Ue.previewUrl);const h=mt?ar(mt):null;if(h){if(Ne.current=Ke(h.path,h.params),le(h.path),de(h.pageKey),ne(null),Y(null),I(null),h.pageKey&&Object.keys(h.params).length>0){const D=h.pageKey;fe(z=>({...z,[D]:h.params}))}}else c&&(Ne.current=null,le("/"),ne(null),de(null),Y(null),I(null))}Tt.current=et;const Wr=F.mode==="production"&&!!ze&&!ve,[ls,dn]=S.useState({src:et??void 0,loading:!1}),Lt=Ql(ls,et??void 0,Wr);Lt!==ls&&dn(Lt);const ht=Lt.src,cs=Lt.loading,ds=Do({iframeRef:P,src:F.mode==="sandbox"?et:null,active:F.mode==="sandbox"}),us=S.useRef(null);S.useEffect(()=>{const c=cs?setTimeout(()=>dn(Js),Yl):null,h=()=>{c&&clearTimeout(c)};if(!ze||!ht||us.current===ze)return h;us.current=ze;const D=P.current;return D&&D.getAttribute("src")!==ht&&(De(),D.src=ht),h},[ze,ht,cs]);const fs=()=>{const c=P.current?.contentWindow,h=Qe;if(!c||!h||!re||!te)return;const D=re[te];if(!D||typeof D!="object")return;const z=Vi({previewBaseUrl:h,pageBlock:D,decofile:re,path:ke,pathTemplate:ee});if(!z)return;const me=zt(z.src,bi(Ct,te));c.postMessage({type:"cms-editor::render",src:me,body:z.body},h)},un=S.useRef(null);S.useEffect(()=>{if(!ut||M||Z||!te||!re){un.current=null;return}const c={nav:JSON.stringify({page:te,path:ke,pathTemplate:ee}),content:JSON.stringify(re)},h=sc(un.current,c);un.current=c,h&&fs()},[re,ut,M,Z,te,ke,ee]);const fn=S.useRef(null);S.useEffect(()=>{if(!ut||M||Z||!te||!re){fn.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=fn.current;fn.current={page:te,sig:c},!(!h||h.page!==te||h.sig===c)&&fs()},[o.state.variantOverride,ut,M,Z,te]);const Gr=!!t&&!!r&&!Ae.notFound&&!Br&&!Dr&&(on?.kind==="ready"||_e!=="idle"),ge=Wl({editingMode:g,sandboxDisplay:F.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=Qe;if(!c)return;const h=D=>{if(D.origin===c)if(D.data?.type==="visual-editor::element-clicked"){const z=$o.safeParse(D.data.payload);z.success&&v(z.data)}else if(D.data?.type==="cms-editor::section-clicked"){const z=Io.safeParse(D.data.payload);z.success&&T({index:z.data.sectionIndex,seq:z.data.clickSeq})}else D.data?.type==="cms-editor::render-start"?De():D.data?.type==="cms-editor::render-end"?(at(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:sn,kinds:rn,keys:an},c)):D.data?.type==="cms-editor::render-error"&&at()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[Qe,sn,rn,an]);const ms=()=>{const c=P.current?.contentWindow,h=yt($e);!c||!h||c.postMessage({type:"visual-editor::activate",script:zo},h)},Jr=()=>{const c=P.current?.contentWindow,h=yt($e);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},mn=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||(c.postMessage(F.mode==="production"||ve?{type:"editor::inject",args:{script:Is}}:{type:"visual-editor::activate",script:Is},h),c.postMessage({type:"cms-editor::set-labels",labels:sn,kinds:rn,keys:an},h))},Yr=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Qr=()=>{const c=P.current?.contentWindow,h=Qe;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},At=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),j(c),v(null),T(null),c!=="blocks"&&I(null),h==="visual"&&Jr(),c==="visual"&&ms(),h==="blocks"&&c!=="blocks"&&Yr(),c==="blocks"&&mn()},Xr=()=>{At(Vl(g,f))},Zr=()=>{At(Hl(g,f))},pn=()=>{const c=P.current;if(!c)return;De();const h=document.activeElement,D=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),ac(c,Tt.current);let z;const me=()=>{clearTimeout(z),c.tabIndex=D,c.style.pointerEvents="";const Oe=document.activeElement;(!Oe||Oe===document.body||Oe===c)&&h?.focus(),c.removeEventListener("load",me)};c.addEventListener("load",me),z=setTimeout(me,3e3)};Ji(pn);const _t=js(ue.slug,t??""),Ot=Se&&dt&&!!t,ps=S.useRef(null);S.useEffect(()=>{if(Ot)return mi(_t)},[Ot,_t]);const{reload:gt}=pi(ue.slug,t??""),hs=S.useRef(gt.seq);S.useEffect(()=>{if(hs.current!==gt.seq&&(hs.current=gt.seq,!!Ot&&ps.current===Tt.current)){if(gt.navigates){Es(_t);return}pn()}},[gt.seq]);const ea=hi(Kn),vt=gi(Ve(oe)?ea:""),gs=S.useRef(vt);S.useEffect(()=>{const c=gs.current;if(gs.current=vt,!c||!vt||c===vt)return;const h=P.current;if(h)return Mo({iframe:h,reload:pn})},[vt]);const ta=()=>{const c=Vt.indexOf(k);E(Vt[(c+1)%Vt.length])},hn=(c,h)=>{if(!te)return;const D=te,z={...Ye,[c]:h};Ne.current=Ke(ee,z),fe(me=>({...me,[D]:z})),pt({path:ee,pageKey:D,params:z})},na=Rl({iframeBase:F.iframeBase,resolvedPath:ke,activeGlobalSectionName:M?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),gn=c=>{const h=be[c.key]??{},D=Ke(c.path,h);(M||Le(D)!==Le(ke))&&De(),Ne.current=D,Y(null),I(null),ne(null),T(null),de(c.key),le(c.path),pt({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};_a(mt,c=>{(M||Le(c)!==Le(ke))&&De(),Ne.current=c,Y(null),I(null),ne(null),T(null),de(null),le(c),pt({path:c,pageKey:null,params:{}})});const sa=c=>{if(nt(oe)){const z=re?Ii(re,c.key,xe):null;z?gn(z):yn.info(e("sandbox.preview.blockOnNoPage"));return}if(!ct||!xe){yn.error(e("sandbox.preview.previewMetadataNotReady"));return}De(),Ne.current=null;const h=Ts(xe),D=Ls(ct,h,c.key);Y(c),I(null),ne(D),T(null),o.selectTarget({kind:"section",key:c.key})},ra=c=>{f&&(Y(null),I(c.key),ne(null),At("blocks"),o.selectTarget({kind:"loader",key:c.key}))},aa=async({name:c,path:h,templateKey:D})=>{if(!t||!r)return;const z=yr(h);if(z){X(z);return}const me=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(Ge.some(Pe=>Le(Pe.path)===Le(me))){X(e("sandbox.preview.pageAlreadyExists",{path:me}));return}let Oe;if(D&&(Oe=re?.[D],!Oe)){X(e("sandbox.preview.templateNoLongerExists"));return}X(void 0);try{const Pe=await In.mutateAsync({name:c,path:me,template:Oe,schema:nt(oe)?{meta:xe,loadMeta:async()=>(await Zt.refetch()).data}:void 0});q(!1),yn.success(e("sandbox.preview.pageCreated",{name:c})),await ro(Xl),gn({key:Pe.key,name:Pe.name,path:Pe.path}),At("blocks")}catch(Pe){X(Pe instanceof Ar?e("sandbox.preview.pageSchemaNotReady"):Pe instanceof Error?Pe.message:e("sandbox.preview.failedToCreatePage"))}},Dt=Ll({previewSurfaceActive:dt,daemonReady:Gr,production:F.mode==="production",servePreviewUrl:Ve(oe)}),ia=Al({showPreviewToolbar:Dt,contentEditingEnabled:m}),Bt=()=>{G(!1),J("")},vn=M?.name??jt?.title??tn?.name,xn=zn.isPending||Zt.isPending,bn=xn?yt(F.iframeBase):vn,Ft=M?`section:${M.key}`:Z?`loader:${Z}`:te?`page:${te}`:void 0,oa=Dt?ia?s.jsxs(dr,{open:$,onOpenChange:c=>{G(c),c||J("")},children:[s.jsx(lr,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:xn?bn??void 0:M||jt?vn:[vn,ee].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-ring",children:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[M&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(za,{size:11}),e("sandbox.preview.globalBadge")]}),jt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[s.jsx(Ka,{size:11}),e("sandbox.preview.loaderBadge")]}),bn&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:bn}),!xn&&!M&&!jt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:ee}),s.jsx(Da,{size:12,className:Ht("shrink-0 transition-transform",$&&"rotate-180")})]})})}),s.jsxs(cr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(fr,{shouldFilter:!1,defaultValue:Ft,children:[s.jsx(mr,{value:H,onValueChange:c=>{J(c),ae.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(ur,{ref:ae,className:"max-h-80",children:[s.jsx(pr,{children:Ge.length===0&&en.length===0&&qn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Vn.length>0&&s.jsx(wt,{children:Vn.map(c=>s.jsxs(kt,{value:`page:${c.key}`,"aria-current":Ft===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Bt(),gn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Hn.length>0&&s.jsx(wt,{heading:e("sandbox.preview.globalComponents"),children:Hn.map(c=>s.jsx(kt,{value:`section:${c.key}`,"aria-current":Ft===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),sa(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Wn.length>0&&s.jsx(wt,{heading:e("sandbox.preview.globalLoaders"),children:Wn.map(c=>s.jsx(kt,{value:`loader:${c.key}`,"aria-current":Ft===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),ra(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!M&&!Z&&St(ee).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:St(ee).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const D=nn[c.name];return D&&Nt?s.jsx(vl,{sources:D,template:ee,paramName:c.name,value:Ye[c.name]??"",sandboxRef:Nt,onCommit:z=>hn(c.name,z)},`${te}:${c.name}`):s.jsx(Tl,{name:c.name,value:Ye[c.name]??"",onCommit:z=>hn(c.name,z)},`${te}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Ie,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Bt(),X(void 0),q(!0)},children:[s.jsx(Wa,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:na}):null,vs=Dt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:ta,"aria-label":e(Qs[k]),children:k==="mobile"?s.jsx(Ia,{size:16}):k==="tablet"?s.jsx(Ua,{size:16}):s.jsx(Va,{size:16})})}),s.jsx(Gt,{children:e(Qs[k])})]}),oa,s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[ln&&s.jsx(Jl,{tests:Ur,options:V,onChange:W,available:!!cn||!es||!ss}),s.jsx(st,{onClick:Hr,disabled:Se&&!is,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(ga,{size:16})})]})]}):null,la=(se||a)&&F.mode==="sandbox",Mt=Zl[k],$t=k==="desktop"&&(L.width===0||L.width>=Mt.width+2*Ys),xs=$t?1:Math.min(L.width>0?L.width/(Mt.width+2*Ys):1,1),ca=$t?{width:"100%",height:"100%"}:{width:`${Mt.width}px`,height:L.height>0?`${L.height/xs}px`:`${Mt.height}px`,transform:`scale(${xs})`,transformOrigin:"top center"},bs=s.jsxs(s.Fragment,{children:[la&&(Dt||m)&&s.jsx(st,{onClick:Xr,"aria-pressed":ge==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ge==="visual",children:s.jsx(Ps,{size:16})}),f&&s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:Zr,"aria-pressed":ge==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ge==="blocks",children:s.jsx(qa,{size:16})})}),s.jsx(Gt,{children:e("sandbox.preview.blocksEditor")})]}),Je&&s.jsxs(Jt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(st,{onClick:B,"aria-pressed":O,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:O,children:s.jsx(Ha,{size:16})})}),s.jsx(Gt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),da=!!Z&&ge==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[Nt&&Object.entries(nn).map(([c,h])=>(Ye[c]??"")===""?s.jsx(El,{sources:h,template:ee,paramName:c,sandboxRef:Nt,onFill:D=>hn(c,D)},`${te}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(ks.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:vs}),children:vs}),s.jsx(ks.Toolbar.Right.Portal,{fallback:bs,children:bs})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:da?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Ws,{virtualMcpId:t,externalSelection:w,onViewJsonFile:B}),O&&Je&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Gs,{ref:_,virtualMcpId:t,pageKey:Je,onClose:A})})]}):s.jsxs(_s,{orientation:"horizontal",disabled:ge!=="blocks",className:"relative isolate",children:[s.jsx(Kt,{ref:N,id:"preview-blocks-editor",defaultSize:ge==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ge==="blocks"&&s.jsx(Ws,{virtualMcpId:t,externalSelection:w,onViewJsonFile:B})}),ge==="blocks"&&s.jsx(Os,{withHandle:!0}),s.jsx(Kt,{id:"preview-canvas",defaultSize:ge==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(_s,{orientation:"horizontal",disabled:!(O&&Je),children:[s.jsx(Kt,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>U(z=>z.width===c.clientWidth&&z.height===c.clientHeight?z:{width:c.clientWidth,height:c.clientHeight});h();const D=new ResizeObserver(h);return D.observe(c),()=>D.disconnect()},className:Ht("h-full relative overflow-clip flex justify-center",dt&&!$t&&"bg-muted/30"),children:[(je||Fr)&&dt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),F.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(Pt,{className:"size-5 text-muted-foreground"})}),F.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"starting",progress:Qn,claimPhase:on})}),!ve&&!Q&&Ue.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"suspended",onResume:Be.resume})}),!ve&&!Q&&Ue.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(kn,{kind:"errored",error:Ue.error,onRetry:Be.retry,connectionsHref:`/${ue.slug}/settings/connections`})}),F.showWakingPill&&s.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[s.jsx(Pt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ge==="visual"&&!y&&s.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(Ps,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ge==="visual"&&y&&s.jsx(Ho,{element:y,onDismiss:()=>v(null)}),dt&&et&&s.jsx("div",{className:Ht("shrink-0",!$t&&"bg-background shadow-edge"),style:ca,onMouseLeave:Qr,children:s.jsx("iframe",{ref:P,src:ht,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:ds.handleError,onLoad:()=>{if(dn(Js),ds.handleLoad(),at(),ps.current=Tt.current,Ot&&Es(_t),F.mode!=="sandbox"||ve){(F.mode==="production"&&!F.showWakingPill||ve)&&ge==="blocks"&&mn();return}if(va("vm_preview_loaded",{view_mode:ge,vm_id:Fe?.sandboxHandle??null}),!M)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ne.current;if(h!==null&&(Ne.current=null,Le(c)!==Le(h))||Le(c)===Le(ke))return;le(c),pt({path:c,pageKey:pe,params:Ye})}catch{}ge==="visual"&&ms(),ge==="blocks"&&mn()}},F.iframeBase)})]})}),O&&Je&&s.jsxs(s.Fragment,{children:[s.jsx(Os,{withHandle:!0}),s.jsx(Kt,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Gs,{ref:_,virtualMcpId:t,pageKey:Je,onClose:A})})]})]})})]})}),s.jsx(Bl,{open:C,onOpenChange:q,isPending:In.isPending,error:K,templates:Ge,onSubmit:aa})]})}const oc=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},lc=1e4,cc=1e4,dc=5e3,uc=2;function fc(t,e){return t&&e===0?cc:Math.min(1e3*2**Math.max(0,e-1),dc)}function mc(t,e,n){return e?!0:t===!0&&n<uc}function pc(t,e){const n=ce.c(11),r=oc,i=xa();let u;n[0]!==t?(u=er.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,x=new AbortController,b=()=>x.abort();f.addEventListener("abort",b);const j=setTimeout(b,lc),g=await r(t,x.signal).catch(gc);clearTimeout(j),f.removeEventListener("abort",b);const k=i.getQueryData(a),E=g?0:(k?.failures??0)+1;return{up:mc(k?.up??null,g,E),failures:E}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:hc},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=ba(d);return t?p?.up??null:null}function hc(t){return t.state.data?fc(t.state.data.up,t.state.data.failures):!1}function gc(){return!1}function vc(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function pd(t){const e=ce.c(48),{virtualMcpId:n}=t,r=Ce(),i=Ja(n),{connection:u}=vr(n),{activeTask:a,taskId:o,currentBranch:l}=Xt(),d=ho(o),[p,m]=S.useState(!1),f=Dn(n,l);let x;e[0]!==f||e[1]!==u?(x=u?Ve(f):null,e[0]=f,e[1]=u,e[2]=x):x=e[2];const b=x,j=pc(b),g=Er();if(oo({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:Sn(i?.metadata),threadHasRepo:Sn(d)||Sn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(Fs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let v;e[4]!==r?(v=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=v):v=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(Fs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let O;e[12]!==N?(O=s.jsxs(Ie,{onClick:T,children:[P,N]}),e[12]=N,e[13]=O):O=e[13];let R;e[14]!==v||e[15]!==w||e[16]!==O?(R=s.jsx(ao,{className:"h-full",image:y,title:v,description:w,actions:O}),e[14]=v,e[15]=w,e[16]=O,e[17]=R):R=e[17];let _;e[18]!==p?(_=s.jsx(io,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=_):_=e[19];let A;return e[20]!==_||e[21]!==R?(A=s.jsxs(s.Fragment,{children:[R,_]}),e[20]=_,e[21]=R,e[22]=A):A=e[22],A}if(u&&i&&!Ve(f)){let y;e[23]!==g||e[24]!==f?(y=vc({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let v;e[26]!==u.endpoint?(v=vi(u.endpoint),e[26]=u.endpoint,e[27]=v):v=e[27];let w;return e[28]!==y||e[29]!==v?(w=s.jsx(bc,{status:y,host:v}),e[28]=y,e[29]=v,e[30]=w):w=e[30],w}if(b&&j!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let v;e[33]!==b||e[34]!==r?(v=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:xc(b)}),e[33]=b,e[34]=r,e[35]=v):v=e[35];let w;e[36]!==v?(w=s.jsx(Yt,{text:v}),e[36]=v,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(Qt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let E;return e[46]!==n?(E=s.jsx(Ra,{children:s.jsx(ic,{virtualMcpId:n})}),e[46]=n,e[47]=E):E=e[47],E}function xc(t){try{return new URL(t).host}catch{return t}}function bc(t){const e=ce.c(20),{status:n,host:r}=t,i=Ce();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Yt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${gr} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(Qt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=yo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(bo,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{bo as L,pd as P,Qt as S,md as u};