decocms 4.538.0 → 4.538.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-BAkVUwUO.js → ActiveShapeUtils-CFnSXQrP.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-GiWY14UJ.js → AlertCircle-Ds_2WhXL.js} +1 -1
  3. package/dist/client/assets/{AreaChart-Dci3EK3c.js → AreaChart-nWCoaPwi.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-Dm1DOIO_.js → ArrowLeft-GaJGcGPr.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DmZqFHxG.js → ArrowUp-Ve1cK4qn.js} +1 -1
  6. package/dist/client/assets/{BarChart-BjaeNt4p.js → BarChart-Dcp2-buy.js} +1 -1
  7. package/dist/client/assets/{Building02-BIDOqlzR.js → Building02-Cf4X-d51.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-CB8wC0a9.js → CartesianChart-DBuztnGc.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-BA1mz10K.js → CategoricalChart-BmgZ7uPj.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-XFmpER2C.js → CheckCircle-D7olxQBc.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BB7VHQ8R.js → ChevronSelectorVertical-ByzlNFqX.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-BOBhKnkD.js → ChevronUp-zgLSJo7N.js} +1 -1
  13. package/dist/client/assets/{Copy01-CNd4Y0N1.js → Copy01-BzoMFIdk.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-12Md4Si9.js → CreditCard01-DqirQppZ.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-PMMJbcO3.js → DotsVertical-DkVpKTIv.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-B2VOr3wa.js → ErrorBarContext-vyTaVMu4.js} +1 -1
  17. package/dist/client/assets/{Globe04-CGU-JbvL.js → Globe04-CkFRv0Y2.js} +1 -1
  18. package/dist/client/assets/{Image01-W4iMjF9I.js → Image01-DqO4SvqB.js} +1 -1
  19. package/dist/client/assets/{Key01-BYK94S-D.js → Key01-DWe6k94t.js} +1 -1
  20. package/dist/client/assets/{Link01-B2ZgpsAH.js → Link01-3o9Elk03.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-BIEHba-f.js → LinkBroken01-DRUa5XT1.js} +1 -1
  22. package/dist/client/assets/{Minus-7M5sAhSA.js → Minus-kzkj_29B.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Dbk8mjTp.js → Monitor01-is8ZyUQC.js} +1 -1
  24. package/dist/client/assets/{Play-BbRDkLyq.js → Play-CjXmtBKS.js} +1 -1
  25. package/dist/client/assets/{Plus-DdEst5EN.js → Plus-DCMQMI-9.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-BsJ5BUHq.js → ReferenceLine-BJ-vDTSh.js} +1 -1
  27. package/dist/client/assets/{SearchMd-tzLrT0kr.js → SearchMd-BPcibh2b.js} +1 -1
  28. package/dist/client/assets/{Sector--uekcoiH.js → Sector-BBrsL2eG.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-qJGLHlTH.js → ShoppingBag01-Bqi9yZ2c.js} +1 -1
  30. package/dist/client/assets/{Sun-D-KTUfZy.js → Sun-ChTfaRFO.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01--A00BMas.js → SwitchHorizontal01-vlFzntYK.js} +1 -1
  32. package/dist/client/assets/{Tool01-CkZ1DNSP.js → Tool01-D_DzUkH6.js} +1 -1
  33. package/dist/client/assets/{Trash01-CbJGwAlq.js → Trash01-D5WxxfhG.js} +1 -1
  34. package/dist/client/assets/{Upload01-DjD3JGRn.js → Upload01-CCpxUc0U.js} +1 -1
  35. package/dist/client/assets/{UserSquare-ynyjvlRU.js → UserSquare-BpdCC6Kq.js} +1 -1
  36. package/dist/client/assets/{Users01-DdZpwbA5.js → Users01-BewLilnR.js} +1 -1
  37. package/dist/client/assets/{XClose-DceAPqwG.js → XClose-CBoBcHI9.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-CdHfy3Ql.js → ZoomOut-UKDGw6yq.js} +1 -1
  39. package/dist/client/assets/{access-gate-DJuyzn-i.js → access-gate-B5lnrNp3.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-C1MwBP_r.js → add-connection-dialog-C5Y_DQIe.js} +1 -1
  41. package/dist/client/assets/{agent-analytics-dfXX1cU0.js → agent-analytics-CrWuxji2.js} +1 -1
  42. package/dist/client/assets/agent-app-B8g7HXCG.js +1 -0
  43. package/dist/client/assets/{agent-assets-CyRSmalt.js → agent-assets-CjCohDd1.js} +1 -1
  44. package/dist/client/assets/{agent-automation-CJd8wY6G.js → agent-automation-Cw1vupSq.js} +1 -1
  45. package/dist/client/assets/{agent-automations-D6Adafc6.js → agent-automations-DADyH9LU.js} +1 -1
  46. package/dist/client/assets/{agent-calendar-Cv3ib5K3.js → agent-calendar-BpnS1B-Q.js} +1 -1
  47. package/dist/client/assets/{agent-connect-sources-DHBUa3O2.js → agent-connect-sources-BUtEOOEi.js} +1 -1
  48. package/dist/client/assets/agent-deck-BjW3Z3s-.js +1 -0
  49. package/dist/client/assets/{agent-e2e-VKi-AtE0.js → agent-e2e-BhriQdAN.js} +1 -1
  50. package/dist/client/assets/agent-experiments-Dr_m9GDA.js +1 -0
  51. package/dist/client/assets/{agent-file-DZcooBP1.js → agent-file-GsiMJmdT.js} +1 -1
  52. package/dist/client/assets/{agent-hosting-B7r4qgUV.js → agent-hosting-3IKxPqmX.js} +1 -1
  53. package/dist/client/assets/{agent-icon-gy5gO-IG.js → agent-icon-CXyyqpMa.js} +1 -1
  54. package/dist/client/assets/agent-library-4NnJCrl7.js +1 -0
  55. package/dist/client/assets/agent-library-file-wOie6wjv.js +1 -0
  56. package/dist/client/assets/agent-monitor-D93cGiV4.js +1 -0
  57. package/dist/client/assets/{agent-overview-d81QkJ3q.js → agent-overview-B5PvLXFR.js} +1 -1
  58. package/dist/client/assets/{agent-releases-BZ3IyOFH.js → agent-releases-bMsZ5yQZ.js} +1 -1
  59. package/dist/client/assets/agent-settings-0mcQwgqo.js +1 -0
  60. package/dist/client/assets/{agent-site-editor-CCwQiTOn.js → agent-site-editor-DN3KRvIk.js} +1 -1
  61. package/dist/client/assets/agent-site-editor-code-BQblA5PP.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-CzD7r_8-.js +1 -0
  63. package/dist/client/assets/agent-site-editor-preview-C0fyF2la.js +1 -0
  64. package/dist/client/assets/agent-view-BqQguXfW.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-DZoYULDN.js → agent-view-guard-z90QrYwh.js} +1 -1
  66. package/dist/client/assets/{agents-list-DbBurDms.js → agents-list-DSXkyPRk.js} +1 -1
  67. package/dist/client/assets/{ai-providers-_rRUHcQ7.js → ai-providers-BbOFlSCp.js} +1 -1
  68. package/dist/client/assets/{alert-DvVSGyF3.js → alert-DtgstSU8.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-NE_bzeJg.js → analytics-sections-u74BlDgr.js} +1 -1
  70. package/dist/client/assets/api-keys-C3Yfrg07.js +1 -0
  71. package/dist/client/assets/{api-keys-ahow6ILL.js → api-keys-CH40x9b5.js} +1 -1
  72. package/dist/client/assets/{app-editor-B3KQDcRV.js → app-editor-lpYZsEpK.js} +1 -1
  73. package/dist/client/assets/{asset-utils-DHO8iK1b.js → asset-utils-D4yG02dq.js} +1 -1
  74. package/dist/client/assets/{auth-BaDT9x77.js → auth-BdHhBAFh.js} +1 -1
  75. package/dist/client/assets/{auth-catchall-DjY3AfiL.js → auth-catchall-GYBtR3ic.js} +1 -1
  76. package/dist/client/assets/{auth-entry-CdkNSgrh.js → auth-entry-CfOxikcY.js} +1 -1
  77. package/dist/client/assets/{auth-split-layout-j0u9Y9VH.js → auth-split-layout-D4alojNr.js} +1 -1
  78. package/dist/client/assets/{authenticate-and-persist-oauth-Ck_jXxSo.js → authenticate-and-persist-oauth-C5KpSVFq.js} +1 -1
  79. package/dist/client/assets/{automation-list-row-CXx6fw_j.js → automation-list-row-CFMhUt1F.js} +1 -1
  80. package/dist/client/assets/{automation-runs-cOtzrPMg.js → automation-runs-r4ByP7K9.js} +1 -1
  81. package/dist/client/assets/{automations-BpilPhr-.js → automations-CJg1PL_7.js} +1 -1
  82. package/dist/client/assets/{autosend-BH28Njc8.js → autosend-BgdlbO_i.js} +1 -1
  83. package/dist/client/assets/{badge-Bwux_Jdb.js → badge-CCN5Ad5E.js} +1 -1
  84. package/dist/client/assets/{block-document-DukFXvb9.js → block-document-BQbDLhhm.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-DK3CHyzo.js → blocks-preview-workspace-context-BoGPIYEL.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-BHECZHqH.js → blocks-tab-states-XuAlkDNG.js} +1 -1
  87. package/dist/client/assets/{blog-schema-BbmcwIps.js → blog-schema-BHUk1mcN.js} +1 -1
  88. package/dist/client/assets/{buckets-Dqk3SwDj.js → buckets-B4G1WogN.js} +1 -1
  89. package/dist/client/assets/{build-improve-prompt-doc-ChB-j5_L.js → build-improve-prompt-doc-BSYSdSKQ.js} +1 -1
  90. package/dist/client/assets/{calendar-BSsKj4_c.js → calendar-DFYFqMKq.js} +1 -1
  91. package/dist/client/assets/{capability-load-error-DUUGeyFg.js → capability-load-error-WlqEME5j.js} +1 -1
  92. package/dist/client/assets/{category-editor-CWstRZQV.js → category-editor-DH1seDHj.js} +1 -1
  93. package/dist/client/assets/{cdn-tab-BTtRBzdr.js → cdn-tab-DtA8sFST.js} +1 -1
  94. package/dist/client/assets/{chart-wRtBwGr8.js → chart-DBJ0nBTj.js} +1 -1
  95. package/dist/client/assets/{chat-context-CMHTyqVA.js → chat-context-B0QfMtK7.js} +1 -1
  96. package/dist/client/assets/{chat-draft-CircrMX4.js → chat-draft-C2BZw8j7.js} +1 -1
  97. package/dist/client/assets/{checkbox-B6Jej9eU.js → checkbox-CzFYIYeS.js} +1 -1
  98. package/dist/client/assets/{choose-editor-CWRKxtO4.js → choose-editor-DJ0ZEPVl.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-DsdcdvJc.js → cli-auth-success-BXfPKx1V.js} +1 -1
  100. package/dist/client/assets/{client-icons-y1Q10YFN.js → client-icons-azojl93a.js} +1 -1
  101. package/dist/client/assets/{cms-settings-editor-Rl7CYt-n.js → cms-settings-editor-CVlNsR9g.js} +1 -1
  102. package/dist/client/assets/{collapsible-BX4HWcSo.js → collapsible-D7SyoWI6.js} +1 -1
  103. package/dist/client/assets/{collection-detail-CIMh3Jei.js → collection-detail-2IiivUXw.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-B6dcxjrb.js → collection-display-button-BdfHxfK8.js} +1 -1
  105. package/dist/client/assets/{collection-search-DF_k1vPg.js → collection-search-ZYYfADQw.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-DY_FxG6c.js → collection-table-wrapper-nUoCOMI0.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-CY_ndJsm.js → collection-tabs-DUT-_32y.js} +1 -1
  108. package/dist/client/assets/{column-rules-AJ36A-hh.js → column-rules-zsCVfrEU.js} +1 -1
  109. package/dist/client/assets/{combobox-BtOTHSYG.js → combobox-BcG9kY9H.js} +1 -1
  110. package/dist/client/assets/{command-CJ4gxSMG.js → command-DMjv9UCp.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-C2KCTUUR.js → companion-mcps-section-BbQDgg34.js} +1 -1
  112. package/dist/client/assets/{config-CPsLBULE.js → config-BRQKyTF3.js} +1 -1
  113. package/dist/client/assets/{connect-kUNXUGjC.js → connect-PJXKtBkj.js} +1 -1
  114. package/dist/client/assets/{connect-layout-VH1UNOcl.js → connect-layout-CdIOrnnB.js} +1 -1
  115. package/dist/client/assets/{connect-source-dialog-Ctou8yGb.js → connect-source-dialog-wB_CpMH5.js} +1 -1
  116. package/dist/client/assets/{connection-DK177lmE.js → connection-Co5j8iMf.js} +1 -1
  117. package/dist/client/assets/{connection-card-B-1tJM8j.js → connection-card-C0W4Y5E8.js} +1 -1
  118. package/dist/client/assets/{connection-detail--WCzBAT2.js → connection-detail-CndRUN2P.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-1yiAHH1P.js → connection-form-helpers-Dz9M5mpv.js} +1 -1
  120. package/dist/client/assets/{connections-Caq3gWB-.js → connections-CyFz6dcc.js} +1 -1
  121. package/dist/client/assets/{content-tab-Cc0Q2ULJ.js → content-tab-YfBULH2U.js} +3 -3
  122. package/dist/client/assets/{context-B-ngValp.js → context-CyZYwDX8.js} +1 -1
  123. package/dist/client/assets/{context-menu-BU8ZaQuM.js → context-menu-BR-HLcTM.js} +1 -1
  124. package/dist/client/assets/{context-shell-DWKwHJHJ.js → context-shell-v5YxJs4X.js} +3 -3
  125. package/dist/client/assets/{core.esm-DGTo4W3O.js → core.esm-CJau0VZ_.js} +1 -1
  126. package/dist/client/assets/{create-organization-dialog-xggmlIiR.js → create-organization-dialog-D3uDt-mS.js} +1 -1
  127. package/dist/client/assets/{daily-pulse-qg2c97vc.js → daily-pulse-CEYtilUl.js} +1 -1
  128. package/dist/client/assets/{discover-UBQau0mq.js → discover-Dt5UzKit.js} +1 -1
  129. package/dist/client/assets/{domain-settings-DOo9wUGy.js → domain-settings-Vd91cRuZ.js} +1 -1
  130. package/dist/client/assets/{drawer-cCeHz-L_.js → drawer-DVDEynMl.js} +1 -1
  131. package/dist/client/assets/{editor-CJ3BTpUv.js → editor-BPHWgsFO.js} +1 -1
  132. package/dist/client/assets/{editor-classes-BWss0ahE.js → editor-classes-DO0eVExg.js} +1 -1
  133. package/dist/client/assets/{empty-state-C1tanHed.js → empty-state-6fA1LS5m.js} +1 -1
  134. package/dist/client/assets/{empty-state-KX515AmC.js → empty-state-C98_cQun.js} +1 -1
  135. package/dist/client/assets/{experiments-tab-ChFL1Dxn.js → experiments-tab-CVhWHQz6.js} +1 -1
  136. package/dist/client/assets/{experiments-tab-choice-Cmll9XRX.js → experiments-tab-choice-9WDva_co.js} +1 -1
  137. package/dist/client/assets/{extract-connection-data-B4eV0UAf.js → extract-connection-data-CQ-9c4M4.js} +1 -1
  138. package/dist/client/assets/{feature-gate-KjTs7hEa.js → feature-gate-BM2nPq_K.js} +1 -1
  139. package/dist/client/assets/{feature-paywall-CDnBgqeG.js → feature-paywall-BkRDvqlZ.js} +1 -1
  140. package/dist/client/assets/{file-explorer-vsnyJPrF.js → file-explorer-CGmxhajs.js} +1 -1
  141. package/dist/client/assets/{file-preview-CSlYixvL.js → file-preview-CW106Au3.js} +1 -1
  142. package/dist/client/assets/{file-share-button-DcdF8SPH.js → file-share-button-B6mdTr9l.js} +1 -1
  143. package/dist/client/assets/{file-type-icon-CGcvQl1w.js → file-type-icon-BQOlt6bc.js} +1 -1
  144. package/dist/client/assets/{folder-icon-DMKaQAkS.js → folder-icon-CEeLVxaA.js} +1 -1
  145. package/dist/client/assets/{form-D3QMRyGF.js → form-D31DoepE.js} +1 -1
  146. package/dist/client/assets/{general-CeodHkRL.js → general-CJiud_H3.js} +1 -1
  147. package/dist/client/assets/{held-block-view-B7Cg1lHe.js → held-block-view-CB3xOhYs.js} +3 -3
  148. package/dist/client/assets/{home-B2OMFpn1.js → home-CNcl_kvy.js} +1 -1
  149. package/dist/client/assets/{hosted-publish-feedback-BHrbF1cA.js → hosted-publish-feedback-BSdcqLMQ.js} +1 -1
  150. package/dist/client/assets/{icon-button-QBx8ZygL.js → icon-button-CbqEy6tn.js} +1 -1
  151. package/dist/client/assets/{index-D0C3Q4Qh.js → index-7IShUKYk.js} +1 -1
  152. package/dist/client/assets/{index-D5DdhWpU.js → index-BU5FmmeM.js} +1 -1
  153. package/dist/client/assets/{index-JgxModG_.js → index-BdgyAwPA.js} +1 -1
  154. package/dist/client/assets/{index-D_g5fbwO.js → index-CD3fj83c.js} +3 -3
  155. package/dist/client/assets/{index-CxwJoIfH.js → index-CQr86l05.js} +1 -1
  156. package/dist/client/assets/{index-w4PzPo3L.js → index-CeKKvvrE.js} +1 -1
  157. package/dist/client/assets/{index-CCCFXbTH.js → index-Cm3twnkq.js} +1 -1
  158. package/dist/client/assets/{index-BFCPigEv.js → index-Cnj5xCCg.js} +1 -1
  159. package/dist/client/assets/{index-DU9qEpSd.js → index-D4YmJ5bn.js} +1 -1
  160. package/dist/client/assets/{index-DXUKwqTT.js → index-DGMpoxyU.js} +1 -1
  161. package/dist/client/assets/{index-DzZQyUBS.js → index-DZBneeX2.js} +1 -1
  162. package/dist/client/assets/{index-CK3OHota.js → index-D_3ll4pl.js} +1 -1
  163. package/dist/client/assets/{index-BKdv8yOo.js → index-GuHT1Dqd.js} +1 -1
  164. package/dist/client/assets/{index-f6pvFBro.js → index-XNAHJkYn.js} +1 -1
  165. package/dist/client/assets/{index-redirect-DR3kwfY_.js → index-redirect-D2Jxd7RA.js} +1 -1
  166. package/dist/client/assets/{index-nla-PJCP.js → index-zj4emT8y.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-OmdTxLUx.js → infiniteQueryObserver-DIZnkeqn.js} +1 -1
  168. package/dist/client/assets/{infra-billing-CnuDBKgM.js → infra-billing-CHM9W63C.js} +1 -1
  169. package/dist/client/assets/{input-Bn4dO9O5.js → input-B5oK-tm6.js} +1 -1
  170. package/dist/client/assets/{input-BM_N6Y5w.js → input-C8LAqcW8.js} +3 -3
  171. package/dist/client/assets/{integration-icon-CjeKpmHY.js → integration-icon-DrUX7MlE.js} +1 -1
  172. package/dist/client/assets/{jira-icon-tR4A-oH7.js → jira-icon-BZpTWRDk.js} +1 -1
  173. package/dist/client/assets/{label-OhIpdV40.js → label-BjHcnejP.js} +1 -1
  174. package/dist/client/assets/{layout-DanHGYTn.js → layout-D-7ngqTv.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-CJWuMxLh.js → legacy-agents-deep-DlwSBmEx.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-LHCezREc.js → legacy-main-redirect-CjBqfgkP.js} +1 -1
  177. package/dist/client/assets/library-DGmRBsYh.js +1 -0
  178. package/dist/client/assets/{login-CGX_-9NW.js → login-DoscEwvo.js} +1 -1
  179. package/dist/client/assets/{markdown-Ccl-upwY.js → markdown-DCOlrq5H.js} +1 -1
  180. package/dist/client/assets/{mcp-app-renderer-Bd1deLT9.js → mcp-app-renderer-CpTKqKhy.js} +1 -1
  181. package/dist/client/assets/{mcp-oauth-TQiYMgbF.js → mcp-oauth-CFWliElr.js} +1 -1
  182. package/dist/client/assets/{mcp-oauth-V5LqpjQv.js → mcp-oauth-rYjfwNTN.js} +1 -1
  183. package/dist/client/assets/{members-D-q5n-4d.js → members-CtNRNIZz.js} +1 -1
  184. package/dist/client/assets/{memory-fmVzKsZd.js → memory-BzISrBF9.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-C-2Xi8qg.js → mini-report-page-COcteM5H.js} +1 -1
  186. package/dist/client/assets/{mock-board-BZHCoT8_.js → mock-board-C1z7Js6O.js} +3 -3
  187. package/dist/client/assets/{monaco-editor-DXrAgHWf.js → monaco-editor-8NbaeYxI.js} +1 -1
  188. package/dist/client/assets/{monitoring-D9N3dAzZ.js → monitoring-CP2OHem9.js} +1 -1
  189. package/dist/client/assets/{monitoring-stats-row-CGUI7QEq.js → monitoring-stats-row-DJwGXbaX.js} +1 -1
  190. package/dist/client/assets/{multi-select-74_OAX-H.js → multi-select-MrdYsdQJ.js} +1 -1
  191. package/dist/client/assets/{mustache-CbGdlb3Z.js → mustache-Cse4SZP_.js} +1 -1
  192. package/dist/client/assets/{named-rule-uses-CjwCvwXA.js → named-rule-uses-DbKcBg9W.js} +1 -1
  193. package/dist/client/assets/{new-project-dialog-WrDYKTwo.js → new-project-dialog-t1kb5xiA.js} +1 -1
  194. package/dist/client/assets/{oauth-callback-ai-provider-WCBjh_Q4.js → oauth-callback-ai-provider-DsuZukYv.js} +1 -1
  195. package/dist/client/assets/{oauth-callback-2GTQxAE4.js → oauth-callback-bSFZUAjG.js} +1 -1
  196. package/dist/client/assets/{onboarding-Vxd9x2Lr.js → onboarding-8qc2gNkO.js} +1 -1
  197. package/dist/client/assets/{openai-conversation-BmXZjGte.js → openai-conversation-CaEjm2EP.js} +1 -1
  198. package/dist/client/assets/{optimistic-project-sidebar-views-Blt0TNGA.js → optimistic-project-sidebar-views-B6Zgt9ra.js} +1 -1
  199. package/dist/client/assets/{order-monitor-day-RXwFA0HX.js → order-monitor-day-kqoS-Y_Q.js} +1 -1
  200. package/dist/client/assets/{organization-choice-Bh1vqoey.js → organization-choice-DZZeL1XT.js} +1 -1
  201. package/dist/client/assets/{orgs-D8Cd4o2t.js → orgs-kt9vh-dy.js} +1 -1
  202. package/dist/client/assets/{page-seo-form-PkkDJzzh.js → page-seo-form-Dp0KuKjw.js} +1 -1
  203. package/dist/client/assets/{pair-CUzOr8bI.js → pair-o3WkMbxi.js} +1 -1
  204. package/dist/client/assets/{parse-sections-CoU5h-pA.js → parse-sections-B9Tf8cb0.js} +1 -1
  205. package/dist/client/assets/{plan-BFEo7Gl8.js → plan-9q_Cw6ji.js} +1 -1
  206. package/dist/client/assets/{plan-ladder-BD0dFgi7.js → plan-ladder-6A8SWD1S.js} +1 -1
  207. package/dist/client/assets/{popover-C_zTb0re.js → popover-DNa0geGd.js} +1 -1
  208. package/dist/client/assets/{post-calendar-DFQsiTn7.js → post-calendar-N4MlB9EJ.js} +1 -1
  209. package/dist/client/assets/{post-editor-DE0wNTFZ.js → post-editor-BPhcrZnu.js} +1 -1
  210. package/dist/client/assets/{preview-content-C-qeGfnu.js → preview-content-BGa1aq6N.js} +1 -1
  211. package/dist/client/assets/{preview-dialog-DQK5-M23.js → preview-dialog-BcLlrF7L.js} +1 -1
  212. package/dist/client/assets/{preview-panel-D-QfoUDv.js → preview-panel-BipRwFTG.js} +1 -1
  213. package/dist/client/assets/{preview-tab-C3PhJlLe.js → preview-tab-D_XmjQ94.js} +3 -3
  214. package/dist/client/assets/{product-picker-dialog-pe0_j8eG.js → product-picker-dialog-CuQoqK9j.js} +1 -1
  215. package/dist/client/assets/{profile-DAfBQItX.js → profile-FuN22bNA.js} +1 -1
  216. package/dist/client/assets/{project-app-view-B6LGlz1-.js → project-app-view-MMtV5o0V.js} +1 -1
  217. package/dist/client/assets/{project-apps-CPupwOqV.js → project-apps-GTR8G8Ys.js} +1 -1
  218. package/dist/client/assets/{project-feed-vxPoCD9l.js → project-feed-CkPrHQsk.js} +1 -1
  219. package/dist/client/assets/{project-icon-Cr845_CG.js → project-icon-fmbPzLuQ.js} +1 -1
  220. package/dist/client/assets/project-reports-Dg-vdrJe.js +1 -0
  221. package/dist/client/assets/project-tasks-C1Fo6Q_q.js +1 -0
  222. package/dist/client/assets/{projects-BjWFpkwY.js → projects-Do4dpHSf.js} +1 -1
  223. package/dist/client/assets/{projects-empty-state-BYlm9UUi.js → projects-empty-state-DOLbuC5C.js} +1 -1
  224. package/dist/client/assets/{prompts-Cssd3XKK.js → prompts-Cbd5IniR.js} +1 -1
  225. package/dist/client/assets/record-editor-CzhxcAkT.js +1 -0
  226. package/dist/client/assets/{redirect-editor-DMEEDgtP.js → redirect-editor-Be9-Qvv_.js} +1 -1
  227. package/dist/client/assets/{releases-api-Bk5t0ert.js → releases-api-CJKOs4iF.js} +1 -1
  228. package/dist/client/assets/reports-BC3mXfe2.js +1 -0
  229. package/dist/client/assets/{reports-Dgbcbhtv.js → reports-Cwi7mYJf.js} +1 -1
  230. package/dist/client/assets/{reports-onboarding-DqBX9ov6.js → reports-onboarding-DBwy9sOO.js} +1 -1
  231. package/dist/client/assets/{reports-tab-CacnVvHJ.js → reports-tab-C6GCZ_1e.js} +2 -2
  232. package/dist/client/assets/repositories-C-vvRVWc.js +1 -0
  233. package/dist/client/assets/{repositories-ByXlUnyd.js → repositories-CLK21UHp.js} +1 -1
  234. package/dist/client/assets/{repository-binding-By57Fxxd.js → repository-binding-BpxbVNK2.js} +1 -1
  235. package/dist/client/assets/{repository-import-picker-CEj8FSjR.js → repository-import-picker-BIa2KeQJ.js} +1 -1
  236. package/dist/client/assets/{repository-picker-CYEr0G_x.js → repository-picker-D1FdmUjm.js} +1 -1
  237. package/dist/client/assets/{require-capability-DEL3Av3U.js → require-capability-DiaarhnE.js} +1 -1
  238. package/dist/client/assets/{required-auth-layout-CjuTV0NI.js → required-auth-layout-CLzneFN8.js} +1 -1
  239. package/dist/client/assets/{reset-password-UdQOTW8F.js → reset-password-CFxj9jWH.js} +1 -1
  240. package/dist/client/assets/{resizable-Dm7Ppqsk.js → resizable-BRQDRNKu.js} +1 -1
  241. package/dist/client/assets/{resolve-tab-icon-RIV-aaN8.js → resolve-tab-icon-bhxvukg7.js} +1 -1
  242. package/dist/client/assets/{review-settings-BTvN1SXb.js → review-settings-BY-BbFx8.js} +1 -1
  243. package/dist/client/assets/{roles-BIW20J-X.js → roles-8aR2wtse.js} +1 -1
  244. package/dist/client/assets/{route-ZLMvRGu5.js → route-BKABB7N0.js} +1 -1
  245. package/dist/client/assets/route-CBcyPgFB.js +1 -0
  246. package/dist/client/assets/{route-CXQCqWNG.js → route-D0phypJY.js} +1 -1
  247. package/dist/client/assets/{sandbox-lifecycle-context-Dgq0M2ct.js → sandbox-lifecycle-context-CP46WhuD.js} +1 -1
  248. package/dist/client/assets/{schema-Bo1PMfNO.js → schema-CZyOweh2.js} +1 -1
  249. package/dist/client/assets/{schema-BCNeMwy9.js → schema-DlfScG-X.js} +1 -1
  250. package/dist/client/assets/{scroll-area-B5DHgOgq.js → scroll-area-DfDFaLoK.js} +1 -1
  251. package/dist/client/assets/{search-input-DUnxVDPX.js → search-input-Ce0LKLJH.js} +1 -1
  252. package/dist/client/assets/{search-toggle-BNKJfOTM.js → search-toggle-mwrYnTpd.js} +1 -1
  253. package/dist/client/assets/{secret-picker-_MclVjTA.js → secret-picker-0ebHTmVr.js} +1 -1
  254. package/dist/client/assets/{secrets-BefWQ0Kr.js → secrets-i5YFgzbS.js} +1 -1
  255. package/dist/client/assets/{section-array-field-CkpcagA9.js → section-array-field-oWK_IMJM.js} +1 -1
  256. package/dist/client/assets/{sections-BnnbYMn9.js → sections-BhWKKbK8.js} +1 -1
  257. package/dist/client/assets/{sections-editor-cmh9dcT6.js → sections-editor-B6j8jHtF.js} +1 -1
  258. package/dist/client/assets/{select-BjHL6qhR.js → select-CEUzoC6o.js} +1 -1
  259. package/dist/client/assets/{select-model-VvtmJMg1.js → select-model-rItZIAGH.js} +1 -1
  260. package/dist/client/assets/{seo-editor-CvmOkvM2.js → seo-editor-BNYNobIZ.js} +1 -1
  261. package/dist/client/assets/{separator-DNlHxi9i.js → separator-DnXEcPkq.js} +1 -1
  262. package/dist/client/assets/settings-tab-4qrzXqQr.js +1 -0
  263. package/dist/client/assets/{sheet-BDXuMmna.js → sheet-BdF546xt.js} +1 -1
  264. package/dist/client/assets/{shell-layout-CjolmPkc.js → shell-layout-BHS6wDGg.js} +1 -1
  265. package/dist/client/assets/{site-draft-actions-BHDZ9fow.js → site-draft-actions-D9KLDMNb.js} +1 -1
  266. package/dist/client/assets/{site-draft-view-DS-zp5U3.js → site-draft-view-Dwp6ox-i.js} +2 -2
  267. package/dist/client/assets/site-editor-C_RF5xzW.js +1 -0
  268. package/dist/client/assets/{site-editor-toast-l1dhSHCt.js → site-editor-toast-qpDJ9c8x.js} +1 -1
  269. package/dist/client/assets/{skills-G8RLqpdy.js → skills-DkTHa0rC.js} +1 -1
  270. package/dist/client/assets/{slider-CMbVyVJQ.js → slider-C2GpxduI.js} +1 -1
  271. package/dist/client/assets/{sortable.esm-ZyT2TvZV.js → sortable.esm-DSLK_VXl.js} +1 -1
  272. package/dist/client/assets/{sso-dK3w8qI7.js → sso-9_HDrEa6.js} +1 -1
  273. package/dist/client/assets/{suggestion-DXuFICZE.js → suggestion-DWnq0fLw.js} +1 -1
  274. package/dist/client/assets/{switch-CZBObdNg.js → switch-JNrraILQ.js} +1 -1
  275. package/dist/client/assets/{symbol-PHC61XFI.js → symbol-DN0zRhCk.js} +1 -1
  276. package/dist/client/assets/{synced-repos-Bz2NDPvW.js → synced-repos-BqaODaqZ.js} +1 -1
  277. package/dist/client/assets/{tab-icon-glyph-Dasyata1.js → tab-icon-glyph-CAGljGST.js} +1 -1
  278. package/dist/client/assets/{table-DCMR2n9h.js → table-CQyj6E6L.js} +1 -1
  279. package/dist/client/assets/{tabs-C-9VaJhf.js → tabs-Dsn3YxbL.js} +1 -1
  280. package/dist/client/assets/{task-assignee-avatar-CIYygg8_.js → task-assignee-avatar-_ItHEfyB.js} +1 -1
  281. package/dist/client/assets/{task-board-CbT-KEYT.js → task-board-Bl8e1XTd.js} +1 -1
  282. package/dist/client/assets/{task-route-BvmEqfe-.js → task-route-TqMS3_Xw.js} +1 -1
  283. package/dist/client/assets/{task-status-DBdRSG-l.js → task-status-RY841uT0.js} +1 -1
  284. package/dist/client/assets/{taskboard-analytics-D-HgYUFe.js → taskboard-analytics-CVrP0ozY.js} +1 -1
  285. package/dist/client/assets/tasks-BQyDO5YT.js +1 -0
  286. package/dist/client/assets/{tasks-TnH1j2VG.js → tasks-DKrnOMsF.js} +1 -1
  287. package/dist/client/assets/{textarea-CM43JFTD.js → textarea-DHsxWS9H.js} +1 -1
  288. package/dist/client/assets/{thread-analytics-0CnU2XFc.js → thread-analytics-BlBn_Ue7.js} +1 -1
  289. package/dist/client/assets/{thread-intent-Cqs1opf_.js → thread-intent-CIa2mqqt.js} +1 -1
  290. package/dist/client/assets/{thread-route-B5ut0NU_.js → thread-route-CUBgdoZ0.js} +1 -1
  291. package/dist/client/assets/{thread-route-LGDwdWed.js → thread-route-OlD3VCew.js} +1 -1
  292. package/dist/client/assets/{thread-sheet-body-O5yfLvQS.js → thread-sheet-body-DcCGHErs.js} +1 -1
  293. package/dist/client/assets/{time-range-picker-CZQbuwqz.js → time-range-picker-DG1uQaMF.js} +1 -1
  294. package/dist/client/assets/{toggle-group-D2zNn425.js → toggle-group-BFn7oikO.js} +1 -1
  295. package/dist/client/assets/{tool-namespace-DTR_kwTg.js → tool-namespace-DtJ2HF8a.js} +1 -1
  296. package/dist/client/assets/{toolbar-icon-button-BHKfNIjM.js → toolbar-icon-button-DZ8JPQ_p.js} +1 -1
  297. package/dist/client/assets/{tooltip-C9Lea48a.js → tooltip-BFOA909d.js} +1 -1
  298. package/dist/client/assets/{tooltipContext-DOujR0BI.js → tooltipContext-2V1j45YY.js} +1 -1
  299. package/dist/client/assets/{track-7vwNFuqv.js → track-XCtPNBYr.js} +1 -1
  300. package/dist/client/assets/{types-CcFIA35S.js → types-BxxJTVxe.js} +1 -1
  301. package/dist/client/assets/{url-slug-BwNJtYgj.js → url-slug-nNAf_zW7.js} +1 -1
  302. package/dist/client/assets/{usage-stats-B1BWkK1R.js → usage-stats-bTZK9s6S.js} +1 -1
  303. package/dist/client/assets/{use-ai-providers-CGxV6Ump.js → use-ai-providers-CehDWGIM.js} +1 -1
  304. package/dist/client/assets/{use-apply-named-rule-CZu73ste.js → use-apply-named-rule-DlF_o_O9.js} +1 -1
  305. package/dist/client/assets/{use-automations-CnW9gLcq.js → use-automations-CcifryrO.js} +1 -1
  306. package/dist/client/assets/{use-autosave-DXgCcKSg.js → use-autosave-Brq7MoHE.js} +1 -1
  307. package/dist/client/assets/{use-chat-layout-state-Df9sHeOa.js → use-chat-layout-state-DX2dVnP3.js} +1 -1
  308. package/dist/client/assets/{use-clock-tick-CIwUUqD7.js → use-clock-tick-9j5u-Rtx.js} +1 -1
  309. package/dist/client/assets/{use-cms-publish-actions-uyU5PTIQ.js → use-cms-publish-actions-CpgSJalU.js} +1 -1
  310. package/dist/client/assets/{use-connect-companion-GZcPBM3Q.js → use-connect-companion-DZRxznzL.js} +1 -1
  311. package/dist/client/assets/{use-connection-Bl0Snogb.js → use-connection-BUd2E1e4.js} +1 -1
  312. package/dist/client/assets/{use-copy-BymKXx9E.js → use-copy-AGiqroYo.js} +1 -1
  313. package/dist/client/assets/{use-create-virtual-mcp-3B7eJ8ln.js → use-create-virtual-mcp-DUfDYvY_.js} +1 -1
  314. package/dist/client/assets/{use-date-fns-locale-C9WVsNHe.js → use-date-fns-locale-t1pyfasq.js} +1 -1
  315. package/dist/client/assets/{use-debounced-autosave-CM2eDIid.js → use-debounced-autosave-uS4v6WVr.js} +1 -1
  316. package/dist/client/assets/{use-debounced-value-DD-Uo8LF.js → use-debounced-value-Bvr3c0Bg.js} +1 -1
  317. package/dist/client/assets/{use-deco-credits-DI-Ge8Zp.js → use-deco-credits-D3Ul2AHT.js} +1 -1
  318. package/dist/client/assets/{use-decopilot-events-C_or96Qd.js → use-decopilot-events-CQwRTT8g.js} +1 -1
  319. package/dist/client/assets/{use-delete-connection-DPdqR9cX.js → use-delete-connection-MUWA0C1G.js} +1 -1
  320. package/dist/client/assets/{use-deployment-admin-B4OyNHUs.js → use-deployment-admin-DtrC7GR5.js} +1 -1
  321. package/dist/client/assets/{use-fast-preview-draft-url-DTWM-ut4.js → use-fast-preview-draft-url-B40YryGZ.js} +1 -1
  322. package/dist/client/assets/{use-file-configs-CuUOK6xS.js → use-file-configs-C87nAUnF.js} +1 -1
  323. package/dist/client/assets/{use-inbox-feed-BXBI7C7m.js → use-inbox-feed-BrxFGNGq.js} +1 -1
  324. package/dist/client/assets/{use-infinite-scroll-DtUCDqWy.js → use-infinite-scroll-BBt1tR4g.js} +1 -1
  325. package/dist/client/assets/{use-join-requests-Cif12_Yd.js → use-join-requests-KZQ6WXPe.js} +1 -1
  326. package/dist/client/assets/{use-main-panel-tabs-DwRWmy8l.js → use-main-panel-tabs-DFZxwocn.js} +1 -1
  327. package/dist/client/assets/{use-mcp-auth-status-CUefMSEY.js → use-mcp-auth-status-fGawges9.js} +1 -1
  328. package/dist/client/assets/{use-mcp-client-B7ar03Mf.js → use-mcp-client-BHU-qsif.js} +1 -1
  329. package/dist/client/assets/{use-mcp-prompts-CSHnamAQ.js → use-mcp-prompts-DVKPAtxK.js} +1 -1
  330. package/dist/client/assets/{use-mcp-tools-C3K1Ek3G.js → use-mcp-tools-DTZgJEdW.js} +1 -1
  331. package/dist/client/assets/{use-mobile-DkF4ktIE.js → use-mobile-C7tjJGs8.js} +1 -1
  332. package/dist/client/assets/{use-move-blocks-D7FqLWkn.js → use-move-blocks-Co0993wA.js} +1 -1
  333. package/dist/client/assets/{use-navigate-to-agent-BMet2fBs.js → use-navigate-to-agent-BZyzGjVW.js} +1 -1
  334. package/dist/client/assets/{use-org-fs-CpvRxmtT.js → use-org-fs-DiFStjLf.js} +1 -1
  335. package/dist/client/assets/{use-org-repo-syncs-DiMRemww.js → use-org-repo-syncs-D8YSA9t2.js} +1 -1
  336. package/dist/client/assets/{use-org-sso-BvIeHiW0.js → use-org-sso-C9Iucy6w.js} +1 -1
  337. package/dist/client/assets/{use-organization-roles-DVxxo3pr.js → use-organization-roles-Dz-b1a1s.js} +1 -1
  338. package/dist/client/assets/{use-organization-settings-BDkE8atK.js → use-organization-settings-CHidLnF6.js} +1 -1
  339. package/dist/client/assets/{use-panel-navigate-CQ5-5m15.js → use-panel-navigate-CrCScmoE.js} +1 -1
  340. package/dist/client/assets/{use-project-native-view-presence-DYYkvSz7.js → use-project-native-view-presence-DSs2LzKr.js} +1 -1
  341. package/dist/client/assets/{use-project-scope-C58lw4kY.js → use-project-scope-ejA4MhTG.js} +1 -1
  342. package/dist/client/assets/{use-recent-apps-CKV2JUjj.js → use-recent-apps-BQamzqjd.js} +1 -1
  343. package/dist/client/assets/{use-releases-BuVS0Zpo.js → use-releases-BgQagTY2.js} +1 -1
  344. package/dist/client/assets/{use-reports-diagnostic-Cw-6s-9X.js → use-reports-diagnostic-DiC-K8YA.js} +1 -1
  345. package/dist/client/assets/{use-sandbox-events-DpAa77RX.js → use-sandbox-events-BbmfXv6n.js} +1 -1
  346. package/dist/client/assets/{use-secrets-BiIt-MIc.js → use-secrets-0iGSdnGP.js} +1 -1
  347. package/dist/client/assets/{use-section-preview-base-Ua-YFPnC.js → use-section-preview-base-QNrdx3XX.js} +1 -1
  348. package/dist/client/assets/{use-session-runtime-D0DDxEjh.js → use-session-runtime-DYJ3pOXd.js} +1 -1
  349. package/dist/client/assets/{use-sidebar-collapsed-a4idgJIz.js → use-sidebar-collapsed-DBJ9kFpJ.js} +1 -1
  350. package/dist/client/assets/{use-tags-BDB4AWNG.js → use-tags-XdRP6hv7.js} +1 -1
  351. package/dist/client/assets/{use-task-board-analytics-DRaiYNSr.js → use-task-board-analytics-C8Y_Nmnp.js} +1 -1
  352. package/dist/client/assets/{use-task-board-events-C59TKc8i.js → use-task-board-events-C3c7HDax.js} +1 -1
  353. package/dist/client/assets/{use-task-board-item-prs-B-u60KUK.js → use-task-board-item-prs-DlYgoZJv.js} +1 -1
  354. package/dist/client/assets/{use-task-metadata-DRhZU82v.js → use-task-metadata-PWx0qQrW.js} +1 -1
  355. package/dist/client/assets/{use-thread-analytics-Czfic6gr.js → use-thread-analytics-DfrxxjCR.js} +1 -1
  356. package/dist/client/assets/{use-thread-outputs-DGui0G3n.js → use-thread-outputs-CAL5fh-E.js} +1 -1
  357. package/dist/client/assets/useInfiniteQuery-BPkTbU3d.js +1 -0
  358. package/dist/client/assets/{useQueries-DBXn9O72.js → useQueries-D1NR6XSj.js} +1 -1
  359. package/dist/client/assets/useSuspenseInfiniteQuery-BpGKYE1U.js +1 -0
  360. package/dist/client/assets/{users-CU_fKKjr.js → users-CHbLiMHe.js} +1 -1
  361. package/dist/client/assets/{utils-BaNJYkyI.js → utils-BzZnpE20.js} +1 -1
  362. package/dist/client/assets/{variant-calendar-Bjoa2Jrm.js → variant-calendar-nksjvE17.js} +1 -1
  363. package/dist/client/assets/{variant-matcher-override-CJIqSDDL.js → variant-matcher-override-CIWGPj0Z.js} +1 -1
  364. package/dist/client/assets/{view-header-CWrj1Fiv.js → view-header-D6fHMTsm.js} +1 -1
  365. package/dist/client/assets/{virtual-mcp-TF_kASgw.js → virtual-mcp-AzZIPPoU.js} +1 -1
  366. package/dist/client/assets/{watch-sse-pool-C69EsECV.js → watch-sse-pool-CF4IoX_h.js} +1 -1
  367. package/dist/client/index.html +1 -1
  368. package/dist/server/server.js +459 -459
  369. package/package.json +1 -1
  370. package/dist/client/assets/agent-app-Lnk024cG.js +0 -1
  371. package/dist/client/assets/agent-deck-cPCyRJh0.js +0 -1
  372. package/dist/client/assets/agent-experiments-DCNDtGmX.js +0 -1
  373. package/dist/client/assets/agent-library-file-BqdlZ9Na.js +0 -1
  374. package/dist/client/assets/agent-library-gWUsTUyf.js +0 -1
  375. package/dist/client/assets/agent-monitor-BwzA3a4j.js +0 -1
  376. package/dist/client/assets/agent-settings-BhGh94On.js +0 -1
  377. package/dist/client/assets/agent-site-editor-code-XUcD4VpI.js +0 -2
  378. package/dist/client/assets/agent-site-editor-content-BJrBGR9_.js +0 -1
  379. package/dist/client/assets/agent-site-editor-preview-Dpc2igwh.js +0 -1
  380. package/dist/client/assets/agent-view-DxoZ1pTh.js +0 -1
  381. package/dist/client/assets/api-keys-CvP8E9BO.js +0 -1
  382. package/dist/client/assets/library-Drr0VtsN.js +0 -1
  383. package/dist/client/assets/project-reports-BFmjNCSO.js +0 -1
  384. package/dist/client/assets/project-tasks-LmEIVMLo.js +0 -1
  385. package/dist/client/assets/record-editor-BOadhn6H.js +0 -1
  386. package/dist/client/assets/reports-vuOwE56c.js +0 -1
  387. package/dist/client/assets/repositories-CNfg6b14.js +0 -1
  388. package/dist/client/assets/route-CUPxBHEr.js +0 -1
  389. package/dist/client/assets/settings-tab-BVbLfmf7.js +0 -1
  390. package/dist/client/assets/site-editor-CL-_ktpm.js +0 -1
  391. package/dist/client/assets/tasks-Bcry5trB.js +0 -1
  392. package/dist/client/assets/useInfiniteQuery-CVBb5I8q.js +0 -1
  393. package/dist/client/assets/useSuspenseInfiniteQuery-DN4Vh5CF.js +0 -1
@@ -1 +1 @@
1
- import{hN as Ho,bh as Wo,c as jn,b as Rn,r as S,l as ae,j as r,bQ as qo,bd as Vs,hO as Ra,B as Ut,X as rn,aj as Go,Z as Uo,bg as Yo,Y as Zo,q as Jo,hm as Qo,hP as Xo,hQ as ei,bp as xn,h as ti,bi as Rt,hR as st,hS as Wr,hT as gs,hU as ni,hV as qr,hW as si,bw as ri,hX as ai,hY as Gr,hZ as oi,t as q,bZ as Ur,h_ as ii,h$ as Kt,i0 as li,i1 as ci,i2 as ui,bY as Yr,i3 as vs,i4 as di,i5 as fi,i6 as mi,bW as pi,bx as hi,i7 as gi,i8 as vi,bT as Si,f7 as yi,K as bi,bu as Zr,i9 as Jr,ia as xi,ib as _i,ic as ki,id as Ss,ie as wi,ig as ji,ih as Ri,ii as Ei,bR as Qr,ij as Vi,ik as Ti,il as Xr,im as Ai,bV as Ni}from"./index-D_g5fbwO.js";import{u as Ci}from"./chat-context-CMHTyqVA.js";import{a2 as Pi,K as Qn,a3 as Ki,a4 as Mi,a5 as Bi,a6 as Di,a7 as Fi,a8 as Ii,a9 as ea,aa as Li,ab as Oi,z as Un,x as Yn,d as zi,u as $i,ac as ta,i as Hi,ad as Wi,k as qi,h as Gi,ae as Ea,af as Ui,ag as Yi,v as na,ah as Zi,ai as Ji,aj as Wn,ak as sa,al as ra,am as aa,an as ys,ao as Qi,D as Xi,ap as el,y as tl,aq as oa,ar as nl,as as ia,at as la,au as ca,M as sl,av as ua,a as rl,aw as an,ax as al,ay as ol,t as qn,az as _n}from"./held-block-view-B7Cg1lHe.js";import{c as il}from"./repository-binding-By57Fxxd.js";import{n as ll,t as cl}from"./ChevronUp-BOBhKnkD.js";import{a9 as Va,b as Jn,ao as ul,H as dl,a3 as da,$ as fa}from"./agent-icon-gy5gO-IG.js";import{S as on}from"./scroll-area-B5DHgOgq.js";import{c as Et,T as Vt,a as Tt}from"./tooltip-C9Lea48a.js";import{l as fl,u as ml,m as pl,D as hl,a1 as gl,B as vl,ac as Mt,ad as Bt,N as Sl,ay as ma,Q as yl,Z as bl}from"./site-editor-toast-l1dhSHCt.js";import{u as xl,X as _l,E as bs,Y as pa,A as kl,Z as wl}from"./blocks-tab-states-BHECZHqH.js";import{m as jl,u as Rl,P as El}from"./mustache-CbGdlb3Z.js";import{a0 as Gt,T as ks,az as ws,a1 as Dt,U as ln,e as Vl,c as Tl,w as Al,k as Gn,p as wn,a4 as Nl,_ as qt,V as xs,Z as bt,Y as kn,F as Cl,a2 as ha,$ as Pl,ai as Kl,ak as Ml,aA as Bl,aB as Dl,aC as Fl}from"./parse-sections-CoU5h-pA.js";import{a as Il}from"./Copy01-CNd4Y0N1.js";import{a as js,e as Ta}from"./UserSquare-ynyjvlRU.js";import{i as ga}from"./Tool01-CkZ1DNSP.js";import{s as va}from"./Image01-W4iMjF9I.js";import{s as Ll}from"./Plus-DdEst5EN.js";import{s as Ol}from"./Trash01-CbJGwAlq.js";import{i as Rs}from"./ZoomOut-CdHfy3Ql.js";import{u as zl,a as Sa,K as $l,P as Hl,b as Wl,C as ql,D as Gl,c as Ul}from"./core.esm-DGTo4W3O.js";import{u as Yl,s as Zl,a as Zn,S as Jl,v as Ql}from"./sortable.esm-ZyT2TvZV.js";import{s as Xl,g as ec,u as tc,A as nc}from"./use-section-preview-base-Ua-YFPnC.js";import{a as sc,P as ya,w as rc,b as ac}from"./page-seo-form-PkkDJzzh.js";import{u as oc}from"./use-apply-named-rule-CZu73ste.js";import{b as ba,a as ic}from"./variant-matcher-override-CJIqSDDL.js";import{c as xa,d as lc,e as cc}from"./variant-draft-pointer-BeAKcq_c.js";import"./use-panel-navigate-CQ5-5m15.js";import"./thread-route-LGDwdWed.js";import"./use-project-scope-C58lw4kY.js";import"./autosend-BH28Njc8.js";import"./thread-intent-Cqs1opf_.js";import"./use-mcp-client-B7ar03Mf.js";import"./auth-BaDT9x77.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C69EsECV.js";import"./task-board-CbT-KEYT.js";import"./schema-Bo1PMfNO.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-C_or96Qd.js";import"./use-ai-providers-CGxV6Ump.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-BDkE8atK.js";import"./utils-BaNJYkyI.js";import"./Play-BbRDkLyq.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CUzOr8bI.js";import"./LinkBroken01-BIEHba-f.js";import"./collapsible-BX4HWcSo.js";import"./use-copy-BymKXx9E.js";import"./usage-stats-B1BWkK1R.js";import"./tool-namespace-DTR_kwTg.js";import"./form-D3QMRyGF.js";import"./label-OhIpdV40.js";import"./utils-CVEq3hMx.js";import"./markdown-Ccl-upwY.js";import"./use-mobile-DkF4ktIE.js";import"./use-clock-tick-CIwUUqD7.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Bd1deLT9.js";import"./types-CcFIA35S.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-GiWY14UJ.js";import"./XClose-DceAPqwG.js";import"./ShoppingBag01-qJGLHlTH.js";import"./SearchMd-tzLrT0kr.js";import"./shell-layout-CjolmPkc.js";import"./Building02-BIDOqlzR.js";import"./use-deployment-admin-B4OyNHUs.js";import"./admin-fetch-BhTJlAsX.js";import"./CheckCircle-XFmpER2C.js";import"./Monitor01-Dbk8mjTp.js";import"./command-CJ4gxSMG.js";import"./index-JgxModG_.js";import"./integration-icon-CjeKpmHY.js";import"./project-icon-Cr845_CG.js";import"./new-project-dialog-WrDYKTwo.js";import"./ArrowLeft-Dm1DOIO_.js";import"./repository-import-picker-CEj8FSjR.js";import"./use-navigate-to-agent-BMet2fBs.js";import"./repository-picker-CYEr0G_x.js";import"./useInfiniteQuery-CVBb5I8q.js";import"./infiniteQueryObserver-OmdTxLUx.js";import"./collection-search-DF_k1vPg.js";import"./use-debounced-value-DD-Uo8LF.js";import"./required-auth-layout-CjuTV0NI.js";import"./use-org-sso-BvIeHiW0.js";import"./sheet-BDXuMmna.js";import"./use-connection-Bl0Snogb.js";import"./Link01-B2ZgpsAH.js";import"./use-mcp-prompts-CSHnamAQ.js";import"./use-thread-outputs-DGui0G3n.js";import"./file-type-icon-CGcvQl1w.js";import"./section-array-field-CkpcagA9.js";import"./alert-DvVSGyF3.js";import"./switch-CZBObdNg.js";import"./textarea-CM43JFTD.js";import"./ChevronSelectorVertical-BB7VHQ8R.js";import"./popover-C_zTb0re.js";import"./monaco-editor-DXrAgHWf.js";import"./editor-CJ3BTpUv.js";import"./calendar-BSsKj4_c.js";import"./SwitchHorizontal01--A00BMas.js";import"./Minus-7M5sAhSA.js";import"./select-BjHL6qhR.js";import"./index-BdQq_4o_.js";import"./index-DU9qEpSd.js";import"./editor-classes-BWss0ahE.js";import"./toggle-group-D2zNn425.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BtOTHSYG.js";import"./Upload01-DjD3JGRn.js";import"./DotsVertical-PMMJbcO3.js";import"./search-input-DUnxVDPX.js";import"./tabs-C-9VaJhf.js";import"./use-file-configs-CuUOK6xS.js";import"./asset-utils-DHO8iK1b.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-session-runtime-D0DDxEjh.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-DmZqFHxG.js";import"./CreditCard01-12Md4Si9.js";import"./Globe04-CGU-JbvL.js";import"./Key01-BYK94S-D.js";import"./Sun-D-KTUfZy.js";import"./Users01-DdZpwbA5.js";import"./experiments-tab-choice-Cmll9XRX.js";import"./use-sandbox-events-DpAa77RX.js";import"./slider-CMbVyVJQ.js";import"./index-nla-PJCP.js";import"./tooltipContext-DOujR0BI.js";import"./CategoricalChart-BA1mz10K.js";import"./index-w4PzPo3L.js";import"./ActiveShapeUtils-BAkVUwUO.js";import"./Sector--uekcoiH.js";import"./symbol-PHC61XFI.js";import"./empty-state-C1tanHed.js";import"./section-preview-url-7zfngvgW.js";import"./use-move-blocks-D7FqLWkn.js";const uc={escape:Pi};function dc(v,e){for(const p of Xl(v,e)){const y=typeof p.title=="string"?p.title:void 0;if(y?.includes("{{"))return y}}function fc(v,e){if(!e)return;const p=Ho(v,Wo(e));if(p)try{const y=dc(p.resolveType,e);return y&&jl.render(y,p.data,{},uc).trim()||void 0}catch{return}}function mc(v){const e=jn.c(13),{icon:p,label:y,className:b}=v;let V;e[0]!==b?(V=ae("size-3.5",b),e[0]=b,e[1]=V):V=e[1];let B;e[2]!==p||e[3]!==V?(B=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=B):B=e[4];let w;e[5]!==y||e[6]!==B?(w=r.jsx(Vt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":y,className:"shrink-0 cursor-help",children:B})}),e[5]=y,e[6]=B,e[7]=w):w=e[7];let K;e[8]!==y?(K=r.jsx(Tt,{className:"max-w-56",children:y}),e[8]=y,e[9]=K):K=e[9];let k;return e[10]!==w||e[11]!==K?(k=r.jsxs(Et,{children:[w,K]}),e[10]=w,e[11]=K,e[12]=k):k=e[12],k}const pc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function _a(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Aa(v){return v.map((e,p)=>({...e,index:p}))}function hc(v,e){if(e===v.length)return v;if(e<v.length)return Aa(v.slice(0,e));const p=Array.from({length:e-v.length},(y,b)=>({id:crypto.randomUUID(),index:v.length+b}));return[...v,...p]}function Na(v){const e=jn.c(44),{section:p,raw:y,meta:b,decofile:V}=v,B=Rn(),w=Qn(),K=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Q;e[0]!==b||e[1]!==y?(Q=y&&b?ec(y,b):void 0,e[0]=b,e[1]=y,e[2]=Q):Q=e[2];const ge=Q;let Ue;e[3]!==b||e[4]!==k||e[5]!==y||e[6]!==K?(Ue=y&&b&&!K&&!k?fc(y,b):void 0,e[3]=b,e[4]=k,e[5]=y,e[6]=K,e[7]=Ue):Ue=e[7];const Oe=Ue;let Ne;e[8]!==V||e[9]!==b||e[10]!==y||e[11]!==p?(Ne=Ii(y,p,V,b),e[8]=V,e[9]=b,e[10]=y,e[11]=p,e[12]=Ne):Ne=e[12];const oe=Ne;let R;e[13]!==k||e[14]!==y?.__resolveType?(R=!k&&Vs(y?.__resolveType??""),e[13]=k,e[14]=y?.__resolveType,e[15]=R):R=e[15];const c=R,xe=K?Jn:k?Va:Ta;let U;e[16]!==k||e[17]!==K?(U=K?{color:Yo}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=K,e[18]=U):U=e[18];const _e=U;let F;e[19]!==xe||e[20]!==w?(F=w?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Oi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(ul,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=w,e[21]=F):F=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let f;e[24]!==w||e[25]!==_e?(f=!w&&r.jsx(js,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=w,e[25]=_e,e[26]=f):f=e[26];const ze=w?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Re;e[27]!==u||e[28]!==ze?(Re=ae("min-w-0 truncate text-sm font-medium",ze,u),e[27]=u,e[28]=ze,e[29]=Re):Re=e[29];const X=Oe??p.label;let $e;e[30]!==Re||e[31]!==X?($e=r.jsx("span",{className:Re,children:X}),e[30]=Re,e[31]=X,e[32]=$e):$e=e[32];let rt;e[33]!==c||e[34]!==w||e[35]!==oe||e[36]!==B?(rt=w?r.jsxs(r.Fragment,{children:[c&&r.jsx(mc,{icon:Rs,label:B("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),oe&&r.jsx(ea,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):oe&&r.jsx(ea,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=w,e[35]=oe,e[36]=B,e[37]=rt):rt=e[37];let Ce;return e[38]!==$e||e[39]!==rt||e[40]!==F||e[41]!==ke||e[42]!==f?(Ce=r.jsxs(r.Fragment,{children:[F,ke,f,$e,rt]}),e[38]=$e,e[39]=rt,e[40]=F,e[41]=ke,e[42]=f,e[43]=Ce):Ce=e[43],Ce}const gc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vc="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function Ca(v,e,p){if(p)return Li({selected:e});const y=v.isSavedBlock===!0,b=v.isMultivariate===!0;return ae("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":y?gc:b?vc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function _s(v,e){return ae("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Sc(v){const e=jn.c(90),{section:p,raw:y,meta:b,decofile:V,sortableId:B,selected:w,onSelect:K,onDelete:k,onDuplicate:Q,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Oe,onAddVariant:Ne,onDetach:oe}=v,R=Rn(),c=Qn(),xe=y?Vs(y.__resolveType??""):!1,U=p.isHidden===!0,_e=xe||U;let F;e[0]!==p?(F=Ra(p),e[0]=p,e[1]=F):F=e[1];const ke=F,f=!!Oe&&!p.isMultivariate;let ze;e[2]!==B?(ze={id:B,animateLayoutChanges:xc},e[2]=B,e[3]=ze):ze=e[3];const{attributes:u,listeners:Re,setNodeRef:X,transform:$e,isDragging:rt}=Yl(ze);let Ce;e[4]!==$e?(Ce=ql.Transform.toString($e?{...$e,x:0}:null),e[4]=$e,e[5]=Ce):Ce=e[5];const at=rt?0:void 0;let Pe;e[6]!==Ce||e[7]!==at?(Pe={transform:Ce,opacity:at},e[6]=Ce,e[7]=at,e[8]=Pe):Pe=e[8];const _=Pe;let we;e[9]!==p?(we=Mi(p),e[9]=p,e[10]=we):we=e[10];const ot=we,it="button",m=0;let L;e[11]!==K?(L=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),K())},e[11]=K,e[12]=L):L=e[12];const et=rt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==w||e[16]!==et?(A=ae("touch-none transition-colors",et,Ca(p,w,c)),e[13]=c,e[14]=p,e[15]=w,e[16]=et,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==b||e[20]!==y||e[21]!==p?(Ye=r.jsx(Na,{section:p,raw:y,meta:b,decofile:V}),e[18]=V,e[19]=b,e[20]=y,e[21]=p,e[22]=Ye):Ye=e[22];const W=!c&&f&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ae(_s(_e,xe)),onClick:T=>{T.stopPropagation(),Oe?.()},onPointerDown:bc,children:r.jsx(Rs,{className:ae("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Tt,{side:"bottom",children:R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),lt=c?r.jsx(Bi,{label:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:U,onToggle:Ue,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})}):r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ae(_s(_e,U)),onClick:T=>{T.stopPropagation(),Ue()},onPointerDown:yc,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})})}),r.jsx(Tt,{side:"bottom",children:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=Uo,Ze=Di;let ve;e[23]!==R?(ve=R("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=R,e[24]=ve):ve=e[24];const ct=ae(_s(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let He;e[25]!==Ze||e[26]!==ve||e[27]!==ct?(He=r.jsx(Ze,{label:ve,classicClassName:ct}),e[25]=Ze,e[26]=ve,e[27]=ct,e[28]=He):He=e[28];let Ee;e[29]!==c||e[30]!==f||e[31]!==xe||e[32]!==Oe||e[33]!==R?(Ee=c&&f&&r.jsxs(r.Fragment,{children:[r.jsxs(rn,{onClick:T=>{T.stopPropagation(),Oe?.()},children:[r.jsx(Rs,{className:"h-4 w-4"}),R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(Go,{})]}),e[29]=c,e[30]=f,e[31]=xe,e[32]=Oe,e[33]=R,e[34]=Ee):Ee=e[34];let Ke;e[35]!==Q?(Ke=T=>{T.stopPropagation(),Q()},e[35]=Q,e[36]=Ke):Ke=e[36];let tt;e[37]===Symbol.for("react.memo_cache_sentinel")?(tt=r.jsx(Il,{className:"h-4 w-4"}),e[37]=tt):tt=e[37];let Me;e[38]!==R?(Me=R("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=R,e[39]=Me):Me=e[39];let Be;e[40]!==Ke||e[41]!==Me?(Be=r.jsxs(rn,{onClick:Ke,children:[tt,Me]}),e[40]=Ke,e[41]=Me,e[42]=Be):Be=e[42];let De;e[43]!==c||e[44]!==ke||e[45]!==Ne||e[46]!==R?(De=ke&&r.jsxs(rn,{className:ae(!c&&Fi),onClick:T=>{T.stopPropagation(),Ne()},children:[r.jsx(Va,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ne,e[46]=R,e[47]=De):De=e[47];let Y;e[48]!==c||e[49]!==ot||e[50]!==ge||e[51]!==R?(Y=ot&&r.jsxs(rn,{className:ae(!c&&pc),onClick:T=>{T.stopPropagation(),ge()},children:[c?r.jsx(Jn,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=ot,e[50]=ge,e[51]=R,e[52]=Y):Y=e[52];let Z;e[53]!==c||e[54]!==oe||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==R?(Z=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(rn,{onClick:T=>{T.stopPropagation(),oe()},children:[c?r.jsx(Ta,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=oe,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=R,e[58]=Z):Z=e[58];let ee;e[59]!==k?(ee=T=>{T.stopPropagation(),k()},e[59]=k,e[60]=ee):ee=e[60];let O;e[61]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(Ol,{className:"h-4 w-4"}),e[61]=O):O=e[61];let N;e[62]!==R?(N=R("sectionsEditor.sectionList.deleteMenuItem"),e[62]=R,e[63]=N):N=e[63];let me;e[64]!==ee||e[65]!==N?(me=r.jsxs(rn,{variant:"destructive",onClick:ee,children:[O,N]}),e[64]=ee,e[65]=N,e[66]=me):me=e[66];let We;e[67]!==Ee||e[68]!==Be||e[69]!==De||e[70]!==Y||e[71]!==Z||e[72]!==me?(We=r.jsxs(Zo,{align:"end",className:"w-44",children:[Ee,Be,De,Y,Z,me]}),e[67]=Ee,e[68]=Be,e[69]=De,e[70]=Y,e[71]=Z,e[72]=me,e[73]=We):We=e[73];let qe;e[74]!==fe||e[75]!==He||e[76]!==We?(qe=r.jsxs(fe,{children:[He,We]}),e[74]=fe,e[75]=He,e[76]=We,e[77]=qe):qe=e[77];let Je;return e[78]!==u||e[79]!==Re||e[80]!==K||e[81]!==X||e[82]!==_||e[83]!==A||e[84]!==Ye||e[85]!==W||e[86]!==lt||e[87]!==qe||e[88]!==L?(Je=r.jsxs("div",{ref:X,style:_,...u,...Re,role:it,tabIndex:m,onClick:K,onKeyDown:L,className:A,children:[Ye,W,lt,qe]}),e[78]=u,e[79]=Re,e[80]=K,e[81]=X,e[82]=_,e[83]=A,e[84]=Ye,e[85]=W,e[86]=lt,e[87]=qe,e[88]=L,e[89]=Je):Je=e[89],Je}function yc(v){return v.stopPropagation()}function bc(v){return v.stopPropagation()}function xc(){return!1}function Es(v){const e=jn.c(11),{canAddSection:p,onAddSection:y,className:b,size:V}=v,B=Rn();let w;e[0]!==b?(w=ae("w-full",b),e[0]=b,e[1]=w):w=e[1];const K=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ll,{size:14}),e[2]=k):k=e[2];let Q;e[3]!==B?(Q=B("sectionsEditor.sectionList.addSectionButton"),e[3]=B,e[4]=Q):Q=e[4];let ge;return e[5]!==y||e[6]!==V||e[7]!==w||e[8]!==K||e[9]!==Q?(ge=r.jsxs(Ut,{type:"button",variant:"outline",size:V,className:w,disabled:K,onClick:y,children:[k,Q]}),e[5]=y,e[6]=V,e[7]=w,e[8]=K,e[9]=Q,e[10]=ge):ge=e[10],ge}function _c(v){const e=jn.c(101),{listKey:p,rawSections:y,sections:b,meta:V,decofile:B,selectedIndex:w,onSelect:K,onReorder:k,onDelete:Q,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Oe,onToggleLazy:Ne,onAddVariant:oe,onDetach:R,onAddSection:c,canAddSection:xe}=v,U=xe===void 0?!0:xe,_e=Rn(),F=Qn();let ke;e[0]!==b.length?(ke=()=>_a(b.length),e[0]=b.length,e[1]=ke):ke=e[1];const[f,ze]=S.useState(ke),[u,Re]=S.useState(null),[X,$e]=S.useState(p),[rt,Ce]=S.useState(b.length),at=S.useRef(!1);X!==p?($e(p),Ce(b.length),ze(_a(b.length))):rt!==b.length&&(Ce(b.length),ze(Fe=>hc(Fe,b.length)));let Pe;e[2]===Symbol.for("react.memo_cache_sentinel")?(Pe={activationConstraint:{distance:8}},e[2]=Pe):Pe=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={coordinateGetter:Zl},e[3]=_):_=e[3];const we=zl(Sa(Hl,Pe),Sa($l,_));let ot;e[4]!==f?(ot=f.map(kc),e[4]=f,e[5]=ot):ot=e[5];const it=ot;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=Fe=>{Re(String(Fe.active.id))},e[6]=m):m=e[6];const L=m;let et;e[7]!==it||e[8]!==k?(et=Fe=>{Re(null);const{active:G,over:ie}=Fe;if(!ie||G.id===ie.id)return;const Ve=it.indexOf(String(G.id)),Qe=it.indexOf(String(ie.id));Ve===-1||Qe===-1||(ze(nt=>Aa(Zn([...nt],Ve,Qe))),at.current=!0,requestAnimationFrame(()=>{at.current=!1}),k?.(Ve,Qe))},e[7]=it,e[8]=k,e[9]=et):et=e[9];const A=et;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Re(null)},e[10]=Ye):Ye=e[10];const W=Ye;let lt,fe,Ze,ve,ct,He,Ee,Ke,tt,Me,Be,De,Y,Z,ee;if(e[11]!==u||e[12]!==U||e[13]!==F||e[14]!==B||e[15]!==f||e[16]!==it||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==oe||e[21]!==Q||e[22]!==R||e[23]!==ge||e[24]!==Ue||e[25]!==K||e[26]!==Oe||e[27]!==Ne||e[28]!==y||e[29]!==b||e[30]!==w||e[31]!==we||e[32]!==_e){Z=Symbol.for("react.early_return_sentinel");e:{const Fe=G=>{at.current||K(G)};if(e[48]!==u||e[49]!==U||e[50]!==F||e[51]!==f||e[52]!==c||e[53]!==y||e[54]!==b||e[55]!==_e){const G=u?f.find(ie=>ie.id===u):null;if(ve=G!=null?b[G.index]:null,Ze=G!=null?y[G.index]:void 0,f.length===0){let ie;e[59]!==_e?(ie=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=ie):ie=e[60];let Ve;e[61]!==ie?(Ve=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ie}),e[61]=ie,e[62]=Ve):Ve=e[62];const Qe=Ve;let nt;e[63]!==U||e[64]!==F||e[65]!==Qe||e[66]!==c?(nt=F?Qe:r.jsxs("div",{className:"space-y-2",children:[Qe,r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm"})]}),e[63]=U,e[64]=F,e[65]=Qe,e[66]=c,e[67]=nt):nt=e[67],Z=nt;break e}Y=ae(G&&"cursor-grabbing"),e[48]=u,e[49]=U,e[50]=F,e[51]=f,e[52]=c,e[53]=y,e[54]=b,e[55]=_e,e[56]=Ze,e[57]=ve,e[58]=Y}else Ze=e[56],ve=e[57],Y=e[58];fe=Gl,Ke=we,tt=Ul,Me=L,Be=A,De=W,lt=Jl,He=it,Ee=Ql,ee="space-y-1",ct=f.map(G=>{const ie=b[G.index];return ie?r.jsx(Sc,{sortableId:G.id,section:ie,raw:y[G.index],meta:V,decofile:B,selected:w===G.index,onSelect:()=>Fe(G.index),onDelete:()=>Q(G.index),onDuplicate:()=>ge(G.index),onMakeReusable:()=>Ue(G.index),onToggleHidden:()=>Oe(G.index),onToggleLazy:Ne?()=>Ne(G.index):void 0,onAddVariant:()=>oe(G.index),onDetach:()=>R(G.index)},G.id):null})}e[11]=u,e[12]=U,e[13]=F,e[14]=B,e[15]=f,e[16]=it,e[17]=A,e[18]=V,e[19]=c,e[20]=oe,e[21]=Q,e[22]=R,e[23]=ge,e[24]=Ue,e[25]=K,e[26]=Oe,e[27]=Ne,e[28]=y,e[29]=b,e[30]=w,e[31]=we,e[32]=_e,e[33]=lt,e[34]=fe,e[35]=Ze,e[36]=ve,e[37]=ct,e[38]=He,e[39]=Ee,e[40]=Ke,e[41]=tt,e[42]=Me,e[43]=Be,e[44]=De,e[45]=Y,e[46]=Z,e[47]=ee}else lt=e[33],fe=e[34],Ze=e[35],ve=e[36],ct=e[37],He=e[38],Ee=e[39],Ke=e[40],tt=e[41],Me=e[42],Be=e[43],De=e[44],Y=e[45],Z=e[46],ee=e[47];if(Z!==Symbol.for("react.early_return_sentinel"))return Z;let O;e[68]!==ct||e[69]!==ee?(O=r.jsx("div",{className:ee,children:ct}),e[68]=ct,e[69]=ee,e[70]=O):O=e[70];let N;e[71]!==lt||e[72]!==He||e[73]!==Ee||e[74]!==O?(N=r.jsx(lt,{items:He,strategy:Ee,children:O}),e[71]=lt,e[72]=He,e[73]=Ee,e[74]=O,e[75]=N):N=e[75];let me;e[76]!==Ze||e[77]!==ve||e[78]!==F||e[79]!==B||e[80]!==V?(me=ve?r.jsx("div",{className:ae("cursor-grabbing shadow-lift",Ca(ve,!1,F)),children:r.jsx(Na,{section:ve,raw:Ze,meta:V,decofile:B})}):null,e[76]=Ze,e[77]=ve,e[78]=F,e[79]=B,e[80]=V,e[81]=me):me=e[81];let We;e[82]!==me?(We=qo.createPortal(r.jsx(Wl,{dropAnimation:Ki,children:me}),document.body),e[82]=me,e[83]=We):We=e[83];let qe;e[84]!==fe||e[85]!==Ke||e[86]!==tt||e[87]!==Me||e[88]!==Be||e[89]!==De||e[90]!==N||e[91]!==We?(qe=r.jsxs(fe,{sensors:Ke,collisionDetection:tt,onDragStart:Me,onDragEnd:Be,onDragCancel:De,children:[N,We]}),e[84]=fe,e[85]=Ke,e[86]=tt,e[87]=Me,e[88]=Be,e[89]=De,e[90]=N,e[91]=We,e[92]=qe):qe=e[92];let Je;e[93]!==U||e[94]!==F||e[95]!==c?(Je=!F&&r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=U,e[94]=F,e[95]=c,e[96]=Je):Je=e[96];let T;return e[97]!==Y||e[98]!==qe||e[99]!==Je?(T=r.jsxs("div",{className:Y,children:[qe,Je]}),e[97]=Y,e[98]=qe,e[99]=Je,e[100]=T):T=e[100],T}function kc(v){return v.id}function wc(v,e,p,y){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const b=e.trim();if(!b)return Gt(v,p,y)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:ks(v,p,y)}:{kind:"noop"};const V=ws(v,p,y);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Dt(V.resolveType,V.data,b)};const B=Un(b),w=Yn(B,p);return w?{kind:"error",reason:"invalid-block-id",message:w}:{kind:"createBlock",blockId:B,blockData:Dt(V.resolveType,V.data,b),reference:ln(B)}}const ka="section-form-stale-save",jc=3;function wa(v,e,p){const y=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ea(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),b=Math.max(0,Math.min(e.pageVariantIndex,y.length-1)),V=y[b]?.sections??[];return{pageVariants:y,variantIndex:b,rawSections:V,parsedSections:wn(V,v,p)}}const ja=new WeakMap;let Rc=0;function Ec(v){let e=ja.get(v);return e===void 0&&(e=++Rc,ja.set(v,e)),e}function uf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:y=!0,previewUrl:b,currentPath:V,activePageBlockKey:B=null,activeGlobalBlockKey:w=null,externalSelection:K,onSaved:k,initialEditSeo:Q=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Oe,onFocusedBlockChange:Ne,onVariantPreviewOverride:oe,focusVariant:R}){const c=Rn(),xe=Ci(),U=xe?.taskId??null,_e=y?{orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:b}:null,[F,ke]=S.useState([]),{data:f,isLoading:ze}=fl(_e,{pollWhile:F.length>0}),{data:u,isLoading:Re}=xl(_e),X=Qn(),$e=xe?.virtualMcpId,Ce=il($e===e?e:null)?.metadata?.siteSlug??null,at=tc({virtualMcpId:e,branch:p,sandboxUrl:b}),Pe=ml(e,p),_=pl(Pe),we=Si(_),ot=!_,it=!!at||_,[m,L]=S.useState(null),[et,A]=S.useState(null),[Ye,W]=S.useState(null),[lt,fe]=S.useState(0),[Ze,ve]=S.useState(void 0),[ct,He]=S.useState(null),[Ee,Ke]=S.useState(null);R&&R.seq!==ct&&(He(R.seq),Ke(R));const[tt,Me]=S.useState(null),Be={index:tt,remember:Me},[De,Y]=S.useState(null),[Z,ee]=S.useState(null),[O,N]=S.useState([]),me=S.useRef(null),[We,qe]=S.useState(O.length);We!==O.length&&(qe(O.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Je,T]=S.useState(0),[Fe,G]=S.useState(null),[ie,Ve]=S.useState(null),[Qe,nt]=S.useState(null),[Pa,Yt]=S.useState(!1),[Ts,Xn]=S.useState(!1),En=S.useRef(null),[Vn,Ka]=S.useState(!0),[Zt,Tn]=S.useState(!1),[Ft,An]=S.useState(!1),[Te,cn]=S.useState(Q),[As,Ns]=S.useState(Q);Q&&!As&&(Ns(!0),cn(!0),L(null),A(null),W(null),N([])),!Q&&As&&Ns(!1);const[Ma,un]=S.useState(null),[Cs,Nn]=S.useState(void 0),[Ps,It]=S.useState([]),[Ks,Jt]=S.useState(0),[Ie,ut]=S.useState(0),[Ba,Le]=S.useState(null),[Qt,Ge]=S.useState(null),[Ms,Bs]=S.useState(null),Ds=Jo(),Fs=hl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),dn=zi({orgSlug:v,virtualMcpId:e,branch:p}),[Da,Fa]=S.useState(V),[Ia,La]=S.useState(B),[Oa,za]=S.useState(w);(Da!==V||Ia!==B||Oa!==w)&&(queueMicrotask(()=>dn.flush()),Fa(V),La(B),za(w),L(null),A(null),W(null),fe(0),Y(null),ee(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1),cn(!1),un(null),Nn(void 0),It([]),Jt(t=>t+1));const D=$i({orgSlug:v,virtualMcpId:e,branch:p}),fn=rl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Cn=Rl({orgSlug:v,virtualMcpId:e,branch:p}),Is=oc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=S.useState(!1),C=S.useRef(null),wt=S.useRef(null),gt=S.useRef(null),vt=S.useRef(null),Pn=S.useRef({}),Lt=S.useRef(null),mn=S.useRef(!1),pn=S.useRef(!1),Se=S.useRef(new Map),tn=S.useRef(!1),xt=S.useRef([]),es=S.useRef(new WeakSet);gl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=ne.current,i=new Set;n&&i.add(n);for(const l of[wt.current?.sectionIndex,o]){const d=l==null?void 0:s[l],E=l==null?void 0:a[l],h=d&&E?.isSavedBlock?Ss(d,E):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[C,gt,vt])l.current&&clearTimeout(l.current),l.current=null;wt.current=null,Se.current.clear(),n&&t.has(n)&&(Pn.current={})}});const ne=S.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ls,Os]=S.useState(0),[$a,Ha]=S.useState(0),zs=Qo(Pe,{orgSlug:v,virtualMcpId:e,branch:p}),$s=Xo(zs,F[0]?.blockKey??null,F[0]?ei(xn(F[0].plan.theirs)):null),[Wa,qa]=S.useState(null),ts=vl(v,e).epoch,[Ga,Ua]=S.useState(ts);if(!y||ze||Re)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ti,{className:"size-5 text-muted-foreground"})});if(!f||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ya=Vl(f,u),$=!!w,se=$?null:Tl(Ya,V,B),g=$?w:se?.key??null,Kn=$&&w?f[w]:void 0,Hs=$&&w&&Kn?Al(w,Kn):$&&w?w:"",Ot=!$&&g&&f[g]?f[g]:null,ns=Te&&f&&u&&g&&se?ta(f,{kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},u):null,Za=Te?Ot?.seo:void 0,Mn=Cs!==void 0?Cs:Za,Ja=Te?Hi(Mn):void 0,Ws=ns?.seoTypeOptions??[],qs=Te&&u?Wi(u):"",ss=Ma??Ja??{},Bn=Te&&ns?sc(ss,ns):null,Gs=Te&&Bn&&qi(Mn)?Gn(Bn,u):null,Us=Te?Gi(f,u)?.seoData:void 0,le=$?[{label:"Default",sections:[{__resolveType:w}]}]:Ea(Ot?.sections,f??{},_),St=le.length>1,J=Math.min(lt,le.length-1),ye=le[J],M=ye?.sections??[],ce=wn(M,f,_),Dn=!$&&Nl(Ot?.sections,_);if($&&w&&Ms!==w){Bs(w);const t=M[0],n=ce[0];if(t&&n){L(0),ut(0),N([]);const s=Rt(t,n,f,_);s&&(A(s.data),W(s.resolveType),Ge(null),Le(null))}}!$&&Ms!==null&&Bs(null),ne.current={rawSections:M,parsedSections:ce,decofile:f??{},activePageKey:g,pageVariants:le,variantIndex:J,sectionVariantIndex:Ie,selectedSectionIndex:m};const Qa=()=>({multivariate:Dn,index:J,variants:le.map(t=>({rule:t.rule})),lazyValues:_&&Dn&&yi(Ot?.sections?.variants?.[J]?.value)}),rs=(t,n)=>{if(!oe)return;if(!g||!Dn||t.length<=1){oe(null);return}const s={multivariate:!0,index:n,variants:t},a=_?xa(g,s):ba(g,s,f,u);oe(a.length>0?a:null)},as=oe&&g&&Dn&&St&&!ze&&!Re?g:null;if(as!==Wa&&(qa(as),as)){const t=le.map(s=>({rule:s.rule})),n=J;queueMicrotask(()=>rs(t,n))}const zt=(t,n,s)=>{if(!oe)return;if(!g){oe(null);return}const a=Qa(),o=_?xa(g,a):ba(g,a,f,u);if(!t||n<0){oe(o.length>0?o:null);return}const i={pageKey:g,page:a,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=_?lc(i):ic({...i,decofile:f,meta:u}),d=_?cc(o,l):[...o,...l];oe(d.length>0?d:null)},_t=(t,n,s,a=m??-1,o=!1)=>{const i=st(t,n);if(!i){A(null),W(null),Ge(null),Le(null),o&&zt(null,a,s);return}const d=qr(i,we)[s];if(!d){A(null),W(null),Ge(null),Le(null),o&&zt(null,a,s);return}const E=ai(d.value,f);A(E?.data??null),W(E?.resolveType??null);const{resolveType:h,formValue:x}=qt(d.rule,f,u??void 0);Ge(h),Le(x),o&&zt(i,a,s)},hn=t=>{Ve(null),fe(t),L(null),A(null),W(null),N([]);const n=le[t]?.rule,{resolveType:s,formValue:a}=qt(n,f??{},u??void 0);ee(s),Y(a),rs(le.map(o=>({rule:o.rule})),t)},Ys=(t,n)=>{const s=M[t],a=ce[t];if(!s||!a)return!1;const o=a.isMultivariate?st(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),ut(i),N([]),T(l=>l+1),a.isMultivariate)_t(s,a,i,t);else{const l=Rt(s,a,f,_);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),Ge(null),Le(null)}return!0},Zs=K?.index;if(K!==void 0&&(K?.seq??null)!==Ze&&(ve(K?.seq??null),typeof Zs=="number"&&Ys(Zs,0)),Ee&&($?Kn:Ot)){const t=Ee.pageVariant,n=!$&&t!==void 0&&t<le.length;if(n&&t!==J)hn(t);else{Ke(null);const{section:s,variant:a}=Ee;if($)a!==void 0&&(Me(a),N([]),T(o=>o+1));else if(s!==void 0&&Ys(s,a??0)){const o=M[s],i=ce[s],l=i.isMultivariate?st(o,i):null;l&&a!==void 0&&queueMicrotask(()=>zt(l,s,a))}else n&&hn(t)}}if(ts!==Ga){Ua(ts);const t=C.current!==null||Se.current.size>0||vt.current!==null||gt.current!==null||D.isPending||dn.isPending||F.length>0,n=m!==null&&Wr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=ce[m];if(N([]),T(o=>o+1),!s||!a)L(null),A(null),W(null);else if(a.isMultivariate)_t(s,a,Ie,m);else{const o=Rt(s,a,f,_);A(o?.data??null),W(o?.resolveType??null)}}!t&&Te&&(un(null),Nn(void 0),Jt(s=>s+1))}if(Ls!==$a){Ha(Ls);const t=m!==null?M[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(N([]),T(s=>s+1),n.isMultivariate)_t(t,n,Ie,m);else{const s=Rt(t,n,f,_);A(s?.data??null),W(s?.resolveType??null)}}const dt=F[0];if(dt){const{formBase:t,target:n}=dt,s=wa(f,n,_),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?gs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,f,_):null,i=ni(dt,o,l=>Gr(t,l));if(i){const d=[{...dt,...i,changedAgain:!0},...F.slice(1)];xt.current=d,ke(d)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:_?void 0:b??void 0,siteSlug:Ce},Fn=Ye&&u?Gn(Ye,u):null,ft=(t,n)=>{if(!g)return;C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=an(f,g,t,J,le);D.mutate({blockKey:g,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},$t=()=>{Ne?.(null),L(null),An(!1),A(null),W(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1)},Js=()=>Wr(me.current,document.activeElement),os=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),wt.current=null,q.error(t,{id:ka}),Js()){tn.current=!0;return}Os(n=>n+1)},Qs=()=>{!tn.current||Js()||xt.current.length>0||C.current!==null||mn.current||pn.current||Se.current.size>0||(tn.current=!1,Os(t=>t+1))},Xs=()=>{tn.current&&setTimeout(Qs,0)},er=t=>bl(Ds,Fs,t,Pe.kind==="protocol"?Pe:null),tr=t=>{Se.current.size!==0&&setTimeout(()=>{if(mn.current||pn.current)return;const n=[...Se.current.values()];Se.current.clear();for(const s of n)s()},t)},Xa=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=ne.current,o=Lt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:$,pageVariantIndex:s,sectionVariantIndex:a,schema:Fn}},vn=t=>{xt.current=t,ke(t)},eo=t=>{const n=xt.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:Jr(a.plan,a.choices,t.plan),fresh:Vi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||xn(a.plan.theirs)!==xn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(o)},nr=(t,n)=>{const s=xt.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if(xn(o.plan.mine)===xn(n))return!0;const i=Zr({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(d=>d!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:Jr(o.plan,o.choices,i)})),!0},to=t=>{const n=ne.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},no=()=>{const t=xt.current[0];if(!t)return null;const{formBase:n,target:s}=t;C.current&&wt.current?.sectionIndex===n.sectionIndex&&wt.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(C.current),C.current=null,wt.current=null),Se.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!nr(n,a)&&Sn(a,n.sectionIndex,0,s),xt.current[0]??null},so=()=>{const t=xt.current[0],n=no();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=hi(n.plan,n.choices);Pe.kind==="protocol"&&Pe.source==="github"&&gi(n.plan,n.choices)&&Sl(c,!1),vn(xt.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,es.current.add(a),(Lt.current===a||to(n))&&(Lt.current=a,A(s),T(i=>i+1)),Sn(s,a.sectionIndex,0,o)},ro=t=>{const[n,...s]=xt.current;n&&vn([{...n,choices:t},...s])},Sn=(t,n,s=0,a,o=!1)=>{const i=a??Xa(n),l=i.sectionVariantIndex,d=i.formBase,E=wt.current;C.current&&(clearTimeout(C.current),C.current=null,E&&(E.sectionIndex!==n||E.sectionVariantIndex!==l)&&E.write());const h=`${i.pageKey}:${n}:${l}`,x=()=>{if(mn.current||pn.current){Se.current.set(h,x);return}const j=typeof t=="function"?t():t;if(d&&nr(d,j))return;const I=ne.current.decofile,{rawSections:P,parsedSections:pe,pageVariants:ue,variantIndex:be}=wa(I,i,_),z=i.pageKey,H=P[n];if(!H)return;const re=pe[n];if(!re)return;const he=d?.base,Ae=gs(H,re,l,I,_),sn=!!he&&!!Ae&&xi(he,Ae)&&!(d&&Gr(d,Ae));if(sn&&he&&Ae){if(_i(he,Ae)){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const te=re.isSavedBlock?"here":ki(he,P.map((de,ht)=>gs(de,pe[ht],l,I,_)),n,d?.sectionCount??P.length);if(te==="unknown"){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof te=="number"&&d){d.sectionCount=P.length,d.sectionIndex=te,Lt.current===d&&L(te),Sn(j,te,s,i);return}}const pt=sn&&he&&Ae?Zr({ancestor:he,mine:j,theirs:Ae}):null;if(pt&&pt.pointers.length>0&&d){d.sectionCount=P.length,eo({plan:pt,formBase:d,target:i,sectionIndex:n,choices:wi(pt),changedAgain:!1,blockKey:re.isSavedBlock?Ss(H,re):z,fresh:{}});return}const Xe=pt?pt.merged:null,Pt=Xe??j,zr=ji({merged:!!Xe,tracked:d,current:Lt.current,saved:j});Xe&&q.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:ka}),zr&&d&&(d.emitted=Xe,A(Xe));const hs=zr||!Xe?Pt:j;d&&(d.base=hs,d.sectionCount=P.length,Ri(d,hs));const $r={onSuccess:()=>{d&&es.current.delete(d),k?.()},onError:te=>{if(d?.base===hs&&he&&(d.base=he),te instanceof yl){if(d&&(d.version=void 0),s<jc){Se.current.delete(h),pn.current=!0;const de=Ti(s,te.carriedStored);setTimeout(()=>{pn.current=!1,Sn(()=>{const ht=d?.emitted;return ht&&typeof ht=="object"?ht:j},n,s+1,i,de.immediate),Se.current.delete(h),tr(_n)},de.delay)}else os();return}D.reportError(te)}},Hr=te=>{mn.current=!0;let de=!1;D.mutateAsync(te).then(()=>$r.onSuccess(),ht=>{de=!0,$r.onError(ht)}).finally(()=>{mn.current=!1,tr(de?_n:0),Qs()})};if(re.isSavedBlock){const te=Ss(H,re);if(!te)return;Hr({blockKey:te,data:Pt,...he?{base:{value:Xe?Ae:he}}:{},rebaseOnConflict:!1,guard:Xr({formBase:d,rebased:!!Xe,versionOf:er})});return}if(!z)return;const Hn={...I[z]},Wt=[...P];if(re.isMultivariate){const te=st(H,re);if(!te||!z)return;const de=Ei(te,l,Pt);Wt[n]=Kt(H,re,de)}else if(re.isHidden){const te=Vs(H.__resolveType),de=te?{...H.section}:{...H},ht=Array.isArray(de.variants)?[...de.variants]:[];ht[0]&&(ht[0]=Qr(de.__resolveType,ht[0],Pt)),de.variants=ht,te?Wt[n]={...H,section:de}:Wt[n]=de}else re.isLazy?Wt[n]={...H,section:Pt}:Wt[n]=Pt;if(ue.length>1){const te=Hn.sections,de=[...te?.variants??[]];de[be]&&(de[be]=Qr(te?.__resolveType,de[be],Wt)),Hn.sections={...te,variants:de}}else Hn.sections=Wt;Hr({blockKey:z,data:Hn,rebaseOnConflict:!1,guard:Xr({formBase:null,rebased:!1,versionOf:er})})};if(wt.current={sectionIndex:n,sectionVariantIndex:l,write:x},o){wt.current=null,x();return}C.current=setTimeout(()=>{C.current=null,x()},_n)},ao=t=>{tn.current=!1,L(t),ut(0),N([]),T(o=>o+1);const n=M[t],s=ce[t];if(Ne?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){_t(n,s,0,t);return}const a=Rt(n,s,f,_);if(!a){A(null),W(null),Ge(null),Le(null),zt(null,t,0);return}A(a.data),W(a.resolveType),Ge(null),Le(null),zt(null,t,0)},sr=t=>{const n=t;m!==null&&(Lt.current=vi(Lt.current,{sectionIndex:m,variantIndex:ne.current.sectionVariantIndex,shown:et,next:n,sectionCount:ne.current.rawSections.length})),A(n),m!==null&&Sn(n,m)},is=t=>{if(!g||!f||!u||!se)return;const n={kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},s=ta(f,n,u);s&&dn.save(g,()=>{const a=Ds.getQueryData(bi.decofile(Fs))?.[g];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Pn.current};return Pn.current={},t?.raw!==void 0?rc(o,t.raw,u):t?.inner!==void 0?ac(n,s,o,t.inner):o})},rr=(t,n)=>{g&&(Pn.current[t]=n,is())},oo=(t,n)=>{if(!g)return;const s=Zn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),ft(s)},io=t=>{if(!g)return;const n=M.filter((s,a)=>a!==t);m===t?$t():m!==null&&m>t&&L(m-1),ft(n)},lo=t=>{if(!g)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,al(n)),m!==null&&m>t&&L(m+1),ft(s)},co=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s)return;const a=s.isHidden?fi(n,_):mi(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},uo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const a=di(n);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},fo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const a=Rt(n,s,f,_);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&$t(),ft(l)},mo=t=>{if(!g)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;ft(n,{onError:()=>{ne.current.selectedSectionIndex===s&&$t()}}),Yt(!1),L(s),ut(0),N([]),T(l=>l+1);const a=n[s],o=wn(n,f,_)[s];if(!a||!o)return;if(o.isMultivariate){_t(a,o,0);return}const i=Rt(a,o,f,_);if(!i){A(null),W(null),Ge(null),Le(null);return}A(i.data),W(i.resolveType),Ge(null),Le(null)},ar=t=>{En.current=t.append,Yt(!0)},po=t=>{const n=En.current;if(!n){mo(t);return}n({__resolveType:t.resolveType}),Yt(!1),En.current=null},or=t=>{if(m===null)return;const n=M[m],s=ce[m];!n||!s?.isMultivariate||(ut(t),N([]),T(a=>a+1),_t(n,s,t,m,!0))},ho=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ci(a,t);if(!o){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Kt(n,s,o);const l=o.variants;let d=Ie;t===Ie?d=Math.min(t,l.length-1):t<Ie&&(d=Ie-1),ut(d),N([]),T(E=>E+1),_t(i[m],s,d),ft(i)},go=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ui(a,t,_),i=[...M];i[m]=Kt(n,s,o);const l=Yr(a.variants??[],t,_);ut(l),N([]),T(d=>d+1),_t(i[m],s,l,m,_),ft(i)},vo=(t,n)=>{if(m===null||!g||t===n)return;const s=M[m],a=ce[m];if(!s||!a?.isMultivariate)return;const o=st(s,a);if(!o)return;const i=ii(o,t,n),l=[...M];l[m]=Kt(s,a,i);let d=Ie;Ie===t?d=n:t<Ie&&n>=Ie?d=Ie-1:t>Ie&&n<=Ie&&(d=Ie+1),ut(d),_t(l[m],a,d,m,_),ft(l)},yn=t=>{const n=t??m;if(n===null||!g)return;const s=M[n],a=ce[n];if(!s||!a)return;const o=oi(s,a,void 0,u,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=wn(i,f,_)[n];if(!l?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),ut(o.newVariantIndex),N([]),T(d=>d+1),_t(o.section,l,o.newVariantIndex,n,_),ft(i)},ir=()=>{if(m===null||!g)return;const t=M[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=st(t,n);if(!s)return;const a=li(t,n,s);if(!a){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=wn(o,f,_)[m];if(!i)return;ut(0),Ge(null),Le(null),N([]),T(d=>d+1);const l=Rt(a,i,f,_);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),zt(null,m,0),ft(o)},So=async t=>{if(Fe===null||!g)return;const n=Yn(t,f,u);if(n){q.error(n);return}const s=M[Fe],a=ce[Fe];if(!s||!a)return;const o=Rt(s,a,f,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),d=[...M];d[Fe]={__resolveType:t},await D.mutateAsync({blockKey:g,data:an(f,g,d,J,le)}),m===Fe&&$t(),G(null),qn(l)||q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){q.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Mt(c,Bt(l))})}},lr=ye?.rule;if(St&&m===null&&Z===null&&lr){const{resolveType:t,formValue:n}=qt(lr,f??{},u??void 0);ee(t),Y(n)}const nn=u?Ui(u):[],ls=u&&f?Yi(u,f):[],Ht=_&&u&&f?_l(u,f):[],cs=(t,n)=>{if(Ht.length===0)return;const s=Pl(t);return{kinds:Ht,selected:s,campaignPrefill:kl(t),onPick:n}},cr=!$&&!!(it&&u&&f),ur=Z&&u?Gn(Z,u):null,yt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},kt=async(t,n)=>{if(!(Dl(n,t,u)>0))try{await Cn.mutateAsync({blockKey:t})}catch(s){q.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Mt(c,Bt(s))})}},dr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],d=l[a],E=d?.rule;if(Gt(E,s,u)){const h=E?.__resolveType??"",x=s[h],j=typeof x?.name=="string"?x.name:h,{__resolveType:I,...P}=t;D.mutate({blockKey:h,data:Dt(I??"",P,j)},{onSuccess:()=>k?.(),onError:D.reportError});return}d&&(l[a]={...d,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},_n)},fr=t=>{ee(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Y(t?n:{}),dr(n)},mr=t=>{const n=t;Y(n);const s=Z?{__resolveType:Z,...n}:{...n};dr(s)},In=async(t,n,s)=>{const a=wl(n,t);if(!a.ok)return a.reason==="conflict"&&q.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ma),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Is.apply({writes:o})).ok?null:(a.blockWrite&&q.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ma,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},pr=Ht.length>0?{kinds:Ht,prepare:async t=>(await In(t,ne.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Kl(ne.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Is.apply({writes:{[Ml(t).blockKey]:n.block}})).ok}}:null,hr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;let o=null;const i=await In(t,s,E=>{const h=s[n],x=h?.sections;if(!x||typeof x!="object"||Array.isArray(x))return null;const j=x;if(!Array.isArray(j.variants))return null;const I=[...j.variants],P=I[a];return P?(o=bt(P.rule,s,u),I[a]={...P,rule:E},{blockKey:n,data:{...h,sections:{...j,variants:I}}}):null});if(!i)return;const{resolveType:l,formValue:d}=qt(i.rule,i.projected,u??void 0);ee(l),Y(d),o&&await kt(o,i.projected),k?.()},gr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[a];if(!E)return;const h=bt(E.rule,s,u),x=ln(t);d[a]={...E,rule:x};const j={...s,[n]:{...o,sections:{...l,variants:d}}},{resolveType:I,formValue:P}=qt(x,j,u??void 0);ee(I),Y(P);try{await D.mutateAsync({blockKey:n,data:j[n]}),h&&h!==t&&await kt(h,j),k?.()}catch(pe){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(pe))})}},vr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=ne.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const P=(j.variants??[])[s]?.rule;if(Gt(P,i,u)){const z=P?.__resolveType??"",H=i[z],re=typeof H?.name=="string"?H.name:z,{__resolveType:he,...Ae}=t;D.mutate({blockKey:z,data:Dt(he??"",Ae,re)},{onSuccess:()=>k?.(),onError:D.reportError});return}const pe=vs(j,s,t),ue=[...a];ue[n]=Kt(h,x,pe);const be=an(i,l,ue,E,d);D.mutate({blockKey:l,data:be},{onSuccess:()=>k?.(),onError:D.reportError})},_n))},yo=t=>{Ge(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Le(t?n:{}),vr(n)},bo=t=>{const n=t;Le(n);const s=Qt?{__resolveType:Qt,...n}:{...n};vr(s)},xo=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;let h=null;const x=await In(t,i,P=>{const pe=a[n],ue=o[n];if(!pe||!ue?.isMultivariate)return null;const be=st(pe,ue);if(!be)return null;const z=be.variants??[];h=bt(z[s]?.rule,i,u);const H=[...a];return H[n]=Kt(pe,ue,vs(be,s,P)),{blockKey:l,data:an(i,l,H,E,d)}});if(!x)return;const{resolveType:j,formValue:I}=qt(x.rule,x.projected,u??void 0);Ge(j),Le(I),h&&await kt(h,x.projected),k?.()},_o=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=bt(I[s]?.rule,i,u),pe=ln(t),ue=vs(j,s,pe),be=[...a];be[n]=Kt(h,x,ue);const z=an(i,l,be,E,d),H={...i,[l]:z},{resolveType:re,formValue:he}=qt(pe,H,u??void 0);Ge(re),Le(he);try{await D.mutateAsync({blockKey:l,data:z}),P&&P!==t&&await kt(P,H),k?.()}catch(Ae){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(Ae))})}};if(!$&&!se)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if($&&!Kn)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?ce[m]??null:null,Sr=m!==null?M[m]:null,yr=Sr&&je?.isMultivariate?st(Sr,je):null,At=yr?qr(yr,we):[],Ln=Math.min(Ie,Math.max(At.length-1,0)),jt=At[Ln]??null,Nt=je?.isMultivariate===!0,us=m!==null&&je!==null,Ct=us&&(Nt||!!(Fn&&et)),ko=Ct&&!$&&je?.isSavedBlock===!0,mt=$||ko,br=$?Hs:je?.label??"",wo=Qt&&u?Gn(Qt,u):null,xr=(t,n)=>n&&X?`${t} · ${n}`:t,_r=je?je.variantOf??je.label:"",jo=(()=>{const t=Nt&&jt?jt.label:null;return t?X?[xr(_r,t)]:[je.label,t]:[je?.label??""]})(),ds=xr(se?.name??"",St?ye?.label:null),On=Ct&&(!$||O.length>0)?$?[Hs,...O]:[ds,...jo,...O]:[],kr=Te&&se?[se.name,"SEO",...Ps]:[],wr=c("sectionsEditor.pageVariantTabs.variantsLabel"),jr=Zt&&se?[se.name,wr]:Ft&&se&&je?[ds,_r,wr]:[],zn=jr.length>0?jr:kr.length>0?kr:mt?On.length>0?On:[br]:On.length>0?On:[ds],Rr=us&&!Nt&&!je?.isHidden&&!!g,Ro=mt||!$&&St&&!!ye||Rr,Eo=us&&!Nt&&!$&&O.length===0&&!!je&&Ra(je)&&!!g,Vo=X&&Ct&&!Ft&&Nt&&O.length===0&&!!jt,Er=X&&O.length>0?na(O[O.length-1]):null,To=O.length>1?na(O[O.length-2]):null,Vr=mt?br:Ct?je?.label??"":se?.name??"",Ao=Zt||Ft?c("sectionsEditor.pageVariantTabs.variantsLabel"):Te?c("sectionsEditor.panelSections.seo"):Er??Vr,Tr=Ft?je?.variantOf??je?.label??"":Zt||Te?se?.name??"":Er?To??Vr:mt?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Ct?se?.name??"":se?.path??"",fs=!Zt&&!Ft&&!Te&&!Ct&&!mt,No=!X&&!Te&&!$&&Nt&&O.length===0,bn=()=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const t=f[g],n=Cl(t.sections,M,u,_);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),L(null),A(null),W(null),N([]),Y(null),ee(null)},onError:D.reportError})},$n=(t,n,s)=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const a=f[g],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const d=Bl(i,l),E={...f,[g]:{...a,sections:d}};D.mutate({blockKey:g,data:E[g]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const x of h)await kt(x,E)})()},onError:D.reportError})},Ar=(t,n)=>{if(t===n)return;let s=J;J===t?s=n:t<J&&n>=J?s=J-1:t>J&&n<=J&&(s=J+1),fe(s);const a=Zn(le.map(o=>({rule:o.rule})),t,n);rs(a,s),$n(o=>Zn(o,t,n))},Nr=t=>{const n=le[t]?.rule,s=bt(n,f??{},u??void 0);$n(a=>a.length<=1?null:(a.splice(t,1),a),()=>{le.length-1===1?fe(0):t<J?fe(J-1):t===J&&fe(Math.max(0,t-1)),L(null),A(null),W(null),N([]),Y(null),ee(null)},s)},Co=()=>{const t=le.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!pi(n.rule)).map(({variant:n})=>bt(n.rule,f??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Ai({variants:n}),a=n[s];return a?[{...a,rule:Ni(u)}]:null},()=>{fe(0),L(null),A(null),W(null),N([]),Y(null),ee(null),Tn(!1)},t)},Cr=t=>{let n=t+1;$n(s=>(n=Yr(s,t,_),Fl(s,t,_)),()=>{fe(n),L(null),A(null),W(null),N([]),Y(null),ee(null)})},Po=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const s=ne.current.activePageKey,a=ne.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[t];if(!E?.rule||typeof E.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=E.rule,x=n.trim();en(!0);try{if(!x){if(!Gt(h,a,u)){Ve(null);return}const z=h.__resolveType??"";d[t]={...E,rule:ks(h,a,u)};const H={...a,[s]:{...o,sections:{...l,variants:d}}};await D.mutateAsync({blockKey:s,data:H[s]}),await kt(z,H),Ve(null),k?.();return}const j=ws(h,a,u);if(!j){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(j.blockKey){await D.mutateAsync({blockKey:j.blockKey,data:Dt(j.resolveType,j.data,x)}),Ve(null),k?.();return}const I=Un(x),P=Yn(I,a,u);if(P){q.error(P);return}const pe=Dt(j.resolveType,j.data,x);let ue=null,be=!1;try{const z=await D.mutateAsync({blockKey:I,data:pe,create:!0});be=qn(z),ue=be?null:I,d[t]={...E,rule:ln(I)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:d}}}),ue=null}catch(z){throw ue&&await Cn.mutateAsync({blockKey:ue}).catch(()=>{}),z}Ve(null),be||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:x})),k?.()}catch(j){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(j))})}finally{en(!1)}},Ko=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(s===null||!l)return;const h=a[s],x=o[s];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=I[t];if(!P?.rule||typeof P.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const pe=P.rule,ue=n.trim();en(!0);const be=async z=>{const H={...j,variants:z},re=[...a];re[s]=Kt(h,x,H);const he=an(i,l,re,E,d);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!ue){if(!Gt(pe,i,u)){nt(null);return}const pt=pe.__resolveType??"",Xe=[...I];Xe[t]={...P,rule:ks(pe,i,u)};const Pt=await be(Xe);await kt(pt,Pt),nt(null),k?.();return}const z=ws(pe,i,u);if(!z){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(z.blockKey){await D.mutateAsync({blockKey:z.blockKey,data:Dt(z.resolveType,z.data,ue)}),nt(null),k?.();return}const H=Un(ue),re=Yn(H,i,u);if(re){q.error(re);return}const he=Dt(z.resolveType,z.data,ue);let Ae=null,sn=!1;try{const pt=await D.mutateAsync({blockKey:H,data:he,create:!0});sn=qn(pt),Ae=sn?null:H;const Xe=[...I];Xe[t]={...P,rule:ln(H)},await be(Xe),Ae=null}catch(pt){throw Ae&&await Cn.mutateAsync({blockKey:Ae}).catch(()=>{}),pt}nt(null),sn||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),k?.()}catch(z){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(z))})}finally{en(!1)}},Pr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Mo={rename:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],d=l?.rule&&typeof l.rule=="object"?l.rule:void 0,E=async x=>{const j={...t,variants:x};return await Pr(a,t,j),{...o,[a]:j}},h=wc(d,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){q.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const I=[...i];I[n]={...l,rule:h.inlinedRule};const P=await E(I);await kt(h.blockKey,P),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let x=null,j=!1;try{const I=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});j=qn(I),x=j?null:h.blockId;const P=[...i];P[n]={...l,rule:h.reference},await E(P),x=null}catch(I){throw x&&await Cn.mutateAsync({blockKey:x}).catch(()=>{}),I}j||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(x))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const d=bt(l.rule,o,u);i[n]={...l,rule:ln(s)};const E={...t,variants:i},h={...o,[a]:E};try{await Pr(a,t,E),d&&d!==s&&await kt(d,h),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(x))})}},selectNamedRule:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;let i=null,l=null;const d=await In(s,o,E=>{const h=Array.isArray(t.variants)?[...t.variants]:[],x=h[n];return x?(i=bt(x.rule,o,u),h[n]={...x,rule:E},l={...t,variants:h},{blockKey:a,data:l}):null});!d||!l||(A(l),i&&await kt(i,d.projected),k?.())}},Kr=()=>{$t()},Mr=t=>{un(t),is({inner:t})},Br=t=>{Nn(t),is({raw:t})},Dr=()=>{un(null),It([])},Fr=()=>Jt(t=>t+1),Ir=()=>{dn.flush(),cn(!1),un(null),Nn(void 0),It([]),Jt(t=>t+1),ge?.()},Bo=()=>{Tn(!1),An(!1),L(null),cn(!0)},Do=()=>{Te&&Ir(),L(null),Tn(!0)},Fo=()=>An(!0),ms=t=>{if(Zt&&t===0){Tn(!1);return}if(Ft&&t<2){An(!1),t===0&&L(null);return}if(Te){if(t===0){Ir();return}if(t===1){It([]),Jt(s=>s+1);return}It(Ps.slice(0,t-1)),Jt(s=>s+1);return}if($){N(O.slice(0,t)),T(s=>s+1);return}if(t===0){Kr();return}if(t===1){N([]),T(s=>s+1);return}const n=!X&&Nt&&jt?1:0;if(n===1&&t===2){N([]),T(s=>s+1);return}N(O.slice(0,t-1-n))},ps=zn.length>1?r.jsx("button",{type:"button",onClick:()=>ms(ol(zn.length,{isMultivariateSectionTop:No})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ae("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",mt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(dl,{className:"size-4"})}):null,Io=mt||Ct||Te?Ro&&r.jsxs("div",{className:ae("border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!$&&St&&ye&&r.jsxs("button",{type:"button",onClick:Kr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ye.label}),className:ae("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Ji),children:[r.jsx(Zi,{rule:xs(ye.rule,f??{},u??void 0),matchers:nn}),r.jsx("span",{className:"max-w-[160px] truncate",children:ye.label})]}),r.jsx("div",{className:"flex-1"}),mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Rr&&r.jsx(Wn,{onClick:()=>yn()})]}),mt&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr,variant:"header"})}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>cn(!0),children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Oe&&g?Oe():Xn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Wn,{onClick:bn})]}),Lo=r.jsxs(r.Fragment,{children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:J,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&Z!==null&&r.jsx(aa,{className:"mt-3",children:r.jsx("div",{className:ae("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:Z,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Ht),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${J}:${Z??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})})]}),Lr=r.jsxs(r.Fragment,{children:[r.jsx(Qi,{listKey:`${g??""}:${m??""}`,variants:At.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:or,onRename:nt,onDuplicate:go,onDelete:ho,onRemoveAll:ir,onReorder:vo,onAdd:()=>yn()}),r.jsx(aa,{children:r.jsx(ys,{currentRt:Qt??"",currentLabel:kn(jt?.rule,f??{},we,u??void 0),currentGlobalKey:bt(jt?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:yo,onSelectGlobal:_o,named:cs(jt?.rule,xo),namedRow:bs(jt?.rule,Ht),rule:jt?.rule,schema:wo,formValue:Ba,onChange:bo,formKey:`${m??"none"}:${Ln}:${Qt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or=r.jsx("div",{className:ae(X?"px-2":"p-2 pt-3"),children:r.jsx(_c,{listKey:`${g??""}-${J}`,rawSections:M,sections:ce,meta:u,decofile:f,selectedIndex:m,onSelect:ao,onReorder:oo,onDelete:io,onDuplicate:lo,onMakeReusable:G,onToggleHidden:co,onToggleLazy:ot?uo:void 0,onAddVariant:yn,onDetach:fo,onAddSection:()=>Yt(!0),canAddSection:cr})}),Oo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&se&&r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr}),Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Ws,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),zo=r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Ws,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),$o=r.jsxs(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:J,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&Z!==null&&r.jsxs("div",{className:ae("px-3 border-b",Vn?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Ka(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":Vn,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),Vn?r.jsx(ll,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(cl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Vn&&r.jsx("div",{className:ae("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:Z,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Ht),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${J}:${Z??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or]},"editor-section-list");return r.jsx(Xi,{value:_,children:r.jsx(el,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&ps&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ps}),(X||zn.length>1)&&r.jsx(tl,{crumbs:zn,onSelect:ms,onSelectRoot:()=>{dn.flush(),Ue?Ue():ms(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:ae("flex items-center gap-2 border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&ps,mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Ao}),Tr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Tr})]}),fs&&St&&ye&&r.jsx(oa,{variants:le,activeIndex:J,onSelect:hn,onManage:Do,onRemoveAll:Co}),Vo&&r.jsx(oa,{variants:At,activeIndex:Ln,onSelect:or,onManage:Fo,onRemoveAll:ir}),fs&&!St&&r.jsx(Wn,{onClick:bn}),Eo&&r.jsx(Wn,{onClick:()=>yn()}),r.jsx(nl,{}),fs&&r.jsxs(r.Fragment,{children:[r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Bo,children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Oe&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Xn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Io}),dt&&r.jsx(si,{open:!0,fields:ri(dt.plan,dt.target.schema),choices:dt.choices,changedAgain:dt.changedAgain,author:$s??null,authorPending:$s===void 0,fieldsAsLabeled:zs!==null,fresh:dt.fresh,onChoose:(t,n)=>ro({...dt.choices,[t]:n}),onApply:so},Ec(dt.formBase)),Ft?r.jsx(ia,{onAdd:()=>yn(),children:Lr},"editor-section-variants"):Ct?r.jsxs(on,{viewportRef:me,onBlur:Xs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Nt&&At.length>0&&O.length===0&&Lr,r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Je,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar,onVariantMatcherOp:$?Mo:void 0})})})]},"editor-section-form"):$?r.jsx(on,{viewportRef:me,onBlur:Xs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Je,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar})})})},"editor-global-block"):Te?X?r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Oo})},"editor-seo"):zo:Zt?r.jsx(ia,{onAdd:bn,children:Lo},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Or})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Es,{canAddSection:cr,onAddSection:()=>Yt(!0)})})]},"editor-section-list"):$o,r.jsx(sl,{open:Fe!==null,onOpenChange:t=>{t||G(null)},defaultBlockId:Fe!==null?Un(ce[Fe]?.label??""):"",isPending:D.isPending,onSubmit:So}),it&&r.jsx(nc,{open:Pa,onOpenChange:t=>{Yt(t),t||(En.current=null)},meta:u,decofile:f,previewBaseUrl:at,onSelect:po}),Ts&&g&&f&&r.jsx(El,{open:Ts,onOpenChange:Xn,pageKey:g,decofile:f}),ie!==null&&r.jsx(ua,{open:!0,initialName:Gt(le[ie]?.rule,f??{},u??void 0)?kn(le[ie]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(le[ie]?.rule,f??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Po(ie,t)},onOpenChange:t=>{!t&&!Xt&&Ve(null)}}),Qe!==null&&r.jsx(ua,{open:!0,initialName:Gt(At[Qe]?.rule,f??{},u??void 0)?kn(At[Qe]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(At[Qe]?.rule,f??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Ko(Qe,t)},onOpenChange:t=>{!t&&!Xt&&nt(null)}})]})})})}export{uf as SectionsEditor};
1
+ import{hN as Ho,bh as Wo,c as jn,b as Rn,r as S,l as ae,j as r,bQ as qo,bd as Vs,hO as Ra,B as Ut,X as rn,aj as Go,Z as Uo,bg as Yo,Y as Zo,q as Jo,hm as Qo,hP as Xo,hQ as ei,bp as xn,h as ti,bi as Rt,hR as st,hS as Wr,hT as gs,hU as ni,hV as qr,hW as si,bw as ri,hX as ai,hY as Gr,hZ as oi,t as q,bZ as Ur,h_ as ii,h$ as Kt,i0 as li,i1 as ci,i2 as ui,bY as Yr,i3 as vs,i4 as di,i5 as fi,i6 as mi,bW as pi,bx as hi,i7 as gi,i8 as vi,bT as Si,f7 as yi,K as bi,bu as Zr,i9 as Jr,ia as xi,ib as _i,ic as ki,id as Ss,ie as wi,ig as ji,ih as Ri,ii as Ei,bR as Qr,ij as Vi,ik as Ti,il as Xr,im as Ai,bV as Ni}from"./index-CD3fj83c.js";import{u as Ci}from"./chat-context-B0QfMtK7.js";import{a2 as Pi,K as Qn,a3 as Ki,a4 as Mi,a5 as Bi,a6 as Di,a7 as Fi,a8 as Ii,a9 as ea,aa as Li,ab as Oi,z as Un,x as Yn,d as zi,u as $i,ac as ta,i as Hi,ad as Wi,k as qi,h as Gi,ae as Ea,af as Ui,ag as Yi,v as na,ah as Zi,ai as Ji,aj as Wn,ak as sa,al as ra,am as aa,an as ys,ao as Qi,D as Xi,ap as el,y as tl,aq as oa,ar as nl,as as ia,at as la,au as ca,M as sl,av as ua,a as rl,aw as an,ax as al,ay as ol,t as qn,az as _n}from"./held-block-view-CB3xOhYs.js";import{c as il}from"./repository-binding-BpxbVNK2.js";import{n as ll,t as cl}from"./ChevronUp-zgLSJo7N.js";import{a9 as Va,b as Jn,ao as ul,H as dl,a3 as da,$ as fa}from"./agent-icon-CXyyqpMa.js";import{S as on}from"./scroll-area-DfDFaLoK.js";import{c as Et,T as Vt,a as Tt}from"./tooltip-BFOA909d.js";import{l as fl,u as ml,m as pl,D as hl,a1 as gl,B as vl,ac as Mt,ad as Bt,N as Sl,ay as ma,Q as yl,Z as bl}from"./site-editor-toast-qpDJ9c8x.js";import{u as xl,X as _l,E as bs,Y as pa,A as kl,Z as wl}from"./blocks-tab-states-XuAlkDNG.js";import{m as jl,u as Rl,P as El}from"./mustache-Cse4SZP_.js";import{a0 as Gt,T as ks,az as ws,a1 as Dt,U as ln,e as Vl,c as Tl,w as Al,k as Gn,p as wn,a4 as Nl,_ as qt,V as xs,Z as bt,Y as kn,F as Cl,a2 as ha,$ as Pl,ai as Kl,ak as Ml,aA as Bl,aB as Dl,aC as Fl}from"./parse-sections-B9Tf8cb0.js";import{a as Il}from"./Copy01-BzoMFIdk.js";import{a as js,e as Ta}from"./UserSquare-BpdCC6Kq.js";import{i as ga}from"./Tool01-D_DzUkH6.js";import{s as va}from"./Image01-DqO4SvqB.js";import{s as Ll}from"./Plus-DCMQMI-9.js";import{s as Ol}from"./Trash01-D5WxxfhG.js";import{i as Rs}from"./ZoomOut-UKDGw6yq.js";import{u as zl,a as Sa,K as $l,P as Hl,b as Wl,C as ql,D as Gl,c as Ul}from"./core.esm-CJau0VZ_.js";import{u as Yl,s as Zl,a as Zn,S as Jl,v as Ql}from"./sortable.esm-DSLK_VXl.js";import{s as Xl,g as ec,u as tc,A as nc}from"./use-section-preview-base-QNrdx3XX.js";import{a as sc,P as ya,w as rc,b as ac}from"./page-seo-form-Dp0KuKjw.js";import{u as oc}from"./use-apply-named-rule-DlF_o_O9.js";import{b as ba,a as ic}from"./variant-matcher-override-CIWGPj0Z.js";import{c as xa,d as lc,e as cc}from"./variant-draft-pointer-BeAKcq_c.js";import"./use-panel-navigate-CrCScmoE.js";import"./thread-route-OlD3VCew.js";import"./use-project-scope-ejA4MhTG.js";import"./autosend-BgdlbO_i.js";import"./thread-intent-CIa2mqqt.js";import"./use-mcp-client-BHU-qsif.js";import"./auth-BdHhBAFh.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CF4IoX_h.js";import"./task-board-Bl8e1XTd.js";import"./schema-CZyOweh2.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-CQwRTT8g.js";import"./use-ai-providers-CehDWGIM.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-CHidLnF6.js";import"./utils-BzZnpE20.js";import"./Play-CjXmtBKS.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-o3WkMbxi.js";import"./LinkBroken01-DRUa5XT1.js";import"./collapsible-D7SyoWI6.js";import"./use-copy-AGiqroYo.js";import"./usage-stats-bTZK9s6S.js";import"./tool-namespace-DtJ2HF8a.js";import"./form-D31DoepE.js";import"./label-BjHcnejP.js";import"./utils-CVEq3hMx.js";import"./markdown-DCOlrq5H.js";import"./use-mobile-C7tjJGs8.js";import"./use-clock-tick-9j5u-Rtx.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CpTKqKhy.js";import"./types-BxxJTVxe.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-Ds_2WhXL.js";import"./XClose-CBoBcHI9.js";import"./ShoppingBag01-Bqi9yZ2c.js";import"./SearchMd-BPcibh2b.js";import"./shell-layout-BHS6wDGg.js";import"./Building02-Cf4X-d51.js";import"./use-deployment-admin-DtrC7GR5.js";import"./admin-fetch-BhTJlAsX.js";import"./CheckCircle-D7olxQBc.js";import"./Monitor01-is8ZyUQC.js";import"./command-DMjv9UCp.js";import"./index-BdgyAwPA.js";import"./integration-icon-DrUX7MlE.js";import"./project-icon-fmbPzLuQ.js";import"./new-project-dialog-t1kb5xiA.js";import"./ArrowLeft-GaJGcGPr.js";import"./repository-import-picker-BIa2KeQJ.js";import"./use-navigate-to-agent-BZyzGjVW.js";import"./repository-picker-D1FdmUjm.js";import"./useInfiniteQuery-BPkTbU3d.js";import"./infiniteQueryObserver-DIZnkeqn.js";import"./collection-search-ZYYfADQw.js";import"./use-debounced-value-Bvr3c0Bg.js";import"./required-auth-layout-CLzneFN8.js";import"./use-org-sso-C9Iucy6w.js";import"./sheet-BdF546xt.js";import"./use-connection-BUd2E1e4.js";import"./Link01-3o9Elk03.js";import"./use-mcp-prompts-DVKPAtxK.js";import"./use-thread-outputs-CAL5fh-E.js";import"./file-type-icon-BQOlt6bc.js";import"./section-array-field-oWK_IMJM.js";import"./alert-DtgstSU8.js";import"./switch-JNrraILQ.js";import"./textarea-DHsxWS9H.js";import"./ChevronSelectorVertical-ByzlNFqX.js";import"./popover-DNa0geGd.js";import"./monaco-editor-8NbaeYxI.js";import"./editor-BPHWgsFO.js";import"./calendar-DFYFqMKq.js";import"./SwitchHorizontal01-vlFzntYK.js";import"./Minus-kzkj_29B.js";import"./select-CEUzoC6o.js";import"./index-BdQq_4o_.js";import"./index-D4YmJ5bn.js";import"./editor-classes-DO0eVExg.js";import"./toggle-group-BFn7oikO.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BcG9kY9H.js";import"./Upload01-CCpxUc0U.js";import"./DotsVertical-DkVpKTIv.js";import"./search-input-Ce0LKLJH.js";import"./tabs-Dsn3YxbL.js";import"./use-file-configs-C87nAUnF.js";import"./asset-utils-D4yG02dq.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-session-runtime-DYJ3pOXd.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-Ve1cK4qn.js";import"./CreditCard01-DqirQppZ.js";import"./Globe04-CkFRv0Y2.js";import"./Key01-DWe6k94t.js";import"./Sun-ChTfaRFO.js";import"./Users01-BewLilnR.js";import"./experiments-tab-choice-9WDva_co.js";import"./use-sandbox-events-BbmfXv6n.js";import"./slider-C2GpxduI.js";import"./index-zj4emT8y.js";import"./tooltipContext-2V1j45YY.js";import"./CategoricalChart-BmgZ7uPj.js";import"./index-CeKKvvrE.js";import"./ActiveShapeUtils-CFnSXQrP.js";import"./Sector-BBrsL2eG.js";import"./symbol-DN0zRhCk.js";import"./empty-state-6fA1LS5m.js";import"./section-preview-url-7zfngvgW.js";import"./use-move-blocks-Co0993wA.js";const uc={escape:Pi};function dc(v,e){for(const p of Xl(v,e)){const y=typeof p.title=="string"?p.title:void 0;if(y?.includes("{{"))return y}}function fc(v,e){if(!e)return;const p=Ho(v,Wo(e));if(p)try{const y=dc(p.resolveType,e);return y&&jl.render(y,p.data,{},uc).trim()||void 0}catch{return}}function mc(v){const e=jn.c(13),{icon:p,label:y,className:b}=v;let V;e[0]!==b?(V=ae("size-3.5",b),e[0]=b,e[1]=V):V=e[1];let B;e[2]!==p||e[3]!==V?(B=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=B):B=e[4];let w;e[5]!==y||e[6]!==B?(w=r.jsx(Vt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":y,className:"shrink-0 cursor-help",children:B})}),e[5]=y,e[6]=B,e[7]=w):w=e[7];let K;e[8]!==y?(K=r.jsx(Tt,{className:"max-w-56",children:y}),e[8]=y,e[9]=K):K=e[9];let k;return e[10]!==w||e[11]!==K?(k=r.jsxs(Et,{children:[w,K]}),e[10]=w,e[11]=K,e[12]=k):k=e[12],k}const pc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function _a(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Aa(v){return v.map((e,p)=>({...e,index:p}))}function hc(v,e){if(e===v.length)return v;if(e<v.length)return Aa(v.slice(0,e));const p=Array.from({length:e-v.length},(y,b)=>({id:crypto.randomUUID(),index:v.length+b}));return[...v,...p]}function Na(v){const e=jn.c(44),{section:p,raw:y,meta:b,decofile:V}=v,B=Rn(),w=Qn(),K=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Q;e[0]!==b||e[1]!==y?(Q=y&&b?ec(y,b):void 0,e[0]=b,e[1]=y,e[2]=Q):Q=e[2];const ge=Q;let Ue;e[3]!==b||e[4]!==k||e[5]!==y||e[6]!==K?(Ue=y&&b&&!K&&!k?fc(y,b):void 0,e[3]=b,e[4]=k,e[5]=y,e[6]=K,e[7]=Ue):Ue=e[7];const Oe=Ue;let Ne;e[8]!==V||e[9]!==b||e[10]!==y||e[11]!==p?(Ne=Ii(y,p,V,b),e[8]=V,e[9]=b,e[10]=y,e[11]=p,e[12]=Ne):Ne=e[12];const oe=Ne;let R;e[13]!==k||e[14]!==y?.__resolveType?(R=!k&&Vs(y?.__resolveType??""),e[13]=k,e[14]=y?.__resolveType,e[15]=R):R=e[15];const c=R,xe=K?Jn:k?Va:Ta;let U;e[16]!==k||e[17]!==K?(U=K?{color:Yo}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=K,e[18]=U):U=e[18];const _e=U;let F;e[19]!==xe||e[20]!==w?(F=w?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Oi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(ul,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=w,e[21]=F):F=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let f;e[24]!==w||e[25]!==_e?(f=!w&&r.jsx(js,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=w,e[25]=_e,e[26]=f):f=e[26];const ze=w?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Re;e[27]!==u||e[28]!==ze?(Re=ae("min-w-0 truncate text-sm font-medium",ze,u),e[27]=u,e[28]=ze,e[29]=Re):Re=e[29];const X=Oe??p.label;let $e;e[30]!==Re||e[31]!==X?($e=r.jsx("span",{className:Re,children:X}),e[30]=Re,e[31]=X,e[32]=$e):$e=e[32];let rt;e[33]!==c||e[34]!==w||e[35]!==oe||e[36]!==B?(rt=w?r.jsxs(r.Fragment,{children:[c&&r.jsx(mc,{icon:Rs,label:B("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),oe&&r.jsx(ea,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):oe&&r.jsx(ea,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=w,e[35]=oe,e[36]=B,e[37]=rt):rt=e[37];let Ce;return e[38]!==$e||e[39]!==rt||e[40]!==F||e[41]!==ke||e[42]!==f?(Ce=r.jsxs(r.Fragment,{children:[F,ke,f,$e,rt]}),e[38]=$e,e[39]=rt,e[40]=F,e[41]=ke,e[42]=f,e[43]=Ce):Ce=e[43],Ce}const gc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vc="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function Ca(v,e,p){if(p)return Li({selected:e});const y=v.isSavedBlock===!0,b=v.isMultivariate===!0;return ae("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":y?gc:b?vc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function _s(v,e){return ae("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Sc(v){const e=jn.c(90),{section:p,raw:y,meta:b,decofile:V,sortableId:B,selected:w,onSelect:K,onDelete:k,onDuplicate:Q,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Oe,onAddVariant:Ne,onDetach:oe}=v,R=Rn(),c=Qn(),xe=y?Vs(y.__resolveType??""):!1,U=p.isHidden===!0,_e=xe||U;let F;e[0]!==p?(F=Ra(p),e[0]=p,e[1]=F):F=e[1];const ke=F,f=!!Oe&&!p.isMultivariate;let ze;e[2]!==B?(ze={id:B,animateLayoutChanges:xc},e[2]=B,e[3]=ze):ze=e[3];const{attributes:u,listeners:Re,setNodeRef:X,transform:$e,isDragging:rt}=Yl(ze);let Ce;e[4]!==$e?(Ce=ql.Transform.toString($e?{...$e,x:0}:null),e[4]=$e,e[5]=Ce):Ce=e[5];const at=rt?0:void 0;let Pe;e[6]!==Ce||e[7]!==at?(Pe={transform:Ce,opacity:at},e[6]=Ce,e[7]=at,e[8]=Pe):Pe=e[8];const _=Pe;let we;e[9]!==p?(we=Mi(p),e[9]=p,e[10]=we):we=e[10];const ot=we,it="button",m=0;let L;e[11]!==K?(L=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),K())},e[11]=K,e[12]=L):L=e[12];const et=rt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==w||e[16]!==et?(A=ae("touch-none transition-colors",et,Ca(p,w,c)),e[13]=c,e[14]=p,e[15]=w,e[16]=et,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==b||e[20]!==y||e[21]!==p?(Ye=r.jsx(Na,{section:p,raw:y,meta:b,decofile:V}),e[18]=V,e[19]=b,e[20]=y,e[21]=p,e[22]=Ye):Ye=e[22];const W=!c&&f&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ae(_s(_e,xe)),onClick:T=>{T.stopPropagation(),Oe?.()},onPointerDown:bc,children:r.jsx(Rs,{className:ae("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Tt,{side:"bottom",children:R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),lt=c?r.jsx(Bi,{label:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:U,onToggle:Ue,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})}):r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ae(_s(_e,U)),onClick:T=>{T.stopPropagation(),Ue()},onPointerDown:yc,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})})}),r.jsx(Tt,{side:"bottom",children:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=Uo,Ze=Di;let ve;e[23]!==R?(ve=R("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=R,e[24]=ve):ve=e[24];const ct=ae(_s(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let He;e[25]!==Ze||e[26]!==ve||e[27]!==ct?(He=r.jsx(Ze,{label:ve,classicClassName:ct}),e[25]=Ze,e[26]=ve,e[27]=ct,e[28]=He):He=e[28];let Ee;e[29]!==c||e[30]!==f||e[31]!==xe||e[32]!==Oe||e[33]!==R?(Ee=c&&f&&r.jsxs(r.Fragment,{children:[r.jsxs(rn,{onClick:T=>{T.stopPropagation(),Oe?.()},children:[r.jsx(Rs,{className:"h-4 w-4"}),R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(Go,{})]}),e[29]=c,e[30]=f,e[31]=xe,e[32]=Oe,e[33]=R,e[34]=Ee):Ee=e[34];let Ke;e[35]!==Q?(Ke=T=>{T.stopPropagation(),Q()},e[35]=Q,e[36]=Ke):Ke=e[36];let tt;e[37]===Symbol.for("react.memo_cache_sentinel")?(tt=r.jsx(Il,{className:"h-4 w-4"}),e[37]=tt):tt=e[37];let Me;e[38]!==R?(Me=R("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=R,e[39]=Me):Me=e[39];let Be;e[40]!==Ke||e[41]!==Me?(Be=r.jsxs(rn,{onClick:Ke,children:[tt,Me]}),e[40]=Ke,e[41]=Me,e[42]=Be):Be=e[42];let De;e[43]!==c||e[44]!==ke||e[45]!==Ne||e[46]!==R?(De=ke&&r.jsxs(rn,{className:ae(!c&&Fi),onClick:T=>{T.stopPropagation(),Ne()},children:[r.jsx(Va,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ne,e[46]=R,e[47]=De):De=e[47];let Y;e[48]!==c||e[49]!==ot||e[50]!==ge||e[51]!==R?(Y=ot&&r.jsxs(rn,{className:ae(!c&&pc),onClick:T=>{T.stopPropagation(),ge()},children:[c?r.jsx(Jn,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=ot,e[50]=ge,e[51]=R,e[52]=Y):Y=e[52];let Z;e[53]!==c||e[54]!==oe||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==R?(Z=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(rn,{onClick:T=>{T.stopPropagation(),oe()},children:[c?r.jsx(Ta,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=oe,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=R,e[58]=Z):Z=e[58];let ee;e[59]!==k?(ee=T=>{T.stopPropagation(),k()},e[59]=k,e[60]=ee):ee=e[60];let O;e[61]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(Ol,{className:"h-4 w-4"}),e[61]=O):O=e[61];let N;e[62]!==R?(N=R("sectionsEditor.sectionList.deleteMenuItem"),e[62]=R,e[63]=N):N=e[63];let me;e[64]!==ee||e[65]!==N?(me=r.jsxs(rn,{variant:"destructive",onClick:ee,children:[O,N]}),e[64]=ee,e[65]=N,e[66]=me):me=e[66];let We;e[67]!==Ee||e[68]!==Be||e[69]!==De||e[70]!==Y||e[71]!==Z||e[72]!==me?(We=r.jsxs(Zo,{align:"end",className:"w-44",children:[Ee,Be,De,Y,Z,me]}),e[67]=Ee,e[68]=Be,e[69]=De,e[70]=Y,e[71]=Z,e[72]=me,e[73]=We):We=e[73];let qe;e[74]!==fe||e[75]!==He||e[76]!==We?(qe=r.jsxs(fe,{children:[He,We]}),e[74]=fe,e[75]=He,e[76]=We,e[77]=qe):qe=e[77];let Je;return e[78]!==u||e[79]!==Re||e[80]!==K||e[81]!==X||e[82]!==_||e[83]!==A||e[84]!==Ye||e[85]!==W||e[86]!==lt||e[87]!==qe||e[88]!==L?(Je=r.jsxs("div",{ref:X,style:_,...u,...Re,role:it,tabIndex:m,onClick:K,onKeyDown:L,className:A,children:[Ye,W,lt,qe]}),e[78]=u,e[79]=Re,e[80]=K,e[81]=X,e[82]=_,e[83]=A,e[84]=Ye,e[85]=W,e[86]=lt,e[87]=qe,e[88]=L,e[89]=Je):Je=e[89],Je}function yc(v){return v.stopPropagation()}function bc(v){return v.stopPropagation()}function xc(){return!1}function Es(v){const e=jn.c(11),{canAddSection:p,onAddSection:y,className:b,size:V}=v,B=Rn();let w;e[0]!==b?(w=ae("w-full",b),e[0]=b,e[1]=w):w=e[1];const K=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ll,{size:14}),e[2]=k):k=e[2];let Q;e[3]!==B?(Q=B("sectionsEditor.sectionList.addSectionButton"),e[3]=B,e[4]=Q):Q=e[4];let ge;return e[5]!==y||e[6]!==V||e[7]!==w||e[8]!==K||e[9]!==Q?(ge=r.jsxs(Ut,{type:"button",variant:"outline",size:V,className:w,disabled:K,onClick:y,children:[k,Q]}),e[5]=y,e[6]=V,e[7]=w,e[8]=K,e[9]=Q,e[10]=ge):ge=e[10],ge}function _c(v){const e=jn.c(101),{listKey:p,rawSections:y,sections:b,meta:V,decofile:B,selectedIndex:w,onSelect:K,onReorder:k,onDelete:Q,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Oe,onToggleLazy:Ne,onAddVariant:oe,onDetach:R,onAddSection:c,canAddSection:xe}=v,U=xe===void 0?!0:xe,_e=Rn(),F=Qn();let ke;e[0]!==b.length?(ke=()=>_a(b.length),e[0]=b.length,e[1]=ke):ke=e[1];const[f,ze]=S.useState(ke),[u,Re]=S.useState(null),[X,$e]=S.useState(p),[rt,Ce]=S.useState(b.length),at=S.useRef(!1);X!==p?($e(p),Ce(b.length),ze(_a(b.length))):rt!==b.length&&(Ce(b.length),ze(Fe=>hc(Fe,b.length)));let Pe;e[2]===Symbol.for("react.memo_cache_sentinel")?(Pe={activationConstraint:{distance:8}},e[2]=Pe):Pe=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={coordinateGetter:Zl},e[3]=_):_=e[3];const we=zl(Sa(Hl,Pe),Sa($l,_));let ot;e[4]!==f?(ot=f.map(kc),e[4]=f,e[5]=ot):ot=e[5];const it=ot;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=Fe=>{Re(String(Fe.active.id))},e[6]=m):m=e[6];const L=m;let et;e[7]!==it||e[8]!==k?(et=Fe=>{Re(null);const{active:G,over:ie}=Fe;if(!ie||G.id===ie.id)return;const Ve=it.indexOf(String(G.id)),Qe=it.indexOf(String(ie.id));Ve===-1||Qe===-1||(ze(nt=>Aa(Zn([...nt],Ve,Qe))),at.current=!0,requestAnimationFrame(()=>{at.current=!1}),k?.(Ve,Qe))},e[7]=it,e[8]=k,e[9]=et):et=e[9];const A=et;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Re(null)},e[10]=Ye):Ye=e[10];const W=Ye;let lt,fe,Ze,ve,ct,He,Ee,Ke,tt,Me,Be,De,Y,Z,ee;if(e[11]!==u||e[12]!==U||e[13]!==F||e[14]!==B||e[15]!==f||e[16]!==it||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==oe||e[21]!==Q||e[22]!==R||e[23]!==ge||e[24]!==Ue||e[25]!==K||e[26]!==Oe||e[27]!==Ne||e[28]!==y||e[29]!==b||e[30]!==w||e[31]!==we||e[32]!==_e){Z=Symbol.for("react.early_return_sentinel");e:{const Fe=G=>{at.current||K(G)};if(e[48]!==u||e[49]!==U||e[50]!==F||e[51]!==f||e[52]!==c||e[53]!==y||e[54]!==b||e[55]!==_e){const G=u?f.find(ie=>ie.id===u):null;if(ve=G!=null?b[G.index]:null,Ze=G!=null?y[G.index]:void 0,f.length===0){let ie;e[59]!==_e?(ie=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=ie):ie=e[60];let Ve;e[61]!==ie?(Ve=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ie}),e[61]=ie,e[62]=Ve):Ve=e[62];const Qe=Ve;let nt;e[63]!==U||e[64]!==F||e[65]!==Qe||e[66]!==c?(nt=F?Qe:r.jsxs("div",{className:"space-y-2",children:[Qe,r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm"})]}),e[63]=U,e[64]=F,e[65]=Qe,e[66]=c,e[67]=nt):nt=e[67],Z=nt;break e}Y=ae(G&&"cursor-grabbing"),e[48]=u,e[49]=U,e[50]=F,e[51]=f,e[52]=c,e[53]=y,e[54]=b,e[55]=_e,e[56]=Ze,e[57]=ve,e[58]=Y}else Ze=e[56],ve=e[57],Y=e[58];fe=Gl,Ke=we,tt=Ul,Me=L,Be=A,De=W,lt=Jl,He=it,Ee=Ql,ee="space-y-1",ct=f.map(G=>{const ie=b[G.index];return ie?r.jsx(Sc,{sortableId:G.id,section:ie,raw:y[G.index],meta:V,decofile:B,selected:w===G.index,onSelect:()=>Fe(G.index),onDelete:()=>Q(G.index),onDuplicate:()=>ge(G.index),onMakeReusable:()=>Ue(G.index),onToggleHidden:()=>Oe(G.index),onToggleLazy:Ne?()=>Ne(G.index):void 0,onAddVariant:()=>oe(G.index),onDetach:()=>R(G.index)},G.id):null})}e[11]=u,e[12]=U,e[13]=F,e[14]=B,e[15]=f,e[16]=it,e[17]=A,e[18]=V,e[19]=c,e[20]=oe,e[21]=Q,e[22]=R,e[23]=ge,e[24]=Ue,e[25]=K,e[26]=Oe,e[27]=Ne,e[28]=y,e[29]=b,e[30]=w,e[31]=we,e[32]=_e,e[33]=lt,e[34]=fe,e[35]=Ze,e[36]=ve,e[37]=ct,e[38]=He,e[39]=Ee,e[40]=Ke,e[41]=tt,e[42]=Me,e[43]=Be,e[44]=De,e[45]=Y,e[46]=Z,e[47]=ee}else lt=e[33],fe=e[34],Ze=e[35],ve=e[36],ct=e[37],He=e[38],Ee=e[39],Ke=e[40],tt=e[41],Me=e[42],Be=e[43],De=e[44],Y=e[45],Z=e[46],ee=e[47];if(Z!==Symbol.for("react.early_return_sentinel"))return Z;let O;e[68]!==ct||e[69]!==ee?(O=r.jsx("div",{className:ee,children:ct}),e[68]=ct,e[69]=ee,e[70]=O):O=e[70];let N;e[71]!==lt||e[72]!==He||e[73]!==Ee||e[74]!==O?(N=r.jsx(lt,{items:He,strategy:Ee,children:O}),e[71]=lt,e[72]=He,e[73]=Ee,e[74]=O,e[75]=N):N=e[75];let me;e[76]!==Ze||e[77]!==ve||e[78]!==F||e[79]!==B||e[80]!==V?(me=ve?r.jsx("div",{className:ae("cursor-grabbing shadow-lift",Ca(ve,!1,F)),children:r.jsx(Na,{section:ve,raw:Ze,meta:V,decofile:B})}):null,e[76]=Ze,e[77]=ve,e[78]=F,e[79]=B,e[80]=V,e[81]=me):me=e[81];let We;e[82]!==me?(We=qo.createPortal(r.jsx(Wl,{dropAnimation:Ki,children:me}),document.body),e[82]=me,e[83]=We):We=e[83];let qe;e[84]!==fe||e[85]!==Ke||e[86]!==tt||e[87]!==Me||e[88]!==Be||e[89]!==De||e[90]!==N||e[91]!==We?(qe=r.jsxs(fe,{sensors:Ke,collisionDetection:tt,onDragStart:Me,onDragEnd:Be,onDragCancel:De,children:[N,We]}),e[84]=fe,e[85]=Ke,e[86]=tt,e[87]=Me,e[88]=Be,e[89]=De,e[90]=N,e[91]=We,e[92]=qe):qe=e[92];let Je;e[93]!==U||e[94]!==F||e[95]!==c?(Je=!F&&r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=U,e[94]=F,e[95]=c,e[96]=Je):Je=e[96];let T;return e[97]!==Y||e[98]!==qe||e[99]!==Je?(T=r.jsxs("div",{className:Y,children:[qe,Je]}),e[97]=Y,e[98]=qe,e[99]=Je,e[100]=T):T=e[100],T}function kc(v){return v.id}function wc(v,e,p,y){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const b=e.trim();if(!b)return Gt(v,p,y)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:ks(v,p,y)}:{kind:"noop"};const V=ws(v,p,y);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Dt(V.resolveType,V.data,b)};const B=Un(b),w=Yn(B,p);return w?{kind:"error",reason:"invalid-block-id",message:w}:{kind:"createBlock",blockId:B,blockData:Dt(V.resolveType,V.data,b),reference:ln(B)}}const ka="section-form-stale-save",jc=3;function wa(v,e,p){const y=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ea(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),b=Math.max(0,Math.min(e.pageVariantIndex,y.length-1)),V=y[b]?.sections??[];return{pageVariants:y,variantIndex:b,rawSections:V,parsedSections:wn(V,v,p)}}const ja=new WeakMap;let Rc=0;function Ec(v){let e=ja.get(v);return e===void 0&&(e=++Rc,ja.set(v,e)),e}function uf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:y=!0,previewUrl:b,currentPath:V,activePageBlockKey:B=null,activeGlobalBlockKey:w=null,externalSelection:K,onSaved:k,initialEditSeo:Q=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Oe,onFocusedBlockChange:Ne,onVariantPreviewOverride:oe,focusVariant:R}){const c=Rn(),xe=Ci(),U=xe?.taskId??null,_e=y?{orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:b}:null,[F,ke]=S.useState([]),{data:f,isLoading:ze}=fl(_e,{pollWhile:F.length>0}),{data:u,isLoading:Re}=xl(_e),X=Qn(),$e=xe?.virtualMcpId,Ce=il($e===e?e:null)?.metadata?.siteSlug??null,at=tc({virtualMcpId:e,branch:p,sandboxUrl:b}),Pe=ml(e,p),_=pl(Pe),we=Si(_),ot=!_,it=!!at||_,[m,L]=S.useState(null),[et,A]=S.useState(null),[Ye,W]=S.useState(null),[lt,fe]=S.useState(0),[Ze,ve]=S.useState(void 0),[ct,He]=S.useState(null),[Ee,Ke]=S.useState(null);R&&R.seq!==ct&&(He(R.seq),Ke(R));const[tt,Me]=S.useState(null),Be={index:tt,remember:Me},[De,Y]=S.useState(null),[Z,ee]=S.useState(null),[O,N]=S.useState([]),me=S.useRef(null),[We,qe]=S.useState(O.length);We!==O.length&&(qe(O.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Je,T]=S.useState(0),[Fe,G]=S.useState(null),[ie,Ve]=S.useState(null),[Qe,nt]=S.useState(null),[Pa,Yt]=S.useState(!1),[Ts,Xn]=S.useState(!1),En=S.useRef(null),[Vn,Ka]=S.useState(!0),[Zt,Tn]=S.useState(!1),[Ft,An]=S.useState(!1),[Te,cn]=S.useState(Q),[As,Ns]=S.useState(Q);Q&&!As&&(Ns(!0),cn(!0),L(null),A(null),W(null),N([])),!Q&&As&&Ns(!1);const[Ma,un]=S.useState(null),[Cs,Nn]=S.useState(void 0),[Ps,It]=S.useState([]),[Ks,Jt]=S.useState(0),[Ie,ut]=S.useState(0),[Ba,Le]=S.useState(null),[Qt,Ge]=S.useState(null),[Ms,Bs]=S.useState(null),Ds=Jo(),Fs=hl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),dn=zi({orgSlug:v,virtualMcpId:e,branch:p}),[Da,Fa]=S.useState(V),[Ia,La]=S.useState(B),[Oa,za]=S.useState(w);(Da!==V||Ia!==B||Oa!==w)&&(queueMicrotask(()=>dn.flush()),Fa(V),La(B),za(w),L(null),A(null),W(null),fe(0),Y(null),ee(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1),cn(!1),un(null),Nn(void 0),It([]),Jt(t=>t+1));const D=$i({orgSlug:v,virtualMcpId:e,branch:p}),fn=rl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Cn=Rl({orgSlug:v,virtualMcpId:e,branch:p}),Is=oc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=S.useState(!1),C=S.useRef(null),wt=S.useRef(null),gt=S.useRef(null),vt=S.useRef(null),Pn=S.useRef({}),Lt=S.useRef(null),mn=S.useRef(!1),pn=S.useRef(!1),Se=S.useRef(new Map),tn=S.useRef(!1),xt=S.useRef([]),es=S.useRef(new WeakSet);gl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=ne.current,i=new Set;n&&i.add(n);for(const l of[wt.current?.sectionIndex,o]){const d=l==null?void 0:s[l],E=l==null?void 0:a[l],h=d&&E?.isSavedBlock?Ss(d,E):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[C,gt,vt])l.current&&clearTimeout(l.current),l.current=null;wt.current=null,Se.current.clear(),n&&t.has(n)&&(Pn.current={})}});const ne=S.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ls,Os]=S.useState(0),[$a,Ha]=S.useState(0),zs=Qo(Pe,{orgSlug:v,virtualMcpId:e,branch:p}),$s=Xo(zs,F[0]?.blockKey??null,F[0]?ei(xn(F[0].plan.theirs)):null),[Wa,qa]=S.useState(null),ts=vl(v,e).epoch,[Ga,Ua]=S.useState(ts);if(!y||ze||Re)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ti,{className:"size-5 text-muted-foreground"})});if(!f||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ya=Vl(f,u),$=!!w,se=$?null:Tl(Ya,V,B),g=$?w:se?.key??null,Kn=$&&w?f[w]:void 0,Hs=$&&w&&Kn?Al(w,Kn):$&&w?w:"",Ot=!$&&g&&f[g]?f[g]:null,ns=Te&&f&&u&&g&&se?ta(f,{kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},u):null,Za=Te?Ot?.seo:void 0,Mn=Cs!==void 0?Cs:Za,Ja=Te?Hi(Mn):void 0,Ws=ns?.seoTypeOptions??[],qs=Te&&u?Wi(u):"",ss=Ma??Ja??{},Bn=Te&&ns?sc(ss,ns):null,Gs=Te&&Bn&&qi(Mn)?Gn(Bn,u):null,Us=Te?Gi(f,u)?.seoData:void 0,le=$?[{label:"Default",sections:[{__resolveType:w}]}]:Ea(Ot?.sections,f??{},_),St=le.length>1,J=Math.min(lt,le.length-1),ye=le[J],M=ye?.sections??[],ce=wn(M,f,_),Dn=!$&&Nl(Ot?.sections,_);if($&&w&&Ms!==w){Bs(w);const t=M[0],n=ce[0];if(t&&n){L(0),ut(0),N([]);const s=Rt(t,n,f,_);s&&(A(s.data),W(s.resolveType),Ge(null),Le(null))}}!$&&Ms!==null&&Bs(null),ne.current={rawSections:M,parsedSections:ce,decofile:f??{},activePageKey:g,pageVariants:le,variantIndex:J,sectionVariantIndex:Ie,selectedSectionIndex:m};const Qa=()=>({multivariate:Dn,index:J,variants:le.map(t=>({rule:t.rule})),lazyValues:_&&Dn&&yi(Ot?.sections?.variants?.[J]?.value)}),rs=(t,n)=>{if(!oe)return;if(!g||!Dn||t.length<=1){oe(null);return}const s={multivariate:!0,index:n,variants:t},a=_?xa(g,s):ba(g,s,f,u);oe(a.length>0?a:null)},as=oe&&g&&Dn&&St&&!ze&&!Re?g:null;if(as!==Wa&&(qa(as),as)){const t=le.map(s=>({rule:s.rule})),n=J;queueMicrotask(()=>rs(t,n))}const zt=(t,n,s)=>{if(!oe)return;if(!g){oe(null);return}const a=Qa(),o=_?xa(g,a):ba(g,a,f,u);if(!t||n<0){oe(o.length>0?o:null);return}const i={pageKey:g,page:a,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=_?lc(i):ic({...i,decofile:f,meta:u}),d=_?cc(o,l):[...o,...l];oe(d.length>0?d:null)},_t=(t,n,s,a=m??-1,o=!1)=>{const i=st(t,n);if(!i){A(null),W(null),Ge(null),Le(null),o&&zt(null,a,s);return}const d=qr(i,we)[s];if(!d){A(null),W(null),Ge(null),Le(null),o&&zt(null,a,s);return}const E=ai(d.value,f);A(E?.data??null),W(E?.resolveType??null);const{resolveType:h,formValue:x}=qt(d.rule,f,u??void 0);Ge(h),Le(x),o&&zt(i,a,s)},hn=t=>{Ve(null),fe(t),L(null),A(null),W(null),N([]);const n=le[t]?.rule,{resolveType:s,formValue:a}=qt(n,f??{},u??void 0);ee(s),Y(a),rs(le.map(o=>({rule:o.rule})),t)},Ys=(t,n)=>{const s=M[t],a=ce[t];if(!s||!a)return!1;const o=a.isMultivariate?st(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),ut(i),N([]),T(l=>l+1),a.isMultivariate)_t(s,a,i,t);else{const l=Rt(s,a,f,_);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),Ge(null),Le(null)}return!0},Zs=K?.index;if(K!==void 0&&(K?.seq??null)!==Ze&&(ve(K?.seq??null),typeof Zs=="number"&&Ys(Zs,0)),Ee&&($?Kn:Ot)){const t=Ee.pageVariant,n=!$&&t!==void 0&&t<le.length;if(n&&t!==J)hn(t);else{Ke(null);const{section:s,variant:a}=Ee;if($)a!==void 0&&(Me(a),N([]),T(o=>o+1));else if(s!==void 0&&Ys(s,a??0)){const o=M[s],i=ce[s],l=i.isMultivariate?st(o,i):null;l&&a!==void 0&&queueMicrotask(()=>zt(l,s,a))}else n&&hn(t)}}if(ts!==Ga){Ua(ts);const t=C.current!==null||Se.current.size>0||vt.current!==null||gt.current!==null||D.isPending||dn.isPending||F.length>0,n=m!==null&&Wr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=ce[m];if(N([]),T(o=>o+1),!s||!a)L(null),A(null),W(null);else if(a.isMultivariate)_t(s,a,Ie,m);else{const o=Rt(s,a,f,_);A(o?.data??null),W(o?.resolveType??null)}}!t&&Te&&(un(null),Nn(void 0),Jt(s=>s+1))}if(Ls!==$a){Ha(Ls);const t=m!==null?M[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(N([]),T(s=>s+1),n.isMultivariate)_t(t,n,Ie,m);else{const s=Rt(t,n,f,_);A(s?.data??null),W(s?.resolveType??null)}}const dt=F[0];if(dt){const{formBase:t,target:n}=dt,s=wa(f,n,_),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?gs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,f,_):null,i=ni(dt,o,l=>Gr(t,l));if(i){const d=[{...dt,...i,changedAgain:!0},...F.slice(1)];xt.current=d,ke(d)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:_?void 0:b??void 0,siteSlug:Ce},Fn=Ye&&u?Gn(Ye,u):null,ft=(t,n)=>{if(!g)return;C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=an(f,g,t,J,le);D.mutate({blockKey:g,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},$t=()=>{Ne?.(null),L(null),An(!1),A(null),W(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1)},Js=()=>Wr(me.current,document.activeElement),os=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),wt.current=null,q.error(t,{id:ka}),Js()){tn.current=!0;return}Os(n=>n+1)},Qs=()=>{!tn.current||Js()||xt.current.length>0||C.current!==null||mn.current||pn.current||Se.current.size>0||(tn.current=!1,Os(t=>t+1))},Xs=()=>{tn.current&&setTimeout(Qs,0)},er=t=>bl(Ds,Fs,t,Pe.kind==="protocol"?Pe:null),tr=t=>{Se.current.size!==0&&setTimeout(()=>{if(mn.current||pn.current)return;const n=[...Se.current.values()];Se.current.clear();for(const s of n)s()},t)},Xa=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=ne.current,o=Lt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:$,pageVariantIndex:s,sectionVariantIndex:a,schema:Fn}},vn=t=>{xt.current=t,ke(t)},eo=t=>{const n=xt.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:Jr(a.plan,a.choices,t.plan),fresh:Vi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||xn(a.plan.theirs)!==xn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(o)},nr=(t,n)=>{const s=xt.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if(xn(o.plan.mine)===xn(n))return!0;const i=Zr({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(d=>d!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:Jr(o.plan,o.choices,i)})),!0},to=t=>{const n=ne.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},no=()=>{const t=xt.current[0];if(!t)return null;const{formBase:n,target:s}=t;C.current&&wt.current?.sectionIndex===n.sectionIndex&&wt.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(C.current),C.current=null,wt.current=null),Se.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!nr(n,a)&&Sn(a,n.sectionIndex,0,s),xt.current[0]??null},so=()=>{const t=xt.current[0],n=no();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=hi(n.plan,n.choices);Pe.kind==="protocol"&&Pe.source==="github"&&gi(n.plan,n.choices)&&Sl(c,!1),vn(xt.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,es.current.add(a),(Lt.current===a||to(n))&&(Lt.current=a,A(s),T(i=>i+1)),Sn(s,a.sectionIndex,0,o)},ro=t=>{const[n,...s]=xt.current;n&&vn([{...n,choices:t},...s])},Sn=(t,n,s=0,a,o=!1)=>{const i=a??Xa(n),l=i.sectionVariantIndex,d=i.formBase,E=wt.current;C.current&&(clearTimeout(C.current),C.current=null,E&&(E.sectionIndex!==n||E.sectionVariantIndex!==l)&&E.write());const h=`${i.pageKey}:${n}:${l}`,x=()=>{if(mn.current||pn.current){Se.current.set(h,x);return}const j=typeof t=="function"?t():t;if(d&&nr(d,j))return;const I=ne.current.decofile,{rawSections:P,parsedSections:pe,pageVariants:ue,variantIndex:be}=wa(I,i,_),z=i.pageKey,H=P[n];if(!H)return;const re=pe[n];if(!re)return;const he=d?.base,Ae=gs(H,re,l,I,_),sn=!!he&&!!Ae&&xi(he,Ae)&&!(d&&Gr(d,Ae));if(sn&&he&&Ae){if(_i(he,Ae)){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const te=re.isSavedBlock?"here":ki(he,P.map((de,ht)=>gs(de,pe[ht],l,I,_)),n,d?.sectionCount??P.length);if(te==="unknown"){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof te=="number"&&d){d.sectionCount=P.length,d.sectionIndex=te,Lt.current===d&&L(te),Sn(j,te,s,i);return}}const pt=sn&&he&&Ae?Zr({ancestor:he,mine:j,theirs:Ae}):null;if(pt&&pt.pointers.length>0&&d){d.sectionCount=P.length,eo({plan:pt,formBase:d,target:i,sectionIndex:n,choices:wi(pt),changedAgain:!1,blockKey:re.isSavedBlock?Ss(H,re):z,fresh:{}});return}const Xe=pt?pt.merged:null,Pt=Xe??j,zr=ji({merged:!!Xe,tracked:d,current:Lt.current,saved:j});Xe&&q.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:ka}),zr&&d&&(d.emitted=Xe,A(Xe));const hs=zr||!Xe?Pt:j;d&&(d.base=hs,d.sectionCount=P.length,Ri(d,hs));const $r={onSuccess:()=>{d&&es.current.delete(d),k?.()},onError:te=>{if(d?.base===hs&&he&&(d.base=he),te instanceof yl){if(d&&(d.version=void 0),s<jc){Se.current.delete(h),pn.current=!0;const de=Ti(s,te.carriedStored);setTimeout(()=>{pn.current=!1,Sn(()=>{const ht=d?.emitted;return ht&&typeof ht=="object"?ht:j},n,s+1,i,de.immediate),Se.current.delete(h),tr(_n)},de.delay)}else os();return}D.reportError(te)}},Hr=te=>{mn.current=!0;let de=!1;D.mutateAsync(te).then(()=>$r.onSuccess(),ht=>{de=!0,$r.onError(ht)}).finally(()=>{mn.current=!1,tr(de?_n:0),Qs()})};if(re.isSavedBlock){const te=Ss(H,re);if(!te)return;Hr({blockKey:te,data:Pt,...he?{base:{value:Xe?Ae:he}}:{},rebaseOnConflict:!1,guard:Xr({formBase:d,rebased:!!Xe,versionOf:er})});return}if(!z)return;const Hn={...I[z]},Wt=[...P];if(re.isMultivariate){const te=st(H,re);if(!te||!z)return;const de=Ei(te,l,Pt);Wt[n]=Kt(H,re,de)}else if(re.isHidden){const te=Vs(H.__resolveType),de=te?{...H.section}:{...H},ht=Array.isArray(de.variants)?[...de.variants]:[];ht[0]&&(ht[0]=Qr(de.__resolveType,ht[0],Pt)),de.variants=ht,te?Wt[n]={...H,section:de}:Wt[n]=de}else re.isLazy?Wt[n]={...H,section:Pt}:Wt[n]=Pt;if(ue.length>1){const te=Hn.sections,de=[...te?.variants??[]];de[be]&&(de[be]=Qr(te?.__resolveType,de[be],Wt)),Hn.sections={...te,variants:de}}else Hn.sections=Wt;Hr({blockKey:z,data:Hn,rebaseOnConflict:!1,guard:Xr({formBase:null,rebased:!1,versionOf:er})})};if(wt.current={sectionIndex:n,sectionVariantIndex:l,write:x},o){wt.current=null,x();return}C.current=setTimeout(()=>{C.current=null,x()},_n)},ao=t=>{tn.current=!1,L(t),ut(0),N([]),T(o=>o+1);const n=M[t],s=ce[t];if(Ne?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){_t(n,s,0,t);return}const a=Rt(n,s,f,_);if(!a){A(null),W(null),Ge(null),Le(null),zt(null,t,0);return}A(a.data),W(a.resolveType),Ge(null),Le(null),zt(null,t,0)},sr=t=>{const n=t;m!==null&&(Lt.current=vi(Lt.current,{sectionIndex:m,variantIndex:ne.current.sectionVariantIndex,shown:et,next:n,sectionCount:ne.current.rawSections.length})),A(n),m!==null&&Sn(n,m)},is=t=>{if(!g||!f||!u||!se)return;const n={kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},s=ta(f,n,u);s&&dn.save(g,()=>{const a=Ds.getQueryData(bi.decofile(Fs))?.[g];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Pn.current};return Pn.current={},t?.raw!==void 0?rc(o,t.raw,u):t?.inner!==void 0?ac(n,s,o,t.inner):o})},rr=(t,n)=>{g&&(Pn.current[t]=n,is())},oo=(t,n)=>{if(!g)return;const s=Zn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),ft(s)},io=t=>{if(!g)return;const n=M.filter((s,a)=>a!==t);m===t?$t():m!==null&&m>t&&L(m-1),ft(n)},lo=t=>{if(!g)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,al(n)),m!==null&&m>t&&L(m+1),ft(s)},co=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s)return;const a=s.isHidden?fi(n,_):mi(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},uo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const a=di(n);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},fo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const a=Rt(n,s,f,_);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&$t(),ft(l)},mo=t=>{if(!g)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;ft(n,{onError:()=>{ne.current.selectedSectionIndex===s&&$t()}}),Yt(!1),L(s),ut(0),N([]),T(l=>l+1);const a=n[s],o=wn(n,f,_)[s];if(!a||!o)return;if(o.isMultivariate){_t(a,o,0);return}const i=Rt(a,o,f,_);if(!i){A(null),W(null),Ge(null),Le(null);return}A(i.data),W(i.resolveType),Ge(null),Le(null)},ar=t=>{En.current=t.append,Yt(!0)},po=t=>{const n=En.current;if(!n){mo(t);return}n({__resolveType:t.resolveType}),Yt(!1),En.current=null},or=t=>{if(m===null)return;const n=M[m],s=ce[m];!n||!s?.isMultivariate||(ut(t),N([]),T(a=>a+1),_t(n,s,t,m,!0))},ho=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ci(a,t);if(!o){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Kt(n,s,o);const l=o.variants;let d=Ie;t===Ie?d=Math.min(t,l.length-1):t<Ie&&(d=Ie-1),ut(d),N([]),T(E=>E+1),_t(i[m],s,d),ft(i)},go=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ui(a,t,_),i=[...M];i[m]=Kt(n,s,o);const l=Yr(a.variants??[],t,_);ut(l),N([]),T(d=>d+1),_t(i[m],s,l,m,_),ft(i)},vo=(t,n)=>{if(m===null||!g||t===n)return;const s=M[m],a=ce[m];if(!s||!a?.isMultivariate)return;const o=st(s,a);if(!o)return;const i=ii(o,t,n),l=[...M];l[m]=Kt(s,a,i);let d=Ie;Ie===t?d=n:t<Ie&&n>=Ie?d=Ie-1:t>Ie&&n<=Ie&&(d=Ie+1),ut(d),_t(l[m],a,d,m,_),ft(l)},yn=t=>{const n=t??m;if(n===null||!g)return;const s=M[n],a=ce[n];if(!s||!a)return;const o=oi(s,a,void 0,u,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=wn(i,f,_)[n];if(!l?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),ut(o.newVariantIndex),N([]),T(d=>d+1),_t(o.section,l,o.newVariantIndex,n,_),ft(i)},ir=()=>{if(m===null||!g)return;const t=M[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=st(t,n);if(!s)return;const a=li(t,n,s);if(!a){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=wn(o,f,_)[m];if(!i)return;ut(0),Ge(null),Le(null),N([]),T(d=>d+1);const l=Rt(a,i,f,_);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),zt(null,m,0),ft(o)},So=async t=>{if(Fe===null||!g)return;const n=Yn(t,f,u);if(n){q.error(n);return}const s=M[Fe],a=ce[Fe];if(!s||!a)return;const o=Rt(s,a,f,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),d=[...M];d[Fe]={__resolveType:t},await D.mutateAsync({blockKey:g,data:an(f,g,d,J,le)}),m===Fe&&$t(),G(null),qn(l)||q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){q.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Mt(c,Bt(l))})}},lr=ye?.rule;if(St&&m===null&&Z===null&&lr){const{resolveType:t,formValue:n}=qt(lr,f??{},u??void 0);ee(t),Y(n)}const nn=u?Ui(u):[],ls=u&&f?Yi(u,f):[],Ht=_&&u&&f?_l(u,f):[],cs=(t,n)=>{if(Ht.length===0)return;const s=Pl(t);return{kinds:Ht,selected:s,campaignPrefill:kl(t),onPick:n}},cr=!$&&!!(it&&u&&f),ur=Z&&u?Gn(Z,u):null,yt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},kt=async(t,n)=>{if(!(Dl(n,t,u)>0))try{await Cn.mutateAsync({blockKey:t})}catch(s){q.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Mt(c,Bt(s))})}},dr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],d=l[a],E=d?.rule;if(Gt(E,s,u)){const h=E?.__resolveType??"",x=s[h],j=typeof x?.name=="string"?x.name:h,{__resolveType:I,...P}=t;D.mutate({blockKey:h,data:Dt(I??"",P,j)},{onSuccess:()=>k?.(),onError:D.reportError});return}d&&(l[a]={...d,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},_n)},fr=t=>{ee(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Y(t?n:{}),dr(n)},mr=t=>{const n=t;Y(n);const s=Z?{__resolveType:Z,...n}:{...n};dr(s)},In=async(t,n,s)=>{const a=wl(n,t);if(!a.ok)return a.reason==="conflict"&&q.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ma),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Is.apply({writes:o})).ok?null:(a.blockWrite&&q.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ma,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},pr=Ht.length>0?{kinds:Ht,prepare:async t=>(await In(t,ne.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Kl(ne.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Is.apply({writes:{[Ml(t).blockKey]:n.block}})).ok}}:null,hr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;let o=null;const i=await In(t,s,E=>{const h=s[n],x=h?.sections;if(!x||typeof x!="object"||Array.isArray(x))return null;const j=x;if(!Array.isArray(j.variants))return null;const I=[...j.variants],P=I[a];return P?(o=bt(P.rule,s,u),I[a]={...P,rule:E},{blockKey:n,data:{...h,sections:{...j,variants:I}}}):null});if(!i)return;const{resolveType:l,formValue:d}=qt(i.rule,i.projected,u??void 0);ee(l),Y(d),o&&await kt(o,i.projected),k?.()},gr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[a];if(!E)return;const h=bt(E.rule,s,u),x=ln(t);d[a]={...E,rule:x};const j={...s,[n]:{...o,sections:{...l,variants:d}}},{resolveType:I,formValue:P}=qt(x,j,u??void 0);ee(I),Y(P);try{await D.mutateAsync({blockKey:n,data:j[n]}),h&&h!==t&&await kt(h,j),k?.()}catch(pe){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(pe))})}},vr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=ne.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const P=(j.variants??[])[s]?.rule;if(Gt(P,i,u)){const z=P?.__resolveType??"",H=i[z],re=typeof H?.name=="string"?H.name:z,{__resolveType:he,...Ae}=t;D.mutate({blockKey:z,data:Dt(he??"",Ae,re)},{onSuccess:()=>k?.(),onError:D.reportError});return}const pe=vs(j,s,t),ue=[...a];ue[n]=Kt(h,x,pe);const be=an(i,l,ue,E,d);D.mutate({blockKey:l,data:be},{onSuccess:()=>k?.(),onError:D.reportError})},_n))},yo=t=>{Ge(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Le(t?n:{}),vr(n)},bo=t=>{const n=t;Le(n);const s=Qt?{__resolveType:Qt,...n}:{...n};vr(s)},xo=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;let h=null;const x=await In(t,i,P=>{const pe=a[n],ue=o[n];if(!pe||!ue?.isMultivariate)return null;const be=st(pe,ue);if(!be)return null;const z=be.variants??[];h=bt(z[s]?.rule,i,u);const H=[...a];return H[n]=Kt(pe,ue,vs(be,s,P)),{blockKey:l,data:an(i,l,H,E,d)}});if(!x)return;const{resolveType:j,formValue:I}=qt(x.rule,x.projected,u??void 0);Ge(j),Le(I),h&&await kt(h,x.projected),k?.()},_o=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=bt(I[s]?.rule,i,u),pe=ln(t),ue=vs(j,s,pe),be=[...a];be[n]=Kt(h,x,ue);const z=an(i,l,be,E,d),H={...i,[l]:z},{resolveType:re,formValue:he}=qt(pe,H,u??void 0);Ge(re),Le(he);try{await D.mutateAsync({blockKey:l,data:z}),P&&P!==t&&await kt(P,H),k?.()}catch(Ae){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(Ae))})}};if(!$&&!se)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if($&&!Kn)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?ce[m]??null:null,Sr=m!==null?M[m]:null,yr=Sr&&je?.isMultivariate?st(Sr,je):null,At=yr?qr(yr,we):[],Ln=Math.min(Ie,Math.max(At.length-1,0)),jt=At[Ln]??null,Nt=je?.isMultivariate===!0,us=m!==null&&je!==null,Ct=us&&(Nt||!!(Fn&&et)),ko=Ct&&!$&&je?.isSavedBlock===!0,mt=$||ko,br=$?Hs:je?.label??"",wo=Qt&&u?Gn(Qt,u):null,xr=(t,n)=>n&&X?`${t} · ${n}`:t,_r=je?je.variantOf??je.label:"",jo=(()=>{const t=Nt&&jt?jt.label:null;return t?X?[xr(_r,t)]:[je.label,t]:[je?.label??""]})(),ds=xr(se?.name??"",St?ye?.label:null),On=Ct&&(!$||O.length>0)?$?[Hs,...O]:[ds,...jo,...O]:[],kr=Te&&se?[se.name,"SEO",...Ps]:[],wr=c("sectionsEditor.pageVariantTabs.variantsLabel"),jr=Zt&&se?[se.name,wr]:Ft&&se&&je?[ds,_r,wr]:[],zn=jr.length>0?jr:kr.length>0?kr:mt?On.length>0?On:[br]:On.length>0?On:[ds],Rr=us&&!Nt&&!je?.isHidden&&!!g,Ro=mt||!$&&St&&!!ye||Rr,Eo=us&&!Nt&&!$&&O.length===0&&!!je&&Ra(je)&&!!g,Vo=X&&Ct&&!Ft&&Nt&&O.length===0&&!!jt,Er=X&&O.length>0?na(O[O.length-1]):null,To=O.length>1?na(O[O.length-2]):null,Vr=mt?br:Ct?je?.label??"":se?.name??"",Ao=Zt||Ft?c("sectionsEditor.pageVariantTabs.variantsLabel"):Te?c("sectionsEditor.panelSections.seo"):Er??Vr,Tr=Ft?je?.variantOf??je?.label??"":Zt||Te?se?.name??"":Er?To??Vr:mt?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Ct?se?.name??"":se?.path??"",fs=!Zt&&!Ft&&!Te&&!Ct&&!mt,No=!X&&!Te&&!$&&Nt&&O.length===0,bn=()=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const t=f[g],n=Cl(t.sections,M,u,_);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),L(null),A(null),W(null),N([]),Y(null),ee(null)},onError:D.reportError})},$n=(t,n,s)=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const a=f[g],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const d=Bl(i,l),E={...f,[g]:{...a,sections:d}};D.mutate({blockKey:g,data:E[g]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const x of h)await kt(x,E)})()},onError:D.reportError})},Ar=(t,n)=>{if(t===n)return;let s=J;J===t?s=n:t<J&&n>=J?s=J-1:t>J&&n<=J&&(s=J+1),fe(s);const a=Zn(le.map(o=>({rule:o.rule})),t,n);rs(a,s),$n(o=>Zn(o,t,n))},Nr=t=>{const n=le[t]?.rule,s=bt(n,f??{},u??void 0);$n(a=>a.length<=1?null:(a.splice(t,1),a),()=>{le.length-1===1?fe(0):t<J?fe(J-1):t===J&&fe(Math.max(0,t-1)),L(null),A(null),W(null),N([]),Y(null),ee(null)},s)},Co=()=>{const t=le.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!pi(n.rule)).map(({variant:n})=>bt(n.rule,f??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Ai({variants:n}),a=n[s];return a?[{...a,rule:Ni(u)}]:null},()=>{fe(0),L(null),A(null),W(null),N([]),Y(null),ee(null),Tn(!1)},t)},Cr=t=>{let n=t+1;$n(s=>(n=Yr(s,t,_),Fl(s,t,_)),()=>{fe(n),L(null),A(null),W(null),N([]),Y(null),ee(null)})},Po=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const s=ne.current.activePageKey,a=ne.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[t];if(!E?.rule||typeof E.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=E.rule,x=n.trim();en(!0);try{if(!x){if(!Gt(h,a,u)){Ve(null);return}const z=h.__resolveType??"";d[t]={...E,rule:ks(h,a,u)};const H={...a,[s]:{...o,sections:{...l,variants:d}}};await D.mutateAsync({blockKey:s,data:H[s]}),await kt(z,H),Ve(null),k?.();return}const j=ws(h,a,u);if(!j){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(j.blockKey){await D.mutateAsync({blockKey:j.blockKey,data:Dt(j.resolveType,j.data,x)}),Ve(null),k?.();return}const I=Un(x),P=Yn(I,a,u);if(P){q.error(P);return}const pe=Dt(j.resolveType,j.data,x);let ue=null,be=!1;try{const z=await D.mutateAsync({blockKey:I,data:pe,create:!0});be=qn(z),ue=be?null:I,d[t]={...E,rule:ln(I)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:d}}}),ue=null}catch(z){throw ue&&await Cn.mutateAsync({blockKey:ue}).catch(()=>{}),z}Ve(null),be||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:x})),k?.()}catch(j){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(j))})}finally{en(!1)}},Ko=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(s===null||!l)return;const h=a[s],x=o[s];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=I[t];if(!P?.rule||typeof P.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const pe=P.rule,ue=n.trim();en(!0);const be=async z=>{const H={...j,variants:z},re=[...a];re[s]=Kt(h,x,H);const he=an(i,l,re,E,d);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!ue){if(!Gt(pe,i,u)){nt(null);return}const pt=pe.__resolveType??"",Xe=[...I];Xe[t]={...P,rule:ks(pe,i,u)};const Pt=await be(Xe);await kt(pt,Pt),nt(null),k?.();return}const z=ws(pe,i,u);if(!z){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(z.blockKey){await D.mutateAsync({blockKey:z.blockKey,data:Dt(z.resolveType,z.data,ue)}),nt(null),k?.();return}const H=Un(ue),re=Yn(H,i,u);if(re){q.error(re);return}const he=Dt(z.resolveType,z.data,ue);let Ae=null,sn=!1;try{const pt=await D.mutateAsync({blockKey:H,data:he,create:!0});sn=qn(pt),Ae=sn?null:H;const Xe=[...I];Xe[t]={...P,rule:ln(H)},await be(Xe),Ae=null}catch(pt){throw Ae&&await Cn.mutateAsync({blockKey:Ae}).catch(()=>{}),pt}nt(null),sn||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),k?.()}catch(z){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(z))})}finally{en(!1)}},Pr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Mo={rename:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],d=l?.rule&&typeof l.rule=="object"?l.rule:void 0,E=async x=>{const j={...t,variants:x};return await Pr(a,t,j),{...o,[a]:j}},h=wc(d,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){q.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const I=[...i];I[n]={...l,rule:h.inlinedRule};const P=await E(I);await kt(h.blockKey,P),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let x=null,j=!1;try{const I=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});j=qn(I),x=j?null:h.blockId;const P=[...i];P[n]={...l,rule:h.reference},await E(P),x=null}catch(I){throw x&&await Cn.mutateAsync({blockKey:x}).catch(()=>{}),I}j||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(x))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const d=bt(l.rule,o,u);i[n]={...l,rule:ln(s)};const E={...t,variants:i},h={...o,[a]:E};try{await Pr(a,t,E),d&&d!==s&&await kt(d,h),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(x))})}},selectNamedRule:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;let i=null,l=null;const d=await In(s,o,E=>{const h=Array.isArray(t.variants)?[...t.variants]:[],x=h[n];return x?(i=bt(x.rule,o,u),h[n]={...x,rule:E},l={...t,variants:h},{blockKey:a,data:l}):null});!d||!l||(A(l),i&&await kt(i,d.projected),k?.())}},Kr=()=>{$t()},Mr=t=>{un(t),is({inner:t})},Br=t=>{Nn(t),is({raw:t})},Dr=()=>{un(null),It([])},Fr=()=>Jt(t=>t+1),Ir=()=>{dn.flush(),cn(!1),un(null),Nn(void 0),It([]),Jt(t=>t+1),ge?.()},Bo=()=>{Tn(!1),An(!1),L(null),cn(!0)},Do=()=>{Te&&Ir(),L(null),Tn(!0)},Fo=()=>An(!0),ms=t=>{if(Zt&&t===0){Tn(!1);return}if(Ft&&t<2){An(!1),t===0&&L(null);return}if(Te){if(t===0){Ir();return}if(t===1){It([]),Jt(s=>s+1);return}It(Ps.slice(0,t-1)),Jt(s=>s+1);return}if($){N(O.slice(0,t)),T(s=>s+1);return}if(t===0){Kr();return}if(t===1){N([]),T(s=>s+1);return}const n=!X&&Nt&&jt?1:0;if(n===1&&t===2){N([]),T(s=>s+1);return}N(O.slice(0,t-1-n))},ps=zn.length>1?r.jsx("button",{type:"button",onClick:()=>ms(ol(zn.length,{isMultivariateSectionTop:No})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ae("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",mt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(dl,{className:"size-4"})}):null,Io=mt||Ct||Te?Ro&&r.jsxs("div",{className:ae("border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!$&&St&&ye&&r.jsxs("button",{type:"button",onClick:Kr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ye.label}),className:ae("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Ji),children:[r.jsx(Zi,{rule:xs(ye.rule,f??{},u??void 0),matchers:nn}),r.jsx("span",{className:"max-w-[160px] truncate",children:ye.label})]}),r.jsx("div",{className:"flex-1"}),mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Rr&&r.jsx(Wn,{onClick:()=>yn()})]}),mt&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr,variant:"header"})}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>cn(!0),children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Oe&&g?Oe():Xn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Wn,{onClick:bn})]}),Lo=r.jsxs(r.Fragment,{children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:J,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&Z!==null&&r.jsx(aa,{className:"mt-3",children:r.jsx("div",{className:ae("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:Z,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Ht),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${J}:${Z??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})})]}),Lr=r.jsxs(r.Fragment,{children:[r.jsx(Qi,{listKey:`${g??""}:${m??""}`,variants:At.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:or,onRename:nt,onDuplicate:go,onDelete:ho,onRemoveAll:ir,onReorder:vo,onAdd:()=>yn()}),r.jsx(aa,{children:r.jsx(ys,{currentRt:Qt??"",currentLabel:kn(jt?.rule,f??{},we,u??void 0),currentGlobalKey:bt(jt?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:yo,onSelectGlobal:_o,named:cs(jt?.rule,xo),namedRow:bs(jt?.rule,Ht),rule:jt?.rule,schema:wo,formValue:Ba,onChange:bo,formKey:`${m??"none"}:${Ln}:${Qt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or=r.jsx("div",{className:ae(X?"px-2":"p-2 pt-3"),children:r.jsx(_c,{listKey:`${g??""}-${J}`,rawSections:M,sections:ce,meta:u,decofile:f,selectedIndex:m,onSelect:ao,onReorder:oo,onDelete:io,onDuplicate:lo,onMakeReusable:G,onToggleHidden:co,onToggleLazy:ot?uo:void 0,onAddVariant:yn,onDetach:fo,onAddSection:()=>Yt(!0),canAddSection:cr})}),Oo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&se&&r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr}),Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Ws,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),zo=r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Ws,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),$o=r.jsxs(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:J,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&Z!==null&&r.jsxs("div",{className:ae("px-3 border-b",Vn?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Ka(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":Vn,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),Vn?r.jsx(ll,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(cl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Vn&&r.jsx("div",{className:ae("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:Z,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Ht),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${J}:${Z??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or]},"editor-section-list");return r.jsx(Xi,{value:_,children:r.jsx(el,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&ps&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ps}),(X||zn.length>1)&&r.jsx(tl,{crumbs:zn,onSelect:ms,onSelectRoot:()=>{dn.flush(),Ue?Ue():ms(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:ae("flex items-center gap-2 border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&ps,mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Jn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Ao}),Tr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Tr})]}),fs&&St&&ye&&r.jsx(oa,{variants:le,activeIndex:J,onSelect:hn,onManage:Do,onRemoveAll:Co}),Vo&&r.jsx(oa,{variants:At,activeIndex:Ln,onSelect:or,onManage:Fo,onRemoveAll:ir}),fs&&!St&&r.jsx(Wn,{onClick:bn}),Eo&&r.jsx(Wn,{onClick:()=>yn()}),r.jsx(nl,{}),fs&&r.jsxs(r.Fragment,{children:[r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Bo,children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Oe&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Xn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Io}),dt&&r.jsx(si,{open:!0,fields:ri(dt.plan,dt.target.schema),choices:dt.choices,changedAgain:dt.changedAgain,author:$s??null,authorPending:$s===void 0,fieldsAsLabeled:zs!==null,fresh:dt.fresh,onChoose:(t,n)=>ro({...dt.choices,[t]:n}),onApply:so},Ec(dt.formBase)),Ft?r.jsx(ia,{onAdd:()=>yn(),children:Lr},"editor-section-variants"):Ct?r.jsxs(on,{viewportRef:me,onBlur:Xs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Nt&&At.length>0&&O.length===0&&Lr,r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Je,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar,onVariantMatcherOp:$?Mo:void 0})})})]},"editor-section-form"):$?r.jsx(on,{viewportRef:me,onBlur:Xs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Je,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar})})})},"editor-global-block"):Te?X?r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Oo})},"editor-seo"):zo:Zt?r.jsx(ia,{onAdd:bn,children:Lo},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Or})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Es,{canAddSection:cr,onAddSection:()=>Yt(!0)})})]},"editor-section-list"):$o,r.jsx(sl,{open:Fe!==null,onOpenChange:t=>{t||G(null)},defaultBlockId:Fe!==null?Un(ce[Fe]?.label??""):"",isPending:D.isPending,onSubmit:So}),it&&r.jsx(nc,{open:Pa,onOpenChange:t=>{Yt(t),t||(En.current=null)},meta:u,decofile:f,previewBaseUrl:at,onSelect:po}),Ts&&g&&f&&r.jsx(El,{open:Ts,onOpenChange:Xn,pageKey:g,decofile:f}),ie!==null&&r.jsx(ua,{open:!0,initialName:Gt(le[ie]?.rule,f??{},u??void 0)?kn(le[ie]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(le[ie]?.rule,f??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Po(ie,t)},onOpenChange:t=>{!t&&!Xt&&Ve(null)}}),Qe!==null&&r.jsx(ua,{open:!0,initialName:Gt(At[Qe]?.rule,f??{},u??void 0)?kn(At[Qe]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(At[Qe]?.rule,f??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Ko(Qe,t)},onOpenChange:t=>{!t&&!Xt&&nt(null)}})]})})})}export{uf as SectionsEditor};
@@ -1 +1 @@
1
- import{r as d,cu as rt,cv as _e,j as c,cw as st,cx as be,cy as k,cz as lt,cA as j,cB as N,cC as $,cD as at,bQ as Ee,cE as Re,cF as it,cG as ct,cH as dt,cI as ut,cJ as pt,cK as ft,cL as mt,cM as ht,cN as vt,cO as gt,cP as xt,cQ as St,c as ee,l as oe,ai as wt}from"./index-D_g5fbwO.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-DU9qEpSd.js";import{t as je,n as yt}from"./ChevronUp-BOBhKnkD.js";var It=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,Tt]=it(Q),[ne]=vt(Q,[Tt,Re]),pe=Re(),[_t,G]=ne(Q),[Nt,Pt]=ne(Q),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,y]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:Q}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:Q}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=nt(g,p,y);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&It.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var J="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=J;var A=10,[He,Y]=ne(J),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,v=G(J,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of h)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=I=>{h={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{h.x<=10&&h.y<=10?I.preventDefault():x.contains(I.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=nt(T,h,R);I&&setTimeout(()=>I.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&(U(h),I&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(h.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const b=h.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(J,t),s=Y(J,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&y){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(l.dir!=="rtl"){const b=q.left-O.left,_=U.left-b,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const b=O.right-q.right,_=window.innerWidth-U.right-b,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(b?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,y,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(J,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),y=Math.max(p,g);if(y<S){const v=y+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=be(),g=d.useRef("touch"),y=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(bt.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,y=>m(y),i.onItemTextChange,y=>a.itemTextRefCallback?.(y,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Qe=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Qe.displayName=ye;var Je=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var Ie="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(Ie,t),s=Y(Ie,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Qt=Ue,Jt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Qe;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Qt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Jt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d};
1
+ import{r as d,cu as rt,cv as _e,j as c,cw as st,cx as be,cy as k,cz as lt,cA as j,cB as N,cC as $,cD as at,bQ as Ee,cE as Re,cF as it,cG as ct,cH as dt,cI as ut,cJ as pt,cK as ft,cL as mt,cM as ht,cN as vt,cO as gt,cP as xt,cQ as St,c as ee,l as oe,ai as wt}from"./index-CD3fj83c.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-D4YmJ5bn.js";import{t as je,n as yt}from"./ChevronUp-zgLSJo7N.js";var It=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,Tt]=it(Q),[ne]=vt(Q,[Tt,Re]),pe=Re(),[_t,G]=ne(Q),[Nt,Pt]=ne(Q),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:i,dir:u,name:f,autoComplete:m,disabled:w,required:C,form:S}=r,p=pe(e),[g,y]=d.useState(null),[v,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[P,O]=_e({prop:o,defaultProp:n??!1,onChange:l,caller:Q}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:Q}),L=d.useRef(null),B=g?S||!!g.closest("form"):!0,[W,V]=d.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return c.jsx(st,{...p,children:c.jsxs(_t,{required:C,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:d.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:d.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?c.jsxs(et,{"aria-hidden":!0,required:C,tabIndex:-1,name:f,autoComplete:m,value:U,onChange:E=>q(E.target.value),disabled:w,form:S,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};Me.displayName=Q;var Ae="SelectTrigger",Oe=d.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,l=pe(t),s=G(Ae,t),a=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),f=d.useRef("touch"),[m,w,C]=ot(p=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=nt(g,p,y);v!==void 0&&s.onValueChange(v.value)}),S=p=>{a||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...l,children:c.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:N(n.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{f.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(g&&p.key===" ")&&It.includes(p.key)&&(S(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:l,placeholder:s="",...a}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,f=l!==void 0,m=k(e,i.onValueNodeChange);return $(()=>{u(f)},[u,f]),c.jsx(j.span,{...a,ref:m,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):l})});ke.displayName=De;var Et="SelectIcon",Le=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});Le.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(at,{asChild:!0,...r});Be.displayName=Rt;var J="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(J,r.__scopeSelect),[o,n]=d.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const l=o;return l?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),l):null}return c.jsx(ze,{...r,ref:e})});Ve.displayName=J;var A=10,[He,Y]=ne(J),jt="SelectContentImpl",Mt=gt("SelectContent.RemoveScroll"),ze=d.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:l,onPointerDownOutside:s,side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g,...y}=r,v=G(J,t),[x,F]=d.useState(null),[M,re]=d.useState(null),P=k(e,h=>F(h)),[O,U]=d.useState(null),[q,L]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=d.useCallback(h=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of h)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=v;d.useEffect(()=>{if(x){let h={x:0,y:0};const T=I=>{h={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{h.x<=10&&h.y<=10?I.preventDefault():x.contains(I.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),d.useEffect(()=>{const h=()=>z(!1);return window.addEventListener("blur",h),window.addEventListener("resize",h),()=>{window.removeEventListener("blur",h),window.removeEventListener("resize",h)}},[z]);const[fe,ae]=ot(h=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=nt(T,h,R);I&&setTimeout(()=>I.ref.current.focus())}),me=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&(U(h),I&&(H.current=!0))},[v.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((h,T,R)=>{const I=!H.current&&!R;(v.value!==void 0&&v.value===T||I)&&L(h)},[v.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:a,sideOffset:i,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:c.jsx(ft,{as:Mt,allowPinchZoom:!0,children:c.jsx(mt,{asChild:!0,trapped:v.open,onMountAutoFocus:h=>{h.preventDefault()},onUnmountAutoFocus:N(n,h=>{v.trigger?.focus({preventScroll:!0}),h.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:h=>h.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,h=>{const T=h.ctrlKey||h.altKey||h.metaKey;if(h.key==="Tab"&&h.preventDefault(),!T&&h.key.length===1&&ae(h.key),["ArrowUp","ArrowDown","Home","End"].includes(h.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(h.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(h.key)){const b=h.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),h.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,l=G(J,t),s=Y(J,t),[a,i]=d.useState(null),[u,f]=d.useState(null),m=k(e,P=>f(P)),w=ue(t),C=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=s,x=d.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&u&&p&&g&&y){const P=l.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(l.dir!=="rtl"){const b=q.left-O.left,_=U.left-b,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.left=xe+"px"}else{const b=O.right-q.right,_=window.innerWidth-U.right-b,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(_,[A,Math.max(A,ge-ve)]);a.style.minWidth=Z+"px",a.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(g.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ie=B-te,se=g.offsetHeight/2,h=g.offsetTop+se,T=H+E+h,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;a.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(b?he:0)+_+D),Z=T+X;a.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;a.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;a.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}a.style.margin=`${A}px 0`,a.style.minHeight=fe+"px",a.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,l.trigger,l.valueNode,a,u,p,g,y,l.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(P=>{P&&S.current===!0&&(x(),v?.(),S.current=!1)},[x,v]);return c.jsx(Dt,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Fe.displayName=At;var Ot="SelectPopperPosition",Se=d.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...l}=r,s=pe(t);return c.jsx(xt,{...s,...l,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Ot;var[Dt,Te]=ne(J,{}),we="SelectViewport",Ue=d.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,l=Y(we,t),s=Te(we,t),a=k(e,l.onViewportChange),i=d.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),c.jsx(de.Slot,{scope:t,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:w}=s;if(w?.current&&m){const C=Math.abs(i.current-f.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(m.style.minHeight),g=parseFloat(m.style.height),y=Math.max(p,g);if(y<S){const v=y+C,x=Math.min(S,v),F=v-x;m.style.height=x+"px",m.style.bottom==="0px"&&(f.scrollTop=F>0?F:0,m.style.justifyContent="flex-end")}}}i.current=f.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return c.jsx(kt,{scope:t,id:n,children:c.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Bt.displayName=We;var Ke="SelectLabel",Vt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Lt(Ke,t);return c.jsx(j.div,{id:n.id,...o,ref:e})});Vt.displayName=Ke;var ce="SelectItem",[Ht,$e]=ne(ce),Ge=d.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:l,...s}=r,a=G(ce,t),i=Y(ce,t),u=a.value===o,[f,m]=d.useState(l??""),[w,C]=d.useState(!1),S=k(e,v=>i.itemRefCallback?.(v,o,n)),p=be(),g=d.useRef("touch"),y=()=>{n||(a.onValueChange(o),a.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Ht,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:d.useCallback(v=>{m(x=>x||(v?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:f,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:N(s.onPointerMove,v=>{g.current=v.pointerType,n?i.onItemLeave?.():g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,v=>{i.searchRef?.current!==""&&v.key===" "||(bt.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...l}=r,s=G(le,t),a=Y(le,t),i=$e(le,t),u=Pt(le,t),[f,m]=d.useState(null),w=k(e,y=>m(y),i.onItemTextChange,y=>a.itemTextRefCallback?.(y,i.value,i.disabled)),C=f?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:C},i.value),[i.disabled,i.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...l,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(l.children,s.valueNode):null]})});Ye.displayName=le;var qe="SelectItemIndicator",Xe=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return $e(qe,t).isSelected?c.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});Xe.displayName=qe;var Ce="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollTop>0;l(u)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop-i.offsetHeight)}}):null});Ze.displayName=Ce;var ye="SelectScrollDownButton",Qe=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,l]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let a=function(){const u=i.scrollHeight-i.clientHeight,f=Math.ceil(i.scrollTop)<u;l(f)};const i=t.viewport;return a(),i.addEventListener("scroll",a),()=>i.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),n?c.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Qe.displayName=ye;var Je=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,l=Y("SelectScrollButton",t),s=d.useRef(null),a=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{a().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{l.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{i()})})}),zt="SelectSeparator",Ft=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return c.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ft.displayName=zt;var Ie="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),l=G(Ie,t),s=Y(Ie,t);return l.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),l=k(o,n),s=ct(e);return d.useEffect(()=>{const a=n.current;if(!a)return;const i=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&f){const m=new Event("change",{bubbles:!0});f.call(a,e),a.dispatchEvent(m)}},[s,e]),c.jsx(j.select,{...t,style:{...Ct,...t.style},ref:l,defaultValue:e})});et.displayName=Wt;function tt(r){return r===""||r===void 0}function ot(r){const e=dt(r),t=d.useRef(""),o=d.useRef(0),n=d.useCallback(s=>{const a=t.current+s;e(a),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(a)},[e]),l=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,l]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,l=t?r.indexOf(t):-1;let s=Kt(r,Math.max(l,0));n.length===1&&(s=s.filter(u=>u!==t));const i=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==t?i:void 0}function Kt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var $t=Me,Gt=Oe,Yt=ke,qt=Le,Xt=Be,Zt=Ve,Qt=Ue,Jt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Qe;function co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(Qt,{className:C,children:t}),e[13]=t,e[14]=C,e[15]=S):S=e[15];let p;e[16]!==i?(p=!i&&c.jsx(ro,{}),e[16]=i,e[17]=p):p=e[17];let g;return e[18]!==a||e[19]!==n||e[20]!==f||e[21]!==m||e[22]!==S||e[23]!==p?(g=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:f,position:a,...n,children:[m,S,p]})}),e[18]=a,e[19]=n,e[20]=f,e[21]=m,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(Jt,{"data-slot":"select-item",className:u,...l,children:[f,m]}),e[14]=l,e[15]=u,e[16]=f,e[17]=m,e[18]=w):w=e[18],w}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(yt,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=c.jsx(je,{className:"size-4"}),e[5]=l):l=e[5];let s;return e[6]!==o||e[7]!==n?(s=c.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:l}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{co as S,uo as a,po as b,mo as c,fo as d};
@@ -1 +1 @@
1
- import{c as $,b as A,r as R,l as G,j as l,B as H,s as J,x as K,v as Q,D as U}from"./index-D_g5fbwO.js";import{c as V,b as W,a as X,D as Y}from"./drawer-cCeHz-L_.js";import{u as Z}from"./use-mobile-DkF4ktIE.js";import{d as ee}from"./chat-context-CMHTyqVA.js";import{S as F,a as le,M as se,c as te}from"./index-DXUKwqTT.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:s,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==s||e[5]!==w||e[6]!==i?(c=i?l.jsx(F,{model:s??null,placeholder:w,isLoading:I}):l.jsx(ne,{placeholder:w}),e[3]=I,e[4]=s,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=l.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(le,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==s||e[16]!==k||e[17]!==b||e[18]!==i?(N=l.jsx(R.Suspense,{fallback:y,children:i?l.jsx(se,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:s??null,onModelChange:b,filterModels:E}):l.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=s,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(q){let g;e[20]!==m?(g=l.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=l.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=l.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=l.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=l.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=l.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=l.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=l.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=l.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let s;return e[0]!==n||e[1]!==t||e[2]!==o?(s=l.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=s):s=e[3],s}export{me as M};
1
+ import{c as $,b as A,r as R,l as G,j as l,B as H,s as J,x as K,v as Q,D as U}from"./index-CD3fj83c.js";import{c as V,b as W,a as X,D as Y}from"./drawer-DVDEynMl.js";import{u as Z}from"./use-mobile-C7tjJGs8.js";import{d as ee}from"./chat-context-B0QfMtK7.js";import{S as F,a as le,M as se,c as te}from"./index-DGMpoxyU.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:s,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==s||e[5]!==w||e[6]!==i?(c=i?l.jsx(F,{model:s??null,placeholder:w,isLoading:I}):l.jsx(ne,{placeholder:w}),e[3]=I,e[4]=s,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=l.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(le,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==s||e[16]!==k||e[17]!==b||e[18]!==i?(N=l.jsx(R.Suspense,{fallback:y,children:i?l.jsx(se,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:s??null,onModelChange:b,filterModels:E}):l.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=s,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(q){let g;e[20]!==m?(g=l.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=l.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=l.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=l.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=l.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=l.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=l.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=l.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=l.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let s;return e[0]!==n||e[1]!==t||e[2]!==o?(s=l.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=s):s=e[3],s}export{me as M};