decocms 4.34.2 → 4.35.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 (237) hide show
  1. package/dist/client/assets/{AlertCircle-CWo2w3Rs.js → AlertCircle-f6lhwhwQ.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-Bmg39pV9.js → ArrowUpRight-CSFwuCf5.js} +1 -1
  3. package/dist/client/assets/{Check-DRzA-dpx.js → Check-Aukmu8Un.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-M6H5ZlJ0.js → CheckCircle-CApzzqD8.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CLHpWdSG.js → ChevronDown-B0UKR4Q8.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-0-moit0s.js → ChevronRight-DBqOeCeL.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BfATOATf.js → ChevronUp-GMJj8UiZ.js} +1 -1
  8. package/dist/client/assets/{Circle-BbviKruX.js → Circle-YviPro1s.js} +1 -1
  9. package/dist/client/assets/{Copy01-0cR9vc8q.js → Copy01-DE6jIX1d.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BYgPyTRF.js → DotsVertical-CRXCtL95.js} +1 -1
  11. package/dist/client/assets/{Eye-C3PjUbDk.js → Eye-DkKR2sGU.js} +1 -1
  12. package/dist/client/assets/{FilterLines-AcRSKyYZ.js → FilterLines-zo9nIazW.js} +1 -1
  13. package/dist/client/assets/{Globe01-UNsFBAF6.js → Globe01-9ubWRIn8.js} +1 -1
  14. package/dist/client/assets/{Globe04-Cvug-N8n.js → Globe04-BQ8V1DCS.js} +1 -1
  15. package/dist/client/assets/{HardDrive-hN1jZwmH.js → HardDrive-inNtB34T.js} +1 -1
  16. package/dist/client/assets/{Key01-_uA23D4r.js → Key01-Ce61Bgp4.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-P3T11G8U.js → LayoutLeft-C4Pounbz.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-yVpYk0TA.js → LinkExternal01-C2NXvx3_.js} +1 -1
  19. package/dist/client/assets/{List-BDtpMLbg.js → List-CoWwn-yg.js} +1 -1
  20. package/dist/client/assets/{Loading02-BtqTcbc-.js → Loading02-DuE9feUL.js} +1 -1
  21. package/dist/client/assets/{Monitor01-Ca-mpyh5.js → Monitor01-DzUUK9ht.js} +1 -1
  22. package/dist/client/assets/{Palette-DoccA0gP.js → Palette-Do-v2l7i.js} +1 -1
  23. package/dist/client/assets/{Play-DamNmHjz.js → Play-Ca8SpLNV.js} +1 -1
  24. package/dist/client/assets/{Plus-DOMy9gvN.js → Plus-D321yWS2.js} +1 -1
  25. package/dist/client/assets/{SearchLg-CgRpLS5P.js → SearchLg-BcZgwDj6.js} +1 -1
  26. package/dist/client/assets/{SearchMd-aI0z5N9j.js → SearchMd-DJS38wH4.js} +1 -1
  27. package/dist/client/assets/{Settings02-BJM4-roS.js → Settings02-CkTsdbF0.js} +1 -1
  28. package/dist/client/assets/{Shield01-DUr3YuOr.js → Shield01-Bn8V09Ru.js} +1 -1
  29. package/dist/client/assets/{Star01-CezMYimm.js → Star01-DuQha8zt.js} +1 -1
  30. package/dist/client/assets/{Stars01-c5pA30a9.js → Stars01-B6X8tGbZ.js} +1 -1
  31. package/dist/client/assets/{Stars02-mQKhQQrM.js → Stars02-DeVTmo8z.js} +1 -1
  32. package/dist/client/assets/{Sun-4EkFOfwd.js → Sun-huCAsUzO.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-BMtwwLBl.js → SwitchHorizontal01-1_z_hHyc.js} +1 -1
  34. package/dist/client/assets/{Tool01-CbCiOrgD.js → Tool01-D1RRR1kw.js} +1 -1
  35. package/dist/client/assets/{Trash01-BPtww6NG.js → Trash01-BhSSOFCl.js} +1 -1
  36. package/dist/client/assets/{Upload01-Bv5V53rT.js → Upload01-pw6m16iV.js} +1 -1
  37. package/dist/client/assets/{User01-BYDmkbvV.js → User01-D3gcuea5.js} +1 -1
  38. package/dist/client/assets/{Users01-CbN3qRM8.js → Users01-hYhuhjvL.js} +1 -1
  39. package/dist/client/assets/{Users03-BflqY5Bb.js → Users03-BW7WVd7l.js} +1 -1
  40. package/dist/client/assets/{X-Cb1IaFkf.js → X-B4-7qG-5.js} +1 -1
  41. package/dist/client/assets/{XCircle-DYs03cv5.js → XCircle-DNMYfZsu.js} +1 -1
  42. package/dist/client/assets/{XClose-D5jBGhZu.js → XClose-LQHYvxls.js} +1 -1
  43. package/dist/client/assets/{Zap-_LBawPer.js → Zap-D3B4NAio.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-D3nXDwPD.js → ZapSquare-CDjZJq8r.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-CoQZkFi6.js → ZoomOut-CdYifXao.js} +1 -1
  46. package/dist/client/assets/{access-gate-CWzEQUbt.js → access-gate-76tQHldY.js} +1 -1
  47. package/dist/client/assets/add-section-modal-BqLvsQKS.js +1 -0
  48. package/dist/client/assets/{agent-capabilities-Beg1Tahi.js → agent-capabilities-CncqCO43.js} +1 -1
  49. package/dist/client/assets/{agent-icon-Jbiz_GlE.js → agent-icon-Clq9aKDI.js} +1 -1
  50. package/dist/client/assets/{agents-list-DRLCMy9G.js → agents-list-BoRmbdnw.js} +1 -1
  51. package/dist/client/assets/{ai-providers-DYQcR6sR.js → ai-providers-CS4_9q5y.js} +1 -1
  52. package/dist/client/assets/{alert-DRQSEKDE.js → alert-CfLzySTP.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-A1BqEuAN.js → alert-dialog-OcKuMvkx.js} +3 -3
  54. package/dist/client/assets/app-editor-SJHuM8DT.js +1 -0
  55. package/dist/client/assets/{auth-sGPw4pzN.js → auth-BSVfrU7T.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-D6AiaVai.js → auth-catchall-Bq1TEeYt.js} +1 -1
  57. package/dist/client/assets/{auth-entry-BZp32rjz.js → auth-entry-Bbfzs0A9.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-BOSD21G1.js → auth-split-layout-VhDB5Kjd.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-C9K-Bn9S.js → authenticate-and-persist-oauth-pSYfuzK6.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-DX0hA2e6.js → automation-list-row-Cv1Lpo76.js} +1 -1
  61. package/dist/client/assets/{automation-runs-2FK11Uq8.js → automation-runs-DEj3paI_.js} +2 -2
  62. package/dist/client/assets/{automations-OF6KHsxv.js → automations-BUrB7Xnv.js} +1 -1
  63. package/dist/client/assets/{autosend-DRXerSlp.js → autosend-gxaMEvDD.js} +1 -1
  64. package/dist/client/assets/{avatar-DCYC0Ovl.js → avatar-Dv4V-x92.js} +1 -1
  65. package/dist/client/assets/{badge-zW2D6RON.js → badge-C262yjLA.js} +1 -1
  66. package/dist/client/assets/{block-document-CPKTmWKi.js → block-document-mTd4QaWg.js} +3 -3
  67. package/dist/client/assets/{brand-context-CS8dzOEw.js → brand-context-C6Mk4Tdt.js} +1 -1
  68. package/dist/client/assets/{breadcrumb-Cn_dCiaB.js → breadcrumb-CvS5tec8.js} +1 -1
  69. package/dist/client/assets/{buckets-DJAm9tU3.js → buckets-BicnOVQW.js} +1 -1
  70. package/dist/client/assets/bulk-category-panel-5446BaH7.js +1 -0
  71. package/dist/client/assets/{calendar-BUXe1qGD.js → calendar-D4t7kX9Q.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-CBZKpTsj.js → capability-load-error-C6l-t9OR.js} +1 -1
  73. package/dist/client/assets/{card-w-ZXXB57.js → card-D8Vz3jG6.js} +1 -1
  74. package/dist/client/assets/category-editor--ln76tIo.js +1 -0
  75. package/dist/client/assets/{chat-context-BE6mo9bu.js → chat-context-CBVCBl_J.js} +1 -1
  76. package/dist/client/assets/{checkbox-DtrpBIFz.js → checkbox-CchykYiZ.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-C3LANAtT.js → cli-auth-success-BnByk5x5.js} +1 -1
  78. package/dist/client/assets/collection-detail-ND7d2Eyq.js +1 -0
  79. package/dist/client/assets/{collection-display-button-DQpkHuY5.js → collection-display-button-DxqFoVRY.js} +1 -1
  80. package/dist/client/assets/{collection-search-BwSp_Aw4.js → collection-search-CltfDlpo.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-Cn8zRCRJ.js → collection-table-wrapper-DLnmSfmE.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-Bm-3WSlA.js → collection-tabs-CTi5oTnQ.js} +1 -1
  83. package/dist/client/assets/{command-BO3Cnpvg.js → command-BAIXwHHL.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-prtwFO2s.js → commerce-onboarding-CMjqlg8E.js} +1 -1
  85. package/dist/client/assets/connect-desktop-dialog-CAF33mXR.js +1 -0
  86. package/dist/client/assets/{connection-card-4bm-y1Gd.js → connection-card-CO1XcaEL.js} +1 -1
  87. package/dist/client/assets/connection-detail-BlmkUd9p.js +1 -0
  88. package/dist/client/assets/{connection-form-helpers-Dvg-sl5J.js → connection-form-helpers-XaWP2G3x.js} +1 -1
  89. package/dist/client/assets/connections-DnCGVu9g.js +1 -0
  90. package/dist/client/assets/{decopilot-sse-pool-H5PWohfg.js → decopilot-sse-pool-CDHTEmuK.js} +1 -1
  91. package/dist/client/assets/{dialog-D4tuLdKg.js → dialog-WEGZiwPy.js} +1 -1
  92. package/dist/client/assets/{domain-settings-Q64LowCi.js → domain-settings-CRCy8oFu.js} +1 -1
  93. package/dist/client/assets/{drawer-Cl42OMuR.js → drawer-UuuCah9g.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-DnltYtFq.js → dropdown-menu-CksFCj44.js} +1 -1
  95. package/dist/client/assets/{empty-state-CSfhHKVd.js → empty-state-F_lK3gf_.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-DbUbdg9c.js → extract-connection-data-BCgnLdIa.js} +1 -1
  97. package/dist/client/assets/file-explorer-DA4UKKI7.js +2 -0
  98. package/dist/client/assets/{file-type-icon-CzWNCoZC.js → file-type-icon-DEYVlVHX.js} +1 -1
  99. package/dist/client/assets/{files-uyt938FW.js → files-D4agV2id.js} +1 -1
  100. package/dist/client/assets/{form-V_XI11Kc.js → form-vGQs6GSc.js} +1 -1
  101. package/dist/client/assets/{general-BB8ctEPw.js → general-SnqMJ_uN.js} +1 -1
  102. package/dist/client/assets/github-repo-picker-WVoiNLVS.js +1 -0
  103. package/dist/client/assets/{hooks-CV3ote7A.js → hooks-HnvPO2Fr.js} +1 -1
  104. package/dist/client/assets/{index-3wANCPRO.js → index-7EDQs4g5.js} +11 -11
  105. package/dist/client/assets/{index-IJbt2d9X.js → index-B19Gd9cQ.js} +2 -2
  106. package/dist/client/assets/index-BcHmTSFg.css +1 -0
  107. package/dist/client/assets/{index-5kHbzeXa.js → index-BvY5YnRL.js} +1 -1
  108. package/dist/client/assets/{index-BmCtcH0K.js → index-CH3GGxYs.js} +1 -1
  109. package/dist/client/assets/{index-CnZPkn7R.js → index-CmN7TjST.js} +1 -1
  110. package/dist/client/assets/{index-D1Il2d7T.js → index-D1g40hAu.js} +3 -3
  111. package/dist/client/assets/{index-DXiY8k-2.js → index-D4E3XJr2.js} +1 -1
  112. package/dist/client/assets/{index-DHvUf48S.js → index-Du4ARIfO.js} +1 -1
  113. package/dist/client/assets/{index-CwathWr_.js → index-NGT6SGng.js} +1 -1
  114. package/dist/client/assets/{index-nxyUqjSg.js → index-aIln4hKS.js} +1 -1
  115. package/dist/client/assets/{index-0_QD3N3p.js → index-bSsLqTR8.js} +1 -1
  116. package/dist/client/assets/{index-CzWF3J4h.js → index-kAuhGsQR.js} +1 -1
  117. package/dist/client/assets/{index-redirect-Dc2nTn4h.js → index-redirect-BOtvKj4V.js} +1 -1
  118. package/dist/client/assets/{index-BOw4wVWR.js → index-y_ZN3Csi.js} +1 -1
  119. package/dist/client/assets/index-zNNbsSbv.js +217 -0
  120. package/dist/client/assets/{input-NG03AkXE.js → input-AH-zc1xJ.js} +1 -1
  121. package/dist/client/assets/{integration-icon-CZWFT3DW.js → integration-icon-A9c_bebh.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-BKa9UA0S.js → invite-member-dialog-2QbPsKy5.js} +1 -1
  123. package/dist/client/assets/{label-CoVhr6uF.js → label-CREwZHVz.js} +1 -1
  124. package/dist/client/assets/{login-BxoaPHkQ.js → login-DK11wo9B.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-BnINg_mr.js → mcp-oauth-CUTN_jP_.js} +1 -1
  126. package/dist/client/assets/{members-DZDoS8_y.js → members-SQ5xbIj_.js} +1 -1
  127. package/dist/client/assets/{monaco-editor-PvgfmQvG.js → monaco-editor-DcSz2nK4.js} +2 -2
  128. package/dist/client/assets/{monitoring-stats-row-BjJW0hk3.js → monitoring-stats-row-dq67E9g4.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-BTtzlplc.js → oauth-callback-CyjY2LuB.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-ai-provider-4go1C5IS.js → oauth-callback-ai-provider-D-_MRvoT.js} +1 -1
  131. package/dist/client/assets/{onboarding-1FMcSqda.js → onboarding-BcNffG2l.js} +1 -1
  132. package/dist/client/assets/{org-install-6kg2QE41.js → org-install-CZD3yOvZ.js} +1 -1
  133. package/dist/client/assets/{org-layout-BcGgOe1A.js → org-layout-ChzYwis1.js} +1 -1
  134. package/dist/client/assets/{organization-choice-BF8evIsb.js → organization-choice-DO3TpN5Q.js} +1 -1
  135. package/dist/client/assets/page-seo-form-C3ja-AdY.js +1 -0
  136. package/dist/client/assets/page-seo-sheet-DST-XLP6.js +1 -0
  137. package/dist/client/assets/{popover-LegBHHPI.js → popover-BXSfQ3ty.js} +1 -1
  138. package/dist/client/assets/post-editor-B_LetdV2.js +1 -0
  139. package/dist/client/assets/{primitives-5Bes0H8Y.js → primitives-Dh6y5Vqf.js} +1 -1
  140. package/dist/client/assets/{profile-e9z16c_H.js → profile-DeWb4RIY.js} +1 -1
  141. package/dist/client/assets/project-app-view-BifDSljQ.js +1 -0
  142. package/dist/client/assets/record-editor-DI5MypGG.js +1 -0
  143. package/dist/client/assets/registry-B1LHfxlX.js +2 -0
  144. package/dist/client/assets/{registry-layout-BwXFLswk.js → registry-layout-DAKJr0Bp.js} +1 -1
  145. package/dist/client/assets/{require-capability-BZ-zzVLb.js → require-capability-Cb7N2Oxk.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-DjSRL58t.js → required-auth-layout-DRSJiqlk.js} +1 -1
  147. package/dist/client/assets/{reset-password-DDn1uwC9.js → reset-password-BRHQg6QO.js} +1 -1
  148. package/dist/client/assets/{roles-BRoTsMVD.js → roles-SdLIIKmd.js} +1 -1
  149. package/dist/client/assets/{search-input-Ci8tEHW9.js → search-input-BzykC6SX.js} +1 -1
  150. package/dist/client/assets/{secrets-CN1xu6sV.js → secrets-lP0WJIRf.js} +1 -1
  151. package/dist/client/assets/sections-editor-CsFcLCt9.js +2 -0
  152. package/dist/client/assets/{select-DVZc4E4V.js → select-C5NXkaeS.js} +1 -1
  153. package/dist/client/assets/{select-model-CLhsRP_l.js → select-model-MLc2Y3Qy.js} +1 -1
  154. package/dist/client/assets/{seo-editor-Cb9iUbPW.js → seo-editor-r_gWolyN.js} +1 -1
  155. package/dist/client/assets/{settings-layout-DnXr7ygU.js → settings-layout-BRYOw2xs.js} +1 -1
  156. package/dist/client/assets/{settings-section-CHWS1FIf.js → settings-section-DcnbXr5u.js} +1 -1
  157. package/dist/client/assets/{shell-controls-B4nD11vf.js → shell-controls-hRJb8y7E.js} +1 -1
  158. package/dist/client/assets/{shell-layout-Dm40raSF.js → shell-layout-BQHSPqMr.js} +1 -1
  159. package/dist/client/assets/{sidebar-BbmkzDwj.js → sidebar-DgN5oOpi.js} +1 -1
  160. package/dist/client/assets/{skeleton-_zr7HJMo.js → skeleton-BNyVbUwG.js} +1 -1
  161. package/dist/client/assets/{sso-DWDuVYa_.js → sso-wV6U6i7v.js} +1 -1
  162. package/dist/client/assets/{store-p_qhKfKM.js → store-CoUYwDd1.js} +1 -1
  163. package/dist/client/assets/store-registry-mRHIDibK.js +2 -0
  164. package/dist/client/assets/{studio-tools-CTbP1rvS.js → studio-tools-DbeWVKwZ.js} +1 -1
  165. package/dist/client/assets/{switch-OeBXOHbU.js → switch-D35infLY.js} +1 -1
  166. package/dist/client/assets/tab-id-DAJ8K7VA.js +1 -0
  167. package/dist/client/assets/{table-B2Fi-xgN.js → table-CRfKA7NS.js} +1 -1
  168. package/dist/client/assets/{tabs-D3BMQa5m.js → tabs-D3wed5Bx.js} +1 -1
  169. package/dist/client/assets/{textarea-5Pf25_as.js → textarea-CEc_7A6V.js} +1 -1
  170. package/dist/client/assets/{toggle-group-Bp7LVOg4.js → toggle-group-CFbcmDsi.js} +1 -1
  171. package/dist/client/assets/toolbar-CgIGs2xP.js +1 -0
  172. package/dist/client/assets/{toolbar-icon-button-K5Db26Ta.js → toolbar-icon-button-CYEe3N0j.js} +1 -1
  173. package/dist/client/assets/{tools-list-Cj6pWwiB.js → tools-list-DI21LYyh.js} +1 -1
  174. package/dist/client/assets/{tooltip-CZrkvlI-.js → tooltip-Cjk9PMKc.js} +1 -1
  175. package/dist/client/assets/{types-CN46hG-C.js → types-DOtTCrPL.js} +3 -3
  176. package/dist/client/assets/{use-ai-providers-CqbJz7ty.js → use-ai-providers-qucsliq3.js} +1 -1
  177. package/dist/client/assets/{use-automations-Btrbiz8v.js → use-automations-SOkWBo6W.js} +1 -1
  178. package/dist/client/assets/{use-capability-56pwQuBl.js → use-capability-DQv1lExQ.js} +1 -1
  179. package/dist/client/assets/{use-clock-tick-D0StcXXM.js → use-clock-tick-eW5js56x.js} +1 -1
  180. package/dist/client/assets/{use-collections-C3a6O1Kf.js → use-collections-DXG9rjJ2.js} +1 -1
  181. package/dist/client/assets/{use-connection-DlA7SbYu.js → use-connection-Cod3M0Uh.js} +1 -1
  182. package/dist/client/assets/{use-copy-DUBRfsw_.js → use-copy-CGlHMDea.js} +1 -1
  183. package/dist/client/assets/{use-create-virtual-mcp-DuiP1sA2.js → use-create-virtual-mcp-BX6sBt4t.js} +1 -1
  184. package/dist/client/assets/{use-debounced-autosave-BcTFLZWq.js → use-debounced-autosave-DiGqeVKG.js} +1 -1
  185. package/dist/client/assets/{use-debounced-value-DZMfEQVf.js → use-debounced-value-CzaaMzl3.js} +1 -1
  186. package/dist/client/assets/{use-decopilot-events-BRR71e9n.js → use-decopilot-events-uGcsF--z.js} +1 -1
  187. package/dist/client/assets/{use-delete-connection-DsBRsN5J.js → use-delete-connection-QI_R7sTm.js} +1 -1
  188. package/dist/client/assets/{use-file-configs-B09v-Tdk.js → use-file-configs-CtmXiAad.js} +1 -1
  189. package/dist/client/assets/{use-infinite-scroll-CXObKcMM.js → use-infinite-scroll-Ds-wB394.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-BVvEnhaf.js → use-join-requests-C53tVE87.js} +1 -1
  191. package/dist/client/assets/{use-mcp-client-CqQQWnQv.js → use-mcp-client-D-IcrlM1.js} +1 -1
  192. package/dist/client/assets/{use-mcp-prompts-5VgIENjN.js → use-mcp-prompts-CjXlqFii.js} +1 -1
  193. package/dist/client/assets/{use-mcp-tools-BBo1CVh9.js → use-mcp-tools-Dafx8Nf_.js} +1 -1
  194. package/dist/client/assets/{use-members-DQRLt-ZP.js → use-members-BkrjfZtd.js} +1 -1
  195. package/dist/client/assets/{use-mobile-DVBpVOpv.js → use-mobile-Cs5uj2B4.js} +1 -1
  196. package/dist/client/assets/{use-navigate-to-agent-DHQynKWI.js → use-navigate-to-agent-CdzFundu.js} +1 -1
  197. package/dist/client/assets/{use-org-auth-client-D8i1yzzN.js → use-org-auth-client-CYHJ8zhf.js} +1 -1
  198. package/dist/client/assets/{use-org-sso-4OxOQasz.js → use-org-sso-ZllsKAXm.js} +1 -1
  199. package/dist/client/assets/{use-organization-roles-DjenBlf3.js → use-organization-roles-UQbPZOTn.js} +1 -1
  200. package/dist/client/assets/{use-organization-settings-DXQvxmVp.js → use-organization-settings-BM7m28RI.js} +1 -1
  201. package/dist/client/assets/{use-registry-connections-CB4pSGdn.js → use-registry-connections-Obrdx90O.js} +1 -1
  202. package/dist/client/assets/{use-secrets-7z_yVxAY.js → use-secrets-DZyYucb6.js} +1 -1
  203. package/dist/client/assets/{use-status-sounds-DKcljOhr.js → use-status-sounds-COBLP9-r.js} +1 -1
  204. package/dist/client/assets/{use-view-mode-2osL2HHr.js → use-view-mode-fgGIj_ax.js} +1 -1
  205. package/dist/client/assets/{use-virtual-mcp-DTthhqWL.js → use-virtual-mcp-C70XD2v5.js} +1 -1
  206. package/dist/client/assets/useInfiniteQuery-Dul-gPAw.js +1 -0
  207. package/dist/client/assets/useSuspenseInfiniteQuery-0L4EzzOg.js +1 -0
  208. package/dist/client/assets/{variant-calendar-CrtWA8_Z.js → variant-calendar-BqxsTCCA.js} +1 -1
  209. package/dist/client/assets/{view-mode-toggle-BtNX-3na.js → view-mode-toggle-BEPKlxI2.js} +1 -1
  210. package/dist/client/index.html +2 -2
  211. package/dist/server/cli.js +424 -404
  212. package/dist/server/server.js +1 -1
  213. package/package.json +1 -1
  214. package/dist/client/assets/add-section-modal-arZ7Xm3y.js +0 -1
  215. package/dist/client/assets/app-editor-Bx9ZRBZV.js +0 -1
  216. package/dist/client/assets/bulk-category-panel-Dv40K6eC.js +0 -1
  217. package/dist/client/assets/category-editor-Dji6lf8V.js +0 -1
  218. package/dist/client/assets/collection-detail-D_0lSHjB.js +0 -1
  219. package/dist/client/assets/connect-desktop-dialog-eXpxo9qL.js +0 -1
  220. package/dist/client/assets/connection-detail-BoOE1DBL.js +0 -1
  221. package/dist/client/assets/connections-77MmnIp3.js +0 -1
  222. package/dist/client/assets/file-explorer-DHXMnboZ.js +0 -2
  223. package/dist/client/assets/github-repo-picker-D2aJRbrv.js +0 -1
  224. package/dist/client/assets/index-BNFGcJv4.js +0 -519
  225. package/dist/client/assets/index-dPmP2Tp4.css +0 -1
  226. package/dist/client/assets/page-seo-form-3mR99KHZ.js +0 -1
  227. package/dist/client/assets/page-seo-sheet-BwLPWNV9.js +0 -1
  228. package/dist/client/assets/post-editor-D1ab7ktC.js +0 -1
  229. package/dist/client/assets/project-app-view-Jl05SKrY.js +0 -1
  230. package/dist/client/assets/record-editor-C6jfNsK6.js +0 -1
  231. package/dist/client/assets/registry-DKZgk7Wa.js +0 -2
  232. package/dist/client/assets/sections-editor-DAnoJnEa.js +0 -2
  233. package/dist/client/assets/store-registry-DL8uX3MS.js +0 -2
  234. package/dist/client/assets/tab-id-DznSzCvK.js +0 -1
  235. package/dist/client/assets/toolbar-ABPXS5Vo.js +0 -1
  236. package/dist/client/assets/useInfiniteQuery-WADEvwcp.js +0 -1
  237. package/dist/client/assets/useSuspenseInfiniteQuery-fFFo_5V2.js +0 -1
@@ -1 +1 @@
1
- import{c as u,$ as c,K as r,L as y,p as C,d,k as F}from"./index-3wANCPRO.js";import{u as f}from"./studio-tools-CTbP1rvS.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],F(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function L(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,q as b,L as c,m as u};
1
+ import{c as u,$ as c,K as r,L as y,p as C,d,k as F}from"./index-7EDQs4g5.js";import{u as f}from"./studio-tools-DbeWVKwZ.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],F(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function L(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{I as a,q as b,L as c,m as u};
@@ -1 +1 @@
1
- import{Q as d,dI as l,dJ as v,r as i}from"./index-3wANCPRO.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
1
+ import{Q as d,dI as l,dJ as v,r as i}from"./index-7EDQs4g5.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
@@ -1 +1 @@
1
- import{c as g,$ as N,K as y,k as _,p as A,d as I,t as q}from"./index-3wANCPRO.js";import{a as S}from"./use-capability-56pwQuBl.js";import{u as O}from"./studio-tools-CTbP1rvS.js";function F(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,F as u};
1
+ import{c as g,$ as N,K as y,k as _,p as A,d as I,t as q}from"./index-7EDQs4g5.js";import{a as S}from"./use-capability-DQv1lExQ.js";import{u as O}from"./studio-tools-DbeWVKwZ.js";function F(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,F as u};
@@ -1,4 +1,4 @@
1
- import{cO as ce,cP as le,cQ as ue,c8 as de,cR as he,bP as m,bQ as g,cS as fe,cT as pe,cU as me,cV as M,cW as _e,cX as F,cY as we,cZ as q,c_ as ge,c$ as L,d0 as Te,d1 as ye,d2 as ke,d3 as z,bt as ve,bv as Se,ba as Ce,c3 as ee,cf as be,cl as Re,cj as Ie,cC as Ee,d4 as qe,d5 as Pe,d6 as A,d7 as $e,d8 as Me,ck as Ae,cg as He,ch as Oe,ci as xe,bq as Ne,d9 as Ue,da as je,db as Fe,ca as Le,dc as De,dd as Ve,de as Qe,bp as N,c as te,L as se,ah as V}from"./index-3wANCPRO.js";import{S as ze}from"./constants-B72Xmt_K.js";import{U as P,a as H,e as J}from"./auth-sGPw4pzN.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Je(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Je(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const We=6e4;class Ke{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??We,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ge(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ze=Se();const Be=ve(Ze);function Ye(){const a=new Be({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class Xe{constructor(e){this._ajv=e??Ye()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class et{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function tt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function rt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let ot=class extends Ke{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Xe,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new et(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ge(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(L,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(L,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?De:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){tt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&st(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const U=a=>[{type:"text",text:a}];function at(a){const e=a.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:U(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:U(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:U(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function D(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function nt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...D(e.headers),...D(s.headers)}:e.headers};return a(t,r)}:a}class Z extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const B=10,it=13,I=32;function j(a){}function ct(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
1
+ import{cO as ce,cP as le,cQ as ue,c8 as de,cR as he,bP as m,bQ as g,cS as fe,cT as pe,cU as me,cV as M,cW as _e,cX as F,cY as we,cZ as q,c_ as ge,c$ as L,d0 as Te,d1 as ye,d2 as ke,d3 as z,bt as ve,bv as Se,ba as Ce,c3 as ee,cf as be,cl as Re,cj as Ie,cC as Ee,d4 as qe,d5 as Pe,d6 as A,d7 as $e,d8 as Me,ck as Ae,cg as He,ch as Oe,ci as xe,bq as Ne,d9 as Ue,da as je,db as Fe,ca as Le,dc as De,dd as Ve,de as Qe,bp as N,c as te,L as se,ah as V}from"./index-7EDQs4g5.js";import{S as ze}from"./constants-B72Xmt_K.js";import{U as P,a as H,e as J}from"./auth-BSVfrU7T.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Je(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Je(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const We=6e4;class Ke{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,L,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??We,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ge(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ze=Se();const Be=ve(Ze);function Ye(){const a=new Be({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class Xe{constructor(e){this._ajv=e??Ye()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class et{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function tt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function rt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let ot=class extends Ke{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Xe,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new et(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ge(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(L,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(L,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?De:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){tt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&st(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const U=a=>[{type:"text",text:a}];function at(a){const e=a.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:U(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:U(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:U(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function D(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function nt(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...D(e.headers),...D(s.headers)}:e.headers};return a(t,r)}:a}class Z extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const B=10,it=13,I=32;function j(a){}function ct(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
2
2
  `)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
3
3
  `,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=_+1,_=d.indexOf(`
4
4
  `,c);continue}const v=d.charCodeAt(c);if(Y(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(p===0&&d.charCodeAt(_+1)===B){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
@@ -1 +1 @@
1
- import{c as l,k as c,bP as m,bQ as f,L as y,ah as n}from"./index-3wANCPRO.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{q as a,b as g,u as l,g as u};
1
+ import{c as l,k as c,bP as m,bQ as f,L as y,ah as n}from"./index-7EDQs4g5.js";async function u(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>u(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],c(a)}export{q as a,b as g,u as l,g as u};
@@ -1 +1 @@
1
- import{c as m,k as p,L as q,ah as T}from"./index-3wANCPRO.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function L(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,L as u};
1
+ import{c as m,k as p,L as q,ah as T}from"./index-7EDQs4g5.js";function C(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],q(i)}function K(n){const e=m.c(12);let t,o;e[0]!==n?({client:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let s;e[5]!==t?(s=async()=>await t.listTools(),e[5]=t,e[6]=s):s=e[6];const r=o.staleTime??3e4;let i;return e[7]!==o||e[8]!==l||e[9]!==s||e[10]!==r?(i={...o,queryKey:l,queryFn:s,staleTime:r,retry:!1},e[7]=o,e[8]=l,e[9]=s,e[10]=r,e[11]=i):i=e[11],p(i)}function O(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=q,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}function L(n){const e=m.c(21);let t,o,l,s;e[0]!==n?({client:t,toolName:s,toolArguments:l,...o}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=l,e[4]=s):(t=e[1],o=e[2],l=e[3],s=e[4]);let r,i,u;if(e[5]!==t||e[6]!==o||e[7]!==l||e[8]!==s){const f=JSON.stringify(l??{});u=p,r=o,i=T.mcpToolCall(t,s,f),e[5]=t,e[6]=o,e[7]=l,e[8]=s,e[9]=r,e[10]=i,e[11]=u}else r=e[9],i=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==s?(a=async()=>await t.callTool({name:s,arguments:l}),e[12]=t,e[13]=l,e[14]=s,e[15]=a):a=e[15];const y=o.staleTime??3e4;let c;return e[16]!==r||e[17]!==i||e[18]!==a||e[19]!==y?(c={...r,queryKey:i,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=i,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{K as a,C as b,O as c,L as u};
@@ -1 +1 @@
1
- import{c as n,$ as i,L as l,K as m}from"./index-3wANCPRO.js";import{u as a}from"./use-org-auth-client-D8i1yzzN.js";function p(){const e=n.c(7),{locator:o}=i(),u=a();let t;e[0]!==o?(t=m.members(o),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.organization.listMembers(),e[2]=u,e[3]=s):s=e[3];let r;return e[4]!==t||e[5]!==s?(r={queryKey:t,queryFn:s},e[4]=t,e[5]=s,e[6]=r):r=e[6],l(r)}export{p as u};
1
+ import{c as n,$ as i,L as l,K as m}from"./index-7EDQs4g5.js";import{u as a}from"./use-org-auth-client-CYHJ8zhf.js";function p(){const e=n.c(7),{locator:o}=i(),u=a();let t;e[0]!==o?(t=m.members(o),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.organization.listMembers(),e[2]=u,e[3]=s):s=e[3];let r;return e[4]!==t||e[5]!==s?(r={queryKey:t,queryFn:s},e[4]=t,e[5]=s,e[6]=r):r=e[6],l(r)}export{p as u};
@@ -1 +1 @@
1
- import{c as m,r}from"./index-3wANCPRO.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
1
+ import{c as m,r}from"./index-7EDQs4g5.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
@@ -1 +1 @@
1
- import{r as d,c as y,j as A,V as b,b as C,$,a as E}from"./index-3wANCPRO.js";import{a as _}from"./use-virtual-mcp-DTthhqWL.js";import{c as P}from"./hooks-CV3ote7A.js";import{f as w}from"./reusable-new-chat-qqWu133U.js";const S=d.createContext(null);function Q(e){const t=y.c(7),{children:r}=e,[n,c]=d.useState(!1),[o,a]=d.useState(0);let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>a(G),t[0]=u):u=t[0];const l=u;let s;t[1]!==n||t[2]!==o?(s={empty:n,setEmpty:c,orderRevision:o,bumpOrderRevision:l},t[1]=n,t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=A.jsx(S.Provider,{value:s,children:r}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function G(e){return e+1}function W(){return d.useContext(S)?.empty??!1}function N(){return d.useContext(S)?.bumpOrderRevision??U}function U(){}const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function T(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function j(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function K(e){const t=I(e),r=h.get(t);if(r)return r;const n=b.sidebarGroupOrder(e.orgId,e.userId);let c=!1;try{c=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!c&&o.length===0&&e.userId!=="anon"){const a=O(T(e.orgId));a.length>0&&(o=a)}return h.set(t,o),o}function k(e,t){const r=new Set(t);return K(e).filter(n=>!r.has(n))}function D(e,t){h.set(I(e),t),j(b.sidebarGroupOrder(e.orgId,e.userId),t)}function J(e,t,r=[]){if(r.includes(t))return;const n=k(e,r);n.includes(t)||D(e,[t,...n])}const v=[],L=()=>()=>{};function V(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=y.c(14),t=C(),{org:r}=$(),n=_(),{data:c}=E.useSession(),o=c?.user?.id??"anon";let a;e[0]!==n?(a=V(n),e[0]=n,e[1]=a):a=e[1];const u=a,l=N(),s=P();let i;e[2]!==s?.threads.get?(i=s?.threads.get??H,e[2]=s?.threads.get,e[3]=i):i=e[3];let f;e[4]!==s?.threads.get?(f=s?.threads.get??B,e[4]=s?.threads.get,e[5]=f):f=e[5];const m=d.useSyncExternalStore(s?.threads.subscribe??L,i,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==u||e[11]!==o||e[12]!==m?(g=(p,x)=>{J({orgId:r.id,userId:o},p,u),l();const R=w(m,p)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=u,e[11]=o,e[12]=m,e[13]=g):g=e[13],g}function B(){return v}function H(){return v}export{Q as S,N as a,J as b,X as c,V as g,W as u};
1
+ import{r as d,c as y,j as A,V as b,b as C,$,a as E}from"./index-7EDQs4g5.js";import{a as _}from"./use-virtual-mcp-C70XD2v5.js";import{c as P}from"./hooks-HnvPO2Fr.js";import{f as w}from"./reusable-new-chat-qqWu133U.js";const S=d.createContext(null);function Q(e){const t=y.c(7),{children:r}=e,[n,c]=d.useState(!1),[o,a]=d.useState(0);let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>a(G),t[0]=u):u=t[0];const l=u;let s;t[1]!==n||t[2]!==o?(s={empty:n,setEmpty:c,orderRevision:o,bumpOrderRevision:l},t[1]=n,t[2]=o,t[3]=s):s=t[3];let i;return t[4]!==r||t[5]!==s?(i=A.jsx(S.Provider,{value:s,children:r}),t[4]=r,t[5]=s,t[6]=i):i=t[6],i}function G(e){return e+1}function W(){return d.useContext(S)?.empty??!1}function N(){return d.useContext(S)?.bumpOrderRevision??U}function U(){}const h=new Map;function I(e){return`${e.orgId}:${e.userId}`}function T(e){return`sidebar.group-order.${e}`}function O(e){try{const t=localStorage.getItem(e),r=t?JSON.parse(t):[];return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}catch{return[]}}function j(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}function K(e){const t=I(e),r=h.get(t);if(r)return r;const n=b.sidebarGroupOrder(e.orgId,e.userId);let c=!1;try{c=localStorage.getItem(n)!==null}catch{}let o=O(n);if(!c&&o.length===0&&e.userId!=="anon"){const a=O(T(e.orgId));a.length>0&&(o=a)}return h.set(t,o),o}function k(e,t){const r=new Set(t);return K(e).filter(n=>!r.has(n))}function D(e,t){h.set(I(e),t),j(b.sidebarGroupOrder(e.orgId,e.userId),t)}function J(e,t,r=[]){if(r.includes(t))return;const n=k(e,r);n.includes(t)||D(e,[t,...n])}const v=[],L=()=>()=>{};function V(e){return(e??[]).filter(t=>!!t.pinned).map(t=>t.id)}function X(){const e=y.c(14),t=C(),{org:r}=$(),n=_(),{data:c}=E.useSession(),o=c?.user?.id??"anon";let a;e[0]!==n?(a=V(n),e[0]=n,e[1]=a):a=e[1];const u=a,l=N(),s=P();let i;e[2]!==s?.threads.get?(i=s?.threads.get??H,e[2]=s?.threads.get,e[3]=i):i=e[3];let f;e[4]!==s?.threads.get?(f=s?.threads.get??B,e[4]=s?.threads.get,e[5]=f):f=e[5];const m=d.useSyncExternalStore(s?.threads.subscribe??L,i,f);let g;return e[6]!==l||e[7]!==t||e[8]!==r.id||e[9]!==r.slug||e[10]!==u||e[11]!==o||e[12]!==m?(g=(p,x)=>{J({orgId:r.id,userId:o},p,u),l();const R=w(m,p)?.id??crypto.randomUUID();t({to:"/$org/$taskId",params:{org:r.slug,taskId:R},search:{...x?.search??{},virtualmcpid:p}})},e[6]=l,e[7]=t,e[8]=r.id,e[9]=r.slug,e[10]=u,e[11]=o,e[12]=m,e[13]=g):g=e[13],g}function B(){return v}function H(){return v}export{Q as S,N as a,J as b,X as c,V as g,W as u};
@@ -1 +1 @@
1
- import{c as x,$ as j,a as i}from"./index-3wANCPRO.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{c as x,$ as j,a as i}from"./index-7EDQs4g5.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
@@ -1 +1 @@
1
- import{c as u,k as S,p as l,d as y,K as c}from"./index-3wANCPRO.js";function w(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoStatus(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/status`);if(!r.ok)throw new Error("Failed to check SSO status");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function q(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoConfig(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`);if(!r.ok)throw new Error("Failed to fetch SSO config");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function C(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!f.ok){const p=await f.json();throw new Error(p.error||"Failed to save SSO config")}return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function O(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`,{method:"DELETE"});if(!r.ok)throw new Error("Failed to delete SSO config");return r.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function m(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:r})});if(!f.ok)throw new Error("Failed to toggle SSO enforcement");return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}export{q as a,C as b,O as c,m as d,w as u};
1
+ import{c as u,k as S,p as l,d as y,K as c}from"./index-7EDQs4g5.js";function w(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoStatus(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/status`);if(!r.ok)throw new Error("Failed to check SSO status");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function q(o,a){const e=u.c(8);let s;e[0]!==o?(s=c.orgSsoConfig(o??""),e[0]=o,e[1]=s):s=e[1];let t;e[2]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`);if(!r.ok)throw new Error("Failed to fetch SSO config");return r.json()},e[2]=a,e[3]=t):t=e[3];const n=!!o&&!!a;let i;return e[4]!==s||e[5]!==t||e[6]!==n?(i={queryKey:s,queryFn:t,enabled:n},e[4]=s,e[5]=t,e[6]=n,e[7]=i):i=e[7],S(i)}function C(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!f.ok){const p=await f.json();throw new Error(p.error||"Failed to save SSO config")}return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function O(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async()=>{const r=await fetch(`/api/${a}/sso/config`,{method:"DELETE"});if(!r.ok)throw new Error("Failed to delete SSO config");return r.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}function m(o,a){const e=u.c(8),s=l();let t;e[0]!==a?(t=async r=>{const f=await fetch(`/api/${a}/sso/config/enforce`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enforced:r})});if(!f.ok)throw new Error("Failed to toggle SSO enforcement");return f.json()},e[0]=a,e[1]=t):t=e[1];let n;e[2]!==o||e[3]!==s?(n=()=>{s.invalidateQueries({queryKey:c.orgSsoConfig(o)}),s.invalidateQueries({queryKey:c.orgSsoStatus(o)})},e[2]=o,e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==t||e[6]!==n?(i={mutationFn:t,onSuccess:n},e[5]=t,e[6]=n,e[7]=i):i=e[7],y(i)}export{q as a,C as b,O as c,m as d,w as u};
@@ -1 +1 @@
1
- import{u as R}from"./use-org-auth-client-D8i1yzzN.js";import{$ as b,k as P,K as y}from"./index-3wANCPRO.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
1
+ import{u as R}from"./use-org-auth-client-CYHJ8zhf.js";import{$ as b,k as P,K as y}from"./index-7EDQs4g5.js";const w=[{value:"owner",label:"Owner",isBuiltin:!0},{value:"admin",label:"Admin",isBuiltin:!0},{value:"user",label:"User",isBuiltin:!0}];function B(t){return t.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function O(t){if(!t)return{staticPermissions:[],allowsAllStaticPermissions:!1,connectionIds:[],allowsAllConnections:!1,toolNames:[],allowsAllTools:!1,modelCount:0,allowsAllModels:!1};const n=[];let i=!1;const u=[];let c=!1;const a=new Set;let s=!1,f=0,e=!1;for(const[l,o]of Object.entries(t)){if(l==="self"){o.includes("*")?i=!0:n.push(...o);continue}if(l==="models"){o.includes("*:*")?e=!0:f=o.length;continue}if(l==="*"){if(c=!0,o.includes("*"))s=!0;else for(const r of o)a.add(r);continue}if(u.push(l),o.includes("*"))s=!0;else for(const r of o)a.add(r)}return{staticPermissions:n,allowsAllStaticPermissions:i,connectionIds:u,allowsAllConnections:c,toolNames:Array.from(a),allowsAllTools:s,modelCount:f,allowsAllModels:e}}function I(){const{locator:t}=b(),n=R(),{data:i,isLoading:u,error:c,refetch:a}=P({queryKey:y.organizationRoles(t),queryFn:async()=>{try{const e=await n.organization.listRoles();return e?.error?(console.error("[useOrganizationRoles] API error:",e.error),[]):e?.data??[]}catch(e){return console.error("[useOrganizationRoles] Fetch error:",e),[]}},staleTime:3e4}),s=w.map(e=>({role:e.value,label:e.label,isBuiltin:e.isBuiltin}));if(i&&Array.isArray(i))for(const e of i){const l=e.role;if(!l||w.some(h=>h.value===l))continue;const{staticPermissions:o,allowsAllStaticPermissions:r,connectionIds:g,allowsAllConnections:m,toolNames:p,allowsAllTools:d,modelCount:C,allowsAllModels:A}=O(e.permission);s.push({id:e.id,role:l,label:B(l),isBuiltin:!1,permission:e.permission??void 0,staticPermissionCount:r?-1:o.length,allowsAllStaticPermissions:r,connectionCount:m?-1:g.length,allowsAllConnections:m,toolCount:d?-1:p.length,allowsAllTools:d,modelCount:A?-1:C,allowsAllModels:A})}const f=s.filter(e=>!e.isBuiltin);return{roles:s,customRoles:f,builtinRoles:s.filter(e=>e.isBuiltin),isLoading:u,error:c,refetch:a}}export{I as u};
@@ -1 +1 @@
1
- import{c as l,$ as _,k as b,K as f,p as E,d as z,r as D}from"./index-3wANCPRO.js";import{W as R}from"./constants-B72Xmt_K.js";import{c as $,u as G}from"./studio-tools-CTbP1rvS.js";const I={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,task_board_enabled:!1},k={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function N(t,e){return{queryKey:f.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function g(t){const e=l.c(6),{org:s}=_();let n;e[0]!==s.id||e[1]!==s.slug?(n=N(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const a=t;let i;return e[3]!==n||e[4]!==a?(i={...n,select:a},e[3]=n,e[4]=a,e[5]=i):i=e[5],b(i)}function W(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=N(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:a}=b(n);return a??null}function y(){const t=l.c(9),{org:e}=_(),s=G(),n=E();let a;t[0]!==e||t[1]!==s?(a=async u=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=a):a=t[2];let i;t[3]!==e||t[4]!==n?(i=u=>{n.setQueryData(f.organizationSettings(e.id),o=>({...o??I,...u}))},t[3]=e,t[4]=n,t[5]=i):i=t[5];let r;return t[6]!==a||t[7]!==i?(r={mutationFn:a,onSuccess:i},t[6]=a,t[7]=i,t[8]=r):r=t[8],z(r)}function M(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:k}function Z(){const{data:t}=g(Q);return t??k}function Q(t){return M(t.simple_mode)}function F(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({simple_mode:i},r),n=(i,r)=>e.mutateAsync({simple_mode:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function j(){const{data:t}=g(C);return t??!1}function C(t){return t.task_board_enabled??!1}function L(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({task_board_enabled:i},r),n=(i,r)=>e.mutateAsync({task_board_enabled:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function P(){const{data:t}=g(U);return t??null}function U(t){return t.registry_config}function v(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({registry_config:i},r),n=(i,r)=>e.mutateAsync({registry_config:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function J(){const{data:t}=g(x);return t??null}function x(t){return t.default_home_agents}function q(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({default_home_agents:i},r),n=(i,r)=>e.mutateAsync({default_home_agents:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function V(){const t=l.c(14),{org:e}=_(),s=q(),n=E();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=Promise.resolve(),t[0]=a):a=t[0];const i=D.useRef(a);let r;t[1]!==e.id?(r=f.organizationSettings(e.id),t[1]=e.id,t[2]=r):r=t[2];const u=r;let o;t[3]!==u||t[4]!==n?(o=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=o):o=t[5];const p=o;let m;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(m=O=>{const T=i.current.then(async()=>{const A=n.getQueryData(u),S=O(A?.default_home_agents?.ids??[]);if(S!==null){n.setQueryData(u,c=>c&&{...c,default_home_agents:{ids:S}});try{await s.mutateAsync({ids:S}),await n.refetchQueries({queryKey:f.homeNextActions(e.slug),type:"active"})}catch(c){const w=c;throw n.setQueryData(u,A),w}}});return i.current=T.catch(K),T},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=m):m=t[10];const h=m;let d;return t[11]!==h||t[12]!==p?(d={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=d):d=t[13],d}function K(){}function X(){const t=l.c(5),{org:e}=_(),s=P();let n;t[0]!==e.id?(n=R.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const a=n;let i;return t[2]!==a||t[3]!==s?(i=r=>{if(!s)return r===a;const u=s.registries[r];return u?u.enabled:r===a},t[2]=a,t[3]=s,t[4]=i):i=t[4],i}export{V as a,j as b,X as c,W as d,L as e,Z as f,F as g,P as h,v as i,J as u};
1
+ import{c as l,$ as _,k as b,K as f,p as E,d as z,r as D}from"./index-7EDQs4g5.js";import{W as R}from"./constants-B72Xmt_K.js";import{c as $,u as G}from"./studio-tools-DbeWVKwZ.js";const I={organizationId:"",sidebar_items:null,enabled_plugins:null,registry_config:null,simple_mode:null,default_home_agents:null,task_board_enabled:!1},k={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function N(t,e){return{queryKey:f.organizationSettings(e),queryFn:async()=>{try{return await $(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...I,organizationId:e}}},staleTime:6e4}}function g(t){const e=l.c(6),{org:s}=_();let n;e[0]!==s.id||e[1]!==s.slug?(n=N(s.slug,s.id),e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const a=t;let i;return e[3]!==n||e[4]!==a?(i={...n,select:a},e[3]=n,e[4]=a,e[5]=i):i=e[5],b(i)}function W(t,e){const s=l.c(3);let n;s[0]!==t||s[1]!==e?(n=N(e,t),s[0]=t,s[1]=e,s[2]=n):n=s[2];const{data:a}=b(n);return a??null}function y(){const t=l.c(9),{org:e}=_(),s=G(),n=E();let a;t[0]!==e||t[1]!==s?(a=async u=>{const o=await s.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...u});if(!o)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return o},t[0]=e,t[1]=s,t[2]=a):a=t[2];let i;t[3]!==e||t[4]!==n?(i=u=>{n.setQueryData(f.organizationSettings(e.id),o=>({...o??I,...u}))},t[3]=e,t[4]=n,t[5]=i):i=t[5];let r;return t[6]!==a||t[7]!==i?(r={mutationFn:a,onSuccess:i},t[6]=a,t[7]=i,t[8]=r):r=t[8],z(r)}function M(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:k}function Z(){const{data:t}=g(Q);return t??k}function Q(t){return M(t.simple_mode)}function F(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({simple_mode:i},r),n=(i,r)=>e.mutateAsync({simple_mode:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function j(){const{data:t}=g(C);return t??!1}function C(t){return t.task_board_enabled??!1}function L(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({task_board_enabled:i},r),n=(i,r)=>e.mutateAsync({task_board_enabled:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function P(){const{data:t}=g(U);return t??null}function U(t){return t.registry_config}function v(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({registry_config:i},r),n=(i,r)=>e.mutateAsync({registry_config:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function J(){const{data:t}=g(x);return t??null}function x(t){return t.default_home_agents}function q(){const t=l.c(7),e=y();let s,n;t[0]!==e?(s=(i,r)=>e.mutate({default_home_agents:i},r),n=(i,r)=>e.mutateAsync({default_home_agents:i},r),t[0]=e,t[1]=s,t[2]=n):(s=t[1],n=t[2]);let a;return t[3]!==e||t[4]!==s||t[5]!==n?(a={...e,mutate:s,mutateAsync:n},t[3]=e,t[4]=s,t[5]=n,t[6]=a):a=t[6],a}function V(){const t=l.c(14),{org:e}=_(),s=q(),n=E();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=Promise.resolve(),t[0]=a):a=t[0];const i=D.useRef(a);let r;t[1]!==e.id?(r=f.organizationSettings(e.id),t[1]=e.id,t[2]=r):r=t[2];const u=r;let o;t[3]!==u||t[4]!==n?(o=()=>n.getQueryData(u)?.default_home_agents?.ids??[],t[3]=u,t[4]=n,t[5]=o):o=t[5];const p=o;let m;t[6]!==u||t[7]!==e.slug||t[8]!==n||t[9]!==s?(m=O=>{const T=i.current.then(async()=>{const A=n.getQueryData(u),S=O(A?.default_home_agents?.ids??[]);if(S!==null){n.setQueryData(u,c=>c&&{...c,default_home_agents:{ids:S}});try{await s.mutateAsync({ids:S}),await n.refetchQueries({queryKey:f.homeNextActions(e.slug),type:"active"})}catch(c){const w=c;throw n.setQueryData(u,A),w}}});return i.current=T.catch(K),T},t[6]=u,t[7]=e.slug,t[8]=n,t[9]=s,t[10]=m):m=t[10];const h=m;let d;return t[11]!==h||t[12]!==p?(d={currentIds:p,apply:h},t[11]=h,t[12]=p,t[13]=d):d=t[13],d}function K(){}function X(){const t=l.c(5),{org:e}=_(),s=P();let n;t[0]!==e.id?(n=R.REGISTRY(e.id),t[0]=e.id,t[1]=n):n=t[1];const a=n;let i;return t[2]!==a||t[3]!==s?(i=r=>{if(!s)return r===a;const u=s.registries[r];return u?u.enabled:r===a},t[2]=a,t[3]=s,t[4]=i):i=t[4],i}export{V as a,j as b,X as c,W as d,L as e,Z as f,F as g,P as h,v as i,J as u};
@@ -1 +1 @@
1
- import{c as C,$ as R}from"./index-3wANCPRO.js";import{u as p}from"./use-connection-DlA7SbYu.js";import{W as a}from"./constants-B72Xmt_K.js";import{h as y}from"./use-organization-settings-DXQvxmVp.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
1
+ import{c as C,$ as R}from"./index-7EDQs4g5.js";import{u as p}from"./use-connection-Cod3M0Uh.js";import{W as a}from"./constants-B72Xmt_K.js";import{h as y}from"./use-organization-settings-BM7m28RI.js";function M(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{M as u};
@@ -1 +1 @@
1
- import{c as r,$ as a,K as c,L as f,p as y,d as S}from"./index-3wANCPRO.js";import{u as l}from"./studio-tools-CTbP1rvS.js";function p(){const e=r.c(7),{org:o}=a(),u=l();let i;e[0]!==o.id?(i=c.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=f(s);return n.secrets}function C(){const e=r.c(8),{org:o}=a(),u=l(),i=y();let t;e[0]!==u?(t=async d=>await u.call("SECRET_CREATE",{...d}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:c.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{C as a,p as u};
1
+ import{c as r,$ as a,K as c,L as f,p as y,d as S}from"./index-7EDQs4g5.js";import{u as l}from"./studio-tools-DbeWVKwZ.js";function p(){const e=r.c(7),{org:o}=a(),u=l();let i;e[0]!==o.id?(i=c.secrets(o.id),e[0]=o.id,e[1]=i):i=e[1];let t;e[2]!==u?(t=async()=>await u.call("SECRET_LIST",{}),e[2]=u,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:n}=f(s);return n.secrets}function C(){const e=r.c(8),{org:o}=a(),u=l(),i=y();let t;e[0]!==u?(t=async d=>await u.call("SECRET_CREATE",{...d}),e[0]=u,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:c.secrets(o.id)})},e[2]=o,e[3]=i,e[4]=s):s=e[4];let n;return e[5]!==t||e[6]!==s?(n={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=n):n=e[7],S(n)}export{C as a,p as u};
@@ -1 +1 @@
1
- import{c as r,a1 as u}from"./index-3wANCPRO.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-BRR71e9n.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
1
+ import{c as r,a1 as u}from"./index-7EDQs4g5.js";import{p as i,q as c}from"./question-004-sINsf4GQ.js";import{u as f}from"./use-decopilot-events-uGcsF--z.js";const p=new Set(["completed","failed","requires_action"]);function q(s){const e=r.c(5),[n]=u();let t;e[0]!==n?(t=o=>{n.enableSounds&&p.has(o.data.status)&&i(c.dataUri).catch(l)},e[0]=n,e[1]=t):t=e[1];let a;e[2]!==s||e[3]!==t?(a={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=a):a=e[4],f(a)}function l(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
@@ -1 +1 @@
1
- import{c as p,r as f}from"./index-3wANCPRO.js";import{u as w}from"./use-mobile-DVBpVOpv.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
1
+ import{c as p,r as f}from"./index-7EDQs4g5.js";import{u as w}from"./use-mobile-Cs5uj2B4.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
@@ -1 +1 @@
1
- import{c as a,$ as d,ah as P,k as p}from"./index-3wANCPRO.js";import{b as L,a as S,u as V}from"./use-collections-C3a6O1Kf.js";import{u as g}from"./use-mcp-client-CqQQWnQv.js";import{S as f}from"./constants-B72Xmt_K.js";function b(e){const t=a.c(5);let s;t[0]!==e?(s=e===void 0?{}:e,t[0]=e,t[1]=s):s=t[1];const i=s,{org:n}=d();let o;t[2]!==n.id||t[3]!==n.slug?(o={connectionId:f,orgId:n.id,orgSlug:n.slug},t[2]=n.id,t[3]=n.slug,t[4]=o):o=t[4];const l=g(o);return L(n.id,"VIRTUAL_MCP",l,i)}function R(e){const t=a.c(3),{org:s}=d();let i;t[0]!==s.id||t[1]!==s.slug?(i={connectionId:f,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=i):i=t[2];const n=g(i);return V(s.id,"VIRTUAL_MCP",e??void 0,n)}function $(e){const t=a.c(15),{org:s}=d();let i;t[0]!==s.id||t[1]!==s.slug?(i={connectionId:f,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=i):i=t[2];const n=g(i);let o,l,c;t[3]!==e||t[4]!==s.id?(o=[...e].sort(),c=p,l=P.virtualMcpLastUsed(s.id,o),t[3]=e,t[4]=s.id,t[5]=o,t[6]=l,t[7]=c):(o=t[5],l=t[6],c=t[7]);const m=o.length>0;let u;t[8]!==n||t[9]!==o?(u=async()=>{const M=(await n.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},C=new Map;for(const I of M.items)C.set(I.id,I);return C},t[8]=n,t[9]=o,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==m||t[13]!==u?(r={queryKey:l,enabled:m,staleTime:3e4,queryFn:u},t[11]=l,t[12]=m,t[13]=u,t[14]=r):r=t[14],c(r)}function E(){const e=a.c(3),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const i=g(s);return S(t.id,"VIRTUAL_MCP",i)}export{b as a,E as b,$ as c,R as u};
1
+ import{c as a,$ as d,ah as P,k as p}from"./index-7EDQs4g5.js";import{b as L,a as S,u as V}from"./use-collections-DXG9rjJ2.js";import{u as g}from"./use-mcp-client-D-IcrlM1.js";import{S as f}from"./constants-B72Xmt_K.js";function b(e){const t=a.c(5);let s;t[0]!==e?(s=e===void 0?{}:e,t[0]=e,t[1]=s):s=t[1];const i=s,{org:n}=d();let o;t[2]!==n.id||t[3]!==n.slug?(o={connectionId:f,orgId:n.id,orgSlug:n.slug},t[2]=n.id,t[3]=n.slug,t[4]=o):o=t[4];const l=g(o);return L(n.id,"VIRTUAL_MCP",l,i)}function R(e){const t=a.c(3),{org:s}=d();let i;t[0]!==s.id||t[1]!==s.slug?(i={connectionId:f,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=i):i=t[2];const n=g(i);return V(s.id,"VIRTUAL_MCP",e??void 0,n)}function $(e){const t=a.c(15),{org:s}=d();let i;t[0]!==s.id||t[1]!==s.slug?(i={connectionId:f,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=i):i=t[2];const n=g(i);let o,l,c;t[3]!==e||t[4]!==s.id?(o=[...e].sort(),c=p,l=P.virtualMcpLastUsed(s.id,o),t[3]=e,t[4]=s.id,t[5]=o,t[6]=l,t[7]=c):(o=t[5],l=t[6],c=t[7]);const m=o.length>0;let u;t[8]!==n||t[9]!==o?(u=async()=>{const M=(await n.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},C=new Map;for(const I of M.items)C.set(I.id,I);return C},t[8]=n,t[9]=o,t[10]=u):u=t[10];let r;return t[11]!==l||t[12]!==m||t[13]!==u?(r={queryKey:l,enabled:m,staleTime:3e4,queryFn:u},t[11]=l,t[12]=m,t[13]=u,t[14]=r):r=t[14],c(r)}function E(){const e=a.c(3),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:f,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const i=g(s);return S(t.id,"VIRTUAL_MCP",i)}export{b as a,E as b,$ as c,R as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./use-infinite-scroll-Ds-wB394.js";import{cy as i}from"./index-7EDQs4g5.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./use-infinite-scroll-Ds-wB394.js";import{cy as u,F as n}from"./index-7EDQs4g5.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +1 @@
1
- import{c as V,r as U,j as s,l as J,B as Y}from"./index-3wANCPRO.js";import{f as ct}from"./agent-icon-Jbiz_GlE.js";import{n as mt,a as et}from"./Loading02-BtqTcbc-.js";import{i as pt}from"./ChevronRight-0-moit0s.js";import{L as dt}from"./label-CoVhr6uF.js";import{A as rt}from"./automation-runs-2FK11Uq8.js";import{S as ft}from"./switch-OeBXOHbU.js";import{a as ut,T as ht,b as gt}from"./tooltip-CZrkvlI-.js";import{V as xt}from"./view-mode-toggle-BtNX-3na.js";import"./AlertCircle-CWo2w3Rs.js";import"./Tool01-CbCiOrgD.js";import"./SwitchHorizontal01-BMtwwLBl.js";import"./Settings02-BJM4-roS.js";import"./XCircle-DYs03cv5.js";import"./ArrowUpRight-Bmg39pV9.js";import"./ZapSquare-D3nXDwPD.js";import"./Users03-BflqY5Bb.js";import"./CheckCircle-M6H5ZlJ0.js";import"./Check-DRzA-dpx.js";import"./ChevronDown-CLHpWdSG.js";import"./ChevronUp-BfATOATf.js";import"./Circle-BbviKruX.js";import"./Stars02-mQKhQQrM.js";import"./Copy01-0cR9vc8q.js";import"./ZoomOut-CoQZkFi6.js";import"./DotsVertical-BYgPyTRF.js";import"./Globe01-UNsFBAF6.js";import"./Eye-C3PjUbDk.js";import"./FilterLines-AcRSKyYZ.js";import"./Star01-CezMYimm.js";import"./Globe04-Cvug-N8n.js";import"./HardDrive-hN1jZwmH.js";import"./Key01-_uA23D4r.js";import"./LayoutLeft-P3T11G8U.js";import"./LinkExternal01-yVpYk0TA.js";import"./List-BDtpMLbg.js";import"./Monitor01-Ca-mpyh5.js";import"./Sun-4EkFOfwd.js";import"./Palette-DoccA0gP.js";import"./Play-DamNmHjz.js";import"./Plus-DOMy9gvN.js";import"./SearchLg-CgRpLS5P.js";import"./SearchMd-aI0z5N9j.js";import"./Shield01-DUr3YuOr.js";import"./Stars01-c5pA30a9.js";import"./Trash01-BPtww6NG.js";import"./Upload01-Bv5V53rT.js";import"./User01-BYDmkbvV.js";import"./Users01-CbN3qRM8.js";import"./XClose-D5jBGhZu.js";import"./X-Cb1IaFkf.js";import"./Zap-_LBawPer.js";import"./select-DVZc4E4V.js";import"./useInfiniteQuery-WADEvwcp.js";import"./use-infinite-scroll-CXObKcMM.js";import"./use-connection-DlA7SbYu.js";import"./use-collections-C3a6O1Kf.js";import"./use-mcp-client-CqQQWnQv.js";import"./constants-B72Xmt_K.js";import"./auth-sGPw4pzN.js";import"./use-virtual-mcp-DTthhqWL.js";import"./card-w-ZXXB57.js";import"./sidebar-BbmkzDwj.js";import"./use-mobile-DVBpVOpv.js";import"./table-B2Fi-xgN.js";import"./empty-state-CSfhHKVd.js";import"./use-members-DQRLt-ZP.js";import"./use-org-auth-client-D8i1yzzN.js";import"./use-clock-tick-D0StcXXM.js";import"./use-automations-Btrbiz8v.js";import"./studio-tools-CTbP1rvS.js";import"./useSuspenseInfiniteQuery-fFFo_5V2.js";import"./badge-zW2D6RON.js";import"./checkbox-DtrpBIFz.js";import"./command-BO3Cnpvg.js";import"./index-0_QD3N3p.js";import"./dialog-D4tuLdKg.js";import"./popover-LegBHHPI.js";import"./avatar-DCYC0Ovl.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DUBRfsw_.js";import"./file-type-icon-CzWNCoZC.js";import"./tab-id-DznSzCvK.js";import"./monaco-editor-PvgfmQvG.js";import"./index-D1Il2d7T.js";import"./chat-context-BE6mo9bu.js";import"./autosend-DRXerSlp.js";import"./hooks-CV3ote7A.js";import"./decopilot-sse-pool-H5PWohfg.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CqbJz7ty.js";import"./use-decopilot-events-BRR71e9n.js";import"./use-organization-settings-DXQvxmVp.js";import"./types-CN46hG-C.js";import"./shell-layout-Dm40raSF.js";import"./alert-dialog-A1BqEuAN.js";import"./required-auth-layout-DjSRL58t.js";import"./use-org-sso-4OxOQasz.js";import"./integration-icon-CZWFT3DW.js";import"./use-navigate-to-agent-DHQynKWI.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-5VgIENjN.js";import"./form-V_XI11Kc.js";import"./input-NG03AkXE.js";const bt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),yt=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Tt=new Date(-864e13),vt=new Date(864e13),jt=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,Nt=/\/flags\/multivariate\.ts$/;function wt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function kt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",l=typeof r=="string";if(!n&&!l)return null;const o=n?new Date(t):Tt,m=l?new Date(r):vt;return Number.isNaN(o.getTime())||Number.isNaN(m.getTime())||n&&l&&m.getTime()<=o.getTime()?null:{start:o,end:m,openStart:!n,openEnd:!l}}function nt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(bt.has(r)){const n=kt(e);n&&t.push(n);return}if(yt.has(r)){const n=e.matchers;if(Array.isArray(n))for(const l of n)nt(l,t)}}}function _t(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!jt.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Mt(e){if(typeof e=="string"){const a=e.trim();if(a.length===0)return null;try{const i=new URL(a).pathname.split("/").filter(Boolean),p=i[i.length-1];if(p)return decodeURIComponent(p)}catch{}return a.length>80?`${a.slice(0,77)}…`:a}if(!e||typeof e!="object")return null;const t=e,r=t.config,l=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,l?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const a of o)if(typeof a=="string"&&a.trim().length>0)return a.trim();const m=t.__resolveType;if(typeof m=="string"){const c=(m.split("/").pop()??m).replace(/\.(tsx?|jsx?)$/i,"");if(c.length>0)return c}return null}function Et(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function W(e,t,r,n,l){if(_t(e)){const o=e.variants,m=e.__resolveType,a=Nt.test(m)?"":Et(n);o.forEach((c,i)=>{if(!c||typeof c!="object")return;const p=c,d=[];if(nt(p.rule,d),d.length===0)return;const x=Mt(p.value)??(a||r);for(const h of d)l.push({blockKey:t,blockLabel:r,innerPath:a,variantIndex:i,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:m})});for(let c=0;c<o.length;c++){const i=o[c];i&&typeof i=="object"&&W(i.value,t,r,[...n,"variants",c,"value"],l)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)W(e[o],t,r,[...n,o],l);return}if(e&&typeof e=="object")for(const[o,m]of Object.entries(e))o!=="__resolveType"&&W(m,t,r,[...n,o],l)}function St(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))W(n,r,wt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function At(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,l)=>{const o=l*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),r}const Dt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ot(e,t){return e.get(t)??Dt}const $t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["January","February","March","April","May","June","July","August","September","October","November","December"],it=1440*60*1e3;function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){return new Date(e.getFullYear(),e.getMonth(),1)}function F(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function z(e,t){const r=new Date(e);return r.setDate(r.getDate()+t),r}function K(e,t){return Math.round((P(e).getTime()-P(t).getTime())/it)}function Ct(e){const t=(e.getTime()-P(e).getTime())/it;return Math.min(Math.max(t,0),1)}function q(e,t){return K(e,t)+Ct(e)}function Rt(e){const t=z(e,-e.getDay()),r=[];for(let n=0;n<6;n++){const l=[];for(let o=0;o<7;o++)l.push(z(t,n*7+o));r.push(l)}for(;r.length>0&&r[r.length-1].every(n=>n.getMonth()!==e.getMonth());)r.pop();return r}function Lt(e,t){const r=P(e[0]),n=z(r,7),l=r.getTime(),o=n.getTime(),m=[];for(const i of t){const p=P(i.start),d=P(i.end);if(d.getTime()<r.getTime()||p.getTime()>=n.getTime())continue;const u=p.getTime()<r.getTime()?r:p,x=d.getTime()>=n.getTime()?z(n,-1):d,h=K(u,r),g=K(x,u)+1;if(g<=0)continue;const b=Math.max(i.start.getTime(),l),y=Math.min(i.end.getTime(),o),T=q(new Date(b),r),f=Math.max(q(new Date(y),r)-T,0);f<=0||m.push({variant:i,startCol:h,span:g,leftUnits:T,widthUnits:f})}m.sort((i,p)=>i.startCol-p.startCol||p.span-i.span||i.variant.blockKey.localeCompare(p.variant.blockKey));const a=[],c=[];for(const i of m){let p=a.findIndex(d=>d<=i.startCol);p===-1&&(p=a.length,a.push(0)),a[p]=i.startCol+i.span,c.push({...i,lane:p})}return c}const Q=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ot(e){const t=e.openStart?"Always":Q.format(e.start),r=e.openEnd?"Ongoing":Q.format(e.end);return`${t} → ${r}`}function Pt(e){const t=V.c(17),{variant:r}=e;let n;t[0]!==r.blockLabel?(n=s.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=n):n=t[1];let l;t[2]!==r.innerPath?(l=r.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=l):l=t[3];let o;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(o=r.label!==r.blockLabel&&r.label!==r.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=o):o=t[7];let m;t[8]!==r?(m=Ot(r),t[8]=r,t[9]=m):m=t[9];let a;t[10]!==m?(a=s.jsx("div",{className:"mt-1",children:m}),t[10]=m,t[11]=a):a=t[11];let c;return t[12]!==n||t[13]!==l||t[14]!==o||t[15]!==a?(c=s.jsx(gt,{children:s.jsxs("div",{className:"text-xs",children:[n,l,o,a]})}),t[12]=n,t[13]=l,t[14]=o,t[15]=a,t[16]=c):c=t[16],c}const X=16;function It(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${X}px, #000 calc(100% - ${X}px), ${n})`}function lt(e){const t=V.c(26),{variant:r,color:n,style:l,children:o,fadeStart:m,fadeEnd:a}=e,c=m===void 0?!1:m,i=a===void 0?!1:a;let p;t[0]!==i||t[1]!==c?(p=It(c,i),t[0]=i,t[1]=c,t[2]=p):p=t[2];const d=p;let u;t[3]!==c?(u=c&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=c,t[4]=u):u=t[4];let x;t[5]!==i?(x=i&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=i,t[6]=x):x=t[6];let h;t[7]!==d?(h=d&&{maskImage:d,WebkitMaskImage:d},t[7]=d,t[8]=h):h=t[8];let g;t[9]!==n.bg||t[10]!==n.text||t[11]!==l||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:n.bg,color:n.text,borderRadius:4,...u,...x,...h,...l},t[9]=n.bg,t[10]=n.text,t[11]=l,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let y;t[18]!==g||t[19]!==b?(y=s.jsx(ut,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=y):y=t[20];let T;t[21]!==r?(T=s.jsx(Pt,{variant:r}),t[21]=r,t[22]=T):T=t[22];let f;return t[23]!==T||t[24]!==y?(f=s.jsxs(ht,{children:[y,T]}),t[23]=T,t[24]=y,t[25]=f):f=t[25],f}function Qr(e){const t=V.c(49),{decofile:r}=e,[n,l]=U.useState("calendar"),[o,m]=U.useState(Bt),[a,c]=U.useState(!1);let i,p,d;if(t[0]!==r||t[1]!==a){const S=St(r);i=S.filter(Ht).length,d=a?S:S.filter(Vt),p=At(d.map(Ft)),t[0]=r,t[1]=a,t[2]=i,t[3]=p,t[4]=d}else i=t[2],p=t[3],d=t[4];const u=p;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>m(at(new Date)),t[5]=x):x=t[5];const h=x;let g;t[6]!==n?(g=()=>m(S=>n==="calendar"?F(S,-1):F(S,-3)),t[6]=n,t[7]=g):g=t[7];const b=g;let y;t[8]!==n?(y=()=>m(S=>n==="calendar"?F(S,1):F(S,3)),t[8]=n,t[9]=y):y=t[9];const T=y;let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Y,{variant:"outline",size:"sm",onClick:h,children:"Today"}),t[10]=f):f=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(mt,{size:16}),t[11]=w):w=t[11];let k;t[12]!==b?(k=s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:b,"aria-label":"Previous",children:w}),t[12]=b,t[13]=k):k=t[13];let _;t[14]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(pt,{size:16}),t[14]=_):_=t[14];let M;t[15]!==T?(M=s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:T,"aria-label":"Next",children:_}),t[15]=T,t[16]=M):M=t[16];const A=st[o.getMonth()];let E;t[17]!==o?(E=o.getFullYear(),t[17]=o,t[18]=E):E=t[18];let v;t[19]!==A||t[20]!==E?(v=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[A," ",E]}),t[19]=A,t[20]=E,t[21]=v):v=t[21];let j;t[22]!==v||t[23]!==k||t[24]!==M?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[f,k,M,v]}),t[22]=v,t[23]=k,t[24]=M,t[25]=j):j=t[25];let D;t[26]!==i||t[27]!==a?(D=i>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ft,{id:"show-ongoing",checked:a,onCheckedChange:c}),s.jsxs(dt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:["Show ongoing (",i,")"]})]}),t[26]=i,t[27]=a,t[28]=D):D=t[28];let L;t[29]===Symbol.for("react.memo_cache_sentinel")?(L={value:"calendar",icon:s.jsx(et,{}),label:"Calendar"},t[29]=L):L=t[29];let I;t[30]===Symbol.for("react.memo_cache_sentinel")?(I=[L,{value:"timeline",icon:s.jsx(ct,{}),label:"Timeline"}],t[30]=I):I=t[30];let N;t[31]!==n?(N=s.jsx(xt,{value:n,onValueChange:l,options:I}),t[31]=n,t[32]=N):N=t[32];let R;t[33]!==D||t[34]!==N?(R=s.jsxs("div",{className:"flex items-center gap-4",children:[D,N]}),t[33]=D,t[34]=N,t[35]=R):R=t[35];let $;t[36]!==j||t[37]!==R?($=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,R]}),t[36]=j,t[37]=R,t[38]=$):$=t[38];let C;t[39]!==u||t[40]!==o||t[41]!==i||t[42]!==a||t[43]!==d||t[44]!==n?(C=d.length===0?s.jsx(Wt,{hiddenOngoing:a?0:i}):n==="calendar"?s.jsx(Ut,{monthStart:o,variants:d,colorMap:u}):s.jsx(Jt,{monthStart:o,variants:d,colorMap:u}),t[39]=u,t[40]=o,t[41]=i,t[42]=a,t[43]=d,t[44]=n,t[45]=C):C=t[45];let O;return t[46]!==$||t[47]!==C?(O=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[$,C]}),t[46]=$,t[47]=C,t[48]=O):O=t[48],O}function Ft(e){return e.blockKey}function Vt(e){return!e.openEnd}function Ht(e){return e.openEnd}function Bt(){return at(new Date)}function Wt(e){const t=V.c(3),{hiddenOngoing:r}=e,n=r===void 0?0:r;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(et,{size:24,className:"text-muted-foreground/60"}),t[0]=l):l=t[0];let o;return t[1]!==n?(o=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[l,n>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:"No dated variants in view."}),s.jsxs("div",{className:"text-xs text-muted-foreground/80",children:[n," ongoing"," ",n===1?"variant is":"variants are"," hidden — enable “Show ongoing” to view."]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:"No scheduled variants."}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]})]}),t[1]=n,t[2]=o):o=t[2],o}const G=20,Z=2,tt=28,zt=6;function Ut(e){const t=V.c(17),{monthStart:r,variants:n,colorMap:l}=e;let o,m,a,c,i;if(t[0]!==l||t[1]!==r||t[2]!==n){const u=Rt(r),x=P(new Date);o=rt,i="flex-1 min-h-0",m="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:$t.map(Gt)}),t[8]=a):a=t[8],c=u.map((h,g)=>{const b=Lt(h,n),y=b.reduce(Yt,0),T=tt+y*(G+Z)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[h.map((f,w)=>{const k=f.getMonth()===r.getMonth(),_=f.getTime()===x.getTime();return s.jsx("div",{className:J("border-r last:border-r-0 px-2 pt-1.5 text-xs",k?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:J("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",_&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},w)}),b.map((f,w)=>{const k=ot(l,f.variant.blockKey),_=tt+f.lane*(G+Z),M=f.leftUnits/7*100,A=f.widthUnits/7*100,E=f.variant.openStart&&g===0,v=f.variant.openEnd&&g===u.length-1;return s.jsxs(lt,{variant:f.variant,color:k,fadeStart:E,fadeEnd:v,style:{top:_,left:`calc(${M}% + 2px)`,width:`calc(${A}% - 4px)`,minWidth:zt,height:G},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",f.variant.label]})]},`${g}-${w}`)})]},g)}),t[0]=l,t[1]=r,t[2]=n,t[3]=o,t[4]=m,t[5]=a,t[6]=c,t[7]=i}else o=t[3],m=t[4],a=t[5],c=t[6],i=t[7];let p;t[9]!==m||t[10]!==a||t[11]!==c?(p=s.jsxs("div",{className:m,children:[a,c]}),t[9]=m,t[10]=a,t[11]=c,t[12]=p):p=t[12];let d;return t[13]!==o||t[14]!==i||t[15]!==p?(d=s.jsx(o,{className:i,children:p}),t[13]=o,t[14]=i,t[15]=p,t[16]=d):d=t[16],d}function Yt(e,t){return Math.max(e,t.lane+1)}function Gt(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const B=4,Kt=32,H=240;function Jt(e){const t=V.c(27),{monthStart:r,variants:n,colorMap:l}=e,o=r;let m,a,c,i,p,d;if(t[0]!==l||t[1]!==r||t[2]!==o||t[3]!==n){const h=F(r,B),g=new Date,b=new Map;for(const v of n){const j=b.get(v.blockKey)??[];j.push(v),b.set(v.blockKey,j)}const y=Array.from(b.entries()).sort(Xt),T=h.getTime()-o.getTime(),f=v=>(Math.max(o.getTime(),Math.min(h.getTime(),v.getTime()))-o.getTime())/T*100;let w;t[10]!==o?(w=(v,j)=>F(o,j),t[10]=o,t[11]=w):w=t[11];const k=Array.from({length:B},w),_=g.getTime()>=o.getTime()&&g.getTime()<=h.getTime()?f(g):null;m=rt,d="flex-1 min-h-0",a="min-w-[900px] relative";let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:H},children:"Variant / Block"}),t[12]=M):M=t[12];let A;t[13]===Symbol.for("react.memo_cache_sentinel")?(A={gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},t[13]=A):A=t[13];const E=k.map(Qt);t[14]!==E?(c=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[M,s.jsx("div",{className:"flex-1 grid",style:A,children:E})]}),t[14]=E,t[15]=c):c=t[15],t[16]!==_?(i=_!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${H}px + (100% - ${H}px) * ${_} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:"Today"})}),t[16]=_,t[17]=i):i=t[17],p=y.map(v=>{const[j,D]=v,L=ot(l,j),I=D[0]?.blockLabel??j;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:H},children:I})}),D.map((N,R)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:Kt},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:H},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:L.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:N.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},children:k.map(qt)}),(()=>{const $=Math.max(N.start.getTime(),o.getTime()),C=Math.min(N.end.getTime(),h.getTime());if(C<=$)return null;const O=f(new Date($)),S=f(new Date(C))-O;return s.jsx(lt,{variant:N,color:L,fadeStart:N.openStart,fadeEnd:N.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${S}% - 2px)`,height:22},children:N.label})})()]})]},R))]},j)}),t[0]=l,t[1]=r,t[2]=o,t[3]=n,t[4]=m,t[5]=a,t[6]=c,t[7]=i,t[8]=p,t[9]=d}else m=t[4],a=t[5],c=t[6],i=t[7],p=t[8],d=t[9];let u;t[18]!==a||t[19]!==c||t[20]!==i||t[21]!==p?(u=s.jsxs("div",{className:a,children:[c,i,p]}),t[18]=a,t[19]=c,t[20]=i,t[21]=p,t[22]=u):u=t[22];let x;return t[23]!==m||t[24]!==d||t[25]!==u?(x=s.jsx(m,{className:d,children:u}),t[23]=m,t[24]=d,t[25]=u,t[26]=x):x=t[26],x}function qt(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function Qt(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[st[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Xt(e,t){return e[0].localeCompare(t[0])}export{Qr as VariantCalendar};
1
+ import{c as V,r as U,j as s,l as J,B as Y}from"./index-7EDQs4g5.js";import{f as ct}from"./agent-icon-Clq9aKDI.js";import{n as mt,a as et}from"./Loading02-DuE9feUL.js";import{i as pt}from"./ChevronRight-DBqOeCeL.js";import{L as dt}from"./label-CREwZHVz.js";import{B as rt}from"./automation-runs-DEj3paI_.js";import{S as ft}from"./switch-D35infLY.js";import{a as ut,T as ht,b as gt}from"./tooltip-Cjk9PMKc.js";import{V as xt}from"./view-mode-toggle-BEPKlxI2.js";import"./AlertCircle-f6lhwhwQ.js";import"./Tool01-D1RRR1kw.js";import"./SwitchHorizontal01-1_z_hHyc.js";import"./Settings02-CkTsdbF0.js";import"./XCircle-DNMYfZsu.js";import"./ArrowUpRight-CSFwuCf5.js";import"./ZapSquare-CDjZJq8r.js";import"./Users03-BW7WVd7l.js";import"./CheckCircle-CApzzqD8.js";import"./Check-Aukmu8Un.js";import"./ChevronDown-B0UKR4Q8.js";import"./ChevronUp-GMJj8UiZ.js";import"./Circle-YviPro1s.js";import"./Stars02-DeVTmo8z.js";import"./Copy01-DE6jIX1d.js";import"./ZoomOut-CdYifXao.js";import"./DotsVertical-CRXCtL95.js";import"./Globe01-9ubWRIn8.js";import"./Eye-DkKR2sGU.js";import"./FilterLines-zo9nIazW.js";import"./Star01-DuQha8zt.js";import"./Globe04-BQ8V1DCS.js";import"./HardDrive-inNtB34T.js";import"./Key01-Ce61Bgp4.js";import"./LayoutLeft-C4Pounbz.js";import"./LinkExternal01-C2NXvx3_.js";import"./List-CoWwn-yg.js";import"./Monitor01-DzUUK9ht.js";import"./Sun-huCAsUzO.js";import"./Palette-Do-v2l7i.js";import"./Play-Ca8SpLNV.js";import"./Plus-D321yWS2.js";import"./SearchLg-BcZgwDj6.js";import"./SearchMd-DJS38wH4.js";import"./Shield01-Bn8V09Ru.js";import"./Stars01-B6X8tGbZ.js";import"./Trash01-BhSSOFCl.js";import"./Upload01-pw6m16iV.js";import"./User01-D3gcuea5.js";import"./Users01-hYhuhjvL.js";import"./XClose-LQHYvxls.js";import"./X-B4-7qG-5.js";import"./Zap-D3B4NAio.js";import"./select-C5NXkaeS.js";import"./useInfiniteQuery-Dul-gPAw.js";import"./use-infinite-scroll-Ds-wB394.js";import"./use-connection-Cod3M0Uh.js";import"./use-collections-DXG9rjJ2.js";import"./use-mcp-client-D-IcrlM1.js";import"./constants-B72Xmt_K.js";import"./auth-BSVfrU7T.js";import"./use-virtual-mcp-C70XD2v5.js";import"./card-D8Vz3jG6.js";import"./sidebar-DgN5oOpi.js";import"./use-mobile-Cs5uj2B4.js";import"./table-CRfKA7NS.js";import"./empty-state-F_lK3gf_.js";import"./use-members-BkrjfZtd.js";import"./use-org-auth-client-CYHJ8zhf.js";import"./use-clock-tick-eW5js56x.js";import"./use-automations-SOkWBo6W.js";import"./studio-tools-DbeWVKwZ.js";import"./useSuspenseInfiniteQuery-0L4EzzOg.js";import"./badge-C262yjLA.js";import"./checkbox-CchykYiZ.js";import"./command-BAIXwHHL.js";import"./index-bSsLqTR8.js";import"./dialog-WEGZiwPy.js";import"./popover-BXSfQ3ty.js";import"./avatar-Dv4V-x92.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CGlHMDea.js";import"./file-type-icon-DEYVlVHX.js";import"./tab-id-DAJ8K7VA.js";import"./monaco-editor-DcSz2nK4.js";import"./index-D1g40hAu.js";import"./chat-context-CBVCBl_J.js";import"./autosend-gxaMEvDD.js";import"./hooks-HnvPO2Fr.js";import"./decopilot-sse-pool-CDHTEmuK.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-qucsliq3.js";import"./use-decopilot-events-uGcsF--z.js";import"./use-organization-settings-BM7m28RI.js";import"./types-DOtTCrPL.js";import"./shell-layout-BQHSPqMr.js";import"./alert-dialog-OcKuMvkx.js";import"./required-auth-layout-DRSJiqlk.js";import"./use-org-sso-ZllsKAXm.js";import"./integration-icon-A9c_bebh.js";import"./use-navigate-to-agent-CdzFundu.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-CjXlqFii.js";import"./form-vGQs6GSc.js";import"./input-AH-zc1xJ.js";const bt=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),yt=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Tt=new Date(-864e13),vt=new Date(864e13),jt=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,Nt=/\/flags\/multivariate\.ts$/;function wt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function kt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,n=typeof t=="string",l=typeof r=="string";if(!n&&!l)return null;const o=n?new Date(t):Tt,m=l?new Date(r):vt;return Number.isNaN(o.getTime())||Number.isNaN(m.getTime())||n&&l&&m.getTime()<=o.getTime()?null:{start:o,end:m,openStart:!n,openEnd:!l}}function nt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(bt.has(r)){const n=kt(e);n&&t.push(n);return}if(yt.has(r)){const n=e.matchers;if(Array.isArray(n))for(const l of n)nt(l,t)}}}function _t(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!jt.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Mt(e){if(typeof e=="string"){const a=e.trim();if(a.length===0)return null;try{const i=new URL(a).pathname.split("/").filter(Boolean),p=i[i.length-1];if(p)return decodeURIComponent(p)}catch{}return a.length>80?`${a.slice(0,77)}…`:a}if(!e||typeof e!="object")return null;const t=e,r=t.config,l=t.desktop?.media,o=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,l?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const a of o)if(typeof a=="string"&&a.trim().length>0)return a.trim();const m=t.__resolveType;if(typeof m=="string"){const c=(m.split("/").pop()??m).replace(/\.(tsx?|jsx?)$/i,"");if(c.length>0)return c}return null}function Et(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];typeof n=="number"?t.length>0?t[t.length-1]+=`[${n}]`:t.push(`[${n}]`):t.push(n)}return t.join(" · ")}function W(e,t,r,n,l){if(_t(e)){const o=e.variants,m=e.__resolveType,a=Nt.test(m)?"":Et(n);o.forEach((c,i)=>{if(!c||typeof c!="object")return;const p=c,d=[];if(nt(p.rule,d),d.length===0)return;const x=Mt(p.value)??(a||r);for(const h of d)l.push({blockKey:t,blockLabel:r,innerPath:a,variantIndex:i,start:h.start,end:h.end,openStart:h.openStart,openEnd:h.openEnd,label:x,flagResolveType:m})});for(let c=0;c<o.length;c++){const i=o[c];i&&typeof i=="object"&&W(i.value,t,r,[...n,"variants",c,"value"],l)}return}if(Array.isArray(e)){for(let o=0;o<e.length;o++)W(e[o],t,r,[...n,o],l);return}if(e&&typeof e=="object")for(const[o,m]of Object.entries(e))o!=="__resolveType"&&W(m,t,r,[...n,o],l)}function St(e){if(!e)return[];const t=[];for(const[r,n]of Object.entries(e))W(n,r,wt(r),[],t);return t.sort((r,n)=>r.start.getTime()-n.start.getTime())}function At(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((n,l)=>{const o=l*137.508%360;r.set(n,{bg:`oklch(0.62 0.14 ${o})`,text:"white",border:`oklch(0.50 0.14 ${o})`})}),r}const Dt={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function ot(e,t){return e.get(t)??Dt}const $t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],st=["January","February","March","April","May","June","July","August","September","October","November","December"],it=1440*60*1e3;function P(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function at(e){return new Date(e.getFullYear(),e.getMonth(),1)}function F(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function z(e,t){const r=new Date(e);return r.setDate(r.getDate()+t),r}function K(e,t){return Math.round((P(e).getTime()-P(t).getTime())/it)}function Ct(e){const t=(e.getTime()-P(e).getTime())/it;return Math.min(Math.max(t,0),1)}function q(e,t){return K(e,t)+Ct(e)}function Rt(e){const t=z(e,-e.getDay()),r=[];for(let n=0;n<6;n++){const l=[];for(let o=0;o<7;o++)l.push(z(t,n*7+o));r.push(l)}for(;r.length>0&&r[r.length-1].every(n=>n.getMonth()!==e.getMonth());)r.pop();return r}function Lt(e,t){const r=P(e[0]),n=z(r,7),l=r.getTime(),o=n.getTime(),m=[];for(const i of t){const p=P(i.start),d=P(i.end);if(d.getTime()<r.getTime()||p.getTime()>=n.getTime())continue;const u=p.getTime()<r.getTime()?r:p,x=d.getTime()>=n.getTime()?z(n,-1):d,h=K(u,r),g=K(x,u)+1;if(g<=0)continue;const b=Math.max(i.start.getTime(),l),y=Math.min(i.end.getTime(),o),T=q(new Date(b),r),f=Math.max(q(new Date(y),r)-T,0);f<=0||m.push({variant:i,startCol:h,span:g,leftUnits:T,widthUnits:f})}m.sort((i,p)=>i.startCol-p.startCol||p.span-i.span||i.variant.blockKey.localeCompare(p.variant.blockKey));const a=[],c=[];for(const i of m){let p=a.findIndex(d=>d<=i.startCol);p===-1&&(p=a.length,a.push(0)),a[p]=i.startCol+i.span,c.push({...i,lane:p})}return c}const Q=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Ot(e){const t=e.openStart?"Always":Q.format(e.start),r=e.openEnd?"Ongoing":Q.format(e.end);return`${t} → ${r}`}function Pt(e){const t=V.c(17),{variant:r}=e;let n;t[0]!==r.blockLabel?(n=s.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=n):n=t[1];let l;t[2]!==r.innerPath?(l=r.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=l):l=t[3];let o;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(o=r.label!==r.blockLabel&&r.label!==r.innerPath&&s.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=o):o=t[7];let m;t[8]!==r?(m=Ot(r),t[8]=r,t[9]=m):m=t[9];let a;t[10]!==m?(a=s.jsx("div",{className:"mt-1",children:m}),t[10]=m,t[11]=a):a=t[11];let c;return t[12]!==n||t[13]!==l||t[14]!==o||t[15]!==a?(c=s.jsx(gt,{children:s.jsxs("div",{className:"text-xs",children:[n,l,o,a]})}),t[12]=n,t[13]=l,t[14]=o,t[15]=a,t[16]=c):c=t[16],c}const X=16;function It(e,t){const r=e?"transparent":"#000 0",n=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${X}px, #000 calc(100% - ${X}px), ${n})`}function lt(e){const t=V.c(26),{variant:r,color:n,style:l,children:o,fadeStart:m,fadeEnd:a}=e,c=m===void 0?!1:m,i=a===void 0?!1:a;let p;t[0]!==i||t[1]!==c?(p=It(c,i),t[0]=i,t[1]=c,t[2]=p):p=t[2];const d=p;let u;t[3]!==c?(u=c&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=c,t[4]=u):u=t[4];let x;t[5]!==i?(x=i&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=i,t[6]=x):x=t[6];let h;t[7]!==d?(h=d&&{maskImage:d,WebkitMaskImage:d},t[7]=d,t[8]=h):h=t[8];let g;t[9]!==n.bg||t[10]!==n.text||t[11]!==l||t[12]!==u||t[13]!==x||t[14]!==h?(g={background:n.bg,color:n.text,borderRadius:4,...u,...x,...h,...l},t[9]=n.bg,t[10]=n.text,t[11]=l,t[12]=u,t[13]=x,t[14]=h,t[15]=g):g=t[15];let b;t[16]!==o?(b=s.jsx("span",{className:"truncate",children:o}),t[16]=o,t[17]=b):b=t[17];let y;t[18]!==g||t[19]!==b?(y=s.jsx(ut,{asChild:!0,children:s.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:g,children:b})}),t[18]=g,t[19]=b,t[20]=y):y=t[20];let T;t[21]!==r?(T=s.jsx(Pt,{variant:r}),t[21]=r,t[22]=T):T=t[22];let f;return t[23]!==T||t[24]!==y?(f=s.jsxs(ht,{children:[y,T]}),t[23]=T,t[24]=y,t[25]=f):f=t[25],f}function Qr(e){const t=V.c(49),{decofile:r}=e,[n,l]=U.useState("calendar"),[o,m]=U.useState(Bt),[a,c]=U.useState(!1);let i,p,d;if(t[0]!==r||t[1]!==a){const S=St(r);i=S.filter(Ht).length,d=a?S:S.filter(Vt),p=At(d.map(Ft)),t[0]=r,t[1]=a,t[2]=i,t[3]=p,t[4]=d}else i=t[2],p=t[3],d=t[4];const u=p;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>m(at(new Date)),t[5]=x):x=t[5];const h=x;let g;t[6]!==n?(g=()=>m(S=>n==="calendar"?F(S,-1):F(S,-3)),t[6]=n,t[7]=g):g=t[7];const b=g;let y;t[8]!==n?(y=()=>m(S=>n==="calendar"?F(S,1):F(S,3)),t[8]=n,t[9]=y):y=t[9];const T=y;let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Y,{variant:"outline",size:"sm",onClick:h,children:"Today"}),t[10]=f):f=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(mt,{size:16}),t[11]=w):w=t[11];let k;t[12]!==b?(k=s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:b,"aria-label":"Previous",children:w}),t[12]=b,t[13]=k):k=t[13];let _;t[14]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(pt,{size:16}),t[14]=_):_=t[14];let M;t[15]!==T?(M=s.jsx(Y,{variant:"ghost",size:"icon",className:"size-8",onClick:T,"aria-label":"Next",children:_}),t[15]=T,t[16]=M):M=t[16];const A=st[o.getMonth()];let E;t[17]!==o?(E=o.getFullYear(),t[17]=o,t[18]=E):E=t[18];let v;t[19]!==A||t[20]!==E?(v=s.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[A," ",E]}),t[19]=A,t[20]=E,t[21]=v):v=t[21];let j;t[22]!==v||t[23]!==k||t[24]!==M?(j=s.jsxs("div",{className:"flex items-center gap-2",children:[f,k,M,v]}),t[22]=v,t[23]=k,t[24]=M,t[25]=j):j=t[25];let D;t[26]!==i||t[27]!==a?(D=i>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ft,{id:"show-ongoing",checked:a,onCheckedChange:c}),s.jsxs(dt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:["Show ongoing (",i,")"]})]}),t[26]=i,t[27]=a,t[28]=D):D=t[28];let L;t[29]===Symbol.for("react.memo_cache_sentinel")?(L={value:"calendar",icon:s.jsx(et,{}),label:"Calendar"},t[29]=L):L=t[29];let I;t[30]===Symbol.for("react.memo_cache_sentinel")?(I=[L,{value:"timeline",icon:s.jsx(ct,{}),label:"Timeline"}],t[30]=I):I=t[30];let N;t[31]!==n?(N=s.jsx(xt,{value:n,onValueChange:l,options:I}),t[31]=n,t[32]=N):N=t[32];let R;t[33]!==D||t[34]!==N?(R=s.jsxs("div",{className:"flex items-center gap-4",children:[D,N]}),t[33]=D,t[34]=N,t[35]=R):R=t[35];let $;t[36]!==j||t[37]!==R?($=s.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,R]}),t[36]=j,t[37]=R,t[38]=$):$=t[38];let C;t[39]!==u||t[40]!==o||t[41]!==i||t[42]!==a||t[43]!==d||t[44]!==n?(C=d.length===0?s.jsx(Wt,{hiddenOngoing:a?0:i}):n==="calendar"?s.jsx(Ut,{monthStart:o,variants:d,colorMap:u}):s.jsx(Jt,{monthStart:o,variants:d,colorMap:u}),t[39]=u,t[40]=o,t[41]=i,t[42]=a,t[43]=d,t[44]=n,t[45]=C):C=t[45];let O;return t[46]!==$||t[47]!==C?(O=s.jsxs("div",{className:"flex h-full w-full flex-col",children:[$,C]}),t[46]=$,t[47]=C,t[48]=O):O=t[48],O}function Ft(e){return e.blockKey}function Vt(e){return!e.openEnd}function Ht(e){return e.openEnd}function Bt(){return at(new Date)}function Wt(e){const t=V.c(3),{hiddenOngoing:r}=e,n=r===void 0?0:r;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(et,{size:24,className:"text-muted-foreground/60"}),t[0]=l):l=t[0];let o;return t[1]!==n?(o=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[l,n>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{children:"No dated variants in view."}),s.jsxs("div",{className:"text-xs text-muted-foreground/80",children:[n," ongoing"," ",n===1?"variant is":"variants are"," hidden — enable “Show ongoing” to view."]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{children:"No scheduled variants."}),s.jsx("div",{className:"text-xs text-muted-foreground/80",children:"Variants gated by a date matcher appear here."})]})]}),t[1]=n,t[2]=o):o=t[2],o}const G=20,Z=2,tt=28,zt=6;function Ut(e){const t=V.c(17),{monthStart:r,variants:n,colorMap:l}=e;let o,m,a,c,i;if(t[0]!==l||t[1]!==r||t[2]!==n){const u=Rt(r),x=P(new Date);o=rt,i="flex-1 min-h-0",m="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:$t.map(Gt)}),t[8]=a):a=t[8],c=u.map((h,g)=>{const b=Lt(h,n),y=b.reduce(Yt,0),T=tt+y*(G+Z)+8;return s.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[h.map((f,w)=>{const k=f.getMonth()===r.getMonth(),_=f.getTime()===x.getTime();return s.jsx("div",{className:J("border-r last:border-r-0 px-2 pt-1.5 text-xs",k?"bg-background":"bg-muted/30 text-muted-foreground"),children:s.jsx("span",{className:J("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",_&&"bg-primary text-primary-foreground font-semibold"),children:f.getDate()})},w)}),b.map((f,w)=>{const k=ot(l,f.variant.blockKey),_=tt+f.lane*(G+Z),M=f.leftUnits/7*100,A=f.widthUnits/7*100,E=f.variant.openStart&&g===0,v=f.variant.openEnd&&g===u.length-1;return s.jsxs(lt,{variant:f.variant,color:k,fadeStart:E,fadeEnd:v,style:{top:_,left:`calc(${M}% + 2px)`,width:`calc(${A}% - 4px)`,minWidth:zt,height:G},children:[f.variant.blockLabel,f.variant.label!==f.variant.blockLabel&&s.jsxs("span",{className:"opacity-70",children:[" · ",f.variant.label]})]},`${g}-${w}`)})]},g)}),t[0]=l,t[1]=r,t[2]=n,t[3]=o,t[4]=m,t[5]=a,t[6]=c,t[7]=i}else o=t[3],m=t[4],a=t[5],c=t[6],i=t[7];let p;t[9]!==m||t[10]!==a||t[11]!==c?(p=s.jsxs("div",{className:m,children:[a,c]}),t[9]=m,t[10]=a,t[11]=c,t[12]=p):p=t[12];let d;return t[13]!==o||t[14]!==i||t[15]!==p?(d=s.jsx(o,{className:i,children:p}),t[13]=o,t[14]=i,t[15]=p,t[16]=d):d=t[16],d}function Yt(e,t){return Math.max(e,t.lane+1)}function Gt(e){return s.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const B=4,Kt=32,H=240;function Jt(e){const t=V.c(27),{monthStart:r,variants:n,colorMap:l}=e,o=r;let m,a,c,i,p,d;if(t[0]!==l||t[1]!==r||t[2]!==o||t[3]!==n){const h=F(r,B),g=new Date,b=new Map;for(const v of n){const j=b.get(v.blockKey)??[];j.push(v),b.set(v.blockKey,j)}const y=Array.from(b.entries()).sort(Xt),T=h.getTime()-o.getTime(),f=v=>(Math.max(o.getTime(),Math.min(h.getTime(),v.getTime()))-o.getTime())/T*100;let w;t[10]!==o?(w=(v,j)=>F(o,j),t[10]=o,t[11]=w):w=t[11];const k=Array.from({length:B},w),_=g.getTime()>=o.getTime()&&g.getTime()<=h.getTime()?f(g):null;m=rt,d="flex-1 min-h-0",a="min-w-[900px] relative";let M;t[12]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:{width:H},children:"Variant / Block"}),t[12]=M):M=t[12];let A;t[13]===Symbol.for("react.memo_cache_sentinel")?(A={gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},t[13]=A):A=t[13];const E=k.map(Qt);t[14]!==E?(c=s.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[M,s.jsx("div",{className:"flex-1 grid",style:A,children:E})]}),t[14]=E,t[15]=c):c=t[15],t[16]!==_?(i=_!==null&&s.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${H}px + (100% - ${H}px) * ${_} / 100)`},children:s.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:"Today"})}),t[16]=_,t[17]=i):i=t[17],p=y.map(v=>{const[j,D]=v,L=ot(l,j),I=D[0]?.blockLabel??j;return s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:s.jsx("div",{className:"px-3 truncate",style:{width:H},children:I})}),D.map((N,R)=>s.jsxs("div",{className:"flex border-b items-center",style:{height:Kt},children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:H},children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:L.bg}}),s.jsx("span",{className:"truncate text-foreground/80",children:N.label})]}),s.jsxs("div",{className:"relative flex-1 h-full",children:[s.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${B}, minmax(0, 1fr))`},children:k.map(qt)}),(()=>{const $=Math.max(N.start.getTime(),o.getTime()),C=Math.min(N.end.getTime(),h.getTime());if(C<=$)return null;const O=f(new Date($)),S=f(new Date(C))-O;return s.jsx(lt,{variant:N,color:L,fadeStart:N.openStart,fadeEnd:N.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${O}%`,width:`calc(${S}% - 2px)`,height:22},children:N.label})})()]})]},R))]},j)}),t[0]=l,t[1]=r,t[2]=o,t[3]=n,t[4]=m,t[5]=a,t[6]=c,t[7]=i,t[8]=p,t[9]=d}else m=t[4],a=t[5],c=t[6],i=t[7],p=t[8],d=t[9];let u;t[18]!==a||t[19]!==c||t[20]!==i||t[21]!==p?(u=s.jsxs("div",{className:a,children:[c,i,p]}),t[18]=a,t[19]=c,t[20]=i,t[21]=p,t[22]=u):u=t[22];let x;return t[23]!==m||t[24]!==d||t[25]!==u?(x=s.jsx(m,{className:d,children:u}),t[23]=m,t[24]=d,t[25]=u,t[26]=x):x=t[26],x}function qt(e,t){return s.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function Qt(e,t){return s.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[st[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function Xt(e,t){return e[0].localeCompare(t[0])}export{Qr as VariantCalendar};
@@ -1 +1 @@
1
- import{c as $,r as T,l as f,j as i}from"./index-3wANCPRO.js";import{T as k,a as I,b as P}from"./tooltip-CZrkvlI-.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const n=M[_];let l;t[6]!==z?(l=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=l):l=t[7];let a;t[8]!==n||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(n.buttonWithLabel,"px-3"):n.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=n,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":n.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==l||t[25]!==a?(v=i.jsxs("div",{className:l,children:[a,u]}),t[23]=u,t[24]=l,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
1
+ import{c as $,r as T,l as f,j as i}from"./index-7EDQs4g5.js";import{T as k,a as I,b as P}from"./tooltip-Cjk9PMKc.js";const M={sm:{button:"size-7",buttonWithLabel:"h-7",icon:"size-4"},md:{button:"size-9",buttonWithLabel:"h-9",icon:"size-5"},lg:{button:"size-12",buttonWithLabel:"h-12",icon:"size-6"}};function B(E){const t=$.c(27),{value:s,onValueChange:y,options:o,size:C,fullWidth:L,className:z}=E,_=C===void 0?"sm":C,b=L===void 0?!1:L;let h;t[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[0]=h):h=t[0];const R=T.useRef(h);let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x={left:0,width:0,opacity:0},t[1]=x):x=t[1];const[d,S]=T.useState(x);let g,p;t[2]!==o||t[3]!==s?(g=()=>{const e=o.findIndex(j=>j.value===s),m=R.current[e];m&&S({left:m.offsetLeft,width:m.offsetWidth,opacity:1})},p=[s,o],t[2]=o,t[3]=s,t[4]=g,t[5]=p):(g=t[4],p=t[5]),T.useEffect(g,p);const n=M[_];let l;t[6]!==z?(l=f("relative flex gap-0 bg-muted rounded-lg",z),t[6]=z,t[7]=l):l=t[7];let a;t[8]!==n||t[9]!==b||t[10]!==y||t[11]!==o||t[12]!==s?(a=o.map((e,m)=>{const j=i.jsxs("button",{ref:V=>{R.current[m]=V},type:"button",onClick:()=>y(e.value),className:f("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b?"flex-1 h-12 px-4":e.label?f(n.buttonWithLabel,"px-3"):n.button),children:[i.jsx("span",{className:f("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",n.icon,s===e.value?"text-foreground":"text-muted-foreground"),children:e.icon}),e.label&&i.jsx("span",{className:f("text-xs transition-colors ease-out duration-200 whitespace-nowrap",s===e.value?"text-foreground":"text-muted-foreground"),children:e.label})]},e.value);return e.tooltip?i.jsxs(k,{children:[i.jsx(I,{asChild:!0,children:j}),i.jsx(P,{side:"bottom",children:e.tooltip})]},e.value):j}),t[8]=n,t[9]=b,t[10]=y,t[11]=o,t[12]=s,t[13]=a):a=t[13];const w=b?"h-12":n.button;let r;t[14]!==w?(r=f("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",w),t[14]=w,t[15]=r):r=t[15];const W=`${d.left}px`,N=`${d.width}px`;let c;t[16]!==d.opacity||t[17]!==W||t[18]!==N?(c={left:W,width:N,opacity:d.opacity},t[16]=d.opacity,t[17]=W,t[18]=N,t[19]=c):c=t[19];let u;t[20]!==r||t[21]!==c?(u=i.jsx("div",{className:r,style:c}),t[20]=r,t[21]=c,t[22]=u):u=t[22];let v;return t[23]!==u||t[24]!==l||t[25]!==a?(v=i.jsxs("div",{className:l,children:[a,u]}),t[23]=u,t[24]=l,t[25]=a,t[26]=v):v=t[26],v}export{B as V};
@@ -56,8 +56,8 @@
56
56
  <meta name="apple-mobile-web-app-capable" content="yes" />
57
57
  <meta name="apple-mobile-web-app-status-bar-style" content="default" />
58
58
  <meta name="apple-mobile-web-app-title" content="deco Studio" />
59
- <script type="module" crossorigin src="/assets/index-3wANCPRO.js"></script>
60
- <link rel="stylesheet" crossorigin href="/assets/index-dPmP2Tp4.css">
59
+ <script type="module" crossorigin src="/assets/index-7EDQs4g5.js"></script>
60
+ <link rel="stylesheet" crossorigin href="/assets/index-BcHmTSFg.css">
61
61
  </head>
62
62
  <body>
63
63
  <div id="root"></div>