decocms 4.380.1 → 4.380.2

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 (368) hide show
  1. package/dist/client/assets/{AlertCircle-Dp9-4uGL.js → AlertCircle-CGFLJpTs.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DQVkcGY7.js → AreaChart-a82Hhsmi.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CoVGTgdo.js → ArrowLeft-DC5XoBuA.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-BxXRK-9T.js → ArrowRight-BOJ1d9xj.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CAUxOu8p.js → ArrowUp-C1pJvrX2.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-D9KJIhDm.js → CartesianChart-yTuaWbdE.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-nFjpVjB-.js → CheckCircle-Bw2G2vwj.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-sV1u8S9q.js → ChevronUp-DSgAhhLJ.js} +1 -1
  9. package/dist/client/assets/{Copy01-DzDBcbz0.js → Copy01-BaJ5hTZ2.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-CGjET6rc.js → CreditCard01-DLxXT7_f.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-nR6OZIyf.js → DotsVertical-Cz_1rDcG.js} +1 -1
  12. package/dist/client/assets/{Download01-B-j-PqXV.js → Download01-CGyaU6cf.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-GaOdZh3-.js → ErrorBarContext-H3WwZUjL.js} +1 -1
  14. package/dist/client/assets/{Eye-PvWoxqY9.js → Eye-DXecVoiS.js} +1 -1
  15. package/dist/client/assets/{Globe01-fYg4pZgD.js → Globe01-BWcV-98b.js} +1 -1
  16. package/dist/client/assets/{Globe04-BS9lOiYa.js → Globe04-Cx7GY3vn.js} +1 -1
  17. package/dist/client/assets/{Image01-DSpVkEsU.js → Image01-B5ab_A88.js} +1 -1
  18. package/dist/client/assets/{Key01-Cfzm2tKV.js → Key01-D0TscG0E.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CehGoQ2f.js → LayoutLeft-d27AQAwl.js} +1 -1
  20. package/dist/client/assets/{Line-Bdn8Ste-.js → Line-iessdnWy.js} +1 -1
  21. package/dist/client/assets/{Link01-D1oz866b.js → Link01-Dx7hRSe5.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-DwEzooFw.js → LinkExternal01-BfutJB7X.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DhgCTrJw.js → Monitor01-Dentn30o.js} +1 -1
  24. package/dist/client/assets/{Package-BE4Z0-75.js → Package-CPNFyhMT.js} +1 -1
  25. package/dist/client/assets/{Palette-BHutPJim.js → Palette-DbXyfbJI.js} +1 -1
  26. package/dist/client/assets/{Play-DMSe6o7-.js → Play-CU4Q1GTp.js} +1 -1
  27. package/dist/client/assets/{Plus-BOiGcAFt.js → Plus-D3XzoCF3.js} +1 -1
  28. package/dist/client/assets/{SearchLg-CE6yXrvc.js → SearchLg-BYoLM1MK.js} +1 -1
  29. package/dist/client/assets/{SearchMd-Dgu5BSsL.js → SearchMd-DWKZ-mHQ.js} +1 -1
  30. package/dist/client/assets/{Sector-DCFpX9k7.js → Sector-DH8uTs0D.js} +1 -1
  31. package/dist/client/assets/{Settings02-CL4hLItW.js → Settings02-BqG3HPm0.js} +1 -1
  32. package/dist/client/assets/{Share07-BkxYWQqa.js → Share07-o5jM3q0c.js} +1 -1
  33. package/dist/client/assets/{Stars01-d503ijmt.js → Stars01-BZHqW_f9.js} +1 -1
  34. package/dist/client/assets/{Sun-D3L9_gRp.js → Sun-DGhoQy96.js} +1 -1
  35. package/dist/client/assets/{Tool01-z2bboeAO.js → Tool01-CE_c59RR.js} +1 -1
  36. package/dist/client/assets/{Tool02-Cd91k1L_.js → Tool02-Bo-RIY8d.js} +1 -1
  37. package/dist/client/assets/{Trash01-QZwDLax2.js → Trash01-CRCUnlT2.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-CyHcLfeA.js → TrendUp01-B5hqDidz.js} +1 -1
  39. package/dist/client/assets/{Upload01-DN1COvBA.js → Upload01-Bl2MpUhj.js} +1 -1
  40. package/dist/client/assets/{User01-DEAOyUK3.js → User01-3GLc_M8a.js} +1 -1
  41. package/dist/client/assets/{UserSquare-n4jXoTmN.js → UserSquare-CEWYtKNG.js} +1 -1
  42. package/dist/client/assets/{Users01-BhnSoj1S.js → Users01-DZ2aEDSy.js} +1 -1
  43. package/dist/client/assets/{X-C5DCm1y_.js → X-BGniQsFS.js} +1 -1
  44. package/dist/client/assets/{XCircle-BlIZZKKY.js → XCircle-CLEbTtoV.js} +1 -1
  45. package/dist/client/assets/{XClose-C9CCRs8f.js → XClose-wzn6XIaq.js} +1 -1
  46. package/dist/client/assets/{Zap-Df8s4LtK.js → Zap-BHpOc94D.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-DW85jM8U.js → ZoomOut-CDTxnLh4.js} +1 -1
  48. package/dist/client/assets/{access-gate-DX91gcCP.js → access-gate-C6A3nRFO.js} +1 -1
  49. package/dist/client/assets/{add-connection-dialog-CCuNVgdn.js → add-connection-dialog-Bb9g1-aL.js} +1 -1
  50. package/dist/client/assets/{agent-analytics-0ofo37uM.js → agent-analytics-Bsz-bSr0.js} +1 -1
  51. package/dist/client/assets/agent-app-DesHz54X.js +1 -0
  52. package/dist/client/assets/{agent-assets-BWnBXi1M.js → agent-assets-Biq0mlJm.js} +1 -1
  53. package/dist/client/assets/{agent-automation-CV8mmzMU.js → agent-automation-xDic7y2P.js} +1 -1
  54. package/dist/client/assets/{agent-automations-BFg01sOh.js → agent-automations-DcuDx55z.js} +1 -1
  55. package/dist/client/assets/{agent-connect-sources-D_BRp-A1.js → agent-connect-sources-Cydd6pKs.js} +1 -1
  56. package/dist/client/assets/agent-deck-BfHJuX43.js +1 -0
  57. package/dist/client/assets/{agent-e2e-BbSLwzVy.js → agent-e2e-BpJp1n9i.js} +1 -1
  58. package/dist/client/assets/{agent-experiments-DpnnC7co.js → agent-experiments-DijfK_gJ.js} +1 -1
  59. package/dist/client/assets/agent-file-CMCRpotH.js +1 -0
  60. package/dist/client/assets/{agent-git-CZuXgIye.js → agent-git-CZf70UrF.js} +1 -1
  61. package/dist/client/assets/{agent-hosting--hxENpsC.js → agent-hosting-wzysZLdu.js} +1 -1
  62. package/dist/client/assets/{agent-icon-UkUz72j1.js → agent-icon-D496OkeL.js} +1 -1
  63. package/dist/client/assets/agent-library-file-D-nUmAuh.js +1 -0
  64. package/dist/client/assets/{agent-monitor-ClMk4Oug.js → agent-monitor-6AAWwBbq.js} +1 -1
  65. package/dist/client/assets/{agent-overview-ClekFH7r.js → agent-overview-QbpPeBnc.js} +1 -1
  66. package/dist/client/assets/agent-settings-xOqY0ZbM.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-BlFIVSLJ.js → agent-site-editor-DXxcNAAU.js} +13 -13
  68. package/dist/client/assets/agent-site-editor-code-CQaQYkYG.js +2 -0
  69. package/dist/client/assets/{agent-site-editor-content-CmTDMtv2.js → agent-site-editor-content-BlnYGJNq.js} +2 -2
  70. package/dist/client/assets/{agent-site-editor-preview-Ba7Htl0A.js → agent-site-editor-preview-CWjsD5rW.js} +3 -3
  71. package/dist/client/assets/agent-view-CYAR8G1z.js +1 -0
  72. package/dist/client/assets/{agent-view-guard-HtiixG-C.js → agent-view-guard-B6fFe17X.js} +1 -1
  73. package/dist/client/assets/{agents-list-B8jwhkhi.js → agents-list-CqIyRDj0.js} +1 -1
  74. package/dist/client/assets/ai-providers-2e7ta5Tg.js +6 -0
  75. package/dist/client/assets/{alert-BUXdFIse.js → alert-CIymKwzl.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-ZjPwJc65.js → alert-dialog-Bq7N6ZWF.js} +1 -1
  77. package/dist/client/assets/api-keys-BVhi6eib.js +1 -0
  78. package/dist/client/assets/{api-keys-BEPR7x7y.js → api-keys-equ4Tv0D.js} +1 -1
  79. package/dist/client/assets/app-editor-S-OQQx45.js +1 -0
  80. package/dist/client/assets/{asset-utils-CTapiLZF.js → asset-utils-ClvN_bIt.js} +1 -1
  81. package/dist/client/assets/{auth-PesCBjhl.js → auth-3KEna5Qg.js} +1 -1
  82. package/dist/client/assets/{auth-catchall-DPjqpqP4.js → auth-catchall-1KfVcSXT.js} +1 -1
  83. package/dist/client/assets/{auth-entry-B6mwPojR.js → auth-entry-BKOXx840.js} +1 -1
  84. package/dist/client/assets/{auth-split-layout-DwI6KMEH.js → auth-split-layout-D5Awhhre.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-DuwOtc-d.js → authenticate-and-persist-oauth-5OH4tqLf.js} +1 -1
  86. package/dist/client/assets/{automation-list-row-BO0eJvY-.js → automation-list-row-CNmGZG7h.js} +1 -1
  87. package/dist/client/assets/{automation-runs-BZROKStd.js → automation-runs-DoA8WvHT.js} +1 -1
  88. package/dist/client/assets/{automations-CvioSdw9.js → automations-DtZ-CBg6.js} +1 -1
  89. package/dist/client/assets/{autosend-DI1--obS.js → autosend-CgAy_8nv.js} +1 -1
  90. package/dist/client/assets/{avatar-EZue9I__.js → avatar-PPm_nVJO.js} +1 -1
  91. package/dist/client/assets/{badge-DSwozW1G.js → badge-CzCkyB-y.js} +1 -1
  92. package/dist/client/assets/{block-document-CPnW1EW8.js → block-document-D8uEaf-S.js} +1 -1
  93. package/dist/client/assets/{blocks-preview-workspace-context-RMD7RonS.js → blocks-preview-workspace-context-JV86bUee.js} +1 -1
  94. package/dist/client/assets/{breadcrumb-C-PZOkcF.js → breadcrumb-1SsyuAmn.js} +1 -1
  95. package/dist/client/assets/{buckets-CQ1bBbUS.js → buckets-BKOCj--b.js} +1 -1
  96. package/dist/client/assets/{build-improve-prompt-doc-C1JN34Rl.js → build-improve-prompt-doc-Y74P3hyZ.js} +1 -1
  97. package/dist/client/assets/{bulk-category-panel-BC8RLVBS.js → bulk-category-panel-DDeRHIvS.js} +1 -1
  98. package/dist/client/assets/{calendar-CtoAHdqx.js → calendar-Bs8TzhBE.js} +1 -1
  99. package/dist/client/assets/{capability-load-error-BF6EpFcl.js → capability-load-error-qgxNzLRH.js} +1 -1
  100. package/dist/client/assets/category-editor-AbJlO6XH.js +1 -0
  101. package/dist/client/assets/{chart-DqI4QWe-.js → chart-CSB0FjAw.js} +1 -1
  102. package/dist/client/assets/{chat-context-2kVChe1m.js → chat-context-C7f3MLVZ.js} +1 -1
  103. package/dist/client/assets/{chat-draft-DOGJfeIo.js → chat-draft-BW5UOw44.js} +1 -1
  104. package/dist/client/assets/{checkbox-DzVvL9c5.js → checkbox-Djw8YkXF.js} +1 -1
  105. package/dist/client/assets/{choose-editor-C2HMxhXX.js → choose-editor-CCbrtvab.js} +1 -1
  106. package/dist/client/assets/{cli-auth-success-vMoXOf2P.js → cli-auth-success-2avwTjVf.js} +1 -1
  107. package/dist/client/assets/{client-icons-5YddkTV1.js → client-icons-CgVdwszb.js} +1 -1
  108. package/dist/client/assets/{collapsible-B7hv9iRj.js → collapsible-CL_tV3Eh.js} +1 -1
  109. package/dist/client/assets/{collection-detail-Hm9I5La8.js → collection-detail-BeOsyZBJ.js} +1 -1
  110. package/dist/client/assets/{collection-display-button-BQgqv2Lq.js → collection-display-button-BPeer94Q.js} +1 -1
  111. package/dist/client/assets/{collection-search-L62qqQEF.js → collection-search-CW48jNAm.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-DG8fwYqd.js → collection-table-wrapper-DedUSq_q.js} +1 -1
  113. package/dist/client/assets/{collection-tabs-BSd2F5zF.js → collection-tabs-BxNdQr3v.js} +1 -1
  114. package/dist/client/assets/{combobox-DG_gjanO.js → combobox-Dwfed5hM.js} +1 -1
  115. package/dist/client/assets/{command-BtNpU6EY.js → command-Dp_xVMno.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-BljCYKNd.js → companion-mcps-section-DwDjUgsF.js} +1 -1
  117. package/dist/client/assets/{connect-BoaTjwXT.js → connect-CTaD0CTL.js} +1 -1
  118. package/dist/client/assets/{connect-layout-BOQEmxF_.js → connect-layout-DBtCSLVk.js} +1 -1
  119. package/dist/client/assets/{connection-Ciz_sqOe.js → connection-B8n_iRDm.js} +1 -1
  120. package/dist/client/assets/{connection-card-Ctor28p_.js → connection-card-d6di2niE.js} +1 -1
  121. package/dist/client/assets/{connection-detail-A03z8KwI.js → connection-detail-Bd0H2Cr3.js} +1 -1
  122. package/dist/client/assets/{connection-form-helpers-B5XTvxJB.js → connection-form-helpers-D99GQOo-.js} +1 -1
  123. package/dist/client/assets/{connections-DVOOtlef.js → connections-BbEnv8dv.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-CNUKs0Rq.js → create-organization-dialog-C7J_r78k.js} +1 -1
  125. package/dist/client/assets/{decofile-api-BbZF6zYQ.js → decofile-api-BirlTWkL.js} +1 -1
  126. package/dist/client/assets/{decopilot-BvnxFULb.js → decopilot-DOWkbqe-.js} +1 -1
  127. package/dist/client/assets/{dialog-DqpJkgtD.js → dialog-DTxKdk6B.js} +1 -1
  128. package/dist/client/assets/{discover-BZl4Ju53.js → discover-DBWZ7ohk.js} +1 -1
  129. package/dist/client/assets/{domain-settings-Dn1YTyHA.js → domain-settings-Bdyi19GR.js} +1 -1
  130. package/dist/client/assets/{download-app-dialog-CLLpE1Va.js → download-app-dialog-B_OO5bFO.js} +1 -1
  131. package/dist/client/assets/{drawer-gvgyCX2C.js → drawer-CwqENKPq.js} +1 -1
  132. package/dist/client/assets/{editor-B6SPVf0p.js → editor-DpRJQ9mq.js} +1 -1
  133. package/dist/client/assets/{empty-state-BP_ua3lw.js → empty-state-Cva040iu.js} +1 -1
  134. package/dist/client/assets/{empty-state-DiJdC2AG.js → empty-state-DekE7Ie6.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-DtxkNQlF.js → extract-connection-data-B_g-VP9A.js} +1 -1
  136. package/dist/client/assets/{feature-gate-DwXyxwRC.js → feature-gate-CUslF5vY.js} +1 -1
  137. package/dist/client/assets/{feature-paywall-Dlj2u6nx.js → feature-paywall-BD-lgh2_.js} +1 -1
  138. package/dist/client/assets/{file-explorer-BWOd3edW.js → file-explorer-CWc8jnpt.js} +1 -1
  139. package/dist/client/assets/{file-preview-BZs72SZX.js → file-preview-DAmEXgR_.js} +1 -1
  140. package/dist/client/assets/{file-share-button-DiPJJyoU.js → file-share-button-xSfhcPPB.js} +1 -1
  141. package/dist/client/assets/{file-type-icon-DaEpPzuv.js → file-type-icon-CdJziZKk.js} +1 -1
  142. package/dist/client/assets/{folder-icon-BDGClo4K.js → folder-icon-B-DOdGRA.js} +1 -1
  143. package/dist/client/assets/{form-DY61OzdM.js → form-Bw33z1SA.js} +1 -1
  144. package/dist/client/assets/{gateway-client-BZLKfjYs.js → gateway-client-CrkEu4dZ.js} +1 -1
  145. package/dist/client/assets/{general-Cpw5FsI5.js → general-CQVoP6Bh.js} +1 -1
  146. package/dist/client/assets/{github-icon-CVTHHFxk.js → github-icon-CfXQNl0v.js} +1 -1
  147. package/dist/client/assets/{home-Gqylher4.js → home-BLWvCsHm.js} +1 -1
  148. package/dist/client/assets/hooks-BEXBCk9z.js +2 -0
  149. package/dist/client/assets/{hooks-C0tgwOmM.js → hooks-DgdsVzEA.js} +1 -1
  150. package/dist/client/assets/{icon-button-DtAyZPaw.js → icon-button-DYZouDqo.js} +1 -1
  151. package/dist/client/assets/{index-CTktesQe.js → index-9o3jDog2.js} +1 -1
  152. package/dist/client/assets/{index-fjGQnHBO.js → index-BQHnqw3U.js} +1 -1
  153. package/dist/client/assets/{index-DwbY1n5w.js → index-CNDyHqLd.js} +1 -1
  154. package/dist/client/assets/{index-VzHSubcI.js → index-COA9taIA.js} +1 -1
  155. package/dist/client/assets/{index-MKUdQRRL.js → index-CUrCXCxK.js} +1 -1
  156. package/dist/client/assets/{index-jAwpak4-.js → index-CeBCCoZB.js} +1 -1
  157. package/dist/client/assets/{index-8jHgu7SV.js → index-DB2dtavd.js} +1 -1
  158. package/dist/client/assets/{index-AhDOs3JG.js → index-DKa2AY2P.js} +1 -1
  159. package/dist/client/assets/{index-BRPaWRo-.js → index-J-HhaIRe.js} +2 -2
  160. package/dist/client/assets/index-L3ADEseX.js +5 -0
  161. package/dist/client/assets/{index-BQqEqUHw.js → index-RQ433UOD.js} +1 -1
  162. package/dist/client/assets/{index-DG7Ub4UK.js → index-b-HPQtaV.js} +1 -1
  163. package/dist/client/assets/{index-dGxYypI5.js → index-mhmcAxUW.js} +1 -1
  164. package/dist/client/assets/{index-DUo7RdjM.js → index-oMcUL3Yj.js} +1 -1
  165. package/dist/client/assets/{index-redirect-uTgWCjE8.js → index-redirect-BcnCuUFG.js} +1 -1
  166. package/dist/client/assets/{infiniteQueryObserver-C7HqNpWB.js → infiniteQueryObserver-Bp62E0f5.js} +1 -1
  167. package/dist/client/assets/{infra-billing-W_8drDf8.js → infra-billing-BCRjskqP.js} +1 -1
  168. package/dist/client/assets/{input-DqTF951M.js → input-BwB4jnj_.js} +1 -1
  169. package/dist/client/assets/{input-Dfi6JpaU.js → input-D5ksR5GW.js} +1 -1
  170. package/dist/client/assets/{input-B0uEOAUu.js → input-Dr3S5ak1.js} +1 -1
  171. package/dist/client/assets/{integration-icon-Dcqj-FW-.js → integration-icon-9SSN9Dl9.js} +1 -1
  172. package/dist/client/assets/{label-DRb1UAWz.js → label-CjHJo36P.js} +1 -1
  173. package/dist/client/assets/last-preview-page-kpd1zNQa.js +1 -0
  174. package/dist/client/assets/{layout-CzWcsfsW.js → layout-BeJYnmuf.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-DlnqxKah.js → legacy-agents-deep-DrKJ1wEq.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-B_cJgsHu.js → legacy-main-redirect-WAZbVTnq.js} +1 -1
  177. package/dist/client/assets/{library-D9EspjcX.js → library-4bJ2rmQt.js} +1 -1
  178. package/dist/client/assets/{login-zJRm3B3J.js → login-BWMwZVUY.js} +1 -1
  179. package/dist/client/assets/{markdown-BHYHFE5D.js → markdown-DN_WHoBa.js} +1 -1
  180. package/dist/client/assets/{mcp-app-renderer-CcpKc2N2.js → mcp-app-renderer-BDiTxwS7.js} +1 -1
  181. package/dist/client/assets/{mcp-oauth-CMzWrATm.js → mcp-oauth-Cfvqr8fE.js} +1 -1
  182. package/dist/client/assets/{members-Dgtp5hV8.js → members-BOQXIgtZ.js} +1 -1
  183. package/dist/client/assets/{message-templates-Cd1p3BgF.js → message-templates-F1a4WGkX.js} +1 -1
  184. package/dist/client/assets/{mini-report-page-CL3MB03d.js → mini-report-page-ol1xCTtf.js} +1 -1
  185. package/dist/client/assets/{mock-board-Cs3qNDwu.js → mock-board-CcJYFRSI.js} +3 -3
  186. package/dist/client/assets/{monaco-editor-BL4167yq.js → monaco-editor-BSp0HKdn.js} +1 -1
  187. package/dist/client/assets/{monitoring-stats-row-BO0U2bR4.js → monitoring-stats-row-B07R3XRH.js} +1 -1
  188. package/dist/client/assets/{multi-select-BujGNpEb.js → multi-select-TwgloS8r.js} +1 -1
  189. package/dist/client/assets/{mustache-CsH2CXct.js → mustache-CVWbGRah.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-B7Y9f1XV.js → oauth-callback-CvPKF6HM.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-ai-provider-DfZ3Kk9Q.js → oauth-callback-ai-provider-COFdHrZu.js} +1 -1
  192. package/dist/client/assets/{onboarding-DOYnWTsu.js → onboarding-DrAKPbzp.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-D7RtkNyG.js → optimistic-project-sidebar-views-0t3BJG6O.js} +1 -1
  194. package/dist/client/assets/{org-file-open-context-uN9hrCO1.js → org-file-open-context-DLYT0cgI.js} +1 -1
  195. package/dist/client/assets/{organization-choice-DTkcSTLN.js → organization-choice-DRI0Xf93.js} +1 -1
  196. package/dist/client/assets/{orgs-DgducVta.js → orgs-DajJVdOr.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-B2elNExj.js → page-seo-form-D9MSqhdC.js} +1 -1
  198. package/dist/client/assets/pair-CU2rNVlM.js +47 -0
  199. package/dist/client/assets/{plan-ladder-Cy3iGrRF.js → plan-ladder-CLfe96p7.js} +1 -1
  200. package/dist/client/assets/{popover-BxW4EeQD.js → popover-CqiAzy6q.js} +1 -1
  201. package/dist/client/assets/{post-calendar-CNyFpCvN.js → post-calendar-BbL2q81W.js} +1 -1
  202. package/dist/client/assets/{post-editor-C79iKYly.js → post-editor-BjAlLIBX.js} +1 -1
  203. package/dist/client/assets/{preview-content-Ck_q9D1b.js → preview-content-BEgqvROI.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-B4XYMOaG.js → preview-dialog-C1_XqXvf.js} +1 -1
  205. package/dist/client/assets/{primitives-Dab8HKVc.js → primitives-CenJalqY.js} +1 -1
  206. package/dist/client/assets/{profile-RSnp0Ojz.js → profile-Dbwp1FZf.js} +1 -1
  207. package/dist/client/assets/{project-app-view-B3NmBwDP.js → project-app-view-BVaAiMcz.js} +1 -1
  208. package/dist/client/assets/{project-feed-C5XIbxsf.js → project-feed-Dvl8n7rc.js} +1 -1
  209. package/dist/client/assets/{project-icon-B5sk8DiS.js → project-icon-CrCdaVr_.js} +1 -1
  210. package/dist/client/assets/project-reports-Drc1KzOQ.js +1 -0
  211. package/dist/client/assets/project-tasks-DwGCPJ6m.js +1 -0
  212. package/dist/client/assets/{prompts-C-Rb6d0c.js → prompts-EXj1sy5I.js} +1 -1
  213. package/dist/client/assets/record-editor-BOZo1ZUq.js +1 -0
  214. package/dist/client/assets/{redirect-editor-BySyTt5E.js → redirect-editor-pNWBdqg6.js} +1 -1
  215. package/dist/client/assets/registry-DsNzo3hF.js +2 -0
  216. package/dist/client/assets/{registry-layout-DOGcKk4q.js → registry-layout-B4sWausW.js} +1 -1
  217. package/dist/client/assets/reports-CzR_Cwbv.js +1 -0
  218. package/dist/client/assets/{reports-BH9dTydN.js → reports-D-pqorfM.js} +1 -1
  219. package/dist/client/assets/{reports-onboarding-B2PEhD55.js → reports-onboarding-Gfw31-tC.js} +1 -1
  220. package/dist/client/assets/{reports-tab-D-IJinJD.js → reports-tab-CWRt3rcI.js} +2 -2
  221. package/dist/client/assets/{repositories-D6ISP4EE.js → repositories-Cq6sMn55.js} +1 -1
  222. package/dist/client/assets/{repository-import-picker-B1Evzd-j.js → repository-import-picker-C-n4lBHF.js} +1 -1
  223. package/dist/client/assets/{repository-picker-DL74_12-.js → repository-picker-CaYH5503.js} +1 -1
  224. package/dist/client/assets/{require-capability-UII3z9hP.js → require-capability-D2eRS8Ds.js} +1 -1
  225. package/dist/client/assets/{required-auth-layout-Ce7b2T9C.js → required-auth-layout-BKb9-6vC.js} +1 -1
  226. package/dist/client/assets/{reset-password-CbJ4Hz3J.js → reset-password-BvVXhylp.js} +1 -1
  227. package/dist/client/assets/{resizable-DVOszXcW.js → resizable-Bt98DGlm.js} +1 -1
  228. package/dist/client/assets/{review-settings-C393xuw1.js → review-settings-CuVB3EmJ.js} +1 -1
  229. package/dist/client/assets/{rich-text-link-control-XKcUgEYo.js → rich-text-link-control-N5yQ4FMB.js} +1 -1
  230. package/dist/client/assets/{roles-BYL8YTIs.js → roles-BO1lFKQs.js} +1 -1
  231. package/dist/client/assets/{route-N23pCKiW.js → route-BP1JkGvW.js} +1 -1
  232. package/dist/client/assets/{route-Dv2P950G.js → route-CR7kiBqv.js} +1 -1
  233. package/dist/client/assets/{route-page-header-TEPzoQ22.js → route-page-header-fPq-qE7U.js} +1 -1
  234. package/dist/client/assets/{route-BUu7HA2D.js → route-woaISgz4.js} +1 -1
  235. package/dist/client/assets/{runnable-block-editor-DiOjyJY3.js → runnable-block-editor-xiAEogpy.js} +1 -1
  236. package/dist/client/assets/{sandbox-lifecycle-context-CAZK81-M.js → sandbox-lifecycle-context-CmeEs8uW.js} +2 -2
  237. package/dist/client/assets/{schema-C7QXUiED.js → schema-BmTPXP0h.js} +1 -1
  238. package/dist/client/assets/{scroll-area-4pfR4KXf.js → scroll-area-D72_bYX-.js} +1 -1
  239. package/dist/client/assets/{search-input-CFnZ1EoZ.js → search-input-DVbLXCEj.js} +1 -1
  240. package/dist/client/assets/{search-toggle-BclsmpXk.js → search-toggle-B8-QCzR2.js} +1 -1
  241. package/dist/client/assets/{secrets-CojUSlhS.js → secrets-D9w8WJUH.js} +1 -1
  242. package/dist/client/assets/{sections-editor-CE5jQY9D.js → sections-editor-bQYiNQsv.js} +1 -1
  243. package/dist/client/assets/{select-model-DOUnsx10.js → select-model-BUKfjbeY.js} +1 -1
  244. package/dist/client/assets/{select-DoCMn5nH.js → select-zKx4kd1b.js} +1 -1
  245. package/dist/client/assets/{seo-editor-BhYIlRos.js → seo-editor-C1rg2ivT.js} +1 -1
  246. package/dist/client/assets/{separator-DAmPieHa.js → separator-DIK9oMBk.js} +1 -1
  247. package/dist/client/assets/{settings-tab-BotBAoS5.js → settings-tab-DnH50j1e.js} +1 -1
  248. package/dist/client/assets/{sheet-BlT0ycOP.js → sheet-CCy35_-v.js} +1 -1
  249. package/dist/client/assets/shell-layout-Dj-jZ6jC.js +1 -0
  250. package/dist/client/assets/{sidebar-D-MQS6hu.js → sidebar-Y-jcWrzw.js} +1 -1
  251. package/dist/client/assets/{skill-preview-DVmBJ-9d.js → skill-preview-DAUvP3iZ.js} +1 -1
  252. package/dist/client/assets/{skills-D_uh1mX6.js → skills-DQx9g0Gz.js} +1 -1
  253. package/dist/client/assets/{sso-zTAaW4rZ.js → sso-DkSKjhD5.js} +1 -1
  254. package/dist/client/assets/{store-CjQW2ejO.js → store-D-H_X08C.js} +1 -1
  255. package/dist/client/assets/store-registry-osFeoz0Q.js +2 -0
  256. package/dist/client/assets/{switch-KRXjUmuU.js → switch-BTJnoG_j.js} +1 -1
  257. package/dist/client/assets/{synced-repos-0eTihvYh.js → synced-repos-05MD6I3R.js} +1 -1
  258. package/dist/client/assets/{table-CjQKw7tT.js → table-J6_odvOq.js} +1 -1
  259. package/dist/client/assets/{tabs-DavXAQpQ.js → tabs-DNRDoJPn.js} +1 -1
  260. package/dist/client/assets/{task-board-CcpOhcy4.js → task-board-BRDQJ0Y_.js} +1 -1
  261. package/dist/client/assets/{task-route-CAELVYNm.js → task-route-D9j1p6oU.js} +1 -1
  262. package/dist/client/assets/{task-status-CDmbn8rn.js → task-status-3HWFI1qu.js} +1 -1
  263. package/dist/client/assets/taskboard-analytics-DL1GEMDG.js +1 -0
  264. package/dist/client/assets/{tasks-RvJkj36f.js → tasks-Bi0sW-D0.js} +1 -1
  265. package/dist/client/assets/tasks-dBux8yBe.js +1 -0
  266. package/dist/client/assets/{textarea-B5S25kzg.js → textarea-IiEjpID3.js} +1 -1
  267. package/dist/client/assets/{thread-button-DPlpZmEs.js → thread-button-uDLbMetB.js} +1 -1
  268. package/dist/client/assets/{thread-intent-B0zO6cq8.js → thread-intent-DeoW4DlO.js} +1 -1
  269. package/dist/client/assets/{thread-route-BnB-FbSU.js → thread-route-BJtUmhwW.js} +1 -1
  270. package/dist/client/assets/{thread-route-CiiBSvcH.js → thread-route-Cb0bjsjK.js} +1 -1
  271. package/dist/client/assets/{thread-sheet-body-BD2kD_-P.js → thread-sheet-body-BZaEC0cb.js} +1 -1
  272. package/dist/client/assets/{toggle-group-CisId5Hk.js → toggle-group-2-AJ4PX8.js} +1 -1
  273. package/dist/client/assets/{toolbar-icon-button-DblfpIpX.js → toolbar-icon-button-BNr0uvrm.js} +1 -1
  274. package/dist/client/assets/{tooltip-CHwKR_-k.js → tooltip-CvsJoQ2r.js} +1 -1
  275. package/dist/client/assets/{track-eQvHzyzx.js → track-B9OWK61W.js} +1 -1
  276. package/dist/client/assets/{types-DZIFiTO8.js → types-DBvOp03a.js} +1 -1
  277. package/dist/client/assets/{usage-stats-aKXWUmvx.js → usage-stats-zzlmS7nl.js} +1 -1
  278. package/dist/client/assets/{use-ai-providers-2DMSS8F3.js → use-ai-providers-C5aBXU5x.js} +1 -1
  279. package/dist/client/assets/{use-automations-CZAFLQm2.js → use-automations-CHCA-LyE.js} +1 -1
  280. package/dist/client/assets/{use-autosave-BMHCv34p.js → use-autosave-BjqzqGH1.js} +1 -1
  281. package/dist/client/assets/{use-connect-companion-C10smgw3.js → use-connect-companion-D7rIWDjo.js} +1 -1
  282. package/dist/client/assets/{use-connection-Cv12sY9Y.js → use-connection-BVWLSIgG.js} +1 -1
  283. package/dist/client/assets/{use-copy-BM1-zBmR.js → use-copy-B-yVF-T4.js} +1 -1
  284. package/dist/client/assets/{use-create-virtual-mcp-CIrkQnXn.js → use-create-virtual-mcp-B8c170Z7.js} +1 -1
  285. package/dist/client/assets/{use-date-fns-locale-DdaSzKTZ.js → use-date-fns-locale-tVWkgiye.js} +1 -1
  286. package/dist/client/assets/{use-debounced-autosave-CBBLNT5o.js → use-debounced-autosave-BedmTE3a.js} +1 -1
  287. package/dist/client/assets/{use-debounced-value-BbIU6jk8.js → use-debounced-value-RCOUyhbk.js} +1 -1
  288. package/dist/client/assets/{use-deco-credits-BKXec4qv.js → use-deco-credits-CNT8sgKc.js} +1 -1
  289. package/dist/client/assets/{use-decopilot-events-BQ30YqEW.js → use-decopilot-events-Yer_uM_S.js} +1 -1
  290. package/dist/client/assets/{use-delete-connection-BJtw172l.js → use-delete-connection-DeItobW_.js} +1 -1
  291. package/dist/client/assets/{use-deployment-admin-BZzhx75Y.js → use-deployment-admin-CHH8IV6l.js} +1 -1
  292. package/dist/client/assets/{use-entitlements-CScQVp2_.js → use-entitlements-z0zlslXa.js} +1 -1
  293. package/dist/client/assets/{use-fast-preview-draft-url-Ah9HUPNv.js → use-fast-preview-draft-url-DGs-WRxv.js} +1 -1
  294. package/dist/client/assets/{use-file-configs-BPPTWkg1.js → use-file-configs-DpTBLkPU.js} +1 -1
  295. package/dist/client/assets/{use-in-settings-CaKZdnKS.js → use-in-settings-CDLV44q3.js} +1 -1
  296. package/dist/client/assets/{use-infinite-scroll-CxHDqOqn.js → use-infinite-scroll-Ch9lEd3E.js} +1 -1
  297. package/dist/client/assets/{use-join-requests-PPLVJHIG.js → use-join-requests-BDFPEBoJ.js} +1 -1
  298. package/dist/client/assets/{use-main-panel-tabs-COvlayXj.js → use-main-panel-tabs-OW5hqyvj.js} +1 -1
  299. package/dist/client/assets/{use-mcp-auth-status-D7SgvyfT.js → use-mcp-auth-status-BSJCGmmd.js} +1 -1
  300. package/dist/client/assets/{use-mcp-client-COESFWVa.js → use-mcp-client-mvmVY_Sq.js} +1 -1
  301. package/dist/client/assets/{use-mcp-prompts-D_no5mU5.js → use-mcp-prompts-D4-Z04dj.js} +1 -1
  302. package/dist/client/assets/{use-mcp-tools-DfkMiakP.js → use-mcp-tools-C7FpW5Rr.js} +1 -1
  303. package/dist/client/assets/{use-members-C8McmSVO.js → use-members-CZXSXw_1.js} +1 -1
  304. package/dist/client/assets/use-mobile-BtQeDX-z.js +1 -0
  305. package/dist/client/assets/{use-navigate-to-agent-CXfbIl3z.js → use-navigate-to-agent-BiSNiCre.js} +1 -1
  306. package/dist/client/assets/{use-open-billing-url-BTZ4cHvi.js → use-open-billing-url-BLr1QHHh.js} +1 -1
  307. package/dist/client/assets/{use-org-auth-client-BH4xLV6X.js → use-org-auth-client-BznOfNJb.js} +1 -1
  308. package/dist/client/assets/{use-org-fs-Dj_dt0Lr.js → use-org-fs-Cl4AAfEE.js} +1 -1
  309. package/dist/client/assets/{use-org-repo-syncs-CX6D871l.js → use-org-repo-syncs-CPZxqDW-.js} +1 -1
  310. package/dist/client/assets/{use-org-sso-D01eFIHQ.js → use-org-sso-Cb8Yn6yP.js} +1 -1
  311. package/dist/client/assets/{use-organization-roles-DEi3WU_t.js → use-organization-roles-jofIoo_T.js} +1 -1
  312. package/dist/client/assets/{use-organization-settings-Be4UD12s.js → use-organization-settings-C1FltOgT.js} +1 -1
  313. package/dist/client/assets/{use-panel-navigate-Chuzw-rn.js → use-panel-navigate-CXz4fRn5.js} +1 -1
  314. package/dist/client/assets/{use-project-native-view-presence-Bxvud_sX.js → use-project-native-view-presence-3yl9GAt2.js} +1 -1
  315. package/dist/client/assets/{use-project-scope-mm4wUXYr.js → use-project-scope-Dd3XRNTj.js} +1 -1
  316. package/dist/client/assets/{use-registry-connections-Chp6Cx45.js → use-registry-connections-DtQgEcVS.js} +1 -1
  317. package/dist/client/assets/{use-releases-CrxK0TsI.js → use-releases-CvqcA-kL.js} +1 -1
  318. package/dist/client/assets/{use-reports-diagnostic-aKya3QMZ.js → use-reports-diagnostic-CWgd-3_g.js} +1 -1
  319. package/dist/client/assets/{use-route-default-main-CN_9P1DH.js → use-route-default-main-CPQ4AmO4.js} +1 -1
  320. package/dist/client/assets/{use-secrets-DfgVJ2My.js → use-secrets-q0A46oGN.js} +1 -1
  321. package/dist/client/assets/{use-section-preview-base-CU9Y5hvz.js → use-section-preview-base-B_9x3Nht.js} +1 -1
  322. package/dist/client/assets/{use-session-runtime-CiFwd2ON.js → use-session-runtime-DQ_xnOm6.js} +1 -1
  323. package/dist/client/assets/{use-tags-CzBs6p38.js → use-tags-CYAPfYQP.js} +1 -1
  324. package/dist/client/assets/{use-task-board-analytics-rS8gOor5.js → use-task-board-analytics-DLlgZnFs.js} +1 -1
  325. package/dist/client/assets/{use-task-metadata-CxBTKP3l.js → use-task-metadata-D7elYoD_.js} +1 -1
  326. package/dist/client/assets/{use-thread-outputs-jKRhjtXQ.js → use-thread-outputs-CVc4ZTLK.js} +1 -1
  327. package/dist/client/assets/{use-view-mode-CBq9wacX.js → use-view-mode-oN14Hv6M.js} +1 -1
  328. package/dist/client/assets/{use-virtual-mcp-CkVjIQBx.js → use-virtual-mcp-TYMfCW-P.js} +1 -1
  329. package/dist/client/assets/useInfiniteQuery-DUvEi5Ym.js +1 -0
  330. package/dist/client/assets/{useQueries-2XN4ydkQ.js → useQueries-CX0az6_Q.js} +1 -1
  331. package/dist/client/assets/useSuspenseInfiniteQuery-CC7Cv3nZ.js +1 -0
  332. package/dist/client/assets/{users-BvNREGeT.js → users--BORUDmN.js} +1 -1
  333. package/dist/client/assets/{utils-b5kzEb0v.js → utils-eMZKRHuP.js} +1 -1
  334. package/dist/client/assets/{variant-calendar-BooSLl82.js → variant-calendar-7T7b5EH_.js} +1 -1
  335. package/dist/client/assets/{variant-matcher-override-ByjeDRSE.js → variant-matcher-override-Dko4GZ86.js} +1 -1
  336. package/dist/client/assets/{view-mode-toggle-DHFXAdRm.js → view-mode-toggle-D3ebQ5N9.js} +1 -1
  337. package/dist/client/assets/{virtual-mcp-DcW9-ayK.js → virtual-mcp-oulMbZvO.js} +1 -1
  338. package/dist/client/index.html +1 -1
  339. package/dist/server/cli.js +1 -1
  340. package/dist/server/server.js +1 -1
  341. package/package.json +1 -1
  342. package/dist/client/assets/agent-app-Bb_kqYZv.js +0 -1
  343. package/dist/client/assets/agent-deck-znI40rOG.js +0 -1
  344. package/dist/client/assets/agent-file-JdhTjhxr.js +0 -1
  345. package/dist/client/assets/agent-library-file-B_NDDv-X.js +0 -1
  346. package/dist/client/assets/agent-settings-BEfkP4VD.js +0 -1
  347. package/dist/client/assets/agent-site-editor-code-DbUPRJ1J.js +0 -2
  348. package/dist/client/assets/agent-view-DGFEbWoW.js +0 -1
  349. package/dist/client/assets/ai-providers-mpw8wD5x.js +0 -6
  350. package/dist/client/assets/api-keys-VehTYaph.js +0 -1
  351. package/dist/client/assets/app-editor-BVwS3yya.js +0 -1
  352. package/dist/client/assets/category-editor-O6g-jKKg.js +0 -1
  353. package/dist/client/assets/hooks-BijvSzOm.js +0 -2
  354. package/dist/client/assets/index-CgCH5Aue.js +0 -5
  355. package/dist/client/assets/last-preview-page-Bqmq2BzT.js +0 -1
  356. package/dist/client/assets/pair-B0QPWKX-.js +0 -47
  357. package/dist/client/assets/project-reports-PhLh2RJe.js +0 -1
  358. package/dist/client/assets/project-tasks-CzB56Bn8.js +0 -1
  359. package/dist/client/assets/record-editor-DJlcTtXp.js +0 -1
  360. package/dist/client/assets/registry-Bmgo4YcQ.js +0 -2
  361. package/dist/client/assets/reports-DpENaxSX.js +0 -1
  362. package/dist/client/assets/shell-layout-CLZ3Rv0X.js +0 -1
  363. package/dist/client/assets/store-registry-Le_gk2Q0.js +0 -2
  364. package/dist/client/assets/taskboard-analytics-BOuz_qGc.js +0 -1
  365. package/dist/client/assets/tasks-D7D2sxUJ.js +0 -1
  366. package/dist/client/assets/use-mobile-Cpd2MZ1z.js +0 -1
  367. package/dist/client/assets/useInfiniteQuery-BmZ0LIU0.js +0 -1
  368. package/dist/client/assets/useSuspenseInfiniteQuery-YpbUSC3T.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-BRPaWRo-.js";import{u as Le}from"./use-mcp-client-COESFWVa.js";import{u as Ue}from"./use-session-runtime-CiFwd2ON.js";import{u as Re,b as Oe}from"./chat-context-2kVChe1m.js";import{u as Be}from"./hooks-C0tgwOmM.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-CkVjIQBx.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,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 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-J-HhaIRe.js";import{u as Le}from"./use-mcp-client-mvmVY_Sq.js";import{u as Ue}from"./use-session-runtime-DQ_xnOm6.js";import{u as Re,b as Oe}from"./chat-context-C7f3MLVZ.js";import{u as Be}from"./hooks-DgdsVzEA.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-TYMfCW-P.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 +1 @@
1
- import{ao as a,bM as t,ap as e,bN as c,bO as d,bP as p,bQ as m}from"./index-BRPaWRo-.js";const i=500;a({title:e().max(i),url:e().max(i),icon:e().max(i)});a({registries:d(e().max(i),a({enabled:t()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:c(e().max(i)).describe("List of MCP app_name or app_id values to hide from the store.")});const s=a({keyId:e().max(i),modelId:e().max(i),title:e().max(i).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const _=a({tiers:a({fast:s,smart:s,thinking:s,image:s,web_search:s,deep_research:s})});a({tiers:a({fast:s.optional(),smart:s.optional(),thinking:s.optional()})});a({ids:c(e().max(i)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const y=a({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.")}),b=new Set(["reviewer_enabled","cheap_reviewer_model"]);function v(n,r){const h=n?.[r];return b.has(r)?h!==!1:h===!0}function x(n){const r=n?.auto_resolve_conflicts;return typeof r=="boolean"?r:n?.auto_merge===!0}const l=256*1024,f=50,o=500,u=5e3;a({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(u).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:a({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:a({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:c(d(e(),m())).max(f).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),m()).nullable().optional().refine(n=>n==null||JSON.stringify(n).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{b as D,y as O,_ as S,x as a,v as o};
1
+ import{ao as a,bM as t,ap as e,bN as c,bO as d,bP as p,bQ as m}from"./index-J-HhaIRe.js";const i=500;a({title:e().max(i),url:e().max(i),icon:e().max(i)});a({registries:d(e().max(i),a({enabled:t()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:c(e().max(i)).describe("List of MCP app_name or app_id values to hide from the store.")});const s=a({keyId:e().max(i),modelId:e().max(i),title:e().max(i).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const _=a({tiers:a({fast:s,smart:s,thinking:s,image:s,web_search:s,deep_research:s})});a({tiers:a({fast:s.optional(),smart:s.optional(),thinking:s.optional()})});a({ids:c(e().max(i)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const y=a({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.")}),b=new Set(["reviewer_enabled","cheap_reviewer_model"]);function v(n,r){const h=n?.[r];return b.has(r)?h!==!1:h===!0}function x(n){const r=n?.auto_resolve_conflicts;return typeof r=="boolean"?r:n?.auto_merge===!0}const l=256*1024,f=50,o=500,u=5e3;a({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(u).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:a({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:a({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:c(d(e(),m())).max(f).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),m()).nullable().optional().refine(n=>n==null||JSON.stringify(n).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{b as D,y as O,_ as S,x as a,v as o};
@@ -1 +1 @@
1
- import{r as d,bo as A,bv as ce,j as b,bq as _,bH as ae,dk as O,br as C,bA as P,bt as ie,c as F,l as $}from"./index-BRPaWRo-.js";import{e as de}from"./select-DoCMn5nH.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),[T,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),v=A(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:T,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,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=A(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=A(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=A(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,T]=d.useState(null),Y=A(e,v=>T(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 H(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"),H(v))}),onPointerMove:C(r.onPointerMove,H),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})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,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(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=A(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,T=h.clientY-S.top;s.onThumbPointerDown({x:w,y:T})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;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,bo as A,bv as ce,j as b,bq as _,bH as ae,dk as O,br as C,bA as P,bt as ie,c as F,l as $}from"./index-J-HhaIRe.js";import{e as de}from"./select-zKx4kd1b.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),[T,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,H]=d.useState(!1),v=A(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:T,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:H,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=A(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=A(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=A(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,T]=d.useState(null),Y=A(e,v=>T(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 H(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"),H(v))}),onPointerMove:C(r.onPointerMove,H),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})})})}),W="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(W,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(W,o),s=ee(W,o),{onThumbPositionChange:a}=s,c=A(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,T=h.clientY-S.top;s.onThumbPointerDown({x:w,y:T})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=W;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 +1 @@
1
- import{c as b,l as w,j as a,h as j}from"./index-BRPaWRo-.js";import{i as v}from"./SearchMd-Dgu5BSsL.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-J-HhaIRe.js";import{i as v}from"./SearchMd-DWKZ-mHQ.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-BRPaWRo-.js";import{i as I}from"./SearchMd-Dgu5BSsL.js";import{i as M}from"./X-C5DCm1y_.js";import{I as O}from"./icon-button-DtAyZPaw.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-J-HhaIRe.js";import{i as I}from"./SearchMd-DWKZ-mHQ.js";import{i as M}from"./X-BGniQsFS.js";import{I as O}from"./icon-button-DYZouDqo.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 v,b as C,j as s,n as w,e$ as F,E as L,r as y,aQ as O,Z as B,B as z,R as E,t as _}from"./index-BRPaWRo-.js";import{i as R}from"./AlertCircle-Dp9-4uGL.js";import{s as A}from"./Plus-BOiGcAFt.js";import{s as I}from"./User01-DEAOyUK3.js";import{t as q}from"./Users01-BhnSoj1S.js";import{D as V,b as H,c as Q,d as Z,h as G,e as J}from"./dialog-DqpJkgtD.js";import{I as P}from"./input-Dfi6JpaU.js";import{L as D}from"./label-DRb1UAWz.js";import{S as K,b as M,a as U,d as W,c as $}from"./select-DoCMn5nH.js";import{T as X}from"./textarea-B5S25kzg.js";import{u as Y,a as ee}from"./use-secrets-DfgVJ2My.js";import{R as te}from"./require-capability-UII3z9hP.js";import"./X-C5DCm1y_.js";import"./index-8jHgu7SV.js";import"./ChevronUp-sV1u8S9q.js";import"./access-gate-DX91gcCP.js";import"./capability-load-error-BF6EpFcl.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(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(Q,{children:[s.jsx(Z,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{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(K,{value:n,onValueChange:x=>c(x),children:[s.jsx(M,{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(J,{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=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(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 Pe(){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{Pe 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,aQ as O,Z as B,B as z,R as E,t as _}from"./index-J-HhaIRe.js";import{i as R}from"./AlertCircle-CGFLJpTs.js";import{s as A}from"./Plus-D3XzoCF3.js";import{s as I}from"./User01-3GLc_M8a.js";import{t as q}from"./Users01-DZ2aEDSy.js";import{D as V,b as H,c as Q,d as Z,h as G,e as J}from"./dialog-DTxKdk6B.js";import{I as P}from"./input-D5ksR5GW.js";import{L as D}from"./label-CjHJo36P.js";import{S as K,b as M,a as U,d as W,c as $}from"./select-zKx4kd1b.js";import{T as X}from"./textarea-IiEjpID3.js";import{u as Y,a as ee}from"./use-secrets-q0A46oGN.js";import{R as te}from"./require-capability-D2eRS8Ds.js";import"./X-BGniQsFS.js";import"./index-DB2dtavd.js";import"./ChevronUp-DSgAhhLJ.js";import"./access-gate-C6A3nRFO.js";import"./capability-load-error-qgxNzLRH.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(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(Q,{children:[s.jsx(Z,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{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(K,{value:n,onValueChange:x=>c(x),children:[s.jsx(M,{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(J,{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=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(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 Pe(){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{Pe as default};
@@ -1,2 +1,2 @@
1
- import{c as it,b as Ct,r as w,l as Ie,j as s,aO as cn,Z as os,B as at,F as un,G as vt,I as dn,aN as mn,H as fn,h as pn,aM as qa,o as Ga,t as Z,K as Wa}from"./index-BRPaWRo-.js";import{u as Ya}from"./chat-context-2kVChe1m.js";import{I as gn,J as Ja,K as Qa,L as hn,N as Za,O as Xa,V as eo,Q as to,T as vn,U as so,W as no,X as Ft,Y as Sn,Z as ao,_ as oo,e as io,f as ro,h as lo,u as co,$ as Gs,a0 as uo,a1 as mo,a2 as fo,a3 as po,a4 as go,p as Xt,a5 as ho,A as xt,a6 as Bt,a7 as vo,a8 as So,a9 as ot,aa as Ws,z as yo,ab as bo,ac as Ys,ad as xo,ae as _o,H as It,af as es,ag as Js,M as jo,C as xs,ah as ht,G as Vt,ai as Eo,aj as Ro,ak as wo,F as ko,al as To,am as Vo,an as _t,ao as Do,ap as No,aq as Ao,d as Po,ar as Qs,as as Ot,at as Zs,au as Co,av as Mo,aw as Ko,ax as Lo,y as _s,ay as Xs,az as en,aA as Dt,aB as ts,aC as js,aD as Bo,aE as Io,aF as Oo,aG as Fo,aH as zo}from"./runnable-block-editor-DiOjyJY3.js";import{d as $o}from"./use-virtual-mcp-CkVjIQBx.js";import{n as Ho,t as Uo}from"./ChevronUp-sV1u8S9q.js";import{z as Rs,bj as qo,a2 as ws,a5 as Go,o as Wo,P as Yo,x as Jo}from"./agent-icon-UkUz72j1.js";import{i as yn}from"./Globe01-fYg4pZgD.js";import{S as ss}from"./scroll-area-4pfR4KXf.js";import{c as Nt,T as At,a as Pt}from"./tooltip-CHwKR_-k.js";import{d as Qo,h as Zo,c as Xo,e as ei,b as ti,D as si}from"./dialog-DqpJkgtD.js";import{I as ni}from"./input-Dfi6JpaU.js";import{m as ai,u as oi,P as ii}from"./mustache-CsH2CXct.js";import{b as bn,G as ri,e as li,j as ci,g as ui,r as ns,M as tn}from"./claim-phase-copy-0btUuJoC.js";import{a as xn}from"./Copy01-DzDBcbz0.js";import{c as _n}from"./UserSquare-n4jXoTmN.js";import{i as di}from"./Settings02-CL4hLItW.js";import{s as mi}from"./Eye-PvWoxqY9.js";import{s as fi}from"./TrendUp01-CyHcLfeA.js";import{s as ks}from"./Plus-BOiGcAFt.js";import{s as jn}from"./Trash01-QZwDLax2.js";import{i as pi}from"./Zap-Df8s4LtK.js";import{a as En,b as as,d as Rn,K as wn,P as kn,u as Tn,C as Vn,s as Dn,e as zt,D as Nn,c as An,S as Pn,v as Cn}from"./rich-text-link-control-XKcUgEYo.js";import{s as gi}from"./safe-image-url-D5z803Ot.js";import{a as hi,P as vi,b as Si}from"./page-seo-form-B2elNExj.js";import{a as yi}from"./Tool01-z2bboeAO.js";import{u as bi,A as xi}from"./use-section-preview-base-CU9Y5hvz.js";import{b as sn,a as _i}from"./variant-matcher-override-ByjeDRSE.js";import"./use-panel-navigate-Chuzw-rn.js";import"./thread-route-BnB-FbSU.js";import"./use-project-scope-mm4wUXYr.js";import"./github-repo-BknN0SVI.js";import"./autosend-DI1--obS.js";import"./thread-intent-B0zO6cq8.js";import"./slugify-CEUa2lfQ.js";import"./hooks-C0tgwOmM.js";import"./use-mcp-client-COESFWVa.js";import"./auth-PesCBjhl.js";import"./backoff-8mStPHYB.js";import"./task-board-CcpOhcy4.js";import"./schema-C7QXUiED.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-CScQVp2_.js";import"./use-ai-providers-2DMSS8F3.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-BQ30YqEW.js";import"./use-organization-settings-Be4UD12s.js";import"./use-session-runtime-CiFwd2ON.js";import"./decofile-api-BbZF6zYQ.js";import"./utils-b5kzEb0v.js";import"./ZoomOut-DW85jM8U.js";import"./Image01-DSpVkEsU.js";import"./sandbox-url-D3mC8qhT.js";import"./Play-DMSe6o7-.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-B0QPWKX-.js";import"./Stars01-d503ijmt.js";import"./Tool02-Cd91k1L_.js";import"./ArrowRight-BxXRK-9T.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-B7hv9iRj.js";import"./use-copy-BM1-zBmR.js";import"./usage-stats-aKXWUmvx.js";import"./markdown-BHYHFE5D.js";import"./Download01-B-j-PqXV.js";import"./org-file-open-context-uN9hrCO1.js";import"./use-mobile-Cpd2MZ1z.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CcpKc2N2.js";import"./types-DZIFiTO8.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-BZLKfjYs.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-Dp9-4uGL.js";import"./XClose-C9CCRs8f.js";import"./Share07-BkxYWQqa.js";import"./SearchMd-Dgu5BSsL.js";import"./shell-layout-CLZ3Rv0X.js";import"./avatar-EZue9I__.js";import"./User01-DEAOyUK3.js";import"./Globe04-BS9lOiYa.js";import"./SearchLg-CE6yXrvc.js";import"./download-app-dialog-CLLpE1Va.js";import"./CheckCircle-nFjpVjB-.js";import"./Monitor01-DhgCTrJw.js";import"./command-BtNpU6EY.js";import"./index-CTktesQe.js";import"./integration-icon-Dcqj-FW-.js";import"./project-icon-B5sk8DiS.js";import"./required-auth-layout-Ce7b2T9C.js";import"./use-org-sso-D01eFIHQ.js";import"./LinkExternal01-DwEzooFw.js";import"./sheet-BlT0ycOP.js";import"./X-C5DCm1y_.js";import"./use-connection-Cv12sY9Y.js";import"./Palette-BHutPJim.js";import"./use-navigate-to-agent-CXfbIl3z.js";import"./Link01-D1oz866b.js";import"./use-mcp-prompts-D_no5mU5.js";import"./index-DUo7RdjM.js";import"./form-DY61OzdM.js";import"./label-DRb1UAWz.js";import"./use-thread-outputs-jKRhjtXQ.js";import"./file-type-icon-DaEpPzuv.js";import"./popover-BxW4EeQD.js";import"./monaco-editor-BL4167yq.js";import"./editor-B6SPVf0p.js";import"./calendar-CtoAHdqx.js";import"./textarea-B5S25kzg.js";import"./select-DoCMn5nH.js";import"./index-8jHgu7SV.js";import"./switch-KRXjUmuU.js";import"./Upload01-DN1COvBA.js";import"./DotsVertical-nR6OZIyf.js";import"./search-input-CFnZ1EoZ.js";import"./tabs-DavXAQpQ.js";import"./use-debounced-value-BbIU6jk8.js";import"./use-file-configs-BPPTWkg1.js";import"./asset-utils-CTapiLZF.js";import"./useInfiniteQuery-BmZ0LIU0.js";import"./infiniteQueryObserver-C7HqNpWB.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-CisId5Hk.js";import"./alert-dialog-ZjPwJc65.js";import"./sandbox-git-api-CMdpE2TE.js";import"./ArrowUp-CAUxOu8p.js";import"./ArrowLeft-CoVGTgdo.js";import"./CreditCard01-CGjET6rc.js";import"./Key01-Cfzm2tKV.js";import"./LayoutLeft-CehGoQ2f.js";import"./Sun-D3L9_gRp.js";import"./Package-BE4Z0-75.js";import"./Users01-BhnSoj1S.js";import"./XCircle-BlIZZKKY.js";import"./section-preview-url-Csj0_ZDg.js";function ji(d){return d.schema?.definitions??d.schema?.$defs??{}}function Mn(d,e){const o=ji(e),l=o[btoa(d)];if(!l)return[];const m=[l];if(Array.isArray(l.allOf)){const _=l.allOf.find(x=>typeof x.$ref=="string")?.$ref;if(typeof _=="string"){const x=o[_.replace("#/definitions/","")];x&&m.push(x)}}return m}function Ei(d,e){for(const o of Mn(d,e)){const l=typeof o.image=="string"?o.image:void 0;if(l?.includes("{{{"))return l}}function Ri(d,e){if(!e)return;const o=gn(d);if(!o)return;const l=Ei(o.resolveType,e);if(!l)return;const m=Ja(l,o.data);if(m)return gi(m)}const wi={escape:Qa};function ki(d,e){for(const o of Mn(d,e)){const l=typeof o.title=="string"?o.title:void 0;if(l?.includes("{{"))return l}}function Ti(d,e){if(!e)return;const o=gn(d);if(o)try{const l=ki(o.resolveType,e);return l&&ai.render(l,o.data,{},wi).trim()||void 0}catch{return}}const Vi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Di="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 nn(d){return Array.from({length:d},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Kn(d){return d.map((e,o)=>({...e,index:o}))}function Ni(d,e){if(e===d.length)return d;if(e<d.length)return Kn(d.slice(0,e));const o=Array.from({length:e-d.length},(l,m)=>({id:crypto.randomUUID(),index:d.length+m}));return[...d,...o]}function Ln(d){const e=it.c(38),{section:o,raw:l,meta:m,decofile:_}=d,x=os(),v=o.isSavedBlock===!0,b=o.isMultivariate===!0;let g;e[0]!==m||e[1]!==l?(g=l&&m?Ri(l,m):void 0,e[0]=m,e[1]=l,e[2]=g):g=e[2];const R=g;let H;e[3]!==m||e[4]!==b||e[5]!==l||e[6]!==v?(H=l&&m&&!v&&!b?Ti(l,m):void 0,e[3]=m,e[4]=b,e[5]=l,e[6]=v,e[7]=H):H=e[7];const z=H;let I;e[8]!==_||e[9]!==m||e[10]!==l||e[11]!==o?(I=to(l,o,_,m),e[8]=_,e[9]=m,e[10]=l,e[11]=o,e[12]=I):I=e[12];const E=I,f=b?qo:_n;let h;e[13]!==b||e[14]!==v?(h=v?{color:ri}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[13]=b,e[14]=v,e[15]=h):h=e[15];const C=h;let N;e[16]!==f||e[17]!==x||e[18]!==C?(N=x?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx(f,{className:"absolute inset-0 size-4 transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:C}),s.jsx(ws,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):s.jsx(ws,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[16]=f,e[17]=x,e[18]=C,e[19]=N):N=e[19];let i;e[20]!==R?(i=R&&s.jsx("img",{src:R,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[20]=R,e[21]=i):i=e[21];let V;e[22]!==x||e[23]!==C?(V=!x&&s.jsx(Rs,{className:"h-4 w-4 shrink-0",style:C}),e[22]=x,e[23]=C,e[24]=V):V=e[24];const c=o.isHidden&&"line-through opacity-50";let B;e[25]!==c?(B=Ie("min-w-0 flex-1 truncate text-sm font-medium",c),e[25]=c,e[26]=B):B=e[26];const F=z??o.label;let U;e[27]!==F||e[28]!==B?(U=s.jsx("span",{className:B,children:F}),e[27]=F,e[28]=B,e[29]=U):U=e[29];let ae;e[30]!==E?(ae=E&&s.jsx(so,{className:"absolute -right-0.5 -top-0.5"}),e[30]=E,e[31]=ae):ae=e[31];let fe;return e[32]!==U||e[33]!==ae||e[34]!==N||e[35]!==i||e[36]!==V?(fe=s.jsxs(s.Fragment,{children:[N,i,V,U,ae]}),e[32]=U,e[33]=ae,e[34]=N,e[35]=i,e[36]=V,e[37]=fe):fe=e[37],fe}const Ai="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Pi="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]",Ci="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";function Es(d,e){return Ie("h-7 shrink-0 overflow-hidden",e?Ai:d?Ci:Pi)}function Bn(d,e){const o=d.isSavedBlock===!0,l=d.isMultivariate===!0;return Ie("group relative flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Vi:l?vn:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Mi(d){const e=it.c(85),{section:o,raw:l,meta:m,decofile:_,sortableId:x,selected:v,onSelect:b,onDelete:g,onDuplicate:R,onMakeReusable:H,onToggleHidden:z,onToggleLazy:I,onAddVariant:E,onDetach:f}=d,h=Ct(),C=os(),N=l?bn(l.__resolveType??""):!1,i=o.isHidden===!0,V=N||i;let c;e[0]!==o?(c=Za(o),e[0]=o,e[1]=c):c=e[1];const B=c;let F;e[2]!==x?(F={id:x,animateLayoutChanges:Oi},e[2]=x,e[3]=F):F=e[3];const{attributes:U,listeners:ae,setNodeRef:fe,transform:oe,isDragging:u}=Tn(F);let D;e[4]!==oe?(D=Vn.Transform.toString(oe?{...oe,x:0}:null),e[4]=oe,e[5]=D):D=e[5];const ne=u?0:void 0;let k;e[6]!==D||e[7]!==ne?(k={transform:D,opacity:ne},e[6]=D,e[7]=ne,e[8]=k):k=e[8];const ke=k;let P;e[9]!==o?(P=Xa(o),e[9]=o,e[10]=P):P=e[10];const Te=P;let J;e[11]!==b?(J=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),b())},e[11]=b,e[12]=J):J=e[12];const Ne=u?"cursor-grabbing":"cursor-pointer";let Je;e[13]!==o||e[14]!==v||e[15]!==Ne?(Je=Ie("touch-none transition-colors",Ne,Bn(o,v)),e[13]=o,e[14]=v,e[15]=Ne,e[16]=Je):Je=e[16];let Ue;e[17]!==_||e[18]!==m||e[19]!==l||e[20]!==o?(Ue=s.jsx(Ln,{section:o,raw:l,meta:m,decofile:_}),e[17]=_,e[18]=m,e[19]=l,e[20]=o,e[21]=Ue):Ue=e[21];let ye;e[22]!==i||e[23]!==h?(ye=h(i?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[22]=i,e[23]=h,e[24]=ye):ye=e[24];let Ae;e[25]!==z?(Ae=T=>{T.stopPropagation(),z()},e[25]=z,e[26]=Ae):Ae=e[26];let Ee;e[27]!==i?(Ee=i?s.jsx(di,{className:"h-3.5 w-3.5"}):s.jsx(mi,{className:"h-3.5 w-3.5"}),e[27]=i,e[28]=Ee):Ee=e[28];let q;e[29]!==i||e[30]!==h?(q=h(i?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[29]=i,e[30]=h,e[31]=q):q=e[31];let M;e[32]!==q?(M=s.jsx(Pt,{side:"bottom",children:q}),e[32]=q,e[33]=M):M=e[33];const pe=dn,be=un,ze=!0,Pe=at,te="button",ge="ghost",Be="icon";let le;e[34]!==h?(le=h("sectionsEditor.sectionList.sectionActionsMenu"),e[34]=h,e[35]=le):le=e[35];const ie=Ie(Es(V,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let he;e[36]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(mn,{className:"h-3.5 w-3.5"}),e[36]=he):he=e[36];let se;e[37]!==Pe||e[38]!==le||e[39]!==ie?(se=s.jsx(Pe,{type:te,variant:ge,size:Be,"aria-label":le,className:ie,onClick:Li,onPointerDown:Ki,children:he}),e[37]=Pe,e[38]=le,e[39]=ie,e[40]=se):se=e[40];let de;e[41]!==be||e[42]!==se?(de=s.jsx(be,{asChild:ze,children:se}),e[41]=be,e[42]=se,e[43]=de):de=e[43];let Re;e[44]!==R?(Re=T=>{T.stopPropagation(),R()},e[44]=R,e[45]=Re):Re=e[45];let Ce;e[46]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(xn,{className:"h-4 w-4"}),e[46]=Ce):Ce=e[46];let ce;e[47]!==h?(ce=h("sectionsEditor.sectionList.duplicateMenuItem"),e[47]=h,e[48]=ce):ce=e[48];let Ve;e[49]!==Re||e[50]!==ce?(Ve=s.jsxs(vt,{onClick:Re,children:[Ce,ce]}),e[49]=Re,e[50]=ce,e[51]=Ve):Ve=e[51];let ve;e[52]!==B||e[53]!==E||e[54]!==h?(ve=B&&s.jsxs(vt,{className:eo,onClick:T=>{T.stopPropagation(),E()},children:[s.jsx(fi,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.addVariantMenuItem")]}),e[52]=B,e[53]=E,e[54]=h,e[55]=ve):ve=e[55];let X;e[56]!==C||e[57]!==Te||e[58]!==H||e[59]!==h?(X=Te&&s.jsxs(vt,{className:Di,onClick:T=>{T.stopPropagation(),H()},children:[C?s.jsx(yn,{className:"h-4 w-4"}):s.jsx(Rs,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[56]=C,e[57]=Te,e[58]=H,e[59]=h,e[60]=X):X=e[60];let O;e[61]!==C||e[62]!==f||e[63]!==o.isMultivariate||e[64]!==o.isSavedBlock||e[65]!==h?(O=o.isSavedBlock===!0&&!o.isMultivariate&&s.jsxs(vt,{onClick:T=>{T.stopPropagation(),f()},children:[C?s.jsx(_n,{className:"h-4 w-4"}):s.jsx(Rs,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.detachMenuItem")]}),e[61]=C,e[62]=f,e[63]=o.isMultivariate,e[64]=o.isSavedBlock,e[65]=h,e[66]=O):O=e[66];let re;e[67]!==g?(re=T=>{T.stopPropagation(),g()},e[67]=g,e[68]=re):re=e[68];let xe;e[69]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(jn,{className:"h-4 w-4"}),e[69]=xe):xe=e[69];let me;e[70]!==h?(me=h("sectionsEditor.sectionList.deleteMenuItem"),e[70]=h,e[71]=me):me=e[71];let Me;e[72]!==re||e[73]!==me?(Me=s.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:re,children:[xe,me]}),e[72]=re,e[73]=me,e[74]=Me):Me=e[74];let ue;e[75]!==Ve||e[76]!==ve||e[77]!==X||e[78]!==O||e[79]!==Me?(ue=s.jsxs(fn,{align:"end",className:"w-44",children:[Ve,ve,X,O,Me]}),e[75]=Ve,e[76]=ve,e[77]=X,e[78]=O,e[79]=Me,e[80]=ue):ue=e[80];let L;return e[81]!==pe||e[82]!==de||e[83]!==ue?(L=s.jsxs(pe,{children:[de,ue]}),e[81]=pe,e[82]=de,e[83]=ue,e[84]=L):L=e[84],s.jsxs("div",{ref:fe,style:ke,...U,...ae,role:"button",tabIndex:0,onClick:b,onKeyDown:J,className:Je,children:[Ue,!o.isMultivariate&&s.jsxs(Nt,{children:[s.jsx(At,{asChild:!0,children:s.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":h(N?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ie(Es(V,N)),onClick:T=>{T.stopPropagation(),I()},onPointerDown:Ii,children:s.jsx(pi,{className:Ie("h-3.5 w-3.5",N&&"text-yellow-500")})})}),s.jsx(Pt,{side:"bottom",children:h(N?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),s.jsxs(Nt,{children:[s.jsx(At,{asChild:!0,children:s.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ie(Es(V,i)),onClick:Ae,onPointerDown:Bi,children:Ee})}),M]}),L]})}function Ki(d){return d.stopPropagation()}function Li(d){return d.stopPropagation()}function Bi(d){return d.stopPropagation()}function Ii(d){return d.stopPropagation()}function Oi(){return!1}function Fi(d){const e=it.c(106),{listKey:o,rawSections:l,sections:m,meta:_,decofile:x,selectedIndex:v,onSelect:b,onReorder:g,onDelete:R,onDuplicate:H,onMakeReusable:z,onToggleHidden:I,onToggleLazy:E,onAddVariant:f,onDetach:h,onAddSection:C,canAddSection:N}=d,i=N===void 0?!0:N,V=Ct();let c;e[0]!==m.length?(c=()=>nn(m.length),e[0]=m.length,e[1]=c):c=e[1];const[B,F]=w.useState(c),[U,ae]=w.useState(null),[fe,oe]=w.useState(o),[u,D]=w.useState(m.length),ne=w.useRef(!1);fe!==o?(oe(o),D(m.length),F(nn(m.length))):u!==m.length&&(D(m.length),F(ue=>Ni(ue,m.length)));let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k={activationConstraint:{distance:8}},e[2]=k):k=e[2];let ke;e[3]===Symbol.for("react.memo_cache_sentinel")?(ke={coordinateGetter:Dn},e[3]=ke):ke=e[3];const P=En(as(kn,k),as(wn,ke));let Te;e[4]!==B?(Te=B.map(zi),e[4]=B,e[5]=Te):Te=e[5];const J=Te;let Ne;e[6]===Symbol.for("react.memo_cache_sentinel")?(Ne=ue=>{ae(String(ue.active.id))},e[6]=Ne):Ne=e[6];const Je=Ne;let Ue;e[7]!==J||e[8]!==g?(Ue=ue=>{ae(null);const{active:L,over:T}=ue;if(!T||L.id===T.id)return;const Qe=J.indexOf(String(L.id)),Ge=J.indexOf(String(T.id));Qe===-1||Ge===-1||(F(mt=>Kn(zt([...mt],Qe,Ge))),ne.current=!0,requestAnimationFrame(()=>{ne.current=!1}),g?.(Qe,Ge))},e[7]=J,e[8]=g,e[9]=Ue):Ue=e[9];const ye=Ue;let Ae;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ae=()=>{ae(null)},e[10]=Ae):Ae=e[10];const Ee=Ae;let q,M,pe,be,ze,Pe,te,ge,Be,le,ie,he,se,de,Re;if(e[11]!==U||e[12]!==i||e[13]!==x||e[14]!==B||e[15]!==J||e[16]!==ye||e[17]!==_||e[18]!==C||e[19]!==f||e[20]!==R||e[21]!==h||e[22]!==H||e[23]!==z||e[24]!==b||e[25]!==I||e[26]!==E||e[27]!==l||e[28]!==m||e[29]!==v||e[30]!==P||e[31]!==V){de=Symbol.for("react.early_return_sentinel");e:{const ue=L=>{ne.current||b(L)};if(e[47]!==U||e[48]!==i||e[49]!==B||e[50]!==C||e[51]!==l||e[52]!==m||e[53]!==V){const L=U?B.find(T=>T.id===U):null;if(be=L!=null?m[L.index]:null,pe=L!=null?l[L.index]:void 0,B.length===0){let T;e[57]!==V?(T=V("sectionsEditor.sectionList.noSections"),e[57]=V,e[58]=T):T=e[58];let Qe;e[59]!==T?(Qe=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:T}),e[59]=T,e[60]=Qe):Qe=e[60];const Ge=!i;let mt;e[61]===Symbol.for("react.memo_cache_sentinel")?(mt=s.jsx(ks,{size:14}),e[61]=mt):mt=e[61];let Ze;e[62]!==V?(Ze=V("sectionsEditor.sectionList.addSectionButton"),e[62]=V,e[63]=Ze):Ze=e[63];let De;e[64]!==C||e[65]!==Ge||e[66]!==Ze?(De=s.jsxs(at,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ge,onClick:C,children:[mt,Ze]}),e[64]=C,e[65]=Ge,e[66]=Ze,e[67]=De):De=e[67];let $e;e[68]!==Qe||e[69]!==De?($e=s.jsxs("div",{className:"space-y-2",children:[Qe,De]}),e[68]=Qe,e[69]=De,e[70]=$e):$e=e[70],de=$e;break e}se=Ie(L&&"cursor-grabbing"),e[47]=U,e[48]=i,e[49]=B,e[50]=C,e[51]=l,e[52]=m,e[53]=V,e[54]=pe,e[55]=be,e[56]=se}else pe=e[54],be=e[55],se=e[56];M=Nn,ge=P,Be=An,le=Je,ie=ye,he=Ee,q=Pn,Pe=J,te=Cn,Re="space-y-1",ze=B.map(L=>{const T=m[L.index];return T?s.jsx(Mi,{sortableId:L.id,section:T,raw:l[L.index],meta:_,decofile:x,selected:v===L.index,onSelect:()=>ue(L.index),onDelete:()=>R(L.index),onDuplicate:()=>H(L.index),onMakeReusable:()=>z(L.index),onToggleHidden:()=>I(L.index),onToggleLazy:()=>E(L.index),onAddVariant:()=>f(L.index),onDetach:()=>h(L.index)},L.id):null})}e[11]=U,e[12]=i,e[13]=x,e[14]=B,e[15]=J,e[16]=ye,e[17]=_,e[18]=C,e[19]=f,e[20]=R,e[21]=h,e[22]=H,e[23]=z,e[24]=b,e[25]=I,e[26]=E,e[27]=l,e[28]=m,e[29]=v,e[30]=P,e[31]=V,e[32]=q,e[33]=M,e[34]=pe,e[35]=be,e[36]=ze,e[37]=Pe,e[38]=te,e[39]=ge,e[40]=Be,e[41]=le,e[42]=ie,e[43]=he,e[44]=se,e[45]=de,e[46]=Re}else q=e[32],M=e[33],pe=e[34],be=e[35],ze=e[36],Pe=e[37],te=e[38],ge=e[39],Be=e[40],le=e[41],ie=e[42],he=e[43],se=e[44],de=e[45],Re=e[46];if(de!==Symbol.for("react.early_return_sentinel"))return de;let Ce;e[71]!==ze||e[72]!==Re?(Ce=s.jsx("div",{className:Re,children:ze}),e[71]=ze,e[72]=Re,e[73]=Ce):Ce=e[73];let ce;e[74]!==q||e[75]!==Pe||e[76]!==te||e[77]!==Ce?(ce=s.jsx(q,{items:Pe,strategy:te,children:Ce}),e[74]=q,e[75]=Pe,e[76]=te,e[77]=Ce,e[78]=ce):ce=e[78];let Ve;e[79]!==pe||e[80]!==be||e[81]!==x||e[82]!==_?(Ve=be?s.jsx("div",{className:Ie("cursor-grabbing shadow-lg ring-1 ring-border/60",Bn(be,!1)),children:s.jsx(Ln,{section:be,raw:pe,meta:_,decofile:x})}):null,e[79]=pe,e[80]=be,e[81]=x,e[82]=_,e[83]=Ve):Ve=e[83];let ve;e[84]!==Ve?(ve=cn.createPortal(s.jsx(Rn,{dropAnimation:hn,children:Ve}),document.body),e[84]=Ve,e[85]=ve):ve=e[85];let X;e[86]!==M||e[87]!==ge||e[88]!==Be||e[89]!==le||e[90]!==ie||e[91]!==he||e[92]!==ce||e[93]!==ve?(X=s.jsxs(M,{sensors:ge,collisionDetection:Be,onDragStart:le,onDragEnd:ie,onDragCancel:he,children:[ce,ve]}),e[86]=M,e[87]=ge,e[88]=Be,e[89]=le,e[90]=ie,e[91]=he,e[92]=ce,e[93]=ve,e[94]=X):X=e[94];const O=!i;let re;e[95]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(ks,{size:14}),e[95]=re):re=e[95];let xe;e[96]!==V?(xe=V("sectionsEditor.sectionList.addSectionButton"),e[96]=V,e[97]=xe):xe=e[97];let me;e[98]!==C||e[99]!==O||e[100]!==xe?(me=s.jsxs(at,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:O,onClick:C,children:[re,xe]}),e[98]=C,e[99]=O,e[100]=xe,e[101]=me):me=e[101];let Me;return e[102]!==se||e[103]!==X||e[104]!==me?(Me=s.jsxs("div",{className:se,children:[X,me]}),e[102]=se,e[103]=X,e[104]=me,e[105]=Me):Me=e[105],Me}function zi(d){return d.id}function an(d){const e=it.c(57),{open:o,initialName:l,autoLabel:m,isPending:_,onSubmit:x,onOpenChange:v}=d,b=_===void 0?!1:_,g=Ct(),[R,H]=w.useState(l),[z,I]=w.useState(o);o!==z&&(I(o),o&&H(l));let E;e[0]!==b||e[1]!==v?(E=Ne=>{!Ne&&!b&&v(!1)},e[0]=b,e[1]=v,e[2]=E):E=e[2];const f=E;let h;e[3]!==b||e[4]!==R||e[5]!==x?(h=async Ne=>{Ne.preventDefault(),!b&&await x(R.trim())},e[3]=b,e[4]=R,e[5]=x,e[6]=h):h=e[6];const C=h;let N;e[7]!==g?(N=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=N):N=e[8];let i;e[9]!==N?(i=s.jsx(Qo,{children:N}),e[9]=N,e[10]=i):i=e[10];let V;e[11]!==m||e[12]!==g?(V=g("sectionsEditor.variantRenameDialog.description",{fallback:m||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=g,e[13]=V):V=e[13];let c;e[14]!==V?(c=s.jsx(Zo,{children:V}),e[14]=V,e[15]=c):c=e[15];let B;e[16]!==i||e[17]!==c?(B=s.jsxs(Xo,{children:[i,c]}),e[16]=i,e[17]=c,e[18]=B):B=e[18];let F;e[19]!==g?(F=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=F):F=e[20];let U;e[21]!==F?(U=s.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:F}),e[21]=F,e[22]=U):U=e[22];let ae;e[23]===Symbol.for("react.memo_cache_sentinel")?(ae=Ne=>H(Ne.target.value),e[23]=ae):ae=e[23];let fe;e[24]!==m||e[25]!==b||e[26]!==R?(fe=s.jsx(ni,{id:"variant-rename-name",value:R,onChange:ae,placeholder:m,autoFocus:!0,disabled:b}),e[24]=m,e[25]=b,e[26]=R,e[27]=fe):fe=e[27];let oe;e[28]!==U||e[29]!==fe?(oe=s.jsxs("div",{className:"space-y-1.5 py-4",children:[U,fe]}),e[28]=U,e[29]=fe,e[30]=oe):oe=e[30];let u;e[31]!==v?(u=()=>v(!1),e[31]=v,e[32]=u):u=e[32];let D;e[33]!==g?(D=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=D):D=e[34];let ne;e[35]!==b||e[36]!==u||e[37]!==D?(ne=s.jsx(at,{type:"button",variant:"outline",onClick:u,disabled:b,children:D}),e[35]=b,e[36]=u,e[37]=D,e[38]=ne):ne=e[38];let k;e[39]!==b||e[40]!==g?(k=b?s.jsxs(s.Fragment,{children:[s.jsx(pn,{className:"size-3.5"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=b,e[40]=g,e[41]=k):k=e[41];let ke;e[42]!==b||e[43]!==k?(ke=s.jsx(at,{type:"submit",disabled:b,children:k}),e[42]=b,e[43]=k,e[44]=ke):ke=e[44];let P;e[45]!==ne||e[46]!==ke?(P=s.jsxs(ei,{children:[ne,ke]}),e[45]=ne,e[46]=ke,e[47]=P):P=e[47];let Te;e[48]!==C||e[49]!==oe||e[50]!==P||e[51]!==B?(Te=s.jsx(ti,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:C,children:[B,oe,P]})}),e[48]=C,e[49]=oe,e[50]=P,e[51]=B,e[52]=Te):Te=e[52];let J;return e[53]!==f||e[54]!==o||e[55]!==Te?(J=s.jsx(si,{open:o,onOpenChange:f,children:Te}),e[53]=f,e[54]=o,e[55]=Te,e[56]=J):J=e[56],J}function Ts(d){const e=it.c(5),{rule:o,matchers:l}=d,m=o?.__resolveType??"";let _;if(e[0]!==l||e[1]!==m){const g=l.find(R=>R.resolveType===m)?.iconName??no(m);_=Go(g),e[0]=l,e[1]=m,e[2]=_}else _=e[2];const x=_;if(!x)return null;let v;return e[3]!==x?(v=s.jsx(x,{size:14,className:"shrink-0"}),e[3]=x,e[4]=v):v=e[4],v}function on(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
1
+ import{c as it,b as Ct,r as w,l as Ie,j as s,aO as cn,Z as os,B as at,F as un,G as vt,I as dn,aN as mn,H as fn,h as pn,aM as qa,o as Ga,t as Z,K as Wa}from"./index-J-HhaIRe.js";import{u as Ya}from"./chat-context-C7f3MLVZ.js";import{I as gn,J as Ja,K as Qa,L as hn,N as Za,O as Xa,V as eo,Q as to,T as vn,U as so,W as no,X as Ft,Y as Sn,Z as ao,_ as oo,e as io,f as ro,h as lo,u as co,$ as Gs,a0 as uo,a1 as mo,a2 as fo,a3 as po,a4 as go,p as Xt,a5 as ho,A as xt,a6 as Bt,a7 as vo,a8 as So,a9 as ot,aa as Ws,z as yo,ab as bo,ac as Ys,ad as xo,ae as _o,H as It,af as es,ag as Js,M as jo,C as xs,ah as ht,G as Vt,ai as Eo,aj as Ro,ak as wo,F as ko,al as To,am as Vo,an as _t,ao as Do,ap as No,aq as Ao,d as Po,ar as Qs,as as Ot,at as Zs,au as Co,av as Mo,aw as Ko,ax as Lo,y as _s,ay as Xs,az as en,aA as Dt,aB as ts,aC as js,aD as Bo,aE as Io,aF as Oo,aG as Fo,aH as zo}from"./runnable-block-editor-xiAEogpy.js";import{d as $o}from"./use-virtual-mcp-TYMfCW-P.js";import{n as Ho,t as Uo}from"./ChevronUp-DSgAhhLJ.js";import{z as Rs,bj as qo,a2 as ws,a5 as Go,o as Wo,P as Yo,x as Jo}from"./agent-icon-D496OkeL.js";import{i as yn}from"./Globe01-BWcV-98b.js";import{S as ss}from"./scroll-area-D72_bYX-.js";import{c as Nt,T as At,a as Pt}from"./tooltip-CvsJoQ2r.js";import{d as Qo,h as Zo,c as Xo,e as ei,b as ti,D as si}from"./dialog-DTxKdk6B.js";import{I as ni}from"./input-D5ksR5GW.js";import{m as ai,u as oi,P as ii}from"./mustache-CVWbGRah.js";import{b as bn,G as ri,e as li,j as ci,g as ui,r as ns,M as tn}from"./claim-phase-copy-0btUuJoC.js";import{a as xn}from"./Copy01-BaJ5hTZ2.js";import{c as _n}from"./UserSquare-CEWYtKNG.js";import{i as di}from"./Settings02-BqG3HPm0.js";import{s as mi}from"./Eye-DXecVoiS.js";import{s as fi}from"./TrendUp01-B5hqDidz.js";import{s as ks}from"./Plus-D3XzoCF3.js";import{s as jn}from"./Trash01-CRCUnlT2.js";import{i as pi}from"./Zap-BHpOc94D.js";import{a as En,b as as,d as Rn,K as wn,P as kn,u as Tn,C as Vn,s as Dn,e as zt,D as Nn,c as An,S as Pn,v as Cn}from"./rich-text-link-control-N5yQ4FMB.js";import{s as gi}from"./safe-image-url-D5z803Ot.js";import{a as hi,P as vi,b as Si}from"./page-seo-form-D9MSqhdC.js";import{a as yi}from"./Tool01-CE_c59RR.js";import{u as bi,A as xi}from"./use-section-preview-base-B_9x3Nht.js";import{b as sn,a as _i}from"./variant-matcher-override-Dko4GZ86.js";import"./use-panel-navigate-CXz4fRn5.js";import"./thread-route-BJtUmhwW.js";import"./use-project-scope-Dd3XRNTj.js";import"./github-repo-BknN0SVI.js";import"./autosend-CgAy_8nv.js";import"./thread-intent-DeoW4DlO.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DgdsVzEA.js";import"./use-mcp-client-mvmVY_Sq.js";import"./auth-3KEna5Qg.js";import"./backoff-8mStPHYB.js";import"./task-board-BRDQJ0Y_.js";import"./schema-BmTPXP0h.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-z0zlslXa.js";import"./use-ai-providers-C5aBXU5x.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-Yer_uM_S.js";import"./use-organization-settings-C1FltOgT.js";import"./use-session-runtime-DQ_xnOm6.js";import"./decofile-api-BirlTWkL.js";import"./utils-eMZKRHuP.js";import"./ZoomOut-CDTxnLh4.js";import"./Image01-B5ab_A88.js";import"./sandbox-url-D3mC8qhT.js";import"./Play-CU4Q1GTp.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CU2rNVlM.js";import"./Stars01-BZHqW_f9.js";import"./Tool02-Bo-RIY8d.js";import"./ArrowRight-BOJ1d9xj.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-CL_tV3Eh.js";import"./use-copy-B-yVF-T4.js";import"./usage-stats-zzlmS7nl.js";import"./markdown-DN_WHoBa.js";import"./Download01-CGyaU6cf.js";import"./org-file-open-context-DLYT0cgI.js";import"./use-mobile-BtQeDX-z.js";import"./shell-layout-Dj-jZ6jC.js";import"./avatar-PPm_nVJO.js";import"./User01-3GLc_M8a.js";import"./Globe04-Cx7GY3vn.js";import"./SearchLg-BYoLM1MK.js";import"./XClose-wzn6XIaq.js";import"./download-app-dialog-B_OO5bFO.js";import"./CheckCircle-Bw2G2vwj.js";import"./Monitor01-Dentn30o.js";import"./Share07-o5jM3q0c.js";import"./command-Dp_xVMno.js";import"./index-9o3jDog2.js";import"./SearchMd-DWKZ-mHQ.js";import"./integration-icon-9SSN9Dl9.js";import"./project-icon-CrCdaVr_.js";import"./required-auth-layout-BKb9-6vC.js";import"./use-org-sso-Cb8Yn6yP.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BDiTxwS7.js";import"./types-DBvOp03a.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-CrkEu4dZ.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-CGFLJpTs.js";import"./LinkExternal01-BfutJB7X.js";import"./sheet-CCy35_-v.js";import"./X-BGniQsFS.js";import"./use-connection-BVWLSIgG.js";import"./Palette-DbXyfbJI.js";import"./use-navigate-to-agent-BiSNiCre.js";import"./Link01-Dx7hRSe5.js";import"./use-mcp-prompts-D4-Z04dj.js";import"./index-oMcUL3Yj.js";import"./form-Bw33z1SA.js";import"./label-CjHJo36P.js";import"./use-thread-outputs-CVc4ZTLK.js";import"./file-type-icon-CdJziZKk.js";import"./popover-CqiAzy6q.js";import"./monaco-editor-BSp0HKdn.js";import"./editor-DpRJQ9mq.js";import"./calendar-Bs8TzhBE.js";import"./textarea-IiEjpID3.js";import"./select-zKx4kd1b.js";import"./index-DB2dtavd.js";import"./switch-BTJnoG_j.js";import"./Upload01-Bl2MpUhj.js";import"./DotsVertical-Cz_1rDcG.js";import"./search-input-DVbLXCEj.js";import"./tabs-DNRDoJPn.js";import"./use-debounced-value-RCOUyhbk.js";import"./use-file-configs-DpTBLkPU.js";import"./asset-utils-ClvN_bIt.js";import"./useInfiniteQuery-DUvEi5Ym.js";import"./infiniteQueryObserver-Bp62E0f5.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-2-AJ4PX8.js";import"./alert-dialog-Bq7N6ZWF.js";import"./sandbox-git-api-CMdpE2TE.js";import"./ArrowUp-C1pJvrX2.js";import"./ArrowLeft-DC5XoBuA.js";import"./CreditCard01-DLxXT7_f.js";import"./Key01-D0TscG0E.js";import"./LayoutLeft-d27AQAwl.js";import"./Sun-DGhoQy96.js";import"./Package-CPNFyhMT.js";import"./Users01-DZ2aEDSy.js";import"./XCircle-CLEbTtoV.js";import"./section-preview-url-Csj0_ZDg.js";function ji(d){return d.schema?.definitions??d.schema?.$defs??{}}function Mn(d,e){const o=ji(e),l=o[btoa(d)];if(!l)return[];const m=[l];if(Array.isArray(l.allOf)){const _=l.allOf.find(x=>typeof x.$ref=="string")?.$ref;if(typeof _=="string"){const x=o[_.replace("#/definitions/","")];x&&m.push(x)}}return m}function Ei(d,e){for(const o of Mn(d,e)){const l=typeof o.image=="string"?o.image:void 0;if(l?.includes("{{{"))return l}}function Ri(d,e){if(!e)return;const o=gn(d);if(!o)return;const l=Ei(o.resolveType,e);if(!l)return;const m=Ja(l,o.data);if(m)return gi(m)}const wi={escape:Qa};function ki(d,e){for(const o of Mn(d,e)){const l=typeof o.title=="string"?o.title:void 0;if(l?.includes("{{"))return l}}function Ti(d,e){if(!e)return;const o=gn(d);if(o)try{const l=ki(o.resolveType,e);return l&&ai.render(l,o.data,{},wi).trim()||void 0}catch{return}}const Vi="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Di="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 nn(d){return Array.from({length:d},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Kn(d){return d.map((e,o)=>({...e,index:o}))}function Ni(d,e){if(e===d.length)return d;if(e<d.length)return Kn(d.slice(0,e));const o=Array.from({length:e-d.length},(l,m)=>({id:crypto.randomUUID(),index:d.length+m}));return[...d,...o]}function Ln(d){const e=it.c(38),{section:o,raw:l,meta:m,decofile:_}=d,x=os(),v=o.isSavedBlock===!0,b=o.isMultivariate===!0;let g;e[0]!==m||e[1]!==l?(g=l&&m?Ri(l,m):void 0,e[0]=m,e[1]=l,e[2]=g):g=e[2];const R=g;let H;e[3]!==m||e[4]!==b||e[5]!==l||e[6]!==v?(H=l&&m&&!v&&!b?Ti(l,m):void 0,e[3]=m,e[4]=b,e[5]=l,e[6]=v,e[7]=H):H=e[7];const z=H;let I;e[8]!==_||e[9]!==m||e[10]!==l||e[11]!==o?(I=to(l,o,_,m),e[8]=_,e[9]=m,e[10]=l,e[11]=o,e[12]=I):I=e[12];const E=I,f=b?qo:_n;let h;e[13]!==b||e[14]!==v?(h=v?{color:ri}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[13]=b,e[14]=v,e[15]=h):h=e[15];const C=h;let N;e[16]!==f||e[17]!==x||e[18]!==C?(N=x?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx(f,{className:"absolute inset-0 size-4 transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:C}),s.jsx(ws,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):s.jsx(ws,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[16]=f,e[17]=x,e[18]=C,e[19]=N):N=e[19];let i;e[20]!==R?(i=R&&s.jsx("img",{src:R,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[20]=R,e[21]=i):i=e[21];let V;e[22]!==x||e[23]!==C?(V=!x&&s.jsx(Rs,{className:"h-4 w-4 shrink-0",style:C}),e[22]=x,e[23]=C,e[24]=V):V=e[24];const c=o.isHidden&&"line-through opacity-50";let B;e[25]!==c?(B=Ie("min-w-0 flex-1 truncate text-sm font-medium",c),e[25]=c,e[26]=B):B=e[26];const F=z??o.label;let U;e[27]!==F||e[28]!==B?(U=s.jsx("span",{className:B,children:F}),e[27]=F,e[28]=B,e[29]=U):U=e[29];let ae;e[30]!==E?(ae=E&&s.jsx(so,{className:"absolute -right-0.5 -top-0.5"}),e[30]=E,e[31]=ae):ae=e[31];let fe;return e[32]!==U||e[33]!==ae||e[34]!==N||e[35]!==i||e[36]!==V?(fe=s.jsxs(s.Fragment,{children:[N,i,V,U,ae]}),e[32]=U,e[33]=ae,e[34]=N,e[35]=i,e[36]=V,e[37]=fe):fe=e[37],fe}const Ai="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",Pi="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]",Ci="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";function Es(d,e){return Ie("h-7 shrink-0 overflow-hidden",e?Ai:d?Ci:Pi)}function Bn(d,e){const o=d.isSavedBlock===!0,l=d.isMultivariate===!0;return Ie("group relative flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?Vi:l?vn:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Mi(d){const e=it.c(85),{section:o,raw:l,meta:m,decofile:_,sortableId:x,selected:v,onSelect:b,onDelete:g,onDuplicate:R,onMakeReusable:H,onToggleHidden:z,onToggleLazy:I,onAddVariant:E,onDetach:f}=d,h=Ct(),C=os(),N=l?bn(l.__resolveType??""):!1,i=o.isHidden===!0,V=N||i;let c;e[0]!==o?(c=Za(o),e[0]=o,e[1]=c):c=e[1];const B=c;let F;e[2]!==x?(F={id:x,animateLayoutChanges:Oi},e[2]=x,e[3]=F):F=e[3];const{attributes:U,listeners:ae,setNodeRef:fe,transform:oe,isDragging:u}=Tn(F);let D;e[4]!==oe?(D=Vn.Transform.toString(oe?{...oe,x:0}:null),e[4]=oe,e[5]=D):D=e[5];const ne=u?0:void 0;let k;e[6]!==D||e[7]!==ne?(k={transform:D,opacity:ne},e[6]=D,e[7]=ne,e[8]=k):k=e[8];const ke=k;let P;e[9]!==o?(P=Xa(o),e[9]=o,e[10]=P):P=e[10];const Te=P;let J;e[11]!==b?(J=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),b())},e[11]=b,e[12]=J):J=e[12];const Ne=u?"cursor-grabbing":"cursor-pointer";let Je;e[13]!==o||e[14]!==v||e[15]!==Ne?(Je=Ie("touch-none transition-colors",Ne,Bn(o,v)),e[13]=o,e[14]=v,e[15]=Ne,e[16]=Je):Je=e[16];let Ue;e[17]!==_||e[18]!==m||e[19]!==l||e[20]!==o?(Ue=s.jsx(Ln,{section:o,raw:l,meta:m,decofile:_}),e[17]=_,e[18]=m,e[19]=l,e[20]=o,e[21]=Ue):Ue=e[21];let ye;e[22]!==i||e[23]!==h?(ye=h(i?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[22]=i,e[23]=h,e[24]=ye):ye=e[24];let Ae;e[25]!==z?(Ae=T=>{T.stopPropagation(),z()},e[25]=z,e[26]=Ae):Ae=e[26];let Ee;e[27]!==i?(Ee=i?s.jsx(di,{className:"h-3.5 w-3.5"}):s.jsx(mi,{className:"h-3.5 w-3.5"}),e[27]=i,e[28]=Ee):Ee=e[28];let q;e[29]!==i||e[30]!==h?(q=h(i?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),e[29]=i,e[30]=h,e[31]=q):q=e[31];let M;e[32]!==q?(M=s.jsx(Pt,{side:"bottom",children:q}),e[32]=q,e[33]=M):M=e[33];const pe=dn,be=un,ze=!0,Pe=at,te="button",ge="ghost",Be="icon";let le;e[34]!==h?(le=h("sectionsEditor.sectionList.sectionActionsMenu"),e[34]=h,e[35]=le):le=e[35];const ie=Ie(Es(V,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let he;e[36]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(mn,{className:"h-3.5 w-3.5"}),e[36]=he):he=e[36];let se;e[37]!==Pe||e[38]!==le||e[39]!==ie?(se=s.jsx(Pe,{type:te,variant:ge,size:Be,"aria-label":le,className:ie,onClick:Li,onPointerDown:Ki,children:he}),e[37]=Pe,e[38]=le,e[39]=ie,e[40]=se):se=e[40];let de;e[41]!==be||e[42]!==se?(de=s.jsx(be,{asChild:ze,children:se}),e[41]=be,e[42]=se,e[43]=de):de=e[43];let Re;e[44]!==R?(Re=T=>{T.stopPropagation(),R()},e[44]=R,e[45]=Re):Re=e[45];let Ce;e[46]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(xn,{className:"h-4 w-4"}),e[46]=Ce):Ce=e[46];let ce;e[47]!==h?(ce=h("sectionsEditor.sectionList.duplicateMenuItem"),e[47]=h,e[48]=ce):ce=e[48];let Ve;e[49]!==Re||e[50]!==ce?(Ve=s.jsxs(vt,{onClick:Re,children:[Ce,ce]}),e[49]=Re,e[50]=ce,e[51]=Ve):Ve=e[51];let ve;e[52]!==B||e[53]!==E||e[54]!==h?(ve=B&&s.jsxs(vt,{className:eo,onClick:T=>{T.stopPropagation(),E()},children:[s.jsx(fi,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.addVariantMenuItem")]}),e[52]=B,e[53]=E,e[54]=h,e[55]=ve):ve=e[55];let X;e[56]!==C||e[57]!==Te||e[58]!==H||e[59]!==h?(X=Te&&s.jsxs(vt,{className:Di,onClick:T=>{T.stopPropagation(),H()},children:[C?s.jsx(yn,{className:"h-4 w-4"}):s.jsx(Rs,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[56]=C,e[57]=Te,e[58]=H,e[59]=h,e[60]=X):X=e[60];let O;e[61]!==C||e[62]!==f||e[63]!==o.isMultivariate||e[64]!==o.isSavedBlock||e[65]!==h?(O=o.isSavedBlock===!0&&!o.isMultivariate&&s.jsxs(vt,{onClick:T=>{T.stopPropagation(),f()},children:[C?s.jsx(_n,{className:"h-4 w-4"}):s.jsx(Rs,{className:"h-4 w-4"}),h("sectionsEditor.sectionList.detachMenuItem")]}),e[61]=C,e[62]=f,e[63]=o.isMultivariate,e[64]=o.isSavedBlock,e[65]=h,e[66]=O):O=e[66];let re;e[67]!==g?(re=T=>{T.stopPropagation(),g()},e[67]=g,e[68]=re):re=e[68];let xe;e[69]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(jn,{className:"h-4 w-4"}),e[69]=xe):xe=e[69];let me;e[70]!==h?(me=h("sectionsEditor.sectionList.deleteMenuItem"),e[70]=h,e[71]=me):me=e[71];let Me;e[72]!==re||e[73]!==me?(Me=s.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:re,children:[xe,me]}),e[72]=re,e[73]=me,e[74]=Me):Me=e[74];let ue;e[75]!==Ve||e[76]!==ve||e[77]!==X||e[78]!==O||e[79]!==Me?(ue=s.jsxs(fn,{align:"end",className:"w-44",children:[Ve,ve,X,O,Me]}),e[75]=Ve,e[76]=ve,e[77]=X,e[78]=O,e[79]=Me,e[80]=ue):ue=e[80];let L;return e[81]!==pe||e[82]!==de||e[83]!==ue?(L=s.jsxs(pe,{children:[de,ue]}),e[81]=pe,e[82]=de,e[83]=ue,e[84]=L):L=e[84],s.jsxs("div",{ref:fe,style:ke,...U,...ae,role:"button",tabIndex:0,onClick:b,onKeyDown:J,className:Je,children:[Ue,!o.isMultivariate&&s.jsxs(Nt,{children:[s.jsx(At,{asChild:!0,children:s.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":h(N?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:Ie(Es(V,N)),onClick:T=>{T.stopPropagation(),I()},onPointerDown:Ii,children:s.jsx(pi,{className:Ie("h-3.5 w-3.5",N&&"text-yellow-500")})})}),s.jsx(Pt,{side:"bottom",children:h(N?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),s.jsxs(Nt,{children:[s.jsx(At,{asChild:!0,children:s.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":ye,className:Ie(Es(V,i)),onClick:Ae,onPointerDown:Bi,children:Ee})}),M]}),L]})}function Ki(d){return d.stopPropagation()}function Li(d){return d.stopPropagation()}function Bi(d){return d.stopPropagation()}function Ii(d){return d.stopPropagation()}function Oi(){return!1}function Fi(d){const e=it.c(106),{listKey:o,rawSections:l,sections:m,meta:_,decofile:x,selectedIndex:v,onSelect:b,onReorder:g,onDelete:R,onDuplicate:H,onMakeReusable:z,onToggleHidden:I,onToggleLazy:E,onAddVariant:f,onDetach:h,onAddSection:C,canAddSection:N}=d,i=N===void 0?!0:N,V=Ct();let c;e[0]!==m.length?(c=()=>nn(m.length),e[0]=m.length,e[1]=c):c=e[1];const[B,F]=w.useState(c),[U,ae]=w.useState(null),[fe,oe]=w.useState(o),[u,D]=w.useState(m.length),ne=w.useRef(!1);fe!==o?(oe(o),D(m.length),F(nn(m.length))):u!==m.length&&(D(m.length),F(ue=>Ni(ue,m.length)));let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k={activationConstraint:{distance:8}},e[2]=k):k=e[2];let ke;e[3]===Symbol.for("react.memo_cache_sentinel")?(ke={coordinateGetter:Dn},e[3]=ke):ke=e[3];const P=En(as(kn,k),as(wn,ke));let Te;e[4]!==B?(Te=B.map(zi),e[4]=B,e[5]=Te):Te=e[5];const J=Te;let Ne;e[6]===Symbol.for("react.memo_cache_sentinel")?(Ne=ue=>{ae(String(ue.active.id))},e[6]=Ne):Ne=e[6];const Je=Ne;let Ue;e[7]!==J||e[8]!==g?(Ue=ue=>{ae(null);const{active:L,over:T}=ue;if(!T||L.id===T.id)return;const Qe=J.indexOf(String(L.id)),Ge=J.indexOf(String(T.id));Qe===-1||Ge===-1||(F(mt=>Kn(zt([...mt],Qe,Ge))),ne.current=!0,requestAnimationFrame(()=>{ne.current=!1}),g?.(Qe,Ge))},e[7]=J,e[8]=g,e[9]=Ue):Ue=e[9];const ye=Ue;let Ae;e[10]===Symbol.for("react.memo_cache_sentinel")?(Ae=()=>{ae(null)},e[10]=Ae):Ae=e[10];const Ee=Ae;let q,M,pe,be,ze,Pe,te,ge,Be,le,ie,he,se,de,Re;if(e[11]!==U||e[12]!==i||e[13]!==x||e[14]!==B||e[15]!==J||e[16]!==ye||e[17]!==_||e[18]!==C||e[19]!==f||e[20]!==R||e[21]!==h||e[22]!==H||e[23]!==z||e[24]!==b||e[25]!==I||e[26]!==E||e[27]!==l||e[28]!==m||e[29]!==v||e[30]!==P||e[31]!==V){de=Symbol.for("react.early_return_sentinel");e:{const ue=L=>{ne.current||b(L)};if(e[47]!==U||e[48]!==i||e[49]!==B||e[50]!==C||e[51]!==l||e[52]!==m||e[53]!==V){const L=U?B.find(T=>T.id===U):null;if(be=L!=null?m[L.index]:null,pe=L!=null?l[L.index]:void 0,B.length===0){let T;e[57]!==V?(T=V("sectionsEditor.sectionList.noSections"),e[57]=V,e[58]=T):T=e[58];let Qe;e[59]!==T?(Qe=s.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:T}),e[59]=T,e[60]=Qe):Qe=e[60];const Ge=!i;let mt;e[61]===Symbol.for("react.memo_cache_sentinel")?(mt=s.jsx(ks,{size:14}),e[61]=mt):mt=e[61];let Ze;e[62]!==V?(Ze=V("sectionsEditor.sectionList.addSectionButton"),e[62]=V,e[63]=Ze):Ze=e[63];let De;e[64]!==C||e[65]!==Ge||e[66]!==Ze?(De=s.jsxs(at,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ge,onClick:C,children:[mt,Ze]}),e[64]=C,e[65]=Ge,e[66]=Ze,e[67]=De):De=e[67];let $e;e[68]!==Qe||e[69]!==De?($e=s.jsxs("div",{className:"space-y-2",children:[Qe,De]}),e[68]=Qe,e[69]=De,e[70]=$e):$e=e[70],de=$e;break e}se=Ie(L&&"cursor-grabbing"),e[47]=U,e[48]=i,e[49]=B,e[50]=C,e[51]=l,e[52]=m,e[53]=V,e[54]=pe,e[55]=be,e[56]=se}else pe=e[54],be=e[55],se=e[56];M=Nn,ge=P,Be=An,le=Je,ie=ye,he=Ee,q=Pn,Pe=J,te=Cn,Re="space-y-1",ze=B.map(L=>{const T=m[L.index];return T?s.jsx(Mi,{sortableId:L.id,section:T,raw:l[L.index],meta:_,decofile:x,selected:v===L.index,onSelect:()=>ue(L.index),onDelete:()=>R(L.index),onDuplicate:()=>H(L.index),onMakeReusable:()=>z(L.index),onToggleHidden:()=>I(L.index),onToggleLazy:()=>E(L.index),onAddVariant:()=>f(L.index),onDetach:()=>h(L.index)},L.id):null})}e[11]=U,e[12]=i,e[13]=x,e[14]=B,e[15]=J,e[16]=ye,e[17]=_,e[18]=C,e[19]=f,e[20]=R,e[21]=h,e[22]=H,e[23]=z,e[24]=b,e[25]=I,e[26]=E,e[27]=l,e[28]=m,e[29]=v,e[30]=P,e[31]=V,e[32]=q,e[33]=M,e[34]=pe,e[35]=be,e[36]=ze,e[37]=Pe,e[38]=te,e[39]=ge,e[40]=Be,e[41]=le,e[42]=ie,e[43]=he,e[44]=se,e[45]=de,e[46]=Re}else q=e[32],M=e[33],pe=e[34],be=e[35],ze=e[36],Pe=e[37],te=e[38],ge=e[39],Be=e[40],le=e[41],ie=e[42],he=e[43],se=e[44],de=e[45],Re=e[46];if(de!==Symbol.for("react.early_return_sentinel"))return de;let Ce;e[71]!==ze||e[72]!==Re?(Ce=s.jsx("div",{className:Re,children:ze}),e[71]=ze,e[72]=Re,e[73]=Ce):Ce=e[73];let ce;e[74]!==q||e[75]!==Pe||e[76]!==te||e[77]!==Ce?(ce=s.jsx(q,{items:Pe,strategy:te,children:Ce}),e[74]=q,e[75]=Pe,e[76]=te,e[77]=Ce,e[78]=ce):ce=e[78];let Ve;e[79]!==pe||e[80]!==be||e[81]!==x||e[82]!==_?(Ve=be?s.jsx("div",{className:Ie("cursor-grabbing shadow-lg ring-1 ring-border/60",Bn(be,!1)),children:s.jsx(Ln,{section:be,raw:pe,meta:_,decofile:x})}):null,e[79]=pe,e[80]=be,e[81]=x,e[82]=_,e[83]=Ve):Ve=e[83];let ve;e[84]!==Ve?(ve=cn.createPortal(s.jsx(Rn,{dropAnimation:hn,children:Ve}),document.body),e[84]=Ve,e[85]=ve):ve=e[85];let X;e[86]!==M||e[87]!==ge||e[88]!==Be||e[89]!==le||e[90]!==ie||e[91]!==he||e[92]!==ce||e[93]!==ve?(X=s.jsxs(M,{sensors:ge,collisionDetection:Be,onDragStart:le,onDragEnd:ie,onDragCancel:he,children:[ce,ve]}),e[86]=M,e[87]=ge,e[88]=Be,e[89]=le,e[90]=ie,e[91]=he,e[92]=ce,e[93]=ve,e[94]=X):X=e[94];const O=!i;let re;e[95]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(ks,{size:14}),e[95]=re):re=e[95];let xe;e[96]!==V?(xe=V("sectionsEditor.sectionList.addSectionButton"),e[96]=V,e[97]=xe):xe=e[97];let me;e[98]!==C||e[99]!==O||e[100]!==xe?(me=s.jsxs(at,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:O,onClick:C,children:[re,xe]}),e[98]=C,e[99]=O,e[100]=xe,e[101]=me):me=e[101];let Me;return e[102]!==se||e[103]!==X||e[104]!==me?(Me=s.jsxs("div",{className:se,children:[X,me]}),e[102]=se,e[103]=X,e[104]=me,e[105]=Me):Me=e[105],Me}function zi(d){return d.id}function an(d){const e=it.c(57),{open:o,initialName:l,autoLabel:m,isPending:_,onSubmit:x,onOpenChange:v}=d,b=_===void 0?!1:_,g=Ct(),[R,H]=w.useState(l),[z,I]=w.useState(o);o!==z&&(I(o),o&&H(l));let E;e[0]!==b||e[1]!==v?(E=Ne=>{!Ne&&!b&&v(!1)},e[0]=b,e[1]=v,e[2]=E):E=e[2];const f=E;let h;e[3]!==b||e[4]!==R||e[5]!==x?(h=async Ne=>{Ne.preventDefault(),!b&&await x(R.trim())},e[3]=b,e[4]=R,e[5]=x,e[6]=h):h=e[6];const C=h;let N;e[7]!==g?(N=g("sectionsEditor.variantRenameDialog.title"),e[7]=g,e[8]=N):N=e[8];let i;e[9]!==N?(i=s.jsx(Qo,{children:N}),e[9]=N,e[10]=i):i=e[10];let V;e[11]!==m||e[12]!==g?(V=g("sectionsEditor.variantRenameDialog.description",{fallback:m||g("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=m,e[12]=g,e[13]=V):V=e[13];let c;e[14]!==V?(c=s.jsx(Zo,{children:V}),e[14]=V,e[15]=c):c=e[15];let B;e[16]!==i||e[17]!==c?(B=s.jsxs(Xo,{children:[i,c]}),e[16]=i,e[17]=c,e[18]=B):B=e[18];let F;e[19]!==g?(F=g("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=g,e[20]=F):F=e[20];let U;e[21]!==F?(U=s.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:F}),e[21]=F,e[22]=U):U=e[22];let ae;e[23]===Symbol.for("react.memo_cache_sentinel")?(ae=Ne=>H(Ne.target.value),e[23]=ae):ae=e[23];let fe;e[24]!==m||e[25]!==b||e[26]!==R?(fe=s.jsx(ni,{id:"variant-rename-name",value:R,onChange:ae,placeholder:m,autoFocus:!0,disabled:b}),e[24]=m,e[25]=b,e[26]=R,e[27]=fe):fe=e[27];let oe;e[28]!==U||e[29]!==fe?(oe=s.jsxs("div",{className:"space-y-1.5 py-4",children:[U,fe]}),e[28]=U,e[29]=fe,e[30]=oe):oe=e[30];let u;e[31]!==v?(u=()=>v(!1),e[31]=v,e[32]=u):u=e[32];let D;e[33]!==g?(D=g("sectionsEditor.variantRenameDialog.cancel"),e[33]=g,e[34]=D):D=e[34];let ne;e[35]!==b||e[36]!==u||e[37]!==D?(ne=s.jsx(at,{type:"button",variant:"outline",onClick:u,disabled:b,children:D}),e[35]=b,e[36]=u,e[37]=D,e[38]=ne):ne=e[38];let k;e[39]!==b||e[40]!==g?(k=b?s.jsxs(s.Fragment,{children:[s.jsx(pn,{className:"size-3.5"}),g("sectionsEditor.variantRenameDialog.saving")]}):g("sectionsEditor.variantRenameDialog.save"),e[39]=b,e[40]=g,e[41]=k):k=e[41];let ke;e[42]!==b||e[43]!==k?(ke=s.jsx(at,{type:"submit",disabled:b,children:k}),e[42]=b,e[43]=k,e[44]=ke):ke=e[44];let P;e[45]!==ne||e[46]!==ke?(P=s.jsxs(ei,{children:[ne,ke]}),e[45]=ne,e[46]=ke,e[47]=P):P=e[47];let Te;e[48]!==C||e[49]!==oe||e[50]!==P||e[51]!==B?(Te=s.jsx(ti,{className:"sm:max-w-md",children:s.jsxs("form",{onSubmit:C,children:[B,oe,P]})}),e[48]=C,e[49]=oe,e[50]=P,e[51]=B,e[52]=Te):Te=e[52];let J;return e[53]!==f||e[54]!==o||e[55]!==Te?(J=s.jsx(si,{open:o,onOpenChange:f,children:Te}),e[53]=f,e[54]=o,e[55]=Te,e[56]=J):J=e[56],J}function Ts(d){const e=it.c(5),{rule:o,matchers:l}=d,m=o?.__resolveType??"";let _;if(e[0]!==l||e[1]!==m){const g=l.find(R=>R.resolveType===m)?.iconName??no(m);_=Go(g),e[0]=l,e[1]=m,e[2]=_}else _=e[2];const x=_;if(!x)return null;let v;return e[3]!==x?(v=s.jsx(x,{size:14,className:"shrink-0"}),e[3]=x,e[4]=v):v=e[4],v}function on(d){return d.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
2
  `)}function rn(d){return d.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function $i(d,e){const o=new Map;for(const l of d){const m=o.get(l.variant.label);m?m.push(l):o.set(l.variant.label,[l])}return e.map((l,m)=>({id:o.get(l.label)?.shift()?.id??crypto.randomUUID(),index:m,variant:l}))}function Hi(d){return d.map((e,o)=>({...e,index:o}))}function In(d){const e=it.c(19),{label:o,effectiveRule:l,matchers:m,canDelete:_,dragging:x,onRename:v,onDuplicate:b,onDelete:g}=d,R=Ct(),H=os();let z;e[0]!==H||e[1]!==x||e[2]!==l||e[3]!==m?(z=H?s.jsxs("span",{className:"relative size-4 shrink-0",children:[s.jsx("span",{className:Ie("absolute inset-0 flex items-center justify-center transition-opacity",x?"opacity-0":"group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"),children:s.jsx(Ts,{rule:l,matchers:m})}),s.jsx(ws,{"aria-hidden":!0,className:Ie("absolute inset-0 size-4 transition-opacity",x?"opacity-100":"opacity-0 group-hover:opacity-100 group-has-[:focus-visible]:opacity-100")})]}):s.jsx(Ts,{rule:l,matchers:m}),e[0]=H,e[1]=x,e[2]=l,e[3]=m,e[4]=z):z=e[4];let I;e[5]!==o?(I=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[5]=o,e[6]=I):I=e[6];let E;e[7]!==_||e[8]!==x||e[9]!==o||e[10]!==g||e[11]!==b||e[12]!==v||e[13]!==R?(E=!x&&s.jsxs(dn,{children:[s.jsx(un,{asChild:!0,children:s.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":R("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:qi,onPointerDown:Ui,children:s.jsx(mn,{size:14})})}),s.jsxs(fn,{align:"end",className:"w-36",children:[s.jsxs(vt,{onClick:h=>{h.stopPropagation(),v?.()},children:[s.jsx(yi,{size:14}),R("sectionsEditor.pageVariantTabs.renameAction")]}),s.jsxs(vt,{onClick:h=>{h.stopPropagation(),b?.()},children:[s.jsx(xn,{size:14}),R("sectionsEditor.pageVariantTabs.duplicateAction")]}),s.jsx(qa,{}),s.jsxs(vt,{variant:"destructive",disabled:!_,onClick:h=>{h.stopPropagation(),g?.()},children:[s.jsx(jn,{size:14}),R("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[7]=_,e[8]=x,e[9]=o,e[10]=g,e[11]=b,e[12]=v,e[13]=R,e[14]=E):E=e[14];let f;return e[15]!==z||e[16]!==I||e[17]!==E?(f=s.jsxs(s.Fragment,{children:[z,I,E]}),e[15]=z,e[16]=I,e[17]=E,e[18]=f):f=e[18],f}function Ui(d){return d.stopPropagation()}function qi(d){return d.stopPropagation()}function Gi(d){const e=it.c(33),{entry:o,isActive:l,canDelete:m,decofile:_,meta:x,matchers:v,onSelect:b,onRename:g,onDuplicate:R,onDelete:H}=d;let z;e[0]!==o.id?(z={id:o.id,animateLayoutChanges:Wi},e[0]=o.id,e[1]=z):z=e[1];const{attributes:I,listeners:E,setNodeRef:f,transform:h,isDragging:C}=Tn(z);let N;e[2]!==h?(N=Vn.Transform.toString(h?{...h,x:0}:null),e[2]=h,e[3]=N):N=e[3];const i=C?0:void 0;let V;e[4]!==N||e[5]!==i?(V={transform:N,opacity:i},e[4]=N,e[5]=i,e[6]=V):V=e[6];const c=V,B=x??void 0;let F;e[7]!==_||e[8]!==o.variant.rule||e[9]!==B?(F=Ft(o.variant.rule,_,B),e[7]=_,e[8]=o.variant.rule,e[9]=B,e[10]=F):F=e[10];const U=F;let ae;e[11]!==b?(ae=k=>{k.target===k.currentTarget&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),b())},e[11]=b,e[12]=ae):ae=e[12];const fe=C?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",oe=l?Sn:vn;let u;e[13]!==fe||e[14]!==oe?(u=Ie("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",fe,oe),e[13]=fe,e[14]=oe,e[15]=u):u=e[15];let D;e[16]!==m||e[17]!==U||e[18]!==o.variant.label||e[19]!==v||e[20]!==H||e[21]!==R||e[22]!==g?(D=s.jsx(In,{label:o.variant.label,effectiveRule:U,matchers:v,canDelete:m,onRename:g,onDuplicate:R,onDelete:H}),e[16]=m,e[17]=U,e[18]=o.variant.label,e[19]=v,e[20]=H,e[21]=R,e[22]=g,e[23]=D):D=e[23];let ne;return e[24]!==I||e[25]!==E||e[26]!==b||e[27]!==f||e[28]!==c||e[29]!==u||e[30]!==D||e[31]!==ae?(ne=s.jsx("div",{ref:f,style:c,...I,...E,onClick:b,onKeyDown:ae,className:u,children:D}),e[24]=I,e[25]=E,e[26]=b,e[27]=f,e[28]=c,e[29]=u,e[30]=D,e[31]=ae,e[32]=ne):ne=e[32],ne}function Wi(){return!1}function Yi(d){const e=it.c(9),{variant:o,decofile:l,meta:m,matchers:_}=d,x=m??void 0;let v;e[0]!==l||e[1]!==x||e[2]!==o.rule?(v=Ft(o.rule,l,x),e[0]=l,e[1]=x,e[2]=o.rule,e[3]=v):v=e[3];const b=v;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=Ie("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",Sn),e[4]=g):g=e[4];let R;return e[5]!==b||e[6]!==_||e[7]!==o.label?(R=s.jsx("div",{className:g,children:s.jsx(In,{label:o.label,effectiveRule:b,matchers:_,canDelete:!1,dragging:!0})}),e[5]=b,e[6]=_,e[7]=o.label,e[8]=R):R=e[8],R}function Ji(d){const e=it.c(91),{listKey:o,variants:l,activeIndex:m,decofile:_,meta:x,matchers:v,onSelect:b,onReorder:g,onRename:R,onDuplicate:H,onDelete:z,onAdd:I}=d,E=Ct();let f;e[0]!==l?(f=()=>rn(l),e[0]=l,e[1]=f):f=e[1];const[h,C]=w.useState(f),[N,i]=w.useState(null),[V,c]=w.useState(o),[B,F]=w.useState(l.length);let U;e[2]!==l?(U=()=>on(l),e[2]=l,e[3]=U):U=e[3];const[ae,fe]=w.useState(U),oe=w.useRef(!1),u=on(l);V!==o?(c(o),F(l.length),fe(u),C(rn(l))):(B!==l.length||ae!==u)&&(F(l.length),fe(u),C(ve=>$i(ve,l)));let D;e[4]===Symbol.for("react.memo_cache_sentinel")?(D={activationConstraint:{distance:8}},e[4]=D):D=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:Dn},e[5]=ne):ne=e[5];const k=En(as(kn,D),as(wn,ne));let ke;e[6]!==h?(ke=h.map(Qi),e[6]=h,e[7]=ke):ke=e[7];const P=ke,Te=l.length>1;let J;e[8]!==h?(J=ve=>{const X=String(ve.active.id);i(h.find(O=>O.id===X)??null)},e[8]=h,e[9]=J):J=e[9];const Ne=J;let Je;e[10]!==P||e[11]!==g?(Je=ve=>{i(null);const{active:X,over:O}=ve;if(!O||X.id===O.id)return;const re=P.indexOf(String(X.id)),xe=P.indexOf(String(O.id));re===-1||xe===-1||(C(me=>Hi(zt([...me],re,xe))),oe.current=!0,requestAnimationFrame(()=>{oe.current=!1}),g(re,xe))},e[10]=P,e[11]=g,e[12]=Je):Je=e[12];const Ue=Je;let ye;e[13]===Symbol.for("react.memo_cache_sentinel")?(ye=()=>{i(null)},e[13]=ye):ye=e[13];const Ae=ye;let Ee,q,M,pe,be,ze,Pe,te,ge,Be,le,ie,he;if(e[14]!==m||e[15]!==Te||e[16]!==_||e[17]!==h||e[18]!==P||e[19]!==Ue||e[20]!==Ne||e[21]!==v||e[22]!==x||e[23]!==I||e[24]!==z||e[25]!==H||e[26]!==R||e[27]!==b||e[28]!==k||e[29]!==E){const ve=T=>{oe.current||b(T)};le="space-y-1 border-b p-2";let X;e[43]!==E?(X=E("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=E,e[44]=X):X=e[44];let O;e[45]!==X?(O=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:X}),e[45]=X,e[46]=O):O=e[46];let re;e[47]!==E?(re=E("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=E,e[48]=re):re=e[48];let xe;e[49]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(ks,{size:14}),e[49]=xe):xe=e[49];let me;e[50]!==I||e[51]!==re?(me=s.jsx(At,{asChild:!0,children:s.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":re,className:"size-6",onClick:I,children:xe})}),e[50]=I,e[51]=re,e[52]=me):me=e[52];let Me;e[53]!==E?(Me=E("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=E,e[54]=Me):Me=e[54];let ue;e[55]!==Me?(ue=s.jsx(Pt,{children:Me}),e[55]=Me,e[56]=ue):ue=e[56];let L;e[57]!==me||e[58]!==ue?(L=s.jsxs(Nt,{children:[me,ue]}),e[57]=me,e[58]=ue,e[59]=L):L=e[59],e[60]!==O||e[61]!==L?(ie=s.jsxs("div",{className:"flex items-center justify-between",children:[O,L]}),e[60]=O,e[61]=L,e[62]=ie):ie=e[62],q=Nn,ze=k,Pe=An,te=Ne,ge=Ue,Be=Ae,Ee=Pn,pe=P,be=Cn,he="space-y-0.5",M=h.map(T=>s.jsx(Gi,{entry:T,isActive:T.index===m,canDelete:Te,decofile:_,meta:x,matchers:v,onSelect:()=>ve(T.index),onRename:()=>R(T.index),onDuplicate:()=>H(T.index),onDelete:()=>z(T.index)},T.id)),e[14]=m,e[15]=Te,e[16]=_,e[17]=h,e[18]=P,e[19]=Ue,e[20]=Ne,e[21]=v,e[22]=x,e[23]=I,e[24]=z,e[25]=H,e[26]=R,e[27]=b,e[28]=k,e[29]=E,e[30]=Ee,e[31]=q,e[32]=M,e[33]=pe,e[34]=be,e[35]=ze,e[36]=Pe,e[37]=te,e[38]=ge,e[39]=Be,e[40]=le,e[41]=ie,e[42]=he}else Ee=e[30],q=e[31],M=e[32],pe=e[33],be=e[34],ze=e[35],Pe=e[36],te=e[37],ge=e[38],Be=e[39],le=e[40],ie=e[41],he=e[42];let se;e[63]!==M||e[64]!==he?(se=s.jsx("div",{className:he,children:M}),e[63]=M,e[64]=he,e[65]=se):se=e[65];let de;e[66]!==Ee||e[67]!==pe||e[68]!==be||e[69]!==se?(de=s.jsx(Ee,{items:pe,strategy:be,children:se}),e[66]=Ee,e[67]=pe,e[68]=be,e[69]=se,e[70]=de):de=e[70];let Re;e[71]!==N||e[72]!==_||e[73]!==v||e[74]!==x?(Re=N?s.jsx(Yi,{variant:N.variant,decofile:_,meta:x,matchers:v}):null,e[71]=N,e[72]=_,e[73]=v,e[74]=x,e[75]=Re):Re=e[75];let Ce;e[76]!==Re?(Ce=cn.createPortal(s.jsx(Rn,{dropAnimation:hn,children:Re}),document.body),e[76]=Re,e[77]=Ce):Ce=e[77];let ce;e[78]!==q||e[79]!==ze||e[80]!==Pe||e[81]!==te||e[82]!==ge||e[83]!==Be||e[84]!==de||e[85]!==Ce?(ce=s.jsxs(q,{sensors:ze,collisionDetection:Pe,onDragStart:te,onDragEnd:ge,onDragCancel:Be,children:[de,Ce]}),e[78]=q,e[79]=ze,e[80]=Pe,e[81]=te,e[82]=ge,e[83]=Be,e[84]=de,e[85]=Ce,e[86]=ce):ce=e[86];let Ve;return e[87]!==le||e[88]!==ie||e[89]!==ce?(Ve=s.jsxs("div",{className:le,children:[ie,ce]}),e[87]=le,e[88]=ie,e[89]=ce,e[90]=Ve):Ve=e[90],Ve}function Qi(d){return d.id}function ln(d){const e=it.c(21),{currentRt:o,currentLabel:l,currentGlobalKey:m,matchers:_,globals:x,onSelect:v,onSelectGlobal:b,schema:g,formValue:R,onChange:H,formKey:z,formWrapperClassName:I,meta:E,decofile:f,onSaveReferencedBlock:h,sandbox:C}=d;let N;e[0]!==m||e[1]!==l||e[2]!==o||e[3]!==x||e[4]!==_||e[5]!==v||e[6]!==b?(N=s.jsx(ao,{currentRt:o,currentLabel:l,currentGlobalKey:m,matchers:_,globals:x,onSelect:v,onSelectGlobal:b}),e[0]=m,e[1]=l,e[2]=o,e[3]=x,e[4]=_,e[5]=v,e[6]=b,e[7]=N):N=e[7];let i;e[8]!==f||e[9]!==z||e[10]!==R||e[11]!==I||e[12]!==E||e[13]!==H||e[14]!==h||e[15]!==C||e[16]!==g?(i=g&&R&&s.jsx("div",{className:I,children:s.jsx(oo,{schema:g,value:R,onChange:H,meta:E,decofile:f,onSaveReferencedBlock:h,sandbox:C},z)}),e[8]=f,e[9]=z,e[10]=R,e[11]=I,e[12]=E,e[13]=H,e[14]=h,e[15]=C,e[16]=g,e[17]=i):i=e[17];let V;return e[18]!==N||e[19]!==i?(V=s.jsxs(s.Fragment,{children:[N,i]}),e[18]=N,e[19]=i,e[20]=V):V=e[20],V}function wc({orgSlug:d,virtualMcpId:e,branch:o,previewReady:l=!0,previewUrl:m,currentPath:_,activePageBlockKey:x=null,activeGlobalBlockKey:v=null,externalSelection:b,onSaved:g,initialEditSeo:R=!1,onExitSeo:H,onSelectRoot:z,onViewJsonFile:I,onVariantPreviewOverride:E}){const f=Ct(),h=Ya(),C=h?.taskId??null,N=l?{orgSlug:d,virtualMcpId:e,branch:o,threadId:C,previewUrl:m}:null,{data:i,isLoading:V}=io(N),{data:c,isLoading:B}=ro(N),F=os(),U=h?.virtualMcpId,fe=$o(U===e?e:null)?.metadata?.siteSlug??null,oe=bi({virtualMcpId:e,sandboxUrl:m}),[u,D]=w.useState(null),[ne,k]=w.useState(null),[ke,P]=w.useState(null),[Te,J]=w.useState(0),[Ne,Je]=w.useState(void 0),[Ue,ye]=w.useState(null),[Ae,Ee]=w.useState(null),[q,M]=w.useState([]),pe=w.useRef(null),[be,ze]=w.useState(q.length);be!==q.length&&(ze(q.length),requestAnimationFrame(()=>{pe.current&&(pe.current.scrollTop=0)}));const[Pe,te]=w.useState(0),[ge,Be]=w.useState(null),[le,ie]=w.useState(null),[he,se]=w.useState(null),[de,Re]=w.useState(!0),[Ce,ce]=w.useState(!1),[Ve,ve]=w.useState(!1),X=w.useRef(null),[O,re]=w.useState(R),[xe,me]=w.useState(R);R&&!xe&&(me(!0),re(!0),D(null),k(null),P(null),M([])),!R&&xe&&me(!1);const[Me,ue]=w.useState(null),[L,T]=w.useState(void 0),[Qe,Ge]=w.useState([]),[mt,Ze]=w.useState(0),[De,$e]=w.useState(0),[On,qe]=w.useState(null),[jt,We]=w.useState(null),[Vs,Ds]=w.useState(null),Fn=Ga(),zn=`${d}/${e}/${o}`,$t=lo({orgSlug:d,virtualMcpId:e,branch:o}),[$n,Hn]=w.useState(_),[Un,qn]=w.useState(x),[Gn,Wn]=w.useState(v);($n!==_||Un!==x||Gn!==v)&&(queueMicrotask(()=>$t.flush()),Hn(_),qn(x),Wn(v),D(null),k(null),P(null),J(0),ye(null),Ee(null),$e(0),qe(null),We(null),M([]),te(t=>t+1),re(!1),ue(null),T(void 0),Ge([]),Ze(t=>t+1));const we=co({orgSlug:d,virtualMcpId:e,branch:o}),Ht=Po((t,n)=>{we.mutate({blockKey:t,data:n},{onSuccess:()=>g?.(),onError:a=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),is=oi({orgSlug:d,virtualMcpId:e,branch:o}),[Mt,Ut]=w.useState(!1),Oe=w.useRef(null),rt=w.useRef(null),lt=w.useRef(null),rs=w.useRef({}),tt=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!l||V||B)return s.jsx("div",{className:"h-full w-full flex items-center justify-center",children:s.jsx(pn,{className:"size-5 text-muted-foreground"})});if(!i||!c)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Yn=li(i),_e=!!v,Ye=_e?null:ci(Yn,_,x),j=_e?v:Ye?.key??null,ls=_e&&v?i[v]:void 0,Ns=_e&&v&&ls?ui(v,ls):_e&&v?v:"",qt=!_e&&j&&i[j]?i[j]:null,cs=O&&i&&c&&j&&Ye?Gs(i,{kind:"page",pageKey:j,pageName:String(Ye.name??""),path:String(Ye.path??"")},c):null,Jn=O?qt?.seo:void 0,us=L!==void 0?L:Jn,Qn=O?uo(us):void 0,Zn=cs?.seoTypeOptions??[],Xn=O&&c?mo(c):"",As=Me??Qn??{},ds=O&&cs?hi(As,cs):null,ea=O&&ds&&fo(us)?ns(ds,c):null,ta=O?po(i,c)?.seoData:void 0,He=_e?[{label:"Default",sections:[{__resolveType:v}]}]:go(qt?.sections,i??{}),Et=He.length>1,Ke=Math.min(Te,He.length-1),ct=He[Ke],Y=ct?.sections??[],Fe=Xt(Y,i),ms=!_e&&ho(qt?.sections);if(_e&&v&&Vs!==v){Ds(v);const t=Y[0],n=Fe[0];if(t&&n){D(0),$e(0),M([]);const a=xt(t,n,i);a&&(k(a.data),P(a.resolveType),We(null),qe(null))}}!_e&&Vs!==null&&Ds(null),tt.current={rawSections:Y,parsedSections:Fe,decofile:i??{},activePageKey:j,pageVariants:He,variantIndex:Ke,sectionVariantIndex:De,selectedSectionIndex:u};const sa=()=>({multivariate:ms,index:Ke,variants:He.map(t=>({rule:t.rule}))}),fs=(t,n)=>{if(!E)return;if(!j||!ms||t.length<=1){E(null);return}const a=sn(j,{multivariate:!0,index:n,variants:t},i,c);E(a.length>0?a:null)},ps=E&&j&&ms&&Et&&!V&&!B?j:null,[na,aa]=w.useState(null);if(ps!==na&&(aa(ps),ps)){const t=He.map(a=>({rule:a.rule})),n=Ke;queueMicrotask(()=>fs(t,n))}const Rt=(t,n,a)=>{if(!E)return;if(!j){E(null);return}const r=sa(),p=sn(j,r,i,c);if(!t||n<0){E(p.length>0?p:null);return}const y=_i({pageKey:j,page:r,sectionIndex:n,sectionLazy:Fe[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:i,meta:c}),S=[...p,...y];E(S.length>0?S:null)},ft=(t,n,a,r=u??-1,p=!1)=>{const y=ot(t,n);if(!y){k(null),P(null),We(null),qe(null),p&&Rt(null,r,a);return}const A=Ws(y,ht)[a];if(!A){k(null),P(null),We(null),qe(null),p&&Rt(null,r,a);return}const ee=Eo(A.value,i);k(ee?.data??null),P(ee?.resolveType??null);const{resolveType:K,formValue:$}=Bt(A.rule,i,c??void 0);We(K),qe($),p&&Rt(y,r,a)},Kt=b?.index;if(b!==void 0&&(b?.seq??null)!==Ne&&(Je(b?.seq??null),typeof Kt=="number")){const t=Y[Kt],n=Fe[Kt];if(t&&n)if(D(Kt),$e(0),M([]),te(a=>a+1),n.isMultivariate)ft(t,n,0,Kt);else{const a=xt(t,n,i);a?(k(a.data),P(a.resolveType)):(k(null),P(null)),We(null),qe(null)}}const Gt={orgSlug:d,virtualMcpId:e,branch:o,threadId:C,previewUrl:m??void 0,siteSlug:fe},gs=ke&&c?ns(ke,c):null,Xe=(t,n)=>{if(!j)return;Oe.current&&(clearTimeout(Oe.current),Oe.current=null),lt.current&&(clearTimeout(lt.current),lt.current=null),rt.current&&(clearTimeout(rt.current),rt.current=null);const a=Ot(i,j,t,Ke,He);we.mutate({blockKey:j,data:a},{onSuccess:()=>n?.onSuccess?.()??g?.(),onError:r=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},wt=()=>{D(null),k(null),P(null),$e(0),qe(null),We(null),M([]),te(t=>t+1)},oa=(t,n)=>{Oe.current&&clearTimeout(Oe.current);const a=tt.current.sectionVariantIndex;Oe.current=setTimeout(()=>{const{rawSections:r,parsedSections:p,decofile:y,activePageKey:S,pageVariants:A,variantIndex:ee}=tt.current,K=r[n];if(!K)return;const $=p[n];if(!$)return;if($.isSavedBlock){const W=Io(K,$);if(!W)return;we.mutate({blockKey:W,data:t},{onSuccess:()=>g?.(),onError:Q=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}if(!S)return;const G={...y[S]},je=[...r];if($.isMultivariate){const W=ot(K,$);if(!W||!S)return;const Q=Oo(W,a,t);je[n]=_t(K,$,Q)}else if($.isHidden){const W=bn(K.__resolveType),Q=W?{...K.section}:{...K},Le=Array.isArray(Q.variants)?[...Q.variants]:[];Le[0]&&(Le[0]={...Le[0],value:t}),Q.variants=Le,W?je[n]={...K,section:Q}:je[n]=Q}else $.isLazy?je[n]={...K,section:t}:je[n]=t;if(A.length>1){const W=G.sections,Q=[...W?.variants??[]];Q[ee]&&(Q[ee]={...Q[ee],value:je}),G.sections={...W,variants:Q}}else G.sections=je;we.mutate({blockKey:S,data:G},{onSuccess:()=>g?.(),onError:W=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:W.message}))})},js)},ia=t=>{D(t),$e(0),M([]),te(p=>p+1);const n=Y[t],a=Fe[t];if(!n||!a)return;if(a.isMultivariate){ft(n,a,0,t);return}const r=xt(n,a,i);if(!r){k(null),P(null),We(null),qe(null),Rt(null,t,0);return}k(r.data),P(r.resolveType),We(null),qe(null),Rt(null,t,0)},Ps=t=>{const n=t;k(n),u!==null&&oa(n,u)},hs=t=>{if(!j||!i||!c||!Ye)return;const n={kind:"page",pageKey:j,pageName:String(Ye.name??""),path:String(Ye.path??"")},a=Gs(i,n,c);a&&$t.save(j,()=>{const r=Fn.getQueryData(Wa.decofile(zn))?.[j];if(!r||typeof r!="object"||r===null||Array.isArray(r))return null;const p={...r,...rs.current};return rs.current={},t?.raw!==void 0?{...p,seo:t.raw}:t?.inner!==void 0?Si(n,a,p,t.inner):p})},ra=(t,n)=>{j&&(rs.current[t]=n,hs())},la=(t,n)=>{if(!j)return;const a=zt([...Y],t,n);u!==null&&(u===t?D(n):t<u&&n>=u?D(u-1):t>u&&n<=u&&D(u+1)),Xe(a)},ca=t=>{if(!j)return;const n=Y.filter((a,r)=>r!==t);u===t?wt():u!==null&&u>t&&D(u-1),Xe(n)},ua=t=>{if(!j)return;const n=Y[t];if(!n)return;const a=[...Y];a.splice(t+1,0,Lo(n)),u!==null&&u>t&&D(u+1),Xe(a)},da=t=>{if(!j)return;const n=Y[t],a=Fe[t];if(!n||!a)return;const r=a.isHidden?Mo(n):Ko(n);if(!r)return;const p=[...Y];p[t]=r,u===t&&wt(),Xe(p)},ma=t=>{if(!j)return;const n=Y[t],a=Fe[t];if(!n||!a||a.isMultivariate)return;const r=Co(n);if(!r)return;const p=[...Y];p[t]=r,u===t&&wt(),Xe(p)},fa=t=>{if(!j)return;const n=Y[t],a=Fe[t];if(!n||!a?.isSavedBlock)return;const r=xt(n,a,i);if(!r?.data)return;const{name:p,...y}=r.data,S=[...Y];a.isLazy?S[t]={...n,section:y}:S[t]=y,u===t&&wt(),Xe(S)},pa=t=>{if(!j)return;const n=[...Y,{__resolveType:t.resolveType}],a=n.length-1;Xe(n,{onSuccess:()=>{ce(!1),D(a),$e(0),M([]),te(S=>S+1);const r=n[a],p=Xt(n,i)[a];if(!r||!p)return;if(p.isMultivariate){ft(r,p,0);return}const y=xt(r,p,i);if(!y){k(null),P(null),We(null),qe(null);return}k(y.data),P(y.resolveType),We(null),qe(null)}})},Cs=t=>{X.current=t.append,ce(!0)},ga=t=>{const n=X.current;if(!n){pa(t);return}n({__resolveType:t.resolveType}),ce(!1),X.current=null},ha=t=>{if(u===null)return;const n=Y[u],a=Fe[u];!n||!a?.isMultivariate||($e(t),M([]),te(r=>r+1),ft(n,a,t,u,!0))},va=t=>{if(u===null||!j)return;const n=Y[u],a=Fe[u];if(!n||!a?.isMultivariate)return;const r=ot(n,a);if(!r)return;const p=No(r,t);if(!p){Z.error(f("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const y=[...Y];y[u]=_t(n,a,p);const S=p.variants;let A=De;t===De?A=Math.min(t,S.length-1):t<De&&(A=De-1),$e(A),M([]),te(ee=>ee+1),ft(y[u],a,A),Xe(y)},Sa=t=>{if(u===null||!j)return;const n=Y[u],a=Fe[u];if(!n||!a?.isMultivariate)return;const r=ot(n,a);if(!r)return;const p=Ao(r,t),y=[...Y];y[u]=_t(n,a,p);const S=t+1;$e(S),M([]),te(A=>A+1),ft(y[u],a,S),Xe(y)},ya=(t,n)=>{if(u===null||!j||t===n)return;const a=Y[u],r=Fe[u];if(!a||!r?.isMultivariate)return;const p=ot(a,r);if(!p)return;const y=Vo(p,t,n),S=[...Y];S[u]=_t(a,r,y);let A=De;De===t?A=n:t<De&&n>=De?A=De-1:t>De&&n<=De&&(A=De+1),$e(A),ft(S[u],r,A),Xe(S)},vs=t=>{const n=t??u;if(n===null||!j)return;const a=Y[n],r=Fe[n];if(!a||!r)return;const p=wo(a,r);if(!p){Z.error(f("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const y=[...Y];y[n]=p.section;const S=Xt(y,i)[n];if(!S?.isMultivariate){Z.error(f("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}D(n),$e(p.newVariantIndex),M([]),te(A=>A+1),ft(p.section,S,p.newVariantIndex,n),Xe(y)},ba=()=>{if(u===null||!j)return;const t=Y[u],n=Fe[u];if(!t||!n?.isMultivariate)return;const a=ot(t,n);if(!a)return;const r=Do(t,n,a);if(!r){Z.error(f("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const p=[...Y];p[u]=r;const y=Xt(p,i)[u];if(!y)return;$e(0),We(null),qe(null),M([]),te(A=>A+1);const S=xt(r,y,i);S?(k(S.data),P(S.resolveType)):(k(null),P(null)),Rt(null,u,0),Xe(p)},xa=async t=>{if(ge===null||!j)return;const n=_s(t,i);if(n){Z.error(n);return}const a=Y[ge],r=Fe[ge];if(!a||!r)return;const p=xt(a,r,i);if(!p){Z.error(f("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const y={...p.data,name:t};try{await we.mutateAsync({blockKey:t,data:y});const S=[...Y];S[ge]={__resolveType:t},await we.mutateAsync({blockKey:j,data:Ot(i,j,S,Ke,He)}),u===ge&&wt(),Be(null),Z.success(f("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),g?.()}catch(S){Z.error(S instanceof Error?S.message:f("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},Ms=ct?.rule;if(Et&&u===null&&Ae===null&&Ms){const{resolveType:t,formValue:n}=Bt(Ms,i??{},c??void 0);Ee(t),ye(n)}const Wt=c?vo(c):[],Ks=c&&i?So(c,i):[],_a=!_e&&!!(oe&&c&&i),ja=Ae&&c?ns(Ae,c):null,kt=()=>{rt.current&&(clearTimeout(rt.current),rt.current=null),lt.current&&(clearTimeout(lt.current),lt.current=null)},Lt=async(t,n)=>{if(!(Bo(n,t,c)>0))try{await is.mutateAsync({blockKey:t})}catch(a){Z.error(a instanceof Error?a.message:f("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Ls=t=>{rt.current&&clearTimeout(rt.current),rt.current=setTimeout(()=>{const{activePageKey:n,decofile:a,variantIndex:r}=tt.current;if(!n)return;const p={...a[n]},y={...p.sections},S=[...y.variants??[]],A=S[r],ee=A?.rule;if(Vt(ee,a,c)){const K=ee?.__resolveType??"",$=a[K],G=typeof $?.name=="string"?$.name:K,{__resolveType:je,...W}=t;we.mutate({blockKey:K,data:Dt(je??"",W,G)},{onSuccess:()=>g?.(),onError:Q=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:Q.message}))});return}A&&(S[r]={...A,rule:t}),p.sections={...y,variants:S},we.mutate({blockKey:n,data:p},{onSuccess:()=>g?.(),onError:K=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:K.message}))})},js)},Ea=t=>{Ee(t);const n=t?Zs(t,c):{__resolveType:tn};ye(t?n:{}),Ls(n)},Ra=t=>{const n=t;ye(n);const a=Ae?{__resolveType:Ae,...n}:{...n};Ls(a)},wa=async t=>{kt();const{activePageKey:n,decofile:a,variantIndex:r}=tt.current;if(!n)return;const p=a[n],y=p?.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const S=y;if(!Array.isArray(S.variants))return;const A=[...S.variants],ee=A[r];if(!ee)return;const K=It(ee.rule,a,c),$=ts(t);A[r]={...ee,rule:$};const G={...a,[n]:{...p,sections:{...S,variants:A}}},{resolveType:je,formValue:W}=Bt($,G,c??void 0);Ee(je),ye(W);try{await we.mutateAsync({blockKey:n,data:G[n]}),K&&K!==t&&await Lt(K,G),g?.()}catch(Q){Z.error(Q instanceof Error?Q.message:f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Bs=t=>{lt.current&&clearTimeout(lt.current);const{selectedSectionIndex:n,sectionVariantIndex:a}=tt.current;n!==null&&(lt.current=setTimeout(()=>{const{rawSections:r,parsedSections:p,decofile:y,activePageKey:S,pageVariants:A,variantIndex:ee}=tt.current;if(!S)return;const K=r[n],$=p[n];if(!K||!$?.isMultivariate)return;const G=ot(K,$);if(!G)return;const W=(G.variants??[])[a]?.rule;if(Vt(W,y,c)){const Se=W?.__resolveType??"",et=y[Se],ut=typeof et?.name=="string"?et.name:Se,{__resolveType:pt,...dt}=t;we.mutate({blockKey:Se,data:Dt(pt??"",dt,ut)},{onSuccess:()=>g?.(),onError:gt=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:gt.message}))});return}const Q=Qs(G,a,t),Le=[...r];Le[n]=_t(K,$,Q);const nt=Ot(y,S,Le,ee,A);we.mutate({blockKey:S,data:nt},{onSuccess:()=>g?.(),onError:Se=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},js))},ka=t=>{We(t);const n=t?Zs(t,c):{__resolveType:tn};qe(t?n:{}),Bs(n)},Ta=t=>{const n=t;qe(n);const a=jt?{__resolveType:jt,...n}:{...n};Bs(a)},Va=async t=>{kt();const{selectedSectionIndex:n,sectionVariantIndex:a,rawSections:r,parsedSections:p,decofile:y,activePageKey:S,pageVariants:A,variantIndex:ee}=tt.current;if(n===null||!S)return;const K=r[n],$=p[n];if(!K||!$?.isMultivariate)return;const G=ot(K,$);if(!G)return;const je=G.variants??[],W=It(je[a]?.rule,y,c),Q=ts(t),Le=Qs(G,a,Q),nt=[...r];nt[n]=_t(K,$,Le);const Se=Ot(y,S,nt,ee,A),et={...y,[S]:Se},{resolveType:ut,formValue:pt}=Bt(Q,et,c??void 0);We(ut),qe(pt);try{await we.mutateAsync({blockKey:S,data:Se}),W&&W!==t&&await Lt(W,et),g?.()}catch(dt){Z.error(dt instanceof Error?dt.message:f("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!_e&&!Ye)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.noPageFound",{currentPath:_})});if(_e&&!ls)return s.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:f("sectionsEditor.sectionsEditor.globalBlockNotFound")});const st=u!==null?Fe[u]??null:null,Is=u!==null?Y[u]:null,Os=Is&&st?.isMultivariate?ot(Is,st):null,St=Os?Ws(Os,ht):[],Ss=Math.min(De,Math.max(St.length-1,0)),Tt=St[Ss]??null,yt=st?.isMultivariate===!0,Fs=u!==null&&st!==null,Yt=Fs&&(yt||!!(gs&&ne)),Da=Yt&&!_e&&st?.isSavedBlock===!0,bt=_e||Da,Na=_e?Ns:st?.label??"",Aa=jt&&c?ns(jt,c):null,Jt=Yt&&(!_e||q.length>0)?_e?[Ns,...q]:[Ye.name,...yt&&Tt?F?[`${st.variantOf??st.label} · ${Tt.label}`]:[st.label,Tt.label]:[st.label],...q]:[],zs=O&&Ye?[Ye.name,"SEO",...Qe]:[],Qt=zs.length>0?zs:bt?Jt.length>0?Jt:[Na]:Jt.length>0?Jt:[Ye.name],$s=Fs&&!yt&&!st?.isHidden&&!!j,Pa=bt||!_e&&Et&&!!ct||$s,Ca=!F&&!O&&!_e&&yt&&q.length===0,Hs=()=>{if(!j)return;kt(),Oe.current&&(clearTimeout(Oe.current),Oe.current=null);const t=i[j],n=ko(t.sections,Y);if(!n)return;const a=To(n);we.mutate({blockKey:j,data:{...t,sections:n}},{onSuccess:()=>{J(a),D(null),k(null),P(null),M([]),ye(null),Ee(null)},onError:r=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:r.message}))})},ys=(t,n,a)=>{if(!j)return;kt(),Oe.current&&(clearTimeout(Oe.current),Oe.current=null);const r=i[j],p=r.sections;if(!p||typeof p!="object"||Array.isArray(p))return;const y=p;if(!Array.isArray(y.variants))return;const S=t([...y.variants]);if(!S)return;const A=Fo(y,S),ee={...i,[j]:{...r,sections:A}};we.mutate({blockKey:j,data:ee[j]},{onSuccess:()=>{n?.(),a&&Lt(a,ee)},onError:K=>Z.error(f("sectionsEditor.sectionsEditor.saveFailed",{error:K.message}))})},Ma=t=>{ie(null),J(t),D(null),k(null),P(null),M([]);const n=He[t]?.rule,{resolveType:a,formValue:r}=Bt(n,i??{},c??void 0);Ee(a),ye(r),fs(He.map(p=>({rule:p.rule})),t)},Ka=(t,n)=>{if(t===n)return;let a=Ke;Ke===t?a=n:t<Ke&&n>=Ke?a=Ke-1:t>Ke&&n<=Ke&&(a=Ke+1),J(a);const r=zt(He.map(p=>({rule:p.rule})),t,n);fs(r,a),ys(p=>zt(p,t,n))},La=t=>{const n=He[t]?.rule,a=It(n,i??{},c??void 0);ys(r=>r.length<=1?null:(r.splice(t,1),r),()=>{He.length-1===1?J(0):t<Ke?J(Ke-1):t===Ke&&J(Math.max(0,t-1)),D(null),k(null),P(null),M([]),ye(null),Ee(null)},a)},Ba=t=>{ys(n=>zo(n,t),()=>{J(t+1),D(null),k(null),P(null),M([]),ye(null),Ee(null)})},Ia=async(t,n)=>{kt(),Oe.current&&(clearTimeout(Oe.current),Oe.current=null);const a=tt.current.activePageKey,r=tt.current.decofile;if(!a)return;const p=r[a],y=p.sections;if(!y||typeof y!="object"||Array.isArray(y))return;const S=y;if(!Array.isArray(S.variants))return;const A=[...S.variants],ee=A[t];if(!ee?.rule||typeof ee.rule!="object"){Z.error(f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const K=ee.rule,$=n.trim();Ut(!0);try{if(!$){if(!Vt(K,r,c)){ie(null);return}const nt=K.__resolveType??"";A[t]={...ee,rule:Xs(K,r,c)};const Se={...r,[a]:{...p,sections:{...S,variants:A}}};await we.mutateAsync({blockKey:a,data:Se[a]}),await Lt(nt,Se),ie(null),g?.();return}const G=en(K,r,c);if(!G){Z.error(f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(G.blockKey){await we.mutateAsync({blockKey:G.blockKey,data:Dt(G.resolveType,G.data,$)}),ie(null),g?.();return}const je=xs($),W=_s(je,r);if(W){Z.error(W);return}const Q=Dt(G.resolveType,G.data,$);let Le=null;try{await we.mutateAsync({blockKey:je,data:Q}),Le=je,A[t]={...ee,rule:ts(je)},await we.mutateAsync({blockKey:a,data:{...p,sections:{...S,variants:A}}}),Le=null}catch(nt){throw Le&&await is.mutateAsync({blockKey:Le}).catch(()=>{}),nt}ie(null),Z.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:$})),g?.()}catch(G){Z.error(G instanceof Error?G.message:f("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ut(!1)}},Oa=async(t,n)=>{kt(),Oe.current&&(clearTimeout(Oe.current),Oe.current=null);const{selectedSectionIndex:a,rawSections:r,parsedSections:p,decofile:y,activePageKey:S,pageVariants:A,variantIndex:ee}=tt.current;if(a===null||!S)return;const K=r[a],$=p[a];if(!K||!$?.isMultivariate)return;const G=ot(K,$);if(!G)return;const je=G.variants??[],W=je[t];if(!W?.rule||typeof W.rule!="object"){Z.error(f("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Q=W.rule,Le=n.trim();Ut(!0);const nt=async Se=>{const et={...G,variants:Se},ut=[...r];ut[a]=_t(K,$,et);const pt=Ot(y,S,ut,ee,A);return await we.mutateAsync({blockKey:S,data:pt}),{...y,[S]:pt}};try{if(!Le){if(!Vt(Q,y,c)){se(null);return}const gt=Q.__resolveType??"",qs=[...je];qs[t]={...W,rule:Xs(Q,y,c)};const Ua=await nt(qs);await Lt(gt,Ua),se(null),g?.();return}const Se=en(Q,y,c);if(!Se){Z.error(f("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await we.mutateAsync({blockKey:Se.blockKey,data:Dt(Se.resolveType,Se.data,Le)}),se(null),g?.();return}const et=xs(Le),ut=_s(et,y);if(ut){Z.error(ut);return}const pt=Dt(Se.resolveType,Se.data,Le);let dt=null;try{await we.mutateAsync({blockKey:et,data:pt}),dt=et;const gt=[...je];gt[t]={...W,rule:ts(et)},await nt(gt),dt=null}catch(gt){throw dt&&await is.mutateAsync({blockKey:dt}).catch(()=>{}),gt}se(null),Z.success(f("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Le})),g?.()}catch(Se){Z.error(Se instanceof Error?Se.message:f("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ut(!1)}},Us=()=>{wt()},Fa=t=>{ue(t),hs({inner:t})},za=t=>{T(t),hs({raw:t})},$a=()=>{ue(null),Ge([])},Ha=()=>Ze(t=>t+1),bs=t=>{if(O){if(t===0){$t.flush(),re(!1),ue(null),T(void 0),Ge([]),Ze(a=>a+1),H?.();return}if(t===1){Ge([]),Ze(a=>a+1);return}Ge(Qe.slice(0,t-1)),Ze(a=>a+1);return}if(_e){M(q.slice(0,t)),te(a=>a+1);return}if(t===0){Us();return}if(t===1){M([]),te(a=>a+1);return}const n=!F&&yt&&Tt?1:0;if(n===1&&t===2){M([]),te(a=>a+1);return}M(q.slice(0,t-1-n))},Zt=Qt.length>1?s.jsx("button",{type:"button",onClick:()=>bs(Ro(Qt.length,{isMultivariateSectionTop:Ca})),title:f("sectionsEditor.sectionsEditor.back"),"aria-label":f("sectionsEditor.sectionsEditor.back"),className:Ie("shrink-0 inline-flex size-6 items-center justify-center classic:rounded-md compact:rounded-lg transition-colors",bt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsx(Wo,{className:"size-4"})}):null;return s.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!F&&Zt&&s.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Zt}),(F||Qt.length>1)&&s.jsx(yo,{crumbs:Qt,onSelect:bs,onSelectRoot:()=>{$t.flush(),z?z():bs(0)}}),s.jsx("div",{className:"shrink-0",children:bt||Yt||O?(Pa||F&&Zt)&&s.jsxs("div",{className:Ie("border-b px-3 py-2.5",bt&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[F&&Zt,!_e&&Et&&ct&&s.jsxs("button",{type:"button",onClick:Us,title:f("sectionsEditor.sectionsEditor.editingInVariant",{variant:ct.label}),className:Ie("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",bo),children:[s.jsx(Ts,{rule:Ft(ct.rule,i??{},c??void 0),matchers:Wt}),s.jsx("span",{className:"max-w-[160px] truncate",children:ct.label})]}),s.jsx("div",{className:"flex-1"}),bt&&s.jsxs(Nt,{children:[s.jsx(At,{asChild:!0,children:s.jsx("span",{className:"shrink-0 cursor-help",children:s.jsx(yn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),s.jsx(Pt,{side:"bottom",className:"max-w-[260px]",children:f("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),$s&&s.jsx(Ys,{onClick:()=>vs()})]}),bt&&s.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:f("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):s.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(xo,{pageKey:j,initialName:Ye.name,initialPath:Ye.path,onFieldChange:ra})}),s.jsxs(Nt,{children:[s.jsx(At,{asChild:!0,children:s.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>re(!0),children:s.jsx(Yo,{size:14})})}),s.jsx(Pt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.editSeo")})]}),s.jsxs(Nt,{children:[s.jsx(At,{asChild:!0,children:s.jsx(at,{type:"button",variant:"ghost",size:"icon","aria-label":f("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>I&&j?I():ve(!0),children:s.jsx(Jo,{size:14})})}),s.jsx(Pt,{side:"bottom",children:f("sectionsEditor.sectionsEditor.viewJson")})]}),s.jsx(Ys,{onClick:Hs})]})}),O?s.jsx(ss,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:s.jsx("div",{className:"mx-auto max-w-2xl",children:qt&&j?s.jsx(vi,{rawSeo:us,innerSeo:As,defaultResolveType:Xn,seoSchema:ea,activeResolveType:ds,seoTypeOptions:Zn,formResetKey:mt,siteDefaultSeo:ta,onBreadcrumbChange:Ge,onPersistRaw:za,onInnerChange:Fa,onClearForm:$a,onBumpFormKey:Ha}):s.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:f("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Yt?s.jsxs(ss,{viewportRef:pe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&St.length>0&&q.length===0&&s.jsxs(s.Fragment,{children:[s.jsx(_o,{listKey:`${j??""}:${u??""}`,variants:St.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ss,onSelect:ha,onRename:se,onDuplicate:Sa,onDelete:va,onRemoveAll:ba,onReorder:ya,onAdd:()=>vs()}),yt&&s.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:f("sectionsEditor.sectionsEditor.variantRule")}),s.jsx(ln,{currentRt:jt??"",currentLabel:es(Tt?.rule,i??{},ht,c??void 0),currentGlobalKey:It(Tt?.rule,i??{},c??void 0)??void 0,matchers:Wt,globals:Ks,onSelect:ka,onSelectGlobal:Va,schema:Aa,formValue:On,onChange:Ta,formKey:`${u??"none"}:${Ss}:${jt??""}`,formWrapperClassName:"pt-1",meta:c??void 0,decofile:i,onSaveReferencedBlock:Ht,sandbox:Gt})]})]}),s.jsx(Js,{activeSchema:gs,formValue:ne,formResetKey:Pe,onFormChange:Ps,onBreadcrumbChange:M,breadcrumbPath:q,emptyMessage:f("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:c,decofile:i,onSaveReferencedBlock:Ht,sandbox:Gt,previewBaseUrl:oe,onRequestAddSection:Cs})]},"editor-section-form"):_e?s.jsx(ss,{viewportRef:pe,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx(Js,{activeSchema:gs,formValue:ne,formResetKey:Pe,onFormChange:Ps,onBreadcrumbChange:M,breadcrumbPath:q,emptyMessage:f("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:c,decofile:i,onSaveReferencedBlock:Ht,sandbox:Gt,previewBaseUrl:oe,onRequestAddSection:Cs})},"editor-global-block"):s.jsxs(ss,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Et&&j&&s.jsx(Ji,{listKey:j,variants:He,activeIndex:Ke,decofile:i??{},meta:c,matchers:Wt,onSelect:Ma,onReorder:Ka,onRename:ie,onDuplicate:Ba,onDelete:La,onAdd:Hs}),Et&&Ae!==null&&s.jsxs("div",{className:Ie("px-3 border-b",de?"pt-3 pb-5 space-y-3":"py-2"),children:[s.jsxs("button",{type:"button",onClick:()=>Re(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer classic:rounded-sm compact:rounded-lg py-0.5 hover:bg-muted/40","aria-expanded":de,children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:f("sectionsEditor.sectionsEditor.variantRule")}),de?s.jsx(Ho,{className:"size-3.5 shrink-0 text-muted-foreground"}):s.jsx(Uo,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),de&&s.jsx("div",{className:Ie("space-y-3",Mt&&"pointer-events-none opacity-50"),children:s.jsx(ln,{currentRt:Ae,currentLabel:es(ct?.rule,i??{},ht,c??void 0),currentGlobalKey:It(ct?.rule,i??{},c??void 0)??void 0,matchers:Wt,globals:Ks,onSelect:Ea,onSelectGlobal:wa,schema:ja,formValue:Ue,onChange:Ra,formKey:`${Ke}:${Ae??""}`,formWrapperClassName:"space-y-3",meta:c??void 0,decofile:i,onSaveReferencedBlock:Ht,sandbox:Gt})})]}),s.jsx("div",{className:"p-2 pt-3",children:s.jsx(Fi,{listKey:`${j??""}-${Ke}`,rawSections:Y,sections:Fe,meta:c,decofile:i,selectedIndex:u,onSelect:ia,onReorder:la,onDelete:ca,onDuplicate:ua,onMakeReusable:Be,onToggleHidden:da,onToggleLazy:ma,onAddVariant:vs,onDetach:fa,onAddSection:()=>ce(!0),canAddSection:_a})})]},"editor-section-list"),s.jsx(jo,{open:ge!==null,onOpenChange:t=>{t||Be(null)},defaultBlockId:ge!==null?xs(Fe[ge]?.label??""):"",isPending:we.isPending,onSubmit:xa}),oe&&s.jsx(xi,{open:Ce,onOpenChange:t=>{ce(t),t||(X.current=null)},meta:c,decofile:i,previewBaseUrl:oe,onSelect:ga}),Ve&&j&&i&&s.jsx(ii,{open:Ve,onOpenChange:ve,pageKey:j,decofile:i}),le!==null&&s.jsx(an,{open:!0,initialName:Vt(He[le]?.rule,i??{},c??void 0)?es(He[le]?.rule,i??{},ht,c??void 0):"",autoLabel:ht(Ft(He[le]?.rule,i??{},c??void 0)),isPending:Mt,onSubmit:async t=>{await Ia(le,t)},onOpenChange:t=>{!t&&!Mt&&ie(null)}}),he!==null&&s.jsx(an,{open:!0,initialName:Vt(St[he]?.rule,i??{},c??void 0)?es(St[he]?.rule,i??{},ht,c??void 0):"",autoLabel:ht(Ft(St[he]?.rule,i??{},c??void 0)),isPending:Mt,onSubmit:async t=>{await Oa(he,t)},onOpenChange:t=>{!t&&!Mt&&se(null)}})]})}export{wc as SectionsEditor};
@@ -1 +1 @@
1
- import{c as $,b as A,r as R,l as G,j as s,B as H}from"./index-BRPaWRo-.js";import{a as J,d as K,b as Q,D as U}from"./dialog-DqpJkgtD.js";import{c as V,b as W,a as X,D as Y}from"./drawer-gvgyCX2C.js";import{u as Z}from"./use-mobile-Cpd2MZ1z.js";import{c as ee}from"./chat-context-2kVChe1m.js";import{S as F,M as se}from"./decopilot-BvnxFULb.js";import{M as le,a as oe}from"./index-DG7Ub4UK.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-J-HhaIRe.js";import{a as J,d as K,b as Q,D as U}from"./dialog-DTxKdk6B.js";import{c as V,b as W,a as X,D as Y}from"./drawer-CwqENKPq.js";import{u as Z}from"./use-mobile-BtQeDX-z.js";import{c as ee}from"./chat-context-C7f3MLVZ.js";import{S as F,M as se}from"./decopilot-DOWkbqe-.js";import{M as le,a as oe}from"./index-b-HPQtaV.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};