@vellumai/web 0.10.3-staging.2 → 0.10.4-staging.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 (309) hide show
  1. package/dist/assets/{AnimatePresence-CgXwEO42.js → AnimatePresence-Dfn9OLfv.js} +2 -2
  2. package/dist/assets/{BundleConfirmPage-DpfvIcwl.js → BundleConfirmPage-cwBrFi1K.js} +1 -1
  3. package/dist/assets/{Combination-4Qc3vrtW.js → Combination-DRz6Ez-m.js} +1 -1
  4. package/dist/assets/{QueryClientProvider-DKhXIxGb.js → QueryClientProvider-DgWA3A3c.js} +1 -1
  5. package/dist/assets/{about-page-CuSnWJFo.js → about-page-6YWjIdZL.js} +1 -1
  6. package/dist/assets/{account-page-CCYCSy2-.js → account-page-bNvk8mIC.js} +1 -1
  7. package/dist/assets/{account-shell-b6GjlQ0u.js → account-shell-B1geYjoc.js} +1 -1
  8. package/dist/assets/{add-credits-modal-Dy3I3Har.js → add-credits-modal-D-5W9e8w.js} +1 -1
  9. package/dist/assets/{advanced-page-CVnT0zH-.js → advanced-page-CuerkFrp.js} +1 -1
  10. package/dist/assets/ai-page-CsqhZcSf.js +1 -0
  11. package/dist/assets/{api-2kc3MHRz.js → api-DXPKXkDj.js} +1 -1
  12. package/dist/assets/{api-key-screen-DGVn66y4.js → api-key-screen-QS5FdtlL.js} +1 -1
  13. package/dist/assets/{app-info-BZYaLxCg.js → app-info-oX9MaK2d.js} +1 -1
  14. package/dist/assets/{archive-BFILUl9x.js → archive-Ct5g6T4N.js} +1 -1
  15. package/dist/assets/{archive-page-Dl6HLIJt.js → archive-page-Bh0LTWRp.js} +1 -1
  16. package/dist/assets/arrow-left-BPsKoNcb.js +1 -0
  17. package/dist/assets/arrow-up-CkZMv0kb.js +1 -0
  18. package/dist/assets/{assistant-api-DROTS3Y9.js → assistant-api-BdlaVxiH.js} +1 -1
  19. package/dist/assets/{assistant-feature-flag-store-Dl92XRsM.js → assistant-feature-flag-store-Ceb6N94N.js} +1 -1
  20. package/dist/assets/assistant-identity-store-ESeBny_J.js +1 -0
  21. package/dist/assets/{assistant-status-panel-BkIkvMYw.js → assistant-status-panel-DRHanMan.js} +1 -1
  22. package/dist/assets/auth-store-BzL2lSd1.js +7 -0
  23. package/dist/assets/ban-BW0pQzvY.js +1 -0
  24. package/dist/assets/{bell-DB1SrBre.js → bell-B-09xFrv.js} +1 -1
  25. package/dist/assets/{billing-page-Cq_yLwUC.js → billing-page-CEArOabV.js} +3 -3
  26. package/dist/assets/{bookmark-C3S-p0MQ.js → bookmark-B_4Mr1qd.js} +1 -1
  27. package/dist/assets/{bookmarks-page-CANlE7hP.js → bookmarks-page-BvkvZ7uy.js} +1 -1
  28. package/dist/assets/{brain-Bs6LnfHO.js → brain-CamcLepK.js} +1 -1
  29. package/dist/assets/{browser-CKX_K5ev.js → browser-CDQJAXkC.js} +2 -2
  30. package/dist/assets/{bug-DDcuQ3au.js → bug-BiiqXpDy.js} +1 -1
  31. package/dist/assets/{build-state-VC4tL7sK.js → build-state-BIN8lPRx.js} +1 -1
  32. package/dist/assets/{button-D7s2Q_uG.js → button-BvHa6F59.js} +1 -1
  33. package/dist/assets/{calendar-CpgH8CqM.js → calendar-Ba3kkcG0.js} +1 -1
  34. package/dist/assets/{capture-error-Hr1Yo2kx.js → capture-error-BaKOqBjF.js} +1 -1
  35. package/dist/assets/{card-BibIM9x3.js → card-D9_3ngHI.js} +1 -1
  36. package/dist/assets/check-DwLoiFa9.js +1 -0
  37. package/dist/assets/check-DxBmXJus.js +1 -0
  38. package/dist/assets/{checkbox-BqCzUvXM.js → checkbox-DNfwi5Hy.js} +1 -1
  39. package/dist/assets/chevron-left-CgekgptJ.js +1 -0
  40. package/dist/assets/chevron-right-DP15nqFC.js +1 -0
  41. package/dist/assets/{chevron-up-BRZN6p_l.js → chevron-up-CNrKWpd3.js} +1 -1
  42. package/dist/assets/{circle-alert-DvNg50UK.js → circle-alert-BB_iJtM8.js} +1 -1
  43. package/dist/assets/circle-check-Cwv8JCfw.js +1 -0
  44. package/dist/assets/{client-feature-flag-store-C1kdd1EO.js → client-feature-flag-store-kWvb3vtZ.js} +1 -1
  45. package/dist/assets/{cloud-off-rAv4OHmv.js → cloud-off-DpkRXr7O.js} +1 -1
  46. package/dist/assets/{cn-DvW5mxZR.js → cn-CFvi8Z0K.js} +1 -1
  47. package/dist/assets/code-7vvpMPgo.js +1 -0
  48. package/dist/assets/{command-palette-GZu_zgQg.js → command-palette-D1nNMvVX.js} +1 -1
  49. package/dist/assets/{command-palette-window-page-CzWu42Ee.js → command-palette-window-page-DrZt0RaG.js} +1 -1
  50. package/dist/assets/{community-page-Dhgypa-h.js → community-page-A8lshdka.js} +1 -1
  51. package/dist/assets/{confirm-dialog-CfOXCE1N.js → confirm-dialog-BtxNY4WU.js} +1 -1
  52. package/dist/assets/{connect-page-CDOcgzzL.js → connect-page-CuSSRk9J.js} +1 -1
  53. package/dist/assets/{consent-controls-BSZV4rW3.js → consent-controls-CYj9WfJh.js} +1 -1
  54. package/dist/assets/{contacts-gateway-dxw1KMN2.js → contacts-gateway-CHNyL-NU.js} +1 -1
  55. package/dist/assets/{contacts-page-route-C3QiOxjO.js → contacts-page-route-qsIGsjpD.js} +2 -2
  56. package/dist/assets/{conversation-list-fetchers-UPVZq_6O.js → conversation-list-fetchers-Bcp_Zesn.js} +1 -1
  57. package/dist/assets/{conversation-store-DK-7gFAt.js → conversation-store-6tz67quR.js} +1 -1
  58. package/dist/assets/{cpu-CiHv3fhs.js → cpu-PmmoD4_K.js} +1 -1
  59. package/dist/assets/{credit-card-BKRB1ZIi.js → credit-card-yPLmY1JU.js} +1 -1
  60. package/dist/assets/{danger-zone-redirect-page-CjqUKhk9.js → danger-zone-redirect-page-Dhgk9mkr.js} +1 -1
  61. package/dist/assets/debug-page-Ddv9MlOm.js +4 -0
  62. package/dist/assets/{deploy-dialogs-jf5VL1UP.js → deploy-dialogs-qdH6GTjP.js} +1 -1
  63. package/dist/assets/{detail-card-BIwpXT5F.js → detail-card-5TPdhuZN.js} +1 -1
  64. package/dist/assets/{developer-page-iEL4eJ8x.js → developer-page-BXl0qAXX.js} +1 -1
  65. package/dist/assets/{devices-page-RMaPGcXe.js → devices-page-DaZR3FC4.js} +1 -1
  66. package/dist/assets/{diagnostics-BEB4VPwC.js → diagnostics-D5xXiLo-.js} +1 -1
  67. package/dist/assets/{dictation-overlay-page-BxQCzLMY.js → dictation-overlay-page-DOdZ_KIz.js} +1 -1
  68. package/dist/assets/{dist-B0Gf-knw.js → dist-BkSUb6s0.js} +1 -1
  69. package/dist/assets/{dist-cApvLul2.js → dist-Ble8OyWO.js} +1 -1
  70. package/dist/assets/{document-viewer-page-57OuXxYw.js → document-viewer-page-XzPSoPVb.js} +1 -1
  71. package/dist/assets/{domain-field-DYwuCpup.js → domain-field-BGp08c4L.js} +1 -1
  72. package/dist/assets/{dropdown-CL8VmqrY.js → dropdown-SUNHYFiy.js} +1 -1
  73. package/dist/assets/{earn-credits-modal-Nm1VymMp.js → earn-credits-modal-D7ioWvNh.js} +1 -1
  74. package/dist/assets/{emails-page-0gRZqa6y.js → emails-page-BRnVsJnR.js} +1 -1
  75. package/dist/assets/{emoji-catalog-data-Dlkuvec0.js → emoji-catalog-data-hHp74TCA.js} +1 -1
  76. package/dist/assets/{environment-store-CvH3J6fT.js → environment-store-B5EGAqzg.js} +1 -1
  77. package/dist/assets/esm-8Mv545sP.js +2 -0
  78. package/dist/assets/esm-B35SBKTx.js +2 -0
  79. package/dist/assets/esm-B9nLiq-2.js +1 -0
  80. package/dist/assets/{esm-B3Lr4Bv0.js → esm-DQXfMjvW.js} +2 -2
  81. package/dist/assets/esm-Dz9uwqjb.js +2 -0
  82. package/dist/assets/esm-TyKOKslC.js +2 -0
  83. package/dist/assets/{external-link-DPAtkBJ2.js → external-link-h3UAe8eX.js} +1 -1
  84. package/dist/assets/{file-editor-BNkJJbUv.js → file-editor-Cy1TZHJJ.js} +1 -1
  85. package/dist/assets/{file-text-CmK9LY1p.js → file-text-Bxj0xAst.js} +1 -1
  86. package/dist/assets/funnel-events-Dz_DLI0Q.js +1 -0
  87. package/dist/assets/general-page-Dl7IYYSf.js +1 -0
  88. package/dist/assets/{globe-DYF_lSGm.js → globe-D7wvOZaZ.js} +1 -1
  89. package/dist/assets/{hard-drive-D7_5VMhi.js → hard-drive-CO7i5o4z.js} +1 -1
  90. package/dist/assets/{hatching-screen-KPinlCES.js → hatching-screen-YvbZlnsV.js} +1 -1
  91. package/dist/assets/home-page-route-B7AJU1pr.js +1 -0
  92. package/dist/assets/{hosting-screen-C14KAJ6m.js → hosting-screen-CKlP38Z3.js} +1 -1
  93. package/dist/assets/{identity-page-route-C0BFcTAF.js → identity-page-route-CZQEWoJK.js} +1 -1
  94. package/dist/assets/index-3zpPFBeR.js +132 -0
  95. package/dist/assets/index-PRuqIn_u.css +2 -0
  96. package/dist/assets/{info-_OtUK1cX.js → info-B4DDA6uP.js} +1 -1
  97. package/dist/assets/{info-BGLlcyt6.js → info-CNTT4WCe.js} +1 -1
  98. package/dist/assets/{input-C8kfrq9r.js → input-BLN3wmw2.js} +1 -1
  99. package/dist/assets/{inspect-page-CWasyuSO.js → inspect-page-AldHg0Dz.js} +4 -4
  100. package/dist/assets/{install-C3xe8ARr.js → install-D_GSceot.js} +1 -1
  101. package/dist/assets/integrations-page-b3sE-PDS.js +1 -0
  102. package/dist/assets/{intelligence-layout-CvTumtjv.js → intelligence-layout-CsM_YjdB.js} +1 -1
  103. package/dist/assets/{keyboard-shortcuts-page-kiOEZKzE.js → keyboard-shortcuts-page-Capx1ICA.js} +1 -1
  104. package/dist/assets/{lib-BWRK7bT2.js → lib-Bexzcbsy.js} +1 -1
  105. package/dist/assets/library-detail-page-DrgMdBPq.js +1 -0
  106. package/dist/assets/{library-page-BHejhapZ.js → library-page-Catpu3p0.js} +1 -1
  107. package/dist/assets/{link-2-CaszbD7P.js → link-2-DW8ruMGH.js} +1 -1
  108. package/dist/assets/{list-row-Cw9JYESP.js → list-row-l7sxQ4Tj.js} +1 -1
  109. package/dist/assets/loader-circle-cYXxWP5B.js +1 -0
  110. package/dist/assets/{local-mode-CvrNMtPF.js → local-mode-Cez1weue.js} +1 -1
  111. package/dist/assets/{log-in-2iOsufxq.js → log-in-Ci5ja9sN.js} +1 -1
  112. package/dist/assets/{login-flow-DPi11n3h.js → login-flow-DeMU71_M.js} +1 -1
  113. package/dist/assets/{login-page-BGLVK82t.js → login-page-DkNb0F3s.js} +1 -1
  114. package/dist/assets/{logout-page-Bl6AD21S.js → logout-page-POyojlS1.js} +1 -1
  115. package/dist/assets/{logs-layout-C9eUE1Pt.js → logs-layout-qJmOLDZF.js} +1 -1
  116. package/dist/assets/{memory-router-playground-page-Dhi3uqxr.js → memory-router-playground-page-DD6t0kqe.js} +1 -1
  117. package/dist/assets/{menu-C_97pis4.js → menu-_JM4udVm.js} +1 -1
  118. package/dist/assets/{messages-DHDZ32NT.js → messages-DCNfjhgv.js} +2 -2
  119. package/dist/assets/{minimize-2-JE_UHZlJ.js → minimize-2-DmC6-Woz.js} +1 -1
  120. package/dist/assets/{mobile-sidebar-drawer-DqXFL0Ke.js → mobile-sidebar-drawer-B4ol32hs.js} +1 -1
  121. package/dist/assets/{modal-D0Q3UWD0.js → modal-CH2iwSBx.js} +1 -1
  122. package/dist/assets/{monitor-D2okHi8o.js → monitor-B1YMXlZj.js} +1 -1
  123. package/dist/assets/{moon-CK8MXzOo.js → moon-DSWoApF5.js} +1 -1
  124. package/dist/assets/mutation-error-B5AKP6aC.js +1 -0
  125. package/dist/assets/{native-file-B-MK3Ngg.js → native-file-GuVJgNpB.js} +2 -2
  126. package/dist/assets/{notice-CqRgVmeL.js → notice-BhqKj_VM.js} +1 -1
  127. package/dist/assets/{notifications-page-pHiDPA0p.js → notifications-page-MRalDive.js} +1 -1
  128. package/dist/assets/{oauth-complete-page-DiGMWbOb.js → oauth-complete-page-DGOyh2u6.js} +1 -1
  129. package/dist/assets/{oauth-popup-complete-page-CwoZnzdc.js → oauth-popup-complete-page-BPxKmr_f.js} +1 -1
  130. package/dist/assets/{page-shell-cEGpH3P5.js → page-shell-cu3KBmqd.js} +1 -1
  131. package/dist/assets/{pairing-page-clFaUgzL.js → pairing-page-_ulPOW9r.js} +1 -1
  132. package/dist/assets/{panel-item-nGTDevWP.js → panel-item-DN2CyWOT.js} +1 -1
  133. package/dist/assets/{password-reset-page-DfYGL1Gv.js → password-reset-page-BfRXQpS_.js} +1 -1
  134. package/dist/assets/{pencil-DbB9rxpY.js → pencil-DUMCM9m-.js} +1 -1
  135. package/dist/assets/{platform-loopback-page-Df5bTTx8.js → platform-loopback-page-D3oAT6qE.js} +1 -1
  136. package/dist/assets/{plugin-detail-page-IRPeI4lP.js → plugin-detail-page-ClMMTrti.js} +1 -1
  137. package/dist/assets/{plugins-page-BaYp2QOe.js → plugins-page-y6Aom9qx.js} +1 -1
  138. package/dist/assets/{popover-CL-JL6vG.js → popover-BIr0nN9H.js} +1 -1
  139. package/dist/assets/prechat-route-MTnUk6MK.js +1 -0
  140. package/dist/assets/{prefs-C_oq5G87.js → prefs-C6e8pdrA.js} +1 -1
  141. package/dist/assets/{privacy-page-BUhxrIRn.js → privacy-page-gc352kAN.js} +1 -1
  142. package/dist/assets/privacy-screen-CQLPQPoM.js +1 -0
  143. package/dist/assets/{progress-bar-DIFlWPPg.js → progress-bar-ATg2lhDh.js} +1 -1
  144. package/dist/assets/{provider-callback-page-CxFC4PH1.js → provider-callback-page-BtYwaMxL.js} +1 -1
  145. package/dist/assets/{provider-key-nA35OC4Y.js → provider-key-BKR2QTfR.js} +1 -1
  146. package/dist/assets/{provider-signup-page-CdpT28xL.js → provider-signup-page-80V_D9ad.js} +1 -1
  147. package/dist/assets/proxy-T76Q62qP.js +1 -0
  148. package/dist/assets/{quick-input-page-C9jN8YtU.js → quick-input-page-B-7fTgJi.js} +1 -1
  149. package/dist/assets/{react-query.gen-CQLyoqYk.js → react-query.gen-BeTpj_Sy.js} +1 -1
  150. package/dist/assets/{react-query.gen-rp6Krcco.js → react-query.gen-breoeUVK.js} +1 -1
  151. package/dist/assets/{refresh-cw-Bf6LV0kG.js → refresh-cw-kmptQnpX.js} +1 -1
  152. package/dist/assets/{research-mock-page-ttrrPwo3.js → research-mock-page-DYPr-S2q.js} +1 -1
  153. package/dist/assets/research-onboarding-route-yYstHFq4.js +35 -0
  154. package/dist/assets/{resize-errors-DnJEbHn4.js → resize-errors-ocHCHRPn.js} +1 -1
  155. package/dist/assets/{resolved-assistants-store-Cp4J43BK.js → resolved-assistants-store-BrS8JBzC.js} +1 -1
  156. package/dist/assets/{return-to-ByvaXBKr.js → return-to-DlPFMVLx.js} +1 -1
  157. package/dist/assets/{review-terms-screen-DEiifDmK.js → review-terms-screen-DFlSm1tM.js} +1 -1
  158. package/dist/assets/risk-badge-CTIwePVV.js +1 -0
  159. package/dist/assets/{routes-DVqkwUEe.js → routes-Dzl0kj5j.js} +1 -1
  160. package/dist/assets/{save-DEBQ_gbb.js → save-DQyrotXP.js} +1 -1
  161. package/dist/assets/{schedules-D-4Rq6ZC.js → schedules-DZspBZ61.js} +1 -1
  162. package/dist/assets/{sdk.gen-D-_js_oC.js → sdk.gen-DSjI3deY.js} +1 -1
  163. package/dist/assets/{select-assistant-screen-UoixBMN2.js → select-assistant-screen-kcdnMYj7.js} +1 -1
  164. package/dist/assets/{setting-row-o44aWwYt.js → setting-row-DB3q3lgL.js} +1 -1
  165. package/dist/assets/settings-layout-DV4y_-8a.js +1 -0
  166. package/dist/assets/{share-feedback-modal-CTwByE7B.js → share-feedback-modal-CNGNLLDP.js} +1 -1
  167. package/dist/assets/{shortcut-keys-vM6sNj7W.js → shortcut-keys-D4E8qQgS.js} +1 -1
  168. package/dist/assets/{sidebar-tree-BJkXpCut.js → sidebar-tree-BCJVetMg.js} +1 -1
  169. package/dist/assets/{signup-page-CKDYl9Wb.js → signup-page-iM9szAKN.js} +1 -1
  170. package/dist/assets/{signup-shell-Bu5BM6II.js → signup-shell-GOG8-46O.js} +1 -1
  171. package/dist/assets/{skills-page-DVjqqfMw.js → skills-page-D3c3cuti.js} +1 -1
  172. package/dist/assets/{sound-manager-CzslfzDO.js → sound-manager-DwCzTycd.js} +1 -1
  173. package/dist/assets/{sounds-page-mens6EAJ.js → sounds-page-C3qbFW0l.js} +1 -1
  174. package/dist/assets/{sparkles-BICoewVE.js → sparkles-C8eL4LNF.js} +1 -1
  175. package/dist/assets/src-Dr68ou95.js +293 -0
  176. package/dist/assets/{stat-square-B0S3fO7O.js → stat-square-zBHENXcL.js} +1 -1
  177. package/dist/assets/{status-badge-pill-DYlAnX5m.js → status-badge-pill-CSitw8_5.js} +1 -1
  178. package/dist/assets/step-indicator-dots-D4A7eDFL.js +1 -0
  179. package/dist/assets/subagent-detail-panel-D3xm4yVF.js +4 -0
  180. package/dist/assets/{subagent-store-BLHGkTJR.js → subagent-store-CFwN6f1W.js} +1 -1
  181. package/dist/assets/system-events-page-CXlJ_J54.js +1 -0
  182. package/dist/assets/{system-events-redirect-page-C1hGE6n5.js → system-events-redirect-page-Bkigvq03.js} +1 -1
  183. package/dist/assets/{tag-B_-QAvJF.js → tag-64Evw5MO.js} +1 -1
  184. package/dist/assets/{three-dot-indicator-CLs7Rl-I.js → three-dot-indicator-DKd64wpF.js} +1 -1
  185. package/dist/assets/{tiptap-document-editor-D2t4qYzv.js → tiptap-document-editor-D031y5O7.js} +1 -1
  186. package/dist/assets/{toast-2TW5tj1Y.js → toast-VJ6jFKB9.js} +1 -1
  187. package/dist/assets/{toggle-X_kQW5my.js → toggle-zADptotB.js} +1 -1
  188. package/dist/assets/tool-detail-panel-Cq_SyoUG.js +2 -0
  189. package/dist/assets/{trace-page-DRWPaAuQ.js → trace-page-CEyVWa_4.js} +1 -1
  190. package/dist/assets/{triangle-alert-Bz1PpciW.js → triangle-alert-DqPPHRPD.js} +1 -1
  191. package/dist/assets/{triangle-alert-DKOyShqD.js → triangle-alert-eaW8jtCr.js} +1 -1
  192. package/dist/assets/{typography-BscuIPxA.js → typography-COqg6o2z.js} +1 -1
  193. package/dist/assets/{upgrade-cancel-page-Cwv5eMh9.js → upgrade-cancel-page-CM9JnbEO.js} +1 -1
  194. package/dist/assets/{upgrade-success-page-DnJ8Kyyj.js → upgrade-success-page-BxrXUjiP.js} +1 -1
  195. package/dist/assets/{usage-page-DJHRS0lZ.js → usage-page-DBmsLal7.js} +1 -1
  196. package/dist/assets/{use-active-assistant-id-C-RHQ9f6.js → use-active-assistant-id-jfqnc4T7.js} +1 -1
  197. package/dist/assets/{use-bus-subscription-BbiZXm1u.js → use-bus-subscription-CKWguMzy.js} +1 -1
  198. package/dist/assets/use-is-org-ready-DLZpD311.js +1 -0
  199. package/dist/assets/{use-onboarding-login-BEOH92mZ.js → use-onboarding-login-Cz1MgHw6.js} +1 -1
  200. package/dist/assets/use-plugin-drift-4-li_vW2.js +1 -0
  201. package/dist/assets/use-reduced-motion-DvKonyYy.js +1 -0
  202. package/dist/assets/{useQuery-B45lW1Kk.js → useBaseQuery-BOw_gWPH.js} +1 -1
  203. package/dist/assets/useInfiniteQuery-iPXlezAp.js +1 -0
  204. package/dist/assets/{useMutation-Lj4VunQV.js → useMutation-D3WkZnYg.js} +1 -1
  205. package/dist/assets/useQuery-cVuP8q1x.js +1 -0
  206. package/dist/assets/{user-plus-C0OyQU83.js → user-plus-CjFuXA3D.js} +1 -1
  207. package/dist/assets/{utils-IBnUZTqY.js → utils-Lep-7jRg.js} +1 -1
  208. package/dist/assets/{viewer-store-Dead64xY.js → viewer-store-Dened07w.js} +1 -1
  209. package/dist/assets/{voice-page-kQZ2ya5j.js → voice-page-C3zxM20t.js} +1 -1
  210. package/dist/assets/{weather-forecast-display-Cu3W6OZF.js → weather-forecast-display-DfsXEBSo.js} +1 -1
  211. package/dist/assets/{web-DOKyhuGQ.js → web-Broue3sZ.js} +1 -1
  212. package/dist/assets/{web-M3MS-KVB.js → web-C6Et8xNJ.js} +1 -1
  213. package/dist/assets/{web-B0S2ynRY.js → web-CNtrY6ZR.js} +1 -1
  214. package/dist/assets/{web-D0QcGl1O.js → web-CccL0uF5.js} +1 -1
  215. package/dist/assets/{web-Cg8gCWpB.js → web-CtAf2vJC.js} +1 -1
  216. package/dist/assets/{web-DJKnWTsF.js → web-Cygkn0vs.js} +1 -1
  217. package/dist/assets/{web-iUXw2JWQ.js → web-DuqCaaXx.js} +1 -1
  218. package/dist/assets/{welcome-screen-Bd7PCfAf.js → welcome-screen-RBmiq3Lq.js} +1 -1
  219. package/dist/assets/workflow-detail-panel-C2dD_hU2.js +1 -0
  220. package/dist/assets/{workspace-page-BR4pOxs5.js → workspace-page-lR8lzD2L.js} +1 -1
  221. package/dist/assets/x-649kPSQS.js +1 -0
  222. package/dist/assets/x-Bn5tweDc.js +1 -0
  223. package/dist/index.html +135 -134
  224. package/package.json +1 -1
  225. package/dist/assets/ai-page-kEbHR7cH.js +0 -1
  226. package/dist/assets/arrow-left-CP-EhDNF.js +0 -1
  227. package/dist/assets/arrow-up-nBfZxfhi.js +0 -1
  228. package/dist/assets/assistant-identity-store-CKjnoLSp.js +0 -1
  229. package/dist/assets/auth-store-Kfxhs2oI.js +0 -7
  230. package/dist/assets/ban-BpBuRCKI.js +0 -1
  231. package/dist/assets/check-CW0KmV0o.js +0 -1
  232. package/dist/assets/check-D6WkI0gF.js +0 -1
  233. package/dist/assets/chevron-left-DghyKSEE.js +0 -1
  234. package/dist/assets/chevron-right-B6vEpVY0.js +0 -1
  235. package/dist/assets/circle-check-DzlJxj_M.js +0 -1
  236. package/dist/assets/code-aMX9iMYa.js +0 -1
  237. package/dist/assets/debug-page-CBozmAQQ.js +0 -2
  238. package/dist/assets/esm-BVNBLzcW.js +0 -2
  239. package/dist/assets/esm-BtN-afz9.js +0 -1
  240. package/dist/assets/esm-D2xhPoyM.js +0 -2
  241. package/dist/assets/esm-DwNtkiSD.js +0 -2
  242. package/dist/assets/esm-pt1s0ryM.js +0 -2
  243. package/dist/assets/general-page-aZxTpnpI.js +0 -1
  244. package/dist/assets/home-page-route-CudtBGg1.js +0 -1
  245. package/dist/assets/index-Hcyzmz_5.css +0 -2
  246. package/dist/assets/index-PRnvH2Y1.js +0 -132
  247. package/dist/assets/integrations-page-WhBpTYP2.js +0 -1
  248. package/dist/assets/library-detail-page-rPvN9G1a.js +0 -1
  249. package/dist/assets/loader-circle-IIzBGiwm.js +0 -1
  250. package/dist/assets/mutation-error-CsyN8rYH.js +0 -1
  251. package/dist/assets/prechat-route-BaMWiiaf.js +0 -1
  252. package/dist/assets/privacy-screen-BaHYtKEt.js +0 -1
  253. package/dist/assets/proxy-DmIh4F51.js +0 -1
  254. package/dist/assets/reduced-motion-DYlLlcUm.js +0 -1
  255. package/dist/assets/research-onboarding-route-Cxai0fux.js +0 -36
  256. package/dist/assets/risk-badge-BA8R-HCI.js +0 -1
  257. package/dist/assets/settings-layout-CQ3Z9Raj.js +0 -1
  258. package/dist/assets/src-CK6bncSg.js +0 -293
  259. package/dist/assets/step-indicator-dots-CEVbsP8r.js +0 -1
  260. package/dist/assets/subagent-detail-panel-DVQAkMjF.js +0 -4
  261. package/dist/assets/system-events-page-Dro8iNrx.js +0 -1
  262. package/dist/assets/tool-detail-panel-DRD2DIMF.js +0 -2
  263. package/dist/assets/use-is-org-ready-BdtHeRV6.js +0 -1
  264. package/dist/assets/use-plugin-drift-Bj693x0f.js +0 -1
  265. package/dist/assets/use-reduced-motion-ChB7nOGe.js +0 -1
  266. package/dist/assets/workflow-detail-panel-CMmPPsuL.js +0 -1
  267. package/dist/assets/x-C8bCmIhD.js +0 -1
  268. package/dist/assets/x-KVxA2ZL0.js +0 -1
  269. /package/dist/assets/{api-errors-CveHbhgb.js → api-errors-B-g6gvNv.js} +0 -0
  270. /package/dist/assets/{avatar-bundled-components-BgAkdy0n.js → avatar-bundled-components-DoxUXsZB.js} +0 -0
  271. /package/dist/assets/{avatar-svg-compositor-CEmN7KGI.js → avatar-svg-compositor-Bzno7teV.js} +0 -0
  272. /package/dist/assets/{build.umd-B3KuSWeo.js → build.umd-C56vswwO.js} +0 -0
  273. /package/dist/assets/{client.gen-Cs6pCK0s.js → client.gen-BnoNy2w0.js} +0 -0
  274. /package/dist/assets/{composer-focus-Bp1AiP29.js → composer-focus-BZr63Cvs.js} +0 -0
  275. /package/dist/assets/{conversation-selection-CtKjA5Ni.js → conversation-selection-BV7USWf2.js} +0 -0
  276. /package/dist/assets/{create-selectors-BE0_e_Ed.js → create-selectors-BTyhO-eS.js} +0 -0
  277. /package/dist/assets/{createLucideIcon-Bjb-Kuq7.js → createLucideIcon-6rJ6BdB7.js} +0 -0
  278. /package/dist/assets/{createLucideIcon-BlMXrA59.js → createLucideIcon-D8roAprb.js} +0 -0
  279. /package/dist/assets/{definitions-lQvEBMJT.js → definitions-CtVlh_R5.js} +0 -0
  280. /package/dist/assets/{dist-BTp54SIT.js → dist-CzyDxYAs.js} +0 -0
  281. /package/dist/assets/{edit-chat-session-DJpqkkos.js → edit-chat-session-BYvbyTwd.js} +0 -0
  282. /package/dist/assets/{effective-timezone-DrYGH2Lb.js → effective-timezone-DAkNzd21.js} +0 -0
  283. /package/dist/assets/{event-bus-Dl7-I4aL.js → event-bus-CBil9JQT.js} +0 -0
  284. /package/dist/assets/{feature-flag-catalog-RK3_Ckyw.js → feature-flag-catalog-Br-v70vR.js} +0 -0
  285. /package/dist/assets/{format-CPOur310.js → format-HKnibeVj.js} +0 -0
  286. /package/dist/assets/{format-date-CLlHK5gl.js → format-date-DyMQp2_m.js} +0 -0
  287. /package/dist/assets/{format-file-size-BfZOpPdu.js → format-file-size-DOcXaUaE.js} +0 -0
  288. /package/dist/assets/{haptics-CXHZxyAg.js → haptics-CKwMH4eq.js} +0 -0
  289. /package/dist/assets/{impersonate-version-flag-n-4oNLiO.js → impersonate-version-flag-XVa1Tm2F.js} +0 -0
  290. /package/dist/assets/{infiniteQueryOptions-C6p49ZmI.js → infiniteQueryOptions-DTCCTa10.js} +0 -0
  291. /package/dist/assets/{is-electron-C_ZTVhv8.js → is-electron-URCUw74P.js} +0 -0
  292. /package/dist/assets/{jsx-runtime-CVSDxk6A.js → jsx-runtime-B-mvcaJS.js} +0 -0
  293. /package/dist/assets/{llm-dimension-CQdmYu05.js → llm-dimension-Dx3xIzPP.js} +0 -0
  294. /package/dist/assets/{misc-BN2o2MEB.js → misc-CBD9JJCY.js} +0 -0
  295. /package/dist/assets/{native-deep-link-BYNI6pkW.js → native-deep-link-DmJ7Ty6z.js} +0 -0
  296. /package/dist/assets/{pdf-pz4ipUHd.js → pdf-DNWhOzmB.js} +0 -0
  297. /package/dist/assets/{prechat-B28Vzu55.js → prechat-BuuzFtal.js} +0 -0
  298. /package/dist/assets/{prechat-names-CRduluk-.js → prechat-names-Bo5bdzfH.js} +0 -0
  299. /package/dist/assets/{public-asset-Fx_laYnf.js → public-asset-BTisO-cB.js} +0 -0
  300. /package/dist/assets/{queryOptions-BtNi-_9H.js → queryOptions-DGyQTr3e.js} +0 -0
  301. /package/dist/assets/{sdk.gen-1aYqVbMj.js → sdk.gen-CC1iYdd0.js} +0 -0
  302. /package/dist/assets/{semver-yC_Iq9co.js → semver-DpADL11z.js} +0 -0
  303. /package/dist/assets/{tool-call-status-DTV5jmaU.js → tool-call-status-DNS6Y_vi.js} +0 -0
  304. /package/dist/assets/{typed-storage-Dctd_K9F.js → typed-storage-Chj38wph.js} +0 -0
  305. /package/dist/assets/{usage-window-Wgtgd-cv.js → usage-window-dm_mRqGo.js} +0 -0
  306. /package/dist/assets/{use-is-mobile-Cy10kl9u.js → use-is-mobile-BF5x8sr8.js} +0 -0
  307. /package/dist/assets/{workflow-status-DmbjJPT4.js → workflow-status-B53qU9DS.js} +0 -0
  308. /package/dist/assets/{xterm-MKaw0cT7.js → xterm-CQ7wuPsS.js} +0 -0
  309. /package/dist/assets/{xterm-addon-fit-BFDQtfbG.js → xterm-addon-fit-CamgTlEH.js} +0 -0
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{r as t,s as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./capture-error-Hr1Yo2kx.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-D7s2Q_uG.js";import{d as o,h as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{N as c,O as l,S as u,T as d,c as f,n as p}from"./QueryClientProvider-DKhXIxGb.js";import{a as m,c as h,d as g,i as _,l as v,o as y,r as b,s as x,t as S,u as C}from"./useQuery-B45lW1Kk.js";import{t as w}from"./jsx-runtime-CVSDxk6A.js";import{t as T}from"./card-BibIM9x3.js";import{n as E,t as D}from"./panel-item-nGTDevWP.js";import{t as O}from"./confirm-dialog-CfOXCE1N.js";import{t as k}from"./notice-CqRgVmeL.js";import{t as A}from"./popover-CL-JL6vG.js";import{t as j}from"./input-C8kfrq9r.js";import{t as M}from"./toggle-X_kQW5my.js";import{n as N,t as P}from"./list-row-Cw9JYESP.js";import{t as F}from"./modal-D0Q3UWD0.js";import{n as I}from"./toast-2TW5tj1Y.js";import{t as L}from"./createLucideIcon-BlMXrA59.js";import{t as ee}from"./check-D6WkI0gF.js";import{t as R}from"./chevron-right-B6vEpVY0.js";import{t as z}from"./circle-alert-DvNg50UK.js";import{t as B}from"./circle-check-DzlJxj_M.js";import{t as V}from"./external-link-DPAtkBJ2.js";import{t as H}from"./loader-circle-IIzBGiwm.js";import{t as U}from"./log-in-2iOsufxq.js";import{t as W}from"./pencil-DbB9rxpY.js";import{t as te}from"./refresh-cw-Bf6LV0kG.js";import{t as ne}from"./sparkles-BICoewVE.js";import{t as re}from"./x-KVxA2ZL0.js";import{hr as G}from"./sdk.gen-1aYqVbMj.js";import{Bt as ie,J as ae,K as oe,Rt as se,Vt as ce,X as le,Y as ue,Z as de,q as fe,zt as pe}from"./react-query.gen-CQLyoqYk.js";import{r as me}from"./api-errors-CveHbhgb.js";import{L as he,M as ge}from"./auth-store-Kfxhs2oI.js";import{r as _e}from"./api-2kc3MHRz.js";import{a as ve}from"./routes-DVqkwUEe.js";import{n as ye}from"./use-is-mobile-Cy10kl9u.js";import{t as be}from"./assistant-feature-flag-store-Dl92XRsM.js";import{S as xe,b as K,vt as Se,x as Ce,yt as we}from"./react-query.gen-rp6Krcco.js";import{n as Te,t as Ee}from"./browser-CKX_K5ev.js";import{$i as q,Ct as De,Dt as Oe,Et as ke,Ht as Ae,Ir as J,Jr as je,Li as Me,Ot as Ne,St as Pe,Y,an as Fe,bt as Ie,ei as Le,mi as Re,qi as ze,rn as Be,ti as X,wt as Ve,x as He,xi as Ue,xt as We}from"./index-PRnvH2Y1.js";import{t as Ge}from"./use-active-assistant-id-C-RHQ9f6.js";function Ke(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function qe(e,t,n){let r=e.slice(0);return r[t]=n,r}var Je=class extends c{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,f.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!l(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ke(e,n).forEach(e=>{e.destroy()}),Ke(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=d(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new g(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=qe(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&f.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Z=e(i(),1);function Ye({queries:e,...t},n){let r=p(n),i=C(),a=v(),o=Z.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{b(e),y(e,a,r.getQueryCache().get(e.queryHash))}),h(a);let[s]=Z.useState(()=>new Je(r,o,t)),[c,l,d]=s.getOptimisticResult(o,t.combine),S=!i&&t.subscribed!==!1;Z.useSyncExternalStore(Z.useCallback(e=>S?s.subscribe(f.batchCalls(e)):u,[s,S]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),Z.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let w=c.some((e,t)=>m(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&m(n,e)?_(n,new g(r,n),a):[]}):[];if(w.length>0)throw Promise.all(w);let T=c.find((e,t)=>{let n=o[t];return n&&x({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(T?.error)throw T.error;return l(d())}var Xe=L(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),Ze=L(`calendar-plus`,[[`path`,{d:`M16 19h6`,key:`xwg31i`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5`,key:`1glfrc`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]);function Qe({assistantId:e,providerKey:t,displayName:n,managedAvailable:r,connectionsQueryKey:i,allConnections:a}){let o=p(),s=ge(),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useRef)(null),d=(0,Z.useRef)(null),[f,m]=(0,Z.useState)(!1),h=()=>{l.current=null,m(!1)},g=()=>{c.current&&!c.current.closed&&c.current.close(),c.current=null,u.current&&=(clearInterval(u.current),null),d.current&&=(clearTimeout(d.current),null)},_=(0,Z.useCallback)(e=>{if(e.type!==`vellum:oauth-complete`||!l.current||e.requestId!==l.current.requestId)return;let{oauthStatus:t,oauthCode:r}=e;if(g(),h(),t===`connected`)I.success(`${n} account connected.`),o.invalidateQueries({queryKey:i});else{let e=r?`Error: ${r}`:`Authorization failed`;I.error(`${n} ${e}`)}},[i,n,o]),v=(0,Z.useCallback)(async(e,n)=>{if(!r)return!1;for(let r=0;r<8;r+=1){r>0&&await Pe(750);try{if(o.invalidateQueries({queryKey:i}),We(await o.fetchQuery({...K({path:{assistant_id:e}}),staleTime:0}),t,n))return!0}catch{}}return!1},[i,r,t,o]);(0,Z.useEffect)(()=>{let e=e=>{let t=l.current;if(!t)return;let n=De(e,window.location.origin,t.requestId);n&&_(n)},t=e=>{let t=l.current;if(!t)return;let n=Ve(e,t.requestId);n&&(_(n),window.localStorage.removeItem(ke(t.requestId)))};return window.addEventListener(`message`,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(`message`,e),window.removeEventListener(`storage`,t)}},[_]),Ne((0,Z.useCallback)(e=>{let t=l.current;t&&e.requestId===t.requestId&&_({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[_])),(0,Z.useEffect)(()=>Te(()=>{let e=l.current;e&&(async()=>{let t=await v(e.platformAssistantId,e.baselineConnectionSignatures);l.current&&(h(),t&&I.success(`${n} account connected.`))})()}),[v,n]),(0,Z.useEffect)(()=>()=>{u.current&&clearInterval(u.current),d.current&&clearTimeout(d.current),c.current&&!c.current.closed&&c.current.close()},[]);let y=we();return{handleConnect:(i=[])=>{if(!r)return;let f=crypto.randomUUID();m(!0);let p=async r=>{let c;try{c=await he(e)}catch(e){g(),h(),I.error(e instanceof Error?e.message:`Failed to start ${n} authorization.`);return}let u=Ie(await o.fetchQuery({...K({path:{assistant_id:c}}),staleTime:0}).catch(()=>c===e?a??[]:[]),t);l.current={requestId:f,provider:t,platformAssistantId:c,baselineConnectionSignatures:u},y.mutate({path:{assistant_id:c,provider:t},body:{requested_scopes:i,redirect_after_connect:`${ve.account.oauth.popupComplete}?requestId=${f}${s?`&native=1`:``}`}},{onSuccess(e){if(s){Ee(e.connect_url);return}r&&!r.closed?r.location.href=e.connect_url:l.current&&(g(),h(),I.error(`${n} connection failed: popup closed.`))},onError(e){g(),h();let t=me(e,void 0,`Failed to start ${n} authorization.`);I.error(t)}})};if(s){p(null);return}let b=window.open(``,`_blank`,`width=500,height=600`);if(b===null){h(),I.error(`Popup blocked. Please enable popups and try again.`);return}c.current=b,u.current=setInterval(()=>{c.current&&c.current.closed&&l.current&&!d.current&&(d.current=setTimeout(async()=>{d.current=null;let e=l.current;if(!e)return;let t=window.localStorage.getItem(ke(e.requestId));if(t){let n=Oe(t);if(n&&n.requestId===e.requestId){_(n),window.localStorage.removeItem(ke(e.requestId));return}}let r=await v(e.platformAssistantId,e.baselineConnectionSignatures);if(l.current){if(r){g(),h(),I.success(`${n} account connected.`);return}g(),h(),I.error(`${n} connection failed: authorization popup closed.`)}},1e3))},100),p(b)},oauthInProgress:f,startOAuthPending:y.isPending}}var Q=w();function $e({displayName:e,providerKey:t,logoUrl:n,connections:r,connectionsLoading:i,startPending:o,oauthInProgress:s,disconnectingId:c,onConnect:l,onDisconnect:u,connectPresets:d=[]}){let f=o||s;return i?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(H,{className:`h-5 w-5 animate-spin text-[var(--content-disabled)]`})}):r.length===0?o||s?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:e,logoUrl:n,size:48}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(H,{className:`h-3.5 w-3.5 animate-spin`}),`Waiting for authorization...`]})]}):(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:e,logoUrl:n,size:48}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`Connect Account to continue`}),(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,Q.jsx)(a,{variant:`primary`,size:`compact`,leftIcon:(0,Q.jsx)(X,{}),onClick:()=>l(),disabled:f,children:`Connect Account`}),d.map(e=>(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,Q.jsx)(Ze,{}),onClick:()=>l(e.scopes),disabled:f,children:e.label},e.id))]})]}):(0,Q.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)]`,children:[(0,Q.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(r=>{let i=c===r.id;return(0,Q.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:e,logoUrl:n,size:20}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:r.account_label??`${e} Account`}),(0,Q.jsx)(a,{variant:`dangerOutline`,size:`compact`,iconOnly:i?(0,Q.jsx)(H,{className:`animate-spin`}):(0,Q.jsx)(J,{}),onClick:()=>u(r),disabled:i,"aria-label":`Disconnect ${r.account_label??`${e} account`}`})]},r.id)})}),(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-base)] px-4 py-3 dark:border-[var(--border-base)]`,children:f?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(H,{className:`h-3.5 w-3.5 animate-spin`}),`Waiting for authorization...`]}):(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(a,{variant:`primary`,size:`compact`,leftIcon:(0,Q.jsx)(V,{}),onClick:()=>l(),disabled:f,children:`Connect account`}),d.map(e=>(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,Q.jsx)(Ze,{}),onClick:()=>l(e.scopes),disabled:f,children:e.label},e.id))]})})]})}function et(e){return e.length>16?`${e.slice(0,12)}…${e.slice(-4)}`:e.length>8?`${e.slice(0,8)}…`:e}function tt(e){try{return new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}catch{return``}}function nt({assistantId:e,providerKey:t,displayName:n,logoUrl:r}){let i=p(),o=S({...ae({path:{assistant_id:e},query:{provider_key:t}}),select:e=>e.apps}),s=S({...le({path:{assistant_id:e,providerKey:t}}),select:e=>e.oauth_callback_url}),c=o.data??[],l=s.data??null,u=Ye({queries:c.map(t=>({...oe({path:{assistant_id:e,appId:t.id}}),select:e=>e.connections}))}),d={};c.forEach((e,t)=>{d[e.id]=u[t]?.data??[]});let f=ue({path:{assistant_id:e},query:{provider_key:t}}),m=ie({onSuccess:()=>{i.invalidateQueries({queryKey:f}),x(``),w(``),y(!1),I.success(`${n} OAuth app added.`)},onError:e=>{I.error(e.message||`Failed to create OAuth app`)}}),h=pe({onSuccess:()=>{i.invalidateQueries({queryKey:f}),I.success(`OAuth app deleted.`)},onError:e=>{I.error(e.message||`Failed to delete OAuth app`)}}),g=se({onSuccess:e=>{`auth_url`in e&&(window.location.href=e.auth_url)},onError:e=>{I.error(e.message||`Failed to start OAuth flow`)}}),_=ce(),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(``),[C,w]=(0,Z.useState)(``),[E,D]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(null),P=m.isPending,F=h.isPending?h.variables?.path?.id??null:null,L=g.isPending?g.variables?.path?.appId??null:null,R=_.isPending?_.variables?.path?.id??null:null,z=()=>{let n=b.trim(),r=C.trim();!n||!r||m.mutate({path:{assistant_id:e},body:{provider_key:t,client_id:n,client_secret:r}})},B=()=>{let t=k;A(null),t&&h.mutate({path:{assistant_id:e,id:t.id}})},U=t=>{g.mutate({path:{assistant_id:e,appId:t.id},body:{callback_transport:`gateway`,scopes:[]}})};return o.isLoading?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(H,{className:`h-5 w-5 animate-spin text-[var(--content-disabled)]`})}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[c.length===0||v?(0,Q.jsx)(T.Root,{children:(0,Q.jsxs)(T.Body,{className:`flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:c.length===0?`Add your own ${n} OAuth app`:`Add another ${n} OAuth app`}),(0,Q.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-tertiary)]`,children:`Credentials are stored encrypted on the assistant and are never sent to Vellum.`})]}),l?(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Redirect URL`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(j,{type:`text`,value:l,readOnly:!0,fullWidth:!0}),(0,Q.jsx)(a,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>{navigator.clipboard.writeText(l).then(()=>{D(!0),I.success(`Copied to clipboard!`),setTimeout(()=>D(!1),2e3)})},"aria-label":E?`Copied`:`Copy redirect URL`,iconOnly:E?(0,Q.jsx)(ee,{"aria-hidden":!0}):(0,Q.jsx)(Me,{"aria-hidden":!0})})]}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add this URL to your OAuth app's redirect settings.`})]}):null,(0,Q.jsx)(j,{label:`Client ID`,type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:`Enter your client ID`,fullWidth:!0}),(0,Q.jsx)(j,{label:`Client Secret`,type:`password`,value:C,onChange:e=>w(e.target.value),placeholder:`Enter your client secret`,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-1`,children:[c.length>0?(0,Q.jsx)(a,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>{y(!1),x(``),w(``)},disabled:P,children:`Cancel`}):null,(0,Q.jsx)(a,{type:`button`,size:`compact`,onClick:z,disabled:P||!b.trim()||!C.trim(),leftIcon:P?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(X,{"aria-hidden":!0}),children:`Add App`})]})]})}):null,c.map(e=>{let i=d[e.id]??[],o=F===e.id,s=L===e.id;return(0,Q.jsx)(T.Root,{children:(0,Q.jsxs)(T.Body,{className:`flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,Q.jsx)(`p`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:et(e.client_id)}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Added `,tt(e.created_at)]})]}),(0,Q.jsx)(a,{type:`button`,variant:`dangerOutline`,size:`compact`,onClick:()=>A(e),disabled:o,"aria-label":`Delete OAuth app ${et(e.client_id)}`,iconOnly:o?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(J,{"aria-hidden":!0})})]}),i.length>0?(0,Q.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)] overflow-hidden rounded-md border border-[var(--border-base)] dark:divide-[var(--border-base)] dark:border-[var(--border-base)]`,children:i.map(i=>{let o=R===i.id;return(0,Q.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:n,logoUrl:r,size:18}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-lighter text-[var(--content-default)]`,children:i.account_info??`${n} Account`}),(0,Q.jsx)(a,{type:`button`,variant:`dangerOutline`,size:`compact`,onClick:()=>N({appId:e.id,connection:i}),disabled:o,"aria-label":`Disconnect ${i.account_info??`${n} account`}`,iconOnly:o?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(J,{"aria-hidden":!0})})]},i.id)})}):null,(0,Q.jsx)(a,{type:`button`,size:`compact`,onClick:()=>U(e),disabled:s,className:`w-full`,leftIcon:s?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(V,{"aria-hidden":!0}),children:s?`Waiting for authorization...`:`Connect account`})]})},e.id)}),c.length>0&&!v?(0,Q.jsx)(a,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>y(!0),className:`w-full border-dashed`,leftIcon:(0,Q.jsx)(X,{"aria-hidden":!0}),children:`Add Another App`}):null,(0,Q.jsx)(O,{open:k!==null,title:`Delete OAuth app`,message:k?`Delete OAuth app '${et(k.client_id)}'? This will disconnect all linked accounts.`:``,confirmLabel:`Delete`,destructive:!0,onConfirm:B,onCancel:()=>A(null)}),(0,Q.jsx)(O,{open:M!==null,title:`Disconnect ${n}?`,message:M?`Disconnect ${M.connection.account_info??`${n} Account`}? You can reconnect later.`:``,confirmLabel:`Disconnect`,destructive:!0,onConfirm:()=>{let t=M;N(null),t&&_.mutate({path:{assistant_id:e,id:t.connection.id}},{onSuccess:()=>{let r=fe({path:{assistant_id:e,appId:t.appId}});i.invalidateQueries({queryKey:r}),i.invalidateQueries({queryKey:f}),I.success(`${n} account disconnected.`)},onError:e=>{I.error(e.message||`Failed to disconnect account`)}})},onCancel:()=>N(null)})]})}var rt={};function it(e){return rt[e]??[]}function at({assistantId:e,platformAssistantId:t,providerKey:n,displayName:r,description:i,logoUrl:o,platformGate:s,onClose:c}){let l=p(),u=s===`full`,d=!Be(),[f,m]=(0,Z.useState)(s===`gated`&&d?`your-own`:`managed`);(0,Z.useEffect)(()=>{!d&&f===`your-own`&&m(`managed`)},[d,f]);let[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null),y=Ce({path:{assistant_id:t}}),{data:b,isLoading:x}=S({...K({path:{assistant_id:t}}),enabled:u}),C=(b??[]).filter(e=>e.provider===n&&e.connected),{handleConnect:w,oauthInProgress:T,startOAuthPending:E}=Qe({assistantId:e,providerKey:n,displayName:r,managedAvailable:u,connectionsQueryKey:y,allConnections:b}),D={path:{assistant_id:t}},k=Se({onSuccess(e,t){I.success(`${r} account disconnected.`);let n=t.path.connection_id;xe(l,D,e=>e?.filter(e=>e.id!==n)),l.invalidateQueries({queryKey:y}),g(null)},onError(e){let t=me(e,void 0,`Failed to disconnect ${r} account.`);I.error(t),g(null)}});(0,Z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&c()};document.addEventListener(`keydown`,e);let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.removeEventListener(`keydown`,e),document.body.style.overflow=t}},[c]);let A=e=>{v(e)},j=()=>{let e=_;v(null),e&&(g(e.id),k.mutate({path:{assistant_id:t,connection_id:e.id}}))},M=i?`Configure ${r} OAuth for ${i}`:`Configure ${r} OAuth`;return(0,Q.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4`,children:[(0,Q.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`integration-modal-title`,className:`flex w-full max-w-[520px] flex-col overflow-hidden rounded-xl bg-white shadow-xl dark:bg-[var(--surface-lift)]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-[var(--border-base)] px-5 py-4 dark:border-[var(--border-base)]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(Y,{providerKey:n,displayName:r,logoUrl:o,size:32}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`h2`,{id:`integration-modal-title`,className:`text-title-small text-[var(--content-default)]`,children:[r,` OAuth`]}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:M})]})]}),(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(re,{}),"aria-label":`Close`,onClick:c})]}),(0,Q.jsxs)(`div`,{className:`space-y-4 px-5 py-4`,children:[s!==`gated`&&d&&(0,Q.jsxs)(`div`,{role:`tablist`,"aria-label":`OAuth mode`,className:`flex w-full rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-0.5 dark:border-[var(--border-base)] dark:bg-[var(--surface-base)]/40`,children:[(0,Q.jsx)(ot,{active:f===`managed`,onClick:()=>m(`managed`),children:`Managed`}),(0,Q.jsx)(ot,{active:f===`your-own`,onClick:()=>m(`your-own`),children:`Your Own`})]}),f===`managed`&&s!==`gated`?s===`disabled`?(0,Q.jsx)(He,{children:`Log in to the Vellum platform to manage OAuth connections.`}):(0,Q.jsx)($e,{displayName:r,providerKey:n,logoUrl:o,connections:C,connectionsLoading:x,startPending:E,oauthInProgress:T,disconnectingId:k.isPending?h:null,onConnect:w,onDisconnect:A,connectPresets:it(n)}):d?(0,Q.jsx)(nt,{assistantId:e,providerKey:n,displayName:r,logoUrl:o}):null]}),(0,Q.jsx)(`div`,{className:`flex justify-end border-t border-[var(--border-base)] px-5 py-3 dark:border-[var(--border-base)]`,children:(0,Q.jsx)(a,{variant:`outlined`,size:`compact`,onClick:c,children:`Confirm`})})]}),(0,Q.jsx)(O,{open:_!==null,title:`Disconnect ${r}?`,message:_?`Disconnect ${_.account_label??`${r} Account`}? You can reconnect later.`:``,confirmLabel:`Disconnect`,destructive:!0,onConfirm:j,onCancel:()=>v(null)})]})}function ot({active:e,onClick:t,children:n}){return(0,Q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e,onClick:t,className:`flex-1 cursor-pointer rounded-[5px] px-3 py-1.5 text-body-medium-default transition-colors ${e?`bg-white text-[var(--content-default)] shadow-sm dark:bg-[var(--surface-lift)] dark:text-[var(--content-default)]`:`text-[var(--content-secondary)] hover:text-[var(--content-default)] dark:text-[var(--content-disabled)] dark:hover:text-[var(--content-default)]`}`,children:n})}function st({platformAssistantId:e,providerKey:t,displayName:n,description:r,logoUrl:i,connection:o,platformGate:s,onConfigure:c}){let l=p(),u=!!o?.connected,[d,f]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(!1),g=ye(),_=Ce({path:{assistant_id:e}}),v={path:{assistant_id:e}},y=Se({onSuccess(e,t){I.success(`${n} account disconnected.`);let r=t.path.connection_id;xe(l,v,e=>e?.filter(e=>e.id!==r)),l.invalidateQueries({queryKey:_})},onError(e){let t=me(e,void 0,`Failed to disconnect ${n} account.`);I.error(t)}}),b=()=>{o?.id&&h(!0)};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(T.Root,{children:(0,Q.jsxs)(T.Body,{padding:`sm`,className:`flex items-center gap-4 px-4`,children:[(0,Q.jsx)(Y,{providerKey:t,displayName:n,logoUrl:i,size:32}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-title-small text-[var(--content-default)]`,children:n}),r&&(0,Q.jsx)(`p`,{className:`truncate text-body-medium-lighter text-[var(--content-tertiary)]`,children:r})]}),u&&s===`full`?(0,Q.jsx)(`div`,{className:`shrink-0`,children:(0,Q.jsx)(ct,{displayName:n,open:d,onOpenChange:f,onEditConnections:()=>{f(!1),c()},onDisable:()=>{f(!1),b()},disablePending:y.isPending,isMobile:g})}):(0,Q.jsx)(a,{variant:`primary`,onClick:c,className:`shrink-0`,children:`Enable`})]})}),(0,Q.jsx)(O,{open:m,title:`Disconnect ${n}?`,message:`Disconnect your ${n} account? You can reconnect it later.`,confirmLabel:`Disconnect`,destructive:!0,onConfirm:()=>{h(!1),o?.id&&y.mutate({path:{assistant_id:e,connection_id:o.id}})},onCancel:()=>h(!1)})]})}function ct({displayName:e,open:t,onOpenChange:n,onEditConnections:r,onDisable:i,disablePending:o,isMobile:s}){return s?(0,Q.jsxs)(E.Root,{open:t,onOpenChange:n,children:[(0,Q.jsx)(E.Trigger,{asChild:!0,children:(0,Q.jsx)(a,{variant:`outlined`,rightIcon:(0,Q.jsx)(q,{}),"aria-haspopup":`menu`,"aria-expanded":t,children:`Configure`})}),(0,Q.jsxs)(E.Content,{children:[(0,Q.jsx)(E.Header,{children:(0,Q.jsx)(E.Title,{children:e})}),(0,Q.jsxs)(E.Body,{children:[(0,Q.jsx)(D,{icon:W,label:`Edit connections`,onSelect:r}),(0,Q.jsx)(D,{icon:o?H:ze,label:`Disable`,onSelect:()=>{o||i()}})]})]})]}):(0,Q.jsxs)(A.Root,{open:t,onOpenChange:n,children:[(0,Q.jsx)(A.Trigger,{asChild:!0,children:(0,Q.jsx)(a,{variant:`outlined`,rightIcon:(0,Q.jsx)(q,{}),"aria-haspopup":`menu`,"aria-expanded":t,children:`Configure`})}),(0,Q.jsxs)(A.Content,{align:`end`,sideOffset:4,role:`menu`,className:`w-56 overflow-hidden p-0`,children:[(0,Q.jsx)(a,{type:`button`,role:`menuitem`,variant:`ghost`,onClick:r,className:`w-full justify-start rounded-none`,leftIcon:(0,Q.jsx)(W,{"aria-hidden":!0}),children:`Edit connections`}),(0,Q.jsx)(a,{type:`button`,role:`menuitem`,variant:`dangerGhost`,onClick:i,disabled:o,className:`w-full justify-start rounded-none`,leftIcon:o?(0,Q.jsx)(H,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(ze,{"aria-hidden":!0}),children:`Disable`})]})]})}var lt=[{value:`none`,label:`None`},{value:`oauth`,label:`OAuth`},{value:`bearer`,label:`Bearer Token`},{value:`api-key`,label:`API Key`}],ut=[{value:`sse`,label:`SSE`},{value:`streamable-http`,label:`Streamable HTTP`},{value:`stdio`,label:`Stdio (command)`}];function dt({open:e,onClose:t,onAdd:n,isPending:r}){let[i,o]=(0,Z.useState)(``),[s,c]=(0,Z.useState)(`sse`),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(`none`),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(`X-API-Key`),[x,S]=(0,Z.useState)(``),C=(0,Z.useCallback)(()=>{o(``),c(`sse`),u(``),f(``),m(``),g(`none`),v(``),b(`X-API-Key`),S(``)},[]),w=(0,Z.useCallback)(()=>{r||(C(),t())},[r,C,t]),T=(0,Z.useCallback)(()=>{let e=i.trim();if(!e)return;let t={name:e,transportType:s};if(s===`stdio`){let e=d.trim();if(!e)return;t.command=e;let n=p.trim();n&&(t.args=n.split(/\s+/))}else{let e=l.trim();if(!e)return;t.url=e,h===`bearer`&&_.trim()?t.headers={Authorization:`Bearer ${_.trim()}`}:h===`api-key`&&y.trim()&&x.trim()?t.headers={[y.trim()]:x.trim()}:h===`oauth`&&(t.autoAuth=!0)}n(t)},[i,s,l,d,p,h,_,y,x,n]),E=s===`stdio`,D=i.trim()&&(E?d.trim():l.trim());return(0,Q.jsx)(F.Root,{open:e,onOpenChange:e=>{e||w()},children:(0,Q.jsxs)(F.Content,{size:`md`,children:[(0,Q.jsxs)(F.Header,{children:[(0,Q.jsx)(F.Title,{icon:Xe,children:`Add MCP Server`}),(0,Q.jsx)(F.Description,{children:`Connect to a Model Context Protocol server to extend available tools.`})]}),(0,Q.jsx)(F.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-name`,children:`Server name`}),(0,Q.jsx)(j,{id:`mcp-name`,type:`text`,value:i,onChange:e=>o(e.target.value),placeholder:`my-server`,fullWidth:!0,autoFocus:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-transport`,children:`Transport`}),(0,Q.jsx)(`select`,{id:`mcp-transport`,value:s,onChange:e=>c(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:ut.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),E?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-command`,children:`Command`}),(0,Q.jsx)(j,{id:`mcp-command`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`npx -y @modelcontextprotocol/server-example`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-args`,children:`Arguments (space-separated)`}),(0,Q.jsx)(j,{id:`mcp-args`,type:`text`,value:p,onChange:e=>m(e.target.value),placeholder:`--port 3000`,fullWidth:!0})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-url`,children:`Server URL`}),(0,Q.jsx)(j,{id:`mcp-url`,type:`url`,value:l,onChange:e=>u(e.target.value),placeholder:`https://example.com/mcp`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-auth`,children:`Authentication`}),(0,Q.jsx)(`select`,{id:`mcp-auth`,value:h,onChange:e=>g(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:lt.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),h===`oauth`?(0,Q.jsx)(`p`,{className:`rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-3 py-2 text-body-small-default text-[var(--content-tertiary)]`,children:`OAuth credentials will be configured through a browser-based authorization flow after the server is added.`}):null,h===`bearer`?(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-bearer`,children:`Bearer token`}),(0,Q.jsx)(j,{id:`mcp-bearer`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:`tok_...`,fullWidth:!0})]}):null,h===`api-key`?(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-apikey-header`,children:`Header name`}),(0,Q.jsx)(j,{id:`mcp-apikey-header`,type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`X-API-Key`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-apikey-value`,children:`API key`}),(0,Q.jsx)(j,{id:`mcp-apikey-value`,type:`password`,value:x,onChange:e=>S(e.target.value),placeholder:`sk_...`,fullWidth:!0})]})]}):null]})]})}),(0,Q.jsxs)(F.Footer,{children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:w,disabled:r,children:`Cancel`}),(0,Q.jsx)(a,{variant:`primary`,onClick:T,disabled:!D||r,children:r?`Adding...`:`Add Server`})]})]})})}async function ft(e){let{data:t,response:n}=await G.get({url:`/v1/assistants/{assistant_id}/internal/mcp/list`,path:{assistant_id:e}});if(!n?.ok)throw Error(`Failed to fetch MCP servers: ${n?.status}`);return t}async function pt(e){let{data:t,response:n}=await G.get({url:`/v1/assistants/{assistant_id}/internal/mcp/tools-summary`,path:{assistant_id:e}});if(!n?.ok)throw Error(`Failed to fetch MCP tools summary: ${n?.status}`);return t}async function mt(e,t){let{response:n}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/update`,path:{assistant_id:e},body:t});if(!n?.ok)throw Error(`Failed to update MCP server: ${n?.status}`)}async function ht(e,t){let{response:n}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/add`,path:{assistant_id:e},body:t});if(!n?.ok)throw Error(`Failed to add MCP server: ${n?.status}`)}async function gt(e,t){let{response:n}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/remove`,path:{assistant_id:e},body:{name:t}});if(!n?.ok)throw Error(`Failed to remove MCP server: ${n?.status}`)}async function _t(e,t){let{data:n,response:r}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/start`,path:{assistant_id:e},body:{serverId:t}});if(!r?.ok)throw Error(`Failed to start MCP auth: ${r?.status}`);return n}async function vt(e,t){let{data:n,response:r}=await G.get({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/status/${encodeURIComponent(t)}`,path:{assistant_id:e}});if(!r?.ok)throw Error(`Failed to poll MCP auth status: ${r?.status}`);return n}async function yt(e,t){let{response:n}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/revoke`,path:{assistant_id:e},body:{serverId:t}});if(!n?.ok)throw Error(`Failed to revoke OAuth for ${t}: ${n?.status}`)}async function bt(e){let{response:t}=await G.post({url:`/v1/assistants/{assistant_id}/internal/mcp/reload`,path:{assistant_id:e},body:{}});if(!t?.ok)throw Error(`Failed to reload MCP servers: ${t?.status}`)}var xt={connected:{icon:B,label:`Connected`,className:`text-[var(--system-positive-strong)]`},"needs-auth":{icon:Ue,label:`Needs Auth`,className:`text-[var(--system-warning-strong)]`},disabled:{icon:Le,label:`Disabled`,className:`text-[var(--content-tertiary)]`}},St={icon:z,label:`Error`,className:`text-[var(--system-negative-strong)]`};function Ct({server:e,toolsSummary:t,onToggleEnabled:n,onRemove:r,onConfigure:i,onAuthenticate:o,onRevokeOAuth:s,isUpdating:c,isAuthenticating:l,isRevoking:u}){let[d,f]=(0,Z.useState)(!1),p=xt[e.status]??St,m=p.icon,h=(0,Z.useCallback)(t=>n(e.id,t),[n,e.id]),g=(0,Z.useCallback)(()=>r(e.id),[r,e.id]),_=(0,Z.useCallback)(()=>i(e.id),[i,e.id]),v=(0,Z.useCallback)(()=>o(e.id),[o,e.id]),y=(0,Z.useCallback)(()=>s(e.id),[s,e.id]),b=(0,Z.useCallback)(()=>f(e=>!e),[]);return(0,Q.jsx)(T.Root,{children:(0,Q.jsxs)(T.Body,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e.id}),(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-label-medium-default ${p.className}`,children:[(0,Q.jsx)(m,{className:`h-3.5 w-3.5`}),p.label]}),e.hasOAuth?(0,Q.jsx)(`span`,{className:`rounded-full bg-[var(--surface-lift)] px-2 py-0.5 text-label-small-default text-[var(--content-secondary)]`,children:`OAuth`}):null]}),(0,Q.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:e.transport.type}),t?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsxs)(`span`,{children:[t.toolCount,` `,t.toolCount===1?`tool`:`tools`]}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsxs)(`span`,{children:[`~`,t.estimatedTokens.toLocaleString(),` tokens`]})]}):null]})]})}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c||l?(0,Q.jsx)(H,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}):null,e.status===`needs-auth`&&e.transport.type!==`stdio`&&!e.hasOAuth?(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,leftIcon:(0,Q.jsx)(U,{}),onClick:v,disabled:l,children:l?`Authenticating...`:`Authenticate`}):null,e.hasOAuth?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,leftIcon:(0,Q.jsx)(te,{}),onClick:v,disabled:l,tooltip:`Re-authenticate OAuth`,children:`Re-auth`}),(0,Q.jsx)(a,{variant:`dangerGhost`,size:`compact`,leftIcon:(0,Q.jsx)(Re,{}),onClick:y,disabled:u,tooltip:`Revoke OAuth credentials`,children:u?`Revoking...`:`Revoke`})]}):null,(0,Q.jsx)(M,{checked:e.enabled,onChange:h,disabled:c,"aria-label":`${e.enabled?`Disable`:`Enable`} ${e.id}`}),(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,onClick:_,tooltip:`Configure`,children:`Configure`}),(0,Q.jsx)(a,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(J,{}),onClick:g,tooltip:`Remove server`,"aria-label":`Remove ${e.id}`})]})]}),t&&t.tools.length>0?(0,Q.jsxs)(`div`,{className:`mt-3 border-t border-[var(--border-base)] pt-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:b,className:`flex w-full cursor-pointer items-center gap-1 text-body-small-default text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:[d?(0,Q.jsx)(q,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(R,{className:`h-3.5 w-3.5`}),t.toolCount,` registered `,t.toolCount===1?`tool`:`tools`]}),d?(0,Q.jsx)(`div`,{className:`mt-2 max-h-60 overflow-y-auto`,children:t.tools.map(e=>(0,Q.jsx)(P,{title:e.name,subtitle:e.description||void 0,trailing:(0,Q.jsxs)(`span`,{className:`whitespace-nowrap text-body-small-default text-[var(--content-secondary)]`,children:[`~`,e.estimatedTokens.toLocaleString(),` tok`]})},e.name))}):null]}):null]})})}var wt=[{value:`none`,label:`None`},{value:`bearer`,label:`Bearer Token`},{value:`api-key`,label:`API Key`}],Tt=[`low`,`medium`,`high`];function Et({server:e,toolsSummary:t,onClose:n,onSave:r,isPending:i}){let[o,s]=(0,Z.useState)(`medium`),[c,l]=(0,Z.useState)(`none`),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(`X-API-Key`),[m,h]=(0,Z.useState)(``);(0,Z.useEffect)(()=>{e&&(s(e.defaultRiskLevel),l(e.authType),d(``),p(e.authHeaderName??`X-API-Key`),h(``))},[e]);let g=(0,Z.useCallback)(()=>{if(!e)return;let t=c!==e.authType,n=c===`bearer`&&u.trim()!==``,i=c===`api-key`&&f.trim()!==``&&m.trim()!==``,a=t||n||i,s;s=a?c===`none`?null:c===`bearer`&&u.trim()?{Authorization:`Bearer ${u.trim()}`}:c===`api-key`&&f.trim()&&m.trim()?{[f.trim()]:m.trim()}:void 0:void 0,r(e.id,{name:e.id,defaultRiskLevel:o,...s===void 0?{}:{headers:s}})},[e,o,c,u,f,m,r]),_=(0,Z.useCallback)(()=>{i||n()},[i,n]);return e?(0,Q.jsx)(F.Root,{open:!!e,onOpenChange:e=>{e||_()},children:(0,Q.jsxs)(F.Content,{size:`lg`,children:[(0,Q.jsxs)(F.Header,{children:[(0,Q.jsx)(F.Title,{icon:Xe,children:e.id}),(0,Q.jsxs)(F.Description,{children:[e.transport.type,` transport · `,e.status]})]}),(0,Q.jsx)(F.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-risk`,children:`Default risk level`}),(0,Q.jsx)(`select`,{id:`mcp-risk`,value:o,onChange:e=>s(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:Tt.map(e=>(0,Q.jsx)(`option`,{value:e,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),e.transport.type===`stdio`?null:(0,Q.jsxs)(Q.Fragment,{children:[e.hasOAuth?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-3 py-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Authentication`}),(0,Q.jsx)(`span`,{className:`rounded-full bg-[var(--surface-lift)] px-2 py-0.5 text-label-small-default text-[var(--content-default)]`,children:`OAuth`}),(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`— managed via OAuth flow`})]}):null,e.hasOAuth?null:(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-auth`,children:`Authentication`}),(0,Q.jsx)(`select`,{id:`mcp-detail-auth`,value:c,onChange:e=>l(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:wt.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),c===`bearer`&&!e.hasOAuth?(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-bearer`,children:`Bearer token`}),(0,Q.jsx)(j,{id:`mcp-detail-bearer`,type:`password`,value:u,onChange:e=>d(e.target.value),placeholder:e.hasStaticAuth&&e.authType===`bearer`?`•••••••• (leave blank to keep current)`:`tok_...`,fullWidth:!0})]}):null,c===`api-key`&&!e.hasOAuth?(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-apikey-header`,children:`Header name`}),(0,Q.jsx)(j,{id:`mcp-detail-apikey-header`,type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`X-API-Key`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-apikey-value`,children:`API key`}),(0,Q.jsx)(j,{id:`mcp-detail-apikey-value`,type:`password`,value:m,onChange:e=>h(e.target.value),placeholder:e.hasStaticAuth&&e.authType===`api-key`?`•••••••• (leave blank to keep current)`:`sk_...`,fullWidth:!0})]})]}):null]}),t&&t.tools.length>0?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`h3`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Registered tools (`,t.toolCount,`)`]}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Total estimated token overhead: ~`,t.estimatedTokens.toLocaleString(),` tokens`]}),(0,Q.jsx)(`div`,{className:`max-h-64 overflow-y-auto rounded-lg border border-[var(--border-base)]`,children:(0,Q.jsxs)(`table`,{className:`w-full text-body-small-default`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{className:`border-b border-[var(--border-base)] bg-[var(--surface-base)]`,children:[(0,Q.jsx)(`th`,{className:`px-3 py-2 text-left font-medium text-[var(--content-secondary)]`,children:`Tool`}),(0,Q.jsx)(`th`,{className:`px-3 py-2 text-left font-medium text-[var(--content-secondary)]`,children:`Description`}),(0,Q.jsx)(`th`,{className:`px-3 py-2 text-right font-medium text-[var(--content-secondary)]`,children:`Tokens`})]})}),(0,Q.jsx)(`tbody`,{children:t.tools.map(e=>(0,Q.jsxs)(`tr`,{className:`border-b border-[var(--border-base)] last:border-b-0`,children:[(0,Q.jsx)(`td`,{className:`px-3 py-2 font-medium text-[var(--content-default)]`,children:e.name}),(0,Q.jsx)(`td`,{className:`max-w-xs truncate px-3 py-2 text-[var(--content-tertiary)]`,children:e.description||`—`}),(0,Q.jsxs)(`td`,{className:`px-3 py-2 text-right text-[var(--content-tertiary)]`,children:[`~`,e.estimatedTokens.toLocaleString()]})]},e.name))})]})})]}):null]})}),(0,Q.jsxs)(F.Footer,{children:[(0,Q.jsx)(a,{variant:`ghost`,onClick:_,disabled:i,children:`Cancel`}),(0,Q.jsx)(a,{variant:`primary`,onClick:g,disabled:i,children:i?`Saving...`:`Save`})]})]})}):null}var Dt=`mcp-servers`,Ot=`mcp-tools-summary`,kt=`Help me set up an MCP server to extend you with external tools.`;function At(){let e=Ge(),t=p(),n=o(),r=be.use.mcpAddServer(),i=be.use.hasHydrated(),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(null),[d,f]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(new Set),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(null),[D,k]=(0,Z.useState)(null),{data:A,isLoading:j,isError:M}=S({queryKey:[Dt,e],queryFn:()=>ft(e)}),{data:N}=S({queryKey:[Ot,e],queryFn:()=>pt(e)}),P=(0,Z.useCallback)(()=>{t.invalidateQueries({queryKey:[Dt,e]}),t.invalidateQueries({queryKey:[Ot,e]})},[t,e]),F=(0,Z.useMemo)(()=>{let e=new Map;if(N)for(let t of N.servers)e.set(t.serverId,t);return e},[N]),L=(0,Z.useMemo)(()=>!l||!A?null:A.servers.find(e=>e.id===l)??null,[l,A]),ee=(0,Z.useCallback)(async(t,n)=>{h(e=>new Set(e).add(t));try{await mt(e,{name:t,enabled:n}),P()}catch{I.error(`Failed to ${n?`enable`:`disable`} ${t}`)}finally{h(e=>{let n=new Set(e);return n.delete(t),n})}},[e,P]),R=(0,Z.useCallback)(async()=>{if(d){y(!0);try{await gt(e,d),P(),I.success(`Removed ${d}`),f(null)}catch{I.error(`Failed to remove ${d}`)}finally{y(!1)}}},[d,e,P]),z=(0,Z.useCallback)(async t=>{E(t);let n;try{n=await _t(e,t)}catch{I.error(`Failed to start authentication for ${t}`),E(null);return}try{if(n.already_authenticated){I.success(`${t} is already authenticated`),P();return}window.open(n.auth_url,`_blank`,`noopener,noreferrer`);for(let n=0;n<60;n++){await new Promise(e=>setTimeout(e,3e3));let n=await vt(e,t);if(n.status===`complete`){I.success(`${t} authenticated successfully`),P();return}if(n.status===`error`){I.error(n.error??`Authentication failed for ${t}`);return}}I.error(`Authentication timed out for ${t}`)}catch{I.error(`Authentication polling failed for ${t}`)}finally{E(null),P()}},[e,P]),B=(0,Z.useCallback)(async t=>{k(t);try{await yt(e,t),P(),I.success(`OAuth credentials revoked for ${t}`)}catch{I.error(`Failed to revoke OAuth for ${t}`)}finally{k(null)}},[e,P]),V=(0,Z.useCallback)(async t=>{let n=t.autoAuth?window.open(`about:blank`,`_blank`,`noopener`):null;_(!0);try{await ht(e,t),P(),I.success(`Added ${t.name}`),c(!1)}catch{I.error(`Failed to add ${t.name}`),n?.close(),_(!1);return}if(_(!1),t.autoAuth){E(t.name);try{let r=await _t(e,t.name);if(r.already_authenticated){n?.close(),I.success(`${t.name} is already authenticated`),P();return}n?n.location.href=r.auth_url:window.open(r.auth_url,`_blank`,`noopener,noreferrer`);for(let n=0;n<60;n++){await new Promise(e=>setTimeout(e,3e3));let n=await vt(e,t.name);if(n.status===`complete`){I.success(`${t.name} authenticated successfully`),P();return}if(n.status===`error`){I.error(n.error??`Authentication failed for ${t.name}`);return}}I.error(`Authentication timed out for ${t.name}`)}catch{n?.close(),I.error(`Failed to start authentication for ${t.name}`)}finally{E(null),P()}}},[e,P]),U=(0,Z.useCallback)(async(t,n)=>{x(!0);try{await mt(e,n),P(),I.success(`Updated ${t}`),u(null)}catch{I.error(`Failed to update ${t}`)}finally{x(!1)}},[e,P]),W=(0,Z.useCallback)(async()=>{w(!0);try{await bt(e),P(),I.success(`MCP servers reloaded`)}catch{I.error(`Failed to reload MCP servers`)}finally{w(!1)}},[e,P]),ne=(0,Z.useCallback)(()=>{r?c(!0):Ae(n,{prompt:kt})},[r,n]),re=A?.servers??[];return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`text-title-small text-[var(--content-default)]`,children:`MCP Servers`}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Manage Model Context Protocol server connections and their registered tools.`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(te,{className:C?`animate-spin`:``}),onClick:W,disabled:C,tooltip:`Reload all servers`,"aria-label":`Reload MCP servers`}),r?(0,Q.jsx)(a,{variant:`primary`,size:`compact`,leftIcon:(0,Q.jsx)(X,{}),onClick:()=>c(!0),children:`Add Server`}):null]})]}),N?(0,Q.jsxs)(`div`,{className:`flex gap-4 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsxs)(`span`,{children:[N.totalToolCount,` total `,N.totalToolCount===1?`tool`:`tools`]}),(0,Q.jsxs)(`span`,{children:[`~`,N.totalEstimatedTokens.toLocaleString(),` total tokens`]})]}):null,j?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{children:`Loading MCP servers...`})]}):M?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Failed to load MCP servers. Check that an assistant is running.`}):re.length===0?(0,Q.jsxs)(`button`,{type:`button`,onClick:ne,disabled:!i,className:`flex w-full flex-col items-center gap-2 rounded-lg border border-dashed border-[var(--border-element)] px-4 py-12 text-center transition-colors hover:border-[var(--border-active)] hover:bg-[var(--surface-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:pointer-events-none`,children:[(0,Q.jsx)(Xe,{className:`h-6 w-6 text-[var(--content-disabled)]`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`No MCP Servers`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:r?`Add an MCP server to extend your assistant with external tools.`:`Chat with your assistant to set up an MCP server.`})]}):(0,Q.jsx)(`div`,{className:`space-y-2`,children:re.map(e=>(0,Q.jsx)(Ct,{server:e,toolsSummary:F.get(e.id),onToggleEnabled:ee,onRemove:f,onConfigure:u,onAuthenticate:z,onRevokeOAuth:B,isUpdating:m.has(e.id),isAuthenticating:T===e.id,isRevoking:D===e.id},e.id))}),r?(0,Q.jsx)(dt,{open:s,onClose:()=>c(!1),onAdd:V,isPending:g}):null,(0,Q.jsx)(Et,{server:L,toolsSummary:l?F.get(l):void 0,onClose:()=>u(null),onSave:U,isPending:b}),(0,Q.jsx)(O,{open:!!d,title:`Remove MCP Server`,message:`Are you sure you want to remove "${d}"? This will disconnect all tools provided by this server.`,confirmLabel:`Remove`,destructive:!0,isPending:v,onConfirm:R,onCancel:()=>f(null)})]})}function jt(){return(0,Q.jsx)(At,{})}function Mt(e,t){let[n,r]=(0,Z.useState)({platformAssistantId:null,isLoading:!1,error:null});return(0,Z.useEffect)(()=>{if(!t||!e){r({platformAssistantId:null,isLoading:!1,error:null});return}let n=!0;return r({platformAssistantId:null,isLoading:!0,error:null}),he(e).then(e=>{n&&r({platformAssistantId:e,isLoading:!1,error:null})}).catch(e=>{n&&r({platformAssistantId:null,isLoading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{n=!1}},[e,t]),n}var Nt=`vellum:integrations:bannerDismissed`,Pt=[{value:`all`,label:`All`},{value:`enabled`,label:`Enabled`},{value:`not-enabled`,label:`Not Enabled`}];function $(e,t){return e?.find(e=>e.provider===t)??null}function Ft(e){return e===`mcp`?`mcp`:`oauth`}function It(){let[e]=s(),i=o(),a=Fe(),[c,l]=(0,Z.useState)(null),[u,d]=(0,Z.useState)(!0),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(`all`),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!0),[b,x]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{y(t(Nt,`false`)===`true`)},[]);let C=()=>{y(!0),n(Nt,`true`)};(0,Z.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await _e();e&&t.ok&&l(t.data)}catch(e){r(e,{context:`integrations.getAssistant`})}finally{e&&d(!1)}})(),()=>{e=!1}},[]);let{platformAssistantId:w,isLoading:T}=Mt(c?.id,a===`full`),{data:E,isLoading:D,isError:O}=S({...de({path:{assistant_id:c?.id??``}}),select:e=>e.providers,enabled:!!c}),{data:M,isLoading:N}=S({...K({path:{assistant_id:w??``}}),enabled:!!w&&a===`full`});(0,Z.useEffect)(()=>{let t=e.get(`oauth_status`);if(!t)return;let n=e.get(`oauth_provider`),r=n?n.charAt(0).toUpperCase()+n.slice(1):null;if(t===`connected`)I.success(r?`${r} account connected successfully.`:`Account connected successfully.`);else if(t===`error`){let t=e.get(`oauth_code`)??`unknown`;I.error({denied:`Authorization was denied. Please try again.`,state_invalid:`Authorization state was invalid. Please try again.`,state_expired:`Authorization expired. Please try again.`,exchange_failed:`Failed to complete authorization. Please try again.`,identity_failed:`Failed to verify account identity. Please try again.`}[t]??(r?`Failed to connect ${r}.`:`Failed to connect. Please try again.`))}i(ve.settings.integrations,{replace:!0})},[e,i]);let P=(0,Z.useMemo)(()=>E?.filter(e=>e.supports_managed_mode)??[],[E]),F=(0,Z.useMemo)(()=>{let e=f.trim().toLowerCase(),t=P.filter(t=>{if(!e)return!0;let n=(t.display_name??t.provider_key).toLowerCase(),r=(t.description??``).toLowerCase();return n.includes(e)||r.includes(e)});return m!==`all`&&(t=t.filter(e=>{let t=!!$(M,e.provider_key)?.connected;return m===`enabled`?t:!t})),[...t].sort((e,t)=>{let n=!!$(M,e.provider_key)?.connected;if(n!==!!$(M,t.provider_key)?.connected)return n?-1:1;let r=(e.display_name??e.provider_key).toLowerCase(),i=(t.display_name??t.provider_key).toLowerCase();return r.localeCompare(i)})},[P,M,f,m]),L=u||D||N||T,ee=Pt.find(e=>e.value===m)?.label??`All`,R=(()=>{if(f.trim())return`No integrations matched`;switch(m){case`enabled`:return`No Enabled Integrations`;case`not-enabled`:return`All Integrations Are Enabled`;default:return`No Integrations Available`}})(),z=(()=>{if(f.trim())return`No integrations matched "${f.trim()}"`;switch(m){case`enabled`:return`Connect an integration to get started.`;case`not-enabled`:return`All available integrations have been connected.`;default:return`Check your connection and try again.`}})(),B=(0,Z.useMemo)(()=>b?P.find(e=>e.provider_key===b)??null:null,[P,b]);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[!v&&(0,Q.jsxs)(k,{tone:`info`,icon:(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`}),onDismiss:C,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default`,children:`Tip:`}),` You can enable integrations by mentioning them in chat.`]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(j,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`Search Integrations`,"aria-label":`Search integrations`,leftIcon:(0,Q.jsx)(je,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,wrapperClassName:`flex-1`}),(0,Q.jsxs)(A.Root,{open:g,onOpenChange:_,children:[(0,Q.jsx)(A.Trigger,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":g,className:`flex w-36 cursor-pointer items-center justify-between gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] transition-colors hover:bg-[var(--ghost-hover)]`,children:[(0,Q.jsx)(`span`,{children:ee}),(0,Q.jsx)(q,{className:`h-3.5 w-3.5`})]})}),(0,Q.jsx)(A.Content,{align:`end`,sideOffset:4,className:`w-36 overflow-hidden p-0`,children:(0,Q.jsx)(`div`,{role:`listbox`,children:Pt.map(e=>{let t=e.value===m;return(0,Q.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>{h(e.value),_(!1)},className:`flex w-full cursor-pointer items-center px-3 py-1.5 text-left hover:bg-[var(--ghost-hover)] ${t?`text-body-medium-default text-[var(--content-default)]`:`text-body-medium-lighter text-[var(--content-default)]`}`,children:e.label},e.value)})})})]})]}),(0,Q.jsx)(`div`,{children:L?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(H,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{children:`Loading...`})]}):O?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Failed to load integrations. Please try again.`}):c?F.length===0?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-lg border border-dashed border-[var(--border-element)] px-4 py-12 text-center`,children:[(0,Q.jsx)(je,{className:`h-6 w-6 text-[var(--content-disabled)]`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:R}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:z})]}):(0,Q.jsx)(`div`,{className:`space-y-2`,children:F.map(e=>(0,Q.jsx)(st,{platformAssistantId:w??c.id,providerKey:e.provider_key,displayName:e.display_name??e.provider_key,description:e.description,logoUrl:e.logo_url,connection:$(M,e.provider_key),platformGate:a,onConfigure:()=>x(e.provider_key)},e.provider_key))}):(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No assistant found. Hatch an assistant to connect integrations.`})}),B&&c&&(0,Q.jsx)(at,{assistantId:c.id,platformAssistantId:w??c.id,providerKey:B.provider_key,displayName:B.display_name??B.provider_key,description:B.description,logoUrl:B.logo_url,platformGate:a,onClose:()=>x(null)})]})}function Lt(){let[e,t]=s(),n=Ft(e.get(`tab`));return(0,Q.jsx)(`div`,{className:`space-y-6`,children:(0,Q.jsxs)(N.Root,{value:n,onValueChange:n=>{let r=Ft(n),i=new URLSearchParams(e);r===`mcp`?i.set(`tab`,`mcp`):i.delete(`tab`),t(i,{replace:!0})},children:[(0,Q.jsxs)(N.List,{children:[(0,Q.jsx)(N.Trigger,{value:`oauth`,children:`OAuth`}),(0,Q.jsx)(N.Trigger,{value:`mcp`,children:`MCP`})]}),(0,Q.jsx)(N.Panel,{value:`oauth`,className:`pt-4`,children:(0,Q.jsx)(Z.Suspense,{children:(0,Q.jsx)(It,{})})}),(0,Q.jsx)(N.Panel,{value:`mcp`,className:`pt-4`,children:(0,Q.jsx)(jt,{})})]})})}export{Lt as IntegrationsPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,p as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import"./src-CK6bncSg.js";import{n as a}from"./toast-2TW5tj1Y.js";import{t as o}from"./loader-circle-IIzBGiwm.js";import{n as s}from"./sdk.gen-1aYqVbMj.js";import{a as c}from"./routes-DVqkwUEe.js";import{a as l}from"./viewer-store-Dead64xY.js";import{_t as u,dt as d,r as f}from"./index-PRnvH2Y1.js";import{t as p}from"./use-active-assistant-id-C-RHQ9f6.js";var m=e(t(),1),h=i();function g(){let{appId:e}=r(),t=p(),i=n(),[g,_]=(0,m.useState)(null),[v,y]=(0,m.useState)(null),[b,x]=(0,m.useState)(!1),S=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(e)return S.current=e,_(null),y(null),s({path:{assistant_id:t,id:e},throwOnError:!0}).then(({data:n})=>{S.current===e&&(l(t,n.appId,n.html),_({appId:n.appId,dirName:n.dirName,name:n.name,html:n.html}))}).catch(t=>{S.current===e&&y(t instanceof Error?t.message:`Failed to open app`)}),()=>{S.current=null}},[t,e]);let C=(0,m.useCallback)(()=>{i(c.library.root)},[i]),w=f(),T=(0,m.useCallback)(()=>{g&&w(g)},[g,w]),E=(0,m.useCallback)(async()=>{if(!(!g||b)){x(!0);try{await u(t,g.appId,g.name),a.success(`App exported`,{description:`${g.name}.vellum`})}catch(e){a.error(`Failed to share app`,{description:e instanceof Error?e.message:void 0})}finally{x(!1)}}},[t,g,b]);return e?v?(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4`,children:[(0,h.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:v}),(0,h.jsx)(`button`,{type:`button`,onClick:C,className:`text-body-medium-default text-[var(--primary-base)] underline`,children:`Back to Library`})]}):g?(0,h.jsx)(d,{appId:g.appId,appName:g.name,html:g.html,assistantId:t,onClose:C,onEdit:T,onShare:E,isSharing:b,enableFullscreen:!0}):(0,h.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,h.jsx)(o,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}):null}export{g as LibraryDetailPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-BlMXrA59.js";var t=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
@@ -1 +0,0 @@
1
- import{n as e}from"./toast-2TW5tj1Y.js";function t(t){return n=>{e.error(n instanceof Error?n.message:t)}}export{t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-BibIM9x3.js";import{t as l}from"./input-C8kfrq9r.js";import{c as u,f as d,o as f}from"./local-mode-CvrNMtPF.js";import{t as p}from"./is-electron-C_ZTVhv8.js";import{n as m}from"./resolved-assistants-store-Cp4J43BK.js";import{t as h}from"./check-D6WkI0gF.js";import{t as g}from"./chevron-left-DghyKSEE.js";import{t as _}from"./loader-circle-IIzBGiwm.js";import{t as v}from"./pencil-DbB9rxpY.js";import{t as y}from"./x-KVxA2ZL0.js";import{$ as b,L as ee,M as te,Q as x,a as S,n as C,o as w}from"./auth-store-Kfxhs2oI.js";import{t as T}from"./client.gen-Cs6pCK0s.js";import{a as E}from"./routes-DVqkwUEe.js";import{o as D,r as O}from"./prefs-C_oq5G87.js";import{t as k}from"./client-feature-flag-store-C1kdd1EO.js";import{b as ne,r as A,yt as re}from"./react-query.gen-rp6Krcco.js";import{c as j,l as ie,n as ae,t as M}from"./prechat-B28Vzu55.js";import{n as oe,t as N}from"./browser-CKX_K5ev.js";import{t as P}from"./public-asset-Fx_laYnf.js";import{Ct as F,Et as I,J as L,Ni as se,Ot as ce,Tt as le,c as ue,d as de,kt as R,l as fe,q as z,s as pe,wt as B}from"./index-PRnvH2Y1.js";import{c as me,i as he,n as V,o as ge,r as _e,s as ve,t as H}from"./step-indicator-dots-CEVbsP8r.js";import{n as U,r as ye}from"./prechat-names-CRduluk-.js";var W=e(t(),1);async function be(){try{let{data:e,response:t}=await T.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=s(),xe=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function Se({onComplete:e}){function t(){fe(),pe(),e()}return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,G.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,G.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,G.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,G.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,G.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,G.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,G.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,G.jsx)(`ul`,{className:`space-y-4`,children:xe.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,G.jsx)(h,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,G.jsxs)(`span`,{className:`text-left`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,G.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var K=`google`,Ce=[{id:`gmail`,label:`Gmail`,logoSrc:P(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:P(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:P(`/images/integrations/google-drive.svg`)}];function we({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=p(),c=a(),l=te(),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(null),v=(0,W.useRef)(null),y=(0,W.useRef)(null),[b,x]=(0,W.useState)(!1),S=(0,W.useCallback)(()=>{d.current=null,x(!1)},[]),C=(0,W.useCallback)(()=>{h.current&&=(window.removeEventListener(`message`,h.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),w=(0,W.useCallback)(()=>{u.current&&!u.current.closed&&u.current.close(),u.current=null,f.current&&=(clearInterval(f.current),null),m.current&&=(clearTimeout(m.current),null)},[]),T=re();(0,W.useEffect)(()=>()=>{f.current&&clearInterval(f.current),m.current&&clearTimeout(m.current),u.current&&!u.current.closed&&u.current.close(),h.current&&window.removeEventListener(`message`,h.current),v.current&&window.removeEventListener(`storage`,v.current),y.current&&=(y.current(),null)},[]);let D=(0,W.useCallback)(async e=>{try{return(await c.fetchQuery({...ne({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===K&&e.connected)??null}catch{return null}},[c]),O=(0,W.useCallback)(async()=>{let e=d.current?.platformAssistantId;w(),S(),r((e?await D(e):null)?.scopes_granted??[])},[S,w,D,r]),k=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!d.current||e.requestId!==d.current.requestId||(e.oauthStatus===`connected`?O():(w(),S())))},[S,w,O]),A=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=F(e,window.location.origin,t.requestId);n&&k(n)},[k]),j=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=B(e,t.requestId);n&&(k(n),window.localStorage.removeItem(I(t.requestId)))},[k]);ce((0,W.useCallback)(e=>{let t=d.current;t&&e.requestId===t.requestId&&k({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[k]));let ie=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(C(),h.current=A,v.current=j,l){x(!0),(async()=>{let n;try{n=await ee(e)}catch{S();return}d.current={requestId:t,platformAssistantId:n},T.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){N(e.connect_url)},onError(){S()}})})(),window.addEventListener(`message`,A),window.addEventListener(`storage`,j),y.current&&y.current();let n=oe(()=>{let e=d.current;if(!e){n(),y.current=null;return}(async()=>{let t=await D(e.platformAssistantId);d.current&&(t?await O():S(),C(),n(),y.current=null)})()});y.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){C();return}u.current=n,x(!0),window.addEventListener(`message`,A),window.addEventListener(`storage`,j),f.current=setInterval(()=>{u.current&&u.current.closed&&d.current&&!m.current&&(m.current=setTimeout(async()=>{m.current=null;let e=d.current;if(!e)return;let t=window.localStorage.getItem(I(e.requestId));if(t)try{let n=JSON.parse(t);if(le(n,e.requestId)){k(n),window.localStorage.removeItem(I(e.requestId)),C();return}}catch{}let n=await D(e.platformAssistantId);d.current&&(n?await O():(w(),S()),C())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{w(),S(),C();return}d.current={requestId:t,platformAssistantId:n},T.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){u.current&&!u.current.closed?u.current.location.href=e.connect_url:d.current&&(w(),S(),C())},onError(){w(),S(),C()}})})()},[e,S,w,D,k,A,j,O,l,C,T]),ae=t||`your assistant`,M=t||`Your assistant`;return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${s?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${s?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${ae} can use Gmail, Calendar, and Drive with your permission.`}),(0,G.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:Ce.map(e=>(0,G.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,G.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,G.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${M} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,G.jsxs)(`div`,{className:`${s?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:ie,disabled:b||T.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:b||T.isPending?(0,G.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsx)(_,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:b||T.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Te({userName:e,assistantName:t,selectedGroupId:r,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:u,onSkip:d}){let f=p();return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,G.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:U.map(e=>(0,G.jsx)(Ee,{group:e,isActive:r===e.id,onToggle:()=>s(r===e.id?null:e.id)},e.id))})]})]}),(0,G.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function Ee({group:e,isActive:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,G.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function De({userName:e,assistantName:t,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:u,totalSteps:d}){return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,G.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(g,{}),onClick:o,"aria-label":`Back`}):(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(H,{current:u,total:d})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var Oe=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:P(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:P(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:P(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:P(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:P(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:P(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:P(`/images/prior-assistants/copilot.svg`)}];function ke({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>q(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(J(e));(0,W.useEffect)(()=>{let t=J(e);if(t===m.current)return;let n=q(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}Ae(n,e)||(m.current=J(n),t(n))},[s]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},_=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,G.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Oe.map(t=>(0,G.jsx)(je,{assistant:t,selected:e.has(t.id),onToggle:()=>h(t.id)},t.id)),d?null:(0,G.jsx)(Me,{onClick:()=>f(!0)})]}),d?(0,G.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(v,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(l,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple assistants with commas`,fullWidth:!0}),_.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function Ae(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function q(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function je({assistant:e,selected:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Ne,{assistant:e,size:32}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Me({onClick:e}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(se,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ne({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Pe({selectedTasks:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,G.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:z.map(t=>{let n=L[t.iconKey],r=e.has(t.id);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,G.jsx)(n,{className:`h-4 w-4`}):null}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,G.jsx)(h,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Fe=new Set([`gmail`,`google-calendar`,`google-drive`]),Ie=[{id:`gmail`,label:`Gmail`,logoSrc:P(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:P(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:P(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:P(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:P(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:P(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:P(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:P(`/images/integrations/github.svg`),logoSrcDark:P(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:P(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:P(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:P(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:P(`/images/integrations/apple-notes.svg`)}];function Le(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>Y(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(X(e));(0,W.useEffect)(()=>{let t=X(e);if(t===m.current)return;let n=Y(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}ze(n,e)||(m.current=X(n),t(n))},[s]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},_=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${r?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[r?(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),r?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,G.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Ie.map(t=>(0,G.jsx)(Z,{tool:t,selected:e.has(t.id),onToggle:()=>h(t.id),electron:o},t.id)),d?null:(0,G.jsx)(Q,{onClick:()=>f(!0),electron:o})]}),d?(0,G.jsx)(c,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(v,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(l,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple tools with commas`,fullWidth:!0}),_.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function ze(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function X(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Z({tool:e,selected:t,onToggle:n,electron:r}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)($,{tool:e,size:32}),(0,G.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Q({onClick:e,electron:t}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(se,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function $({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Be({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,G.jsx)(R,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(g,{}),onClick:r,"aria-label":`Back`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(H,{current:o,total:s})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,G.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,G.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:U.map(n=>{let r=e===n.id;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,G.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,G.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function Ve(e){let[t,n]=(0,W.useState)(()=>(e??``).trim()),r=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,W.useCallback)(e=>{r.current=!0,n(e)},[])}}var He=[`gmail`,`google-calendar`,`google-drive`],Ue=`experiment-activation-flow-2026-06-03`,We=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ge(e,t,n){return t?.initialMessage?t.initialMessage:n?ae(e):M}function Ke(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...He]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Le([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=Ue,i.bootstrapTemplate=We);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Le([...e.selectedPriorAssistants])),i.initialMessage=Ge(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function qe(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Je(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:V.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:V.controlWorkType,enabled:!t},{id:`tools`,funnelStep:V.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:V.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?V.gmailConnect:V.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:V.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Ye(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Xe=`1`;function Ze(e){return e===`nativeVibe`||e===Xe?`nativeVibe`:null}function Qe(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function et(){let e=r(),t=te(),n=D()&&O();return(0,W.useEffect)(()=>{!n&&!t&&e(E.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function tt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,W.useState)(()=>t?`nativeName`:`name`),a=(0,W.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,W.useLayoutEffect)(()=>{if(n)try{let e=Ze(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,W.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,W.useCallback)(()=>{a(null)},[a])}}var nt=3;function rt(){let e=u();return e?.cloud===`vellum`?e.assistantId:f()[0]?.assistantId??null}function it(){let e=r(),[t]=i(),n=t.get(`preview`)===`true`,a=C.use.user(),s=S(),c=w(),l=a?.id??null,u=a?.firstName??``,f=a?.lastName??``,p=te(),h=m.use.activeAssistantId(),g=d(),_=de()&&!ue(),v=k.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(k.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=k.use.selfIntroGreeting(),T=ge(v),D=ve()??T,O=D===_e.paredDown,ne=g?rt():null,re=et(),{currentStep:ae,setCurrentStep:M,clearPersistedStep:oe}=tt(l,p),N=C.use.platformSession(),P=b(N),[F,I]=(0,W.useState)(()=>new Set),[L,se]=(0,W.useState)(()=>new Set),[ce,le]=(0,W.useState)(()=>new Set),{value:R,onChange:fe}=Ve(g&&!P?``:u||f),[z,pe]=(0,W.useState)(null),[B]=(0,W.useState)(()=>ye()),[V,H]=(0,W.useState)(``),[U,xe]=(0,W.useState)(!1),[K,Ce]=(0,W.useState)([]),{data:Ee}=o({...A(),enabled:!c&&s&&(!g||P)}),{data:Oe,isLoading:Ae}=o({queryKey:[`onboarding-recipe`,l],queryFn:be,enabled:!c&&s&&!p&&!g,staleTime:1/0}),q=Oe??null,J=Ee?.id??h??ne,je=qe({localMode:g,platformSession:N,hasCachedPlatformAssistant:ne!==null}),Me=je,Ne=je,Ie=async()=>{await x.checkAssistant(),e(`${E.assistant}?onboarding=1`,{replace:!0})};function Le(e,t=D){n||he(e,{userId:l,variant:me(t)})}let ze=[...F].some(e=>Fe.has(e)),Y=p?Ye():Je({paredDown:O,canOfferPriorAssistants:Ne,canOfferGoogleStep:n?!1:Me,hasGoogleTool:ze,showIOSAppStep:_});function X(t){if(n){e(-1);return}ie(Ke({mode:p?`native`:O?`paredDown`:`control`,recipe:p?null:q,selectedTools:F,selectedTasks:L,selectedPriorAssistants:t?.selectedPriorAssistants??ce,tone:z??q?.tone??`grounded`,userName:R,assistantName:V,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:U,googleScopes:K,connectedScopes:t?.connectedScopes}));let r=V.trim();r&&j(r),p?(oe(),e(E.onboarding.privacy)):(x.markExpectingFirstMessage(),Ie())}let Z=(e,t)=>{e.funnelStep&&Le(e.funnelStep);let n=Qe(Y,e.id);n?M(n):X(t)},Q=e=>{let t=$e(Y,e.id);t&&M(t)};if(!re||Ae)return null;let $=Y.find(e=>e.id===ae)??Y[0];return $?$.id===`nativeName`?(0,G.jsx)(De,{userName:R,assistantName:V,displayedAssistantNames:B,onUserNameChange:fe,onAssistantNameChange:H,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:nt}):$.id===`nativeVibe`?(0,G.jsx)(Be,{selectedGroupId:z,onGroupChange:pe,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:nt}):$.id===`name`?(0,G.jsx)(Te,{userName:R,assistantName:V,selectedGroupId:z,displayedAssistantNames:B,onUserNameChange:fe,onAssistantNameChange:H,onGroupChange:pe,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:L,onChange:se,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:F,onChange:I,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(ke,{selectedAssistants:ce,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;le(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(we,{assistantId:J,assistantName:V,onConnect:e=>{xe(!0),Ce(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Se,{onComplete:()=>Z($)}):null:null}function at(){return(0,G.jsx)(it,{})}export{at as PreChatRoute};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{f as o}from"./local-mode-CvrNMtPF.js";import{t as s}from"./is-electron-C_ZTVhv8.js";import{M as c,d as l,i as u,n as d}from"./auth-store-Kfxhs2oI.js";import{a as f}from"./routes-DVqkwUEe.js";import{d as p,f as m,l as h,u as g}from"./prefs-C_oq5G87.js";import{t as _}from"./client-feature-flag-store-C1kdd1EO.js";import{kt as v}from"./index-PRnvH2Y1.js";import{a as y,c as b,i as x,n as S,o as C,t as w}from"./step-indicator-dots-CEVbsP8r.js";import{n as T,t as E}from"./consent-controls-BSZV4rW3.js";var D=e(t(),1);function O({researchOnboardingEnabled:e,isNative:t,isLocalMode:n}){return e&&!t&&!n?f.onboarding.research:f.onboarding.hatching}var k=a();function A(){let e=r(),[t]=i(),a=d.use.user()?.id??null,A=s(),j=c(),M=_.use.stringFlags().preChatOnboardingExperiment20260606??`control`,N=_.use.researchOnboarding(),P=C(M),[F,I]=g(),[L,R]=p(),[z,B]=m(),[V,H]=h(),U=u();(0,D.useEffect)(()=>{j||y()},[j]);let W=t.get(`preview`)===`true`,G=(0,D.useCallback)(e=>{},[]),K=W?G:I,q=W?G:R,J=W?G:B,Y=W?G:H,X=(0,D.useCallback)(()=>{if(W){e(`${f.onboarding.prechat}?preview=true`);return}if(l({userId:a,tos:z,privacy:V,shareAnalytics:F,shareDiagnostics:L,hasPlatformSession:U}),!j){let e=b(P);x(S.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${O({researchOnboardingEnabled:N,isNative:j,isLocalMode:o()})}${i?`?${i}`:``}`)},[V,U,j,W,e,P,N,t,F,L,z,a]);return(0,k.jsx)(v,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,k.jsx)(T,{electron:A,shareAnalytics:F,shareDiagnostics:L,onShareAnalyticsChange:K,onShareDiagnosticsChange:q,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:V,tosAccepted:z,onPrivacyChange:Y,onTosChange:J,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!z||!V,onClick:X,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n,r}from"./chunk-jRWAZmH_.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{n as o,r as s,t as c}from"./reduced-motion-DYlLlcUm.js";var l=a(),u=n(i(),1),d=(0,u.createContext)({});function f(e){let t=(0,u.useRef)(null);return t.current===null&&(t.current=e()),t.current}var p=typeof window<`u`?u.useLayoutEffect:u.useEffect,m=(0,u.createContext)(null);function h(e,t){e.indexOf(t)===-1&&e.push(t)}function g(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var _=(e,t,n)=>n>t?t:n<e?e:n,v=()=>{},y=()=>{},b={},x=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),S=e=>typeof e==`object`&&!!e,C=e=>/^0[^.\s]+$/u.test(e);function ee(e){let t;return()=>(t===void 0&&(t=e()),t)}var w=e=>e,T=(...e)=>e.reduce((e,t)=>n=>t(e(n))),E=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},te=class{constructor(){this.subscriptions=[]}add(e){return h(this.subscriptions,e),()=>g(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},D=e=>e*1e3,O=e=>e/1e3,ne=(e,t)=>t?1e3/t*e:0,re=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ie=1e-7,ae=12;function oe(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=re(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>ie&&++s<ae);return o}function se(e,t,n,r){if(e===t&&n===r)return w;let i=t=>oe(t,0,1,e,n);return e=>e===0||e===1?e:re(i(e),t,r)}var ce=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,le=e=>t=>1-e(1-t),ue=se(.33,1.53,.69,.99),de=le(ue),fe=ce(de),pe=e=>e>=1?1:(e*=2)<1?.5*de(e):.5*(2-2**(-10*(e-1))),me=e=>1-Math.sin(Math.acos(e)),he=le(me),ge=ce(me),_e=se(.42,0,1,1),ve=se(0,0,.58,1),ye=se(.42,0,.58,1),be=e=>Array.isArray(e)&&typeof e[0]!=`number`,xe=e=>Array.isArray(e)&&typeof e[0]==`number`,Se={linear:w,easeIn:_e,easeInOut:ye,easeOut:ve,circIn:me,circInOut:ge,circOut:he,backIn:de,backInOut:fe,backOut:ue,anticipate:pe},Ce=e=>typeof e==`string`,we=e=>{if(xe(e)){e.length;let[t,n,r,i]=e;return se(t,n,r,i)}else if(Ce(e))return Se[e],`${e}`,Se[e];return e},Te=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],k={value:null,addProjectionMetrics:null};function Ee(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&k.value&&k.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var De=40;function Oe(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Te.reduce((e,n)=>(e[n]=Ee(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=b.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,De),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Te.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Te.length;t++)o[Te[t]].cancel(e)},state:i,steps:o}}var{schedule:A,cancel:j,state:M,steps:ke}=Oe(typeof requestAnimationFrame<`u`?requestAnimationFrame:w,!0),Ae;function je(){Ae=void 0}var N={now:()=>(Ae===void 0&&N.set(M.isProcessing||b.useManualTiming?M.timestamp:performance.now()),Ae),set:e=>{Ae=e,queueMicrotask(je)}},Me={layout:0,mainThread:0,waapi:0},Ne=e=>t=>typeof t==`string`&&t.startsWith(e),Pe=Ne(`--`),Fe=Ne(`var(--`),Ie=e=>Fe(e)?Le.test(e.split(`/*`)[0].trim()):!1,Le=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Re(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var ze={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Be={...ze,transform:e=>_(0,1,e)},Ve={...ze,default:1},He=e=>Math.round(e*1e5)/1e5,Ue=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function We(e){return e==null}var Ge=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ke=(e,t)=>n=>!!(typeof n==`string`&&Ge.test(n)&&n.startsWith(e)||t&&!We(n)&&Object.prototype.hasOwnProperty.call(n,t)),qe=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Ue);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Je=e=>_(0,255,e),Ye={...ze,transform:e=>Math.round(Je(e))},Xe={test:Ke(`rgb`,`red`),parse:qe(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ye.transform(e)+`, `+Ye.transform(t)+`, `+Ye.transform(n)+`, `+He(Be.transform(r))+`)`};function Ze(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Qe={test:Ke(`#`),parse:Ze,transform:Xe.transform},$e=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),P=$e(`deg`),F=$e(`%`),I=$e(`px`),et=$e(`vh`),tt=$e(`vw`),nt={...F,parse:e=>F.parse(e)/100,transform:e=>F.transform(e*100)},rt={test:Ke(`hsl`,`hue`),parse:qe(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+F.transform(He(t))+`, `+F.transform(He(n))+`, `+He(Be.transform(r))+`)`},L={test:e=>Xe.test(e)||Qe.test(e)||rt.test(e),parse:e=>Xe.test(e)?Xe.parse(e):rt.test(e)?rt.parse(e):Qe.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Xe.transform(e):rt.transform(e),getAnimatableNone:e=>{let t=L.parse(e);return t.alpha=0,L.transform(t)}},it=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function at(e){return isNaN(e)&&typeof e==`string`&&(e.match(Ue)?.length||0)+(e.match(it)?.length||0)>0}var ot=`number`,st=`color`,ct=`var`,lt=`var(`,ut="${}",dt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ft(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(dt,e=>(L.test(e)?(r.color.push(a),i.push(st),n.push(L.parse(e))):e.startsWith(lt)?(r.var.push(a),i.push(ct),n.push(e)):(r.number.push(a),i.push(ot),n.push(parseFloat(e))),++a,ut)).split(ut),indexes:r,types:i}}function pt(e){return ft(e).values}function mt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===ot?i+=He(r[a]):e===st?i+=L.transform(r[a]):i+=r[a]}return i}}function ht(e){return mt(ft(e))}var gt=e=>typeof e==`number`?0:L.test(e)?L.getAnimatableNone(e):e,_t=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:gt(e);function vt(e){let t=ft(e);return mt(t)(t.values.map((e,n)=>_t(e,t.split[n])))}var R={test:at,parse:pt,createTransformer:ht,getAnimatableNone:vt};function yt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function bt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=yt(s,r,e+1/3),a=yt(s,r,e),o=yt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function xt(e,t){return n=>n>0?t:e}var z=(e,t,n)=>e+(t-e)*n,St=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Ct=[Qe,Xe,rt],wt=e=>Ct.find(t=>t.test(e));function Tt(e){let t=wt(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===rt&&(n=bt(n)),n}var Et=(e,t)=>{let n=Tt(e),r=Tt(t);if(!n||!r)return xt(e,t);let i={...n};return e=>(i.red=St(n.red,r.red,e),i.green=St(n.green,r.green,e),i.blue=St(n.blue,r.blue,e),i.alpha=z(n.alpha,r.alpha,e),Xe.transform(i))},Dt=new Set([`none`,`hidden`]);function Ot(e,t){return Dt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kt(e,t){return n=>z(e,t,n)}function At(e){return typeof e==`number`?kt:typeof e==`string`?Ie(e)?xt:L.test(e)?Et:Pt:Array.isArray(e)?jt:typeof e==`object`?L.test(e)?Et:Mt:xt}function jt(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>At(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Mt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=At(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Nt(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Pt=(e,t)=>{let n=R.createTransformer(t),r=ft(e),i=ft(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Dt.has(e)&&!i.values.length||Dt.has(t)&&!r.values.length?Ot(e,t):T(jt(Nt(r,i),i.values),n):(`${e}${t}`,xt(e,t))};function Ft(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?z(e,t,n):At(e)(e,t)}var It=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>A.update(t,e),stop:()=>j(t),now:()=>M.isProcessing?M.timestamp:N.now()}},Lt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Rt=2e4;function zt(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Bt(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(zt(r),Rt);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:O(i)}}var B={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Vt(e,t){return e*Math.sqrt(1-t*t)}var Ht=12;function Ut(e,t,n){let r=n;for(let n=1;n<Ht;n++)r-=e(r)/t(r);return r}var Wt=.001;function Gt({duration:e=B.duration,bounce:t=B.bounce,velocity:n=B.velocity,mass:r=B.mass}){let i,a;B.maxDuration;let o=1-t;o=_(B.minDamping,B.maxDamping,o),e=_(B.minDuration,B.maxDuration,O(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Vt(t,o),c=Math.exp(-i);return Wt-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Vt(t**2,o);return(-i(t)+Wt>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-Wt+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Ut(i,a,s);if(e=D(e),isNaN(c))return{stiffness:B.stiffness,damping:B.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Kt=[`duration`,`bounce`],qt=[`stiffness`,`damping`,`mass`];function Jt(e,t){return t.some(t=>e[t]!==void 0)}function Yt(e){let t={velocity:B.velocity,stiffness:B.stiffness,damping:B.damping,mass:B.mass,isResolvedFromDuration:!1,...e};if(!Jt(e,qt)&&Jt(e,Kt))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*_(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:B.mass,stiffness:i,damping:a}}else{let n=Gt({...e,velocity:0});t={...t,...n,mass:B.mass},t.isResolvedFromDuration=!0}return t}function Xt(e=B.visualDuration,t=B.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Yt({...n,velocity:-O(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=O(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?B.restSpeed.granular:B.restSpeed.default,i||=v?B.restDelta.granular:B.restDelta.default;let y,b,x,S,C,ee;if(h<1)x=Vt(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,ee=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+ee*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let w={calculatedDuration:p&&d||null,velocity:e=>D(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=D(t*(C*n+ee*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=D(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(zt(w),Rt),t=Lt(t=>w.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return w}Xt.applyToOptions=e=>{let t=Bt(e,100,Xt);return e.ease=t.ease,e.duration=D(t.duration),e.type=`keyframes`,e};var Zt=5;function Qt(e,t,n){let r=Math.max(t-Zt,0);return ne(n-e(r),t-r)}function $t({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Xt({keyframes:[f.value,m(f.value)],velocity:Qt(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function en(e,t,n){let r=[],i=n||b.mix||Ft,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=T(Array.isArray(t)?t[n]||w:t,a)),r.push(a)}return r}function tn(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=en(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=E(e[r],e[r+1],n);return s[r](i)};return n?t=>l(_(e[0],e[a-1],t)):l}function nn(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=E(0,t,r);e.push(z(n,1,i))}}function rn(e){let t=[0];return nn(t,e.length-1),t}function an(e,t){return e.map(e=>e*t)}function on(e,t){return e.map(()=>t||ye).splice(0,e.length-1)}function sn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=be(r)?r.map(we):we(r),a={done:!1,value:t[0]},o=tn(an(n&&n.length===t.length?n:rn(t),e),t,{ease:Array.isArray(i)?i:on(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var cn=e=>e!==null;function ln(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(cn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var un={decay:$t,inertia:$t,tween:sn,keyframes:sn,spring:Xt};function dn(e){typeof e.type==`string`&&(e.type=un[e.type])}var fn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},pn=e=>e/100,mn=class extends fn{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},Me.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;dn(e);let{type:t=sn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||sn;s!==sn&&typeof o[0]!=`number`&&(this.mixKeyframes=T(pn,Ft(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=zt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let y=this.currentTime,b=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(b=a)),y=_(0,1,n)*o}let x;v?(this.delayState.value=l[0],x=this.delayState):x=b.next(y),i&&!v&&(x.value=i(x.value));let{done:S}=x;!v&&s!==null&&(S=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let C=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&S);return C&&p!==$t&&(x.value=ln(l,this.options,h,this.speed)),m&&m(x.value),C&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return O(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+O(e)}get time(){return O(this.currentTime)}set time(e){e=D(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Qt(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=O(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=It,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(N.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,Me.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function hn(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var V=e=>e*180/Math.PI,gn=e=>vn(V(Math.atan2(e[1],e[0]))),_n={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gn,rotateZ:gn,skewX:e=>V(Math.atan(e[1])),skewY:e=>V(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vn=e=>(e%=360,e<0&&(e+=360),e),yn=gn,bn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Sn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bn,scaleY:xn,scale:e=>(bn(e)+xn(e))/2,rotateX:e=>vn(V(Math.atan2(e[6],e[5]))),rotateY:e=>vn(V(Math.atan2(-e[2],e[0]))),rotateZ:yn,rotate:yn,skewX:e=>V(Math.atan(e[4])),skewY:e=>V(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Cn(e){return+!!e.includes(`scale`)}function wn(e,t){if(!e||e===`none`)return Cn(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Sn,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_n,i=t}if(!i)return Cn(t);let a=r[t],o=i[1].split(`,`).map(En);return typeof a==`function`?a(o):o[a]}var Tn=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wn(n,t)};function En(e){return parseFloat(e.trim())}var Dn=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],On=new Set([...Dn,`pathRotation`]),kn=e=>e===ze||e===I,An=new Set([`x`,`y`,`z`]),jn=Dn.filter(e=>!An.has(e));function Mn(e){let t=[];return jn.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var H={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>wn(t,`x`),y:(e,{transform:t})=>wn(t,`y`)};H.translateX=H.x,H.translateY=H.y;var U=new Set,Nn=!1,Pn=!1,Fn=!1;function In(){if(Pn){let e=Array.from(U).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Mn(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Pn=!1,Nn=!1,U.forEach(e=>e.complete(Fn)),U.clear()}function Ln(){U.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Pn=!0)})}function Rn(){Fn=!0,Ln(),In(),Fn=!1}var zn=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(U.add(this),Nn||(Nn=!0,A.read(Ln),A.resolveKeyframes(In))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}hn(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),U.delete(this)}cancel(){this.state===`scheduled`&&(U.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Bn=e=>e.startsWith(`--`);function Vn(e,t,n){Bn(t)?e.style.setProperty(t,n):e.style[t]=n}var Hn={};function Un(e,t){let n=ee(e);return()=>Hn[t]??n()}var Wn=Un(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Gn=Un(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Kn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,qn={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Kn([0,.65,.55,1]),circOut:Kn([.55,0,1,.45]),backIn:Kn([.31,.01,.66,-.59]),backOut:Kn([.33,1.53,.69,.99])};function Jn(e,t){if(e)return typeof e==`function`?Gn()?Lt(e,t):`ease-out`:xe(e)?Kn(e):Array.isArray(e)?e.map(e=>Jn(e,t)||qn.easeOut):qn[e]}function Yn(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Jn(s,i);Array.isArray(d)&&(u.easing=d),k.value&&Me.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return k.value&&p.finished.finally(()=>{Me.waapi--}),p}function Xn(e){return typeof e==`function`&&`applyToOptions`in e}function Zn({type:e,...t}){return Xn(e)&&Gn()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Qn=class extends fn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Zn(e);this.animation=Yn(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=ln(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Vn(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return O(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+O(e)}get time(){return O(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=D(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Wn()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),w):r(this)}},$n={anticipate:pe,backInOut:fe,circInOut:ge};function er(e){return e in $n}function tr(e){typeof e.ease==`string`&&er(e.ease)&&(e.ease=$n[e.ease])}var nr=10,rr=class extends Qn{constructor(e){tr(e),dn(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new mn({...a,autoplay:!1}),s=Math.max(nr,N.now()-this.startTime),c=_(0,nr,s-nr),l=o.sample(s).value,{name:u}=this.options;i&&u&&Vn(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},ir=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(R.test(e)||e===`0`)&&!e.startsWith(`url(`));function ar(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function or(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=ir(i,t),s=ir(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:ar(e)||(n===`spring`||Xn(n))&&r}function sr(e){e.duration=0,e.type=`keyframes`}var cr=new Set([`opacity`,`clipPath`,`filter`,`transform`]),lr=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ur(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&lr.test(e[t]))return!0;return!1}var dr=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),fr=ee(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function pr(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return fr()&&n&&(cr.has(n)||dr.has(n)&&ur(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var mr=40,hr=class extends fn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||zn;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=N.now();let u=!0;or(e,i,a,o)||(u=!1,(b.instantAnimations||!s)&&l?.(ln(e,n,t)),e[0]=e[e.length-1],sr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>mr?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&pr(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new rr({...d,element:p})}catch{m=new mn(d)}else m=new mn(d);m.finished.then(()=>{this.notifyFinished()}).catch(w),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Rn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function gr(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var _r=30,vr=e=>!isNaN(parseFloat(e)),yr={current:void 0},br=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=N.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=vr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new te);let n=this.events[e].add(t);return e===`change`?()=>{n(),A.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return yr.current&&yr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>_r)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,_r);return ne(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function W(e,t){return new br(e,t)}function xr(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Sr(e,t){let n=e?.[t]??e?.default??e;return n===e?n:xr(n,e)}var Cr={type:`spring`,stiffness:500,damping:25,restSpeed:10},wr=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Tr={type:`keyframes`,duration:.8},Er={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Dr=(e,{keyframes:t})=>t.length>2?Tr:On.has(e)?e.startsWith(`scale`)?wr(t[1]):Cr:Er,Or=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function kr(e){for(let t in e)if(!Or.has(t))return!0;return!1}var Ar=(e,t,n,r={},i,a)=>o=>{let s=Sr(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=D(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};kr(s)||Object.assign(u,Dr(e,u)),u.duration&&=D(u.duration),u.repeatDelay&&=D(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(sr(u),u.delay===0&&(d=!0)),(b.instantAnimations||b.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,sr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=ln(u.keyframes,s);if(e!==void 0){A.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new mn(u):new hr(u)},jr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Mr(e){let t=jr.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Nr(e,t,n=1){`${e}`;let[r,i]=Mr(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return x(e)?parseFloat(e):e}return Ie(i)?Nr(i,t,n+1):i}function Pr(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Fr(e,t,n,r){if(typeof t==`function`){let[i,a]=Pr(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Pr(r);t=t(n===void 0?e.custom:n,i,a)}return t}function G(e,t,n){let r=e.getProps();return Fr(r,t,n===void 0?r.custom:n,e)}var Ir=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Dn]),Lr=e=>Array.isArray(e);function Rr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,W(n))}function zr(e){return Lr(e)?e[e.length-1]||0:e}function Br(e,t){let{transitionEnd:n={},transition:r={},...i}=G(e,t)||{};i={...i,...n};for(let t in i)Rr(e,t,zr(i[t]))}var K=e=>!!(e&&e.getVelocity);function Vr(e){return!!(K(e)&&e.add)}function Hr(e,t){let n=e.getValue(`willChange`);if(Vr(n))return n.add(t);if(!n&&b.WillChange){let n=new b.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Ur(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var Wr=`data-`+Ur(`framerAppearId`);function Gr(e){return e.props[Wr]}function Kr({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function qr(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?xr(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Kr(f,t))continue;let o={delay:n,...Sr(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){A.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Gr(e);if(n){let e=window.MotionHandoffAnimation(n,t,A);e!==null&&(o.startTime=e,p=!0)}}Hr(e,t);let m=l??e.shouldReduceMotion;r.start(Ar(t,r,i,m&&Ir.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>A.update(()=>{o&&Br(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Jr(e,t,n={}){let r=G(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(qr(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Yr(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Yr(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Jr(c,t,{...o,delay:n+(typeof r==`function`?0:r)+gr(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Xr(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Jr(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Jr(e,t,n);else{let i=typeof t==`function`?G(e,t,n.custom):t;r=Promise.all(qr(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Zr={test:e=>e===`auto`,parse:e=>e},Qr=e=>t=>t.test(e),$r=[ze,I,F,P,tt,et,Zr],ei=e=>$r.find(Qr(e));function ti(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||C(e)}var ni=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function ri(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Ue)||[];if(!r)return e;let i=n.replace(r,``),a=+!!ni.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var ii=/\b([a-z-]*)\(.*?\)/gu,ai={...R,getAnimatableNone:e=>{let t=e.match(ii);return t?t.map(ri).join(` `):e}},oi={...R,getAnimatableNone:e=>{let t=R.parse(e);return R.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},si={...ze,transform:Math.round},ci={borderWidth:I,borderTopWidth:I,borderRightWidth:I,borderBottomWidth:I,borderLeftWidth:I,borderRadius:I,borderTopLeftRadius:I,borderTopRightRadius:I,borderBottomRightRadius:I,borderBottomLeftRadius:I,width:I,maxWidth:I,height:I,maxHeight:I,top:I,right:I,bottom:I,left:I,inset:I,insetBlock:I,insetBlockStart:I,insetBlockEnd:I,insetInline:I,insetInlineStart:I,insetInlineEnd:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,paddingBlock:I,paddingBlockStart:I,paddingBlockEnd:I,paddingInline:I,paddingInlineStart:I,paddingInlineEnd:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,marginBlock:I,marginBlockStart:I,marginBlockEnd:I,marginInline:I,marginInlineStart:I,marginInlineEnd:I,fontSize:I,backgroundPositionX:I,backgroundPositionY:I,rotate:P,pathRotation:P,rotateX:P,rotateY:P,rotateZ:P,scale:Ve,scaleX:Ve,scaleY:Ve,scaleZ:Ve,skew:P,skewX:P,skewY:P,distance:I,translateX:I,translateY:I,translateZ:I,x:I,y:I,z:I,perspective:I,transformPerspective:I,opacity:Be,originX:nt,originY:nt,originZ:I,zIndex:si,fillOpacity:Be,strokeOpacity:Be,numOctaves:si},li={...ci,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:ai,WebkitFilter:ai,mask:oi,WebkitMask:oi},ui=e=>li[e],di=new Set([ai,oi]);function fi(e,t){let n=ui(e);return di.has(n)||(n=R),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var pi=new Set([`auto`,`none`,`0`]);function mi(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!pi.has(t)&&ft(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=fi(n,i)}var hi=class extends zn{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Ie(r))){let i=Nr(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Ir.has(n)||e.length!==2)return;let[r,i]=e,a=ei(r),o=ei(i);if(Re(r)!==Re(i)&&H[n]){this.needsMeasurement=!0;return}if(a!==o)if(kn(a)&&kn(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else H[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||ti(e[t]))&&n.push(t);n.length&&mi(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=H[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=H[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};function gi(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var _i=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function vi(e){return S(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:yi,cancel:bi}=Oe(queueMicrotask,!1),q={x:!1,y:!1};function xi(){return q.x||q.y}function Si(e){return e===`x`||e===`y`?q[e]?null:(q[e]=!0,()=>{q[e]=!1}):q.x||q.y?null:(q.x=q.y=!0,()=>{q.x=q.y=!1})}function Ci(e,t){let n=gi(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function wi(e){return!(e.pointerType===`touch`||xi())}function Ti(e,t,n={}){let[r,i,a]=Ci(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!wi(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Ei=(e,t)=>t?e===t?!0:Ei(e,t.parentElement):!1,Di=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Oi=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function ki(e){return Oi.has(e.tagName)||e.isContentEditable===!0}var Ai=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function ji(e){return Ai.has(e.tagName)||e.isContentEditable===!0}var Mi=new WeakSet;function Ni(e){return t=>{t.key===`Enter`&&e(t)}}function Pi(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Fi=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Ni(()=>{if(Mi.has(n))return;Pi(n,`down`);let e=Ni(()=>{Pi(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Pi(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Ii(e){return Di(e)&&!xi()}var Li=new WeakSet;function Ri(e,t,n={}){let[r,i,a]=Ci(e,n),o=e=>{let r=e.currentTarget;if(!Ii(e)||Li.has(e))return;Mi.add(r),n.stopPropagation&&Li.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),Mi.has(r)&&Mi.delete(r),Ii(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||Ei(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),vi(e)&&(e.addEventListener(`focus`,e=>Fi(e,i)),!ki(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function zi(e){return S(e)&&`ownerSVGElement`in e}var Bi=new WeakMap,Vi,Hi=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:zi(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Ui=Hi(`inline`,`width`,`offsetWidth`),Wi=Hi(`block`,`height`,`offsetHeight`);function Gi({target:e,borderBoxSize:t}){Bi.get(e)?.forEach(n=>{n(e,{get width(){return Ui(e,t)},get height(){return Wi(e,t)}})})}function Ki(e){e.forEach(Gi)}function qi(){typeof ResizeObserver>`u`||(Vi=new ResizeObserver(Ki))}function Ji(e,t){Vi||qi();let n=gi(e);return n.forEach(e=>{let n=Bi.get(e);n||(n=new Set,Bi.set(e,n)),n.add(t),Vi?.observe(e)}),()=>{n.forEach(e=>{let n=Bi.get(e);n?.delete(t),n?.size||Vi?.unobserve(e)})}}var Yi=new Set,Xi;function Zi(){Xi=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yi.forEach(t=>t(e))},window.addEventListener(`resize`,Xi)}function Qi(e){return Yi.add(e),Xi||Zi(),()=>{Yi.delete(e),!Yi.size&&typeof Xi==`function`&&(window.removeEventListener(`resize`,Xi),Xi=void 0)}}function $i(e,t){return typeof e==`function`?Qi(e):Ji(e,t)}function ea(e){return zi(e)&&e.tagName===`svg`}var ta=[...$r,L,R],na=e=>ta.find(Qr(e)),ra=()=>({translate:0,scale:1,origin:0,originPoint:0}),ia=()=>({x:ra(),y:ra()}),aa=()=>({min:0,max:0}),J=()=>({x:aa(),y:aa()}),oa=new WeakMap;function sa(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function ca(e){return typeof e==`string`||Array.isArray(e)}var la=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],ua=[`initial`,...la];function da(e){return sa(e.animate)||ua.some(t=>ca(e[t]))}function fa(e){return!!(da(e)||e.variants)}function pa(e,t,n){for(let r in t){let i=t[r],a=n[r];if(K(i))e.addValue(r,i);else if(K(a))e.addValue(r,W(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,W(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var ma=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],ha={};function ga(e){ha=e}function _a(){return ha}var va=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=zn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=N.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,A.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=da(t),this.isVariantNode=fa(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&K(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,oa.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(o.current||c(),this.shouldReduceMotion=s.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),j(this.notifyUpdate),j(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&cr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Qn({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:D(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=On.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&A.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in ha){let t=ha[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):J()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ma.length;t++){let n=ma[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=pa(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=W(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(x(n)||C(n))?n=parseFloat(n):!na(n)&&R.test(t)&&(n=fi(e,t)),this.setBaseTarget(e,K(n)?n.get():n)),K(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Fr(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!K(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new te),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){yi.render(this.render)}},ya=class extends va{constructor(){super(...arguments),this.KeyframeResolver=hi}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;K(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Y=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function ba({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function xa({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Sa(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ca(e){return e===void 0||e===1}function wa({scale:e,scaleX:t,scaleY:n}){return!Ca(e)||!Ca(t)||!Ca(n)}function Ta(e){return wa(e)||Ea(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ea(e){return Da(e.x)||Da(e.y)}function Da(e){return e&&e!==`0%`}function Oa(e,t,n){return n+t*(e-n)}function ka(e,t,n,r,i){return i!==void 0&&(e=Oa(e,i,r)),Oa(e,n,r)+t}function Aa(e,t=0,n=1,r,i){e.min=ka(e.min,t,n,r,i),e.max=ka(e.max,t,n,r,i)}function ja(e,{x:t,y:n}){Aa(e.x,t.translate,t.scale,t.originPoint),Aa(e.y,n.translate,n.scale,n.originPoint)}var Ma=.999999999999,Na=1.0000000000001;function Pa(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(X(e.x,-a.scroll.offset.x),X(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ja(e,o)),r&&Ta(a.latestValues)&&La(e,a.latestValues,a.layout?.layoutBox))}t.x<Na&&t.x>Ma&&(t.x=1),t.y<Na&&t.y>Ma&&(t.y=1)}function X(e,t){e.min+=t,e.max+=t}function Fa(e,t,n,r,i=.5){Aa(e,t,n,z(e.min,e.max,i),r)}function Ia(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function La(e,t,n){let r=n??e;Fa(e.x,Ia(t.x,r.x),t.scaleX,t.scale,t.originX),Fa(e.y,Ia(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ra(e,t){return ba(Sa(e.getBoundingClientRect(),t))}function za(e,t,n){let r=Ra(e,n),{scroll:i}=t;return i&&(X(r.x,i.offset.x),X(r.y,i.offset.y)),r}var Ba={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Va=Dn.length;function Ha(e,t,n){let r=``,i=!0;for(let a=0;a<Va;a++){let o=Dn[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=_i(s,ci[o]);if(!c){i=!1;let t=Ba[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${_i(a,ci.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ua(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(On.has(e)){o=!0;continue}else if(Pe(e)){i[e]=n;continue}else{let t=_i(n,ci[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Ha(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Wa(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Ga(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ka={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(I.test(e))e=parseFloat(e);else return e;return`${Ga(e,t.target.x)}% ${Ga(e,t.target.y)}%`}},qa={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=R.parse(e);if(i.length>5)return r;let a=R.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=z(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Ja={borderRadius:{...Ka,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Ka,borderTopRightRadius:Ka,borderBottomLeftRadius:Ka,borderBottomRightRadius:Ka,boxShadow:qa};function Ya(e,{layout:t,layoutId:n}){return On.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ja[e]||e===`opacity`)}function Xa(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(K(r[t])||i&&K(i[t])||Ya(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Za(e){return window.getComputedStyle(e)}var Qa=class extends ya{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Wa}readValueFromInstance(e,t){if(On.has(t))return this.projection?.isProjecting?Cn(t):Tn(e,t);{let n=Za(e),r=(Pe(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ra(e,t)}build(e,t,n){Ua(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Xa(e,t,n)}},$a={offset:`stroke-dashoffset`,array:`stroke-dasharray`},eo={offset:`strokeDashoffset`,array:`strokeDasharray`};function to(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?$a:eo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var no=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ro(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ua(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of no)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&to(d,i,a,o,!1)}var io=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ao=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function oo(e,t,n,r){Wa(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(io.has(n)?n:Ur(n),t.attrs[n])}function so(e,t,n){let r=Xa(e,t,n);for(let n in e)if(K(e[n])||K(t[n])){let t=Dn.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var co=class extends ya{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=J}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(On.has(t)){let e=ui(t);return e&&e.default||0}return t=io.has(t)?t:Ur(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return so(e,t,n)}build(e,t,n){ro(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){oo(e,t,n,r)}mount(e){this.isSVGTag=ao(e.tagName),super.mount(e)}},lo=ua.length;function uo(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&uo(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<lo;n++){let r=ua[n],i=e.props[r];(ca(i)||i===!1)&&(t[r]=i)}return t}function fo(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var po=[...la].reverse(),mo=la.length;function ho(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Xr(e,t,n)))}function go(e){let t=ho(e),n=yo(),r=!0,i=!1,a=t=>(n,r)=>{let i=G(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=uo(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<mo;t++){let p=po[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=ca(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||sa(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=_o(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:ee={}}=m,w={...ee,...C},T=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=C[e],n=ee[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Lr(t)&&Lr(n)?!fo(t,n)||y:t!==n,r?t==null?u.add(e):T(e):t!==void 0&&u.has(e)?T(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let E=v&&y;b&&(!E||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=G(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=gr(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=G(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=yo(),i=!0}}}function _o(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!fo(t,e):!1}function vo(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function yo(){return{animate:vo(!0),whileInView:vo(),whileHover:vo(),whileTap:vo(),whileDrag:vo(),whileFocus:vo(),exit:vo()}}function bo(e,t){e.min=t.min,e.max=t.max}function Z(e,t){bo(e.x,t.x),bo(e.y,t.y)}function xo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var So=1e-4,Co=1-So,wo=1+So,To=.01,Eo=0-To,Do=0+To;function Q(e){return e.max-e.min}function Oo(e,t,n){return Math.abs(e-t)<=n}function ko(e,t,n,r=.5){e.origin=r,e.originPoint=z(t.min,t.max,e.origin),e.scale=Q(n)/Q(t),e.translate=z(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Co&&e.scale<=wo||isNaN(e.scale))&&(e.scale=1),(e.translate>=Eo&&e.translate<=Do||isNaN(e.translate))&&(e.translate=0)}function Ao(e,t,n,r){ko(e.x,t.x,n.x,r?r.originX:void 0),ko(e.y,t.y,n.y,r?r.originY:void 0)}function jo(e,t,n,r=0){e.min=(r?z(n.min,n.max,r):n.min)+t.min,e.max=e.min+Q(t)}function Mo(e,t,n,r){jo(e.x,t.x,n.x,r?.x),jo(e.y,t.y,n.y,r?.y)}function No(e,t,n,r=0){let i=r?z(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Q(t)}function Po(e,t,n,r){No(e.x,t.x,n.x,r?.x),No(e.y,t.y,n.y,r?.y)}function Fo(e,t,n,r,i){return e-=t,e=Oa(e,1/n,r),i!==void 0&&(e=Oa(e,1/i,r)),e}function Io(e,t=0,n=1,r=.5,i,a=e,o=e){if(F.test(t)&&(t=parseFloat(t),t=z(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=z(a.min,a.max,r);e===a&&(s-=t),e.min=Fo(e.min,t,n,s,i),e.max=Fo(e.max,t,n,s,i)}function Lo(e,t,[n,r,i],a,o){Io(e,t[n],t[r],t[i],t.scale,a,o)}var Ro=[`x`,`scaleX`,`originX`],zo=[`y`,`scaleY`,`originY`];function Bo(e,t,n,r){Lo(e.x,t,Ro,n?n.x:void 0,r?r.x:void 0),Lo(e.y,t,zo,n?n.y:void 0,r?r.y:void 0)}function Vo(e){return e.translate===0&&e.scale===1}function Ho(e){return Vo(e.x)&&Vo(e.y)}function Uo(e,t){return e.min===t.min&&e.max===t.max}function Wo(e,t){return Uo(e.x,t.x)&&Uo(e.y,t.y)}function Go(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ko(e,t){return Go(e.x,t.x)&&Go(e.y,t.y)}function qo(e){return Q(e.x)/Q(e.y)}function Jo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function $(e){return[e(`x`),e(`y`)]}function Yo(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Xo=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],Zo=Xo.length,Qo=e=>typeof e==`string`?parseFloat(e):e,$o=e=>typeof e==`number`||I.test(e);function es(e,t,n,r,i,a){i?(e.opacity=z(0,n.opacity??1,ns(r)),e.opacityExit=z(t.opacity??1,0,rs(r))):a&&(e.opacity=z(t.opacity??1,n.opacity??1,r));for(let i=0;i<Zo;i++){let a=Xo[i],o=ts(t,a),s=ts(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||$o(o)===$o(s)?(e[a]=Math.max(z(Qo(o),Qo(s),r),0),(F.test(s)||F.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=z(t.rotate||0,n.rotate||0,r))}function ts(e,t){return e[t]===void 0?e.borderRadius:e[t]}var ns=is(0,.5,he),rs=is(.5,.95,w);function is(e,t,n){return r=>r<e?0:r>t?1:n(E(e,t,r))}function as(e,t,n){let r=K(e)?e:W(e);return r.start(Ar(``,r,t,n)),r.animation}function os(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var ss=(e,t)=>e.depth-t.depth,cs=class{constructor(){this.children=[],this.isDirty=!1}add(e){h(this.children,e),this.isDirty=!0}remove(e){g(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ss),this.isDirty=!1,this.children.forEach(e)}};function ls(e,t){let n=N.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(j(r),e(a-t))};return A.setup(r,!0),()=>j(r)}function us(e){return K(e)?e.get():e}var ds=class{constructor(){this.members=[]}add(e){h(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(g(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(g(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},fs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ps={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ms=[``,`X`,`Y`,`Z`],hs=1e3,gs=0;function _s(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function vs(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Gr(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,A,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&vs(r)}function ys({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=gs++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,k.value&&(ps.nodes=ps.calculatedTargetDeltas=ps.calculatedProjections=0),this.nodes.forEach(Ss),this.nodes.forEach(js),this.nodes.forEach(Ms),this.nodes.forEach(Cs),k.addProjectionMetrics&&k.addProjectionMetrics(ps)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new cs)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new te),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=zi(t)&&!ea(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;A.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=ls(i,250),fs.hasAnimatedSinceResize&&(fs.hasAnimatedSinceResize=!1,this.nodes.forEach(As)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||zs,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Ko(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Sr(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||As(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),j(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ns),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&vs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Es),this.nodes.forEach(Ts);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ds);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Os),this.nodes.forEach(ks),this.nodes.forEach(bs),this.nodes.forEach(xs)):this.nodes.forEach(Ds),this.clearAllSnapshots();let e=N.now();M.delta=_(0,1e3/60,e-M.timestamp),M.timestamp=e,M.isProcessing=!0,ke.update.process(M),ke.preRender.process(M),ke.render.process(M),M.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,yi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ws),this.sharedNodes.forEach(Ps)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,A.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){A.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Q(this.snapshot.measuredBox.x)&&!Q(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=J(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ho(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ta(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Us(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return J();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Gs))){let{scroll:e}=this.root;e&&(X(t.x,e.offset.x),X(t.y,e.offset.y))}return t}removeElementScroll(e){let t=J();if(Z(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Z(t,e),X(t.x,i.offset.x),X(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||J();Z(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(X(r.x,-n.scroll.offset.x),X(r.y,-n.scroll.offset.y)),Ta(n.latestValues)&&La(r,n.latestValues,n.layout?.layoutBox)}return Ta(this.latestValues)&&La(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=J();Z(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ta(n.latestValues))continue;let r;n.instance&&(wa(n.latestValues)&&n.updateSnapshot(),r=J(),Z(r,n.measurePageBox())),Bo(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ta(this.latestValues)&&Bo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==M.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=M.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=J(),this.targetWithTransforms=J()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Mo(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Z(this.target,this.layout.layoutBox),ja(this.target,this.targetDelta)):Z(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),k.value&&ps.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||wa(this.parent.latestValues)||Ea(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=J(),this.relativeTargetOrigin=J(),Po(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Z(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===M.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Z(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Pa(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=J());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xo(this.prevProjectionDelta.x,this.projectionDelta.x),xo(this.prevProjectionDelta.y,this.projectionDelta.y)),Ao(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Jo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Jo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),k.value&&ps.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ia(),this.projectionDelta=ia(),this.projectionDeltaWithTransform=ia()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=ia();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=J(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(Rs));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=z(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=z(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(Fs(o.x,e.x,n),Fs(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Po(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ls(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Wo(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=J(),Z(f,this.relativeTarget)),c&&(this.animationValues=a,es(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(j(this.pendingAnimation),void 0),this.pendingAnimation=A.update(()=>{fs.hasAnimatedSinceResize=!0,Me.layout++,this.motionValue||=W(0),this.motionValue.jump(0,!1),this.currentAnimation=as(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Me.layout--},onComplete:()=>{Me.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(hs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Ws(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||J();let t=Q(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Q(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Z(t,n),La(t,i),Ao(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ds),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&_s(`z`,e,r,this.animationValues);for(let t=0;t<ms.length;t++)_s(`rotate${ms[t]}`,e,r,this.animationValues),_s(`skew${ms[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=us(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=us(t?.pointerEvents)||``),this.hasProjected&&!Ta(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Yo(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Ja){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Ja[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?us(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Ts),this.root.sharedNodes.clear()}}}function bs(e){e.updateLayout()}function xs(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)$(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Q(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;bo(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Ws(i,t.layoutBox,n)&&$(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Q(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=ia();Ao(o,n,t.layoutBox);let s=ia();a?Ao(s,e.applyTransform(r,!0),t.measuredBox):Ao(s,n,t.layoutBox);let c=!Ho(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=J();Po(s,t.layoutBox,i.layoutBox,o);let c=J();Po(c,n,a.layoutBox,o),Ko(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ss(e){k.value&&ps.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Cs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ws(e){e.clearSnapshot()}function Ts(e){e.clearMeasurements()}function Es(e){e.isLayoutDirty=!0,e.updateLayout()}function Ds(e){e.isLayoutDirty=!1}function Os(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ks(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function As(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function js(e){e.resolveTargetDelta()}function Ms(e){e.calcProjection()}function Ns(e){e.resetSkewAndRotation()}function Ps(e){e.removeLeadSnapshot()}function Fs(e,t,n){e.translate=z(t.translate,0,n),e.scale=z(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Is(e,t,n,r){e.min=z(t.min,n.min,r),e.max=z(t.max,n.max,r)}function Ls(e,t,n,r){Is(e.x,t.x,n.x,r),Is(e.y,t.y,n.y,r)}function Rs(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var zs={duration:.45,ease:[.4,0,.1,1]},Bs=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Vs=Bs(`applewebkit/`)&&!Bs(`chrome/`)?Math.round:w;function Hs(e){e.min=Vs(e.min),e.max=Vs(e.max)}function Us(e){Hs(e.x),Hs(e.y)}function Ws(e,t,n){return e===`position`||e===`preserve-aspect`&&!Oo(qo(t),qo(n),.2)}function Gs(e){return e!==e.root&&e.scroll?.wasRoot}var Ks=ys({attachResizeListener:(e,t)=>os(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qs={current:void 0},Js=ys({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qs.current){let e=new Ks({});e.mount(window),e.setOptions({layoutScroll:!0}),qs.current=e}return qs.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Ys=(0,u.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Xs(e=!0){let t=(0,u.useContext)(m);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,u.useId)();(0,u.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,u.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Zs=(0,u.createContext)({strict:!1}),Qs={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},$s=!1;function ec(){if($s)return;let e={};for(let t in Qs)e[t]={isEnabled:e=>Qs[t].some(t=>!!e[t])};ga(e),$s=!0}function tc(){return ec(),_a()}function nc(e){let t=tc();for(let n in e)t[n]={...t[n],...e[n]};ga(t)}var rc=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function ic(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||rc.has(e)}var ac=r({default:()=>oc}),oc,sc=t((()=>{throw oc={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),cc=e=>!ic(e);function lc(e){typeof e==`function`&&(cc=t=>t.startsWith(`on`)?!ic(t):e(t))}try{lc((sc(),e(ac)).default)}catch{}function uc(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||K(e[i])||(cc(i)||n===!0&&ic(i)||!t&&!ic(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var dc=(0,u.createContext)({});function fc(e,t){if(da(e)){let{initial:t,animate:n}=e;return{initial:t===!1||ca(t)?t:void 0,animate:ca(n)?n:void 0}}return e.inherit===!1?{}:t}function pc(e){let{initial:t,animate:n}=fc(e,(0,u.useContext)(dc));return(0,u.useMemo)(()=>({initial:t,animate:n}),[mc(t),mc(n)])}function mc(e){return Array.isArray(e)?e.join(` `):e}var hc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gc(e,t,n){for(let r in t)!K(t[r])&&!Ya(r,n)&&(e[r]=t[r])}function _c({transformTemplate:e},t){return(0,u.useMemo)(()=>{let n=hc();return Ua(n,t,e),Object.assign({},n.vars,n.style)},[t])}function vc(e,t){let n=e.style||{},r={};return gc(r,n,e),Object.assign(r,_c(e,t)),r}function yc(e,t){let n={},r=vc(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var bc=()=>({...hc(),attrs:{}});function xc(e,t,n,r){let i=(0,u.useMemo)(()=>{let n=bc();return ro(n,t,ao(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};gc(t,e.style,e),i.style={...t,...i.style}}return i}var Sc=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Cc(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Sc.indexOf(e)>-1||/[A-Z]/u.test(e))}function wc(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??Cc(e)?xc:yc)(t,r,i,e),c=uc(t,typeof e==`string`,a),l=e===u.Fragment?{}:{...c,...s,ref:n},{children:d}=t,f=(0,u.useMemo)(()=>K(d)?d.get():d,[d]);return(0,u.createElement)(e,{...l,children:f})}function Tc({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Ec(n,r,i,e),renderState:t()}}function Ec(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=us(a[e]);let{initial:o,animate:s}=e,c=da(e),l=fa(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!sa(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Fr(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Dc=e=>(t,n)=>{let r=(0,u.useContext)(dc),i=(0,u.useContext)(m),a=()=>Tc(e,t,r,i);return n?a():f(a)},Oc=Dc({scrapeMotionValuesFromProps:Xa,createRenderState:hc}),kc=Dc({scrapeMotionValuesFromProps:so,createRenderState:bc}),Ac=Symbol.for(`motionComponentSymbol`);function jc(e,t,n){let r=(0,u.useRef)(n);(0,u.useInsertionEffect)(()=>{r.current=n});let i=(0,u.useRef)(null);return(0,u.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var Mc=(0,u.createContext)({});function Nc(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Pc(e,t,n,r,i,a){let{visualElement:o}=(0,u.useContext)(dc),s=(0,u.useContext)(Zs),c=(0,u.useContext)(m),l=(0,u.useContext)(Ys),d=l.reducedMotion,f=l.skipAnimations,h=(0,u.useRef)(null),g=(0,u.useRef)(!1);r||=s.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:a}),g.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));let _=h.current,v=(0,u.useContext)(Mc);_&&!_.projection&&i&&(_.type===`html`||_.type===`svg`)&&Fc(h.current,n,i,v);let y=(0,u.useRef)(!1);(0,u.useInsertionEffect)(()=>{_&&y.current&&_.update(n,c)});let b=n[Wr],x=(0,u.useRef)(!!b&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return p(()=>{g.current=!0,_&&(y.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),x.current&&_.animationState&&_.animationState.animateChanges())}),(0,u.useEffect)(()=>{_&&(!x.current&&_.animationState&&_.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),!1),_.enteringChildren=void 0)}),_}function Fc(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Ic(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Nc(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Ic(e){if(e)return e.options.allowProjection===!1?Ic(e.parent):e.projection}function Lc(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&nc(r);let a=n?n===`svg`:Cc(e),o=a?kc:Oc;function s(n,s){let c,d={...(0,u.useContext)(Ys),...n,layoutId:Rc(n)},{isStatic:f}=d,p=pc(n),m=o(n,f);if(!f&&typeof window<`u`){zc(d,r);let t=Bc(d);c=t.MeasureLayout,p.visualElement=Pc(e,m,d,i,t.ProjectionNode,a)}return(0,l.jsxs)(dc.Provider,{value:p,children:[c&&p.visualElement?(0,l.jsx)(c,{visualElement:p.visualElement,...d}):null,wc(e,n,jc(m,p.visualElement,s),m,f,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,u.forwardRef)(s);return c[Ac]=e,c}function Rc({layoutId:e}){let t=(0,u.useContext)(d).id;return t&&e!==void 0?t+`-`+e:e}function zc(e,t){(0,u.useContext)(Zs).strict}function Bc(e){let{drag:t,layout:n}=tc();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Vc(e,t){if(typeof Proxy>`u`)return Lc;let n=new Map,r=(n,r)=>Lc(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Lc(a,void 0,e,t)),n.get(a))})}var Hc=(e,t)=>t.isSVG??Cc(e)?new co(t):new Qa(t,{allowProjection:e!==u.Fragment}),Uc=class extends Y{constructor(e){super(e),e.animationState||=go(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();sa(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Wc=0,Gc={animation:{Feature:Uc},exit:{Feature:class extends Y{constructor(){super(...arguments),this.id=Wc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=G(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Kc(e){return{point:{x:e.pageX,y:e.pageY}}}var qc=e=>t=>Di(t)&&e(t,Kc(t));function Jc(e,t,n,r){return os(e,t,qc(n),r)}var Yc=({current:e})=>e?e.ownerDocument.defaultView:null,Xc=(e,t)=>Math.abs(e-t);function Zc(e,t){let n=Xc(e.x,t.x),r=Xc(e.y,t.y);return Math.sqrt(n**2+r**2)}var Qc=new Set([`auto`,`scroll`]),$c=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=el(this.lastRawMoveEventInfo,this.transformPagePoint));let e=nl(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Zc(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=M;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=el(t,this.transformPagePoint),A.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=nl(e.type===`pointercancel`?this.lastMoveEventInfo:el(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Di(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=el(Kc(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=M;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,nl(s,this.history)),this.removeListeners=T(Jc(this.contextWindow,`pointermove`,this.handlePointerMove),Jc(this.contextWindow,`pointerup`,this.handlePointerUp),Jc(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Qc.has(e.overflowX)||Qc.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),A.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),j(this.updatePoint)}};function el(e,t){return t?{point:t(e.point)}:e}function tl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nl({point:e},t){return{point:e,delta:tl(e,il(t)),offset:tl(e,rl(t)),velocity:al(t,.1)}}function rl(e){return e[0]}function il(e){return e[e.length-1]}function al(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=il(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>D(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>D(t)*2&&(r=e[1]);let a=O(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ol(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?z(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?z(n,e,r.max):Math.min(e,n)),e}function sl(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function cl(e,{top:t,left:n,bottom:r,right:i}){return{x:sl(e.x,n,i),y:sl(e.y,t,r)}}function ll(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function ul(e,t){return{x:ll(e.x,t.x),y:ll(e.y,t.y)}}function dl(e,t){let n=.5,r=Q(e),i=Q(t);return i>r?n=E(t.min,t.max-r,e.min):r>i&&(n=E(e.min,e.max-i,t.min)),_(0,1,n)}function fl(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var pl=.35;function ml(e=pl){return e===!1?e=0:e===!0&&(e=pl),{x:hl(e,`left`,`right`),y:hl(e,`top`,`bottom`)}}function hl(e,t,n){return{min:gl(e,t),max:gl(e,n)}}function gl(e,t){return typeof e==`number`?e:e[t]||0}var _l=new WeakMap,vl=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=J(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Kc(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Si(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$(e=>{let t=this.getAxisMotionValue(e).get()||0;if(F.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Q(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&A.update(()=>i(e,t),!1,!0),Hr(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Sl(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&A.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new $c(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Yc(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&A.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!xl(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=ol(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Nc(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=cl(n.layoutBox,e):this.constraints=!1,this.elastic=ml(t),r!==this.constraints&&!Nc(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&$(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=fl(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Nc(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=za(n,r.root,this.visualElement.getTransformPagePoint()),a=ul(r.layout.layoutBox,i);if(t){let e=t(xa(a));this.hasMutatedConstraints=!!e,e&&(a=ba(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=$(o=>{if(!xl(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Hr(this.visualElement,e),n.start(Ar(e,n,0,t,this.visualElement,!1))}stopAnimation(){$(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){$(t=>{let{drag:n}=this.getProps();if(!xl(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-z(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Nc(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};$(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=dl({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),$(t=>{if(!xl(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(z(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_l.set(this.visualElement,this);let e=this.visualElement.current,t=Jc(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ji(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Nc(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=bl(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),A.read(r);let o=os(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&($(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=pl,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function yl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function bl(e,t,n){let r=$i(e,yl(n)),i=$i(t,yl(n));return()=>{r(),i()}}function xl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sl(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Cl=class extends Y{constructor(e){super(e),this.removeGroupControls=w,this.removeListeners=w,this.controls=new vl(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||w}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},wl=e=>(t,n)=>{e&&A.update(()=>e(t,n),!1,!0)},Tl=class extends Y{constructor(){super(...arguments),this.removePointerDownListener=w}onPointerDown(e){this.session=new $c(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yc(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:wl(e),onStart:wl(t),onMove:wl(n),onEnd:(e,t)=>{delete this.session,r&&A.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Jc(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},El=!1,Dl=class extends u.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),El&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),fs.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),El=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||A.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),yi.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;El=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Ol(e){let[t,n]=Xs(),r=(0,u.useContext)(d);return(0,l.jsx)(Dl,{...e,layoutGroup:r,switchLayoutGroup:(0,u.useContext)(Mc),isPresent:t,safeToRemove:n})}var kl={pan:{Feature:Tl},drag:{Feature:Cl,ProjectionNode:Js,MeasureLayout:Ol}};function Al(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&A.postRender(()=>i(t,Kc(t)))}var jl=class extends Y{mount(){let{current:e}=this.node;e&&(this.unmount=Ti(e,(e,t)=>(Al(this.node,t,`Start`),e=>Al(this.node,e,`End`))))}unmount(){}},Ml=class extends Y{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=T(os(this.node.current,`focus`,()=>this.onFocus()),os(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Nl(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&A.postRender(()=>i(t,Kc(t)))}var Pl=class extends Y{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Ri(e,(e,t)=>(Nl(this.node,t,`Start`),(e,{success:t})=>Nl(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Fl=new WeakMap,Il=new WeakMap,Ll=e=>{let t=Fl.get(e.target);t&&t(e)},Rl=e=>{e.forEach(Ll)};function zl({root:e,...t}){let n=e||document;Il.has(n)||Il.set(n,{});let r=Il.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Rl,{root:e,...t})),r[i]}function Bl(e,t,n){let r=zl(t);return Fl.set(e,n),r.observe(e),()=>{Fl.delete(e),r.unobserve(e)}}var Vl={some:0,all:1},Hl=class extends Y{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Vl[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Bl(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Ul(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Ul({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Wl={inView:{Feature:Hl},tap:{Feature:Pl},focus:{Feature:Ml},hover:{Feature:jl}},Gl={layout:{ProjectionNode:Js,MeasureLayout:Ol}},Kl=Vc({...Gc,...Wl,...kl,...Gl},Hc);export{le as A,tn as C,j as D,z as E,g as F,m as I,p as L,E as M,y as N,A as O,v as P,f as R,nn as S,Bt as T,Br as _,co as a,Xn as b,oa as c,zi as d,vi as f,K as g,qr as h,as as i,D as j,be as k,J as l,Xr as m,Xs as n,Qa as o,gi as p,Ys as r,va as s,Kl as t,ea as u,yr as v,Xt as w,rn as x,W as y,d as z};
@@ -1 +0,0 @@
1
- var e={current:null},t={current:!1},n=typeof window<`u`;function r(){if(t.current=!0,n)if(window.matchMedia){let t=window.matchMedia(`(prefers-reduced-motion)`),n=()=>e.current=t.matches;t.addEventListener(`change`,n),n()}else e.current=!1}export{t as n,e as r,r as t};