decocms 4.618.0 → 4.618.1

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 (432) hide show
  1. package/dist/client/assets/{AlertCircle-BYyFOifG.js → AlertCircle-GoAGGV0G.js} +1 -1
  2. package/dist/client/assets/{AreaChart-D6tyN032.js → AreaChart-BCH9fczV.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BQKI9I0k.js → ArrowLeft-DuGHc_Gh.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-B21E_uc5.js → ArrowRight-CMJyKdyB.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BbdlU24N.js → ArrowUp-s5a8DQxj.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-BUy5CVjC.js → BookOpen01-DZs1-yi9.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-DDuspEUo.js → CartesianChart-BFVvuNgw.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CclXOr_i.js → CategoricalChart-iNQ2kTf5.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-DtUq_uxu.js → CheckCircle-vIQcB0iT.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-C0rME5fU.js → ChevronDown-Dm2xO7jf.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BCjXLDN_.js → ChevronSelectorVertical-Cvgyclsz.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-CIqW-9_W.js → ChevronUp-BKdcyIOm.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-BGMvQi86.js → CreditCard01-BUXydXso.js} +1 -1
  14. package/dist/client/assets/{Eye-DvysNEeS.js → Eye-DwRCQHLk.js} +1 -1
  15. package/dist/client/assets/{File02-Nky5bxni.js → File02-Y4Nh84qP.js} +1 -1
  16. package/dist/client/assets/{Fingerprint04-DNoiAgrN.js → Fingerprint04-DlIWxzRc.js} +1 -1
  17. package/dist/client/assets/{Globe04--1ycu_yQ.js → Globe04-5yHQa01g.js} +1 -1
  18. package/dist/client/assets/{Image01-BGZNkNVE.js → Image01-BRABRo3v.js} +1 -1
  19. package/dist/client/assets/{Key01-B7vuN73N.js → Key01-DfLmV_su.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-DTjvUEMi.js → LayoutLeft-owMYqid0.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-w2HNuUHo.js → LinkBroken01-CyjdgWmP.js} +1 -1
  22. package/dist/client/assets/{MessageCircle01-BUz5eIR5.js → MessageCircle01-zc37Krdu.js} +1 -1
  23. package/dist/client/assets/{Minus-DhX2EjkJ.js → Minus-CFYZtYi9.js} +1 -1
  24. package/dist/client/assets/{Monitor01-Dv4dKtFe.js → Monitor01-DUhT2Mcw.js} +1 -1
  25. package/dist/client/assets/{Play-BcRuLGoC.js → Play-C_9Fb_Ik.js} +1 -1
  26. package/dist/client/assets/{Plus-Bd_Azs6t.js → Plus-BoPsX_T8.js} +1 -1
  27. package/dist/client/assets/{ReferenceLine-B5a2JVy9.js → ReferenceLine-ChigmKEb.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DoUjFKDV.js → SearchMd-BGRe_18c.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-DsiPVRC3.js → ShoppingBag01-CoN4FBW5.js} +1 -1
  30. package/dist/client/assets/{Sun-bgIMzv-s.js → Sun-uwKn4QPm.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-BZWsjo2g.js → SwitchHorizontal01-CHtrDs50.js} +1 -1
  32. package/dist/client/assets/{Tool01-JC0jUvnM.js → Tool01-D90Wr5xR.js} +1 -1
  33. package/dist/client/assets/{Tooltip-DmnEut8_.js → Tooltip-Vyb5xIGx.js} +1 -1
  34. package/dist/client/assets/{Trash01-DUjxO1Dn.js → Trash01-Ctp9Olbr.js} +1 -1
  35. package/dist/client/assets/{Upload01-BcZgaIHQ.js → Upload01-DgxprpI7.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-CHkzczFI.js → UserCheck01-CA8kXGn8.js} +1 -1
  37. package/dist/client/assets/{UserSquare-D6ubIo4l.js → UserSquare-dgrNjiXb.js} +1 -1
  38. package/dist/client/assets/{Users01-DOgFV3e5.js → Users01-BasqfwpC.js} +1 -1
  39. package/dist/client/assets/{XClose-CHJIrn3i.js → XClose-BUxhnZ3x.js} +1 -1
  40. package/dist/client/assets/{Zap-6gSNYeqn.js → Zap-CxPsn4FS.js} +1 -1
  41. package/dist/client/assets/{access-gate-B30zL1q2.js → access-gate-4Yp7vAaA.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-DgKMGv-9.js → add-connection-dialog-D2t3ivnz.js} +1 -1
  43. package/dist/client/assets/agent-app-CKN609Ao.js +1 -0
  44. package/dist/client/assets/{agent-assets-CamOcpgT.js → agent-assets-DDFIPSsr.js} +1 -1
  45. package/dist/client/assets/{agent-automation-BfbO9Khi.js → agent-automation-B7CVzf5F.js} +1 -1
  46. package/dist/client/assets/{agent-automations-B4IdsMR9.js → agent-automations-5RoGEa0z.js} +1 -1
  47. package/dist/client/assets/{agent-blog-Cafvmf-h.js → agent-blog-Sl8lv70B.js} +2 -2
  48. package/dist/client/assets/{agent-blog-post-Dqts0p9T.js → agent-blog-post-CeGtmOXI.js} +2 -2
  49. package/dist/client/assets/{agent-business-case-BhUa4Myx.js → agent-business-case-CMOhhL4x.js} +1 -1
  50. package/dist/client/assets/{agent-calendar-yZ-kBQTO.js → agent-calendar-DN3_psfi.js} +1 -1
  51. package/dist/client/assets/{agent-capabilities-CWtYqnIq.js → agent-capabilities-DmT72SWM.js} +1 -1
  52. package/dist/client/assets/{agent-connect-sources-D6NBeEEC.js → agent-connect-sources-B2mB08r7.js} +1 -1
  53. package/dist/client/assets/agent-deck-B4OrR3A7.js +1 -0
  54. package/dist/client/assets/{agent-e2e-WoNG4ZEl.js → agent-e2e-63TLdzRb.js} +1 -1
  55. package/dist/client/assets/agent-experiments-D6tEEJ7A.js +1 -0
  56. package/dist/client/assets/agent-file-BbWhb5MG.js +1 -0
  57. package/dist/client/assets/{agent-hosting-nth6pteI.js → agent-hosting-DR49fQQv.js} +1 -1
  58. package/dist/client/assets/{agent-icon-zKGrqypc.js → agent-icon-DoabtHNW.js} +1 -1
  59. package/dist/client/assets/agent-library-DB8Gnwn6.js +1 -0
  60. package/dist/client/assets/agent-library-file-Cc6xu5fG.js +1 -0
  61. package/dist/client/assets/agent-overview-Dp6TUwUW.js +1 -0
  62. package/dist/client/assets/{agent-releases-Bf5mW-Cb.js → agent-releases-CjOdbsoc.js} +1 -1
  63. package/dist/client/assets/agent-settings-Bl07TGrR.js +1 -0
  64. package/dist/client/assets/{agent-site-editor-Cs2byz0P.js → agent-site-editor-CZ2oqt5O.js} +1 -1
  65. package/dist/client/assets/agent-site-editor-code-D7ZiHs5k.js +2 -0
  66. package/dist/client/assets/agent-site-editor-content-D7tLGQbd.js +1 -0
  67. package/dist/client/assets/agent-site-editor-preview-BwKMWPep.js +1 -0
  68. package/dist/client/assets/agent-view-DkN5uE0f.js +1 -0
  69. package/dist/client/assets/{agent-view-guard-BlaaF4Tt.js → agent-view-guard-wWwEqBbc.js} +1 -1
  70. package/dist/client/assets/{ai-providers-DtnDf2l2.js → ai-providers-DTKly69Q.js} +1 -1
  71. package/dist/client/assets/{alert-Bv1HVos8.js → alert-C5EpdwBA.js} +1 -1
  72. package/dist/client/assets/{analytics-sections-BszcYb0J.js → analytics-sections-BjczT6mc.js} +1 -1
  73. package/dist/client/assets/api-keys-BCHOPkMm.js +1 -0
  74. package/dist/client/assets/{api-keys-omOxFywl.js → api-keys-CV36tutN.js} +1 -1
  75. package/dist/client/assets/{app-editor-CrhcliiJ.js → app-editor--um7u6Wc.js} +1 -1
  76. package/dist/client/assets/{asset-utils-C40NGt6S.js → asset-utils-D7ZsoUjl.js} +1 -1
  77. package/dist/client/assets/{auth-BbyP7Mh4.js → auth-IBAsOARn.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-DC_pvXWR.js → auth-catchall-DPqMCEC6.js} +1 -1
  79. package/dist/client/assets/{auth-entry-DTt6oF6n.js → auth-entry-Bk_VrJBw.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-D6lmqNl3.js → auth-split-layout-zr8fqIYk.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-Dv5K3sbt.js → authenticate-and-persist-oauth-BmdGjqM8.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-CVyxW8bA.js → automation-list-row-kZcPBX-Y.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DxzIf484.js → automation-runs-NP4ibGIs.js} +1 -1
  84. package/dist/client/assets/{automations-D6gxCniS.js → automations-D7IUlLWI.js} +1 -1
  85. package/dist/client/assets/{badge-DhCDyINb.js → badge-DONoxQO7.js} +1 -1
  86. package/dist/client/assets/{block-document-DhUbHSJu.js → block-document-Dlll0MPP.js} +1 -1
  87. package/dist/client/assets/{blocks-preview-workspace-context-Bmn4QW94.js → blocks-preview-workspace-context-LApXEaVX.js} +1 -1
  88. package/dist/client/assets/{blocks-tab-states-CtDx-TXT.js → blocks-tab-states-CTy1iAF5.js} +1 -1
  89. package/dist/client/assets/{blog-preview-url-C8ne1zjD.js → blog-preview-url-BGp0zYxW.js} +1 -1
  90. package/dist/client/assets/{blog-schema-XbxpqD7n.js → blog-schema-CGys1Vfw.js} +1 -1
  91. package/dist/client/assets/{blog-source-gate--8e6WU5f.js → blog-source-gate-D3KL0oEF.js} +1 -1
  92. package/dist/client/assets/{blog-view-gate-5YPkAPHi.js → blog-view-gate-BFq59z60.js} +1 -1
  93. package/dist/client/assets/{buckets-mVuz76PR.js → buckets-C-9n1VRF.js} +1 -1
  94. package/dist/client/assets/{build-improve-prompt-doc-YaUfgVXc.js → build-improve-prompt-doc-CcS36Qyr.js} +1 -1
  95. package/dist/client/assets/{calendar-BDRihgLI.js → calendar-BRx4DiEx.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-BUXjQvww.js → capability-load-error-C6JoLBp9.js} +1 -1
  97. package/dist/client/assets/{category-editor-DAZ1WajU.js → category-editor-B-RRxjlW.js} +1 -1
  98. package/dist/client/assets/{category-tree-9o5eAqGF.js → category-tree-CW0acTf_.js} +1 -1
  99. package/dist/client/assets/{chart-BD1DM8Vo.js → chart-BhhOak8o.js} +1 -1
  100. package/dist/client/assets/{chat-context-DHSww0cO.js → chat-context-vJ6R-Clt.js} +1 -1
  101. package/dist/client/assets/{chat-draft-BwCJJBjY.js → chat-draft-C93TMi7F.js} +1 -1
  102. package/dist/client/assets/{checkbox-BK5KAA6g.js → checkbox-CkODjqKt.js} +1 -1
  103. package/dist/client/assets/{choose-editor-Xa2hczm2.js → choose-editor-CUGLPz2R.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-4m_qDet6.js → cli-auth-success-DISNojzj.js} +1 -1
  105. package/dist/client/assets/{cms-settings-editor-CT9mj3NU.js → cms-settings-editor-DLMpcsg9.js} +1 -1
  106. package/dist/client/assets/{cms-store-drafts-BZtc347l.js → cms-store-drafts-DgvuEc1i.js} +1 -1
  107. package/dist/client/assets/{collapsible-Ff_HBxQZ.js → collapsible-BdVp5Lcb.js} +1 -1
  108. package/dist/client/assets/{collection-detail-Da5T5FHc.js → collection-detail-CYRLagxm.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-Dsc8IsyJ.js → collection-display-button-CrLnf-_h.js} +1 -1
  110. package/dist/client/assets/{collection-search-C3yL3Si4.js → collection-search-DL8nJQx4.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-CC70QIiG.js → collection-table-wrapper-fYA2bGN6.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-Bw8ZEjbc.js → collection-tabs-9jbbjBDw.js} +1 -1
  113. package/dist/client/assets/{combobox-DhzcDPGN.js → combobox-B9eEiOM0.js} +1 -1
  114. package/dist/client/assets/{command-C04_rx60.js → command-D5O7M-Cf.js} +1 -1
  115. package/dist/client/assets/{companion-mcps-section-Cyom-mwN.js → companion-mcps-section-D_ernmuP.js} +1 -1
  116. package/dist/client/assets/{config-CTUwx0E7.js → config-BOn4tvAD.js} +1 -1
  117. package/dist/client/assets/{connect-BFJ96IAv.js → connect-B9Or7Mba.js} +1 -1
  118. package/dist/client/assets/{connect-key-x35pzj1P.js → connect-key-BddF4e4b.js} +1 -1
  119. package/dist/client/assets/{connect-layout-CYxI3Ix2.js → connect-layout-CNgkeyZs.js} +1 -1
  120. package/dist/client/assets/{connect-source-dialog-DW2Q7-Vc.js → connect-source-dialog-F5S3IN4q.js} +1 -1
  121. package/dist/client/assets/{connection-OrxsAVXu.js → connection-BxF6Rdiu.js} +1 -1
  122. package/dist/client/assets/{connection-card-JSblTqum.js → connection-card-Ca3jxrTD.js} +1 -1
  123. package/dist/client/assets/{connection-detail-BDZh3nKl.js → connection-detail-B5pUbex_.js} +1 -1
  124. package/dist/client/assets/{connection-form-helpers-D-61dVx3.js → connection-form-helpers-oAW0sDLm.js} +1 -1
  125. package/dist/client/assets/{connection-slug-BxAeiVuI.js → connection-slug-B7w04sZ1.js} +1 -1
  126. package/dist/client/assets/{connections-Cm49J0DF.js → connections-C0U7G-PU.js} +1 -1
  127. package/dist/client/assets/{content-changes-Sy14c4Sj.js → content-changes-DXqxs3Wb.js} +1 -1
  128. package/dist/client/assets/{content-tab-B08qF9Ws.js → content-tab-C23eyWcW.js} +3 -3
  129. package/dist/client/assets/{context-DWbB1_E6.js → context-LlVd3qyN.js} +1 -1
  130. package/dist/client/assets/{context-menu-2WNbt8mp.js → context-menu-DJtvu4JZ.js} +1 -1
  131. package/dist/client/assets/{context-shell-CsxbLyhW.js → context-shell-0fpmlncZ.js} +3 -3
  132. package/dist/client/assets/{create-organization-dialog-Cmj0uZ47.js → create-organization-dialog-97eVCkRr.js} +1 -1
  133. package/dist/client/assets/{daily-pulse-C2a7jj6_.js → daily-pulse-DVtdyKrr.js} +1 -1
  134. package/dist/client/assets/{delete-copy-B_bYyZez.js → delete-copy-rajlpHzK.js} +1 -1
  135. package/dist/client/assets/{device-hint-BT8_DhB_.js → device-hint-DVUadRrt.js} +1 -1
  136. package/dist/client/assets/{discover-DqSkXP2Q.js → discover-CCbrOrMD.js} +1 -1
  137. package/dist/client/assets/{domain-settings-Cyu0iMV3.js → domain-settings-CcAHeKi4.js} +1 -1
  138. package/dist/client/assets/{drawer-BdL5OKVC.js → drawer-DO0sMAej.js} +1 -1
  139. package/dist/client/assets/{editor-CUzd1SE7.js → editor-UaRoONxx.js} +1 -1
  140. package/dist/client/assets/{editor-classes-1dg1pjaK.js → editor-classes-DMpdrv32.js} +1 -1
  141. package/dist/client/assets/{empty-state-CCe_gxuj.js → empty-state-C4MgLcBg.js} +1 -1
  142. package/dist/client/assets/{empty-state-9tWEtAox.js → empty-state-UX_DOq42.js} +1 -1
  143. package/dist/client/assets/{experiments-tab-choice-CvZgfB88.js → experiments-tab-choice-loxGESO7.js} +1 -1
  144. package/dist/client/assets/{extract-connection-data-0MTwkkap.js → extract-connection-data-DXA3Rt-s.js} +1 -1
  145. package/dist/client/assets/{feature-gate-BoNGlq-b.js → feature-gate-Bc8aW-U-.js} +1 -1
  146. package/dist/client/assets/{feature-paywall-Bg-PT-Nn.js → feature-paywall-hqI35k49.js} +1 -1
  147. package/dist/client/assets/{file-explorer-DQI3RjrR.js → file-explorer-DE4Pg5Zn.js} +1 -1
  148. package/dist/client/assets/{file-preview-pAXtoXVY.js → file-preview-BKJnTrOe.js} +1 -1
  149. package/dist/client/assets/{file-share-button-BpR0pG7Z.js → file-share-button--SjJonFb.js} +1 -1
  150. package/dist/client/assets/{file-type-icon-BINq6pAJ.js → file-type-icon-R4tsODq6.js} +1 -1
  151. package/dist/client/assets/{folder-icon-JauS1zcB.js → folder-icon-DC-T6LMD.js} +1 -1
  152. package/dist/client/assets/{form-DINHcU5h.js → form-DwGozYbG.js} +1 -1
  153. package/dist/client/assets/{frame-navigation-bHiDiNE9.js → frame-navigation-CoKnARJv.js} +1 -1
  154. package/dist/client/assets/{gateway-client-BXoRIC2f.js → gateway-client-C5MrdR_p.js} +1 -1
  155. package/dist/client/assets/{general-KZQuDKZq.js → general-BiR6hkWa.js} +1 -1
  156. package/dist/client/assets/{github-icon-DeI0LVM6.js → github-icon-YYYF_UPl.js} +1 -1
  157. package/dist/client/assets/{held-block-view-BplchR69.js → held-block-view-CRIGJWyy.js} +1 -1
  158. package/dist/client/assets/{home-BM2M0ir_.js → home-Crikv5tf.js} +1 -1
  159. package/dist/client/assets/{home-overview-C7_beN9y.js → home-overview-CJ86tdHp.js} +1 -1
  160. package/dist/client/assets/{hosted-reconcile-zJ_hLbuq.js → hosted-reconcile-CTronLZo.js} +1 -1
  161. package/dist/client/assets/{icon-button-DTvCNNgw.js → icon-button-DFliy54K.js} +1 -1
  162. package/dist/client/assets/{index-gkLejYlX.js → index-B9Qs-0Gp.js} +1 -1
  163. package/dist/client/assets/{index-D4Cq4uu-.js → index-BFFHlwFA.js} +1 -1
  164. package/dist/client/assets/{index-DpsRmOqH.js → index-BH4xxzAP.js} +1 -1
  165. package/dist/client/assets/{index-KT7S-wXA.js → index-BKFaN6Ld.js} +1 -1
  166. package/dist/client/assets/{index-BYAVvzAx.js → index-BTNa7cC6.js} +1 -1
  167. package/dist/client/assets/{index-cHqyigDN.js → index-BVDmO57n.js} +1 -1
  168. package/dist/client/assets/{index-WY5skHFQ.js → index-C_NkXLoh.js} +1 -1
  169. package/dist/client/assets/{index-DOAcfhWB.js → index-CcrP-nDa.js} +1 -1
  170. package/dist/client/assets/{index-CxRoy25G.js → index-D4CqkEu4.js} +1 -1
  171. package/dist/client/assets/{index-BE5pN4ch.js → index-D5QLXgD8.js} +1 -1
  172. package/dist/client/assets/{index-B7VjCiRT.js → index-DDritN78.js} +1 -1
  173. package/dist/client/assets/{index-DkgRE7a8.js → index-DJ-fS83G.js} +1 -1
  174. package/dist/client/assets/{index-DGzcH4Vq.js → index-DRuy-mDa.js} +1 -1
  175. package/dist/client/assets/{index-C1HmbFkP.js → index-DdK1k8EY.js} +1 -1
  176. package/dist/client/assets/{index-DNY1LCEV.js → index-DoEtSiIe.js} +3 -3
  177. package/dist/client/assets/{index-BpSAkv2Q.js → index-FcoC7l5_.js} +1 -1
  178. package/dist/client/assets/{index-redirect-D7g6EvmF.js → index-redirect-CbsKaCLd.js} +1 -1
  179. package/dist/client/assets/{index-Ctcj_Ic4.js → index-w1wolPTy.js} +1 -1
  180. package/dist/client/assets/{infiniteQueryObserver-C58dnOYG.js → infiniteQueryObserver-BRGiYBJv.js} +1 -1
  181. package/dist/client/assets/{infra-billing-PmBjX27u.js → infra-billing-mbjUHJA6.js} +1 -1
  182. package/dist/client/assets/{input-DW2VJfvP.js → input-C6McKl01.js} +3 -3
  183. package/dist/client/assets/{input-Biz1-kQq.js → input-DIuJhVNp.js} +1 -1
  184. package/dist/client/assets/{integration-icon-B7GQGDoQ.js → integration-icon-DvT6X8cI.js} +1 -1
  185. package/dist/client/assets/{item-actions-CigQSqIo.js → item-actions-BSnXs1TT.js} +1 -1
  186. package/dist/client/assets/{jira-icon-CNLkC5R4.js → jira-icon-pZDG9IEF.js} +1 -1
  187. package/dist/client/assets/{label-BleuytxV.js → label-G4Rj_cXa.js} +1 -1
  188. package/dist/client/assets/{layout-BCbrxcxs.js → layout-CTvR7VG1.js} +1 -1
  189. package/dist/client/assets/{legacy-admin-welcome-dialog-B_mFKFt0.js → legacy-admin-welcome-dialog-BYL3pyxT.js} +1 -1
  190. package/dist/client/assets/{legacy-agents-deep-suvWZq4w.js → legacy-agents-deep-Df5JF_SK.js} +1 -1
  191. package/dist/client/assets/{legacy-main-redirect-CqfpK3yi.js → legacy-main-redirect-oBYkuRmD.js} +1 -1
  192. package/dist/client/assets/library-mSFHNE8F.js +1 -0
  193. package/dist/client/assets/{library-tab-B6-1oo-4.js → library-tab-DJQybwNu.js} +1 -1
  194. package/dist/client/assets/{login-CIC76liy.js → login-DdaMpBPE.js} +1 -1
  195. package/dist/client/assets/{markdown-D7s3zZ1r.js → markdown-DeZATUv_.js} +1 -1
  196. package/dist/client/assets/{mcp-app-renderer-xoRmsbxJ.js → mcp-app-renderer-pvE5c1WF.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-Bm9eowFy.js → mcp-oauth-BkAlBGe_.js} +1 -1
  198. package/dist/client/assets/{mcp-oauth-DdZ5iqUI.js → mcp-oauth-C4zfq49i.js} +1 -1
  199. package/dist/client/assets/{members-BVDYMl5s.js → members-Dhg3sD3K.js} +1 -1
  200. package/dist/client/assets/{memory-OIMax3Mf.js → memory-ls8FI-ER.js} +1 -1
  201. package/dist/client/assets/{mock-board-DcJ7MEwz.js → mock-board-UBlWXoTV.js} +3 -3
  202. package/dist/client/assets/{monaco-editor-wJhgDEpd.js → monaco-editor-BwfJ8i7M.js} +1 -1
  203. package/dist/client/assets/{monitoring-Dhz_4NNt.js → monitoring-CQc-Jc5R.js} +1 -1
  204. package/dist/client/assets/{monitoring-stats-row-BGw1gEqW.js → monitoring-stats-row-CBrA5DNm.js} +1 -1
  205. package/dist/client/assets/{multi-select-j_cBBkSq.js → multi-select-D3r33Eqf.js} +1 -1
  206. package/dist/client/assets/{mustache-ByNI-hYL.js → mustache-DKc6J7pv.js} +1 -1
  207. package/dist/client/assets/{named-rule-step-CIgwVXN9.js → named-rule-step-BAentWbs.js} +1 -1
  208. package/dist/client/assets/{named-rule-view-QjZFYuFQ.js → named-rule-view-B12Mihtd.js} +1 -1
  209. package/dist/client/assets/{new-project-dialog-B8SVDcTm.js → new-project-dialog-CT39WKMt.js} +1 -1
  210. package/dist/client/assets/{new-project-store-rLMUNU2t.js → new-project-store-DYc4RZIM.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-BCJ9lzNV.js → oauth-callback-ByK2SiJO.js} +1 -1
  212. package/dist/client/assets/{oauth-callback-ai-provider-DUTt9OdA.js → oauth-callback-ai-provider-Beze5ATE.js} +1 -1
  213. package/dist/client/assets/{oauth-consent-aERAtVyD.js → oauth-consent-C7XByUpM.js} +1 -1
  214. package/dist/client/assets/{onboarding-BEeDAE1n.js → onboarding-DxARgVon.js} +1 -1
  215. package/dist/client/assets/{openai-conversation-CalrcjOi.js → openai-conversation-BZPG3E07.js} +1 -1
  216. package/dist/client/assets/{optimistic-project-sidebar-views-gHKEu9Pp.js → optimistic-project-sidebar-views-DtHZp47L.js} +1 -1
  217. package/dist/client/assets/{order-monitor-day-BMsq7ZVq.js → order-monitor-day-BjMh6dP-.js} +1 -1
  218. package/dist/client/assets/{organization-choice-Dumfb2MT.js → organization-choice-B7oZjoV-.js} +1 -1
  219. package/dist/client/assets/{orgs-BaQBoOtD.js → orgs-Dnp8mGIE.js} +1 -1
  220. package/dist/client/assets/{own-accounts-section-CYaA86cP.js → own-accounts-section-Ox_H5E7F.js} +1 -1
  221. package/dist/client/assets/{pair-Bb6oWjIQ.js → pair-C9Fumckp.js} +1 -1
  222. package/dist/client/assets/{parse-sections-Dru7Bhw3.js → parse-sections-Bbp8QY_-.js} +2 -2
  223. package/dist/client/assets/plan-Bkifmwdt.js +1 -0
  224. package/dist/client/assets/{plan-ladder-DCMpCI9t.js → plan-ladder-DNa_CJD5.js} +1 -1
  225. package/dist/client/assets/{plan-page-DhlVp1jr.js → plan-page-DA2CBoO7.js} +1 -1
  226. package/dist/client/assets/{plan-usage-card-b1xfvJA5.js → plan-usage-card-DnVnSftp.js} +1 -1
  227. package/dist/client/assets/{popover-O0--zxB3.js → popover-mrQ4T9ru.js} +1 -1
  228. package/dist/client/assets/{post-calendar-TZVPBEms.js → post-calendar-D-RLnzxz.js} +1 -1
  229. package/dist/client/assets/{post-editor-CjdfbpGv.js → post-editor-BpIis1xH.js} +1 -1
  230. package/dist/client/assets/{preview-content-Cb6-Hnk_.js → preview-content-DTs-hWSP.js} +1 -1
  231. package/dist/client/assets/{preview-dialog-CeEvmRUv.js → preview-dialog-CGhTVXYZ.js} +1 -1
  232. package/dist/client/assets/{preview-panel-DLXxpwqH.js → preview-panel-CS2evrdt.js} +1 -1
  233. package/dist/client/assets/{preview-tab-h0moNltj.js → preview-tab-C8EYcsK2.js} +3 -3
  234. package/dist/client/assets/{primitives-B_wOu0KD.js → primitives-DCeh9ZFM.js} +1 -1
  235. package/dist/client/assets/{product-picker-dialog-BBGqgaUN.js → product-picker-dialog-BuD1Uiqo.js} +1 -1
  236. package/dist/client/assets/{profile-DXP_cVu3.js → profile-Drm_c_7P.js} +1 -1
  237. package/dist/client/assets/{project-app-view-Df72eQDp.js → project-app-view-BK0cCPsD.js} +1 -1
  238. package/dist/client/assets/{project-apps-D0yVssTS.js → project-apps-CSkPT54a.js} +1 -1
  239. package/dist/client/assets/{project-icon-Bys_QVfz.js → project-icon-BxqBM24K.js} +1 -1
  240. package/dist/client/assets/{project-index-D8QhEEmc.js → project-index-BcbyhrUz.js} +1 -1
  241. package/dist/client/assets/project-reports-C1LMMcEB.js +1 -0
  242. package/dist/client/assets/project-tasks-CYJZp2Uh.js +1 -0
  243. package/dist/client/assets/{projects-DLDVeooh.js → projects-Bt0tB7bD.js} +1 -1
  244. package/dist/client/assets/{projects-empty-state-BYfzt1p6.js → projects-empty-state-CUxxduZa.js} +1 -1
  245. package/dist/client/assets/{prompts-RK2BST5w.js → prompts-Cypbuo50.js} +1 -1
  246. package/dist/client/assets/record-editor-BsKWufWE.js +1 -0
  247. package/dist/client/assets/{redirect-editor-CvpFIhP3.js → redirect-editor-C4dWTnRQ.js} +1 -1
  248. package/dist/client/assets/{reports-DiiYMFp7.js → reports-BJDaNojR.js} +1 -1
  249. package/dist/client/assets/reports-oGZqT3QW.js +1 -0
  250. package/dist/client/assets/{reports-onboarding-CoRYS8wo.js → reports-onboarding-CH17bHGS.js} +1 -1
  251. package/dist/client/assets/{reports-tab-BoI6tcUT.js → reports-tab-muq1g1pm.js} +2 -2
  252. package/dist/client/assets/{repositories-dckrDwEU.js → repositories-Bf8CqdKD.js} +1 -1
  253. package/dist/client/assets/repositories-JzZI0XMl.js +1 -0
  254. package/dist/client/assets/{repository-binding-0rqv5CYu.js → repository-binding-BAQCDq-W.js} +1 -1
  255. package/dist/client/assets/{repository-picker-8sFtA2jE.js → repository-picker-BBkgoOlP.js} +1 -1
  256. package/dist/client/assets/{require-capability-GB4QCUSY.js → require-capability-FcSdruCZ.js} +1 -1
  257. package/dist/client/assets/{required-auth-layout-9Vw9oHyS.js → required-auth-layout-DPL2sBE1.js} +1 -1
  258. package/dist/client/assets/{reset-password-Bkf_fwQB.js → reset-password-D15aZJot.js} +1 -1
  259. package/dist/client/assets/{resizable-BycP7e00.js → resizable-DwqWjQSo.js} +1 -1
  260. package/dist/client/assets/{resolve-tab-icon-B49st38Z.js → resolve-tab-icon-De0SSCOI.js} +1 -1
  261. package/dist/client/assets/{review-settings-AaM16RjA.js → review-settings-X9fyjheP.js} +1 -1
  262. package/dist/client/assets/{role-color-CilFDy12.js → role-color-BX_AhYik.js} +1 -1
  263. package/dist/client/assets/{roles-BN919U7y.js → roles-B-siyM42.js} +1 -1
  264. package/dist/client/assets/{route-CH_5nuP_.js → route-CNMBOzJN.js} +1 -1
  265. package/dist/client/assets/route-CalpiHU1.js +1 -0
  266. package/dist/client/assets/{route-BcZK3YCw.js → route-Cz_N3YLd.js} +1 -1
  267. package/dist/client/assets/{route-page-header-DpWJFSUF.js → route-page-header-nTLU5ayk.js} +1 -1
  268. package/dist/client/assets/{sandbox-git-api-CG9RWp1R.js → sandbox-git-api-DiUyKbJU.js} +1 -1
  269. package/dist/client/assets/{sandbox-lifecycle-context-B2ggxGXu.js → sandbox-lifecycle-context-CRyp43o1.js} +1 -1
  270. package/dist/client/assets/{save-status-BQkBpUbv.js → save-status-CQe-z40L.js} +1 -1
  271. package/dist/client/assets/{schema-JoNeetSU.js → schema-C5ZQLddp.js} +1 -1
  272. package/dist/client/assets/{schema-UfVOE_vK.js → schema-CG6ylG0z.js} +1 -1
  273. package/dist/client/assets/{scroll-area-vXLoyQQw.js → scroll-area-KLotig-P.js} +1 -1
  274. package/dist/client/assets/{search-input-CazoQHCn.js → search-input-wk0beNbE.js} +1 -1
  275. package/dist/client/assets/{search-toggle-om107pCr.js → search-toggle-CMYcoB9P.js} +1 -1
  276. package/dist/client/assets/{secret-picker-BUV633yj.js → secret-picker-j7H2EK7l.js} +1 -1
  277. package/dist/client/assets/{secrets-DGpgtf7U.js → secrets-B9rKvRSV.js} +1 -1
  278. package/dist/client/assets/{section-array-field-B5wOOl5Q.js → section-array-field-yz7QHNSD.js} +1 -1
  279. package/dist/client/assets/{sections-BuMIRgN_.js → sections-44_mUmcy.js} +1 -1
  280. package/dist/client/assets/{sections-editor-JNsgN9Jp.js → sections-editor-vs42n8iz.js} +1 -1
  281. package/dist/client/assets/{select-BtuZ1_PE.js → select-OlcoUSVg.js} +1 -1
  282. package/dist/client/assets/{select-model-D2eRzxwR.js → select-model-D0BbDHat.js} +1 -1
  283. package/dist/client/assets/{seo-editor-CnvOLI1T.js → seo-editor-D1i_wsxL.js} +1 -1
  284. package/dist/client/assets/{separator-CDpQOaDp.js → separator-CunLPufQ.js} +1 -1
  285. package/dist/client/assets/{session-runtime-C9K2fhXt.js → session-runtime-CZKHty5X.js} +1 -1
  286. package/dist/client/assets/settings-tab-VZsLRrpt.js +1 -0
  287. package/dist/client/assets/{sheet-BclrNEHN.js → sheet-De8qzGNI.js} +1 -1
  288. package/dist/client/assets/{shell-layout-B0CrobX4.js → shell-layout-596_q4a1.js} +1 -1
  289. package/dist/client/assets/{site-draft-actions-CKyxePcd.js → site-draft-actions-DXu7he69.js} +1 -1
  290. package/dist/client/assets/{site-draft-view-DITfvlDo.js → site-draft-view-UnsYH70N.js} +1 -1
  291. package/dist/client/assets/site-editor-2NiQbUmg.js +1 -0
  292. package/dist/client/assets/{site-editor-toast-ByfMLHrL.js → site-editor-toast-B-FDGvtN.js} +1 -1
  293. package/dist/client/assets/{skills-UpHMjGzP.js → skills-BjbKR2I7.js} +1 -1
  294. package/dist/client/assets/{slider-BccigXwM.js → slider-c-3WdQpH.js} +1 -1
  295. package/dist/client/assets/{sortable.esm-LMzGz7vy.js → sortable.esm-B0hCRAsX.js} +1 -1
  296. package/dist/client/assets/{sso-BOXfHaVK.js → sso-D4qQzdCn.js} +1 -1
  297. package/dist/client/assets/{suggestion-6kwzt7Yb.js → suggestion-CIik1sqO.js} +1 -1
  298. package/dist/client/assets/{super-agent-icon-z6Ee2KPL.js → super-agent-icon-BQUmZAhN.js} +1 -1
  299. package/dist/client/assets/{switch-DVmURNlF.js → switch-C5tCt-1T.js} +1 -1
  300. package/dist/client/assets/{synced-repos-J7N806y3.js → synced-repos-CBI3cJpx.js} +1 -1
  301. package/dist/client/assets/{tab-icon-glyph-D6HWUMfv.js → tab-icon-glyph-DrXbuC1r.js} +1 -1
  302. package/dist/client/assets/{table-Dfn_tXRY.js → table-RDPVkrI6.js} +1 -1
  303. package/dist/client/assets/{tabs-DzZuOsBG.js → tabs-Bh3jtZIY.js} +1 -1
  304. package/dist/client/assets/{task-board-B6w6sUwb.js → task-board-BRF3ZwKz.js} +1 -1
  305. package/dist/client/assets/{task-key-DwKgVgaG.js → task-key-CajjdR3t.js} +1 -1
  306. package/dist/client/assets/{task-route-DILYUxw7.js → task-route-DltlnXMA.js} +1 -1
  307. package/dist/client/assets/{task-status-CWjPA6gQ.js → task-status-CS7Ps1ks.js} +1 -1
  308. package/dist/client/assets/{taskboard-analytics-D8X9MO7l.js → taskboard-analytics-BM7xNDXS.js} +1 -1
  309. package/dist/client/assets/tasks-BVcnl5hV.js +1 -0
  310. package/dist/client/assets/{tasks-BWMxQc4P.js → tasks-BeWBUFN3.js} +1 -1
  311. package/dist/client/assets/{textarea-BS-fwvE3.js → textarea-CP9TQ5HN.js} +1 -1
  312. package/dist/client/assets/{thread-analytics-BEFAIWhI.js → thread-analytics-CyVeHqD_.js} +1 -1
  313. package/dist/client/assets/{thread-button-CCXdzpOs.js → thread-button-B51gC6ln.js} +1 -1
  314. package/dist/client/assets/{thread-intent-Dmqjim4G.js → thread-intent-R2KI8ie_.js} +1 -1
  315. package/dist/client/assets/{thread-route-DFPY6b9-.js → thread-route-B5gjf6Cd.js} +1 -1
  316. package/dist/client/assets/{thread-route-BMQ7FfFy.js → thread-route-D-UE3Db_.js} +1 -1
  317. package/dist/client/assets/{thread-sheet-body-D_58wlnB.js → thread-sheet-body-B9XdKhNS.js} +1 -1
  318. package/dist/client/assets/{time-range-picker-DVPzF6pR.js → time-range-picker-5TsTBsYK.js} +1 -1
  319. package/dist/client/assets/{toggle-group-BSOB6hW8.js → toggle-group-CtXgLS7e.js} +1 -1
  320. package/dist/client/assets/{tool-set-selector-D9iHbEUH.js → tool-set-selector-WN2Xo0Mj.js} +1 -1
  321. package/dist/client/assets/{toolbar-icon-button-B2FJhjHB.js → toolbar-icon-button-Ce7Zk4Z1.js} +1 -1
  322. package/dist/client/assets/{tooltip-DEqrMv7W.js → tooltip-DhlWzeQv.js} +1 -1
  323. package/dist/client/assets/{tooltipContext-BbljAPKp.js → tooltipContext-BkLzQGib.js} +1 -1
  324. package/dist/client/assets/{track-Bp6zOhD6.js → track-xlpKzX88.js} +1 -1
  325. package/dist/client/assets/{types-mnHt7RAy.js → types-rurFGFZy.js} +1 -1
  326. package/dist/client/assets/{url-slug-BNPYObW-.js → url-slug-CiUrNKts.js} +1 -1
  327. package/dist/client/assets/{usage-stats-PE4G0CeB.js → usage-stats-CLeyhHyT.js} +1 -1
  328. package/dist/client/assets/{use-ai-providers-DuE4C2Wp.js → use-ai-providers-BwkzkRi2.js} +1 -1
  329. package/dist/client/assets/{use-api-keys-C3mHEKzm.js → use-api-keys-B_vZqtxC.js} +1 -1
  330. package/dist/client/assets/{use-apply-named-rule-C6ts9bt2.js → use-apply-named-rule-CaZ5oLnq.js} +1 -1
  331. package/dist/client/assets/use-ask-in-chat-CuhqUmC7.js +1 -0
  332. package/dist/client/assets/{use-automations-LOYHDjb3.js → use-automations-CLa8yUdj.js} +1 -1
  333. package/dist/client/assets/{use-autosave-CLPruo2u.js → use-autosave-CwP_nadT.js} +1 -1
  334. package/dist/client/assets/use-blocks-v8-project-BLAijVCk.js +1 -0
  335. package/dist/client/assets/use-blog-view-DJnS2ipo.js +1 -0
  336. package/dist/client/assets/{use-chat-layout-state-Dx_P1Xmx.js → use-chat-layout-state-x3sd6PWp.js} +1 -1
  337. package/dist/client/assets/{use-cms-publish-actions-_ZdSdw_1.js → use-cms-publish-actions-Bn8BUqaj.js} +1 -1
  338. package/dist/client/assets/{use-connect-companion-DQq6EgX3.js → use-connect-companion-CkgH2aNV.js} +1 -1
  339. package/dist/client/assets/{use-connection-DW1VkUDp.js → use-connection-BO-ZUzee.js} +1 -1
  340. package/dist/client/assets/{use-content-sync-DadcVTeN.js → use-content-sync-By62We3p.js} +1 -1
  341. package/dist/client/assets/{use-copy-D1Ps751Y.js → use-copy-CjEnyhFT.js} +1 -1
  342. package/dist/client/assets/{use-current-view-DTeimNo3.js → use-current-view-C2fbVQ-O.js} +1 -1
  343. package/dist/client/assets/{use-date-fns-locale-D0UHCWV7.js → use-date-fns-locale-DQRGqxvr.js} +1 -1
  344. package/dist/client/assets/{use-debounced-autosave-DYsdj7A1.js → use-debounced-autosave-DN03qSfm.js} +1 -1
  345. package/dist/client/assets/{use-debounced-value-Cj3YP2Ju.js → use-debounced-value-DqHSmPMR.js} +1 -1
  346. package/dist/client/assets/{use-deco-credits-1ccyr4DS.js → use-deco-credits-5H0OzCE5.js} +1 -1
  347. package/dist/client/assets/{use-decopilot-events-qTcqpluN.js → use-decopilot-events-DwNDOIa1.js} +1 -1
  348. package/dist/client/assets/{use-delete-block-DeCae--m.js → use-delete-block-nP_FtjiY.js} +1 -1
  349. package/dist/client/assets/{use-delete-connection-Ddr1KxTc.js → use-delete-connection-BBTdkJYy.js} +1 -1
  350. package/dist/client/assets/{use-deployment-admin-CmLloBgI.js → use-deployment-admin-Bh76rlF7.js} +1 -1
  351. package/dist/client/assets/{use-entitlements-BaQvjR8x.js → use-entitlements-4v7LU4jM.js} +1 -1
  352. package/dist/client/assets/{use-fast-preview-draft-url-Bx6WUO99.js → use-fast-preview-draft-url-DQSkfUDT.js} +1 -1
  353. package/dist/client/assets/{use-file-configs-J6V_3k5a.js → use-file-configs-J6lDtEfO.js} +1 -1
  354. package/dist/client/assets/{use-id-selection-DKtNLyFh.js → use-id-selection-2psZYBx1.js} +1 -1
  355. package/dist/client/assets/{use-in-settings-WKil-W1U.js → use-in-settings-LMUeu63D.js} +1 -1
  356. package/dist/client/assets/{use-inbox-feed-BHASI7cE.js → use-inbox-feed-_58TtHpK.js} +1 -1
  357. package/dist/client/assets/{use-infinite-scroll-BCAJFUTI.js → use-infinite-scroll-uxxC9xbL.js} +1 -1
  358. package/dist/client/assets/{use-join-requests-BVkKaLgc.js → use-join-requests-Dlx4kfO9.js} +1 -1
  359. package/dist/client/assets/{use-main-panel-tabs-BmS9u6Cm.js → use-main-panel-tabs-D5zQhSWJ.js} +1 -1
  360. package/dist/client/assets/{use-mcp-auth-status-WaulxB9m.js → use-mcp-auth-status-FhB3trZz.js} +1 -1
  361. package/dist/client/assets/{use-mcp-client-XSpKurXu.js → use-mcp-client-86j-Nolb.js} +1 -1
  362. package/dist/client/assets/{use-mcp-prompts-Bs2ZYPMm.js → use-mcp-prompts-CPXLXWTp.js} +1 -1
  363. package/dist/client/assets/{use-mcp-tools-C_TsO2I8.js → use-mcp-tools-BeJ4_Tij.js} +1 -1
  364. package/dist/client/assets/{use-mobile-BxcOWRrF.js → use-mobile-BjsAkqwr.js} +1 -1
  365. package/dist/client/assets/{use-move-blocks-B_TQedwE.js → use-move-blocks-CCDsEu9Z.js} +1 -1
  366. package/dist/client/assets/{use-navigate-to-agent-D9QHHZbU.js → use-navigate-to-agent-C-BC28kE.js} +1 -1
  367. package/dist/client/assets/{use-never-published-CchQezqP.js → use-never-published-C4cAqdmZ.js} +1 -1
  368. package/dist/client/assets/{use-org-fs-B4WWFHbJ.js → use-org-fs-C62_MbqW.js} +1 -1
  369. package/dist/client/assets/{use-org-notice-CuExaYhO.js → use-org-notice-BzvGZbQ2.js} +1 -1
  370. package/dist/client/assets/{use-org-repo-syncs-KiPPmYc8.js → use-org-repo-syncs-SmfSLgc1.js} +1 -1
  371. package/dist/client/assets/{use-org-sso-BU8x_N9w.js → use-org-sso-CypQjzG8.js} +1 -1
  372. package/dist/client/assets/{use-organization-settings-BCnB7DAB.js → use-organization-settings-CgKOO7Ms.js} +1 -1
  373. package/dist/client/assets/{use-panel-navigate-CRTRFR_W.js → use-panel-navigate-DHff9CS9.js} +1 -1
  374. package/dist/client/assets/{use-project-native-view-presence-DNQAebLP.js → use-project-native-view-presence-Dug5CWyl.js} +1 -1
  375. package/dist/client/assets/{use-project-scope-AQre_lGB.js → use-project-scope-AMUoXt2c.js} +1 -1
  376. package/dist/client/assets/{use-recent-apps-TNv8uCPr.js → use-recent-apps-qXhoWNgp.js} +1 -1
  377. package/dist/client/assets/{use-reports-diagnostic-BblOLKh2.js → use-reports-diagnostic-CiiYsnje.js} +1 -1
  378. package/dist/client/assets/{use-sandbox-events-CDzu8MpI.js → use-sandbox-events-A8aB0HnP.js} +1 -1
  379. package/dist/client/assets/{use-secrets-BS48xwT8.js → use-secrets-DumIaW5z.js} +1 -1
  380. package/dist/client/assets/{use-section-preview-base-DKzaRrN2.js → use-section-preview-base-BcIQh9cw.js} +1 -1
  381. package/dist/client/assets/{use-sidebar-collapsed-DhXPD56p.js → use-sidebar-collapsed-iTcR18ZK.js} +1 -1
  382. package/dist/client/assets/{use-tags-DZB3cOG6.js → use-tags-Bm6VkRP9.js} +1 -1
  383. package/dist/client/assets/{use-task-board-analytics-BJUgitsX.js → use-task-board-analytics-CcKWYx4U.js} +1 -1
  384. package/dist/client/assets/{use-task-board-item-prs-BRhTw2_C.js → use-task-board-item-prs-Db89Oevz.js} +1 -1
  385. package/dist/client/assets/{use-task-board-items-ClS47WXt.js → use-task-board-items-BVQx7Wft.js} +1 -1
  386. package/dist/client/assets/{use-task-board-prompts-CLIPLPO_.js → use-task-board-prompts-C468T8Y7.js} +1 -1
  387. package/dist/client/assets/{use-task-metadata-D_A2WmqA.js → use-task-metadata-FjAJnVQn.js} +1 -1
  388. package/dist/client/assets/{use-thread-outputs-DqTcUmJ7.js → use-thread-outputs-BnMyEJ2l.js} +1 -1
  389. package/dist/client/assets/{use-view-draft-kind-BtTSFIlo.js → use-view-draft-kind-hbAZo1QG.js} +1 -1
  390. package/dist/client/assets/{use-voice-input-BXFfCREB.js → use-voice-input-DJjQBO4e.js} +1 -1
  391. package/dist/client/assets/useInfiniteQuery-9vIAXgqG.js +1 -0
  392. package/dist/client/assets/{useQueries-CY78CcHi.js → useQueries-CuzZgNOl.js} +1 -1
  393. package/dist/client/assets/useSuspenseInfiniteQuery-CucINu-S.js +1 -0
  394. package/dist/client/assets/{users-B7RH0HPb.js → users-QlOHt7jV.js} +1 -1
  395. package/dist/client/assets/{utils-CeyBwb4E.js → utils-CzRFs-0R.js} +1 -1
  396. package/dist/client/assets/{variant-calendar-CbNvuhgP.js → variant-calendar-DaLwTMzO.js} +1 -1
  397. package/dist/client/assets/{variant-matcher-override-WW9vsYwt.js → variant-matcher-override-BBj0ymp1.js} +1 -1
  398. package/dist/client/assets/{view-header-D-W3mMsY.js → view-header-CRFbPvFT.js} +1 -1
  399. package/dist/client/assets/{virtual-mcp-DFMEmmYR.js → virtual-mcp-K5tXQmiD.js} +1 -1
  400. package/dist/client/assets/{watch-sse-pool-CLN8yu6T.js → watch-sse-pool-C0me6Edt.js} +1 -1
  401. package/dist/client/index.html +1 -1
  402. package/dist/server/server.js +44 -44
  403. package/package.json +1 -1
  404. package/dist/client/assets/agent-app-BVo-JN5-.js +0 -1
  405. package/dist/client/assets/agent-deck-BV2v1bg2.js +0 -1
  406. package/dist/client/assets/agent-experiments-Dn6ATqm3.js +0 -1
  407. package/dist/client/assets/agent-file-BdlM9DC-.js +0 -1
  408. package/dist/client/assets/agent-library-CRndyLSN.js +0 -1
  409. package/dist/client/assets/agent-library-file-CHMBjLP9.js +0 -1
  410. package/dist/client/assets/agent-overview-0qKuyyc3.js +0 -1
  411. package/dist/client/assets/agent-settings-BhODPzv3.js +0 -1
  412. package/dist/client/assets/agent-site-editor-code-Cf9FJAgn.js +0 -2
  413. package/dist/client/assets/agent-site-editor-content-CBrR-oWD.js +0 -1
  414. package/dist/client/assets/agent-site-editor-preview-DKqXk_Fc.js +0 -1
  415. package/dist/client/assets/agent-view-B6-XGf3q.js +0 -1
  416. package/dist/client/assets/api-keys-BWBRmUoJ.js +0 -1
  417. package/dist/client/assets/library-Dp3HrH7T.js +0 -1
  418. package/dist/client/assets/plan-CEsNJEgV.js +0 -1
  419. package/dist/client/assets/project-reports-DF_CqS1r.js +0 -1
  420. package/dist/client/assets/project-tasks-BiRpzten.js +0 -1
  421. package/dist/client/assets/record-editor-D7wKjKze.js +0 -1
  422. package/dist/client/assets/reports-CAZ7fJej.js +0 -1
  423. package/dist/client/assets/repositories-DhWmEVga.js +0 -1
  424. package/dist/client/assets/route-ZfCX71Dd.js +0 -1
  425. package/dist/client/assets/settings-tab-DXCgvlZo.js +0 -1
  426. package/dist/client/assets/site-editor-CRBSEbgW.js +0 -1
  427. package/dist/client/assets/tasks-B5T10R9U.js +0 -1
  428. package/dist/client/assets/use-ask-in-chat-ClsOxWIw.js +0 -1
  429. package/dist/client/assets/use-blocks-v8-project-GPjsiHKH.js +0 -1
  430. package/dist/client/assets/use-blog-view-BjBkHa1n.js +0 -1
  431. package/dist/client/assets/useInfiniteQuery-jSvPkUAC.js +0 -1
  432. package/dist/client/assets/useSuspenseInfiniteQuery-DQoY99kG.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-JNsgN9Jp.js","assets/index-DNY1LCEV.js","assets/index-DOMlzk_A.css","assets/chat-context-DHSww0cO.js","assets/use-panel-navigate-CRTRFR_W.js","assets/thread-route-BMQ7FfFy.js","assets/use-project-scope-AQre_lGB.js","assets/repository-binding-0rqv5CYu.js","assets/use-mcp-client-XSpKurXu.js","assets/auth-BbyP7Mh4.js","assets/use-view-draft-kind-BtTSFIlo.js","assets/use-blog-view-BjBkHa1n.js","assets/use-organization-settings-BCnB7DAB.js","assets/schema-UfVOE_vK.js","assets/task-board-B6w6sUwb.js","assets/thread-intent-Dmqjim4G.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CLN8yu6T.js","assets/session-runtime-C9K2fhXt.js","assets/use-entitlements-BaQvjR8x.js","assets/use-ai-providers-DuE4C2Wp.js","assets/use-current-view-DTeimNo3.js","assets/use-in-settings-WKil-W1U.js","assets/use-decopilot-events-qTcqpluN.js","assets/use-org-fs-B4WWFHbJ.js","assets/useInfiniteQuery-jSvPkUAC.js","assets/infiniteQueryObserver-C58dnOYG.js","assets/save-status-BQkBpUbv.js","assets/Image01-BGZNkNVE.js","assets/Trash01-DUjxO1Dn.js","assets/Upload01-BcZgaIHQ.js","assets/use-never-published-CchQezqP.js","assets/use-voice-input-BXFfCREB.js","assets/popover-O0--zxB3.js","assets/drawer-BdL5OKVC.js","assets/tooltip-DEqrMv7W.js","assets/index-D4Cq4uu-.js","assets/use-mobile-BxcOWRrF.js","assets/agent-icon-zKGrqypc.js","assets/AlertCircle-BYyFOifG.js","assets/UserCheck01-CHkzczFI.js","assets/Tool01-JC0jUvnM.js","assets/ArrowUp-BbdlU24N.js","assets/ArrowLeft-BQKI9I0k.js","assets/ArrowRight-B21E_uc5.js","assets/BookOpen01-BUy5CVjC.js","assets/Globe04--1ycu_yQ.js","assets/CheckCircle-DtUq_uxu.js","assets/ChevronDown-C0rME5fU.js","assets/ChevronSelectorVertical-BCjXLDN_.js","assets/ChevronUp-CIqW-9_W.js","assets/UserSquare-D6ubIo4l.js","assets/LinkBroken01-w2HNuUHo.js","assets/CreditCard01-BGMvQi86.js","assets/File02-Nky5bxni.js","assets/MessageCircle01-BUz5eIR5.js","assets/SwitchHorizontal01-BZWsjo2g.js","assets/Eye-DvysNEeS.js","assets/Fingerprint04-DNoiAgrN.js","assets/Key01-B7vuN73N.js","assets/LayoutLeft-DTjvUEMi.js","assets/Minus-DhX2EjkJ.js","assets/Monitor01-Dv4dKtFe.js","assets/Sun-bgIMzv-s.js","assets/Play-BcRuLGoC.js","assets/Plus-Bd_Azs6t.js","assets/SearchMd-DoUjFKDV.js","assets/ShoppingBag01-DsiPVRC3.js","assets/Users01-DOgFV3e5.js","assets/XClose-CHJIrn3i.js","assets/Zap-6gSNYeqn.js","assets/index-cHqyigDN.js","assets/checkbox-BK5KAA6g.js","assets/select-BtuZ1_PE.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/site-editor-toast-ByfMLHrL.js","assets/content-changes-Sy14c4Sj.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-CDzu8MpI.js","assets/use-blocks-v8-project-GPjsiHKH.js","assets/utils-CeyBwb4E.js","assets/sandbox-git-api-CG9RWp1R.js","assets/hosted-reconcile-zJ_hLbuq.js","assets/blocks-tab-states-CtDx-TXT.js","assets/empty-state-CCe_gxuj.js","assets/search-input-CazoQHCn.js","assets/tabs-DzZuOsBG.js","assets/active-indicator-CCMhAsc_.js","assets/use-debounced-value-Cj3YP2Ju.js","assets/use-file-configs-J6V_3k5a.js","assets/asset-utils-C40NGt6S.js","assets/usage-stats-PE4G0CeB.js","assets/utils-CVEq3hMx.js","assets/markdown-D7s3zZ1r.js","assets/use-copy-D1Ps751Y.js","assets/gateway-client-BXoRIC2f.js","assets/form-DINHcU5h.js","assets/label-BleuytxV.js","assets/switch-DVmURNlF.js","assets/toggle-group-BSOB6hW8.js","assets/match-site-slug-config-B47_xZCi.js","assets/parse-sections-Dru7Bhw3.js","assets/held-block-view-BplchR69.js","assets/calendar-BDRihgLI.js","assets/textarea-BS-fwvE3.js","assets/editor-classes-1dg1pjaK.js","assets/task-key-DwKgVgaG.js","assets/sortable.esm-LMzGz7vy.js","assets/category-tree-9o5eAqGF.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-Bb6oWjIQ.js","assets/collapsible-Ff_HBxQZ.js","assets/use-task-board-items-ClS47WXt.js","assets/config-CTUwx0E7.js","assets/task-route-DILYUxw7.js","assets/project-index-D8QhEEmc.js","assets/shell-layout-B0CrobX4.js","assets/use-deployment-admin-CmLloBgI.js","assets/admin-fetch-BhTJlAsX.js","assets/use-org-notice-CuExaYhO.js","assets/command-C04_rx60.js","assets/index-DGzcH4Vq.js","assets/integration-icon-B7GQGDoQ.js","assets/project-icon-Bys_QVfz.js","assets/use-navigate-to-agent-D9QHHZbU.js","assets/new-project-dialog-B8SVDcTm.js","assets/repository-picker-8sFtA2jE.js","assets/github-icon-DeI0LVM6.js","assets/collection-search-C3yL3Si4.js","assets/new-project-store-rLMUNU2t.js","assets/legacy-admin-welcome-dialog-B_mFKFt0.js","assets/required-auth-layout-9Vw9oHyS.js","assets/use-org-sso-BU8x_N9w.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-xoRmsbxJ.js","assets/types-mnHt7RAy.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-BclrNEHN.js","assets/use-connection-DW1VkUDp.js","assets/use-mcp-prompts-Bs2ZYPMm.js","assets/use-thread-outputs-DqTcUmJ7.js","assets/file-type-icon-BINq6pAJ.js","assets/section-array-field-B5wOOl5Q.js","assets/named-rule-step-CIgwVXN9.js","assets/slider-BccigXwM.js","assets/index-CxRoy25G.js","assets/tooltipContext-BbljAPKp.js","assets/CategoricalChart-CclXOr_i.js","assets/index-WY5skHFQ.js","assets/combobox-DhzcDPGN.js","assets/scroll-area-vXLoyQQw.js","assets/monaco-editor-wJhgDEpd.js","assets/editor-CUzd1SE7.js","assets/use-delete-block-DeCae--m.js","assets/use-section-preview-base-DKzaRrN2.js","assets/mustache-ByNI-hYL.js","assets/seo-editor-CnvOLI1T.js","assets/use-apply-named-rule-C6ts9bt2.js","assets/use-move-blocks-B_TQedwE.js","assets/variant-matcher-override-WW9vsYwt.js"])))=>i.map(i=>d[i]);
2
- import{c as le,j as r,r as R,m as Re,b as Se,B as _e,aJ as ps,bn as gt,aK as De,bo as So,bp as Po,bq as jo,br as Eo,v as en,D as tn,K as sn,w as nn,x as rn,e as No,h as it,I as Vs,y as Co,bb as To,a6 as gs,ba as Ro,b8 as Jr,bs as vr,i as Yr,au as Ws,aw as qs,a9 as Qr,P as Gs,E as Lo,t as ms,b9 as Ao,q as Oo}from"./index-DNY1LCEV.js";import{u as an,N as _o}from"./save-status-BQkBpUbv.js";import{b as $o,c as lt,r as Xr,l as Zr,f as Fo,g as Do,w as Bo}from"./chat-context-DHSww0cO.js";import{t as Mo}from"./ChevronDown-C0rME5fU.js";import{H as zo,I as Io,C as on,J as Ko,b as Uo,K as xr,L as Ho,M as ea,N as Vo,O as ta}from"./agent-icon-zKGrqypc.js";import{s as Wo}from"./File02-Nky5bxni.js";import{b as qo,n as Go}from"./UserSquare-D6ubIo4l.js";import{s as sa}from"./Plus-Bd_Azs6t.js";import{a as na,b as ra,P as aa}from"./popover-O0--zxB3.js";import{e as We,b as qe,c as ln,f as cn,a as dn,C as un}from"./command-C04_rx60.js";import{a as Jo,c as Yo,b as Qo}from"./repository-binding-0rqv5CYu.js";import{a as bt}from"./sandbox-lifecycle-context-B2ggxGXu.js";import{a as Xo,n as Zo,u as ei,f as br,H as ti,g as $s,P as si}from"./frame-navigation-bHiDiNE9.js";import{r as ni}from"./session-runtime-C9K2fhXt.js";import{u as oa}from"./use-voice-input-BXFfCREB.js";import{l as ri,m as ai,n as oi,o as ii,q as li,t as ci,u as Ut,j as vs,v as ia,i as tt,w as di,x as fn,y as la,k as ca,z as ui,A as fi,B as da,C as pi,c as ua,b as fa,D as mi,h as Ve,E as hi,d as gi,g as vi,F as xi,G as bi,H as yr,I as yi,J as wr,K as wi,L as ki,M as kr,N as Sr,O as Pr,P as jr,Q as Er,R as Fs,S as Si,U as Pi,V as ji,W as Ei,e as Ni}from"./site-editor-toast-ByfMLHrL.js";import{u as pa}from"./use-mobile-BxcOWRrF.js";import{T as st,I as Nr}from"./toolbar-icon-button-B2FJhjHB.js";import{T as nt,a as rt,c as at}from"./tooltip-DEqrMv7W.js";import{w as os,i as Ci}from"./variant-matcher-override-WW9vsYwt.js";import{s as xt,n as pn,a as mn,f as Be,e as Ti,v as ma,u as ha,h as Ri,i as Li,B as Ai,S as Oi,C as _i,b as $i,c as Fi,d as Di,g as Bi,N as Mi,j as zi,r as Ii,k as Ki,l as Cr,p as Ui}from"./blocks-tab-states-CtDx-TXT.js";import{a as Hi}from"./use-fast-preview-draft-url-Bx6WUO99.js";import{g as Vi,c as Tr,B as Ds,P as Wi,r as qi,R as Gi,S as Ji,l as Yi,m as Qi,p as Xi}from"./parse-sections-Dru7Bhw3.js";import{g as Zi}from"./section-array-field-B5wOOl5Q.js";import{u as el}from"./shell-layout-B0CrobX4.js";import{u as hn,b as tl}from"./use-sandbox-events-CDzu8MpI.js";import{s as sl,p as nl,W as rl,n as al,S as Bs}from"./category-tree-9o5eAqGF.js";import{u as Js}from"./useQueries-CY78CcHi.js";import{i as ga}from"./ArrowRight-B21E_uc5.js";import{a as ol,c as il}from"./blog-preview-url-C8ne1zjD.js";import{u as ll,b as va}from"./use-never-published-CchQezqP.js";import{u as xa}from"./blocks-preview-workspace-context-Bmn4QW94.js";import{u as cl,H as dl}from"./held-block-view-BplchR69.js";import{MonacoCodeEditor as ba}from"./monaco-editor-wJhgDEpd.js";import{c as ya,u as wa}from"./hosted-reconcile-zJ_hLbuq.js";import{d as ka}from"./utils-CeyBwb4E.js";import{R as Rr,a as is,b as Lr}from"./resizable-BycP7e00.js";import{g as Sa}from"./use-org-notice-CuExaYhO.js";import{u as ul}from"./use-blocks-v8-project-GPjsiHKH.js";import{s as fl,L as pl,R as Pa,D as Ar,w as Ys}from"./device-hint-BT8_DhB_.js";import{s as ml}from"./UserCheck01-CHkzczFI.js";import{L as hl}from"./label-BleuytxV.js";import{T as gl,a as Or}from"./toggle-group-BSOB6hW8.js";import{i as vl,l as xl,D as bl}from"./named-rule-step-CIgwVXN9.js";import{b as yl}from"./sandbox-url-D3mC8qhT.js";import{r as wl,R as kl}from"./virtual-mcp-DFMEmmYR.js";import{d as Sl}from"./delay-CnY5UFtP.js";import{s as ja}from"./XClose-CHJIrn3i.js";import{o as Pl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as Ms,b as jl,w as El,n as _r}from"./app-preview-url-9Od4s8Sz.js";import{u as Nl}from"./use-organization-settings-BCnB7DAB.js";import{a as zs}from"./agent-capabilities-CWtYqnIq.js";import{E as Cl}from"./empty-state-CCe_gxuj.js";import{G as $r}from"./github-icon-DeI0LVM6.js";import{R as Tl}from"./new-project-dialog-B8SVDcTm.js";import{r as Rl}from"./preview-source-BsRLGWUP.js";import{A as Ll,a as Al,b as Ol}from"./alert-Bv1HVos8.js";import{u as _l}from"./use-task-metadata-D_A2WmqA.js";function $l(t){const e=le.c(10),{waiting:s}=t,n=s?"true":"false";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(zo,{className:"size-5 sm:size-6"})}),e[0]=o):o=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=c):c=e[1];let d;e[2]!==s?(d=s&&r.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]=s,e[3]=d):d=e[3];let i;e[4]!==d?(i=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[c,d]}),e[4]=d,e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Io,{className:"size-5 sm:size-6"})}),e[6]=a):a=e[6];let l;return e[7]!==n||e[8]!==i?(l=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":n,className:"flex items-center gap-2",children:[o,i,a]}),e[7]=n,e[8]=i,e[9]=l):l=e[9],l}function Fl(t){const e=le.c(22),{index:s,numbered:n,step:o,heading:c}=t,d=R.useId();let i;e[0]!==s||e[1]!==n?(i=n&&r.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:s}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==c||e[4]!==d||e[5]!==o.title?(a=r.jsx(c,{id:d,className:"text-sm font-medium text-foreground",children:o.title}),e[3]=c,e[4]=d,e[5]=o.title,e[6]=a):a=e[6];let l;e[7]!==i||e[8]!==a?(l=r.jsxs("div",{className:"flex items-center gap-3",children:[i,a]}),e[7]=i,e[8]=a,e[9]=l):l=e[9];const g=n&&"sm:pl-9";let f;e[10]!==g?(f=Re("flex min-w-0 flex-col gap-3",g),e[10]=g,e[11]=f):f=e[11];let p;e[12]!==o.body?(p=o.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:o.body}),e[12]=o.body,e[13]=p):p=e[13];let m;e[14]!==o.after||e[15]!==f||e[16]!==p?(m=r.jsxs("div",{className:f,children:[p,o.after]}),e[14]=o.after,e[15]=f,e[16]=p,e[17]=m):m=e[17];let v;return e[18]!==d||e[19]!==l||e[20]!==m?(v=r.jsxs("li",{"aria-labelledby":d,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,m]}),e[18]=d,e[19]=l,e[20]=m,e[21]=v):v=e[21],v}const Dl=[];function hs(t){const e=le.c(20),{title:s,lead:n,waiting:o,alerts:c,steps:d,footer:i,headingLevel:a}=t,l=d===void 0?Dl:d,g=a===void 0?1:a,f=g===1?"h1":"h2",p=o&&l.length===0?"status":void 0;let m;e[0]!==o?(m=r.jsx($l,{waiting:o}),e[0]=o,e[1]=m):m=e[1];let v;e[2]!==f||e[3]!==s?(v=r.jsx(f,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=f,e[3]=s,e[4]=v):v=e[4];let y;e[5]!==n?(y=n&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:n}),e[5]=n,e[6]=y):y=e[6];let h;e[7]!==p||e[8]!==m||e[9]!==v||e[10]!==y?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[m,v,y]}),e[7]=p,e[8]=m,e[9]=v,e[10]=y,e[11]=h):h=e[11];let x;e[12]!==g||e[13]!==l?(x=l.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:l.map((b,w)=>r.jsx(Fl,{index:w+1,numbered:l.length>1,step:b,heading:g===1?"h2":"h3"},b.title))}),e[12]=g,e[13]=l,e[14]=x):x=e[14];let C;return e[15]!==c||e[16]!==i||e[17]!==h||e[18]!==x?(C=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.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:[h,c,x,i]})}),e[15]=c,e[16]=i,e[17]=h,e[18]=x,e[19]=C):C=e[19],C}function Bl(t){const e=le.c(43),{wait:s,hosts:n,invalidLink:o}=t,c=o===void 0?!1:o,d=Se();let i;e[0]!==c||e[1]!==d?(i=c&&r.jsx(Ll,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(Al,{className:"line-clamp-none text-foreground",children:d("decoServe.link.invalidTitle")}),r.jsx(Ol,{children:d("decoServe.link.invalidBody")})]})}),e[0]=c,e[1]=d,e[2]=i):i=e[2];const a=i;if(s.kind==="problem"){let w;e[3]!==d||e[4]!==s.host||e[5]!==s.problem?(w=fl(d,s.problem,s.host),e[3]=d,e[4]=s.host,e[5]=s.problem,e[6]=w):w=e[6];const{title:N,body:k}=w;let S;e[7]!==k?(S=r.jsx(Pa,{text:k}),e[7]=k,e[8]=S):S=e[8];let E;e[9]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx(Ar,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=E):E=e[9];let T;return e[10]!==a||e[11]!==S||e[12]!==N?(T=r.jsx(hs,{headingLevel:2,waiting:!1,title:N,lead:S,alerts:a,footer:E}),e[10]=a,e[11]=S,e[12]=N,e[13]=T):T=e[13],T}const l=s.kind==="looking",g=l&&!s.paused;let f;e[14]!==d?(f=d("decoServe.waiting.title"),e[14]=d,e[15]=f):f=e[15];let p;e[16]!==d?(p=d("decoServe.waiting.lead"),e[16]=d,e[17]=p):p=e[17];let m;e[18]!==a||e[19]!==s.kind?(m=(a||s.kind==="denied")&&r.jsxs(r.Fragment,{children:[a,s.kind==="denied"&&r.jsx(pl,{})]}),e[18]=a,e[19]=s.kind,e[20]=m):m=e[20];let v;e[21]!==d?(v=d("decoServe.waiting.connect.title"),e[21]=d,e[22]=v):v=e[22];let y;e[23]!==d?(y=d("decoServe.waiting.connect.body"),e[23]=d,e[24]=y):y=e[24];let h;e[25]!==n||e[26]!==l||e[27]!==d||e[28]!==s.kind||e[29]!==s.onStart||e[30]!==s.paused?(h=s.kind==="needs-gesture"?r.jsx(_e,{variant:"outline",className:"self-start",onClick:s.onStart,children:d("decoServe.guide.start")}):l&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?d("decoServe.guide.paused"):d("decoServe.guide.looking",{hosts:n})}),e[25]=n,e[26]=l,e[27]=d,e[28]=s.kind,e[29]=s.onStart,e[30]=s.paused,e[31]=h):h=e[31];let x;e[32]!==v||e[33]!==y||e[34]!==h?(x=[{title:v,body:y,after:h}],e[32]=v,e[33]=y,e[34]=h,e[35]=x):x=e[35];let C;e[36]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx(Ar,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=C):C=e[36];let b;return e[37]!==x||e[38]!==g||e[39]!==f||e[40]!==p||e[41]!==m?(b=r.jsx(hs,{headingLevel:2,waiting:g,title:f,lead:p,alerts:m,steps:x,footer:C}),e[37]=x,e[38]=g,e[39]=f,e[40]=p,e[41]=m,e[42]=b):b=e[42],b}function Ml(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 zl=15e3,Il=3e3;function Kl(t){const{candidates:e,probe:s,onFound:n,onChange:o,doc:c=document,setTimer:d=(w,N)=>setTimeout(w,N),clearTimer:i=w=>clearTimeout(w),timeoutMs:a=Il}=t;let l={status:"searching",firstRoundDone:!1,problem:null},g=!1,f=!1,p=0,m=null,v=null;const y=()=>c.visibilityState==="hidden",h=w=>{l={...l,...w},o(l)},x=async w=>{v=new AbortController;const N=v,k=d(()=>N.abort(),a);try{return await s(w,N.signal),!0}catch(S){if(g)return!1;const E=ai(S);return E.reason!=="not-answering"?h({problem:{...E,endpoint:w}}):l.problem?.endpoint===w&&h({problem:null}),!1}finally{i(k),v=null}},C=async()=>{if(m=null,!(g||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(y()){h({status:"paused"});return}f=!0,l.status!=="searching"&&h({status:"searching"});for(const w of e){if(g)break;if(await x(w)){if(f=!1,g)return;g=!0,c.removeEventListener("visibilitychange",b),h({status:"found",firstRoundDone:!0}),n(w);return}}if(f=!1,!g){if(p+=1,l.firstRoundDone||h({firstRoundDone:!0}),y()){h({status:"paused"});return}m=d(()=>{C()},ri(p,zl))}}};function b(){if(!g){if(y()){m!==null&&(i(m),m=null),f||h({status:"paused"});return}m!==null&&i(m),p=0,C()}}return c.addEventListener("visibilitychange",b),o(l),C(),()=>{g=!0,m!==null&&i(m),v?.abort(),c.removeEventListener("visibilitychange",b)}}function Ul(t,e){return ii(t,e)}const Hl=["loopback-network","local-network-access"];async function Vl(){if(oi(window.location.origin))return null;for(const t of Hl)try{return await navigator.permissions.query({name:t})}catch{}return null}let Ea=null,Fr=!1;const Is=new Set;function Wl(t){if(Is.add(t),!Fr){Fr=!0;const e=s=>{Ea=s;for(const n of Is)n()};Vl().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Is.delete(t)}const ql={status:"stopped",firstRoundDone:!1,problem:null},Ks=new Map;function Gl(t){const e=Ks.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const n=new Set;let o=null;const c={onFound:()=>{},getSnapshot:()=>s,subscribe:d=>(n.add(d),o??=Kl({candidates:t.split(" "),probe:Ul,onFound:i=>c.onFound(i),onChange:i=>{s=i;for(const a of n)a()}}),()=>{n.delete(d),!(n.size>0)&&(o?.(),o=null,Ks.delete(t))})};return Ks.set(t,c),c}function Na(){return R.useSyncExternalStore(Wl,Br,Br)}const Jl=()=>()=>{},Dr=()=>ql,Br=()=>Ea;function Pf(t){const e=le.c(9),{candidates:s,onFound:n}=t,[o,c]=R.useState(!1),d=Na(),a=(d==="granted"||d==="unsupported"||d==="prompt"&&o)&&s.length>0;let l;e[0]!==a||e[1]!==s||e[2]!==n?(l=a?Gl(s.join(" ")):null,l&&(l.onFound=n),e[0]=a,e[1]=s,e[2]=n,e[3]=l):l=e[3];const g=R.useSyncExternalStore(l?.subscribe??Jl,l?.getSnapshot??Dr,l?.getSnapshot??Dr),f=d==="prompt"&&!o;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[4]=p):p=e[4];let m;return e[5]!==d||e[6]!==g||e[7]!==f?(m={state:g,access:d,needsGesture:f,start:p},e[5]=d,e[6]=g,e[7]=f,e[8]=m):m=e[8],m}const Mr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Yl(t){const{previewState:e,progressStatus:s,fastPreviewActive:n=!1,fastPreviewReady:o=!1,codingSession:c=!1,hostedDraft:d=!1}=t,i=c?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Mr:d&&t.hostedPointerPending&&!o?{...Mr,showDecidingLoader:!0}:n&&o&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:n&&d&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:!n&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ql=1500,Xl=500;function Zl({iframe:t,reload:e,waitMs:s=Ql,confirmMs:n=Xl}){let o;const c=()=>{clearTimeout(d),o=setTimeout(e,n)};t.addEventListener("load",c,{once:!0});const d=setTimeout(()=>{t.removeEventListener("load",c),e()},s);return()=>{clearTimeout(d),clearTimeout(o),t.removeEventListener("load",c)}}const ec=ps({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:ps({width:gt(),height:gt()}),position:ps({x:gt(),y:gt()})}),tc=`(function() {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-vs42n8iz.js","assets/index-DoEtSiIe.js","assets/index-DOMlzk_A.css","assets/chat-context-vJ6R-Clt.js","assets/use-panel-navigate-DHff9CS9.js","assets/thread-route-D-UE3Db_.js","assets/use-project-scope-AMUoXt2c.js","assets/repository-binding-BAQCDq-W.js","assets/use-mcp-client-86j-Nolb.js","assets/auth-IBAsOARn.js","assets/use-view-draft-kind-hbAZo1QG.js","assets/use-blog-view-DJnS2ipo.js","assets/use-organization-settings-CgKOO7Ms.js","assets/schema-CG6ylG0z.js","assets/task-board-BRF3ZwKz.js","assets/thread-intent-R2KI8ie_.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-C0me6Edt.js","assets/session-runtime-CZKHty5X.js","assets/use-entitlements-4v7LU4jM.js","assets/use-ai-providers-BwkzkRi2.js","assets/use-current-view-C2fbVQ-O.js","assets/use-in-settings-LMUeu63D.js","assets/use-decopilot-events-DwNDOIa1.js","assets/use-org-fs-C62_MbqW.js","assets/useInfiniteQuery-9vIAXgqG.js","assets/infiniteQueryObserver-BRGiYBJv.js","assets/save-status-CQe-z40L.js","assets/Image01-BRABRo3v.js","assets/Trash01-Ctp9Olbr.js","assets/Upload01-DgxprpI7.js","assets/use-never-published-C4cAqdmZ.js","assets/use-voice-input-DJjQBO4e.js","assets/popover-mrQ4T9ru.js","assets/drawer-DO0sMAej.js","assets/tooltip-DhlWzeQv.js","assets/index-BFFHlwFA.js","assets/use-mobile-BjsAkqwr.js","assets/agent-icon-DoabtHNW.js","assets/AlertCircle-GoAGGV0G.js","assets/UserCheck01-CA8kXGn8.js","assets/Tool01-D90Wr5xR.js","assets/ArrowUp-s5a8DQxj.js","assets/ArrowLeft-DuGHc_Gh.js","assets/ArrowRight-CMJyKdyB.js","assets/BookOpen01-DZs1-yi9.js","assets/Globe04-5yHQa01g.js","assets/CheckCircle-vIQcB0iT.js","assets/ChevronDown-Dm2xO7jf.js","assets/ChevronSelectorVertical-Cvgyclsz.js","assets/ChevronUp-BKdcyIOm.js","assets/UserSquare-dgrNjiXb.js","assets/LinkBroken01-CyjdgWmP.js","assets/CreditCard01-BUXydXso.js","assets/File02-Y4Nh84qP.js","assets/MessageCircle01-zc37Krdu.js","assets/SwitchHorizontal01-CHtrDs50.js","assets/Eye-DwRCQHLk.js","assets/Fingerprint04-DlIWxzRc.js","assets/Key01-DfLmV_su.js","assets/LayoutLeft-owMYqid0.js","assets/Minus-CFYZtYi9.js","assets/Monitor01-DUhT2Mcw.js","assets/Sun-uwKn4QPm.js","assets/Play-C_9Fb_Ik.js","assets/Plus-BoPsX_T8.js","assets/SearchMd-BGRe_18c.js","assets/ShoppingBag01-CoN4FBW5.js","assets/Users01-BasqfwpC.js","assets/XClose-BUxhnZ3x.js","assets/Zap-CxPsn4FS.js","assets/index-BVDmO57n.js","assets/checkbox-CkODjqKt.js","assets/select-OlcoUSVg.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/site-editor-toast-B-FDGvtN.js","assets/content-changes-DXqxs3Wb.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-A8aB0HnP.js","assets/use-blocks-v8-project-BLAijVCk.js","assets/utils-CzRFs-0R.js","assets/sandbox-git-api-DiUyKbJU.js","assets/hosted-reconcile-CTronLZo.js","assets/blocks-tab-states-CTy1iAF5.js","assets/empty-state-C4MgLcBg.js","assets/search-input-wk0beNbE.js","assets/tabs-Bh3jtZIY.js","assets/active-indicator-CCMhAsc_.js","assets/use-debounced-value-DqHSmPMR.js","assets/use-file-configs-J6lDtEfO.js","assets/asset-utils-D7ZsoUjl.js","assets/usage-stats-CLeyhHyT.js","assets/utils-CVEq3hMx.js","assets/markdown-DeZATUv_.js","assets/use-copy-CjEnyhFT.js","assets/gateway-client-C5MrdR_p.js","assets/form-DwGozYbG.js","assets/label-G4Rj_cXa.js","assets/switch-C5tCt-1T.js","assets/toggle-group-CtXgLS7e.js","assets/match-site-slug-config-B47_xZCi.js","assets/parse-sections-Bbp8QY_-.js","assets/held-block-view-CRIGJWyy.js","assets/calendar-BRx4DiEx.js","assets/textarea-CP9TQ5HN.js","assets/editor-classes-DMpdrv32.js","assets/task-key-CajjdR3t.js","assets/sortable.esm-B0hCRAsX.js","assets/category-tree-CW0acTf_.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-C9Fumckp.js","assets/collapsible-BdVp5Lcb.js","assets/use-task-board-items-BVQx7Wft.js","assets/config-BOn4tvAD.js","assets/task-route-DltlnXMA.js","assets/project-index-BcbyhrUz.js","assets/shell-layout-596_q4a1.js","assets/use-deployment-admin-Bh76rlF7.js","assets/admin-fetch-BhTJlAsX.js","assets/use-org-notice-BzvGZbQ2.js","assets/command-D5O7M-Cf.js","assets/index-DRuy-mDa.js","assets/integration-icon-DvT6X8cI.js","assets/project-icon-BxqBM24K.js","assets/use-navigate-to-agent-C-BC28kE.js","assets/new-project-dialog-CT39WKMt.js","assets/repository-picker-BBkgoOlP.js","assets/github-icon-YYYF_UPl.js","assets/collection-search-DL8nJQx4.js","assets/new-project-store-DYc4RZIM.js","assets/legacy-admin-welcome-dialog-BYL3pyxT.js","assets/required-auth-layout-DPL2sBE1.js","assets/use-org-sso-CypQjzG8.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-pvE5c1WF.js","assets/types-rurFGFZy.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-De8qzGNI.js","assets/use-connection-BO-ZUzee.js","assets/use-mcp-prompts-CPXLXWTp.js","assets/use-thread-outputs-BnMyEJ2l.js","assets/file-type-icon-R4tsODq6.js","assets/section-array-field-yz7QHNSD.js","assets/named-rule-step-BAentWbs.js","assets/slider-c-3WdQpH.js","assets/index-D4CqkEu4.js","assets/tooltipContext-BkLzQGib.js","assets/CategoricalChart-iNQ2kTf5.js","assets/index-C_NkXLoh.js","assets/combobox-B9eEiOM0.js","assets/scroll-area-KLotig-P.js","assets/monaco-editor-BwfJ8i7M.js","assets/editor-UaRoONxx.js","assets/use-delete-block-nP_FtjiY.js","assets/use-section-preview-base-BcIQh9cw.js","assets/mustache-DKc6J7pv.js","assets/seo-editor-D1i_wsxL.js","assets/use-apply-named-rule-CaZ5oLnq.js","assets/use-move-blocks-CCDsEu9Z.js","assets/variant-matcher-override-BBj0ymp1.js"])))=>i.map(i=>d[i]);
2
+ import{c as le,j as r,r as R,m as Re,b as Se,B as _e,aJ as ps,bn as gt,aK as De,bo as So,bp as Po,bq as jo,br as Eo,v as en,D as tn,K as sn,w as nn,x as rn,e as No,h as it,I as Vs,y as Co,bb as To,a6 as gs,ba as Ro,b8 as Jr,bs as vr,i as Yr,au as Ws,aw as qs,a9 as Qr,P as Gs,E as Lo,t as ms,b9 as Ao,q as Oo}from"./index-DoEtSiIe.js";import{u as an,N as _o}from"./save-status-CQe-z40L.js";import{b as $o,c as lt,r as Xr,l as Zr,f as Fo,g as Do,w as Bo}from"./chat-context-vJ6R-Clt.js";import{t as Mo}from"./ChevronDown-Dm2xO7jf.js";import{H as zo,I as Io,C as on,J as Ko,b as Uo,K as xr,L as Ho,M as ea,N as Vo,O as ta}from"./agent-icon-DoabtHNW.js";import{s as Wo}from"./File02-Y4Nh84qP.js";import{b as qo,n as Go}from"./UserSquare-dgrNjiXb.js";import{s as sa}from"./Plus-BoPsX_T8.js";import{a as na,b as ra,P as aa}from"./popover-mrQ4T9ru.js";import{e as We,b as qe,c as ln,f as cn,a as dn,C as un}from"./command-D5O7M-Cf.js";import{a as Jo,c as Yo,b as Qo}from"./repository-binding-BAQCDq-W.js";import{a as bt}from"./sandbox-lifecycle-context-CRyp43o1.js";import{a as Xo,n as Zo,u as ei,f as br,H as ti,g as $s,P as si}from"./frame-navigation-CoKnARJv.js";import{r as ni}from"./session-runtime-CZKHty5X.js";import{u as oa}from"./use-voice-input-DJjQBO4e.js";import{l as ri,m as ai,n as oi,o as ii,q as li,t as ci,u as Ut,j as vs,v as ia,i as tt,w as di,x as fn,y as la,k as ca,z as ui,A as fi,B as da,C as pi,c as ua,b as fa,D as mi,h as Ve,E as hi,d as gi,g as vi,F as xi,G as bi,H as yr,I as yi,J as wr,K as wi,L as ki,M as kr,N as Sr,O as Pr,P as jr,Q as Er,R as Fs,S as Si,U as Pi,V as ji,W as Ei,e as Ni}from"./site-editor-toast-B-FDGvtN.js";import{u as pa}from"./use-mobile-BjsAkqwr.js";import{T as st,I as Nr}from"./toolbar-icon-button-Ce7Zk4Z1.js";import{T as nt,a as rt,c as at}from"./tooltip-DhlWzeQv.js";import{w as os,i as Ci}from"./variant-matcher-override-BBj0ymp1.js";import{s as xt,n as pn,a as mn,f as Be,e as Ti,v as ma,u as ha,h as Ri,i as Li,B as Ai,S as Oi,C as _i,b as $i,c as Fi,d as Di,g as Bi,N as Mi,j as zi,r as Ii,k as Ki,l as Cr,p as Ui}from"./blocks-tab-states-CTy1iAF5.js";import{a as Hi}from"./use-fast-preview-draft-url-DQSkfUDT.js";import{g as Vi,c as Tr,B as Ds,P as Wi,r as qi,R as Gi,S as Ji,l as Yi,m as Qi,p as Xi}from"./parse-sections-Bbp8QY_-.js";import{g as Zi}from"./section-array-field-yz7QHNSD.js";import{u as el}from"./shell-layout-596_q4a1.js";import{u as hn,b as tl}from"./use-sandbox-events-A8aB0HnP.js";import{s as sl,p as nl,W as rl,n as al,S as Bs}from"./category-tree-CW0acTf_.js";import{u as Js}from"./useQueries-CuzZgNOl.js";import{i as ga}from"./ArrowRight-CMJyKdyB.js";import{a as ol,c as il}from"./blog-preview-url-BGp0zYxW.js";import{u as ll,b as va}from"./use-never-published-C4cAqdmZ.js";import{u as xa}from"./blocks-preview-workspace-context-LApXEaVX.js";import{u as cl,H as dl}from"./held-block-view-CRIGJWyy.js";import{MonacoCodeEditor as ba}from"./monaco-editor-BwfJ8i7M.js";import{c as ya,u as wa}from"./hosted-reconcile-CTronLZo.js";import{d as ka}from"./utils-CzRFs-0R.js";import{R as Rr,a as is,b as Lr}from"./resizable-DwqWjQSo.js";import{g as Sa}from"./use-org-notice-BzvGZbQ2.js";import{u as ul}from"./use-blocks-v8-project-BLAijVCk.js";import{s as fl,L as pl,R as Pa,D as Ar,w as Ys}from"./device-hint-DVUadRrt.js";import{s as ml}from"./UserCheck01-CA8kXGn8.js";import{L as hl}from"./label-G4Rj_cXa.js";import{T as gl,a as Or}from"./toggle-group-CtXgLS7e.js";import{i as vl,l as xl,D as bl}from"./named-rule-step-BAentWbs.js";import{b as yl}from"./sandbox-url-D3mC8qhT.js";import{r as wl,R as kl}from"./virtual-mcp-K5tXQmiD.js";import{d as Sl}from"./delay-CnY5UFtP.js";import{s as ja}from"./XClose-BUxhnZ3x.js";import{o as Pl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as Ms,b as jl,w as El,n as _r}from"./app-preview-url-9Od4s8Sz.js";import{u as Nl}from"./use-organization-settings-CgKOO7Ms.js";import{a as zs}from"./agent-capabilities-DmT72SWM.js";import{E as Cl}from"./empty-state-C4MgLcBg.js";import{G as $r}from"./github-icon-YYYF_UPl.js";import{R as Tl}from"./new-project-dialog-CT39WKMt.js";import{r as Rl}from"./preview-source-BsRLGWUP.js";import{A as Ll,a as Al,b as Ol}from"./alert-C5EpdwBA.js";import{u as _l}from"./use-task-metadata-FjAJnVQn.js";function $l(t){const e=le.c(10),{waiting:s}=t,n=s?"true":"false";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(zo,{className:"size-5 sm:size-6"})}),e[0]=o):o=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=c):c=e[1];let d;e[2]!==s?(d=s&&r.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]=s,e[3]=d):d=e[3];let i;e[4]!==d?(i=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[c,d]}),e[4]=d,e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Io,{className:"size-5 sm:size-6"})}),e[6]=a):a=e[6];let l;return e[7]!==n||e[8]!==i?(l=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":n,className:"flex items-center gap-2",children:[o,i,a]}),e[7]=n,e[8]=i,e[9]=l):l=e[9],l}function Fl(t){const e=le.c(22),{index:s,numbered:n,step:o,heading:c}=t,d=R.useId();let i;e[0]!==s||e[1]!==n?(i=n&&r.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:s}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let a;e[3]!==c||e[4]!==d||e[5]!==o.title?(a=r.jsx(c,{id:d,className:"text-sm font-medium text-foreground",children:o.title}),e[3]=c,e[4]=d,e[5]=o.title,e[6]=a):a=e[6];let l;e[7]!==i||e[8]!==a?(l=r.jsxs("div",{className:"flex items-center gap-3",children:[i,a]}),e[7]=i,e[8]=a,e[9]=l):l=e[9];const g=n&&"sm:pl-9";let f;e[10]!==g?(f=Re("flex min-w-0 flex-col gap-3",g),e[10]=g,e[11]=f):f=e[11];let p;e[12]!==o.body?(p=o.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:o.body}),e[12]=o.body,e[13]=p):p=e[13];let m;e[14]!==o.after||e[15]!==f||e[16]!==p?(m=r.jsxs("div",{className:f,children:[p,o.after]}),e[14]=o.after,e[15]=f,e[16]=p,e[17]=m):m=e[17];let v;return e[18]!==d||e[19]!==l||e[20]!==m?(v=r.jsxs("li",{"aria-labelledby":d,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,m]}),e[18]=d,e[19]=l,e[20]=m,e[21]=v):v=e[21],v}const Dl=[];function hs(t){const e=le.c(20),{title:s,lead:n,waiting:o,alerts:c,steps:d,footer:i,headingLevel:a}=t,l=d===void 0?Dl:d,g=a===void 0?1:a,f=g===1?"h1":"h2",p=o&&l.length===0?"status":void 0;let m;e[0]!==o?(m=r.jsx($l,{waiting:o}),e[0]=o,e[1]=m):m=e[1];let v;e[2]!==f||e[3]!==s?(v=r.jsx(f,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=f,e[3]=s,e[4]=v):v=e[4];let y;e[5]!==n?(y=n&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:n}),e[5]=n,e[6]=y):y=e[6];let h;e[7]!==p||e[8]!==m||e[9]!==v||e[10]!==y?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[m,v,y]}),e[7]=p,e[8]=m,e[9]=v,e[10]=y,e[11]=h):h=e[11];let x;e[12]!==g||e[13]!==l?(x=l.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:l.map((b,w)=>r.jsx(Fl,{index:w+1,numbered:l.length>1,step:b,heading:g===1?"h2":"h3"},b.title))}),e[12]=g,e[13]=l,e[14]=x):x=e[14];let C;return e[15]!==c||e[16]!==i||e[17]!==h||e[18]!==x?(C=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.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:[h,c,x,i]})}),e[15]=c,e[16]=i,e[17]=h,e[18]=x,e[19]=C):C=e[19],C}function Bl(t){const e=le.c(43),{wait:s,hosts:n,invalidLink:o}=t,c=o===void 0?!1:o,d=Se();let i;e[0]!==c||e[1]!==d?(i=c&&r.jsx(Ll,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(Al,{className:"line-clamp-none text-foreground",children:d("decoServe.link.invalidTitle")}),r.jsx(Ol,{children:d("decoServe.link.invalidBody")})]})}),e[0]=c,e[1]=d,e[2]=i):i=e[2];const a=i;if(s.kind==="problem"){let w;e[3]!==d||e[4]!==s.host||e[5]!==s.problem?(w=fl(d,s.problem,s.host),e[3]=d,e[4]=s.host,e[5]=s.problem,e[6]=w):w=e[6];const{title:N,body:k}=w;let S;e[7]!==k?(S=r.jsx(Pa,{text:k}),e[7]=k,e[8]=S):S=e[8];let E;e[9]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx(Ar,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=E):E=e[9];let T;return e[10]!==a||e[11]!==S||e[12]!==N?(T=r.jsx(hs,{headingLevel:2,waiting:!1,title:N,lead:S,alerts:a,footer:E}),e[10]=a,e[11]=S,e[12]=N,e[13]=T):T=e[13],T}const l=s.kind==="looking",g=l&&!s.paused;let f;e[14]!==d?(f=d("decoServe.waiting.title"),e[14]=d,e[15]=f):f=e[15];let p;e[16]!==d?(p=d("decoServe.waiting.lead"),e[16]=d,e[17]=p):p=e[17];let m;e[18]!==a||e[19]!==s.kind?(m=(a||s.kind==="denied")&&r.jsxs(r.Fragment,{children:[a,s.kind==="denied"&&r.jsx(pl,{})]}),e[18]=a,e[19]=s.kind,e[20]=m):m=e[20];let v;e[21]!==d?(v=d("decoServe.waiting.connect.title"),e[21]=d,e[22]=v):v=e[22];let y;e[23]!==d?(y=d("decoServe.waiting.connect.body"),e[23]=d,e[24]=y):y=e[24];let h;e[25]!==n||e[26]!==l||e[27]!==d||e[28]!==s.kind||e[29]!==s.onStart||e[30]!==s.paused?(h=s.kind==="needs-gesture"?r.jsx(_e,{variant:"outline",className:"self-start",onClick:s.onStart,children:d("decoServe.guide.start")}):l&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?d("decoServe.guide.paused"):d("decoServe.guide.looking",{hosts:n})}),e[25]=n,e[26]=l,e[27]=d,e[28]=s.kind,e[29]=s.onStart,e[30]=s.paused,e[31]=h):h=e[31];let x;e[32]!==v||e[33]!==y||e[34]!==h?(x=[{title:v,body:y,after:h}],e[32]=v,e[33]=y,e[34]=h,e[35]=x):x=e[35];let C;e[36]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx(Ar,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=C):C=e[36];let b;return e[37]!==x||e[38]!==g||e[39]!==f||e[40]!==p||e[41]!==m?(b=r.jsx(hs,{headingLevel:2,waiting:g,title:f,lead:p,alerts:m,steps:x,footer:C}),e[37]=x,e[38]=g,e[39]=f,e[40]=p,e[41]=m,e[42]=b):b=e[42],b}function Ml(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 zl=15e3,Il=3e3;function Kl(t){const{candidates:e,probe:s,onFound:n,onChange:o,doc:c=document,setTimer:d=(w,N)=>setTimeout(w,N),clearTimer:i=w=>clearTimeout(w),timeoutMs:a=Il}=t;let l={status:"searching",firstRoundDone:!1,problem:null},g=!1,f=!1,p=0,m=null,v=null;const y=()=>c.visibilityState==="hidden",h=w=>{l={...l,...w},o(l)},x=async w=>{v=new AbortController;const N=v,k=d(()=>N.abort(),a);try{return await s(w,N.signal),!0}catch(S){if(g)return!1;const E=ai(S);return E.reason!=="not-answering"?h({problem:{...E,endpoint:w}}):l.problem?.endpoint===w&&h({problem:null}),!1}finally{i(k),v=null}},C=async()=>{if(m=null,!(g||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(y()){h({status:"paused"});return}f=!0,l.status!=="searching"&&h({status:"searching"});for(const w of e){if(g)break;if(await x(w)){if(f=!1,g)return;g=!0,c.removeEventListener("visibilitychange",b),h({status:"found",firstRoundDone:!0}),n(w);return}}if(f=!1,!g){if(p+=1,l.firstRoundDone||h({firstRoundDone:!0}),y()){h({status:"paused"});return}m=d(()=>{C()},ri(p,zl))}}};function b(){if(!g){if(y()){m!==null&&(i(m),m=null),f||h({status:"paused"});return}m!==null&&i(m),p=0,C()}}return c.addEventListener("visibilitychange",b),o(l),C(),()=>{g=!0,m!==null&&i(m),v?.abort(),c.removeEventListener("visibilitychange",b)}}function Ul(t,e){return ii(t,e)}const Hl=["loopback-network","local-network-access"];async function Vl(){if(oi(window.location.origin))return null;for(const t of Hl)try{return await navigator.permissions.query({name:t})}catch{}return null}let Ea=null,Fr=!1;const Is=new Set;function Wl(t){if(Is.add(t),!Fr){Fr=!0;const e=s=>{Ea=s;for(const n of Is)n()};Vl().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Is.delete(t)}const ql={status:"stopped",firstRoundDone:!1,problem:null},Ks=new Map;function Gl(t){const e=Ks.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const n=new Set;let o=null;const c={onFound:()=>{},getSnapshot:()=>s,subscribe:d=>(n.add(d),o??=Kl({candidates:t.split(" "),probe:Ul,onFound:i=>c.onFound(i),onChange:i=>{s=i;for(const a of n)a()}}),()=>{n.delete(d),!(n.size>0)&&(o?.(),o=null,Ks.delete(t))})};return Ks.set(t,c),c}function Na(){return R.useSyncExternalStore(Wl,Br,Br)}const Jl=()=>()=>{},Dr=()=>ql,Br=()=>Ea;function Pf(t){const e=le.c(9),{candidates:s,onFound:n}=t,[o,c]=R.useState(!1),d=Na(),a=(d==="granted"||d==="unsupported"||d==="prompt"&&o)&&s.length>0;let l;e[0]!==a||e[1]!==s||e[2]!==n?(l=a?Gl(s.join(" ")):null,l&&(l.onFound=n),e[0]=a,e[1]=s,e[2]=n,e[3]=l):l=e[3];const g=R.useSyncExternalStore(l?.subscribe??Jl,l?.getSnapshot??Dr,l?.getSnapshot??Dr),f=d==="prompt"&&!o;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[4]=p):p=e[4];let m;return e[5]!==d||e[6]!==g||e[7]!==f?(m={state:g,access:d,needsGesture:f,start:p},e[5]=d,e[6]=g,e[7]=f,e[8]=m):m=e[8],m}const Mr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Yl(t){const{previewState:e,progressStatus:s,fastPreviewActive:n=!1,fastPreviewReady:o=!1,codingSession:c=!1,hostedDraft:d=!1}=t,i=c?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Mr:d&&t.hostedPointerPending&&!o?{...Mr,showDecidingLoader:!0}:n&&o&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:n&&d&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:!n&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ql=1500,Xl=500;function Zl({iframe:t,reload:e,waitMs:s=Ql,confirmMs:n=Xl}){let o;const c=()=>{clearTimeout(d),o=setTimeout(e,n)};t.addEventListener("load",c,{once:!0});const d=setTimeout(()=>{t.removeEventListener("load",c),e()},s);return()=>{clearTimeout(d),clearTimeout(o),t.removeEventListener("load",c)}}const ec=ps({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:ps({width:gt(),height:gt()}),position:ps({x:gt(),y:gt()})}),tc=`(function() {
3
3
  if (window.__visualEditorActive) return;
4
4
  window.__visualEditorActive = true;
5
5
 
@@ -554,4 +554,4 @@ import{c as le,j as r,r as R,m as Re,b as Se,B as _e,aJ as ps,bn as gt,aK as De,
554
554
  }
555
555
  });
556
556
  })();`,ls=Object.freeze({ready:"deco:ready",load:"deco:load",loaded:"deco:loaded",loadError:"deco:load-error"}),ac="v1",oc="/studio-modules",Us=["wireframe","html-swap"];function ic(t,e,s){const n=new URL(`${oc}/${ac}/${e}.js`,t);return s&&n.searchParams.set("build",s),n.href}const lc=2e3;class cc{constructor(e){this.options=e,this.urls=Object.fromEntries(Us.map(s=>[s,ic(e.studioOrigin,s,e.build)]))}options;origin=null;urls;loaded=new Set;swapId=0;pendingSwap=null;startTimer=null;has(e){return this.loaded.has(e)}handle(e){const s=this.options.frame();if(!s||e.source!==s)return!1;const n=e.data;if(!n||typeof n.type!="string")return!1;if(n.type===ls.ready)return dc(e.origin)?(this.ready(e.origin),!0):!1;if(e.origin!==this.origin)return!1;const o=n;switch(o.type){case ls.loaded:{const c=this.nameOf(o.url);return c&&(this.loaded.add(c),this.options.onModulesChange?.(),c==="wireframe"&&this.options.onWireframeReady?.()),!0}case ls.loadError:{const c=this.nameOf(o.url);return c&&this.loaded.delete(c)&&this.options.onModulesChange?.(),c==="html-swap"&&this.failSwap(),!0}case"wireframe:hover":case"wireframe:select":return this.options.onWireframe?.(o),!0;case"html-swap:start":return this.pendingSwap?.id===o.id&&(this.pendingSwap.started=!0,this.clearStartTimer()),!0;case"html-swap:end":return this.pendingSwap?.id!==o.id||(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.()),!0;case"html-swap:error":return this.pendingSwap?.id===o.id&&this.failSwap(),!0;default:return!1}}wireframe(e){return this.post("wireframe",e)}refresh(e){if(e!==void 0&&!this.isFrameOrigin(e))return!1;const s=++this.swapId,n=e?{type:"html-swap:refresh",id:s,url:e}:{type:"html-swap:refresh",id:s};return this.post("html-swap",n)?(this.pendingSwap={id:s,started:!1},this.clearStartTimer(),this.startTimer=setTimeout(()=>{this.startTimer=null,this.pendingSwap?.id===s&&!this.pendingSwap.started&&this.failSwap()},lc),!0):!1}dispose(){this.clearStartTimer(),this.pendingSwap=null,this.loaded.clear(),this.origin=null}ready(e){this.origin=e,this.loaded.size&&(this.loaded.clear(),this.options.onModulesChange?.()),this.pendingSwap&&(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.());const s=this.options.frame();for(const n of Us)s?.postMessage({type:ls.load,url:this.urls[n]},e)}post(e,s){const n=this.options.frame();return!n||!this.origin||!this.loaded.has(e)?!1:(n.postMessage(s,this.origin),!0)}isFrameOrigin(e){try{return new URL(e).origin===this.origin}catch{return!1}}nameOf(e){return Us.find(s=>this.urls[s]===e)??null}failSwap(){this.clearStartTimer(),this.pendingSwap&&(this.pendingSwap=null,this.options.onSwapFailed?.())}clearStartTimer(){this.startTimer&&clearTimeout(this.startTimer),this.startTimer=null}}function dc(t){if(typeof t!="string"||t==="null")return!1;try{const e=new URL(t).origin;return e!=="null"&&e===t}catch{return!1}}function Qs(t,e,s=!1){let n=t,o=typeof n?.__resolveType=="string"?n.__resolveType:"";for(let c=0;o&&c<5;c++){const d=e[o];if(d&&typeof d=="object"&&"__resolveType"in d){const i=d.__resolveType;if(typeof i=="string"&&i&&i!==o){n=d,o=i;continue}}break}if(!o)return[];if(o.includes("flags/multivariate")||s&&So(o,s)){const c=Array.isArray(n.variants)?n.variants:[];if(c.length===0||c.every(a=>{const l=a?.rule;return Po(l?.__resolveType,s)}))return null;const i=[];for(const a of c){const l=jo(a,s);if(l&&typeof l=="object")for(const g of Qs(l,e,s)??[])i.includes(g)||i.push(g)}return i}if(Eo(o)){const c=n.section&&typeof n.section=="object"?Qs(n.section,e,s):[];return c===null?null:c.length?[o,...c]:[o]}return[o]}function ht(t){return t.replace(/[`*_]/g,"\\$&")}function uc(t,e){const s=[`The user selected an element on the live preview and asked: **"${ht(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&&s.push(`**Section resolveType:** \`${ht(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 n=`<${t.tag}${t.classes?` class="${ht(t.classes)}"`:""}>`;s.push(`**Clicked element:** \`${n}\``),t.parents&&s.push(`**DOM breadcrumb:** ${ht(t.parents)} > ${t.tag}`),t.text&&s.push(`**Text content:** "${ht(t.text)}"`),t.componentName&&s.push(`**Component name:** ${ht(t.componentName)}`);const o=t.html.replace(/```/g,"`` `");return s.push("","**HTML snippet:**","```html",o,"```"),s.push("","Please read the source file, locate the element, and apply the requested change."),s.join(`
557
- `)}function fc(t,e,s=320,n=44,o=12){const{x:c,y:d}=t,{width:i,height:a}=e,l=Math.max(o,Math.min(c-s/2,i-s-o)),f=d/a>.68?Math.max(o,d-n-18):Math.min(d+18,a-n-o);return{leftPct:l/i*100,topPct:f/a*100}}function pc(t){const e=le.c(45),{element:s,onDismiss:n}=t,[o,c]=R.useState(""),d=R.useRef(null),{sendMessage:i}=$o(),{openSidePanel:a}=el(),l=Se();let g;e[0]!==s||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==i?(g=()=>{if(!o.trim())return;const I=uc(s,o);a(),i({parts:[{type:"text",text:I}]}),n()},e[0]=s,e[1]=o,e[2]=n,e[3]=a,e[4]=i,e[5]=g):g=e[5];const f=g;let p;e[6]!==s.position||e[7]!==s.viewport?(p=fc(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=p):p=e[8];const m=p,v=`${m.leftPct}%`,y=`${m.topPct}%`;let h;e[9]!==v||e[10]!==y?(h={left:v,top:y,width:"320px"},e[9]=v,e[10]=y,e[11]=h):h=e[11];let x;e[12]!==f?(x=I=>{I.preventDefault(),f()},e[12]=f,e[13]=x):x=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=I=>c(I.target.value),e[14]=C):C=e[14];let b;e[15]!==n?(b=I=>{I.key==="Escape"&&n()},e[15]=n,e[16]=b):b=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let N;e[19]!==o||e[20]!==b||e[21]!==w?(N=r.jsx("input",{ref:d,autoFocus:!0,type:"text",value:o,onChange:C,onKeyDown:b,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=o,e[20]=b,e[21]=w,e[22]=N):N=e[22];let k;e[23]!==o?(k=o.trim(),e[23]=o,e[24]=k):k=e[24];const S=!k;let E;e[25]!==l?(E=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=E):E=e[26];let T;e[27]!==l?(T=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=T):T=e[28];let B;e[29]!==T?(B=r.jsx("title",{children:T}),e[29]=T,e[30]=B):B=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=A):A=e[31];let L;e[32]!==B?(L=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[B,A]}),e[32]=B,e[33]=L):L=e[33];let $;e[34]!==S||e[35]!==E||e[36]!==L?($=r.jsx("button",{type:"submit",disabled:S,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:E,children:L}),e[34]=S,e[35]=E,e[36]=L,e[37]=$):$=e[37];let _;e[38]!==N||e[39]!==$||e[40]!==x?(_=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:x,children:[N,$]}),e[38]=N,e[39]=$,e[40]=x,e[41]=_):_=e[41];let F;return e[42]!==_||e[43]!==h?(F=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:_}),e[42]=_,e[43]=h,e[44]=F):F=e[44],F}const zr="site-links",mc=/details?page|\bpdp\b/i,hc=/listingpage|\bplp\b/i;function gc(t,e,s){const n=new Set;for(const i of s)mc.test(i)&&n.add("product"),hc.test(i)&&n.add("category");const o=xt(pn(t)),c=o[o.length-1],d=o[o.length-2];return c?.type==="text"&&c.text==="/p"&&d?.type==="param"&&d.name===e&&n.add("product"),e==="*"&&o.some(i=>i.type==="param"&&i.name==="*")&&n.add("category"),n}const vc=["rosa","preto","pink","black"];function cs(t,e){const s=e.trim();return s?t(s):vc.flatMap(n=>t(n))}function xc(t,e){const s=e.trim(),n=[];/^\d+$/.test(s)&&n.push({resolveType:t,props:{ids:[s]}});const c=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return n.push({resolveType:t,props:{query:c,count:10}}),n}const Ca=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function gn(t){return t.split("/")[0]??""}function bc(t){const e=new Set;for(const s of t){const n=gn(s);Ca.has(n)&&e.add(n)}return e}function yc(t,e){const s=gn(t);return!Ca.has(s)||e.size===0?!0:e.has(s)}const wc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>cs(s=>xc(t,s),e),optionsFromPayload:ds},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:ds},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:ds},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:ds},{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:Cc}];function kc(t,e,s=new Set){const n=[...e],o=i=>{const a=[];for(const l of wc){if(l.kind!==i)continue;const g=n.find(f=>l.test(f)&&yc(f,s));g&&a.push({cand:l,resolveType:g})}return a.find(l=>s.has(gn(l.resolveType)))??a[0]},c=(i,a,l)=>({kind:i.kind,id:`${i.kind}:${a}`,resolveType:a,clientFilter:i.clientFilter,isFallback:l,buildRequests:g=>i.buildRequests(a,g),optionsFromPayload:i.optionsFromPayload}),d=[];for(const i of["product","category"]){if(!t.has(i))continue;const a=o(i);a&&d.push(c(a.cand,a.resolveType,!1))}return t.size>0&&d.push(Sc(t.has("category")?"category":"product")),d}function Sc(t){return{kind:t,id:zr,resolveType:zr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Oc(e,s)}}function ot(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Pc(t,e,s){const n=new Set,o=new Set,c=d=>{if(Array.isArray(d)){for(const l of d)c(l);return}const i=ot(d);if(!i)return;const a=i.__resolveType;if(typeof a=="string"){if(s(a))n.add(a);else if(a in e&&!o.has(a)){o.add(a);const l=ot(e[a])?.__resolveType;typeof l=="string"&&s(l)&&n.add(a),c(e[a])}}for(const l of Object.values(i))c(l)};return c(t),n}function Ta(t){const e=new Set,s=[];for(const n of t)for(const o of n)e.has(o.value)||(e.add(o.value),s.push(o));return s}function Ra(t){try{return decodeURIComponent(t)}catch{return t}}function jc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ec(t){const e=[];let s="^";for(const n of t)n.type==="text"?s+=jc(n.text):(e.push(n.name),s+=n.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function vn(t,e,s){if(typeof t!="string"||!t)return null;let n;try{n=new URL(t,"https://placeholder.invalid").pathname}catch{return null}n=n.replace(/\/+$/,"");const o=xt(pn(e)),{pattern:c,order:d}=Ec(o),i=d.indexOf(s);if(i===-1)return null;const a=n.match(c);if(!a)return null;const l=a[i+1]?.replace(/^\/+|\/+$/g,"");return l?Ra(l):null}function ds(t,e){const s=ot(t),n=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],o=[],c=new Set;for(const d of n){const i=ot(d);if(!i)continue;const a=vn(i.url,e.template,e.paramName);if(!a||c.has(a))continue;c.add(a);const l=ot(i.isVariantOf),g=typeof l?.name=="string"&&l.name||typeof i.name=="string"&&i.name||a,f=Array.isArray(i.image)?ot(i.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;o.push({value:a,label:g,image:p})}return o}function Nc(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?Ra(s):null}function Cc(t){const e=[],s=new Set,n=(o,c)=>{const d=ot(o);if(!d)return;const i=typeof d.name=="string"&&d.name?d.name:"",a=i?[...c,i]:c,l=Nc(d.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:a.join(" › ")||l})),Array.isArray(d.children))for(const g of d.children)n(g,a)};if(Array.isArray(t))for(const o of t)n(o,[]);return e}const Tc=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 Rc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function Lc(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let n,o=0;for(;(n=s.exec(t))!==null&&o++<5e3;){const c=n[1]??"",d=(n[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:c,text:d})}return e}function Ac(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,n=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,o=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let c,d=0;for(;(c=n.exec(t))!==null&&d++<3e3;){const i=(c[1]??"").replace(/\\\//g,"/");if(!i||s.has(i))continue;s.add(i);const a=t.slice(c.index,c.index+900).match(o)?.[1]?.replace(/\\\//g,"/");e.push({url:i,name:c[2]??"",image:a||void 0})}return e}function Oc(t,e){const s=[],n=new Set,o=(c,d,i,a)=>{if(s.length>=200)return;const l=vn(c,e.template,e.paramName);!l||n.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||i==="category"&&Tc.has(l.split("/")[0]??"")||(n.add(l),s.push({value:l,label:d&&d.length<=80?d:Rc(l),kind:i,image:a}))};for(const{url:c,name:d,image:i}of Ac(t))o(c,d,"product",i);for(const{href:c,text:d}of Lc(t))c.startsWith("/")&&!c.startsWith("//")&&o(c,d,"category");return s}function zt(t,e,s=50){const n=e.trim().toLowerCase();return(n?t.filter(c=>c.label.toLowerCase().includes(n)||c.value.toLowerCase().includes(n)):t).slice(0,s)}const La=1e4;function _c(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 $c(t,{resolveType:e,props:s}){const n=await fetch(li(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(La)});if(!n.ok)throw new Error(`Failed to fetch options: ${n.status}`);return n.json()}async function Ir(t,e){const s=await fetch(ci(t,e),{signal:AbortSignal.timeout(La)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Fc(t,e,s){const n=e.optionsFromPayload(await Ir(t,"/"),s),o=n.find(d=>d.kind==="category");if(!o)return n;const c=Be(s.template,{[s.paramName]:o.value});if(c==="/")return n;try{const d=e.optionsFromPayload(await Ir(t,c),s).filter(i=>i.kind==="product");return Ta([n,d])}catch{return n}}function Dc(t,e,s){return sn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function Bc(t,e,s,n){if(e.homepageLinks)return Fc(t,e,n);const o=e.buildRequests?.(s)??[];if(o.length===0)return[];const c=await Promise.allSettled(o.map(i=>$c(t,i))),d=c.filter(i=>i.status==="fulfilled").map(i=>i.value);if(d.length===0){const i=c.find(a=>a.status==="rejected");throw i?i.reason:new Error("Failed to fetch options")}return Ta(d.map(i=>e.optionsFromPayload(i,n)))}function Xs(t,e,s,n,o){return{queryKey:Dc(t,e,s),queryFn:()=>Bc(t,e,s,n),enabled:o,staleTime:6e4,retry:1}}function It(t){const e=le.c(16),{heading:s,iconKind:n,options:o,template:c,paramName:d,keyPrefix:i,onSelect:a}=t;if(o.length===0)return null;let l;if(e[0]!==n||e[1]!==i||e[2]!==a||e[3]!==o||e[4]!==d||e[5]!==c){let f;e[7]!==n||e[8]!==i||e[9]!==a||e[10]!==d||e[11]!==c?(f=p=>r.jsxs(qe,{value:`${i}:${p.value}`,className:"gap-3 py-2",onSelect:()=>a(p.value),children:[n==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.image?r.jsx("img",{src:p.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(on,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:p.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Be(c,{[d]:p.value})})]})]},`${i}:${p.value}`),e[7]=n,e[8]=i,e[9]=a,e[10]=d,e[11]=c,e[12]=f):f=e[12],l=o.map(f),e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=d,e[5]=c,e[6]=l}else l=e[6];let g;return e[13]!==s||e[14]!==l?(g=r.jsx(We,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=g):g=e[15],g}function Kr(t){const e=le.c(2),{text:s}=t;let n;return e[0]!==s?(n=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Mc(t){const e=le.c(52),{sources:s,template:n,paramName:o,value:c,sandboxRef:d,onCommit:i}=t,a=Se(),[l,g]=R.useState(!1),[f,p]=R.useState(""),[m,v]=R.useState(""),y=R.useRef(null),h=o==="*"?a("sandbox.preview.catchAllParamLabel"):`:${o}`,x=_c(a),b=[...new Set(s.map(re=>x[re.kind].noun))].join(" or ");let w;e[0]!==a||e[1]!==b?(w=a("sandbox.pathParamPickerChip.searchPlaceholder",{options:b}),e[0]=a,e[1]=b,e[2]=w):w=e[2];const N=w,k={template:n,paramName:o};let S;e[3]!==f?(S=(re,ue)=>({source:re,query:ue,options:re.clientFilter?zt(ue.data??[],f):ue.data??[]}),e[3]=f,e[4]=S):S=e[4];const E=S,T=s.filter(qc),B=s.filter(Wc),A=Js({queries:T.map(re=>Xs(d,re,m,k,l))});let L;e[5]!==A||e[6]!==E?(L=(re,ue)=>E(re,A[ue]),e[5]=A,e[6]=E,e[7]=L):L=e[7];const $=T.map(L),_=$.length===0||$.every(Vc),F=Js({queries:B.map(re=>Xs(d,re,m,k,l&&_))});let I;e[8]!==F||e[9]!==E?(I=(re,ue)=>E(re,F[ue]),e[8]=F,e[9]=E,e[10]=I):I=e[10];const J=B.map(I),W=_?J:$,Y=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,Q=Y&&!Y.query.isLoading&&!Y.query.isError?Y?.query.data??[]:[],V=zt(Q.filter(Hc),f),ee=zt(Q.filter(Uc),f),q=V.length>0&&ee.length>0,K=re=>{g(re),y.current&&clearTimeout(y.current),p(re?c:""),v(re?c:"")};let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=re=>{p(re),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{v(re)},300)},e[11]=z):z=e[11];const j=z,O=re=>{i(re),K(!1)},D=mn(f),H=Be(n,{[o]:D}),Z=tn,te=en,M="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",X=Kc;let se;e[12]!==h||e[13]!==a?(se=a("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=a,e[14]=se):se=e[14];let ae;e[15]!==se?(ae=r.jsx(nn,{className:"sr-only",children:r.jsx(rn,{children:se})}),e[15]=se,e[16]=ae):ae=e[16];let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=r.jsx(on,{size:16,className:"shrink-0 text-foreground"}),e[17]=me):me=e[17];let pe;e[18]!==a?(pe=a("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=a,e[19]=pe):pe=e[19];let be;e[20]!==h?(be=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=be):be=e[21];let ge;e[22]!==pe||e[23]!==be?(ge=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[me,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",be]})]}),e[22]=pe,e[23]=be,e[24]=ge):ge=e[24];const ve=cn,Pe=!1,fe="min-h-0 flex-1";let de;e[25]!==N||e[26]!==f?(de=r.jsx(dn,{autoFocus:!0,placeholder:N,value:f,onValueChange:j}),e[25]=N,e[26]=f,e[27]=de):de=e[27];const Le=ln,Ie="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ke;e[28]!==a?(Ke=a("sandbox.pathParamPickerChip.noResults"),e[28]=a,e[29]=Ke):Ke=e[29];let Me;e[30]!==Ke?(Me=r.jsx(un,{children:Ke}),e[30]=Ke,e[31]=Me):Me=e[31];const yt=D&&r.jsx(We,{className:"shrink-0",children:r.jsxs(qe,{value:`__raw__:${D}`,className:"gap-3 py-2",onSelect:()=>O(D),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(ga,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:a("sandbox.pathParamPickerChip.useRawValue",{rawTerm:D,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:H})]})]})}),he=q?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(It,{heading:x.category.heading,iconKind:"category",options:V,template:n,paramName:o,keyPrefix:`${Y?.source.id}:cat`,onSelect:O})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(It,{heading:x.product.heading,iconKind:"product",options:ee,template:n,paramName:o,keyPrefix:`${Y?.source.id}:prod`,onSelect:O})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(re=>{const{source:ue,query:Ge,options:wt}=re,{noun:Je}=x[ue.kind];if(Ge.isLoading)return r.jsx(Kr,{text:a("sandbox.pathParamPickerChip.loading",{noun:Je})},ue.id);if(Ge.isError)return r.jsx(Kr,{text:a("sandbox.pathParamPickerChip.couldNotLoad")},ue.id);if(ue.homepageLinks){const Ht=Ge.data??[];return r.jsxs(R.Fragment,{children:[r.jsx(It,{heading:x.category.heading,iconKind:"category",options:zt(Ht.filter(Ic),f),template:n,paramName:o,keyPrefix:`${ue.id}:cat`,onSelect:O}),r.jsx(It,{heading:x.product.heading,iconKind:"product",options:zt(Ht.filter(zc),f),template:n,paramName:o,keyPrefix:`${ue.id}:prod`,onSelect:O})]},ue.id)}return r.jsx(It,{heading:W.length>1?x[ue.kind].heading:void 0,iconKind:ue.kind,options:wt,template:n,paramName:o,keyPrefix:ue.id,onSelect:O},ue.id)})});let $e;e[32]!==Le||e[33]!==Me||e[34]!==yt||e[35]!==he?($e=r.jsxs(Le,{className:Ie,children:[Me,yt,he]}),e[32]=Le,e[33]=Me,e[34]=yt,e[35]=he,e[36]=$e):$e=e[36];let xe;e[37]!==ve||e[38]!==de||e[39]!==$e?(xe=r.jsxs(ve,{shouldFilter:Pe,className:fe,children:[de,$e]}),e[37]=ve,e[38]=de,e[39]=$e,e[40]=xe):xe=e[40];let Ue;e[41]!==te||e[42]!==ae||e[43]!==ge||e[44]!==xe||e[45]!==X?(Ue=r.jsxs(te,{className:M,onClick:X,children:[ae,ge,xe]}),e[41]=te,e[42]=ae,e[43]=ge,e[44]=xe,e[45]=X,e[46]=Ue):Ue=e[46];let Ae;return e[47]!==Z||e[48]!==K||e[49]!==l||e[50]!==Ue?(Ae=r.jsx(Z,{open:l,onOpenChange:K,children:Ue}),e[47]=Z,e[48]=K,e[49]=l,e[50]=Ue,e[51]=Ae):Ae=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:a("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),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:re=>{re.stopPropagation(),K(!0)},children:c||h}),Ae]})}function zc(t){return t.kind==="product"}function Ic(t){return t.kind!=="product"}function Kc(t){return t.stopPropagation()}function Uc(t){return t.kind==="product"}function Hc(t){return t.kind!=="product"}function Vc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Wc(t){return t.isFallback}function qc(t){return!t.isFallback}function Gc(t){const e=le.c(8),{sources:s,template:n,paramName:o,sandboxRef:c,onFill:d}=t;let i,a;if(e[0]!==o||e[1]!==c||e[2]!==s||e[3]!==n){const m={template:n,paramName:o},v=s.filter(Jc);a=Js,i=v.map(y=>Xs(c,y,"",m,!0)),e[0]=o,e[1]=c,e[2]=s,e[3]=n,e[4]=i,e[5]=a}else i=e[4],a=e[5];let l;e[6]!==i?(l={queries:i},e[6]=i,e[7]=l):l=e[7];const g=a(l),[f,p]=R.useState(!1);if(!f)for(const m of g){if(m.isLoading)break;const v=m.data?.[0];if(v){p(!0),queueMicrotask(()=>d(v.value));break}}return null}function Jc(t){return!t.isFallback}function Yc(t){const e=le.c(31),{name:s,value:n,onCommit:o}=t,c=Se(),[d,i]=R.useState(n),[a,l]=R.useState(!1),g=R.useRef(!1);let f;e[0]!==s||e[1]!==c?(f=s==="*"?c("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=c,e[2]=f):f=e[2];const p=f,m=d||p;let v;e[3]!==m?(v=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:m}),e[3]=m,e[4]=v):v=e[4];let y;e[5]!==p||e[6]!==c?(y=c("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=c,e[7]=y):y=e[7];let h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=E=>i(E.target.value),x=()=>l(!0),e[8]=h,e[9]=x):(h=e[8],x=e[9]);let C;e[10]!==n?(C=E=>{E.key==="Enter"&&E.currentTarget.blur(),E.key==="Escape"&&(g.current=!0,i(n),E.currentTarget.blur())},e[10]=n,e[11]=C):C=e[11];let b;e[12]!==d||e[13]!==o||e[14]!==n?(b=()=>{if(l(!1),g.current){g.current=!1;return}const E=mn(d);i(E),E!==n&&o(E)},e[12]=d,e[13]=o,e[14]=n,e[15]=b):b=e[15];let w;e[16]!==d||e[17]!==p||e[18]!==y||e[19]!==C||e[20]!==b?(w=r.jsx("input",{type:"text",value:d,placeholder:p,title:y,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:Qc,onChange:h,onFocus:x,onKeyDown:C,onBlur:b}),e[16]=d,e[17]=p,e[18]=y,e[19]=C,e[20]=b,e[21]=w):w=e[21];let N;e[22]!==v||e[23]!==w?(N=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,w]}),e[22]=v,e[23]=w,e[24]=N):N=e[24];let k;e[25]!==a||e[26]!==c?(k=a&&r.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:[r.jsx(Ko,{size:10}),c("sandbox.preview.enterToGo")]}),e[25]=a,e[26]=c,e[27]=k):k=e[27];let S;return e[28]!==k||e[29]!==N?(S=r.jsxs(r.Fragment,{children:[N,k]}),e[28]=k,e[29]=N,e[30]=S):S=e[30],S}function Qc(t){return t.stopPropagation()}const Xc=/^(?:autor|author|authorSlug)$/;function Ur(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}const us=t=>typeof t=="string"?t:"";function Zc(t,e,s,n=new Date().toISOString().slice(0,10)){const o=Ti(e),[c]=xt(e);if(o.length===0||o.includes("*")||c?.type!=="text"||c.text==="/")return[];const d=sl(t),i=m=>d[m].map(v=>({label:v.label,data:Ur(Ur(t[v.key])[rl[m]])})),a=[],l=i("posts").filter(({data:m})=>nl(m)==="published"&&us(m.date).slice(0,10)<=n).sort((m,v)=>us(v.data.date).localeCompare(us(m.data.date)));for(const{label:m,data:v}of l)a.push({label:m,path:ol(t,v,s)});for(const{label:m,data:v}of i("categories"))a.push({label:m,path:il(t,v,s)});const g=o.find(m=>Xc.test(m));if(g)for(const{label:m,data:v}of i("authors")){const y=us(v.slug);a.push({label:m,path:y?Be(e,{[g]:y}):null})}const f=[],p=new Set;for(const{label:m,path:v}of a){if(!v)continue;const y={};for(const x of o){const C=vn(v,e,x);if(!C)break;y[x]=C}if(Object.keys(y).length!==o.length)continue;const h=Be(e,y);p.has(h)||(p.add(h),f.push({label:m,values:y}))}return f}function ed(t){const e=le.c(96),{paramName:s,template:n,value:o,options:c,onPick:d,onCommit:i}=t,a=Se(),[l,g]=R.useState(!1),[f,p]=R.useState(""),m=`:${s}`;let v;if(e[0]!==c||e[1]!==f){const K=f.trim().toLowerCase();v=K?c.filter(z=>z.label.toLowerCase().includes(K)||Object.values(z.values).some(j=>j.toLowerCase().includes(K))):c,e[0]=c,e[1]=f,e[2]=v}else v=e[2];const y=v;let h,x,C,b,w,N,k,S,E,T,B,A,L,$,_,F,I,J;if(e[3]!==i||e[4]!==l||e[5]!==m||e[6]!==f||e[7]!==a||e[8]!==o){const K=mn(f);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{g(!1),p("")},e[27]=z):z=e[27],w=z;let j;e[28]!==m||e[29]!==a?(j=a("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:m}),e[28]=m,e[29]=a,e[30]=j):j=e[30];let O;e[31]===Symbol.for("react.memo_cache_sentinel")?(O=ae=>{ae.stopPropagation(),g(!0)},e[31]=O):O=e[31];const D=o||m;e[32]!==j||e[33]!==D?(T=r.jsx("button",{type:"button",title:j,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:O,children:D}),e[32]=j,e[33]=D,e[34]=T):T=e[34],b=tn,S=l,e[35]===Symbol.for("react.memo_cache_sentinel")?(E=ae=>ae?g(!0):w(),e[35]=E):E=e[35],C=en,I="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",J=td;let H;e[36]!==m||e[37]!==a?(H=a("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:m}),e[36]=m,e[37]=a,e[38]=H):H=e[38],e[39]!==H?(N=r.jsx(nn,{className:"sr-only",children:r.jsx(rn,{children:H})}),e[39]=H,e[40]=N):N=e[40];let Z;e[41]===Symbol.for("react.memo_cache_sentinel")?(Z=r.jsx(on,{size:16,className:"shrink-0 text-foreground"}),e[41]=Z):Z=e[41];let te;e[42]!==a?(te=a("sandbox.pathParamPickerChip.pickValueHeading"),e[42]=a,e[43]=te):te=e[43];let M;e[44]!==m?(M=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:m}),e[44]=m,e[45]=M):M=e[45],e[46]!==te||e[47]!==M?(k=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[Z,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[te," ",M]})]}),e[46]=te,e[47]=M,e[48]=k):k=e[48],x=cn,$=!1,_="min-h-0 flex-1";let X;e[49]!==a?(X=a("sandbox.pathParamPickerChip.searchBlogPlaceholder"),e[49]=a,e[50]=X):X=e[50],e[51]!==f||e[52]!==X?(F=r.jsx(dn,{autoFocus:!0,placeholder:X,value:f,onValueChange:p}),e[51]=f,e[52]=X,e[53]=F):F=e[53],h=ln,B="max-h-none min-h-0 flex-1 overflow-y-auto";let se;e[54]!==a?(se=a("sandbox.pathParamPickerChip.noResults"),e[54]=a,e[55]=se):se=e[55],e[56]!==se?(A=r.jsx(un,{children:se}),e[56]=se,e[57]=A):A=e[57],L=K&&r.jsx(We,{children:r.jsxs(qe,{value:`__raw__:${K}`,className:"gap-3 py-2",onSelect:()=>{i(K),w()},children:[r.jsx(ga,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:a("sandbox.pathParamPickerChip.useRawValue",{rawTerm:K,paramLabel:m})})]})}),e[3]=i,e[4]=l,e[5]=m,e[6]=f,e[7]=a,e[8]=o,e[9]=h,e[10]=x,e[11]=C,e[12]=b,e[13]=w,e[14]=N,e[15]=k,e[16]=S,e[17]=E,e[18]=T,e[19]=B,e[20]=A,e[21]=L,e[22]=$,e[23]=_,e[24]=F,e[25]=I,e[26]=J}else h=e[9],x=e[10],C=e[11],b=e[12],w=e[13],N=e[14],k=e[15],S=e[16],E=e[17],T=e[18],B=e[19],A=e[20],L=e[21],$=e[22],_=e[23],F=e[24],I=e[25],J=e[26];let W;if(e[58]!==w||e[59]!==d||e[60]!==n||e[61]!==y){let K;e[63]!==w||e[64]!==d||e[65]!==n?(K=z=>{const j=Be(n,z.values);return r.jsx(qe,{value:j,className:"py-2",onSelect:()=>{d(z.values),w()},children:r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:z.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:j})]})},j)},e[63]=w,e[64]=d,e[65]=n,e[66]=K):K=e[66],W=y.map(K),e[58]=w,e[59]=d,e[60]=n,e[61]=y,e[62]=W}else W=e[62];let Y;e[67]!==W?(Y=r.jsx(We,{children:W}),e[67]=W,e[68]=Y):Y=e[68];let G;e[69]!==h||e[70]!==Y||e[71]!==B||e[72]!==A||e[73]!==L?(G=r.jsxs(h,{className:B,children:[A,L,Y]}),e[69]=h,e[70]=Y,e[71]=B,e[72]=A,e[73]=L,e[74]=G):G=e[74];let Q;e[75]!==x||e[76]!==G||e[77]!==$||e[78]!==_||e[79]!==F?(Q=r.jsxs(x,{shouldFilter:$,className:_,children:[F,G]}),e[75]=x,e[76]=G,e[77]=$,e[78]=_,e[79]=F,e[80]=Q):Q=e[80];let V;e[81]!==C||e[82]!==N||e[83]!==k||e[84]!==Q||e[85]!==I||e[86]!==J?(V=r.jsxs(C,{className:I,onClick:J,children:[N,k,Q]}),e[81]=C,e[82]=N,e[83]=k,e[84]=Q,e[85]=I,e[86]=J,e[87]=V):V=e[87];let ee;e[88]!==b||e[89]!==S||e[90]!==E||e[91]!==V?(ee=r.jsx(b,{open:S,onOpenChange:E,children:V}),e[88]=b,e[89]=S,e[90]=E,e[91]=V,e[92]=ee):ee=e[92];let q;return e[93]!==T||e[94]!==ee?(q=r.jsxs(r.Fragment,{children:[T,ee]}),e[93]=T,e[94]=ee,e[95]=q):q=e[95],q}function td(t){return t.stopPropagation()}function sd(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),n=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${n}`}catch{return e}}function nd(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function rd(t){return t.showPreviewToolbar&&(t.contentEditingEnabled||t.hasFrameworkRoutes)}function ad(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function od(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class Aa extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function id(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new Aa;return s}async function ld(t,e,s){return s?Tr(t,e,await id(s.meta,s.loadMeta)):Tr(t,e)}function cd(t){const e=le.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const n=ll(s);let o;return e[2]!==t||e[3]!==n?(o={mutationFn:async c=>{const{name:d,path:i,template:a,schema:l}=c;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const g=Vi(d),f=a?{...a,name:d,path:i}:await ld(d,i,l);return await n.mutateAsync({blockKey:g,data:f}),{key:g,name:d,path:i}}},e[2]=t,e[3]=n,e[4]=o):o=e[4],No(o)}function dd(t){const e=le.c(89),{open:s,onOpenChange:n,isPending:o,error:c,templates:d,onSubmit:i}=t,a=o===void 0?!1:o,l=Se();let g;e[0]!==l?(g=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=g):g=e[1];const[f,p]=R.useState(g);let m;e[2]!==l?(m=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=m):m=e[3];const[v,y]=R.useState(m),[h,x]=R.useState(Ds),[C,b]=R.useState(null),[w,N]=R.useState(s);s!==w&&(N(s),s&&(p(l("sectionsEditor.createPageModal.defaultPageName")),y(l("sectionsEditor.createPageModal.defaultPagePath")),x(Ds),b(null)));const k=!!d?.length;let S;e[4]!==a||e[5]!==n?(S=pe=>{!pe&&!a&&(b(null),n(!1))},e[4]=a,e[5]=n,e[6]=S):S=e[6];const E=S;let T;e[7]!==a||e[8]!==f||e[9]!==i||e[10]!==v||e[11]!==k||e[12]!==h?(T=async pe=>{pe.preventDefault();const be=f.trim(),ge=v.trim();if(!be||!ge||a)return;const ve=ma(ge);if(ve){b(ve);return}b(null),await i({name:be,path:ge,templateKey:k&&h!==Ds?h:null})},e[7]=a,e[8]=f,e[9]=i,e[10]=v,e[11]=k,e[12]=h,e[13]=T):T=e[13];const B=T,A=C??c;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let $;e[16]!==L?($=r.jsx(nn,{children:r.jsx(rn,{children:L})}),e[16]=L,e[17]=$):$=e[17];let _;e[18]!==l?(_=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=_):_=e[19];let F;e[20]!==_?(F=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=F):F=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=pe=>p(pe.target.value),e[22]=I):I=e[22];let J;e[23]!==l?(J=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=J):J=e[24];let W;e[25]!==a||e[26]!==f||e[27]!==J?(W=r.jsx(Vs,{id:"new-page-name",value:f,onChange:I,placeholder:J,autoFocus:!0,disabled:a}),e[25]=a,e[26]=f,e[27]=J,e[28]=W):W=e[28];let Y;e[29]!==W||e[30]!==F?(Y=r.jsxs("div",{className:"space-y-1.5",children:[F,W]}),e[29]=W,e[30]=F,e[31]=Y):Y=e[31];let G;e[32]!==l?(G=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=G):G=e[33];let Q;e[34]!==G?(Q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:G}),e[34]=G,e[35]=Q):Q=e[35];let V;e[36]===Symbol.for("react.memo_cache_sentinel")?(V=pe=>y(pe.target.value),e[36]=V):V=e[36];let ee;e[37]!==l?(ee=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=ee):ee=e[38];let q;e[39]!==a||e[40]!==v||e[41]!==ee?(q=r.jsx(Vs,{id:"new-page-path",value:v,onChange:V,placeholder:ee,disabled:a}),e[39]=a,e[40]=v,e[41]=ee,e[42]=q):q=e[42];let K;e[43]!==Q||e[44]!==q?(K=r.jsxs("div",{className:"space-y-1.5",children:[Q,q]}),e[43]=Q,e[44]=q,e[45]=K):K=e[45];let z;e[46]!==a||e[47]!==k||e[48]!==l||e[49]!==h||e[50]!==d?(z=k&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),r.jsx(Wi,{id:"new-page-template",value:h,onChange:x,templates:d??[],disabled:a})]}),e[46]=a,e[47]=k,e[48]=l,e[49]=h,e[50]=d,e[51]=z):z=e[51];let j;e[52]!==A?(j=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=j):j=e[53];let O;e[54]!==Y||e[55]!==K||e[56]!==z||e[57]!==j?(O=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,K,z,j]}),e[54]=Y,e[55]=K,e[56]=z,e[57]=j,e[58]=O):O=e[58];let D;e[59]!==n?(D=()=>n(!1),e[59]=n,e[60]=D):D=e[60];let H;e[61]!==l?(H=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=H):H=e[62];let Z;e[63]!==a||e[64]!==D||e[65]!==H?(Z=r.jsx(_e,{type:"button",variant:"outline",onClick:D,disabled:a,children:H}),e[63]=a,e[64]=D,e[65]=H,e[66]=Z):Z=e[66];let te;e[67]!==a||e[68]!==f||e[69]!==v?(te=!f.trim()||!v.trim()||a,e[67]=a,e[68]=f,e[69]=v,e[70]=te):te=e[70];let M;e[71]!==a||e[72]!==l?(M=a?r.jsxs(r.Fragment,{children:[r.jsx(it,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=a,e[72]=l,e[73]=M):M=e[73];let X;e[74]!==te||e[75]!==M?(X=r.jsx(_e,{type:"submit",disabled:te,children:M}),e[74]=te,e[75]=M,e[76]=X):X=e[76];let se;e[77]!==Z||e[78]!==X?(se=r.jsxs(Co,{children:[Z,X]}),e[77]=Z,e[78]=X,e[79]=se):se=e[79];let ae;e[80]!==B||e[81]!==O||e[82]!==se||e[83]!==$?(ae=r.jsx(en,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[$,O,se]})}),e[80]=B,e[81]=O,e[82]=se,e[83]=$,e[84]=ae):ae=e[84];let me;return e[85]!==E||e[86]!==s||e[87]!==ae?(me=r.jsx(tn,{open:s,onOpenChange:E,children:ae}),e[85]=E,e[86]=s,e[87]=ae,e[88]=me):me=e[88],me}function ud(t){const e=le.c(35),{orgSlug:s,virtualMcpId:n,branch:o,previewUrl:c,meta:d,decofile:i,blockKey:a}=t,l=Se();let g;e[0]!==o||e[1]!==s||e[2]!==n?(g={orgSlug:s,virtualMcpId:n,branch:o},e[0]=o,e[1]=s,e[2]=n,e[3]=g):g=e[3];const f=cl(g,i);let p;e[4]!==a||e[5]!==i?(p=qi(i,a),e[4]=a,e[5]=i,e[6]=p):p=e[6];const{resolveType:m,props:v,title:y}=p;if(!m){let N;e[7]!==l?(N=l("sandbox.preview.loaderNoLongerExists"),e[7]=l,e[8]=N):N=e[8];let k;return e[9]!==N?(k=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:N}),e[9]=N,e[10]=k):k=e[10],k}const h=`loader:${a}`,x=`loader:${a}`;let C;e[11]!==a||e[12]!==m||e[13]!==y?(C={mode:"saved",blockKey:a,resolveType:m,title:y},e[11]=a,e[12]=m,e[13]=y,e[14]=C):C=e[14];let b;e[15]!==o||e[16]!==i||e[17]!==d||e[18]!==s||e[19]!==c||e[20]!==v||e[21]!==f.isPending||e[22]!==f.save||e[23]!==x||e[24]!==C||e[25]!==n?(b=r.jsx(Gi,{orgSlug:s,virtualMcpId:n,branch:o,previewUrl:c,meta:d,decofile:i,kind:"loaders",target:C,initialValue:v,isCreating:f.isPending,onCreate:fd,onSaveReferencedBlock:f.save,showRun:!1},x),e[15]=o,e[16]=i,e[17]=d,e[18]=s,e[19]=c,e[20]=v,e[21]=f.isPending,e[22]=f.save,e[23]=x,e[24]=C,e[25]=n,e[26]=b):b=e[26];let w;return e[27]!==a||e[28]!==o||e[29]!==i||e[30]!==s||e[31]!==h||e[32]!==b||e[33]!==n?(w=r.jsx(dl,{listing:i,orgSlug:s,virtualMcpId:n,branch:o,blockKey:a,present:void 0,children:b},h),e[27]=a,e[28]=o,e[29]=i,e[30]=s,e[31]=h,e[32]=b,e[33]=n,e[34]=w):w=e[34],w}async function fd(){}function pd(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Hr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:pd(t.error)}}function md(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 hd(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=md(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(o=>o.status==="error"&&!o.hasData&&o.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?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 gd=R.lazy(()=>To(()=>import("./sections-editor-JNsgN9Jp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163])).then(t=>({default:t.SectionsEditor})));function Vr(t){const e=le.c(62),{virtualMcpId:s,externalSelection:n,onSectionPicked:o,onViewJsonFile:c}=t,d=n===void 0?null:n,{org:i}=gs(),{currentBranch:a,taskId:l}=lt(),g=hn(),f=bt(),p=xa(),m=g.lifecycle.phase==="running",v=f.previewUrl;let y;e[0]!==a||e[1]!==i||e[2]!==v||e[3]!==l||e[4]!==s?(y=a?{orgSlug:i.slug,virtualMcpId:s,branch:a,threadId:l??null,previewUrl:v}:null,e[0]=a,e[1]=i,e[2]=v,e[3]=l,e[4]=s,e[5]=y):y=e[5];const h=y,x=Ut(s,a);let C;e[6]!==m?(C={fetchEnabled:m},e[6]=m,e[7]=C):C=e[7];const b=vs(h,C),w=ia(h);let N;e[8]!==m?(N={fetchEnabled:m},e[8]=m,e[9]=N):N=e[9];const k=ha(h,N),S=hd({lifecyclePhase:g.lifecycle.phase,decofile:Hr(b),meta:Hr(k),hasEditableContent:Ri(b.data,k.data),fastPreviewActive:oa(s).runtime==="cms"||tt(x)}),E=an()===void 0,T=vd;if(Li(x)){let j;return e[10]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(Oi,{})),e[10]=j):j=e[10],j}if(x.kind==="pending"&&x.retrying){let j;return e[11]!==x?(j=T(r.jsx(_i,{backend:x})),e[11]=x,e[12]=j):j=e[12],j}if(S.kind==="loading"||E){let j;return e[13]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(Ro,{})),e[13]=j):j=e[13],j}if(b.data&&di(k.data)){const j=p.state.target,O=j?.kind==="page"||j?.kind==="section"?j.key:null,D=x.kind==="legacy"?O??"":`${w}:${O??""}`,H=a??"";let Z;return e[14]!==b.data||e[15]!==O||e[16]!==i.slug||e[17]!==D||e[18]!==H||e[19]!==s?(Z=T(r.jsx(Ji,{orgSlug:i.slug,virtualMcpId:s,branch:H,decofile:b.data,initialKey:O,compact:!0},D)),e[14]=b.data,e[15]=O,e[16]=i.slug,e[17]=D,e[18]=H,e[19]=s,e[20]=Z):Z=e[20],Z}if(S.kind==="empty"){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx($i,{})),e[21]=j):j=e[21],j}if(S.kind==="error"){let j;e[22]!==b||e[23]!==f||e[24]!==k||e[25]!==S.source?(j=()=>{if(S.source==="sandbox"){f.retry();return}Promise.all([b.refetch(),k.refetch()])},e[22]=b,e[23]=f,e[24]=k,e[25]=S.source,e[26]=j):j=e[26];const O=j;let D;return e[27]!==O||e[28]!==S.source?(D=T(r.jsx(Ai,{source:S.source,onRetry:O})),e[27]=O,e[28]=S.source,e[29]=D):D=e[29],D}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=j=>T(r.jsx("div",{className:"h-full min-h-0",children:j})),e[30]=B):B=e[30];const A=B,L=p.state.target;if(L?.kind==="loader"&&b.data&&k.data){const j=x.kind==="legacy"?void 0:w,O=a??"",D=v??null;let H;return e[31]!==b.data||e[32]!==k.data||e[33]!==i.slug||e[34]!==j||e[35]!==O||e[36]!==D||e[37]!==L.key||e[38]!==s?(H=A(r.jsx(ud,{orgSlug:i.slug,virtualMcpId:s,branch:O,previewUrl:D,meta:k.data,decofile:b.data,blockKey:L.key},j)),e[31]=b.data,e[32]=k.data,e[33]=i.slug,e[34]=j,e[35]=O,e[36]=D,e[37]=L.key,e[38]=s,e[39]=H):H=e[39],H}let $;e[40]!==a||e[41]!==i.slug||e[42]!==L||e[43]!==s?($=L||!a?null:Xr(Zr(i.slug,s,a)),e[40]=a,e[41]=i.slug,e[42]=L,e[43]=s,e[44]=$):$=e[44];const _=$;let F="/",I=null,J=null;L?.kind==="page"?(F=L.path,I=L.key):L?.kind==="section"?J=L.key:_&&(F=_.path,I=_.pageKey);const W=I?`page:${I}`:J?`section:${J}`:`path:${F}`;let Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(Y=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}),e[45]=Y):Y=e[45];const G=x.kind==="legacy"?W:`${w}:${W}`,Q=a??"",V=v??void 0,ee=J?null:d,q=J?void 0:o,K=!!I&&p.state.editSeoPageKey===I;let z;return e[46]!==J||e[47]!==I||e[48]!==F||e[49]!==c||e[50]!==i.slug||e[51]!==V||e[52]!==ee||e[53]!==q||e[54]!==K||e[55]!==G||e[56]!==Q||e[57]!==s||e[58]!==p.consumeEditSeo||e[59]!==p.setFocusedBlock||e[60]!==p.setVariantOverride?(z=A(r.jsx(R.Suspense,{fallback:Y,children:r.jsx(gd,{orgSlug:i.slug,virtualMcpId:s,branch:Q,previewReady:!0,previewUrl:V,currentPath:F,activePageBlockKey:I,activeGlobalBlockKey:J,externalSelection:ee,onSectionPicked:q,initialEditSeo:K,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:c},G)})),e[46]=J,e[47]=I,e[48]=F,e[49]=c,e[50]=i.slug,e[51]=V,e[52]=ee,e[53]=q,e[54]=K,e[55]=G,e[56]=Q,e[57]=s,e[58]=p.consumeEditSeo,e[59]=p.setFocusedBlock,e[60]=p.setVariantOverride,e[61]=z):z=e[61],z}function vd(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function xd(t){const e=le.c(51),{virtualMcpId:s,pageKey:n,onClose:o,ref:c}=t,d=Se(),i=an(),a=i===!0,l=fn(s);let g;e[0]!==l||e[1]!==n?(g=la(l,ka(n)),e[0]=l,e[1]=n,e[2]=g):g=e[2];const f=g,{org:p}=gs(),{currentBranch:m,taskId:v}=lt(),h=bt().previewUrl;let x;e[3]!==m||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==s?(x=m?{orgSlug:p.slug,virtualMcpId:s,branch:m,threadId:v??null,previewUrl:h}:null,e[3]=m,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=s,e[8]=x):x=e[8];const b=vs(x),w=m??"";let N;e[9]!==p.slug||e[10]!==w||e[11]!==s?(N={orgSlug:p.slug,virtualMcpId:s,branch:w},e[9]=p.slug,e[10]=w,e[11]=s,e[12]=N):N=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k={holdsCopy:!0},e[13]=k):k=e[13];const{save:S,flush:E,hold:T}=va(N,k),B=m??"";let A;e[14]!==p.slug||e[15]!==B||e[16]!==s?(A=ya({orgSlug:p.slug,virtualMcpId:s,branch:B}),e[14]=p.slug,e[15]=B,e[16]=s,e[17]=A):A=e[17];const L=wa(A);let $;e[18]!==n||e[19]!==L?($=L(n),e[18]=n,e[19]=L,e[20]=$):$=e[20];const _=$;let F;e[21]!==_||e[22]!==n?(F={pageKey:n,copyEpoch:_},e[21]=_,e[22]=n,e[23]=F):F=e[23];const[I,J]=R.useState(F);(I.pageKey!==n||I.copyEpoch!==_)&&(J({pageKey:n,copyEpoch:_}),T(n));const W=b.data?.[n],Y=b.data===void 0&&b.isLoading||i===void 0,G=b.data!==void 0&&W===void 0,Q=!m||G||Y;let V;e[24]!==W?(V=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=V):V=e[25];const ee=V;let q;e[26]!==n||e[27]!==Q||e[28]!==S?(q=H=>{if(Q)return;let Z;try{Z=JSON.parse(H)}catch{return}Z===null||typeof Z!="object"||Array.isArray(Z)||S(n,Z)},e[26]=n,e[27]=Q,e[28]=S,e[29]=q):q=e[29];const K=q;let z;e[30]!==E?(z=()=>({flush:E}),e[30]=E,e[31]=z):z=e[31],R.useImperativeHandle(c,z);let j;e[32]!==f||e[33]!==a||e[34]!==o||e[35]!==d?(j=a?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Jr,{size:14})})]}),e[32]=f,e[33]=a,e[34]=o,e[35]=d,e[36]=j):j=e[36];let O;e[37]!==_||e[38]!==b.data||e[39]!==E||e[40]!==ee||e[41]!==Y||e[42]!==G||e[43]!==n||e[44]!==Q||e[45]!==K||e[46]!==d?(O=Y?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}):G?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(ba,{code:ee,language:"json",readOnly:Q,height:"100%",onChange:H=>K(H??""),onSave:H=>{K(H),E()}},`${n}:${b.data===void 0?"loading":"ready"}:${_}`)}),e[37]=_,e[38]=b.data,e[39]=E,e[40]=ee,e[41]=Y,e[42]=G,e[43]=n,e[44]=Q,e[45]=K,e[46]=d,e[47]=O):O=e[47];let D;return e[48]!==j||e[49]!==O?(D=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[j,O]}),e[48]=j,e[49]=O,e[50]=D):D=e[50],D}function Wr(t){const e=le.c(3),{currentBranch:s}=lt(),n=Ut(t.virtualMcpId,s);let o;return e[0]!==n.kind||e[1]!==t?(o=n.kind==="legacy"?r.jsx(xd,{...t}):r.jsx(bd,{...t}),e[0]=n.kind,e[1]=t,e[2]=o):o=e[2],o}function bd(t){const e=le.c(61),{virtualMcpId:s,pageKey:n,onClose:o,ref:c}=t,d=Se(),i=an(),a=i===!0,l=fn(s);let g;e[0]!==l||e[1]!==n?(g=la(l,ka(n)),e[0]=l,e[1]=n,e[2]=g):g=e[2];const f=g,{org:p}=gs(),{currentBranch:m,taskId:v}=lt(),h=bt().previewUrl;let x;e[3]!==m||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==s?(x=m?{orgSlug:p.slug,virtualMcpId:s,branch:m,threadId:v??null,previewUrl:h}:null,e[3]=m,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=s,e[8]=x):x=e[8];const C=x,b=vs(C);let w;e[9]!==n?(w=[n],e[9]=n,e[10]=w):w=e[10];let N;e[11]!==b.data?(N={listing:b.data},e[11]=b.data,e[12]=N):N=e[12];const k=ca(C,w,N),S=m??"";let E;e[13]!==p.slug||e[14]!==S||e[15]!==s?(E={orgSlug:p.slug,virtualMcpId:s,branch:S},e[13]=p.slug,e[14]=S,e[15]=s,e[16]=E):E=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T={holdsCopy:!0},e[17]=T):T=e[17];const{save:B,flush:A,hold:L}=va(E,T),$=m??"";let _;e[18]!==p.slug||e[19]!==$||e[20]!==s?(_=ya({orgSlug:p.slug,virtualMcpId:s,branch:$}),e[18]=p.slug,e[19]=$,e[20]=s,e[21]=_):_=e[21];const F=wa(_);let I;e[22]!==n||e[23]!==F?(I=F(n),e[22]=n,e[23]=F,e[24]=I):I=e[24];const J=I,W=b.data?.[n];let Y;e[25]!==k.ready||e[26]!==b.data||e[27]!==W?(Y=k.ready&&b.data!==void 0&&(W===void 0||vr(W)),e[25]=k.ready,e[26]=b.data,e[27]=W,e[28]=Y):Y=e[28];const G=Y;let Q;e[29]!==J||e[30]!==n?(Q={pageKey:n,copyEpoch:J,opened:!1,code:""},e[29]=J,e[30]=n,e[31]=Q):Q=e[31];const[V,ee]=R.useState(Q);if(G&&(V.pageKey!==n||V.copyEpoch!==J||!V.opened)){let X;e[32]!==W?(X=W===void 0?"":JSON.stringify(W,null,2),e[32]=W,e[33]=X):X=e[33],ee({pageKey:n,copyEpoch:J,opened:!0,code:X}),vr(W)&&L(n)}const q=V.pageKey===n&&V.opened,K=i===void 0||!q&&!G,z=G&&W===void 0,j=!m||z||K;let O;e[34]!==n||e[35]!==j||e[36]!==B?(O=X=>{if(j)return;ee(ae=>({...ae,code:X}));let se;try{se=JSON.parse(X)}catch{return}se===null||typeof se!="object"||Array.isArray(se)||B(n,se)},e[34]=n,e[35]=j,e[36]=B,e[37]=O):O=e[37];const D=O;let H;e[38]!==A?(H=()=>({flush:A}),e[38]=A,e[39]=H):H=e[39],R.useImperativeHandle(c,H);let Z;e[40]!==f||e[41]!==a||e[42]!==o||e[43]!==d?(Z=a?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Jr,{size:14})})]}),e[40]=f,e[41]=a,e[42]=o,e[43]=d,e[44]=Z):Z=e[44];let te;e[45]!==k.failed||e[46]!==k.retry||e[47]!==A||e[48]!==V.code||e[49]!==V.copyEpoch||e[50]!==V.pageKey||e[51]!==K||e[52]!==z||e[53]!==j||e[54]!==D||e[55]!==q||e[56]!==d?(te=!q&&k.failed?r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-4",children:[r.jsx("p",{className:"text-sm",children:d("sectionsEditor.hosted.blockLoadFailed")}),r.jsx(_e,{variant:"outline",size:"sm",onClick:k.retry,children:d("sectionsEditor.namedRules.tryAgain")})]}):K?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}):z?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(ba,{code:V.code,language:"json",readOnly:j,height:"100%",onChange:X=>D(X??""),onSave:X=>{D(X),A()}},`${V.pageKey}:${V.copyEpoch}`)}),e[45]=k.failed,e[46]=k.retry,e[47]=A,e[48]=V.code,e[49]=V.copyEpoch,e[50]=V.pageKey,e[51]=K,e[52]=z,e[53]=j,e[54]=D,e[55]=q,e[56]=d,e[57]=te):te=e[57];let M;return e[58]!==Z||e[59]!==te?(M=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,te]}),e[58]=Z,e[59]=te,e[60]=M):M=e[60],M}function Oa(t){return t.contentEditingEnabled&&!t.isMobile}function yd(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function wd(t,e){return t==="blocks"?"preview":e?"blocks":t}function kd(t){return Oa({contentEditingEnabled:Sa(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function Sd(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function Pd(t){const e=ui(t),{display:s}=t;let n=null;if(s.mode==="production"&&s.iframeBase)try{n=new URL(t.path,s.iframeBase).href}catch{n=null}const o=fi(n,e);return{value:e,frame:o?Ys(o,t.device):null,newTab:o}}function jd(t){const e=le.c(94),{tests:s,load:n,onOpen:o,options:c,onChange:d,available:i}=t,a=Se();let l;e[0]!==c?(l=da(c),e[0]=c,e[1]=l):l=e[1];const g=l;let f;e[2]!==c.tests?(f=c.tests??{},e[2]=c.tests,e[3]=f):f=e[3];const p=f;let m;e[4]!==d||e[5]!==c?(m=M=>{const X=M?xl(M):null,{at:se,...ae}=c;d(X?{...ae,at:X}:ae)},e[4]=d,e[5]=c,e[6]=m):m=e[6];const v=m;let y;e[7]!==p||e[8]!==d||e[9]!==c?(y=(M,X)=>{const se={...p};X==="on"?se[M]=!0:X==="off"?se[M]=!1:delete se[M];const{tests:ae,...me}=c;d(Object.keys(se).length>0?{...me,tests:se}:me)},e[7]=p,e[8]=d,e[9]=c,e[10]=y):y=e[10];const h=y;let x;e[11]!==o?(x=M=>{M&&o?.()},e[11]=o,e[12]=x):x=e[12];let C;e[13]!==a?(C=a("sandbox.previewAs.label"),e[13]=a,e[14]=C):C=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(ml,{size:16}),e[15]=b):b=e[15];let w;e[16]!==g||e[17]!==C?(w=r.jsx(nt,{asChild:!0,children:r.jsx(na,{asChild:!0,children:r.jsx(st,{"aria-label":C,active:g,"data-testid":"preview-as-trigger",children:b})})}),e[16]=g,e[17]=C,e[18]=w):w=e[18];let N;e[19]!==a?(N=a("sandbox.previewAs.label"),e[19]=a,e[20]=N):N=e[20];let k;e[21]!==N?(k=r.jsx(rt,{children:N}),e[21]=N,e[22]=k):k=e[22];let S;e[23]!==k||e[24]!==w?(S=r.jsxs(at,{children:[w,k]}),e[23]=k,e[24]=w,e[25]=S):S=e[25];let E;e[26]!==a?(E=a("sandbox.previewAs.label"),e[26]=a,e[27]=E):E=e[27];let T;e[28]!==E?(T=r.jsx("h3",{className:"text-sm font-medium",children:E}),e[28]=E,e[29]=T):T=e[29];let B;e[30]!==i||e[31]!==a?(B=a(i?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=i,e[31]=a,e[32]=B):B=e[32];let A;e[33]!==B?(A=r.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[33]=B,e[34]=A):A=e[34];let L;e[35]!==T||e[36]!==A?(L=r.jsxs("div",{className:"flex flex-col gap-1",children:[T,A]}),e[35]=T,e[36]=A,e[37]=L):L=e[37];let $;e[38]!==a?($=a("sandbox.previewAs.momentLabel"),e[38]=a,e[39]=$):$=e[39];let _;e[40]!==$?(_=r.jsx(hl,{htmlFor:"preview-as-moment",children:$}),e[40]=$,e[41]=_):_=e[41];let F;e[42]!==c.at?(F=vl(c.at),e[42]=c.at,e[43]=F):F=e[43];let I;e[44]!==v?(I=M=>v(M.target.value),e[44]=v,e[45]=I):I=e[45];let J;e[46]!==F||e[47]!==I?(J=r.jsx(Vs,{id:"preview-as-moment",type:"datetime-local",className:bl,value:F,onChange:I}),e[46]=F,e[47]=I,e[48]=J):J=e[48];const W=c.at===void 0;let Y;e[49]!==v?(Y=()=>v(""),e[49]=v,e[50]=Y):Y=e[50];let G;e[51]!==a?(G=a("sandbox.previewAs.now"),e[51]=a,e[52]=G):G=e[52];let Q;e[53]!==W||e[54]!==Y||e[55]!==G?(Q=r.jsx(_e,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:Y,children:G}),e[53]=W,e[54]=Y,e[55]=G,e[56]=Q):Q=e[56];let V;e[57]!==J||e[58]!==Q?(V=r.jsxs("div",{className:"flex items-center gap-2",children:[J,Q]}),e[57]=J,e[58]=Q,e[59]=V):V=e[59];let ee;e[60]!==a?(ee=a("sandbox.previewAs.momentHint"),e[60]=a,e[61]=ee):ee=e[61];let q;e[62]!==ee?(q=r.jsx("p",{className:"text-xs text-muted-foreground",children:ee}),e[62]=ee,e[63]=q):q=e[63];let K;e[64]!==_||e[65]!==V||e[66]!==q?(K=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,V,q]}),e[64]=_,e[65]=V,e[66]=q,e[67]=K):K=e[67];let z;e[68]!==a?(z=a("sandbox.previewAs.testsLabel"),e[68]=a,e[69]=z):z=e[69];let j;e[70]!==z?(j=r.jsx("span",{className:"text-sm font-medium",children:z}),e[70]=z,e[71]=j):j=e[71];let O;e[72]!==p||e[73]!==n||e[74]!==h||e[75]!==a||e[76]!==s?(O=n&&!n.ready?n.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsLoadFailed")}),r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:n.retry,children:a("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(it,{className:"size-4 text-muted-foreground"})}):s.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(M=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:M}),r.jsxs(gl,{type:"single",variant:"outline",size:"sm",value:p[M]===void 0?"":p[M]?"on":"off",onValueChange:X=>h(M,X),"aria-label":M,children:[r.jsx(Or,{value:"off",children:a("sandbox.previewAs.off")}),r.jsx(Or,{value:"on",children:a("sandbox.previewAs.on")})]})]},M))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=n,e[74]=h,e[75]=a,e[76]=s,e[77]=O):O=e[77];let D;e[78]!==j||e[79]!==O?(D=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[j,O]}),e[78]=j,e[79]=O,e[80]=D):D=e[80];let H;e[81]!==g||e[82]!==d||e[83]!==a?(H=g&&r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>d({}),children:a("sandbox.previewAs.reset")}),e[81]=g,e[82]=d,e[83]=a,e[84]=H):H=e[84];let Z;e[85]!==L||e[86]!==K||e[87]!==D||e[88]!==H?(Z=r.jsxs(ra,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,K,D,H]}),e[85]=L,e[86]=K,e[87]=D,e[88]=H,e[89]=Z):Z=e[89];let te;return e[90]!==S||e[91]!==Z||e[92]!==x?(te=r.jsxs(aa,{onOpenChange:x,children:[S,Z]}),e[90]=S,e[91]=Z,e[92]=x,e[93]=te):te=e[93],te}const Ed=["next"],Nd=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],_a=new Set(["tsx","ts","jsx","js","mdx"]),Cd=new Set(["tsx","jsx"]),Td=new Set(["404","500"]);function Rd(t){const e=new Set;if(!t||typeof t!="object")return e;const s=t;for(const n of["dependencies","devDependencies"]){const o=s[n];if(o&&typeof o=="object"&&!Array.isArray(o))for(const c of Object.keys(o))e.add(c)}return e}function Ld(t){const e=Rd(t);return Ed.some(s=>e.has(s))?"next":Nd.some(s=>e.has(s))?"tanstack":null}function $a(t,e){const s=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return s?`${s}/${e}`:e}function Ad(t,e){const s=n=>$a(e,n);switch(t){case"next":return[{router:"next-pages",dir:s("pages"),pattern:"**/*"},{router:"next-pages",dir:s("src/pages"),pattern:"**/*"},{router:"next-app",dir:s("app"),pattern:"**/page.*"},{router:"next-app",dir:s("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:s("src/routes"),pattern:"**/*"}];default:{const n=t;throw new Error(`Unknown framework: ${String(n)}`)}}}function xn(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function Od(t){const e=xn(t.at(-1)??"");if(!e||!_a.has(e[1]))return null;const[s]=e;if(s.includes("."))return null;const n=[...t.slice(0,-1),s];return n[0]==="api"||n.length===1&&Td.has(s)||n.some(o=>o.startsWith("_")||o.includes("["))?null:(n.at(-1)==="index"&&n.pop(),`/${n.join("/")}`)}function _d(t){const e=xn(t.at(-1)??"");if(!e||e[0]!=="page"||!_a.has(e[1]))return null;const s=[];for(const n of t.slice(0,-1)){if(n.startsWith("_")||n.startsWith("@")||/^\(\.{1,3}\)/.test(n)||n.includes("["))return null;n.startsWith("(")&&n.endsWith(")")||s.push(n)}return`/${s.join("/")}`}function $d(t){const e=[];let s="",n=!1;for(const o of t)o==="["?n=!0:o==="]"&&(n=!1),o==="."&&!n?(e.push(s),s=""):s+=o;return e.push(s),e}function Fd(t){const e=xn(t.at(-1)??"");if(!e||!Cd.has(e[1]))return null;const s=[...t.slice(0,-1),...$d(e[0])].filter(Boolean);s.at(-1)==="lazy"&&s.pop();const n=s.at(-1);if(!n||n==="__root"||s.some(c=>c.startsWith("-"))||n.startsWith("_"))return null;(n==="index"||n==="route")&&s.pop();const o=[];for(const c of s){if(c.includes("$"))return null;if(c.startsWith("_")||c.startsWith("(")&&c.endsWith(")"))continue;const d=c.replace(/_$/,"").replace(/[[\]]/g,"");d&&o.push(d)}return`/${o.join("/")}`}function Dd(t,e){const s=e.split("/").filter(Boolean);if(s.length===0)return null;switch(t){case"next-pages":return Od(s);case"next-app":return _d(s);case"tanstack":return Fd(s);default:{const n=t;throw new Error(`Unknown router: ${String(n)}`)}}}function Bd(t){const e=new Set;for(const{root:s,files:n}of t){const o=`${s.dir}/`;for(const c of n){if(!c.startsWith(o))continue;const d=Dd(s.router,c.slice(o.length));d&&e.add(d)}}return[...e].sort((s,n)=>s==="/"?-1:n==="/"?1:s.localeCompare(n))}const Md=5e3,zd=6e4;async function Id(t,e){const s=await fetch(yl(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:Md})});if(!s.ok)throw new Error(`Failed to list ${e.dir}: ${s.status}`);const n=await s.json();return Array.isArray(n.files)?n.files.filter(o=>typeof o=="string"):[]}async function Kd(t,e){const s=await pi(t,$a(e,"package.json"));if(s.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const n=s.kind==="data"?Ld(s.data):null;if(!n)return[];const o=Ad(n,e),c=await Promise.all(o.map(async d=>({root:d,files:await Id(t,d)})));return Bd(c)}function Ud(t,e,s){const n=le.c(12);let o;n[0]!==e||n[1]!==t?(o=t?sn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],n[0]=e,n[1]=t,n[2]=o):o=n[2];let c;n[3]!==e||n[4]!==t?(c=()=>t?Kd(t,e):[],n[3]=e,n[4]=t,n[5]=c):c=n[5];const d=s&&!!t;let i;n[6]!==o||n[7]!==c||n[8]!==d?(i={queryKey:o,queryFn:c,enabled:d,staleTime:zd},n[6]=o,n[7]=c,n[8]=d,n[9]=i):i=n[9];const a=Yr(i);let l;return n[10]!==a.data?(l=a.data??[],n[10]=a.data,n[11]=l):l=n[11],l}const Hd=500,Vd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},qr=1,fs=["desktop","mobile","tablet"],Wd=["preview","visual","blocks"],qd={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Gd(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 Kt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Hs(t,e){try{return new URL(t,e).href}catch{return null}}function Jd(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 s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function Yd(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Qd(t,e,s){const n=t.toLowerCase(),o=e.toLowerCase(),c=o.split("/").filter(Boolean),d=a=>{if(a===s)return 100;const l=a.indexOf(s);if(l===-1)return 0;let g=40;return l===0?g+=30:/[\s/-]/.test(a[l-1]??"")&&(g+=20),g+=Math.round(s.length/a.length*20),g};let i=Math.max(d(n),d(o));return c.at(-1)===s?i=Math.max(i,95):c.includes(s)&&(i=Math.max(i,90)),i}function Xd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Zd({virtualMcpId:t}){const e=Se(),s=pa(),{currentBranch:n,taskId:o,virtualMcpId:c}=lt(),d=!!Fo(),i=xa(),a=Jo(c===t?t:null),l=oa(t),g=wl(a?.metadata?.ui?.layout??null),f=Sa(g),p=Oa({contentEditingEnabled:f,isMobile:s}),[m]=R.useState(()=>kd({cmsMode:g,isMobile:s})),[v,y]=Ws(qs.previewEditingMode(t),u=>u&&Wd.includes(u)?u:null),h=v??m,[x,C]=Ws(qs.previewDeviceSize(t),u=>u&&fs.includes(u)?u:"desktop"),[b,w]=R.useState(null),[N,k]=R.useState(null),S=R.useRef(null),E=R.useRef(null),[T,B]=R.useState(!1),A=R.useRef(null),L=()=>{A.current?.flush(),B(!1)},$=()=>B(u=>(u&&A.current?.flush(),!u)),[_,F]=R.useState({width:0,height:0}),[I,J]=R.useState(!1),[W,Y]=R.useState({}),[G,Q]=R.useState(""),V=R.useRef(null),[ee,q]=R.useState(!1),[K,z]=R.useState(),[j,O]=R.useState(null),[D,H]=R.useState(null),[Z,te]=R.useState(null),[M,X]=R.useState(()=>i.state.target?.kind==="page"?i.state.target.path:"/"),[se,ae]=R.useState(()=>i.state.target?.kind==="page"?i.state.target.key:null),[me,pe]=R.useState({}),[be,ge]=R.useState(!1),ve=R.useRef(null),Pe=()=>{ge(!0),S.current&&$s(S.current),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>ge(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),ge(!1)},{org:de}=gs(),Le=hn(),Ie=bt(),Ke=Ie.vmEntry,Me=Le.lifecycle.phase,{url:yt}=ua(t),he=Ut(t,n),{connection:$e}=fa(t),xe=ul(t),Ue=mi({hasServeConnection:!!$e,runtime:l.runtime}),Ae=!tt(he)&&he.kind!=="pending",re=Ve(he)??yt,ue=re??Ie.previewUrl,Ge=!!re||Me==="running",wt=a?.id===t?ni(a.metadata):null,Je=!re&&a?.id===t&&l.runtime==="cms",Ht=l.projectDefault==="cms",kt=Ae?hi({sandboxUrl:ue,previewServerUrl:wt,fastPreviewActive:Je}):null,bn=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,threadId:o??null,previewUrl:ue}:null,yn=vs(bn,{fetchEnabled:Ge}),xs=ha(bn,{fetchEnabled:Ge}),ce=yn.data,we=xs.data,Ye=ce?Fi(ce,we).sort((u,P)=>u.name.localeCompare(P.name)):[],Vt=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n}:null,wn=cd(Vt),Fa=gi(Vt),bs=ce&&we?Di(ce,we):[],kn=Ae&&ce&&we?Yi(we,ce,"loaders"):[],Da=G?(()=>{const u=G.toLowerCase();return Ye.map(P=>({page:P,score:Qd(P.name,P.path,u)})).filter(({score:P})=>P>0).sort((P,U)=>U.score-P.score||P.page.path.length-U.page.path.length).map(({page:P})=>P)})():Ye,Ba=bs.filter(u=>{if(!G)return!0;const P=G.toLowerCase();return u.name.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),Sn=p?kn:[],Pn=Sn.filter(u=>{if(!G)return!0;const P=G.toLowerCase();return u.title.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),Wt=D?kn.find(u=>u.key===D)??null:null,Ne=pn,ys=j||D?null:Bi(Ye,M,se),ie=ys?.key??null,ct=i.state.target?.kind==="section"?i.state.target.key:i.state.focusedBlockKey??ie,qt=ys?.path??null,ws={};if(Ae&&Ge&&ue&&we&&ce){const u=Qi(we,"loaders"),P=ie?ce[ie]:void 0,U=Pc(P,ce,Ee=>u.has(Ee)),oe=bc(U);for(const Ee of xt(M)){if(Ee.type!=="param")continue;const Ce=gc(M,Ee.name,U),mt=kc(Ce,u,oe);mt.length>0&&(ws[Ee.name]=mt)}}const jn=u=>ce?Zc(ce,u,we):[],ks=ie?jn(M):[],Qe=(ie?me[ie]:void 0)??ks[0]?.values??{},Te=Be(M,Qe),St=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,threadId:o??null}:null,En=ce&&ie?Zi(ce,ie,0):[],Nn=tt(he),Cn=ce?Xi(En,ce,Nn):[],Pt=Cn.map(u=>u.isSavedBlock?u.label:""),jt=Cn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),Et=En.map(u=>Qs(u,ce??{},Nn)),dt=R.useRef(null),Fe=R.useRef(null),Ma=Le.status.state==="paused",Ss=Le.phase,Tn=al({claimPhase:Ss,lifecycle:Le.lifecycle}),Xe=Ie.previewState,za=Ie.userStopped,Ia=vi(de.slug,t??""),{url:He}=Hi(Je&&t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,previewServerUrl:wt??null,path:Te}:null),Ka=Ht&&l.runtime==="sandbox",Oe=xi(he,Ue,xe),Rn=bi(Oe&&Je&&he.kind==="protocol"&&t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n}:null),Ln=Oe?Rn.pointer:null,ne=Yl({previewState:Xe,progressStatus:Tn.status,previewServerUrl:wt,fastPreviewActive:Je,fastPreviewReady:!!He,codingSession:Ka,localPreviewUrl:re,hostedDraft:Oe,hostedPointerPending:Oe&&(he.kind==="pending"||Rn.pending)}),An=ne.showWakingPill||Oe&&ne.mode==="production"&&!Ln,Nt=ne.mode!=="none",Ua=ne.mode==="production"&&ne.iframeBase?Kt(ne.iframeBase):null,ut=ne.mode==="production"?Ua:Kt(ue),Ha=a?.id===t&&a.metadata?.fastPreviewInPlace===!0,Ct=Ae?re?ne.mode==="sandbox"&&p&&h==="blocks":ne.mode==="production"&&Je&&Ha&&p&&h==="blocks":!1,On=R.useRef(null),{pin:Va,effective:Wa}=Jd(On.current,{inPlaceRenderActive:Ct,draftPreviewUrl:He,resolvedPath:Te});On.current=Va;const _n=i.state.variantOverride??[],Gt=Ae?_n:[],Tt=Ae?[]:_n,Jt=tt(he)&&Mi.some(u=>zi(we,u)==="available"),ft=Jt?W:{},$n=da(ft),qa=Jt&&ce?Object.keys(Ii(ce).experiments):[],[Fn,Ga]=R.useState(!1),Dn=ca(Vt,Jt&&Fn?Ki:[]),Ja={...Dn,ready:!(he.kind==="protocol"&&he.hosted)||Fn&&Dn.ready},Ze=t?yr(de.slug,t):null,Ya=yi(Ze),Yt=Oe?Pd({display:ne,path:Te,pointer:Ln,heldRevision:Ya,device:x,forcedVariants:Tt,previewOptions:ft}):null,Bn=JSON.stringify([Tt,ft]);R.useEffect(()=>{if(!Oe||!Ze)return;const[u,P]=JSON.parse(Bn);wr(Ze,{forcedVariants:u,previewOptions:P})},[Oe,Ze,Bn]),R.useEffect(()=>{if(!(!Oe||!Ze))return()=>wr(Ze,null)},[Oe,Ze]);const Ps=$e&&Ve(he)?wi($e.endpoint,Tt,$n):null,Qa=$e&&Ve(he)?Ps?ki(Ps,ft):kr:null,et=Gd(ne.mode==="sandbox"?os(Ys(Sr(Z??Hs(Te,ne.iframeBase)??ne.iframeBase,Qa),x),Gt):ne.mode==="production"&&Yt?.frame?Yt.frame:ne.mode==="production"?os(Ys(Pr(jr(Sr(Z??Wa??Hs(Te,ne.iframeBase)??ne.iframeBase,An?kr:null),Tt),ft),x),Gt):null),Mn=He??(ne.iframeBase?Hs(Te,ne.iframeBase):null),zn=ne.mode==="production"&&Yt?Yt.newTab:ne.mode==="production"?Mn?os(Pr(jr(Mn,Tt),ft),Gt):null:et??ne.iframeBase,Xa=()=>{const u=zn;u&&window.open(u,"_blank","noopener")},Rt=t&&n?Zr(de.slug,t,n):null,Lt=u=>{Rt&&Bo(Rt,u)},ke=i.state.target;R.useEffect(()=>{if(!(!ke||!kt||!we))if(ke.kind==="page"){const u=me[ke.key]??{};Fe.current=Be(ke.path,u),O(null),H(null),te(null),ae(ke.key),X(ke.path),Lt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")Fe.current=null,O(null),H(ke.key),te(null);else{const u=bs.find(P=>P.key===ke.key);if(u){Fe.current=null;const P=Cr(we);H(null),O(u),te(Er(kt,P,u.key))}}},[ke,kt,we,me]),R.useEffect(()=>{!ie||qt===null||ke?.kind==="page"&&ke.key===ie&&ke.path===qt||i.selectTarget({kind:"page",key:ie,path:qt})},[ie,qt,ke]);const[In,Za]=R.useState(null);if(Xe.kind==="iframe"&&In!==Xe.previewUrl){const u=In!==null;Za(Xe.previewUrl);const P=Rt?Xr(Rt):null;if(P){if(Fe.current=Be(P.path,P.params),X(P.path),ae(P.pageKey),te(null),O(null),H(null),P.pageKey&&Object.keys(P.params).length>0){const U=P.pageKey;pe(oe=>({...oe,[U]:P.params}))}}else u&&(Fe.current=null,X("/"),te(null),ae(null),O(null),H(null))}dt.current=et;const eo=ne.mode==="production"&&!!He&&!re,[Qt,js]=R.useState({src:et??void 0,loading:!1}),[to,Es]=R.useState(!1),[so,no]=R.useState(),[Kn,Un]=R.useState(null),je=Xo(Kn,{base:ne.iframeBase??"",frameSrc:Qt.src,loadedSrc:so,wanted:et??void 0,canSwap:xe&&to&&!Qt.loading});je!==Kn&&Un(je);const Xt=Zo(Qt,je?je.src:et??void 0,eo);Xt!==Qt&&js(Xt);const pt=Xt.src,Hn=Xt.loading,Vn=ei({iframeRef:S,src:ne.mode==="sandbox"?et:null,active:ne.mode==="sandbox"}),Wn=R.useRef(null);R.useEffect(()=>{const u=Hn?setTimeout(()=>js(br),ti):null,P=()=>{u&&clearTimeout(u)};if(!He||!pt||Wn.current===He)return P;Wn.current=He;const U=S.current;return U&&U.getAttribute("src")!==pt&&(Pe(),U.src=pt),P},[He,pt,Hn]);const qn=()=>{const u=S.current?.contentWindow,P=ut;if(!u||!P||!ce||!ie)return;const U=ce[ie];if(!U||typeof U!="object")return;const oe=Ei({previewBaseUrl:P,pageBlock:U,decofile:ce,path:Te,pathTemplate:M});if(!oe)return;const Ee=os(oe.src,Ci(Gt,ie));u.postMessage({type:"cms-editor::render",src:Ee,body:oe.body},P)},Ns=R.useRef(null);R.useEffect(()=>{if(!Ct||j||D||!ie||!ce){Ns.current=null;return}const u={nav:JSON.stringify({page:ie,path:Te,pathTemplate:M}),content:JSON.stringify(ce)},P=Yd(Ns.current,u);Ns.current=u,P&&qn()},[ce,Ct,j,D,ie,Te,M]);const Cs=R.useRef(null);R.useEffect(()=>{if(!Ct||j||D||!ie||!ce){Cs.current=null;return}const u=JSON.stringify(i.state.variantOverride??null),P=Cs.current;Cs.current={page:ie,sig:u},!(!P||P.page!==ie||P.sig===u)&&qn()},[i.state.variantOverride,Ct,j,D,ie]);const Gn=!!t&&!!n&&!Le.notFound&&!za&&!Ma&&(Ss?.kind==="ready"||Me!=="idle"),Jn=!tt(he),ro=fn(t??void 0),ao=Ud(St,ro,Jn&&Gn),oo=new Set(f?Ye.map(u=>Ne(u.path)):[]),At=Jn?ao.filter(u=>!oo.has(Ne(u))):[],Yn=G?At.filter(u=>u.toLowerCase().includes(G.toLowerCase())):At,ye=Sd({editingMode:h,sandboxDisplay:ne.mode==="sandbox",blocksEditingEnabled:p});R.useEffect(()=>{const u=ut;if(!u)return;const P=U=>{if(U.origin===u)if(U.data?.type==="visual-editor::element-clicked"){const oe=ec.safeParse(U.data.payload);oe.success&&w(oe.data)}else if(U.data?.type==="cms-editor::section-clicked"){const oe=nc.safeParse(U.data.payload);oe.success&&k({index:oe.data.sectionIndex,seq:oe.data.clickSeq})}else U.data?.type==="cms-editor::render-start"?Pe():U.data?.type==="cms-editor::render-end"?(fe(),S.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:Pt,kinds:jt,keys:Et},u)):U.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[ut,Pt,jt,Et]);const Qn=()=>{const u=S.current?.contentWindow,P=Kt(ue),U=od({v8:xe,script:tc});!u||!P||!U||u.postMessage(U,P)},io=()=>{if(xe)return;const u=S.current?.contentWindow,P=Kt(ue);!u||!P||u.postMessage({type:"visual-editor::deactivate"},P)},Xn=()=>{const u=ze.current;u?.has("wireframe")&&(u.wireframe({type:"wireframe:sections",labels:Pt,kinds:jt,keys:Et}),u.wireframe({type:ye==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Ts=()=>{if(xe){Xn();return}const u=S.current?.contentWindow,P=ut,U=ad({v8:xe,production:ne.mode==="production",localPreview:!!re,script:rc});!u||!P||!U||(u.postMessage(U,P),u.postMessage({type:"cms-editor::set-labels",labels:Pt,kinds:jt,keys:Et},P))},lo=()=>{if(xe){ze.current?.wireframe({type:"wireframe:deactivate"});return}const u=S.current?.contentWindow,P=ut;!u||!P||u.postMessage({type:"cms-editor::deactivate"},P)},Zn=u=>{ze.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:u})},co=()=>{if(ze.current?.wireframe({type:"wireframe:clear-hover"}),xe)return;const u=S.current?.contentWindow,P=ut;!u||!P||(u.postMessage({type:"cms-editor::clear-hover"},P),u.postMessage({type:"visual-editor::clear-hover"},P))},Zt=u=>{if(u==="blocks"&&!p)return;const P=h;!s&&u!==P&&(u==="blocks"?E.current?.resize("30%"):E.current?.collapse()),y(u),w(null),k(null),u!=="blocks"&&H(null),P==="visual"&&io(),u==="visual"&&Qn(),P==="blocks"&&u!=="blocks"&&lo(),u==="blocks"&&Ts()},uo=()=>{Zt(yd(h,p))},fo=()=>{Zt(wd(h,p))},es=()=>{const u=S.current;if(!u)return;Pe();const P=document.activeElement,U=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Xd(u,dt.current);let oe;const Ee=()=>{clearTimeout(oe),u.tabIndex=U,u.style.pointerEvents="";const Ce=document.activeElement;(!Ce||Ce===document.body||Ce===u)&&P?.focus(),u.removeEventListener("load",Ee)};u.addEventListener("load",Ee),oe=setTimeout(Ee,3e3)};tl(es);const ze=R.useRef(null),er=R.useEffectEvent(Xn),po=R.useEffectEvent((u,P)=>{k({index:u,seq:P})}),mo=R.useEffectEvent(()=>{fe(),S.current&&$s(S.current),je&&(Rs.current=je.shown),_t&&Fs(Ot)}),tr=R.useEffectEvent(()=>{if(Es(!1),je&&Un(null),je&&je.src!==dt.current){Pe();return}es()});R.useEffect(()=>{if(!xe)return;const u=new cc({studioOrigin:window.location.origin,build:"4.618.0",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>er(),onWireframe:U=>{U.type==="wireframe:select"&&po(U.sectionIndex,U.clickSeq)},onModulesChange:()=>Es(u.has("html-swap")),onSwapEnd:()=>mo(),onSwapFailed:()=>tr()});ze.current=u;const P=U=>{u.handle(U)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),u.dispose(),Es(!1),ze.current===u&&(ze.current=null)}},[xe,ne.iframeBase]);const sr=xe?JSON.stringify([Pt,jt,Et,ye]):"";R.useEffect(()=>{sr&&er()},[sr]);const nr=R.useRef(null);R.useEffect(()=>{const u=nr.current;if(nr.current=je,je&&je!==u){ze.current?.refresh(je.shown)?Pe():tr();return}!je&&u&&u.shown!==u.src&&u.src===dt.current&&es()},[je]);const rr=()=>{ze.current?.refresh()||es()},Ot=yr(de.slug,t??""),_t=Oe&&Nt&&!!t,Rs=R.useRef(null);R.useEffect(()=>{if(_t)return Si(Ot)},[_t,Ot]);const{reload:$t}=Pi(de.slug,t??""),ar=R.useRef($t.seq);R.useEffect(()=>{if(ar.current!==$t.seq&&(ar.current=$t.seq,!!_t&&Rs.current===dt.current)){if($t.navigates){Fs(Ot);return}rr()}},[$t.seq]);const Ls=ia(Vt),Ft=ji(Ve(he)?Ls:""),or=R.useRef(Ft);R.useEffect(()=>{const u=or.current;if(or.current=Ft,!u||!Ft||u===Ft)return;const P=S.current;if(P)return Zl({iframe:P,reload:rr})},[Ft]);const ir=()=>{const u=fs.indexOf(x);C(fs[(u+1)%fs.length])},ts=(u,P)=>lr({...Qe,[u]:P}),lr=u=>{if(!ie)return;const P=ie;Fe.current=Be(M,u),pe(U=>({...U,[P]:u})),Lt({path:M,pageKey:P,params:u})},ho=sd({iframeBase:ne.iframeBase,resolvedPath:Te,activeGlobalSectionName:j?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),As=u=>{const P=me[u.key]??{},U=Be(u.path,me[u.key]??jn(u.path)[0]?.values??{});(j||Ne(U)!==Ne(Te))&&Pe(),Fe.current=U,O(null),H(null),te(null),k(null),ae(u.key),X(u.path),Lt({path:u.path,pageKey:u.key,params:P}),i.selectTarget({kind:"page",key:u.key,path:u.path})},cr=u=>{(j||Ne(u)!==Ne(Te))&&Pe(),Fe.current=u,O(null),H(null),te(null),k(null),ae(null),X(u),Lt({path:u,pageKey:null,params:{}})};Do(Rt,cr);const go=u=>{if(tt(he)){const oe=ce?Ui(ce,u.key,we):null;oe?As(oe):ms.info(e("sandbox.preview.blockOnNoPage"));return}if(!kt||!we){ms.error(e("sandbox.preview.previewMetadataNotReady"));return}Pe(),Fe.current=null;const P=Cr(we),U=Er(kt,P,u.key);O(u),H(null),te(U),k(null),i.selectTarget({kind:"section",key:u.key})},vo=u=>{p&&(O(null),H(u.key),te(null),Zt("blocks"),i.selectTarget({kind:"loader",key:u.key}))},xo=async({name:u,path:P,templateKey:U})=>{if(!t||!n)return;const oe=ma(P);if(oe){z(oe);return}const Ee=P.trim().startsWith("/")?P.trim():`/${P.trim()}`;if(Ye.some(Ce=>Ne(Ce.path)===Ne(Ee))){z(e("sandbox.preview.pageAlreadyExists",{path:Ee}));return}z(void 0);try{const Ce=U?await Fa(ce,U):void 0;if(U&&!Ce){z(e("sandbox.preview.templateNoLongerExists"));return}const mt=await wn.mutateAsync({name:u,path:Ee,template:Ce,schema:tt(he)?{meta:we,loadMeta:async()=>(await xs.refetch()).data}:void 0});q(!1),ms.success(e("sandbox.preview.pageCreated",{name:u})),await Sl(Hd),As({key:mt.key,name:mt.name,path:mt.path}),Zt("blocks")}catch(Ce){z(Ce instanceof Aa?e("sandbox.preview.pageSchemaNotReady"):Ce instanceof Error?Ce.message:e("sandbox.preview.failedToCreatePage"))}},Dt=nd({previewSurfaceActive:Nt,daemonReady:Gn,production:ne.mode==="production",servePreviewUrl:Ve(he)}),dr=rd({showPreviewToolbar:Dt,contentEditingEnabled:f,hasFrameworkRoutes:At.length>0}),ur=f?Da:[],fr=f?Ba:[],Bt=()=>{J(!1),Q("")},Os=f?j?.name??Wt?.title??ys?.name:void 0,_s=f&&(yn.isPending||xs.isPending),ss=_s?Kt(ne.iframeBase):Os,Mt=j?`section:${j.key}`:D?`loader:${D}`:f&&ie?`page:${ie}`:At.includes(Ne(M))?`route:${Ne(M)}`:void 0,ns=e(qd[x]),pr=x==="mobile"?r.jsx(ea,{size:16}):x==="tablet"?r.jsx(Vo,{size:16}):r.jsx(ta,{size:16}),bo=Dt?dr?r.jsxs("div",{className:"flex h-7 min-w-36 flex-1 items-stretch overflow-hidden rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background transition-colors hover:border-border",children:[r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx("button",{type:"button",onClick:ir,"aria-label":ns,className:Re("flex w-7 shrink-0 items-center justify-center border-r border-border/60 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",Nr),children:pr})}),r.jsx(rt,{children:ns})]}),r.jsxs(aa,{open:I,onOpenChange:u=>{J(u),u||Q("")},children:[r.jsx(na,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:_s?ss??void 0:j||Wt?Os:[Os,M].filter(Boolean).join(" · "),className:Re("group/page-picker flex min-w-0 flex-1 items-stretch whitespace-nowrap text-left text-xs text-muted-foreground",Nr),children:r.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:[j&&r.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:[r.jsx(Uo,{size:11}),e("sandbox.preview.globalBadge")]}),Wt&&r.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:[r.jsx(Wo,{size:11}),e("sandbox.preview.loaderBadge")]}),ss&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ss}),!_s&&!j&&!Wt&&r.jsx("span",{"data-testid":"preview-page-path",className:Re("min-w-0 truncate font-mono [direction:rtl]",ss?"ml-auto shrink-[2] text-right text-muted-foreground md:@max-[40rem]/panel-toolbar:hidden":"flex-1 text-left text-foreground"),children:r.jsx("bdi",{dir:"ltr",children:M})}),r.jsx(Mo,{size:12,className:Re("shrink-0 transition-transform",I&&"rotate-180")})]})})}),r.jsxs(ra,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(cn,{shouldFilter:!1,defaultValue:Mt,children:[r.jsx(dn,{value:G,onValueChange:u=>{Q(u),V.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(ln,{ref:V,className:"max-h-80",children:[r.jsx(un,{children:(!f||Ye.length===0)&&At.length===0&&(!f||bs.length===0)&&Sn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),ur.length>0&&r.jsx(We,{children:ur.map(u=>r.jsxs(qe,{value:`page:${u.key}`,"aria-current":Mt===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Bt(),As(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),Yn.length>0&&r.jsx(We,{heading:e("sandbox.preview.siteRoutes"),children:Yn.map(u=>r.jsx(qe,{value:`route:${u}`,"aria-current":Mt===`route:${u}`||void 0,title:u,onSelect:()=>{Bt(),cr(u)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:u})},u))}),fr.length>0&&r.jsx(We,{heading:e("sandbox.preview.globalComponents"),children:fr.map(u=>r.jsx(qe,{value:`section:${u.key}`,"aria-current":Mt===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),go(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),Pn.length>0&&r.jsx(We,{heading:e("sandbox.preview.globalLoaders"),children:Pn.map(u=>r.jsx(qe,{value:`loader:${u.key}`,"aria-current":Mt===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),vo(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),f&&!j&&!D&&xt(M).some(u=>u.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:xt(M).map((u,P)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${P}`);const U=ws[u.name];return!U&&ks.length>0?r.jsx(ed,{paramName:u.name,template:M,value:Qe[u.name]??"",options:ks,onPick:lr,onCommit:oe=>ts(u.name,oe)},`${ie}:${u.name}`):U&&St?r.jsx(Mc,{sources:U,template:M,paramName:u.name,value:Qe[u.name]??"",sandboxRef:St,onCommit:oe=>ts(u.name,oe)},`${ie}:${u.name}`):r.jsx(Yc,{name:u.name,value:Qe[u.name]??"",onCommit:oe=>ts(u.name,oe)},`${ie}:${u.name}`)})}),f&&r.jsx("div",{className:"border-t p-1.5",children:r.jsxs(_e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Bt(),z(void 0),q(!0)},children:[r.jsx(sa,{size:16}),e("sandbox.preview.createNewPage")]})})]})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ho}):null,mr=Dt||f?r.jsxs("div",{className:"flex min-w-0 max-w-[24rem] flex-1 items-center justify-center gap-1",children:[!(Dt&&dr)&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:ir,"aria-label":ns,children:pr})}),r.jsx(rt,{children:ns})]}),bo,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Jt&&r.jsx(jd,{tests:qa,load:Ja,onOpen:()=>Ga(!0),options:W,onChange:u=>{Y(u),i.previewAsChanged()},available:!!Ps||!An||!$n}),r.jsx(st,{onClick:Xa,disabled:Oe&&!zn,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Qr,{size:16})})]})]}):null,yo=(Ae||d)&&ne.mode==="sandbox",rs=Vd[x],as=x==="desktop"&&(_.width===0||_.width>=rs.width+2*qr),hr=as?1:Math.min(_.width>0?_.width/(rs.width+2*qr):1,1),wo=as?{width:"100%",height:"100%"}:{width:`${rs.width}px`,height:_.height>0?`${_.height/hr}px`:`${rs.height}px`,transform:`scale(${hr})`,transformOrigin:"top center"},gr=r.jsxs(r.Fragment,{children:[yo&&(Dt||f)&&r.jsx(st,{onClick:uo,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(xr,{size:16})}),p&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:fo,"aria-pressed":ye==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ye==="blocks",children:r.jsx(qo,{size:16})})}),r.jsx(rt,{children:e("sandbox.preview.blocksEditor")})]}),ct&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:$,"aria-pressed":T,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:T,children:r.jsx(Ho,{size:16})})}),r.jsx(rt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ko=!!D&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[St&&Object.entries(ws).map(([u,P])=>(Qe[u]??"")===""?r.jsx(Gc,{sources:P,template:M,paramName:u,sandboxRef:St,onFill:U=>ts(u,U)},`${ie}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(Gs.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:mr}),children:mr}),r.jsx(Gs.Toolbar.Right.Portal,{fallback:gr,children:gr})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:ko?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(Vr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Zn,onViewJsonFile:$}),T&&ct&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Wr,{ref:A,virtualMcpId:t,pageKey:ct,onClose:L},he.kind==="legacy"?void 0:JSON.stringify([Ls,xe]))})]}):r.jsxs(Rr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(is,{ref:E,id:"preview-blocks-editor",defaultSize:ye==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ye==="blocks"&&r.jsx(Vr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Zn,onViewJsonFile:$})}),ye==="blocks"&&r.jsx(Lr,{withHandle:!0}),r.jsx(is,{id:"preview-canvas",defaultSize:ye==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(Rr,{orientation:"horizontal",disabled:!(T&&ct),children:[r.jsx(is,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:u=>{if(!u)return;const P=()=>F(oe=>oe.width===u.clientWidth&&oe.height===u.clientHeight?oe:{width:u.clientWidth,height:u.clientHeight});P();const U=new ResizeObserver(P);return U.observe(u),()=>U.disconnect()},className:Re("h-full relative overflow-clip flex justify-center",Nt&&!as&&"bg-muted/30"),children:[(be||Ia)&&Nt&&r.jsx(si,{}),ne.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}),ne.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Bs,{kind:"starting",progress:Tn,claimPhase:Ss})}),!re&&Xe.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Bs,{kind:"suspended",onResume:Ie.resume})}),!re&&Xe.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Bs,{kind:"errored",error:Xe.error,onRetry:Ie.retry,connectionsHref:`/${de.slug}/settings/connections`})}),ne.showWakingPill&&r.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:[r.jsx(it,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ye==="visual"&&!b&&r.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:[r.jsx(xr,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ye==="visual"&&b&&r.jsx(pc,{element:b,onDismiss:()=>w(null)}),Nt&&et&&r.jsx("div",{className:Re("shrink-0",!as&&"bg-background shadow-edge"),style:wo,onMouseLeave:co,children:r.jsx("iframe",{ref:S,src:pt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Vn.handleError,onLoad:u=>{if($s(u.currentTarget),js(br),no(pt),Vn.handleLoad(),fe(),Rs.current=dt.current,_t&&Fs(Ot),ne.mode!=="sandbox"||re){(ne.mode==="production"&&!ne.showWakingPill||re)&&ye==="blocks"&&Ts();return}if(Lo("vm_preview_loaded",{view_mode:ye,vm_id:Ke?.sandboxHandle??null}),!j)try{const P=S.current?.contentWindow?.location?.pathname;if(!P)return;const U=Fe.current;if(U!==null&&(Fe.current=null,Ne(P)!==Ne(U))||Ne(P)===Ne(Te))return;X(P),Lt({path:P,pageKey:se,params:Qe})}catch{}ye==="visual"&&Qn(),ye==="blocks"&&Ts()}},ne.iframeBase)})]})}),T&&ct&&r.jsxs(r.Fragment,{children:[r.jsx(Lr,{withHandle:!0}),r.jsx(is,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Wr,{ref:A,virtualMcpId:t,pageKey:ct,onClose:L},he.kind==="legacy"?void 0:JSON.stringify([Ls,xe]))})]})]})})]})}),r.jsx(dd,{open:ee,onOpenChange:q,isPending:wn.isPending,error:K,templates:Ye,onSubmit:xo})]})}const Zs={app:null,split:!1};function eu(t){const e=le.c(24),{project:s,maxApps:n,children:o}=t,c=Se();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={silent:!0},e[0]=d):d=e[0];const i=Yo(d),a=bt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const g=l;let f;e[3]!==g.apps?(f=g.apps??[],e[3]=g.apps,e[4]=f):f=e[4];const p=f;let m;e[5]!==i.update||e[6]!==a||e[7]!==s.id||e[8]!==s.metadata||e[9]!==g||e[10]!==c?(m=b=>i.update.mutate({id:s.id,data:{metadata:{...Pl(s.metadata),runtime:{...g,apps:b.length?b:null}}}},{onSuccess:()=>a.start(),onError:()=>ms.error(c("sandbox.appTabs.saveError"))}),e[5]=i.update,e[6]=a,e[7]=s.id,e[8]=s.metadata,e[9]=g,e[10]=c,e[11]=m):m=e[11];const v=m,y=g.path??null;let h,x;e[12]!==p||e[13]!==v?(h=b=>v([...p,{path:b}]),x=b=>v(p.filter(w=>w.path!==b)),e[12]=p,e[13]=v,e[14]=h,e[15]=x):(h=e[14],x=e[15]);let C;return e[16]!==p||e[17]!==o||e[18]!==n||e[19]!==s.id||e[20]!==y||e[21]!==h||e[22]!==x?(C=r.jsx(tu,{virtualMcpId:s.id,mainPath:y,apps:p,maxApps:n,onAddApp:h,onRemoveApp:x,children:o}),e[16]=p,e[17]=o,e[18]=n,e[19]=s.id,e[20]=y,e[21]=h,e[22]=x,e[23]=C):C=e[23],C}function tu(t){const e=le.c(102),{virtualMcpId:s,mainPath:n,apps:o,maxApps:c,onAddApp:d,onRemoveApp:i,children:a}=t,l=Se(),g=pa(),{currentBranch:f}=lt(),p=bt(),m=hn().lifecycle.phase,v=Ut(s,f),{url:y}=ua(s);let h;e[0]!==v||e[1]!==y?(h=Ve(v)??y,e[0]=v,e[1]=y,e[2]=h):h=e[2];const x=h,C=x??p.previewUrl,b=!!x||m==="running",w=!b&&p.status==="errored";let N;e[3]!==p.vmEntry?.startedWith?.apps?(N=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=N):N=e[4];const k=N;let S;e[5]!==s?(S=qs.previewAppLayout(s),e[5]=s,e[6]=S):S=e[6];const[E,T]=Ws(S,su);let B;e[7]!==o||e[8]!==E?(B=o.some(fe=>fe.path===E.app)?E.app:null,e[7]=o,e[8]=E,e[9]=B):B=e[9];const A=B,L=A!==null&&E.split&&!g,$=A===null||L,_=A??o[0]?.path??null,[F,I]=R.useState(null),[J,W]=R.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{I(null),W(!1)},e[10]=Y):Y=e[10];const G=Y;let Q;e[11]!==o||e[12]!==F||e[13]!==g||e[14]!==n||e[15]!==d||e[16]!==T?(Q=()=>{if(F===null)return;const fe=_r(F);if(!fe){G();return}if(fe===_r(n??"")||o.some(de=>de.path===fe)){W(!0);return}d(fe),T({app:fe,split:!g}),G()},e[11]=o,e[12]=F,e[13]=g,e[14]=n,e[15]=d,e[16]=T,e[17]=Q):Q=e[17];const V=Q;let ee;e[18]!==n||e[19]!==l?(ee=n?Ms(n):l("sandbox.appTabs.root"),e[18]=n,e[19]=l,e[20]=ee):ee=e[20];const q=ee;let K;e[21]!==L||e[22]!==l?(K=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=K):K=e[23];const z=K;let j;e[24]!==l?(j=l("sandbox.appTabs.label"),e[24]=l,e[25]=j):j=e[25];let O;e[26]!==l?(O=l("sandbox.appTabs.main"),e[26]=l,e[27]=O):O=e[27];let D;e[28]!==l?(D=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=D):D=e[29];let H;e[30]!==T?(H=()=>T(Zs),e[30]=T,e[31]=H):H=e[31];let Z;e[32]!==w||e[33]!==q||e[34]!==b||e[35]!==$||e[36]!==O||e[37]!==D||e[38]!==H?(Z=r.jsx(Gr,{label:q,badge:O,hint:D,ready:b,failed:w,onScreen:$,onSelect:H}),e[32]=w,e[33]=q,e[34]=b,e[35]=$,e[36]=O,e[37]=D,e[38]=H,e[39]=Z):Z=e[39];let te;if(e[40]!==o||e[41]!==A||e[42]!==w||e[43]!==q||e[44]!==i||e[45]!==b||e[46]!==T||e[47]!==L||e[48]!==l){let fe;e[50]!==A||e[51]!==w||e[52]!==q||e[53]!==i||e[54]!==b||e[55]!==T||e[56]!==L||e[57]!==l?(fe=de=>{const Le=Ms(de.path);return r.jsx(Gr,{label:Le,hint:l("sandbox.appTabs.extraHint",{app:q}),ready:b,failed:w,onScreen:de.path===A,onSelect:()=>T({app:de.path,split:L}),onRemove:()=>i(de.path),removeLabel:l("sandbox.appTabs.remove",{app:Le})},de.path)},e[50]=A,e[51]=w,e[52]=q,e[53]=i,e[54]=b,e[55]=T,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],te=o.map(fe),e[40]=o,e[41]=A,e[42]=w,e[43]=q,e[44]=i,e[45]=b,e[46]=T,e[47]=L,e[48]=l,e[49]=te}else te=e[49];let M;e[59]!==Z||e[60]!==te||e[61]!==j?(M=r.jsxs("div",{role:"tablist","aria-label":j,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[Z,te]}),e[59]=Z,e[60]=te,e[61]=j,e[62]=M):M=e[62];let X;e[63]!==o.length||e[64]!==V||e[65]!==F||e[66]!==J||e[67]!==c||e[68]!==l?(X=F!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),V()},children:r.jsx("input",{autoFocus:!0,value:F,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":J,onChange:fe=>{I(fe.target.value),W(!1)},onBlur:G,onKeyDown:fe=>{fe.key==="Escape"&&G()},className:Re("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",J?"border-destructive":"border-border")})}):o.length<c&&r.jsx(vt,{label:l("sandbox.appTabs.add"),onClick:()=>I(""),children:r.jsx(sa,{})}),e[63]=o.length,e[64]=V,e[65]=F,e[66]=J,e[67]=c,e[68]=l,e[69]=X):X=e[69];let se;e[70]!==g||e[71]!==T||e[72]!==L||e[73]!==z||e[74]!==_?(se=!g&&_&&r.jsx(vt,{label:z,active:L,onClick:()=>T(L?Zs:{app:_,split:!0}),children:r.jsx(Go,{})}),e[70]=g,e[71]=T,e[72]=L,e[73]=z,e[74]=_,e[75]=se):se=e[75];let ae;e[76]!==M||e[77]!==X||e[78]!==se?(ae=r.jsxs(r.Fragment,{children:[M,X,se]}),e[76]=M,e[77]=X,e[78]=se,e[79]=ae):ae=e[79];const me=ae;let pe;e[80]!==me?(pe=r.jsx(Gs.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:me}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:me})}),e[80]=me,e[81]=pe):pe=e[81];let be;e[82]!==a||e[83]!==$?(be=$&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:a}),e[82]=a,e[83]=$,e[84]=be):be=e[84];let ge;e[85]!==A||e[86]!==w||e[87]!==p.start||e[88]!==x||e[89]!==q||e[90]!==C||e[91]!==b||e[92]!==T||e[93]!==L||e[94]!==k?(ge=A!==null&&r.jsx(nu,{name:Ms(A),mainName:q,appUrl:C?jl(C,A):null,ready:b,failed:w,notStarted:!x&&!k.includes(A),onStart:p.start,className:Re(L&&"border-l border-border"),onClose:L?()=>T({app:A,split:!1}):void 0},A),e[85]=A,e[86]=w,e[87]=p.start,e[88]=x,e[89]=q,e[90]=C,e[91]=b,e[92]=T,e[93]=L,e[94]=k,e[95]=ge):ge=e[95];let ve;e[96]!==be||e[97]!==ge?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[be,ge]}),e[96]=be,e[97]=ge,e[98]=ve):ve=e[98];let Pe;return e[99]!==pe||e[100]!==ve?(Pe=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Pe):Pe=e[101],Pe}function su(t){return t??Zs}function Gr(t){const e=le.c(28),{label:s,badge:n,hint:o,ready:c,failed:d,onScreen:i,onSelect:a,onRemove:l,removeLabel:g}=t,f=i?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let p;e[0]!==f?(p=Re("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",f),e[0]=f,e[1]=p):p=e[1];const m=c?"bg-success":d?"bg-destructive":"animate-pulse bg-warning";let v;e[2]!==m?(v=Re("size-1.5 rounded-full",m),e[2]=m,e[3]=v):v=e[3];let y;e[4]!==v?(y=r.jsx("span",{"aria-hidden":!0,className:v}),e[4]=v,e[5]=y):y=e[5];let h;e[6]!==s?(h=r.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=h):h=e[7];let x;e[8]!==n?(x=n&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:n}),e[8]=n,e[9]=x):x=e[9];let C;e[10]!==i||e[11]!==a||e[12]!==y||e[13]!==h||e[14]!==x?(C=r.jsx(nt,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:a,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[y,h,x]})}),e[10]=i,e[11]=a,e[12]=y,e[13]=h,e[14]=x,e[15]=C):C=e[15];let b;e[16]!==o?(b=r.jsx(rt,{className:"max-w-64",children:o}),e[16]=o,e[17]=b):b=e[17];let w;e[18]!==C||e[19]!==b?(w=r.jsxs(at,{children:[C,b]}),e[18]=C,e[19]=b,e[20]=w):w=e[20];let N;e[21]!==l||e[22]!==g?(N=l&&r.jsx("button",{type:"button","aria-label":g,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(ja,{className:"size-3"})}),e[21]=l,e[22]=g,e[23]=N):N=e[23];let k;return e[24]!==w||e[25]!==N||e[26]!==p?(k=r.jsxs("div",{className:p,children:[w,N]}),e[24]=w,e[25]=N,e[26]=p,e[27]=k):k=e[27],k}function nu(t){const e=le.c(71),{name:s,mainName:n,appUrl:o,ready:c,failed:d,notStarted:i,onStart:a,className:l,onClose:g}=t,f=Se(),[p,m]=R.useState("/"),[v,y]=R.useState("desktop"),[h,x]=R.useState(0),C=R.useRef(null);let b;e[0]!==o||e[1]!==p?(b=o?El(o,p):null,e[0]=o,e[1]=p,e[2]=b):b=e[2];const w=b;let N;e[3]!==l?(N=Re("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=N):N=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=D=>{D.preventDefault(),m(C.current?.value||"/")},e[5]=k):k=e[5];let S;e[6]!==s||e[7]!==f?(S=f("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=f,e[8]=S):S=e[8];let E;e[9]!==p||e[10]!==S?(E=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:k,children:r.jsx("input",{ref:C,defaultValue:p,"aria-label":S,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=p,e[10]=S,e[11]=E):E=e[11];let T;e[12]!==v||e[13]!==f?(T=f(v==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=v,e[13]=f,e[14]=T):T=e[14];let B;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=()=>y(au),e[15]=B):B=e[15];let A;e[16]!==v?(A=v==="desktop"?r.jsx(ta,{}):r.jsx(ea,{}),e[16]=v,e[17]=A):A=e[17];let L;e[18]!==T||e[19]!==A?(L=r.jsx(vt,{label:T,onClick:B,children:A}),e[18]=T,e[19]=A,e[20]=L):L=e[20];let $;e[21]!==s||e[22]!==f?($=f("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=f,e[23]=$):$=e[23];const _=!w||!c;let F,I;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>x(ru),I=r.jsx(Ao,{}),e[24]=F,e[25]=I):(F=e[24],I=e[25]);let J;e[26]!==$||e[27]!==_?(J=r.jsx(vt,{label:$,disabled:_,onClick:F,children:I}),e[26]=$,e[27]=_,e[28]=J):J=e[28];let W;e[29]!==s||e[30]!==f?(W=f("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=f,e[31]=W):W=e[31];const Y=!w||!c;let G;e[32]!==w?(G=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=G):G=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(Qr,{}),e[34]=Q):Q=e[34];let V;e[35]!==W||e[36]!==Y||e[37]!==G?(V=r.jsx(vt,{label:W,disabled:Y,onClick:G,children:Q}),e[35]=W,e[36]=Y,e[37]=G,e[38]=V):V=e[38];let ee;e[39]!==s||e[40]!==g||e[41]!==f?(ee=g&&r.jsx(vt,{label:f("sandbox.appPane.close",{app:s}),onClick:g,children:r.jsx(ja,{})}),e[39]=s,e[40]=g,e[41]=f,e[42]=ee):ee=e[42];let q;e[43]!==J||e[44]!==V||e[45]!==ee||e[46]!==E||e[47]!==L?(q=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[E,L,J,V,ee]}),e[43]=J,e[44]=V,e[45]=ee,e[46]=E,e[47]=L,e[48]=q):q=e[48];let K;e[49]!==n||e[50]!==f?(K=f("sandbox.appPane.previewOnly",{app:n}),e[49]=n,e[50]=f,e[51]=K):K=e[51];let z;e[52]!==K?(z=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:K}),e[52]=K,e[53]=z):z=e[53];let j;e[54]!==v||e[55]!==d||e[56]!==n||e[57]!==s||e[58]!==i||e[59]!==a||e[60]!==c||e[61]!==h||e[62]!==w||e[63]!==f?(j=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:c&&i?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:f("sandbox.appPane.notStarted",{app:s})}),r.jsx(_e,{size:"sm",variant:"outline",onClick:a,children:f("sandbox.appPane.start",{app:s})})]}):!c||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:c?f("sandbox.appPane.noUrl"):d?f("sandbox.appPane.failed",{app:n}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:s,className:Re("h-full bg-background",v==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=v,e[55]=d,e[56]=n,e[57]=s,e[58]=i,e[59]=a,e[60]=c,e[61]=h,e[62]=w,e[63]=f,e[64]=j):j=e[64];let O;return e[65]!==s||e[66]!==N||e[67]!==q||e[68]!==z||e[69]!==j?(O=r.jsxs("section",{"aria-label":s,className:N,children:[q,z,j]}),e[65]=s,e[66]=N,e[67]=q,e[68]=z,e[69]=j,e[70]=O):O=e[70],O}function ru(t){return t+1}function au(t){return t==="desktop"?"mobile":"desktop"}function vt(t){const e=le.c(11),{label:s,children:n,active:o,disabled:c,onClick:d}=t;let i;e[0]!==o||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==d?(i=r.jsx(nt,{asChild:!0,children:r.jsx(st,{"aria-label":s,"aria-pressed":o,active:o,disabled:c,onClick:d,children:n})}),e[0]=o,e[1]=n,e[2]=c,e[3]=s,e[4]=d,e[5]=i):i=e[5];let a;e[6]!==s?(a=r.jsx(rt,{children:s}),e[6]=s,e[7]=a):a=e[7];let l;return e[8]!==i||e[9]!==a?(l=r.jsxs(at,{children:[i,a]}),e[8]=i,e[9]=a,e[10]=l):l=e[10],l}const ou=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},iu=1e4,lu=1e4,cu=5e3,du=2;function uu(t,e){return t&&e===0?lu:Math.min(1e3*2**Math.max(0,e-1),cu)}function fu(t,e,s){return e?!0:t===!0&&s<du}function pu(t,e){const s=le.c(11),n=ou,o=Oo();let c;s[0]!==t?(c=sn.localAppReachable(t??""),s[0]=t,s[1]=c):c=s[1];const d=c;let i;s[2]!==n||s[3]!==o||s[4]!==d||s[5]!==t?(i=async f=>{const{signal:p}=f,m=new AbortController,v=()=>m.abort();p.addEventListener("abort",v);const y=setTimeout(v,iu),h=await n(t,m.signal).catch(hu);clearTimeout(y),p.removeEventListener("abort",v);const x=o.getQueryData(d),C=h?0:(x?.failures??0)+1;return{up:fu(x?.up??null,h,C),failures:C}},s[2]=n,s[3]=o,s[4]=d,s[5]=t,s[6]=i):i=s[6];const a=!!t;let l;s[7]!==d||s[8]!==i||s[9]!==a?(l={queryKey:d,queryFn:i,enabled:a,retry:!1,staleTime:0,gcTime:0,refetchInterval:mu},s[7]=d,s[8]=i,s[9]=a,s[10]=l):l=s[10];const{data:g}=Yr(l);return t?g?.up??null:null}function mu(t){return t.state.data?uu(t.state.data.up,t.state.data.failures):!1}function hu(){return!1}function gu(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const s=e.problem;return!s||s.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:s}}return{kind:"connecting"}}function jf(t){const e=le.c(53),{virtualMcpId:s}=t,n=Se(),o=Qo(s),{connection:c}=fa(s),{activeTask:d,taskId:i,currentBranch:a}=lt(),l=_l(i),[g,f]=R.useState(!1),p=Ut(s,a);let m;e[0]!==p||e[1]!==c?(m=c?Ve(p):null,e[0]=p,e[1]=c,e[2]=m):m=e[2];const v=m,y=pu(v),h=Na(),x=Nl("multi_app_preview");if(Rl({threadId:i,sandboxBranch:d?.branch??a,agentHasRepo:zs(o?.metadata),threadHasRepo:zs(l)||zs(d?.metadata)})==="none"&&!c){let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx($r,{className:"size-7 text-foreground"})}),e[3]=k):k=e[3];let S;e[4]!==n?(S=n("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=n,e[5]=S):S=e[5];let E;e[6]!==n?(E=n("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=n,e[7]=E):E=e[7];let T,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>f(!0),B=r.jsx($r,{className:"size-4"}),e[8]=T,e[9]=B):(T=e[8],B=e[9]);let A;e[10]!==n?(A=n("mainPanelTabs.previewTab.connectGithub"),e[10]=n,e[11]=A):A=e[11];let L;e[12]!==A?(L=r.jsxs(_e,{onClick:T,children:[B,A]}),e[12]=A,e[13]=L):L=e[13];let $;e[14]!==S||e[15]!==E||e[16]!==L?($=r.jsx(Cl,{className:"h-full",image:k,title:S,description:E,actions:L}),e[14]=S,e[15]=E,e[16]=L,e[17]=$):$=e[17];let _;e[18]!==g?(_=r.jsx(Tl,{open:g,onOpenChange:f,mode:"agent"}),e[18]=g,e[19]=_):_=e[19];let F;return e[20]!==_||e[21]!==$?(F=r.jsxs(r.Fragment,{children:[$,_]}),e[20]=_,e[21]=$,e[22]=F):F=e[22],F}if(c&&o&&!Ve(p)){let k;e[23]!==h||e[24]!==p?(k=gu({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=k):k=e[25];let S;e[26]!==c.endpoint?(S=Ni(c.endpoint),e[26]=c.endpoint,e[27]=S):S=e[27];let E;return e[28]!==k||e[29]!==S?(E=r.jsx(xu,{status:k,host:S}),e[28]=k,e[29]=S,e[30]=E):E=e[30],E}if(v&&y!==!0){let k;e[31]!==n?(k=n("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=n,e[32]=k):k=e[32];let S;e[33]!==v||e[34]!==n?(S=n("mainPanelTabs.previewTab.localAppWaiting.body",{host:vu(v)}),e[33]=v,e[34]=n,e[35]=S):S=e[35];let E;e[36]!==S?(E=r.jsx(Pa,{text:S}),e[36]=S,e[37]=E):E=e[37];let T;e[38]!==n?(T=n("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=n,e[39]=T):T=e[39];let B;e[40]!==T?(B=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=B):B=e[41];let A;return e[42]!==k||e[43]!==E||e[44]!==B?(A=r.jsx(hs,{headingLevel:2,waiting:!0,title:k,lead:E,footer:B}),e[42]=k,e[43]=E,e[44]=B,e[45]=A):A=e[45],A}let b;e[46]!==s?(b=r.jsx(Zd,{virtualMcpId:s}),e[46]=s,e[47]=b):b=e[47];const w=b;let N;return e[48]!==o||e[49]!==x||e[50]!==w||e[51]!==c?(N=r.jsx(_o,{children:x&&o&&!c?r.jsx(eu,{project:o,maxApps:kl,children:w}):w}),e[48]=o,e[49]=x,e[50]=w,e[51]=c,e[52]=N):N=e[52],N}function vu(t){try{return new URL(t).host}catch{return t}}function xu(t){const e=le.c(13),{status:s,host:n}=t,o=Se();if(s.kind==="connected"){let i;e[0]!==o?(i=o("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=o,e[3]=a):a=e[3];let l;return e[4]!==i||e[5]!==a?(l=r.jsx(hs,{headingLevel:2,waiting:!1,title:i,lead:a}),e[4]=i,e[5]=a,e[6]=l):l=e[6],l}let c;e[7]!==n||e[8]!==s?(c=Ml(s,n),e[7]=n,e[8]=s,e[9]=c):c=e[9];let d;return e[10]!==n||e[11]!==c?(d=r.jsx(Bl,{wait:c,hosts:n}),e[10]=n,e[11]=c,e[12]=d):d=e[12],d}export{Bl as L,jf as P,hs as S,Pf as u};
557
+ `)}function fc(t,e,s=320,n=44,o=12){const{x:c,y:d}=t,{width:i,height:a}=e,l=Math.max(o,Math.min(c-s/2,i-s-o)),f=d/a>.68?Math.max(o,d-n-18):Math.min(d+18,a-n-o);return{leftPct:l/i*100,topPct:f/a*100}}function pc(t){const e=le.c(45),{element:s,onDismiss:n}=t,[o,c]=R.useState(""),d=R.useRef(null),{sendMessage:i}=$o(),{openSidePanel:a}=el(),l=Se();let g;e[0]!==s||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==i?(g=()=>{if(!o.trim())return;const I=uc(s,o);a(),i({parts:[{type:"text",text:I}]}),n()},e[0]=s,e[1]=o,e[2]=n,e[3]=a,e[4]=i,e[5]=g):g=e[5];const f=g;let p;e[6]!==s.position||e[7]!==s.viewport?(p=fc(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=p):p=e[8];const m=p,v=`${m.leftPct}%`,y=`${m.topPct}%`;let h;e[9]!==v||e[10]!==y?(h={left:v,top:y,width:"320px"},e[9]=v,e[10]=y,e[11]=h):h=e[11];let x;e[12]!==f?(x=I=>{I.preventDefault(),f()},e[12]=f,e[13]=x):x=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=I=>c(I.target.value),e[14]=C):C=e[14];let b;e[15]!==n?(b=I=>{I.key==="Escape"&&n()},e[15]=n,e[16]=b):b=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let N;e[19]!==o||e[20]!==b||e[21]!==w?(N=r.jsx("input",{ref:d,autoFocus:!0,type:"text",value:o,onChange:C,onKeyDown:b,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=o,e[20]=b,e[21]=w,e[22]=N):N=e[22];let k;e[23]!==o?(k=o.trim(),e[23]=o,e[24]=k):k=e[24];const S=!k;let E;e[25]!==l?(E=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=E):E=e[26];let T;e[27]!==l?(T=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=T):T=e[28];let B;e[29]!==T?(B=r.jsx("title",{children:T}),e[29]=T,e[30]=B):B=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=A):A=e[31];let L;e[32]!==B?(L=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[B,A]}),e[32]=B,e[33]=L):L=e[33];let $;e[34]!==S||e[35]!==E||e[36]!==L?($=r.jsx("button",{type:"submit",disabled:S,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:E,children:L}),e[34]=S,e[35]=E,e[36]=L,e[37]=$):$=e[37];let _;e[38]!==N||e[39]!==$||e[40]!==x?(_=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:x,children:[N,$]}),e[38]=N,e[39]=$,e[40]=x,e[41]=_):_=e[41];let F;return e[42]!==_||e[43]!==h?(F=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:_}),e[42]=_,e[43]=h,e[44]=F):F=e[44],F}const zr="site-links",mc=/details?page|\bpdp\b/i,hc=/listingpage|\bplp\b/i;function gc(t,e,s){const n=new Set;for(const i of s)mc.test(i)&&n.add("product"),hc.test(i)&&n.add("category");const o=xt(pn(t)),c=o[o.length-1],d=o[o.length-2];return c?.type==="text"&&c.text==="/p"&&d?.type==="param"&&d.name===e&&n.add("product"),e==="*"&&o.some(i=>i.type==="param"&&i.name==="*")&&n.add("category"),n}const vc=["rosa","preto","pink","black"];function cs(t,e){const s=e.trim();return s?t(s):vc.flatMap(n=>t(n))}function xc(t,e){const s=e.trim(),n=[];/^\d+$/.test(s)&&n.push({resolveType:t,props:{ids:[s]}});const c=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return n.push({resolveType:t,props:{query:c,count:10}}),n}const Ca=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function gn(t){return t.split("/")[0]??""}function bc(t){const e=new Set;for(const s of t){const n=gn(s);Ca.has(n)&&e.add(n)}return e}function yc(t,e){const s=gn(t);return!Ca.has(s)||e.size===0?!0:e.has(s)}const wc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>cs(s=>xc(t,s),e),optionsFromPayload:ds},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:ds},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:ds},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:ds},{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:Cc}];function kc(t,e,s=new Set){const n=[...e],o=i=>{const a=[];for(const l of wc){if(l.kind!==i)continue;const g=n.find(f=>l.test(f)&&yc(f,s));g&&a.push({cand:l,resolveType:g})}return a.find(l=>s.has(gn(l.resolveType)))??a[0]},c=(i,a,l)=>({kind:i.kind,id:`${i.kind}:${a}`,resolveType:a,clientFilter:i.clientFilter,isFallback:l,buildRequests:g=>i.buildRequests(a,g),optionsFromPayload:i.optionsFromPayload}),d=[];for(const i of["product","category"]){if(!t.has(i))continue;const a=o(i);a&&d.push(c(a.cand,a.resolveType,!1))}return t.size>0&&d.push(Sc(t.has("category")?"category":"product")),d}function Sc(t){return{kind:t,id:zr,resolveType:zr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Oc(e,s)}}function ot(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Pc(t,e,s){const n=new Set,o=new Set,c=d=>{if(Array.isArray(d)){for(const l of d)c(l);return}const i=ot(d);if(!i)return;const a=i.__resolveType;if(typeof a=="string"){if(s(a))n.add(a);else if(a in e&&!o.has(a)){o.add(a);const l=ot(e[a])?.__resolveType;typeof l=="string"&&s(l)&&n.add(a),c(e[a])}}for(const l of Object.values(i))c(l)};return c(t),n}function Ta(t){const e=new Set,s=[];for(const n of t)for(const o of n)e.has(o.value)||(e.add(o.value),s.push(o));return s}function Ra(t){try{return decodeURIComponent(t)}catch{return t}}function jc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ec(t){const e=[];let s="^";for(const n of t)n.type==="text"?s+=jc(n.text):(e.push(n.name),s+=n.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function vn(t,e,s){if(typeof t!="string"||!t)return null;let n;try{n=new URL(t,"https://placeholder.invalid").pathname}catch{return null}n=n.replace(/\/+$/,"");const o=xt(pn(e)),{pattern:c,order:d}=Ec(o),i=d.indexOf(s);if(i===-1)return null;const a=n.match(c);if(!a)return null;const l=a[i+1]?.replace(/^\/+|\/+$/g,"");return l?Ra(l):null}function ds(t,e){const s=ot(t),n=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],o=[],c=new Set;for(const d of n){const i=ot(d);if(!i)continue;const a=vn(i.url,e.template,e.paramName);if(!a||c.has(a))continue;c.add(a);const l=ot(i.isVariantOf),g=typeof l?.name=="string"&&l.name||typeof i.name=="string"&&i.name||a,f=Array.isArray(i.image)?ot(i.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;o.push({value:a,label:g,image:p})}return o}function Nc(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const s=e.replace(/^\/+|\/+$/g,"");return s?Ra(s):null}function Cc(t){const e=[],s=new Set,n=(o,c)=>{const d=ot(o);if(!d)return;const i=typeof d.name=="string"&&d.name?d.name:"",a=i?[...c,i]:c,l=Nc(d.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:a.join(" › ")||l})),Array.isArray(d.children))for(const g of d.children)n(g,a)};if(Array.isArray(t))for(const o of t)n(o,[]);return e}const Tc=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 Rc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function Lc(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let n,o=0;for(;(n=s.exec(t))!==null&&o++<5e3;){const c=n[1]??"",d=(n[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:c,text:d})}return e}function Ac(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,n=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,o=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let c,d=0;for(;(c=n.exec(t))!==null&&d++<3e3;){const i=(c[1]??"").replace(/\\\//g,"/");if(!i||s.has(i))continue;s.add(i);const a=t.slice(c.index,c.index+900).match(o)?.[1]?.replace(/\\\//g,"/");e.push({url:i,name:c[2]??"",image:a||void 0})}return e}function Oc(t,e){const s=[],n=new Set,o=(c,d,i,a)=>{if(s.length>=200)return;const l=vn(c,e.template,e.paramName);!l||n.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||i==="category"&&Tc.has(l.split("/")[0]??"")||(n.add(l),s.push({value:l,label:d&&d.length<=80?d:Rc(l),kind:i,image:a}))};for(const{url:c,name:d,image:i}of Ac(t))o(c,d,"product",i);for(const{href:c,text:d}of Lc(t))c.startsWith("/")&&!c.startsWith("//")&&o(c,d,"category");return s}function zt(t,e,s=50){const n=e.trim().toLowerCase();return(n?t.filter(c=>c.label.toLowerCase().includes(n)||c.value.toLowerCase().includes(n)):t).slice(0,s)}const La=1e4;function _c(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 $c(t,{resolveType:e,props:s}){const n=await fetch(li(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(La)});if(!n.ok)throw new Error(`Failed to fetch options: ${n.status}`);return n.json()}async function Ir(t,e){const s=await fetch(ci(t,e),{signal:AbortSignal.timeout(La)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Fc(t,e,s){const n=e.optionsFromPayload(await Ir(t,"/"),s),o=n.find(d=>d.kind==="category");if(!o)return n;const c=Be(s.template,{[s.paramName]:o.value});if(c==="/")return n;try{const d=e.optionsFromPayload(await Ir(t,c),s).filter(i=>i.kind==="product");return Ta([n,d])}catch{return n}}function Dc(t,e,s){return sn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function Bc(t,e,s,n){if(e.homepageLinks)return Fc(t,e,n);const o=e.buildRequests?.(s)??[];if(o.length===0)return[];const c=await Promise.allSettled(o.map(i=>$c(t,i))),d=c.filter(i=>i.status==="fulfilled").map(i=>i.value);if(d.length===0){const i=c.find(a=>a.status==="rejected");throw i?i.reason:new Error("Failed to fetch options")}return Ta(d.map(i=>e.optionsFromPayload(i,n)))}function Xs(t,e,s,n,o){return{queryKey:Dc(t,e,s),queryFn:()=>Bc(t,e,s,n),enabled:o,staleTime:6e4,retry:1}}function It(t){const e=le.c(16),{heading:s,iconKind:n,options:o,template:c,paramName:d,keyPrefix:i,onSelect:a}=t;if(o.length===0)return null;let l;if(e[0]!==n||e[1]!==i||e[2]!==a||e[3]!==o||e[4]!==d||e[5]!==c){let f;e[7]!==n||e[8]!==i||e[9]!==a||e[10]!==d||e[11]!==c?(f=p=>r.jsxs(qe,{value:`${i}:${p.value}`,className:"gap-3 py-2",onSelect:()=>a(p.value),children:[n==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.image?r.jsx("img",{src:p.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(on,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:p.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Be(c,{[d]:p.value})})]})]},`${i}:${p.value}`),e[7]=n,e[8]=i,e[9]=a,e[10]=d,e[11]=c,e[12]=f):f=e[12],l=o.map(f),e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=d,e[5]=c,e[6]=l}else l=e[6];let g;return e[13]!==s||e[14]!==l?(g=r.jsx(We,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=g):g=e[15],g}function Kr(t){const e=le.c(2),{text:s}=t;let n;return e[0]!==s?(n=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Mc(t){const e=le.c(52),{sources:s,template:n,paramName:o,value:c,sandboxRef:d,onCommit:i}=t,a=Se(),[l,g]=R.useState(!1),[f,p]=R.useState(""),[m,v]=R.useState(""),y=R.useRef(null),h=o==="*"?a("sandbox.preview.catchAllParamLabel"):`:${o}`,x=_c(a),b=[...new Set(s.map(re=>x[re.kind].noun))].join(" or ");let w;e[0]!==a||e[1]!==b?(w=a("sandbox.pathParamPickerChip.searchPlaceholder",{options:b}),e[0]=a,e[1]=b,e[2]=w):w=e[2];const N=w,k={template:n,paramName:o};let S;e[3]!==f?(S=(re,ue)=>({source:re,query:ue,options:re.clientFilter?zt(ue.data??[],f):ue.data??[]}),e[3]=f,e[4]=S):S=e[4];const E=S,T=s.filter(qc),B=s.filter(Wc),A=Js({queries:T.map(re=>Xs(d,re,m,k,l))});let L;e[5]!==A||e[6]!==E?(L=(re,ue)=>E(re,A[ue]),e[5]=A,e[6]=E,e[7]=L):L=e[7];const $=T.map(L),_=$.length===0||$.every(Vc),F=Js({queries:B.map(re=>Xs(d,re,m,k,l&&_))});let I;e[8]!==F||e[9]!==E?(I=(re,ue)=>E(re,F[ue]),e[8]=F,e[9]=E,e[10]=I):I=e[10];const J=B.map(I),W=_?J:$,Y=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,Q=Y&&!Y.query.isLoading&&!Y.query.isError?Y?.query.data??[]:[],V=zt(Q.filter(Hc),f),ee=zt(Q.filter(Uc),f),q=V.length>0&&ee.length>0,K=re=>{g(re),y.current&&clearTimeout(y.current),p(re?c:""),v(re?c:"")};let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=re=>{p(re),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{v(re)},300)},e[11]=z):z=e[11];const j=z,O=re=>{i(re),K(!1)},D=mn(f),H=Be(n,{[o]:D}),Z=tn,te=en,M="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",X=Kc;let se;e[12]!==h||e[13]!==a?(se=a("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=a,e[14]=se):se=e[14];let ae;e[15]!==se?(ae=r.jsx(nn,{className:"sr-only",children:r.jsx(rn,{children:se})}),e[15]=se,e[16]=ae):ae=e[16];let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=r.jsx(on,{size:16,className:"shrink-0 text-foreground"}),e[17]=me):me=e[17];let pe;e[18]!==a?(pe=a("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=a,e[19]=pe):pe=e[19];let be;e[20]!==h?(be=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=be):be=e[21];let ge;e[22]!==pe||e[23]!==be?(ge=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[me,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",be]})]}),e[22]=pe,e[23]=be,e[24]=ge):ge=e[24];const ve=cn,Pe=!1,fe="min-h-0 flex-1";let de;e[25]!==N||e[26]!==f?(de=r.jsx(dn,{autoFocus:!0,placeholder:N,value:f,onValueChange:j}),e[25]=N,e[26]=f,e[27]=de):de=e[27];const Le=ln,Ie="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ke;e[28]!==a?(Ke=a("sandbox.pathParamPickerChip.noResults"),e[28]=a,e[29]=Ke):Ke=e[29];let Me;e[30]!==Ke?(Me=r.jsx(un,{children:Ke}),e[30]=Ke,e[31]=Me):Me=e[31];const yt=D&&r.jsx(We,{className:"shrink-0",children:r.jsxs(qe,{value:`__raw__:${D}`,className:"gap-3 py-2",onSelect:()=>O(D),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(ga,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:a("sandbox.pathParamPickerChip.useRawValue",{rawTerm:D,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:H})]})]})}),he=q?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(It,{heading:x.category.heading,iconKind:"category",options:V,template:n,paramName:o,keyPrefix:`${Y?.source.id}:cat`,onSelect:O})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(It,{heading:x.product.heading,iconKind:"product",options:ee,template:n,paramName:o,keyPrefix:`${Y?.source.id}:prod`,onSelect:O})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(re=>{const{source:ue,query:Ge,options:wt}=re,{noun:Je}=x[ue.kind];if(Ge.isLoading)return r.jsx(Kr,{text:a("sandbox.pathParamPickerChip.loading",{noun:Je})},ue.id);if(Ge.isError)return r.jsx(Kr,{text:a("sandbox.pathParamPickerChip.couldNotLoad")},ue.id);if(ue.homepageLinks){const Ht=Ge.data??[];return r.jsxs(R.Fragment,{children:[r.jsx(It,{heading:x.category.heading,iconKind:"category",options:zt(Ht.filter(Ic),f),template:n,paramName:o,keyPrefix:`${ue.id}:cat`,onSelect:O}),r.jsx(It,{heading:x.product.heading,iconKind:"product",options:zt(Ht.filter(zc),f),template:n,paramName:o,keyPrefix:`${ue.id}:prod`,onSelect:O})]},ue.id)}return r.jsx(It,{heading:W.length>1?x[ue.kind].heading:void 0,iconKind:ue.kind,options:wt,template:n,paramName:o,keyPrefix:ue.id,onSelect:O},ue.id)})});let $e;e[32]!==Le||e[33]!==Me||e[34]!==yt||e[35]!==he?($e=r.jsxs(Le,{className:Ie,children:[Me,yt,he]}),e[32]=Le,e[33]=Me,e[34]=yt,e[35]=he,e[36]=$e):$e=e[36];let xe;e[37]!==ve||e[38]!==de||e[39]!==$e?(xe=r.jsxs(ve,{shouldFilter:Pe,className:fe,children:[de,$e]}),e[37]=ve,e[38]=de,e[39]=$e,e[40]=xe):xe=e[40];let Ue;e[41]!==te||e[42]!==ae||e[43]!==ge||e[44]!==xe||e[45]!==X?(Ue=r.jsxs(te,{className:M,onClick:X,children:[ae,ge,xe]}),e[41]=te,e[42]=ae,e[43]=ge,e[44]=xe,e[45]=X,e[46]=Ue):Ue=e[46];let Ae;return e[47]!==Z||e[48]!==K||e[49]!==l||e[50]!==Ue?(Ae=r.jsx(Z,{open:l,onOpenChange:K,children:Ue}),e[47]=Z,e[48]=K,e[49]=l,e[50]=Ue,e[51]=Ae):Ae=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:a("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),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:re=>{re.stopPropagation(),K(!0)},children:c||h}),Ae]})}function zc(t){return t.kind==="product"}function Ic(t){return t.kind!=="product"}function Kc(t){return t.stopPropagation()}function Uc(t){return t.kind==="product"}function Hc(t){return t.kind!=="product"}function Vc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Wc(t){return t.isFallback}function qc(t){return!t.isFallback}function Gc(t){const e=le.c(8),{sources:s,template:n,paramName:o,sandboxRef:c,onFill:d}=t;let i,a;if(e[0]!==o||e[1]!==c||e[2]!==s||e[3]!==n){const m={template:n,paramName:o},v=s.filter(Jc);a=Js,i=v.map(y=>Xs(c,y,"",m,!0)),e[0]=o,e[1]=c,e[2]=s,e[3]=n,e[4]=i,e[5]=a}else i=e[4],a=e[5];let l;e[6]!==i?(l={queries:i},e[6]=i,e[7]=l):l=e[7];const g=a(l),[f,p]=R.useState(!1);if(!f)for(const m of g){if(m.isLoading)break;const v=m.data?.[0];if(v){p(!0),queueMicrotask(()=>d(v.value));break}}return null}function Jc(t){return!t.isFallback}function Yc(t){const e=le.c(31),{name:s,value:n,onCommit:o}=t,c=Se(),[d,i]=R.useState(n),[a,l]=R.useState(!1),g=R.useRef(!1);let f;e[0]!==s||e[1]!==c?(f=s==="*"?c("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=c,e[2]=f):f=e[2];const p=f,m=d||p;let v;e[3]!==m?(v=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:m}),e[3]=m,e[4]=v):v=e[4];let y;e[5]!==p||e[6]!==c?(y=c("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=c,e[7]=y):y=e[7];let h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=E=>i(E.target.value),x=()=>l(!0),e[8]=h,e[9]=x):(h=e[8],x=e[9]);let C;e[10]!==n?(C=E=>{E.key==="Enter"&&E.currentTarget.blur(),E.key==="Escape"&&(g.current=!0,i(n),E.currentTarget.blur())},e[10]=n,e[11]=C):C=e[11];let b;e[12]!==d||e[13]!==o||e[14]!==n?(b=()=>{if(l(!1),g.current){g.current=!1;return}const E=mn(d);i(E),E!==n&&o(E)},e[12]=d,e[13]=o,e[14]=n,e[15]=b):b=e[15];let w;e[16]!==d||e[17]!==p||e[18]!==y||e[19]!==C||e[20]!==b?(w=r.jsx("input",{type:"text",value:d,placeholder:p,title:y,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:Qc,onChange:h,onFocus:x,onKeyDown:C,onBlur:b}),e[16]=d,e[17]=p,e[18]=y,e[19]=C,e[20]=b,e[21]=w):w=e[21];let N;e[22]!==v||e[23]!==w?(N=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,w]}),e[22]=v,e[23]=w,e[24]=N):N=e[24];let k;e[25]!==a||e[26]!==c?(k=a&&r.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:[r.jsx(Ko,{size:10}),c("sandbox.preview.enterToGo")]}),e[25]=a,e[26]=c,e[27]=k):k=e[27];let S;return e[28]!==k||e[29]!==N?(S=r.jsxs(r.Fragment,{children:[N,k]}),e[28]=k,e[29]=N,e[30]=S):S=e[30],S}function Qc(t){return t.stopPropagation()}const Xc=/^(?:autor|author|authorSlug)$/;function Ur(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}const us=t=>typeof t=="string"?t:"";function Zc(t,e,s,n=new Date().toISOString().slice(0,10)){const o=Ti(e),[c]=xt(e);if(o.length===0||o.includes("*")||c?.type!=="text"||c.text==="/")return[];const d=sl(t),i=m=>d[m].map(v=>({label:v.label,data:Ur(Ur(t[v.key])[rl[m]])})),a=[],l=i("posts").filter(({data:m})=>nl(m)==="published"&&us(m.date).slice(0,10)<=n).sort((m,v)=>us(v.data.date).localeCompare(us(m.data.date)));for(const{label:m,data:v}of l)a.push({label:m,path:ol(t,v,s)});for(const{label:m,data:v}of i("categories"))a.push({label:m,path:il(t,v,s)});const g=o.find(m=>Xc.test(m));if(g)for(const{label:m,data:v}of i("authors")){const y=us(v.slug);a.push({label:m,path:y?Be(e,{[g]:y}):null})}const f=[],p=new Set;for(const{label:m,path:v}of a){if(!v)continue;const y={};for(const x of o){const C=vn(v,e,x);if(!C)break;y[x]=C}if(Object.keys(y).length!==o.length)continue;const h=Be(e,y);p.has(h)||(p.add(h),f.push({label:m,values:y}))}return f}function ed(t){const e=le.c(96),{paramName:s,template:n,value:o,options:c,onPick:d,onCommit:i}=t,a=Se(),[l,g]=R.useState(!1),[f,p]=R.useState(""),m=`:${s}`;let v;if(e[0]!==c||e[1]!==f){const K=f.trim().toLowerCase();v=K?c.filter(z=>z.label.toLowerCase().includes(K)||Object.values(z.values).some(j=>j.toLowerCase().includes(K))):c,e[0]=c,e[1]=f,e[2]=v}else v=e[2];const y=v;let h,x,C,b,w,N,k,S,E,T,B,A,L,$,_,F,I,J;if(e[3]!==i||e[4]!==l||e[5]!==m||e[6]!==f||e[7]!==a||e[8]!==o){const K=mn(f);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{g(!1),p("")},e[27]=z):z=e[27],w=z;let j;e[28]!==m||e[29]!==a?(j=a("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:m}),e[28]=m,e[29]=a,e[30]=j):j=e[30];let O;e[31]===Symbol.for("react.memo_cache_sentinel")?(O=ae=>{ae.stopPropagation(),g(!0)},e[31]=O):O=e[31];const D=o||m;e[32]!==j||e[33]!==D?(T=r.jsx("button",{type:"button",title:j,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:O,children:D}),e[32]=j,e[33]=D,e[34]=T):T=e[34],b=tn,S=l,e[35]===Symbol.for("react.memo_cache_sentinel")?(E=ae=>ae?g(!0):w(),e[35]=E):E=e[35],C=en,I="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",J=td;let H;e[36]!==m||e[37]!==a?(H=a("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:m}),e[36]=m,e[37]=a,e[38]=H):H=e[38],e[39]!==H?(N=r.jsx(nn,{className:"sr-only",children:r.jsx(rn,{children:H})}),e[39]=H,e[40]=N):N=e[40];let Z;e[41]===Symbol.for("react.memo_cache_sentinel")?(Z=r.jsx(on,{size:16,className:"shrink-0 text-foreground"}),e[41]=Z):Z=e[41];let te;e[42]!==a?(te=a("sandbox.pathParamPickerChip.pickValueHeading"),e[42]=a,e[43]=te):te=e[43];let M;e[44]!==m?(M=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:m}),e[44]=m,e[45]=M):M=e[45],e[46]!==te||e[47]!==M?(k=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[Z,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[te," ",M]})]}),e[46]=te,e[47]=M,e[48]=k):k=e[48],x=cn,$=!1,_="min-h-0 flex-1";let X;e[49]!==a?(X=a("sandbox.pathParamPickerChip.searchBlogPlaceholder"),e[49]=a,e[50]=X):X=e[50],e[51]!==f||e[52]!==X?(F=r.jsx(dn,{autoFocus:!0,placeholder:X,value:f,onValueChange:p}),e[51]=f,e[52]=X,e[53]=F):F=e[53],h=ln,B="max-h-none min-h-0 flex-1 overflow-y-auto";let se;e[54]!==a?(se=a("sandbox.pathParamPickerChip.noResults"),e[54]=a,e[55]=se):se=e[55],e[56]!==se?(A=r.jsx(un,{children:se}),e[56]=se,e[57]=A):A=e[57],L=K&&r.jsx(We,{children:r.jsxs(qe,{value:`__raw__:${K}`,className:"gap-3 py-2",onSelect:()=>{i(K),w()},children:[r.jsx(ga,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:a("sandbox.pathParamPickerChip.useRawValue",{rawTerm:K,paramLabel:m})})]})}),e[3]=i,e[4]=l,e[5]=m,e[6]=f,e[7]=a,e[8]=o,e[9]=h,e[10]=x,e[11]=C,e[12]=b,e[13]=w,e[14]=N,e[15]=k,e[16]=S,e[17]=E,e[18]=T,e[19]=B,e[20]=A,e[21]=L,e[22]=$,e[23]=_,e[24]=F,e[25]=I,e[26]=J}else h=e[9],x=e[10],C=e[11],b=e[12],w=e[13],N=e[14],k=e[15],S=e[16],E=e[17],T=e[18],B=e[19],A=e[20],L=e[21],$=e[22],_=e[23],F=e[24],I=e[25],J=e[26];let W;if(e[58]!==w||e[59]!==d||e[60]!==n||e[61]!==y){let K;e[63]!==w||e[64]!==d||e[65]!==n?(K=z=>{const j=Be(n,z.values);return r.jsx(qe,{value:j,className:"py-2",onSelect:()=>{d(z.values),w()},children:r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:z.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:j})]})},j)},e[63]=w,e[64]=d,e[65]=n,e[66]=K):K=e[66],W=y.map(K),e[58]=w,e[59]=d,e[60]=n,e[61]=y,e[62]=W}else W=e[62];let Y;e[67]!==W?(Y=r.jsx(We,{children:W}),e[67]=W,e[68]=Y):Y=e[68];let G;e[69]!==h||e[70]!==Y||e[71]!==B||e[72]!==A||e[73]!==L?(G=r.jsxs(h,{className:B,children:[A,L,Y]}),e[69]=h,e[70]=Y,e[71]=B,e[72]=A,e[73]=L,e[74]=G):G=e[74];let Q;e[75]!==x||e[76]!==G||e[77]!==$||e[78]!==_||e[79]!==F?(Q=r.jsxs(x,{shouldFilter:$,className:_,children:[F,G]}),e[75]=x,e[76]=G,e[77]=$,e[78]=_,e[79]=F,e[80]=Q):Q=e[80];let V;e[81]!==C||e[82]!==N||e[83]!==k||e[84]!==Q||e[85]!==I||e[86]!==J?(V=r.jsxs(C,{className:I,onClick:J,children:[N,k,Q]}),e[81]=C,e[82]=N,e[83]=k,e[84]=Q,e[85]=I,e[86]=J,e[87]=V):V=e[87];let ee;e[88]!==b||e[89]!==S||e[90]!==E||e[91]!==V?(ee=r.jsx(b,{open:S,onOpenChange:E,children:V}),e[88]=b,e[89]=S,e[90]=E,e[91]=V,e[92]=ee):ee=e[92];let q;return e[93]!==T||e[94]!==ee?(q=r.jsxs(r.Fragment,{children:[T,ee]}),e[93]=T,e[94]=ee,e[95]=q):q=e[95],q}function td(t){return t.stopPropagation()}function sd(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),n=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${n}`}catch{return e}}function nd(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function rd(t){return t.showPreviewToolbar&&(t.contentEditingEnabled||t.hasFrameworkRoutes)}function ad(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function od(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class Aa extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function id(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new Aa;return s}async function ld(t,e,s){return s?Tr(t,e,await id(s.meta,s.loadMeta)):Tr(t,e)}function cd(t){const e=le.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const n=ll(s);let o;return e[2]!==t||e[3]!==n?(o={mutationFn:async c=>{const{name:d,path:i,template:a,schema:l}=c;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const g=Vi(d),f=a?{...a,name:d,path:i}:await ld(d,i,l);return await n.mutateAsync({blockKey:g,data:f}),{key:g,name:d,path:i}}},e[2]=t,e[3]=n,e[4]=o):o=e[4],No(o)}function dd(t){const e=le.c(89),{open:s,onOpenChange:n,isPending:o,error:c,templates:d,onSubmit:i}=t,a=o===void 0?!1:o,l=Se();let g;e[0]!==l?(g=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=g):g=e[1];const[f,p]=R.useState(g);let m;e[2]!==l?(m=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=m):m=e[3];const[v,y]=R.useState(m),[h,x]=R.useState(Ds),[C,b]=R.useState(null),[w,N]=R.useState(s);s!==w&&(N(s),s&&(p(l("sectionsEditor.createPageModal.defaultPageName")),y(l("sectionsEditor.createPageModal.defaultPagePath")),x(Ds),b(null)));const k=!!d?.length;let S;e[4]!==a||e[5]!==n?(S=pe=>{!pe&&!a&&(b(null),n(!1))},e[4]=a,e[5]=n,e[6]=S):S=e[6];const E=S;let T;e[7]!==a||e[8]!==f||e[9]!==i||e[10]!==v||e[11]!==k||e[12]!==h?(T=async pe=>{pe.preventDefault();const be=f.trim(),ge=v.trim();if(!be||!ge||a)return;const ve=ma(ge);if(ve){b(ve);return}b(null),await i({name:be,path:ge,templateKey:k&&h!==Ds?h:null})},e[7]=a,e[8]=f,e[9]=i,e[10]=v,e[11]=k,e[12]=h,e[13]=T):T=e[13];const B=T,A=C??c;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let $;e[16]!==L?($=r.jsx(nn,{children:r.jsx(rn,{children:L})}),e[16]=L,e[17]=$):$=e[17];let _;e[18]!==l?(_=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=_):_=e[19];let F;e[20]!==_?(F=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=F):F=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=pe=>p(pe.target.value),e[22]=I):I=e[22];let J;e[23]!==l?(J=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=J):J=e[24];let W;e[25]!==a||e[26]!==f||e[27]!==J?(W=r.jsx(Vs,{id:"new-page-name",value:f,onChange:I,placeholder:J,autoFocus:!0,disabled:a}),e[25]=a,e[26]=f,e[27]=J,e[28]=W):W=e[28];let Y;e[29]!==W||e[30]!==F?(Y=r.jsxs("div",{className:"space-y-1.5",children:[F,W]}),e[29]=W,e[30]=F,e[31]=Y):Y=e[31];let G;e[32]!==l?(G=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=G):G=e[33];let Q;e[34]!==G?(Q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:G}),e[34]=G,e[35]=Q):Q=e[35];let V;e[36]===Symbol.for("react.memo_cache_sentinel")?(V=pe=>y(pe.target.value),e[36]=V):V=e[36];let ee;e[37]!==l?(ee=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=ee):ee=e[38];let q;e[39]!==a||e[40]!==v||e[41]!==ee?(q=r.jsx(Vs,{id:"new-page-path",value:v,onChange:V,placeholder:ee,disabled:a}),e[39]=a,e[40]=v,e[41]=ee,e[42]=q):q=e[42];let K;e[43]!==Q||e[44]!==q?(K=r.jsxs("div",{className:"space-y-1.5",children:[Q,q]}),e[43]=Q,e[44]=q,e[45]=K):K=e[45];let z;e[46]!==a||e[47]!==k||e[48]!==l||e[49]!==h||e[50]!==d?(z=k&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),r.jsx(Wi,{id:"new-page-template",value:h,onChange:x,templates:d??[],disabled:a})]}),e[46]=a,e[47]=k,e[48]=l,e[49]=h,e[50]=d,e[51]=z):z=e[51];let j;e[52]!==A?(j=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=j):j=e[53];let O;e[54]!==Y||e[55]!==K||e[56]!==z||e[57]!==j?(O=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,K,z,j]}),e[54]=Y,e[55]=K,e[56]=z,e[57]=j,e[58]=O):O=e[58];let D;e[59]!==n?(D=()=>n(!1),e[59]=n,e[60]=D):D=e[60];let H;e[61]!==l?(H=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=H):H=e[62];let Z;e[63]!==a||e[64]!==D||e[65]!==H?(Z=r.jsx(_e,{type:"button",variant:"outline",onClick:D,disabled:a,children:H}),e[63]=a,e[64]=D,e[65]=H,e[66]=Z):Z=e[66];let te;e[67]!==a||e[68]!==f||e[69]!==v?(te=!f.trim()||!v.trim()||a,e[67]=a,e[68]=f,e[69]=v,e[70]=te):te=e[70];let M;e[71]!==a||e[72]!==l?(M=a?r.jsxs(r.Fragment,{children:[r.jsx(it,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=a,e[72]=l,e[73]=M):M=e[73];let X;e[74]!==te||e[75]!==M?(X=r.jsx(_e,{type:"submit",disabled:te,children:M}),e[74]=te,e[75]=M,e[76]=X):X=e[76];let se;e[77]!==Z||e[78]!==X?(se=r.jsxs(Co,{children:[Z,X]}),e[77]=Z,e[78]=X,e[79]=se):se=e[79];let ae;e[80]!==B||e[81]!==O||e[82]!==se||e[83]!==$?(ae=r.jsx(en,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[$,O,se]})}),e[80]=B,e[81]=O,e[82]=se,e[83]=$,e[84]=ae):ae=e[84];let me;return e[85]!==E||e[86]!==s||e[87]!==ae?(me=r.jsx(tn,{open:s,onOpenChange:E,children:ae}),e[85]=E,e[86]=s,e[87]=ae,e[88]=me):me=e[88],me}function ud(t){const e=le.c(35),{orgSlug:s,virtualMcpId:n,branch:o,previewUrl:c,meta:d,decofile:i,blockKey:a}=t,l=Se();let g;e[0]!==o||e[1]!==s||e[2]!==n?(g={orgSlug:s,virtualMcpId:n,branch:o},e[0]=o,e[1]=s,e[2]=n,e[3]=g):g=e[3];const f=cl(g,i);let p;e[4]!==a||e[5]!==i?(p=qi(i,a),e[4]=a,e[5]=i,e[6]=p):p=e[6];const{resolveType:m,props:v,title:y}=p;if(!m){let N;e[7]!==l?(N=l("sandbox.preview.loaderNoLongerExists"),e[7]=l,e[8]=N):N=e[8];let k;return e[9]!==N?(k=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:N}),e[9]=N,e[10]=k):k=e[10],k}const h=`loader:${a}`,x=`loader:${a}`;let C;e[11]!==a||e[12]!==m||e[13]!==y?(C={mode:"saved",blockKey:a,resolveType:m,title:y},e[11]=a,e[12]=m,e[13]=y,e[14]=C):C=e[14];let b;e[15]!==o||e[16]!==i||e[17]!==d||e[18]!==s||e[19]!==c||e[20]!==v||e[21]!==f.isPending||e[22]!==f.save||e[23]!==x||e[24]!==C||e[25]!==n?(b=r.jsx(Gi,{orgSlug:s,virtualMcpId:n,branch:o,previewUrl:c,meta:d,decofile:i,kind:"loaders",target:C,initialValue:v,isCreating:f.isPending,onCreate:fd,onSaveReferencedBlock:f.save,showRun:!1},x),e[15]=o,e[16]=i,e[17]=d,e[18]=s,e[19]=c,e[20]=v,e[21]=f.isPending,e[22]=f.save,e[23]=x,e[24]=C,e[25]=n,e[26]=b):b=e[26];let w;return e[27]!==a||e[28]!==o||e[29]!==i||e[30]!==s||e[31]!==h||e[32]!==b||e[33]!==n?(w=r.jsx(dl,{listing:i,orgSlug:s,virtualMcpId:n,branch:o,blockKey:a,present:void 0,children:b},h),e[27]=a,e[28]=o,e[29]=i,e[30]=s,e[31]=h,e[32]=b,e[33]=n,e[34]=w):w=e[34],w}async function fd(){}function pd(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Hr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:pd(t.error)}}function md(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 hd(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=md(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const s=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return s&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(o=>o.status==="error"&&!o.hasData&&o.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:s?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 gd=R.lazy(()=>To(()=>import("./sections-editor-vs42n8iz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163])).then(t=>({default:t.SectionsEditor})));function Vr(t){const e=le.c(62),{virtualMcpId:s,externalSelection:n,onSectionPicked:o,onViewJsonFile:c}=t,d=n===void 0?null:n,{org:i}=gs(),{currentBranch:a,taskId:l}=lt(),g=hn(),f=bt(),p=xa(),m=g.lifecycle.phase==="running",v=f.previewUrl;let y;e[0]!==a||e[1]!==i||e[2]!==v||e[3]!==l||e[4]!==s?(y=a?{orgSlug:i.slug,virtualMcpId:s,branch:a,threadId:l??null,previewUrl:v}:null,e[0]=a,e[1]=i,e[2]=v,e[3]=l,e[4]=s,e[5]=y):y=e[5];const h=y,x=Ut(s,a);let C;e[6]!==m?(C={fetchEnabled:m},e[6]=m,e[7]=C):C=e[7];const b=vs(h,C),w=ia(h);let N;e[8]!==m?(N={fetchEnabled:m},e[8]=m,e[9]=N):N=e[9];const k=ha(h,N),S=hd({lifecyclePhase:g.lifecycle.phase,decofile:Hr(b),meta:Hr(k),hasEditableContent:Ri(b.data,k.data),fastPreviewActive:oa(s).runtime==="cms"||tt(x)}),E=an()===void 0,T=vd;if(Li(x)){let j;return e[10]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(Oi,{})),e[10]=j):j=e[10],j}if(x.kind==="pending"&&x.retrying){let j;return e[11]!==x?(j=T(r.jsx(_i,{backend:x})),e[11]=x,e[12]=j):j=e[12],j}if(S.kind==="loading"||E){let j;return e[13]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(Ro,{})),e[13]=j):j=e[13],j}if(b.data&&di(k.data)){const j=p.state.target,O=j?.kind==="page"||j?.kind==="section"?j.key:null,D=x.kind==="legacy"?O??"":`${w}:${O??""}`,H=a??"";let Z;return e[14]!==b.data||e[15]!==O||e[16]!==i.slug||e[17]!==D||e[18]!==H||e[19]!==s?(Z=T(r.jsx(Ji,{orgSlug:i.slug,virtualMcpId:s,branch:H,decofile:b.data,initialKey:O,compact:!0},D)),e[14]=b.data,e[15]=O,e[16]=i.slug,e[17]=D,e[18]=H,e[19]=s,e[20]=Z):Z=e[20],Z}if(S.kind==="empty"){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx($i,{})),e[21]=j):j=e[21],j}if(S.kind==="error"){let j;e[22]!==b||e[23]!==f||e[24]!==k||e[25]!==S.source?(j=()=>{if(S.source==="sandbox"){f.retry();return}Promise.all([b.refetch(),k.refetch()])},e[22]=b,e[23]=f,e[24]=k,e[25]=S.source,e[26]=j):j=e[26];const O=j;let D;return e[27]!==O||e[28]!==S.source?(D=T(r.jsx(Ai,{source:S.source,onRetry:O})),e[27]=O,e[28]=S.source,e[29]=D):D=e[29],D}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=j=>T(r.jsx("div",{className:"h-full min-h-0",children:j})),e[30]=B):B=e[30];const A=B,L=p.state.target;if(L?.kind==="loader"&&b.data&&k.data){const j=x.kind==="legacy"?void 0:w,O=a??"",D=v??null;let H;return e[31]!==b.data||e[32]!==k.data||e[33]!==i.slug||e[34]!==j||e[35]!==O||e[36]!==D||e[37]!==L.key||e[38]!==s?(H=A(r.jsx(ud,{orgSlug:i.slug,virtualMcpId:s,branch:O,previewUrl:D,meta:k.data,decofile:b.data,blockKey:L.key},j)),e[31]=b.data,e[32]=k.data,e[33]=i.slug,e[34]=j,e[35]=O,e[36]=D,e[37]=L.key,e[38]=s,e[39]=H):H=e[39],H}let $;e[40]!==a||e[41]!==i.slug||e[42]!==L||e[43]!==s?($=L||!a?null:Xr(Zr(i.slug,s,a)),e[40]=a,e[41]=i.slug,e[42]=L,e[43]=s,e[44]=$):$=e[44];const _=$;let F="/",I=null,J=null;L?.kind==="page"?(F=L.path,I=L.key):L?.kind==="section"?J=L.key:_&&(F=_.path,I=_.pageKey);const W=I?`page:${I}`:J?`section:${J}`:`path:${F}`;let Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(Y=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}),e[45]=Y):Y=e[45];const G=x.kind==="legacy"?W:`${w}:${W}`,Q=a??"",V=v??void 0,ee=J?null:d,q=J?void 0:o,K=!!I&&p.state.editSeoPageKey===I;let z;return e[46]!==J||e[47]!==I||e[48]!==F||e[49]!==c||e[50]!==i.slug||e[51]!==V||e[52]!==ee||e[53]!==q||e[54]!==K||e[55]!==G||e[56]!==Q||e[57]!==s||e[58]!==p.consumeEditSeo||e[59]!==p.setFocusedBlock||e[60]!==p.setVariantOverride?(z=A(r.jsx(R.Suspense,{fallback:Y,children:r.jsx(gd,{orgSlug:i.slug,virtualMcpId:s,branch:Q,previewReady:!0,previewUrl:V,currentPath:F,activePageBlockKey:I,activeGlobalBlockKey:J,externalSelection:ee,onSectionPicked:q,initialEditSeo:K,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:c},G)})),e[46]=J,e[47]=I,e[48]=F,e[49]=c,e[50]=i.slug,e[51]=V,e[52]=ee,e[53]=q,e[54]=K,e[55]=G,e[56]=Q,e[57]=s,e[58]=p.consumeEditSeo,e[59]=p.setFocusedBlock,e[60]=p.setVariantOverride,e[61]=z):z=e[61],z}function vd(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function xd(t){const e=le.c(51),{virtualMcpId:s,pageKey:n,onClose:o,ref:c}=t,d=Se(),i=an(),a=i===!0,l=fn(s);let g;e[0]!==l||e[1]!==n?(g=la(l,ka(n)),e[0]=l,e[1]=n,e[2]=g):g=e[2];const f=g,{org:p}=gs(),{currentBranch:m,taskId:v}=lt(),h=bt().previewUrl;let x;e[3]!==m||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==s?(x=m?{orgSlug:p.slug,virtualMcpId:s,branch:m,threadId:v??null,previewUrl:h}:null,e[3]=m,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=s,e[8]=x):x=e[8];const b=vs(x),w=m??"";let N;e[9]!==p.slug||e[10]!==w||e[11]!==s?(N={orgSlug:p.slug,virtualMcpId:s,branch:w},e[9]=p.slug,e[10]=w,e[11]=s,e[12]=N):N=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k={holdsCopy:!0},e[13]=k):k=e[13];const{save:S,flush:E,hold:T}=va(N,k),B=m??"";let A;e[14]!==p.slug||e[15]!==B||e[16]!==s?(A=ya({orgSlug:p.slug,virtualMcpId:s,branch:B}),e[14]=p.slug,e[15]=B,e[16]=s,e[17]=A):A=e[17];const L=wa(A);let $;e[18]!==n||e[19]!==L?($=L(n),e[18]=n,e[19]=L,e[20]=$):$=e[20];const _=$;let F;e[21]!==_||e[22]!==n?(F={pageKey:n,copyEpoch:_},e[21]=_,e[22]=n,e[23]=F):F=e[23];const[I,J]=R.useState(F);(I.pageKey!==n||I.copyEpoch!==_)&&(J({pageKey:n,copyEpoch:_}),T(n));const W=b.data?.[n],Y=b.data===void 0&&b.isLoading||i===void 0,G=b.data!==void 0&&W===void 0,Q=!m||G||Y;let V;e[24]!==W?(V=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=V):V=e[25];const ee=V;let q;e[26]!==n||e[27]!==Q||e[28]!==S?(q=H=>{if(Q)return;let Z;try{Z=JSON.parse(H)}catch{return}Z===null||typeof Z!="object"||Array.isArray(Z)||S(n,Z)},e[26]=n,e[27]=Q,e[28]=S,e[29]=q):q=e[29];const K=q;let z;e[30]!==E?(z=()=>({flush:E}),e[30]=E,e[31]=z):z=e[31],R.useImperativeHandle(c,z);let j;e[32]!==f||e[33]!==a||e[34]!==o||e[35]!==d?(j=a?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Jr,{size:14})})]}),e[32]=f,e[33]=a,e[34]=o,e[35]=d,e[36]=j):j=e[36];let O;e[37]!==_||e[38]!==b.data||e[39]!==E||e[40]!==ee||e[41]!==Y||e[42]!==G||e[43]!==n||e[44]!==Q||e[45]!==K||e[46]!==d?(O=Y?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}):G?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(ba,{code:ee,language:"json",readOnly:Q,height:"100%",onChange:H=>K(H??""),onSave:H=>{K(H),E()}},`${n}:${b.data===void 0?"loading":"ready"}:${_}`)}),e[37]=_,e[38]=b.data,e[39]=E,e[40]=ee,e[41]=Y,e[42]=G,e[43]=n,e[44]=Q,e[45]=K,e[46]=d,e[47]=O):O=e[47];let D;return e[48]!==j||e[49]!==O?(D=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[j,O]}),e[48]=j,e[49]=O,e[50]=D):D=e[50],D}function Wr(t){const e=le.c(3),{currentBranch:s}=lt(),n=Ut(t.virtualMcpId,s);let o;return e[0]!==n.kind||e[1]!==t?(o=n.kind==="legacy"?r.jsx(xd,{...t}):r.jsx(bd,{...t}),e[0]=n.kind,e[1]=t,e[2]=o):o=e[2],o}function bd(t){const e=le.c(61),{virtualMcpId:s,pageKey:n,onClose:o,ref:c}=t,d=Se(),i=an(),a=i===!0,l=fn(s);let g;e[0]!==l||e[1]!==n?(g=la(l,ka(n)),e[0]=l,e[1]=n,e[2]=g):g=e[2];const f=g,{org:p}=gs(),{currentBranch:m,taskId:v}=lt(),h=bt().previewUrl;let x;e[3]!==m||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==s?(x=m?{orgSlug:p.slug,virtualMcpId:s,branch:m,threadId:v??null,previewUrl:h}:null,e[3]=m,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=s,e[8]=x):x=e[8];const C=x,b=vs(C);let w;e[9]!==n?(w=[n],e[9]=n,e[10]=w):w=e[10];let N;e[11]!==b.data?(N={listing:b.data},e[11]=b.data,e[12]=N):N=e[12];const k=ca(C,w,N),S=m??"";let E;e[13]!==p.slug||e[14]!==S||e[15]!==s?(E={orgSlug:p.slug,virtualMcpId:s,branch:S},e[13]=p.slug,e[14]=S,e[15]=s,e[16]=E):E=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T={holdsCopy:!0},e[17]=T):T=e[17];const{save:B,flush:A,hold:L}=va(E,T),$=m??"";let _;e[18]!==p.slug||e[19]!==$||e[20]!==s?(_=ya({orgSlug:p.slug,virtualMcpId:s,branch:$}),e[18]=p.slug,e[19]=$,e[20]=s,e[21]=_):_=e[21];const F=wa(_);let I;e[22]!==n||e[23]!==F?(I=F(n),e[22]=n,e[23]=F,e[24]=I):I=e[24];const J=I,W=b.data?.[n];let Y;e[25]!==k.ready||e[26]!==b.data||e[27]!==W?(Y=k.ready&&b.data!==void 0&&(W===void 0||vr(W)),e[25]=k.ready,e[26]=b.data,e[27]=W,e[28]=Y):Y=e[28];const G=Y;let Q;e[29]!==J||e[30]!==n?(Q={pageKey:n,copyEpoch:J,opened:!1,code:""},e[29]=J,e[30]=n,e[31]=Q):Q=e[31];const[V,ee]=R.useState(Q);if(G&&(V.pageKey!==n||V.copyEpoch!==J||!V.opened)){let X;e[32]!==W?(X=W===void 0?"":JSON.stringify(W,null,2),e[32]=W,e[33]=X):X=e[33],ee({pageKey:n,copyEpoch:J,opened:!0,code:X}),vr(W)&&L(n)}const q=V.pageKey===n&&V.opened,K=i===void 0||!q&&!G,z=G&&W===void 0,j=!m||z||K;let O;e[34]!==n||e[35]!==j||e[36]!==B?(O=X=>{if(j)return;ee(ae=>({...ae,code:X}));let se;try{se=JSON.parse(X)}catch{return}se===null||typeof se!="object"||Array.isArray(se)||B(n,se)},e[34]=n,e[35]=j,e[36]=B,e[37]=O):O=e[37];const D=O;let H;e[38]!==A?(H=()=>({flush:A}),e[38]=A,e[39]=H):H=e[39],R.useImperativeHandle(c,H);let Z;e[40]!==f||e[41]!==a||e[42]!==o||e[43]!==d?(Z=a?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Jr,{size:14})})]}),e[40]=f,e[41]=a,e[42]=o,e[43]=d,e[44]=Z):Z=e[44];let te;e[45]!==k.failed||e[46]!==k.retry||e[47]!==A||e[48]!==V.code||e[49]!==V.copyEpoch||e[50]!==V.pageKey||e[51]!==K||e[52]!==z||e[53]!==j||e[54]!==D||e[55]!==q||e[56]!==d?(te=!q&&k.failed?r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-4",children:[r.jsx("p",{className:"text-sm",children:d("sectionsEditor.hosted.blockLoadFailed")}),r.jsx(_e,{variant:"outline",size:"sm",onClick:k.retry,children:d("sectionsEditor.namedRules.tryAgain")})]}):K?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}):z?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(ba,{code:V.code,language:"json",readOnly:j,height:"100%",onChange:X=>D(X??""),onSave:X=>{D(X),A()}},`${V.pageKey}:${V.copyEpoch}`)}),e[45]=k.failed,e[46]=k.retry,e[47]=A,e[48]=V.code,e[49]=V.copyEpoch,e[50]=V.pageKey,e[51]=K,e[52]=z,e[53]=j,e[54]=D,e[55]=q,e[56]=d,e[57]=te):te=e[57];let M;return e[58]!==Z||e[59]!==te?(M=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,te]}),e[58]=Z,e[59]=te,e[60]=M):M=e[60],M}function Oa(t){return t.contentEditingEnabled&&!t.isMobile}function yd(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function wd(t,e){return t==="blocks"?"preview":e?"blocks":t}function kd(t){return Oa({contentEditingEnabled:Sa(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function Sd(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function Pd(t){const e=ui(t),{display:s}=t;let n=null;if(s.mode==="production"&&s.iframeBase)try{n=new URL(t.path,s.iframeBase).href}catch{n=null}const o=fi(n,e);return{value:e,frame:o?Ys(o,t.device):null,newTab:o}}function jd(t){const e=le.c(94),{tests:s,load:n,onOpen:o,options:c,onChange:d,available:i}=t,a=Se();let l;e[0]!==c?(l=da(c),e[0]=c,e[1]=l):l=e[1];const g=l;let f;e[2]!==c.tests?(f=c.tests??{},e[2]=c.tests,e[3]=f):f=e[3];const p=f;let m;e[4]!==d||e[5]!==c?(m=M=>{const X=M?xl(M):null,{at:se,...ae}=c;d(X?{...ae,at:X}:ae)},e[4]=d,e[5]=c,e[6]=m):m=e[6];const v=m;let y;e[7]!==p||e[8]!==d||e[9]!==c?(y=(M,X)=>{const se={...p};X==="on"?se[M]=!0:X==="off"?se[M]=!1:delete se[M];const{tests:ae,...me}=c;d(Object.keys(se).length>0?{...me,tests:se}:me)},e[7]=p,e[8]=d,e[9]=c,e[10]=y):y=e[10];const h=y;let x;e[11]!==o?(x=M=>{M&&o?.()},e[11]=o,e[12]=x):x=e[12];let C;e[13]!==a?(C=a("sandbox.previewAs.label"),e[13]=a,e[14]=C):C=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(ml,{size:16}),e[15]=b):b=e[15];let w;e[16]!==g||e[17]!==C?(w=r.jsx(nt,{asChild:!0,children:r.jsx(na,{asChild:!0,children:r.jsx(st,{"aria-label":C,active:g,"data-testid":"preview-as-trigger",children:b})})}),e[16]=g,e[17]=C,e[18]=w):w=e[18];let N;e[19]!==a?(N=a("sandbox.previewAs.label"),e[19]=a,e[20]=N):N=e[20];let k;e[21]!==N?(k=r.jsx(rt,{children:N}),e[21]=N,e[22]=k):k=e[22];let S;e[23]!==k||e[24]!==w?(S=r.jsxs(at,{children:[w,k]}),e[23]=k,e[24]=w,e[25]=S):S=e[25];let E;e[26]!==a?(E=a("sandbox.previewAs.label"),e[26]=a,e[27]=E):E=e[27];let T;e[28]!==E?(T=r.jsx("h3",{className:"text-sm font-medium",children:E}),e[28]=E,e[29]=T):T=e[29];let B;e[30]!==i||e[31]!==a?(B=a(i?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=i,e[31]=a,e[32]=B):B=e[32];let A;e[33]!==B?(A=r.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[33]=B,e[34]=A):A=e[34];let L;e[35]!==T||e[36]!==A?(L=r.jsxs("div",{className:"flex flex-col gap-1",children:[T,A]}),e[35]=T,e[36]=A,e[37]=L):L=e[37];let $;e[38]!==a?($=a("sandbox.previewAs.momentLabel"),e[38]=a,e[39]=$):$=e[39];let _;e[40]!==$?(_=r.jsx(hl,{htmlFor:"preview-as-moment",children:$}),e[40]=$,e[41]=_):_=e[41];let F;e[42]!==c.at?(F=vl(c.at),e[42]=c.at,e[43]=F):F=e[43];let I;e[44]!==v?(I=M=>v(M.target.value),e[44]=v,e[45]=I):I=e[45];let J;e[46]!==F||e[47]!==I?(J=r.jsx(Vs,{id:"preview-as-moment",type:"datetime-local",className:bl,value:F,onChange:I}),e[46]=F,e[47]=I,e[48]=J):J=e[48];const W=c.at===void 0;let Y;e[49]!==v?(Y=()=>v(""),e[49]=v,e[50]=Y):Y=e[50];let G;e[51]!==a?(G=a("sandbox.previewAs.now"),e[51]=a,e[52]=G):G=e[52];let Q;e[53]!==W||e[54]!==Y||e[55]!==G?(Q=r.jsx(_e,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:Y,children:G}),e[53]=W,e[54]=Y,e[55]=G,e[56]=Q):Q=e[56];let V;e[57]!==J||e[58]!==Q?(V=r.jsxs("div",{className:"flex items-center gap-2",children:[J,Q]}),e[57]=J,e[58]=Q,e[59]=V):V=e[59];let ee;e[60]!==a?(ee=a("sandbox.previewAs.momentHint"),e[60]=a,e[61]=ee):ee=e[61];let q;e[62]!==ee?(q=r.jsx("p",{className:"text-xs text-muted-foreground",children:ee}),e[62]=ee,e[63]=q):q=e[63];let K;e[64]!==_||e[65]!==V||e[66]!==q?(K=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,V,q]}),e[64]=_,e[65]=V,e[66]=q,e[67]=K):K=e[67];let z;e[68]!==a?(z=a("sandbox.previewAs.testsLabel"),e[68]=a,e[69]=z):z=e[69];let j;e[70]!==z?(j=r.jsx("span",{className:"text-sm font-medium",children:z}),e[70]=z,e[71]=j):j=e[71];let O;e[72]!==p||e[73]!==n||e[74]!==h||e[75]!==a||e[76]!==s?(O=n&&!n.ready?n.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsLoadFailed")}),r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:n.retry,children:a("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(it,{className:"size-4 text-muted-foreground"})}):s.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(M=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:M}),r.jsxs(gl,{type:"single",variant:"outline",size:"sm",value:p[M]===void 0?"":p[M]?"on":"off",onValueChange:X=>h(M,X),"aria-label":M,children:[r.jsx(Or,{value:"off",children:a("sandbox.previewAs.off")}),r.jsx(Or,{value:"on",children:a("sandbox.previewAs.on")})]})]},M))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=n,e[74]=h,e[75]=a,e[76]=s,e[77]=O):O=e[77];let D;e[78]!==j||e[79]!==O?(D=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[j,O]}),e[78]=j,e[79]=O,e[80]=D):D=e[80];let H;e[81]!==g||e[82]!==d||e[83]!==a?(H=g&&r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>d({}),children:a("sandbox.previewAs.reset")}),e[81]=g,e[82]=d,e[83]=a,e[84]=H):H=e[84];let Z;e[85]!==L||e[86]!==K||e[87]!==D||e[88]!==H?(Z=r.jsxs(ra,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,K,D,H]}),e[85]=L,e[86]=K,e[87]=D,e[88]=H,e[89]=Z):Z=e[89];let te;return e[90]!==S||e[91]!==Z||e[92]!==x?(te=r.jsxs(aa,{onOpenChange:x,children:[S,Z]}),e[90]=S,e[91]=Z,e[92]=x,e[93]=te):te=e[93],te}const Ed=["next"],Nd=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],_a=new Set(["tsx","ts","jsx","js","mdx"]),Cd=new Set(["tsx","jsx"]),Td=new Set(["404","500"]);function Rd(t){const e=new Set;if(!t||typeof t!="object")return e;const s=t;for(const n of["dependencies","devDependencies"]){const o=s[n];if(o&&typeof o=="object"&&!Array.isArray(o))for(const c of Object.keys(o))e.add(c)}return e}function Ld(t){const e=Rd(t);return Ed.some(s=>e.has(s))?"next":Nd.some(s=>e.has(s))?"tanstack":null}function $a(t,e){const s=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return s?`${s}/${e}`:e}function Ad(t,e){const s=n=>$a(e,n);switch(t){case"next":return[{router:"next-pages",dir:s("pages"),pattern:"**/*"},{router:"next-pages",dir:s("src/pages"),pattern:"**/*"},{router:"next-app",dir:s("app"),pattern:"**/page.*"},{router:"next-app",dir:s("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:s("src/routes"),pattern:"**/*"}];default:{const n=t;throw new Error(`Unknown framework: ${String(n)}`)}}}function xn(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function Od(t){const e=xn(t.at(-1)??"");if(!e||!_a.has(e[1]))return null;const[s]=e;if(s.includes("."))return null;const n=[...t.slice(0,-1),s];return n[0]==="api"||n.length===1&&Td.has(s)||n.some(o=>o.startsWith("_")||o.includes("["))?null:(n.at(-1)==="index"&&n.pop(),`/${n.join("/")}`)}function _d(t){const e=xn(t.at(-1)??"");if(!e||e[0]!=="page"||!_a.has(e[1]))return null;const s=[];for(const n of t.slice(0,-1)){if(n.startsWith("_")||n.startsWith("@")||/^\(\.{1,3}\)/.test(n)||n.includes("["))return null;n.startsWith("(")&&n.endsWith(")")||s.push(n)}return`/${s.join("/")}`}function $d(t){const e=[];let s="",n=!1;for(const o of t)o==="["?n=!0:o==="]"&&(n=!1),o==="."&&!n?(e.push(s),s=""):s+=o;return e.push(s),e}function Fd(t){const e=xn(t.at(-1)??"");if(!e||!Cd.has(e[1]))return null;const s=[...t.slice(0,-1),...$d(e[0])].filter(Boolean);s.at(-1)==="lazy"&&s.pop();const n=s.at(-1);if(!n||n==="__root"||s.some(c=>c.startsWith("-"))||n.startsWith("_"))return null;(n==="index"||n==="route")&&s.pop();const o=[];for(const c of s){if(c.includes("$"))return null;if(c.startsWith("_")||c.startsWith("(")&&c.endsWith(")"))continue;const d=c.replace(/_$/,"").replace(/[[\]]/g,"");d&&o.push(d)}return`/${o.join("/")}`}function Dd(t,e){const s=e.split("/").filter(Boolean);if(s.length===0)return null;switch(t){case"next-pages":return Od(s);case"next-app":return _d(s);case"tanstack":return Fd(s);default:{const n=t;throw new Error(`Unknown router: ${String(n)}`)}}}function Bd(t){const e=new Set;for(const{root:s,files:n}of t){const o=`${s.dir}/`;for(const c of n){if(!c.startsWith(o))continue;const d=Dd(s.router,c.slice(o.length));d&&e.add(d)}}return[...e].sort((s,n)=>s==="/"?-1:n==="/"?1:s.localeCompare(n))}const Md=5e3,zd=6e4;async function Id(t,e){const s=await fetch(yl(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:Md})});if(!s.ok)throw new Error(`Failed to list ${e.dir}: ${s.status}`);const n=await s.json();return Array.isArray(n.files)?n.files.filter(o=>typeof o=="string"):[]}async function Kd(t,e){const s=await pi(t,$a(e,"package.json"));if(s.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const n=s.kind==="data"?Ld(s.data):null;if(!n)return[];const o=Ad(n,e),c=await Promise.all(o.map(async d=>({root:d,files:await Id(t,d)})));return Bd(c)}function Ud(t,e,s){const n=le.c(12);let o;n[0]!==e||n[1]!==t?(o=t?sn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],n[0]=e,n[1]=t,n[2]=o):o=n[2];let c;n[3]!==e||n[4]!==t?(c=()=>t?Kd(t,e):[],n[3]=e,n[4]=t,n[5]=c):c=n[5];const d=s&&!!t;let i;n[6]!==o||n[7]!==c||n[8]!==d?(i={queryKey:o,queryFn:c,enabled:d,staleTime:zd},n[6]=o,n[7]=c,n[8]=d,n[9]=i):i=n[9];const a=Yr(i);let l;return n[10]!==a.data?(l=a.data??[],n[10]=a.data,n[11]=l):l=n[11],l}const Hd=500,Vd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},qr=1,fs=["desktop","mobile","tablet"],Wd=["preview","visual","blocks"],qd={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Gd(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 Kt(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Hs(t,e){try{return new URL(t,e).href}catch{return null}}function Jd(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 s={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:s,effective:s.url}}return{pin:t,effective:t?.url??null}}function Yd(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Qd(t,e,s){const n=t.toLowerCase(),o=e.toLowerCase(),c=o.split("/").filter(Boolean),d=a=>{if(a===s)return 100;const l=a.indexOf(s);if(l===-1)return 0;let g=40;return l===0?g+=30:/[\s/-]/.test(a[l-1]??"")&&(g+=20),g+=Math.round(s.length/a.length*20),g};let i=Math.max(d(n),d(o));return c.at(-1)===s?i=Math.max(i,95):c.includes(s)&&(i=Math.max(i,90)),i}function Xd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Zd({virtualMcpId:t}){const e=Se(),s=pa(),{currentBranch:n,taskId:o,virtualMcpId:c}=lt(),d=!!Fo(),i=xa(),a=Jo(c===t?t:null),l=oa(t),g=wl(a?.metadata?.ui?.layout??null),f=Sa(g),p=Oa({contentEditingEnabled:f,isMobile:s}),[m]=R.useState(()=>kd({cmsMode:g,isMobile:s})),[v,y]=Ws(qs.previewEditingMode(t),u=>u&&Wd.includes(u)?u:null),h=v??m,[x,C]=Ws(qs.previewDeviceSize(t),u=>u&&fs.includes(u)?u:"desktop"),[b,w]=R.useState(null),[N,k]=R.useState(null),S=R.useRef(null),E=R.useRef(null),[T,B]=R.useState(!1),A=R.useRef(null),L=()=>{A.current?.flush(),B(!1)},$=()=>B(u=>(u&&A.current?.flush(),!u)),[_,F]=R.useState({width:0,height:0}),[I,J]=R.useState(!1),[W,Y]=R.useState({}),[G,Q]=R.useState(""),V=R.useRef(null),[ee,q]=R.useState(!1),[K,z]=R.useState(),[j,O]=R.useState(null),[D,H]=R.useState(null),[Z,te]=R.useState(null),[M,X]=R.useState(()=>i.state.target?.kind==="page"?i.state.target.path:"/"),[se,ae]=R.useState(()=>i.state.target?.kind==="page"?i.state.target.key:null),[me,pe]=R.useState({}),[be,ge]=R.useState(!1),ve=R.useRef(null),Pe=()=>{ge(!0),S.current&&$s(S.current),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>ge(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),ge(!1)},{org:de}=gs(),Le=hn(),Ie=bt(),Ke=Ie.vmEntry,Me=Le.lifecycle.phase,{url:yt}=ua(t),he=Ut(t,n),{connection:$e}=fa(t),xe=ul(t),Ue=mi({hasServeConnection:!!$e,runtime:l.runtime}),Ae=!tt(he)&&he.kind!=="pending",re=Ve(he)??yt,ue=re??Ie.previewUrl,Ge=!!re||Me==="running",wt=a?.id===t?ni(a.metadata):null,Je=!re&&a?.id===t&&l.runtime==="cms",Ht=l.projectDefault==="cms",kt=Ae?hi({sandboxUrl:ue,previewServerUrl:wt,fastPreviewActive:Je}):null,bn=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,threadId:o??null,previewUrl:ue}:null,yn=vs(bn,{fetchEnabled:Ge}),xs=ha(bn,{fetchEnabled:Ge}),ce=yn.data,we=xs.data,Ye=ce?Fi(ce,we).sort((u,P)=>u.name.localeCompare(P.name)):[],Vt=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n}:null,wn=cd(Vt),Fa=gi(Vt),bs=ce&&we?Di(ce,we):[],kn=Ae&&ce&&we?Yi(we,ce,"loaders"):[],Da=G?(()=>{const u=G.toLowerCase();return Ye.map(P=>({page:P,score:Qd(P.name,P.path,u)})).filter(({score:P})=>P>0).sort((P,U)=>U.score-P.score||P.page.path.length-U.page.path.length).map(({page:P})=>P)})():Ye,Ba=bs.filter(u=>{if(!G)return!0;const P=G.toLowerCase();return u.name.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),Sn=p?kn:[],Pn=Sn.filter(u=>{if(!G)return!0;const P=G.toLowerCase();return u.title.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),Wt=D?kn.find(u=>u.key===D)??null:null,Ne=pn,ys=j||D?null:Bi(Ye,M,se),ie=ys?.key??null,ct=i.state.target?.kind==="section"?i.state.target.key:i.state.focusedBlockKey??ie,qt=ys?.path??null,ws={};if(Ae&&Ge&&ue&&we&&ce){const u=Qi(we,"loaders"),P=ie?ce[ie]:void 0,U=Pc(P,ce,Ee=>u.has(Ee)),oe=bc(U);for(const Ee of xt(M)){if(Ee.type!=="param")continue;const Ce=gc(M,Ee.name,U),mt=kc(Ce,u,oe);mt.length>0&&(ws[Ee.name]=mt)}}const jn=u=>ce?Zc(ce,u,we):[],ks=ie?jn(M):[],Qe=(ie?me[ie]:void 0)??ks[0]?.values??{},Te=Be(M,Qe),St=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,threadId:o??null}:null,En=ce&&ie?Zi(ce,ie,0):[],Nn=tt(he),Cn=ce?Xi(En,ce,Nn):[],Pt=Cn.map(u=>u.isSavedBlock?u.label:""),jt=Cn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),Et=En.map(u=>Qs(u,ce??{},Nn)),dt=R.useRef(null),Fe=R.useRef(null),Ma=Le.status.state==="paused",Ss=Le.phase,Tn=al({claimPhase:Ss,lifecycle:Le.lifecycle}),Xe=Ie.previewState,za=Ie.userStopped,Ia=vi(de.slug,t??""),{url:He}=Hi(Je&&t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,previewServerUrl:wt??null,path:Te}:null),Ka=Ht&&l.runtime==="sandbox",Oe=xi(he,Ue,xe),Rn=bi(Oe&&Je&&he.kind==="protocol"&&t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n}:null),Ln=Oe?Rn.pointer:null,ne=Yl({previewState:Xe,progressStatus:Tn.status,previewServerUrl:wt,fastPreviewActive:Je,fastPreviewReady:!!He,codingSession:Ka,localPreviewUrl:re,hostedDraft:Oe,hostedPointerPending:Oe&&(he.kind==="pending"||Rn.pending)}),An=ne.showWakingPill||Oe&&ne.mode==="production"&&!Ln,Nt=ne.mode!=="none",Ua=ne.mode==="production"&&ne.iframeBase?Kt(ne.iframeBase):null,ut=ne.mode==="production"?Ua:Kt(ue),Ha=a?.id===t&&a.metadata?.fastPreviewInPlace===!0,Ct=Ae?re?ne.mode==="sandbox"&&p&&h==="blocks":ne.mode==="production"&&Je&&Ha&&p&&h==="blocks":!1,On=R.useRef(null),{pin:Va,effective:Wa}=Jd(On.current,{inPlaceRenderActive:Ct,draftPreviewUrl:He,resolvedPath:Te});On.current=Va;const _n=i.state.variantOverride??[],Gt=Ae?_n:[],Tt=Ae?[]:_n,Jt=tt(he)&&Mi.some(u=>zi(we,u)==="available"),ft=Jt?W:{},$n=da(ft),qa=Jt&&ce?Object.keys(Ii(ce).experiments):[],[Fn,Ga]=R.useState(!1),Dn=ca(Vt,Jt&&Fn?Ki:[]),Ja={...Dn,ready:!(he.kind==="protocol"&&he.hosted)||Fn&&Dn.ready},Ze=t?yr(de.slug,t):null,Ya=yi(Ze),Yt=Oe?Pd({display:ne,path:Te,pointer:Ln,heldRevision:Ya,device:x,forcedVariants:Tt,previewOptions:ft}):null,Bn=JSON.stringify([Tt,ft]);R.useEffect(()=>{if(!Oe||!Ze)return;const[u,P]=JSON.parse(Bn);wr(Ze,{forcedVariants:u,previewOptions:P})},[Oe,Ze,Bn]),R.useEffect(()=>{if(!(!Oe||!Ze))return()=>wr(Ze,null)},[Oe,Ze]);const Ps=$e&&Ve(he)?wi($e.endpoint,Tt,$n):null,Qa=$e&&Ve(he)?Ps?ki(Ps,ft):kr:null,et=Gd(ne.mode==="sandbox"?os(Ys(Sr(Z??Hs(Te,ne.iframeBase)??ne.iframeBase,Qa),x),Gt):ne.mode==="production"&&Yt?.frame?Yt.frame:ne.mode==="production"?os(Ys(Pr(jr(Sr(Z??Wa??Hs(Te,ne.iframeBase)??ne.iframeBase,An?kr:null),Tt),ft),x),Gt):null),Mn=He??(ne.iframeBase?Hs(Te,ne.iframeBase):null),zn=ne.mode==="production"&&Yt?Yt.newTab:ne.mode==="production"?Mn?os(Pr(jr(Mn,Tt),ft),Gt):null:et??ne.iframeBase,Xa=()=>{const u=zn;u&&window.open(u,"_blank","noopener")},Rt=t&&n?Zr(de.slug,t,n):null,Lt=u=>{Rt&&Bo(Rt,u)},ke=i.state.target;R.useEffect(()=>{if(!(!ke||!kt||!we))if(ke.kind==="page"){const u=me[ke.key]??{};Fe.current=Be(ke.path,u),O(null),H(null),te(null),ae(ke.key),X(ke.path),Lt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")Fe.current=null,O(null),H(ke.key),te(null);else{const u=bs.find(P=>P.key===ke.key);if(u){Fe.current=null;const P=Cr(we);H(null),O(u),te(Er(kt,P,u.key))}}},[ke,kt,we,me]),R.useEffect(()=>{!ie||qt===null||ke?.kind==="page"&&ke.key===ie&&ke.path===qt||i.selectTarget({kind:"page",key:ie,path:qt})},[ie,qt,ke]);const[In,Za]=R.useState(null);if(Xe.kind==="iframe"&&In!==Xe.previewUrl){const u=In!==null;Za(Xe.previewUrl);const P=Rt?Xr(Rt):null;if(P){if(Fe.current=Be(P.path,P.params),X(P.path),ae(P.pageKey),te(null),O(null),H(null),P.pageKey&&Object.keys(P.params).length>0){const U=P.pageKey;pe(oe=>({...oe,[U]:P.params}))}}else u&&(Fe.current=null,X("/"),te(null),ae(null),O(null),H(null))}dt.current=et;const eo=ne.mode==="production"&&!!He&&!re,[Qt,js]=R.useState({src:et??void 0,loading:!1}),[to,Es]=R.useState(!1),[so,no]=R.useState(),[Kn,Un]=R.useState(null),je=Xo(Kn,{base:ne.iframeBase??"",frameSrc:Qt.src,loadedSrc:so,wanted:et??void 0,canSwap:xe&&to&&!Qt.loading});je!==Kn&&Un(je);const Xt=Zo(Qt,je?je.src:et??void 0,eo);Xt!==Qt&&js(Xt);const pt=Xt.src,Hn=Xt.loading,Vn=ei({iframeRef:S,src:ne.mode==="sandbox"?et:null,active:ne.mode==="sandbox"}),Wn=R.useRef(null);R.useEffect(()=>{const u=Hn?setTimeout(()=>js(br),ti):null,P=()=>{u&&clearTimeout(u)};if(!He||!pt||Wn.current===He)return P;Wn.current=He;const U=S.current;return U&&U.getAttribute("src")!==pt&&(Pe(),U.src=pt),P},[He,pt,Hn]);const qn=()=>{const u=S.current?.contentWindow,P=ut;if(!u||!P||!ce||!ie)return;const U=ce[ie];if(!U||typeof U!="object")return;const oe=Ei({previewBaseUrl:P,pageBlock:U,decofile:ce,path:Te,pathTemplate:M});if(!oe)return;const Ee=os(oe.src,Ci(Gt,ie));u.postMessage({type:"cms-editor::render",src:Ee,body:oe.body},P)},Ns=R.useRef(null);R.useEffect(()=>{if(!Ct||j||D||!ie||!ce){Ns.current=null;return}const u={nav:JSON.stringify({page:ie,path:Te,pathTemplate:M}),content:JSON.stringify(ce)},P=Yd(Ns.current,u);Ns.current=u,P&&qn()},[ce,Ct,j,D,ie,Te,M]);const Cs=R.useRef(null);R.useEffect(()=>{if(!Ct||j||D||!ie||!ce){Cs.current=null;return}const u=JSON.stringify(i.state.variantOverride??null),P=Cs.current;Cs.current={page:ie,sig:u},!(!P||P.page!==ie||P.sig===u)&&qn()},[i.state.variantOverride,Ct,j,D,ie]);const Gn=!!t&&!!n&&!Le.notFound&&!za&&!Ma&&(Ss?.kind==="ready"||Me!=="idle"),Jn=!tt(he),ro=fn(t??void 0),ao=Ud(St,ro,Jn&&Gn),oo=new Set(f?Ye.map(u=>Ne(u.path)):[]),At=Jn?ao.filter(u=>!oo.has(Ne(u))):[],Yn=G?At.filter(u=>u.toLowerCase().includes(G.toLowerCase())):At,ye=Sd({editingMode:h,sandboxDisplay:ne.mode==="sandbox",blocksEditingEnabled:p});R.useEffect(()=>{const u=ut;if(!u)return;const P=U=>{if(U.origin===u)if(U.data?.type==="visual-editor::element-clicked"){const oe=ec.safeParse(U.data.payload);oe.success&&w(oe.data)}else if(U.data?.type==="cms-editor::section-clicked"){const oe=nc.safeParse(U.data.payload);oe.success&&k({index:oe.data.sectionIndex,seq:oe.data.clickSeq})}else U.data?.type==="cms-editor::render-start"?Pe():U.data?.type==="cms-editor::render-end"?(fe(),S.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:Pt,kinds:jt,keys:Et},u)):U.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[ut,Pt,jt,Et]);const Qn=()=>{const u=S.current?.contentWindow,P=Kt(ue),U=od({v8:xe,script:tc});!u||!P||!U||u.postMessage(U,P)},io=()=>{if(xe)return;const u=S.current?.contentWindow,P=Kt(ue);!u||!P||u.postMessage({type:"visual-editor::deactivate"},P)},Xn=()=>{const u=ze.current;u?.has("wireframe")&&(u.wireframe({type:"wireframe:sections",labels:Pt,kinds:jt,keys:Et}),u.wireframe({type:ye==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Ts=()=>{if(xe){Xn();return}const u=S.current?.contentWindow,P=ut,U=ad({v8:xe,production:ne.mode==="production",localPreview:!!re,script:rc});!u||!P||!U||(u.postMessage(U,P),u.postMessage({type:"cms-editor::set-labels",labels:Pt,kinds:jt,keys:Et},P))},lo=()=>{if(xe){ze.current?.wireframe({type:"wireframe:deactivate"});return}const u=S.current?.contentWindow,P=ut;!u||!P||u.postMessage({type:"cms-editor::deactivate"},P)},Zn=u=>{ze.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:u})},co=()=>{if(ze.current?.wireframe({type:"wireframe:clear-hover"}),xe)return;const u=S.current?.contentWindow,P=ut;!u||!P||(u.postMessage({type:"cms-editor::clear-hover"},P),u.postMessage({type:"visual-editor::clear-hover"},P))},Zt=u=>{if(u==="blocks"&&!p)return;const P=h;!s&&u!==P&&(u==="blocks"?E.current?.resize("30%"):E.current?.collapse()),y(u),w(null),k(null),u!=="blocks"&&H(null),P==="visual"&&io(),u==="visual"&&Qn(),P==="blocks"&&u!=="blocks"&&lo(),u==="blocks"&&Ts()},uo=()=>{Zt(yd(h,p))},fo=()=>{Zt(wd(h,p))},es=()=>{const u=S.current;if(!u)return;Pe();const P=document.activeElement,U=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Xd(u,dt.current);let oe;const Ee=()=>{clearTimeout(oe),u.tabIndex=U,u.style.pointerEvents="";const Ce=document.activeElement;(!Ce||Ce===document.body||Ce===u)&&P?.focus(),u.removeEventListener("load",Ee)};u.addEventListener("load",Ee),oe=setTimeout(Ee,3e3)};tl(es);const ze=R.useRef(null),er=R.useEffectEvent(Xn),po=R.useEffectEvent((u,P)=>{k({index:u,seq:P})}),mo=R.useEffectEvent(()=>{fe(),S.current&&$s(S.current),je&&(Rs.current=je.shown),_t&&Fs(Ot)}),tr=R.useEffectEvent(()=>{if(Es(!1),je&&Un(null),je&&je.src!==dt.current){Pe();return}es()});R.useEffect(()=>{if(!xe)return;const u=new cc({studioOrigin:window.location.origin,build:"4.618.1",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>er(),onWireframe:U=>{U.type==="wireframe:select"&&po(U.sectionIndex,U.clickSeq)},onModulesChange:()=>Es(u.has("html-swap")),onSwapEnd:()=>mo(),onSwapFailed:()=>tr()});ze.current=u;const P=U=>{u.handle(U)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),u.dispose(),Es(!1),ze.current===u&&(ze.current=null)}},[xe,ne.iframeBase]);const sr=xe?JSON.stringify([Pt,jt,Et,ye]):"";R.useEffect(()=>{sr&&er()},[sr]);const nr=R.useRef(null);R.useEffect(()=>{const u=nr.current;if(nr.current=je,je&&je!==u){ze.current?.refresh(je.shown)?Pe():tr();return}!je&&u&&u.shown!==u.src&&u.src===dt.current&&es()},[je]);const rr=()=>{ze.current?.refresh()||es()},Ot=yr(de.slug,t??""),_t=Oe&&Nt&&!!t,Rs=R.useRef(null);R.useEffect(()=>{if(_t)return Si(Ot)},[_t,Ot]);const{reload:$t}=Pi(de.slug,t??""),ar=R.useRef($t.seq);R.useEffect(()=>{if(ar.current!==$t.seq&&(ar.current=$t.seq,!!_t&&Rs.current===dt.current)){if($t.navigates){Fs(Ot);return}rr()}},[$t.seq]);const Ls=ia(Vt),Ft=ji(Ve(he)?Ls:""),or=R.useRef(Ft);R.useEffect(()=>{const u=or.current;if(or.current=Ft,!u||!Ft||u===Ft)return;const P=S.current;if(P)return Zl({iframe:P,reload:rr})},[Ft]);const ir=()=>{const u=fs.indexOf(x);C(fs[(u+1)%fs.length])},ts=(u,P)=>lr({...Qe,[u]:P}),lr=u=>{if(!ie)return;const P=ie;Fe.current=Be(M,u),pe(U=>({...U,[P]:u})),Lt({path:M,pageKey:P,params:u})},ho=sd({iframeBase:ne.iframeBase,resolvedPath:Te,activeGlobalSectionName:j?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),As=u=>{const P=me[u.key]??{},U=Be(u.path,me[u.key]??jn(u.path)[0]?.values??{});(j||Ne(U)!==Ne(Te))&&Pe(),Fe.current=U,O(null),H(null),te(null),k(null),ae(u.key),X(u.path),Lt({path:u.path,pageKey:u.key,params:P}),i.selectTarget({kind:"page",key:u.key,path:u.path})},cr=u=>{(j||Ne(u)!==Ne(Te))&&Pe(),Fe.current=u,O(null),H(null),te(null),k(null),ae(null),X(u),Lt({path:u,pageKey:null,params:{}})};Do(Rt,cr);const go=u=>{if(tt(he)){const oe=ce?Ui(ce,u.key,we):null;oe?As(oe):ms.info(e("sandbox.preview.blockOnNoPage"));return}if(!kt||!we){ms.error(e("sandbox.preview.previewMetadataNotReady"));return}Pe(),Fe.current=null;const P=Cr(we),U=Er(kt,P,u.key);O(u),H(null),te(U),k(null),i.selectTarget({kind:"section",key:u.key})},vo=u=>{p&&(O(null),H(u.key),te(null),Zt("blocks"),i.selectTarget({kind:"loader",key:u.key}))},xo=async({name:u,path:P,templateKey:U})=>{if(!t||!n)return;const oe=ma(P);if(oe){z(oe);return}const Ee=P.trim().startsWith("/")?P.trim():`/${P.trim()}`;if(Ye.some(Ce=>Ne(Ce.path)===Ne(Ee))){z(e("sandbox.preview.pageAlreadyExists",{path:Ee}));return}z(void 0);try{const Ce=U?await Fa(ce,U):void 0;if(U&&!Ce){z(e("sandbox.preview.templateNoLongerExists"));return}const mt=await wn.mutateAsync({name:u,path:Ee,template:Ce,schema:tt(he)?{meta:we,loadMeta:async()=>(await xs.refetch()).data}:void 0});q(!1),ms.success(e("sandbox.preview.pageCreated",{name:u})),await Sl(Hd),As({key:mt.key,name:mt.name,path:mt.path}),Zt("blocks")}catch(Ce){z(Ce instanceof Aa?e("sandbox.preview.pageSchemaNotReady"):Ce instanceof Error?Ce.message:e("sandbox.preview.failedToCreatePage"))}},Dt=nd({previewSurfaceActive:Nt,daemonReady:Gn,production:ne.mode==="production",servePreviewUrl:Ve(he)}),dr=rd({showPreviewToolbar:Dt,contentEditingEnabled:f,hasFrameworkRoutes:At.length>0}),ur=f?Da:[],fr=f?Ba:[],Bt=()=>{J(!1),Q("")},Os=f?j?.name??Wt?.title??ys?.name:void 0,_s=f&&(yn.isPending||xs.isPending),ss=_s?Kt(ne.iframeBase):Os,Mt=j?`section:${j.key}`:D?`loader:${D}`:f&&ie?`page:${ie}`:At.includes(Ne(M))?`route:${Ne(M)}`:void 0,ns=e(qd[x]),pr=x==="mobile"?r.jsx(ea,{size:16}):x==="tablet"?r.jsx(Vo,{size:16}):r.jsx(ta,{size:16}),bo=Dt?dr?r.jsxs("div",{className:"flex h-7 min-w-36 flex-1 items-stretch overflow-hidden rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background transition-colors hover:border-border",children:[r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx("button",{type:"button",onClick:ir,"aria-label":ns,className:Re("flex w-7 shrink-0 items-center justify-center border-r border-border/60 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",Nr),children:pr})}),r.jsx(rt,{children:ns})]}),r.jsxs(aa,{open:I,onOpenChange:u=>{J(u),u||Q("")},children:[r.jsx(na,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:_s?ss??void 0:j||Wt?Os:[Os,M].filter(Boolean).join(" · "),className:Re("group/page-picker flex min-w-0 flex-1 items-stretch whitespace-nowrap text-left text-xs text-muted-foreground",Nr),children:r.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:[j&&r.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:[r.jsx(Uo,{size:11}),e("sandbox.preview.globalBadge")]}),Wt&&r.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:[r.jsx(Wo,{size:11}),e("sandbox.preview.loaderBadge")]}),ss&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ss}),!_s&&!j&&!Wt&&r.jsx("span",{"data-testid":"preview-page-path",className:Re("min-w-0 truncate font-mono [direction:rtl]",ss?"ml-auto shrink-[2] text-right text-muted-foreground md:@max-[40rem]/panel-toolbar:hidden":"flex-1 text-left text-foreground"),children:r.jsx("bdi",{dir:"ltr",children:M})}),r.jsx(Mo,{size:12,className:Re("shrink-0 transition-transform",I&&"rotate-180")})]})})}),r.jsxs(ra,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(cn,{shouldFilter:!1,defaultValue:Mt,children:[r.jsx(dn,{value:G,onValueChange:u=>{Q(u),V.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(ln,{ref:V,className:"max-h-80",children:[r.jsx(un,{children:(!f||Ye.length===0)&&At.length===0&&(!f||bs.length===0)&&Sn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),ur.length>0&&r.jsx(We,{children:ur.map(u=>r.jsxs(qe,{value:`page:${u.key}`,"aria-current":Mt===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{Bt(),As(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),Yn.length>0&&r.jsx(We,{heading:e("sandbox.preview.siteRoutes"),children:Yn.map(u=>r.jsx(qe,{value:`route:${u}`,"aria-current":Mt===`route:${u}`||void 0,title:u,onSelect:()=>{Bt(),cr(u)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:u})},u))}),fr.length>0&&r.jsx(We,{heading:e("sandbox.preview.globalComponents"),children:fr.map(u=>r.jsx(qe,{value:`section:${u.key}`,"aria-current":Mt===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),go(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),Pn.length>0&&r.jsx(We,{heading:e("sandbox.preview.globalLoaders"),children:Pn.map(u=>r.jsx(qe,{value:`loader:${u.key}`,"aria-current":Mt===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),vo(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),f&&!j&&!D&&xt(M).some(u=>u.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:xt(M).map((u,P)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${P}`);const U=ws[u.name];return!U&&ks.length>0?r.jsx(ed,{paramName:u.name,template:M,value:Qe[u.name]??"",options:ks,onPick:lr,onCommit:oe=>ts(u.name,oe)},`${ie}:${u.name}`):U&&St?r.jsx(Mc,{sources:U,template:M,paramName:u.name,value:Qe[u.name]??"",sandboxRef:St,onCommit:oe=>ts(u.name,oe)},`${ie}:${u.name}`):r.jsx(Yc,{name:u.name,value:Qe[u.name]??"",onCommit:oe=>ts(u.name,oe)},`${ie}:${u.name}`)})}),f&&r.jsx("div",{className:"border-t p-1.5",children:r.jsxs(_e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Bt(),z(void 0),q(!0)},children:[r.jsx(sa,{size:16}),e("sandbox.preview.createNewPage")]})})]})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:ho}):null,mr=Dt||f?r.jsxs("div",{className:"flex min-w-0 max-w-[24rem] flex-1 items-center justify-center gap-1",children:[!(Dt&&dr)&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:ir,"aria-label":ns,children:pr})}),r.jsx(rt,{children:ns})]}),bo,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Jt&&r.jsx(jd,{tests:qa,load:Ja,onOpen:()=>Ga(!0),options:W,onChange:u=>{Y(u),i.previewAsChanged()},available:!!Ps||!An||!$n}),r.jsx(st,{onClick:Xa,disabled:Oe&&!zn,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Qr,{size:16})})]})]}):null,yo=(Ae||d)&&ne.mode==="sandbox",rs=Vd[x],as=x==="desktop"&&(_.width===0||_.width>=rs.width+2*qr),hr=as?1:Math.min(_.width>0?_.width/(rs.width+2*qr):1,1),wo=as?{width:"100%",height:"100%"}:{width:`${rs.width}px`,height:_.height>0?`${_.height/hr}px`:`${rs.height}px`,transform:`scale(${hr})`,transformOrigin:"top center"},gr=r.jsxs(r.Fragment,{children:[yo&&(Dt||f)&&r.jsx(st,{onClick:uo,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(xr,{size:16})}),p&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:fo,"aria-pressed":ye==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ye==="blocks",children:r.jsx(qo,{size:16})})}),r.jsx(rt,{children:e("sandbox.preview.blocksEditor")})]}),ct&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:$,"aria-pressed":T,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:T,children:r.jsx(Ho,{size:16})})}),r.jsx(rt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),ko=!!D&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[St&&Object.entries(ws).map(([u,P])=>(Qe[u]??"")===""?r.jsx(Gc,{sources:P,template:M,paramName:u,sandboxRef:St,onFill:U=>ts(u,U)},`${ie}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(Gs.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:mr}),children:mr}),r.jsx(Gs.Toolbar.Right.Portal,{fallback:gr,children:gr})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:ko?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(Vr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Zn,onViewJsonFile:$}),T&&ct&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Wr,{ref:A,virtualMcpId:t,pageKey:ct,onClose:L},he.kind==="legacy"?void 0:JSON.stringify([Ls,xe]))})]}):r.jsxs(Rr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(is,{ref:E,id:"preview-blocks-editor",defaultSize:ye==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ye==="blocks"&&r.jsx(Vr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Zn,onViewJsonFile:$})}),ye==="blocks"&&r.jsx(Lr,{withHandle:!0}),r.jsx(is,{id:"preview-canvas",defaultSize:ye==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(Rr,{orientation:"horizontal",disabled:!(T&&ct),children:[r.jsx(is,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:u=>{if(!u)return;const P=()=>F(oe=>oe.width===u.clientWidth&&oe.height===u.clientHeight?oe:{width:u.clientWidth,height:u.clientHeight});P();const U=new ResizeObserver(P);return U.observe(u),()=>U.disconnect()},className:Re("h-full relative overflow-clip flex justify-center",Nt&&!as&&"bg-muted/30"),children:[(be||Ia)&&Nt&&r.jsx(si,{}),ne.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}),ne.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Bs,{kind:"starting",progress:Tn,claimPhase:Ss})}),!re&&Xe.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Bs,{kind:"suspended",onResume:Ie.resume})}),!re&&Xe.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Bs,{kind:"errored",error:Xe.error,onRetry:Ie.retry,connectionsHref:`/${de.slug}/settings/connections`})}),ne.showWakingPill&&r.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:[r.jsx(it,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ye==="visual"&&!b&&r.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:[r.jsx(xr,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ye==="visual"&&b&&r.jsx(pc,{element:b,onDismiss:()=>w(null)}),Nt&&et&&r.jsx("div",{className:Re("shrink-0",!as&&"bg-background shadow-edge"),style:wo,onMouseLeave:co,children:r.jsx("iframe",{ref:S,src:pt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Vn.handleError,onLoad:u=>{if($s(u.currentTarget),js(br),no(pt),Vn.handleLoad(),fe(),Rs.current=dt.current,_t&&Fs(Ot),ne.mode!=="sandbox"||re){(ne.mode==="production"&&!ne.showWakingPill||re)&&ye==="blocks"&&Ts();return}if(Lo("vm_preview_loaded",{view_mode:ye,vm_id:Ke?.sandboxHandle??null}),!j)try{const P=S.current?.contentWindow?.location?.pathname;if(!P)return;const U=Fe.current;if(U!==null&&(Fe.current=null,Ne(P)!==Ne(U))||Ne(P)===Ne(Te))return;X(P),Lt({path:P,pageKey:se,params:Qe})}catch{}ye==="visual"&&Qn(),ye==="blocks"&&Ts()}},ne.iframeBase)})]})}),T&&ct&&r.jsxs(r.Fragment,{children:[r.jsx(Lr,{withHandle:!0}),r.jsx(is,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Wr,{ref:A,virtualMcpId:t,pageKey:ct,onClose:L},he.kind==="legacy"?void 0:JSON.stringify([Ls,xe]))})]})]})})]})}),r.jsx(dd,{open:ee,onOpenChange:q,isPending:wn.isPending,error:K,templates:Ye,onSubmit:xo})]})}const Zs={app:null,split:!1};function eu(t){const e=le.c(24),{project:s,maxApps:n,children:o}=t,c=Se();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={silent:!0},e[0]=d):d=e[0];const i=Yo(d),a=bt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const g=l;let f;e[3]!==g.apps?(f=g.apps??[],e[3]=g.apps,e[4]=f):f=e[4];const p=f;let m;e[5]!==i.update||e[6]!==a||e[7]!==s.id||e[8]!==s.metadata||e[9]!==g||e[10]!==c?(m=b=>i.update.mutate({id:s.id,data:{metadata:{...Pl(s.metadata),runtime:{...g,apps:b.length?b:null}}}},{onSuccess:()=>a.start(),onError:()=>ms.error(c("sandbox.appTabs.saveError"))}),e[5]=i.update,e[6]=a,e[7]=s.id,e[8]=s.metadata,e[9]=g,e[10]=c,e[11]=m):m=e[11];const v=m,y=g.path??null;let h,x;e[12]!==p||e[13]!==v?(h=b=>v([...p,{path:b}]),x=b=>v(p.filter(w=>w.path!==b)),e[12]=p,e[13]=v,e[14]=h,e[15]=x):(h=e[14],x=e[15]);let C;return e[16]!==p||e[17]!==o||e[18]!==n||e[19]!==s.id||e[20]!==y||e[21]!==h||e[22]!==x?(C=r.jsx(tu,{virtualMcpId:s.id,mainPath:y,apps:p,maxApps:n,onAddApp:h,onRemoveApp:x,children:o}),e[16]=p,e[17]=o,e[18]=n,e[19]=s.id,e[20]=y,e[21]=h,e[22]=x,e[23]=C):C=e[23],C}function tu(t){const e=le.c(102),{virtualMcpId:s,mainPath:n,apps:o,maxApps:c,onAddApp:d,onRemoveApp:i,children:a}=t,l=Se(),g=pa(),{currentBranch:f}=lt(),p=bt(),m=hn().lifecycle.phase,v=Ut(s,f),{url:y}=ua(s);let h;e[0]!==v||e[1]!==y?(h=Ve(v)??y,e[0]=v,e[1]=y,e[2]=h):h=e[2];const x=h,C=x??p.previewUrl,b=!!x||m==="running",w=!b&&p.status==="errored";let N;e[3]!==p.vmEntry?.startedWith?.apps?(N=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=N):N=e[4];const k=N;let S;e[5]!==s?(S=qs.previewAppLayout(s),e[5]=s,e[6]=S):S=e[6];const[E,T]=Ws(S,su);let B;e[7]!==o||e[8]!==E?(B=o.some(fe=>fe.path===E.app)?E.app:null,e[7]=o,e[8]=E,e[9]=B):B=e[9];const A=B,L=A!==null&&E.split&&!g,$=A===null||L,_=A??o[0]?.path??null,[F,I]=R.useState(null),[J,W]=R.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{I(null),W(!1)},e[10]=Y):Y=e[10];const G=Y;let Q;e[11]!==o||e[12]!==F||e[13]!==g||e[14]!==n||e[15]!==d||e[16]!==T?(Q=()=>{if(F===null)return;const fe=_r(F);if(!fe){G();return}if(fe===_r(n??"")||o.some(de=>de.path===fe)){W(!0);return}d(fe),T({app:fe,split:!g}),G()},e[11]=o,e[12]=F,e[13]=g,e[14]=n,e[15]=d,e[16]=T,e[17]=Q):Q=e[17];const V=Q;let ee;e[18]!==n||e[19]!==l?(ee=n?Ms(n):l("sandbox.appTabs.root"),e[18]=n,e[19]=l,e[20]=ee):ee=e[20];const q=ee;let K;e[21]!==L||e[22]!==l?(K=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=K):K=e[23];const z=K;let j;e[24]!==l?(j=l("sandbox.appTabs.label"),e[24]=l,e[25]=j):j=e[25];let O;e[26]!==l?(O=l("sandbox.appTabs.main"),e[26]=l,e[27]=O):O=e[27];let D;e[28]!==l?(D=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=D):D=e[29];let H;e[30]!==T?(H=()=>T(Zs),e[30]=T,e[31]=H):H=e[31];let Z;e[32]!==w||e[33]!==q||e[34]!==b||e[35]!==$||e[36]!==O||e[37]!==D||e[38]!==H?(Z=r.jsx(Gr,{label:q,badge:O,hint:D,ready:b,failed:w,onScreen:$,onSelect:H}),e[32]=w,e[33]=q,e[34]=b,e[35]=$,e[36]=O,e[37]=D,e[38]=H,e[39]=Z):Z=e[39];let te;if(e[40]!==o||e[41]!==A||e[42]!==w||e[43]!==q||e[44]!==i||e[45]!==b||e[46]!==T||e[47]!==L||e[48]!==l){let fe;e[50]!==A||e[51]!==w||e[52]!==q||e[53]!==i||e[54]!==b||e[55]!==T||e[56]!==L||e[57]!==l?(fe=de=>{const Le=Ms(de.path);return r.jsx(Gr,{label:Le,hint:l("sandbox.appTabs.extraHint",{app:q}),ready:b,failed:w,onScreen:de.path===A,onSelect:()=>T({app:de.path,split:L}),onRemove:()=>i(de.path),removeLabel:l("sandbox.appTabs.remove",{app:Le})},de.path)},e[50]=A,e[51]=w,e[52]=q,e[53]=i,e[54]=b,e[55]=T,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],te=o.map(fe),e[40]=o,e[41]=A,e[42]=w,e[43]=q,e[44]=i,e[45]=b,e[46]=T,e[47]=L,e[48]=l,e[49]=te}else te=e[49];let M;e[59]!==Z||e[60]!==te||e[61]!==j?(M=r.jsxs("div",{role:"tablist","aria-label":j,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[Z,te]}),e[59]=Z,e[60]=te,e[61]=j,e[62]=M):M=e[62];let X;e[63]!==o.length||e[64]!==V||e[65]!==F||e[66]!==J||e[67]!==c||e[68]!==l?(X=F!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),V()},children:r.jsx("input",{autoFocus:!0,value:F,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":J,onChange:fe=>{I(fe.target.value),W(!1)},onBlur:G,onKeyDown:fe=>{fe.key==="Escape"&&G()},className:Re("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",J?"border-destructive":"border-border")})}):o.length<c&&r.jsx(vt,{label:l("sandbox.appTabs.add"),onClick:()=>I(""),children:r.jsx(sa,{})}),e[63]=o.length,e[64]=V,e[65]=F,e[66]=J,e[67]=c,e[68]=l,e[69]=X):X=e[69];let se;e[70]!==g||e[71]!==T||e[72]!==L||e[73]!==z||e[74]!==_?(se=!g&&_&&r.jsx(vt,{label:z,active:L,onClick:()=>T(L?Zs:{app:_,split:!0}),children:r.jsx(Go,{})}),e[70]=g,e[71]=T,e[72]=L,e[73]=z,e[74]=_,e[75]=se):se=e[75];let ae;e[76]!==M||e[77]!==X||e[78]!==se?(ae=r.jsxs(r.Fragment,{children:[M,X,se]}),e[76]=M,e[77]=X,e[78]=se,e[79]=ae):ae=e[79];const me=ae;let pe;e[80]!==me?(pe=r.jsx(Gs.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:me}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:me})}),e[80]=me,e[81]=pe):pe=e[81];let be;e[82]!==a||e[83]!==$?(be=$&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:a}),e[82]=a,e[83]=$,e[84]=be):be=e[84];let ge;e[85]!==A||e[86]!==w||e[87]!==p.start||e[88]!==x||e[89]!==q||e[90]!==C||e[91]!==b||e[92]!==T||e[93]!==L||e[94]!==k?(ge=A!==null&&r.jsx(nu,{name:Ms(A),mainName:q,appUrl:C?jl(C,A):null,ready:b,failed:w,notStarted:!x&&!k.includes(A),onStart:p.start,className:Re(L&&"border-l border-border"),onClose:L?()=>T({app:A,split:!1}):void 0},A),e[85]=A,e[86]=w,e[87]=p.start,e[88]=x,e[89]=q,e[90]=C,e[91]=b,e[92]=T,e[93]=L,e[94]=k,e[95]=ge):ge=e[95];let ve;e[96]!==be||e[97]!==ge?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[be,ge]}),e[96]=be,e[97]=ge,e[98]=ve):ve=e[98];let Pe;return e[99]!==pe||e[100]!==ve?(Pe=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Pe):Pe=e[101],Pe}function su(t){return t??Zs}function Gr(t){const e=le.c(28),{label:s,badge:n,hint:o,ready:c,failed:d,onScreen:i,onSelect:a,onRemove:l,removeLabel:g}=t,f=i?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let p;e[0]!==f?(p=Re("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",f),e[0]=f,e[1]=p):p=e[1];const m=c?"bg-success":d?"bg-destructive":"animate-pulse bg-warning";let v;e[2]!==m?(v=Re("size-1.5 rounded-full",m),e[2]=m,e[3]=v):v=e[3];let y;e[4]!==v?(y=r.jsx("span",{"aria-hidden":!0,className:v}),e[4]=v,e[5]=y):y=e[5];let h;e[6]!==s?(h=r.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=h):h=e[7];let x;e[8]!==n?(x=n&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:n}),e[8]=n,e[9]=x):x=e[9];let C;e[10]!==i||e[11]!==a||e[12]!==y||e[13]!==h||e[14]!==x?(C=r.jsx(nt,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:a,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[y,h,x]})}),e[10]=i,e[11]=a,e[12]=y,e[13]=h,e[14]=x,e[15]=C):C=e[15];let b;e[16]!==o?(b=r.jsx(rt,{className:"max-w-64",children:o}),e[16]=o,e[17]=b):b=e[17];let w;e[18]!==C||e[19]!==b?(w=r.jsxs(at,{children:[C,b]}),e[18]=C,e[19]=b,e[20]=w):w=e[20];let N;e[21]!==l||e[22]!==g?(N=l&&r.jsx("button",{type:"button","aria-label":g,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(ja,{className:"size-3"})}),e[21]=l,e[22]=g,e[23]=N):N=e[23];let k;return e[24]!==w||e[25]!==N||e[26]!==p?(k=r.jsxs("div",{className:p,children:[w,N]}),e[24]=w,e[25]=N,e[26]=p,e[27]=k):k=e[27],k}function nu(t){const e=le.c(71),{name:s,mainName:n,appUrl:o,ready:c,failed:d,notStarted:i,onStart:a,className:l,onClose:g}=t,f=Se(),[p,m]=R.useState("/"),[v,y]=R.useState("desktop"),[h,x]=R.useState(0),C=R.useRef(null);let b;e[0]!==o||e[1]!==p?(b=o?El(o,p):null,e[0]=o,e[1]=p,e[2]=b):b=e[2];const w=b;let N;e[3]!==l?(N=Re("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=N):N=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=D=>{D.preventDefault(),m(C.current?.value||"/")},e[5]=k):k=e[5];let S;e[6]!==s||e[7]!==f?(S=f("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=f,e[8]=S):S=e[8];let E;e[9]!==p||e[10]!==S?(E=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:k,children:r.jsx("input",{ref:C,defaultValue:p,"aria-label":S,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=p,e[10]=S,e[11]=E):E=e[11];let T;e[12]!==v||e[13]!==f?(T=f(v==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=v,e[13]=f,e[14]=T):T=e[14];let B;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=()=>y(au),e[15]=B):B=e[15];let A;e[16]!==v?(A=v==="desktop"?r.jsx(ta,{}):r.jsx(ea,{}),e[16]=v,e[17]=A):A=e[17];let L;e[18]!==T||e[19]!==A?(L=r.jsx(vt,{label:T,onClick:B,children:A}),e[18]=T,e[19]=A,e[20]=L):L=e[20];let $;e[21]!==s||e[22]!==f?($=f("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=f,e[23]=$):$=e[23];const _=!w||!c;let F,I;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>x(ru),I=r.jsx(Ao,{}),e[24]=F,e[25]=I):(F=e[24],I=e[25]);let J;e[26]!==$||e[27]!==_?(J=r.jsx(vt,{label:$,disabled:_,onClick:F,children:I}),e[26]=$,e[27]=_,e[28]=J):J=e[28];let W;e[29]!==s||e[30]!==f?(W=f("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=f,e[31]=W):W=e[31];const Y=!w||!c;let G;e[32]!==w?(G=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=G):G=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(Qr,{}),e[34]=Q):Q=e[34];let V;e[35]!==W||e[36]!==Y||e[37]!==G?(V=r.jsx(vt,{label:W,disabled:Y,onClick:G,children:Q}),e[35]=W,e[36]=Y,e[37]=G,e[38]=V):V=e[38];let ee;e[39]!==s||e[40]!==g||e[41]!==f?(ee=g&&r.jsx(vt,{label:f("sandbox.appPane.close",{app:s}),onClick:g,children:r.jsx(ja,{})}),e[39]=s,e[40]=g,e[41]=f,e[42]=ee):ee=e[42];let q;e[43]!==J||e[44]!==V||e[45]!==ee||e[46]!==E||e[47]!==L?(q=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[E,L,J,V,ee]}),e[43]=J,e[44]=V,e[45]=ee,e[46]=E,e[47]=L,e[48]=q):q=e[48];let K;e[49]!==n||e[50]!==f?(K=f("sandbox.appPane.previewOnly",{app:n}),e[49]=n,e[50]=f,e[51]=K):K=e[51];let z;e[52]!==K?(z=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:K}),e[52]=K,e[53]=z):z=e[53];let j;e[54]!==v||e[55]!==d||e[56]!==n||e[57]!==s||e[58]!==i||e[59]!==a||e[60]!==c||e[61]!==h||e[62]!==w||e[63]!==f?(j=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:c&&i?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:f("sandbox.appPane.notStarted",{app:s})}),r.jsx(_e,{size:"sm",variant:"outline",onClick:a,children:f("sandbox.appPane.start",{app:s})})]}):!c||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:c?f("sandbox.appPane.noUrl"):d?f("sandbox.appPane.failed",{app:n}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:s,className:Re("h-full bg-background",v==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=v,e[55]=d,e[56]=n,e[57]=s,e[58]=i,e[59]=a,e[60]=c,e[61]=h,e[62]=w,e[63]=f,e[64]=j):j=e[64];let O;return e[65]!==s||e[66]!==N||e[67]!==q||e[68]!==z||e[69]!==j?(O=r.jsxs("section",{"aria-label":s,className:N,children:[q,z,j]}),e[65]=s,e[66]=N,e[67]=q,e[68]=z,e[69]=j,e[70]=O):O=e[70],O}function ru(t){return t+1}function au(t){return t==="desktop"?"mobile":"desktop"}function vt(t){const e=le.c(11),{label:s,children:n,active:o,disabled:c,onClick:d}=t;let i;e[0]!==o||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==d?(i=r.jsx(nt,{asChild:!0,children:r.jsx(st,{"aria-label":s,"aria-pressed":o,active:o,disabled:c,onClick:d,children:n})}),e[0]=o,e[1]=n,e[2]=c,e[3]=s,e[4]=d,e[5]=i):i=e[5];let a;e[6]!==s?(a=r.jsx(rt,{children:s}),e[6]=s,e[7]=a):a=e[7];let l;return e[8]!==i||e[9]!==a?(l=r.jsxs(at,{children:[i,a]}),e[8]=i,e[9]=a,e[10]=l):l=e[10],l}const ou=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},iu=1e4,lu=1e4,cu=5e3,du=2;function uu(t,e){return t&&e===0?lu:Math.min(1e3*2**Math.max(0,e-1),cu)}function fu(t,e,s){return e?!0:t===!0&&s<du}function pu(t,e){const s=le.c(11),n=ou,o=Oo();let c;s[0]!==t?(c=sn.localAppReachable(t??""),s[0]=t,s[1]=c):c=s[1];const d=c;let i;s[2]!==n||s[3]!==o||s[4]!==d||s[5]!==t?(i=async f=>{const{signal:p}=f,m=new AbortController,v=()=>m.abort();p.addEventListener("abort",v);const y=setTimeout(v,iu),h=await n(t,m.signal).catch(hu);clearTimeout(y),p.removeEventListener("abort",v);const x=o.getQueryData(d),C=h?0:(x?.failures??0)+1;return{up:fu(x?.up??null,h,C),failures:C}},s[2]=n,s[3]=o,s[4]=d,s[5]=t,s[6]=i):i=s[6];const a=!!t;let l;s[7]!==d||s[8]!==i||s[9]!==a?(l={queryKey:d,queryFn:i,enabled:a,retry:!1,staleTime:0,gcTime:0,refetchInterval:mu},s[7]=d,s[8]=i,s[9]=a,s[10]=l):l=s[10];const{data:g}=Yr(l);return t?g?.up??null:null}function mu(t){return t.state.data?uu(t.state.data.up,t.state.data.failures):!1}function hu(){return!1}function gu(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const s=e.problem;return!s||s.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:s}}return{kind:"connecting"}}function jf(t){const e=le.c(53),{virtualMcpId:s}=t,n=Se(),o=Qo(s),{connection:c}=fa(s),{activeTask:d,taskId:i,currentBranch:a}=lt(),l=_l(i),[g,f]=R.useState(!1),p=Ut(s,a);let m;e[0]!==p||e[1]!==c?(m=c?Ve(p):null,e[0]=p,e[1]=c,e[2]=m):m=e[2];const v=m,y=pu(v),h=Na(),x=Nl("multi_app_preview");if(Rl({threadId:i,sandboxBranch:d?.branch??a,agentHasRepo:zs(o?.metadata),threadHasRepo:zs(l)||zs(d?.metadata)})==="none"&&!c){let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx($r,{className:"size-7 text-foreground"})}),e[3]=k):k=e[3];let S;e[4]!==n?(S=n("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=n,e[5]=S):S=e[5];let E;e[6]!==n?(E=n("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=n,e[7]=E):E=e[7];let T,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>f(!0),B=r.jsx($r,{className:"size-4"}),e[8]=T,e[9]=B):(T=e[8],B=e[9]);let A;e[10]!==n?(A=n("mainPanelTabs.previewTab.connectGithub"),e[10]=n,e[11]=A):A=e[11];let L;e[12]!==A?(L=r.jsxs(_e,{onClick:T,children:[B,A]}),e[12]=A,e[13]=L):L=e[13];let $;e[14]!==S||e[15]!==E||e[16]!==L?($=r.jsx(Cl,{className:"h-full",image:k,title:S,description:E,actions:L}),e[14]=S,e[15]=E,e[16]=L,e[17]=$):$=e[17];let _;e[18]!==g?(_=r.jsx(Tl,{open:g,onOpenChange:f,mode:"agent"}),e[18]=g,e[19]=_):_=e[19];let F;return e[20]!==_||e[21]!==$?(F=r.jsxs(r.Fragment,{children:[$,_]}),e[20]=_,e[21]=$,e[22]=F):F=e[22],F}if(c&&o&&!Ve(p)){let k;e[23]!==h||e[24]!==p?(k=gu({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=k):k=e[25];let S;e[26]!==c.endpoint?(S=Ni(c.endpoint),e[26]=c.endpoint,e[27]=S):S=e[27];let E;return e[28]!==k||e[29]!==S?(E=r.jsx(xu,{status:k,host:S}),e[28]=k,e[29]=S,e[30]=E):E=e[30],E}if(v&&y!==!0){let k;e[31]!==n?(k=n("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=n,e[32]=k):k=e[32];let S;e[33]!==v||e[34]!==n?(S=n("mainPanelTabs.previewTab.localAppWaiting.body",{host:vu(v)}),e[33]=v,e[34]=n,e[35]=S):S=e[35];let E;e[36]!==S?(E=r.jsx(Pa,{text:S}),e[36]=S,e[37]=E):E=e[37];let T;e[38]!==n?(T=n("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=n,e[39]=T):T=e[39];let B;e[40]!==T?(B=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=B):B=e[41];let A;return e[42]!==k||e[43]!==E||e[44]!==B?(A=r.jsx(hs,{headingLevel:2,waiting:!0,title:k,lead:E,footer:B}),e[42]=k,e[43]=E,e[44]=B,e[45]=A):A=e[45],A}let b;e[46]!==s?(b=r.jsx(Zd,{virtualMcpId:s}),e[46]=s,e[47]=b):b=e[47];const w=b;let N;return e[48]!==o||e[49]!==x||e[50]!==w||e[51]!==c?(N=r.jsx(_o,{children:x&&o&&!c?r.jsx(eu,{project:o,maxApps:kl,children:w}):w}),e[48]=o,e[49]=x,e[50]=w,e[51]=c,e[52]=N):N=e[52],N}function vu(t){try{return new URL(t).host}catch{return t}}function xu(t){const e=le.c(13),{status:s,host:n}=t,o=Se();if(s.kind==="connected"){let i;e[0]!==o?(i=o("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=o,e[3]=a):a=e[3];let l;return e[4]!==i||e[5]!==a?(l=r.jsx(hs,{headingLevel:2,waiting:!1,title:i,lead:a}),e[4]=i,e[5]=a,e[6]=l):l=e[6],l}let c;e[7]!==n||e[8]!==s?(c=Ml(s,n),e[7]=n,e[8]=s,e[9]=c):c=e[9];let d;return e[10]!==n||e[11]!==c?(d=r.jsx(Bl,{wait:c,hosts:n}),e[10]=n,e[11]=c,e[12]=d):d=e[12],d}export{Bl as L,jf as P,hs as S,Pf as u};