decocms 4.500.2 → 4.500.4

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 (374) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CeZzOoVf.js → ActiveShapeUtils-r8jaNALG.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-D4iOZ3Bs.js → AlertCircle-BgwifFMG.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CUWmFHwI.js → AreaChart-DB6yNBzt.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-iygYSRbQ.js → ArrowLeft-BP0atRPX.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-KCSPs-fi.js → ArrowUp-AxzDl8Z3.js} +1 -1
  6. package/dist/client/assets/{BarChart-gbo6r8aY.js → BarChart-CwA-ga4F.js} +1 -1
  7. package/dist/client/assets/{Building02-EbX1A23K.js → Building02-DDW-F58b.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-DbqLrstZ.js → CategoricalChart-DVQp8mi8.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-CoJfU94i.js → CheckCircle-pe1RxSse.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-DqpRXMOM.js → ChevronSelectorVertical-B9RLS3HF.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-BSm7AtSf.js → ChevronUp-QaPEzxVx.js} +1 -1
  12. package/dist/client/assets/{Copy01-DlA26aBh.js → Copy01-YTn6AAPK.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-CXGPcE51.js → CreditCard01-DPxzkwQY.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-CTugBooH.js → DotsVertical-D1KewbnO.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-CJdWK23B.js → ErrorBarContext-DFDHSMqE.js} +1 -1
  16. package/dist/client/assets/{Globe04-DDiW2Onm.js → Globe04-Cq4nB1G2.js} +1 -1
  17. package/dist/client/assets/{Image01-BjUHwjIr.js → Image01-Bpynux_N.js} +1 -1
  18. package/dist/client/assets/{Key01-DMnhMxC3.js → Key01-ByMBFx-i.js} +1 -1
  19. package/dist/client/assets/{Link01-DKypA3Uf.js → Link01-Zi8wbjzB.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-Cjxu7rCw.js → LinkBroken01-tO8JEBqa.js} +1 -1
  21. package/dist/client/assets/{Monitor01-CTL-UG2p.js → Monitor01-wrmGnmsX.js} +1 -1
  22. package/dist/client/assets/{Play-NZWCLDah.js → Play-W6HcQ7l_.js} +1 -1
  23. package/dist/client/assets/{Plus-DLTeBarI.js → Plus-BKb3EUuT.js} +1 -1
  24. package/dist/client/assets/{SearchMd-BsNWsFDv.js → SearchMd-BXSC0WTH.js} +1 -1
  25. package/dist/client/assets/{Sector-BRgBibA6.js → Sector-DqutoVk-.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-CWlRU3Ye.js → ShoppingBag01-D0kKEJuH.js} +1 -1
  27. package/dist/client/assets/{Sun-DhZMu2lN.js → Sun-CfiICDcE.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DZEm8csq.js → SwitchHorizontal01-CAC-8ZOB.js} +1 -1
  29. package/dist/client/assets/{Tool01-o_nJ7Y1x.js → Tool01-C9pjFqwV.js} +1 -1
  30. package/dist/client/assets/{Trash01-JZaZB0vu.js → Trash01-BO35Cov_.js} +1 -1
  31. package/dist/client/assets/{Upload01-CpEePL13.js → Upload01-DJFAu4Mm.js} +1 -1
  32. package/dist/client/assets/{User01-BGOQS9vx.js → User01-B7hPiYB7.js} +1 -1
  33. package/dist/client/assets/{UserSquare-BFlEW2x5.js → UserSquare-CLXjlx3Y.js} +1 -1
  34. package/dist/client/assets/{Users01-C9dOtgmV.js → Users01-DxG-qkCG.js} +1 -1
  35. package/dist/client/assets/{XAxis-4jP2_ps6.js → XAxis-BlThxQ5X.js} +1 -1
  36. package/dist/client/assets/{XClose-DO008B8R.js → XClose-CMdSy1nN.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-DA1sRe95.js → ZoomOut-DLs2h_6j.js} +1 -1
  38. package/dist/client/assets/{access-gate-DsVMqwjM.js → access-gate-3MCIFFcK.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-BTQ6Snbx.js → add-connection-dialog-DNMm7BIu.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-CpGEVH02.js → agent-analytics-CrniEuaQ.js} +1 -1
  41. package/dist/client/assets/agent-app-BQhyv8DF.js +1 -0
  42. package/dist/client/assets/{agent-assets-D1AunKzQ.js → agent-assets-IKAQ5dPz.js} +1 -1
  43. package/dist/client/assets/{agent-automation-Ds-y1bNp.js → agent-automation-D7MtRcpp.js} +1 -1
  44. package/dist/client/assets/{agent-automations-Bhv6Y5Fg.js → agent-automations-C6QL27by.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-BWYssaAs.js → agent-connect-sources-3TeEngKZ.js} +1 -1
  46. package/dist/client/assets/agent-deck-f6820vT8.js +1 -0
  47. package/dist/client/assets/{agent-e2e-mBRBGP-4.js → agent-e2e-BPlZoWAG.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-aivx3wKk.js → agent-experiments-DUjuqx9x.js} +1 -1
  49. package/dist/client/assets/{agent-file-p8VPN5Ls.js → agent-file-Cx3yLMJg.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-BLydMzz1.js → agent-hosting-D42N4TPy.js} +1 -1
  51. package/dist/client/assets/{agent-icon-DDBSTxwl.js → agent-icon-DjnOmCBc.js} +1 -1
  52. package/dist/client/assets/agent-library-BIn7dUjB.js +1 -0
  53. package/dist/client/assets/agent-library-file-CeiO8mwA.js +1 -0
  54. package/dist/client/assets/{agent-monitor-DwF-OeKx.js → agent-monitor-mP9taLUf.js} +1 -1
  55. package/dist/client/assets/{agent-overview-PzlD3Gdw.js → agent-overview-1r1Kovqy.js} +1 -1
  56. package/dist/client/assets/agent-settings-klWG-4n_.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-BpVIjbEo.js → agent-site-editor-AFFGIJna.js} +1 -1
  58. package/dist/client/assets/agent-site-editor-code-C4ytTmHW.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-UkRK2sPZ.js → agent-site-editor-content-8UmzG7GR.js} +3 -3
  60. package/dist/client/assets/agent-site-editor-preview-CKZy7Tmh.js +551 -0
  61. package/dist/client/assets/agent-view-Hz67HaQW.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-CNj-ECwU.js → agent-view-guard-BlKWFB7P.js} +1 -1
  63. package/dist/client/assets/{agents-list-DIvEheHR.js → agents-list-CNENncPv.js} +1 -1
  64. package/dist/client/assets/{ai-providers-Bv4VnLS0.js → ai-providers-DurLhw5y.js} +1 -1
  65. package/dist/client/assets/{alert-DYBIxnQj.js → alert-BavK6rpL.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-DpmCpPBI.js → alert-dialog-DLvf9XpO.js} +1 -1
  67. package/dist/client/assets/{analytics-sections-Dv6tHtpt.js → analytics-sections-BILOZ8xI.js} +1 -1
  68. package/dist/client/assets/api-keys-Bar4CNhW.js +1 -0
  69. package/dist/client/assets/{api-keys-BpociG2u.js → api-keys-DxfnV1wH.js} +1 -1
  70. package/dist/client/assets/app-editor-BpQwl80B.js +1 -0
  71. package/dist/client/assets/{asset-utils-BUihGB_o.js → asset-utils-RL-ZiBha.js} +1 -1
  72. package/dist/client/assets/{auth-D1PkW9Uj.js → auth-C11WExuf.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-xah8Rp3j.js → auth-catchall-DtdWlB5Z.js} +1 -1
  74. package/dist/client/assets/{auth-entry-VLEYf8tT.js → auth-entry-DzUfVYJ4.js} +1 -1
  75. package/dist/client/assets/{auth-split-layout-HBBBJTJB.js → auth-split-layout-DdRT7pwN.js} +1 -1
  76. package/dist/client/assets/{authenticate-and-persist-oauth-BfNR0joU.js → authenticate-and-persist-oauth-DyuZVm6i.js} +1 -1
  77. package/dist/client/assets/{automation-list-row-IGsRC78W.js → automation-list-row-DQWI_wwj.js} +1 -1
  78. package/dist/client/assets/{automation-runs-C60W3bGo.js → automation-runs-BMd-xJ2A.js} +1 -1
  79. package/dist/client/assets/{automations-CaS6shwH.js → automations-DEn-h47r.js} +1 -1
  80. package/dist/client/assets/{autosend-D3KZZhDs.js → autosend-BxzE8tXY.js} +1 -1
  81. package/dist/client/assets/{avatar-Brh_8d7a.js → avatar-BQ1clUOI.js} +1 -1
  82. package/dist/client/assets/{badge-Dp13ql_I.js → badge-NHL6jQ7U.js} +1 -1
  83. package/dist/client/assets/{block-document-Cxj1MUpK.js → block-document-Cn1hz4p_.js} +3 -3
  84. package/dist/client/assets/{blocks-preview-workspace-context-D7M7BwP7.js → blocks-preview-workspace-context-C7BK9yT5.js} +1 -1
  85. package/dist/client/assets/{blog-schema-G4wBIdc6.js → blog-schema-rNr5GnCl.js} +1 -1
  86. package/dist/client/assets/{board-analytics-DO-wkHdX.js → board-analytics-IRwojiVB.js} +1 -1
  87. package/dist/client/assets/{buckets-C5bRLlmM.js → buckets-CbnqPAbV.js} +1 -1
  88. package/dist/client/assets/{build-improve-prompt-doc-DHL2uEEa.js → build-improve-prompt-doc-DIcVxtkz.js} +1 -1
  89. package/dist/client/assets/{calendar-DEB-AUfC.js → calendar-wJdw6sZE.js} +1 -1
  90. package/dist/client/assets/{capability-load-error-CR2FG7xy.js → capability-load-error-BegMkJwl.js} +1 -1
  91. package/dist/client/assets/{category-editor-DfXKd-cd.js → category-editor-D92K-w8g.js} +1 -1
  92. package/dist/client/assets/{chart-CXoR26LQ.js → chart-yyGN_0NT.js} +1 -1
  93. package/dist/client/assets/chat-context-Bdbu4aFj.js +39 -0
  94. package/dist/client/assets/{chat-draft-CWFQi3-d.js → chat-draft-CKhySLl4.js} +1 -1
  95. package/dist/client/assets/{checkbox-CGTvhz0x.js → checkbox-B6gj5-qt.js} +1 -1
  96. package/dist/client/assets/{choose-editor-DBCIeCbR.js → choose-editor-pJnZ58-b.js} +1 -1
  97. package/dist/client/assets/claim-phase-copy-CNoIfrVp.js +1 -0
  98. package/dist/client/assets/{cli-auth-success-Nd2PZ9ox.js → cli-auth-success-C2CP1C9i.js} +1 -1
  99. package/dist/client/assets/{client-icons-BI4heyKD.js → client-icons-BG3NCFov.js} +1 -1
  100. package/dist/client/assets/{collapsible-Cq1aFrCg.js → collapsible-8Gh0baiT.js} +1 -1
  101. package/dist/client/assets/{collection-detail-ClkMaErn.js → collection-detail-DgpOivN_.js} +1 -1
  102. package/dist/client/assets/{collection-display-button-BjwUZtSd.js → collection-display-button-Guyqw9do.js} +1 -1
  103. package/dist/client/assets/{collection-search-Cp82h57b.js → collection-search-ji1JjZMn.js} +1 -1
  104. package/dist/client/assets/{collection-table-wrapper-BmpUFI8T.js → collection-table-wrapper-CSxKmndL.js} +1 -1
  105. package/dist/client/assets/{collection-tabs-C6HP7d51.js → collection-tabs-C39YFQ2E.js} +1 -1
  106. package/dist/client/assets/{column-rules-CJ4d_g8W.js → column-rules-vK8DsKaQ.js} +1 -1
  107. package/dist/client/assets/{combobox-CF6B9Wmt.js → combobox-sJwovF14.js} +1 -1
  108. package/dist/client/assets/{command-BfXTTBD9.js → command-CloMVJTp.js} +1 -1
  109. package/dist/client/assets/{companion-mcps-section-BLJLcZpb.js → companion-mcps-section-DkcpjKJu.js} +1 -1
  110. package/dist/client/assets/{config-BZYNAwT6.js → config-BGvl3kPw.js} +1 -1
  111. package/dist/client/assets/{connect-FZH1ks7l.js → connect-BXtTpX6G.js} +1 -1
  112. package/dist/client/assets/{connect-layout-BbzklNPm.js → connect-layout-3qTDxx-Z.js} +1 -1
  113. package/dist/client/assets/{connection-BTT1rt_2.js → connection-BKamaNd5.js} +1 -1
  114. package/dist/client/assets/{connection-card-CsIFgDe8.js → connection-card-VZBAZ1By.js} +1 -1
  115. package/dist/client/assets/{connection-detail-BSkgGFWF.js → connection-detail-DmNwjYLW.js} +1 -1
  116. package/dist/client/assets/{connection-form-helpers-Bg3g47y2.js → connection-form-helpers-T_Ai4T1w.js} +1 -1
  117. package/dist/client/assets/{connections-BcHX4l-p.js → connections-CRhKf5Aw.js} +1 -1
  118. package/dist/client/assets/{context-D9dob61q.js → context-DDqIS5x2.js} +1 -1
  119. package/dist/client/assets/{context-menu-DPNtSYt0.js → context-menu-BL7ReY3s.js} +1 -1
  120. package/dist/client/assets/{core.esm-C90YQIGJ.js → core.esm-CAijLSig.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-BoHINOyM.js → create-organization-dialog-CzdjGKlM.js} +1 -1
  122. package/dist/client/assets/{daily-pulse-tLPif3nO.js → daily-pulse-Do7Bv4JX.js} +1 -1
  123. package/dist/client/assets/{device-hint-ClxhQWtk.js → device-hint-CWzU-IYs.js} +1 -1
  124. package/dist/client/assets/{discover-BGUAZcdZ.js → discover-BnV5JtgA.js} +1 -1
  125. package/dist/client/assets/{domain-settings-C1KL1CIp.js → domain-settings-Dp99mfI4.js} +1 -1
  126. package/dist/client/assets/{drawer-20Gv7XN0.js → drawer-CBMcEEQM.js} +1 -1
  127. package/dist/client/assets/{editor-CklcmkgZ.js → editor-B4h2oI8R.js} +1 -1
  128. package/dist/client/assets/{empty-state-CsVqjGqu.js → empty-state-BZTHulBK.js} +1 -1
  129. package/dist/client/assets/{empty-state-BWSdqiOv.js → empty-state-YI3BPcNO.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-C8Idk1Oj.js → extract-connection-data-U1HCpmI2.js} +1 -1
  131. package/dist/client/assets/{feature-gate-Brul-7Vc.js → feature-gate-Bz1_kJfU.js} +1 -1
  132. package/dist/client/assets/{feature-paywall-B1-Kq6zS.js → feature-paywall-Hzw839qS.js} +1 -1
  133. package/dist/client/assets/{file-explorer-0AwiXzsI.js → file-explorer-D-yZsL4s.js} +1 -1
  134. package/dist/client/assets/{file-preview-BTrgY74n.js → file-preview-BPquMk7t.js} +1 -1
  135. package/dist/client/assets/{file-share-button-kQh5APqr.js → file-share-button-CZio6GIv.js} +1 -1
  136. package/dist/client/assets/{file-type-icon-Dbuavq5L.js → file-type-icon-BQzv7Wym.js} +1 -1
  137. package/dist/client/assets/flat-project-xIeYzzyp.js +1 -0
  138. package/dist/client/assets/{folder-icon-D1xnfwm_.js → folder-icon-hFIrLwS2.js} +1 -1
  139. package/dist/client/assets/{form-BZ1i_2GJ.js → form-BRZ5DZiG.js} +1 -1
  140. package/dist/client/assets/{general-C8gjvVqx.js → general-D4j81pur.js} +1 -1
  141. package/dist/client/assets/{home-BnDlnEHu.js → home-BlQ7XxUT.js} +1 -1
  142. package/dist/client/assets/{icon-button-BDbIWVW3.js → icon-button-7qsU_2OV.js} +1 -1
  143. package/dist/client/assets/{index-Bs_Ow9qj.js → index-6SpfJF4P.js} +1 -1
  144. package/dist/client/assets/{index-D94af8m5.js → index-BFQV-2t6.js} +1 -1
  145. package/dist/client/assets/{index-pEr2eE8n.js → index-BXITXB61.js} +1 -1
  146. package/dist/client/assets/{index-4XFLhK7S.js → index-C3moojPl.js} +41 -41
  147. package/dist/client/assets/{index-C8VO6rJ2.js → index-CsiOLq0m.js} +3 -3
  148. package/dist/client/assets/{index-DlsOrQnt.js → index-Csp02eVI.js} +1 -1
  149. package/dist/client/assets/{index-CN8TQhg6.js → index-DOFxzI-C.js} +1 -1
  150. package/dist/client/assets/index-DQO0lnZr.css +1 -0
  151. package/dist/client/assets/{index-DujNp8wX.js → index-DjXrdMkW.js} +1 -1
  152. package/dist/client/assets/{index-COd_qFje.js → index-b34wBOnq.js} +1 -1
  153. package/dist/client/assets/{index-DrIzKTur.js → index-lfns9uh8.js} +1 -1
  154. package/dist/client/assets/{index-DVVx4F0i.js → index-p5cxA0SC.js} +1 -1
  155. package/dist/client/assets/{index-C0n7mPS1.js → index-qV0aMVfj.js} +1 -1
  156. package/dist/client/assets/{index-CWl9v4eu.js → index-rN0rlunX.js} +1 -1
  157. package/dist/client/assets/{index-redirect-BQGkKPeS.js → index-redirect-4gzc5Gy_.js} +1 -1
  158. package/dist/client/assets/{infiniteQueryObserver-DLzEnjM8.js → infiniteQueryObserver-DMRptffd.js} +1 -1
  159. package/dist/client/assets/{infra-billing-Df_WNbOe.js → infra-billing-BK2k2AIQ.js} +1 -1
  160. package/dist/client/assets/{input-BzdgO_dK.js → input-C8o95ZIl.js} +3 -3
  161. package/dist/client/assets/{input-DQtH0um6.js → input-Dy0JrrC0.js} +1 -1
  162. package/dist/client/assets/{integration-icon-BqsHjS-b.js → integration-icon-CmzyrNbk.js} +1 -1
  163. package/dist/client/assets/{jira-icon-CG6W0SJT.js → jira-icon-CaqntM3w.js} +1 -1
  164. package/dist/client/assets/{label-ByKoWpTn.js → label-C-C9Ou_x.js} +1 -1
  165. package/dist/client/assets/{layout-Ih9F7QDG.js → layout-SMB9U0zE.js} +1 -1
  166. package/dist/client/assets/{legacy-agents-deep-D4aZSj1S.js → legacy-agents-deep-DH5S5sM5.js} +1 -1
  167. package/dist/client/assets/{legacy-main-redirect-CawnT8bs.js → legacy-main-redirect-CgxK0F6X.js} +1 -1
  168. package/dist/client/assets/library-DxhILUSJ.js +1 -0
  169. package/dist/client/assets/{library-tab-CWnL_FfR.js → library-tab-BDN7_SPX.js} +1 -1
  170. package/dist/client/assets/{login-BV5vcG2Q.js → login-KvBjhXxT.js} +1 -1
  171. package/dist/client/assets/{markdown-BW2GJSHC.js → markdown-BUXU5oD6.js} +1 -1
  172. package/dist/client/assets/{mcp-app-renderer-fDcax7T2.js → mcp-app-renderer-DyZ3_ABn.js} +1 -1
  173. package/dist/client/assets/{mcp-oauth-CVI2AkSu.js → mcp-oauth-BkcOWs3t.js} +1 -1
  174. package/dist/client/assets/{mcp-oauth-BjHElKzR.js → mcp-oauth-L9MT2tEQ.js} +1 -1
  175. package/dist/client/assets/{members-f-Grp_Zc.js → members-DDmeZze3.js} +1 -1
  176. package/dist/client/assets/{memory-CYDtZWEC.js → memory-Bz_z-OHW.js} +1 -1
  177. package/dist/client/assets/{mini-report-page-BvYGpq5f.js → mini-report-page-Du9prRn4.js} +1 -1
  178. package/dist/client/assets/{mock-board-hNRrDjvq.js → mock-board-wu3yr1Uh.js} +1 -1
  179. package/dist/client/assets/{monaco-editor-DkahnDKS.js → monaco-editor-Cpw9JqW2.js} +1 -1
  180. package/dist/client/assets/{monitoring-stats-row-Cx7S4sFz.js → monitoring-stats-row-CR8Pz4AG.js} +1 -1
  181. package/dist/client/assets/{multi-select-BsYgOBGm.js → multi-select-d0qSjN1D.js} +1 -1
  182. package/dist/client/assets/{mustache-D7UTScQH.js → mustache-BlQTgv16.js} +1 -1
  183. package/dist/client/assets/{new-project-dialog-DdG-RgMO.js → new-project-dialog-BLbuP-We.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-GzdTg9VJ.js → oauth-callback-CEt2mysn.js} +1 -1
  185. package/dist/client/assets/{oauth-callback-ai-provider-BANi9OcB.js → oauth-callback-ai-provider-CrSicNp6.js} +1 -1
  186. package/dist/client/assets/{onboarding-w2z3NDRW.js → onboarding-ChZQ4_Cn.js} +1 -1
  187. package/dist/client/assets/{openai-conversation-C7TUEjal.js → openai-conversation-Qck38y07.js} +1 -1
  188. package/dist/client/assets/{optimistic-project-sidebar-views-7fDRNM1p.js → optimistic-project-sidebar-views-DBs2dIsI.js} +1 -1
  189. package/dist/client/assets/{organization-choice-DRyD5yII.js → organization-choice-W78BZNeA.js} +1 -1
  190. package/dist/client/assets/{orgs-EvyltNU-.js → orgs-DueEMR7Z.js} +1 -1
  191. package/dist/client/assets/{page-seo-form-0-tAzxyW.js → page-seo-form-CY1JVNQO.js} +1 -1
  192. package/dist/client/assets/{pair-Cm6oR2ES.js → pair-BL76LvR6.js} +1 -1
  193. package/dist/client/assets/{plan-ladder-D4-VvMwX.js → plan-ladder-CBREr6Ld.js} +1 -1
  194. package/dist/client/assets/{popover-DGVyEQ9q.js → popover-P9zPzqJX.js} +1 -1
  195. package/dist/client/assets/{post-calendar-CGDOG4Ay.js → post-calendar-JcrcT1nM.js} +1 -1
  196. package/dist/client/assets/{post-editor-BFSJ6I4d.js → post-editor-C5HYxFbJ.js} +1 -1
  197. package/dist/client/assets/{preview-content-KcSZme5m.js → preview-content-ChI0T8Cs.js} +1 -1
  198. package/dist/client/assets/{preview-dialog-DHH8biYM.js → preview-dialog-CFiVBx33.js} +1 -1
  199. package/dist/client/assets/{preview-panel-CMlsnFlv.js → preview-panel-BMAYjh5J.js} +1 -1
  200. package/dist/client/assets/{product-picker-dialog-Bz7bVPFI.js → product-picker-dialog-DZ5LfyYE.js} +1 -1
  201. package/dist/client/assets/{profile-be5NkG2U.js → profile-DB49xk9A.js} +1 -1
  202. package/dist/client/assets/{project-app-view-BV4H0rEJ.js → project-app-view-Dv1i76zf.js} +1 -1
  203. package/dist/client/assets/{project-feed-Dly67hgE.js → project-feed-CvGIQNLX.js} +1 -1
  204. package/dist/client/assets/{project-icon-CMe6LZd9.js → project-icon-Ds5KkwAm.js} +1 -1
  205. package/dist/client/assets/project-reports-Bt1ILOwc.js +1 -0
  206. package/dist/client/assets/project-tasks-CMbWkOn0.js +1 -0
  207. package/dist/client/assets/{projects-CDscJwj7.js → projects-8sHbBlFT.js} +1 -1
  208. package/dist/client/assets/{projects-empty-state-VFtNQKgJ.js → projects-empty-state-IOAu-wpI.js} +1 -1
  209. package/dist/client/assets/{prompts-CG--DGsd.js → prompts-Ce0XP9qb.js} +1 -1
  210. package/dist/client/assets/record-editor-C6Bydih8.js +1 -0
  211. package/dist/client/assets/redirect-editor-BH-M-WaR.js +1 -0
  212. package/dist/client/assets/{reports-CODPKkJO.js → reports-CE5LHXXr.js} +1 -1
  213. package/dist/client/assets/reports-CKooFM0m.js +1 -0
  214. package/dist/client/assets/{reports-onboarding-D0Irch0-.js → reports-onboarding-p3K1uYqw.js} +1 -1
  215. package/dist/client/assets/{reports-tab-NvqzpdHL.js → reports-tab-BXua1NQM.js} +2 -2
  216. package/dist/client/assets/{repositories-xZsmQvzi.js → repositories-ToQv_rZB.js} +1 -1
  217. package/dist/client/assets/{repository-binding-C_InVumU.js → repository-binding-CPA8-dMz.js} +1 -1
  218. package/dist/client/assets/{repository-import-picker-Bixi7zBc.js → repository-import-picker-DG4AirBH.js} +1 -1
  219. package/dist/client/assets/{repository-picker-BHgNNGrn.js → repository-picker-BfnPBGTa.js} +1 -1
  220. package/dist/client/assets/{require-capability-D49j17CD.js → require-capability-B_m0hTh2.js} +1 -1
  221. package/dist/client/assets/{required-auth-layout-CxaLcttO.js → required-auth-layout-DqtVx04D.js} +1 -1
  222. package/dist/client/assets/{reset-password-Bg3-bOJi.js → reset-password-Badkqm_7.js} +1 -1
  223. package/dist/client/assets/{resizable-sj2QiDEc.js → resizable-BTJacEf8.js} +1 -1
  224. package/dist/client/assets/{resolve-tab-icon-Benn2iaL.js → resolve-tab-icon-rGkJ7QGs.js} +1 -1
  225. package/dist/client/assets/{review-settings-DjIYcWCV.js → review-settings-DFCkjKmA.js} +1 -1
  226. package/dist/client/assets/{rich-text-link-control-C2ryIXD3.js → rich-text-link-control-CGRceWX2.js} +1 -1
  227. package/dist/client/assets/{roles-8gcvGZJw.js → roles-BirPgyBv.js} +1 -1
  228. package/dist/client/assets/route-AynshQR9.js +1 -0
  229. package/dist/client/assets/{route-C0mgkpSg.js → route-BelNzFge.js} +1 -1
  230. package/dist/client/assets/{route-DyDxvrHS.js → route-Dx6968P1.js} +1 -1
  231. package/dist/client/assets/{runnable-block-editor-dTVVXX5v.js → runnable-block-editor-BfWUQRiS.js} +4 -4
  232. package/dist/client/assets/{sandbox-lifecycle-context-DzcFvw1G.js → sandbox-lifecycle-context-BUwLKKqW.js} +1 -1
  233. package/dist/client/assets/{schema-DyLXU88M.js → schema-DyDDwNs8.js} +1 -1
  234. package/dist/client/assets/{scroll-area-DYybJ63r.js → scroll-area-BJew8KVi.js} +1 -1
  235. package/dist/client/assets/{search-input-DJwYl_zW.js → search-input-iE4YnSAW.js} +1 -1
  236. package/dist/client/assets/{search-toggle-DOVOYril.js → search-toggle-BcxWLlTq.js} +1 -1
  237. package/dist/client/assets/{secret-picker-C40fL6uP.js → secret-picker-DPGoj7h_.js} +1 -1
  238. package/dist/client/assets/{secrets-Kq6gwxOB.js → secrets-B8z_kU7L.js} +1 -1
  239. package/dist/client/assets/sections-editor-CrDBRhDJ.js +4 -0
  240. package/dist/client/assets/{select-CEirlFRV.js → select-DStdJ5GE.js} +1 -1
  241. package/dist/client/assets/{select-model-5mFHKpuo.js → select-model-DktuB9we.js} +1 -1
  242. package/dist/client/assets/{seo-editor-DHTxrlCs.js → seo-editor-Do_o2mpU.js} +1 -1
  243. package/dist/client/assets/{separator-E-ZvgvRL.js → separator-DjT0GNN3.js} +1 -1
  244. package/dist/client/assets/{settings-tab-C9ihpTae.js → settings-tab-Bp_kIMZk.js} +1 -1
  245. package/dist/client/assets/{sheet-Bs1jJD9o.js → sheet-DrnvYUkv.js} +1 -1
  246. package/dist/client/assets/{shell-layout-DZBrJWAA.js → shell-layout-es79-GX2.js} +1 -1
  247. package/dist/client/assets/{skills-7xwa1ol9.js → skills-tgcVsI6y.js} +1 -1
  248. package/dist/client/assets/{slider-ki239RUG.js → slider-DDCTVa3c.js} +1 -1
  249. package/dist/client/assets/{sortable.esm-Dvqn6rnz.js → sortable.esm-DMnnxTnV.js} +1 -1
  250. package/dist/client/assets/{sso-n5eUQ_Xy.js → sso-CjxHBVq1.js} +1 -1
  251. package/dist/client/assets/{suggestion-DHADwupQ.js → suggestion-lK-gfS31.js} +1 -1
  252. package/dist/client/assets/{switch-BD8_vvWq.js → switch-Kct2nT2R.js} +1 -1
  253. package/dist/client/assets/{symbol-Dx-KpnN7.js → symbol-ConDXyHb.js} +1 -1
  254. package/dist/client/assets/{synced-repos-B-5rRFwb.js → synced-repos-BldmP6l5.js} +1 -1
  255. package/dist/client/assets/{tab-icon-glyph-B9KZAh18.js → tab-icon-glyph-TqQzdqzw.js} +1 -1
  256. package/dist/client/assets/{table-B1C2ctbL.js → table-D3NAm7Bc.js} +1 -1
  257. package/dist/client/assets/{tabs-tkvg_YSq.js → tabs-BmpbjUEc.js} +1 -1
  258. package/dist/client/assets/{task-board-DcolQ15W.js → task-board-B3rwHKUr.js} +1 -1
  259. package/dist/client/assets/{task-route-Dp4TtKUe.js → task-route-BuUiu92l.js} +1 -1
  260. package/dist/client/assets/{task-status-CF9KSEEA.js → task-status-D3rjOgq8.js} +1 -1
  261. package/dist/client/assets/taskboard-analytics-DQb8UlLT.js +1 -0
  262. package/dist/client/assets/tasks-B-ZKkcGw.js +1 -0
  263. package/dist/client/assets/{tasks-B6gqzeMQ.js → tasks-ChYbt0G7.js} +1 -1
  264. package/dist/client/assets/{textarea-BpBHfDQd.js → textarea-BWzL69YC.js} +1 -1
  265. package/dist/client/assets/{thread-analytics-DfV1z1-8.js → thread-analytics-tujDJaK3.js} +1 -1
  266. package/dist/client/assets/{thread-button-BNBHV_Wu.js → thread-button-BzqfKMW2.js} +1 -1
  267. package/dist/client/assets/{thread-intent-DqexYQAC.js → thread-intent-CJ-s3I0o.js} +1 -1
  268. package/dist/client/assets/{thread-route-B-yx1tFW.js → thread-route-CV6SbsTq.js} +1 -1
  269. package/dist/client/assets/{thread-route-BXR-ufCz.js → thread-route-GHLN4JK9.js} +1 -1
  270. package/dist/client/assets/{thread-sheet-body-Bgp-QwJy.js → thread-sheet-body-D5eS4AiQ.js} +1 -1
  271. package/dist/client/assets/{time-range-picker-DILwkH82.js → time-range-picker-D2lucQp_.js} +1 -1
  272. package/dist/client/assets/{toggle-group-SSpwI-zE.js → toggle-group-OQufBZdd.js} +1 -1
  273. package/dist/client/assets/{tool-namespace-CsdkV2uo.js → tool-namespace-BNEevFqW.js} +1 -1
  274. package/dist/client/assets/{toolbar-icon-button-CIXm0pyl.js → toolbar-icon-button-CXgkBoho.js} +1 -1
  275. package/dist/client/assets/{tooltip-CUk78XFR.js → tooltip-B7gx1fFf.js} +1 -1
  276. package/dist/client/assets/{tooltipContext-BY8Qgc3U.js → tooltipContext-C3VsicNY.js} +1 -1
  277. package/dist/client/assets/{track-DDd4x4-Y.js → track-BmECy8By.js} +1 -1
  278. package/dist/client/assets/{types-DPbXDbOS.js → types-D-iizAZX.js} +1 -1
  279. package/dist/client/assets/{url-slug-CFKzH8Z4.js → url-slug-yE9p_CBQ.js} +1 -1
  280. package/dist/client/assets/{usage-stats-wClM7TZ-.js → usage-stats-CmZMkNV4.js} +1 -1
  281. package/dist/client/assets/{use-ai-providers-CAEoYJwC.js → use-ai-providers-BuM6ovEv.js} +1 -1
  282. package/dist/client/assets/{use-automations-DXjaaH0T.js → use-automations-LJ6ovb1E.js} +1 -1
  283. package/dist/client/assets/{use-autosave-BOlmY_xu.js → use-autosave-CF8yQfdB.js} +1 -1
  284. package/dist/client/assets/{use-chat-layout-state-BYcPLpFV.js → use-chat-layout-state-DSr0gtOa.js} +1 -1
  285. package/dist/client/assets/{use-chat-navigation-CKcbdotk.js → use-chat-navigation-CtLOIOM3.js} +1 -1
  286. package/dist/client/assets/{use-clock-tick-CwQv-OCe.js → use-clock-tick-CjMIMPxr.js} +1 -1
  287. package/dist/client/assets/{use-connect-companion-PBAraKBj.js → use-connect-companion-CwbSClFC.js} +1 -1
  288. package/dist/client/assets/{use-connection-DldRXuvq.js → use-connection-CYbCdCg-.js} +1 -1
  289. package/dist/client/assets/{use-copy-BC3Fmh27.js → use-copy-DQJK1-Md.js} +1 -1
  290. package/dist/client/assets/{use-create-virtual-mcp-D8P6CVcB.js → use-create-virtual-mcp-BUTNkXFZ.js} +1 -1
  291. package/dist/client/assets/{use-date-fns-locale-DquxgLdE.js → use-date-fns-locale-Co69xfV4.js} +1 -1
  292. package/dist/client/assets/{use-debounced-autosave-mYSK51JG.js → use-debounced-autosave-x27V8Nl7.js} +1 -1
  293. package/dist/client/assets/{use-debounced-value-CNkuXNOW.js → use-debounced-value-gqRwYLiP.js} +1 -1
  294. package/dist/client/assets/{use-deco-credits-DKtKOwIN.js → use-deco-credits-BXoQO4ZL.js} +1 -1
  295. package/dist/client/assets/{use-decopilot-events-DH5jig6y.js → use-decopilot-events-DTg4q8xq.js} +1 -1
  296. package/dist/client/assets/{use-delete-connection-Dzg9cQZm.js → use-delete-connection-AGx8DbMG.js} +1 -1
  297. package/dist/client/assets/{use-deployment-admin-CyBWrUgL.js → use-deployment-admin-0LqCMWJq.js} +1 -1
  298. package/dist/client/assets/{use-ensure-project-folder-CdHM_a-9.js → use-ensure-project-folder-BJtbErXB.js} +1 -1
  299. package/dist/client/assets/use-fast-preview-draft-url-Cf70Sary.js +1 -0
  300. package/dist/client/assets/{use-file-configs-DsMQGho1.js → use-file-configs-yKzFEaLv.js} +1 -1
  301. package/dist/client/assets/{use-infinite-scroll-C0Ths8NM.js → use-infinite-scroll-bleQjS0V.js} +1 -1
  302. package/dist/client/assets/{use-join-requests-CoVXbvos.js → use-join-requests-hLy1Es2J.js} +1 -1
  303. package/dist/client/assets/{use-main-panel-tabs-DlD2zr1g.js → use-main-panel-tabs-CnECwxGP.js} +1 -1
  304. package/dist/client/assets/{use-mcp-auth-status-B2t4xmcR.js → use-mcp-auth-status-96a5nrqO.js} +1 -1
  305. package/dist/client/assets/{use-mcp-client-C5uLw7Lc.js → use-mcp-client-CaTe2ylT.js} +1 -1
  306. package/dist/client/assets/{use-mcp-prompts-Dxu80Ack.js → use-mcp-prompts-CatolySn.js} +1 -1
  307. package/dist/client/assets/{use-mcp-tools-Cm9CvYn6.js → use-mcp-tools-DSK4UhCW.js} +1 -1
  308. package/dist/client/assets/{use-members-C9_S9nP9.js → use-members-DpzUOwzJ.js} +1 -1
  309. package/dist/client/assets/{use-mobile-Buz9Esa_.js → use-mobile-CW5odOpu.js} +1 -1
  310. package/dist/client/assets/{use-navigate-to-agent-C41zpB_Z.js → use-navigate-to-agent-d5laMYnC.js} +1 -1
  311. package/dist/client/assets/use-new-blocks-editor-Cz0Ycsmz.js +1 -0
  312. package/dist/client/assets/{use-open-billing-url-C1VukQDg.js → use-open-billing-url-Cp2-WoXr.js} +1 -1
  313. package/dist/client/assets/{use-org-auth-client-DjRiIxwH.js → use-org-auth-client-BK9SNEwg.js} +1 -1
  314. package/dist/client/assets/{use-org-fs-DqhUUlbQ.js → use-org-fs-CGkxTNmD.js} +1 -1
  315. package/dist/client/assets/{use-org-repo-syncs-cx9r2nZl.js → use-org-repo-syncs-DD7U_Wvq.js} +1 -1
  316. package/dist/client/assets/{use-org-sso-DVCQNBfN.js → use-org-sso-BFc5mu2c.js} +1 -1
  317. package/dist/client/assets/{use-organization-roles-Bp0RCVOK.js → use-organization-roles-_ra6WqmV.js} +1 -1
  318. package/dist/client/assets/{use-organization-settings-B0rQmLIX.js → use-organization-settings-DYBuXxZf.js} +1 -1
  319. package/dist/client/assets/{use-panel-navigate-DOyxnt44.js → use-panel-navigate-BSNsfU5E.js} +1 -1
  320. package/dist/client/assets/{use-project-scope-DJTJDi3A.js → use-project-scope-B0llZYB3.js} +1 -1
  321. package/dist/client/assets/{use-releases-BXUiPgUU.js → use-releases-CtMKqMnj.js} +1 -1
  322. package/dist/client/assets/{use-reports-diagnostic-frCP_UW9.js → use-reports-diagnostic-BUInMZkH.js} +1 -1
  323. package/dist/client/assets/{use-sandbox-events-Clj9v6On.js → use-sandbox-events-BWuyZLCb.js} +1 -1
  324. package/dist/client/assets/{use-secrets-CIfBnw6x.js → use-secrets-DZiT1hfy.js} +1 -1
  325. package/dist/client/assets/{use-section-preview-base-BYZSxM0z.js → use-section-preview-base-C_HnXvmD.js} +1 -1
  326. package/dist/client/assets/{use-tags-Blq5AODj.js → use-tags-D9KDSClM.js} +1 -1
  327. package/dist/client/assets/{use-task-board-analytics-D09WT40p.js → use-task-board-analytics-BeVdM1sk.js} +1 -1
  328. package/dist/client/assets/{use-task-board-events-Bx8_k4aV.js → use-task-board-events-BGOp2VgA.js} +1 -1
  329. package/dist/client/assets/{use-task-board-item-prs-Bsgf-2Zm.js → use-task-board-item-prs-CoAaBXmY.js} +1 -1
  330. package/dist/client/assets/{use-task-board-items-CIYsbBEM.js → use-task-board-items-5GcCOG2k.js} +1 -1
  331. package/dist/client/assets/{use-task-metadata-DDV_r81k.js → use-task-metadata-BtjkeyMc.js} +1 -1
  332. package/dist/client/assets/{use-thread-analytics-BuosijZj.js → use-thread-analytics-hmgxoK5f.js} +1 -1
  333. package/dist/client/assets/{use-thread-outputs-D13C6fsy.js → use-thread-outputs-PMUX8yZJ.js} +1 -1
  334. package/dist/client/assets/useInfiniteQuery-Cogq3tDA.js +1 -0
  335. package/dist/client/assets/{useQueries-DZMzH0ea.js → useQueries-CYxeWZY5.js} +1 -1
  336. package/dist/client/assets/useSuspenseInfiniteQuery-BbeYvXgw.js +1 -0
  337. package/dist/client/assets/{users-CE3WLjUJ.js → users-D-me7s_R.js} +1 -1
  338. package/dist/client/assets/{utils-qUv9_Hyk.js → utils-B68PenDU.js} +1 -1
  339. package/dist/client/assets/{variant-calendar-B604PCFx.js → variant-calendar-DRmc-Qwc.js} +1 -1
  340. package/dist/client/assets/{variant-matcher-override-CgF3ujB9.js → variant-matcher-override-cnXBxn5m.js} +1 -1
  341. package/dist/client/assets/{view-mode-toggle-BaZ1kmhW.js → view-mode-toggle-t5oMnsLw.js} +1 -1
  342. package/dist/client/assets/{virtual-mcp-CWsV4-pi.js → virtual-mcp-EknFjHGW.js} +1 -1
  343. package/dist/client/assets/{watch-sse-pool-BjTl5yOD.js → watch-sse-pool-BBIuBzhf.js} +1 -1
  344. package/dist/client/index.html +2 -2
  345. package/dist/server/server.js +2 -2
  346. package/package.json +1 -1
  347. package/dist/client/assets/agent-app-fS8AS09U.js +0 -1
  348. package/dist/client/assets/agent-deck-BSKZhX9C.js +0 -1
  349. package/dist/client/assets/agent-library-BORVKAKi.js +0 -1
  350. package/dist/client/assets/agent-library-file-CQVtmhou.js +0 -1
  351. package/dist/client/assets/agent-settings-CP8WaMNS.js +0 -1
  352. package/dist/client/assets/agent-site-editor-code-DBqdRzpW.js +0 -2
  353. package/dist/client/assets/agent-site-editor-preview-CMWo8Jpl.js +0 -518
  354. package/dist/client/assets/agent-view-BHgh3Lxp.js +0 -1
  355. package/dist/client/assets/api-keys-DLMcrFXL.js +0 -1
  356. package/dist/client/assets/app-editor-CJc6hCJ6.js +0 -1
  357. package/dist/client/assets/chat-context-BR-PmAJg.js +0 -39
  358. package/dist/client/assets/claim-phase-copy-C0pvoElR.js +0 -1
  359. package/dist/client/assets/flat-project-YGEAxpJq.js +0 -1
  360. package/dist/client/assets/index-D7k-FSss.css +0 -1
  361. package/dist/client/assets/library-BIKWwK0_.js +0 -1
  362. package/dist/client/assets/project-reports-BqyykKm5.js +0 -1
  363. package/dist/client/assets/project-tasks-DHxi49Je.js +0 -1
  364. package/dist/client/assets/record-editor-CQTy2--L.js +0 -1
  365. package/dist/client/assets/redirect-editor-Diq4Tlsx.js +0 -1
  366. package/dist/client/assets/reports-Bew0urwY.js +0 -1
  367. package/dist/client/assets/route-DQYAyMBI.js +0 -1
  368. package/dist/client/assets/sections-editor-5-gvD3vu.js +0 -1
  369. package/dist/client/assets/taskboard-analytics-C_zsZRzy.js +0 -1
  370. package/dist/client/assets/tasks-O62NX5lN.js +0 -1
  371. package/dist/client/assets/use-fast-preview-draft-url-Cuacxxyo.js +0 -1
  372. package/dist/client/assets/use-new-blocks-editor-DuP8uKZj.js +0 -1
  373. package/dist/client/assets/useInfiniteQuery-B3MUNCKJ.js +0 -1
  374. package/dist/client/assets/useSuspenseInfiniteQuery-DPTWpcSJ.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as me,b as he,a2 as pe,d as je,u as Se,a as we,j as s,n as oe,F as Ne,o as Te,K as ee,r as te,a4 as ge,B as de,ff as ye,l as ve,b2 as ce,m as ze,h as Ee}from"./index-4XFLhK7S.js";import{t as ke}from"./Building02-EbX1A23K.js";import{s as Ce}from"./User01-BGOQS9vx.js";import{a as Me,A as Oe}from"./alert-DYBIxnQj.js";import{T as _e,a as De,b as Fe}from"./tooltip-CUk78XFR.js";import{C as Pe}from"./collection-tabs-C6HP7d51.js";import{E as Le}from"./empty-state-CsVqjGqu.js";import{u as $e}from"./use-clock-tick-CwQv-OCe.js";import{e as qe,u as Ae,s as Ie,w as Ke}from"./use-org-fs-DqhUUlbQ.js";import"./index-DujNp8wX.js";import"./badge-Dp13ql_I.js";import"./useInfiniteQuery-B3MUNCKJ.js";import"./infiniteQueryObserver-DLzEnjM8.js";const Re=16e3;function He(t,e){return t==="organization"?"MEMORY.md":`users/${e}/MEMORY.md`}function Qe(t){return t==="organization"?`# Organization memory
1
+ import{c as me,b as he,a2 as pe,d as je,u as Se,a as we,j as s,n as oe,F as Ne,o as Te,K as ee,r as te,a4 as ge,B as de,ff as ye,l as ve,b2 as ce,m as ze,h as Ee}from"./index-C3moojPl.js";import{t as ke}from"./Building02-DDW-F58b.js";import{s as Ce}from"./User01-B7hPiYB7.js";import{a as Me,A as Oe}from"./alert-BavK6rpL.js";import{T as _e,a as De,b as Fe}from"./tooltip-B7gx1fFf.js";import{C as Pe}from"./collection-tabs-C39YFQ2E.js";import{E as Le}from"./empty-state-BZTHulBK.js";import{u as $e}from"./use-clock-tick-CjMIMPxr.js";import{e as qe,u as Ae,s as Ie,w as Ke}from"./use-org-fs-CGkxTNmD.js";import"./index-DjXrdMkW.js";import"./badge-NHL6jQ7U.js";import"./useInfiniteQuery-Cogq3tDA.js";import"./infiniteQueryObserver-DMRptffd.js";const Re=16e3;function He(t,e){return t==="organization"?"MEMORY.md":`users/${e}/MEMORY.md`}function Qe(t){return t==="organization"?`# Organization memory
2
2
 
3
3
  Durable facts shared with everyone in this organization. Keep this a concise, curated index — not a log.
4
4
  `:`# User memory
@@ -1 +1 @@
1
- import{c as R,l as h,j as s}from"./index-4XFLhK7S.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-C3moojPl.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 +1 @@
1
- import{c as p,r as c,fw as f,j as l,H as h,fx as g}from"./index-4XFLhK7S.js";function w(u){const e=p.c(5),{seed:i,children:s}=u;let t;e[0]!==i?(t=()=>{const o=new f({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,retry:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchInterval:!1}}});return i(o),o},e[0]=i,e[1]=t):t=e[1];const[n]=c.useState(t);let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none absolute inset-0 select-none overflow-hidden",children:l.jsx(h,{fallback:null,children:l.jsx(c.Suspense,{fallback:null,children:l.jsx(g,{client:n,children:s})})})}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}const d=new Date().toISOString();function r(u,e,i,s,t,n){return{id:u,organizationId:"preview",title:e,description:null,repositoryId:null,virtualMcpId:null,sprintId:null,status:i,priority:t,type:s,assigneeId:null,assignedBy:null,repo:null,dueDate:null,sortOrder:n,keySeq:n,externalUrl:null,previewRoutes:[],source:null,retryAttempts:0,reviewCycleStartedAt:null,threads:[],tags:[],reviewVerdicts:[],statusSince:null,createdBy:"preview",createdAt:d,updatedBy:"preview",updatedAt:d}}function y(){return{items:[r("p1","Fix checkout shipping estimate","triage","bug","high",1),r("p2","Add size guide to product page","triage","feature","medium",2),r("p3","Compress hero images","triage","chore","low",3),r("p4","Rewrite category descriptions","in_progress","feature","medium",4),r("p5","Audit broken redirects","in_progress","chore","high",5),r("p6","New arrivals landing page","in_review","feature","high",6),r("p7","Speed up search results","qa","chore","medium",7),r("p8","Black Friday banner","done","feature","urgent",8)],repos:[],columns:[]}}export{w as P,y as m};
1
+ import{c as p,r as c,fw as f,j as l,H as h,fx as g}from"./index-C3moojPl.js";function w(u){const e=p.c(5),{seed:i,children:s}=u;let t;e[0]!==i?(t=()=>{const o=new f({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,retry:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchInterval:!1}}});return i(o),o},e[0]=i,e[1]=t):t=e[1];const[n]=c.useState(t);let a;return e[2]!==s||e[3]!==n?(a=l.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none absolute inset-0 select-none overflow-hidden",children:l.jsx(h,{fallback:null,children:l.jsx(c.Suspense,{fallback:null,children:l.jsx(g,{client:n,children:s})})})}),e[2]=s,e[3]=n,e[4]=a):a=e[4],a}const d=new Date().toISOString();function r(u,e,i,s,t,n){return{id:u,organizationId:"preview",title:e,description:null,repositoryId:null,virtualMcpId:null,sprintId:null,status:i,priority:t,type:s,assigneeId:null,assignedBy:null,repo:null,dueDate:null,sortOrder:n,keySeq:n,externalUrl:null,previewRoutes:[],source:null,retryAttempts:0,reviewCycleStartedAt:null,threads:[],tags:[],reviewVerdicts:[],statusSince:null,createdBy:"preview",createdAt:d,updatedBy:"preview",updatedAt:d}}function y(){return{items:[r("p1","Fix checkout shipping estimate","triage","bug","high",1),r("p2","Add size guide to product page","triage","feature","medium",2),r("p3","Compress hero images","triage","chore","low",3),r("p4","Rewrite category descriptions","in_progress","feature","medium",4),r("p5","Audit broken redirects","in_progress","chore","high",5),r("p6","New arrivals landing page","in_review","feature","high",6),r("p7","Speed up search results","qa","chore","medium",7),r("p8","Black Friday banner","done","feature","urgent",8)],repos:[],columns:[]}}export{w as P,y as m};
@@ -1,4 +1,4 @@
1
- import{r as m,j as c,h as I,c as k,aX as v}from"./index-4XFLhK7S.js";import{l as S,c as L,F as $}from"./editor-CklcmkgZ.js";import{d as K}from"./delay-CnY5UFtP.js";L();async function D(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 c,h as I,c as k,aX as v}from"./index-C3moojPl.js";import{l as S,c as L,F as $}from"./editor-B4h2oI8R.js";import{d as K}from"./delay-CnY5UFtP.js";L();async function D(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{c as lt,l as J,j as l}from"./index-4XFLhK7S.js";import{C as Q,d as Z}from"./chart-CXoR26LQ.js";import{C as tt,Y as et,A as mt,a as dt}from"./AreaChart-CUWmFHwI.js";import{X as at}from"./XAxis-4jP2_ps6.js";import{C as ut}from"./tooltipContext-BY8Qgc3U.js";import{a as ht,B as pt}from"./BarChart-gbo6r8aY.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),d=a[x];d&&(d.calls+=1,o.isError&&(d.errors+=1),Number.isFinite(o.durationMs)&&d.durations.push(o.durationMs))}return a.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((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function Ct(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let d;t[3]!==x||t[4]!==m||t[5]!==i?(d=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=d):d=t[6];const S=d;let y;t[7]!==a?(y=l.jsx("div",{className:"text-[11px] text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let b;t[11]!==S?(b=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=b):b=t[12];let p;t[13]!==k||t[14]!==b?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,b]}),t[13]=k,t[14]=b,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg border bg-background px-3 py-2 shadow-md",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Lt(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(u=>u[e]??0),0);if(g==="area"){let u;t[0]!==c?(u=J(c,"w-full"),t[0]=c,t[1]=u):u=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let v;t[5]!==e||t[6]!==M?(v={[e]:M},t[5]=e,t[6]=M,t[7]=v):v=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(at,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(et,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(mt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(dt,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==u||t[41]!==v?(H=l.jsx(Z,{role:"img","aria-label":n,className:u,config:v,children:B}),t[38]=n,t[39]=B,t[40]=u,t[41]=v,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let d;t[48]!==e||t[49]!==x?(d={[e]:x},t[48]=e,t[49]=x,t[50]=d):d=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const b=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==b?(p=l.jsx(at,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:b,tickMargin:8}),t[54]=b,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(et,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:u=>{const{active:M,payload:v}=u;return l.jsx(rt,{active:M,payload:v,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let u;t[67]!==a||t[68]!==e?(u=(M,v)=>l.jsx(ut,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${v}`),t[67]=a,t[68]=e,t[69]=u):u=t[69],L=r.map(u),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(ht,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(pt,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==d?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:d,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=d,t[84]=F):F=t[84],F}export{Lt as K,Ct as c};
1
+ import{c as lt,l as J,j as l}from"./index-C3moojPl.js";import{C as Q,d as Z}from"./chart-yyGN_0NT.js";import{C as tt,Y as et,A as mt,a as dt}from"./AreaChart-DB6yNBzt.js";import{X as at}from"./XAxis-BlThxQ5X.js";import{C as ut}from"./tooltipContext-C3VsicNY.js";import{a as ht,B as pt}from"./BarChart-CwA-ga4F.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),d=a[x];d&&(d.calls+=1,o.isError&&(d.errors+=1),Number.isFinite(o.durationMs)&&d.durations.push(o.durationMs))}return a.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((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function Ct(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let d;t[3]!==x||t[4]!==m||t[5]!==i?(d=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=d):d=t[6];const S=d;let y;t[7]!==a?(y=l.jsx("div",{className:"text-[11px] text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let b;t[11]!==S?(b=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=b):b=t[12];let p;t[13]!==k||t[14]!==b?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,b]}),t[13]=k,t[14]=b,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg border bg-background px-3 py-2 shadow-md",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Lt(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(u=>u[e]??0),0);if(g==="area"){let u;t[0]!==c?(u=J(c,"w-full"),t[0]=c,t[1]=u):u=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let v;t[5]!==e||t[6]!==M?(v={[e]:M},t[5]=e,t[6]=M,t[7]=v):v=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(at,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(et,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(mt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(dt,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==u||t[41]!==v?(H=l.jsx(Z,{role:"img","aria-label":n,className:u,config:v,children:B}),t[38]=n,t[39]=B,t[40]=u,t[41]=v,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let d;t[48]!==e||t[49]!==x?(d={[e]:x},t[48]=e,t[49]=x,t[50]=d):d=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const b=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==b?(p=l.jsx(at,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:b,tickMargin:8}),t[54]=b,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(et,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:u=>{const{active:M,payload:v}=u;return l.jsx(rt,{active:M,payload:v,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let u;t[67]!==a||t[68]!==e?(u=(M,v)=>l.jsx(ut,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${v}`),t[67]=a,t[68]=e,t[69]=u):u=t[69],L=r.map(u),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(ht,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(pt,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==d?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:d,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=d,t[84]=F):F=t[84],F}export{Lt as K,Ct as c};
@@ -1 +1 @@
1
- import{c as fe,r as Z,l as he,j as t,B as pe}from"./index-4XFLhK7S.js";import{B as re}from"./badge-Dp13ql_I.js";import{C as ce}from"./checkbox-CGTvhz0x.js";import{t as de}from"./ChevronUp-BSm7AtSf.js";import{C as xe,a as ge,b as me,c as ve,e as je,f as Ce}from"./command-BfXTTBD9.js";import{a as be,b as Ne,P as ye}from"./popover-DGVyEQ9q.js";const we=[];function Ae(o){const e=fe.c(72),{options:n,onValueChange:i,defaultValue:ee,placeholder:te,variant:se,animation:le,maxCount:ae,modalPopover:ne,asChild:ie,className:J,disabled:oe,onSearchChange:P}=o,d=ee===void 0?we:ee,Y=te===void 0?"Select items":te,V=se===void 0?"default":se,_=le===void 0?0:le,k=ae===void 0?3:ae,F=ne===void 0?!1:ne,G=ie===void 0?!1:ie,L=oe===void 0?!1:oe,[s,S]=Z.useState(d),[q,E]=Z.useState(!1);let O,B;e[0]!==d||e[1]!==s?(B=()=>{JSON.stringify(s)!==JSON.stringify(d)&&S(d)},O=[d,s],e[0]=d,e[1]=s,e[2]=O,e[3]=B):(O=e[2],B=e[3]),Z.useEffect(B,O);let D;e[4]!==i||e[5]!==s?(D=l=>{if(l.key==="Enter")E(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const a=[...s];a.pop(),S(a),i(a)}},e[4]=i,e[5]=s,e[6]=D):D=e[6];const H=D;let I;e[7]!==i||e[8]!==s?(I=l=>{const a=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];S(a),i(a)},e[7]=i,e[8]=s,e[9]=I):I=e[9];const c=I;let A;e[10]!==i?(A=()=>{S([]),i([])},e[10]=i,e[11]=A):A=e[11];const Q=A;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{E(Ve)},e[12]=R):R=e[12];const ue=R;let T;e[13]!==Q||e[14]!==i||e[15]!==n||e[16]!==s.length?(T=()=>{if(s.length===n.length)Q();else{const l=n.map(Pe);S(l),i(l)}},e[13]=Q,e[14]=i,e[15]=n,e[16]=s.length,e[17]=T):T=e[17];const r=T;let m;e[18]!==G?(m=G?{}:{variant:"outline"},e[18]=G,e[19]=m):m=e[19];let u;e[20]!==J?(u=he("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 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",J),e[20]=J,e[21]=u):u=e[21];let f;e[22]!==_||e[23]!==k||e[24]!==n||e[25]!==Y||e[26]!==s||e[27]!==V?(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(X=>X.value===l),w=a?.icon;return t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${_}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(re,{variant:V==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${_}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(de,{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:Y}),t.jsx(de,{size:20,className:"shrink-0 opacity-50"})]}),e[22]=_,e[23]=k,e[24]=n,e[25]=Y,e[26]=s,e[27]=V,e[28]=f):f=e[28];let h;e[29]!==L||e[30]!==m||e[31]!==u||e[32]!==f?(h=t.jsx(be,{asChild:!0,children:t.jsx(pe,{ref:null,...m,onClick:ue,className:u,disabled:L,children:f})}),e[29]=L,e[30]=m,e[31]=u,e[32]=f,e[33]=h):h=e[33];let K;e[34]===Symbol.for("react.memo_cache_sentinel")?(K=()=>E(!1),e[34]=K):K=e[34];const U=!P;let p;e[35]!==H||e[36]!==P?(p=t.jsx(xe,{placeholder:"Search...",onKeyDown:H,onValueChange:P,className:"rounded-t-xl"}),e[35]=H,e[36]=P,e[37]=p):p=e[37];let M;e[38]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ge,{children:"No results found."}),e[38]=M):M=e[38];let x;e[39]!==r?(x=()=>{r()},e[39]=r,e[40]=x):x=e[40];let g;e[41]!==r?(g=l=>{l.stopPropagation(),r()},e[41]=r,e[42]=g):g=e[42];const W=s.length===n.length&&n.length>0;let v;e[43]!==W||e[44]!==r?(v=t.jsx(ce,{checked:W,onCheckedChange:r,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Se}),e[43]=W,e[44]=r,e[45]=v):v=e[45];let $;e[46]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"(Select All)"}),e[46]=$):$=e[46];let j;e[47]!==g||e[48]!==v?(j=t.jsxs("div",{className:"flex items-center w-full",onClick:g,children:[v,$]}),e[47]=g,e[48]=v,e[49]=j):j=e[49];let C;e[50]!==x||e[51]!==j?(C=t.jsx(me,{onSelect:x,className:"cursor-pointer",children:j},"all"),e[50]=x,e[51]=j,e[52]=C):C=e[52];let b;if(e[53]!==n||e[54]!==s||e[55]!==c){let l;e[57]!==s||e[58]!==c?(l=a=>{const w=s.includes(a.value);return t.jsx(me,{onSelect:()=>{c(a)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:X=>{X.stopPropagation(),c(a)},children:[t.jsx(ce,{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[57]=s,e[58]=c,e[59]=l):l=e[59],b=n.map(l),e[53]=n,e[54]=s,e[55]=c,e[56]=b}else b=e[56];let N;e[60]!==C||e[61]!==b?(N=t.jsxs(ve,{className:"rounded-b-xl",children:[M,t.jsxs(je,{children:[C,b]})]}),e[60]=C,e[61]=b,e[62]=N):N=e[62];let y;e[63]!==U||e[64]!==p||e[65]!==N?(y=t.jsx(Ne,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:K,children:t.jsxs(Ce,{shouldFilter:U,className:"rounded-xl",children:[p,N]})}),e[63]=U,e[64]=p,e[65]=N,e[66]=y):y=e[66];let z;return e[67]!==q||e[68]!==F||e[69]!==h||e[70]!==y?(z=t.jsxs(ye,{open:q,onOpenChange:E,modal:F,children:[h,y]}),e[67]=q,e[68]=F,e[69]=h,e[70]=y,e[71]=z):z=e[71],z}function ke(o){return o.stopPropagation()}function Se(o){return o.stopPropagation()}function Pe(o){return o.value}function Ve(o){return!o}export{Ae as M};
1
+ import{c as fe,r as Z,l as he,j as t,B as pe}from"./index-C3moojPl.js";import{B as re}from"./badge-NHL6jQ7U.js";import{C as ce}from"./checkbox-B6gj5-qt.js";import{t as de}from"./ChevronUp-QaPEzxVx.js";import{C as xe,a as ge,b as me,c as ve,e as je,f as Ce}from"./command-CloMVJTp.js";import{a as be,b as Ne,P as ye}from"./popover-P9zPzqJX.js";const we=[];function Ae(o){const e=fe.c(72),{options:n,onValueChange:i,defaultValue:ee,placeholder:te,variant:se,animation:le,maxCount:ae,modalPopover:ne,asChild:ie,className:J,disabled:oe,onSearchChange:P}=o,d=ee===void 0?we:ee,Y=te===void 0?"Select items":te,V=se===void 0?"default":se,_=le===void 0?0:le,k=ae===void 0?3:ae,F=ne===void 0?!1:ne,G=ie===void 0?!1:ie,L=oe===void 0?!1:oe,[s,S]=Z.useState(d),[q,E]=Z.useState(!1);let O,B;e[0]!==d||e[1]!==s?(B=()=>{JSON.stringify(s)!==JSON.stringify(d)&&S(d)},O=[d,s],e[0]=d,e[1]=s,e[2]=O,e[3]=B):(O=e[2],B=e[3]),Z.useEffect(B,O);let D;e[4]!==i||e[5]!==s?(D=l=>{if(l.key==="Enter")E(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const a=[...s];a.pop(),S(a),i(a)}},e[4]=i,e[5]=s,e[6]=D):D=e[6];const H=D;let I;e[7]!==i||e[8]!==s?(I=l=>{const a=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];S(a),i(a)},e[7]=i,e[8]=s,e[9]=I):I=e[9];const c=I;let A;e[10]!==i?(A=()=>{S([]),i([])},e[10]=i,e[11]=A):A=e[11];const Q=A;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{E(Ve)},e[12]=R):R=e[12];const ue=R;let T;e[13]!==Q||e[14]!==i||e[15]!==n||e[16]!==s.length?(T=()=>{if(s.length===n.length)Q();else{const l=n.map(Pe);S(l),i(l)}},e[13]=Q,e[14]=i,e[15]=n,e[16]=s.length,e[17]=T):T=e[17];const r=T;let m;e[18]!==G?(m=G?{}:{variant:"outline"},e[18]=G,e[19]=m):m=e[19];let u;e[20]!==J?(u=he("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 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",J),e[20]=J,e[21]=u):u=e[21];let f;e[22]!==_||e[23]!==k||e[24]!==n||e[25]!==Y||e[26]!==s||e[27]!==V?(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(X=>X.value===l),w=a?.icon;return t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${_}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(re,{variant:V==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${_}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(de,{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:Y}),t.jsx(de,{size:20,className:"shrink-0 opacity-50"})]}),e[22]=_,e[23]=k,e[24]=n,e[25]=Y,e[26]=s,e[27]=V,e[28]=f):f=e[28];let h;e[29]!==L||e[30]!==m||e[31]!==u||e[32]!==f?(h=t.jsx(be,{asChild:!0,children:t.jsx(pe,{ref:null,...m,onClick:ue,className:u,disabled:L,children:f})}),e[29]=L,e[30]=m,e[31]=u,e[32]=f,e[33]=h):h=e[33];let K;e[34]===Symbol.for("react.memo_cache_sentinel")?(K=()=>E(!1),e[34]=K):K=e[34];const U=!P;let p;e[35]!==H||e[36]!==P?(p=t.jsx(xe,{placeholder:"Search...",onKeyDown:H,onValueChange:P,className:"rounded-t-xl"}),e[35]=H,e[36]=P,e[37]=p):p=e[37];let M;e[38]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ge,{children:"No results found."}),e[38]=M):M=e[38];let x;e[39]!==r?(x=()=>{r()},e[39]=r,e[40]=x):x=e[40];let g;e[41]!==r?(g=l=>{l.stopPropagation(),r()},e[41]=r,e[42]=g):g=e[42];const W=s.length===n.length&&n.length>0;let v;e[43]!==W||e[44]!==r?(v=t.jsx(ce,{checked:W,onCheckedChange:r,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Se}),e[43]=W,e[44]=r,e[45]=v):v=e[45];let $;e[46]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"(Select All)"}),e[46]=$):$=e[46];let j;e[47]!==g||e[48]!==v?(j=t.jsxs("div",{className:"flex items-center w-full",onClick:g,children:[v,$]}),e[47]=g,e[48]=v,e[49]=j):j=e[49];let C;e[50]!==x||e[51]!==j?(C=t.jsx(me,{onSelect:x,className:"cursor-pointer",children:j},"all"),e[50]=x,e[51]=j,e[52]=C):C=e[52];let b;if(e[53]!==n||e[54]!==s||e[55]!==c){let l;e[57]!==s||e[58]!==c?(l=a=>{const w=s.includes(a.value);return t.jsx(me,{onSelect:()=>{c(a)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:X=>{X.stopPropagation(),c(a)},children:[t.jsx(ce,{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[57]=s,e[58]=c,e[59]=l):l=e[59],b=n.map(l),e[53]=n,e[54]=s,e[55]=c,e[56]=b}else b=e[56];let N;e[60]!==C||e[61]!==b?(N=t.jsxs(ve,{className:"rounded-b-xl",children:[M,t.jsxs(je,{children:[C,b]})]}),e[60]=C,e[61]=b,e[62]=N):N=e[62];let y;e[63]!==U||e[64]!==p||e[65]!==N?(y=t.jsx(Ne,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:K,children:t.jsxs(Ce,{shouldFilter:U,className:"rounded-xl",children:[p,N]})}),e[63]=U,e[64]=p,e[65]=N,e[66]=y):y=e[66];let z;return e[67]!==q||e[68]!==F||e[69]!==h||e[70]!==y?(z=t.jsxs(ye,{open:q,onOpenChange:E,modal:F,children:[h,y]}),e[67]=q,e[68]=F,e[69]=h,e[70]=y,e[71]=z):z=e[71],z}function ke(o){return o.stopPropagation()}function Se(o){return o.stopPropagation()}function Pe(o){return o.value}function Ve(o){return!o}export{Ae as M};
@@ -1,4 +1,4 @@
1
- import{o as B,e as z,K as q,b as F,r as J,j as w,D as V,q as _,s as H,v as $,B as O,t as U}from"./index-4XFLhK7S.js";import{a as G}from"./input-BzdgO_dK.js";import{u as L,z as Y,A as X,B as Z,y as I,q as M}from"./claim-phase-copy-C0pvoElR.js";import{h as ee,t as te,i as re}from"./runnable-block-editor-dTVVXX5v.js";import{t as se}from"./sandbox-git-api-C7JbVL7R.js";import{u as ne}from"./chat-context-BR-PmAJg.js";import{b as ae}from"./sandbox-url-D3mC8qhT.js";import{a as ie}from"./utils-qUv9_Hyk.js";import{i as oe}from"./CheckCircle-CoJfU94i.js";import{a as ce}from"./Copy01-DlA26aBh.js";import{M as ue}from"./monaco-editor-DkahnDKS.js";function Ae({orgSlug:s,virtualMcpId:e,branch:t}){const r=B(),a=ne()?.taskId??null,n=ee(e),i=G(e).runtime==="cms",{url:o}=L(e),c=te({orgSlug:s,virtualMcpId:e,branch:t,localPreviewUrl:o});return z({mutationKey:M(s,e,t),scope:I(s,e,t),mutationFn:async({blockKey:u})=>{if(o)return{ok:!0,existed:!0};if(i){const h=await Y({orgSlug:s,virtualMcpId:e,branch:t},{delete:[u]});return X(r,{orgSlug:s,virtualMcpId:e,branch:t},h),await r.invalidateQueries({queryKey:se({orgSlug:s,virtualMcpId:e,branch:t,threadId:a})}),{ok:!0,existed:!0}}const f=re(n,ie(u)),l=await fetch(ae({orgSlug:s,virtualMcpId:e,branch:t,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():Z(l,"Delete")},onMutate:async({blockKey:u})=>{const f=q.decofile(c);await r.cancelQueries({queryKey:f});const l=r.getQueryData(f),h=!!l&&u in l,b=l?.[u];return r.setQueryData(f,k=>{if(!k)return k;const{[u]:p,...g}=k;return g}),{queryKey:f,blockKey:u,hadKey:h,previousValue:b}},onError:(u,f,l)=>{l&&r.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h)},onSuccess:()=>{r.invalidateQueries({queryKey:q.liveMeta(s,e,t)})}})}function Qe({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,f]=J.useState(!1),[l,h]=J.useState(c),[b,k]=J.useState(!1),p=!a||o,g=l!==c,d=()=>{navigator.clipboard.writeText(l).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)})},v=async m=>{if(!a||b)return;let S;try{S=JSON.parse(m)}catch{U.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}k(!0);try{await a(S),U.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(E){U.error(n("sectionsEditor.pageJsonDialog.saveError",{error:E instanceof Error?E.message:String(E)}))}finally{k(!1)}};return w.jsx(V,{open:s,onOpenChange:e,children:w.jsxs(_,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[w.jsxs(H,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[w.jsx($,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),w.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[w.jsxs(O,{variant:"ghost",size:"sm",onClick:d,className:"h-7 gap-1.5 text-xs",children:[u?w.jsx(oe,{size:12}):w.jsx(ce,{size:12}),n(u?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!p&&w.jsx(O,{size:"sm",onClick:()=>v(l),disabled:!g||b,className:"h-7 text-xs",children:n(b?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?w.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):w.jsx("div",{className:"min-h-0 flex-1 py-2",children:w.jsx(ue,{code:c,language:"json",readOnly:p,height:"100%",onChange:m=>h(m??""),onSave:m=>{v(m)}})})]})})}var le=Object.prototype.toString,j=Array.isArray||function(e){return le.call(e)==="[object Array]"};function K(s){return typeof s=="function"}function fe(s){return j(s)?"array":typeof s}function N(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function pe(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var he=RegExp.prototype.test;function de(s,e){return he.call(s,e)}var ve=/\S/;function ye(s){return!de(ve,s)}var ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function we(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return ge[t]})}var me=/\s*/,Ee=/\s+/,Q=/\s*=/,xe=/\s*\}/,ke=/#|\^|\/|>|\{|&|=|!/;function Ce(s,e){if(!s)return[];var t=!1,r=[],a=[],n=[],i=!1,o=!1,c="",u=0;function f(){if(i&&!o)for(;n.length;)delete a[n.pop()];else n=[];i=!1,o=!1}var l,h,b;function k(C){if(typeof C=="string"&&(C=C.split(Ee,2)),!j(C)||C.length!==2)throw new Error("Invalid tags: "+C);l=new RegExp(N(C[0])+"\\s*"),h=new RegExp("\\s*"+N(C[1])),b=new RegExp("\\s*"+N("}"+C[1]))}k(e||x.tags);for(var p=new R(s),g,d,v,m,S,E;!p.eos();){if(g=p.pos,v=p.scanUntil(l),v)for(var T=0,W=v.length;T<W;++T)m=v.charAt(T),ye(m)?(n.push(a.length),c+=m):(o=!0,t=!0,c+=" "),a.push(["text",m,g,g+1]),g+=1,m===`
1
+ import{o as B,e as z,K as q,b as F,r as J,j as w,D as V,q as _,s as H,v as $,B as O,t as U}from"./index-C3moojPl.js";import{a as G}from"./input-C8o95ZIl.js";import{u as L,z as Y,A as X,B as Z,y as I,q as M}from"./claim-phase-copy-CNoIfrVp.js";import{h as ee,t as te,i as re}from"./runnable-block-editor-BfWUQRiS.js";import{t as se}from"./sandbox-git-api-C7JbVL7R.js";import{u as ne}from"./chat-context-Bdbu4aFj.js";import{b as ae}from"./sandbox-url-D3mC8qhT.js";import{a as ie}from"./utils-B68PenDU.js";import{i as oe}from"./CheckCircle-pe1RxSse.js";import{a as ce}from"./Copy01-YTn6AAPK.js";import{M as ue}from"./monaco-editor-Cpw9JqW2.js";function Ae({orgSlug:s,virtualMcpId:e,branch:t}){const r=B(),a=ne()?.taskId??null,n=ee(e),i=G(e).runtime==="cms",{url:o}=L(e),c=te({orgSlug:s,virtualMcpId:e,branch:t,localPreviewUrl:o});return z({mutationKey:M(s,e,t),scope:I(s,e,t),mutationFn:async({blockKey:u})=>{if(o)return{ok:!0,existed:!0};if(i){const h=await Y({orgSlug:s,virtualMcpId:e,branch:t},{delete:[u]});return X(r,{orgSlug:s,virtualMcpId:e,branch:t},h),await r.invalidateQueries({queryKey:se({orgSlug:s,virtualMcpId:e,branch:t,threadId:a})}),{ok:!0,existed:!0}}const f=re(n,ie(u)),l=await fetch(ae({orgSlug:s,virtualMcpId:e,branch:t,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():Z(l,"Delete")},onMutate:async({blockKey:u})=>{const f=q.decofile(c);await r.cancelQueries({queryKey:f});const l=r.getQueryData(f),h=!!l&&u in l,b=l?.[u];return r.setQueryData(f,k=>{if(!k)return k;const{[u]:p,...g}=k;return g}),{queryKey:f,blockKey:u,hadKey:h,previousValue:b}},onError:(u,f,l)=>{l&&r.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h)},onSuccess:()=>{r.invalidateQueries({queryKey:q.liveMeta(s,e,t)})}})}function Qe({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,f]=J.useState(!1),[l,h]=J.useState(c),[b,k]=J.useState(!1),p=!a||o,g=l!==c,d=()=>{navigator.clipboard.writeText(l).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)})},v=async m=>{if(!a||b)return;let S;try{S=JSON.parse(m)}catch{U.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}k(!0);try{await a(S),U.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(E){U.error(n("sectionsEditor.pageJsonDialog.saveError",{error:E instanceof Error?E.message:String(E)}))}finally{k(!1)}};return w.jsx(V,{open:s,onOpenChange:e,children:w.jsxs(_,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[w.jsxs(H,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[w.jsx($,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),w.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[w.jsxs(O,{variant:"ghost",size:"sm",onClick:d,className:"h-7 gap-1.5 text-xs",children:[u?w.jsx(oe,{size:12}):w.jsx(ce,{size:12}),n(u?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!p&&w.jsx(O,{size:"sm",onClick:()=>v(l),disabled:!g||b,className:"h-7 text-xs",children:n(b?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?w.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):w.jsx("div",{className:"min-h-0 flex-1 py-2",children:w.jsx(ue,{code:c,language:"json",readOnly:p,height:"100%",onChange:m=>h(m??""),onSave:m=>{v(m)}})})]})})}var le=Object.prototype.toString,j=Array.isArray||function(e){return le.call(e)==="[object Array]"};function K(s){return typeof s=="function"}function fe(s){return j(s)?"array":typeof s}function N(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function pe(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var he=RegExp.prototype.test;function de(s,e){return he.call(s,e)}var ve=/\S/;function ye(s){return!de(ve,s)}var ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function we(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return ge[t]})}var me=/\s*/,Ee=/\s+/,Q=/\s*=/,xe=/\s*\}/,ke=/#|\^|\/|>|\{|&|=|!/;function Ce(s,e){if(!s)return[];var t=!1,r=[],a=[],n=[],i=!1,o=!1,c="",u=0;function f(){if(i&&!o)for(;n.length;)delete a[n.pop()];else n=[];i=!1,o=!1}var l,h,b;function k(C){if(typeof C=="string"&&(C=C.split(Ee,2)),!j(C)||C.length!==2)throw new Error("Invalid tags: "+C);l=new RegExp(N(C[0])+"\\s*"),h=new RegExp("\\s*"+N(C[1])),b=new RegExp("\\s*"+N("}"+C[1]))}k(e||x.tags);for(var p=new R(s),g,d,v,m,S,E;!p.eos();){if(g=p.pos,v=p.scanUntil(l),v)for(var T=0,W=v.length;T<W;++T)m=v.charAt(T),ye(m)?(n.push(a.length),c+=m):(o=!0,t=!0,c+=" "),a.push(["text",m,g,g+1]),g+=1,m===`
2
2
  `&&(f(),c="",u=0,t=!1);if(!p.scan(l))break;if(i=!0,d=p.scan(ke)||"name",p.scan(me),d==="="?(v=p.scanUntil(Q),p.scan(Q),p.scanUntil(h)):d==="{"?(v=p.scanUntil(b),p.scan(xe),p.scanUntil(h),d="&"):v=p.scanUntil(h),!p.scan(h))throw new Error("Unclosed tag at "+p.pos);if(d==">"?S=[d,v,g,p.pos,c,u,t]:S=[d,v,g,p.pos],u++,a.push(S),d==="#"||d==="^")r.push(S);else if(d==="/"){if(E=r.pop(),!E)throw new Error('Unopened section "'+v+'" at '+g);if(E[1]!==v)throw new Error('Unclosed section "'+E[1]+'" at '+g)}else d==="name"||d==="{"||d==="&"?o=!0:d==="="&&k(v)}if(f(),E=r.pop(),E)throw new Error('Unclosed section "'+E[1]+'" at '+p.pos);return Se(be(a))}function be(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 Se(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 R(s){this.string=s,this.tail=s,this.pos=0}R.prototype.eos=function(){return this.tail===""};R.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};R.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 D(s,e){this.view=s,this.cache={".":this.view},this.parent=e}D.prototype.push=function(e){return new D(e,this)};D.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=A(n,i[o])||pe(n,i[o])),n=n[i[o++]];else n=a.view[e],c=A(a.view,e);if(c){r=n;break}a=a.parent}t[e]=r}return K(r)&&(r=r.call(this.view)),r};function y(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}y.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};y.prototype.parse=function(e,t){var r=this.templateCache,a=e+":"+(t||x.tags).join(":"),n=typeof r<"u",i=n?r.get(a):void 0;return i==null&&(i=Ce(e,t),n&&r.set(a,i)),i};y.prototype.render=function(e,t,r,a){var n=this.getConfigTags(a),i=this.parse(e,n),o=t instanceof D?t:new D(t,void 0);return this.renderTokens(i,o,r,e,a)};y.prototype.renderTokens=function(e,t,r,a,n){for(var i="",o,c,u,f=0,l=e.length;f<l;++f)u=void 0,o=e[f],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};y.prototype.renderSection=function(e,t,r,a,n){var i=this,o="",c=t.lookup(e[1]);function u(h){return i.render(h,t,r,n)}if(c){if(j(c))for(var f=0,l=c.length;f<l;++f)o+=this.renderTokens(e[4],t.push(c[f]),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}};y.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)};y.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
  `)};y.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],f=i;c==0&&u&&(f=this.indentPartial(i,u,o));var l=this.parse(f,n);return this.renderTokens(l,t,r,f,a)}}};y.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(r!=null)return r};y.prototype.escapedValue=function(e,t,r){var a=this.getConfigEscape(r)||x.escape,n=t.lookup(e[1]);if(n!=null)return typeof n=="number"&&a===x.escape?String(n):a(n)};y.prototype.rawValue=function(e){return e[1]};y.prototype.getConfigTags=function(e){return j(e)?e:e&&typeof e=="object"?e.tags:void 0};y.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!j(e))return e.escape};var x={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){P.templateCache=s},get templateCache(){return P.templateCache}},P=new y;x.clearCache=function(){return P.clearCache()};x.parse=function(e,t){return P.parse(e,t)};x.render=function(e,t,r,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+fe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return P.render(e,t,r,a)};x.escape=we;x.Scanner=R;x.Context=D;x.Writer=y;export{Qe as P,x as m,Ae as u};
@@ -1 +1 @@
1
- import{c as y,j as t,r as w,y as _,b as S,B as N,D as K,q as M,s as A,v as R,aK as E,I as T,l as V,t as $}from"./index-4XFLhK7S.js";import{i as B}from"./ArrowLeft-iygYSRbQ.js";import{s as F}from"./Plus-DLTeBarI.js";import{L as H}from"./label-ByKoWpTn.js";import{R as L}from"./repository-import-picker-Bixi7zBc.js";import{u as O}from"./use-navigate-to-agent-C41zpB_Z.js";import{S as z}from"./thread-intent-DqexYQAC.js";import{f as Z}from"./repository-binding-C_InVumU.js";const D={viewBox:"0 0 96 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},l={stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};function q(a){const e=y.c(9),{className:n}=a;let r,o,s,c,i,u,h;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M22 46V22",...l,opacity:.7}),o=t.jsx("circle",{cx:"22",cy:"18",r:"4",...l,opacity:.8}),s=t.jsx("circle",{cx:"22",cy:"50",r:"4",...l,opacity:.8}),c=t.jsx("path",{d:"M22 32h14a6 6 0 0 1 6 6v4",...l,opacity:.6}),i=t.jsx("circle",{cx:"42",cy:"46",r:"4",...l,opacity:.7}),u=t.jsx("path",{d:"M56 22h9l3 4h14a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H56a3 3 0 0 1-3-3V25a3 3 0 0 1 3-3Z",...l,opacity:.75}),h=t.jsx("path",{d:"M53 34h32",...l,opacity:.5}),e[0]=r,e[1]=o,e[2]=s,e[3]=c,e[4]=i,e[5]=u,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],i=e[4],u=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,i,u,h]}),e[7]=n,e[8]=d):d=e[8],d}function I(a){const e=y.c(4),{className:n}=a;let r,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M16 22a4 4 0 0 1 4-4h14l6 6h20a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H20a4 4 0 0 1-4-4V22Z",...l,opacity:.8}),o=t.jsx("path",{d:"M16 28h64",...l,opacity:.5}),e[0]=r,e[1]=o):(r=e[0],o=e[1]);let s;return e[2]!==n?(s=t.jsxs("svg",{...D,className:n,children:[r,o]}),e[2]=n,e[3]=s):s=e[3],s}function ie(a){const e=y.c(5),{className:n}=a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:"46",y:"16",width:"128",height:"88",rx:"8",...l}),t.jsx("path",{d:"M46 34h128",...l,opacity:.6}),t.jsx("circle",{cx:"56",cy:"25",r:"2",fill:"currentColor",opacity:.6}),t.jsx("circle",{cx:"64",cy:"25",r:"2",fill:"currentColor",opacity:.45}),t.jsx("circle",{cx:"72",cy:"25",r:"2",fill:"currentColor",opacity:.3}),t.jsx("rect",{x:"58",y:"44",width:"104",height:"24",rx:"4",...l,opacity:.5}),t.jsx("rect",{x:"58",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.4}),t.jsx("rect",{x:"95",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.3}),t.jsx("rect",{x:"132",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.22})]}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("g",{transform:"rotate(-8 44 92)",children:[t.jsx("rect",{x:"22",y:"52",width:"44",height:"76",rx:"8",...l,fill:"var(--color-background)"}),t.jsx("path",{d:"M37 60h14",...l,opacity:.5}),t.jsx("rect",{x:"29",y:"68",width:"30",height:"20",rx:"3",...l,opacity:.45}),t.jsx("path",{d:"M29 96h30M29 104h20",...l,opacity:.35}),t.jsx("rect",{x:"29",y:"112",width:"30",height:"8",rx:"4",...l,opacity:.5})]}),e[1]=o):o=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("g",{transform:"rotate(10 168 104)",children:[t.jsx("path",{d:"M150 92h30a6 6 0 0 1 6 6v26a6 6 0 0 1-6 6h-30a6 6 0 0 1-6-6V98a6 6 0 0 1 6-6Z",...l,fill:"var(--color-background)"}),t.jsx("circle",{cx:"165",cy:"104",r:"3.5",...l}),t.jsx("path",{d:"M152 116h26M152 124h16",...l,opacity:.45})]}),e[2]=s):s=e[2];let c;return e[3]!==n?(c=t.jsxs("svg",{viewBox:"0 0 220 140",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:n,children:[r,o,s]}),e[3]=n,e[4]=c):c=e[4],c}const v=new z(!1);let k="unknown",P=null;function U(a,e){k=a,P=e?.onCreated??null,_("project_create_clicked",{source:a}),v.set(!0)}function le(){const a=y.c(2),e=w.useSyncExternalStore(v.subscribe,v.get);let n;return a[0]!==e?(n=[e,v.set],a[0]=e,a[1]=n):n=a[1],n}function C(a){const e=P;P=null,e?.(a)}function pe(){return k}const W={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:q,plate:"bg-chart-5/10 group-hover:bg-chart-5/16",art_:"text-chart-5"},folder:{titleKey:"projects.new.path.folder",hintKey:"projects.new.path.folder.hint",art:I,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},G=["repository","folder"];function J(a){const e=y.c(25),{path:n,onSelect:r}=a,o=S(),s=W[n],c=s.art;let i;e[0]!==s.art_||e[1]!==s.plate?(i=V("flex h-28 items-center justify-center rounded-lg transition-colors",s.plate,s.art_),e[0]=s.art_,e[1]=s.plate,e[2]=i):i=e[2];let u;e[3]!==c?(u=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=u):u=e[4];let h;e[5]!==i||e[6]!==u?(h=t.jsx("span",{className:i,children:u}),e[5]=i,e[6]=u,e[7]=h):h=e[7];let d;e[8]!==s.titleKey||e[9]!==o?(d=o(s.titleKey),e[8]=s.titleKey,e[9]=o,e[10]=d):d=e[10];let x;e[11]!==d?(x=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=x):x=e[12];let f;e[13]!==s.hintKey||e[14]!==o?(f=o(s.hintKey),e[13]=s.hintKey,e[14]=o,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=j):j=e[17];let m;e[18]!==x||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[x,j]}),e[18]=x,e[19]=j,e[20]=m):m=e[20];let g;return e[21]!==r||e[22]!==h||e[23]!==m?(g=t.jsxs("button",{type:"button",onClick:r,className:"group flex flex-col gap-3 rounded-xl bg-card p-3 text-left card-shadow outline-none transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent/40 focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20 motion-reduce:transition-none motion-reduce:hover:translate-y-0",children:[h,m]}),e[21]=r,e[22]=h,e[23]=m,e[24]=g):g=e[24],g}function Q(a){const e=y.c(8),{label:n,children:r,hint:o}=a;let s;e[0]!==n?(s=t.jsx(H,{children:n}),e[0]=n,e[1]=s):s=e[1];let c;e[2]!==o?(c=o&&t.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=c):c=e[3];let i;return e[4]!==r||e[5]!==s||e[6]!==c?(i=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[s,r,c]}),e[4]=r,e[5]=s,e[6]=c,e[7]=i):i=e[7],i}function he({open:a,onOpenChange:e,source:n="org_home"}){const r=S(),o=Z(),s=O(),[c,i]=w.useState(null),[u,h]=w.useState(""),[d,x]=w.useState(null),f=w.useRef(null),j=()=>{i(null),h(""),x(null)},m=()=>{e(!1),j()};if(c==="repository")return t.jsx(L,{open:!0,onOpenChange:p=>{p||m()},onImportComplete:({virtualMcpId:p})=>{p&&(C(p),s(p)),m()}});const g=async()=>{if(o.create.isPending)return;const p=u.trim();if(!p){x(r("projects.new.nameRequired"));return}try{const b=(await o.create.mutateAsync({title:p,description:null,status:"active",pinned:!1,connections:[],metadata:{instructions:null,project:{storeUrl:null},ui:{pinnedViews:null,layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}}}))?.id;_("project_created",{source:n,path:c}),m(),b&&(C(b),s(b)),$.success(r("projects.new.created",{title:p}))}catch{x(r("projects.new.failed"))}};return t.jsx(K,{open:a,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(M,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:p=>{p.preventDefault(),f.current?.focus()},children:[t.jsxs(A,{children:[t.jsx(R,{children:r("projects.new.title")}),t.jsx(E,{children:r(c?"projects.new.step.folder.title":"projects.new.subtitle")})]}),c===null?t.jsx("div",{className:"grid grid-cols-1 gap-3 animate-in fade-in-0 duration-200 sm:grid-cols-2 motion-reduce:animate-none",children:G.map(p=>t.jsx(J,{path:p,onSelect:()=>{_("project_create_path_selected",{source:n,path:p}),i(p)}},p))}):t.jsxs("form",{className:"flex flex-col gap-4 animate-in fade-in-0 slide-in-from-right-2 duration-200 motion-reduce:animate-none",onSubmit:p=>{p.preventDefault(),x(null),g()},children:[t.jsx(Q,{label:r("projects.new.nameLabel"),children:t.jsx(T,{autoFocus:!0,value:u,onChange:p=>h(p.target.value),placeholder:r("projects.new.namePlaceholder")})}),d&&t.jsx("p",{className:"text-sm text-destructive",children:d}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(N,{type:"button",variant:"ghost",onClick:()=>j(),children:[t.jsx(B,{size:14}),r("projects.new.back")]}),t.jsx(N,{type:"submit",disabled:o.create.isPending,children:o.create.isPending?r("projects.new.creating"):r("projects.new.create")})]})]})]})})}function de(a){const e=y.c(11),{source:n,variant:r,size:o,label:s}=a,c=r===void 0?"default":r,i=o===void 0?"sm":o,u=S();let h;e[0]!==n?(h=()=>U(n),e[0]=n,e[1]=h):h=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(F,{size:14}),e[2]=d):d=e[2];let x;e[3]!==s||e[4]!==u?(x=s??u("projects.home.newProject"),e[3]=s,e[4]=u,e[5]=x):x=e[5];let f;return e[6]!==i||e[7]!==h||e[8]!==x||e[9]!==c?(f=t.jsxs(N,{size:i,variant:c,onClick:h,children:[d,x]}),e[6]=i,e[7]=h,e[8]=x,e[9]=c,e[10]=f):f=e[10],f}export{ie as E,de as N,he as a,pe as n,U as o,le as u};
1
+ import{c as y,j as t,r as w,y as _,b as S,B as N,D as K,q as M,s as A,v as R,aK as E,I as T,l as V,t as $}from"./index-C3moojPl.js";import{i as B}from"./ArrowLeft-BP0atRPX.js";import{s as F}from"./Plus-BKb3EUuT.js";import{L as H}from"./label-C-C9Ou_x.js";import{R as L}from"./repository-import-picker-DG4AirBH.js";import{u as O}from"./use-navigate-to-agent-d5laMYnC.js";import{S as z}from"./thread-intent-CJ-s3I0o.js";import{f as Z}from"./repository-binding-CPA8-dMz.js";const D={viewBox:"0 0 96 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},l={stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};function q(a){const e=y.c(9),{className:n}=a;let r,o,s,c,i,u,h;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M22 46V22",...l,opacity:.7}),o=t.jsx("circle",{cx:"22",cy:"18",r:"4",...l,opacity:.8}),s=t.jsx("circle",{cx:"22",cy:"50",r:"4",...l,opacity:.8}),c=t.jsx("path",{d:"M22 32h14a6 6 0 0 1 6 6v4",...l,opacity:.6}),i=t.jsx("circle",{cx:"42",cy:"46",r:"4",...l,opacity:.7}),u=t.jsx("path",{d:"M56 22h9l3 4h14a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H56a3 3 0 0 1-3-3V25a3 3 0 0 1 3-3Z",...l,opacity:.75}),h=t.jsx("path",{d:"M53 34h32",...l,opacity:.5}),e[0]=r,e[1]=o,e[2]=s,e[3]=c,e[4]=i,e[5]=u,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],i=e[4],u=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,i,u,h]}),e[7]=n,e[8]=d):d=e[8],d}function I(a){const e=y.c(4),{className:n}=a;let r,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M16 22a4 4 0 0 1 4-4h14l6 6h20a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H20a4 4 0 0 1-4-4V22Z",...l,opacity:.8}),o=t.jsx("path",{d:"M16 28h64",...l,opacity:.5}),e[0]=r,e[1]=o):(r=e[0],o=e[1]);let s;return e[2]!==n?(s=t.jsxs("svg",{...D,className:n,children:[r,o]}),e[2]=n,e[3]=s):s=e[3],s}function ie(a){const e=y.c(5),{className:n}=a;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:"46",y:"16",width:"128",height:"88",rx:"8",...l}),t.jsx("path",{d:"M46 34h128",...l,opacity:.6}),t.jsx("circle",{cx:"56",cy:"25",r:"2",fill:"currentColor",opacity:.6}),t.jsx("circle",{cx:"64",cy:"25",r:"2",fill:"currentColor",opacity:.45}),t.jsx("circle",{cx:"72",cy:"25",r:"2",fill:"currentColor",opacity:.3}),t.jsx("rect",{x:"58",y:"44",width:"104",height:"24",rx:"4",...l,opacity:.5}),t.jsx("rect",{x:"58",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.4}),t.jsx("rect",{x:"95",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.3}),t.jsx("rect",{x:"132",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.22})]}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("g",{transform:"rotate(-8 44 92)",children:[t.jsx("rect",{x:"22",y:"52",width:"44",height:"76",rx:"8",...l,fill:"var(--color-background)"}),t.jsx("path",{d:"M37 60h14",...l,opacity:.5}),t.jsx("rect",{x:"29",y:"68",width:"30",height:"20",rx:"3",...l,opacity:.45}),t.jsx("path",{d:"M29 96h30M29 104h20",...l,opacity:.35}),t.jsx("rect",{x:"29",y:"112",width:"30",height:"8",rx:"4",...l,opacity:.5})]}),e[1]=o):o=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("g",{transform:"rotate(10 168 104)",children:[t.jsx("path",{d:"M150 92h30a6 6 0 0 1 6 6v26a6 6 0 0 1-6 6h-30a6 6 0 0 1-6-6V98a6 6 0 0 1 6-6Z",...l,fill:"var(--color-background)"}),t.jsx("circle",{cx:"165",cy:"104",r:"3.5",...l}),t.jsx("path",{d:"M152 116h26M152 124h16",...l,opacity:.45})]}),e[2]=s):s=e[2];let c;return e[3]!==n?(c=t.jsxs("svg",{viewBox:"0 0 220 140",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:n,children:[r,o,s]}),e[3]=n,e[4]=c):c=e[4],c}const v=new z(!1);let k="unknown",P=null;function U(a,e){k=a,P=e?.onCreated??null,_("project_create_clicked",{source:a}),v.set(!0)}function le(){const a=y.c(2),e=w.useSyncExternalStore(v.subscribe,v.get);let n;return a[0]!==e?(n=[e,v.set],a[0]=e,a[1]=n):n=a[1],n}function C(a){const e=P;P=null,e?.(a)}function pe(){return k}const W={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:q,plate:"bg-chart-5/10 group-hover:bg-chart-5/16",art_:"text-chart-5"},folder:{titleKey:"projects.new.path.folder",hintKey:"projects.new.path.folder.hint",art:I,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},G=["repository","folder"];function J(a){const e=y.c(25),{path:n,onSelect:r}=a,o=S(),s=W[n],c=s.art;let i;e[0]!==s.art_||e[1]!==s.plate?(i=V("flex h-28 items-center justify-center rounded-lg transition-colors",s.plate,s.art_),e[0]=s.art_,e[1]=s.plate,e[2]=i):i=e[2];let u;e[3]!==c?(u=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=u):u=e[4];let h;e[5]!==i||e[6]!==u?(h=t.jsx("span",{className:i,children:u}),e[5]=i,e[6]=u,e[7]=h):h=e[7];let d;e[8]!==s.titleKey||e[9]!==o?(d=o(s.titleKey),e[8]=s.titleKey,e[9]=o,e[10]=d):d=e[10];let x;e[11]!==d?(x=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=x):x=e[12];let f;e[13]!==s.hintKey||e[14]!==o?(f=o(s.hintKey),e[13]=s.hintKey,e[14]=o,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=j):j=e[17];let m;e[18]!==x||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[x,j]}),e[18]=x,e[19]=j,e[20]=m):m=e[20];let g;return e[21]!==r||e[22]!==h||e[23]!==m?(g=t.jsxs("button",{type:"button",onClick:r,className:"group flex flex-col gap-3 rounded-xl bg-card p-3 text-left card-shadow outline-none transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent/40 focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20 motion-reduce:transition-none motion-reduce:hover:translate-y-0",children:[h,m]}),e[21]=r,e[22]=h,e[23]=m,e[24]=g):g=e[24],g}function Q(a){const e=y.c(8),{label:n,children:r,hint:o}=a;let s;e[0]!==n?(s=t.jsx(H,{children:n}),e[0]=n,e[1]=s):s=e[1];let c;e[2]!==o?(c=o&&t.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=c):c=e[3];let i;return e[4]!==r||e[5]!==s||e[6]!==c?(i=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[s,r,c]}),e[4]=r,e[5]=s,e[6]=c,e[7]=i):i=e[7],i}function he({open:a,onOpenChange:e,source:n="org_home"}){const r=S(),o=Z(),s=O(),[c,i]=w.useState(null),[u,h]=w.useState(""),[d,x]=w.useState(null),f=w.useRef(null),j=()=>{i(null),h(""),x(null)},m=()=>{e(!1),j()};if(c==="repository")return t.jsx(L,{open:!0,onOpenChange:p=>{p||m()},onImportComplete:({virtualMcpId:p})=>{p&&(C(p),s(p)),m()}});const g=async()=>{if(o.create.isPending)return;const p=u.trim();if(!p){x(r("projects.new.nameRequired"));return}try{const b=(await o.create.mutateAsync({title:p,description:null,status:"active",pinned:!1,connections:[],metadata:{instructions:null,project:{storeUrl:null},ui:{pinnedViews:null,layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}}}))?.id;_("project_created",{source:n,path:c}),m(),b&&(C(b),s(b)),$.success(r("projects.new.created",{title:p}))}catch{x(r("projects.new.failed"))}};return t.jsx(K,{open:a,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(M,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:p=>{p.preventDefault(),f.current?.focus()},children:[t.jsxs(A,{children:[t.jsx(R,{children:r("projects.new.title")}),t.jsx(E,{children:r(c?"projects.new.step.folder.title":"projects.new.subtitle")})]}),c===null?t.jsx("div",{className:"grid grid-cols-1 gap-3 animate-in fade-in-0 duration-200 sm:grid-cols-2 motion-reduce:animate-none",children:G.map(p=>t.jsx(J,{path:p,onSelect:()=>{_("project_create_path_selected",{source:n,path:p}),i(p)}},p))}):t.jsxs("form",{className:"flex flex-col gap-4 animate-in fade-in-0 slide-in-from-right-2 duration-200 motion-reduce:animate-none",onSubmit:p=>{p.preventDefault(),x(null),g()},children:[t.jsx(Q,{label:r("projects.new.nameLabel"),children:t.jsx(T,{autoFocus:!0,value:u,onChange:p=>h(p.target.value),placeholder:r("projects.new.namePlaceholder")})}),d&&t.jsx("p",{className:"text-sm text-destructive",children:d}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(N,{type:"button",variant:"ghost",onClick:()=>j(),children:[t.jsx(B,{size:14}),r("projects.new.back")]}),t.jsx(N,{type:"submit",disabled:o.create.isPending,children:o.create.isPending?r("projects.new.creating"):r("projects.new.create")})]})]})]})})}function de(a){const e=y.c(11),{source:n,variant:r,size:o,label:s}=a,c=r===void 0?"default":r,i=o===void 0?"sm":o,u=S();let h;e[0]!==n?(h=()=>U(n),e[0]=n,e[1]=h):h=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(F,{size:14}),e[2]=d):d=e[2];let x;e[3]!==s||e[4]!==u?(x=s??u("projects.home.newProject"),e[3]=s,e[4]=u,e[5]=x):x=e[5];let f;return e[6]!==i||e[7]!==h||e[8]!==x||e[9]!==c?(f=t.jsxs(N,{size:i,variant:c,onClick:h,children:[d,x]}),e[6]=i,e[7]=h,e[8]=x,e[9]=c,e[10]=f):f=e[10],f}export{ie as E,de as N,he as a,pe as n,U as o,le as u};
@@ -1 +1 @@
1
- import{b as o,r as c,j as e,h as n}from"./index-4XFLhK7S.js";import{h as u}from"./mcp-oauth-CVI2AkSu.js";import"./auth-D1PkW9Uj.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-C3moojPl.js";import{h as u}from"./mcp-oauth-BkcOWs3t.js";import"./auth-C11WExuf.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-4XFLhK7S.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-C3moojPl.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,x as ze,I as Le,l as ae,t as he}from"./index-4XFLhK7S.js";import{R as _e}from"./required-auth-layout-CxaLcttO.js";import{A as se}from"./auth-split-layout-HBBBJTJB.js";import{O as Ee}from"./organization-choice-DRyD5yII.js";import{A as ve}from"./avatar-Brh_8d7a.js";import{L as Ae}from"./label-ByKoWpTn.js";import{S as De}from"./switch-BD8_vvWq.js";import{t as Pe}from"./Building02-EbX1A23K.js";import{i as Re}from"./CheckCircle-CoJfU94i.js";import{t as Fe}from"./Globe04-DDiW2Onm.js";import{i as Me}from"./Upload01-CpEePL13.js";import"./Plus-DLTeBarI.js";import"./User01-BGOQS9vx.js";const $e=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 at(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),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 Te(){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(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=s):s=i[3],s}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),s=b.split("@")[1]?.toLowerCase()??"",a=!!s&&!$e.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:Be,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(Ke),A=N.some(Ie),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(Ee,{organizations:N,domain:s,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),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 Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(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 Be(){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(Ge,{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(Je,{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(Ae,{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(Le,{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(De,{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 Je(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(Me,{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:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Fe,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0}],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 Ge({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(Re,{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{at 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,x as ze,I as Le,l as ae,t as he}from"./index-C3moojPl.js";import{R as _e}from"./required-auth-layout-DqtVx04D.js";import{A as se}from"./auth-split-layout-DdRT7pwN.js";import{O as Ee}from"./organization-choice-W78BZNeA.js";import{A as ve}from"./avatar-BQ1clUOI.js";import{L as Ae}from"./label-C-C9Ou_x.js";import{S as De}from"./switch-Kct2nT2R.js";import{t as Pe}from"./Building02-DDW-F58b.js";import{i as Re}from"./CheckCircle-pe1RxSse.js";import{t as Fe}from"./Globe04-Cq4nB1G2.js";import{i as Me}from"./Upload01-DJFAu4Mm.js";import"./Plus-BKb3EUuT.js";import"./User01-B7hPiYB7.js";const $e=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 at(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),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 Te(){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(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=s):s=i[3],s}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),s=b.split("@")[1]?.toLowerCase()??"",a=!!s&&!$e.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:Be,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(Ke),A=N.some(Ie),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(Ee,{organizations:N,domain:s,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),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 Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(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 Be(){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(Ge,{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(Je,{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(Ae,{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(Le,{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(De,{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 Je(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(Me,{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:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Fe,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0}],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 Ge({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(Re,{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{at as default};
@@ -1,3 +1,3 @@
1
- import{f as J,g as B}from"./input-BzdgO_dK.js";import{aD as A,aE as D,c$ as C,aW as U,bT as W}from"./index-4XFLhK7S.js";import"./usage-stats-wClM7TZ-.js";import"./tool-namespace-CsdkV2uo.js";import"./form-BZ1i_2GJ.js";import"./label-ByKoWpTn.js";import"./utils-CVEq3hMx.js";import"./markdown-BW2GJSHC.js";import"./use-copy-BC3Fmh27.js";import"./Copy01-DlA26aBh.js";import"./ZoomOut-DA1sRe95.js";import"./location-BjlyegC2.js";import"./use-mobile-Buz9Esa_.js";import"./use-panel-navigate-DOyxnt44.js";import"./thread-route-B-yx1tFW.js";import"./use-project-scope-DJTJDi3A.js";import"./repository-binding-C_InVumU.js";import"./use-mcp-client-C5uLw7Lc.js";import"./auth-D1PkW9Uj.js";import"./tooltip-CUk78XFR.js";import"./index-DujNp8wX.js";import"./agent-icon-DDBSTxwl.js";import"./AlertCircle-D4iOZ3Bs.js";import"./Tool01-o_nJ7Y1x.js";import"./ArrowUp-KCSPs-fi.js";import"./ArrowLeft-iygYSRbQ.js";import"./LinkBroken01-Cjxu7rCw.js";import"./ShoppingBag01-CWlRU3Ye.js";import"./Building02-EbX1A23K.js";import"./CheckCircle-CoJfU94i.js";import"./ChevronUp-BSm7AtSf.js";import"./ChevronSelectorVertical-DqpRXMOM.js";import"./UserSquare-BFlEW2x5.js";import"./CreditCard01-CXGPcE51.js";import"./DotsVertical-CTugBooH.js";import"./Image01-BjUHwjIr.js";import"./Globe04-DDiW2Onm.js";import"./SwitchHorizontal01-DZEm8csq.js";import"./Key01-DMnhMxC3.js";import"./Link01-DKypA3Uf.js";import"./Monitor01-CTL-UG2p.js";import"./Sun-DhZMu2lN.js";import"./Play-NZWCLDah.js";import"./Plus-DLTeBarI.js";import"./SearchMd-BsNWsFDv.js";import"./Trash01-JZaZB0vu.js";import"./Upload01-CpEePL13.js";import"./User01-BGOQS9vx.js";import"./Users01-C9dOtgmV.js";import"./XClose-DO008B8R.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-decopilot-events-DH5jig6y.js";import"./thread-intent-DqexYQAC.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BjTl5yOD.js";import"./task-board-DcolQ15W.js";import"./schema-DyLXU88M.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-BR-PmAJg.js";import"./autosend-D3KZZhDs.js";import"./use-ai-providers-CAEoYJwC.js";import"./use-chat-navigation-CKcbdotk.js";import"./use-organization-settings-B0rQmLIX.js";import"./icon-button-BDbIWVW3.js";import"./file-type-icon-Dbuavq5L.js";import"./shell-layout-DZBrJWAA.js";import"./avatar-Brh_8d7a.js";import"./use-clock-tick-CwQv-OCe.js";import"./command-BfXTTBD9.js";import"./index-DVVx4F0i.js";import"./integration-icon-BqsHjS-b.js";import"./project-icon-CMe6LZd9.js";import"./new-project-dialog-DdG-RgMO.js";import"./repository-import-picker-Bixi7zBc.js";import"./use-navigate-to-agent-C41zpB_Z.js";import"./repository-picker-BHgNNGrn.js";import"./useInfiniteQuery-B3MUNCKJ.js";import"./infiniteQueryObserver-DLzEnjM8.js";import"./collection-search-Cp82h57b.js";import"./use-debounced-value-CNkuXNOW.js";import"./required-auth-layout-CxaLcttO.js";import"./use-org-sso-DVCQNBfN.js";import"./chat-draft-CWFQi3-d.js";import"./select-CEirlFRV.js";import"./index-BdQq_4o_.js";import"./tabs-tkvg_YSq.js";import"./use-deco-credits-DKtKOwIN.js";import"./toggle-group-SSpwI-zE.js";import"./use-open-billing-url-C1VukQDg.js";import"./index-pEr2eE8n.js";import"./checkbox-CGTvhz0x.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-DGVyEQ9q.js";import"./drawer-20Gv7XN0.js";import"./input-DQtH0um6.js";import"./suggestion-DHADwupQ.js";import"./use-chat-layout-state-BYcPLpFV.js";import"./use-file-configs-DsMQGho1.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-Dxu80Ack.js";import"./use-org-fs-DqhUUlbQ.js";import"./question-004-sINsf4GQ.js";import"./use-members-C9_S9nP9.js";import"./use-org-auth-client-DjRiIxwH.js";import"./feature-paywall-B1-Kq6zS.js";import"./plan-ladder-D4-VvMwX.js";import"./add-connection-dialog-BTQ6Snbx.js";import"./extract-connection-data-C8Idk1Oj.js";import"./metadata-D72DunRR.js";import"./connection-BTT1rt_2.js";import"./url-slug-CFKzH8Z4.js";import"./connection-card-CsIFgDe8.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BpBHfDQd.js";import"./use-connection-DldRXuvq.js";import"./connection-form-helpers-Bg3g47y2.js";import"./authenticate-and-persist-oauth-BfNR0joU.js";import"./mcp-oauth-BjHElKzR.js";import"./mcp-oauth-CVI2AkSu.js";import"./collection-tabs-C6HP7d51.js";import"./badge-Dp13ql_I.js";import"./use-infinite-scroll-C0Ths8NM.js";import"./useSuspenseInfiniteQuery-DPTWpcSJ.js";import"./use-task-board-events-Bx8_k4aV.js";class X{constructor(t,n=4e3){this.onDisconnect=t,this.graceMs=n}onDisconnect;graceMs;timer;report(t){if(t==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(t==="failed"||t==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}t==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const $=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:D(),delta:D(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),H=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:D(),target:C("client")})});class F{constructor(t,n){this.send=t,this.callbacks=n}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(t,n=Date.now()){if(this.closed)return;const r=$.safeParse(t);if(r.success){const e=r.data;if(this.seen.has(e.event_id))return;this.seen.add(e.event_id);const s=e.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:e.delta,start:e.start_ms,end:e.end_ms,arrivedAt:n,id:e.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:e.delta,event_id:e.event_id});return}const a=H.safeParse(t);if(a.success){const{id:e}=a.data.delegation;if(this.delegated.has(e)||this.pending.has(e))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(e,{offset:a.data.offset_ms,receivedAt:n});return}const m=A({type:C("session.thinking.appended"),client_event_id:D()}).safeParse(t);if(m.success){const e=m.data.client_event_id,s=this.awaitingContext.get(e);this.awaitingContext.delete(e),s&&(s.remaining.delete(e),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const p=A({type:D()}).safeParse(t);p.success&&p.data.type==="error"&&this.callbacks.onError()}tick(t=Date.now()){if(!this.closed)for(const[n,r]of this.pending){const a=this.fragments.filter(o=>o.start<r.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,r.receivedAt);if(t-m<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-r.receivedAt<3e3)continue;if(this.pending.delete(n),this.delegated.add(n),!p.length){this.publishUpdate({delivery:"announce",delegationId:n,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const e=p.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(p.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(e.length>J){this.publishUpdate({delivery:"announce",delegationId:n,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of p)this.consumed.add(o.id);this.callbacks.onDelegate({request:e,delegationId:n,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:n,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:n,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(t){if(this.closed)return;if(t.contextId){if(this.contexts.get(t.contextId)===t.text)return;this.contexts.set(t.contextId,t.text)}const r=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
1
+ import{f as J,g as B}from"./input-C8o95ZIl.js";import{aD as A,aE as D,c$ as C,aW as U,bT as W}from"./index-C3moojPl.js";import"./usage-stats-CmZMkNV4.js";import"./tool-namespace-BNEevFqW.js";import"./form-BRZ5DZiG.js";import"./label-C-C9Ou_x.js";import"./utils-CVEq3hMx.js";import"./markdown-BUXU5oD6.js";import"./use-copy-DQJK1-Md.js";import"./Copy01-YTn6AAPK.js";import"./ZoomOut-DLs2h_6j.js";import"./location-BjlyegC2.js";import"./use-mobile-CW5odOpu.js";import"./use-panel-navigate-BSNsfU5E.js";import"./thread-route-CV6SbsTq.js";import"./use-project-scope-B0llZYB3.js";import"./repository-binding-CPA8-dMz.js";import"./use-mcp-client-CaTe2ylT.js";import"./auth-C11WExuf.js";import"./tooltip-B7gx1fFf.js";import"./index-DjXrdMkW.js";import"./agent-icon-DjnOmCBc.js";import"./AlertCircle-BgwifFMG.js";import"./Tool01-C9pjFqwV.js";import"./ArrowUp-AxzDl8Z3.js";import"./ArrowLeft-BP0atRPX.js";import"./LinkBroken01-tO8JEBqa.js";import"./ShoppingBag01-D0kKEJuH.js";import"./Building02-DDW-F58b.js";import"./CheckCircle-pe1RxSse.js";import"./ChevronUp-QaPEzxVx.js";import"./ChevronSelectorVertical-B9RLS3HF.js";import"./UserSquare-CLXjlx3Y.js";import"./CreditCard01-DPxzkwQY.js";import"./DotsVertical-D1KewbnO.js";import"./Image01-Bpynux_N.js";import"./Globe04-Cq4nB1G2.js";import"./SwitchHorizontal01-CAC-8ZOB.js";import"./Key01-ByMBFx-i.js";import"./Link01-Zi8wbjzB.js";import"./Monitor01-wrmGnmsX.js";import"./Sun-CfiICDcE.js";import"./Play-W6HcQ7l_.js";import"./Plus-BKb3EUuT.js";import"./SearchMd-BXSC0WTH.js";import"./Trash01-BO35Cov_.js";import"./Upload01-DJFAu4Mm.js";import"./User01-B7hPiYB7.js";import"./Users01-DxG-qkCG.js";import"./XClose-CMdSy1nN.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-decopilot-events-DTg4q8xq.js";import"./thread-intent-CJ-s3I0o.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BBIuBzhf.js";import"./task-board-B3rwHKUr.js";import"./schema-DyDDwNs8.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-Bdbu4aFj.js";import"./autosend-BxzE8tXY.js";import"./use-ai-providers-BuM6ovEv.js";import"./use-chat-navigation-CtLOIOM3.js";import"./use-organization-settings-DYBuXxZf.js";import"./icon-button-7qsU_2OV.js";import"./file-type-icon-BQzv7Wym.js";import"./shell-layout-es79-GX2.js";import"./avatar-BQ1clUOI.js";import"./use-clock-tick-CjMIMPxr.js";import"./command-CloMVJTp.js";import"./index-p5cxA0SC.js";import"./integration-icon-CmzyrNbk.js";import"./project-icon-Ds5KkwAm.js";import"./new-project-dialog-BLbuP-We.js";import"./repository-import-picker-DG4AirBH.js";import"./use-navigate-to-agent-d5laMYnC.js";import"./repository-picker-BfnPBGTa.js";import"./useInfiniteQuery-Cogq3tDA.js";import"./infiniteQueryObserver-DMRptffd.js";import"./collection-search-ji1JjZMn.js";import"./use-debounced-value-gqRwYLiP.js";import"./required-auth-layout-DqtVx04D.js";import"./use-org-sso-BFc5mu2c.js";import"./chat-draft-CKhySLl4.js";import"./select-DStdJ5GE.js";import"./index-BdQq_4o_.js";import"./tabs-BmpbjUEc.js";import"./use-deco-credits-BXoQO4ZL.js";import"./toggle-group-OQufBZdd.js";import"./use-open-billing-url-Cp2-WoXr.js";import"./index-BXITXB61.js";import"./checkbox-B6gj5-qt.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-P9zPzqJX.js";import"./drawer-CBMcEEQM.js";import"./input-Dy0JrrC0.js";import"./suggestion-lK-gfS31.js";import"./use-chat-layout-state-DSr0gtOa.js";import"./use-file-configs-yKzFEaLv.js";import"./site-slug-DebpOoQq.js";import"./use-mcp-prompts-CatolySn.js";import"./use-org-fs-CGkxTNmD.js";import"./question-004-sINsf4GQ.js";import"./use-members-DpzUOwzJ.js";import"./use-org-auth-client-BK9SNEwg.js";import"./feature-paywall-Hzw839qS.js";import"./plan-ladder-CBREr6Ld.js";import"./add-connection-dialog-DNMm7BIu.js";import"./extract-connection-data-U1HCpmI2.js";import"./metadata-D72DunRR.js";import"./connection-BKamaNd5.js";import"./url-slug-yE9p_CBQ.js";import"./connection-card-VZBAZ1By.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BWzL69YC.js";import"./use-connection-CYbCdCg-.js";import"./connection-form-helpers-T_Ai4T1w.js";import"./authenticate-and-persist-oauth-DyuZVm6i.js";import"./mcp-oauth-L9MT2tEQ.js";import"./mcp-oauth-BkcOWs3t.js";import"./collection-tabs-C39YFQ2E.js";import"./badge-NHL6jQ7U.js";import"./use-infinite-scroll-bleQjS0V.js";import"./useSuspenseInfiniteQuery-BbeYvXgw.js";import"./use-task-board-events-BGOp2VgA.js";class X{constructor(t,n=4e3){this.onDisconnect=t,this.graceMs=n}onDisconnect;graceMs;timer;report(t){if(t==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(t==="failed"||t==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}t==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const $=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:D(),delta:D(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),H=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:D(),target:C("client")})});class F{constructor(t,n){this.send=t,this.callbacks=n}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(t,n=Date.now()){if(this.closed)return;const r=$.safeParse(t);if(r.success){const e=r.data;if(this.seen.has(e.event_id))return;this.seen.add(e.event_id);const s=e.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:e.delta,start:e.start_ms,end:e.end_ms,arrivedAt:n,id:e.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:e.delta,event_id:e.event_id});return}const a=H.safeParse(t);if(a.success){const{id:e}=a.data.delegation;if(this.delegated.has(e)||this.pending.has(e))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(e,{offset:a.data.offset_ms,receivedAt:n});return}const m=A({type:C("session.thinking.appended"),client_event_id:D()}).safeParse(t);if(m.success){const e=m.data.client_event_id,s=this.awaitingContext.get(e);this.awaitingContext.delete(e),s&&(s.remaining.delete(e),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const p=A({type:D()}).safeParse(t);p.success&&p.data.type==="error"&&this.callbacks.onError()}tick(t=Date.now()){if(!this.closed)for(const[n,r]of this.pending){const a=this.fragments.filter(o=>o.start<r.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,r.receivedAt);if(t-m<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-r.receivedAt<3e3)continue;if(this.pending.delete(n),this.delegated.add(n),!p.length){this.publishUpdate({delivery:"announce",delegationId:n,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const e=p.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(p.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(e.length>J){this.publishUpdate({delivery:"announce",delegationId:n,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of p)this.consumed.add(o.id);this.callbacks.onDelegate({request:e,delegationId:n,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:n,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:n,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(t){if(this.closed)return;if(t.contextId){if(this.contexts.get(t.contextId)===t.text)return;this.contexts.set(t.contextId,t.text)}const r=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
2
2
  `:`Studio result data:
3
3
  `)+t.text,a=new TextEncoder,m=t.delivery==="announce"&&a.encode(r).length>480,p={remaining:new Set,delegationId:t.delegationId};let e="",s=0;const o=()=>{if(!e)return;const i=crypto.randomUUID();m&&(p.remaining.add(i),this.awaitingContext.set(i,p)),this.send({type:t.delivery==="announce"&&!m?"session.commentary.append":"session.thinking.append",event_id:i,delegation_id:t.delegationId??null,content:e}),e="",s=0};for(const i of r){const v=a.encode(i).length;s+v>480&&o(),e+=i,s+=v}o()}close(){this.closed=!0,this.pending.clear(),this.awaitingContext.clear()}}async function ho(E,t,n){n.throwIfAborted();const r=new RTCPeerConnection,a=r.createDataChannel("oai-events"),m=document.createElement("audio");m.autoplay=!0;let p,e,s,o,i=!1,v=!1,h,O,L=0,P=0,g,w,y=!1;const I=Promise.withResolvers(),x=Promise.withResolvers();x.promise.catch(()=>{});const b=new F(d=>{!i&&a.readyState==="open"&&a.send(JSON.stringify(d))},t),q=new X(()=>{i||t.onDisconnect()}),T=async()=>{if(!i){i=!0,q.dispose(),b.close(),clearInterval(O),n.removeEventListener("abort",M),a.close(),r.close();for(const d of p?.getTracks()??[])d.stop();m.pause(),m.srcObject=null,e&&e.state!=="closed"&&await e.close().catch(()=>{})}},M=()=>{T()};n.addEventListener("abort",M,{once:!0});const u=AbortSignal.any([n,AbortSignal.timeout(3e4)]),j=x.promise,z=()=>x.reject(u.reason);u.addEventListener("abort",z,{once:!0}),j.catch(()=>{}),a.onmessage=({data:d})=>{if(!(i||typeof d!="string"))try{const l=JSON.parse(d);typeof l=="object"&&l!==null&&"type"in l&&(l.type==="session.started"&&(v=!0,x.resolve()),l.type==="session.closed"&&(I.resolve(),h||t.onDisconnect())),h||b.receive(l)}catch{t.onError()}},a.onclose=()=>{x.reject(new Error("Voice connection closed")),I.resolve(),!i&&!h&&t.onDisconnect()},r.onconnectionstatechange=()=>{i||q.report(r.connectionState)},r.ontrack=({streams:d,track:l})=>{if(i)return;const _=d[0]??new MediaStream([l]);m.srcObject=_,e??=new AudioContext,s=e.createAnalyser(),s.fftSize=256,o=new Uint8Array(s.fftSize),e.createMediaStreamSource(_).connect(s),e.resume().catch(()=>t.onError()),m.play().catch(()=>t.onError())};function N(){if(!s||!o||i)return 0;s.getByteTimeDomainData(o);let d=0;for(const l of o)d+=((l-128)/128)**2;return Math.min(1,Math.sqrt(d/o.length)*4)}try{const d=navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(c=>{if(i||u.aborted){for(const f of c.getTracks())f.stop();throw new DOMException("Voice connection cancelled","AbortError")}return p=c,c}),l=await Promise.race([d,new Promise((c,f)=>u.addEventListener("abort",()=>f(u.reason),{once:!0}))]);e??=new AudioContext,g=e.createAnalyser(),g.fftSize=256,w=new Uint8Array(g.fftSize),e.createMediaStreamSource(l).connect(g),await e.resume();for(const c of l.getAudioTracks())r.addTrack(c,l);const _=await r.createOffer();await r.setLocalDescription(_),u.throwIfAborted(),r.iceGatheringState!=="complete"&&await new Promise((c,f)=>{const S=()=>{r.iceGatheringState==="complete"&&(R(),c())},k=()=>{R(),f(u.reason)},R=()=>{r.removeEventListener("icegatheringstatechange",S),u.removeEventListener("abort",k)};r.addEventListener("icegatheringstatechange",S),u.addEventListener("abort",k,{once:!0}),S(),u.aborted&&k()});const V=r.localDescription?.sdp;if(!V)throw new Error("Missing voice offer");const G=await E(V,u);return await r.setRemoteDescription({type:"answer",sdp:G.sdp}),await j,n.throwIfAborted(),u.removeEventListener("abort",z),n.removeEventListener("abort",M),t.onConnect(),O=setInterval(()=>{if(i||h)return;if(b.tick(),g&&w&&!y){g.getByteTimeDomainData(w);const f=w.reduce((S,k)=>S+((k-128)/128)**2,0)/w.length;Math.sqrt(f)>.025&&(P=Date.now())}t.onUserSpeaking(!y&&Date.now()-P<400),N()>.02&&(L=Date.now()),t.onModeChange({mode:Date.now()-L<400?"speaking":"listening"})},100),{endSession:()=>(h??=(async()=>{b.close();for(const c of p?.getTracks()??[])c.stop();if(m.pause(),v&&a.readyState==="open"){a.send(JSON.stringify({type:"session.close"}));let c;await Promise.race([I.promise,new Promise(f=>{c=setTimeout(f,3e3)})]),clearTimeout(c)}await T()})(),h),publishUpdate:c=>b.publishUpdate(c),setMicMuted:c=>{y=c;for(const f of p?.getAudioTracks()??[])f.enabled=!y;y&&t.onUserSpeaking(!1)},getOutputVolume:N}}catch(d){throw await T(),d}}export{ho as startOpenAIConversation};
@@ -1 +1 @@
1
- import{c as a,a2 as f,m as S,K as y,o as v}from"./index-4XFLhK7S.js";import{g as d}from"./use-chat-layout-state-BYcPLpFV.js";function c(e,i){return y.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=S(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=v();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};
1
+ import{c as a,a2 as f,m as S,K as y,o as v}from"./index-C3moojPl.js";import{g as d}from"./use-chat-layout-state-DSr0gtOa.js";function c(e,i){return y.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=S(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=v();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};
@@ -1 +1 @@
1
- import{c as G,r as H,e as A,j as s,B as L,h as B}from"./index-4XFLhK7S.js";import{A as I}from"./avatar-Brh_8d7a.js";import{s as K}from"./Plus-DLTeBarI.js";async function T(i,e,p){const o=await fetch(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:e})}),l=await o.json();if(!o.ok||!l.success)throw new Error(l.error||p);return l}function Z(i){const e=G.c(45),{organizations:p,domain:o,requestedSlugs:l,onRequestedSlug:C,onSelected:h,onJoined:c,onRequestCompleted:M,selectLabel:O,onCreateNew:S,createNewLabel:P}=i,j=O===void 0?"Select":O,_=P===void 0?"Create new organization":P;let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[0]=N):N=e[0];const[J,U]=H.useState(N);let v;e[1]!==C?(v=r=>{U(t=>new Set(t).add(r)),C?.(r)},e[1]=C,e[2]=v):v=e[2];const E=v;let z;e[3]!==c?(z={mutationFn:V,onSuccess:r=>{const{organization:t,slug:x}=r;c?.(t,x)}},e[3]=c,e[4]=z):z=e[4];const n=A(z);let R;e[5]!==E||e[6]!==c||e[7]!==M?(R={mutationFn:Q,onSuccess:r=>{const{organization:t,slug:x,alreadyMember:F}=r;if(F&&x){c?.(t,x);return}E(t.slug),M?.(t)}},e[5]=E,e[6]=c,e[7]=M,e[8]=R):R=e[8];const a=A(R);let u;e[9]!==l?(u=l??[],e[9]=l,e[10]=u):u=e[10];let y;e[11]!==J||e[12]!==u?(y=new Set([...u,...J]),e[11]=J,e[12]=u,e[13]=y):y=e[13];const b=y,q=n.variables?.slug??null,w=a.variables?.slug??null;let d;e[14]!==_||e[15]!==S?(d=S&&s.jsxs("button",{type:"button",onClick:S,className:"rounded-xl border border-dashed border-border p-4 flex items-center justify-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:border-foreground/40 transition-colors",children:[s.jsx(K,{size:16}),_]}),e[14]=_,e[15]=S,e[16]=d):d=e[16];let m;if(e[17]!==o||e[18]!==b||e[19]!==n||e[20]!==h||e[21]!==p||e[22]!==q||e[23]!==w||e[24]!==a||e[25]!==j){let r;e[27]!==o||e[28]!==b||e[29]!==n||e[30]!==h||e[31]!==q||e[32]!==w||e[33]!==a||e[34]!==j?(r=t=>{const x=n.isPending&&q===t.slug,F=a.isPending&&w===t.slug,$=b.has(t.slug),D=t.logo??(o?`https://www.google.com/s2/favicons?domain=${o}&sz=128`:null);return s.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[s.jsx(I,{url:D??void 0,fallback:t.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:t.name}),o&&s.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",o]})]}),t.joinMode==="auto"?s.jsx(L,{size:"default",onClick:()=>n.mutate(t),disabled:n.isPending,children:x?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(B,{className:"size-3.5"})," Joining..."]}):"Join"}):t.joinMode==="request"?$?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Request sent"}):s.jsx(L,{size:"default",variant:"outline",onClick:()=>a.mutate(t),disabled:a.isPending,children:F?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(B,{className:"size-3.5"})," Requesting..."]}):"Request to join"}):s.jsx(L,{size:"default",onClick:()=>h?.(t),children:j})]},t.id)},e[27]=o,e[28]=b,e[29]=n,e[30]=h,e[31]=q,e[32]=w,e[33]=a,e[34]=j,e[35]=r):r=e[35],m=p.map(r),e[17]=o,e[18]=b,e[19]=n,e[20]=h,e[21]=p,e[22]=q,e[23]=w,e[24]=a,e[25]=j,e[26]=m}else m=e[26];let g;e[36]!==n.error?(g=n.error&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n.error instanceof Error?n.error.message:"Failed to join organization"}),e[36]=n.error,e[37]=g):g=e[37];let f;e[38]!==a.error?(f=a.error&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error instanceof Error?a.error.message:"Failed to request access"}),e[38]=a.error,e[39]=f):f=e[39];let k;return e[40]!==m||e[41]!==g||e[42]!==f||e[43]!==d?(k=s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[d,m,g,f]}),e[40]=m,e[41]=g,e[42]=f,e[43]=d,e[44]=k):k=e[44],k}async function Q(i){const e=await T("/api/auth/custom/domain-request-join",i.slug,"Failed to request access");return{organization:i,slug:e.slug,alreadyMember:e.alreadyMember}}async function V(i){const e=await T("/api/auth/custom/domain-join",i.slug,"Failed to join organization");return{organization:i,slug:e.slug??i.slug}}export{Z as O};
1
+ import{c as G,r as H,e as A,j as s,B as L,h as B}from"./index-C3moojPl.js";import{A as I}from"./avatar-BQ1clUOI.js";import{s as K}from"./Plus-BKb3EUuT.js";async function T(i,e,p){const o=await fetch(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:e})}),l=await o.json();if(!o.ok||!l.success)throw new Error(l.error||p);return l}function Z(i){const e=G.c(45),{organizations:p,domain:o,requestedSlugs:l,onRequestedSlug:C,onSelected:h,onJoined:c,onRequestCompleted:M,selectLabel:O,onCreateNew:S,createNewLabel:P}=i,j=O===void 0?"Select":O,_=P===void 0?"Create new organization":P;let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=new Set,e[0]=N):N=e[0];const[J,U]=H.useState(N);let v;e[1]!==C?(v=r=>{U(t=>new Set(t).add(r)),C?.(r)},e[1]=C,e[2]=v):v=e[2];const E=v;let z;e[3]!==c?(z={mutationFn:V,onSuccess:r=>{const{organization:t,slug:x}=r;c?.(t,x)}},e[3]=c,e[4]=z):z=e[4];const n=A(z);let R;e[5]!==E||e[6]!==c||e[7]!==M?(R={mutationFn:Q,onSuccess:r=>{const{organization:t,slug:x,alreadyMember:F}=r;if(F&&x){c?.(t,x);return}E(t.slug),M?.(t)}},e[5]=E,e[6]=c,e[7]=M,e[8]=R):R=e[8];const a=A(R);let u;e[9]!==l?(u=l??[],e[9]=l,e[10]=u):u=e[10];let y;e[11]!==J||e[12]!==u?(y=new Set([...u,...J]),e[11]=J,e[12]=u,e[13]=y):y=e[13];const b=y,q=n.variables?.slug??null,w=a.variables?.slug??null;let d;e[14]!==_||e[15]!==S?(d=S&&s.jsxs("button",{type:"button",onClick:S,className:"rounded-xl border border-dashed border-border p-4 flex items-center justify-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:border-foreground/40 transition-colors",children:[s.jsx(K,{size:16}),_]}),e[14]=_,e[15]=S,e[16]=d):d=e[16];let m;if(e[17]!==o||e[18]!==b||e[19]!==n||e[20]!==h||e[21]!==p||e[22]!==q||e[23]!==w||e[24]!==a||e[25]!==j){let r;e[27]!==o||e[28]!==b||e[29]!==n||e[30]!==h||e[31]!==q||e[32]!==w||e[33]!==a||e[34]!==j?(r=t=>{const x=n.isPending&&q===t.slug,F=a.isPending&&w===t.slug,$=b.has(t.slug),D=t.logo??(o?`https://www.google.com/s2/favicons?domain=${o}&sz=128`:null);return s.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex items-center gap-4",children:[s.jsx(I,{url:D??void 0,fallback:t.name.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-10 w-10 shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:t.name}),o&&s.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:["@",o]})]}),t.joinMode==="auto"?s.jsx(L,{size:"default",onClick:()=>n.mutate(t),disabled:n.isPending,children:x?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(B,{className:"size-3.5"})," Joining..."]}):"Join"}):t.joinMode==="request"?$?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Request sent"}):s.jsx(L,{size:"default",variant:"outline",onClick:()=>a.mutate(t),disabled:a.isPending,children:F?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(B,{className:"size-3.5"})," Requesting..."]}):"Request to join"}):s.jsx(L,{size:"default",onClick:()=>h?.(t),children:j})]},t.id)},e[27]=o,e[28]=b,e[29]=n,e[30]=h,e[31]=q,e[32]=w,e[33]=a,e[34]=j,e[35]=r):r=e[35],m=p.map(r),e[17]=o,e[18]=b,e[19]=n,e[20]=h,e[21]=p,e[22]=q,e[23]=w,e[24]=a,e[25]=j,e[26]=m}else m=e[26];let g;e[36]!==n.error?(g=n.error&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n.error instanceof Error?n.error.message:"Failed to join organization"}),e[36]=n.error,e[37]=g):g=e[37];let f;e[38]!==a.error?(f=a.error&&s.jsx("p",{className:"text-xs text-destructive",role:"alert",children:a.error instanceof Error?a.error.message:"Failed to request access"}),e[38]=a.error,e[39]=f):f=e[39];let k;return e[40]!==m||e[41]!==g||e[42]!==f||e[43]!==d?(k=s.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[d,m,g,f]}),e[40]=m,e[41]=g,e[42]=f,e[43]=d,e[44]=k):k=e[44],k}async function Q(i){const e=await T("/api/auth/custom/domain-request-join",i.slug,"Failed to request access");return{organization:i,slug:e.slug,alreadyMember:e.alreadyMember}}async function V(i){const e=await T("/api/auth/custom/domain-join",i.slug,"Failed to join organization");return{organization:i,slug:e.slug??i.slug}}export{Z as O};