decocms 4.524.2 → 4.525.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 (408) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-C-rHC-K0.js → ActiveShapeUtils-CfDf2bdI.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-CIClX1OX.js → AlertCircle-X-2ynYTr.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CFefRI3l.js → AreaChart-Co4tgm2e.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-hUis4zpK.js → ArrowLeft-D5rLbzEv.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DvNrLRdk.js → ArrowUp-D5ujBFbU.js} +1 -1
  6. package/dist/client/assets/{BarChart-BD4Z4ti7.js → BarChart-s2InKCwb.js} +1 -1
  7. package/dist/client/assets/{Building02-DyaG8VRs.js → Building02-CmwS_4Zd.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-Cm6m5mMn.js → CartesianChart-CV_17khx.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-B2xwR0Vg.js → CategoricalChart-BXV8ybtn.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-IjQMURt4.js → CheckCircle-K7QKF0ga.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-DSrF7Kt-.js → ChevronSelectorVertical-8Zglhuwj.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-DZpXGp6s.js → ChevronUp-bhjMH6tk.js} +1 -1
  13. package/dist/client/assets/{Copy01-DelcC4NE.js → Copy01-BQVKjs--.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-cYImG8Bl.js → CreditCard01-DLuzN9Da.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-Cd1ayiT8.js → DotsVertical-D0yivq6N.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-3Qb2LA4z.js → ErrorBarContext-D7k2zl1o.js} +1 -1
  17. package/dist/client/assets/{Globe04-C3AUDQA6.js → Globe04-Do87jSl8.js} +1 -1
  18. package/dist/client/assets/{Image01-BmkGkBEJ.js → Image01-Ca2zoOmL.js} +1 -1
  19. package/dist/client/assets/{Key01-BJu0utQ9.js → Key01-B22TaZal.js} +1 -1
  20. package/dist/client/assets/{Link01-CpEeBnOB.js → Link01-CKgU9XrQ.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-BbJzP52K.js → LinkBroken01-DbRdGmca.js} +1 -1
  22. package/dist/client/assets/{Minus-Beni9ibl.js → Minus-DbFMOQp2.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DIpgHRZ3.js → Monitor01-CfX8nvtP.js} +1 -1
  24. package/dist/client/assets/{Play-CeJs-Z9F.js → Play-gY_w5wGM.js} +1 -1
  25. package/dist/client/assets/{Plus-Dp5dZDoY.js → Plus-cZACl5Bj.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-BlgL76sy.js → ReferenceLine-qGRCuWbQ.js} +1 -1
  27. package/dist/client/assets/{SearchMd-DkOimU4h.js → SearchMd-B3lyjcge.js} +1 -1
  28. package/dist/client/assets/{Sector-DYInMAbx.js → Sector-tGFgbjWQ.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-CrAecsFE.js → ShoppingBag01-CIHcZyoe.js} +1 -1
  30. package/dist/client/assets/{Sun-Dm3m8VPj.js → Sun-BQHZ8KXH.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-BvXNAenZ.js → SwitchHorizontal01-C4b3q3_P.js} +1 -1
  32. package/dist/client/assets/{Tool01-CyfGI7T6.js → Tool01-DZBBNle2.js} +1 -1
  33. package/dist/client/assets/{Trash01-BneWuuYf.js → Trash01-DAL2eWYn.js} +1 -1
  34. package/dist/client/assets/{Upload01-CNkWpiz7.js → Upload01-3A7TgOQk.js} +1 -1
  35. package/dist/client/assets/{UserSquare-BWlOHIw0.js → UserSquare-C3P5-DPf.js} +1 -1
  36. package/dist/client/assets/{Users01-ugdEQXdG.js → Users01-CbJgTvJT.js} +1 -1
  37. package/dist/client/assets/{XClose-BHn8yO7p.js → XClose-B7VCNh_p.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-Csm0orCM.js → ZoomOut-I9ktV8DJ.js} +1 -1
  39. package/dist/client/assets/{access-gate-AGX410gm.js → access-gate-aP3HDD5b.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-7qj2kjMr.js → add-connection-dialog-Bk02feSt.js} +1 -1
  41. package/dist/client/assets/agent-analytics-DQUAv2rU.js +1 -0
  42. package/dist/client/assets/agent-app-CC8H2_RQ.js +1 -0
  43. package/dist/client/assets/{agent-assets-r6VBDeE0.js → agent-assets-CNkZSOPp.js} +1 -1
  44. package/dist/client/assets/{agent-automation-DM7_Ee5Y.js → agent-automation-C0Yq9OiE.js} +1 -1
  45. package/dist/client/assets/{agent-automations-BUj7_vKE.js → agent-automations-CL8PVnUy.js} +1 -1
  46. package/dist/client/assets/agent-calendar-BMldRrmG.js +1 -0
  47. package/dist/client/assets/{agent-connect-sources-IL9oYYUF.js → agent-connect-sources-Bcy9EWkz.js} +1 -1
  48. package/dist/client/assets/agent-deck-KP9i8rlb.js +1 -0
  49. package/dist/client/assets/{agent-e2e-CAHEpLI3.js → agent-e2e-CqVIclm2.js} +1 -1
  50. package/dist/client/assets/agent-experiments-CVGDLUGS.js +1 -0
  51. package/dist/client/assets/{agent-file-CtLzmiB2.js → agent-file-BmTf9y-D.js} +1 -1
  52. package/dist/client/assets/{agent-hosting-Bu4SIylb.js → agent-hosting-CLZVBk4b.js} +1 -1
  53. package/dist/client/assets/{agent-icon-BXl9rcx1.js → agent-icon-D9Dw0iKh.js} +1 -1
  54. package/dist/client/assets/agent-library-B9XhNA3y.js +1 -0
  55. package/dist/client/assets/agent-library-file-DMWQXc7h.js +1 -0
  56. package/dist/client/assets/agent-monitor-D-nTcMhx.js +1 -0
  57. package/dist/client/assets/{agent-overview-DT8rD_2N.js → agent-overview-DjXD2Qs4.js} +1 -1
  58. package/dist/client/assets/{agent-releases-lt59FkfL.js → agent-releases-CufoFdaF.js} +1 -1
  59. package/dist/client/assets/agent-settings-B-Q2xNFl.js +1 -0
  60. package/dist/client/assets/{agent-site-editor-DWKoTev5.js → agent-site-editor-D37kRaBn.js} +1 -1
  61. package/dist/client/assets/agent-site-editor-code-DiDoS2Hl.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-BL8iQpvi.js +1 -0
  63. package/dist/client/assets/agent-site-editor-preview-BnzfkMpU.js +1 -0
  64. package/dist/client/assets/agent-view-BWlsY4B7.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-C0-5YLfj.js → agent-view-guard-Ckrg4QdJ.js} +1 -1
  66. package/dist/client/assets/{agents-list-BvjBZO8s.js → agents-list-CC5MwUx0.js} +1 -1
  67. package/dist/client/assets/{ai-providers-COtiWMIM.js → ai-providers-Cjz6Am1T.js} +1 -1
  68. package/dist/client/assets/{alert-BxwQ9GWi.js → alert-CzMP0em5.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-CC5Y9IMF.js → analytics-sections-DdSu0p8k.js} +1 -1
  70. package/dist/client/assets/analytics-tab-akNEioSW.js +2 -0
  71. package/dist/client/assets/{api-keys-MQsmca-c.js → api-keys-DNOcnvbb.js} +1 -1
  72. package/dist/client/assets/api-keys-VKfbZR3P.js +1 -0
  73. package/dist/client/assets/{app-editor-C-CTy5jL.js → app-editor-BX-caEcq.js} +1 -1
  74. package/dist/client/assets/{asset-utils-CDMjNYFJ.js → asset-utils-KcjmG-m6.js} +1 -1
  75. package/dist/client/assets/{auth-BkqoCGcx.js → auth-BZRl-fvJ.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-D_N41KBC.js → auth-catchall-Cixh_xVS.js} +1 -1
  77. package/dist/client/assets/{auth-entry-BV7CL8vh.js → auth-entry-CDgI8GSv.js} +1 -1
  78. package/dist/client/assets/{auth-split-layout-DzZGmD-Q.js → auth-split-layout-BpY6CA0U.js} +1 -1
  79. package/dist/client/assets/{authenticate-and-persist-oauth-BD9brsY_.js → authenticate-and-persist-oauth-DSVaoY9Y.js} +1 -1
  80. package/dist/client/assets/{automation-list-row-BjMjCaBD.js → automation-list-row-BcZ7qNH8.js} +1 -1
  81. package/dist/client/assets/{automation-runs-DCUB5KLk.js → automation-runs-B9CF82zY.js} +1 -1
  82. package/dist/client/assets/{automations-1qHtjGaW.js → automations-CkWWycIp.js} +1 -1
  83. package/dist/client/assets/{autosend-1U_b-i1h.js → autosend-Lp9Ownww.js} +1 -1
  84. package/dist/client/assets/{badge-DESNookz.js → badge-CXzZRklK.js} +1 -1
  85. package/dist/client/assets/{block-document-CcGRU5CL.js → block-document-CITCS8My.js} +1 -1
  86. package/dist/client/assets/blocks-preview-workspace-context-C1VREoKK.js +1 -0
  87. package/dist/client/assets/{blocks-tab-states-Bji5rJXk.js → blocks-tab-states-3dDtGXkD.js} +1 -1
  88. package/dist/client/assets/{blog-schema-BNIKCmEY.js → blog-schema-D8JT-pfW.js} +1 -1
  89. package/dist/client/assets/{buckets-DnnlOaFn.js → buckets-DSY_lUaA.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-CiV-KlOc.js → build-improve-prompt-doc-BuwT-s1U.js} +1 -1
  91. package/dist/client/assets/{calendar-sUXRafM_.js → calendar-H7tEy9sl.js} +1 -1
  92. package/dist/client/assets/{campaigns-view-3-zGJglb.js → campaigns-view-DqoAS-BN.js} +1 -1
  93. package/dist/client/assets/{capability-load-error--G3e97qI.js → capability-load-error-99aOEzWN.js} +1 -1
  94. package/dist/client/assets/{category-editor-CS1KKmTs.js → category-editor-Oh8gppwu.js} +1 -1
  95. package/dist/client/assets/{cdn-tab-CrOE0j6D.js → cdn-tab-BnhMzxv9.js} +1 -1
  96. package/dist/client/assets/{chart-CaDJ4F39.js → chart-Bt_svDxj.js} +1 -1
  97. package/dist/client/assets/chat-context-B-EalrGD.js +39 -0
  98. package/dist/client/assets/{chat-draft-XY_NNpgA.js → chat-draft-D3axWnPl.js} +1 -1
  99. package/dist/client/assets/{checkbox-D-LzvMyz.js → checkbox-B1NhUIDG.js} +1 -1
  100. package/dist/client/assets/{choose-editor-CRTIidNs.js → choose-editor-D1BKVjbI.js} +1 -1
  101. package/dist/client/assets/{cli-auth-success-M-vNesnJ.js → cli-auth-success-Zog61hSo.js} +1 -1
  102. package/dist/client/assets/{client-icons-DJfzDzX4.js → client-icons-CCQzD3FK.js} +1 -1
  103. package/dist/client/assets/cms-settings-editor-BIjSx0Nc.js +1 -0
  104. package/dist/client/assets/{collapsible-B9h9LvCC.js → collapsible-IxpT7xWi.js} +1 -1
  105. package/dist/client/assets/{collection-detail-DB5YnYwu.js → collection-detail-6FWEOpRT.js} +1 -1
  106. package/dist/client/assets/{collection-display-button-BZ7DzDHo.js → collection-display-button-CKQHTJrg.js} +1 -1
  107. package/dist/client/assets/{collection-search-D_HANk-F.js → collection-search-4jrHPH5z.js} +1 -1
  108. package/dist/client/assets/{collection-table-wrapper-BH6lYVpk.js → collection-table-wrapper-Cp_spvZp.js} +1 -1
  109. package/dist/client/assets/{collection-tabs-H7yEtuRH.js → collection-tabs-BGV0tagg.js} +1 -1
  110. package/dist/client/assets/{column-rules-CNwPb3ah.js → column-rules-D1g0VR5d.js} +1 -1
  111. package/dist/client/assets/{combobox-BfNsB6Ea.js → combobox-D60tpxva.js} +1 -1
  112. package/dist/client/assets/{command-DoejxN8Q.js → command-DHvjfMO5.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-DQptjkfL.js → companion-mcps-section-TI-TBX0N.js} +1 -1
  114. package/dist/client/assets/{config-CjsHeG1l.js → config-Tv6nMoGu.js} +1 -1
  115. package/dist/client/assets/{connect-KGH4OYue.js → connect-UTvCbjSn.js} +1 -1
  116. package/dist/client/assets/{connect-layout-C8XNo1vh.js → connect-layout-tlVOroiR.js} +1 -1
  117. package/dist/client/assets/{connect-source-dialog-CKPrWV3W.js → connect-source-dialog-B3OyvOFa.js} +1 -1
  118. package/dist/client/assets/{connection-DgmraTnv.js → connection-DdGNUc6-.js} +1 -1
  119. package/dist/client/assets/{connection-card-nzYl3iaE.js → connection-card-B5O4Wsbz.js} +1 -1
  120. package/dist/client/assets/{connection-detail-thguseWo.js → connection-detail-CmtLTaHA.js} +1 -1
  121. package/dist/client/assets/{connection-form-helpers-DQAPN_By.js → connection-form-helpers-DsmTilVU.js} +1 -1
  122. package/dist/client/assets/{connections-DGmAEet-.js → connections-DqzZAO_3.js} +1 -1
  123. package/dist/client/assets/{content-tab-BskMZIA-.js → content-tab-CQYmoOq9.js} +3 -3
  124. package/dist/client/assets/{context-BTZ4zLZ6.js → context-CfqV1IZs.js} +1 -1
  125. package/dist/client/assets/{context-menu-DXOWR6Jg.js → context-menu-BKWMPe3O.js} +1 -1
  126. package/dist/client/assets/{context-shell-C9dd2zeB.js → context-shell-DSYPtBTI.js} +3 -3
  127. package/dist/client/assets/{core.esm-kr0nDMAf.js → core.esm-9HSn5uPZ.js} +1 -1
  128. package/dist/client/assets/{create-organization-dialog-VXkZbmzL.js → create-organization-dialog-D10b15S1.js} +1 -1
  129. package/dist/client/assets/{daily-pulse-WpcSkDI1.js → daily-pulse-DgtJGCVE.js} +1 -1
  130. package/dist/client/assets/{discover-BwWAcy7q.js → discover-qjJnqmId.js} +1 -1
  131. package/dist/client/assets/{domain-settings-B3KwV4Bi.js → domain-settings-TTJZbGRJ.js} +1 -1
  132. package/dist/client/assets/{drawer-BxmRq7z0.js → drawer-C_HOpx0y.js} +1 -1
  133. package/dist/client/assets/{editor-vxR6fGAu.js → editor-BdrieXEx.js} +1 -1
  134. package/dist/client/assets/{editor-classes-C1mRh06j.js → editor-classes-ByAE0Rcb.js} +1 -1
  135. package/dist/client/assets/{empty-state-C0q6FDCT.js → empty-state-C7Ay2sll.js} +1 -1
  136. package/dist/client/assets/{empty-state-BXpVXa8p.js → empty-state-Cmr3S21S.js} +1 -1
  137. package/dist/client/assets/{experiments-tab-vC9IxL9H.js → experiments-tab-C2tJOVTj.js} +1 -1
  138. package/dist/client/assets/{experiments-tab-choice-CJW0rlLk.js → experiments-tab-choice-zawYDgsX.js} +1 -1
  139. package/dist/client/assets/{extract-connection-data-DyihSSH6.js → extract-connection-data-zKnn6Dof.js} +1 -1
  140. package/dist/client/assets/{feature-gate-B2DL7P_r.js → feature-gate-C6VahgnU.js} +1 -1
  141. package/dist/client/assets/{feature-paywall-CaUW3vBu.js → feature-paywall-BEbplQ--.js} +1 -1
  142. package/dist/client/assets/{file-explorer-B6YWvV4f.js → file-explorer-DLwjIufd.js} +1 -1
  143. package/dist/client/assets/{file-preview-p8MVe0Co.js → file-preview-COfbxVXI.js} +1 -1
  144. package/dist/client/assets/{file-share-button-BwVAEVZB.js → file-share-button-BtEY0eqQ.js} +1 -1
  145. package/dist/client/assets/{file-type-icon-T5-JgFJO.js → file-type-icon-DBRx3EE8.js} +1 -1
  146. package/dist/client/assets/{folder-icon-U3eZ3MHL.js → folder-icon-ATvneswn.js} +1 -1
  147. package/dist/client/assets/{form-BKxpLzV1.js → form-sdJe6ZVI.js} +1 -1
  148. package/dist/client/assets/{general-twaLFZ_x.js → general-C475sARZ.js} +1 -1
  149. package/dist/client/assets/{held-block-view-DF-dsPP4.js → held-block-view-CMM-oPyn.js} +3 -3
  150. package/dist/client/assets/{home-B70oGoSa.js → home-y4mIYyne.js} +1 -1
  151. package/dist/client/assets/{icon-button-BpGFmmxF.js → icon-button-CdFqvwVW.js} +1 -1
  152. package/dist/client/assets/{index-BHWlfC8b.js → index-5Rxgh8df.js} +1 -1
  153. package/dist/client/assets/index-BgjLAl1E.css +1 -0
  154. package/dist/client/assets/{index-CbIYCvQg.js → index-C-AP-JX2.js} +1 -1
  155. package/dist/client/assets/{index-C91ph34T.js → index-CJkX47-N.js} +1 -1
  156. package/dist/client/assets/{index-C_H0V1sq.js → index-CYjxbJyH.js} +1 -1
  157. package/dist/client/assets/{index-BGCeOWuH.js → index-CZa3eyGb.js} +48 -48
  158. package/dist/client/assets/{index-FG3t9V84.js → index-Cf0lbIa5.js} +1 -1
  159. package/dist/client/assets/{index-B5KgRDmR.js → index-CrwXZTne.js} +1 -1
  160. package/dist/client/assets/{index-B54Dwq_E.js → index-D47oPuzS.js} +1 -1
  161. package/dist/client/assets/{index-CSsLL5lB.js → index-D5GK2hYV.js} +1 -1
  162. package/dist/client/assets/index-DGh8fN-O.js +1 -0
  163. package/dist/client/assets/{index-jBUTr_mZ.js → index-DKEkcTAe.js} +1 -1
  164. package/dist/client/assets/{index-DEhotlUt.js → index-DXZflUD0.js} +1 -1
  165. package/dist/client/assets/{index-Y7xr7TpK.js → index-DZBOWYUC.js} +1 -1
  166. package/dist/client/assets/{index-vWFZdxRo.js → index-Dr2piS20.js} +1 -1
  167. package/dist/client/assets/{index-C5dWtjQZ.js → index-ZYyznNcg.js} +1 -1
  168. package/dist/client/assets/{index-redirect-BrPjqRgi.js → index-redirect-CmV_7D3q.js} +1 -1
  169. package/dist/client/assets/{infiniteQueryObserver-DdJGfIBw.js → infiniteQueryObserver-Bj1XK-s-.js} +1 -1
  170. package/dist/client/assets/{infra-billing-DA3iH8RT.js → infra-billing-AjJxcLpN.js} +1 -1
  171. package/dist/client/assets/input-B305reVY.js +17 -0
  172. package/dist/client/assets/{input-DdaB0aDZ.js → input-UflMOkm2.js} +1 -1
  173. package/dist/client/assets/{integration-icon-IfDXGweg.js → integration-icon-Dg-0enaK.js} +1 -1
  174. package/dist/client/assets/{jira-icon-Btvsno6j.js → jira-icon-LHSQ0THI.js} +1 -1
  175. package/dist/client/assets/{label-_maV4eWQ.js → label-D_y7huPi.js} +1 -1
  176. package/dist/client/assets/{layout-BnRLK8Je.js → layout-BP2vQ1s7.js} +1 -1
  177. package/dist/client/assets/{legacy-agents-deep-EQC0E9us.js → legacy-agents-deep-DCLl15SR.js} +1 -1
  178. package/dist/client/assets/{legacy-main-redirect-C8Z33lV9.js → legacy-main-redirect-B4J3fSRE.js} +1 -1
  179. package/dist/client/assets/library-Bns22mAf.js +1 -0
  180. package/dist/client/assets/{login-CRL4Hxp0.js → login-C_21RFJH.js} +1 -1
  181. package/dist/client/assets/{markdown-Pxz-NCAq.js → markdown-DRSNNxww.js} +1 -1
  182. package/dist/client/assets/{mcp-app-renderer-C-WjAbV3.js → mcp-app-renderer-kU5GlIYH.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-UPAY9qQh.js → mcp-oauth-C4-kW2Qs.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-ZXLBTZQF.js → mcp-oauth-hGnP00_b.js} +1 -1
  185. package/dist/client/assets/{members-wnvPkZUo.js → members-C6nd5H4U.js} +1 -1
  186. package/dist/client/assets/{memory-5e8aSOvx.js → memory-CuqUqYaX.js} +1 -1
  187. package/dist/client/assets/{mini-report-page-BJU2AtSk.js → mini-report-page-4eFJ6i6E.js} +1 -1
  188. package/dist/client/assets/{mock-board-KL7JXnQ3.js → mock-board-DckuZkOJ.js} +3 -3
  189. package/dist/client/assets/{monaco-editor-CEz6AH84.js → monaco-editor-hax50RkV.js} +1 -1
  190. package/dist/client/assets/{monitoring-CSgf9qta.js → monitoring-B6KSdVsK.js} +1 -1
  191. package/dist/client/assets/{monitoring-stats-row-CQA6lBFw.js → monitoring-stats-row-DA53VNYY.js} +1 -1
  192. package/dist/client/assets/{multi-select-BRkampvt.js → multi-select-BXPlQfny.js} +1 -1
  193. package/dist/client/assets/{mustache-D-9UMI1S.js → mustache-Bz1-fywO.js} +1 -1
  194. package/dist/client/assets/{named-rule-uses-5Sl1aIdP.js → named-rule-uses-5dqNKr-I.js} +1 -1
  195. package/dist/client/assets/{named-rule-view-ChwtdSTO.js → named-rule-view-CTYOj6rx.js} +1 -1
  196. package/dist/client/assets/{new-project-dialog-BZU_MI3Q.js → new-project-dialog-Dw5AGC0_.js} +1 -1
  197. package/dist/client/assets/{oauth-callback-CIbrOy6h.js → oauth-callback-CrMwtWWq.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-ai-provider-DEFfXzWj.js → oauth-callback-ai-provider-DVv7bJ0G.js} +1 -1
  199. package/dist/client/assets/{onboarding-BB5U3n3W.js → onboarding-dFcnQ43S.js} +1 -1
  200. package/dist/client/assets/{openai-conversation-CeRUtzJI.js → openai-conversation-BPBksfQq.js} +1 -1
  201. package/dist/client/assets/{optimistic-project-sidebar-views-BpMb4HEN.js → optimistic-project-sidebar-views-p5DZ1J0t.js} +1 -1
  202. package/dist/client/assets/{order-monitor-day-DUguCaIU.js → order-monitor-day-DKC4UhpG.js} +1 -1
  203. package/dist/client/assets/{organization-choice-HyxmQkdd.js → organization-choice-DgNX0px1.js} +1 -1
  204. package/dist/client/assets/{orgs-C96LReuI.js → orgs--Jgqg6Dn.js} +1 -1
  205. package/dist/client/assets/{page-seo-form-Dx0hMHSf.js → page-seo-form-Ce_NK10C.js} +1 -1
  206. package/dist/client/assets/{pair-DVCmCnBf.js → pair-DdbYjyQ3.js} +1 -1
  207. package/dist/client/assets/{parse-sections-BHOqhf01.js → parse-sections-oc95T4h7.js} +1 -1
  208. package/dist/client/assets/{plan-D4Ztu-Mv.js → plan-ZvtmjKe3.js} +1 -1
  209. package/dist/client/assets/{plan-ladder-BT3Oz8Ev.js → plan-ladder-EdUaionH.js} +1 -1
  210. package/dist/client/assets/{popover-SHWbH4i8.js → popover-BLArxJjU.js} +1 -1
  211. package/dist/client/assets/{post-calendar-WzBoQET7.js → post-calendar-CbC3_MoD.js} +1 -1
  212. package/dist/client/assets/{post-editor-CtDaen5o.js → post-editor-YM3sgG2e.js} +1 -1
  213. package/dist/client/assets/{preview-content-BhIMVcYB.js → preview-content-GXFA_X5E.js} +1 -1
  214. package/dist/client/assets/{preview-dialog-DoeqGaQU.js → preview-dialog-D26WaaIk.js} +1 -1
  215. package/dist/client/assets/{preview-panel-DMNxFjEG.js → preview-panel-B_p-C9Al.js} +1 -1
  216. package/dist/client/assets/{preview-tab-C2Feq6DP.js → preview-tab-Duwq60WH.js} +3 -3
  217. package/dist/client/assets/{product-picker-dialog-BF4qIVtr.js → product-picker-dialog-f1dTB5f1.js} +1 -1
  218. package/dist/client/assets/{profile-CA9XT1yH.js → profile-DLFUEAmv.js} +1 -1
  219. package/dist/client/assets/{project-app-view-DnVvuNnI.js → project-app-view-CnegYwol.js} +1 -1
  220. package/dist/client/assets/{project-apps-BfDjxodR.js → project-apps-BEnCDhRH.js} +1 -1
  221. package/dist/client/assets/{project-feed-q9sZKOfh.js → project-feed-f7HLjRe8.js} +1 -1
  222. package/dist/client/assets/{project-icon-CjQuZIIb.js → project-icon-PZVlAu2D.js} +1 -1
  223. package/dist/client/assets/project-reports-DwBCSB_E.js +1 -0
  224. package/dist/client/assets/project-tasks-DC6ktZiN.js +1 -0
  225. package/dist/client/assets/{projects-DvPJEsmw.js → projects-BoKvz5fr.js} +1 -1
  226. package/dist/client/assets/{projects-empty-state-CEDwkoTb.js → projects-empty-state-Cq326GR_.js} +1 -1
  227. package/dist/client/assets/{prompts-B3mSxUa6.js → prompts-DvtSj5pm.js} +1 -1
  228. package/dist/client/assets/record-editor-BKwj4lcG.js +1 -0
  229. package/dist/client/assets/{redirect-editor-DS-wqNcI.js → redirect-editor-BaZEnl8a.js} +1 -1
  230. package/dist/client/assets/{releases-api-BmEWQbgz.js → releases-api-BohVJQUi.js} +1 -1
  231. package/dist/client/assets/{reports-BrWasOQ1.js → reports--iZn8db0.js} +1 -1
  232. package/dist/client/assets/reports-B7Os682y.js +1 -0
  233. package/dist/client/assets/{reports-onboarding-DU-PrPll.js → reports-onboarding-Cz-2WWBR.js} +1 -1
  234. package/dist/client/assets/{reports-tab-ChwZOe5G.js → reports-tab-COgTSVf5.js} +2 -2
  235. package/dist/client/assets/{repositories-BcpDx93s.js → repositories-BPLjQabQ.js} +1 -1
  236. package/dist/client/assets/repositories-BzPPC0PO.js +1 -0
  237. package/dist/client/assets/{repository-binding-Meqp5p71.js → repository-binding-Kf_PGfSt.js} +1 -1
  238. package/dist/client/assets/{repository-import-picker-FH262XPV.js → repository-import-picker-DoXIwk7w.js} +1 -1
  239. package/dist/client/assets/{repository-picker-DCYyzOOP.js → repository-picker-Ck8gOK4_.js} +1 -1
  240. package/dist/client/assets/{require-capability-oXulJiLn.js → require-capability-9Oz2BfBS.js} +1 -1
  241. package/dist/client/assets/{required-auth-layout-tipFurup.js → required-auth-layout-Cex5NCBT.js} +1 -1
  242. package/dist/client/assets/{reset-password-3NrSj3Hp.js → reset-password-DetEygjt.js} +1 -1
  243. package/dist/client/assets/{resizable-DhKaPyjj.js → resizable-WLl3kXXs.js} +1 -1
  244. package/dist/client/assets/{resolve-tab-icon-Dllm1_fu.js → resolve-tab-icon-ByqcINMf.js} +1 -1
  245. package/dist/client/assets/{review-settings-8QMhy3Lg.js → review-settings-bGGfBlNt.js} +1 -1
  246. package/dist/client/assets/{roles-BEcXWCxJ.js → roles-C_SQvcrV.js} +1 -1
  247. package/dist/client/assets/{route-CMo6fdQZ.js → route-BRjhV7ZN.js} +1 -1
  248. package/dist/client/assets/{route-7AN9YEMz.js → route-CrZ0agrx.js} +1 -1
  249. package/dist/client/assets/route-DOcNdWL5.js +1 -0
  250. package/dist/client/assets/sandbox-lifecycle-context-RGinjzUS.js +1 -0
  251. package/dist/client/assets/{schema-LbfQM_um.js → schema-0jGA111R.js} +1 -1
  252. package/dist/client/assets/{schema-Db9nAPbV.js → schema-DzkQww7V.js} +1 -1
  253. package/dist/client/assets/{scroll-area-Do3s8MFg.js → scroll-area-tGpLyLX1.js} +1 -1
  254. package/dist/client/assets/{search-input-BiW12RB7.js → search-input-l1Nxf0a9.js} +1 -1
  255. package/dist/client/assets/{search-toggle-C_s2zUEP.js → search-toggle-CxATSEKS.js} +1 -1
  256. package/dist/client/assets/{secret-picker-4kZnJB0L.js → secret-picker-DZfeNjeU.js} +1 -1
  257. package/dist/client/assets/{secrets-D3OOpubP.js → secrets-DiQbqnkh.js} +1 -1
  258. package/dist/client/assets/{section-array-field-DlpdCCcl.js → section-array-field-CLj6DiG4.js} +1 -1
  259. package/dist/client/assets/{sections-NxijzCAP.js → sections-D4nfYRrB.js} +1 -1
  260. package/dist/client/assets/{sections-editor-DZMEPtw_.js → sections-editor-NTS3iIPY.js} +1 -1
  261. package/dist/client/assets/{select-C0Q0f4At.js → select-Dh0RDXSe.js} +1 -1
  262. package/dist/client/assets/{select-model-DlU2H5oA.js → select-model-Cmt1TH6i.js} +1 -1
  263. package/dist/client/assets/{seo-editor-DOL-unZx.js → seo-editor-BMcjQ83E.js} +1 -1
  264. package/dist/client/assets/{separator-DcYK5L3O.js → separator-Bpi7EJ0Z.js} +1 -1
  265. package/dist/client/assets/settings-tab-z_Zg1Psn.js +1 -0
  266. package/dist/client/assets/{sheet-C3lf7JiX.js → sheet-BeB7fiX7.js} +1 -1
  267. package/dist/client/assets/{shell-layout-aaJ-Ow-a.js → shell-layout-CNGrbelx.js} +1 -1
  268. package/dist/client/assets/{site-draft-actions-BdvwngLt.js → site-draft-actions-QoxLdEip.js} +1 -1
  269. package/dist/client/assets/site-draft-view-DgaAKV3m.js +2 -0
  270. package/dist/client/assets/site-editor-CShdOJ2B.js +1 -0
  271. package/dist/client/assets/{site-editor-toast-DS0_fxT0.js → site-editor-toast-BzM8F-5I.js} +1 -1
  272. package/dist/client/assets/{skills-Db9hF38T.js → skills-BFyhQCV2.js} +1 -1
  273. package/dist/client/assets/{slider-Brs1MiDz.js → slider-BEIpzaR7.js} +1 -1
  274. package/dist/client/assets/{sortable.esm-DR7ZsZlW.js → sortable.esm-DXFyyTP0.js} +1 -1
  275. package/dist/client/assets/{sso-BKJEgj1Q.js → sso-AQP6Ciq2.js} +1 -1
  276. package/dist/client/assets/{suggestion-BqSBag09.js → suggestion-5McGPh6e.js} +1 -1
  277. package/dist/client/assets/{switch-DXvm-pfC.js → switch-Ba2Gsd2l.js} +1 -1
  278. package/dist/client/assets/{symbol-DhjzVarJ.js → symbol-DhVs0bZH.js} +1 -1
  279. package/dist/client/assets/{synced-repos-BshDcf0T.js → synced-repos-CMC6m4k2.js} +1 -1
  280. package/dist/client/assets/{tab-icon-glyph-x6aTS8aC.js → tab-icon-glyph-BecmvuFT.js} +1 -1
  281. package/dist/client/assets/{table-CsgmIfM7.js → table-up4JHBvu.js} +1 -1
  282. package/dist/client/assets/{tabs-snNNT2OQ.js → tabs-C46_2gJf.js} +1 -1
  283. package/dist/client/assets/{task-assignee-avatar-CIFZYxqw.js → task-assignee-avatar-CdFkE7XN.js} +1 -1
  284. package/dist/client/assets/{task-board-DZ8Kzwkd.js → task-board-BCtRCz9S.js} +1 -1
  285. package/dist/client/assets/{task-route-B3yf9UbZ.js → task-route-Y1X7OZ0H.js} +1 -1
  286. package/dist/client/assets/{task-status-BXAKMLjX.js → task-status-CSuoeMCO.js} +1 -1
  287. package/dist/client/assets/{taskboard-analytics-CzU6hvG8.js → taskboard-analytics-B7lSR6tY.js} +1 -1
  288. package/dist/client/assets/tasks-BC1mhZoV.js +1 -0
  289. package/dist/client/assets/{tasks-BfBA5dNC.js → tasks-xJwb3MB5.js} +1 -1
  290. package/dist/client/assets/{textarea-PZ5-N42X.js → textarea-CTXOHUAm.js} +1 -1
  291. package/dist/client/assets/{thread-analytics-C0N5WioR.js → thread-analytics-Duedqn0y.js} +1 -1
  292. package/dist/client/assets/{thread-intent-DH83rsLQ.js → thread-intent-BAvAvKIG.js} +1 -1
  293. package/dist/client/assets/{thread-route-C8i0NIbO.js → thread-route-5Y36bVJA.js} +1 -1
  294. package/dist/client/assets/{thread-route-D9dyzfFR.js → thread-route-D-HTU4ms.js} +1 -1
  295. package/dist/client/assets/{thread-sheet-body-6YAeci0o.js → thread-sheet-body-DaYQzSu-.js} +1 -1
  296. package/dist/client/assets/{time-range-picker-CVmtrNYi.js → time-range-picker-fN9Evhky.js} +1 -1
  297. package/dist/client/assets/{toggle-group-CUFIN5dE.js → toggle-group-B38pdvYb.js} +1 -1
  298. package/dist/client/assets/{tool-namespace-Y0TJrGSX.js → tool-namespace-BCj-Y0g5.js} +1 -1
  299. package/dist/client/assets/{toolbar-icon-button-C6e2VzUh.js → toolbar-icon-button-brf17qwF.js} +1 -1
  300. package/dist/client/assets/{tooltip-9LLsMgGV.js → tooltip-CzDCGEIi.js} +1 -1
  301. package/dist/client/assets/{tooltipContext-D1XV88gx.js → tooltipContext-BmuFpL8F.js} +1 -1
  302. package/dist/client/assets/{track-BDVG3U2y.js → track-CFwl4Yaf.js} +1 -1
  303. package/dist/client/assets/{types-BO2WHIDA.js → types-BEPRfygK.js} +1 -1
  304. package/dist/client/assets/{url-slug-DonaWwCk.js → url-slug-W-P-V6ae.js} +1 -1
  305. package/dist/client/assets/{usage-stats-DBeLsjRR.js → usage-stats-B-bDSRFu.js} +1 -1
  306. package/dist/client/assets/{use-ai-providers-BHsc3bDD.js → use-ai-providers-ZqKycOYQ.js} +1 -1
  307. package/dist/client/assets/{use-apply-named-rule---oSjx7n.js → use-apply-named-rule-CvK-hhnp.js} +1 -1
  308. package/dist/client/assets/{use-automations-1YEM9DbK.js → use-automations-D3-t6dDi.js} +1 -1
  309. package/dist/client/assets/{use-autosave-B-Iuf8KI.js → use-autosave-i2Rvz97o.js} +1 -1
  310. package/dist/client/assets/{use-chat-layout-state-C15u8M2V.js → use-chat-layout-state-9bVxCYem.js} +1 -1
  311. package/dist/client/assets/{use-clock-tick-DIHPLwxm.js → use-clock-tick-BM5p8P79.js} +1 -1
  312. package/dist/client/assets/{use-connect-companion-V3BIIJeW.js → use-connect-companion-a0M1gRGT.js} +1 -1
  313. package/dist/client/assets/{use-connection-BQFGYTV6.js → use-connection-C6xnl_pH.js} +1 -1
  314. package/dist/client/assets/{use-content-sync-DPGe01L6.js → use-content-sync-tAg8ta4S.js} +1 -1
  315. package/dist/client/assets/{use-copy-CxT0JeDz.js → use-copy-BkKCeyGC.js} +1 -1
  316. package/dist/client/assets/{use-create-virtual-mcp-CAv-1I_T.js → use-create-virtual-mcp-Bu3SZepQ.js} +1 -1
  317. package/dist/client/assets/{use-date-fns-locale-BQCqx0nl.js → use-date-fns-locale-8Ts_sXo3.js} +1 -1
  318. package/dist/client/assets/{use-debounced-autosave-DXyNDYcX.js → use-debounced-autosave-DMiQvxW8.js} +1 -1
  319. package/dist/client/assets/{use-debounced-value-N-JjpU1V.js → use-debounced-value-DE8_aoyE.js} +1 -1
  320. package/dist/client/assets/{use-deco-credits-DDwwBuMm.js → use-deco-credits-DNhIxA1G.js} +1 -1
  321. package/dist/client/assets/{use-decopilot-events-CqPtaVnx.js → use-decopilot-events-C6Ht-NxL.js} +1 -1
  322. package/dist/client/assets/{use-delete-connection-BSNr2bC3.js → use-delete-connection-BJIuoAsL.js} +1 -1
  323. package/dist/client/assets/{use-deployment-admin-aELFz-ee.js → use-deployment-admin-yhpva385.js} +1 -1
  324. package/dist/client/assets/{use-fast-preview-draft-url-4INawxcX.js → use-fast-preview-draft-url-C6RW47sS.js} +1 -1
  325. package/dist/client/assets/{use-file-configs-DH6Ac5Y5.js → use-file-configs-DTUQ5Hig.js} +1 -1
  326. package/dist/client/assets/{use-inbox-feed-CXjwjyxO.js → use-inbox-feed-HZQIvZXe.js} +1 -1
  327. package/dist/client/assets/{use-infinite-scroll-CNc2NI3i.js → use-infinite-scroll-DUZWngnl.js} +1 -1
  328. package/dist/client/assets/{use-join-requests-B0daTOT_.js → use-join-requests-B4fxzXiJ.js} +1 -1
  329. package/dist/client/assets/{use-main-panel-tabs-BhdlgJp6.js → use-main-panel-tabs-Bx3g8qPg.js} +1 -1
  330. package/dist/client/assets/{use-mcp-auth-status-CF5TaDec.js → use-mcp-auth-status-D6Yk3F2A.js} +1 -1
  331. package/dist/client/assets/{use-mcp-client-P41n2mxI.js → use-mcp-client-CgMd9iAw.js} +1 -1
  332. package/dist/client/assets/{use-mcp-prompts-B3Nr4ZJG.js → use-mcp-prompts-QvvUKN0H.js} +1 -1
  333. package/dist/client/assets/{use-mcp-tools-BNi1ikeO.js → use-mcp-tools-dRnQL8sk.js} +1 -1
  334. package/dist/client/assets/{use-mobile-jFUNwYYf.js → use-mobile-CmqrzeQ2.js} +1 -1
  335. package/dist/client/assets/{use-move-blocks-B-yW6Slv.js → use-move-blocks-CZU-bgYZ.js} +1 -1
  336. package/dist/client/assets/{use-navigate-to-agent-Dm6cdVpv.js → use-navigate-to-agent-BxC330Nu.js} +1 -1
  337. package/dist/client/assets/{use-open-billing-url-Byo1M4SG.js → use-open-billing-url-c4b9_W-b.js} +1 -1
  338. package/dist/client/assets/{use-org-fs-BrF4BnPF.js → use-org-fs-CBQNhgrx.js} +1 -1
  339. package/dist/client/assets/{use-org-repo-syncs-6ClvuhZj.js → use-org-repo-syncs-BpCSmIKb.js} +1 -1
  340. package/dist/client/assets/{use-org-sso-BhUG19nu.js → use-org-sso-BjyMvUUZ.js} +1 -1
  341. package/dist/client/assets/{use-organization-roles-DGB0g1Kk.js → use-organization-roles-CR-IVvZj.js} +1 -1
  342. package/dist/client/assets/{use-organization-settings-BiInrSf0.js → use-organization-settings-y-0WXno1.js} +1 -1
  343. package/dist/client/assets/{use-panel-navigate-BJRHz9-t.js → use-panel-navigate-zL6feX1_.js} +1 -1
  344. package/dist/client/assets/{use-project-native-view-presence-7WN9qseE.js → use-project-native-view-presence-CzShimrg.js} +1 -1
  345. package/dist/client/assets/{use-project-scope-B0Sibn6g.js → use-project-scope-DtQCf5X8.js} +1 -1
  346. package/dist/client/assets/{use-recent-apps-C1A023Yo.js → use-recent-apps-CsecLp6Y.js} +1 -1
  347. package/dist/client/assets/{use-releases-tJmW6WNc.js → use-releases-Bn59ANC-.js} +1 -1
  348. package/dist/client/assets/{use-reports-diagnostic-DOFdWvCv.js → use-reports-diagnostic-DmS17KTi.js} +1 -1
  349. package/dist/client/assets/use-sandbox-events-BkrPzSJm.js +2 -0
  350. package/dist/client/assets/{use-secrets-D7gMnlZB.js → use-secrets-FsfDKvXs.js} +1 -1
  351. package/dist/client/assets/{use-section-preview-base-wA756W4w.js → use-section-preview-base-YJjHRtUw.js} +1 -1
  352. package/dist/client/assets/{use-session-runtime-CQn-52Ez.js → use-session-runtime-B1BjekR-.js} +1 -1
  353. package/dist/client/assets/{use-sidebar-collapsed-BPZlAUWE.js → use-sidebar-collapsed-50yzGJzV.js} +1 -1
  354. package/dist/client/assets/{use-tags-BqkalJgS.js → use-tags-CZDUybI1.js} +1 -1
  355. package/dist/client/assets/{use-task-board-analytics-CGnOgEtr.js → use-task-board-analytics-B2Pm02Ek.js} +1 -1
  356. package/dist/client/assets/{use-task-board-events-DBa8GRgx.js → use-task-board-events-DGLOhClG.js} +1 -1
  357. package/dist/client/assets/{use-task-board-item-prs-Cz375X0D.js → use-task-board-item-prs-B6JhCfRd.js} +1 -1
  358. package/dist/client/assets/{use-task-metadata-DYMge1Ms.js → use-task-metadata-Cl62kND-.js} +1 -1
  359. package/dist/client/assets/{use-thread-analytics-BgqERo23.js → use-thread-analytics-CR3zf5b3.js} +1 -1
  360. package/dist/client/assets/{use-thread-outputs-CxOHL03a.js → use-thread-outputs-DQFZK-8V.js} +1 -1
  361. package/dist/client/assets/useInfiniteQuery-BLBwQpXr.js +1 -0
  362. package/dist/client/assets/{useQueries-CunEDk2w.js → useQueries-BKAb_KHa.js} +1 -1
  363. package/dist/client/assets/useSuspenseInfiniteQuery-Dgg4wUTA.js +1 -0
  364. package/dist/client/assets/{users-Ckolvc6J.js → users-B1TbgHgl.js} +1 -1
  365. package/dist/client/assets/{utils-OgCNPQQr.js → utils-DTNHEqVe.js} +1 -1
  366. package/dist/client/assets/{variant-calendar-CVJKB37H.js → variant-calendar-BaZfELT8.js} +1 -1
  367. package/dist/client/assets/{variant-matcher-override-DMBn3So8.js → variant-matcher-override-e7d1QuAB.js} +1 -1
  368. package/dist/client/assets/{virtual-mcp-CjF7Cu1C.js → virtual-mcp-IZZKCKG6.js} +1 -1
  369. package/dist/client/assets/{watch-sse-pool-D75R450R.js → watch-sse-pool-BvCNV0KD.js} +1 -1
  370. package/dist/client/index.html +2 -2
  371. package/dist/server/server.js +81 -81
  372. package/package.json +1 -1
  373. package/dist/client/assets/agent-analytics-Cbdz4epN.js +0 -1
  374. package/dist/client/assets/agent-app-B-kKN9Kk.js +0 -1
  375. package/dist/client/assets/agent-calendar-D_we3tsY.js +0 -1
  376. package/dist/client/assets/agent-deck-w0DJ8inL.js +0 -1
  377. package/dist/client/assets/agent-experiments-zafEuLfN.js +0 -1
  378. package/dist/client/assets/agent-library-B6GAeK3B.js +0 -1
  379. package/dist/client/assets/agent-library-file-_ugelwAI.js +0 -1
  380. package/dist/client/assets/agent-monitor-BYj2OHl4.js +0 -1
  381. package/dist/client/assets/agent-settings-CkcXvyCB.js +0 -1
  382. package/dist/client/assets/agent-site-editor-code-BNXkN8TJ.js +0 -2
  383. package/dist/client/assets/agent-site-editor-content-BG_Zli2l.js +0 -1
  384. package/dist/client/assets/agent-site-editor-preview-DLqn9oce.js +0 -1
  385. package/dist/client/assets/agent-view-Bvz_UFEk.js +0 -1
  386. package/dist/client/assets/analytics-tab-BHmGa-59.js +0 -2
  387. package/dist/client/assets/api-keys-C1TdMpH9.js +0 -1
  388. package/dist/client/assets/blocks-preview-workspace-context-CVuSXtvf.js +0 -1
  389. package/dist/client/assets/chat-context-BvBN6HgF.js +0 -39
  390. package/dist/client/assets/cms-settings-editor-DQJghv4n.js +0 -1
  391. package/dist/client/assets/index-BQfNeaI1.css +0 -1
  392. package/dist/client/assets/index-CiU3Lit1.js +0 -1
  393. package/dist/client/assets/input-BJWjsMTr.js +0 -17
  394. package/dist/client/assets/library-DwSKFwop.js +0 -1
  395. package/dist/client/assets/project-reports-5DLZwE2I.js +0 -1
  396. package/dist/client/assets/project-tasks-ByxD-zBq.js +0 -1
  397. package/dist/client/assets/record-editor-hmgA54LD.js +0 -1
  398. package/dist/client/assets/reports-DklBonJw.js +0 -1
  399. package/dist/client/assets/repositories-CUKAU9Zy.js +0 -1
  400. package/dist/client/assets/route-lyp-fDsn.js +0 -1
  401. package/dist/client/assets/sandbox-lifecycle-context-D9P5uTE7.js +0 -1
  402. package/dist/client/assets/settings-tab-Dk0U9Ztd.js +0 -1
  403. package/dist/client/assets/site-draft-view-DJ-2XrRv.js +0 -2
  404. package/dist/client/assets/site-editor-DssQOjHQ.js +0 -1
  405. package/dist/client/assets/tasks-DxdBuhqv.js +0 -1
  406. package/dist/client/assets/use-sandbox-events-BNCiNcVF.js +0 -2
  407. package/dist/client/assets/useInfiniteQuery-B_LZh1B0.js +0 -1
  408. package/dist/client/assets/useSuspenseInfiniteQuery-CgbZRhlW.js +0 -1
@@ -1 +1 @@
1
- import{hM as Wo,bh as Ho,c as jn,b as Rn,r as S,l as ae,j as r,bP as qo,bd as Vs,hN as Ra,B as Ut,X as rn,aj as Go,Z as Uo,bg as Yo,Y as Jo,q as Qo,hm as Xo,hO as Zo,hP as ei,bo as xn,h as ti,bi as Rt,hQ as st,hR as Hr,hS as gs,hT as ni,hU as qr,hV as si,bv as ri,hW as ai,hX as Gr,hY as oi,t as q,bY as Ur,hZ as ii,h_ as Kt,h$ as li,i0 as ci,i1 as ui,bX as Yr,i2 as vs,i3 as di,i4 as fi,i5 as mi,bV as pi,bw as hi,i6 as gi,i7 as vi,bS as Si,f7 as yi,K as bi,bt as Jr,i8 as Qr,i9 as xi,ia as _i,ib as ki,ic as Ss,id as wi,ie as ji,ig as Ri,ih as Ei,bQ as Xr,ii as Vi,ij as Ti,ik as Zr,il as Ai,bU as Ni}from"./index-BGCeOWuH.js";import{u as Ci}from"./chat-context-BvBN6HgF.js";import{a2 as Pi,K as Xn,a3 as Ki,a4 as Mi,a5 as Bi,a6 as Di,a7 as Fi,a8 as Ii,a9 as ea,aa as Li,ab as Oi,z as Un,x as Yn,d as zi,u as $i,ac as ta,i as Wi,ad as Hi,k as qi,h as Gi,ae as Ea,af as Ui,ag as Yi,v as na,ah as Ji,ai as Qi,aj as Hn,ak as sa,al as ra,am as aa,an as ys,ao as Xi,D as Zi,ap as el,y as tl,aq as oa,ar as nl,as as ia,at as la,au as ca,M as sl,av as ua,a as rl,aw as an,ax as al,ay as ol,t as qn,az as _n}from"./held-block-view-DF-dsPP4.js";import{c as il}from"./repository-binding-Meqp5p71.js";import{n as ll,t as cl}from"./ChevronUp-DZpXGp6s.js";import{aa as Va,b as Qn,ap as ul,H as dl,a4 as da,a0 as fa}from"./agent-icon-BXl9rcx1.js";import{S as on}from"./scroll-area-Do3s8MFg.js";import{c as Et,T as Vt,a as Tt}from"./tooltip-9LLsMgGV.js";import{l as fl,u as ml,m as pl,D as hl,_ as gl,B as vl,aa as Mt,ab as Bt,K as Sl,ax as ma,N as yl,W as bl}from"./site-editor-toast-DS0_fxT0.js";import{u as xl,X as _l,E as bs,Y as pa,A as kl,Z as wl}from"./blocks-tab-states-Bji5rJXk.js";import{m as jl,u as Rl,P as El}from"./mustache-D-9UMI1S.js";import{Z as Gt,O as ks,ax as ws,_ as Dt,P as ln,e as Vl,c as Tl,w as Al,k as Gn,p as wn,a1 as Nl,X as qt,Q as xs,W as bt,V as kn,C as Cl,$ as ha,Y as Pl,ag as Kl,ai as Ml,ay as Bl,az as Dl,aA as Fl}from"./parse-sections-BHOqhf01.js";import{a as Il}from"./Copy01-DelcC4NE.js";import{a as js,e as Ta}from"./UserSquare-BWlOHIw0.js";import{i as ga}from"./Tool01-CyfGI7T6.js";import{s as va}from"./Image01-BmkGkBEJ.js";import{s as Ll}from"./Plus-Dp5dZDoY.js";import{s as Ol}from"./Trash01-BneWuuYf.js";import{i as Rs}from"./ZoomOut-Csm0orCM.js";import{u as zl,a as Sa,K as $l,P as Wl,b as Hl,C as ql,D as Gl,c as Ul}from"./core.esm-kr0nDMAf.js";import{u as Yl,s as Jl,a as Jn,S as Ql,v as Xl}from"./sortable.esm-DR7ZsZlW.js";import{s as Zl,g as ec,u as tc,A as nc}from"./use-section-preview-base-wA756W4w.js";import{a as sc,P as ya,w as rc,b as ac}from"./page-seo-form-Dx0hMHSf.js";import{u as oc}from"./use-apply-named-rule---oSjx7n.js";import{b as ba,a as ic}from"./variant-matcher-override-DMBn3So8.js";import{c as xa,d as lc,e as cc}from"./variant-draft-pointer-BeAKcq_c.js";import"./use-panel-navigate-BJRHz9-t.js";import"./thread-route-D9dyzfFR.js";import"./use-project-scope-B0Sibn6g.js";import"./autosend-1U_b-i1h.js";import"./thread-intent-DH83rsLQ.js";import"./use-mcp-client-P41n2mxI.js";import"./auth-BkqoCGcx.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-D75R450R.js";import"./task-board-DZ8Kzwkd.js";import"./schema-Db9nAPbV.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-CqPtaVnx.js";import"./use-ai-providers-BHsc3bDD.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-BiInrSf0.js";import"./utils-OgCNPQQr.js";import"./Play-CeJs-Z9F.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DVCmCnBf.js";import"./LinkBroken01-BbJzP52K.js";import"./collapsible-B9h9LvCC.js";import"./use-copy-CxT0JeDz.js";import"./usage-stats-DBeLsjRR.js";import"./tool-namespace-Y0TJrGSX.js";import"./form-BKxpLzV1.js";import"./label-_maV4eWQ.js";import"./utils-CVEq3hMx.js";import"./markdown-Pxz-NCAq.js";import"./use-mobile-jFUNwYYf.js";import"./use-clock-tick-DIHPLwxm.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C-WjAbV3.js";import"./types-BO2WHIDA.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-CIClX1OX.js";import"./XClose-BHn8yO7p.js";import"./ShoppingBag01-CrAecsFE.js";import"./SearchMd-DkOimU4h.js";import"./shell-layout-aaJ-Ow-a.js";import"./Building02-DyaG8VRs.js";import"./CheckCircle-IjQMURt4.js";import"./Monitor01-DIpgHRZ3.js";import"./command-DoejxN8Q.js";import"./index-BHWlfC8b.js";import"./integration-icon-IfDXGweg.js";import"./project-icon-CjQuZIIb.js";import"./new-project-dialog-BZU_MI3Q.js";import"./ArrowLeft-hUis4zpK.js";import"./repository-import-picker-FH262XPV.js";import"./use-navigate-to-agent-Dm6cdVpv.js";import"./repository-picker-DCYyzOOP.js";import"./useInfiniteQuery-B_LZh1B0.js";import"./infiniteQueryObserver-DdJGfIBw.js";import"./collection-search-D_HANk-F.js";import"./use-debounced-value-N-JjpU1V.js";import"./required-auth-layout-tipFurup.js";import"./use-org-sso-BhUG19nu.js";import"./sheet-C3lf7JiX.js";import"./use-connection-BQFGYTV6.js";import"./Link01-CpEeBnOB.js";import"./use-mcp-prompts-B3Nr4ZJG.js";import"./use-thread-outputs-CxOHL03a.js";import"./file-type-icon-T5-JgFJO.js";import"./section-array-field-DlpdCCcl.js";import"./alert-BxwQ9GWi.js";import"./switch-DXvm-pfC.js";import"./textarea-PZ5-N42X.js";import"./ChevronSelectorVertical-DSrF7Kt-.js";import"./popover-SHWbH4i8.js";import"./monaco-editor-CEz6AH84.js";import"./editor-vxR6fGAu.js";import"./calendar-sUXRafM_.js";import"./SwitchHorizontal01-BvXNAenZ.js";import"./Minus-Beni9ibl.js";import"./select-C0Q0f4At.js";import"./index-BdQq_4o_.js";import"./index-C91ph34T.js";import"./editor-classes-C1mRh06j.js";import"./toggle-group-CUFIN5dE.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BfNsB6Ea.js";import"./Upload01-CNkWpiz7.js";import"./DotsVertical-Cd1ayiT8.js";import"./search-input-BiW12RB7.js";import"./tabs-snNNT2OQ.js";import"./use-file-configs-DH6Ac5Y5.js";import"./asset-utils-CDMjNYFJ.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-session-runtime-CQn-52Ez.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-DvNrLRdk.js";import"./CreditCard01-cYImG8Bl.js";import"./Globe04-C3AUDQA6.js";import"./Key01-BJu0utQ9.js";import"./Sun-Dm3m8VPj.js";import"./Users01-ugdEQXdG.js";import"./experiments-tab-choice-CJW0rlLk.js";import"./use-sandbox-events-BNCiNcVF.js";import"./slider-Brs1MiDz.js";import"./index-B54Dwq_E.js";import"./tooltipContext-D1XV88gx.js";import"./CategoricalChart-B2xwR0Vg.js";import"./index-DEhotlUt.js";import"./ActiveShapeUtils-C-rHC-K0.js";import"./Sector-DYInMAbx.js";import"./symbol-DhjzVarJ.js";import"./empty-state-BXpVXa8p.js";import"./section-preview-url-7zfngvgW.js";import"./use-move-blocks-B-yW6Slv.js";const uc={escape:Pi};function dc(v,e){for(const p of Zl(v,e)){const y=typeof p.title=="string"?p.title:void 0;if(y?.includes("{{"))return y}}function fc(v,e){if(!e)return;const p=Wo(v,Ho(e));if(p)try{const y=dc(p.resolveType,e);return y&&jl.render(y,p.data,{},uc).trim()||void 0}catch{return}}function mc(v){const e=jn.c(13),{icon:p,label:y,className:b}=v;let V;e[0]!==b?(V=ae("size-3.5",b),e[0]=b,e[1]=V):V=e[1];let B;e[2]!==p||e[3]!==V?(B=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=B):B=e[4];let w;e[5]!==y||e[6]!==B?(w=r.jsx(Vt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":y,className:"shrink-0 cursor-help",children:B})}),e[5]=y,e[6]=B,e[7]=w):w=e[7];let K;e[8]!==y?(K=r.jsx(Tt,{className:"max-w-56",children:y}),e[8]=y,e[9]=K):K=e[9];let k;return e[10]!==w||e[11]!==K?(k=r.jsxs(Et,{children:[w,K]}),e[10]=w,e[11]=K,e[12]=k):k=e[12],k}const pc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function _a(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Aa(v){return v.map((e,p)=>({...e,index:p}))}function hc(v,e){if(e===v.length)return v;if(e<v.length)return Aa(v.slice(0,e));const p=Array.from({length:e-v.length},(y,b)=>({id:crypto.randomUUID(),index:v.length+b}));return[...v,...p]}function Na(v){const e=jn.c(44),{section:p,raw:y,meta:b,decofile:V}=v,B=Rn(),w=Xn(),K=p.isSavedBlock===!0,k=p.isMultivariate===!0;let X;e[0]!==b||e[1]!==y?(X=y&&b?ec(y,b):void 0,e[0]=b,e[1]=y,e[2]=X):X=e[2];const ge=X;let Ue;e[3]!==b||e[4]!==k||e[5]!==y||e[6]!==K?(Ue=y&&b&&!K&&!k?fc(y,b):void 0,e[3]=b,e[4]=k,e[5]=y,e[6]=K,e[7]=Ue):Ue=e[7];const Oe=Ue;let Ne;e[8]!==V||e[9]!==b||e[10]!==y||e[11]!==p?(Ne=Ii(y,p,V,b),e[8]=V,e[9]=b,e[10]=y,e[11]=p,e[12]=Ne):Ne=e[12];const oe=Ne;let R;e[13]!==k||e[14]!==y?.__resolveType?(R=!k&&Vs(y?.__resolveType??""),e[13]=k,e[14]=y?.__resolveType,e[15]=R):R=e[15];const c=R,xe=K?Qn:k?Va:Ta;let U;e[16]!==k||e[17]!==K?(U=K?{color:Yo}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=K,e[18]=U):U=e[18];const _e=U;let F;e[19]!==xe||e[20]!==w?(F=w?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Oi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(ul,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=w,e[21]=F):F=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let f;e[24]!==w||e[25]!==_e?(f=!w&&r.jsx(js,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=w,e[25]=_e,e[26]=f):f=e[26];const ze=w?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Re;e[27]!==u||e[28]!==ze?(Re=ae("min-w-0 truncate text-sm font-medium",ze,u),e[27]=u,e[28]=ze,e[29]=Re):Re=e[29];const Z=Oe??p.label;let $e;e[30]!==Re||e[31]!==Z?($e=r.jsx("span",{className:Re,children:Z}),e[30]=Re,e[31]=Z,e[32]=$e):$e=e[32];let rt;e[33]!==c||e[34]!==w||e[35]!==oe||e[36]!==B?(rt=w?r.jsxs(r.Fragment,{children:[c&&r.jsx(mc,{icon:Rs,label:B("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),oe&&r.jsx(ea,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):oe&&r.jsx(ea,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=w,e[35]=oe,e[36]=B,e[37]=rt):rt=e[37];let Ce;return e[38]!==$e||e[39]!==rt||e[40]!==F||e[41]!==ke||e[42]!==f?(Ce=r.jsxs(r.Fragment,{children:[F,ke,f,$e,rt]}),e[38]=$e,e[39]=rt,e[40]=F,e[41]=ke,e[42]=f,e[43]=Ce):Ce=e[43],Ce}const gc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vc="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function Ca(v,e,p){if(p)return Li({selected:e});const y=v.isSavedBlock===!0,b=v.isMultivariate===!0;return ae("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":y?gc:b?vc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function _s(v,e){return ae("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Sc(v){const e=jn.c(90),{section:p,raw:y,meta:b,decofile:V,sortableId:B,selected:w,onSelect:K,onDelete:k,onDuplicate:X,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Oe,onAddVariant:Ne,onDetach:oe}=v,R=Rn(),c=Xn(),xe=y?Vs(y.__resolveType??""):!1,U=p.isHidden===!0,_e=xe||U;let F;e[0]!==p?(F=Ra(p),e[0]=p,e[1]=F):F=e[1];const ke=F,f=!!Oe&&!p.isMultivariate;let ze;e[2]!==B?(ze={id:B,animateLayoutChanges:xc},e[2]=B,e[3]=ze):ze=e[3];const{attributes:u,listeners:Re,setNodeRef:Z,transform:$e,isDragging:rt}=Yl(ze);let Ce;e[4]!==$e?(Ce=ql.Transform.toString($e?{...$e,x:0}:null),e[4]=$e,e[5]=Ce):Ce=e[5];const at=rt?0:void 0;let Pe;e[6]!==Ce||e[7]!==at?(Pe={transform:Ce,opacity:at},e[6]=Ce,e[7]=at,e[8]=Pe):Pe=e[8];const _=Pe;let we;e[9]!==p?(we=Mi(p),e[9]=p,e[10]=we):we=e[10];const ot=we,it="button",m=0;let L;e[11]!==K?(L=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),K())},e[11]=K,e[12]=L):L=e[12];const et=rt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==w||e[16]!==et?(A=ae("touch-none transition-colors",et,Ca(p,w,c)),e[13]=c,e[14]=p,e[15]=w,e[16]=et,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==b||e[20]!==y||e[21]!==p?(Ye=r.jsx(Na,{section:p,raw:y,meta:b,decofile:V}),e[18]=V,e[19]=b,e[20]=y,e[21]=p,e[22]=Ye):Ye=e[22];const H=!c&&f&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ae(_s(_e,xe)),onClick:T=>{T.stopPropagation(),Oe?.()},onPointerDown:bc,children:r.jsx(Rs,{className:ae("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Tt,{side:"bottom",children:R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),lt=c?r.jsx(Bi,{label:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:U,onToggle:Ue,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})}):r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ae(_s(_e,U)),onClick:T=>{T.stopPropagation(),Ue()},onPointerDown:yc,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})})}),r.jsx(Tt,{side:"bottom",children:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=Uo,Je=Di;let ve;e[23]!==R?(ve=R("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=R,e[24]=ve):ve=e[24];const ct=ae(_s(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let We;e[25]!==Je||e[26]!==ve||e[27]!==ct?(We=r.jsx(Je,{label:ve,classicClassName:ct}),e[25]=Je,e[26]=ve,e[27]=ct,e[28]=We):We=e[28];let Ee;e[29]!==c||e[30]!==f||e[31]!==xe||e[32]!==Oe||e[33]!==R?(Ee=c&&f&&r.jsxs(r.Fragment,{children:[r.jsxs(rn,{onClick:T=>{T.stopPropagation(),Oe?.()},children:[r.jsx(Rs,{className:"h-4 w-4"}),R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(Go,{})]}),e[29]=c,e[30]=f,e[31]=xe,e[32]=Oe,e[33]=R,e[34]=Ee):Ee=e[34];let Ke;e[35]!==X?(Ke=T=>{T.stopPropagation(),X()},e[35]=X,e[36]=Ke):Ke=e[36];let tt;e[37]===Symbol.for("react.memo_cache_sentinel")?(tt=r.jsx(Il,{className:"h-4 w-4"}),e[37]=tt):tt=e[37];let Me;e[38]!==R?(Me=R("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=R,e[39]=Me):Me=e[39];let Be;e[40]!==Ke||e[41]!==Me?(Be=r.jsxs(rn,{onClick:Ke,children:[tt,Me]}),e[40]=Ke,e[41]=Me,e[42]=Be):Be=e[42];let De;e[43]!==c||e[44]!==ke||e[45]!==Ne||e[46]!==R?(De=ke&&r.jsxs(rn,{className:ae(!c&&Fi),onClick:T=>{T.stopPropagation(),Ne()},children:[r.jsx(Va,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ne,e[46]=R,e[47]=De):De=e[47];let Y;e[48]!==c||e[49]!==ot||e[50]!==ge||e[51]!==R?(Y=ot&&r.jsxs(rn,{className:ae(!c&&pc),onClick:T=>{T.stopPropagation(),ge()},children:[c?r.jsx(Qn,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=ot,e[50]=ge,e[51]=R,e[52]=Y):Y=e[52];let J;e[53]!==c||e[54]!==oe||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==R?(J=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(rn,{onClick:T=>{T.stopPropagation(),oe()},children:[c?r.jsx(Ta,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=oe,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=R,e[58]=J):J=e[58];let ee;e[59]!==k?(ee=T=>{T.stopPropagation(),k()},e[59]=k,e[60]=ee):ee=e[60];let O;e[61]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(Ol,{className:"h-4 w-4"}),e[61]=O):O=e[61];let N;e[62]!==R?(N=R("sectionsEditor.sectionList.deleteMenuItem"),e[62]=R,e[63]=N):N=e[63];let me;e[64]!==ee||e[65]!==N?(me=r.jsxs(rn,{variant:"destructive",onClick:ee,children:[O,N]}),e[64]=ee,e[65]=N,e[66]=me):me=e[66];let He;e[67]!==Ee||e[68]!==Be||e[69]!==De||e[70]!==Y||e[71]!==J||e[72]!==me?(He=r.jsxs(Jo,{align:"end",className:"w-44",children:[Ee,Be,De,Y,J,me]}),e[67]=Ee,e[68]=Be,e[69]=De,e[70]=Y,e[71]=J,e[72]=me,e[73]=He):He=e[73];let qe;e[74]!==fe||e[75]!==We||e[76]!==He?(qe=r.jsxs(fe,{children:[We,He]}),e[74]=fe,e[75]=We,e[76]=He,e[77]=qe):qe=e[77];let Qe;return e[78]!==u||e[79]!==Re||e[80]!==K||e[81]!==Z||e[82]!==_||e[83]!==A||e[84]!==Ye||e[85]!==H||e[86]!==lt||e[87]!==qe||e[88]!==L?(Qe=r.jsxs("div",{ref:Z,style:_,...u,...Re,role:it,tabIndex:m,onClick:K,onKeyDown:L,className:A,children:[Ye,H,lt,qe]}),e[78]=u,e[79]=Re,e[80]=K,e[81]=Z,e[82]=_,e[83]=A,e[84]=Ye,e[85]=H,e[86]=lt,e[87]=qe,e[88]=L,e[89]=Qe):Qe=e[89],Qe}function yc(v){return v.stopPropagation()}function bc(v){return v.stopPropagation()}function xc(){return!1}function Es(v){const e=jn.c(11),{canAddSection:p,onAddSection:y,className:b,size:V}=v,B=Rn();let w;e[0]!==b?(w=ae("w-full",b),e[0]=b,e[1]=w):w=e[1];const K=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ll,{size:14}),e[2]=k):k=e[2];let X;e[3]!==B?(X=B("sectionsEditor.sectionList.addSectionButton"),e[3]=B,e[4]=X):X=e[4];let ge;return e[5]!==y||e[6]!==V||e[7]!==w||e[8]!==K||e[9]!==X?(ge=r.jsxs(Ut,{type:"button",variant:"outline",size:V,className:w,disabled:K,onClick:y,children:[k,X]}),e[5]=y,e[6]=V,e[7]=w,e[8]=K,e[9]=X,e[10]=ge):ge=e[10],ge}function _c(v){const e=jn.c(101),{listKey:p,rawSections:y,sections:b,meta:V,decofile:B,selectedIndex:w,onSelect:K,onReorder:k,onDelete:X,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Oe,onToggleLazy:Ne,onAddVariant:oe,onDetach:R,onAddSection:c,canAddSection:xe}=v,U=xe===void 0?!0:xe,_e=Rn(),F=Xn();let ke;e[0]!==b.length?(ke=()=>_a(b.length),e[0]=b.length,e[1]=ke):ke=e[1];const[f,ze]=S.useState(ke),[u,Re]=S.useState(null),[Z,$e]=S.useState(p),[rt,Ce]=S.useState(b.length),at=S.useRef(!1);Z!==p?($e(p),Ce(b.length),ze(_a(b.length))):rt!==b.length&&(Ce(b.length),ze(Fe=>hc(Fe,b.length)));let Pe;e[2]===Symbol.for("react.memo_cache_sentinel")?(Pe={activationConstraint:{distance:8}},e[2]=Pe):Pe=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={coordinateGetter:Jl},e[3]=_):_=e[3];const we=zl(Sa(Wl,Pe),Sa($l,_));let ot;e[4]!==f?(ot=f.map(kc),e[4]=f,e[5]=ot):ot=e[5];const it=ot;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=Fe=>{Re(String(Fe.active.id))},e[6]=m):m=e[6];const L=m;let et;e[7]!==it||e[8]!==k?(et=Fe=>{Re(null);const{active:G,over:ie}=Fe;if(!ie||G.id===ie.id)return;const Ve=it.indexOf(String(G.id)),Xe=it.indexOf(String(ie.id));Ve===-1||Xe===-1||(ze(nt=>Aa(Jn([...nt],Ve,Xe))),at.current=!0,requestAnimationFrame(()=>{at.current=!1}),k?.(Ve,Xe))},e[7]=it,e[8]=k,e[9]=et):et=e[9];const A=et;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Re(null)},e[10]=Ye):Ye=e[10];const H=Ye;let lt,fe,Je,ve,ct,We,Ee,Ke,tt,Me,Be,De,Y,J,ee;if(e[11]!==u||e[12]!==U||e[13]!==F||e[14]!==B||e[15]!==f||e[16]!==it||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==oe||e[21]!==X||e[22]!==R||e[23]!==ge||e[24]!==Ue||e[25]!==K||e[26]!==Oe||e[27]!==Ne||e[28]!==y||e[29]!==b||e[30]!==w||e[31]!==we||e[32]!==_e){J=Symbol.for("react.early_return_sentinel");e:{const Fe=G=>{at.current||K(G)};if(e[48]!==u||e[49]!==U||e[50]!==F||e[51]!==f||e[52]!==c||e[53]!==y||e[54]!==b||e[55]!==_e){const G=u?f.find(ie=>ie.id===u):null;if(ve=G!=null?b[G.index]:null,Je=G!=null?y[G.index]:void 0,f.length===0){let ie;e[59]!==_e?(ie=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=ie):ie=e[60];let Ve;e[61]!==ie?(Ve=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ie}),e[61]=ie,e[62]=Ve):Ve=e[62];const Xe=Ve;let nt;e[63]!==U||e[64]!==F||e[65]!==Xe||e[66]!==c?(nt=F?Xe:r.jsxs("div",{className:"space-y-2",children:[Xe,r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm"})]}),e[63]=U,e[64]=F,e[65]=Xe,e[66]=c,e[67]=nt):nt=e[67],J=nt;break e}Y=ae(G&&"cursor-grabbing"),e[48]=u,e[49]=U,e[50]=F,e[51]=f,e[52]=c,e[53]=y,e[54]=b,e[55]=_e,e[56]=Je,e[57]=ve,e[58]=Y}else Je=e[56],ve=e[57],Y=e[58];fe=Gl,Ke=we,tt=Ul,Me=L,Be=A,De=H,lt=Ql,We=it,Ee=Xl,ee="space-y-1",ct=f.map(G=>{const ie=b[G.index];return ie?r.jsx(Sc,{sortableId:G.id,section:ie,raw:y[G.index],meta:V,decofile:B,selected:w===G.index,onSelect:()=>Fe(G.index),onDelete:()=>X(G.index),onDuplicate:()=>ge(G.index),onMakeReusable:()=>Ue(G.index),onToggleHidden:()=>Oe(G.index),onToggleLazy:Ne?()=>Ne(G.index):void 0,onAddVariant:()=>oe(G.index),onDetach:()=>R(G.index)},G.id):null})}e[11]=u,e[12]=U,e[13]=F,e[14]=B,e[15]=f,e[16]=it,e[17]=A,e[18]=V,e[19]=c,e[20]=oe,e[21]=X,e[22]=R,e[23]=ge,e[24]=Ue,e[25]=K,e[26]=Oe,e[27]=Ne,e[28]=y,e[29]=b,e[30]=w,e[31]=we,e[32]=_e,e[33]=lt,e[34]=fe,e[35]=Je,e[36]=ve,e[37]=ct,e[38]=We,e[39]=Ee,e[40]=Ke,e[41]=tt,e[42]=Me,e[43]=Be,e[44]=De,e[45]=Y,e[46]=J,e[47]=ee}else lt=e[33],fe=e[34],Je=e[35],ve=e[36],ct=e[37],We=e[38],Ee=e[39],Ke=e[40],tt=e[41],Me=e[42],Be=e[43],De=e[44],Y=e[45],J=e[46],ee=e[47];if(J!==Symbol.for("react.early_return_sentinel"))return J;let O;e[68]!==ct||e[69]!==ee?(O=r.jsx("div",{className:ee,children:ct}),e[68]=ct,e[69]=ee,e[70]=O):O=e[70];let N;e[71]!==lt||e[72]!==We||e[73]!==Ee||e[74]!==O?(N=r.jsx(lt,{items:We,strategy:Ee,children:O}),e[71]=lt,e[72]=We,e[73]=Ee,e[74]=O,e[75]=N):N=e[75];let me;e[76]!==Je||e[77]!==ve||e[78]!==F||e[79]!==B||e[80]!==V?(me=ve?r.jsx("div",{className:ae("cursor-grabbing shadow-lift",Ca(ve,!1,F)),children:r.jsx(Na,{section:ve,raw:Je,meta:V,decofile:B})}):null,e[76]=Je,e[77]=ve,e[78]=F,e[79]=B,e[80]=V,e[81]=me):me=e[81];let He;e[82]!==me?(He=qo.createPortal(r.jsx(Hl,{dropAnimation:Ki,children:me}),document.body),e[82]=me,e[83]=He):He=e[83];let qe;e[84]!==fe||e[85]!==Ke||e[86]!==tt||e[87]!==Me||e[88]!==Be||e[89]!==De||e[90]!==N||e[91]!==He?(qe=r.jsxs(fe,{sensors:Ke,collisionDetection:tt,onDragStart:Me,onDragEnd:Be,onDragCancel:De,children:[N,He]}),e[84]=fe,e[85]=Ke,e[86]=tt,e[87]=Me,e[88]=Be,e[89]=De,e[90]=N,e[91]=He,e[92]=qe):qe=e[92];let Qe;e[93]!==U||e[94]!==F||e[95]!==c?(Qe=!F&&r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=U,e[94]=F,e[95]=c,e[96]=Qe):Qe=e[96];let T;return e[97]!==Y||e[98]!==qe||e[99]!==Qe?(T=r.jsxs("div",{className:Y,children:[qe,Qe]}),e[97]=Y,e[98]=qe,e[99]=Qe,e[100]=T):T=e[100],T}function kc(v){return v.id}function wc(v,e,p,y){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const b=e.trim();if(!b)return Gt(v,p,y)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:ks(v,p,y)}:{kind:"noop"};const V=ws(v,p,y);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Dt(V.resolveType,V.data,b)};const B=Un(b),w=Yn(B,p);return w?{kind:"error",reason:"invalid-block-id",message:w}:{kind:"createBlock",blockId:B,blockData:Dt(V.resolveType,V.data,b),reference:ln(B)}}const ka="section-form-stale-save",jc=3;function wa(v,e,p){const y=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ea(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),b=Math.max(0,Math.min(e.pageVariantIndex,y.length-1)),V=y[b]?.sections??[];return{pageVariants:y,variantIndex:b,rawSections:V,parsedSections:wn(V,v,p)}}const ja=new WeakMap;let Rc=0;function Ec(v){let e=ja.get(v);return e===void 0&&(e=++Rc,ja.set(v,e)),e}function lf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:y=!0,previewUrl:b,currentPath:V,activePageBlockKey:B=null,activeGlobalBlockKey:w=null,externalSelection:K,onSaved:k,initialEditSeo:X=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Oe,onFocusedBlockChange:Ne,onVariantPreviewOverride:oe,focusVariant:R}){const c=Rn(),xe=Ci(),U=xe?.taskId??null,_e=y?{orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:b}:null,[F,ke]=S.useState([]),{data:f,isLoading:ze}=fl(_e,{pollWhile:F.length>0}),{data:u,isLoading:Re}=xl(_e),Z=Xn(),$e=xe?.virtualMcpId,Ce=il($e===e?e:null)?.metadata?.siteSlug??null,at=tc({virtualMcpId:e,branch:p,sandboxUrl:b}),Pe=ml(e,p),_=pl(Pe),we=Si(_),ot=!_,it=!!at||_,[m,L]=S.useState(null),[et,A]=S.useState(null),[Ye,H]=S.useState(null),[lt,fe]=S.useState(0),[Je,ve]=S.useState(void 0),[ct,We]=S.useState(null),[Ee,Ke]=S.useState(null);R&&R.seq!==ct&&(We(R.seq),Ke(R));const[tt,Me]=S.useState(null),Be={index:tt,remember:Me},[De,Y]=S.useState(null),[J,ee]=S.useState(null),[O,N]=S.useState([]),me=S.useRef(null),[He,qe]=S.useState(O.length);He!==O.length&&(qe(O.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Qe,T]=S.useState(0),[Fe,G]=S.useState(null),[ie,Ve]=S.useState(null),[Xe,nt]=S.useState(null),[Pa,Yt]=S.useState(!1),[Ts,Zn]=S.useState(!1),En=S.useRef(null),[Vn,Ka]=S.useState(!0),[Jt,Tn]=S.useState(!1),[Ft,An]=S.useState(!1),[Te,cn]=S.useState(X),[As,Ns]=S.useState(X);X&&!As&&(Ns(!0),cn(!0),L(null),A(null),H(null),N([])),!X&&As&&Ns(!1);const[Ma,un]=S.useState(null),[Cs,Nn]=S.useState(void 0),[Ps,It]=S.useState([]),[Ks,Qt]=S.useState(0),[Ie,ut]=S.useState(0),[Ba,Le]=S.useState(null),[Xt,Ge]=S.useState(null),[Ms,Bs]=S.useState(null),Ds=Qo(),Fs=hl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),dn=zi({orgSlug:v,virtualMcpId:e,branch:p}),[Da,Fa]=S.useState(V),[Ia,La]=S.useState(B),[Oa,za]=S.useState(w);(Da!==V||Ia!==B||Oa!==w)&&(queueMicrotask(()=>dn.flush()),Fa(V),La(B),za(w),L(null),A(null),H(null),fe(0),Y(null),ee(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1),cn(!1),un(null),Nn(void 0),It([]),Qt(t=>t+1));const D=$i({orgSlug:v,virtualMcpId:e,branch:p}),fn=rl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Cn=Rl({orgSlug:v,virtualMcpId:e,branch:p}),Is=oc({orgSlug:v,virtualMcpId:e,branch:p}),[Zt,en]=S.useState(!1),C=S.useRef(null),wt=S.useRef(null),gt=S.useRef(null),vt=S.useRef(null),Pn=S.useRef({}),Lt=S.useRef(null),mn=S.useRef(!1),pn=S.useRef(!1),Se=S.useRef(new Map),tn=S.useRef(!1),xt=S.useRef([]),es=S.useRef(new WeakSet);gl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=ne.current,i=new Set;n&&i.add(n);for(const l of[wt.current?.sectionIndex,o]){const d=l==null?void 0:s[l],E=l==null?void 0:a[l],h=d&&E?.isSavedBlock?Ss(d,E):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[C,gt,vt])l.current&&clearTimeout(l.current),l.current=null;wt.current=null,Se.current.clear(),n&&t.has(n)&&(Pn.current={})}});const ne=S.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ls,Os]=S.useState(0),[$a,Wa]=S.useState(0),zs=Xo(Pe,{orgSlug:v,virtualMcpId:e,branch:p}),$s=Zo(zs,F[0]?.blockKey??null,F[0]?ei(xn(F[0].plan.theirs)):null),[Ha,qa]=S.useState(null),ts=vl(v,e).epoch,[Ga,Ua]=S.useState(ts);if(!y||ze||Re)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ti,{className:"size-5 text-muted-foreground"})});if(!f||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ya=Vl(f,u),$=!!w,se=$?null:Tl(Ya,V,B),g=$?w:se?.key??null,Kn=$&&w?f[w]:void 0,Ws=$&&w&&Kn?Al(w,Kn):$&&w?w:"",Ot=!$&&g&&f[g]?f[g]:null,ns=Te&&f&&u&&g&&se?ta(f,{kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},u):null,Ja=Te?Ot?.seo:void 0,Mn=Cs!==void 0?Cs:Ja,Qa=Te?Wi(Mn):void 0,Hs=ns?.seoTypeOptions??[],qs=Te&&u?Hi(u):"",ss=Ma??Qa??{},Bn=Te&&ns?sc(ss,ns):null,Gs=Te&&Bn&&qi(Mn)?Gn(Bn,u):null,Us=Te?Gi(f,u)?.seoData:void 0,le=$?[{label:"Default",sections:[{__resolveType:w}]}]:Ea(Ot?.sections,f??{},_),St=le.length>1,Q=Math.min(lt,le.length-1),ye=le[Q],M=ye?.sections??[],ce=wn(M,f,_),Dn=!$&&Nl(Ot?.sections,_);if($&&w&&Ms!==w){Bs(w);const t=M[0],n=ce[0];if(t&&n){L(0),ut(0),N([]);const s=Rt(t,n,f,_);s&&(A(s.data),H(s.resolveType),Ge(null),Le(null))}}!$&&Ms!==null&&Bs(null),ne.current={rawSections:M,parsedSections:ce,decofile:f??{},activePageKey:g,pageVariants:le,variantIndex:Q,sectionVariantIndex:Ie,selectedSectionIndex:m};const Xa=()=>({multivariate:Dn,index:Q,variants:le.map(t=>({rule:t.rule})),lazyValues:_&&Dn&&yi(Ot?.sections?.variants?.[Q]?.value)}),rs=(t,n)=>{if(!oe)return;if(!g||!Dn||t.length<=1){oe(null);return}const s={multivariate:!0,index:n,variants:t},a=_?xa(g,s):ba(g,s,f,u);oe(a.length>0?a:null)},as=oe&&g&&Dn&&St&&!ze&&!Re?g:null;if(as!==Ha&&(qa(as),as)){const t=le.map(s=>({rule:s.rule})),n=Q;queueMicrotask(()=>rs(t,n))}const zt=(t,n,s)=>{if(!oe)return;if(!g){oe(null);return}const a=Xa(),o=_?xa(g,a):ba(g,a,f,u);if(!t||n<0){oe(o.length>0?o:null);return}const i={pageKey:g,page:a,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=_?lc(i):ic({...i,decofile:f,meta:u}),d=_?cc(o,l):[...o,...l];oe(d.length>0?d:null)},_t=(t,n,s,a=m??-1,o=!1)=>{const i=st(t,n);if(!i){A(null),H(null),Ge(null),Le(null),o&&zt(null,a,s);return}const d=qr(i,we)[s];if(!d){A(null),H(null),Ge(null),Le(null),o&&zt(null,a,s);return}const E=ai(d.value,f);A(E?.data??null),H(E?.resolveType??null);const{resolveType:h,formValue:x}=qt(d.rule,f,u??void 0);Ge(h),Le(x),o&&zt(i,a,s)},hn=t=>{Ve(null),fe(t),L(null),A(null),H(null),N([]);const n=le[t]?.rule,{resolveType:s,formValue:a}=qt(n,f??{},u??void 0);ee(s),Y(a),rs(le.map(o=>({rule:o.rule})),t)},Ys=(t,n)=>{const s=M[t],a=ce[t];if(!s||!a)return!1;const o=a.isMultivariate?st(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),ut(i),N([]),T(l=>l+1),a.isMultivariate)_t(s,a,i,t);else{const l=Rt(s,a,f,_);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),Ge(null),Le(null)}return!0},Js=K?.index;if(K!==void 0&&(K?.seq??null)!==Je&&(ve(K?.seq??null),typeof Js=="number"&&Ys(Js,0)),Ee&&($?Kn:Ot)){const t=Ee.pageVariant,n=!$&&t!==void 0&&t<le.length;if(n&&t!==Q)hn(t);else{Ke(null);const{section:s,variant:a}=Ee;if($)a!==void 0&&(Me(a),N([]),T(o=>o+1));else if(s!==void 0&&Ys(s,a??0)){const o=M[s],i=ce[s],l=i.isMultivariate?st(o,i):null;l&&a!==void 0&&queueMicrotask(()=>zt(l,s,a))}else n&&hn(t)}}if(ts!==Ga){Ua(ts);const t=C.current!==null||Se.current.size>0||vt.current!==null||gt.current!==null||D.isPending||dn.isPending||F.length>0,n=m!==null&&Hr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=ce[m];if(N([]),T(o=>o+1),!s||!a)L(null),A(null),H(null);else if(a.isMultivariate)_t(s,a,Ie,m);else{const o=Rt(s,a,f,_);A(o?.data??null),H(o?.resolveType??null)}}!t&&Te&&(un(null),Nn(void 0),Qt(s=>s+1))}if(Ls!==$a){Wa(Ls);const t=m!==null?M[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(N([]),T(s=>s+1),n.isMultivariate)_t(t,n,Ie,m);else{const s=Rt(t,n,f,_);A(s?.data??null),H(s?.resolveType??null)}}const dt=F[0];if(dt){const{formBase:t,target:n}=dt,s=wa(f,n,_),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?gs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,f,_):null,i=ni(dt,o,l=>Gr(t,l));if(i){const d=[{...dt,...i,changedAgain:!0},...F.slice(1)];xt.current=d,ke(d)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:_?void 0:b??void 0,siteSlug:Ce},Fn=Ye&&u?Gn(Ye,u):null,ft=(t,n)=>{if(!g)return;C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=an(f,g,t,Q,le);D.mutate({blockKey:g,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},$t=()=>{Ne?.(null),L(null),An(!1),A(null),H(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1)},Qs=()=>Hr(me.current,document.activeElement),os=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),wt.current=null,q.error(t,{id:ka}),Qs()){tn.current=!0;return}Os(n=>n+1)},Xs=()=>{!tn.current||Qs()||xt.current.length>0||C.current!==null||mn.current||pn.current||Se.current.size>0||(tn.current=!1,Os(t=>t+1))},Zs=()=>{tn.current&&setTimeout(Xs,0)},er=t=>bl(Ds,Fs,t,Pe.kind==="protocol"?Pe:null),tr=t=>{Se.current.size!==0&&setTimeout(()=>{if(mn.current||pn.current)return;const n=[...Se.current.values()];Se.current.clear();for(const s of n)s()},t)},Za=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=ne.current,o=Lt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:$,pageVariantIndex:s,sectionVariantIndex:a,schema:Fn}},vn=t=>{xt.current=t,ke(t)},eo=t=>{const n=xt.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:Qr(a.plan,a.choices,t.plan),fresh:Vi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||xn(a.plan.theirs)!==xn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(o)},nr=(t,n)=>{const s=xt.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if(xn(o.plan.mine)===xn(n))return!0;const i=Jr({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(d=>d!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:Qr(o.plan,o.choices,i)})),!0},to=t=>{const n=ne.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},no=()=>{const t=xt.current[0];if(!t)return null;const{formBase:n,target:s}=t;C.current&&wt.current?.sectionIndex===n.sectionIndex&&wt.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(C.current),C.current=null,wt.current=null),Se.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!nr(n,a)&&Sn(a,n.sectionIndex,0,s),xt.current[0]??null},so=()=>{const t=xt.current[0],n=no();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=hi(n.plan,n.choices);Pe.kind==="protocol"&&Pe.source==="github"&&gi(n.plan,n.choices)&&Sl(c,!1),vn(xt.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,es.current.add(a),(Lt.current===a||to(n))&&(Lt.current=a,A(s),T(i=>i+1)),Sn(s,a.sectionIndex,0,o)},ro=t=>{const[n,...s]=xt.current;n&&vn([{...n,choices:t},...s])},Sn=(t,n,s=0,a,o=!1)=>{const i=a??Za(n),l=i.sectionVariantIndex,d=i.formBase,E=wt.current;C.current&&(clearTimeout(C.current),C.current=null,E&&(E.sectionIndex!==n||E.sectionVariantIndex!==l)&&E.write());const h=`${i.pageKey}:${n}:${l}`,x=()=>{if(mn.current||pn.current){Se.current.set(h,x);return}const j=typeof t=="function"?t():t;if(d&&nr(d,j))return;const I=ne.current.decofile,{rawSections:P,parsedSections:pe,pageVariants:ue,variantIndex:be}=wa(I,i,_),z=i.pageKey,W=P[n];if(!W)return;const re=pe[n];if(!re)return;const he=d?.base,Ae=gs(W,re,l,I,_),sn=!!he&&!!Ae&&xi(he,Ae)&&!(d&&Gr(d,Ae));if(sn&&he&&Ae){if(_i(he,Ae)){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const te=re.isSavedBlock?"here":ki(he,P.map((de,ht)=>gs(de,pe[ht],l,I,_)),n,d?.sectionCount??P.length);if(te==="unknown"){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof te=="number"&&d){d.sectionCount=P.length,d.sectionIndex=te,Lt.current===d&&L(te),Sn(j,te,s,i);return}}const pt=sn&&he&&Ae?Jr({ancestor:he,mine:j,theirs:Ae}):null;if(pt&&pt.pointers.length>0&&d){d.sectionCount=P.length,eo({plan:pt,formBase:d,target:i,sectionIndex:n,choices:wi(pt),changedAgain:!1,blockKey:re.isSavedBlock?Ss(W,re):z,fresh:{}});return}const Ze=pt?pt.merged:null,Pt=Ze??j,zr=ji({merged:!!Ze,tracked:d,current:Lt.current,saved:j});Ze&&q.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:ka}),zr&&d&&(d.emitted=Ze,A(Ze));const hs=zr||!Ze?Pt:j;d&&(d.base=hs,d.sectionCount=P.length,Ri(d,hs));const $r={onSuccess:()=>{d&&es.current.delete(d),k?.()},onError:te=>{if(d?.base===hs&&he&&(d.base=he),te instanceof yl){if(d&&(d.version=void 0),s<jc){Se.current.delete(h),pn.current=!0;const de=Ti(s,te.carriedStored);setTimeout(()=>{pn.current=!1,Sn(()=>{const ht=d?.emitted;return ht&&typeof ht=="object"?ht:j},n,s+1,i,de.immediate),Se.current.delete(h),tr(_n)},de.delay)}else os();return}D.reportError(te)}},Wr=te=>{mn.current=!0;let de=!1;D.mutateAsync(te).then(()=>$r.onSuccess(),ht=>{de=!0,$r.onError(ht)}).finally(()=>{mn.current=!1,tr(de?_n:0),Xs()})};if(re.isSavedBlock){const te=Ss(W,re);if(!te)return;Wr({blockKey:te,data:Pt,...he?{base:{value:Ze?Ae:he}}:{},rebaseOnConflict:!1,guard:Zr({formBase:d,rebased:!!Ze,versionOf:er})});return}if(!z)return;const Wn={...I[z]},Ht=[...P];if(re.isMultivariate){const te=st(W,re);if(!te||!z)return;const de=Ei(te,l,Pt);Ht[n]=Kt(W,re,de)}else if(re.isHidden){const te=Vs(W.__resolveType),de=te?{...W.section}:{...W},ht=Array.isArray(de.variants)?[...de.variants]:[];ht[0]&&(ht[0]=Xr(de.__resolveType,ht[0],Pt)),de.variants=ht,te?Ht[n]={...W,section:de}:Ht[n]=de}else re.isLazy?Ht[n]={...W,section:Pt}:Ht[n]=Pt;if(ue.length>1){const te=Wn.sections,de=[...te?.variants??[]];de[be]&&(de[be]=Xr(te?.__resolveType,de[be],Ht)),Wn.sections={...te,variants:de}}else Wn.sections=Ht;Wr({blockKey:z,data:Wn,rebaseOnConflict:!1,guard:Zr({formBase:null,rebased:!1,versionOf:er})})};if(wt.current={sectionIndex:n,sectionVariantIndex:l,write:x},o){wt.current=null,x();return}C.current=setTimeout(()=>{C.current=null,x()},_n)},ao=t=>{tn.current=!1,L(t),ut(0),N([]),T(o=>o+1);const n=M[t],s=ce[t];if(Ne?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){_t(n,s,0,t);return}const a=Rt(n,s,f,_);if(!a){A(null),H(null),Ge(null),Le(null),zt(null,t,0);return}A(a.data),H(a.resolveType),Ge(null),Le(null),zt(null,t,0)},sr=t=>{const n=t;m!==null&&(Lt.current=vi(Lt.current,{sectionIndex:m,variantIndex:ne.current.sectionVariantIndex,shown:et,next:n,sectionCount:ne.current.rawSections.length})),A(n),m!==null&&Sn(n,m)},is=t=>{if(!g||!f||!u||!se)return;const n={kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},s=ta(f,n,u);s&&dn.save(g,()=>{const a=Ds.getQueryData(bi.decofile(Fs))?.[g];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Pn.current};return Pn.current={},t?.raw!==void 0?rc(o,t.raw,u):t?.inner!==void 0?ac(n,s,o,t.inner):o})},rr=(t,n)=>{g&&(Pn.current[t]=n,is())},oo=(t,n)=>{if(!g)return;const s=Jn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),ft(s)},io=t=>{if(!g)return;const n=M.filter((s,a)=>a!==t);m===t?$t():m!==null&&m>t&&L(m-1),ft(n)},lo=t=>{if(!g)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,al(n)),m!==null&&m>t&&L(m+1),ft(s)},co=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s)return;const a=s.isHidden?fi(n,_):mi(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},uo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const a=di(n);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},fo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const a=Rt(n,s,f,_);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&$t(),ft(l)},mo=t=>{if(!g)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;ft(n,{onError:()=>{ne.current.selectedSectionIndex===s&&$t()}}),Yt(!1),L(s),ut(0),N([]),T(l=>l+1);const a=n[s],o=wn(n,f,_)[s];if(!a||!o)return;if(o.isMultivariate){_t(a,o,0);return}const i=Rt(a,o,f,_);if(!i){A(null),H(null),Ge(null),Le(null);return}A(i.data),H(i.resolveType),Ge(null),Le(null)},ar=t=>{En.current=t.append,Yt(!0)},po=t=>{const n=En.current;if(!n){mo(t);return}n({__resolveType:t.resolveType}),Yt(!1),En.current=null},or=t=>{if(m===null)return;const n=M[m],s=ce[m];!n||!s?.isMultivariate||(ut(t),N([]),T(a=>a+1),_t(n,s,t,m,!0))},ho=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ci(a,t);if(!o){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Kt(n,s,o);const l=o.variants;let d=Ie;t===Ie?d=Math.min(t,l.length-1):t<Ie&&(d=Ie-1),ut(d),N([]),T(E=>E+1),_t(i[m],s,d),ft(i)},go=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ui(a,t,_),i=[...M];i[m]=Kt(n,s,o);const l=Yr(a.variants??[],t,_);ut(l),N([]),T(d=>d+1),_t(i[m],s,l,m,_),ft(i)},vo=(t,n)=>{if(m===null||!g||t===n)return;const s=M[m],a=ce[m];if(!s||!a?.isMultivariate)return;const o=st(s,a);if(!o)return;const i=ii(o,t,n),l=[...M];l[m]=Kt(s,a,i);let d=Ie;Ie===t?d=n:t<Ie&&n>=Ie?d=Ie-1:t>Ie&&n<=Ie&&(d=Ie+1),ut(d),_t(l[m],a,d,m,_),ft(l)},yn=t=>{const n=t??m;if(n===null||!g)return;const s=M[n],a=ce[n];if(!s||!a)return;const o=oi(s,a,void 0,u,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=wn(i,f,_)[n];if(!l?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),ut(o.newVariantIndex),N([]),T(d=>d+1),_t(o.section,l,o.newVariantIndex,n,_),ft(i)},ir=()=>{if(m===null||!g)return;const t=M[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=st(t,n);if(!s)return;const a=li(t,n,s);if(!a){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=wn(o,f,_)[m];if(!i)return;ut(0),Ge(null),Le(null),N([]),T(d=>d+1);const l=Rt(a,i,f,_);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),zt(null,m,0),ft(o)},So=async t=>{if(Fe===null||!g)return;const n=Yn(t,f,u);if(n){q.error(n);return}const s=M[Fe],a=ce[Fe];if(!s||!a)return;const o=Rt(s,a,f,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),d=[...M];d[Fe]={__resolveType:t},await D.mutateAsync({blockKey:g,data:an(f,g,d,Q,le)}),m===Fe&&$t(),G(null),qn(l)||q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){q.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Mt(c,Bt(l))})}},lr=ye?.rule;if(St&&m===null&&J===null&&lr){const{resolveType:t,formValue:n}=qt(lr,f??{},u??void 0);ee(t),Y(n)}const nn=u?Ui(u):[],ls=u&&f?Yi(u,f):[],Wt=_&&u&&f?_l(u,f):[],cs=(t,n)=>{if(Wt.length===0)return;const s=Pl(t);return{kinds:Wt,selected:s,campaignPrefill:kl(t),onPick:n}},cr=!$&&!!(it&&u&&f),ur=J&&u?Gn(J,u):null,yt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},kt=async(t,n)=>{if(!(Dl(n,t,u)>0))try{await Cn.mutateAsync({blockKey:t})}catch(s){q.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Mt(c,Bt(s))})}},dr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],d=l[a],E=d?.rule;if(Gt(E,s,u)){const h=E?.__resolveType??"",x=s[h],j=typeof x?.name=="string"?x.name:h,{__resolveType:I,...P}=t;D.mutate({blockKey:h,data:Dt(I??"",P,j)},{onSuccess:()=>k?.(),onError:D.reportError});return}d&&(l[a]={...d,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},_n)},fr=t=>{ee(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Y(t?n:{}),dr(n)},mr=t=>{const n=t;Y(n);const s=J?{__resolveType:J,...n}:{...n};dr(s)},In=async(t,n,s)=>{const a=wl(n,t);if(!a.ok)return a.reason==="conflict"&&q.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ma),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Is.apply({writes:o})).ok?null:(a.blockWrite&&q.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ma,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},pr=Wt.length>0?{kinds:Wt,prepare:async t=>(await In(t,ne.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Kl(ne.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Is.apply({writes:{[Ml(t).blockKey]:n.block}})).ok}}:null,hr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;let o=null;const i=await In(t,s,E=>{const h=s[n],x=h?.sections;if(!x||typeof x!="object"||Array.isArray(x))return null;const j=x;if(!Array.isArray(j.variants))return null;const I=[...j.variants],P=I[a];return P?(o=bt(P.rule,s,u),I[a]={...P,rule:E},{blockKey:n,data:{...h,sections:{...j,variants:I}}}):null});if(!i)return;const{resolveType:l,formValue:d}=qt(i.rule,i.projected,u??void 0);ee(l),Y(d),o&&await kt(o,i.projected),k?.()},gr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[a];if(!E)return;const h=bt(E.rule,s,u),x=ln(t);d[a]={...E,rule:x};const j={...s,[n]:{...o,sections:{...l,variants:d}}},{resolveType:I,formValue:P}=qt(x,j,u??void 0);ee(I),Y(P);try{await D.mutateAsync({blockKey:n,data:j[n]}),h&&h!==t&&await kt(h,j),k?.()}catch(pe){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(pe))})}},vr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=ne.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const P=(j.variants??[])[s]?.rule;if(Gt(P,i,u)){const z=P?.__resolveType??"",W=i[z],re=typeof W?.name=="string"?W.name:z,{__resolveType:he,...Ae}=t;D.mutate({blockKey:z,data:Dt(he??"",Ae,re)},{onSuccess:()=>k?.(),onError:D.reportError});return}const pe=vs(j,s,t),ue=[...a];ue[n]=Kt(h,x,pe);const be=an(i,l,ue,E,d);D.mutate({blockKey:l,data:be},{onSuccess:()=>k?.(),onError:D.reportError})},_n))},yo=t=>{Ge(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Le(t?n:{}),vr(n)},bo=t=>{const n=t;Le(n);const s=Xt?{__resolveType:Xt,...n}:{...n};vr(s)},xo=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;let h=null;const x=await In(t,i,P=>{const pe=a[n],ue=o[n];if(!pe||!ue?.isMultivariate)return null;const be=st(pe,ue);if(!be)return null;const z=be.variants??[];h=bt(z[s]?.rule,i,u);const W=[...a];return W[n]=Kt(pe,ue,vs(be,s,P)),{blockKey:l,data:an(i,l,W,E,d)}});if(!x)return;const{resolveType:j,formValue:I}=qt(x.rule,x.projected,u??void 0);Ge(j),Le(I),h&&await kt(h,x.projected),k?.()},_o=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=bt(I[s]?.rule,i,u),pe=ln(t),ue=vs(j,s,pe),be=[...a];be[n]=Kt(h,x,ue);const z=an(i,l,be,E,d),W={...i,[l]:z},{resolveType:re,formValue:he}=qt(pe,W,u??void 0);Ge(re),Le(he);try{await D.mutateAsync({blockKey:l,data:z}),P&&P!==t&&await kt(P,W),k?.()}catch(Ae){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(Ae))})}};if(!$&&!se)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if($&&!Kn)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?ce[m]??null:null,Sr=m!==null?M[m]:null,yr=Sr&&je?.isMultivariate?st(Sr,je):null,At=yr?qr(yr,we):[],Ln=Math.min(Ie,Math.max(At.length-1,0)),jt=At[Ln]??null,Nt=je?.isMultivariate===!0,us=m!==null&&je!==null,Ct=us&&(Nt||!!(Fn&&et)),ko=Ct&&!$&&je?.isSavedBlock===!0,mt=$||ko,br=$?Ws:je?.label??"",wo=Xt&&u?Gn(Xt,u):null,xr=(t,n)=>n&&Z?`${t} · ${n}`:t,_r=je?je.variantOf??je.label:"",jo=(()=>{const t=Nt&&jt?jt.label:null;return t?Z?[xr(_r,t)]:[je.label,t]:[je?.label??""]})(),ds=xr(se?.name??"",St?ye?.label:null),On=Ct&&(!$||O.length>0)?$?[Ws,...O]:[ds,...jo,...O]:[],kr=Te&&se?[se.name,"SEO",...Ps]:[],wr=c("sectionsEditor.pageVariantTabs.variantsLabel"),jr=Jt&&se?[se.name,wr]:Ft&&se&&je?[ds,_r,wr]:[],zn=jr.length>0?jr:kr.length>0?kr:mt?On.length>0?On:[br]:On.length>0?On:[ds],Rr=us&&!Nt&&!je?.isHidden&&!!g,Ro=mt||!$&&St&&!!ye||Rr,Eo=us&&!Nt&&!$&&O.length===0&&!!je&&Ra(je)&&!!g,Vo=Z&&Ct&&!Ft&&Nt&&O.length===0&&!!jt,Er=Z&&O.length>0?na(O[O.length-1]):null,To=O.length>1?na(O[O.length-2]):null,Vr=mt?br:Ct?je?.label??"":se?.name??"",Ao=Jt||Ft?c("sectionsEditor.pageVariantTabs.variantsLabel"):Te?c("sectionsEditor.panelSections.seo"):Er??Vr,Tr=Ft?je?.variantOf??je?.label??"":Jt||Te?se?.name??"":Er?To??Vr:mt?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Ct?se?.name??"":se?.path??"",fs=!Jt&&!Ft&&!Te&&!Ct&&!mt,No=!Z&&!Te&&!$&&Nt&&O.length===0,bn=()=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const t=f[g],n=Cl(t.sections,M,u,_);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),L(null),A(null),H(null),N([]),Y(null),ee(null)},onError:D.reportError})},$n=(t,n,s)=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const a=f[g],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const d=Bl(i,l),E={...f,[g]:{...a,sections:d}};D.mutate({blockKey:g,data:E[g]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const x of h)await kt(x,E)})()},onError:D.reportError})},Ar=(t,n)=>{if(t===n)return;let s=Q;Q===t?s=n:t<Q&&n>=Q?s=Q-1:t>Q&&n<=Q&&(s=Q+1),fe(s);const a=Jn(le.map(o=>({rule:o.rule})),t,n);rs(a,s),$n(o=>Jn(o,t,n))},Nr=t=>{const n=le[t]?.rule,s=bt(n,f??{},u??void 0);$n(a=>a.length<=1?null:(a.splice(t,1),a),()=>{le.length-1===1?fe(0):t<Q?fe(Q-1):t===Q&&fe(Math.max(0,t-1)),L(null),A(null),H(null),N([]),Y(null),ee(null)},s)},Co=()=>{const t=le.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!pi(n.rule)).map(({variant:n})=>bt(n.rule,f??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Ai({variants:n}),a=n[s];return a?[{...a,rule:Ni(u)}]:null},()=>{fe(0),L(null),A(null),H(null),N([]),Y(null),ee(null),Tn(!1)},t)},Cr=t=>{let n=t+1;$n(s=>(n=Yr(s,t,_),Fl(s,t,_)),()=>{fe(n),L(null),A(null),H(null),N([]),Y(null),ee(null)})},Po=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const s=ne.current.activePageKey,a=ne.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[t];if(!E?.rule||typeof E.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=E.rule,x=n.trim();en(!0);try{if(!x){if(!Gt(h,a,u)){Ve(null);return}const z=h.__resolveType??"";d[t]={...E,rule:ks(h,a,u)};const W={...a,[s]:{...o,sections:{...l,variants:d}}};await D.mutateAsync({blockKey:s,data:W[s]}),await kt(z,W),Ve(null),k?.();return}const j=ws(h,a,u);if(!j){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(j.blockKey){await D.mutateAsync({blockKey:j.blockKey,data:Dt(j.resolveType,j.data,x)}),Ve(null),k?.();return}const I=Un(x),P=Yn(I,a,u);if(P){q.error(P);return}const pe=Dt(j.resolveType,j.data,x);let ue=null,be=!1;try{const z=await D.mutateAsync({blockKey:I,data:pe,create:!0});be=qn(z),ue=be?null:I,d[t]={...E,rule:ln(I)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:d}}}),ue=null}catch(z){throw ue&&await Cn.mutateAsync({blockKey:ue}).catch(()=>{}),z}Ve(null),be||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:x})),k?.()}catch(j){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(j))})}finally{en(!1)}},Ko=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(s===null||!l)return;const h=a[s],x=o[s];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=I[t];if(!P?.rule||typeof P.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const pe=P.rule,ue=n.trim();en(!0);const be=async z=>{const W={...j,variants:z},re=[...a];re[s]=Kt(h,x,W);const he=an(i,l,re,E,d);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!ue){if(!Gt(pe,i,u)){nt(null);return}const pt=pe.__resolveType??"",Ze=[...I];Ze[t]={...P,rule:ks(pe,i,u)};const Pt=await be(Ze);await kt(pt,Pt),nt(null),k?.();return}const z=ws(pe,i,u);if(!z){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(z.blockKey){await D.mutateAsync({blockKey:z.blockKey,data:Dt(z.resolveType,z.data,ue)}),nt(null),k?.();return}const W=Un(ue),re=Yn(W,i,u);if(re){q.error(re);return}const he=Dt(z.resolveType,z.data,ue);let Ae=null,sn=!1;try{const pt=await D.mutateAsync({blockKey:W,data:he,create:!0});sn=qn(pt),Ae=sn?null:W;const Ze=[...I];Ze[t]={...P,rule:ln(W)},await be(Ze),Ae=null}catch(pt){throw Ae&&await Cn.mutateAsync({blockKey:Ae}).catch(()=>{}),pt}nt(null),sn||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),k?.()}catch(z){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(z))})}finally{en(!1)}},Pr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Mo={rename:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],d=l?.rule&&typeof l.rule=="object"?l.rule:void 0,E=async x=>{const j={...t,variants:x};return await Pr(a,t,j),{...o,[a]:j}},h=wc(d,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){q.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const I=[...i];I[n]={...l,rule:h.inlinedRule};const P=await E(I);await kt(h.blockKey,P),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let x=null,j=!1;try{const I=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});j=qn(I),x=j?null:h.blockId;const P=[...i];P[n]={...l,rule:h.reference},await E(P),x=null}catch(I){throw x&&await Cn.mutateAsync({blockKey:x}).catch(()=>{}),I}j||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(x))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const d=bt(l.rule,o,u);i[n]={...l,rule:ln(s)};const E={...t,variants:i},h={...o,[a]:E};try{await Pr(a,t,E),d&&d!==s&&await kt(d,h),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(x))})}},selectNamedRule:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;let i=null,l=null;const d=await In(s,o,E=>{const h=Array.isArray(t.variants)?[...t.variants]:[],x=h[n];return x?(i=bt(x.rule,o,u),h[n]={...x,rule:E},l={...t,variants:h},{blockKey:a,data:l}):null});!d||!l||(A(l),i&&await kt(i,d.projected),k?.())}},Kr=()=>{$t()},Mr=t=>{un(t),is({inner:t})},Br=t=>{Nn(t),is({raw:t})},Dr=()=>{un(null),It([])},Fr=()=>Qt(t=>t+1),Ir=()=>{dn.flush(),cn(!1),un(null),Nn(void 0),It([]),Qt(t=>t+1),ge?.()},Bo=()=>{Tn(!1),An(!1),L(null),cn(!0)},Do=()=>{Te&&Ir(),L(null),Tn(!0)},Fo=()=>An(!0),ms=t=>{if(Jt&&t===0){Tn(!1);return}if(Ft&&t<2){An(!1),t===0&&L(null);return}if(Te){if(t===0){Ir();return}if(t===1){It([]),Qt(s=>s+1);return}It(Ps.slice(0,t-1)),Qt(s=>s+1);return}if($){N(O.slice(0,t)),T(s=>s+1);return}if(t===0){Kr();return}if(t===1){N([]),T(s=>s+1);return}const n=!Z&&Nt&&jt?1:0;if(n===1&&t===2){N([]),T(s=>s+1);return}N(O.slice(0,t-1-n))},ps=zn.length>1?r.jsx("button",{type:"button",onClick:()=>ms(ol(zn.length,{isMultivariateSectionTop:No})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ae("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",mt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(dl,{className:"size-4"})}):null,Io=mt||Ct||Te?Ro&&r.jsxs("div",{className:ae("border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!$&&St&&ye&&r.jsxs("button",{type:"button",onClick:Kr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ye.label}),className:ae("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Qi),children:[r.jsx(Ji,{rule:xs(ye.rule,f??{},u??void 0),matchers:nn}),r.jsx("span",{className:"max-w-[160px] truncate",children:ye.label})]}),r.jsx("div",{className:"flex-1"}),mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Rr&&r.jsx(Hn,{onClick:()=>yn()})]}),mt&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr,variant:"header"})}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>cn(!0),children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Oe&&g?Oe():Zn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Hn,{onClick:bn})]}),Lo=r.jsxs(r.Fragment,{children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:Q,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&J!==null&&r.jsx(aa,{className:"mt-3",children:r.jsx("div",{className:ae("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:J,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Wt),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${Q}:${J??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})})]}),Lr=r.jsxs(r.Fragment,{children:[r.jsx(Xi,{listKey:`${g??""}:${m??""}`,variants:At.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:or,onRename:nt,onDuplicate:go,onDelete:ho,onRemoveAll:ir,onReorder:vo,onAdd:()=>yn()}),r.jsx(aa,{children:r.jsx(ys,{currentRt:Xt??"",currentLabel:kn(jt?.rule,f??{},we,u??void 0),currentGlobalKey:bt(jt?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:yo,onSelectGlobal:_o,named:cs(jt?.rule,xo),namedRow:bs(jt?.rule,Wt),rule:jt?.rule,schema:wo,formValue:Ba,onChange:bo,formKey:`${m??"none"}:${Ln}:${Xt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or=r.jsx("div",{className:ae(Z?"px-2":"p-2 pt-3"),children:r.jsx(_c,{listKey:`${g??""}-${Q}`,rawSections:M,sections:ce,meta:u,decofile:f,selectedIndex:m,onSelect:ao,onReorder:oo,onDelete:io,onDuplicate:lo,onMakeReusable:G,onToggleHidden:co,onToggleLazy:ot?uo:void 0,onAddVariant:yn,onDetach:fo,onAddSection:()=>Yt(!0),canAddSection:cr})}),Oo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&se&&r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr}),Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Hs,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),zo=r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Hs,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),$o=r.jsxs(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:Q,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&J!==null&&r.jsxs("div",{className:ae("px-3 border-b",Vn?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Ka(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":Vn,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),Vn?r.jsx(ll,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(cl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Vn&&r.jsx("div",{className:ae("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:J,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Wt),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${Q}:${J??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or]},"editor-section-list");return r.jsx(Zi,{value:_,children:r.jsx(el,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!Z&&ps&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ps}),(Z||zn.length>1)&&r.jsx(tl,{crumbs:zn,onSelect:ms,onSelectRoot:()=>{dn.flush(),Ue?Ue():ms(0)}}),r.jsx("div",{className:"shrink-0",children:Z?r.jsxs("div",{className:ae("flex items-center gap-2 border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[Z&&ps,mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Ao}),Tr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Tr})]}),fs&&St&&ye&&r.jsx(oa,{variants:le,activeIndex:Q,onSelect:hn,onManage:Do,onRemoveAll:Co}),Vo&&r.jsx(oa,{variants:At,activeIndex:Ln,onSelect:or,onManage:Fo,onRemoveAll:ir}),fs&&!St&&r.jsx(Hn,{onClick:bn}),Eo&&r.jsx(Hn,{onClick:()=>yn()}),r.jsx(nl,{}),fs&&r.jsxs(r.Fragment,{children:[r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Bo,children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Oe&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Zn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Io}),dt&&r.jsx(si,{open:!0,fields:ri(dt.plan,dt.target.schema),choices:dt.choices,changedAgain:dt.changedAgain,author:$s??null,authorPending:$s===void 0,fieldsAsLabeled:zs!==null,fresh:dt.fresh,onChoose:(t,n)=>ro({...dt.choices,[t]:n}),onApply:so},Ec(dt.formBase)),Ft?r.jsx(ia,{onAdd:()=>yn(),children:Lr},"editor-section-variants"):Ct?r.jsxs(on,{viewportRef:me,onBlur:Zs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!Z&&Nt&&At.length>0&&O.length===0&&Lr,r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Qe,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar,onVariantMatcherOp:$?Mo:void 0})})})]},"editor-section-form"):$?r.jsx(on,{viewportRef:me,onBlur:Zs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Qe,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar})})})},"editor-global-block"):Te?Z?r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Oo})},"editor-seo"):zo:Jt?r.jsx(ia,{onAdd:bn,children:Lo},"editor-variants"):Z?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Or})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Es,{canAddSection:cr,onAddSection:()=>Yt(!0)})})]},"editor-section-list"):$o,r.jsx(sl,{open:Fe!==null,onOpenChange:t=>{t||G(null)},defaultBlockId:Fe!==null?Un(ce[Fe]?.label??""):"",isPending:D.isPending,onSubmit:So}),it&&r.jsx(nc,{open:Pa,onOpenChange:t=>{Yt(t),t||(En.current=null)},meta:u,decofile:f,previewBaseUrl:at,onSelect:po}),Ts&&g&&f&&r.jsx(El,{open:Ts,onOpenChange:Zn,pageKey:g,decofile:f}),ie!==null&&r.jsx(ua,{open:!0,initialName:Gt(le[ie]?.rule,f??{},u??void 0)?kn(le[ie]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(le[ie]?.rule,f??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Po(ie,t)},onOpenChange:t=>{!t&&!Zt&&Ve(null)}}),Xe!==null&&r.jsx(ua,{open:!0,initialName:Gt(At[Xe]?.rule,f??{},u??void 0)?kn(At[Xe]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(At[Xe]?.rule,f??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Ko(Xe,t)},onOpenChange:t=>{!t&&!Zt&&nt(null)}})]})})})}export{lf as SectionsEditor};
1
+ import{hM as Wo,bh as Ho,c as jn,b as Rn,r as S,l as ae,j as r,bP as qo,bd as Vs,hN as Ra,B as Ut,X as rn,aj as Go,Z as Uo,bg as Yo,Y as Jo,q as Qo,hm as Xo,hO as Zo,hP as ei,bo as xn,h as ti,bi as Rt,hQ as st,hR as Hr,hS as gs,hT as ni,hU as qr,hV as si,bv as ri,hW as ai,hX as Gr,hY as oi,t as q,bY as Ur,hZ as ii,h_ as Kt,h$ as li,i0 as ci,i1 as ui,bX as Yr,i2 as vs,i3 as di,i4 as fi,i5 as mi,bV as pi,bw as hi,i6 as gi,i7 as vi,bS as Si,f7 as yi,K as bi,bt as Jr,i8 as Qr,i9 as xi,ia as _i,ib as ki,ic as Ss,id as wi,ie as ji,ig as Ri,ih as Ei,bQ as Xr,ii as Vi,ij as Ti,ik as Zr,il as Ai,bU as Ni}from"./index-CZa3eyGb.js";import{u as Ci}from"./chat-context-B-EalrGD.js";import{a2 as Pi,K as Xn,a3 as Ki,a4 as Mi,a5 as Bi,a6 as Di,a7 as Fi,a8 as Ii,a9 as ea,aa as Li,ab as Oi,z as Un,x as Yn,d as zi,u as $i,ac as ta,i as Wi,ad as Hi,k as qi,h as Gi,ae as Ea,af as Ui,ag as Yi,v as na,ah as Ji,ai as Qi,aj as Hn,ak as sa,al as ra,am as aa,an as ys,ao as Xi,D as Zi,ap as el,y as tl,aq as oa,ar as nl,as as ia,at as la,au as ca,M as sl,av as ua,a as rl,aw as an,ax as al,ay as ol,t as qn,az as _n}from"./held-block-view-CMM-oPyn.js";import{c as il}from"./repository-binding-Kf_PGfSt.js";import{n as ll,t as cl}from"./ChevronUp-bhjMH6tk.js";import{aa as Va,b as Qn,ap as ul,H as dl,a4 as da,a0 as fa}from"./agent-icon-D9Dw0iKh.js";import{S as on}from"./scroll-area-tGpLyLX1.js";import{c as Et,T as Vt,a as Tt}from"./tooltip-CzDCGEIi.js";import{l as fl,u as ml,m as pl,D as hl,_ as gl,B as vl,aa as Mt,ab as Bt,K as Sl,ax as ma,N as yl,W as bl}from"./site-editor-toast-BzM8F-5I.js";import{u as xl,X as _l,E as bs,Y as pa,A as kl,Z as wl}from"./blocks-tab-states-3dDtGXkD.js";import{m as jl,u as Rl,P as El}from"./mustache-Bz1-fywO.js";import{Z as Gt,O as ks,ax as ws,_ as Dt,P as ln,e as Vl,c as Tl,w as Al,k as Gn,p as wn,a1 as Nl,X as qt,Q as xs,W as bt,V as kn,C as Cl,$ as ha,Y as Pl,ag as Kl,ai as Ml,ay as Bl,az as Dl,aA as Fl}from"./parse-sections-oc95T4h7.js";import{a as Il}from"./Copy01-BQVKjs--.js";import{a as js,e as Ta}from"./UserSquare-C3P5-DPf.js";import{i as ga}from"./Tool01-DZBBNle2.js";import{s as va}from"./Image01-Ca2zoOmL.js";import{s as Ll}from"./Plus-cZACl5Bj.js";import{s as Ol}from"./Trash01-DAL2eWYn.js";import{i as Rs}from"./ZoomOut-I9ktV8DJ.js";import{u as zl,a as Sa,K as $l,P as Wl,b as Hl,C as ql,D as Gl,c as Ul}from"./core.esm-9HSn5uPZ.js";import{u as Yl,s as Jl,a as Jn,S as Ql,v as Xl}from"./sortable.esm-DXFyyTP0.js";import{s as Zl,g as ec,u as tc,A as nc}from"./use-section-preview-base-YJjHRtUw.js";import{a as sc,P as ya,w as rc,b as ac}from"./page-seo-form-Ce_NK10C.js";import{u as oc}from"./use-apply-named-rule-CvK-hhnp.js";import{b as ba,a as ic}from"./variant-matcher-override-e7d1QuAB.js";import{c as xa,d as lc,e as cc}from"./variant-draft-pointer-BeAKcq_c.js";import"./use-panel-navigate-zL6feX1_.js";import"./thread-route-D-HTU4ms.js";import"./use-project-scope-DtQCf5X8.js";import"./autosend-Lp9Ownww.js";import"./thread-intent-BAvAvKIG.js";import"./use-mcp-client-CgMd9iAw.js";import"./auth-BZRl-fvJ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BvCNV0KD.js";import"./task-board-BCtRCz9S.js";import"./schema-DzkQww7V.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-C6Ht-NxL.js";import"./use-ai-providers-ZqKycOYQ.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-y-0WXno1.js";import"./utils-DTNHEqVe.js";import"./Play-gY_w5wGM.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DdbYjyQ3.js";import"./LinkBroken01-DbRdGmca.js";import"./collapsible-IxpT7xWi.js";import"./use-copy-BkKCeyGC.js";import"./usage-stats-B-bDSRFu.js";import"./tool-namespace-BCj-Y0g5.js";import"./form-sdJe6ZVI.js";import"./label-D_y7huPi.js";import"./utils-CVEq3hMx.js";import"./markdown-DRSNNxww.js";import"./use-mobile-CmqrzeQ2.js";import"./use-clock-tick-BM5p8P79.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-kU5GlIYH.js";import"./types-BEPRfygK.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./AlertCircle-X-2ynYTr.js";import"./XClose-B7VCNh_p.js";import"./ShoppingBag01-CIHcZyoe.js";import"./SearchMd-B3lyjcge.js";import"./shell-layout-CNGrbelx.js";import"./Building02-CmwS_4Zd.js";import"./CheckCircle-K7QKF0ga.js";import"./Monitor01-CfX8nvtP.js";import"./command-DHvjfMO5.js";import"./index-5Rxgh8df.js";import"./integration-icon-Dg-0enaK.js";import"./project-icon-PZVlAu2D.js";import"./new-project-dialog-Dw5AGC0_.js";import"./ArrowLeft-D5rLbzEv.js";import"./repository-import-picker-DoXIwk7w.js";import"./use-navigate-to-agent-BxC330Nu.js";import"./repository-picker-Ck8gOK4_.js";import"./useInfiniteQuery-BLBwQpXr.js";import"./infiniteQueryObserver-Bj1XK-s-.js";import"./collection-search-4jrHPH5z.js";import"./use-debounced-value-DE8_aoyE.js";import"./required-auth-layout-Cex5NCBT.js";import"./use-org-sso-BjyMvUUZ.js";import"./sheet-BeB7fiX7.js";import"./use-connection-C6xnl_pH.js";import"./Link01-CKgU9XrQ.js";import"./use-mcp-prompts-QvvUKN0H.js";import"./use-thread-outputs-DQFZK-8V.js";import"./file-type-icon-DBRx3EE8.js";import"./section-array-field-CLj6DiG4.js";import"./alert-CzMP0em5.js";import"./switch-Ba2Gsd2l.js";import"./textarea-CTXOHUAm.js";import"./ChevronSelectorVertical-8Zglhuwj.js";import"./popover-BLArxJjU.js";import"./monaco-editor-hax50RkV.js";import"./editor-BdrieXEx.js";import"./calendar-H7tEy9sl.js";import"./SwitchHorizontal01-C4b3q3_P.js";import"./Minus-DbFMOQp2.js";import"./select-Dh0RDXSe.js";import"./index-BdQq_4o_.js";import"./index-CJkX47-N.js";import"./editor-classes-ByAE0Rcb.js";import"./toggle-group-B38pdvYb.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-D60tpxva.js";import"./Upload01-3A7TgOQk.js";import"./DotsVertical-D0yivq6N.js";import"./search-input-l1Nxf0a9.js";import"./tabs-C46_2gJf.js";import"./use-file-configs-DTUQ5Hig.js";import"./asset-utils-KcjmG-m6.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./use-session-runtime-B1BjekR-.js";import"./sandbox-git-api-CH_-QFpD.js";import"./sandbox-url-D3mC8qhT.js";import"./ArrowUp-D5ujBFbU.js";import"./CreditCard01-DLuzN9Da.js";import"./Globe04-Do87jSl8.js";import"./Key01-B22TaZal.js";import"./Sun-BQHZ8KXH.js";import"./Users01-CbJgTvJT.js";import"./experiments-tab-choice-zawYDgsX.js";import"./use-sandbox-events-BkrPzSJm.js";import"./slider-BEIpzaR7.js";import"./index-D47oPuzS.js";import"./tooltipContext-BmuFpL8F.js";import"./CategoricalChart-BXV8ybtn.js";import"./index-DXZflUD0.js";import"./ActiveShapeUtils-CfDf2bdI.js";import"./Sector-tGFgbjWQ.js";import"./symbol-DhVs0bZH.js";import"./empty-state-Cmr3S21S.js";import"./section-preview-url-7zfngvgW.js";import"./use-move-blocks-CZU-bgYZ.js";const uc={escape:Pi};function dc(v,e){for(const p of Zl(v,e)){const y=typeof p.title=="string"?p.title:void 0;if(y?.includes("{{"))return y}}function fc(v,e){if(!e)return;const p=Wo(v,Ho(e));if(p)try{const y=dc(p.resolveType,e);return y&&jl.render(y,p.data,{},uc).trim()||void 0}catch{return}}function mc(v){const e=jn.c(13),{icon:p,label:y,className:b}=v;let V;e[0]!==b?(V=ae("size-3.5",b),e[0]=b,e[1]=V):V=e[1];let B;e[2]!==p||e[3]!==V?(B=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=B):B=e[4];let w;e[5]!==y||e[6]!==B?(w=r.jsx(Vt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":y,className:"shrink-0 cursor-help",children:B})}),e[5]=y,e[6]=B,e[7]=w):w=e[7];let K;e[8]!==y?(K=r.jsx(Tt,{className:"max-w-56",children:y}),e[8]=y,e[9]=K):K=e[9];let k;return e[10]!==w||e[11]!==K?(k=r.jsxs(Et,{children:[w,K]}),e[10]=w,e[11]=K,e[12]=k):k=e[12],k}const pc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function _a(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Aa(v){return v.map((e,p)=>({...e,index:p}))}function hc(v,e){if(e===v.length)return v;if(e<v.length)return Aa(v.slice(0,e));const p=Array.from({length:e-v.length},(y,b)=>({id:crypto.randomUUID(),index:v.length+b}));return[...v,...p]}function Na(v){const e=jn.c(44),{section:p,raw:y,meta:b,decofile:V}=v,B=Rn(),w=Xn(),K=p.isSavedBlock===!0,k=p.isMultivariate===!0;let X;e[0]!==b||e[1]!==y?(X=y&&b?ec(y,b):void 0,e[0]=b,e[1]=y,e[2]=X):X=e[2];const ge=X;let Ue;e[3]!==b||e[4]!==k||e[5]!==y||e[6]!==K?(Ue=y&&b&&!K&&!k?fc(y,b):void 0,e[3]=b,e[4]=k,e[5]=y,e[6]=K,e[7]=Ue):Ue=e[7];const Oe=Ue;let Ne;e[8]!==V||e[9]!==b||e[10]!==y||e[11]!==p?(Ne=Ii(y,p,V,b),e[8]=V,e[9]=b,e[10]=y,e[11]=p,e[12]=Ne):Ne=e[12];const oe=Ne;let R;e[13]!==k||e[14]!==y?.__resolveType?(R=!k&&Vs(y?.__resolveType??""),e[13]=k,e[14]=y?.__resolveType,e[15]=R):R=e[15];const c=R,xe=K?Qn:k?Va:Ta;let U;e[16]!==k||e[17]!==K?(U=K?{color:Yo}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=K,e[18]=U):U=e[18];const _e=U;let F;e[19]!==xe||e[20]!==w?(F=w?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(Oi,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(ul,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=w,e[21]=F):F=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let f;e[24]!==w||e[25]!==_e?(f=!w&&r.jsx(js,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=w,e[25]=_e,e[26]=f):f=e[26];const ze=w?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Re;e[27]!==u||e[28]!==ze?(Re=ae("min-w-0 truncate text-sm font-medium",ze,u),e[27]=u,e[28]=ze,e[29]=Re):Re=e[29];const Z=Oe??p.label;let $e;e[30]!==Re||e[31]!==Z?($e=r.jsx("span",{className:Re,children:Z}),e[30]=Re,e[31]=Z,e[32]=$e):$e=e[32];let rt;e[33]!==c||e[34]!==w||e[35]!==oe||e[36]!==B?(rt=w?r.jsxs(r.Fragment,{children:[c&&r.jsx(mc,{icon:Rs,label:B("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),oe&&r.jsx(ea,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):oe&&r.jsx(ea,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=w,e[35]=oe,e[36]=B,e[37]=rt):rt=e[37];let Ce;return e[38]!==$e||e[39]!==rt||e[40]!==F||e[41]!==ke||e[42]!==f?(Ce=r.jsxs(r.Fragment,{children:[F,ke,f,$e,rt]}),e[38]=$e,e[39]=rt,e[40]=F,e[41]=ke,e[42]=f,e[43]=Ce):Ce=e[43],Ce}const gc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",vc="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function Ca(v,e,p){if(p)return Li({selected:e});const y=v.isSavedBlock===!0,b=v.isMultivariate===!0;return ae("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":y?gc:b?vc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function _s(v,e){return ae("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Sc(v){const e=jn.c(90),{section:p,raw:y,meta:b,decofile:V,sortableId:B,selected:w,onSelect:K,onDelete:k,onDuplicate:X,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Oe,onAddVariant:Ne,onDetach:oe}=v,R=Rn(),c=Xn(),xe=y?Vs(y.__resolveType??""):!1,U=p.isHidden===!0,_e=xe||U;let F;e[0]!==p?(F=Ra(p),e[0]=p,e[1]=F):F=e[1];const ke=F,f=!!Oe&&!p.isMultivariate;let ze;e[2]!==B?(ze={id:B,animateLayoutChanges:xc},e[2]=B,e[3]=ze):ze=e[3];const{attributes:u,listeners:Re,setNodeRef:Z,transform:$e,isDragging:rt}=Yl(ze);let Ce;e[4]!==$e?(Ce=ql.Transform.toString($e?{...$e,x:0}:null),e[4]=$e,e[5]=Ce):Ce=e[5];const at=rt?0:void 0;let Pe;e[6]!==Ce||e[7]!==at?(Pe={transform:Ce,opacity:at},e[6]=Ce,e[7]=at,e[8]=Pe):Pe=e[8];const _=Pe;let we;e[9]!==p?(we=Mi(p),e[9]=p,e[10]=we):we=e[10];const ot=we,it="button",m=0;let L;e[11]!==K?(L=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),K())},e[11]=K,e[12]=L):L=e[12];const et=rt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==w||e[16]!==et?(A=ae("touch-none transition-colors",et,Ca(p,w,c)),e[13]=c,e[14]=p,e[15]=w,e[16]=et,e[17]=A):A=e[17];let Ye;e[18]!==V||e[19]!==b||e[20]!==y||e[21]!==p?(Ye=r.jsx(Na,{section:p,raw:y,meta:b,decofile:V}),e[18]=V,e[19]=b,e[20]=y,e[21]=p,e[22]=Ye):Ye=e[22];const H=!c&&f&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ae(_s(_e,xe)),onClick:T=>{T.stopPropagation(),Oe?.()},onPointerDown:bc,children:r.jsx(Rs,{className:ae("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Tt,{side:"bottom",children:R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),lt=c?r.jsx(Bi,{label:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:U,onToggle:Ue,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})}):r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon","aria-label":R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ae(_s(_e,U)),onClick:T=>{T.stopPropagation(),Ue()},onPointerDown:yc,children:U?r.jsx(ga,{className:"h-3.5 w-3.5"}):r.jsx(va,{className:"h-3.5 w-3.5"})})}),r.jsx(Tt,{side:"bottom",children:R(U?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=Uo,Je=Di;let ve;e[23]!==R?(ve=R("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=R,e[24]=ve):ve=e[24];const ct=ae(_s(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let We;e[25]!==Je||e[26]!==ve||e[27]!==ct?(We=r.jsx(Je,{label:ve,classicClassName:ct}),e[25]=Je,e[26]=ve,e[27]=ct,e[28]=We):We=e[28];let Ee;e[29]!==c||e[30]!==f||e[31]!==xe||e[32]!==Oe||e[33]!==R?(Ee=c&&f&&r.jsxs(r.Fragment,{children:[r.jsxs(rn,{onClick:T=>{T.stopPropagation(),Oe?.()},children:[r.jsx(Rs,{className:"h-4 w-4"}),R(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(Go,{})]}),e[29]=c,e[30]=f,e[31]=xe,e[32]=Oe,e[33]=R,e[34]=Ee):Ee=e[34];let Ke;e[35]!==X?(Ke=T=>{T.stopPropagation(),X()},e[35]=X,e[36]=Ke):Ke=e[36];let tt;e[37]===Symbol.for("react.memo_cache_sentinel")?(tt=r.jsx(Il,{className:"h-4 w-4"}),e[37]=tt):tt=e[37];let Me;e[38]!==R?(Me=R("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=R,e[39]=Me):Me=e[39];let Be;e[40]!==Ke||e[41]!==Me?(Be=r.jsxs(rn,{onClick:Ke,children:[tt,Me]}),e[40]=Ke,e[41]=Me,e[42]=Be):Be=e[42];let De;e[43]!==c||e[44]!==ke||e[45]!==Ne||e[46]!==R?(De=ke&&r.jsxs(rn,{className:ae(!c&&Fi),onClick:T=>{T.stopPropagation(),Ne()},children:[r.jsx(Va,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ne,e[46]=R,e[47]=De):De=e[47];let Y;e[48]!==c||e[49]!==ot||e[50]!==ge||e[51]!==R?(Y=ot&&r.jsxs(rn,{className:ae(!c&&pc),onClick:T=>{T.stopPropagation(),ge()},children:[c?r.jsx(Qn,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=ot,e[50]=ge,e[51]=R,e[52]=Y):Y=e[52];let J;e[53]!==c||e[54]!==oe||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==R?(J=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(rn,{onClick:T=>{T.stopPropagation(),oe()},children:[c?r.jsx(Ta,{className:"h-4 w-4"}):r.jsx(js,{className:"h-4 w-4"}),R("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=oe,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=R,e[58]=J):J=e[58];let ee;e[59]!==k?(ee=T=>{T.stopPropagation(),k()},e[59]=k,e[60]=ee):ee=e[60];let O;e[61]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(Ol,{className:"h-4 w-4"}),e[61]=O):O=e[61];let N;e[62]!==R?(N=R("sectionsEditor.sectionList.deleteMenuItem"),e[62]=R,e[63]=N):N=e[63];let me;e[64]!==ee||e[65]!==N?(me=r.jsxs(rn,{variant:"destructive",onClick:ee,children:[O,N]}),e[64]=ee,e[65]=N,e[66]=me):me=e[66];let He;e[67]!==Ee||e[68]!==Be||e[69]!==De||e[70]!==Y||e[71]!==J||e[72]!==me?(He=r.jsxs(Jo,{align:"end",className:"w-44",children:[Ee,Be,De,Y,J,me]}),e[67]=Ee,e[68]=Be,e[69]=De,e[70]=Y,e[71]=J,e[72]=me,e[73]=He):He=e[73];let qe;e[74]!==fe||e[75]!==We||e[76]!==He?(qe=r.jsxs(fe,{children:[We,He]}),e[74]=fe,e[75]=We,e[76]=He,e[77]=qe):qe=e[77];let Qe;return e[78]!==u||e[79]!==Re||e[80]!==K||e[81]!==Z||e[82]!==_||e[83]!==A||e[84]!==Ye||e[85]!==H||e[86]!==lt||e[87]!==qe||e[88]!==L?(Qe=r.jsxs("div",{ref:Z,style:_,...u,...Re,role:it,tabIndex:m,onClick:K,onKeyDown:L,className:A,children:[Ye,H,lt,qe]}),e[78]=u,e[79]=Re,e[80]=K,e[81]=Z,e[82]=_,e[83]=A,e[84]=Ye,e[85]=H,e[86]=lt,e[87]=qe,e[88]=L,e[89]=Qe):Qe=e[89],Qe}function yc(v){return v.stopPropagation()}function bc(v){return v.stopPropagation()}function xc(){return!1}function Es(v){const e=jn.c(11),{canAddSection:p,onAddSection:y,className:b,size:V}=v,B=Rn();let w;e[0]!==b?(w=ae("w-full",b),e[0]=b,e[1]=w):w=e[1];const K=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ll,{size:14}),e[2]=k):k=e[2];let X;e[3]!==B?(X=B("sectionsEditor.sectionList.addSectionButton"),e[3]=B,e[4]=X):X=e[4];let ge;return e[5]!==y||e[6]!==V||e[7]!==w||e[8]!==K||e[9]!==X?(ge=r.jsxs(Ut,{type:"button",variant:"outline",size:V,className:w,disabled:K,onClick:y,children:[k,X]}),e[5]=y,e[6]=V,e[7]=w,e[8]=K,e[9]=X,e[10]=ge):ge=e[10],ge}function _c(v){const e=jn.c(101),{listKey:p,rawSections:y,sections:b,meta:V,decofile:B,selectedIndex:w,onSelect:K,onReorder:k,onDelete:X,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Oe,onToggleLazy:Ne,onAddVariant:oe,onDetach:R,onAddSection:c,canAddSection:xe}=v,U=xe===void 0?!0:xe,_e=Rn(),F=Xn();let ke;e[0]!==b.length?(ke=()=>_a(b.length),e[0]=b.length,e[1]=ke):ke=e[1];const[f,ze]=S.useState(ke),[u,Re]=S.useState(null),[Z,$e]=S.useState(p),[rt,Ce]=S.useState(b.length),at=S.useRef(!1);Z!==p?($e(p),Ce(b.length),ze(_a(b.length))):rt!==b.length&&(Ce(b.length),ze(Fe=>hc(Fe,b.length)));let Pe;e[2]===Symbol.for("react.memo_cache_sentinel")?(Pe={activationConstraint:{distance:8}},e[2]=Pe):Pe=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={coordinateGetter:Jl},e[3]=_):_=e[3];const we=zl(Sa(Wl,Pe),Sa($l,_));let ot;e[4]!==f?(ot=f.map(kc),e[4]=f,e[5]=ot):ot=e[5];const it=ot;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=Fe=>{Re(String(Fe.active.id))},e[6]=m):m=e[6];const L=m;let et;e[7]!==it||e[8]!==k?(et=Fe=>{Re(null);const{active:G,over:ie}=Fe;if(!ie||G.id===ie.id)return;const Ve=it.indexOf(String(G.id)),Xe=it.indexOf(String(ie.id));Ve===-1||Xe===-1||(ze(nt=>Aa(Jn([...nt],Ve,Xe))),at.current=!0,requestAnimationFrame(()=>{at.current=!1}),k?.(Ve,Xe))},e[7]=it,e[8]=k,e[9]=et):et=e[9];const A=et;let Ye;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ye=()=>{Re(null)},e[10]=Ye):Ye=e[10];const H=Ye;let lt,fe,Je,ve,ct,We,Ee,Ke,tt,Me,Be,De,Y,J,ee;if(e[11]!==u||e[12]!==U||e[13]!==F||e[14]!==B||e[15]!==f||e[16]!==it||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==oe||e[21]!==X||e[22]!==R||e[23]!==ge||e[24]!==Ue||e[25]!==K||e[26]!==Oe||e[27]!==Ne||e[28]!==y||e[29]!==b||e[30]!==w||e[31]!==we||e[32]!==_e){J=Symbol.for("react.early_return_sentinel");e:{const Fe=G=>{at.current||K(G)};if(e[48]!==u||e[49]!==U||e[50]!==F||e[51]!==f||e[52]!==c||e[53]!==y||e[54]!==b||e[55]!==_e){const G=u?f.find(ie=>ie.id===u):null;if(ve=G!=null?b[G.index]:null,Je=G!=null?y[G.index]:void 0,f.length===0){let ie;e[59]!==_e?(ie=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=ie):ie=e[60];let Ve;e[61]!==ie?(Ve=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:ie}),e[61]=ie,e[62]=Ve):Ve=e[62];const Xe=Ve;let nt;e[63]!==U||e[64]!==F||e[65]!==Xe||e[66]!==c?(nt=F?Xe:r.jsxs("div",{className:"space-y-2",children:[Xe,r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm"})]}),e[63]=U,e[64]=F,e[65]=Xe,e[66]=c,e[67]=nt):nt=e[67],J=nt;break e}Y=ae(G&&"cursor-grabbing"),e[48]=u,e[49]=U,e[50]=F,e[51]=f,e[52]=c,e[53]=y,e[54]=b,e[55]=_e,e[56]=Je,e[57]=ve,e[58]=Y}else Je=e[56],ve=e[57],Y=e[58];fe=Gl,Ke=we,tt=Ul,Me=L,Be=A,De=H,lt=Ql,We=it,Ee=Xl,ee="space-y-1",ct=f.map(G=>{const ie=b[G.index];return ie?r.jsx(Sc,{sortableId:G.id,section:ie,raw:y[G.index],meta:V,decofile:B,selected:w===G.index,onSelect:()=>Fe(G.index),onDelete:()=>X(G.index),onDuplicate:()=>ge(G.index),onMakeReusable:()=>Ue(G.index),onToggleHidden:()=>Oe(G.index),onToggleLazy:Ne?()=>Ne(G.index):void 0,onAddVariant:()=>oe(G.index),onDetach:()=>R(G.index)},G.id):null})}e[11]=u,e[12]=U,e[13]=F,e[14]=B,e[15]=f,e[16]=it,e[17]=A,e[18]=V,e[19]=c,e[20]=oe,e[21]=X,e[22]=R,e[23]=ge,e[24]=Ue,e[25]=K,e[26]=Oe,e[27]=Ne,e[28]=y,e[29]=b,e[30]=w,e[31]=we,e[32]=_e,e[33]=lt,e[34]=fe,e[35]=Je,e[36]=ve,e[37]=ct,e[38]=We,e[39]=Ee,e[40]=Ke,e[41]=tt,e[42]=Me,e[43]=Be,e[44]=De,e[45]=Y,e[46]=J,e[47]=ee}else lt=e[33],fe=e[34],Je=e[35],ve=e[36],ct=e[37],We=e[38],Ee=e[39],Ke=e[40],tt=e[41],Me=e[42],Be=e[43],De=e[44],Y=e[45],J=e[46],ee=e[47];if(J!==Symbol.for("react.early_return_sentinel"))return J;let O;e[68]!==ct||e[69]!==ee?(O=r.jsx("div",{className:ee,children:ct}),e[68]=ct,e[69]=ee,e[70]=O):O=e[70];let N;e[71]!==lt||e[72]!==We||e[73]!==Ee||e[74]!==O?(N=r.jsx(lt,{items:We,strategy:Ee,children:O}),e[71]=lt,e[72]=We,e[73]=Ee,e[74]=O,e[75]=N):N=e[75];let me;e[76]!==Je||e[77]!==ve||e[78]!==F||e[79]!==B||e[80]!==V?(me=ve?r.jsx("div",{className:ae("cursor-grabbing shadow-lift",Ca(ve,!1,F)),children:r.jsx(Na,{section:ve,raw:Je,meta:V,decofile:B})}):null,e[76]=Je,e[77]=ve,e[78]=F,e[79]=B,e[80]=V,e[81]=me):me=e[81];let He;e[82]!==me?(He=qo.createPortal(r.jsx(Hl,{dropAnimation:Ki,children:me}),document.body),e[82]=me,e[83]=He):He=e[83];let qe;e[84]!==fe||e[85]!==Ke||e[86]!==tt||e[87]!==Me||e[88]!==Be||e[89]!==De||e[90]!==N||e[91]!==He?(qe=r.jsxs(fe,{sensors:Ke,collisionDetection:tt,onDragStart:Me,onDragEnd:Be,onDragCancel:De,children:[N,He]}),e[84]=fe,e[85]=Ke,e[86]=tt,e[87]=Me,e[88]=Be,e[89]=De,e[90]=N,e[91]=He,e[92]=qe):qe=e[92];let Qe;e[93]!==U||e[94]!==F||e[95]!==c?(Qe=!F&&r.jsx(Es,{canAddSection:U,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=U,e[94]=F,e[95]=c,e[96]=Qe):Qe=e[96];let T;return e[97]!==Y||e[98]!==qe||e[99]!==Qe?(T=r.jsxs("div",{className:Y,children:[qe,Qe]}),e[97]=Y,e[98]=qe,e[99]=Qe,e[100]=T):T=e[100],T}function kc(v){return v.id}function wc(v,e,p,y){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const b=e.trim();if(!b)return Gt(v,p,y)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:ks(v,p,y)}:{kind:"noop"};const V=ws(v,p,y);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Dt(V.resolveType,V.data,b)};const B=Un(b),w=Yn(B,p);return w?{kind:"error",reason:"invalid-block-id",message:w}:{kind:"createBlock",blockId:B,blockData:Dt(V.resolveType,V.data,b),reference:ln(B)}}const ka="section-form-stale-save",jc=3;function wa(v,e,p){const y=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Ea(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),b=Math.max(0,Math.min(e.pageVariantIndex,y.length-1)),V=y[b]?.sections??[];return{pageVariants:y,variantIndex:b,rawSections:V,parsedSections:wn(V,v,p)}}const ja=new WeakMap;let Rc=0;function Ec(v){let e=ja.get(v);return e===void 0&&(e=++Rc,ja.set(v,e)),e}function lf({orgSlug:v,virtualMcpId:e,branch:p,previewReady:y=!0,previewUrl:b,currentPath:V,activePageBlockKey:B=null,activeGlobalBlockKey:w=null,externalSelection:K,onSaved:k,initialEditSeo:X=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Oe,onFocusedBlockChange:Ne,onVariantPreviewOverride:oe,focusVariant:R}){const c=Rn(),xe=Ci(),U=xe?.taskId??null,_e=y?{orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:b}:null,[F,ke]=S.useState([]),{data:f,isLoading:ze}=fl(_e,{pollWhile:F.length>0}),{data:u,isLoading:Re}=xl(_e),Z=Xn(),$e=xe?.virtualMcpId,Ce=il($e===e?e:null)?.metadata?.siteSlug??null,at=tc({virtualMcpId:e,branch:p,sandboxUrl:b}),Pe=ml(e,p),_=pl(Pe),we=Si(_),ot=!_,it=!!at||_,[m,L]=S.useState(null),[et,A]=S.useState(null),[Ye,H]=S.useState(null),[lt,fe]=S.useState(0),[Je,ve]=S.useState(void 0),[ct,We]=S.useState(null),[Ee,Ke]=S.useState(null);R&&R.seq!==ct&&(We(R.seq),Ke(R));const[tt,Me]=S.useState(null),Be={index:tt,remember:Me},[De,Y]=S.useState(null),[J,ee]=S.useState(null),[O,N]=S.useState([]),me=S.useRef(null),[He,qe]=S.useState(O.length);He!==O.length&&(qe(O.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[Qe,T]=S.useState(0),[Fe,G]=S.useState(null),[ie,Ve]=S.useState(null),[Xe,nt]=S.useState(null),[Pa,Yt]=S.useState(!1),[Ts,Zn]=S.useState(!1),En=S.useRef(null),[Vn,Ka]=S.useState(!0),[Jt,Tn]=S.useState(!1),[Ft,An]=S.useState(!1),[Te,cn]=S.useState(X),[As,Ns]=S.useState(X);X&&!As&&(Ns(!0),cn(!0),L(null),A(null),H(null),N([])),!X&&As&&Ns(!1);const[Ma,un]=S.useState(null),[Cs,Nn]=S.useState(void 0),[Ps,It]=S.useState([]),[Ks,Qt]=S.useState(0),[Ie,ut]=S.useState(0),[Ba,Le]=S.useState(null),[Xt,Ge]=S.useState(null),[Ms,Bs]=S.useState(null),Ds=Qo(),Fs=hl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),dn=zi({orgSlug:v,virtualMcpId:e,branch:p}),[Da,Fa]=S.useState(V),[Ia,La]=S.useState(B),[Oa,za]=S.useState(w);(Da!==V||Ia!==B||Oa!==w)&&(queueMicrotask(()=>dn.flush()),Fa(V),La(B),za(w),L(null),A(null),H(null),fe(0),Y(null),ee(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1),cn(!1),un(null),Nn(void 0),It([]),Qt(t=>t+1));const D=$i({orgSlug:v,virtualMcpId:e,branch:p}),fn=rl((t,n)=>{D.mutate({blockKey:t,data:n},{onSuccess:()=>k?.(),onError:D.reportError})}),Cn=Rl({orgSlug:v,virtualMcpId:e,branch:p}),Is=oc({orgSlug:v,virtualMcpId:e,branch:p}),[Zt,en]=S.useState(!1),C=S.useRef(null),wt=S.useRef(null),gt=S.useRef(null),vt=S.useRef(null),Pn=S.useRef({}),Lt=S.useRef(null),mn=S.useRef(!1),pn=S.useRef(!1),Se=S.useRef(new Map),tn=S.useRef(!1),xt=S.useRef([]),es=S.useRef(new WeakSet);gl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:a,selectedSectionIndex:o}=ne.current,i=new Set;n&&i.add(n);for(const l of[wt.current?.sectionIndex,o]){const d=l==null?void 0:s[l],E=l==null?void 0:a[l],h=d&&E?.isSavedBlock?Ss(d,E):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[C,gt,vt])l.current&&clearTimeout(l.current),l.current=null;wt.current=null,Se.current.clear(),n&&t.has(n)&&(Pn.current={})}});const ne=S.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Ls,Os]=S.useState(0),[$a,Wa]=S.useState(0),zs=Xo(Pe,{orgSlug:v,virtualMcpId:e,branch:p}),$s=Zo(zs,F[0]?.blockKey??null,F[0]?ei(xn(F[0].plan.theirs)):null),[Ha,qa]=S.useState(null),ts=vl(v,e).epoch,[Ga,Ua]=S.useState(ts);if(!y||ze||Re)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(ti,{className:"size-5 text-muted-foreground"})});if(!f||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ya=Vl(f,u),$=!!w,se=$?null:Tl(Ya,V,B),g=$?w:se?.key??null,Kn=$&&w?f[w]:void 0,Ws=$&&w&&Kn?Al(w,Kn):$&&w?w:"",Ot=!$&&g&&f[g]?f[g]:null,ns=Te&&f&&u&&g&&se?ta(f,{kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},u):null,Ja=Te?Ot?.seo:void 0,Mn=Cs!==void 0?Cs:Ja,Qa=Te?Wi(Mn):void 0,Hs=ns?.seoTypeOptions??[],qs=Te&&u?Hi(u):"",ss=Ma??Qa??{},Bn=Te&&ns?sc(ss,ns):null,Gs=Te&&Bn&&qi(Mn)?Gn(Bn,u):null,Us=Te?Gi(f,u)?.seoData:void 0,le=$?[{label:"Default",sections:[{__resolveType:w}]}]:Ea(Ot?.sections,f??{},_),St=le.length>1,Q=Math.min(lt,le.length-1),ye=le[Q],M=ye?.sections??[],ce=wn(M,f,_),Dn=!$&&Nl(Ot?.sections,_);if($&&w&&Ms!==w){Bs(w);const t=M[0],n=ce[0];if(t&&n){L(0),ut(0),N([]);const s=Rt(t,n,f,_);s&&(A(s.data),H(s.resolveType),Ge(null),Le(null))}}!$&&Ms!==null&&Bs(null),ne.current={rawSections:M,parsedSections:ce,decofile:f??{},activePageKey:g,pageVariants:le,variantIndex:Q,sectionVariantIndex:Ie,selectedSectionIndex:m};const Xa=()=>({multivariate:Dn,index:Q,variants:le.map(t=>({rule:t.rule})),lazyValues:_&&Dn&&yi(Ot?.sections?.variants?.[Q]?.value)}),rs=(t,n)=>{if(!oe)return;if(!g||!Dn||t.length<=1){oe(null);return}const s={multivariate:!0,index:n,variants:t},a=_?xa(g,s):ba(g,s,f,u);oe(a.length>0?a:null)},as=oe&&g&&Dn&&St&&!ze&&!Re?g:null;if(as!==Ha&&(qa(as),as)){const t=le.map(s=>({rule:s.rule})),n=Q;queueMicrotask(()=>rs(t,n))}const zt=(t,n,s)=>{if(!oe)return;if(!g){oe(null);return}const a=Xa(),o=_?xa(g,a):ba(g,a,f,u);if(!t||n<0){oe(o.length>0?o:null);return}const i={pageKey:g,page:a,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=_?lc(i):ic({...i,decofile:f,meta:u}),d=_?cc(o,l):[...o,...l];oe(d.length>0?d:null)},_t=(t,n,s,a=m??-1,o=!1)=>{const i=st(t,n);if(!i){A(null),H(null),Ge(null),Le(null),o&&zt(null,a,s);return}const d=qr(i,we)[s];if(!d){A(null),H(null),Ge(null),Le(null),o&&zt(null,a,s);return}const E=ai(d.value,f);A(E?.data??null),H(E?.resolveType??null);const{resolveType:h,formValue:x}=qt(d.rule,f,u??void 0);Ge(h),Le(x),o&&zt(i,a,s)},hn=t=>{Ve(null),fe(t),L(null),A(null),H(null),N([]);const n=le[t]?.rule,{resolveType:s,formValue:a}=qt(n,f??{},u??void 0);ee(s),Y(a),rs(le.map(o=>({rule:o.rule})),t)},Ys=(t,n)=>{const s=M[t],a=ce[t];if(!s||!a)return!1;const o=a.isMultivariate?st(s,a)?.variants?.length??0:0,i=n<o?n:0;if(L(t),ut(i),N([]),T(l=>l+1),a.isMultivariate)_t(s,a,i,t);else{const l=Rt(s,a,f,_);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),Ge(null),Le(null)}return!0},Js=K?.index;if(K!==void 0&&(K?.seq??null)!==Je&&(ve(K?.seq??null),typeof Js=="number"&&Ys(Js,0)),Ee&&($?Kn:Ot)){const t=Ee.pageVariant,n=!$&&t!==void 0&&t<le.length;if(n&&t!==Q)hn(t);else{Ke(null);const{section:s,variant:a}=Ee;if($)a!==void 0&&(Me(a),N([]),T(o=>o+1));else if(s!==void 0&&Ys(s,a??0)){const o=M[s],i=ce[s],l=i.isMultivariate?st(o,i):null;l&&a!==void 0&&queueMicrotask(()=>zt(l,s,a))}else n&&hn(t)}}if(ts!==Ga){Ua(ts);const t=C.current!==null||Se.current.size>0||vt.current!==null||gt.current!==null||D.isPending||dn.isPending||F.length>0,n=m!==null&&Hr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=M[m],a=ce[m];if(N([]),T(o=>o+1),!s||!a)L(null),A(null),H(null);else if(a.isMultivariate)_t(s,a,Ie,m);else{const o=Rt(s,a,f,_);A(o?.data??null),H(o?.resolveType??null)}}!t&&Te&&(un(null),Nn(void 0),Qt(s=>s+1))}if(Ls!==$a){Wa(Ls);const t=m!==null?M[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(N([]),T(s=>s+1),n.isMultivariate)_t(t,n,Ie,m);else{const s=Rt(t,n,f,_);A(s?.data??null),H(s?.resolveType??null)}}const dt=F[0];if(dt){const{formBase:t,target:n}=dt,s=wa(f,n,_),a=t.sectionIndex,o=s.rawSections.length===t.sectionCount?gs(s.rawSections[a],s.parsedSections[a],n.sectionVariantIndex,f,_):null,i=ni(dt,o,l=>Gr(t,l));if(i){const d=[{...dt,...i,changedAgain:!0},...F.slice(1)];xt.current=d,ke(d)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:U,previewUrl:_?void 0:b??void 0,siteSlug:Ce},Fn=Ye&&u?Gn(Ye,u):null,ft=(t,n)=>{if(!g)return;C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=an(f,g,t,Q,le);D.mutate({blockKey:g,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:a=>{n?.onError?.(),D.reportError(a)}})},$t=()=>{Ne?.(null),L(null),An(!1),A(null),H(null),ut(0),Le(null),Ge(null),N([]),T(t=>t+1)},Qs=()=>Hr(me.current,document.activeElement),os=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear(),wt.current=null,q.error(t,{id:ka}),Qs()){tn.current=!0;return}Os(n=>n+1)},Xs=()=>{!tn.current||Qs()||xt.current.length>0||C.current!==null||mn.current||pn.current||Se.current.size>0||(tn.current=!1,Os(t=>t+1))},Zs=()=>{tn.current&&setTimeout(Xs,0)},er=t=>bl(Ds,Fs,t,Pe.kind==="protocol"?Pe:null),tr=t=>{Se.current.size!==0&&setTimeout(()=>{if(mn.current||pn.current)return;const n=[...Se.current.values()];Se.current.clear();for(const s of n)s()},t)},Za=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:a}=ne.current,o=Lt.current;return{formBase:o?.sectionIndex===t&&o.variantIndex===a?o:null,pageKey:n,global:$,pageVariantIndex:s,sectionVariantIndex:a,schema:Fn}},vn=t=>{xt.current=t,ke(t)},eo=t=>{const n=xt.current,s=n.findIndex(i=>i.formBase===t.formBase),a=s>=0?n[s]:void 0,o=a?n.with(s,{...t,choices:Qr(a.plan,a.choices,t.plan),fresh:Vi(a.plan,t.plan,a.fresh),changedAgain:a.changedAgain||xn(a.plan.theirs)!==xn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(o)},nr=(t,n)=>{const s=xt.current,a=s.findIndex(l=>l.formBase===t),o=s[a];if(!o)return!1;if(xn(o.plan.mine)===xn(n))return!0;const i=Jr({...o.plan,mine:n});if(i.pointers.length===0){const l=s.filter(d=>d!==o);return vn(l),!1}return vn(s.with(a,{...o,plan:i,choices:Qr(o.plan,o.choices,i)})),!0},to=t=>{const n=ne.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},no=()=>{const t=xt.current[0];if(!t)return null;const{formBase:n,target:s}=t;C.current&&wt.current?.sectionIndex===n.sectionIndex&&wt.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(C.current),C.current=null,wt.current=null),Se.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const a=n.emitted;return a&&typeof a=="object"&&!nr(n,a)&&Sn(a,n.sectionIndex,0,s),xt.current[0]??null},so=()=>{const t=xt.current[0],n=no();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=hi(n.plan,n.choices);Pe.kind==="protocol"&&Pe.source==="github"&&gi(n.plan,n.choices)&&Sl(c,!1),vn(xt.current.slice(1));const{formBase:a,target:o}=n;a.base=n.plan.theirs,a.version=void 0,a.emitted=s,es.current.add(a),(Lt.current===a||to(n))&&(Lt.current=a,A(s),T(i=>i+1)),Sn(s,a.sectionIndex,0,o)},ro=t=>{const[n,...s]=xt.current;n&&vn([{...n,choices:t},...s])},Sn=(t,n,s=0,a,o=!1)=>{const i=a??Za(n),l=i.sectionVariantIndex,d=i.formBase,E=wt.current;C.current&&(clearTimeout(C.current),C.current=null,E&&(E.sectionIndex!==n||E.sectionVariantIndex!==l)&&E.write());const h=`${i.pageKey}:${n}:${l}`,x=()=>{if(mn.current||pn.current){Se.current.set(h,x);return}const j=typeof t=="function"?t():t;if(d&&nr(d,j))return;const I=ne.current.decofile,{rawSections:P,parsedSections:pe,pageVariants:ue,variantIndex:be}=wa(I,i,_),z=i.pageKey,W=P[n];if(!W)return;const re=pe[n];if(!re)return;const he=d?.base,Ae=gs(W,re,l,I,_),sn=!!he&&!!Ae&&xi(he,Ae)&&!(d&&Gr(d,Ae));if(sn&&he&&Ae){if(_i(he,Ae)){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const te=re.isSavedBlock?"here":ki(he,P.map((de,ht)=>gs(de,pe[ht],l,I,_)),n,d?.sectionCount??P.length);if(te==="unknown"){os(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof te=="number"&&d){d.sectionCount=P.length,d.sectionIndex=te,Lt.current===d&&L(te),Sn(j,te,s,i);return}}const pt=sn&&he&&Ae?Jr({ancestor:he,mine:j,theirs:Ae}):null;if(pt&&pt.pointers.length>0&&d){d.sectionCount=P.length,eo({plan:pt,formBase:d,target:i,sectionIndex:n,choices:wi(pt),changedAgain:!1,blockKey:re.isSavedBlock?Ss(W,re):z,fresh:{}});return}const Ze=pt?pt.merged:null,Pt=Ze??j,zr=ji({merged:!!Ze,tracked:d,current:Lt.current,saved:j});Ze&&q.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:ka}),zr&&d&&(d.emitted=Ze,A(Ze));const hs=zr||!Ze?Pt:j;d&&(d.base=hs,d.sectionCount=P.length,Ri(d,hs));const $r={onSuccess:()=>{d&&es.current.delete(d),k?.()},onError:te=>{if(d?.base===hs&&he&&(d.base=he),te instanceof yl){if(d&&(d.version=void 0),s<jc){Se.current.delete(h),pn.current=!0;const de=Ti(s,te.carriedStored);setTimeout(()=>{pn.current=!1,Sn(()=>{const ht=d?.emitted;return ht&&typeof ht=="object"?ht:j},n,s+1,i,de.immediate),Se.current.delete(h),tr(_n)},de.delay)}else os();return}D.reportError(te)}},Wr=te=>{mn.current=!0;let de=!1;D.mutateAsync(te).then(()=>$r.onSuccess(),ht=>{de=!0,$r.onError(ht)}).finally(()=>{mn.current=!1,tr(de?_n:0),Xs()})};if(re.isSavedBlock){const te=Ss(W,re);if(!te)return;Wr({blockKey:te,data:Pt,...he?{base:{value:Ze?Ae:he}}:{},rebaseOnConflict:!1,guard:Zr({formBase:d,rebased:!!Ze,versionOf:er})});return}if(!z)return;const Wn={...I[z]},Ht=[...P];if(re.isMultivariate){const te=st(W,re);if(!te||!z)return;const de=Ei(te,l,Pt);Ht[n]=Kt(W,re,de)}else if(re.isHidden){const te=Vs(W.__resolveType),de=te?{...W.section}:{...W},ht=Array.isArray(de.variants)?[...de.variants]:[];ht[0]&&(ht[0]=Xr(de.__resolveType,ht[0],Pt)),de.variants=ht,te?Ht[n]={...W,section:de}:Ht[n]=de}else re.isLazy?Ht[n]={...W,section:Pt}:Ht[n]=Pt;if(ue.length>1){const te=Wn.sections,de=[...te?.variants??[]];de[be]&&(de[be]=Xr(te?.__resolveType,de[be],Ht)),Wn.sections={...te,variants:de}}else Wn.sections=Ht;Wr({blockKey:z,data:Wn,rebaseOnConflict:!1,guard:Zr({formBase:null,rebased:!1,versionOf:er})})};if(wt.current={sectionIndex:n,sectionVariantIndex:l,write:x},o){wt.current=null,x();return}C.current=setTimeout(()=>{C.current=null,x()},_n)},ao=t=>{tn.current=!1,L(t),ut(0),N([]),T(o=>o+1);const n=M[t],s=ce[t];if(Ne?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){_t(n,s,0,t);return}const a=Rt(n,s,f,_);if(!a){A(null),H(null),Ge(null),Le(null),zt(null,t,0);return}A(a.data),H(a.resolveType),Ge(null),Le(null),zt(null,t,0)},sr=t=>{const n=t;m!==null&&(Lt.current=vi(Lt.current,{sectionIndex:m,variantIndex:ne.current.sectionVariantIndex,shown:et,next:n,sectionCount:ne.current.rawSections.length})),A(n),m!==null&&Sn(n,m)},is=t=>{if(!g||!f||!u||!se)return;const n={kind:"page",pageKey:g,pageName:String(se.name??""),path:String(se.path??"")},s=ta(f,n,u);s&&dn.save(g,()=>{const a=Ds.getQueryData(bi.decofile(Fs))?.[g];if(!a||typeof a!="object"||a===null||Array.isArray(a))return null;const o={...a,...Pn.current};return Pn.current={},t?.raw!==void 0?rc(o,t.raw,u):t?.inner!==void 0?ac(n,s,o,t.inner):o})},rr=(t,n)=>{g&&(Pn.current[t]=n,is())},oo=(t,n)=>{if(!g)return;const s=Jn([...M],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),ft(s)},io=t=>{if(!g)return;const n=M.filter((s,a)=>a!==t);m===t?$t():m!==null&&m>t&&L(m-1),ft(n)},lo=t=>{if(!g)return;const n=M[t];if(!n)return;const s=[...M];s.splice(t+1,0,al(n)),m!==null&&m>t&&L(m+1),ft(s)},co=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s)return;const a=s.isHidden?fi(n,_):mi(n,u);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},uo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const a=di(n);if(!a)return;const o=[...M];o[t]=a,m===t&&$t(),ft(o)},fo=t=>{if(!g)return;const n=M[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const a=Rt(n,s,f,_);if(!a?.data)return;const{name:o,...i}=a.data,l=[...M];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&$t(),ft(l)},mo=t=>{if(!g)return;const n=[...M,{__resolveType:t.resolveType}],s=n.length-1;ft(n,{onError:()=>{ne.current.selectedSectionIndex===s&&$t()}}),Yt(!1),L(s),ut(0),N([]),T(l=>l+1);const a=n[s],o=wn(n,f,_)[s];if(!a||!o)return;if(o.isMultivariate){_t(a,o,0);return}const i=Rt(a,o,f,_);if(!i){A(null),H(null),Ge(null),Le(null);return}A(i.data),H(i.resolveType),Ge(null),Le(null)},ar=t=>{En.current=t.append,Yt(!0)},po=t=>{const n=En.current;if(!n){mo(t);return}n({__resolveType:t.resolveType}),Yt(!1),En.current=null},or=t=>{if(m===null)return;const n=M[m],s=ce[m];!n||!s?.isMultivariate||(ut(t),N([]),T(a=>a+1),_t(n,s,t,m,!0))},ho=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ci(a,t);if(!o){q.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...M];i[m]=Kt(n,s,o);const l=o.variants;let d=Ie;t===Ie?d=Math.min(t,l.length-1):t<Ie&&(d=Ie-1),ut(d),N([]),T(E=>E+1),_t(i[m],s,d),ft(i)},go=t=>{if(m===null||!g)return;const n=M[m],s=ce[m];if(!n||!s?.isMultivariate)return;const a=st(n,s);if(!a)return;const o=ui(a,t,_),i=[...M];i[m]=Kt(n,s,o);const l=Yr(a.variants??[],t,_);ut(l),N([]),T(d=>d+1),_t(i[m],s,l,m,_),ft(i)},vo=(t,n)=>{if(m===null||!g||t===n)return;const s=M[m],a=ce[m];if(!s||!a?.isMultivariate)return;const o=st(s,a);if(!o)return;const i=ii(o,t,n),l=[...M];l[m]=Kt(s,a,i);let d=Ie;Ie===t?d=n:t<Ie&&n>=Ie?d=Ie-1:t>Ie&&n<=Ie&&(d=Ie+1),ut(d),_t(l[m],a,d,m,_),ft(l)},yn=t=>{const n=t??m;if(n===null||!g)return;const s=M[n],a=ce[n];if(!s||!a)return;const o=oi(s,a,void 0,u,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...M];i[n]=o.section;const l=wn(i,f,_)[n];if(!l?.isMultivariate){q.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),ut(o.newVariantIndex),N([]),T(d=>d+1),_t(o.section,l,o.newVariantIndex,n,_),ft(i)},ir=()=>{if(m===null||!g)return;const t=M[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=st(t,n);if(!s)return;const a=li(t,n,s);if(!a){q.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const o=[...M];o[m]=a;const i=wn(o,f,_)[m];if(!i)return;ut(0),Ge(null),Le(null),N([]),T(d=>d+1);const l=Rt(a,i,f,_);l?(A(l.data),H(l.resolveType)):(A(null),H(null)),zt(null,m,0),ft(o)},So=async t=>{if(Fe===null||!g)return;const n=Yn(t,f,u);if(n){q.error(n);return}const s=M[Fe],a=ce[Fe];if(!s||!a)return;const o=Rt(s,a,f,_);if(!o){q.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...o.data,name:t};try{const l=await D.mutateAsync({blockKey:t,data:i,create:!0}),d=[...M];d[Fe]={__resolveType:t},await D.mutateAsync({blockKey:g,data:an(f,g,d,Q,le)}),m===Fe&&$t(),G(null),qn(l)||q.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){q.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Mt(c,Bt(l))})}},lr=ye?.rule;if(St&&m===null&&J===null&&lr){const{resolveType:t,formValue:n}=qt(lr,f??{},u??void 0);ee(t),Y(n)}const nn=u?Ui(u):[],ls=u&&f?Yi(u,f):[],Wt=_&&u&&f?_l(u,f):[],cs=(t,n)=>{if(Wt.length===0)return;const s=Pl(t);return{kinds:Wt,selected:s,campaignPrefill:kl(t),onPick:n}},cr=!$&&!!(it&&u&&f),ur=J&&u?Gn(J,u):null,yt=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},kt=async(t,n)=>{if(!(Dl(n,t,u)>0))try{await Cn.mutateAsync({blockKey:t})}catch(s){q.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Mt(c,Bt(s))})}},dr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o={...s[n]},i={...o.sections},l=[...i.variants??[]],d=l[a],E=d?.rule;if(Gt(E,s,u)){const h=E?.__resolveType??"",x=s[h],j=typeof x?.name=="string"?x.name:h,{__resolveType:I,...P}=t;D.mutate({blockKey:h,data:Dt(I??"",P,j)},{onSuccess:()=>k?.(),onError:D.reportError});return}d&&(l[a]={...d,rule:t}),o.sections={...i,variants:l},D.mutate({blockKey:n,data:o},{onSuccess:()=>k?.(),onError:D.reportError})},_n)},fr=t=>{ee(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Y(t?n:{}),dr(n)},mr=t=>{const n=t;Y(n);const s=J?{__resolveType:J,...n}:{...n};dr(s)},In=async(t,n,s)=>{const a=wl(n,t);if(!a.ok)return a.reason==="conflict"&&q.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),ma),null;const o={};if(s){const i=s(a.rule);if(!i)return null;o[i.blockKey]=i.data}return a.blockWrite&&(o[a.blockWrite.blockKey]=a.blockWrite.block),Object.keys(o).length>0&&!(await Is.apply({writes:o})).ok?null:(a.blockWrite&&q.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...ma,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:a.rule,projected:{...n,...o}})},pr=Wt.length>0?{kinds:Wt,prepare:async t=>(await In(t,ne.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Kl(ne.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Is.apply({writes:{[Ml(t).blockKey]:n.block}})).ok}}:null,hr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;let o=null;const i=await In(t,s,E=>{const h=s[n],x=h?.sections;if(!x||typeof x!="object"||Array.isArray(x))return null;const j=x;if(!Array.isArray(j.variants))return null;const I=[...j.variants],P=I[a];return P?(o=bt(P.rule,s,u),I[a]={...P,rule:E},{blockKey:n,data:{...h,sections:{...j,variants:I}}}):null});if(!i)return;const{resolveType:l,formValue:d}=qt(i.rule,i.projected,u??void 0);ee(l),Y(d),o&&await kt(o,i.projected),k?.()},gr=async t=>{yt();const{activePageKey:n,decofile:s,variantIndex:a}=ne.current;if(!n)return;const o=s[n],i=o?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[a];if(!E)return;const h=bt(E.rule,s,u),x=ln(t);d[a]={...E,rule:x};const j={...s,[n]:{...o,sections:{...l,variants:d}}},{resolveType:I,formValue:P}=qt(x,j,u??void 0);ee(I),Y(P);try{await D.mutateAsync({blockKey:n,data:j[n]}),h&&h!==t&&await kt(h,j),k?.()}catch(pe){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(pe))})}},vr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=ne.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const P=(j.variants??[])[s]?.rule;if(Gt(P,i,u)){const z=P?.__resolveType??"",W=i[z],re=typeof W?.name=="string"?W.name:z,{__resolveType:he,...Ae}=t;D.mutate({blockKey:z,data:Dt(he??"",Ae,re)},{onSuccess:()=>k?.(),onError:D.reportError});return}const pe=vs(j,s,t),ue=[...a];ue[n]=Kt(h,x,pe);const be=an(i,l,ue,E,d);D.mutate({blockKey:l,data:be},{onSuccess:()=>k?.(),onError:D.reportError})},_n))},yo=t=>{Ge(t);const n=t?ha(t,u):{__resolveType:Ur(u)};Le(t?n:{}),vr(n)},bo=t=>{const n=t;Le(n);const s=Xt?{__resolveType:Xt,...n}:{...n};vr(s)},xo=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;let h=null;const x=await In(t,i,P=>{const pe=a[n],ue=o[n];if(!pe||!ue?.isMultivariate)return null;const be=st(pe,ue);if(!be)return null;const z=be.variants??[];h=bt(z[s]?.rule,i,u);const W=[...a];return W[n]=Kt(pe,ue,vs(be,s,P)),{blockKey:l,data:an(i,l,W,E,d)}});if(!x)return;const{resolveType:j,formValue:I}=qt(x.rule,x.projected,u??void 0);Ge(j),Le(I),h&&await kt(h,x.projected),k?.()},_o=async t=>{yt();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(n===null||!l)return;const h=a[n],x=o[n];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=bt(I[s]?.rule,i,u),pe=ln(t),ue=vs(j,s,pe),be=[...a];be[n]=Kt(h,x,ue);const z=an(i,l,be,E,d),W={...i,[l]:z},{resolveType:re,formValue:he}=qt(pe,W,u??void 0);Ge(re),Le(he);try{await D.mutateAsync({blockKey:l,data:z}),P&&P!==t&&await kt(P,W),k?.()}catch(Ae){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(Ae))})}};if(!$&&!se)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if($&&!Kn)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const je=m!==null?ce[m]??null:null,Sr=m!==null?M[m]:null,yr=Sr&&je?.isMultivariate?st(Sr,je):null,At=yr?qr(yr,we):[],Ln=Math.min(Ie,Math.max(At.length-1,0)),jt=At[Ln]??null,Nt=je?.isMultivariate===!0,us=m!==null&&je!==null,Ct=us&&(Nt||!!(Fn&&et)),ko=Ct&&!$&&je?.isSavedBlock===!0,mt=$||ko,br=$?Ws:je?.label??"",wo=Xt&&u?Gn(Xt,u):null,xr=(t,n)=>n&&Z?`${t} · ${n}`:t,_r=je?je.variantOf??je.label:"",jo=(()=>{const t=Nt&&jt?jt.label:null;return t?Z?[xr(_r,t)]:[je.label,t]:[je?.label??""]})(),ds=xr(se?.name??"",St?ye?.label:null),On=Ct&&(!$||O.length>0)?$?[Ws,...O]:[ds,...jo,...O]:[],kr=Te&&se?[se.name,"SEO",...Ps]:[],wr=c("sectionsEditor.pageVariantTabs.variantsLabel"),jr=Jt&&se?[se.name,wr]:Ft&&se&&je?[ds,_r,wr]:[],zn=jr.length>0?jr:kr.length>0?kr:mt?On.length>0?On:[br]:On.length>0?On:[ds],Rr=us&&!Nt&&!je?.isHidden&&!!g,Ro=mt||!$&&St&&!!ye||Rr,Eo=us&&!Nt&&!$&&O.length===0&&!!je&&Ra(je)&&!!g,Vo=Z&&Ct&&!Ft&&Nt&&O.length===0&&!!jt,Er=Z&&O.length>0?na(O[O.length-1]):null,To=O.length>1?na(O[O.length-2]):null,Vr=mt?br:Ct?je?.label??"":se?.name??"",Ao=Jt||Ft?c("sectionsEditor.pageVariantTabs.variantsLabel"):Te?c("sectionsEditor.panelSections.seo"):Er??Vr,Tr=Ft?je?.variantOf??je?.label??"":Jt||Te?se?.name??"":Er?To??Vr:mt?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):Ct?se?.name??"":se?.path??"",fs=!Jt&&!Ft&&!Te&&!Ct&&!mt,No=!Z&&!Te&&!$&&Nt&&O.length===0,bn=()=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const t=f[g],n=Cl(t.sections,M,u,_);if(!n)return;const{sections:s,newVariantIndex:a}=n;D.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),L(null),A(null),H(null),N([]),Y(null),ee(null)},onError:D.reportError})},$n=(t,n,s)=>{if(!g)return;yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const a=f[g],o=a.sections;if(!o||typeof o!="object"||Array.isArray(o))return;const i=o;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const d=Bl(i,l),E={...f,[g]:{...a,sections:d}};D.mutate({blockKey:g,data:E[g]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const x of h)await kt(x,E)})()},onError:D.reportError})},Ar=(t,n)=>{if(t===n)return;let s=Q;Q===t?s=n:t<Q&&n>=Q?s=Q-1:t>Q&&n<=Q&&(s=Q+1),fe(s);const a=Jn(le.map(o=>({rule:o.rule})),t,n);rs(a,s),$n(o=>Jn(o,t,n))},Nr=t=>{const n=le[t]?.rule,s=bt(n,f??{},u??void 0);$n(a=>a.length<=1?null:(a.splice(t,1),a),()=>{le.length-1===1?fe(0):t<Q?fe(Q-1):t===Q&&fe(Math.max(0,t-1)),L(null),A(null),H(null),N([]),Y(null),ee(null)},s)},Co=()=>{const t=le.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!pi(n.rule)).map(({variant:n})=>bt(n.rule,f??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Ai({variants:n}),a=n[s];return a?[{...a,rule:Ni(u)}]:null},()=>{fe(0),L(null),A(null),H(null),N([]),Y(null),ee(null),Tn(!1)},t)},Cr=t=>{let n=t+1;$n(s=>(n=Yr(s,t,_),Fl(s,t,_)),()=>{fe(n),L(null),A(null),H(null),N([]),Y(null),ee(null)})},Po=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const s=ne.current.activePageKey,a=ne.current.decofile;if(!s)return;const o=a[s],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const d=[...l.variants],E=d[t];if(!E?.rule||typeof E.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=E.rule,x=n.trim();en(!0);try{if(!x){if(!Gt(h,a,u)){Ve(null);return}const z=h.__resolveType??"";d[t]={...E,rule:ks(h,a,u)};const W={...a,[s]:{...o,sections:{...l,variants:d}}};await D.mutateAsync({blockKey:s,data:W[s]}),await kt(z,W),Ve(null),k?.();return}const j=ws(h,a,u);if(!j){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(j.blockKey){await D.mutateAsync({blockKey:j.blockKey,data:Dt(j.resolveType,j.data,x)}),Ve(null),k?.();return}const I=Un(x),P=Yn(I,a,u);if(P){q.error(P);return}const pe=Dt(j.resolveType,j.data,x);let ue=null,be=!1;try{const z=await D.mutateAsync({blockKey:I,data:pe,create:!0});be=qn(z),ue=be?null:I,d[t]={...E,rule:ln(I)},await D.mutateAsync({blockKey:s,data:{...o,sections:{...l,variants:d}}}),ue=null}catch(z){throw ue&&await Cn.mutateAsync({blockKey:ue}).catch(()=>{}),z}Ve(null),be||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:x})),k?.()}catch(j){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(j))})}finally{en(!1)}},Ko=async(t,n)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{selectedSectionIndex:s,rawSections:a,parsedSections:o,decofile:i,activePageKey:l,pageVariants:d,variantIndex:E}=ne.current;if(s===null||!l)return;const h=a[s],x=o[s];if(!h||!x?.isMultivariate)return;const j=st(h,x);if(!j)return;const I=j.variants??[],P=I[t];if(!P?.rule||typeof P.rule!="object"){q.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const pe=P.rule,ue=n.trim();en(!0);const be=async z=>{const W={...j,variants:z},re=[...a];re[s]=Kt(h,x,W);const he=an(i,l,re,E,d);return await D.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!ue){if(!Gt(pe,i,u)){nt(null);return}const pt=pe.__resolveType??"",Ze=[...I];Ze[t]={...P,rule:ks(pe,i,u)};const Pt=await be(Ze);await kt(pt,Pt),nt(null),k?.();return}const z=ws(pe,i,u);if(!z){q.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(z.blockKey){await D.mutateAsync({blockKey:z.blockKey,data:Dt(z.resolveType,z.data,ue)}),nt(null),k?.();return}const W=Un(ue),re=Yn(W,i,u);if(re){q.error(re);return}const he=Dt(z.resolveType,z.data,ue);let Ae=null,sn=!1;try{const pt=await D.mutateAsync({blockKey:W,data:he,create:!0});sn=qn(pt),Ae=sn?null:W;const Ze=[...I];Ze[t]={...P,rule:ln(W)},await be(Ze),Ae=null}catch(pt){throw Ae&&await Cn.mutateAsync({blockKey:Ae}).catch(()=>{}),pt}nt(null),sn||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),k?.()}catch(z){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(z))})}finally{en(!1)}},Pr=async(t,n,s)=>{A(s);try{await D.mutateAsync({blockKey:t,data:s})}catch(a){throw A(o=>o===s?n:o),a}},Mo={rename:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],d=l?.rule&&typeof l.rule=="object"?l.rule:void 0,E=async x=>{const j={...t,variants:x};return await Pr(a,t,j),{...o,[a]:j}},h=wc(d,s,o,u);if(h.kind!=="noop"){if(h.kind==="error"){q.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const I=[...i];I[n]={...l,rule:h.inlinedRule};const P=await E(I);await kt(h.blockKey,P),k?.();return}if(h.kind==="updateBlock"){await D.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let x=null,j=!1;try{const I=await D.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});j=qn(I),x=j?null:h.blockId;const P=[...i];P[n]={...l,rule:h.reference},await E(P),x=null}catch(I){throw x&&await Cn.mutateAsync({blockKey:x}).catch(()=>{}),I}j||q.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Mt(c,Bt(x))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const d=bt(l.rule,o,u);i[n]={...l,rule:ln(s)};const E={...t,variants:i},h={...o,[a]:E};try{await Pr(a,t,E),d&&d!==s&&await kt(d,h),k?.()}catch(x){q.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Mt(c,Bt(x))})}},selectNamedRule:async(t,n,s)=>{yt(),C.current&&(clearTimeout(C.current),C.current=null),Se.current.clear();const{activePageKey:a,decofile:o}=ne.current;if(!a)return;let i=null,l=null;const d=await In(s,o,E=>{const h=Array.isArray(t.variants)?[...t.variants]:[],x=h[n];return x?(i=bt(x.rule,o,u),h[n]={...x,rule:E},l={...t,variants:h},{blockKey:a,data:l}):null});!d||!l||(A(l),i&&await kt(i,d.projected),k?.())}},Kr=()=>{$t()},Mr=t=>{un(t),is({inner:t})},Br=t=>{Nn(t),is({raw:t})},Dr=()=>{un(null),It([])},Fr=()=>Qt(t=>t+1),Ir=()=>{dn.flush(),cn(!1),un(null),Nn(void 0),It([]),Qt(t=>t+1),ge?.()},Bo=()=>{Tn(!1),An(!1),L(null),cn(!0)},Do=()=>{Te&&Ir(),L(null),Tn(!0)},Fo=()=>An(!0),ms=t=>{if(Jt&&t===0){Tn(!1);return}if(Ft&&t<2){An(!1),t===0&&L(null);return}if(Te){if(t===0){Ir();return}if(t===1){It([]),Qt(s=>s+1);return}It(Ps.slice(0,t-1)),Qt(s=>s+1);return}if($){N(O.slice(0,t)),T(s=>s+1);return}if(t===0){Kr();return}if(t===1){N([]),T(s=>s+1);return}const n=!Z&&Nt&&jt?1:0;if(n===1&&t===2){N([]),T(s=>s+1);return}N(O.slice(0,t-1-n))},ps=zn.length>1?r.jsx("button",{type:"button",onClick:()=>ms(ol(zn.length,{isMultivariateSectionTop:No})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:ae("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",mt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(dl,{className:"size-4"})}):null,Io=mt||Ct||Te?Ro&&r.jsxs("div",{className:ae("border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!$&&St&&ye&&r.jsxs("button",{type:"button",onClick:Kr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:ye.label}),className:ae("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Qi),children:[r.jsx(Ji,{rule:xs(ye.rule,f??{},u??void 0),matchers:nn}),r.jsx("span",{className:"max-w-[160px] truncate",children:ye.label})]}),r.jsx("div",{className:"flex-1"}),mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Rr&&r.jsx(Hn,{onClick:()=>yn()})]}),mt&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr,variant:"header"})}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>cn(!0),children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Oe&&g?Oe():Zn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(Hn,{onClick:bn})]}),Lo=r.jsxs(r.Fragment,{children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:Q,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&J!==null&&r.jsx(aa,{className:"mt-3",children:r.jsx("div",{className:ae("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:J,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Wt),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${Q}:${J??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})})]}),Lr=r.jsxs(r.Fragment,{children:[r.jsx(Xi,{listKey:`${g??""}:${m??""}`,variants:At.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:or,onRename:nt,onDuplicate:go,onDelete:ho,onRemoveAll:ir,onReorder:vo,onAdd:()=>yn()}),r.jsx(aa,{children:r.jsx(ys,{currentRt:Xt??"",currentLabel:kn(jt?.rule,f??{},we,u??void 0),currentGlobalKey:bt(jt?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:yo,onSelectGlobal:_o,named:cs(jt?.rule,xo),namedRow:bs(jt?.rule,Wt),rule:jt?.rule,schema:wo,formValue:Ba,onChange:bo,formKey:`${m??"none"}:${Ln}:${Xt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or=r.jsx("div",{className:ae(Z?"px-2":"p-2 pt-3"),children:r.jsx(_c,{listKey:`${g??""}-${Q}`,rawSections:M,sections:ce,meta:u,decofile:f,selectedIndex:m,onSelect:ao,onReorder:oo,onDelete:io,onDuplicate:lo,onMakeReusable:G,onToggleHidden:co,onToggleLazy:ot?uo:void 0,onAddVariant:yn,onDetach:fo,onAddSection:()=>Yt(!0),canAddSection:cr})}),Oo=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&se&&r.jsx(sa,{pageKey:g,initialName:se.name,initialPath:se.path,onFieldChange:rr}),Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Hs,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),zo=r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?r.jsx(ya,{rawSeo:Mn,innerSeo:ss,defaultResolveType:qs,seoTypesLoading:_&&!u,seoSchema:Gs,activeResolveType:Bn,seoTypeOptions:Hs,formResetKey:Ks,siteDefaultSeo:Us,onBreadcrumbChange:It,onPersistRaw:Br,onInnerChange:Mr,onClearForm:Dr,onBumpFormKey:Fr,asyncRenderAvailable:ot}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),$o=r.jsxs(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[St&&g&&r.jsx(ra,{listKey:g,variants:le,activeIndex:Q,decofile:f??{},meta:u,matchers:nn,onSelect:hn,onReorder:Ar,onRename:Ve,onDuplicate:Cr,onDelete:Nr,onAdd:bn}),St&&J!==null&&r.jsxs("div",{className:ae("px-3 border-b",Vn?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>Ka(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":Vn,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),Vn?r.jsx(ll,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(cl,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Vn&&r.jsx("div",{className:ae("space-y-3",Zt&&"pointer-events-none opacity-50"),children:r.jsx(ys,{currentRt:J,currentLabel:kn(ye?.rule,f??{},we,u??void 0),currentGlobalKey:bt(ye?.rule,f??{},u??void 0)??void 0,matchers:nn,globals:ls,onSelect:fr,onSelectGlobal:gr,named:cs(ye?.rule,hr),namedRow:bs(ye?.rule,Wt),rule:ye?.rule,schema:ur,formValue:De,onChange:mr,formKey:`${Q}:${J??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:f,onSaveReferencedBlock:fn,sandbox:gn})})]}),Or]},"editor-section-list");return r.jsx(Zi,{value:_,children:r.jsx(el,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!Z&&ps&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ps}),(Z||zn.length>1)&&r.jsx(tl,{crumbs:zn,onSelect:ms,onSelectRoot:()=>{dn.flush(),Ue?Ue():ms(0)}}),r.jsx("div",{className:"shrink-0",children:Z?r.jsxs("div",{className:ae("flex items-center gap-2 border-b px-3 py-2.5",mt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[Z&&ps,mt&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Qn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Tt,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:Ao}),Tr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Tr})]}),fs&&St&&ye&&r.jsx(oa,{variants:le,activeIndex:Q,onSelect:hn,onManage:Do,onRemoveAll:Co}),Vo&&r.jsx(oa,{variants:At,activeIndex:Ln,onSelect:or,onManage:Fo,onRemoveAll:ir}),fs&&!St&&r.jsx(Hn,{onClick:bn}),Eo&&r.jsx(Hn,{onClick:()=>yn()}),r.jsx(nl,{}),fs&&r.jsxs(r.Fragment,{children:[r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:Bo,children:r.jsx(da,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Oe&&r.jsxs(Et,{children:[r.jsx(Vt,{asChild:!0,children:r.jsx(Ut,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Zn(!0),children:r.jsx(fa,{size:14})})}),r.jsx(Tt,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Io}),dt&&r.jsx(si,{open:!0,fields:ri(dt.plan,dt.target.schema),choices:dt.choices,changedAgain:dt.changedAgain,author:$s??null,authorPending:$s===void 0,fieldsAsLabeled:zs!==null,fresh:dt.fresh,onChoose:(t,n)=>ro({...dt.choices,[t]:n}),onApply:so},Ec(dt.formBase)),Ft?r.jsx(ia,{onAdd:()=>yn(),children:Lr},"editor-section-variants"):Ct?r.jsxs(on,{viewportRef:me,onBlur:Zs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!Z&&Nt&&At.length>0&&O.length===0&&Lr,r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Qe,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar,onVariantMatcherOp:$?Mo:void 0})})})]},"editor-section-form"):$?r.jsx(on,{viewportRef:me,onBlur:Zs,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(pa,{value:pr,children:r.jsx(la,{value:$&&_?Be:null,children:r.jsx(ca,{activeSchema:Fn,formValue:et,formResetKey:Qe,onFormChange:sr,onBreadcrumbChange:N,breadcrumbPath:O,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:f,onSaveReferencedBlock:fn,sandbox:gn,previewBaseUrl:at,onRequestAddSection:ar})})})},"editor-global-block"):Te?Z?r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Oo})},"editor-seo"):zo:Jt?r.jsx(ia,{onAdd:bn,children:Lo},"editor-variants"):Z?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(on,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Or})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Es,{canAddSection:cr,onAddSection:()=>Yt(!0)})})]},"editor-section-list"):$o,r.jsx(sl,{open:Fe!==null,onOpenChange:t=>{t||G(null)},defaultBlockId:Fe!==null?Un(ce[Fe]?.label??""):"",isPending:D.isPending,onSubmit:So}),it&&r.jsx(nc,{open:Pa,onOpenChange:t=>{Yt(t),t||(En.current=null)},meta:u,decofile:f,previewBaseUrl:at,onSelect:po}),Ts&&g&&f&&r.jsx(El,{open:Ts,onOpenChange:Zn,pageKey:g,decofile:f}),ie!==null&&r.jsx(ua,{open:!0,initialName:Gt(le[ie]?.rule,f??{},u??void 0)?kn(le[ie]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(le[ie]?.rule,f??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Po(ie,t)},onOpenChange:t=>{!t&&!Zt&&Ve(null)}}),Xe!==null&&r.jsx(ua,{open:!0,initialName:Gt(At[Xe]?.rule,f??{},u??void 0)?kn(At[Xe]?.rule,f??{},we,u??void 0):"",autoLabel:we(xs(At[Xe]?.rule,f??{},u??void 0)),isPending:Zt,onSubmit:async t=>{await Ko(Xe,t)},onOpenChange:t=>{!t&&!Zt&&nt(null)}})]})})})}export{lf as SectionsEditor};
@@ -1 +1 @@
1
- import{r as d,ct as rt,cu as _e,j as c,cv as st,cw as be,cx as k,cy as lt,cz as j,cA as N,cB as $,cC as at,bP as Ee,cD as Re,cE as it,cF as ct,cG as dt,cH as ut,cI as pt,cJ as ft,cK as mt,cL as ht,cM as vt,cN as gt,cO as xt,cP as St,c as ee,l as oe,ai as wt}from"./index-BGCeOWuH.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-C91ph34T.js";import{t as je,n as yt}from"./ChevronUp-DZpXGp6s.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 co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(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 mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(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{co as S,uo as a,po as b,mo as c,fo as d};
1
+ import{r as d,ct as rt,cu as _e,j as c,cv as st,cw as be,cx as k,cy as lt,cz as j,cA as N,cB as $,cC as at,bP as Ee,cD as Re,cE as it,cF as ct,cG as dt,cH as ut,cI as pt,cJ as ft,cK as mt,cL as ht,cM as vt,cN as gt,cO as xt,cP as St,c as ee,l as oe,ai as wt}from"./index-CZa3eyGb.js";import{c as Ne}from"./index-BdQq_4o_.js";import{V as Ct}from"./index-CJkX47-N.js";import{t as je,n as yt}from"./ChevronUp-bhjMH6tk.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 co(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx($t,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=c.jsx(Yt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(15);let t,o,n,l,s;e[0]!==r?({className:o,size:l,variant:s,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"default":l,i=s===void 0?"outline":s;let u;e[6]!==o?(u=oe("data-[placeholder]:text-subtle-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex w-fit items-center justify-between gap-1.5 px-3 text-sm whitespace-nowrap transition-[color,background-color,box-shadow] outline-none disabled:text-subtle-foreground disabled:pointer-events-none","data-[variant=outline]:rounded-[var(--studio-control-radius,var(--radius-lg))] data-[variant=outline]:bg-[var(--studio-input-background)] data-[variant=outline]:shadow-edge data-[variant=outline]:hover:bg-sidebar","data-[variant=filled]:rounded-full data-[variant=filled]:bg-muted data-[variant=filled]:hover:bg-secondary-hover","data-[variant=pill]:rounded-full data-[variant=pill]:bg-card data-[variant=pill]:shadow-edge data-[variant=pill]:hover:bg-[var(--studio-outline-hover-background)]","data-[size=default]:h-[var(--studio-control-height,2.25rem)] data-[size=default]:pl-4 data-[size=sm]:h-8 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:text-xs data-[size=xs]:font-medium","*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",o),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-3.5 stroke-[1.5]"})}),e[8]=f):f=e[8];let m;return e[9]!==t||e[10]!==n||e[11]!==a||e[12]!==u||e[13]!==i?(m=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":a,"data-variant":i,className:u,...n,children:[t,f]}),e[9]=t,e[10]=n,e[11]=a,e[12]=u,e[13]=i,e[14]=m):m=e[14],m}function fo(r){const e=ee.c(25);let t,o,n,l,s;e[0]!==r?({className:o,children:t,position:l,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=l===void 0?"popper":l,i=s===void 0?!1:s,u=a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let f;e[6]!==o||e[7]!==u?(f=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[var(--studio-surface-radius,var(--radius-lg))] border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=f):f=e[8];let m;e[9]!==i?(m=!i&&c.jsx(no,{}),e[9]=i,e[10]=m):m=e[10];const w=a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let C;e[11]!==w?(C=oe("p-1",w),e[11]=w,e[12]=C):C=e[12];let S;e[13]!==t||e[14]!==C?(S=c.jsx(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 mo(r){const e=ee.c(19);let t,o,n,l,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...l}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=l,e[5]=s):(t=e[1],o=e[2],n=e[3],l=e[4],s=e[5]);const a=s===void 0?!1:s,i=n&&"items-start py-2";let u;e[6]!==o||e[7]!==i?(u=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",i,o),e[6]=o,e[7]=i,e[8]=u):u=e[8];let f;e[9]!==a?(f=!a&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(wt,{className:"size-4"})})}),e[9]=a,e[10]=f):f=e[10];let m;e[11]!==t||e[12]!==n?(m=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(Pe,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(Pe,{children:t}),e[11]=t,e[12]=n,e[13]=m):m=e[13];let w;return e[14]!==l||e[15]!==u||e[16]!==f||e[17]!==m?(w=c.jsxs(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{co as S,uo as a,po as b,mo as c,fo as d};
@@ -1 +1 @@
1
- import{c as $,b as A,r as R,l as G,j as l,B as H,s as J,x as K,v as Q,D as U}from"./index-BGCeOWuH.js";import{c as V,b as W,a as X,D as Y}from"./drawer-BxmRq7z0.js";import{u as Z}from"./use-mobile-jFUNwYYf.js";import{d as ee}from"./chat-context-BvBN6HgF.js";import{S as F,a as le,M as se,c as te}from"./index-CbIYCvQg.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:s,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==s||e[5]!==w||e[6]!==i?(c=i?l.jsx(F,{model:s??null,placeholder:w,isLoading:I}):l.jsx(ne,{placeholder:w}),e[3]=I,e[4]=s,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=l.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(le,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==s||e[16]!==k||e[17]!==b||e[18]!==i?(N=l.jsx(R.Suspense,{fallback:y,children:i?l.jsx(se,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:s??null,onModelChange:b,filterModels:E}):l.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=s,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(q){let g;e[20]!==m?(g=l.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=l.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=l.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=l.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=l.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=l.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=l.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=l.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=l.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let s;return e[0]!==n||e[1]!==t||e[2]!==o?(s=l.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=s):s=e[3],s}export{me as M};
1
+ import{c as $,b as A,r as R,l as G,j as l,B as H,s as J,x as K,v as Q,D as U}from"./index-CZa3eyGb.js";import{c as V,b as W,a as X,D as Y}from"./drawer-C_HOpx0y.js";import{u as Z}from"./use-mobile-CmqrzeQ2.js";import{d as ee}from"./chat-context-B-EalrGD.js";import{S as F,a as le,M as se,c as te}from"./index-C-AP-JX2.js";function me(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:s,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:b,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=b!==void 0,q=Z(),O=z==="borderless"?"ghost":"outline",_=z==="borderless"&&"md:border-none";let d;e[0]!==t||e[1]!==_?(d=G("text-sm hover:bg-accent py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==s||e[5]!==w||e[6]!==i?(c=i?l.jsx(F,{model:s??null,placeholder:w,isLoading:I}):l.jsx(ne,{placeholder:w}),e[3]=I,e[4]=s,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=l.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const m=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=l.jsx(le,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==s||e[16]!==k||e[17]!==b||e[18]!==i?(N=l.jsx(R.Suspense,{fallback:y,children:i?l.jsx(se,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:s??null,onModelChange:b,filterModels:E}):l.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=s,e[16]=k,e[17]=b,e[18]=i,e[19]=N):N=e[19];const f=N;if(q){let g;e[20]!==m?(g=l.jsx(V,{asChild:!0,children:m}),e[20]=m,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=l.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let C;e[26]!==f?(C=l.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:f}),e[26]=f,e[27]=C):C=e[27];let v;e[28]!==M||e[29]!==C?(v=l.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,C]}),e[28]=M,e[29]=C,e[30]=v):v=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==v?(T=l.jsxs(Y,{open:a,onOpenChange:S,children:[g,v]}),e[31]=a,e[32]=g,e[33]=v,e[34]=T):T=e[34],T}let h;e[35]!==m?(h=l.jsx(J,{asChild:!0,children:m}),e[35]=m,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=l.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==f||e[42]!==p?(u=l.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,f]}),e[41]=f,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=l.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let s;return e[0]!==n||e[1]!==t||e[2]!==o?(s=l.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=s):s=e[3],s}export{me as M};