decocms 4.507.4 → 4.508.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-BAL0Xqny.js → ActiveShapeUtils-C3FzlJkn.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-T1ZkrR0m.js → AlertCircle-DRgK9JB_.js} +1 -1
  3. package/dist/client/assets/{AreaChart-Dvv3jub6.js → AreaChart-D2DvxH5P.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CYKCt2D_.js → ArrowLeft-BzwJwvy1.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CrfIcCHY.js → ArrowUp-CxFxaW35.js} +1 -1
  6. package/dist/client/assets/{BarChart-Z1_46Epq.js → BarChart-BeLSl_Z5.js} +1 -1
  7. package/dist/client/assets/{Building02-BzqtLsiR.js → Building02-rClnD4uc.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-DSzs6PbU.js → CategoricalChart-Dxc9tBh7.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-Cyp8J2-O.js → CheckCircle-mTX9fWaM.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-bMnA4IfS.js → ChevronSelectorVertical-Dl1xrKr0.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-DWP9CKrv.js → ChevronUp-kQFA9QX6.js} +1 -1
  12. package/dist/client/assets/{Copy01-4Op2Jutz.js → Copy01-hfEOHSDl.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-8ijEtUnj.js → CreditCard01-DF7MTKJ3.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-Ik04gU0Z.js → DotsVertical-C3XWNKuz.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-1QYVhNWP.js → ErrorBarContext-LolURZUN.js} +1 -1
  16. package/dist/client/assets/{Globe04-DTYU91Z7.js → Globe04-JT--e5Bh.js} +1 -1
  17. package/dist/client/assets/{Image01-BoNtuy7T.js → Image01-jGkvOWRJ.js} +1 -1
  18. package/dist/client/assets/{Key01-DVtNzjvm.js → Key01-BzxD_x8A.js} +1 -1
  19. package/dist/client/assets/{Link01-COgU4X0d.js → Link01-OCnw3a5L.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-1s3iBfyN.js → LinkBroken01-CHV_OJuf.js} +1 -1
  21. package/dist/client/assets/{Monitor01-BMmwz8er.js → Monitor01-CvJxGIjI.js} +1 -1
  22. package/dist/client/assets/{Play-C_Kc3qTH.js → Play-03q5nxE3.js} +1 -1
  23. package/dist/client/assets/{Plus-bl3Do1ab.js → Plus-DNWiwlMd.js} +1 -1
  24. package/dist/client/assets/{SearchMd-CuIII2sM.js → SearchMd-uZ1fg-aL.js} +1 -1
  25. package/dist/client/assets/{Sector-Ca7XNqZx.js → Sector-C1Q0fcJu.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-CQamAcPv.js → ShoppingBag01-C6lx54lK.js} +1 -1
  27. package/dist/client/assets/{Sun-CT-ZvHiv.js → Sun-hQOE8_Ah.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BMvJE9CE.js → SwitchHorizontal01-BRLZiSEm.js} +1 -1
  29. package/dist/client/assets/{Tool01-eRpAM_xP.js → Tool01-BsXZFLbB.js} +1 -1
  30. package/dist/client/assets/{Trash01-DtrweZMg.js → Trash01-AnrBN8Oq.js} +1 -1
  31. package/dist/client/assets/{Upload01-dCDZcDY3.js → Upload01-D1D--Ifq.js} +1 -1
  32. package/dist/client/assets/{User01-N2rUxuZL.js → User01-D7NqDG9h.js} +1 -1
  33. package/dist/client/assets/{UserSquare-BPqJsNeY.js → UserSquare-BO3h4SWI.js} +1 -1
  34. package/dist/client/assets/{Users01--Pjgrl_5.js → Users01-BCrqWlZC.js} +1 -1
  35. package/dist/client/assets/{XAxis-Bcjro0Ob.js → XAxis-Cdyr85g2.js} +1 -1
  36. package/dist/client/assets/{XClose-DBK6xbU_.js → XClose-BHIq2rSj.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-BSgJ_qOu.js → ZoomOut-CKwphFFF.js} +1 -1
  38. package/dist/client/assets/{access-gate-DSd_cW3Q.js → access-gate-Ds8y-c7d.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-B2yW98GA.js → add-connection-dialog-CI2jVjIC.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-DAcM92Eu.js → agent-analytics-BBNdaLPH.js} +1 -1
  41. package/dist/client/assets/agent-app-Tk7ibbxk.js +1 -0
  42. package/dist/client/assets/{agent-assets-CpU6grt8.js → agent-assets-w7G4G7NG.js} +1 -1
  43. package/dist/client/assets/{agent-automation-B-gVk0Iu.js → agent-automation-DoUvIa4h.js} +1 -1
  44. package/dist/client/assets/{agent-automations-Un1oiGTh.js → agent-automations-DRXZ46C-.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-D2iZNBca.js → agent-connect-sources-lMSZjLpx.js} +1 -1
  46. package/dist/client/assets/agent-deck-G9eN_-lW.js +1 -0
  47. package/dist/client/assets/{agent-e2e-BU3R6DRe.js → agent-e2e-4_Wcmxwo.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-De5Xjb8U.js → agent-experiments-Kqg0ctEE.js} +1 -1
  49. package/dist/client/assets/{agent-file-BUbOjh-I.js → agent-file-BU_XbaPw.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-DUYz3ME7.js → agent-hosting-BR2uRV4C.js} +1 -1
  51. package/dist/client/assets/{agent-icon-u2ivNkJK.js → agent-icon-ndY1RWjU.js} +1 -1
  52. package/dist/client/assets/agent-library-BtjlzgNd.js +1 -0
  53. package/dist/client/assets/agent-library-file-CGC_OSnB.js +1 -0
  54. package/dist/client/assets/{agent-monitor-6ujZcZJe.js → agent-monitor-yoz-N-1r.js} +1 -1
  55. package/dist/client/assets/{agent-overview-Bxaa87a8.js → agent-overview-CUf0Y3ir.js} +1 -1
  56. package/dist/client/assets/{agent-releases-Bf8Vhnqt.js → agent-releases-szVOzGiC.js} +1 -1
  57. package/dist/client/assets/agent-settings-vKXRBe4W.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-B8Gy3O3j.js → agent-site-editor-B7iEqwmc.js} +1 -1
  59. package/dist/client/assets/agent-site-editor-code-CyNojH-R.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-CxWPoAy6.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-B2DApGX5.js +1 -0
  62. package/dist/client/assets/agent-view-CD5NqqDd.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-D7Efz7aP.js → agent-view-guard-D3N2evVp.js} +1 -1
  64. package/dist/client/assets/{agents-list-CjgsD106.js → agents-list-DyLpBolv.js} +1 -1
  65. package/dist/client/assets/{ai-providers-DYVp9dmp.js → ai-providers-B0Oo6J0F.js} +1 -1
  66. package/dist/client/assets/{alert-C4LKzrU_.js → alert-BMizf1K4.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-DiDDn4Bn.js → alert-dialog-BwIOugPC.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-BTuh0sxQ.js → analytics-sections-Dt6_PKUK.js} +1 -1
  69. package/dist/client/assets/api-keys-D24Q5aDz.js +1 -0
  70. package/dist/client/assets/{api-keys-DT2jF2YV.js → api-keys-dCavcgAr.js} +1 -1
  71. package/dist/client/assets/{app-editor-2Z9PUdLT.js → app-editor-DXunZc54.js} +1 -1
  72. package/dist/client/assets/{asset-utils-D_uCIG2N.js → asset-utils-BIz3ln3H.js} +1 -1
  73. package/dist/client/assets/{auth-CExazRf5.js → auth-Ru0XeHze.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-Bg4s733G.js → auth-catchall-D7KASRkB.js} +1 -1
  75. package/dist/client/assets/{auth-entry-DklrAmyd.js → auth-entry-CnbgzVrn.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-yWRpLXbZ.js → auth-split-layout-BlnrsRxb.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-B43eE55s.js → authenticate-and-persist-oauth-Bdc0JCPD.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-rr5_wiXj.js → automation-list-row-CwFLSkkD.js} +1 -1
  79. package/dist/client/assets/{automation-runs-Dzy5TJhL.js → automation-runs-3gdVKwGN.js} +1 -1
  80. package/dist/client/assets/{automations-D7-lperE.js → automations-Mz8s_9Y-.js} +1 -1
  81. package/dist/client/assets/{autosend-CUxwH8aa.js → autosend-BkZD94wn.js} +1 -1
  82. package/dist/client/assets/{avatar-k7zVZ1nb.js → avatar-svlBTViV.js} +1 -1
  83. package/dist/client/assets/{badge-BE7xUmDV.js → badge-DV-csERH.js} +1 -1
  84. package/dist/client/assets/{block-document-BISmqkMT.js → block-document-CPap6Hoh.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-9rYmJjdK.js → blocks-preview-workspace-context-C6DV9nNg.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-B0RpWAaK.js → blocks-tab-states-BiTn5vNe.js} +3 -3
  87. package/dist/client/assets/{blog-schema-CYYjVJrx.js → blog-schema-m8oXhY_o.js} +1 -1
  88. package/dist/client/assets/{board-analytics-BPcQpX0a.js → board-analytics-qsIYH9UQ.js} +1 -1
  89. package/dist/client/assets/{buckets-7sZ822gQ.js → buckets-B2eTUubY.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-4hqh7aGt.js → build-improve-prompt-doc-CXtDfPwS.js} +1 -1
  91. package/dist/client/assets/{calendar-C_cq2tGg.js → calendar-BJAZ7ITP.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-Dm_yuCkZ.js → capability-load-error-DfOS2qD0.js} +1 -1
  93. package/dist/client/assets/{category-editor-CQjH2oSA.js → category-editor-DwIdkmBC.js} +1 -1
  94. package/dist/client/assets/{chart-B2lVx6UJ.js → chart-B2WOgoqq.js} +1 -1
  95. package/dist/client/assets/{chat-context-DL44ik-l.js → chat-context-ChcTnk8Q.js} +1 -1
  96. package/dist/client/assets/{chat-draft-BGj508pV.js → chat-draft-iM4uBzs8.js} +1 -1
  97. package/dist/client/assets/{checkbox-CTOJeQYr.js → checkbox-CWzVH6do.js} +1 -1
  98. package/dist/client/assets/{choose-editor-BoM3oSha.js → choose-editor-L8_fuH5l.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-CmIjetif.js → cli-auth-success-xPKL8BL-.js} +1 -1
  100. package/dist/client/assets/{client-icons-C4GjI8VB.js → client-icons-C0i-kUEb.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-Crw1X5_M.js +1 -0
  102. package/dist/client/assets/{collapsible-DM3c5ETU.js → collapsible-wEeZPPIk.js} +1 -1
  103. package/dist/client/assets/{collection-detail-D94lQ1Zc.js → collection-detail-DkQebCJX.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-Dz_a8Rja.js → collection-display-button-BKVS2PGV.js} +1 -1
  105. package/dist/client/assets/{collection-search-BgZ6ncMc.js → collection-search-Ov4rPa97.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-DYmuLoSL.js → collection-table-wrapper-Cd2H8RtH.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-C9sF3Ij7.js → collection-tabs-D-zLkcuK.js} +1 -1
  108. package/dist/client/assets/{column-rules-DVJwf6Ig.js → column-rules-BqHh278p.js} +1 -1
  109. package/dist/client/assets/{combobox-CWvfr2Bd.js → combobox-AVFbBj8k.js} +1 -1
  110. package/dist/client/assets/{command-kL2BpXNu.js → command-ChZnkO48.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-BWwhuQv7.js → companion-mcps-section-BdsvuyO-.js} +1 -1
  112. package/dist/client/assets/{config-CmZDuh3u.js → config-Bm6KxaFP.js} +1 -1
  113. package/dist/client/assets/{connect-Cxk1UNDF.js → connect-CVqC_htJ.js} +1 -1
  114. package/dist/client/assets/{connect-layout-CuQDm86w.js → connect-layout-BnvEVu6w.js} +1 -1
  115. package/dist/client/assets/{connection-ClykfAAS.js → connection-BQYwMjUn.js} +1 -1
  116. package/dist/client/assets/{connection-card-CKRGS9aW.js → connection-card-w1pyA0AW.js} +1 -1
  117. package/dist/client/assets/{connection-detail-CIN8FXIj.js → connection-detail-D3sGWJ5y.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-DaJ65Rex.js → connection-form-helpers--5_FBdwa.js} +1 -1
  119. package/dist/client/assets/{connections-q1djGcEd.js → connections-2CDOGfAf.js} +1 -1
  120. package/dist/client/assets/{content-tab-Dvm-MV4U.js → content-tab-ufWzSoXT.js} +3 -3
  121. package/dist/client/assets/{context-BXY_cB7z.js → context-CRfcwldP.js} +1 -1
  122. package/dist/client/assets/{context-menu-CJERsJPE.js → context-menu-CeIyABDi.js} +1 -1
  123. package/dist/client/assets/{core.esm-BG0jKDkq.js → core.esm-BfHJA0TA.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-qyMaxypW.js → create-organization-dialog-C9vMS6wi.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-DeWjd8Jy.js → daily-pulse-C0yqxvJM.js} +1 -1
  126. package/dist/client/assets/{discover-0qam8o_r.js → discover-DbQRR_O3.js} +1 -1
  127. package/dist/client/assets/{domain-settings-Ci1klqCY.js → domain-settings-CkpWWkS-.js} +1 -1
  128. package/dist/client/assets/{drawer-NCwSL4IN.js → drawer-BMFFvaL0.js} +1 -1
  129. package/dist/client/assets/{editor-BAFV_HOz.js → editor-Cskgo4t5.js} +1 -1
  130. package/dist/client/assets/{editor-classes-Bf1cMZ5c.js → editor-classes-C28rWAPt.js} +1 -1
  131. package/dist/client/assets/{empty-state-CazxAouP.js → empty-state-5cqHHAHm.js} +1 -1
  132. package/dist/client/assets/{empty-state-CyvDawXM.js → empty-state-B_hi_eG9.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-Df_4NBNm.js → extract-connection-data-BP7KazgH.js} +1 -1
  134. package/dist/client/assets/{feature-gate-DKISz7u2.js → feature-gate-Dm218ZjC.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-BfJ3JcG2.js → feature-paywall-Cgz8CMXc.js} +1 -1
  136. package/dist/client/assets/{file-explorer-DBf-vGM2.js → file-explorer-CS89g_zS.js} +1 -1
  137. package/dist/client/assets/{file-preview-DG6sL6GL.js → file-preview-U5Y7TvR2.js} +1 -1
  138. package/dist/client/assets/{file-share-button-v2uCK60u.js → file-share-button-B8Qy9vuB.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-CnGkqsAH.js → file-type-icon-DYutf45Y.js} +1 -1
  140. package/dist/client/assets/flat-project-mVjYSjvy.js +1 -0
  141. package/dist/client/assets/{folder-icon-OnROrjIS.js → folder-icon-DLicGE7r.js} +1 -1
  142. package/dist/client/assets/{form-B0S4gwZl.js → form-Bca46vhe.js} +1 -1
  143. package/dist/client/assets/{general-Bwo2AG61.js → general-yd6vlutH.js} +1 -1
  144. package/dist/client/assets/{home-Pp3nSwfE.js → home-BU4NK3v6.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-jZYaiFNy.js → hosted-publish-feedback-DnsB267D.js} +1 -1
  146. package/dist/client/assets/{icon-button-BDgagVz4.js → icon-button-ChLL5yDL.js} +1 -1
  147. package/dist/client/assets/{index-qMd-hqZw.js → index-B87t6NQf.js} +1 -1
  148. package/dist/client/assets/{index-AXw2yr4_.js → index-BB6qJjD3.js} +1 -1
  149. package/dist/client/assets/{index-CvWx2Izz.js → index-BGvlkI3R.js} +1 -1
  150. package/dist/client/assets/{index-jyhHzpR3.js → index-BJ6dsjIl.js} +1 -1
  151. package/dist/client/assets/{index-BUcAISa8.js → index-BOCmUs5e.js} +4 -4
  152. package/dist/client/assets/{index-Dd00K3eL.js → index-BRvSRRRr.js} +1 -1
  153. package/dist/client/assets/{index-JOJ7PVEg.js → index-BlpRem7Q.js} +1 -1
  154. package/dist/client/assets/{index-B9UR2St-.js → index-BoFHO5RY.js} +1 -1
  155. package/dist/client/assets/{index-awJH-yt2.js → index-CTh6BzVi.js} +3 -3
  156. package/dist/client/assets/{index-xJOQw_q2.js → index-DKhF_H6j.js} +1 -1
  157. package/dist/client/assets/{index-c-E5TfxF.js → index-DVNE46xa.js} +1 -1
  158. package/dist/client/assets/{index-rxNSDZLc.js → index-DZEft5uP.js} +1 -1
  159. package/dist/client/assets/{index-_4HSlqk7.js → index-DbEiru9a.js} +1 -1
  160. package/dist/client/assets/{index-Bfspj4xO.js → index-DgJzDYIg.js} +1 -1
  161. package/dist/client/assets/{index-VMpHqTms.js → index-DwyX0Lfk.js} +1 -1
  162. package/dist/client/assets/{index-redirect-BxHx01ue.js → index-redirect-DqSAK9om.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-DOzqu3CQ.js → infiniteQueryObserver-B7_k3f99.js} +1 -1
  164. package/dist/client/assets/{infra-billing-D938gqE_.js → infra-billing-CjvIyWFt.js} +1 -1
  165. package/dist/client/assets/{input-B74-qJgM.js → input-DkRYN8U-.js} +3 -3
  166. package/dist/client/assets/{input-BZCpPpnc.js → input-VU9TmbHH.js} +1 -1
  167. package/dist/client/assets/{integration-icon-ChciBY2o.js → integration-icon-ak9Kf0du.js} +1 -1
  168. package/dist/client/assets/{jira-icon-B6QeGFuc.js → jira-icon-BWCPEjrr.js} +1 -1
  169. package/dist/client/assets/{label-eEmb1iBr.js → label-C-ZL8muP.js} +1 -1
  170. package/dist/client/assets/{layout-0OB0eIys.js → layout-cY3CgJvq.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-1rcXPVaq.js → legacy-agents-deep-D4us0T0O.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-C4cHO-CO.js → legacy-main-redirect-BkaZ5ZhP.js} +1 -1
  173. package/dist/client/assets/library-C4jtiJlg.js +1 -0
  174. package/dist/client/assets/{library-tab-1vjc8QRq.js → library-tab-BVMhkwRQ.js} +1 -1
  175. package/dist/client/assets/{login-Cr9q8XjG.js → login-B9_RQM1l.js} +1 -1
  176. package/dist/client/assets/{markdown-B_belhjs.js → markdown-139du5-r.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-BTEXkB1o.js → mcp-app-renderer-Bdo6XZex.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-BjnYnOAT.js → mcp-oauth-OreG94Sz.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-Df_GM2_g.js → mcp-oauth-xr1jliP9.js} +1 -1
  180. package/dist/client/assets/{members-CQVWPaLO.js → members-DPGoTLnj.js} +1 -1
  181. package/dist/client/assets/{memory-tRje6nGV.js → memory-luaHcViv.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-PBpsjjW-.js → mini-report-page-BYczJDsY.js} +1 -1
  183. package/dist/client/assets/{mock-board-BMnnvW9l.js → mock-board-vqGO01s1.js} +1 -1
  184. package/dist/client/assets/{monaco-editor-D7Wz-MKW.js → monaco-editor-CK_xL2d8.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-DsjQfEly.js → monitoring-stats-row-C0--I9c_.js} +1 -1
  186. package/dist/client/assets/{multi-select-VdJ2yUcb.js → multi-select-DIKIJUkK.js} +1 -1
  187. package/dist/client/assets/{mustache-BzIipqEK.js → mustache-CKk3zMw1.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-4pgTOLZa.js → new-project-dialog-CkYId2Lh.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-Cgt1SkEU.js → oauth-callback-C7eYh3k9.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-ai-provider-CJw6k__Q.js → oauth-callback-ai-provider-pn9TQm4S.js} +1 -1
  191. package/dist/client/assets/{onboarding-HsEzs1cx.js → onboarding-BiAjLS4d.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-C9xs6L0k.js → openai-conversation-DhLlByyF.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-Dp6MX9Wo.js → optimistic-project-sidebar-views-DrJTLDvq.js} +1 -1
  194. package/dist/client/assets/order-monitor-day-D2DPF_-7.js +1 -0
  195. package/dist/client/assets/{organization-choice-Dx3Q-TEp.js → organization-choice-DXXDw6Ka.js} +1 -1
  196. package/dist/client/assets/{orgs-BvIpo_CC.js → orgs-B_kVR_CR.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-BRGFtgzV.js → page-seo-form-JACX4dVa.js} +1 -1
  198. package/dist/client/assets/{pair-DTCbqEJJ.js → pair-BuwlHYqc.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-BosseGj-.js → plan-ladder-B_I9AoFo.js} +1 -1
  200. package/dist/client/assets/{popover-2LCOzLqM.js → popover-hPl3gZkE.js} +1 -1
  201. package/dist/client/assets/{post-calendar-B-KeJmLM.js → post-calendar-BOa7Fn-g.js} +1 -1
  202. package/dist/client/assets/{post-editor-BBwuotw_.js → post-editor-CEBQzcL7.js} +1 -1
  203. package/dist/client/assets/{preview-content-BrSgIQdx.js → preview-content-B_u1AtxU.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-DxCc_83x.js → preview-dialog-CVUIwuSI.js} +1 -1
  205. package/dist/client/assets/{preview-panel-CEvLrF57.js → preview-panel-CA1qen4u.js} +1 -1
  206. package/dist/client/assets/{preview-tab-EDXeaUjq.js → preview-tab-CWys0pQE.js} +3 -3
  207. package/dist/client/assets/{product-picker-dialog-CJY03R9-.js → product-picker-dialog-BHaMx_oO.js} +1 -1
  208. package/dist/client/assets/{profile-ocYhDdf-.js → profile-B--MUGfI.js} +1 -1
  209. package/dist/client/assets/{project-app-view-BIPtsxJX.js → project-app-view-KzZdUmqf.js} +1 -1
  210. package/dist/client/assets/{project-feed-2x8KDo1u.js → project-feed-CeCiO4WF.js} +1 -1
  211. package/dist/client/assets/{project-icon-BVi6jykh.js → project-icon-BbXZsYe5.js} +1 -1
  212. package/dist/client/assets/project-reports-B8eXEkZp.js +1 -0
  213. package/dist/client/assets/project-tasks-prm6sFyB.js +1 -0
  214. package/dist/client/assets/{projects-B1gqzvaP.js → projects-CawKsgaS.js} +1 -1
  215. package/dist/client/assets/{projects-empty-state-msmXPtF9.js → projects-empty-state-CVMx-csZ.js} +1 -1
  216. package/dist/client/assets/{prompts-DPI0Lbhi.js → prompts-GV6vHi3Q.js} +1 -1
  217. package/dist/client/assets/record-editor-s1ymOqml.js +1 -0
  218. package/dist/client/assets/{redirect-editor-ClyrjULu.js → redirect-editor-DZy0GaYH.js} +1 -1
  219. package/dist/client/assets/reports-Cvitp0af.js +1 -0
  220. package/dist/client/assets/{reports-D0-3BDN9.js → reports-DOGEO98v.js} +1 -1
  221. package/dist/client/assets/{reports-onboarding-D5Ohh65U.js → reports-onboarding-CKfiI8-p.js} +1 -1
  222. package/dist/client/assets/{reports-tab-CGM4OgZ-.js → reports-tab-Dun2p-H0.js} +2 -2
  223. package/dist/client/assets/{repositories-BX0zzV9H.js → repositories-ChgrXMYY.js} +1 -1
  224. package/dist/client/assets/{repository-binding-C4OsSA6m.js → repository-binding-CRho0p-d.js} +1 -1
  225. package/dist/client/assets/{repository-import-picker-B0pfCyxB.js → repository-import-picker-B4RkmAHQ.js} +1 -1
  226. package/dist/client/assets/{repository-picker-BjLyF0UU.js → repository-picker-CkFN3RpX.js} +1 -1
  227. package/dist/client/assets/{require-capability-Sr5QmqkV.js → require-capability-TRUTQOME.js} +1 -1
  228. package/dist/client/assets/{required-auth-layout-BcWyX0tN.js → required-auth-layout-DfsZRaZp.js} +1 -1
  229. package/dist/client/assets/{reset-password-Dv7DePXr.js → reset-password-BEwZW6TX.js} +1 -1
  230. package/dist/client/assets/{resizable-rQgJB4MP.js → resizable-9eb5yMBY.js} +1 -1
  231. package/dist/client/assets/{resolve-tab-icon-CcwQIqdW.js → resolve-tab-icon-BG71jGkO.js} +1 -1
  232. package/dist/client/assets/{review-settings-DaCbRDPV.js → review-settings-D73xrL00.js} +1 -1
  233. package/dist/client/assets/{roles-CMWEHao_.js → roles-w5iALB5v.js} +1 -1
  234. package/dist/client/assets/{route-CowAxBHf.js → route-BIP1ydTX.js} +1 -1
  235. package/dist/client/assets/route-CH7llhC9.js +1 -0
  236. package/dist/client/assets/{route-BRpVGRtq.js → route-djIv8e5Q.js} +1 -1
  237. package/dist/client/assets/{sandbox-lifecycle-context-Cai1YOLP.js → sandbox-lifecycle-context-BpxXnBl4.js} +1 -1
  238. package/dist/client/assets/{schema-Ctps-XT5.js → schema-CWcCrp1Z.js} +1 -1
  239. package/dist/client/assets/{schema-DFwdEHXk.js → schema-cIPnPaZy.js} +1 -1
  240. package/dist/client/assets/{scroll-area-BquREfD9.js → scroll-area-HEEo7zAl.js} +1 -1
  241. package/dist/client/assets/{search-input-B3OlXYBk.js → search-input-C1zHzfNa.js} +1 -1
  242. package/dist/client/assets/{search-toggle-DlbC-qm6.js → search-toggle-C2-3cqGH.js} +1 -1
  243. package/dist/client/assets/{secret-ciphertext-DspRdh2f.js → secret-ciphertext-CSc2OLqA.js} +1 -1
  244. package/dist/client/assets/{secret-picker-QpjTt9i4.js → secret-picker-BuZft72r.js} +1 -1
  245. package/dist/client/assets/{secrets-CweZX_-G.js → secrets-DzgdyJ5L.js} +1 -1
  246. package/dist/client/assets/{sections-editor-tLPCjatE.js → sections-editor-DneoLEuW.js} +1 -1
  247. package/dist/client/assets/{select-BZtkY-6Q.js → select-Bq0vTEkX.js} +1 -1
  248. package/dist/client/assets/{select-model-ypXtXaeM.js → select-model-f8FsMuYz.js} +1 -1
  249. package/dist/client/assets/{seo-editor-BThkwHKz.js → seo-editor-VV8qaVCj.js} +1 -1
  250. package/dist/client/assets/{separator-WCuRepY7.js → separator-DLgfXwLN.js} +1 -1
  251. package/dist/client/assets/{settings-tab-B_OtBvtL.js → settings-tab-Dupxn9u_.js} +1 -1
  252. package/dist/client/assets/{sheet-wIGY1BhL.js → sheet-ByjoR9NZ.js} +1 -1
  253. package/dist/client/assets/{shell-layout-C6in_tdZ.js → shell-layout--nu4TX02.js} +1 -1
  254. package/dist/client/assets/site-editor-DWPmz9wn.js +1 -0
  255. package/dist/client/assets/{site-editor-toast-DzpqzRIN.js → site-editor-toast-BJ5z9pNz.js} +1 -1
  256. package/dist/client/assets/{skills-CfpoVQzd.js → skills-D7KiBQsN.js} +1 -1
  257. package/dist/client/assets/{slider-DlGWUSHl.js → slider-tPJKX_XF.js} +1 -1
  258. package/dist/client/assets/{sortable.esm-CX1GpTrE.js → sortable.esm-D7jA01m7.js} +1 -1
  259. package/dist/client/assets/{sso-YsEFJ35H.js → sso-DnQMM0g9.js} +1 -1
  260. package/dist/client/assets/{suggestion-BDDkx8wt.js → suggestion-BoKW7C2P.js} +1 -1
  261. package/dist/client/assets/{switch-ByNrRBdU.js → switch-Dubjp7kN.js} +1 -1
  262. package/dist/client/assets/{symbol-BMdRj-zf.js → symbol-CV7scdpJ.js} +1 -1
  263. package/dist/client/assets/{synced-repos-CTcDXXZs.js → synced-repos-CiN18kni.js} +1 -1
  264. package/dist/client/assets/{tab-icon-glyph-DqaNYjGu.js → tab-icon-glyph-Clsy5Yie.js} +1 -1
  265. package/dist/client/assets/{table-BnEG4fsZ.js → table-CZt5xP25.js} +1 -1
  266. package/dist/client/assets/{tabs-CwSp61cB.js → tabs-j67RnvdQ.js} +1 -1
  267. package/dist/client/assets/{task-board-hdrVwFVS.js → task-board-C94vU4ou.js} +1 -1
  268. package/dist/client/assets/{task-route-CxU8BSZk.js → task-route-BszFrOaw.js} +1 -1
  269. package/dist/client/assets/{task-status-DpKiRcZA.js → task-status-CEagG8m_.js} +1 -1
  270. package/dist/client/assets/taskboard-analytics-xx9cuDQq.js +1 -0
  271. package/dist/client/assets/{tasks-Ckh-cnxw.js → tasks-BFNjlX11.js} +1 -1
  272. package/dist/client/assets/tasks-BUWNyzBS.js +1 -0
  273. package/dist/client/assets/{textarea-CRyjwEqe.js → textarea-TaCrk10b.js} +1 -1
  274. package/dist/client/assets/{thread-analytics-BFx9-ViN.js → thread-analytics-DSCs8wQv.js} +1 -1
  275. package/dist/client/assets/{thread-intent-DhkLy13k.js → thread-intent-FDeXaDYT.js} +1 -1
  276. package/dist/client/assets/{thread-route-BzAkvXZO.js → thread-route-BJT1AZOr.js} +1 -1
  277. package/dist/client/assets/{thread-route-iBVNlpET.js → thread-route-CCdwsU-Y.js} +1 -1
  278. package/dist/client/assets/{thread-sheet-body-CCi8emNA.js → thread-sheet-body-JXcJ3O56.js} +1 -1
  279. package/dist/client/assets/{time-range-picker-BrfdBzqI.js → time-range-picker-C4Z7sFIS.js} +1 -1
  280. package/dist/client/assets/{toggle-group-Cke1wKDH.js → toggle-group-Cjg5yTIq.js} +1 -1
  281. package/dist/client/assets/{tool-namespace-BXFHxu5_.js → tool-namespace-DqRUFWOS.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-WOmWcuPV.js → toolbar-icon-button-FvedXQUt.js} +1 -1
  283. package/dist/client/assets/{tooltip-Npd1IBFB.js → tooltip-BK6bkzFU.js} +1 -1
  284. package/dist/client/assets/{tooltipContext-C_RxKwqR.js → tooltipContext-6dHCyOPT.js} +1 -1
  285. package/dist/client/assets/{track-DWiQitlP.js → track-1DCyrBU8.js} +1 -1
  286. package/dist/client/assets/{types-JYftUHor.js → types-CQaTVPow.js} +1 -1
  287. package/dist/client/assets/{url-slug-psmAhJiF.js → url-slug-W3nScHaD.js} +1 -1
  288. package/dist/client/assets/{usage-stats-DeKdK9SW.js → usage-stats-B2hjYXg0.js} +1 -1
  289. package/dist/client/assets/{use-ai-providers-CBBzjFhl.js → use-ai-providers-BQUzk2kS.js} +1 -1
  290. package/dist/client/assets/{use-app-takeover-zY0NJ0sD.js → use-app-takeover-CfJ3KcD6.js} +1 -1
  291. package/dist/client/assets/{use-automations-CjaoEOVQ.js → use-automations-Be9X1Kx9.js} +1 -1
  292. package/dist/client/assets/{use-autosave-C0hpkW37.js → use-autosave-C2TsZDuz.js} +1 -1
  293. package/dist/client/assets/{use-chat-navigation-Cxan89R8.js → use-chat-navigation-DdZ6WAy-.js} +1 -1
  294. package/dist/client/assets/{use-clock-tick-DDv64CjX.js → use-clock-tick-DIulXUbJ.js} +1 -1
  295. package/dist/client/assets/{use-connect-companion-Cq1d8llk.js → use-connect-companion-Cv_xXpoU.js} +1 -1
  296. package/dist/client/assets/{use-connection-DD-60zit.js → use-connection-D1Zl0xok.js} +1 -1
  297. package/dist/client/assets/{use-content-sync-B6jQ4Cv-.js → use-content-sync-bWtwlxQJ.js} +1 -1
  298. package/dist/client/assets/{use-copy-D8rIRHRy.js → use-copy-qf10DRy9.js} +1 -1
  299. package/dist/client/assets/{use-create-virtual-mcp-C6rhnZK4.js → use-create-virtual-mcp-D6s3wkOf.js} +1 -1
  300. package/dist/client/assets/{use-date-fns-locale-BHSKPU1I.js → use-date-fns-locale-DzeoHUz7.js} +1 -1
  301. package/dist/client/assets/{use-debounced-autosave-DlgW8h0y.js → use-debounced-autosave-PPu22Bhc.js} +1 -1
  302. package/dist/client/assets/{use-debounced-value-DAimUErS.js → use-debounced-value-CGXDj-PA.js} +1 -1
  303. package/dist/client/assets/{use-deco-credits-g8JxcvuQ.js → use-deco-credits-Cn5WFssl.js} +1 -1
  304. package/dist/client/assets/{use-decopilot-events-1Ue6t9uD.js → use-decopilot-events-B-KnnZSr.js} +1 -1
  305. package/dist/client/assets/{use-delete-connection-aWCoQCSI.js → use-delete-connection-BWr_htDe.js} +1 -1
  306. package/dist/client/assets/{use-deployment-admin-C_cAoqcz.js → use-deployment-admin-DgT8SM2M.js} +1 -1
  307. package/dist/client/assets/{use-ensure-project-folder-COMVsdzC.js → use-ensure-project-folder-B8iEdtWi.js} +1 -1
  308. package/dist/client/assets/{use-fast-preview-draft-url-CnqLh_PK.js → use-fast-preview-draft-url-2FsUFQjh.js} +1 -1
  309. package/dist/client/assets/{use-file-configs-Yj2yOnDl.js → use-file-configs-Pqo7OuGa.js} +1 -1
  310. package/dist/client/assets/{use-infinite-scroll-Dzt1HFZA.js → use-infinite-scroll-BBMDPJ8Y.js} +1 -1
  311. package/dist/client/assets/{use-join-requests-Ca0-ZmOx.js → use-join-requests-DkDnq2t0.js} +1 -1
  312. package/dist/client/assets/{use-main-panel-tabs-Dw0WqVQl.js → use-main-panel-tabs-D5V3Apbl.js} +1 -1
  313. package/dist/client/assets/{use-mcp-auth-status-Bkm1SdFb.js → use-mcp-auth-status-B2dxPIqA.js} +1 -1
  314. package/dist/client/assets/{use-mcp-client-CXzIAVI_.js → use-mcp-client-52cULFEI.js} +1 -1
  315. package/dist/client/assets/{use-mcp-prompts-B04lynbc.js → use-mcp-prompts-cFJG9oH_.js} +1 -1
  316. package/dist/client/assets/{use-mcp-tools-DOnkoD66.js → use-mcp-tools-CZHcwTNA.js} +1 -1
  317. package/dist/client/assets/{use-members-DOrbNcAJ.js → use-members-DGxX_vQB.js} +1 -1
  318. package/dist/client/assets/{use-mobile-DszEwU_T.js → use-mobile-CbyN-2jY.js} +1 -1
  319. package/dist/client/assets/{use-navigate-to-agent-BE6ZEPUi.js → use-navigate-to-agent-BXAeHaex.js} +1 -1
  320. package/dist/client/assets/{use-open-billing-url-DUKZxYlJ.js → use-open-billing-url--GFaVN_O.js} +1 -1
  321. package/dist/client/assets/{use-org-auth-client-CpM0RfU1.js → use-org-auth-client-BvpKSYmO.js} +1 -1
  322. package/dist/client/assets/{use-org-fs-D7bxmks4.js → use-org-fs-CmUmucUf.js} +1 -1
  323. package/dist/client/assets/{use-org-repo-syncs-DYJrqXto.js → use-org-repo-syncs-8zIOfMQj.js} +1 -1
  324. package/dist/client/assets/{use-org-sso-Cmy5SNH_.js → use-org-sso-DgTtAFtU.js} +1 -1
  325. package/dist/client/assets/{use-organization-roles-Ch4iCVoq.js → use-organization-roles-CILDS-HZ.js} +1 -1
  326. package/dist/client/assets/{use-organization-settings-DjWvQexi.js → use-organization-settings-oW1-A4fr.js} +1 -1
  327. package/dist/client/assets/{use-panel-navigate-CeDVVCkS.js → use-panel-navigate-sC31QNLz.js} +1 -1
  328. package/dist/client/assets/{use-project-native-view-presence-YWMyr72T.js → use-project-native-view-presence-DoHDLNAG.js} +1 -1
  329. package/dist/client/assets/{use-project-scope-5YpNgUL6.js → use-project-scope-PpktGVbB.js} +1 -1
  330. package/dist/client/assets/{use-recent-apps-BY5qGNsG.js → use-recent-apps-F4etVz5-.js} +1 -1
  331. package/dist/client/assets/{use-releases-DNcZGEW5.js → use-releases-DJ3_3r6L.js} +1 -1
  332. package/dist/client/assets/{use-reports-diagnostic-CkT6fJ7D.js → use-reports-diagnostic-YYi2gy8_.js} +1 -1
  333. package/dist/client/assets/{use-secrets-uk71zh7-.js → use-secrets-BlmA3MrX.js} +1 -1
  334. package/dist/client/assets/{use-section-preview-base-BYZiHlaA.js → use-section-preview-base-DXQMfLn9.js} +1 -1
  335. package/dist/client/assets/{use-tags-CKSnijO-.js → use-tags-BPSIOz7Y.js} +1 -1
  336. package/dist/client/assets/{use-task-board-analytics-q-mfDhSM.js → use-task-board-analytics-DnzZMM3Q.js} +1 -1
  337. package/dist/client/assets/{use-task-board-events-D29THDyx.js → use-task-board-events-Bn6hAZVM.js} +1 -1
  338. package/dist/client/assets/{use-task-board-item-prs-C32PmmQm.js → use-task-board-item-prs-m9_KRZoq.js} +1 -1
  339. package/dist/client/assets/{use-task-board-items-Cj9ZgoVC.js → use-task-board-items-DA_UDa8i.js} +1 -1
  340. package/dist/client/assets/{use-task-metadata-DnDtZNKw.js → use-task-metadata-Cq4Zn8Tm.js} +1 -1
  341. package/dist/client/assets/{use-thread-analytics-DqFvOcsE.js → use-thread-analytics-B9ptnv1A.js} +1 -1
  342. package/dist/client/assets/{use-thread-outputs-C6dqZco1.js → use-thread-outputs-BPKnTsgd.js} +1 -1
  343. package/dist/client/assets/useInfiniteQuery-DLiHmV3M.js +1 -0
  344. package/dist/client/assets/{useQueries-Ds44Skcl.js → useQueries-Btn7O7jr.js} +1 -1
  345. package/dist/client/assets/useSuspenseInfiniteQuery-DKelDyyv.js +1 -0
  346. package/dist/client/assets/{users-CuQ1a_93.js → users-Bgwi7pZL.js} +1 -1
  347. package/dist/client/assets/{utils-B4VCCAxN.js → utils-Ci8APlrm.js} +1 -1
  348. package/dist/client/assets/{variant-calendar-i6jj6ehs.js → variant-calendar-BOVhedq0.js} +1 -1
  349. package/dist/client/assets/{variant-draft-pointer-DOXokiAV.js → variant-draft-pointer-C9f5IZVL.js} +1 -1
  350. package/dist/client/assets/{view-mode-toggle-7-N5f6LY.js → view-mode-toggle-Drydf5me.js} +1 -1
  351. package/dist/client/assets/{virtual-mcp-BT4ljKsC.js → virtual-mcp-DTVuDZwT.js} +1 -1
  352. package/dist/client/assets/{watch-sse-pool-CBn5OZ_Z.js → watch-sse-pool-DJ0G_gEe.js} +1 -1
  353. package/dist/client/index.html +1 -1
  354. package/dist/server/server.js +534 -526
  355. package/package.json +1 -1
  356. package/dist/client/assets/agent-app-DMpGNnPR.js +0 -1
  357. package/dist/client/assets/agent-deck-CZNDv1mI.js +0 -1
  358. package/dist/client/assets/agent-library-CRicVjHe.js +0 -1
  359. package/dist/client/assets/agent-library-file-5bEyOzlc.js +0 -1
  360. package/dist/client/assets/agent-settings-DoaEiYch.js +0 -1
  361. package/dist/client/assets/agent-site-editor-code-nxeUtWd2.js +0 -2
  362. package/dist/client/assets/agent-site-editor-content-MjcMIMIi.js +0 -1
  363. package/dist/client/assets/agent-site-editor-preview-BgfVqf-n.js +0 -1
  364. package/dist/client/assets/agent-view-B1-PgHLK.js +0 -1
  365. package/dist/client/assets/api-keys-CAj6rmix.js +0 -1
  366. package/dist/client/assets/cms-settings-editor-bq02-RQH.js +0 -1
  367. package/dist/client/assets/flat-project-DW1zMPL_.js +0 -1
  368. package/dist/client/assets/library-4m0WPS60.js +0 -1
  369. package/dist/client/assets/order-monitor-day-kvoSv5Oy.js +0 -1
  370. package/dist/client/assets/project-reports-CCEjXGH-.js +0 -1
  371. package/dist/client/assets/project-tasks-B_cB8jUa.js +0 -1
  372. package/dist/client/assets/record-editor-C0cJzt3s.js +0 -1
  373. package/dist/client/assets/reports-7MVtogQn.js +0 -1
  374. package/dist/client/assets/route-Ch1P1tF0.js +0 -1
  375. package/dist/client/assets/site-editor-DN_jWyDx.js +0 -1
  376. package/dist/client/assets/taskboard-analytics-9U6nRSeM.js +0 -1
  377. package/dist/client/assets/tasks-9qvqdnze.js +0 -1
  378. package/dist/client/assets/useInfiniteQuery-DRIZEKZQ.js +0 -1
  379. package/dist/client/assets/useSuspenseInfiniteQuery-DLwZomQy.js +0 -1
@@ -1 +1 @@
1
- import{c as D,b as O,d as ne,f as re,ae as oe,j as t,B as Q,a5 as ce,n as de,v as W,l as X}from"./index-BUcAISa8.js";import{I as ae}from"./icon-button-BDgagVz4.js";import{c as Y,T as Z,a as ee}from"./tooltip-Npd1IBFB.js";import{n as fe}from"./ZoomOut-BSgJ_qOu.js";import{h as me,at as xe,au as he}from"./agent-icon-u2ivNkJK.js";import{s as pe}from"./XClose-DBK6xbU_.js";import{F as te,t as V,H as ue}from"./file-share-button-v2uCK60u.js";import{f as be,F as je,a as ge}from"./file-preview-DG6sL6GL.js";import{F as se}from"./file-type-icon-CnGkqsAH.js";import{u as ve,b as we,e as ye}from"./use-org-fs-D7bxmks4.js";import{c as Pe,b as Ce}from"./location-BjlyegC2.js";function Ne(b){const e=D.c(13),{previewPath:l}=b,m=O(),r=ne(),p=re({strict:!1}).org??"";let s;e[0]!==l?(s=l.split("/").slice(0,-1).join("/"),e[0]=l,e[1]=s):s=e[1];const o=s;let a;e[2]!==r||e[3]!==p||e[4]!==o||e[5]!==l?(a=()=>{r({to:oe.library,params:{org:p},search:{path:o||void 0,preview:l}})},e[2]=r,e[3]=p,e[4]=o,e[5]=l,e[6]=a):a=e[6];const c=a;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(me,{size:14}),e[7]=j):j=e[7];let u;e[8]!==m?(u=m("library.seeInLibrary.label"),e[8]=m,e[9]=u):u=e[9];let x;return e[10]!==c||e[11]!==u?(x=t.jsxs(Q,{variant:"ghost",size:"sm",onClick:c,className:"shrink-0 gap-1.5 text-xs text-muted-foreground",children:[j,u]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const ke=b=>/\.html?$/i.test(b);function le(b){switch(b){case"dialog":return"h-11 py-1 pr-12 pl-2";case"panel":return"h-9 px-2";case"aside":return"h-12 gap-2 px-1.5";default:return b}}function Fe(b){const e=D.c(12),{expanded:l,onToggle:m,placement:r}=b,p=O();let s;e[0]!==r?(s=V(r),e[0]=r,e[1]=s):s=e[1];const o=l?"library.previewContent.collapse":"library.previewContent.expand";let a;e[2]!==p||e[3]!==o?(a=p(o),e[2]=p,e[3]=o,e[4]=a):a=e[4];let c;e[5]!==l?(c=l?t.jsx(xe,{size:14}):t.jsx(he,{size:14}),e[5]=l,e[6]=c):c=e[6];let j;return e[7]!==m||e[8]!==s||e[9]!==a||e[10]!==c?(j=t.jsx(ae,{...s,label:a,tooltipSide:"bottom",onClick:m,children:c}),e[7]=m,e[8]=s,e[9]=a,e[10]=c,e[11]=j):j=e[11],j}function ie(b){const e=D.c(9),{onClose:l,placement:m}=b,r=m===void 0?"bar":m,p=O();let s;e[0]!==r?(s=V(r),e[0]=r,e[1]=s):s=e[1];let o;e[2]!==p?(o=p("library.previewContent.close"),e[2]=p,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(pe,{size:14}),e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==s||e[7]!==o?(c=t.jsx(ae,{...s,label:o,tooltipSide:"bottom",onClick:l,children:a}),e[5]=l,e[6]=s,e[7]=o,e[8]=c):c=e[8],c}function De(b){const e=D.c(92),{previewPath:l,onClose:m,expand:r,showSeeInLibrary:p,variant:s}=b,o=p===void 0?!1:p,a=O();let c;e[0]!==l?(c=Pe(l),e[0]=l,e[1]=c):c=e[1];const j=c,{volume:u,dirPath:x}=j,{data:f,isPending:A}=ve(u,x),H=we(u??"");let w,y,n,d,h,i,P,B;if(e[2]!==H||e[3]!==f||e[4]!==r||e[5]!==x||e[6]!==l||e[7]!==o||e[8]!==s){d=Ce(x),h=s==="dialog",i=r?.expanded?"topbar":s==="aside"?"aside":"bar";let g;e[17]!==i?(g=V(i),e[17]=i,e[18]=g):g=e[18],w=g;let T;e[19]!==r||e[20]!==i?(T=r?.onToggle&&t.jsx(Fe,{expanded:r.expanded,onToggle:r.onToggle,placement:i}),e[19]=r,e[20]=i,e[21]=T):T=e[21],y=T;let v;e[22]!==l||e[23]!==o?(v=o?t.jsx(Ne,{previewPath:l}):null,e[22]=l,e[23]=o,e[24]=v):v=e[24],P=v,n=f&&f.kind==="file"?{key:l,filename:d,size:f.size,downloadUrl:H(f.path)}:null,B=n&&f&&ke(d),e[2]=H,e[3]=f,e[4]=r,e[5]=x,e[6]=l,e[7]=o,e[8]=s,e[9]=w,e[10]=y,e[11]=n,e[12]=d,e[13]=h,e[14]=i,e[15]=P,e[16]=B}else w=e[9],y=e[10],n=e[11],d=e[12],h=e[13],i=e[14],P=e[15],B=e[16];if(B){let g;e[25]!==d||e[26]!==h?(g=h&&t.jsx(W,{className:"sr-only",children:d}),e[25]=d,e[26]=h,e[27]=g):g=e[27];const T=n.downloadUrl;let v;e[28]!==f?(v=ye(f),e[28]=f,e[29]=v):v=e[29];let z;e[30]!==s?(z=s==="aside"?le(s):void 0,e[30]=s,e[31]=z):z=e[31];const R=u==="home"?x:void 0,q=u??"",G=f.shareMode??"private",J=f.effectivePublic??!1,K=window.location.origin+n.downloadUrl;let S;e[32]!==x||e[33]!==i||e[34]!==G||e[35]!==J||e[36]!==K||e[37]!==q?(S=t.jsx(te,{volume:q,path:x,shareMode:G,effectivePublic:J,url:K,placement:i}),e[32]=x,e[33]=i,e[34]=G,e[35]=J,e[36]=K,e[37]=q,e[38]=S):S=e[38];let U;e[39]!==y||e[40]!==h||e[41]!==m||e[42]!==i?(U=h?t.jsx("div",{className:"w-8 shrink-0"}):t.jsxs(t.Fragment,{children:[y,t.jsx(ie,{onClose:m,placement:i})]}),e[39]=y,e[40]=h,e[41]=m,e[42]=i,e[43]=U):U=e[43];let I;e[44]!==P||e[45]!==S||e[46]!==U?(I=t.jsxs(t.Fragment,{children:[S,P,U]}),e[44]=P,e[45]=S,e[46]=U,e[47]=I):I=e[47];let L;e[48]!==n.downloadUrl||e[49]!==d||e[50]!==i||e[51]!==l||e[52]!==I||e[53]!==v||e[54]!==z||e[55]!==R?(L=t.jsx(ue,{readUrl:T,marker:v,toolbarClassName:z,title:d,placement:i,savePath:R,trailing:I},l),e[48]=n.downloadUrl,e[49]=d,e[50]=i,e[51]=l,e[52]=I,e[53]=v,e[54]=z,e[55]=R,e[56]=L):L=e[56];let E;return e[57]!==L||e[58]!==g?(E=t.jsxs(t.Fragment,{children:[g,L]}),e[57]=L,e[58]=g,e[59]=E):E=e[59],E}let C;e[60]!==w||e[61]!==f?.effectivePublic||e[62]!==f?.shareMode||e[63]!==n||e[64]!==x||e[65]!==i||e[66]!==a||e[67]!==u?(C=n&&t.jsxs(t.Fragment,{children:[t.jsx(te,{volume:u??"",path:x,shareMode:f?.shareMode??"private",effectivePublic:f?.effectivePublic??!1,url:window.location.origin+n.downloadUrl,placement:i}),t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(Q,{variant:w.variant,size:w.size,asChild:!0,children:t.jsx("a",{href:n.downloadUrl,download:n.filename,children:t.jsx(fe,{size:14})})})}),t.jsx(ee,{side:"bottom",children:a("library.previewContent.download")})]}),t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(Q,{variant:w.variant,size:w.size,onClick:()=>window.open(n.downloadUrl,"_blank","noopener"),children:t.jsx(ce,{size:14})})}),t.jsx(ee,{side:"bottom",children:a("library.previewContent.openInNewTab")})]})]}),e[60]=w,e[61]=f?.effectivePublic,e[62]=f?.shareMode,e[63]=n,e[64]=x,e[65]=i,e[66]=a,e[67]=u,e[68]=C):C=e[68];let N;e[69]!==y||e[70]!==h||e[71]!==m||e[72]!==i?(N=!h&&t.jsxs(t.Fragment,{children:[y,t.jsx(ie,{onClose:m,placement:i})]}),e[69]=y,e[70]=h,e[71]=m,e[72]=i,e[73]=N):N=e[73];let $;e[74]!==C||e[75]!==N?($=t.jsxs(t.Fragment,{children:[C,N]}),e[74]=C,e[75]=N,e[76]=$):$=e[76];const M=$;let k;e[77]!==M||e[78]!==n||e[79]!==d||e[80]!==h||e[81]!==i||e[82]!==s?(k=i==="topbar"?t.jsx(de.Actions,{children:M}):t.jsxs("div",{className:X("flex shrink-0 items-center gap-1 border-b border-border/60",le(s)),children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[t.jsx(se,{filename:d,className:"h-4.5 w-3.5 shrink-0"}),h?t.jsx(W,{className:"truncate text-xs font-medium text-foreground",children:d}):t.jsx("span",{className:X("truncate font-medium text-foreground",i==="aside"?"text-sm":"text-xs"),children:d}),n&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:be(n.size)})]}),M]}),e[77]=M,e[78]=n,e[79]=d,e[80]=h,e[81]=i,e[82]=s,e[83]=k):k=e[83];let F;e[84]!==n||e[85]!==d||e[86]!==A||e[87]!==a?(F=t.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:n?t.jsx(je,{file:n}):A?t.jsx(ge,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(se,{filename:d,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:a("library.previewContent.fileNotAvailable")})]})}),e[84]=n,e[85]=d,e[86]=A,e[87]=a,e[88]=F):F=e[88];let _;return e[89]!==k||e[90]!==F?(_=t.jsxs(t.Fragment,{children:[k,F]}),e[89]=k,e[90]=F,e[91]=_):_=e[91],_}export{De as L};
1
+ import{c as D,b as O,d as ne,f as re,ae as oe,j as t,B as Q,a5 as ce,n as de,v as W,l as X}from"./index-BOCmUs5e.js";import{I as ae}from"./icon-button-ChLL5yDL.js";import{c as Y,T as Z,a as ee}from"./tooltip-BK6bkzFU.js";import{n as fe}from"./ZoomOut-CKwphFFF.js";import{h as me,at as xe,au as he}from"./agent-icon-ndY1RWjU.js";import{s as pe}from"./XClose-BHIq2rSj.js";import{F as te,t as V,H as ue}from"./file-share-button-B8Qy9vuB.js";import{f as be,F as je,a as ge}from"./file-preview-U5Y7TvR2.js";import{F as se}from"./file-type-icon-DYutf45Y.js";import{u as ve,b as we,e as ye}from"./use-org-fs-CmUmucUf.js";import{c as Pe,b as Ce}from"./location-BjlyegC2.js";function Ne(b){const e=D.c(13),{previewPath:l}=b,m=O(),r=ne(),p=re({strict:!1}).org??"";let s;e[0]!==l?(s=l.split("/").slice(0,-1).join("/"),e[0]=l,e[1]=s):s=e[1];const o=s;let a;e[2]!==r||e[3]!==p||e[4]!==o||e[5]!==l?(a=()=>{r({to:oe.library,params:{org:p},search:{path:o||void 0,preview:l}})},e[2]=r,e[3]=p,e[4]=o,e[5]=l,e[6]=a):a=e[6];const c=a;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(me,{size:14}),e[7]=j):j=e[7];let u;e[8]!==m?(u=m("library.seeInLibrary.label"),e[8]=m,e[9]=u):u=e[9];let x;return e[10]!==c||e[11]!==u?(x=t.jsxs(Q,{variant:"ghost",size:"sm",onClick:c,className:"shrink-0 gap-1.5 text-xs text-muted-foreground",children:[j,u]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const ke=b=>/\.html?$/i.test(b);function le(b){switch(b){case"dialog":return"h-11 py-1 pr-12 pl-2";case"panel":return"h-9 px-2";case"aside":return"h-12 gap-2 px-1.5";default:return b}}function Fe(b){const e=D.c(12),{expanded:l,onToggle:m,placement:r}=b,p=O();let s;e[0]!==r?(s=V(r),e[0]=r,e[1]=s):s=e[1];const o=l?"library.previewContent.collapse":"library.previewContent.expand";let a;e[2]!==p||e[3]!==o?(a=p(o),e[2]=p,e[3]=o,e[4]=a):a=e[4];let c;e[5]!==l?(c=l?t.jsx(xe,{size:14}):t.jsx(he,{size:14}),e[5]=l,e[6]=c):c=e[6];let j;return e[7]!==m||e[8]!==s||e[9]!==a||e[10]!==c?(j=t.jsx(ae,{...s,label:a,tooltipSide:"bottom",onClick:m,children:c}),e[7]=m,e[8]=s,e[9]=a,e[10]=c,e[11]=j):j=e[11],j}function ie(b){const e=D.c(9),{onClose:l,placement:m}=b,r=m===void 0?"bar":m,p=O();let s;e[0]!==r?(s=V(r),e[0]=r,e[1]=s):s=e[1];let o;e[2]!==p?(o=p("library.previewContent.close"),e[2]=p,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(pe,{size:14}),e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==s||e[7]!==o?(c=t.jsx(ae,{...s,label:o,tooltipSide:"bottom",onClick:l,children:a}),e[5]=l,e[6]=s,e[7]=o,e[8]=c):c=e[8],c}function De(b){const e=D.c(92),{previewPath:l,onClose:m,expand:r,showSeeInLibrary:p,variant:s}=b,o=p===void 0?!1:p,a=O();let c;e[0]!==l?(c=Pe(l),e[0]=l,e[1]=c):c=e[1];const j=c,{volume:u,dirPath:x}=j,{data:f,isPending:A}=ve(u,x),H=we(u??"");let w,y,n,d,h,i,P,B;if(e[2]!==H||e[3]!==f||e[4]!==r||e[5]!==x||e[6]!==l||e[7]!==o||e[8]!==s){d=Ce(x),h=s==="dialog",i=r?.expanded?"topbar":s==="aside"?"aside":"bar";let g;e[17]!==i?(g=V(i),e[17]=i,e[18]=g):g=e[18],w=g;let T;e[19]!==r||e[20]!==i?(T=r?.onToggle&&t.jsx(Fe,{expanded:r.expanded,onToggle:r.onToggle,placement:i}),e[19]=r,e[20]=i,e[21]=T):T=e[21],y=T;let v;e[22]!==l||e[23]!==o?(v=o?t.jsx(Ne,{previewPath:l}):null,e[22]=l,e[23]=o,e[24]=v):v=e[24],P=v,n=f&&f.kind==="file"?{key:l,filename:d,size:f.size,downloadUrl:H(f.path)}:null,B=n&&f&&ke(d),e[2]=H,e[3]=f,e[4]=r,e[5]=x,e[6]=l,e[7]=o,e[8]=s,e[9]=w,e[10]=y,e[11]=n,e[12]=d,e[13]=h,e[14]=i,e[15]=P,e[16]=B}else w=e[9],y=e[10],n=e[11],d=e[12],h=e[13],i=e[14],P=e[15],B=e[16];if(B){let g;e[25]!==d||e[26]!==h?(g=h&&t.jsx(W,{className:"sr-only",children:d}),e[25]=d,e[26]=h,e[27]=g):g=e[27];const T=n.downloadUrl;let v;e[28]!==f?(v=ye(f),e[28]=f,e[29]=v):v=e[29];let z;e[30]!==s?(z=s==="aside"?le(s):void 0,e[30]=s,e[31]=z):z=e[31];const R=u==="home"?x:void 0,q=u??"",G=f.shareMode??"private",J=f.effectivePublic??!1,K=window.location.origin+n.downloadUrl;let S;e[32]!==x||e[33]!==i||e[34]!==G||e[35]!==J||e[36]!==K||e[37]!==q?(S=t.jsx(te,{volume:q,path:x,shareMode:G,effectivePublic:J,url:K,placement:i}),e[32]=x,e[33]=i,e[34]=G,e[35]=J,e[36]=K,e[37]=q,e[38]=S):S=e[38];let U;e[39]!==y||e[40]!==h||e[41]!==m||e[42]!==i?(U=h?t.jsx("div",{className:"w-8 shrink-0"}):t.jsxs(t.Fragment,{children:[y,t.jsx(ie,{onClose:m,placement:i})]}),e[39]=y,e[40]=h,e[41]=m,e[42]=i,e[43]=U):U=e[43];let I;e[44]!==P||e[45]!==S||e[46]!==U?(I=t.jsxs(t.Fragment,{children:[S,P,U]}),e[44]=P,e[45]=S,e[46]=U,e[47]=I):I=e[47];let L;e[48]!==n.downloadUrl||e[49]!==d||e[50]!==i||e[51]!==l||e[52]!==I||e[53]!==v||e[54]!==z||e[55]!==R?(L=t.jsx(ue,{readUrl:T,marker:v,toolbarClassName:z,title:d,placement:i,savePath:R,trailing:I},l),e[48]=n.downloadUrl,e[49]=d,e[50]=i,e[51]=l,e[52]=I,e[53]=v,e[54]=z,e[55]=R,e[56]=L):L=e[56];let E;return e[57]!==L||e[58]!==g?(E=t.jsxs(t.Fragment,{children:[g,L]}),e[57]=L,e[58]=g,e[59]=E):E=e[59],E}let C;e[60]!==w||e[61]!==f?.effectivePublic||e[62]!==f?.shareMode||e[63]!==n||e[64]!==x||e[65]!==i||e[66]!==a||e[67]!==u?(C=n&&t.jsxs(t.Fragment,{children:[t.jsx(te,{volume:u??"",path:x,shareMode:f?.shareMode??"private",effectivePublic:f?.effectivePublic??!1,url:window.location.origin+n.downloadUrl,placement:i}),t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(Q,{variant:w.variant,size:w.size,asChild:!0,children:t.jsx("a",{href:n.downloadUrl,download:n.filename,children:t.jsx(fe,{size:14})})})}),t.jsx(ee,{side:"bottom",children:a("library.previewContent.download")})]}),t.jsxs(Y,{children:[t.jsx(Z,{asChild:!0,children:t.jsx(Q,{variant:w.variant,size:w.size,onClick:()=>window.open(n.downloadUrl,"_blank","noopener"),children:t.jsx(ce,{size:14})})}),t.jsx(ee,{side:"bottom",children:a("library.previewContent.openInNewTab")})]})]}),e[60]=w,e[61]=f?.effectivePublic,e[62]=f?.shareMode,e[63]=n,e[64]=x,e[65]=i,e[66]=a,e[67]=u,e[68]=C):C=e[68];let N;e[69]!==y||e[70]!==h||e[71]!==m||e[72]!==i?(N=!h&&t.jsxs(t.Fragment,{children:[y,t.jsx(ie,{onClose:m,placement:i})]}),e[69]=y,e[70]=h,e[71]=m,e[72]=i,e[73]=N):N=e[73];let $;e[74]!==C||e[75]!==N?($=t.jsxs(t.Fragment,{children:[C,N]}),e[74]=C,e[75]=N,e[76]=$):$=e[76];const M=$;let k;e[77]!==M||e[78]!==n||e[79]!==d||e[80]!==h||e[81]!==i||e[82]!==s?(k=i==="topbar"?t.jsx(de.Actions,{children:M}):t.jsxs("div",{className:X("flex shrink-0 items-center gap-1 border-b border-border/60",le(s)),children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[t.jsx(se,{filename:d,className:"h-4.5 w-3.5 shrink-0"}),h?t.jsx(W,{className:"truncate text-xs font-medium text-foreground",children:d}):t.jsx("span",{className:X("truncate font-medium text-foreground",i==="aside"?"text-sm":"text-xs"),children:d}),n&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:be(n.size)})]}),M]}),e[77]=M,e[78]=n,e[79]=d,e[80]=h,e[81]=i,e[82]=s,e[83]=k):k=e[83];let F;e[84]!==n||e[85]!==d||e[86]!==A||e[87]!==a?(F=t.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:n?t.jsx(je,{file:n}):A?t.jsx(ge,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(se,{filename:d,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:a("library.previewContent.fileNotAvailable")})]})}),e[84]=n,e[85]=d,e[86]=A,e[87]=a,e[88]=F):F=e[88];let _;return e[89]!==k||e[90]!==F?(_=t.jsxs(t.Fragment,{children:[k,F]}),e[89]=k,e[90]=F,e[91]=_):_=e[91],_}export{De as L};
@@ -1 +1 @@
1
- import{c as f,j as n,q as m,D as p}from"./index-BUcAISa8.js";import{L as w}from"./preview-content-BrSgIQdx.js";function d(x){const e=f.c(9),{previewPath:a,onClose:o,showSeeInLibrary:l}=x,t=l===void 0?!1:l;let i;e[0]!==o?(i=c=>{c||o()},e[0]=o,e[1]=i):i=e[1];let r;e[2]!==o||e[3]!==a||e[4]!==t?(r=n.jsx(m,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",children:n.jsx(w,{previewPath:a,onClose:o,showSeeInLibrary:t,variant:"dialog"})}),e[2]=o,e[3]=a,e[4]=t,e[5]=r):r=e[5];let s;return e[6]!==i||e[7]!==r?(s=n.jsx(p,{open:!0,onOpenChange:i,children:r}),e[6]=i,e[7]=r,e[8]=s):s=e[8],s}export{d as L};
1
+ import{c as f,j as n,q as m,D as p}from"./index-BOCmUs5e.js";import{L as w}from"./preview-content-B_u1AtxU.js";function d(x){const e=f.c(9),{previewPath:a,onClose:o,showSeeInLibrary:l}=x,t=l===void 0?!1:l;let i;e[0]!==o?(i=c=>{c||o()},e[0]=o,e[1]=i):i=e[1];let r;e[2]!==o||e[3]!==a||e[4]!==t?(r=n.jsx(m,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",children:n.jsx(w,{previewPath:a,onClose:o,showSeeInLibrary:t,variant:"dialog"})}),e[2]=o,e[3]=a,e[4]=t,e[5]=r):r=e[5];let s;return e[6]!==i||e[7]!==r?(s=n.jsx(p,{open:!0,onOpenChange:i,children:r}),e[6]=i,e[7]=r,e[8]=s):s=e[8],s}export{d as L};
@@ -1 +1 @@
1
- import{c as p,j as c}from"./index-BUcAISa8.js";import{L as x}from"./preview-content-BrSgIQdx.js";function u(f){const e=p.c(6),{previewPath:i,onClose:o,showSeeInLibrary:n,expand:a,variant:l}=f,s=n===void 0?!1:n,t=l===void 0?"panel":l;let r;return e[0]!==a||e[1]!==o||e[2]!==i||e[3]!==s||e[4]!==t?(r=c.jsx("div",{className:"flex h-full w-full flex-col bg-background",children:c.jsx(x,{previewPath:i,onClose:o,showSeeInLibrary:s,expand:a,variant:t})}),e[0]=a,e[1]=o,e[2]=i,e[3]=s,e[4]=t,e[5]=r):r=e[5],r}export{u as L};
1
+ import{c as p,j as c}from"./index-BOCmUs5e.js";import{L as x}from"./preview-content-B_u1AtxU.js";function u(f){const e=p.c(6),{previewPath:i,onClose:o,showSeeInLibrary:n,expand:a,variant:l}=f,s=n===void 0?!1:n,t=l===void 0?"panel":l;let r;return e[0]!==a||e[1]!==o||e[2]!==i||e[3]!==s||e[4]!==t?(r=c.jsx("div",{className:"flex h-full w-full flex-col bg-background",children:c.jsx(x,{previewPath:i,onClose:o,showSeeInLibrary:s,expand:a,variant:t})}),e[0]=a,e[1]=o,e[2]=i,e[3]=s,e[4]=t,e[5]=r):r=e[5],r}export{u as L};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-tLPCjatE.js","assets/index-BUcAISa8.js","assets/index-s7bCSMKE.css","assets/chat-context-DL44ik-l.js","assets/use-panel-navigate-CeDVVCkS.js","assets/thread-route-iBVNlpET.js","assets/use-project-scope-5YpNgUL6.js","assets/repository-binding-C4OsSA6m.js","assets/use-mcp-client-CXzIAVI_.js","assets/auth-CExazRf5.js","assets/autosend-CUxwH8aa.js","assets/thread-intent-DhkLy13k.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CBn5OZ_Z.js","assets/task-board-hdrVwFVS.js","assets/schema-Ctps-XT5.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-1Ue6t9uD.js","assets/use-ai-providers-CBBzjFhl.js","assets/use-chat-navigation-Cxan89R8.js","assets/location-BjlyegC2.js","assets/use-organization-settings-DjWvQexi.js","assets/blocks-tab-states-B0RpWAaK.js","assets/site-editor-toast-DzpqzRIN.js","assets/input-B74-qJgM.js","assets/usage-stats-DeKdK9SW.js","assets/tool-namespace-BXFHxu5_.js","assets/form-B0S4gwZl.js","assets/label-eEmb1iBr.js","assets/utils-CVEq3hMx.js","assets/markdown-B_belhjs.js","assets/use-copy-D8rIRHRy.js","assets/Copy01-4Op2Jutz.js","assets/ZoomOut-BSgJ_qOu.js","assets/use-mobile-DszEwU_T.js","assets/tooltip-Npd1IBFB.js","assets/index-VMpHqTms.js","assets/agent-icon-u2ivNkJK.js","assets/AlertCircle-T1ZkrR0m.js","assets/Tool01-eRpAM_xP.js","assets/ArrowUp-CrfIcCHY.js","assets/ArrowLeft-CYKCt2D_.js","assets/LinkBroken01-1s3iBfyN.js","assets/ShoppingBag01-CQamAcPv.js","assets/Building02-BzqtLsiR.js","assets/CheckCircle-Cyp8J2-O.js","assets/ChevronUp-DWP9CKrv.js","assets/ChevronSelectorVertical-bMnA4IfS.js","assets/UserSquare-BPqJsNeY.js","assets/CreditCard01-8ijEtUnj.js","assets/DotsVertical-Ik04gU0Z.js","assets/Image01-BoNtuy7T.js","assets/Globe04-DTYU91Z7.js","assets/SwitchHorizontal01-BMvJE9CE.js","assets/Key01-DVtNzjvm.js","assets/Link01-COgU4X0d.js","assets/Monitor01-BMmwz8er.js","assets/Sun-CT-ZvHiv.js","assets/Play-C_Kc3qTH.js","assets/Plus-bl3Do1ab.js","assets/SearchMd-CuIII2sM.js","assets/Trash01-DtrweZMg.js","assets/Upload01-dCDZcDY3.js","assets/User01-N2rUxuZL.js","assets/Users01--Pjgrl_5.js","assets/XClose-DBK6xbU_.js","assets/format-time-CAj8AQXM.js","assets/differenceInSeconds-C3x8sHUj.js","assets/icon-button-BDgagVz4.js","assets/file-type-icon-CnGkqsAH.js","assets/shell-layout-C6in_tdZ.js","assets/avatar-k7zVZ1nb.js","assets/use-clock-tick-DDv64CjX.js","assets/command-kL2BpXNu.js","assets/index-c-E5TfxF.js","assets/integration-icon-ChciBY2o.js","assets/project-icon-BVi6jykh.js","assets/new-project-dialog-4pgTOLZa.js","assets/repository-import-picker-B0pfCyxB.js","assets/use-navigate-to-agent-BE6ZEPUi.js","assets/repository-picker-BjLyF0UU.js","assets/useInfiniteQuery-DRIZEKZQ.js","assets/infiniteQueryObserver-DOzqu3CQ.js","assets/collection-search-BgZ6ncMc.js","assets/use-debounced-value-DAimUErS.js","assets/required-auth-layout-BcWyX0tN.js","assets/use-org-sso-Cmy5SNH_.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-BGj508pV.js","assets/select-BZtkY-6Q.js","assets/index-BdQq_4o_.js","assets/tabs-CwSp61cB.js","assets/use-deco-credits-g8JxcvuQ.js","assets/toggle-group-Cke1wKDH.js","assets/use-open-billing-url-DUKZxYlJ.js","assets/index-Bfspj4xO.js","assets/checkbox-CTOJeQYr.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-2LCOzLqM.js","assets/drawer-NCwSL4IN.js","assets/input-BZCpPpnc.js","assets/suggestion-BDDkx8wt.js","assets/use-mcp-prompts-B04lynbc.js","assets/use-org-fs-D7bxmks4.js","assets/question-004-sINsf4GQ.js","assets/use-members-DOrbNcAJ.js","assets/use-org-auth-client-CpM0RfU1.js","assets/feature-paywall-BfJ3JcG2.js","assets/plan-ladder-BosseGj-.js","assets/add-connection-dialog-B2yW98GA.js","assets/extract-connection-data-Df_4NBNm.js","assets/metadata-D72DunRR.js","assets/connection-ClykfAAS.js","assets/url-slug-psmAhJiF.js","assets/connection-card-CKRGS9aW.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-CRyjwEqe.js","assets/use-connection-DD-60zit.js","assets/schema-DFwdEHXk.js","assets/connection-form-helpers-DaJ65Rex.js","assets/authenticate-and-persist-oauth-B43eE55s.js","assets/mcp-oauth-Df_GM2_g.js","assets/mcp-oauth-BjnYnOAT.js","assets/collection-tabs-C9sF3Ij7.js","assets/badge-BE7xUmDV.js","assets/use-infinite-scroll-Dzt1HFZA.js","assets/useSuspenseInfiniteQuery-DLwZomQy.js","assets/use-task-board-events-D29THDyx.js","assets/use-project-native-view-presence-YWMyr72T.js","assets/use-file-configs-Yj2yOnDl.js","assets/site-slug-DebpOoQq.js","assets/input-Bwd_JSM8.css","assets/sandbox-url-D3mC8qhT.js","assets/utils-B4VCCAxN.js","assets/index-rxNSDZLc.js","assets/pair-DTCbqEJJ.js","assets/collapsible-DM3c5ETU.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-BTEXkB1o.js","assets/types-JYftUHor.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-wIGY1BhL.js","assets/use-thread-outputs-C6dqZco1.js","assets/sandbox-git-api-CRxdlhrN.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/secret-ciphertext-DspRdh2f.js","assets/alert-C4LKzrU_.js","assets/switch-ByNrRBdU.js","assets/scroll-area-BquREfD9.js","assets/monaco-editor-D7Wz-MKW.js","assets/editor-BAFV_HOz.js","assets/calendar-C_cq2tGg.js","assets/editor-classes-Bf1cMZ5c.js","assets/core.esm-BG0jKDkq.js","assets/sortable.esm-CX1GpTrE.js","assets/view-mode-toggle-7-N5f6LY.js","assets/combobox-CWvfr2Bd.js","assets/alert-dialog-DiDDn4Bn.js","assets/search-input-B3OlXYBk.js","assets/asset-utils-D_uCIG2N.js","assets/empty-state-CazxAouP.js","assets/mustache-BzIipqEK.js","assets/use-section-preview-base-BYZiHlaA.js","assets/section-preview-url-7zfngvgW.js","assets/page-seo-form-BRGFtgzV.js","assets/variant-draft-pointer-DOXokiAV.js"])))=>i.map(i=>d[i]);
2
- import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aY as Ye,aG as Ne,q as Os,D as Ds,K as Bs,s as Fs,v as Ms,e as Ir,h as gt,I as rs,w as Ur,aZ as Hr,a2 as Sn,a_ as Vr,aX as qr,at as as,av as os,a5 as Wr,P as is,y as Gr,t as cn,o as Jr,m as Yr}from"./index-BUcAISa8.js";import{u as $s,g as Qr,c as Xr,B as dn,P as Zr,r as ea,R as ta,a as na,b as Ks,d as zs,i as sa,S as ra,e as aa,f as oa,C as ia,h as la,j as ca,l as da,m as ua,p as fa,k as ma,n as un,N as pa}from"./blocks-tab-states-B0RpWAaK.js";import{b as ha,c as It,r as Is,l as Us,f as ga,g as va,w as ba}from"./chat-context-DL44ik-l.js";import{t as xa}from"./ChevronUp-DWP9CKrv.js";import{R as ya,S as wa,J as Hs,T as ka,b as Sa,U as Pa,V as Ea,W as ja,X as Na,Y as ls,Z as Ta}from"./agent-icon-u2ivNkJK.js";import{a as Ca}from"./UserSquare-BPqJsNeY.js";import{s as Ra}from"./Plus-bl3Do1ab.js";import{P as La,a as _a,b as Aa}from"./popover-2LCOzLqM.js";import{a as mt,b as pt,c as Vs,d as qs,e as Ws,C as Gs}from"./command-kL2BpXNu.js";import{c as Oa,a as Da}from"./repository-binding-C4OsSA6m.js";import{b as Pn}from"./sandbox-lifecycle-context-Cai1YOLP.js";import{e as Ba}from"./backoff-CrEUbyZT.js";import{f as Fa}from"./thread-intent-DhkLy13k.js";import{a as Js}from"./input-B74-qJgM.js";import{S as Ys,A as Ma,B as $a,C as Ka,F as za,G as Ia,H as Ua,I as Ha,u as En,J as jn,K as xn,L as Va,M as qa,N as Wa,c as Ga,b as Qs,O as Ja,P as Qe,z as Ya,Q as Qa,R as Xa,U as Za,x as eo,V as cs,w as to,W as no,e as so}from"./site-editor-toast-DzpqzRIN.js";import{u as ro}from"./use-mobile-DszEwU_T.js";import{c as fn,T as mn,a as pn}from"./tooltip-Npd1IBFB.js";import{T as ct}from"./toolbar-icon-button-WOmWcuPV.js";import{b as ao,w as At,a as ds,i as oo}from"./variant-draft-pointer-DOXokiAV.js";import{h as io,s as lo,L as co,R as Kt,j as us,N as uo,k as fo,l as ht,n as Nn,m as Xs,f as Fe,v as Zs,o as mo,q as po,r as ho,t as go,u as vo,w as fs,d as bo}from"./secret-ciphertext-DspRdh2f.js";import{r as xo,D as ms,w as ps,b as hs,a as yo}from"./section-preview-url-7zfngvgW.js";import{u as wo}from"./use-fast-preview-draft-url-CnqLh_PK.js";import{a as ko,c as er}from"./shell-layout-C6in_tdZ.js";import{u as tr,b as So}from"./index-rxNSDZLc.js";import{u as yn}from"./useQueries-Ds44Skcl.js";import{i as Po}from"./LinkBroken01-1s3iBfyN.js";import{u as nr}from"./blocks-preview-workspace-context-9rYmJjdK.js";import{MonacoCodeEditor as Eo}from"./monaco-editor-D7Wz-MKW.js";import{a as jo}from"./utils-B4VCCAxN.js";import{R as gs,a as Ot,b as vs}from"./resizable-rQgJB4MP.js";import{c as No,a as hn}from"./use-project-native-view-presence-YWMyr72T.js";import{w as bs}from"./device-hint-SeLRi17j.js";import{r as To}from"./virtual-mcp-BT4ljKsC.js";import{d as Co}from"./delay-CnY5UFtP.js";import{E as Ro}from"./empty-state-CazxAouP.js";import{G as xs}from"./repository-picker-BjLyF0UU.js";import{R as Lo}from"./repository-import-picker-B0pfCyxB.js";import{r as _o}from"./preview-source-BsRLGWUP.js";import{A as Ao,a as Oo,b as Do}from"./alert-C4LKzrU_.js";import{u as Bo}from"./use-task-metadata-DnDtZNKw.js";function Fo(t){const e=ne.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(ya,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(wa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function Mo(t){const e=ne.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Mt("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let x;e[14]!==i.command?(x=i.command&&s.jsx(io,{command:i.command}),e[14]=i.command,e[15]=x):x=e[15];let v;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==x?(v=s.jsxs("div",{className:m,children:[f,x,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=x,e[20]=v):v=e[20];let E;return e[21]!==a||e[22]!==d||e[23]!==v?(E=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,v]}),e[21]=a,e[22]=d,e[23]=v,e[24]=E):E=e[24],E}const $o=[];function zt(t){const e=ne.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?$o:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let x;e[0]!==i?(x=s.jsx(Fo,{waiting:i}),e[0]=i,e[1]=x):x=e[1];let v;e[2]!==m||e[3]!==n?(v=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=v):v=e[4];let E;e[5]!==r?(E=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=E):E=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==v||e[10]!==E?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,v,E]}),e[7]=f,e[8]=x,e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,b)=>s.jsx(Mo,{index:b+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let j;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(j=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=j):j=e[19],j}function Ko(t){const e=ne.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=_e();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(Ao,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(Oo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(Do,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let B;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(B=lo(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=B):B=e[6];const{title:R,body:D}=B;let O;e[7]!==D?(O=s.jsx(Kt,{text:D}),e[7]=D,e[8]=O):O=e[8];let F;e[9]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(us,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=F):F=e[9];let _;return e[10]!==l||e[11]!==O||e[12]!==R?(_=s.jsx(zt,{headingLevel:2,waiting:!1,title:R,lead:O,alerts:l,footer:F}),e[10]=l,e[11]=O,e[12]=R,e[13]=_):_=e[13],_}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let x;e[18]!==l||e[19]!==n.kind?(x=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(co,{})]}),e[18]=l,e[19]=n.kind,e[20]=x):x=e[20];let v;e[21]!==a?(v=a("decoServe.guide.step1.title"),e[21]=a,e[22]=v):v=e[22];let E;e[23]!==a?(E=a("decoServe.guide.step1.body"),e[23]=a,e[24]=E):E=e[24];let g;e[25]!==E?(g=s.jsx(Kt,{text:E}),e[25]=E,e[26]=g):g=e[26];let k;e[27]!==v||e[28]!==g?(k={title:v,body:g,command:Ys},e[27]=v,e[28]=g,e[29]=k):k=e[29];let j;e[30]!==a?(j=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=j):j=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let b;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(b=n.kind==="needs-gesture"?s.jsx(Xe,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=b):b=e[40];let w;e[41]!==j||e[42]!==y||e[43]!==b?(w={title:j,body:y,after:b},e[41]=j,e[42]=y,e[43]=b,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(us,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==x?(N=s.jsx(zt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:x,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=x,e[54]=N):N=e[54],N}function zo(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const Io=15e3,Uo=3e3;function Ho(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(b,w)=>setTimeout(b,w),clearTimer:o=b=>clearTimeout(b),timeoutMs:l=Uo}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,x=null,v=null;const E=()=>u.visibilityState==="hidden",g=b=>{d={...d,...b},i(d)},k=async b=>{v=new AbortController;const w=v,T=a(()=>w.abort(),l);try{return await n(b,w.signal),!0}catch(P){if(p)return!1;const N=$a(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:b}}):d.problem?.endpoint===b&&g({problem:null}),!1}finally{o(T),v=null}},j=async()=>{if(x=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(E()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const b of e){if(p)break;if(await k(b)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(b);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),E()){g({status:"paused"});return}x=a(()=>{j()},Ma(f,Io))}}};function y(){if(!p){if(E()){x!==null&&(o(x),x=null),m||g({status:"paused"});return}x!==null&&o(x),f=0,j()}}return u.addEventListener("visibilitychange",y),i(d),j(),()=>{p=!0,x!==null&&o(x),v?.abort(),u.removeEventListener("visibilitychange",y)}}function Vo(t,e){return za(Ia({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const qo=["loopback-network","local-network-access"];async function Wo(){if(Ka(window.location.origin))return null;for(const t of qo)try{return await navigator.permissions.query({name:t})}catch{}return null}let sr=null,ys=!1;const gn=new Set;function Go(t){if(gn.add(t),!ys){ys=!0;const e=n=>{sr=n;for(const r of gn)r()};Wo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>gn.delete(t)}const Jo={status:"stopped",firstRoundDone:!1,problem:null},vn=new Map;function Yo(t){const e=vn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=Ho({candidates:t.split(" "),probe:Vo,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,vn.delete(t))})};return vn.set(t,u),u}function rr(){return S.useSyncExternalStore(Go,ks,ks)}const Qo=()=>()=>{},ws=()=>Jo,ks=()=>sr;function Pc(t){const e=ne.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=rr(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Yo(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Qo,d?.getSnapshot??ws,d?.getSnapshot??ws),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let x;return e[5]!==a||e[6]!==p||e[7]!==m?(x={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=x):x=e[8],x}const Ss={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Xo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...Ss,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ss:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Zo=1e4,ei=1e3,ti=3e4;function ni({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Zo)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const x=Ba(ti,ei,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const v=t.current,E=a.current;!v||!E||!o.current||(v.src=E,d())},x)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const si=1500,ri=500;function ai({iframe:t,reload:e,waitMs:n=si,confirmMs:r=ri}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const oi=$t({tag:Ne(),id:Ne(),classes:Ne(),text:Ne(),html:Ne(),manifestKey:Ne().nullable(),componentName:Ne().nullable(),parents:Ne(),url:Ne(),path:Ne(),viewport:$t({width:Ye(),height:Ye()}),position:$t({x:Ye(),y:Ye()})}),ii=`(function() {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-DneoLEuW.js","assets/index-BOCmUs5e.js","assets/index-s7bCSMKE.css","assets/chat-context-ChcTnk8Q.js","assets/use-panel-navigate-sC31QNLz.js","assets/thread-route-CCdwsU-Y.js","assets/use-project-scope-PpktGVbB.js","assets/repository-binding-CRho0p-d.js","assets/use-mcp-client-52cULFEI.js","assets/auth-Ru0XeHze.js","assets/autosend-BkZD94wn.js","assets/thread-intent-FDeXaDYT.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-DJ0G_gEe.js","assets/task-board-C94vU4ou.js","assets/schema-CWcCrp1Z.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-B-KnnZSr.js","assets/use-ai-providers-BQUzk2kS.js","assets/use-chat-navigation-DdZ6WAy-.js","assets/location-BjlyegC2.js","assets/use-organization-settings-oW1-A4fr.js","assets/blocks-tab-states-BiTn5vNe.js","assets/site-editor-toast-BJ5z9pNz.js","assets/input-DkRYN8U-.js","assets/usage-stats-B2hjYXg0.js","assets/tool-namespace-DqRUFWOS.js","assets/form-Bca46vhe.js","assets/label-C-ZL8muP.js","assets/utils-CVEq3hMx.js","assets/markdown-139du5-r.js","assets/use-copy-qf10DRy9.js","assets/Copy01-hfEOHSDl.js","assets/ZoomOut-CKwphFFF.js","assets/use-mobile-CbyN-2jY.js","assets/tooltip-BK6bkzFU.js","assets/index-DwyX0Lfk.js","assets/agent-icon-ndY1RWjU.js","assets/AlertCircle-DRgK9JB_.js","assets/Tool01-BsXZFLbB.js","assets/ArrowUp-CxFxaW35.js","assets/ArrowLeft-BzwJwvy1.js","assets/LinkBroken01-CHV_OJuf.js","assets/ShoppingBag01-C6lx54lK.js","assets/Building02-rClnD4uc.js","assets/CheckCircle-mTX9fWaM.js","assets/ChevronUp-kQFA9QX6.js","assets/ChevronSelectorVertical-Dl1xrKr0.js","assets/UserSquare-BO3h4SWI.js","assets/CreditCard01-DF7MTKJ3.js","assets/DotsVertical-C3XWNKuz.js","assets/Image01-jGkvOWRJ.js","assets/Globe04-JT--e5Bh.js","assets/SwitchHorizontal01-BRLZiSEm.js","assets/Key01-BzxD_x8A.js","assets/Link01-OCnw3a5L.js","assets/Monitor01-CvJxGIjI.js","assets/Sun-hQOE8_Ah.js","assets/Play-03q5nxE3.js","assets/Plus-DNWiwlMd.js","assets/SearchMd-uZ1fg-aL.js","assets/Trash01-AnrBN8Oq.js","assets/Upload01-D1D--Ifq.js","assets/User01-D7NqDG9h.js","assets/Users01-BCrqWlZC.js","assets/XClose-BHIq2rSj.js","assets/format-time-CAj8AQXM.js","assets/differenceInSeconds-C3x8sHUj.js","assets/icon-button-ChLL5yDL.js","assets/file-type-icon-DYutf45Y.js","assets/shell-layout--nu4TX02.js","assets/avatar-svlBTViV.js","assets/use-clock-tick-DIulXUbJ.js","assets/command-ChZnkO48.js","assets/index-DVNE46xa.js","assets/integration-icon-ak9Kf0du.js","assets/project-icon-BbXZsYe5.js","assets/new-project-dialog-CkYId2Lh.js","assets/repository-import-picker-B4RkmAHQ.js","assets/use-navigate-to-agent-BXAeHaex.js","assets/repository-picker-CkFN3RpX.js","assets/useInfiniteQuery-DLiHmV3M.js","assets/infiniteQueryObserver-B7_k3f99.js","assets/collection-search-Ov4rPa97.js","assets/use-debounced-value-CGXDj-PA.js","assets/required-auth-layout-DfsZRaZp.js","assets/use-org-sso-DgTtAFtU.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-iM4uBzs8.js","assets/select-Bq0vTEkX.js","assets/index-BdQq_4o_.js","assets/tabs-j67RnvdQ.js","assets/use-deco-credits-Cn5WFssl.js","assets/toggle-group-Cjg5yTIq.js","assets/use-open-billing-url--GFaVN_O.js","assets/index-DgJzDYIg.js","assets/checkbox-CWzVH6do.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-hPl3gZkE.js","assets/drawer-BMFFvaL0.js","assets/input-VU9TmbHH.js","assets/suggestion-BoKW7C2P.js","assets/use-mcp-prompts-cFJG9oH_.js","assets/use-org-fs-CmUmucUf.js","assets/question-004-sINsf4GQ.js","assets/use-members-DGxX_vQB.js","assets/use-org-auth-client-BvpKSYmO.js","assets/feature-paywall-Cgz8CMXc.js","assets/plan-ladder-B_I9AoFo.js","assets/add-connection-dialog-CI2jVjIC.js","assets/extract-connection-data-BP7KazgH.js","assets/metadata-D72DunRR.js","assets/connection-BQYwMjUn.js","assets/url-slug-W3nScHaD.js","assets/connection-card-w1pyA0AW.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-TaCrk10b.js","assets/use-connection-D1Zl0xok.js","assets/schema-cIPnPaZy.js","assets/connection-form-helpers--5_FBdwa.js","assets/authenticate-and-persist-oauth-Bdc0JCPD.js","assets/mcp-oauth-xr1jliP9.js","assets/mcp-oauth-OreG94Sz.js","assets/collection-tabs-D-zLkcuK.js","assets/badge-DV-csERH.js","assets/use-infinite-scroll-BBMDPJ8Y.js","assets/useSuspenseInfiniteQuery-DKelDyyv.js","assets/use-task-board-events-Bn6hAZVM.js","assets/use-project-native-view-presence-DoHDLNAG.js","assets/use-file-configs-Pqo7OuGa.js","assets/site-slug-DebpOoQq.js","assets/input-Bwd_JSM8.css","assets/sandbox-url-D3mC8qhT.js","assets/utils-Ci8APlrm.js","assets/index-DZEft5uP.js","assets/pair-BuwlHYqc.js","assets/collapsible-wEeZPPIk.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-Bdo6XZex.js","assets/types-CQaTVPow.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-ByjoR9NZ.js","assets/use-thread-outputs-BPKnTsgd.js","assets/sandbox-git-api-CRxdlhrN.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/secret-ciphertext-CSc2OLqA.js","assets/alert-BMizf1K4.js","assets/switch-Dubjp7kN.js","assets/scroll-area-HEEo7zAl.js","assets/monaco-editor-CK_xL2d8.js","assets/editor-Cskgo4t5.js","assets/calendar-BJAZ7ITP.js","assets/editor-classes-C28rWAPt.js","assets/core.esm-BfHJA0TA.js","assets/sortable.esm-D7jA01m7.js","assets/view-mode-toggle-Drydf5me.js","assets/combobox-AVFbBj8k.js","assets/alert-dialog-BwIOugPC.js","assets/search-input-C1zHzfNa.js","assets/asset-utils-BIz3ln3H.js","assets/empty-state-5cqHHAHm.js","assets/mustache-CKk3zMw1.js","assets/use-section-preview-base-DXQMfLn9.js","assets/section-preview-url-7zfngvgW.js","assets/page-seo-form-JACX4dVa.js","assets/variant-draft-pointer-C9f5IZVL.js"])))=>i.map(i=>d[i]);
2
+ import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aY as Ye,aG as Ne,q as Os,D as Ds,K as Bs,s as Fs,v as Ms,e as Ir,h as gt,I as rs,w as Ur,aZ as Hr,a2 as Sn,a_ as Vr,aX as qr,at as as,av as os,a5 as Wr,P as is,y as Gr,t as cn,o as Jr,m as Yr}from"./index-BOCmUs5e.js";import{u as $s,g as Qr,c as Xr,B as dn,P as Zr,r as ea,R as ta,a as na,b as Ks,d as zs,i as sa,S as ra,e as aa,f as oa,C as ia,h as la,j as ca,l as da,m as ua,p as fa,k as ma,n as un,N as pa}from"./blocks-tab-states-BiTn5vNe.js";import{b as ha,c as It,r as Is,l as Us,f as ga,g as va,w as ba}from"./chat-context-ChcTnk8Q.js";import{t as xa}from"./ChevronUp-kQFA9QX6.js";import{R as ya,S as wa,J as Hs,T as ka,b as Sa,U as Pa,V as Ea,W as ja,X as Na,Y as ls,Z as Ta}from"./agent-icon-ndY1RWjU.js";import{a as Ca}from"./UserSquare-BO3h4SWI.js";import{s as Ra}from"./Plus-DNWiwlMd.js";import{P as La,a as _a,b as Aa}from"./popover-hPl3gZkE.js";import{a as mt,b as pt,c as Vs,d as qs,e as Ws,C as Gs}from"./command-ChZnkO48.js";import{c as Oa,a as Da}from"./repository-binding-CRho0p-d.js";import{b as Pn}from"./sandbox-lifecycle-context-BpxXnBl4.js";import{e as Ba}from"./backoff-CrEUbyZT.js";import{f as Fa}from"./thread-intent-FDeXaDYT.js";import{a as Js}from"./input-DkRYN8U-.js";import{S as Ys,A as Ma,B as $a,C as Ka,F as za,G as Ia,H as Ua,I as Ha,u as En,J as jn,K as xn,L as Va,M as qa,N as Wa,c as Ga,b as Qs,O as Ja,P as Qe,z as Ya,Q as Qa,R as Xa,U as Za,x as eo,V as cs,w as to,W as no,e as so}from"./site-editor-toast-BJ5z9pNz.js";import{u as ro}from"./use-mobile-CbyN-2jY.js";import{c as fn,T as mn,a as pn}from"./tooltip-BK6bkzFU.js";import{T as ct}from"./toolbar-icon-button-FvedXQUt.js";import{b as ao,w as At,a as ds,i as oo}from"./variant-draft-pointer-C9f5IZVL.js";import{h as io,s as lo,L as co,R as Kt,j as us,N as uo,k as fo,l as ht,n as Nn,m as Xs,f as Fe,v as Zs,o as mo,q as po,r as ho,t as go,u as vo,w as fs,d as bo}from"./secret-ciphertext-CSc2OLqA.js";import{r as xo,D as ms,w as ps,b as hs,a as yo}from"./section-preview-url-7zfngvgW.js";import{u as wo}from"./use-fast-preview-draft-url-2FsUFQjh.js";import{a as ko,c as er}from"./shell-layout--nu4TX02.js";import{u as tr,b as So}from"./index-DZEft5uP.js";import{u as yn}from"./useQueries-Btn7O7jr.js";import{i as Po}from"./LinkBroken01-CHV_OJuf.js";import{u as nr}from"./blocks-preview-workspace-context-C6DV9nNg.js";import{MonacoCodeEditor as Eo}from"./monaco-editor-CK_xL2d8.js";import{a as jo}from"./utils-Ci8APlrm.js";import{R as gs,a as Ot,b as vs}from"./resizable-9eb5yMBY.js";import{c as No,a as hn}from"./use-project-native-view-presence-DoHDLNAG.js";import{w as bs}from"./device-hint-SeLRi17j.js";import{r as To}from"./virtual-mcp-DTVuDZwT.js";import{d as Co}from"./delay-CnY5UFtP.js";import{E as Ro}from"./empty-state-5cqHHAHm.js";import{G as xs}from"./repository-picker-CkFN3RpX.js";import{R as Lo}from"./repository-import-picker-B4RkmAHQ.js";import{r as _o}from"./preview-source-BsRLGWUP.js";import{A as Ao,a as Oo,b as Do}from"./alert-BMizf1K4.js";import{u as Bo}from"./use-task-metadata-Cq4Zn8Tm.js";function Fo(t){const e=ne.c(10),{waiting:n}=t,r=n?"true":"false";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(ya,{className:"size-5 sm:size-6"})}),e[0]=i):i=e[0];let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=u):u=e[1];let a;e[2]!==n?(a=n&&s.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=n,e[3]=a):a=e[3];let o;e[4]!==a?(o=s.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[u,a]}),e[4]=a,e[5]=o):o=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:s.jsx(wa,{className:"size-5 sm:size-6"})}),e[6]=l):l=e[6];let d;return e[7]!==r||e[8]!==o?(d=s.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":r,className:"flex items-center gap-2",children:[i,o,l]}),e[7]=r,e[8]=o,e[9]=d):d=e[9],d}function Mo(t){const e=ne.c(25),{index:n,numbered:r,step:i,heading:u}=t,a=S.useId();let o;e[0]!==n||e[1]!==r?(o=r&&s.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:n}),e[0]=n,e[1]=r,e[2]=o):o=e[2];let l;e[3]!==u||e[4]!==a||e[5]!==i.title?(l=s.jsx(u,{id:a,className:"text-sm font-medium text-foreground",children:i.title}),e[3]=u,e[4]=a,e[5]=i.title,e[6]=l):l=e[6];let d;e[7]!==o||e[8]!==l?(d=s.jsxs("div",{className:"flex items-center gap-3",children:[o,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9];const p=r&&"sm:pl-9";let m;e[10]!==p?(m=Mt("flex min-w-0 flex-col gap-3",p),e[10]=p,e[11]=m):m=e[11];let f;e[12]!==i.body?(f=i.body&&s.jsx("p",{className:"text-sm text-muted-foreground",children:i.body}),e[12]=i.body,e[13]=f):f=e[13];let x;e[14]!==i.command?(x=i.command&&s.jsx(io,{command:i.command}),e[14]=i.command,e[15]=x):x=e[15];let v;e[16]!==i.after||e[17]!==m||e[18]!==f||e[19]!==x?(v=s.jsxs("div",{className:m,children:[f,x,i.after]}),e[16]=i.after,e[17]=m,e[18]=f,e[19]=x,e[20]=v):v=e[20];let E;return e[21]!==a||e[22]!==d||e[23]!==v?(E=s.jsxs("li",{"aria-labelledby":a,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[d,v]}),e[21]=a,e[22]=d,e[23]=v,e[24]=E):E=e[24],E}const $o=[];function zt(t){const e=ne.c(20),{title:n,lead:r,waiting:i,alerts:u,steps:a,footer:o,headingLevel:l}=t,d=a===void 0?$o:a,p=l===void 0?1:l,m=p===1?"h1":"h2",f=i&&d.length===0?"status":void 0;let x;e[0]!==i?(x=s.jsx(Fo,{waiting:i}),e[0]=i,e[1]=x):x=e[1];let v;e[2]!==m||e[3]!==n?(v=s.jsx(m,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:n}),e[2]=m,e[3]=n,e[4]=v):v=e[4];let E;e[5]!==r?(E=r&&s.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:r}),e[5]=r,e[6]=E):E=e[6];let g;e[7]!==f||e[8]!==x||e[9]!==v||e[10]!==E?(g=s.jsxs("header",{role:f,className:"flex flex-col items-center gap-3 text-center",children:[x,v,E]}),e[7]=f,e[8]=x,e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==p||e[13]!==d?(k=d.length>0&&s.jsx("ol",{className:"flex flex-col gap-3",children:d.map((y,b)=>s.jsx(Mo,{index:b+1,numbered:d.length>1,step:y,heading:p===1?"h2":"h3"},y.title))}),e[12]=p,e[13]=d,e[14]=k):k=e[14];let j;return e[15]!==u||e[16]!==o||e[17]!==g||e[18]!==k?(j=s.jsx("div",{className:"h-full w-full overflow-y-auto",children:s.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[g,u,k,o]})}),e[15]=u,e[16]=o,e[17]=g,e[18]=k,e[19]=j):j=e[19],j}function Ko(t){const e=ne.c(55),{wait:n,hosts:r,invalidLink:i}=t,u=i===void 0?!1:i,a=_e();let o;e[0]!==u||e[1]!==a?(o=u&&s.jsx(Ao,{variant:"warning",children:s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[s.jsx(Oo,{className:"line-clamp-none text-foreground",children:a("decoServe.link.invalidTitle")}),s.jsx(Do,{children:a("decoServe.link.invalidBody")})]})}),e[0]=u,e[1]=a,e[2]=o):o=e[2];const l=o;if(n.kind==="problem"){let B;e[3]!==a||e[4]!==n.host||e[5]!==n.problem?(B=lo(a,n.problem,n.host),e[3]=a,e[4]=n.host,e[5]=n.problem,e[6]=B):B=e[6];const{title:R,body:D}=B;let O;e[7]!==D?(O=s.jsx(Kt,{text:D}),e[7]=D,e[8]=O):O=e[8];let F;e[9]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(us,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=F):F=e[9];let _;return e[10]!==l||e[11]!==O||e[12]!==R?(_=s.jsx(zt,{headingLevel:2,waiting:!1,title:R,lead:O,alerts:l,footer:F}),e[10]=l,e[11]=O,e[12]=R,e[13]=_):_=e[13],_}const d=n.kind==="looking",p=d&&!n.paused;let m;e[14]!==a?(m=a("decoServe.waiting.title"),e[14]=a,e[15]=m):m=e[15];let f;e[16]!==a?(f=a("decoServe.waiting.lead"),e[16]=a,e[17]=f):f=e[17];let x;e[18]!==l||e[19]!==n.kind?(x=(l||n.kind==="denied")&&s.jsxs(s.Fragment,{children:[l,n.kind==="denied"&&s.jsx(co,{})]}),e[18]=l,e[19]=n.kind,e[20]=x):x=e[20];let v;e[21]!==a?(v=a("decoServe.guide.step1.title"),e[21]=a,e[22]=v):v=e[22];let E;e[23]!==a?(E=a("decoServe.guide.step1.body"),e[23]=a,e[24]=E):E=e[24];let g;e[25]!==E?(g=s.jsx(Kt,{text:E}),e[25]=E,e[26]=g):g=e[26];let k;e[27]!==v||e[28]!==g?(k={title:v,body:g,command:Ys},e[27]=v,e[28]=g,e[29]=k):k=e[29];let j;e[30]!==a?(j=a("decoServe.waiting.step2.title"),e[30]=a,e[31]=j):j=e[31];let y;e[32]!==a?(y=a("decoServe.waiting.step2.body"),e[32]=a,e[33]=y):y=e[33];let b;e[34]!==r||e[35]!==d||e[36]!==a||e[37]!==n.kind||e[38]!==n.onStart||e[39]!==n.paused?(b=n.kind==="needs-gesture"?s.jsx(Xe,{variant:"outline",className:"self-start",onClick:n.onStart,children:a("decoServe.guide.step2.start")}):d&&s.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:n.paused?a("decoServe.guide.step2.paused"):a("decoServe.guide.step2.looking",{hosts:r})}),e[34]=r,e[35]=d,e[36]=a,e[37]=n.kind,e[38]=n.onStart,e[39]=n.paused,e[40]=b):b=e[40];let w;e[41]!==j||e[42]!==y||e[43]!==b?(w={title:j,body:y,after:b},e[41]=j,e[42]=y,e[43]=b,e[44]=w):w=e[44];let T;e[45]!==k||e[46]!==w?(T=[k,w],e[45]=k,e[46]=w,e[47]=T):T=e[47];let P;e[48]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(us,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[48]=P):P=e[48];let N;return e[49]!==T||e[50]!==p||e[51]!==m||e[52]!==f||e[53]!==x?(N=s.jsx(zt,{headingLevel:2,waiting:p,title:m,lead:f,alerts:x,steps:T,footer:P}),e[49]=T,e[50]=p,e[51]=m,e[52]=f,e[53]=x,e[54]=N):N=e[54],N}function zo(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const Io=15e3,Uo=3e3;function Ho(t){const{candidates:e,probe:n,onFound:r,onChange:i,doc:u=document,setTimer:a=(b,w)=>setTimeout(b,w),clearTimer:o=b=>clearTimeout(b),timeoutMs:l=Uo}=t;let d={status:"searching",firstRoundDone:!1,problem:null},p=!1,m=!1,f=0,x=null,v=null;const E=()=>u.visibilityState==="hidden",g=b=>{d={...d,...b},i(d)},k=async b=>{v=new AbortController;const w=v,T=a(()=>w.abort(),l);try{return await n(b,w.signal),!0}catch(P){if(p)return!1;const N=$a(P);return N.reason!=="not-answering"?g({problem:{...N,endpoint:b}}):d.problem?.endpoint===b&&g({problem:null}),!1}finally{o(T),v=null}},j=async()=>{if(x=null,!(p||m)){if(e.length===0){g({status:"stopped",firstRoundDone:!0});return}if(E()){g({status:"paused"});return}m=!0,d.status!=="searching"&&g({status:"searching"});for(const b of e){if(p)break;if(await k(b)){if(m=!1,p)return;p=!0,u.removeEventListener("visibilitychange",y),g({status:"found",firstRoundDone:!0}),r(b);return}}if(m=!1,!p){if(f+=1,d.firstRoundDone||g({firstRoundDone:!0}),E()){g({status:"paused"});return}x=a(()=>{j()},Ma(f,Io))}}};function y(){if(!p){if(E()){x!==null&&(o(x),x=null),m||g({status:"paused"});return}x!==null&&o(x),f=0,j()}}return u.addEventListener("visibilitychange",y),i(d),j(),()=>{p=!0,x!==null&&o(x),v?.abort(),u.removeEventListener("visibilitychange",y)}}function Vo(t,e){return za(Ia({endpoint:t,fetch:n=>fetch(n,{signal:e})}))}const qo=["loopback-network","local-network-access"];async function Wo(){if(Ka(window.location.origin))return null;for(const t of qo)try{return await navigator.permissions.query({name:t})}catch{}return null}let sr=null,ys=!1;const gn=new Set;function Go(t){if(gn.add(t),!ys){ys=!0;const e=n=>{sr=n;for(const r of gn)r()};Wo().then(n=>{if(!n)return e("unsupported");e(n.state),n.addEventListener("change",()=>e(n.state))})}return()=>gn.delete(t)}const Jo={status:"stopped",firstRoundDone:!1,problem:null},vn=new Map;function Yo(t){const e=vn.get(t);if(e)return e;let n={status:"searching",firstRoundDone:!1,problem:null};const r=new Set;let i=null;const u={onFound:()=>{},getSnapshot:()=>n,subscribe:a=>(r.add(a),i??=Ho({candidates:t.split(" "),probe:Vo,onFound:o=>u.onFound(o),onChange:o=>{n=o;for(const l of r)l()}}),()=>{r.delete(a),!(r.size>0)&&(i?.(),i=null,vn.delete(t))})};return vn.set(t,u),u}function rr(){return S.useSyncExternalStore(Go,ks,ks)}const Qo=()=>()=>{},ws=()=>Jo,ks=()=>sr;function Pc(t){const e=ne.c(9),{candidates:n,onFound:r}=t,[i,u]=S.useState(!1),a=rr(),l=(a==="granted"||a==="unsupported"||a==="prompt"&&i)&&n.length>0;let d;e[0]!==l||e[1]!==n||e[2]!==r?(d=l?Yo(n.join(" ")):null,d&&(d.onFound=r),e[0]=l,e[1]=n,e[2]=r,e[3]=d):d=e[3];const p=S.useSyncExternalStore(d?.subscribe??Qo,d?.getSnapshot??ws,d?.getSnapshot??ws),m=a==="prompt"&&!i;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[4]=f):f=e[4];let x;return e[5]!==a||e[6]!==p||e[7]!==m?(x={state:p,access:a,needsGesture:m,start:f},e[5]=a,e[6]=p,e[7]=m,e[8]=x):x=e[8],x}const Ss={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Xo(t){const{previewState:e,progressStatus:n,fastPreviewActive:r=!1,fastPreviewReady:i=!1,codingSession:u=!1,hostedDraft:a=!1}=t,o=u?null:t.previewServerUrl;return t.deciding?{...Ss,showDecidingLoader:!0}:t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Ss:r&&i&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:r&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!r&&e.kind==="iframe"&&n!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Zo=1e4,ei=1e3,ti=3e4;function ni({iframeRef:t,src:e,active:n}){const r=S.useRef(0),i=S.useRef(null),u=S.useRef(null),a=S.useRef(e),o=S.useRef(n);a.current=e,o.current=n;const l=()=>{i.current&&clearTimeout(i.current),u.current&&clearTimeout(u.current),i.current=null,u.current=null},d=()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,p()},Zo)},p=()=>{if(!o.current||!a.current)return;u.current&&clearTimeout(u.current);const x=Ba(ti,ei,r.current,2,.5);r.current+=1,u.current=setTimeout(()=>{u.current=null;const v=t.current,E=a.current;!v||!E||!o.current||(v.src=E,d())},x)},m=()=>{r.current=0,l()},f=()=>{i.current&&(clearTimeout(i.current),i.current=null),p()};return S.useEffect(()=>{if(l(),r.current=0,!(!n||!e))return d(),l},[e,n]),{handleLoad:m,handleError:f}}const si=1500,ri=500;function ai({iframe:t,reload:e,waitMs:n=si,confirmMs:r=ri}){let i;const u=()=>{clearTimeout(a),i=setTimeout(e,r)};t.addEventListener("load",u,{once:!0});const a=setTimeout(()=>{t.removeEventListener("load",u),e()},n);return()=>{clearTimeout(a),clearTimeout(i),t.removeEventListener("load",u)}}const oi=$t({tag:Ne(),id:Ne(),classes:Ne(),text:Ne(),html:Ne(),manifestKey:Ne().nullable(),componentName:Ne().nullable(),parents:Ne(),url:Ne(),path:Ne(),viewport:$t({width:Ye(),height:Ye()}),position:$t({x:Ye(),y:Ye()})}),ii=`(function() {
3
3
  if (window.__visualEditorActive) return;
4
4
  window.__visualEditorActive = true;
5
5
 
@@ -548,4 +548,4 @@ import{c as ne,j as s,r as S,l as Mt,b as _e,B as Xe,aF as $t,aY as Ye,aG as Ne,
548
548
  }
549
549
  });
550
550
  })();`;function wn(t,e){let n=t,r=typeof n?.__resolveType=="string"?n.__resolveType:"";for(let i=0;r&&i<5;i++){const u=e[r];if(u&&typeof u=="object"&&"__resolveType"in u){const a=u.__resolveType;if(typeof a=="string"&&a&&a!==r){n=u,r=a;continue}}break}if(!r)return[];if(r.includes("flags/multivariate")){const i=Array.isArray(n.variants)?n.variants:[];if(i.length===0||i.every(o=>o?.rule?.__resolveType===uo))return null;const a=[];for(const o of i){const l=o?.value;if(l&&typeof l=="object")for(const d of wn(l,e)??[])a.includes(d)||a.push(d)}return a}if(fo(r)){const i=n.section&&typeof n.section=="object"?wn(n.section,e):[];return i===null?null:i.length?[r,...i]:[r]}return[r]}function Je(t){return t.replace(/[`*_]/g,"\\$&")}function di(t,e){const n=[`The user selected an element on the live preview and asked: **"${Je(e.trim())}"**`,"","For text content changes, locate the correct source file and apply the change.","For code and CSS changes, understand which component the user is referring to and apply changes to the correct component.",""];t.manifestKey&&n.push(`**Section resolveType:** \`${Je(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const r=`<${t.tag}${t.classes?` class="${Je(t.classes)}"`:""}>`;n.push(`**Clicked element:** \`${r}\``),t.parents&&n.push(`**DOM breadcrumb:** ${Je(t.parents)} > ${t.tag}`),t.text&&n.push(`**Text content:** "${Je(t.text)}"`),t.componentName&&n.push(`**Component name:** ${Je(t.componentName)}`);const i=t.html.replace(/```/g,"`` `");return n.push("","**HTML snippet:**","```html",i,"```"),n.push("","Please read the source file, locate the element, and apply the requested change."),n.join(`
551
- `)}function ui(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function fi(t){const e=ne.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=ha(),{openSidePanel:l}=ko(),d=_e();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const U=di(n,i);l(),o({parts:[{type:"text",text:U}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=ui(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const x=f,v=`${x.leftPct}%`,E=`${x.topPct}%`;let g;e[9]!==v||e[10]!==E?(g={left:v,top:E,width:"320px"},e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==m?(k=U=>{U.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=U=>u(U.target.value),e[14]=j):j=e[14];let y;e[15]!==r?(y=U=>{U.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let b;e[17]!==d?(b=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==b?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:j,onKeyDown:y,placeholder:b,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=b,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let B;e[27]!==d?(B=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=B):B=e[28];let R;e[29]!==B?(R=s.jsx("title",{children:B}),e[29]=B,e[30]=R):R=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=D):D=e[31];let O;e[32]!==R?(O=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,D]}),e[32]=R,e[33]=O):O=e[33];let F;e[34]!==P||e[35]!==N||e[36]!==O?(F=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:O}),e[34]=P,e[35]=N,e[36]=O,e[37]=F):F=e[37];let _;e[38]!==w||e[39]!==F||e[40]!==k?(_=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:k,children:[w,F]}),e[38]=w,e[39]=F,e[40]=k,e[41]=_):_=e[41];let I;return e[42]!==_||e[43]!==g?(I=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:_}),e[42]=_,e[43]=g,e[44]=I):I=e[44],I}const Es="site-links",mi=/details?page|\bpdp\b/i,pi=/listingpage|\bplp\b/i;function hi(t,e,n){const r=new Set;for(const o of n)mi.test(o)&&r.add("product"),pi.test(o)&&r.add("category");const i=ht(Nn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const gi=["rosa","preto","pink","black"];function Dt(t,e){const n=e.trim();return n?t(n):gi.flatMap(r=>t(r))}function vi(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const ar=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Tn(t){return t.split("/")[0]??""}function bi(t){const e=new Set;for(const n of t){const r=Tn(n);ar.has(r)&&e.add(r)}return e}function xi(t,e){const n=Tn(t);return!ar.has(n)||e.size===0?!0:e.has(n)}const yi=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Dt(n=>vi(t,n),e),optionsFromPayload:Bt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:Ni}];function wi(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of yi){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&xi(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Tn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(ki(t.has("category")?"category":"product")),a}function ki(t){return{kind:t,id:Es,resolveType:Es,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>_i(e,n)}}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Si(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=Ie(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=Ie(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function or(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function ir(t){try{return decodeURIComponent(t)}catch{return t}}function Pi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=Pi(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function lr(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=ht(Nn(e)),{pattern:u,order:a}=Ei(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?ir(d):null}function Bt(t,e){const n=Ie(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=Ie(a);if(!o)continue;const l=lr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=Ie(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?Ie(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function ji(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?ir(n):null}function Ni(t){const e=[],n=new Set,r=(i,u)=>{const a=Ie(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=ji(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const Ti=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function Ci(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function Ri(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function Li(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function _i(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=lr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&Ti.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:Ci(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of Li(t))i(u,a,"product",o);for(const{href:u,text:a}of Ri(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function dt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const cr=1e4;function Ai(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function Oi(t,{resolveType:e,props:n}){const r=await fetch(Ua(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(cr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function js(t,e){const n=await fetch(Ha(t,e),{signal:AbortSignal.timeout(cr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function Di(t,e,n){const r=e.optionsFromPayload(await js(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Fe(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await js(t,u),n).filter(o=>o.kind==="product");return or([r,a])}catch{return r}}function Bi(t,e,n){return Bs.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function Fi(t,e,n,r){if(e.homepageLinks)return Di(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>Oi(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return or(a.map(o=>e.optionsFromPayload(o,r)))}function kn(t,e,n,r,i){return{queryKey:Bi(t,e,n),queryFn:()=>Fi(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function ut(t){const e=ne.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(Hs,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Fe(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(mt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Ns(t){const e=ne.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Mi(t){const e=ne.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=_e(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[x,v]=S.useState(""),E=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=Ai(l),y=[...new Set(n.map(M=>k[M.kind].noun))].join(" or ");let b;e[0]!==l||e[1]!==y?(b=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=b):b=e[2];const w=b,T={template:r,paramName:i};let P;e[3]!==m?(P=(M,G)=>({source:M,query:G,options:M.clientFilter?dt(G.data??[],m):G.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,B=n.filter(qi),R=n.filter(Vi),D=yn({queries:B.map(M=>kn(a,M,x,T,d))});let O;e[5]!==D||e[6]!==N?(O=(M,G)=>N(M,D[G]),e[5]=D,e[6]=N,e[7]=O):O=e[7];const F=B.map(O),_=F.length===0||F.every(Hi),I=yn({queries:R.map(M=>kn(a,M,x,T,d&&_))});let U;e[8]!==I||e[9]!==N?(U=(M,G)=>N(M,I[G]),e[8]=I,e[9]=N,e[10]=U):U=e[10];const Z=R.map(U),z=_?Z:F,q=z.length===1&&z[0]?.source.homepageLinks?z[0]:null,ee=q&&!q.query.isLoading&&!q.query.isError?q?.query.data??[]:[],ce=dt(ee.filter(Ui),m),C=dt(ee.filter(Ii),m),H=ce.length>0&&C.length>0,A=M=>{p(M),E.current&&clearTimeout(E.current),f(M?u:""),v(M?u:"")};let J;e[11]===Symbol.for("react.memo_cache_sentinel")?(J=M=>{f(M),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{v(M)},300)},e[11]=J):J=e[11];const Y=J,Q=M=>{o(M),A(!1)},he=Xs(m),se=Fe(r,{[i]:he}),W=Ds,oe=Os,we="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",de=zi;let re;e[12]!==g||e[13]!==l?(re=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=re):re=e[14];let ue;e[15]!==re?(ue=s.jsx(Fs,{className:"sr-only",children:s.jsx(Ms,{children:re})}),e[15]=re,e[16]=ue):ue=e[16];let ke;e[17]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Hs,{size:16,className:"shrink-0 text-foreground"}),e[17]=ke):ke=e[17];let ae;e[18]!==l?(ae=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=ae):ae=e[19];let fe;e[20]!==g?(fe=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-[12px] text-special",children:g}),e[20]=g,e[21]=fe):fe=e[21];let ie;e[22]!==ae||e[23]!==fe?(ie=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ke,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ae," ",fe]})]}),e[22]=ae,e[23]=fe,e[24]=ie):ie=e[24];const Te=qs,Se=!1,Me="min-h-0 flex-1";let ge;e[25]!==w||e[26]!==m?(ge=s.jsx(Ws,{autoFocus:!0,placeholder:w,value:m,onValueChange:Y}),e[25]=w,e[26]=m,e[27]=ge):ge=e[27];const Ze=Vs,vt="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Be;e[28]!==l?(Be=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Be):Be=e[29];let Ae;e[30]!==Be?(Ae=s.jsx(Gs,{children:Be}),e[30]=Be,e[31]=Ae):Ae=e[31];const be=he&&s.jsx(mt,{className:"shrink-0",children:s.jsxs(pt,{value:`__raw__:${he}`,className:"gap-3 py-2",onSelect:()=>Q(he),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Po,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:he,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:se})]})]})}),$e=H?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:ce,template:r,paramName:i,keyPrefix:`${q?.source.id}:cat`,onSelect:Q})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${q?.source.id}:prod`,onSelect:Q})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:z.map(M=>{const{source:G,query:Ke,options:et}=M,{noun:Ue}=k[G.kind];if(Ke.isLoading)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.loading",{noun:Ue})},G.id);if(Ke.isError)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},G.id);if(G.homepageLinks){const bt=Ke.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:dt(bt.filter(Ki),m),template:r,paramName:i,keyPrefix:`${G.id}:cat`,onSelect:Q}),s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:dt(bt.filter($i),m),template:r,paramName:i,keyPrefix:`${G.id}:prod`,onSelect:Q})]},G.id)}return s.jsx(ut,{heading:z.length>1?k[G.kind].heading:void 0,iconKind:G.kind,options:et,template:r,paramName:i,keyPrefix:G.id,onSelect:Q},G.id)})});let Ce;e[32]!==Ze||e[33]!==Ae||e[34]!==be||e[35]!==$e?(Ce=s.jsxs(Ze,{className:vt,children:[Ae,be,$e]}),e[32]=Ze,e[33]=Ae,e[34]=be,e[35]=$e,e[36]=Ce):Ce=e[36];let Re;e[37]!==Te||e[38]!==ge||e[39]!==Ce?(Re=s.jsxs(Te,{shouldFilter:Se,className:Me,children:[ge,Ce]}),e[37]=Te,e[38]=ge,e[39]=Ce,e[40]=Re):Re=e[40];let Pe;e[41]!==oe||e[42]!==ue||e[43]!==ie||e[44]!==Re||e[45]!==de?(Pe=s.jsxs(oe,{className:we,onClick:de,children:[ue,ie,Re]}),e[41]=oe,e[42]=ue,e[43]=ie,e[44]=Re,e[45]=de,e[46]=Pe):Pe=e[46];let xe;return e[47]!==W||e[48]!==A||e[49]!==d||e[50]!==Pe?(xe=s.jsx(W,{open:d,onOpenChange:A,children:Pe}),e[47]=W,e[48]=A,e[49]=d,e[50]=Pe,e[51]=xe):xe=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-[12px] text-special hover:bg-special/25",onClick:M=>{M.stopPropagation(),A(!0)},children:u||g}),xe]})}function $i(t){return t.kind==="product"}function Ki(t){return t.kind!=="product"}function zi(t){return t.stopPropagation()}function Ii(t){return t.kind==="product"}function Ui(t){return t.kind!=="product"}function Hi(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Vi(t){return t.isFallback}function qi(t){return!t.isFallback}function Wi(t){const e=ne.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const x={template:r,paramName:i},v=n.filter(Gi);l=yn,o=v.map(E=>kn(u,E,"",x,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const x of p){if(x.isLoading)break;const v=x.data?.[0];if(v){f(!0),queueMicrotask(()=>a(v.value));break}}return null}function Gi(t){return!t.isFallback}function Ji(t){const e=ne.c(31),{name:n,value:r,onCommit:i}=t,u=_e(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,x=a||f;let v;e[3]!==x?(v=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-[12px]",children:x}),e[3]=x,e[4]=v):v=e[4];let E;e[5]!==f||e[6]!==u?(E=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=E):E=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let j;e[10]!==r?(j=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=j):j=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=Xs(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let b;e[16]!==a||e[17]!==f||e[18]!==E||e[19]!==j||e[20]!==y?(b=s.jsx("input",{type:"text",value:a,placeholder:f,title:E,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-[12px] text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Yi,onChange:g,onFocus:k,onKeyDown:j,onBlur:y}),e[16]=a,e[17]=f,e[18]=E,e[19]=j,e[20]=y,e[21]=b):b=e[21];let w;e[22]!==v||e[23]!==b?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,b]}),e[22]=v,e[23]=b,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-[10px] text-muted-foreground",children:[s.jsx(ka,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Yi(t){return t.stopPropagation()}function Qi(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Xi(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Zi(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function el(t){const e=ne.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=$s(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const d=Qr(a),p=l?{...l,name:a,path:o}:Xr(a,o);return await r.mutateAsync({blockKey:d,data:p}),{key:d,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],Ir(i)}function tl(t){const e=ne.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=_e();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let x;e[2]!==d?(x=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=x):x=e[3];const[v,E]=S.useState(x),[g,k]=S.useState(dn),[j,y]=S.useState(null),[b,w]=S.useState(n);n!==b&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),E(d("sectionsEditor.createPageModal.defaultPagePath")),k(dn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=ae=>{!ae&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let B;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==v||e[11]!==T||e[12]!==g?(B=async ae=>{ae.preventDefault();const fe=m.trim(),ie=v.trim();if(!fe||!ie||l)return;const Te=Zs(ie);if(Te){y(Te);return}y(null),await o({name:fe,path:ie,templateKey:T&&g!==dn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=v,e[11]=T,e[12]=g,e[13]=B):B=e[13];const R=B,D=j??u;let O;e[14]!==d?(O=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=O):O=e[15];let F;e[16]!==O?(F=s.jsx(Fs,{children:s.jsx(Ms,{children:O})}),e[16]=O,e[17]=F):F=e[17];let _;e[18]!==d?(_=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=_):_=e[19];let I;e[20]!==_?(I=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=I):I=e[21];let U;e[22]===Symbol.for("react.memo_cache_sentinel")?(U=ae=>f(ae.target.value),e[22]=U):U=e[22];let Z;e[23]!==d?(Z=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=Z):Z=e[24];let z;e[25]!==l||e[26]!==m||e[27]!==Z?(z=s.jsx(rs,{id:"new-page-name",value:m,onChange:U,placeholder:Z,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=Z,e[28]=z):z=e[28];let q;e[29]!==z||e[30]!==I?(q=s.jsxs("div",{className:"space-y-1.5",children:[I,z]}),e[29]=z,e[30]=I,e[31]=q):q=e[31];let te;e[32]!==d?(te=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=te):te=e[33];let ee;e[34]!==te?(ee=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:te}),e[34]=te,e[35]=ee):ee=e[35];let ce;e[36]===Symbol.for("react.memo_cache_sentinel")?(ce=ae=>E(ae.target.value),e[36]=ce):ce=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let H;e[39]!==l||e[40]!==v||e[41]!==C?(H=s.jsx(rs,{id:"new-page-path",value:v,onChange:ce,placeholder:C,disabled:l}),e[39]=l,e[40]=v,e[41]=C,e[42]=H):H=e[42];let A;e[43]!==ee||e[44]!==H?(A=s.jsxs("div",{className:"space-y-1.5",children:[ee,H]}),e[43]=ee,e[44]=H,e[45]=A):A=e[45];let J;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(J=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(Zr,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=J):J=e[51];let Y;e[52]!==D?(Y=D&&s.jsx("p",{className:"text-xs text-destructive",children:D}),e[52]=D,e[53]=Y):Y=e[53];let Q;e[54]!==q||e[55]!==A||e[56]!==J||e[57]!==Y?(Q=s.jsxs("div",{className:"space-y-4 py-4",children:[q,A,J,Y]}),e[54]=q,e[55]=A,e[56]=J,e[57]=Y,e[58]=Q):Q=e[58];let he;e[59]!==r?(he=()=>r(!1),e[59]=r,e[60]=he):he=e[60];let se;e[61]!==d?(se=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=se):se=e[62];let W;e[63]!==l||e[64]!==he||e[65]!==se?(W=s.jsx(Xe,{type:"button",variant:"outline",onClick:he,disabled:l,children:se}),e[63]=l,e[64]=he,e[65]=se,e[66]=W):W=e[66];let oe;e[67]!==l||e[68]!==m||e[69]!==v?(oe=!m.trim()||!v.trim()||l,e[67]=l,e[68]=m,e[69]=v,e[70]=oe):oe=e[70];let we;e[71]!==l||e[72]!==d?(we=l?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=we):we=e[73];let de;e[74]!==oe||e[75]!==we?(de=s.jsx(Xe,{type:"submit",disabled:oe,children:we}),e[74]=oe,e[75]=we,e[76]=de):de=e[76];let re;e[77]!==W||e[78]!==de?(re=s.jsxs(Ur,{children:[W,de]}),e[77]=W,e[78]=de,e[79]=re):re=e[79];let ue;e[80]!==R||e[81]!==Q||e[82]!==re||e[83]!==F?(ue=s.jsx(Os,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[F,Q,re]})}),e[80]=R,e[81]=Q,e[82]=re,e[83]=F,e[84]=ue):ue=e[84];let ke;return e[85]!==N||e[86]!==n||e[87]!==ue?(ke=s.jsx(Ds,{open:n,onOpenChange:N,children:ue}),e[85]=N,e[86]=n,e[87]=ue,e[88]=ke):ke=e[88],ke}function nl(t){const e=ne.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=_e();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=$s(p);let f;e[4]!==m?(f=na((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const x=f;let v;e[6]!==l||e[7]!==o?(v=ea(o,l),e[6]=l,e[7]=o,e[8]=v):v=e[8];const{resolveType:E,props:g,title:k}=v;if(!E){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const j=`loader:${l}`;let y;e[13]!==l||e[14]!==E||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:E,title:k},e[13]=l,e[14]=E,e[15]=k,e[16]=y):y=e[16];let b;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==x||e[25]!==j||e[26]!==y||e[27]!==r?(b=s.jsx(ta,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:sl,onSaveReferencedBlock:x,showRun:!1},j),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=x,e[25]=j,e[26]=y,e[27]=r,e[28]=b):b=e[28],b}async function sl(){}function rl(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Ts(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:rl(t.error)}}function al(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function ol(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=al(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(i=>i.status==="error"&&!i.hasData&&i.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const il=S.lazy(()=>Hr(()=>import("./sections-editor-tLPCjatE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])).then(t=>({default:t.SectionsEditor})));function Cs(t){const e=ne.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=Sn(),{currentBranch:o,taskId:l}=It(),d=tr(),p=Pn(),m=nr(),f=d.lifecycle.phase==="running",x=p.previewUrl;let v;e[0]!==o||e[1]!==a||e[2]!==x||e[3]!==l||e[4]!==n?(v=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:x}:null,e[0]=o,e[1]=a,e[2]=x,e[3]=l,e[4]=n,e[5]=v):v=e[5];const E=v,g=En(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const j=jn(E,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const b=Ks(E,y),w=ol({lifecyclePhase:d.lifecycle.phase,decofile:Ts(j),meta:Ts(b),hasEditableContent:mo(j.data,b.data),fastPreviewActive:Js(n).runtime==="cms"||xn(g)}),T=zs()===void 0,P=ll;if(sa(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(oa,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(ia,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Vr,{})),e[13]=C):C=e[13],C}if(j.data&&Va(b.data)){const C=m.state.target,H=C?.kind==="page"||C?.kind==="section"?C.key:null,A=H??"",J=o??"";let Y;return e[14]!==j.data||e[15]!==H||e[16]!==a.slug||e[17]!==A||e[18]!==J||e[19]!==n?(Y=P(s.jsx(ra,{orgSlug:a.slug,virtualMcpId:n,branch:J,decofile:j.data,initialKey:H,compact:!0},A)),e[14]=j.data,e[15]=H,e[16]=a.slug,e[17]=A,e[18]=J,e[19]=n,e[20]=Y):Y=e[20],Y}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(la,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==j||e[23]!==p||e[24]!==b||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([j.refetch(),b.refetch()])},e[22]=j,e[23]=p,e[24]=b,e[25]=w.source,e[26]=C):C=e[26];const H=C;let A;return e[27]!==H||e[28]!==w.source?(A=P(s.jsx(aa,{source:w.source,onRetry:H})),e[27]=H,e[28]=w.source,e[29]=A):A=e[29],A}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const B=N,R=m.state.target;if(R?.kind==="loader"&&j.data&&b.data){const C=o??"",H=x??null;let A;return e[31]!==j.data||e[32]!==b.data||e[33]!==a.slug||e[34]!==C||e[35]!==H||e[36]!==R.key||e[37]!==n?(A=B(s.jsx(nl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:H,meta:b.data,decofile:j.data,blockKey:R.key})),e[31]=j.data,e[32]=b.data,e[33]=a.slug,e[34]=C,e[35]=H,e[36]=R.key,e[37]=n,e[38]=A):A=e[38],A}let D;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(D=R||!o?null:Is(Us(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=D):D=e[43];const O=D;let F="/",_=null,I=null;R?.kind==="page"?(F=R.path,_=R.key):R?.kind==="section"?I=R.key:O&&(F=O.path,_=O.pageKey);const U=_?`page:${_}`:I?`section:${I}`:`path:${F}`;let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=Z):Z=e[44];const z=o??"",q=x??void 0,te=I?null:u,ee=!!_&&m.state.editSeoPageKey===_;let ce;return e[45]!==I||e[46]!==_||e[47]!==F||e[48]!==U||e[49]!==i||e[50]!==a.slug||e[51]!==te||e[52]!==ee||e[53]!==z||e[54]!==q||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ce=B(s.jsx(S.Suspense,{fallback:Z,children:s.jsx(il,{orgSlug:a.slug,virtualMcpId:n,branch:z,previewReady:!0,previewUrl:q,currentPath:F,activePageBlockKey:_,activeGlobalBlockKey:I,externalSelection:te,initialEditSeo:ee,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},U)})),e[45]=I,e[46]=_,e[47]=F,e[48]=U,e[49]=i,e[50]=a.slug,e[51]=te,e[52]=ee,e[53]=z,e[54]=q,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ce):ce=e[59],ce}function ll(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Rs(t){const e=ne.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=_e(),o=zs(),l=o===!0,d=qa(n);let p;e[0]!==d||e[1]!==r?(p=Wa(d,jo(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=Sn(),{currentBranch:x,taskId:v}=It(),g=Pn().previewUrl;let k;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==v||e[7]!==n?(k=x?{orgSlug:f.slug,virtualMcpId:n,branch:x,threadId:v??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=v,e[7]=n,e[8]=k):k=e[8];const y=jn(k),b=x??"";let w;e[9]!==f.slug||e[10]!==b||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:b},e[9]=f.slug,e[10]=b,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=ca(w),N=y.data?.[r],B=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,D=!x||R||B;let O;e[13]!==N?(O=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=O):O=e[14];const F=O;let _;e[15]!==r||e[16]!==D||e[17]!==T?(_=te=>{if(D)return;let ee;try{ee=JSON.parse(te)}catch{return}ee===null||typeof ee!="object"||Array.isArray(ee)||T(r,ee)},e[15]=r,e[16]=D,e[17]=T,e[18]=_):_=e[18];const I=_;let U;e[19]!==P?(U=()=>({flush:P}),e[19]=P,e[20]=U):U=e[20],S.useImperativeHandle(u,U);let Z;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(Z=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Xe,{variant:"ghost",size:"icon",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"size-7 shrink-0",children:s.jsx(qr,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=Z):Z=e[25];let z;e[26]!==y.data||e[27]!==P||e[28]!==F||e[29]!==B||e[30]!==R||e[31]!==r||e[32]!==D||e[33]!==I||e[34]!==a?(z=B?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Eo,{code:F,language:"json",readOnly:D,height:"100%",onChange:te=>I(te??""),onSave:te=>{I(te),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=F,e[29]=B,e[30]=R,e[31]=r,e[32]=D,e[33]=I,e[34]=a,e[35]=z):z=e[35];let q;return e[36]!==Z||e[37]!==z?(q=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,z]}),e[36]=Z,e[37]=z,e[38]=q):q=e[38],q}function dr(t){return t.contentEditingEnabled&&!t.isMobile}function cl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function dl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ul(t){return dr({contentEditingEnabled:er(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function fl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}const ml=15e3;function pl(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Ls(t){return t.loading?{...t,loading:!1}:t}const hl=500,gl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},_s=1,Ft=["desktop","mobile","tablet"],vl=["preview","visual","blocks"],As={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function bl(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function ft(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function bn(t,e){try{return new URL(t,e).href}catch{return null}}function xl(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function yl(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wl(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function kl(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sl({virtualMcpId:t}){const e=_e(),n=ro(),{currentBranch:r,taskId:i,virtualMcpId:u}=It(),a=!!ga(),o=nr(),l=Oa(u===t?t:null),d=Js(t),p=To(l?.metadata?.ui?.layout??null),m=er(p),f=dr({contentEditingEnabled:m,isMobile:n}),[x]=S.useState(()=>ul({cmsMode:p,isMobile:n})),[v,E]=as(os.previewEditingMode(t),c=>c&&vl.includes(c)?c:null),g=v??x,[k,j]=as(os.previewDeviceSize(t),c=>c&&Ft.includes(c)?c:"desktop"),[y,b]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[B,R]=S.useState(!1),D=S.useRef(null),O=()=>{D.current?.flush(),R(!1)},F=()=>R(c=>(c&&D.current?.flush(),!c)),[_,I]=S.useState({width:0,height:0}),[U,Z]=S.useState(!1),[z,q]=S.useState(""),te=S.useRef(null),[ee,ce]=S.useState(!1),[C,H]=S.useState(),[A,J]=S.useState(null),[Y,Q]=S.useState(null),[he,se]=S.useState(null),[W,oe]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[we,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[re,ue]=S.useState({}),[ke,ae]=S.useState(!1),fe=S.useRef(null),ie=()=>{ae(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>ae(!1),15e3)},Te=()=>{fe.current&&(clearTimeout(fe.current),fe.current=null),ae(!1)},{org:Se}=Sn(),Me=tr(),ge=Pn(),Ze=ge.vmEntry,vt=Me.lifecycle.phase,{url:Be,undecided:Ae}=Ga(t),be=En(t,r),{connection:$e}=Qs(t),Ce=No(t),Re=Ja({hasServeConnection:!!$e,runtime:d.runtime}),Pe=Ae||Re==="github"&&(Ce==="loading"||Ce==="error"),xe=!xn(be)&&!Pe&&!(Re==="github"&&be.kind==="pending"),M=Qe(be)??Be,G=M??ge.previewUrl,Ke=!!M||vt==="running",et=l?.id===t?Fa(l.metadata):null,Ue=!M&&!Ae&&l?.id===t&&d.runtime==="cms",bt=d.projectDefault==="cms",tt=xe?xo({sandboxUrl:G,previewServerUrl:et,fastPreviewActive:Ue}):null,Cn=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:G}:null,Rn=jn(Cn,{fetchEnabled:Ke}),Ln=Ks(Cn,{fetchEnabled:Ke}),X=Rn.data,ve=Ln.data,He=X?po(X,ve).sort((c,h)=>c.name.localeCompare(h.name)):[],_n=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r}:null,An=el(_n),Ut=X&&ve?ho(X,ve):[],On=xe&&X&&ve?da(ve,X,"loaders"):[],Dn=z?(()=>{const c=z.toLowerCase();return He.map(h=>({page:h,score:wl(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,L)=>L.score-h.score||h.page.path.length-L.page.path.length).map(({page:h})=>h)})():He,Bn=Ut.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),Fn=f?On:[],Mn=Fn.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),xt=Y?On.find(c=>c.key===Y)??null:null,Le=Nn,Ht=A||Y?null:go(He,W,we),V=Ht?.key??null,Ve=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??V,yt=Ht?.path??null,qe=(V?re[V]:void 0)??{},ye=Fe(W,qe),Vt={};if(xe&&Ke&&G&&ve&&X){const c=ua(ve,"loaders"),h=V?X[V]:void 0,L=Si(h,X,le=>c.has(le)),$=bi(L);for(const le of ht(W)){if(le.type!=="param")continue;const De=hi(W,le.name,L),je=wi(De,c,$);je.length>0&&(Vt[le.name]=je)}}const wt=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,$n=X&&V?vo(X,V,0):[],Kn=X?fa($n,X):[],qt=Kn.map(c=>c.isSavedBlock?c.label:""),Wt=Kn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),Gt=$n.map(c=>wn(c,X??{})),kt=S.useRef(null),Ee=S.useRef(null),ur=Me.status.state==="paused",Jt=Me.phase,zn=ma({claimPhase:Jt,lifecycle:Me.lifecycle}),ze=ge.previewState,fr=ge.userStopped,mr=Ya(Se.slug,t??""),{url:Oe}=wo(Ue&&t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,previewServerUrl:et??null,path:ye}:null),pr=bt&&d.runtime==="sandbox",Yt=Qa(be,Re,Ce),K=Xo({previewState:ze,progressStatus:zn.status,previewServerUrl:et,fastPreviewActive:Ue,fastPreviewReady:!!Oe,codingSession:pr,localPreviewUrl:M,hostedDraft:Yt,deciding:Pe}),hr=K.showWakingPill||Yt&&K.mode==="production"&&!Oe,nt=K.mode!=="none",gr=K.mode==="production"&&K.iframeBase?ft(K.iframeBase):null,We=K.mode==="production"?gr:ft(G),vr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,st=xe?M?K.mode==="sandbox"&&f&&g==="blocks":K.mode==="production"&&Ue&&vr&&f&&g==="blocks":!1,In=S.useRef(null),{pin:br,effective:xr}=xl(In.current,{inPlaceRenderActive:st,draftPreviewUrl:Oe,resolvedPath:ye});In.current=br;const Un=o.state.variantOverride??[],St=xe?Un:[],Qt=xe?[]:Un,yr=$e&&Qe(be)?ao($e.endpoint,Qt)??ms:null,Ge=bl(K.mode==="sandbox"?At(bs(ps(he??bn(ye,K.iframeBase)??K.iframeBase,yr),k),St):K.mode==="production"?At(bs(ds(ps(he??xr??bn(ye,K.iframeBase)??K.iframeBase,hr?ms:null),Qt),k),St):null),Hn=Oe??(K.iframeBase?bn(ye,K.iframeBase):null),wr=K.mode==="production"?Hn?At(ds(Hn,Qt),St):null:Ge??K.iframeBase,kr=()=>{const c=wr;c&&window.open(c,"_blank","noopener")},rt=t&&r?Us(Se.slug,t,r):null,at=c=>{rt&&ba(rt,c)},me=o.state.target;S.useEffect(()=>{if(!(!me||!tt||!ve))if(me.kind==="page"){const c=re[me.key]??{};Ee.current=Fe(me.path,c),J(null),Q(null),se(null),de(me.key),oe(me.path),at({path:me.path,pageKey:me.key,params:c})}else if(me.kind==="loader")Ee.current=null,J(null),Q(me.key),se(null);else{const c=Ut.find(h=>h.key===me.key);if(c){Ee.current=null;const h=fs(ve);Q(null),J(c),se(hs(tt,h,c.key))}}},[me,tt,ve,re]),S.useEffect(()=>{!V||yt===null||me?.kind==="page"&&me.key===V&&me.path===yt||o.selectTarget({kind:"page",key:V,path:yt})},[V,yt,me]);const[Vn,Sr]=S.useState(null);if(ze.kind==="iframe"&&Vn!==ze.previewUrl){const c=Vn!==null;Sr(ze.previewUrl);const h=rt?Is(rt):null;if(h){if(Ee.current=Fe(h.path,h.params),oe(h.path),de(h.pageKey),se(null),J(null),Q(null),h.pageKey&&Object.keys(h.params).length>0){const L=h.pageKey;ue($=>({...$,[L]:h.params}))}}else c&&(Ee.current=null,oe("/"),se(null),de(null),J(null),Q(null))}kt.current=Ge;const Pr=K.mode==="production"&&!!Oe&&!M,[qn,Xt]=S.useState({src:Ge??void 0,loading:!1}),Pt=pl(qn,Ge??void 0,Pr);Pt!==qn&&Xt(Pt);const ot=Pt.src,Wn=Pt.loading,Gn=ni({iframeRef:P,src:K.mode==="sandbox"?Ge:null,active:K.mode==="sandbox"}),Jn=S.useRef(null);S.useEffect(()=>{const c=Wn?setTimeout(()=>Xt(Ls),ml):null,h=()=>{c&&clearTimeout(c)};if(!Oe||!ot||Jn.current===Oe)return h;Jn.current=Oe;const L=P.current;return L&&L.getAttribute("src")!==ot&&(ie(),L.src=ot),h},[Oe,ot,Wn]);const Yn=()=>{const c=P.current?.contentWindow,h=We;if(!c||!h||!X||!V)return;const L=X[V];if(!L||typeof L!="object")return;const $=yo({previewBaseUrl:h,pageBlock:L,decofile:X,path:ye,pathTemplate:W});if(!$)return;const le=At($.src,oo(St,V));c.postMessage({type:"cms-editor::render",src:le,body:$.body},h)},Zt=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){Zt.current=null;return}const c={nav:JSON.stringify({page:V,path:ye,pathTemplate:W}),content:JSON.stringify(X)},h=yl(Zt.current,c);Zt.current=c,h&&Yn()},[X,st,A,Y,V,ye,W]);const en=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){en.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=en.current;en.current={page:V,sig:c},!(!h||h.page!==V||h.sig===c)&&Yn()},[o.state.variantOverride,st,A,Y,V]);const Er=!!t&&!!r&&!Me.notFound&&!fr&&!ur&&(Jt?.kind==="ready"||vt!=="idle"),pe=fl({editingMode:g,sandboxDisplay:K.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=We;if(!c)return;const h=L=>{if(L.origin===c)if(L.data?.type==="visual-editor::element-clicked"){const $=oi.safeParse(L.data.payload);$.success&&b($.data)}else if(L.data?.type==="cms-editor::section-clicked"){const $=ci.safeParse(L.data.payload);$.success&&T({index:$.data.sectionIndex,seq:$.data.clickSeq})}else L.data?.type==="cms-editor::render-start"?ie():L.data?.type==="cms-editor::render-end"?(Te(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},c)):L.data?.type==="cms-editor::render-error"&&Te()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[We,qt,Wt,Gt]);const Qn=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::activate",script:ii},h)},jr=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},tn=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage(K.mode==="production"||M?{type:"editor::inject",args:{script:Ps}}:{type:"visual-editor::activate",script:Ps},h),c.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},h))},Nr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Tr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},Et=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),E(c),b(null),T(null),c!=="blocks"&&Q(null),h==="visual"&&jr(),c==="visual"&&Qn(),h==="blocks"&&c!=="blocks"&&Nr(),c==="blocks"&&tn()},Cr=()=>{Et(cl(g,f))},Rr=()=>{Et(dl(g,f))},nn=()=>{const c=P.current;if(!c)return;ie();const h=document.activeElement,L=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),kl(c,kt.current);let $;const le=()=>{clearTimeout($),c.tabIndex=L,c.style.pointerEvents="";const De=document.activeElement;(!De||De===document.body||De===c)&&h?.focus(),c.removeEventListener("load",le)};c.addEventListener("load",le),$=setTimeout(le,3e3)};So(nn);const jt=Xa(Se.slug,t??""),Nt=Yt&&nt&&!!t,Xn=S.useRef(null);S.useEffect(()=>{if(Nt)return Za(jt)},[Nt,jt]);const{reload:it}=eo(Se.slug,t??""),Zn=S.useRef(it.seq);S.useEffect(()=>{if(Zn.current!==it.seq&&(Zn.current=it.seq,!!Nt&&Xn.current===kt.current)){if(it.navigates){cs(jt);return}nn()}},[it.seq]);const Lr=to(_n),lt=no(Qe(be)?Lr:""),es=S.useRef(lt);S.useEffect(()=>{const c=es.current;if(es.current=lt,!c||!lt||c===lt)return;const h=P.current;if(h)return ai({iframe:h,reload:nn})},[lt]);const _r=()=>{const c=Ft.indexOf(k);j(Ft[(c+1)%Ft.length])},sn=(c,h)=>{if(!V)return;const L=V,$={...qe,[c]:h};Ee.current=Fe(W,$),ue(le=>({...le,[L]:$})),at({path:W,pageKey:L,params:$})},Ar=Qi({iframeBase:K.iframeBase,resolvedPath:ye,activeGlobalSectionName:A?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),rn=c=>{const h=re[c.key]??{},L=Fe(c.path,h);(A||Le(L)!==Le(ye))&&ie(),Ee.current=L,J(null),Q(null),se(null),T(null),de(c.key),oe(c.path),at({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};va(rt,c=>{(A||Le(c)!==Le(ye))&&ie(),Ee.current=c,J(null),Q(null),se(null),T(null),de(null),oe(c),at({path:c,pageKey:null,params:{}})});const Or=c=>{if(xn(be)){const $=X?bo(X,c.key,ve):null;$?rn($):cn.info(e("sandbox.preview.blockOnNoPage"));return}if(!tt||!ve){cn.error(e("sandbox.preview.previewMetadataNotReady"));return}ie(),Ee.current=null;const h=fs(ve),L=hs(tt,h,c.key);J(c),Q(null),se(L),T(null),o.selectTarget({kind:"section",key:c.key})},Dr=c=>{f&&(J(null),Q(c.key),se(null),Et("blocks"),o.selectTarget({kind:"loader",key:c.key}))},Br=async({name:c,path:h,templateKey:L})=>{if(!t||!r)return;const $=Zs(h);if($){H($);return}const le=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(He.some(je=>Le(je.path)===Le(le))){H(e("sandbox.preview.pageAlreadyExists",{path:le}));return}let De;if(L&&(De=X?.[L],!De)){H(e("sandbox.preview.templateNoLongerExists"));return}H(void 0);try{const je=await An.mutateAsync({name:c,path:le,template:De});ce(!1),cn.success(e("sandbox.preview.pageCreated",{name:c})),await Co(hl),rn({key:je.key,name:je.name,path:je.path}),Et("blocks")}catch(je){H(je instanceof Error?je.message:e("sandbox.preview.failedToCreatePage"))}},Tt=Xi({previewSurfaceActive:nt,daemonReady:Er,production:K.mode==="production",servePreviewUrl:Qe(be)}),Fr=Zi({showPreviewToolbar:Tt,contentEditingEnabled:m}),Ct=()=>{Z(!1),q("")},an=A?.name??xt?.title??Ht?.name,on=Rn.isPending||Ln.isPending,ln=on?ft(K.iframeBase):an,Rt=A?`section:${A.key}`:Y?`loader:${Y}`:V?`page:${V}`:void 0,Mr=Tt?Fr?s.jsxs(La,{open:U,onOpenChange:c=>{Z(c),c||q("")},children:[s.jsx(_a,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:on?ln??void 0:A||xt?an:[an,W].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[A&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(Sa,{size:11}),e("sandbox.preview.globalBadge")]}),xt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:[s.jsx(Pa,{size:11}),e("sandbox.preview.loaderBadge")]}),ln&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ln}),!on&&!A&&!xt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:W}),s.jsx(xa,{size:12,className:Mt("shrink-0 transition-transform",U&&"rotate-180")})]})})}),s.jsxs(Aa,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(qs,{shouldFilter:!1,defaultValue:Rt,children:[s.jsx(Ws,{value:z,onValueChange:c=>{q(c),te.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(Vs,{ref:te,className:"max-h-80",children:[s.jsx(Gs,{children:He.length===0&&Ut.length===0&&Fn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Dn.length>0&&s.jsx(mt,{children:Dn.map(c=>s.jsxs(pt,{value:`page:${c.key}`,"aria-current":Rt===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Ct(),rn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Bn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalComponents"),children:Bn.map(c=>s.jsx(pt,{value:`section:${c.key}`,"aria-current":Rt===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Or(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Mn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalLoaders"),children:Mn.map(c=>s.jsx(pt,{value:`loader:${c.key}`,"aria-current":Rt===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Dr(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!A&&!Y&&ht(W).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:ht(W).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const L=Vt[c.name];return L&&wt?s.jsx(Mi,{sources:L,template:W,paramName:c.name,value:qe[c.name]??"",sandboxRef:wt,onCommit:$=>sn(c.name,$)},`${V}:${c.name}`):s.jsx(Ji,{name:c.name,value:qe[c.name]??"",onCommit:$=>sn(c.name,$)},`${V}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Xe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ct(),H(void 0),ce(!0)},children:[s.jsx(Ra,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Ar}):null,ts=Tt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:_r,"aria-label":e(As[k]),children:k==="mobile"?s.jsx(Ea,{size:16}):k==="tablet"?s.jsx(ja,{size:16}):s.jsx(Na,{size:16})})}),s.jsx(pn,{children:e(As[k])})]}),Mr,s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.jsx(ct,{onClick:kr,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(Wr,{size:16})})})]}):null,$r=(xe||a)&&K.mode==="sandbox",Lt=gl[k],_t=k==="desktop"&&(_.width===0||_.width>=Lt.width+2*_s),ns=_t?1:Math.min(_.width>0?_.width/(Lt.width+2*_s):1,1),Kr=_t?{width:"100%",height:"100%"}:{width:`${Lt.width}px`,height:_.height>0?`${_.height/ns}px`:`${Lt.height}px`,transform:`scale(${ns})`,transformOrigin:"top center"},ss=s.jsxs(s.Fragment,{children:[$r&&(Tt||m)&&s.jsx(ct,{onClick:Cr,"aria-pressed":pe==="visual","aria-label":e("sandbox.preview.visualEditor"),active:pe==="visual",children:s.jsx(ls,{size:16})}),f&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:Rr,"aria-pressed":pe==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:pe==="blocks",children:s.jsx(Ca,{size:16})})}),s.jsx(pn,{children:e("sandbox.preview.blocksEditor")})]}),Ve&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:F,"aria-pressed":B,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:B,children:s.jsx(Ta,{size:16})})}),s.jsx(pn,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),zr=!!Y&&pe==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(Vt).map(([c,h])=>(qe[c]??"")===""?s.jsx(Wi,{sources:h,template:W,paramName:c,sandboxRef:wt,onFill:L=>sn(c,L)},`${V}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(is.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:ts}),children:ts}),s.jsx(is.Toolbar.Right.Portal,{fallback:ss,children:ss})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:zr?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F}),B&&Ve&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]}):s.jsxs(gs,{orientation:"horizontal",disabled:pe!=="blocks",className:"relative isolate",children:[s.jsx(Ot,{ref:N,id:"preview-blocks-editor",defaultSize:pe==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:pe==="blocks"&&s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F})}),pe==="blocks"&&s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-canvas",defaultSize:pe==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(gs,{orientation:"horizontal",disabled:!(B&&Ve),children:[s.jsx(Ot,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>I($=>$.width===c.clientWidth&&$.height===c.clientHeight?$:{width:c.clientWidth,height:c.clientHeight});h();const L=new ResizeObserver(h);return L.observe(c),()=>L.disconnect()},className:Mt("h-full relative overflow-clip flex justify-center",nt&&!_t&&"bg-muted/30"),children:[(ke||mr)&&nt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),K.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),K.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"starting",progress:zn,claimPhase:Jt})}),!M&&!Pe&&ze.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"suspended",onResume:ge.resume})}),!M&&!Pe&&ze.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"errored",error:ze.error,onRetry:ge.retry,connectionsHref:`/${Se.slug}/settings/connections`})}),K.showWakingPill&&s.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl border border-border bg-muted px-4 py-3 shadow-lg pointer-events-none select-none",children:[s.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),pe==="visual"&&!y&&s.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-violet-400/40 bg-violet-500/90 px-3 py-1 text-xs font-medium text-white shadow-md backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(ls,{size:12}),e("sandbox.preview.clickElementToAsk")]}),pe==="visual"&&y&&s.jsx(fi,{element:y,onDismiss:()=>b(null)}),nt&&Ge&&s.jsx("div",{className:Mt("shrink-0",!_t&&"border-x border-border bg-background shadow-sm"),style:Kr,onMouseLeave:Tr,children:s.jsx("iframe",{ref:P,src:ot,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Gn.handleError,onLoad:()=>{if(Xt(Ls),Gn.handleLoad(),Te(),Xn.current=kt.current,Nt&&cs(jt),K.mode!=="sandbox"||M){(K.mode==="production"&&!K.showWakingPill||M)&&pe==="blocks"&&tn();return}if(Gr("vm_preview_loaded",{view_mode:pe,vm_id:Ze?.sandboxHandle??null}),!A)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ee.current;if(h!==null&&(Ee.current=null,Le(c)!==Le(h))||Le(c)===Le(ye))return;oe(c),at({path:c,pageKey:we,params:qe})}catch{}pe==="visual"&&Qn(),pe==="blocks"&&tn()}},K.iframeBase)})]})}),B&&Ve&&s.jsxs(s.Fragment,{children:[s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]})]})})]})}),s.jsx(tl,{open:ee,onOpenChange:ce,isPending:An.isPending,error:C,templates:He,onSubmit:Br})]})}const Pl=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},El=1e4,jl=1e4,Nl=5e3,Tl=2;function Cl(t,e){return t&&e===0?jl:Math.min(1e3*2**Math.max(0,e-1),Nl)}function Rl(t,e,n){return e?!0:t===!0&&n<Tl}function Ll(t,e){const n=ne.c(11),r=Pl,i=Jr();let u;n[0]!==t?(u=Bs.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,x=new AbortController,v=()=>x.abort();f.addEventListener("abort",v);const E=setTimeout(v,El),g=await r(t,x.signal).catch(Al);clearTimeout(E),f.removeEventListener("abort",v);const k=i.getQueryData(a),j=g?0:(k?.failures??0)+1;return{up:Rl(k?.up??null,g,j),failures:j}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:_l},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=Yr(d);return t?p?.up??null:null}function _l(t){return t.state.data?Cl(t.state.data.up,t.state.data.failures):!1}function Al(){return!1}function Ol(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Ec(t){const e=ne.c(48),{virtualMcpId:n}=t,r=_e(),i=Da(n),{connection:u}=Qs(n),{activeTask:a,taskId:o,currentBranch:l}=It(),d=Bo(o),[p,m]=S.useState(!1),f=En(n,l);let x;e[0]!==f||e[1]!==u?(x=u?Qe(f):null,e[0]=f,e[1]=u,e[2]=x):x=e[2];const v=x,E=Ll(v),g=rr();if(_o({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:hn(i?.metadata),threadHasRepo:hn(d)||hn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(xs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let b;e[4]!==r?(b=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=b):b=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(xs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let B;e[12]!==N?(B=s.jsxs(Xe,{onClick:T,children:[P,N]}),e[12]=N,e[13]=B):B=e[13];let R;e[14]!==b||e[15]!==w||e[16]!==B?(R=s.jsx(Ro,{className:"h-full",image:y,title:b,description:w,actions:B}),e[14]=b,e[15]=w,e[16]=B,e[17]=R):R=e[17];let D;e[18]!==p?(D=s.jsx(Lo,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=D):D=e[19];let O;return e[20]!==D||e[21]!==R?(O=s.jsxs(s.Fragment,{children:[R,D]}),e[20]=D,e[21]=R,e[22]=O):O=e[22],O}if(u&&i&&!Qe(f)){let y;e[23]!==g||e[24]!==f?(y=Ol({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let b;e[26]!==u.endpoint?(b=so(u.endpoint),e[26]=u.endpoint,e[27]=b):b=e[27];let w;return e[28]!==y||e[29]!==b?(w=s.jsx(Bl,{status:y,host:b}),e[28]=y,e[29]=b,e[30]=w):w=e[30],w}if(v&&E!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let b;e[33]!==v||e[34]!==r?(b=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Dl(v)}),e[33]=v,e[34]=r,e[35]=b):b=e[35];let w;e[36]!==b?(w=s.jsx(Kt,{text:b}),e[36]=b,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(zt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let j;return e[46]!==n?(j=s.jsx(pa,{children:s.jsx(Sl,{virtualMcpId:n})}),e[46]=n,e[47]=j):j=e[47],j}function Dl(t){try{return new URL(t).host}catch{return t}}function Bl(t){const e=ne.c(20),{status:n,host:r}=t,i=_e();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Kt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${Ys} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(zt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=zo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(Ko,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{Ko as L,Ec as P,zt as S,Pc as u};
551
+ `)}function ui(t,e,n=320,r=44,i=12){const{x:u,y:a}=t,{width:o,height:l}=e,d=Math.max(i,Math.min(u-n/2,o-n-i)),m=a/l>.68?Math.max(i,a-r-18):Math.min(a+18,l-r-i);return{leftPct:d/o*100,topPct:m/l*100}}function fi(t){const e=ne.c(45),{element:n,onDismiss:r}=t,[i,u]=S.useState(""),a=S.useRef(null),{sendMessage:o}=ha(),{openSidePanel:l}=ko(),d=_e();let p;e[0]!==n||e[1]!==i||e[2]!==r||e[3]!==l||e[4]!==o?(p=()=>{if(!i.trim())return;const U=di(n,i);l(),o({parts:[{type:"text",text:U}]}),r()},e[0]=n,e[1]=i,e[2]=r,e[3]=l,e[4]=o,e[5]=p):p=e[5];const m=p;let f;e[6]!==n.position||e[7]!==n.viewport?(f=ui(n.position,n.viewport),e[6]=n.position,e[7]=n.viewport,e[8]=f):f=e[8];const x=f,v=`${x.leftPct}%`,E=`${x.topPct}%`;let g;e[9]!==v||e[10]!==E?(g={left:v,top:E,width:"320px"},e[9]=v,e[10]=E,e[11]=g):g=e[11];let k;e[12]!==m?(k=U=>{U.preventDefault(),m()},e[12]=m,e[13]=k):k=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=U=>u(U.target.value),e[14]=j):j=e[14];let y;e[15]!==r?(y=U=>{U.key==="Escape"&&r()},e[15]=r,e[16]=y):y=e[16];let b;e[17]!==d?(b=d("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=d,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==y||e[21]!==b?(w=s.jsx("input",{ref:a,autoFocus:!0,type:"text",value:i,onChange:j,onKeyDown:y,placeholder:b,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=i,e[20]=y,e[21]=b,e[22]=w):w=e[22];let T;e[23]!==i?(T=i.trim(),e[23]=i,e[24]=T):T=e[24];const P=!T;let N;e[25]!==d?(N=d("sandbox.visualEditorPrompt.sendButton"),e[25]=d,e[26]=N):N=e[26];let B;e[27]!==d?(B=d("sandbox.visualEditorPrompt.sendButton"),e[27]=d,e[28]=B):B=e[28];let R;e[29]!==B?(R=s.jsx("title",{children:B}),e[29]=B,e[30]=R):R=e[30];let D;e[31]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=D):D=e[31];let O;e[32]!==R?(O=s.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[R,D]}),e[32]=R,e[33]=O):O=e[33];let F;e[34]!==P||e[35]!==N||e[36]!==O?(F=s.jsx("button",{type:"submit",disabled:P,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:N,children:O}),e[34]=P,e[35]=N,e[36]=O,e[37]=F):F=e[37];let _;e[38]!==w||e[39]!==F||e[40]!==k?(_=s.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:k,children:[w,F]}),e[38]=w,e[39]=F,e[40]=k,e[41]=_):_=e[41];let I;return e[42]!==_||e[43]!==g?(I=s.jsx("div",{className:"absolute z-30 pointer-events-none",style:g,children:_}),e[42]=_,e[43]=g,e[44]=I):I=e[44],I}const Es="site-links",mi=/details?page|\bpdp\b/i,pi=/listingpage|\bplp\b/i;function hi(t,e,n){const r=new Set;for(const o of n)mi.test(o)&&r.add("product"),pi.test(o)&&r.add("category");const i=ht(Nn(t)),u=i[i.length-1],a=i[i.length-2];return u?.type==="text"&&u.text==="/p"&&a?.type==="param"&&a.name===e&&r.add("product"),e==="*"&&i.some(o=>o.type==="param"&&o.name==="*")&&r.add("category"),r}const gi=["rosa","preto","pink","black"];function Dt(t,e){const n=e.trim();return n?t(n):gi.flatMap(r=>t(r))}function vi(t,e){const n=e.trim(),r=[];/^\d+$/.test(n)&&r.push({resolveType:t,props:{ids:[n]}});const u=n.includes("-")&&!/\s/.test(n)?n.replace(/-+/g," "):n;return r.push({resolveType:t,props:{query:u,count:10}}),r}const ar=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function Tn(t){return t.split("/")[0]??""}function bi(t){const e=new Set;for(const n of t){const r=Tn(n);ar.has(r)&&e.add(r)}return e}function xi(t,e){const n=Tn(t);return!ar.has(n)||e.size===0?!0:e.has(n)}const yi=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>Dt(n=>vi(t,n),e),optionsFromPayload:Bt},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{props:{search:n,pageSize:10,currentPage:1}}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{term:n,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>Dt(n=>[{resolveType:t,props:{query:n,term:n,count:10,hitsPerPage:10}}],e),optionsFromPayload:Bt},{kind:"category",test:t=>t==="vtex/loaders/categories/tree.ts"||/categor(y|ies).*tree/i.test(t),clientFilter:!0,buildRequests:t=>[{resolveType:t,props:{}}],optionsFromPayload:Ni}];function wi(t,e,n=new Set){const r=[...e],i=o=>{const l=[];for(const d of yi){if(d.kind!==o)continue;const p=r.find(m=>d.test(m)&&xi(m,n));p&&l.push({cand:d,resolveType:p})}return l.find(d=>n.has(Tn(d.resolveType)))??l[0]},u=(o,l,d)=>({kind:o.kind,id:`${o.kind}:${l}`,resolveType:l,clientFilter:o.clientFilter,isFallback:d,buildRequests:p=>o.buildRequests(l,p),optionsFromPayload:o.optionsFromPayload}),a=[];for(const o of["product","category"]){if(!t.has(o))continue;const l=i(o);l&&a.push(u(l.cand,l.resolveType,!1))}return t.size>0&&a.push(ki(t.has("category")?"category":"product")),a}function ki(t){return{kind:t,id:Es,resolveType:Es,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,n)=>_i(e,n)}}function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Si(t,e,n){const r=new Set,i=new Set,u=a=>{if(Array.isArray(a)){for(const d of a)u(d);return}const o=Ie(a);if(!o)return;const l=o.__resolveType;if(typeof l=="string"){if(n(l))r.add(l);else if(l in e&&!i.has(l)){i.add(l);const d=Ie(e[l])?.__resolveType;typeof d=="string"&&n(d)&&r.add(l),u(e[l])}}for(const d of Object.values(o))u(d)};return u(t),r}function or(t){const e=new Set,n=[];for(const r of t)for(const i of r)e.has(i.value)||(e.add(i.value),n.push(i));return n}function ir(t){try{return decodeURIComponent(t)}catch{return t}}function Pi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ei(t){const e=[];let n="^";for(const r of t)r.type==="text"?n+=Pi(r.text):(e.push(r.name),n+=r.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${n}$`),order:e}}function lr(t,e,n){if(typeof t!="string"||!t)return null;let r;try{r=new URL(t,"https://placeholder.invalid").pathname}catch{return null}r=r.replace(/\/+$/,"");const i=ht(Nn(e)),{pattern:u,order:a}=Ei(i),o=a.indexOf(n);if(o===-1)return null;const l=r.match(u);if(!l)return null;const d=l[o+1]?.replace(/^\/+|\/+$/g,"");return d?ir(d):null}function Bt(t,e){const n=Ie(t),r=Array.isArray(t)?t:Array.isArray(n?.products)?n.products:Array.isArray(n?.list)?n.list:[],i=[],u=new Set;for(const a of r){const o=Ie(a);if(!o)continue;const l=lr(o.url,e.template,e.paramName);if(!l||u.has(l))continue;u.add(l);const d=Ie(o.isVariantOf),p=typeof d?.name=="string"&&d.name||typeof o.name=="string"&&o.name||l,m=Array.isArray(o.image)?Ie(o.image[0]):null,f=typeof m?.url=="string"?m.url:void 0;i.push({value:l,label:p,image:f})}return i}function ji(t){if(typeof t!="string"||!t)return null;let e;try{e=new URL(t,"https://placeholder.invalid").pathname}catch{return null}const n=e.replace(/^\/+|\/+$/g,"");return n?ir(n):null}function Ni(t){const e=[],n=new Set,r=(i,u)=>{const a=Ie(i);if(!a)return;const o=typeof a.name=="string"&&a.name?a.name:"",l=o?[...u,o]:u,d=ji(a.url);if(d&&!n.has(d)&&(n.add(d),e.push({value:d,label:l.join(" › ")||d})),Array.isArray(a.children))for(const p of a.children)r(p,l)};if(Array.isArray(t))for(const i of t)r(i,[]);return e}const Ti=new Set(["login","logout","signin","sign-in","signup","sign-up","register","account","myaccount","my-account","minha-conta","conta","cart","carrinho","checkout","wishlist","favoritos","favorites","orders","pedidos","help","hc","sac","atendimento","contato","contact","institucional","newsletter","customer","sales","catalogsearch","search","busca","privacy-policy-cookie-restriction-mode"]);function Ci(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,n=>n.toUpperCase())}function Ri(t){if(typeof t!="string"||!t)return[];const e=[],n=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let r,i=0;for(;(r=n.exec(t))!==null&&i++<5e3;){const u=r[1]??"",a=(r[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:u,text:a})}return e}function Li(t){if(typeof t!="string"||!t)return[];const e=[],n=new Set,r=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,i=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let u,a=0;for(;(u=r.exec(t))!==null&&a++<3e3;){const o=(u[1]??"").replace(/\\\//g,"/");if(!o||n.has(o))continue;n.add(o);const l=t.slice(u.index,u.index+900).match(i)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:u[2]??"",image:l||void 0})}return e}function _i(t,e){const n=[],r=new Set,i=(u,a,o,l)=>{if(n.length>=200)return;const d=lr(u,e.template,e.paramName);!d||r.has(d)||e.paramName==="*"&&/(^|\/)p$/.test(d)||o==="category"&&Ti.has(d.split("/")[0]??"")||(r.add(d),n.push({value:d,label:a&&a.length<=80?a:Ci(d),kind:o,image:l}))};for(const{url:u,name:a,image:o}of Li(t))i(u,a,"product",o);for(const{href:u,text:a}of Ri(t))u.startsWith("/")&&!u.startsWith("//")&&i(u,a,"category");return n}function dt(t,e,n=50){const r=e.trim().toLowerCase();return(r?t.filter(u=>u.label.toLowerCase().includes(r)||u.value.toLowerCase().includes(r)):t).slice(0,n)}const cr=1e4;function Ai(t){return{product:{noun:t("sandbox.pathParamPickerChip.kindProductNoun"),heading:t("sandbox.pathParamPickerChip.kindProductHeading")},category:{noun:t("sandbox.pathParamPickerChip.kindCategoryNoun"),heading:t("sandbox.pathParamPickerChip.kindCategoryHeading")}}}async function Oi(t,{resolveType:e,props:n}){const r=await fetch(Ua(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...n}),signal:AbortSignal.timeout(cr)});if(!r.ok)throw new Error(`Failed to fetch options: ${r.status}`);return r.json()}async function js(t,e){const n=await fetch(Ha(t,e),{signal:AbortSignal.timeout(cr)});if(!n.ok)throw new Error(`Failed to fetch page: ${n.status}`);return n.text()}async function Di(t,e,n){const r=e.optionsFromPayload(await js(t,"/"),n),i=r.find(a=>a.kind==="category");if(!i)return r;const u=Fe(n.template,{[n.paramName]:i.value});if(u==="/")return r;try{const a=e.optionsFromPayload(await js(t,u),n).filter(o=>o.kind==="product");return or([r,a])}catch{return r}}function Bi(t,e,n){return Bs.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":n}`)}async function Fi(t,e,n,r){if(e.homepageLinks)return Di(t,e,r);const i=e.buildRequests?.(n)??[];if(i.length===0)return[];const u=await Promise.allSettled(i.map(o=>Oi(t,o))),a=u.filter(o=>o.status==="fulfilled").map(o=>o.value);if(a.length===0){const o=u.find(l=>l.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return or(a.map(o=>e.optionsFromPayload(o,r)))}function kn(t,e,n,r,i){return{queryKey:Bi(t,e,n),queryFn:()=>Fi(t,e,n,r),enabled:i,staleTime:6e4,retry:1}}function ut(t){const e=ne.c(16),{heading:n,iconKind:r,options:i,template:u,paramName:a,keyPrefix:o,onSelect:l}=t;if(i.length===0)return null;let d;if(e[0]!==r||e[1]!==o||e[2]!==l||e[3]!==i||e[4]!==a||e[5]!==u){let m;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a||e[11]!==u?(m=f=>s.jsxs(pt,{value:`${o}:${f.value}`,className:"gap-3 py-2",onSelect:()=>l(f.value),children:[r==="product"&&s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:f.image?s.jsx("img",{src:f.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):s.jsx(Hs,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:f.label}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Fe(u,{[a]:f.value})})]})]},`${o}:${f.value}`),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=u,e[12]=m):m=e[12],d=i.map(m),e[0]=r,e[1]=o,e[2]=l,e[3]=i,e[4]=a,e[5]=u,e[6]=d}else d=e[6];let p;return e[13]!==n||e[14]!==d?(p=s.jsx(mt,{heading:n,children:d}),e[13]=n,e[14]=d,e[15]=p):p=e[15],p}function Ns(t){const e=ne.c(2),{text:n}=t;let r;return e[0]!==n?(r=s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Mi(t){const e=ne.c(52),{sources:n,template:r,paramName:i,value:u,sandboxRef:a,onCommit:o}=t,l=_e(),[d,p]=S.useState(!1),[m,f]=S.useState(""),[x,v]=S.useState(""),E=S.useRef(null),g=i==="*"?l("sandbox.preview.catchAllParamLabel"):`:${i}`,k=Ai(l),y=[...new Set(n.map(M=>k[M.kind].noun))].join(" or ");let b;e[0]!==l||e[1]!==y?(b=l("sandbox.pathParamPickerChip.searchPlaceholder",{options:y}),e[0]=l,e[1]=y,e[2]=b):b=e[2];const w=b,T={template:r,paramName:i};let P;e[3]!==m?(P=(M,G)=>({source:M,query:G,options:M.clientFilter?dt(G.data??[],m):G.data??[]}),e[3]=m,e[4]=P):P=e[4];const N=P,B=n.filter(qi),R=n.filter(Vi),D=yn({queries:B.map(M=>kn(a,M,x,T,d))});let O;e[5]!==D||e[6]!==N?(O=(M,G)=>N(M,D[G]),e[5]=D,e[6]=N,e[7]=O):O=e[7];const F=B.map(O),_=F.length===0||F.every(Hi),I=yn({queries:R.map(M=>kn(a,M,x,T,d&&_))});let U;e[8]!==I||e[9]!==N?(U=(M,G)=>N(M,I[G]),e[8]=I,e[9]=N,e[10]=U):U=e[10];const Z=R.map(U),z=_?Z:F,q=z.length===1&&z[0]?.source.homepageLinks?z[0]:null,ee=q&&!q.query.isLoading&&!q.query.isError?q?.query.data??[]:[],ce=dt(ee.filter(Ui),m),C=dt(ee.filter(Ii),m),H=ce.length>0&&C.length>0,A=M=>{p(M),E.current&&clearTimeout(E.current),f(M?u:""),v(M?u:"")};let J;e[11]===Symbol.for("react.memo_cache_sentinel")?(J=M=>{f(M),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{v(M)},300)},e[11]=J):J=e[11];const Y=J,Q=M=>{o(M),A(!1)},he=Xs(m),se=Fe(r,{[i]:he}),W=Ds,oe=Os,we="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",de=zi;let re;e[12]!==g||e[13]!==l?(re=l("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:g}),e[12]=g,e[13]=l,e[14]=re):re=e[14];let ue;e[15]!==re?(ue=s.jsx(Fs,{className:"sr-only",children:s.jsx(Ms,{children:re})}),e[15]=re,e[16]=ue):ue=e[16];let ke;e[17]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(Hs,{size:16,className:"shrink-0 text-foreground"}),e[17]=ke):ke=e[17];let ae;e[18]!==l?(ae=l("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=l,e[19]=ae):ae=e[19];let fe;e[20]!==g?(fe=s.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-[12px] text-special",children:g}),e[20]=g,e[21]=fe):fe=e[21];let ie;e[22]!==ae||e[23]!==fe?(ie=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[ke,s.jsxs("span",{className:"text-sm font-medium text-foreground",children:[ae," ",fe]})]}),e[22]=ae,e[23]=fe,e[24]=ie):ie=e[24];const Te=qs,Se=!1,Me="min-h-0 flex-1";let ge;e[25]!==w||e[26]!==m?(ge=s.jsx(Ws,{autoFocus:!0,placeholder:w,value:m,onValueChange:Y}),e[25]=w,e[26]=m,e[27]=ge):ge=e[27];const Ze=Vs,vt="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Be;e[28]!==l?(Be=l("sandbox.pathParamPickerChip.noResults"),e[28]=l,e[29]=Be):Be=e[29];let Ae;e[30]!==Be?(Ae=s.jsx(Gs,{children:Be}),e[30]=Be,e[31]=Ae):Ae=e[31];const be=he&&s.jsx(mt,{className:"shrink-0",children:s.jsxs(pt,{value:`__raw__:${he}`,className:"gap-3 py-2",onSelect:()=>Q(he),children:[s.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:s.jsx(Po,{size:14,className:"text-muted-foreground"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm",children:l("sandbox.pathParamPickerChip.useRawValue",{rawTerm:he,paramLabel:g})}),s.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:se})]})]})}),$e=H?s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:ce,template:r,paramName:i,keyPrefix:`${q?.source.id}:cat`,onSelect:Q})}),s.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:C,template:r,paramName:i,keyPrefix:`${q?.source.id}:prod`,onSelect:Q})})]}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:z.map(M=>{const{source:G,query:Ke,options:et}=M,{noun:Ue}=k[G.kind];if(Ke.isLoading)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.loading",{noun:Ue})},G.id);if(Ke.isError)return s.jsx(Ns,{text:l("sandbox.pathParamPickerChip.couldNotLoad")},G.id);if(G.homepageLinks){const bt=Ke.data??[];return s.jsxs(S.Fragment,{children:[s.jsx(ut,{heading:k.category.heading,iconKind:"category",options:dt(bt.filter(Ki),m),template:r,paramName:i,keyPrefix:`${G.id}:cat`,onSelect:Q}),s.jsx(ut,{heading:k.product.heading,iconKind:"product",options:dt(bt.filter($i),m),template:r,paramName:i,keyPrefix:`${G.id}:prod`,onSelect:Q})]},G.id)}return s.jsx(ut,{heading:z.length>1?k[G.kind].heading:void 0,iconKind:G.kind,options:et,template:r,paramName:i,keyPrefix:G.id,onSelect:Q},G.id)})});let Ce;e[32]!==Ze||e[33]!==Ae||e[34]!==be||e[35]!==$e?(Ce=s.jsxs(Ze,{className:vt,children:[Ae,be,$e]}),e[32]=Ze,e[33]=Ae,e[34]=be,e[35]=$e,e[36]=Ce):Ce=e[36];let Re;e[37]!==Te||e[38]!==ge||e[39]!==Ce?(Re=s.jsxs(Te,{shouldFilter:Se,className:Me,children:[ge,Ce]}),e[37]=Te,e[38]=ge,e[39]=Ce,e[40]=Re):Re=e[40];let Pe;e[41]!==oe||e[42]!==ue||e[43]!==ie||e[44]!==Re||e[45]!==de?(Pe=s.jsxs(oe,{className:we,onClick:de,children:[ue,ie,Re]}),e[41]=oe,e[42]=ue,e[43]=ie,e[44]=Re,e[45]=de,e[46]=Pe):Pe=e[46];let xe;return e[47]!==W||e[48]!==A||e[49]!==d||e[50]!==Pe?(xe=s.jsx(W,{open:d,onOpenChange:A,children:Pe}),e[47]=W,e[48]=A,e[49]=d,e[50]=Pe,e[51]=xe):xe=e[51],s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",title:l("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:g}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-[12px] text-special hover:bg-special/25",onClick:M=>{M.stopPropagation(),A(!0)},children:u||g}),xe]})}function $i(t){return t.kind==="product"}function Ki(t){return t.kind!=="product"}function zi(t){return t.stopPropagation()}function Ii(t){return t.kind==="product"}function Ui(t){return t.kind!=="product"}function Hi(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Vi(t){return t.isFallback}function qi(t){return!t.isFallback}function Wi(t){const e=ne.c(8),{sources:n,template:r,paramName:i,sandboxRef:u,onFill:a}=t;let o,l;if(e[0]!==i||e[1]!==u||e[2]!==n||e[3]!==r){const x={template:r,paramName:i},v=n.filter(Gi);l=yn,o=v.map(E=>kn(u,E,"",x,!0)),e[0]=i,e[1]=u,e[2]=n,e[3]=r,e[4]=o,e[5]=l}else o=e[4],l=e[5];let d;e[6]!==o?(d={queries:o},e[6]=o,e[7]=d):d=e[7];const p=l(d),[m,f]=S.useState(!1);if(!m)for(const x of p){if(x.isLoading)break;const v=x.data?.[0];if(v){f(!0),queueMicrotask(()=>a(v.value));break}}return null}function Gi(t){return!t.isFallback}function Ji(t){const e=ne.c(31),{name:n,value:r,onCommit:i}=t,u=_e(),[a,o]=S.useState(r),[l,d]=S.useState(!1),p=S.useRef(!1);let m;e[0]!==n||e[1]!==u?(m=n==="*"?u("sandbox.preview.catchAllParamLabel"):`:${n}`,e[0]=n,e[1]=u,e[2]=m):m=e[2];const f=m,x=a||f;let v;e[3]!==x?(v=s.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-[12px]",children:x}),e[3]=x,e[4]=v):v=e[4];let E;e[5]!==f||e[6]!==u?(E=u("sandbox.preview.valueForParam",{label:f}),e[5]=f,e[6]=u,e[7]=E):E=e[7];let g,k;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=N=>o(N.target.value),k=()=>d(!0),e[8]=g,e[9]=k):(g=e[8],k=e[9]);let j;e[10]!==r?(j=N=>{N.key==="Enter"&&N.currentTarget.blur(),N.key==="Escape"&&(p.current=!0,o(r),N.currentTarget.blur())},e[10]=r,e[11]=j):j=e[11];let y;e[12]!==a||e[13]!==i||e[14]!==r?(y=()=>{if(d(!1),p.current){p.current=!1;return}const N=Xs(a);o(N),N!==r&&i(N)},e[12]=a,e[13]=i,e[14]=r,e[15]=y):y=e[15];let b;e[16]!==a||e[17]!==f||e[18]!==E||e[19]!==j||e[20]!==y?(b=s.jsx("input",{type:"text",value:a,placeholder:f,title:E,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-[12px] text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Yi,onChange:g,onFocus:k,onKeyDown:j,onBlur:y}),e[16]=a,e[17]=f,e[18]=E,e[19]=j,e[20]=y,e[21]=b):b=e[21];let w;e[22]!==v||e[23]!==b?(w=s.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,b]}),e[22]=v,e[23]=b,e[24]=w):w=e[24];let T;e[25]!==l||e[26]!==u?(T=l&&s.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-[10px] text-muted-foreground",children:[s.jsx(ka,{size:10}),u("sandbox.preview.enterToGo")]}),e[25]=l,e[26]=u,e[27]=T):T=e[27];let P;return e[28]!==T||e[29]!==w?(P=s.jsxs(s.Fragment,{children:[w,T]}),e[28]=T,e[29]=w,e[30]=P):P=e[30],P}function Yi(t){return t.stopPropagation()}function Qi(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const n=new URL(e),r=t.resolvedPath==="/"?"":t.resolvedPath;return`${n.host}${r}`}catch{return e}}function Xi(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Zi(t){return t.showPreviewToolbar&&t.contentEditingEnabled}function el(t){const e=ne.c(5);let n;e[0]!==t?(n=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=n):n=e[1];const r=$s(n);let i;return e[2]!==t||e[3]!==r?(i={mutationFn:async u=>{const{name:a,path:o,template:l}=u;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const d=Qr(a),p=l?{...l,name:a,path:o}:Xr(a,o);return await r.mutateAsync({blockKey:d,data:p}),{key:d,name:a,path:o}}},e[2]=t,e[3]=r,e[4]=i):i=e[4],Ir(i)}function tl(t){const e=ne.c(89),{open:n,onOpenChange:r,isPending:i,error:u,templates:a,onSubmit:o}=t,l=i===void 0?!1:i,d=_e();let p;e[0]!==d?(p=d("sectionsEditor.createPageModal.defaultPageName"),e[0]=d,e[1]=p):p=e[1];const[m,f]=S.useState(p);let x;e[2]!==d?(x=d("sectionsEditor.createPageModal.defaultPagePath"),e[2]=d,e[3]=x):x=e[3];const[v,E]=S.useState(x),[g,k]=S.useState(dn),[j,y]=S.useState(null),[b,w]=S.useState(n);n!==b&&(w(n),n&&(f(d("sectionsEditor.createPageModal.defaultPageName")),E(d("sectionsEditor.createPageModal.defaultPagePath")),k(dn),y(null)));const T=!!a?.length;let P;e[4]!==l||e[5]!==r?(P=ae=>{!ae&&!l&&(y(null),r(!1))},e[4]=l,e[5]=r,e[6]=P):P=e[6];const N=P;let B;e[7]!==l||e[8]!==m||e[9]!==o||e[10]!==v||e[11]!==T||e[12]!==g?(B=async ae=>{ae.preventDefault();const fe=m.trim(),ie=v.trim();if(!fe||!ie||l)return;const Te=Zs(ie);if(Te){y(Te);return}y(null),await o({name:fe,path:ie,templateKey:T&&g!==dn?g:null})},e[7]=l,e[8]=m,e[9]=o,e[10]=v,e[11]=T,e[12]=g,e[13]=B):B=e[13];const R=B,D=j??u;let O;e[14]!==d?(O=d("sectionsEditor.createPageModal.title"),e[14]=d,e[15]=O):O=e[15];let F;e[16]!==O?(F=s.jsx(Fs,{children:s.jsx(Ms,{children:O})}),e[16]=O,e[17]=F):F=e[17];let _;e[18]!==d?(_=d("sectionsEditor.createPageModal.nameLabel"),e[18]=d,e[19]=_):_=e[19];let I;e[20]!==_?(I=s.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=I):I=e[21];let U;e[22]===Symbol.for("react.memo_cache_sentinel")?(U=ae=>f(ae.target.value),e[22]=U):U=e[22];let Z;e[23]!==d?(Z=d("sectionsEditor.createPageModal.namePlaceholder"),e[23]=d,e[24]=Z):Z=e[24];let z;e[25]!==l||e[26]!==m||e[27]!==Z?(z=s.jsx(rs,{id:"new-page-name",value:m,onChange:U,placeholder:Z,autoFocus:!0,disabled:l}),e[25]=l,e[26]=m,e[27]=Z,e[28]=z):z=e[28];let q;e[29]!==z||e[30]!==I?(q=s.jsxs("div",{className:"space-y-1.5",children:[I,z]}),e[29]=z,e[30]=I,e[31]=q):q=e[31];let te;e[32]!==d?(te=d("sectionsEditor.createPageModal.pathLabel"),e[32]=d,e[33]=te):te=e[33];let ee;e[34]!==te?(ee=s.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:te}),e[34]=te,e[35]=ee):ee=e[35];let ce;e[36]===Symbol.for("react.memo_cache_sentinel")?(ce=ae=>E(ae.target.value),e[36]=ce):ce=e[36];let C;e[37]!==d?(C=d("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=d,e[38]=C):C=e[38];let H;e[39]!==l||e[40]!==v||e[41]!==C?(H=s.jsx(rs,{id:"new-page-path",value:v,onChange:ce,placeholder:C,disabled:l}),e[39]=l,e[40]=v,e[41]=C,e[42]=H):H=e[42];let A;e[43]!==ee||e[44]!==H?(A=s.jsxs("div",{className:"space-y-1.5",children:[ee,H]}),e[43]=ee,e[44]=H,e[45]=A):A=e[45];let J;e[46]!==l||e[47]!==T||e[48]!==d||e[49]!==g||e[50]!==a?(J=T&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:d("sectionsEditor.createPageModal.templateLabel")}),s.jsx(Zr,{id:"new-page-template",value:g,onChange:k,templates:a??[],disabled:l})]}),e[46]=l,e[47]=T,e[48]=d,e[49]=g,e[50]=a,e[51]=J):J=e[51];let Y;e[52]!==D?(Y=D&&s.jsx("p",{className:"text-xs text-destructive",children:D}),e[52]=D,e[53]=Y):Y=e[53];let Q;e[54]!==q||e[55]!==A||e[56]!==J||e[57]!==Y?(Q=s.jsxs("div",{className:"space-y-4 py-4",children:[q,A,J,Y]}),e[54]=q,e[55]=A,e[56]=J,e[57]=Y,e[58]=Q):Q=e[58];let he;e[59]!==r?(he=()=>r(!1),e[59]=r,e[60]=he):he=e[60];let se;e[61]!==d?(se=d("sectionsEditor.createPageModal.cancelButton"),e[61]=d,e[62]=se):se=e[62];let W;e[63]!==l||e[64]!==he||e[65]!==se?(W=s.jsx(Xe,{type:"button",variant:"outline",onClick:he,disabled:l,children:se}),e[63]=l,e[64]=he,e[65]=se,e[66]=W):W=e[66];let oe;e[67]!==l||e[68]!==m||e[69]!==v?(oe=!m.trim()||!v.trim()||l,e[67]=l,e[68]=m,e[69]=v,e[70]=oe):oe=e[70];let we;e[71]!==l||e[72]!==d?(we=l?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"size-3.5"}),d("sectionsEditor.createPageModal.creatingButton")]}):d("sectionsEditor.createPageModal.createButton"),e[71]=l,e[72]=d,e[73]=we):we=e[73];let de;e[74]!==oe||e[75]!==we?(de=s.jsx(Xe,{type:"submit",disabled:oe,children:we}),e[74]=oe,e[75]=we,e[76]=de):de=e[76];let re;e[77]!==W||e[78]!==de?(re=s.jsxs(Ur,{children:[W,de]}),e[77]=W,e[78]=de,e[79]=re):re=e[79];let ue;e[80]!==R||e[81]!==Q||e[82]!==re||e[83]!==F?(ue=s.jsx(Os,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:R,children:[F,Q,re]})}),e[80]=R,e[81]=Q,e[82]=re,e[83]=F,e[84]=ue):ue=e[84];let ke;return e[85]!==N||e[86]!==n||e[87]!==ue?(ke=s.jsx(Ds,{open:n,onOpenChange:N,children:ue}),e[85]=N,e[86]=n,e[87]=ue,e[88]=ke):ke=e[88],ke}function nl(t){const e=ne.c(29),{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,blockKey:l}=t,d=_e();let p;e[0]!==i||e[1]!==n||e[2]!==r?(p={orgSlug:n,virtualMcpId:r,branch:i},e[0]=i,e[1]=n,e[2]=r,e[3]=p):p=e[3];const m=$s(p);let f;e[4]!==m?(f=na((w,T)=>m.mutate({blockKey:w,data:T})),e[4]=m,e[5]=f):f=e[5];const x=f;let v;e[6]!==l||e[7]!==o?(v=ea(o,l),e[6]=l,e[7]=o,e[8]=v):v=e[8];const{resolveType:E,props:g,title:k}=v;if(!E){let w;e[9]!==d?(w=d("sandbox.preview.loaderNoLongerExists"),e[9]=d,e[10]=w):w=e[10];let T;return e[11]!==w?(T=s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:w}),e[11]=w,e[12]=T):T=e[12],T}const j=`loader:${l}`;let y;e[13]!==l||e[14]!==E||e[15]!==k?(y={mode:"saved",blockKey:l,resolveType:E,title:k},e[13]=l,e[14]=E,e[15]=k,e[16]=y):y=e[16];let b;return e[17]!==i||e[18]!==o||e[19]!==a||e[20]!==n||e[21]!==u||e[22]!==g||e[23]!==m.isPending||e[24]!==x||e[25]!==j||e[26]!==y||e[27]!==r?(b=s.jsx(ta,{orgSlug:n,virtualMcpId:r,branch:i,previewUrl:u,meta:a,decofile:o,kind:"loaders",target:y,initialValue:g,isCreating:m.isPending,onCreate:sl,onSaveReferencedBlock:x,showRun:!1},j),e[17]=i,e[18]=o,e[19]=a,e[20]=n,e[21]=u,e[22]=g,e[23]=m.isPending,e[24]=x,e[25]=j,e[26]=y,e[27]=r,e[28]=b):b=e[28],b}async function sl(){}function rl(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Ts(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:rl(t.error)}}function al(t){switch(t){case"clone-failed":case"install-failed":case"start-failed":return"terminal-error";case"idle":case"cloning":return"booting";case"checking-out":case"installing":case"starting":case"running":case"crashed":return"snapshot-readable"}}function ol(t){if(t.fastPreviewActive)return t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData?{kind:"error",source:"data"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"};const e=al(t.lifecyclePhase);if(e==="terminal-error")return{kind:"error",source:"sandbox"};if(e==="booting")return{kind:"loading"};const n=t.decofile.status==="error"&&!t.decofile.hasData||t.meta.status==="error"&&!t.meta.hasData;return n&&t.lifecyclePhase==="checking-out"?{kind:"loading"}:[t.decofile,t.meta].some(i=>i.status==="error"&&!i.hasData&&i.errorStatus===404)?{kind:"empty",reason:"framework-missing"}:n?t.lifecyclePhase==="running"||t.lifecyclePhase==="crashed"?{kind:"error",source:"data"}:{kind:"loading"}:!t.decofile.hasData||!t.meta.hasData?{kind:"loading"}:t.hasEditableContent?{kind:"content"}:{kind:"empty",reason:"no-content"}}const il=S.lazy(()=>Hr(()=>import("./sections-editor-DneoLEuW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166])).then(t=>({default:t.SectionsEditor})));function Cs(t){const e=ne.c(60),{virtualMcpId:n,externalSelection:r,onViewJsonFile:i}=t,u=r===void 0?null:r,{org:a}=Sn(),{currentBranch:o,taskId:l}=It(),d=tr(),p=Pn(),m=nr(),f=d.lifecycle.phase==="running",x=p.previewUrl;let v;e[0]!==o||e[1]!==a||e[2]!==x||e[3]!==l||e[4]!==n?(v=o?{orgSlug:a.slug,virtualMcpId:n,branch:o,threadId:l??null,previewUrl:x}:null,e[0]=o,e[1]=a,e[2]=x,e[3]=l,e[4]=n,e[5]=v):v=e[5];const E=v,g=En(n,o);let k;e[6]!==f?(k={fetchEnabled:f},e[6]=f,e[7]=k):k=e[7];const j=jn(E,k);let y;e[8]!==f?(y={fetchEnabled:f},e[8]=f,e[9]=y):y=e[9];const b=Ks(E,y),w=ol({lifecyclePhase:d.lifecycle.phase,decofile:Ts(j),meta:Ts(b),hasEditableContent:mo(j.data,b.data),fastPreviewActive:Js(n).runtime==="cms"||xn(g)}),T=zs()===void 0,P=ll;if(sa(g)){let C;return e[10]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(oa,{})),e[10]=C):C=e[10],C}if(g.kind==="pending"&&g.retrying){let C;return e[11]!==g?(C=P(s.jsx(ia,{backend:g})),e[11]=g,e[12]=C):C=e[12],C}if(w.kind==="loading"||T){let C;return e[13]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(Vr,{})),e[13]=C):C=e[13],C}if(j.data&&Va(b.data)){const C=m.state.target,H=C?.kind==="page"||C?.kind==="section"?C.key:null,A=H??"",J=o??"";let Y;return e[14]!==j.data||e[15]!==H||e[16]!==a.slug||e[17]!==A||e[18]!==J||e[19]!==n?(Y=P(s.jsx(ra,{orgSlug:a.slug,virtualMcpId:n,branch:J,decofile:j.data,initialKey:H,compact:!0},A)),e[14]=j.data,e[15]=H,e[16]=a.slug,e[17]=A,e[18]=J,e[19]=n,e[20]=Y):Y=e[20],Y}if(w.kind==="empty"){let C;return e[21]===Symbol.for("react.memo_cache_sentinel")?(C=P(s.jsx(la,{})),e[21]=C):C=e[21],C}if(w.kind==="error"){let C;e[22]!==j||e[23]!==p||e[24]!==b||e[25]!==w.source?(C=()=>{if(w.source==="sandbox"){p.retry();return}Promise.all([j.refetch(),b.refetch()])},e[22]=j,e[23]=p,e[24]=b,e[25]=w.source,e[26]=C):C=e[26];const H=C;let A;return e[27]!==H||e[28]!==w.source?(A=P(s.jsx(aa,{source:w.source,onRetry:H})),e[27]=H,e[28]=w.source,e[29]=A):A=e[29],A}let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=C=>P(s.jsx("div",{className:"h-full min-h-0",children:C})),e[30]=N):N=e[30];const B=N,R=m.state.target;if(R?.kind==="loader"&&j.data&&b.data){const C=o??"",H=x??null;let A;return e[31]!==j.data||e[32]!==b.data||e[33]!==a.slug||e[34]!==C||e[35]!==H||e[36]!==R.key||e[37]!==n?(A=B(s.jsx(nl,{orgSlug:a.slug,virtualMcpId:n,branch:C,previewUrl:H,meta:b.data,decofile:j.data,blockKey:R.key})),e[31]=j.data,e[32]=b.data,e[33]=a.slug,e[34]=C,e[35]=H,e[36]=R.key,e[37]=n,e[38]=A):A=e[38],A}let D;e[39]!==o||e[40]!==a.slug||e[41]!==R||e[42]!==n?(D=R||!o?null:Is(Us(a.slug,n,o)),e[39]=o,e[40]=a.slug,e[41]=R,e[42]=n,e[43]=D):D=e[43];const O=D;let F="/",_=null,I=null;R?.kind==="page"?(F=R.path,_=R.key):R?.kind==="section"?I=R.key:O&&(F=O.path,_=O.pageKey);const U=_?`page:${_}`:I?`section:${I}`:`path:${F}`;let Z;e[44]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),e[44]=Z):Z=e[44];const z=o??"",q=x??void 0,te=I?null:u,ee=!!_&&m.state.editSeoPageKey===_;let ce;return e[45]!==I||e[46]!==_||e[47]!==F||e[48]!==U||e[49]!==i||e[50]!==a.slug||e[51]!==te||e[52]!==ee||e[53]!==z||e[54]!==q||e[55]!==n||e[56]!==m.consumeEditSeo||e[57]!==m.setFocusedBlock||e[58]!==m.setVariantOverride?(ce=B(s.jsx(S.Suspense,{fallback:Z,children:s.jsx(il,{orgSlug:a.slug,virtualMcpId:n,branch:z,previewReady:!0,previewUrl:q,currentPath:F,activePageBlockKey:_,activeGlobalBlockKey:I,externalSelection:te,initialEditSeo:ee,onExitSeo:m.consumeEditSeo,onVariantPreviewOverride:m.setVariantOverride,onFocusedBlockChange:m.setFocusedBlock,onViewJsonFile:i},U)})),e[45]=I,e[46]=_,e[47]=F,e[48]=U,e[49]=i,e[50]=a.slug,e[51]=te,e[52]=ee,e[53]=z,e[54]=q,e[55]=n,e[56]=m.consumeEditSeo,e[57]=m.setFocusedBlock,e[58]=m.setVariantOverride,e[59]=ce):ce=e[59],ce}function ll(t){return s.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function Rs(t){const e=ne.c(39),{virtualMcpId:n,pageKey:r,onClose:i,ref:u}=t,a=_e(),o=zs(),l=o===!0,d=qa(n);let p;e[0]!==d||e[1]!==r?(p=Wa(d,jo(r)),e[0]=d,e[1]=r,e[2]=p):p=e[2];const m=p,{org:f}=Sn(),{currentBranch:x,taskId:v}=It(),g=Pn().previewUrl;let k;e[3]!==x||e[4]!==f.slug||e[5]!==g||e[6]!==v||e[7]!==n?(k=x?{orgSlug:f.slug,virtualMcpId:n,branch:x,threadId:v??null,previewUrl:g}:null,e[3]=x,e[4]=f.slug,e[5]=g,e[6]=v,e[7]=n,e[8]=k):k=e[8];const y=jn(k),b=x??"";let w;e[9]!==f.slug||e[10]!==b||e[11]!==n?(w={orgSlug:f.slug,virtualMcpId:n,branch:b},e[9]=f.slug,e[10]=b,e[11]=n,e[12]=w):w=e[12];const{save:T,flush:P}=ca(w),N=y.data?.[r],B=y.data===void 0&&y.isLoading||o===void 0,R=y.data!==void 0&&N===void 0,D=!x||R||B;let O;e[13]!==N?(O=N===void 0?"":JSON.stringify(N,null,2),e[13]=N,e[14]=O):O=e[14];const F=O;let _;e[15]!==r||e[16]!==D||e[17]!==T?(_=te=>{if(D)return;let ee;try{ee=JSON.parse(te)}catch{return}ee===null||typeof ee!="object"||Array.isArray(ee)||T(r,ee)},e[15]=r,e[16]=D,e[17]=T,e[18]=_):_=e[18];const I=_;let U;e[19]!==P?(U=()=>({flush:P}),e[19]=P,e[20]=U):U=e[20],S.useImperativeHandle(u,U);let Z;e[21]!==m||e[22]!==l||e[23]!==i||e[24]!==a?(Z=l?s.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:s.jsx("span",{title:m,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:m})}):s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:a("sectionsEditor.pageJsonDialog.titleShort")}),s.jsx(Xe,{variant:"ghost",size:"icon",onClick:i,"aria-label":a("sectionsEditor.pageJsonDialog.close"),className:"size-7 shrink-0",children:s.jsx(qr,{size:14})})]}),e[21]=m,e[22]=l,e[23]=i,e[24]=a,e[25]=Z):Z=e[25];let z;e[26]!==y.data||e[27]!==P||e[28]!==F||e[29]!==B||e[30]!==R||e[31]!==r||e[32]!==D||e[33]!==I||e[34]!==a?(z=B?s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}):R?s.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",a("sectionsEditor.pageJsonDialog.pageNotFound")]}):s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Eo,{code:F,language:"json",readOnly:D,height:"100%",onChange:te=>I(te??""),onSave:te=>{I(te),P()}},`${r}:${y.data===void 0?"loading":"ready"}`)}),e[26]=y.data,e[27]=P,e[28]=F,e[29]=B,e[30]=R,e[31]=r,e[32]=D,e[33]=I,e[34]=a,e[35]=z):z=e[35];let q;return e[36]!==Z||e[37]!==z?(q=s.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,z]}),e[36]=Z,e[37]=z,e[38]=q):q=e[38],q}function dr(t){return t.contentEditingEnabled&&!t.isMobile}function cl(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function dl(t,e){return t==="blocks"?"preview":e?"blocks":t}function ul(t){return dr({contentEditingEnabled:er(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function fl(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}const ml=15e3;function pl(t,e,n){return n?t.src===e||t.loading?t:{src:e,loading:!0}:t.src===e&&!t.loading?t:{src:e,loading:!1}}function Ls(t){return t.loading?{...t,loading:!1}:t}const hl=500,gl={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},_s=1,Ft=["desktop","mobile","tablet"],vl=["preview","visual","blocks"],As={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function bl(t){if(!t)return null;try{const e=new URL(t,window.location.href);return e.searchParams.set("__decoFBT","0"),e.searchParams.set("__deco_ssr","1"),e.href}catch{return t}}function ft(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function bn(t,e){try{return new URL(t,e).href}catch{return null}}function xl(t,e){if(!e.inPlaceRenderActive)return{pin:e.draftPreviewUrl?{path:e.resolvedPath,url:e.draftPreviewUrl}:null,effective:e.draftPreviewUrl};if(e.draftPreviewUrl!==null&&t?.path!==e.resolvedPath){const n={path:e.resolvedPath,url:e.draftPreviewUrl};return{pin:n,effective:n.url}}return{pin:t,effective:t?.url??null}}function yl(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function wl(t,e,n){const r=t.toLowerCase(),i=e.toLowerCase(),u=i.split("/").filter(Boolean),a=l=>{if(l===n)return 100;const d=l.indexOf(n);if(d===-1)return 0;let p=40;return d===0?p+=30:/[\s/-]/.test(l[d-1]??"")&&(p+=20),p+=Math.round(n.length/l.length*20),p};let o=Math.max(a(r),a(i));return u.at(-1)===n?o=Math.max(o,95):u.includes(n)&&(o=Math.max(o,90)),o}function kl(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Sl({virtualMcpId:t}){const e=_e(),n=ro(),{currentBranch:r,taskId:i,virtualMcpId:u}=It(),a=!!ga(),o=nr(),l=Oa(u===t?t:null),d=Js(t),p=To(l?.metadata?.ui?.layout??null),m=er(p),f=dr({contentEditingEnabled:m,isMobile:n}),[x]=S.useState(()=>ul({cmsMode:p,isMobile:n})),[v,E]=as(os.previewEditingMode(t),c=>c&&vl.includes(c)?c:null),g=v??x,[k,j]=as(os.previewDeviceSize(t),c=>c&&Ft.includes(c)?c:"desktop"),[y,b]=S.useState(null),[w,T]=S.useState(null),P=S.useRef(null),N=S.useRef(null),[B,R]=S.useState(!1),D=S.useRef(null),O=()=>{D.current?.flush(),R(!1)},F=()=>R(c=>(c&&D.current?.flush(),!c)),[_,I]=S.useState({width:0,height:0}),[U,Z]=S.useState(!1),[z,q]=S.useState(""),te=S.useRef(null),[ee,ce]=S.useState(!1),[C,H]=S.useState(),[A,J]=S.useState(null),[Y,Q]=S.useState(null),[he,se]=S.useState(null),[W,oe]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[we,de]=S.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[re,ue]=S.useState({}),[ke,ae]=S.useState(!1),fe=S.useRef(null),ie=()=>{ae(!0),fe.current&&clearTimeout(fe.current),fe.current=setTimeout(()=>ae(!1),15e3)},Te=()=>{fe.current&&(clearTimeout(fe.current),fe.current=null),ae(!1)},{org:Se}=Sn(),Me=tr(),ge=Pn(),Ze=ge.vmEntry,vt=Me.lifecycle.phase,{url:Be,undecided:Ae}=Ga(t),be=En(t,r),{connection:$e}=Qs(t),Ce=No(t),Re=Ja({hasServeConnection:!!$e,runtime:d.runtime}),Pe=Ae||Re==="github"&&(Ce==="loading"||Ce==="error"),xe=!xn(be)&&!Pe&&!(Re==="github"&&be.kind==="pending"),M=Qe(be)??Be,G=M??ge.previewUrl,Ke=!!M||vt==="running",et=l?.id===t?Fa(l.metadata):null,Ue=!M&&!Ae&&l?.id===t&&d.runtime==="cms",bt=d.projectDefault==="cms",tt=xe?xo({sandboxUrl:G,previewServerUrl:et,fastPreviewActive:Ue}):null,Cn=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null,previewUrl:G}:null,Rn=jn(Cn,{fetchEnabled:Ke}),Ln=Ks(Cn,{fetchEnabled:Ke}),X=Rn.data,ve=Ln.data,He=X?po(X,ve).sort((c,h)=>c.name.localeCompare(h.name)):[],_n=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r}:null,An=el(_n),Ut=X&&ve?ho(X,ve):[],On=xe&&X&&ve?da(ve,X,"loaders"):[],Dn=z?(()=>{const c=z.toLowerCase();return He.map(h=>({page:h,score:wl(h.name,h.path,c)})).filter(({score:h})=>h>0).sort((h,L)=>L.score-h.score||h.page.path.length-L.page.path.length).map(({page:h})=>h)})():He,Bn=Ut.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.name.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),Fn=f?On:[],Mn=Fn.filter(c=>{if(!z)return!0;const h=z.toLowerCase();return c.title.toLowerCase().includes(h)||c.key.toLowerCase().includes(h)||c.resolveType.toLowerCase().includes(h)}),xt=Y?On.find(c=>c.key===Y)??null:null,Le=Nn,Ht=A||Y?null:go(He,W,we),V=Ht?.key??null,Ve=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??V,yt=Ht?.path??null,qe=(V?re[V]:void 0)??{},ye=Fe(W,qe),Vt={};if(xe&&Ke&&G&&ve&&X){const c=ua(ve,"loaders"),h=V?X[V]:void 0,L=Si(h,X,le=>c.has(le)),$=bi(L);for(const le of ht(W)){if(le.type!=="param")continue;const De=hi(W,le.name,L),je=wi(De,c,$);je.length>0&&(Vt[le.name]=je)}}const wt=t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,threadId:i??null}:null,$n=X&&V?vo(X,V,0):[],Kn=X?fa($n,X):[],qt=Kn.map(c=>c.isSavedBlock?c.label:""),Wt=Kn.map(c=>c.isSavedBlock?"global":c.isMultivariate?"variant":"normal"),Gt=$n.map(c=>wn(c,X??{})),kt=S.useRef(null),Ee=S.useRef(null),ur=Me.status.state==="paused",Jt=Me.phase,zn=ma({claimPhase:Jt,lifecycle:Me.lifecycle}),ze=ge.previewState,fr=ge.userStopped,mr=Ya(Se.slug,t??""),{url:Oe}=wo(Ue&&t&&r?{orgSlug:Se.slug,virtualMcpId:t,branch:r,previewServerUrl:et??null,path:ye}:null),pr=bt&&d.runtime==="sandbox",Yt=Qa(be,Re,Ce),K=Xo({previewState:ze,progressStatus:zn.status,previewServerUrl:et,fastPreviewActive:Ue,fastPreviewReady:!!Oe,codingSession:pr,localPreviewUrl:M,hostedDraft:Yt,deciding:Pe}),hr=K.showWakingPill||Yt&&K.mode==="production"&&!Oe,nt=K.mode!=="none",gr=K.mode==="production"&&K.iframeBase?ft(K.iframeBase):null,We=K.mode==="production"?gr:ft(G),vr=l?.id===t&&l.metadata?.fastPreviewInPlace===!0,st=xe?M?K.mode==="sandbox"&&f&&g==="blocks":K.mode==="production"&&Ue&&vr&&f&&g==="blocks":!1,In=S.useRef(null),{pin:br,effective:xr}=xl(In.current,{inPlaceRenderActive:st,draftPreviewUrl:Oe,resolvedPath:ye});In.current=br;const Un=o.state.variantOverride??[],St=xe?Un:[],Qt=xe?[]:Un,yr=$e&&Qe(be)?ao($e.endpoint,Qt)??ms:null,Ge=bl(K.mode==="sandbox"?At(bs(ps(he??bn(ye,K.iframeBase)??K.iframeBase,yr),k),St):K.mode==="production"?At(bs(ds(ps(he??xr??bn(ye,K.iframeBase)??K.iframeBase,hr?ms:null),Qt),k),St):null),Hn=Oe??(K.iframeBase?bn(ye,K.iframeBase):null),wr=K.mode==="production"?Hn?At(ds(Hn,Qt),St):null:Ge??K.iframeBase,kr=()=>{const c=wr;c&&window.open(c,"_blank","noopener")},rt=t&&r?Us(Se.slug,t,r):null,at=c=>{rt&&ba(rt,c)},me=o.state.target;S.useEffect(()=>{if(!(!me||!tt||!ve))if(me.kind==="page"){const c=re[me.key]??{};Ee.current=Fe(me.path,c),J(null),Q(null),se(null),de(me.key),oe(me.path),at({path:me.path,pageKey:me.key,params:c})}else if(me.kind==="loader")Ee.current=null,J(null),Q(me.key),se(null);else{const c=Ut.find(h=>h.key===me.key);if(c){Ee.current=null;const h=fs(ve);Q(null),J(c),se(hs(tt,h,c.key))}}},[me,tt,ve,re]),S.useEffect(()=>{!V||yt===null||me?.kind==="page"&&me.key===V&&me.path===yt||o.selectTarget({kind:"page",key:V,path:yt})},[V,yt,me]);const[Vn,Sr]=S.useState(null);if(ze.kind==="iframe"&&Vn!==ze.previewUrl){const c=Vn!==null;Sr(ze.previewUrl);const h=rt?Is(rt):null;if(h){if(Ee.current=Fe(h.path,h.params),oe(h.path),de(h.pageKey),se(null),J(null),Q(null),h.pageKey&&Object.keys(h.params).length>0){const L=h.pageKey;ue($=>({...$,[L]:h.params}))}}else c&&(Ee.current=null,oe("/"),se(null),de(null),J(null),Q(null))}kt.current=Ge;const Pr=K.mode==="production"&&!!Oe&&!M,[qn,Xt]=S.useState({src:Ge??void 0,loading:!1}),Pt=pl(qn,Ge??void 0,Pr);Pt!==qn&&Xt(Pt);const ot=Pt.src,Wn=Pt.loading,Gn=ni({iframeRef:P,src:K.mode==="sandbox"?Ge:null,active:K.mode==="sandbox"}),Jn=S.useRef(null);S.useEffect(()=>{const c=Wn?setTimeout(()=>Xt(Ls),ml):null,h=()=>{c&&clearTimeout(c)};if(!Oe||!ot||Jn.current===Oe)return h;Jn.current=Oe;const L=P.current;return L&&L.getAttribute("src")!==ot&&(ie(),L.src=ot),h},[Oe,ot,Wn]);const Yn=()=>{const c=P.current?.contentWindow,h=We;if(!c||!h||!X||!V)return;const L=X[V];if(!L||typeof L!="object")return;const $=yo({previewBaseUrl:h,pageBlock:L,decofile:X,path:ye,pathTemplate:W});if(!$)return;const le=At($.src,oo(St,V));c.postMessage({type:"cms-editor::render",src:le,body:$.body},h)},Zt=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){Zt.current=null;return}const c={nav:JSON.stringify({page:V,path:ye,pathTemplate:W}),content:JSON.stringify(X)},h=yl(Zt.current,c);Zt.current=c,h&&Yn()},[X,st,A,Y,V,ye,W]);const en=S.useRef(null);S.useEffect(()=>{if(!st||A||Y||!V||!X){en.current=null;return}const c=JSON.stringify(o.state.variantOverride??null),h=en.current;en.current={page:V,sig:c},!(!h||h.page!==V||h.sig===c)&&Yn()},[o.state.variantOverride,st,A,Y,V]);const Er=!!t&&!!r&&!Me.notFound&&!fr&&!ur&&(Jt?.kind==="ready"||vt!=="idle"),pe=fl({editingMode:g,sandboxDisplay:K.mode==="sandbox",blocksEditingEnabled:f});S.useEffect(()=>{const c=We;if(!c)return;const h=L=>{if(L.origin===c)if(L.data?.type==="visual-editor::element-clicked"){const $=oi.safeParse(L.data.payload);$.success&&b($.data)}else if(L.data?.type==="cms-editor::section-clicked"){const $=ci.safeParse(L.data.payload);$.success&&T({index:$.data.sectionIndex,seq:$.data.clickSeq})}else L.data?.type==="cms-editor::render-start"?ie():L.data?.type==="cms-editor::render-end"?(Te(),P.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},c)):L.data?.type==="cms-editor::render-error"&&Te()};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[We,qt,Wt,Gt]);const Qn=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::activate",script:ii},h)},jr=()=>{const c=P.current?.contentWindow,h=ft(G);!c||!h||c.postMessage({type:"visual-editor::deactivate"},h)},tn=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage(K.mode==="production"||M?{type:"editor::inject",args:{script:Ps}}:{type:"visual-editor::activate",script:Ps},h),c.postMessage({type:"cms-editor::set-labels",labels:qt,kinds:Wt,keys:Gt},h))},Nr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||c.postMessage({type:"cms-editor::deactivate"},h)},Tr=()=>{const c=P.current?.contentWindow,h=We;!c||!h||(c.postMessage({type:"cms-editor::clear-hover"},h),c.postMessage({type:"visual-editor::clear-hover"},h))},Et=c=>{if(c==="blocks"&&!f)return;const h=g;!n&&c!==h&&(c==="blocks"?N.current?.resize("30%"):N.current?.collapse()),E(c),b(null),T(null),c!=="blocks"&&Q(null),h==="visual"&&jr(),c==="visual"&&Qn(),h==="blocks"&&c!=="blocks"&&Nr(),c==="blocks"&&tn()},Cr=()=>{Et(cl(g,f))},Rr=()=>{Et(dl(g,f))},nn=()=>{const c=P.current;if(!c)return;ie();const h=document.activeElement,L=c.tabIndex;c.tabIndex=-1,c.style.pointerEvents="none",c.blur(),kl(c,kt.current);let $;const le=()=>{clearTimeout($),c.tabIndex=L,c.style.pointerEvents="";const De=document.activeElement;(!De||De===document.body||De===c)&&h?.focus(),c.removeEventListener("load",le)};c.addEventListener("load",le),$=setTimeout(le,3e3)};So(nn);const jt=Xa(Se.slug,t??""),Nt=Yt&&nt&&!!t,Xn=S.useRef(null);S.useEffect(()=>{if(Nt)return Za(jt)},[Nt,jt]);const{reload:it}=eo(Se.slug,t??""),Zn=S.useRef(it.seq);S.useEffect(()=>{if(Zn.current!==it.seq&&(Zn.current=it.seq,!!Nt&&Xn.current===kt.current)){if(it.navigates){cs(jt);return}nn()}},[it.seq]);const Lr=to(_n),lt=no(Qe(be)?Lr:""),es=S.useRef(lt);S.useEffect(()=>{const c=es.current;if(es.current=lt,!c||!lt||c===lt)return;const h=P.current;if(h)return ai({iframe:h,reload:nn})},[lt]);const _r=()=>{const c=Ft.indexOf(k);j(Ft[(c+1)%Ft.length])},sn=(c,h)=>{if(!V)return;const L=V,$={...qe,[c]:h};Ee.current=Fe(W,$),ue(le=>({...le,[L]:$})),at({path:W,pageKey:L,params:$})},Ar=Qi({iframeBase:K.iframeBase,resolvedPath:ye,activeGlobalSectionName:A?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),rn=c=>{const h=re[c.key]??{},L=Fe(c.path,h);(A||Le(L)!==Le(ye))&&ie(),Ee.current=L,J(null),Q(null),se(null),T(null),de(c.key),oe(c.path),at({path:c.path,pageKey:c.key,params:h}),o.selectTarget({kind:"page",key:c.key,path:c.path})};va(rt,c=>{(A||Le(c)!==Le(ye))&&ie(),Ee.current=c,J(null),Q(null),se(null),T(null),de(null),oe(c),at({path:c,pageKey:null,params:{}})});const Or=c=>{if(xn(be)){const $=X?bo(X,c.key,ve):null;$?rn($):cn.info(e("sandbox.preview.blockOnNoPage"));return}if(!tt||!ve){cn.error(e("sandbox.preview.previewMetadataNotReady"));return}ie(),Ee.current=null;const h=fs(ve),L=hs(tt,h,c.key);J(c),Q(null),se(L),T(null),o.selectTarget({kind:"section",key:c.key})},Dr=c=>{f&&(J(null),Q(c.key),se(null),Et("blocks"),o.selectTarget({kind:"loader",key:c.key}))},Br=async({name:c,path:h,templateKey:L})=>{if(!t||!r)return;const $=Zs(h);if($){H($);return}const le=h.trim().startsWith("/")?h.trim():`/${h.trim()}`;if(He.some(je=>Le(je.path)===Le(le))){H(e("sandbox.preview.pageAlreadyExists",{path:le}));return}let De;if(L&&(De=X?.[L],!De)){H(e("sandbox.preview.templateNoLongerExists"));return}H(void 0);try{const je=await An.mutateAsync({name:c,path:le,template:De});ce(!1),cn.success(e("sandbox.preview.pageCreated",{name:c})),await Co(hl),rn({key:je.key,name:je.name,path:je.path}),Et("blocks")}catch(je){H(je instanceof Error?je.message:e("sandbox.preview.failedToCreatePage"))}},Tt=Xi({previewSurfaceActive:nt,daemonReady:Er,production:K.mode==="production",servePreviewUrl:Qe(be)}),Fr=Zi({showPreviewToolbar:Tt,contentEditingEnabled:m}),Ct=()=>{Z(!1),q("")},an=A?.name??xt?.title??Ht?.name,on=Rn.isPending||Ln.isPending,ln=on?ft(K.iframeBase):an,Rt=A?`section:${A.key}`:Y?`loader:${Y}`:V?`page:${V}`:void 0,Mr=Tt?Fr?s.jsxs(La,{open:U,onOpenChange:c=>{Z(c),c||q("")},children:[s.jsx(_a,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:on?ln??void 0:A||xt?an:[an,W].filter(Boolean).join(" · "),className:"group/page-picker flex h-7 w-fit min-w-[320px] items-stretch overflow-hidden whitespace-nowrap rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background text-left text-xs text-muted-foreground transition-colors hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:s.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[A&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-[11px] font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[s.jsx(Sa,{size:11}),e("sandbox.preview.globalBadge")]}),xt&&s.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground",children:[s.jsx(Pa,{size:11}),e("sandbox.preview.loaderBadge")]}),ln&&s.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ln}),!on&&!A&&!xt&&s.jsx("span",{"data-testid":"preview-page-path",className:"ml-auto min-w-0 truncate text-right font-mono text-muted-foreground",children:W}),s.jsx(xa,{size:12,className:Mt("shrink-0 transition-transform",U&&"rotate-180")})]})})}),s.jsxs(Aa,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[s.jsxs(qs,{shouldFilter:!1,defaultValue:Rt,children:[s.jsx(Ws,{value:z,onValueChange:c=>{q(c),te.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),s.jsxs(Vs,{ref:te,className:"max-h-80",children:[s.jsx(Gs,{children:He.length===0&&Ut.length===0&&Fn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Dn.length>0&&s.jsx(mt,{children:Dn.map(c=>s.jsxs(pt,{value:`page:${c.key}`,"aria-current":Rt===`page:${c.key}`||void 0,title:`${c.name} · ${c.path}`,onSelect:()=>{Ct(),rn(c)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:c.name}),s.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:c.path})]},c.key))}),Bn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalComponents"),children:Bn.map(c=>s.jsx(pt,{value:`section:${c.key}`,"aria-current":Rt===`section:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Or(c)},children:s.jsx("span",{className:"truncate",children:c.name})},c.key))}),Mn.length>0&&s.jsx(mt,{heading:e("sandbox.preview.globalLoaders"),children:Mn.map(c=>s.jsx(pt,{value:`loader:${c.key}`,"aria-current":Rt===`loader:${c.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Ct(),Dr(c)},children:s.jsx("span",{className:"truncate",children:c.title})},c.key))})]})]}),!A&&!Y&&ht(W).some(c=>c.type!=="text")&&s.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:ht(W).map((c,h)=>{if(c.type==="text")return s.jsx("span",{children:c.text},`text-${h}`);const L=Vt[c.name];return L&&wt?s.jsx(Mi,{sources:L,template:W,paramName:c.name,value:qe[c.name]??"",sandboxRef:wt,onCommit:$=>sn(c.name,$)},`${V}:${c.name}`):s.jsx(Ji,{name:c.name,value:qe[c.name]??"",onCommit:$=>sn(c.name,$)},`${V}:${c.name}`)})}),s.jsx("div",{className:"border-t p-1.5",children:s.jsxs(Xe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Ct(),H(void 0),ce(!0)},children:[s.jsx(Ra,{size:16}),e("sandbox.preview.createNewPage")]})})]})]}):s.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:Ar}):null,ts=Tt||m?s.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:_r,"aria-label":e(As[k]),children:k==="mobile"?s.jsx(Ea,{size:16}):k==="tablet"?s.jsx(ja,{size:16}):s.jsx(Na,{size:16})})}),s.jsx(pn,{children:e(As[k])})]}),Mr,s.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.jsx(ct,{onClick:kr,"aria-label":e("sandbox.preview.openInNewTab"),children:s.jsx(Wr,{size:16})})})]}):null,$r=(xe||a)&&K.mode==="sandbox",Lt=gl[k],_t=k==="desktop"&&(_.width===0||_.width>=Lt.width+2*_s),ns=_t?1:Math.min(_.width>0?_.width/(Lt.width+2*_s):1,1),Kr=_t?{width:"100%",height:"100%"}:{width:`${Lt.width}px`,height:_.height>0?`${_.height/ns}px`:`${Lt.height}px`,transform:`scale(${ns})`,transformOrigin:"top center"},ss=s.jsxs(s.Fragment,{children:[$r&&(Tt||m)&&s.jsx(ct,{onClick:Cr,"aria-pressed":pe==="visual","aria-label":e("sandbox.preview.visualEditor"),active:pe==="visual",children:s.jsx(ls,{size:16})}),f&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:Rr,"aria-pressed":pe==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:pe==="blocks",children:s.jsx(Ca,{size:16})})}),s.jsx(pn,{children:e("sandbox.preview.blocksEditor")})]}),Ve&&s.jsxs(fn,{children:[s.jsx(mn,{asChild:!0,children:s.jsx(ct,{onClick:F,"aria-pressed":B,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:B,children:s.jsx(Ta,{size:16})})}),s.jsx(pn,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),zr=!!Y&&pe==="blocks";return s.jsxs("div",{className:"flex flex-col w-full h-full",children:[wt&&Object.entries(Vt).map(([c,h])=>(qe[c]??"")===""?s.jsx(Wi,{sources:h,template:W,paramName:c,sandboxRef:wt,onFill:L=>sn(c,L)},`${V}:${c}`):null),s.jsxs(s.Fragment,{children:[s.jsx(is.Toolbar.Center.Portal,{fallback:s.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:ts}),children:ts}),s.jsx(is.Toolbar.Right.Portal,{fallback:ss,children:ss})]}),s.jsx("div",{className:"flex-1 overflow-hidden relative",children:zr?s.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F}),B&&Ve&&s.jsx("div",{className:"absolute inset-0 z-10",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]}):s.jsxs(gs,{orientation:"horizontal",disabled:pe!=="blocks",className:"relative isolate",children:[s.jsx(Ot,{ref:N,id:"preview-blocks-editor",defaultSize:pe==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:pe==="blocks"&&s.jsx(Cs,{virtualMcpId:t,externalSelection:w,onViewJsonFile:F})}),pe==="blocks"&&s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-canvas",defaultSize:pe==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:s.jsxs(gs,{orientation:"horizontal",disabled:!(B&&Ve),children:[s.jsx(Ot,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:s.jsxs("div",{ref:c=>{if(!c)return;const h=()=>I($=>$.width===c.clientWidth&&$.height===c.clientHeight?$:{width:c.clientWidth,height:c.clientHeight});h();const L=new ResizeObserver(h);return L.observe(c),()=>L.disconnect()},className:Mt("h-full relative overflow-clip flex justify-center",nt&&!_t&&"bg-muted/30"),children:[(ke||mr)&&nt&&s.jsx("div",{className:"absolute inset-x-0 top-0 z-40 h-1 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-r-full bg-brand shadow-[0_0_6px] shadow-brand/60 animate-preview-ramp"})}),K.showDecidingLoader&&s.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:s.jsx(gt,{className:"size-5 text-muted-foreground"})}),K.showBlockingOverlay&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"starting",progress:zn,claimPhase:Jt})}),!M&&!Pe&&ze.kind==="suspended"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"suspended",onResume:ge.resume})}),!M&&!Pe&&ze.kind==="errored"&&s.jsx("div",{className:"absolute inset-0 z-30",children:s.jsx(un,{kind:"errored",error:ze.error,onRetry:ge.retry,connectionsHref:`/${Se.slug}/settings/connections`})}),K.showWakingPill&&s.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl border border-border bg-muted px-4 py-3 shadow-lg pointer-events-none select-none",children:[s.jsx(gt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),pe==="visual"&&!y&&s.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-violet-400/40 bg-violet-500/90 px-3 py-1 text-xs font-medium text-white shadow-md backdrop-blur-sm pointer-events-none select-none",children:[s.jsx(ls,{size:12}),e("sandbox.preview.clickElementToAsk")]}),pe==="visual"&&y&&s.jsx(fi,{element:y,onDismiss:()=>b(null)}),nt&&Ge&&s.jsx("div",{className:Mt("shrink-0",!_t&&"border-x border-border bg-background shadow-sm"),style:Kr,onMouseLeave:Tr,children:s.jsx("iframe",{ref:P,src:ot,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Gn.handleError,onLoad:()=>{if(Xt(Ls),Gn.handleLoad(),Te(),Xn.current=kt.current,Nt&&cs(jt),K.mode!=="sandbox"||M){(K.mode==="production"&&!K.showWakingPill||M)&&pe==="blocks"&&tn();return}if(Gr("vm_preview_loaded",{view_mode:pe,vm_id:Ze?.sandboxHandle??null}),!A)try{const c=P.current?.contentWindow?.location?.pathname;if(!c)return;const h=Ee.current;if(h!==null&&(Ee.current=null,Le(c)!==Le(h))||Le(c)===Le(ye))return;oe(c),at({path:c,pageKey:we,params:qe})}catch{}pe==="visual"&&Qn(),pe==="blocks"&&tn()}},K.iframeBase)})]})}),B&&Ve&&s.jsxs(s.Fragment,{children:[s.jsx(vs,{withHandle:!0}),s.jsx(Ot,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:s.jsx(Rs,{ref:D,virtualMcpId:t,pageKey:Ve,onClose:O})})]})]})})]})}),s.jsx(tl,{open:ee,onOpenChange:ce,isPending:An.isPending,error:C,templates:He,onSubmit:Br})]})}const Pl=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},El=1e4,jl=1e4,Nl=5e3,Tl=2;function Cl(t,e){return t&&e===0?jl:Math.min(1e3*2**Math.max(0,e-1),Nl)}function Rl(t,e,n){return e?!0:t===!0&&n<Tl}function Ll(t,e){const n=ne.c(11),r=Pl,i=Jr();let u;n[0]!==t?(u=Bs.localAppReachable(t??""),n[0]=t,n[1]=u):u=n[1];const a=u;let o;n[2]!==r||n[3]!==i||n[4]!==a||n[5]!==t?(o=async m=>{const{signal:f}=m,x=new AbortController,v=()=>x.abort();f.addEventListener("abort",v);const E=setTimeout(v,El),g=await r(t,x.signal).catch(Al);clearTimeout(E),f.removeEventListener("abort",v);const k=i.getQueryData(a),j=g?0:(k?.failures??0)+1;return{up:Rl(k?.up??null,g,j),failures:j}},n[2]=r,n[3]=i,n[4]=a,n[5]=t,n[6]=o):o=n[6];const l=!!t;let d;n[7]!==a||n[8]!==o||n[9]!==l?(d={queryKey:a,queryFn:o,enabled:l,retry:!1,staleTime:0,gcTime:0,refetchInterval:_l},n[7]=a,n[8]=o,n[9]=l,n[10]=d):d=n[10];const{data:p}=Yr(d);return t?p?.up??null:null}function _l(t){return t.state.data?Cl(t.state.data.up,t.state.data.failures):!1}function Al(){return!1}function Ol(t){const{backend:e}=t;if(e.kind==="protocol"&&e.source==="local")return{kind:"connected"};if(e.kind==="unavailable"&&e.source==="local"){const n=e.problem;return!n||n.reason==="not-answering"?t.access==="denied"?{kind:"needs-permission"}:{kind:"not-running"}:{kind:"problem",problem:n}}return{kind:"connecting"}}function Ec(t){const e=ne.c(48),{virtualMcpId:n}=t,r=_e(),i=Da(n),{connection:u}=Qs(n),{activeTask:a,taskId:o,currentBranch:l}=It(),d=Bo(o),[p,m]=S.useState(!1),f=En(n,l);let x;e[0]!==f||e[1]!==u?(x=u?Qe(f):null,e[0]=f,e[1]=u,e[2]=x):x=e[2];const v=x,E=Ll(v),g=rr();if(_o({threadId:o,sandboxBranch:a?.branch??l,agentHasRepo:hn(i?.metadata),threadHasRepo:hn(d)||hn(a?.metadata)})==="none"&&!u){let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(xs,{className:"size-7 text-foreground"})}),e[3]=y):y=e[3];let b;e[4]!==r?(b=r("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=r,e[5]=b):b=e[5];let w;e[6]!==r?(w=r("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=r,e[7]=w):w=e[7];let T,P;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>m(!0),P=s.jsx(xs,{className:"size-4"}),e[8]=T,e[9]=P):(T=e[8],P=e[9]);let N;e[10]!==r?(N=r("mainPanelTabs.previewTab.connectGithub"),e[10]=r,e[11]=N):N=e[11];let B;e[12]!==N?(B=s.jsxs(Xe,{onClick:T,children:[P,N]}),e[12]=N,e[13]=B):B=e[13];let R;e[14]!==b||e[15]!==w||e[16]!==B?(R=s.jsx(Ro,{className:"h-full",image:y,title:b,description:w,actions:B}),e[14]=b,e[15]=w,e[16]=B,e[17]=R):R=e[17];let D;e[18]!==p?(D=s.jsx(Lo,{open:p,onOpenChange:m,mode:"agent"}),e[18]=p,e[19]=D):D=e[19];let O;return e[20]!==D||e[21]!==R?(O=s.jsxs(s.Fragment,{children:[R,D]}),e[20]=D,e[21]=R,e[22]=O):O=e[22],O}if(u&&i&&!Qe(f)){let y;e[23]!==g||e[24]!==f?(y=Ol({backend:f,access:g}),e[23]=g,e[24]=f,e[25]=y):y=e[25];let b;e[26]!==u.endpoint?(b=so(u.endpoint),e[26]=u.endpoint,e[27]=b):b=e[27];let w;return e[28]!==y||e[29]!==b?(w=s.jsx(Bl,{status:y,host:b}),e[28]=y,e[29]=b,e[30]=w):w=e[30],w}if(v&&E!==!0){let y;e[31]!==r?(y=r("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=r,e[32]=y):y=e[32];let b;e[33]!==v||e[34]!==r?(b=r("mainPanelTabs.previewTab.localAppWaiting.body",{host:Dl(v)}),e[33]=v,e[34]=r,e[35]=b):b=e[35];let w;e[36]!==b?(w=s.jsx(Kt,{text:b}),e[36]=b,e[37]=w):w=e[37];let T;e[38]!==r?(T=r("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=r,e[39]=T):T=e[39];let P;e[40]!==T?(P=s.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=P):P=e[41];let N;return e[42]!==y||e[43]!==w||e[44]!==P?(N=s.jsx(zt,{headingLevel:2,waiting:!0,title:y,lead:w,footer:P}),e[42]=y,e[43]=w,e[44]=P,e[45]=N):N=e[45],N}let j;return e[46]!==n?(j=s.jsx(pa,{children:s.jsx(Sl,{virtualMcpId:n})}),e[46]=n,e[47]=j):j=e[47],j}function Dl(t){try{return new URL(t).host}catch{return t}}function Bl(t){const e=ne.c(20),{status:n,host:r}=t,i=_e();if(n.kind==="connected"){let o;e[0]!==i?(o=i("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=i,e[1]=o):o=e[1];let l;e[2]!==i?(l=i("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=i,e[3]=l):l=e[3];let d;e[4]!==l?(d=s.jsx(Kt,{text:l}),e[4]=l,e[5]=d):d=e[5];let p;e[6]!==i?(p=i("mainPanelTabs.previewTab.localhostNoPreview.step.title"),e[6]=i,e[7]=p):p=e[7];let m;e[8]!==p?(m=[{title:p,command:`${Ys} --preview localhost:3000`}],e[8]=p,e[9]=m):m=e[9];let f;return e[10]!==o||e[11]!==d||e[12]!==m?(f=s.jsx(zt,{headingLevel:2,waiting:!1,title:o,lead:d,steps:m}),e[10]=o,e[11]=d,e[12]=m,e[13]=f):f=e[13],f}let u;e[14]!==r||e[15]!==n?(u=zo(n,r),e[14]=r,e[15]=n,e[16]=u):u=e[16];let a;return e[17]!==r||e[18]!==u?(a=s.jsx(Ko,{wait:u,hosts:r}),e[17]=r,e[18]=u,e[19]=a):a=e[19],a}export{Ko as L,Ec as P,zt as S,Pc as u};