@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.
- package/dist/assets/{AnimatePresence-CgXwEO42.js → AnimatePresence-Dfn9OLfv.js} +2 -2
- package/dist/assets/{BundleConfirmPage-DpfvIcwl.js → BundleConfirmPage-cwBrFi1K.js} +1 -1
- package/dist/assets/{Combination-4Qc3vrtW.js → Combination-DRz6Ez-m.js} +1 -1
- package/dist/assets/{QueryClientProvider-DKhXIxGb.js → QueryClientProvider-DgWA3A3c.js} +1 -1
- package/dist/assets/{about-page-CuSnWJFo.js → about-page-6YWjIdZL.js} +1 -1
- package/dist/assets/{account-page-CCYCSy2-.js → account-page-bNvk8mIC.js} +1 -1
- package/dist/assets/{account-shell-b6GjlQ0u.js → account-shell-B1geYjoc.js} +1 -1
- package/dist/assets/{add-credits-modal-Dy3I3Har.js → add-credits-modal-D-5W9e8w.js} +1 -1
- package/dist/assets/{advanced-page-CVnT0zH-.js → advanced-page-CuerkFrp.js} +1 -1
- package/dist/assets/ai-page-CsqhZcSf.js +1 -0
- package/dist/assets/{api-2kc3MHRz.js → api-DXPKXkDj.js} +1 -1
- package/dist/assets/{api-key-screen-DGVn66y4.js → api-key-screen-QS5FdtlL.js} +1 -1
- package/dist/assets/{app-info-BZYaLxCg.js → app-info-oX9MaK2d.js} +1 -1
- package/dist/assets/{archive-BFILUl9x.js → archive-Ct5g6T4N.js} +1 -1
- package/dist/assets/{archive-page-Dl6HLIJt.js → archive-page-Bh0LTWRp.js} +1 -1
- package/dist/assets/arrow-left-BPsKoNcb.js +1 -0
- package/dist/assets/arrow-up-CkZMv0kb.js +1 -0
- package/dist/assets/{assistant-api-DROTS3Y9.js → assistant-api-BdlaVxiH.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-Dl92XRsM.js → assistant-feature-flag-store-Ceb6N94N.js} +1 -1
- package/dist/assets/assistant-identity-store-ESeBny_J.js +1 -0
- package/dist/assets/{assistant-status-panel-BkIkvMYw.js → assistant-status-panel-DRHanMan.js} +1 -1
- package/dist/assets/auth-store-BzL2lSd1.js +7 -0
- package/dist/assets/ban-BW0pQzvY.js +1 -0
- package/dist/assets/{bell-DB1SrBre.js → bell-B-09xFrv.js} +1 -1
- package/dist/assets/{billing-page-Cq_yLwUC.js → billing-page-CEArOabV.js} +3 -3
- package/dist/assets/{bookmark-C3S-p0MQ.js → bookmark-B_4Mr1qd.js} +1 -1
- package/dist/assets/{bookmarks-page-CANlE7hP.js → bookmarks-page-BvkvZ7uy.js} +1 -1
- package/dist/assets/{brain-Bs6LnfHO.js → brain-CamcLepK.js} +1 -1
- package/dist/assets/{browser-CKX_K5ev.js → browser-CDQJAXkC.js} +2 -2
- package/dist/assets/{bug-DDcuQ3au.js → bug-BiiqXpDy.js} +1 -1
- package/dist/assets/{build-state-VC4tL7sK.js → build-state-BIN8lPRx.js} +1 -1
- package/dist/assets/{button-D7s2Q_uG.js → button-BvHa6F59.js} +1 -1
- package/dist/assets/{calendar-CpgH8CqM.js → calendar-Ba3kkcG0.js} +1 -1
- package/dist/assets/{capture-error-Hr1Yo2kx.js → capture-error-BaKOqBjF.js} +1 -1
- package/dist/assets/{card-BibIM9x3.js → card-D9_3ngHI.js} +1 -1
- package/dist/assets/check-DwLoiFa9.js +1 -0
- package/dist/assets/check-DxBmXJus.js +1 -0
- package/dist/assets/{checkbox-BqCzUvXM.js → checkbox-DNfwi5Hy.js} +1 -1
- package/dist/assets/chevron-left-CgekgptJ.js +1 -0
- package/dist/assets/chevron-right-DP15nqFC.js +1 -0
- package/dist/assets/{chevron-up-BRZN6p_l.js → chevron-up-CNrKWpd3.js} +1 -1
- package/dist/assets/{circle-alert-DvNg50UK.js → circle-alert-BB_iJtM8.js} +1 -1
- package/dist/assets/circle-check-Cwv8JCfw.js +1 -0
- package/dist/assets/{client-feature-flag-store-C1kdd1EO.js → client-feature-flag-store-kWvb3vtZ.js} +1 -1
- package/dist/assets/{cloud-off-rAv4OHmv.js → cloud-off-DpkRXr7O.js} +1 -1
- package/dist/assets/{cn-DvW5mxZR.js → cn-CFvi8Z0K.js} +1 -1
- package/dist/assets/code-7vvpMPgo.js +1 -0
- package/dist/assets/{command-palette-GZu_zgQg.js → command-palette-D1nNMvVX.js} +1 -1
- package/dist/assets/{command-palette-window-page-CzWu42Ee.js → command-palette-window-page-DrZt0RaG.js} +1 -1
- package/dist/assets/{community-page-Dhgypa-h.js → community-page-A8lshdka.js} +1 -1
- package/dist/assets/{confirm-dialog-CfOXCE1N.js → confirm-dialog-BtxNY4WU.js} +1 -1
- package/dist/assets/{connect-page-CDOcgzzL.js → connect-page-CuSSRk9J.js} +1 -1
- package/dist/assets/{consent-controls-BSZV4rW3.js → consent-controls-CYj9WfJh.js} +1 -1
- package/dist/assets/{contacts-gateway-dxw1KMN2.js → contacts-gateway-CHNyL-NU.js} +1 -1
- package/dist/assets/{contacts-page-route-C3QiOxjO.js → contacts-page-route-qsIGsjpD.js} +2 -2
- package/dist/assets/{conversation-list-fetchers-UPVZq_6O.js → conversation-list-fetchers-Bcp_Zesn.js} +1 -1
- package/dist/assets/{conversation-store-DK-7gFAt.js → conversation-store-6tz67quR.js} +1 -1
- package/dist/assets/{cpu-CiHv3fhs.js → cpu-PmmoD4_K.js} +1 -1
- package/dist/assets/{credit-card-BKRB1ZIi.js → credit-card-yPLmY1JU.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-CjqUKhk9.js → danger-zone-redirect-page-Dhgk9mkr.js} +1 -1
- package/dist/assets/debug-page-Ddv9MlOm.js +4 -0
- package/dist/assets/{deploy-dialogs-jf5VL1UP.js → deploy-dialogs-qdH6GTjP.js} +1 -1
- package/dist/assets/{detail-card-BIwpXT5F.js → detail-card-5TPdhuZN.js} +1 -1
- package/dist/assets/{developer-page-iEL4eJ8x.js → developer-page-BXl0qAXX.js} +1 -1
- package/dist/assets/{devices-page-RMaPGcXe.js → devices-page-DaZR3FC4.js} +1 -1
- package/dist/assets/{diagnostics-BEB4VPwC.js → diagnostics-D5xXiLo-.js} +1 -1
- package/dist/assets/{dictation-overlay-page-BxQCzLMY.js → dictation-overlay-page-DOdZ_KIz.js} +1 -1
- package/dist/assets/{dist-B0Gf-knw.js → dist-BkSUb6s0.js} +1 -1
- package/dist/assets/{dist-cApvLul2.js → dist-Ble8OyWO.js} +1 -1
- package/dist/assets/{document-viewer-page-57OuXxYw.js → document-viewer-page-XzPSoPVb.js} +1 -1
- package/dist/assets/{domain-field-DYwuCpup.js → domain-field-BGp08c4L.js} +1 -1
- package/dist/assets/{dropdown-CL8VmqrY.js → dropdown-SUNHYFiy.js} +1 -1
- package/dist/assets/{earn-credits-modal-Nm1VymMp.js → earn-credits-modal-D7ioWvNh.js} +1 -1
- package/dist/assets/{emails-page-0gRZqa6y.js → emails-page-BRnVsJnR.js} +1 -1
- package/dist/assets/{emoji-catalog-data-Dlkuvec0.js → emoji-catalog-data-hHp74TCA.js} +1 -1
- package/dist/assets/{environment-store-CvH3J6fT.js → environment-store-B5EGAqzg.js} +1 -1
- package/dist/assets/esm-8Mv545sP.js +2 -0
- package/dist/assets/esm-B35SBKTx.js +2 -0
- package/dist/assets/esm-B9nLiq-2.js +1 -0
- package/dist/assets/{esm-B3Lr4Bv0.js → esm-DQXfMjvW.js} +2 -2
- package/dist/assets/esm-Dz9uwqjb.js +2 -0
- package/dist/assets/esm-TyKOKslC.js +2 -0
- package/dist/assets/{external-link-DPAtkBJ2.js → external-link-h3UAe8eX.js} +1 -1
- package/dist/assets/{file-editor-BNkJJbUv.js → file-editor-Cy1TZHJJ.js} +1 -1
- package/dist/assets/{file-text-CmK9LY1p.js → file-text-Bxj0xAst.js} +1 -1
- package/dist/assets/funnel-events-Dz_DLI0Q.js +1 -0
- package/dist/assets/general-page-Dl7IYYSf.js +1 -0
- package/dist/assets/{globe-DYF_lSGm.js → globe-D7wvOZaZ.js} +1 -1
- package/dist/assets/{hard-drive-D7_5VMhi.js → hard-drive-CO7i5o4z.js} +1 -1
- package/dist/assets/{hatching-screen-KPinlCES.js → hatching-screen-YvbZlnsV.js} +1 -1
- package/dist/assets/home-page-route-B7AJU1pr.js +1 -0
- package/dist/assets/{hosting-screen-C14KAJ6m.js → hosting-screen-CKlP38Z3.js} +1 -1
- package/dist/assets/{identity-page-route-C0BFcTAF.js → identity-page-route-CZQEWoJK.js} +1 -1
- package/dist/assets/index-3zpPFBeR.js +132 -0
- package/dist/assets/index-PRuqIn_u.css +2 -0
- package/dist/assets/{info-_OtUK1cX.js → info-B4DDA6uP.js} +1 -1
- package/dist/assets/{info-BGLlcyt6.js → info-CNTT4WCe.js} +1 -1
- package/dist/assets/{input-C8kfrq9r.js → input-BLN3wmw2.js} +1 -1
- package/dist/assets/{inspect-page-CWasyuSO.js → inspect-page-AldHg0Dz.js} +4 -4
- package/dist/assets/{install-C3xe8ARr.js → install-D_GSceot.js} +1 -1
- package/dist/assets/integrations-page-b3sE-PDS.js +1 -0
- package/dist/assets/{intelligence-layout-CvTumtjv.js → intelligence-layout-CsM_YjdB.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-kiOEZKzE.js → keyboard-shortcuts-page-Capx1ICA.js} +1 -1
- package/dist/assets/{lib-BWRK7bT2.js → lib-Bexzcbsy.js} +1 -1
- package/dist/assets/library-detail-page-DrgMdBPq.js +1 -0
- package/dist/assets/{library-page-BHejhapZ.js → library-page-Catpu3p0.js} +1 -1
- package/dist/assets/{link-2-CaszbD7P.js → link-2-DW8ruMGH.js} +1 -1
- package/dist/assets/{list-row-Cw9JYESP.js → list-row-l7sxQ4Tj.js} +1 -1
- package/dist/assets/loader-circle-cYXxWP5B.js +1 -0
- package/dist/assets/{local-mode-CvrNMtPF.js → local-mode-Cez1weue.js} +1 -1
- package/dist/assets/{log-in-2iOsufxq.js → log-in-Ci5ja9sN.js} +1 -1
- package/dist/assets/{login-flow-DPi11n3h.js → login-flow-DeMU71_M.js} +1 -1
- package/dist/assets/{login-page-BGLVK82t.js → login-page-DkNb0F3s.js} +1 -1
- package/dist/assets/{logout-page-Bl6AD21S.js → logout-page-POyojlS1.js} +1 -1
- package/dist/assets/{logs-layout-C9eUE1Pt.js → logs-layout-qJmOLDZF.js} +1 -1
- package/dist/assets/{memory-router-playground-page-Dhi3uqxr.js → memory-router-playground-page-DD6t0kqe.js} +1 -1
- package/dist/assets/{menu-C_97pis4.js → menu-_JM4udVm.js} +1 -1
- package/dist/assets/{messages-DHDZ32NT.js → messages-DCNfjhgv.js} +2 -2
- package/dist/assets/{minimize-2-JE_UHZlJ.js → minimize-2-DmC6-Woz.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-DqXFL0Ke.js → mobile-sidebar-drawer-B4ol32hs.js} +1 -1
- package/dist/assets/{modal-D0Q3UWD0.js → modal-CH2iwSBx.js} +1 -1
- package/dist/assets/{monitor-D2okHi8o.js → monitor-B1YMXlZj.js} +1 -1
- package/dist/assets/{moon-CK8MXzOo.js → moon-DSWoApF5.js} +1 -1
- package/dist/assets/mutation-error-B5AKP6aC.js +1 -0
- package/dist/assets/{native-file-B-MK3Ngg.js → native-file-GuVJgNpB.js} +2 -2
- package/dist/assets/{notice-CqRgVmeL.js → notice-BhqKj_VM.js} +1 -1
- package/dist/assets/{notifications-page-pHiDPA0p.js → notifications-page-MRalDive.js} +1 -1
- package/dist/assets/{oauth-complete-page-DiGMWbOb.js → oauth-complete-page-DGOyh2u6.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-CwoZnzdc.js → oauth-popup-complete-page-BPxKmr_f.js} +1 -1
- package/dist/assets/{page-shell-cEGpH3P5.js → page-shell-cu3KBmqd.js} +1 -1
- package/dist/assets/{pairing-page-clFaUgzL.js → pairing-page-_ulPOW9r.js} +1 -1
- package/dist/assets/{panel-item-nGTDevWP.js → panel-item-DN2CyWOT.js} +1 -1
- package/dist/assets/{password-reset-page-DfYGL1Gv.js → password-reset-page-BfRXQpS_.js} +1 -1
- package/dist/assets/{pencil-DbB9rxpY.js → pencil-DUMCM9m-.js} +1 -1
- package/dist/assets/{platform-loopback-page-Df5bTTx8.js → platform-loopback-page-D3oAT6qE.js} +1 -1
- package/dist/assets/{plugin-detail-page-IRPeI4lP.js → plugin-detail-page-ClMMTrti.js} +1 -1
- package/dist/assets/{plugins-page-BaYp2QOe.js → plugins-page-y6Aom9qx.js} +1 -1
- package/dist/assets/{popover-CL-JL6vG.js → popover-BIr0nN9H.js} +1 -1
- package/dist/assets/prechat-route-MTnUk6MK.js +1 -0
- package/dist/assets/{prefs-C_oq5G87.js → prefs-C6e8pdrA.js} +1 -1
- package/dist/assets/{privacy-page-BUhxrIRn.js → privacy-page-gc352kAN.js} +1 -1
- package/dist/assets/privacy-screen-CQLPQPoM.js +1 -0
- package/dist/assets/{progress-bar-DIFlWPPg.js → progress-bar-ATg2lhDh.js} +1 -1
- package/dist/assets/{provider-callback-page-CxFC4PH1.js → provider-callback-page-BtYwaMxL.js} +1 -1
- package/dist/assets/{provider-key-nA35OC4Y.js → provider-key-BKR2QTfR.js} +1 -1
- package/dist/assets/{provider-signup-page-CdpT28xL.js → provider-signup-page-80V_D9ad.js} +1 -1
- package/dist/assets/proxy-T76Q62qP.js +1 -0
- package/dist/assets/{quick-input-page-C9jN8YtU.js → quick-input-page-B-7fTgJi.js} +1 -1
- package/dist/assets/{react-query.gen-CQLyoqYk.js → react-query.gen-BeTpj_Sy.js} +1 -1
- package/dist/assets/{react-query.gen-rp6Krcco.js → react-query.gen-breoeUVK.js} +1 -1
- package/dist/assets/{refresh-cw-Bf6LV0kG.js → refresh-cw-kmptQnpX.js} +1 -1
- package/dist/assets/{research-mock-page-ttrrPwo3.js → research-mock-page-DYPr-S2q.js} +1 -1
- package/dist/assets/research-onboarding-route-yYstHFq4.js +35 -0
- package/dist/assets/{resize-errors-DnJEbHn4.js → resize-errors-ocHCHRPn.js} +1 -1
- package/dist/assets/{resolved-assistants-store-Cp4J43BK.js → resolved-assistants-store-BrS8JBzC.js} +1 -1
- package/dist/assets/{return-to-ByvaXBKr.js → return-to-DlPFMVLx.js} +1 -1
- package/dist/assets/{review-terms-screen-DEiifDmK.js → review-terms-screen-DFlSm1tM.js} +1 -1
- package/dist/assets/risk-badge-CTIwePVV.js +1 -0
- package/dist/assets/{routes-DVqkwUEe.js → routes-Dzl0kj5j.js} +1 -1
- package/dist/assets/{save-DEBQ_gbb.js → save-DQyrotXP.js} +1 -1
- package/dist/assets/{schedules-D-4Rq6ZC.js → schedules-DZspBZ61.js} +1 -1
- package/dist/assets/{sdk.gen-D-_js_oC.js → sdk.gen-DSjI3deY.js} +1 -1
- package/dist/assets/{select-assistant-screen-UoixBMN2.js → select-assistant-screen-kcdnMYj7.js} +1 -1
- package/dist/assets/{setting-row-o44aWwYt.js → setting-row-DB3q3lgL.js} +1 -1
- package/dist/assets/settings-layout-DV4y_-8a.js +1 -0
- package/dist/assets/{share-feedback-modal-CTwByE7B.js → share-feedback-modal-CNGNLLDP.js} +1 -1
- package/dist/assets/{shortcut-keys-vM6sNj7W.js → shortcut-keys-D4E8qQgS.js} +1 -1
- package/dist/assets/{sidebar-tree-BJkXpCut.js → sidebar-tree-BCJVetMg.js} +1 -1
- package/dist/assets/{signup-page-CKDYl9Wb.js → signup-page-iM9szAKN.js} +1 -1
- package/dist/assets/{signup-shell-Bu5BM6II.js → signup-shell-GOG8-46O.js} +1 -1
- package/dist/assets/{skills-page-DVjqqfMw.js → skills-page-D3c3cuti.js} +1 -1
- package/dist/assets/{sound-manager-CzslfzDO.js → sound-manager-DwCzTycd.js} +1 -1
- package/dist/assets/{sounds-page-mens6EAJ.js → sounds-page-C3qbFW0l.js} +1 -1
- package/dist/assets/{sparkles-BICoewVE.js → sparkles-C8eL4LNF.js} +1 -1
- package/dist/assets/src-Dr68ou95.js +293 -0
- package/dist/assets/{stat-square-B0S3fO7O.js → stat-square-zBHENXcL.js} +1 -1
- package/dist/assets/{status-badge-pill-DYlAnX5m.js → status-badge-pill-CSitw8_5.js} +1 -1
- package/dist/assets/step-indicator-dots-D4A7eDFL.js +1 -0
- package/dist/assets/subagent-detail-panel-D3xm4yVF.js +4 -0
- package/dist/assets/{subagent-store-BLHGkTJR.js → subagent-store-CFwN6f1W.js} +1 -1
- package/dist/assets/system-events-page-CXlJ_J54.js +1 -0
- package/dist/assets/{system-events-redirect-page-C1hGE6n5.js → system-events-redirect-page-Bkigvq03.js} +1 -1
- package/dist/assets/{tag-B_-QAvJF.js → tag-64Evw5MO.js} +1 -1
- package/dist/assets/{three-dot-indicator-CLs7Rl-I.js → three-dot-indicator-DKd64wpF.js} +1 -1
- package/dist/assets/{tiptap-document-editor-D2t4qYzv.js → tiptap-document-editor-D031y5O7.js} +1 -1
- package/dist/assets/{toast-2TW5tj1Y.js → toast-VJ6jFKB9.js} +1 -1
- package/dist/assets/{toggle-X_kQW5my.js → toggle-zADptotB.js} +1 -1
- package/dist/assets/tool-detail-panel-Cq_SyoUG.js +2 -0
- package/dist/assets/{trace-page-DRWPaAuQ.js → trace-page-CEyVWa_4.js} +1 -1
- package/dist/assets/{triangle-alert-Bz1PpciW.js → triangle-alert-DqPPHRPD.js} +1 -1
- package/dist/assets/{triangle-alert-DKOyShqD.js → triangle-alert-eaW8jtCr.js} +1 -1
- package/dist/assets/{typography-BscuIPxA.js → typography-COqg6o2z.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-Cwv5eMh9.js → upgrade-cancel-page-CM9JnbEO.js} +1 -1
- package/dist/assets/{upgrade-success-page-DnJ8Kyyj.js → upgrade-success-page-BxrXUjiP.js} +1 -1
- package/dist/assets/{usage-page-DJHRS0lZ.js → usage-page-DBmsLal7.js} +1 -1
- package/dist/assets/{use-active-assistant-id-C-RHQ9f6.js → use-active-assistant-id-jfqnc4T7.js} +1 -1
- package/dist/assets/{use-bus-subscription-BbiZXm1u.js → use-bus-subscription-CKWguMzy.js} +1 -1
- package/dist/assets/use-is-org-ready-DLZpD311.js +1 -0
- package/dist/assets/{use-onboarding-login-BEOH92mZ.js → use-onboarding-login-Cz1MgHw6.js} +1 -1
- package/dist/assets/use-plugin-drift-4-li_vW2.js +1 -0
- package/dist/assets/use-reduced-motion-DvKonyYy.js +1 -0
- package/dist/assets/{useQuery-B45lW1Kk.js → useBaseQuery-BOw_gWPH.js} +1 -1
- package/dist/assets/useInfiniteQuery-iPXlezAp.js +1 -0
- package/dist/assets/{useMutation-Lj4VunQV.js → useMutation-D3WkZnYg.js} +1 -1
- package/dist/assets/useQuery-cVuP8q1x.js +1 -0
- package/dist/assets/{user-plus-C0OyQU83.js → user-plus-CjFuXA3D.js} +1 -1
- package/dist/assets/{utils-IBnUZTqY.js → utils-Lep-7jRg.js} +1 -1
- package/dist/assets/{viewer-store-Dead64xY.js → viewer-store-Dened07w.js} +1 -1
- package/dist/assets/{voice-page-kQZ2ya5j.js → voice-page-C3zxM20t.js} +1 -1
- package/dist/assets/{weather-forecast-display-Cu3W6OZF.js → weather-forecast-display-DfsXEBSo.js} +1 -1
- package/dist/assets/{web-DOKyhuGQ.js → web-Broue3sZ.js} +1 -1
- package/dist/assets/{web-M3MS-KVB.js → web-C6Et8xNJ.js} +1 -1
- package/dist/assets/{web-B0S2ynRY.js → web-CNtrY6ZR.js} +1 -1
- package/dist/assets/{web-D0QcGl1O.js → web-CccL0uF5.js} +1 -1
- package/dist/assets/{web-Cg8gCWpB.js → web-CtAf2vJC.js} +1 -1
- package/dist/assets/{web-DJKnWTsF.js → web-Cygkn0vs.js} +1 -1
- package/dist/assets/{web-iUXw2JWQ.js → web-DuqCaaXx.js} +1 -1
- package/dist/assets/{welcome-screen-Bd7PCfAf.js → welcome-screen-RBmiq3Lq.js} +1 -1
- package/dist/assets/workflow-detail-panel-C2dD_hU2.js +1 -0
- package/dist/assets/{workspace-page-BR4pOxs5.js → workspace-page-lR8lzD2L.js} +1 -1
- package/dist/assets/x-649kPSQS.js +1 -0
- package/dist/assets/x-Bn5tweDc.js +1 -0
- package/dist/index.html +135 -134
- package/package.json +1 -1
- package/dist/assets/ai-page-kEbHR7cH.js +0 -1
- package/dist/assets/arrow-left-CP-EhDNF.js +0 -1
- package/dist/assets/arrow-up-nBfZxfhi.js +0 -1
- package/dist/assets/assistant-identity-store-CKjnoLSp.js +0 -1
- package/dist/assets/auth-store-Kfxhs2oI.js +0 -7
- package/dist/assets/ban-BpBuRCKI.js +0 -1
- package/dist/assets/check-CW0KmV0o.js +0 -1
- package/dist/assets/check-D6WkI0gF.js +0 -1
- package/dist/assets/chevron-left-DghyKSEE.js +0 -1
- package/dist/assets/chevron-right-B6vEpVY0.js +0 -1
- package/dist/assets/circle-check-DzlJxj_M.js +0 -1
- package/dist/assets/code-aMX9iMYa.js +0 -1
- package/dist/assets/debug-page-CBozmAQQ.js +0 -2
- package/dist/assets/esm-BVNBLzcW.js +0 -2
- package/dist/assets/esm-BtN-afz9.js +0 -1
- package/dist/assets/esm-D2xhPoyM.js +0 -2
- package/dist/assets/esm-DwNtkiSD.js +0 -2
- package/dist/assets/esm-pt1s0ryM.js +0 -2
- package/dist/assets/general-page-aZxTpnpI.js +0 -1
- package/dist/assets/home-page-route-CudtBGg1.js +0 -1
- package/dist/assets/index-Hcyzmz_5.css +0 -2
- package/dist/assets/index-PRnvH2Y1.js +0 -132
- package/dist/assets/integrations-page-WhBpTYP2.js +0 -1
- package/dist/assets/library-detail-page-rPvN9G1a.js +0 -1
- package/dist/assets/loader-circle-IIzBGiwm.js +0 -1
- package/dist/assets/mutation-error-CsyN8rYH.js +0 -1
- package/dist/assets/prechat-route-BaMWiiaf.js +0 -1
- package/dist/assets/privacy-screen-BaHYtKEt.js +0 -1
- package/dist/assets/proxy-DmIh4F51.js +0 -1
- package/dist/assets/reduced-motion-DYlLlcUm.js +0 -1
- package/dist/assets/research-onboarding-route-Cxai0fux.js +0 -36
- package/dist/assets/risk-badge-BA8R-HCI.js +0 -1
- package/dist/assets/settings-layout-CQ3Z9Raj.js +0 -1
- package/dist/assets/src-CK6bncSg.js +0 -293
- package/dist/assets/step-indicator-dots-CEVbsP8r.js +0 -1
- package/dist/assets/subagent-detail-panel-DVQAkMjF.js +0 -4
- package/dist/assets/system-events-page-Dro8iNrx.js +0 -1
- package/dist/assets/tool-detail-panel-DRD2DIMF.js +0 -2
- package/dist/assets/use-is-org-ready-BdtHeRV6.js +0 -1
- package/dist/assets/use-plugin-drift-Bj693x0f.js +0 -1
- package/dist/assets/use-reduced-motion-ChB7nOGe.js +0 -1
- package/dist/assets/workflow-detail-panel-CMmPPsuL.js +0 -1
- package/dist/assets/x-C8bCmIhD.js +0 -1
- package/dist/assets/x-KVxA2ZL0.js +0 -1
- /package/dist/assets/{api-errors-CveHbhgb.js → api-errors-B-g6gvNv.js} +0 -0
- /package/dist/assets/{avatar-bundled-components-BgAkdy0n.js → avatar-bundled-components-DoxUXsZB.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-CEmN7KGI.js → avatar-svg-compositor-Bzno7teV.js} +0 -0
- /package/dist/assets/{build.umd-B3KuSWeo.js → build.umd-C56vswwO.js} +0 -0
- /package/dist/assets/{client.gen-Cs6pCK0s.js → client.gen-BnoNy2w0.js} +0 -0
- /package/dist/assets/{composer-focus-Bp1AiP29.js → composer-focus-BZr63Cvs.js} +0 -0
- /package/dist/assets/{conversation-selection-CtKjA5Ni.js → conversation-selection-BV7USWf2.js} +0 -0
- /package/dist/assets/{create-selectors-BE0_e_Ed.js → create-selectors-BTyhO-eS.js} +0 -0
- /package/dist/assets/{createLucideIcon-Bjb-Kuq7.js → createLucideIcon-6rJ6BdB7.js} +0 -0
- /package/dist/assets/{createLucideIcon-BlMXrA59.js → createLucideIcon-D8roAprb.js} +0 -0
- /package/dist/assets/{definitions-lQvEBMJT.js → definitions-CtVlh_R5.js} +0 -0
- /package/dist/assets/{dist-BTp54SIT.js → dist-CzyDxYAs.js} +0 -0
- /package/dist/assets/{edit-chat-session-DJpqkkos.js → edit-chat-session-BYvbyTwd.js} +0 -0
- /package/dist/assets/{effective-timezone-DrYGH2Lb.js → effective-timezone-DAkNzd21.js} +0 -0
- /package/dist/assets/{event-bus-Dl7-I4aL.js → event-bus-CBil9JQT.js} +0 -0
- /package/dist/assets/{feature-flag-catalog-RK3_Ckyw.js → feature-flag-catalog-Br-v70vR.js} +0 -0
- /package/dist/assets/{format-CPOur310.js → format-HKnibeVj.js} +0 -0
- /package/dist/assets/{format-date-CLlHK5gl.js → format-date-DyMQp2_m.js} +0 -0
- /package/dist/assets/{format-file-size-BfZOpPdu.js → format-file-size-DOcXaUaE.js} +0 -0
- /package/dist/assets/{haptics-CXHZxyAg.js → haptics-CKwMH4eq.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-n-4oNLiO.js → impersonate-version-flag-XVa1Tm2F.js} +0 -0
- /package/dist/assets/{infiniteQueryOptions-C6p49ZmI.js → infiniteQueryOptions-DTCCTa10.js} +0 -0
- /package/dist/assets/{is-electron-C_ZTVhv8.js → is-electron-URCUw74P.js} +0 -0
- /package/dist/assets/{jsx-runtime-CVSDxk6A.js → jsx-runtime-B-mvcaJS.js} +0 -0
- /package/dist/assets/{llm-dimension-CQdmYu05.js → llm-dimension-Dx3xIzPP.js} +0 -0
- /package/dist/assets/{misc-BN2o2MEB.js → misc-CBD9JJCY.js} +0 -0
- /package/dist/assets/{native-deep-link-BYNI6pkW.js → native-deep-link-DmJ7Ty6z.js} +0 -0
- /package/dist/assets/{pdf-pz4ipUHd.js → pdf-DNWhOzmB.js} +0 -0
- /package/dist/assets/{prechat-B28Vzu55.js → prechat-BuuzFtal.js} +0 -0
- /package/dist/assets/{prechat-names-CRduluk-.js → prechat-names-Bo5bdzfH.js} +0 -0
- /package/dist/assets/{public-asset-Fx_laYnf.js → public-asset-BTisO-cB.js} +0 -0
- /package/dist/assets/{queryOptions-BtNi-_9H.js → queryOptions-DGyQTr3e.js} +0 -0
- /package/dist/assets/{sdk.gen-1aYqVbMj.js → sdk.gen-CC1iYdd0.js} +0 -0
- /package/dist/assets/{semver-yC_Iq9co.js → semver-DpADL11z.js} +0 -0
- /package/dist/assets/{tool-call-status-DTV5jmaU.js → tool-call-status-DNS6Y_vi.js} +0 -0
- /package/dist/assets/{typed-storage-Dctd_K9F.js → typed-storage-Chj38wph.js} +0 -0
- /package/dist/assets/{usage-window-Wgtgd-cv.js → usage-window-dm_mRqGo.js} +0 -0
- /package/dist/assets/{use-is-mobile-Cy10kl9u.js → use-is-mobile-BF5x8sr8.js} +0 -0
- /package/dist/assets/{workflow-status-DmbjJPT4.js → workflow-status-B53qU9DS.js} +0 -0
- /package/dist/assets/{xterm-MKaw0cT7.js → xterm-CQ7wuPsS.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-BFDQtfbG.js → xterm-addon-fit-CamgTlEH.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BaKOqBjF.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-BvHa6F59.js";import{d as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DgWA3A3c.js";import{t as o}from"./jsx-runtime-B-mvcaJS.js";import{t as s}from"./useQuery-cVuP8q1x.js";import{t as c}from"./card-D9_3ngHI.js";import"./src-Dr68ou95.js";import{t as l}from"./tag-64Evw5MO.js";import{t as u}from"./createLucideIcon-D8roAprb.js";import{t as d}from"./arrow-left-BPsKoNcb.js";import{t as f}from"./external-link-h3UAe8eX.js";import{t as p}from"./file-text-Bxj0xAst.js";import{t as m}from"./globe-D7wvOZaZ.js";import{t as h}from"./loader-circle-cYXxWP5B.js";import{Un as g}from"./sdk.gen-CC1iYdd0.js";import{Kt as _,mt as v,pt as y}from"./react-query.gen-BeTpj_Sy.js";import{n as b,r as x,t as S}from"./api-errors-B-g6gvNv.js";import{a as C}from"./routes-Dzl0kj5j.js";import{$r as w,Di as T,Ir as E,L as D,Lr as O,Pr as k,R as A,ia as j}from"./index-3zpPFBeR.js";import{i as M,n as N,r as P,t as F}from"./file-editor-Cy1TZHJJ.js";var I=u(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),L=e(n(),1),R=o();function z({skill:e,className:t,fallback:n=`🧩`}){let[r,i]=(0,L.useState)(!1);return e.icon&&!r?(0,R.jsx)(`img`,{src:`/assistant/skills/${e.id}/${e.icon}`,alt:``,className:`${t} object-contain`,onError:()=>i(!0)}):(0,R.jsx)(`span`,{className:t,children:e.emoji??n})}var B={vellum:{label:`Vellum`,icon:I},clawhub:{label:`Clawhub`,icon:m},skillssh:{label:`skills.sh`,icon:O},custom:{label:`Custom`,icon:k}};function V({origin:e}){let t=e in B?B[e]:{label:e.replace(/-/g,` `),icon:w};return(0,R.jsx)(l,{tone:`neutral`,leftIcon:(0,L.createElement)(t.icon),className:`capitalize`,children:t.label})}function H(e){return e.kind===`installed`||e.kind===`bundled`}function U(e){return e.kind===`catalog`}function W(e){return e.kind===`installed`}function G({assistantId:e,skill:t,onBack:n,onInstall:i,onRemove:a,isInstalling:o=!1,isRemoving:l=!1}){let[u,f]=(0,L.useState)(null),m=U(t),g=W(t),_=s({...v({path:{assistant_id:e,id:t.id}}),select:e=>e??null}),b=(0,L.useMemo)(()=>_.data?.files??[],[_.data]),x=(0,L.useMemo)(()=>b.find(e=>e.name===`SKILL.md`),[b]),S=u??x?.path??null,C=s({...y({path:{assistant_id:e,id:t.id},query:{path:S??``}}),select:e=>e??null,enabled:!!S}),w=b.find(e=>e.path===S);return(0,R.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[(0,R.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,R.jsx)(r,{type:`button`,variant:`ghost`,iconOnly:(0,R.jsx)(d,{"aria-hidden":!0}),"aria-label":`Back to skills`,onClick:n}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,R.jsx)(z,{skill:t,className:`h-8 w-8 text-3xl`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,R.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t.name}),(0,R.jsx)(V,{origin:t.origin})]}),(0,R.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description})]})]}),m?o?(0,R.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,R.jsx)(h,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,R.jsx)(r,{type:`button`,onClick:i,disabled:!i,leftIcon:(0,R.jsx)(j,{"aria-hidden":!0}),children:`Install`}):(0,R.jsx)(r,{type:`button`,variant:g?`dangerOutline`:`outlined`,onClick:a,disabled:!g||l||!a,leftIcon:l?(0,R.jsx)(h,{className:`animate-spin`,"aria-hidden":!0}):(0,R.jsx)(E,{"aria-hidden":!0}),children:`Remove`})]})]}),(0,R.jsx)(c.Root,{asChild:!0,noPadding:!0,children:(0,R.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,R.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:_.isLoading?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,R.jsx)(h,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):b.length===0?(0,R.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files available.`}):b.map(e=>{let t=S===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>f(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,R.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,R.jsx)(p,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:C.isLoading?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,R.jsx)(h,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):w?(0,R.jsx)(K,{assistantId:e,skillId:t.id,fileName:w.name,filePath:w.path,content:C.data?.content??null,isBinary:!!C.data?.isBinary,editable:t.kind===`installed`},`${t.id}/${w.path}`):(0,R.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]})}function K({assistantId:e,skillId:n,fileName:o,filePath:s,content:c,isBinary:l,editable:u}){let d=i(),p=a(),[m,h]=(0,L.useState)(!1),[g,v]=(0,L.useState)(``),y=`skills/${n}/${s}`,b=_({onSuccess:()=>{h(!1),v(``),p.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),p.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),s===`SKILL.md`&&p.invalidateQueries({queryKey:[{_id:`skillsGet`}]})},onError:e=>{t(e,{context:`skill-file-save`,bestEffort:!0})}}),x=m&&g!==(c??``),S=(0,L.useCallback)(()=>{!x||b.isPending||b.mutate({path:{assistant_id:e},body:{path:y,content:g,encoding:`utf8`}})},[x,b,e,y,g]),w=(0,L.useCallback)(()=>{h(!0),v(c??``),b.reset()},[c,b]),T=(0,L.useCallback)(()=>{h(!1),v(``),b.reset()},[b]);if(l)return(0,R.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`});if(c===null)return(0,R.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,o,`.`]});let E=u?(0,R.jsx)(r,{variant:`ghost`,size:`regular`,iconOnly:(0,R.jsx)(f,{"aria-hidden":!0}),onClick:()=>d(`${C.workspace}?file=${encodeURIComponent(y)}`),"aria-label":`Open in Workspace`,className:`hover:bg-[var(--surface-base)]`}):void 0;return A(o,void 0)&&!m?(0,R.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,R.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,R.jsx)(F,{content:c,fileName:o,showEdit:u,isEditing:!1,onToggleEdit:w,extraActions:E}),(0,R.jsx)(D,{content:c})]})}):(0,R.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,R.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,R.jsx)(F,{content:m?g:c,fileName:o,showEdit:u,isEditing:m,onToggleEdit:()=>m?T():w(),extraActions:E}),m?(0,R.jsx)(P,{value:g,onChange:v,onSave:S}):(0,R.jsx)(M,{content:c,readOnly:!u,onStartEdit:w})]}),m&&(0,R.jsx)(N,{isDirty:x,isSaving:b.isPending,error:b.isError?`Save failed`:null,onSave:S,onDiscard:T})]})}async function q(e,t,n){let{data:r,error:i,response:a}=await g({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1});if(b(a,i,`Failed to install skill.`),!a.ok)throw new S(a.status,x(i,a,`Failed to install skill.`));return r??{ok:!0}}export{W as a,I as c,H as i,G as n,V as o,U as r,z as s,q as t};
|
|
@@ -0,0 +1 @@
|
|
|
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-BaKOqBjF.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-BvHa6F59.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-DgWA3A3c.js";import{a as m,c as h,i as g,l as _,n as v,o as y,r as b,s as x,u as S}from"./useBaseQuery-BOw_gWPH.js";import{t as C}from"./jsx-runtime-B-mvcaJS.js";import{t as w}from"./useQuery-cVuP8q1x.js";import{t as T}from"./card-D9_3ngHI.js";import{n as E,t as D}from"./panel-item-DN2CyWOT.js";import{t as O}from"./confirm-dialog-BtxNY4WU.js";import{t as k}from"./notice-BhqKj_VM.js";import{t as A}from"./popover-BIr0nN9H.js";import{t as j}from"./input-BLN3wmw2.js";import{t as M}from"./toggle-zADptotB.js";import{n as N,t as P}from"./list-row-l7sxQ4Tj.js";import{t as F}from"./modal-CH2iwSBx.js";import{n as I}from"./toast-VJ6jFKB9.js";import{t as L}from"./createLucideIcon-D8roAprb.js";import{t as ee}from"./check-DwLoiFa9.js";import{t as R}from"./chevron-right-DP15nqFC.js";import{t as z}from"./circle-alert-BB_iJtM8.js";import{t as B}from"./circle-check-Cwv8JCfw.js";import{t as V}from"./external-link-h3UAe8eX.js";import{t as H}from"./loader-circle-cYXxWP5B.js";import{t as U}from"./log-in-Ci5ja9sN.js";import{t as W}from"./pencil-DUMCM9m-.js";import{t as te}from"./refresh-cw-kmptQnpX.js";import{t as ne}from"./sparkles-C8eL4LNF.js";import{t as re}from"./x-Bn5tweDc.js";import{hr as G}from"./sdk.gen-CC1iYdd0.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-BeTpj_Sy.js";import{r as me}from"./api-errors-B-g6gvNv.js";import{L as he,M as ge}from"./auth-store-BzL2lSd1.js";import{r as _e}from"./api-DXPKXkDj.js";import{a as ve}from"./routes-Dzl0kj5j.js";import{n as ye}from"./use-is-mobile-BF5x8sr8.js";import{t as be}from"./assistant-feature-flag-store-Ceb6N94N.js";import{S as xe,b as K,vt as Se,x as Ce,yt as we}from"./react-query.gen-breoeUVK.js";import{n as Te,t as Ee}from"./browser-CDQJAXkC.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,bt as Fe,ei as Ie,in as Le,mi as Re,nn as ze,qi as Be,ti as X,wt as Ve,x as He,xi as Ue,xt as We}from"./index-3zpPFBeR.js";import{t as Ge}from"./use-active-assistant-id-jfqnc4T7.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 S(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=_(),a=h(),o=Z.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{v(e),m(e,a,r.getQueryCache().get(e.queryHash))}),x(a);let[s]=Z.useState(()=>new Je(r,o,t)),[c,l,d]=s.getOptimisticResult(o,t.combine),C=!i&&t.subscribed!==!1;Z.useSyncExternalStore(Z.useCallback(e=>C?s.subscribe(f.batchCalls(e)):u,[s,C]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),Z.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let w=c.some((e,t)=>g(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&g(n,e)?b(n,new S(r,n),a):[]}):[];if(w.length>0)throw Promise.all(w);let T=c.find((e,t)=>{let n=o[t];return n&&y({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=Fe(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=C();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=w({...ae({path:{assistant_id:e},query:{provider_key:t}}),select:e=>e.apps}),s=w({...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(``),C(``),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)(``),[S,C]=(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=S.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:S,onChange:e=>C(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(``),C(``)},disabled:P,children:`Cancel`}):null,(0,Q.jsx)(a,{type:`button`,size:`compact`,onClick:z,disabled:P||!b.trim()||!S.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=!ze(),[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}=w({...K({path:{assistant_id:t}}),enabled:u}),S=(b??[]).filter(e=>e.provider===n&&e.connected),{handleConnect:C,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:S,connectionsLoading:x,startPending:E,oauthInProgress:T,disconnectingId:k.isPending?h:null,onConnect:C,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:Be,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)(Be,{"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:Ie,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),[S,C]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(null),[D,k]=(0,Z.useState)(null),{data:A,isLoading:j,isError:M}=w({queryKey:[Dt,e],queryFn:()=>ft(e)}),{data:N}=w({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()=>{C(!0);try{await bt(e),P(),I.success(`MCP servers reloaded`)}catch{I.error(`Failed to reload MCP servers`)}finally{C(!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:S?`animate-spin`:``}),onClick:W,disabled:S,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=Le(),[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 S=()=>{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:C,isLoading:T}=Mt(c?.id,a===`full`),{data:E,isLoading:D,isError:O}=w({...de({path:{assistant_id:c?.id??``}}),select:e=>e.providers,enabled:!!c}),{data:M,isLoading:N}=w({...K({path:{assistant_id:C??``}}),enabled:!!C&&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:S,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:C??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:C??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 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{i as n,n as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{i as n,n as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-B-mvcaJS.js";import{t as o}from"./cn-CFvi8Z0K.js";import{t as s}from"./typography-COqg6o2z.js";import"./src-Dr68ou95.js";import{a as c}from"./routes-Dzl0kj5j.js";import{n as l}from"./use-is-mobile-BF5x8sr8.js";import{t as u}from"./assistant-identity-store-ESeBny_J.js";import{t as d}from"./assistant-feature-flag-store-Ceb6N94N.js";import{Qt as f}from"./index-3zpPFBeR.js";import{t as p}from"./page-shell-cu3KBmqd.js";var m=e(t(),1),h=a(),g=[{label:`Identity`,to:c.identity},{label:`Skills`,to:c.skills},{label:`Workspace`,to:c.workspace},{label:`Contacts`,to:c.contacts.root}],_={label:`Plugins`,to:c.plugins};function v(){let e=u.use.name(),t=d.use.hasHydrated(),a=d.use.externalPlugins(),{pathname:c}=i(),v=l(),y=f.use.setTopBarCenter();(0,m.useEffect)(()=>(y(v?(0,h.jsxs)(s,{variant:`body-medium-default`,className:`truncate text-[var(--content-secondary)]`,children:[`About `,e||`Assistant`]}):null),()=>{y(null)}),[v,e,y]);let b=t&&a?[g[0],_,...g.slice(1)]:g;return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`mb-4 shrink-0 text-title-large text-[var(--content-default)] max-md:hidden`,children:[`About `,e||`Assistant`]}),(0,h.jsx)(`nav`,{className:`mb-4 flex shrink-0 items-center overflow-x-auto border-b border-[var(--border-base)]`,style:{scrollbarWidth:`none`,WebkitOverflowScrolling:`touch`},"aria-label":`About assistant sections`,children:b.map(({label:e,to:t})=>{let n=c===t||c.startsWith(t+`/`);return(0,h.jsx)(r,{to:t,className:o(`relative -mb-px inline-flex cursor-pointer items-center gap-1.5 border-b-2 border-transparent bg-transparent px-2.5 py-[7px]`,`text-body-medium-default whitespace-nowrap`,`text-[var(--content-secondary)] transition-colors`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-0`,`hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,n&&`border-[var(--border-active)] text-[var(--primary-active)]`,n&&`hover:bg-transparent`),children:e},t)})}),(0,h.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:(0,h.jsx)(n,{})})]})}export{v as IntelligenceLayout};
|
package/dist/assets/{keyboard-shortcuts-page-kiOEZKzE.js → keyboard-shortcuts-page-Capx1ICA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BvHa6F59.js";import{r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-B-mvcaJS.js";import{t as a}from"./card-D9_3ngHI.js";import{t as o}from"./notice-BhqKj_VM.js";import{t as s}from"./shortcut-keys-D4E8qQgS.js";import{t as c}from"./is-electron-URCUw74P.js";import{t as l}from"./x-Bn5tweDc.js";import{a as u}from"./routes-Dzl0kj5j.js";import{Zr as d}from"./index-3zpPFBeR.js";var f=e(t(),1);async function p(){if(!c())return[];let e=window.vellum;return e?.hotkeys?e.hotkeys.get():[]}async function m(e,t){if(!c())return;let n=window.vellum;n?.hotkeys&&await n.hotkeys.set(e,t)}function h(e){if(!c())return()=>{};let t=window.vellum;return t?.hotkeys?t.hotkeys.onChange(e):()=>{}}var g={ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`,Enter:`Return`,NumpadEnter:`Return`,Space:`Space`,Tab:`Tab`,Escape:`Escape`,Backspace:`Backspace`,Delete:`Delete`,Insert:`Insert`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`,Minus:`-`,Equal:`=`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Semicolon:`;`,Quote:`'`,Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`},_=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`ShiftLeft`,`ShiftRight`]),v=e=>{let t=e.code;return _.has(t)?null:/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^Numpad[0-9]$/.test(t)?`num${t.slice(6)}`:/^F[0-9]{1,2}$/.test(t)?t:g[t]??null},y=e=>{let t=v(e);if(t===null)return null;let n=[];return e.metaKey&&n.push(`CmdOrCtrl`),e.ctrlKey&&n.push(`Control`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`),[...n,t].join(`+`)},b=(e,t,n)=>n===``?null:e.find(e=>e.key!==t&&e.accelerator===n)??null,x=i(),S=[{scope:`global`,title:`Global shortcuts`,description:`Work anywhere, even when Vellum is in the background.`},{scope:`menu`,title:`App shortcuts`,description:`Work while a Vellum window is focused.`}];function C({hotkey:e,recording:t,conflictLabel:r,onStartRecording:i,onCancelRecording:a,onReset:o,onRemove:c}){let u=e.accelerator===``,f=e.override!==null;return(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-2`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e.label}),r!==null&&(0,x.jsxs)(`div`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:[`Already used by `,r]})]}),(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,x.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Recording… press a shortcut, or Esc to cancel`}):u?(0,x.jsx)(`span`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`Disabled`}):(0,x.jsx)(s,{accelerator:e.accelerator}),t?(0,x.jsx)(n,{variant:`ghost`,size:`compact`,onClick:a,children:`Cancel`}):(0,x.jsx)(n,{variant:`outlined`,size:`compact`,onClick:i,"aria-label":`Record shortcut for ${e.label}`,children:`Record`}),(0,x.jsx)(n,{variant:`ghost`,size:`compact`,disabled:!f,leftIcon:(0,x.jsx)(d,{className:`h-3.5 w-3.5`}),onClick:o,"aria-label":`Reset ${e.label} to default`}),(0,x.jsx)(n,{variant:`ghost`,size:`compact`,disabled:u,leftIcon:(0,x.jsx)(l,{className:`h-3.5 w-3.5`}),onClick:c,"aria-label":`Remove ${e.label} binding`})]})]})}function w(){let[e,t]=(0,f.useState)([]),[n,i]=(0,f.useState)(null),[s,l]=(0,f.useState)(null),d=(0,f.useCallback)(()=>{p().then(t)},[]);(0,f.useEffect)(()=>(d(),h(t)),[d]);let g=(0,f.useCallback)(()=>{i(null),l(null)},[]);(0,f.useEffect)(()=>{if(n===null)return;let t=t=>{if(t.preventDefault(),t.stopPropagation(),t.code===`Escape`){g();return}let r=y(t);if(r===null)return;let i=b(e,n,r);if(i!==null){l({key:n,label:i.label});return}m(n,r).then(d),g()};return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[n,e,d,g]);let _=(0,f.useCallback)(e=>{l(null),i(e)},[]),v=(0,f.useCallback)(t=>{let n=b(e,t,e.find(e=>e.key===t)?.defaultAccelerator??``);if(n!==null){i(null),l({key:t,label:n.label});return}g(),m(t,null).then(d)},[e,d,g]),w=(0,f.useCallback)(e=>{g(),m(e,``).then(d)},[d,g]),T=(0,f.useMemo)(()=>S.map(t=>({...t,commands:e.filter(e=>e.rebindable&&e.scope===t.scope)})).filter(e=>e.commands.length>0),[e]);return c()?(0,x.jsxs)(`div`,{className:`space-y-4`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Keyboard Shortcuts`}),(0,x.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Customize the shortcuts for Vellum's commands.`})]}),s!==null&&(0,x.jsxs)(o,{tone:`warning`,children:[`That shortcut is already used by `,s.label,`.`,` `,n===null?`Remove or change that binding before resetting.`:`Pick a different combination, or press Esc to cancel.`]}),T.map(e=>(0,x.jsxs)(a,{bordered:!0,children:[(0,x.jsxs)(`div`,{className:`mb-2`,children:[(0,x.jsx)(`div`,{className:`text-body-medium-emphasised text-[var(--content-default)]`,children:e.title}),(0,x.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,x.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:e.commands.map(e=>(0,x.jsx)(C,{hotkey:e,recording:n===e.key,conflictLabel:s!==null&&s.key===e.key?s.label:null,onStartRecording:()=>_(e.key),onCancelRecording:g,onReset:()=>v(e.key),onRemove:()=>w(e.key)},e.key))})]},e.scope))]}):(0,x.jsx)(r,{replace:!0,to:u.settings.general})}export{w as KeyboardShortcutsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,r as t,t as n}from"./chunk-jRWAZmH_.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";function a(){}function o(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function s(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var c=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,u={};function d(e,t){return((t||u).jsx?l:c).test(e)}var f=/[ \t\n\f\r]/g;function p(e){return typeof e==`object`?e.type===`text`?m(e.value):!1:m(e)}function m(e){return e.replace(f,``)===``}var h=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};h.prototype.normal={},h.prototype.property={},h.prototype.space=void 0;function g(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new h(n,r,t)}function _(e){return e.toLowerCase()}var v=class{constructor(e,t){this.attribute=t,this.property=e}};v.prototype.attribute=``,v.prototype.booleanish=!1,v.prototype.boolean=!1,v.prototype.commaOrSpaceSeparated=!1,v.prototype.commaSeparated=!1,v.prototype.defined=!1,v.prototype.mustUseProperty=!1,v.prototype.number=!1,v.prototype.overloadedBoolean=!1,v.prototype.property=``,v.prototype.spaceSeparated=!1,v.prototype.space=void 0;var y=t({boolean:()=>x,booleanish:()=>S,commaOrSpaceSeparated:()=>D,commaSeparated:()=>E,number:()=>w,overloadedBoolean:()=>C,spaceSeparated:()=>T}),b=0,x=O(),S=O(),C=O(),w=O(),T=O(),E=O(),D=O();function O(){return 2**++b}var k=Object.keys(y),A=class extends v{constructor(e,t,n,r){let i=-1;if(super(e,t),ee(this,`space`,r),typeof n==`number`)for(;++i<k.length;){let e=k[i];ee(this,k[i],(n&y[e])===y[e])}}};A.prototype.defined=!0;function ee(e,t,n){n&&(e[t]=n)}function j(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new A(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_(r)]=r,n[_(a.attribute)]=r}return new h(t,n,e.space)}var M=j({properties:{ariaActiveDescendant:null,ariaAtomic:S,ariaAutoComplete:null,ariaBusy:S,ariaChecked:S,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:T,ariaCurrent:null,ariaDescribedBy:T,ariaDetails:null,ariaDisabled:S,ariaDropEffect:T,ariaErrorMessage:null,ariaExpanded:S,ariaFlowTo:T,ariaGrabbed:S,ariaHasPopup:null,ariaHidden:S,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:T,ariaLevel:w,ariaLive:null,ariaModal:S,ariaMultiLine:S,ariaMultiSelectable:S,ariaOrientation:null,ariaOwns:T,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:S,ariaReadOnly:S,ariaRelevant:null,ariaRequired:S,ariaRoleDescription:T,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:S,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function N(e,t){return t in e?e[t]:t}function P(e,t){return N(e,t.toLowerCase())}var F=j({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:E,acceptCharset:T,accessKey:T,action:null,allow:null,allowFullScreen:x,allowPaymentRequest:x,allowUserMedia:x,alpha:x,alt:null,as:null,async:x,autoCapitalize:null,autoComplete:T,autoFocus:x,autoPlay:x,blocking:T,capture:null,charSet:null,checked:x,cite:null,className:T,closedBy:null,colorSpace:null,cols:w,colSpan:w,command:null,commandFor:null,content:null,contentEditable:S,controls:x,controlsList:T,coords:w|E,crossOrigin:null,data:null,dateTime:null,decoding:null,default:x,defer:x,dir:null,dirName:null,disabled:x,download:C,draggable:S,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:x,formTarget:null,headers:T,height:w,hidden:C,high:w,href:null,hrefLang:null,htmlFor:T,httpEquiv:T,id:null,imageSizes:null,imageSrcSet:null,inert:x,inputMode:null,integrity:null,is:null,isMap:x,itemId:null,itemProp:T,itemRef:T,itemScope:x,itemType:T,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:x,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:x,muted:x,name:null,nonce:null,noModule:x,noValidate:x,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:x,optimum:w,pattern:null,ping:T,placeholder:null,playsInline:x,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:x,referrerPolicy:null,rel:T,required:x,reversed:x,rows:w,rowSpan:w,sandbox:T,scope:null,scoped:x,seamless:x,selected:x,shadowRootClonable:x,shadowRootCustomElementRegistry:x,shadowRootDelegatesFocus:x,shadowRootMode:null,shadowRootSerializable:x,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:S,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:x,useMap:null,value:S,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:T,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:x,declare:x,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:x,noHref:x,noShade:x,noWrap:x,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:S,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:x,disablePictureInPicture:x,disableRemotePlayback:x,exportParts:E,part:T,prefix:null,property:null,results:w,security:null,unselectable:null},space:`html`,transform:P}),I=j({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:D,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:T,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:x,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:E,g2:E,glyphName:E,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:D,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:T,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D,rev:D,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D,requiredFeatures:D,requiredFonts:D,requiredFormats:D,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:D,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:N}),L=j({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),te=j({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:P}),ne=j({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),re={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ie=/[A-Z]/g,ae=/-[a-z]/g,oe=/^data[-\w.:]+$/i;function se(e,t){let n=_(t),r=t,i=v;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&oe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ae,le);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ae.test(e)){let n=e.replace(ie,ce);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=A}return new i(r,t)}function ce(e){return`-`+e.toLowerCase()}function le(e){return e.charAt(1).toUpperCase()}var ue=g([M,F,L,te,ne],`html`),de=g([M,I,L,te,ne],`svg`);function fe(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function pe(e){return e.join(` `).trim()}var me=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
1
|
+
import{o as e,r as t,t as n}from"./chunk-jRWAZmH_.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./jsx-runtime-B-mvcaJS.js";function a(){}function o(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function s(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var c=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,u={};function d(e,t){return((t||u).jsx?l:c).test(e)}var f=/[ \t\n\f\r]/g;function p(e){return typeof e==`object`?e.type===`text`?m(e.value):!1:m(e)}function m(e){return e.replace(f,``)===``}var h=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};h.prototype.normal={},h.prototype.property={},h.prototype.space=void 0;function g(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new h(n,r,t)}function _(e){return e.toLowerCase()}var v=class{constructor(e,t){this.attribute=t,this.property=e}};v.prototype.attribute=``,v.prototype.booleanish=!1,v.prototype.boolean=!1,v.prototype.commaOrSpaceSeparated=!1,v.prototype.commaSeparated=!1,v.prototype.defined=!1,v.prototype.mustUseProperty=!1,v.prototype.number=!1,v.prototype.overloadedBoolean=!1,v.prototype.property=``,v.prototype.spaceSeparated=!1,v.prototype.space=void 0;var y=t({boolean:()=>x,booleanish:()=>S,commaOrSpaceSeparated:()=>D,commaSeparated:()=>E,number:()=>w,overloadedBoolean:()=>C,spaceSeparated:()=>T}),b=0,x=O(),S=O(),C=O(),w=O(),T=O(),E=O(),D=O();function O(){return 2**++b}var k=Object.keys(y),A=class extends v{constructor(e,t,n,r){let i=-1;if(super(e,t),ee(this,`space`,r),typeof n==`number`)for(;++i<k.length;){let e=k[i];ee(this,k[i],(n&y[e])===y[e])}}};A.prototype.defined=!0;function ee(e,t,n){n&&(e[t]=n)}function j(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new A(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_(r)]=r,n[_(a.attribute)]=r}return new h(t,n,e.space)}var M=j({properties:{ariaActiveDescendant:null,ariaAtomic:S,ariaAutoComplete:null,ariaBusy:S,ariaChecked:S,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:T,ariaCurrent:null,ariaDescribedBy:T,ariaDetails:null,ariaDisabled:S,ariaDropEffect:T,ariaErrorMessage:null,ariaExpanded:S,ariaFlowTo:T,ariaGrabbed:S,ariaHasPopup:null,ariaHidden:S,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:T,ariaLevel:w,ariaLive:null,ariaModal:S,ariaMultiLine:S,ariaMultiSelectable:S,ariaOrientation:null,ariaOwns:T,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:S,ariaReadOnly:S,ariaRelevant:null,ariaRequired:S,ariaRoleDescription:T,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:S,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function N(e,t){return t in e?e[t]:t}function P(e,t){return N(e,t.toLowerCase())}var F=j({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:E,acceptCharset:T,accessKey:T,action:null,allow:null,allowFullScreen:x,allowPaymentRequest:x,allowUserMedia:x,alpha:x,alt:null,as:null,async:x,autoCapitalize:null,autoComplete:T,autoFocus:x,autoPlay:x,blocking:T,capture:null,charSet:null,checked:x,cite:null,className:T,closedBy:null,colorSpace:null,cols:w,colSpan:w,command:null,commandFor:null,content:null,contentEditable:S,controls:x,controlsList:T,coords:w|E,crossOrigin:null,data:null,dateTime:null,decoding:null,default:x,defer:x,dir:null,dirName:null,disabled:x,download:C,draggable:S,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:x,formTarget:null,headers:T,height:w,hidden:C,high:w,href:null,hrefLang:null,htmlFor:T,httpEquiv:T,id:null,imageSizes:null,imageSrcSet:null,inert:x,inputMode:null,integrity:null,is:null,isMap:x,itemId:null,itemProp:T,itemRef:T,itemScope:x,itemType:T,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:x,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:x,muted:x,name:null,nonce:null,noModule:x,noValidate:x,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:x,optimum:w,pattern:null,ping:T,placeholder:null,playsInline:x,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:x,referrerPolicy:null,rel:T,required:x,reversed:x,rows:w,rowSpan:w,sandbox:T,scope:null,scoped:x,seamless:x,selected:x,shadowRootClonable:x,shadowRootCustomElementRegistry:x,shadowRootDelegatesFocus:x,shadowRootMode:null,shadowRootSerializable:x,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:S,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:x,useMap:null,value:S,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:T,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:x,declare:x,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:x,noHref:x,noShade:x,noWrap:x,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:S,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:x,disablePictureInPicture:x,disableRemotePlayback:x,exportParts:E,part:T,prefix:null,property:null,results:w,security:null,unselectable:null},space:`html`,transform:P}),I=j({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:D,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:T,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:x,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:E,g2:E,glyphName:E,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:D,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:T,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D,rev:D,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D,requiredFeatures:D,requiredFonts:D,requiredFormats:D,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:D,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:N}),L=j({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),te=j({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:P}),ne=j({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),re={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ie=/[A-Z]/g,ae=/-[a-z]/g,oe=/^data[-\w.:]+$/i;function se(e,t){let n=_(t),r=t,i=v;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&oe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ae,le);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ae.test(e)){let n=e.replace(ie,ce);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=A}return new i(r,t)}function ce(e){return`-`+e.toLowerCase()}function le(e){return e.charAt(1).toUpperCase()}var ue=g([M,F,L,te,ne],`html`),de=g([M,I,L,te,ne],`svg`);function fe(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function pe(e){return e.join(` `).trim()}var me=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
2
2
|
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),he=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(me());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),ge=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),_e=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(he()),r=ge();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),ve=be(`end`),ye=be(`start`);function be(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function xe(e){let t=ye(e),n=ve(e);if(t&&n)return{start:t,end:n}}function Se(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?we(e.position):`start`in e||`end`in e?we(e):`line`in e||`column`in e?Ce(e):``}function Ce(e){return Te(e&&e.line)+`:`+Te(e&&e.column)}function we(e){return Ce(e&&e.start)+`-`+Ce(e&&e.end)}function Te(e){return e&&typeof e==`number`?e:1}var R=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Se(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};R.prototype.file=``,R.prototype.name=``,R.prototype.reason=``,R.prototype.message=``,R.prototype.stack=``,R.prototype.column=void 0,R.prototype.line=void 0,R.prototype.ancestors=void 0,R.prototype.cause=void 0,R.prototype.fatal=void 0,R.prototype.place=void 0,R.prototype.ruleId=void 0,R.prototype.source=void 0;var Ee=e(_e(),1),De={}.hasOwnProperty,Oe=new Map,ke=/[A-Z]/g,Ae=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),je=new Set([`td`,`th`]),Me=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ne(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=We(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Ue(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?de:ue,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Pe(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Pe(e,t,n){if(t.type===`element`)return Fe(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ie(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Re(e,t,n);if(t.type===`mdxjsEsm`)return Le(e,t);if(t.type===`root`)return ze(e,t,n);if(t.type===`text`)return Be(e,t)}function Fe(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=de,e.schema=i),e.ancestors.push(t);let a=Xe(e,t.tagName,!1),o=Ge(e,t),s=qe(e,t);return Ae.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!p(e):!0})),Ve(e,o,a,t),He(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ie(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ze(e,t.position)}function Le(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ze(e,t.position)}function Re(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=de,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Xe(e,t.name,!0),o=Ke(e,t),s=qe(e,t);return Ve(e,o,a,t),He(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ze(e,t,n){let r={};return He(r,qe(e,t)),e.create(t,e.Fragment,r,n)}function Be(e,t){return t.value}function Ve(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function He(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ue(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function We(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ye(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Ge(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&De.call(t.properties,i)){let a=Je(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&je.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Ke(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ze(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Ze(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function qe(e,t){let n=[],r=-1,i=e.passKeys?new Map:Oe;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Pe(e,a,o);s!==void 0&&n.push(s)}return n}function Je(e,t,n){let r=se(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?s(n):pe(n)),r.property===`style`){let t=typeof n==`object`?n:Ye(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Qe(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?re[r.property]||r.property:r.attribute,n]}}function Ye(e,t){try{return(0,Ee.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new R("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Me+`#cannot-parse-style-attribute`,r}}function Xe(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=d(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=d(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return De.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ze(e)}function Ze(e,t){let n=new R("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Me+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Qe(e){let t={},n;for(n in e)De.call(e,n)&&(t[$e(n)]=e[n]);return t}function $e(e){let t=e.replace(ke,et);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function et(e){return`-`+e.toLowerCase()}var tt={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},nt={};function rt(e,t){let n=t||nt;return it(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function it(e,t,n){if(ot(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return at(e.children,t,n)}return Array.isArray(e)?at(e,t,n):``}function at(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=it(e[i],t,n);return r.join(``)}function ot(e){return!!(e&&typeof e==`object`)}var st=document.createElement(`i`);function ct(e){let t=`&`+e+`;`;st.innerHTML=t;let n=st.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function z(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function B(e,t){return e.length>0?(z(e,e.length,0,t),e):t}var lt={}.hasOwnProperty;function ut(e){let t={},n=-1;for(;++n<e.length;)dt(t,e[n]);return t}function dt(e,t){let n;for(n in t){let r=(lt.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){lt.call(r,a)||(r[a]=[]);let e=i[a];ft(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ft(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);z(e,0,0,r)}function pt(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function V(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var H=q(/[A-Za-z]/),U=q(/[\dA-Za-z]/),mt=q(/[#-'*+\--9=?A-Z^-~]/);function ht(e){return e!==null&&(e<32||e===127)}var gt=q(/\d/),_t=q(/[\dA-Fa-f]/),vt=q(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}var yt=q(/\p{P}|\p{S}/u),bt=q(/\s/);function q(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function J(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&U(e.charCodeAt(n+1))&&U(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return K(r)?(e.enter(n),s(r)):t(r)}function s(r){return K(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var xt={tokenize:St};function St(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Ct={tokenize:Tt},wt={tokenize:Et};function Tt(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return z(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wt,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(wt,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return W(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;z(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Et(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Dt(e){if(e===null||G(e)||bt(e))return 1;if(yt(e))return 2}function Ot(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var kt={name:`attention`,resolveAll:At,tokenize:jt};function At(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Mt(d,-c),Mt(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=B(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=B(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=B(l,Ot(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=B(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=B(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,z(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function jt(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Dt(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Dt(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Mt(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Nt={name:`autolink`,tokenize:Pt};function Pt(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return H(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||U(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||U(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||ht(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):mt(t)?(e.consume(t),l):n(t)}function u(e){return U(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||U(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Ft={partial:!0,tokenize:It};function It(e,t,n){return r;function r(t){return K(t)?Y(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var Lt={continuation:{tokenize:zt},exit:Bt,name:`blockQuote`,tokenize:Rt};function Rt(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return K(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function zt(e,t,n){let r=this;return i;function i(t){return K(t)?Y(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Lt,t,n)(r)}}function Bt(e){e.exit(`blockQuote`)}var Vt={name:`characterEscape`,tokenize:Ht};function Ht(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return vt(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Ut={name:`characterReference`,tokenize:Wt};function Wt(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=U,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=_t,u):(e.enter(`characterReferenceValue`),a=7,o=gt,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===U&&!ct(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Gt={partial:!0,tokenize:Jt},Kt={concrete:!0,name:`codeFenced`,tokenize:qt};function qt(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),K(t)?Y(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Gt,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Y(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&K(t)?Y(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(Gt,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),K(t)?Y(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),K(t)?Y(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Jt(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Yt={name:`codeIndented`,tokenize:Zt},Xt={partial:!0,tokenize:Qt};function Zt(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Y(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):W(t)?e.attempt(Xt,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||W(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Qt(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Y(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):W(e)?i(e):n(e)}}var $t={name:`codeText`,previous:tn,resolve:en,tokenize:nn};function en(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function tn(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function nn(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||W(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var rn=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&an(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),an(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),an(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);an(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);an(this.left,t.reverse())}}};function an(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function on(e){let t={},n=-1,r,i,a,o,s,c,l,u=new rn(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,sn(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return z(e,0,1/0,u.slice(0)),!l}function sn(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var cn={resolve:un,tokenize:dn},ln={partial:!0,tokenize:fn};function un(e){return on(e),e}function dn(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):W(t)?e.check(ln,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function fn(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,a,`linePrefix`)}function a(i){if(i===null||W(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function pn(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||ht(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||W(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||G(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||ht(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function mn(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):W(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!K(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function hn(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function gn(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):K(i)?Y(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var _n={name:`definition`,tokenize:yn},vn={partial:!0,tokenize:bn};function yn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return mn.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=V(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return G(t)?gn(e,l)(t):l(t)}function l(t){return pn(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(vn,d,d)(t)}function d(t){return K(t)?Y(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function bn(e,t,n){return r;function r(t){return G(t)?gn(e,i)(t):n(t)}function i(t){return hn(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return K(t)?Y(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var xn={name:`hardBreakEscape`,tokenize:Sn};function Sn(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Cn={name:`headingAtx`,resolve:wn,tokenize:Tn};function wn(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},z(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Tn(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||G(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):K(n)?Y(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||G(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var En=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Dn=[`pre`,`script`,`style`,`textarea`],On={concrete:!0,name:`htmlFlow`,resolveTo:jn,tokenize:Mn},kn={partial:!0,tokenize:Pn},An={partial:!0,tokenize:Nn};function jn(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Mn(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):H(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):H(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return H(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||G(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Dn.includes(l)?(i=1,r.interrupt?t(s):O(s)):En.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||U(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return K(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||H(t)?(e.consume(t),b):K(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||U(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):K(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):K(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||G(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||K(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):K(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),I):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(kn,L,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(An,A,L)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),F):O(t)}function M(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Dn.includes(n)?(e.consume(t),I):O(t)}return H(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),I):t===45&&i===2?(e.consume(t),F):O(t)}function I(t){return t===null||W(t)?(e.exit(`htmlFlowData`),L(t)):(e.consume(t),I)}function L(n){return e.exit(`htmlFlow`),t(n)}}function Nn(e,t,n){let r=this;return i;function i(t){return W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Pn(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Ft,t,n)}}var Fn={name:`htmlText`,tokenize:In};function In(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):H(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):H(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):W(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):W(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):W(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return H(t)?(e.consume(t),S):n(t)}function S(t){return t===45||U(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,M(t)):K(t)?(e.consume(t),C):j(t)}function w(t){return t===45||U(t)?(e.consume(t),w):t===47||t===62||G(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||H(t)?(e.consume(t),E):W(t)?(o=T,M(t)):K(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||U(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,M(t)):K(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):W(t)?(o=O,M(t)):K(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):W(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||G(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||G(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return K(t)?Y(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}var Ln={name:`labelEnd`,resolveAll:Vn,resolveTo:Hn,tokenize:Un},Rn={tokenize:Wn},zn={tokenize:Gn},Bn={tokenize:Kn};function Vn(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&z(e,0,e.length,n),e}function Hn(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=B(s,e.slice(a+1,a+r+3)),s=B(s,[[`enter`,u,t]]),s=B(s,Ot(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=B(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=B(s,e.slice(o+1)),s=B(s,[[`exit`,c,t]]),z(e,a,e.length,s),e}function Un(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(V(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Rn,u,o?u:d)(t):t===91?e.attempt(zn,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Bn,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Wn(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return G(t)?gn(e,a)(t):a(t)}function a(t){return t===41?u(t):pn(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return G(t)?gn(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?hn(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return G(t)?gn(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Gn(e,t,n){let r=this;return i;function i(t){return mn.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(V(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Kn(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var qn={name:`labelStartImage`,resolveAll:Ln.resolveAll,tokenize:Jn};function Jn(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Yn={name:`labelStartLink`,resolveAll:Ln.resolveAll,tokenize:Xn};function Xn(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Zn={name:`lineEnding`,tokenize:Qn};function Qn(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y(e,t,`linePrefix`)}}var $n={name:`thematicBreak`,tokenize:er};function er(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),K(t)?Y(e,s,`whitespace`)(t):s(t))}}var X={continuation:{tokenize:ir},exit:or,name:`list`,tokenize:rr},tr={partial:!0,tokenize:sr},nr={partial:!0,tokenize:ar};function rr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:gt(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check($n,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return gt(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Ft,r.interrupt?n:u,e.attempt(tr,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return K(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ir(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ft,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!K(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(X,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ar(e,t,n){let r=this;return Y(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function or(e){e.exit(this.containerState.type)}function sr(e,t,n){let r=this;return Y(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!K(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var cr={name:`setextUnderline`,resolveTo:lr,tokenize:ur};function lr(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function ur(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),K(t)?Y(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var dr={tokenize:fr};function fr(e){let t=this,n=e.attempt(Ft,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(cn,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var pr={resolveAll:_r()},mr=gr(`string`),hr=gr(`text`);function gr(e){return{resolveAll:_r(e===`text`?vr:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function _r(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function vr(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var yr=t({attentionMarkers:()=>Dr,contentInitial:()=>xr,disable:()=>Or,document:()=>br,flow:()=>Cr,flowInitial:()=>Sr,insideSpan:()=>Er,string:()=>wr,text:()=>Tr}),br={42:X,43:X,45:X,48:X,49:X,50:X,51:X,52:X,53:X,54:X,55:X,56:X,57:X,62:Lt},xr={91:_n},Sr={[-2]:Yt,[-1]:Yt,32:Yt},Cr={35:Cn,42:$n,45:[cr,$n],60:On,61:cr,95:$n,96:Kt,126:Kt},wr={38:Ut,92:Vt},Tr={[-5]:Zn,[-4]:Zn,[-3]:Zn,33:qn,38:Ut,42:kt,60:[Nt,Fn],91:Yn,92:[xn,Vt],93:Ln,95:kt,96:$t},Er={null:[kt,pr]},Dr={null:[42,95]},Or={null:[]};function kr(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=B(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ot(a,l.events,l),l.events):[]}function f(e,t){return jr(p(e),t)}function p(e){return Ar(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){W(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&z(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ar(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function jr(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
3
3
|
`;break;case-3:o=`\r
|
|
4
4
|
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Mr(e){let t={constructs:ut([yr,...(e||{}).extensions||[]]),content:n(xt),defined:[],document:n(Ct),flow:n(dr),lazy:{},string:n(mr),text:n(hr)};return t;function n(e){return n;function n(n){return kr(t,e,n)}}}function Nr(e){for(;!on(e););return e}var Pr=/[\0\t\n\r]/g;function Fr(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Pr.lastIndex=u,c=Pr.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Ir=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Lr(e){return e.replace(Ir,Rr)}function Rr(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return pt(n.slice(t?2:1),t?16:10)}return ct(n)||e}var zr={}.hasOwnProperty;function Br(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Vr(n)(Nr(Mr(n).document().write(Fr()(e,t,!0))))}function Vr(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(pe),blockQuote:a(ce),characterEscape:T,characterReference:T,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(ue,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(de),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(fe),hardBreakEscape:a(me),hardBreakTrailing:a(me),htmlFlow:a(he,o),htmlFlowData:T,htmlText:a(he,o),htmlTextData:T,image:a(ge),label:o,link:a(_e),listItem:a(ye),listItemValue:f,listOrdered:a(ve,d),listUnordered:a(ve),paragraph:a(be),reference:te,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(pe),strong:a(xe),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:se,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ie,characterReference:ae,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:P,labelText:N,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ne,resourceDestinationString:F,resourceTitleString:I,resource:L,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Hr(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];zr.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Wr).call(a,void 0,e[0])}for(r.position={start:Z(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Z(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Z(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Wr).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Se({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Z(e.end)}function u(){return rt(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=V(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ce(),n.position={start:Z(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Z(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Z(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Lr(t),n.identifier=V(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function L(){this.data.inReference=void 0}function te(){this.data.referenceType=`collapsed`}function ne(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=V(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function re(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=pt(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ct(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=Z(e.end)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[]}}function le(){return{type:`code`,lang:null,meta:null,value:``}}function ue(){return{type:`inlineCode`,value:``}}function de(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function fe(){return{type:`emphasis`,children:[]}}function pe(){return{type:`heading`,depth:0,children:[]}}function me(){return{type:`break`}}function he(){return{type:`html`,value:``}}function ge(){return{type:`image`,title:null,url:``,alt:null}}function _e(){return{type:`link`,title:null,url:``,children:[]}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function Z(e){return{line:e.line,column:e.column,offset:e.offset}}function Hr(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Hr(e,r):Ur(e,r)}}function Ur(e,t){let n;for(n in t)if(zr.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Wr(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Se({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Se({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Se({start:t.start,end:t.end})+`) is still open`)}function Gr(e){let t=this;t.parser=n;function n(n){return Br(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Kr(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function qr(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
@@ -0,0 +1 @@
|
|
|
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-B-mvcaJS.js";import"./src-Dr68ou95.js";import{n as a}from"./toast-VJ6jFKB9.js";import{t as o}from"./loader-circle-cYXxWP5B.js";import{n as s}from"./sdk.gen-CC1iYdd0.js";import{a as c}from"./routes-Dzl0kj5j.js";import{a as l}from"./viewer-store-Dened07w.js";import{Ht as u,_t as d,dt as f,gt as p,r as m}from"./index-3zpPFBeR.js";import{t as h}from"./deploy-dialogs-qdH6GTjP.js";import{t as g}from"./use-active-assistant-id-jfqnc4T7.js";var _=e(t(),1),v=i();function y(){let{appId:e}=r(),t=g(),i=n(),y=p.use.isDeploying(),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(!1),E=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(e)return E.current=e,x(null),C(null),s({path:{assistant_id:t,id:e},throwOnError:!0}).then(({data:n})=>{E.current===e&&(l(t,n.appId,n.html),x({appId:n.appId,dirName:n.dirName,name:n.name,html:n.html}))}).catch(t=>{E.current===e&&C(t instanceof Error?t.message:`Failed to open app`)}),()=>{E.current=null}},[t,e]);let D=(0,_.useCallback)(()=>{i(c.library.root)},[i]),O=m(),k=(0,_.useCallback)(()=>{b&&O(b)},[b,O]),A=(0,_.useCallback)(async()=>{if(!(!b||w)){T(!0);try{await d(t,b.appId,b.name),a.success(`App exported`,{description:`${b.name}.vellum`})}catch(e){a.error(`Failed to share app`,{description:e instanceof Error?e.message:void 0})}finally{T(!1)}}},[t,b,w]),j=(0,_.useCallback)(()=>{b&&p.getState().deployApp(t,b.appId,b.name,b.html)},[t,b]),M=(0,_.useCallback)(e=>{u(i,{prompt:e})},[i]);return e?S?(0,v.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4`,children:[(0,v.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:S}),(0,v.jsx)(`button`,{type:`button`,onClick:D,className:`text-body-medium-default text-[var(--primary-base)] underline`,children:`Back to Library`})]}):b?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(f,{appId:b.appId,appName:b.name,html:b.html,assistantId:t,onClose:D,onEdit:k,onShare:A,isSharing:w,onDeploy:j,isDeploying:y,enableFullscreen:!0}),(0,v.jsx)(h,{assistantId:t,onStartConversation:M})]}):(0,v.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,v.jsx)(o,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}):null}export{y as LibraryDetailPage};
|
|
@@ -1 +1 @@
|
|
|
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}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{n as s,t as c}from"./panel-item-nGTDevWP.js";import{t as l}from"./menu-C_97pis4.js";import"./src-CK6bncSg.js";import{t as u}from"./confirm-dialog-CfOXCE1N.js";import{t as d}from"./input-C8kfrq9r.js";import{n as f}from"./toast-2TW5tj1Y.js";import{t as p}from"./arrow-up-nBfZxfhi.js";import{t as m}from"./file-text-CmK9LY1p.js";import{t as h}from"./globe-DYF_lSGm.js";import{s as g,t as _}from"./sdk.gen-1aYqVbMj.js";import{C as v,n as y,t as b}from"./react-query.gen-CQLyoqYk.js";import{a as x}from"./routes-DVqkwUEe.js";import{n as S}from"./use-is-mobile-Cy10kl9u.js";import{i as C,r as w}from"./viewer-store-Dead64xY.js";import{t as T}from"./misc-BN2o2MEB.js";import{Fr as E,Ft as D,Ht as O,Ir as k,Jr as A,Ni as j,Z as M,_t as N,gt as P,ii as F,ri as I,yi as L}from"./index-PRnvH2Y1.js";import{t as R}from"./deploy-dialogs-jf5VL1UP.js";import{t as z}from"./use-active-assistant-id-C-RHQ9f6.js";import{t as B}from"./page-shell-cEGpH3P5.js";import{t as V}from"./format-date-CLlHK5gl.js";var H=e(t(),1),U=o();function W({app:e,isDeleting:t,onConfirm:n,onCancel:r}){return(0,U.jsx)(u,{open:e!==null,title:`Delete app`,message:e?`"${e.name}" will be permanently removed.`:``,confirmLabel:t?`Deleting…`:`Delete`,destructive:!0,onConfirm:n,onCancel:r})}function G(e){return e===1?`1 word`:`${e} words`}function K({document:e,onOpen:t}){return(0,U.jsxs)(`div`,{className:`group relative flex flex-col gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(e.surfaceId),className:T(`relative flex w-full cursor-pointer flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)]`,`aspect-[16/10]`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`),children:[(0,U.jsx)(m,{size:34,className:`text-[var(--content-tertiary)]`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:G(e.wordCount)})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(e.surfaceId),className:`flex cursor-pointer flex-col gap-0.5 px-0.5 text-left outline-none`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:e.title}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:V(new Date(e.updatedAt))})]})]})}function q({fileInputRef:e,isImporting:t,onImportBundle:r,onNewConversation:i}){return(0,U.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-4 py-24`,children:[(0,U.jsx)(`input`,{ref:e,type:`file`,accept:`.vellum`,className:`hidden`,onChange:r}),(0,U.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-xl bg-[var(--surface-base)]`,children:(0,U.jsx)(L,{size:32,className:`text-[var(--content-tertiary)]`})}),(0,U.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Your library is empty`}),(0,U.jsx)(`p`,{className:`max-w-md text-center text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:`Ask your assistant to build something, or import a shared app`}),(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(n,{variant:`primary`,size:`regular`,onClick:i,children:`New Conversation`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:`or`})]}):null,(0,U.jsxs)(n,{variant:`outlined`,size:`regular`,onClick:()=>e.current?.click(),disabled:t,children:[t?(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`}):(0,U.jsx)(E,{size:14}),(0,U.jsx)(`span`,{className:`ml-1.5`,children:`Import .vellum File`})]})]})]})}function J({app:e,assistantId:t,isPinned:n,onOpen:r,onPin:i,onDelete:a,onDeploy:o,justImported:s,onAnimationEnd:c}){let[l,u]=(0,H.useState)(!1),d=(0,H.useCallback)(()=>C(t,e.id),[t,e.id]),p=(0,H.useCallback)(async()=>{if(!l){u(!0);try{await N(t,e.id,e.name),f.success(`App exported`,{description:`${e.name}.vellum`})}catch(e){f.error(`Failed to share app`,{description:e instanceof Error?e.message:void 0})}finally{u(!1)}}},[t,e.id,e.name,l]),[m,h]=(0,H.useState)(!1),g=S();return(0,U.jsxs)(`div`,{className:T(`group relative flex flex-col gap-2`,s&&`animate-[card-entrance_400ms_ease-out]`),onAnimationEnd:s?c:void 0,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:T(`relative w-full cursor-pointer overflow-hidden rounded-xl`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`),children:(0,U.jsx)(M,{name:e.name,icon:e.icon,loadHtml:d})}),(0,U.jsx)(`div`,{className:T(`absolute right-2 top-2 z-20 transition-opacity`,`max-md:opacity-100`,`md:group-hover:opacity-100 md:group-focus-within:opacity-100`,m?`opacity-100`:`md:opacity-0`),children:(0,U.jsx)(Y,{appName:e.name,isPinned:n,open:m,onOpenChange:h,onPin:()=>i(e),onDelete:a?()=>a(e):void 0,onShare:p,onDeploy:o,isMobile:g})}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`flex cursor-pointer flex-col gap-0.5 px-0.5 text-left outline-none`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:e.name}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:V(new Date(e.createdAt))})]})]})}function Y({appName:e,isPinned:t,open:r,onOpenChange:i,onPin:a,onDelete:o,onShare:u,onDeploy:d,isMobile:f}){return f?(0,U.jsxs)(s.Root,{open:r,onOpenChange:i,children:[(0,U.jsx)(s.Trigger,{asChild:!0,children:(0,U.jsx)(n,{variant:`primary`,size:`compact`,iconOnly:(0,U.jsx)(j,{}),"aria-label":`App actions`,onClick:e=>e.stopPropagation()})}),(0,U.jsxs)(s.Content,{children:[(0,U.jsx)(s.Header,{className:`sr-only`,children:(0,U.jsx)(s.Title,{children:e})}),(0,U.jsxs)(s.Body,{className:`pt-0`,children:[(0,U.jsx)(c,{icon:t?F:I,label:t?`Unpin`:`Pin`,onSelect:()=>{i(!1),a()}}),u?(0,U.jsx)(c,{icon:p,label:(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,U.jsx)(`span`,{children:`Share`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Export as .vellum file`})]}),onSelect:()=>{i(!1),u()}}):null,d?(0,U.jsx)(c,{icon:h,label:(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,U.jsx)(`span`,{children:`Deploy to Vercel`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish as a static page`})]}),onSelect:()=>{i(!1),d()}}):null,o?(0,U.jsx)(c,{icon:k,label:`Delete`,onSelect:()=>{i(!1),o()}}):null]})]})]}):(0,U.jsxs)(l.Root,{open:r,onOpenChange:i,children:[(0,U.jsx)(l.Trigger,{asChild:!0,children:(0,U.jsx)(n,{variant:`primary`,size:`compact`,iconOnly:(0,U.jsx)(j,{}),"aria-label":`App actions`,onClick:e=>e.stopPropagation()})}),(0,U.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,U.jsx)(l.Item,{leftIcon:t?(0,U.jsx)(F,{size:14}):(0,U.jsx)(I,{size:14}),onSelect:()=>a(),className:`whitespace-nowrap`,children:t?`Unpin`:`Pin`}),u?(0,U.jsx)(l.Item,{leftIcon:(0,U.jsx)(p,{size:14}),onSelect:()=>u(),className:`whitespace-nowrap`,children:`Share`}):null,d?(0,U.jsx)(l.Item,{leftIcon:(0,U.jsx)(h,{size:14}),onSelect:()=>d(),className:`whitespace-nowrap`,children:`Deploy to Vercel`}):null,o?(0,U.jsx)(l.Item,{leftIcon:(0,U.jsx)(k,{size:14,className:`text-red-600`}),onSelect:()=>o(),className:`whitespace-nowrap text-red-600 data-[highlighted]:text-red-700`,children:`Delete`}):null]})]})}function X({title:e,apps:t,assistantId:n,pinnedAppIds:r,lastImportedAppId:i,onOpen:a,onPin:o,onDelete:s,onDeploy:c,onAnimationEnd:l}){return t.length===0?null:(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h2`,{className:`mb-4 text-body-small-emphasised text-[color:var(--content-secondary)]`,children:e}),(0,U.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(max(220px,calc((100%-6rem)/5)),1fr))] gap-6`,children:t.map(e=>(0,U.jsx)(J,{app:e,assistantId:n,isPinned:r.has(e.id),onOpen:a,onPin:o,onDelete:s,justImported:e.id===i,onAnimationEnd:l,onDeploy:c?()=>c(e.id):void 0},e.id))})]})}var Z=(e,t)=>t.updatedAt-e.updatedAt||t.createdAt-e.createdAt;function Q(e){let t=D.use.pinnedAppIds(),{data:n=[],isLoading:r,error:i}=a({...b({path:{assistant_id:e}}),select:e=>e.apps}),{data:o=[],isLoading:s,error:c}=a({...v({path:{assistant_id:e}}),select:e=>e.documents}),l=r||s,u=i&&c?i instanceof Error?i.message:`Failed to load library`:null,[d,f]=(0,H.useState)(``),p=(0,H.useMemo)(()=>{if(!d.trim())return n;let e=d.toLowerCase();return n.filter(t=>t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))},[n,d]);return{apps:n,documents:o,filteredApps:p,pinnedApps:(0,H.useMemo)(()=>p.filter(e=>t.has(e.id)).sort(Z),[p,t]),recentApps:(0,H.useMemo)(()=>p.filter(e=>!t.has(e.id)).sort(Z),[p,t]),filteredDocuments:(0,H.useMemo)(()=>{if(!d.trim())return o;let e=d.toLowerCase();return o.filter(t=>t.title.toLowerCase().includes(e))},[o,d]),searchText:d,setSearchText:f,loading:l,error:u}}async function $(e,t){let{data:n,error:r,response:i}=await g({path:{assistant_id:e},body:t,bodySerializer:e=>e,headers:{"Content-Type":`application/octet-stream`},throwOnError:!1});if(!i||!i.ok){let e=(r&&typeof r==`object`&&`message`in r?r.message:null)??`Failed to import app.`;throw Error(e)}return n}function ee({assistantId:e,assistantName:t,title:r,onNewConversation:a,onOpenDocument:o,onOpenApp:s}){let c=i(),l=D.use.togglePin(),u=D.use.pinnedAppIds(),p=P.use.isDeploying(),{apps:m,documents:h,filteredApps:g,pinnedApps:v,recentApps:b,filteredDocuments:x,searchText:S,setSearchText:T,loading:O,error:k}=Q(e),[j,M]=(0,H.useState)(null),[N,F]=(0,H.useState)(!1),I=(0,H.useCallback)(async()=>{let t=j;if(!(!t||N)){F(!0);try{await _({path:{assistant_id:e,id:t.id},throwOnError:!0}),w(e,t.id),c.invalidateQueries({queryKey:y({path:{assistant_id:e}})}),u.has(t.id)&&l(t),M(null)}catch(e){f.error(e instanceof Error?e.message:`Failed to delete app`)}finally{F(!1)}}},[j,N,e,u,l,c]),L=(0,H.useCallback)(()=>{N||M(null)},[N]),z=(0,H.useRef)(null),[B,V]=(0,H.useState)(!1),G=(0,H.useCallback)(async t=>{let n=t.target.files?.[0];if(!(!n||B)){V(!0);try{let t=await $(e,n);await c.invalidateQueries({queryKey:y({path:{assistant_id:e}})}),f.success(t.name+` imported`),s(t.appId)}catch(e){f.error(e instanceof Error?e.message:`Failed to import app`)}finally{V(!1),z.current&&(z.current.value=``)}}},[e,B,c,s]),J=(0,H.useCallback)(async t=>{if(p)return;let n=m.find(e=>e.id===t)?.name??`this app`;try{let r=await C(e,t);P.getState().deployApp(e,t,n,r)}catch{P.getState().deployApp(e,t,n,``)}},[e,p,m]),Y=(0,H.useCallback)(e=>l(e),[l]);return O?(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--primary-base)]`,role:`status`,"aria-label":`Loading apps`})}):k?(0,U.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-4`,children:[(0,U.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:k}),(0,U.jsx)(`button`,{type:`button`,className:`rounded-lg bg-[var(--primary-base)] px-4 py-2 text-body-medium-default text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)]`,onClick:()=>window.location.reload(),children:`Retry`})]}):m.length===0&&h.length===0?(0,U.jsx)(q,{fileInputRef:z,isImporting:B,onImportBundle:G,onNewConversation:a?()=>a():void 0}):(0,U.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`mb-4 flex shrink-0 items-center justify-between gap-4`,children:[r?(0,U.jsx)(`h1`,{className:`text-title-large text-[var(--content-default)]`,children:r}):(0,U.jsx)(`span`,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`input`,{ref:z,type:`file`,accept:`.vellum`,className:`hidden`,onChange:G}),(0,U.jsxs)(n,{variant:`outlined`,size:`regular`,onClick:()=>z.current?.click(),disabled:B,children:[B?(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`}):(0,U.jsx)(E,{size:14}),(0,U.jsx)(`span`,{className:`ml-1.5`,children:`Import`})]})]})]}),(0,U.jsx)(`div`,{className:`mb-6 shrink-0`,children:(0,U.jsx)(d,{fullWidth:!0,type:`text`,placeholder:`Search your library`,value:S,onChange:e=>T(e.target.value),leftIcon:(0,U.jsx)(A,{size:16})})}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:g.length===0&&x.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16`,children:[(0,U.jsx)(A,{size:32,className:`mb-4 text-[var(--content-tertiary)]`}),(0,U.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`No apps or documents matched “`,S,`”`]})]}):(0,U.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,U.jsx)(X,{title:`Pinned`,apps:v,assistantId:e,pinnedAppIds:u,onOpen:s,onPin:Y,onDelete:M,onDeploy:J}),(0,U.jsx)(X,{title:`Recents`,apps:b,assistantId:e,pinnedAppIds:u,onOpen:s,onPin:Y,onDelete:M,onDeploy:J}),x.length>0?(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h2`,{className:`mb-4 text-body-small-emphasised text-[color:var(--content-secondary)]`,children:`Documents`}),(0,U.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(max(220px,calc((100%-6rem)/5)),1fr))] gap-6`,children:x.map(e=>(0,U.jsx)(K,{document:e,onOpen:e=>{o&&o(e)}},e.surfaceId))})]}):null]})}),(0,U.jsx)(R,{assistantId:e,assistantName:t,onStartConversation:a}),(0,U.jsx)(W,{app:j,isDeleting:N,onConfirm:I,onCancel:L})]})}function te(){let e=z(),t=r();return(0,U.jsx)(B,{children:(0,U.jsx)(ee,{assistantId:e,title:`Library`,onNewConversation:(0,H.useCallback)(e=>{O(t,{prompt:e})},[t]),onOpenDocument:(0,H.useCallback)(e=>{t(x.document(e))},[t]),onOpenApp:(0,H.useCallback)(e=>{t(x.library.app(e))},[t])})})}export{te as LibraryPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BvHa6F59.js";import{d as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as i}from"./QueryClientProvider-DgWA3A3c.js";import{t as a}from"./jsx-runtime-B-mvcaJS.js";import{t as o}from"./useQuery-cVuP8q1x.js";import{n as s,t as c}from"./panel-item-DN2CyWOT.js";import{t as l}from"./menu-_JM4udVm.js";import"./src-Dr68ou95.js";import{t as u}from"./confirm-dialog-BtxNY4WU.js";import{t as d}from"./input-BLN3wmw2.js";import{n as f}from"./toast-VJ6jFKB9.js";import{t as p}from"./arrow-up-CkZMv0kb.js";import{t as m}from"./file-text-Bxj0xAst.js";import{t as h}from"./globe-D7wvOZaZ.js";import{s as g,t as _}from"./sdk.gen-CC1iYdd0.js";import{C as v,n as y,t as b}from"./react-query.gen-BeTpj_Sy.js";import{a as x}from"./routes-Dzl0kj5j.js";import{n as S}from"./use-is-mobile-BF5x8sr8.js";import{i as C,r as w}from"./viewer-store-Dened07w.js";import{t as T}from"./misc-CBD9JJCY.js";import{Fr as E,Ft as D,Ht as O,Ir as k,Jr as A,Ni as j,Z as M,_t as N,gt as P,ii as F,ri as I,yi as L}from"./index-3zpPFBeR.js";import{t as R}from"./deploy-dialogs-qdH6GTjP.js";import{t as z}from"./use-active-assistant-id-jfqnc4T7.js";import{t as B}from"./page-shell-cu3KBmqd.js";import{t as V}from"./format-date-DyMQp2_m.js";var H=e(t(),1),U=a();function W({app:e,isDeleting:t,onConfirm:n,onCancel:r}){return(0,U.jsx)(u,{open:e!==null,title:`Delete app`,message:e?`"${e.name}" will be permanently removed.`:``,confirmLabel:t?`Deleting…`:`Delete`,destructive:!0,onConfirm:n,onCancel:r})}function G(e){return e===1?`1 word`:`${e} words`}function K({document:e,onOpen:t}){return(0,U.jsxs)(`div`,{className:`group relative flex flex-col gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(e.surfaceId),className:T(`relative flex w-full cursor-pointer flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)]`,`aspect-[16/10]`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`),children:[(0,U.jsx)(m,{size:34,className:`text-[var(--content-tertiary)]`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:G(e.wordCount)})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(e.surfaceId),className:`flex cursor-pointer flex-col gap-0.5 px-0.5 text-left outline-none`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:e.title}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:V(new Date(e.updatedAt))})]})]})}function q({fileInputRef:e,isImporting:t,onImportBundle:r,onNewConversation:i}){return(0,U.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-4 py-24`,children:[(0,U.jsx)(`input`,{ref:e,type:`file`,accept:`.vellum`,className:`hidden`,onChange:r}),(0,U.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-xl bg-[var(--surface-base)]`,children:(0,U.jsx)(L,{size:32,className:`text-[var(--content-tertiary)]`})}),(0,U.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Your library is empty`}),(0,U.jsx)(`p`,{className:`max-w-md text-center text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:`Ask your assistant to build something, or import a shared app`}),(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(n,{variant:`primary`,size:`regular`,onClick:i,children:`New Conversation`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:`or`})]}):null,(0,U.jsxs)(n,{variant:`outlined`,size:`regular`,onClick:()=>e.current?.click(),disabled:t,children:[t?(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`}):(0,U.jsx)(E,{size:14}),(0,U.jsx)(`span`,{className:`ml-1.5`,children:`Import .vellum File`})]})]})]})}function J({app:e,assistantId:t,isPinned:n,onOpen:r,onPin:i,onDelete:a,onDeploy:o,justImported:s,onAnimationEnd:c}){let[l,u]=(0,H.useState)(!1),d=(0,H.useCallback)(()=>C(t,e.id),[t,e.id]),p=(0,H.useCallback)(async()=>{if(!l){u(!0);try{await N(t,e.id,e.name),f.success(`App exported`,{description:`${e.name}.vellum`})}catch(e){f.error(`Failed to share app`,{description:e instanceof Error?e.message:void 0})}finally{u(!1)}}},[t,e.id,e.name,l]),[m,h]=(0,H.useState)(!1),g=S();return(0,U.jsxs)(`div`,{className:T(`group relative flex flex-col gap-2`,s&&`animate-[card-entrance_400ms_ease-out]`),onAnimationEnd:s?c:void 0,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:T(`relative w-full cursor-pointer overflow-hidden rounded-xl`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`),children:(0,U.jsx)(M,{name:e.name,icon:e.icon,loadHtml:d})}),(0,U.jsx)(`div`,{className:T(`absolute right-2 top-2 z-20 transition-opacity`,`max-md:opacity-100`,`md:group-hover:opacity-100 md:group-focus-within:opacity-100`,m?`opacity-100`:`md:opacity-0`),children:(0,U.jsx)(Y,{appName:e.name,isPinned:n,open:m,onOpenChange:h,onPin:()=>i(e),onDelete:a?()=>a(e):void 0,onShare:p,onDeploy:o,isMobile:g})}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:`flex cursor-pointer flex-col gap-0.5 px-0.5 text-left outline-none`,children:[(0,U.jsx)(`span`,{className:`truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:e.name}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:V(new Date(e.createdAt))})]})]})}function Y({appName:e,isPinned:t,open:r,onOpenChange:i,onPin:a,onDelete:o,onShare:u,onDeploy:d,isMobile:f}){return f?(0,U.jsxs)(s.Root,{open:r,onOpenChange:i,children:[(0,U.jsx)(s.Trigger,{asChild:!0,children:(0,U.jsx)(n,{variant:`primary`,size:`compact`,iconOnly:(0,U.jsx)(j,{}),"aria-label":`App actions`,onClick:e=>e.stopPropagation()})}),(0,U.jsxs)(s.Content,{children:[(0,U.jsx)(s.Header,{className:`sr-only`,children:(0,U.jsx)(s.Title,{children:e})}),(0,U.jsxs)(s.Body,{className:`pt-0`,children:[(0,U.jsx)(c,{icon:t?F:I,label:t?`Unpin`:`Pin`,onSelect:()=>{i(!1),a()}}),u?(0,U.jsx)(c,{icon:p,label:(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,U.jsx)(`span`,{children:`Share`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Export as .vellum file`})]}),onSelect:()=>{i(!1),u()}}):null,d?(0,U.jsx)(c,{icon:h,label:(0,U.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,U.jsx)(`span`,{children:`Deploy to Vercel`}),(0,U.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish as a static page`})]}),onSelect:()=>{i(!1),d()}}):null,o?(0,U.jsx)(c,{icon:k,label:`Delete`,onSelect:()=>{i(!1),o()}}):null]})]})]}):(0,U.jsxs)(l.Root,{open:r,onOpenChange:i,children:[(0,U.jsx)(l.Trigger,{asChild:!0,children:(0,U.jsx)(n,{variant:`primary`,size:`compact`,iconOnly:(0,U.jsx)(j,{}),"aria-label":`App actions`,onClick:e=>e.stopPropagation()})}),(0,U.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,U.jsx)(l.Item,{leftIcon:t?(0,U.jsx)(F,{size:14}):(0,U.jsx)(I,{size:14}),onSelect:()=>a(),className:`whitespace-nowrap`,children:t?`Unpin`:`Pin`}),u?(0,U.jsx)(l.Item,{leftIcon:(0,U.jsx)(p,{size:14}),onSelect:()=>u(),className:`whitespace-nowrap`,children:`Share`}):null,d?(0,U.jsx)(l.Item,{leftIcon:(0,U.jsx)(h,{size:14}),onSelect:()=>d(),className:`whitespace-nowrap`,children:`Deploy to Vercel`}):null,o?(0,U.jsx)(l.Item,{leftIcon:(0,U.jsx)(k,{size:14,className:`text-red-600`}),onSelect:()=>o(),className:`whitespace-nowrap text-red-600 data-[highlighted]:text-red-700`,children:`Delete`}):null]})]})}function X({title:e,apps:t,assistantId:n,pinnedAppIds:r,lastImportedAppId:i,onOpen:a,onPin:o,onDelete:s,onDeploy:c,onAnimationEnd:l}){return t.length===0?null:(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h2`,{className:`mb-4 text-body-small-emphasised text-[color:var(--content-secondary)]`,children:e}),(0,U.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(max(220px,calc((100%-6rem)/5)),1fr))] gap-6`,children:t.map(e=>(0,U.jsx)(J,{app:e,assistantId:n,isPinned:r.has(e.id),onOpen:a,onPin:o,onDelete:s,justImported:e.id===i,onAnimationEnd:l,onDeploy:c?()=>c(e.id):void 0},e.id))})]})}var Z=(e,t)=>t.updatedAt-e.updatedAt||t.createdAt-e.createdAt;function Q(e){let t=D.use.pinnedAppIds(),{data:n=[],isLoading:r,error:i}=o({...b({path:{assistant_id:e}}),select:e=>e.apps}),{data:a=[],isLoading:s,error:c}=o({...v({path:{assistant_id:e}}),select:e=>e.documents}),l=r||s,u=i&&c?i instanceof Error?i.message:`Failed to load library`:null,[d,f]=(0,H.useState)(``),p=(0,H.useMemo)(()=>{if(!d.trim())return n;let e=d.toLowerCase();return n.filter(t=>t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))},[n,d]);return{apps:n,documents:a,filteredApps:p,pinnedApps:(0,H.useMemo)(()=>p.filter(e=>t.has(e.id)).sort(Z),[p,t]),recentApps:(0,H.useMemo)(()=>p.filter(e=>!t.has(e.id)).sort(Z),[p,t]),filteredDocuments:(0,H.useMemo)(()=>{if(!d.trim())return a;let e=d.toLowerCase();return a.filter(t=>t.title.toLowerCase().includes(e))},[a,d]),searchText:d,setSearchText:f,loading:l,error:u}}async function $(e,t){let{data:n,error:r,response:i}=await g({path:{assistant_id:e},body:t,bodySerializer:e=>e,headers:{"Content-Type":`application/octet-stream`},throwOnError:!1});if(!i||!i.ok){let e=(r&&typeof r==`object`&&`message`in r?r.message:null)??`Failed to import app.`;throw Error(e)}return n}function ee({assistantId:e,assistantName:t,title:r,onNewConversation:a,onOpenDocument:o,onOpenApp:s}){let c=i(),l=D.use.togglePin(),u=D.use.pinnedAppIds(),p=P.use.isDeploying(),{apps:m,documents:h,filteredApps:g,pinnedApps:v,recentApps:b,filteredDocuments:x,searchText:S,setSearchText:T,loading:O,error:k}=Q(e),[j,M]=(0,H.useState)(null),[N,F]=(0,H.useState)(!1),I=(0,H.useCallback)(async()=>{let t=j;if(!(!t||N)){F(!0);try{await _({path:{assistant_id:e,id:t.id},throwOnError:!0}),w(e,t.id),c.invalidateQueries({queryKey:y({path:{assistant_id:e}})}),u.has(t.id)&&l(t),M(null)}catch(e){f.error(e instanceof Error?e.message:`Failed to delete app`)}finally{F(!1)}}},[j,N,e,u,l,c]),L=(0,H.useCallback)(()=>{N||M(null)},[N]),z=(0,H.useRef)(null),[B,V]=(0,H.useState)(!1),G=(0,H.useCallback)(async t=>{let n=t.target.files?.[0];if(!(!n||B)){V(!0);try{let t=await $(e,n);await c.invalidateQueries({queryKey:y({path:{assistant_id:e}})}),f.success(t.name+` imported`),s(t.appId)}catch(e){f.error(e instanceof Error?e.message:`Failed to import app`)}finally{V(!1),z.current&&(z.current.value=``)}}},[e,B,c,s]),J=(0,H.useCallback)(async t=>{if(p)return;let n=m.find(e=>e.id===t)?.name??`this app`;try{let r=await C(e,t);P.getState().deployApp(e,t,n,r)}catch{P.getState().deployApp(e,t,n,``)}},[e,p,m]),Y=(0,H.useCallback)(e=>l(e),[l]);return O?(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--primary-base)]`,role:`status`,"aria-label":`Loading apps`})}):k?(0,U.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-4`,children:[(0,U.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:k}),(0,U.jsx)(`button`,{type:`button`,className:`rounded-lg bg-[var(--primary-base)] px-4 py-2 text-body-medium-default text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)]`,onClick:()=>window.location.reload(),children:`Retry`})]}):m.length===0&&h.length===0?(0,U.jsx)(q,{fileInputRef:z,isImporting:B,onImportBundle:G,onNewConversation:a?()=>a():void 0}):(0,U.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`mb-4 flex shrink-0 items-center justify-between gap-4`,children:[r?(0,U.jsx)(`h1`,{className:`text-title-large text-[var(--content-default)]`,children:r}):(0,U.jsx)(`span`,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`input`,{ref:z,type:`file`,accept:`.vellum`,className:`hidden`,onChange:G}),(0,U.jsxs)(n,{variant:`outlined`,size:`regular`,onClick:()=>z.current?.click(),disabled:B,children:[B?(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`}):(0,U.jsx)(E,{size:14}),(0,U.jsx)(`span`,{className:`ml-1.5`,children:`Import`})]})]})]}),(0,U.jsx)(`div`,{className:`mb-6 shrink-0`,children:(0,U.jsx)(d,{fullWidth:!0,type:`text`,placeholder:`Search your library`,value:S,onChange:e=>T(e.target.value),leftIcon:(0,U.jsx)(A,{size:16})})}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:g.length===0&&x.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16`,children:[(0,U.jsx)(A,{size:32,className:`mb-4 text-[var(--content-tertiary)]`}),(0,U.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`No apps or documents matched “`,S,`”`]})]}):(0,U.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,U.jsx)(X,{title:`Pinned`,apps:v,assistantId:e,pinnedAppIds:u,onOpen:s,onPin:Y,onDelete:M,onDeploy:J}),(0,U.jsx)(X,{title:`Recents`,apps:b,assistantId:e,pinnedAppIds:u,onOpen:s,onPin:Y,onDelete:M,onDeploy:J}),x.length>0?(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`h2`,{className:`mb-4 text-body-small-emphasised text-[color:var(--content-secondary)]`,children:`Documents`}),(0,U.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(max(220px,calc((100%-6rem)/5)),1fr))] gap-6`,children:x.map(e=>(0,U.jsx)(K,{document:e,onOpen:e=>{o&&o(e)}},e.surfaceId))})]}):null]})}),(0,U.jsx)(R,{assistantId:e,assistantName:t,onStartConversation:a}),(0,U.jsx)(W,{app:j,isDeleting:N,onConfirm:I,onCancel:L})]})}function te(){let e=z(),t=r();return(0,U.jsx)(B,{children:(0,U.jsx)(ee,{assistantId:e,title:`Library`,onNewConversation:(0,H.useCallback)(e=>{O(t,{prompt:e})},[t]),onOpenDocument:(0,H.useCallback)(e=>{t(x.document(e))},[t]),onOpenApp:(0,H.useCallback)(e=>{t(x.library.app(e))},[t])})})}export{te as LibraryPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-D8roAprb.js";var t=e(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]);export{t};
|