decocms 4.365.0 → 4.365.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (488) hide show
  1. package/dist/client/assets/{AlertCircle-bl0yU7gy.js → AlertCircle-BPZWT1gc.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CHPDNuDf.js → AreaChart-CxCPUfZu.js} +3 -3
  3. package/dist/client/assets/{ArrowLeft-CpbUCYpB.js → ArrowLeft-c3HIgil5.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CkVUmxaa.js → ArrowRight-BHzAyFwu.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BQQdFypM.js → ArrowUp-DywwLYcR.js} +1 -1
  6. package/dist/client/assets/{Check-BJaMheL7.js → Check-PyGET9iL.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BNNyBNMK.js → CheckCircle-4Be5K85Z.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-2Ti1evDh.js → ChevronRight-vY_5m8VB.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Cp-tcsrs.js → ChevronUp-B9QGJbr0.js} +1 -1
  10. package/dist/client/assets/{Copy01-BrL9ZrVF.js → Copy01-BbtQlTnV.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-_mwanoIZ.js → CreditCard01-2jrzrshR.js} +1 -1
  12. package/dist/client/assets/{Database01-Dm_V08L3.js → Database01-B8rfUUUF.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-B8slOnrw.js → DotsVertical-zFAA_as9.js} +1 -1
  14. package/dist/client/assets/{Download01-Bl2-HJHJ.js → Download01-CSiLQIib.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-nVgseQIz.js → ErrorBarContext-D7xML5iT.js} +1 -1
  16. package/dist/client/assets/{Eye-B_BMkWWc.js → Eye-BRXlESxS.js} +1 -1
  17. package/dist/client/assets/{File02-3fotvfyl.js → File02-D4JZqTxD.js} +1 -1
  18. package/dist/client/assets/{GitBranch01-Dr0NRbj6.js → GitBranch01-95kZh6WB.js} +1 -1
  19. package/dist/client/assets/{Globe01-DMnQmvOn.js → Globe01-Dej65_H6.js} +1 -1
  20. package/dist/client/assets/{HardDrive-CxNWrsuq.js → HardDrive-DCLQ4vdy.js} +1 -1
  21. package/dist/client/assets/{Image01-DMAKgzzX.js → Image01-Dd-Rx_B5.js} +1 -1
  22. package/dist/client/assets/{Key01-CVfJV98q.js → Key01-CQFO2R8H.js} +1 -1
  23. package/dist/client/assets/{Link01-CKw3sRrv.js → Link01-pGxgI9VT.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-OjBTsG9L.js → LinkExternal01-Jetqi62I.js} +1 -1
  25. package/dist/client/assets/MessageCircle01-D2dDPrBD.js +1 -0
  26. package/dist/client/assets/{Monitor01-Bc6Zvq9B.js → Monitor01-Bw-h-DKp.js} +1 -1
  27. package/dist/client/assets/{Package-DTeqx5ul.js → Package-CF-S4NRB.js} +1 -1
  28. package/dist/client/assets/{Palette-CiXH5EXK.js → Palette-DuCZiZH-.js} +1 -1
  29. package/dist/client/assets/{Play-BPdpqeiE.js → Play-BTJRmkRf.js} +1 -1
  30. package/dist/client/assets/{Plus-kQ9d0PiA.js → Plus-BUGmioCX.js} +1 -1
  31. package/dist/client/assets/Printer-B2Ij2s1c.js +1 -0
  32. package/dist/client/assets/{SearchLg-Cecpe6x9.js → SearchLg-De3yWxzK.js} +1 -1
  33. package/dist/client/assets/{SearchMd-hBr_biLL.js → SearchMd-DanltqT5.js} +1 -1
  34. package/dist/client/assets/{Sector-B0yBxg4a.js → Sector-DqvqR1iU.js} +2 -2
  35. package/dist/client/assets/{Settings02-BqKUeA5H.js → Settings02-C-HNbNsn.js} +1 -1
  36. package/dist/client/assets/{Share07-D8xQrAsX.js → Share07-C4Gw_nzw.js} +1 -1
  37. package/dist/client/assets/{Shield01-Dav77ssu.js → Shield01-7bhnSYVs.js} +1 -1
  38. package/dist/client/assets/{Stars01-DWjpdjKn.js → Stars01-BmtGexbk.js} +1 -1
  39. package/dist/client/assets/{Sun-wxsl7cI_.js → Sun-D5AClOdh.js} +1 -1
  40. package/dist/client/assets/{SwitchHorizontal01-CCraiYIJ.js → SwitchHorizontal01-CCmSX-Ww.js} +1 -1
  41. package/dist/client/assets/{Tool01-E6Rv0Nbs.js → Tool01-C1VYYGhf.js} +1 -1
  42. package/dist/client/assets/{Tool02-Darwb8nP.js → Tool02-A5gv-OOO.js} +1 -1
  43. package/dist/client/assets/{Trash01-BB2ymX9J.js → Trash01-DkwdEhkp.js} +1 -1
  44. package/dist/client/assets/{TrendUp01-PJuAXI74.js → TrendUp01-CQWL_vX5.js} +1 -1
  45. package/dist/client/assets/{Upload01-BtBtAyal.js → Upload01-BlEOH700.js} +1 -1
  46. package/dist/client/assets/{User01-CtDIPHIF.js → User01-C2ILPAHc.js} +1 -1
  47. package/dist/client/assets/{UserSquare-BflxhZ_l.js → UserSquare-DY1wI6ZR.js} +1 -1
  48. package/dist/client/assets/{Users01-9HTYv5bx.js → Users01-bydaoxbh.js} +1 -1
  49. package/dist/client/assets/{Users03-D8RoJqiC.js → Users03-3yW32m45.js} +1 -1
  50. package/dist/client/assets/X-DejWyAyX.js +1 -0
  51. package/dist/client/assets/{XCircle-Dvf0BUKb.js → XCircle-SVZraRfE.js} +1 -1
  52. package/dist/client/assets/{XClose-DPfGLo7I.js → XClose-wkdnmhrB.js} +1 -1
  53. package/dist/client/assets/{Zap-ChgjHdxL.js → Zap-0km1-ru7.js} +1 -1
  54. package/dist/client/assets/{ZoomOut-BAhVAzy1.js → ZoomOut-BA2ZiotX.js} +1 -1
  55. package/dist/client/assets/access-gate-DpZqBld0.js +1 -0
  56. package/dist/client/assets/add-connection-dialog-DB5JJjad.js +1 -0
  57. package/dist/client/assets/agent-analytics-CAHUVirD.js +2 -0
  58. package/dist/client/assets/agent-app-BeMC8z8k.js +1 -0
  59. package/dist/client/assets/agent-assets-DsMv2xEg.js +1 -0
  60. package/dist/client/assets/agent-automation-BY5j9rqa.js +20 -0
  61. package/dist/client/assets/agent-automations-1_XWI0cB.js +1 -0
  62. package/dist/client/assets/agent-connect-sources-CGYs_l_4.js +1 -0
  63. package/dist/client/assets/agent-deck-BqKNWwGC.js +1 -0
  64. package/dist/client/assets/agent-e2e-DSg6pAM6.js +1 -0
  65. package/dist/client/assets/agent-file-QzuIvb2U.js +1 -0
  66. package/dist/client/assets/agent-git-B5SGdxwk.js +3 -0
  67. package/dist/client/assets/agent-hosting-CWM0TAgK.js +1 -0
  68. package/dist/client/assets/agent-icon-BjknPEfN.js +1 -0
  69. package/dist/client/assets/agent-library-file-DOj4Pso1.js +1 -0
  70. package/dist/client/assets/agent-monitor-D0SLtbEO.js +1 -0
  71. package/dist/client/assets/agent-overview-4MzJb6Tv.js +1 -0
  72. package/dist/client/assets/agent-settings-D4SL-PIa.js +1 -0
  73. package/dist/client/assets/agent-site-editor-BDP-vSUl.js +24 -0
  74. package/dist/client/assets/agent-site-editor-code-C2z-Az-Y.js +2 -0
  75. package/dist/client/assets/agent-site-editor-content-JPYekiK_.js +2 -0
  76. package/dist/client/assets/agent-site-editor-preview-CFLjaarK.js +504 -0
  77. package/dist/client/assets/agent-view-Bp9ooHxf.js +1 -0
  78. package/dist/client/assets/agent-view-guard-B7qYW-b3.js +1 -0
  79. package/dist/client/assets/agents-list-h96XaSKk.js +1 -0
  80. package/dist/client/assets/ai-providers-COWdzwzu.js +1 -0
  81. package/dist/client/assets/{alert-DkgzGFz6.js → alert-CvK2RkF3.js} +1 -1
  82. package/dist/client/assets/{alert-dialog-BdwUra4d.js → alert-dialog-CDARhUOh.js} +2 -2
  83. package/dist/client/assets/{api-keys-Bl99t7Nm.js → api-keys-Ba-S9F5Y.js} +1 -1
  84. package/dist/client/assets/api-keys-DeCwNgs3.js +1 -0
  85. package/dist/client/assets/app-editor-CsOLGnt4.js +1 -0
  86. package/dist/client/assets/asset-utils-DQpbxjwd.js +1 -0
  87. package/dist/client/assets/{auth-vfqjjrgv.js → auth-Cyjh0UQp.js} +1 -1
  88. package/dist/client/assets/{auth-catchall-CZ_cFv3z.js → auth-catchall-BbOJ2FpE.js} +1 -1
  89. package/dist/client/assets/{auth-entry-Cp4v6AT2.js → auth-entry-CIc1-YG9.js} +1 -1
  90. package/dist/client/assets/{auth-split-layout-BB-yAg-2.js → auth-split-layout-WGnYlU-M.js} +1 -1
  91. package/dist/client/assets/{authenticate-and-persist-oauth-CpB-R1LO.js → authenticate-and-persist-oauth-Dgc5b4Jr.js} +1 -1
  92. package/dist/client/assets/{automation-list-row-DKusfCau.js → automation-list-row-Dyqat6cE.js} +1 -1
  93. package/dist/client/assets/automation-runs-DkHp_jZr.js +1 -0
  94. package/dist/client/assets/automations-BSGRkynt.js +1 -0
  95. package/dist/client/assets/{autosend-u-W4xgi7.js → autosend-BBoss6Ia.js} +1 -1
  96. package/dist/client/assets/{avatar-BpU54ct-.js → avatar-CO3n6wLC.js} +1 -1
  97. package/dist/client/assets/backoff-8mStPHYB.js +1 -0
  98. package/dist/client/assets/{badge-DJ5ezE5-.js → badge-DUpgRwQu.js} +1 -1
  99. package/dist/client/assets/{block-document-7Ngv587f.js → block-document-CVyeCLBq.js} +3 -3
  100. package/dist/client/assets/blocks-preview-workspace-context-CLQbGv9t.js +1 -0
  101. package/dist/client/assets/{breadcrumb-Dlcs3jWo.js → breadcrumb-FJ1G6kmP.js} +1 -1
  102. package/dist/client/assets/buckets-BTZUX3pR.js +1 -0
  103. package/dist/client/assets/build-improve-prompt-doc-CcAYvBOj.js +2 -0
  104. package/dist/client/assets/bulk-category-panel-9cEfFq4L.js +1 -0
  105. package/dist/client/assets/{calendar-B8BrEMls.js → calendar-Bb8OUNd8.js} +1 -1
  106. package/dist/client/assets/{capability-load-error-CdMFNpdR.js → capability-load-error-Ctg9pY-k.js} +1 -1
  107. package/dist/client/assets/{cards-BfP1wflC.js → cards-CbRL3hJc.js} +1 -1
  108. package/dist/client/assets/category-editor-DLB1OCyq.js +1 -0
  109. package/dist/client/assets/{chart-zbtN9_7R.js → chart-DqNrc8dZ.js} +1 -1
  110. package/dist/client/assets/{chat-context-CD1rWX64.js → chat-context-B40ngn3f.js} +9 -9
  111. package/dist/client/assets/{checkbox-DwVdLA7e.js → checkbox-STVvKX8k.js} +1 -1
  112. package/dist/client/assets/choose-editor-DVdbAy2O.js +1 -0
  113. package/dist/client/assets/claim-phase-copy-0btUuJoC.js +1 -0
  114. package/dist/client/assets/{cli-auth-success-BtBj1xJE.js → cli-auth-success-DmTxFaq5.js} +1 -1
  115. package/dist/client/assets/{client-icons-BcSFyY79.js → client-icons-CR99ZCoE.js} +1 -1
  116. package/dist/client/assets/collapsible-Cf4ZreOo.js +1 -0
  117. package/dist/client/assets/collection-detail-oWaNi-hD.js +1 -0
  118. package/dist/client/assets/collection-display-button-CkKXuKd-.js +1 -0
  119. package/dist/client/assets/{collection-search-Bi-DttH4.js → collection-search-CDaDEv2c.js} +1 -1
  120. package/dist/client/assets/{collection-table-wrapper-DfAhVjGn.js → collection-table-wrapper-B036tBOl.js} +1 -1
  121. package/dist/client/assets/{collection-tabs-BZkkvpP_.js → collection-tabs-CkeFxbT3.js} +1 -1
  122. package/dist/client/assets/{command-cJVGaRa3.js → command-D7YFT70c.js} +1 -1
  123. package/dist/client/assets/{command-palette-store-BNo0UXiS.js → command-palette-store-BcwFt5eE.js} +1 -1
  124. package/dist/client/assets/commerce-onboarding-BcoYZTQG.js +1 -0
  125. package/dist/client/assets/{companion-mcps-section-smAU7jYC.js → companion-mcps-section-CS9qQ8v0.js} +1 -1
  126. package/dist/client/assets/{connect-Bn7h46Ea.js → connect-BM6ZfhOz.js} +2 -2
  127. package/dist/client/assets/connect-layout-De5w9TxQ.js +1 -0
  128. package/dist/client/assets/{connection-card-DCMUv-0w.js → connection-card-kANJRcvf.js} +1 -1
  129. package/dist/client/assets/connection-detail-Ckkh02Py.js +1 -0
  130. package/dist/client/assets/{connection-D6f54N4w.js → connection-di4Fldx3.js} +1 -1
  131. package/dist/client/assets/{connection-form-helpers-BiJdmlDA.js → connection-form-helpers-fWne-kOd.js} +1 -1
  132. package/dist/client/assets/connections-BKm7IMTt.js +1 -0
  133. package/dist/client/assets/{create-organization-dialog-IR2z5bIs.js → create-organization-dialog-BmgLNeEx.js} +1 -1
  134. package/dist/client/assets/decofile-api-BhjpITFN.js +1 -0
  135. package/dist/client/assets/{decopilot-CK3rN_ad.js → decopilot-ClO0uusm.js} +2 -2
  136. package/dist/client/assets/dialog-Dxe0Jgna.js +1 -0
  137. package/dist/client/assets/discover-BdugM7FR.js +1 -0
  138. package/dist/client/assets/domain-settings-Dp-mWih8.js +1 -0
  139. package/dist/client/assets/{download-app-dialog-CNd8ka-x.js → download-app-dialog-lwMMuYsF.js} +1 -1
  140. package/dist/client/assets/{drawer-DsG6Si3V.js → drawer-1GzYkddr.js} +1 -1
  141. package/dist/client/assets/{dropdown-menu-4cRHTbic.js → dropdown-menu-Bws_0K_q.js} +1 -1
  142. package/dist/client/assets/{editor-NTP5Xcj9.js → editor-U5ucetu-.js} +1 -1
  143. package/dist/client/assets/{empty-state-DmTochCH.js → empty-state-BjMIbq91.js} +1 -1
  144. package/dist/client/assets/{empty-state-D86Jkx4H.js → empty-state-C3Z_6q55.js} +1 -1
  145. package/dist/client/assets/{extract-connection-data-B3hIAjiC.js → extract-connection-data-BAjOM4U5.js} +1 -1
  146. package/dist/client/assets/file-explorer-LFC3Ac60.js +2 -0
  147. package/dist/client/assets/{file-preview-BbFH5cdB.js → file-preview-n35lcg8c.js} +1 -1
  148. package/dist/client/assets/{file-share-button-ChoXQdlr.js → file-share-button-D04rfik7.js} +2 -2
  149. package/dist/client/assets/{file-type-icon-DJQFeBpV.js → file-type-icon-C4dI9q_n.js} +1 -1
  150. package/dist/client/assets/{folder-icon-BRLOuEpt.js → folder-icon-pWHmymOf.js} +1 -1
  151. package/dist/client/assets/{form-DhUF_Mtg.js → form-CRSWplOb.js} +1 -1
  152. package/dist/client/assets/{gateway-client-Cb37izH_.js → gateway-client-D45uHvIc.js} +1 -1
  153. package/dist/client/assets/general-C7RGB0Oj.js +1 -0
  154. package/dist/client/assets/{github-icon-cJDFDEm7.js → github-icon-CsH29e4W.js} +1 -1
  155. package/dist/client/assets/{github-repo-C0igpkr9.js → github-repo-BknN0SVI.js} +1 -1
  156. package/dist/client/assets/home-CpLcM3nB.js +1 -0
  157. package/dist/client/assets/hooks-CE7d6Dy1.js +15 -0
  158. package/dist/client/assets/{hooks-BrcP19Uo.js → hooks-CxBYuMc8.js} +2 -2
  159. package/dist/client/assets/{index-epfDD3H5.js → index-4fsCOuPz.js} +2 -2
  160. package/dist/client/assets/index-B53DWiGz.js +1 -0
  161. package/dist/client/assets/{index-BQzHGsvt.js → index-BJDZS0O4.js} +11 -11
  162. package/dist/client/assets/index-BQwroePl.js +1 -0
  163. package/dist/client/assets/{index-Df6f9kP3.js → index-BRigOSQu.js} +1 -1
  164. package/dist/client/assets/{index-CoYeuRng.js → index-CBcq1VSB.js} +1 -1
  165. package/dist/client/assets/index-CFUteTrc.js +1 -0
  166. package/dist/client/assets/{index-gctAQu2T.js → index-CVJEcf37.js} +74 -74
  167. package/dist/client/assets/{index-DQ6uuKpF.js → index-CblYf_yB.js} +8 -8
  168. package/dist/client/assets/{index-BywxOh2e.js → index-CcEd_wWL.js} +1 -1
  169. package/dist/client/assets/index-Clbrhj--.js +1 -0
  170. package/dist/client/assets/{index-CImKKZ20.js → index-CxOPSFx9.js} +1 -1
  171. package/dist/client/assets/index-CyYEAXEU.js +1 -0
  172. package/dist/client/assets/{index-eVyHwFa9.js → index-DAN6A7hZ.js} +1 -1
  173. package/dist/client/assets/{index-DJADaZ4J.css → index-DUflXgSu.css} +1 -1
  174. package/dist/client/assets/index-Dio39w6e.js +26 -0
  175. package/dist/client/assets/index-DsI9yqDT.js +1 -0
  176. package/dist/client/assets/{index-redirect-DxBD4sTo.js → index-redirect-Bw20Ba6Y.js} +1 -1
  177. package/dist/client/assets/{infiniteQueryObserver-Da0v0sXC.js → infiniteQueryObserver-BSmIgXE3.js} +1 -1
  178. package/dist/client/assets/infra-billing-DFEuQtvU.js +1 -0
  179. package/dist/client/assets/{input-eBmoU-9D.js → input-C8MQoDCb.js} +1 -1
  180. package/dist/client/assets/{input-DlvEXkej.js → input-CQyA0V5b.js} +1 -1
  181. package/dist/client/assets/{input-C9QH7mMV.js → input-DD_DI_Km.js} +2 -2
  182. package/dist/client/assets/{integration-icon-YYg8l_RW.js → integration-icon-BV7Q9XOu.js} +1 -1
  183. package/dist/client/assets/{label-DGkzLfNU.js → label-Cfl8uGDP.js} +1 -1
  184. package/dist/client/assets/last-preview-page-B_KVLuYW.js +1 -0
  185. package/dist/client/assets/layout-Dm4T-Vne.js +1 -0
  186. package/dist/client/assets/legacy-agents-deep-Dd57JUEI.js +1 -0
  187. package/dist/client/assets/legacy-main-redirect-CWvMqmhB.js +1 -0
  188. package/dist/client/assets/{library-CKrgioQu.js → library-3DHQWojm.js} +4 -4
  189. package/dist/client/assets/login-CupMnybl.js +1 -0
  190. package/dist/client/assets/{markdown-BV0XgGTq.js → markdown-BvSl7QX1.js} +3 -3
  191. package/dist/client/assets/{mcp-app-renderer-Bv46PiO3.js → mcp-app-renderer-DJ7Ve9Yy.js} +2 -2
  192. package/dist/client/assets/{mcp-oauth-i7PCjbNf.js → mcp-oauth-OvlzbMCP.js} +1 -1
  193. package/dist/client/assets/members-Cuiahh5G.js +1 -0
  194. package/dist/client/assets/message-templates-wocfrCJF.js +1 -0
  195. package/dist/client/assets/{mini-report-page-k88VT2C2.js → mini-report-page-4Bd0cMlr.js} +1 -1
  196. package/dist/client/assets/{monaco-editor-kRD7y0Pc.js → monaco-editor-B2KCfh7a.js} +1 -1
  197. package/dist/client/assets/{monitoring-stats-row-CuCuR7PQ.js → monitoring-stats-row-CufhVlNy.js} +1 -1
  198. package/dist/client/assets/{multi-select-CltjjMwX.js → multi-select-BHFunwbq.js} +1 -1
  199. package/dist/client/assets/{mustache-Db7x-4gI.js → mustache-DyjElMuJ.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-CT29B8-5.js → oauth-callback-4BOm__rV.js} +1 -1
  201. package/dist/client/assets/{oauth-callback-ai-provider-3CPoYshC.js → oauth-callback-ai-provider-Czk5gVgf.js} +1 -1
  202. package/dist/client/assets/{onboarding-DEm51GnF.js → onboarding-D2PsWH4h.js} +1 -1
  203. package/dist/client/assets/{optimistic-project-sidebar-views-Drtbh9Ui.js → optimistic-project-sidebar-views-B3vU1qR8.js} +1 -1
  204. package/dist/client/assets/{organization-choice-BdqJqB_v.js → organization-choice-C-PRPVPc.js} +1 -1
  205. package/dist/client/assets/orgs-DpmY6dw4.js +1 -0
  206. package/dist/client/assets/{page-seo-form-BXvLQ5tk.js → page-seo-form-gUB5sB3u.js} +1 -1
  207. package/dist/client/assets/{pair-BIPkH5eA.js → pair-98UY-0wm.js} +8 -8
  208. package/dist/client/assets/{popover-BfKN_4aI.js → popover-DAJR0ej2.js} +1 -1
  209. package/dist/client/assets/post-calendar-4XiTJrif.js +1 -0
  210. package/dist/client/assets/post-editor-CXRn_RK8.js +1 -0
  211. package/dist/client/assets/preview-content-Tw_jYCgT.js +1 -0
  212. package/dist/client/assets/{preview-dialog-CYbL8r4H.js → preview-dialog-Bg_Wo7YI.js} +1 -1
  213. package/dist/client/assets/{primitives-BXcg67BS.js → primitives-BfIYsPoI.js} +1 -1
  214. package/dist/client/assets/profile-CDs1X-Le.js +1 -0
  215. package/dist/client/assets/project-app-view-BPLB01Cj.js +1 -0
  216. package/dist/client/assets/project-feed-CeGbFvMT.js +1 -0
  217. package/dist/client/assets/{project-icon-Dk1HaDIZ.js → project-icon-D1x6NEST.js} +1 -1
  218. package/dist/client/assets/project-reports-fH8-r6df.js +1 -0
  219. package/dist/client/assets/project-tasks-tas6EPem.js +1 -0
  220. package/dist/client/assets/prompts-B-VqD1p-.js +1 -0
  221. package/dist/client/assets/record-editor-LOQZDk0V.js +1 -0
  222. package/dist/client/assets/redirect-editor-CgXt_KHn.js +1 -0
  223. package/dist/client/assets/registry-YMo7WLlx.js +2 -0
  224. package/dist/client/assets/{registry-layout-CRM-FBei.js → registry-layout-SseogjtO.js} +3 -3
  225. package/dist/client/assets/reports-DC8tSFj3.js +1 -0
  226. package/dist/client/assets/{reports-B1FmmHPo.js → reports-Q6oueood.js} +2 -2
  227. package/dist/client/assets/reports-tab-DE-TYPly.js +2 -0
  228. package/dist/client/assets/repositories-BoiOgwFm.js +1 -0
  229. package/dist/client/assets/repository-import-picker-DyEfEliR.js +1 -0
  230. package/dist/client/assets/repository-picker-DWJtJkZW.js +1 -0
  231. package/dist/client/assets/require-capability-DljrHpsM.js +1 -0
  232. package/dist/client/assets/{required-auth-layout-CraNNSBi.js → required-auth-layout-TTElzhIM.js} +1 -1
  233. package/dist/client/assets/{reset-password-DcO8_P05.js → reset-password-B1ylDKoe.js} +1 -1
  234. package/dist/client/assets/resizable-DOW_fL7z.js +1 -0
  235. package/dist/client/assets/retry-i8LvYSZg.js +1 -0
  236. package/dist/client/assets/{review-settings-CANg_Nan.js → review-settings-DHvMG4G0.js} +1 -1
  237. package/dist/client/assets/{rich-text-link-control-CCig2s9-.js → rich-text-link-control-HLhFAha7.js} +1 -1
  238. package/dist/client/assets/roles-BWbTlJZc.js +1 -0
  239. package/dist/client/assets/route-D26IsMv1.js +1 -0
  240. package/dist/client/assets/route-D_kbg4iH.js +1 -0
  241. package/dist/client/assets/route-jdsFbZW7.js +1 -0
  242. package/dist/client/assets/runnable-block-editor-Bi0Cv7yD.js +16 -0
  243. package/dist/client/assets/sandbox-git-api-CMdpE2TE.js +1 -0
  244. package/dist/client/assets/{sandbox-lifecycle-context-Beua1bNX.js → sandbox-lifecycle-context-BbTDNpeS.js} +2 -2
  245. package/dist/client/assets/save-changes-debug-nBi-n9eV.js +1 -0
  246. package/dist/client/assets/{schema-BzgrQmAY.js → schema-BegvnGCM.js} +1 -1
  247. package/dist/client/assets/{scroll-area-tBZq-ZvJ.js → scroll-area-CxxMejtk.js} +1 -1
  248. package/dist/client/assets/{search-input-CYERWjWv.js → search-input-axkgbTZ7.js} +1 -1
  249. package/dist/client/assets/secrets-kzqIbFmd.js +1 -0
  250. package/dist/client/assets/section-preview-url-Csj0_ZDg.js +1 -0
  251. package/dist/client/assets/sections-editor-B_t9OrnC.js +2 -0
  252. package/dist/client/assets/select-B2GRzoG3.js +1 -0
  253. package/dist/client/assets/select-model-BRHN792B.js +1 -0
  254. package/dist/client/assets/seo-editor-DvngP1ti.js +1 -0
  255. package/dist/client/assets/settings-tab-DFjZ-Fkn.js +5 -0
  256. package/dist/client/assets/sheet-BePDARR0.js +1 -0
  257. package/dist/client/assets/shell-layout-D2wS-FNX.js +1 -0
  258. package/dist/client/assets/sidebar-IspuJbto.js +1 -0
  259. package/dist/client/assets/skill-preview-BdtuUFgV.js +1 -0
  260. package/dist/client/assets/skills-QJ3mhNvI.js +1 -0
  261. package/dist/client/assets/sso-DKhL-ARh.js +1 -0
  262. package/dist/client/assets/{store-CjL9y_7d.js → store-B9Az6md3.js} +1 -1
  263. package/dist/client/assets/store-registry-hcgHbNGW.js +2 -0
  264. package/dist/client/assets/switch-DJ4Dr2_V.js +1 -0
  265. package/dist/client/assets/synced-repos-flbNGs20.js +1 -0
  266. package/dist/client/assets/{table-aIDGrvqv.js → table-CrJ9LOSc.js} +1 -1
  267. package/dist/client/assets/{tabs-Sr-wlkg3.js → tabs-DVMaAAMA.js} +1 -1
  268. package/dist/client/assets/{task-board-CazuPR-U.js → task-board-SlBuwhrX.js} +1 -1
  269. package/dist/client/assets/task-route-B4hPzw6u.js +1 -0
  270. package/dist/client/assets/{task-status-Cj8IGjJC.js → task-status-DhZZzZ6G.js} +1 -1
  271. package/dist/client/assets/{tasks-DzatESzy.js → tasks-B_rqCvr1.js} +4 -4
  272. package/dist/client/assets/tasks-CViGtGHm.js +1 -0
  273. package/dist/client/assets/{textarea-6VvdKhvF.js → textarea-BDMLJ5G-.js} +1 -1
  274. package/dist/client/assets/{thread-intent-DPwCeeGE.js → thread-intent-C7DpKTRQ.js} +1 -1
  275. package/dist/client/assets/thread-route-Bc63tvFc.js +1 -0
  276. package/dist/client/assets/{thread-route-BsrvgyVU.js → thread-route-BzWllNYG.js} +1 -1
  277. package/dist/client/assets/thread-sheet-body-CiausLhX.js +1 -0
  278. package/dist/client/assets/toggle-group-BW8cP6lf.js +1 -0
  279. package/dist/client/assets/{toolbar-icon-button-CSTgB2Je.js → toolbar-icon-button-A2ebiBUr.js} +1 -1
  280. package/dist/client/assets/tooltip-B7VLfO9w.js +1 -0
  281. package/dist/client/assets/{track-CDfY4FZL.js → track-BGU8HJCB.js} +1 -1
  282. package/dist/client/assets/{types-8hWP_tsZ.js → types-CrAbOCy3.js} +6 -6
  283. package/dist/client/assets/usage-stats-Bf1Ukas_.js +1 -0
  284. package/dist/client/assets/use-ai-providers-R1Jac-4Q.js +1 -0
  285. package/dist/client/assets/use-automations-BzLd_Cf7.js +1 -0
  286. package/dist/client/assets/{use-autosave-DRlRuq5e.js → use-autosave-BezKrA6F.js} +1 -1
  287. package/dist/client/assets/use-commerce-diagnostic-DTGIqIpu.js +1 -0
  288. package/dist/client/assets/use-connect-companion-CgerJAPe.js +1 -0
  289. package/dist/client/assets/{use-connection-tOIuuLKJ.js → use-connection-B4t4VJEN.js} +1 -1
  290. package/dist/client/assets/{use-copy-B4PUMZjo.js → use-copy-DQwrjGi4.js} +1 -1
  291. package/dist/client/assets/{use-create-virtual-mcp-x2IPUAAO.js → use-create-virtual-mcp-CHEKOqdh.js} +1 -1
  292. package/dist/client/assets/{use-date-fns-locale-use6rm0l.js → use-date-fns-locale-m0Q-8AAg.js} +1 -1
  293. package/dist/client/assets/{use-debounced-autosave-CWLgAozd.js → use-debounced-autosave-C82NqRut.js} +1 -1
  294. package/dist/client/assets/{use-debounced-value-BHZw1Wtv.js → use-debounced-value-SjJ8k_tD.js} +1 -1
  295. package/dist/client/assets/use-deco-credits-CIfhJ3OU.js +1 -0
  296. package/dist/client/assets/use-decopilot-events-DDnHJjGY.js +1 -0
  297. package/dist/client/assets/use-delete-connection-BWW3Qwe4.js +1 -0
  298. package/dist/client/assets/{use-deployment-admin-PTBGIrMl.js → use-deployment-admin-D4Et99Id.js} +1 -1
  299. package/dist/client/assets/use-fast-preview-draft-url-B8C-G0p2.js +1 -0
  300. package/dist/client/assets/use-file-configs-CKcyFOK-.js +1 -0
  301. package/dist/client/assets/{use-infinite-scroll-DnRzNQQc.js → use-infinite-scroll-C88xvDJq.js} +1 -1
  302. package/dist/client/assets/use-join-requests-CtMSd2H7.js +1 -0
  303. package/dist/client/assets/use-main-panel-tabs-BLf-yD79.js +1 -0
  304. package/dist/client/assets/use-mcp-auth-status-CF5e5Swp.js +1 -0
  305. package/dist/client/assets/{use-mcp-client-CzGi1Gun.js → use-mcp-client-DmOwsV3f.js} +6 -6
  306. package/dist/client/assets/{use-mcp-prompts-BJsq63pG.js → use-mcp-prompts-BKFfTbQi.js} +1 -1
  307. package/dist/client/assets/{use-mcp-tools-I4ahUYGD.js → use-mcp-tools-eOThR6gd.js} +1 -1
  308. package/dist/client/assets/{use-members-xjztJVBn.js → use-members-mw1URW2v.js} +1 -1
  309. package/dist/client/assets/use-mobile-WPuOYoIV.js +1 -0
  310. package/dist/client/assets/{use-navigate-to-agent-CBQsYRLL.js → use-navigate-to-agent-zGc1-u-z.js} +1 -1
  311. package/dist/client/assets/use-open-billing-url-BYWSUicc.js +1 -0
  312. package/dist/client/assets/use-org-auth-client-mMTl8cKp.js +1 -0
  313. package/dist/client/assets/{use-org-fs-Cm8FYvYP.js → use-org-fs-Ck9VysIz.js} +1 -1
  314. package/dist/client/assets/use-org-notice-Cb7z4nA0.js +1 -0
  315. package/dist/client/assets/{use-org-sso-CP_t4LLU.js → use-org-sso-CvkPQsKr.js} +1 -1
  316. package/dist/client/assets/{use-organization-roles-Cnixvt9H.js → use-organization-roles-wnmrYWSM.js} +1 -1
  317. package/dist/client/assets/use-organization-settings-CRw6qdb3.js +1 -0
  318. package/dist/client/assets/use-panel-navigate-ez3OqVq8.js +1 -0
  319. package/dist/client/assets/{use-project-native-view-presence-CJ7vLSBz.js → use-project-native-view-presence-DFjsPIlC.js} +1 -1
  320. package/dist/client/assets/use-project-scope-D9t-w7F3.js +1 -0
  321. package/dist/client/assets/use-registry-connections-BC1Pt8V1.js +1 -0
  322. package/dist/client/assets/use-releases-B_ioEYcb.js +1 -0
  323. package/dist/client/assets/use-route-default-main-B8Ci266p.js +1 -0
  324. package/dist/client/assets/use-secrets-BZEH47Ed.js +1 -0
  325. package/dist/client/assets/use-section-preview-base-D8ddLJeY.js +1 -0
  326. package/dist/client/assets/{use-session-runtime-Cs4eGT9k.js → use-session-runtime-CKDTMwlz.js} +1 -1
  327. package/dist/client/assets/use-tags-BnnveSvi.js +1 -0
  328. package/dist/client/assets/use-task-metadata-DQ-jzCVZ.js +1 -0
  329. package/dist/client/assets/{use-thread-outputs-DtpQGqCf.js → use-thread-outputs-ChimPCUk.js} +1 -1
  330. package/dist/client/assets/use-view-mode-CpyVGfy9.js +1 -0
  331. package/dist/client/assets/use-virtual-mcp-DvSX4N6q.js +1 -0
  332. package/dist/client/assets/useInfiniteQuery-CuoCKqDV.js +1 -0
  333. package/dist/client/assets/{useQueries-CnHkVL7d.js → useQueries-CCVXh4wK.js} +1 -1
  334. package/dist/client/assets/useSuspenseInfiniteQuery-BGyZ2Zcs.js +1 -0
  335. package/dist/client/assets/{users-CWHZPvdU.js → users-DgkJfwRz.js} +1 -1
  336. package/dist/client/assets/{utils-CdxSjBly.js → utils-D06E4WDv.js} +2 -2
  337. package/dist/client/assets/variant-calendar-B2YQFxru.js +1 -0
  338. package/dist/client/assets/{variant-matcher-override-BLTbL0Nb.js → variant-matcher-override-POFwaaTG.js} +1 -1
  339. package/dist/client/assets/view-mode-toggle-B09x-ETl.js +1 -0
  340. package/dist/client/assets/{virtual-mcp-CIE6gIFV.js → virtual-mcp-D-br_N6s.js} +1 -1
  341. package/dist/client/index.html +2 -2
  342. package/dist/server/cli.js +1 -1
  343. package/dist/server/server.js +1 -1
  344. package/package.json +1 -1
  345. package/dist/client/assets/Printer-Nban-oJk.js +0 -1
  346. package/dist/client/assets/access-gate-aVhmxNUP.js +0 -1
  347. package/dist/client/assets/add-connection-dialog-C2-znERG.js +0 -1
  348. package/dist/client/assets/agent-analytics-CLObAM6S.js +0 -2
  349. package/dist/client/assets/agent-app-DtLxy7iB.js +0 -1
  350. package/dist/client/assets/agent-assets-5J9H4wgC.js +0 -1
  351. package/dist/client/assets/agent-automation-DTYBStDc.js +0 -20
  352. package/dist/client/assets/agent-automations-DYZPALXC.js +0 -1
  353. package/dist/client/assets/agent-connect-sources-DJFWziK9.js +0 -1
  354. package/dist/client/assets/agent-deck-De0Y6qk5.js +0 -1
  355. package/dist/client/assets/agent-e2e-MVQ6vmAy.js +0 -1
  356. package/dist/client/assets/agent-file-IBnKf7Fw.js +0 -1
  357. package/dist/client/assets/agent-git-DjVoKiR8.js +0 -3
  358. package/dist/client/assets/agent-hosting-DbC8wvCr.js +0 -1
  359. package/dist/client/assets/agent-icon-DsGBCBNv.js +0 -1
  360. package/dist/client/assets/agent-library-file-CySHm683.js +0 -1
  361. package/dist/client/assets/agent-monitor-Duc2QTVQ.js +0 -1
  362. package/dist/client/assets/agent-overview-DAVTPrgq.js +0 -1
  363. package/dist/client/assets/agent-settings-DBEnACPy.js +0 -1
  364. package/dist/client/assets/agent-site-editor-CJ_722sF.js +0 -1
  365. package/dist/client/assets/agent-site-editor-code-CBPV2yNN.js +0 -2
  366. package/dist/client/assets/agent-site-editor-content-C-fwwsI7.js +0 -2
  367. package/dist/client/assets/agent-site-editor-preview-Be-uG2hV.js +0 -504
  368. package/dist/client/assets/agent-view-B3DdbJTr.js +0 -1
  369. package/dist/client/assets/agent-view-guard-DTG6Ut5n.js +0 -1
  370. package/dist/client/assets/agents-list-DNaOFYAO.js +0 -1
  371. package/dist/client/assets/ai-providers-BPcl_qgT.js +0 -1
  372. package/dist/client/assets/api-keys-CYMMtT0P.js +0 -1
  373. package/dist/client/assets/app-editor-_27_2g82.js +0 -1
  374. package/dist/client/assets/asset-utils-DTfzHa9m.js +0 -1
  375. package/dist/client/assets/automation-runs-Dt50JHCo.js +0 -1
  376. package/dist/client/assets/automations-DDydXmIK.js +0 -1
  377. package/dist/client/assets/backoff-CrEUbyZT.js +0 -1
  378. package/dist/client/assets/buckets-Wx6DtJNT.js +0 -1
  379. package/dist/client/assets/build-improve-prompt-doc-4aKzyTWA.js +0 -2
  380. package/dist/client/assets/bulk-category-panel-CclTC40F.js +0 -1
  381. package/dist/client/assets/category-editor-CuGxUDVJ.js +0 -1
  382. package/dist/client/assets/choose-editor-CE7aKrQp.js +0 -1
  383. package/dist/client/assets/collapsible-BDifv-q9.js +0 -1
  384. package/dist/client/assets/collection-detail-ec9sW8Ey.js +0 -1
  385. package/dist/client/assets/collection-display-button-C3CfuUhX.js +0 -1
  386. package/dist/client/assets/commerce-onboarding-Dxc7EEsL.js +0 -1
  387. package/dist/client/assets/connect-layout-Bby2uYqZ.js +0 -1
  388. package/dist/client/assets/connection-detail-C-Fe9wui.js +0 -1
  389. package/dist/client/assets/connections-CxSK9S4W.js +0 -1
  390. package/dist/client/assets/decode-html-entities-B4Qel6ov.js +0 -1
  391. package/dist/client/assets/decopilot-sse-pool-czpSFI9L.js +0 -1
  392. package/dist/client/assets/delay-CnY5UFtP.js +0 -1
  393. package/dist/client/assets/dialog--Jkwvpx1.js +0 -1
  394. package/dist/client/assets/discover-C7-JIKhR.js +0 -1
  395. package/dist/client/assets/domain-settings-Dh029s1M.js +0 -1
  396. package/dist/client/assets/file-explorer-B4d-xz4q.js +0 -2
  397. package/dist/client/assets/general-BY1zbaWS.js +0 -1
  398. package/dist/client/assets/home-CeJo7q7K.js +0 -1
  399. package/dist/client/assets/hooks-CxPd9b6i.js +0 -15
  400. package/dist/client/assets/index-1yGxjvng.js +0 -24
  401. package/dist/client/assets/index-C7tZKQ5s.js +0 -1
  402. package/dist/client/assets/index-CklK0EA_.js +0 -1
  403. package/dist/client/assets/index-D5CXQ9x9.js +0 -1
  404. package/dist/client/assets/index-Og5m3t85.js +0 -26
  405. package/dist/client/assets/index-Y6pd1REu.js +0 -1
  406. package/dist/client/assets/infra-billing-ChvPe0pr.js +0 -1
  407. package/dist/client/assets/invite-member-dialog-CeSVAfZq.js +0 -1
  408. package/dist/client/assets/layout-BIIr_imR.js +0 -1
  409. package/dist/client/assets/legacy-agents-deep-CdZo4h4A.js +0 -1
  410. package/dist/client/assets/legacy-main-redirect-CWWHewM6.js +0 -1
  411. package/dist/client/assets/login-svGY2sKo.js +0 -1
  412. package/dist/client/assets/members-BOTXfNHf.js +0 -1
  413. package/dist/client/assets/org-layout-BiRvLqL-.js +0 -1
  414. package/dist/client/assets/orgs-CMf-H7HH.js +0 -1
  415. package/dist/client/assets/post-calendar-BAQtpQvh.js +0 -1
  416. package/dist/client/assets/post-editor-DBJMHXYe.js +0 -1
  417. package/dist/client/assets/preview-content-CICx8Frq.js +0 -1
  418. package/dist/client/assets/profile-CUkJFM3_.js +0 -1
  419. package/dist/client/assets/project-app-view-BSYHmGj3.js +0 -1
  420. package/dist/client/assets/project-feed-BEGVLizK.js +0 -1
  421. package/dist/client/assets/project-reports-BozhFElP.js +0 -1
  422. package/dist/client/assets/project-tasks-DVexwc9x.js +0 -1
  423. package/dist/client/assets/prompts-Df-P8Zuz.js +0 -1
  424. package/dist/client/assets/record-editor-9YdHcAWO.js +0 -1
  425. package/dist/client/assets/redirect-editor-BohyWJXT.js +0 -1
  426. package/dist/client/assets/registry-BbkHDIpk.js +0 -2
  427. package/dist/client/assets/reports-SeFGRJSZ.js +0 -1
  428. package/dist/client/assets/reports-tab-D5rlmWEp.js +0 -2
  429. package/dist/client/assets/repositories-BXEjUV3F.js +0 -1
  430. package/dist/client/assets/repository-import-picker-Bc_O4k0-.js +0 -1
  431. package/dist/client/assets/repository-picker-DC97O6OK.js +0 -1
  432. package/dist/client/assets/require-capability-CoB1D-Ih.js +0 -1
  433. package/dist/client/assets/retry-CErkP7V6.js +0 -1
  434. package/dist/client/assets/roles-DEMri9Kk.js +0 -1
  435. package/dist/client/assets/runnable-block-editor-BD-IThSC.js +0 -16
  436. package/dist/client/assets/secrets-7Z0pTBUq.js +0 -1
  437. package/dist/client/assets/sections-editor-DoMH-fks.js +0 -2
  438. package/dist/client/assets/select-C9ZnmbzX.js +0 -1
  439. package/dist/client/assets/select-model-FK_tmltz.js +0 -1
  440. package/dist/client/assets/seo-editor-DNovpojV.js +0 -1
  441. package/dist/client/assets/settings-layout-Cd8jASua.js +0 -1
  442. package/dist/client/assets/settings-sidebar-DP80M_GR.js +0 -1
  443. package/dist/client/assets/settings-tab-DE3XUo7h.js +0 -5
  444. package/dist/client/assets/shell-controls-CnE-Tn5l.js +0 -1
  445. package/dist/client/assets/shell-layout-DMp5UdGb.js +0 -1
  446. package/dist/client/assets/skill-preview-D2lK4hU9.js +0 -1
  447. package/dist/client/assets/skills-xXfBybxi.js +0 -1
  448. package/dist/client/assets/source-system-tabs-CnEGUb4r.js +0 -1
  449. package/dist/client/assets/sso-DdBxRFrm.js +0 -1
  450. package/dist/client/assets/store-registry-BFRxGHgD.js +0 -2
  451. package/dist/client/assets/switch-DADMizS1.js +0 -1
  452. package/dist/client/assets/synced-repos-Cp7R03Jp.js +0 -1
  453. package/dist/client/assets/task-route-_NgFGVoT.js +0 -1
  454. package/dist/client/assets/tasks-BvZdYZ5R.js +0 -1
  455. package/dist/client/assets/thread-sheet-body-S2AS0IdJ.js +0 -1
  456. package/dist/client/assets/toggle-group-CHZjV-1n.js +0 -1
  457. package/dist/client/assets/toolbar-DAhC4RMM.js +0 -1
  458. package/dist/client/assets/usage-stats-B38oXMbk.js +0 -1
  459. package/dist/client/assets/use-ai-providers-DYf552qv.js +0 -1
  460. package/dist/client/assets/use-automations-DSRSDlyo.js +0 -1
  461. package/dist/client/assets/use-commerce-diagnostic-pXwQBZmy.js +0 -1
  462. package/dist/client/assets/use-connect-companion-Bt171l5d.js +0 -1
  463. package/dist/client/assets/use-deco-credits-Coxc4dyp.js +0 -1
  464. package/dist/client/assets/use-decopilot-events-V4xtyk7c.js +0 -1
  465. package/dist/client/assets/use-delete-connection-geT4L5Ed.js +0 -1
  466. package/dist/client/assets/use-file-configs-BLWnBKpa.js +0 -1
  467. package/dist/client/assets/use-join-requests-DL4guRSR.js +0 -1
  468. package/dist/client/assets/use-main-panel-tabs-BtAksZ1f.js +0 -1
  469. package/dist/client/assets/use-mcp-auth-status-CpecQqEX.js +0 -1
  470. package/dist/client/assets/use-open-billing-url-DaC9_MxZ.js +0 -1
  471. package/dist/client/assets/use-org-auth-client-DuxSmx0x.js +0 -1
  472. package/dist/client/assets/use-org-notice-lWz1PPs-.js +0 -1
  473. package/dist/client/assets/use-organization-settings-C-LQvPpq.js +0 -1
  474. package/dist/client/assets/use-panel-navigate-D2RT2tc_.js +0 -1
  475. package/dist/client/assets/use-project-scope-Ch_4TfMQ.js +0 -1
  476. package/dist/client/assets/use-registry-connections-CuDWC28C.js +0 -1
  477. package/dist/client/assets/use-secrets-BJDccjnS.js +0 -1
  478. package/dist/client/assets/use-section-preview-base-SCqBiLMF.js +0 -1
  479. package/dist/client/assets/use-status-sounds-BG-lkYEo.js +0 -1
  480. package/dist/client/assets/use-tags-DhkHJc7C.js +0 -1
  481. package/dist/client/assets/use-task-metadata-COSUQhUk.js +0 -1
  482. package/dist/client/assets/use-view-mode-CUARubnx.js +0 -1
  483. package/dist/client/assets/use-virtual-mcp-BMRFgR9g.js +0 -1
  484. package/dist/client/assets/useInfiniteQuery-DOeboQGx.js +0 -1
  485. package/dist/client/assets/useSuspenseInfiniteQuery-B5UzTlHS.js +0 -1
  486. package/dist/client/assets/variant-calendar-f9XxiGiP.js +0 -1
  487. package/dist/client/assets/view-mode-toggle-D31fXZcw.js +0 -1
  488. /package/dist/client/assets/{index-DDGTF8rc.css → agent-site-editor-DDGTF8rc.css} +0 -0
@@ -1,4 +1,4 @@
1
- import{r as N,c as H,j as d,eY as G,eZ as K,o as Q,v as X,l as B,h as J}from"./index-gctAQu2T.js";import{D as ee,E as te,C as ne}from"./types-8hWP_tsZ.js";const z=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function oe(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${ie(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
1
+ import{r as N,c as D,j as d,eC as K,eD as Q,o as X,v as Y,l as B,h as J}from"./index-CVJEcf37.js";import{D as ee,E as te,C as ne}from"./types-CrAbOCy3.js";const z=["default-src 'none'","script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'","style-src 'unsafe-inline'","img-src * data: blob:","media-src * data: blob:","font-src data:","connect-src 'none'","frame-src 'none'","worker-src blob:","form-action 'none'","base-uri 'none'"].join("; ");function oe(o,e={}){const n=`<meta http-equiv="Content-Security-Policy" content="${ie(e)}">`,s=/<head(\s[^>]*)?>|<HEAD(\s[^>]*)?>/i,i=o.match(s);if(i){const l=(i.index??0)+i[0].length;return o.slice(0,l)+`
2
2
  `+n+o.slice(l)}const r=/<html(\s[^>]*)?>|<HTML(\s[^>]*)?>/i,a=o.match(r);if(a){const l=(a.index??0)+a[0].length;return o.slice(0,l)+`
3
3
  <head>
4
4
  `+n+`
@@ -8,4 +8,4 @@ import{r as N,c as H,j as d,eY as G,eZ as K,o as Q,v as X,l as B,h as J}from"./i
8
8
  </head>`+o.slice(l)}return`<head>
9
9
  `+n+`
10
10
  </head>
11
- `+o}const se=/^https?:\/\/(\*\.)?[a-zA-Z0-9._-]+(:\d+)?\/?$/;function j(o){return!o||o.length===0?[]:o.filter(e=>se.test(e))}function ie(o){if(o.csp)return o.csp;const e=o.resourceCsp;if(!e)return z;const t=j(e.resourceDomains),n=j(e.connectDomains),s=j(e.frameDomains),i=j(e.baseUriDomains),r=t.length>0,a=n.length>0,c=s.length>0,u=i.length>0;if(!r&&!a&&!c&&!u)return z;const l=t.join(" ");return["default-src 'none'",r?`script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' ${l}`:"script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",r?`style-src 'unsafe-inline' ${l}`:"style-src 'unsafe-inline'",r?`img-src * data: blob: ${l}`:"img-src * data: blob:",r?`media-src * data: blob: ${l}`:"media-src * data: blob:",r?`font-src data: ${l}`:"font-src data:",a?`connect-src ${n.join(" ")}`:"connect-src 'none'",c?`frame-src ${s.join(" ")}`:"frame-src 'none'","worker-src blob:","form-action 'none'",u?`base-uri ${i.join(" ")}`:"base-uri 'none'"].join("; ")}const re=[["--background","--color-background-primary"],["--muted","--color-background-secondary"],["--accent","--color-background-tertiary"],["--destructive","--color-background-danger"],["--success","--color-background-success"],["--warning","--color-background-warning"],["--foreground","--color-text-primary"],["--muted-foreground","--color-text-secondary"],["--accent-foreground","--color-text-tertiary"],["--destructive-foreground","--color-text-danger"],["--success-foreground","--color-text-success"],["--warning-foreground","--color-text-warning"],["--border","--color-border-primary"],["--input","--color-border-secondary"],["--ring","--color-ring-primary"],["--font-sans","--font-sans"],["--font-mono","--font-mono"],["--font-weight-normal","--font-weight-normal"],["--font-weight-medium","--font-weight-medium"],["--font-weight-semibold","--font-weight-semibold"],["--font-weight-bold","--font-weight-bold"],["--radius","--border-radius-md"],["--default-border-width","--border-width-regular"],["--shadow-sm","--shadow-sm"],["--shadow-md","--shadow-md"],["--shadow-lg","--shadow-lg"]];function ae(){if(typeof document>"u")return{};const o=getComputedStyle(document.documentElement),e={};for(const[t,n]of re){const s=o.getPropertyValue(t).trim();s&&(e[n]=s)}return{variables:e}}const le={name:"Studio",version:"1.0.0"},ce={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{},updateModelContext:{text:{}}},ue=15e3;function de(){return typeof navigator>"u"?"en":navigator.language??"en"}function he(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function fe(){return typeof navigator>"u"?"web":/Mobi|Android/i.test(navigator.userAgent)?"mobile":"web"}function q(o,e,t,n,s){return{theme:ne(),styles:ae(),displayMode:o,availableDisplayModes:["inline","fullscreen"],locale:s??de(),timeZone:he(),platform:fe(),...e!=null&&{toolInfo:e},...t!=null&&{containerDimensions:{maxHeight:t}},...n!=null&&{orgId:n}}}const F=new Set;let V=!1;function me(){if(V||typeof document>"u")return;V=!0;const o=()=>F.forEach(e=>e());new MutationObserver(o).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o)}function ge(o){return F.add(o),me(),()=>F.delete(o)}class pe{bridge=null;timeout=null;disposed=!1;unsubTheme=null;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const t=this.config;this.config=e,!(!this.bridge||this.disposed)&&((e.displayMode!==t.displayMode||e.locale!==t.locale)&&this.pushHostContext(),e.toolInput!==t.toolInput&&e.toolInput!=null&&this.bridge.sendToolInput({arguments:e.toolInput}),e.toolResult!==t.toolResult&&e.toolResult!=null&&this.bridge.sendToolResult(e.toolResult))}pushHostContext(){if(!this.bridge||this.disposed)return;const{displayMode:e,maxHeight:t,toolInfo:n,orgId:s,locale:i}=this.config;this.bridge.setHostContext(q(e,n,t,s,i))}set(e){const t=this.snapshot,n={...t,...e};if(!(n.height===t.height&&n.isLoading===t.isLoading&&n.error===t.error)){this.snapshot=Object.freeze(n);for(const s of this.listeners)s()}}teardown(){(this.bridge||this.timeout||this.unsubTheme)&&this.config.onTeardown?.(),this.disposed=!0,this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.teardownResource({}).catch(()=>{}),this.bridge.close(),this.bridge=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}attach=e=>{if(this.teardown(),this.disposed=!1,this.set({height:this.config.minHeight,isLoading:!0,error:null}),!e)return;e.onerror=()=>{this.disposed||this.set({error:"Failed to load app",isLoading:!1})};let t=!1;e.onload=()=>{if(!this.disposed){if(!t){t=!0;return}this.set({height:this.config.minHeight,isLoading:!0,error:null}),this.connectBridge(e)}},this.connectBridge(e)};connectBridge(e){this.clearTimeout(),this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.close(),this.bridge=null);try{const{client:t,displayMode:n,maxHeight:s,toolInfo:i,orgId:r,locale:a}=this.config,c=q(n,i,s,r,a),u=new ee(t,le,ce,{hostContext:c});this.bridge=u,this.registerHandlers(u),this.startInitTimeout(),this.registerInitHandler(u),this.connectTransport(u,e),this.unsubTheme=ge(()=>this.pushHostContext())}catch(t){this.clearTimeout(),console.error("Failed to create AppBridge:",t),this.set({error:t instanceof Error?t.message:"Unknown error",isLoading:!1})}}registerHandlers(e){e.onopenlink=async({url:t})=>{let n=null;try{n=new URL(t)}catch{}if(!n||!["http:","https:"].includes(n.protocol))throw new Error("Only http and https URLs are allowed");return window.open(t,"_blank","noopener,noreferrer"),{}},e.onmessage=async t=>(this.config.onMessage?.(t),{}),e.onupdatemodelcontext=async t=>(this.config.onUpdateModelContext?.(t),{}),e.onsizechange=({height:t})=>{if(!this.disposed&&t!=null){const{minHeight:n,maxHeight:s}=this.config;this.set({height:Math.max(n,Math.min(s,t))})}},e.onloggingmessage=({level:t,data:n})=>{console[t==="error"?"error":"debug"](`[MCP App ${this.config.toolInfo?.tool.name??"unknown"}]`,n)},e.onrequestdisplaymode=async({mode:t})=>({mode:this.config.onRequestDisplayMode?await this.config.onRequestDisplayMode(t):this.config.displayMode}),e.ondownloadfile=async({contents:t})=>{for(const n of t)if(n.type==="resource"){const s=n.resource,i="blob"in s?new Blob([Uint8Array.from(atob(s.blob),c=>c.charCodeAt(0))],{type:s.mimeType}):new Blob([s.text??""],{type:s.mimeType}),r=URL.createObjectURL(i),a=document.createElement("a");a.href=r,a.download=s.uri.split("/").pop()??"download",a.click(),URL.revokeObjectURL(r)}else n.type==="resource_link"&&window.open(n.uri,"_blank");return{}}}registerInitHandler(e){e.oninitialized=()=>{if(this.disposed)return;this.clearTimeout(),this.set({isLoading:!1});const{toolInput:t,toolResult:n}=this.config;t!=null&&e.sendToolInput({arguments:t}),n!=null&&e.sendToolResult(n)}}startInitTimeout(){this.timeout=setTimeout(()=>{this.disposed||this.set({error:"App took too long to load",isLoading:!1})},ue)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,t){if(!t.contentWindow){console.warn("iframe contentWindow not yet available");return}const n=new te(t.contentWindow,t.contentWindow);e.connect(n).catch(s=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",s),this.set({error:s instanceof Error?s.message:"Connection failed",isLoading:!1}))})}}function be(o){const e=N.useRef(new pe(o));N.useEffect(()=>{e.current.updateConfig(o)},[o]);const{height:t,isLoading:n,error:s}=N.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:t,isLoading:n,error:s,iframeRef:e.current.attach}}const Z=new Set;function we(o){const e=o?.contents?.[0];return!e||!("text"in e)||!e.text?null:oe(e.text,{resourceCsp:e._meta?.ui?.csp})}function W(o){const e=H.c(40),{html:t,uri:n,orgId:s,toolInfo:i,toolInput:r,toolResult:a,displayMode:c,minHeight:u,maxHeight:l,client:T,onMessage:L,onUpdateModelContext:S,onTeardown:D,onRequestDisplayMode:P,className:f}=o,h=c===void 0?"inline":c,k=u===void 0?150:u,A=l===void 0?600:l;n&&!Z.has(n)&&(Z.add(n),Q("mcp_app_opened",{resource_uri:n,display_mode:h,tool_name:i?.tool?.name??null}));const[E]=X();let v;e[0]!==T||e[1]!==h||e[2]!==A||e[3]!==k||e[4]!==L||e[5]!==P||e[6]!==D||e[7]!==S||e[8]!==s||e[9]!==E.language||e[10]!==i||e[11]!==r||e[12]!==a?(v={client:T,displayMode:h,minHeight:k,maxHeight:A,orgId:s,locale:E.language,toolInfo:i,toolInput:r,toolResult:a,onMessage:L,onUpdateModelContext:S,onTeardown:D,onRequestDisplayMode:P},e[0]=T,e[1]=h,e[2]=A,e[3]=k,e[4]=L,e[5]=P,e[6]=D,e[7]=S,e[8]=s,e[9]=E.language,e[10]=i,e[11]=r,e[12]=a,e[13]=v):v=e[13];const{height:_,isLoading:M,error:R,iframeRef:U}=be(v);if(!t)return null;if(R){let y;e[14]!==f?(y=B("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",f),e[14]=f,e[15]=y):y=e[15];let x;e[16]!==R?(x=d.jsx("span",{className:"text-sm",children:R}),e[16]=R,e[17]=x):x=e[17];let I;return e[18]!==y||e[19]!==x?(I=d.jsx("div",{className:y,children:x}),e[18]=y,e[19]=x,e[20]=I):I=e[20],I}const Y=i?.tool.name;let m;e[21]!==f?(m=B("relative w-full overflow-hidden rounded-lg",f),e[21]=f,e[22]=m):m=e[22];let g;e[23]!==h||e[24]!==_?(g=h!=="fullscreen"?{height:`${_}px`}:void 0,e[23]=h,e[24]=_,e[25]=g):g=e[25];let p;e[26]!==M?(p=M&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx(J,{className:"size-4"}),d.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[26]=M,e[27]=p):p=e[27];const $=M&&"invisible";let b;e[28]!==$?(b=B("w-full h-full border-0",$),e[28]=$,e[29]=b):b=e[29];const O=`MCP App: ${Y??n}`;let w;e[30]!==t||e[31]!==U||e[32]!==O||e[33]!==b?(w=d.jsx("iframe",{ref:U,srcDoc:t,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads",className:b,title:O}),e[30]=t,e[31]=U,e[32]=O,e[33]=b,e[34]=w):w=e[34];let C;return e[35]!==w||e[36]!==m||e[37]!==g||e[38]!==p?(C=d.jsxs("div",{className:m,style:g,children:[p,w]}),e[35]=w,e[36]=m,e[37]=g,e[38]=p,e[39]=C):C=e[39],C}function ye(o){const e=H.c(13);let t,n,s,i;e[0]!==o?({resourceURI:i,orgSlug:s,connectionId:t,...n}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=s,e[4]=i):(t=e[1],n=e[2],s=e[3],i=e[4]);let r;e[5]!==t||e[6]!==s||e[7]!==i?(r={orgSlug:s,connectionId:t,uri:i,staleTime:3e4},e[5]=t,e[6]=s,e[7]=i,e[8]=r):r=e[8];const a=G(r);let c;return e[9]!==n||e[10]!==a.data||e[11]!==i?(c=d.jsx(W,{html:a.data,uri:i,...n}),e[9]=n,e[10]=a.data,e[11]=i,e[12]=c):c=e[12],c}function xe(o){const e=H.c(10);let t,n;e[0]!==o?({resourceURI:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let s;e[3]!==t.client||e[4]!==n?(s={client:t.client,uri:n,staleTime:3e4},e[3]=t.client,e[4]=n,e[5]=s):s=e[5];const{data:i}=K(s),r=we(i);let a;return e[6]!==t||e[7]!==r||e[8]!==n?(a=d.jsx(W,{html:r,uri:n,...t}),e[6]=t,e[7]=r,e[8]=n,e[9]=a):a=e[9],a}function Me(o){const e=H.c(4);if(o.orgSlug&&o.connectionId){let n;return e[0]!==o?(n=d.jsx(ye,{...o,orgSlug:o.orgSlug,connectionId:o.connectionId}),e[0]=o,e[1]=n):n=e[1],n}let t;return e[2]!==o?(t=d.jsx(xe,{...o}),e[2]=o,e[3]=t):t=e[3],t}export{Me as M};
11
+ `+o}const se=/^https?:\/\/(\*\.)?[a-zA-Z0-9._-]+(:\d+)?\/?$/;function j(o){return!o||o.length===0?[]:o.filter(e=>se.test(e))}function ie(o){if(o.csp)return o.csp;const e=o.resourceCsp;if(!e)return z;const t=j(e.resourceDomains),n=j(e.connectDomains),s=j(e.frameDomains),i=j(e.baseUriDomains),r=t.length>0,a=n.length>0,c=s.length>0,u=i.length>0;if(!r&&!a&&!c&&!u)return z;const l=t.join(" ");return["default-src 'none'",r?`script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' ${l}`:"script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",r?`style-src 'unsafe-inline' ${l}`:"style-src 'unsafe-inline'",r?`img-src * data: blob: ${l}`:"img-src * data: blob:",r?`media-src * data: blob: ${l}`:"media-src * data: blob:",r?`font-src data: ${l}`:"font-src data:",a?`connect-src ${n.join(" ")}`:"connect-src 'none'",c?`frame-src ${s.join(" ")}`:"frame-src 'none'","worker-src blob:","form-action 'none'",u?`base-uri ${i.join(" ")}`:"base-uri 'none'"].join("; ")}const re=[["--background","--color-background-primary"],["--muted","--color-background-secondary"],["--accent","--color-background-tertiary"],["--destructive","--color-background-danger"],["--success","--color-background-success"],["--warning","--color-background-warning"],["--foreground","--color-text-primary"],["--muted-foreground","--color-text-secondary"],["--accent-foreground","--color-text-tertiary"],["--destructive-foreground","--color-text-danger"],["--success-foreground","--color-text-success"],["--warning-foreground","--color-text-warning"],["--border","--color-border-primary"],["--input","--color-border-secondary"],["--ring","--color-ring-primary"],["--font-sans","--font-sans"],["--font-mono","--font-mono"],["--font-weight-normal","--font-weight-normal"],["--font-weight-medium","--font-weight-medium"],["--font-weight-semibold","--font-weight-semibold"],["--font-weight-bold","--font-weight-bold"],["--radius","--border-radius-md"],["--default-border-width","--border-width-regular"],["--shadow-sm","--shadow-sm"],["--shadow-md","--shadow-md"],["--shadow-lg","--shadow-lg"]];function ae(){if(typeof document>"u")return{};const o=getComputedStyle(document.documentElement),e={};for(const[t,n]of re){const s=o.getPropertyValue(t).trim();s&&(e[n]=s)}return{variables:e}}const le={name:"Studio",version:"1.0.0"},ce={openLinks:{},serverTools:{},serverResources:{},logging:{},message:{},downloadFile:{},updateModelContext:{text:{}}},ue=15e3;function de(){return typeof navigator>"u"?"en":navigator.language??"en"}function he(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}}function fe(){return typeof navigator>"u"?"web":/Mobi|Android/i.test(navigator.userAgent)?"mobile":"web"}function q(o,e,t,n,s){return{theme:ne(),styles:ae(),displayMode:o,availableDisplayModes:["inline","fullscreen"],locale:s??de(),timeZone:he(),platform:fe(),...e!=null&&{toolInfo:e},...t!=null&&{containerDimensions:{maxHeight:t}},...n!=null&&{orgId:n}}}const F=new Set;let V=!1;function me(){if(V||typeof document>"u")return;V=!0;const o=()=>F.forEach(e=>e());new MutationObserver(o).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o)}function ge(o){return F.add(o),me(),()=>F.delete(o)}class pe{bridge=null;timeout=null;disposed=!1;unsubTheme=null;snapshot;listeners=new Set;config;constructor(e){this.config=e,this.snapshot=Object.freeze({height:e.minHeight,isLoading:!0,error:null})}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;updateConfig(e){const t=this.config;this.config=e,!(!this.bridge||this.disposed)&&((e.displayMode!==t.displayMode||e.locale!==t.locale)&&this.pushHostContext(),e.toolInput!==t.toolInput&&e.toolInput!=null&&this.bridge.sendToolInput({arguments:e.toolInput}),e.toolResult!==t.toolResult&&e.toolResult!=null&&this.bridge.sendToolResult(e.toolResult))}pushHostContext(){if(!this.bridge||this.disposed)return;const{displayMode:e,maxHeight:t,toolInfo:n,orgId:s,locale:i}=this.config;this.bridge.setHostContext(q(e,n,t,s,i))}set(e){const t=this.snapshot,n={...t,...e};if(!(n.height===t.height&&n.isLoading===t.isLoading&&n.error===t.error)){this.snapshot=Object.freeze(n);for(const s of this.listeners)s()}}teardown(){(this.bridge||this.timeout||this.unsubTheme)&&this.config.onTeardown?.(),this.disposed=!0,this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.teardownResource({}).catch(()=>{}),this.bridge.close(),this.bridge=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}attach=e=>{if(this.teardown(),this.disposed=!1,this.set({height:this.config.minHeight,isLoading:!0,error:null}),!e)return;e.onerror=()=>{this.disposed||this.set({error:"Failed to load app",isLoading:!1})};let t=!1;e.onload=()=>{if(!this.disposed){if(!t){t=!0;return}this.set({height:this.config.minHeight,isLoading:!0,error:null}),this.connectBridge(e)}},this.connectBridge(e)};connectBridge(e){this.clearTimeout(),this.unsubTheme?.(),this.unsubTheme=null,this.bridge&&(this.bridge.close(),this.bridge=null);try{const{client:t,displayMode:n,maxHeight:s,toolInfo:i,orgId:r,locale:a}=this.config,c=q(n,i,s,r,a),u=new ee(t,le,ce,{hostContext:c});this.bridge=u,this.registerHandlers(u),this.startInitTimeout(),this.registerInitHandler(u),this.connectTransport(u,e),this.unsubTheme=ge(()=>this.pushHostContext())}catch(t){this.clearTimeout(),console.error("Failed to create AppBridge:",t),this.set({error:t instanceof Error?t.message:"Unknown error",isLoading:!1})}}registerHandlers(e){e.onopenlink=async({url:t})=>{let n=null;try{n=new URL(t)}catch{}if(!n||!["http:","https:"].includes(n.protocol))throw new Error("Only http and https URLs are allowed");return window.open(t,"_blank","noopener,noreferrer"),{}},e.onmessage=async t=>(this.config.onMessage?.(t),{}),e.onupdatemodelcontext=async t=>(this.config.onUpdateModelContext?.(t),{}),e.onsizechange=({height:t})=>{if(!this.disposed&&t!=null){const{minHeight:n,maxHeight:s}=this.config;this.set({height:Math.max(n,Math.min(s,t))})}},e.onloggingmessage=({level:t,data:n})=>{console[t==="error"?"error":"debug"](`[MCP App ${this.config.toolInfo?.tool.name??"unknown"}]`,n)},e.onrequestdisplaymode=async({mode:t})=>({mode:this.config.onRequestDisplayMode?await this.config.onRequestDisplayMode(t):this.config.displayMode}),e.ondownloadfile=async({contents:t})=>{for(const n of t)if(n.type==="resource"){const s=n.resource,i="blob"in s?new Blob([Uint8Array.from(atob(s.blob),c=>c.charCodeAt(0))],{type:s.mimeType}):new Blob([s.text??""],{type:s.mimeType}),r=URL.createObjectURL(i),a=document.createElement("a");a.href=r,a.download=s.uri.split("/").pop()??"download",a.click(),URL.revokeObjectURL(r)}else n.type==="resource_link"&&window.open(n.uri,"_blank");return{}}}registerInitHandler(e){e.oninitialized=()=>{if(this.disposed)return;this.clearTimeout(),this.set({isLoading:!1});const{toolInput:t,toolResult:n}=this.config;t!=null&&e.sendToolInput({arguments:t}),n!=null&&e.sendToolResult(n)}}startInitTimeout(){this.timeout=setTimeout(()=>{this.disposed||this.set({error:"App took too long to load",isLoading:!1})},ue)}clearTimeout(){this.timeout&&(globalThis.clearTimeout(this.timeout),this.timeout=null)}connectTransport(e,t){if(!t.contentWindow){console.warn("iframe contentWindow not yet available");return}const n=new te(t.contentWindow,t.contentWindow);e.connect(n).catch(s=>{this.disposed||(this.clearTimeout(),console.error("AppBridge connect failed:",s),this.set({error:s instanceof Error?s.message:"Connection failed",isLoading:!1}))})}}function be(o){const e=N.useRef(new pe(o));N.useEffect(()=>{e.current.updateConfig(o)},[o]);const{height:t,isLoading:n,error:s}=N.useSyncExternalStore(e.current.subscribe,e.current.getSnapshot);return{height:t,isLoading:n,error:s,iframeRef:e.current.attach}}const W=new Set;function we(o){const e=o?.contents?.[0];return!e||!("text"in e)||!e.text?null:oe(e.text,{resourceCsp:e._meta?.ui?.csp})}function Z(o){const e=D.c(40),{html:t,uri:n,orgId:s,toolInfo:i,toolInput:r,toolResult:a,displayMode:c,minHeight:u,maxHeight:l,client:T,onMessage:H,onUpdateModelContext:L,onTeardown:S,onRequestDisplayMode:P,className:f}=o,h=c===void 0?"inline":c,k=u===void 0?150:u,A=l===void 0?600:l;n&&!W.has(n)&&(W.add(n),X("mcp_app_opened",{resource_uri:n,display_mode:h,tool_name:i?.tool?.name??null}));const[E]=Y();let v;e[0]!==T||e[1]!==h||e[2]!==A||e[3]!==k||e[4]!==H||e[5]!==P||e[6]!==S||e[7]!==L||e[8]!==s||e[9]!==E.language||e[10]!==i||e[11]!==r||e[12]!==a?(v={client:T,displayMode:h,minHeight:k,maxHeight:A,orgId:s,locale:E.language,toolInfo:i,toolInput:r,toolResult:a,onMessage:H,onUpdateModelContext:L,onTeardown:S,onRequestDisplayMode:P},e[0]=T,e[1]=h,e[2]=A,e[3]=k,e[4]=H,e[5]=P,e[6]=S,e[7]=L,e[8]=s,e[9]=E.language,e[10]=i,e[11]=r,e[12]=a,e[13]=v):v=e[13];const{height:_,isLoading:M,error:R,iframeRef:U}=be(v);if(!t)return null;if(R){let y;e[14]!==f?(y=B("flex items-center justify-center p-4 text-destructive bg-destructive/10 rounded-lg",f),e[14]=f,e[15]=y):y=e[15];let x;e[16]!==R?(x=d.jsx("span",{className:"text-sm",children:R}),e[16]=R,e[17]=x):x=e[17];let I;return e[18]!==y||e[19]!==x?(I=d.jsx("div",{className:y,children:x}),e[18]=y,e[19]=x,e[20]=I):I=e[20],I}const G=i?.tool.name;let m;e[21]!==f?(m=B("relative w-full overflow-hidden rounded-lg",f),e[21]=f,e[22]=m):m=e[22];let g;e[23]!==h||e[24]!==_?(g=h!=="fullscreen"?{height:`${_}px`}:void 0,e[23]=h,e[24]=_,e[25]=g):g=e[25];let p;e[26]!==M?(p=M&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:d.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[d.jsx(J,{className:"size-4"}),d.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),e[26]=M,e[27]=p):p=e[27];const $=M&&"invisible";let b;e[28]!==$?(b=B("w-full h-full border-0",$),e[28]=$,e[29]=b):b=e[29];const O=`MCP App: ${G??n}`;let w;e[30]!==t||e[31]!==U||e[32]!==O||e[33]!==b?(w=d.jsx("iframe",{ref:U,srcDoc:t,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads",className:b,title:O}),e[30]=t,e[31]=U,e[32]=O,e[33]=b,e[34]=w):w=e[34];let C;return e[35]!==w||e[36]!==m||e[37]!==g||e[38]!==p?(C=d.jsxs("div",{className:m,style:g,children:[p,w]}),e[35]=w,e[36]=m,e[37]=g,e[38]=p,e[39]=C):C=e[39],C}function ye(o){const e=D.c(13);let t,n,s,i;e[0]!==o?({resourceURI:i,orgSlug:s,connectionId:t,...n}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=s,e[4]=i):(t=e[1],n=e[2],s=e[3],i=e[4]);let r;e[5]!==t||e[6]!==s||e[7]!==i?(r={orgSlug:s,connectionId:t,uri:i,staleTime:3e4},e[5]=t,e[6]=s,e[7]=i,e[8]=r):r=e[8];const a=K(r);let c;return e[9]!==n||e[10]!==a.data||e[11]!==i?(c=d.jsx(Z,{html:a.data,uri:i,...n}),e[9]=n,e[10]=a.data,e[11]=i,e[12]=c):c=e[12],c}function xe(o){const e=D.c(10);let t,n;e[0]!==o?({resourceURI:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let s;e[3]!==t.client||e[4]!==n?(s={client:t.client,uri:n,staleTime:3e4},e[3]=t.client,e[4]=n,e[5]=s):s=e[5];const{data:i}=Q(s),r=we(i);let a;return e[6]!==t||e[7]!==r||e[8]!==n?(a=d.jsx(Z,{html:r,uri:n,...t}),e[6]=t,e[7]=r,e[8]=n,e[9]=a):a=e[9],a}function Me(o){const e=D.c(4);if(o.orgSlug&&o.connectionId){let n;return e[0]!==o?(n=d.jsx(ye,{...o,orgSlug:o.orgSlug,connectionId:o.connectionId}),e[0]=o,e[1]=n):n=e[1],n}let t;return e[2]!==o?(t=d.jsx(xe,{...o}),e[2]=o,e[3]=t):t=e[3],t}export{Me as M};
@@ -1 +1 @@
1
- import{d as D,a as H,e as z,b as J}from"./auth-vfqjjrgv.js";import{b7 as L}from"./index-gctAQu2T.js";function K(){return window.location.origin}function R(){try{const e=window.location.hostname;return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}const P="mcp:oauth:callback:";let O=null;const W=1e3,j=10*6e4,C=15e3;class F{_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(t){this._redirectUrl=t.callbackUrl??O?.redirectUrl??`${K()}/oauth/callback`,this._windowMode=t.windowMode??"popup";const n=t.scope?Array.isArray(t.scope)?t.scope.join(" "):t.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:t.clientName??"@decocms/studio MCP client",...n&&{scope:n}}}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(t){this._clientInfo=t}tokens(){return this._tokens??void 0}saveTokens(t){this._tokens=t}redirectToAuthorization(t){if(this._windowMode==="tab"){if(!window.open(t.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(t.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(t.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(t){this._codeVerifier=t}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}}async function B(e){const t=L(e,window.location.origin),n=e.orgSlug?`/api/${encodeURIComponent(e.orgSlug)}/mcp/${e.connectionId}`:`/mcp/${e.connectionId}`,i=new URL(n,t),s=new F({serverUrl:i.href,clientName:e.clientName,clientUri:e.clientUri,callbackUrl:e.callbackUrl,scope:e.scope,windowMode:e.windowMode}),o={fn:null};try{const r=new Promise((u,d)=>{const y=e.timeout||j;let m,p,b,f=!1;const $=s.state(),S=`${P}${$}`,h=()=>{window.removeEventListener("message",E),window.removeEventListener("storage",U),clearTimeout(m),clearInterval(p),clearInterval(b);try{localStorage.removeItem(S)}catch{}};o.fn=c=>{f||(f=!0,h(),d(c))};const A=async c=>{if(f)return;if(f=!0,!c.success){h(),d(new Error(c.error||"OAuth authentication failed"));return}const{code:k,state:V}=c;if(!k){h(),d(new Error("Missing authorization code"));return}if(s.getStoredState()!==V){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const M=(await D(i))?.authorization_servers?.[0]||i,I=await H(M),g=s.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const N=s.codeVerifier(),x=await z(M,{metadata:I,clientInformation:g,authorizationCode:k,codeVerifier:N,redirectUri:s.redirectUrl,resource:new URL(i)});h(),u({tokens:x,clientId:g.client_id??null,clientSecret:g.client_secret??null,tokenEndpoint:I?.token_endpoint??null,userinfoEndpoint:I?.userinfo_endpoint??null})}catch(v){h(),d(v)}},E=async c=>{!R()&&c.origin!==window.location.origin||c.data?.type==="mcp:oauth:callback"&&await A(c.data)},U=async c=>{if(!(c.key!==S||!c.newValue))try{const k=JSON.parse(c.newValue);await A(k)}catch{}};window.addEventListener("message",E),window.addEventListener("storage",U),b=setInterval(()=>{if(f)return;let c=null;try{c=localStorage.getItem(S)}catch{return}if(c)try{A(JSON.parse(c))}catch{}},W),m=setTimeout(()=>{f||(f=!0,h(),d(new Error("OAuth authentication timeout")))},y)});if(r.catch(()=>{}),await J(s,{serverUrl:i})==="REDIRECT"){const u=await r;return{token:u.tokens.access_token,tokenInfo:{accessToken:u.tokens.access_token,refreshToken:u.tokens.refresh_token??null,expiresIn:u.tokens.expires_in??null,scope:u.tokens.scope??null,clientId:u.clientId,clientSecret:u.clientSecret,tokenEndpoint:u.tokenEndpoint,userinfoEndpoint:u.userinfoEndpoint,idToken:u.tokens.id_token??null},error:null}}const l=s.tokens(),w=s.clientInformation();return{token:l?.access_token||null,tokenInfo:l?{accessToken:l.access_token,refreshToken:l.refresh_token??null,expiresIn:l.expires_in??null,scope:l.scope??null,clientId:w?.client_id??null,clientSecret:w?.client_secret??null,tokenEndpoint:null,userinfoEndpoint:null,idToken:l.id_token??null}:null,error:null}}catch(r){return o.fn&&o.fn(r instanceof Error?r:new Error(String(r))),{token:null,tokenInfo:null,error:r instanceof Error?r.message:String(r)}}}function T(e,t){if(window.opener&&!window.opener.closed){const n=R()?"*":window.location.origin;return window.opener.postMessage(e,n),!0}if(t)try{const n=`${P}${t}`;return localStorage.setItem(n,JSON.stringify(e)),!0}catch{}return!1}async function ee(){const e=new URLSearchParams(window.location.search),t=e.get("code");let n=e.get("state");const i=e.get("error"),s=e.get("error_description");let o=n;if(n)try{const a=atob(n),l=JSON.parse(a);l.clientState&&(o=l.clientState)}catch{}if(i){const a=s||i;return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}if(!t||!n){const a="Missing code or state parameter";return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}return n=o||n,T({type:"mcp:oauth:callback",success:!0,code:t,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function G(e){try{const t=_(),n=t?new URL(e,t):new URL(e),i=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return i?i[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function Y(e){try{const t=_();return(t?new URL(e,t):new URL(e)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function X(e,t,n){try{const i=`/api/${encodeURIComponent(t)}/connections/${e}/oauth-token/status`,s=n?new URL(i,n).href:i,o=_(),r=!n||new URL(n).origin===o,a=await fetch(s,{credentials:r?"include":"omit"});return a.ok?{hasToken:(await a.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function te({url:e,token:t,orgId:n,studioUrl:i,meshUrl:s}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const r=await fetch(e,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/studio MCP client",version:"1.0.0"}}}),signal:AbortSignal.timeout(C)}),a=G(e),l=Y(e),w=_(),u=L({studioUrl:i,meshUrl:s},w?new URL(e,w).origin:new URL(e).origin);if(r.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(a&&l?await X(a,l,u):{hasToken:!1}).hasToken};let d;try{const p=await r.json();d=p.error||p.message}catch{}return r.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:d||`HTTP ${r.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!r.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:d||`HTTP ${r.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o instanceof Error&&o.name==="TimeoutError"?`Connection check timed out after ${C/1e3}s`:o.message}}}export{B as a,ee as h,te as i};
1
+ import{d as D,a as H,e as z,b as J}from"./auth-Cyjh0UQp.js";import{aB as L}from"./index-CVJEcf37.js";function K(){return window.location.origin}function R(){try{const e=window.location.hostname;return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}const P="mcp:oauth:callback:";let O=null;const W=1e3,j=10*6e4,C=15e3;class F{_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(t){this._redirectUrl=t.callbackUrl??O?.redirectUrl??`${K()}/oauth/callback`,this._windowMode=t.windowMode??"popup";const n=t.scope?Array.isArray(t.scope)?t.scope.join(" "):t.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:t.clientName??"@decocms/studio MCP client",...n&&{scope:n}}}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(t){this._clientInfo=t}tokens(){return this._tokens??void 0}saveTokens(t){this._tokens=t}redirectToAuthorization(t){if(this._windowMode==="tab"){if(!window.open(t.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(t.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(t.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(t){this._codeVerifier=t}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}}async function Z(e){const t=L(e,window.location.origin),n=e.orgSlug?`/api/${encodeURIComponent(e.orgSlug)}/mcp/${e.connectionId}`:`/mcp/${e.connectionId}`,i=new URL(n,t),s=new F({serverUrl:i.href,clientName:e.clientName,clientUri:e.clientUri,callbackUrl:e.callbackUrl,scope:e.scope,windowMode:e.windowMode}),o={fn:null};try{const r=new Promise((u,d)=>{const y=e.timeout||j;let m,p,E,f=!1;const $=s.state(),S=`${P}${$}`,h=()=>{window.removeEventListener("message",b),window.removeEventListener("storage",U),clearTimeout(m),clearInterval(p),clearInterval(E);try{localStorage.removeItem(S)}catch{}};o.fn=c=>{f||(f=!0,h(),d(c))};const A=async c=>{if(f)return;if(f=!0,!c.success){h(),d(new Error(c.error||"OAuth authentication failed"));return}const{code:k,state:V}=c;if(!k){h(),d(new Error("Missing authorization code"));return}if(s.getStoredState()!==V){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const M=(await D(i))?.authorization_servers?.[0]||i,I=await H(M),g=s.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const N=s.codeVerifier(),x=await z(M,{metadata:I,clientInformation:g,authorizationCode:k,codeVerifier:N,redirectUri:s.redirectUrl,resource:new URL(i)});h(),u({tokens:x,clientId:g.client_id??null,clientSecret:g.client_secret??null,tokenEndpoint:I?.token_endpoint??null,userinfoEndpoint:I?.userinfo_endpoint??null})}catch(v){h(),d(v)}},b=async c=>{!R()&&c.origin!==window.location.origin||c.data?.type==="mcp:oauth:callback"&&await A(c.data)},U=async c=>{if(!(c.key!==S||!c.newValue))try{const k=JSON.parse(c.newValue);await A(k)}catch{}};window.addEventListener("message",b),window.addEventListener("storage",U),E=setInterval(()=>{if(f)return;let c=null;try{c=localStorage.getItem(S)}catch{return}if(c)try{A(JSON.parse(c))}catch{}},W),m=setTimeout(()=>{f||(f=!0,h(),d(new Error("OAuth authentication timeout")))},y)});if(r.catch(()=>{}),await J(s,{serverUrl:i})==="REDIRECT"){const u=await r;return{token:u.tokens.access_token,tokenInfo:{accessToken:u.tokens.access_token,refreshToken:u.tokens.refresh_token??null,expiresIn:u.tokens.expires_in??null,scope:u.tokens.scope??null,clientId:u.clientId,clientSecret:u.clientSecret,tokenEndpoint:u.tokenEndpoint,userinfoEndpoint:u.userinfoEndpoint,idToken:u.tokens.id_token??null},error:null}}const l=s.tokens(),w=s.clientInformation();return{token:l?.access_token||null,tokenInfo:l?{accessToken:l.access_token,refreshToken:l.refresh_token??null,expiresIn:l.expires_in??null,scope:l.scope??null,clientId:w?.client_id??null,clientSecret:w?.client_secret??null,tokenEndpoint:null,userinfoEndpoint:null,idToken:l.id_token??null}:null,error:null}}catch(r){return o.fn&&o.fn(r instanceof Error?r:new Error(String(r))),{token:null,tokenInfo:null,error:r instanceof Error?r.message:String(r)}}}function T(e,t){if(window.opener&&!window.opener.closed){const n=R()?"*":window.location.origin;return window.opener.postMessage(e,n),!0}if(t)try{const n=`${P}${t}`;return localStorage.setItem(n,JSON.stringify(e)),!0}catch{}return!1}async function ee(){const e=new URLSearchParams(window.location.search),t=e.get("code");let n=e.get("state");const i=e.get("error"),s=e.get("error_description");let o=n;if(n)try{const a=atob(n),l=JSON.parse(a);l.clientState&&(o=l.clientState)}catch{}if(i){const a=s||i;return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}if(!t||!n){const a="Missing code or state parameter";return T({type:"mcp:oauth:callback",success:!1,error:a},o),{success:!1,error:a}}return n=o||n,T({type:"mcp:oauth:callback",success:!0,code:t,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function G(e){try{const t=_(),n=t?new URL(e,t):new URL(e),i=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return i?i[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function Y(e){try{const t=_();return(t?new URL(e,t):new URL(e)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function X(e,t,n){try{const i=`/api/${encodeURIComponent(t)}/connections/${e}/oauth-token/status`,s=n?new URL(i,n).href:i,o=_(),r=!n||new URL(n).origin===o,a=await fetch(s,{credentials:r?"include":"omit"});return a.ok?{hasToken:(await a.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function te({url:e,token:t,orgId:n,studioUrl:i,meshUrl:s}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const r=await fetch(e,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/studio MCP client",version:"1.0.0"}}}),signal:AbortSignal.timeout(C)}),a=G(e),l=Y(e),w=_(),u=L({studioUrl:i,meshUrl:s},w?new URL(e,w).origin:new URL(e).origin);if(r.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(a&&l?await X(a,l,u):{hasToken:!1}).hasToken};let d;try{const p=await r.json();d=p.error||p.message}catch{}return r.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:d||`HTTP ${r.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!r.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:d||`HTTP ${r.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o instanceof Error&&o.name==="TimeoutError"?`Connection check timed out after ${C/1e3}s`:o.message}}}export{Z as a,ee as h,te as i};
@@ -0,0 +1 @@
1
+ import{c as ue,b as xe,j as s,dQ as ns,B as rt,dP as rs,dO as as,M as It,_ as os,z as cs,n as Jt,e as xt,K as ct,t as ge,r as pe,l as at,h as Rt,fe as ms,du as At,o as nt}from"./index-CVJEcf37.js";import{C as ds}from"./collection-display-button-CkKXuKd-.js";import{S as us}from"./search-input-axkgbTZ7.js";import{C as fs}from"./collection-table-wrapper-B036tBOl.js";import{E as Nt}from"./empty-state-BjMIbq91.js";import{u as gs,a as ps,I as xs}from"./use-join-requests-CtMSd2H7.js";import{A as ot}from"./avatar-CO3n6wLC.js";import{f as hs}from"./format-time-BtXRrtv4.js";import{g as gt}from"./get-initials-D-f_fDFw.js";import{a as bs}from"./use-members-mw1URW2v.js";import{u as Ht}from"./use-org-auth-client-mMTl8cKp.js";import{u as js}from"./use-organization-roles-wnmrYWSM.js";import{g as vs,a as Cs}from"./role-color-Dn2tXDDF.js";import{T as Ss,a as Ns,b as ys,c as ws}from"./tooltip-B7VLfO9w.js";import{A as zt,a as Pt,b as kt,c as _t,g as Dt,d as Et,e as Ot,f as Lt}from"./alert-dialog-CDARhUOh.js";import{B as ht}from"./badge-DUpgRwQu.js";import{c as Wt,D as Yt,b as Zt,h as Ms,i as Is,j as Ts,a as Mt,g as Rs}from"./dropdown-menu-Bws_0K_q.js";import{i as Xt}from"./DotsVertical-zFAA_as9.js";import{i as As}from"./Key01-CQFO2R8H.js";import{i as zs}from"./Shield01-7bhnSYVs.js";import{b as Ps}from"./SwitchHorizontal01-CCmSX-Ww.js";import{s as ks}from"./Trash01-DkwdEhkp.js";import{s as es}from"./XClose-wkdnmhrB.js";import{a as $t,b as qt,c as Ft,d as Bt,S as Kt}from"./select-B2GRzoG3.js";import{C as Ut}from"./checkbox-STVvKX8k.js";import{a as yt,b as wt,g as Vt,C as _s,c as Ds,d as Es,e as Os}from"./command-D7YFT70c.js";import{b as Ls,P as $s,a as qs}from"./popover-DAJR0ej2.js";import{t as Fs}from"./ChevronUp-B9QGJbr0.js";import{s as Bs}from"./Plus-BUGmioCX.js";import{u as Ks,c as Us,a as Vs,d as Qs}from"./use-tags-BnnveSvi.js";import{R as Gs}from"./require-capability-DljrHpsM.js";import"./ArrowUp-DywwLYcR.js";import"./Check-PyGET9iL.js";import"./view-mode-toggle-B09x-ETl.js";import"./SearchMd-DanltqT5.js";import"./table-CrJ9LOSc.js";import"./dialog-Dxe0Jgna.js";import"./X-DejWyAyX.js";import"./form-CRSWplOb.js";import"./label-Cfl8uGDP.js";import"./textarea-BDMLJ5G-.js";import"./User01-C2ILPAHc.js";import"./differenceInSeconds-C3x8sHUj.js";import"./index-CFUteTrc.js";import"./ChevronRight-vY_5m8VB.js";import"./index-DsI9yqDT.js";import"./access-gate-DpZqBld0.js";import"./capability-load-error-Ctg9pY-k.js";function Js(){const t=ue.c(19),e=xe(),l=gs(),{approve:c,deny:r}=ps();if(l.length===0)return null;let n;t[0]!==e?(n=e("settings.joinRequestsSection.title"),t[0]=e,t[1]=n):n=t[1];let u;t[2]!==e?(u=e("settings.joinRequestsSection.description"),t[2]=e,t[3]=u):u=t[3];let m;if(t[4]!==c||t[5]!==r||t[6]!==l||t[7]!==e){let f;t[9]!==c||t[10]!==r||t[11]!==e?(f=o=>s.jsx(ns,{icon:s.jsx(ot,{url:o.user?.image??void 0,fallback:(o.user?.name??o.user?.email??"?").charAt(0).toUpperCase(),shape:"circle",size:"sm"}),title:o.user?.name??o.user?.email??o.userId,description:o.user?.email,action:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rt,{size:"sm",variant:"outline",onClick:()=>r.mutate(o.id),disabled:r.isPending||c.isPending,children:e("settings.joinRequestsSection.deny")}),s.jsx(rt,{size:"sm",onClick:()=>c.mutate(o.id),disabled:c.isPending||r.isPending,children:e("settings.joinRequestsSection.approve")})]})},o.id),t[9]=c,t[10]=r,t[11]=e,t[12]=f):f=t[12],m=l.map(f),t[4]=c,t[5]=r,t[6]=l,t[7]=e,t[8]=m}else m=t[8];let a;t[13]!==m?(a=s.jsx(rs,{children:m}),t[13]=m,t[14]=a):a=t[14];let p;return t[15]!==n||t[16]!==u||t[17]!==a?(p=s.jsx(as,{title:n,description:u,children:a}),t[15]=n,t[16]=u,t[17]=a,t[18]=p):p=t[18],p}function Hs(){const t=ue.c(7),{locator:e}=It(),l=os();let c;t[0]!==e?(c=ct.invitations(e),t[0]=e,t[1]=c):c=t[1];let r;t[2]!==l?(r=async()=>(await l.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=l,t[3]=r):r=t[3];let n;return t[4]!==c||t[5]!==r?(n={queryKey:c,queryFn:r},t[4]=c,t[5]=r,t[6]=n):n=t[6],cs(n)}function Ws(){const t=ue.c(10),{locator:e}=It(),l=Ht(),c=Jt();let r;t[0]!==l?(r=async p=>{const f=await l.organization.cancelInvitation({invitationId:p});if(f?.error)throw new Error(f.error.message);return f.data},t[0]=l,t[1]=r):r=t[1];let n;t[2]!==e||t[3]!==c?(n=()=>{c.invalidateQueries({queryKey:ct.invitations(e)}),ge.success("Invitation cancelled")},t[2]=e,t[3]=c,t[4]=n):n=t[4];let u;t[5]!==r||t[6]!==n?(u={mutationFn:r,onSuccess:n,onError:Ys},t[5]=r,t[6]=n,t[7]=u):u=t[7];const m=xt(u);let a;return t[8]!==m?(a={cancel:m},t[8]=m,t[9]=a):a=t[9],a}function Ys(t){ge.error(t instanceof Error?t.message:"Failed to cancel invitation")}function ts(t){const e=ue.c(51),{memberId:l,className:c,disabled:r,maxDisplay:n}=t,u=r===void 0?!1:r,m=n===void 0?2:n,a=xe(),[p,f]=pe.useState(!1),[o,j]=pe.useState(""),{data:E,isLoading:z}=Ks(),P=E===void 0?[]:E,{data:v,isLoading:B}=Us(l),x=v===void 0?[]:v,O=Vs(),I=Qs(),L=z||B,S=x.map(Xs);let T;e[0]!==o?(T=C=>C.name.toLowerCase().includes(o.toLowerCase()),e[0]=o,e[1]=T):T=e[1];const k=P.filter(T);let _;e[2]!==o?(_=C=>C.name.toLowerCase()===o.toLowerCase(),e[2]=o,e[3]=_):_=e[3];const R=P.find(_),w=o.trim()&&!R,M=async C=>{const de=S.includes(C.id)?S.filter(be=>be!==C.id):[...S,C.id];await I.mutateAsync({memberId:l,tagIds:de})},K=async()=>{if(!o.trim())return;const C=await O.mutateAsync(o.trim());await I.mutateAsync({memberId:l,tagIds:[...S,C.id]}),j("")},q=async C=>{const he=S.filter(de=>de!==C);await I.mutateAsync({memberId:l,tagIds:he})},N=O.isPending||I.isPending,h=$s;let y;e[4]!==p?(y=()=>f(!p),e[4]=p,e[5]=y):y=e[5];let g;e[6]!==c?(g=at("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",c),e[6]=c,e[7]=g):g=e[7];const b=u||L,$=L?s.jsx(Rt,{className:"size-3.5 text-muted-foreground"}):x.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[x.slice(0,m).map(Zs),x.length>m&&s.jsxs(ht,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",x.length-m]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:a("common.tagMultiSelect.addTags")});let F;e[8]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Fs,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=F):F=e[8];let D;e[9]!==$||e[10]!==y||e[11]!==g||e[12]!==b?(D=s.jsx(qs,{asChild:!0,children:s.jsxs(rt,{variant:"ghost",size:"sm",onClick:y,className:g,disabled:b,children:[$,F]})}),e[9]=$,e[10]=y,e[11]=g,e[12]=b,e[13]=D):D=e[13];const Q=Ls,H="w-56 p-0",U="start";let G;e[14]===Symbol.for("react.memo_cache_sentinel")?(G=()=>f(!1),e[14]=G):G=e[14];const J=Es,W=!1;let Y;e[15]!==a?(Y=a("common.tagMultiSelect.searchOrCreate"),e[15]=a,e[16]=Y):Y=e[16];let Z;e[17]!==o||e[18]!==Y?(Z=s.jsx(Os,{placeholder:Y,value:o,onValueChange:j,className:"h-9"}),e[17]=o,e[18]=Y,e[19]=Z):Z=e[19];const re=Ds,ae=x.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{heading:a("common.tagMultiSelect.selected"),children:x.map(C=>s.jsx(wt,{onSelect:()=>M(C),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ut,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:C.name})]}),s.jsx("button",{onClick:he=>{he.stopPropagation(),q(C.id)},className:"opacity-50 hover:opacity-100",disabled:N,children:s.jsx(es,{size:14})})]})},C.id))}),s.jsx(Vt,{})]}),oe=yt;let X;e[20]!==a?(X=a("common.tagMultiSelect.available"),e[20]=a,e[21]=X):X=e[21];const ce=k.length===0&&!w&&s.jsx(_s,{children:a("common.tagMultiSelect.noTagsFound")}),me=k.filter(C=>!S.includes(C.id)).map(C=>s.jsx(wt,{onSelect:()=>M(C),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ut,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:C.name})]})},C.id));let ee;e[22]!==oe||e[23]!==X||e[24]!==ce||e[25]!==me?(ee=s.jsxs(oe,{heading:X,children:[ce,me]}),e[22]=oe,e[23]=X,e[24]=ce,e[25]=me,e[26]=ee):ee=e[26];let te;e[27]!==K||e[28]!==N||e[29]!==o||e[30]!==w||e[31]!==a?(te=w&&s.jsxs(s.Fragment,{children:[s.jsx(Vt,{}),s.jsx(yt,{children:s.jsx(wt,{onSelect:K,className:"cursor-pointer",disabled:N,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[N?s.jsx(Rt,{className:"size-3.5"}):s.jsx(Bs,{size:14}),s.jsx("span",{children:a("common.tagMultiSelect.createTag",{tagName:o.trim()})})]})})})]}),e[27]=K,e[28]=N,e[29]=o,e[30]=w,e[31]=a,e[32]=te):te=e[32];let se;e[33]!==re||e[34]!==ae||e[35]!==ee||e[36]!==te?(se=s.jsxs(re,{children:[ae,ee,te]}),e[33]=re,e[34]=ae,e[35]=ee,e[36]=te,e[37]=se):se=e[37];let ie;e[38]!==J||e[39]!==Z||e[40]!==se?(ie=s.jsxs(J,{shouldFilter:W,children:[Z,se]}),e[38]=J,e[39]=Z,e[40]=se,e[41]=ie):ie=e[41];let le;e[42]!==Q||e[43]!==G||e[44]!==ie?(le=s.jsx(Q,{className:H,align:U,onEscapeKeyDown:G,children:ie}),e[42]=Q,e[43]=G,e[44]=ie,e[45]=le):le=e[45];let ne;return e[46]!==h||e[47]!==p||e[48]!==D||e[49]!==le?(ne=s.jsxs(h,{open:p,onOpenChange:f,children:[D,le]}),e[46]=h,e[47]=p,e[48]=D,e[49]=le,e[50]=ne):ne=e[50],ne}function Zs(t){return s.jsx(ht,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Xs(t){return t.id}const ei=["owner","admin","user"];function ti(t){const e=new Map;for(const l of ei)e.set(l,vs(l,!0));for(const l of t)l&&!e.has(l.role)&&e.set(l.role,Cs(l.role));return e}function pt(t){const e=ue.c(84),{role:l,memberId:c,isOwner:r,roleColorMap:n,selectableRoles:u,onRoleChange:m,size:a,className:p}=t,f=a===void 0?"xs":a,o=xe();let j,E,z,P,v,B,x,O,I,L,S;if(e[0]!==p||e[1]!==r||e[2]!==c||e[3]!==m||e[4]!==l||e[5]!==n||e[6]!==u||e[7]!==f||e[8]!==o){S=Symbol.for("react.early_return_sentinel");e:{const N=n.get(l)??"bg-muted-foreground";if(r){let h;e[20]!==c||e[21]!==m?(h=J=>m(c,J),e[20]=c,e[21]=m,e[22]=h):h=e[22];let y;e[23]!==l?(y=s.jsx("span",{className:"capitalize truncate",children:l}),e[23]=l,e[24]=y):y=e[24];const g=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:at("size-2 rounded-full shrink-0",N)}),y]});let b;e[25]!==g?(b=s.jsx($t,{children:g}),e[25]=g,e[26]=b):b=e[26];let $;e[27]!==p||e[28]!==f||e[29]!==b?($=s.jsx(qt,{size:f,className:p,children:b}),e[27]=p,e[28]=f,e[29]=b,e[30]=$):$=e[30];let F;if(e[31]!==n||e[32]!==u){let J;e[34]!==n?(J=W=>{const Y=n.get(W.role)??"bg-muted-foreground";return s.jsx(Ft,{value:W.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:at("size-3 rounded-full",Y)}),s.jsx("span",{className:"capitalize",children:W.label})]})},W.role)},e[34]=n,e[35]=J):J=e[35],F=u.map(J),e[31]=n,e[32]=u,e[33]=F}else F=e[33];let D;e[36]!==F?(D=s.jsx(Bt,{children:F}),e[36]=F,e[37]=D):D=e[37];let Q;e[38]!==r||e[39]!==l||e[40]!==h||e[41]!==$||e[42]!==D?(Q=s.jsx(Ss,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(Kt,{value:l,onValueChange:h,disabled:r,children:[$,D]})})}),e[38]=r,e[39]=l,e[40]=h,e[41]=$,e[42]=D,e[43]=Q):Q=e[43];let H;e[44]!==o?(H=o("orgs.members.ownerRoleCannotBeChanged"),e[44]=o,e[45]=H):H=e[45];let U;e[46]!==H?(U=s.jsx(Ns,{children:s.jsx("p",{children:H})}),e[46]=H,e[47]=U):U=e[47];let G;e[48]!==Q||e[49]!==U?(G=s.jsx(ys,{children:s.jsxs(ws,{children:[Q,U]})}),e[48]=Q,e[49]=U,e[50]=G):G=e[50],S=G;break e}z=Kt,O=l,e[51]!==c||e[52]!==m?(I=h=>m(c,h),e[51]=c,e[52]=m,e[53]=I):I=e[53],L=r,E=qt,B=f,x=p,j=$t,v="flex items-center gap-2 min-w-0",P=at("size-2 rounded-full shrink-0",N)}e[0]=p,e[1]=r,e[2]=c,e[3]=m,e[4]=l,e[5]=n,e[6]=u,e[7]=f,e[8]=o,e[9]=j,e[10]=E,e[11]=z,e[12]=P,e[13]=v,e[14]=B,e[15]=x,e[16]=O,e[17]=I,e[18]=L,e[19]=S}else j=e[9],E=e[10],z=e[11],P=e[12],v=e[13],B=e[14],x=e[15],O=e[16],I=e[17],L=e[18],S=e[19];if(S!==Symbol.for("react.early_return_sentinel"))return S;let T;e[54]!==P?(T=s.jsx("div",{className:P}),e[54]=P,e[55]=T):T=e[55];let k;e[56]!==l?(k=s.jsx("span",{className:"capitalize truncate",children:l}),e[56]=l,e[57]=k):k=e[57];let _;e[58]!==T||e[59]!==k||e[60]!==v?(_=s.jsxs("div",{className:v,children:[T,k]}),e[58]=T,e[59]=k,e[60]=v,e[61]=_):_=e[61];let R;e[62]!==j||e[63]!==_?(R=s.jsx(j,{children:_}),e[62]=j,e[63]=_,e[64]=R):R=e[64];let w;e[65]!==E||e[66]!==R||e[67]!==B||e[68]!==x?(w=s.jsx(E,{size:B,className:x,children:R}),e[65]=E,e[66]=R,e[67]=B,e[68]=x,e[69]=w):w=e[69];let M;if(e[70]!==n||e[71]!==u){let N;e[73]!==n?(N=h=>{const y=n.get(h.role)??"bg-muted-foreground";return s.jsx(Ft,{value:h.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:at("size-3 rounded-full",y)}),s.jsx("span",{className:"capitalize",children:h.label})]})},h.role)},e[73]=n,e[74]=N):N=e[74],M=u.map(N),e[70]=n,e[71]=u,e[72]=M}else M=e[72];let K;e[75]!==M?(K=s.jsx(Bt,{children:M}),e[75]=M,e[76]=K):K=e[76];let q;return e[77]!==z||e[78]!==w||e[79]!==K||e[80]!==O||e[81]!==I||e[82]!==L?(q=s.jsxs(z,{value:O,onValueChange:I,disabled:L,children:[w,K]}),e[77]=z,e[78]=w,e[79]=K,e[80]=O,e[81]=I,e[82]=L,e[83]=q):q=e[83],q}function Qt(t){const e=ue.c(59),{member:l,roles:c,onChangeRole:r,onRemove:n,isUpdating:u}=t,m=u===void 0?!1:u,a=xe(),p=l.role==="owner";let f,o,j,E,z,P,v,B,x;if(e[0]!==p||e[1]!==m||e[2]!==l.id||e[3]!==l.role||e[4]!==r||e[5]!==c||e[6]!==a){let M;e[16]!==l.role?(M=g=>g.role!==l.role&&g.role!=="owner",e[16]=l.role,e[17]=M):M=e[17];const K=c.filter(M);E=Wt;let q;e[18]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Xt,{size:20}),e[18]=q):q=e[18],e[19]!==p?(x=s.jsx(Yt,{asChild:!0,children:s.jsx(rt,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:p,onClick:ii,children:q})}),e[19]=p,e[20]=x):x=e[20],j=Zt,v="end",B=si,o=Ms;let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ps,{size:16}),e[21]=N):N=e[21];let h;e[22]!==a?(h=a("orgs.members.changeRole"),e[22]=a,e[23]=h):h=e[23],e[24]!==m||e[25]!==h?(P=s.jsxs(Is,{disabled:m,children:[N,h]}),e[24]=m,e[25]=h,e[26]=P):P=e[26],f=Ts;let y;e[27]!==m||e[28]!==l.id||e[29]!==r||e[30]!==a?(y=g=>{const b=[];return g.isBuiltin||(g.allowsAllStaticPermissions?b.push(a("orgs.members.fullOrgAccess")):g.staticPermissionCount&&g.staticPermissionCount>0&&b.push(a("orgs.members.orgPermsCount",{count:g.staticPermissionCount})),g.allowsAllConnections?b.push(a("orgs.members.allConnections")):g.connectionCount&&g.connectionCount>0&&b.push(a("orgs.members.connectionCount",{count:g.connectionCount})),(g.connectionCount!==0||g.allowsAllConnections)&&(g.allowsAllTools?b.push(a("orgs.members.allTools")):g.toolCount&&g.toolCount>0&&b.push(a("orgs.members.toolCount",{count:g.toolCount})))),s.jsxs(Mt,{onClick:$=>{$.stopPropagation(),r(l.id,g.role)},disabled:m,children:[g.isBuiltin?s.jsx(zs,{size:16}):s.jsx(As,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:g.label}),!g.isBuiltin&&b.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:b.join(", ")})]})]},g.role)},e[27]=m,e[28]=l.id,e[29]=r,e[30]=a,e[31]=y):y=e[31],z=K.map(y),e[0]=p,e[1]=m,e[2]=l.id,e[3]=l.role,e[4]=r,e[5]=c,e[6]=a,e[7]=f,e[8]=o,e[9]=j,e[10]=E,e[11]=z,e[12]=P,e[13]=v,e[14]=B,e[15]=x}else f=e[7],o=e[8],j=e[9],E=e[10],z=e[11],P=e[12],v=e[13],B=e[14],x=e[15];let O;e[32]!==f||e[33]!==z?(O=s.jsx(f,{children:z}),e[32]=f,e[33]=z,e[34]=O):O=e[34];let I;e[35]!==o||e[36]!==P||e[37]!==O?(I=s.jsxs(o,{children:[P,O]}),e[35]=o,e[36]=P,e[37]=O,e[38]=I):I=e[38];let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Rs,{}),e[39]=L):L=e[39];let S;e[40]!==l.id||e[41]!==n?(S=M=>{M.stopPropagation(),n(l.id)},e[40]=l.id,e[41]=n,e[42]=S):S=e[42];let T;e[43]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(ks,{size:16}),e[43]=T):T=e[43];let k;e[44]!==a?(k=a("orgs.members.removeMember"),e[44]=a,e[45]=k):k=e[45];let _;e[46]!==S||e[47]!==k?(_=s.jsxs(Mt,{variant:"destructive",onClick:S,children:[T,k]}),e[46]=S,e[47]=k,e[48]=_):_=e[48];let R;e[49]!==j||e[50]!==_||e[51]!==v||e[52]!==B||e[53]!==I?(R=s.jsxs(j,{align:v,onClick:B,children:[I,L,_]}),e[49]=j,e[50]=_,e[51]=v,e[52]=B,e[53]=I,e[54]=R):R=e[54];let w;return e[55]!==E||e[56]!==R||e[57]!==x?(w=s.jsxs(E,{children:[x,R]}),e[55]=E,e[56]=R,e[57]=x,e[58]=w):w=e[58],w}function si(t){return t.stopPropagation()}function ii(t){return t.stopPropagation()}function Gt(t){const e=ue.c(11),{invitationId:l,onCancel:c,isCancelling:r}=t,n=r===void 0?!1:r,u=xe();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Yt,{asChild:!0,children:s.jsx(rt,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ni,children:s.jsx(Xt,{size:20})})}),e[0]=m):m=e[0];let a;e[1]!==l||e[2]!==c?(a=j=>{j.stopPropagation(),c(l)},e[1]=l,e[2]=c,e[3]=a):a=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(es,{size:16}),e[4]=p):p=e[4];let f;e[5]!==u?(f=u("orgs.members.cancelInvitation"),e[5]=u,e[6]=f):f=e[6];let o;return e[7]!==n||e[8]!==a||e[9]!==f?(o=s.jsxs(Wt,{children:[m,s.jsx(Zt,{align:"end",onClick:li,children:s.jsxs(Mt,{variant:"destructive",onClick:a,disabled:n,children:[p,f]})})]}),e[7]=n,e[8]=a,e[9]=f,e[10]=o):o=e[10],o}function li(t){return t.stopPropagation()}function ni(t){return t.stopPropagation()}function ri(){const t=ue.c(198),e=xe(),{data:l}=bs(),{data:c}=Hs(),r=Ws(),n=Jt(),{locator:u}=It(),m=Ht(),[a,p]=pe.useState(null),[f,o]=pe.useState(null),[j,E]=pe.useState(""),[z,P]=pe.useState("table"),[v,B]=pe.useState("member"),[x,O]=pe.useState("asc"),I=l?.data?.members;let L;t[0]!==v?(L=i=>{v===i?O(ui):(B(i),O("asc"))},t[0]=v,t[1]=L):L=t[1];const S=L;let T=I??[],k=c??[];if(j){const i=j.toLowerCase();T=T.filter(d=>d.user?.name?.toLowerCase().includes(i)||d.user?.email?.toLowerCase().includes(i)||d.role?.toLowerCase().includes(i)),k=k.filter(d=>d.email?.toLowerCase().includes(i)||d.role?.toLowerCase().includes(i))}if(v&&x){let i;t[2]!==x||t[3]!==v?(i=(d,A)=>{let V,fe;e:switch(v){case"member":{V=d.user?.name||"",fe=A.user?.name||"";break e}case"role":{V=d.role||"",fe=A.role||"";break e}case"joined":{V=d.createdAt?typeof d.createdAt=="string"?d.createdAt:d.createdAt.toISOString():"",fe=A.createdAt?typeof A.createdAt=="string"?A.createdAt:A.createdAt.toISOString():"";break e}default:return 0}return x==="asc"?V.localeCompare(fe):fe.localeCompare(V)},t[2]=x,t[3]=v,t[4]=i):i=t[4],T=[...T].sort(i)}const _=T;let R;t[5]!==m?(R=async i=>{const d=await m.organization.removeMember({memberIdOrEmail:i});if(d?.error)throw new Error(d.error.message)},t[5]=m,t[6]=R):R=t[6];let w;t[7]!==u||t[8]!==n||t[9]!==e?(w=()=>{nt("member_removed"),n.invalidateQueries({queryKey:ct.members(u)}),ge.success(e("orgs.members.memberRemovedSuccess")),p(null)},t[7]=u,t[8]=n,t[9]=e,t[10]=w):w=t[10];let M;t[11]!==e?(M=i=>{nt("member_remove_failed",{error:i instanceof Error?i.message:String(i)}),ge.error(i instanceof Error?i.message:e("orgs.members.failedRemoveMember"))},t[11]=e,t[12]=M):M=t[12];let K;t[13]!==R||t[14]!==w||t[15]!==M?(K={mutationFn:R,onSuccess:w,onError:M},t[13]=R,t[14]=w,t[15]=M,t[16]=K):K=t[16];const q=xt(K);let N;t[17]!==m?(N=async i=>{const{memberId:d,role:A}=i,V=await m.organization.updateMemberRole({memberId:d,role:[A]});if(V?.error)throw new Error(V.error.message)},t[17]=m,t[18]=N):N=t[18];let h;t[19]!==u||t[20]!==n||t[21]!==e?(h=(i,d)=>{nt("member_role_updated",{new_role:d.role}),n.invalidateQueries({queryKey:ct.members(u)}),ge.success(e("orgs.members.roleUpdatedSuccess"))},t[19]=u,t[20]=n,t[21]=e,t[22]=h):h=t[22];let y;t[23]!==e?(y=(i,d)=>{nt("member_role_update_failed",{new_role:d.role,error:i instanceof Error?i.message:String(i)}),ge.error(i instanceof Error?i.message:e("orgs.members.failedUpdateRole"))},t[23]=e,t[24]=y):y=t[24];let g;t[25]!==N||t[26]!==h||t[27]!==y?(g={mutationFn:N,onSuccess:h,onError:y},t[25]=N,t[26]=h,t[27]=y,t[28]=g):g=t[28];const b=xt(g);let $;t[29]!==m?($=async i=>{const{invitationId:d,role:A,email:V}=i,fe=await m.organization.cancelInvitation({invitationId:d});if(fe?.error)throw new Error(fe.error.message);const Tt=await m.organization.inviteMember({email:V,role:A});if(Tt?.error)throw new Error(Tt.error.message)},t[29]=m,t[30]=$):$=t[30];let F;t[31]!==u||t[32]!==n||t[33]!==e?(F=(i,d)=>{nt("invitation_role_updated",{new_role:d.role}),n.invalidateQueries({queryKey:ct.invitations(u)}),ge.success(e("orgs.members.invitationRoleUpdatedSuccess"))},t[31]=u,t[32]=n,t[33]=e,t[34]=F):F=t[34];let D;t[35]!==e?(D=(i,d)=>{nt("invitation_role_update_failed",{new_role:d.role,error:i instanceof Error?i.message:String(i)}),ge.error(i instanceof Error?i.message:e("orgs.members.failedUpdateInvitationRole"))},t[35]=e,t[36]=D):D=t[36];let Q;t[37]!==F||t[38]!==D||t[39]!==$?(Q={mutationFn:$,onSuccess:F,onError:D},t[37]=F,t[38]=D,t[39]=$,t[40]=Q):Q=t[40];const H=xt(Q),{roles:U,customRoles:G}=js();let J;t[41]!==G?(J=ti(G),t[41]=G,t[42]=J):J=t[42];const W=J;let Y;t[43]!==U?(Y=U.filter(di),t[43]=U,t[44]=Y):Y=t[44];const Z=Y;let re;t[45]!==e?(re=e("orgs.members.columnMember"),t[45]=e,t[46]=re):re=t[46];let ae;t[47]!==e?(ae=i=>i.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ot,{url:i.data.user?.image??void 0,fallback:gt(i.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.data.user?.name||e("orgs.members.unknown")}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:i.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ot,{fallback:gt(i.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:i.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:e("orgs.members.invitationSent")})]})]}),t[47]=e,t[48]=ae):ae=t[48];let oe;t[49]!==re||t[50]!==ae?(oe={id:"member",header:re,render:ae,cellClassName:"flex-1 min-w-0",sortable:!0},t[49]=re,t[50]=ae,t[51]=oe):oe=t[51];let X;t[52]!==e?(X=e("orgs.members.columnRole"),t[52]=e,t[53]=X):X=t[53];let ce;t[54]!==W||t[55]!==Z||t[56]!==H||t[57]!==b?(ce=i=>i.type==="member"?s.jsx(pt,{role:i.data.role,memberId:i.data.id,isOwner:i.data.role==="owner",roleColorMap:W,selectableRoles:Z,onRoleChange:(d,A)=>b.mutate({memberId:d,role:A}),className:"w-36"}):s.jsx(pt,{role:i.data.role,memberId:i.data.id,isOwner:!1,roleColorMap:W,selectableRoles:Z,onRoleChange:(d,A)=>H.mutate({invitationId:d,role:A,email:i.data.email}),className:"w-36"}),t[54]=W,t[55]=Z,t[56]=H,t[57]=b,t[58]=ce):ce=t[58];let me;t[59]!==X||t[60]!==ce?(me={id:"role",header:X,render:ce,cellClassName:"w-36 shrink-0",sortable:!0},t[59]=X,t[60]=ce,t[61]=me):me=t[61];let ee;t[62]!==e?(ee=e("orgs.members.columnTags"),t[62]=e,t[63]=ee):ee=t[63];let te;t[64]!==ee?(te={id:"tags",header:ee,render:mi,cellClassName:"w-40 shrink-0"},t[64]=ee,t[65]=te):te=t[65];let se;t[66]!==e?(se=e("orgs.members.columnJoined"),t[66]=e,t[67]=se):se=t[67];let ie;t[68]!==e?(ie=i=>i.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:i.data.createdAt?hs(i.data.createdAt):e("orgs.members.na")}):s.jsx(ht,{variant:"outline",children:e("orgs.members.pending")}),t[68]=e,t[69]=ie):ie=t[69];let le;t[70]!==se||t[71]!==ie?(le={id:"joined",header:se,render:ie,cellClassName:"w-48 shrink-0",sortable:!0},t[70]=se,t[71]=ie,t[72]=le):le=t[72];let ne;t[73]!==r.cancel.isPending||t[74]!==U||t[75]!==b?(ne={id:"actions",header:"",render:i=>i.type==="member"?s.jsx(Qt,{member:i.data,roles:U,onChangeRole:(d,A)=>b.mutate({memberId:d,role:A}),onRemove:p,isUpdating:b.isPending}):s.jsx(Gt,{invitationId:i.data.id,onCancel:o,isCancelling:r.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[73]=r.cancel.isPending,t[74]=U,t[75]=b,t[76]=ne):ne=t[76];let C;t[77]!==oe||t[78]!==me||t[79]!==te||t[80]!==le||t[81]!==ne?(C=[oe,me,te,le,ne],t[77]=oe,t[78]=me,t[79]=te,t[80]=le,t[81]=ne,t[82]=C):C=t[82];const he=C;let de;t[83]!==e?(de=e("orgs.members.inviteMember"),t[83]=e,t[84]=de):de=t[84];let be;t[85]!==de?(be=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(xs,{trigger:s.jsx(rt,{children:de})})}),t[85]=de,t[86]=be):be=t[86];const bt=be,jt=[..._.map(ci),...k.filter(oi).map(ai)],vt=!!f;let mt;t[87]===Symbol.for("react.memo_cache_sentinel")?(mt=()=>o(null),t[87]=mt):mt=t[87];let je;t[88]!==e?(je=e("orgs.members.cancelInvitationTitle"),t[88]=e,t[89]=je):je=t[89];let ve;t[90]!==je?(ve=s.jsx(zt,{children:je}),t[90]=je,t[91]=ve):ve=t[91];let Ce;t[92]!==e?(Ce=e("orgs.members.cancelInvitationDescription"),t[92]=e,t[93]=Ce):Ce=t[93];let Se;t[94]!==Ce?(Se=s.jsx(Pt,{children:Ce}),t[94]=Ce,t[95]=Se):Se=t[95];let Ne;t[96]!==ve||t[97]!==Se?(Ne=s.jsxs(kt,{children:[ve,Se]}),t[96]=ve,t[97]=Se,t[98]=Ne):Ne=t[98];let ye;t[99]!==e?(ye=e("orgs.members.keepInvitation"),t[99]=e,t[100]=ye):ye=t[100];let we;t[101]!==ye?(we=s.jsx(_t,{children:ye}),t[101]=ye,t[102]=we):we=t[102];let Me;t[103]!==r.cancel||t[104]!==f?(Me=()=>{f&&(r.cancel.mutate(f),o(null))},t[103]=r.cancel,t[104]=f,t[105]=Me):Me=t[105];const ss=r.cancel.isPending;let Ie;t[106]!==e?(Ie=e("orgs.members.cancelInvitation"),t[106]=e,t[107]=Ie):Ie=t[107];let Te;t[108]!==r.cancel.isPending||t[109]!==Me||t[110]!==Ie?(Te=s.jsx(Dt,{onClick:Me,disabled:ss,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ie}),t[108]=r.cancel.isPending,t[109]=Me,t[110]=Ie,t[111]=Te):Te=t[111];let Re;t[112]!==we||t[113]!==Te?(Re=s.jsxs(Et,{children:[we,Te]}),t[112]=we,t[113]=Te,t[114]=Re):Re=t[114];let Ae;t[115]!==Ne||t[116]!==Re?(Ae=s.jsxs(Ot,{children:[Ne,Re]}),t[115]=Ne,t[116]=Re,t[117]=Ae):Ae=t[117];let ze;t[118]!==vt||t[119]!==Ae?(ze=s.jsx(Lt,{open:vt,onOpenChange:mt,children:Ae}),t[118]=vt,t[119]=Ae,t[120]=ze):ze=t[120];const Ct=!!a;let dt;t[121]===Symbol.for("react.memo_cache_sentinel")?(dt=()=>p(null),t[121]=dt):dt=t[121];let Pe;t[122]!==e?(Pe=e("orgs.members.removeMemberTitle"),t[122]=e,t[123]=Pe):Pe=t[123];let ke;t[124]!==Pe?(ke=s.jsx(zt,{children:Pe}),t[124]=Pe,t[125]=ke):ke=t[125];let _e;t[126]!==e?(_e=e("orgs.members.removeMemberDescription"),t[126]=e,t[127]=_e):_e=t[127];let De;t[128]!==_e?(De=s.jsx(Pt,{children:_e}),t[128]=_e,t[129]=De):De=t[129];let Ee;t[130]!==ke||t[131]!==De?(Ee=s.jsxs(kt,{children:[ke,De]}),t[130]=ke,t[131]=De,t[132]=Ee):Ee=t[132];let Oe;t[133]!==e?(Oe=e("orgs.members.cancel"),t[133]=e,t[134]=Oe):Oe=t[134];let Le;t[135]!==Oe?(Le=s.jsx(_t,{children:Oe}),t[135]=Oe,t[136]=Le):Le=t[136];let $e;t[137]!==a||t[138]!==q?($e=()=>a&&q.mutate(a),t[137]=a,t[138]=q,t[139]=$e):$e=t[139];const is=q.isPending;let qe;t[140]!==e?(qe=e("orgs.members.remove"),t[140]=e,t[141]=qe):qe=t[141];let Fe;t[142]!==q.isPending||t[143]!==$e||t[144]!==qe?(Fe=s.jsx(Dt,{onClick:$e,disabled:is,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:qe}),t[142]=q.isPending,t[143]=$e,t[144]=qe,t[145]=Fe):Fe=t[145];let Be;t[146]!==Le||t[147]!==Fe?(Be=s.jsxs(Et,{children:[Le,Fe]}),t[146]=Le,t[147]=Fe,t[148]=Be):Be=t[148];let Ke;t[149]!==Ee||t[150]!==Be?(Ke=s.jsxs(Ot,{children:[Ee,Be]}),t[149]=Ee,t[150]=Be,t[151]=Ke):Ke=t[151];let Ue;t[152]!==Ct||t[153]!==Ke?(Ue=s.jsx(Lt,{open:Ct,onOpenChange:dt,children:Ke}),t[152]=Ct,t[153]=Ke,t[154]=Ue):Ue=t[154];let Ve;t[155]===Symbol.for("react.memo_cache_sentinel")?(Ve=s.jsx(Js,{}),t[155]=Ve):Ve=t[155];const ls="flex flex-col gap-6";let Qe;t[156]!==e?(Qe=e("orgs.members.searchPlaceholder"),t[156]=e,t[157]=Qe):Qe=t[157];let ut;t[158]===Symbol.for("react.memo_cache_sentinel")?(ut=i=>{i.key==="Escape"&&(E(""),i.target.blur())},t[158]=ut):ut=t[158];let Ge;t[159]!==j||t[160]!==Qe?(Ge=s.jsx(us,{value:j,onChange:E,placeholder:Qe,className:"w-full md:w-[375px]",onKeyDown:ut}),t[159]=j,t[160]=Qe,t[161]=Ge):Ge=t[161];let Je;t[162]!==e?(Je=e("orgs.members.sortName"),t[162]=e,t[163]=Je):Je=t[163];let He;t[164]!==Je?(He={id:"member",label:Je},t[164]=Je,t[165]=He):He=t[165];let We;t[166]!==e?(We=e("orgs.members.sortRole"),t[166]=e,t[167]=We):We=t[167];let Ye;t[168]!==We?(Ye={id:"role",label:We},t[168]=We,t[169]=Ye):Ye=t[169];let Ze;t[170]!==e?(Ze=e("orgs.members.sortJoined"),t[170]=e,t[171]=Ze):Ze=t[171];let Xe;t[172]!==Ze?(Xe={id:"joined",label:Ze},t[172]=Ze,t[173]=Xe):Xe=t[173];let et;t[174]!==He||t[175]!==Ye||t[176]!==Xe?(et=[He,Ye,Xe],t[174]=He,t[175]=Ye,t[176]=Xe,t[177]=et):et=t[177];let tt;t[178]!==S||t[179]!==x||t[180]!==v||t[181]!==et||t[182]!==z?(tt=s.jsx(ds,{viewMode:z,onViewModeChange:P,sortKey:v,sortDirection:x,onSort:S,sortOptions:et}),t[178]=S,t[179]=x,t[180]=v,t[181]=et,t[182]=z,t[183]=tt):tt=t[183];let st;t[184]!==Ge||t[185]!==tt?(st=s.jsxs("div",{className:"flex items-center gap-2",children:[Ge,tt]}),t[184]=Ge,t[185]=tt,t[186]=st):st=t[186];let it;t[187]!==bt||t[188]!==st?(it=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[st,bt]}),t[187]=bt,t[188]=st,t[189]=it):it=t[189];const St=z==="cards"?s.jsx("div",{children:jt.length===0?s.jsx(Nt,{title:e("orgs.members.noMembersFound"),description:j?e("orgs.members.noMembersMatch",{search:j}):e("orgs.members.inviteMembersGetStarted")}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:jt.map(i=>{if(i.type==="invitation")return s.jsxs(At,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Gt,{invitationId:i.data.id,onCancel:o,isCancelling:r.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ot,{fallback:gt(i.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:i.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ht,{variant:"outline",className:"w-fit text-warning border-warning/40",children:e("orgs.members.pending")})}),s.jsx(pt,{role:i.data.role,memberId:i.data.id,isOwner:!1,roleColorMap:W,selectableRoles:Z,onRoleChange:(A,V)=>H.mutate({invitationId:A,role:V,email:i.data.email}),className:"w-fit"})]})]})]},`inv-${i.data.id}`);const d=i.data;return s.jsxs(At,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Qt,{member:d,roles:U,onChangeRole:(A,V)=>b.mutate({memberId:A,role:V}),onRemove:p,isUpdating:b.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ot,{url:d.user?.image??void 0,fallback:gt(d.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:d.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:d.user?.email}),s.jsx(pt,{role:d.role,memberId:d.id,isOwner:d.role==="owner",roleColorMap:W,selectableRoles:Z,onRoleChange:(A,V)=>b.mutate({memberId:A,role:V}),className:"w-fit"}),s.jsx(ts,{memberId:d.id,maxDisplay:3})]})]})]},d.id)})})}):s.jsx(fs,{columns:he,data:jt,isLoading:!1,sortKey:v,sortDirection:x,onSort:S,emptyState:j?s.jsx(Nt,{title:e("orgs.members.noMembersFound"),description:e("orgs.members.noMembersMatch",{search:j})}):s.jsx(Nt,{title:e("orgs.members.noMembersFound"),description:e("orgs.members.inviteMembersGetStarted")})});let lt;t[190]!==it||t[191]!==St?(lt=s.jsxs("div",{className:ls,children:[it,St]}),t[190]=it,t[191]=St,t[192]=lt):lt=t[192];let ft;return t[193]!==ze||t[194]!==Ue||t[195]!==Ve||t[196]!==lt?(ft=s.jsxs(s.Fragment,{children:[ze,Ue,Ve,lt]}),t[193]=ze,t[194]=Ue,t[195]=Ve,t[196]=lt,t[197]=ft):ft=t[197],ft}function ai(t){return{type:"invitation",data:t}}function oi(t){return t.status==="pending"}function ci(t){return{type:"member",data:t}}function mi(t){return t.type==="member"?s.jsx(ts,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function di(t){return t.role!=="owner"}function ui(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function fi(){const t=ue.c(7),e=xe();let l;t[0]!==e?(l=e("orgs.members.failedLoadMembers"),t[0]=e,t[1]=l):l=t[1];let c;t[2]!==l?(c=s.jsx("div",{className:"text-sm text-muted-foreground",children:l}),t[2]=l,t[3]=c):c=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ri,{}),t[4]=r):r=t[4];let n;return t[5]!==c?(n=s.jsx(ms,{group:"members",className:"gap-6",errorFallback:c,children:r}),t[5]=c,t[6]=n):n=t[6],n}function ol(){const t=ue.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Gs,{capability:"members:manage",area:"members",children:s.jsx(fi,{})}),t[0]=e):e=t[0],e}export{ol as default};
@@ -0,0 +1 @@
1
+ import{c as T,r as I,j as s,l as h,B as S,b as q}from"./index-CVJEcf37.js";import{c as G,D as H,b as X,a as U}from"./dropdown-menu-Bws_0K_q.js";import{i as Z}from"./ChevronRight-vY_5m8VB.js";import{T as J}from"./agent-icon-BjknPEfN.js";import{a as K}from"./Printer-B2Ij2s1c.js";import{w as _}from"./editor-U5ucetu-.js";import{g as Q}from"./utils-D06E4WDv.js";const V={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},E=1114111;function de(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,n)=>{if(n.startsWith("#x")||n.startsWith("#X")){const i=Number.parseInt(n.slice(2),16);return!Number.isFinite(i)||i>E?e:String.fromCodePoint(i)}if(n.startsWith("#")){const i=Number.parseInt(n.slice(1),10);return!Number.isFinite(i)||i>E?e:String.fromCodePoint(i)}return V[n]??e}):""}function Y(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const ee=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function P(t){const e=T.c(10),{height:n}=t,i=q();let o;e[0]!==n?(o={height:n},e[0]=n,e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=ee.map(te),e[2]=a):a=e[2];let c;e[3]!==i?(c=i("thread.publishDialog.openingComparison"),e[3]=i,e[4]=c):c=e[4];let l;e[5]!==c?(l=s.jsx("div",{className:"flex items-center justify-center pt-1 text-[11px] text-muted-foreground",children:c}),e[5]=c,e[6]=l):l=e[6];let d;return e[7]!==o||e[8]!==l?(d=s.jsxs("div",{style:o,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[a,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9],d}function te(t,e){return s.jsxs("div",{className:h("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[s.jsx("div",{className:h("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),s.jsx("div",{className:h("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const M={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},se={...M,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function ue(t){const e=T.c(11),{diff:n,emptyMessage:i,rowClassName:o,onDiscardFile:a,hideFileRows:c,editorHeight:l}=t,d=i===void 0?"No file changes in the working tree":i,p=o===void 0?"px-6":o,w=c===void 0?!1:c,m=l===void 0?"380px":l,[y,B]=I.useState(null),[N,j]=I.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=Y(),e[0]=g):g=e[0];const $=g;if(!n||Object.keys(n.diffs).length===0){let f;return e[1]!==d?(f=s.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:d}),e[1]=d,e[2]=f):f=e[2],f}let x;return e[3]!==n.diffs||e[4]!==N||e[5]!==m||e[6]!==y||e[7]!==w||e[8]!==a||e[9]!==p?(x=s.jsx("div",{className:"divide-y",children:Object.entries(n.diffs).map(f=>{const[r,L]=f,{from:k,to:D}=L,R=y===r,W=k===null,z=D===null,v=r.startsWith("/")?r.slice(1):r,b=v.lastIndexOf("/"),C=b>=0?v.slice(b+1):v,F=b>=0?v.slice(0,b):null,O=Q(r),A=W?"bg-success":z?"bg-destructive":"bg-warning";return w?s.jsx("div",{children:s.jsx(_,{original:k??"",modified:D??"",language:O,theme:$,height:m,loading:s.jsx(P,{height:m}),options:se})},r):s.jsxs("div",{children:[s.jsxs("div",{className:h("flex items-center gap-3 py-3 hover:bg-muted/30",p),children:[s.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>B(R?null:r),children:s.jsx(Z,{className:h("h-3.5 w-3.5 transition-transform",R&&"rotate-90")})}),s.jsx("div",{className:h("h-2.5 w-2.5 shrink-0 rounded-full",A)}),s.jsx(K,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:C}),F&&s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F}),a?s.jsxs(G,{children:[s.jsx(H,{asChild:!0,children:s.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground",children:s.jsx(J,{className:"h-3.5 w-3.5"})})}),s.jsx(X,{align:"end",children:s.jsx(U,{className:"text-destructive focus:text-destructive",onSelect:()=>j(r),children:"Discard changes"})})]}):null]}),N===r&&a?s.jsxs("div",{className:h("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",p),children:[s.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",s.jsx("span",{className:"font-medium",children:C}),"? This cannot be undone."]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsx(S,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>j(null),children:"Cancel"}),s.jsx(S,{type:"button",size:"sm",className:"h-7 bg-destructive px-2 text-xs text-destructive-foreground hover:bg-destructive/90",onClick:()=>{j(null),a(r)},children:"Discard"})]})]}):null,R&&s.jsx("div",{className:"border-t",children:s.jsx(_,{original:k??"",modified:D??"",language:O,theme:$,height:m,loading:s.jsx(P,{height:m}),options:M})})]},r)})}),e[3]=n.diffs,e[4]=N,e[5]=m,e[6]=y,e[7]=w,e[8]=a,e[9]=p,e[10]=x):x=e[10],x}const u="The user clicked this action deliberately — execute directly. Do not call user_ask unless you hit an actual problem outside the scope of this intent (missing auth, unresolvable conflict, a check with multiple plausible fixes).";function he(t){return`Reopen PR #${t.prNumber}. ${u}`}function me(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${u}`}function fe(t){return`Sync \`${t.branch}\` with everyone else's work: \`git add -A\`, commit any pending local changes with a concise conventional-commit message (skip if the working tree is clean), \`git pull --rebase\` to bring in anything pushed directly to \`origin/${t.branch}\`, then \`git rebase origin/${t.base}\` to catch up with the base branch. Resolve any conflicts that come up, then push the result (force-with-lease only if the rebase rewrote commits already on the remote). ${u}`}function pe(t){return`Re-run the \`${t.checkName}\` check on PR #${t.prNumber}. If an empty commit is needed to retrigger CI, create and push one. ${u}`}function ge(t){const e=(t.failingChecks??[]).map(n=>`\`${n}\``).join(", ");return`PR #${t.prNumber} has failing checks: ${e}. For each: read the logs, diagnose the root cause, apply the smallest fix that makes it pass, commit, and push. ${u}`}function xe(t){return`Mark PR #${t.prNumber} ready for review. ${u}`}function ve(t){return`Read the unresolved review threads on PR #${t.prNumber}. For each thread: understand the reviewer's ask, apply the needed changes, commit, push, reply explaining what changed, and resolve the thread. If a comment is a question that doesn't need a code change, reply with the answer and resolve. ${u}`}function be(t){return`Review PR #${t.prNumber}. Read the full diff, analyze every changed file for correctness, security, code quality, and alignment with the repo's patterns. Post specific line-level review comments on concerns, then submit an overall review (approve / request changes / comment) with a concise summary. Do not modify the code — this is a read-and-comment pass. ${u}`}export{ue as G,he as a,be as b,me as c,de as d,pe as e,ge as f,xe as m,ve as r,fe as s};
@@ -1 +1 @@
1
- import{c as R,l as h,j as s}from"./index-gctAQu2T.js";function E($){const e=R.c(34),{generating:l,className:N}=$;let t;e[0]!==N?(t=h("pointer-events-none rounded-xl border border-border bg-background shadow-lg",N),e[0]=N,e[1]=t):t=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",className:"stroke-muted"}),e[2]=p):p=e[2];const v=l?"75.4":"22",k=l?"stroke-muted":"stroke-success";let a;e[3]!==k?(a=h("transition-[stroke-dashoffset] duration-1000 ease-out",k),e[3]=k,e[4]=a):a=e[4];let i;e[5]!==v||e[6]!==a?(i=s.jsxs("svg",{viewBox:"0 0 32 32",className:"size-9 shrink-0 -rotate-90",children:[p,s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"75.4",strokeDashoffset:v,className:a})]}),e[5]=v,e[6]=a,e[7]=i):i=e[7];const w=l&&"animate-pulse";let c;e[8]!==w?(c=h("h-1.5 w-full rounded-full bg-muted",w),e[8]=w,e[9]=c):c=e[9];let r;e[10]!==c?(r=s.jsx("div",{className:c}),e[10]=c,e[11]=r):r=e[11];const y=l&&"animate-pulse";let n;e[12]!==y?(n=h("h-1.5 w-2/3 rounded-full bg-muted",y),e[12]=y,e[13]=n):n=e[13];let o;e[14]!==n?(o=s.jsx("div",{className:n}),e[14]=n,e[15]=o):o=e[15];let d;e[16]!==o||e[17]!==r?(d=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[r,o]}),e[16]=o,e[17]=r,e[18]=d):d=e[18];let f;e[19]!==d||e[20]!==i?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[19]=d,e[20]=i,e[21]=f):f=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=[7,10,5,9,6,8],e[22]=g):g=e[22];let m;e[23]!==l?(m=s.jsx("div",{className:"flex h-10 items-end gap-1.5",children:g.map((_,b)=>s.jsx("div",{style:{height:`${_*4}px`},className:h("flex-1 rounded-sm",l?"animate-pulse bg-muted":b%2===0?"bg-success/70":"bg-success/30")},`bar-${b}`))}),e[23]=l,e[24]=m):m=e[24];let u;e[25]!==l?(u=s.jsx("div",{className:"flex flex-col gap-1.5",children:["w-full","w-5/6","w-full","w-2/3","w-full"].map((_,b)=>s.jsx("div",{className:h("h-1.5 rounded-full bg-muted",_,l&&"animate-pulse")},`line-${b}`))}),e[25]=l,e[26]=u):u=e[26];let x;e[27]!==f||e[28]!==m||e[29]!==u?(x=s.jsxs("div",{className:"flex h-full flex-col gap-3 p-4",children:[f,m,u]}),e[27]=f,e[28]=m,e[29]=u,e[30]=x):x=e[30];let j;return e[31]!==t||e[32]!==x?(j=s.jsx("div",{"aria-hidden":!0,className:t,children:x}),e[31]=t,e[32]=x,e[33]=j):j=e[33],j}export{E as M};
1
+ import{c as R,l as h,j as s}from"./index-CVJEcf37.js";function E($){const e=R.c(34),{generating:l,className:N}=$;let t;e[0]!==N?(t=h("pointer-events-none rounded-xl border border-border bg-background shadow-lg",N),e[0]=N,e[1]=t):t=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",className:"stroke-muted"}),e[2]=p):p=e[2];const v=l?"75.4":"22",k=l?"stroke-muted":"stroke-success";let a;e[3]!==k?(a=h("transition-[stroke-dashoffset] duration-1000 ease-out",k),e[3]=k,e[4]=a):a=e[4];let i;e[5]!==v||e[6]!==a?(i=s.jsxs("svg",{viewBox:"0 0 32 32",className:"size-9 shrink-0 -rotate-90",children:[p,s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"75.4",strokeDashoffset:v,className:a})]}),e[5]=v,e[6]=a,e[7]=i):i=e[7];const w=l&&"animate-pulse";let c;e[8]!==w?(c=h("h-1.5 w-full rounded-full bg-muted",w),e[8]=w,e[9]=c):c=e[9];let r;e[10]!==c?(r=s.jsx("div",{className:c}),e[10]=c,e[11]=r):r=e[11];const y=l&&"animate-pulse";let n;e[12]!==y?(n=h("h-1.5 w-2/3 rounded-full bg-muted",y),e[12]=y,e[13]=n):n=e[13];let o;e[14]!==n?(o=s.jsx("div",{className:n}),e[14]=n,e[15]=o):o=e[15];let d;e[16]!==o||e[17]!==r?(d=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[r,o]}),e[16]=o,e[17]=r,e[18]=d):d=e[18];let f;e[19]!==d||e[20]!==i?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[19]=d,e[20]=i,e[21]=f):f=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=[7,10,5,9,6,8],e[22]=g):g=e[22];let m;e[23]!==l?(m=s.jsx("div",{className:"flex h-10 items-end gap-1.5",children:g.map((_,b)=>s.jsx("div",{style:{height:`${_*4}px`},className:h("flex-1 rounded-sm",l?"animate-pulse bg-muted":b%2===0?"bg-success/70":"bg-success/30")},`bar-${b}`))}),e[23]=l,e[24]=m):m=e[24];let u;e[25]!==l?(u=s.jsx("div",{className:"flex flex-col gap-1.5",children:["w-full","w-5/6","w-full","w-2/3","w-full"].map((_,b)=>s.jsx("div",{className:h("h-1.5 rounded-full bg-muted",_,l&&"animate-pulse")},`line-${b}`))}),e[25]=l,e[26]=u):u=e[26];let x;e[27]!==f||e[28]!==m||e[29]!==u?(x=s.jsxs("div",{className:"flex h-full flex-col gap-3 p-4",children:[f,m,u]}),e[27]=f,e[28]=m,e[29]=u,e[30]=x):x=e[30];let j;return e[31]!==t||e[32]!==x?(j=s.jsx("div",{"aria-hidden":!0,className:t,children:x}),e[31]=t,e[32]=x,e[33]=j):j=e[33],j}export{E as M};
@@ -1,4 +1,4 @@
1
- import{r as m,j as f,h as I,c as V,an as O}from"./index-gctAQu2T.js";import{l as k,c as L,F as S}from"./editor-NTP5Xcj9.js";import{d as $}from"./delay-CnY5UFtP.js";L();async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
1
+ import{r as m,j as f,h as I,c as V,au as O}from"./index-CVJEcf37.js";import{l as k,c as L,F as S}from"./editor-U5ucetu-.js";import{d as $}from"./backoff-8mStPHYB.js";L();async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
2
2
  type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
3
3
  ? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
4
4
  : T extends object
@@ -1 +1 @@
1
- import{r as f,fg as lt,c as Ne,l as Ie,j as I}from"./index-gctAQu2T.js";import{c as Ae,b as Pe}from"./chart-zbtN9_7R.js";import{a2 as xe,a3 as ot,a4 as st,a5 as ct,a6 as ut,E as ue,_ as fe,a7 as ve,a8 as dt,P as Se,b as $,a9 as ft,aa as vt,s as ee,ab as mt,ac as G,e as J,ad as V,f as Q,h as Te,g as Re,ae as Fe,af as pt,ag as ht,ah as Ee,ai as xt,aj as Oe,ak as gt,L as le,p as yt,r as bt,D as ge,u as $e,R as kt,S as It,j as At,Z as ye,k as We,l as Pt,n as St,m as Et,q as Ot,al as Bt,t as oe,z as Ge,G as Ct,am as jt,an as wt,ao as Be,ap as Ve,aq as Mt,ar as Ue,F as Dt,J as _t,H as R,I as Lt,K as zt,N as Kt,as as Nt,at as Tt,$ as Ce,au as Rt,av as Ft,C as je,X as we,Y as Me,A as $t,a as Wt}from"./AreaChart-CHPDNuDf.js";import{a as Gt,S as Vt}from"./ErrorBarContext-nVgseQIz.js";var Ut="Invariant failed";function Yt(t,e){throw new Error(Ut)}var be=t=>null;be.displayName="Cell";var Ye=(t,e,a)=>{var r=xe();return(i,n)=>c=>{t?.(i,n,c),r(ot({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:a}))}},Xe=t=>{var e=xe();return(a,r)=>i=>{t?.(a,r,i),e(st())}},qe=(t,e,a)=>{var r=xe();return(i,n)=>c=>{t?.(i,n,c),r(ct({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:a}))}},De=(t,e,a)=>{var r=a??t;if(!ue(r))return fe(r,e,0)},Xt=(t,e,a)=>{var r={},i=t.filter(ut),n=t.filter(l=>l.stackId==null),c=i.reduce((l,o)=>{var u=l[o.stackId];return u==null&&(u=[]),u.push(o),l[o.stackId]=u,l},r),s=Object.entries(c).map(l=>{var o,[u,v]=l,x=v.map(g=>g.dataKey),p=De(e,a,(o=v[0])===null||o===void 0?void 0:o.barSize);return{stackId:u,dataKeys:x,barSize:p}}),m=n.map(l=>{var o=[l.dataKey].filter(v=>v!=null),u=De(e,a,l.barSize);return{stackId:void 0,dataKeys:o,barSize:u}});return[...s,...m]};function _e(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,r)}return a}function ie(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?_e(Object(a),!0).forEach(function(r){qt(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_e(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function qt(t,e,a){return(e=Ht(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Ht(t){var e=Zt(t,"string");return typeof e=="symbol"?e:e+""}function Zt(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jt(t,e,a,r,i){var n,c=r.length;if(!(c<1)){var s=fe(t,a,0,!0),m,l=[];if(ve((n=r[0])===null||n===void 0?void 0:n.barSize)){var o=!1,u=a/c,v=r.reduce((h,y)=>h+(y.barSize||0),0);v+=(c-1)*s,v>=a&&(v-=(c-1)*s,s=0),v>=a&&u>0&&(o=!0,u*=.9,v=c*u);var x=(a-v)/2>>0,p={offset:x-s,size:0};m=r.reduce((h,y)=>{var k,C={stackId:y.stackId,dataKeys:y.dataKeys,position:{offset:p.offset+p.size+s,size:o?u:(k=y.barSize)!==null&&k!==void 0?k:0}},A=[...h,C];return p=C.position,A},l)}else{var g=fe(e,a,0,!0);a-2*g-(c-1)*s<=0&&(s=0);var b=(a-2*g-(c-1)*s)/c;b>1&&(b>>=0);var d=ve(i)?Math.min(b,i):b;m=r.reduce((h,y,k)=>[...h,{stackId:y.stackId,dataKeys:y.dataKeys,position:{offset:g+(b+s)*k+(b-d)/2,size:d}}],l)}return m}}var Qt=(t,e,a,r,i,n,c)=>{var s=ue(c)?e:c,m=Jt(a,r,i!==n?i:n,t,s);return i!==n&&m!=null&&(m=m.map(l=>ie(ie({},l),{},{position:ie(ie({},l.position),{},{offset:l.position.offset-i/2})}))),m},ea=(t,e)=>{var a=dt(e);if(!(!t||a==null||e==null)){var{stackId:r}=e;if(r!=null){var i=t[r];if(i){var{stackedData:n}=i;if(n)return n.find(c=>c.key===a)}}}},ta=(t,e)=>{if(!(t==null||e==null)){var a=t.find(r=>r.stackId===e.stackId&&e.dataKey!=null&&r.dataKeys.includes(e.dataKey));if(a!=null)return a.position}};function aa(t,e){return t&&typeof t=="object"&&"zIndex"in t&&typeof t.zIndex=="number"&&ve(t.zIndex)?t.zIndex:e}function me(){return me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},me.apply(null,arguments)}function ke(t){return f.createElement(Gt,me({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},t))}var ra=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Se(e))return e;var n=Se(r)||ue(r);return n?e(r,i):(n||Yt(),a)}},na=(t,e,a)=>a,ia=(t,e)=>e,ae=$([Re,ia],(t,e)=>t.filter(a=>a.type==="bar").find(a=>a.id===e)),la=$([ae],t=>t?.maxBarSize),oa=(t,e,a,r)=>r,sa=$([ee,Re,G,V,na],(t,e,a,r,i)=>e.filter(n=>t==="horizontal"?n.xAxisId===a:n.yAxisId===r).filter(n=>n.isPanorama===i).filter(n=>n.hide===!1).filter(n=>n.type==="bar")),ca=(t,e,a)=>{var r=ee(t),i=G(t,e),n=V(t,e);if(!(i==null||n==null))return r==="horizontal"?Ee(t,"yAxis",n,a):Ee(t,"xAxis",i,a)},ua=(t,e)=>{var a=ee(t),r=G(t,e),i=V(t,e);if(!(r==null||i==null))return a==="horizontal"?Oe(t,"xAxis",r):Oe(t,"yAxis",i)},da=$([sa,xt,ua],Xt),fa=(t,e,a)=>{var r,i,n=ae(t,e);if(n==null)return 0;var c=G(t,e),s=V(t,e);if(c==null||s==null)return 0;var m=ee(t),l=Fe(t),{maxBarSize:o}=n,u=ue(o)?l:o,v,x;return m==="horizontal"?(v=J(t,"xAxis",c,a),x=Q(t,"xAxis",c,a)):(v=J(t,"yAxis",s,a),x=Q(t,"yAxis",s,a)),(r=(i=Te(v,x,!0))!==null&&i!==void 0?i:u)!==null&&r!==void 0?r:0},He=(t,e,a)=>{var r=ee(t),i=G(t,e),n=V(t,e);if(!(i==null||n==null)){var c,s;return r==="horizontal"?(c=J(t,"xAxis",i,a),s=Q(t,"xAxis",i,a)):(c=J(t,"yAxis",n,a),s=Q(t,"yAxis",n,a)),Te(c,s)}},va=$([da,Fe,pt,ht,fa,He,la],Qt),ma=(t,e,a)=>{var r=G(t,e);if(r!=null)return J(t,"xAxis",r,a)},pa=(t,e,a)=>{var r=V(t,e);if(r!=null)return J(t,"yAxis",r,a)},ha=(t,e,a)=>{var r=G(t,e);if(r!=null)return Q(t,"xAxis",r,a)},xa=(t,e,a)=>{var r=V(t,e);if(r!=null)return Q(t,"yAxis",r,a)},ga=$([va,ae],ta),ya=$([ca,ae],ea),ba=$([ft,vt,ma,pa,ha,xa,ga,ee,mt,He,ya,ae,oa],(t,e,a,r,i,n,c,s,m,l,o,u,v)=>{var{chartData:x,dataStartIndex:p,dataEndIndex:g}=m;if(!(u==null||c==null||e==null||s!=="horizontal"&&s!=="vertical"||a==null||r==null||i==null||n==null||l==null)){var{data:b}=u,d;if(b!=null&&b.length>0?d=b:d=x?.slice(p,g+1),d!=null)return Xa({layout:s,barSettings:u,pos:c,parentViewBox:e,bandSize:l,xAxis:a,yAxis:r,xAxisTicks:i,yAxisTicks:n,stackedData:o,displayedData:d,offset:t,cells:v,dataStartIndex:p})}}),ka=["index"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},pe.apply(null,arguments)}function Ia(t,e){if(t==null)return{};var a,r,i=Aa(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)a=n[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(i[a]=t[a])}return i}function Aa(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var Ze=f.createContext(void 0),Pa=t=>{var e=f.useContext(Ze);if(e!=null)return e.stackId;if(t!=null)return gt(t)},Sa=(t,e)=>"recharts-bar-stack-clip-path-".concat(t,"-").concat(e),Ea=t=>{var e=f.useContext(Ze);if(e!=null){var{stackId:a}=e;return"url(#".concat(Sa(a,t),")")}},Je=t=>{var{index:e}=t,a=Ia(t,ka),r=Ea(e);return f.createElement(le,pe({className:"recharts-bar-stack-layer",clipPath:r},a))},Oa=["onMouseEnter","onMouseLeave","onClick"],Ba=["value","background","tooltipPosition"],Ca=["id"],ja=["onMouseEnter","onClick","onMouseLeave"];function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},F.apply(null,arguments)}function Le(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,r)}return a}function M(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Le(Object(a),!0).forEach(function(r){wa(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Le(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function wa(t,e,a){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Ma(t){var e=Da(t,"string");return typeof e=="symbol"?e:e+""}function Da(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function se(t,e){if(t==null)return{};var a,r,i=_a(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)a=n[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(i[a]=t[a])}return i}function _a(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var La=t=>{var{dataKey:e,name:a,fill:r,legendType:i,hide:n}=t;return[{inactive:n,dataKey:e,type:i,color:r,value:We(a,e),payload:t}]},za=f.memo(t=>{var{dataKey:e,stroke:a,strokeWidth:r,fill:i,name:n,hide:c,unit:s,tooltipType:m,id:l}=t,o={dataDefinedOnItem:void 0,getPosition:St,settings:{stroke:a,strokeWidth:r,fill:i,dataKey:e,nameKey:void 0,name:We(n,e),hide:c,type:m,color:i,unit:s,graphicalItemId:l}};return f.createElement(Pt,{tooltipEntrySettings:o})});function Ka(t){var e=oe(Ve),{data:a,dataKey:r,background:i,allOtherBarProps:n}=t,{onMouseEnter:c,onMouseLeave:s,onClick:m}=n,l=se(n,Oa),o=Ye(c,r,n.id),u=Xe(s),v=qe(m,r,n.id);if(!i||a==null)return null;var x=Mt(i);return f.createElement(ye,{zIndex:aa(i,ge.barBackground)},a.map((p,g)=>{var{value:b,background:d,tooltipPosition:h}=p,y=se(p,Ba);if(!d)return null;var k=o(p,g),C=u(p,g),A=v(p,g),P=M(M(M(M(M({option:i,isActive:String(g)===e},y),{},{fill:"#eee"},d),x),Ue(l,p,g)),{},{onMouseEnter:k,onMouseLeave:C,onClick:A,dataKey:r,index:g,className:"recharts-bar-background-rectangle"});return f.createElement(ke,F({key:"background-bar-".concat(g)},P))}))}function Na(t){var{showLabels:e,children:a,rects:r}=t,i=r?.map(n=>{var c={x:n.x,y:n.y,width:n.width,lowerWidth:n.width,upperWidth:n.width,height:n.height};return M(M({},c),{},{value:n.value,payload:n.payload,parentViewBox:n.parentViewBox,viewBox:c,fill:n.fill})});return f.createElement(zt,{value:e?i:void 0},a)}function Ta(t){var{shape:e,activeBar:a,baseProps:r,entry:i,index:n,dataKey:c}=t,s=oe(Ve),m=oe(Nt),l=a&&String(i.originalDataIndex)===s&&(m==null||c===m),[o,u]=f.useState(!1),[v,x]=f.useState(!1);f.useEffect(()=>{var y;return l?(u(!0),y=requestAnimationFrame(()=>{x(!0)})):x(!1),()=>{cancelAnimationFrame(y)}},[l]);var p=f.useCallback(()=>{l||u(!1)},[l]),g=l&&v,b=l||o,d;l?a===!0?d=e:d=a:d=e;var h=f.createElement(ke,F({},r,{name:String(r.name)},i,{isActive:g,option:d,index:n,dataKey:c,onTransitionEnd:p}));return b?f.createElement(ye,{zIndex:ge.activeBar},f.createElement(Je,{index:i.originalDataIndex},h)):h}function Ra(t){var{shape:e,baseProps:a,entry:r,index:i,dataKey:n}=t;return f.createElement(ke,F({},a,{name:String(a.name)},r,{isActive:!1,option:e,index:i,dataKey:n}))}function Fa(t){var e,{data:a,props:r}=t,i=(e=Kt(r))!==null&&e!==void 0?e:{},{id:n}=i,c=se(i,Ca),{shape:s,dataKey:m,activeBar:l}=r,{onMouseEnter:o,onClick:u,onMouseLeave:v}=r,x=se(r,ja),p=Ye(o,m,n),g=Xe(v),b=qe(u,m,n);return a?f.createElement(f.Fragment,null,a.map((d,h)=>f.createElement(Je,F({index:d.originalDataIndex,key:"rectangle-".concat(d?.x,"-").concat(d?.y,"-").concat(d?.value,"-").concat(h),className:"recharts-bar-rectangle"},Ue(x,d,h),{onMouseEnter:p(d,h),onMouseLeave:g(d,h),onClick:b(d,h)}),l?f.createElement(Ta,{shape:s,activeBar:l,baseProps:c,entry:d,index:h,dataKey:m}):f.createElement(Ra,{shape:s,baseProps:c,entry:d,index:h,dataKey:m})))):null}function $a(t){var{props:e,previousRectanglesRef:a}=t,{data:r,layout:i,isAnimationActive:n,animationBegin:c,animationDuration:s,animationEasing:m,onAnimationEnd:l,onAnimationStart:o}=e,u=a.current,v=Dt(e,"recharts-bar-"),[x,p]=f.useState(!1),g=!x,b=f.useCallback(()=>{typeof l=="function"&&l(),p(!1)},[l]),d=f.useCallback(()=>{typeof o=="function"&&o(),p(!0)},[o]);return f.createElement(Na,{showLabels:g,rects:r},f.createElement(_t,{animationId:v,begin:c,duration:s,isActive:n,easing:m,onAnimationEnd:b,onAnimationStart:d,key:v},h=>{var y=h===1?r:r?.map((k,C)=>{var A=u&&u[C];if(A)return M(M({},k),{},{x:R(A.x,k.x,h),y:R(A.y,k.y,h),width:R(A.width,k.width,h),height:R(A.height,k.height,h)});if(i==="horizontal"){var P=R(0,k.height,h),w=R(k.stackedBarStart,k.y,h);return M(M({},k),{},{y:w,height:P})}var j=R(0,k.width,h),S=R(k.stackedBarStart,k.x,h);return M(M({},k),{},{width:j,x:S})});return h>0&&(a.current=y??null),y==null?null:f.createElement(le,null,f.createElement(Fa,{props:e,data:y}))}),f.createElement(Lt,{label:e.label}),e.children)}function Wa(t){var e=f.useRef(null);return f.createElement($a,{previousRectanglesRef:e,props:t})}var Qe=0,Ga=(t,e)=>{var a=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:a,errorVal:Ge(t,e)}};class Va extends f.PureComponent{render(){var{hide:e,data:a,dataKey:r,className:i,xAxisId:n,yAxisId:c,needClip:s,background:m,id:l}=this.props;if(e||a==null)return null;var o=lt("recharts-bar",i),u=l;return f.createElement(le,{className:o,id:l},s&&f.createElement("defs",null,f.createElement(Ct,{clipPathId:u,xAxisId:n,yAxisId:c})),f.createElement(le,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(u,")"):void 0},f.createElement(Ka,{data:a,dataKey:r,background:m,allOtherBarProps:this.props}),f.createElement(Wa,this.props)))}}var Ua={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:Qe,xAxisId:0,yAxisId:0,zIndex:ge.bar};function Ya(t){var{xAxisId:e,yAxisId:a,hide:r,legendType:i,minPointSize:n,activeBar:c,animationBegin:s,animationDuration:m,animationEasing:l,isAnimationActive:o}=t,{needClip:u}=Et(e,a),v=Ot(),x=$e(),p=Bt(t.children,be),g=oe(h=>ba(h,t.id,x,p));if(v!=="vertical"&&v!=="horizontal")return null;var b,d=g?.[0];return d==null||d.height==null||d.width==null?b=0:b=v==="vertical"?d.height/2:d.width/2,f.createElement(Vt,{xAxisId:e,yAxisId:a,data:g,dataPointFormatter:Ga,errorBarOffset:b},f.createElement(Va,F({},t,{layout:v,needClip:u,data:g,xAxisId:e,yAxisId:a,hide:r,legendType:i,minPointSize:n,activeBar:c,animationBegin:s,animationDuration:m,animationEasing:l,isAnimationActive:o})))}function Xa(t){var{layout:e,barSettings:{dataKey:a,minPointSize:r,hasCustomShape:i},pos:n,bandSize:c,xAxis:s,yAxis:m,xAxisTicks:l,yAxisTicks:o,stackedData:u,displayedData:v,offset:x,cells:p,parentViewBox:g,dataStartIndex:b}=t,d=e==="horizontal"?m:s,h=u?d.scale.domain():null,y=jt({numericAxis:d}),k=d.scale.map(y);return v.map((C,A)=>{var P,w,j,S,O,K;if(u){var B=u[A+b];if(B==null)return null;P=wt(B,h)}else P=Ge(C,a),Array.isArray(P)||(P=[y,P]);var E=ra(r,Qe)(P[1],A);if(e==="horizontal"){var D,N=m.scale.map(P[0]),_=m.scale.map(P[1]);if(N==null||_==null)return null;w=Be({axis:s,ticks:l,bandSize:c,offset:n.offset,entry:C,index:A}),j=(D=_??N)!==null&&D!==void 0?D:void 0,S=n.size;var L=N-_;if(O=Tt(L)?0:L,K={x:w,y:x.top,width:S,height:x.height},Math.abs(E)>0&&Math.abs(O)<Math.abs(E)){var z=Ce(O||E)*(Math.abs(E)-Math.abs(O));j-=z,O+=z}}else{var T=s.scale.map(P[0]),W=s.scale.map(P[1]);if(T==null||W==null)return null;if(w=T,j=Be({axis:m,ticks:o,bandSize:c,offset:n.offset,entry:C,index:A}),S=W-T,O=n.size,K={x:x.left,y:j,width:x.width,height:O},Math.abs(E)>0&&Math.abs(S)<Math.abs(E)){var U=Ce(S||E)*(Math.abs(E)-Math.abs(S));S+=U}}if(w==null||j==null||S==null||O==null||!i&&(S===0||O===0))return null;var te=M(M({},C),{},{stackedBarStart:k,x:w,y:j,width:S,height:O,value:u?P:P[1],payload:C,background:K,tooltipPosition:{x:w+S/2,y:j+O/2},parentViewBox:g,originalDataIndex:A},p&&p[A]&&p[A].props);return te}).filter(Boolean)}function qa(t){var e=bt(t,Ua),a=Pa(e.stackId),r=$e();return f.createElement(kt,{id:e.id,type:"bar"},i=>f.createElement(f.Fragment,null,f.createElement(It,{legendPayload:La(e)}),f.createElement(za,{dataKey:e.dataKey,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:i}),f.createElement(At,{type:"bar",id:i,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:a,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:r,hasCustomShape:e.shape!=null}),f.createElement(ye,{zIndex:e.zIndex},f.createElement(Ya,F({},e,{id:i})))))}var et=f.memo(qa,yt);et.displayName="Bar";var Ha=["axis","item"],Za=f.forwardRef((t,e)=>f.createElement(Rt,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ha,tooltipPayloadSearcher:Ft,categoricalChartProps:t,ref:e}));const tt=60*1e3,ce=60*tt,Ja=24*ce,at=25*ce;function he(t,e){if(t.length===0)return 0;const a=[...t].sort((i,n)=>i-n),r=Math.max(0,Math.min(a.length-1,Math.ceil(e*a.length)-1));return a[r]??0}function Qa(t,e){return e<=at?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function er(t,e){const a=e-t;return a<=ce?Math.max(1,Math.min(60,Math.ceil(a/tt))):a<=at?Math.max(1,Math.min(25,Math.ceil(a/ce))):Math.max(1,Math.min(31,Math.ceil(a/Ja)))}function tr(t,e,a,r){const i=e.getTime(),n=a.getTime(),c=Math.max(1,n-i),s=er(i,n),m=Math.max(1,Math.floor(c/s)),l=[];for(let o=0;o<s;o++){const u=new Date(i+o*m);l.push({t:u.toISOString(),ts:u.getTime(),label:Qa(u,c),calls:0,errors:0,durations:[]})}for(const o of t){const u=new Date(o.timestamp).getTime(),v=Math.floor((u-i)/m),x=Math.max(0,Math.min(s-1,v)),p=l[x];p&&(p.calls+=1,o.isError&&(p.errors+=1),Number.isFinite(o.durationMs)&&p.durations.push(o.durationMs))}return l.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((u,v)=>u+v,0)/o.durations.length:0),p50:Math.round(he(o.durations,.5)),p95:Math.round(he(o.durations,.95))}))}function lr(t,e,a,r,i){const n=r??t.length,c=i??t.filter(u=>u.isError).length,s=t.map(u=>u.durationMs),m=s.length>0?s.reduce((u,v)=>u+v,0)/s.length:0,l=he(s,.95),o=tr(t,e.startDate,e.endDate);return{totalCalls:n,totalErrors:c,avgDurationMs:m,p95DurationMs:l,data:o}}function ze(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Ke(t){const e=Ne.c(19),{active:a,payload:r,dataKey:i,colorVar:n}=t;if(!a||!r?.length)return null;const c=r[0],s=c?.payload?.t??"";let m;e[0]!==c?.payload?.label||e[1]!==s?(m=s?new Date(s).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):c?.payload?.label??"",e[0]=c?.payload?.label,e[1]=s,e[2]=m):m=e[2];const l=m,o=c?.value,u=typeof o=="number"?o:0,v=i==="avg"||i==="p50"||i==="p95",x=i==="costUsd";let p;e[3]!==x||e[4]!==v||e[5]!==u?(p=x?`$${u.toFixed(u<1?4:2)}`:v?u>=1e4?`${(u/1e3).toFixed(1)}s`:`${Math.round(u)}ms`:u.toLocaleString(),e[3]=x,e[4]=v,e[5]=u,e[6]=p):p=e[6];const g=p;let b;e[7]!==l?(b=I.jsx("div",{className:"text-[11px] text-muted-foreground mb-1",children:l}),e[7]=l,e[8]=b):b=e[8];let d;e[9]!==n?(d=I.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:n}}),e[9]=n,e[10]=d):d=e[10];let h;e[11]!==g?(h=I.jsx("span",{className:"text-xs font-medium tabular-nums",children:g}),e[11]=g,e[12]=h):h=e[12];let y;e[13]!==d||e[14]!==h?(y=I.jsxs("div",{className:"flex items-center gap-1.5",children:[d,h]}),e[13]=d,e[14]=h,e[15]=y):y=e[15];let k;return e[16]!==b||e[17]!==y?(k=I.jsxs("div",{className:"rounded-lg border bg-background px-3 py-2 shadow-md",children:[b,y]}),e[16]=b,e[17]=y,e[18]=k):k=e[18],k}function or(t){const e=Ne.c(85),{data:a,dataKey:r,colorNum:i,chartHeight:n,variant:c,ariaLabel:s}=t,m=c===void 0?"bar":c,l=`var(--chart-${i})`,o=`kpi-gradient-${r}-${i}`,u=Math.max(...a.map(B=>B[r]??0),0);if(m==="area"){let B;e[0]!==n?(B=Ie(n,"w-full"),e[0]=n,e[1]=B):B=e[1];let E;e[2]!==l||e[3]!==r?(E={label:r,color:l},e[2]=l,e[3]=r,e[4]=E):E=e[4];let D;e[5]!==r||e[6]!==E?(D={[r]:E},e[5]=r,e[6]=E,e[7]=D):D=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N={left:0,right:-12,top:8,bottom:8},e[8]=N):N=e[8];let _,L;e[9]!==l?(_=I.jsx("stop",{offset:"0%",stopColor:l,stopOpacity:.2}),L=I.jsx("stop",{offset:"100%",stopColor:l,stopOpacity:0}),e[9]=l,e[10]=_,e[11]=L):(_=e[10],L=e[11]);let z;e[12]!==o||e[13]!==_||e[14]!==L?(z=I.jsx("defs",{children:I.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[_,L]})}),e[12]=o,e[13]=_,e[14]=L,e[15]=z):z=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=I.jsx(je,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[16]=T):T=e[16];let W;e[17]===Symbol.for("react.memo_cache_sentinel")?(W=I.jsx(we,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),e[17]=W):W=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[18]=U):U=e[18];const te=u>0?"auto":10;let Y;e[19]!==te?(Y=I.jsx(Me,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ze,width:40,domain:[0,te],tickCount:5}),e[19]=te,e[20]=Y):Y=e[20];let re;e[21]===Symbol.for("react.memo_cache_sentinel")?(re={stroke:"var(--border)",strokeDasharray:"4 4"},e[21]=re):re=e[21];let X;e[22]!==l||e[23]!==r?(X=I.jsx(Ae,{cursor:re,content:rt=>{const{active:nt,payload:it}=rt;return I.jsx(Ke,{active:nt,payload:it,dataKey:r,colorVar:l})}}),e[22]=l,e[23]=r,e[24]=X):X=e[24];const de=`url(#${o})`;let q;e[25]!==l?(q={r:4,fill:l,stroke:"var(--background)",strokeWidth:2},e[25]=l,e[26]=q):q=e[26];let H;e[27]!==l||e[28]!==r||e[29]!==de||e[30]!==q?(H=I.jsx($t,{type:"linear",dataKey:r,stroke:l,strokeWidth:2,fill:de,animationDuration:300,dot:!1,activeDot:q}),e[27]=l,e[28]=r,e[29]=de,e[30]=q,e[31]=H):H=e[31];let Z;e[32]!==a||e[33]!==Y||e[34]!==X||e[35]!==H||e[36]!==z?(Z=I.jsxs(Wt,{data:a,margin:N,children:[z,T,W,Y,X,H]}),e[32]=a,e[33]=Y,e[34]=X,e[35]=H,e[36]=z,e[37]=Z):Z=e[37];let ne;return e[38]!==s||e[39]!==Z||e[40]!==B||e[41]!==D?(ne=I.jsx(Pe,{role:"img","aria-label":s,className:B,config:D,children:Z}),e[38]=s,e[39]=Z,e[40]=B,e[41]=D,e[42]=ne):ne=e[42],ne}let v;e[43]!==n?(v=Ie(n,"w-full"),e[43]=n,e[44]=v):v=e[44];let x;e[45]!==l||e[46]!==r?(x={label:r,color:l},e[45]=l,e[46]=r,e[47]=x):x=e[47];let p;e[48]!==r||e[49]!==x?(p={[r]:x},e[48]=r,e[49]=x,e[50]=p):p=e[50];let g,b;e[51]===Symbol.for("react.memo_cache_sentinel")?(g={left:0,right:-12,top:8,bottom:8},b=I.jsx(je,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[51]=g,e[52]=b):(g=e[51],b=e[52]);let d;e[53]===Symbol.for("react.memo_cache_sentinel")?(d={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[53]=d):d=e[53];const h=a.length<=6?0:Math.floor(a.length/6);let y;e[54]!==h?(y=I.jsx(we,{dataKey:"label",axisLine:!1,tickLine:!1,tick:d,interval:h,tickMargin:8}),e[54]=h,e[55]=y):y=e[55];let k;e[56]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[56]=k):k=e[56];const C=u>0?"auto":10;let A;e[57]!==C?(A=I.jsx(Me,{orientation:"right",axisLine:!1,tickLine:!1,tick:k,tickFormatter:ze,width:40,domain:[0,C],tickCount:5}),e[57]=C,e[58]=A):A=e[58];let P;e[59]===Symbol.for("react.memo_cache_sentinel")?(P={fill:"var(--muted)",opacity:.3},e[59]=P):P=e[59];let w;e[60]!==l||e[61]!==r?(w=I.jsx(Ae,{cursor:P,content:B=>{const{active:E,payload:D}=B;return I.jsx(Ke,{active:E,payload:D,dataKey:r,colorVar:l})}}),e[60]=l,e[61]=r,e[62]=w):w=e[62];let j;if(e[63]!==l||e[64]!==a||e[65]!==r){let B;e[67]!==l||e[68]!==r?(B=(E,D)=>I.jsx(be,{fill:(E[r]??0)===0?"var(--muted-foreground)":l,fillOpacity:(E[r]??0)===0?.15:.85},`cell-${D}`),e[67]=l,e[68]=r,e[69]=B):B=e[69],j=a.map(B),e[63]=l,e[64]=a,e[65]=r,e[66]=j}else j=e[66];let S;e[70]!==l||e[71]!==r||e[72]!==j?(S=I.jsx(et,{dataKey:r,fill:l,radius:0,minPointSize:1,children:j}),e[70]=l,e[71]=r,e[72]=j,e[73]=S):S=e[73];let O;e[74]!==a||e[75]!==A||e[76]!==w||e[77]!==S||e[78]!==y?(O=I.jsxs(Za,{data:a,margin:g,children:[b,y,A,w,S]}),e[74]=a,e[75]=A,e[76]=w,e[77]=S,e[78]=y,e[79]=O):O=e[79];let K;return e[80]!==s||e[81]!==O||e[82]!==v||e[83]!==p?(K=I.jsx(Pe,{role:"img","aria-label":s,className:v,config:p,children:O}),e[80]=s,e[81]=O,e[82]=v,e[83]=p,e[84]=K):K=e[84],K}export{Za as B,be as C,or as K,et as a,lr as c};
1
+ import{r as f,eV as lt,c as Ne,l as Ie,j as I}from"./index-CVJEcf37.js";import{c as Ae,b as Pe}from"./chart-DqNrc8dZ.js";import{a2 as xe,a3 as ot,a4 as st,a5 as ct,a6 as ut,E as ue,_ as fe,a7 as ve,a8 as dt,P as Se,b as $,a9 as ft,aa as vt,s as ee,ab as mt,ac as G,e as J,ad as V,f as Q,h as Te,g as Re,ae as Fe,af as pt,ag as ht,ah as Ee,ai as xt,aj as Oe,ak as gt,L as le,p as yt,r as bt,D as ge,u as $e,R as kt,S as It,j as At,Z as ye,k as We,l as Pt,n as St,m as Et,q as Ot,al as Bt,t as oe,z as Ge,G as Ct,am as jt,an as wt,ao as Be,ap as Ve,aq as Mt,ar as Ue,F as Dt,J as _t,H as R,I as Lt,K as zt,N as Kt,as as Nt,at as Tt,$ as Ce,au as Rt,av as Ft,C as je,X as we,Y as Me,A as $t,a as Wt}from"./AreaChart-CxCPUfZu.js";import{a as Gt,S as Vt}from"./ErrorBarContext-D7xML5iT.js";var Ut="Invariant failed";function Yt(t,e){throw new Error(Ut)}var be=t=>null;be.displayName="Cell";var Ye=(t,e,a)=>{var r=xe();return(i,n)=>c=>{t?.(i,n,c),r(ot({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:a}))}},Xe=t=>{var e=xe();return(a,r)=>i=>{t?.(a,r,i),e(st())}},qe=(t,e,a)=>{var r=xe();return(i,n)=>c=>{t?.(i,n,c),r(ct({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:a}))}},De=(t,e,a)=>{var r=a??t;if(!ue(r))return fe(r,e,0)},Xt=(t,e,a)=>{var r={},i=t.filter(ut),n=t.filter(l=>l.stackId==null),c=i.reduce((l,o)=>{var u=l[o.stackId];return u==null&&(u=[]),u.push(o),l[o.stackId]=u,l},r),s=Object.entries(c).map(l=>{var o,[u,v]=l,x=v.map(g=>g.dataKey),p=De(e,a,(o=v[0])===null||o===void 0?void 0:o.barSize);return{stackId:u,dataKeys:x,barSize:p}}),m=n.map(l=>{var o=[l.dataKey].filter(v=>v!=null),u=De(e,a,l.barSize);return{stackId:void 0,dataKeys:o,barSize:u}});return[...s,...m]};function _e(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,r)}return a}function ie(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?_e(Object(a),!0).forEach(function(r){qt(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_e(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function qt(t,e,a){return(e=Ht(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Ht(t){var e=Zt(t,"string");return typeof e=="symbol"?e:e+""}function Zt(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jt(t,e,a,r,i){var n,c=r.length;if(!(c<1)){var s=fe(t,a,0,!0),m,l=[];if(ve((n=r[0])===null||n===void 0?void 0:n.barSize)){var o=!1,u=a/c,v=r.reduce((h,y)=>h+(y.barSize||0),0);v+=(c-1)*s,v>=a&&(v-=(c-1)*s,s=0),v>=a&&u>0&&(o=!0,u*=.9,v=c*u);var x=(a-v)/2>>0,p={offset:x-s,size:0};m=r.reduce((h,y)=>{var k,C={stackId:y.stackId,dataKeys:y.dataKeys,position:{offset:p.offset+p.size+s,size:o?u:(k=y.barSize)!==null&&k!==void 0?k:0}},A=[...h,C];return p=C.position,A},l)}else{var g=fe(e,a,0,!0);a-2*g-(c-1)*s<=0&&(s=0);var b=(a-2*g-(c-1)*s)/c;b>1&&(b>>=0);var d=ve(i)?Math.min(b,i):b;m=r.reduce((h,y,k)=>[...h,{stackId:y.stackId,dataKeys:y.dataKeys,position:{offset:g+(b+s)*k+(b-d)/2,size:d}}],l)}return m}}var Qt=(t,e,a,r,i,n,c)=>{var s=ue(c)?e:c,m=Jt(a,r,i!==n?i:n,t,s);return i!==n&&m!=null&&(m=m.map(l=>ie(ie({},l),{},{position:ie(ie({},l.position),{},{offset:l.position.offset-i/2})}))),m},ea=(t,e)=>{var a=dt(e);if(!(!t||a==null||e==null)){var{stackId:r}=e;if(r!=null){var i=t[r];if(i){var{stackedData:n}=i;if(n)return n.find(c=>c.key===a)}}}},ta=(t,e)=>{if(!(t==null||e==null)){var a=t.find(r=>r.stackId===e.stackId&&e.dataKey!=null&&r.dataKeys.includes(e.dataKey));if(a!=null)return a.position}};function aa(t,e){return t&&typeof t=="object"&&"zIndex"in t&&typeof t.zIndex=="number"&&ve(t.zIndex)?t.zIndex:e}function me(){return me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},me.apply(null,arguments)}function ke(t){return f.createElement(Gt,me({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},t))}var ra=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Se(e))return e;var n=Se(r)||ue(r);return n?e(r,i):(n||Yt(),a)}},na=(t,e,a)=>a,ia=(t,e)=>e,ae=$([Re,ia],(t,e)=>t.filter(a=>a.type==="bar").find(a=>a.id===e)),la=$([ae],t=>t?.maxBarSize),oa=(t,e,a,r)=>r,sa=$([ee,Re,G,V,na],(t,e,a,r,i)=>e.filter(n=>t==="horizontal"?n.xAxisId===a:n.yAxisId===r).filter(n=>n.isPanorama===i).filter(n=>n.hide===!1).filter(n=>n.type==="bar")),ca=(t,e,a)=>{var r=ee(t),i=G(t,e),n=V(t,e);if(!(i==null||n==null))return r==="horizontal"?Ee(t,"yAxis",n,a):Ee(t,"xAxis",i,a)},ua=(t,e)=>{var a=ee(t),r=G(t,e),i=V(t,e);if(!(r==null||i==null))return a==="horizontal"?Oe(t,"xAxis",r):Oe(t,"yAxis",i)},da=$([sa,xt,ua],Xt),fa=(t,e,a)=>{var r,i,n=ae(t,e);if(n==null)return 0;var c=G(t,e),s=V(t,e);if(c==null||s==null)return 0;var m=ee(t),l=Fe(t),{maxBarSize:o}=n,u=ue(o)?l:o,v,x;return m==="horizontal"?(v=J(t,"xAxis",c,a),x=Q(t,"xAxis",c,a)):(v=J(t,"yAxis",s,a),x=Q(t,"yAxis",s,a)),(r=(i=Te(v,x,!0))!==null&&i!==void 0?i:u)!==null&&r!==void 0?r:0},He=(t,e,a)=>{var r=ee(t),i=G(t,e),n=V(t,e);if(!(i==null||n==null)){var c,s;return r==="horizontal"?(c=J(t,"xAxis",i,a),s=Q(t,"xAxis",i,a)):(c=J(t,"yAxis",n,a),s=Q(t,"yAxis",n,a)),Te(c,s)}},va=$([da,Fe,pt,ht,fa,He,la],Qt),ma=(t,e,a)=>{var r=G(t,e);if(r!=null)return J(t,"xAxis",r,a)},pa=(t,e,a)=>{var r=V(t,e);if(r!=null)return J(t,"yAxis",r,a)},ha=(t,e,a)=>{var r=G(t,e);if(r!=null)return Q(t,"xAxis",r,a)},xa=(t,e,a)=>{var r=V(t,e);if(r!=null)return Q(t,"yAxis",r,a)},ga=$([va,ae],ta),ya=$([ca,ae],ea),ba=$([ft,vt,ma,pa,ha,xa,ga,ee,mt,He,ya,ae,oa],(t,e,a,r,i,n,c,s,m,l,o,u,v)=>{var{chartData:x,dataStartIndex:p,dataEndIndex:g}=m;if(!(u==null||c==null||e==null||s!=="horizontal"&&s!=="vertical"||a==null||r==null||i==null||n==null||l==null)){var{data:b}=u,d;if(b!=null&&b.length>0?d=b:d=x?.slice(p,g+1),d!=null)return Xa({layout:s,barSettings:u,pos:c,parentViewBox:e,bandSize:l,xAxis:a,yAxis:r,xAxisTicks:i,yAxisTicks:n,stackedData:o,displayedData:d,offset:t,cells:v,dataStartIndex:p})}}),ka=["index"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},pe.apply(null,arguments)}function Ia(t,e){if(t==null)return{};var a,r,i=Aa(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)a=n[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(i[a]=t[a])}return i}function Aa(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var Ze=f.createContext(void 0),Pa=t=>{var e=f.useContext(Ze);if(e!=null)return e.stackId;if(t!=null)return gt(t)},Sa=(t,e)=>"recharts-bar-stack-clip-path-".concat(t,"-").concat(e),Ea=t=>{var e=f.useContext(Ze);if(e!=null){var{stackId:a}=e;return"url(#".concat(Sa(a,t),")")}},Je=t=>{var{index:e}=t,a=Ia(t,ka),r=Ea(e);return f.createElement(le,pe({className:"recharts-bar-stack-layer",clipPath:r},a))},Oa=["onMouseEnter","onMouseLeave","onClick"],Ba=["value","background","tooltipPosition"],Ca=["id"],ja=["onMouseEnter","onClick","onMouseLeave"];function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},F.apply(null,arguments)}function Le(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,r)}return a}function M(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Le(Object(a),!0).forEach(function(r){wa(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Le(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function wa(t,e,a){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Ma(t){var e=Da(t,"string");return typeof e=="symbol"?e:e+""}function Da(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function se(t,e){if(t==null)return{};var a,r,i=_a(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)a=n[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(i[a]=t[a])}return i}function _a(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var La=t=>{var{dataKey:e,name:a,fill:r,legendType:i,hide:n}=t;return[{inactive:n,dataKey:e,type:i,color:r,value:We(a,e),payload:t}]},za=f.memo(t=>{var{dataKey:e,stroke:a,strokeWidth:r,fill:i,name:n,hide:c,unit:s,tooltipType:m,id:l}=t,o={dataDefinedOnItem:void 0,getPosition:St,settings:{stroke:a,strokeWidth:r,fill:i,dataKey:e,nameKey:void 0,name:We(n,e),hide:c,type:m,color:i,unit:s,graphicalItemId:l}};return f.createElement(Pt,{tooltipEntrySettings:o})});function Ka(t){var e=oe(Ve),{data:a,dataKey:r,background:i,allOtherBarProps:n}=t,{onMouseEnter:c,onMouseLeave:s,onClick:m}=n,l=se(n,Oa),o=Ye(c,r,n.id),u=Xe(s),v=qe(m,r,n.id);if(!i||a==null)return null;var x=Mt(i);return f.createElement(ye,{zIndex:aa(i,ge.barBackground)},a.map((p,g)=>{var{value:b,background:d,tooltipPosition:h}=p,y=se(p,Ba);if(!d)return null;var k=o(p,g),C=u(p,g),A=v(p,g),P=M(M(M(M(M({option:i,isActive:String(g)===e},y),{},{fill:"#eee"},d),x),Ue(l,p,g)),{},{onMouseEnter:k,onMouseLeave:C,onClick:A,dataKey:r,index:g,className:"recharts-bar-background-rectangle"});return f.createElement(ke,F({key:"background-bar-".concat(g)},P))}))}function Na(t){var{showLabels:e,children:a,rects:r}=t,i=r?.map(n=>{var c={x:n.x,y:n.y,width:n.width,lowerWidth:n.width,upperWidth:n.width,height:n.height};return M(M({},c),{},{value:n.value,payload:n.payload,parentViewBox:n.parentViewBox,viewBox:c,fill:n.fill})});return f.createElement(zt,{value:e?i:void 0},a)}function Ta(t){var{shape:e,activeBar:a,baseProps:r,entry:i,index:n,dataKey:c}=t,s=oe(Ve),m=oe(Nt),l=a&&String(i.originalDataIndex)===s&&(m==null||c===m),[o,u]=f.useState(!1),[v,x]=f.useState(!1);f.useEffect(()=>{var y;return l?(u(!0),y=requestAnimationFrame(()=>{x(!0)})):x(!1),()=>{cancelAnimationFrame(y)}},[l]);var p=f.useCallback(()=>{l||u(!1)},[l]),g=l&&v,b=l||o,d;l?a===!0?d=e:d=a:d=e;var h=f.createElement(ke,F({},r,{name:String(r.name)},i,{isActive:g,option:d,index:n,dataKey:c,onTransitionEnd:p}));return b?f.createElement(ye,{zIndex:ge.activeBar},f.createElement(Je,{index:i.originalDataIndex},h)):h}function Ra(t){var{shape:e,baseProps:a,entry:r,index:i,dataKey:n}=t;return f.createElement(ke,F({},a,{name:String(a.name)},r,{isActive:!1,option:e,index:i,dataKey:n}))}function Fa(t){var e,{data:a,props:r}=t,i=(e=Kt(r))!==null&&e!==void 0?e:{},{id:n}=i,c=se(i,Ca),{shape:s,dataKey:m,activeBar:l}=r,{onMouseEnter:o,onClick:u,onMouseLeave:v}=r,x=se(r,ja),p=Ye(o,m,n),g=Xe(v),b=qe(u,m,n);return a?f.createElement(f.Fragment,null,a.map((d,h)=>f.createElement(Je,F({index:d.originalDataIndex,key:"rectangle-".concat(d?.x,"-").concat(d?.y,"-").concat(d?.value,"-").concat(h),className:"recharts-bar-rectangle"},Ue(x,d,h),{onMouseEnter:p(d,h),onMouseLeave:g(d,h),onClick:b(d,h)}),l?f.createElement(Ta,{shape:s,activeBar:l,baseProps:c,entry:d,index:h,dataKey:m}):f.createElement(Ra,{shape:s,baseProps:c,entry:d,index:h,dataKey:m})))):null}function $a(t){var{props:e,previousRectanglesRef:a}=t,{data:r,layout:i,isAnimationActive:n,animationBegin:c,animationDuration:s,animationEasing:m,onAnimationEnd:l,onAnimationStart:o}=e,u=a.current,v=Dt(e,"recharts-bar-"),[x,p]=f.useState(!1),g=!x,b=f.useCallback(()=>{typeof l=="function"&&l(),p(!1)},[l]),d=f.useCallback(()=>{typeof o=="function"&&o(),p(!0)},[o]);return f.createElement(Na,{showLabels:g,rects:r},f.createElement(_t,{animationId:v,begin:c,duration:s,isActive:n,easing:m,onAnimationEnd:b,onAnimationStart:d,key:v},h=>{var y=h===1?r:r?.map((k,C)=>{var A=u&&u[C];if(A)return M(M({},k),{},{x:R(A.x,k.x,h),y:R(A.y,k.y,h),width:R(A.width,k.width,h),height:R(A.height,k.height,h)});if(i==="horizontal"){var P=R(0,k.height,h),w=R(k.stackedBarStart,k.y,h);return M(M({},k),{},{y:w,height:P})}var j=R(0,k.width,h),S=R(k.stackedBarStart,k.x,h);return M(M({},k),{},{width:j,x:S})});return h>0&&(a.current=y??null),y==null?null:f.createElement(le,null,f.createElement(Fa,{props:e,data:y}))}),f.createElement(Lt,{label:e.label}),e.children)}function Wa(t){var e=f.useRef(null);return f.createElement($a,{previousRectanglesRef:e,props:t})}var Qe=0,Ga=(t,e)=>{var a=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:a,errorVal:Ge(t,e)}};class Va extends f.PureComponent{render(){var{hide:e,data:a,dataKey:r,className:i,xAxisId:n,yAxisId:c,needClip:s,background:m,id:l}=this.props;if(e||a==null)return null;var o=lt("recharts-bar",i),u=l;return f.createElement(le,{className:o,id:l},s&&f.createElement("defs",null,f.createElement(Ct,{clipPathId:u,xAxisId:n,yAxisId:c})),f.createElement(le,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(u,")"):void 0},f.createElement(Ka,{data:a,dataKey:r,background:m,allOtherBarProps:this.props}),f.createElement(Wa,this.props)))}}var Ua={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:Qe,xAxisId:0,yAxisId:0,zIndex:ge.bar};function Ya(t){var{xAxisId:e,yAxisId:a,hide:r,legendType:i,minPointSize:n,activeBar:c,animationBegin:s,animationDuration:m,animationEasing:l,isAnimationActive:o}=t,{needClip:u}=Et(e,a),v=Ot(),x=$e(),p=Bt(t.children,be),g=oe(h=>ba(h,t.id,x,p));if(v!=="vertical"&&v!=="horizontal")return null;var b,d=g?.[0];return d==null||d.height==null||d.width==null?b=0:b=v==="vertical"?d.height/2:d.width/2,f.createElement(Vt,{xAxisId:e,yAxisId:a,data:g,dataPointFormatter:Ga,errorBarOffset:b},f.createElement(Va,F({},t,{layout:v,needClip:u,data:g,xAxisId:e,yAxisId:a,hide:r,legendType:i,minPointSize:n,activeBar:c,animationBegin:s,animationDuration:m,animationEasing:l,isAnimationActive:o})))}function Xa(t){var{layout:e,barSettings:{dataKey:a,minPointSize:r,hasCustomShape:i},pos:n,bandSize:c,xAxis:s,yAxis:m,xAxisTicks:l,yAxisTicks:o,stackedData:u,displayedData:v,offset:x,cells:p,parentViewBox:g,dataStartIndex:b}=t,d=e==="horizontal"?m:s,h=u?d.scale.domain():null,y=jt({numericAxis:d}),k=d.scale.map(y);return v.map((C,A)=>{var P,w,j,S,O,K;if(u){var B=u[A+b];if(B==null)return null;P=wt(B,h)}else P=Ge(C,a),Array.isArray(P)||(P=[y,P]);var E=ra(r,Qe)(P[1],A);if(e==="horizontal"){var D,N=m.scale.map(P[0]),_=m.scale.map(P[1]);if(N==null||_==null)return null;w=Be({axis:s,ticks:l,bandSize:c,offset:n.offset,entry:C,index:A}),j=(D=_??N)!==null&&D!==void 0?D:void 0,S=n.size;var L=N-_;if(O=Tt(L)?0:L,K={x:w,y:x.top,width:S,height:x.height},Math.abs(E)>0&&Math.abs(O)<Math.abs(E)){var z=Ce(O||E)*(Math.abs(E)-Math.abs(O));j-=z,O+=z}}else{var T=s.scale.map(P[0]),W=s.scale.map(P[1]);if(T==null||W==null)return null;if(w=T,j=Be({axis:m,ticks:o,bandSize:c,offset:n.offset,entry:C,index:A}),S=W-T,O=n.size,K={x:x.left,y:j,width:x.width,height:O},Math.abs(E)>0&&Math.abs(S)<Math.abs(E)){var U=Ce(S||E)*(Math.abs(E)-Math.abs(S));S+=U}}if(w==null||j==null||S==null||O==null||!i&&(S===0||O===0))return null;var te=M(M({},C),{},{stackedBarStart:k,x:w,y:j,width:S,height:O,value:u?P:P[1],payload:C,background:K,tooltipPosition:{x:w+S/2,y:j+O/2},parentViewBox:g,originalDataIndex:A},p&&p[A]&&p[A].props);return te}).filter(Boolean)}function qa(t){var e=bt(t,Ua),a=Pa(e.stackId),r=$e();return f.createElement(kt,{id:e.id,type:"bar"},i=>f.createElement(f.Fragment,null,f.createElement(It,{legendPayload:La(e)}),f.createElement(za,{dataKey:e.dataKey,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:i}),f.createElement(At,{type:"bar",id:i,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:a,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:r,hasCustomShape:e.shape!=null}),f.createElement(ye,{zIndex:e.zIndex},f.createElement(Ya,F({},e,{id:i})))))}var et=f.memo(qa,yt);et.displayName="Bar";var Ha=["axis","item"],Za=f.forwardRef((t,e)=>f.createElement(Rt,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ha,tooltipPayloadSearcher:Ft,categoricalChartProps:t,ref:e}));const tt=60*1e3,ce=60*tt,Ja=24*ce,at=25*ce;function he(t,e){if(t.length===0)return 0;const a=[...t].sort((i,n)=>i-n),r=Math.max(0,Math.min(a.length-1,Math.ceil(e*a.length)-1));return a[r]??0}function Qa(t,e){return e<=at?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function er(t,e){const a=e-t;return a<=ce?Math.max(1,Math.min(60,Math.ceil(a/tt))):a<=at?Math.max(1,Math.min(25,Math.ceil(a/ce))):Math.max(1,Math.min(31,Math.ceil(a/Ja)))}function tr(t,e,a,r){const i=e.getTime(),n=a.getTime(),c=Math.max(1,n-i),s=er(i,n),m=Math.max(1,Math.floor(c/s)),l=[];for(let o=0;o<s;o++){const u=new Date(i+o*m);l.push({t:u.toISOString(),ts:u.getTime(),label:Qa(u,c),calls:0,errors:0,durations:[]})}for(const o of t){const u=new Date(o.timestamp).getTime(),v=Math.floor((u-i)/m),x=Math.max(0,Math.min(s-1,v)),p=l[x];p&&(p.calls+=1,o.isError&&(p.errors+=1),Number.isFinite(o.durationMs)&&p.durations.push(o.durationMs))}return l.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((u,v)=>u+v,0)/o.durations.length:0),p50:Math.round(he(o.durations,.5)),p95:Math.round(he(o.durations,.95))}))}function lr(t,e,a,r,i){const n=r??t.length,c=i??t.filter(u=>u.isError).length,s=t.map(u=>u.durationMs),m=s.length>0?s.reduce((u,v)=>u+v,0)/s.length:0,l=he(s,.95),o=tr(t,e.startDate,e.endDate);return{totalCalls:n,totalErrors:c,avgDurationMs:m,p95DurationMs:l,data:o}}function ze(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Ke(t){const e=Ne.c(19),{active:a,payload:r,dataKey:i,colorVar:n}=t;if(!a||!r?.length)return null;const c=r[0],s=c?.payload?.t??"";let m;e[0]!==c?.payload?.label||e[1]!==s?(m=s?new Date(s).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):c?.payload?.label??"",e[0]=c?.payload?.label,e[1]=s,e[2]=m):m=e[2];const l=m,o=c?.value,u=typeof o=="number"?o:0,v=i==="avg"||i==="p50"||i==="p95",x=i==="costUsd";let p;e[3]!==x||e[4]!==v||e[5]!==u?(p=x?`$${u.toFixed(u<1?4:2)}`:v?u>=1e4?`${(u/1e3).toFixed(1)}s`:`${Math.round(u)}ms`:u.toLocaleString(),e[3]=x,e[4]=v,e[5]=u,e[6]=p):p=e[6];const g=p;let b;e[7]!==l?(b=I.jsx("div",{className:"text-[11px] text-muted-foreground mb-1",children:l}),e[7]=l,e[8]=b):b=e[8];let d;e[9]!==n?(d=I.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:n}}),e[9]=n,e[10]=d):d=e[10];let h;e[11]!==g?(h=I.jsx("span",{className:"text-xs font-medium tabular-nums",children:g}),e[11]=g,e[12]=h):h=e[12];let y;e[13]!==d||e[14]!==h?(y=I.jsxs("div",{className:"flex items-center gap-1.5",children:[d,h]}),e[13]=d,e[14]=h,e[15]=y):y=e[15];let k;return e[16]!==b||e[17]!==y?(k=I.jsxs("div",{className:"rounded-lg border bg-background px-3 py-2 shadow-md",children:[b,y]}),e[16]=b,e[17]=y,e[18]=k):k=e[18],k}function or(t){const e=Ne.c(85),{data:a,dataKey:r,colorNum:i,chartHeight:n,variant:c,ariaLabel:s}=t,m=c===void 0?"bar":c,l=`var(--chart-${i})`,o=`kpi-gradient-${r}-${i}`,u=Math.max(...a.map(B=>B[r]??0),0);if(m==="area"){let B;e[0]!==n?(B=Ie(n,"w-full"),e[0]=n,e[1]=B):B=e[1];let E;e[2]!==l||e[3]!==r?(E={label:r,color:l},e[2]=l,e[3]=r,e[4]=E):E=e[4];let D;e[5]!==r||e[6]!==E?(D={[r]:E},e[5]=r,e[6]=E,e[7]=D):D=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N={left:0,right:-12,top:8,bottom:8},e[8]=N):N=e[8];let _,L;e[9]!==l?(_=I.jsx("stop",{offset:"0%",stopColor:l,stopOpacity:.2}),L=I.jsx("stop",{offset:"100%",stopColor:l,stopOpacity:0}),e[9]=l,e[10]=_,e[11]=L):(_=e[10],L=e[11]);let z;e[12]!==o||e[13]!==_||e[14]!==L?(z=I.jsx("defs",{children:I.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[_,L]})}),e[12]=o,e[13]=_,e[14]=L,e[15]=z):z=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=I.jsx(je,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[16]=T):T=e[16];let W;e[17]===Symbol.for("react.memo_cache_sentinel")?(W=I.jsx(we,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),e[17]=W):W=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[18]=U):U=e[18];const te=u>0?"auto":10;let Y;e[19]!==te?(Y=I.jsx(Me,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ze,width:40,domain:[0,te],tickCount:5}),e[19]=te,e[20]=Y):Y=e[20];let re;e[21]===Symbol.for("react.memo_cache_sentinel")?(re={stroke:"var(--border)",strokeDasharray:"4 4"},e[21]=re):re=e[21];let X;e[22]!==l||e[23]!==r?(X=I.jsx(Ae,{cursor:re,content:rt=>{const{active:nt,payload:it}=rt;return I.jsx(Ke,{active:nt,payload:it,dataKey:r,colorVar:l})}}),e[22]=l,e[23]=r,e[24]=X):X=e[24];const de=`url(#${o})`;let q;e[25]!==l?(q={r:4,fill:l,stroke:"var(--background)",strokeWidth:2},e[25]=l,e[26]=q):q=e[26];let H;e[27]!==l||e[28]!==r||e[29]!==de||e[30]!==q?(H=I.jsx($t,{type:"linear",dataKey:r,stroke:l,strokeWidth:2,fill:de,animationDuration:300,dot:!1,activeDot:q}),e[27]=l,e[28]=r,e[29]=de,e[30]=q,e[31]=H):H=e[31];let Z;e[32]!==a||e[33]!==Y||e[34]!==X||e[35]!==H||e[36]!==z?(Z=I.jsxs(Wt,{data:a,margin:N,children:[z,T,W,Y,X,H]}),e[32]=a,e[33]=Y,e[34]=X,e[35]=H,e[36]=z,e[37]=Z):Z=e[37];let ne;return e[38]!==s||e[39]!==Z||e[40]!==B||e[41]!==D?(ne=I.jsx(Pe,{role:"img","aria-label":s,className:B,config:D,children:Z}),e[38]=s,e[39]=Z,e[40]=B,e[41]=D,e[42]=ne):ne=e[42],ne}let v;e[43]!==n?(v=Ie(n,"w-full"),e[43]=n,e[44]=v):v=e[44];let x;e[45]!==l||e[46]!==r?(x={label:r,color:l},e[45]=l,e[46]=r,e[47]=x):x=e[47];let p;e[48]!==r||e[49]!==x?(p={[r]:x},e[48]=r,e[49]=x,e[50]=p):p=e[50];let g,b;e[51]===Symbol.for("react.memo_cache_sentinel")?(g={left:0,right:-12,top:8,bottom:8},b=I.jsx(je,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[51]=g,e[52]=b):(g=e[51],b=e[52]);let d;e[53]===Symbol.for("react.memo_cache_sentinel")?(d={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[53]=d):d=e[53];const h=a.length<=6?0:Math.floor(a.length/6);let y;e[54]!==h?(y=I.jsx(we,{dataKey:"label",axisLine:!1,tickLine:!1,tick:d,interval:h,tickMargin:8}),e[54]=h,e[55]=y):y=e[55];let k;e[56]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[56]=k):k=e[56];const C=u>0?"auto":10;let A;e[57]!==C?(A=I.jsx(Me,{orientation:"right",axisLine:!1,tickLine:!1,tick:k,tickFormatter:ze,width:40,domain:[0,C],tickCount:5}),e[57]=C,e[58]=A):A=e[58];let P;e[59]===Symbol.for("react.memo_cache_sentinel")?(P={fill:"var(--muted)",opacity:.3},e[59]=P):P=e[59];let w;e[60]!==l||e[61]!==r?(w=I.jsx(Ae,{cursor:P,content:B=>{const{active:E,payload:D}=B;return I.jsx(Ke,{active:E,payload:D,dataKey:r,colorVar:l})}}),e[60]=l,e[61]=r,e[62]=w):w=e[62];let j;if(e[63]!==l||e[64]!==a||e[65]!==r){let B;e[67]!==l||e[68]!==r?(B=(E,D)=>I.jsx(be,{fill:(E[r]??0)===0?"var(--muted-foreground)":l,fillOpacity:(E[r]??0)===0?.15:.85},`cell-${D}`),e[67]=l,e[68]=r,e[69]=B):B=e[69],j=a.map(B),e[63]=l,e[64]=a,e[65]=r,e[66]=j}else j=e[66];let S;e[70]!==l||e[71]!==r||e[72]!==j?(S=I.jsx(et,{dataKey:r,fill:l,radius:0,minPointSize:1,children:j}),e[70]=l,e[71]=r,e[72]=j,e[73]=S):S=e[73];let O;e[74]!==a||e[75]!==A||e[76]!==w||e[77]!==S||e[78]!==y?(O=I.jsxs(Za,{data:a,margin:g,children:[b,y,A,w,S]}),e[74]=a,e[75]=A,e[76]=w,e[77]=S,e[78]=y,e[79]=O):O=e[79];let K;return e[80]!==s||e[81]!==O||e[82]!==v||e[83]!==p?(K=I.jsx(Pe,{role:"img","aria-label":s,className:v,config:p,children:O}),e[80]=s,e[81]=O,e[82]=v,e[83]=p,e[84]=K):K=e[84],K}export{Za as B,be as C,or as K,et as a,lr as c};
@@ -1 +1 @@
1
- import{c as he,r as te,l as xe,j as t,B as pe}from"./index-gctAQu2T.js";import{B as ce}from"./badge-DJ5ezE5-.js";import{C as de}from"./checkbox-DwVdLA7e.js";import{t as me}from"./ChevronUp-Cp-tcsrs.js";import{d as ge,e as ve,a as ue,b as je,C as Ce,c as be}from"./command-cJVGaRa3.js";import{a as Ne,b as ye,P as we}from"./popover-BfKN_4aI.js";function Ke(o){const e=he.c(74),{options:n,onValueChange:i,defaultValue:P,placeholder:se,variant:le,animation:ae,maxCount:ne,modalPopover:ie,asChild:oe,className:G,disabled:re,onSearchChange:V}=o;let _;e[0]!==P?(_=P===void 0?[]:P,e[0]=P,e[1]=_):_=e[1];const d=_,L=se===void 0?"Select items":se,E=le===void 0?"default":le,O=ae===void 0?0:ae,k=ne===void 0?3:ne,q=ie===void 0?!1:ie,H=oe===void 0?!1:oe,Q=re===void 0?!1:re,[s,S]=te.useState(d),[U,B]=te.useState(!1);let D,I;e[2]!==d||e[3]!==s?(D=()=>{JSON.stringify(s)!==JSON.stringify(d)&&S(d)},I=[d,s],e[2]=d,e[3]=s,e[4]=D,e[5]=I):(D=e[4],I=e[5]),te.useEffect(D,I);let K;e[6]!==i||e[7]!==s?(K=l=>{if(l.key==="Enter")B(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const a=[...s];a.pop(),S(a),i(a)}},e[6]=i,e[7]=s,e[8]=K):K=e[8];const W=K;let T;e[9]!==i||e[10]!==s?(T=l=>{const a=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];S(a),i(a)},e[9]=i,e[10]=s,e[11]=T):T=e[11];const c=T;let $;e[12]!==i?($=()=>{S([]),i([])},e[12]=i,e[13]=$):$=e[13];const X=$;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{B(Ve)},e[14]=z):z=e[14];const fe=z;let A;e[15]!==X||e[16]!==i||e[17]!==n||e[18]!==s.length?(A=()=>{if(s.length===n.length)X();else{const l=n.map(Pe);S(l),i(l)}},e[15]=X,e[16]=i,e[17]=n,e[18]=s.length,e[19]=A):A=e[19];const r=A;let m;e[20]!==H?(m=H?{}:{variant:"outline"},e[20]=H,e[21]=m):m=e[21];let u;e[22]!==G?(u=xe("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",G),e[22]=G,e[23]=u):u=e[23];let f;e[24]!==O||e[25]!==k||e[26]!==n||e[27]!==L||e[28]!==s||e[29]!==E?(f=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const a=n.find(ee=>ee.value===l),w=a?.icon;return t.jsxs(ce,{variant:E==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${O}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:a?.label})]},l)}),s.length>k&&t.jsxs(ce,{variant:E==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${O}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(me,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:L}),t.jsx(me,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=O,e[25]=k,e[26]=n,e[27]=L,e[28]=s,e[29]=E,e[30]=f):f=e[30];let h;e[31]!==Q||e[32]!==m||e[33]!==u||e[34]!==f?(h=t.jsx(Ne,{asChild:!0,children:t.jsx(pe,{ref:null,...m,onClick:fe,className:u,disabled:Q,children:f})}),e[31]=Q,e[32]=m,e[33]=u,e[34]=f,e[35]=h):h=e[35];let J;e[36]===Symbol.for("react.memo_cache_sentinel")?(J=()=>B(!1),e[36]=J):J=e[36];const Y=!V;let x;e[37]!==W||e[38]!==V?(x=t.jsx(ge,{placeholder:"Search...",onKeyDown:W,onValueChange:V,className:"rounded-t-xl"}),e[37]=W,e[38]=V,e[39]=x):x=e[39];let M;e[40]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ve,{children:"No results found."}),e[40]=M):M=e[40];let p;e[41]!==r?(p=()=>{r()},e[41]=r,e[42]=p):p=e[42];let g;e[43]!==r?(g=l=>{l.stopPropagation(),r()},e[43]=r,e[44]=g):g=e[44];const Z=s.length===n.length&&n.length>0;let v;e[45]!==Z||e[46]!==r?(v=t.jsx(de,{checked:Z,onCheckedChange:r,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Se}),e[45]=Z,e[46]=r,e[47]=v):v=e[47];let R;e[48]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("span",{children:"(Select All)"}),e[48]=R):R=e[48];let j;e[49]!==g||e[50]!==v?(j=t.jsxs("div",{className:"flex items-center w-full",onClick:g,children:[v,R]}),e[49]=g,e[50]=v,e[51]=j):j=e[51];let C;e[52]!==p||e[53]!==j?(C=t.jsx(ue,{onSelect:p,className:"cursor-pointer",children:j},"all"),e[52]=p,e[53]=j,e[54]=C):C=e[54];let b;if(e[55]!==n||e[56]!==s||e[57]!==c){let l;e[59]!==s||e[60]!==c?(l=a=>{const w=s.includes(a.value);return t.jsx(ue,{onSelect:()=>{c(a)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:ee=>{ee.stopPropagation(),c(a)},children:[t.jsx(de,{checked:w,onCheckedChange:()=>{c(a)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:ke}),a.icon&&t.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:a.label})]})},a.value)},e[59]=s,e[60]=c,e[61]=l):l=e[61],b=n.map(l),e[55]=n,e[56]=s,e[57]=c,e[58]=b}else b=e[58];let N;e[62]!==C||e[63]!==b?(N=t.jsxs(je,{className:"rounded-b-xl",children:[M,t.jsxs(Ce,{children:[C,b]})]}),e[62]=C,e[63]=b,e[64]=N):N=e[64];let y;e[65]!==Y||e[66]!==x||e[67]!==N?(y=t.jsx(ye,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:J,children:t.jsxs(be,{shouldFilter:Y,className:"rounded-xl",children:[x,N]})}),e[65]=Y,e[66]=x,e[67]=N,e[68]=y):y=e[68];let F;return e[69]!==U||e[70]!==q||e[71]!==h||e[72]!==y?(F=t.jsxs(we,{open:U,onOpenChange:B,modal:q,children:[h,y]}),e[69]=U,e[70]=q,e[71]=h,e[72]=y,e[73]=F):F=e[73],F}function ke(o){return o.stopPropagation()}function Se(o){return o.stopPropagation()}function Pe(o){return o.value}function Ve(o){return!o}export{Ke as M};
1
+ import{c as he,r as te,l as xe,j as t,B as pe}from"./index-CVJEcf37.js";import{B as ce}from"./badge-DUpgRwQu.js";import{C as de}from"./checkbox-STVvKX8k.js";import{t as me}from"./ChevronUp-B9QGJbr0.js";import{e as ge,C as ve,b as ue,c as je,a as Ce,d as be}from"./command-D7YFT70c.js";import{a as Ne,b as ye,P as we}from"./popover-DAJR0ej2.js";function Ke(o){const e=he.c(74),{options:n,onValueChange:i,defaultValue:P,placeholder:se,variant:le,animation:ae,maxCount:ne,modalPopover:ie,asChild:oe,className:G,disabled:re,onSearchChange:V}=o;let _;e[0]!==P?(_=P===void 0?[]:P,e[0]=P,e[1]=_):_=e[1];const d=_,L=se===void 0?"Select items":se,E=le===void 0?"default":le,O=ae===void 0?0:ae,k=ne===void 0?3:ne,q=ie===void 0?!1:ie,H=oe===void 0?!1:oe,Q=re===void 0?!1:re,[s,S]=te.useState(d),[U,B]=te.useState(!1);let D,I;e[2]!==d||e[3]!==s?(D=()=>{JSON.stringify(s)!==JSON.stringify(d)&&S(d)},I=[d,s],e[2]=d,e[3]=s,e[4]=D,e[5]=I):(D=e[4],I=e[5]),te.useEffect(D,I);let K;e[6]!==i||e[7]!==s?(K=l=>{if(l.key==="Enter")B(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const a=[...s];a.pop(),S(a),i(a)}},e[6]=i,e[7]=s,e[8]=K):K=e[8];const W=K;let T;e[9]!==i||e[10]!==s?(T=l=>{const a=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];S(a),i(a)},e[9]=i,e[10]=s,e[11]=T):T=e[11];const c=T;let $;e[12]!==i?($=()=>{S([]),i([])},e[12]=i,e[13]=$):$=e[13];const X=$;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{B(Ve)},e[14]=z):z=e[14];const fe=z;let A;e[15]!==X||e[16]!==i||e[17]!==n||e[18]!==s.length?(A=()=>{if(s.length===n.length)X();else{const l=n.map(Pe);S(l),i(l)}},e[15]=X,e[16]=i,e[17]=n,e[18]=s.length,e[19]=A):A=e[19];const r=A;let m;e[20]!==H?(m=H?{}:{variant:"outline"},e[20]=H,e[21]=m):m=e[21];let u;e[22]!==G?(u=xe("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",G),e[22]=G,e[23]=u):u=e[23];let f;e[24]!==O||e[25]!==k||e[26]!==n||e[27]!==L||e[28]!==s||e[29]!==E?(f=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const a=n.find(ee=>ee.value===l),w=a?.icon;return t.jsxs(ce,{variant:E==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${O}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:a?.label})]},l)}),s.length>k&&t.jsxs(ce,{variant:E==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${O}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(me,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:L}),t.jsx(me,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=O,e[25]=k,e[26]=n,e[27]=L,e[28]=s,e[29]=E,e[30]=f):f=e[30];let h;e[31]!==Q||e[32]!==m||e[33]!==u||e[34]!==f?(h=t.jsx(Ne,{asChild:!0,children:t.jsx(pe,{ref:null,...m,onClick:fe,className:u,disabled:Q,children:f})}),e[31]=Q,e[32]=m,e[33]=u,e[34]=f,e[35]=h):h=e[35];let J;e[36]===Symbol.for("react.memo_cache_sentinel")?(J=()=>B(!1),e[36]=J):J=e[36];const Y=!V;let x;e[37]!==W||e[38]!==V?(x=t.jsx(ge,{placeholder:"Search...",onKeyDown:W,onValueChange:V,className:"rounded-t-xl"}),e[37]=W,e[38]=V,e[39]=x):x=e[39];let M;e[40]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ve,{children:"No results found."}),e[40]=M):M=e[40];let p;e[41]!==r?(p=()=>{r()},e[41]=r,e[42]=p):p=e[42];let g;e[43]!==r?(g=l=>{l.stopPropagation(),r()},e[43]=r,e[44]=g):g=e[44];const Z=s.length===n.length&&n.length>0;let v;e[45]!==Z||e[46]!==r?(v=t.jsx(de,{checked:Z,onCheckedChange:r,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Se}),e[45]=Z,e[46]=r,e[47]=v):v=e[47];let R;e[48]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("span",{children:"(Select All)"}),e[48]=R):R=e[48];let j;e[49]!==g||e[50]!==v?(j=t.jsxs("div",{className:"flex items-center w-full",onClick:g,children:[v,R]}),e[49]=g,e[50]=v,e[51]=j):j=e[51];let C;e[52]!==p||e[53]!==j?(C=t.jsx(ue,{onSelect:p,className:"cursor-pointer",children:j},"all"),e[52]=p,e[53]=j,e[54]=C):C=e[54];let b;if(e[55]!==n||e[56]!==s||e[57]!==c){let l;e[59]!==s||e[60]!==c?(l=a=>{const w=s.includes(a.value);return t.jsx(ue,{onSelect:()=>{c(a)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:ee=>{ee.stopPropagation(),c(a)},children:[t.jsx(de,{checked:w,onCheckedChange:()=>{c(a)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:ke}),a.icon&&t.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:a.label})]})},a.value)},e[59]=s,e[60]=c,e[61]=l):l=e[61],b=n.map(l),e[55]=n,e[56]=s,e[57]=c,e[58]=b}else b=e[58];let N;e[62]!==C||e[63]!==b?(N=t.jsxs(je,{className:"rounded-b-xl",children:[M,t.jsxs(Ce,{children:[C,b]})]}),e[62]=C,e[63]=b,e[64]=N):N=e[64];let y;e[65]!==Y||e[66]!==x||e[67]!==N?(y=t.jsx(ye,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:J,children:t.jsxs(be,{shouldFilter:Y,className:"rounded-xl",children:[x,N]})}),e[65]=Y,e[66]=x,e[67]=N,e[68]=y):y=e[68];let F;return e[69]!==U||e[70]!==q||e[71]!==h||e[72]!==y?(F=t.jsxs(we,{open:U,onOpenChange:B,modal:q,children:[h,y]}),e[69]=U,e[70]=q,e[71]=h,e[72]=y,e[73]=F):F=e[73],F}function ke(o){return o.stopPropagation()}function Se(o){return o.stopPropagation()}function Pe(o){return o.value}function Ve(o){return!o}export{Ke as M};
@@ -1,4 +1,4 @@
1
- import{n as W,e as B,K as O,b as F,r as J,j as y,B as q,t as N}from"./index-gctAQu2T.js";import{u as z}from"./use-session-runtime-Cs4eGT9k.js";import{k as I,o as V}from"./runnable-block-editor-BD-IThSC.js";import{a0 as _,a1 as H,a2 as G,a3 as Y}from"./index-1yGxjvng.js";import{s as L}from"./decode-html-entities-B4Qel6ov.js";import{b as M}from"./chat-context-CD1rWX64.js";import{d as X}from"./utils-CdxSjBly.js";import{i as Z}from"./CheckCircle-BNNyBNMK.js";import{a as ee}from"./Copy01-BrL9ZrVF.js";import{D as te,b as re,c as se,d as ne}from"./dialog--Jkwvpx1.js";import{M as ae}from"./monaco-editor-kRD7y0Pc.js";function Ue({orgSlug:s,virtualMcpId:e,branch:t}){const r=W(),a=M()?.taskId??null,n=I(e),i=z(e).runtime==="cms";return B({mutationKey:Y(s,e,t),mutationFn:async({blockKey:o})=>{if(i){const l=await _({orgSlug:s,virtualMcpId:e,branch:t},{delete:[o]});return H(r,{orgSlug:s,virtualMcpId:e,branch:t},l),await r.invalidateQueries({queryKey:L({orgSlug:s,virtualMcpId:e,branch:t,threadId:a})}),{ok:!0,existed:!0}}const c=V(n,X(o)),u=await fetch(`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(t)}/unlink`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:c})});return u.ok?u.json():G(u,"Delete")},onMutate:async({blockKey:o})=>{const c=`${s}/${e}/${t}`,u=O.decofile(c);await r.cancelQueries({queryKey:u});const l=r.getQueryData(u),h=!!l&&o in l,g=l?.[o];return r.setQueryData(u,x=>{if(!x)return x;const{[o]:D,...f}=x;return f}),{queryKey:u,blockKey:o,hadKey:h,previousValue:g}},onError:(o,c,u)=>{u&&r.setQueryData(u.queryKey,l=>u.hadKey?{...l??{},[u.blockKey]:u.previousValue}:l)},onSuccess:()=>{r.invalidateQueries({queryKey:O.liveMeta(s,e,t)})}})}function Ke({open:s,onOpenChange:e,pageKey:t,decofile:r,onSave:a}){const n=F(),i=r[t],o=i===void 0,c=o?"":JSON.stringify(i,null,2),[u,l]=J.useState(!1),[h,g]=J.useState(c),[x,D]=J.useState(!1),f=!a||o,C=h!==c,p=()=>{navigator.clipboard.writeText(h).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},d=async w=>{if(!a||x)return;let k;try{k=JSON.parse(w)}catch{N.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}D(!0);try{await a(k),N.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(m){N.error(n("sectionsEditor.pageJsonDialog.saveError",{error:m instanceof Error?m.message:String(m)}))}finally{D(!1)}};return y.jsx(te,{open:s,onOpenChange:e,children:y.jsxs(re,{className:"max-w-3xl p-0 gap-0",children:[y.jsxs(se,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[y.jsx(ne,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),y.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[y.jsxs(q,{variant:"ghost",size:"sm",onClick:p,className:"h-7 gap-1.5 text-xs",children:[u?y.jsx(Z,{size:12}):y.jsx(ee,{size:12}),n(u?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!f&&y.jsx(q,{size:"sm",onClick:()=>d(h),disabled:!C||x,className:"h-7 text-xs",children:n(x?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?y.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):y.jsx("div",{className:"h-[70vh]",children:y.jsx(ae,{code:c,language:"json",readOnly:f,height:"100%",onChange:w=>g(w??""),onSave:w=>{d(w)}})})]})})}var ie=Object.prototype.toString,j=Array.isArray||function(e){return ie.call(e)==="[object Array]"};function K(s){return typeof s=="function"}function oe(s){return j(s)?"array":typeof s}function U(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Q(s,e){return s!=null&&typeof s=="object"&&e in s}function ce(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var ue=RegExp.prototype.test;function le(s,e){return ue.call(s,e)}var fe=/\S/;function pe(s){return!le(fe,s)}var he={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function de(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return he[t]})}var ve=/\s*/,ye=/\s+/,$=/\s*=/,ge=/\s*\}/,we=/#|\^|\/|>|\{|&|=|!/;function me(s,e){if(!s)return[];var t=!1,r=[],a=[],n=[],i=!1,o=!1,c="",u=0;function l(){if(i&&!o)for(;n.length;)delete a[n.pop()];else n=[];i=!1,o=!1}var h,g,x;function D(b){if(typeof b=="string"&&(b=b.split(ye,2)),!j(b)||b.length!==2)throw new Error("Invalid tags: "+b);h=new RegExp(U(b[0])+"\\s*"),g=new RegExp("\\s*"+U(b[1])),x=new RegExp("\\s*"+U("}"+b[1]))}D(e||E.tags);for(var f=new P(s),C,p,d,w,k,m;!f.eos();){if(C=f.pos,d=f.scanUntil(h),d)for(var T=0,A=d.length;T<A;++T)w=d.charAt(T),pe(w)?(n.push(a.length),c+=w):(o=!0,t=!0,c+=" "),a.push(["text",w,C,C+1]),C+=1,w===`
1
+ import{n as W,e as B,K as O,b as F,r as J,j as y,B as q,t as N}from"./index-CVJEcf37.js";import{u as z}from"./use-session-runtime-CKDTMwlz.js";import{k as I,o as V}from"./runnable-block-editor-Bi0Cv7yD.js";import{p as _,s as H,t as G,a as Y}from"./decofile-api-BhjpITFN.js";import{o as L}from"./sandbox-git-api-CMdpE2TE.js";import{u as M}from"./chat-context-B40ngn3f.js";import{a as X}from"./utils-D06E4WDv.js";import{i as Z}from"./CheckCircle-4Be5K85Z.js";import{a as ee}from"./Copy01-BbtQlTnV.js";import{D as te,b as re,c as se,d as ne}from"./dialog-Dxe0Jgna.js";import{M as ae}from"./monaco-editor-B2KCfh7a.js";function Ue({orgSlug:s,virtualMcpId:e,branch:t}){const r=W(),a=M()?.taskId??null,n=I(e),i=z(e).runtime==="cms";return B({mutationKey:Y(s,e,t),mutationFn:async({blockKey:o})=>{if(i){const l=await _({orgSlug:s,virtualMcpId:e,branch:t},{delete:[o]});return H(r,{orgSlug:s,virtualMcpId:e,branch:t},l),await r.invalidateQueries({queryKey:L({orgSlug:s,virtualMcpId:e,branch:t,threadId:a})}),{ok:!0,existed:!0}}const c=V(n,X(o)),u=await fetch(`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(t)}/unlink`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:c})});return u.ok?u.json():G(u,"Delete")},onMutate:async({blockKey:o})=>{const c=`${s}/${e}/${t}`,u=O.decofile(c);await r.cancelQueries({queryKey:u});const l=r.getQueryData(u),h=!!l&&o in l,g=l?.[o];return r.setQueryData(u,x=>{if(!x)return x;const{[o]:D,...f}=x;return f}),{queryKey:u,blockKey:o,hadKey:h,previousValue:g}},onError:(o,c,u)=>{u&&r.setQueryData(u.queryKey,l=>u.hadKey?{...l??{},[u.blockKey]:u.previousValue}:l)},onSuccess:()=>{r.invalidateQueries({queryKey:O.liveMeta(s,e,t)})}})}function Ke({open:s,onOpenChange:e,pageKey:t,decofile:r,onSave:a}){const n=F(),i=r[t],o=i===void 0,c=o?"":JSON.stringify(i,null,2),[u,l]=J.useState(!1),[h,g]=J.useState(c),[x,D]=J.useState(!1),f=!a||o,C=h!==c,p=()=>{navigator.clipboard.writeText(h).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},d=async w=>{if(!a||x)return;let k;try{k=JSON.parse(w)}catch{N.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}D(!0);try{await a(k),N.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(m){N.error(n("sectionsEditor.pageJsonDialog.saveError",{error:m instanceof Error?m.message:String(m)}))}finally{D(!1)}};return y.jsx(te,{open:s,onOpenChange:e,children:y.jsxs(re,{className:"max-w-3xl p-0 gap-0",children:[y.jsxs(se,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[y.jsx(ne,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),y.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[y.jsxs(q,{variant:"ghost",size:"sm",onClick:p,className:"h-7 gap-1.5 text-xs",children:[u?y.jsx(Z,{size:12}):y.jsx(ee,{size:12}),n(u?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!f&&y.jsx(q,{size:"sm",onClick:()=>d(h),disabled:!C||x,className:"h-7 text-xs",children:n(x?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?y.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):y.jsx("div",{className:"h-[70vh]",children:y.jsx(ae,{code:c,language:"json",readOnly:f,height:"100%",onChange:w=>g(w??""),onSave:w=>{d(w)}})})]})})}var ie=Object.prototype.toString,j=Array.isArray||function(e){return ie.call(e)==="[object Array]"};function K(s){return typeof s=="function"}function oe(s){return j(s)?"array":typeof s}function U(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Q(s,e){return s!=null&&typeof s=="object"&&e in s}function ce(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var ue=RegExp.prototype.test;function le(s,e){return ue.call(s,e)}var fe=/\S/;function pe(s){return!le(fe,s)}var he={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function de(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return he[t]})}var ve=/\s*/,ye=/\s+/,$=/\s*=/,ge=/\s*\}/,we=/#|\^|\/|>|\{|&|=|!/;function me(s,e){if(!s)return[];var t=!1,r=[],a=[],n=[],i=!1,o=!1,c="",u=0;function l(){if(i&&!o)for(;n.length;)delete a[n.pop()];else n=[];i=!1,o=!1}var h,g,x;function D(b){if(typeof b=="string"&&(b=b.split(ye,2)),!j(b)||b.length!==2)throw new Error("Invalid tags: "+b);h=new RegExp(U(b[0])+"\\s*"),g=new RegExp("\\s*"+U(b[1])),x=new RegExp("\\s*"+U("}"+b[1]))}D(e||E.tags);for(var f=new P(s),C,p,d,w,k,m;!f.eos();){if(C=f.pos,d=f.scanUntil(h),d)for(var T=0,A=d.length;T<A;++T)w=d.charAt(T),pe(w)?(n.push(a.length),c+=w):(o=!0,t=!0,c+=" "),a.push(["text",w,C,C+1]),C+=1,w===`
2
2
  `&&(l(),c="",u=0,t=!1);if(!f.scan(h))break;if(i=!0,p=f.scan(we)||"name",f.scan(ve),p==="="?(d=f.scanUntil($),f.scan($),f.scanUntil(g)):p==="{"?(d=f.scanUntil(x),f.scan(ge),f.scanUntil(g),p="&"):d=f.scanUntil(g),!f.scan(g))throw new Error("Unclosed tag at "+f.pos);if(p==">"?k=[p,d,C,f.pos,c,u,t]:k=[p,d,C,f.pos],u++,a.push(k),p==="#"||p==="^")r.push(k);else if(p==="/"){if(m=r.pop(),!m)throw new Error('Unopened section "'+d+'" at '+C);if(m[1]!==d)throw new Error('Unclosed section "'+m[1]+'" at '+C)}else p==="name"||p==="{"||p==="&"?o=!0:p==="="&&D(d)}if(l(),m=r.pop(),m)throw new Error('Unclosed section "'+m[1]+'" at '+f.pos);return xe(Ee(a))}function Ee(s){for(var e=[],t,r,a=0,n=s.length;a<n;++a)t=s[a],t&&(t[0]==="text"&&r&&r[0]==="text"?(r[1]+=t[1],r[3]=t[3]):(e.push(t),r=t));return e}function xe(s){for(var e=[],t=e,r=[],a,n,i=0,o=s.length;i<o;++i)switch(a=s[i],a[0]){case"#":case"^":t.push(a),r.push(a),t=a[4]=[];break;case"/":n=r.pop(),n[5]=a[2],t=r.length>0?r[r.length-1][4]:e;break;default:t.push(a)}return e}function P(s){this.string=s,this.tail=s,this.pos=0}P.prototype.eos=function(){return this.tail===""};P.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};P.prototype.scanUntil=function(e){var t=this.tail.search(e),r;switch(t){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=r.length,r};function S(s,e){this.view=s,this.cache={".":this.view},this.parent=e}S.prototype.push=function(e){return new S(e,this)};S.prototype.lookup=function(e){var t=this.cache,r;if(t.hasOwnProperty(e))r=t[e];else{for(var a=this,n,i,o,c=!1;a;){if(e.indexOf(".")>0)for(n=a.view,i=e.split("."),o=0;n!=null&&o<i.length;)o===i.length-1&&(c=Q(n,i[o])||ce(n,i[o])),n=n[i[o++]];else n=a.view[e],c=Q(a.view,e);if(c){r=n;break}a=a.parent}t[e]=r}return K(r)&&(r=r.call(this.view)),r};function v(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}v.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};v.prototype.parse=function(e,t){var r=this.templateCache,a=e+":"+(t||E.tags).join(":"),n=typeof r<"u",i=n?r.get(a):void 0;return i==null&&(i=me(e,t),n&&r.set(a,i)),i};v.prototype.render=function(e,t,r,a){var n=this.getConfigTags(a),i=this.parse(e,n),o=t instanceof S?t:new S(t,void 0);return this.renderTokens(i,o,r,e,a)};v.prototype.renderTokens=function(e,t,r,a,n){for(var i="",o,c,u,l=0,h=e.length;l<h;++l)u=void 0,o=e[l],c=o[0],c==="#"?u=this.renderSection(o,t,r,a,n):c==="^"?u=this.renderInverted(o,t,r,a,n):c===">"?u=this.renderPartial(o,t,r,n):c==="&"?u=this.unescapedValue(o,t):c==="name"?u=this.escapedValue(o,t,n):c==="text"&&(u=this.rawValue(o)),u!==void 0&&(i+=u);return i};v.prototype.renderSection=function(e,t,r,a,n){var i=this,o="",c=t.lookup(e[1]);function u(g){return i.render(g,t,r,n)}if(c){if(j(c))for(var l=0,h=c.length;l<h;++l)o+=this.renderTokens(e[4],t.push(c[l]),r,a,n);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(e[4],t.push(c),r,a,n);else if(K(c)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(t.view,a.slice(e[3],e[5]),u),c!=null&&(o+=c)}else o+=this.renderTokens(e[4],t,r,a,n);return o}};v.prototype.renderInverted=function(e,t,r,a,n){var i=t.lookup(e[1]);if(!i||j(i)&&i.length===0)return this.renderTokens(e[4],t,r,a,n)};v.prototype.indentPartial=function(e,t,r){for(var a=t.replace(/[^ \t]/g,""),n=e.split(`
3
3
  `),i=0;i<n.length;i++)n[i].length&&(i>0||!r)&&(n[i]=a+n[i]);return n.join(`
4
4
  `)};v.prototype.renderPartial=function(e,t,r,a){if(r){var n=this.getConfigTags(a),i=K(r)?r(e[1]):r[e[1]];if(i!=null){var o=e[6],c=e[5],u=e[4],l=i;c==0&&u&&(l=this.indentPartial(i,u,o));var h=this.parse(l,n);return this.renderTokens(h,t,r,l,a)}}};v.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(r!=null)return r};v.prototype.escapedValue=function(e,t,r){var a=this.getConfigEscape(r)||E.escape,n=t.lookup(e[1]);if(n!=null)return typeof n=="number"&&a===E.escape?String(n):a(n)};v.prototype.rawValue=function(e){return e[1]};v.prototype.getConfigTags=function(e){return j(e)?e:e&&typeof e=="object"?e.tags:void 0};v.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!j(e))return e.escape};var E={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(s){R.templateCache=s},get templateCache(){return R.templateCache}},R=new v;E.clearCache=function(){return R.clearCache()};E.parse=function(e,t){return R.parse(e,t)};E.render=function(e,t,r,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+oe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return R.render(e,t,r,a)};E.escape=de;E.Scanner=P;E.Context=S;E.Writer=v;export{Ke as P,E as m,Ue as u};
@@ -1 +1 @@
1
- import{b as o,r as c,j as e,h as n}from"./index-gctAQu2T.js";import{h as u}from"./mcp-oauth-i7PCjbNf.js";import"./auth-vfqjjrgv.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
1
+ import{b as o,r as c,j as e,h as n}from"./index-CVJEcf37.js";import{h as u}from"./mcp-oauth-OvlzbMCP.js";import"./auth-Cyjh0UQp.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
@@ -1 +1 @@
1
- import{b as d,r as a,j as e,h}from"./index-gctAQu2T.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
1
+ import{b as d,r as a,j as e,h}from"./index-CVJEcf37.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
@@ -1 +1 @@
1
- import{c as ie,j as t,a as ye,h as ce,b as de,m as Ce,K as Oe,r as P,B as Ne,e as pe,l as ae,t as he}from"./index-gctAQu2T.js";import{R as ze}from"./required-auth-layout-CraNNSBi.js";import{A as se}from"./auth-split-layout-BB-yAg-2.js";import{O as Le}from"./organization-choice-BdqJqB_v.js";import{A as ve}from"./avatar-BpU54ct-.js";import{I as _e}from"./input-eBmoU-9D.js";import{L as Ee}from"./label-DGkzLfNU.js";import{S as Ae}from"./switch-DADMizS1.js";import{t as De,a as Pe,b as Re}from"./Users03-D8RoJqiC.js";import{i as Fe}from"./CheckCircle-BNNyBNMK.js";import{a as Me}from"./Palette-CiXH5EXK.js";import{i as $e}from"./Upload01-BtBtAyal.js";import"./Plus-kQ9d0PiA.js";import"./User01-CtDIPHIF.js";const Te=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function lt(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(qe,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:s}=i;let a;e[0]!==s||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:s??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let r;e[5]!==m?(r=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=r):r=e[6];let o;e[7]!==f||e[8]!==r?(o=t.jsxs("div",{className:"space-y-2",children:[f,r]}),e[7]=f,e[8]=r,e[9]=o):o=e[9];let j;return e[10]!==a||e[11]!==o?(j=t.jsxs("div",{className:"grid gap-10",children:[a,o]}),e[10]=a,e[11]=o,e[12]=j):j=e[12],j}function qe(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(se,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let s;return i[1]!==n||i[2]!==m?(s=t.jsx(Ue,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=s):s=i[3],s}function Ue(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),s=b.split("@")[1]?.toLowerCase()??"",a=!!s&&!Te.has(s),f=s.split(".")[0]??"",r=f.charAt(0).toUpperCase()+f.slice(1);let o;e[0]!==r||e[1]!==a||e[2]!==m?(o=a?r:m?.split(" ")[0]??"",e[0]=r,e[1]=a,e[2]=m,e[3]=o):o=e[3];const j=o,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(s),queryFn:Je,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=l):l=e[5],t.jsx(se,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[l,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:s})})]})})}if(u){let l;e[6]!==w?(l=()=>w(),e[6]=w,e[7]=l):l=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==l||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:l,children:d}),e[10]=l,e[11]=d,e[12]=h):h=e[12],t.jsx(se,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:s})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Be),A=N.some(Ke),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let l;e[16]!==m?(l=m?.split(" ")[0]??"",e[16]=m,e[17]=l):l=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==r||e[21]!==s||e[22]!==a||e[23]!==l||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:l,allowDomainClaim:!1,onBack:d}),e[20]=r,e[21]=s,e[22]=a,e[23]=l,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let l;e[26]!==p||e[27]!==N.length||e[28]!==n?(l=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=l):l=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==l||e[34]!==d?(h=t.jsx(fe,{title:l,description:d}),e[33]=l,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==s||e[40]!==_||e[41]!==O?(C=t.jsx(Le,{organizations:N,domain:s,requestedSlugs:_,onRequestedSlug:O,onJoined:Ie}),e[38]=N,e[39]=s,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(se,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==r||e[56]!==s||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:j}),e[54]=j,e[55]=r,e[56]=s,e[57]=a,e[58]=D):D=e[58],D}function Ie(i,e){window.location.href=`/${e}`}function Ke(i){return i.joinMode==="auto"}function Be(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Je(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:s,allowDomainClaim:a,onBack:f}=i,r=a===void 0?!0:a,o=de(),j=b&&r?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(s),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const l=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(se,{children:t.jsx(Ye,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=l.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||l.error||null;let z;e[22]!==r||e[23]!==O||e[24]!==l||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&r?p.mutate():l.mutate())},e[22]=r,e[23]=O,e[24]=l,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==o?(k=o("routes.onboarding.welcomeTitle"),e[28]=o,e[29]=k):k=e[29];let L;e[30]!==o?(L=o("routes.onboarding.setupDescription"),e[30]=o,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==o?(F=o("routes.onboarding.orgAvatar"),e[35]=o,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==o?(q=o("routes.onboarding.optional"),e[39]=o,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==s||e[47]!==c?(K=(c.trim()||s||"?").charAt(0).toUpperCase(),e[46]=s,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Ge,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==o?(G=o("routes.onboarding.orgName"),e[56]=o,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ee,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let re;e[60]===Symbol.for("react.memo_cache_sentinel")?(re=x=>v(x.target.value),e[60]=re):re=e[60];let H;e[61]!==s||e[62]!==o?(H=s||o("routes.onboarding.myOrganizationPlaceholder"),e[61]=s,e[62]=o,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(_e,{id:"org-name",value:c,onChange:re,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==r||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==o?(V=b&&r&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:o("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(Ae,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=r,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=o,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==o?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:o("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=o,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==o?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",o("routes.onboarding.creating")]}):o("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=o,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let oe;e[93]!==f||e[94]!==o?(oe=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:o("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=o,e[95]=oe):oe=e[95];let le;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==oe?(le=t.jsx(se,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,oe]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=oe,e[102]=le):le=e[102],le}function Ge(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:s}=i,a=de(),f=P.useRef(null);let r;e[0]!==n||e[1]!==a?(r=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=r):r=e[2];const o=r;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==s||e[7]!==o?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[6]=s,e[7]=o,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx($e,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==s||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:s,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=s,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:De,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Pe,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:Re,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0},{icon:Me,labelKey:"routes.onboarding.step.extractingBrand",claimOnly:!1}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ye({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),s=we.filter(o=>b||!o.claimOnly),[a,f]=P.useState(0),r=P.useRef(!1);if(!r.current){r.current=!0;for(let o=1;o<s.length;o++)setTimeout(()=>f(o),Se*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:s.map((o,j)=>{const c=o.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(o.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Fe,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},o.labelKey)})})]})}export{lt as default};
1
+ import{c as ie,j as t,a as ye,h as ce,b as de,m as Ce,K as Oe,r as P,B as Ne,e as pe,l as ae,t as he}from"./index-CVJEcf37.js";import{R as ze}from"./required-auth-layout-TTElzhIM.js";import{A as se}from"./auth-split-layout-WGnYlU-M.js";import{O as Le}from"./organization-choice-C-PRPVPc.js";import{A as ve}from"./avatar-CO3n6wLC.js";import{I as _e}from"./input-C8MQoDCb.js";import{L as Ee}from"./label-Cfl8uGDP.js";import{S as Ae}from"./switch-DJ4Dr2_V.js";import{t as De,a as Pe,b as Re}from"./Users03-3yW32m45.js";import{i as Fe}from"./CheckCircle-4Be5K85Z.js";import{a as Me}from"./Palette-DuCZiZH-.js";import{i as $e}from"./Upload01-BlEOH700.js";import"./Plus-BUGmioCX.js";import"./User01-C2ILPAHc.js";const Te=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function lt(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(qe,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:s}=i;let a;e[0]!==s||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:s??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]})}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let r;e[5]!==m?(r=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=r):r=e[6];let o;e[7]!==f||e[8]!==r?(o=t.jsxs("div",{className:"space-y-2",children:[f,r]}),e[7]=f,e[8]=r,e[9]=o):o=e[9];let j;return e[10]!==a||e[11]!==o?(j=t.jsxs("div",{className:"grid gap-10",children:[a,o]}),e[10]=a,e[11]=o,e[12]=j):j=e[12],j}function qe(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(se,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let s;return i[1]!==n||i[2]!==m?(s=t.jsx(Ue,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=s):s=i[3],s}function Ue(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),s=b.split("@")[1]?.toLowerCase()??"",a=!!s&&!Te.has(s),f=s.split(".")[0]??"",r=f.charAt(0).toUpperCase()+f.slice(1);let o;e[0]!==r||e[1]!==a||e[2]!==m?(o=a?r:m?.split(" ")[0]??"",e[0]=r,e[1]=a,e[2]=m,e[3]=o):o=e[3];const j=o,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(s),queryFn:Je,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=l):l=e[5],t.jsx(se,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[l,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:s})})]})})}if(u){let l;e[6]!==w?(l=()=>w(),e[6]=w,e[7]=l):l=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==l||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:l,children:d}),e[10]=l,e[11]=d,e[12]=h):h=e[12],t.jsx(se,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:s})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Be),A=N.some(Ke),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let l;e[16]!==m?(l=m?.split(" ")[0]??"",e[16]=m,e[17]=l):l=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==r||e[21]!==s||e[22]!==a||e[23]!==l||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:l,allowDomainClaim:!1,onBack:d}),e[20]=r,e[21]=s,e[22]=a,e[23]=l,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let l;e[26]!==p||e[27]!==N.length||e[28]!==n?(l=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=l):l=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==l||e[34]!==d?(h=t.jsx(fe,{title:l,description:d}),e[33]=l,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==s||e[40]!==_||e[41]!==O?(C=t.jsx(Le,{organizations:N,domain:s,requestedSlugs:_,onRequestedSlug:O,onJoined:Ie}),e[38]=N,e[39]=s,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(se,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==r||e[56]!==s||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:j}),e[54]=j,e[55]=r,e[56]=s,e[57]=a,e[58]=D):D=e[58],D}function Ie(i,e){window.location.href=`/${e}`}function Ke(i){return i.joinMode==="auto"}function Be(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Je(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:s,allowDomainClaim:a,onBack:f}=i,r=a===void 0?!0:a,o=de(),j=b&&r?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(s),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const l=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(se,{children:t.jsx(Ye,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=l.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||l.error||null;let z;e[22]!==r||e[23]!==O||e[24]!==l||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&r?p.mutate():l.mutate())},e[22]=r,e[23]=O,e[24]=l,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==o?(k=o("routes.onboarding.welcomeTitle"),e[28]=o,e[29]=k):k=e[29];let L;e[30]!==o?(L=o("routes.onboarding.setupDescription"),e[30]=o,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==o?(F=o("routes.onboarding.orgAvatar"),e[35]=o,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==o?(q=o("routes.onboarding.optional"),e[39]=o,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==s||e[47]!==c?(K=(c.trim()||s||"?").charAt(0).toUpperCase(),e[46]=s,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Ge,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==o?(G=o("routes.onboarding.orgName"),e[56]=o,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ee,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let re;e[60]===Symbol.for("react.memo_cache_sentinel")?(re=x=>v(x.target.value),e[60]=re):re=e[60];let H;e[61]!==s||e[62]!==o?(H=s||o("routes.onboarding.myOrganizationPlaceholder"),e[61]=s,e[62]=o,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(_e,{id:"org-name",value:c,onChange:re,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==r||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==o?(V=b&&r&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:o("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(Ae,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=r,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=o,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==o?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:o("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=o,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==o?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",o("routes.onboarding.creating")]}):o("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=o,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let oe;e[93]!==f||e[94]!==o?(oe=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:o("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=o,e[95]=oe):oe=e[95];let le;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==oe?(le=t.jsx(se,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,oe]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=oe,e[102]=le):le=e[102],le}function Ge(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:s}=i,a=de(),f=P.useRef(null);let r;e[0]!==n||e[1]!==a?(r=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=r):r=e[2];const o=r;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==s||e[7]!==o?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[6]=s,e[7]=o,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx($e,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==s||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:s,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=s,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:De,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Pe,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:Re,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0},{icon:Me,labelKey:"routes.onboarding.step.extractingBrand",claimOnly:!1}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ye({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),s=we.filter(o=>b||!o.claimOnly),[a,f]=P.useState(0),r=P.useRef(!1);if(!r.current){r.current=!0;for(let o=1;o<s.length;o++)setTimeout(()=>f(o),Se*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:s.map((o,j)=>{const c=o.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(o.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Fe,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},o.labelKey)})})]})}export{lt as default};