decocms 4.152.2 → 4.154.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 (222) hide show
  1. package/dist/client/assets/{AlertCircle-CJIb11xM.js → AlertCircle-DrATK--G.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BD-p9vcZ.js → AreaChart-Ba9Ms0ch.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-C4eq2Obn.js → ArrowUp-boiVbq4P.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-DY5OrDCo.js → ArrowUpRight-CGNmznYx.js} +1 -1
  5. package/dist/client/assets/{Check-CzuAentr.js → Check-GfWraBFp.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-L1MZeMEC.js → CheckCircle-6OIDiE1o.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-CClFlSxz.js → ChevronDown-CSrIpSEZ.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-uevwIauT.js → ChevronRight-CTT8T1J0.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BMENMqPe.js → ChevronUp-DwmhjoAn.js} +1 -1
  10. package/dist/client/assets/{Copy01-DKc_cNPS.js → Copy01--ZOTzkPA.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-CQZHTBv_.js → CpuChip01-BlrhketG.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DNiWmGQW.js → DotsVertical-CLT4z1eM.js} +1 -1
  13. package/dist/client/assets/{Eye-CLJlIW72.js → Eye-CKSKAoUm.js} +1 -1
  14. package/dist/client/assets/{FilterLines-_KV74m1j.js → FilterLines-Db1mPJVs.js} +1 -1
  15. package/dist/client/assets/{HardDrive-D3MsBwdM.js → HardDrive-C2zbQHbI.js} +1 -1
  16. package/dist/client/assets/{Key01-Ph8ozLZ_.js → Key01-C017Z9kh.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-BLprwKtV.js → LayoutLeft-BAgNWwto.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-Bmn2On3L.js → LinkExternal01-BBpoOd9O.js} +1 -1
  19. package/dist/client/assets/{LogOut01-DtXlL9FN.js → LogOut01-Bvl779Ya.js} +1 -1
  20. package/dist/client/assets/{Monitor01-Cq5ooC-g.js → Monitor01-Cg1SkWzI.js} +1 -1
  21. package/dist/client/assets/{Palette-DfxMP9C1.js → Palette-CsAExMG_.js} +1 -1
  22. package/dist/client/assets/{Play-D9njRjDI.js → Play-DxZ6Acq3.js} +1 -1
  23. package/dist/client/assets/{Plus-DLbtYGri.js → Plus-C6kGK8YY.js} +1 -1
  24. package/dist/client/assets/{SearchLg-DctVlVQz.js → SearchLg-DrfU4tKL.js} +1 -1
  25. package/dist/client/assets/{SearchMd-EJtaQP9g.js → SearchMd-BI0XFlBK.js} +1 -1
  26. package/dist/client/assets/{Settings02-D2Od6hIu.js → Settings02-vpAc0p9f.js} +1 -1
  27. package/dist/client/assets/{Shield01-CfDR602-.js → Shield01-mWDumpp-.js} +1 -1
  28. package/dist/client/assets/{Star01-vKIuVNvK.js → Star01-Dqavdch8.js} +1 -1
  29. package/dist/client/assets/{Stars01-3Jc0GjIj.js → Stars01-szhvpQET.js} +1 -1
  30. package/dist/client/assets/{Stars02-pjrDL108.js → Stars02-hS3VtVKb.js} +1 -1
  31. package/dist/client/assets/{Sun-D70XMNg2.js → Sun-BChTpLPO.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-DqL7dpQo.js → SwitchHorizontal01-BBtvc6mI.js} +1 -1
  33. package/dist/client/assets/{Tool01-BqM3fhvU.js → Tool01-Dhc4ao7G.js} +1 -1
  34. package/dist/client/assets/{Tool02-CdAHKhSP.js → Tool02-DD_vhYh6.js} +1 -1
  35. package/dist/client/assets/{Trash01-CQlBG8ML.js → Trash01-Lta4-dBB.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-BOoR0Suf.js → TrendUp01-CvDSutMV.js} +1 -1
  37. package/dist/client/assets/{Upload01-bMCburYR.js → Upload01-BQ9GWbOC.js} +1 -1
  38. package/dist/client/assets/{User01-Bk3KF8L-.js → User01-BebV7VwV.js} +1 -1
  39. package/dist/client/assets/{Users01-DrmBjw74.js → Users01-DOLzWgUv.js} +1 -1
  40. package/dist/client/assets/{Users03-DjFIwR1e.js → Users03-lqPHwKgJ.js} +1 -1
  41. package/dist/client/assets/{X-F_AtITBB.js → X-ChbPSCzS.js} +1 -1
  42. package/dist/client/assets/{XCircle-BmPLYPUm.js → XCircle-TzZ5I8PA.js} +1 -1
  43. package/dist/client/assets/{XClose-pCZ95Skb.js → XClose-CcQyyEDk.js} +1 -1
  44. package/dist/client/assets/{Zap-DSrBTwKT.js → Zap-DzsOPqEB.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-lUH8oMSf.js → ZapSquare-N_iAx6EQ.js} +1 -1
  46. package/dist/client/assets/{access-gate-DnmOgDmX.js → access-gate-czxSnRem.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-DH8DHbpw.js → add-section-modal-DGzfYcGp.js} +1 -1
  48. package/dist/client/assets/{agent-icon-B0dE0gXI.js → agent-icon-QsGAUDhV.js} +1 -1
  49. package/dist/client/assets/{agents-list-D5y8SDcU.js → agents-list-CHBC3HUy.js} +1 -1
  50. package/dist/client/assets/{ai-providers-y4LX99HP.js → ai-providers-BZ-sWWtp.js} +1 -1
  51. package/dist/client/assets/{alert-GrGBKekR.js → alert-CbVemj36.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-BbzswsKi.js → alert-dialog-B5U5wY1n.js} +1 -1
  53. package/dist/client/assets/{app-editor-BeBEbbez.js → app-editor-dtaq2QVZ.js} +1 -1
  54. package/dist/client/assets/{auth-Cci4GApT.js → auth-D4KWVJ-l.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-BdrP-mFN.js → auth-catchall-2hcnZL1N.js} +1 -1
  56. package/dist/client/assets/{auth-entry-CQsBGjxN.js → auth-entry-CgG7V5l9.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-BviFip9f.js → auth-split-layout-BMN5ZumL.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-Cv27aboH.js → authenticate-and-persist-oauth-D3KKPa0A.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-DwHzmOHN.js → automation-list-row-DLEoL538.js} +1 -1
  60. package/dist/client/assets/{automation-runs-D5uEU05P.js → automation-runs-DKfA3tEq.js} +1 -1
  61. package/dist/client/assets/{automations-ED2Iy6Vm.js → automations-BeIYBXNU.js} +1 -1
  62. package/dist/client/assets/{avatar-PyzDD5US.js → avatar-_7MnLC1x.js} +1 -1
  63. package/dist/client/assets/{badge-Dnjs2Zbd.js → badge-D-_7-i7u.js} +1 -1
  64. package/dist/client/assets/{block-document-B-nAZW78.js → block-document-BKftwFt3.js} +1 -1
  65. package/dist/client/assets/{brand-context-BnOeGriO.js → brand-context-BFwyqn_N.js} +1 -1
  66. package/dist/client/assets/{buckets-XrX7DKSR.js → buckets-B02-yx-t.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-1TxRLred.js → bulk-category-panel-Cyd36lRc.js} +1 -1
  68. package/dist/client/assets/{calendar-Bja0SUOs.js → calendar-c2b6er6e.js} +2 -2
  69. package/dist/client/assets/{capability-load-error-Do7SvLQW.js → capability-load-error-Ba-2Rwdi.js} +1 -1
  70. package/dist/client/assets/{card-y0dhwXnt.js → card-Cc4Sk9Cg.js} +1 -1
  71. package/dist/client/assets/{category-editor-Fvpm2WRu.js → category-editor-qID5YG1L.js} +1 -1
  72. package/dist/client/assets/{chat-context-DMUQz7NG.js → chat-context-BIm2blRr.js} +1 -1
  73. package/dist/client/assets/{checkbox-D9vx5ZZj.js → checkbox-Dis5O6hc.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-CjNjh__E.js → cli-auth-success-goyICRI5.js} +1 -1
  75. package/dist/client/assets/{collection-detail-DrlKWW5-.js → collection-detail-Ca1iFv3v.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-V2qmjQut.js → collection-display-button-WMuSThgX.js} +1 -1
  77. package/dist/client/assets/{collection-search-CWxNjcsw.js → collection-search-Cwx9vavy.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-CuvAa6BD.js → collection-table-wrapper-C8YddJV1.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-HtRBcLFx.js → collection-tabs-CQH_lrUa.js} +1 -1
  80. package/dist/client/assets/{command-BlXAhqWF.js → command-DRjaLNfE.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-COESBA1z.js → commerce-onboarding-uVL6zb7h.js} +1 -1
  82. package/dist/client/assets/{companions-core-CXGQ7uVK.js → companions-core-DB0ttgCA.js} +1 -1
  83. package/dist/client/assets/{connect-cJhb2oBC.js → connect-C5K16t11.js} +1 -1
  84. package/dist/client/assets/{connection-DWiaV8fW.js → connection-D69nZcZq.js} +1 -1
  85. package/dist/client/assets/{connection-card-CUyV1k5o.js → connection-card-DYmDmitm.js} +1 -1
  86. package/dist/client/assets/{connection-detail-BbP_tQBk.js → connection-detail-Ck8N0AcI.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-Id5QIP0z.js → connection-form-helpers-DJHjRcxz.js} +1 -1
  88. package/dist/client/assets/{connections-DmbhbZRK.js → connections-CA9XU_LB.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-D9LvrvYB.js → decopilot-sse-pool-BqOQpD3k.js} +1 -1
  90. package/dist/client/assets/{dialog-umfUtb99.js → dialog-CGIzImjA.js} +1 -1
  91. package/dist/client/assets/{domain-settings-i1hvYDBx.js → domain-settings-CoLIRepL.js} +1 -1
  92. package/dist/client/assets/{drawer-BUnObxIU.js → drawer-BnrznRXJ.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-CDi9V4K2.js → dropdown-menu-BqEwoGS-.js} +1 -1
  94. package/dist/client/assets/{empty-state-CRcUb-lZ.js → empty-state-CP56BOYX.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-B49JzpOp.js → extract-connection-data-COcUiVUk.js} +1 -1
  96. package/dist/client/assets/{file-explorer-DBQSC69s.js → file-explorer-2fC1j1bY.js} +2 -2
  97. package/dist/client/assets/{form-C-C_sOUC.js → form-B1Je5WWi.js} +1 -1
  98. package/dist/client/assets/{general-kNKSObvm.js → general-D8ygNhQj.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-D3BJLO5i.js → github-repo-picker-DFY4goj7.js} +1 -1
  100. package/dist/client/assets/{hooks-BfI5-YVe.js → hooks-c93_ex0y.js} +1 -1
  101. package/dist/client/assets/{index-CsebWa9R.js → index-1_-ikgnM.js} +1 -1
  102. package/dist/client/assets/index-B5jBvolo.css +1 -0
  103. package/dist/client/assets/{index-D_PNbLDw.js → index-BLS8bdia.js} +1 -1
  104. package/dist/client/assets/{index-83skOF3Q.js → index-BqeaXUqM.js} +1 -1
  105. package/dist/client/assets/{index-DZHjNDS2.js → index-D3-5x7iS.js} +1 -1
  106. package/dist/client/assets/{index-C2MB_KMl.js → index-DEOfU1EL.js} +36 -36
  107. package/dist/client/assets/{index-DdGqNgtg.js → index-DhKQ08bZ.js} +1 -1
  108. package/dist/client/assets/{index-D47l1GkF.js → index-DriQFBys.js} +1 -1
  109. package/dist/client/assets/{index-BQVRYyhb.js → index-X1IvsmDv.js} +1 -1
  110. package/dist/client/assets/{index-DIkRR5xC.js → index-Zp3vWiTZ.js} +1 -1
  111. package/dist/client/assets/{index-CviX7bgn.js → index-obg2D9mw.js} +4 -4
  112. package/dist/client/assets/{index-redirect-oERHx7o3.js → index-redirect-djuM2jXs.js} +1 -1
  113. package/dist/client/assets/{index-v4xr9fBY.js → index-w4Kza-rK.js} +5 -5
  114. package/dist/client/assets/{input-BhxRA_PT.js → input-DVK3DIEk.js} +1 -1
  115. package/dist/client/assets/{integration-icon-CNZB1ZgI.js → integration-icon-D7Hr4PuO.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-BBLo0xtd.js → invite-member-dialog-By7jI_4u.js} +1 -1
  117. package/dist/client/assets/{label-CV9ZjoNw.js → label-Bbg1oZtS.js} +1 -1
  118. package/dist/client/assets/{layout-oi6eozIR.js → layout-DWvbZg-S.js} +1 -1
  119. package/dist/client/assets/{login-7GSMSmDU.js → login-DTGFEppO.js} +1 -1
  120. package/dist/client/assets/{mcp-oauth-xeI046T8.js → mcp-oauth-D3T1jiFO.js} +1 -1
  121. package/dist/client/assets/{members-DvrhREZA.js → members-CSqifoWg.js} +1 -1
  122. package/dist/client/assets/{monaco-editor-Cv0goHEj.js → monaco-editor-cBR-B6jK.js} +1 -1
  123. package/dist/client/assets/{monitoring-stats-row-V8O2Ro-U.js → monitoring-stats-row-DhQMHWKH.js} +1 -1
  124. package/dist/client/assets/{multi-select-BKPa72QH.js → multi-select-tPBk15dV.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-Bz8lL0Wt.js → oauth-callback-D5x8Ri6r.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-7zgbzy7R.js → oauth-callback-ai-provider-C8qsaBIX.js} +1 -1
  127. package/dist/client/assets/{onboarding-D76lSMle.js → onboarding-DOnmCu8e.js} +1 -1
  128. package/dist/client/assets/{org-layout-B24s61-1.js → org-layout-DmrCFnQj.js} +1 -1
  129. package/dist/client/assets/{organization-choice-BCn2YoDb.js → organization-choice-DfQ4HL4w.js} +1 -1
  130. package/dist/client/assets/{orgs-BskWfyij.js → orgs-DicJgRM1.js} +1 -1
  131. package/dist/client/assets/{page-seo-form-Ca7r-wrV.js → page-seo-form-DeaCyfGQ.js} +1 -1
  132. package/dist/client/assets/{popover-DWt5ICmR.js → popover-DjkrtSzs.js} +1 -1
  133. package/dist/client/assets/{post-editor-DhHYWFTw.js → post-editor-BS1BoxUD.js} +1 -1
  134. package/dist/client/assets/{primitives-nDW7DL8Q.js → primitives-b_WXlnZO.js} +1 -1
  135. package/dist/client/assets/{profile-CuVDlTkY.js → profile-C1CkY0CM.js} +1 -1
  136. package/dist/client/assets/project-app-view-DH5xUTNg.js +1 -0
  137. package/dist/client/assets/record-editor-WGVciJNv.js +1 -0
  138. package/dist/client/assets/{redirect-editor-BzlpeM6X.js → redirect-editor-CcSA36dm.js} +1 -1
  139. package/dist/client/assets/registry-D268wuJ4.js +2 -0
  140. package/dist/client/assets/{registry-layout-DOrq4Kg2.js → registry-layout-Ctxae8D_.js} +1 -1
  141. package/dist/client/assets/{reports-DeQEVTxM.js → reports-BPTerYvn.js} +1 -1
  142. package/dist/client/assets/{require-capability-CY0pv6qC.js → require-capability-BU4R-Pci.js} +1 -1
  143. package/dist/client/assets/{required-auth-layout-B4hT2jJ6.js → required-auth-layout-C7bhzdzG.js} +1 -1
  144. package/dist/client/assets/{reset-password-DxzjmCNO.js → reset-password-BMKS5sDo.js} +1 -1
  145. package/dist/client/assets/{roles-HOif2C5d.js → roles-IeN3IyhY.js} +1 -1
  146. package/dist/client/assets/{search-input-jQMH80d1.js → search-input-Cru0aaSq.js} +1 -1
  147. package/dist/client/assets/{secrets-BeqgbfKp.js → secrets-DPiuYk9g.js} +1 -1
  148. package/dist/client/assets/{sections-editor-DwJl9UQf.js → sections-editor-rYh_c3z7.js} +1 -1
  149. package/dist/client/assets/{select-c9MOlhi4.js → select-B-YdeuWd.js} +1 -1
  150. package/dist/client/assets/{select-model-3Y0RIjid.js → select-model-MSe8iJC7.js} +1 -1
  151. package/dist/client/assets/{self-tool-result-CL0ggiz4.js → self-tool-result-DSiTGzYb.js} +1 -1
  152. package/dist/client/assets/{seo-editor-BEkSG9db.js → seo-editor-BDD2JLpf.js} +1 -1
  153. package/dist/client/assets/{settings-layout-D3n3N0n1.js → settings-layout-FgrY41p7.js} +1 -1
  154. package/dist/client/assets/{settings-section-Ci41xvwW.js → settings-section-0Il2nrB-.js} +1 -1
  155. package/dist/client/assets/{shell-controls-BqQDdQit.js → shell-controls-BXHz3sFD.js} +1 -1
  156. package/dist/client/assets/{shell-layout-CikXXWSF.js → shell-layout-DSa8T0M4.js} +1 -1
  157. package/dist/client/assets/{sidebar-Bn8O7Aoo.js → sidebar-DWgS242X.js} +1 -1
  158. package/dist/client/assets/{skeleton-V5kxsFXg.js → skeleton-C1HZSi37.js} +1 -1
  159. package/dist/client/assets/{spinner-B-_zF0cw.js → spinner-kz0fXsFk.js} +1 -1
  160. package/dist/client/assets/{sso-Ba8XDhl4.js → sso-ClIfjoxd.js} +1 -1
  161. package/dist/client/assets/store-registry-BzmH7Pzu.js +2 -0
  162. package/dist/client/assets/{store-BdL9SGT5.js → store-zEC2TOuo.js} +1 -1
  163. package/dist/client/assets/{studio-tools-Xw-8BkV3.js → studio-tools-BylTF4-U.js} +1 -1
  164. package/dist/client/assets/{switch-BArXYiGI.js → switch-DLSLpDDC.js} +1 -1
  165. package/dist/client/assets/{tab-id-WKHool93.js → tab-id-Dl1o9iNc.js} +1 -1
  166. package/dist/client/assets/{table-YqpfKi5R.js → table-Dj0pa7qr.js} +1 -1
  167. package/dist/client/assets/{tabs-B3563EJu.js → tabs-DOISnywY.js} +1 -1
  168. package/dist/client/assets/{textarea-DAdqvQK7.js → textarea-BF27pyG0.js} +1 -1
  169. package/dist/client/assets/{toggle-group-DhYbfukY.js → toggle-group-CaG8s-oU.js} +1 -1
  170. package/dist/client/assets/{toolbar-9JOgV_wh.js → toolbar-BDafR3Cw.js} +1 -1
  171. package/dist/client/assets/{tooltip-CzcvFJJ4.js → tooltip-D7StMLxc.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-B7l3jMjK.js → use-ai-providers-Df4EenwN.js} +1 -1
  173. package/dist/client/assets/{use-automations-k3FdbNQZ.js → use-automations-BHklCdet.js} +1 -1
  174. package/dist/client/assets/{use-autosave-D_BvxoLq.js → use-autosave-yWsXmZ6V.js} +1 -1
  175. package/dist/client/assets/{use-capability-C9ZzLeWc.js → use-capability-Cnl59xCS.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-Bx9BIbXn.js → use-clock-tick-Bg7iwLiT.js} +1 -1
  177. package/dist/client/assets/{use-connection-Cx1i_8ZN.js → use-connection-BUo2sigQ.js} +1 -1
  178. package/dist/client/assets/{use-copy-B2wy-3nw.js → use-copy-BZ1uzFBm.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-6kthF1rc.js → use-create-virtual-mcp-DKDi48iR.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-031Q_-VG.js → use-debounced-autosave-eUlOdvtC.js} +1 -1
  181. package/dist/client/assets/{use-debounced-value-DExSEFbd.js → use-debounced-value-DpBsFX3D.js} +1 -1
  182. package/dist/client/assets/{use-deco-credits-DBj-t6Aa.js → use-deco-credits-ByHlytit.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-Bl5cSmBo.js → use-decopilot-events-CRkJLiAl.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-BDFlhFvE.js → use-delete-connection-DD1Pbe4L.js} +1 -1
  185. package/dist/client/assets/{use-deployment-admin-BWGeFN0z.js → use-deployment-admin-DQs8Vk9v.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-CAVDuZCM.js → use-file-configs-AShx7pDp.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-KjXcCgnB.js → use-infinite-scroll-DDo__zqC.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-B-ESBTqy.js → use-join-requests-DtdC8DPn.js} +1 -1
  189. package/dist/client/assets/{use-mcp-auth-status-C8_KfxzO.js → use-mcp-auth-status-P0M4YpoR.js} +1 -1
  190. package/dist/client/assets/{use-mcp-client-DspygOPp.js → use-mcp-client-iPC50X8f.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-MSs9nJ6T.js → use-mcp-tools-DzzKJ-_D.js} +1 -1
  192. package/dist/client/assets/{use-members-Dbnerenq.js → use-members-oSMhXQpq.js} +1 -1
  193. package/dist/client/assets/{use-mobile-C-mJw8PU.js → use-mobile-B7cyaUDa.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-DSBbiXfY.js → use-navigate-to-agent-DBC7w0Dc.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-BLdLjrj3.js → use-org-auth-client-DfepKFTi.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-DTXoH044.js → use-org-sso-Cl_sF9Eb.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-BaSsK7Wz.js → use-organization-roles-DD1c5hVD.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-CaerOcj2.js → use-organization-settings-NgDaxxSt.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-UoehQZfC.js → use-registry-connections-BvMzZBIl.js} +1 -1
  200. package/dist/client/assets/{use-secrets-C1Rd8ciu.js → use-secrets-rEsQEZ5u.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-DHwBY788.js → use-status-sounds-CTRcRdJQ.js} +1 -1
  202. package/dist/client/assets/{use-tags-CRNzH6FE.js → use-tags-clUvkKKY.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-9o6KjSAa.js → use-view-mode-DB9APer_.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-kUy0NdbH.js → use-virtual-mcp-DezThwv0.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-DNUr1sdD.js +1 -0
  206. package/dist/client/assets/{useQueries-Bt-8udgX.js → useQueries-C9uqopwa.js} +1 -1
  207. package/dist/client/assets/{useRouterState-CzVdxDmf.js → useRouterState-DNSSQUlE.js} +1 -1
  208. package/dist/client/assets/useSuspenseInfiniteQuery-BQFc-ofx.js +1 -0
  209. package/dist/client/assets/{users-Cp1_XbOZ.js → users-B7lb5cSL.js} +1 -1
  210. package/dist/client/assets/{variant-calendar-DUjKuaAn.js → variant-calendar-vZDHoFr_.js} +1 -1
  211. package/dist/client/assets/{view-mode-toggle-BR1L0_ap.js → view-mode-toggle-BGs6Ej_8.js} +1 -1
  212. package/dist/client/index.html +2 -2
  213. package/dist/server/cli.js +247 -167
  214. package/dist/server/server.js +1 -1
  215. package/package.json +1 -1
  216. package/dist/client/assets/index-CbTRSuOH.css +0 -1
  217. package/dist/client/assets/project-app-view-C5Glu0kH.js +0 -1
  218. package/dist/client/assets/record-editor-C39caKgs.js +0 -1
  219. package/dist/client/assets/registry-Dwo3t2BQ.js +0 -2
  220. package/dist/client/assets/store-registry-B-9PFWDk.js +0 -2
  221. package/dist/client/assets/useInfiniteQuery-Dd4ko7id.js +0 -1
  222. package/dist/client/assets/useSuspenseInfiniteQuery-OE3RI5rq.js +0 -1
@@ -1 +1 @@
1
- import{a as B,D as ke,r as y,e as ae,p as $,j as t,m as j,B as pe,o as Be,n as $e,K as oe,c as ce,b as xe,S as Fe}from"./index-v4xr9fBY.js";import{I as X}from"./input-BhxRA_PT.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-B-_zF0cw.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const _e={submitEmailPassword:({mode:r,email:e,password:c,name:f})=>r==="sign_up"?B.signUp.email({email:e,password:c,name:f||""}):B.signIn.email({email:e,password:c}),requestPasswordReset:({email:r,redirectTo:e})=>B.requestPasswordReset({email:r,redirectTo:e}),sendOtp:({email:r})=>B.emailOtp.sendVerificationOtp({email:r,type:"sign-in"}),submitOtp:({email:r,otp:e})=>B.signIn.emailOtp({email:r,otp:e}),socialSignIn:({provider:r,callbackURL:e})=>B.signIn.social({provider:r,callbackURL:e}),ssoSignIn:({providerId:r,callbackURL:e})=>B.signIn.sso({providerId:r,callbackURL:e}),onAuthenticated:r=>{window.location.href=r}},le="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:r=>`Code sent to ${r}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:r=>`Continue with ${r}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:r,callbackUrl:e="/",title:c,subtitle:f,brand:p,copy:m,variant:i="default",allowedSocialProviders:l,allowPassword:u=!0,onAuthEvent:I,actions:N}){const{emailAndPassword:A,resetPassword:v,emailOtp:E,socialProviders:h}=ke(),d={..._e,...N},g=s=>{try{I?.(s)}catch{}},P=i==="compact",Z=l?h.providers.filter(s=>l.includes(s.name)):h.providers,ee=h.enabled&&Z.length>0,me=A.enabled&&(u||!E.enabled&&!ee),x=h.enabled&&h.providers.length>0&&!ee&&!E.enabled&&!me?h.providers:Z,O=h.enabled&&x.length>0,F=A.enabled&&(u||!E.enabled&&!O),[b,M]=y.useState(""),[_,V]=y.useState(""),[a,S]=y.useState(""),[q,T]=y.useState(""),[L,ue]=y.useState(!1),[ge,Le]=y.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[k,Q]=y.useState(""),[be,ye]=y.useState(!1),[Oe,he]=y.useState(null),n={...Ke,...m},te=y.useId(),z=`${te}-email`,H=`${te}-email-error`,ve=`${te}-name`,we=`${te}-password`,Ee=`${te}-otp`,C=ge==="signUp",W=ge==="forgotPassword",R=ge==="emailOtp",se=ae({mutationFn:async({email:s,password:o,name:D})=>{try{const J=await d.submitEmailPassword({mode:C?"sign_up":"sign_in",email:s,password:o,name:D});if(J.error)throw new Error(J.error.message||(C?n.signUpFailed:n.signInFailed));return J}catch(J){throw J instanceof Error?J:new Error(n.authenticationFailed)}},onMutate:()=>{g({type:"started",method:"email_password",mode:C?"sign_up":"sign_in"})},onSuccess:()=>{g({type:"succeeded",method:"email_password",mode:C?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(r??e)},onError:s=>{g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),$(C?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),ne=ae({mutationFn:async({email:s})=>{const o=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(o.error)throw new Error(o.error.message||n.resetEmailFailed);return o},onSuccess:()=>{$("password_reset_requested"),ye(!0)},onError:s=>{$("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),K=ae({mutationFn:async({email:s})=>{const o=await d.sendOtp({email:s});if(o.error)throw new Error(o.error.message||n.otpSendFailed);return o},onMutate:()=>{g({type:"started",method:"email_otp"})},onSuccess:()=>{g({type:"otp_sent",method:"email_otp"}),$("email_otp_sent"),ue(!0)},onError:s=>{g({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),Y=ae({mutationFn:async({email:s,otp:o})=>{const D=await d.submitOtp({email:s,otp:o});if(D.error)throw new Error(D.error.message||n.invalidCode);return D},onMutate:()=>{g({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{g({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(r??e)},onError:s=>{g({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ie=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),fe=()=>{b.trim()&&!ie(b)&&Q(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}se.mutate({email:b,password:_,name:a})},Re=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail);return}ne.mutate({email:b})},De=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}K.mutate({email:b})},Me=s=>{s.preventDefault(),Y.mutate({email:b,otp:q})},G=s=>o=>{s(o.target.value),Se&&se.reset(),je&&ne.reset(),Ne&&(K.reset(),Y.reset()),s===M&&k&&Q("")},re=s=>{Le(s),S(""),T(""),ue(!1),Q(""),ye(!1),he(null),se.reset(),ne.reset(),K.reset(),Y.reset()},w=se.isPending||ne.isPending||K.isPending||Y.isPending,Se=se.error,je=ne.error,Ne=K.error||Y.error,U=C?b.trim()&&_.trim()&&a.trim():W?b.trim():R?L?q.trim():b.trim():b.trim()&&_.trim(),qe=s=>{if(!s)return null;const o=s.message.toLowerCase();return o.includes("unauthorized")||o.includes("401")?n.invalidEmailOrPassword:o.includes("already exists")||o.includes("409")?n.accountExists:o.includes("network")||o.includes("fetch")?n.networkError:o.includes("rate limit")||o.includes("429")?n.tooManyAttempts:o.includes("invalid")&&o.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=Se||je||Ne||Oe,We=async s=>{g({type:"started",method:"social",provider:s}),he(null);try{const o=await d.socialSignIn({provider:s,callbackURL:r??e});if(o.error)throw new Error(o.error.message||n.authenticationFailed)}catch(o){const D=o instanceof Error?o.message:String(o);g({type:"failed",method:"social",provider:s,stage:"redirect",error:D}),$("social_signin_failed",{provider:s,error:D}),he(o instanceof Error?o:new Error(D))}},Ue=W?n.resetPasswordTitle:R&&L?n.verificationCodeTitle:c??n.welcomeTitle,Ae=W?n.resetPasswordSubtitle:R&&L?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:j("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{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"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:j("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ae&&t.jsx("p",{className:j("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ae})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),be&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!W&&!(R&&L)&&O&&t.jsx("div",{className:"grid gap-2",children:x.map(s=>t.jsxs("button",{type:"button",disabled:w,onClick:()=>{We(s.name)},className:j("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:j("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!W&&!(R&&L)&&O&&(F||E.enabled)&&t.jsxs("div",{className:j("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:j("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),R&&E.enabled&&t.jsx(t.Fragment,{children:L?t.jsxs("form",{onSubmit:Me,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Ee,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(X,{id:Ee,type:"text",placeholder:n.enterCodePlaceholder,value:q,onChange:G(T),required:!0,disabled:w,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{ue(!1),T(""),K.reset(),Y.reset()},disabled:w,className:j("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:z,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive",children:k})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.sending:n.sendCode})]})}),W&&F&&!be&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive mt-1.5",children:k})]}),t.jsx(pe,{type:"submit",disabled:w||!U,className:"w-full font-semibold",size:"xl",children:w?n.sending:n.sendResetLink})]}),!W&&!R&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[C&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(X,{id:ve,type:"text",placeholder:n.namePlaceholder,value:a,onChange:G(S),required:!0,disabled:w,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive mt-1.5",children:k})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!C&&v.enabled&&t.jsx("button",{type:"button",onClick:()=>re("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(X,{id:we,type:"password",placeholder:"••••••••",value:_,onChange:G(V),required:!0,disabled:w,autoComplete:C?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:j("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",U?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:j("p-1",!U&&"pointer-events-none"),children:t.jsx(pe,{type:"submit",disabled:w||!U,className:j("w-full font-semibold"),size:"xl","aria-hidden":!U,children:w?C?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:W?t.jsx("button",{type:"button",onClick:()=>re("signIn"),disabled:w,className:le,children:n.backToSignIn}):R&&F?t.jsx("button",{type:"button",onClick:()=>re("signIn"),disabled:w,className:le,children:n.signInWithPassword}):!R&&F?t.jsxs(t.Fragment,{children:[C?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>re(C?"signIn":"signUp"),disabled:w,className:le,children:C?n.signIn:n.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>re("emailOtp"),disabled:w,className:le,children:n.signInWithEmailCode})]})]}):null})]})}async function de(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const r=Be(),e=Ve(),c=$e({queryKey:oe.desktopAuthStatus(),queryFn:async()=>(await de()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=y.useState(!1),[m,i]=y.useState(null),[l,u]=y.useState(!1),[I,N]=y.useState(null);y.useEffect(()=>{},[e,r]);async function A(){p(!0),i(null);try{const d=await de();await d.performAuthLogin();const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}catch(d){i(d instanceof Error?d.message:"Sign-in failed")}finally{p(!1)}}async function v(){p(!0);try{const d=await de();await d.performAuthLogout();const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}finally{p(!1)}}async function E(){u(!0),N(null);let d;try{d=await de()}catch(g){N(g instanceof Error?g.message:"Sign-in failed"),u(!1);return}try{await d.performAuthCompleteSession()}catch(g){N(g instanceof Error?g.message:"Sign-in failed")}finally{try{const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}finally{u(!1)}}}async function h(){await c.refetch()}return{status:c.data,isChecking:c.isLoading,isRetryingStatus:c.isFetching,isPending:f,loginError:m,login:A,logout:v,isCompletingSession:l,completeSessionError:I,completeSession:E,retryStatus:h}}function Je(r){return!(r.emailAndPassword.enabled||r.emailOtp.enabled||r.socialProviders.enabled)&&!r.sso.enabled&&r.magicLink.enabled}function Xe(){return ce.c(10),Ge(),null}function Ze(r){const e=ce.c(25),{onContinue:c,isPending:f,error:p}=r,m=xe();let i;e[0]!==m?(i=m("common.authEntry.browserOnlyTitle"),e[0]=m,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:i}),e[2]=i,e[3]=l):l=e[3];let u;e[4]!==m?(u=m("common.authEntry.browserOnlyDescription"),e[4]=m,e[5]=u):u=e[5];let I;e[6]!==u?(I=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:u}),e[6]=u,e[7]=I):I=e[7];let N;e[8]!==l||e[9]!==I?(N=t.jsxs("div",{className:"flex flex-col gap-1",children:[l,I]}),e[8]=l,e[9]=I,e[10]=N):N=e[10];let A;e[11]!==c?(A=()=>{c()},e[11]=c,e[12]=A):A=e[12];let v;e[13]!==m?(v=m("common.authEntry.browserOnlyCta"),e[13]=m,e[14]=v):v=e[14];let E;e[15]!==f||e[16]!==A||e[17]!==v?(E=t.jsx(pe,{onClick:A,disabled:f,children:v}),e[15]=f,e[16]=A,e[17]=v,e[18]=E):E=e[18];let h;e[19]!==p?(h=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=h):h=e[20];let d;return e[21]!==N||e[22]!==E||e[23]!==h?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[N,E,h]}),e[21]=N,e[22]=E,e[23]=h,e[24]=d):d=e[24],d}function Ce(r){const e=ce.c(8),{label:c,error:f}=r;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let m;e[1]!==c?(m=c&&t.jsx("p",{className:"text-sm text-muted-foreground",children:c}),e[1]=c,e[2]=m):m=e[2];let i;e[3]!==f?(i=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=i):i=e[4];let l;return e[5]!==m||e[6]!==i?(l=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,m,i]}),e[5]=m,e[6]=i,e[7]=l):l=e[7],l}class Ie{constructor(e){this.response=e}response}function et(r){return r.startsWith("/")&&!r.startsWith("//")?r:"/"}function tt({redirectTo:r,onAuthEvent:e}){const c=xe(),[f,p]=y.useState(null),m=y.useEffectEvent(i=>{try{e?.(i)}catch{}});return y.useEffect(()=>{let i=!1;return(async()=>{m({type:"started",method:"local"});try{let l;try{l=await ze(async()=>{const u=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(u.status>=500)throw new Ie(u);return u},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(u){if(u instanceof He&&u.cause instanceof Ie)l=u.cause.response;else throw u}if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u?.error||c("common.authEntry.autoLoginFailed"))}i||(m({type:"succeeded",method:"local"}),window.location.href=et(r))}catch(l){i||(m({type:"failed",method:"local",stage:"authenticate",error:l instanceof Error?l.message:String(l)}),p(l instanceof Error?l.message:c("common.authEntry.autoLoginFailed")))}})(),()=>{i=!0}},[r]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:c("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:c("common.authEntry.tryRestartingServer")})]})}):t.jsx(Fe,{})}function st({callbackURL:r,providerId:e,ssoSignIn:c,onAuthEvent:f}){const p=y.useEffectEvent(i=>{try{f?.(i)}catch{}}),m=y.useEffectEvent(c);return y.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const i=await m({providerId:e,callbackURL:r});if(i.error)throw new Error(i.error.message||"SSO redirect failed")}catch(i){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:i instanceof Error?i.message:String(i)})}})()},[e,r]),t.jsx(Fe,{})}function lt(r){const e=ce.c(45),{callbackUrl:c,redirectUrl:f,allowAutoLogin:p,title:m,subtitle:i,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v}=r,E=p===void 0?!0:p,h=xe(),{sso:d,emailAndPassword:g,magicLink:P,emailOtp:Z,socialProviders:ee,localMode:me}=ke(),x=Xe(),O=f||c,F=x?.actions;let b;e[0]!==F?(b={..._e,...F},e[0]=F,e[1]=b):b=e[1];const M=b;if(x?.isPending){let a;e[2]!==h?(a=h("common.authEntry.finishSignInInBrowser"),e[2]=h,e[3]=a):a=e[3];let S;return e[4]!==x.loginError||e[5]!==a?(S=t.jsx(Ce,{label:a,error:x.loginError}),e[4]=x.loginError,e[5]=a,e[6]=S):S=e[6],S}if(x?.isCompletingSession){let a;e[7]!==h?(a=h("common.authEntry.finishingSignIn"),e[7]=h,e[8]=a):a=e[8];let S;return e[9]!==x.completeSessionError||e[10]!==a?(S=t.jsx(Ce,{label:a,error:x.completeSessionError}),e[9]=x.completeSessionError,e[10]=a,e[11]=S):S=e[11],S}if(me&&E){let a;return e[12]!==v||e[13]!==O?(a=t.jsx(tt,{redirectTo:O,onAuthEvent:v}),e[12]=v,e[13]=O,e[14]=a):a=e[14],a}if(d.enabled){let a;return e[15]!==v||e[16]!==O||e[17]!==M.ssoSignIn||e[18]!==d.providerId?(a=t.jsx(st,{callbackURL:O,providerId:d.providerId,ssoSignIn:M.ssoSignIn,onAuthEvent:v}),e[15]=v,e[16]=O,e[17]=M.ssoSignIn,e[18]=d.providerId,e[19]=a):a=e[19],a}if(x&&Je({emailAndPassword:g,emailOtp:Z,socialProviders:ee,magicLink:P,sso:d})){let a;return e[20]!==x.isPending||e[21]!==x.login||e[22]!==x.loginError?(a=t.jsx(Ze,{onContinue:x.login,isPending:x.isPending,error:x.loginError}),e[20]=x.isPending,e[21]=x.login,e[22]=x.loginError,e[23]=a):a=e[23],a}if(g.enabled||P.enabled||Z.enabled||ee.enabled){const a=x?.loginError??x?.completeSessionError??null;let S;e[24]!==A||e[25]!==N||e[26]!==l||e[27]!==c||e[28]!==u||e[29]!==v||e[30]!==F||e[31]!==f||e[32]!==i||e[33]!==m||e[34]!==I?(S=t.jsx(Ye,{redirectUrl:f,callbackUrl:c,title:m,subtitle:i,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v,actions:F}),e[24]=A,e[25]=N,e[26]=l,e[27]=c,e[28]=u,e[29]=v,e[30]=F,e[31]=f,e[32]=i,e[33]=m,e[34]=I,e[35]=S):S=e[35];const q=S;if(!a)return q;let T;e[36]!==a?(T=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[36]=a,e[37]=T):T=e[37];let L;return e[38]!==q||e[39]!==T?(L=t.jsxs("div",{className:"grid gap-4",children:[T,q]}),e[38]=q,e[39]=T,e[40]=L):L=e[40],L}let _;e[41]!==h?(_=h("common.authEntry.noLoginOptions"),e[41]=h,e[42]=_):_=e[42];let V;return e[43]!==_?(V=t.jsx("div",{children:_}),e[43]=_,e[44]=V):V=e[44],V}export{lt as A,Ge as u};
1
+ import{a as B,D as ke,r as y,e as ae,p as $,j as t,m as j,B as pe,o as Be,n as $e,K as oe,c as ce,b as xe,S as Fe}from"./index-w4Kza-rK.js";import{I as X}from"./input-DVK3DIEk.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-kz0fXsFk.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const _e={submitEmailPassword:({mode:r,email:e,password:c,name:f})=>r==="sign_up"?B.signUp.email({email:e,password:c,name:f||""}):B.signIn.email({email:e,password:c}),requestPasswordReset:({email:r,redirectTo:e})=>B.requestPasswordReset({email:r,redirectTo:e}),sendOtp:({email:r})=>B.emailOtp.sendVerificationOtp({email:r,type:"sign-in"}),submitOtp:({email:r,otp:e})=>B.signIn.emailOtp({email:r,otp:e}),socialSignIn:({provider:r,callbackURL:e})=>B.signIn.social({provider:r,callbackURL:e}),ssoSignIn:({providerId:r,callbackURL:e})=>B.signIn.sso({providerId:r,callbackURL:e}),onAuthenticated:r=>{window.location.href=r}},le="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:r=>`Code sent to ${r}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:r=>`Continue with ${r}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:r,callbackUrl:e="/",title:c,subtitle:f,brand:p,copy:m,variant:i="default",allowedSocialProviders:l,allowPassword:u=!0,onAuthEvent:I,actions:N}){const{emailAndPassword:A,resetPassword:v,emailOtp:E,socialProviders:h}=ke(),d={..._e,...N},g=s=>{try{I?.(s)}catch{}},P=i==="compact",Z=l?h.providers.filter(s=>l.includes(s.name)):h.providers,ee=h.enabled&&Z.length>0,me=A.enabled&&(u||!E.enabled&&!ee),x=h.enabled&&h.providers.length>0&&!ee&&!E.enabled&&!me?h.providers:Z,O=h.enabled&&x.length>0,F=A.enabled&&(u||!E.enabled&&!O),[b,M]=y.useState(""),[_,V]=y.useState(""),[a,S]=y.useState(""),[q,T]=y.useState(""),[L,ue]=y.useState(!1),[ge,Le]=y.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[k,Q]=y.useState(""),[be,ye]=y.useState(!1),[Oe,he]=y.useState(null),n={...Ke,...m},te=y.useId(),z=`${te}-email`,H=`${te}-email-error`,ve=`${te}-name`,we=`${te}-password`,Ee=`${te}-otp`,C=ge==="signUp",W=ge==="forgotPassword",R=ge==="emailOtp",se=ae({mutationFn:async({email:s,password:o,name:D})=>{try{const J=await d.submitEmailPassword({mode:C?"sign_up":"sign_in",email:s,password:o,name:D});if(J.error)throw new Error(J.error.message||(C?n.signUpFailed:n.signInFailed));return J}catch(J){throw J instanceof Error?J:new Error(n.authenticationFailed)}},onMutate:()=>{g({type:"started",method:"email_password",mode:C?"sign_up":"sign_in"})},onSuccess:()=>{g({type:"succeeded",method:"email_password",mode:C?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(r??e)},onError:s=>{g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),$(C?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),ne=ae({mutationFn:async({email:s})=>{const o=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(o.error)throw new Error(o.error.message||n.resetEmailFailed);return o},onSuccess:()=>{$("password_reset_requested"),ye(!0)},onError:s=>{$("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),K=ae({mutationFn:async({email:s})=>{const o=await d.sendOtp({email:s});if(o.error)throw new Error(o.error.message||n.otpSendFailed);return o},onMutate:()=>{g({type:"started",method:"email_otp"})},onSuccess:()=>{g({type:"otp_sent",method:"email_otp"}),$("email_otp_sent"),ue(!0)},onError:s=>{g({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),Y=ae({mutationFn:async({email:s,otp:o})=>{const D=await d.submitOtp({email:s,otp:o});if(D.error)throw new Error(D.error.message||n.invalidCode);return D},onMutate:()=>{g({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{g({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(r??e)},onError:s=>{g({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ie=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),fe=()=>{b.trim()&&!ie(b)&&Q(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}se.mutate({email:b,password:_,name:a})},Re=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail);return}ne.mutate({email:b})},De=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}K.mutate({email:b})},Me=s=>{s.preventDefault(),Y.mutate({email:b,otp:q})},G=s=>o=>{s(o.target.value),Se&&se.reset(),je&&ne.reset(),Ne&&(K.reset(),Y.reset()),s===M&&k&&Q("")},re=s=>{Le(s),S(""),T(""),ue(!1),Q(""),ye(!1),he(null),se.reset(),ne.reset(),K.reset(),Y.reset()},w=se.isPending||ne.isPending||K.isPending||Y.isPending,Se=se.error,je=ne.error,Ne=K.error||Y.error,U=C?b.trim()&&_.trim()&&a.trim():W?b.trim():R?L?q.trim():b.trim():b.trim()&&_.trim(),qe=s=>{if(!s)return null;const o=s.message.toLowerCase();return o.includes("unauthorized")||o.includes("401")?n.invalidEmailOrPassword:o.includes("already exists")||o.includes("409")?n.accountExists:o.includes("network")||o.includes("fetch")?n.networkError:o.includes("rate limit")||o.includes("429")?n.tooManyAttempts:o.includes("invalid")&&o.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=Se||je||Ne||Oe,We=async s=>{g({type:"started",method:"social",provider:s}),he(null);try{const o=await d.socialSignIn({provider:s,callbackURL:r??e});if(o.error)throw new Error(o.error.message||n.authenticationFailed)}catch(o){const D=o instanceof Error?o.message:String(o);g({type:"failed",method:"social",provider:s,stage:"redirect",error:D}),$("social_signin_failed",{provider:s,error:D}),he(o instanceof Error?o:new Error(D))}},Ue=W?n.resetPasswordTitle:R&&L?n.verificationCodeTitle:c??n.welcomeTitle,Ae=W?n.resetPasswordSubtitle:R&&L?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:j("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{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"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:j("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ae&&t.jsx("p",{className:j("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ae})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),be&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!W&&!(R&&L)&&O&&t.jsx("div",{className:"grid gap-2",children:x.map(s=>t.jsxs("button",{type:"button",disabled:w,onClick:()=>{We(s.name)},className:j("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:j("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!W&&!(R&&L)&&O&&(F||E.enabled)&&t.jsxs("div",{className:j("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:j("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),R&&E.enabled&&t.jsx(t.Fragment,{children:L?t.jsxs("form",{onSubmit:Me,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Ee,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(X,{id:Ee,type:"text",placeholder:n.enterCodePlaceholder,value:q,onChange:G(T),required:!0,disabled:w,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{ue(!1),T(""),K.reset(),Y.reset()},disabled:w,className:j("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:z,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive",children:k})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.sending:n.sendCode})]})}),W&&F&&!be&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive mt-1.5",children:k})]}),t.jsx(pe,{type:"submit",disabled:w||!U,className:"w-full font-semibold",size:"xl",children:w?n.sending:n.sendResetLink})]}),!W&&!R&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[C&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(X,{id:ve,type:"text",placeholder:n.namePlaceholder,value:a,onChange:G(S),required:!0,disabled:w,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(X,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:G(M),onBlur:fe,required:!0,disabled:w,autoComplete:"email","aria-invalid":!!k,"aria-describedby":k?H:void 0,className:"h-11 rounded-lg"}),k&&t.jsx("p",{id:H,role:"alert",className:"text-xs text-destructive mt-1.5",children:k})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!C&&v.enabled&&t.jsx("button",{type:"button",onClick:()=>re("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(X,{id:we,type:"password",placeholder:"••••••••",value:_,onChange:G(V),required:!0,disabled:w,autoComplete:C?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:j("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",U?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:j("p-1",!U&&"pointer-events-none"),children:t.jsx(pe,{type:"submit",disabled:w||!U,className:j("w-full font-semibold"),size:"xl","aria-hidden":!U,children:w?C?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:W?t.jsx("button",{type:"button",onClick:()=>re("signIn"),disabled:w,className:le,children:n.backToSignIn}):R&&F?t.jsx("button",{type:"button",onClick:()=>re("signIn"),disabled:w,className:le,children:n.signInWithPassword}):!R&&F?t.jsxs(t.Fragment,{children:[C?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>re(C?"signIn":"signUp"),disabled:w,className:le,children:C?n.signIn:n.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>re("emailOtp"),disabled:w,className:le,children:n.signInWithEmailCode})]})]}):null})]})}async function de(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const r=Be(),e=Ve(),c=$e({queryKey:oe.desktopAuthStatus(),queryFn:async()=>(await de()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=y.useState(!1),[m,i]=y.useState(null),[l,u]=y.useState(!1),[I,N]=y.useState(null);y.useEffect(()=>{},[e,r]);async function A(){p(!0),i(null);try{const d=await de();await d.performAuthLogin();const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}catch(d){i(d instanceof Error?d.message:"Sign-in failed")}finally{p(!1)}}async function v(){p(!0);try{const d=await de();await d.performAuthLogout();const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}finally{p(!1)}}async function E(){u(!0),N(null);let d;try{d=await de()}catch(g){N(g instanceof Error?g.message:"Sign-in failed"),u(!1);return}try{await d.performAuthCompleteSession()}catch(g){N(g instanceof Error?g.message:"Sign-in failed")}finally{try{const g=await d.fetchAuthStatus();r.setQueryData(oe.desktopAuthStatus(),g)}finally{u(!1)}}}async function h(){await c.refetch()}return{status:c.data,isChecking:c.isLoading,isRetryingStatus:c.isFetching,isPending:f,loginError:m,login:A,logout:v,isCompletingSession:l,completeSessionError:I,completeSession:E,retryStatus:h}}function Je(r){return!(r.emailAndPassword.enabled||r.emailOtp.enabled||r.socialProviders.enabled)&&!r.sso.enabled&&r.magicLink.enabled}function Xe(){return ce.c(10),Ge(),null}function Ze(r){const e=ce.c(25),{onContinue:c,isPending:f,error:p}=r,m=xe();let i;e[0]!==m?(i=m("common.authEntry.browserOnlyTitle"),e[0]=m,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:i}),e[2]=i,e[3]=l):l=e[3];let u;e[4]!==m?(u=m("common.authEntry.browserOnlyDescription"),e[4]=m,e[5]=u):u=e[5];let I;e[6]!==u?(I=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:u}),e[6]=u,e[7]=I):I=e[7];let N;e[8]!==l||e[9]!==I?(N=t.jsxs("div",{className:"flex flex-col gap-1",children:[l,I]}),e[8]=l,e[9]=I,e[10]=N):N=e[10];let A;e[11]!==c?(A=()=>{c()},e[11]=c,e[12]=A):A=e[12];let v;e[13]!==m?(v=m("common.authEntry.browserOnlyCta"),e[13]=m,e[14]=v):v=e[14];let E;e[15]!==f||e[16]!==A||e[17]!==v?(E=t.jsx(pe,{onClick:A,disabled:f,children:v}),e[15]=f,e[16]=A,e[17]=v,e[18]=E):E=e[18];let h;e[19]!==p?(h=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=h):h=e[20];let d;return e[21]!==N||e[22]!==E||e[23]!==h?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[N,E,h]}),e[21]=N,e[22]=E,e[23]=h,e[24]=d):d=e[24],d}function Ce(r){const e=ce.c(8),{label:c,error:f}=r;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let m;e[1]!==c?(m=c&&t.jsx("p",{className:"text-sm text-muted-foreground",children:c}),e[1]=c,e[2]=m):m=e[2];let i;e[3]!==f?(i=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=i):i=e[4];let l;return e[5]!==m||e[6]!==i?(l=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,m,i]}),e[5]=m,e[6]=i,e[7]=l):l=e[7],l}class Ie{constructor(e){this.response=e}response}function et(r){return r.startsWith("/")&&!r.startsWith("//")?r:"/"}function tt({redirectTo:r,onAuthEvent:e}){const c=xe(),[f,p]=y.useState(null),m=y.useEffectEvent(i=>{try{e?.(i)}catch{}});return y.useEffect(()=>{let i=!1;return(async()=>{m({type:"started",method:"local"});try{let l;try{l=await ze(async()=>{const u=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(u.status>=500)throw new Ie(u);return u},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(u){if(u instanceof He&&u.cause instanceof Ie)l=u.cause.response;else throw u}if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u?.error||c("common.authEntry.autoLoginFailed"))}i||(m({type:"succeeded",method:"local"}),window.location.href=et(r))}catch(l){i||(m({type:"failed",method:"local",stage:"authenticate",error:l instanceof Error?l.message:String(l)}),p(l instanceof Error?l.message:c("common.authEntry.autoLoginFailed")))}})(),()=>{i=!0}},[r]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:c("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:c("common.authEntry.tryRestartingServer")})]})}):t.jsx(Fe,{})}function st({callbackURL:r,providerId:e,ssoSignIn:c,onAuthEvent:f}){const p=y.useEffectEvent(i=>{try{f?.(i)}catch{}}),m=y.useEffectEvent(c);return y.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const i=await m({providerId:e,callbackURL:r});if(i.error)throw new Error(i.error.message||"SSO redirect failed")}catch(i){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:i instanceof Error?i.message:String(i)})}})()},[e,r]),t.jsx(Fe,{})}function lt(r){const e=ce.c(45),{callbackUrl:c,redirectUrl:f,allowAutoLogin:p,title:m,subtitle:i,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v}=r,E=p===void 0?!0:p,h=xe(),{sso:d,emailAndPassword:g,magicLink:P,emailOtp:Z,socialProviders:ee,localMode:me}=ke(),x=Xe(),O=f||c,F=x?.actions;let b;e[0]!==F?(b={..._e,...F},e[0]=F,e[1]=b):b=e[1];const M=b;if(x?.isPending){let a;e[2]!==h?(a=h("common.authEntry.finishSignInInBrowser"),e[2]=h,e[3]=a):a=e[3];let S;return e[4]!==x.loginError||e[5]!==a?(S=t.jsx(Ce,{label:a,error:x.loginError}),e[4]=x.loginError,e[5]=a,e[6]=S):S=e[6],S}if(x?.isCompletingSession){let a;e[7]!==h?(a=h("common.authEntry.finishingSignIn"),e[7]=h,e[8]=a):a=e[8];let S;return e[9]!==x.completeSessionError||e[10]!==a?(S=t.jsx(Ce,{label:a,error:x.completeSessionError}),e[9]=x.completeSessionError,e[10]=a,e[11]=S):S=e[11],S}if(me&&E){let a;return e[12]!==v||e[13]!==O?(a=t.jsx(tt,{redirectTo:O,onAuthEvent:v}),e[12]=v,e[13]=O,e[14]=a):a=e[14],a}if(d.enabled){let a;return e[15]!==v||e[16]!==O||e[17]!==M.ssoSignIn||e[18]!==d.providerId?(a=t.jsx(st,{callbackURL:O,providerId:d.providerId,ssoSignIn:M.ssoSignIn,onAuthEvent:v}),e[15]=v,e[16]=O,e[17]=M.ssoSignIn,e[18]=d.providerId,e[19]=a):a=e[19],a}if(x&&Je({emailAndPassword:g,emailOtp:Z,socialProviders:ee,magicLink:P,sso:d})){let a;return e[20]!==x.isPending||e[21]!==x.login||e[22]!==x.loginError?(a=t.jsx(Ze,{onContinue:x.login,isPending:x.isPending,error:x.loginError}),e[20]=x.isPending,e[21]=x.login,e[22]=x.loginError,e[23]=a):a=e[23],a}if(g.enabled||P.enabled||Z.enabled||ee.enabled){const a=x?.loginError??x?.completeSessionError??null;let S;e[24]!==A||e[25]!==N||e[26]!==l||e[27]!==c||e[28]!==u||e[29]!==v||e[30]!==F||e[31]!==f||e[32]!==i||e[33]!==m||e[34]!==I?(S=t.jsx(Ye,{redirectUrl:f,callbackUrl:c,title:m,subtitle:i,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v,actions:F}),e[24]=A,e[25]=N,e[26]=l,e[27]=c,e[28]=u,e[29]=v,e[30]=F,e[31]=f,e[32]=i,e[33]=m,e[34]=I,e[35]=S):S=e[35];const q=S;if(!a)return q;let T;e[36]!==a?(T=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[36]=a,e[37]=T):T=e[37];let L;return e[38]!==q||e[39]!==T?(L=t.jsxs("div",{className:"grid gap-4",children:[T,q]}),e[38]=q,e[39]=T,e[40]=L):L=e[40],L}let _;e[41]!==h?(_=h("common.authEntry.noLoginOptions"),e[41]=h,e[42]=_):_=e[42];let V;return e[43]!==_?(V=t.jsx("div",{children:_}),e[43]=_,e[44]=V):V=e[44],V}export{lt as A,Ge as u};
@@ -1 +1 @@
1
- import{c as g,m as p,j as f}from"./index-v4xr9fBY.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
1
+ import{c as g,m as p,j as f}from"./index-w4Kza-rK.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
@@ -1 +1 @@
1
- import"./index-v4xr9fBY.js";import{i as u,a as p}from"./mcp-oauth-xeI046T8.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
1
+ import"./index-w4Kza-rK.js";import{i as u,a as p}from"./mcp-oauth-D3T1jiFO.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
@@ -1 +1 @@
1
- import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-v4xr9fBY.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-BbzswsKi.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-CDi9V4K2.js";import{s as me}from"./Stars02-pjrDL108.js";import{a as ue}from"./DotsVertical-DNiWmGQW.js";import{s as de}from"./Trash01-CQlBG8ML.js";import{i as fe}from"./Zap-DSrBTwKT.js";import{u as ge}from"./use-virtual-mcp-kUy0NdbH.js";import{A as xe}from"./agent-icon-B0dE0gXI.js";import{u as pe}from"./use-automations-k3FdbNQZ.js";function ke(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=ge(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(xe,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(ue,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(de,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(me,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(fe,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{ke as A};
1
+ import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-w4Kza-rK.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-B5U5wY1n.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-BqEwoGS-.js";import{s as me}from"./Stars02-hS3VtVKb.js";import{a as ue}from"./DotsVertical-CLT4z1eM.js";import{s as de}from"./Trash01-Lta4-dBB.js";import{i as fe}from"./Zap-DzsOPqEB.js";import{u as ge}from"./use-virtual-mcp-DezThwv0.js";import{A as xe}from"./agent-icon-QsGAUDhV.js";import{u as pe}from"./use-automations-BHklCdet.js";function ke(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=ge(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(xe,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(ue,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(de,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(me,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(fe,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{ke as A};
@@ -1,4 +1,4 @@
1
- import{r as z,c as V,Z as Ux,j as m,B as tn,Y as jm,X as Hx,_ as jx,bn as lf,ax as Zt,bD as Ca,b as ue,H as $x,m as Te,d as Dn,f as zx,p as qx,aB as Gx,ay as hn,aF as Vx,aE as fn,bC as Yr,aC as Mn,bE as Iy,aA as Ny,F as $t,o as Wx,e as Yx,K as xt,t as mp,n as Kr,E as vy,aw as Cy,bF as uf,aD as Kx,bG as An}from"./index-v4xr9fBY.js";import{e as Xx}from"./select-c9MOlhi4.js";import{u as Ry}from"./useInfiniteQuery-Dd4ko7id.js";import{a as wy,u as Zx}from"./use-connection-Cx1i_8ZN.js";import{j as Qx,u as cf,f as Jx,i as ek,a as tk,S as nk}from"./use-mcp-client-DspygOPp.js";import{a as rk}from"./use-virtual-mcp-kUy0NdbH.js";import{C as ak}from"./card-y0dhwXnt.js";import{o as Oy,m as Ly,p as df,q as pf}from"./sidebar-Bn8O7Aoo.js";import{c as Dy,e as My,a as Ti,d as yt,b as Py,T as St}from"./table-YqpfKi5R.js";import{E as hp}from"./empty-state-CRcUb-lZ.js";import{u as ff}from"./use-infinite-scroll-KjXcCgnB.js";import{u as ik}from"./use-members-Dbnerenq.js";import{u as Fy,S as Kn}from"./use-clock-tick-Bx9BIbXn.js";import{e as sk}from"./use-automations-k3FdbNQZ.js";import{u as By}from"./studio-tools-Xw-8BkV3.js";import{u as ok}from"./useSuspenseInfiniteQuery-OE3RI5rq.js";import{A as Uy}from"./avatar-PyzDD5US.js";import{t as Ra}from"./ChevronDown-CClFlSxz.js";import{n as gp}from"./ChevronUp-BMENMqPe.js";import{n as mf,t as lk,c as Hy,i as uk,a as hf}from"./Tool02-CdAHKhSP.js";import{aP as ck,aQ as dk,h as pk,aR as fk,aS as mk,a7 as hk,F as gk,aT as bk,ae as Ek,i as $m,aw as Tk,D as yk,m as Sk,aU as Ak,aN as jy,aV as _k,A as $y,aW as Ht,aX as xk,n as kk}from"./agent-icon-B0dE0gXI.js";import{t as yi}from"./Stars01-3Jc0GjIj.js";import{i as zy,b as sa}from"./XCircle-BmPLYPUm.js";import{i as Xr}from"./Check-CzuAentr.js";import{i as zm}from"./ChevronRight-uevwIauT.js";import{a as Si}from"./Copy01-DKc_cNPS.js";import{b as mn,t as gf,c as qm}from"./format-time-BnbuEtat.js";import{u as qy}from"./use-copy-B2wy-3nw.js";import{T as vn,a as Cn,c as Rn}from"./tooltip-CzcvFJJ4.js";import{b as Gy,a as Ik,c as Nk,d as vk,e as Vy,g as Ck,f as Rk}from"./dialog-umfUtb99.js";import{u as wk}from"./use-mobile-C-mJw8PU.js";import{h as Ok,f as Lk,o as Dk,q as Mk}from"./tab-id-WKHool93.js";import{R as Pk,c as Fk,r as Bk,d as Uk}from"./hooks-BfI5-YVe.js";import{l as nr,D as Hk,b as bf,d as Wy,a as jk}from"./chat-context-DMUQz7NG.js";import{c as $k}from"./monaco-editor-Cv0goHEj.js";import{g as Yy,M as zk}from"./index-DZHjNDS2.js";import{N as ct,R as qk,l as Gk,a as kt,m as Vk,F as Gm,S as Ky,T as kn,n as Wk,o as Ef,D as Br,j as Ai,p as Ur,P as Ct,q as Yk,f as Rt,r as Kk,s as Xk,v as Zk,w as Xy,x as Xn,y as $e,z as rr,A as wn,B as Zn,G as bp,H as Qk,I as Jk,J as eI,K as tI,L as nI,O as rI,Q as aI,U as Zy,V as Ep,W as iI,X as sI,Y as Qy,Z as oI,_ as lI,$ as Vm,t as uI,a0 as wt,a1 as ar,c as cI,u as dI,M as pI,e as fI}from"./calendar-Bja0SUOs.js";import{i as Jy}from"./AlertCircle-CJIb11xM.js";import{s as mI}from"./Eye-CLJlIW72.js";import{s as wa,t as eS}from"./Star01-vKIuVNvK.js";import{s as hI}from"./XClose-pCZ95Skb.js";import{n as Tp}from"./ZapSquare-lUH8oMSf.js";import{d as gI,c as bI,a as oa}from"./Tool01-BqM3fhvU.js";import{i as Ar}from"./Monitor01-Cq5ooC-g.js";import{i as EI}from"./SearchMd-EJtaQP9g.js";import{i as TI}from"./Upload01-bMCburYR.js";import{u as yI,a as SI}from"./shell-layout-CikXXWSF.js";import{n as tS}from"./LinkExternal01-Bmn2On3L.js";import{I as gn}from"./integration-icon-CNZB1ZgI.js";import{i as AI}from"./ArrowUpRight-DY5OrDCo.js";import{a as Tf}from"./Users03-DjFIwR1e.js";import{a as jt}from"./Palette-DfxMP9C1.js";import{c as nS}from"./use-navigate-to-agent-DSBbiXfY.js";import{a as _I}from"./Stars02-pjrDL108.js";import{g as xI}from"./AreaChart-BD-p9vcZ.js";import{a as kI,F as II,b as NI,c as vI,d as CI,e as RI}from"./form-C-C_sOUC.js";import{I as wI}from"./input-BhxRA_PT.js";import{S as OI}from"./spinner-B-_zF0cw.js";const LI={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function rS(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(LI)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function aS(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function iS(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+rS(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function pz(t){return t.reduce((e,n)=>iS(e,n.metadata?.usage),aS())}const DI={damping:.7,stiffness:.05,mass:1.25},MI=70,PI=1e3/60,FI=350;let _i=!1;globalThis.document?.addEventListener("mousedown",()=>{_i=!0});globalThis.document?.addEventListener("mouseup",()=>{_i=!1});globalThis.document?.addEventListener("click",()=>{_i=!1});const BI=(t={})=>{const[e,n]=z.useState(!1),[r,a]=z.useState(t.initial!==!1),[i,s]=z.useState(!1),o=z.useRef(null);o.current=t;const l=z.useCallback(()=>{if(!_i)return!1;const y=window.getSelection();if(!y||!y.rangeCount)return!1;const A=y.getRangeAt(0);return A.commonAncestorContainer.contains(T.current)||T.current?.contains(A.commonAncestorContainer)},[]),u=z.useCallback(y=>{c.isAtBottom=y,a(y)},[]),d=z.useCallback(y=>{c.escapedFromLock=y,n(y)},[]),c=z.useMemo(()=>{let y;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return T.current?.scrollTop??0},set scrollTop(A){if(T.current){const{scrollBehavior:_}=getComputedStyle(T.current);_!=="auto"&&(T.current.style.scrollBehavior="auto"),T.current.scrollTop=A,c.ignoreScrollToTop=T.current.scrollTop,_!=="auto"&&(T.current.style.scrollBehavior=_)}},get targetScrollTop(){return!T.current||!S.current?0:T.current.scrollHeight-1-T.current.clientHeight},get calculatedTargetScrollTop(){if(!T.current||!S.current)return 0;const{targetScrollTop:A}=this;if(!t.targetScrollTop)return A;if(y?.targetScrollTop===A)return y.calculatedScrollTop;const _=Math.max(Math.min(t.targetScrollTop(A,{scrollElement:T.current,contentElement:S.current}),A),0);return y={targetScrollTop:A,calculatedScrollTop:_},requestAnimationFrame(()=>{y=void 0}),_},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=MI}}},[]),p=z.useCallback((y={})=>{typeof y=="string"&&(y={animation:y}),y.preserveScrollPosition||u(!0);const A=Date.now()+(Number(y.wait)||0),_=Qi(o.current,y.animation),{ignoreEscapes:k=!1}=y;let E,x=c.calculatedTargetScrollTop;y.duration instanceof Promise?y.duration.finally(()=>{E=Date.now()}):E=A+(y.duration??0);const v=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:I}=c,L=performance.now(),M=(L-(c.lastTick??L))/PI;if(c.animation||(c.animation={behavior:_,promise:N,ignoreEscapes:k}),c.animation.behavior===_&&(c.lastTick=L),l()||A>Date.now())return v();if(I<Math.min(x,c.calculatedTargetScrollTop)){if(c.animation?.behavior===_){if(_==="instant")return c.scrollTop=c.calculatedTargetScrollTop,v();c.velocity=(_.damping*c.velocity+_.stiffness*c.scrollDifference)/_.mass,c.accumulated+=c.velocity*M,c.scrollTop+=c.accumulated,c.scrollTop!==I&&(c.accumulated=0)}return v()}return E>Date.now()?(x=c.calculatedTargetScrollTop,v()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?p({animation:Qi(o.current,o.current.resize),ignoreEscapes:k,duration:Math.max(0,E-Date.now())||void 0}):c.isAtBottom)});return N.then(I=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),I))};return y.wait!==!0&&(c.animation=void 0),c.animation?.behavior===_?c.animation.promise:v()},[u,l,c]),f=z.useCallback(()=>{d(!0),u(!1)},[d,u]),g=z.useCallback(({target:y})=>{if(y!==T.current)return;const{scrollTop:A,ignoreScrollToTop:_}=c;let{lastScrollTop:k=A}=c;c.lastScrollTop=A,c.ignoreScrollToTop=void 0,_&&_>A&&(k=_),s(c.isNearBottom),setTimeout(()=>{if(c.resizeDifference||A===_)return;if(l()){d(!0),u(!1);return}const E=A>k,x=A<k;if(c.animation?.ignoreEscapes){c.scrollTop=k;return}x&&(d(!0),u(!1)),E&&d(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[d,u,l,c]),b=z.useCallback(({target:y,deltaY:A})=>{let _=y;for(;!["scroll","auto"].includes(getComputedStyle(_).overflow);){if(!_.parentElement)return;_=_.parentElement}_===T.current&&A<0&&T.current.scrollHeight>T.current.clientHeight&&!c.animation?.ignoreEscapes&&(d(!0),u(!1))},[d,u,c]),T=Wm(y=>{T.current?.removeEventListener("scroll",g),T.current?.removeEventListener("wheel",b),y?.addEventListener("scroll",g,{passive:!0}),y?.addEventListener("wheel",b,{passive:!0})},[]),S=Wm(y=>{if(c.resizeObserver?.disconnect(),c.resizeObserver=void 0,!y)return;let A;c.resizeObserver=new ResizeObserver(([_])=>{const{height:k}=_.contentRect,E=k-(A??k);if(c.resizeDifference=E,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),s(c.isNearBottom),E>=0){const x=Qi(o.current,A?o.current.resize:o.current.initial);p({animation:x,wait:!0,preserveScrollPosition:!0,duration:x==="instant"?void 0:FI})}else c.isNearBottom&&(d(!1),u(!0));A=k,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===E&&(c.resizeDifference=0)},1)})}),c.resizeObserver?.observe(y)},[]);return{contentRef:S,scrollRef:T,scrollToBottom:p,stopScroll:f,isAtBottom:r||i,isNearBottom:i,escapedFromLock:e,state:c}};function Wm(t,e){const n=z.useCallback(r=>(n.current=r,t(r)),e);return n}const Zi=new Map;function Qi(...t){const e={...DI};let n=!1;for(const a of t){if(a==="instant"){n=!0;continue}typeof a=="object"&&(n=!1,e.damping=a.damping??e.damping,e.stiffness=a.stiffness??e.stiffness,e.mass=a.mass??e.mass)}const r=JSON.stringify(e);return Zi.has(r)||Zi.set(r,Object.freeze(e)),n?"instant":Zi.get(r)}function UI(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function yf(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Sf(t,e){if(!e)return t;const n=`${UI(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function HI(t,e){return Sf(t,e).replace(/[_-]/g," ").toLowerCase()}function jI(t){const e={};for(const n of t?.arguments??[])e[n.name]=n.required?jm().min(1,"Required"):jm();return Hx(e)}function $I(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function zI(t){const e=V.c(67),{prompt:n,setPrompt:r,onSubmit:a,defaultValues:i}=t,s=z.useId();let o,l;if(e[0]!==n){const $=jI(n);l=jx,o=Ux($),e[0]=n,e[1]=o,e[2]=l}else o=e[1],l=e[2];let u;e[3]!==i||e[4]!==n?(u=n?$I(n,i):{},e[3]=i,e[4]=n,e[5]=u):u=e[5];let d;e[6]!==o||e[7]!==u?(d={resolver:o,defaultValues:u,mode:"onChange"},e[6]=o,e[7]=u,e[8]=d):d=e[8];const c=l(d);let p;e[9]!==n?.arguments?(p=n?.arguments??[],e[9]=n?.arguments,e[10]=p):p=e[10];const f=p;let g;e[11]!==c||e[12]!==a||e[13]!==r?(g=async $=>{await a($),r(null),c.reset()},e[11]=c,e[12]=a,e[13]=r,e[14]=g):g=e[14];const b=g;let T;e[15]!==c||e[16]!==r?(T=$=>{$||(c.reset(),r(null))},e[15]=c,e[16]=r,e[17]=T):T=e[17];const S=T;if(!n)return null;let y;e[18]!==n._meta||e[19]!==n.name||e[20]!==n.title?(y=n.title||HI(n.name,yf(n._meta)),e[18]=n._meta,e[19]=n.name,e[20]=n.title,e[21]=y):y=e[21];let A;e[22]!==y?(A=m.jsx(Gy,{children:m.jsx("span",{className:"capitalize",children:y})}),e[22]=y,e[23]=A):A=e[23];let _;e[24]!==n.description?(_=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=_):_=e[25];let k;e[26]!==_||e[27]!==A?(k=m.jsxs(Ik,{children:[A,_]}),e[26]=_,e[27]=A,e[28]=k):k=e[28];let E;e[29]!==c||e[30]!==b?(E=$=>{$.stopPropagation(),c.handleSubmit(b)($)},e[29]=c,e[30]=b,e[31]=E):E=e[31];let x;if(e[32]!==f||e[33]!==c.control||e[34]!==c.formState.isSubmitting){let $;e[36]!==c.control||e[37]!==c.formState.isSubmitting?($=G=>m.jsx(II,{control:c.control,name:G.name,render:X=>{const{field:R}=X;return m.jsxs(NI,{children:[m.jsxs(vI,{className:"text-xs",children:[G.name,G.required?null:m.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),m.jsx(CI,{children:m.jsx(wI,{...R,value:R.value??"",required:G.required,placeholder:G.description??"",className:"h-9",disabled:c.formState.isSubmitting})}),m.jsx(RI,{})]})}},G.name),e[36]=c.control,e[37]=c.formState.isSubmitting,e[38]=$):$=e[38],x=f.map($),e[32]=f,e[33]=c.control,e[34]=c.formState.isSubmitting,e[35]=x}else x=e[35];let v;e[39]!==S?(v=()=>S(!1),e[39]=S,e[40]=v):v=e[40];let N;e[41]!==c.formState.isSubmitting||e[42]!==v?(N=m.jsx(tn,{type:"button",variant:"ghost",onClick:v,disabled:c.formState.isSubmitting,children:"Cancel"}),e[41]=c.formState.isSubmitting,e[42]=v,e[43]=N):N=e[43];let I;e[44]!==c.formState.isSubmitting?(I=c.formState.isSubmitting?m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(OI,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=c.formState.isSubmitting,e[45]=I):I=e[45];let L;e[46]!==c.formState.isSubmitting||e[47]!==s||e[48]!==I?(L=m.jsx(tn,{type:"submit",form:s,disabled:c.formState.isSubmitting,children:I}),e[46]=c.formState.isSubmitting,e[47]=s,e[48]=I,e[49]=L):L=e[49];let M;e[50]!==N||e[51]!==L?(M=m.jsxs(Nk,{children:[N,L]}),e[50]=N,e[51]=L,e[52]=M):M=e[52];let U;e[53]!==s||e[54]!==E||e[55]!==x||e[56]!==M?(U=m.jsxs("form",{id:s,className:"space-y-4 py-4",autoComplete:"off",onSubmit:E,children:[x,M]}),e[53]=s,e[54]=E,e[55]=x,e[56]=M,e[57]=U):U=e[57];let F;e[58]!==c||e[59]!==U?(F=m.jsx(kI,{...c,children:U}),e[58]=c,e[59]=U,e[60]=F):F=e[60];let P;e[61]!==k||e[62]!==F?(P=m.jsxs(vk,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[k,F]}),e[61]=k,e[62]=F,e[63]=P):P=e[63];let B;return e[64]!==S||e[65]!==P?(B=m.jsx(Vy,{open:!0,onOpenChange:S,children:P}),e[64]=S,e[65]=P,e[66]=B):B=e[66],B}const qI=/^mcp__[a-zA-Z0-9_-]+__/;function sS(t){return t.replace(qI,"")}function Af(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pn=Af();function oS(t){Pn=t}var _r={exec:()=>null};function ve(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(a,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(it.caret,"$1"),n=n.replace(a,s),r},getRegex:()=>new RegExp(n,e)};return r}var it={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},GI=/^(?:[ \t]*(?:\n|$))+/,VI=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,WI=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,YI=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_f=/(?:[*+-]|\d{1,9}[.)])/,lS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uS=ve(lS).replace(/bull/g,_f).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),KI=ve(lS).replace(/bull/g,_f).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XI=/^[^\n]+/,kf=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ZI=ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),QI=ve(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_f).getRegex(),xi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",If=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,JI=ve("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",If).replace("tag",xi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cS=ve(xf).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex(),eN=ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cS).getRegex(),Nf={blockquote:eN,code:VI,def:ZI,fences:WI,heading:YI,hr:Zr,html:JI,lheading:uS,list:QI,newline:GI,paragraph:cS,table:_r,text:XI},Ym=ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex(),tN={...Nf,lheading:KI,table:Ym,paragraph:ve(xf).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ym).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex()},nN={...Nf,html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",If).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ve(xf).replace("hr",Zr).replace("heading",` *#{1,6} *[^
1
+ import{r as z,c as V,Z as Ux,j as m,B as tn,Y as jm,X as Hx,_ as jx,bn as lf,ax as Zt,bD as Ca,b as ue,H as $x,m as Te,d as Dn,f as zx,p as qx,aB as Gx,ay as hn,aF as Vx,aE as fn,bC as Yr,aC as Mn,bE as Iy,aA as Ny,F as $t,o as Wx,e as Yx,K as xt,t as mp,n as Kr,E as vy,aw as Cy,bF as uf,aD as Kx,bG as An}from"./index-w4Kza-rK.js";import{e as Xx}from"./select-B-YdeuWd.js";import{u as Ry}from"./useInfiniteQuery-DNUr1sdD.js";import{a as wy,u as Zx}from"./use-connection-BUo2sigQ.js";import{j as Qx,u as cf,f as Jx,i as ek,a as tk,S as nk}from"./use-mcp-client-iPC50X8f.js";import{a as rk}from"./use-virtual-mcp-DezThwv0.js";import{C as ak}from"./card-Cc4Sk9Cg.js";import{o as Oy,m as Ly,p as df,q as pf}from"./sidebar-DWgS242X.js";import{c as Dy,e as My,a as Ti,d as yt,b as Py,T as St}from"./table-Dj0pa7qr.js";import{E as hp}from"./empty-state-CP56BOYX.js";import{u as ff}from"./use-infinite-scroll-DDo__zqC.js";import{u as ik}from"./use-members-oSMhXQpq.js";import{u as Fy,S as Kn}from"./use-clock-tick-Bg7iwLiT.js";import{e as sk}from"./use-automations-BHklCdet.js";import{u as By}from"./studio-tools-BylTF4-U.js";import{u as ok}from"./useSuspenseInfiniteQuery-BQFc-ofx.js";import{A as Uy}from"./avatar-_7MnLC1x.js";import{t as Ra}from"./ChevronDown-CSrIpSEZ.js";import{n as gp}from"./ChevronUp-DwmhjoAn.js";import{n as mf,t as lk,c as Hy,i as uk,a as hf}from"./Tool02-DD_vhYh6.js";import{aN as ck,aO as dk,h as pk,aP as fk,aQ as mk,a7 as hk,F as gk,aR as bk,ae as Ek,i as $m,au as Tk,D as yk,m as Sk,aS as Ak,aL as jy,aT as _k,A as $y,aU as Ht,aV as xk,n as kk}from"./agent-icon-QsGAUDhV.js";import{t as yi}from"./Stars01-szhvpQET.js";import{i as zy,b as sa}from"./XCircle-TzZ5I8PA.js";import{i as Xr}from"./Check-GfWraBFp.js";import{i as zm}from"./ChevronRight-CTT8T1J0.js";import{a as Si}from"./Copy01--ZOTzkPA.js";import{b as mn,t as gf,c as qm}from"./format-time-BnbuEtat.js";import{u as qy}from"./use-copy-BZ1uzFBm.js";import{T as vn,a as Cn,c as Rn}from"./tooltip-D7StMLxc.js";import{b as Gy,a as Ik,c as Nk,d as vk,e as Vy,g as Ck,f as Rk}from"./dialog-CGIzImjA.js";import{u as wk}from"./use-mobile-B7cyaUDa.js";import{h as Ok,f as Lk,o as Dk,q as Mk}from"./tab-id-Dl1o9iNc.js";import{R as Pk,c as Fk,r as Bk,d as Uk}from"./hooks-c93_ex0y.js";import{l as nr,D as Hk,b as bf,d as Wy,a as jk}from"./chat-context-BIm2blRr.js";import{c as $k}from"./monaco-editor-cBR-B6jK.js";import{g as Yy,M as zk}from"./index-D3-5x7iS.js";import{N as ct,R as qk,n as Gk,a as kt,o as Vk,F as Gm,S as Ky,T as kn,p as Wk,q as Ef,D as Br,k as Ai,r as Ur,P as Ct,s as Yk,f as Rt,v as Kk,w as Xk,x as Zk,y as Xy,z as Xn,m as $e,h as rr,A as wn,B as Zn,G as bp,H as Qk,I as Jk,J as eI,K as tI,L as nI,O as rI,Q as aI,U as Zy,V as Ep,W as iI,X as sI,Y as Qy,Z as oI,_ as lI,$ as Vm,t as uI,a0 as wt,a1 as ar,c as cI,u as dI,M as pI,e as fI}from"./calendar-c2b6er6e.js";import{i as Jy}from"./AlertCircle-DrATK--G.js";import{s as mI}from"./Eye-CKSKAoUm.js";import{s as wa,t as eS}from"./Star01-Dqavdch8.js";import{s as hI}from"./XClose-CcQyyEDk.js";import{n as Tp}from"./ZapSquare-N_iAx6EQ.js";import{d as gI,c as bI,a as oa}from"./Tool01-Dhc4ao7G.js";import{i as Ar}from"./Monitor01-Cg1SkWzI.js";import{i as EI}from"./SearchMd-BI0XFlBK.js";import{i as TI}from"./Upload01-BQ9GWbOC.js";import{u as yI,a as SI}from"./shell-layout-DSa8T0M4.js";import{n as tS}from"./LinkExternal01-BBpoOd9O.js";import{I as gn}from"./integration-icon-D7Hr4PuO.js";import{i as AI}from"./ArrowUpRight-CGNmznYx.js";import{a as Tf}from"./Users03-lqPHwKgJ.js";import{a as jt}from"./Palette-CsAExMG_.js";import{c as nS}from"./use-navigate-to-agent-DBC7w0Dc.js";import{a as _I}from"./Stars02-hS3VtVKb.js";import{g as xI}from"./AreaChart-Ba9Ms0ch.js";import{a as kI,F as II,b as NI,c as vI,d as CI,e as RI}from"./form-B1Je5WWi.js";import{I as wI}from"./input-DVK3DIEk.js";import{S as OI}from"./spinner-kz0fXsFk.js";const LI={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function rS(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(LI)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function aS(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function iS(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+rS(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function pz(t){return t.reduce((e,n)=>iS(e,n.metadata?.usage),aS())}const DI={damping:.7,stiffness:.05,mass:1.25},MI=70,PI=1e3/60,FI=350;let _i=!1;globalThis.document?.addEventListener("mousedown",()=>{_i=!0});globalThis.document?.addEventListener("mouseup",()=>{_i=!1});globalThis.document?.addEventListener("click",()=>{_i=!1});const BI=(t={})=>{const[e,n]=z.useState(!1),[r,a]=z.useState(t.initial!==!1),[i,s]=z.useState(!1),o=z.useRef(null);o.current=t;const l=z.useCallback(()=>{if(!_i)return!1;const y=window.getSelection();if(!y||!y.rangeCount)return!1;const A=y.getRangeAt(0);return A.commonAncestorContainer.contains(T.current)||T.current?.contains(A.commonAncestorContainer)},[]),u=z.useCallback(y=>{c.isAtBottom=y,a(y)},[]),d=z.useCallback(y=>{c.escapedFromLock=y,n(y)},[]),c=z.useMemo(()=>{let y;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return T.current?.scrollTop??0},set scrollTop(A){if(T.current){const{scrollBehavior:_}=getComputedStyle(T.current);_!=="auto"&&(T.current.style.scrollBehavior="auto"),T.current.scrollTop=A,c.ignoreScrollToTop=T.current.scrollTop,_!=="auto"&&(T.current.style.scrollBehavior=_)}},get targetScrollTop(){return!T.current||!S.current?0:T.current.scrollHeight-1-T.current.clientHeight},get calculatedTargetScrollTop(){if(!T.current||!S.current)return 0;const{targetScrollTop:A}=this;if(!t.targetScrollTop)return A;if(y?.targetScrollTop===A)return y.calculatedScrollTop;const _=Math.max(Math.min(t.targetScrollTop(A,{scrollElement:T.current,contentElement:S.current}),A),0);return y={targetScrollTop:A,calculatedScrollTop:_},requestAnimationFrame(()=>{y=void 0}),_},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=MI}}},[]),p=z.useCallback((y={})=>{typeof y=="string"&&(y={animation:y}),y.preserveScrollPosition||u(!0);const A=Date.now()+(Number(y.wait)||0),_=Qi(o.current,y.animation),{ignoreEscapes:k=!1}=y;let E,x=c.calculatedTargetScrollTop;y.duration instanceof Promise?y.duration.finally(()=>{E=Date.now()}):E=A+(y.duration??0);const v=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:I}=c,L=performance.now(),M=(L-(c.lastTick??L))/PI;if(c.animation||(c.animation={behavior:_,promise:N,ignoreEscapes:k}),c.animation.behavior===_&&(c.lastTick=L),l()||A>Date.now())return v();if(I<Math.min(x,c.calculatedTargetScrollTop)){if(c.animation?.behavior===_){if(_==="instant")return c.scrollTop=c.calculatedTargetScrollTop,v();c.velocity=(_.damping*c.velocity+_.stiffness*c.scrollDifference)/_.mass,c.accumulated+=c.velocity*M,c.scrollTop+=c.accumulated,c.scrollTop!==I&&(c.accumulated=0)}return v()}return E>Date.now()?(x=c.calculatedTargetScrollTop,v()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?p({animation:Qi(o.current,o.current.resize),ignoreEscapes:k,duration:Math.max(0,E-Date.now())||void 0}):c.isAtBottom)});return N.then(I=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),I))};return y.wait!==!0&&(c.animation=void 0),c.animation?.behavior===_?c.animation.promise:v()},[u,l,c]),f=z.useCallback(()=>{d(!0),u(!1)},[d,u]),g=z.useCallback(({target:y})=>{if(y!==T.current)return;const{scrollTop:A,ignoreScrollToTop:_}=c;let{lastScrollTop:k=A}=c;c.lastScrollTop=A,c.ignoreScrollToTop=void 0,_&&_>A&&(k=_),s(c.isNearBottom),setTimeout(()=>{if(c.resizeDifference||A===_)return;if(l()){d(!0),u(!1);return}const E=A>k,x=A<k;if(c.animation?.ignoreEscapes){c.scrollTop=k;return}x&&(d(!0),u(!1)),E&&d(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[d,u,l,c]),b=z.useCallback(({target:y,deltaY:A})=>{let _=y;for(;!["scroll","auto"].includes(getComputedStyle(_).overflow);){if(!_.parentElement)return;_=_.parentElement}_===T.current&&A<0&&T.current.scrollHeight>T.current.clientHeight&&!c.animation?.ignoreEscapes&&(d(!0),u(!1))},[d,u,c]),T=Wm(y=>{T.current?.removeEventListener("scroll",g),T.current?.removeEventListener("wheel",b),y?.addEventListener("scroll",g,{passive:!0}),y?.addEventListener("wheel",b,{passive:!0})},[]),S=Wm(y=>{if(c.resizeObserver?.disconnect(),c.resizeObserver=void 0,!y)return;let A;c.resizeObserver=new ResizeObserver(([_])=>{const{height:k}=_.contentRect,E=k-(A??k);if(c.resizeDifference=E,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),s(c.isNearBottom),E>=0){const x=Qi(o.current,A?o.current.resize:o.current.initial);p({animation:x,wait:!0,preserveScrollPosition:!0,duration:x==="instant"?void 0:FI})}else c.isNearBottom&&(d(!1),u(!0));A=k,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===E&&(c.resizeDifference=0)},1)})}),c.resizeObserver?.observe(y)},[]);return{contentRef:S,scrollRef:T,scrollToBottom:p,stopScroll:f,isAtBottom:r||i,isNearBottom:i,escapedFromLock:e,state:c}};function Wm(t,e){const n=z.useCallback(r=>(n.current=r,t(r)),e);return n}const Zi=new Map;function Qi(...t){const e={...DI};let n=!1;for(const a of t){if(a==="instant"){n=!0;continue}typeof a=="object"&&(n=!1,e.damping=a.damping??e.damping,e.stiffness=a.stiffness??e.stiffness,e.mass=a.mass??e.mass)}const r=JSON.stringify(e);return Zi.has(r)||Zi.set(r,Object.freeze(e)),n?"instant":Zi.get(r)}function UI(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function yf(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Sf(t,e){if(!e)return t;const n=`${UI(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function HI(t,e){return Sf(t,e).replace(/[_-]/g," ").toLowerCase()}function jI(t){const e={};for(const n of t?.arguments??[])e[n.name]=n.required?jm().min(1,"Required"):jm();return Hx(e)}function $I(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function zI(t){const e=V.c(67),{prompt:n,setPrompt:r,onSubmit:a,defaultValues:i}=t,s=z.useId();let o,l;if(e[0]!==n){const $=jI(n);l=jx,o=Ux($),e[0]=n,e[1]=o,e[2]=l}else o=e[1],l=e[2];let u;e[3]!==i||e[4]!==n?(u=n?$I(n,i):{},e[3]=i,e[4]=n,e[5]=u):u=e[5];let d;e[6]!==o||e[7]!==u?(d={resolver:o,defaultValues:u,mode:"onChange"},e[6]=o,e[7]=u,e[8]=d):d=e[8];const c=l(d);let p;e[9]!==n?.arguments?(p=n?.arguments??[],e[9]=n?.arguments,e[10]=p):p=e[10];const f=p;let g;e[11]!==c||e[12]!==a||e[13]!==r?(g=async $=>{await a($),r(null),c.reset()},e[11]=c,e[12]=a,e[13]=r,e[14]=g):g=e[14];const b=g;let T;e[15]!==c||e[16]!==r?(T=$=>{$||(c.reset(),r(null))},e[15]=c,e[16]=r,e[17]=T):T=e[17];const S=T;if(!n)return null;let y;e[18]!==n._meta||e[19]!==n.name||e[20]!==n.title?(y=n.title||HI(n.name,yf(n._meta)),e[18]=n._meta,e[19]=n.name,e[20]=n.title,e[21]=y):y=e[21];let A;e[22]!==y?(A=m.jsx(Gy,{children:m.jsx("span",{className:"capitalize",children:y})}),e[22]=y,e[23]=A):A=e[23];let _;e[24]!==n.description?(_=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=_):_=e[25];let k;e[26]!==_||e[27]!==A?(k=m.jsxs(Ik,{children:[A,_]}),e[26]=_,e[27]=A,e[28]=k):k=e[28];let E;e[29]!==c||e[30]!==b?(E=$=>{$.stopPropagation(),c.handleSubmit(b)($)},e[29]=c,e[30]=b,e[31]=E):E=e[31];let x;if(e[32]!==f||e[33]!==c.control||e[34]!==c.formState.isSubmitting){let $;e[36]!==c.control||e[37]!==c.formState.isSubmitting?($=G=>m.jsx(II,{control:c.control,name:G.name,render:X=>{const{field:R}=X;return m.jsxs(NI,{children:[m.jsxs(vI,{className:"text-xs",children:[G.name,G.required?null:m.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),m.jsx(CI,{children:m.jsx(wI,{...R,value:R.value??"",required:G.required,placeholder:G.description??"",className:"h-9",disabled:c.formState.isSubmitting})}),m.jsx(RI,{})]})}},G.name),e[36]=c.control,e[37]=c.formState.isSubmitting,e[38]=$):$=e[38],x=f.map($),e[32]=f,e[33]=c.control,e[34]=c.formState.isSubmitting,e[35]=x}else x=e[35];let v;e[39]!==S?(v=()=>S(!1),e[39]=S,e[40]=v):v=e[40];let N;e[41]!==c.formState.isSubmitting||e[42]!==v?(N=m.jsx(tn,{type:"button",variant:"ghost",onClick:v,disabled:c.formState.isSubmitting,children:"Cancel"}),e[41]=c.formState.isSubmitting,e[42]=v,e[43]=N):N=e[43];let I;e[44]!==c.formState.isSubmitting?(I=c.formState.isSubmitting?m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(OI,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=c.formState.isSubmitting,e[45]=I):I=e[45];let L;e[46]!==c.formState.isSubmitting||e[47]!==s||e[48]!==I?(L=m.jsx(tn,{type:"submit",form:s,disabled:c.formState.isSubmitting,children:I}),e[46]=c.formState.isSubmitting,e[47]=s,e[48]=I,e[49]=L):L=e[49];let M;e[50]!==N||e[51]!==L?(M=m.jsxs(Nk,{children:[N,L]}),e[50]=N,e[51]=L,e[52]=M):M=e[52];let U;e[53]!==s||e[54]!==E||e[55]!==x||e[56]!==M?(U=m.jsxs("form",{id:s,className:"space-y-4 py-4",autoComplete:"off",onSubmit:E,children:[x,M]}),e[53]=s,e[54]=E,e[55]=x,e[56]=M,e[57]=U):U=e[57];let F;e[58]!==c||e[59]!==U?(F=m.jsx(kI,{...c,children:U}),e[58]=c,e[59]=U,e[60]=F):F=e[60];let P;e[61]!==k||e[62]!==F?(P=m.jsxs(vk,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[k,F]}),e[61]=k,e[62]=F,e[63]=P):P=e[63];let B;return e[64]!==S||e[65]!==P?(B=m.jsx(Vy,{open:!0,onOpenChange:S,children:P}),e[64]=S,e[65]=P,e[66]=B):B=e[66],B}const qI=/^mcp__[a-zA-Z0-9_-]+__/;function sS(t){return t.replace(qI,"")}function Af(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pn=Af();function oS(t){Pn=t}var _r={exec:()=>null};function ve(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(a,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(it.caret,"$1"),n=n.replace(a,s),r},getRegex:()=>new RegExp(n,e)};return r}var it={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},GI=/^(?:[ \t]*(?:\n|$))+/,VI=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,WI=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,YI=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_f=/(?:[*+-]|\d{1,9}[.)])/,lS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uS=ve(lS).replace(/bull/g,_f).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),KI=ve(lS).replace(/bull/g,_f).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XI=/^[^\n]+/,kf=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ZI=ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),QI=ve(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_f).getRegex(),xi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",If=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,JI=ve("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",If).replace("tag",xi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cS=ve(xf).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex(),eN=ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cS).getRegex(),Nf={blockquote:eN,code:VI,def:ZI,fences:WI,heading:YI,hr:Zr,html:JI,lheading:uS,list:QI,newline:GI,paragraph:cS,table:_r,text:XI},Ym=ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex(),tN={...Nf,lheading:KI,table:Ym,paragraph:ve(xf).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ym).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex()},nN={...Nf,html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",If).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ve(xf).replace("hr",Zr).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",uS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rN=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,aN=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dS=/^( {2,}|\\)\n(?!\s*$)/,iN=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ki=/[\p{P}\p{S}]/u,vf=/[\s\p{P}\p{S}]/u,pS=/[^\s\p{P}\p{S}]/u,sN=ve(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,vf).getRegex(),fS=/(?!~)[\p{P}\p{S}]/u,oN=/(?!~)[\s\p{P}\p{S}]/u,lN=/(?:[^\s\p{P}\p{S}]|~)/u,uN=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,mS=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,cN=ve(mS,"u").replace(/punct/g,ki).getRegex(),dN=ve(mS,"u").replace(/punct/g,fS).getRegex(),hS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pN=ve(hS,"gu").replace(/notPunctSpace/g,pS).replace(/punctSpace/g,vf).replace(/punct/g,ki).getRegex(),fN=ve(hS,"gu").replace(/notPunctSpace/g,lN).replace(/punctSpace/g,oN).replace(/punct/g,fS).getRegex(),mN=ve("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,pS).replace(/punctSpace/g,vf).replace(/punct/g,ki).getRegex(),hN=ve(/\\(punct)/,"gu").replace(/punct/g,ki).getRegex(),gN=ve(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bN=ve(If).replace("(?:-->|$)","-->").getRegex(),EN=ve("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Oa=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,TN=ve(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Oa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gS=ve(/^!?\[(label)\]\[(ref)\]/).replace("label",Oa).replace("ref",kf).getRegex(),bS=ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",kf).getRegex(),yN=ve("reflink|nolink(?!\\()","g").replace("reflink",gS).replace("nolink",bS).getRegex(),Cf={_backpedal:_r,anyPunctuation:hN,autolink:gN,blockSkip:uN,br:dS,code:aN,del:_r,emStrongLDelim:cN,emStrongRDelimAst:pN,emStrongRDelimUnd:mN,escape:rN,link:TN,nolink:bS,punctuation:sN,reflink:gS,reflinkSearch:yN,tag:EN,text:iN,url:_r},SN={...Cf,link:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",Oa).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Oa).getRegex()},yp={...Cf,emStrongRDelimAst:fN,emStrongLDelim:dN,url:ve(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},AN={...yp,br:ve(dS).replace("{2,}","*").getRegex(),text:ve(yp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},la={normal:Nf,gfm:tN,pedantic:nN},dr={normal:Cf,gfm:yp,breaks:AN,pedantic:SN},_N={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Km=t=>_N[t];function Dt(t,e){if(e){if(it.escapeTest.test(t))return t.replace(it.escapeReplace,Km)}else if(it.escapeTestNoEncode.test(t))return t.replace(it.escapeReplaceNoEncode,Km);return t}function Xm(t){try{t=encodeURI(t).replace(it.percentDecode,"%")}catch{return null}return t}function Zm(t,e){const n=t.replace(it.findPipe,(i,s,o)=>{let l=!1,u=s;for(;--u>=0&&o[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(it.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(it.slashPipe,"|");return r}function pr(t,e,n){const r=t.length;if(r===0)return"";let a=0;for(;a<r&&t.charAt(r-a-1)===e;)a++;return t.slice(0,r-a)}function xN(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Qm(t,e,n,r,a){const i=e.href,s=e.title||null,o=t[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:s,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}function kN(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const a=r[1];return e.split(`
3
3
  `).map(i=>{const s=i.match(n.other.beginningSpace);if(s===null)return i;const[o]=s;return o.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var La=class{options;rules;lexer;constructor(t){this.options=t||Pn}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pr(n,`
@@ -1 +1 @@
1
- import{c as B,j as o,b as D,F as M,d as $,r as q,B as F,p as R}from"./index-v4xr9fBY.js";import{s as V}from"./Plus-DLbtYGri.js";import{i as S}from"./Zap-DSrBTwKT.js";import{S as G}from"./search-input-jQMH80d1.js";import{P as d}from"./index-CsebWa9R.js";import{E as T}from"./empty-state-CRcUb-lZ.js";import{c as H}from"./use-automations-k3FdbNQZ.js";import{c as J}from"./use-navigate-to-agent-DSBbiXfY.js";import{A as K}from"./automation-list-row-DwHzmOHN.js";import{q as O}from"./use-mcp-client-DspygOPp.js";import{a as Q}from"./use-virtual-mcp-kUy0NdbH.js";import{R as U}from"./require-capability-CY0pv6qC.js";import"./SearchMd-EJtaQP9g.js";import"./sidebar-Bn8O7Aoo.js";import"./LayoutLeft-BLprwKtV.js";import"./use-mobile-C-mJw8PU.js";import"./X-F_AtITBB.js";import"./tooltip-CzcvFJJ4.js";import"./studio-tools-Xw-8BkV3.js";import"./hooks-BfI5-YVe.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-D9LvrvYB.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-BbzswsKi.js";import"./dropdown-menu-CDi9V4K2.js";import"./Check-CzuAentr.js";import"./ChevronRight-uevwIauT.js";import"./DotsVertical-DNiWmGQW.js";import"./Stars02-pjrDL108.js";import"./Trash01-CQlBG8ML.js";import"./agent-icon-B0dE0gXI.js";import"./AlertCircle-CJIb11xM.js";import"./Tool01-BqM3fhvU.js";import"./ArrowUp-C4eq2Obn.js";import"./Settings02-D2Od6hIu.js";import"./Tool02-CdAHKhSP.js";import"./XCircle-BmPLYPUm.js";import"./ArrowUpRight-DY5OrDCo.js";import"./TrendUp01-BOoR0Suf.js";import"./ZapSquare-lUH8oMSf.js";import"./Users03-DjFIwR1e.js";import"./CheckCircle-L1MZeMEC.js";import"./ChevronDown-CClFlSxz.js";import"./ChevronUp-BMENMqPe.js";import"./Copy01-DKc_cNPS.js";import"./CpuChip01-CQZHTBv_.js";import"./Eye-CLJlIW72.js";import"./FilterLines-_KV74m1j.js";import"./Star01-vKIuVNvK.js";import"./Palette-DfxMP9C1.js";import"./SwitchHorizontal01-DqL7dpQo.js";import"./HardDrive-D3MsBwdM.js";import"./Key01-Ph8ozLZ_.js";import"./LinkExternal01-Bmn2On3L.js";import"./LogOut01-DtXlL9FN.js";import"./Monitor01-Cq5ooC-g.js";import"./Sun-D70XMNg2.js";import"./Play-D9njRjDI.js";import"./SearchLg-DctVlVQz.js";import"./Shield01-CfDR602-.js";import"./Stars01-3Jc0GjIj.js";import"./Upload01-bMCburYR.js";import"./User01-Bk3KF8L-.js";import"./Users01-DrmBjw74.js";import"./XClose-pCZ95Skb.js";import"./auth-Cci4GApT.js";import"./use-capability-C9ZzLeWc.js";import"./access-gate-DnmOgDmX.js";import"./capability-load-error-Do7SvLQW.js";function W(){const t=B.c(20),e=D(),{org:c}=M(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=$(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+i}})};let l;t[0]!==f||t[1]!==c.slug?(l=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=l):l=t[2];const L=l,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(G,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(F,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function go(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{go as default};
1
+ import{c as B,j as o,b as D,F as M,d as $,r as q,B as F,p as R}from"./index-w4Kza-rK.js";import{s as V}from"./Plus-C6kGK8YY.js";import{i as S}from"./Zap-DzsOPqEB.js";import{S as G}from"./search-input-Cru0aaSq.js";import{P as d}from"./index-1_-ikgnM.js";import{E as T}from"./empty-state-CP56BOYX.js";import{c as H}from"./use-automations-BHklCdet.js";import{c as J}from"./use-navigate-to-agent-DBC7w0Dc.js";import{A as K}from"./automation-list-row-DLEoL538.js";import{q as O}from"./use-mcp-client-iPC50X8f.js";import{a as Q}from"./use-virtual-mcp-DezThwv0.js";import{R as U}from"./require-capability-BU4R-Pci.js";import"./SearchMd-BI0XFlBK.js";import"./sidebar-DWgS242X.js";import"./LayoutLeft-BAgNWwto.js";import"./use-mobile-B7cyaUDa.js";import"./X-ChbPSCzS.js";import"./tooltip-D7StMLxc.js";import"./studio-tools-BylTF4-U.js";import"./hooks-c93_ex0y.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BqOQpD3k.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-B5U5wY1n.js";import"./dropdown-menu-BqEwoGS-.js";import"./Check-GfWraBFp.js";import"./ChevronRight-CTT8T1J0.js";import"./DotsVertical-CLT4z1eM.js";import"./Stars02-hS3VtVKb.js";import"./Trash01-Lta4-dBB.js";import"./agent-icon-QsGAUDhV.js";import"./AlertCircle-DrATK--G.js";import"./Tool01-Dhc4ao7G.js";import"./ArrowUp-boiVbq4P.js";import"./Settings02-vpAc0p9f.js";import"./Tool02-DD_vhYh6.js";import"./XCircle-TzZ5I8PA.js";import"./ArrowUpRight-CGNmznYx.js";import"./TrendUp01-CvDSutMV.js";import"./ZapSquare-N_iAx6EQ.js";import"./Users03-lqPHwKgJ.js";import"./CheckCircle-6OIDiE1o.js";import"./ChevronDown-CSrIpSEZ.js";import"./ChevronUp-DwmhjoAn.js";import"./Copy01--ZOTzkPA.js";import"./CpuChip01-BlrhketG.js";import"./Eye-CKSKAoUm.js";import"./FilterLines-Db1mPJVs.js";import"./Star01-Dqavdch8.js";import"./Palette-CsAExMG_.js";import"./SwitchHorizontal01-BBtvc6mI.js";import"./HardDrive-C2zbQHbI.js";import"./Key01-C017Z9kh.js";import"./LinkExternal01-BBpoOd9O.js";import"./LogOut01-Bvl779Ya.js";import"./Monitor01-Cg1SkWzI.js";import"./Sun-BChTpLPO.js";import"./Play-DxZ6Acq3.js";import"./SearchLg-DrfU4tKL.js";import"./Shield01-mWDumpp-.js";import"./Stars01-szhvpQET.js";import"./Upload01-BQ9GWbOC.js";import"./User01-BebV7VwV.js";import"./Users01-DOLzWgUv.js";import"./XClose-CcQyyEDk.js";import"./auth-D4KWVJ-l.js";import"./use-capability-Cnl59xCS.js";import"./access-gate-czxSnRem.js";import"./capability-load-error-Ba-2Rwdi.js";function W(){const t=B.c(20),e=D(),{org:c}=M(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=$(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+i}})};let l;t[0]!==f||t[1]!==c.slug?(l=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=l):l=t[2];const L=l,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(G,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(F,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function go(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{go as default};
@@ -1 +1 @@
1
- import{c as k,j as i,m as f,bs as R,cM as V,cN as I,cO as O}from"./index-v4xr9fBY.js";import{s as $}from"./User01-Bk3KF8L-.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const m=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==m||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx($,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(U,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(E,{className:f(z,"rounded-none"),delayMs:l?600:0,children:m})]}),e[22]=z,e[23]=m,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(M,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function B(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let m;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(m=i.jsx(W,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=m):m=e[17],m}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
1
+ import{c as k,j as i,m as f,bs as R,cM as V,cN as I,cO as O}from"./index-w4Kza-rK.js";import{s as $}from"./User01-BebV7VwV.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const m=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==m||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx($,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(U,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(E,{className:f(z,"rounded-none"),delayMs:l?600:0,children:m})]}),e[22]=z,e[23]=m,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(M,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function B(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let m;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(m=i.jsx(W,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=m):m=e[17],m}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
@@ -1 +1 @@
1
- import{c as u,m as l,j as g,b4 as v,bs as b}from"./index-v4xr9fBY.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=u.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=l(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
1
+ import{c as u,m as l,j as g,b4 as v,bs as b}from"./index-w4Kza-rK.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=u.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=l(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};