decocms 4.439.0 → 4.440.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/dist/client/assets/{AlertCircle-DNh15odk.js → AlertCircle-BRBGpzZA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DHC4iQTL.js → AreaChart-u6Mr5vHg.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Cqg3j8St.js → ArrowLeft-D_nqQ9tV.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-6P5DjR1t.js → ArrowUp-DH2IataT.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-dVe_ZNcS.js → CartesianChart-BACZ_JVe.js} +1 -1
  6. package/dist/client/assets/{Check-D-yzmwYn.js → Check-CO_ET4WO.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-rjwyzOFk.js → CheckCircle-RceYLcNO.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D60SP3XH.js → ChevronUp-DnrzvZVs.js} +1 -1
  9. package/dist/client/assets/{Copy01-CB0oESJQ.js → Copy01-BBbKMHlK.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-D5kRRYiA.js → CreditCard01-D97_uv9-.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-JQQSHvl4.js → DotsVertical-DA8jC7Sm.js} +1 -1
  12. package/dist/client/assets/{ErrorBarContext-Bj2oJlhL.js → ErrorBarContext-B25cMhf0.js} +1 -1
  13. package/dist/client/assets/{Image01-D5rleQuB.js → Image01-AFCLWig4.js} +1 -1
  14. package/dist/client/assets/{Key01-k7QWuZZQ.js → Key01-DOFfyL8f.js} +1 -1
  15. package/dist/client/assets/{Line-d6qphZcQ.js → Line-ifQGqba-.js} +1 -1
  16. package/dist/client/assets/{Link01-Cw5nVzWM.js → Link01-7l6-kKGf.js} +1 -1
  17. package/dist/client/assets/{LinkBroken01-gwFdcT6K.js → LinkBroken01-t821Qpkz.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DY6YFto3.js → LinkExternal01-CGlBJ7ud.js} +1 -1
  19. package/dist/client/assets/{Monitor01-CwcZK9j8.js → Monitor01-B8XQMd3B.js} +1 -1
  20. package/dist/client/assets/{Palette-DjIClyYF.js → Palette-Dcur9L4v.js} +1 -1
  21. package/dist/client/assets/{Plus-B2OSMT7h.js → Plus-B0dyDF7l.js} +1 -1
  22. package/dist/client/assets/{SearchMd-zLAR-XV2.js → SearchMd-DWmqXOB3.js} +1 -1
  23. package/dist/client/assets/{Sector-BpeBpHJh.js → Sector-CjACZniY.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-DodmZnt4.js → ShoppingBag01-CnpFPbsS.js} +1 -1
  25. package/dist/client/assets/{Sun-BlPxF05z.js → Sun-CnfUJ0L6.js} +1 -1
  26. package/dist/client/assets/{Tool01-BOjbFJCz.js → Tool01-lC3aADL7.js} +1 -1
  27. package/dist/client/assets/{Trash01-XL5_ynxe.js → Trash01-DV0azdbE.js} +1 -1
  28. package/dist/client/assets/{Upload01-BgnfyY39.js → Upload01-DK8FpPmK.js} +1 -1
  29. package/dist/client/assets/{User01-BmSpscpo.js → User01-BY20MgLM.js} +1 -1
  30. package/dist/client/assets/{UserSquare-DQSzlDyj.js → UserSquare-bfdtEra2.js} +1 -1
  31. package/dist/client/assets/{Users01-Cu0IOT-O.js → Users01-qvvwVlrt.js} +1 -1
  32. package/dist/client/assets/{X-BRJDCcj9.js → X-CMwuaze4.js} +1 -1
  33. package/dist/client/assets/{XAxis--Ss4V9TD.js → XAxis-WGIN87ND.js} +1 -1
  34. package/dist/client/assets/{XClose-cblogra0.js → XClose-CzlFjlez.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-CHBfhru9.js → ZoomOut-D_ifUcHu.js} +1 -1
  36. package/dist/client/assets/{access-gate-zVG3uMCf.js → access-gate-BOQqTHG4.js} +1 -1
  37. package/dist/client/assets/{add-connection-dialog-BdGkf6fb.js → add-connection-dialog-BxahNv4G.js} +1 -1
  38. package/dist/client/assets/{agent-analytics-sie_dmFE.js → agent-analytics-CGaZnDet.js} +1 -1
  39. package/dist/client/assets/agent-app-HRhkGt4e.js +1 -0
  40. package/dist/client/assets/{agent-assets-CUmR3DlZ.js → agent-assets-DgwRmMX3.js} +1 -1
  41. package/dist/client/assets/{agent-automation-CDGnu6LJ.js → agent-automation-Dmx4CuOb.js} +1 -1
  42. package/dist/client/assets/{agent-automations-DXUFG3pc.js → agent-automations-D49rFQFC.js} +1 -1
  43. package/dist/client/assets/{agent-connect-sources-Dl3mNUrO.js → agent-connect-sources-C7wp22k7.js} +1 -1
  44. package/dist/client/assets/agent-deck-C3svsy7Z.js +1 -0
  45. package/dist/client/assets/{agent-e2e-DLSjrNEX.js → agent-e2e-DNfKyrDH.js} +1 -1
  46. package/dist/client/assets/{agent-experiments-A4uiLJgr.js → agent-experiments-CxFez-pk.js} +1 -1
  47. package/dist/client/assets/{agent-file-rvFuO31C.js → agent-file-CeVg9xBG.js} +1 -1
  48. package/dist/client/assets/{agent-git-DdunhDgp.js → agent-git-CTSmRbRs.js} +1 -1
  49. package/dist/client/assets/{agent-hosting-DEIJsmW5.js → agent-hosting-DKHsCemp.js} +1 -1
  50. package/dist/client/assets/{agent-icon-MUEfToW1.js → agent-icon-DV55KTHV.js} +1 -1
  51. package/dist/client/assets/agent-library-BseoXsKi.js +1 -0
  52. package/dist/client/assets/agent-library-file-D-k7ToJp.js +1 -0
  53. package/dist/client/assets/{agent-monitor--cuY5pYG.js → agent-monitor-CmWO_xKA.js} +1 -1
  54. package/dist/client/assets/{agent-overview-lNYRzsXP.js → agent-overview-QZEmtrKn.js} +1 -1
  55. package/dist/client/assets/agent-settings-DqFfgmc7.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-DjqU86NG.js → agent-site-editor-A-DuGZL1.js} +1 -1
  57. package/dist/client/assets/agent-site-editor-code-4yF8GVCZ.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-DlK0hqc9.js → agent-site-editor-content-D1GHZfYW.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-ByIKtrAz.js → agent-site-editor-preview-RNdb_aLF.js} +3 -3
  60. package/dist/client/assets/agent-view-CASURRu4.js +1 -0
  61. package/dist/client/assets/{agent-view-guard-ChLJmBP5.js → agent-view-guard-C6pPHYLM.js} +1 -1
  62. package/dist/client/assets/{agents-list-DoazNNiL.js → agents-list-DrZwJdgg.js} +1 -1
  63. package/dist/client/assets/{ai-providers-BLWhSwwC.js → ai-providers-C3SDK-es.js} +1 -1
  64. package/dist/client/assets/{alert-BFHHNxnn.js → alert-D3UeuoXv.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-DMpR0cgA.js → alert-dialog-D5ehbgbg.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-Dt3CooMv.js → analytics-sections-8tMy3NSb.js} +1 -1
  67. package/dist/client/assets/{api-keys-CuS1VRyL.js → api-keys-BGIqZi8b.js} +1 -1
  68. package/dist/client/assets/api-keys-DQMXRZDM.js +1 -0
  69. package/dist/client/assets/{app-editor-D3v5ZTbF.js → app-editor-BhQAjgpO.js} +1 -1
  70. package/dist/client/assets/{asset-utils-B3iwsCJa.js → asset-utils-CzXHTnwN.js} +1 -1
  71. package/dist/client/assets/{auth-CtKUYryj.js → auth-D62PuyHX.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-CfvE5cij.js → auth-catchall-B3J-GACW.js} +1 -1
  73. package/dist/client/assets/{auth-entry-DF4Nif3w.js → auth-entry-BWhEuRSI.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-DFGtdXSo.js → auth-split-layout-5urTf-8R.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-B2kuZKVb.js → authenticate-and-persist-oauth-DoNypqY8.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-BEcMpn8E.js → automation-list-row-6V6__o_w.js} +1 -1
  77. package/dist/client/assets/{automation-runs-C3b4l0S5.js → automation-runs-DJ3rlQae.js} +1 -1
  78. package/dist/client/assets/{automations-CYonb4k7.js → automations-DNX-Z3mR.js} +1 -1
  79. package/dist/client/assets/{autosend-Cm6PSWmI.js → autosend-_7Pn3AYs.js} +1 -1
  80. package/dist/client/assets/{avatar-ay32d7Rq.js → avatar-HeVuI3WS.js} +1 -1
  81. package/dist/client/assets/{badge-BI-lLKoq.js → badge-DLk0uZg2.js} +1 -1
  82. package/dist/client/assets/{block-document-BMgThWIX.js → block-document-HwHxH7Bn.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-CGvBOobb.js → blocks-preview-workspace-context-0CY5kK_i.js} +1 -1
  84. package/dist/client/assets/{buckets-CE-CN8Z3.js → buckets-DNXFJJmf.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-CIPlVAj1.js → build-improve-prompt-doc-DiiRh6vZ.js} +1 -1
  86. package/dist/client/assets/{calendar-BrlmwFhH.js → calendar-Bs93rBUA.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-Ikh4so4d.js → capability-load-error-C1opTYYa.js} +1 -1
  88. package/dist/client/assets/{category-editor-B1oCGWUg.js → category-editor-BzSt35e8.js} +1 -1
  89. package/dist/client/assets/{chart-CmddLGXm.js → chart-BswBR4td.js} +1 -1
  90. package/dist/client/assets/{chat-context-BME83pNr.js → chat-context-CocIg825.js} +1 -1
  91. package/dist/client/assets/{chat-draft-Cr8A9k3f.js → chat-draft-DVoUlwJ3.js} +1 -1
  92. package/dist/client/assets/{checkbox-C_fcJ23Z.js → checkbox-C-jsWi4f.js} +1 -1
  93. package/dist/client/assets/{choose-editor-Ct_hojdT.js → choose-editor-BmR7SGph.js} +1 -1
  94. package/dist/client/assets/{claim-phase-copy-cMVgzjzE.js → claim-phase-copy-DM-AWuNF.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-CgVkfoY6.js → cli-auth-success-BB8BjOg-.js} +1 -1
  96. package/dist/client/assets/{client-icons-_mUBMG5g.js → client-icons-DLhmJ_Wc.js} +1 -1
  97. package/dist/client/assets/{collapsible-BKpQ7Moy.js → collapsible-CuGEZkc7.js} +1 -1
  98. package/dist/client/assets/{collection-detail-faeL9TRY.js → collection-detail-Df1t4CiZ.js} +1 -1
  99. package/dist/client/assets/{collection-display-button-B2gCuF1B.js → collection-display-button-DcAXDLtF.js} +1 -1
  100. package/dist/client/assets/{collection-search-DF-hol44.js → collection-search-BVdAr8z7.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-D7rTVAg6.js → collection-table-wrapper-qlvTDDfb.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-BpMesivQ.js → collection-tabs-D--zl7tk.js} +1 -1
  103. package/dist/client/assets/{combobox-BqvA6tS8.js → combobox-CaxzDpIX.js} +1 -1
  104. package/dist/client/assets/{command-CIkNvcpT.js → command-C0uSVAHC.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section-CcDk1MlC.js → companion-mcps-section-tdKhwU79.js} +1 -1
  106. package/dist/client/assets/{config-D3bkYN9z.js → config-BTAHIKaz.js} +1 -1
  107. package/dist/client/assets/{connect-BuEYQp0G.js → connect-Bj2cQ3O8.js} +1 -1
  108. package/dist/client/assets/{connect-layout-BKIx1TCS.js → connect-layout-CbgMWnkc.js} +1 -1
  109. package/dist/client/assets/{connection-DfFT6zSi.js → connection-CWiycsnd.js} +1 -1
  110. package/dist/client/assets/{connection-card-Cjr4qV1f.js → connection-card-DINEZcyg.js} +1 -1
  111. package/dist/client/assets/{connection-detail-5M2l4dlO.js → connection-detail-FkV9ORDZ.js} +1 -1
  112. package/dist/client/assets/{connection-form-helpers-D0VuujW_.js → connection-form-helpers-C825tgC1.js} +1 -1
  113. package/dist/client/assets/{connections-B_rZEPH1.js → connections-D8I3589k.js} +1 -1
  114. package/dist/client/assets/{context-PjhNUFtI.js → context-DQeq5C_R.js} +1 -1
  115. package/dist/client/assets/{context-menu-8QjmDiKV.js → context-menu-BZtI-iYm.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-D8Zq2NdW.js → create-organization-dialog-7qPWrl6e.js} +1 -1
  117. package/dist/client/assets/{daily-pulse-CD2M2tf5.js → daily-pulse-Bkk6WmeP.js} +1 -1
  118. package/dist/client/assets/{decopilot-BC1XQuwZ.js → decopilot-2FFmwoNB.js} +1 -1
  119. package/dist/client/assets/{device-hint-Be0ZjmvP.js → device-hint-DffcSqg_.js} +1 -1
  120. package/dist/client/assets/{dialog-mikl7FPK.js → dialog-Dw8xcjW3.js} +1 -1
  121. package/dist/client/assets/{discover-dfa3FdGx.js → discover-DIOje2Ib.js} +1 -1
  122. package/dist/client/assets/{domain-settings-YY0yjjj3.js → domain-settings-8z8kLU4n.js} +1 -1
  123. package/dist/client/assets/{download-app-dialog-B78Xzwoc.js → download-app-dialog-BSYwZSLo.js} +1 -1
  124. package/dist/client/assets/{drawer-D3v6_JsP.js → drawer-Dt1DFlEt.js} +1 -1
  125. package/dist/client/assets/{editor-D8tpvF9d.js → editor-CX3cazY1.js} +1 -1
  126. package/dist/client/assets/{empty-state-CkZIUtqW.js → empty-state-BE9_fazN.js} +1 -1
  127. package/dist/client/assets/{empty-state-C3HLisyP.js → empty-state-Dt2YybO3.js} +1 -1
  128. package/dist/client/assets/{extract-connection-data-D8uzEbgz.js → extract-connection-data-Cb2jVjCO.js} +1 -1
  129. package/dist/client/assets/{feature-gate-CSSfV67D.js → feature-gate-B0_tSsnV.js} +1 -1
  130. package/dist/client/assets/{feature-paywall-QqKok_5s.js → feature-paywall-BgH7Ln-V.js} +1 -1
  131. package/dist/client/assets/{file-explorer-C5kOKfct.js → file-explorer-Cbx1Ahiy.js} +1 -1
  132. package/dist/client/assets/{file-preview-BA4pWn9n.js → file-preview-BiCTzlao.js} +1 -1
  133. package/dist/client/assets/{file-share-button-BcBUJOwa.js → file-share-button-nPArR5GT.js} +1 -1
  134. package/dist/client/assets/{file-type-icon-BiPcxDCh.js → file-type-icon-DY-An3SA.js} +1 -1
  135. package/dist/client/assets/flat-project-D6pOpnSj.js +1 -0
  136. package/dist/client/assets/{folder-icon-A-avv35D.js → folder-icon-BXdHDD5F.js} +1 -1
  137. package/dist/client/assets/{form-DFhKgLoW.js → form-CqyDHzdF.js} +1 -1
  138. package/dist/client/assets/{gateway-client-CO0DTYhc.js → gateway-client-Dv06lV8N.js} +1 -1
  139. package/dist/client/assets/{general-B7JXtMaJ.js → general-m3RIl8ZM.js} +1 -1
  140. package/dist/client/assets/{home-D3X_QmDS.js → home-DP-XCZ30.js} +1 -1
  141. package/dist/client/assets/{icon-button-DpSb8Egz.js → icon-button-CzDbjYoM.js} +1 -1
  142. package/dist/client/assets/{index-BANaWTQj.js → index-8hvPIbgz.js} +1 -1
  143. package/dist/client/assets/{index-BhtKEZBr.js → index-BBMPGKIn.js} +1 -1
  144. package/dist/client/assets/{index-z_0ITlK_.js → index-BMb0J2ET.js} +1 -1
  145. package/dist/client/assets/{index-Iyfhqo9X.js → index-B_4zzu3P.js} +1 -1
  146. package/dist/client/assets/{index-DiCP27dD.js → index-Co-4sRnJ.js} +4 -4
  147. package/dist/client/assets/{index-CFlrgMgL.js → index-D0owq1f2.js} +1 -1
  148. package/dist/client/assets/{index-DJtgWs5g.js → index-D7VCPHbB.js} +3 -3
  149. package/dist/client/assets/{index-CdhxN82e.js → index-DA-4uVv2.js} +1 -1
  150. package/dist/client/assets/{index-B7fuDbL1.js → index-DcYvMhsA.js} +1 -1
  151. package/dist/client/assets/{index-BkXdjZbb.js → index-Dfk-aa2W.js} +1 -1
  152. package/dist/client/assets/{index-DC0oSvPN.css → index-DjN2oOmz.css} +1 -1
  153. package/dist/client/assets/{index-BG-txml-.js → index-DySHyK_e.js} +1 -1
  154. package/dist/client/assets/{index-CUFTVjlL.js → index-DyphIbgX.js} +1 -1
  155. package/dist/client/assets/{index-CHuCYD81.js → index-MAF8_efg.js} +1 -1
  156. package/dist/client/assets/{index-NbacZBE-.js → index-P52tuAKC.js} +1 -1
  157. package/dist/client/assets/{index-7tCYd4Vg.js → index-jL0svWh-.js} +1 -1
  158. package/dist/client/assets/{index-redirect-Ko3of0UI.js → index-redirect-CrmLnSSn.js} +1 -1
  159. package/dist/client/assets/{infiniteQueryObserver-CyHZuz-2.js → infiniteQueryObserver-DJ3A-TdU.js} +1 -1
  160. package/dist/client/assets/{infra-billing-C0BFdzuF.js → infra-billing-D6q7wZ_0.js} +1 -1
  161. package/dist/client/assets/{input-DiHRd4r7.js → input-BxLUTBXU.js} +1 -1
  162. package/dist/client/assets/{input-BVeDaXAt.js → input-CKfCW4iw.js} +1 -1
  163. package/dist/client/assets/{input-Djcpt5QF.js → input-COrt256w.js} +3 -3
  164. package/dist/client/assets/{integration-icon-Bao5FeG3.js → integration-icon-CNlbbwne.js} +1 -1
  165. package/dist/client/assets/{label-D7xsLlpE.js → label-DU_w-ckQ.js} +1 -1
  166. package/dist/client/assets/{layout-BAB69r-K.js → layout-DpzNGU1W.js} +1 -1
  167. package/dist/client/assets/{legacy-agents-deep-DMZRbqKj.js → legacy-agents-deep-D0IhRF5B.js} +1 -1
  168. package/dist/client/assets/{legacy-main-redirect-As359wx5.js → legacy-main-redirect-Bp-dMEE0.js} +1 -1
  169. package/dist/client/assets/{library-tab-CHLyyHog.js → library-tab-B5SoCSuy.js} +1 -1
  170. package/dist/client/assets/library-zwZu2XHX.js +1 -0
  171. package/dist/client/assets/{login-BxNWinsk.js → login-BabWcQ2i.js} +1 -1
  172. package/dist/client/assets/{markdown-bwKekgUZ.js → markdown-C9QLOL7g.js} +1 -1
  173. package/dist/client/assets/{mcp-app-renderer-CQvBXjgY.js → mcp-app-renderer-BUT4kPR2.js} +1 -1
  174. package/dist/client/assets/{mcp-oauth-BXj3mNzg.js → mcp-oauth-BimxrF_f.js} +1 -1
  175. package/dist/client/assets/{members-FveXAeAV.js → members-Bl784KGm.js} +1 -1
  176. package/dist/client/assets/{message-templates-Z-5W2V4k.js → message-templates-QcL4DUmR.js} +1 -1
  177. package/dist/client/assets/{mini-report-page-D-ZojmkU.js → mini-report-page-c9TkUi0R.js} +1 -1
  178. package/dist/client/assets/{mock-board-BhSA6gG2.js → mock-board-C0ZR6UK2.js} +1 -1
  179. package/dist/client/assets/{monaco-editor-D6jAaYUJ.js → monaco-editor-CCbTu1Zq.js} +1 -1
  180. package/dist/client/assets/{monitoring-stats-row-CJLoSY1V.js → monitoring-stats-row-Cr6UHFNA.js} +1 -1
  181. package/dist/client/assets/{multi-select-BgfFNUKh.js → multi-select-9oN2iBx_.js} +1 -1
  182. package/dist/client/assets/{mustache-fjqzOR6W.js → mustache-CKo61BiR.js} +1 -1
  183. package/dist/client/assets/{new-project-dialog-BB20uiKn.js → new-project-dialog-CzRX3bqD.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-BfvXWMRw.js → oauth-callback-DXsrYo58.js} +1 -1
  185. package/dist/client/assets/{oauth-callback-ai-provider-hQ4hVv77.js → oauth-callback-ai-provider-COzXSgab.js} +1 -1
  186. package/dist/client/assets/{onboarding-PSkWarZ7.js → onboarding-DOpWWbfX.js} +1 -1
  187. package/dist/client/assets/{openai-conversation-DBU1KXlW.js → openai-conversation-BQ0qlnvJ.js} +1 -1
  188. package/dist/client/assets/{optimistic-project-sidebar-views-CnvB9J-O.js → optimistic-project-sidebar-views-D4Emai-D.js} +1 -1
  189. package/dist/client/assets/{org-file-open-context-D7lCLqWP.js → org-file-open-context-CgCmoW9s.js} +1 -1
  190. package/dist/client/assets/{organization-choice-CfoAZ3dj.js → organization-choice-COxWAOgI.js} +1 -1
  191. package/dist/client/assets/{orgs-BA013DQ3.js → orgs-DqUwa1rJ.js} +1 -1
  192. package/dist/client/assets/{page-seo-form-7gMmDQJA.js → page-seo-form-Bi__p_tv.js} +1 -1
  193. package/dist/client/assets/{pair-Cevm6d0j.js → pair-BWDj_GIt.js} +1 -1
  194. package/dist/client/assets/{plan-ladder-aCvCcobI.js → plan-ladder-PugCzyO6.js} +1 -1
  195. package/dist/client/assets/{popover-DCTrph_D.js → popover-DmlD7L54.js} +1 -1
  196. package/dist/client/assets/{post-calendar-BpuA9JAu.js → post-calendar-_G3C9FIJ.js} +1 -1
  197. package/dist/client/assets/{post-editor-BKI84UXc.js → post-editor-CQmc7dyT.js} +1 -1
  198. package/dist/client/assets/{preview-content-Hk3IWI9Q.js → preview-content-mZxKtDk3.js} +1 -1
  199. package/dist/client/assets/{preview-dialog-v-YYOVPl.js → preview-dialog-DBbT1IPw.js} +1 -1
  200. package/dist/client/assets/{profile-CtTYj67N.js → profile-BZHYLZQF.js} +1 -1
  201. package/dist/client/assets/{project-app-view-mzT7jr0l.js → project-app-view-DHhfL06M.js} +1 -1
  202. package/dist/client/assets/{project-feed-D3XL-cR1.js → project-feed-BAQmClh0.js} +1 -1
  203. package/dist/client/assets/{project-icon-Big-MTDO.js → project-icon-CIt25m1v.js} +1 -1
  204. package/dist/client/assets/project-reports-BPgQePan.js +1 -0
  205. package/dist/client/assets/project-tasks-Bodr6bBn.js +1 -0
  206. package/dist/client/assets/{projects-CepdMOvE.js → projects-DkzfKq0o.js} +1 -1
  207. package/dist/client/assets/{projects-empty-state-vZgPOEGN.js → projects-empty-state-CGWR-feW.js} +1 -1
  208. package/dist/client/assets/{prompts-UVhYmQ30.js → prompts-DnC6lyZl.js} +1 -1
  209. package/dist/client/assets/record-editor-CWa5kuX3.js +1 -0
  210. package/dist/client/assets/{redirect-editor-DjVDiz1X.js → redirect-editor-CchUa0et.js} +1 -1
  211. package/dist/client/assets/{reports-rTgAGD0e.js → reports-CywIxjj0.js} +1 -1
  212. package/dist/client/assets/reports-DE_iinGQ.js +1 -0
  213. package/dist/client/assets/{reports-onboarding-jCEj8RJs.js → reports-onboarding-BwNbweYr.js} +1 -1
  214. package/dist/client/assets/{reports-tab-0RvL3I5A.js → reports-tab-E_94bQMh.js} +2 -2
  215. package/dist/client/assets/{repositories-C-ZPaM0R.js → repositories-D18-e4Ht.js} +1 -1
  216. package/dist/client/assets/{repository-binding-7uLkPgTO.js → repository-binding-B0HdN6Lz.js} +1 -1
  217. package/dist/client/assets/{repository-import-picker-CJLnodOL.js → repository-import-picker-DBLmxazs.js} +1 -1
  218. package/dist/client/assets/{repository-picker-BEisb5wQ.js → repository-picker-DIAetLTu.js} +1 -1
  219. package/dist/client/assets/{require-capability-jbhah2Og.js → require-capability-ngDTKpk-.js} +1 -1
  220. package/dist/client/assets/{required-auth-layout-BYkqQs2_.js → required-auth-layout-miKcB0rt.js} +1 -1
  221. package/dist/client/assets/{reset-password-B6tcqXNX.js → reset-password-goI4AN3o.js} +1 -1
  222. package/dist/client/assets/{resizable-BsCV6tK2.js → resizable-CpyyJXRZ.js} +1 -1
  223. package/dist/client/assets/{resolve-tab-icon-DFeiFaOh.js → resolve-tab-icon-CRFTmUo8.js} +1 -1
  224. package/dist/client/assets/{review-settings-BiNvlyCs.js → review-settings-bh0EyH5K.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-BZeYaPP7.js → rich-text-link-control-Co6k6OlH.js} +1 -1
  226. package/dist/client/assets/{roles-DOsWyyAw.js → roles-Dfc6a85e.js} +1 -1
  227. package/dist/client/assets/{route-jVSRh2Ao.js → route-BUFpECc9.js} +1 -1
  228. package/dist/client/assets/route-CrrxgfJi.js +1 -0
  229. package/dist/client/assets/route-DAkaBbdM.js +1 -0
  230. package/dist/client/assets/{runnable-block-editor-CnJtlMKM.js → runnable-block-editor-CDsWwzF6.js} +1 -1
  231. package/dist/client/assets/{sandbox-lifecycle-context-BAJMUPhe.js → sandbox-lifecycle-context-FrgKEa4u.js} +1 -1
  232. package/dist/client/assets/{schema-uULRlMFx.js → schema-Bg7Z4WK1.js} +1 -1
  233. package/dist/client/assets/{scroll-area-DVyEm7OM.js → scroll-area-B-lzB5tO.js} +1 -1
  234. package/dist/client/assets/{search-input-BD1KUApf.js → search-input-DxispljN.js} +1 -1
  235. package/dist/client/assets/{search-toggle-M1mnWjNp.js → search-toggle-BUr7OpuE.js} +1 -1
  236. package/dist/client/assets/{secret-picker-BhFpEdB6.js → secret-picker-Cdibhh7U.js} +1 -1
  237. package/dist/client/assets/{secrets-DPafm7lX.js → secrets-CConrVDh.js} +1 -1
  238. package/dist/client/assets/{sections-editor-D6SV8WNT.js → sections-editor-0i-naoBY.js} +1 -1
  239. package/dist/client/assets/{select-XfsDki64.js → select-CZTYe-RM.js} +1 -1
  240. package/dist/client/assets/{select-model-DwXOaJtS.js → select-model-CTMl4DBk.js} +1 -1
  241. package/dist/client/assets/{seo-editor-FqSozPeP.js → seo-editor-Bu8hE-fM.js} +1 -1
  242. package/dist/client/assets/{separator-kOZLr21y.js → separator-D1tnRKZk.js} +1 -1
  243. package/dist/client/assets/{settings-tab-Bre5HiIa.js → settings-tab-Bn1uHMT_.js} +1 -1
  244. package/dist/client/assets/{sheet-B-78DEn-.js → sheet-DYXq70sZ.js} +1 -1
  245. package/dist/client/assets/{shell-layout-BqGUI9qq.js → shell-layout-HGSCI1cW.js} +1 -1
  246. package/dist/client/assets/{skills-B6koxdnK.js → skills-DiX3Wo9s.js} +1 -1
  247. package/dist/client/assets/{sso-eRUC1kMb.js → sso-B97iUHe5.js} +1 -1
  248. package/dist/client/assets/{suggestion-gvkpO2tS.js → suggestion-BkHBW1eO.js} +1 -1
  249. package/dist/client/assets/{switch-q3W9ZKax.js → switch-BGCsiekK.js} +1 -1
  250. package/dist/client/assets/{synced-repos-DmLSe-Io.js → synced-repos-jTLgevgn.js} +1 -1
  251. package/dist/client/assets/{tab-icon-glyph-dHUEuXe7.js → tab-icon-glyph--MlM4zGI.js} +1 -1
  252. package/dist/client/assets/{table-DP3ml4By.js → table-CPY_9uUo.js} +1 -1
  253. package/dist/client/assets/{tabs-QsV8VgLb.js → tabs-aXag5nk_.js} +1 -1
  254. package/dist/client/assets/{task-board-Bsy8g6jg.js → task-board-DV8c5Zhu.js} +1 -1
  255. package/dist/client/assets/{task-route-DvSaC1w6.js → task-route-DkUw5kJo.js} +1 -1
  256. package/dist/client/assets/{task-status-DaLuiSZl.js → task-status-C1rdpmGX.js} +1 -1
  257. package/dist/client/assets/{taskboard-analytics-CPih1fTU.js → taskboard-analytics-DXhKcjBe.js} +1 -1
  258. package/dist/client/assets/{tasks-BylQtsAP.js → tasks-4av_39uG.js} +1 -1
  259. package/dist/client/assets/tasks-DMbENiIa.js +1 -0
  260. package/dist/client/assets/{textarea-BTYU6whs.js → textarea-BwFbzFhR.js} +1 -1
  261. package/dist/client/assets/{thread-analytics-BcMW4cpe.js → thread-analytics-ZZSgMAeG.js} +1 -1
  262. package/dist/client/assets/{thread-button-DUMd6Gl5.js → thread-button-D-dNsXV2.js} +1 -1
  263. package/dist/client/assets/{thread-intent-BUoHTmSs.js → thread-intent-B5r6uX01.js} +1 -1
  264. package/dist/client/assets/{thread-route-DTtV9-z7.js → thread-route-BAsLNDrI.js} +1 -1
  265. package/dist/client/assets/{thread-route-Dhlv68Qd.js → thread-route-BtbKeVmC.js} +1 -1
  266. package/dist/client/assets/{thread-sheet-body-Bl4vCX_3.js → thread-sheet-body-DITXlsnG.js} +1 -1
  267. package/dist/client/assets/{toggle-group-D4u16ScM.js → toggle-group-CSB3oZUC.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-D6XJE-fW.js → toolbar-icon-button-C8w8sPNx.js} +1 -1
  269. package/dist/client/assets/{tooltip-Tr2HPvjQ.js → tooltip-CYfkikaX.js} +1 -1
  270. package/dist/client/assets/{track-DL1FzN4e.js → track-CsuwcppY.js} +1 -1
  271. package/dist/client/assets/{types-DCGsxM-a.js → types-FVrLJnQ_.js} +1 -1
  272. package/dist/client/assets/{usage-stats-CWr5CEzC.js → usage-stats-B5xe2MvZ.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-B_f1rQjj.js → use-ai-providers-zPZTeTn6.js} +1 -1
  274. package/dist/client/assets/{use-automations-Cq1O-3i0.js → use-automations-DBkOR8ED.js} +1 -1
  275. package/dist/client/assets/{use-autosave-CHEjRH5z.js → use-autosave-xZ5zN50O.js} +1 -1
  276. package/dist/client/assets/{use-chat-layout-state-CT7zBoif.js → use-chat-layout-state-_hTo6qiX.js} +1 -1
  277. package/dist/client/assets/{use-connect-companion-CfMsP3Rn.js → use-connect-companion-PwrgKsDQ.js} +1 -1
  278. package/dist/client/assets/{use-connection-DLt6R4bi.js → use-connection-DzHiClla.js} +1 -1
  279. package/dist/client/assets/{use-copy-CLYTIONg.js → use-copy-kTB71Cx6.js} +1 -1
  280. package/dist/client/assets/{use-create-virtual-mcp-m11_0WJM.js → use-create-virtual-mcp-BXXlVaJ1.js} +1 -1
  281. package/dist/client/assets/{use-date-fns-locale-1j3nOfJv.js → use-date-fns-locale-DmITod04.js} +1 -1
  282. package/dist/client/assets/{use-debounced-autosave-Yt6HWq-D.js → use-debounced-autosave-8CpUK2dy.js} +1 -1
  283. package/dist/client/assets/{use-debounced-value-C3sc6opm.js → use-debounced-value-DDoK_9IU.js} +1 -1
  284. package/dist/client/assets/{use-deco-credits-BMaRSUa6.js → use-deco-credits-DIzsZghd.js} +1 -1
  285. package/dist/client/assets/{use-decopilot-events-CrIzSMHr.js → use-decopilot-events-BZEZhg3r.js} +1 -1
  286. package/dist/client/assets/{use-delete-connection-BGvztQK_.js → use-delete-connection-DDnKZtgg.js} +1 -1
  287. package/dist/client/assets/{use-deployment-admin-CZoIvK7e.js → use-deployment-admin-ApUENcoe.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-D0VACG9d.js → use-fast-preview-draft-url-BZzWJ74e.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-qerNjBlD.js → use-file-configs-Dckq5B6h.js} +1 -1
  290. package/dist/client/assets/{use-infinite-scroll-dYJQUb5x.js → use-infinite-scroll-CaES8Ly6.js} +1 -1
  291. package/dist/client/assets/{use-join-requests-BIlkPzgz.js → use-join-requests-CKlzLYmF.js} +1 -1
  292. package/dist/client/assets/{use-main-panel-tabs-CY7VBXj1.js → use-main-panel-tabs-BEaE1an6.js} +1 -1
  293. package/dist/client/assets/{use-mcp-auth-status-jUIuYcXR.js → use-mcp-auth-status-CEJ_jWCe.js} +1 -1
  294. package/dist/client/assets/{use-mcp-client-B2MWBaco.js → use-mcp-client-huiboiuW.js} +1 -1
  295. package/dist/client/assets/{use-mcp-prompts-B3G5Db0n.js → use-mcp-prompts-CK7nTCfz.js} +1 -1
  296. package/dist/client/assets/{use-mcp-tools-BGTSgzQD.js → use-mcp-tools-DrNXuvH-.js} +1 -1
  297. package/dist/client/assets/{use-members-Co6URFc9.js → use-members-Czj8Or22.js} +1 -1
  298. package/dist/client/assets/{use-mobile-pQqIDSFe.js → use-mobile-C_c7X_X9.js} +1 -1
  299. package/dist/client/assets/{use-navigate-to-agent-DsFIew61.js → use-navigate-to-agent-B8uYHMgO.js} +1 -1
  300. package/dist/client/assets/use-new-blocks-editor-DRI-powp.js +1 -0
  301. package/dist/client/assets/{use-open-billing-url-9TGzfMS0.js → use-open-billing-url-ClFzvK5L.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-BsYVB1hJ.js → use-org-auth-client-DGMlZ1DJ.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-CVraJ6yz.js → use-org-fs-Zkz7cnFM.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-CjTrRQU6.js → use-org-repo-syncs-Bl-zLisR.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-DEPHrl0A.js → use-org-sso-WomPaWOu.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-DIN278U2.js → use-organization-roles-D0rAtkDp.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-Bj01eknb.js → use-organization-settings-BXIx1FLP.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-DSCpdSlE.js → use-panel-navigate-9QHW-FCg.js} +1 -1
  309. package/dist/client/assets/{use-project-scope-CtBx9mRG.js → use-project-scope-Bn-XeyFm.js} +1 -1
  310. package/dist/client/assets/{use-releases-CniZP6q6.js → use-releases-DXjAp2xg.js} +1 -1
  311. package/dist/client/assets/{use-reports-diagnostic-B2JxQzqt.js → use-reports-diagnostic-MPgYdKXV.js} +1 -1
  312. package/dist/client/assets/{use-secrets-C9609GG4.js → use-secrets-oQfbwqKQ.js} +1 -1
  313. package/dist/client/assets/{use-section-preview-base-t3MPJMlb.js → use-section-preview-base-CmEtoGbE.js} +1 -1
  314. package/dist/client/assets/{use-session-runtime-_LaLKVsW.js → use-session-runtime-Mt5i1NtG.js} +1 -1
  315. package/dist/client/assets/{use-tags-DyCG8Pgp.js → use-tags-Bbqw8zS9.js} +1 -1
  316. package/dist/client/assets/{use-task-board-analytics-x1OhPjoJ.js → use-task-board-analytics-_GYuIvYU.js} +1 -1
  317. package/dist/client/assets/{use-task-board-events-BWmV0h-s.js → use-task-board-events-CHHrBRNs.js} +1 -1
  318. package/dist/client/assets/{use-task-metadata-Ci4ti26B.js → use-task-metadata-Bwd62AhF.js} +1 -1
  319. package/dist/client/assets/{use-thread-analytics-Du-VhVh5.js → use-thread-analytics-BHXCrsPt.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-DmyvMQPi.js → use-thread-outputs-DWqKD4Kd.js} +1 -1
  321. package/dist/client/assets/useInfiniteQuery-BbXVrX4k.js +1 -0
  322. package/dist/client/assets/{useQueries-B-98FYC1.js → useQueries-P_HReZM-.js} +1 -1
  323. package/dist/client/assets/useSuspenseInfiniteQuery-Ddc-zVFy.js +1 -0
  324. package/dist/client/assets/{users-isQ6tVka.js → users-D7Dbr_DI.js} +1 -1
  325. package/dist/client/assets/{utils-DqphBcT3.js → utils-v5cDdvER.js} +1 -1
  326. package/dist/client/assets/{variant-calendar-DcvcdAAr.js → variant-calendar-ANwfNoin.js} +1 -1
  327. package/dist/client/assets/{variant-matcher-override-DkXKwTi8.js → variant-matcher-override-UcAv0Nhz.js} +1 -1
  328. package/dist/client/assets/{view-mode-toggle-DkhaajMC.js → view-mode-toggle-DDXXNR3I.js} +1 -1
  329. package/dist/client/assets/{virtual-mcp-BC5Jfihj.js → virtual-mcp-TWIqdaTw.js} +1 -1
  330. package/dist/client/index.html +2 -2
  331. package/dist/server/cli.js +597 -595
  332. package/dist/server/migrate.js +154 -152
  333. package/dist/server/server.js +1 -1
  334. package/package.json +1 -1
  335. package/dist/client/assets/agent-app-6JHlx-Wc.js +0 -1
  336. package/dist/client/assets/agent-deck-B05_iIMl.js +0 -1
  337. package/dist/client/assets/agent-library-DWODQYB3.js +0 -1
  338. package/dist/client/assets/agent-library-file-B_xfN-mr.js +0 -1
  339. package/dist/client/assets/agent-settings-C84DY1Qi.js +0 -1
  340. package/dist/client/assets/agent-site-editor-code-Cn2_bvrE.js +0 -2
  341. package/dist/client/assets/agent-view-hGrHic_u.js +0 -1
  342. package/dist/client/assets/api-keys-zZAM-5ss.js +0 -1
  343. package/dist/client/assets/flat-project-joz7A3io.js +0 -1
  344. package/dist/client/assets/library-DEKjW-rT.js +0 -1
  345. package/dist/client/assets/project-reports-Daw_hYhG.js +0 -1
  346. package/dist/client/assets/project-tasks-CtprO76f.js +0 -1
  347. package/dist/client/assets/record-editor-CvGzqZ3N.js +0 -1
  348. package/dist/client/assets/reports-BqUgoTuQ.js +0 -1
  349. package/dist/client/assets/route-0XzjohZn.js +0 -1
  350. package/dist/client/assets/route-DERwtrnp.js +0 -1
  351. package/dist/client/assets/tasks-D8DST2AK.js +0 -1
  352. package/dist/client/assets/use-new-blocks-editor-vSm_pB4S.js +0 -1
  353. package/dist/client/assets/useInfiniteQuery-VJ_kzi-a.js +0 -1
  354. package/dist/client/assets/useSuspenseInfiniteQuery-Bw_5F2ui.js +0 -1
@@ -1 +1 @@
1
- import{c as b,l as w,j as a,h as j}from"./index-DiCP27dD.js";import{i as v}from"./SearchMd-zLAR-XV2.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
1
+ import{c as b,l as w,j as a,h as j}from"./index-Co-4sRnJ.js";import{i as v}from"./SearchMd-DWmqXOB3.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
@@ -1 +1 @@
1
- import{c as K,r as C,l as B,j as a}from"./index-DiCP27dD.js";import{i as I}from"./SearchMd-zLAR-XV2.js";import{i as M}from"./X-BRJDCcj9.js";import{I as O}from"./icon-button-DpSb8Egz.js";function H(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{H as S};
1
+ import{c as K,r as C,l as B,j as a}from"./index-Co-4sRnJ.js";import{i as I}from"./SearchMd-DWmqXOB3.js";import{i as M}from"./X-CMwuaze4.js";import{I as O}from"./icon-button-CzDbjYoM.js";function H(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{H as S};
@@ -1 +1 @@
1
- import{c as x,b as d,j as l}from"./index-DiCP27dD.js";import{s as j}from"./User01-BmSpscpo.js";import{t as E}from"./Users01-Cu0IOT-O.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
1
+ import{c as x,b as d,j as l}from"./index-Co-4sRnJ.js";import{s as j}from"./User01-BY20MgLM.js";import{t as E}from"./Users01-qvvwVlrt.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
@@ -1 +1 @@
1
- import{c as j,b as y,j as s,n as C,fn as $,E as F,r as N,aS as L,B as D,a6 as E,t as _}from"./index-DiCP27dD.js";import{i as O}from"./AlertCircle-DNh15odk.js";import{s as B}from"./Plus-B2OSMT7h.js";import{s as A}from"./User01-BmSpscpo.js";import{t as R}from"./Users01-Cu0IOT-O.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-mikl7FPK.js";import{I as z}from"./input-BVeDaXAt.js";import{L as w}from"./label-D7xsLlpE.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-XfsDki64.js";import{T as W}from"./textarea-BTYU6whs.js";import{u as X,a as Y}from"./use-secrets-C9609GG4.js";import{R as Z}from"./require-capability-jbhah2Og.js";import"./X-BRJDCcj9.js";import"./index-CHuCYD81.js";import"./Check-D-yzmwYn.js";import"./ChevronUp-D60SP3XH.js";import"./access-gate-zVG3uMCf.js";import"./capability-load-error-Ikh4so4d.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?A:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(K,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(B,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{ze as default};
1
+ import{c as j,b as y,j as s,n as C,fn as $,E as F,r as N,aS as L,B as D,a6 as E,t as _}from"./index-Co-4sRnJ.js";import{i as O}from"./AlertCircle-BRBGpzZA.js";import{s as B}from"./Plus-B0dyDF7l.js";import{s as A}from"./User01-BY20MgLM.js";import{t as R}from"./Users01-qvvwVlrt.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-Dw8xcjW3.js";import{I as z}from"./input-CKfCW4iw.js";import{L as w}from"./label-DU_w-ckQ.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-CZTYe-RM.js";import{T as W}from"./textarea-BwFbzFhR.js";import{u as X,a as Y}from"./use-secrets-oQfbwqKQ.js";import{R as Z}from"./require-capability-ngDTKpk-.js";import"./X-CMwuaze4.js";import"./index-MAF8_efg.js";import"./Check-CO_ET4WO.js";import"./ChevronUp-DnrzvZVs.js";import"./access-gate-BOQqTHG4.js";import"./capability-load-error-C1opTYYa.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?A:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(K,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(B,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{ze as default};
@@ -1 +1 @@
1
- import{c as Jt,b as Yt,r as j,l as oe,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-DiCP27dD.js";import{u as _o}from"./chat-context-BME83pNr.js";import{u as fs}from"./use-new-blocks-editor-vSm_pB4S.js";import{E as jo,F as Eo,G as ko,H as wo,I as Ro,J as Vo,K as To,V as No,L as Ao,N as Bn,O as Mo,Q as Po,C as cs,y as us,e as Co,f as Do,j as Ko,u as Bo,T as Ln,U as Lo,W as Fo,X as Io,Y as Oo,Z as zo,p as rs,A as kt,_ as $o,$ as Ho,w as Fn,a0 as Go,a1 as qo,a2 as is,a3 as In,a4 as On,a5 as zn,a6 as As,a7 as Wo,a8 as Uo,z as Jo,a9 as $n,aa as Yo,ab as Hn,ac as Gn,M as Qo,ad as qn,ae as lt,d as Zo,af as qt,ag as Xo,ah as er,ai as Ms,aj as tr}from"./runnable-block-editor-CnJtlMKM.js";import{f as sr}from"./repository-binding-7uLkPgTO.js";import{n as nr,t as ar}from"./ChevronUp-D60SP3XH.js";import{a5 as oa,b as ms,ai as or,x as rr,Z as Wn,G as Un}from"./agent-icon-MUEfToW1.js";import{S as Bt}from"./scroll-area-DVyEm7OM.js";import{b as ct,T as ut,a as dt}from"./tooltip-Tr2HPvjQ.js";import{m as ir,u as lr,P as cr}from"./mustache-fjqzOR6W.js";import{aq as ra,c as Is,ar as ia,G as ur,ag as Rt,a4 as Ds,as as Ks,ah as xt,a5 as Lt,j as dr,l as mr,g as fr,r as ls,ak as pr,af as Wt,at as tt,au as Jn,a6 as Ps,ae as bt,ad as Ut,av as hr,aw as gr,K as vr,ax as Sr,ai as Yn,_ as Qn,ay as yr,az as wt,aA as br,aB as xr,aC as _r,aD as Zn,aE as jr,aF as Er,aG as kr,ac as wr,aH as Rr,aI as Vr,aJ as Tr,aK as Nr,ab as Ar,aL as Mr}from"./claim-phase-copy-cMVgzjzE.js";import{a as Pr}from"./Copy01-CB0oESJQ.js";import{a as Bs,d as la}from"./UserSquare-DQSzlDyj.js";import{b as Xn}from"./Tool01-BOjbFJCz.js";import{s as ea}from"./Image01-D5rleQuB.js";import{s as Cr}from"./Plus-B2OSMT7h.js";import{s as Dr}from"./Trash01-XL5_ynxe.js";import{i as Ls}from"./ZoomOut-CHBfhru9.js";import{a as Kr,b as ta,d as Br,K as Lr,P as Fr,u as Ir,C as Or,s as zr,e as ds,D as $r,c as Hr,S as Gr,v as qr}from"./rich-text-link-control-BZeYaPP7.js";import{a as Wr,P as sa,b as Ur}from"./page-seo-form-7gMmDQJA.js";import{u as Jr,A as Yr}from"./use-section-preview-base-t3MPJMlb.js";import{b as na,a as Qr}from"./variant-matcher-override-DkXKwTi8.js";import"./use-panel-navigate-DSCpdSlE.js";import"./thread-route-DTtV9-z7.js";import"./use-project-scope-CtBx9mRG.js";import"./autosend-Cm6PSWmI.js";import"./thread-intent-BUoHTmSs.js";import"./use-mcp-client-B2MWBaco.js";import"./auth-CtKUYryj.js";import"./backoff-8mStPHYB.js";import"./task-board-Bsy8g6jg.js";import"./schema-uULRlMFx.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-CrIzSMHr.js";import"./use-ai-providers-B_f1rQjj.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-Bj01eknb.js";import"./use-session-runtime-_LaLKVsW.js";import"./Sun-BlPxF05z.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Cevm6d0j.js";import"./LinkBroken01-gwFdcT6K.js";import"./Check-D-yzmwYn.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BKpQ7Moy.js";import"./use-copy-CLYTIONg.js";import"./usage-stats-CWr5CEzC.js";import"./markdown-bwKekgUZ.js";import"./dialog-mikl7FPK.js";import"./X-BRJDCcj9.js";import"./org-file-open-context-D7lCLqWP.js";import"./use-mobile-pQqIDSFe.js";import"./shell-layout-BqGUI9qq.js";import"./avatar-ay32d7Rq.js";import"./User01-BmSpscpo.js";import"./Palette-DjIClyYF.js";import"./XClose-cblogra0.js";import"./download-app-dialog-B78Xzwoc.js";import"./CheckCircle-rjwyzOFk.js";import"./Monitor01-CwcZK9j8.js";import"./command-CIkNvcpT.js";import"./index-CFlrgMgL.js";import"./SearchMd-zLAR-XV2.js";import"./integration-icon-Bao5FeG3.js";import"./project-icon-Big-MTDO.js";import"./new-project-dialog-BB20uiKn.js";import"./ArrowLeft-Cqg3j8St.js";import"./input-BVeDaXAt.js";import"./label-D7xsLlpE.js";import"./repository-import-picker-CJLnodOL.js";import"./use-navigate-to-agent-DsFIew61.js";import"./repository-picker-BEisb5wQ.js";import"./LinkExternal01-DY6YFto3.js";import"./useInfiniteQuery-VJ_kzi-a.js";import"./infiniteQueryObserver-CyHZuz-2.js";import"./collection-search-DF-hol44.js";import"./ShoppingBag01-DodmZnt4.js";import"./use-debounced-value-C3sc6opm.js";import"./required-auth-layout-BYkqQs2_.js";import"./use-org-sso-DEPHrl0A.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CQvBXjgY.js";import"./types-DCGsxM-a.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-CO0DTYhc.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-DNh15odk.js";import"./sheet-B-78DEn-.js";import"./use-connection-DLt6R4bi.js";import"./Link01-Cw5nVzWM.js";import"./use-mcp-prompts-B3G5Db0n.js";import"./index-z_0ITlK_.js";import"./form-DFhKgLoW.js";import"./use-thread-outputs-DmyvMQPi.js";import"./file-type-icon-BiPcxDCh.js";import"./popover-DCTrph_D.js";import"./utils-DqphBcT3.js";import"./monaco-editor-D6jAaYUJ.js";import"./editor-D8tpvF9d.js";import"./calendar-BrlmwFhH.js";import"./textarea-BTYU6whs.js";import"./select-XfsDki64.js";import"./index-CHuCYD81.js";import"./switch-q3W9ZKax.js";import"./combobox-BqvA6tS8.js";import"./alert-dialog-DMpR0cgA.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-BgnfyY39.js";import"./DotsVertical-JQQSHvl4.js";import"./search-input-BD1KUApf.js";import"./tabs-QsV8VgLb.js";import"./use-file-configs-qerNjBlD.js";import"./asset-utils-B3iwsCJa.js";import"./use-chat-layout-state-CT7zBoif.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-D4u16ScM.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-6P5DjR1t.js";import"./CreditCard01-D5kRRYiA.js";import"./Key01-k7QWuZZQ.js";import"./Users01-Cu0IOT-O.js";import"./section-preview-url-7zfngvgW.js";function Zr(v){return v.schema?.definitions??v.schema?.$defs??{}}function ca(v,e){const u=Zr(e),p=u[btoa(v)];if(!p)return[];const h=[p];if(Array.isArray(p.allOf)){const k=p.allOf.find(w=>typeof w.$ref=="string")?.$ref;if(typeof k=="string"){const w=u[k.replace("#/definitions/","")];w&&h.push(w)}}return h}function Xr(v,e){for(const u of ca(v,e)){const p=typeof u.image=="string"?u.image:void 0;if(p?.includes("{{{"))return p}}function ei(v,e){if(!e)return;const u=ra(v);if(!u)return;const p=Xr(u.resolveType,e);if(!p)return;const h=jo(p,u.data);if(h)return Eo(h)}const ti={escape:ko};function si(v,e){for(const u of ca(v,e)){const p=typeof u.title=="string"?u.title:void 0;if(p?.includes("{{"))return p}}function ni(v,e){if(!e)return;const u=ra(v);if(u)try{const p=si(u.resolveType,e);return p&&ir.render(p,u.data,{},ti).trim()||void 0}catch{return}}function ai(v){const e=Jt.c(13),{icon:u,label:p,className:h}=v;let k;e[0]!==h?(k=oe("size-3.5",h),e[0]=h,e[1]=k):k=e[1];let w;e[2]!==u||e[3]!==k?(w=n.jsx(u,{className:k}),e[2]=u,e[3]=k,e[4]=w):w=e[4];let y;e[5]!==p||e[6]!==w?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:w})}),e[5]=p,e[6]=w,e[7]=y):y=e[7];let T;e[8]!==p?(T=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=T):T=e[9];let b;return e[10]!==y||e[11]!==T?(b=n.jsxs(ct,{children:[y,T]}),e[10]=y,e[11]=T,e[12]=b):b=e[12],b}const oi="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 aa(v){return Array.from({length:v},(e,u)=>({id:crypto.randomUUID(),index:u}))}function ua(v){return v.map((e,u)=>({...e,index:u}))}function ri(v,e){if(e===v.length)return v;if(e<v.length)return ua(v.slice(0,e));const u=Array.from({length:e-v.length},(p,h)=>({id:crypto.randomUUID(),index:v.length+h}));return[...v,...u]}function da(v){const e=Jt.c(44),{section:u,raw:p,meta:h,decofile:k}=v,w=Yt(),y=fs(),T=u.isSavedBlock===!0,b=u.isMultivariate===!0;let Z;e[0]!==h||e[1]!==p?(Z=p&&h?ei(p,h):void 0,e[0]=h,e[1]=p,e[2]=Z):Z=e[2];const me=Z;let Ke;e[3]!==h||e[4]!==b||e[5]!==p||e[6]!==T?(Ke=p&&h&&!T&&!b?ni(p,h):void 0,e[3]=h,e[4]=b,e[5]=p,e[6]=T,e[7]=Ke):Ke=e[7];const Be=Ke;let Te;e[8]!==k||e[9]!==h||e[10]!==p||e[11]!==u?(Te=Ao(p,u,k,h),e[8]=k,e[9]=h,e[10]=p,e[11]=u,e[12]=Te):Te=e[12];const re=Te;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,ge=T?ms:b?oa:la;let $;e[16]!==b||e[17]!==T?($=T?{color:ur}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=T,e[18]=$):$=e[18];const c=$;let O;e[19]!==ge||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(ge,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(or,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=ge,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==me?(l=me&&n.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=l):l=e[23];let J;e[24]!==y||e[25]!==c?(J=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:c}),e[24]=y,e[25]=c,e[26]=J):J=e[26];const G=y?"shrink":"flex-1",ke=u.isHidden&&"line-through opacity-50";let Ne;e[27]!==ke||e[28]!==G?(Ne=oe("min-w-0 truncate text-sm font-medium",G,ke),e[27]=ke,e[28]=G,e[29]=Ne):Ne=e[29];const qe=Be??u.label;let _e;e[30]!==Ne||e[31]!==qe?(_e=n.jsx("span",{className:Ne,children:qe}),e[30]=Ne,e[31]=qe,e[32]=_e):_e=e[32];let d;e[33]!==V||e[34]!==y||e[35]!==re||e[36]!==w?(d=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:w("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),re&&n.jsx(Bn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):re&&n.jsx(Bn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=re,e[36]=w,e[37]=d):d=e[37];let M;return e[38]!==_e||e[39]!==d||e[40]!==O||e[41]!==l||e[42]!==J?(M=n.jsxs(n.Fragment,{children:[O,l,J,_e,d]}),e[38]=_e,e[39]=d,e[40]=O,e[41]=l,e[42]=J,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="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 ma(v,e,u){if(u)return Mo({selected:e});const p=v.isSavedBlock===!0,h=v.isMultivariate===!0;return oe("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":p?ii:h?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Cs(v,e){return oe("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 ci(v){const e=Jt.c(90),{section:u,raw:p,meta:h,decofile:k,sortableId:w,selected:y,onSelect:T,onDelete:b,onDuplicate:Z,onMakeReusable:me,onToggleHidden:Ke,onToggleLazy:Be,onAddVariant:Te,onDetach:re}=v,r=Yt(),V=fs(),ge=p?Is(p.__resolveType??""):!1,$=u.isHidden===!0,c=ge||$;let O;e[0]!==u?(O=ia(u),e[0]=u,e[1]=O):O=e[1];const l=O;let J;e[2]!==w?(J={id:w,animateLayoutChanges:mi},e[2]=w,e[3]=J):J=e[3];const{attributes:G,listeners:ke,setNodeRef:Ne,transform:qe,isDragging:_e}=Ir(J);let d;e[4]!==qe?(d=Or.Transform.toString(qe?{...qe,x:0}:null),e[4]=qe,e[5]=d):d=e[5];const M=_e?0:void 0;let We;e[6]!==d||e[7]!==M?(We={transform:d,opacity:M},e[6]=d,e[7]=M,e[8]=We):We=e[8];const C=We;let Ue;e[9]!==u?(Ue=Ro(u),e[9]=u,e[10]=Ue):Ue=e[10];const z=Ue,mt="button",fe=0;let ze;e[11]!==T?(ze=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},e[11]=T,e[12]=ze):ze=e[12];const _t=_e?"cursor-grabbing":"cursor-pointer";let Le;e[13]!==V||e[14]!==u||e[15]!==y||e[16]!==_t?(Le=oe("touch-none transition-colors",_t,ma(u,y,V)),e[13]=V,e[14]=u,e[15]=y,e[16]=_t,e[17]=Le):Le=e[17];let ie;e[18]!==k||e[19]!==h||e[20]!==p||e[21]!==u?(ie=n.jsx(da,{section:u,raw:p,meta:h,decofile:k}),e[18]=k,e[19]=h,e[20]=p,e[21]=u,e[22]=ie):ie=e[22];const le=!V&&!u.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Cs(c,ge)),onClick:P=>{P.stopPropagation(),Be()},onPointerDown:di,children:n.jsx(Ls,{className:oe("h-3.5 w-3.5",ge&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ae=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ke,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Cs(c,$)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ui,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=vo,A=To;let ce;e[23]!==r?(ce=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ce):ce=e[24];const we=oe(Cs(c,!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 Me;e[25]!==A||e[26]!==ce||e[27]!==we?(Me=n.jsx(A,{label:ce,classicClassName:we}),e[25]=A,e[26]=ce,e[27]=we,e[28]=Me):Me=e[28];let Re;e[29]!==V||e[30]!==ge||e[31]!==Be||e[32]!==u.isMultivariate||e[33]!==r?(Re=V&&!u.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Be()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=ge,e[31]=Be,e[32]=u.isMultivariate,e[33]=r,e[34]=Re):Re=e[34];let H;e[35]!==Z?(H=P=>{P.stopPropagation(),Z()},e[35]=Z,e[36]=H):H=e[36];let ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=ue):ue=e[37];let je;e[38]!==r?(je=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=je):je=e[39];let pe;e[40]!==H||e[41]!==je?(pe=n.jsxs(Kt,{onClick:H,children:[ue,je]}),e[40]=H,e[41]=je,e[42]=pe):pe=e[42];let ne;e[43]!==V||e[44]!==l||e[45]!==Te||e[46]!==r?(ne=l&&n.jsxs(Kt,{className:oe(!V&&No),onClick:P=>{P.stopPropagation(),Te()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Te,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==V||e[49]!==z||e[50]!==me||e[51]!==r?(he=z&&n.jsxs(Kt,{className:oe(!V&&oi),onClick:P=>{P.stopPropagation(),me()},children:[V?n.jsx(ms,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=me,e[51]=r,e[52]=he):he=e[52];let ae;e[53]!==V||e[54]!==re||e[55]!==u.isMultivariate||e[56]!==u.isSavedBlock||e[57]!==r?(ae=u.isSavedBlock===!0&&!u.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),re()},children:[V?n.jsx(la,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=re,e[55]=u.isMultivariate,e[56]=u.isSavedBlock,e[57]=r,e[58]=ae):ae=e[58];let Pe;e[59]!==b?(Pe=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Pe):Pe=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Dr,{className:"h-4 w-4"}),e[61]=ve):ve=e[61];let Ve;e[62]!==r?(Ve=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ve):Ve=e[63];let Ee;e[64]!==Pe||e[65]!==Ve?(Ee=n.jsxs(Kt,{variant:"destructive",onClick:Pe,children:[ve,Ve]}),e[64]=Pe,e[65]=Ve,e[66]=Ee):Ee=e[66];let Se;e[67]!==Re||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==ae||e[72]!==Ee?(Se=n.jsxs(So,{align:"end",className:"w-44",children:[Re,pe,ne,he,ae,Ee]}),e[67]=Re,e[68]=pe,e[69]=ne,e[70]=he,e[71]=ae,e[72]=Ee,e[73]=Se):Se=e[73];let ye;e[74]!==B||e[75]!==Me||e[76]!==Se?(ye=n.jsxs(B,{children:[Me,Se]}),e[74]=B,e[75]=Me,e[76]=Se,e[77]=ye):ye=e[77];let $e;return e[78]!==G||e[79]!==ke||e[80]!==T||e[81]!==Ne||e[82]!==C||e[83]!==Le||e[84]!==ie||e[85]!==le||e[86]!==Ae||e[87]!==ye||e[88]!==ze?($e=n.jsxs("div",{ref:Ne,style:C,...G,...ke,role:mt,tabIndex:fe,onClick:T,onKeyDown:ze,className:Le,children:[ie,le,Ae,ye]}),e[78]=G,e[79]=ke,e[80]=T,e[81]=Ne,e[82]=C,e[83]=Le,e[84]=ie,e[85]=le,e[86]=Ae,e[87]=ye,e[88]=ze,e[89]=$e):$e=e[89],$e}function ui(v){return v.stopPropagation()}function di(v){return v.stopPropagation()}function mi(){return!1}function Fs(v){const e=Jt.c(11),{canAddSection:u,onAddSection:p,className:h,size:k}=v,w=Yt();let y;e[0]!==h?(y=oe("w-full",h),e[0]=h,e[1]=y):y=e[1];const T=!u;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cr,{size:14}),e[2]=b):b=e[2];let Z;e[3]!==w?(Z=w("sectionsEditor.sectionList.addSectionButton"),e[3]=w,e[4]=Z):Z=e[4];let me;return e[5]!==p||e[6]!==k||e[7]!==y||e[8]!==T||e[9]!==Z?(me=n.jsxs(Vt,{type:"button",variant:"outline",size:k,className:y,disabled:T,onClick:p,children:[b,Z]}),e[5]=p,e[6]=k,e[7]=y,e[8]=T,e[9]=Z,e[10]=me):me=e[10],me}function fi(v){const e=Jt.c(101),{listKey:u,rawSections:p,sections:h,meta:k,decofile:w,selectedIndex:y,onSelect:T,onReorder:b,onDelete:Z,onDuplicate:me,onMakeReusable:Ke,onToggleHidden:Be,onToggleLazy:Te,onAddVariant:re,onDetach:r,onAddSection:V,canAddSection:ge}=v,$=ge===void 0?!0:ge,c=Yt(),O=fs();let l;e[0]!==h.length?(l=()=>aa(h.length),e[0]=h.length,e[1]=l):l=e[1];const[J,G]=j.useState(l),[ke,Ne]=j.useState(null),[qe,_e]=j.useState(u),[d,M]=j.useState(h.length),We=j.useRef(!1);qe!==u?(_e(u),M(h.length),G(aa(h.length))):d!==h.length&&(M(h.length),G(Ce=>ri(Ce,h.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let Ue;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ue={coordinateGetter:zr},e[3]=Ue):Ue=e[3];const z=Kr(ta(Fr,C),ta(Lr,Ue));let mt;e[4]!==J?(mt=J.map(pi),e[4]=J,e[5]=mt):mt=e[5];const fe=mt;let ze;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=Ce=>{Ne(String(Ce.active.id))},e[6]=ze):ze=e[6];const _t=ze;let Le;e[7]!==fe||e[8]!==b?(Le=Ce=>{Ne(null);const{active:L,over:D}=Ce;if(!D||L.id===D.id)return;const Fe=fe.indexOf(String(L.id)),Xe=fe.indexOf(String(D.id));Fe===-1||Xe===-1||(G(nt=>ua(ds([...nt],Fe,Xe))),We.current=!0,requestAnimationFrame(()=>{We.current=!1}),b?.(Fe,Xe))},e[7]=fe,e[8]=b,e[9]=Le):Le=e[9];const ie=Le;let le;e[10]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{Ne(null)},e[10]=le):le=e[10];const Ae=le;let B,A,ce,we,Me,Re,H,ue,je,pe,ne,he,ae,Pe,ve;if(e[11]!==ke||e[12]!==$||e[13]!==O||e[14]!==w||e[15]!==J||e[16]!==fe||e[17]!==ie||e[18]!==k||e[19]!==V||e[20]!==re||e[21]!==Z||e[22]!==r||e[23]!==me||e[24]!==Ke||e[25]!==T||e[26]!==Be||e[27]!==Te||e[28]!==p||e[29]!==h||e[30]!==y||e[31]!==z||e[32]!==c){Pe=Symbol.for("react.early_return_sentinel");e:{const Ce=L=>{We.current||T(L)};if(e[48]!==ke||e[49]!==$||e[50]!==O||e[51]!==J||e[52]!==V||e[53]!==p||e[54]!==h||e[55]!==c){const L=ke?J.find(D=>D.id===ke):null;if(we=L!=null?h[L.index]:null,ce=L!=null?p[L.index]:void 0,J.length===0){let D;e[59]!==c?(D=c("sectionsEditor.sectionList.noSections"),e[59]=c,e[60]=D):D=e[60];let Fe;e[61]!==D?(Fe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:D}),e[61]=D,e[62]=Fe):Fe=e[62];const Xe=Fe;let nt;e[63]!==$||e[64]!==O||e[65]!==Xe||e[66]!==V?(nt=O?Xe:n.jsxs("div",{className:"space-y-2",children:[Xe,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Xe,e[66]=V,e[67]=nt):nt=e[67],Pe=nt;break e}ae=oe(L&&"cursor-grabbing"),e[48]=ke,e[49]=$,e[50]=O,e[51]=J,e[52]=V,e[53]=p,e[54]=h,e[55]=c,e[56]=ce,e[57]=we,e[58]=ae}else ce=e[56],we=e[57],ae=e[58];A=$r,ue=z,je=Hr,pe=_t,ne=ie,he=Ae,B=Gr,Re=fe,H=qr,ve="space-y-1",Me=J.map(L=>{const D=h[L.index];return D?n.jsx(ci,{sortableId:L.id,section:D,raw:p[L.index],meta:k,decofile:w,selected:y===L.index,onSelect:()=>Ce(L.index),onDelete:()=>Z(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>Ke(L.index),onToggleHidden:()=>Be(L.index),onToggleLazy:()=>Te(L.index),onAddVariant:()=>re(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=ke,e[12]=$,e[13]=O,e[14]=w,e[15]=J,e[16]=fe,e[17]=ie,e[18]=k,e[19]=V,e[20]=re,e[21]=Z,e[22]=r,e[23]=me,e[24]=Ke,e[25]=T,e[26]=Be,e[27]=Te,e[28]=p,e[29]=h,e[30]=y,e[31]=z,e[32]=c,e[33]=B,e[34]=A,e[35]=ce,e[36]=we,e[37]=Me,e[38]=Re,e[39]=H,e[40]=ue,e[41]=je,e[42]=pe,e[43]=ne,e[44]=he,e[45]=ae,e[46]=Pe,e[47]=ve}else B=e[33],A=e[34],ce=e[35],we=e[36],Me=e[37],Re=e[38],H=e[39],ue=e[40],je=e[41],pe=e[42],ne=e[43],he=e[44],ae=e[45],Pe=e[46],ve=e[47];if(Pe!==Symbol.for("react.early_return_sentinel"))return Pe;let Ve;e[68]!==Me||e[69]!==ve?(Ve=n.jsx("div",{className:ve,children:Me}),e[68]=Me,e[69]=ve,e[70]=Ve):Ve=e[70];let Ee;e[71]!==B||e[72]!==Re||e[73]!==H||e[74]!==Ve?(Ee=n.jsx(B,{items:Re,strategy:H,children:Ve}),e[71]=B,e[72]=Re,e[73]=H,e[74]=Ve,e[75]=Ee):Ee=e[75];let Se;e[76]!==ce||e[77]!==we||e[78]!==O||e[79]!==w||e[80]!==k?(Se=we?n.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(we,!1,O)),children:n.jsx(da,{section:we,raw:ce,meta:k,decofile:w})}):null,e[76]=ce,e[77]=we,e[78]=O,e[79]=w,e[80]=k,e[81]=Se):Se=e[81];let ye;e[82]!==Se?(ye=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:Se}),document.body),e[82]=Se,e[83]=ye):ye=e[83];let $e;e[84]!==A||e[85]!==ue||e[86]!==je||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==Ee||e[91]!==ye?($e=n.jsxs(A,{sensors:ue,collisionDetection:je,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[Ee,ye]}),e[84]=A,e[85]=ue,e[86]=je,e[87]=pe,e[88]=ne,e[89]=he,e[90]=Ee,e[91]=ye,e[92]=$e):$e=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==ae||e[98]!==$e||e[99]!==P?(st=n.jsxs("div",{className:ae,children:[$e,P]}),e[97]=ae,e[98]=$e,e[99]=P,e[100]=st):st=e[100],st}function pi(v){return v.id}function hi(v,e,u,p){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const h=e.trim();if(!h)return Rt(v,u,p)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ds(v,u,p)}:{kind:"noop"};const k=Ks(v,u,p);if(!k)return{kind:"error",reason:"unreadable-rule"};if(k.blockKey)return{kind:"updateBlock",blockKey:k.blockKey,blockData:xt(k.resolveType,k.data,h)};const w=cs(h),y=us(w,u);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:w,blockData:xt(k.resolveType,k.data,h),reference:Lt(w)}}function Dc({orgSlug:v,virtualMcpId:e,branch:u,previewReady:p=!0,previewUrl:h,currentPath:k,activePageBlockKey:w=null,activeGlobalBlockKey:y=null,externalSelection:T,onSaved:b,initialEditSeo:Z=!1,onExitSeo:me,onSelectRoot:Ke,onViewJsonFile:Be,onFocusedBlockChange:Te,onVariantPreviewOverride:re}){const r=Yt(),V=_o(),ge=V?.taskId??null,$=p?{orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h}:null,{data:c,isLoading:O}=Co($),{data:l,isLoading:J}=Do($),G=fs(),ke=V?.virtualMcpId,qe=sr(ke===e?e:null)?.metadata?.siteSlug??null,_e=Jr({virtualMcpId:e,sandboxUrl:h}),[d,M]=j.useState(null),[We,C]=j.useState(null),[Ue,z]=j.useState(null),[mt,fe]=j.useState(0),[ze,_t]=j.useState(void 0),[Le,ie]=j.useState(null),[le,Ae]=j.useState(null),[B,A]=j.useState([]),ce=j.useRef(null),[we,Me]=j.useState(B.length);we!==B.length&&(Me(B.length),requestAnimationFrame(()=>{ce.current&&(ce.current.scrollTop=0)}));const[Re,H]=j.useState(0),[ue,je]=j.useState(null),[pe,ne]=j.useState(null),[he,ae]=j.useState(null),[Pe,ve]=j.useState(!1),[Ve,Ee]=j.useState(!1),Se=j.useRef(null),[ye,$e]=j.useState(!0),[P,st]=j.useState(!1),[Ce,L]=j.useState(!1),[D,Fe]=j.useState(Z),[Xe,nt]=j.useState(Z);Z&&!Xe&&(nt(!0),Fe(!0),M(null),C(null),z(null),A([])),!Z&&Xe&&nt(!1);const[fa,Qt]=j.useState(null),[Os,ps]=j.useState(void 0),[zs,jt]=j.useState([]),[$s,Ft]=j.useState(0),[Ie,Je]=j.useState(0),[pa,De]=j.useState(null),[Tt,Oe]=j.useState(null),[Hs,Gs]=j.useState(null),ha=yo(),ga=`${v}/${e}/${u}`,Zt=Ko({orgSlug:v,virtualMcpId:e,branch:u}),[va,Sa]=j.useState(k),[ya,ba]=j.useState(w),[xa,_a]=j.useState(y);(va!==k||ya!==w||xa!==y)&&(queueMicrotask(()=>Zt.flush()),Sa(k),ba(w),_a(y),M(null),C(null),z(null),fe(0),ie(null),Ae(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1));const Y=Bo({orgSlug:v,virtualMcpId:e,branch:u}),It=Zo((t,s)=>{Y.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=lr({orgSlug:v,virtualMcpId:e,branch:u}),[Nt,At]=j.useState(!1),q=j.useRef(null),qs=j.useRef(null),at=j.useRef(null),ot=j.useRef(null),hs=j.useRef({}),He=j.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=j.useState(null);if(!p||O||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!c||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=dr(c),Q=!!y,te=Q?null:mr(ka,k,w),g=Q?y:te?.key??null,gs=Q&&y?c[y]:void 0,Ws=Q&&y&&gs?fr(y,gs):Q&&y?y:"",Ot=!Q&&g&&c[g]?c[g]:null,vs=D&&c&&l&&g&&te?Ln(c,{kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},l):null,wa=D?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=D?Lo(es):void 0,Us=vs?.seoTypeOptions??[],Js=D&&l?Fo(l):"",Ss=fa??Ra??{},ts=D&&vs?Wr(Ss,vs):null,Ys=D&&ts&&Io(es)?ls(ts,l):null,Qs=D?Oo(c,l)?.seoData:void 0,de=Q?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,c??{}),et=de.length>1,se=Math.min(mt,de.length-1),Ge=de[se],K=Ge?.sections??[],be=rs(K,c),ys=!Q&&pr(Ot?.sections);if(Q&&y&&Hs!==y){Gs(y);const t=K[0],s=be[0];if(t&&s){M(0),Je(0),A([]);const a=kt(t,s,c);a&&(C(a.data),z(a.resolveType),Oe(null),De(null))}}!Q&&Hs!==null&&Gs(null),He.current={rawSections:K,parsedSections:be,decofile:c??{},activePageKey:g,pageVariants:de,variantIndex:se,sectionVariantIndex:Ie,selectedSectionIndex:d};const Va=()=>({multivariate:ys,index:se,variants:de.map(t=>({rule:t.rule}))}),bs=(t,s)=>{if(!re)return;if(!g||!ys||t.length<=1){re(null);return}const a=na(g,{multivariate:!0,index:s,variants:t},c,l);re(a.length>0?a:null)},xs=re&&g&&ys&&et&&!O&&!J?g:null;if(xs!==ja&&(Ea(xs),xs)){const t=de.map(a=>({rule:a.rule})),s=se;queueMicrotask(()=>bs(t,s))}const Mt=(t,s,a)=>{if(!re)return;if(!g){re(null);return}const o=Va(),i=na(g,o,c,l);if(!t||s<0){re(i.length>0?i:null);return}const m=Qr({pageKey:g,page:o,sectionIndex:s,sectionLazy:be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:l}),f=[...i,...m];re(f.length>0?f:null)},ft=(t,s,a,o=d??-1,i=!1)=>{const m=tt(t,s);if(!m){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const x=Jn(m,lt)[a];if(!x){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const R=hr(x.value,c);C(R?.data??null),z(R?.resolveType??null);const{resolveType:S,formValue:E}=Wt(x.rule,c,l??void 0);Oe(S),De(E),i&&Mt(m,o,a)},zt=T?.index;if(T!==void 0&&(T?.seq??null)!==ze&&(_t(T?.seq??null),typeof zt=="number")){const t=K[zt],s=be[zt];if(t&&s)if(M(zt),Je(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,c);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Oe(null),De(null)}}const $t={orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h??void 0,siteSlug:qe},_s=Ue&&l?ls(Ue,l):null,Ye=(t,s)=>{if(!g)return;q.current&&(clearTimeout(q.current),q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=qt(c,g,t,se,de);Y.mutate({blockKey:g,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Te?.(null),M(null),L(!1),C(null),z(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1)},Ta=(t,s)=>{const a=He.current.sectionVariantIndex,o=qs.current;q.current&&(clearTimeout(q.current),q.current=null,o&&(o.sectionIndex!==s||o.sectionVariantIndex!==a)&&o.write());const i=()=>{const{rawSections:m,parsedSections:f,decofile:x,activePageKey:R,pageVariants:S,variantIndex:E}=He.current,_=m[s];if(!_)return;const W=f[s];if(!W)return;if(W.isSavedBlock){const F=tr(_,W);if(!F)return;Y.mutate({blockKey:F,data:t},{onSuccess:()=>b?.(),onError:U=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:U.message}))});return}if(!R)return;const X={...x[R]},ee=[...m];if(W.isMultivariate){const F=tt(_,W);if(!F||!R)return;const U=Tr(F,a,t);ee[s]=wt(_,W,U)}else if(W.isHidden){const F=Is(_.__resolveType),U=F?{..._.section}:{..._},I=Array.isArray(U.variants)?[...U.variants]:[];I[0]&&(I[0]={...I[0],value:t}),U.variants=I,F?ee[s]={..._,section:U}:ee[s]=U}else W.isLazy?ee[s]={..._,section:t}:ee[s]=t;if(S.length>1){const F=X.sections,U=[...F?.variants??[]];U[E]&&(U[E]={...U[E],value:ee}),X.sections={...F,variants:U}}else X.sections=ee;Y.mutate({blockKey:R,data:X},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))})};qs.current={sectionIndex:s,sectionVariantIndex:a,write:i},q.current=setTimeout(()=>{q.current=null,i()},Ms)},Na=t=>{M(t),Je(0),A([]),H(i=>i+1);const s=K[t],a=be[t];if(Te?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,c);if(!o){C(null),z(null),Oe(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Oe(null),De(null),Mt(null,t,0)},Zs=t=>{const s=t;C(s),d!==null&&Ta(s,d)},js=t=>{if(!g||!c||!l||!te)return;const s={kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},a=Ln(c,s,l);a&&Zt.save(g,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[g];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...hs.current};return hs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Xs=(t,s)=>{g&&(hs.current[t]=s,js())},Aa=(t,s)=>{if(!g)return;const a=ds([...K],t,s);d!==null&&(d===t?M(s):t<d&&s>=d?M(d-1):t>d&&s<=d&&M(d+1)),Ye(a)},Ma=t=>{if(!g)return;const s=K.filter((a,o)=>o!==t);d===t?Pt():d!==null&&d>t&&M(d-1),Ye(s)},Pa=t=>{if(!g)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,Xo(s)),d!==null&&d>t&&M(d+1),Ye(a)},Ca=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a)return;const o=a.isHidden?Er(s):kr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Da=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a||a.isMultivariate)return;const o=jr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Ka=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,c);if(!o?.data)return;const{name:i,...m}=o.data,f=[...K];a.isLazy?f[t]={...s,section:m}:f[t]=m,d===t&&Pt(),Ye(f)},Ba=t=>{if(!g)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{ve(!1),M(a),Je(0),A([]),H(f=>f+1);const o=s[a],i=rs(s,c)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const m=kt(o,i,c);if(!m){C(null),z(null),Oe(null),De(null);return}C(m.data),z(m.resolveType),Oe(null),De(null)}})},en=t=>{Se.current=t.append,ve(!0)},La=t=>{const s=Se.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ve(!1),Se.current=null},tn=t=>{if(d===null)return;const s=K[d],a=be[d];!s||!a?.isMultivariate||(Je(t),A([]),H(o=>o+1),ft(s,a,t,d,!0))},Fa=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=xr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const m=[...K];m[d]=wt(s,a,i);const f=i.variants;let x=Ie;t===Ie?x=Math.min(t,f.length-1):t<Ie&&(x=Ie-1),Je(x),A([]),H(R=>R+1),ft(m[d],a,x),Ye(m)},Ia=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=_r(o,t),m=[...K];m[d]=wt(s,a,i);const f=t+1;Je(f),A([]),H(x=>x+1),ft(m[d],a,f),Ye(m)},Oa=(t,s)=>{if(d===null||!g||t===s)return;const a=K[d],o=be[d];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const m=yr(i,t,s),f=[...K];f[d]=wt(a,o,m);let x=Ie;Ie===t?x=s:t<Ie&&s>=Ie?x=Ie-1:t>Ie&&s<=Ie&&(x=Ie+1),Je(x),ft(f[d],o,x),Ye(f)},Ht=t=>{const s=t??d;if(s===null||!g)return;const a=K[s],o=be[s];if(!a||!o)return;const i=gr(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const m=[...K];m[s]=i.section;const f=rs(m,c)[s];if(!f?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Je(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,f,i.newVariantIndex,s),Ye(m)},sn=()=>{if(d===null||!g)return;const t=K[d],s=be[d];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=br(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...K];i[d]=o;const m=rs(i,c)[d];if(!m)return;Je(0),Oe(null),De(null),A([]),H(x=>x+1);const f=kt(o,m,c);f?(C(f.data),z(f.resolveType)):(C(null),z(null)),Mt(null,d,0),Ye(i)},za=async t=>{if(ue===null||!g)return;const s=us(t,c);if(s){N.error(s);return}const a=K[ue],o=be[ue];if(!a||!o)return;const i=kt(a,o,c);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const m={...i.data,name:t};try{await Y.mutateAsync({blockKey:t,data:m});const f=[...K];f[ue]={__resolveType:t},await Y.mutateAsync({blockKey:g,data:qt(c,g,f,se,de)}),d===ue&&Pt(),je(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(f){N.error(f instanceof Error?f.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},nn=Ge?.rule;if(et&&d===null&&le===null&&nn){const{resolveType:t,formValue:s}=Wt(nn,c??{},l??void 0);Ae(t),ie(s)}const Ct=l?$o(l):[],Es=l&&c?Ho(l,c):[],an=!Q&&!!(_e&&l&&c),on=le&&l?ls(le,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(Vr(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},rn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i={...a[s]},m={...i.sections},f=[...m.variants??[]],x=f[o],R=x?.rule;if(Rt(R,a,l)){const S=R?.__resolveType??"",E=a[S],_=typeof E?.name=="string"?E.name:S,{__resolveType:W,...X}=t;Y.mutate({blockKey:S,data:xt(W??"",X,_)},{onSuccess:()=>b?.(),onError:ee=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ee.message}))});return}x&&(f[o]={...x,rule:t}),i.sections={...m,variants:f},Y.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ms)},ln=t=>{Ae(t);const s=t?Yn(t,l):{__resolveType:Qn};ie(t?s:{}),rn(s)},cn=t=>{const s=t;ie(s);const a=le?{__resolveType:le,...s}:{...s};rn(a)},un=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i=a[s],m=i?.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[o];if(!R)return;const S=bt(R.rule,a,l),E=Lt(t);x[o]={...R,rule:E};const _={...a,[s]:{...i,sections:{...f,variants:x}}},{resolveType:W,formValue:X}=Wt(E,_,l??void 0);Ae(W),ie(X);try{await Y.mutateAsync({blockKey:s,data:_[s]}),S&&S!==t&&await Et(S,_),b?.()}catch(ee){N.error(ee instanceof Error?ee.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},dn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=He.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const X=(_.variants??[])[a]?.rule;if(Rt(X,m,l)){const I=X?.__resolveType??"",Ze=m[I],rt=typeof Ze?.name=="string"?Ze.name:I,{__resolveType:St,...it}=t;Y.mutate({blockKey:I,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const ee=Zn(_,a,t),F=[...o];F[s]=wt(S,E,ee);const U=qt(m,f,F,R,x);Y.mutate({blockKey:f,data:U},{onSuccess:()=>b?.(),onError:I=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:I.message}))})},Ms))},$a=t=>{Oe(t);const s=t?Yn(t,l):{__resolveType:Qn};De(t?s:{}),dn(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};dn(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(s===null||!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],X=bt(W[a]?.rule,m,l),ee=Lt(t),F=Zn(_,a,ee),U=[...o];U[s]=wt(S,E,F);const I=qt(m,f,U,R,x),Ze={...m,[f]:I},{resolveType:rt,formValue:St}=Wt(ee,Ze,l??void 0);Oe(rt),De(St);try{await Y.mutateAsync({blockKey:f,data:I}),X&&X!==t&&await Et(X,Ze),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Q&&!te)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:k})});if(Q&&!gs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const xe=d!==null?be[d]??null:null,mn=d!==null?K[d]:null,fn=mn&&xe?.isMultivariate?tt(mn,xe):null,ht=fn?Jn(fn,lt):[],ss=Math.min(Ie,Math.max(ht.length-1,0)),Dt=ht[ss]??null,gt=xe?.isMultivariate===!0,ks=d!==null&&xe!==null,vt=ks&&(gt||!!(_s&&We)),qa=vt&&!Q&&xe?.isSavedBlock===!0,Qe=Q||qa,pn=Q?Ws:xe?.label??"",Wa=Tt&&l?ls(Tt,l):null,hn=(t,s)=>s&&G?`${t} · ${s}`:t,gn=xe?xe.variantOf??xe.label:"",Ua=(()=>{const t=gt&&Dt?Dt.label:null;return t?G?[hn(gn,t)]:[xe.label,t]:[xe?.label??""]})(),ws=hn(te?.name??"",et?Ge?.label:null),ns=vt&&(!Q||B.length>0)?Q?[Ws,...B]:[ws,...Ua,...B]:[],vn=D&&te?[te.name,"SEO",...zs]:[],Sn=r("sectionsEditor.pageVariantTabs.variantsLabel"),yn=P&&te?[te.name,Sn]:Ce&&te&&xe?[ws,gn,Sn]:[],as=yn.length>0?yn:vn.length>0?vn:Qe?ns.length>0?ns:[pn]:ns.length>0?ns:[ws],bn=ks&&!gt&&!xe?.isHidden&&!!g,Ja=Qe||!Q&&et&&!!Ge||bn,Ya=ks&&!gt&&!Q&&B.length===0&&!!xe&&ia(xe)&&!!g,Qa=G&&vt&&!Ce&&gt&&B.length===0&&!!Dt,xn=G&&B.length>0?Fn(B[B.length-1]):null,Za=B.length>1?Fn(B[B.length-2]):null,_n=Qe?pn:vt?xe?.label??"":te?.name??"",Xa=P||Ce?r("sectionsEditor.pageVariantTabs.variantsLabel"):D?r("sectionsEditor.panelSections.seo"):xn??_n,jn=Ce?xe?.variantOf??xe?.label??"":P||D?te?.name??"":xn?Za??_n:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?te?.name??"":te?.path??"",Rs=!P&&!Ce&&!D&&!vt&&!Qe,eo=!G&&!D&&!Q&&gt&&B.length===0,Gt=()=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const t=c[g],s=vr(t.sections,K);if(!s)return;const a=Sr(s);Y.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),M(null),C(null),z(null),A([]),ie(null),Ae(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},os=(t,s,a)=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const o=c[g],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const m=i;if(!Array.isArray(m.variants))return;const f=t([...m.variants]);if(!f)return;const x=Rr(m,f),R={...c,[g]:{...o,sections:x}};Y.mutate({blockKey:g,data:R[g]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const E of S)await Et(E,R)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{ne(null),fe(t),M(null),C(null),z(null),A([]);const s=de[t]?.rule,{resolveType:a,formValue:o}=Wt(s,c??{},l??void 0);Ae(a),ie(o),bs(de.map(i=>({rule:i.rule})),t)},En=(t,s)=>{if(t===s)return;let a=se;se===t?a=s:t<se&&s>=se?a=se-1:t>se&&s<=se&&(a=se+1),fe(a);const o=ds(de.map(i=>({rule:i.rule})),t,s);bs(o,a),os(i=>ds(i,t,s))},kn=t=>{const s=de[t]?.rule,a=bt(s,c??{},l??void 0);os(o=>o.length<=1?null:(o.splice(t,1),o),()=>{de.length-1===1?fe(0):t<se?fe(se-1):t===se&&fe(Math.max(0,t-1)),M(null),C(null),z(null),A([]),ie(null),Ae(null)},a)},to=()=>{const t=de.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!wr(s.rule)).map(({variant:s})=>bt(s.rule,c??{},l??void 0)).filter(s=>!!s);os(s=>{const a=Nr({variants:s}),o=s[a];return o?[{...o,rule:Ar()}]:null},()=>{fe(0),M(null),C(null),z(null),A([]),ie(null),Ae(null),st(!1)},t)},wn=t=>{os(s=>Mr(s,t),()=>{fe(t+1),M(null),C(null),z(null),A([]),ie(null),Ae(null)})},so=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const a=He.current.activePageKey,o=He.current.decofile;if(!a)return;const i=o[a],m=i.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=R.rule,E=s.trim();At(!0);try{if(!E){if(!Rt(S,o,l)){ne(null);return}const U=S.__resolveType??"";x[t]={...R,rule:Ds(S,o,l)};const I={...o,[a]:{...i,sections:{...f,variants:x}}};await Y.mutateAsync({blockKey:a,data:I[a]}),await Et(U,I),ne(null),b?.();return}const _=Ks(S,o,l);if(!_){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(_.blockKey){await Y.mutateAsync({blockKey:_.blockKey,data:xt(_.resolveType,_.data,E)}),ne(null),b?.();return}const W=cs(E),X=us(W,o);if(X){N.error(X);return}const ee=xt(_.resolveType,_.data,E);let F=null;try{await Y.mutateAsync({blockKey:W,data:ee}),F=W,x[t]={...R,rule:Lt(W)},await Y.mutateAsync({blockKey:a,data:{...i,sections:{...f,variants:x}}}),F=null}catch(U){throw F&&await Xt.mutateAsync({blockKey:F}).catch(()=>{}),U}ne(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:E})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(a===null||!f)return;const S=o[a],E=i[a];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],X=W[t];if(!X?.rule||typeof X.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ee=X.rule,F=s.trim();At(!0);const U=async I=>{const Ze={..._,variants:I},rt=[...o];rt[a]=wt(S,E,Ze);const St=qt(m,f,rt,R,x);return await Y.mutateAsync({blockKey:f,data:St}),{...m,[f]:St}};try{if(!F){if(!Rt(ee,m,l)){ae(null);return}const yt=ee.__resolveType??"",Kn=[...W];Kn[t]={...X,rule:Ds(ee,m,l)};const po=await U(Kn);await Et(yt,po),ae(null),b?.();return}const I=Ks(ee,m,l);if(!I){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(I.blockKey){await Y.mutateAsync({blockKey:I.blockKey,data:xt(I.resolveType,I.data,F)}),ae(null),b?.();return}const Ze=cs(F),rt=us(Ze,m);if(rt){N.error(rt);return}const St=xt(I.resolveType,I.data,F);let it=null;try{await Y.mutateAsync({blockKey:Ze,data:St}),it=Ze;const yt=[...W];yt[t]={...X,rule:Lt(Ze)},await U(yt),it=null}catch(yt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),yt}ae(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),b?.()}catch(I){N.error(I instanceof Error?I.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},Rn=async(t,s,a)=>{C(a);try{await Y.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s],x=f?.rule&&typeof f.rule=="object"?f.rule:void 0,R=async E=>{const _={...t,variants:E};return await Rn(o,t,_),{...i,[o]:_}},S=hi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const _=[...m];_[s]={...f,rule:S.inlinedRule};const W=await R(_);await Et(S.blockKey,W),b?.();return}if(S.kind==="updateBlock"){await Y.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let E=null;try{await Y.mutateAsync({blockKey:S.blockId,data:S.blockData}),E=S.blockId;const _=[...m];_[s]={...f,rule:S.reference},await R(_),E=null}catch(_){throw E&&await Xt.mutateAsync({blockKey:E}).catch(()=>{}),_}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s];if(!f)return;const x=bt(f.rule,i,l);m[s]={...f,rule:Lt(a)};const R={...t,variants:m},S={...i,[o]:R};try{await Rn(o,t,R),x&&x!==a&&await Et(x,S),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Vn=()=>{Pt()},Tn=t=>{Qt(t),js({inner:t})},Nn=t=>{ps(t),js({raw:t})},An=()=>{Qt(null),jt([])},Mn=()=>Ft(t=>t+1),Pn=()=>{Zt.flush(),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1),me?.()},oo=()=>{st(!1),L(!1),M(null),Fe(!0)},ro=()=>{D&&Pn(),M(null),st(!0)},io=()=>L(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Ce&&t<2){L(!1),t===0&&M(null);return}if(D){if(t===0){Pn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Q){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){Vn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&&gt&&Dt?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(B.slice(0,t-1-s))},Ns=as.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(er(as.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Qe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(rr,{className:"size-4"})}):null,lo=Qe||vt||D?Ja&&n.jsxs("div",{className:oe("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Q&&et&&Ge&&n.jsxs("button",{type:"button",onClick:Vn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Ge.label}),className:oe("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",qo),children:[n.jsx(Go,{rule:Ps(Ge.rule,c??{},l??void 0),matchers:Ct}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("div",{className:"flex-1"}),Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),bn&&n.jsx(is,{onClick:()=>Ht()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Xs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Fe(!0),children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Be&&g?Be():Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(is,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})})]}),Cn=n.jsxs(n.Fragment,{children:[n.jsx(Wo,{listKey:`${g??""}:${d??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ss,onSelect:tn,onRename:ae,onDuplicate:Ia,onDelete:Fa,onRemoveAll:sn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(As,{currentRt:Tt??"",currentLabel:Ut(Dt?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Dt?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${d??"none"}:${ss}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:oe(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${g??""}-${se}`,rawSections:K,sections:be,meta:l,decofile:c,selectedIndex:d,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:je,onToggleHidden:Ca,onToggleLazy:Da,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ve(!0),canAddSection:an})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&te&&n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Xs}),Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsxs("div",{className:oe("px-3 border-b",ye?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>$e(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-muted/40","aria-expanded":ye,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),ye?n.jsx(nr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ar,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ye&&n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Uo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||as.length>1)&&n.jsx(Jo,{crumbs:as,onSelect:Ts,onSelectRoot:()=>{Zt.flush(),Ke?Ke():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Xa}),jn&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:jn})]}),Rs&&et&&Ge&&n.jsx($n,{variants:de,activeIndex:se,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ss,onSelect:tn,onManage:io,onRemoveAll:sn}),Rs&&!et&&n.jsx(is,{onClick:Gt}),Ya&&n.jsx(is,{onClick:()=>Ht()}),n.jsx(Yo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Be&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Ce?n.jsx(Hn,{onAdd:()=>Ht(),children:Cn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&&gt&&ht.length>0&&B.length===0&&Cn,n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Zs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en,onVariantMatcherOp:Q?ao:void 0})]},"editor-section-form"):Q?n.jsx(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Zs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en})},"editor-global-block"):D?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:an,onAddSection:()=>ve(!0)})})]},"editor-section-list"):fo,n.jsx(Qo,{open:ue!==null,onOpenChange:t=>{t||je(null)},defaultBlockId:ue!==null?cs(be[ue]?.label??""):"",isPending:Y.isPending,onSubmit:za}),_e&&n.jsx(Yr,{open:Pe,onOpenChange:t=>{ve(t),t||(Se.current=null)},meta:l,decofile:c,previewBaseUrl:_e,onSelect:La}),Ve&&g&&c&&n.jsx(cr,{open:Ve,onOpenChange:Ee,pageKey:g,decofile:c}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(de[pe]?.rule,c??{},l??void 0)?Ut(de[pe]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(de[pe]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(pe,t)},onOpenChange:t=>{!t&&!Nt&&ne(null)}}),he!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[he]?.rule,c??{},l??void 0)?Ut(ht[he]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(ht[he]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(he,t)},onOpenChange:t=>{!t&&!Nt&&ae(null)}})]})})}export{Dc as SectionsEditor};
1
+ import{c as Jt,b as Yt,r as j,l as oe,j as n,aR as ho,B as Vt,G as Kt,al as go,I as vo,H as So,o as yo,h as bo,t as N,K as xo}from"./index-Co-4sRnJ.js";import{u as _o}from"./chat-context-CocIg825.js";import{u as fs}from"./use-new-blocks-editor-DRI-powp.js";import{E as jo,F as Eo,G as ko,H as wo,I as Ro,J as Vo,K as To,V as No,L as Ao,N as Bn,O as Mo,Q as Po,C as cs,y as us,e as Co,f as Do,j as Ko,u as Bo,T as Ln,U as Lo,W as Fo,X as Io,Y as Oo,Z as zo,p as rs,A as kt,_ as $o,$ as Ho,w as Fn,a0 as Go,a1 as qo,a2 as is,a3 as In,a4 as On,a5 as zn,a6 as As,a7 as Wo,a8 as Uo,z as Jo,a9 as $n,aa as Yo,ab as Hn,ac as Gn,M as Qo,ad as qn,ae as lt,d as Zo,af as qt,ag as Xo,ah as er,ai as Ms,aj as tr}from"./runnable-block-editor-CDsWwzF6.js";import{f as sr}from"./repository-binding-B0HdN6Lz.js";import{n as nr,t as ar}from"./ChevronUp-DnrzvZVs.js";import{a5 as oa,b as ms,ai as or,x as rr,Z as Wn,G as Un}from"./agent-icon-DV55KTHV.js";import{S as Bt}from"./scroll-area-B-lzB5tO.js";import{b as ct,T as ut,a as dt}from"./tooltip-CYfkikaX.js";import{m as ir,u as lr,P as cr}from"./mustache-CKo61BiR.js";import{aq as ra,c as Is,ar as ia,G as ur,ag as Rt,a4 as Ds,as as Ks,ah as xt,a5 as Lt,j as dr,l as mr,g as fr,r as ls,ak as pr,af as Wt,at as tt,au as Jn,a6 as Ps,ae as bt,ad as Ut,av as hr,aw as gr,K as vr,ax as Sr,ai as Yn,_ as Qn,ay as yr,az as wt,aA as br,aB as xr,aC as _r,aD as Zn,aE as jr,aF as Er,aG as kr,ac as wr,aH as Rr,aI as Vr,aJ as Tr,aK as Nr,ab as Ar,aL as Mr}from"./claim-phase-copy-DM-AWuNF.js";import{a as Pr}from"./Copy01-BBbKMHlK.js";import{a as Bs,d as la}from"./UserSquare-bfdtEra2.js";import{b as Xn}from"./Tool01-lC3aADL7.js";import{s as ea}from"./Image01-AFCLWig4.js";import{s as Cr}from"./Plus-B0dyDF7l.js";import{s as Dr}from"./Trash01-DV0azdbE.js";import{i as Ls}from"./ZoomOut-D_ifUcHu.js";import{a as Kr,b as ta,d as Br,K as Lr,P as Fr,u as Ir,C as Or,s as zr,e as ds,D as $r,c as Hr,S as Gr,v as qr}from"./rich-text-link-control-Co6k6OlH.js";import{a as Wr,P as sa,b as Ur}from"./page-seo-form-Bi__p_tv.js";import{u as Jr,A as Yr}from"./use-section-preview-base-CmEtoGbE.js";import{b as na,a as Qr}from"./variant-matcher-override-UcAv0Nhz.js";import"./use-panel-navigate-9QHW-FCg.js";import"./thread-route-BAsLNDrI.js";import"./use-project-scope-Bn-XeyFm.js";import"./autosend-_7Pn3AYs.js";import"./thread-intent-B5r6uX01.js";import"./use-mcp-client-huiboiuW.js";import"./auth-D62PuyHX.js";import"./backoff-8mStPHYB.js";import"./task-board-DV8c5Zhu.js";import"./schema-Bg7Z4WK1.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-BZEZhg3r.js";import"./use-ai-providers-zPZTeTn6.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-BXIx1FLP.js";import"./use-session-runtime-Mt5i1NtG.js";import"./Sun-CnfUJ0L6.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BWDj_GIt.js";import"./LinkBroken01-t821Qpkz.js";import"./Check-CO_ET4WO.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-CuGEZkc7.js";import"./use-copy-kTB71Cx6.js";import"./usage-stats-B5xe2MvZ.js";import"./markdown-C9QLOL7g.js";import"./dialog-Dw8xcjW3.js";import"./X-CMwuaze4.js";import"./org-file-open-context-CgCmoW9s.js";import"./use-mobile-C_c7X_X9.js";import"./shell-layout-HGSCI1cW.js";import"./avatar-HeVuI3WS.js";import"./User01-BY20MgLM.js";import"./Palette-Dcur9L4v.js";import"./XClose-CzlFjlez.js";import"./download-app-dialog-BSYwZSLo.js";import"./CheckCircle-RceYLcNO.js";import"./Monitor01-B8XQMd3B.js";import"./command-C0uSVAHC.js";import"./index-D0owq1f2.js";import"./SearchMd-DWmqXOB3.js";import"./integration-icon-CNlbbwne.js";import"./project-icon-CIt25m1v.js";import"./new-project-dialog-CzRX3bqD.js";import"./ArrowLeft-D_nqQ9tV.js";import"./input-CKfCW4iw.js";import"./label-DU_w-ckQ.js";import"./repository-import-picker-DBLmxazs.js";import"./use-navigate-to-agent-B8uYHMgO.js";import"./repository-picker-DIAetLTu.js";import"./LinkExternal01-CGlBJ7ud.js";import"./useInfiniteQuery-BbXVrX4k.js";import"./infiniteQueryObserver-DJ3A-TdU.js";import"./collection-search-BVdAr8z7.js";import"./ShoppingBag01-CnpFPbsS.js";import"./use-debounced-value-DDoK_9IU.js";import"./required-auth-layout-miKcB0rt.js";import"./use-org-sso-WomPaWOu.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BUT4kPR2.js";import"./types-FVrLJnQ_.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-Dv06lV8N.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-BRBGpzZA.js";import"./sheet-DYXq70sZ.js";import"./use-connection-DzHiClla.js";import"./Link01-7l6-kKGf.js";import"./use-mcp-prompts-CK7nTCfz.js";import"./index-BMb0J2ET.js";import"./form-CqyDHzdF.js";import"./use-thread-outputs-DWqKD4Kd.js";import"./file-type-icon-DY-An3SA.js";import"./popover-DmlD7L54.js";import"./utils-v5cDdvER.js";import"./monaco-editor-CCbTu1Zq.js";import"./editor-CX3cazY1.js";import"./calendar-Bs93rBUA.js";import"./textarea-BwFbzFhR.js";import"./select-CZTYe-RM.js";import"./index-MAF8_efg.js";import"./switch-BGCsiekK.js";import"./combobox-CaxzDpIX.js";import"./alert-dialog-D5ehbgbg.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-DK8FpPmK.js";import"./DotsVertical-DA8jC7Sm.js";import"./search-input-DxispljN.js";import"./tabs-aXag5nk_.js";import"./use-file-configs-Dckq5B6h.js";import"./asset-utils-CzXHTnwN.js";import"./use-chat-layout-state-_hTo6qiX.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-CSB3oZUC.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-DH2IataT.js";import"./CreditCard01-D97_uv9-.js";import"./Key01-DOFfyL8f.js";import"./Users01-qvvwVlrt.js";import"./section-preview-url-7zfngvgW.js";function Zr(v){return v.schema?.definitions??v.schema?.$defs??{}}function ca(v,e){const u=Zr(e),p=u[btoa(v)];if(!p)return[];const h=[p];if(Array.isArray(p.allOf)){const k=p.allOf.find(w=>typeof w.$ref=="string")?.$ref;if(typeof k=="string"){const w=u[k.replace("#/definitions/","")];w&&h.push(w)}}return h}function Xr(v,e){for(const u of ca(v,e)){const p=typeof u.image=="string"?u.image:void 0;if(p?.includes("{{{"))return p}}function ei(v,e){if(!e)return;const u=ra(v);if(!u)return;const p=Xr(u.resolveType,e);if(!p)return;const h=jo(p,u.data);if(h)return Eo(h)}const ti={escape:ko};function si(v,e){for(const u of ca(v,e)){const p=typeof u.title=="string"?u.title:void 0;if(p?.includes("{{"))return p}}function ni(v,e){if(!e)return;const u=ra(v);if(u)try{const p=si(u.resolveType,e);return p&&ir.render(p,u.data,{},ti).trim()||void 0}catch{return}}function ai(v){const e=Jt.c(13),{icon:u,label:p,className:h}=v;let k;e[0]!==h?(k=oe("size-3.5",h),e[0]=h,e[1]=k):k=e[1];let w;e[2]!==u||e[3]!==k?(w=n.jsx(u,{className:k}),e[2]=u,e[3]=k,e[4]=w):w=e[4];let y;e[5]!==p||e[6]!==w?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:w})}),e[5]=p,e[6]=w,e[7]=y):y=e[7];let T;e[8]!==p?(T=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=T):T=e[9];let b;return e[10]!==y||e[11]!==T?(b=n.jsxs(ct,{children:[y,T]}),e[10]=y,e[11]=T,e[12]=b):b=e[12],b}const oi="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 aa(v){return Array.from({length:v},(e,u)=>({id:crypto.randomUUID(),index:u}))}function ua(v){return v.map((e,u)=>({...e,index:u}))}function ri(v,e){if(e===v.length)return v;if(e<v.length)return ua(v.slice(0,e));const u=Array.from({length:e-v.length},(p,h)=>({id:crypto.randomUUID(),index:v.length+h}));return[...v,...u]}function da(v){const e=Jt.c(44),{section:u,raw:p,meta:h,decofile:k}=v,w=Yt(),y=fs(),T=u.isSavedBlock===!0,b=u.isMultivariate===!0;let Z;e[0]!==h||e[1]!==p?(Z=p&&h?ei(p,h):void 0,e[0]=h,e[1]=p,e[2]=Z):Z=e[2];const me=Z;let Ke;e[3]!==h||e[4]!==b||e[5]!==p||e[6]!==T?(Ke=p&&h&&!T&&!b?ni(p,h):void 0,e[3]=h,e[4]=b,e[5]=p,e[6]=T,e[7]=Ke):Ke=e[7];const Be=Ke;let Te;e[8]!==k||e[9]!==h||e[10]!==p||e[11]!==u?(Te=Ao(p,u,k,h),e[8]=k,e[9]=h,e[10]=p,e[11]=u,e[12]=Te):Te=e[12];const re=Te;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,ge=T?ms:b?oa:la;let $;e[16]!==b||e[17]!==T?($=T?{color:ur}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=T,e[18]=$):$=e[18];const c=$;let O;e[19]!==ge||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(ge,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Po,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(or,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=ge,e[20]=y,e[21]=O):O=e[21];let l;e[22]!==me?(l=me&&n.jsx("img",{src:me,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=me,e[23]=l):l=e[23];let J;e[24]!==y||e[25]!==c?(J=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:c}),e[24]=y,e[25]=c,e[26]=J):J=e[26];const G=y?"shrink":"flex-1",ke=u.isHidden&&"line-through opacity-50";let Ne;e[27]!==ke||e[28]!==G?(Ne=oe("min-w-0 truncate text-sm font-medium",G,ke),e[27]=ke,e[28]=G,e[29]=Ne):Ne=e[29];const qe=Be??u.label;let _e;e[30]!==Ne||e[31]!==qe?(_e=n.jsx("span",{className:Ne,children:qe}),e[30]=Ne,e[31]=qe,e[32]=_e):_e=e[32];let d;e[33]!==V||e[34]!==y||e[35]!==re||e[36]!==w?(d=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ai,{icon:Ls,label:w("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),re&&n.jsx(Bn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):re&&n.jsx(Bn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=re,e[36]=w,e[37]=d):d=e[37];let M;return e[38]!==_e||e[39]!==d||e[40]!==O||e[41]!==l||e[42]!==J?(M=n.jsxs(n.Fragment,{children:[O,l,J,_e,d]}),e[38]=_e,e[39]=d,e[40]=O,e[41]=l,e[42]=J,e[43]=M):M=e[43],M}const ii="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",li="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 ma(v,e,u){if(u)return Mo({selected:e});const p=v.isSavedBlock===!0,h=v.isMultivariate===!0;return oe("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":p?ii:h?li:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Cs(v,e){return oe("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 ci(v){const e=Jt.c(90),{section:u,raw:p,meta:h,decofile:k,sortableId:w,selected:y,onSelect:T,onDelete:b,onDuplicate:Z,onMakeReusable:me,onToggleHidden:Ke,onToggleLazy:Be,onAddVariant:Te,onDetach:re}=v,r=Yt(),V=fs(),ge=p?Is(p.__resolveType??""):!1,$=u.isHidden===!0,c=ge||$;let O;e[0]!==u?(O=ia(u),e[0]=u,e[1]=O):O=e[1];const l=O;let J;e[2]!==w?(J={id:w,animateLayoutChanges:mi},e[2]=w,e[3]=J):J=e[3];const{attributes:G,listeners:ke,setNodeRef:Ne,transform:qe,isDragging:_e}=Ir(J);let d;e[4]!==qe?(d=Or.Transform.toString(qe?{...qe,x:0}:null),e[4]=qe,e[5]=d):d=e[5];const M=_e?0:void 0;let We;e[6]!==d||e[7]!==M?(We={transform:d,opacity:M},e[6]=d,e[7]=M,e[8]=We):We=e[8];const C=We;let Ue;e[9]!==u?(Ue=Ro(u),e[9]=u,e[10]=Ue):Ue=e[10];const z=Ue,mt="button",fe=0;let ze;e[11]!==T?(ze=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},e[11]=T,e[12]=ze):ze=e[12];const _t=_e?"cursor-grabbing":"cursor-pointer";let Le;e[13]!==V||e[14]!==u||e[15]!==y||e[16]!==_t?(Le=oe("touch-none transition-colors",_t,ma(u,y,V)),e[13]=V,e[14]=u,e[15]=y,e[16]=_t,e[17]=Le):Le=e[17];let ie;e[18]!==k||e[19]!==h||e[20]!==p||e[21]!==u?(ie=n.jsx(da,{section:u,raw:p,meta:h,decofile:k}),e[18]=k,e[19]=h,e[20]=p,e[21]=u,e[22]=ie):ie=e[22];const le=!V&&!u.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:oe(Cs(c,ge)),onClick:P=>{P.stopPropagation(),Be()},onPointerDown:di,children:n.jsx(Ls,{className:oe("h-3.5 w-3.5",ge&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ae=V?n.jsx(Vo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ke,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:oe(Cs(c,$)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ui,children:$?n.jsx(Xn,{className:"h-3.5 w-3.5"}):n.jsx(ea,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=vo,A=To;let ce;e[23]!==r?(ce=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ce):ce=e[24];const we=oe(Cs(c,!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 Me;e[25]!==A||e[26]!==ce||e[27]!==we?(Me=n.jsx(A,{label:ce,classicClassName:we}),e[25]=A,e[26]=ce,e[27]=we,e[28]=Me):Me=e[28];let Re;e[29]!==V||e[30]!==ge||e[31]!==Be||e[32]!==u.isMultivariate||e[33]!==r?(Re=V&&!u.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Be()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(ge?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(go,{})]}),e[29]=V,e[30]=ge,e[31]=Be,e[32]=u.isMultivariate,e[33]=r,e[34]=Re):Re=e[34];let H;e[35]!==Z?(H=P=>{P.stopPropagation(),Z()},e[35]=Z,e[36]=H):H=e[36];let ue;e[37]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(Pr,{className:"h-4 w-4"}),e[37]=ue):ue=e[37];let je;e[38]!==r?(je=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=je):je=e[39];let pe;e[40]!==H||e[41]!==je?(pe=n.jsxs(Kt,{onClick:H,children:[ue,je]}),e[40]=H,e[41]=je,e[42]=pe):pe=e[42];let ne;e[43]!==V||e[44]!==l||e[45]!==Te||e[46]!==r?(ne=l&&n.jsxs(Kt,{className:oe(!V&&No),onClick:P=>{P.stopPropagation(),Te()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=l,e[45]=Te,e[46]=r,e[47]=ne):ne=e[47];let he;e[48]!==V||e[49]!==z||e[50]!==me||e[51]!==r?(he=z&&n.jsxs(Kt,{className:oe(!V&&oi),onClick:P=>{P.stopPropagation(),me()},children:[V?n.jsx(ms,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=me,e[51]=r,e[52]=he):he=e[52];let ae;e[53]!==V||e[54]!==re||e[55]!==u.isMultivariate||e[56]!==u.isSavedBlock||e[57]!==r?(ae=u.isSavedBlock===!0&&!u.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),re()},children:[V?n.jsx(la,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=re,e[55]=u.isMultivariate,e[56]=u.isSavedBlock,e[57]=r,e[58]=ae):ae=e[58];let Pe;e[59]!==b?(Pe=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Pe):Pe=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=n.jsx(Dr,{className:"h-4 w-4"}),e[61]=ve):ve=e[61];let Ve;e[62]!==r?(Ve=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Ve):Ve=e[63];let Ee;e[64]!==Pe||e[65]!==Ve?(Ee=n.jsxs(Kt,{variant:"destructive",onClick:Pe,children:[ve,Ve]}),e[64]=Pe,e[65]=Ve,e[66]=Ee):Ee=e[66];let Se;e[67]!==Re||e[68]!==pe||e[69]!==ne||e[70]!==he||e[71]!==ae||e[72]!==Ee?(Se=n.jsxs(So,{align:"end",className:"w-44",children:[Re,pe,ne,he,ae,Ee]}),e[67]=Re,e[68]=pe,e[69]=ne,e[70]=he,e[71]=ae,e[72]=Ee,e[73]=Se):Se=e[73];let ye;e[74]!==B||e[75]!==Me||e[76]!==Se?(ye=n.jsxs(B,{children:[Me,Se]}),e[74]=B,e[75]=Me,e[76]=Se,e[77]=ye):ye=e[77];let $e;return e[78]!==G||e[79]!==ke||e[80]!==T||e[81]!==Ne||e[82]!==C||e[83]!==Le||e[84]!==ie||e[85]!==le||e[86]!==Ae||e[87]!==ye||e[88]!==ze?($e=n.jsxs("div",{ref:Ne,style:C,...G,...ke,role:mt,tabIndex:fe,onClick:T,onKeyDown:ze,className:Le,children:[ie,le,Ae,ye]}),e[78]=G,e[79]=ke,e[80]=T,e[81]=Ne,e[82]=C,e[83]=Le,e[84]=ie,e[85]=le,e[86]=Ae,e[87]=ye,e[88]=ze,e[89]=$e):$e=e[89],$e}function ui(v){return v.stopPropagation()}function di(v){return v.stopPropagation()}function mi(){return!1}function Fs(v){const e=Jt.c(11),{canAddSection:u,onAddSection:p,className:h,size:k}=v,w=Yt();let y;e[0]!==h?(y=oe("w-full",h),e[0]=h,e[1]=y):y=e[1];const T=!u;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Cr,{size:14}),e[2]=b):b=e[2];let Z;e[3]!==w?(Z=w("sectionsEditor.sectionList.addSectionButton"),e[3]=w,e[4]=Z):Z=e[4];let me;return e[5]!==p||e[6]!==k||e[7]!==y||e[8]!==T||e[9]!==Z?(me=n.jsxs(Vt,{type:"button",variant:"outline",size:k,className:y,disabled:T,onClick:p,children:[b,Z]}),e[5]=p,e[6]=k,e[7]=y,e[8]=T,e[9]=Z,e[10]=me):me=e[10],me}function fi(v){const e=Jt.c(101),{listKey:u,rawSections:p,sections:h,meta:k,decofile:w,selectedIndex:y,onSelect:T,onReorder:b,onDelete:Z,onDuplicate:me,onMakeReusable:Ke,onToggleHidden:Be,onToggleLazy:Te,onAddVariant:re,onDetach:r,onAddSection:V,canAddSection:ge}=v,$=ge===void 0?!0:ge,c=Yt(),O=fs();let l;e[0]!==h.length?(l=()=>aa(h.length),e[0]=h.length,e[1]=l):l=e[1];const[J,G]=j.useState(l),[ke,Ne]=j.useState(null),[qe,_e]=j.useState(u),[d,M]=j.useState(h.length),We=j.useRef(!1);qe!==u?(_e(u),M(h.length),G(aa(h.length))):d!==h.length&&(M(h.length),G(Ce=>ri(Ce,h.length)));let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={activationConstraint:{distance:8}},e[2]=C):C=e[2];let Ue;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ue={coordinateGetter:zr},e[3]=Ue):Ue=e[3];const z=Kr(ta(Fr,C),ta(Lr,Ue));let mt;e[4]!==J?(mt=J.map(pi),e[4]=J,e[5]=mt):mt=e[5];const fe=mt;let ze;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=Ce=>{Ne(String(Ce.active.id))},e[6]=ze):ze=e[6];const _t=ze;let Le;e[7]!==fe||e[8]!==b?(Le=Ce=>{Ne(null);const{active:L,over:D}=Ce;if(!D||L.id===D.id)return;const Fe=fe.indexOf(String(L.id)),Xe=fe.indexOf(String(D.id));Fe===-1||Xe===-1||(G(nt=>ua(ds([...nt],Fe,Xe))),We.current=!0,requestAnimationFrame(()=>{We.current=!1}),b?.(Fe,Xe))},e[7]=fe,e[8]=b,e[9]=Le):Le=e[9];const ie=Le;let le;e[10]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{Ne(null)},e[10]=le):le=e[10];const Ae=le;let B,A,ce,we,Me,Re,H,ue,je,pe,ne,he,ae,Pe,ve;if(e[11]!==ke||e[12]!==$||e[13]!==O||e[14]!==w||e[15]!==J||e[16]!==fe||e[17]!==ie||e[18]!==k||e[19]!==V||e[20]!==re||e[21]!==Z||e[22]!==r||e[23]!==me||e[24]!==Ke||e[25]!==T||e[26]!==Be||e[27]!==Te||e[28]!==p||e[29]!==h||e[30]!==y||e[31]!==z||e[32]!==c){Pe=Symbol.for("react.early_return_sentinel");e:{const Ce=L=>{We.current||T(L)};if(e[48]!==ke||e[49]!==$||e[50]!==O||e[51]!==J||e[52]!==V||e[53]!==p||e[54]!==h||e[55]!==c){const L=ke?J.find(D=>D.id===ke):null;if(we=L!=null?h[L.index]:null,ce=L!=null?p[L.index]:void 0,J.length===0){let D;e[59]!==c?(D=c("sectionsEditor.sectionList.noSections"),e[59]=c,e[60]=D):D=e[60];let Fe;e[61]!==D?(Fe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:D}),e[61]=D,e[62]=Fe):Fe=e[62];const Xe=Fe;let nt;e[63]!==$||e[64]!==O||e[65]!==Xe||e[66]!==V?(nt=O?Xe:n.jsxs("div",{className:"space-y-2",children:[Xe,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Xe,e[66]=V,e[67]=nt):nt=e[67],Pe=nt;break e}ae=oe(L&&"cursor-grabbing"),e[48]=ke,e[49]=$,e[50]=O,e[51]=J,e[52]=V,e[53]=p,e[54]=h,e[55]=c,e[56]=ce,e[57]=we,e[58]=ae}else ce=e[56],we=e[57],ae=e[58];A=$r,ue=z,je=Hr,pe=_t,ne=ie,he=Ae,B=Gr,Re=fe,H=qr,ve="space-y-1",Me=J.map(L=>{const D=h[L.index];return D?n.jsx(ci,{sortableId:L.id,section:D,raw:p[L.index],meta:k,decofile:w,selected:y===L.index,onSelect:()=>Ce(L.index),onDelete:()=>Z(L.index),onDuplicate:()=>me(L.index),onMakeReusable:()=>Ke(L.index),onToggleHidden:()=>Be(L.index),onToggleLazy:()=>Te(L.index),onAddVariant:()=>re(L.index),onDetach:()=>r(L.index)},L.id):null})}e[11]=ke,e[12]=$,e[13]=O,e[14]=w,e[15]=J,e[16]=fe,e[17]=ie,e[18]=k,e[19]=V,e[20]=re,e[21]=Z,e[22]=r,e[23]=me,e[24]=Ke,e[25]=T,e[26]=Be,e[27]=Te,e[28]=p,e[29]=h,e[30]=y,e[31]=z,e[32]=c,e[33]=B,e[34]=A,e[35]=ce,e[36]=we,e[37]=Me,e[38]=Re,e[39]=H,e[40]=ue,e[41]=je,e[42]=pe,e[43]=ne,e[44]=he,e[45]=ae,e[46]=Pe,e[47]=ve}else B=e[33],A=e[34],ce=e[35],we=e[36],Me=e[37],Re=e[38],H=e[39],ue=e[40],je=e[41],pe=e[42],ne=e[43],he=e[44],ae=e[45],Pe=e[46],ve=e[47];if(Pe!==Symbol.for("react.early_return_sentinel"))return Pe;let Ve;e[68]!==Me||e[69]!==ve?(Ve=n.jsx("div",{className:ve,children:Me}),e[68]=Me,e[69]=ve,e[70]=Ve):Ve=e[70];let Ee;e[71]!==B||e[72]!==Re||e[73]!==H||e[74]!==Ve?(Ee=n.jsx(B,{items:Re,strategy:H,children:Ve}),e[71]=B,e[72]=Re,e[73]=H,e[74]=Ve,e[75]=Ee):Ee=e[75];let Se;e[76]!==ce||e[77]!==we||e[78]!==O||e[79]!==w||e[80]!==k?(Se=we?n.jsx("div",{className:oe("cursor-grabbing shadow-lg ring-1 ring-border/60",ma(we,!1,O)),children:n.jsx(da,{section:we,raw:ce,meta:k,decofile:w})}):null,e[76]=ce,e[77]=we,e[78]=O,e[79]=w,e[80]=k,e[81]=Se):Se=e[81];let ye;e[82]!==Se?(ye=ho.createPortal(n.jsx(Br,{dropAnimation:wo,children:Se}),document.body),e[82]=Se,e[83]=ye):ye=e[83];let $e;e[84]!==A||e[85]!==ue||e[86]!==je||e[87]!==pe||e[88]!==ne||e[89]!==he||e[90]!==Ee||e[91]!==ye?($e=n.jsxs(A,{sensors:ue,collisionDetection:je,onDragStart:pe,onDragEnd:ne,onDragCancel:he,children:[Ee,ye]}),e[84]=A,e[85]=ue,e[86]=je,e[87]=pe,e[88]=ne,e[89]=he,e[90]=Ee,e[91]=ye,e[92]=$e):$e=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==ae||e[98]!==$e||e[99]!==P?(st=n.jsxs("div",{className:ae,children:[$e,P]}),e[97]=ae,e[98]=$e,e[99]=P,e[100]=st):st=e[100],st}function pi(v){return v.id}function hi(v,e,u,p){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const h=e.trim();if(!h)return Rt(v,u,p)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ds(v,u,p)}:{kind:"noop"};const k=Ks(v,u,p);if(!k)return{kind:"error",reason:"unreadable-rule"};if(k.blockKey)return{kind:"updateBlock",blockKey:k.blockKey,blockData:xt(k.resolveType,k.data,h)};const w=cs(h),y=us(w,u);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:w,blockData:xt(k.resolveType,k.data,h),reference:Lt(w)}}function Dc({orgSlug:v,virtualMcpId:e,branch:u,previewReady:p=!0,previewUrl:h,currentPath:k,activePageBlockKey:w=null,activeGlobalBlockKey:y=null,externalSelection:T,onSaved:b,initialEditSeo:Z=!1,onExitSeo:me,onSelectRoot:Ke,onViewJsonFile:Be,onFocusedBlockChange:Te,onVariantPreviewOverride:re}){const r=Yt(),V=_o(),ge=V?.taskId??null,$=p?{orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h}:null,{data:c,isLoading:O}=Co($),{data:l,isLoading:J}=Do($),G=fs(),ke=V?.virtualMcpId,qe=sr(ke===e?e:null)?.metadata?.siteSlug??null,_e=Jr({virtualMcpId:e,sandboxUrl:h}),[d,M]=j.useState(null),[We,C]=j.useState(null),[Ue,z]=j.useState(null),[mt,fe]=j.useState(0),[ze,_t]=j.useState(void 0),[Le,ie]=j.useState(null),[le,Ae]=j.useState(null),[B,A]=j.useState([]),ce=j.useRef(null),[we,Me]=j.useState(B.length);we!==B.length&&(Me(B.length),requestAnimationFrame(()=>{ce.current&&(ce.current.scrollTop=0)}));const[Re,H]=j.useState(0),[ue,je]=j.useState(null),[pe,ne]=j.useState(null),[he,ae]=j.useState(null),[Pe,ve]=j.useState(!1),[Ve,Ee]=j.useState(!1),Se=j.useRef(null),[ye,$e]=j.useState(!0),[P,st]=j.useState(!1),[Ce,L]=j.useState(!1),[D,Fe]=j.useState(Z),[Xe,nt]=j.useState(Z);Z&&!Xe&&(nt(!0),Fe(!0),M(null),C(null),z(null),A([])),!Z&&Xe&&nt(!1);const[fa,Qt]=j.useState(null),[Os,ps]=j.useState(void 0),[zs,jt]=j.useState([]),[$s,Ft]=j.useState(0),[Ie,Je]=j.useState(0),[pa,De]=j.useState(null),[Tt,Oe]=j.useState(null),[Hs,Gs]=j.useState(null),ha=yo(),ga=`${v}/${e}/${u}`,Zt=Ko({orgSlug:v,virtualMcpId:e,branch:u}),[va,Sa]=j.useState(k),[ya,ba]=j.useState(w),[xa,_a]=j.useState(y);(va!==k||ya!==w||xa!==y)&&(queueMicrotask(()=>Zt.flush()),Sa(k),ba(w),_a(y),M(null),C(null),z(null),fe(0),ie(null),Ae(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1));const Y=Bo({orgSlug:v,virtualMcpId:e,branch:u}),It=Zo((t,s)=>{Y.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=lr({orgSlug:v,virtualMcpId:e,branch:u}),[Nt,At]=j.useState(!1),q=j.useRef(null),qs=j.useRef(null),at=j.useRef(null),ot=j.useRef(null),hs=j.useRef({}),He=j.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[ja,Ea]=j.useState(null);if(!p||O||J)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(bo,{className:"size-5 text-muted-foreground"})});if(!c||!l)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const ka=dr(c),Q=!!y,te=Q?null:mr(ka,k,w),g=Q?y:te?.key??null,gs=Q&&y?c[y]:void 0,Ws=Q&&y&&gs?fr(y,gs):Q&&y?y:"",Ot=!Q&&g&&c[g]?c[g]:null,vs=D&&c&&l&&g&&te?Ln(c,{kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},l):null,wa=D?Ot?.seo:void 0,es=Os!==void 0?Os:wa,Ra=D?Lo(es):void 0,Us=vs?.seoTypeOptions??[],Js=D&&l?Fo(l):"",Ss=fa??Ra??{},ts=D&&vs?Wr(Ss,vs):null,Ys=D&&ts&&Io(es)?ls(ts,l):null,Qs=D?Oo(c,l)?.seoData:void 0,de=Q?[{label:"Default",sections:[{__resolveType:y}]}]:zo(Ot?.sections,c??{}),et=de.length>1,se=Math.min(mt,de.length-1),Ge=de[se],K=Ge?.sections??[],be=rs(K,c),ys=!Q&&pr(Ot?.sections);if(Q&&y&&Hs!==y){Gs(y);const t=K[0],s=be[0];if(t&&s){M(0),Je(0),A([]);const a=kt(t,s,c);a&&(C(a.data),z(a.resolveType),Oe(null),De(null))}}!Q&&Hs!==null&&Gs(null),He.current={rawSections:K,parsedSections:be,decofile:c??{},activePageKey:g,pageVariants:de,variantIndex:se,sectionVariantIndex:Ie,selectedSectionIndex:d};const Va=()=>({multivariate:ys,index:se,variants:de.map(t=>({rule:t.rule}))}),bs=(t,s)=>{if(!re)return;if(!g||!ys||t.length<=1){re(null);return}const a=na(g,{multivariate:!0,index:s,variants:t},c,l);re(a.length>0?a:null)},xs=re&&g&&ys&&et&&!O&&!J?g:null;if(xs!==ja&&(Ea(xs),xs)){const t=de.map(a=>({rule:a.rule})),s=se;queueMicrotask(()=>bs(t,s))}const Mt=(t,s,a)=>{if(!re)return;if(!g){re(null);return}const o=Va(),i=na(g,o,c,l);if(!t||s<0){re(i.length>0?i:null);return}const m=Qr({pageKey:g,page:o,sectionIndex:s,sectionLazy:be[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:l}),f=[...i,...m];re(f.length>0?f:null)},ft=(t,s,a,o=d??-1,i=!1)=>{const m=tt(t,s);if(!m){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const x=Jn(m,lt)[a];if(!x){C(null),z(null),Oe(null),De(null),i&&Mt(null,o,a);return}const R=hr(x.value,c);C(R?.data??null),z(R?.resolveType??null);const{resolveType:S,formValue:E}=Wt(x.rule,c,l??void 0);Oe(S),De(E),i&&Mt(m,o,a)},zt=T?.index;if(T!==void 0&&(T?.seq??null)!==ze&&(_t(T?.seq??null),typeof zt=="number")){const t=K[zt],s=be[zt];if(t&&s)if(M(zt),Je(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,c);a?(C(a.data),z(a.resolveType)):(C(null),z(null)),Oe(null),De(null)}}const $t={orgSlug:v,virtualMcpId:e,branch:u,threadId:ge,previewUrl:h??void 0,siteSlug:qe},_s=Ue&&l?ls(Ue,l):null,Ye=(t,s)=>{if(!g)return;q.current&&(clearTimeout(q.current),q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=qt(c,g,t,se,de);Y.mutate({blockKey:g,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Te?.(null),M(null),L(!1),C(null),z(null),Je(0),De(null),Oe(null),A([]),H(t=>t+1)},Ta=(t,s)=>{const a=He.current.sectionVariantIndex,o=qs.current;q.current&&(clearTimeout(q.current),q.current=null,o&&(o.sectionIndex!==s||o.sectionVariantIndex!==a)&&o.write());const i=()=>{const{rawSections:m,parsedSections:f,decofile:x,activePageKey:R,pageVariants:S,variantIndex:E}=He.current,_=m[s];if(!_)return;const W=f[s];if(!W)return;if(W.isSavedBlock){const F=tr(_,W);if(!F)return;Y.mutate({blockKey:F,data:t},{onSuccess:()=>b?.(),onError:U=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:U.message}))});return}if(!R)return;const X={...x[R]},ee=[...m];if(W.isMultivariate){const F=tt(_,W);if(!F||!R)return;const U=Tr(F,a,t);ee[s]=wt(_,W,U)}else if(W.isHidden){const F=Is(_.__resolveType),U=F?{..._.section}:{..._},I=Array.isArray(U.variants)?[...U.variants]:[];I[0]&&(I[0]={...I[0],value:t}),U.variants=I,F?ee[s]={..._,section:U}:ee[s]=U}else W.isLazy?ee[s]={..._,section:t}:ee[s]=t;if(S.length>1){const F=X.sections,U=[...F?.variants??[]];U[E]&&(U[E]={...U[E],value:ee}),X.sections={...F,variants:U}}else X.sections=ee;Y.mutate({blockKey:R,data:X},{onSuccess:()=>b?.(),onError:F=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:F.message}))})};qs.current={sectionIndex:s,sectionVariantIndex:a,write:i},q.current=setTimeout(()=>{q.current=null,i()},Ms)},Na=t=>{M(t),Je(0),A([]),H(i=>i+1);const s=K[t],a=be[t];if(Te?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,c);if(!o){C(null),z(null),Oe(null),De(null),Mt(null,t,0);return}C(o.data),z(o.resolveType),Oe(null),De(null),Mt(null,t,0)},Zs=t=>{const s=t;C(s),d!==null&&Ta(s,d)},js=t=>{if(!g||!c||!l||!te)return;const s={kind:"page",pageKey:g,pageName:String(te.name??""),path:String(te.path??"")},a=Ln(c,s,l);a&&Zt.save(g,()=>{const o=ha.getQueryData(xo.decofile(ga))?.[g];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const i={...o,...hs.current};return hs.current={},t?.raw!==void 0?{...i,seo:t.raw}:t?.inner!==void 0?Ur(s,a,i,t.inner):i})},Xs=(t,s)=>{g&&(hs.current[t]=s,js())},Aa=(t,s)=>{if(!g)return;const a=ds([...K],t,s);d!==null&&(d===t?M(s):t<d&&s>=d?M(d-1):t>d&&s<=d&&M(d+1)),Ye(a)},Ma=t=>{if(!g)return;const s=K.filter((a,o)=>o!==t);d===t?Pt():d!==null&&d>t&&M(d-1),Ye(s)},Pa=t=>{if(!g)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,Xo(s)),d!==null&&d>t&&M(d+1),Ye(a)},Ca=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a)return;const o=a.isHidden?Er(s):kr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Da=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a||a.isMultivariate)return;const o=jr(s);if(!o)return;const i=[...K];i[t]=o,d===t&&Pt(),Ye(i)},Ka=t=>{if(!g)return;const s=K[t],a=be[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,c);if(!o?.data)return;const{name:i,...m}=o.data,f=[...K];a.isLazy?f[t]={...s,section:m}:f[t]=m,d===t&&Pt(),Ye(f)},Ba=t=>{if(!g)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Ye(s,{onSuccess:()=>{ve(!1),M(a),Je(0),A([]),H(f=>f+1);const o=s[a],i=rs(s,c)[a];if(!o||!i)return;if(i.isMultivariate){ft(o,i,0);return}const m=kt(o,i,c);if(!m){C(null),z(null),Oe(null),De(null);return}C(m.data),z(m.resolveType),Oe(null),De(null)}})},en=t=>{Se.current=t.append,ve(!0)},La=t=>{const s=Se.current;if(!s){Ba(t);return}s({__resolveType:t.resolveType}),ve(!1),Se.current=null},tn=t=>{if(d===null)return;const s=K[d],a=be[d];!s||!a?.isMultivariate||(Je(t),A([]),H(o=>o+1),ft(s,a,t,d,!0))},Fa=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=xr(o,t);if(!i){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const m=[...K];m[d]=wt(s,a,i);const f=i.variants;let x=Ie;t===Ie?x=Math.min(t,f.length-1):t<Ie&&(x=Ie-1),Je(x),A([]),H(R=>R+1),ft(m[d],a,x),Ye(m)},Ia=t=>{if(d===null||!g)return;const s=K[d],a=be[d];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const i=_r(o,t),m=[...K];m[d]=wt(s,a,i);const f=t+1;Je(f),A([]),H(x=>x+1),ft(m[d],a,f),Ye(m)},Oa=(t,s)=>{if(d===null||!g||t===s)return;const a=K[d],o=be[d];if(!a||!o?.isMultivariate)return;const i=tt(a,o);if(!i)return;const m=yr(i,t,s),f=[...K];f[d]=wt(a,o,m);let x=Ie;Ie===t?x=s:t<Ie&&s>=Ie?x=Ie-1:t>Ie&&s<=Ie&&(x=Ie+1),Je(x),ft(f[d],o,x),Ye(f)},Ht=t=>{const s=t??d;if(s===null||!g)return;const a=K[s],o=be[s];if(!a||!o)return;const i=gr(a,o);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const m=[...K];m[s]=i.section;const f=rs(m,c)[s];if(!f?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Je(i.newVariantIndex),A([]),H(x=>x+1),ft(i.section,f,i.newVariantIndex,s),Ye(m)},sn=()=>{if(d===null||!g)return;const t=K[d],s=be[d];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=br(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const i=[...K];i[d]=o;const m=rs(i,c)[d];if(!m)return;Je(0),Oe(null),De(null),A([]),H(x=>x+1);const f=kt(o,m,c);f?(C(f.data),z(f.resolveType)):(C(null),z(null)),Mt(null,d,0),Ye(i)},za=async t=>{if(ue===null||!g)return;const s=us(t,c);if(s){N.error(s);return}const a=K[ue],o=be[ue];if(!a||!o)return;const i=kt(a,o,c);if(!i){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const m={...i.data,name:t};try{await Y.mutateAsync({blockKey:t,data:m});const f=[...K];f[ue]={__resolveType:t},await Y.mutateAsync({blockKey:g,data:qt(c,g,f,se,de)}),d===ue&&Pt(),je(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(f){N.error(f instanceof Error?f.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},nn=Ge?.rule;if(et&&d===null&&le===null&&nn){const{resolveType:t,formValue:s}=Wt(nn,c??{},l??void 0);Ae(t),ie(s)}const Ct=l?$o(l):[],Es=l&&c?Ho(l,c):[],an=!Q&&!!(_e&&l&&c),on=le&&l?ls(le,l):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(Vr(s,t,l)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},rn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i={...a[s]},m={...i.sections},f=[...m.variants??[]],x=f[o],R=x?.rule;if(Rt(R,a,l)){const S=R?.__resolveType??"",E=a[S],_=typeof E?.name=="string"?E.name:S,{__resolveType:W,...X}=t;Y.mutate({blockKey:S,data:xt(W??"",X,_)},{onSuccess:()=>b?.(),onError:ee=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:ee.message}))});return}x&&(f[o]={...x,rule:t}),i.sections={...m,variants:f},Y.mutate({blockKey:s,data:i},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ms)},ln=t=>{Ae(t);const s=t?Yn(t,l):{__resolveType:Qn};ie(t?s:{}),rn(s)},cn=t=>{const s=t;ie(s);const a=le?{__resolveType:le,...s}:{...s};rn(a)},un=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=He.current;if(!s)return;const i=a[s],m=i?.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[o];if(!R)return;const S=bt(R.rule,a,l),E=Lt(t);x[o]={...R,rule:E};const _={...a,[s]:{...i,sections:{...f,variants:x}}},{resolveType:W,formValue:X}=Wt(E,_,l??void 0);Ae(W),ie(X);try{await Y.mutateAsync({blockKey:s,data:_[s]}),S&&S!==t&&await Et(S,_),b?.()}catch(ee){N.error(ee instanceof Error?ee.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},dn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=He.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const X=(_.variants??[])[a]?.rule;if(Rt(X,m,l)){const I=X?.__resolveType??"",Ze=m[I],rt=typeof Ze?.name=="string"?Ze.name:I,{__resolveType:St,...it}=t;Y.mutate({blockKey:I,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const ee=Zn(_,a,t),F=[...o];F[s]=wt(S,E,ee);const U=qt(m,f,F,R,x);Y.mutate({blockKey:f,data:U},{onSuccess:()=>b?.(),onError:I=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:I.message}))})},Ms))},$a=t=>{Oe(t);const s=t?Yn(t,l):{__resolveType:Qn};De(t?s:{}),dn(s)},Ha=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};dn(a)},Ga=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(s===null||!f)return;const S=o[s],E=i[s];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],X=bt(W[a]?.rule,m,l),ee=Lt(t),F=Zn(_,a,ee),U=[...o];U[s]=wt(S,E,F);const I=qt(m,f,U,R,x),Ze={...m,[f]:I},{resolveType:rt,formValue:St}=Wt(ee,Ze,l??void 0);Oe(rt),De(St);try{await Y.mutateAsync({blockKey:f,data:I}),X&&X!==t&&await Et(X,Ze),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Q&&!te)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:k})});if(Q&&!gs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const xe=d!==null?be[d]??null:null,mn=d!==null?K[d]:null,fn=mn&&xe?.isMultivariate?tt(mn,xe):null,ht=fn?Jn(fn,lt):[],ss=Math.min(Ie,Math.max(ht.length-1,0)),Dt=ht[ss]??null,gt=xe?.isMultivariate===!0,ks=d!==null&&xe!==null,vt=ks&&(gt||!!(_s&&We)),qa=vt&&!Q&&xe?.isSavedBlock===!0,Qe=Q||qa,pn=Q?Ws:xe?.label??"",Wa=Tt&&l?ls(Tt,l):null,hn=(t,s)=>s&&G?`${t} · ${s}`:t,gn=xe?xe.variantOf??xe.label:"",Ua=(()=>{const t=gt&&Dt?Dt.label:null;return t?G?[hn(gn,t)]:[xe.label,t]:[xe?.label??""]})(),ws=hn(te?.name??"",et?Ge?.label:null),ns=vt&&(!Q||B.length>0)?Q?[Ws,...B]:[ws,...Ua,...B]:[],vn=D&&te?[te.name,"SEO",...zs]:[],Sn=r("sectionsEditor.pageVariantTabs.variantsLabel"),yn=P&&te?[te.name,Sn]:Ce&&te&&xe?[ws,gn,Sn]:[],as=yn.length>0?yn:vn.length>0?vn:Qe?ns.length>0?ns:[pn]:ns.length>0?ns:[ws],bn=ks&&!gt&&!xe?.isHidden&&!!g,Ja=Qe||!Q&&et&&!!Ge||bn,Ya=ks&&!gt&&!Q&&B.length===0&&!!xe&&ia(xe)&&!!g,Qa=G&&vt&&!Ce&&gt&&B.length===0&&!!Dt,xn=G&&B.length>0?Fn(B[B.length-1]):null,Za=B.length>1?Fn(B[B.length-2]):null,_n=Qe?pn:vt?xe?.label??"":te?.name??"",Xa=P||Ce?r("sectionsEditor.pageVariantTabs.variantsLabel"):D?r("sectionsEditor.panelSections.seo"):xn??_n,jn=Ce?xe?.variantOf??xe?.label??"":P||D?te?.name??"":xn?Za??_n:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?te?.name??"":te?.path??"",Rs=!P&&!Ce&&!D&&!vt&&!Qe,eo=!G&&!D&&!Q&&gt&&B.length===0,Gt=()=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const t=c[g],s=vr(t.sections,K);if(!s)return;const a=Sr(s);Y.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{fe(a),M(null),C(null),z(null),A([]),ie(null),Ae(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},os=(t,s,a)=>{if(!g)return;pt(),q.current&&(clearTimeout(q.current),q.current=null);const o=c[g],i=o.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const m=i;if(!Array.isArray(m.variants))return;const f=t([...m.variants]);if(!f)return;const x=Rr(m,f),R={...c,[g]:{...o,sections:x}};Y.mutate({blockKey:g,data:R[g]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const E of S)await Et(E,R)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{ne(null),fe(t),M(null),C(null),z(null),A([]);const s=de[t]?.rule,{resolveType:a,formValue:o}=Wt(s,c??{},l??void 0);Ae(a),ie(o),bs(de.map(i=>({rule:i.rule})),t)},En=(t,s)=>{if(t===s)return;let a=se;se===t?a=s:t<se&&s>=se?a=se-1:t>se&&s<=se&&(a=se+1),fe(a);const o=ds(de.map(i=>({rule:i.rule})),t,s);bs(o,a),os(i=>ds(i,t,s))},kn=t=>{const s=de[t]?.rule,a=bt(s,c??{},l??void 0);os(o=>o.length<=1?null:(o.splice(t,1),o),()=>{de.length-1===1?fe(0):t<se?fe(se-1):t===se&&fe(Math.max(0,t-1)),M(null),C(null),z(null),A([]),ie(null),Ae(null)},a)},to=()=>{const t=de.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!wr(s.rule)).map(({variant:s})=>bt(s.rule,c??{},l??void 0)).filter(s=>!!s);os(s=>{const a=Nr({variants:s}),o=s[a];return o?[{...o,rule:Ar()}]:null},()=>{fe(0),M(null),C(null),z(null),A([]),ie(null),Ae(null),st(!1)},t)},wn=t=>{os(s=>Mr(s,t),()=>{fe(t+1),M(null),C(null),z(null),A([]),ie(null),Ae(null)})},so=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const a=He.current.activePageKey,o=He.current.decofile;if(!a)return;const i=o[a],m=i.sections;if(!m||typeof m!="object"||Array.isArray(m))return;const f=m;if(!Array.isArray(f.variants))return;const x=[...f.variants],R=x[t];if(!R?.rule||typeof R.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=R.rule,E=s.trim();At(!0);try{if(!E){if(!Rt(S,o,l)){ne(null);return}const U=S.__resolveType??"";x[t]={...R,rule:Ds(S,o,l)};const I={...o,[a]:{...i,sections:{...f,variants:x}}};await Y.mutateAsync({blockKey:a,data:I[a]}),await Et(U,I),ne(null),b?.();return}const _=Ks(S,o,l);if(!_){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(_.blockKey){await Y.mutateAsync({blockKey:_.blockKey,data:xt(_.resolveType,_.data,E)}),ne(null),b?.();return}const W=cs(E),X=us(W,o);if(X){N.error(X);return}const ee=xt(_.resolveType,_.data,E);let F=null;try{await Y.mutateAsync({blockKey:W,data:ee}),F=W,x[t]={...R,rule:Lt(W)},await Y.mutateAsync({blockKey:a,data:{...i,sections:{...f,variants:x}}}),F=null}catch(U){throw F&&await Xt.mutateAsync({blockKey:F}).catch(()=>{}),U}ne(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:E})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no=async(t,s)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:i,decofile:m,activePageKey:f,pageVariants:x,variantIndex:R}=He.current;if(a===null||!f)return;const S=o[a],E=i[a];if(!S||!E?.isMultivariate)return;const _=tt(S,E);if(!_)return;const W=_.variants??[],X=W[t];if(!X?.rule||typeof X.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ee=X.rule,F=s.trim();At(!0);const U=async I=>{const Ze={..._,variants:I},rt=[...o];rt[a]=wt(S,E,Ze);const St=qt(m,f,rt,R,x);return await Y.mutateAsync({blockKey:f,data:St}),{...m,[f]:St}};try{if(!F){if(!Rt(ee,m,l)){ae(null);return}const yt=ee.__resolveType??"",Kn=[...W];Kn[t]={...X,rule:Ds(ee,m,l)};const po=await U(Kn);await Et(yt,po),ae(null),b?.();return}const I=Ks(ee,m,l);if(!I){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(I.blockKey){await Y.mutateAsync({blockKey:I.blockKey,data:xt(I.resolveType,I.data,F)}),ae(null),b?.();return}const Ze=cs(F),rt=us(Ze,m);if(rt){N.error(rt);return}const St=xt(I.resolveType,I.data,F);let it=null;try{await Y.mutateAsync({blockKey:Ze,data:St}),it=Ze;const yt=[...W];yt[t]={...X,rule:Lt(Ze)},await U(yt),it=null}catch(yt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),yt}ae(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:F})),b?.()}catch(I){N.error(I instanceof Error?I.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},Rn=async(t,s,a)=>{C(a);try{await Y.mutateAsync({blockKey:t,data:a})}catch(o){throw C(i=>i===a?s:i),o}},ao={rename:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s],x=f?.rule&&typeof f.rule=="object"?f.rule:void 0,R=async E=>{const _={...t,variants:E};return await Rn(o,t,_),{...i,[o]:_}},S=hi(x,a,i,l);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const _=[...m];_[s]={...f,rule:S.inlinedRule};const W=await R(_);await Et(S.blockKey,W),b?.();return}if(S.kind==="updateBlock"){await Y.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let E=null;try{await Y.mutateAsync({blockKey:S.blockId,data:S.blockData}),E=S.blockId;const _=[...m];_[s]={...f,rule:S.reference},await R(_),E=null}catch(_){throw E&&await Xt.mutateAsync({blockKey:E}).catch(()=>{}),_}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),q.current&&(clearTimeout(q.current),q.current=null);const{activePageKey:o,decofile:i}=He.current;if(!o)return;const m=Array.isArray(t.variants)?[...t.variants]:[],f=m[s];if(!f)return;const x=bt(f.rule,i,l);m[s]={...f,rule:Lt(a)};const R={...t,variants:m},S={...i,[o]:R};try{await Rn(o,t,R),x&&x!==a&&await Et(x,S),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},Vn=()=>{Pt()},Tn=t=>{Qt(t),js({inner:t})},Nn=t=>{ps(t),js({raw:t})},An=()=>{Qt(null),jt([])},Mn=()=>Ft(t=>t+1),Pn=()=>{Zt.flush(),Fe(!1),Qt(null),ps(void 0),jt([]),Ft(t=>t+1),me?.()},oo=()=>{st(!1),L(!1),M(null),Fe(!0)},ro=()=>{D&&Pn(),M(null),st(!0)},io=()=>L(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Ce&&t<2){L(!1),t===0&&M(null);return}if(D){if(t===0){Pn();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Q){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){Vn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&&gt&&Dt?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(B.slice(0,t-1-s))},Ns=as.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(er(as.length,{isMultivariateSectionTop:eo})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:oe("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Qe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(rr,{className:"size-4"})}):null,lo=Qe||vt||D?Ja&&n.jsxs("div",{className:oe("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Q&&et&&Ge&&n.jsxs("button",{type:"button",onClick:Vn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:Ge.label}),className:oe("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",qo),children:[n.jsx(Go,{rule:Ps(Ge.rule,c??{},l??void 0),matchers:Ct}),n.jsx("span",{className:"max-w-[160px] truncate",children:Ge.label})]}),n.jsx("div",{className:"flex-1"}),Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),bn&&n.jsx(is,{onClick:()=>Ht()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Xs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Fe(!0),children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Be&&g?Be():Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(is,{onClick:Gt})]}),co=n.jsxs(n.Fragment,{children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsx(zn,{className:"mt-3",children:n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})})]}),Cn=n.jsxs(n.Fragment,{children:[n.jsx(Wo,{listKey:`${g??""}:${d??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ss,onSelect:tn,onRename:ae,onDuplicate:Ia,onDelete:Fa,onRemoveAll:sn,onReorder:Oa,onAdd:()=>Ht()}),n.jsx(zn,{children:n.jsx(As,{currentRt:Tt??"",currentLabel:Ut(Dt?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Dt?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:$a,onSelectGlobal:Ga,schema:Wa,formValue:pa,onChange:Ha,formKey:`${d??"none"}:${ss}:${Tt??""}`,formWrapperClassName:"pt-1",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn=n.jsx("div",{className:oe(G?"px-2":"p-2 pt-3"),children:n.jsx(fi,{listKey:`${g??""}-${se}`,rawSections:K,sections:be,meta:l,decofile:c,selectedIndex:d,onSelect:Na,onReorder:Aa,onDelete:Ma,onDuplicate:Pa,onMakeReusable:je,onToggleHidden:Ca,onToggleLazy:Da,onAddVariant:Ht,onDetach:Ka,onAddSection:()=>ve(!0),canAddSection:an})}),uo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&te&&n.jsx(In,{pageKey:g,initialName:te.name,initialPath:te.path,onFieldChange:Xs}),Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),mo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&g?n.jsx(sa,{rawSeo:es,innerSeo:Ss,defaultResolveType:Js,seoSchema:Ys,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Nn,onInnerChange:Tn,onClearForm:An,onBumpFormKey:Mn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),fo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[et&&g&&n.jsx(On,{listKey:g,variants:de,activeIndex:se,decofile:c??{},meta:l,matchers:Ct,onSelect:Vs,onReorder:En,onRename:ne,onDuplicate:wn,onDelete:kn,onAdd:Gt}),et&&le!==null&&n.jsxs("div",{className:oe("px-3 border-b",ye?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>$e(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-muted/40","aria-expanded":ye,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),ye?n.jsx(nr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(ar,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),ye&&n.jsx("div",{className:oe("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(As,{currentRt:le,currentLabel:Ut(Ge?.rule,c??{},lt,l??void 0),currentGlobalKey:bt(Ge?.rule,c??{},l??void 0)??void 0,matchers:Ct,globals:Es,onSelect:ln,onSelectGlobal:un,schema:on,formValue:Le,onChange:cn,formKey:`${se}:${le??""}`,formWrapperClassName:"space-y-3",meta:l??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Dn]},"editor-section-list");return n.jsx(Uo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||as.length>1)&&n.jsx(Jo,{crumbs:as,onSelect:Ts,onSelectRoot:()=>{Zt.flush(),Ke?Ke():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:oe("flex items-center gap-2 border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(ms,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Xa}),jn&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:jn})]}),Rs&&et&&Ge&&n.jsx($n,{variants:de,activeIndex:se,onSelect:Vs,onManage:ro,onRemoveAll:to}),Qa&&n.jsx($n,{variants:ht,activeIndex:ss,onSelect:tn,onManage:io,onRemoveAll:sn}),Rs&&!et&&n.jsx(is,{onClick:Gt}),Ya&&n.jsx(is,{onClick:()=>Ht()}),n.jsx(Yo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:oo,children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Be&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):lo}),Ce?n.jsx(Hn,{onAdd:()=>Ht(),children:Cn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&&gt&&ht.length>0&&B.length===0&&Cn,n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Zs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en,onVariantMatcherOp:Q?ao:void 0})]},"editor-section-form"):Q?n.jsx(Bt,{viewportRef:ce,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Gn,{activeSchema:_s,formValue:We,formResetKey:Re,onFormChange:Zs,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:l,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:_e,onRequestAddSection:en})},"editor-global-block"):D?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:uo})},"editor-seo"):mo:P?n.jsx(Hn,{onAdd:Gt,children:co},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Dn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:an,onAddSection:()=>ve(!0)})})]},"editor-section-list"):fo,n.jsx(Qo,{open:ue!==null,onOpenChange:t=>{t||je(null)},defaultBlockId:ue!==null?cs(be[ue]?.label??""):"",isPending:Y.isPending,onSubmit:za}),_e&&n.jsx(Yr,{open:Pe,onOpenChange:t=>{ve(t),t||(Se.current=null)},meta:l,decofile:c,previewBaseUrl:_e,onSelect:La}),Ve&&g&&c&&n.jsx(cr,{open:Ve,onOpenChange:Ee,pageKey:g,decofile:c}),pe!==null&&n.jsx(qn,{open:!0,initialName:Rt(de[pe]?.rule,c??{},l??void 0)?Ut(de[pe]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(de[pe]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await so(pe,t)},onOpenChange:t=>{!t&&!Nt&&ne(null)}}),he!==null&&n.jsx(qn,{open:!0,initialName:Rt(ht[he]?.rule,c??{},l??void 0)?Ut(ht[he]?.rule,c??{},lt,l??void 0):"",autoLabel:lt(Ps(ht[he]?.rule,c??{},l??void 0)),isPending:Nt,onSubmit:async t=>{await no(he,t)},onOpenChange:t=>{!t&&!Nt&&ae(null)}})]})})}export{Dc as SectionsEditor};
@@ -1 +1 @@
1
- import{r as d,bm as k,bn as Ie,j as c,bo as j,bp as P,bq as rt,br as Ne,bs as st,bt as lt,bu as $,bv as at,aR as Ee,bw as it,bx as Re,by as ct,bz as dt,bA as ut,bB as pt,bC as ft,bD as mt,bE as ht,bF as vt,bG as gt,bH as xt,bI as St,c as ee,l as oe}from"./index-DiCP27dD.js";import{V as wt}from"./index-CHuCYD81.js";import{i as yt}from"./Check-D-yzmwYn.js";import{t as je,n as Ct}from"./ChevronUp-D60SP3XH.js";function Pe(r,[e,t]){return Math.min(t,Math.max(e,r))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:s,defaultValue:l,onValueChange:i,dir:u,name:m,autoComplete:g,disabled:w,required:y,form:S}=r,p=pe(e),[v,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:i,caller:J}),L=d.useRef(null),B=v?S||!!v.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(Nt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Pt,{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:y,tabIndex:-1,name:m,autoComplete:g,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,a=pe(t),s=G(Ae,t),l=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),m=d.useRef("touch"),[g,w,y]=ot(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),h=nt(v,p,C);h!==void 0&&s.onValueChange(h.value)}),S=p=>{l||(s.onOpenChange(!0),y()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...a,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:l,"data-disabled":l?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&bt.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:a,placeholder:s="",...l}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,m=a!==void 0,g=k(e,i.onValueNodeChange);return $(()=>{u(m)},[u,m]),c.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):a})});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 a=o;return a?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),a):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:a,onPointerDownOutside:s,side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,h=G(Q,t),[x,F]=d.useState(null),[M,re]=d.useState(null),_=k(e,f=>F(f)),[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(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.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 f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};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:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,a=G(Q,t),s=Y(Q,t),[l,i]=d.useState(null),[u,m]=d.useState(null),g=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:h}=s,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&v&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.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(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,v,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return c.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:g,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,...a}=r,s=pe(t);return c.jsx(xt,{...s,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.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,a=Y(we,t),s=Te(we,t),l=k(e,a.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:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const y=Math.abs(i.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}i.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();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:a,...s}=r,l=G(ce,t),i=Y(ce,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>i.itemRefCallback?.(h,o,n)),p=Ie(),v=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.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(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,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:P(s.onFocus,()=>y(!0)),onBlur:P(s.onBlur,()=>y(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:P(s.onPointerMove,h=>{v.current=h.pointerType,n?i.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,h=>{h.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,h=>{i.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=r,s=G(le,t),l=Y(le,t),i=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=k(e,C=>g(C),i.onItemTextChange,C=>l.itemTextRefCallback?.(C,i.value,i.disabled)),y=m?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...a,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(a.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 ye="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,a]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollTop>0;a(u)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop-i.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,a]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollHeight-i.clientHeight,m=Math.ceil(i.scrollTop)<u;a(m)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop+i.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,a=Y("SelectScrollButton",t),s=d.useRef(null),l=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(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 be="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),a=G(be,t),s=Y(be,t);return a.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),s=ct(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const i=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[s,e]),c.jsx(j.select,{...t,style:{...wt,...t.style},ref:a,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 l=t.current+s;e(l),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?r.indexOf(t):-1;let s=Kt(r,Math.max(a,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,_e=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(13);let t,o,n,a;e[0]!==r?({className:o,size:a,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const s=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-[var(--studio-outline-hover-background)] hover:text-accent-foreground flex w-fit items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-[var(--studio-control-height,2rem)] data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-[var(--studio-control-radius,var(--radius-lg))] *: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-4",o),e[5]=o,e[6]=l):l=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-4 opacity-50"})}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,i]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,a,s;e[0]!==r?({className:o,children:t,position:a,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=s):(t=e[1],o=e[2],n=e[3],a=e[4],s=e[5]);const l=a===void 0?"popper":a,i=s===void 0?!1:s,u=l==="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 m;e[6]!==o||e[7]!==u?(m=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]=m):m=e[8];let g;e[9]!==i?(g=!i&&c.jsx(no,{}),e[9]=i,e[10]=g):g=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=c.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,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 v;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==g||e[22]!==S||e[23]!==p?(v=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(19);let t,o,n,a,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...a}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=s):(t=e[1],o=e[2],n=e[3],a=e[4],s=e[5]);const l=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 m;e[9]!==l?(m=!l&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(_e,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=g):g=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==g?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,g]}),e[14]=a,e[15]=u,e[16]=m,e[17]=g,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ct,{className:"size-4"}),e[5]=a):a=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:a}),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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"size-4"}),e[5]=a):a=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:a}),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,Pe as e};
1
+ import{r as d,bm as k,bn as Ie,j as c,bo as j,bp as P,bq as rt,br as Ne,bs as st,bt as lt,bu as $,bv as at,aR as Ee,bw as it,bx as Re,by as ct,bz as dt,bA as ut,bB as pt,bC as ft,bD as mt,bE as ht,bF as vt,bG as gt,bH as xt,bI as St,c as ee,l as oe}from"./index-Co-4sRnJ.js";import{V as wt}from"./index-MAF8_efg.js";import{i as yt}from"./Check-CO_ET4WO.js";import{t as je,n as Ct}from"./ChevronUp-DnrzvZVs.js";function Pe(r,[e,t]){return Math.min(t,Math.max(e,r))}var bt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,Tt]=it(J),[ne]=vt(J,[Tt,Re]),pe=Re(),[Nt,G]=ne(J),[Pt,_t]=ne(J),Me=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:a,value:s,defaultValue:l,onValueChange:i,dir:u,name:m,autoComplete:g,disabled:w,required:y,form:S}=r,p=pe(e),[v,C]=d.useState(null),[h,x]=d.useState(null),[F,M]=d.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:i,caller:J}),L=d.useRef(null),B=v?S||!!v.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(Nt,{required:y,scope:e,trigger:v,onTriggerChange:C,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[c.jsx(de.Provider,{scope:e,children:c.jsx(Pt,{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:y,tabIndex:-1,name:m,autoComplete:g,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,a=pe(t),s=G(Ae,t),l=s.disabled||o,i=k(e,s.onTriggerChange),u=ue(t),m=d.useRef("touch"),[g,w,y]=ot(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),h=nt(v,p,C);h!==void 0&&s.onValueChange(h.value)}),S=p=>{l||(s.onOpenChange(!0),y()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(lt,{asChild:!0,...a,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:l,"data-disabled":l?"":void 0,"data-placeholder":tt(s.value)?"":void 0,...n,ref:i,onClick:P(n.onClick,p=>{p.currentTarget.focus(),m.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{m.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&bt.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:a,placeholder:s="",...l}=r,i=G(De,t),{onValueNodeHasChildrenChange:u}=i,m=a!==void 0,g=k(e,i.onValueNodeChange);return $(()=>{u(m)},[u,m]),c.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:s}):a})});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 a=o;return a?Ee.createPortal(c.jsx(He,{scope:r.__scopeSelect,children:c.jsx(de.Slot,{scope:r.__scopeSelect,children:c.jsx("div",{children:r.children})})}),a):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:a,onPointerDownOutside:s,side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,h=G(Q,t),[x,F]=d.useState(null),[M,re]=d.useState(null),_=k(e,f=>F(f)),[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(f=>{const[T,...R]=B().map(N=>N.ref.current),[b]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===b&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=d.useCallback(()=>E([O,x]),[E,O,x]);d.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=h;d.useEffect(()=>{if(x){let f={x:0,y:0};const T=b=>{f={x:Math.abs(Math.round(b.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(K.current?.y??0))}},R=b=>{f.x<=10&&f.y<=10?b.preventDefault():x.contains(b.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 f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=ot(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),b=nt(T,f,R);b&&setTimeout(()=>b.ref.current.focus())}),me=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&(U(f),b&&(H.current=!0))},[h.value]),he=d.useCallback(()=>x?.focus(),[x]),te=d.useCallback((f,T,R)=>{const b=!H.current&&!R;(h.value!==void 0&&h.value===T||b)&&L(f)},[h.value]),ie=o==="popper"?Se:Fe,se=ie===Se?{side:l,sideOffset:i,align:u,alignOffset:m,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};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:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ie,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let b=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=b.indexOf(I);b=b.slice(N+1)}setTimeout(()=>E(b)),f.preventDefault()}})})})})})})});ze.displayName=jt;var At="SelectItemAlignedPosition",Fe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,a=G(Q,t),s=Y(Q,t),[l,i]=d.useState(null),[u,m]=d.useState(null),g=k(e,_=>m(_)),w=ue(t),y=d.useRef(!1),S=d.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:h}=s,x=d.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&v&&C){const _=a.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=a.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(a.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.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(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,u,p,v,C,a.dir,o]);$(()=>x(),[x]);const[F,M]=d.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=d.useCallback(_=>{_&&S.current===!0&&(x(),h?.(),S.current=!1)},[x,h]);return c.jsx(Dt,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:re,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:c.jsx(j.div,{...n,ref:g,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,...a}=r,s=pe(t);return c.jsx(xt,{...s,...a,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.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,a=Y(we,t),s=Te(we,t),l=k(e,a.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:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const m=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const y=Math.abs(i.current-m.scrollTop);if(y>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const h=C+y,x=Math.min(S,h),F=h-x;g.style.height=x+"px",g.style.bottom==="0px"&&(m.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}i.current=m.scrollTop})})})]})});Ue.displayName=we;var We="SelectGroup",[kt,Lt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();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:a,...s}=r,l=G(ce,t),i=Y(ce,t),u=l.value===o,[m,g]=d.useState(a??""),[w,y]=d.useState(!1),S=k(e,h=>i.itemRefCallback?.(h,o,n)),p=Ie(),v=d.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.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(h=>{g(x=>x||(h?.textContent??"").trim())},[]),children:c.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:m,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:P(s.onFocus,()=>y(!0)),onBlur:P(s.onBlur,()=>y(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,h=>{v.current=h.pointerType}),onPointerMove:P(s.onPointerMove,h=>{v.current=h.pointerType,n?i.onItemLeave?.():v.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,h=>{h.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,h=>{i.searchRef?.current!==""&&h.key===" "||(It.includes(h.key)&&C(),h.key===" "&&h.preventDefault())})})})})});Ge.displayName=ce;var le="SelectItemText",Ye=d.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...a}=r,s=G(le,t),l=Y(le,t),i=$e(le,t),u=_t(le,t),[m,g]=d.useState(null),w=k(e,C=>g(C),i.onItemTextChange,C=>l.itemTextRefCallback?.(C,i.value,i.disabled)),y=m?.textContent,S=d.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:y},i.value),[i.disabled,i.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...a,ref:w}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(a.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 ye="SelectScrollUpButton",Ze=d.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,a]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollTop>0;a(u)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop-i.offsetHeight)}}):null});Ze.displayName=ye;var Ce="SelectScrollDownButton",Je=d.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,a]=d.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=i.scrollHeight-i.clientHeight,m=Math.ceil(i.scrollTop)<u;a(m)};const i=t.viewport;return l(),i.addEventListener("scroll",l),()=>i.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?c.jsx(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:i}=t;l&&i&&(l.scrollTop=l.scrollTop+i.offsetHeight)}}):null});Je.displayName=Ce;var Qe=d.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,a=Y("SelectScrollButton",t),s=d.useRef(null),l=ue(t),i=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>i(),[i]),$(()=>{l().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),c.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(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 be="SelectArrow",Ut=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),a=G(be,t),s=Y(be,t);return a.open&&s.position==="popper"?c.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Wt="SelectBubbleInput",et=d.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=d.useRef(null),a=k(o,n),s=ct(e);return d.useEffect(()=>{const l=n.current;if(!l)return;const i=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==e&&m){const g=new Event("change",{bubbles:!0});m.call(l,e),l.dispatchEvent(g)}},[s,e]),c.jsx(j.select,{...t,style:{...wt,...t.style},ref:a,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 l=t.current+s;e(l),(function i(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>i(""),1e3))})(l)},[e]),a=d.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,a]}function nt(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=t?r.indexOf(t):-1;let s=Kt(r,Math.max(a,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,_e=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(13);let t,o,n,a;e[0]!==r?({className:o,size:a,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a):(t=e[1],o=e[2],n=e[3],a=e[4]);const s=a===void 0?"default":a;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-[var(--studio-outline-hover-background)] hover:text-accent-foreground flex w-fit items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-[var(--studio-control-height,2rem)] data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-[var(--studio-control-radius,var(--radius-lg))] *: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-4",o),e[5]=o,e[6]=l):l=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(qt,{asChild:!0,children:c.jsx(je,{className:"size-4 opacity-50"})}),e[7]=i):i=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=c.jsxs(Gt,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,i]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,a,s;e[0]!==r?({className:o,children:t,position:a,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=s):(t=e[1],o=e[2],n=e[3],a=e[4],s=e[5]);const l=a===void 0?"popper":a,i=s===void 0?!1:s,u=l==="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 m;e[6]!==o||e[7]!==u?(m=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]=m):m=e[8];let g;e[9]!==i?(g=!i&&c.jsx(no,{}),e[9]=i,e[10]=g):g=e[10];const w=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let y;e[11]!==w?(y=oe("p-1",w),e[11]=w,e[12]=y):y=e[12];let S;e[13]!==t||e[14]!==y?(S=c.jsx(Jt,{className:y,children:t}),e[13]=t,e[14]=y,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 v;return e[18]!==l||e[19]!==n||e[20]!==m||e[21]!==g||e[22]!==S||e[23]!==p?(v=c.jsx(Xt,{children:c.jsxs(Zt,{"data-slot":"select-content",translate:"no",className:m,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=m,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(19);let t,o,n,a,s;e[0]!==r?({className:o,children:t,description:n,hideCheck:s,...a}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=a,e[5]=s):(t=e[1],o=e[2],n=e[3],a=e[4],s=e[5]);const l=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 m;e[9]!==l?(m=!l&&c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(eo,{children:c.jsx(yt,{className:"size-4"})})}),e[9]=l,e[10]=m):m=e[10];let g;e[11]!==t||e[12]!==n?(g=n?c.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c.jsx(_e,{children:t}),c.jsx("span",{className:"text-xs text-muted-foreground whitespace-normal",children:n})]}):c.jsx(_e,{children:t}),e[11]=t,e[12]=n,e[13]=g):g=e[13];let w;return e[14]!==a||e[15]!==u||e[16]!==m||e[17]!==g?(w=c.jsxs(Qt,{"data-slot":"select-item",className:u,...a,children:[m,g]}),e[14]=a,e[15]=u,e[16]=m,e[17]=g,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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Ct,{className:"size-4"}),e[5]=a):a=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:a}),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 a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"size-4"}),e[5]=a):a=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:a}),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,Pe as e};
@@ -1 +1 @@
1
- import{c as $,b as A,r as R,l as G,j as s,B as H}from"./index-DiCP27dD.js";import{a as J,d as K,b as Q,D as U}from"./dialog-mikl7FPK.js";import{c as V,b as W,a as X,D as Y}from"./drawer-D3v6_JsP.js";import{u as Z}from"./use-mobile-pQqIDSFe.js";import{c as ee}from"./chat-context-BME83pNr.js";import{S as F,M as se}from"./decopilot-BC1XQuwZ.js";import{M as le,a as te}from"./index-B7fuDbL1.js";function he(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:v,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=v!==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 focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const f=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==v||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:v,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,e[16]=k,e[17]=v,e[18]=i,e[19]=N):N=e[19];const m=N;if(q){let g;e[20]!==f?(g=s.jsx(V,{asChild:!0,children:f}),e[20]=f,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let b;e[26]!==m?(b=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:m}),e[26]=m,e[27]=b):b=e[27];let C;e[28]!==M||e[29]!==b?(C=s.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,b]}),e[28]=M,e[29]=b,e[30]=C):C=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==C?(T=s.jsxs(Y,{open:a,onOpenChange:S,children:[g,C]}),e[31]=a,e[32]=g,e[33]=C,e[34]=T):T=e[34],T}let h;e[35]!==f?(h=s.jsx(J,{asChild:!0,children:f}),e[35]=f,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=s.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==m||e[42]!==p?(u=s.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,m]}),e[41]=m,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=s.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{he as M};
1
+ import{c as $,b as A,r as R,l as G,j as s,B as H}from"./index-Co-4sRnJ.js";import{a as J,d as K,b as Q,D as U}from"./dialog-Dw8xcjW3.js";import{c as V,b as W,a as X,D as Y}from"./drawer-Dt1DFlEt.js";import{u as Z}from"./use-mobile-C_c7X_X9.js";import{c as ee}from"./chat-context-CocIg825.js";import{S as F,M as se}from"./decopilot-2FFmwoNB.js";import{M as le,a as te}from"./index-DcYvMhsA.js";function he(L){const e=$.c(48),{variant:o,className:t,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:v,filterModels:E}=L,z=o===void 0?"borderless":o,w=n===void 0?"Select model":n,r=A(),[a,S]=R.useState(!1),i=v!==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 focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",_,t),e[0]=t,e[1]=_,e[2]=d):d=e[2];let c;e[3]!==I||e[4]!==l||e[5]!==w||e[6]!==i?(c=i?s.jsx(F,{model:l??null,placeholder:w,isLoading:I}):s.jsx(ne,{placeholder:w}),e[3]=I,e[4]=l,e[5]=w,e[6]=i,e[7]=c):c=e[7];let D;e[8]!==O||e[9]!==d||e[10]!==c?(D=s.jsx(H,{variant:O,size:"sm",className:d,children:c}),e[8]=O,e[9]=d,e[10]=c,e[11]=D):D=e[11];const f=D;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{}),e[12]=y):y=e[12];let N;e[13]!==P||e[14]!==E||e[15]!==l||e[16]!==k||e[17]!==v||e[18]!==i?(N=s.jsx(R.Suspense,{fallback:y,children:i?s.jsx(le,{onClose:()=>S(!1),credentialId:P??null,onCredentialChange:k??oe,selectedModel:l??null,onModelChange:v,filterModels:E}):s.jsx(te,{onClose:()=>S(!1)})}),e[13]=P,e[14]=E,e[15]=l,e[16]=k,e[17]=v,e[18]=i,e[19]=N):N=e[19];const m=N;if(q){let g;e[20]!==f?(g=s.jsx(V,{asChild:!0,children:f}),e[20]=f,e[21]=g):g=e[21];let j;e[22]!==r?(j=r("chat.selectModel.selectModel"),e[22]=r,e[23]=j):j=e[23];let M;e[24]!==j?(M=s.jsx(W,{className:"sr-only",children:j}),e[24]=j,e[25]=M):M=e[25];let b;e[26]!==m?(b=s.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:m}),e[26]=m,e[27]=b):b=e[27];let C;e[28]!==M||e[29]!==b?(C=s.jsxs(X,{className:"p-0 flex flex-col max-h-[95vh]",children:[M,b]}),e[28]=M,e[29]=b,e[30]=C):C=e[30];let T;return e[31]!==a||e[32]!==g||e[33]!==C?(T=s.jsxs(Y,{open:a,onOpenChange:S,children:[g,C]}),e[31]=a,e[32]=g,e[33]=C,e[34]=T):T=e[34],T}let h;e[35]!==f?(h=s.jsx(J,{asChild:!0,children:f}),e[35]=f,e[36]=h):h=e[36];let x;e[37]!==r?(x=r("chat.selectModel.selectModel"),e[37]=r,e[38]=x):x=e[38];let p;e[39]!==x?(p=s.jsx(K,{className:"sr-only",children:x}),e[39]=x,e[40]=p):p=e[40];let u;e[41]!==m||e[42]!==p?(u=s.jsxs(Q,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden h-[100dvh] sm:h-auto max-h-[100dvh] sm:max-h-[85vh] w-full max-w-full sm:max-w-fit rounded-none sm:rounded-xl border-0 sm:border",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[p,m]}),e[41]=m,e[42]=p,e[43]=u):u=e[43];let B;return e[44]!==a||e[45]!==h||e[46]!==u?(B=s.jsxs(U,{open:a,onOpenChange:S,children:[h,u]}),e[44]=a,e[45]=h,e[46]=u,e[47]=B):B=e[47],B}function oe(){}function ne(L){const e=$.c(4),{placeholder:o}=L,{selectedModel:t,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==t||e[2]!==o?(l=s.jsx(F,{model:t,placeholder:o,isLoading:n}),e[0]=n,e[1]=t,e[2]=o,e[3]=l):l=e[3],l}export{he as M};