decocms 4.535.4 → 4.536.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (394) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CE9RRty2.js → ActiveShapeUtils-IJ1oYARR.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-BmO4vJOs.js → AlertCircle-Cz6_P7ML.js} +1 -1
  3. package/dist/client/assets/{AreaChart-BtD6HX7c.js → AreaChart-eTT2Y7Ef.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BHp0lrDo.js → ArrowLeft-ClEFP1xI.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-C1ze1lYw.js → ArrowUp-esZAPwX6.js} +1 -1
  6. package/dist/client/assets/{BarChart-DpqgYvpT.js → BarChart-DhRFPAeY.js} +1 -1
  7. package/dist/client/assets/{Building02-teHH5338.js → Building02-65KgwQ5O.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-DYKipWMh.js → CartesianChart-Cr8uE6_k.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-wu9SaFW9.js → CategoricalChart-BxUViXyY.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-D6Wz8hBJ.js → CheckCircle-CkMlHbcx.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BKCUuYcV.js → ChevronSelectorVertical-Dv0IPcS7.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-bjIxVrad.js → ChevronUp-Bq07Wt0S.js} +1 -1
  13. package/dist/client/assets/{Copy01-D43IjSFC.js → Copy01-DVjYf8UE.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-LJ-ICys1.js → CreditCard01-D1fzLODG.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-GwsdgrHI.js → DotsVertical-C7omsJ6V.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-BLD9yC6V.js → ErrorBarContext-DpeH5r-p.js} +1 -1
  17. package/dist/client/assets/{Globe04-Ck3KSFRr.js → Globe04-DLvpciMY.js} +1 -1
  18. package/dist/client/assets/{Image01-D7ZR2IUl.js → Image01-BK_sSf9r.js} +1 -1
  19. package/dist/client/assets/{Key01-iL0AmDpL.js → Key01-Dy4KHdYE.js} +1 -1
  20. package/dist/client/assets/{Link01-BAmaaqXS.js → Link01-ci2j_bPP.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-CSj4NG1x.js → LinkBroken01-CgZn_kgS.js} +1 -1
  22. package/dist/client/assets/{Minus-eyAF4BHe.js → Minus-BSI7d8_H.js} +1 -1
  23. package/dist/client/assets/{Monitor01-OJKXayAq.js → Monitor01-QdcvoNmj.js} +1 -1
  24. package/dist/client/assets/{Play-CYJOslRi.js → Play-BGQYvkMd.js} +1 -1
  25. package/dist/client/assets/{Plus-DG02QDBi.js → Plus-DqXRu9xd.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-CNRCRpCX.js → ReferenceLine-BqBCeLdN.js} +1 -1
  27. package/dist/client/assets/{SearchMd-eQGP3B2l.js → SearchMd-B1pNG3dp.js} +1 -1
  28. package/dist/client/assets/{Sector-DqFYSXro.js → Sector-DPBZ0uvQ.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-D_7hYKx-.js → ShoppingBag01-xLzaiz75.js} +1 -1
  30. package/dist/client/assets/{Sun-DlgvbI-T.js → Sun-DAC9yPz1.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CQ6d0kLW.js → SwitchHorizontal01-Ceqgl_dL.js} +1 -1
  32. package/dist/client/assets/{Tool01-DQHTbTAt.js → Tool01-DutC7DUC.js} +1 -1
  33. package/dist/client/assets/{Trash01-DgFWjzpO.js → Trash01-DtErG8K9.js} +1 -1
  34. package/dist/client/assets/{Upload01-CQGS-8-D.js → Upload01-IuP9sE7L.js} +1 -1
  35. package/dist/client/assets/{UserSquare-C8hqvKpv.js → UserSquare-C4Xd30fd.js} +1 -1
  36. package/dist/client/assets/{Users01-B7liCLQJ.js → Users01-CqmTsXbq.js} +1 -1
  37. package/dist/client/assets/{XClose-BukpW4Ul.js → XClose-3xLIDoWV.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-CcGzW8aR.js → ZoomOut-Bef8TDWN.js} +1 -1
  39. package/dist/client/assets/{access-gate-qQA99v-D.js → access-gate-DY1TqDf0.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-Cz7D2aIE.js → add-connection-dialog-IczVjs2u.js} +1 -1
  41. package/dist/client/assets/{agent-analytics-ZPkBy3SY.js → agent-analytics-BwiPUwnG.js} +1 -1
  42. package/dist/client/assets/agent-app-BtrEuXBb.js +1 -0
  43. package/dist/client/assets/{agent-assets-xaD7hNhV.js → agent-assets-CBsBh7L1.js} +1 -1
  44. package/dist/client/assets/{agent-automation-BQxaeiKg.js → agent-automation-B-o29_rb.js} +1 -1
  45. package/dist/client/assets/{agent-automations-3aEICLAe.js → agent-automations-DY4fm0qG.js} +1 -1
  46. package/dist/client/assets/{agent-calendar-B7F525WD.js → agent-calendar-LIO9ezsY.js} +1 -1
  47. package/dist/client/assets/{agent-connect-sources-CTuKd4vv.js → agent-connect-sources-B2EJglQB.js} +1 -1
  48. package/dist/client/assets/agent-deck-DipeqOy8.js +1 -0
  49. package/dist/client/assets/{agent-e2e-CDV2pglM.js → agent-e2e-DnOwfwNx.js} +1 -1
  50. package/dist/client/assets/agent-experiments-CuTb6wnn.js +1 -0
  51. package/dist/client/assets/{agent-file-Bpaqrupb.js → agent-file-Deue8uv5.js} +1 -1
  52. package/dist/client/assets/{agent-hosting-fkvm3hcq.js → agent-hosting-CaxatmOa.js} +1 -1
  53. package/dist/client/assets/{agent-icon-C4FWcm9G.js → agent-icon-2PljfsLU.js} +1 -1
  54. package/dist/client/assets/agent-library-Dp1pbPNV.js +1 -0
  55. package/dist/client/assets/agent-library-file-BRe6xfUp.js +1 -0
  56. package/dist/client/assets/agent-monitor-Die8nep3.js +1 -0
  57. package/dist/client/assets/{agent-overview-BT5fw8cG.js → agent-overview-Bkt42meL.js} +1 -1
  58. package/dist/client/assets/{agent-releases-PMfQqo6s.js → agent-releases-CQ_3V7aV.js} +1 -1
  59. package/dist/client/assets/agent-settings-ULNXlpFL.js +1 -0
  60. package/dist/client/assets/agent-site-editor-code-D6266RoK.js +2 -0
  61. package/dist/client/assets/agent-site-editor-content-p1KXgh71.js +1 -0
  62. package/dist/client/assets/agent-site-editor-preview-DkZVRQAH.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-C8zu5j6F.js → agent-site-editor-qZ27qg-P.js} +1 -1
  64. package/dist/client/assets/agent-view-BDD_VfGg.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-Dh8bPSw0.js → agent-view-guard-CFvLA-aX.js} +1 -1
  66. package/dist/client/assets/{agents-list-CUWv_COW.js → agents-list-DaEVX6fU.js} +1 -1
  67. package/dist/client/assets/{ai-providers-Q1BB_LM_.js → ai-providers-BYl4hpVS.js} +1 -1
  68. package/dist/client/assets/{alert-DMBlE4Az.js → alert-MTGSq9wJ.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-Bp_JnAsz.js → analytics-sections-APieJcuZ.js} +1 -1
  70. package/dist/client/assets/{api-keys-3QVjPPAi.js → api-keys-Clj_w5hp.js} +1 -1
  71. package/dist/client/assets/api-keys-DMHK0Gko.js +1 -0
  72. package/dist/client/assets/{app-editor-D_Lpa9Av.js → app-editor-D-cL6LXx.js} +1 -1
  73. package/dist/client/assets/{asset-utils-W69ddci1.js → asset-utils-CuiPEp5J.js} +1 -1
  74. package/dist/client/assets/{auth-DOw8QO5X.js → auth-DZi3j0cg.js} +1 -1
  75. package/dist/client/assets/{auth-catchall-CPCPPq8s.js → auth-catchall-ClbYBzhX.js} +1 -1
  76. package/dist/client/assets/{auth-entry-CYw7ZBoM.js → auth-entry-BRErVcpG.js} +1 -1
  77. package/dist/client/assets/{auth-split-layout-D7LOmPac.js → auth-split-layout-DgUSBQ_P.js} +1 -1
  78. package/dist/client/assets/{authenticate-and-persist-oauth-Db8PCXi_.js → authenticate-and-persist-oauth-Oq1cZuDP.js} +1 -1
  79. package/dist/client/assets/{automation-list-row-Ds-D7GVI.js → automation-list-row-Btbs2LAB.js} +1 -1
  80. package/dist/client/assets/{automation-runs-Bu4_fqaU.js → automation-runs-eZaW8rPQ.js} +1 -1
  81. package/dist/client/assets/{automations-C0KmvIhT.js → automations-CrvlJwt1.js} +1 -1
  82. package/dist/client/assets/{autosend-BWrEWq5K.js → autosend-qlZ4EwTo.js} +1 -1
  83. package/dist/client/assets/{badge-iD6YraPr.js → badge-DunYeylq.js} +1 -1
  84. package/dist/client/assets/{block-document-BLLx0ed7.js → block-document-DE1kJpxe.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-CbPBkMEF.js → blocks-preview-workspace-context-D5IOdv-x.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-DcLcpiN-.js → blocks-tab-states-BJ_KtaIe.js} +1 -1
  87. package/dist/client/assets/{blog-schema-Df4DOM9Z.js → blog-schema-CEBwYGWl.js} +1 -1
  88. package/dist/client/assets/{buckets-BKtu_EiG.js → buckets-C-7_PSFf.js} +1 -1
  89. package/dist/client/assets/{build-improve-prompt-doc-NHwz2SDa.js → build-improve-prompt-doc-D2TZcAEY.js} +1 -1
  90. package/dist/client/assets/{calendar-hPQZ5eZY.js → calendar-CUW03VkL.js} +1 -1
  91. package/dist/client/assets/{capability-load-error-1B3MIP7D.js → capability-load-error-Cn0r3OXh.js} +1 -1
  92. package/dist/client/assets/{category-editor-DPrubLv5.js → category-editor-D5v8aocK.js} +1 -1
  93. package/dist/client/assets/cdn-tab-Dq_rhUuu.js +1 -0
  94. package/dist/client/assets/{chart-CRp8tHJr.js → chart-BZWQB7-x.js} +1 -1
  95. package/dist/client/assets/{chat-context-CgGENb-d.js → chat-context-5nWd2wfH.js} +1 -1
  96. package/dist/client/assets/{chat-draft-DCY2vv5f.js → chat-draft-DH4nBOgW.js} +1 -1
  97. package/dist/client/assets/{checkbox-Bo5LsWbi.js → checkbox-CMW8RKoG.js} +1 -1
  98. package/dist/client/assets/{choose-editor-Bf4OfFZh.js → choose-editor-BWPGE5ja.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-BDdZ7i5z.js → cli-auth-success-C6uU21ky.js} +1 -1
  100. package/dist/client/assets/{client-icons-DOX3kvoj.js → client-icons-B21uHg0S.js} +1 -1
  101. package/dist/client/assets/{cms-settings-editor-DBEezL_M.js → cms-settings-editor-Yo8ew3Om.js} +1 -1
  102. package/dist/client/assets/{collapsible-D41_Zph5.js → collapsible-ezy6JAPb.js} +1 -1
  103. package/dist/client/assets/{collection-detail-Uv_VcIoG.js → collection-detail-B7ofZYjD.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-D3QKBrBd.js → collection-display-button-DhcooGaQ.js} +1 -1
  105. package/dist/client/assets/{collection-search-C41cpRLf.js → collection-search-DhTgl05U.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-Bx-KN0pt.js → collection-table-wrapper-BSZttlcn.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-DFF7SRdJ.js → collection-tabs--HOz53qZ.js} +1 -1
  108. package/dist/client/assets/{column-rules-u-HCPnk4.js → column-rules-DYgQ7UFl.js} +1 -1
  109. package/dist/client/assets/{combobox-D5QpeBz0.js → combobox-D6SbcRR7.js} +1 -1
  110. package/dist/client/assets/{command-hbwPLpaS.js → command-DF7NsdME.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-nas5Ve7c.js → companion-mcps-section-CwKR9d2x.js} +1 -1
  112. package/dist/client/assets/{config-DyuF_e8k.js → config-DefM5Afe.js} +1 -1
  113. package/dist/client/assets/{connect-layout-DeD-pUH5.js → connect-layout-d04XljO1.js} +1 -1
  114. package/dist/client/assets/{connect-source-dialog-BI8J6mh1.js → connect-source-dialog-Dm8dEhbH.js} +1 -1
  115. package/dist/client/assets/{connect-C2WUq9I7.js → connect-z_kfW2eH.js} +1 -1
  116. package/dist/client/assets/{connection-Cg1SIgkl.js → connection-BHTKykig.js} +1 -1
  117. package/dist/client/assets/{connection-card-Cm0DTsMN.js → connection-card-CRrDkcyE.js} +1 -1
  118. package/dist/client/assets/{connection-detail-1-4OootT.js → connection-detail-Mk7OIPp5.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-ETShxpEs.js → connection-form-helpers-D24CXVn3.js} +1 -1
  120. package/dist/client/assets/{connections-Zciki227.js → connections-udazZKFI.js} +1 -1
  121. package/dist/client/assets/{content-tab-G4ADBGIN.js → content-tab-l7SSawd8.js} +3 -3
  122. package/dist/client/assets/{context-DBKMkU6O.js → context-C3_dSjRo.js} +1 -1
  123. package/dist/client/assets/{context-menu-C2xt-LT8.js → context-menu-2K06VFj9.js} +1 -1
  124. package/dist/client/assets/{context-shell-I6Gk_0vG.js → context-shell-6M8AFSer.js} +3 -3
  125. package/dist/client/assets/{core.esm-rlv9wi-f.js → core.esm-jXpPa-T6.js} +1 -1
  126. package/dist/client/assets/{create-organization-dialog-OjR5nawh.js → create-organization-dialog-CApO76EN.js} +1 -1
  127. package/dist/client/assets/{daily-pulse-BRRONy8z.js → daily-pulse-BYOirajN.js} +1 -1
  128. package/dist/client/assets/{discover-C6lsG6xS.js → discover-Dlr_j9ai.js} +1 -1
  129. package/dist/client/assets/{domain-settings-BHSbgg-h.js → domain-settings-zIy2RnGd.js} +1 -1
  130. package/dist/client/assets/{drawer-CCDqJ6_5.js → drawer-D1oOJWcT.js} +1 -1
  131. package/dist/client/assets/{editor-aCkjdIPo.js → editor-CZg_DPzl.js} +1 -1
  132. package/dist/client/assets/{editor-classes-aXd6jO6f.js → editor-classes-Dg9pAlmc.js} +1 -1
  133. package/dist/client/assets/{empty-state-0qYV2IxH.js → empty-state-BZGQaA3e.js} +1 -1
  134. package/dist/client/assets/{empty-state-BiB1k9E1.js → empty-state-BgEB-a-Y.js} +1 -1
  135. package/dist/client/assets/{experiments-tab-BLzRQEPx.js → experiments-tab-DfMGztu1.js} +1 -1
  136. package/dist/client/assets/{experiments-tab-choice-BwWF3s7j.js → experiments-tab-choice-wicogVfZ.js} +1 -1
  137. package/dist/client/assets/{extract-connection-data-8An_UKh-.js → extract-connection-data-uNjXykZP.js} +1 -1
  138. package/dist/client/assets/{feature-gate-06IO3npK.js → feature-gate-B81scRlA.js} +1 -1
  139. package/dist/client/assets/{feature-paywall-B--yW66D.js → feature-paywall-CXZFZDnX.js} +1 -1
  140. package/dist/client/assets/{file-explorer-Dp5rfBy2.js → file-explorer-Cj4_iKPV.js} +1 -1
  141. package/dist/client/assets/{file-preview-DKQQ05uR.js → file-preview-B23dkRSH.js} +1 -1
  142. package/dist/client/assets/{file-share-button-DNpchNG7.js → file-share-button-DZFKwA4L.js} +1 -1
  143. package/dist/client/assets/{file-type-icon-DeVQ158v.js → file-type-icon-CyX-UMTP.js} +1 -1
  144. package/dist/client/assets/{folder-icon-D427XDK4.js → folder-icon-Cca1eUd8.js} +1 -1
  145. package/dist/client/assets/{form-C0PLsmZN.js → form-DBl_mUYK.js} +1 -1
  146. package/dist/client/assets/{general-BBByqn3z.js → general-DezmPM11.js} +1 -1
  147. package/dist/client/assets/{held-block-view-BmGcRSLV.js → held-block-view-B8sEdlHZ.js} +3 -3
  148. package/dist/client/assets/{home-BM2yEWlS.js → home-Ddr9Inmq.js} +1 -1
  149. package/dist/client/assets/{hosted-publish-feedback-CMaWPFBi.js → hosted-publish-feedback-Ds1RtHYF.js} +1 -1
  150. package/dist/client/assets/{icon-button-Bb7FrbdB.js → icon-button-DOGOl3eR.js} +1 -1
  151. package/dist/client/assets/{index-D_5s-i_S.js → index-5ixoUHcn.js} +1 -1
  152. package/dist/client/assets/{index-BBtqrVmv.js → index-BN_hL0Z4.js} +1 -1
  153. package/dist/client/assets/{index-CgoVr5FU.js → index-BXY_6H_h.js} +5 -5
  154. package/dist/client/assets/{index-CuVdpTpN.js → index-CBXgYz3-.js} +1 -1
  155. package/dist/client/assets/{index-BTdpMnnK.js → index-CW40TH6H.js} +1 -1
  156. package/dist/client/assets/{index-C4QIZ9Sw.js → index-CXgoPu_Q.js} +1 -1
  157. package/dist/client/assets/{index-DXxdxwlD.js → index-Cdi682f-.js} +1 -1
  158. package/dist/client/assets/{index-WnYaiPbw.js → index-CyavzyWu.js} +1 -1
  159. package/dist/client/assets/{index-CRnZnqVH.js → index-D3cNGnQC.js} +1 -1
  160. package/dist/client/assets/{index-BckojLTt.js → index-DGuGzjYL.js} +1 -1
  161. package/dist/client/assets/{index-Dp8Ois5q.js → index-Di9dO1y1.js} +1 -1
  162. package/dist/client/assets/{index-DygEP4cN.js → index-Dsw-6wTM.js} +1 -1
  163. package/dist/client/assets/{index-pK3W-yyu.js → index-FWpA9XtI.js} +1 -1
  164. package/dist/client/assets/{index-DfPyt5Mf.js → index-L2VwHeGQ.js} +1 -1
  165. package/dist/client/assets/{index-Ovy9L9KI.js → index-cKP6cgaI.js} +1 -1
  166. package/dist/client/assets/{index-redirect-CFQ4oc7v.js → index-redirect-Dfd9JUPB.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-BhT1X5Zv.js → infiniteQueryObserver-BFDbIOUX.js} +1 -1
  168. package/dist/client/assets/{infra-billing-B2On7AaM.js → infra-billing-BhoOc3e_.js} +1 -1
  169. package/dist/client/assets/{input-BmD6p00i.js → input-34_0AkPF.js} +1 -1
  170. package/dist/client/assets/{input-4Z-Xhhp5.js → input-CRJ_83xM.js} +3 -3
  171. package/dist/client/assets/{integration-icon-CBXS4hsf.js → integration-icon-BcSLXSA3.js} +1 -1
  172. package/dist/client/assets/{jira-icon-DbVhf1HS.js → jira-icon-Bah8vZCD.js} +1 -1
  173. package/dist/client/assets/{label-jeO06QJJ.js → label-BrtgLUsN.js} +1 -1
  174. package/dist/client/assets/{layout-DoTaRh1V.js → layout-DHm1l4WE.js} +1 -1
  175. package/dist/client/assets/{legacy-agents-deep-CHE3c8Ji.js → legacy-agents-deep-B8KmAEtN.js} +1 -1
  176. package/dist/client/assets/{legacy-main-redirect-CyXWx05G.js → legacy-main-redirect-DBZsRRmo.js} +1 -1
  177. package/dist/client/assets/library-DlXh8o-Q.js +1 -0
  178. package/dist/client/assets/{login-BNbvnzZZ.js → login-EWBImytA.js} +1 -1
  179. package/dist/client/assets/{markdown-Di4RSa-U.js → markdown-DqY4DWVG.js} +1 -1
  180. package/dist/client/assets/{mcp-app-renderer-DNg2HjZ3.js → mcp-app-renderer-DIVYLLKw.js} +1 -1
  181. package/dist/client/assets/{mcp-oauth-DrNngSc4.js → mcp-oauth-6YGp-ztf.js} +1 -1
  182. package/dist/client/assets/{mcp-oauth-Dmaz5wHI.js → mcp-oauth-BKSmCj_9.js} +1 -1
  183. package/dist/client/assets/{members-BzYqudUN.js → members-7x8huCb3.js} +1 -1
  184. package/dist/client/assets/{memory-B6vNbouX.js → memory-Bb3pxX4f.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-CW55NoBA.js → mini-report-page-DL0N-eWi.js} +1 -1
  186. package/dist/client/assets/{mock-board-BDFFzkRS.js → mock-board-BOi2vqeo.js} +3 -3
  187. package/dist/client/assets/{monaco-editor-D7hOBWJ6.js → monaco-editor-JQgHEiJt.js} +1 -1
  188. package/dist/client/assets/{monitoring-LPsc0FFY.js → monitoring-DVH968IJ.js} +1 -1
  189. package/dist/client/assets/{monitoring-stats-row-D5ixb60K.js → monitoring-stats-row-B727zH29.js} +1 -1
  190. package/dist/client/assets/{multi-select-76LKG4dn.js → multi-select-Cx40zkpe.js} +1 -1
  191. package/dist/client/assets/{mustache-ymW-6jdo.js → mustache-DeXpzLc3.js} +1 -1
  192. package/dist/client/assets/{named-rule-uses-MQslbFt3.js → named-rule-uses-BWmpQaEJ.js} +1 -1
  193. package/dist/client/assets/{new-project-dialog-DTmZo42L.js → new-project-dialog-COp1t2XJ.js} +1 -1
  194. package/dist/client/assets/{oauth-callback-BNpswTi1.js → oauth-callback-Lb0sVnZz.js} +1 -1
  195. package/dist/client/assets/{oauth-callback-ai-provider-C-cp8UAM.js → oauth-callback-ai-provider-CkiDVbE8.js} +1 -1
  196. package/dist/client/assets/{onboarding-C25HbKkF.js → onboarding-ZdpclSs5.js} +1 -1
  197. package/dist/client/assets/{openai-conversation-B0Eg9Rey.js → openai-conversation-C1xvkYDH.js} +1 -1
  198. package/dist/client/assets/{optimistic-project-sidebar-views-D_Sk-gnt.js → optimistic-project-sidebar-views-B4WLVxYO.js} +1 -1
  199. package/dist/client/assets/{order-monitor-day-DnTPYfk3.js → order-monitor-day-D18mgtne.js} +1 -1
  200. package/dist/client/assets/{organization-choice-DmKVV6Be.js → organization-choice-Bb26ahbZ.js} +1 -1
  201. package/dist/client/assets/{orgs-DstpVsAI.js → orgs-CIgg-v6m.js} +1 -1
  202. package/dist/client/assets/{page-seo-form-DIJv_vfX.js → page-seo-form-91Ury5FK.js} +1 -1
  203. package/dist/client/assets/{pair-yIU6vg6r.js → pair-BgIPmVIF.js} +1 -1
  204. package/dist/client/assets/{parse-sections-DyZjWLD2.js → parse-sections-Cr8-2nO_.js} +1 -1
  205. package/dist/client/assets/{plan-DQbBYLyR.js → plan-Br-XQLzB.js} +1 -1
  206. package/dist/client/assets/{plan-ladder-BwOXsQw4.js → plan-ladder-C_aFfTB3.js} +1 -1
  207. package/dist/client/assets/{popover-C1CMw7Su.js → popover-DY18XQdw.js} +1 -1
  208. package/dist/client/assets/{post-calendar-Br59rf-0.js → post-calendar-H5a2LYpA.js} +1 -1
  209. package/dist/client/assets/{post-editor-Ouxx2EnK.js → post-editor-C5xh3g8K.js} +1 -1
  210. package/dist/client/assets/{preview-content-OcI7AZ-k.js → preview-content-Ctnw0ck-.js} +1 -1
  211. package/dist/client/assets/{preview-dialog-BHfp_kCk.js → preview-dialog-D50rbPo9.js} +1 -1
  212. package/dist/client/assets/{preview-panel-DaLROR-g.js → preview-panel-BQBG4EwV.js} +1 -1
  213. package/dist/client/assets/{preview-tab-CYPLIfmU.js → preview-tab-C47DAtfY.js} +3 -3
  214. package/dist/client/assets/{product-picker-dialog-Kq-lbAq4.js → product-picker-dialog-bDti8N0r.js} +1 -1
  215. package/dist/client/assets/{profile-0251t-iy.js → profile-BoWfThJx.js} +1 -1
  216. package/dist/client/assets/{project-app-view-Cusfy0F4.js → project-app-view-DKSPVcAQ.js} +1 -1
  217. package/dist/client/assets/{project-apps-CB5ObSeC.js → project-apps-DzTxvCYb.js} +1 -1
  218. package/dist/client/assets/{project-feed-E8fKFevk.js → project-feed-nLedZwej.js} +1 -1
  219. package/dist/client/assets/{project-icon-C5vvEb_A.js → project-icon-DzGNhKqT.js} +1 -1
  220. package/dist/client/assets/project-reports-JDDtVVP3.js +1 -0
  221. package/dist/client/assets/project-tasks-BJ8cR8c9.js +1 -0
  222. package/dist/client/assets/{projects-M0YOuoB5.js → projects-B5JRxWAu.js} +1 -1
  223. package/dist/client/assets/{projects-empty-state-C_Y7N2l4.js → projects-empty-state-WMtHc-H_.js} +1 -1
  224. package/dist/client/assets/{prompts-s4mk28HK.js → prompts-ZTVCIpwf.js} +1 -1
  225. package/dist/client/assets/record-editor-BZbW1F2F.js +1 -0
  226. package/dist/client/assets/{redirect-editor-DrHgTFHC.js → redirect-editor-1KeQGHs1.js} +1 -1
  227. package/dist/client/assets/{releases-api-B3zxxzhX.js → releases-api-DUHDtDQH.js} +1 -1
  228. package/dist/client/assets/{reports-BsbKFImz.js → reports-CYSifZbx.js} +1 -1
  229. package/dist/client/assets/reports-Cj0_OEle.js +1 -0
  230. package/dist/client/assets/{reports-onboarding-CCPUNG-k.js → reports-onboarding-B-jQwnh4.js} +1 -1
  231. package/dist/client/assets/{reports-tab-wwI8-Z9s.js → reports-tab-CtmocHnu.js} +2 -2
  232. package/dist/client/assets/repositories-BP0LnjRC.js +1 -0
  233. package/dist/client/assets/{repositories-gMk2Jtey.js → repositories-CCdMQrd5.js} +1 -1
  234. package/dist/client/assets/{repository-binding-BplOK1-K.js → repository-binding-BFGepSEK.js} +1 -1
  235. package/dist/client/assets/{repository-import-picker-Bmg3pctI.js → repository-import-picker-J0VT1RHB.js} +1 -1
  236. package/dist/client/assets/{repository-picker-Cz4_EfRs.js → repository-picker-Bg05sIEJ.js} +1 -1
  237. package/dist/client/assets/{require-capability-DFMzKO9H.js → require-capability-CSDD3UBf.js} +1 -1
  238. package/dist/client/assets/{required-auth-layout-BJBxNe59.js → required-auth-layout-CSoEKOsv.js} +1 -1
  239. package/dist/client/assets/{reset-password-BDKUzHzX.js → reset-password-9ckf5Kyy.js} +1 -1
  240. package/dist/client/assets/{resizable-CDqVtrC9.js → resizable-B_sG9gsv.js} +1 -1
  241. package/dist/client/assets/{resolve-tab-icon-jkUifP_t.js → resolve-tab-icon-CYDpy4ww.js} +1 -1
  242. package/dist/client/assets/{review-settings-GrpZwDvO.js → review-settings-Dn4RxK9Q.js} +1 -1
  243. package/dist/client/assets/{roles-BIld4CyW.js → roles-Cd0aYlUT.js} +1 -1
  244. package/dist/client/assets/{route-C49Xm04I.js → route-DLJqHi7F.js} +1 -1
  245. package/dist/client/assets/route-DmbYI245.js +1 -0
  246. package/dist/client/assets/{route-CUFe0FJv.js → route-DoncB_gh.js} +1 -1
  247. package/dist/client/assets/{sandbox-lifecycle-context-SSzF2sne.js → sandbox-lifecycle-context-STEBXMVJ.js} +1 -1
  248. package/dist/client/assets/{schema-DDJ9bxPz.js → schema-BV496kYE.js} +1 -1
  249. package/dist/client/assets/{schema-CQtNdMgc.js → schema-DLMpcKaR.js} +1 -1
  250. package/dist/client/assets/{scroll-area-DMv-rL1N.js → scroll-area-CJVjzhxk.js} +1 -1
  251. package/dist/client/assets/{search-input-DUHfcz5L.js → search-input-5HRrV8CZ.js} +1 -1
  252. package/dist/client/assets/{search-toggle-DbjRfTVa.js → search-toggle-BiqcaSEn.js} +1 -1
  253. package/dist/client/assets/{secret-picker-vxBrEwOY.js → secret-picker-BmVgIc4O.js} +1 -1
  254. package/dist/client/assets/{secrets-ChbFlS7C.js → secrets-DRR-fD7V.js} +1 -1
  255. package/dist/client/assets/{section-array-field-EGwJAYSE.js → section-array-field-DsmWGjnn.js} +1 -1
  256. package/dist/client/assets/{sections-wjkekUP5.js → sections-_xys3aZl.js} +1 -1
  257. package/dist/client/assets/{sections-editor-Pau1-0uT.js → sections-editor-mpeg9I7Z.js} +1 -1
  258. package/dist/client/assets/{select-C2h8JGxf.js → select-CEP6OVkE.js} +1 -1
  259. package/dist/client/assets/{select-model-BD7eUwVQ.js → select-model-x0I0UddZ.js} +1 -1
  260. package/dist/client/assets/{seo-editor-DRcWlUUW.js → seo-editor-z94zbXM9.js} +1 -1
  261. package/dist/client/assets/{separator-BWtqoXbT.js → separator-j-pswPgG.js} +1 -1
  262. package/dist/client/assets/settings-tab-CuIy5awS.js +1 -0
  263. package/dist/client/assets/{sheet-mWFXSToR.js → sheet-DfLRO9Ej.js} +1 -1
  264. package/dist/client/assets/{shell-layout-DSWvpIY-.js → shell-layout-DpsES1pk.js} +1 -1
  265. package/dist/client/assets/{site-draft-actions-D84W5-ko.js → site-draft-actions-BeX41xVi.js} +1 -1
  266. package/dist/client/assets/{site-draft-view-D1tY-4NS.js → site-draft-view-CnEo9XFj.js} +2 -2
  267. package/dist/client/assets/site-editor-3410DvFp.js +1 -0
  268. package/dist/client/assets/{site-editor-toast-Do6ZSWZw.js → site-editor-toast-dPE34yv3.js} +1 -1
  269. package/dist/client/assets/{skills-Cd6UiMgi.js → skills-TZE5fcsA.js} +1 -1
  270. package/dist/client/assets/{slider-COi2uzpW.js → slider-IjBbDscU.js} +1 -1
  271. package/dist/client/assets/{sortable.esm-qdpPfwkt.js → sortable.esm-mcWD2OGV.js} +1 -1
  272. package/dist/client/assets/{sso-B-X-AeTn.js → sso-DbYN-mCh.js} +1 -1
  273. package/dist/client/assets/{suggestion-CXSvi_ya.js → suggestion-DE8y-b5q.js} +1 -1
  274. package/dist/client/assets/{switch-DxUvK2ws.js → switch-BWycdCa8.js} +1 -1
  275. package/dist/client/assets/{symbol-B1YUs8Pa.js → symbol-Vy6NQMwF.js} +1 -1
  276. package/dist/client/assets/{synced-repos-CW5aCmPK.js → synced-repos-BhTkpzkJ.js} +1 -1
  277. package/dist/client/assets/{tab-icon-glyph-D-H6WHE_.js → tab-icon-glyph-DbyH0ZFI.js} +1 -1
  278. package/dist/client/assets/{table-DqeeTpOs.js → table-BWfH7VVC.js} +1 -1
  279. package/dist/client/assets/{tabs-BPCzIThV.js → tabs-mxygGbsQ.js} +1 -1
  280. package/dist/client/assets/{task-assignee-avatar-D6omiwOI.js → task-assignee-avatar-517AtuQO.js} +1 -1
  281. package/dist/client/assets/{task-board-BjErhxiY.js → task-board-DYxtOOtW.js} +1 -1
  282. package/dist/client/assets/{task-route-DdxPiCql.js → task-route-BmimspiT.js} +1 -1
  283. package/dist/client/assets/{task-status-Dsk7Kmgw.js → task-status-BAm1eRMu.js} +1 -1
  284. package/dist/client/assets/{taskboard-analytics-k3blgIG4.js → taskboard-analytics-CeTJFklI.js} +1 -1
  285. package/dist/client/assets/{tasks-B1jQnn1g.js → tasks-C5ePe723.js} +1 -1
  286. package/dist/client/assets/tasks-CPyZ9XBV.js +1 -0
  287. package/dist/client/assets/{textarea-FhDpbTid.js → textarea-DSI3yrRQ.js} +1 -1
  288. package/dist/client/assets/{thread-analytics-DADm0wyY.js → thread-analytics-CTEo8YO1.js} +1 -1
  289. package/dist/client/assets/{thread-intent-D86mGBmJ.js → thread-intent-wJOYAcPq.js} +1 -1
  290. package/dist/client/assets/{thread-route-Dhid2QXm.js → thread-route-CD3u6KaS.js} +1 -1
  291. package/dist/client/assets/{thread-route-VP5yBC1h.js → thread-route-tjkZulPh.js} +1 -1
  292. package/dist/client/assets/{thread-sheet-body-gescfe4s.js → thread-sheet-body-DZ9tM4sj.js} +1 -1
  293. package/dist/client/assets/{time-range-picker-0eDc4ckp.js → time-range-picker-D28VOP5v.js} +1 -1
  294. package/dist/client/assets/{toggle-group-cCLxdVS0.js → toggle-group-CFKXbFvG.js} +1 -1
  295. package/dist/client/assets/{tool-namespace-BQqkHHN2.js → tool-namespace-CBWoJZqr.js} +1 -1
  296. package/dist/client/assets/{toolbar-icon-button-BIoz36P3.js → toolbar-icon-button-CG49ZqT-.js} +1 -1
  297. package/dist/client/assets/{tooltip-BH7O8U6v.js → tooltip-CrreJsgc.js} +1 -1
  298. package/dist/client/assets/{tooltipContext-Bu6bYzrQ.js → tooltipContext-DF8cCwWM.js} +1 -1
  299. package/dist/client/assets/{track-BC_FOBSN.js → track-DgApnFTz.js} +1 -1
  300. package/dist/client/assets/{types-Dx7WLYeO.js → types-Dfc9oNyq.js} +1 -1
  301. package/dist/client/assets/{url-slug-BJoByld1.js → url-slug-Bd-dhz4h.js} +1 -1
  302. package/dist/client/assets/{usage-stats-Bqr7SMsL.js → usage-stats-CGDtyshq.js} +1 -1
  303. package/dist/client/assets/{use-ai-providers-DcdjcNWk.js → use-ai-providers-BQDbV1ZK.js} +1 -1
  304. package/dist/client/assets/{use-apply-named-rule-DbXWndeB.js → use-apply-named-rule-3gHN__bo.js} +1 -1
  305. package/dist/client/assets/{use-automations-DzYCSdvv.js → use-automations-DmDKlzGq.js} +1 -1
  306. package/dist/client/assets/{use-autosave-D2KwQDhz.js → use-autosave-B34S98yJ.js} +1 -1
  307. package/dist/client/assets/{use-chat-layout-state-jWfDU2-f.js → use-chat-layout-state-CMlb6hmW.js} +1 -1
  308. package/dist/client/assets/{use-clock-tick-E-feKy2H.js → use-clock-tick-BBiL9O_o.js} +1 -1
  309. package/dist/client/assets/{use-cms-publish-actions-C-tGuEW7.js → use-cms-publish-actions-D3r1PkM4.js} +1 -1
  310. package/dist/client/assets/{use-connect-companion-9nAuhZm3.js → use-connect-companion-j4rYcMFF.js} +1 -1
  311. package/dist/client/assets/{use-connection-BSVd6jY9.js → use-connection-BB0LJu3a.js} +1 -1
  312. package/dist/client/assets/{use-copy-BZAAMFHh.js → use-copy-B5cLN_C5.js} +1 -1
  313. package/dist/client/assets/{use-create-virtual-mcp-BBGr7fmc.js → use-create-virtual-mcp-67AQHCRY.js} +1 -1
  314. package/dist/client/assets/{use-date-fns-locale-CQ6-Sjjz.js → use-date-fns-locale-BmXggBY-.js} +1 -1
  315. package/dist/client/assets/{use-debounced-autosave-khJn9eH3.js → use-debounced-autosave-Bg4dZTFr.js} +1 -1
  316. package/dist/client/assets/{use-debounced-value-DHMt-YvZ.js → use-debounced-value-CRUnyb2r.js} +1 -1
  317. package/dist/client/assets/{use-deco-credits-UDy9oVyz.js → use-deco-credits-D45hXPQg.js} +1 -1
  318. package/dist/client/assets/{use-decopilot-events-DPOGE308.js → use-decopilot-events-BCczItbx.js} +1 -1
  319. package/dist/client/assets/{use-delete-connection-DZUzbE8H.js → use-delete-connection-CvS2dn71.js} +1 -1
  320. package/dist/client/assets/{use-deployment-admin-D_lJiiHz.js → use-deployment-admin-DgMIgn4f.js} +1 -1
  321. package/dist/client/assets/{use-fast-preview-draft-url-Dat_XnNq.js → use-fast-preview-draft-url-CrVzYj1n.js} +1 -1
  322. package/dist/client/assets/{use-file-configs-FQWpkNO9.js → use-file-configs-CvA4fBM5.js} +1 -1
  323. package/dist/client/assets/{use-inbox-feed-CvdhVh-Q.js → use-inbox-feed-BWA6Ulpd.js} +1 -1
  324. package/dist/client/assets/{use-infinite-scroll-D9yHexy7.js → use-infinite-scroll-CUJa5l30.js} +1 -1
  325. package/dist/client/assets/{use-join-requests-BxzwuIrl.js → use-join-requests-DL_UxBL9.js} +1 -1
  326. package/dist/client/assets/{use-main-panel-tabs-DjzqFFzf.js → use-main-panel-tabs-BI2DoKYj.js} +1 -1
  327. package/dist/client/assets/{use-mcp-auth-status-DNU_uZc1.js → use-mcp-auth-status-DDiq76rJ.js} +1 -1
  328. package/dist/client/assets/{use-mcp-client-VUKdisv5.js → use-mcp-client-4s5eiJEh.js} +1 -1
  329. package/dist/client/assets/{use-mcp-prompts-D5yuACkH.js → use-mcp-prompts-BtZsfmwR.js} +1 -1
  330. package/dist/client/assets/{use-mcp-tools-BmgsiGy4.js → use-mcp-tools-BiOw2q-J.js} +1 -1
  331. package/dist/client/assets/{use-mobile-qeR1f008.js → use-mobile-BUhaeAQH.js} +1 -1
  332. package/dist/client/assets/{use-move-blocks-XamE_4Yp.js → use-move-blocks-CnZgmUSp.js} +1 -1
  333. package/dist/client/assets/{use-navigate-to-agent-Dblb0Cto.js → use-navigate-to-agent-BDvRam4x.js} +1 -1
  334. package/dist/client/assets/{use-org-fs-CrieTxin.js → use-org-fs-fDwaJ0Sh.js} +1 -1
  335. package/dist/client/assets/{use-org-repo-syncs-P72KVxM1.js → use-org-repo-syncs-DX-adCLA.js} +1 -1
  336. package/dist/client/assets/{use-org-sso-CNH2nZM7.js → use-org-sso-B3fE-Rcc.js} +1 -1
  337. package/dist/client/assets/{use-organization-roles-CyNKnVYX.js → use-organization-roles-BIlfAB6i.js} +1 -1
  338. package/dist/client/assets/{use-organization-settings-BoplTvFL.js → use-organization-settings-R0q4iG4j.js} +1 -1
  339. package/dist/client/assets/{use-panel-navigate-C8PahcNc.js → use-panel-navigate-LMuhBwrk.js} +1 -1
  340. package/dist/client/assets/{use-project-native-view-presence-B5-VJk9q.js → use-project-native-view-presence-DpLyWumT.js} +1 -1
  341. package/dist/client/assets/{use-project-scope-BG9bvSWW.js → use-project-scope-BtBHn9Jp.js} +1 -1
  342. package/dist/client/assets/{use-recent-apps-BlKwbqAY.js → use-recent-apps-BuBm5pbE.js} +1 -1
  343. package/dist/client/assets/{use-releases-DsrNW2Ek.js → use-releases-D9MPDCz7.js} +1 -1
  344. package/dist/client/assets/{use-reports-diagnostic-DwMGILz2.js → use-reports-diagnostic-lTJmIbnn.js} +1 -1
  345. package/dist/client/assets/{use-sandbox-events-CMkzG3Zz.js → use-sandbox-events-C4shOk3b.js} +1 -1
  346. package/dist/client/assets/{use-secrets-BWxSNYV6.js → use-secrets-Dvk7MRET.js} +1 -1
  347. package/dist/client/assets/{use-section-preview-base-CRxqndHa.js → use-section-preview-base-CZy29Jxx.js} +1 -1
  348. package/dist/client/assets/{use-session-runtime-BLaBf_XS.js → use-session-runtime-B6BD0biY.js} +1 -1
  349. package/dist/client/assets/{use-sidebar-collapsed-DWEv2uSm.js → use-sidebar-collapsed-CQl-rnhM.js} +1 -1
  350. package/dist/client/assets/{use-tags-CW3PDXnj.js → use-tags-Br8YA8t_.js} +1 -1
  351. package/dist/client/assets/{use-task-board-analytics-BuFk-UYI.js → use-task-board-analytics-CBvceYkp.js} +1 -1
  352. package/dist/client/assets/{use-task-board-events-DLSQcorr.js → use-task-board-events-UbAx3_td.js} +1 -1
  353. package/dist/client/assets/{use-task-board-item-prs-CZZADJBK.js → use-task-board-item-prs-DY3JrAUI.js} +1 -1
  354. package/dist/client/assets/{use-task-metadata-BRiKF2Eg.js → use-task-metadata-B_j4y13_.js} +1 -1
  355. package/dist/client/assets/{use-thread-analytics-Bnq_qP9t.js → use-thread-analytics--IZNKFJm.js} +1 -1
  356. package/dist/client/assets/{use-thread-outputs-CWWLS16h.js → use-thread-outputs-CTFOZZ8Q.js} +1 -1
  357. package/dist/client/assets/useInfiniteQuery-BZM9p8aI.js +1 -0
  358. package/dist/client/assets/{useQueries-C6MnX8oH.js → useQueries-DHlvWNcJ.js} +1 -1
  359. package/dist/client/assets/useSuspenseInfiniteQuery-DaqJKtQG.js +1 -0
  360. package/dist/client/assets/{users-C_BfM-iI.js → users-Dx-Kw9rt.js} +1 -1
  361. package/dist/client/assets/{utils-D-9Mcz1C.js → utils-CsMlPs5M.js} +1 -1
  362. package/dist/client/assets/{variant-calendar-BBKZL6jN.js → variant-calendar-CQMZON_P.js} +1 -1
  363. package/dist/client/assets/{variant-matcher-override-B-XUl_qP.js → variant-matcher-override-DXSVPYOd.js} +1 -1
  364. package/dist/client/assets/{view-header-DPaPdjDa.js → view-header-DqWtxlGw.js} +1 -1
  365. package/dist/client/assets/{virtual-mcp-CQRqpyGy.js → virtual-mcp-DD3pH2JU.js} +1 -1
  366. package/dist/client/assets/{watch-sse-pool-Cb-96kB9.js → watch-sse-pool-Dkuv_IW6.js} +1 -1
  367. package/dist/client/index.html +1 -1
  368. package/dist/server/server.js +694 -682
  369. package/package.json +1 -1
  370. package/dist/client/assets/agent-app-Bw_xR2nO.js +0 -1
  371. package/dist/client/assets/agent-deck-DEZ5pY7c.js +0 -1
  372. package/dist/client/assets/agent-experiments-u88gJrf9.js +0 -1
  373. package/dist/client/assets/agent-library-DWNH1dJK.js +0 -1
  374. package/dist/client/assets/agent-library-file-yFgP4_TW.js +0 -1
  375. package/dist/client/assets/agent-monitor-BOzZC3Ye.js +0 -1
  376. package/dist/client/assets/agent-settings-CdTJiiA4.js +0 -1
  377. package/dist/client/assets/agent-site-editor-code-C-7bunw0.js +0 -2
  378. package/dist/client/assets/agent-site-editor-content-BBd5HSOk.js +0 -1
  379. package/dist/client/assets/agent-site-editor-preview-DSFscHmM.js +0 -1
  380. package/dist/client/assets/agent-view-CGetwt8L.js +0 -1
  381. package/dist/client/assets/api-keys-Dq0jMNpz.js +0 -1
  382. package/dist/client/assets/cdn-tab-B8a-vFO8.js +0 -1
  383. package/dist/client/assets/library-D3uDvwzW.js +0 -1
  384. package/dist/client/assets/project-reports-T6nQ-9XH.js +0 -1
  385. package/dist/client/assets/project-tasks-CM_Lf-P6.js +0 -1
  386. package/dist/client/assets/record-editor-B0nlXilA.js +0 -1
  387. package/dist/client/assets/reports-DNHZxX1g.js +0 -1
  388. package/dist/client/assets/repositories-CX6DIFDK.js +0 -1
  389. package/dist/client/assets/route-BUz-dlQp.js +0 -1
  390. package/dist/client/assets/settings-tab-DgQZvJX7.js +0 -1
  391. package/dist/client/assets/site-editor-CKLERBjg.js +0 -1
  392. package/dist/client/assets/tasks-DDXuIUJl.js +0 -1
  393. package/dist/client/assets/useInfiniteQuery-DrcPUg1U.js +0 -1
  394. package/dist/client/assets/useSuspenseInfiniteQuery-nHttoIU_.js +0 -1
@@ -1 +1 @@
1
- import{c as lt,l as J,j as l}from"./index-CgoVr5FU.js";import{C as Q,b as Z}from"./chart-CRp8tHJr.js";import{C as tt,X as et,Y as at}from"./CartesianChart-DYKipWMh.js";import{A as mt,a as ut}from"./AreaChart-BtD6HX7c.js";import{C as dt}from"./tooltipContext-Bu6bYzrQ.js";import{B as ht,a as pt}from"./BarChart-DpqgYvpT.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)),u=a[x];u&&(u.calls+=1,o.isError&&(u.errors+=1),Number.isFinite(o.durationMs)&&u.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 u;t[3]!==x||t[4]!==m||t[5]!==i?(u=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]=u):u=t[6];const S=u;let y;t[7]!==a?(y=l.jsx("div",{className:"text-2xs 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 v;t[11]!==S?(v=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=v):v=t[12];let p;t[13]!==k||t[14]!==v?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,v]}),t[13]=k,t[14]=v,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",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(d=>d[e]??0),0);if(g==="area"){let d;t[0]!==c?(d=J(c,"w-full"),t[0]=c,t[1]=d):d=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 b;t[5]!==e||t[6]!==M?(b={[e]:M},t[5]=e,t[6]=M,t[7]=b):b=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(et,{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(at,{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(ut,{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]!==d||t[41]!==b?(H=l.jsx(Z,{role:"img","aria-label":n,className:d,config:b,children:B}),t[38]=n,t[39]=B,t[40]=d,t[41]=b,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 u;t[48]!==e||t[49]!==x?(u={[e]:x},t[48]=e,t[49]=x,t[50]=u):u=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 v=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==v?(p=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:v,tickMargin:8}),t[54]=v,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(at,{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:d=>{const{active:M,payload:b}=d;return l.jsx(rt,{active:M,payload:b,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 d;t[67]!==a||t[68]!==e?(d=(M,b)=>l.jsx(dt,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${b}`),t[67]=a,t[68]=e,t[69]=d):d=t[69],L=r.map(d),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]!==u?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:u,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=u,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-BXY_6H_h.js";import{C as Q,b as Z}from"./chart-BZWQB7-x.js";import{C as tt,X as et,Y as at}from"./CartesianChart-Cr8uE6_k.js";import{A as mt,a as ut}from"./AreaChart-eTT2Y7Ef.js";import{C as dt}from"./tooltipContext-DF8cCwWM.js";import{B as ht,a as pt}from"./BarChart-DhRFPAeY.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)),u=a[x];u&&(u.calls+=1,o.isError&&(u.errors+=1),Number.isFinite(o.durationMs)&&u.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 u;t[3]!==x||t[4]!==m||t[5]!==i?(u=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]=u):u=t[6];const S=u;let y;t[7]!==a?(y=l.jsx("div",{className:"text-2xs 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 v;t[11]!==S?(v=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=v):v=t[12];let p;t[13]!==k||t[14]!==v?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,v]}),t[13]=k,t[14]=v,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",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(d=>d[e]??0),0);if(g==="area"){let d;t[0]!==c?(d=J(c,"w-full"),t[0]=c,t[1]=d):d=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 b;t[5]!==e||t[6]!==M?(b={[e]:M},t[5]=e,t[6]=M,t[7]=b):b=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(et,{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(at,{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(ut,{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]!==d||t[41]!==b?(H=l.jsx(Z,{role:"img","aria-label":n,className:d,config:b,children:B}),t[38]=n,t[39]=B,t[40]=d,t[41]=b,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 u;t[48]!==e||t[49]!==x?(u={[e]:x},t[48]=e,t[49]=x,t[50]=u):u=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 v=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==v?(p=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:v,tickMargin:8}),t[54]=v,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(at,{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:d=>{const{active:M,payload:b}=d;return l.jsx(rt,{active:M,payload:b,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 d;t[67]!==a||t[68]!==e?(d=(M,b)=>l.jsx(dt,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${b}`),t[67]=a,t[68]=e,t[69]=d):d=t[69],L=r.map(d),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]!==u?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:u,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=u,t[84]=F):F=t[84],F}export{Lt as K,Ct as c};
@@ -1 +1 @@
1
- import{c as ie,r as U,l as ce,j as t}from"./index-CgoVr5FU.js";import{B as le}from"./badge-iD6YraPr.js";import{C as ne}from"./checkbox-Bo5LsWbi.js";import{t as ae}from"./ChevronUp-bjIxVrad.js";import{e as de,C as me,b as oe,c as ue,a as fe,d as he}from"./command-hbwPLpaS.js";import{a as xe,b as pe,P as ge}from"./popover-C1CMw7Su.js";const ve=[];function Ve(r){const e=ie.c(68),{options:a,onValueChange:o,defaultValue:W,placeholder:X,animation:Z,maxCount:ee,modalPopover:te,className:M,disabled:se,onSearchChange:S}=r,d=W===void 0?ve:W,$=X===void 0?"Select items":X,P=Z===void 0?0:Z,k=ee===void 0?3:ee,J=te===void 0?!1:te,Y=se===void 0?!1:se,[s,y]=U.useState(d),[F,_]=U.useState(!1);let V,E;e[0]!==d||e[1]!==s?(V=()=>{JSON.stringify(s)!==JSON.stringify(d)&&y(d)},E=[d,s],e[0]=d,e[1]=s,e[2]=V,e[3]=E):(V=e[2],E=e[3]),U.useEffect(V,E);let O;e[4]!==o||e[5]!==s?(O=l=>{if(l.key==="Enter")_(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const n=[...s];n.pop(),y(n),o(n)}},e[4]=o,e[5]=s,e[6]=O):O=e[6];const G=O;let D;e[7]!==o||e[8]!==s?(D=l=>{const n=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];y(n),o(n)},e[7]=o,e[8]=s,e[9]=D):D=e[9];const c=D;let I;e[10]!==o?(I=()=>{y([]),o([])},e[10]=o,e[11]=I):I=e[11];const L=I;let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{_(Ne)},e[12]=z):z=e[12];const re=z;let A;e[13]!==L||e[14]!==o||e[15]!==a||e[16]!==s.length?(A=()=>{if(s.length===a.length)L();else{const l=a.map(Ce);y(l),o(l)}},e[13]=L,e[14]=o,e[15]=a,e[16]=s.length,e[17]=A):A=e[17];const i=A;let m;e[18]!==M?(m=ce("focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex h-[var(--studio-control-height,2.25rem)] w-full max-w-xs items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] pr-3 pl-1.5 text-sm shadow-edge transition-[background-color,box-shadow] hover:bg-sidebar disabled:pointer-events-none disabled:text-subtle-foreground",M),e[18]=M,e[19]=m):m=e[19];let u;e[20]!==P||e[21]!==k||e[22]!==a||e[23]!==$||e[24]!==s?(u=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 n=a.find(Q=>Q.value===l),w=n?.icon;return t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card max-w-28",style:{animationDuration:`${P}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:n?.label})]},l)}),s.length>k&&t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card flex-shrink-0",style:{animationDuration:`${P}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})})]}):t.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[t.jsx("span",{className:"text-subtle-foreground pl-1.5 text-sm",children:$}),t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})]}),e[20]=P,e[21]=k,e[22]=a,e[23]=$,e[24]=s,e[25]=u):u=e[25];let f;e[26]!==Y||e[27]!==m||e[28]!==u?(f=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button",onClick:re,className:m,disabled:Y,children:u})}),e[26]=Y,e[27]=m,e[28]=u,e[29]=f):f=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=()=>_(!1),e[30]=R):R=e[30];const q=!S;let h;e[31]!==G||e[32]!==S?(h=t.jsx(de,{placeholder:"Search...",onKeyDown:G,onValueChange:S,className:"rounded-t-xl"}),e[31]=G,e[32]=S,e[33]=h):h=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(me,{children:"No results found."}),e[34]=T):T=e[34];let x;e[35]!==i?(x=()=>{i()},e[35]=i,e[36]=x):x=e[36];let p;e[37]!==i?(p=l=>{l.stopPropagation(),i()},e[37]=i,e[38]=p):p=e[38];const H=s.length===a.length&&a.length>0;let g;e[39]!==H||e[40]!==i?(g=t.jsx(ne,{checked:H,onCheckedChange:i,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:be}),e[39]=H,e[40]=i,e[41]=g):g=e[41];let B;e[42]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{children:"(Select All)"}),e[42]=B):B=e[42];let v;e[43]!==p||e[44]!==g?(v=t.jsxs("div",{className:"flex items-center w-full",onClick:p,children:[g,B]}),e[43]=p,e[44]=g,e[45]=v):v=e[45];let j;e[46]!==x||e[47]!==v?(j=t.jsx(oe,{onSelect:x,className:"cursor-pointer",children:v},"all"),e[46]=x,e[47]=v,e[48]=j):j=e[48];let b;if(e[49]!==a||e[50]!==s||e[51]!==c){let l;e[53]!==s||e[54]!==c?(l=n=>{const w=s.includes(n.value);return t.jsx(oe,{onSelect:()=>{c(n)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:Q=>{Q.stopPropagation(),c(n)},children:[t.jsx(ne,{checked:w,onCheckedChange:()=>{c(n)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:je}),n.icon&&t.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:n.label})]})},n.value)},e[53]=s,e[54]=c,e[55]=l):l=e[55],b=a.map(l),e[49]=a,e[50]=s,e[51]=c,e[52]=b}else b=e[52];let C;e[56]!==j||e[57]!==b?(C=t.jsxs(ue,{className:"rounded-b-xl",children:[T,t.jsxs(fe,{children:[j,b]})]}),e[56]=j,e[57]=b,e[58]=C):C=e[58];let N;e[59]!==q||e[60]!==h||e[61]!==C?(N=t.jsx(pe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:R,children:t.jsxs(he,{shouldFilter:q,className:"rounded-xl",children:[h,C]})}),e[59]=q,e[60]=h,e[61]=C,e[62]=N):N=e[62];let K;return e[63]!==F||e[64]!==J||e[65]!==f||e[66]!==N?(K=t.jsxs(ge,{open:F,onOpenChange:_,modal:J,children:[f,N]}),e[63]=F,e[64]=J,e[65]=f,e[66]=N,e[67]=K):K=e[67],K}function je(r){return r.stopPropagation()}function be(r){return r.stopPropagation()}function Ce(r){return r.value}function Ne(r){return!r}export{Ve as M};
1
+ import{c as ie,r as U,l as ce,j as t}from"./index-BXY_6H_h.js";import{B as le}from"./badge-DunYeylq.js";import{C as ne}from"./checkbox-CMW8RKoG.js";import{t as ae}from"./ChevronUp-Bq07Wt0S.js";import{e as de,C as me,b as oe,c as ue,a as fe,d as he}from"./command-DF7NsdME.js";import{a as xe,b as pe,P as ge}from"./popover-DY18XQdw.js";const ve=[];function Ve(r){const e=ie.c(68),{options:a,onValueChange:o,defaultValue:W,placeholder:X,animation:Z,maxCount:ee,modalPopover:te,className:M,disabled:se,onSearchChange:S}=r,d=W===void 0?ve:W,$=X===void 0?"Select items":X,P=Z===void 0?0:Z,k=ee===void 0?3:ee,J=te===void 0?!1:te,Y=se===void 0?!1:se,[s,y]=U.useState(d),[F,_]=U.useState(!1);let V,E;e[0]!==d||e[1]!==s?(V=()=>{JSON.stringify(s)!==JSON.stringify(d)&&y(d)},E=[d,s],e[0]=d,e[1]=s,e[2]=V,e[3]=E):(V=e[2],E=e[3]),U.useEffect(V,E);let O;e[4]!==o||e[5]!==s?(O=l=>{if(l.key==="Enter")_(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const n=[...s];n.pop(),y(n),o(n)}},e[4]=o,e[5]=s,e[6]=O):O=e[6];const G=O;let D;e[7]!==o||e[8]!==s?(D=l=>{const n=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];y(n),o(n)},e[7]=o,e[8]=s,e[9]=D):D=e[9];const c=D;let I;e[10]!==o?(I=()=>{y([]),o([])},e[10]=o,e[11]=I):I=e[11];const L=I;let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{_(Ne)},e[12]=z):z=e[12];const re=z;let A;e[13]!==L||e[14]!==o||e[15]!==a||e[16]!==s.length?(A=()=>{if(s.length===a.length)L();else{const l=a.map(Ce);y(l),o(l)}},e[13]=L,e[14]=o,e[15]=a,e[16]=s.length,e[17]=A):A=e[17];const i=A;let m;e[18]!==M?(m=ce("focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex h-[var(--studio-control-height,2.25rem)] w-full max-w-xs items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] pr-3 pl-1.5 text-sm shadow-edge transition-[background-color,box-shadow] hover:bg-sidebar disabled:pointer-events-none disabled:text-subtle-foreground",M),e[18]=M,e[19]=m):m=e[19];let u;e[20]!==P||e[21]!==k||e[22]!==a||e[23]!==$||e[24]!==s?(u=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 n=a.find(Q=>Q.value===l),w=n?.icon;return t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card max-w-28",style:{animationDuration:`${P}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:n?.label})]},l)}),s.length>k&&t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card flex-shrink-0",style:{animationDuration:`${P}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})})]}):t.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[t.jsx("span",{className:"text-subtle-foreground pl-1.5 text-sm",children:$}),t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})]}),e[20]=P,e[21]=k,e[22]=a,e[23]=$,e[24]=s,e[25]=u):u=e[25];let f;e[26]!==Y||e[27]!==m||e[28]!==u?(f=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button",onClick:re,className:m,disabled:Y,children:u})}),e[26]=Y,e[27]=m,e[28]=u,e[29]=f):f=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=()=>_(!1),e[30]=R):R=e[30];const q=!S;let h;e[31]!==G||e[32]!==S?(h=t.jsx(de,{placeholder:"Search...",onKeyDown:G,onValueChange:S,className:"rounded-t-xl"}),e[31]=G,e[32]=S,e[33]=h):h=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(me,{children:"No results found."}),e[34]=T):T=e[34];let x;e[35]!==i?(x=()=>{i()},e[35]=i,e[36]=x):x=e[36];let p;e[37]!==i?(p=l=>{l.stopPropagation(),i()},e[37]=i,e[38]=p):p=e[38];const H=s.length===a.length&&a.length>0;let g;e[39]!==H||e[40]!==i?(g=t.jsx(ne,{checked:H,onCheckedChange:i,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:be}),e[39]=H,e[40]=i,e[41]=g):g=e[41];let B;e[42]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{children:"(Select All)"}),e[42]=B):B=e[42];let v;e[43]!==p||e[44]!==g?(v=t.jsxs("div",{className:"flex items-center w-full",onClick:p,children:[g,B]}),e[43]=p,e[44]=g,e[45]=v):v=e[45];let j;e[46]!==x||e[47]!==v?(j=t.jsx(oe,{onSelect:x,className:"cursor-pointer",children:v},"all"),e[46]=x,e[47]=v,e[48]=j):j=e[48];let b;if(e[49]!==a||e[50]!==s||e[51]!==c){let l;e[53]!==s||e[54]!==c?(l=n=>{const w=s.includes(n.value);return t.jsx(oe,{onSelect:()=>{c(n)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:Q=>{Q.stopPropagation(),c(n)},children:[t.jsx(ne,{checked:w,onCheckedChange:()=>{c(n)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:je}),n.icon&&t.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:n.label})]})},n.value)},e[53]=s,e[54]=c,e[55]=l):l=e[55],b=a.map(l),e[49]=a,e[50]=s,e[51]=c,e[52]=b}else b=e[52];let C;e[56]!==j||e[57]!==b?(C=t.jsxs(ue,{className:"rounded-b-xl",children:[T,t.jsxs(fe,{children:[j,b]})]}),e[56]=j,e[57]=b,e[58]=C):C=e[58];let N;e[59]!==q||e[60]!==h||e[61]!==C?(N=t.jsx(pe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:R,children:t.jsxs(he,{shouldFilter:q,className:"rounded-xl",children:[h,C]})}),e[59]=q,e[60]=h,e[61]=C,e[62]=N):N=e[62];let K;return e[63]!==F||e[64]!==J||e[65]!==f||e[66]!==N?(K=t.jsxs(ge,{open:F,onOpenChange:_,modal:J,children:[f,N]}),e[63]=F,e[64]=J,e[65]=f,e[66]=N,e[67]=K):K=e[67],K}function je(r){return r.stopPropagation()}function be(r){return r.stopPropagation()}function Ce(r){return r.value}function Ne(r){return!r}export{Ve as M};
@@ -1,4 +1,4 @@
1
- import{q as H,b as W,e as z,K,c as V,j as m,r as J,D as $,v as G,w as L,x as Y,B as O,t as N}from"./index-CgoVr5FU.js";import{u as X}from"./use-session-runtime-BLaBf_XS.js";import{o as Z,c as _,u as I,D as M,N as ee,P as te,R as re,al as se,W as ne,H as ae,F as oe,G as ie,a0 as ce,$ as ue,q as le,J as fe}from"./site-editor-toast-Do6ZSWZw.js";import{s as pe}from"./sandbox-git-api-DcqI6XE4.js";import{u as he}from"./chat-context-CgGENb-d.js";import{F as de,H as ve}from"./blocks-tab-states-DcLcpiN-.js";import{t as B,u as ye}from"./held-block-view-BmGcRSLV.js";import{b as ge}from"./sandbox-url-D3mC8qhT.js";import{d as we}from"./utils-D-9Mcz1C.js";import{i as me}from"./CheckCircle-D6Wz8hBJ.js";import{a as xe}from"./Copy01-D43IjSFC.js";import{MonacoCodeEditor as Ee}from"./monaco-editor-D7hOBWJ6.js";function _e({orgSlug:s,virtualMcpId:e,branch:r}){const t=H(),a=he()?.taskId??null,n=Z(e),o=X(e).runtime==="cms",{url:c}=_(e),u=I(e,r),p=u.kind==="protocol"?u:null,d=M({orgSlug:s,virtualMcpId:e,branch:r}),y=async i=>{if(c)return{ok:!0,existed:!0};if(o){const h=await ce({orgSlug:s,virtualMcpId:e,branch:r},{delete:[i]});return ue(t,{orgSlug:s,virtualMcpId:e,branch:r},h),await t.invalidateQueries({queryKey:pe({orgSlug:s,virtualMcpId:e,branch:r,threadId:a})}),{ok:!0,existed:!0}}const f=le(n,we(i)),l=await fetch(ge({orgSlug:s,virtualMcpId:e,branch:r,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():fe(l,"Delete")},x=W(),C=z({mutationKey:ie(s,e,r),scope:oe(s,e,r),mutationFn:async({blockKey:i,base:f,shown:l})=>{if(p?.source==="github"){const h=l?.();try{await de({queryClient:t,backend:p,params:{orgSlug:s,virtualMcpId:e,branch:r},cacheKey:d},{writes:{},deletes:[i]},f&&f.value!==void 0?{[i]:f.value}:void 0,h&&h.value!==void 0?{[i]:h}:void 0)}catch(v){if(v instanceof ve)return{keptTheirs:!0,deleted:!1};throw v}return{ok:!0,existed:!0}}return p?(await ne(t,p,{orgSlug:s,virtualMcpId:e,branch:r},d,{delete:[i]}),{ok:!0,existed:!0}):ae({queryClient:t,orgSlug:s,virtualMcpId:e,branch:r,backend:u,cacheKey:d},{kind:"edit",write:()=>y(i)})},onMutate:async({blockKey:i})=>{const f=K.decofile(d);await t.cancelQueries({queryKey:f});const l=t.getQueryData(f),h=!!l&&i in l,v=l?.[i];return t.setQueryData(f,E=>{if(!E)return E;const{[i]:w,...b}=E;return b}),{queryKey:f,blockKey:i,hadKey:h,previousValue:v}},onError:(i,f,l)=>{te(x,i),l&&(p?.source==="github"&&(re(i)||i instanceof se)||t.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h))},onSuccess:i=>{if(B(i)){ee(x,!1);return}t.invalidateQueries({queryKey:K.liveMeta(s,e,r)})}}),S=i=>{if(i.base)return i;const f=t.getQueryData(K.decofile(d));return f?{...i,base:{value:f[i.blockKey]}}:i};return{...C,mutate:(i,f)=>C.mutate(S(i),f),mutateAsync:(i,f)=>C.mutateAsync(S(i),f)}}function ke({open:s,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const n=W(),o=t[r],c=o===void 0,u=c?"":JSON.stringify(o,null,2),[p,d]=J.useState(!1),[y,x]=J.useState(u),[C,S]=J.useState(!1),i=!a||c,f=y!==u,l=()=>{navigator.clipboard.writeText(y).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},h=async v=>{if(!a||C)return;let E;try{E=JSON.parse(v)}catch{N.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}S(!0);try{const w=await a(E);B(w)||N.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(w){N.error(n("sectionsEditor.pageJsonDialog.saveError",{error:w instanceof Error?w.message:String(w)}))}finally{S(!1)}};return m.jsx($,{open:s,onOpenChange:e,children:m.jsxs(G,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[m.jsxs(L,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m.jsx(Y,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),m.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[m.jsxs(O,{variant:"ghost",size:"sm",onClick:l,className:"text-xs",children:[p?m.jsx(me,{size:12}):m.jsx(xe,{size:12}),n(p?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!i&&m.jsx(O,{size:"sm",onClick:()=>h(y),disabled:!f||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),c?m.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):m.jsx("div",{className:"min-h-0 flex-1 py-2",children:m.jsx(Ee,{code:u,language:"json",readOnly:i,height:"100%",onChange:v=>x(v??""),onSave:v=>{h(v)}})})]})})}function Ie(s){const e=V.c(10);let r,t;e[0]!==s?({params:r,...t}=s,e[0]=s,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const n=ye(r,a);let o;e[4]!==t.pageKey||e[5]!==n?(o=u=>n.mutateAsync({blockKey:t.pageKey,data:u}),e[4]=t.pageKey,e[5]=n,e[6]=o):o=e[6];let c;return e[7]!==t||e[8]!==o?(c=m.jsx(ke,{...t,onSave:o}),e[7]=t,e[8]=o,e[9]=c):c=e[9],c}var Ce=Object.prototype.toString,j=Array.isArray||function(e){return Ce.call(e)==="[object Array]"};function q(s){return typeof s=="function"}function De(s){return j(s)?"array":typeof s}function U(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function Se(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var Pe=RegExp.prototype.test;function je(s,e){return Pe.call(s,e)}var be=/\S/;function Te(s){return!je(be,s)}var Re={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Ke(s){return String(s).replace(/[&<>"'`=\/]/g,function(r){return Re[r]})}var Je=/\s*/,Ne=/\s+/,Q=/\s*=/,Ue=/\s*\}/,qe=/#|\^|\/|>|\{|&|=|!/;function Oe(s,e){if(!s)return[];var r=!1,t=[],a=[],n=[],o=!1,c=!1,u="",p=0;function d(){if(o&&!c)for(;n.length;)delete a[n.pop()];else n=[];o=!1,c=!1}var y,x,C;function S(D){if(typeof D=="string"&&(D=D.split(Ne,2)),!j(D)||D.length!==2)throw new Error("Invalid tags: "+D);y=new RegExp(U(D[0])+"\\s*"),x=new RegExp("\\s*"+U(D[1])),C=new RegExp("\\s*"+U("}"+D[1]))}S(e||k.tags);for(var i=new R(s),f,l,h,v,E,w;!i.eos();){if(f=i.pos,h=i.scanUntil(y),h)for(var b=0,F=h.length;b<F;++b)v=h.charAt(b),Te(v)?(n.push(a.length),u+=v):(c=!0,r=!0,u+=" "),a.push(["text",v,f,f+1]),f+=1,v===`
1
+ import{q as H,b as W,e as z,K,c as V,j as m,r as J,D as $,v as G,w as L,x as Y,B as O,t as N}from"./index-BXY_6H_h.js";import{u as X}from"./use-session-runtime-B6BD0biY.js";import{o as Z,c as _,u as I,D as M,N as ee,P as te,R as re,al as se,W as ne,H as ae,F as oe,G as ie,a0 as ce,$ as ue,q as le,J as fe}from"./site-editor-toast-dPE34yv3.js";import{s as pe}from"./sandbox-git-api-DcqI6XE4.js";import{u as he}from"./chat-context-5nWd2wfH.js";import{F as de,H as ve}from"./blocks-tab-states-BJ_KtaIe.js";import{t as B,u as ye}from"./held-block-view-B8sEdlHZ.js";import{b as ge}from"./sandbox-url-D3mC8qhT.js";import{d as we}from"./utils-CsMlPs5M.js";import{i as me}from"./CheckCircle-CkMlHbcx.js";import{a as xe}from"./Copy01-DVjYf8UE.js";import{MonacoCodeEditor as Ee}from"./monaco-editor-JQgHEiJt.js";function _e({orgSlug:s,virtualMcpId:e,branch:r}){const t=H(),a=he()?.taskId??null,n=Z(e),o=X(e).runtime==="cms",{url:c}=_(e),u=I(e,r),p=u.kind==="protocol"?u:null,d=M({orgSlug:s,virtualMcpId:e,branch:r}),y=async i=>{if(c)return{ok:!0,existed:!0};if(o){const h=await ce({orgSlug:s,virtualMcpId:e,branch:r},{delete:[i]});return ue(t,{orgSlug:s,virtualMcpId:e,branch:r},h),await t.invalidateQueries({queryKey:pe({orgSlug:s,virtualMcpId:e,branch:r,threadId:a})}),{ok:!0,existed:!0}}const f=le(n,we(i)),l=await fetch(ge({orgSlug:s,virtualMcpId:e,branch:r,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():fe(l,"Delete")},x=W(),C=z({mutationKey:ie(s,e,r),scope:oe(s,e,r),mutationFn:async({blockKey:i,base:f,shown:l})=>{if(p?.source==="github"){const h=l?.();try{await de({queryClient:t,backend:p,params:{orgSlug:s,virtualMcpId:e,branch:r},cacheKey:d},{writes:{},deletes:[i]},f&&f.value!==void 0?{[i]:f.value}:void 0,h&&h.value!==void 0?{[i]:h}:void 0)}catch(v){if(v instanceof ve)return{keptTheirs:!0,deleted:!1};throw v}return{ok:!0,existed:!0}}return p?(await ne(t,p,{orgSlug:s,virtualMcpId:e,branch:r},d,{delete:[i]}),{ok:!0,existed:!0}):ae({queryClient:t,orgSlug:s,virtualMcpId:e,branch:r,backend:u,cacheKey:d},{kind:"edit",write:()=>y(i)})},onMutate:async({blockKey:i})=>{const f=K.decofile(d);await t.cancelQueries({queryKey:f});const l=t.getQueryData(f),h=!!l&&i in l,v=l?.[i];return t.setQueryData(f,E=>{if(!E)return E;const{[i]:w,...b}=E;return b}),{queryKey:f,blockKey:i,hadKey:h,previousValue:v}},onError:(i,f,l)=>{te(x,i),l&&(p?.source==="github"&&(re(i)||i instanceof se)||t.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h))},onSuccess:i=>{if(B(i)){ee(x,!1);return}t.invalidateQueries({queryKey:K.liveMeta(s,e,r)})}}),S=i=>{if(i.base)return i;const f=t.getQueryData(K.decofile(d));return f?{...i,base:{value:f[i.blockKey]}}:i};return{...C,mutate:(i,f)=>C.mutate(S(i),f),mutateAsync:(i,f)=>C.mutateAsync(S(i),f)}}function ke({open:s,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const n=W(),o=t[r],c=o===void 0,u=c?"":JSON.stringify(o,null,2),[p,d]=J.useState(!1),[y,x]=J.useState(u),[C,S]=J.useState(!1),i=!a||c,f=y!==u,l=()=>{navigator.clipboard.writeText(y).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},h=async v=>{if(!a||C)return;let E;try{E=JSON.parse(v)}catch{N.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}S(!0);try{const w=await a(E);B(w)||N.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(w){N.error(n("sectionsEditor.pageJsonDialog.saveError",{error:w instanceof Error?w.message:String(w)}))}finally{S(!1)}};return m.jsx($,{open:s,onOpenChange:e,children:m.jsxs(G,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[m.jsxs(L,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m.jsx(Y,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),m.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[m.jsxs(O,{variant:"ghost",size:"sm",onClick:l,className:"text-xs",children:[p?m.jsx(me,{size:12}):m.jsx(xe,{size:12}),n(p?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!i&&m.jsx(O,{size:"sm",onClick:()=>h(y),disabled:!f||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),c?m.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):m.jsx("div",{className:"min-h-0 flex-1 py-2",children:m.jsx(Ee,{code:u,language:"json",readOnly:i,height:"100%",onChange:v=>x(v??""),onSave:v=>{h(v)}})})]})})}function Ie(s){const e=V.c(10);let r,t;e[0]!==s?({params:r,...t}=s,e[0]=s,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const n=ye(r,a);let o;e[4]!==t.pageKey||e[5]!==n?(o=u=>n.mutateAsync({blockKey:t.pageKey,data:u}),e[4]=t.pageKey,e[5]=n,e[6]=o):o=e[6];let c;return e[7]!==t||e[8]!==o?(c=m.jsx(ke,{...t,onSave:o}),e[7]=t,e[8]=o,e[9]=c):c=e[9],c}var Ce=Object.prototype.toString,j=Array.isArray||function(e){return Ce.call(e)==="[object Array]"};function q(s){return typeof s=="function"}function De(s){return j(s)?"array":typeof s}function U(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function Se(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var Pe=RegExp.prototype.test;function je(s,e){return Pe.call(s,e)}var be=/\S/;function Te(s){return!je(be,s)}var Re={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Ke(s){return String(s).replace(/[&<>"'`=\/]/g,function(r){return Re[r]})}var Je=/\s*/,Ne=/\s+/,Q=/\s*=/,Ue=/\s*\}/,qe=/#|\^|\/|>|\{|&|=|!/;function Oe(s,e){if(!s)return[];var r=!1,t=[],a=[],n=[],o=!1,c=!1,u="",p=0;function d(){if(o&&!c)for(;n.length;)delete a[n.pop()];else n=[];o=!1,c=!1}var y,x,C;function S(D){if(typeof D=="string"&&(D=D.split(Ne,2)),!j(D)||D.length!==2)throw new Error("Invalid tags: "+D);y=new RegExp(U(D[0])+"\\s*"),x=new RegExp("\\s*"+U(D[1])),C=new RegExp("\\s*"+U("}"+D[1]))}S(e||k.tags);for(var i=new R(s),f,l,h,v,E,w;!i.eos();){if(f=i.pos,h=i.scanUntil(y),h)for(var b=0,F=h.length;b<F;++b)v=h.charAt(b),Te(v)?(n.push(a.length),u+=v):(c=!0,r=!0,u+=" "),a.push(["text",v,f,f+1]),f+=1,v===`
2
2
  `&&(d(),u="",p=0,r=!1);if(!i.scan(y))break;if(o=!0,l=i.scan(qe)||"name",i.scan(Je),l==="="?(h=i.scanUntil(Q),i.scan(Q),i.scanUntil(x)):l==="{"?(h=i.scanUntil(C),i.scan(Ue),i.scanUntil(x),l="&"):h=i.scanUntil(x),!i.scan(x))throw new Error("Unclosed tag at "+i.pos);if(l==">"?E=[l,h,f,i.pos,u,p,r]:E=[l,h,f,i.pos],p++,a.push(E),l==="#"||l==="^")t.push(E);else if(l==="/"){if(w=t.pop(),!w)throw new Error('Unopened section "'+h+'" at '+f);if(w[1]!==h)throw new Error('Unclosed section "'+w[1]+'" at '+f)}else l==="name"||l==="{"||l==="&"?c=!0:l==="="&&S(h)}if(d(),w=t.pop(),w)throw new Error('Unclosed section "'+w[1]+'" at '+i.pos);return Qe(Ae(a))}function Ae(s){for(var e=[],r,t,a=0,n=s.length;a<n;++a)r=s[a],r&&(r[0]==="text"&&t&&t[0]==="text"?(t[1]+=r[1],t[3]=r[3]):(e.push(r),t=r));return e}function Qe(s){for(var e=[],r=e,t=[],a,n,o=0,c=s.length;o<c;++o)switch(a=s[o],a[0]){case"#":case"^":r.push(a),t.push(a),r=a[4]=[];break;case"/":n=t.pop(),n[5]=a[2],r=t.length>0?t[t.length-1][4]:e;break;default:r.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 r=this.tail.match(e);if(!r||r.index!==0)return"";var t=r[0];return this.tail=this.tail.substring(t.length),this.pos+=t.length,t};R.prototype.scanUntil=function(e){var r=this.tail.search(e),t;switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t};function P(s,e){this.view=s,this.cache={".":this.view},this.parent=e}P.prototype.push=function(e){return new P(e,this)};P.prototype.lookup=function(e){var r=this.cache,t;if(r.hasOwnProperty(e))t=r[e];else{for(var a=this,n,o,c,u=!1;a;){if(e.indexOf(".")>0)for(n=a.view,o=e.split("."),c=0;n!=null&&c<o.length;)c===o.length-1&&(u=A(n,o[c])||Se(n,o[c])),n=n[o[c++]];else n=a.view[e],u=A(a.view,e);if(u){t=n;break}a=a.parent}r[e]=t}return q(t)&&(t=t.call(this.view)),t};function g(){this.templateCache={_cache:{},set:function(e,r){this._cache[e]=r},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}g.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};g.prototype.parse=function(e,r){var t=this.templateCache,a=e+":"+(r||k.tags).join(":"),n=typeof t<"u",o=n?t.get(a):void 0;return o==null&&(o=Oe(e,r),n&&t.set(a,o)),o};g.prototype.render=function(e,r,t,a){var n=this.getConfigTags(a),o=this.parse(e,n),c=r instanceof P?r:new P(r,void 0);return this.renderTokens(o,c,t,e,a)};g.prototype.renderTokens=function(e,r,t,a,n){for(var o="",c,u,p,d=0,y=e.length;d<y;++d)p=void 0,c=e[d],u=c[0],u==="#"?p=this.renderSection(c,r,t,a,n):u==="^"?p=this.renderInverted(c,r,t,a,n):u===">"?p=this.renderPartial(c,r,t,n):u==="&"?p=this.unescapedValue(c,r):u==="name"?p=this.escapedValue(c,r,n):u==="text"&&(p=this.rawValue(c)),p!==void 0&&(o+=p);return o};g.prototype.renderSection=function(e,r,t,a,n){var o=this,c="",u=r.lookup(e[1]);function p(x){return o.render(x,r,t,n)}if(u){if(j(u))for(var d=0,y=u.length;d<y;++d)c+=this.renderTokens(e[4],r.push(u[d]),t,a,n);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")c+=this.renderTokens(e[4],r.push(u),t,a,n);else if(q(u)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(r.view,a.slice(e[3],e[5]),p),u!=null&&(c+=u)}else c+=this.renderTokens(e[4],r,t,a,n);return c}};g.prototype.renderInverted=function(e,r,t,a,n){var o=r.lookup(e[1]);if(!o||j(o)&&o.length===0)return this.renderTokens(e[4],r,t,a,n)};g.prototype.indentPartial=function(e,r,t){for(var a=r.replace(/[^ \t]/g,""),n=e.split(`
3
3
  `),o=0;o<n.length;o++)n[o].length&&(o>0||!t)&&(n[o]=a+n[o]);return n.join(`
4
4
  `)};g.prototype.renderPartial=function(e,r,t,a){if(t){var n=this.getConfigTags(a),o=q(t)?t(e[1]):t[e[1]];if(o!=null){var c=e[6],u=e[5],p=e[4],d=o;u==0&&p&&(d=this.indentPartial(o,p,c));var y=this.parse(d,n);return this.renderTokens(y,r,t,d,a)}}};g.prototype.unescapedValue=function(e,r){var t=r.lookup(e[1]);if(t!=null)return t};g.prototype.escapedValue=function(e,r,t){var a=this.getConfigEscape(t)||k.escape,n=r.lookup(e[1]);if(n!=null)return typeof n=="number"&&a===k.escape?String(n):a(n)};g.prototype.rawValue=function(e){return e[1]};g.prototype.getConfigTags=function(e){return j(e)?e:e&&typeof e=="object"?e.tags:void 0};g.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!j(e))return e.escape};var k={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){T.templateCache=s},get templateCache(){return T.templateCache}},T=new g;k.clearCache=function(){return T.clearCache()};k.parse=function(e,r){return T.parse(e,r)};k.render=function(e,r,t,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+De(e)+'" was given as the first argument for mustache#render(template, view, partials)');return T.render(e,r,t,a)};k.escape=Ke;k.Scanner=R;k.Context=P;k.Writer=g;export{ke as P,Ie as S,k as m,_e as u};
@@ -1 +1 @@
1
- import{ap as h,aq as B,ar as R,ai as E,am as V,g as C,p as O,ab as x,w as A,N as P,d as j}from"./parse-sections-DyZjWLD2.js";function W(e,n){const t=n.pages===1?e("sectionsEditor.namedRuleUses.countPageOne"):n.pages>1?e("sectionsEditor.namedRuleUses.countPages",{count:String(n.pages)}):null,o=n.sections===1?e("sectionsEditor.namedRuleUses.countSectionOne"):n.sections>1?e("sectionsEditor.namedRuleUses.countSections",{count:String(n.sections)}):null,s=t&&o?e("sectionsEditor.namedRuleUses.countBoth",{pages:t,sections:o}):t??o;return s?{places:s,one:n.pages+n.sections===1}:null}const v=()=>({weak:new WeakMap,strong:new Map,has:!1}),k=new Map;function d(e,n,t){let o=k.get(e)??v();k.set(e,o);for(const s of n){const i=typeof s=="object"&&s!==null||typeof s=="function";let a=i?o.weak.get(s):o.strong.get(s);a||(a=v(),i?o.weak.set(s,a):o.strong.set(s,a)),o=a}return o.has||(o.value=t(),o.has=!0),o.value}function D(e){return d("uses",[e.decofile,e.meta,e.changeCount,e.sides],()=>L(e))}function L(e){const n=h(e.decofile,e.meta),t=e.changeCount===0?e.decofile:e.sides?B(e.decofile,e.sides):null;if(t===null)return{refs:R(n,n),published:null};const o=t===e.decofile?n:h(t,e.meta);return{refs:R(n,o),published:t}}const F=e=>e.length===0||e.length===1&&e[0]==="section";function _(e){const n=e[0]==="section"?e.slice(1):e;return n[0]==="variants"&&typeof n[1]=="number"?n[1]:void 0}function w(e,n){return n&&F(e)?n.index:_(e)}function z(e,n,t){if(e==="section"){const f=w(t?.containerPath??n,t);return f===void 0?{}:{variant:f}}const o=t?.containerPath??n;if(o[0]!=="sections")return{};if(t&&o.length===1)return{pageVariant:t.index};let s=o.slice(1),i;s[0]==="variants"&&typeof s[1]=="number"&&(i=s[1],s=s.slice(2),s[0]==="value"&&(s=s.slice(1)),s[0]==="value"&&(s=s.slice(1)));const a=i===void 0?{}:{pageVariant:i},[c,...u]=s;if(typeof c!="number")return a;a.section=c;const r=w(u,t);return r!==void 0&&(a.variant=r),a}function I(e,n,t,o,s){const i=r=>U(r,e,o,s),a=[],c=new Set,u=r=>{const f=y(r);c.has(f)||(c.add(f),a.push(r))};if(t===null){for(const r of e.refs[n].wholeBlock)u({blockKey:r.blockKey,...i(r.blockKey),wholeBlock:!0,state:r.state});return g(a)}for(const r of e.refs[n].byName.get(t)??[]){if(r.savedRule)continue;const f=i(r.blockKey),l=z(f.blockKind,r.path,r.variant),b=f.blockKind==="page"?q(r.blockKey,l,r.state,e,o):void 0;u({blockKey:r.blockKey,...f,...r.variant?{variant:r.variant.index+1}:{},...b?{section:b}:{},focus:l,wholeBlock:!1,state:r.state})}return g(a)}function y(e){const n=e.focus??{};return[e.blockKey,n.pageVariant??"",n.section??"",e.variant??"",e.wholeBlock].join("#")}function q(e,n,t,o,s){if(n.section===void 0)return;const i=t!=="removed-in-draft"&&e in s?s:o.published??s,a=C(i,e,n.pageVariant??0),c=O(a,i,!0)[n.section];return c?c.variantOf??c.label:void 0}function U(e,n,t,o){const s=t[e]??(n.published?n.published[e]:void 0),i=x(e,s,o);if(i)return{blockKind:"page",title:i.name,path:i.path};const a=s&&typeof s=="object"&&!Array.isArray(s)?s:{};return{blockKind:"section",title:A(H(e),a)}}function g(e){const n=t=>t.state==="removed-in-draft"?1:0;return e.sort((t,o)=>n(t)-n(o)||t.title.localeCompare(o.title)||(t.focus?.pageVariant??0)-(o.focus?.pageVariant??0)||(t.focus?.section??0)-(o.focus?.section??0)||(t.variant??0)-(o.variant??0))}function m(e,n,t){return d("missing",[e,t,n],()=>{const o=E(t,n);if(o.kind==="conflict")return[];const s=[];for(const[i,a]of e.refs[n].byName)V(o,i)||a.some(c=>c.state!=="removed-in-draft")&&s.push(i);return s})}function G(e,n,t,o){return K(e,n,t,o).rows}function J(e,n,t,o){return K(e,n,t,o).names}function K(e,n,t,o){return d("missingRows",[e,t,o,n],()=>{const s=[],i=new Set;let a=0;for(const c of m(e,n,t)){let u=!1;for(const r of I(e,n,c,t,o)){if(r.state==="removed-in-draft")continue;u=!0;const f=y(r);i.has(f)||(i.add(f),s.push(r))}u&&a++}return{rows:g(s),names:a}})}function N(e){return P.filter(n=>j(e,n)==="available")}function p(e,n){return D({decofile:e,meta:n,changeCount:0,sides:void 0})}function Q(e,n){return d("blocksUsingMissing",[e,n],()=>{const t=new Map,o=N(n);if(o.length===0)return t;const s=p(e,n);for(const i of o)for(const a of m(s,i,e))for(const c of s.refs[i].byName.get(a)??[]){const u=t.get(c.blockKey)??[];u.includes(i)||u.push(i),t.set(c.blockKey,u)}return t})}function X(e,n){return d("missingUseCounts",[e,n],()=>{const t=new Map,o=N(n);if(o.length===0)return t;const s=p(e,n);for(const i of o){const a=new Set;let c=0;for(const r of m(s,i,e)){let f=!1;for(const l of s.refs[i].byName.get(r)??[])l.savedRule||(a.add(l.blockKey),f=!0);f&&c++}const u=M(a,s,e,n);u.pages+u.sections>0&&t.set(i,{...u,names:c})}return t})}function Y(e,n,t){return S(e,n,t).size}function Z(e,n,t,o){const s=p(e,n);return M(S(s,t,o),s,e,n)}function S(e,n,t){const o=new Set;for(const s of e.refs[n].byName.get(t)??[])s.savedRule||s.state==="removed-in-draft"||o.add(s.blockKey);return o}function M(e,n,t,o){const s={pages:0,sections:0};for(const i of e)U(i,n,t,o).blockKind==="page"?s.pages++:s.sections++;return s}function H(e){try{return decodeURIComponent(e)}catch{return e}}export{y as a,Q as b,Z as c,D as d,G as e,J as f,I as g,Y as h,X as m,W as n};
1
+ import{ap as h,aq as B,ar as R,ai as E,am as V,g as C,p as O,ab as x,w as A,N as P,d as j}from"./parse-sections-Cr8-2nO_.js";function W(e,n){const t=n.pages===1?e("sectionsEditor.namedRuleUses.countPageOne"):n.pages>1?e("sectionsEditor.namedRuleUses.countPages",{count:String(n.pages)}):null,o=n.sections===1?e("sectionsEditor.namedRuleUses.countSectionOne"):n.sections>1?e("sectionsEditor.namedRuleUses.countSections",{count:String(n.sections)}):null,s=t&&o?e("sectionsEditor.namedRuleUses.countBoth",{pages:t,sections:o}):t??o;return s?{places:s,one:n.pages+n.sections===1}:null}const v=()=>({weak:new WeakMap,strong:new Map,has:!1}),k=new Map;function d(e,n,t){let o=k.get(e)??v();k.set(e,o);for(const s of n){const i=typeof s=="object"&&s!==null||typeof s=="function";let a=i?o.weak.get(s):o.strong.get(s);a||(a=v(),i?o.weak.set(s,a):o.strong.set(s,a)),o=a}return o.has||(o.value=t(),o.has=!0),o.value}function D(e){return d("uses",[e.decofile,e.meta,e.changeCount,e.sides],()=>L(e))}function L(e){const n=h(e.decofile,e.meta),t=e.changeCount===0?e.decofile:e.sides?B(e.decofile,e.sides):null;if(t===null)return{refs:R(n,n),published:null};const o=t===e.decofile?n:h(t,e.meta);return{refs:R(n,o),published:t}}const F=e=>e.length===0||e.length===1&&e[0]==="section";function _(e){const n=e[0]==="section"?e.slice(1):e;return n[0]==="variants"&&typeof n[1]=="number"?n[1]:void 0}function w(e,n){return n&&F(e)?n.index:_(e)}function z(e,n,t){if(e==="section"){const f=w(t?.containerPath??n,t);return f===void 0?{}:{variant:f}}const o=t?.containerPath??n;if(o[0]!=="sections")return{};if(t&&o.length===1)return{pageVariant:t.index};let s=o.slice(1),i;s[0]==="variants"&&typeof s[1]=="number"&&(i=s[1],s=s.slice(2),s[0]==="value"&&(s=s.slice(1)),s[0]==="value"&&(s=s.slice(1)));const a=i===void 0?{}:{pageVariant:i},[c,...u]=s;if(typeof c!="number")return a;a.section=c;const r=w(u,t);return r!==void 0&&(a.variant=r),a}function I(e,n,t,o,s){const i=r=>U(r,e,o,s),a=[],c=new Set,u=r=>{const f=y(r);c.has(f)||(c.add(f),a.push(r))};if(t===null){for(const r of e.refs[n].wholeBlock)u({blockKey:r.blockKey,...i(r.blockKey),wholeBlock:!0,state:r.state});return g(a)}for(const r of e.refs[n].byName.get(t)??[]){if(r.savedRule)continue;const f=i(r.blockKey),l=z(f.blockKind,r.path,r.variant),b=f.blockKind==="page"?q(r.blockKey,l,r.state,e,o):void 0;u({blockKey:r.blockKey,...f,...r.variant?{variant:r.variant.index+1}:{},...b?{section:b}:{},focus:l,wholeBlock:!1,state:r.state})}return g(a)}function y(e){const n=e.focus??{};return[e.blockKey,n.pageVariant??"",n.section??"",e.variant??"",e.wholeBlock].join("#")}function q(e,n,t,o,s){if(n.section===void 0)return;const i=t!=="removed-in-draft"&&e in s?s:o.published??s,a=C(i,e,n.pageVariant??0),c=O(a,i,!0)[n.section];return c?c.variantOf??c.label:void 0}function U(e,n,t,o){const s=t[e]??(n.published?n.published[e]:void 0),i=x(e,s,o);if(i)return{blockKind:"page",title:i.name,path:i.path};const a=s&&typeof s=="object"&&!Array.isArray(s)?s:{};return{blockKind:"section",title:A(H(e),a)}}function g(e){const n=t=>t.state==="removed-in-draft"?1:0;return e.sort((t,o)=>n(t)-n(o)||t.title.localeCompare(o.title)||(t.focus?.pageVariant??0)-(o.focus?.pageVariant??0)||(t.focus?.section??0)-(o.focus?.section??0)||(t.variant??0)-(o.variant??0))}function m(e,n,t){return d("missing",[e,t,n],()=>{const o=E(t,n);if(o.kind==="conflict")return[];const s=[];for(const[i,a]of e.refs[n].byName)V(o,i)||a.some(c=>c.state!=="removed-in-draft")&&s.push(i);return s})}function G(e,n,t,o){return K(e,n,t,o).rows}function J(e,n,t,o){return K(e,n,t,o).names}function K(e,n,t,o){return d("missingRows",[e,t,o,n],()=>{const s=[],i=new Set;let a=0;for(const c of m(e,n,t)){let u=!1;for(const r of I(e,n,c,t,o)){if(r.state==="removed-in-draft")continue;u=!0;const f=y(r);i.has(f)||(i.add(f),s.push(r))}u&&a++}return{rows:g(s),names:a}})}function N(e){return P.filter(n=>j(e,n)==="available")}function p(e,n){return D({decofile:e,meta:n,changeCount:0,sides:void 0})}function Q(e,n){return d("blocksUsingMissing",[e,n],()=>{const t=new Map,o=N(n);if(o.length===0)return t;const s=p(e,n);for(const i of o)for(const a of m(s,i,e))for(const c of s.refs[i].byName.get(a)??[]){const u=t.get(c.blockKey)??[];u.includes(i)||u.push(i),t.set(c.blockKey,u)}return t})}function X(e,n){return d("missingUseCounts",[e,n],()=>{const t=new Map,o=N(n);if(o.length===0)return t;const s=p(e,n);for(const i of o){const a=new Set;let c=0;for(const r of m(s,i,e)){let f=!1;for(const l of s.refs[i].byName.get(r)??[])l.savedRule||(a.add(l.blockKey),f=!0);f&&c++}const u=M(a,s,e,n);u.pages+u.sections>0&&t.set(i,{...u,names:c})}return t})}function Y(e,n,t){return S(e,n,t).size}function Z(e,n,t,o){const s=p(e,n);return M(S(s,t,o),s,e,n)}function S(e,n,t){const o=new Set;for(const s of e.refs[n].byName.get(t)??[])s.savedRule||s.state==="removed-in-draft"||o.add(s.blockKey);return o}function M(e,n,t,o){const s={pages:0,sections:0};for(const i of e)U(i,n,t,o).blockKind==="page"?s.pages++:s.sections++;return s}function H(e){try{return decodeURIComponent(e)}catch{return e}}export{y as a,Q as b,Z as c,D as d,G as e,J as f,I as g,Y as h,X as m,W as n};
@@ -1 +1 @@
1
- import{c as y,j as t,r as w,C as _,b as S,B as N,D as M,v as K,w as A,x as R,aY as E,I as T,l as V,t as $}from"./index-CgoVr5FU.js";import{i as B}from"./ArrowLeft-BHp0lrDo.js";import{s as F}from"./Plus-DG02QDBi.js";import{L as H}from"./label-jeO06QJJ.js";import{R as L}from"./repository-import-picker-Bmg3pctI.js";import{u as O}from"./use-navigate-to-agent-Dblb0Cto.js";import{S as z}from"./thread-intent-D86mGBmJ.js";import{d as Z}from"./repository-binding-BplOK1-K.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 I(a){const e=y.c(9),{className:n}=a;let r,o,s,c,i,x,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}),x=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]=x,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],i=e[4],x=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,i,x,h]}),e[7]=n,e[8]=d):d=e[8],d}function q(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:I,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:q,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},Y=["repository","folder"];function G(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 x;e[3]!==c?(x=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=x):x=e[4];let h;e[5]!==i||e[6]!==x?(h=t.jsx("span",{className:i,children:x}),e[5]=i,e[6]=x,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 u;e[11]!==d?(u=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=u):u=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]!==u||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[u,j]}),e[18]=u,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 surface p-3 text-left focus-ring transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent 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 J(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),[x,h]=w.useState(""),[d,u]=w.useState(null),f=w.useRef(null),j=()=>{i(null),h(""),u(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=x.trim();if(!p){u(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{u(r("projects.new.failed"))}};return t.jsx(M,{open:a,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(K,{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:Y.map(p=>t.jsx(G,{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(),u(null),g()},children:[t.jsx(J,{label:r("projects.new.nameLabel"),children:t.jsx(T,{autoFocus:!0,value:x,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,x=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 u;e[3]!==s||e[4]!==x?(u=s??x("projects.home.newProject"),e[3]=s,e[4]=x,e[5]=u):u=e[5];let f;return e[6]!==i||e[7]!==h||e[8]!==u||e[9]!==c?(f=t.jsxs(N,{size:i,variant:c,onClick:h,children:[d,u]}),e[6]=i,e[7]=h,e[8]=u,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,C as _,b as S,B as N,D as M,v as K,w as A,x as R,aY as E,I as T,l as V,t as $}from"./index-BXY_6H_h.js";import{i as B}from"./ArrowLeft-ClEFP1xI.js";import{s as F}from"./Plus-DqXRu9xd.js";import{L as H}from"./label-BrtgLUsN.js";import{R as L}from"./repository-import-picker-J0VT1RHB.js";import{u as O}from"./use-navigate-to-agent-BDvRam4x.js";import{S as z}from"./thread-intent-wJOYAcPq.js";import{d as Z}from"./repository-binding-BFGepSEK.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 I(a){const e=y.c(9),{className:n}=a;let r,o,s,c,i,x,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}),x=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]=x,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],i=e[4],x=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,i,x,h]}),e[7]=n,e[8]=d):d=e[8],d}function q(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:I,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:q,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},Y=["repository","folder"];function G(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 x;e[3]!==c?(x=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=x):x=e[4];let h;e[5]!==i||e[6]!==x?(h=t.jsx("span",{className:i,children:x}),e[5]=i,e[6]=x,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 u;e[11]!==d?(u=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=u):u=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]!==u||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[u,j]}),e[18]=u,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 surface p-3 text-left focus-ring transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent 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 J(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),[x,h]=w.useState(""),[d,u]=w.useState(null),f=w.useRef(null),j=()=>{i(null),h(""),u(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=x.trim();if(!p){u(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{u(r("projects.new.failed"))}};return t.jsx(M,{open:a,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(K,{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:Y.map(p=>t.jsx(G,{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(),u(null),g()},children:[t.jsx(J,{label:r("projects.new.nameLabel"),children:t.jsx(T,{autoFocus:!0,value:x,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,x=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 u;e[3]!==s||e[4]!==x?(u=s??x("projects.home.newProject"),e[3]=s,e[4]=x,e[5]=u):u=e[5];let f;return e[6]!==i||e[7]!==h||e[8]!==u||e[9]!==c?(f=t.jsxs(N,{size:i,variant:c,onClick:h,children:[d,u]}),e[6]=i,e[7]=h,e[8]=u,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-CgoVr5FU.js";import{h as u}from"./mcp-oauth-DrNngSc4.js";import"./auth-DOw8QO5X.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-BXY_6H_h.js";import{h as u}from"./mcp-oauth-6YGp-ztf.js";import"./auth-DZi3j0cg.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-CgoVr5FU.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-BXY_6H_h.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,o as ve,z as ze,I as Le,l as ae,t as he}from"./index-CgoVr5FU.js";import{R as _e}from"./required-auth-layout-BJBxNe59.js";import{A as oe}from"./auth-split-layout-D7LOmPac.js";import{O as Ee}from"./organization-choice-DmKVV6Be.js";import{L as Ae}from"./label-jeO06QJJ.js";import{S as De}from"./switch-DxUvK2ws.js";import{t as Pe}from"./Building02-teHH5338.js";import{i as Re}from"./CheckCircle-D6Wz8hBJ.js";import{t as Fe}from"./Globe04-Ck3KSFRr.js";import{i as Me}from"./Upload01-CQGS-8-D.js";import"./Plus-DG02QDBi.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 it(){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:o}=i;let a;e[0]!==o||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:o??"?",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]=o,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 l;e[5]!==m?(l=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=l):l=e[6];let s;e[7]!==f||e[8]!==l?(s=t.jsxs("div",{className:"space-y-2",children:[f,l]}),e[7]=f,e[8]=l,e[9]=s):s=e[9];let j;return e[10]!==a||e[11]!==s?(j=t.jsxs("div",{className:"grid gap-10",children:[a,s]}),e[10]=a,e[11]=s,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(oe,{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 o;return i[1]!==n||i[2]!==m?(o=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=o):o=i[3],o}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),o=b.split("@")[1]?.toLowerCase()??"",a=!!o&&!$e.has(o),f=o.split(".")[0]??"",l=f.charAt(0).toUpperCase()+f.slice(1);let s;e[0]!==l||e[1]!==a||e[2]!==m?(s=a?l:m?.split(" ")[0]??"",e[0]=l,e[1]=a,e[2]=m,e[3]=s):s=e[3];const j=s,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(o),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 r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=r):r=e[5],t.jsx(oe,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[r,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:o})})]})})}if(u){let r;e[6]!==w?(r=()=>w(),e[6]=w,e[7]=r):r=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]!==r||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:d}),e[10]=r,e[11]=d,e[12]=h):h=e[12],t.jsx(oe,{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:o})}),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 r;e[16]!==m?(r=m?.split(" ")[0]??"",e[16]=m,e[17]=r):r=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==l||e[21]!==o||e[22]!==a||e[23]!==r||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:r,allowDomainClaim:!1,onBack:d}),e[20]=l,e[21]=o,e[22]=a,e[23]=r,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let r;e[26]!==p||e[27]!==N.length||e[28]!==n?(r=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]=r):r=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]!==r||e[34]!==d?(h=t.jsx(fe,{title:r,description:d}),e[33]=r,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]!==o||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:o,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=o,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(oe,{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]!==l||e[56]!==o||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:j}),e[54]=j,e[55]=l,e[56]=o,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:o,allowDomainClaim:a,onBack:f}=i,l=a===void 0?!0:a,s=de(),j=b&&l?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(o),[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 r=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(oe,{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=r.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||r.error||null;let z;e[22]!==l||e[23]!==O||e[24]!==r||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&l?p.mutate():r.mutate())},e[22]=l,e[23]=O,e[24]=r,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==s?(k=s("routes.onboarding.welcomeTitle"),e[28]=s,e[29]=k):k=e[29];let L;e[30]!==s?(L=s("routes.onboarding.setupDescription"),e[30]=s,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]!==s?(F=s("routes.onboarding.orgAvatar"),e[35]=s,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]!==s?(q=s("routes.onboarding.optional"),e[39]=s,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]!==o||e[47]!==c?(K=(c.trim()||o||"?").charAt(0).toUpperCase(),e[46]=o,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]!==s?(G=s("routes.onboarding.orgName"),e[56]=s,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 le;e[60]===Symbol.for("react.memo_cache_sentinel")?(le=x=>v(x.target.value),e[60]=le):le=e[60];let H;e[61]!==o||e[62]!==s?(H=o||s("routes.onboarding.myOrganizationPlaceholder"),e[61]=o,e[62]=s,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:le,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]!==l||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==s?(V=b&&l&&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:s("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=l,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=s,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"surface 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]!==s?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:s("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=s,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==s?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",s("routes.onboarding.creating")]}):s("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=s,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 se;e[93]!==f||e[94]!==s?(se=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:s("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=s,e[95]=se):se=e[95];let re;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==se?(re=t.jsx(oe,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,se]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=se,e[102]=re):re=e[102],re}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:o}=i,a=de(),f=P.useRef(null);let l;e[0]!==n||e[1]!==a?(l=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]=l):l=e[2];const s=l;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]!==o||e[7]!==s?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),e[6]=o,e[7]=s,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]!==o||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:o,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]=o,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(),o=we.filter(s=>b||!s.claimOnly),[a,f]=P.useState(0),l=P.useRef(!1);if(!l.current){l.current=!0;for(let s=1;s<o.length;s++)setTimeout(()=>f(s),Se*s)}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:o.map((s,j)=>{const c=s.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(s.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})]},s.labelKey)})})]})}export{it 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,o as ve,z as ze,I as Le,l as ae,t as he}from"./index-BXY_6H_h.js";import{R as _e}from"./required-auth-layout-CSoEKOsv.js";import{A as oe}from"./auth-split-layout-DgUSBQ_P.js";import{O as Ee}from"./organization-choice-Bb26ahbZ.js";import{L as Ae}from"./label-BrtgLUsN.js";import{S as De}from"./switch-BWycdCa8.js";import{t as Pe}from"./Building02-65KgwQ5O.js";import{i as Re}from"./CheckCircle-CkMlHbcx.js";import{t as Fe}from"./Globe04-DLvpciMY.js";import{i as Me}from"./Upload01-IuP9sE7L.js";import"./Plus-DqXRu9xd.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 it(){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:o}=i;let a;e[0]!==o||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:o??"?",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]=o,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 l;e[5]!==m?(l=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=l):l=e[6];let s;e[7]!==f||e[8]!==l?(s=t.jsxs("div",{className:"space-y-2",children:[f,l]}),e[7]=f,e[8]=l,e[9]=s):s=e[9];let j;return e[10]!==a||e[11]!==s?(j=t.jsxs("div",{className:"grid gap-10",children:[a,s]}),e[10]=a,e[11]=s,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(oe,{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 o;return i[1]!==n||i[2]!==m?(o=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=o):o=i[3],o}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),o=b.split("@")[1]?.toLowerCase()??"",a=!!o&&!$e.has(o),f=o.split(".")[0]??"",l=f.charAt(0).toUpperCase()+f.slice(1);let s;e[0]!==l||e[1]!==a||e[2]!==m?(s=a?l:m?.split(" ")[0]??"",e[0]=l,e[1]=a,e[2]=m,e[3]=s):s=e[3];const j=s,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(o),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 r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=r):r=e[5],t.jsx(oe,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[r,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:o})})]})})}if(u){let r;e[6]!==w?(r=()=>w(),e[6]=w,e[7]=r):r=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]!==r||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:d}),e[10]=r,e[11]=d,e[12]=h):h=e[12],t.jsx(oe,{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:o})}),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 r;e[16]!==m?(r=m?.split(" ")[0]??"",e[16]=m,e[17]=r):r=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==l||e[21]!==o||e[22]!==a||e[23]!==r||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:r,allowDomainClaim:!1,onBack:d}),e[20]=l,e[21]=o,e[22]=a,e[23]=r,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let r;e[26]!==p||e[27]!==N.length||e[28]!==n?(r=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]=r):r=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]!==r||e[34]!==d?(h=t.jsx(fe,{title:r,description:d}),e[33]=r,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]!==o||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:o,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=o,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(oe,{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]!==l||e[56]!==o||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:j}),e[54]=j,e[55]=l,e[56]=o,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:o,allowDomainClaim:a,onBack:f}=i,l=a===void 0?!0:a,s=de(),j=b&&l?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(o),[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 r=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(oe,{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=r.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||r.error||null;let z;e[22]!==l||e[23]!==O||e[24]!==r||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&l?p.mutate():r.mutate())},e[22]=l,e[23]=O,e[24]=r,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==s?(k=s("routes.onboarding.welcomeTitle"),e[28]=s,e[29]=k):k=e[29];let L;e[30]!==s?(L=s("routes.onboarding.setupDescription"),e[30]=s,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]!==s?(F=s("routes.onboarding.orgAvatar"),e[35]=s,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]!==s?(q=s("routes.onboarding.optional"),e[39]=s,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]!==o||e[47]!==c?(K=(c.trim()||o||"?").charAt(0).toUpperCase(),e[46]=o,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]!==s?(G=s("routes.onboarding.orgName"),e[56]=s,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 le;e[60]===Symbol.for("react.memo_cache_sentinel")?(le=x=>v(x.target.value),e[60]=le):le=e[60];let H;e[61]!==o||e[62]!==s?(H=o||s("routes.onboarding.myOrganizationPlaceholder"),e[61]=o,e[62]=s,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:le,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]!==l||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==s?(V=b&&l&&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:s("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=l,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=s,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"surface 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]!==s?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:s("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=s,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==s?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",s("routes.onboarding.creating")]}):s("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=s,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 se;e[93]!==f||e[94]!==s?(se=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:s("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=s,e[95]=se):se=e[95];let re;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==se?(re=t.jsx(oe,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,se]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=se,e[102]=re):re=e[102],re}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:o}=i,a=de(),f=P.useRef(null);let l;e[0]!==n||e[1]!==a?(l=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]=l):l=e[2];const s=l;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]!==o||e[7]!==s?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),e[6]=o,e[7]=s,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]!==o||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:o,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]=o,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(),o=we.filter(s=>b||!s.claimOnly),[a,f]=P.useState(0),l=P.useRef(!1);if(!l.current){l.current=!0;for(let s=1;s<o.length;s++)setTimeout(()=>f(s),Se*s)}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:o.map((s,j)=>{const c=s.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(s.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})]},s.labelKey)})})]})}export{it as default};
@@ -1,3 +1,3 @@
1
- import{e as J,f as B}from"./input-4Z-Xhhp5.js";import{aK as A,aL as _,e1 as C,b9 as U,cT as W}from"./index-CgoVr5FU.js";import"./usage-stats-Bqr7SMsL.js";import"./tool-namespace-BQqkHHN2.js";import"./form-C0PLsmZN.js";import"./label-jeO06QJJ.js";import"./utils-CVEq3hMx.js";import"./markdown-Di4RSa-U.js";import"./use-copy-BZAAMFHh.js";import"./Copy01-D43IjSFC.js";import"./ZoomOut-CcGzW8aR.js";import"./location-V0VwTJTt.js";import"./use-mobile-qeR1f008.js";import"./use-panel-navigate-C8PahcNc.js";import"./thread-route-VP5yBC1h.js";import"./use-project-scope-BG9bvSWW.js";import"./repository-binding-BplOK1-K.js";import"./use-mcp-client-VUKdisv5.js";import"./auth-DOw8QO5X.js";import"./tooltip-BH7O8U6v.js";import"./index-DfPyt5Mf.js";import"./agent-icon-C4FWcm9G.js";import"./AlertCircle-BmO4vJOs.js";import"./Tool01-DQHTbTAt.js";import"./ArrowUp-C1ze1lYw.js";import"./ArrowLeft-BHp0lrDo.js";import"./LinkBroken01-CSj4NG1x.js";import"./ShoppingBag01-D_7hYKx-.js";import"./Building02-teHH5338.js";import"./CheckCircle-D6Wz8hBJ.js";import"./ChevronUp-bjIxVrad.js";import"./ChevronSelectorVertical-BKCUuYcV.js";import"./UserSquare-C8hqvKpv.js";import"./CreditCard01-LJ-ICys1.js";import"./DotsVertical-GwsdgrHI.js";import"./Image01-D7ZR2IUl.js";import"./Globe04-Ck3KSFRr.js";import"./SwitchHorizontal01-CQ6d0kLW.js";import"./Key01-iL0AmDpL.js";import"./Link01-BAmaaqXS.js";import"./Minus-eyAF4BHe.js";import"./Monitor01-OJKXayAq.js";import"./Sun-DlgvbI-T.js";import"./Play-CYJOslRi.js";import"./Plus-DG02QDBi.js";import"./SearchMd-eQGP3B2l.js";import"./Trash01-DgFWjzpO.js";import"./Upload01-CQGS-8-D.js";import"./Users01-B7liCLQJ.js";import"./XClose-BukpW4Ul.js";import"./use-decopilot-events-DPOGE308.js";import"./thread-intent-D86mGBmJ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-Cb-96kB9.js";import"./task-board-BjErhxiY.js";import"./schema-DDJ9bxPz.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-CgGENb-d.js";import"./autosend-BWrEWq5K.js";import"./use-ai-providers-DcdjcNWk.js";import"./use-organization-settings-BoplTvFL.js";import"./icon-button-Bb7FrbdB.js";import"./file-type-icon-DeVQ158v.js";import"./chat-draft-DCY2vv5f.js";import"./use-session-runtime-BLaBf_XS.js";import"./select-C2h8JGxf.js";import"./index-BdQq_4o_.js";import"./tabs-BPCzIThV.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-UDy9oVyz.js";import"./toggle-group-cCLxdVS0.js";import"./index-Dp8Ois5q.js";import"./checkbox-Bo5LsWbi.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-C1CMw7Su.js";import"./drawer-CCDqJ6_5.js";import"./input-BmD6p00i.js";import"./suggestion-CXSvi_ya.js";import"./use-mcp-prompts-D5yuACkH.js";import"./use-org-fs-CrieTxin.js";import"./useInfiniteQuery-DrcPUg1U.js";import"./infiniteQueryObserver-BhT1X5Zv.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-B--yW66D.js";import"./plan-ladder-BwOXsQw4.js";import"./add-connection-dialog-Cz7D2aIE.js";import"./collection-search-C41cpRLf.js";import"./extract-connection-data-8An_UKh-.js";import"./metadata-D72DunRR.js";import"./connection-Cg1SIgkl.js";import"./url-slug-BJoByld1.js";import"./connection-card-Cm0DTsMN.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-CBXS4hsf.js";import"./textarea-FhDpbTid.js";import"./use-connection-BSVd6jY9.js";import"./schema-CQtNdMgc.js";import"./connection-form-helpers-ETShxpEs.js";import"./authenticate-and-persist-oauth-Db8PCXi_.js";import"./mcp-oauth-Dmaz5wHI.js";import"./mcp-oauth-DrNngSc4.js";import"./collection-tabs-DFF7SRdJ.js";import"./badge-iD6YraPr.js";import"./use-infinite-scroll-D9yHexy7.js";import"./useSuspenseInfiniteQuery-nHttoIU_.js";import"./use-task-board-events-DLSQcorr.js";import"./use-chat-layout-state-jWfDU2-f.js";class X{constructor(t,r=4e3){this.onDisconnect=t,this.graceMs=r}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 H=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:_(),delta:_(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),K=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:_(),target:C("client")})});class ${constructor(t,r){this.send=t,this.callbacks=r}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,r=Date.now()){if(this.closed)return;const n=H.safeParse(t);if(n.success){const e=n.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:r,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=K.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:r});return}const m=A({type:C("session.thinking.appended"),client_event_id:_()}).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:_()}).safeParse(t);p.success&&p.data.type==="error"&&this.callbacks.onError()}tick(t=Date.now()){if(!this.closed)for(const[r,n]of this.pending){const a=this.fragments.filter(o=>o.start<n.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,n.receivedAt);if(t-m<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-n.receivedAt<3e3)continue;if(this.pending.delete(r),this.delegated.add(r),!p.length){this.publishUpdate({delivery:"announce",delegationId:r,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:r,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:r,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:r,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:r,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 n=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
1
+ import{e as J,f as B}from"./input-CRJ_83xM.js";import{aK as A,aL as _,e1 as C,b9 as U,cT as W}from"./index-BXY_6H_h.js";import"./usage-stats-CGDtyshq.js";import"./tool-namespace-CBWoJZqr.js";import"./form-DBl_mUYK.js";import"./label-BrtgLUsN.js";import"./utils-CVEq3hMx.js";import"./markdown-DqY4DWVG.js";import"./use-copy-B5cLN_C5.js";import"./Copy01-DVjYf8UE.js";import"./ZoomOut-Bef8TDWN.js";import"./location-V0VwTJTt.js";import"./use-mobile-BUhaeAQH.js";import"./use-panel-navigate-LMuhBwrk.js";import"./thread-route-tjkZulPh.js";import"./use-project-scope-BtBHn9Jp.js";import"./repository-binding-BFGepSEK.js";import"./use-mcp-client-4s5eiJEh.js";import"./auth-DZi3j0cg.js";import"./tooltip-CrreJsgc.js";import"./index-L2VwHeGQ.js";import"./agent-icon-2PljfsLU.js";import"./AlertCircle-Cz6_P7ML.js";import"./Tool01-DutC7DUC.js";import"./ArrowUp-esZAPwX6.js";import"./ArrowLeft-ClEFP1xI.js";import"./LinkBroken01-CgZn_kgS.js";import"./ShoppingBag01-xLzaiz75.js";import"./Building02-65KgwQ5O.js";import"./CheckCircle-CkMlHbcx.js";import"./ChevronUp-Bq07Wt0S.js";import"./ChevronSelectorVertical-Dv0IPcS7.js";import"./UserSquare-C4Xd30fd.js";import"./CreditCard01-D1fzLODG.js";import"./DotsVertical-C7omsJ6V.js";import"./Image01-BK_sSf9r.js";import"./Globe04-DLvpciMY.js";import"./SwitchHorizontal01-Ceqgl_dL.js";import"./Key01-Dy4KHdYE.js";import"./Link01-ci2j_bPP.js";import"./Minus-BSI7d8_H.js";import"./Monitor01-QdcvoNmj.js";import"./Sun-DAC9yPz1.js";import"./Play-BGQYvkMd.js";import"./Plus-DqXRu9xd.js";import"./SearchMd-B1pNG3dp.js";import"./Trash01-DtErG8K9.js";import"./Upload01-IuP9sE7L.js";import"./Users01-CqmTsXbq.js";import"./XClose-3xLIDoWV.js";import"./use-decopilot-events-BCczItbx.js";import"./thread-intent-wJOYAcPq.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-Dkuv_IW6.js";import"./task-board-DYxtOOtW.js";import"./schema-BV496kYE.js";import"./slugify-CEUa2lfQ.js";import"./chat-context-5nWd2wfH.js";import"./autosend-qlZ4EwTo.js";import"./use-ai-providers-BQDbV1ZK.js";import"./use-organization-settings-R0q4iG4j.js";import"./icon-button-DOGOl3eR.js";import"./file-type-icon-CyX-UMTP.js";import"./chat-draft-DH4nBOgW.js";import"./use-session-runtime-B6BD0biY.js";import"./select-CEP6OVkE.js";import"./index-BdQq_4o_.js";import"./tabs-mxygGbsQ.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-D45hXPQg.js";import"./toggle-group-CFKXbFvG.js";import"./index-Di9dO1y1.js";import"./checkbox-CMW8RKoG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-DY18XQdw.js";import"./drawer-D1oOJWcT.js";import"./input-34_0AkPF.js";import"./suggestion-DE8y-b5q.js";import"./use-mcp-prompts-BtZsfmwR.js";import"./use-org-fs-fDwaJ0Sh.js";import"./useInfiniteQuery-BZM9p8aI.js";import"./infiniteQueryObserver-BFDbIOUX.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-CXZFZDnX.js";import"./plan-ladder-C_aFfTB3.js";import"./add-connection-dialog-IczVjs2u.js";import"./collection-search-DhTgl05U.js";import"./extract-connection-data-uNjXykZP.js";import"./metadata-D72DunRR.js";import"./connection-BHTKykig.js";import"./url-slug-Bd-dhz4h.js";import"./connection-card-CRrDkcyE.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-BcSLXSA3.js";import"./textarea-DSI3yrRQ.js";import"./use-connection-BB0LJu3a.js";import"./schema-DLMpcKaR.js";import"./connection-form-helpers-D24CXVn3.js";import"./authenticate-and-persist-oauth-Oq1cZuDP.js";import"./mcp-oauth-BKSmCj_9.js";import"./mcp-oauth-6YGp-ztf.js";import"./collection-tabs--HOz53qZ.js";import"./badge-DunYeylq.js";import"./use-infinite-scroll-CUJa5l30.js";import"./useSuspenseInfiniteQuery-DaqJKtQG.js";import"./use-task-board-events-UbAx3_td.js";import"./use-chat-layout-state-CMlb6hmW.js";class X{constructor(t,r=4e3){this.onDisconnect=t,this.graceMs=r}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 H=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:_(),delta:_(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),K=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:_(),target:C("client")})});class ${constructor(t,r){this.send=t,this.callbacks=r}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,r=Date.now()){if(this.closed)return;const n=H.safeParse(t);if(n.success){const e=n.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:r,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=K.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:r});return}const m=A({type:C("session.thinking.appended"),client_event_id:_()}).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:_()}).safeParse(t);p.success&&p.data.type==="error"&&this.callbacks.onError()}tick(t=Date.now()){if(!this.closed)for(const[r,n]of this.pending){const a=this.fragments.filter(o=>o.start<n.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,n.receivedAt);if(t-m<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-n.receivedAt<3e3)continue;if(this.pending.delete(r),this.delegated.add(r),!p.length){this.publishUpdate({delivery:"announce",delegationId:r,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:r,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:r,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:r,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:r,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 n=(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(n).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 n){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 Fe(E,t,r){r.throwIfAborted();const n=new RTCPeerConnection,a=n.createDataChannel("oai-events"),m=document.createElement("audio");m.autoplay=!0;let p,e,s,o,i=!1,v=!1,h,L,O=0,P=0,g,w,y=!1;const I=Promise.withResolvers(),x=Promise.withResolvers();x.promise.catch(()=>{});const b=new $(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(L),r.removeEventListener("abort",M),a.close(),n.close();for(const d of p?.getTracks()??[])d.stop();m.pause(),m.srcObject=null,e&&e.state!=="closed"&&await e.close().catch(()=>{})}},M=()=>{T()};r.addEventListener("abort",M,{once:!0});const u=AbortSignal.any([r,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()},n.onconnectionstatechange=()=>{i||q.report(n.connectionState)},n.ontrack=({streams:d,track:l})=>{if(i)return;const D=d[0]??new MediaStream([l]);m.srcObject=D,e??=new AudioContext,s=e.createAnalyser(),s.fftSize=256,o=new Uint8Array(s.fftSize),e.createMediaStreamSource(D).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())n.addTrack(c,l);const D=await n.createOffer();await n.setLocalDescription(D),u.throwIfAborted(),n.iceGatheringState!=="complete"&&await new Promise((c,f)=>{const S=()=>{n.iceGatheringState==="complete"&&(R(),c())},k=()=>{R(),f(u.reason)},R=()=>{n.removeEventListener("icegatheringstatechange",S),u.removeEventListener("abort",k)};n.addEventListener("icegatheringstatechange",S),u.addEventListener("abort",k,{once:!0}),S(),u.aborted&&k()});const V=n.localDescription?.sdp;if(!V)throw new Error("Missing voice offer");const G=await E(V,u);return await n.setRemoteDescription({type:"answer",sdp:G.sdp}),await j,r.throwIfAborted(),u.removeEventListener("abort",z),r.removeEventListener("abort",M),t.onConnect(),L=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&&(O=Date.now()),t.onModeChange({mode:Date.now()-O<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{Fe as startOpenAIConversation};
@@ -1 +1 @@
1
- import{c as a,a4 as f,m as S,K as y,q as v}from"./index-CgoVr5FU.js";import{a as d}from"./use-project-native-view-presence-B5-VJk9q.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,a4 as f,m as S,K as y,q as v}from"./index-BXY_6H_h.js";import{a as d}from"./use-project-native-view-presence-DpLyWumT.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};