decocms 4.445.1 → 4.446.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 (360) hide show
  1. package/dist/client/assets/{AlertCircle-DjwL3HeP.js → AlertCircle-Ca-DA_Xo.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CXzSyqpz.js → AreaChart-6J0SmH8g.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-OKETo1JN.js → ArrowLeft-BGL-gkHz.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CuiZciDq.js → ArrowUp-DCJvUiXa.js} +1 -1
  5. package/dist/client/assets/{Building02-Bi6DxRcf.js → Building02-BMj4gWpR.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-8M4Jx-Ig.js → CartesianChart-wEL_dp30.js} +1 -1
  7. package/dist/client/assets/{Check-CG-PU97b.js → Check-1kmjHGAt.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-BlkcMEUz.js → CheckCircle-DZIvsuC9.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-C3ZiD_fg.js → ChevronUp-BirkHko8.js} +1 -1
  10. package/dist/client/assets/{Copy01-DojX8qy9.js → Copy01-C0n9CnUc.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-BQvCmNkN.js → CreditCard01-CCCfodPa.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Djr19pIQ.js → DotsVertical-D9Sv34Vj.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-CuBemprE.js → ErrorBarContext-BRRTTo5Y.js} +1 -1
  14. package/dist/client/assets/{Image01-DfuNfbn3.js → Image01-DSE2Qnmp.js} +1 -1
  15. package/dist/client/assets/{Key01-CJa1302r.js → Key01-Bc_kctWJ.js} +1 -1
  16. package/dist/client/assets/{Line-DP9XUA3f.js → Line-C6YRqPoH.js} +1 -1
  17. package/dist/client/assets/{Link01-CUp58poO.js → Link01-DRqoYgr7.js} +1 -1
  18. package/dist/client/assets/{LinkBroken01-xH8m8Sus.js → LinkBroken01-Be5i7wiR.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-D6MX3TMO.js → LinkExternal01-CYu1u0V8.js} +1 -1
  20. package/dist/client/assets/{Monitor01-DlAgqW2y.js → Monitor01-B-mcTiTw.js} +1 -1
  21. package/dist/client/assets/{Palette-w5zzOUDg.js → Palette-CfapkMIU.js} +1 -1
  22. package/dist/client/assets/{Plus-B-53rDvP.js → Plus-DeJwCuZE.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BllCVZq9.js → SearchMd-B-uYGFsm.js} +1 -1
  24. package/dist/client/assets/{Sector-BN_4WiSr.js → Sector-CBXMKI9G.js} +1 -1
  25. package/dist/client/assets/{ShoppingBag01-DppHiQvv.js → ShoppingBag01-CZuerMtF.js} +1 -1
  26. package/dist/client/assets/{Sun-wN9CLbIZ.js → Sun-Cxwg0J8z.js} +1 -1
  27. package/dist/client/assets/{Tool01-jLeWFLJf.js → Tool01-D9114OvH.js} +1 -1
  28. package/dist/client/assets/{Trash01-COqYNSpe.js → Trash01-DPzDDdie.js} +1 -1
  29. package/dist/client/assets/{Upload01-Ck_z8fJf.js → Upload01-D29vOgD_.js} +1 -1
  30. package/dist/client/assets/{User01-CST7ZUYM.js → User01-Cv1yYcPo.js} +1 -1
  31. package/dist/client/assets/{UserSquare-B213f0Cc.js → UserSquare-DxiZzC-7.js} +1 -1
  32. package/dist/client/assets/{Users01-BGu5-MW7.js → Users01-fxv639Iz.js} +1 -1
  33. package/dist/client/assets/{X-Cof6n_dh.js → X-DNUeDs_E.js} +1 -1
  34. package/dist/client/assets/{XAxis-Dj0nCCf7.js → XAxis-DCqhZwzQ.js} +1 -1
  35. package/dist/client/assets/{XClose-Bv4BxYzr.js → XClose-CQskEvfN.js} +1 -1
  36. package/dist/client/assets/{ZoomOut-C9XmFKHT.js → ZoomOut-D9VvN_NP.js} +1 -1
  37. package/dist/client/assets/{access-gate-DwCbDOyT.js → access-gate-CjtXh2VQ.js} +1 -1
  38. package/dist/client/assets/{add-connection-dialog-Bd-4QkQ3.js → add-connection-dialog-DqHg8HcJ.js} +1 -1
  39. package/dist/client/assets/{agent-analytics-CZFEsxzi.js → agent-analytics-ZH1VnpyH.js} +1 -1
  40. package/dist/client/assets/agent-app-DhnERFci.js +1 -0
  41. package/dist/client/assets/{agent-assets-C3DwQELr.js → agent-assets-DZ6oRbX0.js} +1 -1
  42. package/dist/client/assets/{agent-automation-BHsaoQMa.js → agent-automation-BRl8iL4T.js} +1 -1
  43. package/dist/client/assets/{agent-automations-D_aNacY7.js → agent-automations-BN-GhuzT.js} +1 -1
  44. package/dist/client/assets/{agent-connect-sources-CmXIaOqo.js → agent-connect-sources-ChbBGCxx.js} +1 -1
  45. package/dist/client/assets/agent-deck-C3wtWOT6.js +1 -0
  46. package/dist/client/assets/{agent-e2e-5Ey6GJps.js → agent-e2e-CcdlKXTV.js} +1 -1
  47. package/dist/client/assets/{agent-experiments-DFFnSKCR.js → agent-experiments-CL-9SIpL.js} +1 -1
  48. package/dist/client/assets/{agent-file-0RtEXQpG.js → agent-file-DWLgfdfw.js} +1 -1
  49. package/dist/client/assets/{agent-git-CknhvqDB.js → agent-git-ZG2S1zYs.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-Cv3HBuvV.js → agent-hosting-BNhVEuQl.js} +1 -1
  51. package/dist/client/assets/{agent-icon-CP-a92NU.js → agent-icon-txBWjErR.js} +1 -1
  52. package/dist/client/assets/agent-library-7tnae9bN.js +1 -0
  53. package/dist/client/assets/agent-library-file-BftkKwug.js +1 -0
  54. package/dist/client/assets/{agent-monitor-DpUK3mmL.js → agent-monitor-Cxzo29vz.js} +1 -1
  55. package/dist/client/assets/{agent-overview-BIGeAvZW.js → agent-overview-BWPew9Qs.js} +1 -1
  56. package/dist/client/assets/agent-settings-DpseRtaF.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-BF-ZX30y.js → agent-site-editor-BvMNm3Hv.js} +1 -1
  58. package/dist/client/assets/agent-site-editor-code-D6mxO_RU.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-D1vaIIMb.js → agent-site-editor-content-CujQFdyP.js} +3 -3
  60. package/dist/client/assets/{agent-site-editor-preview-C-eN1kYT.js → agent-site-editor-preview-Dl9K62Z1.js} +3 -3
  61. package/dist/client/assets/agent-view-CiQLBw-t.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-DPnTVLre.js → agent-view-guard-BpmYIopx.js} +1 -1
  63. package/dist/client/assets/{agents-list-Mgzp0P_4.js → agents-list-ckZNxQQT.js} +1 -1
  64. package/dist/client/assets/{ai-providers-Distp3oA.js → ai-providers-uZvFPpSM.js} +1 -1
  65. package/dist/client/assets/{alert-DqxeFeub.js → alert-CCRJnMJX.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-BGx21FS2.js → alert-dialog-DPRkujUl.js} +1 -1
  67. package/dist/client/assets/{analytics-sections-D10GOi-H.js → analytics-sections-BdxIURCl.js} +1 -1
  68. package/dist/client/assets/{api-keys-C7InEOAV.js → api-keys-CNuRKTn5.js} +1 -1
  69. package/dist/client/assets/api-keys-DyJYVCRj.js +1 -0
  70. package/dist/client/assets/app-editor-8YXMt2hP.js +1 -0
  71. package/dist/client/assets/{asset-utils-BHgp-Y7e.js → asset-utils-CB8QPgwX.js} +1 -1
  72. package/dist/client/assets/{auth-ffdv9zBE.js → auth-D-ee-h5T.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-Co-9Paa8.js → auth-catchall-BK_PlEqR.js} +1 -1
  74. package/dist/client/assets/{auth-entry-CAt61ZOn.js → auth-entry-BEQZwL9l.js} +1 -1
  75. package/dist/client/assets/{auth-split-layout-CCgaVboC.js → auth-split-layout-Bu7yDS6Q.js} +1 -1
  76. package/dist/client/assets/{authenticate-and-persist-oauth-Dzp7mUaZ.js → authenticate-and-persist-oauth-BRf4W3aC.js} +1 -1
  77. package/dist/client/assets/{automation-list-row-ok7jT6DX.js → automation-list-row-Dbc6Qt43.js} +1 -1
  78. package/dist/client/assets/{automation-runs-CXbfi6GL.js → automation-runs-DUtF4sxB.js} +1 -1
  79. package/dist/client/assets/{automations-De2zXYq4.js → automations-ls3UR1Qr.js} +1 -1
  80. package/dist/client/assets/{autosend-Dh7jjPXm.js → autosend-BSFtgKhn.js} +1 -1
  81. package/dist/client/assets/{avatar-fmpBdvp6.js → avatar-D08cfTFl.js} +1 -1
  82. package/dist/client/assets/{badge-DsoTczsm.js → badge-BNBKCpa-.js} +1 -1
  83. package/dist/client/assets/{block-document-D6rGPUNK.js → block-document-DCC9icxJ.js} +1 -1
  84. package/dist/client/assets/{blocks-preview-workspace-context-C2W6_FPn.js → blocks-preview-workspace-context-BpqIiAnp.js} +1 -1
  85. package/dist/client/assets/{buckets-DdCHbQuS.js → buckets-DB5wfGse.js} +1 -1
  86. package/dist/client/assets/{build-improve-prompt-doc-BjoVQABC.js → build-improve-prompt-doc-BImrugKL.js} +1 -1
  87. package/dist/client/assets/{calendar-BJt9uDoC.js → calendar-CiBjQc6z.js} +1 -1
  88. package/dist/client/assets/{capability-load-error-CGburUk6.js → capability-load-error-A3SpOKfq.js} +1 -1
  89. package/dist/client/assets/{category-editor-0k4-JF4F.js → category-editor-BevzDKjY.js} +1 -1
  90. package/dist/client/assets/{chart-CIZqCLm5.js → chart-Chk4n-xD.js} +1 -1
  91. package/dist/client/assets/{chat-context-BBhvzmcP.js → chat-context-PePawndm.js} +1 -1
  92. package/dist/client/assets/{chat-draft-Cz6yiaVy.js → chat-draft-CXRkpBvJ.js} +1 -1
  93. package/dist/client/assets/{checkbox-CpAb-kkK.js → checkbox-ZK2ilOD4.js} +1 -1
  94. package/dist/client/assets/{choose-editor-DKU3NA7D.js → choose-editor-CCWi7bqZ.js} +1 -1
  95. package/dist/client/assets/{claim-phase-copy-CHHxm4AV.js → claim-phase-copy-Cl0YDvy2.js} +1 -1
  96. package/dist/client/assets/{cli-auth-success-BY5G9enJ.js → cli-auth-success-CTKb-X8W.js} +1 -1
  97. package/dist/client/assets/{client-icons-BgBylDCZ.js → client-icons-BGNTW461.js} +1 -1
  98. package/dist/client/assets/{collapsible-B8PaaCi8.js → collapsible-CvSd253l.js} +1 -1
  99. package/dist/client/assets/{collection-detail-BWFHXPAY.js → collection-detail-LBceg9p5.js} +1 -1
  100. package/dist/client/assets/{collection-display-button-uO2KBDwy.js → collection-display-button-DNhdwaFL.js} +1 -1
  101. package/dist/client/assets/{collection-search-zhbgIwPh.js → collection-search-Da38LCFd.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-41fgwDNj.js → collection-table-wrapper-71xj9NS7.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-Cnqxbwq8.js → collection-tabs-POi61Yn-.js} +1 -1
  104. package/dist/client/assets/column-rules-upwy6dYa.js +3 -0
  105. package/dist/client/assets/{combobox-gRnDTga1.js → combobox-rCJznWYq.js} +1 -1
  106. package/dist/client/assets/{command-kcGesH_1.js → command-BuaN4gi6.js} +1 -1
  107. package/dist/client/assets/{companion-mcps-section-3XbtagnL.js → companion-mcps-section-CdKGlriN.js} +1 -1
  108. package/dist/client/assets/{config-sm-ut8Gk.js → config-B6Of24vm.js} +1 -1
  109. package/dist/client/assets/{connect-BH4qJP2z.js → connect-B_C-UzWo.js} +1 -1
  110. package/dist/client/assets/{connect-layout-qnWOJOpE.js → connect-layout-DLkDQKSs.js} +1 -1
  111. package/dist/client/assets/{connection-DNEkOvf2.js → connection-COorLhal.js} +1 -1
  112. package/dist/client/assets/{connection-card-BALjxAsf.js → connection-card-DK1Wt7vU.js} +1 -1
  113. package/dist/client/assets/{connection-detail-CQG26bcS.js → connection-detail-CjXJZq54.js} +1 -1
  114. package/dist/client/assets/{connection-form-helpers-Cb-n9DJ0.js → connection-form-helpers-DwS96ZJh.js} +1 -1
  115. package/dist/client/assets/{connections-i2ynFVnZ.js → connections-G7lZjutX.js} +1 -1
  116. package/dist/client/assets/{context-B7ToLfv0.js → context-JWyIITVx.js} +1 -1
  117. package/dist/client/assets/{context-menu-Bi84gHfG.js → context-menu-2oGyK_uK.js} +1 -1
  118. package/dist/client/assets/{create-organization-dialog-CP_6oHfw.js → create-organization-dialog-CWKQIKrZ.js} +1 -1
  119. package/dist/client/assets/{daily-pulse-8XiTqXkF.js → daily-pulse-C9U2Ukv6.js} +1 -1
  120. package/dist/client/assets/{decopilot-DYxSzoYy.js → decopilot-CTDgHPwq.js} +1 -1
  121. package/dist/client/assets/{device-hint-V6hc7GyA.js → device-hint-CFvz22Pt.js} +1 -1
  122. package/dist/client/assets/{dialog-COgKkGMt.js → dialog-BjdoPdxw.js} +1 -1
  123. package/dist/client/assets/{discover-B7IkkL7W.js → discover-Ctdwj82L.js} +1 -1
  124. package/dist/client/assets/{domain-settings-BKwkxHah.js → domain-settings-cUgfigqi.js} +1 -1
  125. package/dist/client/assets/{download-app-dialog-BU09bt1-.js → download-app-dialog-4RhgrbFN.js} +1 -1
  126. package/dist/client/assets/{drawer-B2MRXWND.js → drawer-C0Z1wiOg.js} +1 -1
  127. package/dist/client/assets/{editor-CIHxdT_W.js → editor-C4wBlSK3.js} +1 -1
  128. package/dist/client/assets/{empty-state-Cjrt4JF2.js → empty-state-Bp2gSnig.js} +1 -1
  129. package/dist/client/assets/{empty-state-DAKEuegE.js → empty-state-CQl0XC4z.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-98j2I-d4.js → extract-connection-data-Db1CJiHn.js} +1 -1
  131. package/dist/client/assets/{feature-gate-B1mBX_Og.js → feature-gate-DSzDIEDM.js} +1 -1
  132. package/dist/client/assets/{feature-paywall-BSrYp3HB.js → feature-paywall-AsO7--Ah.js} +1 -1
  133. package/dist/client/assets/{file-explorer-BEkZigwq.js → file-explorer-B3JOw8iS.js} +1 -1
  134. package/dist/client/assets/{file-preview-BNoQ182-.js → file-preview-Cc6Eq9Sb.js} +1 -1
  135. package/dist/client/assets/{file-share-button-C-PZ60jk.js → file-share-button-Dm01y0go.js} +1 -1
  136. package/dist/client/assets/{file-type-icon-CWC1YDae.js → file-type-icon-d8qc1y0k.js} +1 -1
  137. package/dist/client/assets/flat-project-Bs35VopP.js +1 -0
  138. package/dist/client/assets/{folder-icon-PbflUtLB.js → folder-icon-sunSnr-T.js} +1 -1
  139. package/dist/client/assets/{form-Db69kf_B.js → form-CPwmIDgD.js} +1 -1
  140. package/dist/client/assets/{gateway-client-B4-iQhqC.js → gateway-client-7b4dMSx0.js} +1 -1
  141. package/dist/client/assets/{general-CDUOuFSN.js → general-DCzYfIoO.js} +1 -1
  142. package/dist/client/assets/{home-hJemzDzt.js → home-CtOECS4J.js} +1 -1
  143. package/dist/client/assets/{icon-button-Bwycj_wq.js → icon-button-et2rWMzj.js} +1 -1
  144. package/dist/client/assets/index-6WjGaIcE.css +1 -0
  145. package/dist/client/assets/{index-D1gyNz7X.js → index-BFMaMVsZ.js} +1 -1
  146. package/dist/client/assets/{index-C4_IsUfP.js → index-BSnD4u1l.js} +2 -2
  147. package/dist/client/assets/{index-CSzGrExk.js → index-BUvFUUVJ.js} +1 -1
  148. package/dist/client/assets/{index-Ce2VZWO2.js → index-BgN0Ps2M.js} +1 -1
  149. package/dist/client/assets/{index-DPB2qLtL.js → index-BnLxaCHY.js} +1 -1
  150. package/dist/client/assets/{index-DTW4pU63.js → index-CORMIa-A.js} +1 -1
  151. package/dist/client/assets/{index-BZWRK0v9.js → index-DK4f8rGT.js} +1 -1
  152. package/dist/client/assets/{index-27xDb8Xc.js → index-Dno06lIj.js} +1 -1
  153. package/dist/client/assets/{index-C1ToZZWO.js → index-Dx_j0OqQ.js} +1 -1
  154. package/dist/client/assets/{index-Hu92qcJz.js → index-H5GJB4DI.js} +1 -1
  155. package/dist/client/assets/{index-DJV1OD9N.js → index-QFZIPwT9.js} +1 -1
  156. package/dist/client/assets/index-ZqKo7Jtc.js +64 -0
  157. package/dist/client/assets/{index-BnaT7vkr.js → index-cUMtLdAb.js} +1 -1
  158. package/dist/client/assets/{index-CW5Alkje.js → index-eGns4zSt.js} +1 -1
  159. package/dist/client/assets/{index-DJGpbjKX.js → index-fbhjQbzR.js} +1 -1
  160. package/dist/client/assets/{index-redirect-DTA4ItZi.js → index-redirect-Q2zzgk3k.js} +1 -1
  161. package/dist/client/assets/{infiniteQueryObserver-Cf0bngpS.js → infiniteQueryObserver-3rOVnljf.js} +1 -1
  162. package/dist/client/assets/{infra-billing-BObMvo8v.js → infra-billing-23cXn95a.js} +1 -1
  163. package/dist/client/assets/{input-6lxk3V5y.js → input-Cd0_CDVZ.js} +1 -1
  164. package/dist/client/assets/{input-Dvx4_YlR.js → input-D_thObzv.js} +3 -3
  165. package/dist/client/assets/{input-Dpl0C33Q.js → input-DyS6UqeB.js} +1 -1
  166. package/dist/client/assets/{integration-icon-gYDhAPNi.js → integration-icon-DdOqOzJh.js} +1 -1
  167. package/dist/client/assets/{label-CgPg1zhc.js → label-p4gAloMY.js} +1 -1
  168. package/dist/client/assets/{layout-Crx6USLo.js → layout-BJHFqT5z.js} +1 -1
  169. package/dist/client/assets/{legacy-agents-deep-Cut-1tge.js → legacy-agents-deep-Lz0arQ-r.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-Cj560OCW.js → legacy-main-redirect-C1cNgokY.js} +1 -1
  171. package/dist/client/assets/library-sa8Lb7lL.js +1 -0
  172. package/dist/client/assets/{library-tab-DPNlVhl-.js → library-tab-DDHZvhED.js} +1 -1
  173. package/dist/client/assets/{login-Bs9ns-6d.js → login-Blgte4SI.js} +1 -1
  174. package/dist/client/assets/{markdown-DtvdqO22.js → markdown-wuJsczpE.js} +1 -1
  175. package/dist/client/assets/{mcp-app-renderer-D3TWD-wB.js → mcp-app-renderer-CKOizQ1X.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-CjHh5FM6.js → mcp-oauth-JDHXDTjL.js} +1 -1
  177. package/dist/client/assets/{members-DNgd7fVu.js → members-or8i0XP3.js} +1 -1
  178. package/dist/client/assets/{memory-DU_rRCMP.js → memory-BK3we-w-.js} +1 -1
  179. package/dist/client/assets/{message-templates-s7IORQ8r.js → message-templates-D4jjPBAh.js} +1 -1
  180. package/dist/client/assets/{mini-report-page-oYFhLx2E.js → mini-report-page-DqTavTdu.js} +1 -1
  181. package/dist/client/assets/{mock-board-CCB3PySt.js → mock-board-B4VrUtgj.js} +1 -1
  182. package/dist/client/assets/{monaco-editor-By0NuCaO.js → monaco-editor-D0ZnzEs4.js} +1 -1
  183. package/dist/client/assets/{monitoring-stats-row-C4_DtBvj.js → monitoring-stats-row-BcWN5gal.js} +1 -1
  184. package/dist/client/assets/{multi-select-DEu7tNV3.js → multi-select-C2iXVR_Q.js} +1 -1
  185. package/dist/client/assets/{mustache-DBZS3bdm.js → mustache-BBVwKX2z.js} +1 -1
  186. package/dist/client/assets/{new-project-dialog-BOZCRvZH.js → new-project-dialog-26KIGlBO.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-DOyrg0SN.js → oauth-callback-D1fdfyWK.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-BzMON2oe.js → oauth-callback-ai-provider-BIYcQ38C.js} +1 -1
  189. package/dist/client/assets/{onboarding-CXIS0_bd.js → onboarding-EkOK5nPV.js} +1 -1
  190. package/dist/client/assets/{openai-conversation-C-HjbN9u.js → openai-conversation-DJI7J6XE.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-BOdF7f7a.js → optimistic-project-sidebar-views-DsSa3aGY.js} +1 -1
  192. package/dist/client/assets/{org-file-open-context-6QFXpEgZ.js → org-file-open-context-Bs96eliX.js} +1 -1
  193. package/dist/client/assets/{organization-choice-CM6nT08P.js → organization-choice-7JG7Or6t.js} +1 -1
  194. package/dist/client/assets/{orgs-B6-nh4S4.js → orgs-BGS1DCoT.js} +1 -1
  195. package/dist/client/assets/{page-seo-form-DKvS6L6D.js → page-seo-form-BanWt_Wh.js} +1 -1
  196. package/dist/client/assets/{pair-DpCeb_3s.js → pair-DWcQWh4a.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-DLN0J7oF.js → plan-ladder-ZwA3rsoJ.js} +1 -1
  198. package/dist/client/assets/{popover-dmidPVrf.js → popover-CRO_98-h.js} +1 -1
  199. package/dist/client/assets/{post-calendar-BjokMhLQ.js → post-calendar-BfaZZYX3.js} +1 -1
  200. package/dist/client/assets/{post-editor-YTcyxDjG.js → post-editor-DJxjE37e.js} +1 -1
  201. package/dist/client/assets/{preview-content-gPYBrvGn.js → preview-content-DpW2PJ-b.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-CzQnjks4.js → preview-dialog-DW4Lqxwy.js} +1 -1
  203. package/dist/client/assets/{profile-DxTtdxe5.js → profile-D4tGJTKv.js} +1 -1
  204. package/dist/client/assets/{project-app-view-BODEdbco.js → project-app-view-BqbwakZm.js} +1 -1
  205. package/dist/client/assets/{project-feed-DADEDd8d.js → project-feed-CWfDh6KW.js} +1 -1
  206. package/dist/client/assets/{project-icon-D1yuRlQG.js → project-icon-mfRu-TVA.js} +1 -1
  207. package/dist/client/assets/project-reports-BCXIY49G.js +1 -0
  208. package/dist/client/assets/project-tasks-ByD_Cvnv.js +1 -0
  209. package/dist/client/assets/{projects-CyZfUamX.js → projects-C3WEi1vK.js} +1 -1
  210. package/dist/client/assets/{projects-empty-state-CUFK9GpZ.js → projects-empty-state-BBjuUsU8.js} +1 -1
  211. package/dist/client/assets/{prompts-B9neOFSp.js → prompts-DjpaTlbB.js} +1 -1
  212. package/dist/client/assets/record-editor-Bnb7fDb6.js +1 -0
  213. package/dist/client/assets/{redirect-editor-DrCNsc1H.js → redirect-editor-D72JLPRT.js} +1 -1
  214. package/dist/client/assets/{reports-DyXPXviK.js → reports-CMVZl1EA.js} +1 -1
  215. package/dist/client/assets/reports-D_IkwcBS.js +1 -0
  216. package/dist/client/assets/{reports-onboarding-BxKIzMW5.js → reports-onboarding-xnTEnkQq.js} +1 -1
  217. package/dist/client/assets/{reports-tab-DJgIQjgc.js → reports-tab-vatp9Z9R.js} +2 -2
  218. package/dist/client/assets/{repositories-CsjMPbQH.js → repositories-D282TLTf.js} +1 -1
  219. package/dist/client/assets/{repository-binding-B6lutFQ4.js → repository-binding-Bldcduno.js} +1 -1
  220. package/dist/client/assets/{repository-import-picker-B4bNRs4L.js → repository-import-picker-xEt1JTQh.js} +1 -1
  221. package/dist/client/assets/{repository-picker-BDuRXMxQ.js → repository-picker-_wAGFCw8.js} +1 -1
  222. package/dist/client/assets/{require-capability-BaFiHjJm.js → require-capability-c2x-hAb2.js} +1 -1
  223. package/dist/client/assets/{required-auth-layout-DYUyUBTP.js → required-auth-layout-9CaCzCmK.js} +1 -1
  224. package/dist/client/assets/{reset-password-BZwtg3VF.js → reset-password-D-Q7S-t6.js} +1 -1
  225. package/dist/client/assets/{resizable-D6UZXDc2.js → resizable-DUZ5Fp06.js} +1 -1
  226. package/dist/client/assets/{resolve-tab-icon-DG_iwLVF.js → resolve-tab-icon-N_z8a9nx.js} +1 -1
  227. package/dist/client/assets/{review-settings-CjjMwaAx.js → review-settings-DEkzpUQo.js} +1 -1
  228. package/dist/client/assets/{rich-text-link-control-CqFzbJxy.js → rich-text-link-control-wgMfyyAb.js} +1 -1
  229. package/dist/client/assets/{roles-DRGcrmbe.js → roles-DnLvCVQy.js} +1 -1
  230. package/dist/client/assets/route-B8sxpBnC.js +1 -0
  231. package/dist/client/assets/{route-BhkR_O-0.js → route-BdyjrrEO.js} +1 -1
  232. package/dist/client/assets/{route-DkIAMtp5.js → route-FqdfjqXW.js} +1 -1
  233. package/dist/client/assets/{runnable-block-editor-fyfMhH6V.js → runnable-block-editor-xPDFVXlK.js} +1 -1
  234. package/dist/client/assets/{sandbox-lifecycle-context-DrX5l-5K.js → sandbox-lifecycle-context-D3u8pX2X.js} +1 -1
  235. package/dist/client/assets/{schema-BBcW2anh.js → schema-Cd5rHvlU.js} +1 -1
  236. package/dist/client/assets/{scroll-area-BBLTeXue.js → scroll-area-DYG4mHMK.js} +1 -1
  237. package/dist/client/assets/{search-input-oTBQACCx.js → search-input-CQflA5a-.js} +1 -1
  238. package/dist/client/assets/{search-toggle-BXX7TzWa.js → search-toggle-CiJmR843.js} +1 -1
  239. package/dist/client/assets/{secret-picker-OrYCJEqi.js → secret-picker-Ctn_wc4B.js} +1 -1
  240. package/dist/client/assets/{secrets-B74o_et-.js → secrets-0TS5KONk.js} +1 -1
  241. package/dist/client/assets/{sections-editor-C9jPqZOv.js → sections-editor-g25F6D1o.js} +1 -1
  242. package/dist/client/assets/{select-PSFqlkTM.js → select-CC-cBpVq.js} +1 -1
  243. package/dist/client/assets/{select-model-BP3tXECd.js → select-model-BgCrdVPU.js} +1 -1
  244. package/dist/client/assets/{seo-editor-DqYSllol.js → seo-editor-BZLOy3Ym.js} +1 -1
  245. package/dist/client/assets/{separator-AvIMuaER.js → separator-CtiwlxcW.js} +1 -1
  246. package/dist/client/assets/{settings-tab-C9bNfuVd.js → settings-tab-BHVmz_vd.js} +1 -1
  247. package/dist/client/assets/{sheet-DbmMn_ii.js → sheet-p7htr8B1.js} +1 -1
  248. package/dist/client/assets/{shell-layout-BfhOykQZ.js → shell-layout-znU8dfLI.js} +1 -1
  249. package/dist/client/assets/{skills-B5FUPo9d.js → skills-CURPfnOL.js} +1 -1
  250. package/dist/client/assets/{sso-CHSSVIfl.js → sso-DFLLgebl.js} +1 -1
  251. package/dist/client/assets/{suggestion-DvBjOngJ.js → suggestion-6yTYju-2.js} +1 -1
  252. package/dist/client/assets/{switch-CXpPSeH8.js → switch-By80PO40.js} +1 -1
  253. package/dist/client/assets/{synced-repos-DOJGRaR9.js → synced-repos-CHLq4I2m.js} +1 -1
  254. package/dist/client/assets/{tab-icon-glyph-Btg0LVjZ.js → tab-icon-glyph-B_pElI5g.js} +1 -1
  255. package/dist/client/assets/{table-CtTfXjDZ.js → table-ow3OPohb.js} +1 -1
  256. package/dist/client/assets/{tabs-G-niln3k.js → tabs-B_NYHDVk.js} +1 -1
  257. package/dist/client/assets/{task-board-CRMXz3n1.js → task-board-BoCHCiHL.js} +1 -1
  258. package/dist/client/assets/{task-route-DPhkn4ZD.js → task-route-C_aa_RPA.js} +1 -1
  259. package/dist/client/assets/{task-status-DSm1bkYX.js → task-status-Zk9JczKN.js} +1 -1
  260. package/dist/client/assets/{taskboard-analytics-BMbO7tVP.js → taskboard-analytics-Dhi-x4CE.js} +1 -1
  261. package/dist/client/assets/tasks-BL0HnY0N.js +1 -0
  262. package/dist/client/assets/{tasks-DFbdydCF.js → tasks-DG_jbzgd.js} +1 -1
  263. package/dist/client/assets/{textarea-BJ8_T6kj.js → textarea-Bc3Na4Zg.js} +1 -1
  264. package/dist/client/assets/{thread-analytics-BxcxJsYs.js → thread-analytics-CkfYXVt1.js} +1 -1
  265. package/dist/client/assets/{thread-button-DqELA-UT.js → thread-button-CgRw-DPB.js} +1 -1
  266. package/dist/client/assets/{thread-intent-C8X5ktlA.js → thread-intent-Bwo9Tb6y.js} +1 -1
  267. package/dist/client/assets/{thread-route-AWP4hTSH.js → thread-route-DscdrdSm.js} +1 -1
  268. package/dist/client/assets/{thread-route-DvgzGDGu.js → thread-route-tB6jN0L2.js} +1 -1
  269. package/dist/client/assets/{thread-sheet-body-Ybr5-_Th.js → thread-sheet-body-DhX54ssk.js} +1 -1
  270. package/dist/client/assets/{toggle-group-D4uhQnGP.js → toggle-group-BpqQyGcW.js} +1 -1
  271. package/dist/client/assets/{toolbar-icon-button-BFKlqmai.js → toolbar-icon-button-CIXTKMxv.js} +1 -1
  272. package/dist/client/assets/{tooltip-CMCsIcsS.js → tooltip-Bgl1fAxi.js} +1 -1
  273. package/dist/client/assets/{track-CJNNv07-.js → track-zwiz_A6B.js} +1 -1
  274. package/dist/client/assets/{types-CZAIYuVz.js → types-DSz2eqpq.js} +1 -1
  275. package/dist/client/assets/{usage-stats-CxqpdCji.js → usage-stats-B6WkCKsy.js} +1 -1
  276. package/dist/client/assets/{use-ai-providers-B8JF7TSJ.js → use-ai-providers-b7R9al6L.js} +1 -1
  277. package/dist/client/assets/{use-automations-9PXFtVfy.js → use-automations-CihLtNm4.js} +1 -1
  278. package/dist/client/assets/{use-autosave-CRuKXI8z.js → use-autosave-CWemfCnn.js} +1 -1
  279. package/dist/client/assets/{use-chat-layout-state-CgOfkYao.js → use-chat-layout-state-DvvrnpP7.js} +1 -1
  280. package/dist/client/assets/{use-clock-tick-C2a2oO17.js → use-clock-tick-DAn9rhMX.js} +1 -1
  281. package/dist/client/assets/{use-connect-companion-Ctw-MSpV.js → use-connect-companion-5QXTbLGP.js} +1 -1
  282. package/dist/client/assets/{use-connection-DvNybKFU.js → use-connection-T2ooNFOK.js} +1 -1
  283. package/dist/client/assets/{use-copy-BCqkf684.js → use-copy-Cer_DvZP.js} +1 -1
  284. package/dist/client/assets/{use-create-virtual-mcp-DwZBKhO4.js → use-create-virtual-mcp-DTrLx8jD.js} +1 -1
  285. package/dist/client/assets/{use-date-fns-locale-BEsLqn1p.js → use-date-fns-locale-DeCPPd8H.js} +1 -1
  286. package/dist/client/assets/{use-debounced-autosave-BDq6_yGB.js → use-debounced-autosave-CU1zxcd9.js} +1 -1
  287. package/dist/client/assets/{use-debounced-value-pwchP0rV.js → use-debounced-value-CLZNPNYg.js} +1 -1
  288. package/dist/client/assets/{use-deco-credits-BsxMmBsq.js → use-deco-credits-BDrqLG89.js} +1 -1
  289. package/dist/client/assets/{use-decopilot-events-BDV9lp7g.js → use-decopilot-events-N8vXq82D.js} +1 -1
  290. package/dist/client/assets/{use-delete-connection-Bh8RdOqi.js → use-delete-connection-BAYuQDgc.js} +1 -1
  291. package/dist/client/assets/{use-deployment-admin-BF_BAhyR.js → use-deployment-admin-CVUmuzmU.js} +1 -1
  292. package/dist/client/assets/{use-fast-preview-draft-url-E---BfcR.js → use-fast-preview-draft-url-C7Q5tlLs.js} +1 -1
  293. package/dist/client/assets/{use-file-configs-CZu-bZqB.js → use-file-configs-C9aM8lFc.js} +1 -1
  294. package/dist/client/assets/{use-infinite-scroll-BnSFHDyo.js → use-infinite-scroll-DxRG3Odx.js} +1 -1
  295. package/dist/client/assets/{use-join-requests-BsX2O3TH.js → use-join-requests-g3S1GBN0.js} +1 -1
  296. package/dist/client/assets/{use-main-panel-tabs-Ci7wYJV1.js → use-main-panel-tabs-BS1NCn62.js} +1 -1
  297. package/dist/client/assets/{use-mcp-auth-status-CJu88yT2.js → use-mcp-auth-status-CKNczGWj.js} +1 -1
  298. package/dist/client/assets/{use-mcp-client-B2b2byos.js → use-mcp-client-A77IVsxI.js} +1 -1
  299. package/dist/client/assets/{use-mcp-prompts-D2gSzZBA.js → use-mcp-prompts-Bzy_rF1l.js} +1 -1
  300. package/dist/client/assets/{use-mcp-tools-DpSr2WJO.js → use-mcp-tools-XgrSCkO3.js} +1 -1
  301. package/dist/client/assets/{use-members-Ba5NbSi-.js → use-members-CaS0Ntvk.js} +1 -1
  302. package/dist/client/assets/{use-mobile-DrjH5QWy.js → use-mobile-DNxs9zx_.js} +1 -1
  303. package/dist/client/assets/{use-navigate-to-agent-BnDmIYzi.js → use-navigate-to-agent-B8Tw6lBD.js} +1 -1
  304. package/dist/client/assets/use-new-blocks-editor-BsKR7vcz.js +1 -0
  305. package/dist/client/assets/{use-open-billing-url-PEDdZKq6.js → use-open-billing-url-DrYGAlSe.js} +1 -1
  306. package/dist/client/assets/{use-org-auth-client-C5h3F-Xq.js → use-org-auth-client-BXfCP_SX.js} +1 -1
  307. package/dist/client/assets/{use-org-fs-NLrtNpcZ.js → use-org-fs-Cjw8xggL.js} +1 -1
  308. package/dist/client/assets/{use-org-repo-syncs-BszqDlbi.js → use-org-repo-syncs-4jj4z_0W.js} +1 -1
  309. package/dist/client/assets/{use-org-sso-BJ4-ZYnp.js → use-org-sso-v_RHC6Uu.js} +1 -1
  310. package/dist/client/assets/{use-organization-roles-eMoRxJfR.js → use-organization-roles-DRvYOOs2.js} +1 -1
  311. package/dist/client/assets/{use-organization-settings-CYHzdkln.js → use-organization-settings-1DGLdBJq.js} +1 -1
  312. package/dist/client/assets/{use-panel-navigate-DPo551Yc.js → use-panel-navigate-DuMg6x_K.js} +1 -1
  313. package/dist/client/assets/{use-project-scope-DqbAruKC.js → use-project-scope-B50a346z.js} +1 -1
  314. package/dist/client/assets/{use-releases-BOVKTrsJ.js → use-releases-CjZBu-VF.js} +1 -1
  315. package/dist/client/assets/{use-reports-diagnostic-55PN0uLe.js → use-reports-diagnostic-DCFHDN_E.js} +1 -1
  316. package/dist/client/assets/{use-secrets-CoIpW5Vv.js → use-secrets-CjmTS2ob.js} +1 -1
  317. package/dist/client/assets/{use-section-preview-base-DlIE2buU.js → use-section-preview-base-Dy7gMlm-.js} +1 -1
  318. package/dist/client/assets/{use-session-runtime-DPfz0hqM.js → use-session-runtime-CLmwqP43.js} +1 -1
  319. package/dist/client/assets/{use-tags-BEkYI550.js → use-tags-CTPlgA-X.js} +1 -1
  320. package/dist/client/assets/{use-task-board-analytics-DPTHKKFg.js → use-task-board-analytics-C0o7rS55.js} +1 -1
  321. package/dist/client/assets/{use-task-board-events-8xXEP0g3.js → use-task-board-events-CZLJRGSP.js} +1 -1
  322. package/dist/client/assets/{use-task-metadata-BFr5G8DT.js → use-task-metadata-yam0GxPA.js} +1 -1
  323. package/dist/client/assets/{use-thread-analytics-ChnkVMZ_.js → use-thread-analytics-D8vlPsbf.js} +1 -1
  324. package/dist/client/assets/{use-thread-outputs-BPTyzyCZ.js → use-thread-outputs-8bOBGt9D.js} +1 -1
  325. package/dist/client/assets/useInfiniteQuery-mK_7Bdd0.js +1 -0
  326. package/dist/client/assets/{useQueries-B_vPMY-0.js → useQueries-clqbDuaA.js} +1 -1
  327. package/dist/client/assets/useSuspenseInfiniteQuery-DlwXuQ53.js +1 -0
  328. package/dist/client/assets/{users-TB6DV8rI.js → users-C6XUNB1S.js} +1 -1
  329. package/dist/client/assets/{utils-BTXMZitr.js → utils-rxd5AcRF.js} +1 -1
  330. package/dist/client/assets/{variant-calendar-B69B8SMP.js → variant-calendar-CaJ6M-lI.js} +1 -1
  331. package/dist/client/assets/{variant-matcher-override-CfBblRtM.js → variant-matcher-override-DvDmh02Q.js} +1 -1
  332. package/dist/client/assets/{view-mode-toggle-D7M14JcU.js → view-mode-toggle-CeIqRFVf.js} +1 -1
  333. package/dist/client/assets/{virtual-mcp-CruY_a6o.js → virtual-mcp-CR_Xj7EJ.js} +1 -1
  334. package/dist/client/index.html +2 -2
  335. package/dist/server/cli.js +1 -1
  336. package/dist/server/server.js +1 -1
  337. package/package.json +1 -1
  338. package/dist/client/assets/agent-app-Diwe14GF.js +0 -1
  339. package/dist/client/assets/agent-deck-CbXBzAqF.js +0 -1
  340. package/dist/client/assets/agent-library-C7Hlq-sE.js +0 -1
  341. package/dist/client/assets/agent-library-file-CiQko8Yn.js +0 -1
  342. package/dist/client/assets/agent-settings-DYvMoICn.js +0 -1
  343. package/dist/client/assets/agent-site-editor-code-DeFPvW4J.js +0 -2
  344. package/dist/client/assets/agent-view-BnuKj0ny.js +0 -1
  345. package/dist/client/assets/api-keys-CTKkR1Dq.js +0 -1
  346. package/dist/client/assets/app-editor-dw5EB-b1.js +0 -1
  347. package/dist/client/assets/column-rules-BbslGa4m.js +0 -3
  348. package/dist/client/assets/flat-project-CQrbZkIa.js +0 -1
  349. package/dist/client/assets/index-DXHp6hz_.js +0 -64
  350. package/dist/client/assets/index-KD-5vkyh.css +0 -1
  351. package/dist/client/assets/library-zoJ1ekom.js +0 -1
  352. package/dist/client/assets/project-reports-rKy8N7Ny.js +0 -1
  353. package/dist/client/assets/project-tasks-cuBSqa7p.js +0 -1
  354. package/dist/client/assets/record-editor-CPNxIbj_.js +0 -1
  355. package/dist/client/assets/reports-DNPS3fap.js +0 -1
  356. package/dist/client/assets/route-DlhyTzvL.js +0 -1
  357. package/dist/client/assets/tasks--SO8Qz-Z.js +0 -1
  358. package/dist/client/assets/use-new-blocks-editor-Cukjy9al.js +0 -1
  359. package/dist/client/assets/useInfiniteQuery-CEmUu8UL.js +0 -1
  360. package/dist/client/assets/useSuspenseInfiniteQuery-Dc2ze-DO.js +0 -1
@@ -1,9 +1,9 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-dw5EB-b1.js","assets/index-C4_IsUfP.js","assets/index-KD-5vkyh.css","assets/chat-context-BBhvzmcP.js","assets/use-panel-navigate-DPo551Yc.js","assets/thread-route-AWP4hTSH.js","assets/use-project-scope-DqbAruKC.js","assets/repository-binding-B6lutFQ4.js","assets/use-mcp-client-B2b2byos.js","assets/auth-ffdv9zBE.js","assets/autosend-Dh7jjPXm.js","assets/thread-intent-C8X5ktlA.js","assets/backoff-8mStPHYB.js","assets/task-board-CRMXz3n1.js","assets/schema-BBcW2anh.js","assets/slugify-CEUa2lfQ.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-decopilot-events-BDV9lp7g.js","assets/use-ai-providers-B8JF7TSJ.js","assets/location-DPIrGNp7.js","assets/use-organization-settings-CYHzdkln.js","assets/scroll-area-BBLTeXue.js","assets/select-PSFqlkTM.js","assets/index-CW5Alkje.js","assets/Check-CG-PU97b.js","assets/ChevronUp-C3ZiD_fg.js","assets/use-section-preview-base-DlIE2buU.js","assets/UserSquare-B213f0Cc.js","assets/agent-icon-CP-a92NU.js","assets/AlertCircle-DjwL3HeP.js","assets/Tool01-jLeWFLJf.js","assets/ArrowUp-CuiZciDq.js","assets/ArrowLeft-OKETo1JN.js","assets/LinkBroken01-xH8m8Sus.js","assets/ShoppingBag01-DppHiQvv.js","assets/ZoomOut-C9XmFKHT.js","assets/Building02-Bi6DxRcf.js","assets/CheckCircle-BlkcMEUz.js","assets/Copy01-DojX8qy9.js","assets/CreditCard01-BQvCmNkN.js","assets/DotsVertical-Djr19pIQ.js","assets/Image01-DfuNfbn3.js","assets/Palette-w5zzOUDg.js","assets/XClose-Bv4BxYzr.js","assets/Key01-CJa1302r.js","assets/Link01-CUp58poO.js","assets/LinkExternal01-D6MX3TMO.js","assets/Monitor01-DlAgqW2y.js","assets/Sun-wN9CLbIZ.js","assets/Plus-B-53rDvP.js","assets/SearchMd-BllCVZq9.js","assets/Trash01-COqYNSpe.js","assets/Upload01-Ck_z8fJf.js","assets/User01-CST7ZUYM.js","assets/Users01-BGu5-MW7.js","assets/X-Cof6n_dh.js","assets/dialog-COgKkGMt.js","assets/input-6lxk3V5y.js","assets/use-new-blocks-editor-Cukjy9al.js","assets/claim-phase-copy-CHHxm4AV.js","assets/section-preview-url-7zfngvgW.js","assets/use-session-runtime-DPfz0hqM.js","assets/runnable-block-editor-fyfMhH6V.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-DpCeb_3s.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-B8PaaCi8.js","assets/use-copy-BCqkf684.js","assets/usage-stats-CxqpdCji.js","assets/markdown-DtvdqO22.js","assets/org-file-open-context-6QFXpEgZ.js","assets/use-mobile-DrjH5QWy.js","assets/tooltip-CMCsIcsS.js","assets/use-clock-tick-C2a2oO17.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-D3TWD-wB.js","assets/types-CZAIYuVz.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-B4-iQhqC.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/shell-layout-BfhOykQZ.js","assets/avatar-fmpBdvp6.js","assets/download-app-dialog-BU09bt1-.js","assets/command-kcGesH_1.js","assets/index-BZWRK0v9.js","assets/integration-icon-gYDhAPNi.js","assets/project-icon-D1yuRlQG.js","assets/new-project-dialog-BOZCRvZH.js","assets/label-CgPg1zhc.js","assets/repository-import-picker-B4bNRs4L.js","assets/use-navigate-to-agent-BnDmIYzi.js","assets/repository-picker-BDuRXMxQ.js","assets/useInfiniteQuery-CEmUu8UL.js","assets/infiniteQueryObserver-Cf0bngpS.js","assets/collection-search-zhbgIwPh.js","assets/use-debounced-value-pwchP0rV.js","assets/required-auth-layout-DYUyUBTP.js","assets/use-org-sso-BJ4-ZYnp.js","assets/shell-layout-CE2Eihra.css","assets/sheet-DbmMn_ii.js","assets/use-connection-DvNybKFU.js","assets/use-mcp-prompts-D2gSzZBA.js","assets/index-27xDb8Xc.js","assets/form-Db69kf_B.js","assets/use-thread-outputs-BPTyzyCZ.js","assets/file-type-icon-CWC1YDae.js","assets/popover-dmidPVrf.js","assets/utils-BTXMZitr.js","assets/monaco-editor-By0NuCaO.js","assets/editor-CIHxdT_W.js","assets/calendar-BJt9uDoC.js","assets/textarea-BJ8_T6kj.js","assets/rich-text-link-control-CqFzbJxy.js","assets/switch-CXpPSeH8.js","assets/combobox-gRnDTga1.js","assets/alert-dialog-BGx21FS2.js","assets/sandbox-url-D3mC8qhT.js","assets/search-input-oTBQACCx.js","assets/tabs-G-niln3k.js","assets/use-file-configs-CZu-bZqB.js","assets/asset-utils-BHgp-Y7e.js","assets/use-chat-layout-state-CgOfkYao.js","assets/site-slug-DebpOoQq.js","assets/toggle-group-D4uhQnGP.js","assets/sandbox-git-api-B1R0585s.js","assets/agent-view-guard-DPnTVLre.js","assets/use-main-panel-tabs-Ci7wYJV1.js","assets/use-mcp-tools-DpSr2WJO.js","assets/index-CSzGrExk.js","assets/drawer-B2MRXWND.js","assets/input-Dvx4_YlR.js","assets/chat-draft-Cz6yiaVy.js","assets/use-deco-credits-BsxMmBsq.js","assets/use-open-billing-url-PEDdZKq6.js","assets/decopilot-DYxSzoYy.js","assets/checkbox-CpAb-kkK.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-DPB2qLtL.js","assets/input-Dpl0C33Q.js","assets/suggestion-DvBjOngJ.js","assets/use-org-fs-NLrtNpcZ.js","assets/question-004-sINsf4GQ.js","assets/use-members-Ba5NbSi-.js","assets/use-org-auth-client-C5h3F-Xq.js","assets/feature-paywall-BSrYp3HB.js","assets/plan-ladder-DLN0J7oF.js","assets/add-connection-dialog-Bd-4QkQ3.js","assets/extract-connection-data-98j2I-d4.js","assets/metadata-D72DunRR.js","assets/connection-DNEkOvf2.js","assets/connection-card-BALjxAsf.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-Cb-n9DJ0.js","assets/authenticate-and-persist-oauth-Dzp7mUaZ.js","assets/mcp-oauth-CjHh5FM6.js","assets/collection-tabs-Cnqxbwq8.js","assets/badge-DsoTczsm.js","assets/use-infinite-scroll-BnSFHDyo.js","assets/useSuspenseInfiniteQuery-Dc2ze-DO.js","assets/use-task-board-events-8xXEP0g3.js","assets/input-Bwd_JSM8.css","assets/sandbox-lifecycle-context-DrX5l-5K.js","assets/resolve-tab-icon-DG_iwLVF.js","assets/use-task-metadata-BFr5G8DT.js","assets/virtual-mcp-CruY_a6o.js","assets/feature-gate-B1mBX_Og.js","assets/mustache-DBZS3bdm.js","assets/empty-state-DAKEuegE.js","assets/empty-state-Cjrt4JF2.js","assets/post-editor-YTcyxDjG.js","assets/multi-select-DEu7tNV3.js","assets/block-document-D6rGPUNK.js","assets/index-C1ToZZWO.js","assets/use-fast-preview-draft-url-E---BfcR.js","assets/use-autosave-CRuKXI8z.js","assets/record-editor-CPNxIbj_.js","assets/context-B7ToLfv0.js","assets/index-Ce2VZWO2.js","assets/get-initials-D-f_fDFw.js","assets/icon-button-Bwycj_wq.js","assets/category-editor-0k4-JF4F.js","assets/sections-editor-C9jPqZOv.js","assets/page-seo-form-DKvS6L6D.js","assets/variant-matcher-override-CfBblRtM.js","assets/seo-editor-DqYSllol.js","assets/variant-calendar-B69B8SMP.js","assets/view-mode-toggle-D7M14JcU.js","assets/post-calendar-BjokMhLQ.js","assets/redirect-editor-DrCNsc1H.js"])))=>i.map(i=>d[i]);
2
- import{c as ie,b as je,j as s,m as _o,K as ys,l as ye,r as A,h as at,B as Ee,o as Bo,e as Eo,t as me,a2 as ks,aF as Nt,aN as vt,F as Ft,aG as Ks,H as It,I as Kt,aA as Do,U as Ao,V as Lo,G as Qe,ak as _t,al as fs,ag as $o,X as Oo,u as vn,aL as Ye}from"./index-C4_IsUfP.js";import{A as Ro}from"./agent-view-guard-DPnTVLre.js";import{F as Fo}from"./feature-gate-B1mBX_Og.js";import{u as Qt,b as jn}from"./chat-context-BBhvzmcP.js";import{i as Bt}from"./AlertCircle-DjwL3HeP.js";import{J as Io,V as kn,W as et,X as Sn,Y as Ss,Z as Ko,_ as wn,$ as zo,b as zt,Q as Nn,a0 as Mo,a1 as Vo,a2 as Ct,a3 as Go,a4 as Uo,n as Ho,a5 as qo,a6 as Cn,a7 as Wo,a8 as Yo,a9 as Qo,l as zs,aa as Jo,H as Pn}from"./agent-icon-CP-a92NU.js";import{a as Tn,i as ws,d as Ms}from"./UserSquare-B213f0Cc.js";import{b as _n,i as Bn}from"./ZoomOut-C9XmFKHT.js";import{c as En,i as Xo}from"./XClose-Bv4BxYzr.js";import{s as Ns}from"./Plus-B-53rDvP.js";import{t as Dn}from"./Users01-BGu5-MW7.js";import{f as Zo,e as ea,b as ta,A as sa,a as na,d as oa,c as aa,g as la}from"./alert-dialog-BGx21FS2.js";import{S as Jt}from"./scroll-area-BBLTeXue.js";import{T as He,a as qe,b as We}from"./tooltip-CMCsIcsS.js";import{B as st}from"./badge-DsoTczsm.js";import{S as ps,k as ia,c as ra,g as An,B as hs,P as ca,h as da,n as ua,s as ma,i as Vs,u as Xt,l as fa,o as pa,R as ha,q as Ln,r as ga,t as xa,d as $n,v as ba,w as ya,x as On,y as va,M as ja,j as ka,z as Sa,p as wa,A as Na,C as Ca,e as Pa,f as Ta,D as Gs}from"./runnable-block-editor-fyfMhH6V.js";import{r as Cs,S as _a,t as Ps,i as Ba,w as Ea,x as Da,n as Ot,v as Aa,R as Rn,u as La,y as $a,q as Oa,z as Ra,A as Fa,B as Us,G as Ts,g as Ia,E as Ka,j as Hs,F as za,k as Ma,H as Va,I as qs,h as Ga,J as Fn,m as Ua,K as Ha,L as qa,M as Wa}from"./claim-phase-copy-CHHxm4AV.js";import{u as In,P as Ya}from"./mustache-DBZS3bdm.js";import{n as Kn}from"./ShoppingBag01-DppHiQvv.js";import{t as ft}from"./ChevronUp-C3ZiD_fg.js";import{C as Qa,a as Ja,b as Xa}from"./collapsible-B8PaaCi8.js";import{c as Za,d as el}from"./sandbox-lifecycle-context-DrX5l-5K.js";import{u as zn}from"./use-session-runtime-DPfz0hqM.js";import{c as pt,d as lt,e as ht,b as it,D as rt,h as Mt,a as tl}from"./dialog-COgKkGMt.js";import{I as Xe}from"./input-6lxk3V5y.js";import{C as Zt}from"./checkbox-CpAb-kkK.js";import{L as ze}from"./label-CgPg1zhc.js";import{c as sl,b as nl,a as ol,d as al,S as ll}from"./select-PSFqlkTM.js";import{o as il}from"./sandbox-git-api-B1R0585s.js";import{b as Ws}from"./sandbox-url-D3mC8qhT.js";import{a as Ys}from"./utils-BTXMZitr.js";import{i as rl}from"./CheckCircle-BlkcMEUz.js";import{a as _s}from"./Copy01-DojX8qy9.js";import{s as Bs}from"./Trash01-COqYNSpe.js";import{i as gs}from"./Upload01-Ck_z8fJf.js";import{E as cl}from"./empty-state-DAKEuegE.js";import{T as Rt}from"./textarea-BJ8_T6kj.js";import{u as dl}from"./use-ai-providers-B8JF7TSJ.js";import{M as Mn}from"./monaco-editor-By0NuCaO.js";import{i as Es}from"./X-Cof6n_dh.js";import{f as Vn,a as ul}from"./repository-binding-B6lutFQ4.js";import"./rich-text-link-control-CqFzbJxy.js";import{c as ml}from"./Tool01-jLeWFLJf.js";import{b as Qs}from"./use-project-scope-DqbAruKC.js";import{E as fl}from"./empty-state-Cjrt4JF2.js";import{G as Js}from"./repository-picker-BDuRXMxQ.js";import{R as pl}from"./repository-import-picker-B4bNRs4L.js";import{b as hl}from"./thread-route-AWP4hTSH.js";function gl(n){const e=ie.c(18),{title:t,description:o,children:a}=n,l=je();let i;e[0]!==a?(i=s.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Io,{}),e[2]=c):c=e[2];let r;e[3]!==l?(r=l("common.soon"),e[3]=l,e[4]=r):r=e[4];let d;e[5]!==r?(d=s.jsxs(st,{variant:"secondary",children:[c,r]}),e[5]=r,e[6]=d):d=e[6];let h;e[7]!==t?(h=s.jsx("p",{className:"text-base font-semibold text-foreground",children:t}),e[7]=t,e[8]=h):h=e[8];let m;e[9]!==o?(m=o&&s.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=m):m=e[10];let f;e[11]!==d||e[12]!==h||e[13]!==m?(f=s.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:s.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,h,m]})}),e[11]=d,e[12]=h,e[13]=m,e[14]=f):f=e[14];let u;return e[15]!==i||e[16]!==f?(u=s.jsxs("div",{className:"relative h-full min-h-0",children:[i,f]}),e[15]=i,e[16]=f,e[17]=u):u=e[17],u}function xl(n,e){if(!n||!e?.length)return n;const t=Object.fromEntries(Object.entries(n.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(t).length>0?{...n,properties:t}:n}function bl(n,e,t){return typeof n!="string"?null:xl(Cs(n,e),t)}function Gn(n,e,t){if(!e||typeof n!="string")return!1;const o=bl(n,e,t);return!!o&&Object.keys(o.properties??{}).length>0}function jt(n){const e=ie.c(6),{hasItems:t,emptyLabel:o,emptyHint:a}=n;let l;e[0]!==a||e[1]!==o||e[2]!==t?(l=t?"No results match your search.":s.jsxs(s.Fragment,{children:[s.jsx("div",{children:o}),s.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=t,e[3]=l):l=e[3];let i;return e[4]!==l?(i=s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function es(n,e){return`${n}-${e}`}function Un(n,e){return`site/apps/${n}/${e}.ts`}function Hn(n){const e=n.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const t=n.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return t?{vendor:t[1],app:t[2]}:null}function yl(n){const e=n.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function vl(n){return n==="local"?"Custom":"Installed"}function qn(n,e,t){const o=new Set([es(n,e),e].map(l=>l.toLowerCase())),a=Un(n,e);for(const[l,i]of Object.entries(t)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=i;if(o.has(l.toLowerCase())||c.__resolveType===a)return l}return null}function jl(n,e){const t=n.vendor.alias,o=n.name,a=qn(t,o,e);return{id:es(t,o),app:o,vendor:t,title:n.title||n.name,description:n.description,category:n.category??"Other",logo:n.logo||void 0,resolveType:Un(t,o),blockKey:a,installed:a!==null}}function kl(n,e,t){if(n===_a)return null;const o=Hn(n);if(!o)return null;const{vendor:a,app:l}=o,i=qn(a,l,t),c=Ps(n,e);return{id:es(a,l),app:l,vendor:a,title:c.title??l,description:c.description??"",category:"Others",logo:c.logo??c.icon,resolveType:n,blockKey:i,installed:i!==null}}function Sl(n,e,t){const o=e.__resolveType;if(typeof o!="string"||Ba(n,e)||!Ea(o))return null;const a=Hn(o)??yl(n);if(!a)return null;const l=Ps(o,t),{vendor:i,app:c}=a;return{id:es(i,c),app:c,vendor:i,title:l.title??Da(n,e,t),description:l.description??"",category:vl(i),logo:l.logo??l.icon,resolveType:o,blockKey:n,installed:!0}}function wl(n,e,t){const o=new Map;for(const l of n){const i=jl(l,t);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=kl(l,e,t);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(t)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=Sl(l,i,e);!c||o.has(c.id)||o.set(c.id,c)}return[...o.values()].sort(Nl)}function Nl(n,e){return n.installed!==e.installed?n.installed?-1:1:n.title.localeCompare(e.title)}async function Cl(){const n=await fetch("/api/deco-apps");if(!n.ok)throw new Error(`Failed to fetch deco apps: ${n.status}`);return(await n.json()).apps??[]}function Pl(n,e,t){const o=ie.c(12),a=t?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=ys.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:Cl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const c=_o(i);let r;o[3]!==e||o[4]!==n||o[5]!==c.data?(r=n&&e?wl(c.data??[],n,e):[],o[3]=e,o[4]=n,o[5]=c.data,o[6]=r):r=o[6];const d=r,h=c.isLoading&&!c.isError;let m;return o[7]!==d||o[8]!==c.isError||o[9]!==c.refetch||o[10]!==h?(m={catalog:d,isLoading:h,isError:c.isError,refetch:c.refetch},o[7]=d,o[8]=c.isError,o[9]=c.refetch,o[10]=h,o[11]=m):m=o[11],m}const Tl=["sections","apps","loaders","actions"];function _l(n){const e=ie.c(59),{active:t,counts:o,showBlog:a,onSelect:l}=n,i=je();let c;e[0]!==i?(c=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=s.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:s.jsx("span",{className:"text-sm font-medium",children:c})}),e[2]=c,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const h=t==="pages";let m;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==h?(m=s.jsx(Fe,{id:"pages",icon:Tn,label:d,count:o.pages,active:h,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=h,e[10]=m):m=e[10];let f;e[11]!==i?(f=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=f):f=e[12];const u=t==="redirects";let p;e[13]!==o.redirects||e[14]!==l||e[15]!==f||e[16]!==u?(p=s.jsx(Fe,{id:"redirects",icon:kn,label:f,count:o.redirects,active:u,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=f,e[16]=u,e[17]=p):p=e[17];let b;e[18]!==i?(b=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=b):b=e[19];const g=t==="site";let v;e[20]!==l||e[21]!==g||e[22]!==b?(v=s.jsx(Fe,{id:"site",icon:Ko,label:b,active:g,onSelect:l}),e[20]=l,e[21]=g,e[22]=b,e[23]=v):v=e[23];let y;e[24]!==i?(y=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=y):y=e[25];const k=t==="seo";let S;e[26]!==l||e[27]!==y||e[28]!==k?(S=s.jsx(Fe,{id:"seo",icon:wn,label:y,active:k,onSelect:l}),e[26]=l,e[27]=y,e[28]=k,e[29]=S):S=e[29];let N;e[30]!==i?(N=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=N):N=e[31];const B=t==="calendar";let E;e[32]!==l||e[33]!==N||e[34]!==B?(E=s.jsx(Fe,{id:"calendar",icon:zo,label:N,active:B,onSelect:l}),e[32]=l,e[33]=N,e[34]=B,e[35]=E):E=e[35];let w;e[36]!==t||e[37]!==o||e[38]!==l?(w=s.jsx(Bl,{active:t,counts:o,onSelect:l}),e[36]=t,e[37]=o,e[38]=l,e[39]=w):w=e[39];let T;e[40]!==t||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(T=a&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[s.jsx(Kn,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),s.jsx(Fe,{id:"context",icon:et,label:i("sandbox.collectionsSidebar.context"),active:t==="context",onSelect:l}),s.jsx(Fe,{id:"posts",icon:_n,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:t==="posts",onSelect:l}),s.jsx(Fe,{id:"authors",icon:Dn,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:t==="authors",onSelect:l}),s.jsx(Fe,{id:"categories",icon:Sn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:t==="categories",onSelect:l}),s.jsx(Fe,{id:"post-schedule",icon:Ss,label:i("sandbox.collectionsSidebar.postSchedule"),active:t==="post-schedule",onSelect:l})]}),e[40]=t,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=T):T=e[47];let R;e[48]!==v||e[49]!==S||e[50]!==E||e[51]!==w||e[52]!==T||e[53]!==m||e[54]!==p?(R=s.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[m,p,v,S,E,w,T]}),e[48]=v,e[49]=S,e[50]=E,e[51]=w,e[52]=T,e[53]=m,e[54]=p,e[55]=R):R=e[55];let L;return e[56]!==r||e[57]!==R?(L=s.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[r,R]}),e[56]=r,e[57]=R,e[58]=L):L=e[58],L}function Bl(n){const e=ie.c(52),{active:t,counts:o,onSelect:a}=n,l=je();let i;e[0]!==t?(i=Tl.includes(t),e[0]=t,e[1]=i):i=e[1];const c=i,[r,d]=A.useState(!1),h=r||c;let m,f;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=ye("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),f=s.jsx(Mo,{size:16,className:"shrink-0"}),e[2]=m,e[3]=f):(m=e[2],f=e[3]);let u;e[4]!==l?(u=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=u):u=e[5];let p;e[6]!==u?(p=s.jsx("span",{className:"flex-1 truncate",children:u}),e[6]=u,e[7]=p):p=e[7];const b=h&&"rotate-180";let g;e[8]!==b?(g=ye("shrink-0 text-muted-foreground/70 transition-transform",b),e[8]=b,e[9]=g):g=e[9];let v;e[10]!==g?(v=s.jsx(ft,{size:16,className:g}),e[10]=g,e[11]=v):v=e[11];let y;e[12]!==p||e[13]!==v?(y=s.jsxs(Qa,{className:m,children:[f,p,v]}),e[12]=p,e[13]=v,e[14]=y):y=e[14];let k;e[15]!==l?(k=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=k):k=e[16];const S=t==="sections";let N;e[17]!==o.sections||e[18]!==a||e[19]!==k||e[20]!==S?(N=s.jsx(Fe,{id:"sections",icon:zt,label:k,count:o.sections,active:S,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=k,e[20]=S,e[21]=N):N=e[21];let B;e[22]!==l?(B=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=B):B=e[23];const E=t==="apps";let w;e[24]!==o.apps||e[25]!==a||e[26]!==B||e[27]!==E?(w=s.jsx(Fe,{id:"apps",icon:En,label:B,count:o.apps,active:E,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=B,e[27]=E,e[28]=w):w=e[28];let T;e[29]!==l?(T=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=T):T=e[30];const R=t==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==T||e[34]!==R?(L=s.jsx(Fe,{id:"loaders",icon:Nn,label:T,count:o.loaders,active:R,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=T,e[34]=R,e[35]=L):L=e[35];let G;e[36]!==l?(G=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=G):G=e[37];const F=t==="actions";let _;e[38]!==o.actions||e[39]!==a||e[40]!==G||e[41]!==F?(_=s.jsx(Fe,{id:"actions",icon:Bn,label:G,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=G,e[41]=F,e[42]=_):_=e[42];let $;e[43]!==N||e[44]!==w||e[45]!==L||e[46]!==_?($=s.jsxs(Ja,{className:"flex flex-col gap-0.5 pt-0.5",children:[N,w,L,_]}),e[43]=N,e[44]=w,e[45]=L,e[46]=_,e[47]=$):$=e[47];let K;return e[48]!==h||e[49]!==$||e[50]!==y?(K=s.jsxs(Xa,{open:h,onOpenChange:d,children:[y,$]}),e[48]=h,e[49]=$,e[50]=y,e[51]=K):K=e[51],K}function Fe(n){const e=ie.c(19),{id:t,icon:o,label:a,count:l,active:i,onSelect:c,indent:r}=n;let d;e[0]!==t||e[1]!==c?(d=()=>c(t),e[0]=t,e[1]=c,e[2]=d):d=e[2];const h=r&&"pl-6",m=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let f;e[3]!==h||e[4]!==m?(f=ye("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",h,m),e[3]=h,e[4]=m,e[5]=f):f=e[5];let u;e[6]!==o?(u=s.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=u):u=e[7];let p;e[8]!==a?(p=s.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=p):p=e[9];let b;e[10]!==i||e[11]!==l?(b=l!==void 0&&s.jsx("span",{className:ye("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=b):b=e[12];let g;return e[13]!==d||e[14]!==f||e[15]!==u||e[16]!==p||e[17]!==b?(g=s.jsxs("button",{type:"button",onClick:d,className:f,children:[u,p,b]}),e[13]=d,e[14]=f,e[15]=u,e[16]=p,e[17]=b,e[18]=g):g=e[18],g}function El(n){const e=ie.c(12),{state:t,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=n;switch(t.kind){case"starting":{let c;e[0]!==o||e[1]!==a?(c=ia({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==c?(r=s.jsx(ps,{kind:"starting",progress:c,claimPhase:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5],r}case"suspended":{let c;return e[6]!==l?(c=s.jsx(ps,{kind:"suspended",onResume:l}),e[6]=l,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==i||e[9]!==l||e[10]!==t.error?(c=s.jsx(ps,{kind:"errored",error:t.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=t.error,e[11]=c):c=e[11],c}}}const Dl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Al(n){if(n.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(n.previewState.kind!=="iframe")return{kind:"sandbox-card",state:n.previewState};const e=n.lifecyclePhase==="running",t=!e&&!Dl.has(n.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:t}}function Xs(n,e){const t=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${t} (copy)`;if(!n.has(o))return o;for(let a=2;a<1e3;a++){const l=`${t} (copy ${a})`;if(!n.has(l))return l}return`${t} (copy ${Date.now()})`}function Ll(n,e){const t=Ot,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!n.has(t(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!n.has(t(i)))return i}return`${o}-copy-${Date.now()}`}function $l(n,e){const t=e.replace(/_copy(?:_\d+)?$/,""),o=`${t}_copy`;if(!Object.hasOwn(n,o))return o;for(let a=2;a<1e3;a++){const l=`${t}_copy_${a}`;if(!Object.hasOwn(n,l))return l}return`${t}_copy_${Date.now()}`}function Ol(n){const e=An(n.newName),t={...n.source,name:n.newName,path:n.newPath};return{key:e,data:t}}function Rl(n,e){return ra(n,e)}const Fl=1e3;function Il(n,e){for(let t=0;t<Fl;t++){const o=An(e);if(!Object.hasOwn(n,o))return o}throw new Error("Could not generate a unique page block key")}const Kl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},zl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Ml={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Vl(n){const e=ie.c(88),{open:t,mode:o,initialName:a,initialPath:l,isPending:i,error:c,templates:r,validate:d,onSubmit:h,onOpenChange:m}=n,f=i===void 0?!1:i,u=je(),[p,b]=A.useState(a),[g,v]=A.useState(l),[y,k]=A.useState(hs),[S,N]=A.useState(null),[B,E]=A.useState(t);t!==B&&(E(t),t&&(b(a),v(l),k(hs),N(null)));const w=o==="create"&&!!r?.length;let T;e[0]!==f||e[1]!==m?(T=he=>{!he&&!f&&(N(null),m(!1))},e[0]=f,e[1]=m,e[2]=T):T=e[2];const R=T;let L;e[3]!==f||e[4]!==p||e[5]!==h||e[6]!==g||e[7]!==w||e[8]!==y||e[9]!==d?(L=async he=>{he.preventDefault();const ve=p.trim(),ge=g.trim();if(!ve||!ge||f)return;const De=Aa(ge);if(De){N(De);return}const ke=d?.({name:ve,path:ge});if(ke){N(ke);return}N(null),await h({name:ve,path:ge,templateKey:w&&y!==hs?y:null})},e[3]=f,e[4]=p,e[5]=h,e[6]=g,e[7]=w,e[8]=y,e[9]=d,e[10]=L):L=e[10];const G=L,F=S??c,_=Kl[o];let $;e[11]!==u||e[12]!==_?($=u(_),e[11]=u,e[12]=_,e[13]=$):$=e[13];let K;e[14]!==$?(K=s.jsx(pt,{children:s.jsx(lt,{children:$})}),e[14]=$,e[15]=K):K=e[15];let z;e[16]!==f||e[17]!==w||e[18]!==u||e[19]!==y||e[20]!==r?(z=w&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),s.jsx(ca,{id:"page-form-template",value:y,onChange:k,templates:r??[],disabled:f})]}),e[16]=f,e[17]=w,e[18]=u,e[19]=y,e[20]=r,e[21]=z):z=e[21];let M;e[22]!==u?(M=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=M):M=e[23];let W;e[24]!==M?(W=s.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:M}),e[24]=M,e[25]=W):W=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=he=>b(he.target.value),e[26]=O):O=e[26];let I;e[27]!==u?(I=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=I):I=e[28];let D;e[29]!==f||e[30]!==p||e[31]!==I?(D=s.jsx(Xe,{id:"page-form-name",value:p,onChange:O,placeholder:I,autoFocus:!0,disabled:f}),e[29]=f,e[30]=p,e[31]=I,e[32]=D):D=e[32];let U;e[33]!==D||e[34]!==W?(U=s.jsxs("div",{className:"space-y-1.5",children:[W,D]}),e[33]=D,e[34]=W,e[35]=U):U=e[35];let X;e[36]!==u?(X=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=X):X=e[37];let ee;e[38]!==X?(ee=s.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:X}),e[38]=X,e[39]=ee):ee=e[39];let te;e[40]===Symbol.for("react.memo_cache_sentinel")?(te=he=>v(he.target.value),e[40]=te):te=e[40];let re;e[41]!==u?(re=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=re):re=e[42];let Z;e[43]!==f||e[44]!==g||e[45]!==re?(Z=s.jsx(Xe,{id:"page-form-path",value:g,onChange:te,placeholder:re,disabled:f}),e[43]=f,e[44]=g,e[45]=re,e[46]=Z):Z=e[46];let ae;e[47]!==ee||e[48]!==Z?(ae=s.jsxs("div",{className:"space-y-1.5",children:[ee,Z]}),e[47]=ee,e[48]=Z,e[49]=ae):ae=e[49];let le;e[50]!==F?(le=F&&s.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=le):le=e[51];let oe;e[52]!==U||e[53]!==ae||e[54]!==le||e[55]!==z?(oe=s.jsxs("div",{className:"space-y-4 py-4",children:[z,U,ae,le]}),e[52]=U,e[53]=ae,e[54]=le,e[55]=z,e[56]=oe):oe=e[56];let P;e[57]!==m?(P=()=>m(!1),e[57]=m,e[58]=P):P=e[58];let q;e[59]!==u?(q=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=q):q=e[60];let ne;e[61]!==f||e[62]!==P||e[63]!==q?(ne=s.jsx(Ee,{type:"button",variant:"outline",onClick:P,disabled:f,children:q}),e[61]=f,e[62]=P,e[63]=q,e[64]=ne):ne=e[64];let se;e[65]!==f||e[66]!==p||e[67]!==g?(se=!p.trim()||!g.trim()||f,e[65]=f,e[66]=p,e[67]=g,e[68]=se):se=e[68];let ce;e[69]!==f||e[70]!==o||e[71]!==u?(ce=f?s.jsxs(s.Fragment,{children:[s.jsx(at,{className:"size-3.5"}),u(Ml[o])]}):u(zl[o]),e[69]=f,e[70]=o,e[71]=u,e[72]=ce):ce=e[72];let ue;e[73]!==se||e[74]!==ce?(ue=s.jsx(Ee,{type:"submit",disabled:se,children:ce}),e[73]=se,e[74]=ce,e[75]=ue):ue=e[75];let j;e[76]!==ne||e[77]!==ue?(j=s.jsxs(ht,{children:[ne,ue]}),e[76]=ne,e[77]=ue,e[78]=j):j=e[78];let V;e[79]!==G||e[80]!==oe||e[81]!==j||e[82]!==K?(V=s.jsx(it,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:G,children:[K,oe,j]})}),e[79]=G,e[80]=oe,e[81]=j,e[82]=K,e[83]=V):V=e[83];let fe;return e[84]!==R||e[85]!==t||e[86]!==V?(fe=s.jsx(rt,{open:t,onOpenChange:R,children:V}),e[84]=R,e[85]=t,e[86]=V,e[87]=fe):fe=e[87],fe}const Gl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Zs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Ul(n){const e=ie.c(111),{open:t,isPending:o,error:a,onSubmit:l,onOpenChange:i}=n,c=o===void 0?!1:o,r=je(),[d,h]=A.useState(Zs),[m,f]=A.useState(null),[u,p]=A.useState(t);t!==u&&(p(t),t&&(h(Zs),f(null)));let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=be=>h(Le=>({...Le,...be})),e[0]=b):b=e[0];const g=b;let v;e[1]!==c||e[2]!==i?(v=be=>{!be&&!c&&(f(null),i(!1))},e[1]=c,e[2]=i,e[3]=v):v=e[3];const y=v;let k;e[4]!==c||e[5]!==l||e[6]!==d||e[7]!==r?(k=async be=>{be.preventDefault();const Le=d.from.trim(),Ie=d.to.trim();if(!Le||!Ie||c){f(r("sandbox.redirectFormDialog.errorRequired"));return}f(null),await l({...d,from:Le,to:Ie})},e[4]=c,e[5]=l,e[6]=d,e[7]=r,e[8]=k):k=e[8];const S=k,N=m??a;let B;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(B=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=B):B=e[12];const E=B;let w;e[13]!==r?(w=r("sandbox.redirectFormDialog.title"),e[13]=r,e[14]=w):w=e[14];let T;e[15]!==w?(T=s.jsx(pt,{children:s.jsx(lt,{children:w})}),e[15]=w,e[16]=T):T=e[16];let R;e[17]!==r?(R=r("sandbox.redirectEditor.fromLabel"),e[17]=r,e[18]=R):R=e[18];let L;e[19]!==R?(L=s.jsx(ze,{htmlFor:"redirect-form-from",children:R}),e[19]=R,e[20]=L):L=e[20];const G=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=be=>g({from:be.target.value}),e[21]=F):F=e[21];let _;e[22]!==r?(_=r("sandbox.redirectEditor.fromPlaceholder"),e[22]=r,e[23]=_):_=e[23];let $;e[24]!==c||e[25]!==d.from||e[26]!==_?($=s.jsx(Xe,{id:"redirect-form-from",value:G,onChange:F,placeholder:_,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=_,e[27]=$):$=e[27];let K;e[28]!==$||e[29]!==L?(K=s.jsxs("div",{className:"space-y-1.5",children:[L,$]}),e[28]=$,e[29]=L,e[30]=K):K=e[30];let z;e[31]!==r?(z=r("sandbox.redirectEditor.toLabel"),e[31]=r,e[32]=z):z=e[32];let M;e[33]!==z?(M=s.jsx(ze,{htmlFor:"redirect-form-to",children:z}),e[33]=z,e[34]=M):M=e[34];const W=d.to;let O;e[35]===Symbol.for("react.memo_cache_sentinel")?(O=be=>g({to:be.target.value}),e[35]=O):O=e[35];let I;e[36]!==r?(I=r("sandbox.redirectEditor.toPlaceholder"),e[36]=r,e[37]=I):I=e[37];let D;e[38]!==c||e[39]!==d.to||e[40]!==I?(D=s.jsx(Xe,{id:"redirect-form-to",value:W,onChange:O,placeholder:I,disabled:c}),e[38]=c,e[39]=d.to,e[40]=I,e[41]=D):D=e[41];let U;e[42]!==M||e[43]!==D?(U=s.jsxs("div",{className:"space-y-1.5",children:[M,D]}),e[42]=M,e[43]=D,e[44]=U):U=e[44];let X;e[45]!==r?(X=r("sandbox.redirectEditor.typeLabel"),e[45]=r,e[46]=X):X=e[46];let ee;e[47]!==X?(ee=s.jsx(ze,{htmlFor:"redirect-form-type",children:X}),e[47]=X,e[48]=ee):ee=e[48];const te=d.type;let re;e[49]===Symbol.for("react.memo_cache_sentinel")?(re=be=>g({type:be}),e[49]=re):re=e[49];let Z;e[50]!==r?(Z=r("sandbox.redirectEditor.typePlaceholder"),e[50]=r,e[51]=Z):Z=e[51];let ae;e[52]!==Z?(ae=s.jsx(nl,{id:"redirect-form-type",className:"w-full",children:s.jsx(ol,{placeholder:Z})}),e[52]=Z,e[53]=ae):ae=e[53];let le;e[54]!==r?(le=Gl.map(be=>s.jsx(sl,{value:be.value,children:r(be.labelKey,{status:Rn[be.value]})},be.value)),e[54]=r,e[55]=le):le=e[55];let oe;e[56]!==le?(oe=s.jsx(al,{children:le}),e[56]=le,e[57]=oe):oe=e[57];let P;e[58]!==c||e[59]!==d.type||e[60]!==ae||e[61]!==oe?(P=s.jsxs(ll,{value:te,onValueChange:re,disabled:c,children:[ae,oe]}),e[58]=c,e[59]=d.type,e[60]=ae,e[61]=oe,e[62]=P):P=e[62];let q;e[63]!==ee||e[64]!==P?(q=s.jsxs("div",{className:"space-y-1.5",children:[ee,P]}),e[63]=ee,e[64]=P,e[65]=q):q=e[65];let ne;e[66]===Symbol.for("react.memo_cache_sentinel")?(ne=be=>g({discardQueryParameters:be===!0}),e[66]=ne):ne=e[66];let se;e[67]!==c||e[68]!==d.discardQueryParameters?(se=s.jsx(Zt,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:ne}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=se):se=e[69];let ce;e[70]!==r?(ce=r("sandbox.redirectEditor.discardQueryParameters"),e[70]=r,e[71]=ce):ce=e[71];let ue;e[72]!==ce?(ue=s.jsx("span",{className:"text-sm",children:ce}),e[72]=ce,e[73]=ue):ue=e[73];let j;e[74]!==se||e[75]!==ue?(j=s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[se,ue]}),e[74]=se,e[75]=ue,e[76]=j):j=e[76];let V;e[77]!==N?(V=N&&s.jsx("p",{className:"text-xs text-destructive",children:N}),e[77]=N,e[78]=V):V=e[78];let fe;e[79]!==K||e[80]!==U||e[81]!==q||e[82]!==j||e[83]!==V?(fe=s.jsxs("div",{className:"space-y-4 py-4",children:[K,U,q,j,V]}),e[79]=K,e[80]=U,e[81]=q,e[82]=j,e[83]=V,e[84]=fe):fe=e[84];let he;e[85]!==i?(he=()=>i(!1),e[85]=i,e[86]=he):he=e[86];let ve;e[87]!==r?(ve=r("sandbox.redirectFormDialog.cancel"),e[87]=r,e[88]=ve):ve=e[88];let ge;e[89]!==c||e[90]!==he||e[91]!==ve?(ge=s.jsx(Ee,{type:"button",variant:"outline",onClick:he,disabled:c,children:ve}),e[89]=c,e[90]=he,e[91]=ve,e[92]=ge):ge=e[92];const De=!E;let ke;e[93]!==c||e[94]!==r?(ke=c?s.jsxs(s.Fragment,{children:[s.jsx(at,{className:"size-3.5"}),r("sandbox.redirectFormDialog.pending")]}):r("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=r,e[95]=ke):ke=e[95];let Ce;e[96]!==De||e[97]!==ke?(Ce=s.jsx(Ee,{type:"submit",disabled:De,children:ke}),e[96]=De,e[97]=ke,e[98]=Ce):Ce=e[98];let Pe;e[99]!==ge||e[100]!==Ce?(Pe=s.jsxs(ht,{children:[ge,Ce]}),e[99]=ge,e[100]=Ce,e[101]=Pe):Pe=e[101];let Te;e[102]!==S||e[103]!==fe||e[104]!==Pe||e[105]!==T?(Te=s.jsx(it,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:S,children:[T,fe,Pe]})}),e[102]=S,e[103]=fe,e[104]=Pe,e[105]=T,e[106]=Te):Te=e[106];let Ae;return e[107]!==y||e[108]!==t||e[109]!==Te?(Ae=s.jsx(rt,{open:t,onOpenChange:y,children:Te}),e[107]=y,e[108]=t,e[109]=Te,e[110]=Ae):Ae=e[110],Ae}function Hl(n){const e=ie.c(70),{open:t,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:c}=n,r=l===void 0?!1:l,d=je(),[h,m]=A.useState(a),[f,u]=A.useState(t);t!==f&&(u(t),t&&m(a));let p;e[0]!==r||e[1]!==c?(p=te=>{!te&&!r&&c(!1)},e[0]=r,e[1]=c,e[2]=p):p=e[2];const b=p;let g;e[3]!==r||e[4]!==h||e[5]!==i?(g=async te=>{te.preventDefault();const re=h.trim();!re||r||await i(re)},e[3]=r,e[4]=h,e[5]=i,e[6]=g):g=e[6];const v=g;let y;e[7]!==d?(y=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=y):y=e[8];let k;e[9]!==y?(k=s.jsx(lt,{children:y}),e[9]=y,e[10]=k):k=e[10];let S;e[11]!==d?(S=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=S):S=e[12];let N;e[13]!==S?(N=s.jsx(Mt,{children:S}),e[13]=S,e[14]=N):N=e[14];let B;e[15]!==k||e[16]!==N?(B=s.jsxs(pt,{children:[k,N]}),e[15]=k,e[16]=N,e[17]=B):B=e[17];let E;e[18]!==d?(E=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=E):E=e[19];let w;e[20]!==E?(w=s.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[20]=E,e[21]=w):w=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=te=>m(te.target.value),e[22]=T):T=e[22];let R;e[23]!==r||e[24]!==h?(R=s.jsx(Xe,{id:"section-rename-name",value:h,onChange:T,autoFocus:!0,disabled:r}),e[23]=r,e[24]=h,e[25]=R):R=e[25];let L;e[26]!==w||e[27]!==R?(L=s.jsxs("div",{className:"space-y-1.5",children:[w,R]}),e[26]=w,e[27]=R,e[28]=L):L=e[28];let G;e[29]!==d?(G=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=G):G=e[30];let F;e[31]!==G?(F=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:G}),e[31]=G,e[32]=F):F=e[32];let _;e[33]!==o?(_=s.jsx(Xe,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=_):_=e[34];let $;e[35]!==F||e[36]!==_?($=s.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[35]=F,e[36]=_,e[37]=$):$=e[37];let K;e[38]!==L||e[39]!==$?(K=s.jsxs("div",{className:"space-y-4 py-4",children:[L,$]}),e[38]=L,e[39]=$,e[40]=K):K=e[40];let z;e[41]!==c?(z=()=>c(!1),e[41]=c,e[42]=z):z=e[42];let M;e[43]!==d?(M=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=M):M=e[44];let W;e[45]!==r||e[46]!==z||e[47]!==M?(W=s.jsx(Ee,{type:"button",variant:"outline",onClick:z,disabled:r,children:M}),e[45]=r,e[46]=z,e[47]=M,e[48]=W):W=e[48];let O;e[49]!==r||e[50]!==h?(O=!h.trim()||r,e[49]=r,e[50]=h,e[51]=O):O=e[51];let I;e[52]!==r||e[53]!==d?(I=r?s.jsxs(s.Fragment,{children:[s.jsx(at,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=r,e[53]=d,e[54]=I):I=e[54];let D;e[55]!==O||e[56]!==I?(D=s.jsx(Ee,{type:"submit",disabled:O,children:I}),e[55]=O,e[56]=I,e[57]=D):D=e[57];let U;e[58]!==W||e[59]!==D?(U=s.jsxs(ht,{children:[W,D]}),e[58]=W,e[59]=D,e[60]=U):U=e[60];let X;e[61]!==v||e[62]!==K||e[63]!==U||e[64]!==B?(X=s.jsx(it,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:v,children:[B,K,U]})}),e[61]=v,e[62]=K,e[63]=U,e[64]=B,e[65]=X):X=e[65];let ee;return e[66]!==b||e[67]!==t||e[68]!==X?(ee=s.jsx(rt,{open:t,onOpenChange:b,children:X}),e[66]=b,e[67]=t,e[68]=X,e[69]=ee):ee=e[69],ee}function ql(n){const e=ie.c(7),{type:t}=n,o=Rn[t];let a;e[0]!==o?(a=s.jsx(He,{asChild:!0,children:s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=a):a=e[1];const l=t==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=s.jsx(qe,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=s.jsxs(We,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c}const Wl=60,xs={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},Ds=["posts","authors","categories"],Pt={posts:"post",authors:"author",categories:"category"};function ot(n){return Ds.includes(n)}const ts={posts:"post",authors:"author",categories:"category"},Wn={posts:xs.post,authors:xs.author,categories:xs.category},Yl=Object.fromEntries(Object.entries(Wn).map(([n,e])=>[e,n]));function Ql(n){return typeof n=="string"?Yl[n]??null:null}function Oe(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function Q(n){return typeof n=="string"?n:""}function Jl(n,e){switch(n){case"posts":return{label:Q(e.title)||"Untitled post",subtitle:Q(e.slug),missing:ss(e)};case"authors":return{label:Q(e.name)||"Unnamed author",subtitle:Q(e.email),missing:[]};case"categories":return{label:Q(e.name)||"Unnamed category",subtitle:Q(e.slug),slug:Q(e.slug),parentSlug:Q(e.parentSlug),missing:ii(e)};default:{const t=n;throw new Error(`Unhandled blog kind: ${String(t)}`)}}}function Yn(n){const e={posts:[],authors:[],categories:[]},t=[];for(const[o,a]of Object.entries(n)){const l=Oe(a);if(!l)continue;const i=Ql(l.__resolveType);if(!i)continue;const c=Oe(l[ts[i]])??{},r={key:o,kind:i,...Jl(i,c)};e[i].push(r),t.push({entry:r,key:xt(Q(c[i==="posts"?"title":"name"]))})}Xl(t);for(const o of Ds)e[o].sort((a,l)=>a.label.localeCompare(l.label));return e}function Xl(n){const e=new Map;for(const{entry:t,key:o}of n){if(!o)continue;const a=`${t.kind}:${o}`;e.set(a,(e.get(a)??0)+1)}for(const{entry:t,key:o}of n)o&&(e.get(`${t.kind}:${o}`)??0)>1&&(t.duplicateName=!0)}function Zl(n,e){return Yn(n)[e]}function Ge(n,e){return Zl(n,e).map(t=>({key:t.key,payload:ct(Oe(n[t.key])??void 0,e)}))}const en=Object.freeze({});function ct(n,e){return n?Oe(n[ts[e]])??en:en}function mt(n,e,t){return{name:n,__resolveType:Wn[e],[ts[e]]:t}}function ld({records:n,selected:e,valueField:t,toRef:o}){const a=Array.isArray(e)?e:[],l=f=>typeof f=="string"?f:Q(Oe(f)?.[t]),i=f=>typeof f=="string"?f:Q(Oe(f)?.name),c=f=>{const u=l(f),p=u?n.find(({payload:g})=>Q(g[t])===u):void 0;if(p)return p;const b=i(f);return b?n.find(({payload:g})=>Q(g.name)===b):void 0},r=n.map(({key:f,payload:u})=>({value:f,label:Q(u.name)||Q(u[t])||f})),d=new Map,h=[];return a.forEach((f,u)=>{const p=c(f);if(p){h.includes(p.key)||h.push(p.key);return}const b=`unresolved:${u}`;d.set(b,f),h.push(b),r.push({value:b,label:i(f)||l(f)||"Unknown"})}),{options:r,selectedValues:h,refsForValues:f=>f.map(u=>{const p=n.find(b=>b.key===u);return p?o(p.payload):d.get(u)}).filter(u=>u!==void 0)}}function Qn(n){return Ge(n,"authors").map(({payload:e})=>({...e,name:Q(e.name),email:Q(e.email)})).filter(e=>e.email)}function Ze(n){return Array.isArray(n)?n:[]}function Je(n){if(typeof n=="string")return n;const e=Oe(n);return e?Q(e.slug):""}function Jn(n){if(typeof n=="string")return n;const e=Oe(n);return e?Q(e.email):""}function ss(n){const e=[];return Q(n.title).trim()||e.push("Title"),Q(n.slug).trim()||e.push("Slug"),Ze(n.categories).map(Je).filter(Boolean).length===0&&e.push("Category"),Q(n.excerpt).trim()||e.push("Excerpt"),Q(n.image).trim()||e.push("Cover image"),e}const As=["draft","generating","awaiting_review","scheduled","published","archived"],Xn=8;function bt(n){switch(Q(n.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function id(n){return bt(n)==="archived"}function ei(n,e){return e!=="published"&&e!=="scheduled"||bt(n)===e?!1:ss(n).length>0}function ti(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate()+1,Xn).toISOString()}function Vt(n,e,t){if(e!=="scheduled")return{...n,status:e,scheduledDatetime:""};const o=Q(n.scheduledDatetime);return{...n,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?ti(t):o}}function Zn(n,e=po(n)){return Ge(n,"posts").map(({key:t,payload:o})=>({key:t,duplicateTitle:e.has(t),title:Q(o.title)||"Untitled post",slug:Q(o.slug),date:Q(o.date),scheduledDatetime:Q(o.scheduledDatetime),categorySlugs:Ze(o.categories).map(Je).filter(Boolean),authorEmails:Ze(o.authors).map(Jn).filter(Boolean),missing:ss(o),status:bt(o),form:"live"}))}const eo="blog-manager/posts/";function to(n){return n.startsWith(eo)}function Tt(n){return n.split("/").pop()??n}function Gt(n){return`${eo}${n}`}function si(n){return`collections/blog/posts/${n}`}function vs(){return gt(12)}function ni(n){const e=Oe(n.planning)??{},t=Oe(e.format);return{ideaKey:Q(e.ideaKey)||void 0,pillarKey:Q(e.pillarKey)||void 0,pillarTitle:Q(e.pillarTitle)||void 0,format:t?{name:Q(t.name),value:Q(t.value)}:void 0,brief:Q(e.brief)||void 0}}function so(n){return{title:n.title,slug:"",excerpt:"",date:n.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:n.planning??{}}}function dt(n,e){return{name:n,[ts.posts]:e}}function oi(n,e){return to(n)?dt(n,e):mt(n,"posts",e)}function no(n){const e=[];for(const[t,o]of Object.entries(n)){if(!to(t))continue;const a=Oe(o);a&&e.push({key:t,payload:ct(a,"posts")})}return e}function oo(n){return[...no(n),...Ge(n,"posts")]}function ai(n){const e=po(n);return[...no(n).map(({key:o,payload:a})=>({key:o,duplicateTitle:e.has(o),title:Q(a.title)||"Untitled post",slug:Q(a.slug),date:Q(a.date),scheduledDatetime:Q(a.scheduledDatetime),categorySlugs:Ze(a.categories).map(Je).filter(Boolean),authorEmails:Ze(a.authors).map(Jn).filter(Boolean),missing:ss(a),status:bt(a),form:"planning"})),...Zn(n,e)]}function li(n,e,t){const o=Vt(n.payload,e,t),a=Tt(n.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?si(a):Gt(a),c=l==="live"?mt(i,"posts",o):dt(i,o);return{writes:{[i]:c},deletes:i===n.key?[]:[n.key]}}function rd(n,e,t){const o=Ze(n.categories);if(!o.some(r=>Je(r)===e))return n;let a=!1;const l=o.map(r=>{const d=Je(r);if(d!==e&&d!==t.slug)return r;const h=Oe(r);return h&&Q(h.slug)===t.slug&&Q(h.name)===t.name?r:(a=!0,{name:t.name,slug:t.slug})});if(!a){const r=o.map(Je).filter(Boolean);if(new Set(r).size===r.length)return n}const i=new Set,c=l.filter(r=>{const d=Je(r);return d?i.has(d)?!1:(i.add(d),!0):!0});return{...n,categories:c}}function ii(n){const e=[];return Q(n.name).trim()||e.push("Name"),Q(n.slug).trim()||e.push("Slug"),e}function ri(n,e){const t=Ze(n.categories);return t.some(o=>Je(o)===e)?{...n,categories:t.filter(o=>Je(o)!==e)}:n}function cd(n,e,t){return Q(n.parentSlug)!==e?n:{...n,parentSlug:t}}function ci(n){const e=Q(n.status),t=e==="idea"||e==="in_review"?{status:bt(n)}:{};return{...n,...t,dateModified:new Date().toISOString()}}function gt(n){const e=new Uint8Array(Math.ceil(n/2));return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("").slice(0,n)}function bs(n,e){const t=`collections/blog/${e}/${gt(12)}`;if(!Object.hasOwn(n,t))return t;throw new Error("Could not generate a unique blog block key")}function ao(n){switch(n){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${gt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${gt(8)}`,description:"",sections:[]};default:{const e=n;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const di={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},tn="Box";function ui(n){return n.startsWith("site/")?"site":"app"}function mi(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")||n.startsWith("/")}function kt(...n){for(const e of n)if(e!==void 0)return e}function sn(n){if(n&&!(n.includes("/")||/\.(tsx?|jsx?)$/.test(n)))return n}function fi(n){const e=n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():n}function lo(n){const e=new Set,t=[],o=n.manifest?.blocks??{};for(const a of Object.values(o))for(const l of Object.keys(a)){if(!hi(l)||e.has(l))continue;e.add(l);const i=Ps(l,n),c=ns(l),r=di[c],d=ui(l),h=sn(i.title),m=sn(i.description),f=(d==="site"?kt(h,r?.title):kt(r?.title,h))??fi(c),u=d==="site"?kt(m,r?.description):kt(r?.description,m),p=d==="site"?i.icon:void 0,b=p&&mi(p)?p:void 0,g=b!==void 0?r?.iconName??tn:kt(p,r?.iconName)??tn;t.push({resolveType:l,title:f,description:u,iconName:g,iconUrl:b,source:d})}return t.sort((a,l)=>a.title.localeCompare(l.title))}function ns(n){return(n.split("/").pop()??n).replace(/\.(tsx?|jsx?)$/,"")}const pi=["blog/sections/blocks/","site/sections/Blog/Post/"];function hi(n){return pi.some(e=>n.startsWith(e))}const Ls="blog-manager-brand";function Ke(n){if(!Array.isArray(n))return[];const e=[];for(const t of n){if(typeof t=="string"){t.trim()&&e.push({name:t,value:""});continue}const o=Oe(t);o&&e.push({name:Q(o.name),value:Q(o.value)})}return e}function Me(n){return n.filter(e=>e.name.trim()||e.value.trim())}const gi=6e4,xi=4e3;function bi(n){const e=[],t=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(t.has(i))return;t.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,c]of Object.entries(a))i!=="__resolveType"&&o(c,i)};return o(n,"block"),e.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-editor-8YXMt2hP.js","assets/index-BSnD4u1l.js","assets/index-6WjGaIcE.css","assets/chat-context-PePawndm.js","assets/use-panel-navigate-DuMg6x_K.js","assets/thread-route-DscdrdSm.js","assets/use-project-scope-B50a346z.js","assets/repository-binding-Bldcduno.js","assets/use-mcp-client-A77IVsxI.js","assets/auth-D-ee-h5T.js","assets/autosend-BSFtgKhn.js","assets/thread-intent-Bwo9Tb6y.js","assets/backoff-8mStPHYB.js","assets/task-board-BoCHCiHL.js","assets/schema-Cd5rHvlU.js","assets/slugify-CEUa2lfQ.js","assets/use-is-desktop-app-BNujXJc_.js","assets/use-decopilot-events-N8vXq82D.js","assets/use-ai-providers-b7R9al6L.js","assets/location-DPIrGNp7.js","assets/use-organization-settings-1DGLdBJq.js","assets/scroll-area-DYG4mHMK.js","assets/select-CC-cBpVq.js","assets/index-eGns4zSt.js","assets/Check-1kmjHGAt.js","assets/ChevronUp-BirkHko8.js","assets/use-section-preview-base-Dy7gMlm-.js","assets/UserSquare-DxiZzC-7.js","assets/agent-icon-txBWjErR.js","assets/AlertCircle-Ca-DA_Xo.js","assets/Tool01-D9114OvH.js","assets/ArrowUp-DCJvUiXa.js","assets/ArrowLeft-BGL-gkHz.js","assets/LinkBroken01-Be5i7wiR.js","assets/ShoppingBag01-CZuerMtF.js","assets/ZoomOut-D9VvN_NP.js","assets/Building02-BMj4gWpR.js","assets/CheckCircle-DZIvsuC9.js","assets/Copy01-C0n9CnUc.js","assets/CreditCard01-CCCfodPa.js","assets/DotsVertical-D9Sv34Vj.js","assets/Image01-DSE2Qnmp.js","assets/Palette-CfapkMIU.js","assets/XClose-CQskEvfN.js","assets/Key01-Bc_kctWJ.js","assets/Link01-DRqoYgr7.js","assets/LinkExternal01-CYu1u0V8.js","assets/Monitor01-B-mcTiTw.js","assets/Sun-Cxwg0J8z.js","assets/Plus-DeJwCuZE.js","assets/SearchMd-B-uYGFsm.js","assets/Trash01-DPzDDdie.js","assets/Upload01-D29vOgD_.js","assets/User01-Cv1yYcPo.js","assets/Users01-fxv639Iz.js","assets/X-DNUeDs_E.js","assets/dialog-BjdoPdxw.js","assets/input-Cd0_CDVZ.js","assets/use-new-blocks-editor-BsKR7vcz.js","assets/claim-phase-copy-Cl0YDvy2.js","assets/section-preview-url-7zfngvgW.js","assets/use-session-runtime-CLmwqP43.js","assets/runnable-block-editor-xPDFVXlK.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-DWcQWh4a.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/collapsible-CvSd253l.js","assets/use-copy-Cer_DvZP.js","assets/usage-stats-B6WkCKsy.js","assets/markdown-wuJsczpE.js","assets/org-file-open-context-Bs96eliX.js","assets/use-mobile-DNxs9zx_.js","assets/tooltip-Bgl1fAxi.js","assets/use-clock-tick-DAn9rhMX.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CKOizQ1X.js","assets/types-DSz2eqpq.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/gateway-client-7b4dMSx0.js","assets/tool-namespace-DmnQIdtF.js","assets/utils-CVEq3hMx.js","assets/shell-layout-znU8dfLI.js","assets/avatar-D08cfTFl.js","assets/download-app-dialog-4RhgrbFN.js","assets/command-BuaN4gi6.js","assets/index-DK4f8rGT.js","assets/integration-icon-DdOqOzJh.js","assets/project-icon-mfRu-TVA.js","assets/new-project-dialog-26KIGlBO.js","assets/label-p4gAloMY.js","assets/repository-import-picker-xEt1JTQh.js","assets/use-navigate-to-agent-B8Tw6lBD.js","assets/repository-picker-_wAGFCw8.js","assets/useInfiniteQuery-mK_7Bdd0.js","assets/infiniteQueryObserver-3rOVnljf.js","assets/collection-search-Da38LCFd.js","assets/use-debounced-value-CLZNPNYg.js","assets/required-auth-layout-9CaCzCmK.js","assets/use-org-sso-v_RHC6Uu.js","assets/shell-layout-CE2Eihra.css","assets/sheet-p7htr8B1.js","assets/use-connection-T2ooNFOK.js","assets/use-mcp-prompts-Bzy_rF1l.js","assets/index-Dno06lIj.js","assets/form-CPwmIDgD.js","assets/use-thread-outputs-8bOBGt9D.js","assets/file-type-icon-d8qc1y0k.js","assets/popover-CRO_98-h.js","assets/utils-rxd5AcRF.js","assets/monaco-editor-D0ZnzEs4.js","assets/editor-C4wBlSK3.js","assets/calendar-CiBjQc6z.js","assets/textarea-Bc3Na4Zg.js","assets/rich-text-link-control-wgMfyyAb.js","assets/switch-By80PO40.js","assets/combobox-rCJznWYq.js","assets/alert-dialog-DPRkujUl.js","assets/sandbox-url-D3mC8qhT.js","assets/search-input-CQflA5a-.js","assets/tabs-B_NYHDVk.js","assets/use-file-configs-C9aM8lFc.js","assets/asset-utils-CB8QPgwX.js","assets/use-chat-layout-state-DvvrnpP7.js","assets/site-slug-DebpOoQq.js","assets/toggle-group-BpqQyGcW.js","assets/sandbox-git-api-B1R0585s.js","assets/agent-view-guard-BpmYIopx.js","assets/use-main-panel-tabs-BS1NCn62.js","assets/use-mcp-tools-XgrSCkO3.js","assets/index-BUvFUUVJ.js","assets/drawer-C0Z1wiOg.js","assets/input-D_thObzv.js","assets/chat-draft-CXRkpBvJ.js","assets/use-deco-credits-BDrqLG89.js","assets/use-open-billing-url-DrYGAlSe.js","assets/decopilot-CTDgHPwq.js","assets/checkbox-ZK2ilOD4.js","assets/ai-providers-logos-DD3qZ33J.js","assets/index-BnLxaCHY.js","assets/input-DyS6UqeB.js","assets/suggestion-6yTYju-2.js","assets/use-org-fs-Cjw8xggL.js","assets/question-004-sINsf4GQ.js","assets/use-members-CaS0Ntvk.js","assets/use-org-auth-client-BXfCP_SX.js","assets/feature-paywall-AsO7--Ah.js","assets/plan-ladder-ZwA3rsoJ.js","assets/add-connection-dialog-DqHg8HcJ.js","assets/extract-connection-data-Db1CJiHn.js","assets/metadata-D72DunRR.js","assets/connection-COorLhal.js","assets/connection-card-DK1Wt7vU.js","assets/connection-slug-CITJ0kGN.js","assets/connection-form-helpers-DwS96ZJh.js","assets/authenticate-and-persist-oauth-BRf4W3aC.js","assets/mcp-oauth-JDHXDTjL.js","assets/collection-tabs-POi61Yn-.js","assets/badge-BNBKCpa-.js","assets/use-infinite-scroll-DxRG3Odx.js","assets/useSuspenseInfiniteQuery-DlwXuQ53.js","assets/use-task-board-events-CZLJRGSP.js","assets/input-Bwd_JSM8.css","assets/sandbox-lifecycle-context-D3u8pX2X.js","assets/resolve-tab-icon-N_z8a9nx.js","assets/use-task-metadata-yam0GxPA.js","assets/virtual-mcp-CR_Xj7EJ.js","assets/feature-gate-DSzDIEDM.js","assets/mustache-BBVwKX2z.js","assets/empty-state-CQl0XC4z.js","assets/empty-state-Bp2gSnig.js","assets/post-editor-DJxjE37e.js","assets/multi-select-C2iXVR_Q.js","assets/block-document-DCC9icxJ.js","assets/index-Dx_j0OqQ.js","assets/use-fast-preview-draft-url-C7Q5tlLs.js","assets/use-autosave-CWemfCnn.js","assets/record-editor-Bnb7fDb6.js","assets/context-JWyIITVx.js","assets/index-BgN0Ps2M.js","assets/get-initials-D-f_fDFw.js","assets/icon-button-et2rWMzj.js","assets/category-editor-BevzDKjY.js","assets/sections-editor-g25F6D1o.js","assets/page-seo-form-BanWt_Wh.js","assets/variant-matcher-override-DvDmh02Q.js","assets/seo-editor-BZLOy3Ym.js","assets/variant-calendar-CaJ6M-lI.js","assets/view-mode-toggle-CeIqRFVf.js","assets/post-calendar-BfaZZYX3.js","assets/redirect-editor-D72JLPRT.js"])))=>i.map(i=>d[i]);
2
+ import{c as ie,b as je,j as s,m as _o,K as ys,l as ye,r as A,h as at,B as Ee,o as Bo,e as Eo,t as me,a2 as ks,aF as Nt,aN as vt,F as Ft,aG as Ks,H as It,I as Kt,aA as Do,U as Ao,V as Lo,G as Qe,ak as _t,al as fs,ag as $o,X as Oo,u as vn,aL as Ye}from"./index-BSnD4u1l.js";import{A as Ro}from"./agent-view-guard-BpmYIopx.js";import{F as Fo}from"./feature-gate-DSzDIEDM.js";import{u as Qt,b as jn}from"./chat-context-PePawndm.js";import{i as Bt}from"./AlertCircle-Ca-DA_Xo.js";import{J as Io,V as kn,W as et,X as Sn,Y as Ss,Z as Ko,_ as wn,$ as zo,b as zt,Q as Nn,a0 as Mo,a1 as Vo,a2 as Ct,a3 as Go,a4 as Uo,n as Ho,a5 as qo,a6 as Cn,a7 as Wo,a8 as Yo,a9 as Qo,l as zs,aa as Jo,H as Pn}from"./agent-icon-txBWjErR.js";import{a as Tn,i as ws,d as Ms}from"./UserSquare-DxiZzC-7.js";import{b as _n,i as Bn}from"./ZoomOut-D9VvN_NP.js";import{c as En,i as Xo}from"./XClose-CQskEvfN.js";import{s as Ns}from"./Plus-DeJwCuZE.js";import{t as Dn}from"./Users01-fxv639Iz.js";import{f as Zo,e as ea,b as ta,A as sa,a as na,d as oa,c as aa,g as la}from"./alert-dialog-DPRkujUl.js";import{S as Jt}from"./scroll-area-DYG4mHMK.js";import{T as He,a as qe,b as We}from"./tooltip-Bgl1fAxi.js";import{B as st}from"./badge-BNBKCpa-.js";import{S as ps,k as ia,c as ra,g as An,B as hs,P as ca,h as da,n as ua,s as ma,i as Vs,u as Xt,l as fa,o as pa,R as ha,q as Ln,r as ga,t as xa,d as $n,v as ba,w as ya,x as On,y as va,M as ja,j as ka,z as Sa,p as wa,A as Na,C as Ca,e as Pa,f as Ta,D as Gs}from"./runnable-block-editor-xPDFVXlK.js";import{r as Cs,S as _a,t as Ps,i as Ba,w as Ea,x as Da,n as Ot,v as Aa,R as Rn,u as La,y as $a,q as Oa,z as Ra,A as Fa,B as Us,G as Ts,g as Ia,E as Ka,j as Hs,F as za,k as Ma,H as Va,I as qs,h as Ga,J as Fn,m as Ua,K as Ha,L as qa,M as Wa}from"./claim-phase-copy-Cl0YDvy2.js";import{u as In,P as Ya}from"./mustache-BBVwKX2z.js";import{n as Kn}from"./ShoppingBag01-CZuerMtF.js";import{t as ft}from"./ChevronUp-BirkHko8.js";import{C as Qa,a as Ja,b as Xa}from"./collapsible-CvSd253l.js";import{c as Za,d as el}from"./sandbox-lifecycle-context-D3u8pX2X.js";import{u as zn}from"./use-session-runtime-CLmwqP43.js";import{c as pt,d as lt,e as ht,b as it,D as rt,h as Mt,a as tl}from"./dialog-BjdoPdxw.js";import{I as Xe}from"./input-Cd0_CDVZ.js";import{C as Zt}from"./checkbox-ZK2ilOD4.js";import{L as ze}from"./label-p4gAloMY.js";import{c as sl,b as nl,a as ol,d as al,S as ll}from"./select-CC-cBpVq.js";import{o as il}from"./sandbox-git-api-B1R0585s.js";import{b as Ws}from"./sandbox-url-D3mC8qhT.js";import{a as Ys}from"./utils-rxd5AcRF.js";import{i as rl}from"./CheckCircle-DZIvsuC9.js";import{a as _s}from"./Copy01-C0n9CnUc.js";import{s as Bs}from"./Trash01-DPzDDdie.js";import{i as gs}from"./Upload01-D29vOgD_.js";import{E as cl}from"./empty-state-CQl0XC4z.js";import{T as Rt}from"./textarea-Bc3Na4Zg.js";import{u as dl}from"./use-ai-providers-b7R9al6L.js";import{M as Mn}from"./monaco-editor-D0ZnzEs4.js";import{i as Es}from"./X-DNUeDs_E.js";import{f as Vn,a as ul}from"./repository-binding-Bldcduno.js";import"./rich-text-link-control-wgMfyyAb.js";import{c as ml}from"./Tool01-D9114OvH.js";import{b as Qs}from"./use-project-scope-B50a346z.js";import{E as fl}from"./empty-state-Bp2gSnig.js";import{G as Js}from"./repository-picker-_wAGFCw8.js";import{R as pl}from"./repository-import-picker-xEt1JTQh.js";import{b as hl}from"./thread-route-DscdrdSm.js";function gl(n){const e=ie.c(18),{title:t,description:o,children:a}=n,l=je();let i;e[0]!==a?(i=s.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none h-full select-none overflow-hidden",children:a}),e[0]=a,e[1]=i):i=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Io,{}),e[2]=c):c=e[2];let r;e[3]!==l?(r=l("common.soon"),e[3]=l,e[4]=r):r=e[4];let d;e[5]!==r?(d=s.jsxs(st,{variant:"secondary",children:[c,r]}),e[5]=r,e[6]=d):d=e[6];let h;e[7]!==t?(h=s.jsx("p",{className:"text-base font-semibold text-foreground",children:t}),e[7]=t,e[8]=h):h=e[8];let m;e[9]!==o?(m=o&&s.jsx("p",{className:"text-sm text-muted-foreground",children:o}),e[9]=o,e[10]=m):m=e[10];let f;e[11]!==d||e[12]!==h||e[13]!==m?(f=s.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/60 p-6 backdrop-blur-sm",children:s.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3 rounded-2xl border bg-card px-8 py-6 text-center shadow-lg",children:[d,h,m]})}),e[11]=d,e[12]=h,e[13]=m,e[14]=f):f=e[14];let u;return e[15]!==i||e[16]!==f?(u=s.jsxs("div",{className:"relative h-full min-h-0",children:[i,f]}),e[15]=i,e[16]=f,e[17]=u):u=e[17],u}function xl(n,e){if(!n||!e?.length)return n;const t=Object.fromEntries(Object.entries(n.properties??{}).filter(([o])=>!e.includes(o)));return Object.keys(t).length>0?{...n,properties:t}:n}function bl(n,e,t){return typeof n!="string"?null:xl(Cs(n,e),t)}function Gn(n,e,t){if(!e||typeof n!="string")return!1;const o=bl(n,e,t);return!!o&&Object.keys(o.properties??{}).length>0}function jt(n){const e=ie.c(6),{hasItems:t,emptyLabel:o,emptyHint:a}=n;let l;e[0]!==a||e[1]!==o||e[2]!==t?(l=t?"No results match your search.":s.jsxs(s.Fragment,{children:[s.jsx("div",{children:o}),s.jsx("div",{className:"mt-1 text-muted-foreground/80",children:a})]}),e[0]=a,e[1]=o,e[2]=t,e[3]=l):l=e[3];let i;return e[4]!==l?(i=s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l}),e[4]=l,e[5]=i):i=e[5],i}function es(n,e){return`${n}-${e}`}function Un(n,e){return`site/apps/${n}/${e}.ts`}function Hn(n){const e=n.match(/^site\/apps\/([^/]+)\/([^/.]+)\.tsx?$/);if(e)return{vendor:e[1],app:e[2]};const t=n.match(/^([^/]+)\/apps\/([^/.]+)\.tsx?$/);return t?{vendor:t[1],app:t[2]}:null}function yl(n){const e=n.match(/^([^-]+)-(.+)$/);return e?{vendor:e[1],app:e[2]}:null}function vl(n){return n==="local"?"Custom":"Installed"}function qn(n,e,t){const o=new Set([es(n,e),e].map(l=>l.toLowerCase())),a=Un(n,e);for(const[l,i]of Object.entries(t)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=i;if(o.has(l.toLowerCase())||c.__resolveType===a)return l}return null}function jl(n,e){const t=n.vendor.alias,o=n.name,a=qn(t,o,e);return{id:es(t,o),app:o,vendor:t,title:n.title||n.name,description:n.description,category:n.category??"Other",logo:n.logo||void 0,resolveType:Un(t,o),blockKey:a,installed:a!==null}}function kl(n,e,t){if(n===_a)return null;const o=Hn(n);if(!o)return null;const{vendor:a,app:l}=o,i=qn(a,l,t),c=Ps(n,e);return{id:es(a,l),app:l,vendor:a,title:c.title??l,description:c.description??"",category:"Others",logo:c.logo??c.icon,resolveType:n,blockKey:i,installed:i!==null}}function Sl(n,e,t){const o=e.__resolveType;if(typeof o!="string"||Ba(n,e)||!Ea(o))return null;const a=Hn(o)??yl(n);if(!a)return null;const l=Ps(o,t),{vendor:i,app:c}=a;return{id:es(i,c),app:c,vendor:i,title:l.title??Da(n,e,t),description:l.description??"",category:vl(i),logo:l.logo??l.icon,resolveType:o,blockKey:n,installed:!0}}function wl(n,e,t){const o=new Map;for(const l of n){const i=jl(l,t);o.set(i.id,i)}const a=e.manifest?.blocks?.apps??{};for(const l of Object.keys(a)){const i=kl(l,e,t);!i||o.has(i.id)||o.set(i.id,i)}for(const[l,i]of Object.entries(t)){if(l.includes("/")||!i||typeof i!="object"||Array.isArray(i))continue;const c=Sl(l,i,e);!c||o.has(c.id)||o.set(c.id,c)}return[...o.values()].sort(Nl)}function Nl(n,e){return n.installed!==e.installed?n.installed?-1:1:n.title.localeCompare(e.title)}async function Cl(){const n=await fetch("/api/deco-apps");if(!n.ok)throw new Error(`Failed to fetch deco apps: ${n.status}`);return(await n.json()).apps??[]}function Pl(n,e,t){const o=ie.c(12),a=t?.enabled??!0;let l;o[0]===Symbol.for("react.memo_cache_sentinel")?(l=ys.decoApps(),o[0]=l):l=o[0];let i;o[1]!==a?(i={queryKey:l,queryFn:Cl,staleTime:3e5,retry:1,enabled:a},o[1]=a,o[2]=i):i=o[2];const c=_o(i);let r;o[3]!==e||o[4]!==n||o[5]!==c.data?(r=n&&e?wl(c.data??[],n,e):[],o[3]=e,o[4]=n,o[5]=c.data,o[6]=r):r=o[6];const d=r,h=c.isLoading&&!c.isError;let m;return o[7]!==d||o[8]!==c.isError||o[9]!==c.refetch||o[10]!==h?(m={catalog:d,isLoading:h,isError:c.isError,refetch:c.refetch},o[7]=d,o[8]=c.isError,o[9]=c.refetch,o[10]=h,o[11]=m):m=o[11],m}const Tl=["sections","apps","loaders","actions"];function _l(n){const e=ie.c(59),{active:t,counts:o,showBlog:a,onSelect:l}=n,i=je();let c;e[0]!==i?(c=i("sandbox.collectionsSidebar.content"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=s.jsx("div",{className:"px-3 h-12 flex items-center border-b shrink-0",children:s.jsx("span",{className:"text-sm font-medium",children:c})}),e[2]=c,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sandbox.collectionsSidebar.pages"),e[4]=i,e[5]=d):d=e[5];const h=t==="pages";let m;e[6]!==o.pages||e[7]!==l||e[8]!==d||e[9]!==h?(m=s.jsx(Fe,{id:"pages",icon:Tn,label:d,count:o.pages,active:h,onSelect:l}),e[6]=o.pages,e[7]=l,e[8]=d,e[9]=h,e[10]=m):m=e[10];let f;e[11]!==i?(f=i("sandbox.collectionsSidebar.redirects"),e[11]=i,e[12]=f):f=e[12];const u=t==="redirects";let p;e[13]!==o.redirects||e[14]!==l||e[15]!==f||e[16]!==u?(p=s.jsx(Fe,{id:"redirects",icon:kn,label:f,count:o.redirects,active:u,onSelect:l}),e[13]=o.redirects,e[14]=l,e[15]=f,e[16]=u,e[17]=p):p=e[17];let b;e[18]!==i?(b=i("sandbox.collectionsSidebar.site"),e[18]=i,e[19]=b):b=e[19];const g=t==="site";let v;e[20]!==l||e[21]!==g||e[22]!==b?(v=s.jsx(Fe,{id:"site",icon:Ko,label:b,active:g,onSelect:l}),e[20]=l,e[21]=g,e[22]=b,e[23]=v):v=e[23];let y;e[24]!==i?(y=i("sandbox.collectionsSidebar.seo"),e[24]=i,e[25]=y):y=e[25];const k=t==="seo";let S;e[26]!==l||e[27]!==y||e[28]!==k?(S=s.jsx(Fe,{id:"seo",icon:wn,label:y,active:k,onSelect:l}),e[26]=l,e[27]=y,e[28]=k,e[29]=S):S=e[29];let N;e[30]!==i?(N=i("sandbox.collectionsSidebar.calendar"),e[30]=i,e[31]=N):N=e[31];const B=t==="calendar";let E;e[32]!==l||e[33]!==N||e[34]!==B?(E=s.jsx(Fe,{id:"calendar",icon:zo,label:N,active:B,onSelect:l}),e[32]=l,e[33]=N,e[34]=B,e[35]=E):E=e[35];let w;e[36]!==t||e[37]!==o||e[38]!==l?(w=s.jsx(Bl,{active:t,counts:o,onSelect:l}),e[36]=t,e[37]=o,e[38]=l,e[39]=w):w=e[39];let T;e[40]!==t||e[41]!==o.authors||e[42]!==o.categories||e[43]!==o.posts||e[44]!==l||e[45]!==a||e[46]!==i?(T=a&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-3 flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",children:[s.jsx(Kn,{size:13,className:"shrink-0"}),i("sandbox.collectionsSidebar.blog")]}),s.jsx(Fe,{id:"context",icon:et,label:i("sandbox.collectionsSidebar.context"),active:t==="context",onSelect:l}),s.jsx(Fe,{id:"posts",icon:_n,label:i("sandbox.collectionsSidebar.posts"),count:o.posts,active:t==="posts",onSelect:l}),s.jsx(Fe,{id:"authors",icon:Dn,label:i("sandbox.collectionsSidebar.authors"),count:o.authors,active:t==="authors",onSelect:l}),s.jsx(Fe,{id:"categories",icon:Sn,label:i("sandbox.collectionsSidebar.categories"),count:o.categories,active:t==="categories",onSelect:l}),s.jsx(Fe,{id:"post-schedule",icon:Ss,label:i("sandbox.collectionsSidebar.postSchedule"),active:t==="post-schedule",onSelect:l})]}),e[40]=t,e[41]=o.authors,e[42]=o.categories,e[43]=o.posts,e[44]=l,e[45]=a,e[46]=i,e[47]=T):T=e[47];let R;e[48]!==v||e[49]!==S||e[50]!==E||e[51]!==w||e[52]!==T||e[53]!==m||e[54]!==p?(R=s.jsxs("nav",{className:"flex flex-col p-1.5 gap-0.5",children:[m,p,v,S,E,w,T]}),e[48]=v,e[49]=S,e[50]=E,e[51]=w,e[52]=T,e[53]=m,e[54]=p,e[55]=R):R=e[55];let L;return e[56]!==r||e[57]!==R?(L=s.jsxs("div",{className:"w-[208px] shrink-0 border-r flex flex-col",children:[r,R]}),e[56]=r,e[57]=R,e[58]=L):L=e[58],L}function Bl(n){const e=ie.c(52),{active:t,counts:o,onSelect:a}=n,l=je();let i;e[0]!==t?(i=Tl.includes(t),e[0]=t,e[1]=i):i=e[1];const c=i,[r,d]=A.useState(!1),h=r||c;let m,f;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=ye("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer","text-muted-foreground hover:bg-muted hover:text-foreground"),f=s.jsx(Mo,{size:16,className:"shrink-0"}),e[2]=m,e[3]=f):(m=e[2],f=e[3]);let u;e[4]!==l?(u=l("sandbox.collectionsSidebar.advanced"),e[4]=l,e[5]=u):u=e[5];let p;e[6]!==u?(p=s.jsx("span",{className:"flex-1 truncate",children:u}),e[6]=u,e[7]=p):p=e[7];const b=h&&"rotate-180";let g;e[8]!==b?(g=ye("shrink-0 text-muted-foreground/70 transition-transform",b),e[8]=b,e[9]=g):g=e[9];let v;e[10]!==g?(v=s.jsx(ft,{size:16,className:g}),e[10]=g,e[11]=v):v=e[11];let y;e[12]!==p||e[13]!==v?(y=s.jsxs(Qa,{className:m,children:[f,p,v]}),e[12]=p,e[13]=v,e[14]=y):y=e[14];let k;e[15]!==l?(k=l("sandbox.collectionsSidebar.sections"),e[15]=l,e[16]=k):k=e[16];const S=t==="sections";let N;e[17]!==o.sections||e[18]!==a||e[19]!==k||e[20]!==S?(N=s.jsx(Fe,{id:"sections",icon:zt,label:k,count:o.sections,active:S,onSelect:a,indent:!0}),e[17]=o.sections,e[18]=a,e[19]=k,e[20]=S,e[21]=N):N=e[21];let B;e[22]!==l?(B=l("sandbox.collectionsSidebar.apps"),e[22]=l,e[23]=B):B=e[23];const E=t==="apps";let w;e[24]!==o.apps||e[25]!==a||e[26]!==B||e[27]!==E?(w=s.jsx(Fe,{id:"apps",icon:En,label:B,count:o.apps,active:E,onSelect:a,indent:!0}),e[24]=o.apps,e[25]=a,e[26]=B,e[27]=E,e[28]=w):w=e[28];let T;e[29]!==l?(T=l("sandbox.collectionsSidebar.loaders"),e[29]=l,e[30]=T):T=e[30];const R=t==="loaders";let L;e[31]!==o.loaders||e[32]!==a||e[33]!==T||e[34]!==R?(L=s.jsx(Fe,{id:"loaders",icon:Nn,label:T,count:o.loaders,active:R,onSelect:a,indent:!0}),e[31]=o.loaders,e[32]=a,e[33]=T,e[34]=R,e[35]=L):L=e[35];let G;e[36]!==l?(G=l("sandbox.collectionsSidebar.actions"),e[36]=l,e[37]=G):G=e[37];const F=t==="actions";let _;e[38]!==o.actions||e[39]!==a||e[40]!==G||e[41]!==F?(_=s.jsx(Fe,{id:"actions",icon:Bn,label:G,count:o.actions,active:F,onSelect:a,indent:!0}),e[38]=o.actions,e[39]=a,e[40]=G,e[41]=F,e[42]=_):_=e[42];let $;e[43]!==N||e[44]!==w||e[45]!==L||e[46]!==_?($=s.jsxs(Ja,{className:"flex flex-col gap-0.5 pt-0.5",children:[N,w,L,_]}),e[43]=N,e[44]=w,e[45]=L,e[46]=_,e[47]=$):$=e[47];let K;return e[48]!==h||e[49]!==$||e[50]!==y?(K=s.jsxs(Xa,{open:h,onOpenChange:d,children:[y,$]}),e[48]=h,e[49]=$,e[50]=y,e[51]=K):K=e[51],K}function Fe(n){const e=ie.c(19),{id:t,icon:o,label:a,count:l,active:i,onSelect:c,indent:r}=n;let d;e[0]!==t||e[1]!==c?(d=()=>c(t),e[0]=t,e[1]=c,e[2]=d):d=e[2];const h=r&&"pl-6",m=i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground";let f;e[3]!==h||e[4]!==m?(f=ye("flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors cursor-pointer",h,m),e[3]=h,e[4]=m,e[5]=f):f=e[5];let u;e[6]!==o?(u=s.jsx(o,{size:16,className:"shrink-0"}),e[6]=o,e[7]=u):u=e[7];let p;e[8]!==a?(p=s.jsx("span",{className:"flex-1 truncate",children:a}),e[8]=a,e[9]=p):p=e[9];let b;e[10]!==i||e[11]!==l?(b=l!==void 0&&s.jsx("span",{className:ye("shrink-0 text-xs tabular-nums",i?"text-accent-foreground/70":"text-muted-foreground/70"),children:l}),e[10]=i,e[11]=l,e[12]=b):b=e[12];let g;return e[13]!==d||e[14]!==f||e[15]!==u||e[16]!==p||e[17]!==b?(g=s.jsxs("button",{type:"button",onClick:d,className:f,children:[u,p,b]}),e[13]=d,e[14]=f,e[15]=u,e[16]=p,e[17]=b,e[18]=g):g=e[18],g}function El(n){const e=ie.c(12),{state:t,claimPhase:o,lifecycle:a,onStart:l,connectionsHref:i}=n;switch(t.kind){case"starting":{let c;e[0]!==o||e[1]!==a?(c=ia({claimPhase:o,lifecycle:a}),e[0]=o,e[1]=a,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==c?(r=s.jsx(ps,{kind:"starting",progress:c,claimPhase:o}),e[3]=o,e[4]=c,e[5]=r):r=e[5],r}case"suspended":{let c;return e[6]!==l?(c=s.jsx(ps,{kind:"suspended",onResume:l}),e[6]=l,e[7]=c):c=e[7],c}case"errored":{let c;return e[8]!==i||e[9]!==l||e[10]!==t.error?(c=s.jsx(ps,{kind:"errored",error:t.error,onRetry:l,connectionsHref:i}),e[8]=i,e[9]=l,e[10]=t.error,e[11]=c):c=e[11],c}}}const Dl=new Set(["clone-failed","install-failed","start-failed","crashed"]);function Al(n){if(n.fastPreviewActive)return{kind:"ready",devServerReady:!1,sandboxWarming:!1};if(n.previewState.kind!=="iframe")return{kind:"sandbox-card",state:n.previewState};const e=n.lifecyclePhase==="running",t=!e&&!Dl.has(n.lifecyclePhase);return{kind:"ready",devServerReady:e,sandboxWarming:t}}function Xs(n,e){const t=e.replace(/\s*\(copy(?:\s+\d+)?\)\s*$/,"").trim(),o=`${t} (copy)`;if(!n.has(o))return o;for(let a=2;a<1e3;a++){const l=`${t} (copy ${a})`;if(!n.has(l))return l}return`${t} (copy ${Date.now()})`}function Ll(n,e){const t=Ot,o=e.replace(/-copy(?:-\d+)?$/,""),a=`${o}-copy`;if(!n.has(t(a)))return a;for(let l=2;l<1e3;l++){const i=`${o}-copy-${l}`;if(!n.has(t(i)))return i}return`${o}-copy-${Date.now()}`}function $l(n,e){const t=e.replace(/_copy(?:_\d+)?$/,""),o=`${t}_copy`;if(!Object.hasOwn(n,o))return o;for(let a=2;a<1e3;a++){const l=`${t}_copy_${a}`;if(!Object.hasOwn(n,l))return l}return`${t}_copy_${Date.now()}`}function Ol(n){const e=An(n.newName),t={...n.source,name:n.newName,path:n.newPath};return{key:e,data:t}}function Rl(n,e){return ra(n,e)}const Fl=1e3;function Il(n,e){for(let t=0;t<Fl;t++){const o=An(e);if(!Object.hasOwn(n,o))return o}throw new Error("Could not generate a unique page block key")}const Kl={create:"sandbox.pageFormDialog.titleCreate",duplicate:"sandbox.pageFormDialog.titleDuplicate",rename:"sandbox.pageFormDialog.titleRename"},zl={create:"sandbox.pageFormDialog.submitCreate",duplicate:"sandbox.pageFormDialog.submitDuplicate",rename:"sandbox.pageFormDialog.submitSave"},Ml={create:"sandbox.pageFormDialog.pendingCreate",duplicate:"sandbox.pageFormDialog.pendingDuplicate",rename:"sandbox.pageFormDialog.pendingSave"};function Vl(n){const e=ie.c(88),{open:t,mode:o,initialName:a,initialPath:l,isPending:i,error:c,templates:r,validate:d,onSubmit:h,onOpenChange:m}=n,f=i===void 0?!1:i,u=je(),[p,b]=A.useState(a),[g,v]=A.useState(l),[y,k]=A.useState(hs),[S,N]=A.useState(null),[B,E]=A.useState(t);t!==B&&(E(t),t&&(b(a),v(l),k(hs),N(null)));const w=o==="create"&&!!r?.length;let T;e[0]!==f||e[1]!==m?(T=he=>{!he&&!f&&(N(null),m(!1))},e[0]=f,e[1]=m,e[2]=T):T=e[2];const R=T;let L;e[3]!==f||e[4]!==p||e[5]!==h||e[6]!==g||e[7]!==w||e[8]!==y||e[9]!==d?(L=async he=>{he.preventDefault();const ve=p.trim(),ge=g.trim();if(!ve||!ge||f)return;const De=Aa(ge);if(De){N(De);return}const ke=d?.({name:ve,path:ge});if(ke){N(ke);return}N(null),await h({name:ve,path:ge,templateKey:w&&y!==hs?y:null})},e[3]=f,e[4]=p,e[5]=h,e[6]=g,e[7]=w,e[8]=y,e[9]=d,e[10]=L):L=e[10];const G=L,F=S??c,_=Kl[o];let $;e[11]!==u||e[12]!==_?($=u(_),e[11]=u,e[12]=_,e[13]=$):$=e[13];let K;e[14]!==$?(K=s.jsx(pt,{children:s.jsx(lt,{children:$})}),e[14]=$,e[15]=K):K=e[15];let z;e[16]!==f||e[17]!==w||e[18]!==u||e[19]!==y||e[20]!==r?(z=w&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{htmlFor:"page-form-template",className:"text-xs font-medium text-muted-foreground",children:u("sandbox.pageFormDialog.labelTemplate")}),s.jsx(ca,{id:"page-form-template",value:y,onChange:k,templates:r??[],disabled:f})]}),e[16]=f,e[17]=w,e[18]=u,e[19]=y,e[20]=r,e[21]=z):z=e[21];let M;e[22]!==u?(M=u("sandbox.pageFormDialog.labelName"),e[22]=u,e[23]=M):M=e[23];let W;e[24]!==M?(W=s.jsx("label",{htmlFor:"page-form-name",className:"text-xs font-medium text-muted-foreground",children:M}),e[24]=M,e[25]=W):W=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=he=>b(he.target.value),e[26]=O):O=e[26];let I;e[27]!==u?(I=u("sandbox.pageFormDialog.placeholderName"),e[27]=u,e[28]=I):I=e[28];let D;e[29]!==f||e[30]!==p||e[31]!==I?(D=s.jsx(Xe,{id:"page-form-name",value:p,onChange:O,placeholder:I,autoFocus:!0,disabled:f}),e[29]=f,e[30]=p,e[31]=I,e[32]=D):D=e[32];let U;e[33]!==D||e[34]!==W?(U=s.jsxs("div",{className:"space-y-1.5",children:[W,D]}),e[33]=D,e[34]=W,e[35]=U):U=e[35];let X;e[36]!==u?(X=u("sandbox.pageFormDialog.labelPath"),e[36]=u,e[37]=X):X=e[37];let ee;e[38]!==X?(ee=s.jsx("label",{htmlFor:"page-form-path",className:"text-xs font-medium text-muted-foreground",children:X}),e[38]=X,e[39]=ee):ee=e[39];let te;e[40]===Symbol.for("react.memo_cache_sentinel")?(te=he=>v(he.target.value),e[40]=te):te=e[40];let re;e[41]!==u?(re=u("sandbox.pageFormDialog.placeholderPath"),e[41]=u,e[42]=re):re=e[42];let Z;e[43]!==f||e[44]!==g||e[45]!==re?(Z=s.jsx(Xe,{id:"page-form-path",value:g,onChange:te,placeholder:re,disabled:f}),e[43]=f,e[44]=g,e[45]=re,e[46]=Z):Z=e[46];let ae;e[47]!==ee||e[48]!==Z?(ae=s.jsxs("div",{className:"space-y-1.5",children:[ee,Z]}),e[47]=ee,e[48]=Z,e[49]=ae):ae=e[49];let le;e[50]!==F?(le=F&&s.jsx("p",{className:"text-xs text-destructive",children:F}),e[50]=F,e[51]=le):le=e[51];let oe;e[52]!==U||e[53]!==ae||e[54]!==le||e[55]!==z?(oe=s.jsxs("div",{className:"space-y-4 py-4",children:[z,U,ae,le]}),e[52]=U,e[53]=ae,e[54]=le,e[55]=z,e[56]=oe):oe=e[56];let P;e[57]!==m?(P=()=>m(!1),e[57]=m,e[58]=P):P=e[58];let q;e[59]!==u?(q=u("sandbox.pageFormDialog.buttonCancel"),e[59]=u,e[60]=q):q=e[60];let ne;e[61]!==f||e[62]!==P||e[63]!==q?(ne=s.jsx(Ee,{type:"button",variant:"outline",onClick:P,disabled:f,children:q}),e[61]=f,e[62]=P,e[63]=q,e[64]=ne):ne=e[64];let se;e[65]!==f||e[66]!==p||e[67]!==g?(se=!p.trim()||!g.trim()||f,e[65]=f,e[66]=p,e[67]=g,e[68]=se):se=e[68];let ce;e[69]!==f||e[70]!==o||e[71]!==u?(ce=f?s.jsxs(s.Fragment,{children:[s.jsx(at,{className:"size-3.5"}),u(Ml[o])]}):u(zl[o]),e[69]=f,e[70]=o,e[71]=u,e[72]=ce):ce=e[72];let ue;e[73]!==se||e[74]!==ce?(ue=s.jsx(Ee,{type:"submit",disabled:se,children:ce}),e[73]=se,e[74]=ce,e[75]=ue):ue=e[75];let j;e[76]!==ne||e[77]!==ue?(j=s.jsxs(ht,{children:[ne,ue]}),e[76]=ne,e[77]=ue,e[78]=j):j=e[78];let V;e[79]!==G||e[80]!==oe||e[81]!==j||e[82]!==K?(V=s.jsx(it,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:G,children:[K,oe,j]})}),e[79]=G,e[80]=oe,e[81]=j,e[82]=K,e[83]=V):V=e[83];let fe;return e[84]!==R||e[85]!==t||e[86]!==V?(fe=s.jsx(rt,{open:t,onOpenChange:R,children:V}),e[84]=R,e[85]=t,e[86]=V,e[87]=fe):fe=e[87],fe}const Gl=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}],Zs={from:"",to:"",type:"temporary",discardQueryParameters:!1};function Ul(n){const e=ie.c(111),{open:t,isPending:o,error:a,onSubmit:l,onOpenChange:i}=n,c=o===void 0?!1:o,r=je(),[d,h]=A.useState(Zs),[m,f]=A.useState(null),[u,p]=A.useState(t);t!==u&&(p(t),t&&(h(Zs),f(null)));let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=be=>h(Le=>({...Le,...be})),e[0]=b):b=e[0];const g=b;let v;e[1]!==c||e[2]!==i?(v=be=>{!be&&!c&&(f(null),i(!1))},e[1]=c,e[2]=i,e[3]=v):v=e[3];const y=v;let k;e[4]!==c||e[5]!==l||e[6]!==d||e[7]!==r?(k=async be=>{be.preventDefault();const Le=d.from.trim(),Ie=d.to.trim();if(!Le||!Ie||c){f(r("sandbox.redirectFormDialog.errorRequired"));return}f(null),await l({...d,from:Le,to:Ie})},e[4]=c,e[5]=l,e[6]=d,e[7]=r,e[8]=k):k=e[8];const S=k,N=m??a;let B;e[9]!==c||e[10]!==d.from||e[11]!==d.to?(B=!!d.from.trim()&&!!d.to.trim()&&!c,e[9]=c,e[10]=d.from,e[11]=d.to,e[12]=B):B=e[12];const E=B;let w;e[13]!==r?(w=r("sandbox.redirectFormDialog.title"),e[13]=r,e[14]=w):w=e[14];let T;e[15]!==w?(T=s.jsx(pt,{children:s.jsx(lt,{children:w})}),e[15]=w,e[16]=T):T=e[16];let R;e[17]!==r?(R=r("sandbox.redirectEditor.fromLabel"),e[17]=r,e[18]=R):R=e[18];let L;e[19]!==R?(L=s.jsx(ze,{htmlFor:"redirect-form-from",children:R}),e[19]=R,e[20]=L):L=e[20];const G=d.from;let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=be=>g({from:be.target.value}),e[21]=F):F=e[21];let _;e[22]!==r?(_=r("sandbox.redirectEditor.fromPlaceholder"),e[22]=r,e[23]=_):_=e[23];let $;e[24]!==c||e[25]!==d.from||e[26]!==_?($=s.jsx(Xe,{id:"redirect-form-from",value:G,onChange:F,placeholder:_,autoFocus:!0,disabled:c}),e[24]=c,e[25]=d.from,e[26]=_,e[27]=$):$=e[27];let K;e[28]!==$||e[29]!==L?(K=s.jsxs("div",{className:"space-y-1.5",children:[L,$]}),e[28]=$,e[29]=L,e[30]=K):K=e[30];let z;e[31]!==r?(z=r("sandbox.redirectEditor.toLabel"),e[31]=r,e[32]=z):z=e[32];let M;e[33]!==z?(M=s.jsx(ze,{htmlFor:"redirect-form-to",children:z}),e[33]=z,e[34]=M):M=e[34];const W=d.to;let O;e[35]===Symbol.for("react.memo_cache_sentinel")?(O=be=>g({to:be.target.value}),e[35]=O):O=e[35];let I;e[36]!==r?(I=r("sandbox.redirectEditor.toPlaceholder"),e[36]=r,e[37]=I):I=e[37];let D;e[38]!==c||e[39]!==d.to||e[40]!==I?(D=s.jsx(Xe,{id:"redirect-form-to",value:W,onChange:O,placeholder:I,disabled:c}),e[38]=c,e[39]=d.to,e[40]=I,e[41]=D):D=e[41];let U;e[42]!==M||e[43]!==D?(U=s.jsxs("div",{className:"space-y-1.5",children:[M,D]}),e[42]=M,e[43]=D,e[44]=U):U=e[44];let X;e[45]!==r?(X=r("sandbox.redirectEditor.typeLabel"),e[45]=r,e[46]=X):X=e[46];let ee;e[47]!==X?(ee=s.jsx(ze,{htmlFor:"redirect-form-type",children:X}),e[47]=X,e[48]=ee):ee=e[48];const te=d.type;let re;e[49]===Symbol.for("react.memo_cache_sentinel")?(re=be=>g({type:be}),e[49]=re):re=e[49];let Z;e[50]!==r?(Z=r("sandbox.redirectEditor.typePlaceholder"),e[50]=r,e[51]=Z):Z=e[51];let ae;e[52]!==Z?(ae=s.jsx(nl,{id:"redirect-form-type",className:"w-full",children:s.jsx(ol,{placeholder:Z})}),e[52]=Z,e[53]=ae):ae=e[53];let le;e[54]!==r?(le=Gl.map(be=>s.jsx(sl,{value:be.value,children:r(be.labelKey,{status:Rn[be.value]})},be.value)),e[54]=r,e[55]=le):le=e[55];let oe;e[56]!==le?(oe=s.jsx(al,{children:le}),e[56]=le,e[57]=oe):oe=e[57];let P;e[58]!==c||e[59]!==d.type||e[60]!==ae||e[61]!==oe?(P=s.jsxs(ll,{value:te,onValueChange:re,disabled:c,children:[ae,oe]}),e[58]=c,e[59]=d.type,e[60]=ae,e[61]=oe,e[62]=P):P=e[62];let q;e[63]!==ee||e[64]!==P?(q=s.jsxs("div",{className:"space-y-1.5",children:[ee,P]}),e[63]=ee,e[64]=P,e[65]=q):q=e[65];let ne;e[66]===Symbol.for("react.memo_cache_sentinel")?(ne=be=>g({discardQueryParameters:be===!0}),e[66]=ne):ne=e[66];let se;e[67]!==c||e[68]!==d.discardQueryParameters?(se=s.jsx(Zt,{checked:d.discardQueryParameters,disabled:c,onCheckedChange:ne}),e[67]=c,e[68]=d.discardQueryParameters,e[69]=se):se=e[69];let ce;e[70]!==r?(ce=r("sandbox.redirectEditor.discardQueryParameters"),e[70]=r,e[71]=ce):ce=e[71];let ue;e[72]!==ce?(ue=s.jsx("span",{className:"text-sm",children:ce}),e[72]=ce,e[73]=ue):ue=e[73];let j;e[74]!==se||e[75]!==ue?(j=s.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[se,ue]}),e[74]=se,e[75]=ue,e[76]=j):j=e[76];let V;e[77]!==N?(V=N&&s.jsx("p",{className:"text-xs text-destructive",children:N}),e[77]=N,e[78]=V):V=e[78];let fe;e[79]!==K||e[80]!==U||e[81]!==q||e[82]!==j||e[83]!==V?(fe=s.jsxs("div",{className:"space-y-4 py-4",children:[K,U,q,j,V]}),e[79]=K,e[80]=U,e[81]=q,e[82]=j,e[83]=V,e[84]=fe):fe=e[84];let he;e[85]!==i?(he=()=>i(!1),e[85]=i,e[86]=he):he=e[86];let ve;e[87]!==r?(ve=r("sandbox.redirectFormDialog.cancel"),e[87]=r,e[88]=ve):ve=e[88];let ge;e[89]!==c||e[90]!==he||e[91]!==ve?(ge=s.jsx(Ee,{type:"button",variant:"outline",onClick:he,disabled:c,children:ve}),e[89]=c,e[90]=he,e[91]=ve,e[92]=ge):ge=e[92];const De=!E;let ke;e[93]!==c||e[94]!==r?(ke=c?s.jsxs(s.Fragment,{children:[s.jsx(at,{className:"size-3.5"}),r("sandbox.redirectFormDialog.pending")]}):r("sandbox.redirectFormDialog.submit"),e[93]=c,e[94]=r,e[95]=ke):ke=e[95];let Ce;e[96]!==De||e[97]!==ke?(Ce=s.jsx(Ee,{type:"submit",disabled:De,children:ke}),e[96]=De,e[97]=ke,e[98]=Ce):Ce=e[98];let Pe;e[99]!==ge||e[100]!==Ce?(Pe=s.jsxs(ht,{children:[ge,Ce]}),e[99]=ge,e[100]=Ce,e[101]=Pe):Pe=e[101];let Te;e[102]!==S||e[103]!==fe||e[104]!==Pe||e[105]!==T?(Te=s.jsx(it,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:S,children:[T,fe,Pe]})}),e[102]=S,e[103]=fe,e[104]=Pe,e[105]=T,e[106]=Te):Te=e[106];let Ae;return e[107]!==y||e[108]!==t||e[109]!==Te?(Ae=s.jsx(rt,{open:t,onOpenChange:y,children:Te}),e[107]=y,e[108]=t,e[109]=Te,e[110]=Ae):Ae=e[110],Ae}function Hl(n){const e=ie.c(70),{open:t,blockKey:o,initialName:a,isPending:l,onSubmit:i,onOpenChange:c}=n,r=l===void 0?!1:l,d=je(),[h,m]=A.useState(a),[f,u]=A.useState(t);t!==f&&(u(t),t&&m(a));let p;e[0]!==r||e[1]!==c?(p=te=>{!te&&!r&&c(!1)},e[0]=r,e[1]=c,e[2]=p):p=e[2];const b=p;let g;e[3]!==r||e[4]!==h||e[5]!==i?(g=async te=>{te.preventDefault();const re=h.trim();!re||r||await i(re)},e[3]=r,e[4]=h,e[5]=i,e[6]=g):g=e[6];const v=g;let y;e[7]!==d?(y=d("sandbox.sectionRenameDialog.title"),e[7]=d,e[8]=y):y=e[8];let k;e[9]!==y?(k=s.jsx(lt,{children:y}),e[9]=y,e[10]=k):k=e[10];let S;e[11]!==d?(S=d("sandbox.sectionRenameDialog.description"),e[11]=d,e[12]=S):S=e[12];let N;e[13]!==S?(N=s.jsx(Mt,{children:S}),e[13]=S,e[14]=N):N=e[14];let B;e[15]!==k||e[16]!==N?(B=s.jsxs(pt,{children:[k,N]}),e[15]=k,e[16]=N,e[17]=B):B=e[17];let E;e[18]!==d?(E=d("sandbox.sectionRenameDialog.nameLabel"),e[18]=d,e[19]=E):E=e[19];let w;e[20]!==E?(w=s.jsx("label",{htmlFor:"section-rename-name",className:"text-xs font-medium text-muted-foreground",children:E}),e[20]=E,e[21]=w):w=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=te=>m(te.target.value),e[22]=T):T=e[22];let R;e[23]!==r||e[24]!==h?(R=s.jsx(Xe,{id:"section-rename-name",value:h,onChange:T,autoFocus:!0,disabled:r}),e[23]=r,e[24]=h,e[25]=R):R=e[25];let L;e[26]!==w||e[27]!==R?(L=s.jsxs("div",{className:"space-y-1.5",children:[w,R]}),e[26]=w,e[27]=R,e[28]=L):L=e[28];let G;e[29]!==d?(G=d("sandbox.sectionRenameDialog.keyLabel"),e[29]=d,e[30]=G):G=e[30];let F;e[31]!==G?(F=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:G}),e[31]=G,e[32]=F):F=e[32];let _;e[33]!==o?(_=s.jsx(Xe,{value:o,readOnly:!0,disabled:!0,className:"font-mono"}),e[33]=o,e[34]=_):_=e[34];let $;e[35]!==F||e[36]!==_?($=s.jsxs("div",{className:"space-y-1.5",children:[F,_]}),e[35]=F,e[36]=_,e[37]=$):$=e[37];let K;e[38]!==L||e[39]!==$?(K=s.jsxs("div",{className:"space-y-4 py-4",children:[L,$]}),e[38]=L,e[39]=$,e[40]=K):K=e[40];let z;e[41]!==c?(z=()=>c(!1),e[41]=c,e[42]=z):z=e[42];let M;e[43]!==d?(M=d("sandbox.sectionRenameDialog.cancel"),e[43]=d,e[44]=M):M=e[44];let W;e[45]!==r||e[46]!==z||e[47]!==M?(W=s.jsx(Ee,{type:"button",variant:"outline",onClick:z,disabled:r,children:M}),e[45]=r,e[46]=z,e[47]=M,e[48]=W):W=e[48];let O;e[49]!==r||e[50]!==h?(O=!h.trim()||r,e[49]=r,e[50]=h,e[51]=O):O=e[51];let I;e[52]!==r||e[53]!==d?(I=r?s.jsxs(s.Fragment,{children:[s.jsx(at,{className:"size-3.5"}),d("sandbox.sectionRenameDialog.saving")]}):d("sandbox.sectionRenameDialog.save"),e[52]=r,e[53]=d,e[54]=I):I=e[54];let D;e[55]!==O||e[56]!==I?(D=s.jsx(Ee,{type:"submit",disabled:O,children:I}),e[55]=O,e[56]=I,e[57]=D):D=e[57];let U;e[58]!==W||e[59]!==D?(U=s.jsxs(ht,{children:[W,D]}),e[58]=W,e[59]=D,e[60]=U):U=e[60];let X;e[61]!==v||e[62]!==K||e[63]!==U||e[64]!==B?(X=s.jsx(it,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:v,children:[B,K,U]})}),e[61]=v,e[62]=K,e[63]=U,e[64]=B,e[65]=X):X=e[65];let ee;return e[66]!==b||e[67]!==t||e[68]!==X?(ee=s.jsx(rt,{open:t,onOpenChange:b,children:X}),e[66]=b,e[67]=t,e[68]=X,e[69]=ee):ee=e[69],ee}function ql(n){const e=ie.c(7),{type:t}=n,o=Rn[t];let a;e[0]!==o?(a=s.jsx(He,{asChild:!0,children:s.jsx("span",{className:"shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground",children:o})}),e[0]=o,e[1]=a):a=e[1];const l=t==="permanent"?"Permanent":"Temporary";let i;e[2]!==l?(i=s.jsx(qe,{side:"left",children:l}),e[2]=l,e[3]=i):i=e[3];let c;return e[4]!==a||e[5]!==i?(c=s.jsxs(We,{children:[a,i]}),e[4]=a,e[5]=i,e[6]=c):c=e[6],c}const Wl=60,xs={post:"blog/loaders/Blogpost.ts",author:"blog/loaders/Author.ts",category:"blog/loaders/Category.ts"},Ds=["posts","authors","categories"],Pt={posts:"post",authors:"author",categories:"category"};function ot(n){return Ds.includes(n)}const ts={posts:"post",authors:"author",categories:"category"},Wn={posts:xs.post,authors:xs.author,categories:xs.category},Yl=Object.fromEntries(Object.entries(Wn).map(([n,e])=>[e,n]));function Ql(n){return typeof n=="string"?Yl[n]??null:null}function Oe(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function Q(n){return typeof n=="string"?n:""}function Jl(n,e){switch(n){case"posts":return{label:Q(e.title)||"Untitled post",subtitle:Q(e.slug),missing:ss(e)};case"authors":return{label:Q(e.name)||"Unnamed author",subtitle:Q(e.email),missing:[]};case"categories":return{label:Q(e.name)||"Unnamed category",subtitle:Q(e.slug),slug:Q(e.slug),parentSlug:Q(e.parentSlug),missing:ii(e)};default:{const t=n;throw new Error(`Unhandled blog kind: ${String(t)}`)}}}function Yn(n){const e={posts:[],authors:[],categories:[]},t=[];for(const[o,a]of Object.entries(n)){const l=Oe(a);if(!l)continue;const i=Ql(l.__resolveType);if(!i)continue;const c=Oe(l[ts[i]])??{},r={key:o,kind:i,...Jl(i,c)};e[i].push(r),t.push({entry:r,key:xt(Q(c[i==="posts"?"title":"name"]))})}Xl(t);for(const o of Ds)e[o].sort((a,l)=>a.label.localeCompare(l.label));return e}function Xl(n){const e=new Map;for(const{entry:t,key:o}of n){if(!o)continue;const a=`${t.kind}:${o}`;e.set(a,(e.get(a)??0)+1)}for(const{entry:t,key:o}of n)o&&(e.get(`${t.kind}:${o}`)??0)>1&&(t.duplicateName=!0)}function Zl(n,e){return Yn(n)[e]}function Ge(n,e){return Zl(n,e).map(t=>({key:t.key,payload:ct(Oe(n[t.key])??void 0,e)}))}const en=Object.freeze({});function ct(n,e){return n?Oe(n[ts[e]])??en:en}function mt(n,e,t){return{name:n,__resolveType:Wn[e],[ts[e]]:t}}function ld({records:n,selected:e,valueField:t,toRef:o}){const a=Array.isArray(e)?e:[],l=f=>typeof f=="string"?f:Q(Oe(f)?.[t]),i=f=>typeof f=="string"?f:Q(Oe(f)?.name),c=f=>{const u=l(f),p=u?n.find(({payload:g})=>Q(g[t])===u):void 0;if(p)return p;const b=i(f);return b?n.find(({payload:g})=>Q(g.name)===b):void 0},r=n.map(({key:f,payload:u})=>({value:f,label:Q(u.name)||Q(u[t])||f})),d=new Map,h=[];return a.forEach((f,u)=>{const p=c(f);if(p){h.includes(p.key)||h.push(p.key);return}const b=`unresolved:${u}`;d.set(b,f),h.push(b),r.push({value:b,label:i(f)||l(f)||"Unknown"})}),{options:r,selectedValues:h,refsForValues:f=>f.map(u=>{const p=n.find(b=>b.key===u);return p?o(p.payload):d.get(u)}).filter(u=>u!==void 0)}}function Qn(n){return Ge(n,"authors").map(({payload:e})=>({...e,name:Q(e.name),email:Q(e.email)})).filter(e=>e.email)}function Ze(n){return Array.isArray(n)?n:[]}function Je(n){if(typeof n=="string")return n;const e=Oe(n);return e?Q(e.slug):""}function Jn(n){if(typeof n=="string")return n;const e=Oe(n);return e?Q(e.email):""}function ss(n){const e=[];return Q(n.title).trim()||e.push("Title"),Q(n.slug).trim()||e.push("Slug"),Ze(n.categories).map(Je).filter(Boolean).length===0&&e.push("Category"),Q(n.excerpt).trim()||e.push("Excerpt"),Q(n.image).trim()||e.push("Cover image"),e}const As=["draft","generating","awaiting_review","scheduled","published","archived"],Xn=8;function bt(n){switch(Q(n.status)){case"draft":case"idea":return"draft";case"generating":return"generating";case"awaiting_review":case"in_review":return"awaiting_review";case"scheduled":return"scheduled";case"published":return"published";case"archived":return"archived";case"":return"published";default:return"awaiting_review"}}function id(n){return bt(n)==="archived"}function ei(n,e){return e!=="published"&&e!=="scheduled"||bt(n)===e?!1:ss(n).length>0}function ti(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate()+1,Xn).toISOString()}function Vt(n,e,t){if(e!=="scheduled")return{...n,status:e,scheduledDatetime:""};const o=Q(n.scheduledDatetime);return{...n,status:"scheduled",scheduledDatetime:Number.isNaN(new Date(o).getTime())?ti(t):o}}function Zn(n,e=po(n)){return Ge(n,"posts").map(({key:t,payload:o})=>({key:t,duplicateTitle:e.has(t),title:Q(o.title)||"Untitled post",slug:Q(o.slug),date:Q(o.date),scheduledDatetime:Q(o.scheduledDatetime),categorySlugs:Ze(o.categories).map(Je).filter(Boolean),authorEmails:Ze(o.authors).map(Jn).filter(Boolean),missing:ss(o),status:bt(o),form:"live"}))}const eo="blog-manager/posts/";function to(n){return n.startsWith(eo)}function Tt(n){return n.split("/").pop()??n}function Gt(n){return`${eo}${n}`}function si(n){return`collections/blog/posts/${n}`}function vs(){return gt(12)}function ni(n){const e=Oe(n.planning)??{},t=Oe(e.format);return{ideaKey:Q(e.ideaKey)||void 0,pillarKey:Q(e.pillarKey)||void 0,pillarTitle:Q(e.pillarTitle)||void 0,format:t?{name:Q(t.name),value:Q(t.value)}:void 0,brief:Q(e.brief)||void 0}}function so(n){return{title:n.title,slug:"",excerpt:"",date:n.now.toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[],status:"draft",planning:n.planning??{}}}function dt(n,e){return{name:n,[ts.posts]:e}}function oi(n,e){return to(n)?dt(n,e):mt(n,"posts",e)}function no(n){const e=[];for(const[t,o]of Object.entries(n)){if(!to(t))continue;const a=Oe(o);a&&e.push({key:t,payload:ct(a,"posts")})}return e}function oo(n){return[...no(n),...Ge(n,"posts")]}function ai(n){const e=po(n);return[...no(n).map(({key:o,payload:a})=>({key:o,duplicateTitle:e.has(o),title:Q(a.title)||"Untitled post",slug:Q(a.slug),date:Q(a.date),scheduledDatetime:Q(a.scheduledDatetime),categorySlugs:Ze(a.categories).map(Je).filter(Boolean),authorEmails:Ze(a.authors).map(Jn).filter(Boolean),missing:ss(a),status:bt(a),form:"planning"})),...Zn(n,e)]}function li(n,e,t){const o=Vt(n.payload,e,t),a=Tt(n.key),l=e==="scheduled"||e==="published"?"live":"planning",i=l==="live"?si(a):Gt(a),c=l==="live"?mt(i,"posts",o):dt(i,o);return{writes:{[i]:c},deletes:i===n.key?[]:[n.key]}}function rd(n,e,t){const o=Ze(n.categories);if(!o.some(r=>Je(r)===e))return n;let a=!1;const l=o.map(r=>{const d=Je(r);if(d!==e&&d!==t.slug)return r;const h=Oe(r);return h&&Q(h.slug)===t.slug&&Q(h.name)===t.name?r:(a=!0,{name:t.name,slug:t.slug})});if(!a){const r=o.map(Je).filter(Boolean);if(new Set(r).size===r.length)return n}const i=new Set,c=l.filter(r=>{const d=Je(r);return d?i.has(d)?!1:(i.add(d),!0):!0});return{...n,categories:c}}function ii(n){const e=[];return Q(n.name).trim()||e.push("Name"),Q(n.slug).trim()||e.push("Slug"),e}function ri(n,e){const t=Ze(n.categories);return t.some(o=>Je(o)===e)?{...n,categories:t.filter(o=>Je(o)!==e)}:n}function cd(n,e,t){return Q(n.parentSlug)!==e?n:{...n,parentSlug:t}}function ci(n){const e=Q(n.status),t=e==="idea"||e==="in_review"?{status:bt(n)}:{};return{...n,...t,dateModified:new Date().toISOString()}}function gt(n){const e=new Uint8Array(Math.ceil(n/2));return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("").slice(0,n)}function bs(n,e){const t=`collections/blog/${e}/${gt(12)}`;if(!Object.hasOwn(n,t))return t;throw new Error("Could not generate a unique blog block key")}function ao(n){switch(n){case"posts":return{title:"Untitled post",excerpt:"",slug:`untitled-${gt(8)}`,date:new Date().toISOString().slice(0,10),image:"",alt:"",authors:[],categories:[],sections:[]};case"authors":return{name:"New author",type:"Person",email:"",jobTitle:"",company:"",url:"",avatar:""};case"categories":return{name:"New category",slug:`category-${gt(8)}`,description:"",sections:[]};default:{const e=n;throw new Error(`Unhandled blog kind: ${String(e)}`)}}}const di={Paragraph:{title:"Paragraph",description:"Rich text content",iconName:"Pilcrow01"},Heading:{title:"Heading",description:"Section title (H1–H6)",iconName:"HeadingSquare"},Quote:{title:"Quote",description:"Pull quote",iconName:"MessageTextSquare02"},Code:{title:"Code",description:"Code block with syntax highlighting",iconName:"Code02"},List:{title:"List",description:"Bulleted or numbered list",iconName:"List"},BlockImage:{title:"Image",description:"Image with optional caption",iconName:"Image01"},Video:{title:"Video",description:"Embedded video",iconName:"PlayCircle"},Divider:{title:"Divider",description:"Horizontal divider",iconName:"Divider"},Cta:{title:"Call to action",description:"Button linking to a URL",iconName:"CursorClick01"},Callout:{title:"Callout",description:"Highlighted note, tip or warning",iconName:"Lightbulb02"},Stat:{title:"Stat",description:"Single key metric",iconName:"BarChartSquareUp"},StatGroup:{title:"Stat group",description:"Row of metrics",iconName:"BarChartSquare02"},CardGroup:{title:"Card group",description:"Grid of cards",iconName:"LayoutGrid01"},Checklist:{title:"Checklist",description:"List of check items",iconName:"CheckSquare"},Steps:{title:"Steps",description:"Step-by-step guide",iconName:"LayersThree01"},Comparison:{title:"Comparison",description:"Side-by-side comparison",iconName:"Columns03"},Table:{title:"Table",description:"Rows and columns of structured data",iconName:"Table"},ProductCard:{title:"Product card",description:"Single product",iconName:"Tag01"},ProductShelf:{title:"Product shelf",description:"Row of products",iconName:"ShoppingBag01"}},tn="Box";function ui(n){return n.startsWith("site/")?"site":"app"}function mi(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")||n.startsWith("/")}function kt(...n){for(const e of n)if(e!==void 0)return e}function sn(n){if(n&&!(n.includes("/")||/\.(tsx?|jsx?)$/.test(n)))return n}function fi(n){const e=n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim();return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():n}function lo(n){const e=new Set,t=[],o=n.manifest?.blocks??{};for(const a of Object.values(o))for(const l of Object.keys(a)){if(!hi(l)||e.has(l))continue;e.add(l);const i=Ps(l,n),c=ns(l),r=di[c],d=ui(l),h=sn(i.title),m=sn(i.description),f=(d==="site"?kt(h,r?.title):kt(r?.title,h))??fi(c),u=d==="site"?kt(m,r?.description):kt(r?.description,m),p=d==="site"?i.icon:void 0,b=p&&mi(p)?p:void 0,g=b!==void 0?r?.iconName??tn:kt(p,r?.iconName)??tn;t.push({resolveType:l,title:f,description:u,iconName:g,iconUrl:b,source:d})}return t.sort((a,l)=>a.title.localeCompare(l.title))}function ns(n){return(n.split("/").pop()??n).replace(/\.(tsx?|jsx?)$/,"")}const pi=["blog/sections/blocks/","site/sections/Blog/Post/"];function hi(n){return pi.some(e=>n.startsWith(e))}const Ls="blog-manager-brand";function Ke(n){if(!Array.isArray(n))return[];const e=[];for(const t of n){if(typeof t=="string"){t.trim()&&e.push({name:t,value:""});continue}const o=Oe(t);o&&e.push({name:Q(o.name),value:Q(o.value)})}return e}function Me(n){return n.filter(e=>e.name.trim()||e.value.trim())}const gi=6e4,xi=4e3;function bi(n){const e=[],t=new Set,o=(a,l)=>{if(typeof a=="string"){if(!a.includes(" ")||a.length<4||/^(https?:)?\/\//.test(a)||/^data:/.test(a))return;const i=`${l}: ${a.trim()}`;if(t.has(i))return;t.add(i),e.push(i);return}if(Array.isArray(a)){for(const i of a)o(i,l);return}if(a&&typeof a=="object")for(const[i,c]of Object.entries(a))i!=="__resolveType"&&o(c,i)};return o(n,"block"),e.join(`
3
3
  `)}function dd(n,e){const t=new Map,o=d=>{const h=t.get(d);if(h!==void 0)return h;const m=bi(n[d]).slice(0,xi);return t.set(d,m),m},a=(d,h)=>o(h).length-o(d).length,l=[...Ge(n,"posts").map(d=>d.key).sort(a),...Ge(n,"categories").map(d=>d.key),...[...e].sort(a)],i=[],c=new Set;let r=gi;for(const d of l){if(i.length>=Wl)break;if(c.has(d)||!n[d])continue;c.add(d);const h=o(d);if(h.length>r)break;i.push({key:d,content:h}),r-=h.length}return i}const io="blog-manager/themes/";function yi(){return`${io}${crypto.randomUUID()}`}function vi(n,e){return{name:n,title:e.title,body:e.body,pillarKey:e.pillarKey??"",createdAt:e.createdAt}}function ro(n){const e=[];for(const[t,o]of Object.entries(n)){if(!t.startsWith(io))continue;const a=Oe(o);a&&e.push({key:t,title:Q(a.title),body:Q(a.body),pillarKey:Q(a.pillarKey)||void 0,createdAt:Q(a.createdAt)})}return e.sort((t,o)=>o.createdAt.localeCompare(t.createdAt)||t.title.localeCompare(o.title))}const co="blog-manager/pillars/";function ud(){return`${co}${crypto.randomUUID()}`}function uo(n){const e=[];for(const[t,o]of Object.entries(n)){if(!t.startsWith(co))continue;const a=Oe(o);a&&e.push({key:t,title:Q(a.title),body:Q(a.body),createdAt:Q(a.createdAt),formats:Ze(a.formats).map(l=>Q(l)).filter(Boolean)})}return e.sort((t,o)=>o.createdAt.localeCompare(t.createdAt)||t.title.localeCompare(o.title))}const mo="blog-manager-formats",ji=40;function md(n){return Ge(n,"posts").slice(0,ji).map(({key:e,payload:t})=>({key:e,title:Q(t.title),sections:Ze(t.sections).map(o=>Q(Oe(o)?.__resolveType)).filter(Boolean).map(ns)}))}function ki(n){const e=new Map;for(const t of lo(n)){const o=ns(t.resolveType);e.has(o)||e.set(o,{name:o,title:t.title,description:t.description})}return[...e.values()]}function Si(n){const e=new Set;for(const t of n.matchAll(/(?:^|[\s([{>])@([A-Za-z][\w-]*)/g))t[1]&&e.add(t[1]);return[...e]}function fd(n,e){const t=new Set(e);return Si(n).filter(o=>!t.has(o))}const wi=["Heading","Paragraph","BlockImage","List","Cta"];function pd(n){const e=new Set(n);return wi.filter(t=>e.has(t))}function xt(n){return n.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/\s+/g," ").trim()}function hd(n,e,t,o){const a=xt(o);return a?fo(n,e).some(l=>l.key!==t&&xt(l.name)===a):!1}function fo(n,e){return e!=="posts"?Ge(n,e).map(({key:t,payload:o})=>({key:t,name:Q(o.name)})):oo(n).map(({key:t,payload:o})=>({key:t,name:Q(o.title)}))}function po(n){const e=new Map;for(const{key:o,name:a}of fo(n,"posts")){const l=xt(a);if(!l)continue;const i=e.get(l);i?i.push(o):e.set(l,[o])}const t=new Set;for(const o of e.values())if(o.length>1)for(const a of o)t.add(a);return t}function Ni(n,e){const t=new Set(n.map(xt)),o=[];for(const a of e){const l=xt(a.title);!l||t.has(l)||(t.add(l),o.push(a))}return o}const Ci=["companyName","language","description","tone","targetAudience"];function Pi(n){const e=Oe(n)??{},t=[];for(const o of Ci)Q(e[o]).trim()||t.push(o);return Me(Ke(e.dos)).length===0&&t.push("dos"),Me(Ke(e.avoid)).length===0&&t.push("avoid"),t}function ho(n){const e={};for(const t of lo(n)){const o=ns(t.resolveType);o in e||(e[o]=t.resolveType)}return e}function Ti(n,e){const t=[];for(const o of n){const a=e[o.type];if(a)switch(o.type){case"Heading":t.push({__resolveType:a,text:Q(o.text),level:o.level??"2"});break;case"Paragraph":t.push({__resolveType:a,html:Q(o.html)});break;case"List":t.push({__resolveType:a,items:(o.items??[]).join(`
4
4
  `),style:o.style??"unordered"});break;case"Quote":t.push({__resolveType:a,quote:Q(o.quote)});break;case"Callout":t.push({__resolveType:a,title:Q(o.title),body:Q(o.body),variant:o.variant??"info"});break;case"Cta":t.push({__resolveType:a,text:Q(o.text),href:Q(o.href)});break;case"Divider":t.push({__resolveType:a});break}}return t}const $s=80;function go(n){return n.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,$s)}function gd(n){return n.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").slice(0,$s)}function nn(n,e){const t=$s-e.length-1;return`${n.slice(0,t).replace(/-+$/,"")}-${e}`}function xo(n,e,t){const o=go(n)||`${t}-${gt(6)}`,a=new Set(e);if(!a.has(o))return o;for(let l=2;l<100;l++){const i=nn(o,String(l));if(!a.has(i))return i}return nn(o,gt(4))}function bo(n,e){return xo(n,e,"post")}function _i(n,e){return xo(n,e,"category")}function Bi({draft:n,resolveTypes:e,categories:t,authors:o,planning:a,takenSlugs:l,now:i}){const c=new Set(n.categorySlugs),r=new Set(n.authorEmails),d={title:n.title,slug:bo(n.title,l),date:i.toISOString().slice(0,10),excerpt:n.excerpt,image:"",alt:"",authors:o.filter(h=>r.has(h.email)),categories:t.filter(h=>c.has(h.slug)),seo:{title:n.seo.title,description:n.seo.description,image:""},sections:Ti(n.sections,e),planning:a??{}};return Vt(d,"awaiting_review",i)}const xd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],bd=["January","February","March","April","May","June","July","August","September","October","November","December"],yo=1440*60*1e3;function ut(n){const e=new Date(n);return e.setHours(0,0,0,0),e}function yd(n){return new Date(n.getFullYear(),n.getMonth(),1)}function vd(n,e){return new Date(n.getFullYear(),n.getMonth()+e,1)}function Ut(n,e){const t=new Date(n);return t.setDate(t.getDate()+e),t}function js(n,e){return Math.round((ut(n).getTime()-ut(e).getTime())/yo)}function Ei(n){const e=(n.getTime()-ut(n).getTime())/yo;return Math.min(Math.max(e,0),1)}function on(n,e){return js(n,e)+Ei(n)}function jd(n){const e=Ut(n,-n.getDay()),t=[];for(let o=0;o<6;o++){const a=[];for(let l=0;l<7;l++)a.push(Ut(e,o*7+l));t.push(a)}for(;t.length>0&&t[t.length-1].every(o=>o.getMonth()!==n.getMonth());)t.pop();return t}function kd(n,e){const t=ut(n[0]),o=Ut(t,7),a=t.getTime(),l=o.getTime(),i=[];for(const d of e){const h=ut(d.start),m=ut(d.end);if(m.getTime()<t.getTime()||h.getTime()>=o.getTime())continue;const f=h.getTime()<t.getTime()?t:h,u=m.getTime()>=o.getTime()?Ut(o,-1):m,p=js(f,t),b=js(u,f)+1;if(b<=0)continue;const g=Math.max(d.start.getTime(),a),v=Math.min(d.end.getTime(),l),y=on(new Date(g),t),k=Math.max(on(new Date(v),t)-y,0);k<=0||i.push({variant:d,startCol:p,span:b,leftUnits:y,widthUnits:k})}i.sort((d,h)=>d.startCol-h.startCol||h.span-d.span||d.variant.blockKey.localeCompare(h.variant.blockKey));const c=[],r=[];for(const d of i){let h=c.findIndex(m=>m<=d.startCol);h===-1&&(h=c.length,c.push(0)),c[h]=d.startCol+d.span,r.push({...d,lane:h})}return r}function Ht(n){const e=String(n.getMonth()+1).padStart(2,"0"),t=String(n.getDate()).padStart(2,"0");return`${n.getFullYear()}-${e}-${t}`}const vo=/^(\d{4})-(\d{2})-(\d{2})$/;function qt(n){const e=n.trim();if(!e)return null;const t=vo.exec(e);if(t){const a=Number(t[1]),l=Number(t[2])-1,i=Number(t[3]),c=new Date(a,l,i);return c.getMonth()===l&&c.getDate()===i?c:null}const o=new Date(e);return Number.isNaN(o.getTime())?null:ut(o)}function Di(n){const e=new Date(n.getFullYear(),n.getMonth(),n.getDate(),Xn);return{...ao("posts"),status:"scheduled",scheduledDatetime:e.toISOString(),date:Ht(n)}}function Ai(n){if(typeof n!="string")return null;const e=n.trim();if(!e)return null;if(vo.test(e))return qt(e);const t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Li(n,e){const t=Ai(n.scheduledDatetime);if(!t)return null;const o=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),a={...n,scheduledDatetime:o.toISOString()};return(typeof n.date=="string"?n.date:"")===Ht(t)&&(a.date=Ht(o)),a}function $i(n){return qt(n.scheduledDatetime)??qt(n.date)}function Sd(n){const e=new Map,t=[];for(const a of n){const l={post:a,scheduled:qt(a.scheduledDatetime)!==null},i=$i(a);if(!i){t.push(l);continue}const c=Ht(i),r=e.get(c);r?r.push(l):e.set(c,[l])}const o=(a,l)=>Number(l.scheduled)-Number(a.scheduled)||a.post.title.localeCompare(l.post.title);for(const a of e.values())a.sort(o);return t.sort(o),{byDay:e,undated:t}}function Oi(n){const e=ie.c(40),{orgSlug:t,virtualMcpId:o,branch:a}=n,l=Bo(),i=Qt()?.taskId??null,c=da(o),r=zn(o).runtime==="cms",{url:d}=La(o);let h;e[0]!==a||e[1]!==d||e[2]!==t||e[3]!==o?(h=ys.decofile(ua({orgSlug:t,virtualMcpId:o,branch:a,localPreviewUrl:d})),e[0]=a,e[1]=d,e[2]=t,e[3]=o,e[4]=h):h=e[4];const m=h;let f;e[5]!==a||e[6]!==t||e[7]!==o?(f=Oa(t,o,a),e[5]=a,e[6]=t,e[7]=o,e[8]=f):f=e[8];let u;e[9]!==a||e[10]!==t||e[11]!==o?(u=$a(t,o,a),e[9]=a,e[10]=t,e[11]=o,e[12]=u):u=e[12];let p;e[13]!==a||e[14]!==r||e[15]!==d||e[16]!==t||e[17]!==c||e[18]!==l||e[19]!==i||e[20]!==o?(p=async N=>{const{writes:B,deletes:E}=N,w=ma(B);if(d)return{ok:!0};if(r){const R=await Ra({orgSlug:t,virtualMcpId:o,branch:a},{set:w,delete:E});return Fa(l,{orgSlug:t,virtualMcpId:o,branch:a},R),await l.invalidateQueries({queryKey:il({orgSlug:t,virtualMcpId:o,branch:a,threadId:i})}),R}const T={orgSlug:t,virtualMcpId:o,branch:a,threadId:i};for(const[R,L]of Object.entries(w)){const G=await fetch(Ws(T,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Vs(c,Ys(R)),content:JSON.stringify(L,null,2)})});if(!G.ok)return Us(G,"Write")}for(const R of E){const L=await fetch(Ws(T,"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:Vs(c,Ys(R))})});if(!L.ok)return Us(L,"Delete")}return{ok:!0}},e[13]=a,e[14]=r,e[15]=d,e[16]=t,e[17]=c,e[18]=l,e[19]=i,e[20]=o,e[21]=p):p=e[21];let b;e[22]!==a||e[23]!==t||e[24]!==l||e[25]!==o?(b=()=>{l.invalidateQueries({queryKey:ys.liveMeta(t,o,a)})},e[22]=a,e[23]=t,e[24]=l,e[25]=o,e[26]=b):b=e[26];let g;e[27]!==f||e[28]!==u||e[29]!==p||e[30]!==b?(g={mutationKey:f,scope:u,mutationFn:p,onSuccess:b},e[27]=f,e[28]=u,e[29]=p,e[30]=b,e[31]=g):g=e[31];const v=Eo(g);let y;e[32]!==v||e[33]!==l||e[34]!==m?(y=async N=>{const B=[...Object.keys(N.writes),...N.deletes],E=l.getQueryData(m),w=new Map;for(const T of B)E&&T in E&&w.set(T,E[T]);l.setQueryData(m,T=>Ri(T,N)),l.cancelQueries({queryKey:m});try{return await v.mutateAsync(N)}catch(T){const R=T;throw l.setQueryData(m,L=>{if(!L)return L;const G={...L};for(const F of B)w.has(F)?G[F]=w.get(F):delete G[F];return G}),R}},e[32]=v,e[33]=l,e[34]=m,e[35]=y):y=e[35];const k=y;let S;return e[36]!==k||e[37]!==v.isError||e[38]!==v.isPending?(S={move:k,isPending:v.isPending,isError:v.isError},e[36]=k,e[37]=v.isError,e[38]=v.isPending,e[39]=S):S=e[39],S}function Ri(n,{writes:e,deletes:t}){const o={...n??{},...e};for(const a of t)a in e||delete o[a];return o}const Wt={draft:"sandbox.postBoard.laneDraft",generating:"sandbox.postBoard.laneGenerating",awaiting_review:"sandbox.postBoard.laneAwaitingReview",scheduled:"sandbox.postBoard.laneScheduled",published:"sandbox.postBoard.lanePublished",archived:"sandbox.postBoard.laneArchived"};function Fi({orgSlug:n,virtualMcpId:e,branch:t,decofile:o,onMoved:a}){const l=je(),i=Oi({orgSlug:n,virtualMcpId:e,branch:t}),[c,r]=A.useState(new Set),d=u=>ct(o[u],"posts"),h=(u,p,b=d(u))=>p==="generating"?{kind:"not-a-target"}:c.has(Tt(u))?{kind:"in-flight"}:ei(b,p)?{kind:"incomplete"}:null,m=u=>{switch(u.kind){case"incomplete":return l("sandbox.postBoard.moveBlocked");case"in-flight":return l("sandbox.postBoard.moveInFlight");case"not-a-target":return l("sandbox.postBoard.moveNotATarget");default:return String(u)}};return{apply:async(u,p,b)=>{const g=b??d(u);if(bt(g)===p)return null;const v=h(u,p,g);if(v)return v.kind!=="in-flight"&&me.error(m(v)),null;const y=Tt(u);r(N=>new Set(N).add(y));const k=li({key:u,payload:g},p,new Date),S=Object.keys(k.writes)[0]??u;S!==u&&a?.(u,S);try{return await i.move(k),S}catch(N){return S!==u&&a?.(S,u),me.error(N instanceof Error?N.message:l("sandbox.postBoard.moveFailed")),null}finally{r(N=>{const B=new Set(N);return B.delete(y),B})}},refuse:h,reasonText:m,isMoving:u=>c.has(Tt(u))}}function Ii(n){const e=ie.c(15),{value:t,onChange:o,placeholder:a,className:l,onFocus:i,onBlur:c,onKeyDown:r,spellCheck:d,readOnly:h,inputRef:m}=n,f=d===void 0?!0:d;let u;e[0]!==o?(u=g=>o(g.target.value),e[0]=o,e[1]=u):u=e[1];let p;e[2]!==l?(p=ye("w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-muted-foreground/50 focus:ring-0",l),e[2]=l,e[3]=p):p=e[3];let b;return e[4]!==m||e[5]!==c||e[6]!==i||e[7]!==r||e[8]!==a||e[9]!==h||e[10]!==f||e[11]!==u||e[12]!==p||e[13]!==t?(b=s.jsx("textarea",{ref:m,value:t,onChange:u,onInput:Ki,onFocus:i,onBlur:c,onKeyDown:r,placeholder:a,spellCheck:f,readOnly:h,rows:1,className:p}),e[4]=m,e[5]=c,e[6]=i,e[7]=r,e[8]=a,e[9]=h,e[10]=f,e[11]=u,e[12]=p,e[13]=t,e[14]=b):b=e[14],b}function Ki(n){const e=n.currentTarget;e.style.height="auto",e.style.height=`${e.scrollHeight}px`}function Se(n){return typeof n=="string"?n:""}function wd(n){const e=ie.c(11);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=ye(t,"pr-9"),e[3]=t,e[4]=a):a=e[4];let l;e[5]!==o||e[6]!==a?(l=s.jsx(Ii,{...o,className:a}),e[5]=o,e[6]=a,e[7]=l):l=e[7];let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Vo,{size:18,"aria-hidden":!0,className:"pointer-events-none absolute right-2 top-3 text-muted-foreground/40 transition-opacity group-hover/editable:text-muted-foreground group-focus-within/editable:text-muted-foreground"}),e[8]=i):i=e[8];let c;return e[9]!==l?(c=s.jsxs("div",{className:"group/editable relative -mx-2 rounded-md px-2 transition-colors hover:bg-muted/50 focus-within:bg-muted/50",children:[l,i]}),e[9]=l,e[10]=c):c=e[10],c}function Nd(n){const e=ie.c(5),{label:t,onClick:o,disabled:a}=n;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ns,{size:13}),e[0]=l):l=e[0];let i;return e[1]!==a||e[2]!==t||e[3]!==o?(i=s.jsxs("button",{type:"button",onClick:o,disabled:a,className:"flex items-center gap-1.5 rounded-lg border border-dashed px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground disabled:opacity-40 disabled:hover:border-dashed disabled:hover:text-muted-foreground cursor-pointer",children:[l,t]}),e[1]=a,e[2]=t,e[3]=o,e[4]=i):i=e[4],i}function Cd(n){const e=ie.c(4),{label:t,onClick:o}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Bs,{size:13}),e[0]=a):a=e[0];let l;return e[1]!==t||e[2]!==o?(l=s.jsx("button",{type:"button","aria-label":t,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground/60 opacity-0 transition-opacity hover:text-destructive group-hover/item:opacity-100 cursor-pointer rounded-lg",children:a}),e[1]=t,e[2]=o,e[3]=l):l=e[3],l}function Pd(n){const e=ie.c(2),{children:t}=n;let o;return e[0]!==t?(o=s.jsx("div",{className:"absolute -top-9 left-0 z-10 flex items-center gap-0.5 rounded-md border bg-popover p-0.5 shadow-md",children:t}),e[0]=t,e[1]=o):o=e[1],o}function Td(n){if(Array.isArray(n))return n;if(typeof n!="string"||n.trim()==="")return[];try{const e=JSON.parse(n);return Array.isArray(e)?e:[]}catch{return[]}}function wt(n){const e=ie.c(14),{options:t,value:o,emptyLabel:a,onChange:l}=n;let i;e[0]!==a||e[1]!==l||e[2]!==o?(i=a&&s.jsx(an,{active:!o,onClick:()=>l(""),children:a}),e[0]=a,e[1]=l,e[2]=o,e[3]=i):i=e[3];let c;if(e[4]!==l||e[5]!==t||e[6]!==o){let d;e[8]!==l||e[9]!==o?(d=h=>s.jsx(an,{active:h===o,onClick:()=>l(h),children:h},h),e[8]=l,e[9]=o,e[10]=d):d=e[10],c=t.filter(Boolean).map(d),e[4]=l,e[5]=t,e[6]=o,e[7]=c}else c=e[7];let r;return e[11]!==i||e[12]!==c?(r=s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i,c]}),e[11]=i,e[12]=c,e[13]=r):r=e[13],r}function an(n){const e=ie.c(7),{active:t,onClick:o,children:a}=n,l=t?"border-primary bg-primary text-primary-foreground":"bg-card hover:bg-muted";let i;e[0]!==l?(i=ye("cursor-pointer rounded-md border px-2.5 py-1 text-xs font-medium transition-colors",l),e[0]=l,e[1]=i):i=e[1];let c;return e[2]!==t||e[3]!==a||e[4]!==o||e[5]!==i?(c=s.jsx("button",{type:"button","aria-pressed":t,onClick:o,className:i,children:a}),e[2]=t,e[3]=a,e[4]=o,e[5]=i,e[6]=c):c=e[6],c}function _d(n,e=[]){return typeof n=="string"?n:JSON.stringify(n??e)}const ln=[{id:"idea",label:"sandbox.generatePost.stepIdea"},{id:"format",label:"sandbox.generatePost.stepFormat"},{id:"extra",label:"sandbox.generatePost.stepExtra"}],zi={companyName:"sandbox.blogBrand.companyNameLabel",language:"sandbox.blogBrand.languageLabel",description:"sandbox.blogBrand.descriptionLabel",tone:"sandbox.blogBrand.toneLabel",targetAudience:"sandbox.blogBrand.audienceLabel",dos:"sandbox.blogBrand.tabDos",avoid:"sandbox.blogBrand.tabGuardrails"};function Mi({open:n,onOpenChange:e,decofile:t,hasAi:o,seed:a,onGenerate:l}){const i=je(),c=ks(),[r,d]=A.useState(a?"format":"idea"),[h,m]=A.useState(a?.key??""),[f,u]=A.useState(a?.title??""),[p,b]=A.useState(a?.body??""),[g,v]=A.useState([]),[y,k]=A.useState(""),[S,N]=A.useState(""),[B,E]=A.useState(""),[w,T]=A.useState(""),[R,L]=A.useState(""),[G,F]=A.useState(!1),_=t[Ls],$=Pi(_),K={companyName:Se(_?.companyName),description:Se(_?.description),language:Se(_?.language),tone:Se(_?.tone),targetAudience:Se(_?.targetAudience),values:Me(Ke(_?.values)),dos:Me(Ke(_?.dos)),avoid:Me(Ke(_?.avoid))},z=ro(t),M=z.find(P=>P.key===h),W=uo(t).find(P=>P.key===M?.pillarKey),O=t[mo],I=Me(Ke(O?.formats)),D=Ge(t,"categories").map(({payload:P})=>({name:Se(P.name),slug:Se(P.slug)})).filter(P=>P.slug),U=Qn(t),X=()=>{d(a?"format":"idea"),m(a?.key??""),u(a?.title??""),b(a?.body??""),v([]),k(""),N(""),E(""),T(""),L("")},ee=P=>{e(P),P||X()},te=async()=>{F(!0);try{const P=await c.call("BLOG_THEME_SUGGEST",{brand:K,existingTitles:[],formats:I.map(q=>q.name).filter(Boolean),guidance:W?`Every idea must be one angle inside the pillar "${W.title}": ${W.body}`:void 0,count:4});v(P.themes)}catch(P){me.error(P instanceof Error?P.message:i("sandbox.generatePost.suggestFailed"))}finally{F(!1)}},re=a?ln.filter(P=>P.id!=="idea"):ln,Z=re.findIndex(P=>P.id===r),ae=r==="idea"?f.trim().length>0:r==="format"?y.trim().length>0&&S.trim().length>0:!0,le=r==="extra",oe=()=>{l({idea:{key:h||void 0,title:f.trim(),body:p.trim()},pillar:W?{key:W.key,title:W.title,body:W.body}:void 0,format:{name:y.trim(),value:S.trim()},category:D.find(P=>P.slug===B),author:U.find(P=>P.email===w),extraInstructions:R.trim()||void 0}),ee(!1)};return s.jsx(rt,{open:n,onOpenChange:ee,children:s.jsxs(it,{className:"flex max-h-[85vh] flex-col sm:max-w-2xl",children:[s.jsxs(pt,{children:[s.jsx(lt,{children:i("sandbox.generatePost.title")}),s.jsx(Mt,{children:i("sandbox.generatePost.subtitle")})]}),$.length>0?s.jsx("p",{className:"text-sm text-muted-foreground",children:i("sandbox.generatePost.blockedBrand",{fields:$.map(P=>i(zi[P])).join(", ")})}):s.jsxs(s.Fragment,{children:[s.jsx("ol",{className:"flex shrink-0 items-center gap-1.5 text-xs",children:re.map((P,q)=>s.jsx("li",{className:ye("rounded-md px-2 py-1",q===Z?"bg-primary text-primary-foreground":q<Z?"text-foreground":"text-muted-foreground"),children:i(P.label)},P.id))}),s.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto py-1",children:[r==="idea"&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:W?i("sandbox.generatePost.ideaHintInPillar",{pillar:W.title}):i("sandbox.generatePost.ideaHint")}),z.length>0&&s.jsx(wt,{options:z.map(P=>P.title).filter(Boolean),value:M?.title??"",emptyLabel:i("sandbox.generatePost.writeAnIdea"),onChange:P=>{const q=z.find(ne=>ne.title===P);m(q?.key??""),u(q?.title??""),b(q?.body??"")}}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"generate-idea-title",children:i("sandbox.generatePost.ideaTitleLabel")}),s.jsx(Xe,{id:"generate-idea-title",value:f,onChange:P=>{m(""),u(P.target.value)},placeholder:i("sandbox.generatePost.ideaTitlePlaceholder")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"generate-idea-body",children:i("sandbox.generatePost.ideaBodyLabel")}),s.jsx(Rt,{id:"generate-idea-body",value:p,onChange:P=>b(P.target.value),placeholder:i("sandbox.generatePost.ideaBodyPlaceholder"),rows:3})]}),s.jsx(Vi,{label:i("sandbox.generatePost.suggestIdeas"),hint:i("sandbox.generatePost.suggestIdeasHint"),disabled:!o||G,busy:G,onSuggest:te}),s.jsx(Gi,{suggestions:g,onPick:P=>{u(P.title),b(P.body)}})]}),r==="format"&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.formatHint")}),s.jsx(wt,{options:I.map(P=>P.name),value:y,onChange:P=>{k(P),N(I.find(q=>q.name===P)?.value??"")}}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"generate-format-name",children:i("sandbox.generatePost.formatNameLabel")}),s.jsx(Xe,{id:"generate-format-name",value:y,onChange:P=>k(P.target.value),placeholder:i("sandbox.generatePost.formatNamePlaceholder")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"generate-format-value",children:i("sandbox.generatePost.formatValueLabel")}),s.jsx(Rt,{id:"generate-format-value",value:S,onChange:P=>N(P.target.value),placeholder:i("sandbox.generatePost.formatValuePlaceholder"),rows:4})]})]}),r==="extra"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"generate-category",children:i("sandbox.generatePost.categoryLabel")}),s.jsx(wt,{options:D.map(P=>P.name),value:D.find(P=>P.slug===B)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:P=>E(D.find(q=>q.name===P)?.slug??"")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"generate-author",children:i("sandbox.generatePost.authorLabel")}),s.jsx(wt,{options:U.map(P=>P.name),value:U.find(P=>P.email===w)?.name??"",emptyLabel:i("sandbox.generatePost.inferIt"),onChange:P=>T(U.find(q=>q.name===P)?.email??"")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ze,{htmlFor:"generate-extra",children:i("sandbox.generatePost.extraLabel")}),s.jsx(Rt,{id:"generate-extra",value:R,onChange:P=>L(P.target.value),placeholder:i("sandbox.generatePost.extraPlaceholder"),rows:3})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.generatePost.inferHint")})]})]}),s.jsxs(ht,{className:"shrink-0 sm:justify-between",children:[s.jsx(Ee,{type:"button",variant:"outline",disabled:Z===0,onClick:()=>d(re[Z-1].id),children:i("sandbox.generatePost.back")}),le?s.jsxs(Ee,{type:"button",disabled:!o,onClick:oe,children:[s.jsx(et,{size:14}),i("sandbox.generatePost.generate")]}):s.jsx(Ee,{type:"button",disabled:!ae,onClick:()=>d(re[Z+1].id),children:i("sandbox.generatePost.next")})]})]})]})})}function Vi(n){const e=ie.c(12),{label:t,hint:o,disabled:a,busy:l,onSuggest:i}=n;let c;e[0]!==o?(c=s.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==l?(r=l?s.jsx(Ct,{size:14,className:"animate-spin"}):s.jsx(et,{size:14}),e[2]=l,e[3]=r):r=e[3];let d;e[4]!==a||e[5]!==t||e[6]!==i||e[7]!==r?(d=s.jsxs(Ee,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:i,children:[r,t]}),e[4]=a,e[5]=t,e[6]=i,e[7]=r,e[8]=d):d=e[8];let h;return e[9]!==c||e[10]!==d?(h=s.jsxs("div",{className:"flex items-center justify-between gap-3 border-t pt-3",children:[c,d]}),e[9]=c,e[10]=d,e[11]=h):h=e[11],h}function Gi(n){const e=ie.c(7),{suggestions:t,onPick:o}=n;if(t.length===0)return null;let a;if(e[0]!==o||e[1]!==t){let i;e[3]!==o?(i=c=>s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>o(c),className:"w-full cursor-pointer rounded-lg border bg-card p-2.5 text-left transition-colors hover:border-primary/40",children:[s.jsx("p",{className:"text-sm font-medium",children:c.title}),s.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:c.body})]})},c.title),e[3]=o,e[4]=i):i=e[4],a=t.map(i),e[0]=o,e[1]=t,e[2]=a}else a=e[2];let l;return e[5]!==a?(l=s.jsx("ul",{className:"space-y-1.5",children:a}),e[5]=a,e[6]=l):l=e[6],l}const Ui=["Heading","Paragraph","List","Quote","Callout","Cta","Divider"];function Hi(n){return Ui.includes(n)}function qi({orgSlug:n,virtualMcpId:e,branch:t,decofile:o,meta:a,onStarted:l}){const i=je(),c=ks(),r=Xt({orgSlug:n,virtualMcpId:e,branch:t});return async d=>{const h=Gt(vs()),m={ideaKey:d.idea.key,pillarKey:d.pillar?.key,pillarTitle:d.pillar?.title,format:d.format,brief:d.idea.body},f=Vt(so({title:d.idea.title,planning:m,now:new Date}),"generating",new Date);await r.mutateAsync({blockKey:h,data:dt(h,f)}),l?.(h);const u=o[Ls],p=d.category?[d.category]:Ge(o,"categories").map(({payload:g})=>({name:Se(g.name),slug:Se(g.slug)})).filter(g=>g.slug),b=d.author?[d.author]:Qn(o);try{const g=await c.call("BLOG_POST_DRAFT",{brand:{companyName:Se(u?.companyName),description:Se(u?.description),language:Se(u?.language),tone:Se(u?.tone),targetAudience:Se(u?.targetAudience),values:Me(Ke(u?.values)),dos:Me(Ke(u?.dos)),avoid:Me(Ke(u?.avoid))},pillar:d.pillar?{title:d.pillar.title,body:d.pillar.body}:void 0,theme:{title:d.idea.title,body:d.idea.body},format:d.format,sections:ki(a).filter(y=>Hi(y.name)).map(y=>({type:y.name,purpose:y.description})),categories:p,authors:b.map(({name:y,email:k})=>({name:y,email:k})),extraInstructions:d.extraInstructions?.trim()||void 0}),v=Bi({draft:g,resolveTypes:ho(a),categories:p,authors:b,planning:m,takenSlugs:Zn(o).map(y=>y.slug),now:new Date});await r.mutateAsync({blockKey:h,data:dt(h,v)}),me.success(i("sandbox.generatePost.done",{title:g.title}))}catch(g){await r.mutateAsync({blockKey:h,data:dt(h,Vt(f,"draft",new Date))}),me.error(g instanceof Error?g.message:i("sandbox.generatePost.failed"))}}}const Wi=/<(h[1-6]|p|ul|ol|div|img|br|blockquote|section|article|figure)\b|<\/[a-z]/i;function jo(n){return Wi.test(n)}function Yi(n){const e=n.trim();return e?jo(e)?nr(e):ar(e):{title:"",sections:[]}}function Os(n){return n.replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#0?39;|&apos;/gi,"'").replace(/&amp;/gi,"&")}function St(n){let e=n,t;do t=e,e=e.replace(/<[^>]+>/g,"");while(e!==t);return Os(e).replace(/\s+/g," ").trim()}function Qi(n){let e=n,t;do t=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==t);return e}function Ji(n){let e=n,t;do t=e,e=e.replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/gi,"");while(e!==t);return e}function ko(n){let e=n,t;do t=e,e=Ji(Qi(e));while(e!==t);return e}const Xi=/^(a|b|strong|i|em|u|s|code|br|span|sub|sup)$/;function Yt(n){let e="";for(const t of n)t.charCodeAt(0)>31&&(e+=t);return e=e.trim(),!/^[a-z][a-z0-9+.-]*:/i.test(e)||/^(https?|mailto|tel):/i.test(e)}function Zi(n){return n.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const er=/^<\/?([a-z][a-z0-9]*)\b([^>]*)>/i;function tr(n,e,t){const o=e.toLowerCase();if(!Xi.test(o))return"";if(n.startsWith("</"))return`</${o}>`;if(o!=="a")return`<${o}>`;const a=Os(t.match(/href\s*=\s*"([^"]*)"/i)?.[1]??"");return Yt(a)&&a?`<a href="${Zi(a)}">`:"<a>"}function So(n){const e=ko(n);let t="",o=0;for(;o<e.length;){const a=e.indexOf("<",o);if(a===-1){t+=e.slice(o);break}t+=e.slice(o,a);const l=er.exec(e.slice(a));if(!l){t+="&lt;",o=a+1;continue}t+=tr(l[0],l[1]??"",l[2]??""),o=a+l[0].length}return t}function At(n,e){const t=n.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));return t?.[1]?Os(t[1]):""}const sr=/<(h[1-6]|p|ul|ol|blockquote|figure)\b[^>]*>([\s\S]*?)<\/\1\s*>|<hr\b[^>]*\/?>|<img\b[^>]*>/gi;function nr(n){const e=ko(n);let t="";const o=[];for(const a of e.matchAll(sr)){const l=a[1]?.toLowerCase(),i=a[2]??"",c=a[0];if(!l){if(/^<img/i.test(c)){const r=At(c,"src");r&&Yt(r)&&o.push({kind:"image",url:r,alt:At(c,"alt"),caption:""})}else o.push({kind:"divider"});continue}if(/^h[1-6]$/.test(l)){const r=St(i);if(!r)continue;if(l==="h1"&&!t){t=r;continue}o.push({kind:"heading",text:r,level:l.slice(1)})}else if(l==="p"){const r=So(i.trim());St(r)&&o.push({kind:"paragraph",html:r})}else if(l==="ul"||l==="ol"){const r=[...i.matchAll(/<li\b[^>]*>([\s\S]*?)<\/li\s*>/gi)].map(d=>St(d[1]??"")).filter(Boolean);r.length&&o.push({kind:"list",items:r,ordered:l==="ol"})}else if(l==="blockquote"){const r=St(i);r&&o.push({kind:"quote",text:r})}else if(l==="figure"){const r=i.match(/<img\b[^>]*>/i)?.[0],d=r?At(r,"src"):"",h=St(i.match(/<figcaption\b[^>]*>([\s\S]*?)<\/figcaption\s*>/i)?.[1]??"");d&&Yt(d)&&o.push({kind:"image",url:d,alt:r?At(r,"alt"):"",caption:h})}}return{title:t,sections:o}}function or(n){return n.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,'<a href="$2">$1</a>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^*])\*([^*]+)\*/g,"$1<em>$2</em>").replace(/`([^`]+)`/g,"<code>$1</code>")}function ar(n){const e=n.replace(/\r\n?/g,`
5
5
  `).split(`
6
6
  `);let t="";const o=[];let a=[],l=null,i=[];const c=()=>{a.length&&(o.push({kind:"paragraph",html:So(or(a.join(" ")))}),a=[])},r=()=>{l&&(o.push({kind:"list",items:l.items,ordered:l.ordered}),l=null)},d=()=>{i.length&&(o.push({kind:"quote",text:i.join(" ")}),i=[])},h=()=>{c(),r(),d()};for(const m of e){const f=m.trimEnd(),u=f.match(/^(#{1,6})\s+(.*)$/),p=f.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/),b=f.match(/^\s*(?:[-*+]|\d+\.)\s+(.*)$/),g=/^\s*\d+\./.test(f),v=f.match(/^>\s?(.*)$/);if(!f.trim())h();else if(u){h();const y=u[2]?.trim()??"",k=String(u[1]?.length??1);k==="1"&&!t?t=y:y&&o.push({kind:"heading",text:y,level:k})}else if(/^(-{3,}|\*{3,}|_{3,})$/.test(f.trim()))h(),o.push({kind:"divider"});else if(p){h();const y=p[2]??"";Yt(y)&&o.push({kind:"image",url:y,alt:p[1]??"",caption:""})}else b?(c(),d(),l||(l={items:[],ordered:g}),l.items.push(b[1]?.trim()??"")):v?(c(),r(),i.push(v[1]?.trim()??"")):(r(),d(),a.push(f.trim()))}return h(),{title:t,sections:o}}const lr={heading:"Heading",paragraph:"Paragraph",list:"List",quote:"Quote",divider:"Divider",image:"BlockImage"};function ir(n,e){const t=[];for(const o of n){const a=e[lr[o.kind]];if(a)switch(o.kind){case"heading":t.push({__resolveType:a,text:o.text,level:o.level});break;case"paragraph":t.push({__resolveType:a,html:o.html});break;case"list":t.push({__resolveType:a,items:o.items.join(`
7
7
  `),style:o.ordered?"ordered":"unordered"});break;case"quote":t.push({__resolveType:a,quote:o.text});break;case"divider":t.push({__resolveType:a});break;case"image":t.push({__resolveType:a,url:o.url,alt:o.alt,caption:o.caption,size:"normal"});break}}return t}function rr({title:n,blocks:e,takenSlugs:t,now:o}){const a=n.trim();return{title:a,slug:a?bo(a,t):go(""),date:o.toISOString().slice(0,10),excerpt:"",image:"",alt:"",authors:[],categories:[],sections:e,status:"in_review"}}const rn="__all__",cn={"date-desc":"sandbox.postToolbar.sortNewestFirst","date-asc":"sandbox.postToolbar.sortOldestFirst",az:"sandbox.postToolbar.sortTitleAZ",za:"sandbox.postToolbar.sortTitleZA"},cr={"date-desc":"sandbox.postToolbar.sortNewest","date-asc":"sandbox.postToolbar.sortOldest",az:"sandbox.postToolbar.sortAZ",za:"sandbox.postToolbar.sortZA"},dn="status:";function un(n){if(!n.startsWith(dn))return null;const e=n.slice(dn.length);return As.includes(e)?e:null}const mn=A.forwardRef(function(e,t){const o=ie.c(20);let a,l,i,c,r;o[0]!==e?({icon:a,active:l,value:r,className:i,...c}=e,o[0]=e,o[1]=a,o[2]=l,o[3]=i,o[4]=c,o[5]=r):(a=o[1],l=o[2],i=o[3],c=o[4],r=o[5]);const d=l?"text-foreground":"text-muted-foreground";let h;o[6]!==i||o[7]!==d?(h=ye("h-7 gap-1 px-1.5 text-xs",d,i),o[6]=i,o[7]=d,o[8]=h):h=o[8];let m;o[9]!==a?(m=s.jsx(a,{size:14,className:"shrink-0"}),o[9]=a,o[10]=m):m=o[10];let f;o[11]!==r?(f=r&&s.jsx("span",{className:"min-w-0 flex-1 truncate",children:r}),o[11]=r,o[12]=f):f=o[12];let u;o[13]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ft,{size:12,className:"shrink-0 opacity-60"}),o[13]=u):u=o[13];let p;return o[14]!==c||o[15]!==t||o[16]!==h||o[17]!==m||o[18]!==f?(p=s.jsxs(Ee,{ref:t,type:"button",variant:"ghost",size:"sm",className:h,...c,children:[m,f,u]}),o[14]=c,o[15]=t,o[16]=h,o[17]=m,o[18]=f,o[19]=p):p=o[19],p});function Rs(n){const e=ie.c(2),{count:t}=n;let o;return e[0]!==t?(o=s.jsx("span",{className:"ml-auto pl-3 text-xs text-muted-foreground tabular-nums",children:t}),e[0]=t,e[1]=o):o=e[1],o}function dr(n){const e=ie.c(19),{value:t,onChange:o}=n,a=je();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[0]=l):l=e[0];let i;e[1]!==o?(i=f=>o(f.target.value),e[1]=o,e[2]=i):i=e[2];let c;e[3]!==a?(c=a("sandbox.postToolbar.searchPlaceholder"),e[3]=a,e[4]=c):c=e[4];let r;e[5]!==a?(r=a("sandbox.postToolbar.searchAriaLabel"),e[5]=a,e[6]=r):r=e[6];let d;e[7]!==i||e[8]!==c||e[9]!==r||e[10]!==t?(d=s.jsx("input",{type:"text",value:t,onChange:i,placeholder:c,"aria-label":r,className:"min-w-0 flex-1 bg-transparent py-0.5 text-sm outline-none placeholder:text-muted-foreground"}),e[7]=i,e[8]=c,e[9]=r,e[10]=t,e[11]=d):d=e[11];let h;e[12]!==o||e[13]!==a||e[14]!==t?(h=t&&s.jsx(wo,{label:a("sandbox.postToolbar.clearSearch"),onClick:()=>o("")}),e[12]=o,e[13]=a,e[14]=t,e[15]=h):h=e[15];let m;return e[16]!==d||e[17]!==h?(m=s.jsxs("div",{className:"flex items-center gap-2 border-b px-2.5 py-1.5",children:[l,d,h]}),e[16]=d,e[17]=h,e[18]=m):m=e[18],m}function ur(n){const e=ie.c(100),{categories:t,authors:o,statusCounts:a,categoryFilter:l,authorFilter:i,statusFilter:c,sort:r,onCategoryFilterChange:d,onAuthorFilterChange:h,onStatusFilterChange:m,onSortChange:f}=n,u=je();let p;if(e[0]!==t||e[1]!==l){let j;e[3]!==l?(j=V=>V.slug===l,e[3]=l,e[4]=j):j=e[4],p=t.find(j),e[0]=t,e[1]=l,e[2]=p}else p=e[2];const b=p;let g;if(e[5]!==i||e[6]!==o){let j;e[8]!==i?(j=V=>V.email===i,e[8]=i,e[9]=j):j=e[9],g=o.find(j),e[5]=i,e[6]=o,e[7]=g}else g=e[7];const v=g,y=!!(l||i||c);let k;e[10]!==v?.name||e[11]!==b?.name||e[12]!==c||e[13]!==u?(k=b?.name??v?.name??u(c?Wt[c]:"sandbox.postToolbar.filterLabel"),e[10]=v?.name,e[11]=b?.name,e[12]=c,e[13]=u,e[14]=k):k=e[14];const S=k,N=l?`cat:${l}`:i?`author:${i}`:c?`status:${c}`:rn;let B;e[15]!==h||e[16]!==d||e[17]!==m?(B=()=>{d(null),h(null),m(null)},e[15]=h,e[16]=d,e[17]=m,e[18]=B):B=e[18];const E=B;let w;e[19]!==E||e[20]!==h||e[21]!==d||e[22]!==m?(w=j=>{j.startsWith("cat:")?(h(null),m(null),d(j.slice(4))):j.startsWith("author:")?(d(null),m(null),h(j.slice(7))):un(j)?(d(null),h(null),m(un(j))):E()},e[19]=E,e[20]=h,e[21]=d,e[22]=m,e[23]=w):w=e[23];const T=w;let R;e[24]!==S||e[25]!==y?(R=s.jsx(Ft,{asChild:!0,children:s.jsx(mn,{icon:Go,active:y,value:S,className:"min-w-0 shrink"})}),e[24]=S,e[25]=y,e[26]=R):R=e[26];let L;e[27]!==u?(L=u("sandbox.postToolbar.filterBy"),e[27]=u,e[28]=L):L=e[28];let G;e[29]!==L?(G=s.jsx(vt,{children:L}),e[29]=L,e[30]=G):G=e[30];let F;e[31]!==u?(F=u("sandbox.postToolbar.allPosts"),e[31]=u,e[32]=F):F=e[32];let _;e[33]!==F?(_=s.jsx(Nt,{value:rn,children:F}),e[33]=F,e[34]=_):_=e[34];let $;e[35]!==u?($=u("sandbox.postToolbar.statusLabel"),e[35]=u,e[36]=$):$=e[36];let K;e[37]!==$?(K=s.jsx(vt,{className:"text-muted-foreground/70",children:$}),e[37]=$,e[38]=K):K=e[38];let z;e[39]!==a||e[40]!==u?(z=As.map(j=>s.jsxs(Nt,{value:`status:${j}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:u(Wt[j])}),s.jsx(Rs,{count:a[j]??0})]},`status:${j}`)),e[39]=a,e[40]=u,e[41]=z):z=e[41];let M;e[42]!==t.length||e[43]!==u?(M=t.length>0&&s.jsx(vt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.categoryLabel")}),e[42]=t.length,e[43]=u,e[44]=M):M=e[44];let W;e[45]!==t?(W=t.map(fr),e[45]=t,e[46]=W):W=e[46];let O;e[47]!==o.length||e[48]!==u?(O=o.length>0&&s.jsx(vt,{className:"text-muted-foreground/70",children:u("sandbox.postToolbar.authorLabel")}),e[47]=o.length,e[48]=u,e[49]=O):O=e[49];let I;e[50]!==o?(I=o.map(mr),e[50]=o,e[51]=I):I=e[51];let D;e[52]!==N||e[53]!==T||e[54]!==_||e[55]!==K||e[56]!==z||e[57]!==M||e[58]!==W||e[59]!==O||e[60]!==I?(D=s.jsxs(Ks,{value:N,onValueChange:T,children:[_,K,z,M,W,O,I]}),e[52]=N,e[53]=T,e[54]=_,e[55]=K,e[56]=z,e[57]=M,e[58]=W,e[59]=O,e[60]=I,e[61]=D):D=e[61];let U;e[62]!==D||e[63]!==G?(U=s.jsxs(It,{align:"start",className:"max-h-96 w-60 overflow-y-auto",children:[G,D]}),e[62]=D,e[63]=G,e[64]=U):U=e[64];let X;e[65]!==U||e[66]!==R?(X=s.jsxs(Kt,{children:[R,U]}),e[65]=U,e[66]=R,e[67]=X):X=e[67];let ee;e[68]!==E||e[69]!==y||e[70]!==u?(ee=y&&s.jsx(wo,{label:u("sandbox.postToolbar.clearFilter"),onClick:E}),e[68]=E,e[69]=y,e[70]=u,e[71]=ee):ee=e[71];const te=cr[r];let re;e[72]!==u||e[73]!==te?(re=u(te),e[72]=u,e[73]=te,e[74]=re):re=e[74];let Z;e[75]!==re?(Z=s.jsx(Ft,{asChild:!0,children:s.jsx(mn,{icon:Uo,active:!0,value:re})}),e[75]=re,e[76]=Z):Z=e[76];let ae;e[77]!==u?(ae=u("sandbox.postToolbar.sortBy"),e[77]=u,e[78]=ae):ae=e[78];let le;e[79]!==ae?(le=s.jsx(vt,{children:ae}),e[79]=ae,e[80]=le):le=e[80];let oe;e[81]!==f?(oe=j=>f(j),e[81]=f,e[82]=oe):oe=e[82];let P;e[83]===Symbol.for("react.memo_cache_sentinel")?(P=Object.keys(cn),e[83]=P):P=e[83];let q;e[84]!==u?(q=P.map(j=>s.jsx(Nt,{value:j,children:u(cn[j])},j)),e[84]=u,e[85]=q):q=e[85];let ne;e[86]!==r||e[87]!==oe||e[88]!==q?(ne=s.jsx(Ks,{value:r,onValueChange:oe,children:q}),e[86]=r,e[87]=oe,e[88]=q,e[89]=ne):ne=e[89];let se;e[90]!==le||e[91]!==ne?(se=s.jsxs(It,{align:"end",className:"w-44",children:[le,ne]}),e[90]=le,e[91]=ne,e[92]=se):se=e[92];let ce;e[93]!==Z||e[94]!==se?(ce=s.jsx("div",{className:"ml-auto shrink-0",children:s.jsxs(Kt,{children:[Z,se]})}),e[93]=Z,e[94]=se,e[95]=ce):ce=e[95];let ue;return e[96]!==X||e[97]!==ee||e[98]!==ce?(ue=s.jsxs("div",{className:"flex min-w-0 items-center gap-1 overflow-hidden border-b px-2 py-1.5",children:[X,ee,ce]}),e[96]=X,e[97]=ee,e[98]=ce,e[99]=ue):ue=e[99],ue}function mr(n){return s.jsxs(Nt,{value:`author:${n.email}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.name}),s.jsx(Rs,{count:n.count})]},`author:${n.email}`)}function fr(n){return s.jsxs(Nt,{value:`cat:${n.slug}`,children:[s.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.name}),s.jsx(Rs,{count:n.count})]},`cat:${n.slug}`)}function wo(n){const e=ie.c(4),{label:t,onClick:o}=n;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Es,{size:12}),e[0]=a):a=e[0];let l;return e[1]!==t||e[2]!==o?(l=s.jsx("button",{type:"button","aria-label":t,onClick:o,className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer rounded-lg",children:a}),e[1]=t,e[2]=o,e[3]=l):l=e[3],l}function pr(n){const e=ie.c(18),{checked:t,disabled:o,onToggle:a}=n,l=je();let i;e[0]!==a?(i=()=>a(),e[0]=a,e[1]=i):i=e[1];let c;e[2]!==t||e[3]!==l?(c=l(t?"sandbox.postToolbar.deselectAllPosts":"sandbox.postToolbar.selectAllPosts"),e[2]=t,e[3]=l,e[4]=c):c=e[4];let r;e[5]!==t||e[6]!==o||e[7]!==i||e[8]!==c?(r=s.jsx(He,{asChild:!0,children:s.jsx("span",{className:"flex shrink-0 items-center px-1.5",onClick:hr,children:s.jsx(Zt,{checked:t,disabled:o,onCheckedChange:i,"aria-label":c})})}),e[5]=t,e[6]=o,e[7]=i,e[8]=c,e[9]=r):r=e[9];let d;e[10]!==t||e[11]!==l?(d=l(t?"sandbox.postToolbar.deselectAll":"sandbox.postToolbar.selectAll"),e[10]=t,e[11]=l,e[12]=d):d=e[12];let h;e[13]!==d?(h=s.jsx(qe,{side:"bottom",children:d}),e[13]=d,e[14]=h):h=e[14];let m;return e[15]!==r||e[16]!==h?(m=s.jsxs(We,{children:[r,h]}),e[15]=r,e[16]=h,e[17]=m):m=e[17],m}function hr(n){return n.stopPropagation()}function gr(n){const e=ie.c(42),{count:t,allSelected:o,onToggleSelectAll:a,onArchive:l,onExit:i}=n,c=je();let r;e[0]!==o||e[1]!==a?(r=s.jsx(pr,{checked:o,onToggle:a}),e[0]=o,e[1]=a,e[2]=r):r=e[2];let d;e[3]!==t||e[4]!==c?(d=c("sandbox.postToolbar.itemsSelected",{count:t}),e[3]=t,e[4]=c,e[5]=d):d=e[5];let h;e[6]!==d?(h=s.jsx("span",{className:"text-xs font-medium tabular-nums",children:d}),e[6]=d,e[7]=h):h=e[7];const m=t===0;let f;e[8]!==c?(f=c("sandbox.postToolbar.archiveSelectedPosts"),e[8]=c,e[9]=f):f=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Do,{size:14}),e[10]=u):u=e[10];let p;e[11]!==l||e[12]!==m||e[13]!==f?(p=s.jsx(He,{asChild:!0,children:s.jsx(Ee,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",disabled:m,onClick:l,"aria-label":f,children:u})}),e[11]=l,e[12]=m,e[13]=f,e[14]=p):p=e[14];let b;e[15]!==c?(b=c("sandbox.postToolbar.archiveSelected"),e[15]=c,e[16]=b):b=e[16];let g;e[17]!==b?(g=s.jsx(qe,{side:"bottom",children:b}),e[17]=b,e[18]=g):g=e[18];let v;e[19]!==p||e[20]!==g?(v=s.jsxs(We,{children:[p,g]}),e[19]=p,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==c?(y=c("sandbox.postToolbar.exitSelection"),e[22]=c,e[23]=y):y=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Es,{size:14}),e[24]=k):k=e[24];let S;e[25]!==i||e[26]!==y?(S=s.jsx(He,{asChild:!0,children:s.jsx(Ee,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,"aria-label":y,children:k})}),e[25]=i,e[26]=y,e[27]=S):S=e[27];let N;e[28]!==c?(N=c("sandbox.postToolbar.exitSelection"),e[28]=c,e[29]=N):N=e[29];let B;e[30]!==N?(B=s.jsx(qe,{side:"bottom",children:N}),e[30]=N,e[31]=B):B=e[31];let E;e[32]!==S||e[33]!==B?(E=s.jsxs(We,{children:[S,B]}),e[32]=S,e[33]=B,e[34]=E):E=e[34];let w;e[35]!==v||e[36]!==E?(w=s.jsxs("div",{className:"ml-auto flex items-center gap-0.5",children:[v,E]}),e[35]=v,e[36]=E,e[37]=w):w=e[37];let T;return e[38]!==r||e[39]!==w||e[40]!==h?(T=s.jsxs("div",{className:"flex items-center gap-0.5 border-b bg-accent/40 px-2 py-1.5",children:[r,h,w]}),e[38]=r,e[39]=w,e[40]=h,e[41]=T):T=e[41],T}const xr={draft:"outline",generating:"secondary",awaiting_review:"warning",scheduled:"secondary",published:"success",archived:"outline"},fn="ideas",pn=n=>n.scheduledDatetime||n.date||"",br=(n,e)=>pn(e).localeCompare(pn(n)),yr=n=>n==="scheduled"||n==="published",No="application/x-post-key";function vr({orgSlug:n,virtualMcpId:e,branch:t,decofile:o,view:a,selectedKey:l,onViewChange:i,onOpen:c,onClose:r,move:d,meta:h,renderDetail:m}){const f=je(),u=ks(),p=Xt({orgSlug:n,virtualMcpId:e,branch:t}),b=In({orgSlug:n,virtualMcpId:e,branch:t}),g=dl().length>0,[v,y]=A.useState(null),[k,S]=A.useState(!1),[N,B]=A.useState(!1),[E,w]=A.useState(""),[T,R]=A.useState(3),[L,G]=A.useState(""),[F,_]=A.useState(!1),[$,K]=A.useState(!1),[z,M]=A.useState(),[W,O]=A.useState(!1),[I,D]=A.useState(""),U=A.useRef(null),[X,ee]=Ao(Lo.blogBoardCollapsedLanes(),[]),te=C=>ee(J=>J.includes(C)?J.filter(_e=>_e!==C):[...J,C]),re=qi({orgSlug:n,virtualMcpId:e,branch:t,decofile:o,meta:h,onStarted:c}),Z=ai(o),ae=ro(o),le=uo(o),oe=C=>le.find(J=>J.key===C)?.title,P=C=>ct(o[C],"posts"),q=l&&Z.some(C=>C.key===l)?l:Z[0]?.key??null,ne=async C=>{await d.apply(C.key,"archived")&&me.success(f("sandbox.postBoard.archived"))},[se,ce]=A.useState(null),[ue,j]=A.useState(null),[V,fe]=A.useState(null),[he,ve]=A.useState("date-desc"),[ge,De]=A.useState(""),[ke,Ce]=A.useState(new Set),Pe=Z.reduce((C,J)=>(C[J.status]=(C[J.status]??0)+1,C),{}),Te=C=>{const J=new Map;for(const _e of Z)for(const Ve of C(_e))J.set(Ve,(J.get(Ve)??0)+1);return J},Ae=Te(C=>C.categorySlugs),be=Te(C=>C.authorEmails),Le=Ge(o,"categories").map(({payload:C})=>({slug:Se(C.slug),name:Se(C.name)||Se(C.slug),count:Ae.get(Se(C.slug))??0})),Ie=Ge(o,"authors").map(({payload:C})=>({email:Se(C.email),name:Se(C.name)||Se(C.email),count:be.get(Se(C.email))??0})),H=ge.trim().toLowerCase(),xe=Z.filter(C=>!se||C.categorySlugs.includes(se)).filter(C=>!ue||C.authorEmails.includes(ue)).filter(C=>!V||C.status===V).filter(C=>!H||C.title.toLowerCase().includes(H)||C.slug.toLowerCase().includes(H)).sort((C,J)=>{if(he==="az")return C.title.localeCompare(J.title);if(he==="za")return J.title.localeCompare(C.title);const _e=(C.scheduledDatetime||C.date).localeCompare(J.scheduledDatetime||J.date);return he==="date-asc"?_e:-_e}),we=ke.size>0,Re=C=>Ce(J=>{const _e=new Set(J);return _e.delete(C)||_e.add(C),_e}),ls=()=>Ce(C=>xe.every(J=>C.has(J.key))?new Set:new Set(xe.map(J=>J.key))),is=async()=>{let C=0;for(const J of ke)await d.apply(J,"archived")&&(C+=1);Ce(new Set),C>0&&me.success(f("sandbox.postBoard.archived"))},rs=C=>{M({key:C.key,title:C.title,body:C.body}),K(!0)},cs=C=>{b.mutate({blockKey:C.key})},ds=(C,J)=>{y(null),d.apply(J,C)},Et=()=>{const C=Gt(vs()),J=so({title:"",now:new Date});p.mutate({blockKey:C,data:dt(C,J)}),c(C)},us=()=>{const C=Yi(I),J=ir(C.sections,ho(h));if(J.length===0&&!C.title.trim()){me.error(f("sandbox.postBoard.importEmpty"));return}const _e=Gt(vs()),Ve=rr({title:C.title,blocks:J,takenSlugs:Z.map(Be=>Be.slug).filter(Boolean),now:new Date});p.mutate({blockKey:_e,data:dt(_e,Ve)}),O(!1),D(""),me.success(f("sandbox.postBoard.imported")),c(_e)},ms=async()=>{S(!0);const C=le.find(J=>J.key===L);try{const J=o[Ls]??{},_e=o[mo],Ve=Ke(_e?.formats).map(x=>x.name).filter(Boolean),Be=await u.call("BLOG_THEME_SUGGEST",{brand:{companyName:Se(J.companyName),description:Se(J.description),language:Se(J.language),tone:Se(J.tone),targetAudience:Se(J.targetAudience),values:Me(Ke(J.values)),dos:Me(Ke(J.dos)),avoid:Me(Ke(J.avoid))},existingTitles:ae.map(x=>x.title).filter(Boolean),formats:Ve,guidance:[C&&`Every idea must be one angle inside the pillar "${C.title}": ${C.body}`,E.trim()].filter(Boolean).join(`
8
8
 
9
- `)||void 0,count:T}),nt=Ni(ae.map(x=>x.title),Be.themes);if(nt.length===0){me.info(f("sandbox.postBoard.ideasFailed"));return}let yt=0;for(const x of nt){const Y=yi();try{await p.mutateAsync({blockKey:Y,data:vi(Y,{title:x.title,body:x.body,pillarKey:C?.key,createdAt:new Date().toISOString()})}),yt++}catch(de){console.warn("[posts] could not save a generated idea",de)}}if(yt===0){me.error(f("sandbox.postBoard.ideasFailed"));return}me.success(f("sandbox.postBoard.ideasAdded",{count:String(yt)}))}catch(J){me.error(J instanceof Error?J.message:f("sandbox.postBoard.ideasFailed"))}finally{S(!1)}};return s.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[s.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[s.jsx(hn,{active:a==="board",onClick:()=>i("board"),icon:s.jsx(Ho,{size:14}),label:f("sandbox.postBoard.viewBoard")}),s.jsx(hn,{active:a==="list",onClick:()=>i("list"),icon:s.jsx(Xo,{size:14}),label:f("sandbox.postBoard.viewList")})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[k&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[s.jsx(Ct,{size:12,className:"animate-spin"}),f("sandbox.postBoard.generatingLabel")]}),s.jsxs(rt,{open:N,onOpenChange:B,children:[s.jsx(tl,{asChild:!0,children:s.jsxs(Ee,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[s.jsx(et,{size:14}),f("sandbox.postBoard.generateIdeas"),s.jsx(st,{variant:"secondary",children:f("common.soon")})]})}),s.jsxs(it,{className:"sm:max-w-lg",children:[s.jsxs(pt,{children:[s.jsx(lt,{children:f("sandbox.postBoard.generateIdeas")}),s.jsx(Mt,{children:f("sandbox.postBoard.ideaGuidanceLabel")})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Rt,{id:"idea-guidance",value:E,rows:6,autoFocus:!0,onChange:C=>w(C.target.value),placeholder:f("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),le.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(ze,{className:"text-xs",children:f("sandbox.postBoard.ideaPillarLabel")}),s.jsx(wt,{options:le.map(C=>C.title),value:le.find(C=>C.key===L)?.title??"",emptyLabel:f("sandbox.postBoard.ideaNoPillar"),onChange:C=>G(le.find(J=>J.title===C)?.key??"")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ze,{htmlFor:"idea-count",className:"text-xs",children:f("sandbox.postBoard.ideaCount")}),s.jsx(Xe,{id:"idea-count",type:"number",min:1,max:8,value:T,onChange:C=>R(Math.max(1,Math.min(8,Number(C.target.value)||1))),className:"h-9 w-16"}),s.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:f("sandbox.postBoard.usesCredits")})]})]}),s.jsx(ht,{children:s.jsxs(Ee,{type:"button",onClick:()=>{B(!1),ms()},children:[s.jsx(et,{size:14}),f("sandbox.postBoard.generateIdeas")]})})]})]}),s.jsxs(Kt,{children:[s.jsx(Ft,{asChild:!0,children:s.jsxs(Ee,{type:"button",size:"sm",children:[s.jsx(Ns,{size:14}),f("sandbox.postBoard.newPost"),s.jsx(ft,{size:14})]})}),s.jsxs(It,{align:"end",className:"w-56",children:[s.jsxs(Qe,{disabled:!0,onClick:()=>{M(void 0),K(!0)},children:[s.jsx(et,{size:14}),s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[f("sandbox.postBoard.newPostGenerate"),s.jsx(st,{variant:"secondary",children:f("common.soon")})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:f("sandbox.postBoard.newPostGenerateHint")})]})]}),s.jsxs(Qe,{onClick:Et,children:[s.jsx(qo,{size:14}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:f("sandbox.postBoard.newPostWrite")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:f("sandbox.postBoard.newPostWriteHint")})]})]}),s.jsxs(Qe,{onClick:()=>O(!0),children:[s.jsx(gs,{size:14}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:f("sandbox.postBoard.importContent")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:f("sandbox.postBoard.importContentHint")})]})]})]})]}),s.jsx(Mi,{open:$,onOpenChange:K,decofile:o,hasAi:g,seed:z,onGenerate:C=>{re(C)}},z?.title??"scratch"),s.jsx(rt,{open:W,onOpenChange:O,children:s.jsxs(it,{className:"max-h-[85vh] sm:max-w-2xl",children:[s.jsxs(pt,{children:[s.jsx(lt,{children:f("sandbox.postBoard.importTitle")}),s.jsx(Mt,{children:f("sandbox.postBoard.importDescription")})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:s.jsx(Mn,{code:I,language:jo(I)?"html":"markdown",height:"100%",autoFocus:!0,onChange:C=>D(C??"")})}),s.jsx("input",{ref:U,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async C=>{const J=C.target.files?.[0];J&&D(await J.text()),C.target.value=""}}),s.jsxs(Ee,{type:"button",variant:"outline",size:"sm",onClick:()=>U.current?.click(),children:[s.jsx(gs,{size:14}),f("sandbox.postBoard.importUpload")]})]}),s.jsx(ht,{children:s.jsxs(Ee,{type:"button",disabled:!I.trim(),onClick:us,children:[s.jsx(gs,{size:14}),f("sandbox.postBoard.importRun")]})})]})})]})]}),Z.length===0&&ae.length===0?s.jsx(cl,{className:"flex-1",icon:s.jsx(et,{size:22}),title:f("sandbox.postBoard.emptyTitle"),description:f("sandbox.postBoard.emptyDescription"),buttonProps:{children:f("sandbox.postBoard.newPost"),onClick:Et}}):a==="board"?s.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[s.jsx(wr,{ideas:ae,collapsed:X.includes(fn),pillarTitleOf:oe,onToggleCollapsed:()=>te(fn),onGenerate:rs,onDelete:cs}),s.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),As.map(C=>{const J=Z.filter(Be=>Be.status===C);yr(C)&&J.sort(br);const _e=f(Wt[C]),Ve=X.includes(C);return s.jsx("div",{onDragOver:Be=>{Be.preventDefault(),y(C)},onDragLeave:()=>y(Be=>Be===C?null:Be),onDrop:Be=>{Be.preventDefault(),ds(C,Be.dataTransfer.getData(No))},className:ye("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ve?"w-11":"w-72",v===C&&"border-primary bg-primary/5"),children:Ve?s.jsxs("button",{type:"button",onClick:()=>te(C),"aria-label":f("sandbox.postBoard.expandLane",{lane:_e}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[s.jsx(_t,{size:14,className:"shrink-0"}),s.jsx("span",{className:"text-xs tabular-nums",children:J.length}),s.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:_e})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[s.jsxs("button",{type:"button",onClick:()=>te(C),"aria-label":f("sandbox.postBoard.collapseLane",{lane:_e}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[s.jsx(ft,{size:14,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:_e})]}),s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:J.length})]}),s.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:J.length===0?s.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.postBoard.laneEmpty")}):J.map(Be=>s.jsx(Sr,{post:Be,payload:P(Be.key),moving:d.isMoving(Be.key),onOpen:()=>c(Be.key),onArchive:Be.status==="archived"?void 0:()=>{ne(Be)}},Be.key))})]})},C)})]}):s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[s.jsx(dr,{value:ge,onChange:De}),we?s.jsx(gr,{count:ke.size,allSelected:xe.length>0&&xe.every(C=>ke.has(C.key)),onToggleSelectAll:ls,onArchive:()=>{is()},onExit:()=>Ce(new Set)}):s.jsx(ur,{categories:Le,authors:Ie,statusCounts:Pe,categoryFilter:se,authorFilter:ue,statusFilter:V,sort:he,onCategoryFilterChange:ce,onAuthorFilterChange:j,onStatusFilterChange:fe,onSortChange:ve}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s.jsx(jr,{posts:xe,selectedKey:q,selectionActive:we,selectedKeys:ke,onToggleSelect:Re,onOpen:c,isMoving:d.isMoving,onArchive:C=>{ne(C)}})})]}),s.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:q&&m?s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:m(q)}):s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:f("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&F&&m&&s.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:m(l,{expanded:!0,onToggleExpand:()=>_(!1),onClose:()=>{_(!1),r?.()}})}),s.jsx(rt,{open:a==="board"&&!!l&&!F,onOpenChange:C=>{C||(_(!1),r?.())},children:s.jsxs(it,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[s.jsx(lt,{className:"sr-only",children:f("sandbox.collectionsSidebar.posts")}),l&&m?s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:m(l,{expanded:!1,onToggleExpand:()=>_(!0),onClose:()=>r?.()})}):null]})})]})}function hn(n){const e=ie.c(7),{active:t,onClick:o,icon:a,label:l}=n,i=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==i?(c=ye("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==c?(r=s.jsxs("button",{type:"button",onClick:o,className:c,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=c,e[6]=r):r=e[6],r}function jr(n){const e=ie.c(23),{posts:t,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:c,isMoving:r,onArchive:d}=n,h=je();if(t.length===0){let u;e[0]!==h?(u=h("sandbox.postList.noMatches"),e[0]=h,e[1]=u):u=e[1];let p;return e[2]!==u?(p=s.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=p):p=e[3],p}let m;if(e[4]!==r||e[5]!==d||e[6]!==c||e[7]!==i||e[8]!==t||e[9]!==o||e[10]!==l||e[11]!==a){let u;e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==i||e[17]!==o||e[18]!==l||e[19]!==a?(u=p=>s.jsx(kr,{post:p,selected:p.key===o,selectionActive:a,checked:l.has(p.key),onToggleSelect:()=>i(p.key),moving:r(p.key),onOpen:()=>c(p.key),onArchive:p.status==="archived"?void 0:()=>d(p)},p.key),e[13]=r,e[14]=d,e[15]=c,e[16]=i,e[17]=o,e[18]=l,e[19]=a,e[20]=u):u=e[20],m=t.map(u),e[4]=r,e[5]=d,e[6]=c,e[7]=i,e[8]=t,e[9]=o,e[10]=l,e[11]=a,e[12]=m}else m=e[12];let f;return e[21]!==m?(f=s.jsx("ul",{className:"divide-y",children:m}),e[21]=m,e[22]=f):f=e[22],f}function kr(n){const e=ie.c(60),{post:t,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:c,onOpen:r,onArchive:d}=n,h=je(),m=t.status==="awaiting_review"&&t.missing.length>0,f=t.status==="scheduled"||t.status==="published",u=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let p;e[0]!==u?(p=ye("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=p):p=e[1];let b;e[2]!==i?(b=()=>i(),e[2]=i,e[3]=b):b=e[3];let g;e[4]!==t.title||e[5]!==h?(g=t.title||h("sandbox.postBoard.untitled"),e[4]=t.title,e[5]=h,e[6]=g):g=e[6];let v;e[7]!==l||e[8]!==b||e[9]!==g?(v=s.jsx(Zt,{checked:l,onCheckedChange:b,"aria-label":g}),e[7]=l,e[8]=b,e[9]=g,e[10]=v):v=e[10];let y;e[11]!==p||e[12]!==v?(y=s.jsx("span",{className:p,children:v}),e[11]=p,e[12]=v,e[13]=y):y=e[13];let k;e[14]!==c||e[15]!==d||e[16]!==a?(k=d&&!a&&s.jsx(Fs,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=k):k=e[17];let S;e[18]!==r||e[19]!==i||e[20]!==a?(S=()=>a?i():r(),e[18]=r,e[19]=i,e[20]=a,e[21]=S):S=e[21];const N=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let B;e[22]!==N?(B=ye("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",N),e[22]=N,e[23]=B):B=e[23];let E;e[24]!==t.title||e[25]!==h?(E=t.title||h("sandbox.postBoard.untitled"),e[24]=t.title,e[25]=h,e[26]=E):E=e[26];let w;e[27]!==E?(w=s.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:E}),e[27]=E,e[28]=w):w=e[28];const T=xr[t.status],R=Wt[t.status];let L;e[29]!==h||e[30]!==R?(L=h(R),e[29]=h,e[30]=R,e[31]=L):L=e[31];let G;e[32]!==T||e[33]!==L?(G=s.jsx(st,{variant:T,className:"shrink-0",children:L}),e[32]=T,e[33]=L,e[34]=G):G=e[34];let F;e[35]!==m||e[36]!==t.missing?(F=m&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[s.jsx(Bt,{size:12}),t.missing.length]}),e[35]=m,e[36]=t.missing,e[37]=F):F=e[37];let _;e[38]!==t.duplicateTitle||e[39]!==h?(_=t.duplicateTitle&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:h("sandbox.postBoard.duplicateTitle"),children:[s.jsx(_s,{size:12,"aria-hidden":!0}),s.jsx("span",{className:"sr-only",children:h("sandbox.postBoard.duplicateTitle")})]}),e[38]=t.duplicateTitle,e[39]=h,e[40]=_):_=e[40];let $;e[41]!==f||e[42]!==t.date||e[43]!==t.scheduledDatetime?($=f&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[s.jsx(Ss,{size:12}),(t.scheduledDatetime||t.date||"").slice(0,10)]}),e[41]=f,e[42]=t.date,e[43]=t.scheduledDatetime,e[44]=$):$=e[44];let K;e[45]!==G||e[46]!==F||e[47]!==_||e[48]!==$?(K=s.jsxs("div",{className:"flex items-center gap-2",children:[G,F,_,$]}),e[45]=G,e[46]=F,e[47]=_,e[48]=$,e[49]=K):K=e[49];let z;e[50]!==o||e[51]!==B||e[52]!==w||e[53]!==K||e[54]!==S?(z=s.jsxs("button",{type:"button",onClick:S,"aria-current":o,className:B,children:[w,K]}),e[50]=o,e[51]=B,e[52]=w,e[53]=K,e[54]=S,e[55]=z):z=e[55];let M;return e[56]!==z||e[57]!==y||e[58]!==k?(M=s.jsxs("li",{className:"group/row relative",children:[y,k,z]}),e[56]=z,e[57]=y,e[58]=k,e[59]=M):M=e[59],M}function Sr(n){const e=ie.c(50),{post:t,payload:o,moving:a,onOpen:l,onArchive:i}=n,c=je(),r=t.status!=="generating"&&!a;let d;e[0]!==o?(d=ni(o),e[0]=o,e[1]=d):d=e[1];const h=d,m=!r&&"opacity-80";let f;e[2]!==m?(f=ye("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",m),e[2]=m,e[3]=f):f=e[3];let u;e[4]!==a||e[5]!==i?(u=i&&s.jsx(Fs,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=u):u=e[6];let p;e[7]!==t.key?(p=L=>L.dataTransfer.setData(No,t.key),e[7]=t.key,e[8]=p):p=e[8];const b=r?"cursor-grab active:cursor-grabbing":"cursor-pointer";let g;e[9]!==b?(g=ye("block w-full p-3 text-left",b),e[9]=b,e[10]=g):g=e[10];let v;e[11]!==t.title||e[12]!==c?(v=t.title||c("sandbox.postBoard.untitled"),e[11]=t.title,e[12]=c,e[13]=v):v=e[13];let y;e[14]!==v?(y=s.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:v}),e[14]=v,e[15]=y):y=e[15];let k;e[16]!==h||e[17]!==t.status?(k=t.status==="draft"&&s.jsxs(s.Fragment,{children:[h.pillarTitle&&s.jsx(st,{variant:"secondary",className:"max-w-full truncate",children:h.pillarTitle}),h.format?.name&&s.jsx(st,{variant:"outline",className:"max-w-full truncate",children:h.format.name})]}),e[16]=h,e[17]=t.status,e[18]=k):k=e[18];let S;e[19]!==t.status||e[20]!==c?(S=t.status==="generating"&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(Ct,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=t.status,e[20]=c,e[21]=S):S=e[21];let N;e[22]!==t.missing||e[23]!==t.status||e[24]!==c?(N=t.status==="awaiting_review"&&(t.missing.length>0?s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[s.jsx(Bt,{size:12}),c("sandbox.postBoard.nIssues",{count:String(t.missing.length)})]}):s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[s.jsx(rl,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=t.missing,e[23]=t.status,e[24]=c,e[25]=N):N=e[25];let B;e[26]!==t.date||e[27]!==t.scheduledDatetime||e[28]!==t.status?(B=(t.status==="scheduled"||t.status==="published")&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ss,{size:12}),(t.scheduledDatetime||t.date||"").slice(0,10)]}),e[26]=t.date,e[27]=t.scheduledDatetime,e[28]=t.status,e[29]=B):B=e[29];let E;e[30]!==t.duplicateTitle||e[31]!==c?(E=t.duplicateTitle&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[s.jsx(_s,{size:12,"aria-hidden":!0}),c("sandbox.postBoard.duplicateTitle")]}),e[30]=t.duplicateTitle,e[31]=c,e[32]=E):E=e[32];let w;e[33]!==k||e[34]!==S||e[35]!==N||e[36]!==B||e[37]!==E?(w=s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[k,S,N,B,E]}),e[33]=k,e[34]=S,e[35]=N,e[36]=B,e[37]=E,e[38]=w):w=e[38];let T;e[39]!==r||e[40]!==l||e[41]!==w||e[42]!==p||e[43]!==g||e[44]!==y?(T=s.jsxs("button",{type:"button",draggable:r,onDragStart:p,onClick:l,className:g,children:[y,w]}),e[39]=r,e[40]=l,e[41]=w,e[42]=p,e[43]=g,e[44]=y,e[45]=T):T=e[45];let R;return e[46]!==T||e[47]!==f||e[48]!==u?(R=s.jsxs("div",{className:f,children:[u,T]}),e[46]=T,e[47]=f,e[48]=u,e[49]=R):R=e[49],R}function wr(n){const e=ie.c(40),{ideas:t,collapsed:o,pillarTitleOf:a,onToggleCollapsed:l,onGenerate:i,onDelete:c}=n,r=je();let d,h,m,f,u,p,b;if(e[0]!==o||e[1]!==t.length||e[2]!==l||e[3]!==r){b=Symbol.for("react.early_return_sentinel");e:{if(d=r("sandbox.postBoard.ideasTray"),o){let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(_t,{size:14,className:"shrink-0"}),e[11]=w):w=e[11];let T;e[12]!==t.length?(T=s.jsx("span",{className:"text-xs tabular-nums",children:t.length}),e[12]=t.length,e[13]=T):T=e[13],b=s.jsxs("button",{type:"button",onClick:l,"aria-label":r("sandbox.postBoard.expandLane",{lane:d}),"aria-expanded":!1,className:"flex w-11 shrink-0 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[w,T,s.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:d})]});break e}p="flex w-72 shrink-0 flex-col",u="flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",h="button",m=l,f=r("sandbox.postBoard.collapseLane",{lane:d})}e[0]=o,e[1]=t.length,e[2]=l,e[3]=r,e[4]=d,e[5]=h,e[6]=m,e[7]=f,e[8]=u,e[9]=p,e[10]=b}else d=e[4],h=e[5],m=e[6],f=e[7],u=e[8],p=e[9],b=e[10];if(b!==Symbol.for("react.early_return_sentinel"))return b;let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ft,{size:14,className:"shrink-0"}),e[14]=g):g=e[14];let v;e[15]!==d?(v=s.jsx("span",{className:"truncate",children:d}),e[15]=d,e[16]=v):v=e[16];let y;e[17]!==h||e[18]!==m||e[19]!==f||e[20]!==v?(y=s.jsxs("button",{type:h,onClick:m,"aria-label":f,"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[g,v]}),e[17]=h,e[18]=m,e[19]=f,e[20]=v,e[21]=y):y=e[21];let k;e[22]!==t.length?(k=s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:t.length}),e[22]=t.length,e[23]=k):k=e[23];let S;e[24]!==k||e[25]!==u||e[26]!==y?(S=s.jsxs("div",{className:u,children:[y,k]}),e[24]=k,e[25]=u,e[26]=y,e[27]=S):S=e[27];let N;e[28]!==t||e[29]!==c||e[30]!==i||e[31]!==a||e[32]!==r?(N=t.length===0?s.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.postBoard.ideasEmpty")}):t.map(w=>{const T=a(w.pillarKey);return s.jsxs("div",{className:"group/card relative rounded-lg border border-dashed bg-card shadow-sm transition-colors hover:border-primary/40",children:[s.jsx(Fs,{label:r("sandbox.postBoard.deleteIdea"),onArchive:()=>c(w),className:"top-2"}),s.jsxs("div",{className:"p-3",children:[s.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:w.title||r("sandbox.postBoard.untitledIdea")}),w.body&&s.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:w.body}),T&&s.jsx(st,{variant:"secondary",className:"mt-2 max-w-full truncate",children:T})]}),s.jsx("div",{className:"border-t px-3 py-2",children:s.jsxs(Ee,{type:"button",variant:"ghost",size:"sm",disabled:!0,className:"h-7 w-full justify-start px-1.5 text-xs",onClick:()=>i(w),children:[s.jsx(et,{size:13}),r("sandbox.postBoard.writeFromIdea"),s.jsx(st,{variant:"secondary",className:"ml-auto",children:r("common.soon")})]})})]},w.key)}),e[28]=t,e[29]=c,e[30]=i,e[31]=a,e[32]=r,e[33]=N):N=e[33];let B;e[34]!==N?(B=s.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto pb-2 pr-1",children:N}),e[34]=N,e[35]=B):B=e[35];let E;return e[36]!==S||e[37]!==B||e[38]!==p?(E=s.jsxs("div",{className:p,children:[S,B]}),e[36]=S,e[37]=B,e[38]=p,e[39]=E):E=e[39],E}function Fs(n){const e=ie.c(13),{label:t,onArchive:o,disabled:a,className:l}=n,i=je();let c;e[0]!==t||e[1]!==i?(c=t??i("sandbox.postBoard.delete"),e[0]=t,e[1]=i,e[2]=c):c=e[2];const r=c;let d;e[3]!==o?(d=u=>{u.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let h;e[5]!==l?(h=ye("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[5]=l,e[6]=h):h=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Bs,{size:13}),e[7]=m):m=e[7];let f;return e[8]!==a||e[9]!==d||e[10]!==h||e[11]!==r?(f=s.jsx("button",{type:"button",disabled:a,"aria-label":r,title:r,onClick:d,className:h,children:m}),e[8]=a,e[9]=d,e[10]=h,e[11]=r,e[12]=f):f=e[12],f}function Ue(n){const e=ie.c(54),{icon:t,logoUrl:o,title:a,subtitle:l,active:i,accent:c,variantCount:r,trailing:d,selectable:h,selectionActive:m,selected:f,invalid:u,invalidReason:p,warning:b,warningReason:g,onToggleSelect:v,onClick:y,menu:k}=n,S=je(),N=c==="global";let B;e[0]!==t||e[1]!==i||e[2]!==N||e[3]!==o?(B=o?s.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):s.jsx("span",{className:ye("flex size-8 shrink-0 items-center justify-center rounded-lg",N?"bg-global-section/15":"bg-muted"),children:s.jsx(t,{size:16,className:ye("shrink-0",!N&&(i?"text-accent-foreground":"text-muted-foreground")),style:N?{color:Ts}:void 0})}),e[0]=t,e[1]=i,e[2]=N,e[3]=o,e[4]=B):B=e[4];const E=B,w=i?N?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":N?"hover:bg-global-section/10":"hover:bg-muted";let T;e[5]!==w?(T=ye("group relative flex min-w-0 items-center rounded-md transition-colors",w),e[5]=w,e[6]=T):T=e[6];let R;e[7]!==v||e[8]!==h||e[9]!==f||e[10]!==m||e[11]!==S||e[12]!==a?(R=h&&s.jsx("span",{className:ye("flex shrink-0 items-center pl-2.5 transition-opacity",f||m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Nr,children:s.jsx(Zt,{checked:f,onCheckedChange:()=>v?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:a})})}),e[7]=v,e[8]=h,e[9]=f,e[10]=m,e[11]=S,e[12]=a,e[13]=R):R=e[13];const L=u&&!i&&"text-destructive";let G;e[14]!==L?(G=ye("block truncate text-sm font-medium",L),e[14]=L,e[15]=G):G=e[15];let F;e[16]!==G||e[17]!==a?(F=s.jsx("span",{className:G,children:a}),e[16]=G,e[17]=a,e[18]=F):F=e[18];const _=i?"text-accent-foreground/70":"text-muted-foreground";let $;e[19]!==_?($=ye("block truncate text-xs",_),e[19]=_,e[20]=$):$=e[20];let K;e[21]!==l||e[22]!==$?(K=s.jsx("span",{className:$,children:l}),e[21]=l,e[22]=$,e[23]=K):K=e[23];let z;e[24]!==K||e[25]!==F?(z=s.jsxs("span",{className:"min-w-0 flex-1",children:[F,K]}),e[24]=K,e[25]=F,e[26]=z):z=e[26];let M;e[27]!==i||e[28]!==S||e[29]!==r?(M=r!==void 0&&r>1&&s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsxs("span",{className:ye("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[s.jsx(Cn,{size:14}),r]})}),s.jsx(qe,{side:"bottom",children:S("sandbox.itemRow.variantCount",{count:r})})]}),e[27]=i,e[28]=S,e[29]=r,e[30]=M):M=e[30];let W;e[31]!==b||e[32]!==g?(W=b&&s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsx("span",{className:"flex shrink-0 items-center text-warning",children:s.jsx(Bt,{size:14})})}),g&&s.jsx(qe,{side:"bottom",children:g})]}),e[31]=b,e[32]=g,e[33]=W):W=e[33];let O;e[34]!==i||e[35]!==u||e[36]!==p?(O=u&&s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsx("span",{className:ye("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:s.jsx(Bt,{size:14})})}),p&&s.jsx(qe,{side:"bottom",children:p})]}),e[34]=i,e[35]=u,e[36]=p,e[37]=O):O=e[37];let I;e[38]!==y||e[39]!==E||e[40]!==z||e[41]!==M||e[42]!==W||e[43]!==O||e[44]!==d?(I=s.jsxs("button",{type:"button",onClick:y,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[E,z,M,W,O,d]}),e[38]=y,e[39]=E,e[40]=z,e[41]=M,e[42]=W,e[43]=O,e[44]=d,e[45]=I):I=e[45];let D;e[46]!==i||e[47]!==k?(D=k&&s.jsx("div",{className:ye("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:k}),e[46]=i,e[47]=k,e[48]=D):D=e[48];let U;return e[49]!==I||e[50]!==D||e[51]!==T||e[52]!==R?(U=s.jsxs("div",{className:T,children:[R,I,D]}),e[49]=I,e[50]=D,e[51]=T,e[52]=R,e[53]=U):U=e[53],U}function Nr(n){return n.stopPropagation()}function tt(n){const e=ie.c(10),{icon:t,title:o,description:a}=n;let l;e[0]!==t?(l=t&&s.jsx(t,{size:24,className:"text-muted-foreground/60"}),e[0]=t,e[1]=l):l=e[1];let i;e[2]!==o?(i=s.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a&&s.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==l||e[7]!==i||e[8]!==c?(r=s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,c]}),e[6]=l,e[7]=i,e[8]=c,e[9]=r):r=e[9],r}const Cr={loaders:Nn,actions:Bn},Pr={loaders:"Loaders",actions:"Actions"},Tr={analytics:Qo,blog:Kn,commerce:Yo,site:Wo,website:zt};function _r(n,e){return e===0?Tr[n.toLowerCase()]??zs:zs}function Lt(n,e){return e===0?xa(n):n}function Br(n){const e=ie.c(98),{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r}=n,d=je();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[m,f]=A.useState(h),[u,p]=A.useState(null),[b,g]=A.useState(""),[v,y]=A.useState(Fr),[k,S]=A.useState(r);k!==r&&(S(r),f([]),p(null),g(""),y(new Set));let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=X=>{y(ee=>{const te=new Set(ee);return te.has(X)?te.delete(X):te.add(X),te})},e[1]=N):N=e[1];const B=N;let E;e[2]!==a||e[3]!==t||e[4]!==o?(E={orgSlug:t,virtualMcpId:o,branch:a},e[2]=a,e[3]=t,e[4]=o,e[5]=E):E=e[5];const w=Xt(E);let T;e[6]!==w?(T=$n((X,ee)=>w.mutate({blockKey:X,data:ee})),e[6]=w,e[7]=T):T=e[7];const R=T;let L;e[8]!==r?(L=ba(r),e[8]=r,e[9]=L):L=e[9];const G=L,F=Cr[r];let _,$,K,z,M,W,O;if(e[10]!==F||e[11]!==a||e[12]!==c||e[13]!==r||e[14]!==i||e[15]!==v||e[16]!==t||e[17]!==m||e[18]!==l||e[19]!==w||e[20]!==R||e[21]!==b||e[22]!==u||e[23]!==G||e[24]!==d||e[25]!==o){K=Symbol.for("react.early_return_sentinel");e:{const X=[...fa(i,c,r).map(Rr),...pa(i,r).map(Or)],ee=b.trim().toLowerCase(),te=ee.length>0,re=te?X.filter(H=>H.title.toLowerCase().includes(ee)||H.resolveType.toLowerCase().includes(ee)):[],Z=new Map,ae=[],le=new Map;if(!te){for(const H of X){const xe=H.folderPath;if(!(xe.length<m.length)&&m.every((we,Re)=>xe[Re]===we))if(xe.length===m.length)if(H.savedKey!==void 0){const we=le.get(H.resolveType);we?we.push(H):le.set(H.resolveType,[H])}else ae.push(H);else{const we=xe[m.length],Re=Z.get(we)??{count:0,savedCount:0};H.savedKey!==void 0?Re.savedCount=Re.savedCount+1:Re.count=Re.count+1,Z.set(we,Re)}}ae.sort($r);for(const H of le.values())H.sort(Lr)}const oe=[...le.entries()].filter(H=>{const[xe]=H;return!ae.some(we=>we.resolveType===xe)}).flatMap(Ar).sort(Dr);let P;e[33]!==m?(P=(H,xe)=>Lt(H.name,m.length).localeCompare(Lt(xe.name,m.length)),e[33]=m,e[34]=P):P=e[34];const q=[...Z.entries()].map(Er).sort(P);let ne;e[35]===Symbol.for("react.memo_cache_sentinel")?(ne=H=>{p(H.savedKey!==void 0?{mode:"saved",key:H.savedKey}:{mode:"available",resolveType:H.resolveType,title:H.title})},e[35]=ne):ne=e[35];const se=ne;let ce;e[36]!==w||e[37]!==G||e[38]!==d?(ce=async(H,xe)=>{await w.mutateAsync({blockKey:H,data:xe}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:G,blockId:H})),p({mode:"saved",key:H})},e[36]=w,e[37]=G,e[38]=d,e[39]=ce):ce=e[39];const ue=ce;let j;e[40]!==c||e[41]!==u?(j=Ir(u,c),e[40]=c,e[41]=u,e[42]=j):j=e[42];const V=j;if(V){const H=`${V.mode}:${V.mode==="saved"?V.blockKey:V.resolveType}`;let xe;e[43]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>p(null),e[43]=xe):xe=e[43];let we;e[44]!==a||e[45]!==c||e[46]!==ue||e[47]!==r||e[48]!==i||e[49]!==t||e[50]!==l||e[51]!==w.isPending||e[52]!==R||e[53]!==H||e[54]!==V.editorTarget||e[55]!==V.initialValue||e[56]!==o?(we=s.jsx(ha,{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r,target:V.editorTarget,initialValue:V.initialValue,isCreating:w.isPending,onCreate:ue,onSaveReferencedBlock:R,onBack:xe},H),e[44]=a,e[45]=c,e[46]=ue,e[47]=r,e[48]=i,e[49]=t,e[50]=l,e[51]=w.isPending,e[52]=R,e[53]=H,e[54]=V.editorTarget,e[55]=V.initialValue,e[56]=o,e[57]=we):we=e[57],K=we;break e}O="flex h-full w-full min-w-0 flex-col";let fe;e[58]!==d?(fe=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=fe):fe=e[59];let he;e[60]===Symbol.for("react.memo_cache_sentinel")?(he=()=>f([]),e[60]=he):he=e[60];const ve=m.length===0?"font-medium text-foreground":"text-muted-foreground";let ge;e[61]!==ve?(ge=ye("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ve),e[61]=ve,e[62]=ge):ge=e[62];const De=Pr[r];let ke;e[63]!==ge||e[64]!==De?(ke=s.jsx("button",{type:"button",onClick:he,className:ge,children:De}),e[63]=ge,e[64]=De,e[65]=ke):ke=e[65];let Ce;e[66]!==m?(Ce=m.map((H,xe)=>{const we=xe===m.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>f(m.slice(0,xe+1)),className:ye("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",we?"font-medium text-foreground":"text-muted-foreground"),children:Lt(H,xe)})]},`${H}-${xe}`)}),e[66]=m,e[67]=Ce):Ce=e[67];let Pe;e[68]!==fe||e[69]!==ke||e[70]!==Ce?(Pe=s.jsxs("nav",{"aria-label":fe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[ke,Ce]}),e[68]=fe,e[69]=ke,e[70]=Ce,e[71]=Pe):Pe=e[71];let Te;e[72]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Te):Te=e[72];let Ae;e[73]===Symbol.for("react.memo_cache_sentinel")?(Ae=H=>g(H.target.value),e[73]=Ae):Ae=e[73];let be;e[74]!==r||e[75]!==d?(be=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:r}),e[74]=r,e[75]=d,e[76]=be):be=e[76];let Le;e[77]!==r||e[78]!==d?(Le=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:r}),e[77]=r,e[78]=d,e[79]=Le):Le=e[79];let Ie;e[80]!==b||e[81]!==be||e[82]!==Le?(Ie=s.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Te,s.jsx("input",{type:"text",value:b,onChange:Ae,placeholder:be,"aria-label":Le,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=b,e[81]=be,e[82]=Le,e[83]=Ie):Ie=e[83],e[84]!==Pe||e[85]!==Ie?($=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Pe,Ie]}),e[84]=Pe,e[85]=Ie,e[86]=$):$=e[86],_=Jt,W="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",z="mx-auto w-full max-w-4xl px-6 py-5",M=te?re.length===0?s.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:r,query:b.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):s.jsx("div",{className:"flex flex-col gap-1",children:re.map(H=>s.jsx(Ue,{icon:F,accent:H.savedKey!==void 0?"global":void 0,title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)},H.savedKey??H.resolveType))}):q.length===0&&ae.length===0&&oe.length===0?s.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:r}),description:m.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):s.jsxs(s.Fragment,{children:[q.length>0&&s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:q.map(H=>{const xe=_r(H.name,m.length);return s.jsxs("button",{type:"button",onClick:()=>f([...m,H.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[s.jsx(xe,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm font-medium",children:Lt(H.name,m.length)}),s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[H.count," ",H.count===1?G:r,H.savedCount>0&&s.jsxs(s.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:H.savedCount})]})]})]})]},H.name)})}),(ae.length>0||oe.length>0)&&s.jsxs("div",{className:ye("flex flex-col gap-1",q.length>0&&"mt-4"),children:[ae.map(H=>{const xe=le.get(H.resolveType)??[],we=v.has(H.resolveType);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(Ue,{icon:F,title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)}),xe.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>B(H.resolveType),"aria-expanded":we,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Ts},children:[we?s.jsx(ft,{size:12,className:"shrink-0"}):s.jsx(_t,{size:12,className:"shrink-0"}),d(we?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",xe.length,")"]}),we&&s.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:xe.map(Re=>s.jsx(Ue,{icon:F,accent:"global",title:Re.title,subtitle:Re.resolveType,active:!1,onClick:()=>se(Re)},Re.savedKey))})]})]},H.resolveType)}),oe.map(H=>s.jsx(Ue,{icon:F,accent:"global",title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)},H.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=c,e[13]=r,e[14]=i,e[15]=v,e[16]=t,e[17]=m,e[18]=l,e[19]=w,e[20]=R,e[21]=b,e[22]=u,e[23]=G,e[24]=d,e[25]=o,e[26]=_,e[27]=$,e[28]=K,e[29]=z,e[30]=M,e[31]=W,e[32]=O}else _=e[26],$=e[27],K=e[28],z=e[29],M=e[30],W=e[31],O=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let I;e[87]!==z||e[88]!==M?(I=s.jsx("div",{className:z,children:M}),e[87]=z,e[88]=M,e[89]=I):I=e[89];let D;e[90]!==_||e[91]!==I||e[92]!==W?(D=s.jsx(_,{className:W,children:I}),e[90]=_,e[91]=I,e[92]=W,e[93]=D):D=e[93];let U;return e[94]!==$||e[95]!==D||e[96]!==O?(U=s.jsxs("div",{className:O,children:[$,D]}),e[94]=$,e[95]=D,e[96]=O,e[97]=U):U=e[97],U}function Er(n){const[e,t]=n;return{name:e,...t}}function Dr(n,e){return n.title.localeCompare(e.title)}function Ar(n){const[,e]=n;return e}function Lr(n,e){return n.title.localeCompare(e.title)}function $r(n,e){return n.title.localeCompare(e.title)}function Or(n){return{resolveType:n.resolveType,title:n.title,folderPath:Ln(n.resolveType)}}function Rr(n){return{resolveType:n.resolveType,title:n.title,folderPath:Ln(n.resolveType),savedKey:n.key}}function Fr(){return new Set}function Ir(n,e){if(!n)return null;if(n.mode==="available")return{mode:"available",resolveType:n.resolveType,editorTarget:{mode:"available",resolveType:n.resolveType,title:n.title},initialValue:{}};const{resolveType:t,props:o,title:a}=ga(e,n.key);return{mode:"saved",blockKey:n.key,resolveType:t,editorTarget:{mode:"saved",blockKey:n.key,resolveType:t,title:a},initialValue:o}}function Kr(n){const e=ie.c(106),{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,resolveType:r,title:d,defaultBlockId:h,isCreating:m,onCreate:f,onSaveReferencedBlock:u}=n,p=je(),b=Qt(),g=b?.virtualMcpId,y=Vn(g===o?o:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[S,N]=A.useState(k);let B;e[1]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[1]=B):B=e[1];const[E,w]=A.useState(B),[T,R]=A.useState(0),[L,G]=A.useState(!1);let F;e[2]!==i||e[3]!==r?(F=Cs(r,i),e[2]=i,e[3]=r,e[4]=F):F=e[4];const _=F;let $,K,z,M,W,O,I,D;if(e[5]!==y||e[6]!==a||e[7]!==c||e[8]!==E||e[9]!==S||e[10]!==m||e[11]!==f||e[12]!==t||e[13]!==l||e[14]!==r||e[15]!==p||e[16]!==b?.taskId||e[17]!==d||e[18]!==o){const ae=r.split("/").pop()?.replace(/\.tsx?$/,"")??r,le=b?.taskId??null,oe=l??void 0;let P;e[27]!==y||e[28]!==a||e[29]!==t||e[30]!==oe||e[31]!==le||e[32]!==o?(P={orgSlug:t,virtualMcpId:o,branch:a,threadId:le,previewUrl:oe,siteSlug:y},e[27]=y,e[28]=a,e[29]=t,e[30]=oe,e[31]=le,e[32]=o,e[33]=P):P=e[33],K=P;let q,ne,se,ce;if(e[34]!==c||e[35]!==E||e[36]!==S||e[37]!==f||e[38]!==p||e[39]!==d){const ke=[d,...E],Ce=Te=>{w(E.slice(0,Te)),R(zr)};let Pe;e[48]!==c||e[49]!==S||e[50]!==f?(Pe=async Te=>{const Ae=va(Te,c);if(Ae){me.error(Ae);return}await f(Te,S),G(!1)},e[48]=c,e[49]=S,e[50]=f,e[51]=Pe):Pe=e[51],$=Pe,D="flex h-full w-full min-w-0",I="flex min-w-0 flex-1 flex-col",W="shrink-0 border-b px-3 py-2.5",ce="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==p?(q=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=p,e[53]=q):q=e[53],ne="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",se=ke.map((Te,Ae)=>{const be=Ae===ke.length-1,Le=ya(Te);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[Ae>0&&s.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>Ce(Ae),title:Le,className:ye("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",be?"font-medium text-foreground":"text-muted-foreground"),children:Le})]},`${Le}-${Ae}`)}),e[34]=c,e[35]=E,e[36]=S,e[37]=f,e[38]=p,e[39]=d,e[40]=$,e[41]=q,e[42]=ne,e[43]=se,e[44]=ce,e[45]=W,e[46]=I,e[47]=D}else $=e[40],q=e[41],ne=e[42],se=e[43],ce=e[44],W=e[45],I=e[46],D=e[47];let ue;e[54]!==q||e[55]!==ne||e[56]!==se?(ue=s.jsx("nav",{"aria-label":q,className:ne,children:se}),e[54]=q,e[55]=ne,e[56]=se,e[57]=ue):ue=e[57];let j;e[58]===Symbol.for("react.memo_cache_sentinel")?(j=()=>G(!0),e[58]=j):j=e[58];let V;e[59]!==p?(V=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=p,e[60]=V):V=e[60];let fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(fe=s.jsx(Jo,{size:14}),e[61]=fe):fe=e[61];let he;e[62]!==m||e[63]!==V?(he=s.jsx(He,{asChild:!0,children:s.jsx(Ee,{size:"icon",className:"size-8 shrink-0",disabled:m,onClick:j,"aria-label":V,children:fe})}),e[62]=m,e[63]=V,e[64]=he):he=e[64];let ve;e[65]!==p?(ve=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=p,e[66]=ve):ve=e[66];let ge;e[67]!==ve?(ge=s.jsx(qe,{side:"bottom",children:ve}),e[67]=ve,e[68]=ge):ge=e[68];let De;e[69]!==he||e[70]!==ge?(De=s.jsxs(We,{children:[he,ge]}),e[69]=he,e[70]=ge,e[71]=De):De=e[71],e[72]!==ce||e[73]!==ue||e[74]!==De?(O=s.jsxs("div",{className:ce,children:[ue,De]}),e[72]=ce,e[73]=ue,e[74]=De,e[75]=O):O=e[75],z="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",M=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:ae}),e[5]=y,e[6]=a,e[7]=c,e[8]=E,e[9]=S,e[10]=m,e[11]=f,e[12]=t,e[13]=l,e[14]=r,e[15]=p,e[16]=b?.taskId,e[17]=d,e[18]=o,e[19]=$,e[20]=K,e[21]=z,e[22]=M,e[23]=W,e[24]=O,e[25]=I,e[26]=D}else $=e[19],K=e[20],z=e[21],M=e[22],W=e[23],O=e[24],I=e[25],D=e[26];let U;e[76]!==z||e[77]!==M?(U=s.jsx("p",{className:z,children:M}),e[76]=z,e[77]=M,e[78]=U):U=e[78];let X;e[79]!==U||e[80]!==W||e[81]!==O?(X=s.jsxs("div",{className:W,children:[O,U]}),e[79]=U,e[80]=W,e[81]=O,e[82]=X):X=e[82];let ee;e[83]!==c||e[84]!==E||e[85]!==T||e[86]!==S||e[87]!==i||e[88]!==u||e[89]!==K||e[90]!==_||e[91]!==p?(ee=s.jsx(Jt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:_?s.jsx(On,{schema:_,value:S,onChange:ae=>N(ae),basePath:"",breadcrumbPath:E,onBreadcrumbChange:w,meta:i,decofile:c,onSaveReferencedBlock:u,sandbox:K},T):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=E,e[85]=T,e[86]=S,e[87]=i,e[88]=u,e[89]=K,e[90]=_,e[91]=p,e[92]=ee):ee=e[92];let te;e[93]!==X||e[94]!==ee||e[95]!==I?(te=s.jsxs("div",{className:I,children:[X,ee]}),e[93]=X,e[94]=ee,e[95]=I,e[96]=te):te=e[96];let re;e[97]!==h||e[98]!==$||e[99]!==m||e[100]!==L?(re=s.jsx(ja,{open:L,onOpenChange:G,defaultBlockId:h,isPending:m,onSubmit:$}),e[97]=h,e[98]=$,e[99]=m,e[100]=L,e[101]=re):re=e[101];let Z;return e[102]!==te||e[103]!==re||e[104]!==D?(Z=s.jsxs("div",{className:D,children:[te,re]}),e[102]=te,e[103]=re,e[104]=D,e[105]=Z):Z=e[105],Z}function zr(n){return n+1}function Mr(n,e){const t={__resolveType:n},o=wa([t],e)[0];return o?Na(t,o,e):null}function Vr({orgSlug:n,virtualMcpId:e,branch:t,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:c}){const r=je(),d=Qt(),h=d?.virtualMcpId,f=Vn(h===e?e:null)?.metadata?.siteSlug??null,[u]=A.useState(()=>Mr(i,l)),[p,b]=A.useState(u?.data??{}),[g,v]=A.useState([]),[y,k]=A.useState(0),[S,N]=A.useState(!1),[B,E]=A.useState(null),w=B!==null,{save:T,flush:R}=ka({orgSlug:n,virtualMcpId:e,branch:t}),L=u?.resolveType?Cs(u.resolveType,a):null,G=l[i],F=G?Ia(i,G):i,_=d?.taskId??null,$={orgSlug:n,virtualMcpId:e,branch:t,threadId:_,previewUrl:o??void 0,siteSlug:f},K=I=>{b(I),T(i,I)},z=()=>{w?(E(null),N(!1),k(I=>I+1)):E(JSON.stringify(p,null,2))},M=I=>{const D=I??"";try{const U=JSON.parse(D);if(U&&typeof U=="object"&&!Array.isArray(U)){N(!1),K(U);return}N(!0)}catch{N(!0)}},W=[F,...g],O=I=>{v(g.slice(0,I)),k(D=>D+1)};return s.jsx("div",{className:"flex h-full w-full min-w-0",children:s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx(Sa,{crumbs:W,onSelect:O}),s.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ts},"aria-hidden":!0}),s.jsx("div",{className:"flex-1"}),s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsx(Ee,{variant:w?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:z,"aria-label":r(w?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":w,children:w?s.jsx(Es,{size:14}):s.jsx(Pn,{size:14})})}),s.jsx(qe,{side:"bottom",children:r(w?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),s.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:r("sandbox.savedSectionEditor.globalSectionDescription")})]}),s.jsxs("div",{className:"relative min-h-0 flex-1",children:[s.jsx(Jt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:L?s.jsx(On,{schema:L,value:p,onChange:I=>K(I),basePath:"",breadcrumbPath:g,onBreadcrumbChange:v,meta:a,decofile:l,onSaveReferencedBlock:c,sandbox:$},y):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.savedSectionEditor.noEditableFields")})})})}),B!==null&&s.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[S&&s.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:r("sandbox.savedSectionEditor.invalidJsonError")}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Mn,{language:"json",height:"100%",code:B,onChange:M,onSave:I=>{M(I),R()}})})]})]})]})})}function Gr(n){const e=ie.c(36),{selection:t,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,isCreating:d,onCreateAvailable:h,onSaveReferencedBlock:m}=n,f=je();if(!t){let b;e[0]!==f?(b=f("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=f,e[1]=b):b=e[1];let g;e[2]!==f?(g=f("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=f,e[3]=g):g=e[3];let v;return e[4]!==b||e[5]!==g?(v=s.jsx(tt,{title:b,description:g}),e[4]=b,e[5]=g,e[6]=v):v=e[6],v}if(t.collection==="available-section"){const b=`available:${t.resolveType}`,g=t.resolveType,v=t.title;let y;e[7]!==t.title?(y=Ca(t.title),e[7]=t.title,e[8]=y):y=e[8];let k;e[9]!==h||e[10]!==t.resolveType?(k=(N,B)=>h(t.resolveType,N,B),e[9]=h,e[10]=t.resolveType,e[11]=k):k=e[11];let S;return e[12]!==l||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==m||e[17]!==o||e[18]!==i||e[19]!==t.resolveType||e[20]!==t.title||e[21]!==b||e[22]!==y||e[23]!==k||e[24]!==a?(S=s.jsx(Kr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,resolveType:g,title:v,defaultBlockId:y,isCreating:d,onCreate:k,onSaveReferencedBlock:m},b),e[12]=l,e[13]=r,e[14]=d,e[15]=c,e[16]=m,e[17]=o,e[18]=i,e[19]=t.resolveType,e[20]=t.title,e[21]=b,e[22]=y,e[23]=k,e[24]=a,e[25]=S):S=e[25],S}const u=`saved:${t.key}`;let p;return e[26]!==l||e[27]!==r||e[28]!==c||e[29]!==m||e[30]!==o||e[31]!==i||e[32]!==t.key||e[33]!==u||e[34]!==a?(p=s.jsx(Vr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,blockKey:t.key,onSaveReferencedBlock:m},u),e[26]=l,e[27]=r,e[28]=c,e[29]=m,e[30]=o,e[31]=i,e[32]=t.key,e[33]=u,e[34]=a,e[35]=p):p=e[35],p}function $t(n){const e=ie.c(34),{onDuplicate:t,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:c}=n,r=je();let d;e[0]!==r?(d=r("sandbox.itemActions.moreActions"),e[0]=r,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx($o,{size:14}),e[2]=h):h=e[2];let m;e[3]!==d?(m=s.jsx(Ft,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Ur,children:h})}),e[3]=d,e[4]=m):m=e[4];let f;e[5]!==o||e[6]!==r?(f=o&&s.jsxs(Qe,{onClick:o,children:[s.jsx(ml,{size:14}),r("sandbox.itemActions.rename")]}),e[5]=o,e[6]=r,e[7]=f):f=e[7];let u;e[8]!==t||e[9]!==r?(u=t&&s.jsxs(Qe,{onClick:t,children:[s.jsx(_s,{size:14}),r("sandbox.itemActions.duplicate")]}),e[8]=t,e[9]=r,e[10]=u):u=e[10];let p;e[11]!==a||e[12]!==r?(p=a&&s.jsxs(s.Fragment,{children:[s.jsx(fs,{}),s.jsxs(Qe,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[s.jsx(Cn,{size:14}),r("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=r,e[13]=p):p=e[13];let b;e[14]!==l||e[15]!==i||e[16]!==r?(b=(l||i)&&s.jsxs(s.Fragment,{children:[s.jsx(fs,{}),l&&s.jsxs(Qe,{onClick:l,children:[s.jsx(wn,{size:14}),r("sandbox.itemActions.editSeo")]}),i&&s.jsxs(Qe,{onClick:i,children:[s.jsx(Pn,{size:14}),r("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=r,e[17]=b):b=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fs,{}),e[18]=g):g=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Bs,{size:14}),e[19]=v):v=e[19];let y;e[20]!==r?(y=r("sandbox.itemActions.delete"),e[20]=r,e[21]=y):y=e[21];let k;e[22]!==c||e[23]!==y?(k=s.jsxs(Qe,{onClick:c,className:"text-destructive focus:text-destructive",children:[v,y]}),e[22]=c,e[23]=y,e[24]=k):k=e[24];let S;e[25]!==k||e[26]!==f||e[27]!==u||e[28]!==p||e[29]!==b?(S=s.jsxs(It,{align:"end",className:"w-44",children:[f,u,p,b,g,k]}),e[25]=k,e[26]=f,e[27]=u,e[28]=p,e[29]=b,e[30]=S):S=e[30];let N;return e[31]!==S||e[32]!==m?(N=s.jsxs(Kt,{children:[m,S]}),e[31]=S,e[32]=m,e[33]=N):N=e[33],N}function Ur(n){return n.stopPropagation()}const Co=4;function os(n){const e=new Map;for(const t of n)t.slug&&!e.has(t.slug)&&e.set(t.slug,t);return e}function as(n,e){const t=n.parentSlug;if(!n.slug||!t||t===n.slug)return;const o=e.get(t);return o===n?void 0:o}function Po(n,e){const t=os(e),o=[],a=new Set;let l=t.get(n);for(;l&&!a.has(l.slug??"")&&(a.add(l.slug??""),o.push(l),!(o.length>=Co));)l=as(l,t);return o.reverse()}function To(n,e){const t=new Map;for(const o of n){const a=as(o,e);if(!a?.slug)continue;const l=t.get(a);l?l.push(o):t.set(a,[o])}for(const o of t.values())o.sort((a,l)=>a.label.localeCompare(l.label));return t}function Bd(n,e){const t=os(e),o=To(e,t),a=new Set([n]),l=t.get(n);let i=l?[l]:[];for(;i.length;){const c=[];for(const r of i)for(const d of o.get(r)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),c.push(d));i=c}return a.delete(n),a}function Ed(n,e){if(!n)return[];const t=os(e),o=Po(n,e),a=o[0];return!a||as(a,t)?[n]:o.map(l=>l.slug??"")}function Hr(n){const e=os(n),t=To(n,e),o=new Set,a=[],l=(c,r)=>{if(!o.has(c)&&(o.add(c),a.push({entry:c,depth:r}),!(r+1>=Co)))for(const d of t.get(c)??[])l(d,r+1)},i=n.filter(c=>!as(c,e)).sort((c,r)=>c.label.localeCompare(r.label));for(const c of i)l(c,0);for(const c of n)l(c,0);return a}function qr(n){return n.split("/").pop()?.replace(/\.tsx?$/,"")||n||"Section"}function Wr(n){const e=new Map;for(const t of n){const o=qr(t.resolveType),a=e.get(o);a?a.push(t):e.set(o,[t])}return[...e.entries()].map(([t,o])=>({label:t,sections:o})).sort((t,o)=>t.label.localeCompare(o.label))}function gn(n){const e=ie.c(8),{icon:t,label:o,className:a}=n;let l;e[0]!==a?(l=ye("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==t?(i=s.jsx(t,{size:13,className:"shrink-0"}),e[2]=t,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==l||e[6]!==i?(c=s.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=c):c=e[7],c}const xn=A.lazy(()=>Ye(()=>import("./app-editor-dw5EB-b1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(n=>({default:n.AppEditor}))),Yr=A.lazy(()=>Ye(()=>import("./post-editor-YTcyxDjG.js"),__vite__mapDeps([171,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,117,57,90,172,158,137,85,86,56,108,120,115,113,62,61,59,63,64,65,66,67,68,69,70,71,72,73,23,74,75,76,77,78,79,80,81,82,83,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,109,21,22,110,111,112,58,114,116,118,119,121,122,123,124,125,126,173,141,60,174,168,175,176,127,128,129,130,131,132,133,134,135,136,138,139,140,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,169,170])).then(n=>({default:n.PostEditor}))),Qr=A.lazy(()=>Ye(()=>import("./record-editor-CPNxIbj_.js"),__vite__mapDeps([177,1,2,57,90,22,23,24,25,113,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,58,114,115,116,117,118,119,120,121,122,123,124,125,126,176,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(n=>({default:n.RecordEditor}))),Jr=A.lazy(()=>Ye(()=>import("./context-B7ToLfv0.js"),__vite__mapDeps([178,1,2,25,28,29,30,31,32,33,34,35,36,37,24,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,90,113,108,18,179,104,79,56,105,81,71,72,4,5,6,7,8,9,73,23,114,141,174,142,70,19,83,85,86,180,145,181,62,61,11,12,13,14,15,3,10,16,17,20,59,63,64,65,66,67,68,69,74,75,76,77,78,80,82,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,106,107,109,21,22,110,111,112,58,115,116,117,118,119,120,121,122,123,124,125,126,168,176,177,127,128,129,130,131,132,133,134,135,136,137,138,139,140,143,144,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,169,170,182,173,60,175])).then(n=>({default:n.BlogContext}))),Xr=A.lazy(()=>Ye(()=>import("./category-editor-0k4-JF4F.js"),__vite__mapDeps([182,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,33,35,46,28,30,31,32,34,36,37,24,25,27,38,39,40,41,42,43,44,45,47,48,49,50,51,52,53,54,55,117,57,90,22,23,173,114,85,86,56,108,62,61,59,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,109,21,110,111,112,113,58,115,116,118,119,120,121,122,123,124,125,126,141,60,174,175,176,127,128,129,130,131,132,133,134,135,136,137,138,139,140,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(n=>({default:n.CategoryEditor}))),Zr=A.lazy(()=>Ye(()=>import("./sections-editor-C9jPqZOv.js"),__vite__mapDeps([183,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,58,62,61,59,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,23,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,57,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,22,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,168,184,26,60,185])).then(n=>({default:n.SectionsEditor}))),ec=A.lazy(()=>Ye(()=>import("./seo-editor-DqYSllol.js"),__vite__mapDeps([186,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,21,22,23,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,57,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,58,114,115,116,117,118,119,120,121,122,123,124,125,126,184])).then(n=>({default:n.SeoEditor}))),tc=A.lazy(()=>Ye(()=>import("./variant-calendar-B69B8SMP.js"),__vite__mapDeps([187,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,90,21,22,23,115,73,188,127,128,123,121,20,14,13,124,5,4,6,7,8,9,11,12,15,102,129,77,81,130,3,10,16,17,18,19,79,56,131,96,72,103,104,105,57,71,132,82,83,84,74,85,86,87,88,89,91,92,93,94,95,97,98,99,100,133,61,69,68,70,65,66,120,134,125,80,135,136,137,138,108,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,113,154,155,156,157,158,159,160,161,162,64,67,75,76,78,101,106,107,163,118,63,164,165,166,167,117,62,59,109,110,111,112,58,114,116,119,122,126,168,169,170])).then(n=>({default:n.VariantCalendar}))),sc=A.lazy(()=>Ye(()=>import("./post-calendar-BjokMhLQ.js"),__vite__mapDeps([189,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,21,22,23,127,128,123,121,20,14,13,124,5,4,6,7,8,9,11,12,15,102,129,77,81,130,3,10,16,17,18,19,79,73,56,131,96,72,103,104,105,90,57,71,132,82,83,84,74,85,86,87,88,89,91,92,93,94,95,97,98,99,100,133,61,69,68,70,65,66,120,134,125,80,135,136,137,138,108,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,113,154,155,156,157,158,159,160,161,162,64,67,75,76,78,101,106,107,163,118,63,164,165,166,167,117,62,59,109,110,111,112,58,114,115,116,119,122,126,168,169,170])).then(n=>({default:n.PostCalendar}))),nc=A.lazy(()=>Ye(()=>import("./redirect-editor-DrCNsc1H.js"),__vite__mapDeps([190,1,2,137,24,57,90,22,23,25,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,113,58,114,115,116,117,118,119,120,121,122,123,124,125,126,176])).then(n=>({default:n.RedirectEditor})));function oc(n){const e=ie.c(20),{deepLinkPage:t}=n,{currentBranch:o,virtualMcpId:a}=jn(),{org:l}=Oo(),i=Za(),c=el(),{runtime:r,previewServerUrl:d}=zn(a),h=r==="cms";let m;e[0]!==h||e[1]!==c.previewState||e[2]!==i.lifecycle.phase?(m=Al({fastPreviewActive:h,previewState:c.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=h,e[1]=c.previewState,e[2]=i.lifecycle.phase,e[3]=m):m=e[3];const f=m;if(f.kind==="sandbox-card"){const b=`/${l.slug}/settings/connections`;let g;return e[4]!==f.state||e[5]!==c.start||e[6]!==b||e[7]!==i.lifecycle||e[8]!==i.phase?(g=s.jsx(El,{state:f.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:c.start,connectionsHref:b}),e[4]=f.state,e[5]=c.start,e[6]=b,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!a||!o){let b;return e[10]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(tt,{title:"Waiting for sandbox context…"}),e[10]=b):b=e[10],b}const u=h?d:c.previewUrl;let p;return e[11]!==o||e[12]!==t||e[13]!==f.devServerReady||e[14]!==f.sandboxWarming||e[15]!==c.previewUrl||e[16]!==l.slug||e[17]!==u||e[18]!==a?(p=s.jsx(lc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:c.previewUrl,sitePreviewUrl:u,deepLinkPage:t,devServerReady:f.devServerReady,sandboxWarming:f.sandboxWarming}),e[11]=o,e[12]=t,e[13]=f.devServerReady,e[14]=f.sandboxWarming,e[15]=c.previewUrl,e[16]=l.slug,e[17]=u,e[18]=a,e[19]=p):p=e[19],p}const bn=2e3,ac=15;function yn(n,e,t,o){return typeof e!="string"||t&&(Gn(e,t,o)||n.state.dataUpdateCount>=ac)?!1:bn}function lc({orgSlug:n,virtualMcpId:e,branch:t,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:c}){const r=je(),d=Qt()?.taskId??null,h={orgSlug:n,virtualMcpId:e,branch:t,threadId:d,previewUrl:o},{data:m,isLoading:f}=Pa(h,{fetchEnabled:i}),u=vn({strict:!1}),[p,b]=A.useState(()=>u.contentCollection&&ot(u.contentCollection)&&u.contentCollection||"pages"),[g,v]=A.useState(()=>u.contentItem&&ot(p)?{collection:p,key:u.contentItem}:null),[y,k]=A.useState(null),S=!!(l?.pageId||l?.path||l?.pathTemplate),[N,B]=A.useState(!1);if(S&&!N&&g===null&&m){B(!0);const x=Ka(Hs(m),l??{});x&&(b("pages"),v({collection:"pages",key:x.key,path:x.path}))}const[E,w]=A.useState(""),[T,R]=A.useState("board"),L=x=>{v(x),k(null)},[G,F]=A.useState(p);G!==p&&(F(p),w(""));const{data:_,isLoading:$,isFetching:K}=Ta(h,{fetchEnabled:i,refetchInterval:x=>{const Y=x.state.data;if(p==="apps"&&g&&g.collection==="apps"){const de=m?.[g.key];return yn(x,typeof de?.__resolveType=="string"?de.__resolveType:void 0,Y)}if(p==="site"&&m){const de=Y?qs(m,Y):null,pe=m.site,Ne=de?.resolveType??(typeof pe?.__resolveType=="string"?pe.__resolveType:void 0);return yn(x,Ne,Y,["seo"])}return!1}}),z=(x,Y)=>!Gn(x,_,Y)&&($||K),{catalog:M,isLoading:W}=Pl(_??void 0,m??void 0,{enabled:p==="apps"}),O=Xt(h),I=In(h),D=Fi({orgSlug:n,virtualMcpId:e,branch:t,decofile:m??{},onMoved:(x,Y)=>v(de=>de?.collection==="posts"&&de.key===x?{collection:"posts",key:Y}:de)}),[U,X]=A.useState(null),[ee,te]=A.useState(),[re,Z]=A.useState(!1),[ae,le]=A.useState(),[oe,P]=A.useState(null),[q,ne]=A.useState(null),[se,ce]=A.useState(null),ue=!m||!_;if(f||$||ue&&c)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(at,{className:"size-5 text-muted-foreground"})});if(ue)return s.jsx(tt,{title:"Could not load site data."});const j=Hs(m).sort((x,Y)=>x.name.localeCompare(Y.name)),V=za(m).sort((x,Y)=>x.from.localeCompare(Y.from)),fe=Ma(m,_),he=p==="sections"?Va(_):[],ve=qs(m,_),ge=Yn(m),De=Ds.some(x=>ge[x].length>0),ke=ot(p)?ge[p]:[],Ce=Gs(_,"loaders"),Pe=Gs(_,"actions");if(!Ga(m,_)&&!De&&Ce===0&&Pe===0)return s.jsx(tt,{icon:Bt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Te={pages:j.length,sections:fe.length,apps:M.length,loaders:Ce,actions:Pe,redirects:V.length,posts:ge.posts.length,authors:ge.authors.length,categories:ge.categories.length},Ae=new Set(j.map(x=>Ot(x.path))),be=new Set(j.map(x=>x.name)),Le=new Set(fe.map(x=>x.name)),Ie=async x=>{const Y=m[x.key];if(!Y)return;const de=Fn(m,x.key),pe=Ua(m,x.key,Math.max(0,de-1)),Ne=Ha(Y.sections,pe);if(Ne)try{await O.mutateAsync({blockKey:x.key,data:{...Y,sections:Ne}}),me.success(`Variant added to "${x.name}"`),v({collection:"pages",key:x.key,path:x.path})}catch($e){me.error($e instanceof Error?$e.message:"Could not add variant")}},H=()=>{te(void 0),X({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},xe=x=>{te(void 0),X({mode:"duplicate",sourceKey:x.key,initialName:Xs(be,x.name),initialPath:Ll(Ae,x.path)})},we=x=>{te(void 0),X({mode:"rename",sourceKey:x.key,initialName:x.name,initialPath:x.path})},Re=async x=>{if(!U)return;const{mode:Y,sourceKey:de}=U;try{if(Y==="create"){let pe;if(x.templateKey){const $e=m[x.templateKey];if(!$e)throw new Error("Selected template no longer exists.");pe={...$e,name:x.name,path:x.path}}else pe=Rl(x.name,x.path);const Ne=Il(m,x.name);await O.mutateAsync({blockKey:Ne,data:pe}),me.success(`Created "${x.name}"`),v({collection:"pages",key:Ne,path:x.path})}else if(Y==="duplicate"&&de){const pe=m[de];if(!pe)throw new Error("Source page not found");const{key:Ne,data:$e}=Ol({source:pe,pages:j,newName:x.name,newPath:x.path});await O.mutateAsync({blockKey:Ne,data:$e}),me.success(`Duplicated as "${x.name}"`),v({collection:"pages",key:Ne,path:x.path})}else if(Y==="rename"&&de){const pe=m[de];if(!pe)throw new Error("Page not found");const Ne={...pe,name:x.name,path:x.path};await O.mutateAsync({blockKey:de,data:Ne}),me.success("Page updated"),g?.collection==="pages"&&g.key===de&&v({collection:"pages",key:de,path:x.path})}X(null)}catch(pe){te(pe instanceof Error?pe.message:"Save failed")}},ls=({path:x})=>{if(!U)return null;const Y=Ot(x);return(U.mode==="rename"?Ot(U.initialPath):null)!==Y&&Ae.has(Y)?`A page with path "${x}" already exists.`:null},is=async(x,Y,de)=>{await O.mutateAsync({blockKey:Y,data:{...de,name:Y,__resolveType:x}}),me.success(r("sandbox.contentBrowser.createdSection",{name:Y})),v({collection:"sections",key:Y})},rs=$n((x,Y)=>O.mutate({blockKey:x,data:Y})),cs=async x=>{const Y=m[x.key];if(!Y){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}const de=$l(m,x.key),pe=Xs(Le,x.name),Ne={...Y,name:pe};try{await O.mutateAsync({blockKey:de,data:Ne}),me.success(r("sandbox.contentBrowser.duplicatedSection",{name:x.name})),v({collection:"sections",key:de})}catch($e){me.error($e instanceof Error?$e.message:r("sandbox.contentBrowser.duplicateFailed"))}},ds=async x=>{if(!oe)return;const Y=m[oe];if(!Y){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}try{await O.mutateAsync({blockKey:oe,data:{...Y,name:x}}),me.success(r("sandbox.contentBrowser.sectionRenamed")),P(null)}catch(de){me.error(de instanceof Error?de.message:r("sandbox.contentBrowser.renameFailed"))}},Et=()=>{le(void 0),Z(!0)},us=async x=>{const Y=qa(m,x.from),de=Wa(x);try{await O.mutateAsync({blockKey:Y,data:de}),me.success("Created redirect"),Z(!1),v({collection:"redirects",key:Y})}catch(pe){le(pe instanceof Error?pe.message:"Could not create redirect")}},ms=async x=>{const Y=bs(m,x),de=mt(Y,x,ao(x));try{await O.mutateAsync({blockKey:Y,data:de}),me.success(`Created ${Pt[x]}`),v({collection:x,key:Y})}catch(pe){me.error(pe instanceof Error?pe.message:"Could not create")}},C=async x=>{const Y=bs(m,"posts"),de=mt(Y,"posts",Di(x));try{await O.mutateAsync({blockKey:Y,data:de}),me.success(r("sandbox.postCalendar.createdScheduledPost")),b("posts"),F("posts"),v({collection:"posts",key:Y}),k(null)}catch(pe){me.error(pe instanceof Error?pe.message:r("sandbox.postCalendar.couldNotCreate"))}},J=async(x,Y)=>{const de=m[x],pe=de?Li(ct(de,"posts"),Y):null;if(!pe){me.error(r("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await O.mutateAsync({blockKey:x,data:mt(x,"posts",pe)})}catch(Ne){me.error(Ne instanceof Error?Ne.message:r("sandbox.postCalendar.couldNotReschedule"))}},_e=async x=>{const Y=m[x.key];if(!Y){me.error("Record not found.");return}const de=bs(m,x.kind),pe=x.kind==="posts"?"title":"name",Ne={...structuredClone(ct(Y,x.kind)),[pe]:`${x.label} (copy)`};if(x.kind==="categories"){const $e=ge.categories.map(Dt=>Dt.slug??"").filter(Boolean);Ne.slug=_i(String(Ne.slug??""),$e)}try{await O.mutateAsync({blockKey:de,data:mt(de,x.kind,Ne)}),me.success(`Duplicated "${x.label}"`),v({collection:x.kind,key:de})}catch($e){me.error($e instanceof Error?$e.message:"Duplicate failed")}},Ve=()=>{b("posts"),F("posts"),v(null),k(null),w("")},Be=async()=>{if(q)try{const{kind:x,key:Y,label:de}=q;if(x==="blog"){if(q.blogKind==="categories"){const pe=ct(m[Y],"categories").slug,Ne=typeof pe=="string"?pe:"";if(Ne)for(const{key:$e,payload:Dt}of oo(m)){const Is=ri(Dt,Ne);Is!==Dt&&await O.mutateAsync({blockKey:$e,data:oi($e,ci(Is))})}}await I.mutateAsync({blockKey:Y})}else await I.mutateAsync({blockKey:Y});me.success(`Deleted "${de}"`),g&&g.collection!=="available-section"&&g.key===Y&&v(null),ne(null)}catch(x){me.error(x instanceof Error?x.message:"Delete failed")}},nt=I.isPending||O.isPending,yt=q?.kind==="blog"?Pt[q.blogKind]:q?.kind??"item";return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx(_l,{active:p,counts:Te,showBlog:De,onSelect:x=>{b(x),v(null),k(null)}}),p!=="seo"&&p!=="site"&&p!=="context"&&p!=="calendar"&&p!=="post-schedule"&&p!=="posts"&&p!=="loaders"&&p!=="actions"&&s.jsx(ic,{activeCollection:p,pages:j,redirects:V,sections:fe,availableSections:he,appCatalog:M,appCatalogLoading:W,blogEntries:ke,decofile:m,searchQuery:E,onSearchChange:w,selection:g,onSelect:L,onCreate:()=>{p==="pages"?H():p==="redirects"?Et():ot(p)&&ms(p)},onDuplicatePage:xe,onRenamePage:we,onAddPageVariant:Ie,onDeletePage:x=>ne({kind:"page",key:x.key,label:x.name}),onEditPageSeo:x=>{const Y={collection:"pages",key:x.key,path:x.path};v(Y),k(x.key)},onViewPageJson:x=>ce(x.key),onDuplicateSection:cs,onRenameSection:x=>P(x.key),onDeleteSection:x=>ne({kind:"section",key:x.key,label:x.name}),onDeleteRedirect:x=>ne({kind:"redirect",key:x.key,label:x.from||x.key}),onDuplicateBlog:_e,onDeleteBlog:x=>ne({kind:"blog",blogKind:x.kind,key:x.key,label:x.label})}),s.jsx("div",{className:"flex-1 min-w-0",children:p==="loaders"||p==="actions"?s.jsx(Br,{orgSlug:n,virtualMcpId:e,branch:t,previewUrl:o,meta:_,decofile:m,kind:p}):s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(at,{className:"size-5 text-muted-foreground"})}),children:p==="calendar"?s.jsx(tc,{decofile:m}):p==="post-schedule"?s.jsx(sc,{decofile:m,isCreating:O.isPending,onCreate:x=>{C(x)},onReschedule:(x,Y)=>{J(x,Y)},onSelect:x=>{b("posts"),F("posts"),v({collection:"posts",key:x}),k(null)}}):p==="site"?ve?s.jsx(xn,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:ve.key,block:m[ve.key],decofile:m,meta:_,title:"Site",excludeFields:["seo"],schemaPending:z(ve.resolveType,["seo"]),previewBaseUrl:o},`site:${ve.key}`):s.jsx(tt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):p==="context"?s.jsx(gl,{title:r("sandbox.blogContext.soonTitle"),description:r("sandbox.blogContext.soonDescription"),children:s.jsx(Jr,{orgSlug:n,virtualMcpId:e,branch:t,decofile:m,meta:_,onOpenPost:x=>{b("posts"),F("posts"),v({collection:"posts",key:x}),k(null)},onManageCategoryPosts:()=>{b("posts"),F("posts"),v(null),k(null)}})}):p==="seo"?s.jsx(ec,{orgSlug:n,virtualMcpId:e,branch:t,decofile:m,meta:_,target:{kind:"site"},previewBaseUrl:a}):p==="sections"?s.jsx(Gr,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:n,virtualMcpId:e,branch:t,previewUrl:o,meta:_,decofile:m,isCreating:O.isPending,onCreateAvailable:is,onSaveReferencedBlock:rs}):p==="posts"?s.jsx(vr,{orgSlug:n,virtualMcpId:e,branch:t,decofile:m,view:T,selectedKey:g?.collection==="posts"?g.key:null,onViewChange:x=>{R(x),v(null)},onClose:()=>v(null),onOpen:x=>{v({collection:"posts",key:x}),k(null)},move:D,meta:_,renderDetail:(x,Y)=>s.jsx(Yr,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:x,block:m[x],decofile:m,meta:_,previewBaseUrl:a,move:D,onClose:Y?.onClose,expanded:Y?.expanded,onToggleExpand:Y?.onToggleExpand},`post:${Tt(x)}`)}):g&&g.collection!=="available-section"?g.collection==="apps"?s.jsx(xn,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:g.key,block:m[g.key],decofile:m,meta:_,previewBaseUrl:o,schemaPending:z(typeof m[g.key]?.__resolveType=="string"?String(m[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="categories"?s.jsx(Xr,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:g.key,block:m[g.key],decofile:m,meta:_,onManagePosts:()=>Ve(),onOpenPost:x=>{b("posts"),F("posts"),v({collection:"posts",key:x}),k(null)},previewBaseUrl:a},`category:${g.key}`):g.collection==="authors"?s.jsx(Qr,{orgSlug:n,virtualMcpId:e,branch:t,kind:"authors",blockKey:g.key,block:m[g.key]},`authors:${g.key}`):g.collection==="redirects"?s.jsx(nc,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:g.key,block:m[g.key]},`redirect:${g.key}`):s.jsx(Zr,{orgSlug:n,virtualMcpId:e,branch:t,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&y===g.key,onExitSeo:()=>k(null),onSelectRoot:()=>{v(null),k(null)}},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):s.jsx(tt,{title:`Select ${ot(p)?`a ${Pt[p]}`:p==="pages"?"a page":p==="apps"?"an app":p==="redirects"?"a redirect":"a section"} to edit`,description:p==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),U&&s.jsx(Vl,{open:!!U,mode:U.mode,initialName:U.initialName,initialPath:U.initialPath,isPending:O.isPending,error:ee,templates:j,validate:ls,onSubmit:Re,onOpenChange:x=>{x||(X(null),te(void 0))}}),s.jsx(Ul,{open:re,isPending:O.isPending,error:ae,onSubmit:us,onOpenChange:x=>{x||(Z(!1),le(void 0))}}),oe&&s.jsx(Hl,{open:!!oe,blockKey:oe,initialName:fe.find(x=>x.key===oe)?.name??oe,isPending:O.isPending,onSubmit:ds,onOpenChange:x=>{x||P(null)}}),se&&s.jsx(Ya,{open:!!se,onOpenChange:x=>{x||ce(null)},pageKey:se,decofile:m,onSave:x=>O.mutateAsync({blockKey:se,data:x})}),s.jsx(Zo,{open:!!q,onOpenChange:x=>{!x&&!nt&&ne(null)},children:s.jsxs(ea,{children:[s.jsxs(ta,{children:[s.jsx(sa,{children:`Delete ${yt}?`}),s.jsx(na,{children:q?.kind==="section"?`"${q.label}" will be removed. Pages that still reference it will lose this section.`:q?`"${q.label}" will be removed permanently. This can't be undone.`:null})]}),s.jsxs(oa,{children:[s.jsx(aa,{disabled:nt,children:"Cancel"}),s.jsx(la,{onClick:x=>{x.preventDefault(),Be()},disabled:nt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:nt?s.jsxs(s.Fragment,{children:[s.jsx(at,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function ic(n){const e=ie.c(58),{activeCollection:t,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:c,appCatalogLoading:r,blogEntries:d,decofile:h,searchQuery:m,onSearchChange:f,selection:u,onSelect:p,onCreate:b,onDuplicatePage:g,onRenamePage:v,onAddPageVariant:y,onDeletePage:k,onEditPageSeo:S,onViewPageJson:N,onDuplicateSection:B,onRenameSection:E,onDeleteSection:w,onDeleteRedirect:T,onDuplicateBlog:R,onDeleteBlog:L}=n,G=je();let F,_,$,K,z,M;if(e[0]!==t||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==d||e[5]!==h||e[6]!==y||e[7]!==b||e[8]!==L||e[9]!==k||e[10]!==T||e[11]!==w||e[12]!==R||e[13]!==g||e[14]!==B||e[15]!==S||e[16]!==v||e[17]!==E||e[18]!==f||e[19]!==p||e[20]!==N||e[21]!==o||e[22]!==a||e[23]!==m||e[24]!==l||e[25]!==u||e[26]!==G){const D=m.toLowerCase(),U=o.filter(j=>!D||j.name.toLowerCase().includes(D)||j.path.toLowerCase().includes(D)),X=a.filter(j=>!D||j.from.toLowerCase().includes(D)||j.to.toLowerCase().includes(D)),ee=l.filter(j=>!D||j.name.toLowerCase().includes(D)||j.key.toLowerCase().includes(D)||j.resolveType.toLowerCase().includes(D)),te=i.filter(j=>!D||j.title.toLowerCase().includes(D)||j.resolveType.toLowerCase().includes(D)||(j.description?.toLowerCase().includes(D)??!1)),re=Wr(ee),Z=c.filter(j=>!D||j.title.toLowerCase().includes(D)||j.app.toLowerCase().includes(D)||j.vendor.toLowerCase().includes(D)||j.category.toLowerCase().includes(D)),ae=d.filter(j=>!D||j.label.toLowerCase().includes(D)||j.subtitle.toLowerCase().includes(D)),le=t==="categories"&&!D?Hr(ae):ae.map(cc),oe=`Search ${t}…`,P=ot(t)?`Create new ${Pt[t]}`:t==="redirects"?"Create new redirect":"Create new page",q=t!=="apps"&&t!=="sections";z="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let ne;e[33]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[33]=ne):ne=e[33];let se;e[34]!==f?(se=j=>f(j.target.value),e[34]=f,e[35]=se):se=e[35];let ce;e[36]!==oe||e[37]!==m||e[38]!==se?(ce=s.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[ne,s.jsx("input",{type:"text",value:m,onChange:se,placeholder:oe,"aria-label":oe,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[36]=oe,e[37]=m,e[38]=se,e[39]=ce):ce=e[39];let ue;e[40]!==P||e[41]!==b||e[42]!==q?(ue=q&&s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsx(Ee,{variant:"ghost",size:"icon",onClick:b,"aria-label":P,children:s.jsx(Ns,{size:14})})}),s.jsx(qe,{side:"bottom",children:P})]}),e[40]=P,e[41]=b,e[42]=q,e[43]=ue):ue=e[43],e[44]!==ce||e[45]!==ue?(M=s.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[ce,ue]}),e[44]=ce,e[45]=ue,e[46]=M):M=e[46],F=Jt,K="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",_="flex flex-col gap-1 p-1.5",$=t==="pages"?U.length===0?s.jsx(jt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(j=>{const V=u?.collection==="pages"&&u.key===j.key,fe=Fn(h,j.key);return s.jsx(Ue,{icon:Tn,title:j.name,subtitle:j.path,active:V,variantCount:fe,onClick:()=>p({collection:"pages",key:j.key,path:j.path}),menu:s.jsx($t,{onDuplicate:()=>g(j),onRename:()=>v(j),onAddVariant:()=>y(j),onEditSeo:()=>S(j),onViewJson:()=>N(j),onDelete:()=>k(j)})},j.key)}):t==="sections"?ee.length===0&&te.length===0?s.jsx(jt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):s.jsxs(s.Fragment,{children:[re.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(gn,{icon:zt,label:"Saved sections"}),re.map(j=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:j.label}),j.sections.map(V=>{const fe=u?.collection==="sections"&&u.key===V.key;return s.jsx(Ue,{icon:zt,accent:"global",title:V.name,subtitle:j.label,active:fe,onClick:()=>p({collection:"sections",key:V.key}),menu:s.jsx($t,{onDuplicate:()=>B(V),onRename:()=>E(V),onDelete:()=>w(V)})},V.key)})]},j.label))]}),te.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(gn,{icon:Ms,label:"Available sections",className:ye(re.length>0&&"mt-3")}),te.map(j=>{const V=u?.collection==="available-section"&&u.resolveType===j.resolveType,fe=j.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return s.jsx(Ue,{icon:Ms,title:j.title,subtitle:fe??j.resolveType,active:V,onClick:()=>p({collection:"available-section",resolveType:j.resolveType,title:j.title})},j.resolveType)})]})]}):t==="apps"?r?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(at,{className:"size-4.5 text-muted-foreground"})}):Z.length===0?s.jsx(jt,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):Z.map(j=>{const V=u?.collection==="apps"&&j.blockKey!==null&&u.key===j.blockKey;return s.jsx(Ue,{icon:En,logoUrl:j.logo,title:j.title,subtitle:j.category,active:V,trailing:j.installed?s.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!j.installed||!j.blockKey){me.message(`${j.title} is not installed on this site.`);return}p({collection:"apps",key:j.blockKey})}},j.id)}):t==="redirects"?X.length===0?s.jsx(jt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):X.map(j=>s.jsx(Ue,{icon:kn,title:j.from||"(no source)",subtitle:`→ ${j.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===j.key,trailing:s.jsx(ql,{type:j.type}),onClick:()=>p({collection:"redirects",key:j.key}),menu:s.jsx($t,{onDelete:()=>T(j)})},j.key)):ae.length===0?s.jsx(jt,{hasItems:d.length>0,emptyLabel:`No ${t} yet.`,emptyHint:`Click "+" to create your first ${ot(t)?Pt[t]:"item"}.`}):le.map(j=>{const{entry:V,depth:fe}=j,he=u?.collection===V.kind&&u.key===V.key;return s.jsx("div",{style:{paddingLeft:fe*16},children:s.jsx(Ue,{icon:V.kind==="posts"?_n:V.kind==="authors"?Dn:Sn,title:V.label,invalid:V.missing.length>0,invalidReason:V.missing.length>0?G("sandbox.itemRow.missingFields",{fields:V.missing.join(", ")}):void 0,warning:V.duplicateName,warningReason:G("sandbox.itemRow.duplicateName"),subtitle:fe>0?Po(V.slug??"",ae).map(rc).join(" / "):V.subtitle,active:he,onClick:()=>p({collection:V.kind,key:V.key}),menu:s.jsx($t,{onDuplicate:()=>R(V),onDelete:()=>L(V)})})},V.key)}),e[0]=t,e[1]=c,e[2]=r,e[3]=i,e[4]=d,e[5]=h,e[6]=y,e[7]=b,e[8]=L,e[9]=k,e[10]=T,e[11]=w,e[12]=R,e[13]=g,e[14]=B,e[15]=S,e[16]=v,e[17]=E,e[18]=f,e[19]=p,e[20]=N,e[21]=o,e[22]=a,e[23]=m,e[24]=l,e[25]=u,e[26]=G,e[27]=F,e[28]=_,e[29]=$,e[30]=K,e[31]=z,e[32]=M}else F=e[27],_=e[28],$=e[29],K=e[30],z=e[31],M=e[32];let W;e[47]!==_||e[48]!==$?(W=s.jsx("div",{className:_,children:$}),e[47]=_,e[48]=$,e[49]=W):W=e[49];let O;e[50]!==F||e[51]!==K||e[52]!==W?(O=s.jsx(F,{className:K,children:W}),e[50]=F,e[51]=K,e[52]=W,e[53]=O):O=e[53];let I;return e[54]!==z||e[55]!==M||e[56]!==O?(I=s.jsxs("div",{className:z,children:[M,O]}),e[54]=z,e[55]=M,e[56]=O,e[57]=I):I=e[57],I}function rc(n){return n.slug}function cc(n){return{entry:n,depth:0}}function dc(n){const e=ie.c(25),{virtualMcpId:t}=n,o=je(),[a,l]=A.useState(!1),i=ul(t),{activeTask:c}=jn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const d=vn(r);if(!(Qs(i?.metadata)||Qs(c?.metadata))){let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(Js,{className:"size-7 text-foreground"})}),e[1]=f):f=e[1];let u;e[2]!==o?(u=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==o?(p=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=p):p=e[5];let b,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=()=>l(!0),g=s.jsx(Js,{className:"size-4"}),e[6]=b,e[7]=g):(b=e[6],g=e[7]);let v;e[8]!==o?(v=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=v):v=e[9];let y;e[10]!==v?(y=s.jsxs(Ee,{onClick:b,children:[g,v]}),e[10]=v,e[11]=y):y=e[11];let k;e[12]!==u||e[13]!==p||e[14]!==y?(k=s.jsx(fl,{className:"h-full",image:f,title:u,description:p,actions:y}),e[12]=u,e[13]=p,e[14]=y,e[15]=k):k=e[15];let S;e[16]!==a?(S=s.jsx(pl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=S):S=e[17];let N;return e[18]!==S||e[19]!==k?(N=s.jsxs(s.Fragment,{children:[k,S]}),e[18]=S,e[19]=k,e[20]=N):N=e[20],N}let m;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(m=s.jsx(oc,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=m):m=e[24],m}function uc(){const n=ie.c(2),e=hl();let t;return n[0]!==e?(t=s.jsx(Ro,{tabId:"content",children:s.jsx(Fo,{feature:"cms",children:s.jsx(dc,{virtualMcpId:e})})}),n[0]=e,n[1]=t):t=n[1],t}const Dd=Object.freeze(Object.defineProperty({__proto__:null,default:uc},Symbol.toStringTag,{value:"Module"}));export{oo as $,Nd as A,Ls as B,Ke as C,ki as D,wd as E,Pd as F,dd as G,fd as H,Ii as I,Me as J,pd as K,md as L,uo as M,xt as N,Ni as O,As as P,ud as Q,Cd as R,bs as S,ao as T,Oi as U,ai as V,Bd as W,Hr as X,Co as Y,ii as Z,_i as _,oi as a,rd as a0,cd as a1,bd as a2,yd as a3,jd as a4,ut as a5,kd as a6,vd as a7,xd as a8,Sd as a9,Ht as aa,Dd as ab,ns as b,Se as c,id as d,ld as e,Ge as f,ct as g,hd as h,go as i,gd as j,Wt as k,Zn as l,ss as m,$l as n,Yn as o,bt as p,Ed as q,bl as r,ci as s,Td as t,bo as u,hi as v,_d as w,lo as x,mt as y,mo as z};
9
+ `)||void 0,count:T}),nt=Ni(ae.map(x=>x.title),Be.themes);if(nt.length===0){me.info(f("sandbox.postBoard.ideasFailed"));return}let yt=0;for(const x of nt){const Y=yi();try{await p.mutateAsync({blockKey:Y,data:vi(Y,{title:x.title,body:x.body,pillarKey:C?.key,createdAt:new Date().toISOString()})}),yt++}catch(de){console.warn("[posts] could not save a generated idea",de)}}if(yt===0){me.error(f("sandbox.postBoard.ideasFailed"));return}me.success(f("sandbox.postBoard.ideasAdded",{count:String(yt)}))}catch(J){me.error(J instanceof Error?J.message:f("sandbox.postBoard.ideasFailed"))}finally{S(!1)}};return s.jsxs("div",{className:"relative flex h-full min-w-0 flex-col",children:[s.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b px-6 py-3",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("div",{className:"flex items-center gap-0.5 rounded-lg border p-0.5",children:[s.jsx(hn,{active:a==="board",onClick:()=>i("board"),icon:s.jsx(Ho,{size:14}),label:f("sandbox.postBoard.viewBoard")}),s.jsx(hn,{active:a==="list",onClick:()=>i("list"),icon:s.jsx(Xo,{size:14}),label:f("sandbox.postBoard.viewList")})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[k&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground","aria-live":"polite",role:"status",children:[s.jsx(Ct,{size:12,className:"animate-spin"}),f("sandbox.postBoard.generatingLabel")]}),s.jsxs(rt,{open:N,onOpenChange:B,children:[s.jsx(tl,{asChild:!0,children:s.jsxs(Ee,{type:"button",variant:"outline",size:"sm",disabled:!0,children:[s.jsx(et,{size:14}),f("sandbox.postBoard.generateIdeas"),s.jsx(st,{variant:"secondary",children:f("common.soon")})]})}),s.jsxs(it,{className:"sm:max-w-lg",children:[s.jsxs(pt,{children:[s.jsx(lt,{children:f("sandbox.postBoard.generateIdeas")}),s.jsx(Mt,{children:f("sandbox.postBoard.ideaGuidanceLabel")})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Rt,{id:"idea-guidance",value:E,rows:6,autoFocus:!0,onChange:C=>w(C.target.value),placeholder:f("sandbox.postBoard.ideaGuidancePlaceholder"),className:"resize-none text-sm"}),le.length>0&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(ze,{className:"text-xs",children:f("sandbox.postBoard.ideaPillarLabel")}),s.jsx(wt,{options:le.map(C=>C.title),value:le.find(C=>C.key===L)?.title??"",emptyLabel:f("sandbox.postBoard.ideaNoPillar"),onChange:C=>G(le.find(J=>J.title===C)?.key??"")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ze,{htmlFor:"idea-count",className:"text-xs",children:f("sandbox.postBoard.ideaCount")}),s.jsx(Xe,{id:"idea-count",type:"number",min:1,max:8,value:T,onChange:C=>R(Math.max(1,Math.min(8,Number(C.target.value)||1))),className:"h-9 w-16"}),s.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:f("sandbox.postBoard.usesCredits")})]})]}),s.jsx(ht,{children:s.jsxs(Ee,{type:"button",onClick:()=>{B(!1),ms()},children:[s.jsx(et,{size:14}),f("sandbox.postBoard.generateIdeas")]})})]})]}),s.jsxs(Kt,{children:[s.jsx(Ft,{asChild:!0,children:s.jsxs(Ee,{type:"button",size:"sm",children:[s.jsx(Ns,{size:14}),f("sandbox.postBoard.newPost"),s.jsx(ft,{size:14})]})}),s.jsxs(It,{align:"end",className:"w-56",children:[s.jsxs(Qe,{disabled:!0,onClick:()=>{M(void 0),K(!0)},children:[s.jsx(et,{size:14}),s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[f("sandbox.postBoard.newPostGenerate"),s.jsx(st,{variant:"secondary",children:f("common.soon")})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:f("sandbox.postBoard.newPostGenerateHint")})]})]}),s.jsxs(Qe,{onClick:Et,children:[s.jsx(qo,{size:14}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:f("sandbox.postBoard.newPostWrite")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:f("sandbox.postBoard.newPostWriteHint")})]})]}),s.jsxs(Qe,{onClick:()=>O(!0),children:[s.jsx(gs,{size:14}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:f("sandbox.postBoard.importContent")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:f("sandbox.postBoard.importContentHint")})]})]})]})]}),s.jsx(Mi,{open:$,onOpenChange:K,decofile:o,hasAi:g,seed:z,onGenerate:C=>{re(C)}},z?.title??"scratch"),s.jsx(rt,{open:W,onOpenChange:O,children:s.jsxs(it,{className:"max-h-[85vh] sm:max-w-2xl",children:[s.jsxs(pt,{children:[s.jsx(lt,{children:f("sandbox.postBoard.importTitle")}),s.jsx(Mt,{children:f("sandbox.postBoard.importDescription")})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"h-72 overflow-hidden rounded-[var(--studio-control-radius,var(--radius-xl))] border bg-[var(--studio-input-background)]",children:s.jsx(Mn,{code:I,language:jo(I)?"html":"markdown",height:"100%",autoFocus:!0,onChange:C=>D(C??"")})}),s.jsx("input",{ref:U,type:"file",accept:".html,.htm,.md,.markdown,.txt",className:"hidden",onChange:async C=>{const J=C.target.files?.[0];J&&D(await J.text()),C.target.value=""}}),s.jsxs(Ee,{type:"button",variant:"outline",size:"sm",onClick:()=>U.current?.click(),children:[s.jsx(gs,{size:14}),f("sandbox.postBoard.importUpload")]})]}),s.jsx(ht,{children:s.jsxs(Ee,{type:"button",disabled:!I.trim(),onClick:us,children:[s.jsx(gs,{size:14}),f("sandbox.postBoard.importRun")]})})]})})]})]}),Z.length===0&&ae.length===0?s.jsx(cl,{className:"flex-1",icon:s.jsx(et,{size:22}),title:f("sandbox.postBoard.emptyTitle"),description:f("sandbox.postBoard.emptyDescription"),buttonProps:{children:f("sandbox.postBoard.newPost"),onClick:Et}}):a==="board"?s.jsxs("div",{className:"flex min-h-0 flex-1 gap-3 overflow-x-auto p-4",children:[s.jsx(wr,{ideas:ae,collapsed:X.includes(fn),pillarTitleOf:oe,onToggleCollapsed:()=>te(fn),onGenerate:rs,onDelete:cs}),s.jsx("div",{"aria-hidden":!0,className:"my-1 w-px shrink-0 self-stretch bg-border"}),As.map(C=>{const J=Z.filter(Be=>Be.status===C);yr(C)&&J.sort(br);const _e=f(Wt[C]),Ve=X.includes(C);return s.jsx("div",{onDragOver:Be=>{Be.preventDefault(),y(C)},onDragLeave:()=>y(Be=>Be===C?null:Be),onDrop:Be=>{Be.preventDefault(),ds(C,Be.dataTransfer.getData(No))},className:ye("flex shrink-0 flex-col rounded-xl border bg-muted/30 transition-colors",Ve?"w-11":"w-72",v===C&&"border-primary bg-primary/5"),children:Ve?s.jsxs("button",{type:"button",onClick:()=>te(C),"aria-label":f("sandbox.postBoard.expandLane",{lane:_e}),"aria-expanded":!1,className:"flex min-h-0 flex-1 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[s.jsx(_t,{size:14,className:"shrink-0"}),s.jsx("span",{className:"text-xs tabular-nums",children:J.length}),s.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:_e})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",children:[s.jsxs("button",{type:"button",onClick:()=>te(C),"aria-label":f("sandbox.postBoard.collapseLane",{lane:_e}),"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[s.jsx(ft,{size:14,className:"shrink-0"}),s.jsx("span",{className:"truncate",children:_e})]}),s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:J.length})]}),s.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 pb-2",children:J.length===0?s.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:f("sandbox.postBoard.laneEmpty")}):J.map(Be=>s.jsx(Sr,{post:Be,payload:P(Be.key),moving:d.isMoving(Be.key),onOpen:()=>c(Be.key),onArchive:Be.status==="archived"?void 0:()=>{ne(Be)}},Be.key))})]})},C)})]}):s.jsxs("div",{className:"flex min-h-0 flex-1",children:[s.jsxs("div",{className:"flex w-80 shrink-0 flex-col border-r",children:[s.jsx(dr,{value:ge,onChange:De}),we?s.jsx(gr,{count:ke.size,allSelected:xe.length>0&&xe.every(C=>ke.has(C.key)),onToggleSelectAll:ls,onArchive:()=>{is()},onExit:()=>Ce(new Set)}):s.jsx(ur,{categories:Le,authors:Ie,statusCounts:Pe,categoryFilter:se,authorFilter:ue,statusFilter:V,sort:he,onCategoryFilterChange:ce,onAuthorFilterChange:j,onStatusFilterChange:fe,onSortChange:ve}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:s.jsx(jr,{posts:xe,selectedKey:q,selectionActive:we,selectedKeys:ke,onToggleSelect:Re,onOpen:c,isMoving:d.isMoving,onArchive:C=>{ne(C)}})})]}),s.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:q&&m?s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:m(q)}):s.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:f("sandbox.postBoard.selectPrompt")})})]}),a==="board"&&l&&F&&m&&s.jsx("div",{className:"absolute inset-0 z-30 flex flex-col bg-background",children:m(l,{expanded:!0,onToggleExpand:()=>_(!1),onClose:()=>{_(!1),r?.()}})}),s.jsx(rt,{open:a==="board"&&!!l&&!F,onOpenChange:C=>{C||(_(!1),r?.())},children:s.jsxs(it,{closeButtonClassName:"hidden",className:"left-auto right-4 top-4 bottom-4 flex h-auto translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden p-0 sm:max-w-3xl",children:[s.jsx(lt,{className:"sr-only",children:f("sandbox.collectionsSidebar.posts")}),l&&m?s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:m(l,{expanded:!1,onToggleExpand:()=>_(!0),onClose:()=>r?.()})}):null]})})]})}function hn(n){const e=ie.c(7),{active:t,onClick:o,icon:a,label:l}=n,i=t?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground";let c;e[0]!==i?(c=ye("inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",i),e[0]=i,e[1]=c):c=e[1];let r;return e[2]!==a||e[3]!==l||e[4]!==o||e[5]!==c?(r=s.jsxs("button",{type:"button",onClick:o,className:c,children:[a,l]}),e[2]=a,e[3]=l,e[4]=o,e[5]=c,e[6]=r):r=e[6],r}function jr(n){const e=ie.c(23),{posts:t,selectedKey:o,selectionActive:a,selectedKeys:l,onToggleSelect:i,onOpen:c,isMoving:r,onArchive:d}=n,h=je();if(t.length===0){let u;e[0]!==h?(u=h("sandbox.postList.noMatches"),e[0]=h,e[1]=u):u=e[1];let p;return e[2]!==u?(p=s.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=p):p=e[3],p}let m;if(e[4]!==r||e[5]!==d||e[6]!==c||e[7]!==i||e[8]!==t||e[9]!==o||e[10]!==l||e[11]!==a){let u;e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==i||e[17]!==o||e[18]!==l||e[19]!==a?(u=p=>s.jsx(kr,{post:p,selected:p.key===o,selectionActive:a,checked:l.has(p.key),onToggleSelect:()=>i(p.key),moving:r(p.key),onOpen:()=>c(p.key),onArchive:p.status==="archived"?void 0:()=>d(p)},p.key),e[13]=r,e[14]=d,e[15]=c,e[16]=i,e[17]=o,e[18]=l,e[19]=a,e[20]=u):u=e[20],m=t.map(u),e[4]=r,e[5]=d,e[6]=c,e[7]=i,e[8]=t,e[9]=o,e[10]=l,e[11]=a,e[12]=m}else m=e[12];let f;return e[21]!==m?(f=s.jsx("ul",{className:"divide-y",children:m}),e[21]=m,e[22]=f):f=e[22],f}function kr(n){const e=ie.c(60),{post:t,selected:o,selectionActive:a,checked:l,onToggleSelect:i,moving:c,onOpen:r,onArchive:d}=n,h=je(),m=t.status==="awaiting_review"&&t.missing.length>0,f=t.status==="scheduled"||t.status==="published",u=a||l?"opacity-100":"opacity-0 focus-within:opacity-100 group-hover/row:opacity-100";let p;e[0]!==u?(p=ye("absolute left-3 top-3 z-10 transition-opacity",u),e[0]=u,e[1]=p):p=e[1];let b;e[2]!==i?(b=()=>i(),e[2]=i,e[3]=b):b=e[3];let g;e[4]!==t.title||e[5]!==h?(g=t.title||h("sandbox.postBoard.untitled"),e[4]=t.title,e[5]=h,e[6]=g):g=e[6];let v;e[7]!==l||e[8]!==b||e[9]!==g?(v=s.jsx(Zt,{checked:l,onCheckedChange:b,"aria-label":g}),e[7]=l,e[8]=b,e[9]=g,e[10]=v):v=e[10];let y;e[11]!==p||e[12]!==v?(y=s.jsx("span",{className:p,children:v}),e[11]=p,e[12]=v,e[13]=y):y=e[13];let k;e[14]!==c||e[15]!==d||e[16]!==a?(k=d&&!a&&s.jsx(Fs,{onArchive:d,disabled:c,className:"top-2.5"}),e[14]=c,e[15]=d,e[16]=a,e[17]=k):k=e[17];let S;e[18]!==r||e[19]!==i||e[20]!==a?(S=()=>a?i():r(),e[18]=r,e[19]=i,e[20]=a,e[21]=S):S=e[21];const N=o?"bg-accent text-accent-foreground":"bg-card hover:bg-muted/50";let B;e[22]!==N?(B=ye("flex w-full cursor-pointer flex-col gap-1.5 py-2.5 pl-10 pr-3 text-left text-sm transition-colors",N),e[22]=N,e[23]=B):B=e[23];let E;e[24]!==t.title||e[25]!==h?(E=t.title||h("sandbox.postBoard.untitled"),e[24]=t.title,e[25]=h,e[26]=E):E=e[26];let w;e[27]!==E?(w=s.jsx("span",{className:"min-w-0 truncate pr-6 font-medium",children:E}),e[27]=E,e[28]=w):w=e[28];const T=xr[t.status],R=Wt[t.status];let L;e[29]!==h||e[30]!==R?(L=h(R),e[29]=h,e[30]=R,e[31]=L):L=e[31];let G;e[32]!==T||e[33]!==L?(G=s.jsx(st,{variant:T,className:"shrink-0",children:L}),e[32]=T,e[33]=L,e[34]=G):G=e[34];let F;e[35]!==m||e[36]!==t.missing?(F=m&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[s.jsx(Bt,{size:12}),t.missing.length]}),e[35]=m,e[36]=t.missing,e[37]=F):F=e[37];let _;e[38]!==t.duplicateTitle||e[39]!==h?(_=t.duplicateTitle&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",title:h("sandbox.postBoard.duplicateTitle"),children:[s.jsx(_s,{size:12,"aria-hidden":!0}),s.jsx("span",{className:"sr-only",children:h("sandbox.postBoard.duplicateTitle")})]}),e[38]=t.duplicateTitle,e[39]=h,e[40]=_):_=e[40];let $;e[41]!==f||e[42]!==t.date||e[43]!==t.scheduledDatetime?($=f&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[s.jsx(Ss,{size:12}),(t.scheduledDatetime||t.date||"").slice(0,10)]}),e[41]=f,e[42]=t.date,e[43]=t.scheduledDatetime,e[44]=$):$=e[44];let K;e[45]!==G||e[46]!==F||e[47]!==_||e[48]!==$?(K=s.jsxs("div",{className:"flex items-center gap-2",children:[G,F,_,$]}),e[45]=G,e[46]=F,e[47]=_,e[48]=$,e[49]=K):K=e[49];let z;e[50]!==o||e[51]!==B||e[52]!==w||e[53]!==K||e[54]!==S?(z=s.jsxs("button",{type:"button",onClick:S,"aria-current":o,className:B,children:[w,K]}),e[50]=o,e[51]=B,e[52]=w,e[53]=K,e[54]=S,e[55]=z):z=e[55];let M;return e[56]!==z||e[57]!==y||e[58]!==k?(M=s.jsxs("li",{className:"group/row relative",children:[y,k,z]}),e[56]=z,e[57]=y,e[58]=k,e[59]=M):M=e[59],M}function Sr(n){const e=ie.c(50),{post:t,payload:o,moving:a,onOpen:l,onArchive:i}=n,c=je(),r=t.status!=="generating"&&!a;let d;e[0]!==o?(d=ni(o),e[0]=o,e[1]=d):d=e[1];const h=d,m=!r&&"opacity-80";let f;e[2]!==m?(f=ye("group/card relative rounded-lg border bg-card shadow-sm transition-colors hover:border-primary/40",m),e[2]=m,e[3]=f):f=e[3];let u;e[4]!==a||e[5]!==i?(u=i&&s.jsx(Fs,{onArchive:i,disabled:a,className:"top-2"}),e[4]=a,e[5]=i,e[6]=u):u=e[6];let p;e[7]!==t.key?(p=L=>L.dataTransfer.setData(No,t.key),e[7]=t.key,e[8]=p):p=e[8];const b=r?"cursor-grab active:cursor-grabbing":"cursor-pointer";let g;e[9]!==b?(g=ye("block w-full p-3 text-left",b),e[9]=b,e[10]=g):g=e[10];let v;e[11]!==t.title||e[12]!==c?(v=t.title||c("sandbox.postBoard.untitled"),e[11]=t.title,e[12]=c,e[13]=v):v=e[13];let y;e[14]!==v?(y=s.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:v}),e[14]=v,e[15]=y):y=e[15];let k;e[16]!==h||e[17]!==t.status?(k=t.status==="draft"&&s.jsxs(s.Fragment,{children:[h.pillarTitle&&s.jsx(st,{variant:"secondary",className:"max-w-full truncate",children:h.pillarTitle}),h.format?.name&&s.jsx(st,{variant:"outline",className:"max-w-full truncate",children:h.format.name})]}),e[16]=h,e[17]=t.status,e[18]=k):k=e[18];let S;e[19]!==t.status||e[20]!==c?(S=t.status==="generating"&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(Ct,{size:12,className:"animate-spin"}),c("sandbox.postBoard.generatingLabel")]}),e[19]=t.status,e[20]=c,e[21]=S):S=e[21];let N;e[22]!==t.missing||e[23]!==t.status||e[24]!==c?(N=t.status==="awaiting_review"&&(t.missing.length>0?s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[s.jsx(Bt,{size:12}),c("sandbox.postBoard.nIssues",{count:String(t.missing.length)})]}):s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-success",children:[s.jsx(rl,{size:12}),c("sandbox.postBoard.readyToSchedule")]})),e[22]=t.missing,e[23]=t.status,e[24]=c,e[25]=N):N=e[25];let B;e[26]!==t.date||e[27]!==t.scheduledDatetime||e[28]!==t.status?(B=(t.status==="scheduled"||t.status==="published")&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ss,{size:12}),(t.scheduledDatetime||t.date||"").slice(0,10)]}),e[26]=t.date,e[27]=t.scheduledDatetime,e[28]=t.status,e[29]=B):B=e[29];let E;e[30]!==t.duplicateTitle||e[31]!==c?(E=t.duplicateTitle&&s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-warning",children:[s.jsx(_s,{size:12,"aria-hidden":!0}),c("sandbox.postBoard.duplicateTitle")]}),e[30]=t.duplicateTitle,e[31]=c,e[32]=E):E=e[32];let w;e[33]!==k||e[34]!==S||e[35]!==N||e[36]!==B||e[37]!==E?(w=s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[k,S,N,B,E]}),e[33]=k,e[34]=S,e[35]=N,e[36]=B,e[37]=E,e[38]=w):w=e[38];let T;e[39]!==r||e[40]!==l||e[41]!==w||e[42]!==p||e[43]!==g||e[44]!==y?(T=s.jsxs("button",{type:"button",draggable:r,onDragStart:p,onClick:l,className:g,children:[y,w]}),e[39]=r,e[40]=l,e[41]=w,e[42]=p,e[43]=g,e[44]=y,e[45]=T):T=e[45];let R;return e[46]!==T||e[47]!==f||e[48]!==u?(R=s.jsxs("div",{className:f,children:[u,T]}),e[46]=T,e[47]=f,e[48]=u,e[49]=R):R=e[49],R}function wr(n){const e=ie.c(40),{ideas:t,collapsed:o,pillarTitleOf:a,onToggleCollapsed:l,onGenerate:i,onDelete:c}=n,r=je();let d,h,m,f,u,p,b;if(e[0]!==o||e[1]!==t.length||e[2]!==l||e[3]!==r){b=Symbol.for("react.early_return_sentinel");e:{if(d=r("sandbox.postBoard.ideasTray"),o){let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(_t,{size:14,className:"shrink-0"}),e[11]=w):w=e[11];let T;e[12]!==t.length?(T=s.jsx("span",{className:"text-xs tabular-nums",children:t.length}),e[12]=t.length,e[13]=T):T=e[13],b=s.jsxs("button",{type:"button",onClick:l,"aria-label":r("sandbox.postBoard.expandLane",{lane:d}),"aria-expanded":!1,className:"flex w-11 shrink-0 cursor-pointer flex-col items-center gap-2 py-2.5 text-muted-foreground hover:text-foreground",children:[w,T,s.jsx("span",{className:"[writing-mode:vertical-rl] text-sm font-medium",children:d})]});break e}p="flex w-72 shrink-0 flex-col",u="flex items-center justify-between gap-2 px-3 py-2.5 text-sm font-medium",h="button",m=l,f=r("sandbox.postBoard.collapseLane",{lane:d})}e[0]=o,e[1]=t.length,e[2]=l,e[3]=r,e[4]=d,e[5]=h,e[6]=m,e[7]=f,e[8]=u,e[9]=p,e[10]=b}else d=e[4],h=e[5],m=e[6],f=e[7],u=e[8],p=e[9],b=e[10];if(b!==Symbol.for("react.early_return_sentinel"))return b;let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ft,{size:14,className:"shrink-0"}),e[14]=g):g=e[14];let v;e[15]!==d?(v=s.jsx("span",{className:"truncate",children:d}),e[15]=d,e[16]=v):v=e[16];let y;e[17]!==h||e[18]!==m||e[19]!==f||e[20]!==v?(y=s.jsxs("button",{type:h,onClick:m,"aria-label":f,"aria-expanded":!0,className:"flex min-w-0 cursor-pointer items-center gap-1.5 text-left hover:text-muted-foreground",children:[g,v]}),e[17]=h,e[18]=m,e[19]=f,e[20]=v,e[21]=y):y=e[21];let k;e[22]!==t.length?(k=s.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:t.length}),e[22]=t.length,e[23]=k):k=e[23];let S;e[24]!==k||e[25]!==u||e[26]!==y?(S=s.jsxs("div",{className:u,children:[y,k]}),e[24]=k,e[25]=u,e[26]=y,e[27]=S):S=e[27];let N;e[28]!==t||e[29]!==c||e[30]!==i||e[31]!==a||e[32]!==r?(N=t.length===0?s.jsx("p",{className:"px-1 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.postBoard.ideasEmpty")}):t.map(w=>{const T=a(w.pillarKey);return s.jsxs("div",{className:"group/card relative rounded-lg border border-dashed bg-card shadow-sm transition-colors hover:border-primary/40",children:[s.jsx(Fs,{label:r("sandbox.postBoard.deleteIdea"),onArchive:()=>c(w),className:"top-2"}),s.jsxs("div",{className:"p-3",children:[s.jsx("p",{className:"line-clamp-2 pr-6 text-sm font-medium",children:w.title||r("sandbox.postBoard.untitledIdea")}),w.body&&s.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:w.body}),T&&s.jsx(st,{variant:"secondary",className:"mt-2 max-w-full truncate",children:T})]}),s.jsx("div",{className:"border-t px-3 py-2",children:s.jsxs(Ee,{type:"button",variant:"ghost",size:"sm",disabled:!0,className:"h-7 w-full justify-start px-1.5 text-xs",onClick:()=>i(w),children:[s.jsx(et,{size:13}),r("sandbox.postBoard.writeFromIdea"),s.jsx(st,{variant:"secondary",className:"ml-auto",children:r("common.soon")})]})})]},w.key)}),e[28]=t,e[29]=c,e[30]=i,e[31]=a,e[32]=r,e[33]=N):N=e[33];let B;e[34]!==N?(B=s.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto pb-2 pr-1",children:N}),e[34]=N,e[35]=B):B=e[35];let E;return e[36]!==S||e[37]!==B||e[38]!==p?(E=s.jsxs("div",{className:p,children:[S,B]}),e[36]=S,e[37]=B,e[38]=p,e[39]=E):E=e[39],E}function Fs(n){const e=ie.c(13),{label:t,onArchive:o,disabled:a,className:l}=n,i=je();let c;e[0]!==t||e[1]!==i?(c=t??i("sandbox.postBoard.delete"),e[0]=t,e[1]=i,e[2]=c):c=e[2];const r=c;let d;e[3]!==o?(d=u=>{u.stopPropagation(),o()},e[3]=o,e[4]=d):d=e[4];let h;e[5]!==l?(h=ye("absolute right-2 z-10 flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-destructive focus-visible:opacity-100 group-hover/card:opacity-100 group-hover/row:opacity-100",l),e[5]=l,e[6]=h):h=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Bs,{size:13}),e[7]=m):m=e[7];let f;return e[8]!==a||e[9]!==d||e[10]!==h||e[11]!==r?(f=s.jsx("button",{type:"button",disabled:a,"aria-label":r,title:r,onClick:d,className:h,children:m}),e[8]=a,e[9]=d,e[10]=h,e[11]=r,e[12]=f):f=e[12],f}function Ue(n){const e=ie.c(54),{icon:t,logoUrl:o,title:a,subtitle:l,active:i,accent:c,variantCount:r,trailing:d,selectable:h,selectionActive:m,selected:f,invalid:u,invalidReason:p,warning:b,warningReason:g,onToggleSelect:v,onClick:y,menu:k}=n,S=je(),N=c==="global";let B;e[0]!==t||e[1]!==i||e[2]!==N||e[3]!==o?(B=o?s.jsx("img",{src:o,alt:"",className:"size-8 shrink-0 rounded-lg object-cover bg-muted"}):s.jsx("span",{className:ye("flex size-8 shrink-0 items-center justify-center rounded-lg",N?"bg-global-section/15":"bg-muted"),children:s.jsx(t,{size:16,className:ye("shrink-0",!N&&(i?"text-accent-foreground":"text-muted-foreground")),style:N?{color:Ts}:void 0})}),e[0]=t,e[1]=i,e[2]=N,e[3]=o,e[4]=B):B=e[4];const E=B,w=i?N?"bg-global-section/15 text-global-section-fg dark:text-global-section-fg-dark":"bg-accent text-accent-foreground":N?"hover:bg-global-section/10":"hover:bg-muted";let T;e[5]!==w?(T=ye("group relative flex min-w-0 items-center rounded-md transition-colors",w),e[5]=w,e[6]=T):T=e[6];let R;e[7]!==v||e[8]!==h||e[9]!==f||e[10]!==m||e[11]!==S||e[12]!==a?(R=h&&s.jsx("span",{className:ye("flex shrink-0 items-center pl-2.5 transition-opacity",f||m?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),onClick:Nr,children:s.jsx(Zt,{checked:f,onCheckedChange:()=>v?.(),"aria-label":S("sandbox.itemRow.selectItem",{title:a})})}),e[7]=v,e[8]=h,e[9]=f,e[10]=m,e[11]=S,e[12]=a,e[13]=R):R=e[13];const L=u&&!i&&"text-destructive";let G;e[14]!==L?(G=ye("block truncate text-sm font-medium",L),e[14]=L,e[15]=G):G=e[15];let F;e[16]!==G||e[17]!==a?(F=s.jsx("span",{className:G,children:a}),e[16]=G,e[17]=a,e[18]=F):F=e[18];const _=i?"text-accent-foreground/70":"text-muted-foreground";let $;e[19]!==_?($=ye("block truncate text-xs",_),e[19]=_,e[20]=$):$=e[20];let K;e[21]!==l||e[22]!==$?(K=s.jsx("span",{className:$,children:l}),e[21]=l,e[22]=$,e[23]=K):K=e[23];let z;e[24]!==K||e[25]!==F?(z=s.jsxs("span",{className:"min-w-0 flex-1",children:[F,K]}),e[24]=K,e[25]=F,e[26]=z):z=e[26];let M;e[27]!==i||e[28]!==S||e[29]!==r?(M=r!==void 0&&r>1&&s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsxs("span",{className:ye("flex shrink-0 items-center gap-1 text-xs font-medium",i?"text-accent-foreground/70":"text-muted-foreground"),children:[s.jsx(Cn,{size:14}),r]})}),s.jsx(qe,{side:"bottom",children:S("sandbox.itemRow.variantCount",{count:r})})]}),e[27]=i,e[28]=S,e[29]=r,e[30]=M):M=e[30];let W;e[31]!==b||e[32]!==g?(W=b&&s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsx("span",{className:"flex shrink-0 items-center text-warning",children:s.jsx(Bt,{size:14})})}),g&&s.jsx(qe,{side:"bottom",children:g})]}),e[31]=b,e[32]=g,e[33]=W):W=e[33];let O;e[34]!==i||e[35]!==u||e[36]!==p?(O=u&&s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsx("span",{className:ye("flex shrink-0 items-center",i?"text-accent-foreground":"text-destructive"),children:s.jsx(Bt,{size:14})})}),p&&s.jsx(qe,{side:"bottom",children:p})]}),e[34]=i,e[35]=u,e[36]=p,e[37]=O):O=e[37];let I;e[38]!==y||e[39]!==E||e[40]!==z||e[41]!==M||e[42]!==W||e[43]!==O||e[44]!==d?(I=s.jsxs("button",{type:"button",onClick:y,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left cursor-pointer",children:[E,z,M,W,O,d]}),e[38]=y,e[39]=E,e[40]=z,e[41]=M,e[42]=W,e[43]=O,e[44]=d,e[45]=I):I=e[45];let D;e[46]!==i||e[47]!==k?(D=k&&s.jsx("div",{className:ye("pr-1 opacity-0 transition-opacity group-hover:opacity-100",i&&"opacity-100"),children:k}),e[46]=i,e[47]=k,e[48]=D):D=e[48];let U;return e[49]!==I||e[50]!==D||e[51]!==T||e[52]!==R?(U=s.jsxs("div",{className:T,children:[R,I,D]}),e[49]=I,e[50]=D,e[51]=T,e[52]=R,e[53]=U):U=e[53],U}function Nr(n){return n.stopPropagation()}function tt(n){const e=ie.c(10),{icon:t,title:o,description:a}=n;let l;e[0]!==t?(l=t&&s.jsx(t,{size:24,className:"text-muted-foreground/60"}),e[0]=t,e[1]=l):l=e[1];let i;e[2]!==o?(i=s.jsx("div",{children:o}),e[2]=o,e[3]=i):i=e[3];let c;e[4]!==a?(c=a&&s.jsx("div",{className:"text-xs text-muted-foreground/80 max-w-sm",children:a}),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==l||e[7]!==i||e[8]!==c?(r=s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 p-6 text-center text-sm text-muted-foreground",children:[l,i,c]}),e[6]=l,e[7]=i,e[8]=c,e[9]=r):r=e[9],r}const Cr={loaders:Nn,actions:Bn},Pr={loaders:"Loaders",actions:"Actions"},Tr={analytics:Qo,blog:Kn,commerce:Yo,site:Wo,website:zt};function _r(n,e){return e===0?Tr[n.toLowerCase()]??zs:zs}function Lt(n,e){return e===0?xa(n):n}function Br(n){const e=ie.c(98),{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r}=n,d=je();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[m,f]=A.useState(h),[u,p]=A.useState(null),[b,g]=A.useState(""),[v,y]=A.useState(Fr),[k,S]=A.useState(r);k!==r&&(S(r),f([]),p(null),g(""),y(new Set));let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=X=>{y(ee=>{const te=new Set(ee);return te.has(X)?te.delete(X):te.add(X),te})},e[1]=N):N=e[1];const B=N;let E;e[2]!==a||e[3]!==t||e[4]!==o?(E={orgSlug:t,virtualMcpId:o,branch:a},e[2]=a,e[3]=t,e[4]=o,e[5]=E):E=e[5];const w=Xt(E);let T;e[6]!==w?(T=$n((X,ee)=>w.mutate({blockKey:X,data:ee})),e[6]=w,e[7]=T):T=e[7];const R=T;let L;e[8]!==r?(L=ba(r),e[8]=r,e[9]=L):L=e[9];const G=L,F=Cr[r];let _,$,K,z,M,W,O;if(e[10]!==F||e[11]!==a||e[12]!==c||e[13]!==r||e[14]!==i||e[15]!==v||e[16]!==t||e[17]!==m||e[18]!==l||e[19]!==w||e[20]!==R||e[21]!==b||e[22]!==u||e[23]!==G||e[24]!==d||e[25]!==o){K=Symbol.for("react.early_return_sentinel");e:{const X=[...fa(i,c,r).map(Rr),...pa(i,r).map(Or)],ee=b.trim().toLowerCase(),te=ee.length>0,re=te?X.filter(H=>H.title.toLowerCase().includes(ee)||H.resolveType.toLowerCase().includes(ee)):[],Z=new Map,ae=[],le=new Map;if(!te){for(const H of X){const xe=H.folderPath;if(!(xe.length<m.length)&&m.every((we,Re)=>xe[Re]===we))if(xe.length===m.length)if(H.savedKey!==void 0){const we=le.get(H.resolveType);we?we.push(H):le.set(H.resolveType,[H])}else ae.push(H);else{const we=xe[m.length],Re=Z.get(we)??{count:0,savedCount:0};H.savedKey!==void 0?Re.savedCount=Re.savedCount+1:Re.count=Re.count+1,Z.set(we,Re)}}ae.sort($r);for(const H of le.values())H.sort(Lr)}const oe=[...le.entries()].filter(H=>{const[xe]=H;return!ae.some(we=>we.resolveType===xe)}).flatMap(Ar).sort(Dr);let P;e[33]!==m?(P=(H,xe)=>Lt(H.name,m.length).localeCompare(Lt(xe.name,m.length)),e[33]=m,e[34]=P):P=e[34];const q=[...Z.entries()].map(Er).sort(P);let ne;e[35]===Symbol.for("react.memo_cache_sentinel")?(ne=H=>{p(H.savedKey!==void 0?{mode:"saved",key:H.savedKey}:{mode:"available",resolveType:H.resolveType,title:H.title})},e[35]=ne):ne=e[35];const se=ne;let ce;e[36]!==w||e[37]!==G||e[38]!==d?(ce=async(H,xe)=>{await w.mutateAsync({blockKey:H,data:xe}),me.success(d("sandbox.runnableBlocksBrowser.savedBlockToast",{singular:G,blockId:H})),p({mode:"saved",key:H})},e[36]=w,e[37]=G,e[38]=d,e[39]=ce):ce=e[39];const ue=ce;let j;e[40]!==c||e[41]!==u?(j=Ir(u,c),e[40]=c,e[41]=u,e[42]=j):j=e[42];const V=j;if(V){const H=`${V.mode}:${V.mode==="saved"?V.blockKey:V.resolveType}`;let xe;e[43]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>p(null),e[43]=xe):xe=e[43];let we;e[44]!==a||e[45]!==c||e[46]!==ue||e[47]!==r||e[48]!==i||e[49]!==t||e[50]!==l||e[51]!==w.isPending||e[52]!==R||e[53]!==H||e[54]!==V.editorTarget||e[55]!==V.initialValue||e[56]!==o?(we=s.jsx(ha,{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,kind:r,target:V.editorTarget,initialValue:V.initialValue,isCreating:w.isPending,onCreate:ue,onSaveReferencedBlock:R,onBack:xe},H),e[44]=a,e[45]=c,e[46]=ue,e[47]=r,e[48]=i,e[49]=t,e[50]=l,e[51]=w.isPending,e[52]=R,e[53]=H,e[54]=V.editorTarget,e[55]=V.initialValue,e[56]=o,e[57]=we):we=e[57],K=we;break e}O="flex h-full w-full min-w-0 flex-col";let fe;e[58]!==d?(fe=d("sandbox.runnableBlocksBrowser.folderBreadcrumb"),e[58]=d,e[59]=fe):fe=e[59];let he;e[60]===Symbol.for("react.memo_cache_sentinel")?(he=()=>f([]),e[60]=he):he=e[60];const ve=m.length===0?"font-medium text-foreground":"text-muted-foreground";let ge;e[61]!==ve?(ge=ye("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",ve),e[61]=ve,e[62]=ge):ge=e[62];const De=Pr[r];let ke;e[63]!==ge||e[64]!==De?(ke=s.jsx("button",{type:"button",onClick:he,className:ge,children:De}),e[63]=ge,e[64]=De,e[65]=ke):ke=e[65];let Ce;e[66]!==m?(Ce=m.map((H,xe)=>{const we=xe===m.length-1;return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>f(m.slice(0,xe+1)),className:ye("min-w-0 truncate rounded-lg px-1 py-0.5 transition-colors hover:bg-accent hover:text-accent-foreground",we?"font-medium text-foreground":"text-muted-foreground"),children:Lt(H,xe)})]},`${H}-${xe}`)}),e[66]=m,e[67]=Ce):Ce=e[67];let Pe;e[68]!==fe||e[69]!==ke||e[70]!==Ce?(Pe=s.jsxs("nav",{"aria-label":fe,className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:[ke,Ce]}),e[68]=fe,e[69]=ke,e[70]=Ce,e[71]=Pe):Pe=e[71];let Te;e[72]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[72]=Te):Te=e[72];let Ae;e[73]===Symbol.for("react.memo_cache_sentinel")?(Ae=H=>g(H.target.value),e[73]=Ae):Ae=e[73];let be;e[74]!==r||e[75]!==d?(be=d("sandbox.runnableBlocksBrowser.searchPlaceholder",{kind:r}),e[74]=r,e[75]=d,e[76]=be):be=e[76];let Le;e[77]!==r||e[78]!==d?(Le=d("sandbox.runnableBlocksBrowser.searchAriaLabel",{kind:r}),e[77]=r,e[78]=d,e[79]=Le):Le=e[79];let Ie;e[80]!==b||e[81]!==be||e[82]!==Le?(Ie=s.jsxs("div",{className:"flex w-56 shrink-0 items-center gap-2",children:[Te,s.jsx("input",{type:"text",value:b,onChange:Ae,placeholder:be,"aria-label":Le,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[80]=b,e[81]=be,e[82]=Le,e[83]=Ie):Ie=e[83],e[84]!==Pe||e[85]!==Ie?($=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[Pe,Ie]}),e[84]=Pe,e[85]=Ie,e[86]=$):$=e[86],_=Jt,W="min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",z="mx-auto w-full max-w-4xl px-6 py-5",M=te?re.length===0?s.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.noSearchResults",{kind:r,query:b.trim()}),description:d("sandbox.runnableBlocksBrowser.noSearchResultsDescription")}):s.jsx("div",{className:"flex flex-col gap-1",children:re.map(H=>s.jsx(Ue,{icon:F,accent:H.savedKey!==void 0?"global":void 0,title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)},H.savedKey??H.resolveType))}):q.length===0&&ae.length===0&&oe.length===0?s.jsx(tt,{title:d("sandbox.runnableBlocksBrowser.emptyFolderTitle",{kind:r}),description:m.length===0?d("sandbox.runnableBlocksBrowser.emptyFolderNoManifest"):d("sandbox.runnableBlocksBrowser.emptyFolder")}):s.jsxs(s.Fragment,{children:[q.length>0&&s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2",children:q.map(H=>{const xe=_r(H.name,m.length);return s.jsxs("button",{type:"button",onClick:()=>f([...m,H.name]),className:"flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[s.jsx(xe,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-sm font-medium",children:Lt(H.name,m.length)}),s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[H.count," ",H.count===1?G:r,H.savedCount>0&&s.jsxs(s.Fragment,{children:[" ","·"," ",d("sandbox.runnableBlocksBrowser.savedCountLabel",{count:H.savedCount})]})]})]})]},H.name)})}),(ae.length>0||oe.length>0)&&s.jsxs("div",{className:ye("flex flex-col gap-1",q.length>0&&"mt-4"),children:[ae.map(H=>{const xe=le.get(H.resolveType)??[],we=v.has(H.resolveType);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(Ue,{icon:F,title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)}),xe.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>B(H.resolveType),"aria-expanded":we,className:"flex items-center gap-1 self-start rounded-lg px-2.5 py-1 text-xs font-medium transition-colors hover:bg-global-section/10 cursor-pointer ml-11",style:{color:Ts},children:[we?s.jsx(ft,{size:12,className:"shrink-0"}):s.jsx(_t,{size:12,className:"shrink-0"}),d(we?"sandbox.runnableBlocksBrowser.hideSaved":"sandbox.runnableBlocksBrowser.seeSaved")," ","(",xe.length,")"]}),we&&s.jsx("div",{className:"ml-11 flex flex-col gap-1 pb-1",children:xe.map(Re=>s.jsx(Ue,{icon:F,accent:"global",title:Re.title,subtitle:Re.resolveType,active:!1,onClick:()=>se(Re)},Re.savedKey))})]})]},H.resolveType)}),oe.map(H=>s.jsx(Ue,{icon:F,accent:"global",title:H.title,subtitle:H.resolveType,active:!1,onClick:()=>se(H)},H.savedKey))]})]})}e[10]=F,e[11]=a,e[12]=c,e[13]=r,e[14]=i,e[15]=v,e[16]=t,e[17]=m,e[18]=l,e[19]=w,e[20]=R,e[21]=b,e[22]=u,e[23]=G,e[24]=d,e[25]=o,e[26]=_,e[27]=$,e[28]=K,e[29]=z,e[30]=M,e[31]=W,e[32]=O}else _=e[26],$=e[27],K=e[28],z=e[29],M=e[30],W=e[31],O=e[32];if(K!==Symbol.for("react.early_return_sentinel"))return K;let I;e[87]!==z||e[88]!==M?(I=s.jsx("div",{className:z,children:M}),e[87]=z,e[88]=M,e[89]=I):I=e[89];let D;e[90]!==_||e[91]!==I||e[92]!==W?(D=s.jsx(_,{className:W,children:I}),e[90]=_,e[91]=I,e[92]=W,e[93]=D):D=e[93];let U;return e[94]!==$||e[95]!==D||e[96]!==O?(U=s.jsxs("div",{className:O,children:[$,D]}),e[94]=$,e[95]=D,e[96]=O,e[97]=U):U=e[97],U}function Er(n){const[e,t]=n;return{name:e,...t}}function Dr(n,e){return n.title.localeCompare(e.title)}function Ar(n){const[,e]=n;return e}function Lr(n,e){return n.title.localeCompare(e.title)}function $r(n,e){return n.title.localeCompare(e.title)}function Or(n){return{resolveType:n.resolveType,title:n.title,folderPath:Ln(n.resolveType)}}function Rr(n){return{resolveType:n.resolveType,title:n.title,folderPath:Ln(n.resolveType),savedKey:n.key}}function Fr(){return new Set}function Ir(n,e){if(!n)return null;if(n.mode==="available")return{mode:"available",resolveType:n.resolveType,editorTarget:{mode:"available",resolveType:n.resolveType,title:n.title},initialValue:{}};const{resolveType:t,props:o,title:a}=ga(e,n.key);return{mode:"saved",blockKey:n.key,resolveType:t,editorTarget:{mode:"saved",blockKey:n.key,resolveType:t,title:a},initialValue:o}}function Kr(n){const e=ie.c(106),{orgSlug:t,virtualMcpId:o,branch:a,previewUrl:l,meta:i,decofile:c,resolveType:r,title:d,defaultBlockId:h,isCreating:m,onCreate:f,onSaveReferencedBlock:u}=n,p=je(),b=Qt(),g=b?.virtualMcpId,y=Vn(g===o?o:null)?.metadata?.siteSlug??null;let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];const[S,N]=A.useState(k);let B;e[1]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[1]=B):B=e[1];const[E,w]=A.useState(B),[T,R]=A.useState(0),[L,G]=A.useState(!1);let F;e[2]!==i||e[3]!==r?(F=Cs(r,i),e[2]=i,e[3]=r,e[4]=F):F=e[4];const _=F;let $,K,z,M,W,O,I,D;if(e[5]!==y||e[6]!==a||e[7]!==c||e[8]!==E||e[9]!==S||e[10]!==m||e[11]!==f||e[12]!==t||e[13]!==l||e[14]!==r||e[15]!==p||e[16]!==b?.taskId||e[17]!==d||e[18]!==o){const ae=r.split("/").pop()?.replace(/\.tsx?$/,"")??r,le=b?.taskId??null,oe=l??void 0;let P;e[27]!==y||e[28]!==a||e[29]!==t||e[30]!==oe||e[31]!==le||e[32]!==o?(P={orgSlug:t,virtualMcpId:o,branch:a,threadId:le,previewUrl:oe,siteSlug:y},e[27]=y,e[28]=a,e[29]=t,e[30]=oe,e[31]=le,e[32]=o,e[33]=P):P=e[33],K=P;let q,ne,se,ce;if(e[34]!==c||e[35]!==E||e[36]!==S||e[37]!==f||e[38]!==p||e[39]!==d){const ke=[d,...E],Ce=Te=>{w(E.slice(0,Te)),R(zr)};let Pe;e[48]!==c||e[49]!==S||e[50]!==f?(Pe=async Te=>{const Ae=va(Te,c);if(Ae){me.error(Ae);return}await f(Te,S),G(!1)},e[48]=c,e[49]=S,e[50]=f,e[51]=Pe):Pe=e[51],$=Pe,D="flex h-full w-full min-w-0",I="flex min-w-0 flex-1 flex-col",W="shrink-0 border-b px-3 py-2.5",ce="flex min-w-0 items-center gap-2 overflow-hidden",e[52]!==p?(q=p("sandbox.availableSectionEditor.editingBreadcrumb"),e[52]=p,e[53]=q):q=e[53],ne="flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",se=ke.map((Te,Ae)=>{const be=Ae===ke.length-1,Le=ya(Te);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[Ae>0&&s.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>Ce(Ae),title:Le,className:ye("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",be?"font-medium text-foreground":"text-muted-foreground"),children:Le})]},`${Le}-${Ae}`)}),e[34]=c,e[35]=E,e[36]=S,e[37]=f,e[38]=p,e[39]=d,e[40]=$,e[41]=q,e[42]=ne,e[43]=se,e[44]=ce,e[45]=W,e[46]=I,e[47]=D}else $=e[40],q=e[41],ne=e[42],se=e[43],ce=e[44],W=e[45],I=e[46],D=e[47];let ue;e[54]!==q||e[55]!==ne||e[56]!==se?(ue=s.jsx("nav",{"aria-label":q,className:ne,children:se}),e[54]=q,e[55]=ne,e[56]=se,e[57]=ue):ue=e[57];let j;e[58]===Symbol.for("react.memo_cache_sentinel")?(j=()=>G(!0),e[58]=j):j=e[58];let V;e[59]!==p?(V=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[59]=p,e[60]=V):V=e[60];let fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(fe=s.jsx(Jo,{size:14}),e[61]=fe):fe=e[61];let he;e[62]!==m||e[63]!==V?(he=s.jsx(He,{asChild:!0,children:s.jsx(Ee,{size:"icon",className:"size-8 shrink-0",disabled:m,onClick:j,"aria-label":V,children:fe})}),e[62]=m,e[63]=V,e[64]=he):he=e[64];let ve;e[65]!==p?(ve=p("sandbox.availableSectionEditor.saveAsGlobalSection"),e[65]=p,e[66]=ve):ve=e[66];let ge;e[67]!==ve?(ge=s.jsx(qe,{side:"bottom",children:ve}),e[67]=ve,e[68]=ge):ge=e[68];let De;e[69]!==he||e[70]!==ge?(De=s.jsxs(We,{children:[he,ge]}),e[69]=he,e[70]=ge,e[71]=De):De=e[71],e[72]!==ce||e[73]!==ue||e[74]!==De?(O=s.jsxs("div",{className:ce,children:[ue,De]}),e[72]=ce,e[73]=ue,e[74]=De,e[75]=O):O=e[75],z="mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",M=p("sandbox.availableSectionEditor.localEditsHint",{typeLabel:ae}),e[5]=y,e[6]=a,e[7]=c,e[8]=E,e[9]=S,e[10]=m,e[11]=f,e[12]=t,e[13]=l,e[14]=r,e[15]=p,e[16]=b?.taskId,e[17]=d,e[18]=o,e[19]=$,e[20]=K,e[21]=z,e[22]=M,e[23]=W,e[24]=O,e[25]=I,e[26]=D}else $=e[19],K=e[20],z=e[21],M=e[22],W=e[23],O=e[24],I=e[25],D=e[26];let U;e[76]!==z||e[77]!==M?(U=s.jsx("p",{className:z,children:M}),e[76]=z,e[77]=M,e[78]=U):U=e[78];let X;e[79]!==U||e[80]!==W||e[81]!==O?(X=s.jsxs("div",{className:W,children:[O,U]}),e[79]=U,e[80]=W,e[81]=O,e[82]=X):X=e[82];let ee;e[83]!==c||e[84]!==E||e[85]!==T||e[86]!==S||e[87]!==i||e[88]!==u||e[89]!==K||e[90]!==_||e[91]!==p?(ee=s.jsx(Jt,{className:"min-h-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:_?s.jsx(On,{schema:_,value:S,onChange:ae=>N(ae),basePath:"",breadcrumbPath:E,onBreadcrumbChange:w,meta:i,decofile:c,onSaveReferencedBlock:u,sandbox:K},T):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:p("sandbox.availableSectionEditor.noEditableFields")})})})}),e[83]=c,e[84]=E,e[85]=T,e[86]=S,e[87]=i,e[88]=u,e[89]=K,e[90]=_,e[91]=p,e[92]=ee):ee=e[92];let te;e[93]!==X||e[94]!==ee||e[95]!==I?(te=s.jsxs("div",{className:I,children:[X,ee]}),e[93]=X,e[94]=ee,e[95]=I,e[96]=te):te=e[96];let re;e[97]!==h||e[98]!==$||e[99]!==m||e[100]!==L?(re=s.jsx(ja,{open:L,onOpenChange:G,defaultBlockId:h,isPending:m,onSubmit:$}),e[97]=h,e[98]=$,e[99]=m,e[100]=L,e[101]=re):re=e[101];let Z;return e[102]!==te||e[103]!==re||e[104]!==D?(Z=s.jsxs("div",{className:D,children:[te,re]}),e[102]=te,e[103]=re,e[104]=D,e[105]=Z):Z=e[105],Z}function zr(n){return n+1}function Mr(n,e){const t={__resolveType:n},o=wa([t],e)[0];return o?Na(t,o,e):null}function Vr({orgSlug:n,virtualMcpId:e,branch:t,previewUrl:o,meta:a,decofile:l,blockKey:i,onSaveReferencedBlock:c}){const r=je(),d=Qt(),h=d?.virtualMcpId,f=Vn(h===e?e:null)?.metadata?.siteSlug??null,[u]=A.useState(()=>Mr(i,l)),[p,b]=A.useState(u?.data??{}),[g,v]=A.useState([]),[y,k]=A.useState(0),[S,N]=A.useState(!1),[B,E]=A.useState(null),w=B!==null,{save:T,flush:R}=ka({orgSlug:n,virtualMcpId:e,branch:t}),L=u?.resolveType?Cs(u.resolveType,a):null,G=l[i],F=G?Ia(i,G):i,_=d?.taskId??null,$={orgSlug:n,virtualMcpId:e,branch:t,threadId:_,previewUrl:o??void 0,siteSlug:f},K=I=>{b(I),T(i,I)},z=()=>{w?(E(null),N(!1),k(I=>I+1)):E(JSON.stringify(p,null,2))},M=I=>{const D=I??"";try{const U=JSON.parse(D);if(U&&typeof U=="object"&&!Array.isArray(U)){N(!1),K(U);return}N(!0)}catch{N(!0)}},W=[F,...g],O=I=>{v(g.slice(0,I)),k(D=>D+1)};return s.jsx("div",{className:"flex h-full w-full min-w-0",children:s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx(Sa,{crumbs:W,onSelect:O}),s.jsxs("div",{className:"shrink-0 border-b px-3 py-2.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:Ts},"aria-hidden":!0}),s.jsx("div",{className:"flex-1"}),s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsx(Ee,{variant:w?"default":"ghost",size:"icon",className:"size-8 shrink-0",onClick:z,"aria-label":r(w?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson"),"aria-pressed":w,children:w?s.jsx(Es,{size:14}):s.jsx(Pn,{size:14})})}),s.jsx(qe,{side:"bottom",children:r(w?"sandbox.savedSectionEditor.closeJsonEditor":"sandbox.savedSectionEditor.editAsJson")})]})]}),s.jsx("p",{className:"mt-1.5 py-1 pl-1 text-sm leading-snug text-muted-foreground",children:r("sandbox.savedSectionEditor.globalSectionDescription")})]}),s.jsxs("div",{className:"relative min-h-0 flex-1",children:[s.jsx(Jt,{className:"h-full [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:L?s.jsx(On,{schema:L,value:p,onChange:I=>K(I),basePath:"",breadcrumbPath:g,onBreadcrumbChange:v,meta:a,decofile:l,onSaveReferencedBlock:c,sandbox:$},y):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sandbox.savedSectionEditor.noEditableFields")})})})}),B!==null&&s.jsxs("div",{className:"absolute inset-0 flex flex-col bg-background",children:[S&&s.jsx("div",{className:"shrink-0 border-b bg-destructive/10 px-3 py-1.5 text-xs text-destructive",children:r("sandbox.savedSectionEditor.invalidJsonError")}),s.jsx("div",{className:"min-h-0 flex-1",children:s.jsx(Mn,{language:"json",height:"100%",code:B,onChange:M,onSave:I=>{M(I),R()}})})]})]})]})})}function Gr(n){const e=ie.c(36),{selection:t,orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,isCreating:d,onCreateAvailable:h,onSaveReferencedBlock:m}=n,f=je();if(!t){let b;e[0]!==f?(b=f("sandbox.sectionsRightPane.selectSectionTitle"),e[0]=f,e[1]=b):b=e[1];let g;e[2]!==f?(g=f("sandbox.sectionsRightPane.selectSectionDescription"),e[2]=f,e[3]=g):g=e[3];let v;return e[4]!==b||e[5]!==g?(v=s.jsx(tt,{title:b,description:g}),e[4]=b,e[5]=g,e[6]=v):v=e[6],v}if(t.collection==="available-section"){const b=`available:${t.resolveType}`,g=t.resolveType,v=t.title;let y;e[7]!==t.title?(y=Ca(t.title),e[7]=t.title,e[8]=y):y=e[8];let k;e[9]!==h||e[10]!==t.resolveType?(k=(N,B)=>h(t.resolveType,N,B),e[9]=h,e[10]=t.resolveType,e[11]=k):k=e[11];let S;return e[12]!==l||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==m||e[17]!==o||e[18]!==i||e[19]!==t.resolveType||e[20]!==t.title||e[21]!==b||e[22]!==y||e[23]!==k||e[24]!==a?(S=s.jsx(Kr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,resolveType:g,title:v,defaultBlockId:y,isCreating:d,onCreate:k,onSaveReferencedBlock:m},b),e[12]=l,e[13]=r,e[14]=d,e[15]=c,e[16]=m,e[17]=o,e[18]=i,e[19]=t.resolveType,e[20]=t.title,e[21]=b,e[22]=y,e[23]=k,e[24]=a,e[25]=S):S=e[25],S}const u=`saved:${t.key}`;let p;return e[26]!==l||e[27]!==r||e[28]!==c||e[29]!==m||e[30]!==o||e[31]!==i||e[32]!==t.key||e[33]!==u||e[34]!==a?(p=s.jsx(Vr,{orgSlug:o,virtualMcpId:a,branch:l,previewUrl:i,meta:c,decofile:r,blockKey:t.key,onSaveReferencedBlock:m},u),e[26]=l,e[27]=r,e[28]=c,e[29]=m,e[30]=o,e[31]=i,e[32]=t.key,e[33]=u,e[34]=a,e[35]=p):p=e[35],p}function $t(n){const e=ie.c(34),{onDuplicate:t,onRename:o,onAddVariant:a,onEditSeo:l,onViewJson:i,onDelete:c}=n,r=je();let d;e[0]!==r?(d=r("sandbox.itemActions.moreActions"),e[0]=r,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx($o,{size:14}),e[2]=h):h=e[2];let m;e[3]!==d?(m=s.jsx(Ft,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":d,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-background hover:text-foreground cursor-pointer",onClick:Ur,children:h})}),e[3]=d,e[4]=m):m=e[4];let f;e[5]!==o||e[6]!==r?(f=o&&s.jsxs(Qe,{onClick:o,children:[s.jsx(ml,{size:14}),r("sandbox.itemActions.rename")]}),e[5]=o,e[6]=r,e[7]=f):f=e[7];let u;e[8]!==t||e[9]!==r?(u=t&&s.jsxs(Qe,{onClick:t,children:[s.jsx(_s,{size:14}),r("sandbox.itemActions.duplicate")]}),e[8]=t,e[9]=r,e[10]=u):u=e[10];let p;e[11]!==a||e[12]!==r?(p=a&&s.jsxs(s.Fragment,{children:[s.jsx(fs,{}),s.jsxs(Qe,{onClick:a,className:"cursor-pointer text-success focus:text-success",children:[s.jsx(Cn,{size:14}),r("sandbox.itemActions.addVariant")]})]}),e[11]=a,e[12]=r,e[13]=p):p=e[13];let b;e[14]!==l||e[15]!==i||e[16]!==r?(b=(l||i)&&s.jsxs(s.Fragment,{children:[s.jsx(fs,{}),l&&s.jsxs(Qe,{onClick:l,children:[s.jsx(wn,{size:14}),r("sandbox.itemActions.editSeo")]}),i&&s.jsxs(Qe,{onClick:i,children:[s.jsx(Pn,{size:14}),r("sandbox.itemActions.viewJson")]})]}),e[14]=l,e[15]=i,e[16]=r,e[17]=b):b=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fs,{}),e[18]=g):g=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Bs,{size:14}),e[19]=v):v=e[19];let y;e[20]!==r?(y=r("sandbox.itemActions.delete"),e[20]=r,e[21]=y):y=e[21];let k;e[22]!==c||e[23]!==y?(k=s.jsxs(Qe,{onClick:c,className:"text-destructive focus:text-destructive",children:[v,y]}),e[22]=c,e[23]=y,e[24]=k):k=e[24];let S;e[25]!==k||e[26]!==f||e[27]!==u||e[28]!==p||e[29]!==b?(S=s.jsxs(It,{align:"end",className:"w-44",children:[f,u,p,b,g,k]}),e[25]=k,e[26]=f,e[27]=u,e[28]=p,e[29]=b,e[30]=S):S=e[30];let N;return e[31]!==S||e[32]!==m?(N=s.jsxs(Kt,{children:[m,S]}),e[31]=S,e[32]=m,e[33]=N):N=e[33],N}function Ur(n){return n.stopPropagation()}const Co=4;function os(n){const e=new Map;for(const t of n)t.slug&&!e.has(t.slug)&&e.set(t.slug,t);return e}function as(n,e){const t=n.parentSlug;if(!n.slug||!t||t===n.slug)return;const o=e.get(t);return o===n?void 0:o}function Po(n,e){const t=os(e),o=[],a=new Set;let l=t.get(n);for(;l&&!a.has(l.slug??"")&&(a.add(l.slug??""),o.push(l),!(o.length>=Co));)l=as(l,t);return o.reverse()}function To(n,e){const t=new Map;for(const o of n){const a=as(o,e);if(!a?.slug)continue;const l=t.get(a);l?l.push(o):t.set(a,[o])}for(const o of t.values())o.sort((a,l)=>a.label.localeCompare(l.label));return t}function Bd(n,e){const t=os(e),o=To(e,t),a=new Set([n]),l=t.get(n);let i=l?[l]:[];for(;i.length;){const c=[];for(const r of i)for(const d of o.get(r)??[])d.slug&&!a.has(d.slug)&&(a.add(d.slug),c.push(d));i=c}return a.delete(n),a}function Ed(n,e){if(!n)return[];const t=os(e),o=Po(n,e),a=o[0];return!a||as(a,t)?[n]:o.map(l=>l.slug??"")}function Hr(n){const e=os(n),t=To(n,e),o=new Set,a=[],l=(c,r)=>{if(!o.has(c)&&(o.add(c),a.push({entry:c,depth:r}),!(r+1>=Co)))for(const d of t.get(c)??[])l(d,r+1)},i=n.filter(c=>!as(c,e)).sort((c,r)=>c.label.localeCompare(r.label));for(const c of i)l(c,0);for(const c of n)l(c,0);return a}function qr(n){return n.split("/").pop()?.replace(/\.tsx?$/,"")||n||"Section"}function Wr(n){const e=new Map;for(const t of n){const o=qr(t.resolveType),a=e.get(o);a?a.push(t):e.set(o,[t])}return[...e.entries()].map(([t,o])=>({label:t,sections:o})).sort((t,o)=>t.label.localeCompare(o.label))}function gn(n){const e=ie.c(8),{icon:t,label:o,className:a}=n;let l;e[0]!==a?(l=ye("flex items-center gap-1.5 px-2.5 pb-1 pt-1 text-xs font-medium text-muted-foreground/70",a),e[0]=a,e[1]=l):l=e[1];let i;e[2]!==t?(i=s.jsx(t,{size:13,className:"shrink-0"}),e[2]=t,e[3]=i):i=e[3];let c;return e[4]!==o||e[5]!==l||e[6]!==i?(c=s.jsxs("div",{className:l,children:[i,o]}),e[4]=o,e[5]=l,e[6]=i,e[7]=c):c=e[7],c}const xn=A.lazy(()=>Ye(()=>import("./app-editor-8YXMt2hP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(n=>({default:n.AppEditor}))),Yr=A.lazy(()=>Ye(()=>import("./post-editor-DJxjE37e.js"),__vite__mapDeps([171,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,28,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,117,57,90,172,158,137,85,86,56,108,120,115,113,62,61,59,63,64,65,66,67,68,69,70,71,72,73,23,74,75,76,77,78,79,80,81,82,83,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,109,21,22,110,111,112,58,114,116,118,119,121,122,123,124,125,126,173,141,60,174,168,175,176,127,128,129,130,131,132,133,134,135,136,138,139,140,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,169,170])).then(n=>({default:n.PostEditor}))),Qr=A.lazy(()=>Ye(()=>import("./record-editor-Bnb7fDb6.js"),__vite__mapDeps([177,1,2,57,90,22,23,24,25,113,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,58,114,115,116,117,118,119,120,121,122,123,124,125,126,176,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(n=>({default:n.RecordEditor}))),Jr=A.lazy(()=>Ye(()=>import("./context-JWyIITVx.js"),__vite__mapDeps([178,1,2,25,28,29,30,31,32,33,34,35,36,37,24,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,57,90,113,108,18,179,104,79,56,105,81,71,72,4,5,6,7,8,9,73,23,114,141,174,142,70,19,83,85,86,180,145,181,62,61,11,12,13,14,15,3,10,16,17,20,59,63,64,65,66,67,68,69,74,75,76,77,78,80,82,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,106,107,109,21,22,110,111,112,58,115,116,117,118,119,120,121,122,123,124,125,126,168,176,177,127,128,129,130,131,132,133,134,135,136,137,138,139,140,143,144,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,169,170,182,173,60,175])).then(n=>({default:n.BlogContext}))),Xr=A.lazy(()=>Ye(()=>import("./category-editor-BevzDKjY.js"),__vite__mapDeps([182,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,29,33,35,46,28,30,31,32,34,36,37,24,25,27,38,39,40,41,42,43,44,45,47,48,49,50,51,52,53,54,55,117,57,90,22,23,173,114,85,86,56,108,62,61,59,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,109,21,110,111,112,113,58,115,116,118,119,120,121,122,123,124,125,126,141,60,174,175,176,127,128,129,130,131,132,133,134,135,136,137,138,139,140,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170])).then(n=>({default:n.CategoryEditor}))),Zr=A.lazy(()=>Ye(()=>import("./sections-editor-g25F6D1o.js"),__vite__mapDeps([183,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,58,62,61,59,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,23,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,57,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,22,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,168,184,26,60,185])).then(n=>({default:n.SectionsEditor}))),ec=A.lazy(()=>Ye(()=>import("./seo-editor-BZLOy3Ym.js"),__vite__mapDeps([186,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,21,22,23,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,57,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,58,114,115,116,117,118,119,120,121,122,123,124,125,126,184])).then(n=>({default:n.SeoEditor}))),tc=A.lazy(()=>Ye(()=>import("./variant-calendar-CaJ6M-lI.js"),__vite__mapDeps([187,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,90,21,22,23,115,73,188,127,128,123,121,20,14,13,124,5,4,6,7,8,9,11,12,15,102,129,77,81,130,3,10,16,17,18,19,79,56,131,96,72,103,104,105,57,71,132,82,83,84,74,85,86,87,88,89,91,92,93,94,95,97,98,99,100,133,61,69,68,70,65,66,120,134,125,80,135,136,137,138,108,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,113,154,155,156,157,158,159,160,161,162,64,67,75,76,78,101,106,107,163,118,63,164,165,166,167,117,62,59,109,110,111,112,58,114,116,119,122,126,168,169,170])).then(n=>({default:n.VariantCalendar}))),sc=A.lazy(()=>Ye(()=>import("./post-calendar-BfaZZYX3.js"),__vite__mapDeps([189,1,2,28,29,30,31,32,33,34,35,36,37,24,25,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,21,22,23,127,128,123,121,20,14,13,124,5,4,6,7,8,9,11,12,15,102,129,77,81,130,3,10,16,17,18,19,79,73,56,131,96,72,103,104,105,90,57,71,132,82,83,84,74,85,86,87,88,89,91,92,93,94,95,97,98,99,100,133,61,69,68,70,65,66,120,134,125,80,135,136,137,138,108,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,113,154,155,156,157,158,159,160,161,162,64,67,75,76,78,101,106,107,163,118,63,164,165,166,167,117,62,59,109,110,111,112,58,114,115,116,119,122,126,168,169,170])).then(n=>({default:n.PostCalendar}))),nc=A.lazy(()=>Ye(()=>import("./redirect-editor-D72JLPRT.js"),__vite__mapDeps([190,1,2,137,24,57,90,22,23,25,62,61,11,8,9,12,13,14,15,3,4,5,6,7,10,16,17,18,19,20,59,28,29,30,31,32,33,34,35,36,37,27,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,63,64,65,66,67,68,69,70,56,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,21,110,111,112,113,58,114,115,116,117,118,119,120,121,122,123,124,125,126,176])).then(n=>({default:n.RedirectEditor})));function oc(n){const e=ie.c(20),{deepLinkPage:t}=n,{currentBranch:o,virtualMcpId:a}=jn(),{org:l}=Oo(),i=Za(),c=el(),{runtime:r,previewServerUrl:d}=zn(a),h=r==="cms";let m;e[0]!==h||e[1]!==c.previewState||e[2]!==i.lifecycle.phase?(m=Al({fastPreviewActive:h,previewState:c.previewState,lifecyclePhase:i.lifecycle.phase}),e[0]=h,e[1]=c.previewState,e[2]=i.lifecycle.phase,e[3]=m):m=e[3];const f=m;if(f.kind==="sandbox-card"){const b=`/${l.slug}/settings/connections`;let g;return e[4]!==f.state||e[5]!==c.start||e[6]!==b||e[7]!==i.lifecycle||e[8]!==i.phase?(g=s.jsx(El,{state:f.state,claimPhase:i.phase,lifecycle:i.lifecycle,onStart:c.start,connectionsHref:b}),e[4]=f.state,e[5]=c.start,e[6]=b,e[7]=i.lifecycle,e[8]=i.phase,e[9]=g):g=e[9],g}if(!a||!o){let b;return e[10]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(tt,{title:"Waiting for sandbox context…"}),e[10]=b):b=e[10],b}const u=h?d:c.previewUrl;let p;return e[11]!==o||e[12]!==t||e[13]!==f.devServerReady||e[14]!==f.sandboxWarming||e[15]!==c.previewUrl||e[16]!==l.slug||e[17]!==u||e[18]!==a?(p=s.jsx(lc,{orgSlug:l.slug,virtualMcpId:a,branch:o,previewUrl:c.previewUrl,sitePreviewUrl:u,deepLinkPage:t,devServerReady:f.devServerReady,sandboxWarming:f.sandboxWarming}),e[11]=o,e[12]=t,e[13]=f.devServerReady,e[14]=f.sandboxWarming,e[15]=c.previewUrl,e[16]=l.slug,e[17]=u,e[18]=a,e[19]=p):p=e[19],p}const bn=2e3,ac=15;function yn(n,e,t,o){return typeof e!="string"||t&&(Gn(e,t,o)||n.state.dataUpdateCount>=ac)?!1:bn}function lc({orgSlug:n,virtualMcpId:e,branch:t,previewUrl:o,sitePreviewUrl:a,deepLinkPage:l,devServerReady:i,sandboxWarming:c}){const r=je(),d=Qt()?.taskId??null,h={orgSlug:n,virtualMcpId:e,branch:t,threadId:d,previewUrl:o},{data:m,isLoading:f}=Pa(h,{fetchEnabled:i}),u=vn({strict:!1}),[p,b]=A.useState(()=>u.contentCollection&&ot(u.contentCollection)&&u.contentCollection||"pages"),[g,v]=A.useState(()=>u.contentItem&&ot(p)?{collection:p,key:u.contentItem}:null),[y,k]=A.useState(null),S=!!(l?.pageId||l?.path||l?.pathTemplate),[N,B]=A.useState(!1);if(S&&!N&&g===null&&m){B(!0);const x=Ka(Hs(m),l??{});x&&(b("pages"),v({collection:"pages",key:x.key,path:x.path}))}const[E,w]=A.useState(""),[T,R]=A.useState("board"),L=x=>{v(x),k(null)},[G,F]=A.useState(p);G!==p&&(F(p),w(""));const{data:_,isLoading:$,isFetching:K}=Ta(h,{fetchEnabled:i,refetchInterval:x=>{const Y=x.state.data;if(p==="apps"&&g&&g.collection==="apps"){const de=m?.[g.key];return yn(x,typeof de?.__resolveType=="string"?de.__resolveType:void 0,Y)}if(p==="site"&&m){const de=Y?qs(m,Y):null,pe=m.site,Ne=de?.resolveType??(typeof pe?.__resolveType=="string"?pe.__resolveType:void 0);return yn(x,Ne,Y,["seo"])}return!1}}),z=(x,Y)=>!Gn(x,_,Y)&&($||K),{catalog:M,isLoading:W}=Pl(_??void 0,m??void 0,{enabled:p==="apps"}),O=Xt(h),I=In(h),D=Fi({orgSlug:n,virtualMcpId:e,branch:t,decofile:m??{},onMoved:(x,Y)=>v(de=>de?.collection==="posts"&&de.key===x?{collection:"posts",key:Y}:de)}),[U,X]=A.useState(null),[ee,te]=A.useState(),[re,Z]=A.useState(!1),[ae,le]=A.useState(),[oe,P]=A.useState(null),[q,ne]=A.useState(null),[se,ce]=A.useState(null),ue=!m||!_;if(f||$||ue&&c)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(at,{className:"size-5 text-muted-foreground"})});if(ue)return s.jsx(tt,{title:"Could not load site data."});const j=Hs(m).sort((x,Y)=>x.name.localeCompare(Y.name)),V=za(m).sort((x,Y)=>x.from.localeCompare(Y.from)),fe=Ma(m,_),he=p==="sections"?Va(_):[],ve=qs(m,_),ge=Yn(m),De=Ds.some(x=>ge[x].length>0),ke=ot(p)?ge[p]:[],Ce=Gs(_,"loaders"),Pe=Gs(_,"actions");if(!Ga(m,_)&&!De&&Ce===0&&Pe===0)return s.jsx(tt,{icon:Bt,title:"No editable content",description:"This project doesn't expose any Deco pages, sections, apps, loaders, or actions."});const Te={pages:j.length,sections:fe.length,apps:M.length,loaders:Ce,actions:Pe,redirects:V.length,posts:ge.posts.length,authors:ge.authors.length,categories:ge.categories.length},Ae=new Set(j.map(x=>Ot(x.path))),be=new Set(j.map(x=>x.name)),Le=new Set(fe.map(x=>x.name)),Ie=async x=>{const Y=m[x.key];if(!Y)return;const de=Fn(m,x.key),pe=Ua(m,x.key,Math.max(0,de-1)),Ne=Ha(Y.sections,pe);if(Ne)try{await O.mutateAsync({blockKey:x.key,data:{...Y,sections:Ne}}),me.success(`Variant added to "${x.name}"`),v({collection:"pages",key:x.key,path:x.path})}catch($e){me.error($e instanceof Error?$e.message:"Could not add variant")}},H=()=>{te(void 0),X({mode:"create",sourceKey:null,initialName:"My new page",initialPath:"/example"})},xe=x=>{te(void 0),X({mode:"duplicate",sourceKey:x.key,initialName:Xs(be,x.name),initialPath:Ll(Ae,x.path)})},we=x=>{te(void 0),X({mode:"rename",sourceKey:x.key,initialName:x.name,initialPath:x.path})},Re=async x=>{if(!U)return;const{mode:Y,sourceKey:de}=U;try{if(Y==="create"){let pe;if(x.templateKey){const $e=m[x.templateKey];if(!$e)throw new Error("Selected template no longer exists.");pe={...$e,name:x.name,path:x.path}}else pe=Rl(x.name,x.path);const Ne=Il(m,x.name);await O.mutateAsync({blockKey:Ne,data:pe}),me.success(`Created "${x.name}"`),v({collection:"pages",key:Ne,path:x.path})}else if(Y==="duplicate"&&de){const pe=m[de];if(!pe)throw new Error("Source page not found");const{key:Ne,data:$e}=Ol({source:pe,pages:j,newName:x.name,newPath:x.path});await O.mutateAsync({blockKey:Ne,data:$e}),me.success(`Duplicated as "${x.name}"`),v({collection:"pages",key:Ne,path:x.path})}else if(Y==="rename"&&de){const pe=m[de];if(!pe)throw new Error("Page not found");const Ne={...pe,name:x.name,path:x.path};await O.mutateAsync({blockKey:de,data:Ne}),me.success("Page updated"),g?.collection==="pages"&&g.key===de&&v({collection:"pages",key:de,path:x.path})}X(null)}catch(pe){te(pe instanceof Error?pe.message:"Save failed")}},ls=({path:x})=>{if(!U)return null;const Y=Ot(x);return(U.mode==="rename"?Ot(U.initialPath):null)!==Y&&Ae.has(Y)?`A page with path "${x}" already exists.`:null},is=async(x,Y,de)=>{await O.mutateAsync({blockKey:Y,data:{...de,name:Y,__resolveType:x}}),me.success(r("sandbox.contentBrowser.createdSection",{name:Y})),v({collection:"sections",key:Y})},rs=$n((x,Y)=>O.mutate({blockKey:x,data:Y})),cs=async x=>{const Y=m[x.key];if(!Y){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}const de=$l(m,x.key),pe=Xs(Le,x.name),Ne={...Y,name:pe};try{await O.mutateAsync({blockKey:de,data:Ne}),me.success(r("sandbox.contentBrowser.duplicatedSection",{name:x.name})),v({collection:"sections",key:de})}catch($e){me.error($e instanceof Error?$e.message:r("sandbox.contentBrowser.duplicateFailed"))}},ds=async x=>{if(!oe)return;const Y=m[oe];if(!Y){me.error(r("sandbox.contentBrowser.sectionNotFound"));return}try{await O.mutateAsync({blockKey:oe,data:{...Y,name:x}}),me.success(r("sandbox.contentBrowser.sectionRenamed")),P(null)}catch(de){me.error(de instanceof Error?de.message:r("sandbox.contentBrowser.renameFailed"))}},Et=()=>{le(void 0),Z(!0)},us=async x=>{const Y=qa(m,x.from),de=Wa(x);try{await O.mutateAsync({blockKey:Y,data:de}),me.success("Created redirect"),Z(!1),v({collection:"redirects",key:Y})}catch(pe){le(pe instanceof Error?pe.message:"Could not create redirect")}},ms=async x=>{const Y=bs(m,x),de=mt(Y,x,ao(x));try{await O.mutateAsync({blockKey:Y,data:de}),me.success(`Created ${Pt[x]}`),v({collection:x,key:Y})}catch(pe){me.error(pe instanceof Error?pe.message:"Could not create")}},C=async x=>{const Y=bs(m,"posts"),de=mt(Y,"posts",Di(x));try{await O.mutateAsync({blockKey:Y,data:de}),me.success(r("sandbox.postCalendar.createdScheduledPost")),b("posts"),F("posts"),v({collection:"posts",key:Y}),k(null)}catch(pe){me.error(pe instanceof Error?pe.message:r("sandbox.postCalendar.couldNotCreate"))}},J=async(x,Y)=>{const de=m[x],pe=de?Li(ct(de,"posts"),Y):null;if(!pe){me.error(r("sandbox.postCalendar.onlyScheduledCanMove"));return}try{await O.mutateAsync({blockKey:x,data:mt(x,"posts",pe)})}catch(Ne){me.error(Ne instanceof Error?Ne.message:r("sandbox.postCalendar.couldNotReschedule"))}},_e=async x=>{const Y=m[x.key];if(!Y){me.error("Record not found.");return}const de=bs(m,x.kind),pe=x.kind==="posts"?"title":"name",Ne={...structuredClone(ct(Y,x.kind)),[pe]:`${x.label} (copy)`};if(x.kind==="categories"){const $e=ge.categories.map(Dt=>Dt.slug??"").filter(Boolean);Ne.slug=_i(String(Ne.slug??""),$e)}try{await O.mutateAsync({blockKey:de,data:mt(de,x.kind,Ne)}),me.success(`Duplicated "${x.label}"`),v({collection:x.kind,key:de})}catch($e){me.error($e instanceof Error?$e.message:"Duplicate failed")}},Ve=()=>{b("posts"),F("posts"),v(null),k(null),w("")},Be=async()=>{if(q)try{const{kind:x,key:Y,label:de}=q;if(x==="blog"){if(q.blogKind==="categories"){const pe=ct(m[Y],"categories").slug,Ne=typeof pe=="string"?pe:"";if(Ne)for(const{key:$e,payload:Dt}of oo(m)){const Is=ri(Dt,Ne);Is!==Dt&&await O.mutateAsync({blockKey:$e,data:oi($e,ci(Is))})}}await I.mutateAsync({blockKey:Y})}else await I.mutateAsync({blockKey:Y});me.success(`Deleted "${de}"`),g&&g.collection!=="available-section"&&g.key===Y&&v(null),ne(null)}catch(x){me.error(x instanceof Error?x.message:"Delete failed")}},nt=I.isPending||O.isPending,yt=q?.kind==="blog"?Pt[q.blogKind]:q?.kind??"item";return s.jsxs("div",{className:"flex h-full w-full",children:[s.jsx(_l,{active:p,counts:Te,showBlog:De,onSelect:x=>{b(x),v(null),k(null)}}),p!=="seo"&&p!=="site"&&p!=="context"&&p!=="calendar"&&p!=="post-schedule"&&p!=="posts"&&p!=="loaders"&&p!=="actions"&&s.jsx(ic,{activeCollection:p,pages:j,redirects:V,sections:fe,availableSections:he,appCatalog:M,appCatalogLoading:W,blogEntries:ke,decofile:m,searchQuery:E,onSearchChange:w,selection:g,onSelect:L,onCreate:()=>{p==="pages"?H():p==="redirects"?Et():ot(p)&&ms(p)},onDuplicatePage:xe,onRenamePage:we,onAddPageVariant:Ie,onDeletePage:x=>ne({kind:"page",key:x.key,label:x.name}),onEditPageSeo:x=>{const Y={collection:"pages",key:x.key,path:x.path};v(Y),k(x.key)},onViewPageJson:x=>ce(x.key),onDuplicateSection:cs,onRenameSection:x=>P(x.key),onDeleteSection:x=>ne({kind:"section",key:x.key,label:x.name}),onDeleteRedirect:x=>ne({kind:"redirect",key:x.key,label:x.from||x.key}),onDuplicateBlog:_e,onDeleteBlog:x=>ne({kind:"blog",blogKind:x.kind,key:x.key,label:x.label})}),s.jsx("div",{className:"flex-1 min-w-0",children:p==="loaders"||p==="actions"?s.jsx(Br,{orgSlug:n,virtualMcpId:e,branch:t,previewUrl:o,meta:_,decofile:m,kind:p}):s.jsx(A.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(at,{className:"size-5 text-muted-foreground"})}),children:p==="calendar"?s.jsx(tc,{decofile:m}):p==="post-schedule"?s.jsx(sc,{decofile:m,isCreating:O.isPending,onCreate:x=>{C(x)},onReschedule:(x,Y)=>{J(x,Y)},onSelect:x=>{b("posts"),F("posts"),v({collection:"posts",key:x}),k(null)}}):p==="site"?ve?s.jsx(xn,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:ve.key,block:m[ve.key],decofile:m,meta:_,title:"Site",excludeFields:["seo"],schemaPending:z(ve.resolveType,["seo"]),previewBaseUrl:o},`site:${ve.key}`):s.jsx(tt,{title:"Site settings not found",description:"This project doesn't have a site app block (site/apps/site.ts)."}):p==="context"?s.jsx(gl,{title:r("sandbox.blogContext.soonTitle"),description:r("sandbox.blogContext.soonDescription"),children:s.jsx(Jr,{orgSlug:n,virtualMcpId:e,branch:t,decofile:m,meta:_,onOpenPost:x=>{b("posts"),F("posts"),v({collection:"posts",key:x}),k(null)},onManageCategoryPosts:()=>{b("posts"),F("posts"),v(null),k(null)}})}):p==="seo"?s.jsx(ec,{orgSlug:n,virtualMcpId:e,branch:t,decofile:m,meta:_,target:{kind:"site"},previewBaseUrl:a}):p==="sections"?s.jsx(Gr,{selection:g?.collection==="sections"||g?.collection==="available-section"?g:null,orgSlug:n,virtualMcpId:e,branch:t,previewUrl:o,meta:_,decofile:m,isCreating:O.isPending,onCreateAvailable:is,onSaveReferencedBlock:rs}):p==="posts"?s.jsx(vr,{orgSlug:n,virtualMcpId:e,branch:t,decofile:m,view:T,selectedKey:g?.collection==="posts"?g.key:null,onViewChange:x=>{R(x),v(null)},onClose:()=>v(null),onOpen:x=>{v({collection:"posts",key:x}),k(null)},move:D,meta:_,renderDetail:(x,Y)=>s.jsx(Yr,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:x,block:m[x],decofile:m,meta:_,previewBaseUrl:a,move:D,onClose:Y?.onClose,expanded:Y?.expanded,onToggleExpand:Y?.onToggleExpand},`post:${Tt(x)}`)}):g&&g.collection!=="available-section"?g.collection==="apps"?s.jsx(xn,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:g.key,block:m[g.key],decofile:m,meta:_,previewBaseUrl:o,schemaPending:z(typeof m[g.key]?.__resolveType=="string"?String(m[g.key].__resolveType):void 0)},`app:${g.key}`):g.collection==="categories"?s.jsx(Xr,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:g.key,block:m[g.key],decofile:m,meta:_,onManagePosts:()=>Ve(),onOpenPost:x=>{b("posts"),F("posts"),v({collection:"posts",key:x}),k(null)},previewBaseUrl:a},`category:${g.key}`):g.collection==="authors"?s.jsx(Qr,{orgSlug:n,virtualMcpId:e,branch:t,kind:"authors",blockKey:g.key,block:m[g.key]},`authors:${g.key}`):g.collection==="redirects"?s.jsx(nc,{orgSlug:n,virtualMcpId:e,branch:t,blockKey:g.key,block:m[g.key]},`redirect:${g.key}`):s.jsx(Zr,{orgSlug:n,virtualMcpId:e,branch:t,previewReady:!0,previewUrl:o??void 0,currentPath:g.collection==="pages"?g.path:"/",activePageBlockKey:g.collection==="pages"?g.key:null,activeGlobalBlockKey:g.collection==="sections"?g.key:null,initialEditSeo:g.collection==="pages"&&y===g.key,onExitSeo:()=>k(null),onSelectRoot:()=>{v(null),k(null)}},g.collection==="pages"?`page:${g.key}`:`section:${g.key}`):s.jsx(tt,{title:`Select ${ot(p)?`a ${Pt[p]}`:p==="pages"?"a page":p==="apps"?"an app":p==="redirects"?"a redirect":"a section"} to edit`,description:p==="apps"?"Browse all apps and select an installed one to edit its settings.":'Pick an item from the list, or click "+" to create one.'})})}),U&&s.jsx(Vl,{open:!!U,mode:U.mode,initialName:U.initialName,initialPath:U.initialPath,isPending:O.isPending,error:ee,templates:j,validate:ls,onSubmit:Re,onOpenChange:x=>{x||(X(null),te(void 0))}}),s.jsx(Ul,{open:re,isPending:O.isPending,error:ae,onSubmit:us,onOpenChange:x=>{x||(Z(!1),le(void 0))}}),oe&&s.jsx(Hl,{open:!!oe,blockKey:oe,initialName:fe.find(x=>x.key===oe)?.name??oe,isPending:O.isPending,onSubmit:ds,onOpenChange:x=>{x||P(null)}}),se&&s.jsx(Ya,{open:!!se,onOpenChange:x=>{x||ce(null)},pageKey:se,decofile:m,onSave:x=>O.mutateAsync({blockKey:se,data:x})}),s.jsx(Zo,{open:!!q,onOpenChange:x=>{!x&&!nt&&ne(null)},children:s.jsxs(ea,{children:[s.jsxs(ta,{children:[s.jsx(sa,{children:`Delete ${yt}?`}),s.jsx(na,{children:q?.kind==="section"?`"${q.label}" will be removed. Pages that still reference it will lose this section.`:q?`"${q.label}" will be removed permanently. This can't be undone.`:null})]}),s.jsxs(oa,{children:[s.jsx(aa,{disabled:nt,children:"Cancel"}),s.jsx(la,{onClick:x=>{x.preventDefault(),Be()},disabled:nt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:nt?s.jsxs(s.Fragment,{children:[s.jsx(at,{className:"size-3.5"}),"Deleting…"]}):"Delete"})]})]})})]})}function ic(n){const e=ie.c(58),{activeCollection:t,pages:o,redirects:a,sections:l,availableSections:i,appCatalog:c,appCatalogLoading:r,blogEntries:d,decofile:h,searchQuery:m,onSearchChange:f,selection:u,onSelect:p,onCreate:b,onDuplicatePage:g,onRenamePage:v,onAddPageVariant:y,onDeletePage:k,onEditPageSeo:S,onViewPageJson:N,onDuplicateSection:B,onRenameSection:E,onDeleteSection:w,onDeleteRedirect:T,onDuplicateBlog:R,onDeleteBlog:L}=n,G=je();let F,_,$,K,z,M;if(e[0]!==t||e[1]!==c||e[2]!==r||e[3]!==i||e[4]!==d||e[5]!==h||e[6]!==y||e[7]!==b||e[8]!==L||e[9]!==k||e[10]!==T||e[11]!==w||e[12]!==R||e[13]!==g||e[14]!==B||e[15]!==S||e[16]!==v||e[17]!==E||e[18]!==f||e[19]!==p||e[20]!==N||e[21]!==o||e[22]!==a||e[23]!==m||e[24]!==l||e[25]!==u||e[26]!==G){const D=m.toLowerCase(),U=o.filter(j=>!D||j.name.toLowerCase().includes(D)||j.path.toLowerCase().includes(D)),X=a.filter(j=>!D||j.from.toLowerCase().includes(D)||j.to.toLowerCase().includes(D)),ee=l.filter(j=>!D||j.name.toLowerCase().includes(D)||j.key.toLowerCase().includes(D)||j.resolveType.toLowerCase().includes(D)),te=i.filter(j=>!D||j.title.toLowerCase().includes(D)||j.resolveType.toLowerCase().includes(D)||(j.description?.toLowerCase().includes(D)??!1)),re=Wr(ee),Z=c.filter(j=>!D||j.title.toLowerCase().includes(D)||j.app.toLowerCase().includes(D)||j.vendor.toLowerCase().includes(D)||j.category.toLowerCase().includes(D)),ae=d.filter(j=>!D||j.label.toLowerCase().includes(D)||j.subtitle.toLowerCase().includes(D)),le=t==="categories"&&!D?Hr(ae):ae.map(cc),oe=`Search ${t}…`,P=ot(t)?`Create new ${Pt[t]}`:t==="redirects"?"Create new redirect":"Create new page",q=t!=="apps"&&t!=="sections";z="shrink-0 border-r flex flex-col min-h-0 w-[300px]";let ne;e[33]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(ws,{size:14,className:"shrink-0 text-muted-foreground","aria-hidden":!0}),e[33]=ne):ne=e[33];let se;e[34]!==f?(se=j=>f(j.target.value),e[34]=f,e[35]=se):se=e[35];let ce;e[36]!==oe||e[37]!==m||e[38]!==se?(ce=s.jsxs("div",{className:"flex flex-1 items-center gap-2 pl-1",children:[ne,s.jsx("input",{type:"text",value:m,onChange:se,placeholder:oe,"aria-label":oe,className:"w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),e[36]=oe,e[37]=m,e[38]=se,e[39]=ce):ce=e[39];let ue;e[40]!==P||e[41]!==b||e[42]!==q?(ue=q&&s.jsxs(We,{children:[s.jsx(He,{asChild:!0,children:s.jsx(Ee,{variant:"ghost",size:"icon",onClick:b,"aria-label":P,children:s.jsx(Ns,{size:14})})}),s.jsx(qe,{side:"bottom",children:P})]}),e[40]=P,e[41]=b,e[42]=q,e[43]=ue):ue=e[43],e[44]!==ce||e[45]!==ue?(M=s.jsxs("div",{className:"px-2 h-12 flex items-center gap-1 border-b shrink-0",children:[ce,ue]}),e[44]=ce,e[45]=ue,e[46]=M):M=e[46],F=Jt,K="flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",_="flex flex-col gap-1 p-1.5",$=t==="pages"?U.length===0?s.jsx(jt,{hasItems:o.length>0,emptyLabel:"No pages yet.",emptyHint:'Click "+" to create your first page.'}):U.map(j=>{const V=u?.collection==="pages"&&u.key===j.key,fe=Fn(h,j.key);return s.jsx(Ue,{icon:Tn,title:j.name,subtitle:j.path,active:V,variantCount:fe,onClick:()=>p({collection:"pages",key:j.key,path:j.path}),menu:s.jsx($t,{onDuplicate:()=>g(j),onRename:()=>v(j),onAddVariant:()=>y(j),onEditSeo:()=>S(j),onViewJson:()=>N(j),onDelete:()=>k(j)})},j.key)}):t==="sections"?ee.length===0&&te.length===0?s.jsx(jt,{hasItems:l.length>0||i.length>0,emptyLabel:"No sections yet.",emptyHint:"Save a section from a page, or start the preview dev server."}):s.jsxs(s.Fragment,{children:[re.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(gn,{icon:zt,label:"Saved sections"}),re.map(j=>s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"px-2.5 pt-1 pb-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground/60",children:j.label}),j.sections.map(V=>{const fe=u?.collection==="sections"&&u.key===V.key;return s.jsx(Ue,{icon:zt,accent:"global",title:V.name,subtitle:j.label,active:fe,onClick:()=>p({collection:"sections",key:V.key}),menu:s.jsx($t,{onDuplicate:()=>B(V),onRename:()=>E(V),onDelete:()=>w(V)})},V.key)})]},j.label))]}),te.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(gn,{icon:Ms,label:"Available sections",className:ye(re.length>0&&"mt-3")}),te.map(j=>{const V=u?.collection==="available-section"&&u.resolveType===j.resolveType,fe=j.resolveType.split("/").pop()?.replace(/\.tsx?$/,"");return s.jsx(Ue,{icon:Ms,title:j.title,subtitle:fe??j.resolveType,active:V,onClick:()=>p({collection:"available-section",resolveType:j.resolveType,title:j.title})},j.resolveType)})]})]}):t==="apps"?r?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(at,{className:"size-4.5 text-muted-foreground"})}):Z.length===0?s.jsx(jt,{hasItems:c.length>0,emptyLabel:"No apps found.",emptyHint:"Try a different search term."}):Z.map(j=>{const V=u?.collection==="apps"&&j.blockKey!==null&&u.key===j.blockKey;return s.jsx(Ue,{icon:En,logoUrl:j.logo,title:j.title,subtitle:j.category,active:V,trailing:j.installed?s.jsx("span",{className:"shrink-0 rounded-full bg-success/15 px-1.5 py-0.5 text-[10px] font-medium text-success",children:"Installed"}):void 0,onClick:()=>{if(!j.installed||!j.blockKey){me.message(`${j.title} is not installed on this site.`);return}p({collection:"apps",key:j.blockKey})}},j.id)}):t==="redirects"?X.length===0?s.jsx(jt,{hasItems:a.length>0,emptyLabel:"No redirects yet.",emptyHint:'Click "+" to create your first redirect.'}):X.map(j=>s.jsx(Ue,{icon:kn,title:j.from||"(no source)",subtitle:`→ ${j.to||"(no target)"}`,active:u?.collection==="redirects"&&u.key===j.key,trailing:s.jsx(ql,{type:j.type}),onClick:()=>p({collection:"redirects",key:j.key}),menu:s.jsx($t,{onDelete:()=>T(j)})},j.key)):ae.length===0?s.jsx(jt,{hasItems:d.length>0,emptyLabel:`No ${t} yet.`,emptyHint:`Click "+" to create your first ${ot(t)?Pt[t]:"item"}.`}):le.map(j=>{const{entry:V,depth:fe}=j,he=u?.collection===V.kind&&u.key===V.key;return s.jsx("div",{style:{paddingLeft:fe*16},children:s.jsx(Ue,{icon:V.kind==="posts"?_n:V.kind==="authors"?Dn:Sn,title:V.label,invalid:V.missing.length>0,invalidReason:V.missing.length>0?G("sandbox.itemRow.missingFields",{fields:V.missing.join(", ")}):void 0,warning:V.duplicateName,warningReason:G("sandbox.itemRow.duplicateName"),subtitle:fe>0?Po(V.slug??"",ae).map(rc).join(" / "):V.subtitle,active:he,onClick:()=>p({collection:V.kind,key:V.key}),menu:s.jsx($t,{onDuplicate:()=>R(V),onDelete:()=>L(V)})})},V.key)}),e[0]=t,e[1]=c,e[2]=r,e[3]=i,e[4]=d,e[5]=h,e[6]=y,e[7]=b,e[8]=L,e[9]=k,e[10]=T,e[11]=w,e[12]=R,e[13]=g,e[14]=B,e[15]=S,e[16]=v,e[17]=E,e[18]=f,e[19]=p,e[20]=N,e[21]=o,e[22]=a,e[23]=m,e[24]=l,e[25]=u,e[26]=G,e[27]=F,e[28]=_,e[29]=$,e[30]=K,e[31]=z,e[32]=M}else F=e[27],_=e[28],$=e[29],K=e[30],z=e[31],M=e[32];let W;e[47]!==_||e[48]!==$?(W=s.jsx("div",{className:_,children:$}),e[47]=_,e[48]=$,e[49]=W):W=e[49];let O;e[50]!==F||e[51]!==K||e[52]!==W?(O=s.jsx(F,{className:K,children:W}),e[50]=F,e[51]=K,e[52]=W,e[53]=O):O=e[53];let I;return e[54]!==z||e[55]!==M||e[56]!==O?(I=s.jsxs("div",{className:z,children:[M,O]}),e[54]=z,e[55]=M,e[56]=O,e[57]=I):I=e[57],I}function rc(n){return n.slug}function cc(n){return{entry:n,depth:0}}function dc(n){const e=ie.c(25),{virtualMcpId:t}=n,o=je(),[a,l]=A.useState(!1),i=ul(t),{activeTask:c}=jn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const d=vn(r);if(!(Qs(i?.metadata)||Qs(c?.metadata))){let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:s.jsx(Js,{className:"size-7 text-foreground"})}),e[1]=f):f=e[1];let u;e[2]!==o?(u=o("mainPanelTabs.contentTab.noContentToEdit"),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==o?(p=o("mainPanelTabs.contentTab.connectGithubDescription"),e[4]=o,e[5]=p):p=e[5];let b,g;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=()=>l(!0),g=s.jsx(Js,{className:"size-4"}),e[6]=b,e[7]=g):(b=e[6],g=e[7]);let v;e[8]!==o?(v=o("mainPanelTabs.previewTab.connectGithub"),e[8]=o,e[9]=v):v=e[9];let y;e[10]!==v?(y=s.jsxs(Ee,{onClick:b,children:[g,v]}),e[10]=v,e[11]=y):y=e[11];let k;e[12]!==u||e[13]!==p||e[14]!==y?(k=s.jsx(fl,{className:"h-full",image:f,title:u,description:p,actions:y}),e[12]=u,e[13]=p,e[14]=y,e[15]=k):k=e[15];let S;e[16]!==a?(S=s.jsx(pl,{open:a,onOpenChange:l,mode:"agent"}),e[16]=a,e[17]=S):S=e[17];let N;return e[18]!==S||e[19]!==k?(N=s.jsxs(s.Fragment,{children:[k,S]}),e[18]=S,e[19]=k,e[20]=N):N=e[20],N}let m;return e[21]!==d.contentPageId||e[22]!==d.contentPath||e[23]!==d.contentPathTemplate?(m=s.jsx(oc,{deepLinkPage:{pageId:d.contentPageId,path:d.contentPath,pathTemplate:d.contentPathTemplate}}),e[21]=d.contentPageId,e[22]=d.contentPath,e[23]=d.contentPathTemplate,e[24]=m):m=e[24],m}function uc(){const n=ie.c(2),e=hl();let t;return n[0]!==e?(t=s.jsx(Ro,{tabId:"content",children:s.jsx(Fo,{feature:"cms",children:s.jsx(dc,{virtualMcpId:e})})}),n[0]=e,n[1]=t):t=n[1],t}const Dd=Object.freeze(Object.defineProperty({__proto__:null,default:uc},Symbol.toStringTag,{value:"Module"}));export{oo as $,Nd as A,Ls as B,Ke as C,ki as D,wd as E,Pd as F,dd as G,fd as H,Ii as I,Me as J,pd as K,md as L,uo as M,xt as N,Ni as O,As as P,ud as Q,Cd as R,bs as S,ao as T,Oi as U,ai as V,Bd as W,Hr as X,Co as Y,ii as Z,_i as _,oi as a,rd as a0,cd as a1,bd as a2,yd as a3,jd as a4,ut as a5,kd as a6,vd as a7,xd as a8,Sd as a9,Ht as aa,Dd as ab,ns as b,Se as c,id as d,ld as e,Ge as f,ct as g,hd as h,go as i,gd as j,Wt as k,Zn as l,ss as m,$l as n,Yn as o,bt as p,Ed as q,bl as r,ci as s,Td as t,bo as u,hi as v,_d as w,lo as x,mt as y,mo as z};