decocms 4.603.0 → 4.604.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/dist/client/assets/{AlertCircle-B1i_KHb5.js → AlertCircle-DOl7I58f.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BatAqoOF.js → AreaChart-CHROtZD-.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BCGEiplU.js → ArrowLeft-BmWvQCuj.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CTKbq3xg.js → ArrowRight-hKo-D3nP.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-D0iB56_y.js → ArrowUp-DjdsK6g2.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-BRGBbO1d.js → BookOpen01-7rkhx8M3.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-Da5DoyQ3.js → CartesianChart-OsEP4Qzo.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-C0a7-8vN.js → CategoricalChart-BnAT_zaF.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-DhVhQqv1.js → CheckCircle-Dc3WHxxP.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-nlBmBA6R.js → ChevronDown-DL6BIz5f.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-CnSsPRgV.js → ChevronSelectorVertical-DG5kbzU4.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-8WNgfyfx.js → ChevronUp-raY54gH6.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DXlMDhFZ.js → CreditCard01-CbsMKYPA.js} +1 -1
  14. package/dist/client/assets/{Eye-uwbxmI34.js → Eye-C0HPiOiR.js} +1 -1
  15. package/dist/client/assets/{File02-CFPVdIh1.js → File02-Cq5pqf-S.js} +1 -1
  16. package/dist/client/assets/{Fingerprint04-BCose3-q.js → Fingerprint04-CgjCScjZ.js} +1 -1
  17. package/dist/client/assets/{Globe04-CVG10uFQ.js → Globe04-BNrVMBgu.js} +1 -1
  18. package/dist/client/assets/{Image01-BIaadP6j.js → Image01-B9u1sRLC.js} +1 -1
  19. package/dist/client/assets/{Key01-CBM6N1XG.js → Key01-CimmnNZ7.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-BdexGOTP.js → LayoutLeft-DntDUImX.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-wmCuBJVN.js → LinkBroken01-CVzXRHEr.js} +1 -1
  22. package/dist/client/assets/{MessageCircle01-BgFAVnEo.js → MessageCircle01-BhIvz7K8.js} +1 -1
  23. package/dist/client/assets/{Minus-CWR3qyH5.js → Minus-2Ocru1Vv.js} +1 -1
  24. package/dist/client/assets/{Monitor01-BQDnuBH5.js → Monitor01-B6F_ox0H.js} +1 -1
  25. package/dist/client/assets/{Play-1a_lTdjO.js → Play-CXqP7dUq.js} +1 -1
  26. package/dist/client/assets/{Plus-BjA7v0aW.js → Plus-C3X8_FHI.js} +1 -1
  27. package/dist/client/assets/{ReferenceLine-D_7wN1zT.js → ReferenceLine-NPuou87Q.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DLHPy6Uo.js → SearchMd-DhrULjIK.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-DH3DKaiC.js → ShoppingBag01-Bvv8RGv1.js} +1 -1
  30. package/dist/client/assets/{Sun-CF9jssUY.js → Sun-8WH0s68D.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CCkkKeRG.js → SwitchHorizontal01-DgSPPtsf.js} +1 -1
  32. package/dist/client/assets/{Tool01-sUxKxzA1.js → Tool01-Behnzz1u.js} +1 -1
  33. package/dist/client/assets/{Tooltip-BPKjbLoB.js → Tooltip-Dc0P19dp.js} +1 -1
  34. package/dist/client/assets/{Trash01-BJHdmQwJ.js → Trash01-PZdGVeLy.js} +1 -1
  35. package/dist/client/assets/{Upload01-_qHCYjHc.js → Upload01-Bkeloppd.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-CpCxuE-I.js → UserCheck01-C_H-l_wV.js} +1 -1
  37. package/dist/client/assets/{UserSquare-DB6NyDzI.js → UserSquare-B41X0756.js} +1 -1
  38. package/dist/client/assets/{Users01-DwRKp1C7.js → Users01-DQ_THwqW.js} +1 -1
  39. package/dist/client/assets/{XClose-oM6nZllg.js → XClose-Bj-C863w.js} +1 -1
  40. package/dist/client/assets/{Zap-ahofKysd.js → Zap-BkyYaQsJ.js} +1 -1
  41. package/dist/client/assets/{access-gate-KCOTCCf5.js → access-gate-eWIkeT9E.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-DxavYAc5.js → add-connection-dialog-NzJ7NedS.js} +1 -1
  43. package/dist/client/assets/agent-app-C71SvJ1z.js +1 -0
  44. package/dist/client/assets/{agent-assets-bki_BdbO.js → agent-assets-BbBAbjVC.js} +1 -1
  45. package/dist/client/assets/{agent-automation-BjBB8AsX.js → agent-automation-DCxEPkPB.js} +1 -1
  46. package/dist/client/assets/{agent-automations-Cm9PwMtc.js → agent-automations-odNdy5iD.js} +1 -1
  47. package/dist/client/assets/{agent-blog-BIccwwgd.js → agent-blog-CScrLQSN.js} +2 -2
  48. package/dist/client/assets/{agent-blog-post-Cner4u82.js → agent-blog-post-h32FyYTX.js} +2 -2
  49. package/dist/client/assets/{agent-business-case-DInds5Fa.js → agent-business-case-kU44KOYR.js} +1 -1
  50. package/dist/client/assets/{agent-calendar-YS_hatl_.js → agent-calendar-BaQiRVwa.js} +1 -1
  51. package/dist/client/assets/{agent-capabilities-DQK_jZxT.js → agent-capabilities-DvWcNy_n.js} +1 -1
  52. package/dist/client/assets/{agent-connect-sources-DXQ8E_bH.js → agent-connect-sources-BlrAmQSh.js} +1 -1
  53. package/dist/client/assets/agent-deck-BjDvpfbk.js +1 -0
  54. package/dist/client/assets/{agent-e2e-B_DXqaOr.js → agent-e2e-rlhoyHNn.js} +1 -1
  55. package/dist/client/assets/agent-experiments-ByuIsZp1.js +1 -0
  56. package/dist/client/assets/agent-file-jUy0J5UO.js +1 -0
  57. package/dist/client/assets/{agent-hosting-BDgeryfy.js → agent-hosting-xIODr6dk.js} +1 -1
  58. package/dist/client/assets/{agent-icon-CCxR2PUF.js → agent-icon-CRYupZK6.js} +1 -1
  59. package/dist/client/assets/agent-library-3pKzgj4X.js +1 -0
  60. package/dist/client/assets/agent-library-file-DMOMvX_-.js +1 -0
  61. package/dist/client/assets/agent-overview-BgGz6mht.js +1 -0
  62. package/dist/client/assets/{agent-releases-CgzQoR8b.js → agent-releases-Ds8xMFb7.js} +1 -1
  63. package/dist/client/assets/agent-settings-Dig5NHoM.js +1 -0
  64. package/dist/client/assets/{agent-site-editor-DEHW4gut.js → agent-site-editor-BelQhrYx.js} +1 -1
  65. package/dist/client/assets/agent-site-editor-code-h78IlWiZ.js +2 -0
  66. package/dist/client/assets/agent-site-editor-content-2ZBJ4zZj.js +1 -0
  67. package/dist/client/assets/agent-site-editor-preview-BraJrHar.js +1 -0
  68. package/dist/client/assets/agent-view-B3lvytKO.js +1 -0
  69. package/dist/client/assets/{agent-view-guard-OIhvT-yY.js → agent-view-guard-BAEBWQAm.js} +1 -1
  70. package/dist/client/assets/{ai-providers-MAlxtZWl.js → ai-providers-C-smMnWX.js} +1 -1
  71. package/dist/client/assets/{alert-De4kstIi.js → alert-Bs4Syrmu.js} +1 -1
  72. package/dist/client/assets/{analytics-sections-CUSeaKMg.js → analytics-sections-Bawwr646.js} +1 -1
  73. package/dist/client/assets/api-keys-B_GgSNFa.js +1 -0
  74. package/dist/client/assets/{api-keys-C30Nc0_c.js → api-keys-U-JlvfTL.js} +1 -1
  75. package/dist/client/assets/{app-editor-De7hF7Xe.js → app-editor-WCrTicET.js} +1 -1
  76. package/dist/client/assets/{asset-utils-CCfbAgp6.js → asset-utils-DoL_7JcS.js} +1 -1
  77. package/dist/client/assets/{auth-CdyebVHG.js → auth-DGjdHSEc.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-BSDpVceg.js → auth-catchall-BWASEMo1.js} +1 -1
  79. package/dist/client/assets/{auth-entry-Bs4JvKas.js → auth-entry-dIBGSy6P.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-DIFNHgz-.js → auth-split-layout-DDrzNH-L.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-CqTPiorC.js → authenticate-and-persist-oauth-CjHuO6dU.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-Bf8n7Ce9.js → automation-list-row-DcNq7Z4r.js} +1 -1
  83. package/dist/client/assets/{automation-runs-B335XfRz.js → automation-runs-BC4l1zMu.js} +1 -1
  84. package/dist/client/assets/{automations-_jKv_9NQ.js → automations-Dc5cIs_X.js} +1 -1
  85. package/dist/client/assets/{badge-B0BpLsJr.js → badge-BGQjXG0j.js} +1 -1
  86. package/dist/client/assets/{block-document-B6Da88vX.js → block-document-CGUsaamm.js} +1 -1
  87. package/dist/client/assets/{blocks-preview-workspace-context-CnaBqVkb.js → blocks-preview-workspace-context-BGA1iNqV.js} +1 -1
  88. package/dist/client/assets/{blocks-tab-states-DVnYU043.js → blocks-tab-states-D1zjsV30.js} +1 -1
  89. package/dist/client/assets/{blog-preview-url-DL_rJm3r.js → blog-preview-url--uTbBsfv.js} +1 -1
  90. package/dist/client/assets/{blog-schema-CrH-PuPl.js → blog-schema-C6967KEc.js} +1 -1
  91. package/dist/client/assets/{blog-source-gate-D95rUZ9j.js → blog-source-gate-BXjDbubC.js} +1 -1
  92. package/dist/client/assets/{blog-view-gate-BG5wPvov.js → blog-view-gate-DsWcmH7R.js} +1 -1
  93. package/dist/client/assets/{buckets-Bo5nzqO0.js → buckets-OSyRMTtV.js} +1 -1
  94. package/dist/client/assets/{build-improve-prompt-doc-DwEARBAF.js → build-improve-prompt-doc-BQOPGw-y.js} +1 -1
  95. package/dist/client/assets/{calendar-aJ3MwRAc.js → calendar-B6JrW2Q2.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-B-8XRgnZ.js → capability-load-error-42G-R10i.js} +1 -1
  97. package/dist/client/assets/{category-editor-CqQ44lOA.js → category-editor-MmJTq52p.js} +1 -1
  98. package/dist/client/assets/{category-tree-CPJhn4HZ.js → category-tree-ByM1arx3.js} +1 -1
  99. package/dist/client/assets/{chart-Bi7xT2_A.js → chart-DQuSYpgP.js} +1 -1
  100. package/dist/client/assets/{chat-context-BIbY01K8.js → chat-context-hCQ1mfTr.js} +1 -1
  101. package/dist/client/assets/{chat-draft-CiDkLbs7.js → chat-draft-BMedUjWc.js} +1 -1
  102. package/dist/client/assets/{checkbox-C5arK3Yi.js → checkbox-gfRmCHgt.js} +1 -1
  103. package/dist/client/assets/{choose-editor-m1LEJ76m.js → choose-editor-CyxpRT6n.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-DrTHS67O.js → cli-auth-success-C2Sv7dRn.js} +1 -1
  105. package/dist/client/assets/{cms-settings-editor-D2W2Hqjk.js → cms-settings-editor-CBaVB0n1.js} +1 -1
  106. package/dist/client/assets/{cms-store-drafts-SXWusaIT.js → cms-store-drafts-BNUrt0he.js} +1 -1
  107. package/dist/client/assets/{collapsible-uGD63SVW.js → collapsible-9A7TtF9U.js} +1 -1
  108. package/dist/client/assets/{collection-detail-1M3m9BeX.js → collection-detail-BClDIo_j.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-CxJUfsBC.js → collection-display-button-B0r3Zm1X.js} +1 -1
  110. package/dist/client/assets/{collection-search-5yetxvaM.js → collection-search-BO1f-lS0.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-D55eHieQ.js → collection-table-wrapper-Dydnztie.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-DWExNyAp.js → collection-tabs-CdNYsFdX.js} +1 -1
  113. package/dist/client/assets/{combobox-BQpDbntt.js → combobox-CVSWURlo.js} +1 -1
  114. package/dist/client/assets/{command-CGZn32g4.js → command-B2QNmjQS.js} +1 -1
  115. package/dist/client/assets/{companion-mcps-section-DauSR__w.js → companion-mcps-section-BaMmvy2q.js} +1 -1
  116. package/dist/client/assets/{config-D953tTPf.js → config-BREyAdNr.js} +1 -1
  117. package/dist/client/assets/{connect-BL5f_sMR.js → connect-BcWscn1t.js} +1 -1
  118. package/dist/client/assets/{connect-key-LpmiQ5t8.js → connect-key-B0zKFgzW.js} +1 -1
  119. package/dist/client/assets/{connect-layout-BBcCp91i.js → connect-layout-rhUcxeLp.js} +1 -1
  120. package/dist/client/assets/{connect-source-dialog-JNdJSpW0.js → connect-source-dialog-D4HLTtef.js} +1 -1
  121. package/dist/client/assets/{connection-BU3CbBAB.js → connection-DZKAjgLL.js} +1 -1
  122. package/dist/client/assets/{connection-card-Cchv_P1a.js → connection-card-CmxtqmDv.js} +1 -1
  123. package/dist/client/assets/{connection-detail-Fmp6uqV3.js → connection-detail-BLP0uW7Y.js} +1 -1
  124. package/dist/client/assets/{connection-form-helpers-B6YdkPP6.js → connection-form-helpers-DUSDhzNd.js} +1 -1
  125. package/dist/client/assets/{connection-slug-Dby8IQVH.js → connection-slug-DJTdEjhG.js} +1 -1
  126. package/dist/client/assets/{connections-IzFG7l5m.js → connections-DrdA1hf2.js} +1 -1
  127. package/dist/client/assets/{content-changes-wc9FH6jt.js → content-changes-BqXl80v8.js} +1 -1
  128. package/dist/client/assets/{content-tab-D2jQvTTQ.js → content-tab-BEf-lhCQ.js} +3 -3
  129. package/dist/client/assets/{context-CVCs23mW.js → context-CPurNnFb.js} +1 -1
  130. package/dist/client/assets/{context-menu-C473OUCT.js → context-menu-DweTBGtJ.js} +1 -1
  131. package/dist/client/assets/{context-shell-DEGgebgQ.js → context-shell-CWTDaTXc.js} +3 -3
  132. package/dist/client/assets/{create-organization-dialog-CmhbSoK2.js → create-organization-dialog-C_3ruR8s.js} +1 -1
  133. package/dist/client/assets/{daily-pulse-0NkQHK_z.js → daily-pulse-Bcg8lP8r.js} +1 -1
  134. package/dist/client/assets/{delete-copy-D7fJPRdo.js → delete-copy-BGgLzwd2.js} +1 -1
  135. package/dist/client/assets/{device-hint-CddROpzx.js → device-hint-DnbqoU71.js} +1 -1
  136. package/dist/client/assets/{discover-DXj_hJ6j.js → discover-Dsw6AIzG.js} +1 -1
  137. package/dist/client/assets/{domain-settings-CPXAlxYa.js → domain-settings-DjCfB1kU.js} +1 -1
  138. package/dist/client/assets/{drawer-CPRS7vw4.js → drawer-BNjWjF9M.js} +1 -1
  139. package/dist/client/assets/{editor-D4mLuwGY.js → editor-B0cDiaJa.js} +1 -1
  140. package/dist/client/assets/{editor-classes-EyIn6Xdz.js → editor-classes-C7OZWc8j.js} +1 -1
  141. package/dist/client/assets/{empty-state-VIxg_A9_.js → empty-state-CFi8rSdz.js} +1 -1
  142. package/dist/client/assets/{empty-state-DfXiNtjV.js → empty-state-TATcP6j6.js} +1 -1
  143. package/dist/client/assets/{experiments-tab-choice-DDiQfeRQ.js → experiments-tab-choice-DT0xlF2U.js} +1 -1
  144. package/dist/client/assets/{extract-connection-data-CY4kvgmG.js → extract-connection-data-DBf70_By.js} +1 -1
  145. package/dist/client/assets/{feature-gate-BqWMf-_U.js → feature-gate-ELdJQBJt.js} +1 -1
  146. package/dist/client/assets/{feature-paywall-4c2c7IX1.js → feature-paywall-D1djKiP_.js} +1 -1
  147. package/dist/client/assets/{file-explorer-1_QBD_NG.js → file-explorer-BW2uODO-.js} +1 -1
  148. package/dist/client/assets/{file-preview-Cs564GPy.js → file-preview-CUUPp-37.js} +1 -1
  149. package/dist/client/assets/{file-share-button-BREhD61g.js → file-share-button-CApR6POs.js} +1 -1
  150. package/dist/client/assets/{file-type-icon-Dr1Fctbf.js → file-type-icon-CwbVdKyV.js} +1 -1
  151. package/dist/client/assets/{folder-icon-Csn4Yrp8.js → folder-icon-DXxFgD1Q.js} +1 -1
  152. package/dist/client/assets/{form-CdIohY1c.js → form-Pa5TasVH.js} +1 -1
  153. package/dist/client/assets/{frame-navigation-DTZvas3c.js → frame-navigation-C7ZkDufj.js} +1 -1
  154. package/dist/client/assets/{gateway-client-uysD9si3.js → gateway-client-Bys0ijDk.js} +1 -1
  155. package/dist/client/assets/{general-BptiPTam.js → general-Bh7AigA1.js} +1 -1
  156. package/dist/client/assets/{github-icon-BFtlg-Wu.js → github-icon-B__6ogZQ.js} +1 -1
  157. package/dist/client/assets/{held-block-view-Bv5JhAeN.js → held-block-view-DbLxQ9uU.js} +1 -1
  158. package/dist/client/assets/{home-DzRsJbBG.js → home-GNj9GQN2.js} +1 -1
  159. package/dist/client/assets/{home-overview-BoyNS0NF.js → home-overview-D8MBYfsN.js} +1 -1
  160. package/dist/client/assets/{hosted-reconcile-Bt0PeuzR.js → hosted-reconcile-D6Q09K-j.js} +1 -1
  161. package/dist/client/assets/{icon-button-CCNwQPnV.js → icon-button-QNTv5QKa.js} +1 -1
  162. package/dist/client/assets/{index-BzRhR-ob.js → index-B1J4AkqW.js} +1 -1
  163. package/dist/client/assets/{index-Bkszoj0s.js → index-Bf4OrjgG.js} +1 -1
  164. package/dist/client/assets/{index-DzkOamns.js → index-BrKquY8S.js} +1 -1
  165. package/dist/client/assets/{index-BozwbZx0.js → index-Bu31SDiQ.js} +1 -1
  166. package/dist/client/assets/{index-BRun9Rm8.js → index-BuJZ15yz.js} +1 -1
  167. package/dist/client/assets/{index-uTqcpy5-.js → index-C2oHODUV.js} +1 -1
  168. package/dist/client/assets/{index-CFlFN6F_.js → index-CgGY_MUf.js} +1 -1
  169. package/dist/client/assets/{index-DJkxmUQB.js → index-CnCdfGnF.js} +1 -1
  170. package/dist/client/assets/{index-B0mJrf1q.js → index-De0nOX9a.js} +1 -1
  171. package/dist/client/assets/{index-mYSq1oWI.js → index-Dn-dq-as.js} +1 -1
  172. package/dist/client/assets/{index-D9ty5Ie3.js → index-Dws-zNMb.js} +3 -3
  173. package/dist/client/assets/{index-Tv3hc6zd.js → index-IhqNI3vv.js} +1 -1
  174. package/dist/client/assets/{index-BtxZs6tJ.js → index-MLF30Ige.js} +1 -1
  175. package/dist/client/assets/{index-HakIuCjg.js → index-SpspP6ks.js} +1 -1
  176. package/dist/client/assets/{index-DcsJJ-05.js → index-_f9s6__b.js} +1 -1
  177. package/dist/client/assets/{index-D5JoEpF6.js → index-c8rWa20q.js} +1 -1
  178. package/dist/client/assets/{index-CVCo7BMR.js → index-fkcdmHCO.js} +1 -1
  179. package/dist/client/assets/{index-redirect-C9EBDDcV.js → index-redirect-CKWg5EUm.js} +1 -1
  180. package/dist/client/assets/{infiniteQueryObserver-jl0ag-ci.js → infiniteQueryObserver-BpNLIIMd.js} +1 -1
  181. package/dist/client/assets/{infra-billing-D4LI6DuO.js → infra-billing-BD3cfGA0.js} +1 -1
  182. package/dist/client/assets/{input-C0LL8dKB.js → input-BhEEornx.js} +3 -3
  183. package/dist/client/assets/{input-Cabkyu6z.js → input-D3Q9ceVY.js} +1 -1
  184. package/dist/client/assets/{integration-icon-DwE31eP3.js → integration-icon-Dtv10prb.js} +1 -1
  185. package/dist/client/assets/{item-actions-CSc52fWk.js → item-actions-DkT2jQ2-.js} +1 -1
  186. package/dist/client/assets/{jira-icon-BvdOnDqx.js → jira-icon-BdyWZd_c.js} +1 -1
  187. package/dist/client/assets/{label-BuyeEoKy.js → label-DKw_OehI.js} +1 -1
  188. package/dist/client/assets/{layout-Ba4dt8sO.js → layout-BrYSk9r1.js} +1 -1
  189. package/dist/client/assets/{legacy-admin-welcome-dialog-D8acRK4o.js → legacy-admin-welcome-dialog-DEMRqSrw.js} +1 -1
  190. package/dist/client/assets/{legacy-agents-deep-b_6N3FLP.js → legacy-agents-deep-CgBlx1CF.js} +1 -1
  191. package/dist/client/assets/{legacy-main-redirect-BGpepCkG.js → legacy-main-redirect-C1wo3-kp.js} +1 -1
  192. package/dist/client/assets/library-DsfxsidZ.js +1 -0
  193. package/dist/client/assets/{library-tab-Di9PinwS.js → library-tab-Dkg9kVd0.js} +1 -1
  194. package/dist/client/assets/{login-CVt0XOKO.js → login-D6GGUA0-.js} +1 -1
  195. package/dist/client/assets/{markdown-DS2iRx8j.js → markdown-I8GzTJiA.js} +1 -1
  196. package/dist/client/assets/{mcp-app-renderer-Bvu3N1R4.js → mcp-app-renderer-DK2j0Tue.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-Vq46kgZK.js → mcp-oauth-BBOvXanh.js} +1 -1
  198. package/dist/client/assets/{mcp-oauth-BN54afSi.js → mcp-oauth-CkvfyqHv.js} +1 -1
  199. package/dist/client/assets/{members-DAn8pfag.js → members-B4o6EiqS.js} +1 -1
  200. package/dist/client/assets/{memory-DeZ-uHq4.js → memory-Djy6FgRy.js} +1 -1
  201. package/dist/client/assets/{mock-board-Aslmwo3O.js → mock-board-Cpnf4v2l.js} +3 -3
  202. package/dist/client/assets/{monaco-editor-CBnaevuh.js → monaco-editor-xIopiH53.js} +1 -1
  203. package/dist/client/assets/{monitoring-C9ix8aKx.js → monitoring-CYlEmiQJ.js} +1 -1
  204. package/dist/client/assets/{monitoring-stats-row-DxAzeLPb.js → monitoring-stats-row-C_1DRrgj.js} +1 -1
  205. package/dist/client/assets/{multi-select-BmlA-Vkc.js → multi-select-DtgGxgFU.js} +1 -1
  206. package/dist/client/assets/{mustache-_Z8_qqHJ.js → mustache-D-BETM-H.js} +1 -1
  207. package/dist/client/assets/{named-rule-step-BKavlQpM.js → named-rule-step-CTOrHhtq.js} +1 -1
  208. package/dist/client/assets/{named-rule-view-mIjQh4kC.js → named-rule-view-Dqd8JDXo.js} +1 -1
  209. package/dist/client/assets/{new-project-dialog-B7_EHGk8.js → new-project-dialog-By4VEC8c.js} +1 -1
  210. package/dist/client/assets/{new-project-store-B8n3b_tZ.js → new-project-store-CUdxp2Iq.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-BkAHMpfw.js → oauth-callback-3aGVKy0C.js} +1 -1
  212. package/dist/client/assets/{oauth-callback-ai-provider-xDulFiUG.js → oauth-callback-ai-provider-ZYl2SIBX.js} +1 -1
  213. package/dist/client/assets/{oauth-consent-6ruRlSKT.js → oauth-consent-DpgwsgKr.js} +1 -1
  214. package/dist/client/assets/{onboarding-B3SEF9Uz.js → onboarding-DMrvJ-1o.js} +1 -1
  215. package/dist/client/assets/{openai-conversation-DwsKeDmu.js → openai-conversation-FoZ_S--c.js} +1 -1
  216. package/dist/client/assets/{optimistic-project-sidebar-views-BlwdlPER.js → optimistic-project-sidebar-views-p1mhNVPC.js} +1 -1
  217. package/dist/client/assets/{order-monitor-day-DF8bo2MK.js → order-monitor-day-dq36PLvw.js} +1 -1
  218. package/dist/client/assets/{organization-choice-vGHdcSHL.js → organization-choice-DgqvLrXA.js} +1 -1
  219. package/dist/client/assets/{orgs-HP_pPrQW.js → orgs-DRJMoNSK.js} +1 -1
  220. package/dist/client/assets/{own-accounts-section-w0ng40tn.js → own-accounts-section-DMwQVXvm.js} +1 -1
  221. package/dist/client/assets/{pair-C7XMWJ-9.js → pair-DpQo0BNT.js} +1 -1
  222. package/dist/client/assets/{parse-sections-CvIBHt2L.js → parse-sections-DXT317Uu.js} +2 -2
  223. package/dist/client/assets/plan-CMRFe-mo.js +1 -0
  224. package/dist/client/assets/{plan-ladder-BwPwd0L2.js → plan-ladder-CnLJjRvN.js} +1 -1
  225. package/dist/client/assets/{plan-page-BHiPZfGS.js → plan-page-DnL7Do53.js} +1 -1
  226. package/dist/client/assets/{plan-usage-card-DBESPEVj.js → plan-usage-card-B34rpydZ.js} +1 -1
  227. package/dist/client/assets/{popover-CkZGLhNA.js → popover-DYPQiSv-.js} +1 -1
  228. package/dist/client/assets/{post-calendar-CsQoNT7s.js → post-calendar-Hw4CH9hh.js} +1 -1
  229. package/dist/client/assets/{post-editor-ChkfOap8.js → post-editor-IcyR5Vhc.js} +1 -1
  230. package/dist/client/assets/{preview-content-A5KuW_i0.js → preview-content-BAdlr8nf.js} +1 -1
  231. package/dist/client/assets/{preview-dialog-CISa3xH2.js → preview-dialog-KktCHUW7.js} +1 -1
  232. package/dist/client/assets/{preview-panel-Is_T5mgd.js → preview-panel-CNDYDX6W.js} +1 -1
  233. package/dist/client/assets/{preview-tab-QE2EzqbO.js → preview-tab-B7EBuwmn.js} +3 -3
  234. package/dist/client/assets/{primitives-DuwBkkiW.js → primitives-BaWMtJkC.js} +1 -1
  235. package/dist/client/assets/{product-picker-dialog-BgfiINnh.js → product-picker-dialog-CxX3Naw5.js} +1 -1
  236. package/dist/client/assets/{profile-BBSVuOzV.js → profile-hGi6FGDf.js} +1 -1
  237. package/dist/client/assets/{project-app-view-BKpC7rlM.js → project-app-view-Bdd69u96.js} +1 -1
  238. package/dist/client/assets/{project-apps-CIIh9MmH.js → project-apps-Cg1RITYg.js} +1 -1
  239. package/dist/client/assets/{project-icon-B83l1FFE.js → project-icon-CnIB282t.js} +1 -1
  240. package/dist/client/assets/{project-index-DAyEgqrx.js → project-index-8q3yX-Uv.js} +1 -1
  241. package/dist/client/assets/project-reports-Db6zzNbO.js +1 -0
  242. package/dist/client/assets/project-tasks-CF_ifB3s.js +1 -0
  243. package/dist/client/assets/{projects-m3alzMbh.js → projects-DUFVb_Eu.js} +1 -1
  244. package/dist/client/assets/{projects-empty-state-DRs0zzkN.js → projects-empty-state-AcD2jgiE.js} +1 -1
  245. package/dist/client/assets/{prompts-CcRTCjj0.js → prompts-uwcT3BPA.js} +1 -1
  246. package/dist/client/assets/record-editor-CEdK2d-r.js +1 -0
  247. package/dist/client/assets/{redirect-editor-CBbV9fjW.js → redirect-editor-DY-z2TOu.js} +1 -1
  248. package/dist/client/assets/{reports-CceluTq4.js → reports-D1w053nd.js} +1 -1
  249. package/dist/client/assets/reports-RNPSh_Zh.js +1 -0
  250. package/dist/client/assets/{reports-onboarding-CW6RZc4O.js → reports-onboarding-GadOWDmM.js} +1 -1
  251. package/dist/client/assets/{reports-tab-C2ZjDmEI.js → reports-tab-aeJlri8p.js} +2 -2
  252. package/dist/client/assets/{repositories-CVirrF3U.js → repositories-1nzckZN-.js} +1 -1
  253. package/dist/client/assets/repositories-BqlH0wbe.js +1 -0
  254. package/dist/client/assets/{repository-binding-DCgII80m.js → repository-binding-CWC5A7qh.js} +1 -1
  255. package/dist/client/assets/{repository-picker-GD3a62Se.js → repository-picker-D7iBCD48.js} +1 -1
  256. package/dist/client/assets/{require-capability-BIdAaoMl.js → require-capability-3oK6BlmT.js} +1 -1
  257. package/dist/client/assets/{required-auth-layout-CJHidYLF.js → required-auth-layout-BZu2puaM.js} +1 -1
  258. package/dist/client/assets/{reset-password-CrDFD2Qo.js → reset-password-AIsPR66k.js} +1 -1
  259. package/dist/client/assets/{resizable-B9Eyi_ji.js → resizable-CoEd5jC-.js} +1 -1
  260. package/dist/client/assets/{resolve-tab-icon-CKM9oCio.js → resolve-tab-icon-C5OdYCvh.js} +1 -1
  261. package/dist/client/assets/{review-settings-BAe760uV.js → review-settings-Bl4aIl2S.js} +1 -1
  262. package/dist/client/assets/{role-color-B1Um4Dsq.js → role-color-BCrv5q_m.js} +1 -1
  263. package/dist/client/assets/{roles-DKVzo-vg.js → roles-DsDYBJkJ.js} +1 -1
  264. package/dist/client/assets/{route-D40yQj0l.js → route-4dsNdFR2.js} +1 -1
  265. package/dist/client/assets/route-Cg85sfCm.js +1 -0
  266. package/dist/client/assets/{route-page-header-CcVg-Vnk.js → route-page-header-CNcRyRHi.js} +1 -1
  267. package/dist/client/assets/{route-BkuglpaW.js → route-tOhzLIKu.js} +1 -1
  268. package/dist/client/assets/{sandbox-git-api-kZT1B2wI.js → sandbox-git-api--HjjhyJS.js} +1 -1
  269. package/dist/client/assets/{sandbox-lifecycle-context-OY_YTYCF.js → sandbox-lifecycle-context-CRW6W9ms.js} +1 -1
  270. package/dist/client/assets/{save-status-CbCdWhQw.js → save-status-CgoD-OSr.js} +1 -1
  271. package/dist/client/assets/{schema-CId4jxC-.js → schema-DE06prrW.js} +1 -1
  272. package/dist/client/assets/{schema-CTzV9RXv.js → schema-Dd9rXy7Q.js} +1 -1
  273. package/dist/client/assets/{scroll-area-R9Qlcbsn.js → scroll-area-yE4b8t8z.js} +1 -1
  274. package/dist/client/assets/{search-input-BXEVxZTu.js → search-input-BvwG9Gpz.js} +1 -1
  275. package/dist/client/assets/{search-toggle-G2iKVtD4.js → search-toggle-wnRo19F5.js} +1 -1
  276. package/dist/client/assets/{secret-picker-DP_k-tRN.js → secret-picker-C2R7R70s.js} +1 -1
  277. package/dist/client/assets/{secrets-BXKvytJe.js → secrets-DajbQRIu.js} +1 -1
  278. package/dist/client/assets/{section-array-field-ClatUqIl.js → section-array-field-BSa-R005.js} +1 -1
  279. package/dist/client/assets/{sections-DGuQLA5Q.js → sections-TTZmo3Uk.js} +1 -1
  280. package/dist/client/assets/{sections-editor-Cn9WhnKh.js → sections-editor-BohUjqh9.js} +1 -1
  281. package/dist/client/assets/{select-B8AcNN--.js → select-DV3WaQz3.js} +1 -1
  282. package/dist/client/assets/{select-model-Bp-dP1TL.js → select-model-iXYRhSz0.js} +1 -1
  283. package/dist/client/assets/{seo-editor-DfWHWpCT.js → seo-editor-CeAq3tF_.js} +1 -1
  284. package/dist/client/assets/{separator-Df5tfRJy.js → separator-CUTgb7jC.js} +1 -1
  285. package/dist/client/assets/{session-runtime-CaeGmaeh.js → session-runtime-RbvUuwNa.js} +1 -1
  286. package/dist/client/assets/settings-tab-CfKJzzcy.js +1 -0
  287. package/dist/client/assets/{sheet-BX-uc-CP.js → sheet-L4HTwl4r.js} +1 -1
  288. package/dist/client/assets/{shell-layout-Df_Vqmxl.js → shell-layout-C_SGZ8Vi.js} +1 -1
  289. package/dist/client/assets/{site-draft-actions-DuIB4ROz.js → site-draft-actions-C6crz6qr.js} +1 -1
  290. package/dist/client/assets/{site-draft-view-BIEW7QNi.js → site-draft-view-D1iHHLaq.js} +1 -1
  291. package/dist/client/assets/site-editor-Bv6Kdh6u.js +1 -0
  292. package/dist/client/assets/{site-editor-toast-8Snipnn7.js → site-editor-toast-BymLOidH.js} +1 -1
  293. package/dist/client/assets/{skills-CD71-VLR.js → skills-Cn593LLq.js} +1 -1
  294. package/dist/client/assets/{slider-Ce40PfUp.js → slider--vRmZyWu.js} +1 -1
  295. package/dist/client/assets/{sortable.esm-BMdQQlMD.js → sortable.esm-CTCpd14C.js} +1 -1
  296. package/dist/client/assets/{sso-oSOcr0Wy.js → sso-DjJBDShv.js} +1 -1
  297. package/dist/client/assets/{suggestion-BJfFlKUn.js → suggestion-BJmzO7o_.js} +1 -1
  298. package/dist/client/assets/{super-agent-icon-Ct_ICcf4.js → super-agent-icon-DJgXomde.js} +1 -1
  299. package/dist/client/assets/{switch-B2Y4X_zr.js → switch-Df6W8JM9.js} +1 -1
  300. package/dist/client/assets/{synced-repos-ClBi5qqf.js → synced-repos-ClA2yzHM.js} +1 -1
  301. package/dist/client/assets/{tab-icon-glyph-DCTZNfdF.js → tab-icon-glyph-BXcMIo0P.js} +1 -1
  302. package/dist/client/assets/{table-Bgl4r11n.js → table-W-puqNkZ.js} +1 -1
  303. package/dist/client/assets/{tabs-mO2tcMNi.js → tabs-CbftHH4j.js} +1 -1
  304. package/dist/client/assets/{task-board-CKMBp6DZ.js → task-board-nmvAE1np.js} +1 -1
  305. package/dist/client/assets/{task-key-D4f-sg50.js → task-key-CttVN38p.js} +1 -1
  306. package/dist/client/assets/{task-route-CO-bF-dc.js → task-route-DZSYzo3l.js} +1 -1
  307. package/dist/client/assets/{task-status-BgBxV1so.js → task-status-Bmh-WAjR.js} +1 -1
  308. package/dist/client/assets/{taskboard-analytics-Bygs-ucY.js → taskboard-analytics-BvcboYkx.js} +1 -1
  309. package/dist/client/assets/tasks-BgFuMCZO.js +1 -0
  310. package/dist/client/assets/{tasks-BSB4SC09.js → tasks-ohHQM8n8.js} +1 -1
  311. package/dist/client/assets/{textarea-CxYbwRQs.js → textarea-DiEPPUlb.js} +1 -1
  312. package/dist/client/assets/{thread-analytics-D2bpggTx.js → thread-analytics-DYMj4eii.js} +1 -1
  313. package/dist/client/assets/{thread-button-B8jlPwZm.js → thread-button-CsQNPyA8.js} +1 -1
  314. package/dist/client/assets/{thread-intent-CYwcSe1Q.js → thread-intent-Cpu3ihkE.js} +1 -1
  315. package/dist/client/assets/{thread-route-2H1rJmYZ.js → thread-route-CfOc-Skq.js} +1 -1
  316. package/dist/client/assets/{thread-route-CfoDJxAx.js → thread-route-DrRW7paz.js} +1 -1
  317. package/dist/client/assets/{thread-sheet-body-C75KpeDg.js → thread-sheet-body-CUwl_XRe.js} +1 -1
  318. package/dist/client/assets/{time-range-picker-YQf6kbUD.js → time-range-picker-hUiPtWcr.js} +1 -1
  319. package/dist/client/assets/{toggle-group-navQiXEB.js → toggle-group-D4LrchJT.js} +1 -1
  320. package/dist/client/assets/{tool-set-selector-DTF-tSJ8.js → tool-set-selector-BaDWzQDx.js} +1 -1
  321. package/dist/client/assets/{toolbar-icon-button-XqXhc7QP.js → toolbar-icon-button-B9KCgsM0.js} +1 -1
  322. package/dist/client/assets/{tooltip-WWhnAI0D.js → tooltip-DlU94Hgw.js} +1 -1
  323. package/dist/client/assets/{tooltipContext-Bo1ey-tK.js → tooltipContext-D60le1gJ.js} +1 -1
  324. package/dist/client/assets/{track-CFN31sNa.js → track-CNDVG92Y.js} +1 -1
  325. package/dist/client/assets/{types-Dn5pCQsk.js → types-DFah_SNi.js} +1 -1
  326. package/dist/client/assets/{url-slug-_CQrBm2g.js → url-slug-Cjk5fXnU.js} +1 -1
  327. package/dist/client/assets/{usage-stats-CmNc8cAj.js → usage-stats-D5XufpdL.js} +1 -1
  328. package/dist/client/assets/{use-ai-providers-fHYrugD3.js → use-ai-providers-CZZKXVB1.js} +1 -1
  329. package/dist/client/assets/{use-api-keys-D5gIwchQ.js → use-api-keys-CIEmL_L8.js} +1 -1
  330. package/dist/client/assets/{use-apply-named-rule-D3XuNHsr.js → use-apply-named-rule-D1K-CTJc.js} +1 -1
  331. package/dist/client/assets/use-ask-in-chat-CSsADPkf.js +1 -0
  332. package/dist/client/assets/{use-automations-DmvCuHJK.js → use-automations-D9G2aQtg.js} +1 -1
  333. package/dist/client/assets/{use-autosave-Cp4cbZfZ.js → use-autosave-DA0iUsFs.js} +1 -1
  334. package/dist/client/assets/use-blocks-v8-project-BD5Jh-pP.js +1 -0
  335. package/dist/client/assets/use-blog-view-D1-0qsnM.js +1 -0
  336. package/dist/client/assets/{use-chat-layout-state-BaDKAECw.js → use-chat-layout-state-BRzFXpfg.js} +1 -1
  337. package/dist/client/assets/{use-cms-publish-actions-nQ5uL1t1.js → use-cms-publish-actions-Bpr8vfHu.js} +1 -1
  338. package/dist/client/assets/{use-connect-companion-C25pDJPN.js → use-connect-companion-Bqq_EO2v.js} +1 -1
  339. package/dist/client/assets/{use-connection-Cfm3n1XL.js → use-connection-CIMAuSK_.js} +1 -1
  340. package/dist/client/assets/{use-content-sync-CUYx6TEx.js → use-content-sync-B6dUTcmO.js} +1 -1
  341. package/dist/client/assets/{use-copy-D8xWA2yV.js → use-copy-Ch95imPZ.js} +1 -1
  342. package/dist/client/assets/{use-current-view-D4QwvKZY.js → use-current-view-TPfqtmJr.js} +1 -1
  343. package/dist/client/assets/{use-date-fns-locale-C3g_gdL8.js → use-date-fns-locale-DZrLBHYK.js} +1 -1
  344. package/dist/client/assets/{use-debounced-autosave-TQo-9acI.js → use-debounced-autosave-kLGb03O4.js} +1 -1
  345. package/dist/client/assets/{use-debounced-value-CyYRIO6x.js → use-debounced-value-BACx1z3V.js} +1 -1
  346. package/dist/client/assets/{use-deco-credits-B8P7CP1g.js → use-deco-credits-B2sBSPka.js} +1 -1
  347. package/dist/client/assets/{use-decopilot-events-D2kyZDkU.js → use-decopilot-events-CTU1ebGV.js} +1 -1
  348. package/dist/client/assets/{use-delete-block-mSGolgbs.js → use-delete-block-D3LZPXdf.js} +1 -1
  349. package/dist/client/assets/{use-delete-connection-Doaqb1mb.js → use-delete-connection-BWUexbsc.js} +1 -1
  350. package/dist/client/assets/{use-deployment-admin-ChHKYp27.js → use-deployment-admin-BFYSoSrq.js} +1 -1
  351. package/dist/client/assets/{use-entitlements-C9g1ozeL.js → use-entitlements-D5byd2v_.js} +1 -1
  352. package/dist/client/assets/{use-fast-preview-draft-url-Oht_itRW.js → use-fast-preview-draft-url-CwAURvyZ.js} +1 -1
  353. package/dist/client/assets/{use-file-configs-BkG8Iml_.js → use-file-configs-PWDcgSOC.js} +1 -1
  354. package/dist/client/assets/{use-id-selection-DiyjnQ8j.js → use-id-selection-DiGQvESY.js} +1 -1
  355. package/dist/client/assets/{use-in-settings-D6bXO-H0.js → use-in-settings--CBG8Ce6.js} +1 -1
  356. package/dist/client/assets/{use-inbox-feed-Bm4NiXcv.js → use-inbox-feed-Bz282qCn.js} +1 -1
  357. package/dist/client/assets/{use-infinite-scroll-DqUoS-l2.js → use-infinite-scroll-Tsjw8bRi.js} +1 -1
  358. package/dist/client/assets/{use-join-requests-wmoCs74z.js → use-join-requests-BX1q4JJR.js} +1 -1
  359. package/dist/client/assets/{use-main-panel-tabs-yM1RCEi5.js → use-main-panel-tabs-xL_Tdyig.js} +1 -1
  360. package/dist/client/assets/{use-mcp-auth-status-BbJoMlJb.js → use-mcp-auth-status-DtZK1ooz.js} +1 -1
  361. package/dist/client/assets/{use-mcp-client-CCxN3wif.js → use-mcp-client-Dj93nKzQ.js} +1 -1
  362. package/dist/client/assets/{use-mcp-prompts-DVoQ1lwW.js → use-mcp-prompts-C96c-FQr.js} +1 -1
  363. package/dist/client/assets/{use-mcp-tools-6V4XkJcF.js → use-mcp-tools-BayWRNGV.js} +1 -1
  364. package/dist/client/assets/{use-mobile-B8Aa4Xlk.js → use-mobile-BKxwZ6y7.js} +1 -1
  365. package/dist/client/assets/{use-move-blocks-BXjxUn5y.js → use-move-blocks-DJWtOlrn.js} +1 -1
  366. package/dist/client/assets/{use-navigate-to-agent-ILbX-YSf.js → use-navigate-to-agent-Cs2gjUt8.js} +1 -1
  367. package/dist/client/assets/{use-never-published-DzIkWgN5.js → use-never-published-ajD1yeUg.js} +1 -1
  368. package/dist/client/assets/{use-org-fs-9SZb1DFS.js → use-org-fs-Bus57BBg.js} +1 -1
  369. package/dist/client/assets/{use-org-notice-xNR84Fdf.js → use-org-notice-150NxgCA.js} +1 -1
  370. package/dist/client/assets/{use-org-repo-syncs-Cys8SyI4.js → use-org-repo-syncs-BF-Ps9GL.js} +1 -1
  371. package/dist/client/assets/{use-org-sso-C54pKXlG.js → use-org-sso-DriBivLP.js} +1 -1
  372. package/dist/client/assets/{use-organization-settings-DWZK4txY.js → use-organization-settings-DgQPa1gy.js} +1 -1
  373. package/dist/client/assets/{use-panel-navigate-DDkOk54O.js → use-panel-navigate-cnbfkht1.js} +1 -1
  374. package/dist/client/assets/{use-project-native-view-presence-Djk6cHeC.js → use-project-native-view-presence-BuRns7cy.js} +1 -1
  375. package/dist/client/assets/{use-project-scope-DQMPXxdu.js → use-project-scope-pykFyq6n.js} +1 -1
  376. package/dist/client/assets/{use-recent-apps-DgXyGMJY.js → use-recent-apps-1MfPlw9-.js} +1 -1
  377. package/dist/client/assets/{use-reports-diagnostic-BKWEjMrL.js → use-reports-diagnostic-D0uhQ6j7.js} +1 -1
  378. package/dist/client/assets/{use-sandbox-events-BtTSBNQ-.js → use-sandbox-events-CzU-CIRU.js} +1 -1
  379. package/dist/client/assets/{use-secrets-B8rVmi0H.js → use-secrets-COcd5rI3.js} +1 -1
  380. package/dist/client/assets/{use-section-preview-base-3aCgX76G.js → use-section-preview-base-CucfwoLI.js} +1 -1
  381. package/dist/client/assets/{use-sidebar-collapsed-DQ8plnyV.js → use-sidebar-collapsed-okJvs--c.js} +1 -1
  382. package/dist/client/assets/{use-tags-SiefX76A.js → use-tags-Dp6RVKXN.js} +1 -1
  383. package/dist/client/assets/{use-task-board-analytics-DBtBKp5C.js → use-task-board-analytics-ByzD69on.js} +1 -1
  384. package/dist/client/assets/{use-task-board-item-prs-Dnj65bJE.js → use-task-board-item-prs-63C3B6MK.js} +1 -1
  385. package/dist/client/assets/{use-task-board-items-RVurD3dm.js → use-task-board-items-3Ud_roVn.js} +1 -1
  386. package/dist/client/assets/{use-task-board-prompts-C9B0Fj4B.js → use-task-board-prompts-DXjJFXo8.js} +1 -1
  387. package/dist/client/assets/{use-task-metadata-B-Jkenb-.js → use-task-metadata-CkxNf4wa.js} +1 -1
  388. package/dist/client/assets/{use-thread-outputs-Bp1yZzWp.js → use-thread-outputs-CPRCvFuj.js} +1 -1
  389. package/dist/client/assets/{use-view-draft-kind-D6nuhvC8.js → use-view-draft-kind-BuUq_bMk.js} +1 -1
  390. package/dist/client/assets/{use-voice-input-BRffPZLC.js → use-voice-input-BXZD6ZnT.js} +1 -1
  391. package/dist/client/assets/useInfiniteQuery-B0htY_KT.js +1 -0
  392. package/dist/client/assets/{useQueries-TcBx6Y_l.js → useQueries-DAkF7mLh.js} +1 -1
  393. package/dist/client/assets/useSuspenseInfiniteQuery-BoJ8nJIB.js +1 -0
  394. package/dist/client/assets/{users-BrlvYrfH.js → users-CriUhQwd.js} +1 -1
  395. package/dist/client/assets/{utils-BvR8qziK.js → utils-CWb2jsOo.js} +1 -1
  396. package/dist/client/assets/{variant-calendar-B03MXYrd.js → variant-calendar--k3aMV8i.js} +1 -1
  397. package/dist/client/assets/{variant-matcher-override-B5Ejbh3V.js → variant-matcher-override-DqN6Qt3p.js} +1 -1
  398. package/dist/client/assets/{view-header-D2HsNkGz.js → view-header-Yb7KWXjt.js} +1 -1
  399. package/dist/client/assets/{virtual-mcp-CKK4xh6P.js → virtual-mcp-fhoMEN4c.js} +1 -1
  400. package/dist/client/assets/{watch-sse-pool-C-H2mUwU.js → watch-sse-pool-BSVBaC3o.js} +1 -1
  401. package/dist/client/index.html +1 -1
  402. package/dist/server/server.js +578 -578
  403. package/package.json +1 -1
  404. package/dist/client/assets/agent-app-DSKOCCje.js +0 -1
  405. package/dist/client/assets/agent-deck-DrelwgqT.js +0 -1
  406. package/dist/client/assets/agent-experiments-HDRXaF9_.js +0 -1
  407. package/dist/client/assets/agent-file-PsEy2j16.js +0 -1
  408. package/dist/client/assets/agent-library-DRMbpZNJ.js +0 -1
  409. package/dist/client/assets/agent-library-file-Ci4RvnZ3.js +0 -1
  410. package/dist/client/assets/agent-overview-BGymLZDi.js +0 -1
  411. package/dist/client/assets/agent-settings-BIDE4zZk.js +0 -1
  412. package/dist/client/assets/agent-site-editor-code-BguSH4kf.js +0 -2
  413. package/dist/client/assets/agent-site-editor-content-ULgQXDfp.js +0 -1
  414. package/dist/client/assets/agent-site-editor-preview-Bg7-GK6e.js +0 -1
  415. package/dist/client/assets/agent-view-bhpsBbN2.js +0 -1
  416. package/dist/client/assets/api-keys-D5aUEOaZ.js +0 -1
  417. package/dist/client/assets/library-BzKGFmec.js +0 -1
  418. package/dist/client/assets/plan-W-EFjzuP.js +0 -1
  419. package/dist/client/assets/project-reports-DQGF2xJn.js +0 -1
  420. package/dist/client/assets/project-tasks-BBAYKy8r.js +0 -1
  421. package/dist/client/assets/record-editor-0gtIzDkA.js +0 -1
  422. package/dist/client/assets/reports-DbLM9LU8.js +0 -1
  423. package/dist/client/assets/repositories-GozVvKpl.js +0 -1
  424. package/dist/client/assets/route-CQJFjDvy.js +0 -1
  425. package/dist/client/assets/settings-tab-B_DvV5jK.js +0 -1
  426. package/dist/client/assets/site-editor-hcWx5wR4.js +0 -1
  427. package/dist/client/assets/tasks-BdXLUlHE.js +0 -1
  428. package/dist/client/assets/use-ask-in-chat-DG7NmbH7.js +0 -1
  429. package/dist/client/assets/use-blocks-v8-project-VC8Oc8YL.js +0 -1
  430. package/dist/client/assets/use-blog-view-12eN62uX.js +0 -1
  431. package/dist/client/assets/useInfiniteQuery-BVDzY1XE.js +0 -1
  432. package/dist/client/assets/useSuspenseInfiniteQuery-ZMVy_VA8.js +0 -1
@@ -1 +1 @@
1
- import{ic as ti,br as ni,c as wn,b as Rn,r as b,m as le,j as r,ca as si,bo as Cs,id as Do,B as It,Y as on,aw as ri,_ as oi,bq as ai,Z as ii,q as li,ie as bs,hK as ci,ig as ui,ih as di,h as fi,bs as wt,ii as Qr,ij as xs,ik as mi,il as pt,im as Yr,io as pi,fT as hi,ip as gi,iq as Xr,ir as vi,t as H,fx as Zr,is as yi,it as Bt,iu as Si,iv as bi,iw as xi,fl as eo,ix as _s,iy as _i,iz as ki,iA as wi,fi as Ri,fU as ji,iB as Ei,iC as Vi,fw as Ti,K as Ai,iD as to,eQ as Ni,fM as Hn,fR as no,iE as so,iF as Ci,iG as Pi,iH as Bi,iI as Ki,iJ as Mi,iK as Di,iL as ro,iM as Fi,iN as Ii,fk as oo,iO as Li,iP as Oi,fO as ao,iQ as zi,fg as $i}from"./index-D9ty5Ie3.js";import{u as Wi}from"./chat-context-BIbY01K8.js";import{a as Zn,M as io}from"./save-status-CbCdWhQw.js";import{p as kn,f as Hi,n as qi}from"./parse-sections-CvIBHt2L.js";import{a as Gi}from"./repository-binding-DCgII80m.js";import{t as Ui}from"./ChevronDown-nlBmBA6R.js";import{d as Fo,b as Ji}from"./UserCheck01-CpCxuE-I.js";import{n as Qi}from"./ChevronUp-8WNgfyfx.js";import{b as Xn,e as Yi,Q as lo,L as co}from"./agent-icon-CCxR2PUF.js";import{S as an}from"./scroll-area-R9Qlcbsn.js";import{c as Rt,T as jt,a as Et}from"./tooltip-WWhnAI0D.js";import{g as Xi,h as Zi,i as el,E as tl,j as nl,V as sl,k as rl,l as ol,G as al,s as Jn,v as Qn,u as il,a as qn,p as Io,m as ll,n as cl,c as uo,o as ul,q as dl,A as Gn,P as fo,w as mo,x as po,y as ks,z as fl,B as ml,D as ho,F as pl,J as go,K as vo,L as yo,M as hl,Q as So,T as ln,U as gl,W as vl}from"./held-block-view-Bv5JhAeN.js";import{j as yl,u as Sl,i as bl,v as xl,aB as _l,U as kl,k as bo,aU as xo,a9 as Kt,aa as Mt,aq as wl,aV as Rl,aW as jl,aO as _o,at as El,aA as Vl}from"./site-editor-toast-8Snipnn7.js";import{u as Tl,ao as ko,c as wo,k as Al,A as Nl,ad as Cl,ae as Pl,aj as Bl}from"./blocks-tab-states-DVnYU043.js";import{u as Kl}from"./use-delete-block-mSGolgbs.js";import{b as Ml,u as Dl,k as Un,e as xn}from"./use-never-published-DzIkWgN5.js";import{b as Es,f as Lo}from"./UserSquare-DB6NyDzI.js";import{b as Fl}from"./MessageCircle01-BgFAVnEo.js";import{i as Ro}from"./Tool01-sUxKxzA1.js";import{s as jo}from"./Eye-uwbxmI34.js";import{s as Il}from"./Plus-BjA7v0aW.js";import{s as Ll}from"./Trash01-BJHdmQwJ.js";import{i as Vs}from"./Zap-ahofKysd.js";import{u as Ol,a as Eo,n as zl,P as $l,o as Wl,C as Hl,D as ql,c as Gl}from"./task-key-D4f-sg50.js";import{u as Ul,s as Jl,a as Yn,S as Ql,v as Yl}from"./sortable.esm-BMdQQlMD.js";import{s as Xl,g as Zl,u as ec,A as tc}from"./use-section-preview-base-3aCgX76G.js";import{m as nc,P as sc}from"./mustache-_Z8_qqHJ.js";import{aR as Vo,aS as rc,X as oc,aT as ac,aU as ic,k as lc}from"./category-tree-CPJhn4HZ.js";import{u as cc,a as uc,P as To,w as dc,b as fc}from"./seo-editor-DfWHWpCT.js";import{v as mc,k as ws,x as Ao,j as pc,y as hc}from"./named-rule-step-BKavlQpM.js";import{u as gc}from"./use-apply-named-rule-D3XuNHsr.js";import{o as Jt,f as Ts,y as As,q as Ft,h as cn,u as vc,n as Ut,r as Rs,m as Dt,k as _n,b as yc,s as No,z as Sc,A as bc,B as xc}from"./section-array-field-ClatUqIl.js";import{b as Co,a as _c}from"./variant-matcher-override-B5Ejbh3V.js";import"./use-panel-navigate-DDkOk54O.js";import"./thread-route-2H1rJmYZ.js";import"./use-project-scope-DQMPXxdu.js";import"./use-view-draft-kind-D6nuhvC8.js";import"./use-blog-view-12eN62uX.js";import"./use-organization-settings-DWZK4txY.js";import"./schema-CTzV9RXv.js";import"./task-board-CKMBp6DZ.js";import"./thread-intent-CYwcSe1Q.js";import"./use-mcp-client-CCxN3wif.js";import"./auth-CdyebVHG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C-H2mUwU.js";import"./session-runtime-CaeGmaeh.js";import"./use-entitlements-C9g1ozeL.js";import"./use-ai-providers-fHYrugD3.js";import"./use-current-view-D4QwvKZY.js";import"./use-in-settings-D6bXO-H0.js";import"./use-decopilot-events-D2kyZDkU.js";import"./use-org-fs-9SZb1DFS.js";import"./useInfiniteQuery-BVDzY1XE.js";import"./infiniteQueryObserver-jl0ag-ci.js";import"./Image01-BIaadP6j.js";import"./Upload01-_qHCYjHc.js";import"./label-BuyeEoKy.js";import"./SwitchHorizontal01-CCkkKeRG.js";import"./popover-CkZGLhNA.js";import"./switch-B2Y4X_zr.js";import"./toggle-group-navQiXEB.js";import"./active-indicator-CCMhAsc_.js";import"./match-site-slug-config-B47_xZCi.js";import"./use-file-configs-BkG8Iml_.js";import"./asset-utils-CCfbAgp6.js";import"./AlertCircle-B1i_KHb5.js";import"./hosted-reconcile-Bt0PeuzR.js";import"./SearchMd-DLHPy6Uo.js";import"./textarea-CxYbwRQs.js";import"./use-copy-D8xWA2yV.js";import"./ChevronSelectorVertical-CnSsPRgV.js";import"./command-CGZn32g4.js";import"./index-CVCo7BMR.js";import"./Play-1a_lTdjO.js";import"./monaco-editor-CBnaevuh.js";import"./editor-D4mLuwGY.js";import"./ArrowUp-D0iB56_y.js";import"./ArrowLeft-BCGEiplU.js";import"./ArrowRight-CTKbq3xg.js";import"./BookOpen01-BRGBbO1d.js";import"./Globe04-CVG10uFQ.js";import"./CheckCircle-DhVhQqv1.js";import"./LinkBroken01-wmCuBJVN.js";import"./CreditCard01-DXlMDhFZ.js";import"./File02-CFPVdIh1.js";import"./Fingerprint04-BCose3-q.js";import"./Key01-CBM6N1XG.js";import"./LayoutLeft-BdexGOTP.js";import"./Minus-CWR3qyH5.js";import"./Monitor01-BQDnuBH5.js";import"./Sun-CF9jssUY.js";import"./ShoppingBag01-DH3DKaiC.js";import"./Users01-DwRKp1C7.js";import"./XClose-oM6nZllg.js";import"./index-BdQq_4o_.js";import"./index-BzRhR-ob.js";import"./utils-BvR8qziK.js";import"./calendar-aJ3MwRAc.js";import"./usage-stats-CmNc8cAj.js";import"./utils-CVEq3hMx.js";import"./markdown-DS2iRx8j.js";import"./use-mobile-B8Aa4Xlk.js";import"./gateway-client-uysD9si3.js";import"./form-CdIohY1c.js";import"./select-B8AcNN--.js";import"./editor-classes-EyIn6Xdz.js";import"./combobox-BQpDbntt.js";import"./content-changes-wc9FH6jt.js";import"./sandbox-url-D3mC8qhT.js";import"./use-sandbox-events-BtTSBNQ-.js";import"./use-blocks-v8-project-VC8Oc8YL.js";import"./use-voice-input-BRffPZLC.js";import"./drawer-CPRS7vw4.js";import"./index-BRun9Rm8.js";import"./checkbox-C5arK3Yi.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-kZT1B2wI.js";import"./empty-state-DfXiNtjV.js";import"./search-input-BXEVxZTu.js";import"./tabs-mO2tcMNi.js";import"./use-debounced-value-CyYRIO6x.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-C7XMWJ-9.js";import"./collapsible-uGD63SVW.js";import"./use-task-board-items-RVurD3dm.js";import"./config-D953tTPf.js";import"./task-route-CO-bF-dc.js";import"./project-index-DAyEgqrx.js";import"./shell-layout-Df_Vqmxl.js";import"./use-deployment-admin-ChHKYp27.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-xNR84Fdf.js";import"./integration-icon-DwE31eP3.js";import"./project-icon-B83l1FFE.js";import"./use-navigate-to-agent-ILbX-YSf.js";import"./new-project-dialog-B7_EHGk8.js";import"./repository-picker-GD3a62Se.js";import"./github-icon-BFtlg-Wu.js";import"./collection-search-5yetxvaM.js";import"./new-project-store-B8n3b_tZ.js";import"./legacy-admin-welcome-dialog-D8acRK4o.js";import"./required-auth-layout-CJHidYLF.js";import"./use-org-sso-C54pKXlG.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Bvu3N1R4.js";import"./types-Dn5pCQsk.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-BX-uc-CP.js";import"./use-connection-Cfm3n1XL.js";import"./use-mcp-prompts-DVoQ1lwW.js";import"./use-thread-outputs-Bp1yZzWp.js";import"./file-type-icon-Dr1Fctbf.js";import"./slider-Ce40PfUp.js";import"./index-BtxZs6tJ.js";import"./tooltipContext-Bo1ey-tK.js";import"./CategoricalChart-C0a7-8vN.js";import"./index-BozwbZx0.js";import"./use-move-blocks-BXjxUn5y.js";const kc={escape:Xi};function wc(g,e){for(const p of Xl(g,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function Rc(g,e){if(!e)return;const p=ti(g,ni(e));if(p)try{const S=wc(p.resolveType,e);return S&&nc.render(S,p.data,{},kc).trim()||void 0}catch{return}}function jc(g){const e=wn.c(13),{icon:p,label:S,className:x}=g;let V;e[0]!==x?(V=le("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(jt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(Rt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const Ec="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 Po(g){return Array.from({length:g},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Oo(g){return g.map((e,p)=>({...e,index:p}))}function Vc(g,e){if(e===g.length)return g;if(e<g.length)return Oo(g.slice(0,e));const p=Array.from({length:e-g.length},(S,x)=>({id:crypto.randomUUID(),index:g.length+x}));return[...g,...p]}function zo(g){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=g,C=Rn(),_=Zn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let X;e[0]!==x||e[1]!==S?(X=S&&x?Zl(S,x):void 0,e[0]=x,e[1]=S,e[2]=X):X=e[2];const ge=X;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?Rc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=rl(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&Cs(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Xn:k?Fo:Lo;let G;e[16]!==k||e[17]!==P?(G=P?{color:ai}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let F;e[19]!==xe||e[20]!==_?(F=_?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(al,{"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(Fl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,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 d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Es,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=le("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const Z=Le??p.label;let ze;e[30]!==Ee||e[31]!==Z?(ze=r.jsx("span",{className:Ee,children:Z}),e[30]=Ee,e[31]=Z,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(jc,{icon:Vs,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(io,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(io,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==F||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[F,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=F,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const Tc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ac="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 $o(g,e,p){if(p)return ol({selected:e});const S=g.isSavedBlock===!0,x=g.isMultivariate===!0;return le("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":S?Tc:x?Ac:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function js(g,e){return le("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":g?"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 Nc(g){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:X,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=g,w=Rn(),c=Zn(),xe=S?Cs(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let F;e[0]!==p?(F=Do(p),e[0]=p,e[1]=F):F=e[1];const ke=F,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Bc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:Z,transform:ze,isDragging:nt}=Ul(Oe);let Pe;e[4]!==ze?(Pe=Hl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let de;e[6]!==Pe||e[7]!==st?(de={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=de):de=e[8];const v=de;let we;e[9]!==p?(we=el(p),e[9]=p,e[10]=we):we=e[10];const rt=we,ot="button",m=0;let I;e[11]!==P?(I=D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),P())},e[11]=P,e[12]=I):I=e[12];const Ze=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Ze?(A=le("touch-none transition-colors",Ze,$o(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Ze,e[17]=A):A=e[17];let Qe;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Qe=r.jsx(zo,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Qe):Qe=e[22];const W=!c&&d&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(js(_e,xe)),onClick:D=>{D.stopPropagation(),Le?.()},onPointerDown:Pc,children:r.jsx(Vs,{className:le("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),at=c?r.jsx(tl,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(Ro,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})}):r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(js(_e,G)),onClick:D=>{D.stopPropagation(),Ue()},onPointerDown:Cc,children:G?r.jsx(Ro,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=oi,Ye=nl;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=le(js(_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 $e;e[25]!==Ye||e[26]!==ve||e[27]!==it?($e=r.jsx(Ye,{label:ve,classicClassName:it}),e[25]=Ye,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(on,{onClick:D=>{D.stopPropagation(),Le?.()},children:[r.jsx(Vs,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(ri,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==X?(Ke=D=>{D.stopPropagation(),X()},e[35]=X,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(Yi,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(on,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let M;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(M=ke&&r.jsxs(on,{className:le(!c&&sl),onClick:D=>{D.stopPropagation(),Ce()},children:[r.jsx(Fo,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=M):M=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(on,{className:le(!c&&Ec),onClick:D=>{D.stopPropagation(),ge()},children:[c?r.jsx(Xn,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let me;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(me=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(on,{onClick:D=>{D.stopPropagation(),Je()},children:[c?r.jsx(Lo,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=me):me=e[58];let We;e[59]!==k?(We=D=>{D.stopPropagation(),k()},e[59]=k,e[60]=We):We=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Ll,{className:"h-4 w-4"}),e[61]=et):et=e[61];let Me;e[62]!==w?(Me=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=Me):Me=e[63];let $;e[64]!==We||e[65]!==Me?($=r.jsxs(on,{variant:"destructive",onClick:We,children:[et,Me]}),e[64]=We,e[65]=Me,e[66]=$):$=e[66];let ie;e[67]!==Be||e[68]!==ee||e[69]!==M||e[70]!==T||e[71]!==me||e[72]!==$?(ie=r.jsxs(ii,{align:"end",className:"w-44",children:[Be,ee,M,T,me,$]}),e[67]=Be,e[68]=ee,e[69]=M,e[70]=T,e[71]=me,e[72]=$,e[73]=ie):ie=e[73];let Ve;e[74]!==fe||e[75]!==$e||e[76]!==ie?(Ve=r.jsxs(fe,{children:[$e,ie]}),e[74]=fe,e[75]=$e,e[76]=ie,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==Z||e[82]!==v||e[83]!==A||e[84]!==Qe||e[85]!==W||e[86]!==at||e[87]!==Ve||e[88]!==I?(Te=r.jsxs("div",{ref:Z,style:v,...u,...Ee,role:ot,tabIndex:m,onClick:P,onKeyDown:I,className:A,children:[Qe,W,at,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=Z,e[82]=v,e[83]=A,e[84]=Qe,e[85]=W,e[86]=at,e[87]=Ve,e[88]=I,e[89]=Te):Te=e[89],Te}function Cc(g){return g.stopPropagation()}function Pc(g){return g.stopPropagation()}function Bc(){return!1}function Ns(g){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=g,C=Rn();let _;e[0]!==x?(_=le("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Il,{size:14}),e[2]=k):k=e[2];let X;e[3]!==C?(X=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=X):X=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==X?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,X]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=X,e[10]=ge):ge=e[10],ge}function Kc(g){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:X,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=g,G=xe===void 0?!0:xe,_e=Rn(),F=Zn();let ke;e[0]!==x.length?(ke=()=>Po(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[Z,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);Z!==p?(ze(p),Pe(x.length),Oe(Po(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Vc(tt,x.length)));let de;e[2]===Symbol.for("react.memo_cache_sentinel")?(de={activationConstraint:{distance:8}},e[2]=de):de=e[2];let v;e[3]===Symbol.for("react.memo_cache_sentinel")?(v={coordinateGetter:Jl},e[3]=v):v=e[3];const we=Ol(Eo($l,de),Eo(zl,v));let rt;e[4]!==d?(rt=d.map(Mc),e[4]=d,e[5]=rt):rt=e[5];const ot=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const I=m;let Ze;e[7]!==ot||e[8]!==k?(Ze=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const He=ot.indexOf(String(O.id)),ht=ot.indexOf(String(Ae.id));He===-1||ht===-1||(Oe(bt=>Oo(Yn([...bt],He,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(He,ht))},e[7]=ot,e[8]=k,e[9]=Ze):Ze=e[9];const A=Ze;let Qe;e[10]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{Ee(null)},e[10]=Qe):Qe=e[10];const W=Qe;let at,fe,Ye,ve,it,$e,Be,Ke,se,Y,ee,M,T,me,We;if(e[11]!==u||e[12]!==G||e[13]!==F||e[14]!==C||e[15]!==d||e[16]!==ot||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==X||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){me=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==F||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Ye=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let He;e[61]!==Ae?(He=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=He):He=e[62];const ht=He;let bt;e[63]!==G||e[64]!==F||e[65]!==ht||e[66]!==c?(bt=F?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=F,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],me=bt;break e}T=le(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=F,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Ye,e[57]=ve,e[58]=T}else Ye=e[56],ve=e[57],T=e[58];fe=ql,Ke=we,se=Gl,Y=I,ee=A,M=W,at=Ql,$e=ot,Be=Yl,We="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Nc,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>X(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=F,e[14]=C,e[15]=d,e[16]=ot,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=X,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=at,e[34]=fe,e[35]=Ye,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=M,e[45]=T,e[46]=me,e[47]=We}else at=e[33],fe=e[34],Ye=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],M=e[44],T=e[45],me=e[46],We=e[47];if(me!==Symbol.for("react.early_return_sentinel"))return me;let et;e[68]!==it||e[69]!==We?(et=r.jsx("div",{className:We,children:it}),e[68]=it,e[69]=We,e[70]=et):et=e[70];let Me;e[71]!==at||e[72]!==$e||e[73]!==Be||e[74]!==et?(Me=r.jsx(at,{items:$e,strategy:Be,children:et}),e[71]=at,e[72]=$e,e[73]=Be,e[74]=et,e[75]=Me):Me=e[75];let $;e[76]!==Ye||e[77]!==ve||e[78]!==F||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:le("cursor-grabbing shadow-lift",$o(ve,!1,F)),children:r.jsx(zo,{section:ve,raw:Ye,meta:V,decofile:C})}):null,e[76]=Ye,e[77]=ve,e[78]=F,e[79]=C,e[80]=V,e[81]=$):$=e[81];let ie;e[82]!==$?(ie=si.createPortal(r.jsx(Wl,{dropAnimation:Zi,children:$}),document.body),e[82]=$,e[83]=ie):ie=e[83];let Ve;e[84]!==fe||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==M||e[90]!==Me||e[91]!==ie?(Ve=r.jsxs(fe,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:M,children:[Me,ie]}),e[84]=fe,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=M,e[90]=Me,e[91]=ie,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==F||e[95]!==c?(Te=!F&&r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=F,e[95]=c,e[96]=Te):Te=e[96];let D;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(D=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=D):D=e[100],D}function Mc(g){return g.id}function Dc(g,e,p,S){if(!g||typeof g!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(g,p,S)?{kind:"inline",blockKey:g.__resolveType??"",inlinedRule:Ts(g,p,S)}:{kind:"noop"};const V=As(g,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Jn(x),_=Qn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Bo="section-form-stale-save",Fc=3;function Ko(g,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Io(e.pageKey?g[e.pageKey]?.sections:void 0,g,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,g,p)}}const Mo=new WeakMap;let Ic=0;function Lc(g){let e=Mo.get(g);return e===void 0&&(e=++Ic,Mo.set(g,e)),e}function Wf({orgSlug:g,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:X=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=Rn(),xe=Wi(),G=xe?.taskId??null,_e=S?{orgSlug:g,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[F,ke]=b.useState([]),{data:d,isLoading:Oe}=yl(_e,{pollWhile:F.length>0}),{data:u,isLoading:Ee}=Tl(_e),Z=Zn(),ze=xe?.virtualMcpId,Pe=Gi(ze===e?e:null)?.metadata?.siteSlug??null,st=ec({virtualMcpId:e,branch:p,sandboxUrl:x}),de=Sl(e,p),v=bl(de),we=Ti(v),rt=!v,ot=!!st||v,[m,I]=b.useState(null),[Ze,A]=b.useState(null),[Qe,W]=b.useState(null),[at,fe]=b.useState(0),[Ye,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[M,T]=b.useState([]),me=b.useRef(null),[We,et]=b.useState(M.length);We!==M.length&&(et(M.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Me,$]=b.useState(0),[ie,Ve]=b.useState(null),[Te,D]=b.useState(null),[tt,O]=b.useState(null),[Ae,He]=b.useState(!1),[ht,bt]=b.useState(!1),jn=b.useRef(null),[En,Wo]=b.useState(!0),[Qt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[Re,un]=b.useState(X),[Ps,Bs]=b.useState(X);X&&!Ps&&(Bs(!0),un(!0),I(null),A(null),W(null),T([])),!X&&Ps&&Bs(!1);const[Ho,dn]=b.useState(null),[Ks,An]=b.useState(void 0),[Ms,Ot]=b.useState([]),[Ds,Yt]=b.useState(0),[De,lt]=b.useState(0),[qo,Fe]=b.useState(null),[Xt,qe]=b.useState(null),[Fs,Is]=b.useState(null),Nn=li(),Cn=xl({orgSlug:g,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Ml({orgSlug:g,virtualMcpId:e,branch:p}),[Go,Uo]=b.useState(V),[Jo,Qo]=b.useState(C),[Yo,Xo]=b.useState(_);(Go!==V||Jo!==C||Yo!==_)&&(queueMicrotask(()=>fn.flush()),Uo(V),Qo(C),Xo(_),I(null),A(null),W(null),fe(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1));const L=Dl({orgSlug:g,virtualMcpId:e,branch:p}),Ls=il({orgSlug:g,virtualMcpId:e,branch:p},d??{},{onSaved:k}),mn=Ls.save,Pn=Kl({orgSlug:g,virtualMcpId:e,branch:p}),Os=gc({orgSlug:g,virtualMcpId:e,branch:p}),[Zt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Bn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),es=b.useRef(new WeakSet);_l(g,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:o,selectedSectionIndex:a}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,a]){const f=l==null?void 0:s[l],j=l==null?void 0:o[l],h=f&&j?.isSavedBlock?bs(f,j):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Bn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[zs,$s]=b.useState(0),[Zo,ea]=b.useState(0),Ws=ci(de,{orgSlug:g,virtualMcpId:e,branch:p}),Hs=ui(Ws,F[0]?.blockKey??null,di(d,F[0]?.blockKey??null)),[ta,na]=b.useState(null),ts=kl(g,e).epoch,[sa,ra]=b.useState(ts);cc(Re?{orgSlug:g,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const qs=_??(d&&u?ko(wo(d,u),V,C)?.key??null:null),ns=bo({orgSlug:g,virtualMcpId:e,branch:p},qs?[qs]:[],{withRefs:!0}),[Gs,oa]=b.useState(!1),ss=bo({orgSlug:g,virtualMcpId:e,branch:p},Gs?Al:[]),Us={ready:!(de.kind==="protocol"&&de.hosted)||Gs&&ss.ready,failed:ss.failed,retry:ss.retry,request:()=>oa(!0)};if(ns.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:ns.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!ns.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(fi,{className:"size-5 text-muted-foreground"})});if(!d||!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 aa=wo(d,u),q=!!_,oe=q?null:ko(aa,V,C),y=q?_:oe?.key??null,rs=q&&_?d[_]:void 0,Js=q&&_&&rs?Nl(_,rs):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,os=Re&&d&&u&&y&&oe?Vo(d,{kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},u):null,ia=Re?nn?.seo:void 0,Kn=Ks!==void 0?Ks:ia,la=Re?rc(Kn):void 0,Qs=os?.seoTypeOptions??[],Ys=Re&&u?oc(u):"",as=Ho??la??{},Mn=Re&&os?uc(as,os):null,Xs=Re&&Mn&&ac(Kn)?qn(Mn,u):null,Zs=Re?ic(d,u)?.seoData:void 0,pe=q?[{label:"Default",sections:[{__resolveType:_}]}]:Io(nn?.sections,d??{},v),yt=pe.length>1,te=Math.min(at,pe.length-1),Se=pe[te],B=Se?.sections??[],ce=kn(B,d,v),Dn=!q&&vc(nn?.sections,v);if(q&&_&&Fs!==_){Is(_);const t=B[0],n=ce[0];if(t&&n){I(0),lt(0),T([]);const s=wt(t,n,d,v);s&&(A(s.data),W(s.resolveType),qe(null),Fe(null))}}!q&&Fs!==null&&Is(null),re.current={rawSections:B,parsedSections:ce,decofile:d??{},activePageKey:y,pageVariants:pe,variantIndex:te,sectionVariantIndex:De,selectedSectionIndex:m};const ca=()=>({multivariate:Dn,index:te,variants:pe.map(t=>({rule:t.rule})),lazyValues:v&&Dn&&Ni(nn?.sections?.variants?.[te]?.value)}),is=(t,n)=>{if(!w)return;if(!y||!Dn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},o=v?xo(y,s):Co(y,s,d,u);w(o.length>0?o:null)},ls=w&&y&&Dn&&yt&&!Oe&&!Ee?y:null;if(ls!==ta&&(na(ls),ls)){const t=pe.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>is(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const o=ca(),a=v?xo(y,o):Co(y,o,d,u);if(!t||n<0){w(a.length>0?a:null);return}const i={pageKey:y,page:o,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=v?Rl(i):_c({...i,decofile:d,meta:u}),f=v?jl(a,l):[...a,...l];w(f.length>0?f:null)},xt=(t,n,s,o=m??-1,a=!1)=>{const i=pt(t,n);if(!i){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const f=Yr(i,we)[s];if(!f){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const j=gi(f.value,d);A(j?.data??null),W(j?.resolveType??null);const{resolveType:h,formValue:R}=Ut(f.rule,d,u??void 0);qe(h),Fe(R),a&&$t(i,o,s)},cs=t=>{D(null),fe(t),I(null),A(null),W(null),T([]);const n=pe[t]?.rule,{resolveType:s,formValue:o}=Ut(n,d??{},u??void 0);ee(s),se(o),is(pe.map(a=>({rule:a.rule})),t)},ua=(t,n)=>{const s=B[t],o=ce[t];if(!s||!o)return!1;const a=o.isMultivariate?pt(s,o)?.variants?.length??0:0,i=n<a?n:0;if(I(t),lt(i),T([]),$(l=>l+1),o.isMultivariate)xt(s,o,i,t);else{const l=wt(s,o,d,v);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),qe(null),Fe(null)}return!0},er=P?.index;if(P!==void 0&&(P?.seq??null)!==Ye&&(ve(P?.seq??null),typeof er=="number"&&ua(er,0)),ts!==sa){ra(ts);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||L.isPending||Ls.isPending||fn.isPending||F.length>0,n=m!==null&&Qr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=B[m],o=ce[m];if(T([]),$(a=>a+1),!s||!o)I(null),A(null),W(null);else if(o.isMultivariate)xt(s,o,De,m);else{const a=wt(s,o,d,v);A(a?.data??null),W(a?.resolveType??null)}}!t&&Re&&(dn(null),An(void 0),Yt(s=>s+1))}if(zs!==Zo){ea(zs);const t=m!==null?B[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,De,m);else{const s=wt(t,n,d,v);A(s?.data??null),W(s?.resolveType??null)}}const ut=F[0];if(ut){const{formBase:t,target:n}=ut,s=Ko(d,n,v),o=t.sectionIndex,a=s.rawSections.length===t.sectionCount?xs(s.rawSections[o],s.parsedSections[o],n.sectionVariantIndex,d,v):null,i=mi(ut,a,l=>Xr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...F.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:g,virtualMcpId:e,branch:p,threadId:G,previewUrl:v?void 0:x??void 0,siteSlug:Pe},Fn=Qe&&u?qn(Qe,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=ln(d,y,t,te,pe);L.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:o=>{n?.onError?.(),L.reportError(o)}})},Wt=()=>{Ce?.(null),I(null),Tn(!1),A(null),W(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},tr=()=>Qr(me.current,document.activeElement),us=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,H.error(t,{id:Bo}),tr()){tn.current=!0;return}$s(n=>n+1)},nr=()=>{!tn.current||tr()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,$s(t=>t+1))},sr=()=>{tn.current&&setTimeout(nr,0)},rr=de.kind==="protocol"&&de.source==="github",or=t=>Vl(Nn,Cn,t,de.kind==="protocol"?de:null),ar=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},da=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:o}=re.current,a=zt.current;return{formBase:a?.sectionIndex===t&&a.variantIndex===o?a:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:o,schema:Fn}},vn=t=>{ct.current=t,ke(t)},fa=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),o=s>=0?n[s]:void 0,a=o?n.with(s,{...t,choices:so(o.plan,o.choices,t.plan),fresh:Li(o.plan,t.plan,o.fresh),changedAgain:o.changedAgain||Hn(o.plan.theirs)!==Hn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(a)},ir=(t,n)=>{const s=ct.current,o=s.findIndex(l=>l.formBase===t),a=s[o];if(!a)return!1;if(Hn(a.plan.mine)===Hn(n))return!0;const i=no({...a.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==a);return vn(l),!1}return vn(s.with(o,{...a,plan:i,choices:so(a.plan,a.choices,i)})),!0},ma=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},pa=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const o=n.emitted;return o&&typeof o=="object"&&!ir(n,o)&&yn(o,n.sectionIndex,0,s),ct.current[0]??null},ha=()=>{const t=ct.current[0],n=pa();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=ji(n.plan,n.choices);de.kind==="protocol"&&de.source==="github"&&Ei(n.plan,n.choices)&&wl(c,!1),vn(ct.current.slice(1));const{formBase:o,target:a}=n;o.base=n.plan.theirs,o.version=void 0,o.emitted=s,es.current.add(o),(zt.current===o||ma(n))&&(zt.current=o,A(s),$(i=>i+1)),yn(s,o.sectionIndex,0,a)},ga=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,o,a=!1)=>{const i=o??da(n),l=i.sectionVariantIndex,f=i.formBase,j=a||to(ct.current,f,i,n,v).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const R=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(R,E);return}const K=typeof t=="function"?t():t,z=to(ct.current,f,i,n,v).base;if(z&&ir(z,K))return;const ne=re.current.decofile,{rawSections:J,parsedSections:Ne,pageVariants:Q,variantIndex:be}=Ko(ne,i,v),Ie=i.pageKey,he=J[n];if(!he)return;const ue=Ne[n];if(!ue)return;const Ge=f?.base,Xe=xs(he,ue,l,ne,v),Nt=!!Ge&&!!Xe&&Ci(Ge,Xe)&&!(f&&Xr(f,Xe));if(Nt&&Ge&&Xe){if(Pi(Ge,Xe)){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const U=ue.isSavedBlock?"here":Bi(Ge,J.map((ae,mt)=>xs(ae,Ne[mt],l,ne,v)),n,f?.sectionCount??J.length);if(U==="unknown"){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof U=="number"&&f){f.sectionCount=J.length,f.sectionIndex=U,zt.current===f&&I(U),yn(K,U,s,i);return}}const Ct=Nt&&Ge&&Xe?no({ancestor:Ge,mine:K,theirs:Xe}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=J.length,fa({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Ki(Ct),changedAgain:!1,blockKey:ue.isSavedBlock?bs(he,ue):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??K,Gr=Mi({merged:!!Pt,tracked:f,current:zt.current,saved:K});Pt&&H.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Bo}),Gr&&f&&(f.emitted=Pt,A(Pt));const Ss=Gr||!Pt?rn:K;f&&(f.base=Ss,f.sectionCount=J.length,Di(f,Ss));const Ur={onSuccess:()=>{f&&es.current.delete(f),k?.()},onError:U=>{if(f?.base===Ss&&Ge&&(f.base=Ge),U instanceof El){if(f&&(f.version=void 0),s<Fc){ye.current.delete(R),hn.current=!0;const ae=Oi(s,U.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:K},n,s+1,i,ae.immediate),ye.current.delete(R),ar(xn(v))},ae.delay)}else us();return}L.reportError(U)}},Jr=U=>{pn.current=!0;let ae=!1;L.mutateAsync(U).then(()=>Ur.onSuccess(),mt=>{ae=!0,Ur.onError(mt)}).finally(()=>{pn.current=!1,ar(ae?xn(v):0),nr()})};if(ue.isSavedBlock){const U=bs(he,ue);if(!U)return;Jr({blockKey:U,data:rn,...Ge?{base:{value:Fi({startedFrom:Ge,stored:Xe,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:ro({formBase:f,rebased:!!Pt,versionOf:or,productionVersionOf:ae=>ao(Nn,Cn,ae),...rr?{copy:{value:ne[U]}}:{}})});return}if(!Ie)return;const Wn={...ne[Ie]},Gt=[...J];if(ue.isMultivariate){const U=pt(he,ue);if(!U||!Ie)return;const ae=Ii(U,l,rn);Gt[n]=Bt(he,ue,ae)}else if(ue.isHidden){const U=Cs(he.__resolveType),ae=U?{...he.section}:{...he},mt=Array.isArray(ae.variants)?[...ae.variants]:[];mt[0]&&(mt[0]=oo(ae.__resolveType,mt[0],rn)),ae.variants=mt,U?Gt[n]={...he,section:ae}:Gt[n]=ae}else ue.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(Q.length>1){const U=Wn.sections,ae=[...U?.variants??[]];ae[be]&&(ae[be]=oo(U?.__resolveType,ae[be],Gt)),Wn.sections={...U,variants:ae}}else Wn.sections=Gt;Jr({blockKey:Ie,data:Wn,rebaseOnConflict:!1,guard:ro({formBase:null,rebased:!1,versionOf:or,productionVersionOf:U=>ao(Nn,Cn,U),...rr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},j){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(v))},va=t=>{tn.current=!1,I(t),lt(0),T([]),$(a=>a+1);const n=B[t],s=ce[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const o=wt(n,s,d,v);if(!o){A(null),W(null),qe(null),Fe(null),$t(null,t,0);return}A(o.data),W(o.resolveType),qe(null),Fe(null),$t(null,t,0)},lr=t=>{const n=t;m!==null&&(zt.current=Vi(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Ze,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},ds=t=>{if(!y||!d||!u||!oe)return;const n={kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},s=Vo(d,n,u);s&&fn.save(y,()=>{const o=Nn.getQueryData(Ai.decofile(Cn))?.[y];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const a={...o,...Bn.current};return Bn.current={},t?.raw!==void 0?dc(a,t.raw,u):t?.inner!==void 0?fc(n,s,a,t.inner):a})},cr=(t,n)=>{y&&(Bn.current[t]=n,ds())},ya=(t,n)=>{if(!y)return;const s=Yn([...B],t,n);m!==null&&(m===t?I(n):t<m&&n>=m?I(m-1):t>m&&n<=m&&I(m+1)),dt(s)},Sa=t=>{if(!y)return;const n=B.filter((s,o)=>o!==t);m===t?Wt():m!==null&&m>t&&I(m-1),dt(n)},ba=t=>{if(!y)return;const n=B[t];if(!n)return;const s=[...B];s.splice(t+1,0,gl(n)),m!==null&&m>t&&I(m+1),dt(s)},xa=t=>{if(!y)return;const n=B[t],s=ce[t];if(!n||!s)return;const o=s.isHidden?ki(n,v):wi(n,u);if(!o)return;const a=[...B];a[t]=o,m===t&&Wt(),dt(a)},_a=t=>{if(!y)return;const n=B[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const o=_i(n);if(!o)return;const a=[...B];a[t]=o,m===t&&Wt(),dt(a)},ka=t=>{if(!y)return;const n=B[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const o=wt(n,s,d,v);if(!o?.data)return;const{name:a,...i}=o.data,l=[...B];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Wt(),dt(l)},wa=t=>{if(!y)return;const n=qi(ce),s=[...B.slice(0,n),{__resolveType:t.resolveType},...B.slice(n)];dt(s,{onError:()=>{re.current.selectedSectionIndex===n&&Wt()}}),He(!1),I(n),lt(0),T([]),$(l=>l+1);const o=s[n],a=kn(s,d,v)[n];if(!o||!a)return;if(a.isMultivariate){xt(o,a,0);return}const i=wt(o,a,d,v);if(!i){A(null),W(null),qe(null),Fe(null);return}A(i.data),W(i.resolveType),qe(null),Fe(null)},ur=t=>{jn.current=t.append,He(!0)},Ra=t=>{const n=jn.current;if(!n){wa(t);return}n({__resolveType:t.resolveType}),He(!1),jn.current=null},dr=t=>{if(m===null)return;const n=B[m],s=ce[m];!n||!s?.isMultivariate||(lt(t),T([]),$(o=>o+1),xt(n,s,t,m,!0))},ja=t=>{if(m===null||!y)return;const n=B[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=bi(o,t);if(!a){H.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...B];i[m]=Bt(n,s,a);const l=a.variants;let f=De;t===De?f=Math.min(t,l.length-1):t<De&&(f=De-1),lt(f),T([]),$(j=>j+1),xt(i[m],s,f),dt(i)},Ea=t=>{if(m===null||!y)return;const n=B[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=xi(o,t,v),i=[...B];i[m]=Bt(n,s,a);const l=eo(o.variants??[],t,v);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,v),dt(i)},Va=(t,n)=>{if(m===null||!y||t===n)return;const s=B[m],o=ce[m];if(!s||!o?.isMultivariate)return;const a=pt(s,o);if(!a)return;const i=yi(a,t,n),l=[...B];l[m]=Bt(s,o,i);let f=De;De===t?f=n:t<De&&n>=De?f=De-1:t>De&&n<=De&&(f=De+1),lt(f),xt(l[m],o,f,m,v),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=B[n],o=ce[n];if(!s||!o)return;const a=vi(s,o,void 0,u,v);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...B];i[n]=a.section;const l=kn(i,d,v)[n];if(!l?.isMultivariate){H.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}I(n),lt(a.newVariantIndex),T([]),$(f=>f+1),xt(a.section,l,a.newVariantIndex,n,v),dt(i)},fr=()=>{if(m===null||!y)return;const t=B[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const o=Si(t,n,s);if(!o){H.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const a=[...B];a[m]=o;const i=kn(a,d,v)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(o,i,d,v);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),$t(null,m,0),dt(a)},Ta=async t=>{if(ie===null||!y)return;const n=Qn(t,d,u);if(n){H.error(n);return}const s=B[ie],o=ce[ie];if(!s||!o)return;const a=wt(s,o,d,v);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...a.data,name:t};try{const l=await L.mutateAsync({blockKey:t,data:i,create:!0}),f=[...B];f[ie]={__resolveType:t},await L.mutateAsync({blockKey:y,data:ln(d,y,f,te,pe)}),m===ie&&Wt(),Ve(null),Un(l)||H.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){H.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Mt(l))})}},mr=Se?.rule;if(yt&&m===null&&Y===null&&mr){const{resolveType:t,formValue:n}=Ut(mr,d??{},u??void 0);ee(t),se(n)}const sn=u?ll(u):[],fs=u&&d?cl(u,d):[],Ht=v&&u&&d?mc(u,d):[],ms=(t,n)=>{if(Ht.length===0)return;const s=Cl(t);return{kinds:Ht,selected:s,campaignPrefill:pc(t),onPick:n,load:Us}},pr=!q&&!!(ot&&u&&d),hr=Y&&u?qn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(bc(n,t,u,v))try{await Pn.mutateAsync({blockKey:t})}catch(s){H.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Mt(s))})}},gr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a={...s[n]},i={...a.sections},l=[...i.variants??[]],f=l[o],j=f?.rule;if(Jt(j,s,u)){const h=j?.__resolveType??"",R=s[h],E=typeof R?.name=="string"?R.name:h,{__resolveType:K,...z}=t;L.mutate({blockKey:h,data:Ft(K??"",z,E)},{onSuccess:()=>k?.(),onError:L.reportError});return}f&&(l[o]={...f,rule:t}),a.sections={...i,variants:l},L.mutate({blockKey:n,data:a},{onSuccess:()=>k?.(),onError:L.reportError})},xn(v))},vr=t=>{ee(t);const n=t?No(t,u):{__resolveType:Zr(u)};se(t?n:{}),gr(n)},yr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};gr(s)},In=async(t,n,s)=>{const o=hc(n,t);if(!o.ok)return o.reason==="conflict"&&H.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),_o),null;const a={};if(s){const i=s(o.rule);if(!i)return null;a[i.blockKey]=i.data}return o.blockWrite&&(a[o.blockWrite.blockKey]=o.blockWrite.block),Object.keys(a).length>0&&!(await Os.apply({writes:a})).ok?null:(o.blockWrite&&H.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{..._o,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:o.rule,projected:{...n,...a}})},Sr=Ht.length>0?{kinds:Ht,load:Us,prepare:async t=>(await In(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Pl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Os.apply({writes:{[Bl(t).blockKey]:n.block}})).ok}}:null,br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=await In(t,s,f=>{const j=s[n],h=j?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const R=h;if(!Array.isArray(R.variants))return null;const E=[...R.variants],K=E[o];return K?(E[o]={...K,rule:f},{blockKey:n,data:{...j,sections:{...R,variants:E}}}):null});if(!a)return;const{resolveType:i,formValue:l}=Ut(a.rule,a.projected,u??void 0);ee(i),se(l),k?.()},xr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=s[n],i=a?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[o];if(!j)return;const h=Dt(j.rule,s,u),R=cn(t);f[o]={...j,rule:R};const E={...s,[n]:{...a,sections:{...l,variants:f}}},{resolveType:K,formValue:z}=Ut(R,E,u??void 0);ee(K),se(z);try{await L.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(ne))})}},_r=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(!l)return;const h=o[n],R=a[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const Q=z?.__resolveType??"",be=i[Q],Ie=typeof be?.name=="string"?be.name:Q,{__resolveType:he,...ue}=t;L.mutate({blockKey:Q,data:Ft(he??"",ue,Ie)},{onSuccess:()=>k?.(),onError:L.reportError});return}const ne=_s(E,s,t),J=[...o];J[n]=Bt(h,R,ne);const Ne=ln(i,l,J,j,f);L.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:L.reportError})},xn(v)))},Aa=t=>{qe(t);const n=t?No(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),_r(n)},Na=t=>{const n=t;Fe(n);const s=Xt?{__resolveType:Xt,...n}:{...n};_r(s)},Ca=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=await In(t,i,K=>{const z=o[n],ne=a[n];if(!z||!ne?.isMultivariate)return null;const J=pt(z,ne);if(!J)return null;const Ne=[...o];return Ne[n]=Bt(z,ne,_s(J,s,K)),{blockKey:l,data:ln(i,l,Ne,j,f)}});if(!h)return;const{resolveType:R,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(R),Fe(E),k?.()},Pa=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=o[n],R=a[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const K=E.variants??[],z=Dt(K[s]?.rule,i,u),ne=cn(t),J=_s(E,s,ne),Ne=[...o];Ne[n]=Bt(h,R,J);const Q=ln(i,l,Ne,j,f),be={...i,[l]:Q},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await L.mutateAsync({blockKey:l,data:Q}),z&&z!==t&&await qt(z,be),k?.()}catch(ue){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(ue))})}};if(!q&&!oe)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(q&&!rs)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,kr=m!==null?B[m]:null,wr=kr&&je?.isMultivariate?pt(kr,je):null,Vt=wr?Yr(wr,we,v):[],Ln=Math.min(De,Math.max(Vt.length-1,0)),kt=Vt[Ln]??null,Tt=je?.isMultivariate===!0,ps=m!==null&&je!==null,At=ps&&(Tt||!!(Fn&&Ze)),Ba=At&&!q&&je?.isSavedBlock===!0,ft=q||Ba,Rr=q?Js:je?.label??"",Ka=Xt&&u?qn(Xt,u):null,jr=(t,n)=>n&&Z?`${t} · ${n}`:t,Er=je?je.variantOf??je.label:"",Ma=(()=>{const t=Tt&&kt?kt.label:null;return t?Z?[jr(Er,t)]:[je.label,t]:[je?.label??""]})(),hs=jr(oe?.name??"",yt?Se?.label:null),On=At&&(!q||M.length>0)?q?[Js,...M]:[hs,...Ma,...M]:[],Vr=Re&&oe?[oe.name,"SEO",...Ms]:[],Tr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Ar=Qt&&oe?[oe.name,Tr]:Lt&&oe&&je?[hs,Er,Tr]:[],zn=Ar.length>0?Ar:Vr.length>0?Vr:ft?On.length>0?On:[Rr]:On.length>0?On:[hs],Nr=ps&&!Tt&&!je?.isHidden&&!!y,Da=ft||!q&&yt&&!!Se||Nr,Fa=ps&&!Tt&&!q&&M.length===0&&!!je&&Do(je)&&!!y,Ia=Z&&At&&!Lt&&Tt&&M.length===0&&!!kt,Cr=Z&&M.length>0?uo(M[M.length-1]):null,La=M.length>1?uo(M[M.length-2]):null,Pr=ft?Rr:At?je?.label??"":oe?.name??"",Oa=Qt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):Re?c("sectionsEditor.panelSections.seo"):Cr??Pr,Br=Lt?je?.variantOf??je?.label??"":Qt||Re?oe?.name??"":Cr?La??Pr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?oe?.name??"":oe?.path??"",gs=!Qt&&!Lt&&!Re&&!At&&!ft,za=!Z&&!Re&&!q&&Tt&&M.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=yc(t.sections,B,u,v);if(!n)return;const{sections:s,newVariantIndex:o}=n;L.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{fe(o),I(null),A(null),W(null),T([]),se(null),ee(null)},onError:L.reportError})},$n=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const o=d[y],a=o.sections;if(!a||typeof a!="object"||Array.isArray(a))return;const i=a;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=Sc(i,l),j={...d,[y]:{...o,sections:f}};L.mutate({blockKey:y,data:j[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const R of h)await qt(R,j)})()},onError:L.reportError})},Kr=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),fe(s);const o=Yn(pe.map(a=>({rule:a.rule})),t,n);is(o,s),$n(a=>Yn(a,t,n))},Mr=t=>{const n=pe[t]?.rule,s=Dt(n,d??{},u??void 0);$n(o=>o.length<=1?null:(o.splice(t,1),o),()=>{pe.length-1===1?fe(0):t<te?fe(te-1):t===te&&fe(Math.max(0,t-1)),I(null),A(null),W(null),T([]),se(null),ee(null)},s)},$a=()=>{const t=pe.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!Ri(n.rule)).map(({variant:n})=>Dt(n.rule,d??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=zi({variants:n}),o=n[s];return o?[{...o,rule:$i(u)}]:null},()=>{fe(0),I(null),A(null),W(null),T([]),se(null),ee(null),Vn(!1)},t)},Dr=t=>{let n=t+1;$n(s=>(n=eo(s,t,v),xc(s,t,v)),()=>{fe(n),I(null),A(null),W(null),T([]),se(null),ee(null)})},Wa=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,o=re.current.decofile;if(!s)return;const a=o[s],i=a.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[t];if(!j?.rule||typeof j.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=j.rule,R=n.trim();en(!0);try{if(!R){if(!Jt(h,o,u)){D(null);return}const Q=h.__resolveType??"";f[t]={...j,rule:Ts(h,o,u)};const be={...o,[s]:{...a,sections:{...l,variants:f}}};await L.mutateAsync({blockKey:s,data:be[s]}),await qt(Q,be),D(null),k?.();return}const E=As(h,o,u);if(!E){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await L.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,R)}),D(null),k?.();return}const K=Jn(R),z=Qn(K,o,u);if(z){H.error(z);return}const ne=Ft(E.resolveType,E.data,R);let J=null,Ne=!1;try{const Q=await L.mutateAsync({blockKey:K,data:ne,create:!0});Ne=Un(Q),J=Ne?null:K,f[t]={...j,rule:cn(K)},await L.mutateAsync({blockKey:s,data:{...a,sections:{...l,variants:f}}}),J=null}catch(Q){throw J&&await Pn.mutateAsync({blockKey:J}).catch(()=>{}),Q}D(null),Ne||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:R})),k?.()}catch(E){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(E))})}finally{en(!1)}},Ha=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(s===null||!l)return;const h=o[s],R=a[s];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const K=E.variants??[],z=K[t];if(!z?.rule||typeof z.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,J=n.trim();en(!0);const Ne=async Q=>{const be={...E,variants:Q},Ie=[...o];Ie[s]=Bt(h,R,be);const he=ln(i,l,Ie,j,f);return await L.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!J){if(!Jt(ne,i,u)){O(null);return}const Xe=ne.__resolveType??"",Nt=[...K];Nt[t]={...z,rule:Ts(ne,i,u)};const Ct=await Ne(Nt);await qt(Xe,Ct),O(null),k?.();return}const Q=As(ne,i,u);if(!Q){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Q.blockKey){await L.mutateAsync({blockKey:Q.blockKey,data:Ft(Q.resolveType,Q.data,J)}),O(null),k?.();return}const be=Jn(J),Ie=Qn(be,i,u);if(Ie){H.error(Ie);return}const he=Ft(Q.resolveType,Q.data,J);let ue=null,Ge=!1;try{const Xe=await L.mutateAsync({blockKey:be,data:he,create:!0});Ge=Un(Xe),ue=Ge?null:be;const Nt=[...K];Nt[t]={...z,rule:cn(be)},await Ne(Nt),ue=null}catch(Xe){throw ue&&await Pn.mutateAsync({blockKey:ue}).catch(()=>{}),Xe}O(null),Ge||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Q){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(Q))})}finally{en(!1)}},Fr=async(t,n,s)=>{A(s);try{await L.mutateAsync({blockKey:t,data:s})}catch(o){throw A(a=>a===s?n:a),o}},qa={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,j=async R=>{const E={...t,variants:R};return await Fr(o,t,E),{...a,[o]:E}},h=Dc(f,s,a,u);if(h.kind!=="noop"){if(h.kind==="error"){H.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 K=[...i];K[n]={...l,rule:h.inlinedRule};const z=await j(K);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await L.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let R=null,E=!1;try{const K=await L.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Un(K),R=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await j(z),R=null}catch(K){throw R&&await Pn.mutateAsync({blockKey:R}).catch(()=>{}),K}E||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(R){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(R))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Dt(l.rule,a,u);i[n]={...l,rule:cn(s)};const j={...t,variants:i},h={...a,[o]:j};try{await Fr(o,t,j),f&&f!==s&&await qt(f,h),k?.()}catch(R){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(R))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;let i=null;!await In(s,a,f=>{const j=Array.isArray(t.variants)?[...t.variants]:[],h=j[n];return h?(j[n]={...h,rule:f},i={...t,variants:j},{blockKey:o,data:i}):null})||!i||(A(i),k?.())}},Ir=()=>{Wt(),v&&$t(null,-1,0)},Lr=t=>{dn(t),ds({inner:t})},Or=t=>{An(t),ds({raw:t})},zr=()=>{dn(null),Ot([])},$r=()=>Yt(t=>t+1),Wr=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1),ge?.()},Ga=()=>{Vn(!1),Tn(!1),I(null),un(!0)},Ua=()=>{Re&&Wr(),I(null),Vn(!0)},Ja=()=>Tn(!0),vs=t=>{if(Qt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&I(null);return}if(Re){if(t===0){Wr();return}if(t===1){Ot([]),Yt(s=>s+1);return}Ot(Ms.slice(0,t-1)),Yt(s=>s+1);return}if(q){T(M.slice(0,t)),$(s=>s+1);return}if(t===0){Ir();return}if(t===1){T([]),$(s=>s+1);return}const n=!Z&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(M.slice(0,t-1-n))},ys=zn.length>1?r.jsx("button",{type:"button",onClick:()=>vs(vl(zn.length,{isMultivariateSectionTop:za})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(Ji,{className:"size-4"})}):null,Qa=ft||At||Re?Da&&r.jsxs("div",{className:le("border-b px-3 py-2.5",ft&&"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:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Ir,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:le("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",dl),children:[r.jsx(ul,{rule:Rs(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Xn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Nr&&r.jsx(Gn,{onClick:()=>Sn()})]}),ft&&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(fo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:cr,variant:"header"})}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(co,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Gn,{onClick:bn})]}),Ya=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(mo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Kr,onRename:D,onDuplicate:Dr,onDelete:Mr,onAdd:bn}),yt&&Y!==null&&r.jsx(po,{className:"mt-3",children:r.jsx("div",{className:le("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:vr,onSelectGlobal:xr,named:ms(Se?.rule,br),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:hr,formValue:Ke,onChange:yr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Hr=r.jsxs(r.Fragment,{children:[r.jsx(fl,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:dr,onRename:O,onDuplicate:Ea,onDelete:ja,onRemoveAll:fr,onReorder:Va,onAdd:()=>Sn()}),r.jsx(po,{children:r.jsx(ks,{currentRt:Xt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:Aa,onSelectGlobal:Pa,named:ms(kt?.rule,Ca),namedRow:ws(kt?.rule,Ht),rule:kt?.rule,schema:Ka,formValue:qo,onChange:Na,formKey:`${m??"none"}:${Ln}:${Xt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),qr=r.jsx("div",{className:le(Z?"px-2":"p-2 pt-3"),children:r.jsx(Kc,{listKey:`${y??""}-${te}`,rawSections:B,sections:ce,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{va(t),Je?.(t)},onReorder:ya,onDelete:Sa,onDuplicate:ba,onMakeReusable:Ve,onToggleHidden:xa,onToggleLazy:rt?_a:void 0,onAddVariant:Sn,onDetach:ka,onAddSection:()=>He(!0),canAddSection:pr})}),Xa=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&oe&&r.jsx(fo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:cr}),nn&&y?r.jsx(To,{rawSeo:Kn,innerSeo:as,defaultResolveType:Ys,seoTypesLoading:v&&!u,seoSchema:Xs,activeResolveType:Mn,seoTypeOptions:Qs,formResetKey:Ds,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Or,onInnerChange:Lr,onClearForm:zr,onBumpFormKey:$r,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Za=r.jsx(an,{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:nn&&y?r.jsx(To,{rawSeo:Kn,innerSeo:as,defaultResolveType:Ys,seoTypesLoading:v&&!u,seoSchema:Xs,activeResolveType:Mn,seoTypeOptions:Qs,formResetKey:Ds,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Or,onInnerChange:Lr,onClearForm:zr,onBumpFormKey:$r,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),ei=r.jsxs(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(mo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Kr,onRename:D,onDuplicate:Dr,onDelete:Mr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:le("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Wo(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":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(Qi,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Ui,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:le("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:vr,onSelectGlobal:xr,named:ms(Se?.rule,br),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:hr,formValue:Ke,onChange:yr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),qr]},"editor-section-list");return r.jsx(lc,{value:v,children:r.jsx(ml,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!Z&&ys&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ys}),(Z||zn.length>1)&&r.jsx(Hi,{crumbs:zn,onSelect:vs,onSelectRoot:()=>{fn.flush(),Ue?Ue():vs(0)}}),r.jsx("div",{className:"shrink-0",children:Z?r.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[Z&&ys,ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Xn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{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:Oa}),Br&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Br})]}),gs&&yt&&Se&&r.jsx(ho,{variants:pe,activeIndex:te,onSelect:cs,onManage:Ua,onRemoveAll:$a}),Ia&&r.jsx(ho,{variants:Vt,activeIndex:Ln,onSelect:dr,onManage:Ja,onRemoveAll:fr}),gs&&!yt&&r.jsx(Gn,{onClick:bn}),Fa&&r.jsx(Gn,{onClick:()=>Sn()}),r.jsx(pl,{}),gs&&r.jsxs(r.Fragment,{children:[r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Ga,children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(co,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Qa}),ut&&r.jsx(pi,{open:!0,fields:hi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Hs??null,authorPending:Hs===void 0,fieldsAsLabeled:Ws!==null,fresh:ut.fresh,keepTyping:v,onChoose:(t,n)=>ga({...ut.choices,[t]:n}),onApply:ha},Lc(ut.formBase)),Lt?r.jsx(go,{onAdd:()=>Sn(),children:Hr},"editor-section-variants"):At?r.jsxs(an,{viewportRef:me,onBlur:sr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!Z&&Tt&&Vt.length>0&&M.length===0&&Hr,r.jsx(Ao,{value:Sr,children:r.jsx(vo,{value:q&&v?Be:null,children:r.jsx(yo,{activeSchema:Fn,formValue:Ze,formResetKey:Me,onFormChange:lr,onBreadcrumbChange:T,breadcrumbPath:M,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:ur,onVariantMatcherOp:q?qa:void 0})})})]},"editor-section-form"):q?r.jsx(an,{viewportRef:me,onBlur:sr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Ao,{value:Sr,children:r.jsx(vo,{value:q&&v?Be:null,children:r.jsx(yo,{activeSchema:Fn,formValue:Ze,formResetKey:Me,onFormChange:lr,onBreadcrumbChange:T,breadcrumbPath:M,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:ur})})})},"editor-global-block"):Re?Z?r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Xa})},"editor-seo"):Za:Qt?r.jsx(go,{onAdd:bn,children:Ya},"editor-variants"):Z?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:qr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ns,{canAddSection:pr,onAddSection:()=>He(!0)})})]},"editor-section-list"):ei,r.jsx(hl,{open:ie!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:ie!==null?Jn(ce[ie]?.label??""):"",isPending:L.isPending,onSubmit:Ta}),ot&&r.jsx(tc,{open:Ae,onOpenChange:t=>{He(t),t||(jn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:Ra}),ht&&y&&d&&r.jsx(sc,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(So,{open:!0,initialName:Jt(pe[Te]?.rule,d??{},u??void 0)?_n(pe[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(Rs(pe[Te]?.rule,d??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Wa(Te,t)},onOpenChange:t=>{!t&&!Zt&&D(null)}}),tt!==null&&r.jsx(So,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(Rs(Vt[tt]?.rule,d??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Ha(tt,t)},onOpenChange:t=>{!t&&!Zt&&O(null)}})]})})})}export{Wf as SectionsEditor};
1
+ import{ic as ti,br as ni,c as wn,b as Rn,r as b,m as le,j as r,ca as si,bo as Cs,id as Do,B as It,Y as on,aw as ri,_ as oi,bq as ai,Z as ii,q as li,ie as bs,hK as ci,ig as ui,ih as di,h as fi,bs as wt,ii as Qr,ij as xs,ik as mi,il as pt,im as Yr,io as pi,fT as hi,ip as gi,iq as Xr,ir as vi,t as H,fx as Zr,is as yi,it as Bt,iu as Si,iv as bi,iw as xi,fl as eo,ix as _s,iy as _i,iz as ki,iA as wi,fi as Ri,fU as ji,iB as Ei,iC as Vi,fw as Ti,K as Ai,iD as to,eQ as Ni,fM as Hn,fR as no,iE as so,iF as Ci,iG as Pi,iH as Bi,iI as Ki,iJ as Mi,iK as Di,iL as ro,iM as Fi,iN as Ii,fk as oo,iO as Li,iP as Oi,fO as ao,iQ as zi,fg as $i}from"./index-Dws-zNMb.js";import{u as Wi}from"./chat-context-hCQ1mfTr.js";import{a as Zn,M as io}from"./save-status-CgoD-OSr.js";import{p as kn,f as Hi,n as qi}from"./parse-sections-DXT317Uu.js";import{a as Gi}from"./repository-binding-CWC5A7qh.js";import{t as Ui}from"./ChevronDown-DL6BIz5f.js";import{d as Fo,b as Ji}from"./UserCheck01-C_H-l_wV.js";import{n as Qi}from"./ChevronUp-raY54gH6.js";import{b as Xn,e as Yi,Q as lo,L as co}from"./agent-icon-CRYupZK6.js";import{S as an}from"./scroll-area-yE4b8t8z.js";import{c as Rt,T as jt,a as Et}from"./tooltip-DlU94Hgw.js";import{g as Xi,h as Zi,i as el,E as tl,j as nl,V as sl,k as rl,l as ol,G as al,s as Jn,v as Qn,u as il,a as qn,p as Io,m as ll,n as cl,c as uo,o as ul,q as dl,A as Gn,P as fo,w as mo,x as po,y as ks,z as fl,B as ml,D as ho,F as pl,J as go,K as vo,L as yo,M as hl,Q as So,T as ln,U as gl,W as vl}from"./held-block-view-DbLxQ9uU.js";import{j as yl,u as Sl,i as bl,v as xl,aB as _l,U as kl,k as bo,aU as xo,a9 as Kt,aa as Mt,aq as wl,aV as Rl,aW as jl,aO as _o,at as El,aA as Vl}from"./site-editor-toast-BymLOidH.js";import{u as Tl,ao as ko,c as wo,k as Al,A as Nl,ad as Cl,ae as Pl,aj as Bl}from"./blocks-tab-states-D1zjsV30.js";import{u as Kl}from"./use-delete-block-D3LZPXdf.js";import{b as Ml,u as Dl,k as Un,e as xn}from"./use-never-published-ajD1yeUg.js";import{b as Es,f as Lo}from"./UserSquare-B41X0756.js";import{b as Fl}from"./MessageCircle01-BhIvz7K8.js";import{i as Ro}from"./Tool01-Behnzz1u.js";import{s as jo}from"./Eye-C0HPiOiR.js";import{s as Il}from"./Plus-C3X8_FHI.js";import{s as Ll}from"./Trash01-PZdGVeLy.js";import{i as Vs}from"./Zap-BkyYaQsJ.js";import{u as Ol,a as Eo,n as zl,P as $l,o as Wl,C as Hl,D as ql,c as Gl}from"./task-key-CttVN38p.js";import{u as Ul,s as Jl,a as Yn,S as Ql,v as Yl}from"./sortable.esm-CTCpd14C.js";import{s as Xl,g as Zl,u as ec,A as tc}from"./use-section-preview-base-CucfwoLI.js";import{m as nc,P as sc}from"./mustache-D-BETM-H.js";import{aR as Vo,aS as rc,X as oc,aT as ac,aU as ic,k as lc}from"./category-tree-ByM1arx3.js";import{u as cc,a as uc,P as To,w as dc,b as fc}from"./seo-editor-CeAq3tF_.js";import{v as mc,k as ws,x as Ao,j as pc,y as hc}from"./named-rule-step-CTOrHhtq.js";import{u as gc}from"./use-apply-named-rule-D1K-CTJc.js";import{o as Jt,f as Ts,y as As,q as Ft,h as cn,u as vc,n as Ut,r as Rs,m as Dt,k as _n,b as yc,s as No,z as Sc,A as bc,B as xc}from"./section-array-field-BSa-R005.js";import{b as Co,a as _c}from"./variant-matcher-override-DqN6Qt3p.js";import"./use-panel-navigate-cnbfkht1.js";import"./thread-route-CfOc-Skq.js";import"./use-project-scope-pykFyq6n.js";import"./use-view-draft-kind-BuUq_bMk.js";import"./use-blog-view-D1-0qsnM.js";import"./use-organization-settings-DgQPa1gy.js";import"./schema-Dd9rXy7Q.js";import"./task-board-nmvAE1np.js";import"./thread-intent-Cpu3ihkE.js";import"./use-mcp-client-Dj93nKzQ.js";import"./auth-DGjdHSEc.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BSVBaC3o.js";import"./session-runtime-RbvUuwNa.js";import"./use-entitlements-D5byd2v_.js";import"./use-ai-providers-CZZKXVB1.js";import"./use-current-view-TPfqtmJr.js";import"./use-in-settings--CBG8Ce6.js";import"./use-decopilot-events-CTU1ebGV.js";import"./use-org-fs-Bus57BBg.js";import"./useInfiniteQuery-B0htY_KT.js";import"./infiniteQueryObserver-BpNLIIMd.js";import"./Image01-B9u1sRLC.js";import"./Upload01-Bkeloppd.js";import"./label-DKw_OehI.js";import"./SwitchHorizontal01-DgSPPtsf.js";import"./popover-DYPQiSv-.js";import"./switch-Df6W8JM9.js";import"./toggle-group-D4LrchJT.js";import"./active-indicator-CCMhAsc_.js";import"./match-site-slug-config-B47_xZCi.js";import"./use-file-configs-PWDcgSOC.js";import"./asset-utils-DoL_7JcS.js";import"./AlertCircle-DOl7I58f.js";import"./hosted-reconcile-D6Q09K-j.js";import"./SearchMd-DhrULjIK.js";import"./textarea-DiEPPUlb.js";import"./use-copy-Ch95imPZ.js";import"./ChevronSelectorVertical-DG5kbzU4.js";import"./command-B2QNmjQS.js";import"./index-fkcdmHCO.js";import"./Play-CXqP7dUq.js";import"./monaco-editor-xIopiH53.js";import"./editor-B0cDiaJa.js";import"./ArrowUp-DjdsK6g2.js";import"./ArrowLeft-BmWvQCuj.js";import"./ArrowRight-hKo-D3nP.js";import"./BookOpen01-7rkhx8M3.js";import"./Globe04-BNrVMBgu.js";import"./CheckCircle-Dc3WHxxP.js";import"./LinkBroken01-CVzXRHEr.js";import"./CreditCard01-CbsMKYPA.js";import"./File02-Cq5pqf-S.js";import"./Fingerprint04-CgjCScjZ.js";import"./Key01-CimmnNZ7.js";import"./LayoutLeft-DntDUImX.js";import"./Minus-2Ocru1Vv.js";import"./Monitor01-B6F_ox0H.js";import"./Sun-8WH0s68D.js";import"./ShoppingBag01-Bvv8RGv1.js";import"./Users01-DQ_THwqW.js";import"./XClose-Bj-C863w.js";import"./index-BdQq_4o_.js";import"./index-B1J4AkqW.js";import"./utils-CWb2jsOo.js";import"./calendar-B6JrW2Q2.js";import"./usage-stats-D5XufpdL.js";import"./utils-CVEq3hMx.js";import"./markdown-I8GzTJiA.js";import"./use-mobile-BKxwZ6y7.js";import"./gateway-client-Bys0ijDk.js";import"./form-Pa5TasVH.js";import"./select-DV3WaQz3.js";import"./editor-classes-C7OZWc8j.js";import"./combobox-CVSWURlo.js";import"./content-changes-BqXl80v8.js";import"./sandbox-url-D3mC8qhT.js";import"./use-sandbox-events-CzU-CIRU.js";import"./use-blocks-v8-project-BD5Jh-pP.js";import"./use-voice-input-BXZD6ZnT.js";import"./drawer-BNjWjF9M.js";import"./index-BuJZ15yz.js";import"./checkbox-gfRmCHgt.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api--HjjhyJS.js";import"./empty-state-TATcP6j6.js";import"./search-input-BvwG9Gpz.js";import"./tabs-CbftHH4j.js";import"./use-debounced-value-BACx1z3V.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DpQo0BNT.js";import"./collapsible-9A7TtF9U.js";import"./use-task-board-items-3Ud_roVn.js";import"./config-BREyAdNr.js";import"./task-route-DZSYzo3l.js";import"./project-index-8q3yX-Uv.js";import"./shell-layout-C_SGZ8Vi.js";import"./use-deployment-admin-BFYSoSrq.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-150NxgCA.js";import"./integration-icon-Dtv10prb.js";import"./project-icon-CnIB282t.js";import"./use-navigate-to-agent-Cs2gjUt8.js";import"./new-project-dialog-By4VEC8c.js";import"./repository-picker-D7iBCD48.js";import"./github-icon-B__6ogZQ.js";import"./collection-search-BO1f-lS0.js";import"./new-project-store-CUdxp2Iq.js";import"./legacy-admin-welcome-dialog-DEMRqSrw.js";import"./required-auth-layout-BZu2puaM.js";import"./use-org-sso-DriBivLP.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DK2j0Tue.js";import"./types-DFah_SNi.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-L4HTwl4r.js";import"./use-connection-CIMAuSK_.js";import"./use-mcp-prompts-C96c-FQr.js";import"./use-thread-outputs-CPRCvFuj.js";import"./file-type-icon-CwbVdKyV.js";import"./slider--vRmZyWu.js";import"./index-MLF30Ige.js";import"./tooltipContext-D60le1gJ.js";import"./CategoricalChart-BnAT_zaF.js";import"./index-Bu31SDiQ.js";import"./use-move-blocks-DJWtOlrn.js";const kc={escape:Xi};function wc(g,e){for(const p of Xl(g,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function Rc(g,e){if(!e)return;const p=ti(g,ni(e));if(p)try{const S=wc(p.resolveType,e);return S&&nc.render(S,p.data,{},kc).trim()||void 0}catch{return}}function jc(g){const e=wn.c(13),{icon:p,label:S,className:x}=g;let V;e[0]!==x?(V=le("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(jt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(Rt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const Ec="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 Po(g){return Array.from({length:g},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Oo(g){return g.map((e,p)=>({...e,index:p}))}function Vc(g,e){if(e===g.length)return g;if(e<g.length)return Oo(g.slice(0,e));const p=Array.from({length:e-g.length},(S,x)=>({id:crypto.randomUUID(),index:g.length+x}));return[...g,...p]}function zo(g){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=g,C=Rn(),_=Zn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let X;e[0]!==x||e[1]!==S?(X=S&&x?Zl(S,x):void 0,e[0]=x,e[1]=S,e[2]=X):X=e[2];const ge=X;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?Rc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=rl(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&Cs(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Xn:k?Fo:Lo;let G;e[16]!==k||e[17]!==P?(G=P?{color:ai}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let F;e[19]!==xe||e[20]!==_?(F=_?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(al,{"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(Fl,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,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 d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Es,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=le("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const Z=Le??p.label;let ze;e[30]!==Ee||e[31]!==Z?(ze=r.jsx("span",{className:Ee,children:Z}),e[30]=Ee,e[31]=Z,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(jc,{icon:Vs,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(io,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(io,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==F||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[F,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=F,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const Tc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Ac="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 $o(g,e,p){if(p)return ol({selected:e});const S=g.isSavedBlock===!0,x=g.isMultivariate===!0;return le("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":S?Tc:x?Ac:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function js(g,e){return le("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":g?"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 Nc(g){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:X,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=g,w=Rn(),c=Zn(),xe=S?Cs(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let F;e[0]!==p?(F=Do(p),e[0]=p,e[1]=F):F=e[1];const ke=F,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Bc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:Z,transform:ze,isDragging:nt}=Ul(Oe);let Pe;e[4]!==ze?(Pe=Hl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let de;e[6]!==Pe||e[7]!==st?(de={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=de):de=e[8];const v=de;let we;e[9]!==p?(we=el(p),e[9]=p,e[10]=we):we=e[10];const rt=we,ot="button",m=0;let I;e[11]!==P?(I=D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),P())},e[11]=P,e[12]=I):I=e[12];const Ze=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Ze?(A=le("touch-none transition-colors",Ze,$o(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Ze,e[17]=A):A=e[17];let Qe;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Qe=r.jsx(zo,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Qe):Qe=e[22];const W=!c&&d&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(js(_e,xe)),onClick:D=>{D.stopPropagation(),Le?.()},onPointerDown:Pc,children:r.jsx(Vs,{className:le("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),at=c?r.jsx(tl,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(Ro,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})}):r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(js(_e,G)),onClick:D=>{D.stopPropagation(),Ue()},onPointerDown:Cc,children:G?r.jsx(Ro,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=oi,Ye=nl;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=le(js(_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 $e;e[25]!==Ye||e[26]!==ve||e[27]!==it?($e=r.jsx(Ye,{label:ve,classicClassName:it}),e[25]=Ye,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(on,{onClick:D=>{D.stopPropagation(),Le?.()},children:[r.jsx(Vs,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(ri,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==X?(Ke=D=>{D.stopPropagation(),X()},e[35]=X,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(Yi,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(on,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let M;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(M=ke&&r.jsxs(on,{className:le(!c&&sl),onClick:D=>{D.stopPropagation(),Ce()},children:[r.jsx(Fo,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=M):M=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(on,{className:le(!c&&Ec),onClick:D=>{D.stopPropagation(),ge()},children:[c?r.jsx(Xn,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let me;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(me=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(on,{onClick:D=>{D.stopPropagation(),Je()},children:[c?r.jsx(Lo,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=me):me=e[58];let We;e[59]!==k?(We=D=>{D.stopPropagation(),k()},e[59]=k,e[60]=We):We=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Ll,{className:"h-4 w-4"}),e[61]=et):et=e[61];let Me;e[62]!==w?(Me=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=Me):Me=e[63];let $;e[64]!==We||e[65]!==Me?($=r.jsxs(on,{variant:"destructive",onClick:We,children:[et,Me]}),e[64]=We,e[65]=Me,e[66]=$):$=e[66];let ie;e[67]!==Be||e[68]!==ee||e[69]!==M||e[70]!==T||e[71]!==me||e[72]!==$?(ie=r.jsxs(ii,{align:"end",className:"w-44",children:[Be,ee,M,T,me,$]}),e[67]=Be,e[68]=ee,e[69]=M,e[70]=T,e[71]=me,e[72]=$,e[73]=ie):ie=e[73];let Ve;e[74]!==fe||e[75]!==$e||e[76]!==ie?(Ve=r.jsxs(fe,{children:[$e,ie]}),e[74]=fe,e[75]=$e,e[76]=ie,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==Z||e[82]!==v||e[83]!==A||e[84]!==Qe||e[85]!==W||e[86]!==at||e[87]!==Ve||e[88]!==I?(Te=r.jsxs("div",{ref:Z,style:v,...u,...Ee,role:ot,tabIndex:m,onClick:P,onKeyDown:I,className:A,children:[Qe,W,at,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=Z,e[82]=v,e[83]=A,e[84]=Qe,e[85]=W,e[86]=at,e[87]=Ve,e[88]=I,e[89]=Te):Te=e[89],Te}function Cc(g){return g.stopPropagation()}function Pc(g){return g.stopPropagation()}function Bc(){return!1}function Ns(g){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=g,C=Rn();let _;e[0]!==x?(_=le("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Il,{size:14}),e[2]=k):k=e[2];let X;e[3]!==C?(X=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=X):X=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==X?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,X]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=X,e[10]=ge):ge=e[10],ge}function Kc(g){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:X,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=g,G=xe===void 0?!0:xe,_e=Rn(),F=Zn();let ke;e[0]!==x.length?(ke=()=>Po(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[Z,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);Z!==p?(ze(p),Pe(x.length),Oe(Po(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Vc(tt,x.length)));let de;e[2]===Symbol.for("react.memo_cache_sentinel")?(de={activationConstraint:{distance:8}},e[2]=de):de=e[2];let v;e[3]===Symbol.for("react.memo_cache_sentinel")?(v={coordinateGetter:Jl},e[3]=v):v=e[3];const we=Ol(Eo($l,de),Eo(zl,v));let rt;e[4]!==d?(rt=d.map(Mc),e[4]=d,e[5]=rt):rt=e[5];const ot=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const I=m;let Ze;e[7]!==ot||e[8]!==k?(Ze=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const He=ot.indexOf(String(O.id)),ht=ot.indexOf(String(Ae.id));He===-1||ht===-1||(Oe(bt=>Oo(Yn([...bt],He,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(He,ht))},e[7]=ot,e[8]=k,e[9]=Ze):Ze=e[9];const A=Ze;let Qe;e[10]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{Ee(null)},e[10]=Qe):Qe=e[10];const W=Qe;let at,fe,Ye,ve,it,$e,Be,Ke,se,Y,ee,M,T,me,We;if(e[11]!==u||e[12]!==G||e[13]!==F||e[14]!==C||e[15]!==d||e[16]!==ot||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==X||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){me=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==F||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Ye=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let He;e[61]!==Ae?(He=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=He):He=e[62];const ht=He;let bt;e[63]!==G||e[64]!==F||e[65]!==ht||e[66]!==c?(bt=F?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=F,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],me=bt;break e}T=le(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=F,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Ye,e[57]=ve,e[58]=T}else Ye=e[56],ve=e[57],T=e[58];fe=ql,Ke=we,se=Gl,Y=I,ee=A,M=W,at=Ql,$e=ot,Be=Yl,We="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Nc,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>X(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=F,e[14]=C,e[15]=d,e[16]=ot,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=X,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=at,e[34]=fe,e[35]=Ye,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=M,e[45]=T,e[46]=me,e[47]=We}else at=e[33],fe=e[34],Ye=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],M=e[44],T=e[45],me=e[46],We=e[47];if(me!==Symbol.for("react.early_return_sentinel"))return me;let et;e[68]!==it||e[69]!==We?(et=r.jsx("div",{className:We,children:it}),e[68]=it,e[69]=We,e[70]=et):et=e[70];let Me;e[71]!==at||e[72]!==$e||e[73]!==Be||e[74]!==et?(Me=r.jsx(at,{items:$e,strategy:Be,children:et}),e[71]=at,e[72]=$e,e[73]=Be,e[74]=et,e[75]=Me):Me=e[75];let $;e[76]!==Ye||e[77]!==ve||e[78]!==F||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:le("cursor-grabbing shadow-lift",$o(ve,!1,F)),children:r.jsx(zo,{section:ve,raw:Ye,meta:V,decofile:C})}):null,e[76]=Ye,e[77]=ve,e[78]=F,e[79]=C,e[80]=V,e[81]=$):$=e[81];let ie;e[82]!==$?(ie=si.createPortal(r.jsx(Wl,{dropAnimation:Zi,children:$}),document.body),e[82]=$,e[83]=ie):ie=e[83];let Ve;e[84]!==fe||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==M||e[90]!==Me||e[91]!==ie?(Ve=r.jsxs(fe,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:M,children:[Me,ie]}),e[84]=fe,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=M,e[90]=Me,e[91]=ie,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==F||e[95]!==c?(Te=!F&&r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=F,e[95]=c,e[96]=Te):Te=e[96];let D;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(D=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=D):D=e[100],D}function Mc(g){return g.id}function Dc(g,e,p,S){if(!g||typeof g!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(g,p,S)?{kind:"inline",blockKey:g.__resolveType??"",inlinedRule:Ts(g,p,S)}:{kind:"noop"};const V=As(g,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Jn(x),_=Qn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Bo="section-form-stale-save",Fc=3;function Ko(g,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Io(e.pageKey?g[e.pageKey]?.sections:void 0,g,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,g,p)}}const Mo=new WeakMap;let Ic=0;function Lc(g){let e=Mo.get(g);return e===void 0&&(e=++Ic,Mo.set(g,e)),e}function Wf({orgSlug:g,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:X=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=Rn(),xe=Wi(),G=xe?.taskId??null,_e=S?{orgSlug:g,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[F,ke]=b.useState([]),{data:d,isLoading:Oe}=yl(_e,{pollWhile:F.length>0}),{data:u,isLoading:Ee}=Tl(_e),Z=Zn(),ze=xe?.virtualMcpId,Pe=Gi(ze===e?e:null)?.metadata?.siteSlug??null,st=ec({virtualMcpId:e,branch:p,sandboxUrl:x}),de=Sl(e,p),v=bl(de),we=Ti(v),rt=!v,ot=!!st||v,[m,I]=b.useState(null),[Ze,A]=b.useState(null),[Qe,W]=b.useState(null),[at,fe]=b.useState(0),[Ye,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[M,T]=b.useState([]),me=b.useRef(null),[We,et]=b.useState(M.length);We!==M.length&&(et(M.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Me,$]=b.useState(0),[ie,Ve]=b.useState(null),[Te,D]=b.useState(null),[tt,O]=b.useState(null),[Ae,He]=b.useState(!1),[ht,bt]=b.useState(!1),jn=b.useRef(null),[En,Wo]=b.useState(!0),[Qt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[Re,un]=b.useState(X),[Ps,Bs]=b.useState(X);X&&!Ps&&(Bs(!0),un(!0),I(null),A(null),W(null),T([])),!X&&Ps&&Bs(!1);const[Ho,dn]=b.useState(null),[Ks,An]=b.useState(void 0),[Ms,Ot]=b.useState([]),[Ds,Yt]=b.useState(0),[De,lt]=b.useState(0),[qo,Fe]=b.useState(null),[Xt,qe]=b.useState(null),[Fs,Is]=b.useState(null),Nn=li(),Cn=xl({orgSlug:g,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Ml({orgSlug:g,virtualMcpId:e,branch:p}),[Go,Uo]=b.useState(V),[Jo,Qo]=b.useState(C),[Yo,Xo]=b.useState(_);(Go!==V||Jo!==C||Yo!==_)&&(queueMicrotask(()=>fn.flush()),Uo(V),Qo(C),Xo(_),I(null),A(null),W(null),fe(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1));const L=Dl({orgSlug:g,virtualMcpId:e,branch:p}),Ls=il({orgSlug:g,virtualMcpId:e,branch:p},d??{},{onSaved:k}),mn=Ls.save,Pn=Kl({orgSlug:g,virtualMcpId:e,branch:p}),Os=gc({orgSlug:g,virtualMcpId:e,branch:p}),[Zt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Bn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),es=b.useRef(new WeakSet);_l(g,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:o,selectedSectionIndex:a}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,a]){const f=l==null?void 0:s[l],j=l==null?void 0:o[l],h=f&&j?.isSavedBlock?bs(f,j):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Bn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[zs,$s]=b.useState(0),[Zo,ea]=b.useState(0),Ws=ci(de,{orgSlug:g,virtualMcpId:e,branch:p}),Hs=ui(Ws,F[0]?.blockKey??null,di(d,F[0]?.blockKey??null)),[ta,na]=b.useState(null),ts=kl(g,e).epoch,[sa,ra]=b.useState(ts);cc(Re?{orgSlug:g,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const qs=_??(d&&u?ko(wo(d,u),V,C)?.key??null:null),ns=bo({orgSlug:g,virtualMcpId:e,branch:p},qs?[qs]:[],{withRefs:!0}),[Gs,oa]=b.useState(!1),ss=bo({orgSlug:g,virtualMcpId:e,branch:p},Gs?Al:[]),Us={ready:!(de.kind==="protocol"&&de.hosted)||Gs&&ss.ready,failed:ss.failed,retry:ss.retry,request:()=>oa(!0)};if(ns.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:ns.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!ns.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(fi,{className:"size-5 text-muted-foreground"})});if(!d||!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 aa=wo(d,u),q=!!_,oe=q?null:ko(aa,V,C),y=q?_:oe?.key??null,rs=q&&_?d[_]:void 0,Js=q&&_&&rs?Nl(_,rs):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,os=Re&&d&&u&&y&&oe?Vo(d,{kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},u):null,ia=Re?nn?.seo:void 0,Kn=Ks!==void 0?Ks:ia,la=Re?rc(Kn):void 0,Qs=os?.seoTypeOptions??[],Ys=Re&&u?oc(u):"",as=Ho??la??{},Mn=Re&&os?uc(as,os):null,Xs=Re&&Mn&&ac(Kn)?qn(Mn,u):null,Zs=Re?ic(d,u)?.seoData:void 0,pe=q?[{label:"Default",sections:[{__resolveType:_}]}]:Io(nn?.sections,d??{},v),yt=pe.length>1,te=Math.min(at,pe.length-1),Se=pe[te],B=Se?.sections??[],ce=kn(B,d,v),Dn=!q&&vc(nn?.sections,v);if(q&&_&&Fs!==_){Is(_);const t=B[0],n=ce[0];if(t&&n){I(0),lt(0),T([]);const s=wt(t,n,d,v);s&&(A(s.data),W(s.resolveType),qe(null),Fe(null))}}!q&&Fs!==null&&Is(null),re.current={rawSections:B,parsedSections:ce,decofile:d??{},activePageKey:y,pageVariants:pe,variantIndex:te,sectionVariantIndex:De,selectedSectionIndex:m};const ca=()=>({multivariate:Dn,index:te,variants:pe.map(t=>({rule:t.rule})),lazyValues:v&&Dn&&Ni(nn?.sections?.variants?.[te]?.value)}),is=(t,n)=>{if(!w)return;if(!y||!Dn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},o=v?xo(y,s):Co(y,s,d,u);w(o.length>0?o:null)},ls=w&&y&&Dn&&yt&&!Oe&&!Ee?y:null;if(ls!==ta&&(na(ls),ls)){const t=pe.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>is(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const o=ca(),a=v?xo(y,o):Co(y,o,d,u);if(!t||n<0){w(a.length>0?a:null);return}const i={pageKey:y,page:o,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=v?Rl(i):_c({...i,decofile:d,meta:u}),f=v?jl(a,l):[...a,...l];w(f.length>0?f:null)},xt=(t,n,s,o=m??-1,a=!1)=>{const i=pt(t,n);if(!i){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const f=Yr(i,we)[s];if(!f){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const j=gi(f.value,d);A(j?.data??null),W(j?.resolveType??null);const{resolveType:h,formValue:R}=Ut(f.rule,d,u??void 0);qe(h),Fe(R),a&&$t(i,o,s)},cs=t=>{D(null),fe(t),I(null),A(null),W(null),T([]);const n=pe[t]?.rule,{resolveType:s,formValue:o}=Ut(n,d??{},u??void 0);ee(s),se(o),is(pe.map(a=>({rule:a.rule})),t)},ua=(t,n)=>{const s=B[t],o=ce[t];if(!s||!o)return!1;const a=o.isMultivariate?pt(s,o)?.variants?.length??0:0,i=n<a?n:0;if(I(t),lt(i),T([]),$(l=>l+1),o.isMultivariate)xt(s,o,i,t);else{const l=wt(s,o,d,v);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),qe(null),Fe(null)}return!0},er=P?.index;if(P!==void 0&&(P?.seq??null)!==Ye&&(ve(P?.seq??null),typeof er=="number"&&ua(er,0)),ts!==sa){ra(ts);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||L.isPending||Ls.isPending||fn.isPending||F.length>0,n=m!==null&&Qr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=B[m],o=ce[m];if(T([]),$(a=>a+1),!s||!o)I(null),A(null),W(null);else if(o.isMultivariate)xt(s,o,De,m);else{const a=wt(s,o,d,v);A(a?.data??null),W(a?.resolveType??null)}}!t&&Re&&(dn(null),An(void 0),Yt(s=>s+1))}if(zs!==Zo){ea(zs);const t=m!==null?B[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,De,m);else{const s=wt(t,n,d,v);A(s?.data??null),W(s?.resolveType??null)}}const ut=F[0];if(ut){const{formBase:t,target:n}=ut,s=Ko(d,n,v),o=t.sectionIndex,a=s.rawSections.length===t.sectionCount?xs(s.rawSections[o],s.parsedSections[o],n.sectionVariantIndex,d,v):null,i=mi(ut,a,l=>Xr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...F.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:g,virtualMcpId:e,branch:p,threadId:G,previewUrl:v?void 0:x??void 0,siteSlug:Pe},Fn=Qe&&u?qn(Qe,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=ln(d,y,t,te,pe);L.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:o=>{n?.onError?.(),L.reportError(o)}})},Wt=()=>{Ce?.(null),I(null),Tn(!1),A(null),W(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},tr=()=>Qr(me.current,document.activeElement),us=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,H.error(t,{id:Bo}),tr()){tn.current=!0;return}$s(n=>n+1)},nr=()=>{!tn.current||tr()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,$s(t=>t+1))},sr=()=>{tn.current&&setTimeout(nr,0)},rr=de.kind==="protocol"&&de.source==="github",or=t=>Vl(Nn,Cn,t,de.kind==="protocol"?de:null),ar=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},da=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:o}=re.current,a=zt.current;return{formBase:a?.sectionIndex===t&&a.variantIndex===o?a:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:o,schema:Fn}},vn=t=>{ct.current=t,ke(t)},fa=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),o=s>=0?n[s]:void 0,a=o?n.with(s,{...t,choices:so(o.plan,o.choices,t.plan),fresh:Li(o.plan,t.plan,o.fresh),changedAgain:o.changedAgain||Hn(o.plan.theirs)!==Hn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(a)},ir=(t,n)=>{const s=ct.current,o=s.findIndex(l=>l.formBase===t),a=s[o];if(!a)return!1;if(Hn(a.plan.mine)===Hn(n))return!0;const i=no({...a.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==a);return vn(l),!1}return vn(s.with(o,{...a,plan:i,choices:so(a.plan,a.choices,i)})),!0},ma=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},pa=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const o=n.emitted;return o&&typeof o=="object"&&!ir(n,o)&&yn(o,n.sectionIndex,0,s),ct.current[0]??null},ha=()=>{const t=ct.current[0],n=pa();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=ji(n.plan,n.choices);de.kind==="protocol"&&de.source==="github"&&Ei(n.plan,n.choices)&&wl(c,!1),vn(ct.current.slice(1));const{formBase:o,target:a}=n;o.base=n.plan.theirs,o.version=void 0,o.emitted=s,es.current.add(o),(zt.current===o||ma(n))&&(zt.current=o,A(s),$(i=>i+1)),yn(s,o.sectionIndex,0,a)},ga=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,o,a=!1)=>{const i=o??da(n),l=i.sectionVariantIndex,f=i.formBase,j=a||to(ct.current,f,i,n,v).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const R=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(R,E);return}const K=typeof t=="function"?t():t,z=to(ct.current,f,i,n,v).base;if(z&&ir(z,K))return;const ne=re.current.decofile,{rawSections:J,parsedSections:Ne,pageVariants:Q,variantIndex:be}=Ko(ne,i,v),Ie=i.pageKey,he=J[n];if(!he)return;const ue=Ne[n];if(!ue)return;const Ge=f?.base,Xe=xs(he,ue,l,ne,v),Nt=!!Ge&&!!Xe&&Ci(Ge,Xe)&&!(f&&Xr(f,Xe));if(Nt&&Ge&&Xe){if(Pi(Ge,Xe)){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const U=ue.isSavedBlock?"here":Bi(Ge,J.map((ae,mt)=>xs(ae,Ne[mt],l,ne,v)),n,f?.sectionCount??J.length);if(U==="unknown"){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof U=="number"&&f){f.sectionCount=J.length,f.sectionIndex=U,zt.current===f&&I(U),yn(K,U,s,i);return}}const Ct=Nt&&Ge&&Xe?no({ancestor:Ge,mine:K,theirs:Xe}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=J.length,fa({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Ki(Ct),changedAgain:!1,blockKey:ue.isSavedBlock?bs(he,ue):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??K,Gr=Mi({merged:!!Pt,tracked:f,current:zt.current,saved:K});Pt&&H.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Bo}),Gr&&f&&(f.emitted=Pt,A(Pt));const Ss=Gr||!Pt?rn:K;f&&(f.base=Ss,f.sectionCount=J.length,Di(f,Ss));const Ur={onSuccess:()=>{f&&es.current.delete(f),k?.()},onError:U=>{if(f?.base===Ss&&Ge&&(f.base=Ge),U instanceof El){if(f&&(f.version=void 0),s<Fc){ye.current.delete(R),hn.current=!0;const ae=Oi(s,U.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:K},n,s+1,i,ae.immediate),ye.current.delete(R),ar(xn(v))},ae.delay)}else us();return}L.reportError(U)}},Jr=U=>{pn.current=!0;let ae=!1;L.mutateAsync(U).then(()=>Ur.onSuccess(),mt=>{ae=!0,Ur.onError(mt)}).finally(()=>{pn.current=!1,ar(ae?xn(v):0),nr()})};if(ue.isSavedBlock){const U=bs(he,ue);if(!U)return;Jr({blockKey:U,data:rn,...Ge?{base:{value:Fi({startedFrom:Ge,stored:Xe,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:ro({formBase:f,rebased:!!Pt,versionOf:or,productionVersionOf:ae=>ao(Nn,Cn,ae),...rr?{copy:{value:ne[U]}}:{}})});return}if(!Ie)return;const Wn={...ne[Ie]},Gt=[...J];if(ue.isMultivariate){const U=pt(he,ue);if(!U||!Ie)return;const ae=Ii(U,l,rn);Gt[n]=Bt(he,ue,ae)}else if(ue.isHidden){const U=Cs(he.__resolveType),ae=U?{...he.section}:{...he},mt=Array.isArray(ae.variants)?[...ae.variants]:[];mt[0]&&(mt[0]=oo(ae.__resolveType,mt[0],rn)),ae.variants=mt,U?Gt[n]={...he,section:ae}:Gt[n]=ae}else ue.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(Q.length>1){const U=Wn.sections,ae=[...U?.variants??[]];ae[be]&&(ae[be]=oo(U?.__resolveType,ae[be],Gt)),Wn.sections={...U,variants:ae}}else Wn.sections=Gt;Jr({blockKey:Ie,data:Wn,rebaseOnConflict:!1,guard:ro({formBase:null,rebased:!1,versionOf:or,productionVersionOf:U=>ao(Nn,Cn,U),...rr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},j){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(v))},va=t=>{tn.current=!1,I(t),lt(0),T([]),$(a=>a+1);const n=B[t],s=ce[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const o=wt(n,s,d,v);if(!o){A(null),W(null),qe(null),Fe(null),$t(null,t,0);return}A(o.data),W(o.resolveType),qe(null),Fe(null),$t(null,t,0)},lr=t=>{const n=t;m!==null&&(zt.current=Vi(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Ze,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},ds=t=>{if(!y||!d||!u||!oe)return;const n={kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},s=Vo(d,n,u);s&&fn.save(y,()=>{const o=Nn.getQueryData(Ai.decofile(Cn))?.[y];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const a={...o,...Bn.current};return Bn.current={},t?.raw!==void 0?dc(a,t.raw,u):t?.inner!==void 0?fc(n,s,a,t.inner):a})},cr=(t,n)=>{y&&(Bn.current[t]=n,ds())},ya=(t,n)=>{if(!y)return;const s=Yn([...B],t,n);m!==null&&(m===t?I(n):t<m&&n>=m?I(m-1):t>m&&n<=m&&I(m+1)),dt(s)},Sa=t=>{if(!y)return;const n=B.filter((s,o)=>o!==t);m===t?Wt():m!==null&&m>t&&I(m-1),dt(n)},ba=t=>{if(!y)return;const n=B[t];if(!n)return;const s=[...B];s.splice(t+1,0,gl(n)),m!==null&&m>t&&I(m+1),dt(s)},xa=t=>{if(!y)return;const n=B[t],s=ce[t];if(!n||!s)return;const o=s.isHidden?ki(n,v):wi(n,u);if(!o)return;const a=[...B];a[t]=o,m===t&&Wt(),dt(a)},_a=t=>{if(!y)return;const n=B[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const o=_i(n);if(!o)return;const a=[...B];a[t]=o,m===t&&Wt(),dt(a)},ka=t=>{if(!y)return;const n=B[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const o=wt(n,s,d,v);if(!o?.data)return;const{name:a,...i}=o.data,l=[...B];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Wt(),dt(l)},wa=t=>{if(!y)return;const n=qi(ce),s=[...B.slice(0,n),{__resolveType:t.resolveType},...B.slice(n)];dt(s,{onError:()=>{re.current.selectedSectionIndex===n&&Wt()}}),He(!1),I(n),lt(0),T([]),$(l=>l+1);const o=s[n],a=kn(s,d,v)[n];if(!o||!a)return;if(a.isMultivariate){xt(o,a,0);return}const i=wt(o,a,d,v);if(!i){A(null),W(null),qe(null),Fe(null);return}A(i.data),W(i.resolveType),qe(null),Fe(null)},ur=t=>{jn.current=t.append,He(!0)},Ra=t=>{const n=jn.current;if(!n){wa(t);return}n({__resolveType:t.resolveType}),He(!1),jn.current=null},dr=t=>{if(m===null)return;const n=B[m],s=ce[m];!n||!s?.isMultivariate||(lt(t),T([]),$(o=>o+1),xt(n,s,t,m,!0))},ja=t=>{if(m===null||!y)return;const n=B[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=bi(o,t);if(!a){H.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...B];i[m]=Bt(n,s,a);const l=a.variants;let f=De;t===De?f=Math.min(t,l.length-1):t<De&&(f=De-1),lt(f),T([]),$(j=>j+1),xt(i[m],s,f),dt(i)},Ea=t=>{if(m===null||!y)return;const n=B[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=xi(o,t,v),i=[...B];i[m]=Bt(n,s,a);const l=eo(o.variants??[],t,v);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,v),dt(i)},Va=(t,n)=>{if(m===null||!y||t===n)return;const s=B[m],o=ce[m];if(!s||!o?.isMultivariate)return;const a=pt(s,o);if(!a)return;const i=yi(a,t,n),l=[...B];l[m]=Bt(s,o,i);let f=De;De===t?f=n:t<De&&n>=De?f=De-1:t>De&&n<=De&&(f=De+1),lt(f),xt(l[m],o,f,m,v),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=B[n],o=ce[n];if(!s||!o)return;const a=vi(s,o,void 0,u,v);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...B];i[n]=a.section;const l=kn(i,d,v)[n];if(!l?.isMultivariate){H.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}I(n),lt(a.newVariantIndex),T([]),$(f=>f+1),xt(a.section,l,a.newVariantIndex,n,v),dt(i)},fr=()=>{if(m===null||!y)return;const t=B[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const o=Si(t,n,s);if(!o){H.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const a=[...B];a[m]=o;const i=kn(a,d,v)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(o,i,d,v);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),$t(null,m,0),dt(a)},Ta=async t=>{if(ie===null||!y)return;const n=Qn(t,d,u);if(n){H.error(n);return}const s=B[ie],o=ce[ie];if(!s||!o)return;const a=wt(s,o,d,v);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...a.data,name:t};try{const l=await L.mutateAsync({blockKey:t,data:i,create:!0}),f=[...B];f[ie]={__resolveType:t},await L.mutateAsync({blockKey:y,data:ln(d,y,f,te,pe)}),m===ie&&Wt(),Ve(null),Un(l)||H.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){H.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Mt(l))})}},mr=Se?.rule;if(yt&&m===null&&Y===null&&mr){const{resolveType:t,formValue:n}=Ut(mr,d??{},u??void 0);ee(t),se(n)}const sn=u?ll(u):[],fs=u&&d?cl(u,d):[],Ht=v&&u&&d?mc(u,d):[],ms=(t,n)=>{if(Ht.length===0)return;const s=Cl(t);return{kinds:Ht,selected:s,campaignPrefill:pc(t),onPick:n,load:Us}},pr=!q&&!!(ot&&u&&d),hr=Y&&u?qn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(bc(n,t,u,v))try{await Pn.mutateAsync({blockKey:t})}catch(s){H.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Mt(s))})}},gr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a={...s[n]},i={...a.sections},l=[...i.variants??[]],f=l[o],j=f?.rule;if(Jt(j,s,u)){const h=j?.__resolveType??"",R=s[h],E=typeof R?.name=="string"?R.name:h,{__resolveType:K,...z}=t;L.mutate({blockKey:h,data:Ft(K??"",z,E)},{onSuccess:()=>k?.(),onError:L.reportError});return}f&&(l[o]={...f,rule:t}),a.sections={...i,variants:l},L.mutate({blockKey:n,data:a},{onSuccess:()=>k?.(),onError:L.reportError})},xn(v))},vr=t=>{ee(t);const n=t?No(t,u):{__resolveType:Zr(u)};se(t?n:{}),gr(n)},yr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};gr(s)},In=async(t,n,s)=>{const o=hc(n,t);if(!o.ok)return o.reason==="conflict"&&H.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),_o),null;const a={};if(s){const i=s(o.rule);if(!i)return null;a[i.blockKey]=i.data}return o.blockWrite&&(a[o.blockWrite.blockKey]=o.blockWrite.block),Object.keys(a).length>0&&!(await Os.apply({writes:a})).ok?null:(o.blockWrite&&H.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{..._o,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:o.rule,projected:{...n,...a}})},Sr=Ht.length>0?{kinds:Ht,load:Us,prepare:async t=>(await In(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Pl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Os.apply({writes:{[Bl(t).blockKey]:n.block}})).ok}}:null,br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=await In(t,s,f=>{const j=s[n],h=j?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const R=h;if(!Array.isArray(R.variants))return null;const E=[...R.variants],K=E[o];return K?(E[o]={...K,rule:f},{blockKey:n,data:{...j,sections:{...R,variants:E}}}):null});if(!a)return;const{resolveType:i,formValue:l}=Ut(a.rule,a.projected,u??void 0);ee(i),se(l),k?.()},xr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=s[n],i=a?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[o];if(!j)return;const h=Dt(j.rule,s,u),R=cn(t);f[o]={...j,rule:R};const E={...s,[n]:{...a,sections:{...l,variants:f}}},{resolveType:K,formValue:z}=Ut(R,E,u??void 0);ee(K),se(z);try{await L.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(ne))})}},_r=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(!l)return;const h=o[n],R=a[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const Q=z?.__resolveType??"",be=i[Q],Ie=typeof be?.name=="string"?be.name:Q,{__resolveType:he,...ue}=t;L.mutate({blockKey:Q,data:Ft(he??"",ue,Ie)},{onSuccess:()=>k?.(),onError:L.reportError});return}const ne=_s(E,s,t),J=[...o];J[n]=Bt(h,R,ne);const Ne=ln(i,l,J,j,f);L.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:L.reportError})},xn(v)))},Aa=t=>{qe(t);const n=t?No(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),_r(n)},Na=t=>{const n=t;Fe(n);const s=Xt?{__resolveType:Xt,...n}:{...n};_r(s)},Ca=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=await In(t,i,K=>{const z=o[n],ne=a[n];if(!z||!ne?.isMultivariate)return null;const J=pt(z,ne);if(!J)return null;const Ne=[...o];return Ne[n]=Bt(z,ne,_s(J,s,K)),{blockKey:l,data:ln(i,l,Ne,j,f)}});if(!h)return;const{resolveType:R,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(R),Fe(E),k?.()},Pa=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(n===null||!l)return;const h=o[n],R=a[n];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const K=E.variants??[],z=Dt(K[s]?.rule,i,u),ne=cn(t),J=_s(E,s,ne),Ne=[...o];Ne[n]=Bt(h,R,J);const Q=ln(i,l,Ne,j,f),be={...i,[l]:Q},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await L.mutateAsync({blockKey:l,data:Q}),z&&z!==t&&await qt(z,be),k?.()}catch(ue){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(ue))})}};if(!q&&!oe)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(q&&!rs)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,kr=m!==null?B[m]:null,wr=kr&&je?.isMultivariate?pt(kr,je):null,Vt=wr?Yr(wr,we,v):[],Ln=Math.min(De,Math.max(Vt.length-1,0)),kt=Vt[Ln]??null,Tt=je?.isMultivariate===!0,ps=m!==null&&je!==null,At=ps&&(Tt||!!(Fn&&Ze)),Ba=At&&!q&&je?.isSavedBlock===!0,ft=q||Ba,Rr=q?Js:je?.label??"",Ka=Xt&&u?qn(Xt,u):null,jr=(t,n)=>n&&Z?`${t} · ${n}`:t,Er=je?je.variantOf??je.label:"",Ma=(()=>{const t=Tt&&kt?kt.label:null;return t?Z?[jr(Er,t)]:[je.label,t]:[je?.label??""]})(),hs=jr(oe?.name??"",yt?Se?.label:null),On=At&&(!q||M.length>0)?q?[Js,...M]:[hs,...Ma,...M]:[],Vr=Re&&oe?[oe.name,"SEO",...Ms]:[],Tr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Ar=Qt&&oe?[oe.name,Tr]:Lt&&oe&&je?[hs,Er,Tr]:[],zn=Ar.length>0?Ar:Vr.length>0?Vr:ft?On.length>0?On:[Rr]:On.length>0?On:[hs],Nr=ps&&!Tt&&!je?.isHidden&&!!y,Da=ft||!q&&yt&&!!Se||Nr,Fa=ps&&!Tt&&!q&&M.length===0&&!!je&&Do(je)&&!!y,Ia=Z&&At&&!Lt&&Tt&&M.length===0&&!!kt,Cr=Z&&M.length>0?uo(M[M.length-1]):null,La=M.length>1?uo(M[M.length-2]):null,Pr=ft?Rr:At?je?.label??"":oe?.name??"",Oa=Qt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):Re?c("sectionsEditor.panelSections.seo"):Cr??Pr,Br=Lt?je?.variantOf??je?.label??"":Qt||Re?oe?.name??"":Cr?La??Pr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?oe?.name??"":oe?.path??"",gs=!Qt&&!Lt&&!Re&&!At&&!ft,za=!Z&&!Re&&!q&&Tt&&M.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=yc(t.sections,B,u,v);if(!n)return;const{sections:s,newVariantIndex:o}=n;L.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{fe(o),I(null),A(null),W(null),T([]),se(null),ee(null)},onError:L.reportError})},$n=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const o=d[y],a=o.sections;if(!a||typeof a!="object"||Array.isArray(a))return;const i=a;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=Sc(i,l),j={...d,[y]:{...o,sections:f}};L.mutate({blockKey:y,data:j[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const R of h)await qt(R,j)})()},onError:L.reportError})},Kr=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),fe(s);const o=Yn(pe.map(a=>({rule:a.rule})),t,n);is(o,s),$n(a=>Yn(a,t,n))},Mr=t=>{const n=pe[t]?.rule,s=Dt(n,d??{},u??void 0);$n(o=>o.length<=1?null:(o.splice(t,1),o),()=>{pe.length-1===1?fe(0):t<te?fe(te-1):t===te&&fe(Math.max(0,t-1)),I(null),A(null),W(null),T([]),se(null),ee(null)},s)},$a=()=>{const t=pe.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!Ri(n.rule)).map(({variant:n})=>Dt(n.rule,d??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=zi({variants:n}),o=n[s];return o?[{...o,rule:$i(u)}]:null},()=>{fe(0),I(null),A(null),W(null),T([]),se(null),ee(null),Vn(!1)},t)},Dr=t=>{let n=t+1;$n(s=>(n=eo(s,t,v),xc(s,t,v)),()=>{fe(n),I(null),A(null),W(null),T([]),se(null),ee(null)})},Wa=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,o=re.current.decofile;if(!s)return;const a=o[s],i=a.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],j=f[t];if(!j?.rule||typeof j.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=j.rule,R=n.trim();en(!0);try{if(!R){if(!Jt(h,o,u)){D(null);return}const Q=h.__resolveType??"";f[t]={...j,rule:Ts(h,o,u)};const be={...o,[s]:{...a,sections:{...l,variants:f}}};await L.mutateAsync({blockKey:s,data:be[s]}),await qt(Q,be),D(null),k?.();return}const E=As(h,o,u);if(!E){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await L.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,R)}),D(null),k?.();return}const K=Jn(R),z=Qn(K,o,u);if(z){H.error(z);return}const ne=Ft(E.resolveType,E.data,R);let J=null,Ne=!1;try{const Q=await L.mutateAsync({blockKey:K,data:ne,create:!0});Ne=Un(Q),J=Ne?null:K,f[t]={...j,rule:cn(K)},await L.mutateAsync({blockKey:s,data:{...a,sections:{...l,variants:f}}}),J=null}catch(Q){throw J&&await Pn.mutateAsync({blockKey:J}).catch(()=>{}),Q}D(null),Ne||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:R})),k?.()}catch(E){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(E))})}finally{en(!1)}},Ha=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:j}=re.current;if(s===null||!l)return;const h=o[s],R=a[s];if(!h||!R?.isMultivariate)return;const E=pt(h,R);if(!E)return;const K=E.variants??[],z=K[t];if(!z?.rule||typeof z.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,J=n.trim();en(!0);const Ne=async Q=>{const be={...E,variants:Q},Ie=[...o];Ie[s]=Bt(h,R,be);const he=ln(i,l,Ie,j,f);return await L.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!J){if(!Jt(ne,i,u)){O(null);return}const Xe=ne.__resolveType??"",Nt=[...K];Nt[t]={...z,rule:Ts(ne,i,u)};const Ct=await Ne(Nt);await qt(Xe,Ct),O(null),k?.();return}const Q=As(ne,i,u);if(!Q){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Q.blockKey){await L.mutateAsync({blockKey:Q.blockKey,data:Ft(Q.resolveType,Q.data,J)}),O(null),k?.();return}const be=Jn(J),Ie=Qn(be,i,u);if(Ie){H.error(Ie);return}const he=Ft(Q.resolveType,Q.data,J);let ue=null,Ge=!1;try{const Xe=await L.mutateAsync({blockKey:be,data:he,create:!0});Ge=Un(Xe),ue=Ge?null:be;const Nt=[...K];Nt[t]={...z,rule:cn(be)},await Ne(Nt),ue=null}catch(Xe){throw ue&&await Pn.mutateAsync({blockKey:ue}).catch(()=>{}),Xe}O(null),Ge||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Q){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(Q))})}finally{en(!1)}},Fr=async(t,n,s)=>{A(s);try{await L.mutateAsync({blockKey:t,data:s})}catch(o){throw A(a=>a===s?n:a),o}},qa={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,j=async R=>{const E={...t,variants:R};return await Fr(o,t,E),{...a,[o]:E}},h=Dc(f,s,a,u);if(h.kind!=="noop"){if(h.kind==="error"){H.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 K=[...i];K[n]={...l,rule:h.inlinedRule};const z=await j(K);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await L.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let R=null,E=!1;try{const K=await L.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Un(K),R=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await j(z),R=null}catch(K){throw R&&await Pn.mutateAsync({blockKey:R}).catch(()=>{}),K}E||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(R){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Mt(R))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Dt(l.rule,a,u);i[n]={...l,rule:cn(s)};const j={...t,variants:i},h={...a,[o]:j};try{await Fr(o,t,j),f&&f!==s&&await qt(f,h),k?.()}catch(R){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Mt(R))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;let i=null;!await In(s,a,f=>{const j=Array.isArray(t.variants)?[...t.variants]:[],h=j[n];return h?(j[n]={...h,rule:f},i={...t,variants:j},{blockKey:o,data:i}):null})||!i||(A(i),k?.())}},Ir=()=>{Wt(),v&&$t(null,-1,0)},Lr=t=>{dn(t),ds({inner:t})},Or=t=>{An(t),ds({raw:t})},zr=()=>{dn(null),Ot([])},$r=()=>Yt(t=>t+1),Wr=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1),ge?.()},Ga=()=>{Vn(!1),Tn(!1),I(null),un(!0)},Ua=()=>{Re&&Wr(),I(null),Vn(!0)},Ja=()=>Tn(!0),vs=t=>{if(Qt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&I(null);return}if(Re){if(t===0){Wr();return}if(t===1){Ot([]),Yt(s=>s+1);return}Ot(Ms.slice(0,t-1)),Yt(s=>s+1);return}if(q){T(M.slice(0,t)),$(s=>s+1);return}if(t===0){Ir();return}if(t===1){T([]),$(s=>s+1);return}const n=!Z&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(M.slice(0,t-1-n))},ys=zn.length>1?r.jsx("button",{type:"button",onClick:()=>vs(vl(zn.length,{isMultivariateSectionTop:za})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(Ji,{className:"size-4"})}):null,Qa=ft||At||Re?Da&&r.jsxs("div",{className:le("border-b px-3 py-2.5",ft&&"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:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Ir,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:le("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",dl),children:[r.jsx(ul,{rule:Rs(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Xn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Nr&&r.jsx(Gn,{onClick:()=>Sn()})]}),ft&&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(fo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:cr,variant:"header"})}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(co,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Gn,{onClick:bn})]}),Ya=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(mo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Kr,onRename:D,onDuplicate:Dr,onDelete:Mr,onAdd:bn}),yt&&Y!==null&&r.jsx(po,{className:"mt-3",children:r.jsx("div",{className:le("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:vr,onSelectGlobal:xr,named:ms(Se?.rule,br),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:hr,formValue:Ke,onChange:yr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Hr=r.jsxs(r.Fragment,{children:[r.jsx(fl,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:dr,onRename:O,onDuplicate:Ea,onDelete:ja,onRemoveAll:fr,onReorder:Va,onAdd:()=>Sn()}),r.jsx(po,{children:r.jsx(ks,{currentRt:Xt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:Aa,onSelectGlobal:Pa,named:ms(kt?.rule,Ca),namedRow:ws(kt?.rule,Ht),rule:kt?.rule,schema:Ka,formValue:qo,onChange:Na,formKey:`${m??"none"}:${Ln}:${Xt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),qr=r.jsx("div",{className:le(Z?"px-2":"p-2 pt-3"),children:r.jsx(Kc,{listKey:`${y??""}-${te}`,rawSections:B,sections:ce,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{va(t),Je?.(t)},onReorder:ya,onDelete:Sa,onDuplicate:ba,onMakeReusable:Ve,onToggleHidden:xa,onToggleLazy:rt?_a:void 0,onAddVariant:Sn,onDetach:ka,onAddSection:()=>He(!0),canAddSection:pr})}),Xa=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&oe&&r.jsx(fo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:cr}),nn&&y?r.jsx(To,{rawSeo:Kn,innerSeo:as,defaultResolveType:Ys,seoTypesLoading:v&&!u,seoSchema:Xs,activeResolveType:Mn,seoTypeOptions:Qs,formResetKey:Ds,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Or,onInnerChange:Lr,onClearForm:zr,onBumpFormKey:$r,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Za=r.jsx(an,{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:nn&&y?r.jsx(To,{rawSeo:Kn,innerSeo:as,defaultResolveType:Ys,seoTypesLoading:v&&!u,seoSchema:Xs,activeResolveType:Mn,seoTypeOptions:Qs,formResetKey:Ds,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Or,onInnerChange:Lr,onClearForm:zr,onBumpFormKey:$r,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),ei=r.jsxs(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(mo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Kr,onRename:D,onDuplicate:Dr,onDelete:Mr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:le("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Wo(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":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(Qi,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Ui,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:le("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Dt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:vr,onSelectGlobal:xr,named:ms(Se?.rule,br),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:hr,formValue:Ke,onChange:yr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),qr]},"editor-section-list");return r.jsx(lc,{value:v,children:r.jsx(ml,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!Z&&ys&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ys}),(Z||zn.length>1)&&r.jsx(Hi,{crumbs:zn,onSelect:vs,onSelectRoot:()=>{fn.flush(),Ue?Ue():vs(0)}}),r.jsx("div",{className:"shrink-0",children:Z?r.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[Z&&ys,ft&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Xn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{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:Oa}),Br&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Br})]}),gs&&yt&&Se&&r.jsx(ho,{variants:pe,activeIndex:te,onSelect:cs,onManage:Ua,onRemoveAll:$a}),Ia&&r.jsx(ho,{variants:Vt,activeIndex:Ln,onSelect:dr,onManage:Ja,onRemoveAll:fr}),gs&&!yt&&r.jsx(Gn,{onClick:bn}),Fa&&r.jsx(Gn,{onClick:()=>Sn()}),r.jsx(pl,{}),gs&&r.jsxs(r.Fragment,{children:[r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Ga,children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(Rt,{children:[r.jsx(jt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(co,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Qa}),ut&&r.jsx(pi,{open:!0,fields:hi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Hs??null,authorPending:Hs===void 0,fieldsAsLabeled:Ws!==null,fresh:ut.fresh,keepTyping:v,onChoose:(t,n)=>ga({...ut.choices,[t]:n}),onApply:ha},Lc(ut.formBase)),Lt?r.jsx(go,{onAdd:()=>Sn(),children:Hr},"editor-section-variants"):At?r.jsxs(an,{viewportRef:me,onBlur:sr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!Z&&Tt&&Vt.length>0&&M.length===0&&Hr,r.jsx(Ao,{value:Sr,children:r.jsx(vo,{value:q&&v?Be:null,children:r.jsx(yo,{activeSchema:Fn,formValue:Ze,formResetKey:Me,onFormChange:lr,onBreadcrumbChange:T,breadcrumbPath:M,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:ur,onVariantMatcherOp:q?qa:void 0})})})]},"editor-section-form"):q?r.jsx(an,{viewportRef:me,onBlur:sr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(Ao,{value:Sr,children:r.jsx(vo,{value:q&&v?Be:null,children:r.jsx(yo,{activeSchema:Fn,formValue:Ze,formResetKey:Me,onFormChange:lr,onBreadcrumbChange:T,breadcrumbPath:M,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:ur})})})},"editor-global-block"):Re?Z?r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Xa})},"editor-seo"):Za:Qt?r.jsx(go,{onAdd:bn,children:Ya},"editor-variants"):Z?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:qr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ns,{canAddSection:pr,onAddSection:()=>He(!0)})})]},"editor-section-list"):ei,r.jsx(hl,{open:ie!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:ie!==null?Jn(ce[ie]?.label??""):"",isPending:L.isPending,onSubmit:Ta}),ot&&r.jsx(tc,{open:Ae,onOpenChange:t=>{He(t),t||(jn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:Ra}),ht&&y&&d&&r.jsx(sc,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(So,{open:!0,initialName:Jt(pe[Te]?.rule,d??{},u??void 0)?_n(pe[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(Rs(pe[Te]?.rule,d??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Wa(Te,t)},onOpenChange:t=>{!t&&!Zt&&D(null)}}),tt!==null&&r.jsx(So,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(Rs(Vt[tt]?.rule,d??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Ha(tt,t)},onOpenChange:t=>{!t&&!Zt&&O(null)}})]})})})}export{Wf as SectionsEditor};
@@ -1 +1 @@
1
- import{r as d,c0 as rt,c1 as _e,j as c,c2 as st,c3 as be,c4 as k,c5 as lt,c6 as j,c7 as N,c8 as $,c9 as at,ca as Ee,cb as Re,cc as it,cd as ct,ce as dt,cf as ut,cg as pt,ch as ft,ci as mt,cj as ht,ck as vt,cl as gt,cm as xt,cn as St,c as ee,m as oe,aY as wt}from"./index-D9ty5Ie3.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-BzRhR-ob.js";import{t as je}from"./ChevronDown-nlBmBA6R.js";import{n as yt}from"./ChevronUp-8WNgfyfx.js";var It=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[_t,G]=ne(J),[Nt,Pt]=ne(J),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:J}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:J}),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=J;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 Q="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(Q,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=Q;var A=10,[He,Y]=ne(Q),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(Q,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(Q,t),s=Y(Q,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(Q,{}),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(Qe,{...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",Je=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(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Je.displayName=ye;var Qe=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,Jt=Ue,Qt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Je;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($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(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 fo(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 mo(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(Jt,{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 ho(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(Qt,{"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{uo as S,po as a,fo as b,ho as c,mo as d};
1
+ import{r as d,c0 as rt,c1 as _e,j as c,c2 as st,c3 as be,c4 as k,c5 as lt,c6 as j,c7 as N,c8 as $,c9 as at,ca as Ee,cb as Re,cc as it,cd as ct,ce as dt,cf as ut,cg as pt,ch as ft,ci as mt,cj as ht,ck as vt,cl as gt,cm as xt,cn as St,c as ee,m as oe,aY as wt}from"./index-Dws-zNMb.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-B1J4AkqW.js";import{t as je}from"./ChevronDown-DL6BIz5f.js";import{n as yt}from"./ChevronUp-raY54gH6.js";var It=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[_t,G]=ne(J),[Nt,Pt]=ne(J),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:J}),[U,q]=_e({prop:s,defaultProp:a,onChange:i,caller:J}),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=J;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 Q="SelectContent",Ve=d.forwardRef((r,e)=>{const t=G(Q,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=Q;var A=10,[He,Y]=ne(Q),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(Q,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(Q,t),s=Y(Q,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(Q,{}),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(Qe,{...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",Je=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(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:i}=t;a&&i&&(a.scrollTop=a.scrollTop+i.offsetHeight)}}):null});Je.displayName=ye;var Qe=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,Jt=Ue,Qt=Ge,Pe=Ye,eo=Xe,to=Ze,oo=Je;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($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(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 fo(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 mo(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(Jt,{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 ho(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(Qt,{"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{uo as S,po as a,fo as b,ho as c,mo as d};
@@ -1 +1 @@
1
- import{c as $,b as A,r as R,m as G,j as s,B as H,s as J,x as K,v as Q,D as U}from"./index-D9ty5Ie3.js";import{d as V,b as W,a as X,D as Y}from"./drawer-CPRS7vw4.js";import{u as Z}from"./use-mobile-B8Aa4Xlk.js";import{d as ee}from"./chat-context-BIbY01K8.js";import{S as F,a as se,M as le,c as te}from"./index-BRun9Rm8.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,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]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.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=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==b||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:b,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,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=s.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=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=s.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=s.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=s.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=s.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=s.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=s.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=s.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 l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{me as M};
1
+ import{c as $,b as A,r as R,m as G,j as s,B as H,s as J,x as K,v as Q,D as U}from"./index-Dws-zNMb.js";import{d as V,b as W,a as X,D as Y}from"./drawer-BNjWjF9M.js";import{u as Z}from"./use-mobile-BKxwZ6y7.js";import{d as ee}from"./chat-context-hCQ1mfTr.js";import{S as F,a as se,M as le,c as te}from"./index-BuJZ15yz.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,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]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.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=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==b||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:b,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,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=s.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=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=s.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=s.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=s.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=s.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=s.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=s.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=s.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 l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{me as M};