decocms 2.294.0 → 2.294.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/dist/client/assets/{AlertCircle-BefAeM6u.js → AlertCircle-CQWovvD2.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-ctHZC7IK.js → ArrowNarrowLeft-CqWU9oxx.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-Dw5rxpDu.js → ArrowUpRight-DvqijCIt.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-3lbo4DOp.js → CheckCircle-RomNW015.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BMsVDJMd.js → ChevronDown-9Jxith6v.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DNaFnNR_.js → ChevronRight-Dtz86WKJ.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Ba2YtjVA.js → ChevronUp-CaQ8hxxg.js} +1 -1
  8. package/dist/client/assets/{Container-BbxUmzld.js → Container-C5OROtJe.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-q5wudUQb.js → DotsVertical-BgPLp_Gk.js} +1 -1
  10. package/dist/client/assets/{LinkExternal01-B-rWZEWZ.js → LinkExternal01-CYMJiIFP.js} +1 -1
  11. package/dist/client/assets/{Lock01-Bdpg3Hx_.js → Lock01-DnPqyt7e.js} +1 -1
  12. package/dist/client/assets/{Palette-CSbP1WU6.js → Palette-CWoH1X_q.js} +1 -1
  13. package/dist/client/assets/{Play-BwE8tx_2.js → Play-DqvL3G5s.js} +1 -1
  14. package/dist/client/assets/{Plus-B1zoIOQx.js → Plus-Ddba0lt_.js} +1 -1
  15. package/dist/client/assets/{RefreshCcw01-DhQjzDQL.js → RefreshCcw01-DMai8dtt.js} +1 -1
  16. package/dist/client/assets/{SearchMd-tlcXyQa_.js → SearchMd-Wd5u0rRU.js} +1 -1
  17. package/dist/client/assets/{Settings02-NVTdZYn8.js → Settings02-BIbJ38lS.js} +1 -1
  18. package/dist/client/assets/{Shield01-Cczh_kLJ.js → Shield01-CiT3cZOy.js} +1 -1
  19. package/dist/client/assets/{Star01-Cl5wO8v8.js → Star01-B-4f8EI8.js} +1 -1
  20. package/dist/client/assets/{Sun-MpjnKSLA.js → Sun-_Pck-FJM.js} +1 -1
  21. package/dist/client/assets/{Tool01-CWU0CUYW.js → Tool01-BfFn2Oyx.js} +1 -1
  22. package/dist/client/assets/{Trash01-CGGNK3g-.js → Trash01-Dgd5Vw7S.js} +1 -1
  23. package/dist/client/assets/{User01-BwcffllD.js → User01-oXiwFzHp.js} +1 -1
  24. package/dist/client/assets/{Users03-BNN6AS-n.js → Users03-BM4OMOrZ.js} +1 -1
  25. package/dist/client/assets/{X-XvFOaH_0.js → X-CRK0a94F.js} +1 -1
  26. package/dist/client/assets/{XCircle-CBqb98Hh.js → XCircle-Cb6HyAsm.js} +1 -1
  27. package/dist/client/assets/{XClose-CeINnhme.js → XClose-gZr4qGf9.js} +1 -1
  28. package/dist/client/assets/{Zap-CDrmsf2C.js → Zap-DLJMG7tg.js} +1 -1
  29. package/dist/client/assets/{ZapSquare-Ri9lH1zf.js → ZapSquare-BblOxMfA.js} +1 -1
  30. package/dist/client/assets/{accordion-Bgtbenzk.js → accordion-DxXcr0LG.js} +1 -1
  31. package/dist/client/assets/{agent-icon-DdfLWWFz.js → agent-icon-yYRj-0lJ.js} +1 -1
  32. package/dist/client/assets/{agents-list-D5T_UiBJ.js → agents-list-FSl3TY72.js} +1 -1
  33. package/dist/client/assets/ai-providers-eMV2jJWz.js +1 -0
  34. package/dist/client/assets/{alert-dialog-BY7wdwxM.js → alert-dialog-4PMn5MEd.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-BH50jO75.js → auth-catchall-BAX9ql07.js} +1 -1
  36. package/dist/client/assets/{automation-list-row-oLTHyBn9.js → automation-list-row-D0jJ-VOB.js} +1 -1
  37. package/dist/client/assets/{automations-C9eitePX.js → automations-BL3H9zCv.js} +1 -1
  38. package/dist/client/assets/{avatar-DRNf61dD.js → avatar-BBsS3gKf.js} +1 -1
  39. package/dist/client/assets/{badge-BJnKVqQg.js → badge-EwYkSrNU.js} +1 -1
  40. package/dist/client/assets/{brand-context-C2A7oRcl.js → brand-context-BSR4Xu33.js} +1 -1
  41. package/dist/client/assets/{card-Dp6Lilh-.js → card-Da8kkDcf.js} +1 -1
  42. package/dist/client/assets/{chat-context-JfnWgmWL.js → chat-context-Day9b1dU.js} +1 -1
  43. package/dist/client/assets/{checkbox-CouoIES-.js → checkbox-BTjBq0PR.js} +1 -1
  44. package/dist/client/assets/{collection-detail-C5Yymb--.js → collection-detail-1Ybv52WN.js} +1 -1
  45. package/dist/client/assets/{collection-display-button-wfEJKL5y.js → collection-display-button-BIbnppbU.js} +1 -1
  46. package/dist/client/assets/{collection-search-x3WxKP2U.js → collection-search-50UpqUDY.js} +1 -1
  47. package/dist/client/assets/{collection-search-3JVNad_3.js → collection-search-DiGSdKFX.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-DEzISF1y.js → collection-table-wrapper-K7myIred.js} +1 -1
  49. package/dist/client/assets/{collection-tabs-CavPMc70.js → collection-tabs-Dg60mpZc.js} +1 -1
  50. package/dist/client/assets/{collections-BcyYFQx1.js → collections-D3uyismv.js} +1 -1
  51. package/dist/client/assets/{command-_hKyE0nf.js → command-CpdycvMY.js} +1 -1
  52. package/dist/client/assets/{connection-card-P5qNgs6D.js → connection-card-CjJMOpOi.js} +1 -1
  53. package/dist/client/assets/connection-detail-DxSavRey.js +1 -0
  54. package/dist/client/assets/{connection-form-helpers-DjWTdW-u.js → connection-form-helpers-DG70qtHe.js} +1 -1
  55. package/dist/client/assets/{connections-BzamEAWo.js → connections-DSGczNjm.js} +1 -1
  56. package/dist/client/assets/{constants-DZTSQSyU.js → constants-CHMUOnBA.js} +1 -1
  57. package/dist/client/assets/{constants-DWChG_gh.js → constants-DoKzupGF.js} +1 -1
  58. package/dist/client/assets/{dialog-U3vhhaTY.js → dialog-CLKO8eiC.js} +1 -1
  59. package/dist/client/assets/{domain-settings-Df_AVfSP.js → domain-settings-nusKZpFJ.js} +1 -1
  60. package/dist/client/assets/{drawer-CHErHUts.js → drawer-0laKdMkc.js} +1 -1
  61. package/dist/client/assets/{dropdown-menu-LTGIQdd2.js → dropdown-menu-C6nHRZ2x.js} +1 -1
  62. package/dist/client/assets/{dynamic-plugin-layout-DQr-qgoI.js → dynamic-plugin-layout-CSPf8__W.js} +1 -1
  63. package/dist/client/assets/{empty-state-BsHUWcel.js → empty-state-BzDFSsXq.js} +1 -1
  64. package/dist/client/assets/{empty-state-BFgJp7mt.js → empty-state-vECJlBES.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-oVTIsFY5.js → extract-connection-data-BQaFyw9j.js} +1 -1
  66. package/dist/client/assets/{features--2Py51uQ.js → features-CSTJcrQu.js} +1 -1
  67. package/dist/client/assets/{form-D9KcIdYm.js → form-4fwiytJp.js} +1 -1
  68. package/dist/client/assets/general-W97mtxcC.js +1 -0
  69. package/dist/client/assets/{index-DDe7jF1Q.js → index-0IF7sjd1.js} +1 -1
  70. package/dist/client/assets/index-2lpt-nMb.js +1 -0
  71. package/dist/client/assets/{index-BVI1Podc.js → index-B5kxSh6_.js} +1 -1
  72. package/dist/client/assets/{index-BC2QV0vV.js → index-BVABOQyU.js} +3 -3
  73. package/dist/client/assets/{index-BY4tnJ8n.js → index-BayHbTyS.js} +1 -1
  74. package/dist/client/assets/{index-BKYuq1nk.js → index-BdDZPhkl.js} +1 -1
  75. package/dist/client/assets/{index-Ck21eYLb.js → index-BjVS_mPm.js} +1 -1
  76. package/dist/client/assets/{index-Bn0n2Tn5.js → index-ChG_GYbX.js} +2 -2
  77. package/dist/client/assets/{index-XYnQWjlr.js → index-DCNPBqJL.js} +2 -2
  78. package/dist/client/assets/{index-DlTZXAh7.js → index-DNkdomFO.js} +1 -1
  79. package/dist/client/assets/{index-BjIWAww2.js → index-DnI3Jcb3.js} +1 -1
  80. package/dist/client/assets/{index-DSeLALm0.js → index-Dw08Q_qj.js} +1 -1
  81. package/dist/client/assets/index-VzlCgk2d.js +1 -0
  82. package/dist/client/assets/{index-DAG4cu8y.js → index-_zHnBa5f.js} +1 -1
  83. package/dist/client/assets/{index-BMWhZkJH.js → index-lXmRmMe3.js} +1 -1
  84. package/dist/client/assets/{index-CRq27LIF.js → index-rCj8jF9g.js} +1 -1
  85. package/dist/client/assets/{infiniteQueryObserver-BuP6-BnP.js → infiniteQueryObserver-BkQFPIb1.js} +1 -1
  86. package/dist/client/assets/{input-C0cHvFsP.js → input-cSChLxlO.js} +1 -1
  87. package/dist/client/assets/{integration-icon-Db7fTukH.js → integration-icon-BeqPJGem.js} +1 -1
  88. package/dist/client/assets/{label-C-b-mt3k.js → label-qFek-Hzr.js} +1 -1
  89. package/dist/client/assets/{layout-DVOt2okr.js → layout-DyNIFXA1.js} +1 -1
  90. package/dist/client/assets/{lean-canvas-recruit-modal-Bu0aNy4u.js → lean-canvas-recruit-modal-CmsrBNbt.js} +1 -1
  91. package/dist/client/assets/{login-gnnJy4hU.js → login-fxkA0YmB.js} +1 -1
  92. package/dist/client/assets/members-CezvkHQT.js +3 -0
  93. package/dist/client/assets/{monaco-editor-DxUxs9LV.js → monaco-editor-BY9ngL3n.js} +1 -1
  94. package/dist/client/assets/{monitoring-stats-row-CeOh5u1r.js → monitoring-stats-row-C87wH1cE.js} +1 -1
  95. package/dist/client/assets/{oauth-callback-Cj2vHTqt.js → oauth-callback-CkAo5fto.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-ai-provider-C82hMcEJ.js → oauth-callback-ai-provider-CVNg6NIE.js} +1 -1
  97. package/dist/client/assets/{onboarding-B4IxAukM.js → onboarding-DGklDi6-.js} +1 -1
  98. package/dist/client/assets/{org-layout-3WdeVqpU.js → org-layout-JfVHDBF4.js} +1 -1
  99. package/dist/client/assets/{org-plugin-layout-mdTwEf0P.js → org-plugin-layout-nchD6z6X.js} +1 -1
  100. package/dist/client/assets/{pair-Bcvdi-3H.js → pair-7_poUBO_.js} +1 -1
  101. package/dist/client/assets/{plugin-empty-state-CDuOKPoQ.js → plugin-empty-state-BoHwceCP.js} +1 -1
  102. package/dist/client/assets/{plugin-header-Bl_jJCpR.js → plugin-header-B7x435yF.js} +1 -1
  103. package/dist/client/assets/{plugin-layout-BaKtqBSh.js → plugin-layout-lMPEsmyE.js} +1 -1
  104. package/dist/client/assets/{popover-9zp4cKfF.js → popover-CXTQ1pZp.js} +1 -1
  105. package/dist/client/assets/{profile-Byy_H5s-.js → profile-B7Sm0x87.js} +1 -1
  106. package/dist/client/assets/{project-app-view-D8t5BK_c.js → project-app-view-CCFwwwFL.js} +1 -1
  107. package/dist/client/assets/registry-CGoPlkDA.js +2 -0
  108. package/dist/client/assets/{registry-layout-BR-KKTEl.js → registry-layout-C90BJ6Rq.js} +1 -1
  109. package/dist/client/assets/{required-auth-layout-DPKy79PP.js → required-auth-layout-HSIIJt__.js} +1 -1
  110. package/dist/client/assets/{reset-password-DfZzTSNp.js → reset-password-C4MrTg2U.js} +1 -1
  111. package/dist/client/assets/roles-Cxh0Bdz-.js +1 -0
  112. package/dist/client/assets/{scroll-area-CTWKzmcY.js → scroll-area-DBp5wOIC.js} +1 -1
  113. package/dist/client/assets/{search-input-Bkbw9XvQ.js → search-input-ZAyrquFx.js} +1 -1
  114. package/dist/client/assets/{select-rt68l1g_.js → select-CeexIfr3.js} +1 -1
  115. package/dist/client/assets/{select-model-CQYug9E9.js → select-model-DTMG5QxV.js} +1 -1
  116. package/dist/client/assets/{settings-layout-BTinptVV.js → settings-layout-vPJQ-S1Z.js} +1 -1
  117. package/dist/client/assets/{settings-section-BIiOcEee.js → settings-section-BnMkp9Ky.js} +1 -1
  118. package/dist/client/assets/{shell-layout-ti4P0o8w.js → shell-layout-u2G0LiBx.js} +1 -1
  119. package/dist/client/assets/{skeleton-DQqcYIUR.js → skeleton-C5xkidPH.js} +1 -1
  120. package/dist/client/assets/{sso-DtEJ6K21.js → sso--dNq6AVx.js} +1 -1
  121. package/dist/client/assets/{store-BlkOQMDv.js → store-X7XjGNJQ.js} +1 -1
  122. package/dist/client/assets/store-registry-Chj3l7GJ.js +2 -0
  123. package/dist/client/assets/{switch-Dd-fbXw9.js → switch-CO8ELkEz.js} +1 -1
  124. package/dist/client/assets/{table-UGp85pBs.js → table-BFGAzwxV.js} +1 -1
  125. package/dist/client/assets/{tabs-Bajmp5LL.js → tabs-DKutPh-7.js} +1 -1
  126. package/dist/client/assets/{task-status-D2ZncahY.js → task-status-B_agjVRL.js} +1 -1
  127. package/dist/client/assets/{textarea-Ds8u2czk.js → textarea-DsA14nCU.js} +1 -1
  128. package/dist/client/assets/{toggle-group-CrNuUyQT.js → toggle-group-C1gRrQ9h.js} +1 -1
  129. package/dist/client/assets/{tools-list-C9sZCS-d.js → tools-list-BFfWcpMA.js} +1 -1
  130. package/dist/client/assets/{tooltip-CkzGOY_H.js → tooltip-D6U_mOrV.js} +1 -1
  131. package/dist/client/assets/{types-BQS1EcA_.js → types-CdaeT_-k.js} +1 -1
  132. package/dist/client/assets/{use-ai-providers-D8PM532H.js → use-ai-providers-CLMcGum-.js} +1 -1
  133. package/dist/client/assets/{use-collections-s48OQ83y.js → use-collections-B3Xa3dKk.js} +1 -1
  134. package/dist/client/assets/{use-connection-Q2SEpogi.js → use-connection-UQYyaO6_.js} +1 -1
  135. package/dist/client/assets/{use-copy-CBB3IfKo.js → use-copy-DnJa5Wna.js} +1 -1
  136. package/dist/client/assets/{use-create-virtual-mcp-C25QZ7ga.js → use-create-virtual-mcp-JDziG09i.js} +1 -1
  137. package/dist/client/assets/{use-decopilot-events-2jo7Z1ub.js → use-decopilot-events-BEXgeJT0.js} +1 -1
  138. package/dist/client/assets/{use-delete-connection-Cerb12qV.js → use-delete-connection-HjSBghMT.js} +1 -1
  139. package/dist/client/assets/{use-infinite-scroll-DhiqUieY.js → use-infinite-scroll-pE0yY5YF.js} +1 -1
  140. package/dist/client/assets/{use-list-state-BLzfpMTR.js → use-list-state-qucbexq7.js} +1 -1
  141. package/dist/client/assets/{use-mcp-tools-CODd7jbk.js → use-mcp-tools-10Xveav6.js} +1 -1
  142. package/dist/client/assets/use-members-DYi4jSpk.js +1 -0
  143. package/dist/client/assets/{use-navigate-to-agent-BIpRywxJ.js → use-navigate-to-agent-DjzouovW.js} +1 -1
  144. package/dist/client/assets/use-org-auth-client-C5VSPyTf.js +1 -0
  145. package/dist/client/assets/{use-org-sso-B_zJ7IWb.js → use-org-sso-B4kcBKk_.js} +1 -1
  146. package/dist/client/assets/use-organization-roles-CqY2IBkE.js +1 -0
  147. package/dist/client/assets/{use-organization-settings-69gOseUx.js → use-organization-settings-DL07J8Vx.js} +1 -1
  148. package/dist/client/assets/{use-registry-connections-C4iFJ600.js → use-registry-connections-HO8ZDwQn.js} +1 -1
  149. package/dist/client/assets/{use-status-sounds-BJSeHGsn.js → use-status-sounds-Dzd2wfFW.js} +1 -1
  150. package/dist/client/assets/{use-tasks-Q8L8ocme.js → use-tasks-DMNq5MhB.js} +1 -1
  151. package/dist/client/assets/{use-view-mode-lvgEn118.js → use-view-mode-BjcxKjKE.js} +1 -1
  152. package/dist/client/assets/{use-virtual-mcp-BYV6DlKB.js → use-virtual-mcp-DZEy75YH.js} +1 -1
  153. package/dist/client/assets/useInfiniteQuery-Co9WNPPX.js +1 -0
  154. package/dist/client/assets/useSuspenseInfiniteQuery-BbwxgHZr.js +1 -0
  155. package/dist/client/assets/{user-B6WmZaTV.js → user-BlRUTTNb.js} +1 -1
  156. package/dist/client/assets/{view-mode-toggle-DVYpzTeC.js → view-mode-toggle-RGExIMou.js} +1 -1
  157. package/dist/client/assets/{workflow-CJZscJ90.js → workflow-C1SElIVm.js} +1 -1
  158. package/dist/client/assets/workflow-detail-BR_Ju77C.js +1 -0
  159. package/dist/client/index.html +1 -1
  160. package/dist/server/cli.js +2 -2
  161. package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
  162. package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
  163. package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
  164. package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
  165. package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
  166. package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
  167. package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
  168. package/dist/server/node_modules/{xtend → pg}/LICENSE +7 -6
  169. package/dist/server/node_modules/pg/README.md +95 -0
  170. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  171. package/dist/server/node_modules/pg/lib/client.js +743 -0
  172. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  173. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  174. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  175. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  176. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  177. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  178. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  179. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  180. package/dist/server/node_modules/pg/lib/index.js +73 -0
  181. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  182. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  183. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  184. package/dist/server/node_modules/pg/lib/query.js +252 -0
  185. package/dist/server/node_modules/pg/lib/result.js +109 -0
  186. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  187. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  188. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  189. package/dist/server/node_modules/pg/package.json +76 -0
  190. package/dist/server/node_modules/strip-ansi/index.d.ts +15 -0
  191. package/dist/server/node_modules/strip-ansi/index.js +19 -0
  192. package/dist/server/node_modules/{mimic-fn → strip-ansi}/license +1 -1
  193. package/dist/server/node_modules/{ansi-styles → strip-ansi}/package.json +17 -12
  194. package/dist/server/node_modules/strip-ansi/readme.md +37 -0
  195. package/dist/server/server.js +249 -249
  196. package/package.json +1 -1
  197. package/dist/client/assets/ai-providers-Cyq2bO_1.js +0 -1
  198. package/dist/client/assets/connection-detail-C7YX5R9g.js +0 -1
  199. package/dist/client/assets/general-B3-bdB-A.js +0 -1
  200. package/dist/client/assets/index-CT5IWILX.js +0 -1
  201. package/dist/client/assets/index-DLLxA9VA.js +0 -1
  202. package/dist/client/assets/members-DvR6XPbA.js +0 -3
  203. package/dist/client/assets/registry-twLci_qW.js +0 -2
  204. package/dist/client/assets/roles-BX09eeZ2.js +0 -1
  205. package/dist/client/assets/store-registry-CfXgf26T.js +0 -2
  206. package/dist/client/assets/use-members-CYdKPSkq.js +0 -1
  207. package/dist/client/assets/use-organization-roles-9gBEeLeI.js +0 -1
  208. package/dist/client/assets/useInfiniteQuery-BkNuxXHJ.js +0 -1
  209. package/dist/client/assets/useSuspenseInfiniteQuery-CMhS0p47.js +0 -1
  210. package/dist/client/assets/workflow-detail-DyTvPAnr.js +0 -1
  211. package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
  212. package/dist/server/node_modules/ansi-styles/index.js +0 -223
  213. package/dist/server/node_modules/ansi-styles/readme.md +0 -173
  214. package/dist/server/node_modules/mimic-fn/index.d.ts +0 -54
  215. package/dist/server/node_modules/mimic-fn/index.js +0 -13
  216. package/dist/server/node_modules/mimic-fn/package.json +0 -42
  217. package/dist/server/node_modules/mimic-fn/readme.md +0 -69
  218. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  219. package/dist/server/node_modules/pg-int8/README.md +0 -16
  220. package/dist/server/node_modules/pg-int8/index.js +0 -100
  221. package/dist/server/node_modules/pg-int8/package.json +0 -24
  222. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  223. package/dist/server/node_modules/postgres-array/index.js +0 -97
  224. package/dist/server/node_modules/postgres-array/license +0 -21
  225. package/dist/server/node_modules/postgres-array/package.json +0 -35
  226. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  227. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  228. package/dist/server/node_modules/postgres-bytea/license +0 -21
  229. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  230. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  231. package/dist/server/node_modules/postgres-date/index.js +0 -116
  232. package/dist/server/node_modules/postgres-date/license +0 -21
  233. package/dist/server/node_modules/postgres-date/package.json +0 -33
  234. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  235. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  236. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  237. package/dist/server/node_modules/postgres-interval/license +0 -21
  238. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  239. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  240. package/dist/server/node_modules/split2/LICENSE +0 -13
  241. package/dist/server/node_modules/split2/README.md +0 -85
  242. package/dist/server/node_modules/split2/bench.js +0 -27
  243. package/dist/server/node_modules/split2/index.js +0 -141
  244. package/dist/server/node_modules/split2/package.json +0 -39
  245. package/dist/server/node_modules/split2/test.js +0 -409
  246. package/dist/server/node_modules/xtend/.jshintrc +0 -30
  247. package/dist/server/node_modules/xtend/README.md +0 -32
  248. package/dist/server/node_modules/xtend/immutable.js +0 -19
  249. package/dist/server/node_modules/xtend/mutable.js +0 -17
  250. package/dist/server/node_modules/xtend/package.json +0 -55
  251. package/dist/server/node_modules/xtend/test.js +0 -103
  252. /package/dist/server/node_modules/{ansi-styles → get-east-asian-width}/license +0 -0
@@ -1 +1 @@
1
- import{e as z,j as t,b as G,r as R,B as V,P as B,t as f,x as I}from"./index-Bn0n2Tn5.js";import{P as E}from"./index-BY4tnJ8n.js";import{A as U}from"./avatar-DRNf61dD.js";import{S as T}from"./switch-Dd-fbXw9.js";import{S as H,a as Y,d as q,c as F}from"./select-rt68l1g_.js";import{T as K,a as L}from"./toggle-group-CrNuUyQT.js";import{I as J}from"./input-C0cHvFsP.js";import{n as M,a as O,i as Q}from"./Sun-MpjnKSLA.js";import{i as W}from"./Play-BwE8tx_2.js";import{p as X,q as Z}from"./question-004-sINsf4GQ.js";import"./index-BjIWAww2.js";import{d as ee,S as $,a as D,b as h,c as te}from"./settings-section-BIiOcEee.js";import"./tooltip-CkzGOY_H.js";import"./X-XvFOaH_0.js";import"./User01-BwcffllD.js";import"./ChevronDown-BMsVDJMd.js";import"./ChevronUp-Ba2YtjVA.js";import"./card-Dp6Lilh-.js";import"./ArrowUpRight-Dw5rxpDu.js";function ie(){const{data:e,isPending:i}=G.useSession(),n=e?.user,l=n?.image,[s,o]=R.useState(null),[a,c]=R.useState(!1),m=s??n?.name??"",p=s!==null&&s!==(n?.name??""),u=async()=>{if(p){c(!0);try{await G.updateUser({name:m}),f("profile_updated",{fields:["name"]}),o(null),I.success("Profile updated")}catch{I.error("Failed to update profile")}finally{c(!1)}}};return i?null:t.jsx($,{children:t.jsxs(D,{children:[t.jsx(h,{title:"Avatar",action:t.jsx(U,{url:l,fallback:n?.name??"U",shape:"circle",size:"base"})}),t.jsx(h,{title:"Display name",action:t.jsx(J,{id:"display-name",value:m,onChange:d=>o(d.target.value),onKeyDown:d=>{d.key==="Enter"&&u()},placeholder:"Your name",className:"w-[280px]"})}),t.jsx(h,{title:"Email",action:t.jsx("span",{className:"text-sm text-muted-foreground",children:n?.email})}),p&&t.jsxs(te,{children:[t.jsx(V,{variant:"outline",size:"sm",onClick:()=>o(null),disabled:a,children:"Cancel"}),t.jsx(V,{onClick:u,disabled:a,size:"sm",children:a?"Saving…":"Save"})]})]})})}function ne(){const e=z.c(48),[i,n]=B();let l;e[0]!==n?(l=async r=>{if(r&&await Notification.requestPermission()!=="granted"){f("preferences_notifications_permission_denied"),I.error("Notifications denied. Please enable them in your browser settings."),n(ae);return}f("preferences_notifications_toggled",{enabled:r}),n(x=>({...x,enableNotifications:r}))},e[0]=n,e[1]=l):l=e[1];const s=l;let o;e[2]!==n?(o=r=>{r&&(f("preferences_theme_changed",{to_value:r}),n(x=>({...x,theme:r})))},e[2]=n,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(L,{value:"light","aria-label":"Light theme",children:t.jsx(M,{size:14})}),e[4]=a):a=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(L,{value:"dark","aria-label":"Dark theme",children:t.jsx(O,{size:14})}),e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(L,{value:"system","aria-label":"System theme",children:t.jsx(Q,{size:14})}),e[6]=m):m=e[6];let p;e[7]!==i.theme||e[8]!==o?(p=t.jsx(h,{title:"Theme",description:"Your preferred color scheme.",action:t.jsxs(K,{type:"single",size:"sm",variant:"outline",value:i.theme,onValueChange:o,children:[a,c,m]})}),e[7]=i.theme,e[8]=o,e[9]=p):p=e[9];let u;e[10]!==s||e[11]!==i.enableNotifications?(u=typeof Notification<"u"?()=>s(!i.enableNotifications):void 0,e[10]=s,e[11]=i.enableNotifications,e[12]=u):u=e[12];let d;e[13]!==s||e[14]!==i.enableNotifications?(d=t.jsx(T,{disabled:typeof Notification>"u",checked:i.enableNotifications,onCheckedChange:s}),e[13]=s,e[14]=i.enableNotifications,e[15]=d):d=e[15];let b;e[16]!==u||e[17]!==d?(b=t.jsx(h,{title:"Notifications",description:"Receive browser notifications for important events.",onClick:u,action:d}),e[16]=u,e[17]=d,e[18]=b):b=e[18];let v;e[19]!==i.enableSounds||e[20]!==n?(v=()=>{f("preferences_sounds_toggled",{enabled:!i.enableSounds}),n(le)},e[19]=i.enableSounds,e[20]=n,e[21]=v):v=e[21];let P;e[22]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("button",{type:"button","aria-label":"Preview notification sound",onClick:se,className:"size-6 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",children:t.jsx(W,{size:11})}),e[22]=P):P=e[22];let g;e[23]!==n?(g=r=>{f("preferences_sounds_toggled",{enabled:r}),n(x=>({...x,enableSounds:r}))},e[23]=n,e[24]=g):g=e[24];let j;e[25]!==i.enableSounds||e[26]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[P,t.jsx(T,{checked:i.enableSounds,onCheckedChange:g})]}),e[25]=i.enableSounds,e[26]=g,e[27]=j):j=e[27];let _;e[28]!==j||e[29]!==v?(_=t.jsx(h,{title:"Sounds",description:"Play sounds for agent actions and notifications.",onClick:v,action:j}),e[28]=j,e[29]=v,e[30]=_):_=e[30];let S;e[31]!==n?(S=r=>{f("preferences_tool_approval_changed",{to_value:r}),n(x=>({...x,toolApprovalLevel:r}))},e[31]=n,e[32]=S):S=e[32];let y;e[33]!==i.toolApprovalLevel?(y={readonly:"Ask before edit",auto:"Auto approve"}[i.toolApprovalLevel]??"Ask before edit",e[33]=i.toolApprovalLevel,e[34]=y):y=e[34];let N;e[35]!==y?(N=t.jsx(Y,{className:"w-36 h-7 text-xs",children:t.jsx("span",{children:y})}),e[35]=y,e[36]=N):N=e[36];let A;e[37]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(q,{value:"readonly",textValue:"Ask before edit",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Ask before edit"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[37]=A):A=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs(F,{children:[A,t.jsx(q,{value:"auto",textValue:"Auto approve",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Auto approve"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all without approval"})]})})]}),e[38]=k):k=e[38];let C;e[39]!==i.toolApprovalLevel||e[40]!==S||e[41]!==N?(C=t.jsx(h,{title:"Tool Approval",description:"Control how tools are approved before execution.",action:t.jsxs(H,{value:i.toolApprovalLevel,onValueChange:S,children:[N,k]})}),e[39]=i.toolApprovalLevel,e[40]=S,e[41]=N,e[42]=C):C=e[42];let w;return e[43]!==_||e[44]!==C||e[45]!==p||e[46]!==b?(w=t.jsx($,{title:"Preferences",children:t.jsxs(D,{children:[p,b,_,C]})}),e[43]=_,e[44]=C,e[45]=p,e[46]=b,e[47]=w):w=e[47],w}function se(){f("preferences_sounds_previewed"),X(Z.dataUri).catch(oe)}function oe(){}function le(e){return{...e,enableSounds:!e.enableSounds}}function ae(e){return{...e,enableNotifications:!1}}function re(){const e=z.c(11),[i,n]=B();let l;e[0]!==i.experimental_vibecode||e[1]!==n?(l=()=>{f("preferences_experimental_vibecode_toggled",{enabled:!i.experimental_vibecode}),n(ce)},e[0]=i.experimental_vibecode,e[1]=n,e[2]=l):l=e[2];let s;e[3]!==n?(s=c=>{f("preferences_experimental_vibecode_toggled",{enabled:c}),n(m=>({...m,experimental_vibecode:c}))},e[3]=n,e[4]=s):s=e[4];let o;e[5]!==i.experimental_vibecode||e[6]!==s?(o=t.jsx(T,{checked:i.experimental_vibecode,onCheckedChange:s}),e[5]=i.experimental_vibecode,e[6]=s,e[7]=o):o=e[7];let a;return e[8]!==l||e[9]!==o?(a=t.jsx($,{title:"Experimental",children:t.jsx(D,{children:t.jsx(h,{title:"Import from GitHub",description:"Enable importing agents from GitHub repositories.",onClick:l,action:o})})}),e[8]=l,e[9]=o,e[10]=a):a=e[10],a}function ce(e){return{...e,experimental_vibecode:!e.experimental_vibecode}}function de(){const e=z.c(1);let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(E,{children:t.jsx(E.Content,{children:t.jsx(E.Body,{children:t.jsxs(ee,{children:[t.jsx(E.Title,{children:"Profile & Preferences"}),t.jsx(ie,{}),t.jsx(ne,{}),t.jsx(re,{})]})})})}),e[0]=i):i=e[0],i}function Ee(){const e=z.c(1);let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(de,{}),e[0]=i):i=e[0],i}export{Ee as default};
1
+ import{e as z,j as t,b as G,r as R,B as V,P as B,t as f,x as I}from"./index-ChG_GYbX.js";import{P as E}from"./index-BayHbTyS.js";import{A as U}from"./avatar-BBsS3gKf.js";import{S as T}from"./switch-CO8ELkEz.js";import{S as H,a as Y,d as q,c as F}from"./select-CeexIfr3.js";import{T as K,a as L}from"./toggle-group-C1gRrQ9h.js";import{I as J}from"./input-cSChLxlO.js";import{n as M,a as O,i as Q}from"./Sun-_Pck-FJM.js";import{i as W}from"./Play-DqvL3G5s.js";import{p as X,q as Z}from"./question-004-sINsf4GQ.js";import"./index-DnI3Jcb3.js";import{d as ee,S as $,a as D,b as h,c as te}from"./settings-section-BnMkp9Ky.js";import"./tooltip-D6U_mOrV.js";import"./X-CRK0a94F.js";import"./User01-oXiwFzHp.js";import"./ChevronDown-9Jxith6v.js";import"./ChevronUp-CaQ8hxxg.js";import"./card-Da8kkDcf.js";import"./ArrowUpRight-DvqijCIt.js";function ie(){const{data:e,isPending:i}=G.useSession(),n=e?.user,l=n?.image,[s,o]=R.useState(null),[a,c]=R.useState(!1),m=s??n?.name??"",p=s!==null&&s!==(n?.name??""),u=async()=>{if(p){c(!0);try{await G.updateUser({name:m}),f("profile_updated",{fields:["name"]}),o(null),I.success("Profile updated")}catch{I.error("Failed to update profile")}finally{c(!1)}}};return i?null:t.jsx($,{children:t.jsxs(D,{children:[t.jsx(h,{title:"Avatar",action:t.jsx(U,{url:l,fallback:n?.name??"U",shape:"circle",size:"base"})}),t.jsx(h,{title:"Display name",action:t.jsx(J,{id:"display-name",value:m,onChange:d=>o(d.target.value),onKeyDown:d=>{d.key==="Enter"&&u()},placeholder:"Your name",className:"w-[280px]"})}),t.jsx(h,{title:"Email",action:t.jsx("span",{className:"text-sm text-muted-foreground",children:n?.email})}),p&&t.jsxs(te,{children:[t.jsx(V,{variant:"outline",size:"sm",onClick:()=>o(null),disabled:a,children:"Cancel"}),t.jsx(V,{onClick:u,disabled:a,size:"sm",children:a?"Saving…":"Save"})]})]})})}function ne(){const e=z.c(48),[i,n]=B();let l;e[0]!==n?(l=async r=>{if(r&&await Notification.requestPermission()!=="granted"){f("preferences_notifications_permission_denied"),I.error("Notifications denied. Please enable them in your browser settings."),n(ae);return}f("preferences_notifications_toggled",{enabled:r}),n(x=>({...x,enableNotifications:r}))},e[0]=n,e[1]=l):l=e[1];const s=l;let o;e[2]!==n?(o=r=>{r&&(f("preferences_theme_changed",{to_value:r}),n(x=>({...x,theme:r})))},e[2]=n,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(L,{value:"light","aria-label":"Light theme",children:t.jsx(M,{size:14})}),e[4]=a):a=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(L,{value:"dark","aria-label":"Dark theme",children:t.jsx(O,{size:14})}),e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(L,{value:"system","aria-label":"System theme",children:t.jsx(Q,{size:14})}),e[6]=m):m=e[6];let p;e[7]!==i.theme||e[8]!==o?(p=t.jsx(h,{title:"Theme",description:"Your preferred color scheme.",action:t.jsxs(K,{type:"single",size:"sm",variant:"outline",value:i.theme,onValueChange:o,children:[a,c,m]})}),e[7]=i.theme,e[8]=o,e[9]=p):p=e[9];let u;e[10]!==s||e[11]!==i.enableNotifications?(u=typeof Notification<"u"?()=>s(!i.enableNotifications):void 0,e[10]=s,e[11]=i.enableNotifications,e[12]=u):u=e[12];let d;e[13]!==s||e[14]!==i.enableNotifications?(d=t.jsx(T,{disabled:typeof Notification>"u",checked:i.enableNotifications,onCheckedChange:s}),e[13]=s,e[14]=i.enableNotifications,e[15]=d):d=e[15];let b;e[16]!==u||e[17]!==d?(b=t.jsx(h,{title:"Notifications",description:"Receive browser notifications for important events.",onClick:u,action:d}),e[16]=u,e[17]=d,e[18]=b):b=e[18];let v;e[19]!==i.enableSounds||e[20]!==n?(v=()=>{f("preferences_sounds_toggled",{enabled:!i.enableSounds}),n(le)},e[19]=i.enableSounds,e[20]=n,e[21]=v):v=e[21];let P;e[22]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("button",{type:"button","aria-label":"Preview notification sound",onClick:se,className:"size-6 rounded flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/50 transition-colors cursor-pointer",children:t.jsx(W,{size:11})}),e[22]=P):P=e[22];let g;e[23]!==n?(g=r=>{f("preferences_sounds_toggled",{enabled:r}),n(x=>({...x,enableSounds:r}))},e[23]=n,e[24]=g):g=e[24];let j;e[25]!==i.enableSounds||e[26]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[P,t.jsx(T,{checked:i.enableSounds,onCheckedChange:g})]}),e[25]=i.enableSounds,e[26]=g,e[27]=j):j=e[27];let _;e[28]!==j||e[29]!==v?(_=t.jsx(h,{title:"Sounds",description:"Play sounds for agent actions and notifications.",onClick:v,action:j}),e[28]=j,e[29]=v,e[30]=_):_=e[30];let S;e[31]!==n?(S=r=>{f("preferences_tool_approval_changed",{to_value:r}),n(x=>({...x,toolApprovalLevel:r}))},e[31]=n,e[32]=S):S=e[32];let y;e[33]!==i.toolApprovalLevel?(y={readonly:"Ask before edit",auto:"Auto approve"}[i.toolApprovalLevel]??"Ask before edit",e[33]=i.toolApprovalLevel,e[34]=y):y=e[34];let N;e[35]!==y?(N=t.jsx(Y,{className:"w-36 h-7 text-xs",children:t.jsx("span",{children:y})}),e[35]=y,e[36]=N):N=e[36];let A;e[37]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(q,{value:"readonly",textValue:"Ask before edit",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Ask before edit"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[37]=A):A=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsxs(F,{children:[A,t.jsx(q,{value:"auto",textValue:"Auto approve",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("span",{className:"font-medium",children:"Auto approve"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all without approval"})]})})]}),e[38]=k):k=e[38];let C;e[39]!==i.toolApprovalLevel||e[40]!==S||e[41]!==N?(C=t.jsx(h,{title:"Tool Approval",description:"Control how tools are approved before execution.",action:t.jsxs(H,{value:i.toolApprovalLevel,onValueChange:S,children:[N,k]})}),e[39]=i.toolApprovalLevel,e[40]=S,e[41]=N,e[42]=C):C=e[42];let w;return e[43]!==_||e[44]!==C||e[45]!==p||e[46]!==b?(w=t.jsx($,{title:"Preferences",children:t.jsxs(D,{children:[p,b,_,C]})}),e[43]=_,e[44]=C,e[45]=p,e[46]=b,e[47]=w):w=e[47],w}function se(){f("preferences_sounds_previewed"),X(Z.dataUri).catch(oe)}function oe(){}function le(e){return{...e,enableSounds:!e.enableSounds}}function ae(e){return{...e,enableNotifications:!1}}function re(){const e=z.c(11),[i,n]=B();let l;e[0]!==i.experimental_vibecode||e[1]!==n?(l=()=>{f("preferences_experimental_vibecode_toggled",{enabled:!i.experimental_vibecode}),n(ce)},e[0]=i.experimental_vibecode,e[1]=n,e[2]=l):l=e[2];let s;e[3]!==n?(s=c=>{f("preferences_experimental_vibecode_toggled",{enabled:c}),n(m=>({...m,experimental_vibecode:c}))},e[3]=n,e[4]=s):s=e[4];let o;e[5]!==i.experimental_vibecode||e[6]!==s?(o=t.jsx(T,{checked:i.experimental_vibecode,onCheckedChange:s}),e[5]=i.experimental_vibecode,e[6]=s,e[7]=o):o=e[7];let a;return e[8]!==l||e[9]!==o?(a=t.jsx($,{title:"Experimental",children:t.jsx(D,{children:t.jsx(h,{title:"Import from GitHub",description:"Enable importing agents from GitHub repositories.",onClick:l,action:o})})}),e[8]=l,e[9]=o,e[10]=a):a=e[10],a}function ce(e){return{...e,experimental_vibecode:!e.experimental_vibecode}}function de(){const e=z.c(1);let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(E,{children:t.jsx(E.Content,{children:t.jsx(E.Body,{children:t.jsxs(ee,{children:[t.jsx(E.Title,{children:"Profile & Preferences"}),t.jsx(ie,{}),t.jsx(ne,{}),t.jsx(re,{})]})})})}),e[0]=i):i=e[0],i}function Ee(){const e=z.c(1);let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(de,{}),e[0]=i):i=e[0],i}export{Ee as default};
@@ -1 +1 @@
1
- import{e as E,s as H,j as N}from"./index-Bn0n2Tn5.js";import{m as O,k as $,s as v}from"./pair-Bcvdi-3H.js";import{u as L}from"./constants-DWChG_gh.js";import{a as k,c as q}from"./use-mcp-tools-CODd7jbk.js";import{c as B}from"./content-blocks-o63cs2vh.js";import{g as Y,M as G,b as w}from"./types-BQS1EcA_.js";import{c as V,b as z}from"./chat-context-JfnWgmWL.js";import{u as F}from"./shell-layout-ti4P0o8w.js";import"./agent-icon-DdfLWWFz.js";import"./AlertCircle-BefAeM6u.js";import"./Tool01-CWU0CUYW.js";import"./XClose-CeINnhme.js";import"./RefreshCcw01-DhQjzDQL.js";import"./ArrowNarrowLeft-ctHZC7IK.js";import"./XCircle-CBqb98Hh.js";import"./ArrowUpRight-Dw5rxpDu.js";import"./ZapSquare-Ri9lH1zf.js";import"./Users03-BNN6AS-n.js";import"./CheckCircle-3lbo4DOp.js";import"./ChevronDown-BMsVDJMd.js";import"./ChevronRight-DNaFnNR_.js";import"./ChevronUp-Ba2YtjVA.js";import"./DotsVertical-q5wudUQb.js";import"./Container-BbxUmzld.js";import"./Star01-Cl5wO8v8.js";import"./Palette-CSbP1WU6.js";import"./SearchMd-tlcXyQa_.js";import"./index-BY4tnJ8n.js";import"./tooltip-CkzGOY_H.js";import"./X-XvFOaH_0.js";import"./LinkExternal01-B-rWZEWZ.js";import"./Lock01-Bdpg3Hx_.js";import"./Sun-MpjnKSLA.js";import"./Play-BwE8tx_2.js";import"./Plus-B1zoIOQx.js";import"./Settings02-NVTdZYn8.js";import"./Shield01-Cczh_kLJ.js";import"./Trash01-CGGNK3g-.js";import"./User01-BwcffllD.js";import"./Zap-CDrmsf2C.js";import"./index-Ck21eYLb.js";import"./use-copy-CBB3IfKo.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-U3vhhaTY.js";import"./integration-icon-Db7fTukH.js";import"./use-virtual-mcp-BYV6DlKB.js";import"./use-collections-s48OQ83y.js";import"./use-ai-providers-D8PM532H.js";import"./use-decopilot-events-2jo7Z1ub.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-Q8L8ocme.js";import"./use-organization-settings-69gOseUx.js";import"./required-auth-layout-DPKy79PP.js";import"./use-org-sso-B_zJ7IWb.js";const J={};function K(U){const t=E.c(37),{client:s,resourceURI:P,tool:e,connectionId:l,orgId:p,args:a}=U,{sendMessage:c}=V(),{setAppContext:u,clearAppContext:g}=z(),{setChatOpen:d,openTab:r}=F(),n=`${l}:${e.name}`;let o;t[0]!==r?(o=h=>h==="inline"?(r("0"),"inline"):"fullscreen",t[0]=r,t[1]=o):o=t[1];const f=o,m=a??J;let i;t[2]!==s||t[3]!==e.name||t[4]!==m?(i={client:s,toolName:e.name,toolArguments:m},t[2]=s,t[3]=e.name,t[4]=m,t[5]=i):i=t[5];const{data:T}=q(i);let R;if(t[6]!==e._meta||t[7]!==e.name){const h=$(e._meta);R=v(e.name,h),t[6]=e._meta,t[7]=e.name,t[8]=R}else R=t[8];const S=R;let x;t[9]!==e.inputSchema?(x=e.inputSchema??{type:"object"},t[9]=e.inputSchema,t[10]=x):x=t[10];let A;t[11]!==S||t[12]!==x||t[13]!==e?(A={...e,name:S,inputSchema:x},t[11]=S,t[12]=x,t[13]=e,t[14]=A):A=t[14];const y=A;let _;t[15]!==c||t[16]!==d?(_=h=>{const b=B(h.content);b.content.length>0&&(d(!0),c({tiptapDoc:b}))},t[15]=c,t[16]=d,t[17]=_):_=t[17];const D=_;let C;t[18]!==y?(C={tool:y},t[18]=y,t[19]=C):C=t[19];let I;t[20]!==u||t[21]!==n?(I=h=>u(n,h),t[20]=u,t[21]=n,t[22]=I):I=t[22];let M;t[23]!==g||t[24]!==n?(M=()=>g(n),t[23]=g,t[24]=n,t[25]=M):M=t[25];let j;return t[26]!==s||t[27]!==D||t[28]!==f||t[29]!==p||t[30]!==P||t[31]!==C||t[32]!==I||t[33]!==M||t[34]!==m||t[35]!==T?(j=N.jsx(G,{resourceURI:P,orgId:p,toolInfo:C,toolInput:m,toolResult:T,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:s,onMessage:D,onUpdateModelContext:I,onTeardown:M,onRequestDisplayMode:f,className:"h-full"}),t[26]=s,t[27]=D,t[28]=f,t[29]=p,t[30]=P,t[31]=C,t[32]=I,t[33]=M,t[34]=m,t[35]=T,t[36]=j):j=t[36],j}function Qt(U){const t=E.c(22),{connectionId:s,toolName:P,args:e}=U,{org:l}=H();let p;t[0]!==s||t[1]!==l.id?(p={connectionId:s,orgId:l.id},t[0]=s,t[1]=l.id,t[2]=p):p=t[2];const a=L(p);let c;t[3]!==a?(c={client:a},t[3]=a,t[4]=c):c=t[4];const{data:u}=k(c),g=decodeURIComponent(P);let d;t[5]!==g?(d=O(g),t[5]=g,t[6]=d):d=t[6];const r=d;let n,o;if(t[7]!==r||t[8]!==u.tools){let i;t[11]!==r?(i=T=>T.name===r,t[11]=r,t[12]=i):i=t[12],o=u.tools.find(i),n=o?._meta?Y(o._meta):void 0,t[7]=r,t[8]=u.tools,t[9]=n,t[10]=o}else n=t[9],o=t[10];const f=n;if(!o||!f){let i;return t[13]!==r?(i=N.jsx("div",{className:"flex items-center justify-center h-full w-full",children:N.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',r,'" not found or has no UI']})}),t[13]=r,t[14]=i):i=t[14],i}let m;return t[15]!==e||t[16]!==a||t[17]!==s||t[18]!==l.id||t[19]!==f||t[20]!==o?(m=N.jsx(K,{client:a,resourceURI:f,tool:o,connectionId:s,orgId:l.id,args:e}),t[15]=e,t[16]=a,t[17]=s,t[18]=l.id,t[19]=f,t[20]=o,t[21]=m):m=t[21],m}export{Qt as AppViewContent};
1
+ import{e as E,s as H,j as N}from"./index-ChG_GYbX.js";import{m as O,k as $,s as v}from"./pair-7_poUBO_.js";import{u as L}from"./constants-DoKzupGF.js";import{a as k,c as q}from"./use-mcp-tools-10Xveav6.js";import{c as B}from"./content-blocks-o63cs2vh.js";import{g as Y,M as G,b as w}from"./types-CdaeT_-k.js";import{c as V,b as z}from"./chat-context-Day9b1dU.js";import{u as F}from"./shell-layout-u2G0LiBx.js";import"./agent-icon-yYRj-0lJ.js";import"./AlertCircle-CQWovvD2.js";import"./Tool01-BfFn2Oyx.js";import"./XClose-gZr4qGf9.js";import"./RefreshCcw01-DMai8dtt.js";import"./ArrowNarrowLeft-CqWU9oxx.js";import"./XCircle-Cb6HyAsm.js";import"./ArrowUpRight-DvqijCIt.js";import"./ZapSquare-BblOxMfA.js";import"./Users03-BM4OMOrZ.js";import"./CheckCircle-RomNW015.js";import"./ChevronDown-9Jxith6v.js";import"./ChevronRight-Dtz86WKJ.js";import"./ChevronUp-CaQ8hxxg.js";import"./DotsVertical-BgPLp_Gk.js";import"./Container-C5OROtJe.js";import"./Star01-B-4f8EI8.js";import"./Palette-CWoH1X_q.js";import"./SearchMd-Wd5u0rRU.js";import"./index-BayHbTyS.js";import"./tooltip-D6U_mOrV.js";import"./X-CRK0a94F.js";import"./LinkExternal01-CYMJiIFP.js";import"./Lock01-DnPqyt7e.js";import"./Sun-_Pck-FJM.js";import"./Play-DqvL3G5s.js";import"./Plus-Ddba0lt_.js";import"./Settings02-BIbJ38lS.js";import"./Shield01-CiT3cZOy.js";import"./Trash01-Dgd5Vw7S.js";import"./User01-oXiwFzHp.js";import"./Zap-DLJMG7tg.js";import"./index-BjVS_mPm.js";import"./use-copy-DnJa5Wna.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-CLKO8eiC.js";import"./integration-icon-BeqPJGem.js";import"./use-virtual-mcp-DZEy75YH.js";import"./use-collections-B3Xa3dKk.js";import"./use-ai-providers-CLMcGum-.js";import"./use-decopilot-events-BEXgeJT0.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-DMNq5MhB.js";import"./use-organization-settings-DL07J8Vx.js";import"./required-auth-layout-HSIIJt__.js";import"./use-org-sso-B4kcBKk_.js";const J={};function K(U){const t=E.c(37),{client:s,resourceURI:P,tool:e,connectionId:l,orgId:p,args:a}=U,{sendMessage:c}=V(),{setAppContext:u,clearAppContext:g}=z(),{setChatOpen:d,openTab:r}=F(),n=`${l}:${e.name}`;let o;t[0]!==r?(o=h=>h==="inline"?(r("0"),"inline"):"fullscreen",t[0]=r,t[1]=o):o=t[1];const f=o,m=a??J;let i;t[2]!==s||t[3]!==e.name||t[4]!==m?(i={client:s,toolName:e.name,toolArguments:m},t[2]=s,t[3]=e.name,t[4]=m,t[5]=i):i=t[5];const{data:T}=q(i);let R;if(t[6]!==e._meta||t[7]!==e.name){const h=$(e._meta);R=v(e.name,h),t[6]=e._meta,t[7]=e.name,t[8]=R}else R=t[8];const S=R;let x;t[9]!==e.inputSchema?(x=e.inputSchema??{type:"object"},t[9]=e.inputSchema,t[10]=x):x=t[10];let A;t[11]!==S||t[12]!==x||t[13]!==e?(A={...e,name:S,inputSchema:x},t[11]=S,t[12]=x,t[13]=e,t[14]=A):A=t[14];const y=A;let _;t[15]!==c||t[16]!==d?(_=h=>{const b=B(h.content);b.content.length>0&&(d(!0),c({tiptapDoc:b}))},t[15]=c,t[16]=d,t[17]=_):_=t[17];const D=_;let C;t[18]!==y?(C={tool:y},t[18]=y,t[19]=C):C=t[19];let I;t[20]!==u||t[21]!==n?(I=h=>u(n,h),t[20]=u,t[21]=n,t[22]=I):I=t[22];let M;t[23]!==g||t[24]!==n?(M=()=>g(n),t[23]=g,t[24]=n,t[25]=M):M=t[25];let j;return t[26]!==s||t[27]!==D||t[28]!==f||t[29]!==p||t[30]!==P||t[31]!==C||t[32]!==I||t[33]!==M||t[34]!==m||t[35]!==T?(j=N.jsx(G,{resourceURI:P,orgId:p,toolInfo:C,toolInput:m,toolResult:T,displayMode:"fullscreen",minHeight:w.fullscreen.minHeight,maxHeight:w.fullscreen.maxHeight,client:s,onMessage:D,onUpdateModelContext:I,onTeardown:M,onRequestDisplayMode:f,className:"h-full"}),t[26]=s,t[27]=D,t[28]=f,t[29]=p,t[30]=P,t[31]=C,t[32]=I,t[33]=M,t[34]=m,t[35]=T,t[36]=j):j=t[36],j}function Qt(U){const t=E.c(22),{connectionId:s,toolName:P,args:e}=U,{org:l}=H();let p;t[0]!==s||t[1]!==l.id?(p={connectionId:s,orgId:l.id},t[0]=s,t[1]=l.id,t[2]=p):p=t[2];const a=L(p);let c;t[3]!==a?(c={client:a},t[3]=a,t[4]=c):c=t[4];const{data:u}=k(c),g=decodeURIComponent(P);let d;t[5]!==g?(d=O(g),t[5]=g,t[6]=d):d=t[6];const r=d;let n,o;if(t[7]!==r||t[8]!==u.tools){let i;t[11]!==r?(i=T=>T.name===r,t[11]=r,t[12]=i):i=t[12],o=u.tools.find(i),n=o?._meta?Y(o._meta):void 0,t[7]=r,t[8]=u.tools,t[9]=n,t[10]=o}else n=t[9],o=t[10];const f=n;if(!o||!f){let i;return t[13]!==r?(i=N.jsx("div",{className:"flex items-center justify-center h-full w-full",children:N.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',r,'" not found or has no UI']})}),t[13]=r,t[14]=i):i=t[14],i}let m;return t[15]!==e||t[16]!==a||t[17]!==s||t[18]!==l.id||t[19]!==f||t[20]!==o?(m=N.jsx(K,{client:a,resourceURI:f,tool:o,connectionId:s,orgId:l.id,args:e}),t[15]=e,t[16]=a,t[17]=s,t[18]=l.id,t[19]=f,t[20]=o,t[21]=m):m=t[21],m}export{Qt as AppViewContent};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-C90BJ6Rq.js","assets/index-ChG_GYbX.js","assets/index-CICJCo3v.css","assets/ArrowNarrowLeft-CqWU9oxx.js","assets/CheckCircle-RomNW015.js","assets/Container-C5OROtJe.js","assets/Settings02-BIbJ38lS.js","assets/XCircle-Cb6HyAsm.js","assets/constants-DoKzupGF.js","assets/useInfiniteQuery-Co9WNPPX.js","assets/infiniteQueryObserver-BkQFPIb1.js","assets/badge-EwYkSrNU.js","assets/input-cSChLxlO.js","assets/dropdown-menu-C6nHRZ2x.js","assets/ChevronDown-9Jxith6v.js","assets/ChevronRight-Dtz86WKJ.js","assets/DotsVertical-BgPLp_Gk.js","assets/table-BFGAzwxV.js","assets/toggle-group-C1gRrQ9h.js","assets/use-view-mode-BjcxKjKE.js","assets/tooltip-D6U_mOrV.js","assets/SearchMd-Wd5u0rRU.js","assets/dialog-CLKO8eiC.js","assets/X-CRK0a94F.js","assets/AlertCircle-CQWovvD2.js","assets/alert-dialog-4PMn5MEd.js","assets/card-Da8kkDcf.js","assets/Trash01-Dgd5Vw7S.js","assets/label-qFek-Hzr.js","assets/select-CeexIfr3.js","assets/ChevronUp-CaQ8hxxg.js","assets/switch-CO8ELkEz.js","assets/textarea-DsA14nCU.js","assets/RefreshCcw01-DMai8dtt.js","assets/checkbox-BTjBq0PR.js","assets/LinkExternal01-CYMJiIFP.js","assets/use-copy-DnJa5Wna.js","assets/Plus-Ddba0lt_.js","assets/Play-DqvL3G5s.js"])))=>i.map(i=>d[i]);
2
+ import{e as a,j as t,r,l as i,_ as o}from"./index-ChG_GYbX.js";const n=r.lazy(()=>o(()=>import("./registry-layout-C90BJ6Rq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38])));function c(){const s=a.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(r.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(i,{size:20,className:"animate-spin text-muted-foreground"})}),children:t.jsx(n,{})}),s[0]=e):e=s[0],e}export{c as default};
@@ -1,4 +1,4 @@
1
- import{e as Y,s as ie,n as Ie,o as ke,a as je,x as V,r as I,j as t,B as G,l as Le,c as Z,G as Fs,F as Bs}from"./index-Bn0n2Tn5.js";import{i as Qs}from"./ArrowNarrowLeft-ctHZC7IK.js";import{i as qe}from"./CheckCircle-3lbo4DOp.js";import{n as Vs}from"./Container-BbxUmzld.js";import{a as Gs}from"./Settings02-NVTdZYn8.js";import{b as Jt,n as Ks,a as ds,f as Zt,g as Ys,h as us,d as Hs,e as Ws,i as Js,c as St,t as Zs,j as Xs}from"./XCircle-CBqb98Hh.js";import{S as ce,u as oe,d as er}from"./constants-DWChG_gh.js";import{u as ms}from"./useInfiniteQuery-BkNuxXHJ.js";import{B as F}from"./badge-BJnKVqQg.js";import{I as ae}from"./input-C0cHvFsP.js";import{a as dt,c as Ce,D as ut,b as mt,j as Xt,k as es,i as tr}from"./dropdown-menu-LTGIQdd2.js";import{c as Mt,d as Et,a as Fe,e as ue,b as Dt,T as me}from"./table-UGp85pBs.js";import{T as sr,a as ts}from"./toggle-group-CrNuUyQT.js";import{u as rr}from"./use-view-mode-lvgEn118.js";import{i as At}from"./DotsVertical-q5wudUQb.js";import{i as nr,a as ir}from"./SearchMd-tlcXyQa_.js";import{c as xt,d as ht,e as pt,D as ft,a as gt,b as jt}from"./dialog-U3vhhaTY.js";import{i as Ke}from"./AlertCircle-BefAeM6u.js";import{c as Ye,b as He,d as We,f as Je,g as Ze,e as Xe,a as et,A as tt}from"./alert-dialog-BY7wdwxM.js";import{C as ne}from"./card-Dp6Lilh-.js";import{s as st}from"./Trash01-CGGNK3g-.js";import{L as X}from"./label-C-b-mt3k.js";import{S as lr,a as ar,b as or,c as cr,d as Rt}from"./select-rt68l1g_.js";import{S as Oe}from"./switch-Dd-fbXw9.js";import{T as vt}from"./textarea-Ds8u2czk.js";import{a as $t,c as dr,i as ur,s as xs,b as mr}from"./RefreshCcw01-DhQjzDQL.js";import{i as xr}from"./X-XvFOaH_0.js";import{t as hr,i as Tt}from"./ChevronDown-BMsVDJMd.js";import{n as pr}from"./ChevronUp-Ba2YtjVA.js";import{C as ss}from"./checkbox-CouoIES-.js";import{n as fr}from"./LinkExternal01-B-rWZEWZ.js";import{u as It}from"./use-copy-CBB3IfKo.js";import{s as gr}from"./Plus-B1zoIOQx.js";import{a as jr,b as vr,T as br}from"./tooltip-CkzGOY_H.js";import{i as yr}from"./Play-BwE8tx_2.js";import"./infiniteQueryObserver-BuP6-BnP.js";import"./ChevronRight-DNaFnNR_.js";const $e="private-registry",Nr=`
1
+ import{e as Y,s as ie,n as Ie,o as ke,a as je,x as V,r as I,j as t,B as G,l as Le,c as Z,G as Fs,F as Bs}from"./index-ChG_GYbX.js";import{i as Qs}from"./ArrowNarrowLeft-CqWU9oxx.js";import{i as qe}from"./CheckCircle-RomNW015.js";import{n as Vs}from"./Container-C5OROtJe.js";import{a as Gs}from"./Settings02-BIbJ38lS.js";import{b as Jt,n as Ks,a as ds,f as Zt,g as Ys,h as us,d as Hs,e as Ws,i as Js,c as St,t as Zs,j as Xs}from"./XCircle-Cb6HyAsm.js";import{S as ce,u as oe,d as er}from"./constants-DoKzupGF.js";import{u as ms}from"./useInfiniteQuery-Co9WNPPX.js";import{B as F}from"./badge-EwYkSrNU.js";import{I as ae}from"./input-cSChLxlO.js";import{a as dt,c as Ce,D as ut,b as mt,j as Xt,k as es,i as tr}from"./dropdown-menu-C6nHRZ2x.js";import{c as Mt,d as Et,a as Fe,e as ue,b as Dt,T as me}from"./table-BFGAzwxV.js";import{T as sr,a as ts}from"./toggle-group-C1gRrQ9h.js";import{u as rr}from"./use-view-mode-BjcxKjKE.js";import{i as At}from"./DotsVertical-BgPLp_Gk.js";import{i as nr,a as ir}from"./SearchMd-Wd5u0rRU.js";import{c as xt,d as ht,e as pt,D as ft,a as gt,b as jt}from"./dialog-CLKO8eiC.js";import{i as Ke}from"./AlertCircle-CQWovvD2.js";import{c as Ye,b as He,d as We,f as Je,g as Ze,e as Xe,a as et,A as tt}from"./alert-dialog-4PMn5MEd.js";import{C as ne}from"./card-Da8kkDcf.js";import{s as st}from"./Trash01-Dgd5Vw7S.js";import{L as X}from"./label-qFek-Hzr.js";import{S as lr,a as ar,b as or,c as cr,d as Rt}from"./select-CeexIfr3.js";import{S as Oe}from"./switch-CO8ELkEz.js";import{T as vt}from"./textarea-DsA14nCU.js";import{a as $t,c as dr,i as ur,s as xs,b as mr}from"./RefreshCcw01-DMai8dtt.js";import{i as xr}from"./X-CRK0a94F.js";import{t as hr,i as Tt}from"./ChevronDown-9Jxith6v.js";import{n as pr}from"./ChevronUp-CaQ8hxxg.js";import{C as ss}from"./checkbox-BTjBq0PR.js";import{n as fr}from"./LinkExternal01-CYMJiIFP.js";import{u as It}from"./use-copy-DnJa5Wna.js";import{s as gr}from"./Plus-Ddba0lt_.js";import{a as jr,b as vr,T as br}from"./tooltip-D6U_mOrV.js";import{i as yr}from"./Play-DqvL3G5s.js";import"./infiniteQueryObserver-BkQFPIb1.js";import"./ChevronRight-Dtz86WKJ.js";const $e="private-registry",Nr=`
2
2
  You are an MCP tool tester running automated integration checks.
3
3
 
4
4
  Goal:
@@ -1 +1 @@
1
- import{e as c,j as i,A as a,S as u,h,k as f,U as m,N as x}from"./index-Bn0n2Tn5.js";function g(){const t=c.c(5),s=m().location.href;let r;t[0]!==s?(r=s==="/login"||s.startsWith("/login?"),t[0]=s,t[1]=r):r=t[1];const n=r;let o;if(t[2]!==s||t[3]!==n){const l=n?{}:{next:s};o=i.jsx(x,{to:"/login",search:l,replace:!0}),t[2]=s,t[3]=n,t[4]=o}else o=t[4];return o}function d(t){const e=c.c(6),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(a,{children:i.jsx(u,{})}),e[0]=r):r=e[0];let n;e[1]!==s?(n=i.jsx(h,{children:s}),e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(f,{children:i.jsx(g,{})}),e[3]=o):o=e[3];let l;return e[4]!==n?(l=i.jsxs(i.Fragment,{children:[r,n,o]}),e[4]=n,e[5]=l):l=e[5],l}export{d as R};
1
+ import{e as c,j as i,A as a,S as u,h,k as f,U as m,N as x}from"./index-ChG_GYbX.js";function g(){const t=c.c(5),s=m().location.href;let r;t[0]!==s?(r=s==="/login"||s.startsWith("/login?"),t[0]=s,t[1]=r):r=t[1];const n=r;let o;if(t[2]!==s||t[3]!==n){const l=n?{}:{next:s};o=i.jsx(x,{to:"/login",search:l,replace:!0}),t[2]=s,t[3]=n,t[4]=o}else o=t[4];return o}function d(t){const e=c.c(6),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(a,{children:i.jsx(u,{})}),e[0]=r):r=e[0];let n;e[1]!==s?(n=i.jsx(h,{children:s}),e[1]=s,e[2]=n):n=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(f,{children:i.jsx(g,{})}),e[3]=o):o=e[3];let l;return e[4]!==n?(l=i.jsxs(i.Fragment,{children:[r,n,o]}),e[4]=n,e[5]=l):l=e[5],l}export{d as R};
@@ -1 +1 @@
1
- import{e as q,d as Y,f as A,r as B,a as G,j as s,B as z,b as K}from"./index-Bn0n2Tn5.js";import{I as L}from"./input-C0cHvFsP.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let f;e[22]!==a||e[23]!==t?(f=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=f):f=e[24];let g;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(g=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=g):g=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==f||e[42]!==g||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,f,g,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=f,e[42]=g,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
1
+ import{e as q,d as Y,f as A,r as B,a as G,j as s,B as z,b as K}from"./index-ChG_GYbX.js";import{I as L}from"./input-cSChLxlO.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let f;e[22]!==a||e[23]!==t?(f=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=f):f=e[24];let g;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(g=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=g):g=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==f||e[42]!==g||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,f,g,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=f,e[42]=g,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
@@ -0,0 +1 @@
1
+ import{r as k,s as Ne,K as ae,aM as lt,j as s,c as K,l as Ie,B as ne,e as Q,n as Ue,o as ke,z as at,C as ct,a as Ve,x as pe,t as be,H as je,aK as xe,J as se,aI as Pe,a_ as Me,E as dt,f as mt,d as ut}from"./index-ChG_GYbX.js";import{u as gt}from"./use-organization-roles-CqY2IBkE.js";import{u as Oe}from"./use-org-auth-client-C5VSPyTf.js";import{B as _e}from"./badge-EwYkSrNU.js";import{A as Be,a as ze,b as Ye,c as He,d as $e,f as Ke,e as Fe,g as Qe}from"./alert-dialog-4PMn5MEd.js";import{D as Et,a as Tt,b as ft,c as pt}from"./dropdown-menu-C6nHRZ2x.js";import{i as _t}from"./DotsVertical-BgPLp_Gk.js";import{i as Ze}from"./Lock01-DnPqyt7e.js";import{s as Se}from"./Plus-Ddba0lt_.js";import{s as It}from"./Trash01-Dgd5Vw7S.js";import{C as ht}from"./collection-table-wrapper-K7myIred.js";import{P as te}from"./index-BayHbTyS.js";import{E as Ge}from"./empty-state-vECJlBES.js";import{S as ye}from"./search-input-ZAyrquFx.js";import{P as qe,D as Xe}from"./ai-providers-logos-D6a8kmGH.js";import{I as Le}from"./integration-icon-BeqPJGem.js";import{u as Rt}from"./use-infinite-scroll-pE0yY5YF.js";import{C as ve}from"./checkbox-BTjBq0PR.js";import{i as xt}from"./RefreshCcw01-DMai8dtt.js";import{u as Nt}from"./useSuspenseInfiniteQuery-BbwxgHZr.js";import{u as Ct,S as At}from"./constants-DoKzupGF.js";import{C as St}from"./collection-search-DiGSdKFX.js";import{u as Je}from"./use-members-DYi4jSpk.js";import{u as bt}from"./use-connection-UQYyaO6_.js";import{u as Ot,c as yt}from"./use-ai-providers-CLMcGum-.js";import{A as We}from"./avatar-BBsS3gKf.js";import{S as re}from"./switch-CO8ELkEz.js";import{c as ge,T as Ee,a as Te,b as fe}from"./tooltip-D6U_mOrV.js";import{t as Lt}from"./ChevronDown-9Jxith6v.js";import{i as vt}from"./ChevronRight-Dtz86WKJ.js";import{a as jt}from"./SearchMd-Wd5u0rRU.js";import{i as De}from"./X-CRK0a94F.js";import"./table-BFGAzwxV.js";import"./XClose-gZr4qGf9.js";import"./Container-C5OROtJe.js";import"./agent-icon-yYRj-0lJ.js";import"./AlertCircle-CQWovvD2.js";import"./Tool01-BfFn2Oyx.js";import"./ArrowNarrowLeft-CqWU9oxx.js";import"./XCircle-Cb6HyAsm.js";import"./ArrowUpRight-DvqijCIt.js";import"./ZapSquare-BblOxMfA.js";import"./Users03-BM4OMOrZ.js";import"./CheckCircle-RomNW015.js";import"./ChevronUp-CaQ8hxxg.js";import"./Star01-B-4f8EI8.js";import"./Palette-CWoH1X_q.js";import"./LinkExternal01-CYMJiIFP.js";import"./Sun-_Pck-FJM.js";import"./Play-DqvL3G5s.js";import"./Settings02-BIbJ38lS.js";import"./Shield01-CiT3cZOy.js";import"./User01-oXiwFzHp.js";import"./Zap-DLJMG7tg.js";import"./infiniteQueryObserver-BkQFPIb1.js";import"./use-collections-B3Xa3dKk.js";const et=[{name:"ORGANIZATION_CREATE",description:"Create a new organization",category:"Organizations"},{name:"ORGANIZATION_LIST",description:"List organizations",category:"Organizations"},{name:"ORGANIZATION_GET",description:"View organization details",category:"Organizations"},{name:"ORGANIZATION_UPDATE",description:"Update organization",category:"Organizations"},{name:"ORGANIZATION_DELETE",description:"Delete organization",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_SETTINGS_GET",description:"View organization settings",category:"Organizations"},{name:"ORGANIZATION_SETTINGS_UPDATE",description:"Update organization settings",category:"Organizations"},{name:"BRAND_CONTEXT_LIST",description:"List brand contexts",category:"Organizations"},{name:"BRAND_CONTEXT_GET",description:"View brand context",category:"Organizations"},{name:"BRAND_CONTEXT_CREATE",description:"Create brand context",category:"Organizations"},{name:"BRAND_CONTEXT_UPDATE",description:"Update brand context",category:"Organizations"},{name:"BRAND_CONTEXT_DELETE",description:"Delete brand context",category:"Organizations",dangerous:!0},{name:"BRAND_CONTEXT_EXTRACT",description:"Extract brand context from website",category:"Organizations"},{name:"BRAND_GET",description:"Get brand (binding)",category:"Organizations"},{name:"BRAND_LIST",description:"List brands (binding)",category:"Organizations"},{name:"ORGANIZATION_DOMAIN_GET",description:"Get organization domain claim",category:"Organizations"},{name:"ORGANIZATION_DOMAIN_SET",description:"Set organization domain claim",category:"Organizations"},{name:"ORGANIZATION_DOMAIN_UPDATE",description:"Update organization domain settings",category:"Organizations"},{name:"ORGANIZATION_DOMAIN_CLEAR",description:"Clear organization domain claim",category:"Organizations"},{name:"ORGANIZATION_MEMBER_ADD",description:"Add members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_REMOVE",description:"Remove members",category:"Organizations",dangerous:!0},{name:"ORGANIZATION_MEMBER_LIST",description:"List members",category:"Organizations"},{name:"ORGANIZATION_MEMBER_UPDATE_ROLE",description:"Update member roles",category:"Organizations"},{name:"COLLECTION_CONNECTIONS_CREATE",description:"Create connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_LIST",description:"List connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_GET",description:"View connection details",category:"Connections"},{name:"COLLECTION_CONNECTIONS_UPDATE",description:"Update connections",category:"Connections"},{name:"COLLECTION_CONNECTIONS_DELETE",description:"Delete connections",category:"Connections",dangerous:!0},{name:"CONNECTION_TEST",description:"Test connections",category:"Connections"},{name:"DATABASES_RUN_SQL",description:"Run SQL queries",category:"Connections",dangerous:!0},{name:"COLLECTION_VIRTUAL_MCP_CREATE",description:"Create virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_LIST",description:"List virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_GET",description:"View virtual MCP details",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_UPDATE",description:"Update virtual MCPs",category:"Virtual MCPs"},{name:"COLLECTION_VIRTUAL_MCP_DELETE",description:"Delete virtual MCPs",category:"Virtual MCPs",dangerous:!0},{name:"MONITORING_LOG_GET",description:"View monitoring log details",category:"Monitoring"},{name:"MONITORING_LOGS_LIST",description:"List monitoring logs",category:"Monitoring"},{name:"MONITORING_STATS",description:"View monitoring statistics",category:"Monitoring"},{name:"API_KEY_CREATE",description:"Create API key",category:"API Keys"},{name:"API_KEY_LIST",description:"List API keys",category:"API Keys"},{name:"API_KEY_UPDATE",description:"Update API key",category:"API Keys"},{name:"API_KEY_DELETE",description:"Delete API key",category:"API Keys",dangerous:!0},{name:"EVENT_PUBLISH",description:"Publish events",category:"Event Bus"},{name:"EVENT_SUBSCRIBE",description:"Subscribe to events",category:"Event Bus"},{name:"EVENT_UNSUBSCRIBE",description:"Unsubscribe from events",category:"Event Bus"},{name:"EVENT_CANCEL",description:"Cancel recurring events",category:"Event Bus"},{name:"EVENT_ACK",description:"Acknowledge event delivery",category:"Event Bus"},{name:"EVENT_SUBSCRIPTION_LIST",description:"List event subscriptions",category:"Event Bus"},{name:"EVENT_SYNC_SUBSCRIPTIONS",description:"Sync subscriptions to desired state",category:"Event Bus"},{name:"USER_GET",description:"Get a user by id",category:"Users"},{name:"COLLECTION_THREADS_CREATE",description:"Create threads",category:"Threads"},{name:"COLLECTION_THREADS_LIST",description:"List threads",category:"Threads"},{name:"COLLECTION_THREADS_GET",description:"View thread details",category:"Threads"},{name:"COLLECTION_THREADS_UPDATE",description:"Update threads",category:"Threads"},{name:"COLLECTION_THREADS_DELETE",description:"Delete threads",category:"Threads",dangerous:!0},{name:"COLLECTION_THREAD_MESSAGES_LIST",description:"List thread messages",category:"Threads"},{name:"TAGS_LIST",description:"List organization tags",category:"Tags"},{name:"TAGS_CREATE",description:"Create organization tag",category:"Tags"},{name:"TAGS_DELETE",description:"Delete organization tag",category:"Tags",dangerous:!0},{name:"MEMBER_TAGS_GET",description:"Get member tags",category:"Tags"},{name:"MEMBER_TAGS_SET",description:"Set member tags",category:"Tags"},{name:"AUTOMATION_CREATE",description:"Create automation",category:"Automations"},{name:"AUTOMATION_GET",description:"View automation details",category:"Automations"},{name:"AUTOMATION_LIST",description:"List automations",category:"Automations"},{name:"AUTOMATION_UPDATE",description:"Update automation",category:"Automations"},{name:"AUTOMATION_DELETE",description:"Delete automation",category:"Automations",dangerous:!0},{name:"AUTOMATION_TRIGGER_ADD",description:"Add trigger to automation",category:"Automations"},{name:"AUTOMATION_TRIGGER_REMOVE",description:"Remove trigger from automation",category:"Automations"},{name:"AUTOMATION_RUN",description:"Manually trigger an automation run",category:"Automations"},{name:"VIRTUAL_MCP_PLUGIN_CONFIG_GET",description:"View virtual MCP plugin configuration",category:"Virtual MCPs"},{name:"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",description:"Update virtual MCP plugin configuration",category:"Virtual MCPs"},{name:"VIRTUAL_MCP_PINNED_VIEWS_UPDATE",description:"Update virtual MCP pinned sidebar views",category:"Virtual MCPs"},{name:"AI_PROVIDERS_LIST",description:"List available AI providers",category:"AI Providers"},{name:"AI_PROVIDERS_LIST_MODELS",description:"List AI provider models",category:"AI Providers"},{name:"AI_PROVIDERS_ACTIVE",description:"List active AI providers",category:"AI Providers"},{name:"AI_PROVIDER_KEY_CREATE",description:"Store AI provider API key",category:"AI Providers"},{name:"AI_PROVIDER_KEY_LIST",description:"List AI provider API keys",category:"AI Providers"},{name:"AI_PROVIDER_KEY_DELETE",description:"Delete AI provider API key",category:"AI Providers",dangerous:!0},{name:"AI_PROVIDER_OAUTH_URL",description:"Get OAuth URL for provider",category:"AI Providers"},{name:"AI_PROVIDER_OAUTH_EXCHANGE",description:"Exchange OAuth code for API key",category:"AI Providers"},{name:"AI_PROVIDER_PROVISION_KEY",description:"Auto-provision API key for a provider",category:"AI Providers"},{name:"AI_PROVIDER_TOPUP_URL",description:"Get checkout URL to top up provider credits",category:"AI Providers"},{name:"AI_PROVIDER_CREDITS",description:"Get current credit balance for a provider",category:"AI Providers"},{name:"AI_PROVIDER_CLI_ACTIVATE",description:"Activate Claude Code via local CLI",category:"AI Providers"},{name:"LIST_OBJECTS",description:"List objects in storage",category:"Object Storage"},{name:"GET_OBJECT_METADATA",description:"Get object metadata",category:"Object Storage"},{name:"GET_PRESIGNED_URL",description:"Generate download URL",category:"Object Storage"},{name:"PUT_PRESIGNED_URL",description:"Generate upload URL",category:"Object Storage"},{name:"DELETE_OBJECT",description:"Delete object",category:"Object Storage",dangerous:!0},{name:"DELETE_OBJECTS",description:"Delete multiple objects",category:"Object Storage",dangerous:!0},{name:"COLLECTION_REGISTRY_APP_LIST",description:"List registry apps",category:"Registry"},{name:"COLLECTION_REGISTRY_APP_GET",description:"Get registry app details",category:"Registry"},{name:"COLLECTION_REGISTRY_APP_VERSIONS",description:"List registry app versions",category:"Registry"},{name:"COLLECTION_REGISTRY_APP_FILTERS",description:"Get registry app filters",category:"Registry"},{name:"REGISTRY_ITEM_LIST",description:"List private registry items",category:"Registry"},{name:"REGISTRY_ITEM_SEARCH",description:"Search registry items",category:"Registry"},{name:"REGISTRY_ITEM_GET",description:"Get registry item details",category:"Registry"},{name:"REGISTRY_ITEM_VERSIONS",description:"List registry item versions",category:"Registry"},{name:"REGISTRY_ITEM_CREATE",description:"Create registry item",category:"Registry"},{name:"REGISTRY_ITEM_BULK_CREATE",description:"Bulk create registry items",category:"Registry"},{name:"REGISTRY_ITEM_UPDATE",description:"Update registry item",category:"Registry"},{name:"REGISTRY_ITEM_DELETE",description:"Delete registry item",category:"Registry",dangerous:!0},{name:"REGISTRY_ITEM_FILTERS",description:"Get registry item filters",category:"Registry"},{name:"REGISTRY_DISCOVER_TOOLS",description:"Discover tools from MCP server",category:"Registry"},{name:"REGISTRY_AI_GENERATE",description:"AI-generate registry content",category:"Registry"},{name:"REGISTRY_PUBLISH_REQUEST_LIST",description:"List publish requests",category:"Registry"},{name:"REGISTRY_PUBLISH_REQUEST_REVIEW",description:"Review publish request",category:"Registry"},{name:"REGISTRY_PUBLISH_REQUEST_COUNT",description:"Count pending publish requests",category:"Registry"},{name:"REGISTRY_PUBLISH_REQUEST_DELETE",description:"Delete publish request",category:"Registry",dangerous:!0},{name:"REGISTRY_PUBLISH_API_KEY_GENERATE",description:"Generate publish API key",category:"Registry"},{name:"REGISTRY_PUBLISH_API_KEY_LIST",description:"List publish API keys",category:"Registry"},{name:"REGISTRY_PUBLISH_API_KEY_REVOKE",description:"Revoke publish API key",category:"Registry",dangerous:!0},{name:"REGISTRY_MONITOR_RUN_START",description:"Start monitor run",category:"Registry"},{name:"REGISTRY_MONITOR_RUN_LIST",description:"List monitor runs",category:"Registry"},{name:"REGISTRY_MONITOR_RUN_GET",description:"Get monitor run details",category:"Registry"},{name:"REGISTRY_MONITOR_RUN_CANCEL",description:"Cancel monitor run",category:"Registry"},{name:"REGISTRY_MONITOR_RESULT_LIST",description:"List monitor results",category:"Registry"},{name:"REGISTRY_MONITOR_CONNECTION_LIST",description:"List monitor connections",category:"Registry"},{name:"REGISTRY_MONITOR_CONNECTION_SYNC",description:"Sync monitor connections",category:"Registry"},{name:"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",description:"Update monitor connection auth",category:"Registry"},{name:"REGISTRY_MONITOR_SCHEDULE_SET",description:"Set monitor schedule",category:"Registry"},{name:"REGISTRY_MONITOR_SCHEDULE_CANCEL",description:"Cancel monitor schedule",category:"Registry"},{name:"VM_START",description:"Start a Freestyle VM with dev server preview",category:"VM"},{name:"VM_DELETE",description:"Stop and delete a Freestyle VM",category:"VM"},{name:"GITHUB_LIST_USER_ORGS",description:"List GitHub user's personal account and organizations",category:"GitHub"}],Pt={ORGANIZATION_CREATE:"Create organization",ORGANIZATION_LIST:"List organizations",ORGANIZATION_GET:"View organization details",ORGANIZATION_UPDATE:"Update organization",ORGANIZATION_DELETE:"Delete organization",ORGANIZATION_SETTINGS_GET:"View organization settings",ORGANIZATION_SETTINGS_UPDATE:"Update organization settings",BRAND_CONTEXT_LIST:"List brand contexts",BRAND_CONTEXT_GET:"View brand context",BRAND_CONTEXT_CREATE:"Create brand context",BRAND_CONTEXT_UPDATE:"Update brand context",BRAND_CONTEXT_DELETE:"Delete brand context",BRAND_CONTEXT_EXTRACT:"Extract brand from website",BRAND_GET:"Get brand",BRAND_LIST:"List brands",ORGANIZATION_DOMAIN_GET:"Get domain claim",ORGANIZATION_DOMAIN_SET:"Set domain claim",ORGANIZATION_DOMAIN_UPDATE:"Update domain settings",ORGANIZATION_DOMAIN_CLEAR:"Clear domain claim",ORGANIZATION_MEMBER_LIST:"List members",ORGANIZATION_MEMBER_ADD:"Add members",ORGANIZATION_MEMBER_REMOVE:"Remove members",ORGANIZATION_MEMBER_UPDATE_ROLE:"Update member roles",COLLECTION_CONNECTIONS_LIST:"List connections",COLLECTION_CONNECTIONS_GET:"View connection details",COLLECTION_CONNECTIONS_CREATE:"Create connections",COLLECTION_CONNECTIONS_UPDATE:"Update connections",COLLECTION_CONNECTIONS_DELETE:"Delete connections",CONNECTION_TEST:"Test connections",DATABASES_RUN_SQL:"Run SQL queries",COLLECTION_VIRTUAL_MCP_CREATE:"Create virtual MCPs",COLLECTION_VIRTUAL_MCP_LIST:"List virtual MCPs",COLLECTION_VIRTUAL_MCP_GET:"View virtual MCP details",COLLECTION_VIRTUAL_MCP_UPDATE:"Update virtual MCPs",COLLECTION_VIRTUAL_MCP_DELETE:"Delete virtual MCPs",MONITORING_LOG_GET:"View monitoring log details",MONITORING_LOGS_LIST:"List monitoring logs",MONITORING_STATS:"View monitoring statistics",API_KEY_CREATE:"Create API key",API_KEY_LIST:"List API keys",API_KEY_UPDATE:"Update API key",API_KEY_DELETE:"Delete API key",EVENT_PUBLISH:"Publish events",EVENT_SUBSCRIBE:"Subscribe to events",EVENT_UNSUBSCRIBE:"Unsubscribe from events",EVENT_CANCEL:"Cancel recurring events",EVENT_ACK:"Acknowledge event delivery",EVENT_SUBSCRIPTION_LIST:"List event subscriptions",EVENT_SYNC_SUBSCRIPTIONS:"Sync subscriptions to desired state",USER_GET:"Get user by id",COLLECTION_THREADS_CREATE:"Create threads",COLLECTION_THREADS_LIST:"List threads",COLLECTION_THREADS_GET:"View thread details",COLLECTION_THREADS_UPDATE:"Update threads",COLLECTION_THREADS_DELETE:"Delete threads",COLLECTION_THREAD_MESSAGES_LIST:"List thread messages",TAGS_LIST:"List organization tags",TAGS_CREATE:"Create organization tag",TAGS_DELETE:"Delete organization tag",MEMBER_TAGS_GET:"Get member tags",MEMBER_TAGS_SET:"Set member tags",VIRTUAL_MCP_PLUGIN_CONFIG_GET:"View plugin config",VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE:"Update plugin config",VIRTUAL_MCP_PINNED_VIEWS_UPDATE:"Update pinned views",AUTOMATION_CREATE:"Create automation",AUTOMATION_GET:"View automation details",AUTOMATION_LIST:"List automations",AUTOMATION_UPDATE:"Update automation",AUTOMATION_DELETE:"Delete automation",AUTOMATION_TRIGGER_ADD:"Add trigger",AUTOMATION_TRIGGER_REMOVE:"Remove trigger",AUTOMATION_RUN:"Run automation",AI_PROVIDERS_LIST:"List AI providers",AI_PROVIDERS_LIST_MODELS:"List AI models",AI_PROVIDERS_ACTIVE:"List active providers",AI_PROVIDER_KEY_CREATE:"Create provider key",AI_PROVIDER_KEY_LIST:"List provider keys",AI_PROVIDER_KEY_DELETE:"Delete provider key",AI_PROVIDER_OAUTH_URL:"Get OAuth URL",AI_PROVIDER_OAUTH_EXCHANGE:"Connect via OAuth",AI_PROVIDER_PROVISION_KEY:"Auto-provision key",AI_PROVIDER_TOPUP_URL:"Get top-up checkout URL",AI_PROVIDER_CREDITS:"Get credit balance",AI_PROVIDER_CLI_ACTIVATE:"Activate Claude Code CLI",LIST_OBJECTS:"List objects",GET_OBJECT_METADATA:"Get object metadata",GET_PRESIGNED_URL:"Generate download URL",PUT_PRESIGNED_URL:"Generate upload URL",DELETE_OBJECT:"Delete object",DELETE_OBJECTS:"Delete multiple objects",COLLECTION_REGISTRY_APP_LIST:"List registry apps",COLLECTION_REGISTRY_APP_GET:"Get registry app",COLLECTION_REGISTRY_APP_VERSIONS:"List registry app versions",COLLECTION_REGISTRY_APP_FILTERS:"Get registry filters",REGISTRY_ITEM_LIST:"List registry items",REGISTRY_ITEM_SEARCH:"Search registry",REGISTRY_ITEM_GET:"Get registry item",REGISTRY_ITEM_VERSIONS:"List item versions",REGISTRY_ITEM_CREATE:"Create registry item",REGISTRY_ITEM_BULK_CREATE:"Bulk create items",REGISTRY_ITEM_UPDATE:"Update registry item",REGISTRY_ITEM_DELETE:"Delete registry item",REGISTRY_ITEM_FILTERS:"Get item filters",REGISTRY_DISCOVER_TOOLS:"Discover tools",REGISTRY_AI_GENERATE:"AI generate content",REGISTRY_PUBLISH_REQUEST_LIST:"List publish requests",REGISTRY_PUBLISH_REQUEST_REVIEW:"Review publish request",REGISTRY_PUBLISH_REQUEST_COUNT:"Count publish requests",REGISTRY_PUBLISH_REQUEST_DELETE:"Delete publish request",REGISTRY_PUBLISH_API_KEY_GENERATE:"Generate API key",REGISTRY_PUBLISH_API_KEY_LIST:"List API keys",REGISTRY_PUBLISH_API_KEY_REVOKE:"Revoke API key",REGISTRY_MONITOR_RUN_START:"Start monitor run",REGISTRY_MONITOR_RUN_LIST:"List monitor runs",REGISTRY_MONITOR_RUN_GET:"Get monitor run",REGISTRY_MONITOR_RUN_CANCEL:"Cancel monitor run",REGISTRY_MONITOR_RESULT_LIST:"List monitor results",REGISTRY_MONITOR_CONNECTION_LIST:"List monitor connections",REGISTRY_MONITOR_CONNECTION_SYNC:"Sync monitor connections",REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH:"Update connection auth",REGISTRY_MONITOR_SCHEDULE_SET:"Set monitor schedule",REGISTRY_MONITOR_SCHEDULE_CANCEL:"Cancel monitor schedule",VM_START:"Start VM preview",VM_DELETE:"Delete VM preview",GITHUB_LIST_USER_ORGS:"List GitHub user orgs"};function Mt(){const t={Organizations:[],Connections:[],"Virtual MCPs":[],Threads:[],Monitoring:[],Users:[],"API Keys":[],"Event Bus":[],Tags:[],"AI Providers":[],Automations:[],"Object Storage":[],Registry:[],GitHub:[],VM:[]};for(const e of et)t[e.category]?.push(e);return t}function Gt(){return et.map(t=>({value:t.name,label:Pt[t.name],dangerous:t.dangerous}))}const Dt=k.memo(function(e){const n=Q.c(21),{connection:i,isSelected:l,hasToolsEnabled:a,activeToolsCount:g,totalToolsCount:p,onSelect:c,onToggle:T}=e,E=l?"bg-accent/50":"hover:bg-muted/50";let m;n[0]!==E?(m=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",E),n[0]=E,n[1]=m):m=n[1];let r;n[2]!==i.icon||n[3]!==i.title?(r=s.jsx(Le,{icon:i.icon,name:i.title,size:"xs"}),n[2]=i.icon,n[3]=i.title,n[4]=r):r=n[4];let u;n[5]!==i.title?(u=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.title})}),n[5]=i.title,n[6]=u):u=n[6];let d;n[7]!==c||n[8]!==r||n[9]!==u?(d=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[r,u]}),n[7]=c,n[8]=r,n[9]=u,n[10]=d):d=n[10];let _;n[11]!==g||n[12]!==i.tools||n[13]!==a||n[14]!==T||n[15]!==p?(_=i.tools&&i.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[g,"/",p]}),s.jsx(ve,{checked:a,onCheckedChange:T,onClick:kt})]}),n[11]=g,n[12]=i.tools,n[13]=a,n[14]=T,n[15]=p,n[16]=_):_=n[16];let x;return n[17]!==m||n[18]!==d||n[19]!==_?(x=s.jsxs("div",{className:m,children:[d,_]}),n[17]=m,n[18]=d,n[19]=_,n[20]=x):x=n[20],x}),wt=k.memo(function(e){const n=Q.c(18),{connectionId:i,tool:l,isSelected:a,onToggle:g}=e,p=`tool-${i}-${l.name}`,c=a?"text-foreground":"text-muted-foreground";let T;n[0]!==c?(T=K("text-sm font-medium",c),n[0]=c,n[1]=T):T=n[1];let E;n[2]!==T||n[3]!==l.name?(E=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:T,children:l.name})}),n[2]=T,n[3]=l.name,n[4]=E):E=n[4];let m;n[5]!==l.description?(m=l.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),n[5]=l.description,n[6]=m):m=n[6];let r;n[7]!==E||n[8]!==m?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[E,m]}),n[7]=E,n[8]=m,n[9]=r):r=n[9];const u=`tool-${i}-${l.name}`;let d;n[10]!==a||n[11]!==g||n[12]!==u?(d=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ve,{id:u,checked:a,onCheckedChange:g,onClick:Vt})}),n[10]=a,n[11]=g,n[12]=u,n[13]=d):d=n[13];let _;return n[14]!==p||n[15]!==r||n[16]!==d?(_=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:p,children:[r,d]}),n[14]=p,n[15]=r,n[16]=d,n[17]=_):_=n[17],_});function Ut({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:i}){const[l,a]=k.useState(""),g=i!==void 0?i:l,p=k.useDeferredValue(g),[c,T]=k.useState("all"),[E,m]=k.useState(!1),r=k.useRef(new Set(Object.keys(t))),{org:u}=Ne(),d=Ct({connectionId:At,orgId:u.id}),_=100,x=p.trim(),R=x?{operator:"or",conditions:[{field:["title"],operator:"contains",value:x},{field:["description"],operator:"contains",value:x}]}:void 0,L=!!n,S={...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,offset:0,...L&&{include_virtual:!0}},y=JSON.stringify(S),{data:C,fetchNextPage:b,hasNextPage:f,isFetchingNextPage:N}=Nt({queryKey:ae.collectionListInfinite(d,u.id,"","CONNECTIONS",y),queryFn:async({pageParam:I=0})=>(await d.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...R&&{where:R},orderBy:[{field:["updated_at"],direction:"asc"}],limit:_,offset:I,...L&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(I,w)=>{if(I?.hasMore)return w.reduce(($,ee)=>$+(ee?.items?.length??0),0)},staleTime:3e4}),A=C?.pages.flatMap(I=>I?.items??[])??[],o=Rt(b,f??!1,N),M=n?A.filter(I=>I.connection_type!=="VIRTUAL"?!0:lt(I.connection_url)!==n):A,j=r.current,h=[...j.values()].map(I=>M.find(w=>w.id===I)).filter(I=>I!==void 0),G=M.filter(I=>!j.has(I.id)),v=[...h,...G],z=I=>{const w=t[I];return w!==void 0&&w.length>0},V=v.filter(I=>{if(c==="all")return!0;const w=z(I.id);return c==="selected"?w:c==="unselected"?!w:!0}),[Y,D]=k.useState(v[0]?.id??null),O=Y?v.find(I=>I.id===Y)??null:null,B=O?.tools??[],H=(I,w)=>t[I]?.includes(w)??!1,F=(I,w)=>{const $=t[I]??[],ee=$.includes(w),Z={...t};if(ee){const q=$.filter(X=>X!==w);q.length===0?delete Z[I]:Z[I]=q}else Z[I]=[...$,w];e(Z)},J=I=>{const w=v.find(X=>X.id===I);if(!w?.tools)return;const $=t[I]??[],ee=w.tools.map(X=>X.name),Z=$.length>0&&ee.every(X=>$.includes(X)),q={...t};Z?delete q[I]:(q[I]=ee,D(I)),e(q)},W=I=>{D(I),m(!0)},ie=()=>{m(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",E&&"hidden md:flex"),children:[i===void 0&&s.jsx(St,{value:l,onChange:a,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>T("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>T("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>T("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:V.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:g?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[V.map(I=>{const w=I.tools?.length??0,$=t[I.id]?.length??0;return s.jsx(Dt,{connection:I,isSelected:Y===I.id,hasToolsEnabled:z(I.id),activeToolsCount:$,totalToolsCount:w,onSelect:()=>W(I.id),onToggle:()=>J(I.id)},I.id)}),s.jsx("div",{ref:o,className:"h-4"}),N&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Ie,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:K("flex-1 flex-col",E?"flex":"hidden md:flex"),children:O?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"sm",onClick:ie,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(xt,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(Le,{icon:O.icon,name:O.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:O.title}),O.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:O.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:B.map(I=>s.jsx(wt,{connectionId:O.id,tool:I,isSelected:H(O.id,I.name),onToggle:()=>F(O.id,I.name)},I.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function kt(t){return t.stopPropagation()}function Vt(t){return t.stopPropagation()}const Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],Bt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function tt(t){if(!t)return"bg-neutral-400";let e=0;for(let i=0;i<t.length;i++){const l=t.charCodeAt(i);e=(e<<5)-e+l,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}function we(t,e){return e?Bt[t]??"bg-neutral-400":tt(t)}const zt=je({role:je({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:Me(),staticPermissions:xe(se()),toolSet:Pe(se(),xe(se())),allowAllModels:Me(),modelSet:Pe(se(),xe(se())),memberIds:xe(se())});function st(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Yt(t){const e=Q.c(34),{allowAllStaticPermissions:n,staticPermissions:i,onAllowAllChange:l,onPermissionsChange:a,readOnly:g,searchQuery:p}=t,c=g===void 0?!1:g,T=k.useDeferredValue(p);let E,m,r,u;if(e[0]!==n||e[1]!==T||e[2]!==l||e[3]!==a||e[4]!==c||e[5]!==i){const x=Mt(),R=Gt(),L=R.filter(A=>A.label.toLowerCase().includes(T.toLowerCase())),S=A=>{if(i.includes(A))a(i.filter(o=>o!==A));else{const o=[...i,A];o.length===R.length?(l(!0),a([])):a(o)}};r="flex flex-col h-full";const y=!c&&"hover:bg-muted/50 cursor-pointer";let C;e[10]!==y?(C=K("flex items-center justify-between px-4 py-3",y),e[10]=y,e[11]=C):C=e[11];let b;e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==c?(b=()=>{c||(l(!n),a([]))},e[12]=n,e[13]=l,e[14]=a,e[15]=c,e[16]=b):b=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("span",{className:"text-sm font-medium",children:"All organization permissions"}),e[17]=f):f=e[17];let N;e[18]!==n||e[19]!==l||e[20]!==a||e[21]!==c?(N=s.jsx("div",{onClick:Zt,children:c?s.jsx(ge,{children:s.jsxs(Ee,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(re,{checked:n,disabled:!0,onCheckedChange:Qt})})}),s.jsx(fe,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(re,{checked:n,onCheckedChange:A=>{l(A),a([])}})}),e[18]=n,e[19]=l,e[20]=a,e[21]=c,e[22]=N):N=e[22],e[23]!==N||e[24]!==C||e[25]!==b?(u=s.jsx("div",{className:"border-b border-border",children:s.jsxs("div",{className:C,onClick:b,children:[f,N]})}),e[23]=N,e[24]=C,e[25]=b,e[26]=u):u=e[26],E="flex-1 overflow-auto",m=Object.entries(x).map(A=>{const[o,M]=A,j=L.filter(h=>M.some(G=>G.name===h.value));return j.length===0?null:s.jsxs("div",{className:"mb-6 last:mb-0",children:[s.jsx("h4",{className:"text-sm font-medium p-3 pb-1.5 text-muted-foreground/75",children:o}),s.jsx("div",{className:"space-y-1",children:j.map(h=>s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3",!c&&"hover:bg-muted/50 cursor-pointer"),onClick:()=>{c||(n?(l(!1),a(R.map(Ft).filter(G=>G!==h.value))):S(h.value))},children:[s.jsx("span",{className:"text-sm flex-1 min-w-0",children:h.label}),s.jsx("div",{onClick:Kt,children:c?s.jsx(ge,{children:s.jsxs(Ee,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(re,{checked:n||i.includes(h.value),disabled:!0,onCheckedChange:$t})})}),s.jsx(fe,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(re,{checked:n||i.includes(h.value),onCheckedChange:()=>{n?(l(!1),a(R.map(Ht).filter(G=>G!==h.value))):S(h.value)}})})]},h.value))})]},o)}),e[0]=n,e[1]=T,e[2]=l,e[3]=a,e[4]=c,e[5]=i,e[6]=E,e[7]=m,e[8]=r,e[9]=u}else E=e[6],m=e[7],r=e[8],u=e[9];let d;e[27]!==E||e[28]!==m?(d=s.jsx("div",{className:E,children:m}),e[27]=E,e[28]=m,e[29]=d):d=e[29];let _;return e[30]!==r||e[31]!==u||e[32]!==d?(_=s.jsxs("div",{className:r,children:[u,d]}),e[30]=r,e[31]=u,e[32]=d,e[33]=_):_=e[33],_}function Ht(t){return t.value}function $t(){}function Kt(t){return t.stopPropagation()}function Ft(t){return t.value}function Qt(){}function Zt(t){return t.stopPropagation()}const nt={anthropic:"Anthropic",openrouter:"OpenRouter"},qt={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Xt(t,e){const n=t.indexOf("/"),i=n>0?t.slice(0,n):e;return i.startsWith("~")?i.slice(1):i}function Jt(t){return qt[t]??nt[t]??t}function Wt(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const it=30;function es(t){const e=Q.c(44),{connectionId:n,subProviderId:i,subProviderName:l,groupLogo:a,models:g,allConnectionModelIds:p,selectedModels:c,allowAllModels:T,allConnectionModelsSelected:E,onToggleModel:m,onExitAllowAll:r,readOnly:u,defaultExpanded:d}=t,[_,x]=k.useState(d),R=d||_,L=x,[S,y]=k.useState(it);let C;e[0]!==E||e[1]!==T||e[2]!==c?(C=o=>T||E||c.includes("*")||c.includes(o),e[0]=E,e[1]=T,e[2]=c,e[3]=C):C=e[3];const b=C;let f;if(e[4]!==b||e[5]!==g){let o;e[7]!==b?(o=M=>b(M.id),e[7]=b,e[8]=o):o=e[8],f=g.filter(o),e[4]=b,e[5]=g,e[6]=f}else f=e[6];const N=f.length;let A;if(e[9]!==p||e[10]!==T||e[11]!==n||e[12]!==N||e[13]!==R||e[14]!==a||e[15]!==b||e[16]!==g||e[17]!==r||e[18]!==m||e[19]!==u||e[20]!==i||e[21]!==l||e[22]!==S){const o=g.slice(0,S),M=g.length>S;let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=()=>L(is),e[24]=j):j=e[24];const h=a??qe[i]??Xe;let G;e[25]!==l||e[26]!==h?(G=s.jsx(Le,{icon:h,name:l,size:"sm"}),e[25]=l,e[26]=h,e[27]=G):G=e[27];let v;e[28]!==l?(v=s.jsx("span",{className:"text-sm font-medium truncate",children:l}),e[28]=l,e[29]=v):v=e[29];let z;e[30]!==G||e[31]!==v?(z=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,v]}),e[30]=G,e[31]=v,e[32]=z):z=e[32];let V;e[33]!==N||e[34]!==g.length?(V=s.jsxs(_e,{variant:"secondary",className:"text-xs text-muted-foreground",children:[N,"/",g.length," enabled"]}),e[33]=N,e[34]=g.length,e[35]=V):V=e[35];let Y;e[36]!==R?(Y=R?s.jsx(Lt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(vt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=R,e[37]=Y):Y=e[37];let D;e[38]!==Y||e[39]!==V?(D=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[V,Y]}),e[38]=Y,e[39]=V,e[40]=D):D=e[40];let O;e[41]!==D||e[42]!==z?(O=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:j,children:[z,D]}),e[41]=D,e[42]=z,e[43]=O):O=e[43],A=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[O,R&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[o.map(B=>{const H=b(B.id),F=()=>{if(!u){if(T){r(n,p,B.id);return}m(n,B.id)}};return s.jsxs("div",{className:K("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!u&&"hover:bg-muted/50 cursor-pointer"),onClick:F,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:ns,children:u?s.jsx(ge,{children:s.jsxs(Ee,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(re,{checked:H,disabled:!0,onCheckedChange:ss})})}),s.jsx(fe,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(re,{checked:H,onCheckedChange:F})})]},B.id)}),M&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>y(ts),children:["Show more (",g.length-S," remaining)"]})]})]}),e[9]=p,e[10]=T,e[11]=n,e[12]=N,e[13]=R,e[14]=a,e[15]=b,e[16]=g,e[17]=r,e[18]=m,e[19]=u,e[20]=i,e[21]=l,e[22]=S,e[23]=A}else A=e[23];return A}function ts(t){return t+it}function ss(){}function ns(t){return t.stopPropagation()}function is(t){return!t}function rs(t){const e=Q.c(33),{connection:n,selectedModels:i,allowAllModels:l,onToggleModel:a,onExitAllowAll:g,allConnectionModelsSelected:p,searchQuery:c,readOnly:T}=t,E=yt(n.id);let m,r,u,d,_;if(e[0]!==p||e[1]!==l||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==g||e[6]!==a||e[7]!==E||e[8]!==T||e[9]!==c||e[10]!==i){_=Symbol.for("react.early_return_sentinel");e:{let L;e[16]!==n.label?(L=h=>({...h,id:h.modelId,provider:n.label}),e[16]=n.label,e[17]=L):L=e[17];const S=E.filter(cs).map(L),y=c.trim().toLowerCase(),C=y?S.filter(h=>h.title.toLowerCase().includes(y)||h.id.toLowerCase().includes(y)||h.provider?.toLowerCase().includes(y)):S;if(C.length===0){_=null;break e}const b=new Map;for(const h of C){const G=Xt(h.id,n.providerId),v=b.get(G)??{models:[],logo:null};v.models.push({id:h.id,title:Wt(h.title),logo:h.logo}),!v.logo&&h.logo&&(v.logo=h.logo),b.set(G,v)}const f=Array.from(b.entries()).map(as).sort(ls),N=f.length===1||y.length>0;u="flex flex-col gap-3";const A=qe[n.providerId]??Xe;let o;e[18]!==n.providerId||e[19]!==A?(o=s.jsx("img",{src:A,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=A,e[20]=o):o=e[20];const M=nt[n.providerId]??n.providerId;let j;e[21]!==M?(j=s.jsx("h4",{className:"text-sm font-medium",children:M}),e[21]=M,e[22]=j):j=e[22],e[23]!==j||e[24]!==o?(d=s.jsxs("div",{className:"flex items-center gap-2",children:[o,j]}),e[23]=j,e[24]=o,e[25]=d):d=e[25],m="flex flex-col gap-3",r=f.map(h=>s.jsx(es,{connectionId:n.id,subProviderId:h.id,subProviderName:h.name,groupLogo:h.logo,models:h.models,allConnectionModelIds:S.map(os),selectedModels:i,allowAllModels:l,allConnectionModelsSelected:p,onToggleModel:a,onExitAllowAll:g,readOnly:T,defaultExpanded:N},h.id))}e[0]=p,e[1]=l,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=g,e[6]=a,e[7]=E,e[8]=T,e[9]=c,e[10]=i,e[11]=m,e[12]=r,e[13]=u,e[14]=d,e[15]=_}else m=e[11],r=e[12],u=e[13],d=e[14],_=e[15];if(_!==Symbol.for("react.early_return_sentinel"))return _;let x;e[26]!==m||e[27]!==r?(x=s.jsx("div",{className:m,children:r}),e[26]=m,e[27]=r,e[28]=x):x=e[28];let R;return e[29]!==u||e[30]!==d||e[31]!==x?(R=s.jsxs("div",{className:u,children:[d,x]}),e[29]=u,e[30]=d,e[31]=x,e[32]=R):R=e[32],R}function os(t){return t.id}function ls(t,e){return t.name.localeCompare(e.name)}function as(t){const[e,n]=t;return{id:e,name:Jt(e),logo:n.logo,models:n.models}}function cs(t,e,n){return n.findIndex(i=>i.modelId===t.modelId)===e}function ds(t){const e=Q.c(35),{allowAllModels:n,modelSet:i,onAllowAllChange:l,onModelSetChange:a,readOnly:g,searchQuery:p}=t,c=g===void 0?!1:g,T=k.useDeferredValue(p),E=Ot();let m;e[0]!==i||e[1]!==a?(m=(f,N)=>{const A=i[f]??[],o={...i};if(A.includes(N)){const M=A.filter(j=>j!==N);M.length===0?delete o[f]:o[f]=M}else o[f]=[...A,N];a(o)},e[0]=i,e[1]=a,e[2]=m):m=e[2];const r=m;let u;e[3]!==i||e[4]!==l||e[5]!==a?(u=(f,N,A)=>{l(!1),a({...i,[f]:N.filter(o=>o!==A)})},e[3]=i,e[4]=l,e[5]=a,e[6]=u):u=e[6];const d=u,_=!c&&"hover:bg-muted/50 cursor-pointer";let x;e[7]!==_?(x=K("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",_),e[7]=_,e[8]=x):x=e[8];let R;e[9]!==n||e[10]!==l||e[11]!==a||e[12]!==c?(R=()=>{if(c)return;const f=!n;l(f),f&&a({})},e[9]=n,e[10]=l,e[11]=a,e[12]=c,e[13]=R):R=e[13];let L;e[14]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=L):L=e[14];let S;e[15]!==n||e[16]!==l||e[17]!==a||e[18]!==c?(S=s.jsx("div",{onClick:us,children:c?s.jsx(ge,{children:s.jsxs(Ee,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(re,{checked:n,disabled:!0,onCheckedChange:ms})})}),s.jsx(fe,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(re,{checked:n,onCheckedChange:f=>{l(f),f&&a({})}})}),e[15]=n,e[16]=l,e[17]=a,e[18]=c,e[19]=S):S=e[19];let y;e[20]!==x||e[21]!==R||e[22]!==S?(y=s.jsxs("div",{className:x,onClick:R,children:[L,S]}),e[20]=x,e[21]=R,e[22]=S,e[23]=y):y=e[23];let C;e[24]!==E||e[25]!==n||e[26]!==T||e[27]!==d||e[28]!==i||e[29]!==c||e[30]!==r?(C=E.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):E.map(f=>s.jsx(k.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ie,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(rs,{connection:f,selectedModels:i[f.id]??[],allowAllModels:n,onToggleModel:r,onExitAllowAll:d,allConnectionModelsSelected:(i[f.id]??[]).includes("*"),searchQuery:T,readOnly:c})},f.id)),e[24]=E,e[25]=n,e[26]=T,e[27]=d,e[28]=i,e[29]=c,e[30]=r,e[31]=C):C=e[31];let b;return e[32]!==C||e[33]!==y?(b=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[y,C]}),e[32]=C,e[33]=y,e[34]=b):b=e[34],b}function ms(){}function us(t){return t.stopPropagation()}function gs(t){const e=Q.c(52),{open:n,onOpenChange:i,selectedMemberIds:l,onAddMembers:a}=t,[g,p]=k.useState(""),c=k.useDeferredValue(g);let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[0]=T):T=e[0];const[E,m]=k.useState(T),{data:r}=Je();let u,d,_,x,R,L,S,y,C,b,f;if(e[1]!==r?.data?.members||e[2]!==c||e[3]!==a||e[4]!==i||e[5]!==n||e[6]!==E||e[7]!==g||e[8]!==l){const z=r?.data?.members??[];let V;e[20]!==c?(V=O=>{const B=c.toLowerCase();return O.user?.name?.toLowerCase().includes(B)||O.user?.email?.toLowerCase().includes(B)},e[20]=c,e[21]=V):V=e[21];const Y=z.filter(V);let D;e[22]!==a||e[23]!==i||e[24]!==E?(D=()=>{a(E),m([]),i(!1)},e[22]=a,e[23]=i,e[24]=E,e[25]=D):D=e[25],_=D,d=Be,b=n,f=i,u=ze,y="sm:max-w-md p-0 overflow-hidden",e[26]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsxs(Ye,{className:"px-6 pt-6",children:[s.jsx(He,{children:"Add Members to Role"}),s.jsx($e,{children:"Select members to add to this role."})]}),e[26]=C):C=e[26],L="flex flex-col h-80",e[27]!==g?(S=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(ye,{value:g,onChange:p,placeholder:"Search members...",className:"w-full"})}),e[27]=g,e[28]=S):S=e[28],x="flex-1 overflow-auto",R=Y.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:g?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:Y.map(O=>{const B=O.role!=="owner",H=l.includes(O.id),F=E.includes(O.id);return s.jsxs("label",{className:K("flex items-center gap-3 p-2 rounded-lg",!B||H?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ve,{checked:F||H,onCheckedChange:()=>{!B||H||m(J=>J.includes(O.id)?J.filter(W=>W!==O.id):[...J,O.id])},disabled:!B||H}),s.jsx(We,{url:O.user?.image??void 0,fallback:st(O.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:O.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:O.user?.email})]}),!B&&s.jsx(_e,{variant:"secondary",className:"shrink-0",children:"Owner"}),H&&B&&s.jsx(_e,{variant:"outline",className:"shrink-0",children:"Added"})]},O.id)})}),e[1]=r?.data?.members,e[2]=c,e[3]=a,e[4]=i,e[5]=n,e[6]=E,e[7]=g,e[8]=l,e[9]=u,e[10]=d,e[11]=_,e[12]=x,e[13]=R,e[14]=L,e[15]=S,e[16]=y,e[17]=C,e[18]=b,e[19]=f}else u=e[9],d=e[10],_=e[11],x=e[12],R=e[13],L=e[14],S=e[15],y=e[16],C=e[17],b=e[18],f=e[19];let N;e[29]!==x||e[30]!==R?(N=s.jsx("div",{className:x,children:R}),e[29]=x,e[30]=R,e[31]=N):N=e[31];let A;e[32]!==N||e[33]!==L||e[34]!==S?(A=s.jsxs("div",{className:L,children:[S,N]}),e[32]=N,e[33]=L,e[34]=S,e[35]=A):A=e[35];let o;e[36]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ke,{children:"Cancel"}),e[36]=o):o=e[36];const M=E.length===0,j=E.length>0&&`(${E.length})`;let h;e[37]!==_||e[38]!==M||e[39]!==j?(h=s.jsxs(Fe,{className:"px-6 pb-6",children:[o,s.jsxs(Qe,{onClick:_,disabled:M,children:["Add ",j]})]}),e[37]=_,e[38]=M,e[39]=j,e[40]=h):h=e[40];let G;e[41]!==u||e[42]!==A||e[43]!==h||e[44]!==y||e[45]!==C?(G=s.jsxs(u,{className:y,children:[C,A,h]}),e[41]=u,e[42]=A,e[43]=h,e[44]=y,e[45]=C,e[46]=G):G=e[46];let v;return e[47]!==d||e[48]!==G||e[49]!==b||e[50]!==f?(v=s.jsx(d,{open:b,onOpenChange:f,children:G}),e[47]=d,e[48]=G,e[49]=b,e[50]=f,e[51]=v):v=e[51],v}function Es(t){const e=Q.c(28),{memberIds:n,onMemberIdsChange:i,readOnly:l,searchQuery:a,addMemberDialogOpen:g,onAddMemberDialogOpenChange:p}=t,c=l===void 0?!1:l,T=k.useDeferredValue(a),{data:E}=Je();let m,r,u;if(e[0]!==E?.data?.members||e[1]!==T||e[2]!==n||e[3]!==i||e[4]!==c||e[5]!==a){const L=E?.data?.members??[];let S;e[9]!==n?(S=f=>n.includes(f.id),e[9]=n,e[10]=S):S=e[10];const y=L.filter(S);let C;e[11]!==T?(C=f=>{const N=T.toLowerCase();return f.user?.name?.toLowerCase().includes(N)||f.user?.email?.toLowerCase().includes(N)},e[11]=T,e[12]=C):C=e[12];const b=y.filter(C);u="flex flex-col h-full",m="flex-1 overflow-auto",r=y.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):b.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',a,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:b.map(f=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(We,{url:f.user?.image??void 0,fallback:st(f.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:f.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.user?.email})]}),c?s.jsx(ge,{children:s.jsxs(Ee,{children:[s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(De,{size:16})})})}),s.jsx(fe,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>i(n.filter(N=>N!==f.id)),children:s.jsx(De,{size:16})})]},f.id))}),e[0]=E?.data?.members,e[1]=T,e[2]=n,e[3]=i,e[4]=c,e[5]=a,e[6]=m,e[7]=r,e[8]=u}else m=e[6],r=e[7],u=e[8];let d;e[13]!==m||e[14]!==r?(d=s.jsx("div",{className:m,children:r}),e[13]=m,e[14]=r,e[15]=d):d=e[15];let _;e[16]!==n||e[17]!==i?(_=L=>i([...n,...L]),e[16]=n,e[17]=i,e[18]=_):_=e[18];let x;e[19]!==g||e[20]!==n||e[21]!==p||e[22]!==_?(x=s.jsx(gs,{open:g,onOpenChange:p,selectedMemberIds:n,onAddMembers:_}),e[19]=g,e[20]=n,e[21]=p,e[22]=_,e[23]=x):x=e[23];let R;return e[24]!==u||e[25]!==d||e[26]!==x?(R=s.jsxs("div",{className:u,children:[d,x]}),e[24]=u,e[25]=d,e[26]=x,e[27]=R):R=e[27],R}function Ts(t){const e=Q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let i;return e[1]!==t?(i=s.jsx(k.Suspense,{fallback:n,children:s.jsx(Es,{...t})}),e[1]=t,e[2]=i):i=e[2],i}const fs={owner:[],admin:[],user:[]};function ps(t,e){const n=t==="owner"||t==="admin";return{role:{slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:fs[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(i=>i.role===t).map(i=>i.id)}}function _s(t,e,n){const i=t.permission||{},l=i.self||[],a=l.includes("*"),g=a?[]:l.filter(m=>m!=="*"),p={};for(const[m,r]of Object.entries(i))if(!(m==="self"||m==="models"))if(m==="*")for(const u of n)p[u.id]=r.includes("*")?u.tools?.map(d=>d.name)??[]:r;else{const u=n.find(d=>d.id===m);u&&(p[m]=r.includes("*")?u.tools?.map(d=>d.name)??[]:r)}const c=i.models||[],T=c.length===0||c.includes("*:*"),E={};if(!T)for(const m of c){const r=m.indexOf(":");if(r===-1)continue;const u=m.slice(0,r),d=m.slice(r+1);E[u]||(E[u]=[]),E[u].push(d)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:a,staticPermissions:g,toolSet:p,allowAllModels:T,modelSet:E,memberIds:e.filter(m=>m.role===t.role).map(m=>m.id)}}function Is(t,e){const n={};t.allowAllStaticPermissions?n.self=["*"]:t.staticPermissions.length>0&&(n.self=t.staticPermissions);for(const[i,l]of Object.entries(t.toolSet))if(l.length>0){const g=e.find(p=>p.id===i)?.tools?.map(p=>p.name)??[];n[i]=g.length>0&&g.every(p=>l.includes(p))?["*"]:l}if(t.allowAllModels)n.models=["*:*"];else{const i=[];for(const[l,a]of Object.entries(t.modelSet))for(const g of a)i.push(`${l}:${g}`);i.length>0&&(n.models=i)}return n}function hs(t,e,n){return t.kind==="builtin"?ps(t.role,e):t.kind==="custom"?_s(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Rs(t){const e=Q.c(5),{readOnly:n,onOpen:i}=t;if(n){let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Te,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Se,{size:16}),"Add Member"]})})}),e[0]=g):g=e[0];let p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ge,{children:s.jsxs(Ee,{children:[g,s.jsx(fe,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})}),e[1]=p):p=e[1],p}let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Se,{size:16}),e[2]=l):l=e[2];let a;return e[3]!==i?(a=s.jsxs(ne,{variant:"outline",size:"sm",onClick:i,children:[l,"Add Member"]}),e[3]=i,e[4]=a):a=e[4],a}function xs(t){const e=Q.c(14),{locator:n}=Ne(),i=Oe(),l=bt();let a;e[0]!==n?(a=ae.members(n),e[0]=n,e[1]=a):a=e[1];let g;e[2]!==i?(g=()=>i.organization.listMembers(),e[2]=i,e[3]=g):g=e[3];let p;e[4]!==a||e[5]!==g?(p={queryKey:a,queryFn:g},e[4]=a,e[5]=g,e[6]=p):p=e[6];const{data:c,isPending:T}=Ue(p);if(T||!l){let u;return e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ie,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=u):u=e[7],u}let E;e[8]!==c?.data?.members?(E=c?.data?.members??[],e[8]=c?.data?.members,e[9]=E):E=e[9];const m=E;let r;return e[10]!==l||e[11]!==m||e[12]!==t?(r=s.jsx(Ns,{...t,members:m,connections:l}),e[10]=l,e[11]=m,e[12]=t,e[13]=r):r=e[13],r}function Ns({target:t,onBack:e,onSaved:n,members:i,connections:l}){const{locator:a}=Ne(),g=Oe(),p=ke(),c=t.kind==="builtin",T=t.kind==="new",[E,m]=k.useState(c?"org":"mcp"),r=at({resolver:ct(zt),defaultValues:hs(t,i,l)}),u=r.formState.isValid,d=r.formState.isDirty,_=Ve({mutationFn:async o=>{const M=Is(o,l),j=o.role.slug||o.role.label.toLowerCase().replace(/\s+/g,"-"),h=o.role.slug&&!o.role.id,G=async v=>{const z=i.filter(D=>D.role===v).map(D=>D.id),V=o.memberIds.filter(D=>!z.includes(D)),Y=z.filter(D=>!o.memberIds.includes(D));for(const D of V){const O=await g.organization.updateMemberRole({memberId:D,role:[v]});if(O?.error)throw new Error(O.error.message??"Something went wrong")}for(const D of Y){const O=await g.organization.updateMemberRole({memberId:D,role:["user"]});if(O?.error)throw new Error(O.error.message??"Something went wrong")}};if(h)return await G(o.role.slug),o;if(o.role.id){const v=await g.organization.updateRole({roleId:o.role.id,data:{permission:M}});if(v?.error)throw new Error(v.error.message??"Something went wrong");return await G(o.role.slug),o}else{const v=await g.organization.createRole({role:j,permission:M});if(v?.error)throw new Error(v.error.message??"Something went wrong");for(const z of o.memberIds){const V=await g.organization.updateMemberRole({memberId:z,role:[j]});if(V?.error)throw new Error(V.error.message)}return{...o,role:{...o.role,id:v.data?.roleData?.id,slug:j}}}},onSuccess:(o,M)=>{p.invalidateQueries({queryKey:ae.members(a)}),p.invalidateQueries({queryKey:ae.organizationRoles(a)});const j=!M.role.id&&!M.role.slug,h=M.role.slug&&!M.role.id;be(h?"role_members_updated":j?"role_created":"role_updated",{role_slug:M.role.slug??null}),pe.success(h?"Members updated successfully!":j?"Role created successfully!":"Role updated successfully!"),r.reset(o),n(o.role.id)},onError:o=>{pe.error(o instanceof Error?o.message:"Failed to save role")}}),x=r.handleSubmit(o=>{if(!o.role.label.trim()){pe.error("Role name is required"),r.setFocus("role.label");return}_.mutate(o)}),R=!c||t.kind==="builtin"&&t.role!=="owner",L=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",S=[...c?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[y,C]=k.useState(""),[b,f]=k.useState(!1),N=o=>{m(o),C("")},A={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:"flex flex-col overflow-hidden",children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:R&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:_.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:x,disabled:_.isPending||!u||!d,children:_.isPending?"Saving...":T?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",t.kind==="builtin"?we(t.role,!0):t.kind==="custom"?we(t.role.role,!1):tt(r.watch("role.label")))}),c?s.jsx(Ze,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(jt,{size:16,className:"text-muted-foreground shrink-0"}),T?s.jsx("input",{...r.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:!0}):s.jsx("span",{className:"truncate",children:L})]})}),s.jsx("div",{className:"flex items-center gap-2",children:S.map(o=>s.jsx("button",{type:"button",onClick:()=>N(o.id),className:K("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",E===o.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:o.label},o.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(ye,{value:y,onChange:C,placeholder:A[E]??"Search...",className:"w-full md:w-[375px]"}),E==="members"&&s.jsx(Rs,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>f(!0)})]})]})}),s.jsx("div",{className:"flex-1 min-h-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",children:s.jsxs("div",{className:K("h-full overflow-hidden",E!=="models"&&"border border-border rounded-xl bg-card"),children:[E==="mcp"&&!c&&s.jsx(Ut,{toolSet:r.watch("toolSet"),onToolSetChange:o=>r.setValue("toolSet",o,{shouldDirty:!0}),searchQuery:y}),E==="org"&&s.jsx(Yt,{allowAllStaticPermissions:r.watch("allowAllStaticPermissions"),staticPermissions:r.watch("staticPermissions"),onAllowAllChange:o=>r.setValue("allowAllStaticPermissions",o,{shouldDirty:!0}),onPermissionsChange:o=>r.setValue("staticPermissions",o,{shouldDirty:!0}),readOnly:c,searchQuery:y}),E==="models"&&s.jsx(ds,{allowAllModels:r.watch("allowAllModels"),modelSet:r.watch("modelSet"),onAllowAllChange:o=>r.setValue("allowAllModels",o,{shouldDirty:!0}),onModelSetChange:o=>r.setValue("modelSet",o,{shouldDirty:!0}),readOnly:c,searchQuery:y}),E==="members"&&s.jsx(Ts,{memberIds:r.watch("memberIds"),onMemberIdsChange:o=>r.setValue("memberIds",o,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&t.role==="owner",searchQuery:y,addMemberDialogOpen:b,onAddMemberDialogOpenChange:f})]})})]})})}function Cs(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}const As=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ae=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function Ss(t){if(!t)return"bg-neutral-400";let e=0;for(let i=0;i<t.length;i++){const l=t.charCodeAt(i);e=(e<<5)-e+l,e=e&e}const n=Math.abs(e)%Ae.length;return Ae[n]??Ae[0]}const bs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Os(t,e){return e?bs[t]??"bg-neutral-400":Ss(t)}function ys(){const t=Q.c(77),[e,n]=k.useState(""),[i,l]=k.useState(null),a=mt();let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g={strict:!1},t[0]=g):g=t[0];const{role:p}=ut(g),{locator:c}=Ne(),T=Oe(),E=ke(),{customRoles:m,refetch:r}=gt();let u;t[1]!==a?(u=P=>a({to:".",search:U=>({...U,role:P})}),t[1]=a,t[2]=u):u=t[2];const d=u;let _;e:{if(!p){_=null;break e}if(p==="new"){_={kind:"new"};break e}if(p.startsWith("builtin-")){_={kind:"builtin",role:p.slice(8)};break e}let P;t[3]!==p?(P=oe=>oe.id===p,t[3]=p,t[4]=P):P=t[4];const U=m.find(P);_=U?{kind:"custom",role:U}:null}const x=_;let R;t[5]!==c?(R=ae.members(c),t[5]=c,t[6]=R):R=t[6];let L;t[7]!==T?(L=()=>T.organization.listMembers(),t[7]=T,t[8]=L):L=t[8];let S;t[9]!==R||t[10]!==L?(S={queryKey:R,queryFn:L},t[9]=R,t[10]=L,t[11]=S):S=t[11];const{data:y}=Ue(S);let C;t[12]!==y?.data?.members?(C=y?.data?.members??[],t[12]=y?.data?.members,t[13]=C):C=t[13];const b=C;let f;t[14]!==b?(f=P=>b.filter(U=>U.role===P).length,t[14]=b,t[15]=f):f=t[15];const N=f;let A;if(t[16]!==m||t[17]!==N||t[18]!==e){let P;t[20]!==N?(P=le=>({kind:"builtin",role:{...le,memberCount:N(le.role)}}),t[20]=N,t[21]=P):P=t[21];const U=As.map(P);let oe;t[22]!==N?(oe=le=>({kind:"custom",role:{...le,memberCount:N(le.role)}}),t[22]=N,t[23]=oe):oe=t[23];const rt=m.map(oe);if(A=[...U,...rt],e){const le=e.toLowerCase();A=A.filter(ot=>ot.role.label.toLowerCase().includes(le))}t[16]=m,t[17]=N,t[18]=e,t[19]=A}else A=t[19];let o;t[24]!==T?(o=async P=>{const U=await T.organization.deleteRole({roleId:P});if(U?.error)throw new Error(U.error.message);return U?.data},t[24]=T,t[25]=o):o=t[25];const M=Ve({mutationFn:o,onSuccess:(P,U)=>{be("role_deleted",{role_id:U}),E.invalidateQueries({queryKey:ae.members(c)}),E.invalidateQueries({queryKey:ae.organizationRoles(c)}),pe.success("Role deleted successfully!"),r(),x?.kind==="custom"&&x.role.id===U&&d(void 0)},onError:Ds});let j,h,G,v;t[26]===Symbol.for("react.memo_cache_sentinel")?(v={id:"role",header:"Role",render:Gs,cellClassName:"flex-1 min-w-0",sortable:!0},j={id:"type",header:"Type",render:Ms,cellClassName:"w-28 shrink-0"},h={id:"permissions",header:"Permissions",render:Ps,cellClassName:"flex-1 min-w-0"},G={id:"members",header:"Members",render:js,cellClassName:"w-24 shrink-0"},t[26]=j,t[27]=h,t[28]=G,t[29]=v):(j=t[26],h=t[27],G=t[28],v=t[29]);let z;t[30]===Symbol.for("react.memo_cache_sentinel")?(z=[v,j,h,G,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(Et,{children:[s.jsx(Tt,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:vs,children:s.jsx(_t,{size:16})})}),s.jsx(ft,{align:"end",onClick:Ls,children:s.jsxs(pt,{variant:"destructive",onClick:()=>{const U=P.role;U.id&&l({id:U.id,label:U.label})},children:[s.jsx(It,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=z):z=t[30];const V=z;let Y;t[31]!==d?(Y=P=>{if(P.kind==="builtin")d(`builtin-${P.role.role}`);else{const U=P.role;d(U.id)}},t[31]=d,t[32]=Y):Y=t[32];const D=Y;if(x){let P;t[33]!==d?(P=()=>d(void 0),t[33]=d,t[34]=P):P=t[34];let U;return t[35]!==r||t[36]!==d?(U=()=>{r(),d(void 0)},t[35]=r,t[36]=d,t[37]=U):U=t[37],s.jsx(xs,{target:x,onBack:P,onSaved:U},Cs(x))}let O;t[38]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(te.Title,{children:"Roles"}),t[38]=O):O=t[38];let B;t[39]===Symbol.for("react.memo_cache_sentinel")?(B=P=>{P.key==="Escape"&&(n(""),P.target.blur())},t[39]=B):B=t[39];let H;t[40]!==e?(H=s.jsx(ye,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:B}),t[40]=e,t[41]=H):H=t[41];let F;t[42]!==d?(F=()=>d("new"),t[42]=d,t[43]=F):F=t[43];let J;t[44]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Se,{size:16}),t[44]=J):J=t[44];let W;t[45]!==F?(W=s.jsxs(ne,{onClick:F,children:[J,"Create Role"]}),t[45]=F,t[46]=W):W=t[46];let ie;t[47]!==H||t[48]!==W?(ie=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[H,W]}),t[47]=H,t[48]=W,t[49]=ie):ie=t[49];let I;t[50]!==e?(I=e?s.jsx(Ge,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(Ge,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=I):I=t[51];let w;t[52]!==A||t[53]!==V||t[54]!==D||t[55]!==I?(w=s.jsx(ht,{columns:V,data:A,isLoading:!1,onRowClick:D,emptyState:I}),t[52]=A,t[53]=V,t[54]=D,t[55]=I,t[56]=w):w=t[56];let $;t[57]!==ie||t[58]!==w?($=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[O,ie,w]})})}),t[57]=ie,t[58]=w,t[59]=$):$=t[59];const ee=i!==null;let Z;t[60]===Symbol.for("react.memo_cache_sentinel")?(Z=P=>!P&&l(null),t[60]=Z):Z=t[60];let q;t[61]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(He,{children:"Delete Role"}),t[61]=q):q=t[61];const X=i?.label;let ce;t[62]!==X?(ce=s.jsxs(Ye,{children:[q,s.jsxs($e,{children:['Are you sure you want to delete the "',X,'" role? This action cannot be undone.']})]}),t[62]=X,t[63]=ce):ce=t[63];let he;t[64]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(Ke,{children:"Cancel"}),t[64]=he):he=t[64];let de;t[65]!==M||t[66]!==i?(de=s.jsxs(Fe,{children:[he,s.jsx(Qe,{onClick:()=>{i?.id&&M.mutate(i.id),l(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=M,t[66]=i,t[67]=de):de=t[67];let me;t[68]!==ce||t[69]!==de?(me=s.jsxs(ze,{children:[ce,de]}),t[68]=ce,t[69]=de,t[70]=me):me=t[70];let ue;t[71]!==ee||t[72]!==me?(ue=s.jsx(Be,{open:ee,onOpenChange:Z,children:me}),t[71]=ee,t[72]=me,t[73]=ue):ue=t[73];let Re;return t[74]!==$||t[75]!==ue?(Re=s.jsxs(te,{children:[$,ue]}),t[74]=$,t[75]=ue,t[76]=Re):Re=t[76],Re}function Ls(t){return t.stopPropagation()}function vs(t){return t.stopPropagation()}function js(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function Ps(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Ms(t){return t.kind==="builtin"?s.jsx(_e,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(_e,{variant:"outline",className:"text-xs",children:"Custom"})}function Gs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:K("size-2.5 rounded-full shrink-0",Os(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(Ze,{size:12,className:"text-muted-foreground shrink-0"})]})}function Ds(t,e){be("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),pe.error(t instanceof Error?t.message:"Failed to delete role")}function Vn(){const t=Q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(dt,{fallback:e,children:s.jsx(k.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ie,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(ys,{})})}),t[1]=n):n=t[1],n}export{Vn as default};
@@ -1 +1 @@
1
- import{r as i,b6 as T,aS as ce,j as b,a7 as _,ae,aW as O,a8 as C,a4 as P,cE as ie,e as F,c as $}from"./index-Bn0n2Tn5.js";import{e as de}from"./select-rt68l1g_.js";function ue(r,e){return i.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[c,a]=i.useState(null),[u,d]=i.useState(null),[h,f]=i.useState(null),[S,w]=i.useState(null),[A,Y]=i.useState(null),[x,L]=i.useState(0),[M,j]=i.useState(0),[D,y]=i.useState(!1),[N,W]=i.useState(!1),v=T(e,E=>a(E)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:c,viewport:u,onViewportChange:d,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),c=i.useRef(null),a=T(e,c,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:a,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,c=r.orientation==="horizontal";return i.useEffect(()=>(c?n(!0):s(!0),()=>{c?n(!1):s(!1)}),[c,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=i.useState(!1);return i.useEffect(()=>{const c=t.scrollArea;let a=0;if(c){const u=()=>{window.clearTimeout(a),s(!0)},d=()=>{a=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(a),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",d)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>a("SCROLL_END"),100),[c,a]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,t.scrollHideDelay,a]),i.useEffect(()=>{const u=t.viewport,d=n?"scrollLeft":"scrollTop";if(u){let h=u[d];const f=()=>{const S=u[d];h!==S&&(a("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,a,s]),b.jsx(O,{present:o||c!=="hidden",children:b.jsx(V,{"data-state":c==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Z=i.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=i.useState(!1),c=r.orientation==="horizontal",a=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,d=o.viewport.offsetHeight<o.viewport.scrollHeight;s(c?u:d)}},10);return R(o.viewport,a),R(o.content,a),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=i.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=i.useRef(null),s=i.useRef(0),[c,a]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(c.viewport,c.content),d={...l,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,c,S)}return o==="horizontal"?b.jsx(Se,{...d,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,c,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...d,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,c);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=i.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,c]=i.useState(),a=i.useRef(null),u=T(e,a,n.onScrollbarXChange);return i.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:d=>r.onThumbPointerDown(d.x),onDragScroll:d=>r.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+d.deltaX;r.onWheelScroll(f),se(f,h)&&d.preventDefault()}},onResize:()=>{a.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=i.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,c]=i.useState(),a=i.useRef(null),u=T(e,a,n.onScrollbarYChange);return i.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:d=>r.onThumbPointerDown(d.y),onDragScroll:d=>r.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(n.viewport){const f=n.viewport.scrollTop+d.deltaY;r.onWheelScroll(f),se(f,h)&&d.preventDefault()}},onResize:()=>{a.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:d,onResize:h,...f}=r,S=m(g,o),[w,A]=i.useState(null),Y=T(e,v=>A(v)),x=i.useRef(null),L=i.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(d),y=P(a),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,E=v.clientY-x.current.top;u({x:p,y:E})}}return i.useEffect(()=>{const v=p=>{const E=p.target;w?.contains(E)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),i.useEffect(y,[l,y]),R(w,N),R(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(c),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:c}=s,a=T(e,h=>s.onThumbChange(h)),u=i.useRef(void 0),d=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return i.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(d(),!u.current){const S=xe(h,c);u.current=S,c()}};return c(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,d,c]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=i.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=i.useState(0),[c,a]=i.useState(0),u=!!(n&&c);return R(t.scrollbarX,()=>{const d=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(d),a(d)}),R(t.scrollbarY,()=>{const d=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(d),s(d)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:c,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,c=t-s,a=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-c,d=o.content-o.viewport,h=l==="ltr"?[0,d]:[d*-1,0];return le([a,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,c=n-l,a=o==="ltr"?[0,s]:[s*-1,0],u=de(r,a);return le([0,s],[0,c])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,c=o.top!==n.top;(s||c)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(l.current),[]),i.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function R(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Ee=te;function _e(r){const e=F.c(17);let o,l,t,n;e[0]!==r?({className:l,children:o,hideScrollbar:n,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=n===void 0?!1:n;let c;e[5]!==l?(c=$("relative h-full w-full",l),e[5]=l,e[6]=c):c=e[6];let a;e[7]!==o?(a=b.jsx(Ce,{"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:b.jsx("div",{className:"flex min-w-0 flex-col",children:o})}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==s?(u=b.jsx(Re,{hideScrollbar:s}),e[9]=s,e[10]=u):u=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=b.jsx(Ee,{}),e[11]=d):d=e[11];let h;return e[12]!==t||e[13]!==c||e[14]!==a||e[15]!==u?(h=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[a,u,d]}),e[12]=t,e[13]=c,e[14]=a,e[15]=u,e[16]=h):h=e[16],h}function Re(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,c=n===void 0?!1:n,a=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",d=c&&"hidden";let h;e[5]!==o||e[6]!==a||e[7]!==u||e[8]!==d?(h=$("select-none touch-none p-px transition-colors",a,u,d,o),e[5]=o,e[6]=a,e[7]=u,e[8]=d,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S,Re as a};
1
+ import{r as i,b6 as T,aS as ce,j as b,a7 as _,ae,aW as O,a8 as C,a4 as P,cE as ie,e as F,c as $}from"./index-ChG_GYbX.js";import{e as de}from"./select-CeexIfr3.js";function ue(r,e){return i.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[c,a]=i.useState(null),[u,d]=i.useState(null),[h,f]=i.useState(null),[S,w]=i.useState(null),[A,Y]=i.useState(null),[x,L]=i.useState(0),[M,j]=i.useState(0),[D,y]=i.useState(!1),[N,W]=i.useState(!1),v=T(e,E=>a(E)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:c,viewport:u,onViewportChange:d,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),c=i.useRef(null),a=T(e,c,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:a,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,c=r.orientation==="horizontal";return i.useEffect(()=>(c?n(!0):s(!0),()=>{c?n(!1):s(!1)}),[c,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=i.useState(!1);return i.useEffect(()=>{const c=t.scrollArea;let a=0;if(c){const u=()=>{window.clearTimeout(a),s(!0)},d=()=>{a=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(a),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",d)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>a("SCROLL_END"),100),[c,a]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,t.scrollHideDelay,a]),i.useEffect(()=>{const u=t.viewport,d=n?"scrollLeft":"scrollTop";if(u){let h=u[d];const f=()=>{const S=u[d];h!==S&&(a("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,a,s]),b.jsx(O,{present:o||c!=="hidden",children:b.jsx(V,{"data-state":c==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Z=i.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=i.useState(!1),c=r.orientation==="horizontal",a=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,d=o.viewport.offsetHeight<o.viewport.scrollHeight;s(c?u:d)}},10);return R(o.viewport,a),R(o.content,a),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=i.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=i.useRef(null),s=i.useRef(0),[c,a]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(c.viewport,c.content),d={...l,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,c,S)}return o==="horizontal"?b.jsx(Se,{...d,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,c,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...d,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,c);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=i.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,c]=i.useState(),a=i.useRef(null),u=T(e,a,n.onScrollbarXChange);return i.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:d=>r.onThumbPointerDown(d.x),onDragScroll:d=>r.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+d.deltaX;r.onWheelScroll(f),se(f,h)&&d.preventDefault()}},onResize:()=>{a.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=i.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,c]=i.useState(),a=i.useRef(null),u=T(e,a,n.onScrollbarYChange);return i.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:d=>r.onThumbPointerDown(d.y),onDragScroll:d=>r.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(n.viewport){const f=n.viewport.scrollTop+d.deltaY;r.onWheelScroll(f),se(f,h)&&d.preventDefault()}},onResize:()=>{a.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:d,onResize:h,...f}=r,S=m(g,o),[w,A]=i.useState(null),Y=T(e,v=>A(v)),x=i.useRef(null),L=i.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(d),y=P(a),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,E=v.clientY-x.current.top;u({x:p,y:E})}}return i.useEffect(()=>{const v=p=>{const E=p.target;w?.contains(E)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),i.useEffect(y,[l,y]),R(w,N),R(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(c),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=i.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:c}=s,a=T(e,h=>s.onThumbChange(h)),u=i.useRef(void 0),d=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return i.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(d(),!u.current){const S=xe(h,c);u.current=S,c()}};return c(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,d,c]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=i.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=i.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=i.useState(0),[c,a]=i.useState(0),u=!!(n&&c);return R(t.scrollbarX,()=>{const d=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(d),a(d)}),R(t.scrollbarY,()=>{const d=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(d),s(d)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:c,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,c=t-s,a=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-c,d=o.content-o.viewport,h=l==="ltr"?[0,d]:[d*-1,0];return le([a,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,c=n-l,a=o==="ltr"?[0,s]:[s*-1,0],u=de(r,a);return le([0,s],[0,c])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,c=o.top!==n.top;(s||c)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(l.current),[]),i.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function R(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Ee=te;function _e(r){const e=F.c(17);let o,l,t,n;e[0]!==r?({className:l,children:o,hideScrollbar:n,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=n===void 0?!1:n;let c;e[5]!==l?(c=$("relative h-full w-full",l),e[5]=l,e[6]=c):c=e[6];let a;e[7]!==o?(a=b.jsx(Ce,{"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:b.jsx("div",{className:"flex min-w-0 flex-col",children:o})}),e[7]=o,e[8]=a):a=e[8];let u;e[9]!==s?(u=b.jsx(Re,{hideScrollbar:s}),e[9]=s,e[10]=u):u=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=b.jsx(Ee,{}),e[11]=d):d=e[11];let h;return e[12]!==t||e[13]!==c||e[14]!==a||e[15]!==u?(h=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[a,u,d]}),e[12]=t,e[13]=c,e[14]=a,e[15]=u,e[16]=h):h=e[16],h}function Re(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,c=n===void 0?!1:n,a=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",d=c&&"hidden";let h;e[5]!==o||e[6]!==a||e[7]!==u||e[8]!==d?(h=$("select-none touch-none p-px transition-colors",a,u,d,o),e[5]=o,e[6]=a,e[7]=u,e[8]=d,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S,Re as a};
@@ -1 +1 @@
1
- import{e as b,c as w,j as a,l as j}from"./index-Bn0n2Tn5.js";import{i as N}from"./SearchMd-tlcXyQa_.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
1
+ import{e as b,c as w,j as a,l as j}from"./index-ChG_GYbX.js";import{i as N}from"./SearchMd-Wd5u0rRU.js";function S(f){const e=b.c(17),{value:l,onChange:c,placeholder:g,onKeyDown:d,className:u,isSearching:p,disabled:i}=f,m=g===void 0?"Search...":g,x=i&&"pointer-events-none opacity-50";let t;e[0]!==u||e[1]!==x?(t=w("flex items-center gap-4 rounded-lg bg-background dark:bg-input/30 px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",x,u),e[0]=u,e[1]=x,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{size:16,className:"animate-spin text-muted-foreground/75 shrink-0"}):a.jsx(N,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=h=>c(h.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==i||e[8]!==d||e[9]!==m||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:d,placeholder:m,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=i,e[8]=d,e[9]=m,e[10]=s,e[11]=l,e[12]=o):o=e[12];let r;return e[13]!==t||e[14]!==n||e[15]!==o?(r=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=r):r=e[16],r}export{S};
@@ -1 +1 @@
1
- import{r as i,aS as nt,aT as Pe,j as d,c4 as rt,aU as be,b6 as k,c5 as st,a7 as j,a8 as N,cE as $,c6 as lt,ao as _e,c7 as Ee,b9 as at,b7 as ct,a4 as it,c8 as dt,cb as ut,c9 as pt,cc as ft,cd as mt,ae as ht,ca as vt,ce as gt,cf as xt,e as ee,c as oe}from"./index-Bn0n2Tn5.js";import{V as St}from"./tooltip-CkzGOY_H.js";import{t as Re,i as wt}from"./ChevronDown-BMsVDJMd.js";import{n as Ct}from"./ChevronUp-Ba2YtjVA.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,Nt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,U]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,_=>h(_)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=_.left-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function io(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{io as S,po as a,uo as b,fo as c,mo as d,Ne as e};
1
+ import{r as i,aS as nt,aT as Pe,j as d,c4 as rt,aU as be,b6 as k,c5 as st,a7 as j,a8 as N,cE as $,c6 as lt,ao as _e,c7 as Ee,b9 as at,b7 as ct,a4 as it,c8 as dt,cb as ut,c9 as pt,cc as ft,cd as mt,ae as ht,ca as vt,ce as gt,cf as xt,e as ee,c as oe}from"./index-ChG_GYbX.js";import{V as St}from"./tooltip-D6U_mOrV.js";import{t as Re,i as wt}from"./ChevronDown-9Jxith6v.js";import{n as Ct}from"./ChevronUp-CaQ8hxxg.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Pt,Nt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,U]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const P of f)if(P===I||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:N(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,P=y.indexOf(I);y=y.slice(P+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,_=>h(_)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,P=F.left-I,X=_.left-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,P=window.innerWidth-F.right-I,X=window.innerWidth-_.right-P,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Nt(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function io(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function fo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function mo(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{io as S,po as a,uo as b,fo as c,mo as d,Ne as e};