decocms 4.388.4 → 4.389.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/dist/client/assets/{AlertCircle-Cat-Fy2i.js → AlertCircle-CVkVxygv.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CSNer7sZ.js → AreaChart-lVePxdbV.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DuxVUo5_.js → ArrowLeft-CN6aZBvX.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CsoDgnUj.js → ArrowRight-FqJnNh3f.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CbPBDOpZ.js → ArrowUp-bOLRJZuX.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-DgQehil3.js → CartesianChart-C3Zko_Et.js} +1 -1
  7. package/dist/client/assets/{Check-BZXRTDaX.js → Check-DL_AGZMy.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-Cj4PQGuv.js → CheckCircle-DtMp-qqq.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DGt31MPD.js → ChevronUp-B6mY-MC1.js} +1 -1
  10. package/dist/client/assets/{Copy01-B6hr4CBg.js → Copy01-6lOOhJcp.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CiYLi_pR.js → CreditCard01-DdYfDHIS.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BITRq5d-.js → DotsVertical-CAjUqtRp.js} +1 -1
  13. package/dist/client/assets/{Download01-CsYfHghd.js → Download01-Dq8Pn8XY.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-zVAOL4kJ.js → ErrorBarContext-B26KvZ3G.js} +1 -1
  15. package/dist/client/assets/{Eye-rQUtSbk6.js → Eye-B5e-ilzV.js} +1 -1
  16. package/dist/client/assets/{Globe04-C_9DD9oO.js → Globe04-_nV993le.js} +1 -1
  17. package/dist/client/assets/{Image01-BLIf6uY9.js → Image01-CkJtDP-I.js} +1 -1
  18. package/dist/client/assets/{Key01-SGIR_QrT.js → Key01-BCuGindq.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-GBQ0rQxQ.js → LayoutLeft-U0F-Da_p.js} +1 -1
  20. package/dist/client/assets/{Line-y7nkMb-C.js → Line-BA6i0Sln.js} +1 -1
  21. package/dist/client/assets/{Link01-BnVQGp2l.js → Link01-BjTxU_bP.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-Dh0AABP8.js → LinkExternal01-DSUCZUJp.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CxisI5ut.js → Monitor01-r707obGd.js} +1 -1
  24. package/dist/client/assets/{Package-DsU1cU6S.js → Package-D2jMN__x.js} +1 -1
  25. package/dist/client/assets/{Palette-CzoNEzRs.js → Palette-DebiHmrq.js} +1 -1
  26. package/dist/client/assets/{Plus-qASEo4cN.js → Plus-BbELO07z.js} +1 -1
  27. package/dist/client/assets/{SearchLg-qmi8uaeX.js → SearchLg-C9MObDBB.js} +1 -1
  28. package/dist/client/assets/{SearchMd-B6NDUgzQ.js → SearchMd-B1Foybfh.js} +1 -1
  29. package/dist/client/assets/{Sector-DK9KwpRN.js → Sector-OiAocllE.js} +1 -1
  30. package/dist/client/assets/{Share07-CMPYQYHk.js → Share07-B2WnpDWD.js} +1 -1
  31. package/dist/client/assets/{Stars01-cdnol_cb.js → Stars01-DUL2jKUJ.js} +1 -1
  32. package/dist/client/assets/{Sun-BSFyLDhg.js → Sun-BKxdX8hu.js} +1 -1
  33. package/dist/client/assets/{Tool01-H9OcfGdq.js → Tool01-BvNT4KDI.js} +1 -1
  34. package/dist/client/assets/{Trash01-mB4s-hrv.js → Trash01-BLoRPhD3.js} +1 -1
  35. package/dist/client/assets/{Upload01-Uv_jtHIk.js → Upload01-CNb1qfRO.js} +1 -1
  36. package/dist/client/assets/{User01-DHGCVvV3.js → User01-U5CIC-GP.js} +1 -1
  37. package/dist/client/assets/{UserSquare-BfT6tB5U.js → UserSquare-CZakdYWe.js} +1 -1
  38. package/dist/client/assets/{Users01-C_qUmfZB.js → Users01-C6BprSkC.js} +1 -1
  39. package/dist/client/assets/{X-vKTIsgL1.js → X-BNszojyh.js} +1 -1
  40. package/dist/client/assets/{XCircle-Cu2Sy8Aw.js → XCircle-BuDwhQqF.js} +1 -1
  41. package/dist/client/assets/{XClose-DFUqDOc8.js → XClose-D_JLFZFT.js} +1 -1
  42. package/dist/client/assets/{Zap-CSRFlEXK.js → Zap-BCwjglMw.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-Burao8Eg.js → ZoomOut-q6Y0RhlM.js} +1 -1
  44. package/dist/client/assets/{access-gate-Bbnx_Qh-.js → access-gate-Clo8Jex8.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-DzNaYAxM.js → add-connection-dialog-C5SXdxkT.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-C0sV-7Xb.js → agent-analytics-es8O9CL0.js} +2 -2
  47. package/dist/client/assets/agent-app-CGYFJjq5.js +1 -0
  48. package/dist/client/assets/{agent-assets-OnbttXnX.js → agent-assets-Dy169ySy.js} +1 -1
  49. package/dist/client/assets/{agent-automation-BSmqRx9Q.js → agent-automation-D1R1huVt.js} +6 -6
  50. package/dist/client/assets/{agent-automations-D7yiwZb3.js → agent-automations-BVBbNAeW.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-CTElBaoM.js → agent-connect-sources-BYoUrpVF.js} +1 -1
  52. package/dist/client/assets/agent-deck-sqReTFoM.js +1 -0
  53. package/dist/client/assets/{agent-e2e-36-yunOr.js → agent-e2e-DxRXY84q.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-B5DGYFrd.js → agent-experiments-_dQ2BC_Q.js} +1 -1
  55. package/dist/client/assets/agent-file-CGmxIBgM.js +1 -0
  56. package/dist/client/assets/{agent-git-BYVAaPsW.js → agent-git-B2s_zuHj.js} +2 -2
  57. package/dist/client/assets/{agent-hosting-BbmS530x.js → agent-hosting-BGGSrQLd.js} +1 -1
  58. package/dist/client/assets/{agent-icon-CzsnrYjD.js → agent-icon-CSebdE0g.js} +1 -1
  59. package/dist/client/assets/agent-library-file-CK_Y2Pye.js +1 -0
  60. package/dist/client/assets/{agent-monitor-C27DYrEB.js → agent-monitor-Dd5ty7vm.js} +1 -1
  61. package/dist/client/assets/{agent-overview-DsQze4i5.js → agent-overview-Cm3ny-qk.js} +1 -1
  62. package/dist/client/assets/agent-settings-B-c4VHd9.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-BNuBiz19.js → agent-site-editor-CDYe7KMp.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-C2ptd6Is.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-B7A6sQQt.js +2 -0
  66. package/dist/client/assets/agent-site-editor-preview-sULLmso9.js +518 -0
  67. package/dist/client/assets/agent-view-C2yjGU43.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-C4pdkmKc.js → agent-view-guard-a8AZfEO9.js} +1 -1
  69. package/dist/client/assets/{agents-list-B3F1REj8.js → agents-list-oZyF4Ii3.js} +1 -1
  70. package/dist/client/assets/{ai-providers-BYHAVCy5.js → ai-providers-BlScv4nl.js} +2 -2
  71. package/dist/client/assets/{alert-DsW1KUvt.js → alert-DsihHj7h.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-Dg6YJ6PP.js → alert-dialog-DeRt3vSN.js} +1 -1
  73. package/dist/client/assets/{api-keys-DDd9VBHu.js → api-keys-C9NfUH35.js} +1 -1
  74. package/dist/client/assets/api-keys-D3tjigFv.js +1 -0
  75. package/dist/client/assets/app-editor-D_REDtDg.js +1 -0
  76. package/dist/client/assets/{asset-utils-DOWh4JzZ.js → asset-utils-BS06OXCA.js} +1 -1
  77. package/dist/client/assets/{auth-D3Q2r2cz.js → auth-B-OXMWGw.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-M53zUwPP.js → auth-catchall-CLBv3q5z.js} +1 -1
  79. package/dist/client/assets/{auth-entry-CQhZUGUz.js → auth-entry-uRCGi0qy.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-Cp7zhn_p.js → auth-split-layout-C9jB6J1h.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-DG9xWGRs.js → authenticate-and-persist-oauth-B71_ZhsC.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DuetYP8A.js → automation-list-row-BX3OvbcZ.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DrVjV_Uv.js → automation-runs-CUFGFLxs.js} +1 -1
  84. package/dist/client/assets/automations-DGcV2mJq.js +1 -0
  85. package/dist/client/assets/{autosend-C5knIVwo.js → autosend-pQ9pD2-2.js} +1 -1
  86. package/dist/client/assets/{avatar-CLf3yQhN.js → avatar-GIuLZx2C.js} +1 -1
  87. package/dist/client/assets/{badge-DuB4cqrw.js → badge-DS3KIYvS.js} +1 -1
  88. package/dist/client/assets/{block-document-DZ3zGn-U.js → block-document-WF9-dn_8.js} +3 -3
  89. package/dist/client/assets/blocks-preview-workspace-context-BlZqg5yu.js +1 -0
  90. package/dist/client/assets/{breadcrumb-SXbKtw7u.js → breadcrumb-D6xZIsj2.js} +1 -1
  91. package/dist/client/assets/{buckets-D7jxbA8X.js → buckets-CNixgGHU.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-DKo7W0US.js → build-improve-prompt-doc-DeGFReow.js} +1 -1
  93. package/dist/client/assets/{bulk-category-panel-CS9EslBN.js → bulk-category-panel-BS5_T4uL.js} +1 -1
  94. package/dist/client/assets/{calendar-D41RMBsP.js → calendar-D4hMMrVq.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-CYpF4fm6.js → capability-load-error-BjI2iK0-.js} +1 -1
  96. package/dist/client/assets/category-editor-BFX9U9Yh.js +1 -0
  97. package/dist/client/assets/{chart-CdmZzz30.js → chart-CdPsiu6K.js} +1 -1
  98. package/dist/client/assets/{chat-context-D1GbDSrr.js → chat-context-HOmU0YHH.js} +6 -6
  99. package/dist/client/assets/{chat-draft-VYqGGS3B.js → chat-draft-BdxqYU8-.js} +1 -1
  100. package/dist/client/assets/{checkbox-BKGUJJNh.js → checkbox-DBYfq56y.js} +1 -1
  101. package/dist/client/assets/{choose-editor-Dkb9gjmg.js → choose-editor-DSxVv7hu.js} +1 -1
  102. package/dist/client/assets/{claim-phase-copy-0btUuJoC.js → claim-phase-copy-njXeDF0h.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-BFRzX7yY.js → cli-auth-success-uK8yk1Sb.js} +1 -1
  104. package/dist/client/assets/{client-icons-CIit2qYG.js → client-icons-CaoDPAaa.js} +1 -1
  105. package/dist/client/assets/{collapsible-eiDLfZY7.js → collapsible-BpIxv8-d.js} +1 -1
  106. package/dist/client/assets/{collection-detail-D6aw3A-V.js → collection-detail-vK2X038F.js} +1 -1
  107. package/dist/client/assets/{collection-display-button-D9O76Rnp.js → collection-display-button-ChjN1roR.js} +1 -1
  108. package/dist/client/assets/{collection-search-BQXOJg8a.js → collection-search-DyuqjLWs.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-zKpdBBAO.js → collection-table-wrapper-CNNpAz5Y.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-BWQrYrdS.js → collection-tabs-3_QvnkN-.js} +1 -1
  111. package/dist/client/assets/combobox-OP-CbRFf.js +1 -0
  112. package/dist/client/assets/command-ByUEKQB9.js +1 -0
  113. package/dist/client/assets/{companion-mcps-section-8c0rXQex.js → companion-mcps-section-6HKE7JJ2.js} +1 -1
  114. package/dist/client/assets/{connect-B9ZzFP7o.js → connect-CsNBKbv0.js} +2 -2
  115. package/dist/client/assets/{connect-layout-CSTvrhGM.js → connect-layout-DVtCwqcX.js} +1 -1
  116. package/dist/client/assets/{connection-DzM2SOZ6.js → connection-DR9gf0au.js} +1 -1
  117. package/dist/client/assets/{connection-card-DF11WhqU.js → connection-card-BOo8yulu.js} +1 -1
  118. package/dist/client/assets/{connection-detail-Dimacfl3.js → connection-detail-BqzECTqG.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-CyBATU5Y.js → connection-form-helpers-D5P5OxyV.js} +1 -1
  120. package/dist/client/assets/{connections-C_1m4t4b.js → connections-DH9JM6iR.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-Cy1fVEro.js → create-organization-dialog-S8LtKHhd.js} +1 -1
  122. package/dist/client/assets/{decofile-api-DkM3ZQFM.js → decofile-api-CWaaGMA2.js} +1 -1
  123. package/dist/client/assets/{decopilot-YckYKTsg.js → decopilot-B7-O9fZC.js} +2 -2
  124. package/dist/client/assets/{dialog-C36x61_J.js → dialog-BG6kEGFR.js} +1 -1
  125. package/dist/client/assets/{discover-CqgNMlsp.js → discover-OS0btTyd.js} +1 -1
  126. package/dist/client/assets/{domain-settings-D6TBWbch.js → domain-settings-BrbTzYfK.js} +1 -1
  127. package/dist/client/assets/{download-app-dialog-7J000m-o.js → download-app-dialog-NqW4PLAx.js} +1 -1
  128. package/dist/client/assets/{drawer-CsJzOKcM.js → drawer-Bl-PPIzX.js} +1 -1
  129. package/dist/client/assets/{editor-BQuCFEpz.js → editor-BiwQpn1s.js} +1 -1
  130. package/dist/client/assets/{empty-state-ClBiZqLf.js → empty-state-BpI78UAU.js} +1 -1
  131. package/dist/client/assets/{empty-state-gVTYQvW1.js → empty-state-DzReaOau.js} +1 -1
  132. package/dist/client/assets/{extract-connection-data-BIqslos8.js → extract-connection-data-BimwPioU.js} +1 -1
  133. package/dist/client/assets/{feature-gate-DLeaUXYN.js → feature-gate-B63BZEdG.js} +1 -1
  134. package/dist/client/assets/{feature-paywall-lhh7GOr7.js → feature-paywall-DwNmZ-M9.js} +1 -1
  135. package/dist/client/assets/{file-explorer-BRRFAgbe.js → file-explorer-DLzYcbz9.js} +1 -1
  136. package/dist/client/assets/{file-preview-DobzjEc2.js → file-preview-DCBxvWAy.js} +1 -1
  137. package/dist/client/assets/{file-share-button-6XYGV6w8.js → file-share-button-Cz0mgdAm.js} +1 -1
  138. package/dist/client/assets/{file-type-icon-CFRsMAQ4.js → file-type-icon-Cbv1Det1.js} +1 -1
  139. package/dist/client/assets/{folder-icon-CxyYiSJb.js → folder-icon-DltflRpD.js} +1 -1
  140. package/dist/client/assets/{form-CXSt7_li.js → form-Bx8qGby0.js} +1 -1
  141. package/dist/client/assets/{gateway-client-BF14HPqj.js → gateway-client-DiyAsoDf.js} +1 -1
  142. package/dist/client/assets/{general-0kms2_Mb.js → general-DTp5FT8F.js} +1 -1
  143. package/dist/client/assets/{github-icon-CIx0jkrL.js → github-icon-Bx6tzbBb.js} +1 -1
  144. package/dist/client/assets/{home-CyQJcQvg.js → home-tpS1TH6x.js} +1 -1
  145. package/dist/client/assets/{hooks-enzgIMXj.js → hooks-ZOtfl4oi.js} +2 -2
  146. package/dist/client/assets/{hooks-C8t7cMQJ.js → hooks-lZSCdRwc.js} +1 -1
  147. package/dist/client/assets/{icon-button-Df-IeDHT.js → icon-button-BudvJWM8.js} +1 -1
  148. package/dist/client/assets/{index-Ci3v6d1n.js → index-B7pMCohP.js} +1 -1
  149. package/dist/client/assets/index-B88q0man.css +1 -0
  150. package/dist/client/assets/{index-B7z_63F4.js → index-B8ZawsDP.js} +1 -1
  151. package/dist/client/assets/{index-DC9_5qIh.js → index-B9lZAmmH.js} +1 -1
  152. package/dist/client/assets/{index-DowxFM-Z.js → index-Bzch_Lwn.js} +1 -1
  153. package/dist/client/assets/{index-ClQyNrgO.js → index-C-u7JO1Y.js} +1 -1
  154. package/dist/client/assets/{index-Doi07Y6T.js → index-C0e8Nw2i.js} +1 -1
  155. package/dist/client/assets/{index-Byz-UaqT.js → index-CR8U3UFH.js} +1 -1
  156. package/dist/client/assets/{index-doEaURqC.js → index-CyBVTyGa.js} +7 -7
  157. package/dist/client/assets/{index-DV9UJZA2.js → index-CzuzrcF3.js} +1 -1
  158. package/dist/client/assets/{index-BoSUEB27.js → index-DeVdNW-7.js} +1 -1
  159. package/dist/client/assets/{index-CDAG9yf3.js → index-DmF8NlWI.js} +1 -1
  160. package/dist/client/assets/{index-BODjkOG4.js → index-DmsjOEhK.js} +1 -1
  161. package/dist/client/assets/{index-C4LzZ3-O.js → index-DtBnPwzh.js} +1 -1
  162. package/dist/client/assets/{index-D9padtMD.js → index-nJTy1ykh.js} +1 -1
  163. package/dist/client/assets/{index-redirect-XY4L95T5.js → index-redirect-lSGpveHC.js} +1 -1
  164. package/dist/client/assets/{infiniteQueryObserver-CxJm0T6_.js → infiniteQueryObserver-COZ-9XSO.js} +1 -1
  165. package/dist/client/assets/{infra-billing-zdKJ_MUK.js → infra-billing-ZSvY9y-Y.js} +1 -1
  166. package/dist/client/assets/input-D5Zi_pUc.js +1 -0
  167. package/dist/client/assets/{input-BT236l5B.js → input-DMG-B3VZ.js} +2 -2
  168. package/dist/client/assets/{input-CLIoB1hh.js → input-DOIUaBAK.js} +1 -1
  169. package/dist/client/assets/{integration-icon-Crk6WRxP.js → integration-icon-mTqkOE6y.js} +1 -1
  170. package/dist/client/assets/{label-tAsQMZ2G.js → label-DVhvlWqs.js} +1 -1
  171. package/dist/client/assets/{last-preview-page-002026Ee.js → last-preview-page-Cc9l6ICr.js} +1 -1
  172. package/dist/client/assets/{layout-CCpqo3zm.js → layout-0DaHUY7Z.js} +1 -1
  173. package/dist/client/assets/{legacy-agents-deep-Cj78AYzA.js → legacy-agents-deep-O9zXW4qh.js} +1 -1
  174. package/dist/client/assets/{legacy-main-redirect-Dn96iLn4.js → legacy-main-redirect-MeePJHje.js} +1 -1
  175. package/dist/client/assets/{library-BuoDGyY9.js → library-DHdWNZX-.js} +1 -1
  176. package/dist/client/assets/{login-DqL9YZRz.js → login-CXyISdG5.js} +1 -1
  177. package/dist/client/assets/{markdown-D0jNOMCX.js → markdown-DCPDulUN.js} +1 -1
  178. package/dist/client/assets/{mcp-app-renderer-BvLPqeD1.js → mcp-app-renderer-DBdofBbE.js} +2 -2
  179. package/dist/client/assets/{mcp-oauth-61IHYJoj.js → mcp-oauth-DdNMjTqu.js} +1 -1
  180. package/dist/client/assets/{members-BcXF5gIl.js → members-YBQ4CS4C.js} +1 -1
  181. package/dist/client/assets/{message-templates-CUQwBtaa.js → message-templates-B-vmK4Xp.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-DbALNxiX.js → mini-report-page-DekMuoTa.js} +1 -1
  183. package/dist/client/assets/{mock-board-D9-PmaL9.js → mock-board-D9NUZPwb.js} +9 -9
  184. package/dist/client/assets/{monaco-editor-xB6SdWXy.js → monaco-editor-tpWF7AL5.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CTbrFT2U.js → monitoring-stats-row-D_bvL4CA.js} +1 -1
  186. package/dist/client/assets/{multi-select-BPlBOZll.js → multi-select-C3lQgqH3.js} +1 -1
  187. package/dist/client/assets/{mustache-Btjjkmrx.js → mustache-BU3hKYND.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-D8-Vh_4C.js → oauth-callback-BiuyznT3.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-Dpai0ql-.js → oauth-callback-ai-provider-DqtXAIB8.js} +1 -1
  190. package/dist/client/assets/{onboarding-uOVvp-Mg.js → onboarding-BS368ORS.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-BQt56FI4.js → optimistic-project-sidebar-views-BfkTIuSj.js} +1 -1
  192. package/dist/client/assets/org-file-open-context-Bh_zBQ2O.js +1 -0
  193. package/dist/client/assets/{organization-choice-9DpczJ4c.js → organization-choice-GuO7qGDl.js} +1 -1
  194. package/dist/client/assets/{orgs-B6tWlX0C.js → orgs-DhHpNlvn.js} +1 -1
  195. package/dist/client/assets/page-seo-form-BML1eDhR.js +1 -0
  196. package/dist/client/assets/{pair-BIUMok9W.js → pair-CIltybgP.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-DjuDG4EH.js → plan-ladder-BEYdYGx8.js} +1 -1
  198. package/dist/client/assets/{popover-GUR8piky.js → popover-CUdTfYte.js} +1 -1
  199. package/dist/client/assets/post-calendar-BVrfveN8.js +1 -0
  200. package/dist/client/assets/post-editor-LBOMfHyI.js +1 -0
  201. package/dist/client/assets/{preview-content-CkHbAlf-.js → preview-content-D7H_AlKU.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-DUI33rZ8.js → preview-dialog-CUz95NoQ.js} +1 -1
  203. package/dist/client/assets/{primitives-CHkTFFF-.js → primitives-CyfO2GN8.js} +1 -1
  204. package/dist/client/assets/{profile-BIFbXoSW.js → profile-BNPVU14n.js} +1 -1
  205. package/dist/client/assets/{project-app-view-ZkgOByQo.js → project-app-view-Dm6c4g3t.js} +1 -1
  206. package/dist/client/assets/{project-feed-DGoAUO34.js → project-feed-orYCz9U3.js} +1 -1
  207. package/dist/client/assets/{project-icon-mjklzNJs.js → project-icon-DWnsLAeJ.js} +1 -1
  208. package/dist/client/assets/project-reports-DhaLYRaZ.js +1 -0
  209. package/dist/client/assets/project-tasks-Dzzzm0ET.js +1 -0
  210. package/dist/client/assets/{prompts-BwsVrHFI.js → prompts-Dpv9Ex1_.js} +1 -1
  211. package/dist/client/assets/record-editor-BQ-gbw4b.js +1 -0
  212. package/dist/client/assets/redirect-editor-eLzPdMVZ.js +1 -0
  213. package/dist/client/assets/reports-8U4sSr1z.js +1 -0
  214. package/dist/client/assets/{reports-ChF6GDQz.js → reports-CUfYm0DC.js} +1 -1
  215. package/dist/client/assets/{reports-onboarding-ukyewr1e.js → reports-onboarding-V3a9FHx8.js} +1 -1
  216. package/dist/client/assets/{reports-tab-Cxq1-mux.js → reports-tab-Bx7-g2HC.js} +2 -2
  217. package/dist/client/assets/{repositories-D7d8VzOE.js → repositories-Bbw6GL37.js} +1 -1
  218. package/dist/client/assets/{repository-import-picker-B6ijLkOL.js → repository-import-picker-74Y3ta69.js} +1 -1
  219. package/dist/client/assets/{repository-picker-Ca5oB9j5.js → repository-picker-dKTE5PS5.js} +1 -1
  220. package/dist/client/assets/{require-capability-vhXMBpff.js → require-capability-QoYjHav_.js} +1 -1
  221. package/dist/client/assets/{required-auth-layout-DbGCmQgx.js → required-auth-layout-BgLvQHTP.js} +1 -1
  222. package/dist/client/assets/{reset-password-DrRaSkr-.js → reset-password-ateNgI6E.js} +1 -1
  223. package/dist/client/assets/{resizable-WgWAPECX.js → resizable-D6HLmII4.js} +1 -1
  224. package/dist/client/assets/{review-settings-BzcjRJO0.js → review-settings-jZZT0JG1.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-i_tw_Jd2.js → rich-text-link-control-0ZhNexVb.js} +2 -2
  226. package/dist/client/assets/{roles-DTbcvvsD.js → roles-ERYsouVf.js} +1 -1
  227. package/dist/client/assets/{route-BRh6VH3Q.js → route-D5DT7lzH.js} +1 -1
  228. package/dist/client/assets/{route-B8hLxHmX.js → route-DW_oVxtq.js} +1 -1
  229. package/dist/client/assets/{route-DsWfLZyf.js → route-HgZwHfFA.js} +1 -1
  230. package/dist/client/assets/{route-page-header-tbVW9ntg.js → route-page-header-BHdnDvfR.js} +1 -1
  231. package/dist/client/assets/runnable-block-editor-DrtKYS1k.js +17 -0
  232. package/dist/client/assets/{sandbox-lifecycle-context-CvyFr09R.js → sandbox-lifecycle-context-LNZL2c0K.js} +2 -2
  233. package/dist/client/assets/{schema-BVqtjcyJ.js → schema-DSsDEA1v.js} +1 -1
  234. package/dist/client/assets/{scroll-area-Cve7MqyA.js → scroll-area-CmvmQLS1.js} +1 -1
  235. package/dist/client/assets/{search-input-CCUlZDzf.js → search-input-0hd-PWUF.js} +1 -1
  236. package/dist/client/assets/{search-toggle-BtmGTpxl.js → search-toggle-Bp6o4xvm.js} +1 -1
  237. package/dist/client/assets/{secret-picker-DVWtSCXk.js → secret-picker--QwK1qR-.js} +1 -1
  238. package/dist/client/assets/{secrets-dQAYGJYM.js → secrets-ODT01eOm.js} +1 -1
  239. package/dist/client/assets/sections-editor-DwSDIcRs.js +1 -0
  240. package/dist/client/assets/select-CDhEibGy.js +1 -0
  241. package/dist/client/assets/{select-model-Bnz73VTx.js → select-model-Dd7JcBMF.js} +1 -1
  242. package/dist/client/assets/seo-editor-BMnaZ5KR.js +1 -0
  243. package/dist/client/assets/{separator-JATiwE_2.js → separator-D-_LXjFg.js} +1 -1
  244. package/dist/client/assets/{settings-tab-CE0tP2vq.js → settings-tab-CKxa2O9d.js} +4 -4
  245. package/dist/client/assets/{sheet-ZoEgH6s-.js → sheet-DH_REC9j.js} +1 -1
  246. package/dist/client/assets/shell-layout-B3x_9fo1.js +1 -0
  247. package/dist/client/assets/{sidebar-Cz1S2PSM.js → sidebar-CxoDmdm4.js} +1 -1
  248. package/dist/client/assets/{skill-preview-BP5xxsO4.js → skill-preview-D4GrMJU0.js} +1 -1
  249. package/dist/client/assets/{skills-D52kTkau.js → skills-BYtnT-vq.js} +1 -1
  250. package/dist/client/assets/{sso-DAgB-pSG.js → sso-C8v2EdhJ.js} +1 -1
  251. package/dist/client/assets/{switch-BNLiV_oA.js → switch-C7dIR4UF.js} +1 -1
  252. package/dist/client/assets/{synced-repos-BzaJ7fNm.js → synced-repos-BNAaKJnR.js} +1 -1
  253. package/dist/client/assets/{table-D7l9brRh.js → table-B9OXzOjU.js} +1 -1
  254. package/dist/client/assets/{tabs-Gq0qvZI4.js → tabs-D6s_HA-y.js} +1 -1
  255. package/dist/client/assets/{task-board-BXLBBo-B.js → task-board-Qj-6Ctqf.js} +1 -1
  256. package/dist/client/assets/{task-route-BpYPpL3v.js → task-route-9wqWimw6.js} +1 -1
  257. package/dist/client/assets/{task-status-C7fhyr8_.js → task-status-D5cWLC8O.js} +1 -1
  258. package/dist/client/assets/{taskboard-analytics-Bhbjv4p8.js → taskboard-analytics-BtiQkIih.js} +1 -1
  259. package/dist/client/assets/{tasks-C2avg53f.js → tasks-BF0fu0p2.js} +2 -2
  260. package/dist/client/assets/tasks-D4PEOEIP.js +1 -0
  261. package/dist/client/assets/textarea-TE2JJa-B.js +1 -0
  262. package/dist/client/assets/{thread-button-CzoAkKWi.js → thread-button-DUOTtsFE.js} +1 -1
  263. package/dist/client/assets/{thread-intent-DuCE7MYG.js → thread-intent-jq9HKW3p.js} +1 -1
  264. package/dist/client/assets/{thread-route-C5QqTXOt.js → thread-route-C47YRRAe.js} +1 -1
  265. package/dist/client/assets/{thread-route-BBKn0p1b.js → thread-route-JcpQ-ikA.js} +1 -1
  266. package/dist/client/assets/{thread-sheet-body-C52UGBXx.js → thread-sheet-body-DvAYJwTc.js} +1 -1
  267. package/dist/client/assets/{toggle-group-DHrftnUg.js → toggle-group-Dv_lnjT7.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-iy_uLVVB.js → toolbar-icon-button-Cq75cloK.js} +1 -1
  269. package/dist/client/assets/{tooltip-C91IS2ON.js → tooltip-BjUMPvkB.js} +1 -1
  270. package/dist/client/assets/{track-CpCOxAsM.js → track-CNE2_M0H.js} +1 -1
  271. package/dist/client/assets/{types-BCbJ4Eml.js → types-Bxr6Ak0g.js} +3 -3
  272. package/dist/client/assets/{usage-stats-P7Ebxq4V.js → usage-stats-Bug-9_EL.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-CJ2ga4nx.js → use-ai-providers-ShRDl02e.js} +1 -1
  274. package/dist/client/assets/{use-automations-V0dkF89H.js → use-automations-qnBbEhgN.js} +1 -1
  275. package/dist/client/assets/{use-autosave-ClFMVO3A.js → use-autosave-exq2JPmQ.js} +1 -1
  276. package/dist/client/assets/{use-connect-companion-CXK99yF4.js → use-connect-companion-DQoSkSuB.js} +1 -1
  277. package/dist/client/assets/{use-connection-PgTQPnAp.js → use-connection-WQuJ5yl_.js} +1 -1
  278. package/dist/client/assets/{use-copy-CGJ-16i-.js → use-copy-CPOYPvBF.js} +1 -1
  279. package/dist/client/assets/{use-create-virtual-mcp-D4lB4pbk.js → use-create-virtual-mcp-Da7cL0aL.js} +1 -1
  280. package/dist/client/assets/{use-date-fns-locale-VjB0j61V.js → use-date-fns-locale-BcOQz_O6.js} +1 -1
  281. package/dist/client/assets/{use-debounced-autosave-Du2G3qf3.js → use-debounced-autosave-BnbZSVdn.js} +1 -1
  282. package/dist/client/assets/{use-debounced-value-CG2jgHBI.js → use-debounced-value-DHN-wkc6.js} +1 -1
  283. package/dist/client/assets/{use-deco-credits-DU8sJrax.js → use-deco-credits-Fltfd2iB.js} +1 -1
  284. package/dist/client/assets/{use-decopilot-events-x0K7Zb7m.js → use-decopilot-events-DF_mJ7FX.js} +1 -1
  285. package/dist/client/assets/{use-delete-connection-Pe3fW9Dc.js → use-delete-connection-Di7K1zHS.js} +1 -1
  286. package/dist/client/assets/{use-deployment-admin-CWwZo7oV.js → use-deployment-admin-Ney-Hrk_.js} +1 -1
  287. package/dist/client/assets/{use-entitlements-pN-YIa6T.js → use-entitlements-D6f3xZaU.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-CCQm80wV.js → use-fast-preview-draft-url-B6rIt3gA.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-CzJCjBKX.js → use-file-configs-Cd7oj9Fw.js} +1 -1
  290. package/dist/client/assets/{use-in-settings-DplznXN9.js → use-in-settings-8fsBM1xN.js} +1 -1
  291. package/dist/client/assets/{use-infinite-scroll-Bm905rys.js → use-infinite-scroll-BCiTqxTQ.js} +1 -1
  292. package/dist/client/assets/{use-join-requests-D4wrlTl5.js → use-join-requests-BFN9i-Es.js} +1 -1
  293. package/dist/client/assets/use-main-panel-tabs-Wh3mzXf2.js +1 -0
  294. package/dist/client/assets/{use-mcp-auth-status-BnAPI8Zf.js → use-mcp-auth-status-B1aTfNe_.js} +1 -1
  295. package/dist/client/assets/{use-mcp-client-D2DgMGL-.js → use-mcp-client-CqKNXJW7.js} +1 -1
  296. package/dist/client/assets/{use-mcp-prompts-UNzUvECH.js → use-mcp-prompts-DpED8Vrg.js} +1 -1
  297. package/dist/client/assets/{use-mcp-tools-CtMvHJK9.js → use-mcp-tools-BgkfMsvS.js} +1 -1
  298. package/dist/client/assets/{use-members-C_tB-qI-.js → use-members-CeW4sAKm.js} +1 -1
  299. package/dist/client/assets/{use-mobile-DYpKQ1eP.js → use-mobile-CUQu4L8c.js} +1 -1
  300. package/dist/client/assets/{use-navigate-to-agent-TwlhlbmB.js → use-navigate-to-agent-W6hb3mqs.js} +1 -1
  301. package/dist/client/assets/{use-open-billing-url-BrlDdS6U.js → use-open-billing-url-KLMgEPxW.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-BkVvw_9f.js → use-org-auth-client-zTkj17z7.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-Bbl2QQqg.js → use-org-fs-B1IHOZ9S.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-Ds4sFbSY.js → use-org-repo-syncs-CksqUgv6.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-BnqcEd47.js → use-org-sso-CI1_4UQM.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-3K_wbMHo.js → use-organization-roles-DeV7SnLa.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-Wh36EN0I.js → use-organization-settings-4gJ9Tp49.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-xYH0iX8e.js → use-panel-navigate-Bg-MVKv6.js} +1 -1
  309. package/dist/client/assets/{use-project-native-view-presence-U59DT0hQ.js → use-project-native-view-presence-C3jxCCXQ.js} +1 -1
  310. package/dist/client/assets/{use-project-scope-CENQvfVc.js → use-project-scope-CRdwBUT7.js} +1 -1
  311. package/dist/client/assets/{use-releases-_xbQ8yPk.js → use-releases-nsAtxjuW.js} +1 -1
  312. package/dist/client/assets/{use-reports-diagnostic-Cz_g9Pum.js → use-reports-diagnostic-CtuJZ5jH.js} +1 -1
  313. package/dist/client/assets/{use-route-default-main-evb2BAGs.js → use-route-default-main-DA5X9xDG.js} +1 -1
  314. package/dist/client/assets/{use-secrets-44zj-3N9.js → use-secrets-BfDHS5Uq.js} +1 -1
  315. package/dist/client/assets/use-section-preview-base-DW4RpMx9.js +1 -0
  316. package/dist/client/assets/{use-session-runtime-COugfsOm.js → use-session-runtime-DiG_Qt8i.js} +1 -1
  317. package/dist/client/assets/{use-tags-BqebMAjW.js → use-tags-BloUFB1L.js} +1 -1
  318. package/dist/client/assets/{use-task-board-analytics-CElip-Jh.js → use-task-board-analytics-C7hgblhm.js} +1 -1
  319. package/dist/client/assets/{use-task-metadata-Dhub_XGT.js → use-task-metadata-ehugU85S.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-DldRsY9l.js → use-thread-outputs-C9_GjCjS.js} +1 -1
  321. package/dist/client/assets/{use-virtual-mcp-B-mdsJbn.js → use-virtual-mcp-Vg_Ogz61.js} +1 -1
  322. package/dist/client/assets/useInfiniteQuery-DebjMHv1.js +1 -0
  323. package/dist/client/assets/{useQueries-CrUxqve0.js → useQueries-CDvJYO-m.js} +1 -1
  324. package/dist/client/assets/useSuspenseInfiniteQuery-CqRV1dKR.js +1 -0
  325. package/dist/client/assets/{users-XpLTDG6s.js → users-BC2i5HSG.js} +1 -1
  326. package/dist/client/assets/{utils-BcFrUaDf.js → utils-Bf0RpmgB.js} +1 -1
  327. package/dist/client/assets/variant-calendar-BWeWEpfR.js +1 -0
  328. package/dist/client/assets/{variant-matcher-override-DWffsqol.js → variant-matcher-override-fLxntWss.js} +1 -1
  329. package/dist/client/assets/{view-mode-toggle-Bsk0Q0dk.js → view-mode-toggle-DQkw8yuh.js} +1 -1
  330. package/dist/client/assets/{virtual-mcp-Bj7Y16hO.js → virtual-mcp-S8IoUqby.js} +1 -1
  331. package/dist/client/index.html +2 -2
  332. package/dist/server/cli.js +1 -1
  333. package/dist/server/server.js +1 -1
  334. package/package.json +1 -1
  335. package/dist/client/assets/agent-app-D8aCkILQ.js +0 -1
  336. package/dist/client/assets/agent-deck-JfSkYOo0.js +0 -1
  337. package/dist/client/assets/agent-file-BQkNRXR6.js +0 -1
  338. package/dist/client/assets/agent-library-file-B_9ZfsqS.js +0 -1
  339. package/dist/client/assets/agent-settings-Dlb-w-aW.js +0 -1
  340. package/dist/client/assets/agent-site-editor-code-Cg74frt9.js +0 -2
  341. package/dist/client/assets/agent-site-editor-content-BMF_TO-O.js +0 -2
  342. package/dist/client/assets/agent-site-editor-preview-DfUEy_mW.js +0 -518
  343. package/dist/client/assets/agent-view-9ku1NYkG.js +0 -1
  344. package/dist/client/assets/api-keys-CB0BbOJK.js +0 -1
  345. package/dist/client/assets/app-editor-6ntO4YLY.js +0 -1
  346. package/dist/client/assets/automations-CflFKE1S.js +0 -1
  347. package/dist/client/assets/blocks-preview-workspace-context-CGrONP0s.js +0 -1
  348. package/dist/client/assets/category-editor-CMewSARd.js +0 -1
  349. package/dist/client/assets/combobox-B1IXE26_.js +0 -1
  350. package/dist/client/assets/command-CDaLB2Ox.js +0 -1
  351. package/dist/client/assets/index-xA_kfo6T.css +0 -1
  352. package/dist/client/assets/input-BK5Sp8hZ.js +0 -1
  353. package/dist/client/assets/org-file-open-context-DodrnIMR.js +0 -1
  354. package/dist/client/assets/page-seo-form-Dbz3eu1p.js +0 -1
  355. package/dist/client/assets/post-calendar-FfQIYQQi.js +0 -1
  356. package/dist/client/assets/post-editor-YU4-WfQ7.js +0 -1
  357. package/dist/client/assets/project-reports-DVMPWWFi.js +0 -1
  358. package/dist/client/assets/project-tasks-Jy5UvQy6.js +0 -1
  359. package/dist/client/assets/record-editor-CXOCBCZ1.js +0 -1
  360. package/dist/client/assets/redirect-editor-MDe3fibH.js +0 -1
  361. package/dist/client/assets/reports-DwYY1RWm.js +0 -1
  362. package/dist/client/assets/runnable-block-editor-CdEmnBad.js +0 -16
  363. package/dist/client/assets/sections-editor-C6cdGUNk.js +0 -2
  364. package/dist/client/assets/select-oEHCSTZi.js +0 -1
  365. package/dist/client/assets/seo-editor-BD39YQzP.js +0 -1
  366. package/dist/client/assets/shell-layout-BNVBlKMe.js +0 -1
  367. package/dist/client/assets/tasks-aGbeVyrS.js +0 -1
  368. package/dist/client/assets/textarea-B9cyNs7j.js +0 -1
  369. package/dist/client/assets/use-main-panel-tabs-BcprnHpG.js +0 -1
  370. package/dist/client/assets/use-section-preview-base-BbxztEDH.js +0 -1
  371. package/dist/client/assets/useInfiniteQuery-DCZL7BN4.js +0 -1
  372. package/dist/client/assets/useSuspenseInfiniteQuery-C0KSbZH8.js +0 -1
  373. package/dist/client/assets/variant-calendar-BPWkuyHy.js +0 -1
@@ -1,2 +1,2 @@
1
- import{o as j,r as o,dp as Ce,dm as De,c as Pe,e as Ae,dj as ee,a0 as Ee,j as ye,K as M,z as _e}from"./index-doEaURqC.js";import{u as Le}from"./use-mcp-client-D2DgMGL-.js";import{u as Ue}from"./use-session-runtime-COugfsOm.js";import{u as Re,b as Oe}from"./chat-context-D1GbDSrr.js";import{u as Be}from"./hooks-C8t7cMQJ.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./use-virtual-mcp-B-mdsJbn.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=j(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=j(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Qe=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Ye(e,t){const n=j();return Ae({mutationKey:be,retry:(s,u)=>Qe(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Me={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Me),me=16384;class je{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const Ge=1e3,Xe=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=Ee(),a=j(),V=Re()?.taskId??null,[G,E]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,y]=o.useState({kind:"unknown"}),[X,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),Q=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new je,v.current.set(d,S)),S};o.useEffect(()=>{if(E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);E(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),q([]),R([]),v.current.clear()},Y=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
2
- `);_(i.source).append(f);for(const l of O.current)try{l(i.source,f)}catch{}H(l=>l+1)}catch{}},J=r=>{const i=r.type;try{const f=JSON.parse(r.data);switch(D=0,i){case"lifecycle":{const l=f;b(l.state);const F=`${c.slug}/${e}/${t}`;if(Se(l.state.phase)&&!(A&&Se(A))){ee(a,c.id);const K=M.decofile(F);a.getQueryData(K)===void 0&&a.invalidateQueries({queryKey:K})}l.state.phase==="running"&&A!=="running"&&(ee(a,c.id),a.invalidateQueries({queryKey:M.decofile(F)}),a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})),A=l.state.phase;const $=l.state.phase==="running"?l.state.port:null,ce=C.current;if(C.current=$,ce!==null&&$!==null&&ce!==$)for(const K of w.current)try{K()}catch{}return}case"status":U(f);return;case"tasks":{const F=f.active.map($=>$.logName??"").filter(Boolean);R(F);return}case"scripts":q(f.scripts);return;case"branch":{const l=f.meta;y(l);return}case"reload":for(const l of w.current)try{l()}catch{}return;case"file-changed":{const{path:l}=f,F=`${c.slug}/${e}/${t}`;if(l.startsWith(".deco/")||l.includes("/.deco/")){if(!(A==="running"))return;P&&clearTimeout(P),P=setTimeout(()=>{if(P=null,a.invalidateQueries({queryKey:M.decofile(F)}),Q)for(const K of w.current)try{K()}catch{}},500)}else T&&clearTimeout(T),T=setTimeout(()=>{T=null,a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})},1e3);return}}}catch{}};function N(){if(S)return;const r=new EventSource(d);g=r,r.onopen=()=>{},r.onerror=()=>{g===r&&r.readyState===EventSource.CLOSED&&x("studio")},r.addEventListener("phase",I),r.addEventListener("gone",B),r.addEventListener(pe,Y);for(const i of he)r.addEventListener(i,J)}function ae(){if(S||!p||m)return;const r=new EventSource(p);m=r;let i=!1;r.onopen=()=>{if(S||m!==r)return;i=!0,D=0;const f=g;g=null,f?.close()},r.onerror=()=>{m===r&&r.readyState===EventSource.CLOSED&&ue(r,i)},r.addEventListener(pe,Y);for(const f of he)r.addEventListener(f,J)}async function ue(r,i){const f=p?await ze(p):!1;if(!(S||m!==r)){if(r.close(),m=null,f){B(),g||N();return}i&&x("direct")}}function x(r){if(S||L)return;const i=ge(Xe,Ge,D,2,0);D++,L=setTimeout(()=>{if(L=null,!S){if(r==="direct"){m?.close(),m=null,ae();return}g?.close(),g=null,N()}},i)}return N(),()=>{S=!0,g?.close(),m?.close(),L&&clearTimeout(L),T&&clearTimeout(T),P&&clearTimeout(P)}},[e,t,c.slug,c.id,s,V,p,a,Q]);const oe={phase:G,lifecycle:te,status:ne,branch:re,notFound:X,scripts:k,activeProcesses:se,getBuffer:d=>v.current.get(d)?.get()??"",hasData:d=>(v.current.get(d)?.get().length??0)>0,subscribeChunks:d=>(O.current.add(d),()=>{O.current.delete(d)}),subscribeReload:d=>(w.current.add(d),()=>{w.current.delete(d)})};return ye.jsx(ve,{value:oe,children:u})}function de(){return o.use(ve)}function bt(e){const{subscribeChunks:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t((c,a)=>{n.current?.(c,a)}),[t])}function vt(e){const{subscribeReload:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t(()=>{n.current?.()}),[t])}function Ze(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function et(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveGithubRepo&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function wt(e){return e.threadLoaded&&e.isOwner&&e.hasActiveGithubRepo&&!e.branch&&!e.attempted}function tt(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Tt(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:s,branch:u}=e,c=e.ownerId??s;if(!s||!c||!u)return t;const a=n?.[c]?.[u];return a?{...t??{},[s]:{...t?.[s]??{},[u]:a}}:t}function z(e,t,n){const s={virtualMcpId:e};return t&&(s.branch=t),n&&(s.threadId=n),s}const we=2,nt=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function Te(e){return nt.has(e)}function rt(e){return e.executionEnabled&&e.failedReason!==null&&Te(e.failedReason)&&e.attempts<we&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const st={branch:null,count:0,handled:!1};function ot(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function at(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function ut(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function xe(e,t){return`${e??""}::${t??""}`}function ct(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function Z(e){const{data:t,virtualMcpId:n,branch:s}=e;t?.branch&&!s&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:xe(n,t.branch??s),url:t.previewUrl})}const it={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},ke=o.createContext(it);function xt(){return o.use(ke)}function kt({executionEnabled:e,virtualMcpId:t,branch:n,userId:s,hasActiveGithubRepo:u,vmEntry:c,threadId:a,children:V}){const{org:G}=Ee(),{setCurrentTaskBranch:E}=Oe(),te=Be(),b=de(),ne=j(),U=Ue(t),re=U.resolved?U.runtime:null,y=Re()?.taskId??null,X=Le({connectionId:_e,orgId:G.id,orgSlug:G.slug}),h=Ye(X,{onStarted:()=>{a&&te?.refreshThreadMetadata(a)}}),{mutate:k,reset:q}=h,[se,R]=o.useState(null),H=o.useRef(new Set),v=o.useRef(null),[O,w]=o.useState(st),C=ot(O,n);C!==O&&w(C);const p=b.phase?.kind==="failed"?b.phase:null,Q=ct({vmEntry:c,seeded:p?null:se,key:xe(t,n)}),_=!!t&&!!n&&le.isStopped(t,n),oe=b.status.state==="paused",d=!p||!Te(p.reason)||C.count>=we,S=at({mutationError:h.isError&&h.error?$e(h.error.message):null,phase:b.phase,startPending:h.isPending,claimRetryExhausted:d}),D=Ze({previewUrl:Q,appPaused:oe,userStopped:_,startError:S}),L=ut(D),T=n??"",P=H.current.has(T),g=et({executionEnabled:e,hasActiveGithubRepo:u,userId:s,branch:n,vmEntry:c,userStopped:_,isPending:h.isPending,attempted:P,sessionRuntime:re});o.useEffect(()=>{if(!g||!t)return;H.current.add(T);const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] auto-start failed:",r)}})},[g,T,n,t,y,k,E,R]);const m=b.notFound?c?.sandboxHandle??null:null,A=tt({executionEnabled:e,notFound:b.notFound,deadVmId:m,lastDeadVmId:v.current,isPending:h.isPending,userStopped:_});o.useEffect(()=>{if(!A||!m||!t)return;v.current=m;const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] self-heal failed:",r)}})},[A,m,t,n,y,k,E,R]);const I=rt({executionEnabled:e,failedReason:p?.reason??null,attempts:C.count,isPending:h.isPending,userStopped:_,alreadyHandled:C.handled});o.useEffect(()=>{if(!p){w(r=>r.handled?{...r,handled:!1}:r);return}if(!I||!t)return;w(r=>({...r,handled:!0,count:r.count+1}));const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",r)}})},[p,I,t,n,y,k,E,R]);const B=()=>{if(!e||!t)return;const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] user start failed:",r)}})},Y=async()=>{if(!(!e||!t||!n)&&c){le.mark(t,n);try{await X.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}ee(ne)}},J=async()=>{await Y(),B()},N=()=>{H.current=new Set,v.current=null,w({branch:n,count:0,handled:!1}),q(),B()},ue={branch:n,previewState:D,status:L,vmEntry:c,previewUrl:Q,userStopped:_,start:B,stop:Y,restart:J,retry:N,resume:N};return ye.jsx(ke,{value:ue,children:V})}export{gt as S,kt as a,Ye as b,de as c,xt as d,bt as e,vt as f,Ke as g,Tt as o,wt as s,Rt as u};
1
+ import{o as G,r as o,dr as Ce,dp as De,c as Pe,e as Ae,dl as ee,a0 as Ee,j as ye,K as M,z as _e}from"./index-CyBVTyGa.js";import{u as Le}from"./use-mcp-client-CqKNXJW7.js";import{u as Ue}from"./use-session-runtime-DiG_Qt8i.js";import{u as Re,b as Oe}from"./chat-context-HOmU0YHH.js";import{u as Be}from"./hooks-lZSCdRwc.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./use-virtual-mcp-Vg_Ogz61.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=G(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=G(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Qe=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Ye(e,t){const n=G();return Ae({mutationKey:be,retry:(s,u)=>Qe(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Me={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Me),me=16384;class Ge{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const Xe=1e3,je=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=Ee(),a=G(),V=Re()?.taskId??null,[X,E]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,y]=o.useState({kind:"unknown"}),[j,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),Q=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new Ge,v.current.set(d,S)),S};o.useEffect(()=>{if(E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);E(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),E(null),b({phase:"idle"}),U({state:"running"}),y({kind:"unknown"}),q([]),R([]),v.current.clear()},Y=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
2
+ `);_(i.source).append(f);for(const l of O.current)try{l(i.source,f)}catch{}H(l=>l+1)}catch{}},J=r=>{const i=r.type;try{const f=JSON.parse(r.data);switch(D=0,i){case"lifecycle":{const l=f;b(l.state);const F=`${c.slug}/${e}/${t}`;if(Se(l.state.phase)&&!(A&&Se(A))){ee(a,c.id);const K=M.decofile(F);a.getQueryData(K)===void 0&&a.invalidateQueries({queryKey:K})}l.state.phase==="running"&&A!=="running"&&(ee(a,c.id),a.invalidateQueries({queryKey:M.decofile(F)}),a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})),A=l.state.phase;const $=l.state.phase==="running"?l.state.port:null,ce=C.current;if(C.current=$,ce!==null&&$!==null&&ce!==$)for(const K of w.current)try{K()}catch{}return}case"status":U(f);return;case"tasks":{const F=f.active.map($=>$.logName??"").filter(Boolean);R(F);return}case"scripts":q(f.scripts);return;case"branch":{const l=f.meta;y(l);return}case"reload":for(const l of w.current)try{l()}catch{}return;case"file-changed":{const{path:l}=f,F=`${c.slug}/${e}/${t}`;if(l.startsWith(".deco/")||l.includes("/.deco/")){if(!(A==="running"))return;P&&clearTimeout(P),P=setTimeout(()=>{if(P=null,a.invalidateQueries({queryKey:M.decofile(F)}),Q)for(const K of w.current)try{K()}catch{}},500)}else T&&clearTimeout(T),T=setTimeout(()=>{T=null,a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})},1e3);return}}}catch{}};function N(){if(S)return;const r=new EventSource(d);g=r,r.onopen=()=>{},r.onerror=()=>{g===r&&r.readyState===EventSource.CLOSED&&x("studio")},r.addEventListener("phase",I),r.addEventListener("gone",B),r.addEventListener(pe,Y);for(const i of he)r.addEventListener(i,J)}function ae(){if(S||!p||m)return;const r=new EventSource(p);m=r;let i=!1;r.onopen=()=>{if(S||m!==r)return;i=!0,D=0;const f=g;g=null,f?.close()},r.onerror=()=>{m===r&&r.readyState===EventSource.CLOSED&&ue(r,i)},r.addEventListener(pe,Y);for(const f of he)r.addEventListener(f,J)}async function ue(r,i){const f=p?await ze(p):!1;if(!(S||m!==r)){if(r.close(),m=null,f){B(),g||N();return}i&&x("direct")}}function x(r){if(S||L)return;const i=ge(je,Xe,D,2,0);D++,L=setTimeout(()=>{if(L=null,!S){if(r==="direct"){m?.close(),m=null,ae();return}g?.close(),g=null,N()}},i)}return N(),()=>{S=!0,g?.close(),m?.close(),L&&clearTimeout(L),T&&clearTimeout(T),P&&clearTimeout(P)}},[e,t,c.slug,c.id,s,V,p,a,Q]);const oe={phase:X,lifecycle:te,status:ne,branch:re,notFound:j,scripts:k,activeProcesses:se,getBuffer:d=>v.current.get(d)?.get()??"",hasData:d=>(v.current.get(d)?.get().length??0)>0,subscribeChunks:d=>(O.current.add(d),()=>{O.current.delete(d)}),subscribeReload:d=>(w.current.add(d),()=>{w.current.delete(d)})};return ye.jsx(ve,{value:oe,children:u})}function de(){return o.use(ve)}function bt(e){const{subscribeChunks:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t((c,a)=>{n.current?.(c,a)}),[t])}function vt(e){const{subscribeReload:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t(()=>{n.current?.()}),[t])}function Ze(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function et(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveGithubRepo&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function wt(e){return e.threadLoaded&&e.isOwner&&e.hasActiveGithubRepo&&!e.branch&&!e.attempted}function tt(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Tt(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:s,branch:u}=e,c=e.ownerId??s;if(!s||!c||!u)return t;const a=n?.[c]?.[u];return a?{...t??{},[s]:{...t?.[s]??{},[u]:a}}:t}function z(e,t,n){const s={virtualMcpId:e};return t&&(s.branch=t),n&&(s.threadId=n),s}const we=2,nt=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function Te(e){return nt.has(e)}function rt(e){return e.executionEnabled&&e.failedReason!==null&&Te(e.failedReason)&&e.attempts<we&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const st={branch:null,count:0,handled:!1};function ot(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function at(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function ut(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function xe(e,t){return`${e??""}::${t??""}`}function ct(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function Z(e){const{data:t,virtualMcpId:n,branch:s}=e;t?.branch&&!s&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:xe(n,t.branch??s),url:t.previewUrl})}const it={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},ke=o.createContext(it);function xt(){return o.use(ke)}function kt({executionEnabled:e,virtualMcpId:t,branch:n,userId:s,hasActiveGithubRepo:u,vmEntry:c,threadId:a,children:V}){const{org:X}=Ee(),{setCurrentTaskBranch:E}=Oe(),te=Be(),b=de(),ne=G(),U=Ue(t),re=U.resolved?U.runtime:null,y=Re()?.taskId??null,j=Le({connectionId:_e,orgId:X.id,orgSlug:X.slug}),h=Ye(j,{onStarted:()=>{a&&te?.refreshThreadMetadata(a)}}),{mutate:k,reset:q}=h,[se,R]=o.useState(null),H=o.useRef(new Set),v=o.useRef(null),[O,w]=o.useState(st),C=ot(O,n);C!==O&&w(C);const p=b.phase?.kind==="failed"?b.phase:null,Q=ct({vmEntry:c,seeded:p?null:se,key:xe(t,n)}),_=!!t&&!!n&&le.isStopped(t,n),oe=b.status.state==="paused",d=!p||!Te(p.reason)||C.count>=we,S=at({mutationError:h.isError&&h.error?$e(h.error.message):null,phase:b.phase,startPending:h.isPending,claimRetryExhausted:d}),D=Ze({previewUrl:Q,appPaused:oe,userStopped:_,startError:S}),L=ut(D),T=n??"",P=H.current.has(T),g=et({executionEnabled:e,hasActiveGithubRepo:u,userId:s,branch:n,vmEntry:c,userStopped:_,isPending:h.isPending,attempted:P,sessionRuntime:re});o.useEffect(()=>{if(!g||!t)return;H.current.add(T);const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] auto-start failed:",r)}})},[g,T,n,t,y,k,E,R]);const m=b.notFound?c?.sandboxHandle??null:null,A=tt({executionEnabled:e,notFound:b.notFound,deadVmId:m,lastDeadVmId:v.current,isPending:h.isPending,userStopped:_});o.useEffect(()=>{if(!A||!m||!t)return;v.current=m;const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] self-heal failed:",r)}})},[A,m,t,n,y,k,E,R]);const I=rt({executionEnabled:e,failedReason:p?.reason??null,attempts:C.count,isPending:h.isPending,userStopped:_,alreadyHandled:C.handled});o.useEffect(()=>{if(!p){w(r=>r.handled?{...r,handled:!1}:r);return}if(!I||!t)return;w(r=>({...r,handled:!0,count:r.count+1}));const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",r)}})},[p,I,t,n,y,k,E,R]);const B=()=>{if(!e||!t)return;const x=z(t,n,y);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:E,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] user start failed:",r)}})},Y=async()=>{if(!(!e||!t||!n)&&c){le.mark(t,n);try{await j.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}ee(ne)}},J=async()=>{await Y(),B()},N=()=>{H.current=new Set,v.current=null,w({branch:n,count:0,handled:!1}),q(),B()},ue={branch:n,previewState:D,status:L,vmEntry:c,previewUrl:Q,userStopped:_,start:B,stop:Y,restart:J,retry:N,resume:N};return ye.jsx(ke,{value:ue,children:V})}export{gt as S,kt as a,Ye as b,de as c,xt as d,bt as e,vt as f,Ke as g,Tt as o,wt as s,Rt as u};
@@ -1 +1 @@
1
- import{an as n,bL as t,ao as e,bM as m,bN as p,bO as d,bP as h}from"./index-doEaURqC.js";const i=500;n({title:e().max(i),url:e().max(i),icon:e().max(i)});const s=n({keyId:e().max(i),modelId:e().max(i),title:e().max(i).optional()}).nullable();m(["fast","smart","thinking","image","web_search","deep_research"]);m(["fast","smart","thinking"]);const y=n({tiers:n({fast:s,smart:s,thinking:s,image:s,web_search:s,deep_research:s})});n({tiers:n({fast:s.optional(),smart:s.optional(),thinking:s.optional()})});const b=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).regex(b).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:p(e().max(i)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const v=n({home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),cms_auto_fresh_branch:t().optional().describe("When a user opens the CMS on a branch whose last commit is older than the staleness window (2 days), move the session to a freshly minted branch cut from the default branch. The stale branch is left intact on GitHub. Off by default.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model"]);function w(a,r){const c=a?.[r];return u.has(r)?c!==!1:c===!0}function x(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:p(d(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as O,y as S,x as a,b,w as o};
1
+ import{an as n,bN as t,ao as e,bO as m,bP as p,bQ as d,bR as h}from"./index-CyBVTyGa.js";const i=500;n({title:e().max(i),url:e().max(i),icon:e().max(i)});const s=n({keyId:e().max(i),modelId:e().max(i),title:e().max(i).optional()}).nullable();m(["fast","smart","thinking","image","web_search","deep_research"]);m(["fast","smart","thinking"]);const y=n({tiers:n({fast:s,smart:s,thinking:s,image:s,web_search:s,deep_research:s})});n({tiers:n({fast:s.optional(),smart:s.optional(),thinking:s.optional()})});const b=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).regex(b).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:p(e().max(i)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const v=n({home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),cms_auto_fresh_branch:t().optional().describe("When a user opens the CMS on a branch whose last commit is older than the staleness window (2 days), move the session to a freshly minted branch cut from the default branch. The stale branch is left intact on GitHub. Off by default.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model"]);function w(a,r){const c=a?.[r];return u.has(r)?c!==!1:c===!0}function x(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:p(d(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as O,y as S,x as a,b,w as o};
@@ -1 +1 @@
1
- import{r as d,bn as T,bu as ce,j as b,bp as _,bG as ae,dk as O,bq as C,bz as P,bs as ie,c as F,l as $}from"./index-doEaURqC.js";import{e as de}from"./select-oEHCSTZi.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=B(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=B(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var k="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(k,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=k;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(k,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function B(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
1
+ import{r as d,bp as T,bw as ce,j as b,br as _,bI as ae,dm as O,bs as C,bB as P,bu as ie,c as F,l as $}from"./index-CyBVTyGa.js";import{e as de}from"./select-CDhEibGy.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(B,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(B,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(B,{"data-state":n?"visible":"hidden",...t,ref:e})})}),B=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var V="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(V,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=V;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(V,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
@@ -1 +1 @@
1
- import{c as b,l as w,j as a,h as j}from"./index-doEaURqC.js";import{i as v}from"./SearchMd-B6NDUgzQ.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-CyBVTyGa.js";import{i as v}from"./SearchMd-B1Foybfh.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-doEaURqC.js";import{i as I}from"./SearchMd-B6NDUgzQ.js";import{i as M}from"./X-vKTIsgL1.js";import{I as O}from"./icon-button-Df-IeDHT.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-CyBVTyGa.js";import{i as I}from"./SearchMd-B1Foybfh.js";import{i as M}from"./X-BNszojyh.js";import{I as O}from"./icon-button-BudvJWM8.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-doEaURqC.js";import{s as j}from"./User01-DHGCVvV3.js";import{t as E}from"./Users01-C_qUmfZB.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-CyBVTyGa.js";import{s as j}from"./User01-U5CIC-GP.js";import{t as E}from"./Users01-C6BprSkC.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 v,b as C,j as s,n as w,e_ as F,E as L,r as y,aP as O,Z as B,B as _,R as T,t as z}from"./index-doEaURqC.js";import{i as R}from"./AlertCircle-Cat-Fy2i.js";import{s as A}from"./Plus-qASEo4cN.js";import{s as I}from"./User01-DHGCVvV3.js";import{t as q}from"./Users01-C_qUmfZB.js";import{D as V,b as H,c as Z,d as G,h as J,e as K}from"./dialog-C36x61_J.js";import{I as P}from"./input-BK5Sp8hZ.js";import{L as D}from"./label-tAsQMZ2G.js";import{S as M,b as Q,a as U,d as W,c as k}from"./select-oEHCSTZi.js";import{T as X}from"./textarea-B9cyNs7j.js";import{u as Y,a as ee}from"./use-secrets-44zj-3N9.js";import{R as te}from"./require-capability-vhXMBpff.js";import"./X-vKTIsgL1.js";import"./index-C4LzZ3-O.js";import"./Check-BZXRTDaX.js";import"./ChevronUp-DGt31MPD.js";import"./access-gate-Bbnx_Qh-.js";import"./capability-load-error-CYpF4fm6.js";function se(t){const e=v.c(6),{error:r}=t,n=C();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(R,{size:16}),e[0]=c):c=e[0];let i;e[1]!==r.message||e[2]!==n?(i=n("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=n,e[3]=i):i=e[3];let l;return e[4]!==i?(l=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:i})]}),e[4]=i,e[5]=l):l=e[5],l}function re(t){const e=v.c(8),{scope:r}=t,n=C(),c=r==="user"?I:q;let i;e[0]!==r||e[1]!==n?(i=n(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=n,e[2]=i):i=e[2];const l=i;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let o;return e[5]!==l||e[6]!==a?(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:[a,l]}),e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function $(t){const e=v.c(20),{secret:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(T,{size:16,className:"text-muted-foreground"})}),e[0]=n):n=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 i;e[3]!==r.scope?(i=s.jsx(re,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let l;e[5]!==c||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,i]}),e[5]=c,e[6]=i,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=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]=a):a=e[9];let o;e[10]!==l||e[11]!==a?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=o):o=e[12];let m;e[13]!==r.createdAt?(m=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=m):m=e[14];let d;e[15]!==m?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:m}),e[15]=m,e[16]=d):d=e[16];let u;return e[17]!==o||e[18]!==d?(u=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,d]}),e[17]=o,e[18]=d,e[19]=u):u=e[19],u}function ne(t){const e=v.c(15),{action:r}=t,n=C();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(T,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let i;e[1]!==n?(i=n("settings.secrets.emptyTitle"),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==i?(l=s.jsx("p",{className:"font-medium text-sm",children:i}),e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n?(a=n("settings.secrets.emptyDescription"),e[5]=n,e[6]=a):a=e[6];let o;e[7]!==a?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=o):o=e[8];let m;e[9]!==l||e[10]!==o?(m=s.jsxs("div",{children:[l,o]}),e[9]=l,e[10]=o,e[11]=m):m=e[11];let d;return e[12]!==r||e[13]!==m?(d=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,m,r]}),e[12]=r,e[13]=m,e[14]=d):d=e[14],d}function E({open:t,onOpenChange:e}){const r=C(),[n,c]=y.useState("organization"),[i,l]=y.useState(""),[a,o]=y.useState(""),[m,d]=y.useState(""),u=ee();function b(){c("organization"),l(""),o(""),d("")}function g(){b(),e(!1)}async function S(x){if(x.preventDefault(),!(!i.trim()||!a))try{await u.mutateAsync({scope:n,name:i.trim(),value:a,description:m.trim()||void 0}),z.success(r("settings.secrets.secretCreated",{name:i.trim()})),g()}catch(j){z.error(j instanceof Error?j.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(V,{open:t,onOpenChange:x=>{x?e(x):g()},children:s.jsxs(H,{className:"sm:max-w-lg",children:[s.jsxs(Z,{children:[s.jsx(G,{children:r("settings.secrets.newSecretTitle")}),s.jsx(J,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(M,{value:n,onValueChange:x=>c(x),children:[s.jsx(Q,{id:"secret-scope",children:s.jsx(U,{})}),s.jsxs(W,{children:[s.jsx(k,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(k,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(P,{id:"secret-name",value:i,onChange:x=>l(x.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(D,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(P,{id:"secret-value",type:"password",value:a,onChange:x=>o(x.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(X,{id:"secret-description",value:m,onChange:x=>d(x.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(K,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:g,disabled:u.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:u.isPending||!i.trim()||!a,children:u.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function ie(){const t=v.c(36),e=B(),r=C(),n=Y(),[c,i]=y.useState(!1);let l,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!0),a=s.jsx(A,{size:14}),t[0]=l,t[1]=a):(l=t[0],a=t[1]);let o;t[2]!==r?(o=r("settings.secrets.newSecret"),t[2]=r,t[3]=o):o=t[3];let m;t[4]!==o?(m=s.jsx(w.Actions,{children:s.jsxs(_,{size:"sm",onClick:l,children:[a,o]})}),t[4]=o,t[5]=m):m=t[5];const d=m;if(n.length===0){const j=e&&d,N=!e&&d;let h;t[6]!==N?(h=s.jsx(ne,{action:N}),t[6]=N,t[7]=h):h=t[7];let f;t[8]!==c?(f=s.jsx(E,{open:c,onOpenChange:i}),t[8]=c,t[9]=f):f=t[9];let p;return t[10]!==j||t[11]!==h||t[12]!==f?(p=s.jsxs(s.Fragment,{children:[j,h,f]}),t[10]=j,t[11]=h,t[12]=f,t[13]=p):p=t[13],p}let u,b,g;if(t[14]!==d||t[15]!==n||t[16]!==r){const j=n.filter(oe),N=n.filter(ae),h=n.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let f;t[20]!==n.length||t[21]!==r||t[22]!==h?(f=r(h,{count:n.length}),t[20]=n.length,t[21]=r,t[22]=h,t[23]=f):f=t[23];let p;t[24]!==f?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:f}),t[24]=f,t[25]=p):p=t[25],t[26]!==d||t[27]!==p?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[p,d]}),t[26]=d,t[27]=p,t[28]=u):u=t[28],b=j.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:r("settings.secrets.sectionOrganization")}),s.jsx("div",{children:j.map(le)})]}):null,g=N.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:r("settings.secrets.sectionPrivate")}),s.jsx("div",{children:N.map(ce)})]}):null,t[14]=d,t[15]=n,t[16]=r,t[17]=u,t[18]=b,t[19]=g}else u=t[17],b=t[18],g=t[19];let S;t[29]!==c?(S=s.jsx(E,{open:c,onOpenChange:i}),t[29]=c,t[30]=S):S=t[30];let x;return t[31]!==u||t[32]!==b||t[33]!==g||t[34]!==S?(x=s.jsxs(s.Fragment,{children:[u,b,g,S]}),t[31]=u,t[32]=b,t[33]=g,t[34]=S,t[35]=x):x=t[35],x}function ce(t){return s.jsx($,{secret:t},t.id)}function le(t){return s.jsx($,{secret:t},t.id)}function ae(t){return t.scope==="user"}function oe(t){return t.scope==="organization"}function de(){const t=v.c(7),e=C();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let n;t[2]!==r?(n=s.jsx(w.Title,{children:r}),t[2]=r,t[3]=n):n=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(L,{fallback:me,children:s.jsx(y.Suspense,{fallback:s.jsx(O,{className:"h-32 w-full"}),children:s.jsx(ie,{})})}),t[4]=c):c=t[4];let i;return t[5]!==n?(i=s.jsx(w,{children:s.jsx(w.Content,{children:s.jsx(w.Container,{children:s.jsxs(F,{children:[n,c]})})})}),t[5]=n,t[6]=i):i=t[6],i}function me(t){const{error:e}=t;return s.jsx(se,{error:e??new Error("Failed to load secrets")})}function ke(){const t=v.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{capability:"secrets:manage",area:"secrets",children:s.jsx(de,{})}),t[0]=e):e=t[0],e}export{ke as default};
1
+ import{c as v,b as C,j as s,n as w,e$ as F,E as L,r as y,aR as O,Z as R,B as z,R as E,t as _}from"./index-CyBVTyGa.js";import{i as B}from"./AlertCircle-CVkVxygv.js";import{s as A}from"./Plus-BbELO07z.js";import{s as I}from"./User01-U5CIC-GP.js";import{t as q}from"./Users01-C6BprSkC.js";import{D as V,b as H,c as Z,d as G,h as J,e as K}from"./dialog-BG6kEGFR.js";import{I as P}from"./input-D5Zi_pUc.js";import{L as D}from"./label-DVhvlWqs.js";import{S as M,b as Q,a as U,d as W,c as $}from"./select-CDhEibGy.js";import{T as X}from"./textarea-TE2JJa-B.js";import{u as Y,a as ee}from"./use-secrets-BfDHS5Uq.js";import{R as te}from"./require-capability-QoYjHav_.js";import"./X-BNszojyh.js";import"./index-DtBnPwzh.js";import"./Check-DL_AGZMy.js";import"./ChevronUp-B6mY-MC1.js";import"./access-gate-Clo8Jex8.js";import"./capability-load-error-BjI2iK0-.js";function se(t){const e=v.c(6),{error:r}=t,n=C();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(B,{size:16}),e[0]=c):c=e[0];let i;e[1]!==r.message||e[2]!==n?(i=n("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=n,e[3]=i):i=e[3];let l;return e[4]!==i?(l=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:i})]}),e[4]=i,e[5]=l):l=e[5],l}function re(t){const e=v.c(8),{scope:r}=t,n=C(),c=r==="user"?I:q;let i;e[0]!==r||e[1]!==n?(i=n(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=n,e[2]=i):i=e[2];const l=i;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let o;return e[5]!==l||e[6]!==a?(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:[a,l]}),e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function T(t){const e=v.c(20),{secret:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=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]=n):n=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 i;e[3]!==r.scope?(i=s.jsx(re,{scope:r.scope}),e[3]=r.scope,e[4]=i):i=e[4];let l;e[5]!==c||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,i]}),e[5]=c,e[6]=i,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=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]=a):a=e[9];let o;e[10]!==l||e[11]!==a?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=o):o=e[12];let m;e[13]!==r.createdAt?(m=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=m):m=e[14];let d;e[15]!==m?(d=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:m}),e[15]=m,e[16]=d):d=e[16];let u;return e[17]!==o||e[18]!==d?(u=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,d]}),e[17]=o,e[18]=d,e[19]=u):u=e[19],u}function ne(t){const e=v.c(15),{action:r}=t,n=C();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 i;e[1]!==n?(i=n("settings.secrets.emptyTitle"),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==i?(l=s.jsx("p",{className:"font-medium text-sm",children:i}),e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n?(a=n("settings.secrets.emptyDescription"),e[5]=n,e[6]=a):a=e[6];let o;e[7]!==a?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:a}),e[7]=a,e[8]=o):o=e[8];let m;e[9]!==l||e[10]!==o?(m=s.jsxs("div",{children:[l,o]}),e[9]=l,e[10]=o,e[11]=m):m=e[11];let d;return e[12]!==r||e[13]!==m?(d=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,m,r]}),e[12]=r,e[13]=m,e[14]=d):d=e[14],d}function k({open:t,onOpenChange:e}){const r=C(),[n,c]=y.useState("organization"),[i,l]=y.useState(""),[a,o]=y.useState(""),[m,d]=y.useState(""),u=ee();function b(){c("organization"),l(""),o(""),d("")}function g(){b(),e(!1)}async function S(x){if(x.preventDefault(),!(!i.trim()||!a))try{await u.mutateAsync({scope:n,name:i.trim(),value:a,description:m.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:i.trim()})),g()}catch(j){_.error(j instanceof Error?j.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(V,{open:t,onOpenChange:x=>{x?e(x):g()},children:s.jsxs(H,{className:"sm:max-w-lg",children:[s.jsxs(Z,{children:[s.jsx(G,{children:r("settings.secrets.newSecretTitle")}),s.jsx(J,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(M,{value:n,onValueChange:x=>c(x),children:[s.jsx(Q,{id:"secret-scope",children:s.jsx(U,{})}),s.jsxs(W,{children:[s.jsx($,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx($,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(P,{id:"secret-name",value:i,onChange:x=>l(x.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(D,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(P,{id:"secret-value",type:"password",value:a,onChange:x=>o(x.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(D,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(X,{id:"secret-description",value:m,onChange:x=>d(x.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(K,{children:[s.jsx(z,{type:"button",variant:"outline",onClick:g,disabled:u.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(z,{type:"submit",disabled:u.isPending||!i.trim()||!a,children:u.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function ie(){const t=v.c(36),e=R(),r=C(),n=Y(),[c,i]=y.useState(!1);let l,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!0),a=s.jsx(A,{size:14}),t[0]=l,t[1]=a):(l=t[0],a=t[1]);let o;t[2]!==r?(o=r("settings.secrets.newSecret"),t[2]=r,t[3]=o):o=t[3];let m;t[4]!==o?(m=s.jsx(w.Actions,{children:s.jsxs(z,{size:"sm",onClick:l,children:[a,o]})}),t[4]=o,t[5]=m):m=t[5];const d=m;if(n.length===0){const j=e&&d,N=!e&&d;let h;t[6]!==N?(h=s.jsx(ne,{action:N}),t[6]=N,t[7]=h):h=t[7];let f;t[8]!==c?(f=s.jsx(k,{open:c,onOpenChange:i}),t[8]=c,t[9]=f):f=t[9];let p;return t[10]!==j||t[11]!==h||t[12]!==f?(p=s.jsxs(s.Fragment,{children:[j,h,f]}),t[10]=j,t[11]=h,t[12]=f,t[13]=p):p=t[13],p}let u,b,g;if(t[14]!==d||t[15]!==n||t[16]!==r){const j=n.filter(oe),N=n.filter(ae),h=n.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let f;t[20]!==n.length||t[21]!==r||t[22]!==h?(f=r(h,{count:n.length}),t[20]=n.length,t[21]=r,t[22]=h,t[23]=f):f=t[23];let p;t[24]!==f?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:f}),t[24]=f,t[25]=p):p=t[25],t[26]!==d||t[27]!==p?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[p,d]}),t[26]=d,t[27]=p,t[28]=u):u=t[28],b=j.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:r("settings.secrets.sectionOrganization")}),s.jsx("div",{children:j.map(le)})]}):null,g=N.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:r("settings.secrets.sectionPrivate")}),s.jsx("div",{children:N.map(ce)})]}):null,t[14]=d,t[15]=n,t[16]=r,t[17]=u,t[18]=b,t[19]=g}else u=t[17],b=t[18],g=t[19];let S;t[29]!==c?(S=s.jsx(k,{open:c,onOpenChange:i}),t[29]=c,t[30]=S):S=t[30];let x;return t[31]!==u||t[32]!==b||t[33]!==g||t[34]!==S?(x=s.jsxs(s.Fragment,{children:[u,b,g,S]}),t[31]=u,t[32]=b,t[33]=g,t[34]=S,t[35]=x):x=t[35],x}function ce(t){return s.jsx(T,{secret:t},t.id)}function le(t){return s.jsx(T,{secret:t},t.id)}function ae(t){return t.scope==="user"}function oe(t){return t.scope==="organization"}function de(){const t=v.c(7),e=C();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let n;t[2]!==r?(n=s.jsx(w.Title,{children:r}),t[2]=r,t[3]=n):n=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(L,{fallback:me,children:s.jsx(y.Suspense,{fallback:s.jsx(O,{className:"h-32 w-full"}),children:s.jsx(ie,{})})}),t[4]=c):c=t[4];let i;return t[5]!==n?(i=s.jsx(w,{children:s.jsx(w.Content,{children:s.jsx(w.Container,{children:s.jsxs(F,{children:[n,c]})})})}),t[5]=n,t[6]=i):i=t[6],i}function me(t){const{error:e}=t;return s.jsx(se,{error:e??new Error("Failed to load secrets")})}function $e(){const t=v.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{capability:"secrets:manage",area:"secrets",children:s.jsx(de,{})}),t[0]=e):e=t[0],e}export{$e as default};
@@ -0,0 +1 @@
1
+ import{c as Jt,b as Qt,Z as fs,r as j,l as ne,j as n,aQ as fo,B as Vt,G as Kt,aL as po,I as ho,H as go,o as vo,h as So,t as N,K as yo}from"./index-CyBVTyGa.js";import{u as bo}from"./chat-context-HOmU0YHH.js";import{I as na,J as xo,K as _o,L as jo,N as Eo,O as aa,Q as ko,T as wo,U as Ro,V as Vo,W as To,X as Dn,Y as No,Z as Ao,G as Rt,_ as Ds,$ as Ks,a0 as xt,C as cs,y as us,a1 as Lt,e as Mo,f as Po,j as Co,u as Do,a2 as Kn,a3 as Ko,a4 as Bo,a5 as Lo,a6 as Fo,a7 as Io,p as rs,a8 as Oo,A as kt,a9 as qt,aa as zo,ab as $o,ac as tt,ad as Bn,w as Ln,ae as Ho,af as As,ag as Go,ah as is,ai as Fn,aj as In,ak as On,al as Ms,H as bt,am as Ut,an as qo,ao as Uo,z as Wo,ap as zn,aq as Jo,ar as $n,as as Hn,M as Qo,at as Gn,au as lt,av as Yo,aw as Zo,F as Xo,ax as er,d as tr,ay as qn,az as sr,aA as wt,aB as nr,aC as ar,aD as or,aE as Un,aF as Wt,aG as rr,aH as ir,aI as lr,aJ as cr,aK as ur,aL as dr,aM as mr,aN as Ps,aO as fr,aP as pr,aQ as hr,aR as gr,aS as vr}from"./runnable-block-editor-DrtKYS1k.js";import{d as Sr}from"./use-virtual-mcp-Vg_Ogz61.js";import{n as yr,t as br}from"./ChevronUp-B6mY-MC1.js";import{S as oa,z as Bs,a3 as xr,m as _r,P as Wn,x as Jn}from"./agent-icon-CSebdE0g.js";import{i as ms}from"./Share07-B2WnpDWD.js";import{S as Bt}from"./scroll-area-CmvmQLS1.js";import{c as ct,T as ut,a as dt}from"./tooltip-BjUMPvkB.js";import{m as jr,u as Er,P as kr}from"./mustache-BU3hKYND.js";import{b as Is,G as wr,e as Rr,j as Vr,g as Tr,r as ls,M as Qn,F as Nr}from"./claim-phase-copy-njXeDF0h.js";import{a as Ar}from"./Copy01-6lOOhJcp.js";import{c as ra}from"./UserSquare-CZakdYWe.js";import{e as Yn}from"./Tool01-BvNT4KDI.js";import{s as Zn}from"./Eye-B5e-ilzV.js";import{s as Mr}from"./Plus-BbELO07z.js";import{s as Pr}from"./Trash01-BLoRPhD3.js";import{i as Ls}from"./Zap-BCwjglMw.js";import{a as Cr,b as Xn,d as Dr,K as Kr,P as Br,u as Lr,C as Fr,s as Ir,e as ds,D as Or,c as zr,S as $r,v as Hr}from"./rich-text-link-control-0ZhNexVb.js";import{a as Gr,P as ea,b as qr}from"./page-seo-form-BML1eDhR.js";import{u as Ur,A as Wr}from"./use-section-preview-base-DW4RpMx9.js";import{b as ta,a as Jr}from"./variant-matcher-override-fLxntWss.js";import"./use-panel-navigate-Bg-MVKv6.js";import"./thread-route-JcpQ-ikA.js";import"./use-project-scope-CRdwBUT7.js";import"./github-repo-BknN0SVI.js";import"./autosend-pQ9pD2-2.js";import"./thread-intent-jq9HKW3p.js";import"./slugify-CEUa2lfQ.js";import"./hooks-lZSCdRwc.js";import"./use-mcp-client-CqKNXJW7.js";import"./auth-B-OXMWGw.js";import"./backoff-8mStPHYB.js";import"./task-board-Qj-6Ctqf.js";import"./schema-DSsDEA1v.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-D6f3xZaU.js";import"./use-ai-providers-ShRDl02e.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DF_mJ7FX.js";import"./use-organization-settings-4gJ9Tp49.js";import"./use-session-runtime-DiG_Qt8i.js";import"./decofile-api-CWaaGMA2.js";import"./utils-Bf0RpmgB.js";import"./ZoomOut-q6Y0RhlM.js";import"./Image01-CkJtDP-I.js";import"./sandbox-url-D3mC8qhT.js";import"./Sun-BKxdX8hu.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CIltybgP.js";import"./Stars01-DUL2jKUJ.js";import"./ArrowRight-FqJnNh3f.js";import"./Check-DL_AGZMy.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BpIxv8-d.js";import"./use-copy-CPOYPvBF.js";import"./usage-stats-Bug-9_EL.js";import"./markdown-DCPDulUN.js";import"./dialog-BG6kEGFR.js";import"./X-BNszojyh.js";import"./Download01-Dq8Pn8XY.js";import"./org-file-open-context-Bh_zBQ2O.js";import"./use-mobile-CUQu4L8c.js";import"./shell-layout-B3x_9fo1.js";import"./avatar-GIuLZx2C.js";import"./User01-U5CIC-GP.js";import"./Globe04-_nV993le.js";import"./SearchLg-C9MObDBB.js";import"./XClose-D_JLFZFT.js";import"./download-app-dialog-NqW4PLAx.js";import"./CheckCircle-DtMp-qqq.js";import"./Monitor01-r707obGd.js";import"./command-ByUEKQB9.js";import"./index-CR8U3UFH.js";import"./SearchMd-B1Foybfh.js";import"./integration-icon-mTqkOE6y.js";import"./project-icon-DWnsLAeJ.js";import"./required-auth-layout-BgLvQHTP.js";import"./use-org-sso-CI1_4UQM.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DBdofBbE.js";import"./types-Bxr6Ak0g.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-DiyAsoDf.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-CVkVxygv.js";import"./LinkExternal01-DSUCZUJp.js";import"./sheet-DH_REC9j.js";import"./use-connection-WQuJ5yl_.js";import"./Palette-DebiHmrq.js";import"./use-navigate-to-agent-W6hb3mqs.js";import"./Link01-BjTxU_bP.js";import"./use-mcp-prompts-DpED8Vrg.js";import"./index-DmF8NlWI.js";import"./form-Bx8qGby0.js";import"./label-DVhvlWqs.js";import"./input-D5Zi_pUc.js";import"./use-thread-outputs-C9_GjCjS.js";import"./file-type-icon-Cbv1Det1.js";import"./popover-CUdTfYte.js";import"./monaco-editor-tpWF7AL5.js";import"./editor-BiwQpn1s.js";import"./calendar-D4hMMrVq.js";import"./textarea-TE2JJa-B.js";import"./select-CDhEibGy.js";import"./index-DtBnPwzh.js";import"./switch-C7dIR4UF.js";import"./combobox-OP-CbRFf.js";import"./XCircle-BuDwhQqF.js";import"./alert-dialog-DeRt3vSN.js";import"./Upload01-CNb1qfRO.js";import"./DotsVertical-CAjUqtRp.js";import"./search-input-0hd-PWUF.js";import"./tabs-D6s_HA-y.js";import"./use-debounced-value-DHN-wkc6.js";import"./use-file-configs-Cd7oj9Fw.js";import"./asset-utils-BS06OXCA.js";import"./useInfiniteQuery-DebjMHv1.js";import"./infiniteQueryObserver-COZ-9XSO.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-Dv_lnjT7.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-bOLRJZuX.js";import"./ArrowLeft-CN6aZBvX.js";import"./CreditCard01-DdYfDHIS.js";import"./Key01-BCuGindq.js";import"./LayoutLeft-U0F-Da_p.js";import"./Package-D2jMN__x.js";import"./Users01-C6BprSkC.js";import"./section-preview-url-Csj0_ZDg.js";function Qr(S){return S.schema?.definitions??S.schema?.$defs??{}}function ia(S,e){const u=Qr(e),p=u[btoa(S)];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 Yr(S,e){for(const u of ia(S,e)){const p=typeof u.image=="string"?u.image:void 0;if(p?.includes("{{{"))return p}}function Zr(S,e){if(!e)return;const u=na(S);if(!u)return;const p=Yr(u.resolveType,e);if(!p)return;const h=xo(p,u.data);if(h)return _o(h)}const Xr={escape:jo};function ei(S,e){for(const u of ia(S,e)){const p=typeof u.title=="string"?u.title:void 0;if(p?.includes("{{"))return p}}function ti(S,e){if(!e)return;const u=na(S);if(u)try{const p=ei(u.resolveType,e);return p&&jr.render(p,u.data,{},Xr).trim()||void 0}catch{return}}function si(S){const e=Jt.c(13),{icon:u,label:p,className:h}=S;let k;e[0]!==h?(k=ne("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 ni="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 sa(S){return Array.from({length:S},(e,u)=>({id:crypto.randomUUID(),index:u}))}function la(S){return S.map((e,u)=>({...e,index:u}))}function ai(S,e){if(e===S.length)return S;if(e<S.length)return la(S.slice(0,e));const u=Array.from({length:e-S.length},(p,h)=>({id:crypto.randomUUID(),index:S.length+h}));return[...S,...u]}function ca(S){const e=Jt.c(44),{section:u,raw:p,meta:h,decofile:k}=S,w=Qt(),y=fs(),T=u.isSavedBlock===!0,b=u.isMultivariate===!0;let J;e[0]!==h||e[1]!==p?(J=p&&h?Zr(p,h):void 0,e[0]=h,e[1]=p,e[2]=J):J=e[2];const de=J;let De;e[3]!==h||e[4]!==b||e[5]!==p||e[6]!==T?(De=p&&h&&!T&&!b?ti(p,h):void 0,e[3]=h,e[4]=b,e[5]=p,e[6]=T,e[7]=De):De=e[7];const Ke=De;let Ve;e[8]!==k||e[9]!==h||e[10]!==p||e[11]!==u?(Ve=To(p,u,k,h),e[8]=k,e[9]=h,e[10]=p,e[11]=u,e[12]=Ve):Ve=e[12];const ae=Ve;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 R=r,he=T?ms:b?oa:ra;let $;e[16]!==b||e[17]!==T?($=T?{color:wr}: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]!==he||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(he,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Ao,{"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(xr,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=he,e[20]=y,e[21]=O):O=e[21];let i;e[22]!==de?(i=de&&n.jsx("img",{src:de,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=de,e[23]=i):i=e[23];let U;e[24]!==y||e[25]!==c?(U=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:c}),e[24]=y,e[25]=c,e[26]=U):U=e[26];const G=y?"shrink":"flex-1",Ee=u.isHidden&&"line-through opacity-50";let Te;e[27]!==Ee||e[28]!==G?(Te=ne("min-w-0 truncate text-sm font-medium",G,Ee),e[27]=Ee,e[28]=G,e[29]=Te):Te=e[29];const Ge=Ke??u.label;let xe;e[30]!==Te||e[31]!==Ge?(xe=n.jsx("span",{className:Te,children:Ge}),e[30]=Te,e[31]=Ge,e[32]=xe):xe=e[32];let m;e[33]!==R||e[34]!==y||e[35]!==ae||e[36]!==w?(m=y?n.jsxs(n.Fragment,{children:[R&&n.jsx(si,{icon:Ls,label:w("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),ae&&n.jsx(Dn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):ae&&n.jsx(Dn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=R,e[34]=y,e[35]=ae,e[36]=w,e[37]=m):m=e[37];let M;return e[38]!==xe||e[39]!==m||e[40]!==O||e[41]!==i||e[42]!==U?(M=n.jsxs(n.Fragment,{children:[O,i,U,xe,m]}),e[38]=xe,e[39]=m,e[40]=O,e[41]=i,e[42]=U,e[43]=M):M=e[43],M}const oi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",ri="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 ua(S,e,u){if(u)return No({selected:e});const p=S.isSavedBlock===!0,h=S.isMultivariate===!0;return ne("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?oi:h?ri:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Cs(S,e){return ne("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":S?"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 ii(S){const e=Jt.c(90),{section:u,raw:p,meta:h,decofile:k,sortableId:w,selected:y,onSelect:T,onDelete:b,onDuplicate:J,onMakeReusable:de,onToggleHidden:De,onToggleLazy:Ke,onAddVariant:Ve,onDetach:ae}=S,r=Qt(),R=fs(),he=p?Is(p.__resolveType??""):!1,$=u.isHidden===!0,c=he||$;let O;e[0]!==u?(O=aa(u),e[0]=u,e[1]=O):O=e[1];const i=O;let U;e[2]!==w?(U={id:w,animateLayoutChanges:ui},e[2]=w,e[3]=U):U=e[3];const{attributes:G,listeners:Ee,setNodeRef:Te,transform:Ge,isDragging:xe}=Lr(U);let m;e[4]!==Ge?(m=Fr.Transform.toString(Ge?{...Ge,x:0}:null),e[4]=Ge,e[5]=m):m=e[5];const M=xe?0:void 0;let qe;e[6]!==m||e[7]!==M?(qe={transform:m,opacity:M},e[6]=m,e[7]=M,e[8]=qe):qe=e[8];const F=qe;let Ue;e[9]!==u?(Ue=ko(u),e[9]=u,e[10]=Ue):Ue=e[10];const z=Ue,mt="button",me=0;let Oe;e[11]!==T?(Oe=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},e[11]=T,e[12]=Oe):Oe=e[12];const _t=xe?"cursor-grabbing":"cursor-pointer";let Be;e[13]!==R||e[14]!==u||e[15]!==y||e[16]!==_t?(Be=ne("touch-none transition-colors",_t,ua(u,y,R)),e[13]=R,e[14]=u,e[15]=y,e[16]=_t,e[17]=Be):Be=e[17];let oe;e[18]!==k||e[19]!==h||e[20]!==p||e[21]!==u?(oe=n.jsx(ca,{section:u,raw:p,meta:h,decofile:k}),e[18]=k,e[19]=h,e[20]=p,e[21]=u,e[22]=oe):oe=e[22];const re=!R&&!u.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ne(Cs(c,he)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ci,children:n.jsx(Ls,{className:ne("h-3.5 w-3.5",he&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ne=R?n.jsx(wo,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:De,children:$?n.jsx(Yn,{className:"h-3.5 w-3.5"}):n.jsx(Zn,{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:ne(Cs(c,$)),onClick:P=>{P.stopPropagation(),De()},onPointerDown:li,children:$?n.jsx(Yn,{className:"h-3.5 w-3.5"}):n.jsx(Zn,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=ho,A=Ro;let ie;e[23]!==r?(ie=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ie):ie=e[24];const ke=ne(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 Ae;e[25]!==A||e[26]!==ie||e[27]!==ke?(Ae=n.jsx(A,{label:ie,classicClassName:ke}),e[25]=A,e[26]=ie,e[27]=ke,e[28]=Ae):Ae=e[28];let we;e[29]!==R||e[30]!==he||e[31]!==Ke||e[32]!==u.isMultivariate||e[33]!==r?(we=R&&!u.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Ke()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(po,{})]}),e[29]=R,e[30]=he,e[31]=Ke,e[32]=u.isMultivariate,e[33]=r,e[34]=we):we=e[34];let H;e[35]!==J?(H=P=>{P.stopPropagation(),J()},e[35]=J,e[36]=H):H=e[36];let le;e[37]===Symbol.for("react.memo_cache_sentinel")?(le=n.jsx(Ar,{className:"h-4 w-4"}),e[37]=le):le=e[37];let _e;e[38]!==r?(_e=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=_e):_e=e[39];let fe;e[40]!==H||e[41]!==_e?(fe=n.jsxs(Kt,{onClick:H,children:[le,_e]}),e[40]=H,e[41]=_e,e[42]=fe):fe=e[42];let te;e[43]!==R||e[44]!==i||e[45]!==Ve||e[46]!==r?(te=i&&n.jsxs(Kt,{className:ne(!R&&Vo),onClick:P=>{P.stopPropagation(),Ve()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=R,e[44]=i,e[45]=Ve,e[46]=r,e[47]=te):te=e[47];let pe;e[48]!==R||e[49]!==z||e[50]!==de||e[51]!==r?(pe=z&&n.jsxs(Kt,{className:ne(!R&&ni),onClick:P=>{P.stopPropagation(),de()},children:[R?n.jsx(ms,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=R,e[49]=z,e[50]=de,e[51]=r,e[52]=pe):pe=e[52];let se;e[53]!==R||e[54]!==ae||e[55]!==u.isMultivariate||e[56]!==u.isSavedBlock||e[57]!==r?(se=u.isSavedBlock===!0&&!u.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),ae()},children:[R?n.jsx(ra,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=R,e[54]=ae,e[55]=u.isMultivariate,e[56]=u.isSavedBlock,e[57]=r,e[58]=se):se=e[58];let Me;e[59]!==b?(Me=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Me):Me=e[60];let ge;e[61]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(Pr,{className:"h-4 w-4"}),e[61]=ge):ge=e[61];let Re;e[62]!==r?(Re=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Re):Re=e[63];let je;e[64]!==Me||e[65]!==Re?(je=n.jsxs(Kt,{variant:"destructive",onClick:Me,children:[ge,Re]}),e[64]=Me,e[65]=Re,e[66]=je):je=e[66];let ve;e[67]!==we||e[68]!==fe||e[69]!==te||e[70]!==pe||e[71]!==se||e[72]!==je?(ve=n.jsxs(go,{align:"end",className:"w-44",children:[we,fe,te,pe,se,je]}),e[67]=we,e[68]=fe,e[69]=te,e[70]=pe,e[71]=se,e[72]=je,e[73]=ve):ve=e[73];let Se;e[74]!==B||e[75]!==Ae||e[76]!==ve?(Se=n.jsxs(B,{children:[Ae,ve]}),e[74]=B,e[75]=Ae,e[76]=ve,e[77]=Se):Se=e[77];let ze;return e[78]!==G||e[79]!==Ee||e[80]!==T||e[81]!==Te||e[82]!==F||e[83]!==Be||e[84]!==oe||e[85]!==re||e[86]!==Ne||e[87]!==Se||e[88]!==Oe?(ze=n.jsxs("div",{ref:Te,style:F,...G,...Ee,role:mt,tabIndex:me,onClick:T,onKeyDown:Oe,className:Be,children:[oe,re,Ne,Se]}),e[78]=G,e[79]=Ee,e[80]=T,e[81]=Te,e[82]=F,e[83]=Be,e[84]=oe,e[85]=re,e[86]=Ne,e[87]=Se,e[88]=Oe,e[89]=ze):ze=e[89],ze}function li(S){return S.stopPropagation()}function ci(S){return S.stopPropagation()}function ui(){return!1}function Fs(S){const e=Jt.c(11),{canAddSection:u,onAddSection:p,className:h,size:k}=S,w=Qt();let y;e[0]!==h?(y=ne("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(Mr,{size:14}),e[2]=b):b=e[2];let J;e[3]!==w?(J=w("sectionsEditor.sectionList.addSectionButton"),e[3]=w,e[4]=J):J=e[4];let de;return e[5]!==p||e[6]!==k||e[7]!==y||e[8]!==T||e[9]!==J?(de=n.jsxs(Vt,{type:"button",variant:"outline",size:k,className:y,disabled:T,onClick:p,children:[b,J]}),e[5]=p,e[6]=k,e[7]=y,e[8]=T,e[9]=J,e[10]=de):de=e[10],de}function di(S){const e=Jt.c(101),{listKey:u,rawSections:p,sections:h,meta:k,decofile:w,selectedIndex:y,onSelect:T,onReorder:b,onDelete:J,onDuplicate:de,onMakeReusable:De,onToggleHidden:Ke,onToggleLazy:Ve,onAddVariant:ae,onDetach:r,onAddSection:R,canAddSection:he}=S,$=he===void 0?!0:he,c=Qt(),O=fs();let i;e[0]!==h.length?(i=()=>sa(h.length),e[0]=h.length,e[1]=i):i=e[1];const[U,G]=j.useState(i),[Ee,Te]=j.useState(null),[Ge,xe]=j.useState(u),[m,M]=j.useState(h.length),qe=j.useRef(!1);Ge!==u?(xe(u),M(h.length),G(sa(h.length))):m!==h.length&&(M(h.length),G(Pe=>ai(Pe,h.length)));let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[2]=F):F=e[2];let Ue;e[3]===Symbol.for("react.memo_cache_sentinel")?(Ue={coordinateGetter:Ir},e[3]=Ue):Ue=e[3];const z=Cr(Xn(Br,F),Xn(Kr,Ue));let mt;e[4]!==U?(mt=U.map(mi),e[4]=U,e[5]=mt):mt=e[5];const me=mt;let Oe;e[6]===Symbol.for("react.memo_cache_sentinel")?(Oe=Pe=>{Te(String(Pe.active.id))},e[6]=Oe):Oe=e[6];const _t=Oe;let Be;e[7]!==me||e[8]!==b?(Be=Pe=>{Te(null);const{active:I,over:D}=Pe;if(!D||I.id===D.id)return;const Le=me.indexOf(String(I.id)),Ze=me.indexOf(String(D.id));Le===-1||Ze===-1||(G(nt=>la(ds([...nt],Le,Ze))),qe.current=!0,requestAnimationFrame(()=>{qe.current=!1}),b?.(Le,Ze))},e[7]=me,e[8]=b,e[9]=Be):Be=e[9];const oe=Be;let re;e[10]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{Te(null)},e[10]=re):re=e[10];const Ne=re;let B,A,ie,ke,Ae,we,H,le,_e,fe,te,pe,se,Me,ge;if(e[11]!==Ee||e[12]!==$||e[13]!==O||e[14]!==w||e[15]!==U||e[16]!==me||e[17]!==oe||e[18]!==k||e[19]!==R||e[20]!==ae||e[21]!==J||e[22]!==r||e[23]!==de||e[24]!==De||e[25]!==T||e[26]!==Ke||e[27]!==Ve||e[28]!==p||e[29]!==h||e[30]!==y||e[31]!==z||e[32]!==c){Me=Symbol.for("react.early_return_sentinel");e:{const Pe=I=>{qe.current||T(I)};if(e[48]!==Ee||e[49]!==$||e[50]!==O||e[51]!==U||e[52]!==R||e[53]!==p||e[54]!==h||e[55]!==c){const I=Ee?U.find(D=>D.id===Ee):null;if(ke=I!=null?h[I.index]:null,ie=I!=null?p[I.index]:void 0,U.length===0){let D;e[59]!==c?(D=c("sectionsEditor.sectionList.noSections"),e[59]=c,e[60]=D):D=e[60];let Le;e[61]!==D?(Le=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:D}),e[61]=D,e[62]=Le):Le=e[62];const Ze=Le;let nt;e[63]!==$||e[64]!==O||e[65]!==Ze||e[66]!==R?(nt=O?Ze:n.jsxs("div",{className:"space-y-2",children:[Ze,n.jsx(Fs,{canAddSection:$,onAddSection:R,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Ze,e[66]=R,e[67]=nt):nt=e[67],Me=nt;break e}se=ne(I&&"cursor-grabbing"),e[48]=Ee,e[49]=$,e[50]=O,e[51]=U,e[52]=R,e[53]=p,e[54]=h,e[55]=c,e[56]=ie,e[57]=ke,e[58]=se}else ie=e[56],ke=e[57],se=e[58];A=Or,le=z,_e=zr,fe=_t,te=oe,pe=Ne,B=$r,we=me,H=Hr,ge="space-y-1",Ae=U.map(I=>{const D=h[I.index];return D?n.jsx(ii,{sortableId:I.id,section:D,raw:p[I.index],meta:k,decofile:w,selected:y===I.index,onSelect:()=>Pe(I.index),onDelete:()=>J(I.index),onDuplicate:()=>de(I.index),onMakeReusable:()=>De(I.index),onToggleHidden:()=>Ke(I.index),onToggleLazy:()=>Ve(I.index),onAddVariant:()=>ae(I.index),onDetach:()=>r(I.index)},I.id):null})}e[11]=Ee,e[12]=$,e[13]=O,e[14]=w,e[15]=U,e[16]=me,e[17]=oe,e[18]=k,e[19]=R,e[20]=ae,e[21]=J,e[22]=r,e[23]=de,e[24]=De,e[25]=T,e[26]=Ke,e[27]=Ve,e[28]=p,e[29]=h,e[30]=y,e[31]=z,e[32]=c,e[33]=B,e[34]=A,e[35]=ie,e[36]=ke,e[37]=Ae,e[38]=we,e[39]=H,e[40]=le,e[41]=_e,e[42]=fe,e[43]=te,e[44]=pe,e[45]=se,e[46]=Me,e[47]=ge}else B=e[33],A=e[34],ie=e[35],ke=e[36],Ae=e[37],we=e[38],H=e[39],le=e[40],_e=e[41],fe=e[42],te=e[43],pe=e[44],se=e[45],Me=e[46],ge=e[47];if(Me!==Symbol.for("react.early_return_sentinel"))return Me;let Re;e[68]!==Ae||e[69]!==ge?(Re=n.jsx("div",{className:ge,children:Ae}),e[68]=Ae,e[69]=ge,e[70]=Re):Re=e[70];let je;e[71]!==B||e[72]!==we||e[73]!==H||e[74]!==Re?(je=n.jsx(B,{items:we,strategy:H,children:Re}),e[71]=B,e[72]=we,e[73]=H,e[74]=Re,e[75]=je):je=e[75];let ve;e[76]!==ie||e[77]!==ke||e[78]!==O||e[79]!==w||e[80]!==k?(ve=ke?n.jsx("div",{className:ne("cursor-grabbing shadow-lg ring-1 ring-border/60",ua(ke,!1,O)),children:n.jsx(ca,{section:ke,raw:ie,meta:k,decofile:w})}):null,e[76]=ie,e[77]=ke,e[78]=O,e[79]=w,e[80]=k,e[81]=ve):ve=e[81];let Se;e[82]!==ve?(Se=fo.createPortal(n.jsx(Dr,{dropAnimation:Eo,children:ve}),document.body),e[82]=ve,e[83]=Se):Se=e[83];let ze;e[84]!==A||e[85]!==le||e[86]!==_e||e[87]!==fe||e[88]!==te||e[89]!==pe||e[90]!==je||e[91]!==Se?(ze=n.jsxs(A,{sensors:le,collisionDetection:_e,onDragStart:fe,onDragEnd:te,onDragCancel:pe,children:[je,Se]}),e[84]=A,e[85]=le,e[86]=_e,e[87]=fe,e[88]=te,e[89]=pe,e[90]=je,e[91]=Se,e[92]=ze):ze=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==R?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:R,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=R,e[96]=P):P=e[96];let st;return e[97]!==se||e[98]!==ze||e[99]!==P?(st=n.jsxs("div",{className:se,children:[ze,P]}),e[97]=se,e[98]=ze,e[99]=P,e[100]=st):st=e[100],st}function mi(S){return S.id}function fi(S,e,u,p){if(!S||typeof S!="object")return{kind:"error",reason:"no-matcher-rule"};const h=e.trim();if(!h)return Rt(S,u,p)?{kind:"inline",blockKey:S.__resolveType??"",inlinedRule:Ds(S,u,p)}:{kind:"noop"};const k=Ks(S,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 Ic({orgSlug:S,virtualMcpId:e,branch:u,previewReady:p=!0,previewUrl:h,currentPath:k,activePageBlockKey:w=null,activeGlobalBlockKey:y=null,externalSelection:T,onSaved:b,initialEditSeo:J=!1,onExitSeo:de,onSelectRoot:De,onViewJsonFile:Ke,onFocusedBlockChange:Ve,onVariantPreviewOverride:ae}){const r=Qt(),R=bo(),he=R?.taskId??null,$=p?{orgSlug:S,virtualMcpId:e,branch:u,threadId:he,previewUrl:h}:null,{data:c,isLoading:O}=Mo($),{data:i,isLoading:U}=Po($),G=fs(),Ee=R?.virtualMcpId,Ge=Sr(Ee===e?e:null)?.metadata?.siteSlug??null,xe=Ur({virtualMcpId:e,sandboxUrl:h}),[m,M]=j.useState(null),[qe,F]=j.useState(null),[Ue,z]=j.useState(null),[mt,me]=j.useState(0),[Oe,_t]=j.useState(void 0),[Be,oe]=j.useState(null),[re,Ne]=j.useState(null),[B,A]=j.useState([]),ie=j.useRef(null),[ke,Ae]=j.useState(B.length);ke!==B.length&&(Ae(B.length),requestAnimationFrame(()=>{ie.current&&(ie.current.scrollTop=0)}));const[we,H]=j.useState(0),[le,_e]=j.useState(null),[fe,te]=j.useState(null),[pe,se]=j.useState(null),[Me,ge]=j.useState(!1),[Re,je]=j.useState(!1),ve=j.useRef(null),[Se,ze]=j.useState(!0),[P,st]=j.useState(!1),[Pe,I]=j.useState(!1),[D,Le]=j.useState(J),[Ze,nt]=j.useState(J);J&&!Ze&&(nt(!0),Le(!0),M(null),F(null),z(null),A([])),!J&&Ze&&nt(!1);const[da,Yt]=j.useState(null),[Os,ps]=j.useState(void 0),[zs,jt]=j.useState([]),[$s,Ft]=j.useState(0),[Fe,We]=j.useState(0),[ma,Ce]=j.useState(null),[Tt,Ie]=j.useState(null),[Hs,Gs]=j.useState(null),fa=vo(),pa=`${S}/${e}/${u}`,Zt=Co({orgSlug:S,virtualMcpId:e,branch:u}),[ha,ga]=j.useState(k),[va,Sa]=j.useState(w),[ya,ba]=j.useState(y);(ha!==k||va!==w||ya!==y)&&(queueMicrotask(()=>Zt.flush()),ga(k),Sa(w),ba(y),M(null),F(null),z(null),me(0),oe(null),Ne(null),We(0),Ce(null),Ie(null),A([]),H(t=>t+1),Le(!1),Yt(null),ps(void 0),jt([]),Ft(t=>t+1));const q=Do({orgSlug:S,virtualMcpId:e,branch:u}),It=tr((t,s)=>{q.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Xt=Er({orgSlug:S,virtualMcpId:e,branch:u}),[Nt,At]=j.useState(!1),Q=j.useRef(null),at=j.useRef(null),ot=j.useRef(null),hs=j.useRef({}),$e=j.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[xa,_a]=j.useState(null);if(!p||O||U)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(So,{className:"size-5 text-muted-foreground"})});if(!c||!i)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 ja=Rr(c),Y=!!y,X=Y?null:Vr(ja,k,w),g=Y?y:X?.key??null,gs=Y&&y?c[y]:void 0,qs=Y&&y&&gs?Tr(y,gs):Y&&y?y:"",Ot=!Y&&g&&c[g]?c[g]:null,vs=D&&c&&i&&g&&X?Kn(c,{kind:"page",pageKey:g,pageName:String(X.name??""),path:String(X.path??"")},i):null,Ea=D?Ot?.seo:void 0,es=Os!==void 0?Os:Ea,ka=D?Ko(es):void 0,Us=vs?.seoTypeOptions??[],Ws=D&&i?Bo(i):"",Ss=da??ka??{},ts=D&&vs?Gr(Ss,vs):null,Js=D&&ts&&Lo(es)?ls(ts,i):null,Qs=D?Fo(c,i)?.seoData:void 0,ce=Y?[{label:"Default",sections:[{__resolveType:y}]}]:Io(Ot?.sections,c??{}),Xe=ce.length>1,ee=Math.min(mt,ce.length-1),He=ce[ee],K=He?.sections??[],ye=rs(K,c),ys=!Y&&Oo(Ot?.sections);if(Y&&y&&Hs!==y){Gs(y);const t=K[0],s=ye[0];if(t&&s){M(0),We(0),A([]);const a=kt(t,s,c);a&&(F(a.data),z(a.resolveType),Ie(null),Ce(null))}}!Y&&Hs!==null&&Gs(null),$e.current={rawSections:K,parsedSections:ye,decofile:c??{},activePageKey:g,pageVariants:ce,variantIndex:ee,sectionVariantIndex:Fe,selectedSectionIndex:m};const wa=()=>({multivariate:ys,index:ee,variants:ce.map(t=>({rule:t.rule}))}),bs=(t,s)=>{if(!ae)return;if(!g||!ys||t.length<=1){ae(null);return}const a=ta(g,{multivariate:!0,index:s,variants:t},c,i);ae(a.length>0?a:null)},xs=ae&&g&&ys&&Xe&&!O&&!U?g:null;if(xs!==xa&&(_a(xs),xs)){const t=ce.map(a=>({rule:a.rule})),s=ee;queueMicrotask(()=>bs(t,s))}const Mt=(t,s,a)=>{if(!ae)return;if(!g){ae(null);return}const o=wa(),l=ta(g,o,c,i);if(!t||s<0){ae(l.length>0?l:null);return}const f=Jr({pageKey:g,page:o,sectionIndex:s,sectionLazy:ye[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:i}),d=[...l,...f];ae(d.length>0?d:null)},ft=(t,s,a,o=m??-1,l=!1)=>{const f=tt(t,s);if(!f){F(null),z(null),Ie(null),Ce(null),l&&Mt(null,o,a);return}const x=Bn(f,lt)[a];if(!x){F(null),z(null),Ie(null),Ce(null),l&&Mt(null,o,a);return}const V=Yo(x.value,c);F(V?.data??null),z(V?.resolveType??null);const{resolveType:v,formValue:_}=qt(x.rule,c,i??void 0);Ie(v),Ce(_),l&&Mt(f,o,a)},zt=T?.index;if(T!==void 0&&(T?.seq??null)!==Oe&&(_t(T?.seq??null),typeof zt=="number")){const t=K[zt],s=ye[zt];if(t&&s)if(M(zt),We(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,c);a?(F(a.data),z(a.resolveType)):(F(null),z(null)),Ie(null),Ce(null)}}const $t={orgSlug:S,virtualMcpId:e,branch:u,threadId:he,previewUrl:h??void 0,siteSlug:Ge},_s=Ue&&i?ls(Ue,i):null,Je=(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=Wt(c,g,t,ee,ce);q.mutate({blockKey:g,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Ve?.(null),M(null),I(!1),F(null),z(null),We(0),Ce(null),Ie(null),A([]),H(t=>t+1)},Ra=(t,s)=>{Q.current&&clearTimeout(Q.current);const a=$e.current.sectionVariantIndex;Q.current=setTimeout(()=>{const{rawSections:o,parsedSections:l,decofile:f,activePageKey:d,pageVariants:x,variantIndex:V}=$e.current,v=o[s];if(!v)return;const _=l[s];if(!_)return;if(_.isSavedBlock){const C=pr(v,_);if(!C)return;q.mutate({blockKey:C,data:t},{onSuccess:()=>b?.(),onError:L=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:L.message}))});return}if(!d)return;const E={...f[d]},W=[...o];if(_.isMultivariate){const C=tt(v,_);if(!C||!d)return;const L=hr(C,a,t);W[s]=wt(v,_,L)}else if(_.isHidden){const C=Is(v.__resolveType),L=C?{...v.section}:{...v},ue=Array.isArray(L.variants)?[...L.variants]:[];ue[0]&&(ue[0]={...ue[0],value:t}),L.variants=ue,C?W[s]={...v,section:L}:W[s]=L}else _.isLazy?W[s]={...v,section:t}:W[s]=t;if(x.length>1){const C=E.sections,L=[...C?.variants??[]];L[V]&&(L[V]={...L[V],value:W}),E.sections={...C,variants:L}}else E.sections=W;q.mutate({blockKey:d,data:E},{onSuccess:()=>b?.(),onError:C=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:C.message}))})},Ps)},Va=t=>{M(t),We(0),A([]),H(l=>l+1);const s=K[t],a=ye[t];if(Ve?.(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){F(null),z(null),Ie(null),Ce(null),Mt(null,t,0);return}F(o.data),z(o.resolveType),Ie(null),Ce(null),Mt(null,t,0)},Ys=t=>{const s=t;F(s),m!==null&&Ra(s,m)},js=t=>{if(!g||!c||!i||!X)return;const s={kind:"page",pageKey:g,pageName:String(X.name??""),path:String(X.path??"")},a=Kn(c,s,i);a&&Zt.save(g,()=>{const o=fa.getQueryData(yo.decofile(pa))?.[g];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const l={...o,...hs.current};return hs.current={},t?.raw!==void 0?{...l,seo:t.raw}:t?.inner!==void 0?qr(s,a,l,t.inner):l})},Zs=(t,s)=>{g&&(hs.current[t]=s,js())},Ta=(t,s)=>{if(!g)return;const a=ds([...K],t,s);m!==null&&(m===t?M(s):t<m&&s>=m?M(m-1):t>m&&s<=m&&M(m+1)),Je(a)},Na=t=>{if(!g)return;const s=K.filter((a,o)=>o!==t);m===t?Pt():m!==null&&m>t&&M(m-1),Je(s)},Aa=t=>{if(!g)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,cr(s)),m!==null&&m>t&&M(m+1),Je(a)},Ma=t=>{if(!g)return;const s=K[t],a=ye[t];if(!s||!a)return;const o=a.isHidden?ir(s):lr(s);if(!o)return;const l=[...K];l[t]=o,m===t&&Pt(),Je(l)},Pa=t=>{if(!g)return;const s=K[t],a=ye[t];if(!s||!a||a.isMultivariate)return;const o=rr(s);if(!o)return;const l=[...K];l[t]=o,m===t&&Pt(),Je(l)},Ca=t=>{if(!g)return;const s=K[t],a=ye[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,c);if(!o?.data)return;const{name:l,...f}=o.data,d=[...K];a.isLazy?d[t]={...s,section:f}:d[t]=f,m===t&&Pt(),Je(d)},Da=t=>{if(!g)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{ge(!1),M(a),We(0),A([]),H(d=>d+1);const o=s[a],l=rs(s,c)[a];if(!o||!l)return;if(l.isMultivariate){ft(o,l,0);return}const f=kt(o,l,c);if(!f){F(null),z(null),Ie(null),Ce(null);return}F(f.data),z(f.resolveType),Ie(null),Ce(null)}})},Xs=t=>{ve.current=t.append,ge(!0)},Ka=t=>{const s=ve.current;if(!s){Da(t);return}s({__resolveType:t.resolveType}),ge(!1),ve.current=null},en=t=>{if(m===null)return;const s=K[m],a=ye[m];!s||!a?.isMultivariate||(We(t),A([]),H(o=>o+1),ft(s,a,t,m,!0))},Ba=t=>{if(m===null||!g)return;const s=K[m],a=ye[m];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const l=ar(o,t);if(!l){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const f=[...K];f[m]=wt(s,a,l);const d=l.variants;let x=Fe;t===Fe?x=Math.min(t,d.length-1):t<Fe&&(x=Fe-1),We(x),A([]),H(V=>V+1),ft(f[m],a,x),Je(f)},La=t=>{if(m===null||!g)return;const s=K[m],a=ye[m];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const l=or(o,t),f=[...K];f[m]=wt(s,a,l);const d=t+1;We(d),A([]),H(x=>x+1),ft(f[m],a,d),Je(f)},Fa=(t,s)=>{if(m===null||!g||t===s)return;const a=K[m],o=ye[m];if(!a||!o?.isMultivariate)return;const l=tt(a,o);if(!l)return;const f=sr(l,t,s),d=[...K];d[m]=wt(a,o,f);let x=Fe;Fe===t?x=s:t<Fe&&s>=Fe?x=Fe-1:t>Fe&&s<=Fe&&(x=Fe+1),We(x),ft(d[m],o,x),Je(d)},Ht=t=>{const s=t??m;if(s===null||!g)return;const a=K[s],o=ye[s];if(!a||!o)return;const l=Zo(a,o);if(!l){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const f=[...K];f[s]=l.section;const d=rs(f,c)[s];if(!d?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),We(l.newVariantIndex),A([]),H(x=>x+1),ft(l.section,d,l.newVariantIndex,s),Je(f)},tn=()=>{if(m===null||!g)return;const t=K[m],s=ye[m];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=nr(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const l=[...K];l[m]=o;const f=rs(l,c)[m];if(!f)return;We(0),Ie(null),Ce(null),A([]),H(x=>x+1);const d=kt(o,f,c);d?(F(d.data),z(d.resolveType)):(F(null),z(null)),Mt(null,m,0),Je(l)},Ia=async t=>{if(le===null||!g)return;const s=us(t,c);if(s){N.error(s);return}const a=K[le],o=ye[le];if(!a||!o)return;const l=kt(a,o,c);if(!l){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const f={...l.data,name:t};try{await q.mutateAsync({blockKey:t,data:f});const d=[...K];d[le]={__resolveType:t},await q.mutateAsync({blockKey:g,data:Wt(c,g,d,ee,ce)}),m===le&&Pt(),_e(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(d){N.error(d instanceof Error?d.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},sn=He?.rule;if(Xe&&m===null&&re===null&&sn){const{resolveType:t,formValue:s}=qt(sn,c??{},i??void 0);Ne(t),oe(s)}const Ct=i?zo(i):[],Es=i&&c?$o(i,c):[],nn=!Y&&!!(xe&&i&&c),an=re&&i?ls(re,i):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(fr(s,t,i)>0))try{await Xt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},on=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=$e.current;if(!s)return;const l={...a[s]},f={...l.sections},d=[...f.variants??[]],x=d[o],V=x?.rule;if(Rt(V,a,i)){const v=V?.__resolveType??"",_=a[v],E=typeof _?.name=="string"?_.name:v,{__resolveType:W,...C}=t;q.mutate({blockKey:v,data:xt(W??"",C,E)},{onSuccess:()=>b?.(),onError:L=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:L.message}))});return}x&&(d[o]={...x,rule:t}),l.sections={...f,variants:d},q.mutate({blockKey:s,data:l},{onSuccess:()=>b?.(),onError:v=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:v.message}))})},Ps)},rn=t=>{Ne(t);const s=t?qn(t,i):{__resolveType:Qn};oe(t?s:{}),on(s)},ln=t=>{const s=t;oe(s);const a=re?{__resolveType:re,...s}:{...s};on(a)},cn=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=$e.current;if(!s)return;const l=a[s],f=l?.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const d=f;if(!Array.isArray(d.variants))return;const x=[...d.variants],V=x[o];if(!V)return;const v=bt(V.rule,a,i),_=Lt(t);x[o]={...V,rule:_};const E={...a,[s]:{...l,sections:{...d,variants:x}}},{resolveType:W,formValue:C}=qt(_,E,i??void 0);Ne(W),oe(C);try{await q.mutateAsync({blockKey:s,data:E[s]}),v&&v!==t&&await Et(v,E),b?.()}catch(L){N.error(L instanceof Error?L.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},un=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=$e.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:l,decofile:f,activePageKey:d,pageVariants:x,variantIndex:V}=$e.current;if(!d)return;const v=o[s],_=l[s];if(!v||!_?.isMultivariate)return;const E=tt(v,_);if(!E)return;const C=(E.variants??[])[a]?.rule;if(Rt(C,f,i)){const Z=C?.__resolveType??"",Ye=f[Z],rt=typeof Ye?.name=="string"?Ye.name:Z,{__resolveType:St,...it}=t;q.mutate({blockKey:Z,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const L=Un(E,a,t),ue=[...o];ue[s]=wt(v,_,L);const et=Wt(f,d,ue,V,x);q.mutate({blockKey:d,data:et},{onSuccess:()=>b?.(),onError:Z=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:Z.message}))})},Ps))},Oa=t=>{Ie(t);const s=t?qn(t,i):{__resolveType:Qn};Ce(t?s:{}),un(s)},za=t=>{const s=t;Ce(s);const a=Tt?{__resolveType:Tt,...s}:{...s};un(a)},$a=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:l,decofile:f,activePageKey:d,pageVariants:x,variantIndex:V}=$e.current;if(s===null||!d)return;const v=o[s],_=l[s];if(!v||!_?.isMultivariate)return;const E=tt(v,_);if(!E)return;const W=E.variants??[],C=bt(W[a]?.rule,f,i),L=Lt(t),ue=Un(E,a,L),et=[...o];et[s]=wt(v,_,ue);const Z=Wt(f,d,et,V,x),Ye={...f,[d]:Z},{resolveType:rt,formValue:St}=qt(L,Ye,i??void 0);Ie(rt),Ce(St);try{await q.mutateAsync({blockKey:d,data:Z}),C&&C!==t&&await Et(C,Ye),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Y&&!X)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(Y&&!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 be=m!==null?ye[m]??null:null,dn=m!==null?K[m]:null,mn=dn&&be?.isMultivariate?tt(dn,be):null,ht=mn?Bn(mn,lt):[],ss=Math.min(Fe,Math.max(ht.length-1,0)),Dt=ht[ss]??null,gt=be?.isMultivariate===!0,ks=m!==null&&be!==null,vt=ks&&(gt||!!(_s&&qe)),Ha=vt&&!Y&&be?.isSavedBlock===!0,Qe=Y||Ha,fn=Y?qs:be?.label??"",Ga=Tt&&i?ls(Tt,i):null,pn=(t,s)=>s&&G?`${t} · ${s}`:t,hn=be?be.variantOf??be.label:"",qa=(()=>{const t=gt&&Dt?Dt.label:null;return t?G?[pn(hn,t)]:[be.label,t]:[be?.label??""]})(),ws=pn(X?.name??"",Xe?He?.label:null),ns=vt&&(!Y||B.length>0)?Y?[qs,...B]:[ws,...qa,...B]:[],gn=D&&X?[X.name,"SEO",...zs]:[],vn=r("sectionsEditor.pageVariantTabs.variantsLabel"),Sn=P&&X?[X.name,vn]:Pe&&X&&be?[ws,hn,vn]:[],as=Sn.length>0?Sn:gn.length>0?gn:Qe?ns.length>0?ns:[fn]:ns.length>0?ns:[ws],yn=ks&&!gt&&!be?.isHidden&&!!g,Ua=Qe||!Y&&Xe&&!!He||yn,Wa=ks&&!gt&&!Y&&B.length===0&&!!be&&aa(be)&&!!g,Ja=G&&vt&&!Pe&&gt&&B.length===0&&!!Dt,bn=G&&B.length>0?Ln(B[B.length-1]):null,Qa=B.length>1?Ln(B[B.length-2]):null,xn=Qe?fn:vt?be?.label??"":X?.name??"",Ya=P||Pe?r("sectionsEditor.pageVariantTabs.variantsLabel"):D?r("sectionsEditor.panelSections.seo"):bn??xn,_n=Pe?be?.variantOf??be?.label??"":P||D?X?.name??"":bn?Qa??xn:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?X?.name??"":X?.path??"",Rs=!P&&!Pe&&!D&&!vt&&!Qe,Za=!G&&!D&&!Y&&gt&&B.length===0,Gt=()=>{if(!g)return;pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const t=c[g],s=Xo(t.sections,K);if(!s)return;const a=er(s);q.mutate({blockKey:g,data:{...t,sections:s}},{onSuccess:()=>{me(a),M(null),F(null),z(null),A([]),oe(null),Ne(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],l=o.sections;if(!l||typeof l!="object"||Array.isArray(l))return;const f=l;if(!Array.isArray(f.variants))return;const d=t([...f.variants]);if(!d)return;const x=mr(f,d),V={...c,[g]:{...o,sections:x}};q.mutate({blockKey:g,data:V[g]},{onSuccess:()=>{s?.();const v=typeof a=="string"?[a]:a??[];(async()=>{for(const _ of v)await Et(_,V)})()},onError:v=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:v.message}))})},Vs=t=>{te(null),me(t),M(null),F(null),z(null),A([]);const s=ce[t]?.rule,{resolveType:a,formValue:o}=qt(s,c??{},i??void 0);Ne(a),oe(o),bs(ce.map(l=>({rule:l.rule})),t)},jn=(t,s)=>{if(t===s)return;let a=ee;ee===t?a=s:t<ee&&s>=ee?a=ee-1:t>ee&&s<=ee&&(a=ee+1),me(a);const o=ds(ce.map(l=>({rule:l.rule})),t,s);bs(o,a),os(l=>ds(l,t,s))},En=t=>{const s=ce[t]?.rule,a=bt(s,c??{},i??void 0);os(o=>o.length<=1?null:(o.splice(t,1),o),()=>{ce.length-1===1?me(0):t<ee?me(ee-1):t===ee&&me(Math.max(0,t-1)),M(null),F(null),z(null),A([]),oe(null),Ne(null)},a)},Xa=()=>{const t=ce.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!dr(s.rule)).map(({variant:s})=>bt(s.rule,c??{},i??void 0)).filter(s=>!!s);os(s=>{const a=gr({variants:s}),o=s[a];return o?[{...o,rule:Nr()}]:null},()=>{me(0),M(null),F(null),z(null),A([]),oe(null),Ne(null),st(!1)},t)},kn=t=>{os(s=>vr(s,t),()=>{me(t+1),M(null),F(null),z(null),A([]),oe(null),Ne(null)})},eo=async(t,s)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const a=$e.current.activePageKey,o=$e.current.decofile;if(!a)return;const l=o[a],f=l.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const d=f;if(!Array.isArray(d.variants))return;const x=[...d.variants],V=x[t];if(!V?.rule||typeof V.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const v=V.rule,_=s.trim();At(!0);try{if(!_){if(!Rt(v,o,i)){te(null);return}const et=v.__resolveType??"";x[t]={...V,rule:Ds(v,o,i)};const Z={...o,[a]:{...l,sections:{...d,variants:x}}};await q.mutateAsync({blockKey:a,data:Z[a]}),await Et(et,Z),te(null),b?.();return}const E=Ks(v,o,i);if(!E){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await q.mutateAsync({blockKey:E.blockKey,data:xt(E.resolveType,E.data,_)}),te(null),b?.();return}const W=cs(_),C=us(W,o);if(C){N.error(C);return}const L=xt(E.resolveType,E.data,_);let ue=null;try{await q.mutateAsync({blockKey:W,data:L}),ue=W,x[t]={...V,rule:Lt(W)},await q.mutateAsync({blockKey:a,data:{...l,sections:{...d,variants:x}}}),ue=null}catch(et){throw ue&&await Xt.mutateAsync({blockKey:ue}).catch(()=>{}),et}te(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:_})),b?.()}catch(E){N.error(E instanceof Error?E.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},to=async(t,s)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:l,decofile:f,activePageKey:d,pageVariants:x,variantIndex:V}=$e.current;if(a===null||!d)return;const v=o[a],_=l[a];if(!v||!_?.isMultivariate)return;const E=tt(v,_);if(!E)return;const W=E.variants??[],C=W[t];if(!C?.rule||typeof C.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const L=C.rule,ue=s.trim();At(!0);const et=async Z=>{const Ye={...E,variants:Z},rt=[...o];rt[a]=wt(v,_,Ye);const St=Wt(f,d,rt,V,x);return await q.mutateAsync({blockKey:d,data:St}),{...f,[d]:St}};try{if(!ue){if(!Rt(L,f,i)){se(null);return}const yt=L.__resolveType??"",Cn=[...W];Cn[t]={...C,rule:Ds(L,f,i)};const mo=await et(Cn);await Et(yt,mo),se(null),b?.();return}const Z=Ks(L,f,i);if(!Z){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Z.blockKey){await q.mutateAsync({blockKey:Z.blockKey,data:xt(Z.resolveType,Z.data,ue)}),se(null),b?.();return}const Ye=cs(ue),rt=us(Ye,f);if(rt){N.error(rt);return}const St=xt(Z.resolveType,Z.data,ue);let it=null;try{await q.mutateAsync({blockKey:Ye,data:St}),it=Ye;const yt=[...W];yt[t]={...C,rule:Lt(Ye)},await et(yt),it=null}catch(yt){throw it&&await Xt.mutateAsync({blockKey:it}).catch(()=>{}),yt}se(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),b?.()}catch(Z){N.error(Z instanceof Error?Z.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},so={rename:async(t,s,a)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{activePageKey:o,decofile:l}=$e.current;if(!o)return;const f=Array.isArray(t.variants)?[...t.variants]:[],d=f[s],x=d?.rule&&typeof d.rule=="object"?d.rule:void 0,V=async _=>{const E={...t,variants:_};return await q.mutateAsync({blockKey:o,data:E}),{...l,[o]:E}},v=fi(x,a,l,i);if(v.kind!=="noop"){if(v.kind==="error"){N.error(v.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):v.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):v.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(v.kind==="inline"){const E=[...f];E[s]={...d,rule:v.inlinedRule};const W=await V(E);await Et(v.blockKey,W),b?.();return}if(v.kind==="updateBlock"){await q.mutateAsync({blockKey:v.blockKey,data:v.blockData}),b?.();return}let _=null;try{await q.mutateAsync({blockKey:v.blockId,data:v.blockData}),_=v.blockId;const E=[...f];E[s]={...d,rule:v.reference},await V(E),_=null}catch(E){throw _&&await Xt.mutateAsync({blockKey:_}).catch(()=>{}),E}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(_){N.error(_ instanceof Error?_.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:l}=$e.current;if(!o)return;const f=Array.isArray(t.variants)?[...t.variants]:[],d=f[s];if(!d)return;const x=bt(d.rule,l,i);f[s]={...d,rule:Lt(a)};const V={...t,variants:f},v={...l,[o]:V};try{await q.mutateAsync({blockKey:o,data:V}),x&&x!==a&&await Et(x,v),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},wn=()=>{Pt()},Rn=t=>{Yt(t),js({inner:t})},Vn=t=>{ps(t),js({raw:t})},Tn=()=>{Yt(null),jt([])},Nn=()=>Ft(t=>t+1),An=()=>{Zt.flush(),Le(!1),Yt(null),ps(void 0),jt([]),Ft(t=>t+1),de?.()},no=()=>{st(!1),I(!1),M(null),Le(!0)},ao=()=>{D&&An(),M(null),st(!0)},oo=()=>I(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Pe&&t<2){I(!1),t===0&&M(null);return}if(D){if(t===0){An();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Y){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){wn();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(ur(as.length,{isMultivariateSectionTop:Za})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:ne("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(_r,{className:"size-4"})}):null,ro=Qe||vt||D?Ua&&n.jsxs("div",{className:ne("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:[!Y&&Xe&&He&&n.jsxs("button",{type:"button",onClick:wn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:He.label}),className:ne("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",Go),children:[n.jsx(Ho,{rule:As(He.rule,c??{},i??void 0),matchers:Ct}),n.jsx("span",{className:"max-w-[160px] truncate",children:He.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")})]}),yn&&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(Fn,{pageKey:g,initialName:X.name,initialPath:X.path,onFieldChange:Zs,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:()=>Le(!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:()=>Ke&&g?Ke():je(!0),children:n.jsx(Jn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(is,{onClick:Gt})]}),io=n.jsxs(n.Fragment,{children:[Xe&&g&&n.jsx(In,{listKey:g,variants:ce,activeIndex:ee,decofile:c??{},meta:i,matchers:Ct,onSelect:Vs,onReorder:jn,onRename:te,onDuplicate:kn,onDelete:En,onAdd:Gt}),Xe&&re!==null&&n.jsx(On,{className:"mt-3",children:n.jsx("div",{className:ne("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Ms,{currentRt:re,currentLabel:Ut(He?.rule,c??{},lt,i??void 0),currentGlobalKey:bt(He?.rule,c??{},i??void 0)??void 0,matchers:Ct,globals:Es,onSelect:rn,onSelectGlobal:cn,schema:an,formValue:Be,onChange:ln,formKey:`${ee}:${re??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})})]}),Mn=n.jsxs(n.Fragment,{children:[n.jsx(qo,{listKey:`${g??""}:${m??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ss,onSelect:en,onRename:se,onDuplicate:La,onDelete:Ba,onRemoveAll:tn,onReorder:Fa,onAdd:()=>Ht()}),n.jsx(On,{children:n.jsx(Ms,{currentRt:Tt??"",currentLabel:Ut(Dt?.rule,c??{},lt,i??void 0),currentGlobalKey:bt(Dt?.rule,c??{},i??void 0)??void 0,matchers:Ct,globals:Es,onSelect:Oa,onSelectGlobal:$a,schema:Ga,formValue:ma,onChange:za,formKey:`${m??"none"}:${ss}:${Tt??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Pn=n.jsx("div",{className:ne(G?"px-2":"p-2 pt-3"),children:n.jsx(di,{listKey:`${g??""}-${ee}`,rawSections:K,sections:ye,meta:i,decofile:c,selectedIndex:m,onSelect:Va,onReorder:Ta,onDelete:Na,onDuplicate:Aa,onMakeReusable:_e,onToggleHidden:Ma,onToggleLazy:Pa,onAddVariant:Ht,onDetach:Ca,onAddSection:()=>ge(!0),canAddSection:nn})}),lo=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[g&&X&&n.jsx(Fn,{pageKey:g,initialName:X.name,initialPath:X.path,onFieldChange:Zs}),Ot&&g?n.jsx(ea,{rawSeo:es,innerSeo:Ss,defaultResolveType:Ws,seoSchema:Js,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Vn,onInnerChange:Rn,onClearForm:Tn,onBumpFormKey:Nn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),co=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(ea,{rawSeo:es,innerSeo:Ss,defaultResolveType:Ws,seoSchema:Js,activeResolveType:ts,seoTypeOptions:Us,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Vn,onInnerChange:Rn,onClearForm:Tn,onBumpFormKey:Nn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),uo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Xe&&g&&n.jsx(In,{listKey:g,variants:ce,activeIndex:ee,decofile:c??{},meta:i,matchers:Ct,onSelect:Vs,onReorder:jn,onRename:te,onDuplicate:kn,onDelete:En,onAdd:Gt}),Xe&&re!==null&&n.jsxs("div",{className:ne("px-3 border-b",Se?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ze(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":Se,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),Se?n.jsx(yr,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(br,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Se&&n.jsx("div",{className:ne("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Ms,{currentRt:re,currentLabel:Ut(He?.rule,c??{},lt,i??void 0),currentGlobalKey:bt(He?.rule,c??{},i??void 0)??void 0,matchers:Ct,globals:Es,onSelect:rn,onSelectGlobal:cn,schema:an,formValue:Be,onChange:ln,formKey:`${ee}:${re??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:c,onSaveReferencedBlock:It,sandbox:$t})})]}),Pn]},"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(Wo,{crumbs:as,onSelect:Ts,onSelectRoot:()=>{Zt.flush(),De?De():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:ne("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:Ya}),_n&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:_n})]}),Rs&&Xe&&He&&n.jsx(zn,{variants:ce,activeIndex:ee,onSelect:Vs,onManage:ao,onRemoveAll:Xa}),Ja&&n.jsx(zn,{variants:ht,activeIndex:ss,onSelect:en,onManage:oo,onRemoveAll:tn}),Rs&&!Xe&&n.jsx(is,{onClick:Gt}),Wa&&n.jsx(is,{onClick:()=>Ht()}),n.jsx(Jo,{}),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:no,children:n.jsx(Wn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Ke&&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:()=>je(!0),children:n.jsx(Jn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):ro}),Pe?n.jsx($n,{onAdd:()=>Ht(),children:Mn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ie,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&&gt&&ht.length>0&&B.length===0&&Mn,n.jsx(Hn,{activeSchema:_s,formValue:qe,formResetKey:we,onFormChange:Ys,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:xe,onRequestAddSection:Xs})]},"editor-section-form"):Y?n.jsx(Bt,{viewportRef:ie,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Hn,{activeSchema:_s,formValue:qe,formResetKey:we,onFormChange:Ys,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:c,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:xe,onRequestAddSection:Xs,onVariantMatcherOp:so})},"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:lo})},"editor-seo"):co:P?n.jsx($n,{onAdd:Gt,children:io},"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:Pn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:nn,onAddSection:()=>ge(!0)})})]},"editor-section-list"):uo,n.jsx(Qo,{open:le!==null,onOpenChange:t=>{t||_e(null)},defaultBlockId:le!==null?cs(ye[le]?.label??""):"",isPending:q.isPending,onSubmit:Ia}),xe&&n.jsx(Wr,{open:Me,onOpenChange:t=>{ge(t),t||(ve.current=null)},meta:i,decofile:c,previewBaseUrl:xe,onSelect:Ka}),Re&&g&&c&&n.jsx(kr,{open:Re,onOpenChange:je,pageKey:g,decofile:c}),fe!==null&&n.jsx(Gn,{open:!0,initialName:Rt(ce[fe]?.rule,c??{},i??void 0)?Ut(ce[fe]?.rule,c??{},lt,i??void 0):"",autoLabel:lt(As(ce[fe]?.rule,c??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await eo(fe,t)},onOpenChange:t=>{!t&&!Nt&&te(null)}}),pe!==null&&n.jsx(Gn,{open:!0,initialName:Rt(ht[pe]?.rule,c??{},i??void 0)?Ut(ht[pe]?.rule,c??{},lt,i??void 0):"",autoLabel:lt(As(ht[pe]?.rule,c??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await to(pe,t)},onOpenChange:t=>{!t&&!Nt&&se(null)}})]})})}export{Ic as SectionsEditor};
@@ -0,0 +1 @@
1
+ import{r as d,bp as L,bq as Ie,j as c,br as j,bs as P,bt as rt,bu as $,bv as st,aQ as Ee,bw as lt,bx as Ne,by as at,bz as it,bA as Re,bB as ct,bC as dt,bD as ut,bE as pt,bF as ft,bG as mt,bH as ht,bI as vt,bJ as gt,bK as xt,bL as St,c as ee,l as oe}from"./index-CyBVTyGa.js";import{V as wt}from"./index-DtBnPwzh.js";import{i as yt}from"./Check-DL_AGZMy.js";import{t as je,n as Ct}from"./ChevronUp-B6mY-MC1.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=lt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:a,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:i,caller:J}),k=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(at,{...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:k,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=L(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(rt,{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",Le=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=L(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})});Le.displayName=De;var Et="SelectIcon",ke=d.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return c.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Et;var Rt="SelectPortal",Be=r=>c.jsx(st,{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),_=L(e,f=>F(f)),[O,U]=d.useState(null),[q,k]=d.useState(null),B=ue(t),[W,V]=d.useState(!1),H=d.useRef(!1);d.useEffect(()=>{if(x)return dt(x)},[x]),ut();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)&&k(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(pt,{as:Mt,allowPinchZoom:!0,children:c.jsx(ft,{asChild:!0,trapped:h.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{h.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:c.jsx(mt,{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=L(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 k=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=k.length>0&&v===k[k.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=k.length>0&&v===k[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=L(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",[Lt,kt]=ne(We),Bt=d.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Ie();return c.jsx(Lt,{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=kt(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=L(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=L(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=L(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=L(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=L(o,n),s=ht(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=ct(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=Le,qt=ke,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-doEaURqC.js";import{a as J,d as K,b as Q,D as U}from"./dialog-C36x61_J.js";import{c as V,b as W,a as X,D as Y}from"./drawer-CsJzOKcM.js";import{u as Z}from"./use-mobile-DYpKQ1eP.js";import{c as ee}from"./chat-context-D1GbDSrr.js";import{S as F,M as se}from"./decopilot-YckYKTsg.js";import{M as le,a as oe}from"./index-B7z_63F4.js";function he(L){const e=$.c(48),{variant:t,className:o,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:v,filterModels:E}=L,z=t===void 0?"borderless":t,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]!==o||e[1]!==_?(d=G("text-sm hover:bg-accent classic:rounded-lg 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",_,o),e[0]=o,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??te,selectedModel:l??null,onModelChange:v,filterModels:E}):s.jsx(oe,{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 te(){}function ne(L){const e=$.c(4),{placeholder:t}=L,{selectedModel:o,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==o||e[2]!==t?(l=s.jsx(F,{model:o,placeholder:t,isLoading:n}),e[0]=n,e[1]=o,e[2]=t,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-CyBVTyGa.js";import{a as J,d as K,b as Q,D as U}from"./dialog-BG6kEGFR.js";import{c as V,b as W,a as X,D as Y}from"./drawer-Bl-PPIzX.js";import{u as Z}from"./use-mobile-CUQu4L8c.js";import{c as ee}from"./chat-context-HOmU0YHH.js";import{S as F,M as se}from"./decopilot-B7-O9fZC.js";import{M as le,a as oe}from"./index-B8ZawsDP.js";function he(L){const e=$.c(48),{variant:t,className:o,placeholder:n,model:l,isLoading:I,credentialId:P,onCredentialChange:k,onModelChange:v,filterModels:E}=L,z=t===void 0?"borderless":t,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]!==o||e[1]!==_?(d=G("text-sm hover:bg-accent classic:rounded-lg 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",_,o),e[0]=o,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??te,selectedModel:l??null,onModelChange:v,filterModels:E}):s.jsx(oe,{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 te(){}function ne(L){const e=$.c(4),{placeholder:t}=L,{selectedModel:o,isModelsLoading:n}=ee();let l;return e[0]!==n||e[1]!==o||e[2]!==t?(l=s.jsx(F,{model:o,placeholder:t,isLoading:n}),e[0]=n,e[1]=o,e[2]=t,e[3]=l):l=e[3],l}export{he as M};
@@ -0,0 +1 @@
1
+ import{c as T,b as ve,j as o,r as ee,am as je,B as Se,h as ke}from"./index-CyBVTyGa.js";import{P as fe}from"./agent-icon-CSebdE0g.js";import{S as ue}from"./scroll-area-CmvmQLS1.js";import{K as xe,a2 as Ne,a3 as we,a5 as _e,a4 as Ee,a6 as Pe,aW as Te}from"./runnable-block-editor-DrtKYS1k.js";import{r as Fe}from"./claim-phase-copy-njXeDF0h.js";import{u as Re,a as Ce,P as Ke}from"./page-seo-form-BML1eDhR.js";import{a as ye}from"./Image01-CkJtDP-I.js";import"./AlertCircle-CVkVxygv.js";import"./Tool01-BvNT4KDI.js";import"./ArrowUp-bOLRJZuX.js";import"./ArrowLeft-CN6aZBvX.js";import"./ArrowRight-FqJnNh3f.js";import"./XCircle-BuDwhQqF.js";import"./ZoomOut-q6Y0RhlM.js";import"./Globe04-_nV993le.js";import"./CheckCircle-DtMp-qqq.js";import"./Check-DL_AGZMy.js";import"./ChevronUp-B6mY-MC1.js";import"./UserSquare-CZakdYWe.js";import"./Copy01-6lOOhJcp.js";import"./CreditCard01-DdYfDHIS.js";import"./DotsVertical-CAjUqtRp.js";import"./Download01-Dq8Pn8XY.js";import"./Eye-B5e-ilzV.js";import"./Share07-B2WnpDWD.js";import"./XClose-D_JLFZFT.js";import"./Key01-BCuGindq.js";import"./LayoutLeft-U0F-Da_p.js";import"./Link01-BjTxU_bP.js";import"./LinkExternal01-DSUCZUJp.js";import"./Monitor01-r707obGd.js";import"./Sun-BKxdX8hu.js";import"./Package-D2jMN__x.js";import"./Palette-DebiHmrq.js";import"./Plus-BbELO07z.js";import"./SearchLg-C9MObDBB.js";import"./SearchMd-B1Foybfh.js";import"./Stars01-DUL2jKUJ.js";import"./Trash01-BLoRPhD3.js";import"./Upload01-CNb1qfRO.js";import"./User01-U5CIC-GP.js";import"./Users01-C6BprSkC.js";import"./X-BNszojyh.js";import"./Zap-BCwjglMw.js";import"./select-CDhEibGy.js";import"./index-DtBnPwzh.js";import"./use-session-runtime-DiG_Qt8i.js";import"./thread-intent-jq9HKW3p.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-HOmU0YHH.js";import"./use-panel-navigate-Bg-MVKv6.js";import"./thread-route-JcpQ-ikA.js";import"./use-project-scope-CRdwBUT7.js";import"./use-virtual-mcp-Vg_Ogz61.js";import"./use-mcp-client-CqKNXJW7.js";import"./auth-B-OXMWGw.js";import"./github-repo-BknN0SVI.js";import"./autosend-pQ9pD2-2.js";import"./hooks-lZSCdRwc.js";import"./backoff-8mStPHYB.js";import"./task-board-Qj-6Ctqf.js";import"./schema-DSsDEA1v.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-D6f3xZaU.js";import"./use-ai-providers-ShRDl02e.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DF_mJ7FX.js";import"./use-organization-settings-4gJ9Tp49.js";import"./decofile-api-CWaaGMA2.js";import"./utils-Bf0RpmgB.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CIltybgP.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BpIxv8-d.js";import"./use-copy-CPOYPvBF.js";import"./usage-stats-Bug-9_EL.js";import"./markdown-DCPDulUN.js";import"./dialog-BG6kEGFR.js";import"./org-file-open-context-Bh_zBQ2O.js";import"./use-mobile-CUQu4L8c.js";import"./tooltip-BjUMPvkB.js";import"./shell-layout-B3x_9fo1.js";import"./avatar-GIuLZx2C.js";import"./download-app-dialog-NqW4PLAx.js";import"./command-ByUEKQB9.js";import"./index-CR8U3UFH.js";import"./integration-icon-mTqkOE6y.js";import"./project-icon-DWnsLAeJ.js";import"./required-auth-layout-BgLvQHTP.js";import"./use-org-sso-CI1_4UQM.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DBdofBbE.js";import"./types-Bxr6Ak0g.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-DiyAsoDf.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./sheet-DH_REC9j.js";import"./use-connection-WQuJ5yl_.js";import"./use-navigate-to-agent-W6hb3mqs.js";import"./use-mcp-prompts-DpED8Vrg.js";import"./index-DmF8NlWI.js";import"./form-Bx8qGby0.js";import"./label-DVhvlWqs.js";import"./input-D5Zi_pUc.js";import"./use-thread-outputs-C9_GjCjS.js";import"./file-type-icon-Cbv1Det1.js";import"./popover-CUdTfYte.js";import"./monaco-editor-tpWF7AL5.js";import"./editor-BiwQpn1s.js";import"./calendar-D4hMMrVq.js";import"./textarea-TE2JJa-B.js";import"./rich-text-link-control-0ZhNexVb.js";import"./switch-C7dIR4UF.js";import"./combobox-OP-CbRFf.js";import"./alert-dialog-DeRt3vSN.js";import"./search-input-0hd-PWUF.js";import"./tabs-D6s_HA-y.js";import"./use-debounced-value-DHN-wkc6.js";import"./use-file-configs-Cd7oj9Fw.js";import"./asset-utils-BS06OXCA.js";import"./useInfiniteQuery-DebjMHv1.js";import"./infiniteQueryObserver-COZ-9XSO.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-Dv_lnjT7.js";import"./sandbox-git-api-B1R0585s.js";function A(d){return typeof d=="string"&&d.trim()?d:void 0}function he(d,e){if(d){if(e)try{const t=new URL(d,e).href;return xe(t)}catch{return}return xe(d)}}function ze(d){if(!d)return{};const e=A(d.title),t=A(d.titleTemplate);return{title:e&&t?.includes("%s")?t.replace(/%s/g,e):e,description:A(d.description),image:A(d.image),favicon:A(d.favicon)}}function De(d){if(!d)return"example.com";try{return new URL(d).host}catch{return"example.com"}}const $e=[{id:"google",labelKey:"sectionsEditor.seoPreview.platformGoogle",color:"#4285F4",layout:"search"},{id:"facebook",labelKey:"sectionsEditor.seoPreview.platformFacebook",color:"#1877F2",layout:"card"},{id:"twitter",labelKey:"sectionsEditor.seoPreview.platformTwitter",color:"#0f1419",layout:"card"},{id:"linkedin",labelKey:"sectionsEditor.seoPreview.platformLinkedin",color:"#0A66C2",layout:"card"},{id:"whatsapp",labelKey:"sectionsEditor.seoPreview.platformWhatsapp",color:"#25D366",layout:"chat"},{id:"telegram",labelKey:"sectionsEditor.seoPreview.platformTelegram",color:"#229ED9",layout:"chat"},{id:"slack",labelKey:"sectionsEditor.seoPreview.platformSlack",color:"#611f69",layout:"attachment"},{id:"discord",labelKey:"sectionsEditor.seoPreview.platformDiscord",color:"#5865F2",layout:"attachment"}];function de(d){const e=T.c(10),{src:t,className:c,iconSize:v}=d,r=v===void 0?20:v;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={objectFit:"cover"},e[0]=m):m=e[0];let p;return e[1]!==c||e[2]!==t?(p=o.jsx("img",{src:t,alt:"",referrerPolicy:"no-referrer",className:c,style:m}),e[1]=c,e[2]=t,e[3]=p):p=e[3],p}let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s={display:"flex",alignItems:"center",justifyContent:"center",background:"#e5e7eb",color:"#9ca3af"},e[4]=s):s=e[4];let i;e[5]!==r?(i=o.jsx(ye,{size:r}),e[5]=r,e[6]=i):i=e[6];let n;return e[7]!==c||e[8]!==i?(n=o.jsx("div",{className:c,style:s,children:i}),e[7]=c,e[8]=i,e[9]=n):n=e[9],n}function Ie(d){const e=T.c(33),{seo:t,host:c,path:v,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#fff",border:"1px solid #dadce0"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={background:"#f1f3f4"},e[1]=i):i=e[1];let n;e[2]!==t.favicon?(n=o.jsx("div",{className:"flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full",style:i,children:t.favicon?o.jsx("img",{src:t.favicon,alt:"",className:"size-full object-cover"}):o.jsx(ye,{size:12,color:"#9aa0a6"})}),e[2]=t.favicon,e[3]=n):n=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m={color:"#202124"},e[4]=m):m=e[4];let p;e[5]!==c?(p=o.jsx("div",{className:"truncate text-[13px] leading-tight",style:m,children:c}),e[5]=c,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={color:"#4d5156"},e[7]=f):f=e[7];let l;e[8]!==c||e[9]!==v?(l=o.jsxs("div",{className:"truncate text-[12px] leading-tight",style:f,children:[c,v]}),e[8]=c,e[9]=v,e[10]=l):l=e[10];let a;e[11]!==p||e[12]!==l?(a=o.jsxs("div",{className:"min-w-0",children:[p,l]}),e[11]=p,e[12]=l,e[13]=a):a=e[13];let h;e[14]!==n||e[15]!==a?(h=o.jsxs("div",{className:"flex items-center gap-2",children:[n,a]}),e[14]=n,e[15]=a,e[16]=h):h=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u={color:"#1a0dab"},e[17]=u):u=e[17];let y;e[18]!==t.title||e[19]!==r?(y=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[18]=t.title,e[19]=r,e[20]=y):y=e[20];let x;e[21]!==y?(x=o.jsx("div",{className:"mt-1.5 truncate text-[18px] leading-snug",style:u,children:y}),e[21]=y,e[22]=x):x=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S={color:"#4d5156"},e[23]=S):S=e[23];let g;e[24]!==t.description||e[25]!==r?(g=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[24]=t.description,e[25]=r,e[26]=g):g=e[26];let b;e[27]!==g?(b=o.jsx("div",{className:"mt-0.5 line-clamp-2 text-[13px] leading-snug",style:S,children:g}),e[27]=g,e[28]=b):b=e[28];let j;return e[29]!==x||e[30]!==b||e[31]!==h?(j=o.jsxs("div",{className:"rounded-lg p-3 text-left",style:s,children:[h,x,b]}),e[29]=x,e[30]=b,e[31]=h,e[32]=j):j=e[32],j}function Le(d){const e=T.c(26),{seo:t,host:c,t:v}=d;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={background:"#fff",border:"1px solid #e2e8f0"},e[0]=r):r=e[0];let s;e[1]!==t.image?(s=o.jsx(de,{src:t.image,className:"h-40 w-full"}),e[1]=t.image,e[2]=s):s=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={borderTop:"1px solid #e2e8f0"},e[3]=i):i=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n={color:"#8a9099"},e[4]=n):n=e[4];let m;e[5]!==c?(m=o.jsx("div",{className:"truncate text-[11px]",style:n,children:c}),e[5]=c,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={color:"#1c2024"},e[7]=p):p=e[7];let f;e[8]!==t.title||e[9]!==v?(f=t.title??v("sectionsEditor.seoPreview.fallbackTitle"),e[8]=t.title,e[9]=v,e[10]=f):f=e[10];let l;e[11]!==f?(l=o.jsx("div",{className:"line-clamp-1 text-[14px] font-semibold",style:p,children:f}),e[11]=f,e[12]=l):l=e[12];let a;e[13]===Symbol.for("react.memo_cache_sentinel")?(a={color:"#60666c"},e[13]=a):a=e[13];let h;e[14]!==t.description||e[15]!==v?(h=t.description??v("sectionsEditor.seoPreview.fallbackDescription"),e[14]=t.description,e[15]=v,e[16]=h):h=e[16];let u;e[17]!==h?(u=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:a,children:h}),e[17]=h,e[18]=u):u=e[18];let y;e[19]!==u||e[20]!==m||e[21]!==l?(y=o.jsxs("div",{className:"px-3 py-2",style:i,children:[m,l,u]}),e[19]=u,e[20]=m,e[21]=l,e[22]=y):y=e[22];let x;return e[23]!==y||e[24]!==s?(x=o.jsxs("div",{className:"overflow-hidden rounded-lg text-left",style:r,children:[s,y]}),e[23]=y,e[24]=s,e[25]=x):x=e[25],x}function Be(d){const e=T.c(36),{seo:t,host:c,accent:v,t:r}=d;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={background:"#f0f2f5"},e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={color:"#3b4045"},e[1]=i):i=e[1];let n;e[2]!==r?(n=r("sectionsEditor.seoPreview.chatCardHint"),e[2]=r,e[3]=n):n=e[3];let m;e[4]!==n?(m=o.jsx("p",{className:"px-1 pb-1.5 text-[12px]",style:i,children:n}),e[4]=n,e[5]=m):m=e[5];const p=`3px solid ${v}`;let f;e[6]!==p?(f={background:"#fff",borderLeft:p},e[6]=p,e[7]=f):f=e[7];let l;e[8]!==t.image?(l=o.jsx(de,{src:t.image,className:"h-28 w-full",iconSize:18}),e[8]=t.image,e[9]=l):l=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a={color:"#1c2024"},e[10]=a):a=e[10];let h;e[11]!==t.title||e[12]!==r?(h=t.title??r("sectionsEditor.seoPreview.fallbackTitle"),e[11]=t.title,e[12]=r,e[13]=h):h=e[13];let u;e[14]!==h?(u=o.jsx("div",{className:"line-clamp-1 text-[12px] font-semibold",style:a,children:h}),e[14]=h,e[15]=u):u=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y={color:"#60666c"},e[16]=y):y=e[16];let x;e[17]!==t.description||e[18]!==r?(x=t.description??r("sectionsEditor.seoPreview.fallbackDescription"),e[17]=t.description,e[18]=r,e[19]=x):x=e[19];let S;e[20]!==x?(S=o.jsx("div",{className:"line-clamp-2 text-[11px]",style:y,children:x}),e[20]=x,e[21]=S):S=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g={color:"#8a9099"},e[22]=g):g=e[22];let b;e[23]!==c?(b=o.jsx("div",{className:"mt-0.5 text-[10px]",style:g,children:c}),e[23]=c,e[24]=b):b=e[24];let j;e[25]!==u||e[26]!==S||e[27]!==b?(j=o.jsxs("div",{className:"px-2.5 py-1.5",children:[u,S,b]}),e[25]=u,e[26]=S,e[27]=b,e[28]=j):j=e[28];let k;e[29]!==j||e[30]!==f||e[31]!==l?(k=o.jsxs("div",{className:"overflow-hidden rounded-[var(--studio-surface-radius,var(--radius-md))]",style:f,children:[l,j]}),e[29]=j,e[30]=f,e[31]=l,e[32]=k):k=e[32];let N;return e[33]!==k||e[34]!==m?(N=o.jsxs("div",{className:"rounded-lg p-2 text-left",style:s,children:[m,k]}),e[33]=k,e[34]=m,e[35]=N):N=e[35],N}function Oe(d){const e=T.c(39),{seo:t,host:c,accent:v,dark:r,t:s}=d,i=r?"#2b2d31":"#fff",n=r?"#00a8fc":"#1264a3",m=r?"#dbdee1":"#3b4045",p=r?"#949ba4":"#8a9099",f=r?"none":"1px solid #e2e8f0";let l;e[0]!==i||e[1]!==f?(l={background:i,border:f},e[0]=i,e[1]=f,e[2]=l):l=e[2];const a=`3px solid ${v}`;let h;e[3]!==a?(h={borderLeft:a,borderRadius:2},e[3]=a,e[4]=h):h=e[4];let u;e[5]!==p?(u={color:p},e[5]=p,e[6]=u):u=e[6];let y;e[7]!==c||e[8]!==u?(y=o.jsx("div",{className:"text-[10px]",style:u,children:c}),e[7]=c,e[8]=u,e[9]=y):y=e[9];let x;e[10]!==n?(x={color:n},e[10]=n,e[11]=x):x=e[11];let S;e[12]!==t.title||e[13]!==s?(S=t.title??s("sectionsEditor.seoPreview.fallbackTitle"),e[12]=t.title,e[13]=s,e[14]=S):S=e[14];let g;e[15]!==x||e[16]!==S?(g=o.jsx("div",{className:"line-clamp-1 text-[13px] font-semibold",style:x,children:S}),e[15]=x,e[16]=S,e[17]=g):g=e[17];let b;e[18]!==m?(b={color:m},e[18]=m,e[19]=b):b=e[19];let j;e[20]!==t.description||e[21]!==s?(j=t.description??s("sectionsEditor.seoPreview.fallbackDescription"),e[20]=t.description,e[21]=s,e[22]=j):j=e[22];let k;e[23]!==b||e[24]!==j?(k=o.jsx("div",{className:"line-clamp-2 text-[12px]",style:b,children:j}),e[23]=b,e[24]=j,e[25]=k):k=e[25];let N;e[26]!==k||e[27]!==y||e[28]!==g?(N=o.jsxs("div",{className:"min-w-0 flex-1",children:[y,g,k]}),e[26]=k,e[27]=y,e[28]=g,e[29]=N):N=e[29];let w;e[30]!==t.image?(w=o.jsx(de,{src:t.image,className:"size-14 shrink-0 rounded-[var(--studio-control-radius,var(--radius))]",iconSize:16}),e[30]=t.image,e[31]=w):w=e[31];let _;e[32]!==N||e[33]!==w||e[34]!==h?(_=o.jsxs("div",{className:"flex gap-2.5 pl-2.5",style:h,children:[N,w]}),e[32]=N,e[33]=w,e[34]=h,e[35]=_):_=e[35];let P;return e[36]!==_||e[37]!==l?(P=o.jsx("div",{className:"rounded-lg p-2.5 text-left",style:l,children:_}),e[36]=_,e[37]=l,e[38]=P):P=e[38],P}function Ue(d){const e=T.c(21),{platform:t,seo:c,host:v,path:r,t:s}=d;let i;e[0]!==v||e[1]!==r||e[2]!==t.color||e[3]!==t.id||e[4]!==t.layout||e[5]!==c||e[6]!==s?(i=t.layout==="search"?o.jsx(Ie,{seo:c,host:v,path:r,t:s}):t.layout==="card"?o.jsx(Le,{seo:c,host:v,path:r,t:s}):t.layout==="chat"?o.jsx(Be,{seo:c,host:v,path:r,accent:t.color,t:s}):o.jsx(Oe,{seo:c,host:v,path:r,accent:t.color,dark:t.id==="discord",t:s}),e[0]=v,e[1]=r,e[2]=t.color,e[3]=t.id,e[4]=t.layout,e[5]=c,e[6]=s,e[7]=i):i=e[7];const n=i;let m;e[8]!==t.color?(m=o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{background:t.color}}),e[8]=t.color,e[9]=m):m=e[9];let p;e[10]!==t.labelKey||e[11]!==s?(p=s(t.labelKey),e[10]=t.labelKey,e[11]=s,e[12]=p):p=e[12];let f;e[13]!==p?(f=o.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:p}),e[13]=p,e[14]=f):f=e[14];let l;e[15]!==m||e[16]!==f?(l=o.jsxs("div",{className:"mb-1.5 flex items-center gap-1.5",children:[m,f]}),e[15]=m,e[16]=f,e[17]=l):l=e[17];let a;return e[18]!==n||e[19]!==l?(a=o.jsxs("div",{children:[l,n]}),e[18]=n,e[19]=l,e[20]=a):a=e[20],a}function Ae(d){const e=T.c(18),{seo:t,url:c,path:v}=d,r=v===void 0?"/":v,s=ve();let i,n,m;if(e[0]!==t||e[1]!==c){const x=ze(t);i=x,n=he(x.image,c),m=he(x.favicon,c),e[0]=t,e[1]=c,e[2]=i,e[3]=n,e[4]=m}else i=e[2],n=e[3],m=e[4];let p;e[5]!==i||e[6]!==n||e[7]!==m?(p={...i,image:n,favicon:m},e[5]=i,e[6]=n,e[7]=m,e[8]=p):p=e[8];const f=p;let l;e[9]!==c?(l=De(c),e[9]=c,e[10]=l):l=e[10];const a=l,h=r==="/"?"":r;let u;e[11]!==h||e[12]!==a||e[13]!==s||e[14]!==f?(u=$e.map(x=>o.jsx(Ue,{platform:x,seo:f,host:a,path:h,t:s},x.id)),e[11]=h,e[12]=a,e[13]=s,e[14]=f,e[15]=u):u=e[15];let y;return e[16]!==u?(y=o.jsx("div",{className:"grid grid-cols-1 gap-4 @2xl:grid-cols-2",children:u}),e[16]=u,e[17]=y):y=e[17],y}function ui(d){const e=T.c(70),{orgSlug:t,virtualMcpId:c,branch:v,decofile:r,meta:s,target:i,previewBaseUrl:n,onSaved:m,onEditDefaultSeo:p,onBack:f}=d,l=ve(),a=Ne(r,i,s),h=a?.seoData,u=i.kind==="site"?"site":i.pageKey,[y,x]=ee.useState(u),[S,g]=ee.useState(null),[b,j]=ee.useState(0),[k,N]=ee.useState(void 0);y!==u&&(x(u),g(null),N(void 0),j(Ge));const{persistSeo:w,persistRawSeo:_,flush:P,isPending:te}=Re({orgSlug:t,virtualMcpId:c,branch:v,target:i,resolved:a,onSaved:m}),M=i.kind==="page",ge=M?a?.rawSeoData:void 0,U=k!==void 0?k:ge,be=M?we(U)??void 0:void 0,E=S??be??h??{},F=a?Ce(E,a):null,K=F&&(!M||_e(U))?Fe(F,s):null;let G;e[0]!==s?(G=Ee(s),e[0]=s,e[1]=G):G=e[1];const oe=G;let R,H;e[2]!==r||e[3]!==E||e[4]!==s||e[5]!==i.kind?(R=i.kind==="page"?Pe(r,s)?.seoData??{}:{},H=i.kind==="page"?Ve(R,E):E,e[2]=r,e[3]=E,e[4]=s,e[5]=i.kind,e[6]=R,e[7]=H):(R=e[6],H=e[7]);const ie=H;let V;e[8]!==w||e[9]!==a||e[10]!==g?(V=C=>{if(!a)return;const pe=C;g(pe),w(pe)},e[8]=w,e[9]=a,e[10]=g,e[11]=V):V=e[11];const se=V;let W;e[12]!==g?(W=()=>g(null),e[12]=g,e[13]=W):W=e[13];const le=W;let q;e[14]!==j?(q=()=>j(Me),e[14]=j,e[15]=q):q=e[15];const re=q;let J;e[16]!==P||e[17]!==f?(J=()=>{P(),f?.()},e[16]=P,e[17]=f,e[18]=J):J=e[18];const ae=J,z=i.kind==="page"?i.path:"/";let Q;e[19]!==z||e[20]!==n||e[21]!==i.kind?(Q=i.kind==="page"&&n?He(z,n):n??null,e[19]=z,e[20]=n,e[21]=i.kind,e[22]=Q):Q=e[22];const ce=Q;let X;e[23]!==a||e[24]!==l||e[25]!==i.kind?(X=i.kind==="site"?l("sectionsEditor.seoEditor.noSiteSeoBlock"):l(a?"sectionsEditor.seoEditor.noSeoSchema":"sectionsEditor.seoEditor.couldNotLoadSeo"),e[23]=a,e[24]=l,e[25]=i.kind,e[26]=X):X=e[26];const ne=X,Y=M&&a,me=i.kind==="site"&&a&&K;let D;e[27]!==ae||e[28]!==l||e[29]!==i.kind||e[30]!==i.pageName?(D=i.kind==="page"?o.jsxs("nav",{className:"flex min-w-0 items-center gap-1 text-sm",children:[o.jsx("button",{type:"button",onClick:ae,title:i.pageName,className:"min-w-0 truncate rounded-[var(--studio-control-radius,var(--radius-md))] px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:i.pageName}),o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("span",{className:"px-1 py-0.5 font-medium text-foreground",children:"SEO"})]}):o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(fe,{size:16,className:"shrink-0 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:l("sectionsEditor.seoEditor.defaultSeoLabel")}),o.jsxs("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:["· ",l("sectionsEditor.seoEditor.appliedToEveryPage")]})]}),e[27]=ae,e[28]=l,e[29]=i.kind,e[30]=i.pageName,e[31]=D):D=e[31];let $;e[32]!==te?($=te&&o.jsx(ke,{className:"size-3.5 text-muted-foreground"}),e[32]=te,e[33]=$):$=e[33];let I;e[34]!==p||e[35]!==l||e[36]!==i.kind?(I=i.kind==="page"&&p&&o.jsxs(Se,{type:"button",variant:"outline",size:"sm",onClick:p,children:[o.jsx(fe,{size:14}),l("sectionsEditor.seoEditor.editDefaultSeoButton")]}),e[34]=p,e[35]=l,e[36]=i.kind,e[37]=I):I=e[37];let L;e[38]!==$||e[39]!==I?(L=o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[$,I]}),e[38]=$,e[39]=I,e[40]=L):L=e[40];let B;e[41]!==L||e[42]!==D?(B=o.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2 border-b px-4",children:[D,L]}),e[41]=L,e[42]=D,e[43]=B):B=e[43];let O;e[44]!==F||e[45]!==re||e[46]!==le||e[47]!==oe||e[48]!==U||e[49]!==E||e[50]!==ne||e[51]!==b||e[52]!==se||e[53]!==z||e[54]!==_||e[55]!==w||e[56]!==ie||e[57]!==ce||e[58]!==a||e[59]!==K||e[60]!==g||e[61]!==N||e[62]!==Y||e[63]!==me||e[64]!==R||e[65]!==l?(O=!a||!Y&&!me?o.jsx("div",{className:"flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground",children:ne}):o.jsxs("div",{className:"flex min-h-0 flex-1",children:[o.jsx(ue,{className:"w-full max-w-md shrink-0 border-r [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-5 py-4",children:Y?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:l("sectionsEditor.seoEditor.emptyFieldsHint")}),o.jsx(Ke,{rawSeo:U,innerSeo:E,defaultResolveType:oe,seoSchema:K,activeResolveType:F,seoTypeOptions:a.seoTypeOptions,formResetKey:b,siteDefaultSeo:R,onPersistRaw:C=>{N(C),_(C)},onInnerChange:C=>{g(C),w(C)},onClearForm:le,onBumpFormKey:re})]}):K&&F&&o.jsx(Te,{schema:K,resolveType:F,value:E,formResetKey:b,onChange:se})})}),o.jsx(ue,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"@container px-5 py-4",children:o.jsx(Ae,{seo:ie,url:ce,path:z})})})]}),e[44]=F,e[45]=re,e[46]=le,e[47]=oe,e[48]=U,e[49]=E,e[50]=ne,e[51]=b,e[52]=se,e[53]=z,e[54]=_,e[55]=w,e[56]=ie,e[57]=ce,e[58]=a,e[59]=K,e[60]=g,e[61]=N,e[62]=Y,e[63]=me,e[64]=R,e[65]=l,e[66]=O):O=e[66];let Z;return e[67]!==B||e[68]!==O?(Z=o.jsxs("div",{className:"flex h-full w-full flex-col",children:[B,O]}),e[67]=B,e[68]=O,e[69]=Z):Z=e[69],Z}function Me(d){return d+1}function Ge(d){return d+1}function He(d,e){try{return new URL(d,e).href}catch{return e}}function Ve(d,e){const t=e.__resolveType,c=d.__resolveType;if(typeof t=="string"&&typeof c=="string"&&t!==c)return{...e};const v={...d};for(const[r,s]of Object.entries(e))r!=="__resolveType"&&s!=null&&(typeof s=="string"&&s.trim()===""||(v[r]=s));return v}export{ui as SeoEditor};
@@ -1 +1 @@
1
- import{c as p,l as d,j as f,eT as m}from"./index-doEaURqC.js";function x(l){const t=p.c(12);let o,a,r,i;t[0]!==l?({className:o,orientation:r,decorative:i,...a}=l,t[0]=l,t[1]=o,t[2]=a,t[3]=r,t[4]=i):(o=t[1],a=t[2],r=t[3],i=t[4]);const s=r===void 0?"horizontal":r,c=i===void 0?!0:i;let e;t[5]!==o?(e=d("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",o),t[5]=o,t[6]=e):e=t[6];let n;return t[7]!==c||t[8]!==s||t[9]!==a||t[10]!==e?(n=f.jsx(m,{"data-slot":"separator-root",decorative:c,orientation:s,className:e,...a}),t[7]=c,t[8]=s,t[9]=a,t[10]=e,t[11]=n):n=t[11],n}export{x as S};
1
+ import{c as p,l as d,j as f,eU as m}from"./index-CyBVTyGa.js";function x(l){const t=p.c(12);let o,a,r,i;t[0]!==l?({className:o,orientation:r,decorative:i,...a}=l,t[0]=l,t[1]=o,t[2]=a,t[3]=r,t[4]=i):(o=t[1],a=t[2],r=t[3],i=t[4]);const s=r===void 0?"horizontal":r,c=i===void 0?!0:i;let e;t[5]!==o?(e=d("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",o),t[5]=o,t[6]=e):e=t[6];let n;return t[7]!==c||t[8]!==s||t[9]!==a||t[10]!==e?(n=f.jsx(m,{"data-slot":"separator-root",decorative:c,orientation:s,className:e,...a}),t[7]=c,t[8]=s,t[9]=a,t[10]=e,t[11]=n):n=t[11],n}export{x as S};