const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["packs/js/index-DI_ILJc_.js","packs/js/card-DEnbDmxH.js","packs/js/arrow-left-Dkj1EBB0.js","packs/js/index-CZcmSAnz.js","packs/js/list-D4U9tYEx.js","packs/js/check-IvQkHbtf.js","packs/js/chevron-right-drQyQ061.js","packs/js/select-CpYWI5Ol.js","packs/js/index-DxGZybkA.js","packs/js/form-CrFSiw2Q.js","packs/js/setting-toggle-BFIPN3F1.js","packs/js/toggle-BOIejqLW.js","packs/js/theme-toggle-BXC06UDJ.js","packs/js/theme-selector-Bv2l_5d4.js","packs/js/chevron-down-DIGD_Q3B.js","packs/js/emoji-picker-BN3z5OdA.js","packs/js/data-B__uw_g8.js","packs/js/emoji-picker-modal-DiZbGQrj.js","packs/js/modal-BFufcXMr.js","packs/js/button-uvh730_B.js","packs/js/icon-button-B234BWM1.js","packs/js/emoji-picker-dropdown-D0IoGP_Q.js","packs/js/useCustomEmojis-bXei6FcO.js","packs/js/index-CDVTYH_S.js","packs/js/pull-to-refresh-wdC7C_sS.js","packs/assets/pull-to-refresh-DfE38vkG.css","packs/js/scrollable-list-DmdalV6M.js","packs/js/index-5okAbzvu.js","packs/js/index-B0nfuXS-.js","packs/js/load-more-CywBGcJW.js","packs/js/column-BWiOia-1.js","packs/js/helmet-CLiZDYHd.js","packs/js/portal-CQTBhmNY.js","packs/js/placeholder-display-name-BUoY48Qk.js","packs/js/utils-B2qp4No3.js","packs/js/placeholder-status-content-KYA053Nq.js","packs/js/at-DGKhSIem.js","packs/js/user-check-UsTO0o9Q.js","packs/js/chart-bar-y251LZx5.js","packs/js/status-info-BiNltW_l.js","packs/js/useEntityActions-L4libVWN.js","packs/js/useCreateEntity-DzkS-hVy.js","packs/js/useLoading-BcdxmZ4P.js","packs/js/useGroupMedia-Vr1Pt7TA.js","packs/js/divider-B9iI9EO2.js","packs/js/group-privacy-C1RS4AZI.js","packs/js/lock-DPkd9C5n.js","packs/js/world-C_Ez2m2y.js","packs/js/floating-ui.react-DS7qn8DO.js","packs/js/group-avatar-BMgebuX1.js","packs/js/avatar-DHYeB68Y.js","packs/js/photo-off-ueVPg5NH.js","packs/js/still-image-DJwJWTQr.js","packs/js/icon-BQ9fpZaa.js","packs/js/mood-smile-yzeoRbWE.js","packs/js/repeat-D6oA5k1B.js","packs/js/user-plus-BeXSF2H6.js","packs/js/tabs-Bk_wNh0t.js","packs/js/reach-auto-id-DMUoCsEK.js","packs/assets/tabs-D2q_XFB7.css","packs/js/bolt-D_mztAXT.js","packs/js/briefcase-DKeKCfBh.js","packs/js/calendar-event-D5SHpyKR.js","packs/js/messages-IJgyebwF.js","packs/js/mood-happy-RQl2bOGC.js","packs/js/pencil-DWLhb7uF.js","packs/js/status-Dl5nO112.js","packs/js/circles-BtJCB-bT.js","packs/js/translate-button-CsWostxo.js","packs/js/quoted-status-container-BMJ8H0B4.js","packs/js/quoted-status-B1ntPgvR.js","packs/js/status-media-D8ayMUlE.js","packs/js/attachment-thumbs-ZVu4ti1v.js","packs/js/external-link-Dw0Ga1e6.js","packs/js/link-DN_UIEvg.js","packs/js/player-play-eY0iK_os.js","packs/js/zoom-in-C1NYnqo8.js","packs/js/blurhash-D8xl2Aar.js","packs/js/account-container-J_vMXGM3.js","packs/js/useAccount-Ewa7ZNDZ.js","packs/js/useEntity-Db0YNuSl.js","packs/js/useRelationship-C1TGnghT.js","packs/js/account-CFFs4-2d.js","packs/js/badge-BXEFeYMv.js","packs/js/is-mobile-CFLFnkfD.js","packs/js/markup-C5-oe5Hu.js","packs/js/link-EZ-tGDCg.js","packs/js/tooltip-eC8Ibf53.js","packs/js/emojify-4hbeQEqJ.js","packs/assets/markup-Cz-w2FNi.css","packs/js/emoji-Zupq2xC3.js","packs/js/verification-badge-8gH1Yiwq.js","packs/js/action-button-CvJ6UwG4.js","packs/js/ban-CWJKjvj6.js","packs/js/plus-BOck8kIh.js","packs/js/relative-timestamp-Dq5lbv90.js","packs/js/event-preview-yyedsurq.js","packs/js/map-pin-BsC4LFD9.js","packs/js/user-DwNyLszw.js","packs/js/event-date-Bc9NJUmf.js","packs/js/calendar-BmiIhUlT.js","packs/js/outline-box-bAKnE1GU.js","packs/js/quote-Df-ua2p0.js","packs/js/status-content-B6VGNFTi.js","packs/js/only-emoji-DM17FhdA.js","packs/js/react-motion-BmL5kCQ_.js","packs/js/status-reply-mentions-C2EMMh8G.js","packs/js/dots-Droka4sB.js","packs/js/eye-off-ByAjZElF.js","packs/js/eye-C5Cbeuib.js","packs/js/trash-D9r7UV3O.js","packs/js/dropdown-menu-DA1sekGj.js","packs/js/hotkeys-B8M20MTO.js","packs/js/bookmark-off-DSYSekUk.js","packs/js/useDismissEntity-C_nrumLL.js","packs/js/alert-triangle-Cpy0vV2M.js","packs/js/status-action-button-pMGYUpXp.js","packs/js/bookmark-CZSu3ULg.js","packs/js/edit-sh1Qncky.js","packs/js/flag-Dxa_xa2L.js","packs/js/gavel-gZl9Pgpl.js","packs/js/mail-VN1ISJ2O.js","packs/js/pin-BUSTTxzy.js","packs/js/pinned-off-DRoRT-Db.js","packs/js/share-Dgt-jfTN.js","packs/js/upload-CiFqaFVT.js","packs/js/volume-3-B1kk5b5H.js","packs/js/moderation-N8BQuuku.js","packs/js/user-minus-BAZLs1rR.js","packs/js/useBlockGroupMember-DB1jTO1F.js","packs/js/useGroup-CQ2Ff7WP.js","packs/js/useUnmuteGroup-BroaL5no.js","packs/js/emoji-selector-WaSTk7RK.js","packs/js/useClickOutside-BrlxVkTp.js","packs/js/copy-B1iOMhZA.js","packs/js/status-container-4oAus1Wv.js","packs/js/index-Dgk1kvM9.js","packs/js/useCommunityStream-BWAYsYpU.js","packs/js/useTimelineStream-DT44m-k9.js","packs/js/useIsMobile-B1iYK8o9.js","packs/js/timeline-DXpE-X7G.js","packs/js/status-list-Zxa5hNaZ.js","packs/js/feed-suggestions-C4K1rYgw.js","packs/js/suggestions-w0rbTtqT.js","packs/js/placeholder-status-8vV9qww0.js","packs/js/pending-status-CB1QqXme.js","packs/js/poll-preview-BRGMf1ZL.js","packs/js/index-BeVv_xKT.js","packs/js/index-C3KAP9x7.js","packs/js/accordion-CWJAtbLj.js","packs/js/chevron-up-CI4deq8q.js","packs/js/dots-vertical-CMwGTnrr.js","packs/js/pinned-hosts-picker-BEoWIp-c.js","packs/js/index-qKochosu.js","packs/js/icon-button-BYyPLdrI.js","packs/js/index-qDQHrli3.js","packs/js/index-CFlIl2oA.js","packs/js/account-search-EsJwEQct.js","packs/js/search-SR6CU65t.js","packs/js/autosuggest-account-input-b-A85_Xq.js","packs/js/autosuggest-input-BFkoU5oD.js","packs/js/autosuggest-account-qVk2oVya.js","packs/js/mapping-B-67IkM1.js","packs/js/input-CaJ61GZG.js","packs/js/suggestions-Dezp38JV.js","packs/js/index-2xjJQ2Tc.js","packs/js/index-CHjWGURY.js","packs/js/missing-indicator-DTB6R6u9.js","packs/js/index-DtG2u0VG.js","packs/js/list-Daq0jOLO.js","packs/js/new-list-form-CxdMmVFM.js","packs/js/index-ChL6LShn.js","packs/js/index-BZ1Qizz9.js","packs/js/thread-CSAbkizU.js","packs/js/index-DVU0qd7r.js","packs/js/index-BuzN2iJ1.js","packs/js/useAccountLookup-C4WC-2V-.js","packs/js/index-BTTOS_ik.js","packs/js/media-item-4TI5A69D.js","packs/js/volume-DlGWDYQw.js","packs/js/index-B58rJriC.js","packs/js/useAccountList-LAtLxeot.js","packs/js/useBatchedEntities-C0uDqjr8.js","packs/js/index-BQapNynt.js","packs/js/index-DjPZhJg5.js","packs/js/authorize-reject-buttons-CCw6WgEQ.js","packs/js/index-D4zg4m_b.js","packs/js/index-D3XwROy1.js","packs/js/index-CfaHuLwi.js","packs/js/index-B965Eqb2.js","packs/js/lock-open-CvZKgn16.js","packs/js/index-BHANUSGB.js","packs/js/mute-modal-CtX6Jlbc.js","packs/js/duration-selector-POR92bNC.js","packs/js/index-DNdBkOv6.js","packs/js/edit-filter-B91sgSg8.js","packs/js/form-actions-BqsRytxx.js","packs/js/form-group-BotyGYcA.js","packs/js/checkbox-CIEPlWkm.js","packs/js/streamfield-QvMdy6rs.js","packs/js/report-modal-BibUgszN.js","packs/js/group-card-B9HLcAzL.js","packs/js/group-header-image-I9C8iR7B.js","packs/js/group-relationship-DjoFJ-WY.js","packs/js/users-BzbVJ-EC.js","packs/js/progress-bar-Di5s9VUJ.js","packs/js/optional-motion-BsUqX612.js","packs/js/arrows-minimize-DkVyu1hE.js","packs/js/account-moderation-modal-Db76kZDQ.js","packs/js/media-gallery-bkHzS0oD.js","packs/js/upload-CrVVdBkz.js","packs/js/media-aspect-ratio-CAEBADQp.js","packs/js/index-V4dzGs6n.js","packs/js/index-CIchaYxy.js","packs/js/download-B4GS34kY.js","packs/js/media-modal-BDDSDHSb.js","packs/js/arrow-right-Bo-ysgZM.js","packs/js/index-ZIkETy8W.js","packs/js/video-modal-Cm8shPMQ.js","packs/js/boost-modal-C4zj8S7H.js","packs/js/reply-indicator-CVnC81Og.js","packs/js/confirmation-modal-CfdeA9SF.js","packs/js/missing-description-modal-BkGndnC9.js","packs/js/actions-modal-CPv2HlPc.js","packs/js/hotkeys-modal-DMHr_U5B.js","packs/js/compose-modal-CSF0M_Dx.js","packs/js/modal-root-C1Bc3lN_.js","packs/js/usePrevious-CrNW0RqY.js","packs/js/useCompose-BC84Oucd.js","packs/js/useDraggedFiles-DEu1opRe.js","packs/js/compose-form-5LwLB_B_.js","packs/js/emoji-node-Bl6qqqc4.js","packs/js/emoji-picker-dropdown-container-CBt6kkZ0.js","packs/js/upload-button-rEOTd3qo.js","packs/js/useSettingsNotifications-BTAYxO3r.js","packs/js/Overlay-CUUj-Prf.js","packs/js/calendar-stats-BF20vQsz.js","packs/js/datetime-I_R6tiNA.js","packs/js/reply-mentions-modal-ywAaf06Z.js","packs/js/unauthorized-modal-C4c51nAg.js","packs/js/useRegistrationStatus-CVcWb2Aq.js","packs/js/edit-federation-modal--PhhMAUr.js","packs/js/embed-modal-fs3-Q6xS.js","packs/js/copyable-input-Bad1obHd.js","packs/js/component-modal-CoaN3yGT.js","packs/js/reblogs-modal-D_cdQM5n.js","packs/js/favourites-modal-Bmv3ZeH6.js","packs/js/dislikes-modal-Bebu5mH-.js","packs/js/reactions-modal-CA5Gtgwr.js","packs/js/mentions-modal-KZXbPPeM.js","packs/js/landing-page-modal-BbWYIHUF.js","packs/js/birthdays-modal-B0r4Q0s-.js","packs/js/balloon-DRpTiU5V.js","packs/js/birthday-panel-DH2WlBr4.js","packs/js/widget-IMp6jsOh.js","packs/js/index-BJGRbLao.js","packs/js/backspace-CAG12mil.js","packs/js/index-D1E96Djv.js","packs/js/index-pgROd6sC.js","packs/js/search-results-CJH2vAtN.js","packs/js/hashtag-DmeVkMGD.js","packs/js/placeholder-account-SSRoaA4p.js","packs/js/placeholder-hashtag-jk_3c7O9.js","packs/js/search-C7dpXjft.js","packs/js/radio-button-BGXyTrgS.js","packs/assets/index-BsJ2C43g.css","packs/js/index-Dtapc7e0.js","packs/js/login-page-BL1uweT-.js","packs/js/big-card-DUdfenJh.js","packs/js/strings-DUAqYmp4.js","packs/js/index-DFlwV3iU.js","packs/js/registration-page-BBHPuYrT.js","packs/js/registration-form-C1wjDInn.js","packs/js/birthday-input-pAyvLNKn.js","packs/js/index-DL0MlyPH.js","packs/js/accounts-B9ri4WyQ.js","packs/js/index-C4JOre4t.js","packs/js/useImageField-CJLdXS_S.js","packs/js/header-picker-Ce0yfRjC.js","packs/js/photo-plus-DD8XfRyY.js","packs/js/index-Bd5zMBEe.js","packs/js/index-CS_GPRdu.js","packs/js/index-DgaP0lUo.js","packs/js/index-CBAGgJQ6.js","packs/js/file-input-Cswh2IJc.js","packs/js/fork-awesome-icon-a2V2Jzyd.js","packs/js/index-DQvFSfCp.js","packs/js/index-C76of6jf.js","packs/js/index-MXnYVzym.js","packs/js/password-reset-ID_zGkzc.js","packs/js/password-reset-confirm-3ZNGnUKe.js","packs/js/mfa-form-h2nxNtHZ.js","packs/js/index-iXvUwbJ0.js","packs/js/index-DgmqsgPf.js","packs/js/logout-CgHIQw-f.js","packs/js/menu-Dh1IxcDl.js","packs/js/reach-popover-Cb1vj71S.js","packs/assets/menu-CG6a5kV0.css","packs/js/chat-search-input-CtG-ZSm3.js","packs/js/useDebounce-OM1yoNeS.js","packs/assets/chat-search-input-BnVmv4WN.css","packs/js/settings-Dv8RUJvM.js","packs/js/chat-widget-BQxKIk4F.js","packs/js/index-C1wp07tU.js","packs/js/link-footer-DjlwrC6X.js","packs/js/promo-panel-BUyusRvt.js","packs/js/index-D7nRbBXj.js","packs/js/download-B8pUR_V1.js","packs/js/moderation-log-CI1O7GUG.js","packs/js/index-Df8zPiIA.js","packs/js/refresh-D0k8agab.js","packs/js/slider-C5d1dakR.js","packs/js/sign-up-panel-Bmlv8eq_.js","packs/js/cta-banner-UaEeVIY-.js","packs/js/banner-BuvAyZ6v.js","packs/js/funding-panel-Bg2vZ1JR.js","packs/js/trends-panel-DcPPECAv.js","packs/js/profile-info-panel-Dpy48quO.js","packs/js/usePatronUser-BSLmsZFZ.js","packs/js/profile-field-CdyVwUTJ.js","packs/js/profile-stats-BCwkv_th.js","packs/js/flame-u7nvHclv.js","packs/js/profile-media-panel-BUzGzsSq.js","packs/js/profile-fields-panel-BpSwYHhp.js","packs/js/pinned-accounts-panel-Dsh4VS73.js","packs/js/instance-info-panel-3mLu4_k8.js","packs/js/instance-moderation-panel-CgL3FJOy.js","packs/js/instance-restrictions-CtKinFuC.js","packs/js/latest-accounts-panel-LKqQRHwD.js","packs/js/useAdminAccounts-BUvttMl2.js","packs/js/admin-account-B1BFMYxc.js","packs/js/sidebar-menu-HXJqz9wf.js","packs/js/circle-x-B2Bxwo86.js","packs/js/code-COSCzycO.js","packs/js/hash-CcMTqu6J.js","packs/js/wallet-COV1Vv7x.js","packs/js/modal-container-DOkpIme9.js","packs/js/profile-hover-card-DBoDnPLG.js","packs/js/status-hover-card-C289UBF-.js","packs/js/index-CyHtZKji.js","packs/js/site-wallet-BVo-AywG.js","packs/js/crypto-address-DUrZIHv3.js","packs/js/crypto-icon-BFdtlj8F.js","packs/js/crypto-donate-panel-C0_avDBs.js","packs/js/crypto-donate-modal-Df4gWuK2.js","packs/js/lightning-address-JoAMXx-k.js","packs/js/index-BiAOA3vV.js","packs/js/user-index-BADBna_T.js","packs/js/index-De7N6zSE.js","packs/js/index-Crdq1HH1.js","packs/js/index-DSDqguwe.js","packs/js/who-to-follow-panel-PM9VgXIU.js","packs/js/placeholder-sidebar-suggestions-BxzR4zCI.js","packs/js/latest-accounts-panel-CvBZDH_C.js","packs/js/index-Cluu2Hxz.js","packs/js/index-evtfrN1S.js","packs/js/index-RUpoIdae.js","packs/js/index-Cq-KjHPS.js","packs/js/home-BpYK2wwN.js","packs/js/create-Dp0cXZEw.js","packs/js/settings-store-OTGvZ0Jx.js","packs/js/index-B0iaJOrS.js","packs/js/service-worker-info-Cz7TsQ-3.js","packs/js/indicator-C3khJKjW.js","packs/js/compare-history-modal-B4G5ldD_.js","packs/js/index-CfTrAlMX.js","packs/js/familiar-followers-modal-veEMqvL8.js","packs/js/announcements-panel-BlmD1a0K.js","packs/js/index-DZ-i2Jas.js","packs/js/compose-event-modal-CekNCyRo.js","packs/js/join-event-modal-DzN0GfjC.js","packs/js/event-header-Cb9xIQhw.js","packs/js/event-information-DEoyFuKv.js","packs/js/event-discussion-BQCzrL95.js","packs/js/event-map-modal-BffgK0fr.js","packs/assets/event-map-modal-C-XUDgWS.css","packs/js/event-participants-modal-cLK-3GPI.js","packs/js/index-CTHUkE4o.js","packs/js/chevron-left-DYhciPPw.js","packs/js/index-DEu8MUOW.js","packs/js/useGroups-D2zbPESM.js","packs/js/permissions-BSW-aoUe.js","packs/js/placeholder-group-card-DsT0nBv0.js","packs/js/usePendingGroups-BelXlX2y.js","packs/js/pending-items-row-CdI47pVo.js","packs/js/tab-bar-Drzt_2c-.js","packs/js/discover-rpnjWCVv.js","packs/js/usePopularGroups-9jL_RTUg.js","packs/js/layout-list-laTVLTiq.js","packs/js/group-action-button-CHgRc7WW.js","packs/js/tag-list-item-1fN0j1lA.js","packs/js/placeholder-group-search-CtExnJxA.js","packs/js/groups-C6oV3P1w.js","packs/js/group-list-item-DKBRJdMQ.js","packs/js/layout-buttons-Brsp5PL5.js","packs/js/useSuggestedGroups-BwEY2rnL.js","packs/js/popular-NHgLnUtQ.js","packs/js/suggested-D10d1P1q.js","packs/js/tag-HtOasLWj.js","packs/js/useGroupTag-C6s4F1oC.js","packs/js/tags-CWH-sNn6.js","packs/js/pending-requests-COpSCEo5.js","packs/js/group-members-DhAM9agu.js","packs/js/useGroupMembers-F9E3EFbT.js","packs/js/useGroupMembershipRequests-isT3-8nk.js","packs/js/group-tags-DQyL8G7S.js","packs/js/useGroupTags-ejwdHUps.js","packs/js/group-tag-timeline-BF42GoE7.js","packs/js/message-2-PqkRl1SC.js","packs/js/group-timeline-DUBHu4NB.js","packs/js/manage-group-BwbB-jtZ.js","packs/js/column-forbidden-tguB9NMr.js","packs/js/edit-group-BMj6HOs9.js","packs/js/useTextField-CBWDKSYU.js","packs/js/group-tags-field-BDxtx8V_.js","packs/js/group-blocked-members-UkJ14vw-.js","packs/js/group-membership-requests-DuA9ySdn.js","packs/js/group-gallery-DVcBd9xe.js","packs/js/create-group-modal-D2Upfu2x.js","packs/js/new-group-panel-CI4SZUdL.js","packs/js/my-groups-panel-DRgcY8-z.js","packs/js/suggested-groups-panel-u1LNW9gC.js","packs/js/group-media-panel-D-yHDRu8.js","packs/js/new-event-panel-0E9yznKI.js","packs/js/announcements-BmAVNjfv.js","packs/js/useAnnouncements-ZF5YgzcY.js","packs/js/edit-announcement-modal-BYQL41CV.js","packs/js/index-B_Z9eeuU.js","packs/js/account-note-panel-CJfXLSl8.js","packs/js/index-CtDQw7Ci.js","packs/js/focus-plugin--iIkw65e.js","packs/js/onboarding-modal-C948p-hg.js","packs/js/index-C-4_8TjB.js","packs/js/nostr-signup-modal-CzEYd3c1.js","packs/js/nostr-extension-indicator-CZkjZult.js","packs/js/nostr-login-modal-oF2cAL0-.js","packs/js/domains-P7lyuLw0.js","packs/js/useDomains-D9HTWQxH.js","packs/js/edit-domain-modal-BezugQKX.js","packs/js/index-Dthr6DQq.js","packs/js/relay-editor-C4PUDD66.js","packs/js/Bech32Redirect-KlHnMQWM.js","packs/js/manage-zap-split-C_jL8urT.js","packs/js/zap-split-BzwBB0_P.js","packs/js/manage-ditto-server-C_WzXsSe.js","packs/js/relays-Dx-20j01.js","packs/js/rules-4DGBsyKB.js","packs/js/useRules-D3CMPqJB.js","packs/js/edit-rule-modal-BU6uUAJt.js","packs/js/nostr-relays-sVyeuLWX.js","packs/js/pay-request-modal-BKjqKGVf.js","packs/js/useHooks-CGm6xTDF.js","packs/js/usePaymentMethod-bWlefX6A.js","packs/js/zap-invoice-drt8ihHZ.js","packs/js/folder-open-C6xzlwzf.js","packs/js/zaps-modal-D34uN0ff.js","packs/js/zap-split-modal-DCaqA5Wy.js","packs/js/captcha-modal-86ZaTHvK.js","packs/js/nostr-bunker-login-CW5mPtH1.js","packs/js/index-BFAEhHR9.js","packs/js/dots-circle-horizontal-JldemYr_.js","packs/js/balance-CpY92J9l.js","packs/js/square-arrow-right-C8nw9IoM.js","packs/js/editable-lists-Cwh0BR_Q.js","packs/js/transactions-CczLNYJa.js","packs/js/wallet-relays-iv6h1JiT.js","packs/js/wallet-mints-Brbh8IGo.js","packs/js/wallet-transactions-C24PmBBe.js","packs/js/streak-modal-DBPyhPgx.js","packs/js/follows-timeline-CNo-Vlny.js","packs/js/community-timeline-C2oJyF5O.js","packs/js/pocket-wallet-DtPUHioh.js","packs/js/gdpr-banner-B-E_CSft.js","packs/js/index-ChfgrgkU.js","packs/js/index-hDENGkyq.js"])))=>i.map(i=>d[i]); var Rp=Object.defineProperty;var Mf=E=>{throw TypeError(E)};var Ip=(E,y,R)=>y in E?Rp(E,y,{enumerable:!0,configurable:!0,writable:!0,value:R}):E[y]=R;var Jt=(E,y,R)=>Ip(E,typeof y!="symbol"?y+"":y,R),ll=(E,y,R)=>y.has(E)||Mf("Cannot "+R);var et=(E,y,R)=>(ll(E,y,"read from private field"),R?R.call(E):y.get(E)),wt=(E,y,R)=>y.has(E)?Mf("Cannot add the same private member more than once"):y instanceof WeakSet?y.add(E):y.set(E,R),It=(E,y,R,k)=>(ll(E,y,"write to private field"),k?k.call(E,R):y.set(E,R),R),jt=(E,y,R)=>(ll(E,y,"access private method"),R);var xc=(E,y,R,k)=>({set _(H){It(E,y,H,R)},get _(){return et(E,y,k)}});function _mergeNamespaces(E,y){for(var R=0;Rk[H]})}}}return Object.freeze(Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}))}(function(){const y=document.createElement("link").relList;if(y&&y.supports&&y.supports("modulepreload"))return;for(const H of document.querySelectorAll('link[rel="modulepreload"]'))k(H);new MutationObserver(H=>{for(const B of H)if(B.type==="childList")for(const te of B.addedNodes)te.tagName==="LINK"&&te.rel==="modulepreload"&&k(te)}).observe(document,{childList:!0,subtree:!0});function R(H){const B={};return H.integrity&&(B.integrity=H.integrity),H.referrerPolicy&&(B.referrerPolicy=H.referrerPolicy),H.crossOrigin==="use-credentials"?B.credentials="include":H.crossOrigin==="anonymous"?B.credentials="omit":B.credentials="same-origin",B}function k(H){if(H.ep)return;H.ep=!0;const B=R(H);fetch(H.href,B)}})();var commonjsGlobal$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(E){return E&&E.__esModule&&Object.prototype.hasOwnProperty.call(E,"default")?E.default:E}function getAugmentedNamespace(E){if(E.__esModule)return E;var y=E.default;if(typeof y=="function"){var R=function k(){return this instanceof k?Reflect.construct(y,arguments,this.constructor):y.apply(this,arguments)};R.prototype=y.prototype}else R={};return Object.defineProperty(R,"__esModule",{value:!0}),Object.keys(E).forEach(function(k){var H=Object.getOwnPropertyDescriptor(E,k);Object.defineProperty(R,k,H.get?H:{enumerable:!0,get:function(){return E[k]}})}),R}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReact_production_min;function requireReact_production_min(){if(hasRequiredReact_production_min)return react_production_min;hasRequiredReact_production_min=1;var E=Symbol.for("react.element"),y=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),te=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),Ce=Symbol.for("react.memo"),Oe=Symbol.for("react.lazy"),Le=Symbol.iterator;function Ne(He){return He===null||typeof He!="object"?null:(He=Le&&He[Le]||He["@@iterator"],typeof He=="function"?He:null)}var Fe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ue=Object.assign,De={};function $e(He,Ze,mt){this.props=He,this.context=Ze,this.refs=De,this.updater=mt||Fe}$e.prototype.isReactComponent={},$e.prototype.setState=function(He,Ze){if(typeof He!="object"&&typeof He!="function"&&He!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,He,Ze,"setState")},$e.prototype.forceUpdate=function(He){this.updater.enqueueForceUpdate(this,He,"forceUpdate")};function Be(){}Be.prototype=$e.prototype;function Ve(He,Ze,mt){this.props=He,this.context=Ze,this.refs=De,this.updater=mt||Fe}var Ke=Ve.prototype=new Be;Ke.constructor=Ve,Ue(Ke,$e.prototype),Ke.isPureReactComponent=!0;var st=Array.isArray,We=Object.prototype.hasOwnProperty,at={current:null},tt={key:!0,ref:!0,__self:!0,__source:!0};function ft(He,Ze,mt){var gt,vt={},Lt=null,Ut=null;if(Ze!=null)for(gt in Ze.ref!==void 0&&(Ut=Ze.ref),Ze.key!==void 0&&(Lt=""+Ze.key),Ze)We.call(Ze,gt)&&!tt.hasOwnProperty(gt)&&(vt[gt]=Ze[gt]);var $t=arguments.length-2;if($t===1)vt.children=mt;else if(1<$t){for(var zt=Array($t),er=0;er<$t;er++)zt[er]=arguments[er+2];vt.children=zt}if(He&&He.defaultProps)for(gt in $t=He.defaultProps,$t)vt[gt]===void 0&&(vt[gt]=$t[gt]);return{$$typeof:E,type:He,key:Lt,ref:Ut,props:vt,_owner:at.current}}function Ye(He,Ze){return{$$typeof:E,type:He.type,key:Ze,ref:He.ref,props:He.props,_owner:He._owner}}function ot(He){return typeof He=="object"&&He!==null&&He.$$typeof===E}function nt(He){var Ze={"=":"=0",":":"=2"};return"$"+He.replace(/[=:]/g,function(mt){return Ze[mt]})}var pt=/\/+/g;function dt(He,Ze){return typeof He=="object"&&He!==null&&He.key!=null?nt(""+He.key):Ze.toString(36)}function rt(He,Ze,mt,gt,vt){var Lt=typeof He;(Lt==="undefined"||Lt==="boolean")&&(He=null);var Ut=!1;if(He===null)Ut=!0;else switch(Lt){case"string":case"number":Ut=!0;break;case"object":switch(He.$$typeof){case E:case y:Ut=!0}}if(Ut)return Ut=He,vt=vt(Ut),He=gt===""?"."+dt(Ut,0):gt,st(vt)?(mt="",He!=null&&(mt=He.replace(pt,"$&/")+"/"),rt(vt,Ze,mt,"",function(er){return er})):vt!=null&&(ot(vt)&&(vt=Ye(vt,mt+(!vt.key||Ut&&Ut.key===vt.key?"":(""+vt.key).replace(pt,"$&/")+"/")+He)),Ze.push(vt)),1;if(Ut=0,gt=gt===""?".":gt+":",st(He))for(var $t=0;$t{y=H,R=B});return{resolve:y,reject:R,promise:k}});var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state");function die(E,...y){throw new Error(`[Immer] minified error nr: ${E}. Full error at: https://bit.ly/3cXEKWf`)}var getPrototypeOf$1=Object.getPrototypeOf;function isDraft(E){return!!E&&!!E[DRAFT_STATE]}function isDraftable(E){var y;return E?isPlainObject$3(E)||Array.isArray(E)||!!E[DRAFTABLE]||!!((y=E.constructor)!=null&&y[DRAFTABLE])||isMap$1(E)||isSet$1(E):!1}var objectCtorString=Object.prototype.constructor.toString();function isPlainObject$3(E){if(!E||typeof E!="object")return!1;const y=getPrototypeOf$1(E);if(y===null)return!0;const R=Object.hasOwnProperty.call(y,"constructor")&&y.constructor;return R===Object?!0:typeof R=="function"&&Function.toString.call(R)===objectCtorString}function each(E,y){getArchtype(E)===0?Object.entries(E).forEach(([R,k])=>{y(R,k,E)}):E.forEach((R,k)=>y(k,R,E))}function getArchtype(E){const y=E[DRAFT_STATE];return y?y.type_:Array.isArray(E)?1:isMap$1(E)?2:isSet$1(E)?3:0}function has$1(E,y){return getArchtype(E)===2?E.has(y):Object.prototype.hasOwnProperty.call(E,y)}function set$1(E,y,R){const k=getArchtype(E);k===2?E.set(y,R):k===3?E.add(R):E[y]=R}function is$2(E,y){return E===y?E!==0||1/E===1/y:E!==E&&y!==y}function isMap$1(E){return E instanceof Map}function isSet$1(E){return E instanceof Set}function latest(E){return E.copy_||E.base_}function shallowCopy$1(E,y){if(isMap$1(E))return new Map(E);if(isSet$1(E))return new Set(E);if(Array.isArray(E))return Array.prototype.slice.call(E);if(!y&&isPlainObject$3(E))return getPrototypeOf$1(E)?{...E}:Object.assign(Object.create(null),E);const R=Object.getOwnPropertyDescriptors(E);delete R[DRAFT_STATE];let k=Reflect.ownKeys(R);for(let H=0;H1&&(E.set=E.add=E.clear=E.delete=dontMutateFrozenCollections),Object.freeze(E),y&&each(E,(R,k)=>freeze(k,!0))),E}function dontMutateFrozenCollections(){die(2)}function isFrozen(E){return Object.isFrozen(E)}var plugins={};function getPlugin(E){const y=plugins[E];return y||die(0,E),y}function loadPlugin(E,y){plugins[E]||(plugins[E]=y)}var currentScope;function getCurrentScope(){return currentScope}function createScope(E,y){return{drafts_:[],parent_:E,immer_:y,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function usePatchesInScope(E,y){y&&(getPlugin("Patches"),E.patches_=[],E.inversePatches_=[],E.patchListener_=y)}function revokeScope(E){leaveScope(E),E.drafts_.forEach(revokeDraft),E.drafts_=null}function leaveScope(E){E===currentScope&&(currentScope=E.parent_)}function enterScope(E){return currentScope=createScope(currentScope,E)}function revokeDraft(E){const y=E[DRAFT_STATE];y.type_===0||y.type_===1?y.revoke_():y.revoked_=!0}function processResult(E,y){y.unfinalizedDrafts_=y.drafts_.length;const R=y.drafts_[0];return E!==void 0&&E!==R?(R[DRAFT_STATE].modified_&&(revokeScope(y),die(4)),isDraftable(E)&&(E=finalize(y,E),y.parent_||maybeFreeze(y,E)),y.patches_&&getPlugin("Patches").generateReplacementPatches_(R[DRAFT_STATE].base_,E,y.patches_,y.inversePatches_)):E=finalize(y,R,[]),revokeScope(y),y.patches_&&y.patchListener_(y.patches_,y.inversePatches_),E!==NOTHING?E:void 0}function finalize(E,y,R){if(isFrozen(y))return y;const k=y[DRAFT_STATE];if(!k)return each(y,(H,B)=>finalizeProperty(E,k,y,H,B,R)),y;if(k.scope_!==E)return y;if(!k.modified_)return maybeFreeze(E,k.base_,!0),k.base_;if(!k.finalized_){k.finalized_=!0,k.scope_.unfinalizedDrafts_--;const H=k.copy_;let B=H,te=!1;k.type_===3&&(B=new Set(H),H.clear(),te=!0),each(B,(ae,ce)=>finalizeProperty(E,k,H,ae,ce,R,te)),maybeFreeze(E,H,!1),R&&E.patches_&&getPlugin("Patches").generatePatches_(k,R,E.patches_,E.inversePatches_)}return k.copy_}function finalizeProperty(E,y,R,k,H,B,te){if(isDraft(H)){const ae=B&&y&&y.type_!==3&&!has$1(y.assigned_,k)?B.concat(k):void 0,ce=finalize(E,H,ae);if(set$1(R,k,ce),isDraft(ce))E.canAutoFreeze_=!1;else return}else te&&R.add(H);if(isDraftable(H)&&!isFrozen(H)){if(!E.immer_.autoFreeze_&&E.unfinalizedDrafts_<1)return;finalize(E,H),(!y||!y.scope_.parent_)&&maybeFreeze(E,H)}}function maybeFreeze(E,y,R=!1){!E.parent_&&E.immer_.autoFreeze_&&E.canAutoFreeze_&&freeze(y,R)}function createProxyProxy(E,y){const R=Array.isArray(E),k={type_:R?1:0,scope_:y?y.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:{},parent_:y,base_:E,draft_:null,copy_:null,revoke_:null,isManual_:!1};let H=k,B=objectTraps;R&&(H=[k],B=arrayTraps);const{revoke:te,proxy:ae}=Proxy.revocable(H,B);return k.draft_=ae,k.revoke_=te,ae}var objectTraps={get(E,y){if(y===DRAFT_STATE)return E;const R=latest(E);if(!has$1(R,y))return readPropFromProto(E,R,y);const k=R[y];return E.finalized_||!isDraftable(k)?k:k===peek(E.base_,y)?(prepareCopy(E),E.copy_[y]=createProxy(k,E)):k},has(E,y){return y in latest(E)},ownKeys(E){return Reflect.ownKeys(latest(E))},set(E,y,R){const k=getDescriptorFromProto(latest(E),y);if(k!=null&&k.set)return k.set.call(E.draft_,R),!0;if(!E.modified_){const H=peek(latest(E),y),B=H==null?void 0:H[DRAFT_STATE];if(B&&B.base_===R)return E.copy_[y]=R,E.assigned_[y]=!1,!0;if(is$2(R,H)&&(R!==void 0||has$1(E.base_,y)))return!0;prepareCopy(E),markChanged(E)}return E.copy_[y]===R&&(R!==void 0||y in E.copy_)||Number.isNaN(R)&&Number.isNaN(E.copy_[y])||(E.copy_[y]=R,E.assigned_[y]=!0),!0},deleteProperty(E,y){return peek(E.base_,y)!==void 0||y in E.base_?(E.assigned_[y]=!1,prepareCopy(E),markChanged(E)):delete E.assigned_[y],E.copy_&&delete E.copy_[y],!0},getOwnPropertyDescriptor(E,y){const R=latest(E),k=Reflect.getOwnPropertyDescriptor(R,y);return k&&{writable:!0,configurable:E.type_!==1||y!=="length",enumerable:k.enumerable,value:R[y]}},defineProperty(){die(11)},getPrototypeOf(E){return getPrototypeOf$1(E.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(E,y)=>{arrayTraps[E]=function(){return arguments[0]=arguments[0][0],y.apply(this,arguments)}});arrayTraps.deleteProperty=function(E,y){return arrayTraps.set.call(this,E,y,void 0)};arrayTraps.set=function(E,y,R){return objectTraps.set.call(this,E[0],y,R,E[0])};function peek(E,y){const R=E[DRAFT_STATE];return(R?latest(R):E)[y]}function readPropFromProto(E,y,R){var H;const k=getDescriptorFromProto(y,R);return k?"value"in k?k.value:(H=k.get)==null?void 0:H.call(E.draft_):void 0}function getDescriptorFromProto(E,y){if(!(y in E))return;let R=getPrototypeOf$1(E);for(;R;){const k=Object.getOwnPropertyDescriptor(R,y);if(k)return k;R=getPrototypeOf$1(R)}}function markChanged(E){E.modified_||(E.modified_=!0,E.parent_&&markChanged(E.parent_))}function prepareCopy(E){E.copy_||(E.copy_=shallowCopy$1(E.base_,E.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(E){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(y,R,k)=>{if(typeof y=="function"&&typeof R!="function"){const B=R;R=y;const te=this;return function(ce=B,...Ce){return te.produce(ce,Oe=>R.call(this,Oe,...Ce))}}typeof R!="function"&&die(6),k!==void 0&&typeof k!="function"&&die(7);let H;if(isDraftable(y)){const B=enterScope(this),te=createProxy(y,void 0);let ae=!0;try{H=R(te),ae=!1}finally{ae?revokeScope(B):leaveScope(B)}return usePatchesInScope(B,k),processResult(H,B)}else if(!y||typeof y!="object"){if(H=R(y),H===void 0&&(H=y),H===NOTHING&&(H=void 0),this.autoFreeze_&&freeze(H,!0),k){const B=[],te=[];getPlugin("Patches").generateReplacementPatches_(y,H,B,te),k(B,te)}return H}else die(1,y)},this.produceWithPatches=(y,R)=>{if(typeof y=="function")return(te,...ae)=>this.produceWithPatches(te,ce=>y(ce,...ae));let k,H;return[this.produce(y,R,(te,ae)=>{k=te,H=ae}),k,H]},typeof(E==null?void 0:E.autoFreeze)=="boolean"&&this.setAutoFreeze(E.autoFreeze),typeof(E==null?void 0:E.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(E.useStrictShallowCopy)}createDraft(E){isDraftable(E)||die(8),isDraft(E)&&(E=current(E));const y=enterScope(this),R=createProxy(E,void 0);return R[DRAFT_STATE].isManual_=!0,leaveScope(y),R}finishDraft(E,y){const R=E&&E[DRAFT_STATE];(!R||!R.isManual_)&&die(9);const{scope_:k}=R;return usePatchesInScope(k,y),processResult(void 0,k)}setAutoFreeze(E){this.autoFreeze_=E}setUseStrictShallowCopy(E){this.useStrictShallowCopy_=E}applyPatches(E,y){let R;for(R=y.length-1;R>=0;R--){const H=y[R];if(H.path.length===0&&H.op==="replace"){E=H.value;break}}R>-1&&(y=y.slice(R+1));const k=getPlugin("Patches").applyPatches_;return isDraft(E)?k(E,y):this.produce(E,H=>k(H,y))}};function createProxy(E,y){const R=isMap$1(E)?getPlugin("MapSet").proxyMap_(E,y):isSet$1(E)?getPlugin("MapSet").proxySet_(E,y):createProxyProxy(E,y);return(y?y.scope_:getCurrentScope()).drafts_.push(R),R}function current(E){return isDraft(E)||die(10,E),currentImpl(E)}function currentImpl(E){if(!isDraftable(E)||isFrozen(E))return E;const y=E[DRAFT_STATE];let R;if(y){if(!y.modified_)return y.base_;y.finalized_=!0,R=shallowCopy$1(E,y.scope_.immer_.useStrictShallowCopy_)}else R=shallowCopy$1(E,!0);return each(R,(k,H)=>{set$1(R,k,currentImpl(H))}),y&&(y.finalized_=!1),R}function enableMapSet(){class E extends Map{constructor(ce,Ce){super(),this[DRAFT_STATE]={type_:2,parent_:Ce,scope_:Ce?Ce.scope_:getCurrentScope(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:ce,draft_:this,isManual_:!1,revoked_:!1}}get size(){return latest(this[DRAFT_STATE]).size}has(ce){return latest(this[DRAFT_STATE]).has(ce)}set(ce,Ce){const Oe=this[DRAFT_STATE];return te(Oe),(!latest(Oe).has(ce)||latest(Oe).get(ce)!==Ce)&&(R(Oe),markChanged(Oe),Oe.assigned_.set(ce,!0),Oe.copy_.set(ce,Ce),Oe.assigned_.set(ce,!0)),this}delete(ce){if(!this.has(ce))return!1;const Ce=this[DRAFT_STATE];return te(Ce),R(Ce),markChanged(Ce),Ce.base_.has(ce)?Ce.assigned_.set(ce,!1):Ce.assigned_.delete(ce),Ce.copy_.delete(ce),!0}clear(){const ce=this[DRAFT_STATE];te(ce),latest(ce).size&&(R(ce),markChanged(ce),ce.assigned_=new Map,each(ce.base_,Ce=>{ce.assigned_.set(Ce,!1)}),ce.copy_.clear())}forEach(ce,Ce){const Oe=this[DRAFT_STATE];latest(Oe).forEach((Le,Ne,Fe)=>{ce.call(Ce,this.get(Ne),Ne,this)})}get(ce){const Ce=this[DRAFT_STATE];te(Ce);const Oe=latest(Ce).get(ce);if(Ce.finalized_||!isDraftable(Oe)||Oe!==Ce.base_.get(ce))return Oe;const Le=createProxy(Oe,Ce);return R(Ce),Ce.copy_.set(ce,Le),Le}keys(){return latest(this[DRAFT_STATE]).keys()}values(){const ce=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const Ce=ce.next();return Ce.done?Ce:{done:!1,value:this.get(Ce.value)}}}}entries(){const ce=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const Ce=ce.next();if(Ce.done)return Ce;const Oe=this.get(Ce.value);return{done:!1,value:[Ce.value,Oe]}}}}[Symbol.iterator](){return this.entries()}}function y(ae,ce){return new E(ae,ce)}function R(ae){ae.copy_||(ae.assigned_=new Map,ae.copy_=new Map(ae.base_))}class k extends Set{constructor(ce,Ce){super(),this[DRAFT_STATE]={type_:3,parent_:Ce,scope_:Ce?Ce.scope_:getCurrentScope(),modified_:!1,finalized_:!1,copy_:void 0,base_:ce,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return latest(this[DRAFT_STATE]).size}has(ce){const Ce=this[DRAFT_STATE];return te(Ce),Ce.copy_?!!(Ce.copy_.has(ce)||Ce.drafts_.has(ce)&&Ce.copy_.has(Ce.drafts_.get(ce))):Ce.base_.has(ce)}add(ce){const Ce=this[DRAFT_STATE];return te(Ce),this.has(ce)||(B(Ce),markChanged(Ce),Ce.copy_.add(ce)),this}delete(ce){if(!this.has(ce))return!1;const Ce=this[DRAFT_STATE];return te(Ce),B(Ce),markChanged(Ce),Ce.copy_.delete(ce)||(Ce.drafts_.has(ce)?Ce.copy_.delete(Ce.drafts_.get(ce)):!1)}clear(){const ce=this[DRAFT_STATE];te(ce),latest(ce).size&&(B(ce),markChanged(ce),ce.copy_.clear())}values(){const ce=this[DRAFT_STATE];return te(ce),B(ce),ce.copy_.values()}entries(){const ce=this[DRAFT_STATE];return te(ce),B(ce),ce.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(ce,Ce){const Oe=this.values();let Le=Oe.next();for(;!Le.done;)ce.call(Ce,Le.value,Le.value,this),Le=Oe.next()}}function H(ae,ce){return new k(ae,ce)}function B(ae){ae.copy_||(ae.copy_=new Set,ae.base_.forEach(ce=>{if(isDraftable(ce)){const Ce=createProxy(ce,ae);ae.drafts_.set(ce,Ce),ae.copy_.add(Ce)}else ae.copy_.add(ce)}))}function te(ae){ae.revoked_&&die(3,JSON.stringify(latest(ae)))}loadPlugin("MapSet",{proxyMap_:y,proxySet_:H})}var immer=new Immer2,produce=immer.produce;immer.produceWithPatches.bind(immer);immer.setAutoFreeze.bind(immer);immer.setUseStrictShallowCopy.bind(immer);immer.applyPatches.bind(immer);immer.createDraft.bind(immer);immer.finishDraft.bind(immer);var client={},reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredScheduler_production_min;function requireScheduler_production_min(){return hasRequiredScheduler_production_min||(hasRequiredScheduler_production_min=1,function(E){function y(qe,Ge){var je=qe.length;qe.push(Ge);e:for(;0>>1,Ze=qe[He];if(0>>1;HeH(vt,je))LtH(Ut,vt)?(qe[He]=Ut,qe[Lt]=je,He=Lt):(qe[He]=vt,qe[gt]=je,He=gt);else if(LtH(Ut,je))qe[He]=Ut,qe[Lt]=je,He=Lt;else break e}}return Ge}function H(qe,Ge){var je=qe.sortIndex-Ge.sortIndex;return je!==0?je:qe.id-Ge.id}if(typeof performance=="object"&&typeof performance.now=="function"){var B=performance;E.unstable_now=function(){return B.now()}}else{var te=Date,ae=te.now();E.unstable_now=function(){return te.now()-ae}}var ce=[],Ce=[],Oe=1,Le=null,Ne=3,Fe=!1,Ue=!1,De=!1,$e=typeof setTimeout=="function"?setTimeout:null,Be=typeof clearTimeout=="function"?clearTimeout:null,Ve=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ke(qe){for(var Ge=R(Ce);Ge!==null;){if(Ge.callback===null)k(Ce);else if(Ge.startTime<=qe)k(Ce),Ge.sortIndex=Ge.expirationTime,y(ce,Ge);else break;Ge=R(Ce)}}function st(qe){if(De=!1,Ke(qe),!Ue)if(R(ce)!==null)Ue=!0,ke(We);else{var Ge=R(Ce);Ge!==null&&Xe(st,Ge.startTime-qe)}}function We(qe,Ge){Ue=!1,De&&(De=!1,Be(ft),ft=-1),Fe=!0;var je=Ne;try{for(Ke(Ge),Le=R(ce);Le!==null&&(!(Le.expirationTime>Ge)||qe&&!nt());){var He=Le.callback;if(typeof He=="function"){Le.callback=null,Ne=Le.priorityLevel;var Ze=He(Le.expirationTime<=Ge);Ge=E.unstable_now(),typeof Ze=="function"?Le.callback=Ze:Le===R(ce)&&k(ce),Ke(Ge)}else k(ce);Le=R(ce)}if(Le!==null)var mt=!0;else{var gt=R(Ce);gt!==null&&Xe(st,gt.startTime-Ge),mt=!1}return mt}finally{Le=null,Ne=je,Fe=!1}}var at=!1,tt=null,ft=-1,Ye=5,ot=-1;function nt(){return!(E.unstable_now()-otqe||125He?(qe.sortIndex=je,y(Ce,qe),R(ce)===null&&qe===R(Ce)&&(De?(Be(ft),ft=-1):De=!0,Xe(st,je-He))):(qe.sortIndex=Ze,y(ce,qe),Ue||Fe||(Ue=!0,ke(We))),qe},E.unstable_shouldYield=nt,E.unstable_wrapCallback=function(qe){var Ge=Ne;return function(){var je=Ne;Ne=Ge;try{return qe.apply(this,arguments)}finally{Ne=je}}}}(scheduler_production_min)),scheduler_production_min}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReactDom_production_min;function requireReactDom_production_min(){if(hasRequiredReactDom_production_min)return reactDom_production_min;hasRequiredReactDom_production_min=1;var E=requireReact(),y=requireScheduler();function R(K){for(var ie="https://reactjs.org/docs/error-decoder.html?invariant="+K,_e=1;_e"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ce=Object.prototype.hasOwnProperty,Ce=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Oe={},Le={};function Ne(K){return ce.call(Le,K)?!0:ce.call(Oe,K)?!1:Ce.test(K)?Le[K]=!0:(Oe[K]=!0,!1)}function Fe(K,ie,_e,Pe){if(_e!==null&&_e.type===0)return!1;switch(typeof ie){case"function":case"symbol":return!0;case"boolean":return Pe?!1:_e!==null?!_e.acceptsBooleans:(K=K.toLowerCase().slice(0,5),K!=="data-"&&K!=="aria-");default:return!1}}function Ue(K,ie,_e,Pe){if(ie===null||typeof ie>"u"||Fe(K,ie,_e,Pe))return!0;if(Pe)return!1;if(_e!==null)switch(_e.type){case 3:return!ie;case 4:return ie===!1;case 5:return isNaN(ie);case 6:return isNaN(ie)||1>ie}return!1}function De(K,ie,_e,Pe,we,Me,ze){this.acceptsBooleans=ie===2||ie===3||ie===4,this.attributeName=Pe,this.attributeNamespace=we,this.mustUseProperty=_e,this.propertyName=K,this.type=ie,this.sanitizeURL=Me,this.removeEmptyString=ze}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(K){$e[K]=new De(K,0,!1,K,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(K){var ie=K[0];$e[ie]=new De(ie,1,!1,K[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(K){$e[K]=new De(K,2,!1,K.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(K){$e[K]=new De(K,2,!1,K,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(K){$e[K]=new De(K,3,!1,K.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(K){$e[K]=new De(K,3,!0,K,null,!1,!1)}),["capture","download"].forEach(function(K){$e[K]=new De(K,4,!1,K,null,!1,!1)}),["cols","rows","size","span"].forEach(function(K){$e[K]=new De(K,6,!1,K,null,!1,!1)}),["rowSpan","start"].forEach(function(K){$e[K]=new De(K,5,!1,K.toLowerCase(),null,!1,!1)});var Be=/[\-:]([a-z])/g;function Ve(K){return K[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(K){var ie=K.replace(Be,Ve);$e[ie]=new De(ie,1,!1,K,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(K){var ie=K.replace(Be,Ve);$e[ie]=new De(ie,1,!1,K,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(K){var ie=K.replace(Be,Ve);$e[ie]=new De(ie,1,!1,K,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(K){$e[K]=new De(K,1,!1,K.toLowerCase(),null,!1,!1)}),$e.xlinkHref=new De("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(K){$e[K]=new De(K,1,!1,K.toLowerCase(),null,!0,!0)});function Ke(K,ie,_e,Pe){var we=$e.hasOwnProperty(ie)?$e[ie]:null;(we!==null?we.type!==0:Pe||!(2Je||we[ze]!==Me[Je]){var it=` `+we[ze].replace(" at new "," at ");return K.displayName&&it.includes("")&&(it=it.replace("",K.displayName)),it}while(1<=ze&&0<=Je);break}}}finally{mt=!1,Error.prepareStackTrace=_e}return(K=K?K.displayName||K.name:"")?Ze(K):""}function vt(K){switch(K.tag){case 5:return Ze(K.type);case 16:return Ze("Lazy");case 13:return Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 2:case 15:return K=gt(K.type,!1),K;case 11:return K=gt(K.type.render,!1),K;case 1:return K=gt(K.type,!0),K;default:return""}}function Lt(K){if(K==null)return null;if(typeof K=="function")return K.displayName||K.name||null;if(typeof K=="string")return K;switch(K){case tt:return"Fragment";case at:return"Portal";case Ye:return"Profiler";case ft:return"StrictMode";case dt:return"Suspense";case rt:return"SuspenseList"}if(typeof K=="object")switch(K.$$typeof){case nt:return(K.displayName||"Context")+".Consumer";case ot:return(K._context.displayName||"Context")+".Provider";case pt:var ie=K.render;return K=K.displayName,K||(K=ie.displayName||ie.name||"",K=K!==""?"ForwardRef("+K+")":"ForwardRef"),K;case Qe:return ie=K.displayName||null,ie!==null?ie:Lt(K.type)||"Memo";case ke:ie=K._payload,K=K._init;try{return Lt(K(ie))}catch{}}return null}function Ut(K){var ie=K.type;switch(K.tag){case 24:return"Cache";case 9:return(ie.displayName||"Context")+".Consumer";case 10:return(ie._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return K=ie.render,K=K.displayName||K.name||"",ie.displayName||(K!==""?"ForwardRef("+K+")":"ForwardRef");case 7:return"Fragment";case 5:return ie;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Lt(ie);case 8:return ie===ft?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof ie=="function")return ie.displayName||ie.name||null;if(typeof ie=="string")return ie}return null}function $t(K){switch(typeof K){case"boolean":case"number":case"string":case"undefined":return K;case"object":return K;default:return""}}function zt(K){var ie=K.type;return(K=K.nodeName)&&K.toLowerCase()==="input"&&(ie==="checkbox"||ie==="radio")}function er(K){var ie=zt(K)?"checked":"value",_e=Object.getOwnPropertyDescriptor(K.constructor.prototype,ie),Pe=""+K[ie];if(!K.hasOwnProperty(ie)&&typeof _e<"u"&&typeof _e.get=="function"&&typeof _e.set=="function"){var we=_e.get,Me=_e.set;return Object.defineProperty(K,ie,{configurable:!0,get:function(){return we.call(this)},set:function(ze){Pe=""+ze,Me.call(this,ze)}}),Object.defineProperty(K,ie,{enumerable:_e.enumerable}),{getValue:function(){return Pe},setValue:function(ze){Pe=""+ze},stopTracking:function(){K._valueTracker=null,delete K[ie]}}}}function Pn(K){K._valueTracker||(K._valueTracker=er(K))}function rr(K){if(!K)return!1;var ie=K._valueTracker;if(!ie)return!0;var _e=ie.getValue(),Pe="";return K&&(Pe=zt(K)?K.checked?"true":"false":K.value),K=Pe,K!==_e?(ie.setValue(K),!0):!1}function nr(K){if(K=K||(typeof document<"u"?document:void 0),typeof K>"u")return null;try{return K.activeElement||K.body}catch{return K.body}}function on(K,ie){var _e=ie.checked;return je({},ie,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:_e??K._wrapperState.initialChecked})}function Vo(K,ie){var _e=ie.defaultValue==null?"":ie.defaultValue,Pe=ie.checked!=null?ie.checked:ie.defaultChecked;_e=$t(ie.value!=null?ie.value:_e),K._wrapperState={initialChecked:Pe,initialValue:_e,controlled:ie.type==="checkbox"||ie.type==="radio"?ie.checked!=null:ie.value!=null}}function io(K,ie){ie=ie.checked,ie!=null&&Ke(K,"checked",ie,!1)}function Ci(K,ie){io(K,ie);var _e=$t(ie.value),Pe=ie.type;if(_e!=null)Pe==="number"?(_e===0&&K.value===""||K.value!=_e)&&(K.value=""+_e):K.value!==""+_e&&(K.value=""+_e);else if(Pe==="submit"||Pe==="reset"){K.removeAttribute("value");return}ie.hasOwnProperty("value")?Mt(K,ie.type,_e):ie.hasOwnProperty("defaultValue")&&Mt(K,ie.type,$t(ie.defaultValue)),ie.checked==null&&ie.defaultChecked!=null&&(K.defaultChecked=!!ie.defaultChecked)}function Gt(K,ie,_e){if(ie.hasOwnProperty("value")||ie.hasOwnProperty("defaultValue")){var Pe=ie.type;if(!(Pe!=="submit"&&Pe!=="reset"||ie.value!==void 0&&ie.value!==null))return;ie=""+K._wrapperState.initialValue,_e||ie===K.value||(K.value=ie),K.defaultValue=ie}_e=K.name,_e!==""&&(K.name=""),K.defaultChecked=!!K._wrapperState.initialChecked,_e!==""&&(K.name=_e)}function Mt(K,ie,_e){(ie!=="number"||nr(K.ownerDocument)!==K)&&(_e==null?K.defaultValue=""+K._wrapperState.initialValue:K.defaultValue!==""+_e&&(K.defaultValue=""+_e))}var qt=Array.isArray;function Vt(K,ie,_e,Pe){if(K=K.options,ie){ie={};for(var we=0;we<_e.length;we++)ie["$"+_e[we]]=!0;for(_e=0;_e"+ie.valueOf().toString()+"",ie=Cs.firstChild;K.firstChild;)K.removeChild(K.firstChild);for(;ie.firstChild;)K.appendChild(ie.firstChild)}});function qo(K,ie){if(ie){var _e=K.firstChild;if(_e&&_e===K.lastChild&&_e.nodeType===3){_e.nodeValue=ie;return}}K.textContent=ie}var xn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},As=["Webkit","ms","Moz","O"];Object.keys(xn).forEach(function(K){As.forEach(function(ie){ie=ie+K.charAt(0).toUpperCase()+K.substring(1),xn[ie]=xn[K]})});function va(K,ie,_e){return ie==null||typeof ie=="boolean"||ie===""?"":_e||typeof ie!="number"||ie===0||xn.hasOwnProperty(K)&&xn[K]?(""+ie).trim():ie+"px"}function Ca(K,ie){K=K.style;for(var _e in ie)if(ie.hasOwnProperty(_e)){var Pe=_e.indexOf("--")===0,we=va(_e,ie[_e],Pe);_e==="float"&&(_e="cssFloat"),Pe?K.setProperty(_e,we):K[_e]=we}}var Nc=je({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Qo(K,ie){if(ie){if(Nc[K]&&(ie.children!=null||ie.dangerouslySetInnerHTML!=null))throw Error(R(137,K));if(ie.dangerouslySetInnerHTML!=null){if(ie.children!=null)throw Error(R(60));if(typeof ie.dangerouslySetInnerHTML!="object"||!("__html"in ie.dangerouslySetInnerHTML))throw Error(R(61))}if(ie.style!=null&&typeof ie.style!="object")throw Error(R(62))}}function yr(K,ie){if(K.indexOf("-")===-1)return typeof ie.is=="string";switch(K){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jn=null;function Ko(K){return K=K.target||K.srcElement||window,K.correspondingUseElement&&(K=K.correspondingUseElement),K.nodeType===3?K.parentNode:K}var Ri=null,ao=null,co=null;function Aa(K){if(K=Zi(K)){if(typeof Ri!="function")throw Error(R(280));var ie=K.stateNode;ie&&(ie=Va(ie),Ri(K.stateNode,K.type,ie))}}function Xr(K){ao?co?co.push(K):co=[K]:ao=K}function Rs(){if(ao){var K=ao,ie=co;if(co=ao=null,Aa(K),ie)for(K=0;K>>=0,K===0?32:31-(xa(K)/Us|0)|0}var jr=64,En=4194304;function qn(K){switch(K&-K){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return K&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return K&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return K}}function po(K,ie){var _e=K.pendingLanes;if(_e===0)return 0;var Pe=0,we=K.suspendedLanes,Me=K.pingedLanes,ze=_e&268435455;if(ze!==0){var Je=ze&~we;Je!==0?Pe=qn(Je):(Me&=ze,Me!==0&&(Pe=qn(Me)))}else ze=_e&~we,ze!==0?Pe=qn(ze):Me!==0&&(Pe=qn(Me));if(Pe===0)return 0;if(ie!==0&&ie!==Pe&&!(ie&we)&&(we=Pe&-Pe,Me=ie&-ie,we>=Me||we===16&&(Me&4194240)!==0))return ie;if(Pe&4&&(Pe|=_e&16),ie=K.entangledLanes,ie!==0)for(K=K.entanglements,ie&=Pe;0_e;_e++)ie.push(K);return ie}function an(K,ie,_e){K.pendingLanes|=ie,ie!==536870912&&(K.suspendedLanes=0,K.pingedLanes=0),K=K.eventTimes,ie=31-Fr(ie),K[ie]=_e}function Mc(K,ie){var _e=K.pendingLanes&~ie;K.pendingLanes=ie,K.suspendedLanes=0,K.pingedLanes=0,K.expiredLanes&=ie,K.mutableReadLanes&=ie,K.entangledLanes&=ie,ie=K.entanglements;var Pe=K.eventTimes;for(K=K.expirationTimes;0<_e;){var we=31-Fr(_e),Me=1<=Hi),Ol=" ",Pl=!1;function xl(K,ie){switch(K){case"keyup":return Th.indexOf(ie.keyCode)!==-1;case"keydown":return ie.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ll(K){return K=K.detail,typeof K=="object"&&"data"in K?K.data:null}var ks=!1;function vh(K,ie){switch(K){case"compositionend":return Ll(ie);case"keypress":return ie.which!==32?null:(Pl=!0,Ol);case"textInput":return K=ie.data,K===Ol&&Pl?null:K;default:return null}}function Ch(K,ie){if(ks)return K==="compositionend"||!jc&&xl(K,ie)?(K=yl(),Na=Dc=So=null,ks=!1,K):null;switch(K){case"paste":return null;case"keypress":if(!(ie.ctrlKey||ie.altKey||ie.metaKey)||ie.ctrlKey&&ie.altKey){if(ie.char&&1=ie)return{node:_e,offset:ie-K};K=Pe}e:{for(;_e;){if(_e.nextSibling){_e=_e.nextSibling;break e}_e=_e.parentNode}_e=void 0}_e=Dl(_e)}}function kl(K,ie){return K&&ie?K===ie?!0:K&&K.nodeType===3?!1:ie&&ie.nodeType===3?kl(K,ie.parentNode):"contains"in K?K.contains(ie):K.compareDocumentPosition?!!(K.compareDocumentPosition(ie)&16):!1:!1}function Hl(){for(var K=window,ie=nr();ie instanceof K.HTMLIFrameElement;){try{var _e=typeof ie.contentWindow.location.href=="string"}catch{_e=!1}if(_e)K=ie.contentWindow;else break;ie=nr(K.document)}return ie}function qc(K){var ie=K&&K.nodeName&&K.nodeName.toLowerCase();return ie&&(ie==="input"&&(K.type==="text"||K.type==="search"||K.type==="tel"||K.type==="url"||K.type==="password")||ie==="textarea"||K.contentEditable==="true")}function bh(K){var ie=Hl(),_e=K.focusedElem,Pe=K.selectionRange;if(ie!==_e&&_e&&_e.ownerDocument&&kl(_e.ownerDocument.documentElement,_e)){if(Pe!==null&&qc(_e)){if(ie=Pe.start,K=Pe.end,K===void 0&&(K=ie),"selectionStart"in _e)_e.selectionStart=ie,_e.selectionEnd=Math.min(K,_e.value.length);else if(K=(ie=_e.ownerDocument||document)&&ie.defaultView||window,K.getSelection){K=K.getSelection();var we=_e.textContent.length,Me=Math.min(Pe.start,we);Pe=Pe.end===void 0?Me:Math.min(Pe.end,we),!K.extend&&Me>Pe&&(we=Pe,Pe=Me,Me=we),we=$l(_e,Me);var ze=$l(_e,Pe);we&&ze&&(K.rangeCount!==1||K.anchorNode!==we.node||K.anchorOffset!==we.offset||K.focusNode!==ze.node||K.focusOffset!==ze.offset)&&(ie=ie.createRange(),ie.setStart(we.node,we.offset),K.removeAllRanges(),Me>Pe?(K.addRange(ie),K.extend(ze.node,ze.offset)):(ie.setEnd(ze.node,ze.offset),K.addRange(ie)))}}for(ie=[],K=_e;K=K.parentNode;)K.nodeType===1&&ie.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof _e.focus=="function"&&_e.focus(),_e=0;_e=document.documentMode,Hs=null,Qc=null,Vi=null,Kc=!1;function zl(K,ie,_e){var Pe=_e.window===_e?_e.document:_e.nodeType===9?_e:_e.ownerDocument;Kc||Hs==null||Hs!==nr(Pe)||(Pe=Hs,"selectionStart"in Pe&&qc(Pe)?Pe={start:Pe.selectionStart,end:Pe.selectionEnd}:(Pe=(Pe.ownerDocument&&Pe.ownerDocument.defaultView||window).getSelection(),Pe={anchorNode:Pe.anchorNode,anchorOffset:Pe.anchorOffset,focusNode:Pe.focusNode,focusOffset:Pe.focusOffset}),Vi&&ji(Vi,Pe)||(Vi=Pe,Pe=za(Qc,"onSelect"),0Gs||(K.current=iu[Gs],iu[Gs]=null,Gs--)}function tr(K,ie){Gs++,iu[Gs]=K.current,K.current=ie}var vo={},wr=yo(vo),Vr=yo(!1),ns=vo;function qs(K,ie){var _e=K.type.contextTypes;if(!_e)return vo;var Pe=K.stateNode;if(Pe&&Pe.__reactInternalMemoizedUnmaskedChildContext===ie)return Pe.__reactInternalMemoizedMaskedChildContext;var we={},Me;for(Me in _e)we[Me]=ie[Me];return Pe&&(K=K.stateNode,K.__reactInternalMemoizedUnmaskedChildContext=ie,K.__reactInternalMemoizedMaskedChildContext=we),we}function Gr(K){return K=K.childContextTypes,K!=null}function Ga(){ir(Vr),ir(wr)}function rd(K,ie,_e){if(wr.current!==vo)throw Error(R(168));tr(wr,ie),tr(Vr,_e)}function nd(K,ie,_e){var Pe=K.stateNode;if(ie=ie.childContextTypes,typeof Pe.getChildContext!="function")return _e;Pe=Pe.getChildContext();for(var we in Pe)if(!(we in ie))throw Error(R(108,Ut(K)||"Unknown",we));return je({},_e,Pe)}function qa(K){return K=(K=K.stateNode)&&K.__reactInternalMemoizedMergedChildContext||vo,ns=wr.current,tr(wr,K),tr(Vr,Vr.current),!0}function od(K,ie,_e){var Pe=K.stateNode;if(!Pe)throw Error(R(169));_e?(K=nd(K,ie,ns),Pe.__reactInternalMemoizedMergedChildContext=K,ir(Vr),ir(wr),tr(wr,K)):ir(Vr),tr(Vr,_e)}var Zn=null,Qa=!1,au=!1;function sd(K){Zn===null?Zn=[K]:Zn.push(K)}function Vh(K){Qa=!0,sd(K)}function Co(){if(!au&&Zn!==null){au=!0;var K=0,ie=Kt;try{var _e=Zn;for(Kt=1;K<_e.length;K++){var Pe=_e[K];do Pe=Pe(!0);while(Pe!==null)}Zn=null,Qa=!1}catch(we){throw Zn!==null&&(Zn=Zn.slice(K+1)),Ls(Li,Co),we}finally{Kt=ie,au=!1}}return null}var Qs=[],Ks=0,Ka=null,Za=0,cn=[],un=0,os=null,Wn=1,Xn="";function ss(K,ie){Qs[Ks++]=Za,Qs[Ks++]=Ka,Ka=K,Za=ie}function id(K,ie,_e){cn[un++]=Wn,cn[un++]=Xn,cn[un++]=os,os=K;var Pe=Wn;K=Xn;var we=32-Fr(Pe)-1;Pe&=~(1<>=ze,we-=ze,Wn=1<<32-Fr(ie)+we|_e<Bt?(Pr=Ht,Ht=null):Pr=Ht.sibling;var Xt=Tt(ht,Ht,Et[Bt],Rt);if(Xt===null){Ht===null&&(Ht=Pr);break}K&&Ht&&Xt.alternate===null&&ie(ht,Ht),ct=Me(Xt,ct,Bt),kt===null?Ft=Xt:kt.sibling=Xt,kt=Xt,Ht=Pr}if(Bt===Et.length)return _e(ht,Ht),cr&&ss(ht,Bt),Ft;if(Ht===null){for(;BtBt?(Pr=Ht,Ht=null):Pr=Ht.sibling;var bo=Tt(ht,Ht,Xt.value,Rt);if(bo===null){Ht===null&&(Ht=Pr);break}K&&Ht&&bo.alternate===null&&ie(ht,Ht),ct=Me(bo,ct,Bt),kt===null?Ft=bo:kt.sibling=bo,kt=bo,Ht=Pr}if(Xt.done)return _e(ht,Ht),cr&&ss(ht,Bt),Ft;if(Ht===null){for(;!Xt.done;Bt++,Xt=Et.next())Xt=Ct(ht,Xt.value,Rt),Xt!==null&&(ct=Me(Xt,ct,Bt),kt===null?Ft=Xt:kt.sibling=Xt,kt=Xt);return cr&&ss(ht,Bt),Ft}for(Ht=Pe(ht,Ht);!Xt.done;Bt++,Xt=Et.next())Xt=Ot(Ht,ht,Bt,Xt.value,Rt),Xt!==null&&(K&&Xt.alternate!==null&&Ht.delete(Xt.key===null?Bt:Xt.key),ct=Me(Xt,ct,Bt),kt===null?Ft=Xt:kt.sibling=Xt,kt=Xt);return K&&Ht.forEach(function(Ap){return ie(ht,Ap)}),cr&&ss(ht,Bt),Ft}function mr(ht,ct,Et,Rt){if(typeof Et=="object"&&Et!==null&&Et.type===tt&&Et.key===null&&(Et=Et.props.children),typeof Et=="object"&&Et!==null){switch(Et.$$typeof){case We:e:{for(var Ft=Et.key,kt=ct;kt!==null;){if(kt.key===Ft){if(Ft=Et.type,Ft===tt){if(kt.tag===7){_e(ht,kt.sibling),ct=we(kt,Et.props.children),ct.return=ht,ht=ct;break e}}else if(kt.elementType===Ft||typeof Ft=="object"&&Ft!==null&&Ft.$$typeof===ke&&dd(Ft)===kt.type){_e(ht,kt.sibling),ct=we(kt,Et.props),ct.ref=Wi(ht,kt,Et),ct.return=ht,ht=ct;break e}_e(ht,kt);break}else ie(ht,kt);kt=kt.sibling}Et.type===tt?(ct=ps(Et.props.children,ht.mode,Rt,Et.key),ct.return=ht,ht=ct):(Rt=yc(Et.type,Et.key,Et.props,null,ht.mode,Rt),Rt.ref=Wi(ht,ct,Et),Rt.return=ht,ht=Rt)}return ze(ht);case at:e:{for(kt=Et.key;ct!==null;){if(ct.key===kt)if(ct.tag===4&&ct.stateNode.containerInfo===Et.containerInfo&&ct.stateNode.implementation===Et.implementation){_e(ht,ct.sibling),ct=we(ct,Et.children||[]),ct.return=ht,ht=ct;break e}else{_e(ht,ct);break}else ie(ht,ct);ct=ct.sibling}ct=sl(Et,ht.mode,Rt),ct.return=ht,ht=ct}return ze(ht);case ke:return kt=Et._init,mr(ht,ct,kt(Et._payload),Rt)}if(qt(Et))return xt(ht,ct,Et,Rt);if(Ge(Et))return Nt(ht,ct,Et,Rt);Xa(ht,Et)}return typeof Et=="string"&&Et!==""||typeof Et=="number"?(Et=""+Et,ct!==null&&ct.tag===6?(_e(ht,ct.sibling),ct=we(ct,Et),ct.return=ht,ht=ct):(_e(ht,ct),ct=ol(Et,ht.mode,Rt),ct.return=ht,ht=ct),ze(ht)):_e(ht,ct)}return mr}var Ws=fd(!0),hd=fd(!1),Ya=yo(null),Ja=null,Xs=null,hu=null;function pu(){hu=Xs=Ja=null}function Eu(K){var ie=Ya.current;ir(Ya),K._currentValue=ie}function mu(K,ie,_e){for(;K!==null;){var Pe=K.alternate;if((K.childLanes&ie)!==ie?(K.childLanes|=ie,Pe!==null&&(Pe.childLanes|=ie)):Pe!==null&&(Pe.childLanes&ie)!==ie&&(Pe.childLanes|=ie),K===_e)break;K=K.return}}function Ys(K,ie){Ja=K,hu=Xs=null,K=K.dependencies,K!==null&&K.firstContext!==null&&(K.lanes&ie&&(qr=!0),K.firstContext=null)}function ln(K){var ie=K._currentValue;if(hu!==K)if(K={context:K,memoizedValue:ie,next:null},Xs===null){if(Ja===null)throw Error(R(308));Xs=K,Ja.dependencies={lanes:0,firstContext:K}}else Xs=Xs.next=K;return ie}var as=null;function Su(K){as===null?as=[K]:as.push(K)}function pd(K,ie,_e,Pe){var we=ie.interleaved;return we===null?(_e.next=_e,Su(ie)):(_e.next=we.next,we.next=_e),ie.interleaved=_e,Yn(K,Pe)}function Yn(K,ie){K.lanes|=ie;var _e=K.alternate;for(_e!==null&&(_e.lanes|=ie),_e=K,K=K.return;K!==null;)K.childLanes|=ie,_e=K.alternate,_e!==null&&(_e.childLanes|=ie),_e=K,K=K.return;return _e.tag===3?_e.stateNode:null}var Ao=!1;function gu(K){K.updateQueue={baseState:K.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _d(K,ie){K=K.updateQueue,ie.updateQueue===K&&(ie.updateQueue={baseState:K.baseState,firstBaseUpdate:K.firstBaseUpdate,lastBaseUpdate:K.lastBaseUpdate,shared:K.shared,effects:K.effects})}function Jn(K,ie){return{eventTime:K,lane:ie,tag:0,payload:null,callback:null,next:null}}function Ro(K,ie,_e){var Pe=K.updateQueue;if(Pe===null)return null;if(Pe=Pe.shared,Zt&2){var we=Pe.pending;return we===null?ie.next=ie:(ie.next=we.next,we.next=ie),Pe.pending=ie,Yn(K,_e)}return we=Pe.interleaved,we===null?(ie.next=ie,Su(Pe)):(ie.next=we.next,we.next=ie),Pe.interleaved=ie,Yn(K,_e)}function ec(K,ie,_e){if(ie=ie.updateQueue,ie!==null&&(ie=ie.shared,(_e&4194240)!==0)){var Pe=ie.lanes;Pe&=K.pendingLanes,_e|=Pe,ie.lanes=_e,Fs(K,_e)}}function Ed(K,ie){var _e=K.updateQueue,Pe=K.alternate;if(Pe!==null&&(Pe=Pe.updateQueue,_e===Pe)){var we=null,Me=null;if(_e=_e.firstBaseUpdate,_e!==null){do{var ze={eventTime:_e.eventTime,lane:_e.lane,tag:_e.tag,payload:_e.payload,callback:_e.callback,next:null};Me===null?we=Me=ze:Me=Me.next=ze,_e=_e.next}while(_e!==null);Me===null?we=Me=ie:Me=Me.next=ie}else we=Me=ie;_e={baseState:Pe.baseState,firstBaseUpdate:we,lastBaseUpdate:Me,shared:Pe.shared,effects:Pe.effects},K.updateQueue=_e;return}K=_e.lastBaseUpdate,K===null?_e.firstBaseUpdate=ie:K.next=ie,_e.lastBaseUpdate=ie}function tc(K,ie,_e,Pe){var we=K.updateQueue;Ao=!1;var Me=we.firstBaseUpdate,ze=we.lastBaseUpdate,Je=we.shared.pending;if(Je!==null){we.shared.pending=null;var it=Je,St=it.next;it.next=null,ze===null?Me=St:ze.next=St,ze=it;var yt=K.alternate;yt!==null&&(yt=yt.updateQueue,Je=yt.lastBaseUpdate,Je!==ze&&(Je===null?yt.firstBaseUpdate=St:Je.next=St,yt.lastBaseUpdate=it))}if(Me!==null){var Ct=we.baseState;ze=0,yt=St=it=null,Je=Me;do{var Tt=Je.lane,Ot=Je.eventTime;if((Pe&Tt)===Tt){yt!==null&&(yt=yt.next={eventTime:Ot,lane:0,tag:Je.tag,payload:Je.payload,callback:Je.callback,next:null});e:{var xt=K,Nt=Je;switch(Tt=ie,Ot=_e,Nt.tag){case 1:if(xt=Nt.payload,typeof xt=="function"){Ct=xt.call(Ot,Ct,Tt);break e}Ct=xt;break e;case 3:xt.flags=xt.flags&-65537|128;case 0:if(xt=Nt.payload,Tt=typeof xt=="function"?xt.call(Ot,Ct,Tt):xt,Tt==null)break e;Ct=je({},Ct,Tt);break e;case 2:Ao=!0}}Je.callback!==null&&Je.lane!==0&&(K.flags|=64,Tt=we.effects,Tt===null?we.effects=[Je]:Tt.push(Je))}else Ot={eventTime:Ot,lane:Tt,tag:Je.tag,payload:Je.payload,callback:Je.callback,next:null},yt===null?(St=yt=Ot,it=Ct):yt=yt.next=Ot,ze|=Tt;if(Je=Je.next,Je===null){if(Je=we.shared.pending,Je===null)break;Tt=Je,Je=Tt.next,Tt.next=null,we.lastBaseUpdate=Tt,we.shared.pending=null}}while(!0);if(yt===null&&(it=Ct),we.baseState=it,we.firstBaseUpdate=St,we.lastBaseUpdate=yt,ie=we.shared.interleaved,ie!==null){we=ie;do ze|=we.lane,we=we.next;while(we!==ie)}else Me===null&&(we.shared.lanes=0);ls|=ze,K.lanes=ze,K.memoizedState=Ct}}function md(K,ie,_e){if(K=ie.effects,ie.effects=null,K!==null)for(ie=0;ie_e?_e:4,K(!0);var Pe=Au.transition;Au.transition={};try{K(!1),ie()}finally{Kt=_e,Au.transition=Pe}}function Fd(){return dn().memoizedState}function Kh(K,ie,_e){var Pe=xo(K);if(_e={lane:Pe,action:_e,hasEagerState:!1,eagerState:null,next:null},Dd(K))$d(ie,_e);else if(_e=pd(K,ie,_e,Pe),_e!==null){var we=kr();In(_e,K,Pe,we),kd(_e,ie,Pe)}}function Zh(K,ie,_e){var Pe=xo(K),we={lane:Pe,action:_e,hasEagerState:!1,eagerState:null,next:null};if(Dd(K))$d(ie,we);else{var Me=K.alternate;if(K.lanes===0&&(Me===null||Me.lanes===0)&&(Me=ie.lastRenderedReducer,Me!==null))try{var ze=ie.lastRenderedState,Je=Me(ze,_e);if(we.hasEagerState=!0,we.eagerState=Je,yn(Je,ze)){var it=ie.interleaved;it===null?(we.next=we,Su(ie)):(we.next=it.next,it.next=we),ie.interleaved=we;return}}catch{}finally{}_e=pd(K,ie,we,Pe),_e!==null&&(we=kr(),In(_e,K,Pe,we),kd(_e,ie,Pe))}}function Dd(K){var ie=K.alternate;return K===fr||ie!==null&&ie===fr}function $d(K,ie){ea=oc=!0;var _e=K.pending;_e===null?ie.next=ie:(ie.next=_e.next,_e.next=ie),K.pending=ie}function kd(K,ie,_e){if(_e&4194240){var Pe=ie.lanes;Pe&=K.pendingLanes,_e|=Pe,ie.lanes=_e,Fs(K,_e)}}var ac={readContext:ln,useCallback:br,useContext:br,useEffect:br,useImperativeHandle:br,useInsertionEffect:br,useLayoutEffect:br,useMemo:br,useReducer:br,useRef:br,useState:br,useDebugValue:br,useDeferredValue:br,useTransition:br,useMutableSource:br,useSyncExternalStore:br,useId:br,unstable_isNewReconciler:!1},Wh={readContext:ln,useCallback:function(K,ie){return Mn().memoizedState=[K,ie===void 0?null:ie],K},useContext:ln,useEffect:Pd,useImperativeHandle:function(K,ie,_e){return _e=_e!=null?_e.concat([K]):null,sc(4194308,4,wd.bind(null,ie,K),_e)},useLayoutEffect:function(K,ie){return sc(4194308,4,K,ie)},useInsertionEffect:function(K,ie){return sc(4,2,K,ie)},useMemo:function(K,ie){var _e=Mn();return ie=ie===void 0?null:ie,K=K(),_e.memoizedState=[K,ie],K},useReducer:function(K,ie,_e){var Pe=Mn();return ie=_e!==void 0?_e(ie):ie,Pe.memoizedState=Pe.baseState=ie,K={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:K,lastRenderedState:ie},Pe.queue=K,K=K.dispatch=Kh.bind(null,fr,K),[Pe.memoizedState,K]},useRef:function(K){var ie=Mn();return K={current:K},ie.memoizedState=K},useState:Id,useDebugValue:wu,useDeferredValue:function(K){return Mn().memoizedState=K},useTransition:function(){var K=Id(!1),ie=K[0];return K=Qh.bind(null,K[1]),Mn().memoizedState=K,[ie,K]},useMutableSource:function(){},useSyncExternalStore:function(K,ie,_e){var Pe=fr,we=Mn();if(cr){if(_e===void 0)throw Error(R(407));_e=_e()}else{if(_e=ie(),Or===null)throw Error(R(349));us&30||yd(Pe,ie,_e)}we.memoizedState=_e;var Me={value:_e,getSnapshot:ie};return we.queue=Me,Pd(Cd.bind(null,Pe,Me,K),[K]),Pe.flags|=2048,na(9,vd.bind(null,Pe,Me,_e,ie),void 0,null),_e},useId:function(){var K=Mn(),ie=Or.identifierPrefix;if(cr){var _e=Xn,Pe=Wn;_e=(Pe&~(1<<32-Fr(Pe)-1)).toString(32)+_e,ie=":"+ie+"R"+_e,_e=ta++,0<_e&&(ie+="H"+_e.toString(32)),ie+=":"}else _e=qh++,ie=":"+ie+"r"+_e.toString(32)+":";return K.memoizedState=ie},unstable_isNewReconciler:!1},Xh={readContext:ln,useCallback:Nd,useContext:ln,useEffect:Lu,useImperativeHandle:bd,useInsertionEffect:xd,useLayoutEffect:Ld,useMemo:Ud,useReducer:Pu,useRef:Od,useState:function(){return Pu(ra)},useDebugValue:wu,useDeferredValue:function(K){var ie=dn();return Md(ie,Cr.memoizedState,K)},useTransition:function(){var K=Pu(ra)[0],ie=dn().memoizedState;return[K,ie]},useMutableSource:gd,useSyncExternalStore:Td,useId:Fd,unstable_isNewReconciler:!1},Yh={readContext:ln,useCallback:Nd,useContext:ln,useEffect:Lu,useImperativeHandle:bd,useInsertionEffect:xd,useLayoutEffect:Ld,useMemo:Ud,useReducer:xu,useRef:Od,useState:function(){return xu(ra)},useDebugValue:wu,useDeferredValue:function(K){var ie=dn();return Cr===null?ie.memoizedState=K:Md(ie,Cr.memoizedState,K)},useTransition:function(){var K=xu(ra)[0],ie=dn().memoizedState;return[K,ie]},useMutableSource:gd,useSyncExternalStore:Td,useId:Fd,unstable_isNewReconciler:!1};function Cn(K,ie){if(K&&K.defaultProps){ie=je({},ie),K=K.defaultProps;for(var _e in K)ie[_e]===void 0&&(ie[_e]=K[_e]);return ie}return ie}function bu(K,ie,_e,Pe){ie=K.memoizedState,_e=_e(Pe,ie),_e=_e==null?ie:je({},ie,_e),K.memoizedState=_e,K.lanes===0&&(K.updateQueue.baseState=_e)}var cc={isMounted:function(K){return(K=K._reactInternals)?_n(K)===K:!1},enqueueSetState:function(K,ie,_e){K=K._reactInternals;var Pe=kr(),we=xo(K),Me=Jn(Pe,we);Me.payload=ie,_e!=null&&(Me.callback=_e),ie=Ro(K,Me,we),ie!==null&&(In(ie,K,we,Pe),ec(ie,K,we))},enqueueReplaceState:function(K,ie,_e){K=K._reactInternals;var Pe=kr(),we=xo(K),Me=Jn(Pe,we);Me.tag=1,Me.payload=ie,_e!=null&&(Me.callback=_e),ie=Ro(K,Me,we),ie!==null&&(In(ie,K,we,Pe),ec(ie,K,we))},enqueueForceUpdate:function(K,ie){K=K._reactInternals;var _e=kr(),Pe=xo(K),we=Jn(_e,Pe);we.tag=2,ie!=null&&(we.callback=ie),ie=Ro(K,we,Pe),ie!==null&&(In(ie,K,Pe,_e),ec(ie,K,Pe))}};function Hd(K,ie,_e,Pe,we,Me,ze){return K=K.stateNode,typeof K.shouldComponentUpdate=="function"?K.shouldComponentUpdate(Pe,Me,ze):ie.prototype&&ie.prototype.isPureReactComponent?!ji(_e,Pe)||!ji(we,Me):!0}function zd(K,ie,_e){var Pe=!1,we=vo,Me=ie.contextType;return typeof Me=="object"&&Me!==null?Me=ln(Me):(we=Gr(ie)?ns:wr.current,Pe=ie.contextTypes,Me=(Pe=Pe!=null)?qs(K,we):vo),ie=new ie(_e,Me),K.memoizedState=ie.state!==null&&ie.state!==void 0?ie.state:null,ie.updater=cc,K.stateNode=ie,ie._reactInternals=K,Pe&&(K=K.stateNode,K.__reactInternalMemoizedUnmaskedChildContext=we,K.__reactInternalMemoizedMaskedChildContext=Me),ie}function Bd(K,ie,_e,Pe){K=ie.state,typeof ie.componentWillReceiveProps=="function"&&ie.componentWillReceiveProps(_e,Pe),typeof ie.UNSAFE_componentWillReceiveProps=="function"&&ie.UNSAFE_componentWillReceiveProps(_e,Pe),ie.state!==K&&cc.enqueueReplaceState(ie,ie.state,null)}function Nu(K,ie,_e,Pe){var we=K.stateNode;we.props=_e,we.state=K.memoizedState,we.refs={},gu(K);var Me=ie.contextType;typeof Me=="object"&&Me!==null?we.context=ln(Me):(Me=Gr(ie)?ns:wr.current,we.context=qs(K,Me)),we.state=K.memoizedState,Me=ie.getDerivedStateFromProps,typeof Me=="function"&&(bu(K,ie,Me,_e),we.state=K.memoizedState),typeof ie.getDerivedStateFromProps=="function"||typeof we.getSnapshotBeforeUpdate=="function"||typeof we.UNSAFE_componentWillMount!="function"&&typeof we.componentWillMount!="function"||(ie=we.state,typeof we.componentWillMount=="function"&&we.componentWillMount(),typeof we.UNSAFE_componentWillMount=="function"&&we.UNSAFE_componentWillMount(),ie!==we.state&&cc.enqueueReplaceState(we,we.state,null),tc(K,_e,we,Pe),we.state=K.memoizedState),typeof we.componentDidMount=="function"&&(K.flags|=4194308)}function ei(K,ie){try{var _e="",Pe=ie;do _e+=vt(Pe),Pe=Pe.return;while(Pe);var we=_e}catch(Me){we=` Error generating stack: `+Me.message+` `+Me.stack}return{value:K,source:ie,stack:we,digest:null}}function Uu(K,ie,_e){return{value:K,source:null,stack:_e??null,digest:ie??null}}function Mu(K,ie){try{console.error(ie.value)}catch(_e){setTimeout(function(){throw _e})}}var Jh=typeof WeakMap=="function"?WeakMap:Map;function jd(K,ie,_e){_e=Jn(-1,_e),_e.tag=3,_e.payload={element:null};var Pe=ie.value;return _e.callback=function(){_c||(_c=!0,Wu=Pe),Mu(K,ie)},_e}function Vd(K,ie,_e){_e=Jn(-1,_e),_e.tag=3;var Pe=K.type.getDerivedStateFromError;if(typeof Pe=="function"){var we=ie.value;_e.payload=function(){return Pe(we)},_e.callback=function(){Mu(K,ie)}}var Me=K.stateNode;return Me!==null&&typeof Me.componentDidCatch=="function"&&(_e.callback=function(){Mu(K,ie),typeof Pe!="function"&&(Oo===null?Oo=new Set([this]):Oo.add(this));var ze=ie.stack;this.componentDidCatch(ie.value,{componentStack:ze!==null?ze:""})}),_e}function Gd(K,ie,_e){var Pe=K.pingCache;if(Pe===null){Pe=K.pingCache=new Jh;var we=new Set;Pe.set(ie,we)}else we=Pe.get(ie),we===void 0&&(we=new Set,Pe.set(ie,we));we.has(_e)||(we.add(_e),K=hp.bind(null,K,ie,_e),ie.then(K,K))}function qd(K){do{var ie;if((ie=K.tag===13)&&(ie=K.memoizedState,ie=ie!==null?ie.dehydrated!==null:!0),ie)return K;K=K.return}while(K!==null);return null}function Qd(K,ie,_e,Pe,we){return K.mode&1?(K.flags|=65536,K.lanes=we,K):(K===ie?K.flags|=65536:(K.flags|=128,_e.flags|=131072,_e.flags&=-52805,_e.tag===1&&(_e.alternate===null?_e.tag=17:(ie=Jn(-1,1),ie.tag=2,Ro(_e,ie,1))),_e.lanes|=1),K)}var ep=st.ReactCurrentOwner,qr=!1;function $r(K,ie,_e,Pe){ie.child=K===null?hd(ie,null,_e,Pe):Ws(ie,K.child,_e,Pe)}function Kd(K,ie,_e,Pe,we){_e=_e.render;var Me=ie.ref;return Ys(ie,we),Pe=Iu(K,ie,_e,Pe,Me,we),_e=Ou(),K!==null&&!qr?(ie.updateQueue=K.updateQueue,ie.flags&=-2053,K.lanes&=~we,eo(K,ie,we)):(cr&&_e&&cu(ie),ie.flags|=1,$r(K,ie,Pe,we),ie.child)}function Zd(K,ie,_e,Pe,we){if(K===null){var Me=_e.type;return typeof Me=="function"&&!nl(Me)&&Me.defaultProps===void 0&&_e.compare===null&&_e.defaultProps===void 0?(ie.tag=15,ie.type=Me,Wd(K,ie,Me,Pe,we)):(K=yc(_e.type,null,Pe,ie,ie.mode,we),K.ref=ie.ref,K.return=ie,ie.child=K)}if(Me=K.child,!(K.lanes&we)){var ze=Me.memoizedProps;if(_e=_e.compare,_e=_e!==null?_e:ji,_e(ze,Pe)&&K.ref===ie.ref)return eo(K,ie,we)}return ie.flags|=1,K=wo(Me,Pe),K.ref=ie.ref,K.return=ie,ie.child=K}function Wd(K,ie,_e,Pe,we){if(K!==null){var Me=K.memoizedProps;if(ji(Me,Pe)&&K.ref===ie.ref)if(qr=!1,ie.pendingProps=Pe=Me,(K.lanes&we)!==0)K.flags&131072&&(qr=!0);else return ie.lanes=K.lanes,eo(K,ie,we)}return Fu(K,ie,_e,Pe,we)}function Xd(K,ie,_e){var Pe=ie.pendingProps,we=Pe.children,Me=K!==null?K.memoizedState:null;if(Pe.mode==="hidden")if(!(ie.mode&1))ie.memoizedState={baseLanes:0,cachePool:null,transitions:null},tr(ri,rn),rn|=_e;else{if(!(_e&1073741824))return K=Me!==null?Me.baseLanes|_e:_e,ie.lanes=ie.childLanes=1073741824,ie.memoizedState={baseLanes:K,cachePool:null,transitions:null},ie.updateQueue=null,tr(ri,rn),rn|=K,null;ie.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe=Me!==null?Me.baseLanes:_e,tr(ri,rn),rn|=Pe}else Me!==null?(Pe=Me.baseLanes|_e,ie.memoizedState=null):Pe=_e,tr(ri,rn),rn|=Pe;return $r(K,ie,we,_e),ie.child}function Yd(K,ie){var _e=ie.ref;(K===null&&_e!==null||K!==null&&K.ref!==_e)&&(ie.flags|=512,ie.flags|=2097152)}function Fu(K,ie,_e,Pe,we){var Me=Gr(_e)?ns:wr.current;return Me=qs(ie,Me),Ys(ie,we),_e=Iu(K,ie,_e,Pe,Me,we),Pe=Ou(),K!==null&&!qr?(ie.updateQueue=K.updateQueue,ie.flags&=-2053,K.lanes&=~we,eo(K,ie,we)):(cr&&Pe&&cu(ie),ie.flags|=1,$r(K,ie,_e,we),ie.child)}function Jd(K,ie,_e,Pe,we){if(Gr(_e)){var Me=!0;qa(ie)}else Me=!1;if(Ys(ie,we),ie.stateNode===null)lc(K,ie),zd(ie,_e,Pe),Nu(ie,_e,Pe,we),Pe=!0;else if(K===null){var ze=ie.stateNode,Je=ie.memoizedProps;ze.props=Je;var it=ze.context,St=_e.contextType;typeof St=="object"&&St!==null?St=ln(St):(St=Gr(_e)?ns:wr.current,St=qs(ie,St));var yt=_e.getDerivedStateFromProps,Ct=typeof yt=="function"||typeof ze.getSnapshotBeforeUpdate=="function";Ct||typeof ze.UNSAFE_componentWillReceiveProps!="function"&&typeof ze.componentWillReceiveProps!="function"||(Je!==Pe||it!==St)&&Bd(ie,ze,Pe,St),Ao=!1;var Tt=ie.memoizedState;ze.state=Tt,tc(ie,Pe,ze,we),it=ie.memoizedState,Je!==Pe||Tt!==it||Vr.current||Ao?(typeof yt=="function"&&(bu(ie,_e,yt,Pe),it=ie.memoizedState),(Je=Ao||Hd(ie,_e,Je,Pe,Tt,it,St))?(Ct||typeof ze.UNSAFE_componentWillMount!="function"&&typeof ze.componentWillMount!="function"||(typeof ze.componentWillMount=="function"&&ze.componentWillMount(),typeof ze.UNSAFE_componentWillMount=="function"&&ze.UNSAFE_componentWillMount()),typeof ze.componentDidMount=="function"&&(ie.flags|=4194308)):(typeof ze.componentDidMount=="function"&&(ie.flags|=4194308),ie.memoizedProps=Pe,ie.memoizedState=it),ze.props=Pe,ze.state=it,ze.context=St,Pe=Je):(typeof ze.componentDidMount=="function"&&(ie.flags|=4194308),Pe=!1)}else{ze=ie.stateNode,_d(K,ie),Je=ie.memoizedProps,St=ie.type===ie.elementType?Je:Cn(ie.type,Je),ze.props=St,Ct=ie.pendingProps,Tt=ze.context,it=_e.contextType,typeof it=="object"&&it!==null?it=ln(it):(it=Gr(_e)?ns:wr.current,it=qs(ie,it));var Ot=_e.getDerivedStateFromProps;(yt=typeof Ot=="function"||typeof ze.getSnapshotBeforeUpdate=="function")||typeof ze.UNSAFE_componentWillReceiveProps!="function"&&typeof ze.componentWillReceiveProps!="function"||(Je!==Ct||Tt!==it)&&Bd(ie,ze,Pe,it),Ao=!1,Tt=ie.memoizedState,ze.state=Tt,tc(ie,Pe,ze,we);var xt=ie.memoizedState;Je!==Ct||Tt!==xt||Vr.current||Ao?(typeof Ot=="function"&&(bu(ie,_e,Ot,Pe),xt=ie.memoizedState),(St=Ao||Hd(ie,_e,St,Pe,Tt,xt,it)||!1)?(yt||typeof ze.UNSAFE_componentWillUpdate!="function"&&typeof ze.componentWillUpdate!="function"||(typeof ze.componentWillUpdate=="function"&&ze.componentWillUpdate(Pe,xt,it),typeof ze.UNSAFE_componentWillUpdate=="function"&&ze.UNSAFE_componentWillUpdate(Pe,xt,it)),typeof ze.componentDidUpdate=="function"&&(ie.flags|=4),typeof ze.getSnapshotBeforeUpdate=="function"&&(ie.flags|=1024)):(typeof ze.componentDidUpdate!="function"||Je===K.memoizedProps&&Tt===K.memoizedState||(ie.flags|=4),typeof ze.getSnapshotBeforeUpdate!="function"||Je===K.memoizedProps&&Tt===K.memoizedState||(ie.flags|=1024),ie.memoizedProps=Pe,ie.memoizedState=xt),ze.props=Pe,ze.state=xt,ze.context=it,Pe=St):(typeof ze.componentDidUpdate!="function"||Je===K.memoizedProps&&Tt===K.memoizedState||(ie.flags|=4),typeof ze.getSnapshotBeforeUpdate!="function"||Je===K.memoizedProps&&Tt===K.memoizedState||(ie.flags|=1024),Pe=!1)}return Du(K,ie,_e,Pe,Me,we)}function Du(K,ie,_e,Pe,we,Me){Yd(K,ie);var ze=(ie.flags&128)!==0;if(!Pe&&!ze)return we&&od(ie,_e,!1),eo(K,ie,Me);Pe=ie.stateNode,ep.current=ie;var Je=ze&&typeof _e.getDerivedStateFromError!="function"?null:Pe.render();return ie.flags|=1,K!==null&&ze?(ie.child=Ws(ie,K.child,null,Me),ie.child=Ws(ie,null,Je,Me)):$r(K,ie,Je,Me),ie.memoizedState=Pe.state,we&&od(ie,_e,!0),ie.child}function ef(K){var ie=K.stateNode;ie.pendingContext?rd(K,ie.pendingContext,ie.pendingContext!==ie.context):ie.context&&rd(K,ie.context,!1),Tu(K,ie.containerInfo)}function tf(K,ie,_e,Pe,we){return Zs(),fu(we),ie.flags|=256,$r(K,ie,_e,Pe),ie.child}var $u={dehydrated:null,treeContext:null,retryLane:0};function ku(K){return{baseLanes:K,cachePool:null,transitions:null}}function rf(K,ie,_e){var Pe=ie.pendingProps,we=dr.current,Me=!1,ze=(ie.flags&128)!==0,Je;if((Je=ze)||(Je=K!==null&&K.memoizedState===null?!1:(we&2)!==0),Je?(Me=!0,ie.flags&=-129):(K===null||K.memoizedState!==null)&&(we|=1),tr(dr,we&1),K===null)return du(ie),K=ie.memoizedState,K!==null&&(K=K.dehydrated,K!==null)?(ie.mode&1?K.data==="$!"?ie.lanes=8:ie.lanes=1073741824:ie.lanes=1,null):(ze=Pe.children,K=Pe.fallback,Me?(Pe=ie.mode,Me=ie.child,ze={mode:"hidden",children:ze},!(Pe&1)&&Me!==null?(Me.childLanes=0,Me.pendingProps=ze):Me=vc(ze,Pe,0,null),K=ps(K,Pe,_e,null),Me.return=ie,K.return=ie,Me.sibling=K,ie.child=Me,ie.child.memoizedState=ku(_e),ie.memoizedState=$u,K):Hu(ie,ze));if(we=K.memoizedState,we!==null&&(Je=we.dehydrated,Je!==null))return tp(K,ie,ze,Pe,Je,we,_e);if(Me){Me=Pe.fallback,ze=ie.mode,we=K.child,Je=we.sibling;var it={mode:"hidden",children:Pe.children};return!(ze&1)&&ie.child!==we?(Pe=ie.child,Pe.childLanes=0,Pe.pendingProps=it,ie.deletions=null):(Pe=wo(we,it),Pe.subtreeFlags=we.subtreeFlags&14680064),Je!==null?Me=wo(Je,Me):(Me=ps(Me,ze,_e,null),Me.flags|=2),Me.return=ie,Pe.return=ie,Pe.sibling=Me,ie.child=Pe,Pe=Me,Me=ie.child,ze=K.child.memoizedState,ze=ze===null?ku(_e):{baseLanes:ze.baseLanes|_e,cachePool:null,transitions:ze.transitions},Me.memoizedState=ze,Me.childLanes=K.childLanes&~_e,ie.memoizedState=$u,Pe}return Me=K.child,K=Me.sibling,Pe=wo(Me,{mode:"visible",children:Pe.children}),!(ie.mode&1)&&(Pe.lanes=_e),Pe.return=ie,Pe.sibling=null,K!==null&&(_e=ie.deletions,_e===null?(ie.deletions=[K],ie.flags|=16):_e.push(K)),ie.child=Pe,ie.memoizedState=null,Pe}function Hu(K,ie){return ie=vc({mode:"visible",children:ie},K.mode,0,null),ie.return=K,K.child=ie}function uc(K,ie,_e,Pe){return Pe!==null&&fu(Pe),Ws(ie,K.child,null,_e),K=Hu(ie,ie.pendingProps.children),K.flags|=2,ie.memoizedState=null,K}function tp(K,ie,_e,Pe,we,Me,ze){if(_e)return ie.flags&256?(ie.flags&=-257,Pe=Uu(Error(R(422))),uc(K,ie,ze,Pe)):ie.memoizedState!==null?(ie.child=K.child,ie.flags|=128,null):(Me=Pe.fallback,we=ie.mode,Pe=vc({mode:"visible",children:Pe.children},we,0,null),Me=ps(Me,we,ze,null),Me.flags|=2,Pe.return=ie,Me.return=ie,Pe.sibling=Me,ie.child=Pe,ie.mode&1&&Ws(ie,K.child,null,ze),ie.child.memoizedState=ku(ze),ie.memoizedState=$u,Me);if(!(ie.mode&1))return uc(K,ie,ze,null);if(we.data==="$!"){if(Pe=we.nextSibling&&we.nextSibling.dataset,Pe)var Je=Pe.dgst;return Pe=Je,Me=Error(R(419)),Pe=Uu(Me,Pe,void 0),uc(K,ie,ze,Pe)}if(Je=(ze&K.childLanes)!==0,qr||Je){if(Pe=Or,Pe!==null){switch(ze&-ze){case 4:we=2;break;case 16:we=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:we=32;break;case 536870912:we=268435456;break;default:we=0}we=we&(Pe.suspendedLanes|ze)?0:we,we!==0&&we!==Me.retryLane&&(Me.retryLane=we,Yn(K,we),In(Pe,K,we,-1))}return rl(),Pe=Uu(Error(R(421))),uc(K,ie,ze,Pe)}return we.data==="$?"?(ie.flags|=128,ie.child=K.child,ie=pp.bind(null,K),we._reactRetry=ie,null):(K=Me.treeContext,tn=To(we.nextSibling),en=ie,cr=!0,vn=null,K!==null&&(cn[un++]=Wn,cn[un++]=Xn,cn[un++]=os,Wn=K.id,Xn=K.overflow,os=ie),ie=Hu(ie,Pe.children),ie.flags|=4096,ie)}function nf(K,ie,_e){K.lanes|=ie;var Pe=K.alternate;Pe!==null&&(Pe.lanes|=ie),mu(K.return,ie,_e)}function zu(K,ie,_e,Pe,we){var Me=K.memoizedState;Me===null?K.memoizedState={isBackwards:ie,rendering:null,renderingStartTime:0,last:Pe,tail:_e,tailMode:we}:(Me.isBackwards=ie,Me.rendering=null,Me.renderingStartTime=0,Me.last=Pe,Me.tail=_e,Me.tailMode=we)}function of(K,ie,_e){var Pe=ie.pendingProps,we=Pe.revealOrder,Me=Pe.tail;if($r(K,ie,Pe.children,_e),Pe=dr.current,Pe&2)Pe=Pe&1|2,ie.flags|=128;else{if(K!==null&&K.flags&128)e:for(K=ie.child;K!==null;){if(K.tag===13)K.memoizedState!==null&&nf(K,_e,ie);else if(K.tag===19)nf(K,_e,ie);else if(K.child!==null){K.child.return=K,K=K.child;continue}if(K===ie)break e;for(;K.sibling===null;){if(K.return===null||K.return===ie)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}Pe&=1}if(tr(dr,Pe),!(ie.mode&1))ie.memoizedState=null;else switch(we){case"forwards":for(_e=ie.child,we=null;_e!==null;)K=_e.alternate,K!==null&&rc(K)===null&&(we=_e),_e=_e.sibling;_e=we,_e===null?(we=ie.child,ie.child=null):(we=_e.sibling,_e.sibling=null),zu(ie,!1,we,_e,Me);break;case"backwards":for(_e=null,we=ie.child,ie.child=null;we!==null;){if(K=we.alternate,K!==null&&rc(K)===null){ie.child=we;break}K=we.sibling,we.sibling=_e,_e=we,we=K}zu(ie,!0,_e,null,Me);break;case"together":zu(ie,!1,null,null,void 0);break;default:ie.memoizedState=null}return ie.child}function lc(K,ie){!(ie.mode&1)&&K!==null&&(K.alternate=null,ie.alternate=null,ie.flags|=2)}function eo(K,ie,_e){if(K!==null&&(ie.dependencies=K.dependencies),ls|=ie.lanes,!(_e&ie.childLanes))return null;if(K!==null&&ie.child!==K.child)throw Error(R(153));if(ie.child!==null){for(K=ie.child,_e=wo(K,K.pendingProps),ie.child=_e,_e.return=ie;K.sibling!==null;)K=K.sibling,_e=_e.sibling=wo(K,K.pendingProps),_e.return=ie;_e.sibling=null}return ie.child}function rp(K,ie,_e){switch(ie.tag){case 3:ef(ie),Zs();break;case 5:Sd(ie);break;case 1:Gr(ie.type)&&qa(ie);break;case 4:Tu(ie,ie.stateNode.containerInfo);break;case 10:var Pe=ie.type._context,we=ie.memoizedProps.value;tr(Ya,Pe._currentValue),Pe._currentValue=we;break;case 13:if(Pe=ie.memoizedState,Pe!==null)return Pe.dehydrated!==null?(tr(dr,dr.current&1),ie.flags|=128,null):_e&ie.child.childLanes?rf(K,ie,_e):(tr(dr,dr.current&1),K=eo(K,ie,_e),K!==null?K.sibling:null);tr(dr,dr.current&1);break;case 19:if(Pe=(_e&ie.childLanes)!==0,K.flags&128){if(Pe)return of(K,ie,_e);ie.flags|=128}if(we=ie.memoizedState,we!==null&&(we.rendering=null,we.tail=null,we.lastEffect=null),tr(dr,dr.current),Pe)break;return null;case 22:case 23:return ie.lanes=0,Xd(K,ie,_e)}return eo(K,ie,_e)}var sf,Bu,af,cf;sf=function(K,ie){for(var _e=ie.child;_e!==null;){if(_e.tag===5||_e.tag===6)K.appendChild(_e.stateNode);else if(_e.tag!==4&&_e.child!==null){_e.child.return=_e,_e=_e.child;continue}if(_e===ie)break;for(;_e.sibling===null;){if(_e.return===null||_e.return===ie)return;_e=_e.return}_e.sibling.return=_e.return,_e=_e.sibling}},Bu=function(){},af=function(K,ie,_e,Pe){var we=K.memoizedProps;if(we!==Pe){K=ie.stateNode,cs(Un.current);var Me=null;switch(_e){case"input":we=on(K,we),Pe=on(K,Pe),Me=[];break;case"select":we=je({},we,{value:void 0}),Pe=je({},Pe,{value:void 0}),Me=[];break;case"textarea":we=Tr(K,we),Pe=Tr(K,Pe),Me=[];break;default:typeof we.onClick!="function"&&typeof Pe.onClick=="function"&&(K.onclick=ja)}Qo(_e,Pe);var ze;_e=null;for(St in we)if(!Pe.hasOwnProperty(St)&&we.hasOwnProperty(St)&&we[St]!=null)if(St==="style"){var Je=we[St];for(ze in Je)Je.hasOwnProperty(ze)&&(_e||(_e={}),_e[ze]="")}else St!=="dangerouslySetInnerHTML"&&St!=="children"&&St!=="suppressContentEditableWarning"&&St!=="suppressHydrationWarning"&&St!=="autoFocus"&&(H.hasOwnProperty(St)?Me||(Me=[]):(Me=Me||[]).push(St,null));for(St in Pe){var it=Pe[St];if(Je=we!=null?we[St]:void 0,Pe.hasOwnProperty(St)&&it!==Je&&(it!=null||Je!=null))if(St==="style")if(Je){for(ze in Je)!Je.hasOwnProperty(ze)||it&&it.hasOwnProperty(ze)||(_e||(_e={}),_e[ze]="");for(ze in it)it.hasOwnProperty(ze)&&Je[ze]!==it[ze]&&(_e||(_e={}),_e[ze]=it[ze])}else _e||(Me||(Me=[]),Me.push(St,_e)),_e=it;else St==="dangerouslySetInnerHTML"?(it=it?it.__html:void 0,Je=Je?Je.__html:void 0,it!=null&&Je!==it&&(Me=Me||[]).push(St,it)):St==="children"?typeof it!="string"&&typeof it!="number"||(Me=Me||[]).push(St,""+it):St!=="suppressContentEditableWarning"&&St!=="suppressHydrationWarning"&&(H.hasOwnProperty(St)?(it!=null&&St==="onScroll"&&sr("scroll",K),Me||Je===it||(Me=[])):(Me=Me||[]).push(St,it))}_e&&(Me=Me||[]).push("style",_e);var St=Me;(ie.updateQueue=St)&&(ie.flags|=4)}},cf=function(K,ie,_e,Pe){_e!==Pe&&(ie.flags|=4)};function oa(K,ie){if(!cr)switch(K.tailMode){case"hidden":ie=K.tail;for(var _e=null;ie!==null;)ie.alternate!==null&&(_e=ie),ie=ie.sibling;_e===null?K.tail=null:_e.sibling=null;break;case"collapsed":_e=K.tail;for(var Pe=null;_e!==null;)_e.alternate!==null&&(Pe=_e),_e=_e.sibling;Pe===null?ie||K.tail===null?K.tail=null:K.tail.sibling=null:Pe.sibling=null}}function Nr(K){var ie=K.alternate!==null&&K.alternate.child===K.child,_e=0,Pe=0;if(ie)for(var we=K.child;we!==null;)_e|=we.lanes|we.childLanes,Pe|=we.subtreeFlags&14680064,Pe|=we.flags&14680064,we.return=K,we=we.sibling;else for(we=K.child;we!==null;)_e|=we.lanes|we.childLanes,Pe|=we.subtreeFlags,Pe|=we.flags,we.return=K,we=we.sibling;return K.subtreeFlags|=Pe,K.childLanes=_e,ie}function np(K,ie,_e){var Pe=ie.pendingProps;switch(uu(ie),ie.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nr(ie),null;case 1:return Gr(ie.type)&&Ga(),Nr(ie),null;case 3:return Pe=ie.stateNode,Js(),ir(Vr),ir(wr),Cu(),Pe.pendingContext&&(Pe.context=Pe.pendingContext,Pe.pendingContext=null),(K===null||K.child===null)&&(Wa(ie)?ie.flags|=4:K===null||K.memoizedState.isDehydrated&&!(ie.flags&256)||(ie.flags|=1024,vn!==null&&(Ju(vn),vn=null))),Bu(K,ie),Nr(ie),null;case 5:yu(ie);var we=cs(Ji.current);if(_e=ie.type,K!==null&&ie.stateNode!=null)af(K,ie,_e,Pe,we),K.ref!==ie.ref&&(ie.flags|=512,ie.flags|=2097152);else{if(!Pe){if(ie.stateNode===null)throw Error(R(166));return Nr(ie),null}if(K=cs(Un.current),Wa(ie)){Pe=ie.stateNode,_e=ie.type;var Me=ie.memoizedProps;switch(Pe[Nn]=ie,Pe[Ki]=Me,K=(ie.mode&1)!==0,_e){case"dialog":sr("cancel",Pe),sr("close",Pe);break;case"iframe":case"object":case"embed":sr("load",Pe);break;case"video":case"audio":for(we=0;we<\/script>",K=K.removeChild(K.firstChild)):typeof Pe.is=="string"?K=ze.createElement(_e,{is:Pe.is}):(K=ze.createElement(_e),_e==="select"&&(ze=K,Pe.multiple?ze.multiple=!0:Pe.size&&(ze.size=Pe.size))):K=ze.createElementNS(K,_e),K[Nn]=ie,K[Ki]=Pe,sf(K,ie,!1,!1),ie.stateNode=K;e:{switch(ze=yr(_e,Pe),_e){case"dialog":sr("cancel",K),sr("close",K),we=Pe;break;case"iframe":case"object":case"embed":sr("load",K),we=Pe;break;case"video":case"audio":for(we=0;weni&&(ie.flags|=128,Pe=!0,oa(Me,!1),ie.lanes=4194304)}else{if(!Pe)if(K=rc(ze),K!==null){if(ie.flags|=128,Pe=!0,_e=K.updateQueue,_e!==null&&(ie.updateQueue=_e,ie.flags|=4),oa(Me,!0),Me.tail===null&&Me.tailMode==="hidden"&&!ze.alternate&&!cr)return Nr(ie),null}else 2*ar()-Me.renderingStartTime>ni&&_e!==1073741824&&(ie.flags|=128,Pe=!0,oa(Me,!1),ie.lanes=4194304);Me.isBackwards?(ze.sibling=ie.child,ie.child=ze):(_e=Me.last,_e!==null?_e.sibling=ze:ie.child=ze,Me.last=ze)}return Me.tail!==null?(ie=Me.tail,Me.rendering=ie,Me.tail=ie.sibling,Me.renderingStartTime=ar(),ie.sibling=null,_e=dr.current,tr(dr,Pe?_e&1|2:_e&1),ie):(Nr(ie),null);case 22:case 23:return tl(),Pe=ie.memoizedState!==null,K!==null&&K.memoizedState!==null!==Pe&&(ie.flags|=8192),Pe&&ie.mode&1?rn&1073741824&&(Nr(ie),ie.subtreeFlags&6&&(ie.flags|=8192)):Nr(ie),null;case 24:return null;case 25:return null}throw Error(R(156,ie.tag))}function op(K,ie){switch(uu(ie),ie.tag){case 1:return Gr(ie.type)&&Ga(),K=ie.flags,K&65536?(ie.flags=K&-65537|128,ie):null;case 3:return Js(),ir(Vr),ir(wr),Cu(),K=ie.flags,K&65536&&!(K&128)?(ie.flags=K&-65537|128,ie):null;case 5:return yu(ie),null;case 13:if(ir(dr),K=ie.memoizedState,K!==null&&K.dehydrated!==null){if(ie.alternate===null)throw Error(R(340));Zs()}return K=ie.flags,K&65536?(ie.flags=K&-65537|128,ie):null;case 19:return ir(dr),null;case 4:return Js(),null;case 10:return Eu(ie.type._context),null;case 22:case 23:return tl(),null;case 24:return null;default:return null}}var dc=!1,Ur=!1,sp=typeof WeakSet=="function"?WeakSet:Set,Pt=null;function ti(K,ie){var _e=K.ref;if(_e!==null)if(typeof _e=="function")try{_e(null)}catch(Pe){_r(K,ie,Pe)}else _e.current=null}function ju(K,ie,_e){try{_e()}catch(Pe){_r(K,ie,Pe)}}var uf=!1;function ip(K,ie){if(eu=vr,K=Hl(),qc(K)){if("selectionStart"in K)var _e={start:K.selectionStart,end:K.selectionEnd};else e:{_e=(_e=K.ownerDocument)&&_e.defaultView||window;var Pe=_e.getSelection&&_e.getSelection();if(Pe&&Pe.rangeCount!==0){_e=Pe.anchorNode;var we=Pe.anchorOffset,Me=Pe.focusNode;Pe=Pe.focusOffset;try{_e.nodeType,Me.nodeType}catch{_e=null;break e}var ze=0,Je=-1,it=-1,St=0,yt=0,Ct=K,Tt=null;t:for(;;){for(var Ot;Ct!==_e||we!==0&&Ct.nodeType!==3||(Je=ze+we),Ct!==Me||Pe!==0&&Ct.nodeType!==3||(it=ze+Pe),Ct.nodeType===3&&(ze+=Ct.nodeValue.length),(Ot=Ct.firstChild)!==null;)Tt=Ct,Ct=Ot;for(;;){if(Ct===K)break t;if(Tt===_e&&++St===we&&(Je=ze),Tt===Me&&++yt===Pe&&(it=ze),(Ot=Ct.nextSibling)!==null)break;Ct=Tt,Tt=Ct.parentNode}Ct=Ot}_e=Je===-1||it===-1?null:{start:Je,end:it}}else _e=null}_e=_e||{start:0,end:0}}else _e=null;for(tu={focusedElem:K,selectionRange:_e},vr=!1,Pt=ie;Pt!==null;)if(ie=Pt,K=ie.child,(ie.subtreeFlags&1028)!==0&&K!==null)K.return=ie,Pt=K;else for(;Pt!==null;){ie=Pt;try{var xt=ie.alternate;if(ie.flags&1024)switch(ie.tag){case 0:case 11:case 15:break;case 1:if(xt!==null){var Nt=xt.memoizedProps,mr=xt.memoizedState,ht=ie.stateNode,ct=ht.getSnapshotBeforeUpdate(ie.elementType===ie.type?Nt:Cn(ie.type,Nt),mr);ht.__reactInternalSnapshotBeforeUpdate=ct}break;case 3:var Et=ie.stateNode.containerInfo;Et.nodeType===1?Et.textContent="":Et.nodeType===9&&Et.documentElement&&Et.removeChild(Et.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(Rt){_r(ie,ie.return,Rt)}if(K=ie.sibling,K!==null){K.return=ie.return,Pt=K;break}Pt=ie.return}return xt=uf,uf=!1,xt}function sa(K,ie,_e){var Pe=ie.updateQueue;if(Pe=Pe!==null?Pe.lastEffect:null,Pe!==null){var we=Pe=Pe.next;do{if((we.tag&K)===K){var Me=we.destroy;we.destroy=void 0,Me!==void 0&&ju(ie,_e,Me)}we=we.next}while(we!==Pe)}}function fc(K,ie){if(ie=ie.updateQueue,ie=ie!==null?ie.lastEffect:null,ie!==null){var _e=ie=ie.next;do{if((_e.tag&K)===K){var Pe=_e.create;_e.destroy=Pe()}_e=_e.next}while(_e!==ie)}}function Vu(K){var ie=K.ref;if(ie!==null){var _e=K.stateNode;switch(K.tag){case 5:K=_e;break;default:K=_e}typeof ie=="function"?ie(K):ie.current=K}}function lf(K){var ie=K.alternate;ie!==null&&(K.alternate=null,lf(ie)),K.child=null,K.deletions=null,K.sibling=null,K.tag===5&&(ie=K.stateNode,ie!==null&&(delete ie[Nn],delete ie[Ki],delete ie[su],delete ie[Bh],delete ie[jh])),K.stateNode=null,K.return=null,K.dependencies=null,K.memoizedProps=null,K.memoizedState=null,K.pendingProps=null,K.stateNode=null,K.updateQueue=null}function df(K){return K.tag===5||K.tag===3||K.tag===4}function ff(K){e:for(;;){for(;K.sibling===null;){if(K.return===null||df(K.return))return null;K=K.return}for(K.sibling.return=K.return,K=K.sibling;K.tag!==5&&K.tag!==6&&K.tag!==18;){if(K.flags&2||K.child===null||K.tag===4)continue e;K.child.return=K,K=K.child}if(!(K.flags&2))return K.stateNode}}function Gu(K,ie,_e){var Pe=K.tag;if(Pe===5||Pe===6)K=K.stateNode,ie?_e.nodeType===8?_e.parentNode.insertBefore(K,ie):_e.insertBefore(K,ie):(_e.nodeType===8?(ie=_e.parentNode,ie.insertBefore(K,_e)):(ie=_e,ie.appendChild(K)),_e=_e._reactRootContainer,_e!=null||ie.onclick!==null||(ie.onclick=ja));else if(Pe!==4&&(K=K.child,K!==null))for(Gu(K,ie,_e),K=K.sibling;K!==null;)Gu(K,ie,_e),K=K.sibling}function qu(K,ie,_e){var Pe=K.tag;if(Pe===5||Pe===6)K=K.stateNode,ie?_e.insertBefore(K,ie):_e.appendChild(K);else if(Pe!==4&&(K=K.child,K!==null))for(qu(K,ie,_e),K=K.sibling;K!==null;)qu(K,ie,_e),K=K.sibling}var xr=null,An=!1;function Io(K,ie,_e){for(_e=_e.child;_e!==null;)hf(K,ie,_e),_e=_e.sibling}function hf(K,ie,_e){if(Yr&&typeof Yr.onCommitFiberUnmount=="function")try{Yr.onCommitFiberUnmount(Yo,_e)}catch{}switch(_e.tag){case 5:Ur||ti(_e,ie);case 6:var Pe=xr,we=An;xr=null,Io(K,ie,_e),xr=Pe,An=we,xr!==null&&(An?(K=xr,_e=_e.stateNode,K.nodeType===8?K.parentNode.removeChild(_e):K.removeChild(_e)):xr.removeChild(_e.stateNode));break;case 18:xr!==null&&(An?(K=xr,_e=_e.stateNode,K.nodeType===8?ou(K.parentNode,_e):K.nodeType===1&&ou(K,_e),pr(K)):ou(xr,_e.stateNode));break;case 4:Pe=xr,we=An,xr=_e.stateNode.containerInfo,An=!0,Io(K,ie,_e),xr=Pe,An=we;break;case 0:case 11:case 14:case 15:if(!Ur&&(Pe=_e.updateQueue,Pe!==null&&(Pe=Pe.lastEffect,Pe!==null))){we=Pe=Pe.next;do{var Me=we,ze=Me.destroy;Me=Me.tag,ze!==void 0&&(Me&2||Me&4)&&ju(_e,ie,ze),we=we.next}while(we!==Pe)}Io(K,ie,_e);break;case 1:if(!Ur&&(ti(_e,ie),Pe=_e.stateNode,typeof Pe.componentWillUnmount=="function"))try{Pe.props=_e.memoizedProps,Pe.state=_e.memoizedState,Pe.componentWillUnmount()}catch(Je){_r(_e,ie,Je)}Io(K,ie,_e);break;case 21:Io(K,ie,_e);break;case 22:_e.mode&1?(Ur=(Pe=Ur)||_e.memoizedState!==null,Io(K,ie,_e),Ur=Pe):Io(K,ie,_e);break;default:Io(K,ie,_e)}}function pf(K){var ie=K.updateQueue;if(ie!==null){K.updateQueue=null;var _e=K.stateNode;_e===null&&(_e=K.stateNode=new sp),ie.forEach(function(Pe){var we=_p.bind(null,K,Pe);_e.has(Pe)||(_e.add(Pe),Pe.then(we,we))})}}function Rn(K,ie){var _e=ie.deletions;if(_e!==null)for(var Pe=0;Pe<_e.length;Pe++){var we=_e[Pe];try{var Me=K,ze=ie,Je=ze;e:for(;Je!==null;){switch(Je.tag){case 5:xr=Je.stateNode,An=!1;break e;case 3:xr=Je.stateNode.containerInfo,An=!0;break e;case 4:xr=Je.stateNode.containerInfo,An=!0;break e}Je=Je.return}if(xr===null)throw Error(R(160));hf(Me,ze,we),xr=null,An=!1;var it=we.alternate;it!==null&&(it.return=null),we.return=null}catch(St){_r(we,ie,St)}}if(ie.subtreeFlags&12854)for(ie=ie.child;ie!==null;)_f(ie,K),ie=ie.sibling}function _f(K,ie){var _e=K.alternate,Pe=K.flags;switch(K.tag){case 0:case 11:case 14:case 15:if(Rn(ie,K),Fn(K),Pe&4){try{sa(3,K,K.return),fc(3,K)}catch(Nt){_r(K,K.return,Nt)}try{sa(5,K,K.return)}catch(Nt){_r(K,K.return,Nt)}}break;case 1:Rn(ie,K),Fn(K),Pe&512&&_e!==null&&ti(_e,_e.return);break;case 5:if(Rn(ie,K),Fn(K),Pe&512&&_e!==null&&ti(_e,_e.return),K.flags&32){var we=K.stateNode;try{qo(we,"")}catch(Nt){_r(K,K.return,Nt)}}if(Pe&4&&(we=K.stateNode,we!=null)){var Me=K.memoizedProps,ze=_e!==null?_e.memoizedProps:Me,Je=K.type,it=K.updateQueue;if(K.updateQueue=null,it!==null)try{Je==="input"&&Me.type==="radio"&&Me.name!=null&&io(we,Me),yr(Je,ze);var St=yr(Je,Me);for(ze=0;zewe&&(we=ze),Pe&=~Me}if(Pe=we,Pe=ar()-Pe,Pe=(120>Pe?120:480>Pe?480:1080>Pe?1080:1920>Pe?1920:3e3>Pe?3e3:4320>Pe?4320:1960*cp(Pe/1960))-Pe,10K?16:K,Po===null)var Pe=!1;else{if(K=Po,Po=null,mc=0,Zt&6)throw Error(R(331));var we=Zt;for(Zt|=4,Pt=K.current;Pt!==null;){var Me=Pt,ze=Me.child;if(Pt.flags&16){var Je=Me.deletions;if(Je!==null){for(var it=0;itar()-Zu?fs(K,0):Ku|=_e),Kr(K,ie)}function Of(K,ie){ie===0&&(K.mode&1?(ie=En,En<<=1,!(En&130023424)&&(En=4194304)):ie=1);var _e=kr();K=Yn(K,ie),K!==null&&(an(K,ie,_e),Kr(K,_e))}function pp(K){var ie=K.memoizedState,_e=0;ie!==null&&(_e=ie.retryLane),Of(K,_e)}function _p(K,ie){var _e=0;switch(K.tag){case 13:var Pe=K.stateNode,we=K.memoizedState;we!==null&&(_e=we.retryLane);break;case 19:Pe=K.stateNode;break;default:throw Error(R(314))}Pe!==null&&Pe.delete(ie),Of(K,_e)}var Pf;Pf=function(K,ie,_e){if(K!==null)if(K.memoizedProps!==ie.pendingProps||Vr.current)qr=!0;else{if(!(K.lanes&_e)&&!(ie.flags&128))return qr=!1,rp(K,ie,_e);qr=!!(K.flags&131072)}else qr=!1,cr&&ie.flags&1048576&&id(ie,Za,ie.index);switch(ie.lanes=0,ie.tag){case 2:var Pe=ie.type;lc(K,ie),K=ie.pendingProps;var we=qs(ie,wr.current);Ys(ie,_e),we=Iu(null,ie,Pe,K,we,_e);var Me=Ou();return ie.flags|=1,typeof we=="object"&&we!==null&&typeof we.render=="function"&&we.$$typeof===void 0?(ie.tag=1,ie.memoizedState=null,ie.updateQueue=null,Gr(Pe)?(Me=!0,qa(ie)):Me=!1,ie.memoizedState=we.state!==null&&we.state!==void 0?we.state:null,gu(ie),we.updater=cc,ie.stateNode=we,we._reactInternals=ie,Nu(ie,Pe,K,_e),ie=Du(null,ie,Pe,!0,Me,_e)):(ie.tag=0,cr&&Me&&cu(ie),$r(null,ie,we,_e),ie=ie.child),ie;case 16:Pe=ie.elementType;e:{switch(lc(K,ie),K=ie.pendingProps,we=Pe._init,Pe=we(Pe._payload),ie.type=Pe,we=ie.tag=mp(Pe),K=Cn(Pe,K),we){case 0:ie=Fu(null,ie,Pe,K,_e);break e;case 1:ie=Jd(null,ie,Pe,K,_e);break e;case 11:ie=Kd(null,ie,Pe,K,_e);break e;case 14:ie=Zd(null,ie,Pe,Cn(Pe.type,K),_e);break e}throw Error(R(306,Pe,""))}return ie;case 0:return Pe=ie.type,we=ie.pendingProps,we=ie.elementType===Pe?we:Cn(Pe,we),Fu(K,ie,Pe,we,_e);case 1:return Pe=ie.type,we=ie.pendingProps,we=ie.elementType===Pe?we:Cn(Pe,we),Jd(K,ie,Pe,we,_e);case 3:e:{if(ef(ie),K===null)throw Error(R(387));Pe=ie.pendingProps,Me=ie.memoizedState,we=Me.element,_d(K,ie),tc(ie,Pe,null,_e);var ze=ie.memoizedState;if(Pe=ze.element,Me.isDehydrated)if(Me={element:Pe,isDehydrated:!1,cache:ze.cache,pendingSuspenseBoundaries:ze.pendingSuspenseBoundaries,transitions:ze.transitions},ie.updateQueue.baseState=Me,ie.memoizedState=Me,ie.flags&256){we=ei(Error(R(423)),ie),ie=tf(K,ie,Pe,_e,we);break e}else if(Pe!==we){we=ei(Error(R(424)),ie),ie=tf(K,ie,Pe,_e,we);break e}else for(tn=To(ie.stateNode.containerInfo.firstChild),en=ie,cr=!0,vn=null,_e=hd(ie,null,Pe,_e),ie.child=_e;_e;)_e.flags=_e.flags&-3|4096,_e=_e.sibling;else{if(Zs(),Pe===we){ie=eo(K,ie,_e);break e}$r(K,ie,Pe,_e)}ie=ie.child}return ie;case 5:return Sd(ie),K===null&&du(ie),Pe=ie.type,we=ie.pendingProps,Me=K!==null?K.memoizedProps:null,ze=we.children,ru(Pe,we)?ze=null:Me!==null&&ru(Pe,Me)&&(ie.flags|=32),Yd(K,ie),$r(K,ie,ze,_e),ie.child;case 6:return K===null&&du(ie),null;case 13:return rf(K,ie,_e);case 4:return Tu(ie,ie.stateNode.containerInfo),Pe=ie.pendingProps,K===null?ie.child=Ws(ie,null,Pe,_e):$r(K,ie,Pe,_e),ie.child;case 11:return Pe=ie.type,we=ie.pendingProps,we=ie.elementType===Pe?we:Cn(Pe,we),Kd(K,ie,Pe,we,_e);case 7:return $r(K,ie,ie.pendingProps,_e),ie.child;case 8:return $r(K,ie,ie.pendingProps.children,_e),ie.child;case 12:return $r(K,ie,ie.pendingProps.children,_e),ie.child;case 10:e:{if(Pe=ie.type._context,we=ie.pendingProps,Me=ie.memoizedProps,ze=we.value,tr(Ya,Pe._currentValue),Pe._currentValue=ze,Me!==null)if(yn(Me.value,ze)){if(Me.children===we.children&&!Vr.current){ie=eo(K,ie,_e);break e}}else for(Me=ie.child,Me!==null&&(Me.return=ie);Me!==null;){var Je=Me.dependencies;if(Je!==null){ze=Me.child;for(var it=Je.firstContext;it!==null;){if(it.context===Pe){if(Me.tag===1){it=Jn(-1,_e&-_e),it.tag=2;var St=Me.updateQueue;if(St!==null){St=St.shared;var yt=St.pending;yt===null?it.next=it:(it.next=yt.next,yt.next=it),St.pending=it}}Me.lanes|=_e,it=Me.alternate,it!==null&&(it.lanes|=_e),mu(Me.return,_e,ie),Je.lanes|=_e;break}it=it.next}}else if(Me.tag===10)ze=Me.type===ie.type?null:Me.child;else if(Me.tag===18){if(ze=Me.return,ze===null)throw Error(R(341));ze.lanes|=_e,Je=ze.alternate,Je!==null&&(Je.lanes|=_e),mu(ze,_e,ie),ze=Me.sibling}else ze=Me.child;if(ze!==null)ze.return=Me;else for(ze=Me;ze!==null;){if(ze===ie){ze=null;break}if(Me=ze.sibling,Me!==null){Me.return=ze.return,ze=Me;break}ze=ze.return}Me=ze}$r(K,ie,we.children,_e),ie=ie.child}return ie;case 9:return we=ie.type,Pe=ie.pendingProps.children,Ys(ie,_e),we=ln(we),Pe=Pe(we),ie.flags|=1,$r(K,ie,Pe,_e),ie.child;case 14:return Pe=ie.type,we=Cn(Pe,ie.pendingProps),we=Cn(Pe.type,we),Zd(K,ie,Pe,we,_e);case 15:return Wd(K,ie,ie.type,ie.pendingProps,_e);case 17:return Pe=ie.type,we=ie.pendingProps,we=ie.elementType===Pe?we:Cn(Pe,we),lc(K,ie),ie.tag=1,Gr(Pe)?(K=!0,qa(ie)):K=!1,Ys(ie,_e),zd(ie,Pe,we),Nu(ie,Pe,we,_e),Du(null,ie,Pe,!0,K,_e);case 19:return of(K,ie,_e);case 22:return Xd(K,ie,_e)}throw Error(R(156,ie.tag))};function xf(K,ie){return Ls(K,ie)}function Ep(K,ie,_e,Pe){this.tag=K,this.key=_e,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=ie,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=Pe,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(K,ie,_e,Pe){return new Ep(K,ie,_e,Pe)}function nl(K){return K=K.prototype,!(!K||!K.isReactComponent)}function mp(K){if(typeof K=="function")return nl(K)?1:0;if(K!=null){if(K=K.$$typeof,K===pt)return 11;if(K===Qe)return 14}return 2}function wo(K,ie){var _e=K.alternate;return _e===null?(_e=hn(K.tag,ie,K.key,K.mode),_e.elementType=K.elementType,_e.type=K.type,_e.stateNode=K.stateNode,_e.alternate=K,K.alternate=_e):(_e.pendingProps=ie,_e.type=K.type,_e.flags=0,_e.subtreeFlags=0,_e.deletions=null),_e.flags=K.flags&14680064,_e.childLanes=K.childLanes,_e.lanes=K.lanes,_e.child=K.child,_e.memoizedProps=K.memoizedProps,_e.memoizedState=K.memoizedState,_e.updateQueue=K.updateQueue,ie=K.dependencies,_e.dependencies=ie===null?null:{lanes:ie.lanes,firstContext:ie.firstContext},_e.sibling=K.sibling,_e.index=K.index,_e.ref=K.ref,_e}function yc(K,ie,_e,Pe,we,Me){var ze=2;if(Pe=K,typeof K=="function")nl(K)&&(ze=1);else if(typeof K=="string")ze=5;else e:switch(K){case tt:return ps(_e.children,we,Me,ie);case ft:ze=8,we|=8;break;case Ye:return K=hn(12,_e,ie,we|2),K.elementType=Ye,K.lanes=Me,K;case dt:return K=hn(13,_e,ie,we),K.elementType=dt,K.lanes=Me,K;case rt:return K=hn(19,_e,ie,we),K.elementType=rt,K.lanes=Me,K;case Xe:return vc(_e,we,Me,ie);default:if(typeof K=="object"&&K!==null)switch(K.$$typeof){case ot:ze=10;break e;case nt:ze=9;break e;case pt:ze=11;break e;case Qe:ze=14;break e;case ke:ze=16,Pe=null;break e}throw Error(R(130,K==null?K:typeof K,""))}return ie=hn(ze,_e,ie,we),ie.elementType=K,ie.type=Pe,ie.lanes=Me,ie}function ps(K,ie,_e,Pe){return K=hn(7,K,Pe,ie),K.lanes=_e,K}function vc(K,ie,_e,Pe){return K=hn(22,K,Pe,ie),K.elementType=Xe,K.lanes=_e,K.stateNode={isHidden:!1},K}function ol(K,ie,_e){return K=hn(6,K,null,ie),K.lanes=_e,K}function sl(K,ie,_e){return ie=hn(4,K.children!==null?K.children:[],K.key,ie),ie.lanes=_e,ie.stateNode={containerInfo:K.containerInfo,pendingChildren:null,implementation:K.implementation},ie}function Sp(K,ie,_e,Pe,we){this.tag=ie,this.containerInfo=K,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hr(0),this.expirationTimes=hr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hr(0),this.identifierPrefix=Pe,this.onRecoverableError=we,this.mutableSourceEagerHydrationData=null}function il(K,ie,_e,Pe,we,Me,ze,Je,it){return K=new Sp(K,ie,_e,Je,it),ie===1?(ie=1,Me===!0&&(ie|=8)):ie=0,Me=hn(3,null,null,ie),K.current=Me,Me.stateNode=K,Me.memoizedState={element:Pe,isDehydrated:_e,cache:null,transitions:null,pendingSuspenseBoundaries:null},gu(Me),K}function gp(K,ie,_e){var Pe=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(E)}catch(y){console.error(y)}}return E(),reactDom.exports=requireReactDom_production_min(),reactDom.exports}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1;var E=requireReactDom();return client.createRoot=E.createRoot,client.hydrateRoot=E.hydrateRoot,client}var clientExports=requireClient();const{NODE_ENV,BACKEND_URL,FE_INSTANCE_SOURCE_DIR,SENTRY_DSN}={NODE_ENV:"production",BACKEND_URL:"",FE_INSTANCE_SOURCE_DIR:"instance",SENTRY_DSN:void 0};var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(E){return this.listeners.add(E),this.onSubscribe(),()=>{this.listeners.delete(E),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$3(){}function functionalUpdate(E,y){return typeof E=="function"?E(y):E}function isValidTimeout(E){return typeof E=="number"&&E>=0&&E!==1/0}function timeUntilStale(E,y){return Math.max(E+(y||0)-Date.now(),0)}function resolveStaleTime(E,y){return typeof E=="function"?E(y):E}function resolveEnabled(E,y){return typeof E=="function"?E(y):E}function matchQuery(E,y){const{type:R="all",exact:k,fetchStatus:H,predicate:B,queryKey:te,stale:ae}=E;if(te){if(k){if(y.queryHash!==hashQueryKeyByOptions(te,y.options))return!1}else if(!partialMatchKey(y.queryKey,te))return!1}if(R!=="all"){const ce=y.isActive();if(R==="active"&&!ce||R==="inactive"&&ce)return!1}return!(typeof ae=="boolean"&&y.isStale()!==ae||H&&H!==y.state.fetchStatus||B&&!B(y))}function matchMutation(E,y){const{exact:R,status:k,predicate:H,mutationKey:B}=E;if(B){if(!y.options.mutationKey)return!1;if(R){if(hashKey(y.options.mutationKey)!==hashKey(B))return!1}else if(!partialMatchKey(y.options.mutationKey,B))return!1}return!(k&&y.state.status!==k||H&&!H(y))}function hashQueryKeyByOptions(E,y){return((y==null?void 0:y.queryKeyHashFn)||hashKey)(E)}function hashKey(E){return JSON.stringify(E,(y,R)=>isPlainObject$2(R)?Object.keys(R).sort().reduce((k,H)=>(k[H]=R[H],k),{}):R)}function partialMatchKey(E,y){return E===y?!0:typeof E!=typeof y?!1:E&&y&&typeof E=="object"&&typeof y=="object"?!Object.keys(y).some(R=>!partialMatchKey(E[R],y[R])):!1}function replaceEqualDeep(E,y){if(E===y)return E;const R=isPlainArray(E)&&isPlainArray(y);if(R||isPlainObject$2(E)&&isPlainObject$2(y)){const k=R?E:Object.keys(E),H=k.length,B=R?y:Object.keys(y),te=B.length,ae=R?[]:{};let ce=0;for(let Ce=0;Ce{setTimeout(y,E)})}function replaceData(E,y,R){return typeof R.structuralSharing=="function"?R.structuralSharing(E,y):R.structuralSharing!==!1?replaceEqualDeep(E,y):y}function keepPreviousData(E){return E}function addToEnd(E,y,R=0){const k=[...E,y];return R&&k.length>R?k.slice(1):k}function addToStart(E,y,R=0){const k=[y,...E];return R&&k.length>R?k.slice(0,-1):k}var skipToken=Symbol();function ensureQueryFn(E,y){return!E.queryFn&&(y!=null&&y.initialPromise)?()=>y.initialPromise:!E.queryFn||E.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${E.queryHash}'`)):E.queryFn}var _s,Mo,si,Ff,FocusManager=(Ff=class extends Subscribable{constructor(){super();wt(this,_s);wt(this,Mo);wt(this,si);It(this,si,y=>{if(!isServer&&window.addEventListener){const R=()=>y();return window.addEventListener("visibilitychange",R,!1),()=>{window.removeEventListener("visibilitychange",R)}}})}onSubscribe(){et(this,Mo)||this.setEventListener(et(this,si))}onUnsubscribe(){var y;this.hasListeners()||((y=et(this,Mo))==null||y.call(this),It(this,Mo,void 0))}setEventListener(y){var R;It(this,si,y),(R=et(this,Mo))==null||R.call(this),It(this,Mo,y(k=>{typeof k=="boolean"?this.setFocused(k):this.onFocus()}))}setFocused(y){et(this,_s)!==y&&(It(this,_s,y),this.onFocus())}onFocus(){const y=this.isFocused();this.listeners.forEach(R=>{R(y)})}isFocused(){var y;return typeof et(this,_s)=="boolean"?et(this,_s):((y=globalThis.document)==null?void 0:y.visibilityState)!=="hidden"}},_s=new WeakMap,Mo=new WeakMap,si=new WeakMap,Ff),focusManager=new FocusManager,ii,Fo,ai,Df,OnlineManager=(Df=class extends Subscribable{constructor(){super();wt(this,ii,!0);wt(this,Fo);wt(this,ai);It(this,ai,y=>{if(!isServer&&window.addEventListener){const R=()=>y(!0),k=()=>y(!1);return window.addEventListener("online",R,!1),window.addEventListener("offline",k,!1),()=>{window.removeEventListener("online",R),window.removeEventListener("offline",k)}}})}onSubscribe(){et(this,Fo)||this.setEventListener(et(this,ai))}onUnsubscribe(){var y;this.hasListeners()||((y=et(this,Fo))==null||y.call(this),It(this,Fo,void 0))}setEventListener(y){var R;It(this,ai,y),(R=et(this,Fo))==null||R.call(this),It(this,Fo,y(this.setOnline.bind(this)))}setOnline(y){et(this,ii)!==y&&(It(this,ii,y),this.listeners.forEach(k=>{k(y)}))}isOnline(){return et(this,ii)}},ii=new WeakMap,Fo=new WeakMap,ai=new WeakMap,Df),onlineManager=new OnlineManager;function pendingThenable(){let E,y;const R=new Promise((H,B)=>{E=H,y=B});R.status="pending",R.catch(()=>{});function k(H){Object.assign(R,H),delete R.resolve,delete R.reject}return R.resolve=H=>{k({status:"fulfilled",value:H}),E(H)},R.reject=H=>{k({status:"rejected",reason:H}),y(H)},R}function defaultRetryDelay(E){return Math.min(1e3*2**E,3e4)}function canFetch(E){return(E??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(E){super("CancelledError"),this.revert=E==null?void 0:E.revert,this.silent=E==null?void 0:E.silent}};function isCancelledError(E){return E instanceof CancelledError}function createRetryer(E){let y=!1,R=0,k=!1,H;const B=pendingThenable(),te=De=>{var $e;k||(Ne(new CancelledError(De)),($e=E.abort)==null||$e.call(E))},ae=()=>{y=!0},ce=()=>{y=!1},Ce=()=>focusManager.isFocused()&&(E.networkMode==="always"||onlineManager.isOnline())&&E.canRun(),Oe=()=>canFetch(E.networkMode)&&E.canRun(),Le=De=>{var $e;k||(k=!0,($e=E.onSuccess)==null||$e.call(E,De),H==null||H(),B.resolve(De))},Ne=De=>{var $e;k||(k=!0,($e=E.onError)==null||$e.call(E,De),H==null||H(),B.reject(De))},Fe=()=>new Promise(De=>{var $e;H=Be=>{(k||Ce())&&De(Be)},($e=E.onPause)==null||$e.call(E)}).then(()=>{var De;H=void 0,k||(De=E.onContinue)==null||De.call(E)}),Ue=()=>{if(k)return;let De;const $e=R===0?E.initialPromise:void 0;try{De=$e??E.fn()}catch(Be){De=Promise.reject(Be)}Promise.resolve(De).then(Le).catch(Be=>{var at;if(k)return;const Ve=E.retry??(isServer?0:3),Ke=E.retryDelay??defaultRetryDelay,st=typeof Ke=="function"?Ke(R,Be):Ke,We=Ve===!0||typeof Ve=="number"&&RCe()?void 0:Fe()).then(()=>{y?Ne(Be):Ue()})})};return{promise:B,cancel:te,continue:()=>(H==null||H(),B),cancelRetry:ae,continueRetry:ce,canStart:Oe,start:()=>(Oe()?Ue():Fe().then(Ue),B)}}function createNotifyManager(){let E=[],y=0,R=ae=>{ae()},k=ae=>{ae()},H=ae=>setTimeout(ae,0);const B=ae=>{y?E.push(ae):H(()=>{R(ae)})},te=()=>{const ae=E;E=[],ae.length&&H(()=>{k(()=>{ae.forEach(ce=>{R(ce)})})})};return{batch:ae=>{let ce;y++;try{ce=ae()}finally{y--,y||te()}return ce},batchCalls:ae=>(...ce)=>{B(()=>{ae(...ce)})},schedule:B,setNotifyFunction:ae=>{R=ae},setBatchNotifyFunction:ae=>{k=ae},setScheduler:ae=>{H=ae}}}var notifyManager=createNotifyManager(),Es,$f,Removable=($f=class{constructor(){wt(this,Es)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&It(this,Es,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(E){this.gcTime=Math.max(this.gcTime||0,E??(isServer?1/0:5*60*1e3))}clearGcTimeout(){et(this,Es)&&(clearTimeout(et(this,Es)),It(this,Es,void 0))}},Es=new WeakMap,$f),ci,ui,pn,Mr,fa,ms,On,ro,kf,Query=(kf=class extends Removable{constructor(y){super();wt(this,On);wt(this,ci);wt(this,ui);wt(this,pn);wt(this,Mr);wt(this,fa);wt(this,ms);It(this,ms,!1),It(this,fa,y.defaultOptions),this.setOptions(y.options),this.observers=[],It(this,pn,y.cache),this.queryKey=y.queryKey,this.queryHash=y.queryHash,It(this,ci,getDefaultState$1(this.options)),this.state=y.state??et(this,ci),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var y;return(y=et(this,Mr))==null?void 0:y.promise}setOptions(y){this.options={...et(this,fa),...y},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&et(this,pn).remove(this)}setData(y,R){const k=replaceData(this.state.data,y,this.options);return jt(this,On,ro).call(this,{data:k,type:"success",dataUpdatedAt:R==null?void 0:R.updatedAt,manual:R==null?void 0:R.manual}),k}setState(y,R){jt(this,On,ro).call(this,{type:"setState",state:y,setStateOptions:R})}cancel(y){var k,H;const R=(k=et(this,Mr))==null?void 0:k.promise;return(H=et(this,Mr))==null||H.cancel(y),R?R.then(noop$3).catch(noop$3):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(et(this,ci))}isActive(){return this.observers.some(y=>resolveEnabled(y.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(y=>y.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(y=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,y)}onFocus(){var R;const y=this.observers.find(k=>k.shouldFetchOnWindowFocus());y==null||y.refetch({cancelRefetch:!1}),(R=et(this,Mr))==null||R.continue()}onOnline(){var R;const y=this.observers.find(k=>k.shouldFetchOnReconnect());y==null||y.refetch({cancelRefetch:!1}),(R=et(this,Mr))==null||R.continue()}addObserver(y){this.observers.includes(y)||(this.observers.push(y),this.clearGcTimeout(),et(this,pn).notify({type:"observerAdded",query:this,observer:y}))}removeObserver(y){this.observers.includes(y)&&(this.observers=this.observers.filter(R=>R!==y),this.observers.length||(et(this,Mr)&&(et(this,ms)?et(this,Mr).cancel({revert:!0}):et(this,Mr).cancelRetry()),this.scheduleGc()),et(this,pn).notify({type:"observerRemoved",query:this,observer:y}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||jt(this,On,ro).call(this,{type:"invalidate"})}fetch(y,R){var ce,Ce,Oe;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(R!=null&&R.cancelRefetch))this.cancel({silent:!0});else if(et(this,Mr))return et(this,Mr).continueRetry(),et(this,Mr).promise}if(y&&this.setOptions(y),!this.options.queryFn){const Le=this.observers.find(Ne=>Ne.options.queryFn);Le&&this.setOptions(Le.options)}const k=new AbortController,H=Le=>{Object.defineProperty(Le,"signal",{enumerable:!0,get:()=>(It(this,ms,!0),k.signal)})},B=()=>{const Le=ensureQueryFn(this.options,R),Ne={queryKey:this.queryKey,meta:this.meta};return H(Ne),It(this,ms,!1),this.options.persister?this.options.persister(Le,Ne,this):Le(Ne)},te={fetchOptions:R,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:B};H(te),(ce=this.options.behavior)==null||ce.onFetch(te,this),It(this,ui,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((Ce=te.fetchOptions)==null?void 0:Ce.meta))&&jt(this,On,ro).call(this,{type:"fetch",meta:(Oe=te.fetchOptions)==null?void 0:Oe.meta});const ae=Le=>{var Ne,Fe,Ue,De;isCancelledError(Le)&&Le.silent||jt(this,On,ro).call(this,{type:"error",error:Le}),isCancelledError(Le)||((Fe=(Ne=et(this,pn).config).onError)==null||Fe.call(Ne,Le,this),(De=(Ue=et(this,pn).config).onSettled)==null||De.call(Ue,this.state.data,Le,this)),this.scheduleGc()};return It(this,Mr,createRetryer({initialPromise:R==null?void 0:R.initialPromise,fn:te.fetchFn,abort:k.abort.bind(k),onSuccess:Le=>{var Ne,Fe,Ue,De;if(Le===void 0){ae(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(Le)}catch($e){ae($e);return}(Fe=(Ne=et(this,pn).config).onSuccess)==null||Fe.call(Ne,Le,this),(De=(Ue=et(this,pn).config).onSettled)==null||De.call(Ue,Le,this.state.error,this),this.scheduleGc()},onError:ae,onFail:(Le,Ne)=>{jt(this,On,ro).call(this,{type:"failed",failureCount:Le,error:Ne})},onPause:()=>{jt(this,On,ro).call(this,{type:"pause"})},onContinue:()=>{jt(this,On,ro).call(this,{type:"continue"})},retry:te.options.retry,retryDelay:te.options.retryDelay,networkMode:te.options.networkMode,canRun:()=>!0})),et(this,Mr).start()}},ci=new WeakMap,ui=new WeakMap,pn=new WeakMap,Mr=new WeakMap,fa=new WeakMap,ms=new WeakMap,On=new WeakSet,ro=function(y){const R=k=>{switch(y.type){case"failed":return{...k,fetchFailureCount:y.failureCount,fetchFailureReason:y.error};case"pause":return{...k,fetchStatus:"paused"};case"continue":return{...k,fetchStatus:"fetching"};case"fetch":return{...k,...fetchState(k.data,this.options),fetchMeta:y.meta??null};case"success":return{...k,data:y.data,dataUpdateCount:k.dataUpdateCount+1,dataUpdatedAt:y.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!y.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const H=y.error;return isCancelledError(H)&&H.revert&&et(this,ui)?{...et(this,ui),fetchStatus:"idle"}:{...k,error:H,errorUpdateCount:k.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:k.fetchFailureCount+1,fetchFailureReason:H,fetchStatus:"idle",status:"error"};case"invalidate":return{...k,isInvalidated:!0};case"setState":return{...k,...y.state}}};this.state=R(this.state),notifyManager.batch(()=>{this.observers.forEach(k=>{k.onQueryUpdate()}),et(this,pn).notify({query:this,type:"updated",action:y})})},kf);function fetchState(E,y){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(y.networkMode)?"fetching":"paused",...E===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(E){const y=typeof E.initialData=="function"?E.initialData():E.initialData,R=y!==void 0,k=R?typeof E.initialDataUpdatedAt=="function"?E.initialDataUpdatedAt():E.initialDataUpdatedAt:0;return{data:y,dataUpdateCount:0,dataUpdatedAt:R?k??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:R?"success":"pending",fetchStatus:"idle"}}var $n,Hf,QueryCache=(Hf=class extends Subscribable{constructor(y={}){super();wt(this,$n);this.config=y,It(this,$n,new Map)}build(y,R,k){const H=R.queryKey,B=R.queryHash??hashQueryKeyByOptions(H,R);let te=this.get(B);return te||(te=new Query({cache:this,queryKey:H,queryHash:B,options:y.defaultQueryOptions(R),state:k,defaultOptions:y.getQueryDefaults(H)}),this.add(te)),te}add(y){et(this,$n).has(y.queryHash)||(et(this,$n).set(y.queryHash,y),this.notify({type:"added",query:y}))}remove(y){const R=et(this,$n).get(y.queryHash);R&&(y.destroy(),R===y&&et(this,$n).delete(y.queryHash),this.notify({type:"removed",query:y}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(y=>{this.remove(y)})})}get(y){return et(this,$n).get(y)}getAll(){return[...et(this,$n).values()]}find(y){const R={exact:!0,...y};return this.getAll().find(k=>matchQuery(R,k))}findAll(y={}){const R=this.getAll();return Object.keys(y).length>0?R.filter(k=>matchQuery(y,k)):R}notify(y){notifyManager.batch(()=>{this.listeners.forEach(R=>{R(y)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(y=>{y.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(y=>{y.onOnline()})})}},$n=new WeakMap,Hf),kn,Hr,Ss,Hn,No,zf,Mutation=(zf=class extends Removable{constructor(y){super();wt(this,Hn);wt(this,kn);wt(this,Hr);wt(this,Ss);this.mutationId=y.mutationId,It(this,Hr,y.mutationCache),It(this,kn,[]),this.state=y.state||getDefaultState(),this.setOptions(y.options),this.scheduleGc()}setOptions(y){this.options=y,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(y){et(this,kn).includes(y)||(et(this,kn).push(y),this.clearGcTimeout(),et(this,Hr).notify({type:"observerAdded",mutation:this,observer:y}))}removeObserver(y){It(this,kn,et(this,kn).filter(R=>R!==y)),this.scheduleGc(),et(this,Hr).notify({type:"observerRemoved",mutation:this,observer:y})}optionalRemove(){et(this,kn).length||(this.state.status==="pending"?this.scheduleGc():et(this,Hr).remove(this))}continue(){var y;return((y=et(this,Ss))==null?void 0:y.continue())??this.execute(this.state.variables)}async execute(y){var H,B,te,ae,ce,Ce,Oe,Le,Ne,Fe,Ue,De,$e,Be,Ve,Ke,st,We,at,tt;It(this,Ss,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(y):Promise.reject(new Error("No mutationFn found")),onFail:(ft,Ye)=>{jt(this,Hn,No).call(this,{type:"failed",failureCount:ft,error:Ye})},onPause:()=>{jt(this,Hn,No).call(this,{type:"pause"})},onContinue:()=>{jt(this,Hn,No).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>et(this,Hr).canRun(this)}));const R=this.state.status==="pending",k=!et(this,Ss).canStart();try{if(!R){jt(this,Hn,No).call(this,{type:"pending",variables:y,isPaused:k}),await((B=(H=et(this,Hr).config).onMutate)==null?void 0:B.call(H,y,this));const Ye=await((ae=(te=this.options).onMutate)==null?void 0:ae.call(te,y));Ye!==this.state.context&&jt(this,Hn,No).call(this,{type:"pending",context:Ye,variables:y,isPaused:k})}const ft=await et(this,Ss).start();return await((Ce=(ce=et(this,Hr).config).onSuccess)==null?void 0:Ce.call(ce,ft,y,this.state.context,this)),await((Le=(Oe=this.options).onSuccess)==null?void 0:Le.call(Oe,ft,y,this.state.context)),await((Fe=(Ne=et(this,Hr).config).onSettled)==null?void 0:Fe.call(Ne,ft,null,this.state.variables,this.state.context,this)),await((De=(Ue=this.options).onSettled)==null?void 0:De.call(Ue,ft,null,y,this.state.context)),jt(this,Hn,No).call(this,{type:"success",data:ft}),ft}catch(ft){try{throw await((Be=($e=et(this,Hr).config).onError)==null?void 0:Be.call($e,ft,y,this.state.context,this)),await((Ke=(Ve=this.options).onError)==null?void 0:Ke.call(Ve,ft,y,this.state.context)),await((We=(st=et(this,Hr).config).onSettled)==null?void 0:We.call(st,void 0,ft,this.state.variables,this.state.context,this)),await((tt=(at=this.options).onSettled)==null?void 0:tt.call(at,void 0,ft,y,this.state.context)),ft}finally{jt(this,Hn,No).call(this,{type:"error",error:ft})}}finally{et(this,Hr).runNext(this)}}},kn=new WeakMap,Hr=new WeakMap,Ss=new WeakMap,Hn=new WeakSet,No=function(y){const R=k=>{switch(y.type){case"failed":return{...k,failureCount:y.failureCount,failureReason:y.error};case"pause":return{...k,isPaused:!0};case"continue":return{...k,isPaused:!1};case"pending":return{...k,context:y.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:y.isPaused,status:"pending",variables:y.variables,submittedAt:Date.now()};case"success":return{...k,data:y.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...k,data:void 0,error:y.error,failureCount:k.failureCount+1,failureReason:y.error,isPaused:!1,status:"error"}}};this.state=R(this.state),notifyManager.batch(()=>{et(this,kn).forEach(k=>{k.onMutationUpdate(y)}),et(this,Hr).notify({mutation:this,type:"updated",action:y})})},zf);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nn,ha,Bf,MutationCache=(Bf=class extends Subscribable{constructor(y={}){super();wt(this,nn);wt(this,ha);this.config=y,It(this,nn,new Map),It(this,ha,Date.now())}build(y,R,k){const H=new Mutation({mutationCache:this,mutationId:++xc(this,ha)._,options:y.defaultMutationOptions(R),state:k});return this.add(H),H}add(y){const R=scopeFor(y),k=et(this,nn).get(R)??[];k.push(y),et(this,nn).set(R,k),this.notify({type:"added",mutation:y})}remove(y){var k;const R=scopeFor(y);if(et(this,nn).has(R)){const H=(k=et(this,nn).get(R))==null?void 0:k.filter(B=>B!==y);H&&(H.length===0?et(this,nn).delete(R):et(this,nn).set(R,H))}this.notify({type:"removed",mutation:y})}canRun(y){var k;const R=(k=et(this,nn).get(scopeFor(y)))==null?void 0:k.find(H=>H.state.status==="pending");return!R||R===y}runNext(y){var k;const R=(k=et(this,nn).get(scopeFor(y)))==null?void 0:k.find(H=>H!==y&&H.state.isPaused);return(R==null?void 0:R.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(y=>{this.remove(y)})})}getAll(){return[...et(this,nn).values()].flat()}find(y){const R={exact:!0,...y};return this.getAll().find(k=>matchMutation(R,k))}findAll(y={}){return this.getAll().filter(R=>matchMutation(y,R))}notify(y){notifyManager.batch(()=>{this.listeners.forEach(R=>{R(y)})})}resumePausedMutations(){const y=this.getAll().filter(R=>R.state.isPaused);return notifyManager.batch(()=>Promise.all(y.map(R=>R.continue().catch(noop$3))))}},nn=new WeakMap,ha=new WeakMap,Bf);function scopeFor(E){var y;return((y=E.options.scope)==null?void 0:y.id)??String(E.mutationId)}function infiniteQueryBehavior(E){return{onFetch:(y,R)=>{var Oe,Le,Ne,Fe,Ue;const k=y.options,H=(Ne=(Le=(Oe=y.fetchOptions)==null?void 0:Oe.meta)==null?void 0:Le.fetchMore)==null?void 0:Ne.direction,B=((Fe=y.state.data)==null?void 0:Fe.pages)||[],te=((Ue=y.state.data)==null?void 0:Ue.pageParams)||[];let ae={pages:[],pageParams:[]},ce=0;const Ce=async()=>{let De=!1;const $e=Ke=>{Object.defineProperty(Ke,"signal",{enumerable:!0,get:()=>(y.signal.aborted?De=!0:y.signal.addEventListener("abort",()=>{De=!0}),y.signal)})},Be=ensureQueryFn(y.options,y.fetchOptions),Ve=async(Ke,st,We)=>{if(De)return Promise.reject();if(st==null&&Ke.pages.length)return Promise.resolve(Ke);const at={queryKey:y.queryKey,pageParam:st,direction:We?"backward":"forward",meta:y.options.meta};$e(at);const tt=await Be(at),{maxPages:ft}=y.options,Ye=We?addToStart:addToEnd;return{pages:Ye(Ke.pages,tt,ft),pageParams:Ye(Ke.pageParams,st,ft)}};if(H&&B.length){const Ke=H==="backward",st=Ke?getPreviousPageParam:getNextPageParam,We={pages:B,pageParams:te},at=st(k,We);ae=await Ve(We,at,Ke)}else{const Ke=E??B.length;do{const st=ce===0?te[0]??k.initialPageParam:getNextPageParam(k,ae);if(ce>0&&st==null)break;ae=await Ve(ae,st),ce++}while(ce{var De,$e;return($e=(De=y.options).persister)==null?void 0:$e.call(De,Ce,{queryKey:y.queryKey,meta:y.options.meta,signal:y.signal},R)}:y.fetchFn=Ce}}}function getNextPageParam(E,{pages:y,pageParams:R}){const k=y.length-1;return y.length>0?E.getNextPageParam(y[k],y,R[k],R):void 0}function getPreviousPageParam(E,{pages:y,pageParams:R}){var k;return y.length>0?(k=E.getPreviousPageParam)==null?void 0:k.call(E,y[0],y,R[0],R):void 0}function hasNextPage(E,y){return y?getNextPageParam(E,y)!=null:!1}function hasPreviousPage(E,y){return!y||!E.getPreviousPageParam?!1:getPreviousPageParam(E,y)!=null}var Er,Do,$o,li,di,ko,fi,hi,jf,QueryClient=(jf=class{constructor(E={}){wt(this,Er);wt(this,Do);wt(this,$o);wt(this,li);wt(this,di);wt(this,ko);wt(this,fi);wt(this,hi);It(this,Er,E.queryCache||new QueryCache),It(this,Do,E.mutationCache||new MutationCache),It(this,$o,E.defaultOptions||{}),It(this,li,new Map),It(this,di,new Map),It(this,ko,0)}mount(){xc(this,ko)._++,et(this,ko)===1&&(It(this,fi,focusManager.subscribe(async E=>{E&&(await this.resumePausedMutations(),et(this,Er).onFocus())})),It(this,hi,onlineManager.subscribe(async E=>{E&&(await this.resumePausedMutations(),et(this,Er).onOnline())})))}unmount(){var E,y;xc(this,ko)._--,et(this,ko)===0&&((E=et(this,fi))==null||E.call(this),It(this,fi,void 0),(y=et(this,hi))==null||y.call(this),It(this,hi,void 0))}isFetching(E){return et(this,Er).findAll({...E,fetchStatus:"fetching"}).length}isMutating(E){return et(this,Do).findAll({...E,status:"pending"}).length}getQueryData(E){var R;const y=this.defaultQueryOptions({queryKey:E});return(R=et(this,Er).get(y.queryHash))==null?void 0:R.state.data}ensureQueryData(E){const y=this.getQueryData(E.queryKey);if(y===void 0)return this.fetchQuery(E);{const R=this.defaultQueryOptions(E),k=et(this,Er).build(this,R);return E.revalidateIfStale&&k.isStaleByTime(resolveStaleTime(R.staleTime,k))&&this.prefetchQuery(R),Promise.resolve(y)}}getQueriesData(E){return et(this,Er).findAll(E).map(({queryKey:y,state:R})=>{const k=R.data;return[y,k]})}setQueryData(E,y,R){const k=this.defaultQueryOptions({queryKey:E}),H=et(this,Er).get(k.queryHash),B=H==null?void 0:H.state.data,te=functionalUpdate(y,B);if(te!==void 0)return et(this,Er).build(this,k).setData(te,{...R,manual:!0})}setQueriesData(E,y,R){return notifyManager.batch(()=>et(this,Er).findAll(E).map(({queryKey:k})=>[k,this.setQueryData(k,y,R)]))}getQueryState(E){var R;const y=this.defaultQueryOptions({queryKey:E});return(R=et(this,Er).get(y.queryHash))==null?void 0:R.state}removeQueries(E){const y=et(this,Er);notifyManager.batch(()=>{y.findAll(E).forEach(R=>{y.remove(R)})})}resetQueries(E,y){const R=et(this,Er),k={type:"active",...E};return notifyManager.batch(()=>(R.findAll(E).forEach(H=>{H.reset()}),this.refetchQueries(k,y)))}cancelQueries(E={},y={}){const R={revert:!0,...y},k=notifyManager.batch(()=>et(this,Er).findAll(E).map(H=>H.cancel(R)));return Promise.all(k).then(noop$3).catch(noop$3)}invalidateQueries(E={},y={}){return notifyManager.batch(()=>{if(et(this,Er).findAll(E).forEach(k=>{k.invalidate()}),E.refetchType==="none")return Promise.resolve();const R={...E,type:E.refetchType??E.type??"active"};return this.refetchQueries(R,y)})}refetchQueries(E={},y){const R={...y,cancelRefetch:(y==null?void 0:y.cancelRefetch)??!0},k=notifyManager.batch(()=>et(this,Er).findAll(E).filter(H=>!H.isDisabled()).map(H=>{let B=H.fetch(void 0,R);return R.throwOnError||(B=B.catch(noop$3)),H.state.fetchStatus==="paused"?Promise.resolve():B}));return Promise.all(k).then(noop$3)}fetchQuery(E){const y=this.defaultQueryOptions(E);y.retry===void 0&&(y.retry=!1);const R=et(this,Er).build(this,y);return R.isStaleByTime(resolveStaleTime(y.staleTime,R))?R.fetch(y):Promise.resolve(R.state.data)}prefetchQuery(E){return this.fetchQuery(E).then(noop$3).catch(noop$3)}fetchInfiniteQuery(E){return E.behavior=infiniteQueryBehavior(E.pages),this.fetchQuery(E)}prefetchInfiniteQuery(E){return this.fetchInfiniteQuery(E).then(noop$3).catch(noop$3)}ensureInfiniteQueryData(E){return E.behavior=infiniteQueryBehavior(E.pages),this.ensureQueryData(E)}resumePausedMutations(){return onlineManager.isOnline()?et(this,Do).resumePausedMutations():Promise.resolve()}getQueryCache(){return et(this,Er)}getMutationCache(){return et(this,Do)}getDefaultOptions(){return et(this,$o)}setDefaultOptions(E){It(this,$o,E)}setQueryDefaults(E,y){et(this,li).set(hashKey(E),{queryKey:E,defaultOptions:y})}getQueryDefaults(E){const y=[...et(this,li).values()];let R={};return y.forEach(k=>{partialMatchKey(E,k.queryKey)&&(R={...R,...k.defaultOptions})}),R}setMutationDefaults(E,y){et(this,di).set(hashKey(E),{mutationKey:E,defaultOptions:y})}getMutationDefaults(E){const y=[...et(this,di).values()];let R={};return y.forEach(k=>{partialMatchKey(E,k.mutationKey)&&(R={...R,...k.defaultOptions})}),R}defaultQueryOptions(E){if(E._defaulted)return E;const y={...et(this,$o).queries,...this.getQueryDefaults(E.queryKey),...E,_defaulted:!0};return y.queryHash||(y.queryHash=hashQueryKeyByOptions(y.queryKey,y)),y.refetchOnReconnect===void 0&&(y.refetchOnReconnect=y.networkMode!=="always"),y.throwOnError===void 0&&(y.throwOnError=!!y.suspense),!y.networkMode&&y.persister&&(y.networkMode="offlineFirst"),y.enabled!==!0&&y.queryFn===skipToken&&(y.enabled=!1),y}defaultMutationOptions(E){return E!=null&&E._defaulted?E:{...et(this,$o).mutations,...(E==null?void 0:E.mutationKey)&&this.getMutationDefaults(E.mutationKey),...E,_defaulted:!0}}clear(){et(this,Er).clear(),et(this,Do).clear()}},Er=new WeakMap,Do=new WeakMap,$o=new WeakMap,li=new WeakMap,di=new WeakMap,ko=new WeakMap,fi=new WeakMap,hi=new WeakMap,jf),Zr,Qt,pa,zr,gs,pi,Ho,zn,Ea,_i,Ei,Ts,ys,zo,mi,Yt,la,dl,fl,hl,pl,_l,El,ml,Wf,Vf,QueryObserver=(Vf=class extends Subscribable{constructor(y,R){super();wt(this,Yt);wt(this,Zr);wt(this,Qt);wt(this,pa);wt(this,zr);wt(this,gs);wt(this,pi);wt(this,Ho);wt(this,zn);wt(this,Ea);wt(this,_i);wt(this,Ei);wt(this,Ts);wt(this,ys);wt(this,zo);wt(this,mi,new Set);this.options=R,It(this,Zr,y),It(this,zn,null),It(this,Ho,pendingThenable()),this.options.experimental_prefetchInRender||et(this,Ho).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(R)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(et(this,Qt).addObserver(this),shouldFetchOnMount(et(this,Qt),this.options)?jt(this,Yt,la).call(this):this.updateResult(),jt(this,Yt,pl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(et(this,Qt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(et(this,Qt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,jt(this,Yt,_l).call(this),jt(this,Yt,El).call(this),et(this,Qt).removeObserver(this)}setOptions(y,R){const k=this.options,H=et(this,Qt);if(this.options=et(this,Zr).defaultQueryOptions(y),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,et(this,Qt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");jt(this,Yt,ml).call(this),et(this,Qt).setOptions(this.options),k._defaulted&&!shallowEqualObjects(this.options,k)&&et(this,Zr).getQueryCache().notify({type:"observerOptionsUpdated",query:et(this,Qt),observer:this});const B=this.hasListeners();B&&shouldFetchOptionally(et(this,Qt),H,this.options,k)&&jt(this,Yt,la).call(this),this.updateResult(R),B&&(et(this,Qt)!==H||resolveEnabled(this.options.enabled,et(this,Qt))!==resolveEnabled(k.enabled,et(this,Qt))||resolveStaleTime(this.options.staleTime,et(this,Qt))!==resolveStaleTime(k.staleTime,et(this,Qt)))&&jt(this,Yt,dl).call(this);const te=jt(this,Yt,fl).call(this);B&&(et(this,Qt)!==H||resolveEnabled(this.options.enabled,et(this,Qt))!==resolveEnabled(k.enabled,et(this,Qt))||te!==et(this,zo))&&jt(this,Yt,hl).call(this,te)}getOptimisticResult(y){const R=et(this,Zr).getQueryCache().build(et(this,Zr),y),k=this.createResult(R,y);return shouldAssignObserverCurrentProperties(this,k)&&(It(this,zr,k),It(this,pi,this.options),It(this,gs,et(this,Qt).state)),k}getCurrentResult(){return et(this,zr)}trackResult(y,R){const k={};return Object.keys(y).forEach(H=>{Object.defineProperty(k,H,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(H),R==null||R(H),y[H])})}),k}trackProp(y){et(this,mi).add(y)}getCurrentQuery(){return et(this,Qt)}refetch({...y}={}){return this.fetch({...y})}fetchOptimistic(y){const R=et(this,Zr).defaultQueryOptions(y),k=et(this,Zr).getQueryCache().build(et(this,Zr),R);return k.fetch().then(()=>this.createResult(k,R))}fetch(y){return jt(this,Yt,la).call(this,{...y,cancelRefetch:y.cancelRefetch??!0}).then(()=>(this.updateResult(),et(this,zr)))}createResult(y,R){var ft;const k=et(this,Qt),H=this.options,B=et(this,zr),te=et(this,gs),ae=et(this,pi),Ce=y!==k?y.state:et(this,pa),{state:Oe}=y;let Le={...Oe},Ne=!1,Fe;if(R._optimisticResults){const Ye=this.hasListeners(),ot=!Ye&&shouldFetchOnMount(y,R),nt=Ye&&shouldFetchOptionally(y,k,R,H);(ot||nt)&&(Le={...Le,...fetchState(Oe.data,y.options)}),R._optimisticResults==="isRestoring"&&(Le.fetchStatus="idle")}let{error:Ue,errorUpdatedAt:De,status:$e}=Le;if(R.select&&Le.data!==void 0)if(B&&Le.data===(te==null?void 0:te.data)&&R.select===et(this,Ea))Fe=et(this,_i);else try{It(this,Ea,R.select),Fe=R.select(Le.data),Fe=replaceData(B==null?void 0:B.data,Fe,R),It(this,_i,Fe),It(this,zn,null)}catch(Ye){It(this,zn,Ye)}else Fe=Le.data;if(R.placeholderData!==void 0&&Fe===void 0&&$e==="pending"){let Ye;if(B!=null&&B.isPlaceholderData&&R.placeholderData===(ae==null?void 0:ae.placeholderData))Ye=B.data;else if(Ye=typeof R.placeholderData=="function"?R.placeholderData((ft=et(this,Ei))==null?void 0:ft.state.data,et(this,Ei)):R.placeholderData,R.select&&Ye!==void 0)try{Ye=R.select(Ye),It(this,zn,null)}catch(ot){It(this,zn,ot)}Ye!==void 0&&($e="success",Fe=replaceData(B==null?void 0:B.data,Ye,R),Ne=!0)}et(this,zn)&&(Ue=et(this,zn),Fe=et(this,_i),De=Date.now(),$e="error");const Be=Le.fetchStatus==="fetching",Ve=$e==="pending",Ke=$e==="error",st=Ve&&Be,We=Fe!==void 0,tt={status:$e,fetchStatus:Le.fetchStatus,isPending:Ve,isSuccess:$e==="success",isError:Ke,isInitialLoading:st,isLoading:st,data:Fe,dataUpdatedAt:Le.dataUpdatedAt,error:Ue,errorUpdatedAt:De,failureCount:Le.fetchFailureCount,failureReason:Le.fetchFailureReason,errorUpdateCount:Le.errorUpdateCount,isFetched:Le.dataUpdateCount>0||Le.errorUpdateCount>0,isFetchedAfterMount:Le.dataUpdateCount>Ce.dataUpdateCount||Le.errorUpdateCount>Ce.errorUpdateCount,isFetching:Be,isRefetching:Be&&!Ve,isLoadingError:Ke&&!We,isPaused:Le.fetchStatus==="paused",isPlaceholderData:Ne,isRefetchError:Ke&&We,isStale:isStale(y,R),refetch:this.refetch,promise:et(this,Ho)};if(this.options.experimental_prefetchInRender){const Ye=pt=>{tt.status==="error"?pt.reject(tt.error):tt.data!==void 0&&pt.resolve(tt.data)},ot=()=>{const pt=It(this,Ho,tt.promise=pendingThenable());Ye(pt)},nt=et(this,Ho);switch(nt.status){case"pending":y.queryHash===k.queryHash&&Ye(nt);break;case"fulfilled":(tt.status==="error"||tt.data!==nt.value)&&ot();break;case"rejected":(tt.status!=="error"||tt.error!==nt.reason)&&ot();break}}return tt}updateResult(y){const R=et(this,zr),k=this.createResult(et(this,Qt),this.options);if(It(this,gs,et(this,Qt).state),It(this,pi,this.options),et(this,gs).data!==void 0&&It(this,Ei,et(this,Qt)),shallowEqualObjects(k,R))return;It(this,zr,k);const H={},B=()=>{if(!R)return!0;const{notifyOnChangeProps:te}=this.options,ae=typeof te=="function"?te():te;if(ae==="all"||!ae&&!et(this,mi).size)return!0;const ce=new Set(ae??et(this,mi));return this.options.throwOnError&&ce.add("error"),Object.keys(et(this,zr)).some(Ce=>{const Oe=Ce;return et(this,zr)[Oe]!==R[Oe]&&ce.has(Oe)})};(y==null?void 0:y.listeners)!==!1&&B()&&(H.listeners=!0),jt(this,Yt,Wf).call(this,{...H,...y})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&jt(this,Yt,pl).call(this)}},Zr=new WeakMap,Qt=new WeakMap,pa=new WeakMap,zr=new WeakMap,gs=new WeakMap,pi=new WeakMap,Ho=new WeakMap,zn=new WeakMap,Ea=new WeakMap,_i=new WeakMap,Ei=new WeakMap,Ts=new WeakMap,ys=new WeakMap,zo=new WeakMap,mi=new WeakMap,Yt=new WeakSet,la=function(y){jt(this,Yt,ml).call(this);let R=et(this,Qt).fetch(this.options,y);return y!=null&&y.throwOnError||(R=R.catch(noop$3)),R},dl=function(){jt(this,Yt,_l).call(this);const y=resolveStaleTime(this.options.staleTime,et(this,Qt));if(isServer||et(this,zr).isStale||!isValidTimeout(y))return;const k=timeUntilStale(et(this,zr).dataUpdatedAt,y)+1;It(this,Ts,setTimeout(()=>{et(this,zr).isStale||this.updateResult()},k))},fl=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(et(this,Qt)):this.options.refetchInterval)??!1},hl=function(y){jt(this,Yt,El).call(this),It(this,zo,y),!(isServer||resolveEnabled(this.options.enabled,et(this,Qt))===!1||!isValidTimeout(et(this,zo))||et(this,zo)===0)&&It(this,ys,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&jt(this,Yt,la).call(this)},et(this,zo)))},pl=function(){jt(this,Yt,dl).call(this),jt(this,Yt,hl).call(this,jt(this,Yt,fl).call(this))},_l=function(){et(this,Ts)&&(clearTimeout(et(this,Ts)),It(this,Ts,void 0))},El=function(){et(this,ys)&&(clearInterval(et(this,ys)),It(this,ys,void 0))},ml=function(){const y=et(this,Zr).getQueryCache().build(et(this,Zr),this.options);if(y===et(this,Qt))return;const R=et(this,Qt);It(this,Qt,y),It(this,pa,y.state),this.hasListeners()&&(R==null||R.removeObserver(this),y.addObserver(this))},Wf=function(y){notifyManager.batch(()=>{y.listeners&&this.listeners.forEach(R=>{R(et(this,zr))}),et(this,Zr).getQueryCache().notify({query:et(this,Qt),type:"observerResultsUpdated"})})},Vf);function shouldLoadOnMount(E,y){return resolveEnabled(y.enabled,E)!==!1&&E.state.data===void 0&&!(E.state.status==="error"&&y.retryOnMount===!1)}function shouldFetchOnMount(E,y){return shouldLoadOnMount(E,y)||E.state.data!==void 0&&shouldFetchOn(E,y,y.refetchOnMount)}function shouldFetchOn(E,y,R){if(resolveEnabled(y.enabled,E)!==!1){const k=typeof R=="function"?R(E):R;return k==="always"||k!==!1&&isStale(E,y)}return!1}function shouldFetchOptionally(E,y,R,k){return(E!==y||resolveEnabled(k.enabled,E)===!1)&&(!R.suspense||E.state.status!=="error")&&isStale(E,R)}function isStale(E,y){return resolveEnabled(y.enabled,E)!==!1&&E.isStaleByTime(resolveStaleTime(y.staleTime,E))}function shouldAssignObserverCurrentProperties(E,y){return!shallowEqualObjects(E.getCurrentResult(),y)}var InfiniteQueryObserver=class extends QueryObserver{constructor(E,y){super(E,y)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(E,y){super.setOptions({...E,behavior:infiniteQueryBehavior()},y)}getOptimisticResult(E){return E.behavior=infiniteQueryBehavior(),super.getOptimisticResult(E)}fetchNextPage(E){return this.fetch({...E,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(E){return this.fetch({...E,meta:{fetchMore:{direction:"backward"}}})}createResult(E,y){var Ue,De;const{state:R}=E,k=super.createResult(E,y),{isFetching:H,isRefetching:B,isError:te,isRefetchError:ae}=k,ce=(De=(Ue=R.fetchMeta)==null?void 0:Ue.fetchMore)==null?void 0:De.direction,Ce=te&&ce==="forward",Oe=H&&ce==="forward",Le=te&&ce==="backward",Ne=H&&ce==="backward";return{...k,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(y,R.data),hasPreviousPage:hasPreviousPage(y,R.data),isFetchNextPageError:Ce,isFetchingNextPage:Oe,isFetchPreviousPageError:Le,isFetchingPreviousPage:Ne,isRefetchError:ae&&!Ce&&!Le,isRefetching:B&&!Oe&&!Ne}}},Bo,jo,Wr,no,so,Lc,Sl,Gf,MutationObserver$1=(Gf=class extends Subscribable{constructor(R,k){super();wt(this,so);wt(this,Bo);wt(this,jo);wt(this,Wr);wt(this,no);It(this,Bo,R),this.setOptions(k),this.bindMethods(),jt(this,so,Lc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(R){var H;const k=this.options;this.options=et(this,Bo).defaultMutationOptions(R),shallowEqualObjects(this.options,k)||et(this,Bo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:et(this,Wr),observer:this}),k!=null&&k.mutationKey&&this.options.mutationKey&&hashKey(k.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((H=et(this,Wr))==null?void 0:H.state.status)==="pending"&&et(this,Wr).setOptions(this.options)}onUnsubscribe(){var R;this.hasListeners()||(R=et(this,Wr))==null||R.removeObserver(this)}onMutationUpdate(R){jt(this,so,Lc).call(this),jt(this,so,Sl).call(this,R)}getCurrentResult(){return et(this,jo)}reset(){var R;(R=et(this,Wr))==null||R.removeObserver(this),It(this,Wr,void 0),jt(this,so,Lc).call(this),jt(this,so,Sl).call(this)}mutate(R,k){var H;return It(this,no,k),(H=et(this,Wr))==null||H.removeObserver(this),It(this,Wr,et(this,Bo).getMutationCache().build(et(this,Bo),this.options)),et(this,Wr).addObserver(this),et(this,Wr).execute(R)}},Bo=new WeakMap,jo=new WeakMap,Wr=new WeakMap,no=new WeakMap,so=new WeakSet,Lc=function(){var k;const R=((k=et(this,Wr))==null?void 0:k.state)??getDefaultState();It(this,jo,{...R,isPending:R.status==="pending",isSuccess:R.status==="success",isError:R.status==="error",isIdle:R.status==="idle",mutate:this.mutate,reset:this.reset})},Sl=function(R){notifyManager.batch(()=>{var k,H,B,te,ae,ce,Ce,Oe;if(et(this,no)&&this.hasListeners()){const Le=et(this,jo).variables,Ne=et(this,jo).context;(R==null?void 0:R.type)==="success"?((H=(k=et(this,no)).onSuccess)==null||H.call(k,R.data,Le,Ne),(te=(B=et(this,no)).onSettled)==null||te.call(B,R.data,null,Le,Ne)):(R==null?void 0:R.type)==="error"&&((ce=(ae=et(this,no)).onError)==null||ce.call(ae,R.error,Le,Ne),(Oe=(Ce=et(this,no)).onSettled)==null||Oe.call(Ce,void 0,R.error,Le,Ne))}this.listeners.forEach(Le=>{Le(et(this,jo))})})},Gf),reactExports=requireReact();const React$1=getDefaultExportFromCjs(reactExports),React$2=_mergeNamespaces({__proto__:null,default:React$1},[reactExports]);var QueryClientContext=reactExports.createContext(void 0),useQueryClient=E=>{const y=reactExports.useContext(QueryClientContext);if(!y)throw new Error("No QueryClient set, use QueryClientProvider to set one");return y},QueryClientProvider=({client:E,children:y})=>(reactExports.useEffect(()=>(E.mount(),()=>{E.unmount()}),[E]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:E,children:y})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let E=!1;return{clearReset:()=>{E=!1},reset:()=>{E=!0},isReset:()=>E}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(E,y){return typeof E=="function"?E(...y):!!E}function noop$2(){}var ensurePreventErrorBoundaryRetry=(E,y)=>{(E.suspense||E.throwOnError)&&(y.isReset()||(E.retryOnMount=!1))},useClearResetErrorBoundary=E=>{reactExports.useEffect(()=>{E.clearReset()},[E])},getHasError=({result:E,errorResetBoundary:y,throwOnError:R,query:k})=>E.isError&&!y.isReset()&&!E.isFetching&&k&&shouldThrowError(R,[E.error,k]),ensureSuspenseTimers=E=>{E.suspense&&(typeof E.staleTime!="number"&&(E.staleTime=1e3),typeof E.gcTime=="number"&&(E.gcTime=Math.max(E.gcTime,1e3)))},willFetch=(E,y)=>E.isLoading&&E.isFetching&&!y,shouldSuspend=(E,y)=>(E==null?void 0:E.suspense)&&y.isPending,fetchOptimistic=(E,y,R)=>y.fetchOptimistic(E).catch(()=>{R.clearReset()});function useBaseQuery(E,y,R){var Oe,Le,Ne,Fe,Ue;const k=useQueryClient(),H=useIsRestoring(),B=useQueryErrorResetBoundary(),te=k.defaultQueryOptions(E);(Le=(Oe=k.getDefaultOptions().queries)==null?void 0:Oe._experimental_beforeQuery)==null||Le.call(Oe,te),te._optimisticResults=H?"isRestoring":"optimistic",ensureSuspenseTimers(te),ensurePreventErrorBoundaryRetry(te,B),useClearResetErrorBoundary(B);const ae=!k.getQueryCache().get(te.queryHash),[ce]=reactExports.useState(()=>new y(k,te)),Ce=ce.getOptimisticResult(te);if(reactExports.useSyncExternalStore(reactExports.useCallback(De=>{const $e=H?()=>{}:ce.subscribe(notifyManager.batchCalls(De));return ce.updateResult(),$e},[ce,H]),()=>ce.getCurrentResult(),()=>ce.getCurrentResult()),reactExports.useEffect(()=>{ce.setOptions(te,{listeners:!1})},[te,ce]),shouldSuspend(te,Ce))throw fetchOptimistic(te,ce,B);if(getHasError({result:Ce,errorResetBoundary:B,throwOnError:te.throwOnError,query:k.getQueryCache().get(te.queryHash)}))throw Ce.error;if((Fe=(Ne=k.getDefaultOptions().queries)==null?void 0:Ne._experimental_afterQuery)==null||Fe.call(Ne,te,Ce),te.experimental_prefetchInRender&&!isServer&&willFetch(Ce,H)){const De=ae?fetchOptimistic(te,ce,B):(Ue=k.getQueryCache().get(te.queryHash))==null?void 0:Ue.promise;De==null||De.catch(noop$2).finally(()=>{ce.hasListeners()||ce.updateResult()})}return te.notifyOnChangeProps?Ce:ce.trackResult(Ce)}function useQuery(E,y){return useBaseQuery(E,QueryObserver)}function useMutation(E,y){const R=useQueryClient(),[k]=reactExports.useState(()=>new MutationObserver$1(R,E));reactExports.useEffect(()=>{k.setOptions(E)},[k,E]);const H=reactExports.useSyncExternalStore(reactExports.useCallback(te=>k.subscribe(notifyManager.batchCalls(te)),[k]),()=>k.getCurrentResult(),()=>k.getCurrentResult()),B=reactExports.useCallback((te,ae)=>{k.mutate(te,ae).catch(noop$2)},[k]);if(H.error&&shouldThrowError(k.options.throwOnError,[H.error]))throw H.error;return{...H,mutate:B,mutateAsync:H.mutate}}function useInfiniteQuery(E,y){return useBaseQuery(E,InfiniteQueryObserver)}var withSelector={exports:{}},useSyncExternalStoreWithSelector_production_min={};/** * @license React * use-sync-external-store-with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredUseSyncExternalStoreWithSelector_production_min;function requireUseSyncExternalStoreWithSelector_production_min(){if(hasRequiredUseSyncExternalStoreWithSelector_production_min)return useSyncExternalStoreWithSelector_production_min;hasRequiredUseSyncExternalStoreWithSelector_production_min=1;var E=requireReact();function y(ce,Ce){return ce===Ce&&(ce!==0||1/ce===1/Ce)||ce!==ce&&Ce!==Ce}var R=typeof Object.is=="function"?Object.is:y,k=E.useSyncExternalStore,H=E.useRef,B=E.useEffect,te=E.useMemo,ae=E.useDebugValue;return useSyncExternalStoreWithSelector_production_min.useSyncExternalStoreWithSelector=function(ce,Ce,Oe,Le,Ne){var Fe=H(null);if(Fe.current===null){var Ue={hasValue:!1,value:null};Fe.current=Ue}else Ue=Fe.current;Fe=te(function(){function $e(We){if(!Be){if(Be=!0,Ve=We,We=Le(We),Ne!==void 0&&Ue.hasValue){var at=Ue.value;if(Ne(at,We))return Ke=at}return Ke=We}if(at=Ke,R(Ve,We))return at;var tt=Le(We);return Ne!==void 0&&Ne(at,tt)?at:(Ve=We,Ke=tt)}var Be=!1,Ve,Ke,st=Oe===void 0?null:Oe;return[function(){return $e(Ce())},st===null?void 0:function(){return $e(st())}]},[Ce,Oe,Le,Ne]);var De=k(ce,Fe[0],Fe[1]);return B(function(){Ue.hasValue=!0,Ue.value=De},[De]),ae(De),De},useSyncExternalStoreWithSelector_production_min}var hasRequiredWithSelector;function requireWithSelector(){return hasRequiredWithSelector||(hasRequiredWithSelector=1,withSelector.exports=requireUseSyncExternalStoreWithSelector_production_min()),withSelector.exports}var withSelectorExports=requireWithSelector(),React="default"in React$2?React$1:React$2,ContextKey=Symbol.for("react-redux-context"),gT=typeof globalThis<"u"?globalThis:{};function getContext(){if(!React.createContext)return{};const E=gT[ContextKey]??(gT[ContextKey]=new Map);let y=E.get(React.createContext);return y||(y=React.createContext(null),E.set(React.createContext,y)),y}var ReactReduxContext=getContext(),notInitialized=()=>{throw new Error("uSES not initialized!")};function createReduxContextHook(E=ReactReduxContext){return function(){return React.useContext(E)}}var useReduxContext=createReduxContextHook(),useSyncExternalStoreWithSelector=notInitialized,initializeUseSelector=E=>{useSyncExternalStoreWithSelector=E},refEquality=(E,y)=>E===y;function createSelectorHook(E=ReactReduxContext){const y=E===ReactReduxContext?useReduxContext:createReduxContextHook(E);return function(k,H={}){const{equalityFn:B=refEquality,devModeChecks:te={}}=typeof H=="function"?{equalityFn:H}:H,{store:ae,subscription:ce,getServerState:Ce,stabilityCheck:Oe,identityFunctionCheck:Le}=y();React.useRef(!0);const Ne=React.useCallback({[k.name](Ue){return k(Ue)}}[k.name],[k,Oe,te.stabilityCheck]),Fe=useSyncExternalStoreWithSelector(ce.addNestedSub,ae.getState,Ce||ae.getState,Ne,B);return React.useDebugValue(Fe),Fe}}var useSelector=createSelectorHook(),REACT_ELEMENT_TYPE=Symbol.for("react.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_PROVIDER_TYPE=Symbol.for("react.provider"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_SERVER_CONTEXT_TYPE=Symbol.for("react.server_context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),ForwardRef=REACT_FORWARD_REF_TYPE,Memo=REACT_MEMO_TYPE;function typeOf(E){if(typeof E=="object"&&E!==null){const y=E.$$typeof;switch(y){case REACT_ELEMENT_TYPE:{const R=E.type;switch(R){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:return R;default:{const k=R&&R.$$typeof;switch(k){case REACT_SERVER_CONTEXT_TYPE:case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return k;default:return y}}}}case REACT_PORTAL_TYPE:return y}}}function isMemo(E){return typeOf(E)===REACT_MEMO_TYPE}function pureFinalPropsSelectorFactory(E,y,R,k,{areStatesEqual:H,areOwnPropsEqual:B,areStatePropsEqual:te}){let ae=!1,ce,Ce,Oe,Le,Ne;function Fe(Ve,Ke){return ce=Ve,Ce=Ke,Oe=E(ce,Ce),Le=y(k,Ce),Ne=R(Oe,Le,Ce),ae=!0,Ne}function Ue(){return Oe=E(ce,Ce),y.dependsOnOwnProps&&(Le=y(k,Ce)),Ne=R(Oe,Le,Ce),Ne}function De(){return E.dependsOnOwnProps&&(Oe=E(ce,Ce)),y.dependsOnOwnProps&&(Le=y(k,Ce)),Ne=R(Oe,Le,Ce),Ne}function $e(){const Ve=E(ce,Ce),Ke=!te(Ve,Oe);return Oe=Ve,Ke&&(Ne=R(Oe,Le,Ce)),Ne}function Be(Ve,Ke){const st=!B(Ke,Ce),We=!H(Ve,ce,Ke,Ce);return ce=Ve,Ce=Ke,st&&We?Ue():st?De():We?$e():Ne}return function(Ke,st){return ae?Be(Ke,st):Fe(Ke,st)}}function finalPropsSelectorFactory(E,{initMapStateToProps:y,initMapDispatchToProps:R,initMergeProps:k,...H}){const B=y(E,H),te=R(E,H),ae=k(E,H);return pureFinalPropsSelectorFactory(B,te,ae,E,H)}function bindActionCreators(E,y){const R={};for(const k in E){const H=E[k];typeof H=="function"&&(R[k]=(...B)=>y(H(...B)))}return R}function wrapMapToPropsConstant(E){return function(R){const k=E(R);function H(){return k}return H.dependsOnOwnProps=!1,H}}function getDependsOnOwnProps(E){return E.dependsOnOwnProps?!!E.dependsOnOwnProps:E.length!==1}function wrapMapToPropsFunc(E,y){return function(k,{displayName:H}){const B=function(ae,ce){return B.dependsOnOwnProps?B.mapToProps(ae,ce):B.mapToProps(ae,void 0)};return B.dependsOnOwnProps=!0,B.mapToProps=function(ae,ce){B.mapToProps=E,B.dependsOnOwnProps=getDependsOnOwnProps(E);let Ce=B(ae,ce);return typeof Ce=="function"&&(B.mapToProps=Ce,B.dependsOnOwnProps=getDependsOnOwnProps(Ce),Ce=B(ae,ce)),Ce},B}}function createInvalidArgFactory(E,y){return(R,k)=>{throw new Error(`Invalid value of type ${typeof E} for ${y} argument when connecting component ${k.wrappedComponentName}.`)}}function mapDispatchToPropsFactory(E){return E&&typeof E=="object"?wrapMapToPropsConstant(y=>bindActionCreators(E,y)):E?typeof E=="function"?wrapMapToPropsFunc(E):createInvalidArgFactory(E,"mapDispatchToProps"):wrapMapToPropsConstant(y=>({dispatch:y}))}function mapStateToPropsFactory(E){return E?typeof E=="function"?wrapMapToPropsFunc(E):createInvalidArgFactory(E,"mapStateToProps"):wrapMapToPropsConstant(()=>({}))}function defaultMergeProps(E,y,R){return{...R,...E,...y}}function wrapMergePropsFunc(E){return function(R,{displayName:k,areMergedPropsEqual:H}){let B=!1,te;return function(ce,Ce,Oe){const Le=E(ce,Ce,Oe);return B?H(Le,te)||(te=Le):(B=!0,te=Le),te}}}function mergePropsFactory(E){return E?typeof E=="function"?wrapMergePropsFunc(E):createInvalidArgFactory(E,"mergeProps"):()=>defaultMergeProps}function defaultNoopBatch(E){E()}function createListenerCollection(){let E=null,y=null;return{clear(){E=null,y=null},notify(){defaultNoopBatch(()=>{let R=E;for(;R;)R.callback(),R=R.next})},get(){let R=[],k=E;for(;k;)R.push(k),k=k.next;return R},subscribe(R){let k=!0,H=y={callback:R,next:null,prev:y};return H.prev?H.prev.next=H:E=H,function(){!k||E===null||(k=!1,H.next?H.next.prev=H.prev:y=H.prev,H.prev?H.prev.next=H.next:E=H.next)}}}}var nullListeners={notify(){},get:()=>[]};function createSubscription(E,y){let R,k=nullListeners,H=0,B=!1;function te(De){Oe();const $e=k.subscribe(De);let Be=!1;return()=>{Be||(Be=!0,$e(),Le())}}function ae(){k.notify()}function ce(){Ue.onStateChange&&Ue.onStateChange()}function Ce(){return B}function Oe(){H++,R||(R=y?y.addNestedSub(ce):E.subscribe(ce),k=createListenerCollection())}function Le(){H--,R&&H===0&&(R(),R=void 0,k.clear(),k=nullListeners)}function Ne(){B||(B=!0,Oe())}function Fe(){B&&(B=!1,Le())}const Ue={addNestedSub:te,notifyNestedSubs:ae,handleChangeWrapper:ce,isSubscribed:Ce,trySubscribe:Ne,tryUnsubscribe:Fe,getListeners:()=>k};return Ue}var canUseDOM$2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",useIsomorphicLayoutEffect=canUseDOM$2?React.useLayoutEffect:React.useEffect;function is$1(E,y){return E===y?E!==0||y!==0||1/E===1/y:E!==E&&y!==y}function shallowEqual$1(E,y){if(is$1(E,y))return!0;if(typeof E!="object"||E===null||typeof y!="object"||y===null)return!1;const R=Object.keys(E),k=Object.keys(y);if(R.length!==k.length)return!1;for(let H=0;H{useSyncExternalStore=E},NO_SUBSCRIPTION_ARRAY=[null,null];function useIsomorphicLayoutEffectWithArgs(E,y,R){useIsomorphicLayoutEffect(()=>E(...y),R)}function captureWrapperProps(E,y,R,k,H,B){E.current=k,R.current=!1,H.current&&(H.current=null,B())}function subscribeUpdates(E,y,R,k,H,B,te,ae,ce,Ce,Oe){if(!E)return()=>{};let Le=!1,Ne=null;const Fe=()=>{if(Le||!ae.current)return;const De=y.getState();let $e,Be;try{$e=k(De,H.current)}catch(Ve){Be=Ve,Ne=Ve}Be||(Ne=null),$e===B.current?te.current||Ce():(B.current=$e,ce.current=$e,te.current=!0,Oe())};return R.onStateChange=Fe,R.trySubscribe(),Fe(),()=>{if(Le=!0,R.tryUnsubscribe(),R.onStateChange=null,Ne)throw Ne}}function strictEqual(E,y){return E===y}function connect(E,y,R,{pure:k,areStatesEqual:H=strictEqual,areOwnPropsEqual:B=shallowEqual$1,areStatePropsEqual:te=shallowEqual$1,areMergedPropsEqual:ae=shallowEqual$1,forwardRef:ce=!1,context:Ce=ReactReduxContext}={}){const Oe=Ce,Le=mapStateToPropsFactory(E),Ne=mapDispatchToPropsFactory(y),Fe=mergePropsFactory(R),Ue=!!E;return $e=>{const Be=$e.displayName||$e.name||"Component",Ve=`Connect(${Be})`,Ke={shouldHandleStateChanges:Ue,displayName:Ve,wrappedComponentName:Be,WrappedComponent:$e,initMapStateToProps:Le,initMapDispatchToProps:Ne,initMergeProps:Fe,areStatesEqual:H,areStatePropsEqual:te,areOwnPropsEqual:B,areMergedPropsEqual:ae};function st(tt){const[ft,Ye,ot]=React.useMemo(()=>{const{reactReduxForwardedRef:rr,...nr}=tt;return[tt.context,rr,nr]},[tt]),nt=React.useMemo(()=>{let rr=Oe;return ft!=null&&ft.Consumer,rr},[ft,Oe]),pt=React.useContext(nt),dt=!!tt.store&&!!tt.store.getState&&!!tt.store.dispatch,rt=!!pt&&!!pt.store,Qe=dt?tt.store:pt.store,ke=rt?pt.getServerState:Qe.getState,Xe=React.useMemo(()=>finalPropsSelectorFactory(Qe.dispatch,Ke),[Qe]),[qe,Ge]=React.useMemo(()=>{if(!Ue)return NO_SUBSCRIPTION_ARRAY;const rr=createSubscription(Qe,dt?void 0:pt.subscription),nr=rr.notifyNestedSubs.bind(rr);return[rr,nr]},[Qe,dt,pt]),je=React.useMemo(()=>dt?pt:{...pt,subscription:qe},[dt,pt,qe]),He=React.useRef(),Ze=React.useRef(ot),mt=React.useRef(),gt=React.useRef(!1);React.useRef(!1);const vt=React.useRef(!1),Lt=React.useRef();useIsomorphicLayoutEffect(()=>(vt.current=!0,()=>{vt.current=!1}),[]);const Ut=React.useMemo(()=>()=>mt.current&&ot===Ze.current?mt.current:Xe(Qe.getState(),ot),[Qe,ot]),$t=React.useMemo(()=>nr=>qe?subscribeUpdates(Ue,Qe,qe,Xe,Ze,He,gt,vt,mt,Ge,nr):()=>{},[qe]);useIsomorphicLayoutEffectWithArgs(captureWrapperProps,[Ze,He,gt,ot,mt,Ge]);let zt;try{zt=useSyncExternalStore($t,Ut,ke?()=>Xe(ke(),ot):Ut)}catch(rr){throw Lt.current&&(rr.message+=` The error may be correlated with this previous error: ${Lt.current.stack} `),rr}useIsomorphicLayoutEffect(()=>{Lt.current=void 0,mt.current=void 0,He.current=zt});const er=React.useMemo(()=>React.createElement($e,{...zt,ref:Ye}),[Ye,$e,zt]);return React.useMemo(()=>Ue?React.createElement(nt.Provider,{value:je},er):er,[nt,er,je])}const at=React.memo(st);if(at.WrappedComponent=$e,at.displayName=st.displayName=Ve,ce){const ft=React.forwardRef(function(ot,nt){return React.createElement(at,{...ot,reactReduxForwardedRef:nt})});return ft.displayName=Ve,ft.WrappedComponent=$e,hoistNonReactStatics$1(ft,$e)}return hoistNonReactStatics$1(at,$e)}}var connect_default=connect;function Provider$1({store:E,context:y,children:R,serverState:k,stabilityCheck:H="once",identityFunctionCheck:B="once"}){const te=React.useMemo(()=>{const Ce=createSubscription(E);return{store:E,subscription:Ce,getServerState:k?()=>k:void 0,stabilityCheck:H,identityFunctionCheck:B}},[E,k,H,B]),ae=React.useMemo(()=>E.getState(),[E]);useIsomorphicLayoutEffect(()=>{const{subscription:Ce}=te;return Ce.onStateChange=Ce.notifyNestedSubs,Ce.trySubscribe(),ae!==E.getState()&&Ce.notifyNestedSubs(),()=>{Ce.tryUnsubscribe(),Ce.onStateChange=void 0}},[te,ae]);const ce=y||ReactReduxContext;return React.createElement(ce.Provider,{value:te},R)}var Provider_default=Provider$1;function createStoreHook(E=ReactReduxContext){const y=E===ReactReduxContext?useReduxContext:createReduxContextHook(E);return function(){const{store:k}=y();return k}}var useStore$1=createStoreHook();function createDispatchHook(E=ReactReduxContext){const y=E===ReactReduxContext?useStore$1:createStoreHook(E);return function(){return y().dispatch}}var useDispatch=createDispatchHook();initializeUseSelector(withSelectorExports.useSyncExternalStoreWithSelector);initializeConnect(reactExports.useSyncExternalStore);function number$2(E){if(!Number.isSafeInteger(E)||E<0)throw new Error(`Wrong positive integer: ${E}`)}function bytes$3(E,...y){if(!(E instanceof Uint8Array))throw new Error("Expected Uint8Array");if(y.length>0&&!y.includes(E.length))throw new Error(`Expected Uint8Array of length ${y}, not of length=${E.length}`)}function hash$2(E){if(typeof E!="function"||typeof E.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$2(E.outputLen),number$2(E.blockLen)}function exists$2(E,y=!0){if(E.destroyed)throw new Error("Hash instance has been destroyed");if(y&&E.finished)throw new Error("Hash#digest() has already been called")}function output$2(E,y){bytes$3(E);const R=y.outputLen;if(E.lengthE instanceof Uint8Array,createView$2=E=>new DataView(E.buffer,E.byteOffset,E.byteLength),rotr$1=(E,y)=>E<<32-y|E>>>y,isLE$2=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE$2)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes$3(E){if(typeof E!="string")throw new Error(`utf8ToBytes expected string, got ${typeof E}`);return new Uint8Array(new TextEncoder().encode(E))}function toBytes$2(E){if(typeof E=="string"&&(E=utf8ToBytes$3(E)),!u8a$2(E))throw new Error(`expected Uint8Array, got ${typeof E}`);return E}function concatBytes$2(...E){const y=new Uint8Array(E.reduce((k,H)=>k+H.length,0));let R=0;return E.forEach(k=>{if(!u8a$2(k))throw new Error("Uint8Array expected");y.set(k,R),R+=k.length}),y}let Hash$1=class{clone(){return this._cloneInto()}};function wrapConstructor$1(E){const y=k=>E().update(toBytes$2(k)).digest(),R=E();return y.outputLen=R.outputLen,y.blockLen=R.blockLen,y.create=()=>E(),y}function randomBytes$1(E=32){if(crypto$2&&typeof crypto$2.getRandomValues=="function")return crypto$2.getRandomValues(new Uint8Array(E));throw new Error("crypto.getRandomValues must be defined")}function setBigUint64$1(E,y,R,k){if(typeof E.setBigUint64=="function")return E.setBigUint64(y,R,k);const H=BigInt(32),B=BigInt(4294967295),te=Number(R>>H&B),ae=Number(R&B),ce=k?4:0,Ce=k?0:4;E.setUint32(y+ce,te,k),E.setUint32(y+Ce,ae,k)}let SHA2$1=class extends Hash$1{constructor(y,R,k,H){super(),this.blockLen=y,this.outputLen=R,this.padOffset=k,this.isLE=H,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(y),this.view=createView$2(this.buffer)}update(y){exists$2(this);const{view:R,buffer:k,blockLen:H}=this;y=toBytes$2(y);const B=y.length;for(let te=0;teH-te&&(this.process(k,0),te=0);for(let Le=te;LeOe.length)throw new Error("_sha2: outputLen bigger than state");for(let Le=0;LeE&y^~E&R,Maj$1=(E,y,R)=>E&y^E&R^y&R,SHA256_K$1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),IV$1=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W$1=new Uint32Array(64);let SHA256$1=class extends SHA2$1{constructor(){super(64,32,8,!1),this.A=IV$1[0]|0,this.B=IV$1[1]|0,this.C=IV$1[2]|0,this.D=IV$1[3]|0,this.E=IV$1[4]|0,this.F=IV$1[5]|0,this.G=IV$1[6]|0,this.H=IV$1[7]|0}get(){const{A:y,B:R,C:k,D:H,E:B,F:te,G:ae,H:ce}=this;return[y,R,k,H,B,te,ae,ce]}set(y,R,k,H,B,te,ae,ce){this.A=y|0,this.B=R|0,this.C=k|0,this.D=H|0,this.E=B|0,this.F=te|0,this.G=ae|0,this.H=ce|0}process(y,R){for(let Le=0;Le<16;Le++,R+=4)SHA256_W$1[Le]=y.getUint32(R,!1);for(let Le=16;Le<64;Le++){const Ne=SHA256_W$1[Le-15],Fe=SHA256_W$1[Le-2],Ue=rotr$1(Ne,7)^rotr$1(Ne,18)^Ne>>>3,De=rotr$1(Fe,17)^rotr$1(Fe,19)^Fe>>>10;SHA256_W$1[Le]=De+SHA256_W$1[Le-7]+Ue+SHA256_W$1[Le-16]|0}let{A:k,B:H,C:B,D:te,E:ae,F:ce,G:Ce,H:Oe}=this;for(let Le=0;Le<64;Le++){const Ne=rotr$1(ae,6)^rotr$1(ae,11)^rotr$1(ae,25),Fe=Oe+Ne+Chi$1(ae,ce,Ce)+SHA256_K$1[Le]+SHA256_W$1[Le]|0,De=(rotr$1(k,2)^rotr$1(k,13)^rotr$1(k,22))+Maj$1(k,H,B)|0;Oe=Ce,Ce=ce,ce=ae,ae=te+Fe|0,te=B,B=H,H=k,k=Fe+De|0}k=k+this.A|0,H=H+this.B|0,B=B+this.C|0,te=te+this.D|0,ae=ae+this.E|0,ce=ce+this.F|0,Ce=Ce+this.G|0,Oe=Oe+this.H|0,this.set(k,H,B,te,ae,ce,Ce,Oe)}roundClean(){SHA256_W$1.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const sha256$1=wrapConstructor$1(()=>new SHA256$1);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$4=BigInt(0),_1n$4=BigInt(1),_2n$2=BigInt(2),u8a$1=E=>E instanceof Uint8Array,hexes$2=Array.from({length:256},(E,y)=>y.toString(16).padStart(2,"0"));function bytesToHex$2(E){if(!u8a$1(E))throw new Error("Uint8Array expected");let y="";for(let R=0;Rk+H.length,0));let R=0;return E.forEach(k=>{if(!u8a$1(k))throw new Error("Uint8Array expected");y.set(k,R),R+=k.length}),y}function equalBytes$1(E,y){if(E.length!==y.length)return!1;for(let R=0;R_0n$4;E>>=_1n$4,y+=1);return y}function bitGet(E,y){return E>>BigInt(y)&_1n$4}const bitSet=(E,y,R)=>E|(R?_1n$4:_0n$4)<(_2n$2<new Uint8Array(E),u8fr=E=>Uint8Array.from(E);function createHmacDrbg(E,y,R){if(typeof E!="number"||E<2)throw new Error("hashLen must be a number");if(typeof y!="number"||y<2)throw new Error("qByteLen must be a number");if(typeof R!="function")throw new Error("hmacFn must be a function");let k=u8n(E),H=u8n(E),B=0;const te=()=>{k.fill(1),H.fill(0),B=0},ae=(...Le)=>R(H,k,...Le),ce=(Le=u8n())=>{H=ae(u8fr([0]),Le),k=ae(),Le.length!==0&&(H=ae(u8fr([1]),Le),k=ae())},Ce=()=>{if(B++>=1e3)throw new Error("drbg: tried 1000 values");let Le=0;const Ne=[];for(;Le{te(),ce(Le);let Fe;for(;!(Fe=Ne(Ce()));)ce();return te(),Fe}}const validatorFns={bigint:E=>typeof E=="bigint",function:E=>typeof E=="function",boolean:E=>typeof E=="boolean",string:E=>typeof E=="string",stringOrUint8Array:E=>typeof E=="string"||E instanceof Uint8Array,isSafeInteger:E=>Number.isSafeInteger(E),array:E=>Array.isArray(E),field:(E,y)=>y.Fp.isValid(E),hash:E=>typeof E=="function"&&Number.isSafeInteger(E.outputLen)};function validateObject(E,y,R={}){const k=(H,B,te)=>{const ae=validatorFns[B];if(typeof ae!="function")throw new Error(`Invalid validator "${B}", expected function`);const ce=E[H];if(!(te&&ce===void 0)&&!ae(ce,E))throw new Error(`Invalid param ${String(H)}=${ce} (${typeof ce}), expected ${B}`)};for(const[H,B]of Object.entries(y))k(H,B,!1);for(const[H,B]of Object.entries(R))k(H,B,!0);return E}const ut=Object.freeze(Object.defineProperty({__proto__:null,bitGet,bitLen,bitMask,bitSet,bytesToHex:bytesToHex$2,bytesToNumberBE,bytesToNumberLE,concatBytes:concatBytes$1,createHmacDrbg,ensureBytes,equalBytes:equalBytes$1,hexToBytes:hexToBytes$1,hexToNumber,numberToBytesBE,numberToBytesLE,numberToHexUnpadded,numberToVarBytesBE,utf8ToBytes:utf8ToBytes$2,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$3=BigInt(0),_1n$3=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3),_4n=BigInt(4),_5n=BigInt(5),_8n=BigInt(8);BigInt(9);BigInt(16);function mod(E,y){const R=E%y;return R>=_0n$3?R:y+R}function pow(E,y,R){if(R<=_0n$3||y<_0n$3)throw new Error("Expected power/modulo > 0");if(R===_1n$3)return _0n$3;let k=_1n$3;for(;y>_0n$3;)y&_1n$3&&(k=k*E%R),E=E*E%R,y>>=_1n$3;return k}function pow2(E,y,R){let k=E;for(;y-- >_0n$3;)k*=k,k%=R;return k}function invert(E,y){if(E===_0n$3||y<=_0n$3)throw new Error(`invert: expected positive integers, got n=${E} mod=${y}`);let R=mod(E,y),k=y,H=_0n$3,B=_1n$3;for(;R!==_0n$3;){const ae=k/R,ce=k%R,Ce=H-B*ae;k=R,R=ce,H=B,B=Ce}if(k!==_1n$3)throw new Error("invert: does not exist");return mod(H,y)}function tonelliShanks(E){const y=(E-_1n$3)/_2n$1;let R,k,H;for(R=E-_1n$3,k=0;R%_2n$1===_0n$3;R/=_2n$1,k++);for(H=_2n$1;H(k[H]="function",k),y);return validateObject(E,R)}function FpPow(E,y,R){if(R<_0n$3)throw new Error("Expected power > 0");if(R===_0n$3)return E.ONE;if(R===_1n$3)return y;let k=E.ONE,H=y;for(;R>_0n$3;)R&_1n$3&&(k=E.mul(k,H)),H=E.sqr(H),R>>=_1n$3;return k}function FpInvertBatch(E,y){const R=new Array(y.length),k=y.reduce((B,te,ae)=>E.is0(te)?B:(R[ae]=B,E.mul(B,te)),E.ONE),H=E.inv(k);return y.reduceRight((B,te,ae)=>E.is0(te)?B:(R[ae]=E.mul(B,R[ae]),E.mul(B,te)),H),R}function nLength(E,y){const R=y!==void 0?y:E.toString(2).length,k=Math.ceil(R/8);return{nBitLength:R,nByteLength:k}}function Field(E,y,R=!1,k={}){if(E<=_0n$3)throw new Error(`Expected Field ORDER > 0, got ${E}`);const{nBitLength:H,nByteLength:B}=nLength(E,y);if(B>2048)throw new Error("Field lengths over 2048 bytes are not supported");const te=FpSqrt(E),ae=Object.freeze({ORDER:E,BITS:H,BYTES:B,MASK:bitMask(H),ZERO:_0n$3,ONE:_1n$3,create:ce=>mod(ce,E),isValid:ce=>{if(typeof ce!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof ce}`);return _0n$3<=ce&&cece===_0n$3,isOdd:ce=>(ce&_1n$3)===_1n$3,neg:ce=>mod(-ce,E),eql:(ce,Ce)=>ce===Ce,sqr:ce=>mod(ce*ce,E),add:(ce,Ce)=>mod(ce+Ce,E),sub:(ce,Ce)=>mod(ce-Ce,E),mul:(ce,Ce)=>mod(ce*Ce,E),pow:(ce,Ce)=>FpPow(ae,ce,Ce),div:(ce,Ce)=>mod(ce*invert(Ce,E),E),sqrN:ce=>ce*ce,addN:(ce,Ce)=>ce+Ce,subN:(ce,Ce)=>ce-Ce,mulN:(ce,Ce)=>ce*Ce,inv:ce=>invert(ce,E),sqrt:k.sqrt||(ce=>te(ae,ce)),invertBatch:ce=>FpInvertBatch(ae,ce),cmov:(ce,Ce,Oe)=>Oe?Ce:ce,toBytes:ce=>R?numberToBytesLE(ce,B):numberToBytesBE(ce,B),fromBytes:ce=>{if(ce.length!==B)throw new Error(`Fp.fromBytes: expected ${B}, got ${ce.length}`);return R?bytesToNumberLE(ce):bytesToNumberBE(ce)}});return Object.freeze(ae)}function getFieldBytesLength(E){if(typeof E!="bigint")throw new Error("field order must be bigint");const y=E.toString(2).length;return Math.ceil(y/8)}function getMinHashLength(E){const y=getFieldBytesLength(E);return y+Math.ceil(y/2)}function mapHashToField(E,y,R=!1){const k=E.length,H=getFieldBytesLength(y),B=getMinHashLength(y);if(k<16||k1024)throw new Error(`expected ${B}-1024 bytes of input, got ${k}`);const te=R?bytesToNumberBE(E):bytesToNumberLE(E),ae=mod(te,y-_1n$3)+_1n$3;return R?numberToBytesLE(ae,H):numberToBytesBE(ae,H)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$2=BigInt(1);function wNAF(E,y){const R=(H,B)=>{const te=B.negate();return H?te:B},k=H=>{const B=Math.ceil(y/H)+1,te=2**(H-1);return{windows:B,windowSize:te}};return{constTimeNegate:R,unsafeLadder(H,B){let te=E.ZERO,ae=H;for(;B>_0n$2;)B&_1n$2&&(te=te.add(ae)),ae=ae.double(),B>>=_1n$2;return te},precomputeWindow(H,B){const{windows:te,windowSize:ae}=k(B),ce=[];let Ce=H,Oe=Ce;for(let Le=0;Le>=Fe,$e>ce&&($e-=Ne,te+=_1n$2);const Be=De,Ve=De+Math.abs($e)-1,Ke=Ue%2!==0,st=$e<0;$e===0?Oe=Oe.add(R(Ke,B[Be])):Ce=Ce.add(R(st,B[Ve]))}return{p:Ce,f:Oe}},wNAFCached(H,B,te,ae){const ce=H._WINDOW_SIZE||1;let Ce=B.get(H);return Ce||(Ce=this.precomputeWindow(H,ce),ce!==1&&B.set(H,ae(Ce))),this.wNAF(ce,Ce,te)}}}function validateBasic(E){return validateField(E.Fp),validateObject(E,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(E.n,E.nBitLength),...E,p:E.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validatePointOpts(E){const y=validateBasic(E);validateObject(y,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:R,Fp:k,a:H}=y;if(R){if(!k.eql(H,k.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof R!="object"||typeof R.beta!="bigint"||typeof R.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...y})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut,DER={Err:class extends Error{constructor(y=""){super(y)}},_parseInt(E){const{Err:y}=DER;if(E.length<2||E[0]!==2)throw new y("Invalid signature integer tag");const R=E[1],k=E.subarray(2,R+2);if(!R||k.length!==R)throw new y("Invalid signature integer: wrong length");if(k[0]&128)throw new y("Invalid signature integer: negative");if(k[0]===0&&!(k[1]&128))throw new y("Invalid signature integer: unnecessary leading zero");return{d:b2n(k),l:E.subarray(R+2)}},toSig(E){const{Err:y}=DER,R=typeof E=="string"?h2b(E):E;if(!(R instanceof Uint8Array))throw new Error("ui8a expected");let k=R.length;if(k<2||R[0]!=48)throw new y("Invalid signature tag");if(R[1]!==k-2)throw new y("Invalid signature: incorrect length");const{d:H,l:B}=DER._parseInt(R.subarray(2)),{d:te,l:ae}=DER._parseInt(B);if(ae.length)throw new y("Invalid signature: left bytes after parsing");return{r:H,s:te}},hexFromSig(E){const y=Ce=>Number.parseInt(Ce[0],16)&8?"00"+Ce:Ce,R=Ce=>{const Oe=Ce.toString(16);return Oe.length&1?`0${Oe}`:Oe},k=y(R(E.s)),H=y(R(E.r)),B=k.length/2,te=H.length/2,ae=R(B),ce=R(te);return`30${R(te+B+4)}02${ce}${H}02${ae}${k}`}},_0n$1=BigInt(0),_1n$1=BigInt(1);BigInt(2);const _3n=BigInt(3);BigInt(4);function weierstrassPoints(E){const y=validatePointOpts(E),{Fp:R}=y,k=y.toBytes||((Ue,De,$e)=>{const Be=De.toAffine();return concatBytes$1(Uint8Array.from([4]),R.toBytes(Be.x),R.toBytes(Be.y))}),H=y.fromBytes||(Ue=>{const De=Ue.subarray(1),$e=R.fromBytes(De.subarray(0,R.BYTES)),Be=R.fromBytes(De.subarray(R.BYTES,2*R.BYTES));return{x:$e,y:Be}});function B(Ue){const{a:De,b:$e}=y,Be=R.sqr(Ue),Ve=R.mul(Be,Ue);return R.add(R.add(Ve,R.mul(Ue,De)),$e)}if(!R.eql(R.sqr(y.Gy),B(y.Gx)))throw new Error("bad generator point: equation left != right");function te(Ue){return typeof Ue=="bigint"&&_0n$1R.eql(Ke,R.ZERO);return Ve($e)&&Ve(Be)?Le.ZERO:new Le($e,Be,R.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(De){const $e=R.invertBatch(De.map(Be=>Be.pz));return De.map((Be,Ve)=>Be.toAffine($e[Ve])).map(Le.fromAffine)}static fromHex(De){const $e=Le.fromAffine(H(ensureBytes("pointHex",De)));return $e.assertValidity(),$e}static fromPrivateKey(De){return Le.BASE.multiply(ce(De))}_setWindowSize(De){this._WINDOW_SIZE=De,Ce.delete(this)}assertValidity(){if(this.is0()){if(y.allowInfinityPoint&&!R.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:De,y:$e}=this.toAffine();if(!R.isValid(De)||!R.isValid($e))throw new Error("bad point: x or y not FE");const Be=R.sqr($e),Ve=B(De);if(!R.eql(Be,Ve))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:De}=this.toAffine();if(R.isOdd)return!R.isOdd(De);throw new Error("Field doesn't support isOdd")}equals(De){Oe(De);const{px:$e,py:Be,pz:Ve}=this,{px:Ke,py:st,pz:We}=De,at=R.eql(R.mul($e,We),R.mul(Ke,Ve)),tt=R.eql(R.mul(Be,We),R.mul(st,Ve));return at&&tt}negate(){return new Le(this.px,R.neg(this.py),this.pz)}double(){const{a:De,b:$e}=y,Be=R.mul($e,_3n),{px:Ve,py:Ke,pz:st}=this;let We=R.ZERO,at=R.ZERO,tt=R.ZERO,ft=R.mul(Ve,Ve),Ye=R.mul(Ke,Ke),ot=R.mul(st,st),nt=R.mul(Ve,Ke);return nt=R.add(nt,nt),tt=R.mul(Ve,st),tt=R.add(tt,tt),We=R.mul(De,tt),at=R.mul(Be,ot),at=R.add(We,at),We=R.sub(Ye,at),at=R.add(Ye,at),at=R.mul(We,at),We=R.mul(nt,We),tt=R.mul(Be,tt),ot=R.mul(De,ot),nt=R.sub(ft,ot),nt=R.mul(De,nt),nt=R.add(nt,tt),tt=R.add(ft,ft),ft=R.add(tt,ft),ft=R.add(ft,ot),ft=R.mul(ft,nt),at=R.add(at,ft),ot=R.mul(Ke,st),ot=R.add(ot,ot),ft=R.mul(ot,nt),We=R.sub(We,ft),tt=R.mul(ot,Ye),tt=R.add(tt,tt),tt=R.add(tt,tt),new Le(We,at,tt)}add(De){Oe(De);const{px:$e,py:Be,pz:Ve}=this,{px:Ke,py:st,pz:We}=De;let at=R.ZERO,tt=R.ZERO,ft=R.ZERO;const Ye=y.a,ot=R.mul(y.b,_3n);let nt=R.mul($e,Ke),pt=R.mul(Be,st),dt=R.mul(Ve,We),rt=R.add($e,Be),Qe=R.add(Ke,st);rt=R.mul(rt,Qe),Qe=R.add(nt,pt),rt=R.sub(rt,Qe),Qe=R.add($e,Ve);let ke=R.add(Ke,We);return Qe=R.mul(Qe,ke),ke=R.add(nt,dt),Qe=R.sub(Qe,ke),ke=R.add(Be,Ve),at=R.add(st,We),ke=R.mul(ke,at),at=R.add(pt,dt),ke=R.sub(ke,at),ft=R.mul(Ye,Qe),at=R.mul(ot,dt),ft=R.add(at,ft),at=R.sub(pt,ft),ft=R.add(pt,ft),tt=R.mul(at,ft),pt=R.add(nt,nt),pt=R.add(pt,nt),dt=R.mul(Ye,dt),Qe=R.mul(ot,Qe),pt=R.add(pt,dt),dt=R.sub(nt,dt),dt=R.mul(Ye,dt),Qe=R.add(Qe,dt),nt=R.mul(pt,Qe),tt=R.add(tt,nt),nt=R.mul(ke,Qe),at=R.mul(rt,at),at=R.sub(at,nt),nt=R.mul(rt,pt),ft=R.mul(ke,ft),ft=R.add(ft,nt),new Le(at,tt,ft)}subtract(De){return this.add(De.negate())}is0(){return this.equals(Le.ZERO)}wNAF(De){return Fe.wNAFCached(this,Ce,De,$e=>{const Be=R.invertBatch($e.map(Ve=>Ve.pz));return $e.map((Ve,Ke)=>Ve.toAffine(Be[Ke])).map(Le.fromAffine)})}multiplyUnsafe(De){const $e=Le.ZERO;if(De===_0n$1)return $e;if(ae(De),De===_1n$1)return this;const{endo:Be}=y;if(!Be)return Fe.unsafeLadder(this,De);let{k1neg:Ve,k1:Ke,k2neg:st,k2:We}=Be.splitScalar(De),at=$e,tt=$e,ft=this;for(;Ke>_0n$1||We>_0n$1;)Ke&_1n$1&&(at=at.add(ft)),We&_1n$1&&(tt=tt.add(ft)),ft=ft.double(),Ke>>=_1n$1,We>>=_1n$1;return Ve&&(at=at.negate()),st&&(tt=tt.negate()),tt=new Le(R.mul(tt.px,Be.beta),tt.py,tt.pz),at.add(tt)}multiply(De){ae(De);let $e=De,Be,Ve;const{endo:Ke}=y;if(Ke){const{k1neg:st,k1:We,k2neg:at,k2:tt}=Ke.splitScalar($e);let{p:ft,f:Ye}=this.wNAF(We),{p:ot,f:nt}=this.wNAF(tt);ft=Fe.constTimeNegate(st,ft),ot=Fe.constTimeNegate(at,ot),ot=new Le(R.mul(ot.px,Ke.beta),ot.py,ot.pz),Be=ft.add(ot),Ve=Ye.add(nt)}else{const{p:st,f:We}=this.wNAF($e);Be=st,Ve=We}return Le.normalizeZ([Be,Ve])[0]}multiplyAndAddUnsafe(De,$e,Be){const Ve=Le.BASE,Ke=(We,at)=>at===_0n$1||at===_1n$1||!We.equals(Ve)?We.multiplyUnsafe(at):We.multiply(at),st=Ke(this,$e).add(Ke(De,Be));return st.is0()?void 0:st}toAffine(De){const{px:$e,py:Be,pz:Ve}=this,Ke=this.is0();De==null&&(De=Ke?R.ONE:R.inv(Ve));const st=R.mul($e,De),We=R.mul(Be,De),at=R.mul(Ve,De);if(Ke)return{x:R.ZERO,y:R.ZERO};if(!R.eql(at,R.ONE))throw new Error("invZ was invalid");return{x:st,y:We}}isTorsionFree(){const{h:De,isTorsionFree:$e}=y;if(De===_1n$1)return!0;if($e)return $e(Le,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:De,clearCofactor:$e}=y;return De===_1n$1?this:$e?$e(Le,this):this.multiplyUnsafe(y.h)}toRawBytes(De=!0){return this.assertValidity(),k(Le,this,De)}toHex(De=!0){return bytesToHex$2(this.toRawBytes(De))}}Le.BASE=new Le(y.Gx,y.Gy,R.ONE),Le.ZERO=new Le(R.ZERO,R.ONE,R.ZERO);const Ne=y.nBitLength,Fe=wNAF(Le,y.endo?Math.ceil(Ne/2):Ne);return{CURVE:y,ProjectivePoint:Le,normPrivateKeyToScalar:ce,weierstrassEquation:B,isWithinCurveOrder:te}}function validateOpts(E){const y=validateBasic(E);return validateObject(y,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...y})}function weierstrass(E){const y=validateOpts(E),{Fp:R,n:k}=y,H=R.BYTES+1,B=2*R.BYTES+1;function te(Qe){return _0n$1bytesToHex$2(numberToBytesBE(Qe,y.nByteLength));function Ue(Qe){const ke=k>>_1n$1;return Qe>ke}function De(Qe){return Ue(Qe)?ae(-Qe):Qe}const $e=(Qe,ke,Xe)=>bytesToNumberBE(Qe.slice(ke,Xe));class Be{constructor(ke,Xe,qe){this.r=ke,this.s=Xe,this.recovery=qe,this.assertValidity()}static fromCompact(ke){const Xe=y.nByteLength;return ke=ensureBytes("compactSignature",ke,Xe*2),new Be($e(ke,0,Xe),$e(ke,Xe,2*Xe))}static fromDER(ke){const{r:Xe,s:qe}=DER.toSig(ensureBytes("DER",ke));return new Be(Xe,qe)}assertValidity(){if(!Ne(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!Ne(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(ke){return new Be(this.r,this.s,ke)}recoverPublicKey(ke){const{r:Xe,s:qe,recovery:Ge}=this,je=tt(ensureBytes("msgHash",ke));if(Ge==null||![0,1,2,3].includes(Ge))throw new Error("recovery id invalid");const He=Ge===2||Ge===3?Xe+y.n:Xe;if(He>=R.ORDER)throw new Error("recovery id 2 or 3 invalid");const Ze=Ge&1?"03":"02",mt=Ce.fromHex(Ze+Fe(He)),gt=ce(He),vt=ae(-je*gt),Lt=ae(qe*gt),Ut=Ce.BASE.multiplyAndAddUnsafe(mt,vt,Lt);if(!Ut)throw new Error("point at infinify");return Ut.assertValidity(),Ut}hasHighS(){return Ue(this.s)}normalizeS(){return this.hasHighS()?new Be(this.r,ae(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes$1(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes$1(this.toCompactHex())}toCompactHex(){return Fe(this.r)+Fe(this.s)}}const Ve={isValidPrivateKey(Qe){try{return Oe(Qe),!0}catch{return!1}},normPrivateKeyToScalar:Oe,randomPrivateKey:()=>{const Qe=getMinHashLength(y.n);return mapHashToField(y.randomBytes(Qe),y.n)},precompute(Qe=8,ke=Ce.BASE){return ke._setWindowSize(Qe),ke.multiply(BigInt(3)),ke}};function Ke(Qe,ke=!0){return Ce.fromPrivateKey(Qe).toRawBytes(ke)}function st(Qe){const ke=Qe instanceof Uint8Array,Xe=typeof Qe=="string",qe=(ke||Xe)&&Qe.length;return ke?qe===H||qe===B:Xe?qe===2*H||qe===2*B:Qe instanceof Ce}function We(Qe,ke,Xe=!0){if(st(Qe))throw new Error("first arg must be private key");if(!st(ke))throw new Error("second arg must be public key");return Ce.fromHex(ke).multiply(Oe(Qe)).toRawBytes(Xe)}const at=y.bits2int||function(Qe){const ke=bytesToNumberBE(Qe),Xe=Qe.length*8-y.nBitLength;return Xe>0?ke>>BigInt(Xe):ke},tt=y.bits2int_modN||function(Qe){return ae(at(Qe))},ft=bitMask(y.nBitLength);function Ye(Qe){if(typeof Qe!="bigint")throw new Error("bigint expected");if(!(_0n$1<=Qe&&Qezt in Xe))throw new Error("sign() legacy options not supported");const{hash:qe,randomBytes:Ge}=y;let{lowS:je,prehash:He,extraEntropy:Ze}=Xe;je==null&&(je=!0),Qe=ensureBytes("msgHash",Qe),He&&(Qe=ensureBytes("prehashed msgHash",qe(Qe)));const mt=tt(Qe),gt=Oe(ke),vt=[Ye(gt),Ye(mt)];if(Ze!=null){const zt=Ze===!0?Ge(R.BYTES):Ze;vt.push(ensureBytes("extraEntropy",zt))}const Lt=concatBytes$1(...vt),Ut=mt;function $t(zt){const er=at(zt);if(!Ne(er))return;const Pn=ce(er),rr=Ce.BASE.multiply(er).toAffine(),nr=ae(rr.x);if(nr===_0n$1)return;const on=ae(Pn*ae(Ut+nr*gt));if(on===_0n$1)return;let Vo=(rr.x===nr?0:2)|Number(rr.y&_1n$1),io=on;return je&&Ue(on)&&(io=De(on),Vo^=1),new Be(nr,io,Vo)}return{seed:Lt,k2sig:$t}}const nt={lowS:y.lowS,prehash:!1},pt={lowS:y.lowS,prehash:!1};function dt(Qe,ke,Xe=nt){const{seed:qe,k2sig:Ge}=ot(Qe,ke,Xe),je=y;return createHmacDrbg(je.hash.outputLen,je.nByteLength,je.hmac)(qe,Ge)}Ce.BASE._setWindowSize(8);function rt(Qe,ke,Xe,qe=pt){var rr;const Ge=Qe;if(ke=ensureBytes("msgHash",ke),Xe=ensureBytes("publicKey",Xe),"strict"in qe)throw new Error("options.strict was renamed to lowS");const{lowS:je,prehash:He}=qe;let Ze,mt;try{if(typeof Ge=="string"||Ge instanceof Uint8Array)try{Ze=Be.fromDER(Ge)}catch(nr){if(!(nr instanceof DER.Err))throw nr;Ze=Be.fromCompact(Ge)}else if(typeof Ge=="object"&&typeof Ge.r=="bigint"&&typeof Ge.s=="bigint"){const{r:nr,s:on}=Ge;Ze=new Be(nr,on)}else throw new Error("PARSE");mt=Ce.fromHex(Xe)}catch(nr){if(nr.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(je&&Ze.hasHighS())return!1;He&&(ke=y.hash(ke));const{r:gt,s:vt}=Ze,Lt=tt(ke),Ut=ce(vt),$t=ae(Lt*Ut),zt=ae(gt*Ut),er=(rr=Ce.BASE.multiplyAndAddUnsafe(mt,$t,zt))==null?void 0:rr.toAffine();return er?ae(er.x)===gt:!1}return{CURVE:y,getPublicKey:Ke,getSharedSecret:We,sign:dt,verify:rt,ProjectivePoint:Ce,Signature:Be,utils:Ve}}let HMAC$1=class extends Hash$1{constructor(y,R){super(),this.finished=!1,this.destroyed=!1,hash$2(y);const k=toBytes$2(R);if(this.iHash=y.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const H=this.blockLen,B=new Uint8Array(H);B.set(k.length>H?y.create().update(k).digest():k);for(let te=0;tenew HMAC$1(E,y).update(R).digest();hmac$1.create=(E,y)=>new HMAC$1(E,y);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(E){return{hash:E,hmac:(y,...R)=>hmac$1(E,y,concatBytes$2(...R)),randomBytes:randomBytes$1}}function createCurve(E,y){const R=k=>weierstrass({...E,...getHash(k)});return Object.freeze({...R(y),create:R})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n=BigInt(1),_2n=BigInt(2),divNearest=(E,y)=>(E+y/_2n)/y;function sqrtMod(E){const y=secp256k1P,R=BigInt(3),k=BigInt(6),H=BigInt(11),B=BigInt(22),te=BigInt(23),ae=BigInt(44),ce=BigInt(88),Ce=E*E*E%y,Oe=Ce*Ce*E%y,Le=pow2(Oe,R,y)*Oe%y,Ne=pow2(Le,R,y)*Oe%y,Fe=pow2(Ne,_2n,y)*Ce%y,Ue=pow2(Fe,H,y)*Fe%y,De=pow2(Ue,B,y)*Ue%y,$e=pow2(De,ae,y)*De%y,Be=pow2($e,ce,y)*$e%y,Ve=pow2(Be,ae,y)*De%y,Ke=pow2(Ve,R,y)*Oe%y,st=pow2(Ke,te,y)*Ue%y,We=pow2(st,k,y)*Ce%y,at=pow2(We,_2n,y);if(!Fp.eql(Fp.sqr(at),E))throw new Error("Cannot find square root");return at}const Fp=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:E=>{const y=secp256k1N,R=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),k=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),H=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),B=R,te=BigInt("0x100000000000000000000000000000000"),ae=divNearest(B*E,y),ce=divNearest(-k*E,y);let Ce=mod(E-ae*R-ce*H,y),Oe=mod(-ae*k-ce*B,y);const Le=Ce>te,Ne=Oe>te;if(Le&&(Ce=y-Ce),Ne&&(Oe=y-Oe),Ce>te||Oe>te)throw new Error("splitScalar: Endomorphism failed, k="+E);return{k1neg:Le,k1:Ce,k2neg:Ne,k2:Oe}}}},sha256$1),_0n=BigInt(0),fe$1=E=>typeof E=="bigint"&&_0ntypeof E=="bigint"&&_0nH.charCodeAt(0)));R=concatBytes$1(k,k),TAGGED_HASH_PREFIXES[E]=R}return sha256$1(concatBytes$1(R,...y))}const pointToBytes=E=>E.toRawBytes(!0).slice(1),numTo32b=E=>numberToBytesBE(E,32),modP=E=>mod(E,secp256k1P),modN=E=>mod(E,secp256k1N),Point=secp256k1.ProjectivePoint,GmulAdd=(E,y,R)=>Point.BASE.multiplyAndAddUnsafe(E,y,R);function schnorrGetExtPubKey(E){let y=secp256k1.utils.normPrivateKeyToScalar(E),R=Point.fromPrivateKey(y);return{scalar:R.hasEvenY()?y:modN(-y),bytes:pointToBytes(R)}}function lift_x(E){if(!fe$1(E))throw new Error("bad x: need 0 < x < p");const y=modP(E*E),R=modP(y*E+BigInt(7));let k=sqrtMod(R);k%_2n!==_0n&&(k=modP(-k));const H=new Point(E,k,_1n);return H.assertValidity(),H}function challenge(...E){return modN(bytesToNumberBE(taggedHash("BIP0340/challenge",...E)))}function schnorrGetPublicKey(E){return schnorrGetExtPubKey(E).bytes}function schnorrSign(E,y,R=randomBytes$1(32)){const k=ensureBytes("message",E),{bytes:H,scalar:B}=schnorrGetExtPubKey(y),te=ensureBytes("auxRand",R,32),ae=numTo32b(B^bytesToNumberBE(taggedHash("BIP0340/aux",te))),ce=taggedHash("BIP0340/nonce",ae,H,k),Ce=modN(bytesToNumberBE(ce));if(Ce===_0n)throw new Error("sign failed: k is zero");const{bytes:Oe,scalar:Le}=schnorrGetExtPubKey(Ce),Ne=challenge(Oe,H,k),Fe=new Uint8Array(64);if(Fe.set(Oe,0),Fe.set(numTo32b(modN(Le+Ne*B)),32),!schnorrVerify(Fe,k,H))throw new Error("sign: Invalid signature produced");return Fe}function schnorrVerify(E,y,R){const k=ensureBytes("signature",E,64),H=ensureBytes("message",y),B=ensureBytes("publicKey",R,32);try{const te=lift_x(bytesToNumberBE(B)),ae=bytesToNumberBE(k.subarray(0,32));if(!fe$1(ae))return!1;const ce=bytesToNumberBE(k.subarray(32,64));if(!ge$1(ce))return!1;const Ce=challenge(numTo32b(ae),pointToBytes(te),H),Oe=GmulAdd(te,ce,modN(-Ce));return!(!Oe||!Oe.hasEvenY()||Oe.toAffine().x!==ae)}catch{return!1}}const schnorr={getPublicKey:schnorrGetPublicKey,sign:schnorrSign,verify:schnorrVerify,utils:{randomPrivateKey:secp256k1.utils.randomPrivateKey,lift_x,pointToBytes,numberToBytesBE,bytesToNumberBE,taggedHash,mod}},crypto$1=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u8a=E=>E instanceof Uint8Array,createView$1=E=>new DataView(E.buffer,E.byteOffset,E.byteLength),rotr=(E,y)=>E<<32-y|E>>>y,isLE$1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE$1)throw new Error("Non little-endian hardware is not supported");const hexes$1=Array.from({length:256},(E,y)=>y.toString(16).padStart(2,"0"));function bytesToHex$1(E){if(!u8a(E))throw new Error("Uint8Array expected");let y="";for(let R=0;Rk+H.length,0));let R=0;return E.forEach(k=>{if(!u8a(k))throw new Error("Uint8Array expected");y.set(k,R),R+=k.length}),y}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(E){const y=k=>E().update(toBytes$1(k)).digest(),R=E();return y.outputLen=R.outputLen,y.blockLen=R.blockLen,y.create=()=>E(),y}function randomBytes(E=32){if(crypto$1&&typeof crypto$1.getRandomValues=="function")return crypto$1.getRandomValues(new Uint8Array(E));throw new Error("crypto.getRandomValues must be defined")}function number$1(E){if(!Number.isSafeInteger(E)||E<0)throw new Error(`Wrong positive integer: ${E}`)}function bool$1(E){if(typeof E!="boolean")throw new Error(`Expected boolean, not ${E}`)}function bytes$2(E,...y){if(!(E instanceof Uint8Array))throw new Error("Expected Uint8Array");if(y.length>0&&!y.includes(E.length))throw new Error(`Expected Uint8Array of length ${y}, not of length=${E.length}`)}function hash$1(E){if(typeof E!="function"||typeof E.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$1(E.outputLen),number$1(E.blockLen)}function exists$1(E,y=!0){if(E.destroyed)throw new Error("Hash instance has been destroyed");if(y&&E.finished)throw new Error("Hash#digest() has already been called")}function output$1(E,y){bytes$2(E);const R=y.outputLen;if(E.length>H&B),ae=Number(R&B),ce=k?4:0,Ce=k?0:4;E.setUint32(y+ce,te,k),E.setUint32(y+Ce,ae,k)}class SHA2 extends Hash{constructor(y,R,k,H){super(),this.blockLen=y,this.outputLen=R,this.padOffset=k,this.isLE=H,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(y),this.view=createView$1(this.buffer)}update(y){assert.exists(this);const{view:R,buffer:k,blockLen:H}=this;y=toBytes$1(y);const B=y.length;for(let te=0;teH-te&&(this.process(k,0),te=0);for(let Le=te;LeOe.length)throw new Error("_sha2: outputLen bigger than state");for(let Le=0;LeE&y^~E&R,Maj=(E,y,R)=>E&y^E&R^y&R,SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:y,B:R,C:k,D:H,E:B,F:te,G:ae,H:ce}=this;return[y,R,k,H,B,te,ae,ce]}set(y,R,k,H,B,te,ae,ce){this.A=y|0,this.B=R|0,this.C=k|0,this.D=H|0,this.E=B|0,this.F=te|0,this.G=ae|0,this.H=ce|0}process(y,R){for(let Le=0;Le<16;Le++,R+=4)SHA256_W[Le]=y.getUint32(R,!1);for(let Le=16;Le<64;Le++){const Ne=SHA256_W[Le-15],Fe=SHA256_W[Le-2],Ue=rotr(Ne,7)^rotr(Ne,18)^Ne>>>3,De=rotr(Fe,17)^rotr(Fe,19)^Fe>>>10;SHA256_W[Le]=De+SHA256_W[Le-7]+Ue+SHA256_W[Le-16]|0}let{A:k,B:H,C:B,D:te,E:ae,F:ce,G:Ce,H:Oe}=this;for(let Le=0;Le<64;Le++){const Ne=rotr(ae,6)^rotr(ae,11)^rotr(ae,25),Fe=Oe+Ne+Chi(ae,ce,Ce)+SHA256_K[Le]+SHA256_W[Le]|0,De=(rotr(k,2)^rotr(k,13)^rotr(k,22))+Maj(k,H,B)|0;Oe=Ce,Ce=ce,ce=ae,ae=te+Fe|0,te=B,B=H,H=k,k=Fe+De|0}k=k+this.A|0,H=H+this.B|0,B=B+this.C|0,te=te+this.D|0,ae=ae+this.E|0,ce=ce+this.F|0,Ce=Ce+this.G|0,Oe=Oe+this.H|0,this.set(k,H,B,te,ae,ce,Ce,Oe)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const sha256=wrapConstructor(()=>new SHA256);wrapConstructor(()=>new SHA224);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function assertNumber(E){if(!Number.isSafeInteger(E))throw new Error(`Wrong integer: ${E}`)}function chain(...E){const y=(H,B)=>te=>H(B(te)),R=Array.from(E).reverse().reduce((H,B)=>H?y(H,B.encode):B.encode,void 0),k=E.reduce((H,B)=>H?y(H,B.decode):B.decode,void 0);return{encode:R,decode:k}}function alphabet(E){return{encode:y=>{if(!Array.isArray(y)||y.length&&typeof y[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return y.map(R=>{if(assertNumber(R),R<0||R>=E.length)throw new Error(`Digit index outside alphabet: ${R} (alphabet: ${E.length})`);return E[R]})},decode:y=>{if(!Array.isArray(y)||y.length&&typeof y[0]!="string")throw new Error("alphabet.decode input should be array of strings");return y.map(R=>{if(typeof R!="string")throw new Error(`alphabet.decode: not string element=${R}`);const k=E.indexOf(R);if(k===-1)throw new Error(`Unknown letter: "${R}". Allowed: ${E}`);return k})}}}function join(E=""){if(typeof E!="string")throw new Error("join separator should be string");return{encode:y=>{if(!Array.isArray(y)||y.length&&typeof y[0]!="string")throw new Error("join.encode input should be array of strings");for(let R of y)if(typeof R!="string")throw new Error(`join.encode: non-string input=${R}`);return y.join(E)},decode:y=>{if(typeof y!="string")throw new Error("join.decode input should be string");return y.split(E)}}}function padding(E,y="="){if(assertNumber(E),typeof y!="string")throw new Error("padding chr should be string");return{encode(R){if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("padding.encode input should be array of strings");for(let k of R)if(typeof k!="string")throw new Error(`padding.encode: non-string input=${k}`);for(;R.length*E%8;)R.push(y);return R},decode(R){if(!Array.isArray(R)||R.length&&typeof R[0]!="string")throw new Error("padding.encode input should be array of strings");for(let H of R)if(typeof H!="string")throw new Error(`padding.decode: non-string input=${H}`);let k=R.length;if(k*E%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;k>0&&R[k-1]===y;k--)if(!((k-1)*E%8))throw new Error("Invalid padding: string has too much padding");return R.slice(0,k)}}}function normalize(E){if(typeof E!="function")throw new Error("normalize fn should be function");return{encode:y=>y,decode:y=>E(y)}}function convertRadix(E,y,R){if(y<2)throw new Error(`convertRadix: wrong from=${y}, base cannot be less than 2`);if(R<2)throw new Error(`convertRadix: wrong to=${R}, base cannot be less than 2`);if(!Array.isArray(E))throw new Error("convertRadix: data should be array");if(!E.length)return[];let k=0;const H=[],B=Array.from(E);for(B.forEach(te=>{if(assertNumber(te),te<0||te>=y)throw new Error(`Wrong integer: ${te}`)});;){let te=0,ae=!0;for(let ce=k;cey?gcd(y,E%y):E,radix2carry=(E,y)=>E+(y-gcd(E,y));function convertRadix2(E,y,R,k){if(!Array.isArray(E))throw new Error("convertRadix2: data should be array");if(y<=0||y>32)throw new Error(`convertRadix2: wrong from=${y}`);if(R<=0||R>32)throw new Error(`convertRadix2: wrong to=${R}`);if(radix2carry(y,R)>32)throw new Error(`convertRadix2: carry overflow from=${y} to=${R} carryBits=${radix2carry(y,R)}`);let H=0,B=0;const te=2**R-1,ae=[];for(const ce of E){if(assertNumber(ce),ce>=2**y)throw new Error(`convertRadix2: invalid data word=${ce} from=${y}`);if(H=H<32)throw new Error(`convertRadix2: carry overflow pos=${B} from=${y}`);for(B+=y;B>=R;B-=R)ae.push((H>>B-R&te)>>>0);H&=2**B-1}if(H=H<=y)throw new Error("Excess padding");if(!k&&H)throw new Error(`Non-zero padding: ${H}`);return k&&B>0&&ae.push(H>>>0),ae}function radix(E){return assertNumber(E),{encode:y=>{if(!(y instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return convertRadix(Array.from(y),2**8,E)},decode:y=>{if(!Array.isArray(y)||y.length&&typeof y[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(convertRadix(y,E,2**8))}}}function radix2(E,y=!1){if(assertNumber(E),E<=0||E>32)throw new Error("radix2: bits should be in (0..32]");if(radix2carry(8,E)>32||radix2carry(E,8)>32)throw new Error("radix2: carry overflow");return{encode:R=>{if(!(R instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return convertRadix2(Array.from(R),8,E,!y)},decode:R=>{if(!Array.isArray(R)||R.length&&typeof R[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(convertRadix2(R,E,8,y))}}}function unsafeWrapper(E){if(typeof E!="function")throw new Error("unsafeWrapper fn should be function");return function(...y){try{return E.apply(null,y)}catch{}}}const base16=chain(radix2(4),alphabet("0123456789ABCDEF"),join("")),base32=chain(radix2(5),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),padding(5),join(""));chain(radix2(5),alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV"),padding(5),join(""));chain(radix2(5),alphabet("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),join(""),normalize(E=>E.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const base64=chain(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),padding(6),join("")),base64url=chain(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),padding(6),join("")),genBase58=E=>chain(radix(58),alphabet(E),join("")),base58=genBase58("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");genBase58("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");genBase58("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const XMR_BLOCK_LEN=[0,2,3,5,6,7,9,10,11],base58xmr={encode(E){let y="";for(let R=0;R>25;let R=(E&33554431)<<5;for(let k=0;k>k&1)===1&&(R^=POLYMOD_GENERATORS[k]);return R}function bechChecksum(E,y,R=1){const k=E.length;let H=1;for(let B=0;B126)throw new Error(`Invalid prefix (${E})`);H=bech32Polymod(H)^te>>5}H=bech32Polymod(H);for(let B=0;BNe)throw new TypeError(`Length ${Fe} exceeds limit ${Ne}`);return Oe=Oe.toLowerCase(),`${Oe}1${BECH_ALPHABET.encode(Le)}${bechChecksum(Oe,Le,y)}`}function ae(Oe,Le=90){if(typeof Oe!="string")throw new Error(`bech32.decode input should be string, not ${typeof Oe}`);if(Oe.length<8||Le!==!1&&Oe.length>Le)throw new TypeError(`Wrong string length: ${Oe.length} (${Oe}). Expected (8..${Le})`);const Ne=Oe.toLowerCase();if(Oe!==Ne&&Oe!==Oe.toUpperCase())throw new Error("String must be lowercase or uppercase");Oe=Ne;const Fe=Oe.lastIndexOf("1");if(Fe===0||Fe===-1)throw new Error('Letter "1" must be present between prefix and data only');const Ue=Oe.slice(0,Fe),De=Oe.slice(Fe+1);if(De.length<6)throw new Error("Data must be at least 6 characters long");const $e=BECH_ALPHABET.decode(De).slice(0,-6),Be=bechChecksum(Ue,$e,y);if(!De.endsWith(Be))throw new Error(`Invalid checksum in ${Oe}: expected "${Be}"`);return{prefix:Ue,words:$e}}const ce=unsafeWrapper(ae);function Ce(Oe){const{prefix:Le,words:Ne}=ae(Oe,!1);return{prefix:Le,words:Ne,bytes:k(Ne)}}return{encode:te,decode:ae,decodeToBytes:Ce,decodeUnsafe:ce,fromWords:k,fromWordsUnsafe:B,toWords:H}}const bech32=genBech32("bech32");genBech32("bech32m");const utf8={encode:E=>new TextDecoder().decode(E),decode:E=>new TextEncoder().encode(E)},hex=chain(radix2(4),alphabet("0123456789abcdef"),join(""),normalize(E=>{if(typeof E!="string"||E.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof E} with length ${E.length}`);return E.toLowerCase()})),CODERS={utf8,hex,base16,base32,base64,base64url,base58,base58xmr};`${Object.keys(CODERS).join(", ")}`;function number(E){if(!Number.isSafeInteger(E)||E<0)throw new Error(`positive integer expected, not ${E}`)}function bool(E){if(typeof E!="boolean")throw new Error(`boolean expected, not ${E}`)}function isBytes$1(E){return E instanceof Uint8Array||E!=null&&typeof E=="object"&&E.constructor.name==="Uint8Array"}function bytes$1(E,...y){if(!isBytes$1(E))throw new Error("Uint8Array expected");if(y.length>0&&!y.includes(E.length))throw new Error(`Uint8Array expected of length ${y}, not of length=${E.length}`)}function exists(E,y=!0){if(E.destroyed)throw new Error("Hash instance has been destroyed");if(y&&E.finished)throw new Error("Hash#digest() has already been called")}function output(E,y){bytes$1(E);const R=y.outputLen;if(E.lengthnew Uint32Array(E.buffer,E.byteOffset,Math.floor(E.byteLength/4)),createView=E=>new DataView(E.buffer,E.byteOffset,E.byteLength),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(E){if(typeof E!="string")throw new Error(`string expected, got ${typeof E}`);return new Uint8Array(new TextEncoder().encode(E))}function toBytes(E){if(typeof E=="string")E=utf8ToBytes(E);else if(isBytes$1(E))E=E.slice();else throw new Error(`Uint8Array expected, got ${typeof E}`);return E}function checkOpts(E,y){if(y==null||typeof y!="object")throw new Error("options must be defined");return Object.assign(E,y)}function equalBytes(E,y){if(E.length!==y.length)return!1;let R=0;for(let k=0;k(Object.assign(y,E),y),BLOCK_SIZE$1=16,ZEROS16=new Uint8Array(16),ZEROS32=u32(ZEROS16),POLY$1=225,mul2$1=(E,y,R,k)=>{const H=k&1;return{s3:R<<31|k>>>1,s2:y<<31|R>>>1,s1:E<<31|y>>>1,s0:E>>>1^POLY$1<<24&-(H&1)}},swapLE=E=>(E>>>0&255)<<24|(E>>>8&255)<<16|(E>>>16&255)<<8|E>>>24&255|0;function _toGHASHKey(E){E.reverse();const y=E[15]&1;let R=0;for(let k=0;k>>1|R,R=(H&1)<<7}return E[0]^=-y&225,E}const estimateWindow=E=>E>64*1024?8:E>1024?4:2;class GHASH{constructor(y,R){this.blockLen=BLOCK_SIZE$1,this.outputLen=BLOCK_SIZE$1,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,y=toBytes(y),bytes$1(y,16);const k=createView(y);let H=k.getUint32(0,!1),B=k.getUint32(4,!1),te=k.getUint32(8,!1),ae=k.getUint32(12,!1);const ce=[];for(let Ue=0;Ue<128;Ue++)ce.push({s0:swapLE(H),s1:swapLE(B),s2:swapLE(te),s3:swapLE(ae)}),{s0:H,s1:B,s2:te,s3:ae}=mul2$1(H,B,te,ae);const Ce=estimateWindow(R||1024);if(![1,2,4,8].includes(Ce))throw new Error(`ghash: wrong window size=${Ce}, should be 2, 4 or 8`);this.W=Ce;const Le=128/Ce,Ne=this.windowSize=2**Ce,Fe=[];for(let Ue=0;Ue>>Ce-st-1&1))continue;const{s0:at,s1:tt,s2:ft,s3:Ye}=ce[Ce*Ue+st];$e^=at,Be^=tt,Ve^=ft,Ke^=Ye}Fe.push({s0:$e,s1:Be,s2:Ve,s3:Ke})}this.t=Fe}_updateBlock(y,R,k,H){y^=this.s0,R^=this.s1,k^=this.s2,H^=this.s3;const{W:B,t:te,windowSize:ae}=this;let ce=0,Ce=0,Oe=0,Le=0;const Ne=(1<>>8*De&255;for(let Be=8/B-1;Be>=0;Be--){const Ve=$e>>>B*Be&Ne,{s0:Ke,s1:st,s2:We,s3:at}=te[Fe*ae+Ve];ce^=Ke,Ce^=st,Oe^=We,Le^=at,Fe+=1}}this.s0=ce,this.s1=Ce,this.s2=Oe,this.s3=Le}update(y){y=toBytes(y),exists(this);const R=u32(y),k=Math.floor(y.length/BLOCK_SIZE$1),H=y.length%BLOCK_SIZE$1;for(let B=0;BE(H,k.length).update(toBytes(k)).digest(),R=E(new Uint8Array(16),0);return y.outputLen=R.outputLen,y.blockLen=R.blockLen,y.create=(k,H)=>E(k,H),y}wrapConstructorWithKey$1((E,y)=>new GHASH(E,y));wrapConstructorWithKey$1((E,y)=>new Polyval(E,y));const BLOCK_SIZE=16,POLY=283;function mul2(E){return E<<1^POLY&-(E>>7)}function mul(E,y){let R=0;for(;y>0;y>>=1)R^=E&-(y&1),E=mul2(E);return R}const sbox=(()=>{let E=new Uint8Array(256);for(let R=0,k=1;R<256;R++,k^=mul2(k))E[R]=k;const y=new Uint8Array(256);y[0]=99;for(let R=0;R<255;R++){let k=E[255-R];k|=k<<8,y[E[R]]=(k^k>>4^k>>5^k>>6^k>>7^99)&255}return y})(),invSbox=sbox.map((E,y)=>sbox.indexOf(y)),rotr32_8=E=>E<<24|E>>>8,rotl32_8=E=>E<<8|E>>>24;function genTtable(E,y){if(E.length!==256)throw new Error("Wrong sbox length");const R=new Uint32Array(256).map((Ce,Oe)=>y(E[Oe])),k=R.map(rotl32_8),H=k.map(rotl32_8),B=H.map(rotl32_8),te=new Uint32Array(256*256),ae=new Uint32Array(256*256),ce=new Uint16Array(256*256);for(let Ce=0;Ce<256;Ce++)for(let Oe=0;Oe<256;Oe++){const Le=Ce*256+Oe;te[Le]=R[Ce]^k[Oe],ae[Le]=H[Ce]^B[Oe],ce[Le]=E[Ce]<<8|E[Oe]}return{sbox:E,sbox2:ce,T0:R,T1:k,T2:H,T3:B,T01:te,T23:ae}}const tableEncoding=genTtable(sbox,E=>mul(E,3)<<24|E<<16|E<<8|mul(E,2)),tableDecoding=genTtable(invSbox,E=>mul(E,11)<<24|mul(E,13)<<16|mul(E,9)<<8|mul(E,14)),xPowers=(()=>{const E=new Uint8Array(16);for(let y=0,R=1;y<16;y++,R=mul2(R))E[y]=R;return E})();function expandKeyLE(E){bytes$1(E);const y=E.length;if(![16,24,32].includes(y))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${y}`);const{sbox2:R}=tableEncoding,k=u32(E),H=k.length,B=ae=>applySbox(R,ae,ae,ae,ae),te=new Uint32Array(y+28);te.set(k);for(let ae=H;ae6&&ae%H===4&&(ce=B(ce)),te[ae]=te[ae-H]^ce}return te}function expandKeyDecLE(E){const y=expandKeyLE(E),R=y.slice(),k=y.length,{sbox2:H}=tableEncoding,{T0:B,T1:te,T2:ae,T3:ce}=tableDecoding;for(let Ce=0;Ce>>8&255]^ae[Le>>>16&255]^ce[Le>>>24]}return R}function apply0123(E,y,R,k,H,B){return E[R<<8&65280|k>>>8&255]^y[H>>>8&65280|B>>>24&255]}function applySbox(E,y,R,k,H){return E[y&255|R&65280]|E[k>>>16&255|H>>>16&65280]<<16}function encrypt$1(E,y,R,k,H){const{sbox2:B,T01:te,T23:ae}=tableEncoding;let ce=0;y^=E[ce++],R^=E[ce++],k^=E[ce++],H^=E[ce++];const Ce=E.length/4-2;for(let Ue=0;Ue16)throw new Error(`aes/pcks5: wrong padding byte: ${k}`);const H=E.subarray(0,-k);for(let B=0;B{const ae=expandKeyLE(y),{b:ce,o:Ce,out:Oe}=validateBlockEncrypt(B,H,te),Le=u32(R);let Ne=Le[0],Fe=Le[1],Ue=Le[2],De=Le[3],$e=0;for(;$e+4<=ce.length;)Ne^=ce[$e+0],Fe^=ce[$e+1],Ue^=ce[$e+2],De^=ce[$e+3],{s0:Ne,s1:Fe,s2:Ue,s3:De}=encrypt$1(ae,Ne,Fe,Ue,De),Ce[$e++]=Ne,Ce[$e++]=Fe,Ce[$e++]=Ue,Ce[$e++]=De;if(H){const Be=padPCKS(B.subarray($e*4));Ne^=Be[0],Fe^=Be[1],Ue^=Be[2],De^=Be[3],{s0:Ne,s1:Fe,s2:Ue,s3:De}=encrypt$1(ae,Ne,Fe,Ue,De),Ce[$e++]=Ne,Ce[$e++]=Fe,Ce[$e++]=Ue,Ce[$e++]=De}return ae.fill(0),Oe},decrypt:(B,te)=>{validateBlockDecrypt(B);const ae=expandKeyDecLE(y),ce=u32(R),Ce=getDst(B.length,te),Oe=u32(B),Le=u32(Ce);let Ne=ce[0],Fe=ce[1],Ue=ce[2],De=ce[3];for(let $e=0;$e+4<=Oe.length;){const Be=Ne,Ve=Fe,Ke=Ue,st=De;Ne=Oe[$e+0],Fe=Oe[$e+1],Ue=Oe[$e+2],De=Oe[$e+3];const{s0:We,s1:at,s2:tt,s3:ft}=decrypt$1(ae,Ne,Fe,Ue,De);Le[$e++]=We^Be,Le[$e++]=at^Ve,Le[$e++]=tt^Ke,Le[$e++]=ft^st}return ae.fill(0),validatePCKS(Ce,H)}}}),u8to16=(E,y)=>E[y++]&255|(E[y++]&255)<<8;class Poly1305{constructor(y){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,y=toBytes(y),bytes$1(y,32);const R=u8to16(y,0),k=u8to16(y,2),H=u8to16(y,4),B=u8to16(y,6),te=u8to16(y,8),ae=u8to16(y,10),ce=u8to16(y,12),Ce=u8to16(y,14);this.r[0]=R&8191,this.r[1]=(R>>>13|k<<3)&8191,this.r[2]=(k>>>10|H<<6)&7939,this.r[3]=(H>>>7|B<<9)&8191,this.r[4]=(B>>>4|te<<12)&255,this.r[5]=te>>>1&8190,this.r[6]=(te>>>14|ae<<2)&8191,this.r[7]=(ae>>>11|ce<<5)&8065,this.r[8]=(ce>>>8|Ce<<8)&8191,this.r[9]=Ce>>>5&127;for(let Oe=0;Oe<8;Oe++)this.pad[Oe]=u8to16(y,16+2*Oe)}process(y,R,k=!1){const H=k?0:2048,{h:B,r:te}=this,ae=te[0],ce=te[1],Ce=te[2],Oe=te[3],Le=te[4],Ne=te[5],Fe=te[6],Ue=te[7],De=te[8],$e=te[9],Be=u8to16(y,R+0),Ve=u8to16(y,R+2),Ke=u8to16(y,R+4),st=u8to16(y,R+6),We=u8to16(y,R+8),at=u8to16(y,R+10),tt=u8to16(y,R+12),ft=u8to16(y,R+14);let Ye=B[0]+(Be&8191),ot=B[1]+((Be>>>13|Ve<<3)&8191),nt=B[2]+((Ve>>>10|Ke<<6)&8191),pt=B[3]+((Ke>>>7|st<<9)&8191),dt=B[4]+((st>>>4|We<<12)&8191),rt=B[5]+(We>>>1&8191),Qe=B[6]+((We>>>14|at<<2)&8191),ke=B[7]+((at>>>11|tt<<5)&8191),Xe=B[8]+((tt>>>8|ft<<8)&8191),qe=B[9]+(ft>>>5|H),Ge=0,je=Ge+Ye*ae+ot*(5*$e)+nt*(5*De)+pt*(5*Ue)+dt*(5*Fe);Ge=je>>>13,je&=8191,je+=rt*(5*Ne)+Qe*(5*Le)+ke*(5*Oe)+Xe*(5*Ce)+qe*(5*ce),Ge+=je>>>13,je&=8191;let He=Ge+Ye*ce+ot*ae+nt*(5*$e)+pt*(5*De)+dt*(5*Ue);Ge=He>>>13,He&=8191,He+=rt*(5*Fe)+Qe*(5*Ne)+ke*(5*Le)+Xe*(5*Oe)+qe*(5*Ce),Ge+=He>>>13,He&=8191;let Ze=Ge+Ye*Ce+ot*ce+nt*ae+pt*(5*$e)+dt*(5*De);Ge=Ze>>>13,Ze&=8191,Ze+=rt*(5*Ue)+Qe*(5*Fe)+ke*(5*Ne)+Xe*(5*Le)+qe*(5*Oe),Ge+=Ze>>>13,Ze&=8191;let mt=Ge+Ye*Oe+ot*Ce+nt*ce+pt*ae+dt*(5*$e);Ge=mt>>>13,mt&=8191,mt+=rt*(5*De)+Qe*(5*Ue)+ke*(5*Fe)+Xe*(5*Ne)+qe*(5*Le),Ge+=mt>>>13,mt&=8191;let gt=Ge+Ye*Le+ot*Oe+nt*Ce+pt*ce+dt*ae;Ge=gt>>>13,gt&=8191,gt+=rt*(5*$e)+Qe*(5*De)+ke*(5*Ue)+Xe*(5*Fe)+qe*(5*Ne),Ge+=gt>>>13,gt&=8191;let vt=Ge+Ye*Ne+ot*Le+nt*Oe+pt*Ce+dt*ce;Ge=vt>>>13,vt&=8191,vt+=rt*ae+Qe*(5*$e)+ke*(5*De)+Xe*(5*Ue)+qe*(5*Fe),Ge+=vt>>>13,vt&=8191;let Lt=Ge+Ye*Fe+ot*Ne+nt*Le+pt*Oe+dt*Ce;Ge=Lt>>>13,Lt&=8191,Lt+=rt*ce+Qe*ae+ke*(5*$e)+Xe*(5*De)+qe*(5*Ue),Ge+=Lt>>>13,Lt&=8191;let Ut=Ge+Ye*Ue+ot*Fe+nt*Ne+pt*Le+dt*Oe;Ge=Ut>>>13,Ut&=8191,Ut+=rt*Ce+Qe*ce+ke*ae+Xe*(5*$e)+qe*(5*De),Ge+=Ut>>>13,Ut&=8191;let $t=Ge+Ye*De+ot*Ue+nt*Fe+pt*Ne+dt*Le;Ge=$t>>>13,$t&=8191,$t+=rt*Oe+Qe*Ce+ke*ce+Xe*ae+qe*(5*$e),Ge+=$t>>>13,$t&=8191;let zt=Ge+Ye*$e+ot*De+nt*Ue+pt*Fe+dt*Ne;Ge=zt>>>13,zt&=8191,zt+=rt*Le+Qe*Oe+ke*Ce+Xe*ce+qe*ae,Ge+=zt>>>13,zt&=8191,Ge=(Ge<<2)+Ge|0,Ge=Ge+je|0,je=Ge&8191,Ge=Ge>>>13,He+=Ge,B[0]=je,B[1]=He,B[2]=Ze,B[3]=mt,B[4]=gt,B[5]=vt,B[6]=Lt,B[7]=Ut,B[8]=$t,B[9]=zt}finalize(){const{h:y,pad:R}=this,k=new Uint16Array(10);let H=y[1]>>>13;y[1]&=8191;for(let ae=2;ae<10;ae++)y[ae]+=H,H=y[ae]>>>13,y[ae]&=8191;y[0]+=H*5,H=y[0]>>>13,y[0]&=8191,y[1]+=H,H=y[1]>>>13,y[1]&=8191,y[2]+=H,k[0]=y[0]+5,H=k[0]>>>13,k[0]&=8191;for(let ae=1;ae<10;ae++)k[ae]=y[ae]+H,H=k[ae]>>>13,k[ae]&=8191;k[9]-=8192;let B=(H^1)-1;for(let ae=0;ae<10;ae++)k[ae]&=B;B=~B;for(let ae=0;ae<10;ae++)y[ae]=y[ae]&B|k[ae];y[0]=(y[0]|y[1]<<13)&65535,y[1]=(y[1]>>>3|y[2]<<10)&65535,y[2]=(y[2]>>>6|y[3]<<7)&65535,y[3]=(y[3]>>>9|y[4]<<4)&65535,y[4]=(y[4]>>>12|y[5]<<1|y[6]<<14)&65535,y[5]=(y[6]>>>2|y[7]<<11)&65535,y[6]=(y[7]>>>5|y[8]<<8)&65535,y[7]=(y[8]>>>8|y[9]<<5)&65535;let te=y[0]+R[0];y[0]=te&65535;for(let ae=1;ae<8;ae++)te=(y[ae]+R[ae]|0)+(te>>>16)|0,y[ae]=te&65535}update(y){exists(this);const{buffer:R,blockLen:k}=this;y=toBytes(y);const H=y.length;for(let B=0;B>>0,y[B++]=k[te]>>>8;return y}digest(){const{buffer:y,outputLen:R}=this;this.digestInto(y);const k=y.slice(0,R);return this.destroy(),k}}function wrapConstructorWithKey(E){const y=(k,H)=>E(H).update(toBytes(k)).digest(),R=E(new Uint8Array(32));return y.outputLen=R.outputLen,y.blockLen=R.blockLen,y.create=k=>E(k),y}wrapConstructorWithKey(E=>new Poly1305(E));const sigma16=utf8ToBytes("expand 16-byte k"),sigma32=utf8ToBytes("expand 32-byte k"),sigma16_32=u32(sigma16),sigma32_32=u32(sigma32);function rotl(E,y){return E<>>32-y}function isAligned32(E){return E.byteOffset%4===0}const BLOCK_LEN=64,BLOCK_LEN32=16,MAX_COUNTER=2**32-1,U32_EMPTY=new Uint32Array;function runCipher(E,y,R,k,H,B,te,ae){const ce=H.length,Ce=new Uint8Array(BLOCK_LEN),Oe=u32(Ce),Le=isAligned32(H)&&isAligned32(B),Ne=Le?u32(H):U32_EMPTY,Fe=Le?u32(B):U32_EMPTY;for(let Ue=0;Ue=MAX_COUNTER)throw new Error("arx: counter overflow");const De=Math.min(BLOCK_LEN,ce-Ue);if(Le&&De===BLOCK_LEN){const $e=Ue/4;if(Ue%4!==0)throw new Error("arx: invalid block position");for(let Be=0,Ve;Be{bytes$1(ae),bytes$1(ce),bytes$1(Ce);const Ne=Ce.length;if(Oe||(Oe=new Uint8Array(Ne)),bytes$1(Oe),number(Le),Le<0||Le>=MAX_COUNTER)throw new Error("arx: counter overflow");if(Oe.length0;)Fe.pop().fill(0);return Oe}}function chachaCore(E,y,R,k,H,B=20){let te=E[0],ae=E[1],ce=E[2],Ce=E[3],Oe=y[0],Le=y[1],Ne=y[2],Fe=y[3],Ue=y[4],De=y[5],$e=y[6],Be=y[7],Ve=H,Ke=R[0],st=R[1],We=R[2],at=te,tt=ae,ft=ce,Ye=Ce,ot=Oe,nt=Le,pt=Ne,dt=Fe,rt=Ue,Qe=De,ke=$e,Xe=Be,qe=Ve,Ge=Ke,je=st,He=We;for(let mt=0;mtH?y.create().update(k).digest():k);for(let te=0;tenew HMAC(E,y).update(R).digest();hmac.create=(E,y)=>new HMAC(E,y);function extract(E,y,R){return assert.hash(E),hmac(E,toBytes$1(R),toBytes$1(y))}const HKDF_COUNTER=new Uint8Array([0]),EMPTY_BUFFER=new Uint8Array;function expand(E,y,R,k=32){if(assert.hash(E),assert.number(k),k>255*E.outputLen)throw new Error("Length should be <= 255*HashLen");const H=Math.ceil(k/E.outputLen);R===void 0&&(R=EMPTY_BUFFER);const B=new Uint8Array(H*E.outputLen),te=hmac.create(E,y),ae=te._cloneInto(),ce=new Uint8Array(te.outputLen);for(let Ce=0;Cey in E?__defProp$1(E,y,{enumerable:!0,configurable:!0,writable:!0,value:R}):E[y]=R,__export=(E,y)=>{for(var R in y)__defProp$1(E,R,{get:y[R],enumerable:!0})},__publicField$1=(E,y,R)=>(__defNormalProp$1(E,typeof y!="symbol"?y+"":y,R),R),verifiedSymbol=Symbol("verified"),isRecord$1=E=>E instanceof Object;function validateEvent(E){if(!isRecord$1(E)||typeof E.kind!="number"||typeof E.content!="string"||typeof E.created_at!="number"||typeof E.pubkey!="string"||!E.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(E.tags))return!1;for(let y=0;yQueue,QueueNode:()=>QueueNode,binarySearch:()=>binarySearch,insertEventIntoAscendingList:()=>insertEventIntoAscendingList,insertEventIntoDescendingList:()=>insertEventIntoDescendingList,normalizeURL:()=>normalizeURL,utf8Decoder:()=>utf8Decoder,utf8Encoder:()=>utf8Encoder});var utf8Decoder=new TextDecoder("utf-8"),utf8Encoder=new TextEncoder;function normalizeURL(E){E.indexOf("://")===-1&&(E="wss://"+E);let y=new URL(E);return y.pathname=y.pathname.replace(/\/+/g,"/"),y.pathname.endsWith("/")&&(y.pathname=y.pathname.slice(0,-1)),(y.port==="80"&&y.protocol==="ws:"||y.port==="443"&&y.protocol==="wss:")&&(y.port=""),y.searchParams.sort(),y.hash="",y.toString()}function insertEventIntoDescendingList(E,y){const[R,k]=binarySearch(E,H=>y.id===H.id?0:y.created_at===H.created_at?-1:H.created_at-y.created_at);return k||E.splice(R,0,y),E}function insertEventIntoAscendingList(E,y){const[R,k]=binarySearch(E,H=>y.id===H.id?0:y.created_at===H.created_at?-1:y.created_at-H.created_at);return k||E.splice(R,0,y),E}function binarySearch(E,y){let R=0,k=E.length-1;for(;R<=k;){const H=Math.floor((R+k)/2),B=y(E[H]);if(B===0)return[H,!0];B<0?k=H-1:R=H+1}return[R,!1]}var QueueNode=class{constructor(E){Jt(this,"value");Jt(this,"next",null);Jt(this,"prev",null);this.value=E}},Queue=class{constructor(){Jt(this,"first");Jt(this,"last");this.first=null,this.last=null}enqueue(E){const y=new QueueNode(E);return this.last?this.last===this.first?(this.last=y,this.last.prev=this.first,this.first.next=y):(y.prev=this.last,this.last.next=y,this.last=y):(this.first=y,this.last=y),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const y=this.first;return this.first=null,this.last=null,y.value}const E=this.first;return this.first=E.next,E.value}},JS=class{generateSecretKey(){return schnorr.utils.randomPrivateKey()}getPublicKey(E){return bytesToHex$1(schnorr.getPublicKey(E))}finalizeEvent(E,y){const R=E;return R.pubkey=bytesToHex$1(schnorr.getPublicKey(y)),R.id=getEventHash(R),R.sig=bytesToHex$1(schnorr.sign(getEventHash(R),y)),R[verifiedSymbol]=!0,R}verifyEvent(E){if(typeof E[verifiedSymbol]=="boolean")return E[verifiedSymbol];const y=getEventHash(E);if(y!==E.id)return E[verifiedSymbol]=!1,!1;try{const R=schnorr.verify(E.sig,y,E.pubkey);return E[verifiedSymbol]=R,R}catch{return E[verifiedSymbol]=!1,!1}}};function serializeEvent(E){if(!validateEvent(E))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,E.pubkey,E.created_at,E.kind,E.tags,E.content])}function getEventHash(E){let y=sha256(utf8Encoder.encode(serializeEvent(E)));return bytesToHex$1(y)}var i$1=new JS,generateSecretKey=i$1.generateSecretKey,getPublicKey=i$1.getPublicKey,finalizeEvent=i$1.finalizeEvent,verifyEvent=i$1.verifyEvent,kinds_exports={};__export(kinds_exports,{Application:()=>Application,BadgeAward:()=>BadgeAward,BadgeDefinition:()=>BadgeDefinition,BlockedRelaysList:()=>BlockedRelaysList,BookmarkList:()=>BookmarkList,Bookmarksets:()=>Bookmarksets,Calendar:()=>Calendar,CalendarEventRSVP:()=>CalendarEventRSVP,ChannelCreation:()=>ChannelCreation,ChannelHideMessage:()=>ChannelHideMessage,ChannelMessage:()=>ChannelMessage,ChannelMetadata:()=>ChannelMetadata,ChannelMuteUser:()=>ChannelMuteUser,ClassifiedListing:()=>ClassifiedListing,ClientAuth:()=>ClientAuth,CommunitiesList:()=>CommunitiesList,CommunityDefinition:()=>CommunityDefinition,CommunityPostApproval:()=>CommunityPostApproval,Contacts:()=>Contacts,CreateOrUpdateProduct:()=>CreateOrUpdateProduct,CreateOrUpdateStall:()=>CreateOrUpdateStall,Curationsets:()=>Curationsets,Date:()=>Date2,DraftClassifiedListing:()=>DraftClassifiedListing,DraftLong:()=>DraftLong,Emojisets:()=>Emojisets,EncryptedDirectMessage:()=>EncryptedDirectMessage,EncryptedDirectMessages:()=>EncryptedDirectMessages,EventDeletion:()=>EventDeletion,FileMetadata:()=>FileMetadata,FileServerPreference:()=>FileServerPreference,Followsets:()=>Followsets,GenericRepost:()=>GenericRepost,Genericlists:()=>Genericlists,HTTPAuth:()=>HTTPAuth,Handlerinformation:()=>Handlerinformation,Handlerrecommendation:()=>Handlerrecommendation,Highlights:()=>Highlights,InterestsList:()=>InterestsList,Interestsets:()=>Interestsets,JobFeedback:()=>JobFeedback,JobRequest:()=>JobRequest,JobResult:()=>JobResult,Label:()=>Label,LightningPubRPC:()=>LightningPubRPC,LiveChatMessage:()=>LiveChatMessage,LiveEvent:()=>LiveEvent,LongFormArticle:()=>LongFormArticle,Metadata:()=>Metadata,Mutelist:()=>Mutelist,NWCWalletInfo:()=>NWCWalletInfo,NWCWalletRequest:()=>NWCWalletRequest,NWCWalletResponse:()=>NWCWalletResponse,NostrConnect:()=>NostrConnect,OpenTimestamps:()=>OpenTimestamps,Pinlist:()=>Pinlist,ProblemTracker:()=>ProblemTracker,ProfileBadges:()=>ProfileBadges,PublicChatsList:()=>PublicChatsList,Reaction:()=>Reaction,RecommendRelay:()=>RecommendRelay,RelayList:()=>RelayList,Relaysets:()=>Relaysets,Report:()=>Report,Reporting:()=>Reporting,Repost:()=>Repost,SearchRelaysList:()=>SearchRelaysList,ShortTextNote:()=>ShortTextNote,Time:()=>Time,UserEmojiList:()=>UserEmojiList,UserStatuses:()=>UserStatuses,Zap:()=>Zap,ZapGoal:()=>ZapGoal,ZapRequest:()=>ZapRequest,classifyKind:()=>classifyKind,isEphemeralKind:()=>isEphemeralKind,isParameterizedReplaceableKind:()=>isParameterizedReplaceableKind,isRegularKind:()=>isRegularKind,isReplaceableKind:()=>isReplaceableKind});function isRegularKind(E){return 1e3<=E&&E<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(E)}function isReplaceableKind(E){return[0,3].includes(E)||1e4<=E&&E<2e4}function isEphemeralKind(E){return 2e4<=E&&E<3e4}function isParameterizedReplaceableKind(E){return 3e4<=E&&E<4e4}function classifyKind(E){return isRegularKind(E)?"regular":isReplaceableKind(E)?"replaceable":isEphemeralKind(E)?"ephemeral":isParameterizedReplaceableKind(E)?"parameterized":"unknown"}var Metadata=0,ShortTextNote=1,RecommendRelay=2,Contacts=3,EncryptedDirectMessage=4,EncryptedDirectMessages=4,EventDeletion=5,Repost=6,Reaction=7,BadgeAward=8,GenericRepost=16,ChannelCreation=40,ChannelMetadata=41,ChannelMessage=42,ChannelHideMessage=43,ChannelMuteUser=44,OpenTimestamps=1040,FileMetadata=1063,LiveChatMessage=1311,ProblemTracker=1971,Report=1984,Reporting=1984,Label=1985,CommunityPostApproval=4550,JobRequest=5999,JobResult=6999,JobFeedback=7e3,ZapGoal=9041,ZapRequest=9734,Zap=9735,Highlights=9802,Mutelist=1e4,Pinlist=10001,RelayList=10002,BookmarkList=10003,CommunitiesList=10004,PublicChatsList=10005,BlockedRelaysList=10006,SearchRelaysList=10007,InterestsList=10015,UserEmojiList=10030,FileServerPreference=10096,NWCWalletInfo=13194,LightningPubRPC=21e3,ClientAuth=22242,NWCWalletRequest=23194,NWCWalletResponse=23195,NostrConnect=24133,HTTPAuth=27235,Followsets=3e4,Genericlists=30001,Relaysets=30002,Bookmarksets=30003,Curationsets=30004,ProfileBadges=30008,BadgeDefinition=30009,Interestsets=30015,CreateOrUpdateStall=30017,CreateOrUpdateProduct=30018,LongFormArticle=30023,DraftLong=30024,Emojisets=30030,Application=30078,LiveEvent=30311,UserStatuses=30315,ClassifiedListing=30402,DraftClassifiedListing=30403,Date2=31922,Time=31923,Calendar=31924,CalendarEventRSVP=31925,Handlerrecommendation=31989,Handlerinformation=31990,CommunityDefinition=34550;function matchFilter(E,y){if(E.ids&&E.ids.indexOf(y.id)===-1&&!E.ids.some(R=>y.id.startsWith(R))||E.kinds&&E.kinds.indexOf(y.kind)===-1||E.authors&&E.authors.indexOf(y.pubkey)===-1&&!E.authors.some(R=>y.pubkey.startsWith(R)))return!1;for(let R in E)if(R[0]==="#"){let k=R.slice(1),H=E[`#${k}`];if(H&&!y.tags.find(([B,te])=>B===R.slice(1)&&H.indexOf(te)!==-1))return!1}return!(E.since&&y.created_atE.until)}function matchFilters(E,y){for(let R=0;RisReplaceableKind(H)))?E.authors.length*E.kinds.length:1/0)}var fakejson_exports={};__export(fakejson_exports,{getHex64:()=>getHex64,getInt:()=>getInt,getSubscriptionId:()=>getSubscriptionId,matchEventId:()=>matchEventId,matchEventKind:()=>matchEventKind,matchEventPubkey:()=>matchEventPubkey});function getHex64(E,y){let R=y.length+3,k=E.indexOf(`"${y}":`)+R,H=E.slice(k).indexOf('"')+k+1;return E.slice(H,H+64)}function getInt(E,y){let R=y.length,k=E.indexOf(`"${y}":`)+R+3,H=E.slice(k),B=Math.min(H.indexOf(","),H.indexOf("}"));return parseInt(H.slice(0,B),10)}function getSubscriptionId(E){let y=E.slice(0,22).indexOf('"EVENT"');if(y===-1)return null;let R=E.slice(y+7+1).indexOf('"');if(R===-1)return null;let k=y+7+1+R,H=E.slice(k+1,80).indexOf('"');if(H===-1)return null;let B=k+1+H;return E.slice(k+1,B)}function matchEventId(E,y){return y===getHex64(E,"id")}function matchEventPubkey(E,y){return y===getHex64(E,"pubkey")}function matchEventKind(E,y){return y===getInt(E,"kind")}var nip42_exports={};__export(nip42_exports,{makeAuthEvent:()=>makeAuthEvent});function makeAuthEvent(E,y){return{kind:ClientAuth,created_at:Math.floor(Date.now()/1e3),tags:[["relay",E],["challenge",y]],content:""}}var _WebSocket;try{_WebSocket=WebSocket}catch{}var nip19_exports={};__export(nip19_exports,{BECH32_REGEX:()=>BECH32_REGEX,Bech32MaxSize:()=>Bech32MaxSize,decode:()=>decode$1,encodeBytes:()=>encodeBytes,naddrEncode:()=>naddrEncode,neventEncode:()=>neventEncode,noteEncode:()=>noteEncode,nprofileEncode:()=>nprofileEncode,npubEncode:()=>npubEncode,nrelayEncode:()=>nrelayEncode,nsecEncode:()=>nsecEncode});var Bech32MaxSize=5e3,BECH32_REGEX=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function integerToUint8Array(E){const y=new Uint8Array(4);return y[0]=E>>24&255,y[1]=E>>16&255,y[2]=E>>8&255,y[3]=E&255,y}function decode$1(E){var H,B,te,ae,ce,Ce,Oe,Le;let{prefix:y,words:R}=bech32.decode(E,Bech32MaxSize),k=new Uint8Array(bech32.fromWords(R));switch(y){case"nprofile":{let Ne=parseTLV(k);if(!((H=Ne[0])!=null&&H[0]))throw new Error("missing TLV 0 for nprofile");if(Ne[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:bytesToHex$1(Ne[0][0]),relays:Ne[1]?Ne[1].map(Fe=>utf8Decoder.decode(Fe)):[]}}}case"nevent":{let Ne=parseTLV(k);if(!((B=Ne[0])!=null&&B[0]))throw new Error("missing TLV 0 for nevent");if(Ne[0][0].length!==32)throw new Error("TLV 0 should be 32 bytes");if(Ne[2]&&Ne[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(Ne[3]&&Ne[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:bytesToHex$1(Ne[0][0]),relays:Ne[1]?Ne[1].map(Fe=>utf8Decoder.decode(Fe)):[],author:(te=Ne[2])!=null&&te[0]?bytesToHex$1(Ne[2][0]):void 0,kind:(ae=Ne[3])!=null&&ae[0]?parseInt(bytesToHex$1(Ne[3][0]),16):void 0}}}case"naddr":{let Ne=parseTLV(k);if(!((ce=Ne[0])!=null&&ce[0]))throw new Error("missing TLV 0 for naddr");if(!((Ce=Ne[2])!=null&&Ce[0]))throw new Error("missing TLV 2 for naddr");if(Ne[2][0].length!==32)throw new Error("TLV 2 should be 32 bytes");if(!((Oe=Ne[3])!=null&&Oe[0]))throw new Error("missing TLV 3 for naddr");if(Ne[3][0].length!==4)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:utf8Decoder.decode(Ne[0][0]),pubkey:bytesToHex$1(Ne[2][0]),kind:parseInt(bytesToHex$1(Ne[3][0]),16),relays:Ne[1]?Ne[1].map(Fe=>utf8Decoder.decode(Fe)):[]}}}case"nrelay":{let Ne=parseTLV(k);if(!((Le=Ne[0])!=null&&Le[0]))throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:utf8Decoder.decode(Ne[0][0])}}case"nsec":return{type:y,data:k};case"npub":case"note":return{type:y,data:bytesToHex$1(k)};default:throw new Error(`unknown prefix ${y}`)}}function parseTLV(E){let y={},R=E;for(;R.length>0;){let k=R[0],H=R[1],B=R.slice(2,2+H);if(R=R.slice(2+H),B.lengthutf8Encoder.encode(R))});return encodeBech32("nprofile",y)}function neventEncode(E){let y;E.kind!==void 0&&(y=integerToUint8Array(E.kind));let R=encodeTLV({0:[hexToBytes(E.id)],1:(E.relays||[]).map(k=>utf8Encoder.encode(k)),2:E.author?[hexToBytes(E.author)]:[],3:y?[new Uint8Array(y)]:[]});return encodeBech32("nevent",R)}function naddrEncode(E){let y=new ArrayBuffer(4);new DataView(y).setUint32(0,E.kind,!1);let R=encodeTLV({0:[utf8Encoder.encode(E.identifier)],1:(E.relays||[]).map(k=>utf8Encoder.encode(k)),2:[hexToBytes(E.pubkey)],3:[new Uint8Array(y)]});return encodeBech32("naddr",R)}function nrelayEncode(E){let y=encodeTLV({0:[utf8Encoder.encode(E)]});return encodeBech32("nrelay",y)}function encodeTLV(E){let y=[];return Object.entries(E).reverse().forEach(([R,k])=>{k.forEach(H=>{let B=new Uint8Array(H.length+2);B.set([parseInt(R)],0),B.set([H.length],1),B.set(H,2),y.push(B)})}),concatBytes(...y)}var nip04_exports={};__export(nip04_exports,{decrypt:()=>decrypt,encrypt:()=>encrypt});async function encrypt(E,y,R){const k=E instanceof Uint8Array?bytesToHex$1(E):E,H=secp256k1.getSharedSecret(k,"02"+y),B=getNormalizedX(H);let te=Uint8Array.from(randomBytes(16)),ae=utf8Encoder.encode(R),ce=cbc(B,te).encrypt(ae),Ce=base64.encode(new Uint8Array(ce)),Oe=base64.encode(new Uint8Array(te.buffer));return`${Ce}?iv=${Oe}`}async function decrypt(E,y,R){const k=E instanceof Uint8Array?bytesToHex$1(E):E;let[H,B]=R.split("?iv="),te=secp256k1.getSharedSecret(k,"02"+y),ae=getNormalizedX(te),ce=base64.decode(B),Ce=base64.decode(H),Oe=cbc(ae,ce).decrypt(Ce);return utf8Decoder.decode(Oe)}function getNormalizedX(E){return E.slice(1,33)}var nip05_exports={};__export(nip05_exports,{NIP05_REGEX:()=>NIP05_REGEX,isValid:()=>isValid$2,queryProfile:()=>queryProfile,searchDomain:()=>searchDomain,useFetchImplementation:()=>useFetchImplementation});var NIP05_REGEX=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/,_fetch;try{_fetch=fetch}catch{}function useFetchImplementation(E){_fetch=E}async function searchDomain(E,y=""){try{const R=`https://${E}/.well-known/nostr.json?name=${y}`;return(await(await _fetch(R,{redirect:"error"})).json()).names}catch{return{}}}async function queryProfile(E){var B;const y=E.match(NIP05_REGEX);if(!y)return null;const[R,k="_",H]=y;try{const te=`https://${H}/.well-known/nostr.json?name=${k}`,ae=await(await _fetch(te,{redirect:"error"})).json();let ce=ae.names[k];return ce?{pubkey:ce,relays:(B=ae.relays)==null?void 0:B[ce]}:null}catch{return null}}async function isValid$2(E,y){let R=await queryProfile(y);return R?R.pubkey===E:!1}var nip10_exports={};__export(nip10_exports,{parse:()=>parse$3});function parse$3(E){const y={reply:void 0,root:void 0,mentions:[],profiles:[]},R=[];for(const k of E.tags)k[0]==="e"&&k[1]&&R.push(k),k[0]==="p"&&k[1]&&y.profiles.push({pubkey:k[1],relays:k[2]?[k[2]]:[]});for(let k=0;kfetchRelayInformation,useFetchImplementation:()=>useFetchImplementation2});var _fetch2;try{_fetch2=fetch}catch{}function useFetchImplementation2(E){_fetch2=E}async function fetchRelayInformation(E){return await(await fetch(E.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()}var nip13_exports={};__export(nip13_exports,{getPow:()=>getPow,minePow:()=>minePow});function getPow(E){let y=0;for(let R=0;R=y)break}return k}var nip18_exports={};__export(nip18_exports,{finishRepostEvent:()=>finishRepostEvent,getRepostedEvent:()=>getRepostedEvent,getRepostedEventPointer:()=>getRepostedEventPointer});function finishRepostEvent(E,y,R,k){return finalizeEvent({kind:Repost,tags:[...E.tags??[],["e",y.id,R],["p",y.pubkey]],content:E.content===""?"":JSON.stringify(y),created_at:E.created_at},k)}function getRepostedEventPointer(E){if(E.kind!==Repost)return;let y,R;for(let k=E.tags.length-1;k>=0&&(y===void 0||R===void 0);k--){const H=E.tags[k];H.length>=2&&(H[0]==="e"&&y===void 0?y=H:H[0]==="p"&&R===void 0&&(R=H))}if(y!==void 0)return{id:y[1],relays:[y[2],R==null?void 0:R[2]].filter(k=>typeof k=="string"),author:R==null?void 0:R[1]}}function getRepostedEvent(E,{skipVerification:y}={}){const R=getRepostedEventPointer(E);if(R===void 0||E.content==="")return;let k;try{k=JSON.parse(E.content)}catch{return}if(k.id===R.id&&!(!y&&!verifyEvent(k)))return k}var nip21_exports={};__export(nip21_exports,{NOSTR_URI_REGEX:()=>NOSTR_URI_REGEX,parse:()=>parse2,test:()=>test});var NOSTR_URI_REGEX=new RegExp(`nostr:(${BECH32_REGEX.source})`);function test(E){return typeof E=="string"&&new RegExp(`^${NOSTR_URI_REGEX.source}$`).test(E)}function parse2(E){const y=E.match(new RegExp(`^${NOSTR_URI_REGEX.source}$`));if(!y)throw new Error(`Invalid Nostr URI: ${E}`);return{uri:y[0],value:y[1],decoded:decode$1(y[1])}}var nip25_exports={};__export(nip25_exports,{finishReactionEvent:()=>finishReactionEvent,getReactedEventPointer:()=>getReactedEventPointer});function finishReactionEvent(E,y,R){const k=y.tags.filter(H=>H.length>=2&&(H[0]==="e"||H[0]==="p"));return finalizeEvent({...E,kind:Reaction,tags:[...E.tags??[],...k,["e",y.id],["p",y.pubkey]],content:E.content??"+"},R)}function getReactedEventPointer(E){if(E.kind!==Reaction)return;let y,R;for(let k=E.tags.length-1;k>=0&&(y===void 0||R===void 0);k--){const H=E.tags[k];H.length>=2&&(H[0]==="e"&&y===void 0?y=H:H[0]==="p"&&R===void 0&&(R=H))}if(!(y===void 0||R===void 0))return{id:y[1],relays:[y[2],R[2]].filter(k=>k!==void 0),author:R[1]}}var nip27_exports={};__export(nip27_exports,{matchAll:()=>matchAll,regex:()=>regex$1,replaceAll:()=>replaceAll});var regex$1=()=>new RegExp(`\\b${NOSTR_URI_REGEX.source}\\b`,"g");function*matchAll(E){const y=E.matchAll(regex$1());for(const R of y)try{const[k,H]=R;yield{uri:k,value:H,decoded:decode$1(H),start:R.index,end:R.index+k.length}}catch{}}function replaceAll(E,y){return E.replaceAll(regex$1(),(R,k)=>y({uri:R,value:k,decoded:decode$1(k)}))}var nip28_exports={};__export(nip28_exports,{channelCreateEvent:()=>channelCreateEvent,channelHideMessageEvent:()=>channelHideMessageEvent,channelMessageEvent:()=>channelMessageEvent,channelMetadataEvent:()=>channelMetadataEvent,channelMuteUserEvent:()=>channelMuteUserEvent});var channelCreateEvent=(E,y)=>{let R;if(typeof E.content=="object")R=JSON.stringify(E.content);else if(typeof E.content=="string")R=E.content;else return;return finalizeEvent({kind:ChannelCreation,tags:[...E.tags??[]],content:R,created_at:E.created_at},y)},channelMetadataEvent=(E,y)=>{let R;if(typeof E.content=="object")R=JSON.stringify(E.content);else if(typeof E.content=="string")R=E.content;else return;return finalizeEvent({kind:ChannelMetadata,tags:[["e",E.channel_create_event_id],...E.tags??[]],content:R,created_at:E.created_at},y)},channelMessageEvent=(E,y)=>{const R=[["e",E.channel_create_event_id,E.relay_url,"root"]];return E.reply_to_channel_message_event_id&&R.push(["e",E.reply_to_channel_message_event_id,E.relay_url,"reply"]),finalizeEvent({kind:ChannelMessage,tags:[...R,...E.tags??[]],content:E.content,created_at:E.created_at},y)},channelHideMessageEvent=(E,y)=>{let R;if(typeof E.content=="object")R=JSON.stringify(E.content);else if(typeof E.content=="string")R=E.content;else return;return finalizeEvent({kind:ChannelHideMessage,tags:[["e",E.channel_message_event_id],...E.tags??[]],content:R,created_at:E.created_at},y)},channelMuteUserEvent=(E,y)=>{let R;if(typeof E.content=="object")R=JSON.stringify(E.content);else if(typeof E.content=="string")R=E.content;else return;return finalizeEvent({kind:ChannelMuteUser,tags:[["p",E.pubkey_to_mute],...E.tags??[]],content:R,created_at:E.created_at},y)},nip30_exports={};__export(nip30_exports,{EMOJI_SHORTCODE_REGEX:()=>EMOJI_SHORTCODE_REGEX,matchAll:()=>matchAll2,regex:()=>regex2,replaceAll:()=>replaceAll2});var EMOJI_SHORTCODE_REGEX=/:(\w+):/,regex2=()=>new RegExp(`\\B${EMOJI_SHORTCODE_REGEX.source}\\B`,"g");function*matchAll2(E){const y=E.matchAll(regex2());for(const R of y)try{const[k,H]=R;yield{shortcode:k,name:H,start:R.index,end:R.index+k.length}}catch{}}function replaceAll2(E,y){return E.replaceAll(regex2(),(R,k)=>y({shortcode:R,name:k}))}var nip39_exports={};__export(nip39_exports,{useFetchImplementation:()=>useFetchImplementation3,validateGithub:()=>validateGithub});var _fetch3;try{_fetch3=fetch}catch{}function useFetchImplementation3(E){_fetch3=E}async function validateGithub(E,y,R){try{return await(await _fetch3(`https://gist.github.com/${y}/${R}/raw`)).text()===`Verifying that I control the following Nostr public key: ${E}`}catch{return!1}}var nip44_exports={};__export(nip44_exports,{default:()=>nip44_default,v2:()=>v2});var decoder=new TextDecoder,_u=class{static utf8Decode(E){return decoder.decode(E)}static getConversationKey(E,y){const R=secp256k1.getSharedSecret(E,"02"+y).subarray(1,33);return extract(sha256,R,"nip44-v2")}static getMessageKeys(E,y){const R=expand(sha256,E,y,76);return{chacha_key:R.subarray(0,32),chacha_nonce:R.subarray(32,44),hmac_key:R.subarray(44,76)}}static calcPaddedLen(E){if(!Number.isSafeInteger(E)||E<1)throw new Error("expected positive integer");if(E<=32)return 32;const y=1<_u.maxPlaintextSize)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const y=new Uint8Array(2);return new DataView(y.buffer).setUint16(0,E,!1),y}static pad(E){const y=_u.utf8Encode(E),R=y.length,k=_u.writeU16BE(R),H=new Uint8Array(_u.calcPaddedLen(R)-R);return concatBytes(k,y,H)}static unpad(E){const y=new DataView(E.buffer).getUint16(0),R=E.subarray(2,2+y);if(y<_u.minPlaintextSize||y>_u.maxPlaintextSize||R.length!==y||E.length!==2+_u.calcPaddedLen(y))throw new Error("invalid padding");return _u.utf8Decode(R)}static hmacAad(E,y,R){if(R.length!==32)throw new Error("AAD associated data must be 32 bytes");const k=concatBytes(R,y);return hmac(sha256,E,k)}static decodePayload(E){if(typeof E!="string")throw new Error("payload must be a valid string");const y=E.length;if(y<132||y>87472)throw new Error("invalid payload length: "+y);if(E[0]==="#")throw new Error("unknown encryption version");let R;try{R=base64.decode(E)}catch(B){throw new Error("invalid base64: "+B.message)}const k=R.length;if(k<99||k>65603)throw new Error("invalid data length: "+k);const H=R[0];if(H!==2)throw new Error("unknown encryption version "+H);return{nonce:R.subarray(1,33),ciphertext:R.subarray(33,-32),mac:R.subarray(-32)}}},u$2=_u;__publicField$1(u$2,"minPlaintextSize",1);__publicField$1(u$2,"maxPlaintextSize",65535);__publicField$1(u$2,"utf8Encode",utf8ToBytes$1);var v2=class{static encrypt(E,y,R=randomBytes(32)){const{chacha_key:k,chacha_nonce:H,hmac_key:B}=u$2.getMessageKeys(y,R),te=u$2.pad(E),ae=chacha20(k,H,te),ce=u$2.hmacAad(B,ae,R);return base64.encode(concatBytes(new Uint8Array([2]),R,ae,ce))}static decrypt(E,y){const{nonce:R,ciphertext:k,mac:H}=u$2.decodePayload(E),{chacha_key:B,chacha_nonce:te,hmac_key:ae}=u$2.getMessageKeys(y,R),ce=u$2.hmacAad(ae,k,R);if(!equalBytes(ce,H))throw new Error("invalid MAC");const Ce=chacha20(B,te,k);return u$2.unpad(Ce)}};__publicField$1(v2,"utils",u$2);var nip44_default={v2},nip47_exports={};__export(nip47_exports,{makeNwcRequestEvent:()=>makeNwcRequestEvent,parseConnectionString:()=>parseConnectionString});function parseConnectionString(E){const{pathname:y,searchParams:R}=new URL(E),k=y,H=R.get("relay"),B=R.get("secret");if(!k||!H||!B)throw new Error("invalid connection string");return{pubkey:k,relay:H,secret:B}}async function makeNwcRequestEvent(E,y,R){const H=await encrypt(y,E,JSON.stringify({method:"pay_invoice",params:{invoice:R}})),B={kind:NWCWalletRequest,created_at:Math.round(Date.now()/1e3),content:H,tags:[["p",E]]};return finalizeEvent(B,y)}var nip57_exports={};__export(nip57_exports,{getZapEndpoint:()=>getZapEndpoint,makeZapReceipt:()=>makeZapReceipt,makeZapRequest:()=>makeZapRequest,useFetchImplementation:()=>useFetchImplementation4,validateZapRequest:()=>validateZapRequest});var _fetch4;try{_fetch4=fetch}catch{}function useFetchImplementation4(E){_fetch4=E}async function getZapEndpoint(E){try{let y="",{lud06:R,lud16:k}=JSON.parse(E.content);if(R){let{words:te}=bech32.decode(R,1e3),ae=bech32.fromWords(te);y=utf8Decoder.decode(ae)}else if(k){let[te,ae]=k.split("@");y=new URL(`/.well-known/lnurlp/${te}`,`https://${ae}`).toString()}else return null;let B=await(await _fetch4(y)).json();if(B.allowsNostr&&B.nostrPubkey)return B.callback}catch{}return null}function makeZapRequest({profile:E,event:y,amount:R,relays:k,comment:H=""}){if(!R)throw new Error("amount not given");if(!E)throw new Error("profile not given");let B={kind:9734,created_at:Math.round(Date.now()/1e3),content:H,tags:[["p",E],["amount",R.toString()],["relays",...k]]};return y&&B.tags.push(["e",y]),B}function validateZapRequest(E){let y;try{y=JSON.parse(E)}catch{return"Invalid zap request JSON."}if(!validateEvent(y))return"Zap request is not a valid Nostr event.";if(!verifyEvent(y))return"Invalid signature on zap request.";let R=y.tags.find(([B,te])=>B==="p"&&te);if(!R)return"Zap request doesn't have a 'p' tag.";if(!R[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let k=y.tags.find(([B,te])=>B==="e"&&te);return k&&!k[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":y.tags.find(([B,te])=>B==="relays"&&te)?null:"Zap request doesn't have a 'relays' tag."}function makeZapReceipt({zapRequest:E,preimage:y,bolt11:R,paidAt:k}){let H=JSON.parse(E),B=H.tags.filter(([ae])=>ae==="e"||ae==="p"||ae==="a"),te={kind:9735,created_at:Math.round(k.getTime()/1e3),content:"",tags:[...B,["P",H.pubkey],["bolt11",R],["description",E]]};return y&&te.tags.push(["preimage",y]),te}var nip98_exports={};__export(nip98_exports,{getToken:()=>getToken$1,hashPayload:()=>hashPayload,unpackEventFromToken:()=>unpackEventFromToken,validateEvent:()=>validateEvent2,validateEventKind:()=>validateEventKind,validateEventMethodTag:()=>validateEventMethodTag,validateEventPayloadTag:()=>validateEventPayloadTag,validateEventTimestamp:()=>validateEventTimestamp,validateEventUrlTag:()=>validateEventUrlTag,validateToken:()=>validateToken});var _authorizationScheme="Nostr ";async function getToken$1(E,y,R,k=!1,H){const B={kind:HTTPAuth,tags:[["u",E],["method",y]],created_at:Math.round(new Date().getTime()/1e3),content:""};H&&B.tags.push(["payload",hashPayload(H)]);const te=await R(B);return(k?_authorizationScheme:"")+base64.encode(utf8Encoder.encode(JSON.stringify(te)))}async function validateToken(E,y,R){const k=await unpackEventFromToken(E).catch(B=>{throw B});return await validateEvent2(k,y,R).catch(B=>{throw B})}async function unpackEventFromToken(E){if(!E)throw new Error("Missing token");E=E.replace(_authorizationScheme,"");const y=utf8Decoder.decode(base64.decode(E));if(!y||y.length===0||!y.startsWith("{"))throw new Error("Invalid token");return JSON.parse(y)}function validateEventTimestamp(E){return E.created_at?Math.round(new Date().getTime()/1e3)-E.created_at<60:!1}function validateEventKind(E){return E.kind===HTTPAuth}function validateEventUrlTag(E,y){const R=E.tags.find(k=>k[0]==="u");return R?R.length>0&&R[1]===y:!1}function validateEventMethodTag(E,y){const R=E.tags.find(k=>k[0]==="method");return R?R.length>0&&R[1].toLowerCase()===y.toLowerCase():!1}function hashPayload(E){const y=sha256(utf8Encoder.encode(JSON.stringify(E)));return bytesToHex$1(y)}function validateEventPayloadTag(E,y){const R=E.tags.find(H=>H[0]==="payload");if(!R)return!1;const k=hashPayload(y);return R.length>0&&R[1]===k}async function validateEvent2(E,y,R,k){if(!verifyEvent(E))throw new Error("Invalid nostr event, signature invalid");if(!validateEventKind(E))throw new Error("Invalid nostr event, kind invalid");if(!validateEventTimestamp(E))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!validateEventUrlTag(E,y))throw new Error("Invalid nostr event, url tag invalid");if(!validateEventMethodTag(E,R))throw new Error("Invalid nostr event, method tag invalid");if(k&&typeof k=="object"&&Object.keys(k).length>0&&!validateEventPayloadTag(E,k))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0}var _computedKey$1,_computedKey1;_computedKey$1=Symbol.iterator,_computedKey1=Symbol.toStringTag;var qf,Qf,bc,Xf;const Dn=class Dn{constructor(y){wt(this,bc);Jt(this,"cache");Jt(this,qf,"NSet");this.cache=y??new Map}get size(){return this.cache.size}add(y){jt(this,bc,Xf).call(this,y);for(const R of this){if(Dn.deletes(R,y)||Dn.replaces(R,y))return this;Dn.replaces(y,R)&&this.delete(R)}return this.cache.set(y.id,y),this}clear(){this.cache.clear()}delete(y){return this.cache.delete(y.id)}forEach(y,R){return this.cache.forEach((k,H)=>y(k,k,this),R)}has(y){return this.cache.has(y.id)}*entries(){for(const y of this.values())yield[y,y]}keys(){return this.values()}*values(){for(const y of Dn.sortEvents([...this.cache.values()]))yield y}[(Qf=_computedKey$1,qf=_computedKey1,Qf)](){return this.values()}static isReplaceable(y){return[0,3].includes(y)||1e4<=y&&y<2e4}static isParameterizedReplaceable(y){return 3e4<=y&&y<4e4}static replaces(y,R){var B,te;const{kind:k,pubkey:H}=y;if(Dn.isReplaceable(k))return k===R.kind&&H===R.pubkey&&Dn.sortEvents([y,R])[0]===y;if(Dn.isParameterizedReplaceable(k)){const ae=((B=y.tags.find(([Ce])=>Ce==="d"))==null?void 0:B[1])||"",ce=((te=R.tags.find(([Ce])=>Ce==="d"))==null?void 0:te[1])||"";return k===R.kind&&H===R.pubkey&&Dn.sortEvents([y,R])[0]===y&&ae===ce}return!1}static deletes(y,R){const{kind:k,pubkey:H,tags:B}=y;if(k===5&&H===R.pubkey){for(const[te,ae]of B)if(te==="e"&&ae===R.id)return!0}return!1}static sortEvents(y){return y.sort((R,k)=>R.created_at!==k.created_at?k.created_at-R.created_at:R.id.localeCompare(k.id))}};bc=new WeakSet,Xf=function(y){if(y.kind===5){for(const R of y.tags)if(R[0]==="e"){const k=this.cache.get(R[1]);k&&k.pubkey===y.pubkey&&this.delete(k)}}};let NSet=Dn;var util;(function(E){E.assertEqual=H=>H;function y(H){}E.assertIs=y;function R(H){throw new Error}E.assertNever=R,E.arrayToEnum=H=>{const B={};for(const te of H)B[te]=te;return B},E.getValidEnumValues=H=>{const B=E.objectKeys(H).filter(ae=>typeof H[H[ae]]!="number"),te={};for(const ae of B)te[ae]=H[ae];return E.objectValues(te)},E.objectValues=H=>E.objectKeys(H).map(function(B){return H[B]}),E.objectKeys=typeof Object.keys=="function"?H=>Object.keys(H):H=>{const B=[];for(const te in H)Object.prototype.hasOwnProperty.call(H,te)&&B.push(te);return B},E.find=(H,B)=>{for(const te of H)if(B(te))return te},E.isInteger=typeof Number.isInteger=="function"?H=>Number.isInteger(H):H=>typeof H=="number"&&isFinite(H)&&Math.floor(H)===H;function k(H,B=" | "){return H.map(te=>typeof te=="string"?`'${te}'`:te).join(B)}E.joinValues=k,E.jsonStringifyReplacer=(H,B)=>typeof B=="bigint"?B.toString():B})(util||(util={}));var objectUtil;(function(E){E.mergeShapes=(y,R)=>({...y,...R})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=E=>{switch(typeof E){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(E)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(E)?ZodParsedType.array:E===null?ZodParsedType.null:E.then&&typeof E.then=="function"&&E.catch&&typeof E.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&E instanceof Map?ZodParsedType.map:typeof Set<"u"&&E instanceof Set?ZodParsedType.set:typeof Date<"u"&&E instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=E=>JSON.stringify(E,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(y){super(),this.issues=[],this.addIssue=k=>{this.issues=[...this.issues,k]},this.addIssues=(k=[])=>{this.issues=[...this.issues,...k]};const R=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,R):this.__proto__=R,this.name="ZodError",this.issues=y}get errors(){return this.issues}format(y){const R=y||function(B){return B.message},k={_errors:[]},H=B=>{for(const te of B.issues)if(te.code==="invalid_union")te.unionErrors.map(H);else if(te.code==="invalid_return_type")H(te.returnTypeError);else if(te.code==="invalid_arguments")H(te.argumentsError);else if(te.path.length===0)k._errors.push(R(te));else{let ae=k,ce=0;for(;ceR.message){const R={},k=[];for(const H of this.issues)H.path.length>0?(R[H.path[0]]=R[H.path[0]]||[],R[H.path[0]].push(y(H))):k.push(y(H));return{formErrors:k,fieldErrors:R}}get formErrors(){return this.flatten()}}ZodError.create=E=>new ZodError(E);const errorMap=(E,y)=>{let R;switch(E.code){case ZodIssueCode.invalid_type:E.received===ZodParsedType.undefined?R="Required":R=`Expected ${E.expected}, received ${E.received}`;break;case ZodIssueCode.invalid_literal:R=`Invalid literal value, expected ${JSON.stringify(E.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:R=`Unrecognized key(s) in object: ${util.joinValues(E.keys,", ")}`;break;case ZodIssueCode.invalid_union:R="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:R=`Invalid discriminator value. Expected ${util.joinValues(E.options)}`;break;case ZodIssueCode.invalid_enum_value:R=`Invalid enum value. Expected ${util.joinValues(E.options)}, received '${E.received}'`;break;case ZodIssueCode.invalid_arguments:R="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:R="Invalid function return type";break;case ZodIssueCode.invalid_date:R="Invalid date";break;case ZodIssueCode.invalid_string:typeof E.validation=="object"?"includes"in E.validation?(R=`Invalid input: must include "${E.validation.includes}"`,typeof E.validation.position=="number"&&(R=`${R} at one or more positions greater than or equal to ${E.validation.position}`)):"startsWith"in E.validation?R=`Invalid input: must start with "${E.validation.startsWith}"`:"endsWith"in E.validation?R=`Invalid input: must end with "${E.validation.endsWith}"`:util.assertNever(E.validation):E.validation!=="regex"?R=`Invalid ${E.validation}`:R="Invalid";break;case ZodIssueCode.too_small:E.type==="array"?R=`Array must contain ${E.exact?"exactly":E.inclusive?"at least":"more than"} ${E.minimum} element(s)`:E.type==="string"?R=`String must contain ${E.exact?"exactly":E.inclusive?"at least":"over"} ${E.minimum} character(s)`:E.type==="number"?R=`Number must be ${E.exact?"exactly equal to ":E.inclusive?"greater than or equal to ":"greater than "}${E.minimum}`:E.type==="date"?R=`Date must be ${E.exact?"exactly equal to ":E.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(E.minimum))}`:R="Invalid input";break;case ZodIssueCode.too_big:E.type==="array"?R=`Array must contain ${E.exact?"exactly":E.inclusive?"at most":"less than"} ${E.maximum} element(s)`:E.type==="string"?R=`String must contain ${E.exact?"exactly":E.inclusive?"at most":"under"} ${E.maximum} character(s)`:E.type==="number"?R=`Number must be ${E.exact?"exactly":E.inclusive?"less than or equal to":"less than"} ${E.maximum}`:E.type==="bigint"?R=`BigInt must be ${E.exact?"exactly":E.inclusive?"less than or equal to":"less than"} ${E.maximum}`:E.type==="date"?R=`Date must be ${E.exact?"exactly":E.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(E.maximum))}`:R="Invalid input";break;case ZodIssueCode.custom:R="Invalid input";break;case ZodIssueCode.invalid_intersection_types:R="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:R=`Number must be a multiple of ${E.multipleOf}`;break;case ZodIssueCode.not_finite:R="Number must be finite";break;default:R=y.defaultError,util.assertNever(E)}return{message:R}};let overrideErrorMap=errorMap;function setErrorMap(E){overrideErrorMap=E}function getErrorMap(){return overrideErrorMap}const makeIssue=E=>{const{data:y,path:R,errorMaps:k,issueData:H}=E,B=[...R,...H.path||[]],te={...H,path:B};if(H.message!==void 0)return{...H,path:B,message:H.message};let ae="";const ce=k.filter(Ce=>!!Ce).slice().reverse();for(const Ce of ce)ae=Ce(te,{data:y,defaultError:ae}).message;return{...H,path:B,message:ae}},EMPTY_PATH=[];function addIssueToContext(E,y){const R=getErrorMap(),k=makeIssue({issueData:y,data:E.data,path:E.path,errorMaps:[E.common.contextualErrorMap,E.schemaErrorMap,R,R===errorMap?void 0:errorMap].filter(H=>!!H)});E.common.issues.push(k)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(y,R){const k=[];for(const H of R){if(H.status==="aborted")return INVALID;H.status==="dirty"&&y.dirty(),k.push(H.value)}return{status:y.value,value:k}}static async mergeObjectAsync(y,R){const k=[];for(const H of R){const B=await H.key,te=await H.value;k.push({key:B,value:te})}return ParseStatus.mergeObjectSync(y,k)}static mergeObjectSync(y,R){const k={};for(const H of R){const{key:B,value:te}=H;if(B.status==="aborted"||te.status==="aborted")return INVALID;B.status==="dirty"&&y.dirty(),te.status==="dirty"&&y.dirty(),B.value!=="__proto__"&&(typeof te.value<"u"||H.alwaysSet)&&(k[B.value]=te.value)}return{status:y.value,value:k}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=E=>({status:"dirty",value:E}),OK=E=>({status:"valid",value:E}),isAborted=E=>E.status==="aborted",isDirty=E=>E.status==="dirty",isValid$1=E=>E.status==="valid",isAsync=E=>typeof Promise<"u"&&E instanceof Promise;function __classPrivateFieldGet(E,y,R,k){if(typeof y=="function"?E!==y||!k:!y.has(E))throw new TypeError("Cannot read private member from an object whose class did not declare it");return y.get(E)}function __classPrivateFieldSet(E,y,R,k,H){if(typeof y=="function"?E!==y||!H:!y.has(E))throw new TypeError("Cannot write private member to an object whose class did not declare it");return y.set(E,R),R}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(E){E.errToObj=y=>typeof y=="string"?{message:y}:y||{},E.toString=y=>typeof y=="string"?y:y==null?void 0:y.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(y,R,k,H){this._cachedPath=[],this.parent=y,this.data=R,this._path=k,this._key=H}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(E,y)=>{if(isValid$1(y))return{success:!0,data:y.value};if(!E.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const R=new ZodError(E.common.issues);return this._error=R,this._error}}};function processCreateParams(E){if(!E)return{};const{errorMap:y,invalid_type_error:R,required_error:k,description:H}=E;if(y&&(R||k))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return y?{errorMap:y,description:H}:{errorMap:(te,ae)=>{var ce,Ce;const{message:Oe}=E;return te.code==="invalid_enum_value"?{message:Oe??ae.defaultError}:typeof ae.data>"u"?{message:(ce=Oe??k)!==null&&ce!==void 0?ce:ae.defaultError}:te.code!=="invalid_type"?{message:ae.defaultError}:{message:(Ce=Oe??R)!==null&&Ce!==void 0?Ce:ae.defaultError}},description:H}}class ZodType{constructor(y){this.spa=this.safeParseAsync,this._def=y,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(y){return getParsedType(y.data)}_getOrReturnCtx(y,R){return R||{common:y.parent.common,data:y.data,parsedType:getParsedType(y.data),schemaErrorMap:this._def.errorMap,path:y.path,parent:y.parent}}_processInputParams(y){return{status:new ParseStatus,ctx:{common:y.parent.common,data:y.data,parsedType:getParsedType(y.data),schemaErrorMap:this._def.errorMap,path:y.path,parent:y.parent}}}_parseSync(y){const R=this._parse(y);if(isAsync(R))throw new Error("Synchronous parse encountered promise.");return R}_parseAsync(y){const R=this._parse(y);return Promise.resolve(R)}parse(y,R){const k=this.safeParse(y,R);if(k.success)return k.data;throw k.error}safeParse(y,R){var k;const H={common:{issues:[],async:(k=R==null?void 0:R.async)!==null&&k!==void 0?k:!1,contextualErrorMap:R==null?void 0:R.errorMap},path:(R==null?void 0:R.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:y,parsedType:getParsedType(y)},B=this._parseSync({data:y,path:H.path,parent:H});return handleResult(H,B)}async parseAsync(y,R){const k=await this.safeParseAsync(y,R);if(k.success)return k.data;throw k.error}async safeParseAsync(y,R){const k={common:{issues:[],contextualErrorMap:R==null?void 0:R.errorMap,async:!0},path:(R==null?void 0:R.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:y,parsedType:getParsedType(y)},H=this._parse({data:y,path:k.path,parent:k}),B=await(isAsync(H)?H:Promise.resolve(H));return handleResult(k,B)}refine(y,R){const k=H=>typeof R=="string"||typeof R>"u"?{message:R}:typeof R=="function"?R(H):R;return this._refinement((H,B)=>{const te=y(H),ae=()=>B.addIssue({code:ZodIssueCode.custom,...k(H)});return typeof Promise<"u"&&te instanceof Promise?te.then(ce=>ce?!0:(ae(),!1)):te?!0:(ae(),!1)})}refinement(y,R){return this._refinement((k,H)=>y(k)?!0:(H.addIssue(typeof R=="function"?R(k,H):R),!1))}_refinement(y){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:y}})}superRefine(y){return this._refinement(y)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(y){return ZodUnion.create([this,y],this._def)}and(y){return ZodIntersection.create(this,y,this._def)}transform(y){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:y}})}default(y){const R=typeof y=="function"?y:()=>y;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:R,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(y){const R=typeof y=="function"?y:()=>y;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:R,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(y){const R=this.constructor;return new R({...this._def,description:y})}pipe(y){return ZodPipeline.create(this,y)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(E){let y="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return E.precision?y=`${y}\\.\\d{${E.precision}}`:E.precision==null&&(y=`${y}(\\.\\d+)?`),y}function timeRegex(E){return new RegExp(`^${timeRegexSource(E)}$`)}function datetimeRegex(E){let y=`${dateRegexSource}T${timeRegexSource(E)}`;const R=[];return R.push(E.local?"Z?":"Z"),E.offset&&R.push("([+-]\\d{2}:?\\d{2})"),y=`${y}(${R.join("|")})`,new RegExp(`^${y}$`)}function isValidIP(E,y){return!!((y==="v4"||!y)&&ipv4Regex.test(E)||(y==="v6"||!y)&&ipv6Regex.test(E))}class ZodString extends ZodType{_parse(y){if(this._def.coerce&&(y.data=String(y.data)),this._getType(y)!==ZodParsedType.string){const B=this._getOrReturnCtx(y);return addIssueToContext(B,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:B.parsedType}),INVALID}const k=new ParseStatus;let H;for(const B of this._def.checks)if(B.kind==="min")y.data.lengthB.value&&(H=this._getOrReturnCtx(y,H),addIssueToContext(H,{code:ZodIssueCode.too_big,maximum:B.value,type:"string",inclusive:!0,exact:!1,message:B.message}),k.dirty());else if(B.kind==="length"){const te=y.data.length>B.value,ae=y.data.lengthy.test(H),{validation:R,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(k)})}_addCheck(y){return new ZodString({...this._def,checks:[...this._def.checks,y]})}email(y){return this._addCheck({kind:"email",...errorUtil.errToObj(y)})}url(y){return this._addCheck({kind:"url",...errorUtil.errToObj(y)})}emoji(y){return this._addCheck({kind:"emoji",...errorUtil.errToObj(y)})}uuid(y){return this._addCheck({kind:"uuid",...errorUtil.errToObj(y)})}nanoid(y){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(y)})}cuid(y){return this._addCheck({kind:"cuid",...errorUtil.errToObj(y)})}cuid2(y){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(y)})}ulid(y){return this._addCheck({kind:"ulid",...errorUtil.errToObj(y)})}base64(y){return this._addCheck({kind:"base64",...errorUtil.errToObj(y)})}ip(y){return this._addCheck({kind:"ip",...errorUtil.errToObj(y)})}datetime(y){var R,k;return typeof y=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:y}):this._addCheck({kind:"datetime",precision:typeof(y==null?void 0:y.precision)>"u"?null:y==null?void 0:y.precision,offset:(R=y==null?void 0:y.offset)!==null&&R!==void 0?R:!1,local:(k=y==null?void 0:y.local)!==null&&k!==void 0?k:!1,...errorUtil.errToObj(y==null?void 0:y.message)})}date(y){return this._addCheck({kind:"date",message:y})}time(y){return typeof y=="string"?this._addCheck({kind:"time",precision:null,message:y}):this._addCheck({kind:"time",precision:typeof(y==null?void 0:y.precision)>"u"?null:y==null?void 0:y.precision,...errorUtil.errToObj(y==null?void 0:y.message)})}duration(y){return this._addCheck({kind:"duration",...errorUtil.errToObj(y)})}regex(y,R){return this._addCheck({kind:"regex",regex:y,...errorUtil.errToObj(R)})}includes(y,R){return this._addCheck({kind:"includes",value:y,position:R==null?void 0:R.position,...errorUtil.errToObj(R==null?void 0:R.message)})}startsWith(y,R){return this._addCheck({kind:"startsWith",value:y,...errorUtil.errToObj(R)})}endsWith(y,R){return this._addCheck({kind:"endsWith",value:y,...errorUtil.errToObj(R)})}min(y,R){return this._addCheck({kind:"min",value:y,...errorUtil.errToObj(R)})}max(y,R){return this._addCheck({kind:"max",value:y,...errorUtil.errToObj(R)})}length(y,R){return this._addCheck({kind:"length",value:y,...errorUtil.errToObj(R)})}nonempty(y){return this.min(1,errorUtil.errToObj(y))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(y=>y.kind==="datetime")}get isDate(){return!!this._def.checks.find(y=>y.kind==="date")}get isTime(){return!!this._def.checks.find(y=>y.kind==="time")}get isDuration(){return!!this._def.checks.find(y=>y.kind==="duration")}get isEmail(){return!!this._def.checks.find(y=>y.kind==="email")}get isURL(){return!!this._def.checks.find(y=>y.kind==="url")}get isEmoji(){return!!this._def.checks.find(y=>y.kind==="emoji")}get isUUID(){return!!this._def.checks.find(y=>y.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(y=>y.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(y=>y.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(y=>y.kind==="cuid2")}get isULID(){return!!this._def.checks.find(y=>y.kind==="ulid")}get isIP(){return!!this._def.checks.find(y=>y.kind==="ip")}get isBase64(){return!!this._def.checks.find(y=>y.kind==="base64")}get minLength(){let y=null;for(const R of this._def.checks)R.kind==="min"&&(y===null||R.value>y)&&(y=R.value);return y}get maxLength(){let y=null;for(const R of this._def.checks)R.kind==="max"&&(y===null||R.value{var y;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(y=E==null?void 0:E.coerce)!==null&&y!==void 0?y:!1,...processCreateParams(E)})};function floatSafeRemainder(E,y){const R=(E.toString().split(".")[1]||"").length,k=(y.toString().split(".")[1]||"").length,H=R>k?R:k,B=parseInt(E.toFixed(H).replace(".","")),te=parseInt(y.toFixed(H).replace(".",""));return B%te/Math.pow(10,H)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(y){if(this._def.coerce&&(y.data=Number(y.data)),this._getType(y)!==ZodParsedType.number){const B=this._getOrReturnCtx(y);return addIssueToContext(B,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:B.parsedType}),INVALID}let k;const H=new ParseStatus;for(const B of this._def.checks)B.kind==="int"?util.isInteger(y.data)||(k=this._getOrReturnCtx(y,k),addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:B.message}),H.dirty()):B.kind==="min"?(B.inclusive?y.dataB.value:y.data>=B.value)&&(k=this._getOrReturnCtx(y,k),addIssueToContext(k,{code:ZodIssueCode.too_big,maximum:B.value,type:"number",inclusive:B.inclusive,exact:!1,message:B.message}),H.dirty()):B.kind==="multipleOf"?floatSafeRemainder(y.data,B.value)!==0&&(k=this._getOrReturnCtx(y,k),addIssueToContext(k,{code:ZodIssueCode.not_multiple_of,multipleOf:B.value,message:B.message}),H.dirty()):B.kind==="finite"?Number.isFinite(y.data)||(k=this._getOrReturnCtx(y,k),addIssueToContext(k,{code:ZodIssueCode.not_finite,message:B.message}),H.dirty()):util.assertNever(B);return{status:H.value,value:y.data}}gte(y,R){return this.setLimit("min",y,!0,errorUtil.toString(R))}gt(y,R){return this.setLimit("min",y,!1,errorUtil.toString(R))}lte(y,R){return this.setLimit("max",y,!0,errorUtil.toString(R))}lt(y,R){return this.setLimit("max",y,!1,errorUtil.toString(R))}setLimit(y,R,k,H){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:y,value:R,inclusive:k,message:errorUtil.toString(H)}]})}_addCheck(y){return new ZodNumber({...this._def,checks:[...this._def.checks,y]})}int(y){return this._addCheck({kind:"int",message:errorUtil.toString(y)})}positive(y){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(y)})}negative(y){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(y)})}nonpositive(y){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(y)})}nonnegative(y){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(y)})}multipleOf(y,R){return this._addCheck({kind:"multipleOf",value:y,message:errorUtil.toString(R)})}finite(y){return this._addCheck({kind:"finite",message:errorUtil.toString(y)})}safe(y){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(y)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(y)})}get minValue(){let y=null;for(const R of this._def.checks)R.kind==="min"&&(y===null||R.value>y)&&(y=R.value);return y}get maxValue(){let y=null;for(const R of this._def.checks)R.kind==="max"&&(y===null||R.valuey.kind==="int"||y.kind==="multipleOf"&&util.isInteger(y.value))}get isFinite(){let y=null,R=null;for(const k of this._def.checks){if(k.kind==="finite"||k.kind==="int"||k.kind==="multipleOf")return!0;k.kind==="min"?(R===null||k.value>R)&&(R=k.value):k.kind==="max"&&(y===null||k.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(E==null?void 0:E.coerce)||!1,...processCreateParams(E)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(y){if(this._def.coerce&&(y.data=BigInt(y.data)),this._getType(y)!==ZodParsedType.bigint){const B=this._getOrReturnCtx(y);return addIssueToContext(B,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:B.parsedType}),INVALID}let k;const H=new ParseStatus;for(const B of this._def.checks)B.kind==="min"?(B.inclusive?y.dataB.value:y.data>=B.value)&&(k=this._getOrReturnCtx(y,k),addIssueToContext(k,{code:ZodIssueCode.too_big,type:"bigint",maximum:B.value,inclusive:B.inclusive,message:B.message}),H.dirty()):B.kind==="multipleOf"?y.data%B.value!==BigInt(0)&&(k=this._getOrReturnCtx(y,k),addIssueToContext(k,{code:ZodIssueCode.not_multiple_of,multipleOf:B.value,message:B.message}),H.dirty()):util.assertNever(B);return{status:H.value,value:y.data}}gte(y,R){return this.setLimit("min",y,!0,errorUtil.toString(R))}gt(y,R){return this.setLimit("min",y,!1,errorUtil.toString(R))}lte(y,R){return this.setLimit("max",y,!0,errorUtil.toString(R))}lt(y,R){return this.setLimit("max",y,!1,errorUtil.toString(R))}setLimit(y,R,k,H){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:y,value:R,inclusive:k,message:errorUtil.toString(H)}]})}_addCheck(y){return new ZodBigInt({...this._def,checks:[...this._def.checks,y]})}positive(y){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(y)})}negative(y){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(y)})}nonpositive(y){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(y)})}nonnegative(y){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(y)})}multipleOf(y,R){return this._addCheck({kind:"multipleOf",value:y,message:errorUtil.toString(R)})}get minValue(){let y=null;for(const R of this._def.checks)R.kind==="min"&&(y===null||R.value>y)&&(y=R.value);return y}get maxValue(){let y=null;for(const R of this._def.checks)R.kind==="max"&&(y===null||R.value{var y;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(y=E==null?void 0:E.coerce)!==null&&y!==void 0?y:!1,...processCreateParams(E)})};class ZodBoolean extends ZodType{_parse(y){if(this._def.coerce&&(y.data=!!y.data),this._getType(y)!==ZodParsedType.boolean){const k=this._getOrReturnCtx(y);return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:k.parsedType}),INVALID}return OK(y.data)}}ZodBoolean.create=E=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(E==null?void 0:E.coerce)||!1,...processCreateParams(E)});class ZodDate extends ZodType{_parse(y){if(this._def.coerce&&(y.data=new Date(y.data)),this._getType(y)!==ZodParsedType.date){const B=this._getOrReturnCtx(y);return addIssueToContext(B,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:B.parsedType}),INVALID}if(isNaN(y.data.getTime())){const B=this._getOrReturnCtx(y);return addIssueToContext(B,{code:ZodIssueCode.invalid_date}),INVALID}const k=new ParseStatus;let H;for(const B of this._def.checks)B.kind==="min"?y.data.getTime()B.value&&(H=this._getOrReturnCtx(y,H),addIssueToContext(H,{code:ZodIssueCode.too_big,message:B.message,inclusive:!0,exact:!1,maximum:B.value,type:"date"}),k.dirty()):util.assertNever(B);return{status:k.value,value:new Date(y.data.getTime())}}_addCheck(y){return new ZodDate({...this._def,checks:[...this._def.checks,y]})}min(y,R){return this._addCheck({kind:"min",value:y.getTime(),message:errorUtil.toString(R)})}max(y,R){return this._addCheck({kind:"max",value:y.getTime(),message:errorUtil.toString(R)})}get minDate(){let y=null;for(const R of this._def.checks)R.kind==="min"&&(y===null||R.value>y)&&(y=R.value);return y!=null?new Date(y):null}get maxDate(){let y=null;for(const R of this._def.checks)R.kind==="max"&&(y===null||R.valuenew ZodDate({checks:[],coerce:(E==null?void 0:E.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(E)});class ZodSymbol extends ZodType{_parse(y){if(this._getType(y)!==ZodParsedType.symbol){const k=this._getOrReturnCtx(y);return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:k.parsedType}),INVALID}return OK(y.data)}}ZodSymbol.create=E=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(E)});class ZodUndefined extends ZodType{_parse(y){if(this._getType(y)!==ZodParsedType.undefined){const k=this._getOrReturnCtx(y);return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:k.parsedType}),INVALID}return OK(y.data)}}ZodUndefined.create=E=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(E)});class ZodNull extends ZodType{_parse(y){if(this._getType(y)!==ZodParsedType.null){const k=this._getOrReturnCtx(y);return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:k.parsedType}),INVALID}return OK(y.data)}}ZodNull.create=E=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(E)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(y){return OK(y.data)}}ZodAny.create=E=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(E)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(y){return OK(y.data)}}ZodUnknown.create=E=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(E)});class ZodNever extends ZodType{_parse(y){const R=this._getOrReturnCtx(y);return addIssueToContext(R,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:R.parsedType}),INVALID}}ZodNever.create=E=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(E)});class ZodVoid extends ZodType{_parse(y){if(this._getType(y)!==ZodParsedType.undefined){const k=this._getOrReturnCtx(y);return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:k.parsedType}),INVALID}return OK(y.data)}}ZodVoid.create=E=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(E)});class ZodArray extends ZodType{_parse(y){const{ctx:R,status:k}=this._processInputParams(y),H=this._def;if(R.parsedType!==ZodParsedType.array)return addIssueToContext(R,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:R.parsedType}),INVALID;if(H.exactLength!==null){const te=R.data.length>H.exactLength.value,ae=R.data.lengthH.maxLength.value&&(addIssueToContext(R,{code:ZodIssueCode.too_big,maximum:H.maxLength.value,type:"array",inclusive:!0,exact:!1,message:H.maxLength.message}),k.dirty()),R.common.async)return Promise.all([...R.data].map((te,ae)=>H.type._parseAsync(new ParseInputLazyPath(R,te,R.path,ae)))).then(te=>ParseStatus.mergeArray(k,te));const B=[...R.data].map((te,ae)=>H.type._parseSync(new ParseInputLazyPath(R,te,R.path,ae)));return ParseStatus.mergeArray(k,B)}get element(){return this._def.type}min(y,R){return new ZodArray({...this._def,minLength:{value:y,message:errorUtil.toString(R)}})}max(y,R){return new ZodArray({...this._def,maxLength:{value:y,message:errorUtil.toString(R)}})}length(y,R){return new ZodArray({...this._def,exactLength:{value:y,message:errorUtil.toString(R)}})}nonempty(y){return this.min(1,y)}}ZodArray.create=(E,y)=>new ZodArray({type:E,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(y)});function deepPartialify(E){if(E instanceof ZodObject){const y={};for(const R in E.shape){const k=E.shape[R];y[R]=ZodOptional.create(deepPartialify(k))}return new ZodObject({...E._def,shape:()=>y})}else return E instanceof ZodArray?new ZodArray({...E._def,type:deepPartialify(E.element)}):E instanceof ZodOptional?ZodOptional.create(deepPartialify(E.unwrap())):E instanceof ZodNullable?ZodNullable.create(deepPartialify(E.unwrap())):E instanceof ZodTuple?ZodTuple.create(E.items.map(y=>deepPartialify(y))):E}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const y=this._def.shape(),R=util.objectKeys(y);return this._cached={shape:y,keys:R}}_parse(y){if(this._getType(y)!==ZodParsedType.object){const Ce=this._getOrReturnCtx(y);return addIssueToContext(Ce,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:Ce.parsedType}),INVALID}const{status:k,ctx:H}=this._processInputParams(y),{shape:B,keys:te}=this._getCached(),ae=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const Ce in H.data)te.includes(Ce)||ae.push(Ce);const ce=[];for(const Ce of te){const Oe=B[Ce],Le=H.data[Ce];ce.push({key:{status:"valid",value:Ce},value:Oe._parse(new ParseInputLazyPath(H,Le,H.path,Ce)),alwaysSet:Ce in H.data})}if(this._def.catchall instanceof ZodNever){const Ce=this._def.unknownKeys;if(Ce==="passthrough")for(const Oe of ae)ce.push({key:{status:"valid",value:Oe},value:{status:"valid",value:H.data[Oe]}});else if(Ce==="strict")ae.length>0&&(addIssueToContext(H,{code:ZodIssueCode.unrecognized_keys,keys:ae}),k.dirty());else if(Ce!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Ce=this._def.catchall;for(const Oe of ae){const Le=H.data[Oe];ce.push({key:{status:"valid",value:Oe},value:Ce._parse(new ParseInputLazyPath(H,Le,H.path,Oe)),alwaysSet:Oe in H.data})}}return H.common.async?Promise.resolve().then(async()=>{const Ce=[];for(const Oe of ce){const Le=await Oe.key,Ne=await Oe.value;Ce.push({key:Le,value:Ne,alwaysSet:Oe.alwaysSet})}return Ce}).then(Ce=>ParseStatus.mergeObjectSync(k,Ce)):ParseStatus.mergeObjectSync(k,ce)}get shape(){return this._def.shape()}strict(y){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...y!==void 0?{errorMap:(R,k)=>{var H,B,te,ae;const ce=(te=(B=(H=this._def).errorMap)===null||B===void 0?void 0:B.call(H,R,k).message)!==null&&te!==void 0?te:k.defaultError;return R.code==="unrecognized_keys"?{message:(ae=errorUtil.errToObj(y).message)!==null&&ae!==void 0?ae:ce}:{message:ce}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(y){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...y})})}merge(y){return new ZodObject({unknownKeys:y._def.unknownKeys,catchall:y._def.catchall,shape:()=>({...this._def.shape(),...y._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(y,R){return this.augment({[y]:R})}catchall(y){return new ZodObject({...this._def,catchall:y})}pick(y){const R={};return util.objectKeys(y).forEach(k=>{y[k]&&this.shape[k]&&(R[k]=this.shape[k])}),new ZodObject({...this._def,shape:()=>R})}omit(y){const R={};return util.objectKeys(this.shape).forEach(k=>{y[k]||(R[k]=this.shape[k])}),new ZodObject({...this._def,shape:()=>R})}deepPartial(){return deepPartialify(this)}partial(y){const R={};return util.objectKeys(this.shape).forEach(k=>{const H=this.shape[k];y&&!y[k]?R[k]=H:R[k]=H.optional()}),new ZodObject({...this._def,shape:()=>R})}required(y){const R={};return util.objectKeys(this.shape).forEach(k=>{if(y&&!y[k])R[k]=this.shape[k];else{let B=this.shape[k];for(;B instanceof ZodOptional;)B=B._def.innerType;R[k]=B}}),new ZodObject({...this._def,shape:()=>R})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(E,y)=>new ZodObject({shape:()=>E,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(y)});ZodObject.strictCreate=(E,y)=>new ZodObject({shape:()=>E,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(y)});ZodObject.lazycreate=(E,y)=>new ZodObject({shape:E,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(y)});class ZodUnion extends ZodType{_parse(y){const{ctx:R}=this._processInputParams(y),k=this._def.options;function H(B){for(const ae of B)if(ae.result.status==="valid")return ae.result;for(const ae of B)if(ae.result.status==="dirty")return R.common.issues.push(...ae.ctx.common.issues),ae.result;const te=B.map(ae=>new ZodError(ae.ctx.common.issues));return addIssueToContext(R,{code:ZodIssueCode.invalid_union,unionErrors:te}),INVALID}if(R.common.async)return Promise.all(k.map(async B=>{const te={...R,common:{...R.common,issues:[]},parent:null};return{result:await B._parseAsync({data:R.data,path:R.path,parent:te}),ctx:te}})).then(H);{let B;const te=[];for(const ce of k){const Ce={...R,common:{...R.common,issues:[]},parent:null},Oe=ce._parseSync({data:R.data,path:R.path,parent:Ce});if(Oe.status==="valid")return Oe;Oe.status==="dirty"&&!B&&(B={result:Oe,ctx:Ce}),Ce.common.issues.length&&te.push(Ce.common.issues)}if(B)return R.common.issues.push(...B.ctx.common.issues),B.result;const ae=te.map(ce=>new ZodError(ce));return addIssueToContext(R,{code:ZodIssueCode.invalid_union,unionErrors:ae}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(E,y)=>new ZodUnion({options:E,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(y)});const getDiscriminator=E=>E instanceof ZodLazy?getDiscriminator(E.schema):E instanceof ZodEffects?getDiscriminator(E.innerType()):E instanceof ZodLiteral?[E.value]:E instanceof ZodEnum?E.options:E instanceof ZodNativeEnum?util.objectValues(E.enum):E instanceof ZodDefault?getDiscriminator(E._def.innerType):E instanceof ZodUndefined?[void 0]:E instanceof ZodNull?[null]:E instanceof ZodOptional?[void 0,...getDiscriminator(E.unwrap())]:E instanceof ZodNullable?[null,...getDiscriminator(E.unwrap())]:E instanceof ZodBranded||E instanceof ZodReadonly?getDiscriminator(E.unwrap()):E instanceof ZodCatch?getDiscriminator(E._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(y){const{ctx:R}=this._processInputParams(y);if(R.parsedType!==ZodParsedType.object)return addIssueToContext(R,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:R.parsedType}),INVALID;const k=this.discriminator,H=R.data[k],B=this.optionsMap.get(H);return B?R.common.async?B._parseAsync({data:R.data,path:R.path,parent:R}):B._parseSync({data:R.data,path:R.path,parent:R}):(addIssueToContext(R,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[k]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(y,R,k){const H=new Map;for(const B of R){const te=getDiscriminator(B.shape[y]);if(!te.length)throw new Error(`A discriminator value for key \`${y}\` could not be extracted from all schema options`);for(const ae of te){if(H.has(ae))throw new Error(`Discriminator property ${String(y)} has duplicate value ${String(ae)}`);H.set(ae,B)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:y,options:R,optionsMap:H,...processCreateParams(k)})}}function mergeValues(E,y){const R=getParsedType(E),k=getParsedType(y);if(E===y)return{valid:!0,data:E};if(R===ZodParsedType.object&&k===ZodParsedType.object){const H=util.objectKeys(y),B=util.objectKeys(E).filter(ae=>H.indexOf(ae)!==-1),te={...E,...y};for(const ae of B){const ce=mergeValues(E[ae],y[ae]);if(!ce.valid)return{valid:!1};te[ae]=ce.data}return{valid:!0,data:te}}else if(R===ZodParsedType.array&&k===ZodParsedType.array){if(E.length!==y.length)return{valid:!1};const H=[];for(let B=0;B{if(isAborted(B)||isAborted(te))return INVALID;const ae=mergeValues(B.value,te.value);return ae.valid?((isDirty(B)||isDirty(te))&&R.dirty(),{status:R.value,value:ae.data}):(addIssueToContext(k,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return k.common.async?Promise.all([this._def.left._parseAsync({data:k.data,path:k.path,parent:k}),this._def.right._parseAsync({data:k.data,path:k.path,parent:k})]).then(([B,te])=>H(B,te)):H(this._def.left._parseSync({data:k.data,path:k.path,parent:k}),this._def.right._parseSync({data:k.data,path:k.path,parent:k}))}}ZodIntersection.create=(E,y,R)=>new ZodIntersection({left:E,right:y,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(R)});class ZodTuple extends ZodType{_parse(y){const{status:R,ctx:k}=this._processInputParams(y);if(k.parsedType!==ZodParsedType.array)return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:k.parsedType}),INVALID;if(k.data.lengththis._def.items.length&&(addIssueToContext(k,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R.dirty());const B=[...k.data].map((te,ae)=>{const ce=this._def.items[ae]||this._def.rest;return ce?ce._parse(new ParseInputLazyPath(k,te,k.path,ae)):null}).filter(te=>!!te);return k.common.async?Promise.all(B).then(te=>ParseStatus.mergeArray(R,te)):ParseStatus.mergeArray(R,B)}get items(){return this._def.items}rest(y){return new ZodTuple({...this._def,rest:y})}}ZodTuple.create=(E,y)=>{if(!Array.isArray(E))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:E,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(y)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(y){const{status:R,ctx:k}=this._processInputParams(y);if(k.parsedType!==ZodParsedType.object)return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:k.parsedType}),INVALID;const H=[],B=this._def.keyType,te=this._def.valueType;for(const ae in k.data)H.push({key:B._parse(new ParseInputLazyPath(k,ae,k.path,ae)),value:te._parse(new ParseInputLazyPath(k,k.data[ae],k.path,ae)),alwaysSet:ae in k.data});return k.common.async?ParseStatus.mergeObjectAsync(R,H):ParseStatus.mergeObjectSync(R,H)}get element(){return this._def.valueType}static create(y,R,k){return R instanceof ZodType?new ZodRecord({keyType:y,valueType:R,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(k)}):new ZodRecord({keyType:ZodString.create(),valueType:y,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(R)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(y){const{status:R,ctx:k}=this._processInputParams(y);if(k.parsedType!==ZodParsedType.map)return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:k.parsedType}),INVALID;const H=this._def.keyType,B=this._def.valueType,te=[...k.data.entries()].map(([ae,ce],Ce)=>({key:H._parse(new ParseInputLazyPath(k,ae,k.path,[Ce,"key"])),value:B._parse(new ParseInputLazyPath(k,ce,k.path,[Ce,"value"]))}));if(k.common.async){const ae=new Map;return Promise.resolve().then(async()=>{for(const ce of te){const Ce=await ce.key,Oe=await ce.value;if(Ce.status==="aborted"||Oe.status==="aborted")return INVALID;(Ce.status==="dirty"||Oe.status==="dirty")&&R.dirty(),ae.set(Ce.value,Oe.value)}return{status:R.value,value:ae}})}else{const ae=new Map;for(const ce of te){const Ce=ce.key,Oe=ce.value;if(Ce.status==="aborted"||Oe.status==="aborted")return INVALID;(Ce.status==="dirty"||Oe.status==="dirty")&&R.dirty(),ae.set(Ce.value,Oe.value)}return{status:R.value,value:ae}}}}ZodMap.create=(E,y,R)=>new ZodMap({valueType:y,keyType:E,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(R)});class ZodSet extends ZodType{_parse(y){const{status:R,ctx:k}=this._processInputParams(y);if(k.parsedType!==ZodParsedType.set)return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:k.parsedType}),INVALID;const H=this._def;H.minSize!==null&&k.data.sizeH.maxSize.value&&(addIssueToContext(k,{code:ZodIssueCode.too_big,maximum:H.maxSize.value,type:"set",inclusive:!0,exact:!1,message:H.maxSize.message}),R.dirty());const B=this._def.valueType;function te(ce){const Ce=new Set;for(const Oe of ce){if(Oe.status==="aborted")return INVALID;Oe.status==="dirty"&&R.dirty(),Ce.add(Oe.value)}return{status:R.value,value:Ce}}const ae=[...k.data.values()].map((ce,Ce)=>B._parse(new ParseInputLazyPath(k,ce,k.path,Ce)));return k.common.async?Promise.all(ae).then(ce=>te(ce)):te(ae)}min(y,R){return new ZodSet({...this._def,minSize:{value:y,message:errorUtil.toString(R)}})}max(y,R){return new ZodSet({...this._def,maxSize:{value:y,message:errorUtil.toString(R)}})}size(y,R){return this.min(y,R).max(y,R)}nonempty(y){return this.min(1,y)}}ZodSet.create=(E,y)=>new ZodSet({valueType:E,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(y)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(y){const{ctx:R}=this._processInputParams(y);if(R.parsedType!==ZodParsedType.function)return addIssueToContext(R,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:R.parsedType}),INVALID;function k(ae,ce){return makeIssue({data:ae,path:R.path,errorMaps:[R.common.contextualErrorMap,R.schemaErrorMap,getErrorMap(),errorMap].filter(Ce=>!!Ce),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:ce}})}function H(ae,ce){return makeIssue({data:ae,path:R.path,errorMaps:[R.common.contextualErrorMap,R.schemaErrorMap,getErrorMap(),errorMap].filter(Ce=>!!Ce),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:ce}})}const B={errorMap:R.common.contextualErrorMap},te=R.data;if(this._def.returns instanceof ZodPromise){const ae=this;return OK(async function(...ce){const Ce=new ZodError([]),Oe=await ae._def.args.parseAsync(ce,B).catch(Fe=>{throw Ce.addIssue(k(ce,Fe)),Ce}),Le=await Reflect.apply(te,this,Oe);return await ae._def.returns._def.type.parseAsync(Le,B).catch(Fe=>{throw Ce.addIssue(H(Le,Fe)),Ce})})}else{const ae=this;return OK(function(...ce){const Ce=ae._def.args.safeParse(ce,B);if(!Ce.success)throw new ZodError([k(ce,Ce.error)]);const Oe=Reflect.apply(te,this,Ce.data),Le=ae._def.returns.safeParse(Oe,B);if(!Le.success)throw new ZodError([H(Oe,Le.error)]);return Le.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...y){return new ZodFunction({...this._def,args:ZodTuple.create(y).rest(ZodUnknown.create())})}returns(y){return new ZodFunction({...this._def,returns:y})}implement(y){return this.parse(y)}strictImplement(y){return this.parse(y)}static create(y,R,k){return new ZodFunction({args:y||ZodTuple.create([]).rest(ZodUnknown.create()),returns:R||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(k)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(y){const{ctx:R}=this._processInputParams(y);return this._def.getter()._parse({data:R.data,path:R.path,parent:R})}}ZodLazy.create=(E,y)=>new ZodLazy({getter:E,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(y)});class ZodLiteral extends ZodType{_parse(y){if(y.data!==this._def.value){const R=this._getOrReturnCtx(y);return addIssueToContext(R,{received:R.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:y.data}}get value(){return this._def.value}}ZodLiteral.create=(E,y)=>new ZodLiteral({value:E,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(y)});function createZodEnum(E,y){return new ZodEnum({values:E,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(y)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(y){if(typeof y.data!="string"){const R=this._getOrReturnCtx(y),k=this._def.values;return addIssueToContext(R,{expected:util.joinValues(k),received:R.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(y.data)){const R=this._getOrReturnCtx(y),k=this._def.values;return addIssueToContext(R,{received:R.data,code:ZodIssueCode.invalid_enum_value,options:k}),INVALID}return OK(y.data)}get options(){return this._def.values}get enum(){const y={};for(const R of this._def.values)y[R]=R;return y}get Values(){const y={};for(const R of this._def.values)y[R]=R;return y}get Enum(){const y={};for(const R of this._def.values)y[R]=R;return y}extract(y,R=this._def){return ZodEnum.create(y,{...this._def,...R})}exclude(y,R=this._def){return ZodEnum.create(this.options.filter(k=>!y.includes(k)),{...this._def,...R})}}_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(y){const R=util.getValidEnumValues(this._def.values),k=this._getOrReturnCtx(y);if(k.parsedType!==ZodParsedType.string&&k.parsedType!==ZodParsedType.number){const H=util.objectValues(R);return addIssueToContext(k,{expected:util.joinValues(H),received:k.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(y.data)){const H=util.objectValues(R);return addIssueToContext(k,{received:k.data,code:ZodIssueCode.invalid_enum_value,options:H}),INVALID}return OK(y.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=(E,y)=>new ZodNativeEnum({values:E,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(y)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(y){const{ctx:R}=this._processInputParams(y);if(R.parsedType!==ZodParsedType.promise&&R.common.async===!1)return addIssueToContext(R,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:R.parsedType}),INVALID;const k=R.parsedType===ZodParsedType.promise?R.data:Promise.resolve(R.data);return OK(k.then(H=>this._def.type.parseAsync(H,{path:R.path,errorMap:R.common.contextualErrorMap})))}}ZodPromise.create=(E,y)=>new ZodPromise({type:E,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(y)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(y){const{status:R,ctx:k}=this._processInputParams(y),H=this._def.effect||null,B={addIssue:te=>{addIssueToContext(k,te),te.fatal?R.abort():R.dirty()},get path(){return k.path}};if(B.addIssue=B.addIssue.bind(B),H.type==="preprocess"){const te=H.transform(k.data,B);if(k.common.async)return Promise.resolve(te).then(async ae=>{if(R.value==="aborted")return INVALID;const ce=await this._def.schema._parseAsync({data:ae,path:k.path,parent:k});return ce.status==="aborted"?INVALID:ce.status==="dirty"||R.value==="dirty"?DIRTY(ce.value):ce});{if(R.value==="aborted")return INVALID;const ae=this._def.schema._parseSync({data:te,path:k.path,parent:k});return ae.status==="aborted"?INVALID:ae.status==="dirty"||R.value==="dirty"?DIRTY(ae.value):ae}}if(H.type==="refinement"){const te=ae=>{const ce=H.refinement(ae,B);if(k.common.async)return Promise.resolve(ce);if(ce instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return ae};if(k.common.async===!1){const ae=this._def.schema._parseSync({data:k.data,path:k.path,parent:k});return ae.status==="aborted"?INVALID:(ae.status==="dirty"&&R.dirty(),te(ae.value),{status:R.value,value:ae.value})}else return this._def.schema._parseAsync({data:k.data,path:k.path,parent:k}).then(ae=>ae.status==="aborted"?INVALID:(ae.status==="dirty"&&R.dirty(),te(ae.value).then(()=>({status:R.value,value:ae.value}))))}if(H.type==="transform")if(k.common.async===!1){const te=this._def.schema._parseSync({data:k.data,path:k.path,parent:k});if(!isValid$1(te))return te;const ae=H.transform(te.value,B);if(ae instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:R.value,value:ae}}else return this._def.schema._parseAsync({data:k.data,path:k.path,parent:k}).then(te=>isValid$1(te)?Promise.resolve(H.transform(te.value,B)).then(ae=>({status:R.value,value:ae})):te);util.assertNever(H)}}ZodEffects.create=(E,y,R)=>new ZodEffects({schema:E,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:y,...processCreateParams(R)});ZodEffects.createWithPreprocess=(E,y,R)=>new ZodEffects({schema:y,effect:{type:"preprocess",transform:E},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(R)});class ZodOptional extends ZodType{_parse(y){return this._getType(y)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(y)}unwrap(){return this._def.innerType}}ZodOptional.create=(E,y)=>new ZodOptional({innerType:E,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(y)});class ZodNullable extends ZodType{_parse(y){return this._getType(y)===ZodParsedType.null?OK(null):this._def.innerType._parse(y)}unwrap(){return this._def.innerType}}ZodNullable.create=(E,y)=>new ZodNullable({innerType:E,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(y)});class ZodDefault extends ZodType{_parse(y){const{ctx:R}=this._processInputParams(y);let k=R.data;return R.parsedType===ZodParsedType.undefined&&(k=this._def.defaultValue()),this._def.innerType._parse({data:k,path:R.path,parent:R})}removeDefault(){return this._def.innerType}}ZodDefault.create=(E,y)=>new ZodDefault({innerType:E,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof y.default=="function"?y.default:()=>y.default,...processCreateParams(y)});class ZodCatch extends ZodType{_parse(y){const{ctx:R}=this._processInputParams(y),k={...R,common:{...R.common,issues:[]}},H=this._def.innerType._parse({data:k.data,path:k.path,parent:{...k}});return isAsync(H)?H.then(B=>({status:"valid",value:B.status==="valid"?B.value:this._def.catchValue({get error(){return new ZodError(k.common.issues)},input:k.data})})):{status:"valid",value:H.status==="valid"?H.value:this._def.catchValue({get error(){return new ZodError(k.common.issues)},input:k.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(E,y)=>new ZodCatch({innerType:E,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof y.catch=="function"?y.catch:()=>y.catch,...processCreateParams(y)});class ZodNaN extends ZodType{_parse(y){if(this._getType(y)!==ZodParsedType.nan){const k=this._getOrReturnCtx(y);return addIssueToContext(k,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:k.parsedType}),INVALID}return{status:"valid",value:y.data}}}ZodNaN.create=E=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(E)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(y){const{ctx:R}=this._processInputParams(y),k=R.data;return this._def.type._parse({data:k,path:R.path,parent:R})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(y){const{status:R,ctx:k}=this._processInputParams(y);if(k.common.async)return(async()=>{const B=await this._def.in._parseAsync({data:k.data,path:k.path,parent:k});return B.status==="aborted"?INVALID:B.status==="dirty"?(R.dirty(),DIRTY(B.value)):this._def.out._parseAsync({data:B.value,path:k.path,parent:k})})();{const H=this._def.in._parseSync({data:k.data,path:k.path,parent:k});return H.status==="aborted"?INVALID:H.status==="dirty"?(R.dirty(),{status:"dirty",value:H.value}):this._def.out._parseSync({data:H.value,path:k.path,parent:k})}}static create(y,R){return new ZodPipeline({in:y,out:R,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(y){const R=this._def.innerType._parse(y);return isValid$1(R)&&(R.value=Object.freeze(R.value)),R}unwrap(){return this._def.innerType}}ZodReadonly.create=(E,y)=>new ZodReadonly({innerType:E,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(y)});function custom$1(E,y={},R){return E?ZodAny.create().superRefine((k,H)=>{var B,te;if(!E(k)){const ae=typeof y=="function"?y(k):typeof y=="string"?{message:y}:y,ce=(te=(B=ae.fatal)!==null&&B!==void 0?B:R)!==null&&te!==void 0?te:!0,Ce=typeof ae=="string"?{message:ae}:ae;H.addIssue({code:"custom",...Ce,fatal:ce})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(E){E.ZodString="ZodString",E.ZodNumber="ZodNumber",E.ZodNaN="ZodNaN",E.ZodBigInt="ZodBigInt",E.ZodBoolean="ZodBoolean",E.ZodDate="ZodDate",E.ZodSymbol="ZodSymbol",E.ZodUndefined="ZodUndefined",E.ZodNull="ZodNull",E.ZodAny="ZodAny",E.ZodUnknown="ZodUnknown",E.ZodNever="ZodNever",E.ZodVoid="ZodVoid",E.ZodArray="ZodArray",E.ZodObject="ZodObject",E.ZodUnion="ZodUnion",E.ZodDiscriminatedUnion="ZodDiscriminatedUnion",E.ZodIntersection="ZodIntersection",E.ZodTuple="ZodTuple",E.ZodRecord="ZodRecord",E.ZodMap="ZodMap",E.ZodSet="ZodSet",E.ZodFunction="ZodFunction",E.ZodLazy="ZodLazy",E.ZodLiteral="ZodLiteral",E.ZodEnum="ZodEnum",E.ZodEffects="ZodEffects",E.ZodNativeEnum="ZodNativeEnum",E.ZodOptional="ZodOptional",E.ZodNullable="ZodNullable",E.ZodDefault="ZodDefault",E.ZodCatch="ZodCatch",E.ZodPromise="ZodPromise",E.ZodBranded="ZodBranded",E.ZodPipeline="ZodPipeline",E.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(E,y={message:`Input not instance of ${E.name}`})=>custom$1(R=>R instanceof E,y),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:E=>ZodString.create({...E,coerce:!0}),number:E=>ZodNumber.create({...E,coerce:!0}),boolean:E=>ZodBoolean.create({...E,coerce:!0}),bigint:E=>ZodBigInt.create({...E,coerce:!0}),date:E=>ZodDate.create({...E,coerce:!0})},NEVER=INVALID;var z$1=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid:isValid$1,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom:custom$1,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});class NSchema{static id(){return z$1.string().regex(/^[0-9a-f]{64}$/)}static event(){return z$1.object({id:NSchema.id(),kind:z$1.number().int().nonnegative(),pubkey:NSchema.id(),tags:z$1.string().array().array(),content:z$1.string(),created_at:z$1.number(),sig:z$1.string()})}static filter(){return z$1.object({kinds:z$1.number().int().nonnegative().array().optional(),ids:NSchema.id().array().optional(),authors:NSchema.id().array().optional(),since:z$1.number().int().nonnegative().optional(),until:z$1.number().int().nonnegative().optional(),limit:z$1.number().int().nonnegative().optional(),search:z$1.string().optional()}).passthrough().transform(y=>{const R=["kinds","ids","authors","since","until","limit","search"];return Object.entries(y).reduce((k,[H,B])=>((R.includes(H)||H.startsWith("#"))&&(k[H]=B),k),{})})}static bech32(y){return z$1.string().regex(/^[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}$/).refine(R=>y?R.startsWith(`${y}1`):!0)}static clientEVENT(){return z$1.tuple([z$1.literal("EVENT"),NSchema.event()])}static clientREQ(){return z$1.tuple([z$1.literal("REQ"),z$1.string()]).rest(NSchema.filter())}static clientCOUNT(){return z$1.tuple([z$1.literal("COUNT"),z$1.string()]).rest(NSchema.filter())}static clientCLOSE(){return z$1.tuple([z$1.literal("CLOSE"),z$1.string()])}static clientAUTH(){return z$1.tuple([z$1.literal("AUTH"),NSchema.event()])}static clientMsg(){return z$1.union([NSchema.clientEVENT(),NSchema.clientREQ(),NSchema.clientCOUNT(),NSchema.clientCLOSE(),NSchema.clientAUTH()])}static relayEVENT(){return z$1.tuple([z$1.literal("EVENT"),z$1.string(),NSchema.event()])}static relayOK(){return z$1.tuple([z$1.literal("OK"),NSchema.id(),z$1.boolean(),z$1.string()])}static relayEOSE(){return z$1.tuple([z$1.literal("EOSE"),z$1.string()])}static relayNOTICE(){return z$1.tuple([z$1.literal("NOTICE"),z$1.string()])}static relayCLOSED(){return z$1.tuple([z$1.literal("CLOSED"),z$1.string(),z$1.string()])}static relayAUTH(){return z$1.tuple([z$1.literal("AUTH"),z$1.string()])}static relayCOUNT(){return z$1.tuple([z$1.literal("COUNT"),z$1.string(),z$1.object({count:z$1.number().int().nonnegative(),approximate:z$1.boolean().optional()})])}static relayMsg(){return z$1.union([NSchema.relayEVENT(),NSchema.relayOK(),NSchema.relayEOSE(),NSchema.relayNOTICE(),NSchema.relayCLOSED(),NSchema.relayAUTH(),NSchema.relayCOUNT()])}static metadata(){return z$1.object({name:z$1.string().optional().catch(void 0),about:z$1.string().optional().catch(void 0),picture:z$1.string().optional().catch(void 0),banner:z$1.string().optional().catch(void 0),nip05:z$1.string().optional().catch(void 0),lud06:z$1.string().optional().catch(void 0),lud16:z$1.string().optional().catch(void 0)}).passthrough()}static connectRequest(){return z$1.object({id:z$1.string(),method:z$1.string(),params:z$1.string().array()})}static connectResponse(){return z$1.object({id:z$1.string(),result:z$1.string(),error:z$1.string().optional()})}static json(){return z$1.string().transform((y,R)=>{try{return JSON.parse(y)}catch{return R.addIssue({code:z$1.ZodIssueCode.custom,message:"Invalid JSON"}),z$1.NEVER}})}}function isBytes(E){return E instanceof Uint8Array||E!=null&&typeof E=="object"&&E.constructor.name==="Uint8Array"}function bytes(E,...y){if(!isBytes(E))throw new Error("Uint8Array expected");if(y.length>0&&!y.includes(E.length))throw new Error(`Uint8Array expected of length ${y}, not of length=${E.length}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */new Uint8Array(new Uint32Array([287454020]).buffer)[0];const hexes=Array.from({length:256},(E,y)=>y.toString(16).padStart(2,"0"));function bytesToHex(E){bytes(E);let y="";for(let R=0;Rnip04_exports.encrypt(et(this,oo),y,R),decrypt:async(y,R)=>nip04_exports.decrypt(et(this,oo),y,R)});Jt(this,"nip44",{encrypt:async(y,R)=>{const k=jt(this,ma,gl).call(this,y);return nip44_exports.v2.encrypt(R,k)},decrypt:async(y,R)=>{const k=jt(this,ma,gl).call(this,y);return nip44_exports.v2.decrypt(R,k)}});It(this,oo,y)}async getPublicKey(){return getPublicKey(et(this,oo))}async signEvent(y){return finalizeEvent(y,et(this,oo))}}oo=new WeakMap,ma=new WeakSet,gl=function(y){const R=bytesToHex(et(this,oo));return nip44_exports.v2.utils.getConversationKey(R,y)};var _computedKey;_computedKey=Symbol.asyncIterator;var Si,gi,Sa;class Machina{constructor(y){wt(this,Si,[]);wt(this,gi);wt(this,Sa,!1);y!=null&&y.aborted?this.abort():y==null||y.addEventListener("abort",()=>this.abort(),{once:!0})}async*[_computedKey](){for(;!et(this,Sa);){if(et(this,Si).length){yield et(this,Si).shift();continue}await new Promise(y=>{It(this,gi,y)})}throw new DOMException("The signal has been aborted","AbortError")}push(y){var R;et(this,Si).push(y),(R=et(this,gi))==null||R.call(this)}abort(){var y;It(this,Sa,!0),(y=et(this,gi))==null||y.call(this)}}Si=new WeakMap,gi=new WeakMap,Sa=new WeakMap;class ExponentialBackoff{constructor(y,R){if(this._retries=0,!Number.isInteger(y)||y<0)throw new Error("Base must be a positive integer or zero");if(R!==void 0&&(!Number.isInteger(R)||R<0))throw new Error("ExpMax must be a undefined, a positive integer or zero");this.base=y,this.expMax=R,this.i=0}get retries(){return this._retries}get current(){return this.base*Math.pow(2,this.i)}next(){return this._retries++,this.i=this.expMax===void 0?this.i+1:Math.min(this.i+1,this.expMax),this.current}reset(){this._retries=0,this.i=0}}class ArrayQueue{constructor(){this.elements=[]}add(y){this.elements.push(y)}clear(){this.elements.length=0}forEach(y){this.elements.forEach(y)}length(){return this.elements.length}isEmpty(){return this.elements.length===0}peek(){return this.elements[0]}read(){return this.elements.shift()}}var WebsocketEvent;(function(E){E.open="open",E.close="close",E.error="error",E.message="message",E.retry="retry",E.reconnect="reconnect"})(WebsocketEvent||(WebsocketEvent={}));class Websocket{constructor(y,R,k){var H,B,te,ae,ce,Ce,Oe,Le,Ne,Fe,Ue,De,$e,Be,Ve;this._closedByUser=!1,this.handleOpenEvent=Ke=>this.handleEvent(WebsocketEvent.open,Ke),this.handleErrorEvent=Ke=>this.handleEvent(WebsocketEvent.error,Ke),this.handleCloseEvent=Ke=>this.handleEvent(WebsocketEvent.close,Ke),this.handleMessageEvent=Ke=>this.handleEvent(WebsocketEvent.message,Ke),this._url=y,this._protocols=R,this._options={buffer:k==null?void 0:k.buffer,retry:{maxRetries:(H=k==null?void 0:k.retry)===null||H===void 0?void 0:H.maxRetries,instantReconnect:(B=k==null?void 0:k.retry)===null||B===void 0?void 0:B.instantReconnect,backoff:(te=k==null?void 0:k.retry)===null||te===void 0?void 0:te.backoff},listeners:{open:[...(ce=(ae=k==null?void 0:k.listeners)===null||ae===void 0?void 0:ae.open)!==null&&ce!==void 0?ce:[]],close:[...(Oe=(Ce=k==null?void 0:k.listeners)===null||Ce===void 0?void 0:Ce.close)!==null&&Oe!==void 0?Oe:[]],error:[...(Ne=(Le=k==null?void 0:k.listeners)===null||Le===void 0?void 0:Le.error)!==null&&Ne!==void 0?Ne:[]],message:[...(Ue=(Fe=k==null?void 0:k.listeners)===null||Fe===void 0?void 0:Fe.message)!==null&&Ue!==void 0?Ue:[]],retry:[...($e=(De=k==null?void 0:k.listeners)===null||De===void 0?void 0:De.retry)!==null&&$e!==void 0?$e:[]],reconnect:[...(Ve=(Be=k==null?void 0:k.listeners)===null||Be===void 0?void 0:Be.reconnect)!==null&&Ve!==void 0?Ve:[]]}},this._underlyingWebsocket=this.tryConnect()}get url(){return this._url}get protocols(){return this._protocols}get buffer(){return this._options.buffer}get maxRetries(){return this._options.retry.maxRetries}get instantReconnect(){return this._options.retry.instantReconnect}get backoff(){return this._options.retry.backoff}get closedByUser(){return this._closedByUser}get lastConnection(){return this._lastConnection}get underlyingWebsocket(){return this._underlyingWebsocket}get readyState(){return this._underlyingWebsocket.readyState}get bufferedAmount(){return this._underlyingWebsocket.bufferedAmount}get extensions(){return this._underlyingWebsocket.extensions}get binaryType(){return this._underlyingWebsocket.binaryType}set binaryType(y){this._underlyingWebsocket.binaryType=y}send(y){this.closedByUser||(this._underlyingWebsocket.readyState===this._underlyingWebsocket.OPEN?this._underlyingWebsocket.send(y):this.buffer!==void 0&&this.buffer.add(y))}close(y,R){this.cancelScheduledConnectionRetry(),this._closedByUser=!0,this._underlyingWebsocket.close(y,R)}addEventListener(y,R,k){this._options.listeners[y].push({listener:R,options:k})}removeEventListener(y,R,k){const H=B=>B.listener!==R||B.options!==k;this._options.listeners[y]=this._options.listeners[y].filter(H)}tryConnect(){return this._underlyingWebsocket=new WebSocket(this.url,this.protocols),this._underlyingWebsocket.addEventListener(WebsocketEvent.open,this.handleOpenEvent),this._underlyingWebsocket.addEventListener(WebsocketEvent.close,this.handleCloseEvent),this._underlyingWebsocket.addEventListener(WebsocketEvent.error,this.handleErrorEvent),this._underlyingWebsocket.addEventListener(WebsocketEvent.message,this.handleMessageEvent),this._underlyingWebsocket}clearWebsocket(){this._underlyingWebsocket.removeEventListener(WebsocketEvent.open,this.handleOpenEvent),this._underlyingWebsocket.removeEventListener(WebsocketEvent.close,this.handleCloseEvent),this._underlyingWebsocket.removeEventListener(WebsocketEvent.error,this.handleErrorEvent),this._underlyingWebsocket.removeEventListener(WebsocketEvent.message,this.handleMessageEvent),this._underlyingWebsocket.close()}dispatchEvent(y,R){const k=this._options.listeners[y],H=[];k.forEach(({listener:B,options:te})=>{B(this,R),(te===void 0||te.once===void 0||!te.once)&&H.push({listener:B,options:te})}),this._options.listeners[y]=H}handleEvent(y,R){switch(y){case WebsocketEvent.close:this.dispatchEvent(y,R),this.scheduleConnectionRetryIfNeeded();break;case WebsocketEvent.open:if(this.backoff!==void 0&&this._lastConnection!==void 0){const k={retries:this.backoff.retries,lastConnection:new Date(this._lastConnection)},H=new CustomEvent(WebsocketEvent.reconnect,{detail:k});this.dispatchEvent(WebsocketEvent.reconnect,H),this.backoff.reset()}this._lastConnection=new Date,this.dispatchEvent(y,R),this.sendBufferedData();break;case WebsocketEvent.retry:this.dispatchEvent(y,R),this.clearWebsocket(),this.tryConnect();break;default:this.dispatchEvent(y,R);break}}sendBufferedData(){if(this.buffer!==void 0)for(let y=this.buffer.read();y!==void 0;y=this.buffer.read())this.send(y)}scheduleConnectionRetryIfNeeded(){if(this.closedByUser||this.backoff===void 0)return;const y=k=>{const H=new CustomEvent(WebsocketEvent.retry,{detail:k});this.handleEvent(WebsocketEvent.retry,H)},R={backoff:this._options.retry.instantReconnect===!0?0:this.backoff.next(),retries:this._options.retry.instantReconnect===!0?0:this.backoff.retries,lastConnection:this._lastConnection};(this._options.retry.maxRetries===void 0||R.retries<=this._options.retry.maxRetries)&&(this.retryTimeout=globalThis.setTimeout(()=>y(R),R.backoff))}cancelScheduledConnectionRetry(){globalThis.clearTimeout(this.retryTimeout)}}class WebsocketBuilder{constructor(y){this._url=y}get url(){return this._url}withProtocols(y){return this._protocols=y,this}get protocols(){return this._protocols}withMaxRetries(y){var R;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},(R=this._options)===null||R===void 0?void 0:R.retry),{maxRetries:y})}),this}get maxRetries(){var y,R;return(R=(y=this._options)===null||y===void 0?void 0:y.retry)===null||R===void 0?void 0:R.maxRetries}withInstantReconnect(y){var R;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},(R=this._options)===null||R===void 0?void 0:R.retry),{instantReconnect:y})}),this}get instantReconnect(){var y,R;return(R=(y=this._options)===null||y===void 0?void 0:y.retry)===null||R===void 0?void 0:R.instantReconnect}withBackoff(y){var R;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},(R=this._options)===null||R===void 0?void 0:R.retry),{backoff:y})}),this}get backoff(){var y,R;return(R=(y=this._options)===null||y===void 0?void 0:y.retry)===null||R===void 0?void 0:R.backoff}withBuffer(y){return this._options=Object.assign(Object.assign({},this._options),{buffer:y}),this}get buffer(){var y;return(y=this._options)===null||y===void 0?void 0:y.buffer}onOpen(y,R){return this.addListener(WebsocketEvent.open,y,R),this}onClose(y,R){return this.addListener(WebsocketEvent.close,y,R),this}onError(y,R){return this.addListener(WebsocketEvent.error,y,R),this}onMessage(y,R){return this.addListener(WebsocketEvent.message,y,R),this}onRetry(y,R){return this.addListener(WebsocketEvent.retry,y,R),this}onReconnect(y,R){return this.addListener(WebsocketEvent.reconnect,y,R),this}build(){return new Websocket(this._url,this._protocols,this._options)}addListener(y,R,k){var H,B,te,ae,ce,Ce,Oe,Le,Ne,Fe,Ue,De,$e,Be,Ve,Ke,st,We,at,tt,ft;return this._options=Object.assign(Object.assign({},this._options),{listeners:{open:(te=(B=(H=this._options)===null||H===void 0?void 0:H.listeners)===null||B===void 0?void 0:B.open)!==null&&te!==void 0?te:[],close:(Ce=(ce=(ae=this._options)===null||ae===void 0?void 0:ae.listeners)===null||ce===void 0?void 0:ce.close)!==null&&Ce!==void 0?Ce:[],error:(Ne=(Le=(Oe=this._options)===null||Oe===void 0?void 0:Oe.listeners)===null||Le===void 0?void 0:Le.error)!==null&&Ne!==void 0?Ne:[],message:(De=(Ue=(Fe=this._options)===null||Fe===void 0?void 0:Fe.listeners)===null||Ue===void 0?void 0:Ue.message)!==null&&De!==void 0?De:[],retry:(Ve=(Be=($e=this._options)===null||$e===void 0?void 0:$e.listeners)===null||Be===void 0?void 0:Be.retry)!==null&&Ve!==void 0?Ve:[],reconnect:(We=(st=(Ke=this._options)===null||Ke===void 0?void 0:Ke.listeners)===null||st===void 0?void 0:st.reconnect)!==null&&We!==void 0?We:[],[y]:[...(ft=(tt=(at=this._options)===null||at===void 0?void 0:at.listeners)===null||tt===void 0?void 0:tt[y])!==null&&ft!==void 0?ft:[],{listener:R,options:k}]}}),this}}class NRelay1{constructor(y,R={}){Jt(this,"socket");Jt(this,"subscriptions",new Map);Jt(this,"ee",new EventTarget);const{auth:k,backoff:H=new ExponentialBackoff(1e3),verifyEvent:B=verifyEvent}=R;this.socket=new WebsocketBuilder(y).withBuffer(new ArrayQueue).withBackoff(H===!1?void 0:H).onOpen(()=>{for(const te of this.subscriptions.values())this.send(te)}).onMessage((te,ae)=>{const ce=NSchema.json().pipe(NSchema.relayMsg()).safeParse(ae.data);if(!ce.success)return;const Ce=ce.data;switch(Ce[0]){case"EVENT":case"EOSE":case"CLOSED":if(Ce[0]==="EVENT"&&!B(Ce[2]))break;Ce[0]==="CLOSED"&&this.subscriptions.delete(Ce[1]),this.ee.dispatchEvent(new CustomEvent(`sub:${Ce[1]}`,{detail:Ce}));break;case"OK":this.ee.dispatchEvent(new CustomEvent(`ok:${Ce[1]}`,{detail:Ce}));break;case"NOTICE":this.ee.dispatchEvent(new CustomEvent("notice",{detail:Ce}));break;case"COUNT":this.ee.dispatchEvent(new CustomEvent(`count:${Ce[1]}`,{detail:Ce}));break;case"AUTH":k==null||k(Ce[1]).then(Oe=>this.send(["AUTH",Oe])).catch(()=>{})}}).build()}send(y){switch(y[0]){case"REQ":this.subscriptions.set(y[1],y);break;case"CLOSE":this.subscriptions.delete(y[1]);break;case"EVENT":case"COUNT":return this.socket.send(JSON.stringify(y))}this.socket.readyState===WebSocket.OPEN&&this.socket.send(JSON.stringify(y))}async*req(y,R={}){const{signal:k}=R,H=crypto.randomUUID(),B=this.on(`sub:${H}`,k),te=["REQ",H,...y];this.send(te);try{for await(const ae of B){if(ae[0]==="EOSE"&&(yield ae),ae[0]==="CLOSED")break;if(ae[0]==="EVENT")if(matchFilters(y,ae[2]))yield ae;else continue}}finally{this.send(["CLOSE",H])}}async query(y,R){const k=new NSet,H=y.reduce((B,te)=>B+getFilterLimit(te),0);if(H===0)return[];for await(const B of this.req(y,R)){if(B[0]==="EOSE")break;if(B[0]==="EVENT"&&k.add(B[2]),B[0]==="CLOSED")throw new Error("Subscription closed");if(k.size>=H)break}return[...k]}async event(y,R){const k=this.once(`ok:${y.id}`,R==null?void 0:R.signal);this.send(["EVENT",y]);const[,,H,B]=await k;if(!H)throw new Error(B)}async count(y,R){const k=crypto.randomUUID(),H=this.once(`count:${k}`,R==null?void 0:R.signal);this.send(["COUNT",k,...y]);const[,,B]=await H;return B}async*on(y,R){if(R!=null&&R.aborted)throw this.abortError();const k=new Machina(R),H=B=>k.push(B.detail);this.ee.addEventListener(y,H);try{for await(const B of k)yield B}finally{this.ee.removeEventListener(y,H)}}async once(y,R){for await(const k of this.on(y,R))return k;throw new Error("Unreachable")}abortError(){return new DOMException("The signal has been aborted","AbortError")}async close(){this.socket.readyState!==WebSocket.CLOSED&&await new Promise(y=>{this.socket.addEventListener(WebsocketEvent.close,y,{once:!0}),this.socket.close()})}}class HTTPError extends Error{constructor(R,k){super(`HTTP Error: ${R.status} ${R.statusText}`);Jt(this,"response");Jt(this,"request");this.response=R,this.request=k}}var link,hasRequiredLink;function requireLink(){if(hasRequiredLink)return link;hasRequiredLink=1;var E=/^utf-?8|ascii|utf-?16-?le|ucs-?2|base-?64|latin-?1$/i,y=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,R=/\s|\uFEFF|\xA0/,k=/\r?\n[\x20\x09]+/g,H=/[;,"]/,B=/[;,"]|\s/,te=/^[!#$%&'*+\-\.^_`|~\da-zA-Z]+$/,ae={IDLE:1,URI:2,ATTR:4};function ce(Fe){return Fe.replace(y,"")}function Ce(Fe){return R.test(Fe)}function Oe(Fe,Ue){for(;Ce(Fe[Ue]);)Ue++;return Ue}function Le(Fe){return B.test(Fe)||!te.test(Fe)}class Ne{constructor(Ue){this.refs=[],Ue&&this.parse(Ue)}rel(Ue){for(var De=[],$e=Ue.toLowerCase(),Be=0;Be",Ve);if(st===-1)throw new Error("Expected end of URI delimiter at offset "+Ve);Ke={uri:Ue.slice(Ve+1,st)},Ve=st,$e=ae.URI}else throw new Error('Unexpected character "'+Ue[Ve]+'" at offset '+Ve);Ve++}else if($e===ae.URI)if(Ce(Ue[Ve])){Ve++;continue}else if(Ue[Ve]===";")$e=ae.ATTR,Ve++;else if(Ue[Ve]===",")$e=ae.IDLE,Ve++;else throw new Error('Unexpected character "'+Ue[Ve]+'" at offset '+Ve);else if($e===ae.ATTR){if(Ue[Ve]===";"||Ce(Ue[Ve])){Ve++;continue}var st=Ue.indexOf("=",Ve);if(st===-1)throw new Error("Expected attribute delimiter at offset "+Ve);var We=ce(Ue.slice(Ve,st)).toLowerCase(),at="";if(Ve=st+1,Ve=Oe(Ue,Ve),Ue[Ve]==='"')for(Ve++;Ve"),Ue.push(De);return Ue.join(", ")}}return Ne.isCompatibleEncoding=function(Fe){return E.test(Fe)},Ne.parse=function(Fe,Ue){return new Ne().parse(Fe,Ue)},Ne.isSingleOccurenceAttr=function(Fe){return Fe==="rel"||Fe==="type"||Fe==="media"||Fe==="title"||Fe==="title*"},Ne.isTokenAttr=function(Fe){return Fe==="rel"||Fe==="type"||Fe==="anchor"},Ne.escapeQuotes=function(Fe){return Fe.replace(/"/g,'\\"')},Ne.expandRelations=function(Fe){var Ue=Fe.rel.split(" ");return Ue.map(function(De){var $e=Object.assign({},Fe);return $e.rel=De,$e})},Ne.parseExtendedValue=function(Fe){var Ue=/([^']+)?(?:'([^']+)')?(.+)/.exec(Fe);return{language:Ue[2].toLowerCase(),encoding:Ne.isCompatibleEncoding(Ue[1])?null:Ue[1].toLowerCase(),value:Ne.isCompatibleEncoding(Ue[1])?decodeURIComponent(Ue[3]):Ue[3]}},Ne.formatExtendedAttribute=function(Fe,Ue){var De=(Ue.encoding||"utf-8").toUpperCase(),$e=Ue.language||"en",Be="";return Buffer.isBuffer(Ue.value)&&Ne.isCompatibleEncoding(De)?Be=Ue.value.toString(De):Buffer.isBuffer(Ue.value)?Be=Ue.value.toString("hex").replace(/[0-9a-f]{2}/gi,"%$1"):Be=encodeURIComponent(Ue.value),Fe+"="+De+"'"+$e+"'"+Be},Ne.formatAttribute=function(Fe,Ue){return Array.isArray(Ue)?Ue.map(De=>Ne.formatAttribute(Fe,De)).join("; "):Fe[Fe.length-1]==="*"||typeof Ue!="string"?Ne.formatExtendedAttribute(Fe,Ue):(Ne.isTokenAttr(Fe)?Ue=Le(Ue)?'"'+Ne.escapeQuotes(Ue)+'"':Ne.escapeQuotes(Ue):Le(Ue)&&(Ue=encodeURIComponent(Ue),Ue=Ue.replace(/%20/g," ").replace(/%2C/g,",").replace(/%3B/g,";"),Ue='"'+Ue+'"'),Fe+"="+Ue)},link=Ne,link}var linkExports=requireLink();const LinkHeader=getDefaultExportFromCjs(linkExports);class MastodonResponse extends Response{static fromResponse(y){return y.status===204?new MastodonResponse(null,y):new MastodonResponse(y.body,y)}links(){const y=this.headers.get("link");return y?new LinkHeader(y).refs:[]}pagination(){var R,k;const y=this.links();return{next:((R=y.find(H=>H.rel==="next"))==null?void 0:R.uri)??null,prev:((k=y.find(H=>H.rel==="prev"))==null?void 0:k.uri)??null}}next(){var R;return((R=this.links().find(k=>k.rel==="next"))==null?void 0:R.uri)??null}prev(){var R;return((R=this.links().find(k=>k.rel==="prev"))==null?void 0:R.uri)??null}async error(){const y=await this.json(),R=MastodonResponse.errorSchema().safeParse(y);return R.success?R.data:null}static errorSchema(){return z$1.object({error:z$1.string(),detail:z$1.record(z$1.string(),z$1.object({error:z$1.string(),description:z$1.string()}).array()).optional()}).passthrough()}}class MastodonClient{constructor(y,R,k=globalThis.fetch.bind(globalThis)){Jt(this,"baseUrl");Jt(this,"fetch");Jt(this,"accessToken");this.fetch=k,this.baseUrl=y,this.accessToken=R}async get(y,R={}){return this.request("GET",y,void 0,R)}async post(y,R,k={}){return this.request("POST",y,R,k)}async put(y,R,k={}){return this.request("PUT",y,R,k)}async delete(y,R={}){return this.request("DELETE",y,void 0,R)}async patch(y,R,k={}){return this.request("PATCH",y,R,k)}async head(y,R={}){return this.request("HEAD",y,void 0,R)}async options(y,R={}){return this.request("OPTIONS",y,void 0,R)}async request(y,R,k,H={}){const B=new URL(R,this.baseUrl);if(H.searchParams){const Oe=H.searchParams instanceof URLSearchParams?H.searchParams:Object.entries(H.searchParams).reduce((Le,[Ne,Fe])=>{if(Array.isArray(Fe))for(const Ue of Fe)Le.append(`${Ne}[]`,String(Ue));else Fe!=null&&Le.append(Ne,String(Fe));return Le},new URLSearchParams);for(const Le of Oe.keys())B.searchParams.delete(Le);for(const[Le,Ne]of Oe)B.searchParams.append(Le,Ne)}const te=new Headers(H.headers);this.accessToken&&te.set("Authorization",`Bearer ${this.accessToken}`);let ae;k instanceof FormData?ae=k:k!==void 0&&(te.set("Content-Type","application/json"),ae=JSON.stringify(k));const ce=new Request(B,{method:y,headers:te,signal:H.signal,body:ae}),Ce=H.onUploadProgress?await this.xhr(ce,H):MastodonResponse.fromResponse(await this.fetch(ce));if(!Ce.ok)throw new HTTPError(Ce,ce);return Ce}async xhr(y,R={}){const k=new XMLHttpRequest,{resolve:H,reject:B,promise:te}=Promise.withResolvers();k.responseType="arraybuffer",k.onreadystatechange=()=>{if(k.readyState!==XMLHttpRequest.DONE)return;const ae=new Headers(k.getAllResponseHeaders().trim().split(/[\r\n]+/).map(Ce=>{const[Oe,...Le]=Ce.split(": "),Ne=Le.join(": ");return[Oe,Ne]})),ce=new MastodonResponse(k.response,{status:k.status,statusText:k.statusText,headers:ae});H(ce)},k.onerror=()=>{B(new TypeError("Network request failed"))},k.onabort=()=>{B(new DOMException("The request was aborted","AbortError"))},R.onUploadProgress&&(k.upload.onprogress=R.onUploadProgress),R.signal&&R.signal.addEventListener("abort",()=>k.abort(),{once:!0}),k.open(y.method,y.url,!0);for(const[ae,ce]of y.headers)k.setRequestHeader(ae,ce);return k.send(await y.arrayBuffer()),te}}const useAppSelector=useSelector;var DELETE="delete",SHIFT=5,SIZE=1<>>0;if(""+R!==y||R===4294967295)return NaN;y=R}return y<0?ensureSize(E)+y:y}function returnTrue(){return!0}function wholeSlice(E,y,R){return(E===0&&!isNeg(E)||R!==void 0&&E<=-R)&&(y===void 0||R!==void 0&&y>=R)}function resolveBegin(E,y){return resolveIndex(E,y,0)}function resolveEnd(E,y){return resolveIndex(E,y,y)}function resolveIndex(E,y,R){return E===void 0?R:isNeg(E)?y===1/0?y:Math.max(0,y+E)|0:y===void 0||y===E?E:Math.min(y,E)|0}function isNeg(E){return E<0||E===0&&1/E===-1/0}var IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isCollection(E){return!!(E&&E[IS_COLLECTION_SYMBOL])}var IS_KEYED_SYMBOL="@@__IMMUTABLE_KEYED__@@";function isKeyed(E){return!!(E&&E[IS_KEYED_SYMBOL])}var IS_INDEXED_SYMBOL="@@__IMMUTABLE_INDEXED__@@";function isIndexed(E){return!!(E&&E[IS_INDEXED_SYMBOL])}function isAssociative(E){return isKeyed(E)||isIndexed(E)}var Collection=function(y){return isCollection(y)?y:Seq(y)},KeyedCollection=function(E){function y(R){return isKeyed(R)?R:KeyedSeq(R)}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y}(Collection),IndexedCollection=function(E){function y(R){return isIndexed(R)?R:IndexedSeq(R)}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y}(Collection),SetCollection=function(E){function y(R){return isCollection(R)&&!isAssociative(R)?R:SetSeq(R)}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y}(Collection);Collection.Keyed=KeyedCollection;Collection.Indexed=IndexedCollection;Collection.Set=SetCollection;var IS_SEQ_SYMBOL="@@__IMMUTABLE_SEQ__@@";function isSeq(E){return!!(E&&E[IS_SEQ_SYMBOL])}var IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@";function isRecord(E){return!!(E&&E[IS_RECORD_SYMBOL])}function isImmutable(E){return isCollection(E)||isRecord(E)}var IS_ORDERED_SYMBOL="@@__IMMUTABLE_ORDERED__@@";function isOrdered(E){return!!(E&&E[IS_ORDERED_SYMBOL])}var ITERATE_KEYS=0,ITERATE_VALUES=1,ITERATE_ENTRIES=2,REAL_ITERATOR_SYMBOL=typeof Symbol=="function"&&Symbol.iterator,FAUX_ITERATOR_SYMBOL="@@iterator",ITERATOR_SYMBOL=REAL_ITERATOR_SYMBOL||FAUX_ITERATOR_SYMBOL,Iterator=function(y){this.next=y};Iterator.prototype.toString=function(){return"[Iterator]"};Iterator.KEYS=ITERATE_KEYS;Iterator.VALUES=ITERATE_VALUES;Iterator.ENTRIES=ITERATE_ENTRIES;Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()};Iterator.prototype[ITERATOR_SYMBOL]=function(){return this};function iteratorValue(E,y,R,k){var H=E===0?y:E===1?R:[y,R];return k?k.value=H:k={value:H,done:!1},k}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(E){return Array.isArray(E)?!0:!!getIteratorFn(E)}function isIterator(E){return E&&typeof E.next=="function"}function getIterator(E){var y=getIteratorFn(E);return y&&y.call(E)}function getIteratorFn(E){var y=E&&(REAL_ITERATOR_SYMBOL&&E[REAL_ITERATOR_SYMBOL]||E[FAUX_ITERATOR_SYMBOL]);if(typeof y=="function")return y}function isEntriesIterable(E){var y=getIteratorFn(E);return y&&y===E.entries}function isKeysIterable(E){var y=getIteratorFn(E);return y&&y===E.keys}var hasOwnProperty=Object.prototype.hasOwnProperty;function isArrayLike(E){return Array.isArray(E)||typeof E=="string"?!0:E&&typeof E=="object"&&Number.isInteger(E.length)&&E.length>=0&&(E.length===0?Object.keys(E).length===1:E.hasOwnProperty(E.length-1))}var Seq=function(E){function y(R){return R==null?emptySequence():isImmutable(R)?R.toSeq():seqFromValue(R)}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.toSeq=function(){return this},y.prototype.toString=function(){return this.__toString("Seq {","}")},y.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},y.prototype.__iterate=function(k,H){var B=this._cache;if(B){for(var te=B.length,ae=0;ae!==te;){var ce=B[H?te-++ae:ae++];if(k(ce[1],ce[0],this)===!1)break}return ae}return this.__iterateUncached(k,H)},y.prototype.__iterator=function(k,H){var B=this._cache;if(B){var te=B.length,ae=0;return new Iterator(function(){if(ae===te)return iteratorDone();var ce=B[H?te-++ae:ae++];return iteratorValue(k,ce[0],ce[1])})}return this.__iteratorUncached(k,H)},y}(Collection),KeyedSeq=function(E){function y(R){return R==null?emptySequence().toKeyedSeq():isCollection(R)?isKeyed(R)?R.toSeq():R.fromEntrySeq():isRecord(R)?R.toSeq():keyedSeqFromValue(R)}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.toKeyedSeq=function(){return this},y}(Seq),IndexedSeq=function(E){function y(R){return R==null?emptySequence():isCollection(R)?isKeyed(R)?R.entrySeq():R.toIndexedSeq():isRecord(R)?R.toSeq().entrySeq():indexedSeqFromValue(R)}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.of=function(){return y(arguments)},y.prototype.toIndexedSeq=function(){return this},y.prototype.toString=function(){return this.__toString("Seq [","]")},y}(Seq),SetSeq=function(E){function y(R){return(isCollection(R)&&!isAssociative(R)?R:IndexedSeq(R)).toSetSeq()}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.of=function(){return y(arguments)},y.prototype.toSetSeq=function(){return this},y}(Seq);Seq.isSeq=isSeq;Seq.Keyed=KeyedSeq;Seq.Set=SetSeq;Seq.Indexed=IndexedSeq;Seq.prototype[IS_SEQ_SYMBOL]=!0;var ArraySeq=function(E){function y(R){this._array=R,this.size=R.length}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.get=function(k,H){return this.has(k)?this._array[wrapIndex(this,k)]:H},y.prototype.__iterate=function(k,H){for(var B=this._array,te=B.length,ae=0;ae!==te;){var ce=H?te-++ae:ae++;if(k(B[ce],ce,this)===!1)break}return ae},y.prototype.__iterator=function(k,H){var B=this._array,te=B.length,ae=0;return new Iterator(function(){if(ae===te)return iteratorDone();var ce=H?te-++ae:ae++;return iteratorValue(k,ce,B[ce])})},y}(IndexedSeq),ObjectSeq=function(E){function y(R){var k=Object.keys(R).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(R):[]);this._object=R,this._keys=k,this.size=k.length}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.get=function(k,H){return H!==void 0&&!this.has(k)?H:this._object[k]},y.prototype.has=function(k){return hasOwnProperty.call(this._object,k)},y.prototype.__iterate=function(k,H){for(var B=this._object,te=this._keys,ae=te.length,ce=0;ce!==ae;){var Ce=te[H?ae-++ce:ce++];if(k(B[Ce],Ce,this)===!1)break}return ce},y.prototype.__iterator=function(k,H){var B=this._object,te=this._keys,ae=te.length,ce=0;return new Iterator(function(){if(ce===ae)return iteratorDone();var Ce=te[H?ae-++ce:ce++];return iteratorValue(k,Ce,B[Ce])})},y}(KeyedSeq);ObjectSeq.prototype[IS_ORDERED_SYMBOL]=!0;var CollectionSeq=function(E){function y(R){this._collection=R,this.size=R.length||R.size}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.__iterateUncached=function(k,H){if(H)return this.cacheResult().__iterate(k,H);var B=this._collection,te=getIterator(B),ae=0;if(isIterator(te))for(var ce;!(ce=te.next()).done&&k(ce.value,ae++,this)!==!1;);return ae},y.prototype.__iteratorUncached=function(k,H){if(H)return this.cacheResult().__iterator(k,H);var B=this._collection,te=getIterator(B);if(!isIterator(te))return new Iterator(iteratorDone);var ae=0;return new Iterator(function(){var ce=te.next();return ce.done?ce:iteratorValue(k,ae++,ce.value)})},y}(IndexedSeq),EMPTY_SEQ;function emptySequence(){return EMPTY_SEQ||(EMPTY_SEQ=new ArraySeq([]))}function keyedSeqFromValue(E){var y=maybeIndexedSeqFromValue(E);if(y)return y.fromEntrySeq();if(typeof E=="object")return new ObjectSeq(E);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+E)}function indexedSeqFromValue(E){var y=maybeIndexedSeqFromValue(E);if(y)return y;throw new TypeError("Expected Array or collection object of values: "+E)}function seqFromValue(E){var y=maybeIndexedSeqFromValue(E);if(y)return isEntriesIterable(E)?y.fromEntrySeq():isKeysIterable(E)?y.toSetSeq():y;if(typeof E=="object")return new ObjectSeq(E);throw new TypeError("Expected Array or collection object of values, or keyed object: "+E)}function maybeIndexedSeqFromValue(E){return isArrayLike(E)?new ArraySeq(E):hasIterator(E)?new CollectionSeq(E):void 0}var IS_MAP_SYMBOL="@@__IMMUTABLE_MAP__@@";function isMap(E){return!!(E&&E[IS_MAP_SYMBOL])}function isOrderedMap(E){return isMap(E)&&isOrdered(E)}function isValueObject(E){return!!(E&&typeof E.equals=="function"&&typeof E.hashCode=="function")}function is(E,y){if(E===y||E!==E&&y!==y)return!0;if(!E||!y)return!1;if(typeof E.valueOf=="function"&&typeof y.valueOf=="function"){if(E=E.valueOf(),y=y.valueOf(),E===y||E!==E&&y!==y)return!0;if(!E||!y)return!1}return!!(isValueObject(E)&&isValueObject(y)&&E.equals(y))}var imul=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(y,R){y|=0,R|=0;var k=y&65535,H=R&65535;return k*H+((y>>>16)*H+k*(R>>>16)<<16>>>0)|0};function smi(E){return E>>>1&1073741824|E&3221225471}var defaultValueOf=Object.prototype.valueOf;function hash(E){if(E==null)return hashNullish(E);if(typeof E.hashCode=="function")return smi(E.hashCode(E));var y=valueOf$1(E);if(y==null)return hashNullish(y);switch(typeof y){case"boolean":return y?1108378657:1108378656;case"number":return hashNumber(y);case"string":return y.length>STRING_HASH_CACHE_MIN_STRLEN?cachedHashString(y):hashString(y);case"object":case"function":return hashJSObj(y);case"symbol":return hashSymbol(y);default:if(typeof y.toString=="function")return hashString(y.toString());throw new Error("Value type "+typeof y+" cannot be hashed.")}}function hashNullish(E){return E===null?1108378658:1108378659}function hashNumber(E){if(E!==E||E===1/0)return 0;var y=E|0;for(y!==E&&(y^=E*4294967295);E>4294967295;)E/=4294967295,y^=E;return smi(y)}function cachedHashString(E){var y=stringHashCache[E];return y===void 0&&(y=hashString(E),STRING_HASH_CACHE_SIZE===STRING_HASH_CACHE_MAX_SIZE&&(STRING_HASH_CACHE_SIZE=0,stringHashCache={}),STRING_HASH_CACHE_SIZE++,stringHashCache[E]=y),y}function hashString(E){for(var y=0,R=0;R0)switch(E.nodeType){case 1:return E.uniqueID;case 9:return E.documentElement&&E.documentElement.uniqueID}}function valueOf$1(E){return E.valueOf!==defaultValueOf&&typeof E.valueOf=="function"?E.valueOf(E):E}function nextHash(){var E=++_objHashUID;return _objHashUID&1073741824&&(_objHashUID=0),E}var usingWeakMap=typeof WeakMap=="function",weakMap;usingWeakMap&&(weakMap=new WeakMap);var symbolMap=Object.create(null),_objHashUID=0,UID_HASH_KEY="__immutablehash__";typeof Symbol=="function"&&(UID_HASH_KEY=Symbol(UID_HASH_KEY));var STRING_HASH_CACHE_MIN_STRLEN=16,STRING_HASH_CACHE_MAX_SIZE=255,STRING_HASH_CACHE_SIZE=0,stringHashCache={},ToKeyedSequence=function(E){function y(R,k){this._iter=R,this._useKeys=k,this.size=R.size}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.get=function(k,H){return this._iter.get(k,H)},y.prototype.has=function(k){return this._iter.has(k)},y.prototype.valueSeq=function(){return this._iter.valueSeq()},y.prototype.reverse=function(){var k=this,H=reverseFactory(this,!0);return this._useKeys||(H.valueSeq=function(){return k._iter.toSeq().reverse()}),H},y.prototype.map=function(k,H){var B=this,te=mapFactory(this,k,H);return this._useKeys||(te.valueSeq=function(){return B._iter.toSeq().map(k,H)}),te},y.prototype.__iterate=function(k,H){var B=this;return this._iter.__iterate(function(te,ae){return k(te,ae,B)},H)},y.prototype.__iterator=function(k,H){return this._iter.__iterator(k,H)},y}(KeyedSeq);ToKeyedSequence.prototype[IS_ORDERED_SYMBOL]=!0;var ToIndexedSequence=function(E){function y(R){this._iter=R,this.size=R.size}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.includes=function(k){return this._iter.includes(k)},y.prototype.__iterate=function(k,H){var B=this,te=0;return H&&ensureSize(this),this._iter.__iterate(function(ae){return k(ae,H?B.size-++te:te++,B)},H)},y.prototype.__iterator=function(k,H){var B=this,te=this._iter.__iterator(ITERATE_VALUES,H),ae=0;return H&&ensureSize(this),new Iterator(function(){var ce=te.next();return ce.done?ce:iteratorValue(k,H?B.size-++ae:ae++,ce.value,ce)})},y}(IndexedSeq),ToSetSequence=function(E){function y(R){this._iter=R,this.size=R.size}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.has=function(k){return this._iter.includes(k)},y.prototype.__iterate=function(k,H){var B=this;return this._iter.__iterate(function(te){return k(te,te,B)},H)},y.prototype.__iterator=function(k,H){var B=this._iter.__iterator(ITERATE_VALUES,H);return new Iterator(function(){var te=B.next();return te.done?te:iteratorValue(k,te.value,te.value,te)})},y}(SetSeq),FromEntriesSequence=function(E){function y(R){this._iter=R,this.size=R.size}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.prototype.entrySeq=function(){return this._iter.toSeq()},y.prototype.__iterate=function(k,H){var B=this;return this._iter.__iterate(function(te){if(te){validateEntry(te);var ae=isCollection(te);return k(ae?te.get(1):te[1],ae?te.get(0):te[0],B)}},H)},y.prototype.__iterator=function(k,H){var B=this._iter.__iterator(ITERATE_VALUES,H);return new Iterator(function(){for(;;){var te=B.next();if(te.done)return te;var ae=te.value;if(ae){validateEntry(ae);var ce=isCollection(ae);return iteratorValue(k,ce?ae.get(0):ae[0],ce?ae.get(1):ae[1],te)}}})},y}(KeyedSeq);ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough;function flipFactory(E){var y=makeSequence(E);return y._iter=E,y.size=E.size,y.flip=function(){return E},y.reverse=function(){var R=E.reverse.apply(this);return R.flip=function(){return E.reverse()},R},y.has=function(R){return E.includes(R)},y.includes=function(R){return E.has(R)},y.cacheResult=cacheResultThrough,y.__iterateUncached=function(R,k){var H=this;return E.__iterate(function(B,te){return R(te,B,H)!==!1},k)},y.__iteratorUncached=function(R,k){if(R===ITERATE_ENTRIES){var H=E.__iterator(R,k);return new Iterator(function(){var B=H.next();if(!B.done){var te=B.value[0];B.value[0]=B.value[1],B.value[1]=te}return B})}return E.__iterator(R===ITERATE_VALUES?ITERATE_KEYS:ITERATE_VALUES,k)},y}function mapFactory(E,y,R){var k=makeSequence(E);return k.size=E.size,k.has=function(H){return E.has(H)},k.get=function(H,B){var te=E.get(H,NOT_SET);return te===NOT_SET?B:y.call(R,te,H,E)},k.__iterateUncached=function(H,B){var te=this;return E.__iterate(function(ae,ce,Ce){return H(y.call(R,ae,ce,Ce),ce,te)!==!1},B)},k.__iteratorUncached=function(H,B){var te=E.__iterator(ITERATE_ENTRIES,B);return new Iterator(function(){var ae=te.next();if(ae.done)return ae;var ce=ae.value,Ce=ce[0];return iteratorValue(H,Ce,y.call(R,ce[1],Ce,E),ae)})},k}function reverseFactory(E,y){var R=this,k=makeSequence(E);return k._iter=E,k.size=E.size,k.reverse=function(){return E},E.flip&&(k.flip=function(){var H=flipFactory(E);return H.reverse=function(){return E.flip()},H}),k.get=function(H,B){return E.get(y?H:-1-H,B)},k.has=function(H){return E.has(y?H:-1-H)},k.includes=function(H){return E.includes(H)},k.cacheResult=cacheResultThrough,k.__iterate=function(H,B){var te=this,ae=0;return B&&ensureSize(E),E.__iterate(function(ce,Ce){return H(ce,y?Ce:B?te.size-++ae:ae++,te)},!B)},k.__iterator=function(H,B){var te=0;B&&ensureSize(E);var ae=E.__iterator(ITERATE_ENTRIES,!B);return new Iterator(function(){var ce=ae.next();if(ce.done)return ce;var Ce=ce.value;return iteratorValue(H,y?Ce[0]:B?R.size-++te:te++,Ce[1],ce)})},k}function filterFactory(E,y,R,k){var H=makeSequence(E);return k&&(H.has=function(B){var te=E.get(B,NOT_SET);return te!==NOT_SET&&!!y.call(R,te,B,E)},H.get=function(B,te){var ae=E.get(B,NOT_SET);return ae!==NOT_SET&&y.call(R,ae,B,E)?ae:te}),H.__iterateUncached=function(B,te){var ae=this,ce=0;return E.__iterate(function(Ce,Oe,Le){if(y.call(R,Ce,Oe,Le))return ce++,B(Ce,k?Oe:ce-1,ae)},te),ce},H.__iteratorUncached=function(B,te){var ae=E.__iterator(ITERATE_ENTRIES,te),ce=0;return new Iterator(function(){for(;;){var Ce=ae.next();if(Ce.done)return Ce;var Oe=Ce.value,Le=Oe[0],Ne=Oe[1];if(y.call(R,Ne,Le,E))return iteratorValue(B,k?Le:ce++,Ne,Ce)}})},H}function countByFactory(E,y,R){var k=Map$1().asMutable();return E.__iterate(function(H,B){k.update(y.call(R,H,B,E),0,function(te){return te+1})}),k.asImmutable()}function groupByFactory(E,y,R){var k=isKeyed(E),H=(isOrdered(E)?OrderedMap():Map$1()).asMutable();E.__iterate(function(te,ae){H.update(y.call(R,te,ae,E),function(ce){return ce=ce||[],ce.push(k?[ae,te]:te),ce})});var B=collectionClass(E);return H.map(function(te){return reify(E,B(te))}).asImmutable()}function partitionFactory(E,y,R){var k=isKeyed(E),H=[[],[]];E.__iterate(function(te,ae){H[y.call(R,te,ae,E)?1:0].push(k?[ae,te]:te)});var B=collectionClass(E);return H.map(function(te){return reify(E,B(te))})}function sliceFactory(E,y,R,k){var H=E.size;if(wholeSlice(y,R,H))return E;var B=resolveBegin(y,H),te=resolveEnd(R,H);if(B!==B||te!==te)return sliceFactory(E.toSeq().cacheResult(),y,R,k);var ae=te-B,ce;ae===ae&&(ce=ae<0?0:ae);var Ce=makeSequence(E);return Ce.size=ce===0?ce:E.size&&ce||void 0,!k&&isSeq(E)&&ce>=0&&(Ce.get=function(Oe,Le){return Oe=wrapIndex(this,Oe),Oe>=0&&Oece)return iteratorDone();var De=Ne.next();return k||Oe===ITERATE_VALUES||De.done?De:Oe===ITERATE_KEYS?iteratorValue(Oe,Ue-1,void 0,De):iteratorValue(Oe,Ue-1,De.value[1],De)})},Ce}function takeWhileFactory(E,y,R){var k=makeSequence(E);return k.__iterateUncached=function(H,B){var te=this;if(B)return this.cacheResult().__iterate(H,B);var ae=0;return E.__iterate(function(ce,Ce,Oe){return y.call(R,ce,Ce,Oe)&&++ae&&H(ce,Ce,te)}),ae},k.__iteratorUncached=function(H,B){var te=this;if(B)return this.cacheResult().__iterator(H,B);var ae=E.__iterator(ITERATE_ENTRIES,B),ce=!0;return new Iterator(function(){if(!ce)return iteratorDone();var Ce=ae.next();if(Ce.done)return Ce;var Oe=Ce.value,Le=Oe[0],Ne=Oe[1];return y.call(R,Ne,Le,te)?H===ITERATE_ENTRIES?Ce:iteratorValue(H,Le,Ne,Ce):(ce=!1,iteratorDone())})},k}function skipWhileFactory(E,y,R,k){var H=makeSequence(E);return H.__iterateUncached=function(B,te){var ae=this;if(te)return this.cacheResult().__iterate(B,te);var ce=!0,Ce=0;return E.__iterate(function(Oe,Le,Ne){if(!(ce&&(ce=y.call(R,Oe,Le,Ne))))return Ce++,B(Oe,k?Le:Ce-1,ae)}),Ce},H.__iteratorUncached=function(B,te){var ae=this;if(te)return this.cacheResult().__iterator(B,te);var ce=E.__iterator(ITERATE_ENTRIES,te),Ce=!0,Oe=0;return new Iterator(function(){var Le,Ne,Fe;do{if(Le=ce.next(),Le.done)return k||B===ITERATE_VALUES?Le:B===ITERATE_KEYS?iteratorValue(B,Oe++,void 0,Le):iteratorValue(B,Oe++,Le.value[1],Le);var Ue=Le.value;Ne=Ue[0],Fe=Ue[1],Ce&&(Ce=y.call(R,Fe,Ne,ae))}while(Ce);return B===ITERATE_ENTRIES?Le:iteratorValue(B,Ne,Fe,Le)})},H}function concatFactory(E,y){var R=isKeyed(E),k=[E].concat(y).map(function(te){return isCollection(te)?R&&(te=KeyedCollection(te)):te=R?keyedSeqFromValue(te):indexedSeqFromValue(Array.isArray(te)?te:[te]),te}).filter(function(te){return te.size!==0});if(k.length===0)return E;if(k.length===1){var H=k[0];if(H===E||R&&isKeyed(H)||isIndexed(E)&&isIndexed(H))return H}var B=new ArraySeq(k);return R?B=B.toKeyedSeq():isIndexed(E)||(B=B.toSetSeq()),B=B.flatten(!0),B.size=k.reduce(function(te,ae){if(te!==void 0){var ce=ae.size;if(ce!==void 0)return te+ce}},0),B}function flattenFactory(E,y,R){var k=makeSequence(E);return k.__iterateUncached=function(H,B){if(B)return this.cacheResult().__iterate(H,B);var te=0,ae=!1;function ce(Ce,Oe){Ce.__iterate(function(Le,Ne){return(!y||Oe0}function zipWithFactory(E,y,R,k){var H=makeSequence(E),B=new ArraySeq(R).map(function(te){return te.size});return H.size=k?B.max():B.min(),H.__iterate=function(te,ae){for(var ce=this.__iterator(ITERATE_VALUES,ae),Ce,Oe=0;!(Ce=ce.next()).done&&te(Ce.value,Oe++,this)!==!1;);return Oe},H.__iteratorUncached=function(te,ae){var ce=R.map(function(Le){return Le=Collection(Le),getIterator(ae?Le.reverse():Le)}),Ce=0,Oe=!1;return new Iterator(function(){var Le;return Oe||(Le=ce.map(function(Ne){return Ne.next()}),Oe=k?Le.every(function(Ne){return Ne.done}):Le.some(function(Ne){return Ne.done})),Oe?iteratorDone():iteratorValue(te,Ce++,y.apply(null,Le.map(function(Ne){return Ne.value})))})},H}function reify(E,y){return E===y?E:isSeq(E)?y:E.constructor(y)}function validateEntry(E){if(E!==Object(E))throw new TypeError("Expected [K, V] tuple: "+E)}function collectionClass(E){return isKeyed(E)?KeyedCollection:isIndexed(E)?IndexedCollection:SetCollection}function makeSequence(E){return Object.create((isKeyed(E)?KeyedSeq:isIndexed(E)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(E,y){return E===void 0&&y===void 0?0:E===void 0?1:y===void 0?-1:E>y?1:E0;)y[R]=arguments[R+1];if(typeof E!="function")throw new TypeError("Invalid merger function: "+E);return mergeIntoKeyedWith(this,y,E)}function mergeIntoKeyedWith(E,y,R){for(var k=[],H=0;H0;)y[R]=arguments[R+1];return mergeDeepWithSources(this,y,E)}function mergeIn(E){for(var y=[],R=arguments.length-1;R-- >0;)y[R]=arguments[R+1];return updateIn$1(this,E,emptyMap(),function(k){return mergeWithSources(k,y)})}function mergeDeepIn(E){for(var y=[],R=arguments.length-1;R-- >0;)y[R]=arguments[R+1];return updateIn$1(this,E,emptyMap(),function(k){return mergeDeepWithSources(k,y)})}function withMutations(E){var y=this.asMutable();return E(y),y.wasAltered()?y.__ensureOwner(this.__ownerID):this}function asMutable(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)}function asImmutable(){return this.__ensureOwner()}function wasAltered(){return this.__altered}var Map$1=function(E){function y(R){return R==null?emptyMap():isMap(R)&&!isOrdered(R)?R:emptyMap().withMutations(function(k){var H=E(R);assertNotInfinite(H.size),H.forEach(function(B,te){return k.set(te,B)})})}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.of=function(){for(var k=[],H=arguments.length;H--;)k[H]=arguments[H];return emptyMap().withMutations(function(B){for(var te=0;te=k.length)throw new Error("Missing value for key: "+k[te]);B.set(k[te],k[te+1])}})},y.prototype.toString=function(){return this.__toString("Map {","}")},y.prototype.get=function(k,H){return this._root?this._root.get(0,void 0,k,H):H},y.prototype.set=function(k,H){return updateMap(this,k,H)},y.prototype.remove=function(k){return updateMap(this,k,NOT_SET)},y.prototype.deleteAll=function(k){var H=Collection(k);return H.size===0?this:this.withMutations(function(B){H.forEach(function(te){return B.remove(te)})})},y.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},y.prototype.sort=function(k){return OrderedMap(sortFactory(this,k))},y.prototype.sortBy=function(k,H){return OrderedMap(sortFactory(this,H,k))},y.prototype.map=function(k,H){var B=this;return this.withMutations(function(te){te.forEach(function(ae,ce){te.set(ce,k.call(H,ae,ce,B))})})},y.prototype.__iterator=function(k,H){return new MapIterator(this,k,H)},y.prototype.__iterate=function(k,H){var B=this,te=0;return this._root&&this._root.iterate(function(ae){return te++,k(ae[1],ae[0],B)},H),te},y.prototype.__ensureOwner=function(k){return k===this.__ownerID?this:k?makeMap(this.size,this._root,k,this.__hash):this.size===0?emptyMap():(this.__ownerID=k,this.__altered=!1,this)},y}(KeyedCollection);Map$1.isMap=isMap;var MapPrototype=Map$1.prototype;MapPrototype[IS_MAP_SYMBOL]=!0;MapPrototype[DELETE]=MapPrototype.remove;MapPrototype.removeAll=MapPrototype.deleteAll;MapPrototype.setIn=setIn;MapPrototype.removeIn=MapPrototype.deleteIn=deleteIn;MapPrototype.update=update;MapPrototype.updateIn=updateIn;MapPrototype.merge=MapPrototype.concat=merge$1;MapPrototype.mergeWith=mergeWith$1;MapPrototype.mergeDeep=mergeDeep;MapPrototype.mergeDeepWith=mergeDeepWith;MapPrototype.mergeIn=mergeIn;MapPrototype.mergeDeepIn=mergeDeepIn;MapPrototype.withMutations=withMutations;MapPrototype.wasAltered=wasAltered;MapPrototype.asImmutable=asImmutable;MapPrototype["@@transducer/init"]=MapPrototype.asMutable=asMutable;MapPrototype["@@transducer/step"]=function(E,y){return E.set(y[0],y[1])};MapPrototype["@@transducer/result"]=function(E){return E.asImmutable()};var ArrayMapNode=function(y,R){this.ownerID=y,this.entries=R};ArrayMapNode.prototype.get=function(y,R,k,H){for(var B=this.entries,te=0,ae=B.length;te=MAX_ARRAY_MAP_SIZE)return createNodes(y,Ce,H,B);var Fe=y&&y===this.ownerID,Ue=Fe?Ce:arrCopy(Ce);return Ne?ce?Oe===Le-1?Ue.pop():Ue[Oe]=Ue.pop():Ue[Oe]=[H,B]:Ue.push([H,B]),Fe?(this.entries=Ue,this):new ArrayMapNode(y,Ue)}};var BitmapIndexedNode=function(y,R,k){this.ownerID=y,this.bitmap=R,this.nodes=k};BitmapIndexedNode.prototype.get=function(y,R,k,H){R===void 0&&(R=hash(k));var B=1<<((y===0?R:R>>>y)&MASK),te=this.bitmap;return te&B?this.nodes[popCount(te&B-1)].get(y+SHIFT,R,k,H):H};BitmapIndexedNode.prototype.update=function(y,R,k,H,B,te,ae){k===void 0&&(k=hash(H));var ce=(R===0?k:k>>>R)&MASK,Ce=1<=MAX_BITMAP_INDEXED_SIZE)return expandNodes(y,Fe,Oe,ce,De);if(Le&&!De&&Fe.length===2&&isLeafNode(Fe[Ne^1]))return Fe[Ne^1];if(Le&&De&&Fe.length===1&&isLeafNode(De))return De;var $e=y&&y===this.ownerID,Be=Le?De?Oe:Oe^Ce:Oe|Ce,Ve=Le?De?setAt(Fe,Ne,De,$e):spliceOut(Fe,Ne,$e):spliceIn(Fe,Ne,De,$e);return $e?(this.bitmap=Be,this.nodes=Ve,this):new BitmapIndexedNode(y,Be,Ve)};var HashArrayMapNode=function(y,R,k){this.ownerID=y,this.count=R,this.nodes=k};HashArrayMapNode.prototype.get=function(y,R,k,H){R===void 0&&(R=hash(k));var B=(y===0?R:R>>>y)&MASK,te=this.nodes[B];return te?te.get(y+SHIFT,R,k,H):H};HashArrayMapNode.prototype.update=function(y,R,k,H,B,te,ae){k===void 0&&(k=hash(H));var ce=(R===0?k:k>>>R)&MASK,Ce=B===NOT_SET,Oe=this.nodes,Le=Oe[ce];if(Ce&&!Le)return this;var Ne=updateNode(Le,y,R+SHIFT,k,H,B,te,ae);if(Ne===Le)return this;var Fe=this.count;if(!Le)Fe++;else if(!Ne&&(Fe--,Fe>>R)&MASK,te=(R===0?k:k>>>R)&MASK,ae,ce=B===te?[mergeIntoNode(E,y,R+SHIFT,k,H)]:(ae=new ValueNode(y,k,H),B>>=1)te[ae]=R&1?y[B++]:void 0;return te[k]=H,new HashArrayMapNode(E,B+1,te)}function popCount(E){return E-=E>>1&1431655765,E=(E&858993459)+(E>>2&858993459),E=E+(E>>4)&252645135,E+=E>>8,E+=E>>16,E&127}function setAt(E,y,R,k){var H=k?E:arrCopy(E);return H[y]=R,H}function spliceIn(E,y,R,k){var H=E.length+1;if(k&&y+1===H)return E[y]=R,E;for(var B=new Array(H),te=0,ae=0;ae0&&B=0&&k>>R&MASK;if(H>=this.array.length)return new VNode([],y);var B=H===0,te;if(R>0){var ae=this.array[H];if(te=ae&&ae.removeBefore(y,R-SHIFT,k),te===ae&&B)return this}if(B&&!te)return this;var ce=editableVNode(this,y);if(!B)for(var Ce=0;Ce>>R&MASK;if(H>=this.array.length)return this;var B;if(R>0){var te=this.array[H];if(B=te&&te.removeAfter(y,R-SHIFT,k),B===te&&H===this.array.length-1)return this}var ae=editableVNode(this,y);return ae.array.splice(H+1),B&&(ae.array[H]=B),ae};var DONE={};function iterateList(E,y){var R=E._origin,k=E._capacity,H=getTailOffset(k),B=E._tail;return te(E._root,E._level,0);function te(Ce,Oe,Le){return Oe===0?ae(Ce,Le):ce(Ce,Oe,Le)}function ae(Ce,Oe){var Le=Oe===H?B&&B.array:Ce&&Ce.array,Ne=Oe>R?0:R-Oe,Fe=k-Oe;return Fe>SIZE&&(Fe=SIZE),function(){if(Ne===Fe)return DONE;var Ue=y?--Fe:Ne++;return Le&&Le[Ue]}}function ce(Ce,Oe,Le){var Ne,Fe=Ce&&Ce.array,Ue=Le>R?0:R-Le>>Oe,De=(k-Le>>Oe)+1;return De>SIZE&&(De=SIZE),function(){for(;;){if(Ne){var $e=Ne();if($e!==DONE)return $e;Ne=null}if(Ue===De)return DONE;var Be=y?--De:Ue++;Ne=te(Fe&&Fe[Be],Oe-SHIFT,Le+(Be<=E.size||y<0)return E.withMutations(function(te){y<0?setListBounds(te,y).set(0,R):setListBounds(te,0,y+1).set(y,R)});y+=E._origin;var k=E._tail,H=E._root,B=MakeRef();return y>=getTailOffset(E._capacity)?k=updateVNode(k,E.__ownerID,0,y,R,B):H=updateVNode(H,E.__ownerID,E._level,y,R,B),B.value?E.__ownerID?(E._root=H,E._tail=k,E.__hash=void 0,E.__altered=!0,E):makeList(E._origin,E._capacity,E._level,H,k):E}function updateVNode(E,y,R,k,H,B){var te=k>>>R&MASK,ae=E&&te0){var Ce=E&&E.array[te],Oe=updateVNode(Ce,y,R-SHIFT,k,H,B);return Oe===Ce?E:(ce=editableVNode(E,y),ce.array[te]=Oe,ce)}return ae&&E.array[te]===H?E:(B&&SetRef(B),ce=editableVNode(E,y),H===void 0&&te===ce.array.length-1?ce.array.pop():ce.array[te]=H,ce)}function editableVNode(E,y){return y&&E&&y===E.ownerID?E:new VNode(E?E.array.slice():[],y)}function listNodeFor(E,y){if(y>=getTailOffset(E._capacity))return E._tail;if(y<1<0;)R=R.array[y>>>k&MASK],k-=SHIFT;return R}}function setListBounds(E,y,R){y!==void 0&&(y|=0),R!==void 0&&(R|=0);var k=E.__ownerID||new OwnerID,H=E._origin,B=E._capacity,te=H+y,ae=R===void 0?B:R<0?B+R:H+R;if(te===H&&ae===B)return E;if(te>=ae)return E.clear();for(var ce=E._level,Ce=E._root,Oe=0;te+Oe<0;)Ce=new VNode(Ce&&Ce.array.length?[void 0,Ce]:[],k),ce+=SHIFT,Oe+=1<=1<Le?new VNode([],k):Fe;if(Fe&&Ne>Le&&teSHIFT;$e-=SHIFT){var Be=Le>>>$e&MASK;De=De.array[Be]=editableVNode(De.array[Be],k)}De.array[Le>>>SHIFT&MASK]=Fe}if(ae=Ne)te-=Ne,ae-=Ne,ce=SHIFT,Ce=null,Ue=Ue&&Ue.removeBefore(k,0,te);else if(te>H||Ne>>ce&MASK;if(Ve!==Ne>>>ce&MASK)break;Ve&&(Oe+=(1<H&&(Ce=Ce.removeBefore(k,ce,te-Oe)),Ce&&Ne>>SHIFT<=SIZE&&H.size>=k.size*2?(ce=H.filter(function(Ce,Oe){return Ce!==void 0&&B!==Oe}),ae=ce.toKeyedSeq().map(function(Ce){return Ce[0]}).flip().toMap(),E.__ownerID&&(ae.__ownerID=ce.__ownerID=E.__ownerID)):(ae=k.remove(y),ce=B===H.size-1?H.pop():H.set(B,void 0))}else if(te){if(R===H.get(B)[1])return E;ae=k,ce=H.set(B,[y,R])}else ae=k.set(y,H.size),ce=H.set(H.size,[y,R]);return E.__ownerID?(E.size=ae.size,E._map=ae,E._list=ce,E.__hash=void 0,E.__altered=!0,E):makeOrderedMap(ae,ce)}var IS_STACK_SYMBOL="@@__IMMUTABLE_STACK__@@";function isStack(E){return!!(E&&E[IS_STACK_SYMBOL])}var Stack$1=function(E){function y(R){return R==null?emptyStack():isStack(R)?R:emptyStack().pushAll(R)}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.of=function(){return this(arguments)},y.prototype.toString=function(){return this.__toString("Stack [","]")},y.prototype.get=function(k,H){var B=this._head;for(k=wrapIndex(this,k);B&&k--;)B=B.next;return B?B.value:H},y.prototype.peek=function(){return this._head&&this._head.value},y.prototype.push=function(){var k=arguments;if(arguments.length===0)return this;for(var H=this.size+arguments.length,B=this._head,te=arguments.length-1;te>=0;te--)B={value:k[te],next:B};return this.__ownerID?(this.size=H,this._head=B,this.__hash=void 0,this.__altered=!0,this):makeStack(H,B)},y.prototype.pushAll=function(k){if(k=E(k),k.size===0)return this;if(this.size===0&&isStack(k))return k;assertNotInfinite(k.size);var H=this.size,B=this._head;return k.__iterate(function(te){H++,B={value:te,next:B}},!0),this.__ownerID?(this.size=H,this._head=B,this.__hash=void 0,this.__altered=!0,this):makeStack(H,B)},y.prototype.pop=function(){return this.slice(1)},y.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},y.prototype.slice=function(k,H){if(wholeSlice(k,H,this.size))return this;var B=resolveBegin(k,this.size),te=resolveEnd(H,this.size);if(te!==this.size)return E.prototype.slice.call(this,k,H);for(var ae=this.size-B,ce=this._head;B--;)ce=ce.next;return this.__ownerID?(this.size=ae,this._head=ce,this.__hash=void 0,this.__altered=!0,this):makeStack(ae,ce)},y.prototype.__ensureOwner=function(k){return k===this.__ownerID?this:k?makeStack(this.size,this._head,k,this.__hash):this.size===0?emptyStack():(this.__ownerID=k,this.__altered=!1,this)},y.prototype.__iterate=function(k,H){var B=this;if(H)return new ArraySeq(this.toArray()).__iterate(function(ce,Ce){return k(ce,Ce,B)},H);for(var te=0,ae=this._head;ae&&k(ae.value,te++,this)!==!1;)ae=ae.next;return te},y.prototype.__iterator=function(k,H){if(H)return new ArraySeq(this.toArray()).__iterator(k,H);var B=0,te=this._head;return new Iterator(function(){if(te){var ae=te.value;return te=te.next,iteratorValue(k,B++,ae)}return iteratorDone()})},y}(IndexedCollection);Stack$1.isStack=isStack;var StackPrototype=Stack$1.prototype;StackPrototype[IS_STACK_SYMBOL]=!0;StackPrototype.shift=StackPrototype.pop;StackPrototype.unshift=StackPrototype.push;StackPrototype.unshiftAll=StackPrototype.pushAll;StackPrototype.withMutations=withMutations;StackPrototype.wasAltered=wasAltered;StackPrototype.asImmutable=asImmutable;StackPrototype["@@transducer/init"]=StackPrototype.asMutable=asMutable;StackPrototype["@@transducer/step"]=function(E,y){return E.unshift(y)};StackPrototype["@@transducer/result"]=function(E){return E.asImmutable()};function makeStack(E,y,R,k){var H=Object.create(StackPrototype);return H.size=E,H._head=y,H.__ownerID=R,H.__hash=k,H.__altered=!1,H}var EMPTY_STACK;function emptyStack(){return EMPTY_STACK||(EMPTY_STACK=makeStack(0))}var IS_SET_SYMBOL="@@__IMMUTABLE_SET__@@";function isSet(E){return!!(E&&E[IS_SET_SYMBOL])}function isOrderedSet(E){return isSet(E)&&isOrdered(E)}function deepEqual(E,y){if(E===y)return!0;if(!isCollection(y)||E.size!==void 0&&y.size!==void 0&&E.size!==y.size||E.__hash!==void 0&&y.__hash!==void 0&&E.__hash!==y.__hash||isKeyed(E)!==isKeyed(y)||isIndexed(E)!==isIndexed(y)||isOrdered(E)!==isOrdered(y))return!1;if(E.size===0&&y.size===0)return!0;var R=!isAssociative(E);if(isOrdered(E)){var k=E.entries();return y.every(function(ce,Ce){var Oe=k.next().value;return Oe&&is(Oe[1],ce)&&(R||is(Oe[0],Ce))})&&k.next().done}var H=!1;if(E.size===void 0)if(y.size===void 0)typeof E.cacheResult=="function"&&E.cacheResult();else{H=!0;var B=E;E=y,y=B}var te=!0,ae=y.__iterate(function(ce,Ce){if(R?!E.has(ce):H?!is(ce,E.get(Ce,NOT_SET)):!is(E.get(Ce,NOT_SET),ce))return te=!1,!1});return te&&E.size===ae}function mixin(E,y){var R=function(k){E.prototype[k]=y[k]};return Object.keys(y).forEach(R),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(y).forEach(R),E}function toJS(E){if(!E||typeof E!="object")return E;if(!isCollection(E)){if(!isDataStructure(E))return E;E=Seq(E)}if(isKeyed(E)){var y={};return E.__iterate(function(k,H){y[H]=toJS(k)}),y}var R=[];return E.__iterate(function(k){R.push(toJS(k))}),R}var Set$1=function(E){function y(R){return R==null?emptySet():isSet(R)&&!isOrdered(R)?R:emptySet().withMutations(function(k){var H=E(R);assertNotInfinite(H.size),H.forEach(function(B){return k.add(B)})})}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.of=function(){return this(arguments)},y.fromKeys=function(k){return this(KeyedCollection(k).keySeq())},y.intersect=function(k){return k=Collection(k).toArray(),k.length?SetPrototype.intersect.apply(y(k.pop()),k):emptySet()},y.union=function(k){return k=Collection(k).toArray(),k.length?SetPrototype.union.apply(y(k.pop()),k):emptySet()},y.prototype.toString=function(){return this.__toString("Set {","}")},y.prototype.has=function(k){return this._map.has(k)},y.prototype.add=function(k){return updateSet(this,this._map.set(k,k))},y.prototype.remove=function(k){return updateSet(this,this._map.remove(k))},y.prototype.clear=function(){return updateSet(this,this._map.clear())},y.prototype.map=function(k,H){var B=this,te=!1,ae=updateSet(this,this._map.mapEntries(function(ce){var Ce=ce[1],Oe=k.call(H,Ce,Ce,B);return Oe!==Ce&&(te=!0),[Oe,Oe]},H));return te?ae:this},y.prototype.union=function(){for(var k=[],H=arguments.length;H--;)k[H]=arguments[H];return k=k.filter(function(B){return B.size!==0}),k.length===0?this:this.size===0&&!this.__ownerID&&k.length===1?this.constructor(k[0]):this.withMutations(function(B){for(var te=0;te=0&&H=0&&Bthis.size?R:this.find(function(k,H){return H===y},void 0,R)},has:function(y){return y=wrapIndex(this,y),y>=0&&(this.size!==void 0?this.size===1/0||yy?-1:0}function hashCollection(E){if(E.size===1/0)return 0;var y=isOrdered(E),R=isKeyed(E),k=y?1:0,H=E.__iterate(R?y?function(B,te){k=31*k+hashMerge(hash(B),hash(te))|0}:function(B,te){k=k+hashMerge(hash(B),hash(te))|0}:y?function(B){k=31*k+hash(B)|0}:function(B){k=k+hash(B)|0});return murmurHashOfSize(H,k)}function murmurHashOfSize(E,y){return y=imul(y,3432918353),y=imul(y<<15|y>>>-15,461845907),y=imul(y<<13|y>>>-13,5),y=(y+3864292196|0)^E,y=imul(y^y>>>16,2246822507),y=imul(y^y>>>13,3266489909),y=smi(y^y>>>16),y}function hashMerge(E,y){return E^y+2654435769+(E<<6)+(E>>2)|0}var OrderedSet=function(E){function y(R){return R==null?emptyOrderedSet():isOrderedSet(R)?R:emptyOrderedSet().withMutations(function(k){var H=SetCollection(R);assertNotInfinite(H.size),H.forEach(function(B){return k.add(B)})})}return E&&(y.__proto__=E),y.prototype=Object.create(E&&E.prototype),y.prototype.constructor=y,y.of=function(){return this(arguments)},y.fromKeys=function(k){return this(KeyedCollection(k).keySeq())},y.prototype.toString=function(){return this.__toString("OrderedSet {","}")},y}(Set$1);OrderedSet.isOrderedSet=isOrderedSet;var OrderedSetPrototype=OrderedSet.prototype;OrderedSetPrototype[IS_ORDERED_SYMBOL]=!0;OrderedSetPrototype.zip=IndexedCollectionPrototype.zip;OrderedSetPrototype.zipWith=IndexedCollectionPrototype.zipWith;OrderedSetPrototype.zipAll=IndexedCollectionPrototype.zipAll;OrderedSetPrototype.__empty=emptyOrderedSet;OrderedSetPrototype.__make=makeOrderedSet;function makeOrderedSet(E,y){var R=Object.create(OrderedSetPrototype);return R.size=E?E.size:0,R._map=E,R.__ownerID=y,R}var EMPTY_ORDERED_SET;function emptyOrderedSet(){return EMPTY_ORDERED_SET||(EMPTY_ORDERED_SET=makeOrderedSet(emptyOrderedMap()))}function throwOnInvalidDefaultValues(E){if(isRecord(E))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(isImmutable(E))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(E===null||typeof E!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Record=function(y,R){var k;throwOnInvalidDefaultValues(y);var H=function(ae){var ce=this;if(ae instanceof H)return ae;if(!(this instanceof H))return new H(ae);if(!k){k=!0;var Ce=Object.keys(y),Oe=B._indices={};B._name=R,B._keys=Ce,B._defaultValues=y;for(var Le=0;Le2?[]:void 0,{"":E})}function fromJSWith(E,y,R,k,H,B){if(typeof R!="string"&&!isImmutable(R)&&(isArrayLike(R)||hasIterator(R)||isPlainObject$1(R))){if(~E.indexOf(R))throw new TypeError("Cannot convert circular structure to Immutable");E.push(R),H&&k!==""&&H.push(k);var te=y.call(B,k,Seq(R).map(function(ae,ce){return fromJSWith(E,y,ae,ce,H,R)}),H&&H.slice());return E.pop(),H&&H.pop(),te}return R}function defaultConverter(E,y){return isIndexed(y)?y.toList():isKeyed(y)?y.toMap():y.toSet()}function assertIsFunction(E,y=`expected a function, instead received ${typeof E}`){if(typeof E!="function")throw new TypeError(y)}function assertIsArrayOfFunctions(E,y="expected all items to be functions, instead received the following types: "){if(!E.every(R=>typeof R=="function")){const R=E.map(k=>typeof k=="function"?`function ${k.name||"unnamed"}()`:typeof k).join(", ");throw new TypeError(`${y}[${R}]`)}}var ensureIsArray=E=>Array.isArray(E)?E:[E];function getDependencies(E){const y=Array.isArray(E[0])?E[0]:E;return assertIsArrayOfFunctions(y,"createSelector expects all input-selectors to be functions, but received the following types: "),y}function collectInputSelectorResults(E,y){const R=[],{length:k}=E;for(let H=0;H{R=createCacheNode(),te.resetResultsCount()},te.resultsCount=()=>B,te.resetResultsCount=()=>{B=0},te}function createSelectorCreator(E,...y){const R=typeof E=="function"?{memoize:E,memoizeOptions:y}:E;return(...H)=>{let B=0,te=0,ae,ce={},Ce=H.pop();typeof Ce=="object"&&(ce=Ce,Ce=H.pop()),assertIsFunction(Ce,`createSelector expects an output function after the inputs, but received: [${typeof Ce}]`);const Oe={...R,...ce},{memoize:Le,memoizeOptions:Ne=[],argsMemoize:Fe=weakMapMemoize,argsMemoizeOptions:Ue=[],devModeChecks:De={}}=Oe,$e=ensureIsArray(Ne),Be=ensureIsArray(Ue),Ve=getDependencies(H),Ke=Le(function(){return B++,Ce.apply(null,arguments)},...$e),st=Fe(function(){te++;const at=collectInputSelectorResults(Ve,arguments);return ae=Ke.apply(null,at),ae},...Be);return Object.assign(st,{resultFunc:Ce,memoizedResultFunc:Ke,dependencies:Ve,dependencyRecomputations:()=>te,resetDependencyRecomputations:()=>{te=0},lastResult:()=>ae,recomputations:()=>B,resetRecomputations:()=>{B=0},memoize:Le,argsMemoize:Fe})}}var createSelector=createSelectorCreator(weakMapMemoize),extendStatics=function(E,y){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,k){R.__proto__=k}||function(R,k){for(var H in k)Object.prototype.hasOwnProperty.call(k,H)&&(R[H]=k[H])},extendStatics(E,y)};function __extends(E,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");extendStatics(E,y);function R(){this.constructor=E}E.prototype=y===null?Object.create(y):(R.prototype=y.prototype,new R)}var __assign$1=function(){return __assign$1=Object.assign||function(y){for(var R,k=1,H=arguments.length;k"u"&&(B=E.call(this,k),y.set(H,B)),B}function variadic$1(E,y,R){var k=Array.prototype.slice.call(arguments,3),H=R(k),B=y.get(H);return typeof B>"u"&&(B=E.apply(this,k),y.set(H,B)),B}function assemble$1(E,y,R,k,H){return R.bind(y,E,k,H)}function strategyDefault$1(E,y){var R=E.length===1?monadic$1:variadic$1;return assemble$1(E,this,R,y.cache.create(),y.serializer)}function strategyVariadic$1(E,y){return assemble$1(E,this,variadic$1,y.cache.create(),y.serializer)}function strategyMonadic$1(E,y){return assemble$1(E,this,monadic$1,y.cache.create(),y.serializer)}var serializerDefault$1=function(){return JSON.stringify(arguments)};function ObjectWithoutPrototypeCache$1(){this.cache=Object.create(null)}ObjectWithoutPrototypeCache$1.prototype.get=function(E){return this.cache[E]};ObjectWithoutPrototypeCache$1.prototype.set=function(E,y){this.cache[E]=y};var cacheDefault$1={create:function(){return new ObjectWithoutPrototypeCache$1}},strategies$1={variadic:strategyVariadic$1,monadic:strategyMonadic$1},ErrorKind$1;(function(E){E[E.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",E[E.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",E[E.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",E[E.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",E[E.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",E[E.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",E[E.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",E[E.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",E[E.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",E[E.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",E[E.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",E[E.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",E[E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",E[E.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",E[E.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",E[E.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",E[E.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",E[E.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",E[E.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",E[E.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",E[E.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",E[E.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",E[E.INVALID_TAG=23]="INVALID_TAG",E[E.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",E[E.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",E[E.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(ErrorKind$1||(ErrorKind$1={}));var TYPE$1;(function(E){E[E.literal=0]="literal",E[E.argument=1]="argument",E[E.number=2]="number",E[E.date=3]="date",E[E.time=4]="time",E[E.select=5]="select",E[E.plural=6]="plural",E[E.pound=7]="pound",E[E.tag=8]="tag"})(TYPE$1||(TYPE$1={}));var SKELETON_TYPE$1;(function(E){E[E.number=0]="number",E[E.dateTime=1]="dateTime"})(SKELETON_TYPE$1||(SKELETON_TYPE$1={}));function isLiteralElement$1(E){return E.type===TYPE$1.literal}function isArgumentElement$1(E){return E.type===TYPE$1.argument}function isNumberElement$1(E){return E.type===TYPE$1.number}function isDateElement$1(E){return E.type===TYPE$1.date}function isTimeElement$1(E){return E.type===TYPE$1.time}function isSelectElement$1(E){return E.type===TYPE$1.select}function isPluralElement$1(E){return E.type===TYPE$1.plural}function isPoundElement$1(E){return E.type===TYPE$1.pound}function isTagElement$1(E){return E.type===TYPE$1.tag}function isNumberSkeleton$1(E){return!!(E&&typeof E=="object"&&E.type===SKELETON_TYPE$1.number)}function isDateTimeSkeleton$1(E){return!!(E&&typeof E=="object"&&E.type===SKELETON_TYPE$1.dateTime)}var SPACE_SEPARATOR_REGEX$1=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,DATE_TIME_REGEX$1=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function parseDateTimeSkeleton$1(E){var y={};return E.replace(DATE_TIME_REGEX$1,function(R){var k=R.length;switch(R[0]){case"G":y.era=k===4?"long":k===5?"narrow":"short";break;case"y":y.year=k===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":y.month=["numeric","2-digit","short","long","narrow"][k-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":y.day=["numeric","2-digit"][k-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":y.weekday=k===4?"long":k===5?"narrow":"short";break;case"e":if(k<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");y.weekday=["short","long","narrow","short"][k-4];break;case"c":if(k<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");y.weekday=["short","long","narrow","short"][k-4];break;case"a":y.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":y.hourCycle="h12",y.hour=["numeric","2-digit"][k-1];break;case"H":y.hourCycle="h23",y.hour=["numeric","2-digit"][k-1];break;case"K":y.hourCycle="h11",y.hour=["numeric","2-digit"][k-1];break;case"k":y.hourCycle="h24",y.hour=["numeric","2-digit"][k-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":y.minute=["numeric","2-digit"][k-1];break;case"s":y.second=["numeric","2-digit"][k-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":y.timeZoneName=k<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),y}var WHITE_SPACE_REGEX$1=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function parseNumberSkeletonFromString$1(E){if(E.length===0)throw new Error("Number skeleton cannot be empty");for(var y=E.split(WHITE_SPACE_REGEX$1).filter(function(Ne){return Ne.length>0}),R=[],k=0,H=y;k1)throw new RangeError("integer-width stems only accept a single optional option");H.options[0].replace(INTEGER_WIDTH_REGEX$1,function(ce,Ce,Oe,Le,Ne,Fe){if(Ce)y.minimumIntegerDigits=Oe.length;else{if(Le&&Ne)throw new Error("We currently do not support maximum integer digits");if(Fe)throw new Error("We currently do not support exact integer digits")}return""});continue}if(CONCISE_INTEGER_WIDTH_REGEX$1.test(H.stem)){y.minimumIntegerDigits=H.stem.length;continue}if(FRACTION_PRECISION_REGEX$1.test(H.stem)){if(H.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");H.stem.replace(FRACTION_PRECISION_REGEX$1,function(ce,Ce,Oe,Le,Ne,Fe){return Oe==="*"?y.minimumFractionDigits=Ce.length:Le&&Le[0]==="#"?y.maximumFractionDigits=Le.length:Ne&&Fe?(y.minimumFractionDigits=Ne.length,y.maximumFractionDigits=Ne.length+Fe.length):(y.minimumFractionDigits=Ce.length,y.maximumFractionDigits=Ce.length),""});var B=H.options[0];B==="w"?y=__assign$1(__assign$1({},y),{trailingZeroDisplay:"stripIfInteger"}):B&&(y=__assign$1(__assign$1({},y),parseSignificantPrecision$1(B)));continue}if(SIGNIFICANT_PRECISION_REGEX$1.test(H.stem)){y=__assign$1(__assign$1({},y),parseSignificantPrecision$1(H.stem));continue}var te=parseSign$1(H.stem);te&&(y=__assign$1(__assign$1({},y),te));var ae=parseConciseScientificAndEngineeringStem$1(H.stem);ae&&(y=__assign$1(__assign$1({},y),ae))}return y}var timeData$1={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function getBestPattern$1(E,y){for(var R="",k=0;k>1),ce="a",Ce=getDefaultHourSymbolFromLocale$1(y);for((Ce=="H"||Ce=="k")&&(ae=0);ae-- >0;)R+=ce;for(;te-- >0;)R=Ce+R}else H==="J"?R+="H":R+=H}return R}function getDefaultHourSymbolFromLocale$1(E){var y=E.hourCycle;if(y===void 0&&E.hourCycles&&E.hourCycles.length&&(y=E.hourCycles[0]),y)switch(y){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var R=E.language,k;R!=="root"&&(k=E.maximize().region);var H=timeData$1[k||""]||timeData$1[R||""]||timeData$1["".concat(R,"-001")]||timeData$1["001"];return H[0]}var _a$1,SPACE_SEPARATOR_START_REGEX$1=new RegExp("^".concat(SPACE_SEPARATOR_REGEX$1.source,"*")),SPACE_SEPARATOR_END_REGEX$1=new RegExp("".concat(SPACE_SEPARATOR_REGEX$1.source,"*$"));function createLocation$2(E,y){return{start:E,end:y}}var hasNativeStartsWith$1=!!String.prototype.startsWith&&"_a".startsWith("a",1),hasNativeFromCodePoint$1=!!String.fromCodePoint,hasNativeFromEntries$1=!!Object.fromEntries,hasNativeCodePointAt$1=!!String.prototype.codePointAt,hasTrimStart$1=!!String.prototype.trimStart,hasTrimEnd$1=!!String.prototype.trimEnd,hasNativeIsSafeInteger$1=!!Number.isSafeInteger,isSafeInteger$1=hasNativeIsSafeInteger$1?Number.isSafeInteger:function(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E&&Math.abs(E)<=9007199254740991},REGEX_SUPPORTS_U_AND_Y$1=!0;try{var re$2=RE$1("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");REGEX_SUPPORTS_U_AND_Y$1=((_a$1=re$2.exec("a"))===null||_a$1===void 0?void 0:_a$1[0])==="a"}catch{REGEX_SUPPORTS_U_AND_Y$1=!1}var startsWith$1=hasNativeStartsWith$1?function(y,R,k){return y.startsWith(R,k)}:function(y,R,k){return y.slice(k,k+R.length)===R},fromCodePoint$1=hasNativeFromCodePoint$1?String.fromCodePoint:function(){for(var y=[],R=0;RB;){if(te=y[B++],te>1114111)throw RangeError(te+" is not a valid code point");k+=te<65536?String.fromCharCode(te):String.fromCharCode(((te-=65536)>>10)+55296,te%1024+56320)}return k},fromEntries$1=hasNativeFromEntries$1?Object.fromEntries:function(y){for(var R={},k=0,H=y;k=k)){var H=y.charCodeAt(R),B;return H<55296||H>56319||R+1===k||(B=y.charCodeAt(R+1))<56320||B>57343?H:(H-55296<<10)+(B-56320)+65536}},trimStart$1=hasTrimStart$1?function(y){return y.trimStart()}:function(y){return y.replace(SPACE_SEPARATOR_START_REGEX$1,"")},trimEnd$1=hasTrimEnd$1?function(y){return y.trimEnd()}:function(y){return y.replace(SPACE_SEPARATOR_END_REGEX$1,"")};function RE$1(E,y){return new RegExp(E,y)}var matchIdentifierAtIndex$1;if(REGEX_SUPPORTS_U_AND_Y$1){var IDENTIFIER_PREFIX_RE_1$1=RE$1("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");matchIdentifierAtIndex$1=function(y,R){var k;IDENTIFIER_PREFIX_RE_1$1.lastIndex=R;var H=IDENTIFIER_PREFIX_RE_1$1.exec(y);return(k=H[1])!==null&&k!==void 0?k:""}}else matchIdentifierAtIndex$1=function(y,R){for(var k=[];;){var H=codePointAt$1(y,R);if(H===void 0||_isWhiteSpace$1(H)||_isPatternSyntax$1(H))break;k.push(H),R+=H>=65536?2:1}return fromCodePoint$1.apply(void 0,k)};var Parser$1=function(){function E(y,R){R===void 0&&(R={}),this.message=y,this.position={offset:0,line:1,column:1},this.ignoreTag=!!R.ignoreTag,this.locale=R.locale,this.requiresOtherClause=!!R.requiresOtherClause,this.shouldParseSkeletons=!!R.shouldParseSkeletons}return E.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},E.prototype.parseMessage=function(y,R,k){for(var H=[];!this.isEOF();){var B=this.char();if(B===123){var te=this.parseArgument(y,k);if(te.err)return te;H.push(te.val)}else{if(B===125&&y>0)break;if(B===35&&(R==="plural"||R==="selectordinal")){var ae=this.clonePosition();this.bump(),H.push({type:TYPE$1.pound,location:createLocation$2(ae,this.clonePosition())})}else if(B===60&&!this.ignoreTag&&this.peek()===47){if(k)break;return this.error(ErrorKind$1.UNMATCHED_CLOSING_TAG,createLocation$2(this.clonePosition(),this.clonePosition()))}else if(B===60&&!this.ignoreTag&&_isAlpha$1(this.peek()||0)){var te=this.parseTag(y,R);if(te.err)return te;H.push(te.val)}else{var te=this.parseLiteral(y,R);if(te.err)return te;H.push(te.val)}}}return{val:H,err:null}},E.prototype.parseTag=function(y,R){var k=this.clonePosition();this.bump();var H=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:TYPE$1.literal,value:"<".concat(H,"/>"),location:createLocation$2(k,this.clonePosition())},err:null};if(this.bumpIf(">")){var B=this.parseMessage(y+1,R,!0);if(B.err)return B;var te=B.val,ae=this.clonePosition();if(this.bumpIf("")?{val:{type:TYPE$1.tag,value:H,children:te,location:createLocation$2(k,this.clonePosition())},err:null}:this.error(ErrorKind$1.INVALID_TAG,createLocation$2(ae,this.clonePosition())))}else return this.error(ErrorKind$1.UNCLOSED_TAG,createLocation$2(k,this.clonePosition()))}else return this.error(ErrorKind$1.INVALID_TAG,createLocation$2(k,this.clonePosition()))},E.prototype.parseTagName=function(){var y=this.offset();for(this.bump();!this.isEOF()&&_isPotentialElementNameChar$1(this.char());)this.bump();return this.message.slice(y,this.offset())},E.prototype.parseLiteral=function(y,R){for(var k=this.clonePosition(),H="";;){var B=this.tryParseQuote(R);if(B){H+=B;continue}var te=this.tryParseUnquoted(y,R);if(te){H+=te;continue}var ae=this.tryParseLeftAngleBracket();if(ae){H+=ae;continue}break}var ce=createLocation$2(k,this.clonePosition());return{val:{type:TYPE$1.literal,value:H,location:ce},err:null}},E.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!_isAlphaOrSlash$1(this.peek()||0))?(this.bump(),"<"):null},E.prototype.tryParseQuote=function(y){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(y==="plural"||y==="selectordinal")break;return null;default:return null}this.bump();var R=[this.char()];for(this.bump();!this.isEOF();){var k=this.char();if(k===39)if(this.peek()===39)R.push(39),this.bump();else{this.bump();break}else R.push(k);this.bump()}return fromCodePoint$1.apply(void 0,R)},E.prototype.tryParseUnquoted=function(y,R){if(this.isEOF())return null;var k=this.char();return k===60||k===123||k===35&&(R==="plural"||R==="selectordinal")||k===125&&y>0?null:(this.bump(),fromCodePoint$1(k))},E.prototype.parseArgument=function(y,R){var k=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(ErrorKind$1.EXPECT_ARGUMENT_CLOSING_BRACE,createLocation$2(k,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(ErrorKind$1.EMPTY_ARGUMENT,createLocation$2(k,this.clonePosition()));var H=this.parseIdentifierIfPossible().value;if(!H)return this.error(ErrorKind$1.MALFORMED_ARGUMENT,createLocation$2(k,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(ErrorKind$1.EXPECT_ARGUMENT_CLOSING_BRACE,createLocation$2(k,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:TYPE$1.argument,value:H,location:createLocation$2(k,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(ErrorKind$1.EXPECT_ARGUMENT_CLOSING_BRACE,createLocation$2(k,this.clonePosition())):this.parseArgumentOptions(y,R,H,k);default:return this.error(ErrorKind$1.MALFORMED_ARGUMENT,createLocation$2(k,this.clonePosition()))}},E.prototype.parseIdentifierIfPossible=function(){var y=this.clonePosition(),R=this.offset(),k=matchIdentifierAtIndex$1(this.message,R),H=R+k.length;this.bumpTo(H);var B=this.clonePosition(),te=createLocation$2(y,B);return{value:k,location:te}},E.prototype.parseArgumentOptions=function(y,R,k,H){var B,te=this.clonePosition(),ae=this.parseIdentifierIfPossible().value,ce=this.clonePosition();switch(ae){case"":return this.error(ErrorKind$1.EXPECT_ARGUMENT_TYPE,createLocation$2(te,ce));case"number":case"date":case"time":{this.bumpSpace();var Ce=null;if(this.bumpIf(",")){this.bumpSpace();var Oe=this.clonePosition(),Le=this.parseSimpleArgStyleIfPossible();if(Le.err)return Le;var Ne=trimEnd$1(Le.val);if(Ne.length===0)return this.error(ErrorKind$1.EXPECT_ARGUMENT_STYLE,createLocation$2(this.clonePosition(),this.clonePosition()));var Fe=createLocation$2(Oe,this.clonePosition());Ce={style:Ne,styleLocation:Fe}}var Ue=this.tryParseArgumentClose(H);if(Ue.err)return Ue;var De=createLocation$2(H,this.clonePosition());if(Ce&&startsWith$1(Ce==null?void 0:Ce.style,"::",0)){var $e=trimStart$1(Ce.style.slice(2));if(ae==="number"){var Le=this.parseNumberSkeletonFromString($e,Ce.styleLocation);return Le.err?Le:{val:{type:TYPE$1.number,value:k,location:De,style:Le.val},err:null}}else{if($e.length===0)return this.error(ErrorKind$1.EXPECT_DATE_TIME_SKELETON,De);var Be=$e;this.locale&&(Be=getBestPattern$1($e,this.locale));var Ne={type:SKELETON_TYPE$1.dateTime,pattern:Be,location:Ce.styleLocation,parsedOptions:this.shouldParseSkeletons?parseDateTimeSkeleton$1(Be):{}},Ve=ae==="date"?TYPE$1.date:TYPE$1.time;return{val:{type:Ve,value:k,location:De,style:Ne},err:null}}}return{val:{type:ae==="number"?TYPE$1.number:ae==="date"?TYPE$1.date:TYPE$1.time,value:k,location:De,style:(B=Ce==null?void 0:Ce.style)!==null&&B!==void 0?B:null},err:null}}case"plural":case"selectordinal":case"select":{var Ke=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(ErrorKind$1.EXPECT_SELECT_ARGUMENT_OPTIONS,createLocation$2(Ke,__assign$1({},Ke)));this.bumpSpace();var st=this.parseIdentifierIfPossible(),We=0;if(ae!=="select"&&st.value==="offset"){if(!this.bumpIf(":"))return this.error(ErrorKind$1.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,createLocation$2(this.clonePosition(),this.clonePosition()));this.bumpSpace();var Le=this.tryParseDecimalInteger(ErrorKind$1.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ErrorKind$1.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(Le.err)return Le;this.bumpSpace(),st=this.parseIdentifierIfPossible(),We=Le.val}var at=this.tryParsePluralOrSelectOptions(y,ae,R,st);if(at.err)return at;var Ue=this.tryParseArgumentClose(H);if(Ue.err)return Ue;var tt=createLocation$2(H,this.clonePosition());return ae==="select"?{val:{type:TYPE$1.select,value:k,options:fromEntries$1(at.val),location:tt},err:null}:{val:{type:TYPE$1.plural,value:k,options:fromEntries$1(at.val),offset:We,pluralType:ae==="plural"?"cardinal":"ordinal",location:tt},err:null}}default:return this.error(ErrorKind$1.INVALID_ARGUMENT_TYPE,createLocation$2(te,ce))}},E.prototype.tryParseArgumentClose=function(y){return this.isEOF()||this.char()!==125?this.error(ErrorKind$1.EXPECT_ARGUMENT_CLOSING_BRACE,createLocation$2(y,this.clonePosition())):(this.bump(),{val:!0,err:null})},E.prototype.parseSimpleArgStyleIfPossible=function(){for(var y=0,R=this.clonePosition();!this.isEOF();){var k=this.char();switch(k){case 39:{this.bump();var H=this.clonePosition();if(!this.bumpUntil("'"))return this.error(ErrorKind$1.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,createLocation$2(H,this.clonePosition()));this.bump();break}case 123:{y+=1,this.bump();break}case 125:{if(y>0)y-=1;else return{val:this.message.slice(R.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(R.offset,this.offset()),err:null}},E.prototype.parseNumberSkeletonFromString=function(y,R){var k=[];try{k=parseNumberSkeletonFromString$1(y)}catch{return this.error(ErrorKind$1.INVALID_NUMBER_SKELETON,R)}return{val:{type:SKELETON_TYPE$1.number,tokens:k,location:R,parsedOptions:this.shouldParseSkeletons?parseNumberSkeleton$1(k):{}},err:null}},E.prototype.tryParsePluralOrSelectOptions=function(y,R,k,H){for(var B,te=!1,ae=[],ce=new Set,Ce=H.value,Oe=H.location;;){if(Ce.length===0){var Le=this.clonePosition();if(R!=="select"&&this.bumpIf("=")){var Ne=this.tryParseDecimalInteger(ErrorKind$1.EXPECT_PLURAL_ARGUMENT_SELECTOR,ErrorKind$1.INVALID_PLURAL_ARGUMENT_SELECTOR);if(Ne.err)return Ne;Oe=createLocation$2(Le,this.clonePosition()),Ce=this.message.slice(Le.offset,this.offset())}else break}if(ce.has(Ce))return this.error(R==="select"?ErrorKind$1.DUPLICATE_SELECT_ARGUMENT_SELECTOR:ErrorKind$1.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,Oe);Ce==="other"&&(te=!0),this.bumpSpace();var Fe=this.clonePosition();if(!this.bumpIf("{"))return this.error(R==="select"?ErrorKind$1.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:ErrorKind$1.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,createLocation$2(this.clonePosition(),this.clonePosition()));var Ue=this.parseMessage(y+1,R,k);if(Ue.err)return Ue;var De=this.tryParseArgumentClose(Fe);if(De.err)return De;ae.push([Ce,{value:Ue.val,location:createLocation$2(Fe,this.clonePosition())}]),ce.add(Ce),this.bumpSpace(),B=this.parseIdentifierIfPossible(),Ce=B.value,Oe=B.location}return ae.length===0?this.error(R==="select"?ErrorKind$1.EXPECT_SELECT_ARGUMENT_SELECTOR:ErrorKind$1.EXPECT_PLURAL_ARGUMENT_SELECTOR,createLocation$2(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!te?this.error(ErrorKind$1.MISSING_OTHER_CLAUSE,createLocation$2(this.clonePosition(),this.clonePosition())):{val:ae,err:null}},E.prototype.tryParseDecimalInteger=function(y,R){var k=1,H=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(k=-1);for(var B=!1,te=0;!this.isEOF();){var ae=this.char();if(ae>=48&&ae<=57)B=!0,te=te*10+(ae-48),this.bump();else break}var ce=createLocation$2(H,this.clonePosition());return B?(te*=k,isSafeInteger$1(te)?{val:te,err:null}:this.error(R,ce)):this.error(y,ce)},E.prototype.offset=function(){return this.position.offset},E.prototype.isEOF=function(){return this.offset()===this.message.length},E.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},E.prototype.char=function(){var y=this.position.offset;if(y>=this.message.length)throw Error("out of bound");var R=codePointAt$1(this.message,y);if(R===void 0)throw Error("Offset ".concat(y," is at invalid UTF-16 code unit boundary"));return R},E.prototype.error=function(y,R){return{val:null,err:{kind:y,message:this.message,location:R}}},E.prototype.bump=function(){if(!this.isEOF()){var y=this.char();y===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=y<65536?1:2)}},E.prototype.bumpIf=function(y){if(startsWith$1(this.message,y,this.offset())){for(var R=0;R=0?(this.bumpTo(k),!0):(this.bumpTo(this.message.length),!1)},E.prototype.bumpTo=function(y){if(this.offset()>y)throw Error("targetOffset ".concat(y," must be greater than or equal to the current offset ").concat(this.offset()));for(y=Math.min(y,this.message.length);;){var R=this.offset();if(R===y)break;if(R>y)throw Error("targetOffset ".concat(y," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},E.prototype.bumpSpace=function(){for(;!this.isEOF()&&_isWhiteSpace$1(this.char());)this.bump()},E.prototype.peek=function(){if(this.isEOF())return null;var y=this.char(),R=this.offset(),k=this.message.charCodeAt(R+(y>=65536?2:1));return k??null},E}();function _isAlpha$1(E){return E>=97&&E<=122||E>=65&&E<=90}function _isAlphaOrSlash$1(E){return _isAlpha$1(E)||E===47}function _isPotentialElementNameChar$1(E){return E===45||E===46||E>=48&&E<=57||E===95||E>=97&&E<=122||E>=65&&E<=90||E==183||E>=192&&E<=214||E>=216&&E<=246||E>=248&&E<=893||E>=895&&E<=8191||E>=8204&&E<=8205||E>=8255&&E<=8256||E>=8304&&E<=8591||E>=11264&&E<=12271||E>=12289&&E<=55295||E>=63744&&E<=64975||E>=65008&&E<=65533||E>=65536&&E<=983039}function _isWhiteSpace$1(E){return E>=9&&E<=13||E===32||E===133||E>=8206&&E<=8207||E===8232||E===8233}function _isPatternSyntax$1(E){return E>=33&&E<=35||E===36||E>=37&&E<=39||E===40||E===41||E===42||E===43||E===44||E===45||E>=46&&E<=47||E>=58&&E<=59||E>=60&&E<=62||E>=63&&E<=64||E===91||E===92||E===93||E===94||E===96||E===123||E===124||E===125||E===126||E===161||E>=162&&E<=165||E===166||E===167||E===169||E===171||E===172||E===174||E===176||E===177||E===182||E===187||E===191||E===215||E===247||E>=8208&&E<=8213||E>=8214&&E<=8215||E===8216||E===8217||E===8218||E>=8219&&E<=8220||E===8221||E===8222||E===8223||E>=8224&&E<=8231||E>=8240&&E<=8248||E===8249||E===8250||E>=8251&&E<=8254||E>=8257&&E<=8259||E===8260||E===8261||E===8262||E>=8263&&E<=8273||E===8274||E===8275||E>=8277&&E<=8286||E>=8592&&E<=8596||E>=8597&&E<=8601||E>=8602&&E<=8603||E>=8604&&E<=8607||E===8608||E>=8609&&E<=8610||E===8611||E>=8612&&E<=8613||E===8614||E>=8615&&E<=8621||E===8622||E>=8623&&E<=8653||E>=8654&&E<=8655||E>=8656&&E<=8657||E===8658||E===8659||E===8660||E>=8661&&E<=8691||E>=8692&&E<=8959||E>=8960&&E<=8967||E===8968||E===8969||E===8970||E===8971||E>=8972&&E<=8991||E>=8992&&E<=8993||E>=8994&&E<=9e3||E===9001||E===9002||E>=9003&&E<=9083||E===9084||E>=9085&&E<=9114||E>=9115&&E<=9139||E>=9140&&E<=9179||E>=9180&&E<=9185||E>=9186&&E<=9254||E>=9255&&E<=9279||E>=9280&&E<=9290||E>=9291&&E<=9311||E>=9472&&E<=9654||E===9655||E>=9656&&E<=9664||E===9665||E>=9666&&E<=9719||E>=9720&&E<=9727||E>=9728&&E<=9838||E===9839||E>=9840&&E<=10087||E===10088||E===10089||E===10090||E===10091||E===10092||E===10093||E===10094||E===10095||E===10096||E===10097||E===10098||E===10099||E===10100||E===10101||E>=10132&&E<=10175||E>=10176&&E<=10180||E===10181||E===10182||E>=10183&&E<=10213||E===10214||E===10215||E===10216||E===10217||E===10218||E===10219||E===10220||E===10221||E===10222||E===10223||E>=10224&&E<=10239||E>=10240&&E<=10495||E>=10496&&E<=10626||E===10627||E===10628||E===10629||E===10630||E===10631||E===10632||E===10633||E===10634||E===10635||E===10636||E===10637||E===10638||E===10639||E===10640||E===10641||E===10642||E===10643||E===10644||E===10645||E===10646||E===10647||E===10648||E>=10649&&E<=10711||E===10712||E===10713||E===10714||E===10715||E>=10716&&E<=10747||E===10748||E===10749||E>=10750&&E<=11007||E>=11008&&E<=11055||E>=11056&&E<=11076||E>=11077&&E<=11078||E>=11079&&E<=11084||E>=11085&&E<=11123||E>=11124&&E<=11125||E>=11126&&E<=11157||E===11158||E>=11159&&E<=11263||E>=11776&&E<=11777||E===11778||E===11779||E===11780||E===11781||E>=11782&&E<=11784||E===11785||E===11786||E===11787||E===11788||E===11789||E>=11790&&E<=11798||E===11799||E>=11800&&E<=11801||E===11802||E===11803||E===11804||E===11805||E>=11806&&E<=11807||E===11808||E===11809||E===11810||E===11811||E===11812||E===11813||E===11814||E===11815||E===11816||E===11817||E>=11818&&E<=11822||E===11823||E>=11824&&E<=11833||E>=11834&&E<=11835||E>=11836&&E<=11839||E===11840||E===11841||E===11842||E>=11843&&E<=11855||E>=11856&&E<=11857||E===11858||E>=11859&&E<=11903||E>=12289&&E<=12291||E===12296||E===12297||E===12298||E===12299||E===12300||E===12301||E===12302||E===12303||E===12304||E===12305||E>=12306&&E<=12307||E===12308||E===12309||E===12310||E===12311||E===12312||E===12313||E===12314||E===12315||E===12316||E===12317||E>=12318&&E<=12319||E===12320||E===12336||E===64830||E===64831||E>=65093&&E<=65094}function pruneLocation$1(E){E.forEach(function(y){if(delete y.location,isSelectElement$1(y)||isPluralElement$1(y))for(var R in y.options)delete y.options[R].location,pruneLocation$1(y.options[R].value);else isNumberElement$1(y)&&isNumberSkeleton$1(y.style)||(isDateElement$1(y)||isTimeElement$1(y))&&isDateTimeSkeleton$1(y.style)?delete y.style.location:isTagElement$1(y)&&pruneLocation$1(y.children)})}function parse$2(E,y){y===void 0&&(y={}),y=__assign$1({shouldParseSkeletons:!0,requiresOtherClause:!0},y);var R=new Parser$1(E,y).parse();if(R.err){var k=SyntaxError(ErrorKind$1[R.err.kind]);throw k.location=R.err.location,k.originalMessage=R.err.message,k}return y!=null&&y.captureLocation||pruneLocation$1(R.val),R.val}var ErrorCode$1;(function(E){E.MISSING_VALUE="MISSING_VALUE",E.INVALID_VALUE="INVALID_VALUE",E.MISSING_INTL_API="MISSING_INTL_API"})(ErrorCode$1||(ErrorCode$1={}));var FormatError$1=function(E){__extends(y,E);function y(R,k,H){var B=E.call(this,R)||this;return B.code=k,B.originalMessage=H,B}return y.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},y}(Error),InvalidValueError$1=function(E){__extends(y,E);function y(R,k,H,B){return E.call(this,'Invalid values for "'.concat(R,'": "').concat(k,'". Options are "').concat(Object.keys(H).join('", "'),'"'),ErrorCode$1.INVALID_VALUE,B)||this}return y}(FormatError$1),InvalidValueTypeError$1=function(E){__extends(y,E);function y(R,k,H){return E.call(this,'Value for "'.concat(R,'" must be of type ').concat(k),ErrorCode$1.INVALID_VALUE,H)||this}return y}(FormatError$1),MissingValueError$1=function(E){__extends(y,E);function y(R,k){return E.call(this,'The intl string context variable "'.concat(R,'" was not provided to the string "').concat(k,'"'),ErrorCode$1.MISSING_VALUE,k)||this}return y}(FormatError$1),PART_TYPE$2;(function(E){E[E.literal=0]="literal",E[E.object=1]="object"})(PART_TYPE$2||(PART_TYPE$2={}));function mergeLiteral$1(E){return E.length<2?E:E.reduce(function(y,R){var k=y[y.length-1];return!k||k.type!==PART_TYPE$2.literal||R.type!==PART_TYPE$2.literal?y.push(R):k.value+=R.value,y},[])}function isFormatXMLElementFn$2(E){return typeof E=="function"}function formatToParts$1(E,y,R,k,H,B,te){if(E.length===1&&isLiteralElement$1(E[0]))return[{type:PART_TYPE$2.literal,value:E[0].value}];for(var ae=[],ce=0,Ce=E;ce"u")){var R=Intl.NumberFormat.supportedLocalesOf(y);return R.length>0?new Intl.Locale(R[0]):new Intl.Locale(typeof y=="string"?y:y[0])}},E.__parse=parse$2,E.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},E}(),IntlErrorCode;(function(E){E.FORMAT_ERROR="FORMAT_ERROR",E.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",E.INVALID_CONFIG="INVALID_CONFIG",E.MISSING_DATA="MISSING_DATA",E.MISSING_TRANSLATION="MISSING_TRANSLATION"})(IntlErrorCode||(IntlErrorCode={}));var IntlError=function(E){__extends(y,E);function y(R,k,H){var B=this,te=H?H instanceof Error?H:new Error(String(H)):void 0;return B=E.call(this,"[@formatjs/intl Error ".concat(R,"] ").concat(k,` `).concat(te?` `.concat(te.message,` `).concat(te.stack):""))||this,B.code=R,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(B,y),B}return y}(Error),UnsupportedFormatterError=function(E){__extends(y,E);function y(R,k){return E.call(this,IntlErrorCode.UNSUPPORTED_FORMATTER,R,k)||this}return y}(IntlError),InvalidConfigError=function(E){__extends(y,E);function y(R,k){return E.call(this,IntlErrorCode.INVALID_CONFIG,R,k)||this}return y}(IntlError),MissingDataError=function(E){__extends(y,E);function y(R,k){return E.call(this,IntlErrorCode.MISSING_DATA,R,k)||this}return y}(IntlError),IntlFormatError=function(E){__extends(y,E);function y(R,k,H){var B=E.call(this,IntlErrorCode.FORMAT_ERROR,"".concat(R,` Locale: `).concat(k,` `),H)||this;return B.locale=k,B}return y}(IntlError),MessageFormatError=function(E){__extends(y,E);function y(R,k,H,B){var te=E.call(this,"".concat(R,` MessageID: `).concat(H==null?void 0:H.id,` Default Message: `).concat(H==null?void 0:H.defaultMessage,` Description: `).concat(H==null?void 0:H.description,` `),k,B)||this;return te.descriptor=H,te.locale=k,te}return y}(IntlFormatError),MissingTranslationError=function(E){__extends(y,E);function y(R,k){var H=E.call(this,IntlErrorCode.MISSING_TRANSLATION,'Missing message: "'.concat(R.id,'" for locale "').concat(k,'", using ').concat(R.defaultMessage?"default message (".concat(typeof R.defaultMessage=="string"?R.defaultMessage:R.defaultMessage.map(function(B){var te;return(te=B.value)!==null&&te!==void 0?te:JSON.stringify(B)}).join(),")"):"id"," as fallback."))||this;return H.descriptor=R,H}return y}(IntlError);function invariant$3(E,y,R){if(R===void 0&&(R=Error),!E)throw new R(y)}function filterProps(E,y,R){return R===void 0&&(R={}),y.reduce(function(k,H){return H in E?k[H]=E[H]:H in R&&(k[H]=R[H]),k},{})}var defaultErrorHandler=function(E){},defaultWarnHandler=function(E){},DEFAULT_INTL_CONFIG$1={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:defaultErrorHandler,onWarn:defaultWarnHandler};function createIntlCache(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function createFastMemoizeCache$1(E){return{create:function(){return{get:function(y){return E[y]},set:function(y,R){E[y]=R}}}}}function createFormatters(E){E===void 0&&(E=createIntlCache());var y=Intl.RelativeTimeFormat,R=Intl.ListFormat,k=Intl.DisplayNames,H=memoize$1(function(){for(var ae,ce=[],Ce=0;Ce needs to exist in the component ancestry.")}var DEFAULT_INTL_CONFIG=__assign$1(__assign$1({},DEFAULT_INTL_CONFIG$1),{textComponent:reactExports.Fragment});function assignUniqueKeysToParts(E){return function(y){return E(reactExports.Children.toArray(y))}}function shallowEqual(E,y){if(E===y)return!0;if(!E||!y)return!1;var R=Object.keys(E),k=Object.keys(y),H=R.length;if(k.length!==H)return!1;for(var B=0;B0){document.getElementsByTagName("link");const te=document.querySelector("meta[property=csp-nonce]"),ae=(te==null?void 0:te.nonce)||(te==null?void 0:te.getAttribute("nonce"));H=Promise.allSettled(R.map(ce=>{if(ce=assetsURL(ce),ce in seen)return;seen[ce]=!0;const Ce=ce.endsWith(".css"),Oe=Ce?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="proxy.php?url=https%3A%2F%2Ffe.soapbox.pub%2F%24%7Bce%7D"]${Oe}`))return;const Le=document.createElement("link");if(Le.rel=Ce?"stylesheet":scriptRel,Ce||(Le.as="script"),Le.crossOrigin="",Le.href=ce,ae&&Le.setAttribute("nonce",ae),document.head.appendChild(Le),Ce)return new Promise((Ne,Fe)=>{Le.addEventListener("load",Ne),Le.addEventListener("error",()=>Fe(new Error(`Unable to preload CSS for ${ce}`)))})}))}function B(te){const ae=new Event("vite:preloadError",{cancelable:!0});if(ae.payload=te,window.dispatchEvent(ae),!ae.defaultPrevented)throw te}return H.then(te=>{for(const ae of te||[])ae.status==="rejected"&&B(ae.reason);return y().catch(B)})},sourceCode={name:"soapbox",displayName:"Soapbox",url:"https://gitlab.com/soapbox-pub/soapbox",repository:"soapbox-pub/soapbox",version:"3.2.0-5d01cf9",homepage:"https://soapbox.pub/",ref:"5d01cf90a7a35cb50f24362d73f5425624332dce"};async function startSentry(E){const y=await __vitePreload(()=>import("./js/index-Btf-4yAU.js"),[]);y.init({dsn:E,debug:!1,enabled:NODE_ENV==="production",integrations:[y.browserTracingIntegration()],ignoreErrors:["HTTPError","Failed to update a ServiceWorker for scope","AbortError","No available storage method found","ResizeObserver loop completed with undelivered notifications.","ResizeObserver loop limit exceeded"],denyUrls:[/extensions\//i,/^chrome:\/\//i,/^moz-extension:\/\//i],tracesSampleRate:.1}),y.setContext("soapbox",sourceCode)}async function setSentryAccount(E){(await __vitePreload(()=>import("./js/index-Btf-4yAU.js"),[])).setUser({id:E.id,username:E.acct,url:E.url})}async function unsetSentryAccount(){(await __vitePreload(()=>import("./js/index-Btf-4yAU.js"),[])).setUser(null)}async function captureSentryException(E,y){return(await __vitePreload(()=>import("./js/index-Btf-4yAU.js"),[])).captureException(E,y)}const validId=E=>typeof E=="string"&&E!=="null"&&E!=="undefined",isURL=E=>{if(typeof E!="string")return!1;try{return new URL(E),!0}catch{return!1}},parseBaseURL=E=>{try{return new URL(E).origin}catch{return""}},getLoggedInAccount=E=>selectOwnAccount(E),isLoggedIn=E=>validId(E().me),getAppToken=E=>{var y;return(y=E.auth.app)==null?void 0:y.access_token},getUserToken=(E,y)=>{var k,H;if(!y)return;const R=(k=selectAccount(E,y))==null?void 0:k.url;if(R)return(H=E.auth.users[R])==null?void 0:H.access_token},getAccessToken=E=>{const y=E.me;return getUserToken(E,y)},getAuthUserId=E=>{var R;const y=E.auth.me;return List([(R=E.auth.users[y])==null?void 0:R.id,y].filter(k=>k)).find(validId)},getAuthUserUrl=E=>{var R;const y=E.auth.me;return List([(R=E.auth.users[y])==null?void 0:R.url,y].filter(k=>k)).find(isURL)},getMeUrl$1=E=>{var y;return(y=selectOwnAccount(E))==null?void 0:y.url},getToken=(E,y)=>y==="app"?getAppToken(E):getAccessToken(E),getAuthBaseURL=createSelector([(E,y)=>{var R;return y?(R=selectAccount(E,y))==null?void 0:R.url:void 0},(E,y)=>E.auth.me],(E,y)=>parseBaseURL(E)||parseBaseURL(y)),baseClient=(E,y)=>new MastodonClient(y||BACKEND_URL||location.origin,E||void 0),api=(E,y="user")=>{const R=E(),k=getToken(R,y),H=R.me,B=BACKEND_URL||(H?getAuthBaseURL(R,H):void 0)||location.origin;return baseClient(k,B)},ENTITIES_IMPORT="ENTITIES_IMPORT",ENTITIES_DELETE="ENTITIES_DELETE",ENTITIES_DISMISS="ENTITIES_DISMISS",ENTITIES_INCREMENT="ENTITIES_INCREMENT",ENTITIES_FETCH_REQUEST="ENTITIES_FETCH_REQUEST",ENTITIES_FETCH_SUCCESS="ENTITIES_FETCH_SUCCESS",ENTITIES_FETCH_FAIL="ENTITIES_FETCH_FAIL",ENTITIES_INVALIDATE_LIST="ENTITIES_INVALIDATE_LIST",ENTITIES_TRANSACTION="proxy.php?url=https%3A%2F%2Ffe.soapbox.pub%2FENTITIES_TRANSACTION";function importEntities$1(E,y,R,k){return{type:ENTITIES_IMPORT,entityType:y,entities:E,listKey:R,pos:k}}function deleteEntities$1(E,y,R={}){return{type:ENTITIES_DELETE,ids:E,entityType:y,opts:R}}function dismissEntities$1(E,y,R){return{type:ENTITIES_DISMISS,ids:E,entityType:y,listKey:R}}function entitiesFetchRequest(E,y){return{type:ENTITIES_FETCH_REQUEST,entityType:E,listKey:y}}function entitiesFetchSuccess(E,y,R,k,H,B=!1){return{type:ENTITIES_FETCH_SUCCESS,entityType:y,entities:E,listKey:R,pos:k,newState:H,overwrite:B}}function entitiesFetchFail(E,y,R){return{type:ENTITIES_FETCH_FAIL,entityType:E,listKey:y,error:R}}function invalidateEntityList$1(E,y){return{type:ENTITIES_INVALIDATE_LIST,entityType:E,listKey:y}}function entitiesTransaction(E){return{type:ENTITIES_TRANSACTION,transaction:E}}var Entities=(E=>(E.ACCOUNTS="Accounts",E.DOMAINS="Domains",E.GROUPS="Groups",E.GROUP_MEMBERSHIPS="GroupMemberships",E.GROUP_MUTES="GroupMutes",E.GROUP_RELATIONSHIPS="GroupRelationships",E.GROUP_TAGS="GroupTags",E.PATRON_USERS="PatronUsers",E.RELATIONSHIPS="Relationships",E.RELAYS="Relays",E.RULES="Rules",E.STATUSES="Statuses",E))(Entities||{});const relationshipSchema=z$1.object({blocked_by:z$1.boolean().catch(!1),blocking:z$1.boolean().catch(!1),domain_blocking:z$1.boolean().catch(!1),endorsed:z$1.boolean().catch(!1),followed_by:z$1.boolean().catch(!1),following:z$1.boolean().catch(!1),id:z$1.string(),muting:z$1.boolean().catch(!1),muting_notifications:z$1.boolean().catch(!1),note:z$1.string().catch(""),notifying:z$1.boolean().catch(!1),requested:z$1.boolean().catch(!1),showing_reblogs:z$1.boolean().catch(!1),subscribing:z$1.boolean().catch(!1)});function compareNumber(E,y){if(isNaN(E)||isNaN(y))throw new Error("Cannot compare against non-numbers");return E===y?0:EB)return 1}return 0}const NUMERIC_IDENTIFIER="0|[1-9]\\d*",NON_NUMERIC_IDENTIFIER="\\d*[a-zA-Z-][a-zA-Z0-9-]*",VERSION_CORE=`(?${NUMERIC_IDENTIFIER})\\.(?${NUMERIC_IDENTIFIER})\\.(?${NUMERIC_IDENTIFIER})`,PRERELEASE_IDENTIFIER=`(?:${NUMERIC_IDENTIFIER}|${NON_NUMERIC_IDENTIFIER})`,PRERELEASE=`(?:-(?${PRERELEASE_IDENTIFIER}(?:\\.${PRERELEASE_IDENTIFIER})*))`,BUILD_IDENTIFIER="[0-9A-Za-z-]+",BUILD=`(?:\\+(?${BUILD_IDENTIFIER}(?:\\.${BUILD_IDENTIFIER})*))`,FULL_VERSION=`v?${VERSION_CORE}${PRERELEASE}?${BUILD}?`,FULL_REGEXP=new RegExp(`^${FULL_VERSION}$`);function isValidNumber(E){return typeof E=="number"&&!Number.isNaN(E)&&(!Number.isFinite(E)||0<=E&&E<=Number.MAX_SAFE_INTEGER)}const MAX_LENGTH=256,NUMERIC_IDENTIFIER_REGEXP=new RegExp(`^${NUMERIC_IDENTIFIER}$`);function parsePrerelease(E){return E.split(".").filter(Boolean).map(y=>{if(NUMERIC_IDENTIFIER_REGEXP.test(y)){const R=Number(y);if(isValidNumber(R))return R}return y})}function parseBuild(E){return E.split(".").filter(Boolean)}function parseNumber(E,y){const R=Number(E);if(!isValidNumber(R))throw new TypeError(y);return R}function compare(E,y){return E===y?0:compareNumber(E.major,y.major)||compareNumber(E.minor,y.minor)||compareNumber(E.patch,y.patch)||checkIdentifier(E.prerelease,y.prerelease)||compareIdentifier(E.prerelease,y.prerelease)}function greaterOrEqual(E,y){return compare(E,y)>=0}function lessThan(E,y){return compare(E,y)<0}function parse$1(E){var ae;if(typeof E!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof E}`);if(E.length>MAX_LENGTH)throw new TypeError(`Cannot parse version as version length is too long: length is ${E.length}, max length is ${MAX_LENGTH}`);E=E.trim();const y=(ae=E.match(FULL_REGEXP))==null?void 0:ae.groups;if(!y)throw new TypeError(`Cannot parse version: ${E}`);const R=parseNumber(y.major,`Cannot parse version ${E}: invalid major version`),k=parseNumber(y.minor,`Cannot parse version ${E}: invalid minor version`),H=parseNumber(y.patch,`Cannot parse version ${E}: invalid patch version`),B=y.prerelease?parsePrerelease(y.prerelease):[],te=y.buildmetadata?parseBuild(y.buildmetadata):[];return{major:R,minor:k,patch:H,prerelease:B,build:te}}const custom=(E,y={})=>{if(NODE_ENV==="test")return y;const R=Object.assign({}),k=`../custom/${E}.json`;return R[k]?R[k]:y},overrides=custom("features"),any=E=>E.some(Boolean),DITTO="Ditto",FIREFISH="Firefish",FRIENDICA="Friendica",ICESHRIMP="Iceshrimp",MASTODON="Mastodon",MITRA="Mitra",PIXELFED="Pixelfed",PLEROMA="Pleroma",TAKAHE="Takahe",TRUTHSOCIAL="TruthSocial",WILDEBEEST="Wildebeest",AKKOMA="akkoma",GLITCH="glitch",REBASED="soapbox",UNRELEASED="unreleased",getInstanceFeatures=E=>{var H;const y=parseVersion(E.version),{features:R,federation:k}=E.pleroma.metadata;return{accountAliases:y.software===PLEROMA,accountByUsername:y.software===PLEROMA,accountCreation:y.software!==TRUTHSOCIAL,accountEndorsements:y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.4.50")),accountLocation:any([y.software===PLEROMA&&y.build===REBASED&&greaterOrEqual(y.version,parse$1("2.4.50")),y.software===TRUTHSOCIAL]),accountLookup:any([y.software===FIREFISH,y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.4.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.4.50")),y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.6.1")),y.software===TRUTHSOCIAL,y.software===DITTO]),accountMoving:y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.4.50")),accountNotifies:any([y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.3.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.4.50")),y.software===TRUTHSOCIAL]),accountSubscriptions:y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("1.0.0")),accountWebsite:y.software===TRUTHSOCIAL||y.software===DITTO,adminAnnouncements:y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.2.49")),adminFE:y.software===PLEROMA,adminRules:y.software===PLEROMA&&y.build===REBASED&&greaterOrEqual(y.version,parse$1("2.4.51")),announcements:any([y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.1.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.2.49")),y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.7.0"))]),announcementsReactions:y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.1.0")),backups:y.software===PLEROMA,birthdays:y.software===PLEROMA&&y.build===REBASED&&greaterOrEqual(y.version,parse$1("2.4.50")),blockersVisible:R.includes("blockers_visible"),blocks:y.software!==DITTO,bookmarks:any([y.software===FIREFISH,y.software===ICESHRIMP,y.software===FRIENDICA,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.1.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("0.9.9")),y.software===PIXELFED,y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.9.0")),y.software===DITTO]),bots:any([y.software===MASTODON,y.software===PLEROMA]),chatAcceptance:y.software===TRUTHSOCIAL,chatEmojiReactions:y.software===TRUTHSOCIAL,chats:any([y.software===TRUTHSOCIAL,R.includes("pleroma_chat_messages")]),chatsDelete:any([y.software===TRUTHSOCIAL,y.build===REBASED]),chatsExpiration:y.software===TRUTHSOCIAL,chatsMedia:y.software!==TRUTHSOCIAL||y.build===UNRELEASED,chatsReadReceipts:y.software===TRUTHSOCIAL,chatsSearch:y.software===TRUTHSOCIAL,chatsV2:any([y.software===TRUTHSOCIAL,y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.3.0"))]),chatsWithFollowers:y.software===TRUTHSOCIAL,conversations:any([y.software===FIREFISH,y.software===ICESHRIMP,y.software===FRIENDICA,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("2.6.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("0.9.9")),y.software===PIXELFED,y.software===TAKAHE]),customEmojiReacts:any([R.includes("pleroma_custom_emoji_reactions"),R.includes("custom_emoji_reactions"),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.5.50"))]),directTimeline:any([y.software===FRIENDICA,y.software===MASTODON&&lessThan(y.compatVersion,parse$1("3.0.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("0.9.9"))]),dislikes:y.software===FRIENDICA&&greaterOrEqual(y.version,parse$1("2023.3.0")),domainBlocks:k.enabled&&any([y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("1.4.0")),y.software===PLEROMA]),domains:E.pleroma.metadata.multitenancy.enabled,editProfile:any([y.software===FIREFISH,y.software===FRIENDICA,y.software===ICESHRIMP,y.software===MASTODON,y.software===MITRA,y.software===PIXELFED,y.software===PLEROMA,y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.7.0")),y.software===TRUTHSOCIAL,y.software===WILDEBEEST]),editStatuses:any([y.software===FRIENDICA&&greaterOrEqual(y.version,parse$1("2022.12.0")),y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.version,parse$1("3.5.0")),y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.8.0")),R.includes("editing")]),emailList:R.includes("email_list"),embeds:any([y.software===MASTODON,y.software===TRUTHSOCIAL]),emojiReacts:any([y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.0.0")),R.includes("pleroma_emoji_reactions")]),emojiReactsMastodon:E.configuration.reactions.max_reactions>0,emojiReactsNonRGI:y.software===PLEROMA&&lessThan(y.version,parse$1("2.2.49")),events:R.includes("events"),explicitAddressing:any([y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("1.0.0")),y.software===TRUTHSOCIAL,y.software===DITTO]),exportData:!0,exposableReactions:any([y.software===FIREFISH,y.software===FRIENDICA,y.software===ICESHRIMP,y.software===MASTODON,y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.6.1")),y.software===TRUTHSOCIAL,R.includes("exposable_reactions")]),familiarFollowers:any([y.software===MASTODON&&greaterOrEqual(y.version,parse$1("3.5.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.5.51"))&&y.build===REBASED,y.software===TAKAHE,y.software===DITTO]),federating:k.enabled,filters:any([y.software===MASTODON&&lessThan(y.compatVersion,parse$1("3.6.0")),y.software===PLEROMA]),filtersExpiration:any([y.software===MASTODON,y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.3.0"))]),filtersV2:y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.6.0")),focalPoint:y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("2.3.0")),followHashtags:any([y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("4.0.0")),y.software===PLEROMA&&y.build===AKKOMA,y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.9.0"))]),followRequests:any([y.software===MASTODON,y.software===PLEROMA]),followedHashtagsList:y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("4.1.0")),frontendConfigurations:any([y.software===PLEROMA,y.software===DITTO]),groups:y.software===TRUTHSOCIAL,groupsAdminMax:y.software===TRUTHSOCIAL,groupsDiscovery:y.software===TRUTHSOCIAL,groupsKick:y.software!==TRUTHSOCIAL,groupsMuting:y.software===TRUTHSOCIAL,groupsPending:y.software===TRUTHSOCIAL,groupsPromoteToAdmin:y.software!==TRUTHSOCIAL,groupsSearch:y.software===TRUTHSOCIAL,groupsTags:y.software===TRUTHSOCIAL,groupsValidation:y.software===TRUTHSOCIAL,hideNetwork:y.software===PLEROMA,import:y.software===PLEROMA,importData:y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.2.0")),instanceV2:any([y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("4.0.0")),y.software===PLEROMA&&y.build===REBASED&&greaterOrEqual(y.version,parse$1("2.5.54")),y.software===DITTO]),lightning:y.software===DITTO,lists:any([y.software===FIREFISH,y.software===FRIENDICA,y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("2.1.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("0.9.9"))]),logInWithUsername:any([y.software===PLEROMA,y.software===TRUTHSOCIAL]),mastodonAdmin:any([y.software===DITTO,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("2.9.1")),y.software===PLEROMA&&y.build===REBASED&&greaterOrEqual(y.version,parse$1("2.4.50"))]),media:!0,mediaV2:any([y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.1.3")),y.software===WILDEBEEST]),muteStrangers:y.software===PLEROMA,mutesDuration:any([y.software===ICESHRIMP,y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.3.0")),y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.3.0")),y.software===TAKAHE]),nip05:y.software===DITTO,nostr:!!((H=E.nostr)!=null&&H.relay),nostrSign:y.software===DITTO,nostrSignup:y.software===DITTO,notes:any([y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.2.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.4.50"))]),notificationsIncludeTypes:any([y.software===DITTO,y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.5.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.4.50")),y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.6.2"))]),paginatedContext:y.software===TRUTHSOCIAL,pleromaRemoteFollow:y.software===PLEROMA,polls:any([y.software===FIREFISH,y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.version,parse$1("2.8.0")),y.software===PLEROMA,y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.8.0")),y.software===TRUTHSOCIAL]),privacyScopes:![TRUTHSOCIAL,DITTO].includes(y.software),profileDirectory:any([y.software===FRIENDICA,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.0.0")),R.includes("profile_directory")]),profileFields:any([y.software===MASTODON,y.software===PLEROMA,y.software===TAKAHE&&greaterOrEqual(y.version,parse$1("0.7.0")),y.software===DITTO]),publicTimeline:any([y.software===FIREFISH,y.software===FRIENDICA,y.software===ICESHRIMP,y.software===MASTODON,y.software===PLEROMA,y.software===TAKAHE,y.software===WILDEBEEST,y.software===DITTO]),publicTimelineLanguage:y.software===DITTO,quotePosts:any([y.software===FRIENDICA&&greaterOrEqual(y.version,parse$1("2023.3.0")),y.software===PLEROMA&&[REBASED,AKKOMA].includes(y.build)&&greaterOrEqual(y.version,parse$1("2.4.50")),R.includes("quote_posting"),"feature_quote"in E&&E.feature_quote===!0]),remoteInteractions:y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("2.4.50")),removeFromFollowers:any([y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.5.0")),y.software===PLEROMA&&y.build===REBASED&&greaterOrEqual(y.version,parse$1("2.4.50"))]),reportChats:y.software===TRUTHSOCIAL,reportMultipleStatuses:y.software!==TRUTHSOCIAL,resetPassword:y.software===PLEROMA,revokeName:y.software===DITTO,richText:any([y.software===MASTODON&&y.build===GLITCH,y.software===PLEROMA]),rssFeeds:any([y.software===MASTODON,y.software===PLEROMA]),scheduledStatuses:any([y.software===FRIENDICA,y.software===MASTODON&&greaterOrEqual(y.version,parse$1("2.7.0")),y.software===PLEROMA]),searchFromAccount:any([y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.version,parse$1("2.8.0")),y.software===PLEROMA&&greaterOrEqual(y.version,parse$1("1.0.0")),y.software===DITTO]),security:any([y.software===PLEROMA,y.software===TRUTHSOCIAL]),sessions:y.software===PLEROMA,settingsStore:any([y.software===PLEROMA,y.software===TRUTHSOCIAL]),spoilers:y.software!==TRUTHSOCIAL,streak:y.software===DITTO,suggestions:any([y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("2.4.3")),y.software===TRUTHSOCIAL,R.includes("v2_suggestions")]),suggestionsLocal:y.software===DITTO,suggestionsV2:any([y.software===FRIENDICA,y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.4.0")),y.software===TRUTHSOCIAL,R.includes("v2_suggestions")]),translations:R.includes("translation")||E.configuration.translation.enabled,trendingStatuses:any([y.software===ICESHRIMP,y.software===FRIENDICA&&greaterOrEqual(y.version,parse$1("2022.12.0")),y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.5.0")),y.software===DITTO]),trends:any([y.software===FRIENDICA&&greaterOrEqual(y.version,parse$1("2022.12.0")),y.software===ICESHRIMP,y.software===MASTODON&&greaterOrEqual(y.compatVersion,parse$1("3.0.0")),y.software===TRUTHSOCIAL,y.software===DITTO]),unrestrictedLists:y.software===PLEROMA}},getFeatures=createSelector([E=>E],E=>{const y=getInstanceFeatures(E);return Object.assign(y,overrides)}),parseVersion=E=>{var B;const R=/^([\w+.-]*)(?: \(compatible; ([\w]*) (.*)\))?$/.exec(E),k=R?parse$1(R[3]||R[1]):void 0,H=R?parse$1(R[1]):void 0;return R&&k&&H?{build:(B=k.build)==null?void 0:B[0],compatVersion:H,software:R[2]||MASTODON,version:k}:{compatVersion:parse$1("0.0.0"),version:parse$1("0.0.0")}};var purify$1={exports:{}};/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */var purify=purify$1.exports,hasRequiredPurify;function requirePurify(){return hasRequiredPurify||(hasRequiredPurify=1,function(E,y){(function(R,k){E.exports=k()})(purify,function(){const{entries:R,setPrototypeOf:k,isFrozen:H,getPrototypeOf:B,getOwnPropertyDescriptor:te}=Object;let{freeze:ae,seal:ce,create:Ce}=Object,{apply:Oe,construct:Le}=typeof Reflect<"u"&&Reflect;ae||(ae=function(Mt){return Mt}),ce||(ce=function(Mt){return Mt}),Oe||(Oe=function(Mt,qt,Vt){return Mt.apply(qt,Vt)}),Le||(Le=function(Mt,qt){return new Mt(...qt)});const Ne=tt(Array.prototype.forEach),Fe=tt(Array.prototype.pop),Ue=tt(Array.prototype.push),De=tt(String.prototype.toLowerCase),$e=tt(String.prototype.toString),Be=tt(String.prototype.match),Ve=tt(String.prototype.replace),Ke=tt(String.prototype.indexOf),st=tt(String.prototype.trim),We=tt(RegExp.prototype.test),at=ft(TypeError);function tt(Gt){return function(Mt){for(var qt=arguments.length,Vt=new Array(qt>1?qt-1:0),Tr=1;Tr2&&arguments[2]!==void 0?arguments[2]:De;k&&k(Gt,null);let Vt=Mt.length;for(;Vt--;){let Tr=Mt[Vt];if(typeof Tr=="string"){const sn=qt(Tr);sn!==Tr&&(H(Mt)||(Mt[Vt]=sn),Tr=sn)}Gt[Tr]=!0}return Gt}function ot(Gt){for(let Mt=0;Mt/gm),Lt=ce(/\${[\w\W]*}/gm),Ut=ce(/^data-[\-\w.\u00B7-\uFFFF]/),$t=ce(/^aria-[\-\w]+$/),zt=ce(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),er=ce(/^(?:\w+script|data):/i),Pn=ce(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rr=ce(/^html$/i);var nr=Object.freeze({__proto__:null,MUSTACHE_EXPR:gt,ERB_EXPR:vt,TMPLIT_EXPR:Lt,DATA_ATTR:Ut,ARIA_ATTR:$t,IS_ALLOWED_URI:zt,IS_SCRIPT_OR_DATA:er,ATTR_WHITESPACE:Pn,DOCTYPE_NAME:rr});const on=function(){return typeof window>"u"?null:window},Vo=function(Mt,qt){if(typeof Mt!="object"||typeof Mt.createPolicy!="function")return null;let Vt=null;const Tr="data-tt-policy-suffix";qt&&qt.hasAttribute(Tr)&&(Vt=qt.getAttribute(Tr));const sn="dompurify"+(Vt?"#"+Vt:"");try{return Mt.createPolicy(sn,{createHTML(Bn){return Bn},createScriptURL(Bn){return Bn}})}catch{return console.warn("TrustedTypes policy "+sn+" could not be created."),null}};function io(){let Gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:on();const Mt=Dt=>io(Dt);if(Mt.version="3.0.8",Mt.removed=[],!Gt||!Gt.document||Gt.document.nodeType!==9)return Mt.isSupported=!1,Mt;let{document:qt}=Gt;const Vt=qt,Tr=Vt.currentScript,{DocumentFragment:sn,HTMLTemplateElement:Bn,Node:vs,Element:Ai,NodeFilter:Go,NamedNodeMap:Cs=Gt.NamedNodeMap||Gt.MozNamedAttrMap,HTMLFormElement:ya,DOMParser:qo,trustedTypes:xn}=Gt,As=Ai.prototype,va=pt(As,"cloneNode"),Ca=pt(As,"nextSibling"),Nc=pt(As,"childNodes"),Qo=pt(As,"parentNode");if(typeof Bn=="function"){const Dt=qt.createElement("template");Dt.content&&Dt.content.ownerDocument&&(qt=Dt.content.ownerDocument)}let yr,jn="";const{implementation:Ko,createNodeIterator:Ri,createDocumentFragment:ao,getElementsByTagName:co}=qt,{importNode:Aa}=Vt;let Xr={};Mt.isSupported=typeof R=="function"&&typeof Qo=="function"&&Ko&&Ko.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Rs,ERB_EXPR:Is,TMPLIT_EXPR:Os,DATA_ATTR:Ii,ARIA_ATTR:Ra,IS_SCRIPT_OR_DATA:Zo,ATTR_WHITESPACE:Ps}=nr;let{IS_ALLOWED_URI:uo}=nr,Sr=null;const lo=Ye({},[...dt,...rt,...Qe,...Xe,...Ge]);let ur=null;const Wo=Ye({},[...je,...He,...Ze,...mt]);let or=Object.seal(Ce(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Xo=null,Oi=null,Ia=!0,_n=!0,Pi=!1,xi=!0,fo=!1,Ln=!1,xs=!1,Ls=!1,Vn=!1,ws=!1,bs=!1,ar=!0,Oa=!1;const Li="user-content-";let Ns=!0,wn=!1,ho={},Gn=null;const Yo=Ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Yr=null;const Pa=Ye({},["audio","video","img","source","image","track"]);let Fr=null;const xa=Ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Us="http://www.w3.org/1998/Math/MathML",Ms="http://www.w3.org/2000/svg",jr="http://www.w3.org/1999/xhtml";let En=jr,qn=!1,po=null;const Uc=Ye({},[Us,Ms,jr],$e);let Jo=null;const wi=["application/xhtml+xml","text/html"],La="text/html";let hr=null,an=null;const Mc=qt.createElement("form"),Fs=function(lt){return lt instanceof RegExp||lt instanceof Function},Kt=function(){let lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(an&&an===lt)){if((!lt||typeof lt!="object")&&(lt={}),lt=nt(lt),Jo=wi.indexOf(lt.PARSER_MEDIA_TYPE)===-1?La:lt.PARSER_MEDIA_TYPE,hr=Jo==="application/xhtml+xml"?$e:De,Sr="ALLOWED_TAGS"in lt?Ye({},lt.ALLOWED_TAGS,hr):lo,ur="ALLOWED_ATTR"in lt?Ye({},lt.ALLOWED_ATTR,hr):Wo,po="ALLOWED_NAMESPACES"in lt?Ye({},lt.ALLOWED_NAMESPACES,$e):Uc,Fr="ADD_URI_SAFE_ATTR"in lt?Ye(nt(xa),lt.ADD_URI_SAFE_ATTR,hr):xa,Yr="ADD_DATA_URI_TAGS"in lt?Ye(nt(Pa),lt.ADD_DATA_URI_TAGS,hr):Pa,Gn="FORBID_CONTENTS"in lt?Ye({},lt.FORBID_CONTENTS,hr):Yo,Xo="FORBID_TAGS"in lt?Ye({},lt.FORBID_TAGS,hr):{},Oi="FORBID_ATTR"in lt?Ye({},lt.FORBID_ATTR,hr):{},ho="USE_PROFILES"in lt?lt.USE_PROFILES:!1,Ia=lt.ALLOW_ARIA_ATTR!==!1,_n=lt.ALLOW_DATA_ATTR!==!1,Pi=lt.ALLOW_UNKNOWN_PROTOCOLS||!1,xi=lt.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fo=lt.SAFE_FOR_TEMPLATES||!1,Ln=lt.WHOLE_DOCUMENT||!1,Vn=lt.RETURN_DOM||!1,ws=lt.RETURN_DOM_FRAGMENT||!1,bs=lt.RETURN_TRUSTED_TYPE||!1,Ls=lt.FORCE_BODY||!1,ar=lt.SANITIZE_DOM!==!1,Oa=lt.SANITIZE_NAMED_PROPS||!1,Ns=lt.KEEP_CONTENT!==!1,wn=lt.IN_PLACE||!1,uo=lt.ALLOWED_URI_REGEXP||zt,En=lt.NAMESPACE||jr,or=lt.CUSTOM_ELEMENT_HANDLING||{},lt.CUSTOM_ELEMENT_HANDLING&&Fs(lt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(or.tagNameCheck=lt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),lt.CUSTOM_ELEMENT_HANDLING&&Fs(lt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(or.attributeNameCheck=lt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),lt.CUSTOM_ELEMENT_HANDLING&&typeof lt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(or.allowCustomizedBuiltInElements=lt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),fo&&(_n=!1),ws&&(Vn=!0),ho&&(Sr=Ye({},Ge),ur=[],ho.html===!0&&(Ye(Sr,dt),Ye(ur,je)),ho.svg===!0&&(Ye(Sr,rt),Ye(ur,He),Ye(ur,mt)),ho.svgFilters===!0&&(Ye(Sr,Qe),Ye(ur,He),Ye(ur,mt)),ho.mathMl===!0&&(Ye(Sr,Xe),Ye(ur,Ze),Ye(ur,mt))),lt.ADD_TAGS&&(Sr===lo&&(Sr=nt(Sr)),Ye(Sr,lt.ADD_TAGS,hr)),lt.ADD_ATTR&&(ur===Wo&&(ur=nt(ur)),Ye(ur,lt.ADD_ATTR,hr)),lt.ADD_URI_SAFE_ATTR&&Ye(Fr,lt.ADD_URI_SAFE_ATTR,hr),lt.FORBID_CONTENTS&&(Gn===Yo&&(Gn=nt(Gn)),Ye(Gn,lt.FORBID_CONTENTS,hr)),Ns&&(Sr["#text"]=!0),Ln&&Ye(Sr,["html","head","body"]),Sr.table&&(Ye(Sr,["tbody"]),delete Xo.tbody),lt.TRUSTED_TYPES_POLICY){if(typeof lt.TRUSTED_TYPES_POLICY.createHTML!="function")throw at('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof lt.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw at('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');yr=lt.TRUSTED_TYPES_POLICY,jn=yr.createHTML("")}else yr===void 0&&(yr=Vo(xn,Tr)),yr!==null&&typeof jn=="string"&&(jn=yr.createHTML(""));ae&&ae(lt),an=lt}},bi=Ye({},["mi","mo","mn","ms","mtext"]),Ni=Ye({},["foreignobject","desc","title","annotation-xml"]),Ui=Ye({},["title","style","font","a","script"]),Mi=Ye({},[...rt,...Qe,...ke]),Fi=Ye({},[...Xe,...qe]),wa=function(lt){let At=Qo(lt);(!At||!At.tagName)&&(At={namespaceURI:En,tagName:"template"});const bt=De(lt.tagName),Wt=De(At.tagName);return po[lt.namespaceURI]?lt.namespaceURI===Ms?At.namespaceURI===jr?bt==="svg":At.namespaceURI===Us?bt==="svg"&&(Wt==="annotation-xml"||bi[Wt]):!!Mi[bt]:lt.namespaceURI===Us?At.namespaceURI===jr?bt==="math":At.namespaceURI===Ms?bt==="math"&&Ni[Wt]:!!Fi[bt]:lt.namespaceURI===jr?At.namespaceURI===Ms&&!Ni[Wt]||At.namespaceURI===Us&&!bi[Wt]?!1:!Fi[bt]&&(Ui[bt]||!Mi[bt]):!!(Jo==="application/xhtml+xml"&&po[lt.namespaceURI]):!1},mn=function(lt){Ue(Mt.removed,{element:lt});try{lt.parentNode.removeChild(lt)}catch{lt.remove()}},_o=function(lt,At){try{Ue(Mt.removed,{attribute:At.getAttributeNode(lt),from:At})}catch{Ue(Mt.removed,{attribute:null,from:At})}if(At.removeAttribute(lt),lt==="is"&&!ur[lt])if(Vn||ws)try{mn(At)}catch{}else try{At.setAttribute(lt,"")}catch{}},Sn=function(lt){let At=null,bt=null;if(Ls)lt=""+lt;else{const lr=Be(lt,/^[\r\n\t ]+/);bt=lr&&lr[0]}Jo==="application/xhtml+xml"&&En===jr&&(lt=''+lt+"");const Wt=yr?yr.createHTML(lt):lt;if(En===jr)try{At=new qo().parseFromString(Wt,Jo)}catch{}if(!At||!At.documentElement){At=Ko.createDocument(En,"template",null);try{At.documentElement.innerHTML=qn?jn:Wt}catch{}}const pr=At.body||At.documentElement;return lt&&bt&&pr.insertBefore(qt.createTextNode(bt),pr.childNodes[0]||null),En===jr?co.call(At,Ln?"html":"body")[0]:Ln?At.documentElement:pr},gn=function(lt){return Ri.call(lt.ownerDocument||lt,lt,Go.SHOW_ELEMENT|Go.SHOW_COMMENT|Go.SHOW_TEXT,null)},bn=function(lt){return lt instanceof ya&&(typeof lt.nodeName!="string"||typeof lt.textContent!="string"||typeof lt.removeChild!="function"||!(lt.attributes instanceof Cs)||typeof lt.removeAttribute!="function"||typeof lt.setAttribute!="function"||typeof lt.namespaceURI!="string"||typeof lt.insertBefore!="function"||typeof lt.hasChildNodes!="function")},Eo=function(lt){return typeof vs=="function"&< instanceof vs},Dr=function(lt,At,bt){Xr[lt]&&Ne(Xr[lt],Wt=>{Wt.call(Mt,At,bt,an)})},Tn=function(lt){let At=null;if(Dr("beforeSanitizeElements",lt,null),bn(lt))return mn(lt),!0;const bt=hr(lt.nodeName);if(Dr("uponSanitizeElement",lt,{tagName:bt,allowedTags:Sr}),lt.hasChildNodes()&&!Eo(lt.firstElementChild)&&We(/<[/\w]/g,lt.innerHTML)&&We(/<[/\w]/g,lt.textContent))return mn(lt),!0;if(!Sr[bt]||Xo[bt]){if(!Xo[bt]&&Di(bt)&&(or.tagNameCheck instanceof RegExp&&We(or.tagNameCheck,bt)||or.tagNameCheck instanceof Function&&or.tagNameCheck(bt)))return!1;if(Ns&&!Gn[bt]){const Wt=Qo(lt)||lt.parentNode,pr=Nc(lt)||lt.childNodes;if(pr&&Wt){const lr=pr.length;for(let vr=lr-1;vr>=0;--vr)Wt.insertBefore(va(pr[vr],!0),Ca(lt))}}return mn(lt),!0}return lt instanceof Ai&&!wa(lt)||(bt==="noscript"||bt==="noembed"||bt==="noframes")&&We(/<\/no(script|embed|frames)/i,lt.innerHTML)?(mn(lt),!0):(fo&<.nodeType===3&&(At=lt.textContent,Ne([Rs,Is,Os],Wt=>{At=Ve(At,Wt," ")}),lt.textContent!==At&&(Ue(Mt.removed,{element:lt.cloneNode()}),lt.textContent=At)),Dr("afterSanitizeElements",lt,null),!1)},ba=function(lt,At,bt){if(ar&&(At==="id"||At==="name")&&(bt in qt||bt in Mc))return!1;if(!(_n&&!Oi[At]&&We(Ii,At))){if(!(Ia&&We(Ra,At))){if(!ur[At]||Oi[At]){if(!(Di(lt)&&(or.tagNameCheck instanceof RegExp&&We(or.tagNameCheck,lt)||or.tagNameCheck instanceof Function&&or.tagNameCheck(lt))&&(or.attributeNameCheck instanceof RegExp&&We(or.attributeNameCheck,At)||or.attributeNameCheck instanceof Function&&or.attributeNameCheck(At))||At==="is"&&or.allowCustomizedBuiltInElements&&(or.tagNameCheck instanceof RegExp&&We(or.tagNameCheck,bt)||or.tagNameCheck instanceof Function&&or.tagNameCheck(bt))))return!1}else if(!Fr[At]){if(!We(uo,Ve(bt,Ps,""))){if(!((At==="src"||At==="xlink:href"||At==="href")&<!=="script"&&Ke(bt,"data:")===0&&Yr[lt])){if(!(Pi&&!We(Zo,Ve(bt,Ps,"")))){if(bt)return!1}}}}}}return!0},Di=function(lt){return lt.indexOf("-")>0},mo=function(lt){Dr("beforeSanitizeAttributes",lt,null);const{attributes:At}=lt;if(!At)return;const bt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ur};let Wt=At.length;for(;Wt--;){const pr=At[Wt],{name:lr,namespaceURI:vr,value:Qn}=pr,es=hr(lr);let Rr=lr==="value"?Qn:st(Qn);if(bt.attrName=es,bt.attrValue=Rr,bt.keepAttr=!0,bt.forceKeepAttr=void 0,Dr("uponSanitizeAttribute",lt,bt),Rr=bt.attrValue,bt.forceKeepAttr||(_o(lr,lt),!bt.keepAttr))continue;if(!xi&&We(/\/>/i,Rr)){_o(lr,lt);continue}fo&&Ne([Rs,Is,Os],Ds=>{Rr=Ve(Rr,Ds," ")});const ts=hr(lt.nodeName);if(ba(ts,es,Rr)){if(Oa&&(es==="id"||es==="name")&&(_o(lr,lt),Rr=Li+Rr),yr&&typeof xn=="object"&&typeof xn.getAttributeType=="function"&&!vr)switch(xn.getAttributeType(ts,es)){case"TrustedHTML":{Rr=yr.createHTML(Rr);break}case"TrustedScriptURL":{Rr=yr.createScriptURL(Rr);break}}try{vr?lt.setAttributeNS(vr,lr,Rr):lt.setAttribute(lr,Rr),Fe(Mt.removed)}catch{}}}Dr("afterSanitizeAttributes",lt,null)},Fc=function Dt(lt){let At=null;const bt=gn(lt);for(Dr("beforeSanitizeShadowDOM",lt,null);At=bt.nextNode();)Dr("uponSanitizeShadowNode",At,null),!Tn(At)&&(At.content instanceof sn&&Dt(At.content),mo(At));Dr("afterSanitizeShadowDOM",lt,null)};return Mt.sanitize=function(Dt){let lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},At=null,bt=null,Wt=null,pr=null;if(qn=!Dt,qn&&(Dt=""),typeof Dt!="string"&&!Eo(Dt))if(typeof Dt.toString=="function"){if(Dt=Dt.toString(),typeof Dt!="string")throw at("dirty is not a string, aborting")}else throw at("toString is not a function");if(!Mt.isSupported)return Dt;if(xs||Kt(lt),Mt.removed=[],typeof Dt=="string"&&(wn=!1),wn){if(Dt.nodeName){const Qn=hr(Dt.nodeName);if(!Sr[Qn]||Xo[Qn])throw at("root node is forbidden and cannot be sanitized in-place")}}else if(Dt instanceof vs)At=Sn(""),bt=At.ownerDocument.importNode(Dt,!0),bt.nodeType===1&&bt.nodeName==="BODY"||bt.nodeName==="HTML"?At=bt:At.appendChild(bt);else{if(!Vn&&!fo&&!Ln&&Dt.indexOf("<")===-1)return yr&&bs?yr.createHTML(Dt):Dt;if(At=Sn(Dt),!At)return Vn?null:bs?jn:""}At&&Ls&&mn(At.firstChild);const lr=gn(wn?Dt:At);for(;Wt=lr.nextNode();)Tn(Wt)||(Wt.content instanceof sn&&Fc(Wt.content),mo(Wt));if(wn)return Dt;if(Vn){if(ws)for(pr=ao.call(At.ownerDocument);At.firstChild;)pr.appendChild(At.firstChild);else pr=At;return(ur.shadowroot||ur.shadowrootmode)&&(pr=Aa.call(Vt,pr,!0)),pr}let vr=Ln?At.outerHTML:At.innerHTML;return Ln&&Sr["!doctype"]&&At.ownerDocument&&At.ownerDocument.doctype&&At.ownerDocument.doctype.name&&We(rr,At.ownerDocument.doctype.name)&&(vr=" `+vr),fo&&Ne([Rs,Is,Os],Qn=>{vr=Ve(vr,Qn," ")}),yr&&bs?yr.createHTML(vr):vr},Mt.setConfig=function(){let Dt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kt(Dt),xs=!0},Mt.clearConfig=function(){an=null,xs=!1},Mt.isValidAttribute=function(Dt,lt,At){an||Kt({});const bt=hr(Dt),Wt=hr(lt);return ba(bt,Wt,At)},Mt.addHook=function(Dt,lt){typeof lt=="function"&&(Xr[Dt]=Xr[Dt]||[],Ue(Xr[Dt],lt))},Mt.removeHook=function(Dt){if(Xr[Dt])return Fe(Xr[Dt])},Mt.removeHooks=function(Dt){Xr[Dt]&&(Xr[Dt]=[])},Mt.removeAllHooks=function(){Xr={}},Mt}var Ci=io();return Ci})}(purify$1)),purify$1.exports}var browser,hasRequiredBrowser;function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,browser=window.DOMPurify||(window.DOMPurify=requirePurify().default||requirePurify())),browser}var browserExports=requireBrowser();const DOMPurify=getDefaultExportFromCjs(browserExports),avatarMissing="/packs/assets/avatar-missing-C_HJ4lmt.png",headerMissing="/packs/assets/header-missing-DMXFxGbr.png",customEmojiSchema=z$1.object({category:z$1.string().catch(""),shortcode:z$1.string(),static_url:z$1.string().catch(""),url:z$1.string(),visible_in_picker:z$1.boolean().catch(!0)}),contentSchema=z$1.string().catch("").transform(E=>E==="

"?"":E),dateSchema=z$1.string().datetime().catch(new Date().toUTCString());function filteredArray(E){return z$1.any().array().catch([]).transform(y=>y.map(R=>{const k=E.safeParse(R);return k.success?k.data:void 0}).filter(R=>!!R))}const emojiSchema=z$1.string().refine(E=>new RegExp("\\p{Extended_Pictographic}|[\\u{1F1E6}-\\u{1F1FF}]{2}","u").test(E));function jsonSchema(E){return z$1.string().transform((y,R)=>{try{return JSON.parse(y,E)}catch{return R.addIssue({code:z$1.ZodIssueCode.custom,message:"Invalid JSON"}),z$1.NEVER}})}const mimeSchema=z$1.string().regex(/^\w+\/[-+.\w]+$/);function coerceObject(E){return z$1.object({}).passthrough().catch({}).pipe(z$1.object(E))}z$1.string().regex(/^#([a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})$/i);const birthdaySchema=z$1.string().regex(/^\d{4}-\d{2}-\d{2}$/),hexSchema=z$1.string().regex(/^#[a-f0-9]{6}$/i),fieldSchema=z$1.object({name:z$1.string(),value:z$1.string(),verified_at:z$1.string().datetime().nullable().catch(null)}),roleSchema=z$1.object({id:z$1.string().catch(""),name:z$1.string().catch(""),color:hexSchema.catch(""),highlighted:z$1.boolean().catch(!0)}),baseAccountSchema=z$1.object({acct:z$1.string().catch(""),avatar:z$1.string().catch(avatarMissing),avatar_static:z$1.string().url().optional().catch(void 0),bot:z$1.boolean().catch(!1),created_at:z$1.string().datetime().catch(new Date().toUTCString()),discoverable:z$1.boolean().catch(!1),display_name:z$1.string().catch(""),ditto:coerceObject({accepts_zaps:z$1.boolean().catch(!1),accepts_zaps_cashu:z$1.boolean().catch(!1),external_url:z$1.string().optional().catch(void 0),streak:coerceObject({days:z$1.number().catch(0),start:z$1.string().datetime().nullable().catch(null),end:z$1.string().datetime().nullable().catch(null)})}),domain:z$1.string().optional().catch(void 0),emojis:filteredArray(customEmojiSchema),fields:filteredArray(fieldSchema),followers_count:z$1.number().catch(0),following_count:z$1.number().catch(0),fqn:z$1.string().optional().catch(void 0),header:z$1.string().url().catch(headerMissing),header_static:z$1.string().url().optional().catch(void 0),id:z$1.string(),last_status_at:z$1.string().datetime().optional().catch(void 0),local:z$1.boolean().catch(!1),location:z$1.string().optional().catch(void 0),locked:z$1.boolean().catch(!1),moved:z$1.literal(null).catch(null),mute_expires_at:z$1.union([z$1.string(),z$1.null()]).catch(null),nostr:coerceObject({pubkey:NSchema.id().optional().catch(void 0),lud16:z$1.string().email().optional().catch(void 0)}),note:contentSchema,other_settings:z$1.object({birthday:birthdaySchema.nullish().catch(void 0),location:z$1.string().optional().catch(void 0)}).optional().catch(void 0),pleroma:coerceObject({accepts_chat_messages:z$1.boolean().catch(!1),accepts_email_list:z$1.boolean().catch(!1),also_known_as:z$1.array(z$1.string().url()).catch([]),ap_id:z$1.string().url().optional().catch(void 0),birthday:birthdaySchema.nullish().catch(void 0),deactivated:z$1.boolean().catch(!1),favicon:z$1.string().url().optional().catch(void 0),hide_favorites:z$1.boolean().catch(!1),hide_followers:z$1.boolean().catch(!1),hide_followers_count:z$1.boolean().catch(!1),hide_follows:z$1.boolean().catch(!1),hide_follows_count:z$1.boolean().catch(!1),is_admin:z$1.boolean().catch(!1),is_local:z$1.boolean().optional().catch(void 0),is_moderator:z$1.boolean().catch(!1),is_suggested:z$1.boolean().catch(!1),location:z$1.string().optional().catch(void 0),notification_settings:coerceObject({block_from_strangers:z$1.boolean().catch(!1)}),tags:z$1.array(z$1.string()).catch([])}),roles:filteredArray(roleSchema),source:z$1.object({approved:z$1.boolean().catch(!0),chats_onboarded:z$1.boolean().catch(!0),fields:filteredArray(fieldSchema),note:z$1.string().catch(""),pleroma:z$1.object({discoverable:z$1.boolean().catch(!0)}).optional().catch(void 0),sms_verified:z$1.boolean().catch(!1),nostr:z$1.object({nip05:z$1.string().optional().catch(void 0)}).optional().catch(void 0),ditto:coerceObject({captcha_solved:z$1.boolean().catch(!0)})}).optional().catch(void 0),statuses_count:z$1.number().catch(0),suspended:z$1.boolean().catch(!1),uri:z$1.string().url().catch(""),url:z$1.string().url(),username:z$1.string().catch(""),verified:z$1.boolean().catch(!1),website:z$1.string().catch("")}),getDomain$1=E=>{try{return new URL(E).host}catch{return""}},filterBadges$1=E=>E==null?void 0:E.filter(y=>y.startsWith("badge:")).map(y=>roleSchema.parse({id:y,name:y.replace(/^badge:/,"")})),transformAccount=({pleroma:E,other_settings:y,...R})=>{var B,te;const k=R.display_name.trim().length===0?R.username:R.display_name,H=R.domain??getDomain$1(R.url||R.uri);return E&&(E.birthday=E.birthday||(y==null?void 0:y.birthday)),{...R,admin:(E==null?void 0:E.is_admin)||!1,avatar_static:R.avatar_static||R.avatar,discoverable:R.discoverable||((te=(B=R.source)==null?void 0:B.pleroma)==null?void 0:te.discoverable)||!1,display_name:k,domain:H,fqn:R.fqn||(R.acct.includes("@")?R.acct:`${R.acct}@${H}`),header_static:R.header_static||R.header,moderator:(E==null?void 0:E.is_moderator)||!1,local:(E==null?void 0:E.is_local)!==void 0?E.is_local:R.acct.split("@")[1]===void 0,location:R.location||(E==null?void 0:E.location)||(y==null?void 0:y.location)||"",note:DOMPurify.sanitize(R.note,{USE_PROFILES:{html:!0}}),pleroma:E,roles:R.roles.length?R.roles:filterBadges$1(E==null?void 0:E.tags),staff:(E==null?void 0:E.is_admin)||(E==null?void 0:E.is_moderator)||!1,suspended:R.suspended||(E==null?void 0:E.deactivated)||!1,verified:R.verified||(E==null?void 0:E.tags.includes("verified"))||!1}},accountSchema=baseAccountSchema.extend({moved:baseAccountSchema.transform(transformAccount).nullable().catch(null)}).transform(transformAccount),announcementReactionSchema=z$1.object({name:z$1.string().catch(""),count:z$1.number().int().nonnegative().catch(0),me:z$1.boolean().catch(!1),url:z$1.string().nullable().catch(null),static_url:z$1.string().nullable().catch(null),announcement_id:z$1.string().catch("")}),mentionSchema=z$1.object({acct:z$1.string(),id:z$1.string(),url:z$1.string().url().catch(""),username:z$1.string().catch("")}).transform(E=>(E.username||(E.username=E.acct.split("@")[0]),E)),historySchema=z$1.object({accounts:z$1.coerce.number(),uses:z$1.coerce.number()}),tagSchema=z$1.object({name:z$1.string().min(1),url:z$1.string().url().catch(""),history:z$1.array(historySchema).nullable().catch(null),following:z$1.boolean().catch(!1)}),announcementSchema=z$1.object({id:z$1.string(),content:z$1.string().catch(""),starts_at:z$1.string().datetime().nullable().catch(null),ends_at:z$1.string().datetime().nullable().catch(null),all_day:z$1.boolean().catch(!1),read:z$1.boolean().catch(!1),published_at:dateSchema,reactions:filteredArray(announcementReactionSchema),statuses:z$1.preprocess(E=>Array.isArray(E)?Object.fromEntries(E.map(y=>{var R;return[y.url,(R=y.account)==null?void 0:R.acct]})||[]):E,z$1.record(z$1.string(),z$1.string())),mentions:filteredArray(mentionSchema),tags:filteredArray(tagSchema),emojis:filteredArray(customEmojiSchema),updated_at:dateSchema}),adminAnnouncementSchema=announcementSchema.extend({pleroma:z$1.object({raw_content:z$1.string().catch("")})});var q=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],x=E=>{let y=0;for(let R=0;R{let y=E/255;return y<=.04045?y/12.92:Math.pow((y+.055)/1.055,2.4)},h$2=E=>{let y=Math.max(0,Math.min(1,E));return y<=.0031308?Math.trunc(y*12.92*255+.5):Math.trunc((1.055*Math.pow(y,.4166666666666667)-.055)*255+.5)},F$1=E=>E<0?-1:1,M$1=(E,y)=>F$1(E)*Math.pow(Math.abs(E),y),d$1=class extends Error{constructor(y){super(y),this.name="ValidationError",this.message=y}},C=E=>{if(!E||E.length<6)throw new d$1("The blurhash string must be at least 6 characters");let y=x(E[0]),R=Math.floor(y/9)+1,k=y%9+1;if(E.length!==4+2*k*R)throw new d$1(`blurhash length mismatch: length is ${E.length} but it should be ${4+2*k*R}`)},N=E=>{try{C(E)}catch(y){return{result:!1,errorReason:y.message}}return{result:!0}},z=E=>{let y=E>>16,R=E>>8&255,k=E&255;return[f$1(y),f$1(R),f$1(k)]},L=(E,y)=>{let R=Math.floor(E/361),k=Math.floor(E/19)%19,H=E%19;return[M$1((R-9)/9,2)*y,M$1((k-9)/9,2)*y,M$1((H-9)/9,2)*y]},U$1=(E,y,R,k)=>{C(E),k=k|1;let H=x(E[0]),B=Math.floor(H/9)+1,te=H%9+1,ae=(x(E[1])+1)/166,ce=new Array(te*B);for(let Le=0;Le{const R=N(E);R.result||y.addIssue({code:z$1.ZodIssueCode.custom,message:R.errorReason})}),baseAttachmentSchema=z$1.object({blurhash:blurhashSchema.nullable().catch(null),description:z$1.string().catch(""),id:z$1.string(),pleroma:z$1.object({mime_type:mimeSchema}).optional().catch(void 0),preview_url:z$1.string().url().catch(""),remote_url:z$1.string().url().nullable().catch(null),type:z$1.string(),url:z$1.string().url()}),imageMetaSchema=z$1.object({width:z$1.number(),height:z$1.number(),aspect:z$1.number().optional().catch(void 0)}).transform(E=>({...E,aspect:typeof E.aspect=="number"?E.aspect:E.width/E.height})),imageAttachmentSchema=baseAttachmentSchema.extend({type:z$1.literal("image"),meta:z$1.object({original:imageMetaSchema.optional().catch(void 0)}).catch({})}),videoAttachmentSchema=baseAttachmentSchema.extend({type:z$1.literal("video"),meta:z$1.object({duration:z$1.number().optional().catch(void 0),original:imageMetaSchema.optional().catch(void 0)}).catch({})}),gifvAttachmentSchema=baseAttachmentSchema.extend({type:z$1.literal("gifv"),meta:z$1.object({duration:z$1.number().optional().catch(void 0),original:imageMetaSchema.optional().catch(void 0)}).catch({})}),audioAttachmentSchema=baseAttachmentSchema.extend({type:z$1.literal("audio"),meta:z$1.object({duration:z$1.number().optional().catch(void 0),colors:z$1.object({background:z$1.string().optional().catch(void 0),foreground:z$1.string().optional().catch(void 0),accent:z$1.string().optional().catch(void 0),duration:z$1.number().optional().catch(void 0)}).optional().catch(void 0)}).catch({})}),unknownAttachmentSchema=baseAttachmentSchema.extend({type:z$1.literal("unknown")}),attachmentSchema=z$1.discriminatedUnion("type",[imageAttachmentSchema,videoAttachmentSchema,gifvAttachmentSchema,audioAttachmentSchema,unknownAttachmentSchema]).transform(E=>(E.preview_url||(E.preview_url=E.url),E)),maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexPunycode=/^xn--/,regexNonASCII=/[^\0-\x7F]/,regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;function error$1(E){throw new RangeError(errors[E])}function map(E,y){const R=[];let k=E.length;for(;k--;)R[k]=y(E[k]);return R}function mapDomain(E,y){const R=E.split("@");let k="";R.length>1&&(k=R[0]+"@",E=R[1]),E=E.replace(regexSeparators,".");const H=E.split("."),B=map(H,y).join(".");return k+B}function ucs2decode(E){const y=[];let R=0;const k=E.length;for(;R=55296&&H<=56319&&RString.fromCodePoint(...E),basicToDigit=function(E){return E>=48&&E<58?26+(E-48):E>=65&&E<91?E-65:E>=97&&E<123?E-97:base},digitToBasic=function(E,y){return E+22+75*(E<26)-((y!=0)<<5)},adapt=function(E,y,R){let k=0;for(E=R?floor(E/damp):E>>1,E+=floor(E/y);E>baseMinusTMin*tMax>>1;k+=base)E=floor(E/baseMinusTMin);return floor(k+(baseMinusTMin+1)*E/(E+skew))},decode=function(E){const y=[],R=E.length;let k=0,H=initialN,B=initialBias,te=E.lastIndexOf(delimiter);te<0&&(te=0);for(let ae=0;ae=128&&error$1("not-basic"),y.push(E.charCodeAt(ae));for(let ae=te>0?te+1:0;ae=R&&error$1("invalid-input");const Ne=basicToDigit(E.charCodeAt(ae++));Ne>=base&&error$1("invalid-input"),Ne>floor((maxInt-k)/Oe)&&error$1("overflow"),k+=Ne*Oe;const Fe=Le<=B?tMin:Le>=B+tMax?tMax:Le-B;if(Nefloor(maxInt/Ue)&&error$1("overflow"),Oe*=Ue}const Ce=y.length+1;B=adapt(k-ce,Ce,ce==0),floor(k/Ce)>maxInt-H&&error$1("overflow"),H+=floor(k/Ce),k%=Ce,y.splice(k++,0,H)}return String.fromCodePoint(...y)},encode$1=function(E){const y=[];E=ucs2decode(E);const R=E.length;let k=initialN,H=0,B=initialBias;for(const ce of E)ce<128&&y.push(stringFromCharCode(ce));const te=y.length;let ae=te;for(te&&y.push(delimiter);ae=k&&Oefloor((maxInt-H)/Ce)&&error$1("overflow"),H+=(ce-k)*Ce,k=ce;for(const Oe of E)if(OemaxInt&&error$1("overflow"),Oe===k){let Le=H;for(let Ne=base;;Ne+=base){const Fe=Ne<=B?tMin:Ne>=B+tMax?tMax:Ne-B;if(Le(E.OWNER="owner",E.ADMIN="admin",E.USER="user",E))(GroupRoles||{});const groupMemberSchema=z$1.object({id:z$1.string(),account:accountSchema,role:z$1.nativeEnum(GroupRoles)}),groupRelationshipSchema=z$1.object({blocked_by:z$1.boolean().catch(!1),id:z$1.string(),member:z$1.boolean().catch(!1),muting:z$1.boolean().nullable().catch(!1),notifying:z$1.boolean().nullable().catch(null),pending_requests:z$1.boolean().catch(!1),requested:z$1.boolean().catch(!1),role:z$1.nativeEnum(GroupRoles).catch(GroupRoles.USER)}),groupTagSchema=z$1.object({id:z$1.string(),name:z$1.string(),groups:z$1.number().optional(),url:z$1.string().optional(),uses:z$1.number().optional(),pinned:z$1.boolean().optional().catch(!1),visible:z$1.boolean().optional().default(!0)}),groupSchema=z$1.object({avatar:z$1.string().catch(avatarMissing),avatar_static:z$1.string().catch(""),created_at:z$1.string().datetime().catch(new Date().toUTCString()),deleted_at:z$1.string().datetime().or(z$1.null()).catch(null),display_name:z$1.string().catch(""),domain:z$1.string().catch(""),emojis:filteredArray(customEmojiSchema),group_visibility:z$1.string().catch(""),header:z$1.string().catch(headerMissing),header_static:z$1.string().catch(""),id:z$1.coerce.string(),locked:z$1.boolean().catch(!1),membership_required:z$1.boolean().catch(!1),members_count:z$1.number().catch(0),owner:z$1.object({id:z$1.string()}),note:z$1.string().transform(E=>E==="

"?"":E).catch(""),relationship:groupRelationshipSchema.nullable().catch(null),slug:z$1.string().catch(""),source:z$1.object({note:z$1.string()}).optional(),statuses_visibility:z$1.string().catch("public"),tags:z$1.array(groupTagSchema).catch([]),uri:z$1.string().catch(""),url:z$1.string().catch("")}).transform(E=>(E.avatar_static=E.avatar_static||E.avatar,E.header_static=E.header_static||E.header,E.locked=E.locked||E.group_visibility==="members_only",{...E,note:DOMPurify.sanitize(E.note,{USE_PROFILES:{html:!0}})})),IDNA_PREFIX="xn--",cardSchema=z$1.object({author_name:z$1.string().catch(""),author_url:z$1.string().url().catch(""),blurhash:z$1.string().nullable().catch(null),description:z$1.string().catch(""),embed_url:z$1.string().url().catch(""),group:groupSchema.nullable().catch(null),height:z$1.number().catch(0),html:z$1.string().catch(""),image:z$1.string().nullable().catch(null),pleroma:z$1.object({opengraph:z$1.object({width:z$1.number(),height:z$1.number(),html:z$1.string(),thumbnail_url:z$1.string().url()}).optional().catch(void 0)}).optional().catch(void 0),provider_name:z$1.string().catch(""),provider_url:z$1.string().url().catch(""),title:z$1.string().catch(""),type:z$1.enum(["link","photo","video","rich"]).catch("link"),url:z$1.string().url(),width:z$1.number().catch(0)}).transform(({pleroma:E,...y})=>{y.provider_name||(y.provider_name=decodeIDNA(new URL(y.url).hostname)),E!=null&&E.opengraph&&(!y.width&&!y.height&&(y.width=E.opengraph.width,y.height=E.opengraph.height),y.html||(y.html=E.opengraph.html),y.image||(y.image=E.opengraph.thumbnail_url));const R=DOMPurify.sanitize(y.html,{ALLOWED_TAGS:["iframe"],ALLOWED_ATTR:["src","width","height","frameborder","allowfullscreen"],RETURN_DOM:!0});return R.querySelectorAll("iframe").forEach(k=>{try{const H=new URL(k.src);if(H.protocol!=="https:")throw new Error("iframe must be https");if(H.origin===location.origin)throw new Error("iframe must not be same origin");k.setAttribute("sandbox","allow-scripts allow-same-origin allow-presentation")}catch{k.remove()}}),y.html=R.innerHTML,y.html||(y.type="link"),y}),decodeIDNA=E=>E.split(".").map(y=>y.indexOf(IDNA_PREFIX)===0?punycode.decode(y.slice(IDNA_PREFIX.length)):y).join("."),chatMessageSchema=z$1.object({account_id:z$1.string(),media_attachments:filteredArray(attachmentSchema),card:cardSchema.nullable().catch(null),chat_id:z$1.string(),content:contentSchema,created_at:z$1.string().datetime().catch(new Date().toUTCString()),emojis:filteredArray(customEmojiSchema),expiration:z$1.number().optional().catch(void 0),emoji_reactions:z$1.array(emojiSchema).min(1).nullable().catch(null),id:z$1.string(),unread:z$1.coerce.boolean(),deleting:z$1.coerce.boolean(),pending:z$1.coerce.boolean()}),domainSchema=z$1.object({id:z$1.coerce.string(),domain:z$1.string().catch(""),public:z$1.boolean().catch(!1),resolves:z$1.boolean().catch(!1),last_checked_at:z$1.string().datetime().catch("")}),baseEmojiReactionSchema=z$1.object({count:z$1.number().nullable().catch(null),me:z$1.boolean().catch(!1),name:emojiSchema,url:z$1.literal(void 0).catch(void 0)}),customEmojiReactionSchema=baseEmojiReactionSchema.extend({name:z$1.string(),url:z$1.string().url()}),emojiReactionSchema=baseEmojiReactionSchema.or(customEmojiReactionSchema),moderationLogEntrySchema=z$1.object({id:z$1.coerce.string(),data:z$1.record(z$1.string(),z$1.any()).catch({}),time:z$1.number().catch(0),message:z$1.string().catch("")});function stripCompatibilityFeatures(E){const y=document.createElement("div");return y.innerHTML=E,[".quote-inline",".recipients-inline"].forEach(k=>{y.querySelectorAll(k).forEach(H=>{H.remove()})}),y.innerHTML}function htmlToPlaintext(E){const y=document.createElement("div");return y.innerHTML=E,y.textContent||y.innerText||""}const locationSchema=z$1.object({url:z$1.string().url().catch(""),description:z$1.string().catch(""),country:z$1.string().catch(""),locality:z$1.string().catch(""),region:z$1.string().catch(""),postal_code:z$1.string().catch(""),street:z$1.string().catch(""),origin_id:z$1.string().catch(""),origin_provider:z$1.string().catch(""),type:z$1.string().catch(""),timezone:z$1.string().catch(""),name:z$1.string().catch(""),latitude:z$1.number().catch(0),longitude:z$1.number().catch(0),geom:z$1.object({coordinates:z$1.tuple([z$1.number(),z$1.number()]).nullable().catch(null),srid:z$1.string().catch("")}).nullable().catch(null)}),eventSchema=z$1.object({name:z$1.string().catch(""),start_time:z$1.string().datetime().nullable().catch(null),end_time:z$1.string().datetime().nullable().catch(null),join_mode:z$1.enum(["free","restricted","invite"]).nullable().catch(null),participants_count:z$1.number().catch(0),location:locationSchema.nullable().catch(null),join_state:z$1.enum(["pending","reject","accept"]).nullable().catch(null),banner:attachmentSchema.nullable().catch(null),links:z$1.array(attachmentSchema).nullable().catch(null)}),pollOptionSchema=z$1.object({title:z$1.string().catch(""),votes_count:z$1.number().catch(0)}),pollSchema=z$1.object({emojis:filteredArray(customEmojiSchema),expired:z$1.boolean().catch(!1),expires_at:z$1.string().datetime().nullable().catch(null),id:z$1.string(),multiple:z$1.boolean().catch(!1),options:z$1.array(pollOptionSchema).min(1),voters_count:z$1.number().catch(0),votes_count:z$1.number().catch(0),own_votes:z$1.array(z$1.number()).nonempty().nullable().catch(null),voted:z$1.boolean().catch(!1),pleroma:z$1.object({non_anonymous:z$1.boolean().catch(!1)}).optional().catch(void 0)}).transform(E=>{var y;return(y=E.own_votes)!=null&&y.length&&(E.voted=!0),E}),statusPleromaSchema=z$1.object({event:eventSchema.nullish().catch(void 0),quote:z$1.literal(null).catch(null),quote_visible:z$1.boolean().catch(!0)}),statusDittoSchema=z$1.object({external_url:z$1.string().optional().catch(void 0)}),baseStatusSchema=z$1.object({account:accountSchema,application:z$1.object({name:z$1.string(),website:z$1.string().url().nullable().catch(null)}).nullable().catch(null),bookmarked:z$1.coerce.boolean(),card:cardSchema.nullable().catch(null),content:contentSchema,created_at:dateSchema,disliked:z$1.coerce.boolean(),dislikes_count:z$1.number().catch(0),edited_at:z$1.string().datetime().nullable().catch(null),emojis:filteredArray(customEmojiSchema),favourited:z$1.coerce.boolean(),favourites_count:z$1.number().catch(0),group:groupSchema.nullable().catch(null),in_reply_to_account_id:z$1.string().nullable().catch(null),in_reply_to_id:z$1.string().nullable().catch(null),id:z$1.string(),language:z$1.string().nullable().catch(null),media_attachments:filteredArray(attachmentSchema),mentions:filteredArray(mentionSchema),muted:z$1.coerce.boolean(),pinned:z$1.coerce.boolean(),pleroma:statusPleromaSchema.optional().catch(void 0),ditto:statusDittoSchema.optional().catch(void 0),reactions:filteredArray(emojiReactionSchema),poll:pollSchema.nullable().catch(null),quote:z$1.literal(null).catch(null),quotes_count:z$1.number().catch(0),reblog:z$1.literal(null).catch(null),reblogged:z$1.coerce.boolean(),reblogs_count:z$1.number().catch(0),replies_count:z$1.number().catch(0),sensitive:z$1.coerce.boolean(),spoiler_text:contentSchema,tags:filteredArray(tagSchema),tombstone:z$1.object({reason:z$1.enum(["deleted"])}).nullable().optional().catch(void 0),uri:z$1.string().url().catch(""),url:z$1.string().url().catch(""),visibility:z$1.string().catch("public"),zapped:z$1.coerce.boolean(),zaps_amount:z$1.number().catch(0),zapped_cashu:z$1.coerce.boolean(),zaps_amount_cashu:z$1.number().catch(0)}),buildSearchIndex=E=>{const y=E.poll?E.poll.options.map(({title:B})=>B):[],R=E.mentions.map(({acct:B})=>`@${B}`),k=[E.spoiler_text,E.content,...y,...R],H=htmlToPlaintext(k.join(` `))||"";return new DOMParser().parseFromString(H,"text/html").documentElement.textContent||""},transformStatus=({pleroma:E,...y})=>({...y,approval_status:"approval",content:DOMPurify.sanitize(stripCompatibilityFeatures(y.content),{USE_PROFILES:{html:!0}}),expectsCard:!1,event:E==null?void 0:E.event,filtered:[],hidden:!1,pleroma:E?(()=>{const{event:R,...k}=E;return k})():void 0,search_index:buildSearchIndex(y),showFiltered:!1,translation:void 0}),embeddedStatusSchema=baseStatusSchema.transform(transformStatus).nullable().catch(null),statusSchema=baseStatusSchema.extend({quote:embeddedStatusSchema,reblog:embeddedStatusSchema,pleroma:statusPleromaSchema.extend({quote:embeddedStatusSchema,emoji_reactions:filteredArray(emojiReactionSchema)}).optional().catch(void 0)}).transform(({pleroma:E,...y})=>({...y,event:E==null?void 0:E.event,quote:(E==null?void 0:E.quote)||y.quote||null,reactions:(E==null?void 0:E.emoji_reactions)||y.reactions||null,pleroma:E?(()=>{const{event:R,quote:k,emoji_reactions:H,...B}=E;return B})():void 0})).transform(transformStatus),baseNotificationSchema=z$1.object({account:accountSchema,created_at:z$1.string().datetime().catch(new Date().toUTCString()),id:z$1.string(),type:z$1.string()}),mentionNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("mention"),status:statusSchema}),statusNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("status"),status:statusSchema}),reblogNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("reblog"),status:statusSchema}),followNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("follow")}),followRequestNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("follow_request")}),favouriteNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("favourite"),status:statusSchema}),pollNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("poll"),status:statusSchema}),updateNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("update"),status:statusSchema}),moveNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("move"),target:accountSchema}),chatMessageNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("chat_message"),chat_message:chatMessageSchema}),emojiReactionNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("pleroma:emoji_reaction"),emoji:emojiSchema,emoji_url:z$1.string().url().optional().catch(void 0)}),eventReminderNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("pleroma:event_reminder"),status:statusSchema}),participationRequestNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("pleroma:participation_request"),status:statusSchema}),participationAcceptedNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("pleroma:participation_accepted"),status:statusSchema}),nameGrantNotificationSchema=baseNotificationSchema.extend({type:z$1.literal("ditto:name_grant"),name:z$1.string()});z$1.discriminatedUnion("type",[mentionNotificationSchema,statusNotificationSchema,reblogNotificationSchema,followNotificationSchema,followRequestNotificationSchema,favouriteNotificationSchema,pollNotificationSchema,updateNotificationSchema,moveNotificationSchema,chatMessageNotificationSchema,emojiReactionNotificationSchema,eventReminderNotificationSchema,participationRequestNotificationSchema,participationAcceptedNotificationSchema,nameGrantNotificationSchema]);const patronUserSchema=z$1.object({is_patron:z$1.boolean().catch(!1),url:z$1.string().url()}).transform(E=>({id:E.url,...E})),relaySchema=z$1.preprocess(E=>({id:E.actor,...E}),z$1.object({actor:z$1.string().catch(""),id:z$1.string(),followed_back:z$1.boolean().catch(!1)})),baseRuleSchema=z$1.object({id:z$1.string(),text:z$1.string().catch(""),hint:z$1.string().catch(""),rule_type:z$1.enum(["account","content","group"]).nullable().catch(null)}),ruleSchema=z$1.preprocess(E=>({...E,hint:E.hint||E.subtext}),baseRuleSchema),adminRuleSchema=baseRuleSchema.extend({priority:z$1.number().nullable().catch(null)}),tombstoneSchema=z$1.object({reason:z$1.enum(["deleted"])}),ACCOUNT_IMPORT="ACCOUNT_IMPORT",ACCOUNTS_IMPORT="ACCOUNTS_IMPORT",GROUPS_IMPORT="GROUPS_IMPORT",STATUS_IMPORT="STATUS_IMPORT",STATUSES_IMPORT="STATUSES_IMPORT",POLLS_IMPORT="POLLS_IMPORT",ACCOUNT_FETCH_FAIL_FOR_USERNAME_LOOKUP="ACCOUNT_FETCH_FAIL_FOR_USERNAME_LOOKUP",importAccounts$1=E=>(y,R)=>{y({type:ACCOUNTS_IMPORT,accounts:E});try{const k=filteredArray(accountSchema).parse(E);y(importEntities$1(k,Entities.ACCOUNTS))}catch{}},importGroups=E=>importEntities$1(E,Entities.GROUPS),importStatus$5=(E,y)=>(R,k)=>{const H=getSettings(k()).get("expandSpoilers");return R({type:STATUS_IMPORT,status:E,idempotencyKey:y,expandSpoilers:H})},importStatuses$4=E=>(y,R)=>{const k=getSettings(R()).get("expandSpoilers");return y({type:STATUSES_IMPORT,statuses:E,expandSpoilers:k})},importPolls$1=E=>({type:POLLS_IMPORT,polls:E}),importFetchedAccount$1=E=>importFetchedAccounts([E]),importFetchedAccounts=(E,y={should_refetch:!1})=>{const{should_refetch:R}=y,k=[],H=B=>{B.id&&(R&&(B.should_refetch=!0),k.push(B),B.moved&&H(B.moved))};return E.forEach(H),importAccounts$1(k)},importFetchedGroup=E=>importFetchedGroups([E]),importFetchedGroups=E=>{const y=filteredArray(groupSchema).parse(E);return importGroups(y)},importFetchedStatus=(E,y)=>R=>{var k,H,B,te,ae,ce,Ce,Oe,Le,Ne,Fe;isBroken(E)||((k=E.reblog)!=null&&k.id&&R(importFetchedStatus(E.reblog)),(H=E.quote)!=null&&H.id&&R(importFetchedStatus(E.quote)),(te=(B=E.pleroma)==null?void 0:B.quote)!=null&&te.id&&R(importFetchedStatus(E.pleroma.quote)),(ce=(ae=E.reblog)==null?void 0:ae.quote)!=null&&ce.id&&R(importFetchedStatus(E.reblog.quote)),(Le=(Oe=(Ce=E.reblog)==null?void 0:Ce.pleroma)==null?void 0:Oe.quote)!=null&&Le.id&&R(importFetchedStatus(E.reblog.pleroma.quote)),(Ne=E.poll)!=null&&Ne.id&&R(importFetchedPoll(E.poll)),(Fe=E.group)!=null&&Fe.id&&R(importFetchedGroup(E.group)),R(importFetchedAccount$1(E.account)),R(importStatus$5(E,y)))},isBroken=E=>{try{return!!(!E.account.id||E.reblog&&!E.reblog.account.id)}catch{return!0}},importFetchedStatuses=E=>(y,R)=>{const k=[],H=[],B=[];function te(ae){var ce,Ce,Oe,Le,Ne,Fe;isBroken(ae)||(H.push(ae),k.push(ae.account),(ce=ae.reblog)!=null&&ce.id&&te(ae.reblog),(Ce=ae.quote)!=null&&Ce.id&&te(ae.quote),(Le=(Oe=ae.pleroma)==null?void 0:Oe.quote)!=null&&Le.id&&te(ae.pleroma.quote),(Ne=ae.poll)!=null&&Ne.id&&B.push(ae.poll),(Fe=ae.group)!=null&&Fe.id&&y(importFetchedGroup(ae.group)))}E.forEach(te),y(importPolls$1(B)),y(importFetchedAccounts(k)),y(importStatuses$4(H))},importFetchedPoll=E=>y=>{y(importPolls$1([E]))},importErrorWhileFetchingAccountByUsername=E=>({type:ACCOUNT_FETCH_FAIL_FOR_USERNAME_LOOKUP,username:E}),ACCOUNT_CREATE_REQUEST="ACCOUNT_CREATE_REQUEST",ACCOUNT_CREATE_SUCCESS="ACCOUNT_CREATE_SUCCESS",ACCOUNT_CREATE_FAIL="ACCOUNT_CREATE_FAIL",ACCOUNT_FETCH_REQUEST="ACCOUNT_FETCH_REQUEST",ACCOUNT_FETCH_SUCCESS="ACCOUNT_FETCH_SUCCESS",ACCOUNT_FETCH_FAIL="ACCOUNT_FETCH_FAIL",ACCOUNT_BLOCK_REQUEST="ACCOUNT_BLOCK_REQUEST",ACCOUNT_BLOCK_SUCCESS="ACCOUNT_BLOCK_SUCCESS",ACCOUNT_BLOCK_FAIL="ACCOUNT_BLOCK_FAIL",ACCOUNT_UNBLOCK_REQUEST="ACCOUNT_UNBLOCK_REQUEST",ACCOUNT_UNBLOCK_SUCCESS="ACCOUNT_UNBLOCK_SUCCESS",ACCOUNT_UNBLOCK_FAIL="ACCOUNT_UNBLOCK_FAIL",ACCOUNT_MUTE_REQUEST="ACCOUNT_MUTE_REQUEST",ACCOUNT_MUTE_SUCCESS="ACCOUNT_MUTE_SUCCESS",ACCOUNT_MUTE_FAIL="ACCOUNT_MUTE_FAIL",ACCOUNT_UNMUTE_REQUEST="ACCOUNT_UNMUTE_REQUEST",ACCOUNT_UNMUTE_SUCCESS="ACCOUNT_UNMUTE_SUCCESS",ACCOUNT_UNMUTE_FAIL="ACCOUNT_UNMUTE_FAIL",ACCOUNT_SUBSCRIBE_REQUEST="ACCOUNT_SUBSCRIBE_REQUEST",ACCOUNT_SUBSCRIBE_SUCCESS="ACCOUNT_SUBSCRIBE_SUCCESS",ACCOUNT_SUBSCRIBE_FAIL="ACCOUNT_SUBSCRIBE_FAIL",ACCOUNT_UNSUBSCRIBE_REQUEST="ACCOUNT_UNSUBSCRIBE_REQUEST",ACCOUNT_UNSUBSCRIBE_SUCCESS="ACCOUNT_UNSUBSCRIBE_SUCCESS",ACCOUNT_UNSUBSCRIBE_FAIL="ACCOUNT_UNSUBSCRIBE_FAIL",ACCOUNT_PIN_REQUEST="ACCOUNT_PIN_REQUEST",ACCOUNT_PIN_SUCCESS="ACCOUNT_PIN_SUCCESS",ACCOUNT_PIN_FAIL="ACCOUNT_PIN_FAIL",ACCOUNT_UNPIN_REQUEST="ACCOUNT_UNPIN_REQUEST",ACCOUNT_UNPIN_SUCCESS="ACCOUNT_UNPIN_SUCCESS",ACCOUNT_UNPIN_FAIL="ACCOUNT_UNPIN_FAIL",ACCOUNT_REMOVE_FROM_FOLLOWERS_REQUEST="ACCOUNT_REMOVE_FROM_FOLLOWERS_REQUEST",ACCOUNT_REMOVE_FROM_FOLLOWERS_SUCCESS="ACCOUNT_REMOVE_FROM_FOLLOWERS_SUCCESS",ACCOUNT_REMOVE_FROM_FOLLOWERS_FAIL="ACCOUNT_REMOVE_FROM_FOLLOWERS_FAIL",PINNED_ACCOUNTS_FETCH_REQUEST="PINNED_ACCOUNTS_FETCH_REQUEST",PINNED_ACCOUNTS_FETCH_SUCCESS="PINNED_ACCOUNTS_FETCH_SUCCESS",PINNED_ACCOUNTS_FETCH_FAIL="PINNED_ACCOUNTS_FETCH_FAIL",ACCOUNT_SEARCH_REQUEST="ACCOUNT_SEARCH_REQUEST",ACCOUNT_SEARCH_SUCCESS="ACCOUNT_SEARCH_SUCCESS",ACCOUNT_SEARCH_FAIL="ACCOUNT_SEARCH_FAIL",ACCOUNT_LOOKUP_REQUEST="ACCOUNT_LOOKUP_REQUEST",ACCOUNT_LOOKUP_SUCCESS="ACCOUNT_LOOKUP_SUCCESS",ACCOUNT_LOOKUP_FAIL="ACCOUNT_LOOKUP_FAIL",FOLLOWERS_FETCH_SUCCESS="FOLLOWERS_FETCH_SUCCESS",FOLLOWERS_EXPAND_SUCCESS="FOLLOWERS_EXPAND_SUCCESS",FOLLOWING_FETCH_SUCCESS="FOLLOWING_FETCH_SUCCESS",FOLLOWING_EXPAND_SUCCESS="FOLLOWING_EXPAND_SUCCESS",RELATIONSHIPS_FETCH_REQUEST="RELATIONSHIPS_FETCH_REQUEST",RELATIONSHIPS_FETCH_SUCCESS="RELATIONSHIPS_FETCH_SUCCESS",RELATIONSHIPS_FETCH_FAIL="RELATIONSHIPS_FETCH_FAIL",FOLLOW_REQUESTS_FETCH_REQUEST="FOLLOW_REQUESTS_FETCH_REQUEST",FOLLOW_REQUESTS_FETCH_SUCCESS="FOLLOW_REQUESTS_FETCH_SUCCESS",FOLLOW_REQUESTS_FETCH_FAIL="FOLLOW_REQUESTS_FETCH_FAIL",FOLLOW_REQUESTS_EXPAND_REQUEST="FOLLOW_REQUESTS_EXPAND_REQUEST",FOLLOW_REQUESTS_EXPAND_SUCCESS="FOLLOW_REQUESTS_EXPAND_SUCCESS",FOLLOW_REQUESTS_EXPAND_FAIL="FOLLOW_REQUESTS_EXPAND_FAIL",FOLLOW_REQUEST_AUTHORIZE_REQUEST="FOLLOW_REQUEST_AUTHORIZE_REQUEST",FOLLOW_REQUEST_AUTHORIZE_SUCCESS="FOLLOW_REQUEST_AUTHORIZE_SUCCESS",FOLLOW_REQUEST_AUTHORIZE_FAIL="FOLLOW_REQUEST_AUTHORIZE_FAIL",FOLLOW_REQUEST_REJECT_REQUEST="FOLLOW_REQUEST_REJECT_REQUEST",FOLLOW_REQUEST_REJECT_SUCCESS="FOLLOW_REQUEST_REJECT_SUCCESS",FOLLOW_REQUEST_REJECT_FAIL="FOLLOW_REQUEST_REJECT_FAIL",NOTIFICATION_SETTINGS_REQUEST="NOTIFICATION_SETTINGS_REQUEST",NOTIFICATION_SETTINGS_SUCCESS="NOTIFICATION_SETTINGS_SUCCESS",NOTIFICATION_SETTINGS_FAIL="NOTIFICATION_SETTINGS_FAIL",BIRTHDAY_REMINDERS_FETCH_REQUEST="BIRTHDAY_REMINDERS_FETCH_REQUEST",BIRTHDAY_REMINDERS_FETCH_SUCCESS="BIRTHDAY_REMINDERS_FETCH_SUCCESS",BIRTHDAY_REMINDERS_FETCH_FAIL="BIRTHDAY_REMINDERS_FETCH_FAIL",maybeRedirectLogin=(E,y)=>{var R;y&&((R=E==null?void 0:E.response)==null?void 0:R.status)===401&&y.push("/login")},noOp$8=()=>new Promise(E=>E(void 0)),createAccount=E=>async(y,R)=>(y({type:ACCOUNT_CREATE_REQUEST,params:E}),api(R,"app").post("/api/v1/accounts",E).then(k=>k.json()).then(k=>y({type:ACCOUNT_CREATE_SUCCESS,params:E,token:k})).catch(k=>{throw y({type:ACCOUNT_CREATE_FAIL,error:k,params:E}),k})),fetchAccount=E=>(y,R)=>(y(fetchRelationships([E])),selectAccount(R(),E)?Promise.resolve(null):(y(fetchAccountRequest(E)),api(R).get(`/api/v1/accounts/${E}`).then(H=>H.json()).then(H=>{y(importFetchedAccount$1(H)),y(fetchAccountSuccess(H))}).catch(H=>{y(fetchAccountFail$1(E,H))}))),fetchAccountByUsername=(E,y)=>(R,k)=>{const{instance:H,me:B}=k(),te=getFeatures(H);return te.accountByUsername&&(B||!te.accountLookup)?api(k).get(`/api/v1/accounts/${E}`).then(ae=>ae.json()).then(ae=>{R(fetchRelationships([ae.id])),R(importFetchedAccount$1(ae)),R(fetchAccountSuccess(ae))}).catch(ae=>{R(fetchAccountFail$1(null,ae)),R(importErrorWhileFetchingAccountByUsername(E))}):te.accountLookup?R(accountLookup(E)).then(ae=>{R(fetchRelationships([ae.id])),R(fetchAccountSuccess(ae))}).catch(ae=>{R(fetchAccountFail$1(null,ae)),R(importErrorWhileFetchingAccountByUsername(E)),maybeRedirectLogin(ae,y)}):R(accountSearch({q:E,limit:5,resolve:!0})).then(ae=>{const ce=ae.find(Ce=>Ce.acct===E);if(ce)R(fetchRelationships([ce.id])),R(fetchAccountSuccess(ce));else throw ae}).catch(ae=>{R(fetchAccountFail$1(null,ae)),R(importErrorWhileFetchingAccountByUsername(E))})},fetchAccountRequest=E=>({type:ACCOUNT_FETCH_REQUEST,id:E}),fetchAccountSuccess=E=>({type:ACCOUNT_FETCH_SUCCESS,account:E}),fetchAccountFail$1=(E,y)=>({type:ACCOUNT_FETCH_FAIL,id:E,error:y,skipAlert:!0}),blockAccount=E=>(y,R)=>isLoggedIn(R)?(y(blockAccountRequest(E)),api(R).post(`/api/v1/accounts/${E}/block`).then(k=>k.json()).then(k=>(y(importEntities$1([k],Entities.RELATIONSHIPS)),y(blockAccountSuccess(k,R().statuses)))).catch(k=>y(blockAccountFail(k)))):null,unblockAccount=E=>(y,R)=>isLoggedIn(R)?(y(unblockAccountRequest(E)),api(R).post(`/api/v1/accounts/${E}/unblock`).then(k=>k.json()).then(k=>(y(importEntities$1([k],Entities.RELATIONSHIPS)),y(unblockAccountSuccess(k)))).catch(k=>y(unblockAccountFail(k)))):null,blockAccountRequest=E=>({type:ACCOUNT_BLOCK_REQUEST,id:E}),blockAccountSuccess=(E,y)=>({type:ACCOUNT_BLOCK_SUCCESS,relationship:E,statuses:y}),blockAccountFail=E=>({type:ACCOUNT_BLOCK_FAIL,error:E}),unblockAccountRequest=E=>({type:ACCOUNT_UNBLOCK_REQUEST,id:E}),unblockAccountSuccess=E=>({type:ACCOUNT_UNBLOCK_SUCCESS,relationship:E}),unblockAccountFail=E=>({type:ACCOUNT_UNBLOCK_FAIL,error:E}),muteAccount=(E,y,R=0)=>(k,H)=>{if(!isLoggedIn(H))return null;k(muteAccountRequest(E));const B={notifications:y};if(R){const ae=H().instance;parseVersion(ae.version).software===PLEROMA?B.expires_in=R:B.duration=R}return api(H).post(`/api/v1/accounts/${E}/mute`,B).then(te=>te.json()).then(te=>(k(importEntities$1([te],Entities.RELATIONSHIPS)),k(muteAccountSuccess(te,H().statuses)))).catch(te=>k(muteAccountFail(te)))},unmuteAccount=E=>(y,R)=>isLoggedIn(R)?(y(unmuteAccountRequest(E)),api(R).post(`/api/v1/accounts/${E}/unmute`).then(k=>k.json()).then(k=>(y(importEntities$1([k],Entities.RELATIONSHIPS)),y(unmuteAccountSuccess(k)))).catch(k=>y(unmuteAccountFail(k)))):null,muteAccountRequest=E=>({type:ACCOUNT_MUTE_REQUEST,id:E}),muteAccountSuccess=(E,y)=>({type:ACCOUNT_MUTE_SUCCESS,relationship:E,statuses:y}),muteAccountFail=E=>({type:ACCOUNT_MUTE_FAIL,error:E}),unmuteAccountRequest=E=>({type:ACCOUNT_UNMUTE_REQUEST,id:E}),unmuteAccountSuccess=E=>({type:ACCOUNT_UNMUTE_SUCCESS,relationship:E}),unmuteAccountFail=E=>({type:ACCOUNT_UNMUTE_FAIL,error:E}),subscribeAccount=(E,y)=>(R,k)=>isLoggedIn(k)?(R(subscribeAccountRequest(E)),api(k).post(`/api/v1/pleroma/accounts/${E}/subscribe`,{notifications:y}).then(H=>H.json()).then(H=>R(subscribeAccountSuccess(H))).catch(H=>R(subscribeAccountFail(H)))):null,unsubscribeAccount=E=>(y,R)=>isLoggedIn(R)?(y(unsubscribeAccountRequest(E)),api(R).post(`/api/v1/pleroma/accounts/${E}/unsubscribe`).then(k=>k.json()).then(k=>y(unsubscribeAccountSuccess(k))).catch(k=>y(unsubscribeAccountFail(k)))):null,subscribeAccountRequest=E=>({type:ACCOUNT_SUBSCRIBE_REQUEST,id:E}),subscribeAccountSuccess=E=>({type:ACCOUNT_SUBSCRIBE_SUCCESS,relationship:E}),subscribeAccountFail=E=>({type:ACCOUNT_SUBSCRIBE_FAIL,error:E}),unsubscribeAccountRequest=E=>({type:ACCOUNT_UNSUBSCRIBE_REQUEST,id:E}),unsubscribeAccountSuccess=E=>({type:ACCOUNT_UNSUBSCRIBE_SUCCESS,relationship:E}),unsubscribeAccountFail=E=>({type:ACCOUNT_UNSUBSCRIBE_FAIL,error:E}),removeFromFollowers=E=>(y,R)=>isLoggedIn(R)?(y(removeFromFollowersRequest(E)),api(R).post(`/api/v1/accounts/${E}/remove_from_followers`).then(k=>k.json()).then(k=>y(removeFromFollowersSuccess(k))).catch(k=>y(removeFromFollowersFail(E,k)))):null,removeFromFollowersRequest=E=>({type:ACCOUNT_REMOVE_FROM_FOLLOWERS_REQUEST,id:E}),removeFromFollowersSuccess=E=>({type:ACCOUNT_REMOVE_FROM_FOLLOWERS_SUCCESS,relationship:E}),removeFromFollowersFail=(E,y)=>({type:ACCOUNT_REMOVE_FROM_FOLLOWERS_FAIL,id:E,error:y}),fetchRelationships=E=>async(y,R)=>{if(!isLoggedIn(R))return null;const k=R().relationships,H=E.filter(te=>k.get(te,null)===null);if(H.length===0)return null;y(fetchRelationshipsRequest(H));const B=[];try{for(const te of chunkArray(H,20)){const ce=await(await api(R).get("/api/v1/accounts/relationships",{searchParams:{id:te}})).json(),Ce=relationshipSchema.array().parse(ce);B.push(...Ce)}y(importEntities$1(B,Entities.RELATIONSHIPS)),y(fetchRelationshipsSuccess(B))}catch(te){y(fetchRelationshipsFail(te))}};function*chunkArray(E,y){for(let R=0;R({type:RELATIONSHIPS_FETCH_REQUEST,ids:E,skipLoading:!0}),fetchRelationshipsSuccess=E=>({type:RELATIONSHIPS_FETCH_SUCCESS,relationships:E,skipLoading:!0}),fetchRelationshipsFail=E=>({type:RELATIONSHIPS_FETCH_FAIL,error:E,skipLoading:!0}),fetchFollowRequests=()=>(E,y)=>isLoggedIn(y)?(E(fetchFollowRequestsRequest()),api(y).get("/api/v1/follow_requests").then(async R=>{const k=R.next(),H=await R.json();E(importFetchedAccounts(H)),E(fetchFollowRequestsSuccess(H,k))}).catch(R=>E(fetchFollowRequestsFail(R)))):null,fetchFollowRequestsRequest=()=>({type:FOLLOW_REQUESTS_FETCH_REQUEST}),fetchFollowRequestsSuccess=(E,y)=>({type:FOLLOW_REQUESTS_FETCH_SUCCESS,accounts:E,next:y}),fetchFollowRequestsFail=E=>({type:FOLLOW_REQUESTS_FETCH_FAIL,error:E}),expandFollowRequests=()=>(E,y)=>{if(!isLoggedIn(y))return null;const R=y().user_lists.follow_requests.next;return R===null?null:(E(expandFollowRequestsRequest()),api(y).get(R).then(async k=>{const H=k.next(),B=await k.json();E(importFetchedAccounts(B)),E(expandFollowRequestsSuccess(B,H))}).catch(k=>E(expandFollowRequestsFail(k))))},expandFollowRequestsRequest=()=>({type:FOLLOW_REQUESTS_EXPAND_REQUEST}),expandFollowRequestsSuccess=(E,y)=>({type:FOLLOW_REQUESTS_EXPAND_SUCCESS,accounts:E,next:y}),expandFollowRequestsFail=E=>({type:FOLLOW_REQUESTS_EXPAND_FAIL,error:E}),authorizeFollowRequest=E=>(y,R)=>isLoggedIn(R)?(y(authorizeFollowRequestRequest(E)),api(R).post(`/api/v1/follow_requests/${E}/authorize`).then(()=>y(authorizeFollowRequestSuccess(E))).catch(k=>y(authorizeFollowRequestFail(E,k)))):null,authorizeFollowRequestRequest=E=>({type:FOLLOW_REQUEST_AUTHORIZE_REQUEST,id:E}),authorizeFollowRequestSuccess=E=>({type:FOLLOW_REQUEST_AUTHORIZE_SUCCESS,id:E}),authorizeFollowRequestFail=(E,y)=>({type:FOLLOW_REQUEST_AUTHORIZE_FAIL,id:E,error:y}),rejectFollowRequest=E=>(y,R)=>{isLoggedIn(R)&&(y(rejectFollowRequestRequest(E)),api(R).post(`/api/v1/follow_requests/${E}/reject`).then(()=>y(rejectFollowRequestSuccess(E))).catch(k=>y(rejectFollowRequestFail(E,k))))},rejectFollowRequestRequest=E=>({type:FOLLOW_REQUEST_REJECT_REQUEST,id:E}),rejectFollowRequestSuccess=E=>({type:FOLLOW_REQUEST_REJECT_SUCCESS,id:E}),rejectFollowRequestFail=(E,y)=>({type:FOLLOW_REQUEST_REJECT_FAIL,id:E,error:y}),pinAccount=E=>(y,R)=>isLoggedIn(R)?(y(pinAccountRequest(E)),api(R).post(`/api/v1/accounts/${E}/pin`).then(k=>k.json()).then(k=>{y(pinAccountSuccess(k))}).catch(k=>{y(pinAccountFail(k))})):y(noOp$8),unpinAccount=E=>(y,R)=>isLoggedIn(R)?(y(unpinAccountRequest(E)),api(R).post(`/api/v1/accounts/${E}/unpin`).then(k=>k.json()).then(k=>{y(unpinAccountSuccess(k))}).catch(k=>{y(unpinAccountFail(k))})):y(noOp$8),updateNotificationSettings=E=>(y,R)=>(y({type:NOTIFICATION_SETTINGS_REQUEST,params:E}),api(R).put("/api/pleroma/notification_settings",E).then(k=>k.json()).then(k=>{y({type:NOTIFICATION_SETTINGS_SUCCESS,params:E,data:k})}).catch(k=>{throw y({type:NOTIFICATION_SETTINGS_FAIL,params:E,error:k}),k})),pinAccountRequest=E=>({type:ACCOUNT_PIN_REQUEST,id:E}),pinAccountSuccess=E=>({type:ACCOUNT_PIN_SUCCESS,relationship:E}),pinAccountFail=E=>({type:ACCOUNT_PIN_FAIL,error:E}),unpinAccountRequest=E=>({type:ACCOUNT_UNPIN_REQUEST,id:E}),unpinAccountSuccess=E=>({type:ACCOUNT_UNPIN_SUCCESS,relationship:E}),unpinAccountFail=E=>({type:ACCOUNT_UNPIN_FAIL,error:E}),fetchPinnedAccounts=E=>(y,R)=>{y(fetchPinnedAccountsRequest(E)),api(R).get(`/api/v1/pleroma/accounts/${E}/endorsements`).then(k=>k.json()).then(k=>{y(importFetchedAccounts(k)),y(fetchPinnedAccountsSuccess(E,k,null))}).catch(k=>{y(fetchPinnedAccountsFail(E,k))})},fetchPinnedAccountsRequest=E=>({type:PINNED_ACCOUNTS_FETCH_REQUEST,id:E}),fetchPinnedAccountsSuccess=(E,y,R)=>({type:PINNED_ACCOUNTS_FETCH_SUCCESS,id:E,accounts:y,next:R}),fetchPinnedAccountsFail=(E,y)=>({type:PINNED_ACCOUNTS_FETCH_FAIL,id:E,error:y}),accountSearch=(E,y)=>(R,k)=>(R({type:ACCOUNT_SEARCH_REQUEST,params:E}),api(k).get("/api/v1/accounts/search",{searchParams:E,signal:y}).then(H=>H.json()).then(H=>(R(importFetchedAccounts(H)),R({type:ACCOUNT_SEARCH_SUCCESS,accounts:H}),H)).catch(H=>{throw R({type:ACCOUNT_SEARCH_FAIL,skipAlert:!0}),H})),accountLookup=(E,y)=>(R,k)=>(R({type:ACCOUNT_LOOKUP_REQUEST,acct:E}),api(k).get("/api/v1/accounts/lookup",{searchParams:{acct:E},signal:y}).then(H=>H.json()).then(H=>(H&&H.id&&R(importFetchedAccount$1(H)),R({type:ACCOUNT_LOOKUP_SUCCESS,account:H}),H)).catch(H=>{throw R({type:ACCOUNT_LOOKUP_FAIL}),H})),fetchBirthdayReminders=(E,y)=>(R,k)=>{if(!isLoggedIn(k))return;const H=k().me;return R({type:BIRTHDAY_REMINDERS_FETCH_REQUEST,day:y,month:E,id:H}),api(k).get("/api/v1/pleroma/birthdays",{searchParams:{day:y,month:E}}).then(B=>B.json()).then(B=>{R(importFetchedAccounts(B)),R({type:BIRTHDAY_REMINDERS_FETCH_SUCCESS,accounts:B,day:y,month:E,id:H})}).catch(B=>{R({type:BIRTHDAY_REMINDERS_FETCH_FAIL,day:y,month:E,id:H})})},APP_CREATE_REQUEST="APP_CREATE_REQUEST",APP_CREATE_SUCCESS="APP_CREATE_SUCCESS",APP_CREATE_FAIL="APP_CREATE_FAIL";function createApp(E,y){return R=>(R({type:APP_CREATE_REQUEST,params:E}),baseClient(null,y).post("/api/v1/apps",E).then(k=>k.json()).then(k=>(R({type:APP_CREATE_SUCCESS,params:E,app:k}),k)).catch(k=>{throw R({type:APP_CREATE_FAIL,params:E,error:k}),k}))}const EmojiRecord=Record({category:"",shortcode:"",static_url:"",url:"",visible_in_picker:!0}),normalizeEmoji=E=>EmojiRecord(Map$1(fromJS(E))),mergeDefined=(E,y)=>E===void 0?y:E,normalizeId$1=E=>z$1.string().nullable().catch(null).parse(E),toSchema=E=>z$1.custom().transform(E),maybeFromJS=E=>"toJS"in E?E.toJS():E,AccountRecord=Record({accepts_chat_messages:!1,acct:"",avatar:"",avatar_static:"",birthday:"",bot:!1,chats_onboarded:!0,created_at:"",discoverable:!1,display_name:"",emojis:List(),favicon:"",fields:List(),followers_count:0,following_count:0,fqn:"",header:"",header_static:"",id:"",last_status_at:"",location:"",locked:!1,moved:null,mute_expires_at:null,note:"",pleroma:Map$1(),source:Map$1(),statuses_count:0,uri:"",url:"",username:"",website:"",verified:!1,admin:!1,domain:"",moderator:!1,patron:null,relationship:null,should_refetch:!1,staff:!1}),FieldRecord=Record({name:"",value:"",verified_at:null}),normalizePleromaLegacyFields=E=>E.update("pleroma",Map$1(),y=>y.withMutations(R=>{const k=Map$1({is_active:!R.get("deactivated"),is_confirmed:!R.get("confirmation_pending"),is_approved:!R.get("approval_pending")});R.mergeWith(mergeDefined,k),R.deleteAll(["deactivated","confirmation_pending","approval_pending"])})),normalizeAvatar$1=E=>{const y=E.get("avatar"),R=E.get("avatar_static");return E.withMutations(k=>{k.set("avatar",y||R||avatarMissing),k.set("avatar_static",R||y||avatarMissing)})},normalizeHeader$1=E=>{const y=E.get("header"),R=E.get("header_static");return E.withMutations(k=>{k.set("header",y||R||headerMissing),k.set("header_static",R||y||headerMissing)})},normalizeFields=E=>E.update("fields",List(),y=>y.map(FieldRecord)),normalizeEmojis$3=E=>{const y=E.get("emojis",List()).map(normalizeEmoji);return E.set("emojis",y)},normalizeBirthday=E=>{const y=[E.getIn(["pleroma","birthday"]),E.getIn(["other_settings","birthday"])].find(Boolean);return E.set("birthday",y)},getTags=E=>{const y=E.getIn(["pleroma","tags"]);return List(List.isList(y)?y:[])},normalizeVerified=E=>E.update("verified",y=>[y===!0,getTags(E).includes("verified")].some(Boolean)),normalizeDonor=E=>{const y=getTags(E),R=y.includes("donor")?y.push("badge:donor"):y;return E.setIn(["pleroma","tags"],R)},normalizeLocation$1=E=>E.update("location",y=>[y,E.getIn(["pleroma","location"]),E.getIn(["other_settings","location"])].find(Boolean)),fixUsername=E=>{const y=E.get("acct")||"",R=E.get("username")||"";return E.set("username",R||y.split("@")[0])},fixDisplayName$1=E=>{const y=E.get("display_name")||"";return E.set("display_name",y.trim().length===0?E.get("username"):y)},getDomainFromURL$2=E=>{try{const y=E.get("url");return new URL(y).host}catch{return""}},guessFqn$1=E=>{const y=E.get("acct",""),[R,k]=y.split("@");return k?y:[R,getDomainFromURL$2(E)].join("@")},normalizeFqn$1=E=>{const y=E.get("fqn")||guessFqn$1(E);return E.set("fqn",y)},normalizeFavicon=E=>{const y=E.getIn(["pleroma","favicon"])||"";return E.set("favicon",y)},addDomain=E=>{const y=E.get("fqn","").split("@")[1]||"";return E.set("domain",y)},addStaffFields=E=>{const y=E.getIn(["pleroma","is_admin"])===!0,R=E.getIn(["pleroma","is_moderator"])===!0,k=y||R;return E.merge({admin:y,moderator:R,staff:k})},normalizeDiscoverable=E=>{const y=!!(E.get("discoverable")||E.getIn(["source","pleroma","discoverable"]));return E.set("discoverable",y)},normalizeMessageAcceptance=E=>{const y=!!(E.getIn(["pleroma","accepts_chat_messages"])||E.get("accepting_messages"));return E.set("accepts_chat_messages",y)},fixBirthday=E=>{const y=E.get("birthday");return E.set("birthday",y||"")},fixNote$1=E=>E.get("note")==="

"?E.set("note",""):E,normalizeAccount=E=>AccountRecord(Map$1(fromJS(E)).withMutations(y=>{normalizePleromaLegacyFields(y),normalizeEmojis$3(y),normalizeAvatar$1(y),normalizeHeader$1(y),normalizeFields(y),normalizeVerified(y),normalizeDonor(y),normalizeBirthday(y),normalizeLocation$1(y),normalizeFqn$1(y),normalizeFavicon(y),normalizeDiscoverable(y),normalizeMessageAcceptance(y),addDomain(y),addStaffFields(y),fixUsername(y),fixDisplayName$1(y),fixBirthday(y),fixNote$1(y)})),AdminAccountRecord=Record({account:null,approved:!1,confirmed:!1,created_at:new Date,disabled:!1,domain:"",email:"",id:"",invite_request:null,ip:null,ips:List(),locale:null,role:null,sensitized:!1,silenced:!1,suspended:!1,username:""}),normalizePleromaAccount=E=>{if(!E.get("account")){const y=E.getIn(["roles","admin"]),R=E.getIn(["roles","moderator"])?"moderator":null,k=y?"admin":R;return E.withMutations(H=>{H.set("approved",H.get("is_approved")),H.set("confirmed",H.get("is_confirmed")),H.set("disabled",!H.get("is_active")),H.set("invite_request",H.get("registration_reason")),H.set("role",k)})}return E},normalizeAdminAccount=E=>AdminAccountRecord(Map$1(fromJS(E)).withMutations(y=>{normalizePleromaAccount(y)})),AdminReportRecord=Record({account:null,action_taken:!1,action_taken_by_account:null,assigned_account:null,category:"",comment:"",created_at:new Date,id:"",rules:List(),statuses:List(),target_account:null,updated_at:new Date}),normalizePleromaReport=E=>E.get("actor")?E.withMutations(y=>{y.set("target_account",y.get("account")),y.set("account",y.get("actor")),y.set("action_taken",y.get("state")!=="open"),y.set("comment",y.get("content")),y.set("updated_at",y.get("created_at"))}):E,normalizeAdminReport=E=>AdminReportRecord(Map$1(fromJS(E)).withMutations(y=>{normalizePleromaReport(y)})),AttachmentRecord=Record({blurhash:void 0,description:"",id:"",meta:Map$1(),pleroma:Map$1(),preview_url:"",remote_url:null,type:"unknown",url:"",account:null,status:null}),normalizeUrls=E=>{const y=[E.get("url"),E.get("preview_url"),E.get("remote_url")].find(k=>k)||"",R=Map$1({url:y,preview_url:y});return E.mergeWith(mergeDefined,R)},normalizeMeta=E=>{const y=Map$1().merge(E.get("meta"));return E.set("meta",y)},normalizeAttachment=E=>AttachmentRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeUrls(y),normalizeMeta(y)})),ChatRecord=Record({account:null,id:"",unread:0,last_message:"",updated_at:""}),normalizeChat=E=>ChatRecord(Map$1(fromJS(E))),ChatMessageRecord=Record({account_id:"",media_attachments:List(),card:null,chat_id:"",content:"",created_at:"",emojis:List(),expiration:null,emoji_reactions:null,id:"",unread:!1,deleting:!1,pending:!1}),normalizeMedia=E=>{const y=E.get("media_attachments"),R=E.get("attachment");return y?E.set("media_attachments",List(y.map(normalizeAttachment))):R?E.set("media_attachments",List([normalizeAttachment(R)])):E.set("media_attachments",List())},normalizeChatMessageEmojiReaction=E=>{const y=List(E.get("emoji_reactions")||[]);return E.set("emoji_reactions",filteredArray(emojiReactionSchema).parse(y.toJS()))},fixContent$1=E=>E.get("content")==="

"?E.set("content",""):E,normalizeChatMessage=E=>ChatMessageRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeMedia(y),normalizeChatMessageEmojiReaction(y),fixContent$1(y)})),FilterKeywordRecord=Record({id:"",keyword:"",whole_word:!1}),normalizeFilterKeyword=E=>FilterKeywordRecord(Map$1(fromJS(E))),FilterStatusRecord=Record({id:"",status_id:""}),normalizeFilterStatus=E=>FilterStatusRecord(Map$1(fromJS(E))),FilterRecord=Record({id:"",title:"",context:List(),expires_at:"",filter_action:"warn",keywords:List(),statuses:List()}),normalizeFilterV1=E=>E.set("title",E.get("phrase")).set("keywords",List([Map$1({keyword:E.get("phrase"),whole_word:E.get("whole_word")})])).set("filter_action",E.get("irreversible")?"hide":"warn"),normalizeKeywords=E=>E.update("keywords",List(),y=>y.map(normalizeFilterKeyword)),normalizeStatuses=E=>E.update("statuses",List(),y=>y.map(normalizeFilterStatus)),normalizeFilter=E=>FilterRecord(Map$1(fromJS(E)).withMutations(y=>{y.has("phrase")&&normalizeFilterV1(y),normalizeKeywords(y),normalizeStatuses(y)})),GroupRecord=Record({avatar:"",avatar_static:"",created_at:"",deleted_at:null,display_name:"",domain:"",emojis:[],group_visibility:"",header:"",header_static:"",id:"",locked:!1,membership_required:!1,members_count:0,owner:{id:""},note:"",statuses_visibility:"public",slug:"",tags:[],uri:"",url:"",relationship:null}),normalizeAvatar=E=>{const y=E.get("avatar"),R=E.get("avatar_static");return E.withMutations(k=>{k.set("avatar",y||R||avatarMissing),k.set("avatar_static",R||y||avatarMissing)})},normalizeHeader=E=>{const y=E.get("header"),R=E.get("header_static");return E.withMutations(k=>{k.set("header",y||R||headerMissing),k.set("header_static",R||y||headerMissing)})},normalizeEmojis$2=E=>{const y=E.get("emojis",List()).map(normalizeEmoji);return E.set("emojis",y.toArray())},fixDisplayName=E=>{const y=E.get("display_name")||"";return E.set("display_name",y.trim().length===0?E.get("username"):y)},getDomainFromURL$1=E=>{try{const y=E.get("url");return new URL(y).host}catch{return""}},guessFqn=E=>{const y=E.get("acct",""),[R,k]=y.split("@");return k?y:[R,getDomainFromURL$1(E)].join("@")},normalizeFqn=E=>{const y=E.get("fqn")||guessFqn(E);return E.set("fqn",y)},normalizeLocked=E=>{const y=E.get("locked")||E.get("group_visibility")==="members_only";return E.set("locked",y)},fixNote=E=>E.get("note")==="

"?E.set("note",""):E,normalizeGroup=E=>GroupRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeEmojis$2(y),normalizeAvatar(y),normalizeHeader(y),normalizeFqn(y),normalizeLocked(y),fixDisplayName(y),fixNote(y)})),GroupRelationshipRecord=Record({id:"",blocked_by:!1,member:!1,notifying:null,requested:!1,muting:!1,role:"user",pending_requests:!1}),normalizeGroupRelationship=E=>GroupRelationshipRecord(Map$1(fromJS(E))),HistoryRecord$1=Record({accounts:"",day:"",uses:""}),normalizeHistory=E=>HistoryRecord$1(Map$1(fromJS(E))),ListRecord$2=Record({id:"",title:"",replies_policy:null}),normalizeList$3=E=>ListRecord$2(Map$1(fromJS(E))),GeographicLocationRecord=Record({coordinates:null,srid:""}),LocationRecord=Record({url:"",description:"",country:"",locality:"",region:"",postal_code:"",street:"",origin_id:"",origin_provider:"",type:"",timezone:"",geom:null}),normalizeGeographicLocation=E=>E.get("geom")?E.set("geom",GeographicLocationRecord(E.get("geom"))):E,normalizeLocation=E=>LocationRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeGeographicLocation(y)})),MentionRecord=Record({id:"",acct:"",username:"",url:""}),normalizeMention=E=>MentionRecord(normalizeAccount(E)),NotificationRecord=Record({account:null,chat_message:null,created_at:new Date,emoji:null,emoji_url:null,id:"",name:"",amount:0,message:"",status:null,target:null,type:"",total_count:null}),normalizeType=E=>E.get("type")==="group_mention"?E.set("type","mention"):E,normalizeNotification=E=>NotificationRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeType(y)})),EventRecord=Record({name:"",start_time:null,end_time:null,join_mode:null,participants_count:0,location:null,join_state:null,banner:null,links:List()}),StatusRecord=Record({account:null,application:null,approval_status:"approved",bookmarked:!1,card:null,content:"",created_at:"",dislikes_count:0,disliked:!1,edited_at:null,emojis:List(),favourited:!1,favourites_count:0,filtered:List(),group:null,in_reply_to_account_id:null,in_reply_to_id:null,id:"",language:null,media_attachments:List(),mentions:List(),muted:!1,pinned:!1,pleroma:Map$1(),ditto:Map$1(),poll:null,quote:null,quotes_count:0,reactions:null,reblog:null,reblogged:!1,reblogs_count:0,replies_count:0,zaps_amount:0,zaps_amount_cashu:0,sensitive:!1,spoiler_text:"",tags:List(),tombstone:null,uri:"",url:"",visibility:"public",zapped:!1,zapped_cashu:!1,event:null,expectsCard:!1,hidden:!1,search_index:"",showFiltered:!0,translation:null}),normalizeAttachments$1=E=>E.update("media_attachments",List(),y=>y.map(normalizeAttachment)),normalizeMentions=E=>E.update("mentions",List(),y=>y.map(normalizeMention)),normalizeReactions=E=>E.update("emojis",List(),y=>y.map(normalizeEmoji)),normalizeStatusPoll$1=E=>{try{const y=pollSchema.parse(E.get("poll").toJS());return E.set("poll",y)}catch{return E.set("poll",null)}},normalizeTombstone=E=>{try{const y=tombstoneSchema.parse(E.get("tombstone").toJS());return E.set("tombstone",y)}catch{return E.set("tombstone",null)}},normalizeStatusCard=E=>{try{const y=cardSchema.parse(E.get("card").toJS());return E.set("card",y)}catch{return E.set("card",null)}},fixMentionsOrder=E=>{const y=E.get("mentions",List()),R=E.get("in_reply_to_account_id"),k=y.sort((H,B)=>H.get("id")===R?-1:0);return E.set("mentions",k)},addSelfMention=E=>{const y=E.getIn(["account","id"]),R=y===E.get("in_reply_to_account_id"),k=y===E.getIn(["mentions",0,"id"]);if(R&&!k&&y){const H=normalizeMention(E.get("account"));return E.update("mentions",List(),B=>List([H]).concat(B))}else return E},fixQuote$1=E=>E.withMutations(y=>{y.update("quote",R=>R||y.getIn(["pleroma","quote"])||null),y.deleteIn(["pleroma","quote"]),y.update("quotes_count",R=>R||y.getIn(["pleroma","quotes_count"],0)),y.deleteIn(["pleroma","quotes_count"])}),fixSensitivity=E=>{E.get("spoiler_text")&&E.set("sensitive",!0)},normalizeEvent=E=>{if(E.getIn(["pleroma","event"])){const y=E.get("media_attachments").first();let R=null,k=E.get("media_attachments");y&&y.description==="Banner"&&y.type==="image"&&(R=normalizeAttachment(y),k=k.shift());const H=k.filter(te=>te.pleroma.get("mime_type")==="text/html");k=k.filter(te=>te.pleroma.get("mime_type")!=="text/html");const B=EventRecord(E.getIn(["pleroma","event"]).set("banner",R).set("links",H));E.set("event",B).set("media_attachments",k)}},normalizeEmojis$1=E=>{const y=List(E.getIn(["pleroma","emoji_reactions"])||E.get("reactions")),R=filteredArray(emojiReactionSchema).parse(y.toJS());R&&E.set("reactions",List(R))},fixContent=E=>E.get("content")==="

"?E.set("content",""):E,normalizeFilterResults=E=>E.update("filtered",List(),y=>y.map(R=>R.getIn(["filter","title"]))),normalizeDislikes=E=>E.get("friendica")?E.set("dislikes_count",E.getIn(["friendica","dislikes_count"])).set("disliked",E.getIn(["friendica","disliked"])):E,parseAccount=E=>{try{const y=accountSchema.parse(maybeFromJS(E.get("account")));return E.set("account",y)}catch{return E.set("account",null)}},parseGroup=E=>{try{const y=groupSchema.parse(E.get("group").toJS());return E.set("group",y)}catch{return E.set("group",null)}},normalizeStatus=E=>StatusRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeAttachments$1(y),normalizeMentions(y),normalizeEmojis$1(y),normalizeStatusPoll$1(y),normalizeStatusCard(y),fixMentionsOrder(y),addSelfMention(y),fixQuote$1(y),fixSensitivity(y),normalizeEvent(y),normalizeReactions(y),fixContent(y),normalizeFilterResults(y),normalizeDislikes(y),normalizeTombstone(y),parseAccount(y),parseGroup(y)})),StatusEditRecord=Record({account:null,content:"",created_at:new Date,emojis:List(),favourited:!1,media_attachments:List(),poll:null,sensitive:!1,spoiler_text:""}),normalizeAttachments=E=>E.update("media_attachments",List(),y=>y.map(normalizeAttachment)),normalizeEmojis=E=>E.update("emojis",List(),y=>y.map(normalizeEmoji)),normalizeStatusPoll=E=>{try{const y=pollSchema.parse(E.get("poll").toJS());return E.set("poll",y)}catch{return E.set("poll",null)}},normalizeContent=E=>{const y=DOMPurify.sanitize(stripCompatibilityFeatures(E.get("content")),{ADD_ATTR:["target"]});return E.set("content",y)},normalizeStatusEdit=E=>StatusEditRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeAttachments(y),normalizeEmojis(y),normalizeStatusPoll(y),normalizeContent(y)})),TagRecord=Record({name:"",url:"",history:null,following:!1}),normalizeHistoryList=E=>E.get("history")?E.update("history",List(),y=>y.map(normalizeHistory)):E.set("history",null),normalizeTag=E=>TagRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeHistoryList(y)})),normalizeUsername=E=>{const y=E.trim();return y[0]==="@"?y.slice(1):y};function slugify(E){return E.trim().toLowerCase().replace(/[^\w]/g,"-").replace(/-+/g,"-")}function hexToRgb(E){const y=E.replace(/##/g,"#"),R=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(y);if(!R)return null;const[,k,H,B]=R;return{r:parseInt(k,16),g:parseInt(H,16),b:parseInt(B,16)}}function rgbToHex(E,y,R){const k=H=>`0${H.toString(16)}`.slice(-2);return`#${k(E)}${k(y)}${k(R)}`}function lighten(E,y){const R=hexToRgb(`#${E}`);if(!R)return"";const k=Math.round(R.r+(255-R.r)*y),H=Math.round(R.g+(255-R.g)*y),B=Math.round(R.b+(255-R.b)*y);return rgbToHex(k,H,B)}function darken(E,y){const R=hexToRgb(E);if(!R)return"";const k=Math.round(R.r*y),H=Math.round(R.g*y),B=Math.round(R.b*y);return rgbToHex(k,H,B)}function tintify(E){const y={500:`#${E}`.replace(/##/g,"#")},R={50:.95,100:.9,200:.75,300:.3,400:.2,600:.9,700:.75,800:.3,900:.19};return[50,100,200,300,400].forEach(k=>{y[k]=lighten(E,R[k])}),[600,700,800,900].forEach(k=>{y[k]=darken(E,R[k])}),y}const rgbToHsl=E=>{const y=E.r/255,R=E.g/255,k=E.b/255,H=[y,R,k].sort(),B=(H[0]+H[2])/2*100;let te,ae;return H[0]===H[2]?(te=0,ae=0):(B>=50?te=(H[2]-H[0])/(2-H[2]-H[0])*100:te=(H[2]-H[0])/(H[2]+H[0])*100,H[2]===y?ae=(R-k)/(H[2]-H[0])*60:H[2]===R?ae=(2+(k-y)/(H[2]-H[0]))*60:ae=(4+(y-R)/(H[2]-H[0]))*60,ae<0?ae+=360:ae>360&&(ae=ae%360)),{h:ae,s:te,l:B}};function hslToHex(E){const{h:y,s:R}=E;let{l:k}=E;k/=100;const H=R*Math.min(k,1-k)/100,B=te=>{const ae=(te+y/30)%12,ce=k-H*Math.max(Math.min(ae-3,9-ae,1),-1);return Math.round(255*ce).toString(16).padStart(2,"0")};return`#${B(0)}${B(8)}${B(4)}`}const generateAccent=E=>{const y=hexToRgb(E);if(!y)return null;const{h:R}=rgbToHsl(y);return hslToHex({h:R-15,s:86,l:44})},generateNeutral=E=>{const y=hexToRgb(E);if(!y)return null;const{h:R}=rgbToHsl(y);return hslToHex({h:R,s:20,l:55})},parseShades=(E,y,R)=>{if(R){if(typeof R=="string"){const k=hexToRgb(R);if(!k)return;const{r:H,g:B,b:te}=k;E[`--color-${y}`]=`${H} ${B} ${te}`;return}Object.keys(R).forEach(k=>{const H=hexToRgb(R[k]);if(!H)return;const{r:B,g:te,b:ae}=H;E[`--color-${y}-${k}`]=`${B} ${te} ${ae}`})}},parseColors=E=>Object.keys(E).reduce((y,R)=>(parseShades(y,R,E[R]),y),{}),colorsToCss=E=>{const y=parseColors(E);return Object.keys(y).reduce((R,k)=>R+`${k}:${y[k]};`,"")},generateThemeCss=E=>colorsToCss(E.colors.toJS()),hexToHsl=E=>{const y=hexToRgb(E);return y?rgbToHsl(y):null},hueShift=(E,y)=>{const{h:R,s:k,l:H}=hexToHsl(E);return hslToHex({h:(R+y)%360,s:k,l:H})},isHex=E=>/^#([0-9A-F]{3}){1,2}$/i.test(E),expandPalette=E=>Object.entries(E).reduce((y,R)=>{const[k,H]=R;return typeof H=="string"&&isHex(H)?y[k]=tintify(H):H&&typeof H=="object"&&(y[k]=H),y},{}),maybeGenerateAccentColor=E=>isHex(E)?generateAccent(E):null,fromLegacyColors=E=>{const y=E.get("brandColor"),R=E.get("accentColor"),k=isHex(R)?R:maybeGenerateAccentColor(y);return expandPalette({primary:isHex(y)?y:null,secondary:k,accent:k,gray:isHex(y)?generateNeutral(y):null})},toTailwind=E=>{const y=Map$1(E.get("colors")),R=Map$1(fromJS(fromLegacyColors(E)));return E.set("colors",R.mergeDeep(y))},DEFAULT_COLORS=Map$1({success:Map$1({50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"}),danger:Map$1({50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"}),greentext:"#789922"}),PromoPanelItemRecord=Record({icon:"",text:"",url:"",textLocales:Map$1()}),PromoPanelRecord=Record({items:List()}),FooterItemRecord=Record({title:"",url:""}),CryptoAddressRecord=Record({address:"",note:"",ticker:""}),SoapboxConfigRecord=Record({appleAppId:null,authProvider:"",logo:"",logoDarkMode:null,banner:"",brandColor:"",accentColor:"",colors:Map$1(),copyright:`♥${new Date().getFullYear()}. Copying is an act of love. Please copy and share.`,customCss:List(),defaultSettings:Map$1(),extensions:Map$1(),gdpr:!1,gdprUrl:"",greentext:!1,promoPanel:PromoPanelRecord(),navlinks:Map$1({homeFooter:List()}),allowedEmoji:List(["👍","❤️","😆","😮","😢","😩"]),verifiedIcon:"",verifiedCanEditName:!1,displayFqn:!0,cryptoAddresses:List(),cryptoDonatePanel:Map$1({limit:1}),aboutPages:Map$1(),authenticatedProfile:!0,linkFooterMessage:"",links:Map$1(),displayCta:!0,feedInjection:!0,tileServer:"",tileServerAttribution:"",redirectRootNoLogin:"",mediaPreview:!1,sentryDsn:void 0},"SoapboxConfig"),normalizeCryptoAddress=E=>CryptoAddressRecord(Map$1(fromJS(E))).update("ticker",y=>y.replace(/^\$/,"").toLowerCase()),normalizeCryptoAddresses=E=>{const y=List(E.get("cryptoAddresses"));return E.set("cryptoAddresses",y.map(normalizeCryptoAddress))},normalizeBrandColor=E=>{const y=E.get("brandColor")||E.getIn(["colors","primary","500"])||"";return E.set("brandColor",y)},normalizeAccentColor=E=>{const y=E.get("brandColor"),R=E.get("accentColor")||E.getIn(["colors","accent","500"])||(y?generateAccent(y):"");return E.set("accentColor",R)},normalizeColors=E=>{const y=DEFAULT_COLORS.mergeDeep(E.get("colors"));return toTailwind(E.set("colors",y))},maybeAddMissingColors=E=>{const y=E.get("colors"),R=Map$1({"gradient-start":y.getIn(["primary","500"]),"gradient-end":y.getIn(["accent","500"]),"accent-blue":y.getIn(["primary","600"])});return E.set("colors",R.mergeDeep(y))},normalizePromoPanel=E=>{const y=PromoPanelRecord(E.get("promoPanel")),R=y.items.map(PromoPanelItemRecord);return E.set("promoPanel",y.set("items",R))},normalizeFooterLinks=E=>{const y=["navlinks","homeFooter"],R=E.getIn(y,List()).map(FooterItemRecord);return E.setIn(y,R)},upgradeSingleUserMode=E=>{const y=E.get("singleUserMode"),R=E.get("singleUserModeProfile");return!E.get("redirectRootNoLogin")&&y&&R?E.set("redirectRootNoLogin",`/@${normalizeUsername(R)}`).deleteAll(["singleUserMode","singleUserModeProfile"]):E.deleteAll(["singleUserMode","singleUserModeProfile"])},normalizeRedirectRootNoLogin=E=>{const y=E.get("redirectRootNoLogin");if(!y)return E;try{const R=new URL(y,"http://a").pathname;return R!=="/"?E.set("redirectRootNoLogin",R):E.delete("redirectRootNoLogin")}catch(R){return console.error("You have configured an invalid redirect in Soapbox Config."),console.error(R),E.delete("redirectRootNoLogin")}},normalizeSoapboxConfig=E=>SoapboxConfigRecord(Map$1(fromJS(E)).withMutations(y=>{normalizeBrandColor(y),normalizeAccentColor(y),normalizeColors(y),normalizePromoPanel(y),normalizeFooterLinks(y),maybeAddMissingColors(y),normalizeCryptoAddresses(y),upgradeSingleUserMode(y),normalizeRedirectRootNoLogin(y)})),SOAPBOX_CONFIG_REQUEST_SUCCESS="SOAPBOX_CONFIG_REQUEST_SUCCESS",SOAPBOX_CONFIG_REQUEST_FAIL="SOAPBOX_CONFIG_REQUEST_FAIL",SOAPBOX_CONFIG_REMEMBER_SUCCESS="SOAPBOX_CONFIG_REMEMBER_SUCCESS",getSoapboxConfig=createSelector([E=>E.soapbox,E=>getFeatures(E.instance)],(E,y)=>normalizeSoapboxConfig(E).withMutations(R=>{E.get("displayFqn")===void 0&&R.set("displayFqn",y.federating)})),fetchFrontendConfigurations=()=>(E,y)=>api(y).get("/api/pleroma/frontend_configurations").then(R=>R.json()),fetchSoapboxConfig=(E=null)=>(y,R)=>getFeatures(R().instance).frontendConfigurations?y(fetchFrontendConfigurations()).then(H=>H.soapbox_fe?(y(importSoapboxConfig$1(H.soapbox_fe,E)),H.soapbox_fe):y(soapboxConfigFail(new Error("Not found"),E))):y(fetchSoapboxJson(E)),fetchSoapboxJson=E=>y=>fetch("/instance/soapbox.json").then(R=>R.json()).then(R=>{if(!isObject(R))throw"soapbox.json failed";return y(importSoapboxConfig$1(R,E)),R}).catch(R=>{y(soapboxConfigFail(R,E))}),importSoapboxConfig$1=(E,y)=>(E.brandColor||(E.brandColor="#0482d8"),{type:SOAPBOX_CONFIG_REQUEST_SUCCESS,soapboxConfig:E,host:y}),soapboxConfigFail=(E,y)=>({type:SOAPBOX_CONFIG_REQUEST_FAIL,error:E,skipAlert:!0,host:y}),isObject=E=>E instanceof Object&&E.constructor===Object,displayFqn=E=>getSoapboxConfig(E).displayFqn,federationRestrictionsDisclosed=E=>!!E.instance.pleroma.metadata.federation.mrf_policies,getHost$1=E=>{try{return new URL(E).origin}catch{return""}},getBaseURL$1=E=>{const y=selectOwnAccount(E);return isURL(BACKEND_URL)?BACKEND_URL:getHost$1(y==null?void 0:y.url)},OAUTH_TOKEN_CREATE_REQUEST="OAUTH_TOKEN_CREATE_REQUEST",OAUTH_TOKEN_CREATE_SUCCESS="OAUTH_TOKEN_CREATE_SUCCESS",OAUTH_TOKEN_CREATE_FAIL="OAUTH_TOKEN_CREATE_FAIL",OAUTH_TOKEN_REVOKE_REQUEST="OAUTH_TOKEN_REVOKE_REQUEST",OAUTH_TOKEN_REVOKE_SUCCESS="OAUTH_TOKEN_REVOKE_SUCCESS",OAUTH_TOKEN_REVOKE_FAIL="OAUTH_TOKEN_REVOKE_FAIL",obtainOAuthToken=(E,y)=>R=>(R({type:OAUTH_TOKEN_CREATE_REQUEST,params:E}),baseClient(null,y).post("/oauth/token",E).then(k=>k.json()).then(k=>(R({type:OAUTH_TOKEN_CREATE_SUCCESS,params:E,token:k}),k)).catch(k=>{throw R({type:OAUTH_TOKEN_CREATE_FAIL,params:E,error:k,skipAlert:!0}),k})),revokeOAuthToken=E=>(y,R)=>{y({type:OAUTH_TOKEN_REVOKE_REQUEST,params:E});const k=getBaseURL$1(R());return baseClient(null,k).post("/oauth/revoke",E).then(H=>H.json()).then(H=>(y({type:OAUTH_TOKEN_REVOKE_SUCCESS,params:E,data:H}),H)).catch(H=>{throw y({type:OAUTH_TOKEN_REVOKE_FAIL,params:E,error:H}),H})},ONBOARDING_START="ONBOARDING_START",ONBOARDING_END="ONBOARDING_END",ONBOARDING_LOCAL_STORAGE_KEY="soapbox:onboarding",checkOnboardingStatus=()=>E=>{localStorage.getItem(ONBOARDING_LOCAL_STORAGE_KEY)==="1"&&E({type:ONBOARDING_START})},startOnboarding=()=>E=>{localStorage.setItem(ONBOARDING_LOCAL_STORAGE_KEY,"1"),E({type:ONBOARDING_START})},endOnboarding=()=>E=>{localStorage.removeItem(ONBOARDING_LOCAL_STORAGE_KEY),E({type:ONBOARDING_END})},RETRY_CODES=[502,503,504,521,522],queryClient=new QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:6e4,gcTime:1/0,retry(E,y){if(y instanceof HTTPError){const{response:R}=y;if(RETRY_CODES.includes(R.status))return E<3}return!1}}}});let e={data:""},t=E=>typeof window=="object"?((E?E.querySelector("#_goober"):window._goober)||Object.assign((E||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:E||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o=(E,y)=>{let R="",k="",H="";for(let B in E){let te=E[B];B[0]=="@"?B[1]=="i"?R=B+" "+te+";":k+=B[1]=="f"?o(te,B):B+"{"+o(te,B[1]=="k"?"":y)+"}":typeof te=="object"?k+=o(te,y?y.replace(/([^,])+/g,ae=>B.replace(/(^:.*)|([^,])+/g,ce=>/&/.test(ce)?ce.replace(/&/g,ae):ae?ae+" "+ce:ce)):B):te!=null&&(B=/^--/.test(B)?B:B.replace(/[A-Z]/g,"-$&").toLowerCase(),H+=o.p?o.p(B,te):B+":"+te+";")}return R+(y&&H?y+"{"+H+"}":H)+k},c={},s=E=>{if(typeof E=="object"){let y="";for(let R in E)y+=R+s(E[R]);return y}return E},i=(E,y,R,k,H)=>{let B=s(E),te=c[B]||(c[B]=(ce=>{let Ce=0,Oe=11;for(;Ce>>0;return"go"+Oe})(B));if(!c[te]){let ce=B!==E?E:(Ce=>{let Oe,Le,Ne=[{}];for(;Oe=l.exec(Ce.replace(a,""));)Oe[4]?Ne.shift():Oe[3]?(Le=Oe[3].replace(n$1," ").trim(),Ne.unshift(Ne[0][Le]=Ne[0][Le]||{})):Ne[0][Oe[1]]=Oe[2].replace(n$1," ").trim();return Ne[0]})(E);c[te]=o(H?{["@keyframes "+te]:ce}:ce,R?"":"."+te)}let ae=R&&c.g?c.g:null;return R&&(c.g=c[te]),((ce,Ce,Oe,Le)=>{Le?Ce.data=Ce.data.replace(Le,ce):Ce.data.indexOf(ce)===-1&&(Ce.data=Oe?ce+Ce.data:Ce.data+ce)})(c[te],y,k,ae),te},p=(E,y,R)=>E.reduce((k,H,B)=>{let te=y[B];if(te&&te.call){let ae=te(R),ce=ae&&ae.props&&ae.props.className||/^go/.test(ae)&&ae;te=ce?"."+ce:ae&&typeof ae=="object"?ae.props?"":o(ae,""):ae===!1?"":ae}return k+H+(te??"")},"");function u$1(E){let y=this||{},R=E.call?E(y.p):E;return i(R.unshift?R.raw?p(R,[].slice.call(arguments,1),y.p):R.reduce((k,H)=>Object.assign(k,H&&H.call?H(y.p):H),{}):R,t(y.target),y.g,y.o,y.k)}let d,f,g;u$1.bind({g:1});let h$1=u$1.bind({k:1});function m(E,y,R,k){o.p=y,d=E,f=R,g=k}function j(E,y){let R=this||{};return function(){let k=arguments;function H(B,te){let ae=Object.assign({},B),ce=ae.className||H.className;R.p=Object.assign({theme:f&&f()},ae),R.o=/ *go\d+/.test(ce),ae.className=u$1.apply(R,k)+(ce?" "+ce:"");let Ce=E;return E[0]&&(Ce=ae.as||E,delete ae.as),g&&Ce[0]&&g(ae),d(Ce,ae)}return H}}var W=E=>typeof E=="function",T=(E,y)=>W(E)?E(y):E,U=(()=>{let E=0;return()=>(++E).toString()})(),b=(()=>{let E;return()=>{if(E===void 0&&typeof window<"u"){let y=matchMedia("(prefers-reduced-motion: reduce)");E=!y||y.matches}return E}})(),Q=20,S=new Map,X=1e3,$=E=>{if(S.has(E))return;let y=setTimeout(()=>{S.delete(E),u({type:4,toastId:E})},X);S.set(E,y)},J=E=>{let y=S.get(E);y&&clearTimeout(y)},v=(E,y)=>{switch(y.type){case 0:return{...E,toasts:[y.toast,...E.toasts].slice(0,Q)};case 1:return y.toast.id&&J(y.toast.id),{...E,toasts:E.toasts.map(B=>B.id===y.toast.id?{...B,...y.toast}:B)};case 2:let{toast:R}=y;return E.toasts.find(B=>B.id===R.id)?v(E,{type:1,toast:R}):v(E,{type:0,toast:R});case 3:let{toastId:k}=y;return k?$(k):E.toasts.forEach(B=>{$(B.id)}),{...E,toasts:E.toasts.map(B=>B.id===k||k===void 0?{...B,visible:!1}:B)};case 4:return y.toastId===void 0?{...E,toasts:[]}:{...E,toasts:E.toasts.filter(B=>B.id!==y.toastId)};case 5:return{...E,pausedAt:y.time};case 6:let H=y.time-(E.pausedAt||0);return{...E,pausedAt:void 0,toasts:E.toasts.map(B=>({...B,pauseDuration:B.pauseDuration+H}))}}},A=[],P={toasts:[],pausedAt:void 0},u=E=>{P=v(P,E),A.forEach(y=>{y(P)})},Y={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},I=(E={})=>{let[y,R]=reactExports.useState(P);reactExports.useEffect(()=>(A.push(R),()=>{let H=A.indexOf(R);H>-1&&A.splice(H,1)}),[y]);let k=y.toasts.map(H=>{var B,te;return{...E,...E[H.type],...H,duration:H.duration||((B=E[H.type])==null?void 0:B.duration)||(E==null?void 0:E.duration)||Y[H.type],style:{...E.style,...(te=E[H.type])==null?void 0:te.style,...H.style}}});return{...y,toasts:k}},G=(E,y="blank",R)=>({createdAt:Date.now(),visible:!0,type:y,ariaProps:{role:"status","aria-live":"polite"},message:E,pauseDuration:0,...R,id:(R==null?void 0:R.id)||U()}),h=E=>(y,R)=>{let k=G(y,E,R);return u({type:2,toast:k}),k.id},n=(E,y)=>h("blank")(E,y);n.error=h("error");n.success=h("success");n.loading=h("loading");n.custom=h("custom");n.dismiss=E=>{u({type:3,toastId:E})};n.remove=E=>u({type:4,toastId:E});n.promise=(E,y,R)=>{let k=n.loading(y.loading,{...R,...R==null?void 0:R.loading});return E.then(H=>(n.success(T(y.success,H),{id:k,...R,...R==null?void 0:R.success}),H)).catch(H=>{n.error(T(y.error,H),{id:k,...R,...R==null?void 0:R.error})}),E};var Z=(E,y)=>{u({type:1,toast:{id:E,height:y}})},ee=()=>{u({type:5,time:Date.now()})},D=E=>{let{toasts:y,pausedAt:R}=I(E);reactExports.useEffect(()=>{if(R)return;let B=Date.now(),te=y.map(ae=>{if(ae.duration===1/0)return;let ce=(ae.duration||0)+ae.pauseDuration-(B-ae.createdAt);if(ce<0){ae.visible&&n.dismiss(ae.id);return}return setTimeout(()=>n.dismiss(ae.id),ce)});return()=>{te.forEach(ae=>ae&&clearTimeout(ae))}},[y,R]);let k=reactExports.useCallback(()=>{R&&u({type:6,time:Date.now()})},[R]),H=reactExports.useCallback((B,te)=>{let{reverseOrder:ae=!1,gutter:ce=8,defaultPosition:Ce}=te||{},Oe=y.filter(Fe=>(Fe.position||Ce)===(B.position||Ce)&&Fe.height),Le=Oe.findIndex(Fe=>Fe.id===B.id),Ne=Oe.filter((Fe,Ue)=>UeFe.visible).slice(...ae?[Ne+1]:[0,Ne]).reduce((Fe,Ue)=>Fe+(Ue.height||0)+ce,0)},[y]);return{toasts:y,handlers:{updateHeight:Z,startPause:ee,endPause:k,calculateOffset:H}}},oe=h$1` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,re$1=h$1` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,se=h$1` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,_=j("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${E=>E.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${oe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${re$1} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${E=>E.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${se} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,ne=h$1` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,V=j("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${E=>E.secondary||"#e0e0e0"}; border-right-color: ${E=>E.primary||"#616161"}; animation: ${ne} 1s linear infinite; `,pe=h$1` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,de=h$1` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,w=j("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${E=>E.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${pe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${de} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${E=>E.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,ue=j("div")` position: absolute; `,le=j("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,Te=h$1` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,fe=j("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${Te} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,M=({toast:E})=>{let{icon:y,type:R,iconTheme:k}=E;return y!==void 0?typeof y=="string"?reactExports.createElement(fe,null,y):y:R==="blank"?null:reactExports.createElement(le,null,reactExports.createElement(V,{...k}),R!=="loading"&&reactExports.createElement(ue,null,R==="error"?reactExports.createElement(_,{...k}):reactExports.createElement(w,{...k})))},ye=E=>` 0% {transform: translate3d(0,${E*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,ge=E=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${E*-150}%,-1px) scale(.6); opacity:0;} `,he="0%{opacity:0;} 100%{opacity:1;}",xe="0%{opacity:1;} 100%{opacity:0;}",be=j("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,Se=j("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,Ae=(E,y)=>{let R=E.includes("top")?1:-1,[k,H]=b()?[he,xe]:[ye(R),ge(R)];return{animation:y?`${h$1(k)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${h$1(H)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},F=reactExports.memo(({toast:E,position:y,style:R,children:k})=>{let H=E.height?Ae(E.position||y||"top-center",E.visible):{opacity:0},B=reactExports.createElement(M,{toast:E}),te=reactExports.createElement(Se,{...E.ariaProps},T(E.message,E));return reactExports.createElement(be,{className:E.className,style:{...H,...R,...E.style}},typeof k=="function"?k({icon:B,message:te}):reactExports.createElement(reactExports.Fragment,null,B,te))});m(reactExports.createElement);var Ee=({id:E,className:y,style:R,onHeightUpdate:k,children:H})=>{let B=reactExports.useCallback(te=>{if(te){let ae=()=>{let ce=te.getBoundingClientRect().height;k(E,ce)};ae(),new MutationObserver(ae).observe(te,{subtree:!0,childList:!0,characterData:!0})}},[E,k]);return reactExports.createElement("div",{ref:B,className:y,style:R},H)},Re=(E,y)=>{let R=E.includes("top"),k=R?{top:0}:{bottom:0},H=E.includes("center")?{justifyContent:"center"}:E.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:b()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${y*(R?1:-1)}px)`,...k,...H}},ve=u$1` z-index: 9999; > * { pointer-events: auto; } `,O=16,Ie=({reverseOrder:E,position:y="top-center",toastOptions:R,gutter:k,children:H,containerStyle:B,containerClassName:te})=>{let{toasts:ae,handlers:ce}=D(R);return reactExports.createElement("div",{style:{position:"fixed",zIndex:9999,top:O,left:O,right:O,bottom:O,pointerEvents:"none",...B},className:te,onMouseEnter:ce.startPause,onMouseLeave:ce.endPause},ae.map(Ce=>{let Oe=Ce.position||y,Le=ce.calculateOffset(Ce,{reverseOrder:E,gutter:k,defaultPosition:y}),Ne=Re(Oe,Le);return reactExports.createElement(Ee,{id:Ce.id,key:Ce.id,onHeightUpdate:ce.updateHeight,className:Ce.visible?ve:"",style:Ne},Ce.type==="custom"?T(Ce.message,Ce):H?H(Ce):reactExports.createElement(F,{toast:Ce,position:Oe}))}))},_t=n;const alertCircleIcon="/packs/assets/alert-circle-B1ApWyre.svg",circleCheckIcon="/packs/assets/circle-check-D2w9ViiJ.svg",infoCircleIcon="/packs/assets/info-circle-Ds3MihGK.svg",xIcon="/packs/assets/x-DEdHiowI.svg";function r(E){var y,R,k="";if(typeof E=="string"||typeof E=="number")k+=E;else if(typeof E=="object")if(Array.isArray(E))for(y=0;y=0;Oe--){var Le=k[Oe];Le==="."?spliceOne(k,Oe):Le===".."?(spliceOne(k,Oe),Ce++):Ce&&(spliceOne(k,Oe),Ce--)}if(!te)for(;Ce--;Ce)k.unshift("..");te&&k[0]!==""&&(!k[0]||!isAbsolute(k[0]))&&k.unshift("");var Ne=k.join("/");return ae&&Ne.substr(-1)!=="/"&&(Ne+="/"),Ne}function valueOf(E){return E.valueOf?E.valueOf():Object.prototype.valueOf.call(E)}function valueEqual(E,y){if(E===y)return!0;if(E==null||y==null)return!1;if(Array.isArray(E))return Array.isArray(y)&&E.length===y.length&&E.every(function(H,B){return valueEqual(H,y[B])});if(typeof E=="object"||typeof y=="object"){var R=valueOf(E),k=valueOf(y);return R!==E||k!==y?valueEqual(R,k):Object.keys(Object.assign({},E,y)).every(function(H){return valueEqual(E[H],y[H])})}return!1}var prefix="Invariant failed";function invariant$1(E,y){throw new Error(prefix)}function addLeadingSlash$1(E){return E.charAt(0)==="/"?E:"/"+E}function stripLeadingSlash(E){return E.charAt(0)==="/"?E.substr(1):E}function hasBasename(E,y){return E.toLowerCase().indexOf(y.toLowerCase())===0&&"/?#".indexOf(E.charAt(y.length))!==-1}function stripBasename$2(E,y){return hasBasename(E,y)?E.substr(y.length):E}function stripTrailingSlash(E){return E.charAt(E.length-1)==="/"?E.slice(0,-1):E}function parsePath$1(E){var y=E||"/",R="",k="",H=y.indexOf("#");H!==-1&&(k=y.substr(H),y=y.substr(0,H));var B=y.indexOf("?");return B!==-1&&(R=y.substr(B),y=y.substr(0,B)),{pathname:y,search:R==="?"?"":R,hash:k==="#"?"":k}}function createPath(E){var y=E.pathname,R=E.search,k=E.hash,H=y||"/";return R&&R!=="?"&&(H+=R.charAt(0)==="?"?R:"?"+R),k&&k!=="#"&&(H+=k.charAt(0)==="#"?k:"#"+k),H}function createLocation$1(E,y,R,k){var H;typeof E=="string"?(H=parsePath$1(E),H.state=y):(H=_extends$2({},E),H.pathname===void 0&&(H.pathname=""),H.search?H.search.charAt(0)!=="?"&&(H.search="?"+H.search):H.search="",H.hash?H.hash.charAt(0)!=="#"&&(H.hash="#"+H.hash):H.hash="",y!==void 0&&H.state===void 0&&(H.state=y));try{H.pathname=decodeURI(H.pathname)}catch(B){throw B instanceof URIError?new URIError('Pathname "'+H.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):B}return R&&(H.key=R),k?H.pathname?H.pathname.charAt(0)!=="/"&&(H.pathname=resolvePathname$1(H.pathname,k.pathname)):H.pathname=k.pathname:H.pathname||(H.pathname="/"),H}function locationsAreEqual(E,y){return E.pathname===y.pathname&&E.search===y.search&&E.hash===y.hash&&E.key===y.key&&valueEqual(E.state,y.state)}function createTransitionManager(){var E=null;function y(te){return E=te,function(){E===te&&(E=null)}}function R(te,ae,ce,Ce){if(E!=null){var Oe=typeof E=="function"?E(te,ae):E;typeof Oe=="string"?typeof ce=="function"?ce(Oe,Ce):Ce(!0):Ce(Oe!==!1)}else Ce(!0)}var k=[];function H(te){var ae=!0;function ce(){ae&&te.apply(void 0,arguments)}return k.push(ce),function(){ae=!1,k=k.filter(function(Ce){return Ce!==ce})}}function B(){for(var te=arguments.length,ae=new Array(te),ce=0;cert?Qe.splice(rt,Qe.length-rt,nt):Qe.push(nt),Oe({action:ot,location:nt,index:rt,entries:Qe})}})}function $e(ft,Ye){var ot="REPLACE",nt=createLocation$1(ft,Ye,Le(),tt.location);Ce.confirmTransitionTo(nt,ot,R,function(pt){pt&&(tt.entries[tt.index]=nt,Oe({action:ot,location:nt}))})}function Be(ft){var Ye=clamp(tt.index+ft,0,tt.entries.length-1),ot="POP",nt=tt.entries[Ye];Ce.confirmTransitionTo(nt,ot,R,function(pt){pt?Oe({action:ot,location:nt,index:Ye}):Oe()})}function Ve(){Be(-1)}function Ke(){Be(1)}function st(ft){var Ye=tt.index+ft;return Ye>=0&&Ye=0)&&(R[H]=E[H]);return R}var createNamedContext=function(y){var R=index$1();return R.displayName=y,R},historyContext=createNamedContext("Router-History"),context=createNamedContext("Router"),Router$1=function(E){_inheritsLoose(y,E),y.computeRootMatch=function(H){return{path:"/",url:"/",params:{},isExact:H==="/"}};function y(k){var H;return H=E.call(this,k)||this,H.state={location:k.history.location},H._isMounted=!1,H._pendingLocation=null,k.staticContext||(H.unlisten=k.history.listen(function(B){H._isMounted?H.setState({location:B}):H._pendingLocation=B})),H}var R=y.prototype;return R.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},R.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},R.render=function(){return React$1.createElement(context.Provider,{value:{history:this.props.history,location:this.state.location,match:y.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},React$1.createElement(historyContext.Provider,{children:this.props.children||null,value:this.props.history}))},y}(React$1.Component);React$1.Component;var Lifecycle=function(E){_inheritsLoose(y,E);function y(){return E.apply(this,arguments)||this}var R=y.prototype;return R.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},R.componentDidUpdate=function(H){this.props.onUpdate&&this.props.onUpdate.call(this,this,H)},R.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},R.render=function(){return null},y}(React$1.Component),cache={},cacheLimit=1e4,cacheCount=0;function compilePath$1(E){if(cache[E])return cache[E];var y=pathToRegexp.compile(E);return cacheCount"u"&&(forwardRef=forwardRefShim);function isModifiedEvent(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var LinkAnchor=forwardRef(function(E,y){var R=E.innerRef,k=E.navigate,H=E.onClick,B=_objectWithoutPropertiesLoose(E,["innerRef","navigate","onClick"]),te=B.target,ae=_extends$2({},B,{onClick:function(Ce){try{H&&H(Ce)}catch(Oe){throw Ce.preventDefault(),Oe}!Ce.defaultPrevented&&Ce.button===0&&(!te||te==="_self")&&!isModifiedEvent(Ce)&&(Ce.preventDefault(),k())}});return forwardRefShim!==forwardRef?ae.ref=y||R:ae.ref=R,React$1.createElement("a",ae)}),Link=forwardRef(function(E,y){var R=E.component,k=R===void 0?LinkAnchor:R,H=E.replace,B=E.to,te=E.innerRef,ae=_objectWithoutPropertiesLoose(E,["component","replace","to","innerRef"]);return React$1.createElement(context.Consumer,null,function(ce){ce||invariant$1();var Ce=ce.history,Oe=normalizeToLocation(resolveToLocation(B,ce.location),ce.location),Le=Oe?Ce.createHref(Oe):"",Ne=_extends$2({},ae,{href:Le,navigate:function(){var Ue=resolveToLocation(B,ce.location),De=createPath(ce.location)===createPath(normalizeToLocation(Ue)),$e=H||De?Ce.replace:Ce.push;$e(Ue)}});return forwardRefShim!==forwardRef?Ne.ref=y||te:Ne.innerRef=te,React$1.createElement(k,Ne)})}),forwardRefShim$1=function(y){return y},forwardRef$1=React$1.forwardRef;typeof forwardRef$1>"u"&&(forwardRef$1=forwardRefShim$1);function joinClassnames(){for(var E=arguments.length,y=new Array(E),R=0;R{const{space:R,alignItems:k,justifyContent:H,className:B,grow:te,element:ae="div",wrap:ce,...Ce}=E,Oe=ae;return jsxRuntimeExports.jsx(Oe,{...Ce,ref:y,className:clsx("flex rtl:space-x-reverse",{[alignItemsOptions$1[k]]:typeof k<"u",[justifyContentOptions$1[H]]:typeof H<"u",[spaces$1[R]]:typeof R<"u",grow:te,"flex-wrap":ce},B)})}),isNumber=E=>typeof E=="number"&&!isNaN(E),realNumberSchema=z$1.coerce.number().refine(E=>!isNaN(E)),secondsToDays=E=>Math.floor(E/(3600*24)),roundDown=E=>{E>=100&&E<1e3&&(E=Math.floor(E));const y=Number(E.toFixed(2));return y>E?y-1/Math.pow(10,2):y},shortNumberFormat=(E,y)=>{if(!isNumber(E))return"•";let R=E,k="";return E>=1e3&&E<1e6?(k="k",R=roundDown(R/1e3)):E>=1e6&&(k="M",R=roundDown(R/1e6)),y&&R>y?jsxRuntimeExports.jsxs("span",{children:[y,"+"]}):jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(FormattedNumber,{value:R,maximumFractionDigits:0,minimumFractionDigits:0,maximumSignificantDigits:3,numberingSystem:"latn",style:"decimal"}),k]})},isIntegerId=E=>new RegExp(/^-?[0-9]+$/g).test(E),Counter=({count:E,countMax:y})=>jsxRuntimeExports.jsx("span",{className:"flex h-5 min-w-[20px] max-w-[26px] items-center justify-center rounded-full bg-secondary-500 text-xs font-medium text-white ring-2 ring-white black:ring-black dark:ring-gray-800",children:shortNumberFormat(E,y)});var __read$1=function(E,y){var R=typeof Symbol=="function"&&E[Symbol.iterator];if(!R)return E;var k=R.call(E),H,B=[],te;try{for(;(y===void 0||y-- >0)&&!(H=k.next()).done;)B.push(H.value)}catch(ae){te={error:ae}}finally{try{H&&!H.done&&(R=k.return)&&R.call(k)}finally{if(te)throw te.error}}return B},styleToObject=function(E){var y=E.split(/ ?; ?/);return y.reduce(function(R,k){var H=__read$1(k.split(/ ?: ?/),2),B=H[0],te=H[1];return B&&te&&(R[B.replace(/-(\w)/g,function(ae,ce){return ce.toUpperCase()})]=Number.isNaN(Number(te))?te:Number(te)),R},{})};function randomString$2(E){E===void 0&&(E=6);for(var y="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",R="",k=E;k>0;--k)R+=y[Math.round(Math.random()*(y.length-1))];return R}var noTextChildNodes=["br","col","colgroup","dl","hr","iframe","img","input","link","menuitem","meta","ol","param","select","table","tbody","tfoot","thead","tr","ul","wbr"],possibleStandardNames={"accept-charset":"acceptCharset",acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",classid:"classID",classname:"className",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",controlslist:"controlsList",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",datetime:"dateTime",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",enctype:"encType",for:"htmlFor",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",innerhtml:"innerHTML",inputmode:"inputMode",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",marginwidth:"marginWidth",marginheight:"marginHeight",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",nomodule:"noModule",novalidate:"noValidate",playsinline:"playsInline",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",typemustmatch:"typeMustMatch",usemap:"useMap",accentheight:"accentHeight","accent-height":"accentHeight",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",arabicform:"arabicForm","arabic-form":"arabicForm",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",diffuseconstant:"diffuseConstant",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",edgemode:"edgeMode",enablebackground:"enableBackground","enable-background":"enableBackground",externalresourcesrequired:"externalResourcesRequired",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",imagerendering:"imageRendering","image-rendering":"imageRendering",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",vmathematical:"vMathematical","v-mathematical":"vMathematical",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan",onblur:"onBlur",onchange:"onChange",onclick:"onClick",oncontextmenu:"onContextMenu",ondoubleclick:"onDoubleClick",ondrag:"onDrag",ondragend:"onDragEnd",ondragenter:"onDragEnter",ondragexit:"onDragExit",ondragleave:"onDragLeave",ondragover:"onDragOver",ondragstart:"onDragStart",ondrop:"onDrop",onerror:"onError",onfocus:"onFocus",oninput:"onInput",oninvalid:"onInvalid",onkeydown:"onKeyDown",onkeypress:"onKeyPress",onkeyup:"onKeyUp",onload:"onLoad",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onscroll:"onScroll",onsubmit:"onSubmit",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"},__assign=function(){return __assign=Object.assign||function(E){for(var y,R=1,k=arguments.length;R0)&&!(H=k.next()).done;)B.push(H.value)}catch(ae){te={error:ae}}finally{try{H&&!H.done&&(R=k.return)&&R.call(k)}finally{if(te)throw te.error}}return B},__spreadArray=function(E,y,R){if(arguments.length===2)for(var k=0,H=y.length,B;k *":H,te=y.type,ae=te===void 0?"text/html":te;try{var ce=new DOMParser,Ce=ce.parseFromString(E,ae),Oe=Ce.querySelector(B);if(!(Oe instanceof Node))throw new TypeError("Error parsing input");return k?Oe:convertFromNode(Oe,y)}catch{}return null}function convert(E,y){return y===void 0&&(y={}),typeof E=="string"?convertFromString(E,y):E instanceof Node?convertFromNode(E,y):null}var __defProp=Object.defineProperty,__defNormalProp=(E,y,R)=>y in E?__defProp(E,y,{enumerable:!0,configurable:!0,writable:!0,value:R}):E[y]=R,__publicField=(E,y,R)=>(__defNormalProp(E,typeof y!="symbol"?y+"":y,R),R),CACHE_NAME="react-inlinesvg",CACHE_MAX_RETRIES=10,STATUS={IDLE:"idle",LOADING:"loading",LOADED:"loaded",FAILED:"failed",READY:"ready",UNSUPPORTED:"unsupported"};function canUseDOM(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function isSupportedEnvironment(){return supportsInlineSVG()&&typeof window<"u"&&window!==null}async function request(E,y){const R=await fetch(E,y),k=R.headers.get("content-type"),[H]=(k||"").split(/ ?; ?/);if(R.status>299)throw new Error("Not found");if(!["image/svg+xml","text/plain"].some(B=>H.includes(B)))throw new Error(`Content type isn't valid: ${H}`);return R.text()}function sleep(E=1){return new Promise(y=>{setTimeout(y,E*1e3)})}function supportsInlineSVG(){if(!document)return!1;const E=document.createElement("div");E.innerHTML="";const y=E.firstChild;return!!y&&y.namespaceURI==="http://www.w3.org/2000/svg"}function randomCharacter(E){return E[Math.floor(Math.random()*E.length)]}function randomString$1(E){const y="abcdefghijklmnopqrstuvwxyz",k=`${y}${y.toUpperCase()}1234567890`;let H="";for(let B=0;B{this.cacheApi=R,this.isReady=!0,this.subscribers.forEach(k=>k())}):this.isReady=!0}onReady(E){this.isReady?E():this.subscribers.push(E)}async get(E,y){var R;return await(this.cacheApi?this.fetchAndAddToPersistentCache(E,y):this.fetchAndAddToInternalCache(E,y)),((R=this.cacheStore.get(E))==null?void 0:R.content)??""}set(E,y){this.cacheStore.set(E,y)}isCached(E){var y;return((y=this.cacheStore.get(E))==null?void 0:y.status)===STATUS.LOADED}async fetchAndAddToInternalCache(E,y){const R=this.cacheStore.get(E);if((R==null?void 0:R.status)===STATUS.LOADING){await this.handleLoading(E,async()=>{this.cacheStore.set(E,{content:"",status:STATUS.IDLE}),await this.fetchAndAddToInternalCache(E,y)});return}if(!(R!=null&&R.content)){this.cacheStore.set(E,{content:"",status:STATUS.LOADING});try{const k=await request(E,y);this.cacheStore.set(E,{content:k,status:STATUS.LOADED})}catch(k){throw this.cacheStore.set(E,{content:"",status:STATUS.FAILED}),k}}}async fetchAndAddToPersistentCache(E,y){var H,B,te;const R=this.cacheStore.get(E);if((R==null?void 0:R.status)===STATUS.LOADED)return;if((R==null?void 0:R.status)===STATUS.LOADING){await this.handleLoading(E,async()=>{this.cacheStore.set(E,{content:"",status:STATUS.IDLE}),await this.fetchAndAddToPersistentCache(E,y)});return}this.cacheStore.set(E,{content:"",status:STATUS.LOADING});const k=await((H=this.cacheApi)==null?void 0:H.match(E));if(k){const ae=await k.text();this.cacheStore.set(E,{content:ae,status:STATUS.LOADED});return}try{await((B=this.cacheApi)==null?void 0:B.add(new Request(E,y)));const ae=await((te=this.cacheApi)==null?void 0:te.match(E)),ce=await(ae==null?void 0:ae.text())??"";this.cacheStore.set(E,{content:ce,status:STATUS.LOADED})}catch(ae){throw this.cacheStore.set(E,{content:"",status:STATUS.FAILED}),ae}}async handleLoading(E,y){var k;let R=0;for(;((k=this.cacheStore.get(E))==null?void 0:k.status)===STATUS.LOADING&&R=CACHE_MAX_RETRIES&&await y()}keys(){return[...this.cacheStore.keys()]}data(){return[...this.cacheStore.entries()].map(([E,y])=>({[E]:y}))}async delete(E){this.cacheApi&&await this.cacheApi.delete(E),this.cacheStore.delete(E)}async clear(){if(this.cacheApi){const E=await this.cacheApi.keys();for(const y of E)await this.cacheApi.delete(y)}this.cacheStore.clear()}},cacheStore,ReactInlineSVG=class extends reactExports.PureComponent{constructor(E){super(E),__publicField(this,"hash"),__publicField(this,"isActive",!1),__publicField(this,"isInitialized",!1),__publicField(this,"fetchContent",async()=>{const{fetchOptions:y,src:R}=this.props,k=await request(R,y);this.handleLoad(k)}),__publicField(this,"handleError",y=>{const{onError:R}=this.props,k=y.message==="Browser does not support SVG"?STATUS.UNSUPPORTED:STATUS.FAILED;this.isActive&&this.setState({status:k},()=>{typeof R=="function"&&R(y)})}),__publicField(this,"handleLoad",(y,R=!1)=>{this.isActive&&this.setState({content:y,isCached:R,status:STATUS.LOADED},this.getElement)}),this.state={content:"",element:null,isCached:!!E.cacheRequests&&cacheStore.isCached(E.src),status:STATUS.IDLE},this.hash=E.uniqueHash||randomString$1(8)}componentDidMount(){if(this.isActive=!0,!canUseDOM()||this.isInitialized)return;const{status:E}=this.state,{src:y}=this.props;try{if(E===STATUS.IDLE){if(!isSupportedEnvironment())throw new Error("Browser does not support SVG");if(!y)throw new Error("Missing src");this.load()}}catch(R){this.handleError(R)}this.isInitialized=!0}componentDidUpdate(E,y){if(!canUseDOM())return;const{isCached:R,status:k}=this.state,{onLoad:H,src:B}=this.props;if(y.status!==STATUS.READY&&k===STATUS.READY&&H&&H(B,R),E.src!==B){if(!B){this.handleError(new Error("Missing src"));return}this.load()}}componentWillUnmount(){this.isActive=!1}getElement(){try{const E=this.getNode(),y=convert(E);if(!y||!reactExports.isValidElement(y))throw new Error("Could not convert the src to a React element");this.setState({element:y,status:STATUS.READY})}catch(E){this.handleError(new Error(E.message))}}getNode(){const{description:E,title:y}=this.props;try{const R=this.processSVG(),k=convert(R,{nodeOnly:!0});if(!k||!(k instanceof SVGSVGElement))throw new Error("Could not convert the src to a DOM Node");const H=this.updateSVGAttributes(k);if(E){const B=H.querySelector("desc");B&&B.parentNode&&B.parentNode.removeChild(B);const te=document.createElementNS("http://www.w3.org/2000/svg","desc");te.innerHTML=E,H.prepend(te)}if(typeof y<"u"){const B=H.querySelector("title");if(B&&B.parentNode&&B.parentNode.removeChild(B),y){const te=document.createElementNS("http://www.w3.org/2000/svg","title");te.innerHTML=y,H.prepend(te)}}return H}catch(R){return this.handleError(R)}}load(){this.isActive&&this.setState({content:"",element:null,isCached:!1,status:STATUS.LOADING},async()=>{const{cacheRequests:E,fetchOptions:y,src:R}=this.props,k=R.match(/^data:image\/svg[^,]*?(;base64)?,(.*)/u);let H;if(k?H=k[1]?window.atob(k[2]):decodeURIComponent(k[2]):R.includes("H.includes(te)&&(ae?!ae.includes("#"):!1);return R&&[...E.children].forEach(te=>{if(te.attributes&&te.attributes.length){const ae=Object.values(te.attributes).map(ce=>{const Ce=ce,Oe=ce.value.match(/url\((.*?)\)/);return Oe&&Oe[1]&&(Ce.value=ce.value.replace(Oe[0],`url(${y}${Oe[1]}__${this.hash})`)),Ce});k.forEach(ce=>{const Ce=ae.find(Oe=>Oe.name===ce);Ce&&!B(ce,Ce.value)&&(Ce.value=`${Ce.value}__${this.hash}`)})}return te.children.length?this.updateSVGAttributes(te):te}),E}render(){const{element:E,status:y}=this.state,{children:R=null,innerRef:k,loader:H=null}=this.props,B=omit(this.props,"baseURL","cacheRequests","children","description","fetchOptions","innerRef","loader","onError","onLoad","preProcessor","src","title","uniqueHash","uniquifyIDs");return canUseDOM()?E?reactExports.cloneElement(E,{ref:k,...B}):[STATUS.UNSUPPORTED,STATUS.FAILED].includes(y)?R:H:H}};__publicField(ReactInlineSVG,"defaultProps",{cacheRequests:!0,uniquifyIDs:!1});function InlineSVG(E){cacheStore||(cacheStore=new CacheStore);const{loader:y}=E,R=reactExports.useRef(!1),[k,H]=reactExports.useState(cacheStore.isReady);return reactExports.useEffect(()=>{R.current||(cacheStore.onReady(()=>{H(!0)}),R.current=!0)},[]),k?jsxRuntimeExports.jsx(ReactInlineSVG,{...E}):y}const SvgIcon=({src:E,alt:y,size:R=24,className:k,...H})=>{const B=jsxRuntimeExports.jsx("svg",{className:k,width:R,height:R,"data-src":E,"data-testid":"svg-icon-loader"});return jsxRuntimeExports.jsx(InlineSVG,{className:k,src:E,title:y,width:R,height:R,loader:B,"data-testid":"svg-icon",...H,children:B})},Icon=({src:E,alt:y,count:R,size:k,countMax:H,element:B="svg",...te})=>jsxRuntimeExports.jsxs("div",{className:"relative flex shrink-0 flex-col","data-testid":te["data-testid"]||"icon",children:[R?jsxRuntimeExports.jsx("span",{className:"absolute -right-3 -top-2 flex h-5 min-w-[20px] shrink-0 items-center justify-center whitespace-nowrap break-words",children:jsxRuntimeExports.jsx(Counter,{count:R,countMax:H})}):null,B==="svg"?jsxRuntimeExports.jsx(SvgIcon,{src:E,size:k,alt:y,...te}):jsxRuntimeExports.jsx("img",{src:E,width:k,height:k,alt:y,...te})]}),spaces={0:"space-y-0",.5:"space-y-0.5",1:"space-y-1",1.5:"space-y-1.5",2:"space-y-2",3:"space-y-3",4:"space-y-4",5:"space-y-5",6:"space-y-6",9:"space-y-9",10:"space-y-10"},justifyContentOptions={between:"justify-between",center:"justify-center",end:"justify-end"},alignItemsOptions={top:"items-start",bottom:"items-end",center:"items-center",start:"items-start",end:"items-end"},Stack=reactExports.forwardRef((E,y)=>{const{space:R,alignItems:k,justifyContent:H,className:B,grow:te,element:ae="div",...ce}=E,Ce=ae;return jsxRuntimeExports.jsx(Ce,{...ce,ref:y,className:clsx("flex flex-col",{[spaces[R]]:typeof R<"u",[alignItemsOptions[k]]:typeof k<"u",[justifyContentOptions[H]]:typeof H<"u",grow:te},B)})}),themes={default:"text-gray-900 dark:text-gray-100",danger:"text-danger-600",primary:"text-primary-600 dark:text-accent-blue",muted:"text-gray-700 dark:text-gray-600",subtle:"text-gray-400 dark:text-gray-500",success:"text-success-600",inherit:"text-inherit",white:"text-white"},weights={normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},sizes={xs:"text-xs",sm:"text-sm",md:"text-base leading-5",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl"},alignments={left:"text-left",center:"text-center",right:"text-right"},trackingSizes={normal:"tracking-normal",wide:"tracking-wide"},transformProperties={normal:"normal-case",uppercase:"uppercase"},Text=reactExports.forwardRef((E,y)=>{const{align:R,className:k,direction:H,size:B="md",tag:te="p",theme:ae="default",tracking:ce="normal",transform:Ce="normal",truncate:Oe=!1,weight:Le="normal",...Ne}=E,Fe=te,Ue=typeof R=="string"?alignments[R]:"";return jsxRuntimeExports.jsx(Fe,{...Ne,ref:y,style:{textDecoration:te==="abbr"?"underline dotted":void 0,direction:H},className:clsx({"cursor-default":te==="abbr",truncate:Oe,[sizes[B]]:!0,[themes[ae]]:!0,[weights[Le]]:!0,[trackingSizes[ce]]:!0,[Ue]:typeof R<"u",[transformProperties[Ce]]:typeof Ce<"u"},k)})}),renderText=E=>typeof E=="string"?E:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{...E}),Toast=E=>{const{t:y,message:R,type:k,action:H,actionLink:B,actionLabel:te,summary:ae}=E,ce=()=>_t.dismiss(y.id),Ce=()=>{switch(k){case"success":return jsxRuntimeExports.jsx(Icon,{src:circleCheckIcon,className:"size-6 text-success-500 dark:text-success-400","aria-hidden":!0});case"info":return jsxRuntimeExports.jsx(Icon,{src:infoCircleIcon,className:"size-6 text-primary-600 dark:text-accent-blue","aria-hidden":!0});case"error":return jsxRuntimeExports.jsx(Icon,{src:alertCircleIcon,className:"size-6 text-danger-600","aria-hidden":!0})}},Oe=()=>{const Le="mt-0.5 flex-shrink-0 rounded-full text-sm font-medium text-primary-600 dark:text-accent-blue hover:underline focus:outline-none";return H&&te?jsxRuntimeExports.jsx("button",{type:"button",className:Le,onClick:()=>{ce(),H()},"data-testid":"toast-action",children:renderText(te)}):B&&te?jsxRuntimeExports.jsx(Link,{to:B,onClick:ce,className:Le,"data-testid":"toast-action-link",children:renderText(te)}):null};return jsxRuntimeExports.jsx("div",{"data-testid":"toast",className:clsx({"p-4 pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white black:bg-black dark:bg-gray-900 shadow-lg dark:ring-2 dark:ring-gray-800":!0,"animate-enter":y.visible,"animate-leave":!y.visible}),children:jsxRuntimeExports.jsxs(Stack,{space:2,children:[jsxRuntimeExports.jsxs(HStack,{space:4,alignItems:"start",children:[jsxRuntimeExports.jsxs(HStack,{space:3,justifyContent:"between",alignItems:"start",className:"w-0 flex-1",children:[jsxRuntimeExports.jsxs(HStack,{space:3,alignItems:"start",className:"w-0 flex-1",children:[jsxRuntimeExports.jsx("div",{className:"shrink-0",children:Ce()}),jsxRuntimeExports.jsx(Text,{size:"sm","data-testid":"toast-message",className:"pt-0.5",weight:typeof ae>"u"?"normal":"medium",children:renderText(R)})]}),Oe()]}),jsxRuntimeExports.jsx("div",{className:"flex shrink-0 pt-0.5",children:jsxRuntimeExports.jsxs("button",{type:"button",className:"inline-flex rounded-md text-gray-600 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:text-gray-600 dark:hover:text-gray-500",onClick:ce,"data-testid":"toast-dismiss",children:[jsxRuntimeExports.jsx("span",{className:"sr-only",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"lightbox.close",defaultMessage:"Close"})}),jsxRuntimeExports.jsx(Icon,{src:xIcon,className:"size-5"})]})})]}),ae?jsxRuntimeExports.jsx(Text,{theme:"muted",size:"sm",children:ae}):null]})})};function sample(E){const y=Math.floor(Math.random()*E.length);return E[y]}function debounce(E,y,{signal:R,edges:k}={}){let H,B=null;const te=k!=null&&k.includes("leading"),ae=k==null||k.includes("trailing"),ce=()=>{B!==null&&(E.apply(H,B),H=void 0,B=null)},Ce=()=>{ae&&ce(),Fe()};let Oe=null;const Le=()=>{Oe!=null&&clearTimeout(Oe),Oe=setTimeout(()=>{Oe=null,Ce()},y)},Ne=()=>{Oe!==null&&(clearTimeout(Oe),Oe=null)},Fe=()=>{Ne(),H=void 0,B=null},Ue=()=>{Ne(),ce()},De=function(...$e){if(R!=null&&R.aborted)return;H=this,B=$e;const Be=Oe==null;Le(),te&&Be&&ce()};return De.schedule=Le,De.cancel=Fe,De.flush=Ue,R==null||R.addEventListener("abort",Fe,{once:!0}),De}function throttle(E,y,{signal:R,edges:k=["leading","trailing"]}={}){let H=null;const B=debounce(E,y,{signal:R,edges:k}),te=function(...ae){H==null?H=Date.now():Date.now()-H>=y&&(H=Date.now(),B.cancel(),B(...ae)),B(...ae)};return te.cancel=B.cancel,te.flush=B.flush,te}function mapValues(E,y){const R={},k=Object.keys(E);for(let H=0;Hcapitalize(H)).join("")}`}function startCase(E){const y=words(E.trim());let R="";for(let k=0;kE.reduce((y,R,k)=>y+R+(k===E.length-2?" and ":", "),"").slice(0,-2),buildErrorMessage=E=>{const y=Object.keys(E).map(R=>`${startCase(camelCase(R))} ${toSentence(E[R])}`);return toSentence(y)},httpErrorMessages=[{code:100,name:"Continue",description:"The server has received the request headers, and the client should proceed to send the request body"},{code:101,name:"Switching Protocols",description:"The requester has asked the server to switch protocols"},{code:103,name:"Checkpoint",description:"Used in the resumable requests proposal to resume aborted PUT or POST requests"},{code:200,name:"OK",description:"The request is OK (this is the standard response for successful HTTP requests)"},{code:201,name:"Created",description:"The request has been fulfilled"},{code:202,name:"Accepted",description:"The request has been accepted for processing"},{code:203,name:"Non-Authoritative Information",description:"The request has been successfully processed"},{code:204,name:"No Content",description:"The request has been successfully processed"},{code:205,name:"Reset Content",description:"The request has been successfully processed"},{code:206,name:"Partial Content",description:"The server is delivering only part of the resource due to a range header sent by the client"},{code:400,name:"Bad Request",description:"The request cannot be fulfilled due to bad syntax"},{code:401,name:"Unauthorized",description:"The request was a legal request"},{code:402,name:"Payment Required",description:"Reserved for future use"},{code:403,name:"Forbidden",description:"The request was a legal request"},{code:404,name:"Not Found",description:"The requested page could not be found but may be available again in the future"},{code:405,name:"Method Not Allowed",description:"A request was made of a page using a request method not supported by that page"},{code:406,name:"Not Acceptable",description:"The server can only generate a response that is not accepted by the client"},{code:407,name:"Proxy Authentication Required",description:"The client must first authenticate itself with the proxy"},{code:408,name:"Request",description:" Timeout The server timed out waiting for the request"},{code:409,name:"Conflict",description:"The request could not be completed because of a conflict in the request"},{code:410,name:"Gone",description:"The requested page is no longer available"},{code:411,name:"Length Required",description:'The "Content-Length" is not defined. The server will not accept the request without it'},{code:412,name:"Precondition",description:" Failed. The precondition given in the request evaluated to false by the server"},{code:413,name:"Request Entity Too Large",description:"The server will not accept the request"},{code:414,name:"Request-URI Too Long",description:"The server will not accept the request"},{code:415,name:"Unsupported Media Type",description:"The server will not accept the request"},{code:416,name:"Requested Range Not Satisfiable",description:"The client has asked for a portion of the file"},{code:417,name:"Expectation Failed",description:"The server cannot meet the requirements of the Expect request-header field"},{code:500,name:"Internal Server Error",description:"An unexpected error occurred"},{code:501,name:"Not Implemented",description:"The server either does not recognize the request method"},{code:502,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server"},{code:503,name:"Service Unavailable",description:"The server is currently unavailable (overloaded or down)"},{code:504,name:"Gateway Timeout",description:"The server was acting as a gateway or proxy and did not receive a timely response from the upstream server"},{code:505,name:"HTTP Version Not Supported",description:"The server does not support the HTTP protocol version used in the request"},{code:511,name:"Network Authentication Required",description:"The client needs to auth"}];function isNetworkError(E){return E instanceof Error&&E.name==="TypeError"&&E.message.startsWith("Failed to fetch dynamically imported module: ")}const DEFAULT_DURATION=4e3,createToast=(E,y,R)=>{const k=(R==null?void 0:R.duration)||DEFAULT_DURATION;_t.custom(H=>jsxRuntimeExports.jsx(Toast,{t:H,message:y,type:E,...R}),{duration:k})};function info(E,y){createToast("info",E,y)}function success(E,y){createToast("success",E,y)}function error(E,y){createToast("error",E,y)}const messages$7={unexpectedMessage:{id:"alert.unexpected.message",defaultMessage:"Something went wrong."}};async function showAlertForError(E){var R;const{response:y}=E;if(y){const{status:k,statusText:H}=y;if(k===502)return error("The server is down");if(k===404||k===410)return;try{const te=await y.error();if(te)return error(te.error)}catch{}const B=(R=httpErrorMessages.find(te=>te.code===k))==null?void 0:R.description;return error(B??H)}else return console.error(E),error(messages$7.unexpectedMessage)}const toast={info,success,error,showAlertForError},getInstanceScopes=E=>{switch(parseVersion(E).software){case PLEROMA:return"read write follow push admin";default:return"read write follow push"}},getScopes=E=>getInstanceScopes(E.instance.version),SWITCH_ACCOUNT="SWITCH_ACCOUNT",AUTH_APP_CREATED="AUTH_APP_CREATED",AUTH_APP_AUTHORIZED="AUTH_APP_AUTHORIZED",AUTH_LOGGED_IN="AUTH_LOGGED_IN",AUTH_LOGGED_OUT="AUTH_LOGGED_OUT",VERIFY_CREDENTIALS_REQUEST="VERIFY_CREDENTIALS_REQUEST",VERIFY_CREDENTIALS_SUCCESS="VERIFY_CREDENTIALS_SUCCESS",VERIFY_CREDENTIALS_FAIL="VERIFY_CREDENTIALS_FAIL",AUTH_ACCOUNT_REMEMBER_SUCCESS="AUTH_ACCOUNT_REMEMBER_SUCCESS",customApp=custom("app"),messages$6={loggedOut:{id:"auth.logged_out",defaultMessage:"Logged out."},awaitingApproval:{id:"auth.awaiting_approval",defaultMessage:"Your account is awaiting approval"},invalidCredentials:{id:"auth.invalid_credentials",defaultMessage:"Wrong username or password"}},noOp$7=()=>new Promise(E=>E(void 0)),createAppAndToken=()=>E=>E(getAuthApp()).then(()=>E(createAppToken())),getAuthApp=()=>E=>customApp!=null&&customApp.client_secret?noOp$7().then(()=>E({type:AUTH_APP_CREATED,app:customApp})):E(createAuthApp()),createAuthApp=()=>(E,y)=>{const R={client_name:sourceCode.displayName,redirect_uris:"urn:ietf:wg:oauth:2.0:oob",scopes:getScopes(y()),website:sourceCode.homepage};return E(createApp(R)).then(k=>E({type:AUTH_APP_CREATED,app:k}))},createAppToken=()=>(E,y)=>{const R=y().auth.app,k={client_id:R==null?void 0:R.client_id,client_secret:R==null?void 0:R.client_secret,redirect_uri:"urn:ietf:wg:oauth:2.0:oob",grant_type:"client_credentials",scope:getScopes(y())};return E(obtainOAuthToken(k)).then(H=>E({type:AUTH_APP_AUTHORIZED,app:R,token:H}))},createUserToken=(E,y)=>(R,k)=>{const H=k().auth.app,B={client_id:H==null?void 0:H.client_id,client_secret:H==null?void 0:H.client_secret,redirect_uri:"urn:ietf:wg:oauth:2.0:oob",grant_type:"password",username:E,password:y,scope:getScopes(k())};return R(obtainOAuthToken(B)).then(te=>R(authLoggedIn(te)))},otpVerify=(E,y)=>(R,k)=>{const H=k().auth.app;return api(k,"app").post("/oauth/mfa/challenge",{client_id:H==null?void 0:H.client_id,client_secret:H==null?void 0:H.client_secret,mfa_token:y,code:E,challenge_type:"totp",redirect_uri:"urn:ietf:wg:oauth:2.0:oob",scope:getScopes(k())}).then(B=>B.json()).then(B=>R(authLoggedIn(B)))},verifyCredentials=(E,y)=>{const R=parseBaseURL(y);return(k,H)=>(k({type:VERIFY_CREDENTIALS_REQUEST,token:E}),baseClient(E,R).get("/api/v1/accounts/verify_credentials").then(B=>B.json()).then(B=>(k(importFetchedAccount$1(B)),k({type:VERIFY_CREDENTIALS_SUCCESS,token:E,account:B}),B.id===H().me&&k(fetchMeSuccess(B)),B)).catch(B=>{var te,ae,ce;if(((te=B==null?void 0:B.response)==null?void 0:te.status)===403&&((ce=(ae=B==null?void 0:B.response)==null?void 0:ae.data)!=null&&ce.id)){const Ce=B.data;return k(importFetchedAccount$1(Ce)),k({type:VERIFY_CREDENTIALS_SUCCESS,token:E,account:Ce}),Ce.id===H().me&&k(fetchMeSuccess(Ce)),Ce}else throw H().me===null&&k(fetchMeFail(B)),k({type:VERIFY_CREDENTIALS_FAIL,token:E,error:B}),B}))};class MfaRequiredError extends Error{constructor(y){super("MFA is required"),this.token=y}}const logIn=(E,y)=>R=>R(getAuthApp()).then(()=>R(createUserToken(normalizeUsername(E),y))).catch(async k=>{if(k instanceof HTTPError){const H=await k.response.error();if(H){if(H.error==="mfa_required"&&"mfa_token"in H&&typeof H.mfa_token=="string")throw new MfaRequiredError(H.mfa_token);H.error==="awaiting_approval"?toast.error(messages$6.awaitingApproval):toast.error(messages$6.invalidCredentials)}}throw k}),logOut=(E=!0)=>(y,R)=>{var te,ae,ce;const k=R(),H=getLoggedInAccount(k);if(!H)return y(noOp$7);const B={client_id:(te=k.auth.app)==null?void 0:te.client_id,client_secret:(ae=k.auth.app)==null?void 0:ae.client_secret,token:(ce=k.auth.users[H.url])==null?void 0:ce.access_token};return y(revokeOAuthToken(B)).finally(()=>{queryClient.invalidateQueries(),queryClient.clear(),unsetSentryAccount(),localStorage.removeItem("soapbox:external:app"),localStorage.removeItem("soapbox:external:baseurl"),localStorage.removeItem("soapbox:external:scopes"),y({type:AUTH_LOGGED_OUT,account:H,refresh:E}),toast.success(messages$6.loggedOut)})},switchAccount=(E,y=!1)=>(R,k)=>{const H=selectAccount(k(),E);return queryClient.invalidateQueries(),queryClient.clear(),R({type:SWITCH_ACCOUNT,account:H,background:y})},fetchOwnAccounts=()=>(E,y)=>{const R=y();return Object.values(R.auth.users).forEach(k=>{selectAccount(R,k.id)||E(verifyCredentials(k.access_token,k.url)).catch(()=>console.warn(`Failed to load account: ${k.url}`))})},register$2=E=>y=>(E.fullname=E.username,y(createAppAndToken()).then(()=>y(createAccount(E))).then(({token:R})=>(y(startOnboarding()),y(authLoggedIn(R))))),fetchCaptcha=()=>(E,y)=>api(y).get("/api/pleroma/captcha"),authLoggedIn=E=>y=>(y({type:AUTH_LOGGED_IN,token:E}),E),ME_FETCH_REQUEST="ME_FETCH_REQUEST",ME_FETCH_SUCCESS="ME_FETCH_SUCCESS",ME_FETCH_FAIL="ME_FETCH_FAIL",ME_FETCH_SKIP="ME_FETCH_SKIP",ME_PATCH_REQUEST="ME_PATCH_REQUEST",ME_PATCH_SUCCESS="ME_PATCH_SUCCESS",ME_PATCH_FAIL="ME_PATCH_FAIL",noOp$6=()=>new Promise(E=>E(void 0)),getMeId=E=>E.me||getAuthUserId(E),getMeUrl=E=>{var R;const y=getMeId(E);if(y)return((R=selectAccount(E,y))==null?void 0:R.url)||getAuthUserUrl(E)};function getMeToken(E){var R;const y=getMeUrl(E)||E.auth.me;return(R=E.auth.users[y])==null?void 0:R.access_token}const fetchMe=()=>(E,y)=>{const R=y(),k=getMeToken(R),H=getMeUrl(R);return k?(E(fetchMeRequest()),E(verifyCredentials(k,H)).catch(B=>E(fetchMeFail(B)))):(E({type:ME_FETCH_SKIP}),noOp$6())},patchMe=E=>(y,R)=>(y(patchMeRequest()),api(R).patch("/api/v1/accounts/update_credentials",E).then(k=>k.json()).then(k=>{y(patchMeSuccess(k))}).catch(k=>{throw y(patchMeFail(k)),k})),fetchMeRequest=()=>({type:ME_FETCH_REQUEST}),fetchMeSuccess=E=>(setSentryAccount(E),{type:ME_FETCH_SUCCESS,me:E}),fetchMeFail=E=>({type:ME_FETCH_FAIL,error:E,skipAlert:!0}),patchMeRequest=()=>({type:ME_PATCH_REQUEST}),patchMeSuccess=E=>y=>{const R={type:ME_PATCH_SUCCESS,me:E};y(importFetchedAccount$1(E)),y(R)},patchMeFail=E=>({type:ME_PATCH_FAIL,error:E,skipAlert:!0}),__variableDynamicImportRuntimeHelper=(E,y,R)=>{const k=E[y];return k?typeof k=="function"?k():Promise.resolve(k):new Promise((H,B)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(B.bind(null,new Error("Unknown variable dynamic import: "+y+(y.split("/").length!==R?". Note that variables only represent file names one level deep.":""))))})},importCustom=async E=>{try{return await __variableDynamicImportRuntimeHelper(Object.assign({}),`../custom/locales/${E}.json`,4)}catch{return{default:{}}}},importMessages$2=E=>__variableDynamicImportRuntimeHelper(Object.assign({"./locales/ar.json":()=>__vitePreload(()=>import("./js/ar-CqZI7XWk.js"),[]),"./locales/ast.json":()=>__vitePreload(()=>import("./js/ast-XuJYZmQy.js"),[]),"./locales/bg.json":()=>__vitePreload(()=>import("./js/bg-DxEPuwxB.js"),[]),"./locales/bn.json":()=>__vitePreload(()=>import("./js/bn-DlzrMNUw.js"),[]),"./locales/br.json":()=>__vitePreload(()=>import("./js/br-BkXO7zPh.js"),[]),"./locales/bs.json":()=>__vitePreload(()=>import("./js/bs-vXeZa5OT.js"),[]),"./locales/ca.json":()=>__vitePreload(()=>import("./js/ca-Ls_ALP3h.js"),[]),"./locales/co.json":()=>__vitePreload(()=>import("./js/co-vWbBEm3l.js"),[]),"./locales/cs.json":()=>__vitePreload(()=>import("./js/cs-Ddg6ZJVm.js"),[]),"./locales/cy.json":()=>__vitePreload(()=>import("./js/cy-DYwStd_6.js"),[]),"./locales/da.json":()=>__vitePreload(()=>import("./js/da-D-H2GynV.js"),[]),"./locales/de.json":()=>__vitePreload(()=>import("./js/de-CtMyJGTu.js"),[]),"./locales/el.json":()=>__vitePreload(()=>import("./js/el-CkGFKGUF.js"),[]),"./locales/en-Shaw.json":()=>__vitePreload(()=>import("./js/en-Shaw-D7GwCOsF.js"),[]),"./locales/en.json":()=>__vitePreload(()=>import("./js/en-DcAJlqLa.js"),[]),"./locales/eo.json":()=>__vitePreload(()=>import("./js/eo-DNoOREaA.js"),[]),"./locales/es-AR.json":()=>__vitePreload(()=>import("./js/es-AR-DKqDr-uw.js"),[]),"./locales/es.json":()=>__vitePreload(()=>import("./js/es-DCdIRdj_.js"),[]),"./locales/et.json":()=>__vitePreload(()=>import("./js/et-C8ojNdfM.js"),[]),"./locales/eu.json":()=>__vitePreload(()=>import("./js/eu-BFEZLd3E.js"),[]),"./locales/fa.json":()=>__vitePreload(()=>import("./js/fa-ji6YNcFp.js"),[]),"./locales/fi.json":()=>__vitePreload(()=>import("./js/fi-D9aF203_.js"),[]),"./locales/fr.json":()=>__vitePreload(()=>import("./js/fr-9DR5pRNS.js"),[]),"./locales/ga.json":()=>__vitePreload(()=>import("./js/ga-BUWesGjm.js"),[]),"./locales/gl.json":()=>__vitePreload(()=>import("./js/gl-CQ4YYEQ8.js"),[]),"./locales/he.json":()=>__vitePreload(()=>import("./js/he-dtWbr1P7.js"),[]),"./locales/hi.json":()=>__vitePreload(()=>import("./js/hi-B6xk9Bao.js"),[]),"./locales/hr.json":()=>__vitePreload(()=>import("./js/hr-DNzepgu3.js"),[]),"./locales/hu.json":()=>__vitePreload(()=>import("./js/hu-COQzXlLN.js"),[]),"./locales/hy.json":()=>__vitePreload(()=>import("./js/hy-D5JujZhm.js"),[]),"./locales/id.json":()=>__vitePreload(()=>import("./js/id-BOFEfCNU.js"),[]),"./locales/io.json":()=>__vitePreload(()=>import("./js/io-DK1Pj4wR.js"),[]),"./locales/is.json":()=>__vitePreload(()=>import("./js/is-B_ImNZ9h.js"),[]),"./locales/it.json":()=>__vitePreload(()=>import("./js/it-CYNQBIWi.js"),[]),"./locales/ja.json":()=>__vitePreload(()=>import("./js/ja-D_f1zbj3.js"),[]),"./locales/jv.json":()=>__vitePreload(()=>import("./js/jv-B1UYVgny.js"),[]),"./locales/ka.json":()=>__vitePreload(()=>import("./js/ka-CFHA4oyo.js"),[]),"./locales/kk.json":()=>__vitePreload(()=>import("./js/kk-D819Q7AB.js"),[]),"./locales/ko.json":()=>__vitePreload(()=>import("./js/ko-DhpJw3Me.js"),[]),"./locales/lt.json":()=>__vitePreload(()=>import("./js/lt-Chs6YjPD.js"),[]),"./locales/lv.json":()=>__vitePreload(()=>import("./js/lv-Cle1RfCO.js"),[]),"./locales/mk.json":()=>__vitePreload(()=>import("./js/mk-Dfh-HSmd.js"),[]),"./locales/ms.json":()=>__vitePreload(()=>import("./js/ms-oCIDshQp.js"),[]),"./locales/nl.json":()=>__vitePreload(()=>import("./js/nl-D92EcrMI.js"),[]),"./locales/nn.json":()=>__vitePreload(()=>import("./js/nn-Yw-rryku.js"),[]),"./locales/no.json":()=>__vitePreload(()=>import("./js/no-DXt-aDWP.js"),[]),"./locales/oc.json":()=>__vitePreload(()=>import("./js/oc-DCAMf1gJ.js"),[]),"./locales/pl.json":()=>__vitePreload(()=>import("./js/pl-DCHZdbL9.js"),[]),"./locales/pt-BR.json":()=>__vitePreload(()=>import("./js/pt-BR-dv5YmGMk.js"),[]),"./locales/pt.json":()=>__vitePreload(()=>import("./js/pt-BQhl80y7.js"),[]),"./locales/ro.json":()=>__vitePreload(()=>import("./js/ro-q__G98vY.js"),[]),"./locales/ru.json":()=>__vitePreload(()=>import("./js/ru-CfQShgDo.js"),[]),"./locales/sk.json":()=>__vitePreload(()=>import("./js/sk-CZzVqcPR.js"),[]),"./locales/sl.json":()=>__vitePreload(()=>import("./js/sl-C7uCNxoO.js"),[]),"./locales/sq.json":()=>__vitePreload(()=>import("./js/sq-C38dCT5K.js"),[]),"./locales/sr-Latn.json":()=>__vitePreload(()=>import("./js/sr-Latn-Bg1ntw7O.js"),[]),"./locales/sr.json":()=>__vitePreload(()=>import("./js/sr-DXx9T2D0.js"),[]),"./locales/sv.json":()=>__vitePreload(()=>import("./js/sv-yLB9TWkb.js"),[]),"./locales/ta.json":()=>__vitePreload(()=>import("./js/ta-9i-9zxYJ.js"),[]),"./locales/te.json":()=>__vitePreload(()=>import("./js/te-BGsb-6G0.js"),[]),"./locales/th.json":()=>__vitePreload(()=>import("./js/th-x37x0OrO.js"),[]),"./locales/tr.json":()=>__vitePreload(()=>import("./js/tr-B7KVlPic.js"),[]),"./locales/uk.json":()=>__vitePreload(()=>import("./js/uk-Dyl5w6ER.js"),[]),"./locales/whitelist_ar.json":()=>__vitePreload(()=>import("./js/whitelist_ar-K6fnWhzg.js"),[]),"./locales/whitelist_ast.json":()=>__vitePreload(()=>import("./js/whitelist_ast-K6fnWhzg.js"),[]),"./locales/whitelist_bg.json":()=>__vitePreload(()=>import("./js/whitelist_bg-K6fnWhzg.js"),[]),"./locales/whitelist_bn.json":()=>__vitePreload(()=>import("./js/whitelist_bn-K6fnWhzg.js"),[]),"./locales/whitelist_br.json":()=>__vitePreload(()=>import("./js/whitelist_br-K6fnWhzg.js"),[]),"./locales/whitelist_ca.json":()=>__vitePreload(()=>import("./js/whitelist_ca-K6fnWhzg.js"),[]),"./locales/whitelist_co.json":()=>__vitePreload(()=>import("./js/whitelist_co-K6fnWhzg.js"),[]),"./locales/whitelist_cs.json":()=>__vitePreload(()=>import("./js/whitelist_cs-K6fnWhzg.js"),[]),"./locales/whitelist_cy.json":()=>__vitePreload(()=>import("./js/whitelist_cy-K6fnWhzg.js"),[]),"./locales/whitelist_da.json":()=>__vitePreload(()=>import("./js/whitelist_da-K6fnWhzg.js"),[]),"./locales/whitelist_de.json":()=>__vitePreload(()=>import("./js/whitelist_de-K6fnWhzg.js"),[]),"./locales/whitelist_el.json":()=>__vitePreload(()=>import("./js/whitelist_el-K6fnWhzg.js"),[]),"./locales/whitelist_en-Shaw.json":()=>__vitePreload(()=>import("./js/whitelist_en-Shaw-K6fnWhzg.js"),[]),"./locales/whitelist_en.json":()=>__vitePreload(()=>import("./js/whitelist_en-K6fnWhzg.js"),[]),"./locales/whitelist_eo.json":()=>__vitePreload(()=>import("./js/whitelist_eo-K6fnWhzg.js"),[]),"./locales/whitelist_es-AR.json":()=>__vitePreload(()=>import("./js/whitelist_es-AR-K6fnWhzg.js"),[]),"./locales/whitelist_es.json":()=>__vitePreload(()=>import("./js/whitelist_es-K6fnWhzg.js"),[]),"./locales/whitelist_et.json":()=>__vitePreload(()=>import("./js/whitelist_et-K6fnWhzg.js"),[]),"./locales/whitelist_eu.json":()=>__vitePreload(()=>import("./js/whitelist_eu-K6fnWhzg.js"),[]),"./locales/whitelist_fa.json":()=>__vitePreload(()=>import("./js/whitelist_fa-K6fnWhzg.js"),[]),"./locales/whitelist_fi.json":()=>__vitePreload(()=>import("./js/whitelist_fi-K6fnWhzg.js"),[]),"./locales/whitelist_fr.json":()=>__vitePreload(()=>import("./js/whitelist_fr-K6fnWhzg.js"),[]),"./locales/whitelist_ga.json":()=>__vitePreload(()=>import("./js/whitelist_ga-K6fnWhzg.js"),[]),"./locales/whitelist_gl.json":()=>__vitePreload(()=>import("./js/whitelist_gl-K6fnWhzg.js"),[]),"./locales/whitelist_he.json":()=>__vitePreload(()=>import("./js/whitelist_he-K6fnWhzg.js"),[]),"./locales/whitelist_hi.json":()=>__vitePreload(()=>import("./js/whitelist_hi-K6fnWhzg.js"),[]),"./locales/whitelist_hr.json":()=>__vitePreload(()=>import("./js/whitelist_hr-K6fnWhzg.js"),[]),"./locales/whitelist_hu.json":()=>__vitePreload(()=>import("./js/whitelist_hu-K6fnWhzg.js"),[]),"./locales/whitelist_hy.json":()=>__vitePreload(()=>import("./js/whitelist_hy-K6fnWhzg.js"),[]),"./locales/whitelist_id.json":()=>__vitePreload(()=>import("./js/whitelist_id-K6fnWhzg.js"),[]),"./locales/whitelist_io.json":()=>__vitePreload(()=>import("./js/whitelist_io-K6fnWhzg.js"),[]),"./locales/whitelist_is.json":()=>__vitePreload(()=>import("./js/whitelist_is-K6fnWhzg.js"),[]),"./locales/whitelist_it.json":()=>__vitePreload(()=>import("./js/whitelist_it-K6fnWhzg.js"),[]),"./locales/whitelist_ja.json":()=>__vitePreload(()=>import("./js/whitelist_ja-K6fnWhzg.js"),[]),"./locales/whitelist_ka.json":()=>__vitePreload(()=>import("./js/whitelist_ka-K6fnWhzg.js"),[]),"./locales/whitelist_kk.json":()=>__vitePreload(()=>import("./js/whitelist_kk-K6fnWhzg.js"),[]),"./locales/whitelist_ko.json":()=>__vitePreload(()=>import("./js/whitelist_ko-K6fnWhzg.js"),[]),"./locales/whitelist_lt.json":()=>__vitePreload(()=>import("./js/whitelist_lt-K6fnWhzg.js"),[]),"./locales/whitelist_lv.json":()=>__vitePreload(()=>import("./js/whitelist_lv-K6fnWhzg.js"),[]),"./locales/whitelist_mk.json":()=>__vitePreload(()=>import("./js/whitelist_mk-K6fnWhzg.js"),[]),"./locales/whitelist_ms.json":()=>__vitePreload(()=>import("./js/whitelist_ms-K6fnWhzg.js"),[]),"./locales/whitelist_nl.json":()=>__vitePreload(()=>import("./js/whitelist_nl-K6fnWhzg.js"),[]),"./locales/whitelist_nn.json":()=>__vitePreload(()=>import("./js/whitelist_nn-K6fnWhzg.js"),[]),"./locales/whitelist_no.json":()=>__vitePreload(()=>import("./js/whitelist_no-K6fnWhzg.js"),[]),"./locales/whitelist_oc.json":()=>__vitePreload(()=>import("./js/whitelist_oc-K6fnWhzg.js"),[]),"./locales/whitelist_pl.json":()=>__vitePreload(()=>import("./js/whitelist_pl-K6fnWhzg.js"),[]),"./locales/whitelist_pt-BR.json":()=>__vitePreload(()=>import("./js/whitelist_pt-BR-K6fnWhzg.js"),[]),"./locales/whitelist_pt.json":()=>__vitePreload(()=>import("./js/whitelist_pt-K6fnWhzg.js"),[]),"./locales/whitelist_ro.json":()=>__vitePreload(()=>import("./js/whitelist_ro-K6fnWhzg.js"),[]),"./locales/whitelist_ru.json":()=>__vitePreload(()=>import("./js/whitelist_ru-K6fnWhzg.js"),[]),"./locales/whitelist_sk.json":()=>__vitePreload(()=>import("./js/whitelist_sk-K6fnWhzg.js"),[]),"./locales/whitelist_sl.json":()=>__vitePreload(()=>import("./js/whitelist_sl-K6fnWhzg.js"),[]),"./locales/whitelist_sq.json":()=>__vitePreload(()=>import("./js/whitelist_sq-K6fnWhzg.js"),[]),"./locales/whitelist_sr-Latn.json":()=>__vitePreload(()=>import("./js/whitelist_sr-Latn-K6fnWhzg.js"),[]),"./locales/whitelist_sr.json":()=>__vitePreload(()=>import("./js/whitelist_sr-K6fnWhzg.js"),[]),"./locales/whitelist_sv.json":()=>__vitePreload(()=>import("./js/whitelist_sv-K6fnWhzg.js"),[]),"./locales/whitelist_ta.json":()=>__vitePreload(()=>import("./js/whitelist_ta-K6fnWhzg.js"),[]),"./locales/whitelist_te.json":()=>__vitePreload(()=>import("./js/whitelist_te-K6fnWhzg.js"),[]),"./locales/whitelist_th.json":()=>__vitePreload(()=>import("./js/whitelist_th-K6fnWhzg.js"),[]),"./locales/whitelist_tr.json":()=>__vitePreload(()=>import("./js/whitelist_tr-K6fnWhzg.js"),[]),"./locales/whitelist_uk.json":()=>__vitePreload(()=>import("./js/whitelist_uk-K6fnWhzg.js"),[]),"./locales/whitelist_zh-CN.json":()=>__vitePreload(()=>import("./js/whitelist_zh-CN-K6fnWhzg.js"),[]),"./locales/whitelist_zh-HK.json":()=>__vitePreload(()=>import("./js/whitelist_zh-HK-K6fnWhzg.js"),[]),"./locales/whitelist_zh-TW.json":()=>__vitePreload(()=>import("./js/whitelist_zh-TW-K6fnWhzg.js"),[]),"./locales/zh-CN.json":()=>__vitePreload(()=>import("./js/zh-CN-BajLP0MJ.js"),[]),"./locales/zh-HK.json":()=>__vitePreload(()=>import("./js/zh-HK-BroTX5FQ.js"),[]),"./locales/zh-TW.json":()=>__vitePreload(()=>import("./js/zh-TW-BEeUdfiG.js"),[])}),`./locales/${E}.json`,3),importMessagesWithCustom=async E=>{try{const y=await Promise.all([importMessages$2(E),importCustom(E)]),[R,k]=y;return Object.assign(R.default,k.default)}catch(y){throw console.error(y),y}},locales=["ar","ast","bg","bn","br","ca","co","cs","cy","da","de","el","en","en-Shaw","eo","es-AR","es","et","eu","fa","fi","fr","ga","gl","he","hi","hr","hu","hy","id","io","is","it","ja","ka","kk","ko","lt","lv","mk","ms","nl","nn","no","oc","pl","pt-BR","pt","ro","ru","sk","sl","sq","sr","sr-Latn","sv","ta","te","th","tr","uk","zh-CN","zh-HK","zh-TW"],messages$5=locales.reduce((E,y)=>(E[y]=()=>importMessagesWithCustom(y),E),{}),SETTING_CHANGE="SETTING_CHANGE",SETTING_SAVE="SETTING_SAVE",SETTINGS_UPDATE="SETTINGS_UPDATE",FE_NAME="soapbox_fe",saveSuccessMessage={id:"settings.save.success",defaultMessage:"Your preferences have been saved!"},defaultSettings=Map$1({onboarded:!1,skinTone:1,reduceMotion:!1,underlineLinks:!1,autoPlayGif:!0,displayMedia:"default",expandSpoilers:!1,unfollowModal:!1,boostModal:!1,deleteModal:!0,missingDescriptionModal:!1,defaultPrivacy:"public",defaultContentType:"text/plain",themeMode:"system",locale:navigator.language||"en",showExplanationBox:!0,explanationBox:!0,autoloadTimelines:!0,autoloadMore:!0,preserveSpoilers:!1,systemFont:!1,demetricator:!1,isDeveloper:!1,chats:Map$1({panes:List(),mainWindow:"minimized",sound:!0}),home:Map$1({shows:Map$1({reblog:!0,reply:!0,direct:!1}),regex:Map$1({body:""})}),notifications:Map$1({alerts:Map$1({follow:!0,follow_request:!1,favourite:!0,reblog:!0,mention:!0,poll:!0,move:!0,"pleroma:emoji_reaction":!0}),quickFilter:Map$1({active:"all",show:!0,advanced:!1}),shows:Map$1({follow:!0,follow_request:!0,favourite:!0,reblog:!0,mention:!0,poll:!0,move:!0,"pleroma:emoji_reaction":!0}),sounds:Map$1({follow:!1,follow_request:!1,favourite:!1,reblog:!1,mention:!1,poll:!1,move:!1,"pleroma:emoji_reaction":!1}),birthdays:Map$1({show:!0})}),community:Map$1({shows:Map$1({reblog:!1,reply:!0,direct:!1}),other:Map$1({onlyMedia:!1}),regex:Map$1({body:""})}),public:Map$1({shows:Map$1({reblog:!0,reply:!0,direct:!1}),other:Map$1({onlyMedia:!1}),regex:Map$1({body:""})}),direct:Map$1({regex:Map$1({body:""})}),account_timeline:Map$1({shows:Map$1({reblog:!0,pinned:!0,direct:!1})}),groups:Map$1({}),trends:Map$1({show:!0}),columns:List([Map$1({id:"COMPOSE",uuid:crypto.randomUUID(),params:{}}),Map$1({id:"HOME",uuid:crypto.randomUUID(),params:{}}),Map$1({id:"NOTIFICATIONS",uuid:crypto.randomUUID(),params:{}})]),remote_timeline:Map$1({pinnedHosts:List()})}),getSettings=createSelector([E=>E.soapbox.get("defaultSettings"),E=>E.settings],(E,y)=>defaultSettings.mergeDeep(E).mergeDeep(y)),changeSettingImmediate=(E,y,R)=>k=>{k({type:SETTING_CHANGE,path:E,value:y}),k(saveSettingsImmediate(R))},changeSetting=(E,y,R)=>k=>(k({type:SETTING_CHANGE,path:E,value:y}),k(saveSettings(R))),saveSettingsImmediate=E=>(y,R)=>{if(!isLoggedIn(R))return;const k=R();if(getSettings(k).getIn(["saved"]))return;const H=k.settings.delete("saved").toJS();y(patchMe({pleroma_settings_store:{[FE_NAME]:H}})).then(()=>{y({type:SETTING_SAVE}),E!=null&&E.showAlert&&toast.success(saveSuccessMessage)}).catch(B=>{toast.showAlertForError(B)})},saveSettings=E=>y=>y(saveSettingsImmediate(E)),getLocale=(E,y="en")=>{const R=getSettings(E).get("locale").replace("_","-"),k=R.split("-")[0],H=Object.keys(messages$5).includes(k)?k:y;return Object.keys(messages$5).includes(R)?R:H},getDomainFromURL=E=>{try{const y=E.url;return new URL(y).host}catch{return""}},getDomain=E=>{const y=E.acct.split("@")[1];return y||getDomainFromURL(E)},getBaseURL=E=>{try{return new URL(E.url).origin}catch{return""}},getAcct=(E,y)=>y===!0?E.fqn:E.acct,DEFAULT_HEADERS=["/headers/original/missing.png","/images/banner.png",headerMissing],isDefaultHeader=E=>DEFAULT_HEADERS.some(y=>E.endsWith(y)),DEFAULT_AVATARS=["/avatars/original/missing.png","/images/avi.png",avatarMissing],isDefaultAvatar=E=>DEFAULT_AVATARS.some(y=>E.endsWith(y)),mrfSimpleSchema=coerceObject({accept:z$1.string().array().catch([]),avatar_removal:z$1.string().array().catch([]),banner_removal:z$1.string().array().catch([]),federated_timeline_removal:z$1.string().array().catch([]),followers_only:z$1.string().array().catch([]),media_nsfw:z$1.string().array().catch([]),media_removal:z$1.string().array().catch([]),reject:z$1.string().array().catch([]),reject_deletes:z$1.string().array().catch([]),report_removal:z$1.string().array().catch([])}),find=(E,y,R)=>E.find(k=>k.isSuperset(Map$1({group:y,key:R}))),toSimplePolicy=E=>{const y=find(E,":pleroma",":mrf_simple"),R=(k,H)=>{const B=H.getIn(["tuple",0]),te=H.getIn(["tuple",1]);return k.set(B.replace(/^:/,""),Set$1(te))};if(y!=null&&y.get){const H=y.get("value",List()).reduce(R,Map$1());return mrfSimpleSchema.parse(H.toJS())}else return mrfSimpleSchema.parse({})},fromSimplePolicy=E=>{const y=([k,H])=>fromJS({tuple:[`:${k}`,H]}),R=Object.entries(E).map(y);return List([Map$1({group:":pleroma",key:":mrf_simple",value:List(R)})])},ConfigDB={find,toSimplePolicy,fromSimplePolicy},shouldFilter=(E,y)=>Map$1({reblog:E.reblog!==null,reply:E.in_reply_to_id!==null,direct:E.visibility==="direct"}).some((k,H)=>y.getIn(["shows",H])===!1&&k),normalizeId=E=>typeof E=="string"?E:"";function selectAccount(E,y){var R;return(R=E.entities[Entities.ACCOUNTS])==null?void 0:R.store[y]}function selectOwnAccount(E){if(E.me)return selectAccount(E,E.me)}const accountIdsToAccts=(E,y)=>y.map(R=>selectAccount(E,R).acct),getAccountBase=(E,y)=>{var R;return(R=E.entities[Entities.ACCOUNTS])==null?void 0:R.store[y]},getAccountRelationship=(E,y)=>E.relationships.get(y),getAccountMeta=(E,y)=>E.accounts_meta[y],makeGetAccount=()=>createSelector([getAccountBase,getAccountRelationship,getAccountMeta],(E,y,R)=>E?{...E,relationship:y,source:(R==null?void 0:R.source)??E.source,pleroma:(R==null?void 0:R.pleroma)??E.pleroma}:null),toServerSideType=E=>{switch(E){case"home":case"notifications":case"public":case"thread":return E;default:return E.includes("list:")?"home":"public"}},getFilters=(E,y)=>E.filters.filter(R=>(!(y!=null&&y.contextType)||R.context.includes(toServerSideType(y.contextType)))&&(R.expires_at===null||Date.parse(R.expires_at)>new Date().getTime())),escapeRegExp=E=>E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),regexFromFilters=E=>E.size===0?null:new RegExp(E.map(y=>y.keywords.map(R=>{let k=escapeRegExp(R.keyword);return R.whole_word&&(/^[\w]/.test(k)&&(k=`\\b${k}`),/[\w]$/.test(k)&&(k=`${k}\\b`)),k}).join("|")).join("|"),"i"),checkFiltered=(E,y)=>y.reduce((R,k)=>R.concat(k.keywords.reduce((H,B)=>{let te=escapeRegExp(B.keyword);return B.whole_word&&(/^[\w]/.test(te)&&(te=`\\b${te}`),/[\w]$/.test(te)&&(te=`${te}\\b`)),new RegExp(te).test(E)?H.concat(k.title):H},List())),List()),makeGetStatus=()=>createSelector([(E,{id:y})=>E.statuses.get(y),(E,{id:y})=>{var R;return E.statuses.get(((R=E.statuses.get(y))==null?void 0:R.reblog)||"")},(E,{username:y})=>y,getFilters,E=>E.me,E=>getFeatures(E.instance)],(E,y,R,k,H,B)=>{if(!E)return null;const{account:te}=E;return!te||te.acct!==R&&R!==void 0?null:E.withMutations(ce=>{if(ce.set("reblog",y||null),B.filters&&te.id!==H){const Ce=checkFiltered((y==null?void 0:y.search_index)||E.search_index,k);ce.set("filtered",Ce)}})}),makeGetNotification=()=>createSelector([(E,y)=>y,(E,y)=>selectAccount(E,normalizeId(y.account)),(E,y)=>selectAccount(E,normalizeId(y.target)),(E,y)=>E.statuses.get(normalizeId(y.status))],(E,y,R,k)=>E.merge({account:y||null,target:R||null,status:k||null})),getAccountGallery=createSelector([(E,y)=>{var R;return((R=E.timelines.get(`account:${y}:media`))==null?void 0:R.items)||OrderedSet()},E=>E.statuses],(E,y)=>E.reduce((R,k)=>{const H=y.get(k);return!H||H.reblog?R:R.concat(H.media_attachments.map(B=>B.merge({status:H,account:H.account})))},List())),getGroupGallery=createSelector([(E,y)=>{var R;return((R=E.timelines.get(`group:${y}:media`))==null?void 0:R.items)||OrderedSet()},E=>E.statuses],(E,y)=>E.reduce((R,k)=>{const H=y.get(k);return!H||H.reblog?R:R.concat(H.media_attachments.map(B=>B.merge({status:H,account:H.account})))},List())),makeGetReport=()=>{const E=makeGetStatus();return createSelector([(y,R)=>y.admin.reports.get(R),(y,R)=>{var k;return selectAccount(y,((k=y.admin.reports.get(R))==null?void 0:k.account)||"")},(y,R)=>{var k;return selectAccount(y,((k=y.admin.reports.get(R))==null?void 0:k.target_account)||"")},(y,R)=>{var k;return List(fromJS((k=y.admin.reports.get(R))==null?void 0:k.statuses)).map(H=>y.statuses.get(normalizeId(H))).filter(H=>H).map(H=>E(y,H.toJS()))}],(y,R,k,H)=>y?y.withMutations(B=>{B.set("account",R),B.set("target_account",k),B.set("statuses",H)}):null)};function makeGetOtherAccounts(){return createSelector([E=>{var y;return(y=E.entities[Entities.ACCOUNTS])==null?void 0:y.store},E=>E.auth.users,E=>E.me],(E,y,R)=>Object.values(y).map(H=>H.id).reduce((H,B)=>{if(B===R)return H;const te=E[B];return te&&H.push(te),H},[]))}const getSimplePolicy=createSelector([E=>E.admin.configs,E=>E.instance.pleroma.metadata.federation.mrf_simple],(E,y)=>({...y,...ConfigDB.toSimplePolicy(E)})),getRemoteInstanceFavicon=(E,y)=>{var H,B,te;const R=((H=E.entities[Entities.ACCOUNTS])==null?void 0:H.store)??{},k=(B=Object.entries(R).find(([ae,ce])=>ce&&getDomain(ce)===y))==null?void 0:B[1];return(te=k==null?void 0:k.pleroma)==null?void 0:te.favicon},getRemoteInstanceFederation=(E,y)=>{const R=getSimplePolicy(E);return Object.fromEntries(Object.entries(R).map(([k,H])=>[k,H.includes(y)]))},makeGetHosts=()=>createSelector([getSimplePolicy],E=>{const{accept:y,reject_deletes:R,report_removal:k,...H}=E;return Object.values(H).reduce((B,te)=>B.union(te),OrderedSet()).sort()}),RemoteInstanceRecord=Record({host:"",favicon:null,federation:null}),makeGetRemoteInstance=()=>createSelector([(E,y)=>y,getRemoteInstanceFavicon,getRemoteInstanceFederation],(E,y,R)=>RemoteInstanceRecord({host:E,favicon:y,federation:R})),makeGetStatusIds=()=>createSelector([(E,{type:y,prefix:R})=>getSettings(E).get(R||y,Map$1()),(E,{type:y})=>{var R;return((R=E.timelines.get(y))==null?void 0:R.items)||OrderedSet()},E=>E.statuses],(E,y,R)=>y.filter(k=>{const H=R.get(k);return H?!shouldFilter(H,E):!0})),useOwnAccount=()=>{const E=reactExports.useCallback(makeGetAccount(),[]);return{account:useAppSelector(R=>{const{me:k}=R;if(typeof k=="string")return E(R,k)})||void 0}};function useApi(){const{account:E}=useOwnAccount(),y=useAppSelector(H=>H.auth.me),R=useAppSelector(H=>{var B;return E?(B=H.auth.users[E.url])==null?void 0:B.access_token:void 0}),k=new URL(BACKEND_URL||(E==null?void 0:E.url)||y||location.origin).origin;return reactExports.useMemo(()=>new MastodonClient(k,R),[k,R])}const screenshotsSchema=z$1.array(z$1.object({form_factor:z$1.enum(["narrow","wide"]).optional(),label:z$1.string().optional(),platform:z$1.enum(["android","chromeos","ipados","ios","kaios","macos","windows","xbox","chrome_web_store","itunes","microsoft-inbox","microsoft-store","play"]).optional(),sizes:z$1.string().refine(E=>E.split(" ").every(y=>/^[1-9]\d{0,3}[xX][1-9]\d{0,3}$/.test(y))).optional(),src:z$1.string().url(),type:z$1.string().optional()})),versionSchema=z$1.string().catch("0.0.0").transform(E=>(new RegExp(/[0-9.]+rc[0-9]+/g).test(E)&&(E=E.split("rc").join("-rc")),E.includes("Akkoma")&&(E="2.7.2 (compatible; Pleroma 2.4.50+akkoma)"),E.startsWith("takahe/")&&(E=`0.0.0 (compatible; Takahe ${E.slice(7)})`),E)),configurationSchema=coerceObject({accounts:coerceObject({max_featured_tags:z$1.number().catch(1/0),max_pinned_statuses:z$1.number().catch(1/0)}),chats:coerceObject({max_characters:z$1.number().catch(1/0),max_media_attachments:z$1.number().catch(1/0)}),groups:coerceObject({max_characters_description:z$1.number().catch(1/0),max_characters_name:z$1.number().catch(1/0)}),media_attachments:coerceObject({image_matrix_limit:z$1.number().optional().catch(void 0),image_size_limit:z$1.number().optional().catch(void 0),supported_mime_types:mimeSchema.array().optional().catch(void 0),video_duration_limit:z$1.number().optional().catch(void 0),video_frame_rate_limit:z$1.number().optional().catch(void 0),video_matrix_limit:z$1.number().optional().catch(void 0),video_size_limit:z$1.number().optional().catch(void 0)}),polls:coerceObject({max_characters_per_option:z$1.number().catch(1/0),max_expiration:z$1.number().catch(1/0),max_options:z$1.number().catch(1/0),min_expiration:z$1.number().catch(1/0)}),reactions:coerceObject({max_reactions:z$1.number().catch(0)}),statuses:coerceObject({characters_reserved_per_url:z$1.number().optional().catch(void 0),max_characters:z$1.number().catch(1/0),max_media_attachments:z$1.number().catch(1/0)}),translation:coerceObject({enabled:z$1.boolean().catch(!1)}),urls:coerceObject({streaming:z$1.string().url().optional().catch(void 0)}),vapid:coerceObject({public_key:z$1.string().optional().catch(void 0)})}),contactSchema=coerceObject({account:accountSchema.optional().catch(void 0),email:z$1.string().email().optional().catch(void 0)}),nostrSchema=coerceObject({pubkey:z$1.string(),relay:z$1.string().url()}),pleromaSchema=coerceObject({metadata:coerceObject({account_activation_required:z$1.boolean().catch(!1),birthday_min_age:z$1.number().catch(0),birthday_required:z$1.boolean().catch(!1),description_limit:z$1.number().catch(1500),features:z$1.string().array().catch([]),federation:coerceObject({enabled:z$1.boolean().catch(!0),mrf_policies:z$1.string().array().optional().catch(void 0),mrf_simple:mrfSimpleSchema}),fields_limits:coerceObject({max_fields:z$1.number().nonnegative().catch(4),name_length:z$1.number().nonnegative().catch(255),value_length:z$1.number().nonnegative().catch(2047)}),migration_cooldown_period:z$1.number().optional().catch(void 0),multitenancy:coerceObject({domains:z$1.array(z$1.object({domain:z$1.coerce.string(),id:z$1.string(),public:z$1.boolean().catch(!1)})).optional(),enabled:z$1.boolean().catch(!1)}),restrict_unauthenticated:coerceObject({activities:coerceObject({local:z$1.boolean().catch(!1),remote:z$1.boolean().catch(!1)}),profiles:coerceObject({local:z$1.boolean().catch(!1),remote:z$1.boolean().catch(!1)}),timelines:coerceObject({federated:z$1.boolean().catch(!1),local:z$1.boolean().catch(!1)})}),translation:coerceObject({allow_remote:z$1.boolean().catch(!0),allow_unauthenticated:z$1.boolean().catch(!1),source_languages:z$1.string().array().optional().catch(void 0),target_languages:z$1.string().array().optional().catch(void 0)})}),oauth_consumer_strategies:z$1.string().array().catch([]),stats:coerceObject({mau:z$1.number().optional().catch(void 0)}),vapid_public_key:z$1.string().catch("")}),registrationsSchema=coerceObject({approval_required:z$1.boolean().catch(!1),enabled:z$1.boolean().catch(!1),message:z$1.string().optional().catch(void 0)}),statsSchema=coerceObject({domain_count:z$1.number().optional().catch(void 0),status_count:z$1.number().optional().catch(void 0),user_count:z$1.number().optional().catch(void 0)}),thumbnailSchema=coerceObject({blurhash:z$1.string().optional().catch(void 0),url:z$1.string().url().optional().catch(void 0),versions:coerceObject({"@1x":z$1.string().url().optional().catch(void 0),"@2x":z$1.string().url().optional().catch(void 0)})}),instanceIconSchema=coerceObject({size:z$1.string().optional().catch(void 0),src:z$1.string().url().optional().catch(void 0)}),usageSchema=coerceObject({users:coerceObject({active_month:z$1.number().optional().catch(void 0)})}),instanceV1Schema=coerceObject({approval_required:z$1.boolean().catch(!1),configuration:configurationSchema,contact_account:accountSchema.optional().catch(void 0),description:z$1.string().catch(""),description_limit:z$1.number().catch(1500),email:z$1.string().email().catch(""),feature_quote:z$1.boolean().catch(!1),fedibird_capabilities:z$1.array(z$1.string()).catch([]),languages:filteredArray(z$1.string()),max_media_attachments:z$1.number().optional().catch(void 0),max_toot_chars:z$1.number().optional().catch(void 0),nostr:nostrSchema.optional().catch(void 0),pleroma:pleromaSchema,registrations:z$1.boolean().catch(!1),rules:filteredArray(ruleSchema),short_description:z$1.string().catch(""),stats:statsSchema,thumbnail:z$1.string().catch(""),title:z$1.string().catch(""),uri:z$1.string().catch(""),urls:coerceObject({streaming_api:z$1.string().url().optional().catch(void 0)}),version:versionSchema}),instanceV2Schema=coerceObject({api_versions:z$1.record(z$1.string(),z$1.number()).catch({}),configuration:configurationSchema,contact:contactSchema,description:z$1.string().catch(""),domain:z$1.string().catch(""),icon:filteredArray(instanceIconSchema),languages:filteredArray(z$1.string()),nostr:nostrSchema.optional().catch(void 0),pleroma:pleromaSchema,registrations:registrationsSchema,rules:filteredArray(ruleSchema),screenshots:screenshotsSchema.catch([]),short_description:z$1.string().catch(""),source_url:z$1.string().url().optional().catch(void 0),thumbnail:thumbnailSchema,title:z$1.string().catch(""),usage:usageSchema,version:versionSchema});function upgradeInstance(E){return{api_versions:{},configuration:E.configuration,contact:{account:E.contact_account,email:E.email},description:E.short_description,domain:E.uri,icon:[],languages:E.languages,nostr:E.nostr,pleroma:E.pleroma,registrations:{approval_required:E.approval_required,enabled:E.registrations},rules:E.rules,screenshots:[],short_description:E.short_description,thumbnail:{url:E.thumbnail,versions:{"@1x":E.thumbnail}},title:E.title,usage:{users:{}},version:E.version}}function useInstanceV1(E={}){const y=useApi(),{baseUrl:R}=E,{data:k,...H}=useQuery({queryKey:["instance",R??y.baseUrl,"v1"],queryFn:async()=>{const te=await(await y.get("/api/v1/instance")).json();return instanceV1Schema.parse(te)},...E});return{instance:k,...H}}function useInstanceV2(E={}){const y=useApi(),{baseUrl:R}=E,{data:k,...H}=useQuery({queryKey:["instance",R??y.baseUrl,"v2"],queryFn:async()=>{const te=await(await y.get("/api/v2/instance")).json();return instanceV2Schema.parse(te)},...E});return{instance:k,...H}}const useAppDispatch=()=>useDispatch();function useInstance(E={}){const{baseUrl:y,retryOnMount:R=!1,staleTime:k=1/0}=E,H=useInstanceV2({baseUrl:y,retryOnMount:R,staleTime:k}),B=useInstanceV1({baseUrl:y,retryOnMount:R,staleTime:k,enabled:H.isError}),te=reactExports.useMemo(()=>H.instance?H.instance:B.instance?upgradeInstance(B.instance):instanceV2Schema.parse({}),[H.instance,B.instance]),ae=H.isError?B:H,ce=ae.error instanceof HTTPError&&ae.error.response.status===404,Ce=useAppDispatch();return reactExports.useEffect(()=>{Ce({type:"instanceV2/fetch/fulfilled",payload:{instance:te}})},[te]),{...ae,instance:te,isNotFound:ce}}const NostrContext=reactExports.createContext(void 0),NostrProvider=({children:E})=>{var ce;const{instance:y}=useInstance(),[R,k]=reactExports.useState(),[H,B]=reactExports.useState(!0),te=(ce=y.nostr)==null?void 0:ce.relay,ae=()=>{B(!1)};return reactExports.useEffect(()=>{if(te){const Ce=new NRelay1(te);Ce.socket.underlyingWebsocket.addEventListener("open",ae),k(Ce)}else B(!1);return()=>{R==null||R.socket.underlyingWebsocket.removeEventListener("open",ae),R==null||R.close()}},[te]),jsxRuntimeExports.jsx(NostrContext.Provider,{value:{relay:R,isRelayLoading:H},children:E})},useNostr=()=>{const E=reactExports.useContext(NostrContext);if(E===void 0)throw new Error("useNostr must be used within a NostrProvider");return E},StatContext=reactExports.createContext({unreadChatsCount:0}),StatProvider=({children:E})=>{const[y,R]=reactExports.useState(0),k=reactExports.useMemo(()=>({unreadChatsCount:y,setUnreadChatsCount:R}),[y]);return jsxRuntimeExports.jsx(StatContext.Provider,{value:k,children:E})},useStatContext=()=>reactExports.useContext(StatContext),PLEROMA_PRELOAD_IMPORT="PLEROMA_PRELOAD_IMPORT",MASTODON_PRELOAD_IMPORT="MASTODON_PRELOAD_IMPORT",decodeUTF8Base64=E=>{const y=atob(E),R=Uint8Array.from(y.split("").map(H=>H.charCodeAt(0)));return new TextDecoder().decode(R)},decodePleromaData=E=>mapValues(E,y=>JSON.parse(decodeUTF8Base64(y))),pleromaDecoder=E=>decodePleromaData(JSON.parse(E)),decodeFromMarkup=(E,y)=>{const{textContent:R}=document.getElementById(E);return y(R)},preloadFromMarkup=(E,y,R)=>k=>{try{const H=decodeFromMarkup(E,y);k(R(H))}catch{}},preload=()=>E=>{E(preloadFromMarkup("initial-results",pleromaDecoder,preloadPleroma)),E(preloadFromMarkup("initial-state",JSON.parse,preloadMastodon))},preloadPleroma=E=>({type:PLEROMA_PRELOAD_IMPORT,data:E}),preloadMastodon=E=>y=>{const{me:R,access_token:k}=E.meta,{url:H}=E.accounts[R];y(importFetchedAccounts(Object.values(E.accounts))),y(verifyCredentials(k,H)),y({type:MASTODON_PRELOAD_IMPORT,data:E})};function formatProdErrorMessage$1(E){return`Minified Redux error #${E}; visit https://redux.js.org/Errors?code=${E} for the full message or use the non-minified dev environment for full errors. `}var $$observable=typeof Symbol=="function"&&Symbol.observable||"@@observable",symbol_observable_default=$$observable,randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject(E){if(typeof E!="object"||E===null)return!1;let y=E;for(;Object.getPrototypeOf(y)!==null;)y=Object.getPrototypeOf(y);return Object.getPrototypeOf(E)===y}function createStore$1(E,y,R){if(typeof E!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof y=="function"&&typeof R=="function"||typeof R=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof y=="function"&&typeof R>"u"&&(R=y,y=void 0),typeof R<"u"){if(typeof R!="function")throw new Error(formatProdErrorMessage$1(1));return R(createStore$1)(E,y)}let k=E,H=y,B=new Map,te=B,ae=0,ce=!1;function Ce(){te===B&&(te=new Map,B.forEach(($e,Be)=>{te.set(Be,$e)}))}function Oe(){if(ce)throw new Error(formatProdErrorMessage$1(3));return H}function Le($e){if(typeof $e!="function")throw new Error(formatProdErrorMessage$1(4));if(ce)throw new Error(formatProdErrorMessage$1(5));let Be=!0;Ce();const Ve=ae++;return te.set(Ve,$e),function(){if(Be){if(ce)throw new Error(formatProdErrorMessage$1(6));Be=!1,Ce(),te.delete(Ve),B=null}}}function Ne($e){if(!isPlainObject($e))throw new Error(formatProdErrorMessage$1(7));if(typeof $e.type>"u")throw new Error(formatProdErrorMessage$1(8));if(typeof $e.type!="string")throw new Error(formatProdErrorMessage$1(17));if(ce)throw new Error(formatProdErrorMessage$1(9));try{ce=!0,H=k(H,$e)}finally{ce=!1}return(B=te).forEach(Ve=>{Ve()}),$e}function Fe($e){if(typeof $e!="function")throw new Error(formatProdErrorMessage$1(10));k=$e,Ne({type:actionTypes_default.REPLACE})}function Ue(){const $e=Le;return{subscribe(Be){if(typeof Be!="object"||Be===null)throw new Error(formatProdErrorMessage$1(11));function Ve(){const st=Be;st.next&&st.next(Oe())}return Ve(),{unsubscribe:$e(Ve)}},[symbol_observable_default](){return this}}}return Ne({type:actionTypes_default.INIT}),{dispatch:Ne,subscribe:Le,getState:Oe,replaceReducer:Fe,[symbol_observable_default]:Ue}}function assertReducerShape(E){Object.keys(E).forEach(y=>{const R=E[y];if(typeof R(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(formatProdErrorMessage$1(12));if(typeof R(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage$1(13))})}function combineReducers(E){const y=Object.keys(E),R={};for(let B=0;B"u")throw ae&&ae.type,new Error(formatProdErrorMessage$1(14));Ce[Le]=Ue,ce=ce||Ue!==Fe}return ce=ce||k.length!==Object.keys(te).length,ce?Ce:te}}function compose$1(...E){return E.length===0?y=>y:E.length===1?E[0]:E.reduce((y,R)=>(...k)=>y(R(...k)))}function applyMiddleware(...E){return y=>(R,k)=>{const H=y(R,k);let B=()=>{throw new Error(formatProdErrorMessage$1(15))};const te={getState:H.getState,dispatch:(ce,...Ce)=>B(ce,...Ce)},ae=E.map(ce=>ce(te));return B=compose$1(...ae)(H.dispatch),{...H,dispatch:B}}}function isAction(E){return isPlainObject(E)&&"type"in E&&typeof E.type=="string"}function createThunkMiddleware(E){return({dispatch:R,getState:k})=>H=>B=>typeof B=="function"?B(R,k,E):H(B)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,createDraftSafeSelectorCreator=(...E)=>{const y=createSelectorCreator(...E);return(...R)=>{const k=y(...R),H=(B,...te)=>k(isDraft(B)?current(B):B,...te);return Object.assign(H,k),H}};createDraftSafeSelectorCreator(weakMapMemoize);var composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose$1:compose$1.apply(null,arguments)},hasMatchFunction=E=>E&&typeof E.match=="function";function createAction(E,y){function R(...k){if(y){let H=y(...k);if(!H)throw new Error(formatProdErrorMessage(0));return{type:E,payload:H.payload,..."meta"in H&&{meta:H.meta},..."error"in H&&{error:H.error}}}return{type:E,payload:k[0]}}return R.toString=()=>`${E}`,R.type=E,R.match=k=>isAction(k)&&k.type===E,R}var Tuple=class da extends Array{constructor(...y){super(...y),Object.setPrototypeOf(this,da.prototype)}static get[Symbol.species](){return da}concat(...y){return super.concat.apply(this,y)}prepend(...y){return y.length===1&&Array.isArray(y[0])?new da(...y[0].concat(this)):new da(...y.concat(this))}};function freezeDraftable(E){return isDraftable(E)?produce(E,()=>{}):E}function emplace(E,y,R){if(E.has(y)){let H=E.get(y);return R.update&&(H=R.update(H,y,E),E.set(y,H)),H}if(!R.insert)throw new Error(formatProdErrorMessage(10));const k=R.insert(y,E);return E.set(y,k),k}function isBoolean(E){return typeof E=="boolean"}var buildGetDefaultMiddleware=()=>function(y){const{thunk:R=!0,immutableCheck:k=!0,serializableCheck:H=!0,actionCreatorCheck:B=!0}=y??{};let te=new Tuple;return R&&(isBoolean(R)?te.push(thunk):te.push(withExtraArgument(R.extraArgument))),te},SHOULD_AUTOBATCH="RTK_autoBatch",createQueueWithTimer=E=>y=>{setTimeout(y,E)},rAF=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:createQueueWithTimer(10),autoBatchEnhancer=(E={type:"raf"})=>y=>(...R)=>{const k=y(...R);let H=!0,B=!1,te=!1;const ae=new Set,ce=E.type==="tick"?queueMicrotask:E.type==="raf"?rAF:E.type==="callback"?E.queueNotification:createQueueWithTimer(E.timeout),Ce=()=>{te=!1,B&&(B=!1,ae.forEach(Oe=>Oe()))};return Object.assign({},k,{subscribe(Oe){const Le=()=>H&&Oe(),Ne=k.subscribe(Le);return ae.add(Oe),()=>{Ne(),ae.delete(Oe)}},dispatch(Oe){var Le;try{return H=!((Le=Oe==null?void 0:Oe.meta)!=null&&Le[SHOULD_AUTOBATCH]),B=!H,B&&(te||(te=!0,ce(Ce))),k.dispatch(Oe)}finally{H=!0}}})},buildGetDefaultEnhancers=E=>function(R){const{autoBatch:k=!0}=R??{};let H=new Tuple(E);return k&&H.push(autoBatchEnhancer(typeof k=="object"?k:void 0)),H},IS_PRODUCTION=!0;function configureStore(E){const y=buildGetDefaultMiddleware(),{reducer:R=void 0,middleware:k,devTools:H=!0,preloadedState:B=void 0,enhancers:te=void 0}=E||{};let ae;if(typeof R=="function")ae=R;else if(isPlainObject(R))ae=combineReducers(R);else throw new Error(formatProdErrorMessage(1));let ce;typeof k=="function"?ce=k(y):ce=y();let Ce=compose$1;H&&(Ce=composeWithDevTools({trace:!IS_PRODUCTION,...typeof H=="object"&&H}));const Oe=applyMiddleware(...ce),Le=buildGetDefaultEnhancers(Oe);let Ne=typeof te=="function"?te(Le):Le();const Fe=Ce(...Ne);return createStore$1(ae,B,Fe)}function executeReducerBuilderCallback(E){const y={},R=[];let k;const H={addCase(B,te){const ae=typeof B=="string"?B:B.type;if(!ae)throw new Error(formatProdErrorMessage(28));if(ae in y)throw new Error(formatProdErrorMessage(29));return y[ae]=te,H},addMatcher(B,te){return R.push({matcher:B,reducer:te}),H},addDefaultCase(B){return k=B,H}};return E(H),[y,R,k]}function isStateFunction(E){return typeof E=="function"}function createReducer(E,y){let[R,k,H]=executeReducerBuilderCallback(y),B;if(isStateFunction(E))B=()=>freezeDraftable(E());else{const ae=freezeDraftable(E);B=()=>ae}function te(ae=B(),ce){let Ce=[R[ce.type],...k.filter(({matcher:Oe})=>Oe(ce)).map(({reducer:Oe})=>Oe)];return Ce.filter(Oe=>!!Oe).length===0&&(Ce=[H]),Ce.reduce((Oe,Le)=>{if(Le)if(isDraft(Oe)){const Fe=Le(Oe,ce);return Fe===void 0?Oe:Fe}else{if(isDraftable(Oe))return produce(Oe,Ne=>Le(Ne,ce));{const Ne=Le(Oe,ce);if(Ne===void 0){if(Oe===null)return Oe;throw new Error(formatProdErrorMessage(9))}return Ne}}return Oe},ae)}return te.getInitialState=B,te}var urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",nanoid=(E=21)=>{let y="",R=E;for(;R--;)y+=urlAlphabet[Math.random()*64|0];return y},matches=(E,y)=>hasMatchFunction(E)?E.match(y):E(y);function isAnyOf(...E){return y=>E.some(R=>matches(R,y))}var commonProperties=["name","message","stack","code"],RejectWithValue=class{constructor(E,y){Jt(this,"_type");this.payload=E,this.meta=y}},FulfillWithMeta=class{constructor(E,y){Jt(this,"_type");this.payload=E,this.meta=y}},miniSerializeError=E=>{if(typeof E=="object"&&E!==null){const y={};for(const R of commonProperties)typeof E[R]=="string"&&(y[R]=E[R]);return y}return{message:String(E)}},createAsyncThunk=(()=>{function E(y,R,k){const H=createAction(y+"/fulfilled",(ce,Ce,Oe,Le)=>({payload:ce,meta:{...Le||{},arg:Oe,requestId:Ce,requestStatus:"fulfilled"}})),B=createAction(y+"/pending",(ce,Ce,Oe)=>({payload:void 0,meta:{...Oe||{},arg:Ce,requestId:ce,requestStatus:"pending"}})),te=createAction(y+"/rejected",(ce,Ce,Oe,Le,Ne)=>({payload:Le,error:(k&&k.serializeError||miniSerializeError)(ce||"Rejected"),meta:{...Ne||{},arg:Oe,requestId:Ce,rejectedWithValue:!!Le,requestStatus:"rejected",aborted:(ce==null?void 0:ce.name)==="AbortError",condition:(ce==null?void 0:ce.name)==="ConditionError"}}));function ae(ce){return(Ce,Oe,Le)=>{const Ne=k!=null&&k.idGenerator?k.idGenerator(ce):nanoid(),Fe=new AbortController;let Ue;function De(Be){Ue=Be,Fe.abort()}const $e=async function(){var Ke,st;let Be;try{let We=(Ke=k==null?void 0:k.condition)==null?void 0:Ke.call(k,ce,{getState:Oe,extra:Le});if(isThenable(We)&&(We=await We),We===!1||Fe.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const at=new Promise((tt,ft)=>Fe.signal.addEventListener("abort",()=>ft({name:"AbortError",message:Ue||"Aborted"})));Ce(B(Ne,ce,(st=k==null?void 0:k.getPendingMeta)==null?void 0:st.call(k,{requestId:Ne,arg:ce},{getState:Oe,extra:Le}))),Be=await Promise.race([at,Promise.resolve(R(ce,{dispatch:Ce,getState:Oe,extra:Le,requestId:Ne,signal:Fe.signal,abort:De,rejectWithValue:(tt,ft)=>new RejectWithValue(tt,ft),fulfillWithValue:(tt,ft)=>new FulfillWithMeta(tt,ft)})).then(tt=>{if(tt instanceof RejectWithValue)throw tt;return tt instanceof FulfillWithMeta?H(tt.payload,Ne,ce,tt.meta):H(tt,Ne,ce)})])}catch(We){Be=We instanceof RejectWithValue?te(null,Ne,ce,We.payload,We.meta):te(We,Ne,ce)}return k&&!k.dispatchConditionRejection&&te.match(Be)&&Be.meta.condition||Ce(Be),Be}();return Object.assign($e,{abort:De,requestId:Ne,arg:ce,unwrap(){return $e.then(unwrapResult)}})}}return Object.assign(ae,{pending:B,rejected:te,fulfilled:H,settled:isAnyOf(te,H),typePrefix:y})}return E.withTypes=()=>E,E})();function unwrapResult(E){if(E.meta&&E.meta.rejectedWithValue)throw E.payload;if(E.error)throw E.error;return E.payload}function isThenable(E){return E!==null&&typeof E=="object"&&typeof E.then=="function"}var asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType$1(E,y){return`${E}/${y}`}function buildCreateSlice({creators:E}={}){var R;const y=(R=E==null?void 0:E.asyncThunk)==null?void 0:R[asyncThunkSymbol];return function(H){const{name:B,reducerPath:te=B}=H;if(!B)throw new Error(formatProdErrorMessage(11));typeof process<"u";const ae=(typeof H.reducers=="function"?H.reducers(buildReducerCreators()):H.reducers)||{},ce=Object.keys(ae),Ce={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},Oe={addCase($e,Be){const Ve=typeof $e=="string"?$e:$e.type;if(!Ve)throw new Error(formatProdErrorMessage(12));if(Ve in Ce.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return Ce.sliceCaseReducersByType[Ve]=Be,Oe},addMatcher($e,Be){return Ce.sliceMatchers.push({matcher:$e,reducer:Be}),Oe},exposeAction($e,Be){return Ce.actionCreators[$e]=Be,Oe},exposeCaseReducer($e,Be){return Ce.sliceCaseReducersByName[$e]=Be,Oe}};ce.forEach($e=>{const Be=ae[$e],Ve={reducerName:$e,type:getType$1(B,$e),createNotation:typeof H.reducers=="function"};isAsyncThunkSliceReducerDefinition(Be)?handleThunkCaseReducerDefinition(Ve,Be,Oe,y):handleNormalReducerDefinition(Ve,Be,Oe)});function Le(){const[$e={},Be=[],Ve=void 0]=typeof H.extraReducers=="function"?executeReducerBuilderCallback(H.extraReducers):[H.extraReducers],Ke={...$e,...Ce.sliceCaseReducersByType};return createReducer(H.initialState,st=>{for(let We in Ke)st.addCase(We,Ke[We]);for(let We of Ce.sliceMatchers)st.addMatcher(We.matcher,We.reducer);for(let We of Be)st.addMatcher(We.matcher,We.reducer);Ve&&st.addDefaultCase(Ve)})}const Ne=$e=>$e,Fe=new WeakMap;let Ue;const De={name:B,reducerPath:te,reducer($e,Be){return Ue||(Ue=Le()),Ue($e,Be)},actions:Ce.actionCreators,caseReducers:Ce.sliceCaseReducersByName,getInitialState(){return Ue||(Ue=Le()),Ue.getInitialState()},getSelectors($e=Ne){const Be=emplace(Fe,this,{insert:()=>new WeakMap});return emplace(Be,$e,{insert:()=>{const Ve={};for(const[Ke,st]of Object.entries(H.selectors??{}))Ve[Ke]=wrapSelector(this,st,$e,this!==De);return Ve}})},selectSlice($e){let Be=$e[this.reducerPath];return typeof Be>"u"&&this!==De&&(Be=this.getInitialState()),Be},get selectors(){return this.getSelectors(this.selectSlice)},injectInto($e,{reducerPath:Be,...Ve}={}){const Ke=Be??this.reducerPath;return $e.inject({reducerPath:Ke,reducer:this.reducer},Ve),{...this,reducerPath:Ke}}};return De}}function wrapSelector(E,y,R,k){function H(B,...te){let ae=R.call(E,B);return typeof ae>"u"&&k&&(ae=E.getInitialState()),y(ae,...te)}return H.unwrapped=y,H}var createSlice=buildCreateSlice();function buildReducerCreators(){function E(y,R){return{_reducerDefinitionType:"asyncThunk",payloadCreator:y,...R}}return E.withTypes=()=>E,{reducer(y){return Object.assign({[y.name](...R){return y(...R)}}[y.name],{_reducerDefinitionType:"reducer"})},preparedReducer(y,R){return{_reducerDefinitionType:"reducerWithPrepare",prepare:y,reducer:R}},asyncThunk:E}}function handleNormalReducerDefinition({type:E,reducerName:y,createNotation:R},k,H){let B,te;if("reducer"in k){if(R&&!isCaseReducerWithPrepareDefinition(k))throw new Error(formatProdErrorMessage(17));B=k.reducer,te=k.prepare}else B=k;H.addCase(E,B).exposeCaseReducer(y,B).exposeAction(y,te?createAction(E,te):createAction(E))}function isAsyncThunkSliceReducerDefinition(E){return E._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(E){return E._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:E,reducerName:y},R,k,H){if(!H)throw new Error(formatProdErrorMessage(18));const{payloadCreator:B,fulfilled:te,pending:ae,rejected:ce,settled:Ce,options:Oe}=R,Le=H(E,B,Oe);k.exposeAction(y,Le),te&&k.addCase(Le.fulfilled,te),ae&&k.addCase(Le.pending,ae),ce&&k.addCase(Le.rejected,ce),Ce&&k.addMatcher(Le.settled,Ce),k.exposeCaseReducer(y,{fulfilled:te||noop,pending:ae||noop,rejected:ce||noop,settled:Ce||noop})}function noop(){}var alm="listenerMiddleware";createAction(`${alm}/add`);createAction(`${alm}/removeAll`);createAction(`${alm}/remove`);function formatProdErrorMessage(E){return`Minified Redux Toolkit error #${E}; visit https://redux-toolkit.js.org/Errors?code=${E} for the full message or use the non-minified dev environment for full errors. `}const isFailType=E=>E.endsWith("_FAIL"),isRememberFailType=E=>E.endsWith("_REMEMBER_FAIL"),hasResponse=E=>E instanceof HTTPError,authorized=E=>E instanceof HTTPError&&E.response.status!==401,shouldShowError=({type:E,skipAlert:y,error:R})=>!y&&hasResponse(R)&&authorized(R)&&isFailType(E)&&!isRememberFailType(E),errorsMiddleware=()=>()=>E=>y=>{const R=y;return shouldShowError(R)&&toast.showAlertForError(R.error),E(R)},boopMp3="/packs/assets/boop-Dl59frXS.mp3",boopOgg="/packs/assets/boop-jD5jYDdg.ogg",chatMp3="/packs/assets/chat-vn22abW9.mp3",chatOgg="/packs/assets/chat-C-vlioh6.ogg",createAudio=E=>{const y=new Audio;return E.forEach(({type:R,src:k})=>{const H=document.createElement("source");H.type=R,H.src=k,y.appendChild(H)}),y},play=E=>(E.paused||(E.pause(),typeof E.fastSeek=="function"?E.fastSeek(0):E.currentTime=0),E.play().catch(y=>{if(y.name!=="NotAllowedError")throw y})),soundCache={boop:createAudio([{src:boopOgg,type:"audio/ogg"},{src:boopMp3,type:"audio/mpeg"}]),chat:createAudio([{src:chatOgg,type:"audio/ogg"},{src:chatMp3,type:"audio/mpeg"}])};function soundsMiddleware(){return()=>E=>y=>{var k;const R=y;return(k=R.meta)!=null&&k.sound&&soundCache[R.meta.sound]&&play(soundCache[R.meta.sound]),E(R)}}const updateStore=(E,y)=>y.reduce((R,k)=>(R[k.id]=k,R),{...E}),updateList$2=(E,y,R="end")=>{const k=y.map(te=>te.id),H=Array.from(E.ids),B=new Set(R==="start"?[...k,...H]:[...H,...k]);if(typeof E.state.totalCount=="number"){const te=B.size-E.ids.size;E.state.totalCount+=te}return{...E,ids:B}},createCache=()=>({store:{},lists:{}}),createList$1=()=>({ids:new Set,state:createListState()}),createListState=()=>({next:void 0,prev:void 0,totalCount:0,error:null,fetched:!1,fetching:!1,lastFetchedAt:void 0,invalid:!1}),importEntities=(E,y,R,k,H,B,te=!1)=>produce(E,ae=>{const ce=ae[y]??createCache();if(ce.store=updateStore(ce.store,R),typeof k=="string"){let Ce=ce.lists[k]??createList$1();te&&(Ce.ids=new Set),Ce=updateList$2(Ce,R,H),B&&(Ce.state=B),ce.lists[k]=Ce}ae[y]=ce}),deleteEntities=(E,y,R,k)=>produce(E,H=>{const B=H[y]??createCache();for(const te of R)if(delete B.store[te],!(k!=null&&k.preserveLists))for(const ae of Object.values(B.lists))ae&&(ae.ids.delete(te),typeof ae.state.totalCount=="number"&&ae.state.totalCount--);H[y]=B}),dismissEntities=(E,y,R,k)=>produce(E,H=>{const B=H[y]??createCache(),te=B.lists[k];if(te){for(const ae of R)te.ids.delete(ae),typeof te.state.totalCount=="number"&&te.state.totalCount--;H[y]=B}}),incrementEntities=(E,y,R,k)=>produce(E,H=>{var ae;const B=H[y]??createCache(),te=B.lists[R];typeof((ae=te==null?void 0:te.state)==null?void 0:ae.totalCount)=="number"&&(te.state.totalCount+=k,H[y]=B)}),setFetching=(E,y,R,k,H)=>produce(E,B=>{const te=B[y]??createCache();if(typeof R=="string"){const ae=te.lists[R]??createList$1();ae.state.fetching=k,ae.state.error=H,te.lists[R]=ae}B[y]=te}),invalidateEntityList=(E,y,R)=>produce(E,k=>{const B=(k[y]??createCache()).lists[R]??createList$1();B.state.invalid=!0}),doTransaction=(E,y)=>produce(E,R=>{for(const[k,H]of Object.entries(y)){const B=R[k]??createCache();for(const[te,ae]of Object.entries(H)){const ce=B.store[te];ce&&(B.store[te]=ae(ce))}}});function reducer$1(E={},y){switch(y.type){case ENTITIES_IMPORT:return importEntities(E,y.entityType,y.entities,y.listKey,y.pos);case ENTITIES_DELETE:return deleteEntities(E,y.entityType,y.ids,y.opts);case ENTITIES_DISMISS:return dismissEntities(E,y.entityType,y.ids,y.listKey);case ENTITIES_INCREMENT:return incrementEntities(E,y.entityType,y.listKey,y.diff);case ENTITIES_FETCH_SUCCESS:return importEntities(E,y.entityType,y.entities,y.listKey,y.pos,y.newState,y.overwrite);case ENTITIES_FETCH_REQUEST:return setFetching(E,y.entityType,y.listKey,!0);case ENTITIES_FETCH_FAIL:return setFetching(E,y.entityType,y.listKey,!1,y.error);case ENTITIES_INVALIDATE_LIST:return invalidateEntityList(E,y.entityType,y.listKey);case ENTITIES_TRANSACTION:return doTransaction(E,y.transaction);default:return E}}function importAccount$1(E,y){const R=accountSchema.safeParse(y);if(!R.success)return E;const k=R.data;return produce(E,H=>{const B=H[k.id];H[k.id]={pleroma:k.pleroma??(B==null?void 0:B.pleroma),source:k.source??(B==null?void 0:B.source)}})}function accounts_meta(E={},y){switch(y.type){case ME_FETCH_SUCCESS:case ME_PATCH_SUCCESS:return importAccount$1(E,y.me);case VERIFY_CREDENTIALS_SUCCESS:case AUTH_ACCOUNT_REMEMBER_SUCCESS:return importAccount$1(E,y.account);default:return E}}const tagToBadge=E=>`badge:${E}`,badgeToTag=E=>E.replace(/^badge:/,""),getTagDiff=(E,y)=>{const R=OrderedSet(E),k=OrderedSet(y);return{added:k.subtract(R).toArray(),removed:R.subtract(k).toArray()}},filterBadges=E=>E.filter(y=>y.startsWith("badge:")),getBadges=E=>{var R;const y=((R=E==null?void 0:E.pleroma)==null?void 0:R.tags)??[];return filterBadges(y)},ADMIN_CONFIG_FETCH_REQUEST="ADMIN_CONFIG_FETCH_REQUEST",ADMIN_CONFIG_FETCH_SUCCESS="ADMIN_CONFIG_FETCH_SUCCESS",ADMIN_CONFIG_FETCH_FAIL="ADMIN_CONFIG_FETCH_FAIL",ADMIN_CONFIG_UPDATE_REQUEST="ADMIN_CONFIG_UPDATE_REQUEST",ADMIN_CONFIG_UPDATE_SUCCESS="ADMIN_CONFIG_UPDATE_SUCCESS",ADMIN_CONFIG_UPDATE_FAIL="ADMIN_CONFIG_UPDATE_FAIL",ADMIN_REPORTS_FETCH_REQUEST="ADMIN_REPORTS_FETCH_REQUEST",ADMIN_REPORTS_FETCH_SUCCESS="ADMIN_REPORTS_FETCH_SUCCESS",ADMIN_REPORTS_FETCH_FAIL="ADMIN_REPORTS_FETCH_FAIL",ADMIN_REPORTS_PATCH_REQUEST="ADMIN_REPORTS_PATCH_REQUEST",ADMIN_REPORTS_PATCH_SUCCESS="ADMIN_REPORTS_PATCH_SUCCESS",ADMIN_REPORTS_PATCH_FAIL="ADMIN_REPORTS_PATCH_FAIL",ADMIN_USERS_FETCH_REQUEST="ADMIN_USERS_FETCH_REQUEST",ADMIN_USERS_FETCH_SUCCESS="ADMIN_USERS_FETCH_SUCCESS",ADMIN_USERS_FETCH_FAIL="ADMIN_USERS_FETCH_FAIL",ADMIN_USERS_DELETE_REQUEST="ADMIN_USERS_DELETE_REQUEST",ADMIN_USERS_DELETE_SUCCESS="ADMIN_USERS_DELETE_SUCCESS",ADMIN_USERS_DELETE_FAIL="ADMIN_USERS_DELETE_FAIL",ADMIN_USERS_APPROVE_REQUEST="ADMIN_USERS_APPROVE_REQUEST",ADMIN_USERS_APPROVE_SUCCESS="ADMIN_USERS_APPROVE_SUCCESS",ADMIN_USERS_APPROVE_FAIL="ADMIN_USERS_APPROVE_FAIL",ADMIN_USERS_REJECT_REQUEST="ADMIN_USERS_REJECT_REQUEST",ADMIN_USERS_REJECT_SUCCESS="ADMIN_USERS_REJECT_SUCCESS",ADMIN_USERS_REJECT_FAIL="ADMIN_USERS_REJECT_FAIL",ADMIN_USERS_DEACTIVATE_SUCCESS="ADMIN_USERS_DEACTIVATE_SUCCESS",ADMIN_USERS_DEACTIVATE_FAIL="ADMIN_USERS_DEACTIVATE_FAIL",ADMIN_STATUS_DELETE_REQUEST="ADMIN_STATUS_DELETE_REQUEST",ADMIN_STATUS_DELETE_SUCCESS="ADMIN_STATUS_DELETE_SUCCESS",ADMIN_STATUS_DELETE_FAIL="ADMIN_STATUS_DELETE_FAIL",ADMIN_STATUS_TOGGLE_SENSITIVITY_REQUEST="ADMIN_STATUS_TOGGLE_SENSITIVITY_REQUEST",ADMIN_STATUS_TOGGLE_SENSITIVITY_SUCCESS="ADMIN_STATUS_TOGGLE_SENSITIVITY_SUCCESS",ADMIN_STATUS_TOGGLE_SENSITIVITY_FAIL="ADMIN_STATUS_TOGGLE_SENSITIVITY_FAIL",ADMIN_USERS_TAG_REQUEST="ADMIN_USERS_TAG_REQUEST",ADMIN_USERS_TAG_SUCCESS="ADMIN_USERS_TAG_SUCCESS",ADMIN_USERS_TAG_FAIL="ADMIN_USERS_TAG_FAIL",ADMIN_USERS_UNTAG_REQUEST="ADMIN_USERS_UNTAG_REQUEST",ADMIN_USERS_UNTAG_SUCCESS="ADMIN_USERS_UNTAG_SUCCESS",ADMIN_USERS_UNTAG_FAIL="ADMIN_USERS_UNTAG_FAIL",ADMIN_ADD_PERMISSION_GROUP_REQUEST="ADMIN_ADD_PERMISSION_GROUP_REQUEST",ADMIN_ADD_PERMISSION_GROUP_SUCCESS="ADMIN_ADD_PERMISSION_GROUP_SUCCESS",ADMIN_ADD_PERMISSION_GROUP_FAIL="ADMIN_ADD_PERMISSION_GROUP_FAIL",ADMIN_REMOVE_PERMISSION_GROUP_REQUEST="ADMIN_REMOVE_PERMISSION_GROUP_REQUEST",ADMIN_REMOVE_PERMISSION_GROUP_SUCCESS="ADMIN_REMOVE_PERMISSION_GROUP_SUCCESS",ADMIN_REMOVE_PERMISSION_GROUP_FAIL="ADMIN_REMOVE_PERMISSION_GROUP_FAIL",fetchConfig=()=>(E,y)=>(E({type:ADMIN_CONFIG_FETCH_REQUEST}),api(y).get("/api/v1/pleroma/admin/config").then(R=>R.json()).then(R=>{E({type:ADMIN_CONFIG_FETCH_SUCCESS,configs:R.configs,needsReboot:R.need_reboot})}).catch(R=>{E({type:ADMIN_CONFIG_FETCH_FAIL,error:R})})),updateConfig=E=>(y,R)=>(y({type:ADMIN_CONFIG_UPDATE_REQUEST,configs:E}),api(R).post("/api/v1/pleroma/admin/config",{configs:E}).then(k=>k.json()).then(k=>{y({type:ADMIN_CONFIG_UPDATE_SUCCESS,configs:k.configs,needsReboot:k.need_reboot})}).catch(k=>{y({type:ADMIN_CONFIG_UPDATE_FAIL,error:k,configs:E})})),updateSoapboxConfig=E=>(y,R)=>y(updateConfig([{group:":pleroma",key:":frontend_configurations",value:[{tuple:[":soapbox_fe",E]}]}]));function fetchReports(E={}){return async(y,R)=>{y({type:ADMIN_REPORTS_FETCH_REQUEST,params:E});try{const H=await(await api(R).get("/api/v1/admin/reports",{searchParams:E})).json();H.forEach(B=>{var te,ae;y(importFetchedAccount$1((te=B.account)==null?void 0:te.account)),y(importFetchedAccount$1((ae=B.target_account)==null?void 0:ae.account)),y(importFetchedStatuses(B.statuses))}),y({type:ADMIN_REPORTS_FETCH_SUCCESS,reports:H,params:E})}catch(k){y({type:ADMIN_REPORTS_FETCH_FAIL,error:k,params:E})}}}function patchReports(E,y){return(R,k)=>{const H=E.map(B=>({id:B,state:y}));return R({type:ADMIN_REPORTS_PATCH_REQUEST,reports:H}),Promise.all(H.map(async({id:B,state:te})=>{try{await api(k).post(`/api/v1/admin/reports/${B}/${te==="resolved"?"reopen":"resolve"}`),R({type:ADMIN_REPORTS_PATCH_SUCCESS,reports:H})}catch(ae){R({type:ADMIN_REPORTS_PATCH_FAIL,error:ae,reports:H})}}))}}function closeReports(E){return patchReports(E,"closed")}function fetchUsers(E,y=1,R,k=50,H){return async(B,te)=>{B({type:ADMIN_USERS_FETCH_REQUEST,filters:E,page:y,pageSize:k});const ae={...E,username:R};try{const ce=await api(te).get(H||"/api/v1/admin/accounts",{searchParams:ae}),Ce=await ce.json(),Oe=ce.next();return B(importFetchedAccounts(Ce.map(({account:Le})=>Le))),B(fetchRelationships(Ce.map(Le=>Le.id))),B({type:ADMIN_USERS_FETCH_SUCCESS,accounts:Ce,pageSize:k,filters:E,page:y,next:Oe}),{accounts:Ce,next:Oe}}catch(ce){return B({type:ADMIN_USERS_FETCH_FAIL,error:ce,filters:E,page:y,pageSize:k})}}}function revokeName(E,y){return(R,k)=>{const H={type:"revoke_name",report_id:y};return api(k).post(`/api/v1/admin/accounts/${E}/action`,H)}}function deactivateUsers(E,y){return(R,k)=>Promise.all(E.map(async H=>{const B={type:"disable",report_id:y};try{await api(k).post(`/api/v1/admin/accounts/${H}/action`,B),R({type:ADMIN_USERS_DEACTIVATE_SUCCESS,accountIds:[H]})}catch(te){R({type:ADMIN_USERS_DEACTIVATE_FAIL,error:te,accountIds:[H]})}}))}const deleteUser$2=E=>(y,R)=>{const k=accountIdsToAccts(R(),[E]);return y({type:ADMIN_USERS_DELETE_REQUEST,accountId:E}),api(R).request("DELETE","/api/v1/pleroma/admin/users",{nicknames:k}).then(H=>H.json()).then(({nicknames:H})=>{y({type:ADMIN_USERS_DELETE_SUCCESS,nicknames:H,accountId:E})}).catch(H=>{y({type:ADMIN_USERS_DELETE_FAIL,error:H,accountId:E})})};function approveUser$1(E){return async(y,R)=>{y({type:ADMIN_USERS_APPROVE_REQUEST,accountId:E});try{const{user:k}=await api(R).post(`/api/v1/admin/accounts/${E}/approve`).then(H=>H.json());y({type:ADMIN_USERS_APPROVE_SUCCESS,user:k,accountId:E})}catch(k){y({type:ADMIN_USERS_APPROVE_FAIL,error:k,accountId:E})}}}function rejectUser(E){return async(y,R)=>{y({type:ADMIN_USERS_REJECT_REQUEST,accountId:E});try{const{user:k}=await api(R).post(`/api/v1/admin/accounts/${E}/reject`).then(H=>H.json());y({type:ADMIN_USERS_REJECT_SUCCESS,user:k,accountId:E})}catch(k){y({type:ADMIN_USERS_REJECT_FAIL,error:k,accountId:E})}}}const deleteStatus$6=E=>(y,R)=>(y({type:ADMIN_STATUS_DELETE_REQUEST,id:E}),api(R).delete(`/api/v1/pleroma/admin/statuses/${E}`).then(()=>{y({type:ADMIN_STATUS_DELETE_SUCCESS,id:E})}).catch(k=>{y({type:ADMIN_STATUS_DELETE_FAIL,error:k,id:E})})),toggleStatusSensitivity=(E,y)=>(R,k)=>(R({type:ADMIN_STATUS_TOGGLE_SENSITIVITY_REQUEST,id:E}),api(k).put(`/api/v1/pleroma/admin/statuses/${E}`,{sensitive:!y}).then(()=>{R({type:ADMIN_STATUS_TOGGLE_SENSITIVITY_SUCCESS,id:E})}).catch(H=>{R({type:ADMIN_STATUS_TOGGLE_SENSITIVITY_FAIL,error:H,id:E})})),tagUsers=(E,y)=>(R,k)=>{const H=accountIdsToAccts(k(),E);return R({type:ADMIN_USERS_TAG_REQUEST,accountIds:E,tags:y}),api(k).put("/api/v1/pleroma/admin/users/tag",{nicknames:H,tags:y}).then(()=>{R({type:ADMIN_USERS_TAG_SUCCESS,accountIds:E,tags:y})}).catch(B=>{R({type:ADMIN_USERS_TAG_FAIL,error:B,accountIds:E,tags:y})})},untagUsers=(E,y)=>(R,k)=>{const H=accountIdsToAccts(k(),E);return y.includes("badge:donor")&&(y=[...y,"donor"]),R({type:ADMIN_USERS_UNTAG_REQUEST,accountIds:E,tags:y}),api(k).request("DELETE","/api/v1/pleroma/admin/users/tag",{nicknames:H,tags:y}).then(()=>{R({type:ADMIN_USERS_UNTAG_SUCCESS,accountIds:E,tags:y})}).catch(B=>{R({type:ADMIN_USERS_UNTAG_FAIL,error:B,accountIds:E,tags:y})})},setTags=(E,y,R)=>async k=>{const H=getTagDiff(y,R);await k(tagUsers([E],H.added)),await k(untagUsers([E],H.removed))},setBadges=(E,y,R)=>k=>{const H=filterBadges(y),B=filterBadges(R);return k(setTags(E,H,B))},addPermission=(E,y)=>(R,k)=>{const H=accountIdsToAccts(k(),E);return R({type:ADMIN_ADD_PERMISSION_GROUP_REQUEST,accountIds:E,permissionGroup:y}),api(k).post(`/api/v1/pleroma/admin/users/permission_group/${y}`,{nicknames:H}).then(B=>B.json()).then(B=>{R({type:ADMIN_ADD_PERMISSION_GROUP_SUCCESS,accountIds:E,permissionGroup:y,data:B})}).catch(B=>{R({type:ADMIN_ADD_PERMISSION_GROUP_FAIL,error:B,accountIds:E,permissionGroup:y})})},removePermission=(E,y)=>(R,k)=>{const H=accountIdsToAccts(k(),E);return R({type:ADMIN_REMOVE_PERMISSION_GROUP_REQUEST,accountIds:E,permissionGroup:y}),api(k).request("DELETE",`/api/v1/pleroma/admin/users/permission_group/${y}`,{nicknames:H}).then(B=>B.json()).then(B=>{R({type:ADMIN_REMOVE_PERMISSION_GROUP_SUCCESS,accountIds:E,permissionGroup:y,data:B})}).catch(B=>{R({type:ADMIN_REMOVE_PERMISSION_GROUP_FAIL,error:B,accountIds:E,permissionGroup:y})})},promoteToAdmin=E=>y=>Promise.all([y(addPermission([E],"admin")),y(removePermission([E],"moderator"))]),promoteToModerator=E=>y=>Promise.all([y(removePermission([E],"admin")),y(addPermission([E],"moderator"))]),demoteToUser=E=>y=>Promise.all([y(removePermission([E],"admin")),y(removePermission([E],"moderator"))]),setRole=(E,y)=>R=>{switch(y){case"user":return R(demoteToUser(E));case"moderator":return R(promoteToModerator(E));case"admin":return R(promoteToAdmin(E))}},ReducerRecord$p=Record({reports:Map$1(),openReports:OrderedSet(),users:Map$1(),latestUsers:OrderedSet(),awaitingApproval:OrderedSet(),configs:List(),needsReboot:!1}),toIds$2=E=>E.map(y=>y.id),mergeSet=(E,y,R)=>{const k=toIds$2(R);return E.update(y,H=>H.union(k))},replaceSet=(E,y,R)=>{const k=toIds$2(R);return E.set(y,OrderedSet(k))},maybeImportUnapproved=(E,y,R)=>R.pending?mergeSet(E,"awaitingApproval",y):E,maybeImportLatest=(E,y,R,k)=>k===1&&!R.pending?replaceSet(E,"latestUsers",y):E,minifyUser=E=>E.mergeWith((y,R)=>R||y,{account:normalizeId$1(E.getIn(["account","id"]))}),fixUser=E=>normalizeAdminAccount(E).withMutations(y=>{minifyUser(y)});function importUsers(E,y,R,k){return E.withMutations(H=>{maybeImportUnapproved(H,y,R),maybeImportLatest(H,y,R,k),y.forEach(B=>{const te=fixUser(B);H.setIn(["users",B.id],te)})})}function deleteUser$1(E,y){return E.withMutations(R=>{R.update("awaitingApproval",k=>k.delete(y)),R.deleteIn(["users",y])})}function approveUser(E,y){const R=fixUser(y);return E.withMutations(k=>{k.update("awaitingApproval",H=>H.delete(y.id)),k.setIn(["users",y.id],R)})}const minifyReport=E=>E.mergeWith((y,R)=>R||y,{account:normalizeId$1(E.getIn(["account","id"])),target_account:normalizeId$1(E.getIn(["target_account","id"])),action_taken_by_account:normalizeId$1(E.getIn(["action_taken_by_account","id"])),assigned_account:normalizeId$1(E.getIn(["assigned_account","id"])),statuses:E.get("statuses").map(y=>normalizeId$1(y.get("id")))}),fixReport=E=>normalizeAdminReport(E).withMutations(y=>{minifyReport(y)});function importReports(E,y){return E.withMutations(R=>{y.forEach(k=>{const H=fixReport(k);H.action_taken||R.update("openReports",B=>B.add(k.id)),R.setIn(["reports",k.id],H)})})}function handleReportDiffs(E,y){return E.withMutations(R=>{y.forEach(k=>{switch(k.state){case"open":R.update("openReports",H=>H.add(k.id));break;default:R.update("openReports",H=>H.delete(k.id))}})})}const normalizeConfig=E=>Map$1(fromJS(E)),normalizeConfigs=E=>List(fromJS(E)).map(normalizeConfig),importConfigs$1=(E,y)=>E.set("configs",normalizeConfigs(y));function admin(E=ReducerRecord$p(),y){switch(y.type){case ADMIN_CONFIG_FETCH_SUCCESS:case ADMIN_CONFIG_UPDATE_SUCCESS:return importConfigs$1(E,y.configs);case ADMIN_REPORTS_FETCH_SUCCESS:return importReports(E,y.reports);case ADMIN_REPORTS_PATCH_REQUEST:case ADMIN_REPORTS_PATCH_SUCCESS:return handleReportDiffs(E,y.reports);case ADMIN_USERS_FETCH_SUCCESS:return importUsers(E,y.accounts,y.filters,y.page);case ADMIN_USERS_DELETE_REQUEST:case ADMIN_USERS_DELETE_SUCCESS:case ADMIN_USERS_REJECT_REQUEST:case ADMIN_USERS_REJECT_SUCCESS:return deleteUser$1(E,y.accountId);case ADMIN_USERS_APPROVE_REQUEST:return E.update("awaitingApproval",R=>R.remove(y.accountId));case ADMIN_USERS_APPROVE_SUCCESS:return approveUser(E,y.user);default:return E}}const ALIASES_FETCH_REQUEST="ALIASES_FETCH_REQUEST",ALIASES_FETCH_SUCCESS="ALIASES_FETCH_SUCCESS",ALIASES_FETCH_FAIL="ALIASES_FETCH_FAIL",ALIASES_SUGGESTIONS_CHANGE="ALIASES_SUGGESTIONS_CHANGE",ALIASES_SUGGESTIONS_READY="ALIASES_SUGGESTIONS_READY",ALIASES_SUGGESTIONS_CLEAR="ALIASES_SUGGESTIONS_CLEAR",ALIASES_ADD_REQUEST="ALIASES_ADD_REQUEST",ALIASES_ADD_SUCCESS="ALIASES_ADD_SUCCESS",ALIASES_ADD_FAIL="ALIASES_ADD_FAIL",ALIASES_REMOVE_REQUEST="ALIASES_REMOVE_REQUEST",ALIASES_REMOVE_SUCCESS="ALIASES_REMOVE_SUCCESS",ALIASES_REMOVE_FAIL="ALIASES_REMOVE_FAIL",messages$4={createSuccess:{id:"aliases.success.add",defaultMessage:"Account alias created successfully"},removeSuccess:{id:"aliases.success.remove",defaultMessage:"Account alias removed successfully"}},fetchAliases=(E,y)=>{if(!isLoggedIn(y))return;const k=y().instance;getFeatures(k).accountMoving&&(E(fetchAliasesRequest()),api(y).get("/api/pleroma/aliases").then(B=>B.json()).then(B=>{E(fetchAliasesSuccess(B.aliases))}).catch(B=>E(fetchAliasesFail(B))))},fetchAliasesRequest=()=>({type:ALIASES_FETCH_REQUEST}),fetchAliasesSuccess=E=>({type:ALIASES_FETCH_SUCCESS,value:E}),fetchAliasesFail=E=>({type:ALIASES_FETCH_FAIL,error:E}),fetchAliasesSuggestions=E=>(y,R)=>{if(!isLoggedIn(R))return;const k={q:E,resolve:!0,limit:4};api(R).get("/api/v1/accounts/search",{searchParams:k}).then(H=>H.json()).then(H=>{y(importFetchedAccounts(H)),y(fetchAliasesSuggestionsReady(E,H))}).catch(H=>toast.showAlertForError(H))},fetchAliasesSuggestionsReady=(E,y)=>({type:ALIASES_SUGGESTIONS_READY,query:E,accounts:y}),clearAliasesSuggestions=()=>({type:ALIASES_SUGGESTIONS_CLEAR}),changeAliasesSuggestions=E=>({type:ALIASES_SUGGESTIONS_CHANGE,value:E}),addToAliases=E=>(y,R)=>{var te,ae,ce;if(!isLoggedIn(R))return;const k=R(),H=k.instance;if(!getFeatures(H).accountMoving){const Ce=k.me,Oe=((ae=(te=k.accounts_meta[Ce])==null?void 0:te.pleroma)==null?void 0:ae.also_known_as)??[];y(addToAliasesRequest()),api(R).patch("/api/v1/accounts/update_credentials",{also_known_as:[...Oe,(ce=E.pleroma)==null?void 0:ce.ap_id]}).then(Le=>Le.json()).then(Le=>{toast.success(messages$4.createSuccess),y(addToAliasesSuccess),y(patchMeSuccess(Le))}).catch(Le=>y(addToAliasesFail(Le)));return}y(addToAliasesRequest()),api(R).put("/api/pleroma/aliases",{alias:E.acct}).then(()=>{toast.success(messages$4.createSuccess),y(addToAliasesSuccess),y(fetchAliases)}).catch(Ce=>y(fetchAliasesFail(Ce)))},addToAliasesRequest=()=>({type:ALIASES_ADD_REQUEST}),addToAliasesSuccess=()=>({type:ALIASES_ADD_SUCCESS}),addToAliasesFail=E=>({type:ALIASES_ADD_FAIL,error:E}),removeFromAliases=E=>(y,R)=>{var te,ae;if(!isLoggedIn(R))return;const k=R(),H=k.instance;if(!getFeatures(H).accountMoving){const ce=k.me,Ce=((ae=(te=k.accounts_meta[ce])==null?void 0:te.pleroma)==null?void 0:ae.also_known_as)??[];y(removeFromAliasesRequest()),api(R).patch("/api/v1/accounts/update_credentials",{also_known_as:Ce.filter(Oe=>Oe!==E)}).then(Oe=>Oe.json()).then(Oe=>{toast.success(messages$4.removeSuccess),y(removeFromAliasesSuccess),y(patchMeSuccess(Oe))}).catch(Oe=>y(removeFromAliasesFail(Oe)));return}y(addToAliasesRequest()),api(R).request("DELETE","/api/pleroma/aliases",{alias:E}).then(()=>{toast.success(messages$4.removeSuccess),y(removeFromAliasesSuccess),y(fetchAliases)}).catch(ce=>y(fetchAliasesFail(ce)))},removeFromAliasesRequest=()=>({type:ALIASES_REMOVE_REQUEST}),removeFromAliasesSuccess=()=>({type:ALIASES_REMOVE_SUCCESS}),removeFromAliasesFail=E=>({type:ALIASES_REMOVE_FAIL,error:E}),ReducerRecord$o=Record({aliases:Record({items:List(),loaded:!1})(),suggestions:Record({items:List(),value:"",loaded:!1})()});function aliasesReducer(E=ReducerRecord$o(),y){switch(y.type){case ALIASES_FETCH_SUCCESS:return E.setIn(["aliases","items"],y.value);case ALIASES_SUGGESTIONS_CHANGE:return E.setIn(["suggestions","value"],y.value).setIn(["suggestions","loaded"],!1);case ALIASES_SUGGESTIONS_READY:return E.setIn(["suggestions","items"],List(y.accounts.map(R=>R.id))).setIn(["suggestions","loaded"],!0);case ALIASES_SUGGESTIONS_CLEAR:return E.update("suggestions",R=>R.withMutations(k=>{k.set("items",List()),k.set("value",""),k.set("loaded",!1)}));default:return E}}class ServiceWorkerLock{static lock(){if("serviceWorker"in navigator){const y=Object.getPrototypeOf(navigator.serviceWorker);y.register=function(){throw new Error("ServiceWorker is locked")}}}}var ga,Ti;const Uo=class Uo{static lockKey(y){et(Uo,ga).add(y),Object.defineProperty(et(this,Ti),y,{get(){throw new Error(`${y} is locked`)}})}};ga=new WeakMap,Ti=new WeakMap,wt(Uo,ga,new Set),wt(Uo,Ti,Object.getPrototypeOf(localStorage??sessionStorage)),(()=>{const y=et(Uo,Ti).getItem;et(Uo,Ti).getItem=function(R){if(et(Uo,ga).has(R))throw new Error(`${R} is locked`);return y.bind(this)(R)}})();let StoragesLock=Uo;class WorkersLock{static lock(){Worker.constructor=function(){throw new Error("Worker is locked")}}}class WebLock{}Jt(WebLock,"storages",StoragesLock),Jt(WebLock,"serviceWorker",ServiceWorkerLock),Jt(WebLock,"workers",WorkersLock);var Kf,Zf,Br,yi,Ta,vi,wc;class NKeyring{constructor(y,R){wt(this,vi);wt(this,Br,new Map);wt(this,yi);wt(this,Ta);Jt(this,Kf,"NKeyStorage");It(this,yi,y),It(this,Ta,R);const k=et(this,yi).getItem(R);WebLock.storages.lockKey(R);try{const H=new Set(this.dataSchema().parse(k));for(const B of H){const{data:te}=nip19_exports.decode(B),ae=getPublicKey(te);et(this,Br).set(ae,te)}}catch{this.clear()}}dataSchema(){return NSchema.json().pipe(NSchema.bech32("nsec").array())}get size(){return et(this,Br).size}clear(){et(this,Br).clear(),jt(this,vi,wc).call(this)}delete(y){const R=et(this,Br).delete(y);return jt(this,vi,wc).call(this),R}forEach(y,R){for(const[k]of et(this,Br)){const H=this.get(k);H&&y.call(R,H,k,this)}}get(y){const R=et(this,Br).get(y);if(R)return new NSecSigner(R)}has(y){return et(this,Br).has(y)}add(y){const R=getPublicKey(y);return et(this,Br).set(R,y),jt(this,vi,wc).call(this),this.get(R)}*entries(){for(const[y]of et(this,Br))yield[y,this.get(y)]}*keys(){for(const y of et(this,Br).keys())yield y}*values(){for(const y of et(this,Br).keys())yield this.get(y)}[(Zf=Symbol.iterator,Kf=Symbol.toStringTag,Zf)](){return this.entries()}}Br=new WeakMap,yi=new WeakMap,Ta=new WeakMap,vi=new WeakSet,wc=function(){const y=[...et(this,Br).values()].map(nip19_exports.nsecEncode);et(this,yi).setItem(et(this,Ta),JSON.stringify(y))};const keyring=new NKeyring(localStorage,"soapbox:nostr:keys"),createStoreImpl=E=>{let y;const R=new Set,k=(Ce,Oe)=>{const Le=typeof Ce=="function"?Ce(y):Ce;if(!Object.is(Le,y)){const Ne=y;y=Oe??(typeof Le!="object"||Le===null)?Le:Object.assign({},y,Le),R.forEach(Fe=>Fe(y,Ne))}},H=()=>y,ae={setState:k,getState:H,getInitialState:()=>ce,subscribe:Ce=>(R.add(Ce),()=>R.delete(Ce))},ce=y=E(k,H,ae);return ae},createStore=E=>E?createStoreImpl(E):createStoreImpl,identity=E=>E;function useStore(E,y=identity){const R=React$1.useSyncExternalStore(E.subscribe,()=>y(E.getState()),()=>y(E.getInitialState()));return React$1.useDebugValue(R),R}const createImpl=E=>{const y=createStore(E),R=k=>useStore(y,k);return Object.assign(R,y),R},create$1=E=>E?createImpl(E):createImpl;function createJSONStorage(E,y){let R;try{R=E()}catch{return}return{getItem:H=>{var B;const te=ce=>ce===null?null:JSON.parse(ce,void 0),ae=(B=R.getItem(H))!=null?B:null;return ae instanceof Promise?ae.then(te):te(ae)},setItem:(H,B)=>R.setItem(H,JSON.stringify(B,void 0)),removeItem:H=>R.removeItem(H)}}const toThenable=E=>y=>{try{const R=E(y);return R instanceof Promise?R:{then(k){return toThenable(k)(R)},catch(k){return this}}}catch(R){return{then(k){return this},catch(k){return toThenable(k)(R)}}}},persistImpl=(E,y)=>(R,k,H)=>{let B={storage:createJSONStorage(()=>localStorage),partialize:De=>De,version:0,merge:(De,$e)=>({...$e,...De}),...y},te=!1;const ae=new Set,ce=new Set;let Ce=B.storage;if(!Ce)return E((...De)=>{console.warn(`[zustand persist middleware] Unable to update item '${B.name}', the given storage is currently unavailable.`),R(...De)},k,H);const Oe=()=>{const De=B.partialize({...k()});return Ce.setItem(B.name,{state:De,version:B.version})},Le=H.setState;H.setState=(De,$e)=>{Le(De,$e),Oe()};const Ne=E((...De)=>{R(...De),Oe()},k,H);H.getInitialState=()=>Ne;let Fe;const Ue=()=>{var De,$e;if(!Ce)return;te=!1,ae.forEach(Ve=>{var Ke;return Ve((Ke=k())!=null?Ke:Ne)});const Be=(($e=B.onRehydrateStorage)==null?void 0:$e.call(B,(De=k())!=null?De:Ne))||void 0;return toThenable(Ce.getItem.bind(Ce))(B.name).then(Ve=>{if(Ve)if(typeof Ve.version=="number"&&Ve.version!==B.version){if(B.migrate)return[!0,B.migrate(Ve.state,Ve.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,Ve.state];return[!1,void 0]}).then(Ve=>{var Ke;const[st,We]=Ve;if(Fe=B.merge(We,(Ke=k())!=null?Ke:Ne),R(Fe,!0),st)return Oe()}).then(()=>{Be==null||Be(Fe,void 0),Fe=k(),te=!0,ce.forEach(Ve=>Ve(Fe))}).catch(Ve=>{Be==null||Be(void 0,Ve)})};return H.persist={setOptions:De=>{B={...B,...De},De.storage&&(Ce=De.storage)},clearStorage:()=>{Ce==null||Ce.removeItem(B.name)},getOptions:()=>B,rehydrate:()=>Ue(),hasHydrated:()=>te,onHydrate:De=>(ae.add(De),()=>{ae.delete(De)}),onFinishHydration:De=>(ce.add(De),()=>{ce.delete(De)})},B.skipHydration||Ue(),Fe||Ne},persist=persistImpl,connectionSchema=z$1.object({pubkey:NSchema.id(),accessToken:z$1.string(),authorizedPubkey:NSchema.id(),bunkerPubkey:NSchema.id()}),useBunkerStore=create$1()(persist(E=>({connections:[],connect(y){E(R=>produce(R,k=>{k.connections.push(y)}))},revoke(y){E(R=>produce(R,k=>{k.connections=k.connections.filter(H=>H.accessToken!==y)}))}}),{name:"soapbox:bunker",storage:{getItem(E){const y=localStorage.getItem(E);return{state:{connections:jsonSchema().pipe(filteredArray(connectionSchema)).catch([]).parse(y)}}},setItem(E,{state:y}){localStorage.setItem(E,JSON.stringify(y.connections))},removeItem(E){localStorage.removeItem(E)}}})),applicationSchema=z$1.object({name:z$1.string().catch(""),website:z$1.string().url().nullable().catch(null),scopes:z$1.string().array().catch([]),redirect_uris:z$1.string().url().array().optional().catch(void 0),redirect_uri:z$1.string().url().optional().catch(void 0),client_id:z$1.string().optional().catch(void 0),client_secret:z$1.string().optional().catch(void 0),client_secret_expires_at:z$1.number().optional().catch(0)}).transform(E=>{const{redirect_uris:y,redirect_uri:R,...k}=E;return{...k,redirect_uris:y||(R?[R]:[])}}),tokenSchema=z$1.object({access_token:z$1.string(),token_type:z$1.string(),scope:z$1.string(),created_at:z$1.number(),id:z$1.coerce.string().optional().catch(void 0),me:z$1.string().url().optional().catch(void 0)}),authUserSchema=z$1.object({access_token:z$1.string(),id:z$1.string(),url:z$1.string().url()}),authAppSchema=applicationSchema.and(z$1.object({access_token:z$1.string().optional().catch(void 0)})),soapboxAuthSchema=z$1.object({app:authAppSchema.optional(),tokens:z$1.record(z$1.string(),tokenSchema),users:z$1.record(z$1.string(),authUserSchema),me:z$1.string().url().optional()}),STORAGE_KEY="soapbox:auth",SESSION_KEY="soapbox:auth:me";for(let E=0;E{R.tokens[y.access_token]=y})}function importApplication(E,y){return produce(E,R=>{R.app=y})}function maybeShiftMe(E){(!E.me||!E.users[E.me])&&(E.me=Object.keys(E.users)[0])}function importCredentials(E,y,R){const k={id:R.id,access_token:y,url:R.url};return produce(E,H=>{H.users[R.url]=k,maybeShiftMe(H)})}function revokeNostr(E){const{connections:y,revoke:R}=useBunkerStore.getState();for(const k of y)k.accessToken===E&&(R(E),keyring.delete(k.pubkey),keyring.delete(k.bunkerPubkey))}function deleteToken$1(E,y){return revokeNostr(y),produce(E,R=>{delete R.tokens[y];for(const k in R.users)R.users[k].access_token===y&&delete R.users[k];maybeShiftMe(R)})}function deleteUser(E,y){return produce(E,R=>{var H;const k=(H=R.users[y])==null?void 0:H.access_token;delete R.tokens[k],delete R.users[y],maybeShiftMe(R)})}function deleteForbiddenToken(E,y,R){return[401,403].includes(y.response.status)?deleteToken$1(E,R):E}function reducer(E,y){switch(y.type){case AUTH_APP_CREATED:{const R=applicationSchema.safeParse(y.app);return R.success?importApplication(E,R.data):E}case AUTH_APP_AUTHORIZED:{const R=tokenSchema.safeParse(y.token);return R.success?produce(E,k=>{k.app&&(k.app.access_token=R.data.access_token)}):E}case AUTH_LOGGED_IN:{const R=tokenSchema.safeParse(y.token);return R.success?importToken(E,R.data):E}case AUTH_LOGGED_OUT:{const R=accountSchema.safeParse(y.account);return R.success?deleteUser(E,R.data.url):E}case VERIFY_CREDENTIALS_SUCCESS:{const R=accountSchema.safeParse(y.account);return R.success&&typeof y.token=="string"?importCredentials(E,y.token,R.data):E}case VERIFY_CREDENTIALS_FAIL:return y.error instanceof HTTPError&&typeof y.token=="string"?deleteForbiddenToken(E,y.error,y.token):E;case SWITCH_ACCOUNT:{const R=accountSchema.safeParse(y.account);return R.success?y.background===!0?(sessionStorage.setItem(SESSION_KEY,R.data.url),E):{...E,me:R.data.url}:E}case ME_FETCH_SKIP:return{...E,me:void 0};default:return E}}function auth(E=initialState$l,y){const R=reducer(E,y);return R!==E&&persistAuth(R),(y.type===AUTH_LOGGED_OUT||E.me&&E.me!==R.me)&&location.replace("/"),R}const BACKUPS_FETCH_REQUEST="BACKUPS_FETCH_REQUEST",BACKUPS_FETCH_SUCCESS="BACKUPS_FETCH_SUCCESS",BACKUPS_FETCH_FAIL="BACKUPS_FETCH_FAIL",BACKUPS_CREATE_REQUEST="BACKUPS_CREATE_REQUEST",BACKUPS_CREATE_SUCCESS="BACKUPS_CREATE_SUCCESS",BACKUPS_CREATE_FAIL="BACKUPS_CREATE_FAIL",fetchBackups=()=>(E,y)=>(E({type:BACKUPS_FETCH_REQUEST}),api(y).get("/api/v1/pleroma/backups").then(R=>R.json()).then(R=>E({type:BACKUPS_FETCH_SUCCESS,backups:R})).catch(R=>{E({type:BACKUPS_FETCH_FAIL,error:R})})),createBackup=()=>(E,y)=>(E({type:BACKUPS_CREATE_REQUEST}),api(y).post("/api/v1/pleroma/backups").then(R=>R.json()).then(R=>E({type:BACKUPS_CREATE_SUCCESS,backups:R})).catch(R=>{E({type:BACKUPS_CREATE_FAIL,error:R})})),BackupRecord=Record({id:null,content_type:"",url:"",file_size:null,processed:!1,inserted_at:""}),initialState$k=Map$1(),importBackup=(E,y)=>E.set(y.inserted_at,BackupRecord(y)),importBackups=(E,y)=>E.withMutations(R=>{y.forEach(k=>importBackup(R,k))});function backups(E=initialState$k,y){switch(y.type){case BACKUPS_FETCH_SUCCESS:case BACKUPS_CREATE_SUCCESS:return importBackups(E,y.backups);default:return E}}const CHATS_FETCH_REQUEST="CHATS_FETCH_REQUEST",CHATS_FETCH_SUCCESS="CHATS_FETCH_SUCCESS",CHATS_FETCH_FAIL="CHATS_FETCH_FAIL",CHATS_EXPAND_REQUEST="CHATS_EXPAND_REQUEST",CHATS_EXPAND_SUCCESS="CHATS_EXPAND_SUCCESS",CHAT_MESSAGES_FETCH_SUCCESS="CHAT_MESSAGES_FETCH_SUCCESS",CHAT_MESSAGE_SEND_REQUEST="CHAT_MESSAGE_SEND_REQUEST",CHAT_MESSAGE_SEND_SUCCESS="CHAT_MESSAGE_SEND_SUCCESS",CHAT_FETCH_REQUEST="CHAT_FETCH_REQUEST",CHAT_FETCH_SUCCESS="CHAT_FETCH_SUCCESS",CHAT_FETCH_FAIL="CHAT_FETCH_FAIL",CHAT_READ_REQUEST="CHAT_READ_REQUEST",CHAT_READ_SUCCESS="CHAT_READ_SUCCESS",CHAT_READ_FAIL="CHAT_READ_FAIL",CHAT_MESSAGE_DELETE_REQUEST="CHAT_MESSAGE_DELETE_REQUEST",CHAT_MESSAGE_DELETE_SUCCESS="CHAT_MESSAGE_DELETE_SUCCESS",fetchChatsV1=()=>(E,y)=>api(y).get("/api/v1/pleroma/chats").then(R=>R.json()).then(R=>{E({type:CHATS_FETCH_SUCCESS,chats:R})}).catch(R=>{E({type:CHATS_FETCH_FAIL,error:R})}),fetchChatsV2=()=>(E,y)=>api(y).get("/api/v2/pleroma/chats").then(async R=>{const k=R.next(),H=await R.json();E({type:CHATS_FETCH_SUCCESS,chats:H,next:k})}).catch(R=>{E({type:CHATS_FETCH_FAIL,error:R})}),fetchChats=()=>(E,y)=>{const R=y(),{instance:k}=R,H=getFeatures(k);return E({type:CHATS_FETCH_REQUEST}),H.chatsV2?E(fetchChatsV2()):E(fetchChatsV1())},openChat=E=>(y,R)=>{const k=R(),H=getSettings(k).getIn(["chats","panes"]),B=H.findIndex(te=>te.get("chat_id")===E);if(y(markChatRead(E)),B>-1)return y(changeSetting(["chats","panes",B,"state"],"open"));{const te=Map$1({chat_id:E,state:"open"});return y(changeSetting(["chats","panes"],H.push(te)))}},toggleMainWindow=()=>(E,y)=>{const k=getSettings(y()).getIn(["chats","mainWindow"])==="minimized"?"open":"minimized";return E(changeSetting(["chats","mainWindow"],k))},startChat=E=>(y,R)=>(y({type:CHAT_FETCH_REQUEST,accountId:E}),api(R).post(`/api/v1/pleroma/chats/by-account-id/${E}`).then(k=>k.json()).then(k=>(y({type:CHAT_FETCH_SUCCESS,chat:k}),k)).catch(k=>{y({type:CHAT_FETCH_FAIL,accountId:E,error:k})})),markChatRead=(E,y)=>(R,k)=>{const H=k().chats.items.get(E);y||(y=H.last_message),!(H.get("unread")<1)&&y&&(R({type:CHAT_READ_REQUEST,chatId:E,lastReadId:y}),api(k).post(`/api/v1/pleroma/chats/${E}/read`,{last_read_id:y}).then(B=>B.json()).then(B=>{R({type:CHAT_READ_SUCCESS,chat:B,lastReadId:y})}).catch(B=>{R({type:CHAT_READ_FAIL,chatId:E,error:B,lastReadId:y})}))},launchChat=(E,y,R=!1)=>{const k=H=>H<=1190;return H=>H(startChat(E)).then(B=>{R||k(window.innerWidth)?y.push(`/chats/${B.id}`):H(openChat(B.id))})},updateReaction=(E,y,R,k)=>announcementReactionSchema.parse({...E,me:typeof R=="boolean"?R:E.me,count:E.count+y}),updateReactions=(E,y,R,k,H)=>(E.findIndex(te=>te.name===y)>-1&&(E=E.map(te=>te.name===y?updateReaction(te,R,k):te)),[...E,updateReaction(announcementReactionSchema.parse({name:y}),R,k)]),useAnnouncements=()=>{const E=useApi(),y=async()=>{const ae=await(await E.get("/api/v1/announcements")).json();return ae==null?void 0:ae.map(Ce=>announcementSchema.parse(Ce))},{data:R,...k}=useQuery({queryKey:["announcements"],queryFn:y,placeholderData:[]}),{mutate:H}=useMutation({mutationFn:async({announcementId:te,name:ae})=>(await E.put(`/api/v1/announcements/${te}/reactions/${ae}`)).json(),retry:!1,onMutate:({announcementId:te,name:ae})=>{queryClient.setQueryData(["announcements"],ce=>ce.map(Ce=>Ce.id!==te?Ce:announcementSchema.parse({...Ce,reactions:updateReactions(Ce.reactions,ae,1,!0)})))},onError:(te,{announcementId:ae,name:ce})=>{queryClient.setQueryData(["announcements"],Ce=>Ce.map(Oe=>Oe.id!==ae?Oe:announcementSchema.parse({...Oe,reactions:updateReactions(Oe.reactions,ce,-1,!1)})))}}),{mutate:B}=useMutation({mutationFn:async({announcementId:te,name:ae})=>(await E.delete(`/api/v1/announcements/${te}/reactions/${ae}`)).json(),retry:!1,onMutate:({announcementId:te,name:ae})=>{queryClient.setQueryData(["announcements"],ce=>ce.map(Ce=>Ce.id!==te?Ce:announcementSchema.parse({...Ce,reactions:updateReactions(Ce.reactions,ae,-1,!1)})))},onError:(te,{announcementId:ae,name:ce})=>{queryClient.setQueryData(["announcements"],Ce=>Ce.map(Oe=>Oe.id!==ae?Oe:announcementSchema.parse({...Oe,reactions:updateReactions(Oe.reactions,ce,1,!0)})))}});return{data:R?[...R].sort(compareAnnouncements):void 0,...k,addReaction:H,removeReaction:B}};function compareAnnouncements(E,y){return new Date(E.starts_at||E.published_at).getDate()-new Date(y.starts_at||y.published_at).getDate()}const selectCache=(E,y)=>E.entities[y[0]],selectList=(E,y)=>{var H;const[,...R]=y,k=R.join(":");return(H=selectCache(E,y))==null?void 0:H.lists[k]};function selectListState(E,y,R){var H;const k=(H=selectList(E,y))==null?void 0:H.state;return k?k[R]:void 0}function useListState(E,y){return useAppSelector(R=>selectListState(R,E,y))}function selectEntity(E,y,R){var k;return(k=E.entities[y])==null?void 0:k.store[R]}function selectEntities(E,y){const R=selectCache(E,y),k=selectList(E,y),H=k==null?void 0:k.ids;return H?Array.from(H).reduce((B,te)=>{const ae=R==null?void 0:R.store[te];return ae&&B.push(ae),B},[]):[]}function findEntity(E,y,R){const k=E.entities[y];if(k)return Object.values(k.store).find(R)}const skinToneSchema=z$1.union([z$1.literal(1),z$1.literal(2),z$1.literal(3),z$1.literal(4),z$1.literal(5),z$1.literal(6)]),settingsSchema=z$1.object({discloseClient:z$1.boolean().catch(!0),onboarded:z$1.boolean().catch(!1),skinTone:skinToneSchema.catch(1),reduceMotion:z$1.boolean().catch(!1),underlineLinks:z$1.boolean().catch(!1),autoPlayGif:z$1.boolean().catch(!0),displayMedia:z$1.enum(["default","hide_all","show_all"]).catch("default"),expandSpoilers:z$1.boolean().catch(!1),preserveSpoilers:z$1.boolean().catch(!1),unfollowModal:z$1.boolean().catch(!1),boostModal:z$1.boolean().catch(!1),deleteModal:z$1.boolean().catch(!0),missingDescriptionModal:z$1.boolean().catch(!1),defaultPrivacy:z$1.enum(["public","unlisted","private","direct"]).catch("public"),defaultContentType:z$1.enum(["text/plain","text/markdown"]).catch("text/plain"),themeMode:z$1.enum(["system","light","dark","black"]).catch("system"),locale:z$1.string().catch(navigator.language).pipe(z$1.enum(locales)).catch("en"),showExplanationBox:z$1.boolean().catch(!0),explanationBox:z$1.boolean().catch(!0),autoloadTimelines:z$1.boolean().catch(!0),autoloadMore:z$1.boolean().catch(!0),systemFont:z$1.boolean().catch(!1),demetricator:z$1.boolean().catch(!1),isDeveloper:z$1.boolean().catch(!1),demo:z$1.boolean().catch(!1),chats:coerceObject({mainWindow:z$1.enum(["minimized","open"]).catch("minimized"),sound:z$1.boolean().catch(!0)}),home:coerceObject({shows:coerceObject({reblog:z$1.boolean().catch(!0),reply:z$1.boolean().catch(!0)})}),account_timeline:coerceObject({shows:coerceObject({pinned:z$1.boolean().catch(!0)})}),remote_timeline:coerceObject({pinnedHosts:z$1.string().array().catch([])}),public:coerceObject({other:coerceObject({onlyMedia:z$1.boolean().catch(!1)})}),community:coerceObject({other:coerceObject({onlyMedia:z$1.boolean().catch(!1)})}),remote:coerceObject({other:coerceObject({onlyMedia:z$1.boolean().catch(!1)})}),notifications:coerceObject({quickFilter:coerceObject({active:z$1.string().catch("all"),advanced:z$1.boolean().catch(!1),show:z$1.boolean().catch(!0)})}),dismissedSettingsNotifications:z$1.array(z$1.string()).catch([]),frequentlyUsedEmojis:z$1.record(z$1.string(),z$1.number().int().nonnegative()).catch({})}),useSettings=()=>{const E=useAppSelector(y=>getSettings(y));return reactExports.useMemo(()=>settingsSchema.parse(E.toJS()),[E])},ChatContext=reactExports.createContext({isOpen:!1,needsAcceptance:!1});var ChatWidgetScreens=(E=>(E.INBOX="INBOX",E.SEARCH="SEARCH",E.CHAT="CHAT",E.CHAT_SETTINGS="CHAT_SETTINGS",E))(ChatWidgetScreens||{});const ChatProvider=({children:E})=>{const y=useHistory(),R=useAppDispatch(),{chats:k}=useSettings(),{account:H}=useOwnAccount(),te=!!y.location.pathname.match(/^\/chats/),{chatId:ae}=useParams(),[ce,Ce]=reactExports.useState("INBOX"),[Oe,Le]=reactExports.useState(ae),{data:Ne}=useChat(Oe),Fe=!(Ne!=null&&Ne.accepted)&&(Ne==null?void 0:Ne.created_by_account)!==(H==null?void 0:H.id),Ue=k.mainWindow==="open",De=(Ve,Ke)=>{Le(Ke||null),Ce(Ve)},$e=()=>R(toggleMainWindow()),Be=reactExports.useMemo(()=>({chat:Ne,needsAcceptance:Fe,isOpen:Ue,isUsingMainChatPage:te,toggleChatPane:$e,screen:ce,changeScreen:De,currentChatId:Oe}),[Ne,Oe,Fe,te,Ue,ce,De]);return reactExports.useEffect(()=>{Le(ae||null)},[ae]),jsxRuntimeExports.jsx(ChatContext.Provider,{value:Be,children:E})},useChatContext=()=>reactExports.useContext(ChatContext),useFeatures=()=>{const{instance:E}=useInstance();return getFeatures(E)};function compareId(E,y){return E===y?0:E.length===y.length?E>y?1:-1:E.length>y.length?1:-1}function compareDate(E,y){const R=new Date(E),k=new Date(y);return kR?1:0}const isEntity=E=>E&&typeof E=="object"&&"id"in E,deduplicateById=E=>{const y=E.reduce((R,k)=>R.set(k.id,k),new Map);return Array.from(y.values())},flattenPages=E=>{const y=E==null?void 0:E.pages.reduce((R,k)=>[...R,...k.result],[]);if(y&&y.every(isEntity))return deduplicateById(y);if(y)return y},updatePageItem=(E,y,R)=>{queryClient.setQueriesData({queryKey:E},k=>{if(k){const H=k.pages.map(B=>{const te=B.result.map(ae=>R(ae,y)?y:ae);return{...B,result:te}});return{...k,pages:H}}})},appendPageItem=(E,y)=>{queryClient.setQueryData(E,R=>{if(R){const k=[...R.pages];return k[0]={...k[0],result:[y,...k[0].result]},{...R,pages:k}}})},removePageItem=(E,y,R)=>{queryClient.setQueriesData({queryKey:E},k=>{if(k){const H=k.pages.map(B=>{const te=B.result.filter(ae=>!R(ae,y));return{...B,result:te}});return{...k,pages:H}}})},paginateQueryData=E=>E==null?void 0:E.reduce((y,R,k)=>{const H=Math.floor(k/20);return y[H]||(y[H]=[]),y[H].push(R),y},[]),sortQueryData=(E,y)=>{queryClient.setQueryData(E,R=>{if(R){const k={...R},H=flattenPages(k),B=H==null?void 0:H.sort(y),ae=paginateQueryData(B).map((ce,Ce)=>({...R.pages[Ce],result:ce}));return k.pages=ae,k}})},updateChatInChatSearchQuery=E=>{updatePageItem(ChatKeys.chatSearch(),E,(y,R)=>y.id===R.id)},reOrderChatListItems=()=>{sortQueryData(ChatKeys.chatSearch(),(E,y)=>{var R,k;return compareDate((R=E.last_message)==null?void 0:R.created_at,(k=y.last_message)==null?void 0:k.created_at)})},checkIfChatExists=E=>{const y=flattenPages(queryClient.getQueryData(ChatKeys.chatSearch()));return y==null?void 0:y.find(R=>R.id===E)},invalidateChatSearchQuery=()=>{queryClient.invalidateQueries({queryKey:ChatKeys.chatSearch()})},updateChatListItem=E=>{const{id:y,last_message:R}=E;checkIfChatExists(y)?(updateChatInChatSearchQuery(E),reOrderChatListItems()):invalidateChatSearchQuery(),R&&appendPageItem(ChatKeys.chatMessages(E.id),normalizeChatMessage(R))},getUnreadChatsCount=()=>{const E=flattenPages(queryClient.getQueryData(ChatKeys.chatSearch()));return(E==null?void 0:E.reduce((y,R)=>y+R.unread,0))??0},updateChatMessage=E=>updatePageItem(ChatKeys.chatMessages(E.chat_id),normalizeChatMessage(E),(y,R)=>y.id===R.id),useFetchRelationships=()=>{const E=useApi(),y=useAppDispatch();return useMutation({mutationFn:({accountIds:R})=>{const k=R.map(H=>`id[]=${H}`).join("&");return E.get(`/api/v1/accounts/relationships?${k}`)},async onSuccess(R){y(fetchRelationshipsSuccess(await R.json()))},onError(R){y(fetchRelationshipsFail(R))}})},messageExpirationOptions=[604800,1209600,2592e3,7776e3];var MessageExpirationValues=(E=>(E[E.SEVEN=messageExpirationOptions[0]]="SEVEN",E[E.FOURTEEN=messageExpirationOptions[1]]="FOURTEEN",E[E.THIRTY=messageExpirationOptions[2]]="THIRTY",E[E.NINETY=messageExpirationOptions[3]]="NINETY",E))(MessageExpirationValues||{});const ChatKeys={chat:E=>["chats","chat",E],chatMessages:E=>["chats","messages",E],chatSearch:E=>E?["chats","search",E]:["chats","search"]},isLastMessage=E=>{const y=queryClient.getQueryData(ChatKeys.chatSearch()),R=flattenPages(y);return!!(R==null?void 0:R.find(H=>{var B;return((B=H.last_message)==null?void 0:B.id)===E}))},useChatMessages=E=>{var te;const y=useApi(),R=useAppSelector(ae=>ae.relationships.getIn([E.account.id,"blocked_by"])),k=async(ae,ce)=>{const Oe=(ce==null?void 0:ce.link)||`/api/v1/pleroma/chats/${ae}/messages`,Le=await y.get(Oe),Ne=await Le.json(),Fe=Le.next(),Ue=!!Fe;return{result:Ne.map(normalizeChatMessage),link:Fe??void 0,hasMore:Ue}},H=useInfiniteQuery({queryKey:ChatKeys.chatMessages(E.id),queryFn:({pageParam:ae})=>k(E.id,ae),enabled:!R,gcTime:0,staleTime:0,initialPageParam:{link:void 0},getNextPageParam:ae=>{if(ae.hasMore)return{link:ae.link}}}),B=(te=flattenPages(H.data))==null?void 0:te.reverse();return{...H,data:B}},useChats=E=>{const y=useApi(),R=useAppDispatch(),k=useFeatures(),{setUnreadChatsCount:H}=useStatContext(),B=useFetchRelationships(),te=async Le=>{const Ne=k.chatsV2?"/api/v2/pleroma/chats":"/api/v1/pleroma/chats",Ue=(Le==null?void 0:Le.link)||Ne,De=await y.get(Ue,{searchParams:E?{search:E}:void 0}),$e=await De.json(),Be=De.next(),Ve=!!Be;return H(Number(De.headers.get("x-unread-messages-count"))||$e.reduce((Ke,st)=>Ke+st.unread,0)),B.mutate({accountIds:$e.map(Ke=>Ke.account.id)}),R(importFetchedAccounts($e.map(Ke=>Ke.account))),{result:$e,hasMore:Ve,link:Be??void 0}},ae=useInfiniteQuery({queryKey:ChatKeys.chatSearch(E),queryFn:({pageParam:Le})=>te(Le),placeholderData:keepPreviousData,enabled:k.chats,initialPageParam:{link:void 0},getNextPageParam:Le=>{if(Le.hasMore)return{link:Le.link}}}),ce=flattenPages(ae.data);return{chatsQuery:{...ae,data:ce},getOrCreateChatByAccountId:Le=>y.post(`/api/v1/pleroma/chats/by-account-id/${Le}`)}},useChat=E=>{const y=useApi(),R=useAppDispatch(),k=useFetchRelationships(),H=async()=>{if(E){const te=await(await y.get(`/api/v1/pleroma/chats/${E}`)).json();return k.mutate({accountIds:[te.account.id]}),R(importFetchedAccount$1(te.account)),te}};return useQuery({queryKey:ChatKeys.chat(E),queryFn:H,gcTime:0,enabled:!!E})},useChatActions=E=>{const{account:y}=useOwnAccount(),R=useApi(),{setUnreadChatsCount:k}=useStatContext(),{chat:H,changeScreen:B}=useChatContext(),te=async Ue=>R.post(`/api/v1/pleroma/chats/${E}/read`,{last_read_id:Ue}).then(async De=>{var Ve;const $e=await De.json();updatePageItem(ChatKeys.chatSearch(),$e,(Ke,st)=>Ke.id===st.id);const Be=queryClient.getQueryData(ChatKeys.chatSearch());if(Be){const Ke=(Ve=flattenPages(Be))==null?void 0:Ve.map(st=>st.id===$e.id?$e:st);k(Ke==null?void 0:Ke.reduce((st,We)=>st+We.unread,0))}return $e}).catch(()=>null),ae=useMutation({mutationFn:async({chatId:Ue,content:De,mediaIds:$e})=>(await R.post(`/api/v1/pleroma/chats/${Ue}/messages`,{content:De,media_id:$e&&$e.length===1?$e[0]:void 0,media_ids:$e})).json(),retry:!1,onMutate:async Ue=>{await queryClient.cancelQueries({queryKey:["chats","messages",Ue.chatId]});const De=Ue.content,$e=queryClient.getQueryData(["chats","messages",Ue.chatId]),Be=String(Number(new Date));return queryClient.setQueryData(ChatKeys.chatMessages(Ue.chatId),Ve=>{const Ke={...Ve};return Ke.pages=Ke.pages.map((st,We)=>We===0?{...st,result:[normalizeChatMessage({content:Ue.content,id:Be,created_at:new Date,account_id:y==null?void 0:y.id,pending:!0,unread:!0}),...st.result]}:st),Ke}),{prevChatMessages:$e,prevContent:De,pendingId:Be}},onError:(Ue,De,$e)=>{queryClient.setQueryData(["chats","messages",De.chatId],$e.prevChatMessages)},onSuccess:(Ue,De,$e)=>{const Be={...H,last_message:Ue};updatePageItem(ChatKeys.chatSearch(),Be,(Ve,Ke)=>Ve.id===Ke.id),updatePageItem(ChatKeys.chatMessages(De.chatId),normalizeChatMessage(Ue),Ve=>Ve.id===$e.pendingId),reOrderChatListItems()}}),ce=useMutation({mutationFn:Ue=>R.patch(`/api/v1/pleroma/chats/${E}`,Ue),onMutate:async Ue=>{await queryClient.cancelQueries({queryKey:ChatKeys.chat(E)});const De={...H},$e={...H,...Ue};return queryClient.setQueryData(ChatKeys.chat(E),$e),{prevChat:De}},onError:(Ue,De,$e)=>{B(ChatWidgetScreens.CHAT,$e.prevChat.id),queryClient.setQueryData(ChatKeys.chat(E),$e.prevChat),toast.error("Chat Settings failed to update.")},onSuccess(){queryClient.invalidateQueries({queryKey:ChatKeys.chat(E)}),queryClient.invalidateQueries({queryKey:ChatKeys.chatSearch()}),toast.success("Chat Settings updated successfully")}}),Ce=Ue=>R.delete(`/api/v1/pleroma/chats/${E}/messages/${Ue}`),Oe=useMutation({mutationFn:()=>R.post(`/api/v1/pleroma/chats/${E}/accept`),async onSuccess(Ue){const De=await Ue.json();B(ChatWidgetScreens.CHAT,De.id),queryClient.invalidateQueries({queryKey:ChatKeys.chat(E)}),queryClient.invalidateQueries({queryKey:ChatKeys.chatMessages(E)}),queryClient.invalidateQueries({queryKey:ChatKeys.chatSearch()})}}),Le=useMutation({mutationFn:()=>R.delete(`/api/v1/pleroma/chats/${E}`),onSuccess(){B(ChatWidgetScreens.INBOX),queryClient.invalidateQueries({queryKey:ChatKeys.chatMessages(E)}),queryClient.invalidateQueries({queryKey:ChatKeys.chatSearch()})}}),Ne=useMutation({mutationFn:Ue=>R.post(`/api/v1/pleroma/chats/${E}/messages/${Ue.messageId}/reactions`,{json:{emoji:Ue.emoji}}),async onSuccess(Ue){updateChatMessage(await Ue.json())}}),Fe=useMutation({mutationFn:Ue=>R.delete(`/api/v1/pleroma/chats/${E}/messages/${Ue.messageId}/reactions/${Ue.emoji}`),onSuccess(){queryClient.invalidateQueries({queryKey:ChatKeys.chatMessages(E)})}});return{acceptChat:Oe,createChatMessage:ae,createReaction:Ne,deleteChat:Le,deleteChatMessage:Ce,deleteReaction:Fe,markChatAsRead:te,updateChat:ce}};function connectStream(E,y){return(R,k)=>{const H=k().instance.configuration.urls.streaming,B=getAccessToken(k()),{onConnect:te,onDisconnect:ae,onReceive:ce}=y(R,k);let Ce;try{Ce=getStream(H,B,E,{connected(){te()},disconnected(){ae()},received(Le){ce(Ce,Le)},reconnected(){te()}})}catch(Le){console.error(Le)}return()=>{Ce&&Ce.close()}}}function getStream(E,y,R,{connected:k,received:H,disconnected:B,reconnected:te}){const ae=[`stream=${R}`];return new WebsocketBuilder(`${E}/api/v1/streaming/?${ae.join("&")}`).withProtocols(y).withBackoff(new ExponentialBackoff(1e3,6)).onOpen((Ce,Oe)=>{k==null||k(Oe)}).onClose((Ce,Oe)=>{B==null||B(Oe)}).onReconnect((Ce,Oe)=>{te(Oe)}).onMessage((Ce,Oe)=>{if(Oe.data)try{H(JSON.parse(Oe.data))}catch(Le){console.error(Oe),console.error(`Could not parse the above streaming event. ${Le}`)}}).build()}const CONVERSATIONS_MOUNT="CONVERSATIONS_MOUNT",CONVERSATIONS_UNMOUNT="CONVERSATIONS_UNMOUNT",CONVERSATIONS_FETCH_REQUEST="CONVERSATIONS_FETCH_REQUEST",CONVERSATIONS_FETCH_SUCCESS="CONVERSATIONS_FETCH_SUCCESS",CONVERSATIONS_FETCH_FAIL="CONVERSATIONS_FETCH_FAIL",CONVERSATIONS_UPDATE="CONVERSATIONS_UPDATE",CONVERSATIONS_READ="CONVERSATIONS_READ",mountConversations=()=>({type:CONVERSATIONS_MOUNT}),unmountConversations=()=>({type:CONVERSATIONS_UNMOUNT}),markConversationRead=E=>(y,R)=>{isLoggedIn(R)&&(y({type:CONVERSATIONS_READ,id:E}),api(R).post(`/api/v1/conversations/${E}/read`))},expandConversations=({maxId:E}={})=>(y,R)=>{if(!isLoggedIn(R))return;y(expandConversationsRequest());const k={max_id:E};E||(k.since_id=R().conversations.items.getIn([0,"id"]));const H=!!k.since_id;api(R).get("/api/v1/conversations",{searchParams:k}).then(async B=>{const te=B.next(),ae=await B.json();y(importFetchedAccounts(ae.reduce((ce,Ce)=>ce.concat(Ce.accounts),[]))),y(importFetchedStatuses(ae.map(ce=>ce.last_status).filter(ce=>!!ce))),y(expandConversationsSuccess(ae,te,H))}).catch(B=>y(expandConversationsFail(B)))},expandConversationsRequest=()=>({type:CONVERSATIONS_FETCH_REQUEST}),expandConversationsSuccess=(E,y,R)=>({type:CONVERSATIONS_FETCH_SUCCESS,conversations:E,next:y,isLoadingRecent:R}),expandConversationsFail=E=>({type:CONVERSATIONS_FETCH_FAIL,error:E}),updateConversations=E=>y=>(y(importFetchedAccounts(E.accounts)),E.last_status&&y(importFetchedStatus(E.last_status)),y({type:CONVERSATIONS_UPDATE,conversation:E})),FILTERS_FETCH_REQUEST="FILTERS_FETCH_REQUEST",FILTERS_FETCH_SUCCESS="FILTERS_FETCH_SUCCESS",FILTERS_FETCH_FAIL="FILTERS_FETCH_FAIL",FILTER_FETCH_REQUEST="FILTER_FETCH_REQUEST",FILTER_FETCH_SUCCESS="FILTER_FETCH_SUCCESS",FILTER_FETCH_FAIL="FILTER_FETCH_FAIL",FILTERS_CREATE_REQUEST="FILTERS_CREATE_REQUEST",FILTERS_CREATE_SUCCESS="FILTERS_CREATE_SUCCESS",FILTERS_CREATE_FAIL="FILTERS_CREATE_FAIL",FILTERS_UPDATE_REQUEST="FILTERS_UPDATE_REQUEST",FILTERS_UPDATE_SUCCESS="FILTERS_UPDATE_SUCCESS",FILTERS_UPDATE_FAIL="FILTERS_UPDATE_FAIL",FILTERS_DELETE_REQUEST="FILTERS_DELETE_REQUEST",FILTERS_DELETE_SUCCESS="FILTERS_DELETE_SUCCESS",FILTERS_DELETE_FAIL="FILTERS_DELETE_FAIL",messages$3={added:{id:"filters.added",defaultMessage:"Filter added."},removed:{id:"filters.removed",defaultMessage:"Filter deleted."}},fetchFiltersV1=()=>(E,y)=>(E({type:FILTERS_FETCH_REQUEST,skipLoading:!0}),api(y).get("/api/v1/filters").then(R=>R.json()).then(R=>E({type:FILTERS_FETCH_SUCCESS,filters:R,skipLoading:!0})).catch(R=>E({type:FILTERS_FETCH_FAIL,err:R,skipLoading:!0,skipAlert:!0}))),fetchFiltersV2=()=>(E,y)=>(E({type:FILTERS_FETCH_REQUEST,skipLoading:!0}),api(y).get("/api/v2/filters").then(R=>R.json()).then(R=>E({type:FILTERS_FETCH_SUCCESS,filters:R,skipLoading:!0})).catch(R=>E({type:FILTERS_FETCH_FAIL,err:R,skipLoading:!0,skipAlert:!0}))),fetchFilters=(E=!1)=>(y,R)=>{if(!isLoggedIn(R))return;const H=R().instance,B=getFeatures(H);if(B.filtersV2&&E)return y(fetchFiltersV2());if(B.filters)return y(fetchFiltersV1())},fetchFilterV1=E=>(y,R)=>(y({type:FILTER_FETCH_REQUEST,skipLoading:!0}),api(R).get(`/api/v1/filters/${E}`).then(k=>k.json()).then(k=>y({type:FILTER_FETCH_SUCCESS,filter:k,skipLoading:!0})).catch(k=>y({type:FILTER_FETCH_FAIL,err:k,skipLoading:!0,skipAlert:!0}))),fetchFilterV2=E=>(y,R)=>(y({type:FILTER_FETCH_REQUEST,skipLoading:!0}),api(R).get(`/api/v2/filters/${E}`).then(k=>k.json()).then(k=>y({type:FILTER_FETCH_SUCCESS,filter:k,skipLoading:!0})).catch(k=>y({type:FILTER_FETCH_FAIL,err:k,skipLoading:!0,skipAlert:!0}))),fetchFilter=E=>(y,R)=>{const H=R().instance,B=getFeatures(H);if(B.filtersV2)return y(fetchFilterV2(E));if(B.filters)return y(fetchFilterV1(E))},createFilterV1=(E,y,R,k,H)=>(B,te)=>(B({type:FILTERS_CREATE_REQUEST}),api(te).post("/api/v1/filters",{phrase:H[0].keyword,context:R,irreversible:k,whole_word:H[0].whole_word,expires_in:y}).then(ae=>ae.json()).then(ae=>{B({type:FILTERS_CREATE_SUCCESS,filter:ae}),toast.success(messages$3.added)}).catch(ae=>{B({type:FILTERS_CREATE_FAIL,error:ae})})),createFilterV2=(E,y,R,k,H)=>(B,te)=>(B({type:FILTERS_CREATE_REQUEST}),api(te).post("/api/v2/filters",{title:E,context:R,filter_action:k?"hide":"warn",expires_in:y,keywords_attributes:H}).then(ae=>ae.json()).then(ae=>{B({type:FILTERS_CREATE_SUCCESS,filter:ae}),toast.success(messages$3.added)}).catch(ae=>{B({type:FILTERS_CREATE_FAIL,error:ae})})),createFilter=(E,y,R,k,H)=>(B,te)=>{const ce=te().instance;return getFeatures(ce).filtersV2?B(createFilterV2(E,y,R,k,H)):B(createFilterV1(E,y,R,k,H))},updateFilterV1=(E,y,R,k,H,B)=>(te,ae)=>(te({type:FILTERS_UPDATE_REQUEST}),api(ae).patch(`/api/v1/filters/${E}`,{phrase:B[0].keyword,context:k,irreversible:H,whole_word:B[0].whole_word,expires_in:R}).then(ce=>ce.json()).then(ce=>{te({type:FILTERS_UPDATE_SUCCESS,filter:ce}),toast.success(messages$3.added)}).catch(ce=>{te({type:FILTERS_UPDATE_FAIL,error:ce})})),updateFilterV2=(E,y,R,k,H,B)=>(te,ae)=>(te({type:FILTERS_UPDATE_REQUEST}),api(ae).patch(`/api/v2/filters/${E}`,{title:y,context:k,filter_action:H?"hide":"warn",expires_in:R,keywords_attributes:B}).then(ce=>ce.json()).then(ce=>{te({type:FILTERS_UPDATE_SUCCESS,filter:ce}),toast.success(messages$3.added)}).catch(ce=>{te({type:FILTERS_UPDATE_FAIL,error:ce})})),updateFilter=(E,y,R,k,H,B)=>(te,ae)=>{const Ce=ae().instance;return getFeatures(Ce).filtersV2?te(updateFilterV2(E,y,R,k,H,B)):te(updateFilterV1(E,y,R,k,H,B))},deleteFilterV1=E=>(y,R)=>(y({type:FILTERS_DELETE_REQUEST}),api(R).delete(`/api/v1/filters/${E}`).then(k=>k.json()).then(k=>{y({type:FILTERS_DELETE_SUCCESS,filter:k}),toast.success(messages$3.removed)}).catch(k=>{y({type:FILTERS_DELETE_FAIL,error:k})})),deleteFilterV2=E=>(y,R)=>(y({type:FILTERS_DELETE_REQUEST}),api(R).delete(`/api/v2/filters/${E}`).then(k=>k.json()).then(k=>{y({type:FILTERS_DELETE_SUCCESS,filter:k}),toast.success(messages$3.removed)}).catch(k=>{y({type:FILTERS_DELETE_FAIL,error:k})})),deleteFilter=E=>(y,R)=>{const H=R().instance;return getFeatures(H).filtersV2?y(deleteFilterV2(E)):y(deleteFilterV1(E))},MARKER_FETCH_REQUEST="MARKER_FETCH_REQUEST",MARKER_FETCH_SUCCESS="MARKER_FETCH_SUCCESS",MARKER_FETCH_FAIL="MARKER_FETCH_FAIL",MARKER_SAVE_REQUEST="MARKER_SAVE_REQUEST",MARKER_SAVE_SUCCESS="MARKER_SAVE_SUCCESS",MARKER_SAVE_FAIL="MARKER_SAVE_FAIL",fetchMarker=E=>(y,R)=>(y({type:MARKER_FETCH_REQUEST}),api(R).get("/api/v1/markers",{searchParams:{timeline:E}}).then(k=>k.json()).then(k=>{y({type:MARKER_FETCH_SUCCESS,marker:k})}).catch(k=>{y({type:MARKER_FETCH_FAIL,error:k})})),saveMarker=E=>(y,R)=>(y({type:MARKER_SAVE_REQUEST,marker:E}),api(R).post("/api/v1/markers",E).then(k=>k.json()).then(k=>{y({type:MARKER_SAVE_SUCCESS,marker:k})}).catch(k=>{y({type:MARKER_SAVE_FAIL,error:k})}));var ErrorKind;(function(E){E[E.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",E[E.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",E[E.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",E[E.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",E[E.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",E[E.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",E[E.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",E[E.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",E[E.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",E[E.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",E[E.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",E[E.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",E[E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",E[E.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",E[E.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",E[E.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",E[E.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",E[E.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",E[E.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",E[E.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",E[E.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",E[E.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",E[E.INVALID_TAG=23]="INVALID_TAG",E[E.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",E[E.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",E[E.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(ErrorKind||(ErrorKind={}));var TYPE;(function(E){E[E.literal=0]="literal",E[E.argument=1]="argument",E[E.number=2]="number",E[E.date=3]="date",E[E.time=4]="time",E[E.select=5]="select",E[E.plural=6]="plural",E[E.pound=7]="pound",E[E.tag=8]="tag"})(TYPE||(TYPE={}));var SKELETON_TYPE;(function(E){E[E.number=0]="number",E[E.dateTime=1]="dateTime"})(SKELETON_TYPE||(SKELETON_TYPE={}));function isLiteralElement(E){return E.type===TYPE.literal}function isArgumentElement(E){return E.type===TYPE.argument}function isNumberElement(E){return E.type===TYPE.number}function isDateElement(E){return E.type===TYPE.date}function isTimeElement(E){return E.type===TYPE.time}function isSelectElement(E){return E.type===TYPE.select}function isPluralElement(E){return E.type===TYPE.plural}function isPoundElement(E){return E.type===TYPE.pound}function isTagElement(E){return E.type===TYPE.tag}function isNumberSkeleton(E){return!!(E&&typeof E=="object"&&E.type===SKELETON_TYPE.number)}function isDateTimeSkeleton(E){return!!(E&&typeof E=="object"&&E.type===SKELETON_TYPE.dateTime)}var SPACE_SEPARATOR_REGEX=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,DATE_TIME_REGEX=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function parseDateTimeSkeleton(E){var y={};return E.replace(DATE_TIME_REGEX,function(R){var k=R.length;switch(R[0]){case"G":y.era=k===4?"long":k===5?"narrow":"short";break;case"y":y.year=k===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":y.month=["numeric","2-digit","short","long","narrow"][k-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":y.day=["numeric","2-digit"][k-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":y.weekday=k===4?"long":k===5?"narrow":"short";break;case"e":if(k<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");y.weekday=["short","long","narrow","short"][k-4];break;case"c":if(k<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");y.weekday=["short","long","narrow","short"][k-4];break;case"a":y.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":y.hourCycle="h12",y.hour=["numeric","2-digit"][k-1];break;case"H":y.hourCycle="h23",y.hour=["numeric","2-digit"][k-1];break;case"K":y.hourCycle="h11",y.hour=["numeric","2-digit"][k-1];break;case"k":y.hourCycle="h24",y.hour=["numeric","2-digit"][k-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":y.minute=["numeric","2-digit"][k-1];break;case"s":y.second=["numeric","2-digit"][k-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":y.timeZoneName=k<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),y}var WHITE_SPACE_REGEX=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function parseNumberSkeletonFromString(E){if(E.length===0)throw new Error("Number skeleton cannot be empty");for(var y=E.split(WHITE_SPACE_REGEX).filter(function(Ne){return Ne.length>0}),R=[],k=0,H=y;k1)throw new RangeError("integer-width stems only accept a single optional option");H.options[0].replace(INTEGER_WIDTH_REGEX,function(ce,Ce,Oe,Le,Ne,Fe){if(Ce)y.minimumIntegerDigits=Oe.length;else{if(Le&&Ne)throw new Error("We currently do not support maximum integer digits");if(Fe)throw new Error("We currently do not support exact integer digits")}return""});continue}if(CONCISE_INTEGER_WIDTH_REGEX.test(H.stem)){y.minimumIntegerDigits=H.stem.length;continue}if(FRACTION_PRECISION_REGEX.test(H.stem)){if(H.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");H.stem.replace(FRACTION_PRECISION_REGEX,function(ce,Ce,Oe,Le,Ne,Fe){return Oe==="*"?y.minimumFractionDigits=Ce.length:Le&&Le[0]==="#"?y.maximumFractionDigits=Le.length:Ne&&Fe?(y.minimumFractionDigits=Ne.length,y.maximumFractionDigits=Ne.length+Fe.length):(y.minimumFractionDigits=Ce.length,y.maximumFractionDigits=Ce.length),""});var B=H.options[0];B==="w"?y=__assign$1(__assign$1({},y),{trailingZeroDisplay:"stripIfInteger"}):B&&(y=__assign$1(__assign$1({},y),parseSignificantPrecision(B)));continue}if(SIGNIFICANT_PRECISION_REGEX.test(H.stem)){y=__assign$1(__assign$1({},y),parseSignificantPrecision(H.stem));continue}var te=parseSign(H.stem);te&&(y=__assign$1(__assign$1({},y),te));var ae=parseConciseScientificAndEngineeringStem(H.stem);ae&&(y=__assign$1(__assign$1({},y),ae))}return y}var timeData={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function getBestPattern(E,y){for(var R="",k=0;k>1),ce="a",Ce=getDefaultHourSymbolFromLocale(y);for((Ce=="H"||Ce=="k")&&(ae=0);ae-- >0;)R+=ce;for(;te-- >0;)R=Ce+R}else H==="J"?R+="H":R+=H}return R}function getDefaultHourSymbolFromLocale(E){var y=E.hourCycle;if(y===void 0&&E.hourCycles&&E.hourCycles.length&&(y=E.hourCycles[0]),y)switch(y){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var R=E.language,k;R!=="root"&&(k=E.maximize().region);var H=timeData[k||""]||timeData[R||""]||timeData["".concat(R,"-001")]||timeData["001"];return H[0]}var _a,SPACE_SEPARATOR_START_REGEX=new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source,"*")),SPACE_SEPARATOR_END_REGEX=new RegExp("".concat(SPACE_SEPARATOR_REGEX.source,"*$"));function createLocation(E,y){return{start:E,end:y}}var hasNativeStartsWith=!!String.prototype.startsWith&&"_a".startsWith("a",1),hasNativeFromCodePoint=!!String.fromCodePoint,hasNativeFromEntries=!!Object.fromEntries,hasNativeCodePointAt=!!String.prototype.codePointAt,hasTrimStart=!!String.prototype.trimStart,hasTrimEnd=!!String.prototype.trimEnd,hasNativeIsSafeInteger=!!Number.isSafeInteger,isSafeInteger=hasNativeIsSafeInteger?Number.isSafeInteger:function(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E&&Math.abs(E)<=9007199254740991},REGEX_SUPPORTS_U_AND_Y=!0;try{var re=RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");REGEX_SUPPORTS_U_AND_Y=((_a=re.exec("a"))===null||_a===void 0?void 0:_a[0])==="a"}catch{REGEX_SUPPORTS_U_AND_Y=!1}var startsWith=hasNativeStartsWith?function(y,R,k){return y.startsWith(R,k)}:function(y,R,k){return y.slice(k,k+R.length)===R},fromCodePoint=hasNativeFromCodePoint?String.fromCodePoint:function(){for(var y=[],R=0;RB;){if(te=y[B++],te>1114111)throw RangeError(te+" is not a valid code point");k+=te<65536?String.fromCharCode(te):String.fromCharCode(((te-=65536)>>10)+55296,te%1024+56320)}return k},fromEntries=hasNativeFromEntries?Object.fromEntries:function(y){for(var R={},k=0,H=y;k=k)){var H=y.charCodeAt(R),B;return H<55296||H>56319||R+1===k||(B=y.charCodeAt(R+1))<56320||B>57343?H:(H-55296<<10)+(B-56320)+65536}},trimStart=hasTrimStart?function(y){return y.trimStart()}:function(y){return y.replace(SPACE_SEPARATOR_START_REGEX,"")},trimEnd=hasTrimEnd?function(y){return y.trimEnd()}:function(y){return y.replace(SPACE_SEPARATOR_END_REGEX,"")};function RE(E,y){return new RegExp(E,y)}var matchIdentifierAtIndex;if(REGEX_SUPPORTS_U_AND_Y){var IDENTIFIER_PREFIX_RE_1=RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");matchIdentifierAtIndex=function(y,R){var k;IDENTIFIER_PREFIX_RE_1.lastIndex=R;var H=IDENTIFIER_PREFIX_RE_1.exec(y);return(k=H[1])!==null&&k!==void 0?k:""}}else matchIdentifierAtIndex=function(y,R){for(var k=[];;){var H=codePointAt(y,R);if(H===void 0||_isWhiteSpace(H)||_isPatternSyntax(H))break;k.push(H),R+=H>=65536?2:1}return fromCodePoint.apply(void 0,k)};var Parser=function(){function E(y,R){R===void 0&&(R={}),this.message=y,this.position={offset:0,line:1,column:1},this.ignoreTag=!!R.ignoreTag,this.locale=R.locale,this.requiresOtherClause=!!R.requiresOtherClause,this.shouldParseSkeletons=!!R.shouldParseSkeletons}return E.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},E.prototype.parseMessage=function(y,R,k){for(var H=[];!this.isEOF();){var B=this.char();if(B===123){var te=this.parseArgument(y,k);if(te.err)return te;H.push(te.val)}else{if(B===125&&y>0)break;if(B===35&&(R==="plural"||R==="selectordinal")){var ae=this.clonePosition();this.bump(),H.push({type:TYPE.pound,location:createLocation(ae,this.clonePosition())})}else if(B===60&&!this.ignoreTag&&this.peek()===47){if(k)break;return this.error(ErrorKind.UNMATCHED_CLOSING_TAG,createLocation(this.clonePosition(),this.clonePosition()))}else if(B===60&&!this.ignoreTag&&_isAlpha(this.peek()||0)){var te=this.parseTag(y,R);if(te.err)return te;H.push(te.val)}else{var te=this.parseLiteral(y,R);if(te.err)return te;H.push(te.val)}}}return{val:H,err:null}},E.prototype.parseTag=function(y,R){var k=this.clonePosition();this.bump();var H=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:TYPE.literal,value:"<".concat(H,"/>"),location:createLocation(k,this.clonePosition())},err:null};if(this.bumpIf(">")){var B=this.parseMessage(y+1,R,!0);if(B.err)return B;var te=B.val,ae=this.clonePosition();if(this.bumpIf("")?{val:{type:TYPE.tag,value:H,children:te,location:createLocation(k,this.clonePosition())},err:null}:this.error(ErrorKind.INVALID_TAG,createLocation(ae,this.clonePosition())))}else return this.error(ErrorKind.UNCLOSED_TAG,createLocation(k,this.clonePosition()))}else return this.error(ErrorKind.INVALID_TAG,createLocation(k,this.clonePosition()))},E.prototype.parseTagName=function(){var y=this.offset();for(this.bump();!this.isEOF()&&_isPotentialElementNameChar(this.char());)this.bump();return this.message.slice(y,this.offset())},E.prototype.parseLiteral=function(y,R){for(var k=this.clonePosition(),H="";;){var B=this.tryParseQuote(R);if(B){H+=B;continue}var te=this.tryParseUnquoted(y,R);if(te){H+=te;continue}var ae=this.tryParseLeftAngleBracket();if(ae){H+=ae;continue}break}var ce=createLocation(k,this.clonePosition());return{val:{type:TYPE.literal,value:H,location:ce},err:null}},E.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!_isAlphaOrSlash(this.peek()||0))?(this.bump(),"<"):null},E.prototype.tryParseQuote=function(y){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(y==="plural"||y==="selectordinal")break;return null;default:return null}this.bump();var R=[this.char()];for(this.bump();!this.isEOF();){var k=this.char();if(k===39)if(this.peek()===39)R.push(39),this.bump();else{this.bump();break}else R.push(k);this.bump()}return fromCodePoint.apply(void 0,R)},E.prototype.tryParseUnquoted=function(y,R){if(this.isEOF())return null;var k=this.char();return k===60||k===123||k===35&&(R==="plural"||R==="selectordinal")||k===125&&y>0?null:(this.bump(),fromCodePoint(k))},E.prototype.parseArgument=function(y,R){var k=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,createLocation(k,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(ErrorKind.EMPTY_ARGUMENT,createLocation(k,this.clonePosition()));var H=this.parseIdentifierIfPossible().value;if(!H)return this.error(ErrorKind.MALFORMED_ARGUMENT,createLocation(k,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,createLocation(k,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:TYPE.argument,value:H,location:createLocation(k,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,createLocation(k,this.clonePosition())):this.parseArgumentOptions(y,R,H,k);default:return this.error(ErrorKind.MALFORMED_ARGUMENT,createLocation(k,this.clonePosition()))}},E.prototype.parseIdentifierIfPossible=function(){var y=this.clonePosition(),R=this.offset(),k=matchIdentifierAtIndex(this.message,R),H=R+k.length;this.bumpTo(H);var B=this.clonePosition(),te=createLocation(y,B);return{value:k,location:te}},E.prototype.parseArgumentOptions=function(y,R,k,H){var B,te=this.clonePosition(),ae=this.parseIdentifierIfPossible().value,ce=this.clonePosition();switch(ae){case"":return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE,createLocation(te,ce));case"number":case"date":case"time":{this.bumpSpace();var Ce=null;if(this.bumpIf(",")){this.bumpSpace();var Oe=this.clonePosition(),Le=this.parseSimpleArgStyleIfPossible();if(Le.err)return Le;var Ne=trimEnd(Le.val);if(Ne.length===0)return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE,createLocation(this.clonePosition(),this.clonePosition()));var Fe=createLocation(Oe,this.clonePosition());Ce={style:Ne,styleLocation:Fe}}var Ue=this.tryParseArgumentClose(H);if(Ue.err)return Ue;var De=createLocation(H,this.clonePosition());if(Ce&&startsWith(Ce==null?void 0:Ce.style,"::",0)){var $e=trimStart(Ce.style.slice(2));if(ae==="number"){var Le=this.parseNumberSkeletonFromString($e,Ce.styleLocation);return Le.err?Le:{val:{type:TYPE.number,value:k,location:De,style:Le.val},err:null}}else{if($e.length===0)return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON,De);var Be=$e;this.locale&&(Be=getBestPattern($e,this.locale));var Ne={type:SKELETON_TYPE.dateTime,pattern:Be,location:Ce.styleLocation,parsedOptions:this.shouldParseSkeletons?parseDateTimeSkeleton(Be):{}},Ve=ae==="date"?TYPE.date:TYPE.time;return{val:{type:Ve,value:k,location:De,style:Ne},err:null}}}return{val:{type:ae==="number"?TYPE.number:ae==="date"?TYPE.date:TYPE.time,value:k,location:De,style:(B=Ce==null?void 0:Ce.style)!==null&&B!==void 0?B:null},err:null}}case"plural":case"selectordinal":case"select":{var Ke=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS,createLocation(Ke,__assign$1({},Ke)));this.bumpSpace();var st=this.parseIdentifierIfPossible(),We=0;if(ae!=="select"&&st.value==="offset"){if(!this.bumpIf(":"))return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,createLocation(this.clonePosition(),this.clonePosition()));this.bumpSpace();var Le=this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(Le.err)return Le;this.bumpSpace(),st=this.parseIdentifierIfPossible(),We=Le.val}var at=this.tryParsePluralOrSelectOptions(y,ae,R,st);if(at.err)return at;var Ue=this.tryParseArgumentClose(H);if(Ue.err)return Ue;var tt=createLocation(H,this.clonePosition());return ae==="select"?{val:{type:TYPE.select,value:k,options:fromEntries(at.val),location:tt},err:null}:{val:{type:TYPE.plural,value:k,options:fromEntries(at.val),offset:We,pluralType:ae==="plural"?"cardinal":"ordinal",location:tt},err:null}}default:return this.error(ErrorKind.INVALID_ARGUMENT_TYPE,createLocation(te,ce))}},E.prototype.tryParseArgumentClose=function(y){return this.isEOF()||this.char()!==125?this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE,createLocation(y,this.clonePosition())):(this.bump(),{val:!0,err:null})},E.prototype.parseSimpleArgStyleIfPossible=function(){for(var y=0,R=this.clonePosition();!this.isEOF();){var k=this.char();switch(k){case 39:{this.bump();var H=this.clonePosition();if(!this.bumpUntil("'"))return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,createLocation(H,this.clonePosition()));this.bump();break}case 123:{y+=1,this.bump();break}case 125:{if(y>0)y-=1;else return{val:this.message.slice(R.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(R.offset,this.offset()),err:null}},E.prototype.parseNumberSkeletonFromString=function(y,R){var k=[];try{k=parseNumberSkeletonFromString(y)}catch{return this.error(ErrorKind.INVALID_NUMBER_SKELETON,R)}return{val:{type:SKELETON_TYPE.number,tokens:k,location:R,parsedOptions:this.shouldParseSkeletons?parseNumberSkeleton(k):{}},err:null}},E.prototype.tryParsePluralOrSelectOptions=function(y,R,k,H){for(var B,te=!1,ae=[],ce=new Set,Ce=H.value,Oe=H.location;;){if(Ce.length===0){var Le=this.clonePosition();if(R!=="select"&&this.bumpIf("=")){var Ne=this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR,ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);if(Ne.err)return Ne;Oe=createLocation(Le,this.clonePosition()),Ce=this.message.slice(Le.offset,this.offset())}else break}if(ce.has(Ce))return this.error(R==="select"?ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR:ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,Oe);Ce==="other"&&(te=!0),this.bumpSpace();var Fe=this.clonePosition();if(!this.bumpIf("{"))return this.error(R==="select"?ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,createLocation(this.clonePosition(),this.clonePosition()));var Ue=this.parseMessage(y+1,R,k);if(Ue.err)return Ue;var De=this.tryParseArgumentClose(Fe);if(De.err)return De;ae.push([Ce,{value:Ue.val,location:createLocation(Fe,this.clonePosition())}]),ce.add(Ce),this.bumpSpace(),B=this.parseIdentifierIfPossible(),Ce=B.value,Oe=B.location}return ae.length===0?this.error(R==="select"?ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR:ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR,createLocation(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!te?this.error(ErrorKind.MISSING_OTHER_CLAUSE,createLocation(this.clonePosition(),this.clonePosition())):{val:ae,err:null}},E.prototype.tryParseDecimalInteger=function(y,R){var k=1,H=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(k=-1);for(var B=!1,te=0;!this.isEOF();){var ae=this.char();if(ae>=48&&ae<=57)B=!0,te=te*10+(ae-48),this.bump();else break}var ce=createLocation(H,this.clonePosition());return B?(te*=k,isSafeInteger(te)?{val:te,err:null}:this.error(R,ce)):this.error(y,ce)},E.prototype.offset=function(){return this.position.offset},E.prototype.isEOF=function(){return this.offset()===this.message.length},E.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},E.prototype.char=function(){var y=this.position.offset;if(y>=this.message.length)throw Error("out of bound");var R=codePointAt(this.message,y);if(R===void 0)throw Error("Offset ".concat(y," is at invalid UTF-16 code unit boundary"));return R},E.prototype.error=function(y,R){return{val:null,err:{kind:y,message:this.message,location:R}}},E.prototype.bump=function(){if(!this.isEOF()){var y=this.char();y===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=y<65536?1:2)}},E.prototype.bumpIf=function(y){if(startsWith(this.message,y,this.offset())){for(var R=0;R=0?(this.bumpTo(k),!0):(this.bumpTo(this.message.length),!1)},E.prototype.bumpTo=function(y){if(this.offset()>y)throw Error("targetOffset ".concat(y," must be greater than or equal to the current offset ").concat(this.offset()));for(y=Math.min(y,this.message.length);;){var R=this.offset();if(R===y)break;if(R>y)throw Error("targetOffset ".concat(y," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},E.prototype.bumpSpace=function(){for(;!this.isEOF()&&_isWhiteSpace(this.char());)this.bump()},E.prototype.peek=function(){if(this.isEOF())return null;var y=this.char(),R=this.offset(),k=this.message.charCodeAt(R+(y>=65536?2:1));return k??null},E}();function _isAlpha(E){return E>=97&&E<=122||E>=65&&E<=90}function _isAlphaOrSlash(E){return _isAlpha(E)||E===47}function _isPotentialElementNameChar(E){return E===45||E===46||E>=48&&E<=57||E===95||E>=97&&E<=122||E>=65&&E<=90||E==183||E>=192&&E<=214||E>=216&&E<=246||E>=248&&E<=893||E>=895&&E<=8191||E>=8204&&E<=8205||E>=8255&&E<=8256||E>=8304&&E<=8591||E>=11264&&E<=12271||E>=12289&&E<=55295||E>=63744&&E<=64975||E>=65008&&E<=65533||E>=65536&&E<=983039}function _isWhiteSpace(E){return E>=9&&E<=13||E===32||E===133||E>=8206&&E<=8207||E===8232||E===8233}function _isPatternSyntax(E){return E>=33&&E<=35||E===36||E>=37&&E<=39||E===40||E===41||E===42||E===43||E===44||E===45||E>=46&&E<=47||E>=58&&E<=59||E>=60&&E<=62||E>=63&&E<=64||E===91||E===92||E===93||E===94||E===96||E===123||E===124||E===125||E===126||E===161||E>=162&&E<=165||E===166||E===167||E===169||E===171||E===172||E===174||E===176||E===177||E===182||E===187||E===191||E===215||E===247||E>=8208&&E<=8213||E>=8214&&E<=8215||E===8216||E===8217||E===8218||E>=8219&&E<=8220||E===8221||E===8222||E===8223||E>=8224&&E<=8231||E>=8240&&E<=8248||E===8249||E===8250||E>=8251&&E<=8254||E>=8257&&E<=8259||E===8260||E===8261||E===8262||E>=8263&&E<=8273||E===8274||E===8275||E>=8277&&E<=8286||E>=8592&&E<=8596||E>=8597&&E<=8601||E>=8602&&E<=8603||E>=8604&&E<=8607||E===8608||E>=8609&&E<=8610||E===8611||E>=8612&&E<=8613||E===8614||E>=8615&&E<=8621||E===8622||E>=8623&&E<=8653||E>=8654&&E<=8655||E>=8656&&E<=8657||E===8658||E===8659||E===8660||E>=8661&&E<=8691||E>=8692&&E<=8959||E>=8960&&E<=8967||E===8968||E===8969||E===8970||E===8971||E>=8972&&E<=8991||E>=8992&&E<=8993||E>=8994&&E<=9e3||E===9001||E===9002||E>=9003&&E<=9083||E===9084||E>=9085&&E<=9114||E>=9115&&E<=9139||E>=9140&&E<=9179||E>=9180&&E<=9185||E>=9186&&E<=9254||E>=9255&&E<=9279||E>=9280&&E<=9290||E>=9291&&E<=9311||E>=9472&&E<=9654||E===9655||E>=9656&&E<=9664||E===9665||E>=9666&&E<=9719||E>=9720&&E<=9727||E>=9728&&E<=9838||E===9839||E>=9840&&E<=10087||E===10088||E===10089||E===10090||E===10091||E===10092||E===10093||E===10094||E===10095||E===10096||E===10097||E===10098||E===10099||E===10100||E===10101||E>=10132&&E<=10175||E>=10176&&E<=10180||E===10181||E===10182||E>=10183&&E<=10213||E===10214||E===10215||E===10216||E===10217||E===10218||E===10219||E===10220||E===10221||E===10222||E===10223||E>=10224&&E<=10239||E>=10240&&E<=10495||E>=10496&&E<=10626||E===10627||E===10628||E===10629||E===10630||E===10631||E===10632||E===10633||E===10634||E===10635||E===10636||E===10637||E===10638||E===10639||E===10640||E===10641||E===10642||E===10643||E===10644||E===10645||E===10646||E===10647||E===10648||E>=10649&&E<=10711||E===10712||E===10713||E===10714||E===10715||E>=10716&&E<=10747||E===10748||E===10749||E>=10750&&E<=11007||E>=11008&&E<=11055||E>=11056&&E<=11076||E>=11077&&E<=11078||E>=11079&&E<=11084||E>=11085&&E<=11123||E>=11124&&E<=11125||E>=11126&&E<=11157||E===11158||E>=11159&&E<=11263||E>=11776&&E<=11777||E===11778||E===11779||E===11780||E===11781||E>=11782&&E<=11784||E===11785||E===11786||E===11787||E===11788||E===11789||E>=11790&&E<=11798||E===11799||E>=11800&&E<=11801||E===11802||E===11803||E===11804||E===11805||E>=11806&&E<=11807||E===11808||E===11809||E===11810||E===11811||E===11812||E===11813||E===11814||E===11815||E===11816||E===11817||E>=11818&&E<=11822||E===11823||E>=11824&&E<=11833||E>=11834&&E<=11835||E>=11836&&E<=11839||E===11840||E===11841||E===11842||E>=11843&&E<=11855||E>=11856&&E<=11857||E===11858||E>=11859&&E<=11903||E>=12289&&E<=12291||E===12296||E===12297||E===12298||E===12299||E===12300||E===12301||E===12302||E===12303||E===12304||E===12305||E>=12306&&E<=12307||E===12308||E===12309||E===12310||E===12311||E===12312||E===12313||E===12314||E===12315||E===12316||E===12317||E>=12318&&E<=12319||E===12320||E===12336||E===64830||E===64831||E>=65093&&E<=65094}function pruneLocation(E){E.forEach(function(y){if(delete y.location,isSelectElement(y)||isPluralElement(y))for(var R in y.options)delete y.options[R].location,pruneLocation(y.options[R].value);else isNumberElement(y)&&isNumberSkeleton(y.style)||(isDateElement(y)||isTimeElement(y))&&isDateTimeSkeleton(y.style)?delete y.style.location:isTagElement(y)&&pruneLocation(y.children)})}function parse(E,y){y===void 0&&(y={}),y=__assign$1({shouldParseSkeletons:!0,requiresOtherClause:!0},y);var R=new Parser(E,y).parse();if(R.err){var k=SyntaxError(ErrorKind[R.err.kind]);throw k.location=R.err.location,k.originalMessage=R.err.message,k}return y!=null&&y.captureLocation||pruneLocation(R.val),R.val}function memoize(E,y){var R=y&&y.cache?y.cache:cacheDefault,k=y&&y.serializer?y.serializer:serializerDefault,H=y&&y.strategy?y.strategy:strategyDefault;return H(E,{cache:R,serializer:k})}function isPrimitive(E){return E==null||typeof E=="number"||typeof E=="boolean"}function monadic(E,y,R,k){var H=isPrimitive(k)?k:R(k),B=y.get(H);return typeof B>"u"&&(B=E.call(this,k),y.set(H,B)),B}function variadic(E,y,R){var k=Array.prototype.slice.call(arguments,3),H=R(k),B=y.get(H);return typeof B>"u"&&(B=E.apply(this,k),y.set(H,B)),B}function assemble(E,y,R,k,H){return R.bind(y,E,k,H)}function strategyDefault(E,y){var R=E.length===1?monadic:variadic;return assemble(E,this,R,y.cache.create(),y.serializer)}function strategyVariadic(E,y){return assemble(E,this,variadic,y.cache.create(),y.serializer)}function strategyMonadic(E,y){return assemble(E,this,monadic,y.cache.create(),y.serializer)}var serializerDefault=function(){return JSON.stringify(arguments)};function ObjectWithoutPrototypeCache(){this.cache=Object.create(null)}ObjectWithoutPrototypeCache.prototype.get=function(E){return this.cache[E]};ObjectWithoutPrototypeCache.prototype.set=function(E,y){this.cache[E]=y};var cacheDefault={create:function(){return new ObjectWithoutPrototypeCache}},strategies={variadic:strategyVariadic,monadic:strategyMonadic},ErrorCode;(function(E){E.MISSING_VALUE="MISSING_VALUE",E.INVALID_VALUE="INVALID_VALUE",E.MISSING_INTL_API="MISSING_INTL_API"})(ErrorCode||(ErrorCode={}));var FormatError=function(E){__extends(y,E);function y(R,k,H){var B=E.call(this,R)||this;return B.code=k,B.originalMessage=H,B}return y.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},y}(Error),InvalidValueError=function(E){__extends(y,E);function y(R,k,H,B){return E.call(this,'Invalid values for "'.concat(R,'": "').concat(k,'". Options are "').concat(Object.keys(H).join('", "'),'"'),ErrorCode.INVALID_VALUE,B)||this}return y}(FormatError),InvalidValueTypeError=function(E){__extends(y,E);function y(R,k,H){return E.call(this,'Value for "'.concat(R,'" must be of type ').concat(k),ErrorCode.INVALID_VALUE,H)||this}return y}(FormatError),MissingValueError=function(E){__extends(y,E);function y(R,k){return E.call(this,'The intl string context variable "'.concat(R,'" was not provided to the string "').concat(k,'"'),ErrorCode.MISSING_VALUE,k)||this}return y}(FormatError),PART_TYPE;(function(E){E[E.literal=0]="literal",E[E.object=1]="object"})(PART_TYPE||(PART_TYPE={}));function mergeLiteral(E){return E.length<2?E:E.reduce(function(y,R){var k=y[y.length-1];return!k||k.type!==PART_TYPE.literal||R.type!==PART_TYPE.literal?y.push(R):k.value+=R.value,y},[])}function isFormatXMLElementFn(E){return typeof E=="function"}function formatToParts(E,y,R,k,H,B,te){if(E.length===1&&isLiteralElement(E[0]))return[{type:PART_TYPE.literal,value:E[0].value}];for(var ae=[],ce=0,Ce=E;ce"u")){var R=Intl.NumberFormat.supportedLocalesOf(y);return R.length>0?new Intl.Locale(R[0]):new Intl.Locale(typeof y=="string"?y:y[0])}},E.__parse=parse,E.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},E}(),polyfill={};function _typeof(E){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},_typeof(E)}function _classCallCheck(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function _defineProperties(E,y){for(var R=0;R0&&arguments[0]!==void 0?arguments[0]:[],Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck(this,Ne),_classPrivateFieldInitSpec(this,te,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,ae,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,ce,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,Ce,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,Oe,{writable:!0,value:void 0}),_classPrivateFieldSet(this,te,B(Fe)),_classPrivateFieldSet(this,ce,y(_classPrivateFieldGet(this,te))),_classPrivateFieldSet(this,ae,k(_classPrivateFieldGet(this,te))),_classPrivateFieldSet(this,Ce,getType(Ue)),_classPrivateFieldSet(this,Oe,new E("en",Ue))}return _createClass(Ne,[{key:"resolvedOptions",value:function(){var Ue=_classPrivateFieldGet(this,Oe).resolvedOptions(),De=Ue.minimumIntegerDigits,$e=Ue.minimumFractionDigits,Be=Ue.maximumFractionDigits,Ve=Ue.minimumSignificantDigits,Ke=Ue.maximumSignificantDigits,st=Ue.roundingPriority,We={locale:_classPrivateFieldGet(this,te),type:_classPrivateFieldGet(this,Ce),minimumIntegerDigits:De,minimumFractionDigits:$e,maximumFractionDigits:Be};return typeof Ve=="number"&&(We.minimumSignificantDigits=Ve,We.maximumSignificantDigits=Ke),We.pluralCategories=R(_classPrivateFieldGet(this,te),_classPrivateFieldGet(this,Ce)==="ordinal").slice(0),We.roundingPriority=st||"auto",We}},{key:"select",value:function(Ue){if(!(this instanceof Ne))throw new TypeError("select() called on incompatible ".concat(this));if(typeof Ue!="number"&&(Ue=Number(Ue)),!isFinite(Ue))return"other";var De=_classPrivateFieldGet(this,Oe).format(Math.abs(Ue));return _classPrivateFieldGet(this,ce).call(this,De,_classPrivateFieldGet(this,Ce)==="ordinal")}},{key:"selectRange",value:function(Ue,De){if(!(this instanceof Ne))throw new TypeError("selectRange() called on incompatible ".concat(this));if(Ue===void 0)throw new TypeError("start is undefined");if(De===void 0)throw new TypeError("end is undefined");var $e=toNumber(Ue),Be=toNumber(De);if(!isFinite($e))throw new RangeError("start must be finite");if(!isFinite(Be))throw new RangeError("end must be finite");return _classPrivateFieldGet(this,ae).call(this,this.select($e),this.select(Be))}}],[{key:"supportedLocalesOf",value:function(Ue){return canonicalizeLocaleList(Ue).filter(H)}}]),Ne}();return typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(Le.prototype,Symbol.toStringTag,{value:"Intl.PluralRules",writable:!1,configurable:!0}),Object.defineProperty(Le,"prototype",{writable:!1}),Le}const factory=Object.freeze(Object.defineProperty({__proto__:null,default:getPluralRules},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(factory);var pluralRules,hasRequiredPluralRules;function requirePluralRules(){if(hasRequiredPluralRules)return pluralRules;hasRequiredPluralRules=1;var E=require$$0;function y(tt){return tt&&typeof tt=="object"&&"default"in tt?tt:{default:tt}}function R(tt,ft){return ft.forEach(function(Ye){Ye&&typeof Ye!="string"&&!Array.isArray(Ye)&&Object.keys(Ye).forEach(function(ot){if(ot!=="default"&&!(ot in tt)){var nt=Object.getOwnPropertyDescriptor(Ye,ot);Object.defineProperty(tt,ot,nt.get?nt:{enumerable:!0,get:function(){return Ye[ot]}})}})}),Object.freeze(tt)}var k=y(E),H=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof commonjsGlobal$1<"u"?commonjsGlobal$1:typeof self<"u"?self:{};function B(tt){return tt&&tt.__esModule&&Object.prototype.hasOwnProperty.call(tt,"default")?tt.default:tt}var te={exports:{}};(function(tt,ft){var Ye=function(ke,Xe){return Xe?"other":ke==1?"one":"other"},ot=function(ke,Xe){return Xe?"other":ke==0||ke==1?"one":"other"},nt=function(ke,Xe){return Xe?"other":ke>=0&&ke<=1?"one":"other"},pt=function(ke,Xe){var qe=String(ke).split("."),Ge=!qe[1];return Xe?"other":ke==1&&Ge?"one":"other"},dt=function(ke,Xe){return"other"},rt=function(ke,Xe){return Xe?"other":ke==1?"one":ke==2?"two":"other"};(function(Qe,ke){Object.defineProperty(ke,"__esModule",{value:!0}),tt.exports=ke})(H,{af:Ye,ak:ot,am:nt,an:Ye,ar:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-2);return Xe?"other":ke==0?"zero":ke==1?"one":ke==2?"two":je>=3&&je<=10?"few":je>=11&&je<=99?"many":"other"},ars:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-2);return Xe?"other":ke==0?"zero":ke==1?"one":ke==2?"two":je>=3&&je<=10?"few":je>=11&&je<=99?"many":"other"},as:function(ke,Xe){return Xe?ke==1||ke==5||ke==7||ke==8||ke==9||ke==10?"one":ke==2||ke==3?"two":ke==4?"few":ke==6?"many":"other":ke>=0&&ke<=1?"one":"other"},asa:Ye,ast:pt,az:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=Ge.slice(-1),He=Ge.slice(-2),Ze=Ge.slice(-3);return Xe?je==1||je==2||je==5||je==7||je==8||He==20||He==50||He==70||He==80?"one":je==3||je==4||Ze==100||Ze==200||Ze==300||Ze==400||Ze==500||Ze==600||Ze==700||Ze==800||Ze==900?"few":Ge==0||je==6||He==40||He==60||He==90?"many":"other":ke==1?"one":"other"},bal:function(ke,Xe){return ke==1?"one":"other"},be:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-1),He=Ge&&qe[0].slice(-2);return Xe?(je==2||je==3)&&He!=12&&He!=13?"few":"other":je==1&&He!=11?"one":je>=2&&je<=4&&(He<12||He>14)?"few":Ge&&je==0||je>=5&&je<=9||He>=11&&He<=14?"many":"other"},bem:Ye,bez:Ye,bg:Ye,bho:ot,bm:dt,bn:function(ke,Xe){return Xe?ke==1||ke==5||ke==7||ke==8||ke==9||ke==10?"one":ke==2||ke==3?"two":ke==4?"few":ke==6?"many":"other":ke>=0&&ke<=1?"one":"other"},bo:dt,br:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-1),He=Ge&&qe[0].slice(-2),Ze=Ge&&qe[0].slice(-6);return Xe?"other":je==1&&He!=11&&He!=71&&He!=91?"one":je==2&&He!=12&&He!=72&&He!=92?"two":(je==3||je==4||je==9)&&(He<10||He>19)&&(He<70||He>79)&&(He<90||He>99)?"few":ke!=0&&Ge&&Ze==0?"many":"other"},brx:Ye,bs:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-1),mt=Ge.slice(-2),gt=je.slice(-1),vt=je.slice(-2);return Xe?"other":He&&Ze==1&&mt!=11||gt==1&&vt!=11?"one":He&&Ze>=2&&Ze<=4&&(mt<12||mt>14)||gt>=2&><=4&&(vt<12||vt>14)?"few":"other"},ca:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-6);return Xe?ke==1||ke==3?"one":ke==2?"two":ke==4?"few":"other":ke==1&&je?"one":Ge!=0&&He==0&&je?"many":"other"},ce:Ye,ceb:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-1),mt=je.slice(-1);return Xe?"other":He&&(Ge==1||Ge==2||Ge==3)||He&&Ze!=4&&Ze!=6&&Ze!=9||!He&&mt!=4&&mt!=6&&mt!=9?"one":"other"},cgg:Ye,chr:Ye,ckb:Ye,cs:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1];return Xe?"other":ke==1&&je?"one":Ge>=2&&Ge<=4&&je?"few":je?"other":"many"},cy:function(ke,Xe){return Xe?ke==0||ke==7||ke==8||ke==9?"zero":ke==1?"one":ke==2?"two":ke==3||ke==4?"few":ke==5||ke==6?"many":"other":ke==0?"zero":ke==1?"one":ke==2?"two":ke==3?"few":ke==6?"many":"other"},da:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=Number(qe[0])==ke;return Xe?"other":ke==1||!je&&(Ge==0||Ge==1)?"one":"other"},de:pt,doi:nt,dsb:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-2),mt=je.slice(-2);return Xe?"other":He&&Ze==1||mt==1?"one":He&&Ze==2||mt==2?"two":He&&(Ze==3||Ze==4)||mt==3||mt==4?"few":"other"},dv:Ye,dz:dt,ee:Ye,el:Ye,en:function(ke,Xe){var qe=String(ke).split("."),Ge=!qe[1],je=Number(qe[0])==ke,He=je&&qe[0].slice(-1),Ze=je&&qe[0].slice(-2);return Xe?He==1&&Ze!=11?"one":He==2&&Ze!=12?"two":He==3&&Ze!=13?"few":"other":ke==1&&Ge?"one":"other"},eo:Ye,es:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-6);return Xe?"other":ke==1?"one":Ge!=0&&He==0&&je?"many":"other"},et:pt,eu:Ye,fa:nt,ff:function(ke,Xe){return Xe?"other":ke>=0&&ke<2?"one":"other"},fi:pt,fil:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-1),mt=je.slice(-1);return Xe?ke==1?"one":"other":He&&(Ge==1||Ge==2||Ge==3)||He&&Ze!=4&&Ze!=6&&Ze!=9||!He&&mt!=4&&mt!=6&&mt!=9?"one":"other"},fo:Ye,fr:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-6);return Xe?ke==1?"one":"other":ke>=0&&ke<2?"one":Ge!=0&&He==0&&je?"many":"other"},fur:Ye,fy:pt,ga:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke;return Xe?ke==1?"one":"other":ke==1?"one":ke==2?"two":Ge&&ke>=3&&ke<=6?"few":Ge&&ke>=7&&ke<=10?"many":"other"},gd:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke;return Xe?ke==1||ke==11?"one":ke==2||ke==12?"two":ke==3||ke==13?"few":"other":ke==1||ke==11?"one":ke==2||ke==12?"two":Ge&&ke>=3&&ke<=10||Ge&&ke>=13&&ke<=19?"few":"other"},gl:pt,gsw:Ye,gu:function(ke,Xe){return Xe?ke==1?"one":ke==2||ke==3?"two":ke==4?"few":ke==6?"many":"other":ke>=0&&ke<=1?"one":"other"},guw:ot,gv:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-1),Ze=Ge.slice(-2);return Xe?"other":je&&He==1?"one":je&&He==2?"two":je&&(Ze==0||Ze==20||Ze==40||Ze==60||Ze==80)?"few":je?"other":"many"},ha:Ye,haw:Ye,he:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1];return Xe?"other":Ge==1&&je||Ge==0&&!je?"one":Ge==2&&je?"two":"other"},hi:function(ke,Xe){return Xe?ke==1?"one":ke==2||ke==3?"two":ke==4?"few":ke==6?"many":"other":ke>=0&&ke<=1?"one":"other"},hnj:dt,hr:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-1),mt=Ge.slice(-2),gt=je.slice(-1),vt=je.slice(-2);return Xe?"other":He&&Ze==1&&mt!=11||gt==1&&vt!=11?"one":He&&Ze>=2&&Ze<=4&&(mt<12||mt>14)||gt>=2&><=4&&(vt<12||vt>14)?"few":"other"},hsb:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-2),mt=je.slice(-2);return Xe?"other":He&&Ze==1||mt==1?"one":He&&Ze==2||mt==2?"two":He&&(Ze==3||Ze==4)||mt==3||mt==4?"few":"other"},hu:function(ke,Xe){return Xe?ke==1||ke==5?"one":"other":ke==1?"one":"other"},hy:function(ke,Xe){return Xe?ke==1?"one":"other":ke>=0&&ke<2?"one":"other"},ia:pt,id:dt,ig:dt,ii:dt,io:pt,is:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=(qe[1]||"").replace(/0+$/,""),He=Number(qe[0])==ke,Ze=Ge.slice(-1),mt=Ge.slice(-2);return Xe?"other":He&&Ze==1&&mt!=11||je%10==1&&je%100!=11?"one":"other"},it:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-6);return Xe?ke==11||ke==8||ke==80||ke==800?"many":"other":ke==1&&je?"one":Ge!=0&&He==0&&je?"many":"other"},iu:rt,ja:dt,jbo:dt,jgo:Ye,jmc:Ye,jv:dt,jw:dt,ka:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=Ge.slice(-2);return Xe?Ge==1?"one":Ge==0||je>=2&&je<=20||je==40||je==60||je==80?"many":"other":ke==1?"one":"other"},kab:function(ke,Xe){return Xe?"other":ke>=0&&ke<2?"one":"other"},kaj:Ye,kcg:Ye,kde:dt,kea:dt,kk:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-1);return Xe?je==6||je==9||Ge&&je==0&&ke!=0?"many":"other":ke==1?"one":"other"},kkj:Ye,kl:Ye,km:dt,kn:nt,ko:dt,ks:Ye,ksb:Ye,ksh:function(ke,Xe){return Xe?"other":ke==0?"zero":ke==1?"one":"other"},ku:Ye,kw:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-2),He=Ge&&qe[0].slice(-3),Ze=Ge&&qe[0].slice(-5),mt=Ge&&qe[0].slice(-6);return Xe?Ge&&ke>=1&&ke<=4||je>=1&&je<=4||je>=21&&je<=24||je>=41&&je<=44||je>=61&&je<=64||je>=81&&je<=84?"one":ke==5||je==5?"many":"other":ke==0?"zero":ke==1?"one":je==2||je==22||je==42||je==62||je==82||Ge&&He==0&&(Ze>=1e3&&Ze<=2e4||Ze==4e4||Ze==6e4||Ze==8e4)||ke!=0&&mt==1e5?"two":je==3||je==23||je==43||je==63||je==83?"few":ke!=1&&(je==1||je==21||je==41||je==61||je==81)?"many":"other"},ky:Ye,lag:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0];return Xe?"other":ke==0?"zero":(Ge==0||Ge==1)&&ke!=0?"one":"other"},lb:Ye,lg:Ye,lij:function(ke,Xe){var qe=String(ke).split("."),Ge=!qe[1],je=Number(qe[0])==ke;return Xe?ke==11||ke==8||je&&ke>=80&&ke<=89||je&&ke>=800&&ke<=899?"many":"other":ke==1&&Ge?"one":"other"},lkt:dt,ln:ot,lo:function(ke,Xe){return Xe&&ke==1?"one":"other"},lt:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[1]||"",je=Number(qe[0])==ke,He=je&&qe[0].slice(-1),Ze=je&&qe[0].slice(-2);return Xe?"other":He==1&&(Ze<11||Ze>19)?"one":He>=2&&He<=9&&(Ze<11||Ze>19)?"few":Ge!=0?"many":"other"},lv:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[1]||"",je=Ge.length,He=Number(qe[0])==ke,Ze=He&&qe[0].slice(-1),mt=He&&qe[0].slice(-2),gt=Ge.slice(-2),vt=Ge.slice(-1);return Xe?"other":He&&Ze==0||mt>=11&&mt<=19||je==2&>>=11&><=19?"zero":Ze==1&&mt!=11||je==2&&vt==1&>!=11||je!=2&&vt==1?"one":"other"},mas:Ye,mg:ot,mgo:Ye,mk:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-1),mt=Ge.slice(-2),gt=je.slice(-1),vt=je.slice(-2);return Xe?Ze==1&&mt!=11?"one":Ze==2&&mt!=12?"two":(Ze==7||Ze==8)&&mt!=17&&mt!=18?"many":"other":He&&Ze==1&&mt!=11||gt==1&&vt!=11?"one":"other"},ml:Ye,mn:Ye,mo:function(ke,Xe){var qe=String(ke).split("."),Ge=!qe[1],je=Number(qe[0])==ke,He=je&&qe[0].slice(-2);return Xe?ke==1?"one":"other":ke==1&&Ge?"one":!Ge||ke==0||ke!=1&&He>=1&&He<=19?"few":"other"},mr:function(ke,Xe){return Xe?ke==1?"one":ke==2||ke==3?"two":ke==4?"few":"other":ke==1?"one":"other"},ms:function(ke,Xe){return Xe&&ke==1?"one":"other"},mt:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-2);return Xe?"other":ke==1?"one":ke==2?"two":ke==0||je>=3&&je<=10?"few":je>=11&&je<=19?"many":"other"},my:dt,nah:Ye,naq:rt,nb:Ye,nd:Ye,ne:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke;return Xe?Ge&&ke>=1&&ke<=4?"one":"other":ke==1?"one":"other"},nl:pt,nn:Ye,nnh:Ye,no:Ye,nqo:dt,nr:Ye,nso:ot,ny:Ye,nyn:Ye,om:Ye,or:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke;return Xe?ke==1||ke==5||Ge&&ke>=7&&ke<=9?"one":ke==2||ke==3?"two":ke==4?"few":ke==6?"many":"other":ke==1?"one":"other"},os:Ye,osa:dt,pa:ot,pap:Ye,pcm:nt,pl:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-1),Ze=Ge.slice(-2);return Xe?"other":ke==1&&je?"one":je&&He>=2&&He<=4&&(Ze<12||Ze>14)?"few":je&&Ge!=1&&(He==0||He==1)||je&&He>=5&&He<=9||je&&Ze>=12&&Ze<=14?"many":"other"},prg:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[1]||"",je=Ge.length,He=Number(qe[0])==ke,Ze=He&&qe[0].slice(-1),mt=He&&qe[0].slice(-2),gt=Ge.slice(-2),vt=Ge.slice(-1);return Xe?"other":He&&Ze==0||mt>=11&&mt<=19||je==2&>>=11&><=19?"zero":Ze==1&&mt!=11||je==2&&vt==1&>!=11||je!=2&&vt==1?"one":"other"},ps:Ye,pt:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-6);return Xe?"other":Ge==0||Ge==1?"one":Ge!=0&&He==0&&je?"many":"other"},pt_PT:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-6);return Xe?"other":ke==1&&je?"one":Ge!=0&&He==0&&je?"many":"other"},rm:Ye,ro:function(ke,Xe){var qe=String(ke).split("."),Ge=!qe[1],je=Number(qe[0])==ke,He=je&&qe[0].slice(-2);return Xe?ke==1?"one":"other":ke==1&&Ge?"one":!Ge||ke==0||ke!=1&&He>=1&&He<=19?"few":"other"},rof:Ye,ru:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-1),Ze=Ge.slice(-2);return Xe?"other":je&&He==1&&Ze!=11?"one":je&&He>=2&&He<=4&&(Ze<12||Ze>14)?"few":je&&He==0||je&&He>=5&&He<=9||je&&Ze>=11&&Ze<=14?"many":"other"},rwk:Ye,sah:dt,saq:Ye,sat:rt,sc:function(ke,Xe){var qe=String(ke).split("."),Ge=!qe[1];return Xe?ke==11||ke==8||ke==80||ke==800?"many":"other":ke==1&&Ge?"one":"other"},scn:function(ke,Xe){var qe=String(ke).split("."),Ge=!qe[1];return Xe?ke==11||ke==8||ke==80||ke==800?"many":"other":ke==1&&Ge?"one":"other"},sd:Ye,sdh:Ye,se:rt,seh:Ye,ses:dt,sg:dt,sh:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-1),mt=Ge.slice(-2),gt=je.slice(-1),vt=je.slice(-2);return Xe?"other":He&&Ze==1&&mt!=11||gt==1&&vt!=11?"one":He&&Ze>=2&&Ze<=4&&(mt<12||mt>14)||gt>=2&><=4&&(vt<12||vt>14)?"few":"other"},shi:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke;return Xe?"other":ke>=0&&ke<=1?"one":Ge&&ke>=2&&ke<=10?"few":"other"},si:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"";return Xe?"other":ke==0||ke==1||Ge==0&&je==1?"one":"other"},sk:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1];return Xe?"other":ke==1&&je?"one":Ge>=2&&Ge<=4&&je?"few":je?"other":"many"},sl:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-2);return Xe?"other":je&&He==1?"one":je&&He==2?"two":je&&(He==3||He==4)||!je?"few":"other"},sma:rt,smi:rt,smj:rt,smn:rt,sms:rt,sn:Ye,so:Ye,sq:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-1),He=Ge&&qe[0].slice(-2);return Xe?ke==1?"one":je==4&&He!=14?"many":"other":ke==1?"one":"other"},sr:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-1),mt=Ge.slice(-2),gt=je.slice(-1),vt=je.slice(-2);return Xe?"other":He&&Ze==1&&mt!=11||gt==1&&vt!=11?"one":He&&Ze>=2&&Ze<=4&&(mt<12||mt>14)||gt>=2&><=4&&(vt<12||vt>14)?"few":"other"},ss:Ye,ssy:Ye,st:Ye,su:dt,sv:function(ke,Xe){var qe=String(ke).split("."),Ge=!qe[1],je=Number(qe[0])==ke,He=je&&qe[0].slice(-1),Ze=je&&qe[0].slice(-2);return Xe?(He==1||He==2)&&Ze!=11&&Ze!=12?"one":"other":ke==1&&Ge?"one":"other"},sw:pt,syr:Ye,ta:Ye,te:Ye,teo:Ye,th:dt,ti:ot,tig:Ye,tk:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke,je=Ge&&qe[0].slice(-1);return Xe?je==6||je==9||ke==10?"few":"other":ke==1?"one":"other"},tl:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=qe[1]||"",He=!qe[1],Ze=Ge.slice(-1),mt=je.slice(-1);return Xe?ke==1?"one":"other":He&&(Ge==1||Ge==2||Ge==3)||He&&Ze!=4&&Ze!=6&&Ze!=9||!He&&mt!=4&&mt!=6&&mt!=9?"one":"other"},tn:Ye,to:dt,tpi:dt,tr:Ye,ts:Ye,tzm:function(ke,Xe){var qe=String(ke).split("."),Ge=Number(qe[0])==ke;return Xe?"other":ke==0||ke==1||Ge&&ke>=11&&ke<=99?"one":"other"},ug:Ye,uk:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Number(qe[0])==ke,Ze=He&&qe[0].slice(-1),mt=He&&qe[0].slice(-2),gt=Ge.slice(-1),vt=Ge.slice(-2);return Xe?Ze==3&&mt!=13?"few":"other":je&>==1&&vt!=11?"one":je&>>=2&><=4&&(vt<12||vt>14)?"few":je&>==0||je&>>=5&><=9||je&&vt>=11&&vt<=14?"many":"other"},und:dt,ur:pt,uz:Ye,ve:Ye,vec:function(ke,Xe){var qe=String(ke).split("."),Ge=qe[0],je=!qe[1],He=Ge.slice(-6);return Xe?ke==11||ke==8||ke==80||ke==800?"many":"other":ke==1&&je?"one":Ge!=0&&He==0&&je?"many":"other"},vi:function(ke,Xe){return Xe&&ke==1?"one":"other"},vo:Ye,vun:Ye,wa:ot,wae:Ye,wo:dt,xh:Ye,xog:Ye,yi:pt,yo:dt,yue:dt,zh:dt,zu:nt})})(te);var ae=B(te.exports),ce=R({__proto__:null,default:ae},[te.exports]),Ce={exports:{}};(function(tt,ft){var Ye="zero",ot="one",nt="two",pt="few",dt="many",rt="other",Qe={cardinal:[ot,rt],ordinal:[rt]},ke={cardinal:[ot,rt],ordinal:[ot,rt]},Xe={cardinal:[rt],ordinal:[rt]},qe={cardinal:[ot,nt,rt],ordinal:[rt]};(function(Ge,je){Object.defineProperty(je,"__esModule",{value:!0}),tt.exports=je})(H,{af:Qe,ak:Qe,am:Qe,an:Qe,ar:{cardinal:[Ye,ot,nt,pt,dt,rt],ordinal:[rt]},ars:{cardinal:[Ye,ot,nt,pt,dt,rt],ordinal:[rt]},as:{cardinal:[ot,rt],ordinal:[ot,nt,pt,dt,rt]},asa:Qe,ast:Qe,az:{cardinal:[ot,rt],ordinal:[ot,pt,dt,rt]},bal:ke,be:{cardinal:[ot,pt,dt,rt],ordinal:[pt,rt]},bem:Qe,bez:Qe,bg:Qe,bho:Qe,bm:Xe,bn:{cardinal:[ot,rt],ordinal:[ot,nt,pt,dt,rt]},bo:Xe,br:{cardinal:[ot,nt,pt,dt,rt],ordinal:[rt]},brx:Qe,bs:{cardinal:[ot,pt,rt],ordinal:[rt]},ca:{cardinal:[ot,dt,rt],ordinal:[ot,nt,pt,rt]},ce:Qe,ceb:Qe,cgg:Qe,chr:Qe,ckb:Qe,cs:{cardinal:[ot,pt,dt,rt],ordinal:[rt]},cy:{cardinal:[Ye,ot,nt,pt,dt,rt],ordinal:[Ye,ot,nt,pt,dt,rt]},da:Qe,de:Qe,doi:Qe,dsb:{cardinal:[ot,nt,pt,rt],ordinal:[rt]},dv:Qe,dz:Xe,ee:Qe,el:Qe,en:{cardinal:[ot,rt],ordinal:[ot,nt,pt,rt]},eo:Qe,es:{cardinal:[ot,dt,rt],ordinal:[rt]},et:Qe,eu:Qe,fa:Qe,ff:Qe,fi:Qe,fil:ke,fo:Qe,fr:{cardinal:[ot,dt,rt],ordinal:[ot,rt]},fur:Qe,fy:Qe,ga:{cardinal:[ot,nt,pt,dt,rt],ordinal:[ot,rt]},gd:{cardinal:[ot,nt,pt,rt],ordinal:[ot,nt,pt,rt]},gl:Qe,gsw:Qe,gu:{cardinal:[ot,rt],ordinal:[ot,nt,pt,dt,rt]},guw:Qe,gv:{cardinal:[ot,nt,pt,dt,rt],ordinal:[rt]},ha:Qe,haw:Qe,he:qe,hi:{cardinal:[ot,rt],ordinal:[ot,nt,pt,dt,rt]},hnj:Xe,hr:{cardinal:[ot,pt,rt],ordinal:[rt]},hsb:{cardinal:[ot,nt,pt,rt],ordinal:[rt]},hu:ke,hy:ke,ia:Qe,id:Xe,ig:Xe,ii:Xe,io:Qe,is:Qe,it:{cardinal:[ot,dt,rt],ordinal:[dt,rt]},iu:qe,ja:Xe,jbo:Xe,jgo:Qe,jmc:Qe,jv:Xe,jw:Xe,ka:{cardinal:[ot,rt],ordinal:[ot,dt,rt]},kab:Qe,kaj:Qe,kcg:Qe,kde:Xe,kea:Xe,kk:{cardinal:[ot,rt],ordinal:[dt,rt]},kkj:Qe,kl:Qe,km:Xe,kn:Qe,ko:Xe,ks:Qe,ksb:Qe,ksh:{cardinal:[Ye,ot,rt],ordinal:[rt]},ku:Qe,kw:{cardinal:[Ye,ot,nt,pt,dt,rt],ordinal:[ot,dt,rt]},ky:Qe,lag:{cardinal:[Ye,ot,rt],ordinal:[rt]},lb:Qe,lg:Qe,lij:{cardinal:[ot,rt],ordinal:[dt,rt]},lkt:Xe,ln:Qe,lo:{cardinal:[rt],ordinal:[ot,rt]},lt:{cardinal:[ot,pt,dt,rt],ordinal:[rt]},lv:{cardinal:[Ye,ot,rt],ordinal:[rt]},mas:Qe,mg:Qe,mgo:Qe,mk:{cardinal:[ot,rt],ordinal:[ot,nt,dt,rt]},ml:Qe,mn:Qe,mo:{cardinal:[ot,pt,rt],ordinal:[ot,rt]},mr:{cardinal:[ot,rt],ordinal:[ot,nt,pt,rt]},ms:{cardinal:[rt],ordinal:[ot,rt]},mt:{cardinal:[ot,nt,pt,dt,rt],ordinal:[rt]},my:Xe,nah:Qe,naq:qe,nb:Qe,nd:Qe,ne:ke,nl:Qe,nn:Qe,nnh:Qe,no:Qe,nqo:Xe,nr:Qe,nso:Qe,ny:Qe,nyn:Qe,om:Qe,or:{cardinal:[ot,rt],ordinal:[ot,nt,pt,dt,rt]},os:Qe,osa:Xe,pa:Qe,pap:Qe,pcm:Qe,pl:{cardinal:[ot,pt,dt,rt],ordinal:[rt]},prg:{cardinal:[Ye,ot,rt],ordinal:[rt]},ps:Qe,pt:{cardinal:[ot,dt,rt],ordinal:[rt]},pt_PT:{cardinal:[ot,dt,rt],ordinal:[rt]},rm:Qe,ro:{cardinal:[ot,pt,rt],ordinal:[ot,rt]},rof:Qe,ru:{cardinal:[ot,pt,dt,rt],ordinal:[rt]},rwk:Qe,sah:Xe,saq:Qe,sat:qe,sc:{cardinal:[ot,rt],ordinal:[dt,rt]},scn:{cardinal:[ot,rt],ordinal:[dt,rt]},sd:Qe,sdh:Qe,se:qe,seh:Qe,ses:Xe,sg:Xe,sh:{cardinal:[ot,pt,rt],ordinal:[rt]},shi:{cardinal:[ot,pt,rt],ordinal:[rt]},si:Qe,sk:{cardinal:[ot,pt,dt,rt],ordinal:[rt]},sl:{cardinal:[ot,nt,pt,rt],ordinal:[rt]},sma:qe,smi:qe,smj:qe,smn:qe,sms:qe,sn:Qe,so:Qe,sq:{cardinal:[ot,rt],ordinal:[ot,dt,rt]},sr:{cardinal:[ot,pt,rt],ordinal:[rt]},ss:Qe,ssy:Qe,st:Qe,su:Xe,sv:ke,sw:Qe,syr:Qe,ta:Qe,te:Qe,teo:Qe,th:Xe,ti:Qe,tig:Qe,tk:{cardinal:[ot,rt],ordinal:[pt,rt]},tl:ke,tn:Qe,to:Xe,tpi:Xe,tr:Qe,ts:Qe,tzm:Qe,ug:Qe,uk:{cardinal:[ot,pt,dt,rt],ordinal:[pt,rt]},und:Xe,ur:Qe,uz:Qe,ve:Qe,vec:{cardinal:[ot,dt,rt],ordinal:[dt,rt]},vi:{cardinal:[rt],ordinal:[ot,rt]},vo:Qe,vun:Qe,wa:Qe,wae:Qe,wo:Xe,xh:Qe,xog:Qe,yi:Qe,yo:Xe,yue:Xe,zh:Xe,zu:Qe})})(Ce);var Oe=B(Ce.exports),Le=R({__proto__:null,default:Oe},[Ce.exports]),Ne={exports:{}};(function(tt,ft){var Ye=function(dt,rt){return"other"},ot=function(dt,rt){return dt==="other"&&rt==="one"?"one":"other"},nt=function(dt,rt){return rt||"other"};(function(pt,dt){Object.defineProperty(dt,"__esModule",{value:!0}),tt.exports=dt})(H,{af:Ye,ak:ot,am:nt,an:Ye,ar:function(dt,rt){return rt==="few"?"few":rt==="many"?"many":dt==="zero"&&rt==="one"||dt==="zero"&&rt==="two"?"zero":"other"},as:nt,az:nt,be:nt,bg:Ye,bn:nt,bs:nt,ca:Ye,cs:nt,cy:nt,da:nt,de:nt,el:nt,en:Ye,es:Ye,et:Ye,eu:Ye,fa:ot,fi:Ye,fil:nt,fr:nt,ga:nt,gl:nt,gsw:nt,gu:nt,he:Ye,hi:nt,hr:nt,hu:nt,hy:nt,ia:Ye,id:Ye,io:Ye,is:nt,it:nt,ja:Ye,ka:function(dt,rt){return dt||"other"},kk:nt,km:Ye,kn:nt,ko:Ye,ky:nt,lij:nt,lo:Ye,lt:nt,lv:function(dt,rt){return rt==="one"?"one":"other"},mk:Ye,ml:nt,mn:nt,mr:nt,ms:Ye,my:Ye,nb:Ye,ne:nt,nl:nt,no:Ye,or:ot,pa:nt,pcm:Ye,pl:nt,ps:nt,pt:nt,ro:function(dt,rt){return rt==="few"||rt==="one"?"few":"other"},ru:nt,sc:nt,scn:nt,sd:ot,si:function(dt,rt){return dt==="one"&&rt==="one"?"one":"other"},sk:nt,sl:function(dt,rt){return rt==="few"||rt==="one"?"few":rt==="two"?"two":"other"},sq:nt,sr:nt,sv:Ye,sw:nt,ta:nt,te:nt,th:Ye,tk:nt,tr:nt,ug:nt,uk:nt,ur:Ye,uz:nt,vi:Ye,yue:Ye,zh:Ye,zu:nt})})(Ne);var Fe=B(Ne.exports),Ue=R({__proto__:null,default:Fe},[Ne.exports]),De=ae||ce,$e=Oe||Le,Be=Fe||Ue,Ve=function(ft){return ft==="pt-PT"?"pt_PT":ft},Ke=function(ft){return De[Ve(ft)]},st=function(ft,Ye){return $e[Ve(ft)][Ye?"ordinal":"cardinal"]},We=function(ft){return Be[Ve(ft)]},at=k.default(Intl.NumberFormat,Ke,st,We);return pluralRules=at,pluralRules}var hasRequiredPolyfill;function requirePolyfill(){if(hasRequiredPolyfill)return polyfill;hasRequiredPolyfill=1;var E=requirePluralRules();function y(B){return B&&typeof B=="object"&&"default"in B?B:{default:B}}var R=y(E);if(typeof Intl>"u")typeof commonjsGlobal$1<"u"?commonjsGlobal$1.Intl={PluralRules:R.default}:typeof window<"u"?window.Intl={PluralRules:R.default}:polyfill.Intl={PluralRules:R.default},R.default.polyfill=!0;else if(!Intl.PluralRules||!Intl.PluralRules.prototype.selectRange)Intl.PluralRules=R.default,R.default.polyfill=!0;else{var k=["en","es","ru","zh"],H=Intl.PluralRules.supportedLocalesOf(k);H.lengthNOTIFICATION_TYPES.includes(E),GROUP_CREATE_SUCCESS="GROUP_CREATE_SUCCESS",GROUP_UPDATE_SUCCESS="GROUP_UPDATE_SUCCESS",GROUP_DELETE_SUCCESS="GROUP_DELETE_SUCCESS",GROUP_FETCH_REQUEST="GROUP_FETCH_REQUEST",GROUP_FETCH_FAIL="GROUP_FETCH_FAIL",GROUP_RELATIONSHIPS_FETCH_REQUEST="GROUP_RELATIONSHIPS_FETCH_REQUEST",GROUP_RELATIONSHIPS_FETCH_SUCCESS="GROUP_RELATIONSHIPS_FETCH_SUCCESS",GROUP_RELATIONSHIPS_FETCH_FAIL="GROUP_RELATIONSHIPS_FETCH_FAIL",GROUP_KICK_REQUEST="GROUP_KICK_REQUEST",GROUP_KICK_SUCCESS="GROUP_KICK_SUCCESS",GROUP_BLOCKS_FETCH_REQUEST="GROUP_BLOCKS_FETCH_REQUEST",GROUP_BLOCKS_FETCH_SUCCESS="GROUP_BLOCKS_FETCH_SUCCESS",GROUP_BLOCKS_FETCH_FAIL="GROUP_BLOCKS_FETCH_FAIL",GROUP_BLOCKS_EXPAND_REQUEST="GROUP_BLOCKS_EXPAND_REQUEST",GROUP_BLOCKS_EXPAND_SUCCESS="GROUP_BLOCKS_EXPAND_SUCCESS",GROUP_BLOCKS_EXPAND_FAIL="GROUP_BLOCKS_EXPAND_FAIL",GROUP_BLOCK_SUCCESS="GROUP_BLOCK_SUCCESS",GROUP_UNBLOCK_REQUEST="GROUP_UNBLOCK_REQUEST",GROUP_UNBLOCK_SUCCESS="GROUP_UNBLOCK_SUCCESS",GROUP_UNBLOCK_FAIL="GROUP_UNBLOCK_FAIL",GROUP_PROMOTE_SUCCESS="GROUP_PROMOTE_SUCCESS",GROUP_DEMOTE_SUCCESS="GROUP_DEMOTE_SUCCESS",GROUP_MEMBERSHIPS_FETCH_REQUEST="GROUP_MEMBERSHIPS_FETCH_REQUEST",GROUP_MEMBERSHIPS_FETCH_SUCCESS="GROUP_MEMBERSHIPS_FETCH_SUCCESS",GROUP_MEMBERSHIPS_FETCH_FAIL="GROUP_MEMBERSHIPS_FETCH_FAIL",GROUP_MEMBERSHIPS_EXPAND_REQUEST="GROUP_MEMBERSHIPS_EXPAND_REQUEST",GROUP_MEMBERSHIPS_EXPAND_SUCCESS="GROUP_MEMBERSHIPS_EXPAND_SUCCESS",GROUP_MEMBERSHIPS_EXPAND_FAIL="GROUP_MEMBERSHIPS_EXPAND_FAIL",GROUP_MEMBERSHIP_REQUESTS_FETCH_REQUEST="GROUP_MEMBERSHIP_REQUESTS_FETCH_REQUEST",GROUP_MEMBERSHIP_REQUESTS_FETCH_SUCCESS="GROUP_MEMBERSHIP_REQUESTS_FETCH_SUCCESS",GROUP_MEMBERSHIP_REQUESTS_FETCH_FAIL="GROUP_MEMBERSHIP_REQUESTS_FETCH_FAIL",GROUP_MEMBERSHIP_REQUESTS_EXPAND_REQUEST="GROUP_MEMBERSHIP_REQUESTS_EXPAND_REQUEST",GROUP_MEMBERSHIP_REQUESTS_EXPAND_SUCCESS="GROUP_MEMBERSHIP_REQUESTS_EXPAND_SUCCESS",GROUP_MEMBERSHIP_REQUESTS_EXPAND_FAIL="GROUP_MEMBERSHIP_REQUESTS_EXPAND_FAIL",GROUP_MEMBERSHIP_REQUEST_AUTHORIZE_SUCCESS="GROUP_MEMBERSHIP_REQUEST_AUTHORIZE_SUCCESS",GROUP_MEMBERSHIP_REQUEST_REJECT_SUCCESS="GROUP_MEMBERSHIP_REQUEST_REJECT_SUCCESS",fetchGroupRelationships=E=>(y,R)=>{const k=R(),H=k.group_relationships,B=E.filter(te=>H.get(te,null)===null);if(!(!k.me||B.length===0))return y(fetchGroupRelationshipsRequest(B)),api(R).get(`/api/v1/groups/relationships?${B.map(te=>`id[]=${te}`).join("&")}`).then(te=>te.json()).then(te=>{y(fetchGroupRelationshipsSuccess(te))}).catch(te=>{y(fetchGroupRelationshipsFail(te))})},fetchGroupRelationshipsRequest=E=>({type:GROUP_RELATIONSHIPS_FETCH_REQUEST,ids:E,skipLoading:!0}),fetchGroupRelationshipsSuccess=E=>({type:GROUP_RELATIONSHIPS_FETCH_SUCCESS,relationships:E,skipLoading:!0}),fetchGroupRelationshipsFail=E=>({type:GROUP_RELATIONSHIPS_FETCH_FAIL,error:E,skipLoading:!0,skipNotFound:!0}),groupKick=(E,y)=>(R,k)=>(R(groupKickRequest(E,y)),api(k).post(`/api/v1/groups/${E}/kick`,{account_ids:[y]}).then(()=>R(groupKickSuccess(E,y))).catch(H=>R(groupKickFail(E,y,H)))),groupKickRequest=(E,y)=>({type:GROUP_KICK_REQUEST,groupId:E,accountId:y}),groupKickSuccess=(E,y)=>({type:GROUP_KICK_SUCCESS,groupId:E,accountId:y}),groupKickFail=(E,y,R)=>({type:GROUP_KICK_SUCCESS,groupId:E,accountId:y,error:R}),fetchGroupBlocks=E=>(y,R)=>(y(fetchGroupBlocksRequest(E)),api(R).get(`/api/v1/groups/${E}/blocks`).then(async k=>{const H=k.next(),B=await k.json();y(importFetchedAccounts(B)),y(fetchGroupBlocksSuccess(E,B,H))}).catch(k=>{y(fetchGroupBlocksFail(E,k))})),fetchGroupBlocksRequest=E=>({type:GROUP_BLOCKS_FETCH_REQUEST,id:E}),fetchGroupBlocksSuccess=(E,y,R)=>({type:GROUP_BLOCKS_FETCH_SUCCESS,id:E,accounts:y,next:R}),fetchGroupBlocksFail=(E,y)=>({type:GROUP_BLOCKS_FETCH_FAIL,id:E,error:y,skipNotFound:!0}),groupUnblock=(E,y)=>(R,k)=>(R(groupUnblockRequest(E,y)),api(k).delete(`/api/v1/groups/${E}/blocks?account_ids[]=${y}`).then(()=>R(groupUnblockSuccess(E,y))).catch(H=>R(groupUnblockFail(E,y,H)))),groupUnblockRequest=(E,y)=>({type:GROUP_UNBLOCK_REQUEST,groupId:E,accountId:y}),groupUnblockSuccess=(E,y)=>({type:GROUP_UNBLOCK_SUCCESS,groupId:E,accountId:y}),groupUnblockFail=(E,y,R)=>({type:GROUP_UNBLOCK_FAIL,groupId:E,accountId:y,error:R}),NOTIFICATIONS_UPDATE="NOTIFICATIONS_UPDATE",NOTIFICATIONS_UPDATE_NOOP="NOTIFICATIONS_UPDATE_NOOP",NOTIFICATIONS_UPDATE_QUEUE="NOTIFICATIONS_UPDATE_QUEUE",NOTIFICATIONS_DEQUEUE="NOTIFICATIONS_DEQUEUE",NOTIFICATIONS_EXPAND_REQUEST="NOTIFICATIONS_EXPAND_REQUEST",NOTIFICATIONS_EXPAND_SUCCESS="NOTIFICATIONS_EXPAND_SUCCESS",NOTIFICATIONS_EXPAND_FAIL="NOTIFICATIONS_EXPAND_FAIL",NOTIFICATIONS_FILTER_SET="NOTIFICATIONS_FILTER_SET",NOTIFICATIONS_CLEAR="NOTIFICATIONS_CLEAR",NOTIFICATIONS_SCROLL_TOP="NOTIFICATIONS_SCROLL_TOP",NOTIFICATIONS_MARK_READ_REQUEST="NOTIFICATIONS_MARK_READ_REQUEST",MAX_QUEUED_NOTIFICATIONS=40,fetchRelatedRelationships=(E,y)=>{const R=y.filter(k=>k.type==="follow").map(k=>k.account.id);R.length>0&&E(fetchRelationships(R))},updateNotifications=E=>(y,R)=>{const k=getSettings(R()).getIn(["notifications","shows",E.type],!0);E.account&&y(importFetchedAccount$1(E.account)),E.target&&y(importFetchedAccount$1(E.target)),E.status&&y(importFetchedStatus(E.status)),k&&(y({type:NOTIFICATIONS_UPDATE,notification:E}),fetchRelatedRelationships(y,[E]))},updateNotificationsQueue$1=(E,y,R,k)=>(H,B)=>{var Le;if(!E.type||E.type==="pleroma:chat_mention"||E.type==="chat")return;const te=getSettings(B()).getIn(["notifications","alerts",E.type]),ae=getFilters(B(),{contextType:"notifications"}),ce=getSettings(B()).getIn(["notifications","sounds",E.type]);let Ce=!1;const Oe=k==="/notifications";if(["mention","status"].includes(E.type)){const Ne=regexFromFilters(ae),Fe=E.status.spoiler_text+` `+htmlToPlaintext(E.status.content);Ce=Ne&&Ne.test(Fe)}try{const Ne=((Le=window.Notification)==null?void 0:Le.permission)==="granted";if(te&&!Ce&&Ne){const Fe=new IntlMessageFormat(y[`notification.${E.type}`],R).format({name:E.account.display_name.length>0?E.account.display_name:E.account.username}),Ue=E.status&&E.status.spoiler_text.length>0?E.status.spoiler_text:htmlToPlaintext(E.status?E.status.content:"");navigator.serviceWorker.ready.then(De=>{De.showNotification(Fe,{body:Ue,icon:E.account.avatar,tag:E.id,data:{url:"/notifications"}}).catch(console.error)}).catch(console.error)}}catch(Ne){console.warn(Ne)}ce&&!Ce&&H({type:NOTIFICATIONS_UPDATE_NOOP,meta:{sound:"boop"}}),H(Oe?{type:NOTIFICATIONS_UPDATE_QUEUE,notification:E,intlMessages:y,intlLocale:R}:updateNotifications(E))},dequeueNotifications=()=>(E,y)=>{const R=y().notifications.queuedNotifications,k=y().notifications.totalQueuedNotificationsCount;k!==0&&(k>0&&k<=MAX_QUEUED_NOTIFICATIONS?R.forEach(H=>{E(updateNotifications(H.notification))}):E(expandNotifications()),E({type:NOTIFICATIONS_DEQUEUE}),E(markReadNotifications()))},excludeTypesFromFilter=E=>NOTIFICATION_TYPES.filter(y=>y!==E),noOp$5=()=>new Promise(E=>E(void 0)),expandNotifications=({maxId:E}={},y=noOp$5)=>(R,k)=>{if(!isLoggedIn(k))return R(noOp$5);const H=k(),B=getFeatures(H.instance),te=getSettings(H).getIn(["notifications","quickFilter","active"]),ae=H.notifications,ce=!!E;if(ae.isLoading)return y(),R(noOp$5);const Ce={max_id:E};return te==="all"?B.notificationsIncludeTypes?Ce.types=NOTIFICATION_TYPES.filter(Oe=>!EXCLUDE_TYPES.includes(Oe)):Ce.exclude_types=EXCLUDE_TYPES:B.notificationsIncludeTypes?Ce.types=[te]:Ce.exclude_types=excludeTypesFromFilter(te),!E&&ae.items.size>0&&(Ce.since_id=ae.getIn(["items",0,"id"])),R(expandNotificationsRequest(ce)),api(k).get("/api/v1/notifications",{searchParams:Ce}).then(async Oe=>{const Le=Oe.next(),Ne=await Oe.json(),Fe=Ne.reduce((De,$e)=>{var Be,Ve,Ke;return(Be=$e.account)!=null&&Be.id&&(De.accounts[$e.account.id]=$e.account),(Ve=$e.target)!=null&&Ve.id&&(De.accounts[$e.target.id]=$e.target),(Ke=$e.status)!=null&&Ke.id&&(De.statuses[$e.status.id]=$e.status),De},{accounts:{},statuses:{}});R(importFetchedAccounts(Object.values(Fe.accounts))),R(importFetchedStatuses(Object.values(Fe.statuses)));const Ue=Object.values(Fe.statuses).filter(De=>!!De.group);R(fetchGroupRelationships(Ue.map(De=>{var $e;return($e=De.group)==null?void 0:$e.id}))),R(expandNotificationsSuccess(Ne,Le,ce)),fetchRelatedRelationships(R,Ne),y()}).catch(Oe=>{R(expandNotificationsFail(Oe,ce)),y()})},expandNotificationsRequest=E=>({type:NOTIFICATIONS_EXPAND_REQUEST,skipLoading:!E}),expandNotificationsSuccess=(E,y,R)=>({type:NOTIFICATIONS_EXPAND_SUCCESS,notifications:E,next:y,skipLoading:!R}),expandNotificationsFail=(E,y)=>({type:NOTIFICATIONS_EXPAND_FAIL,error:E,skipLoading:!y}),scrollTopNotifications=E=>y=>{y({type:NOTIFICATIONS_SCROLL_TOP,top:E}),y(markReadNotifications())},setFilter$1=E=>y=>{y({type:NOTIFICATIONS_FILTER_SET,path:["notifications","quickFilter","active"],value:E}),y(expandNotifications()),y(saveSettings())},markReadPleroma=E=>(y,R)=>api(R).post("/api/v1/pleroma/notifications/read",{max_id:E}),markReadNotifications=()=>(E,y)=>{var te;if(!isLoggedIn(y))return;const R=y(),k=(te=R.notifications.items.first())==null?void 0:te.id,H=R.notifications.lastRead,B=parseVersion(R.instance.version);k&&(H===-1||compareId(k,H)>0)&&(E(saveMarker({notifications:{last_read_id:k}})),B.software===PLEROMA&&E(markReadPleroma(k)))},defaultMediaVisibility=(E,y)=>!E||(E=getActualStatus(E),E.visibility==="self")?!1:y!=="hide_all"&&!E.sensitive||y==="show_all",getFirstExternalLink=E=>{try{const y='a:not(.mention,.hashtag,.attachment,[rel~="tag"])',R=document.createElement("div");return R.innerHTML=E.content,R.querySelector(y)}catch{return null}},shouldHaveCard=E=>!!getFirstExternalLink(E),hasIntegerMediaIds=E=>E.media_attachments.some(({id:y})=>isIntegerId(y)),textForScreenReader=(E,y,R)=>{const{account:k}=y;if(!k||typeof k!="object")return"";const H=k.display_name,B=[H.length===0?k.acct.split("@")[0]:H,y.spoiler_text&&y.hidden?y.spoiler_text:y.search_index.slice(y.spoiler_text.length),E.formatDate(y.created_at,{hour:"2-digit",minute:"2-digit",month:"short",day:"numeric"}),k.acct];return R&&B.push(R),B.join(", ")},getActualStatus=E=>E!=null&&E.reblog&&typeof(E==null?void 0:E.reblog)=="object"?E.reblog:E,COMPOSE_SET_STATUS="COMPOSE_SET_STATUS",setComposeToStatus=(E,y,R,k,H)=>(B,te)=>{const{instance:ae}=te(),{explicitAddressing:ce}=getFeatures(ae),Ce={type:COMPOSE_SET_STATUS,id:"compose-modal",status:E,rawText:y,explicitAddressing:ce,spoilerText:R,contentType:k,v:parseVersion(ae.version),withRedraft:H};B(Ce)},MODAL_OPEN="MODAL_OPEN",MODAL_CLOSE="MODAL_CLOSE";function openModal(E,y){return R=>{R(closeModal(E)),R(openModalSuccess(E,y))}}const openModalSuccess=(E,y)=>({type:MODAL_OPEN,modalType:E,modalProps:y});function closeModal(E){return{type:MODAL_CLOSE,modalType:E}}const TIMELINE_UPDATE="TIMELINE_UPDATE",TIMELINE_DELETE="TIMELINE_DELETE",TIMELINE_CLEAR="TIMELINE_CLEAR",TIMELINE_UPDATE_QUEUE="TIMELINE_UPDATE_QUEUE",TIMELINE_DEQUEUE="TIMELINE_DEQUEUE",TIMELINE_SCROLL_TOP="TIMELINE_SCROLL_TOP",TIMELINE_EXPAND_REQUEST="TIMELINE_EXPAND_REQUEST",TIMELINE_EXPAND_SUCCESS="TIMELINE_EXPAND_SUCCESS",TIMELINE_EXPAND_FAIL="TIMELINE_EXPAND_FAIL",TIMELINE_CONNECT="TIMELINE_CONNECT",TIMELINE_DISCONNECT="TIMELINE_DISCONNECT",TIMELINE_INSERT="TIMELINE_INSERT",MAX_QUEUED_ITEMS=40,processTimelineUpdate=(E,y,R)=>(k,H)=>{var Oe;const B=H().me,te=((Oe=y.account)==null?void 0:Oe.id)===B,ae=!H().pending_statuses.isEmpty(),ce=getSettings(H()).get(E,Map$1()),Ce=shouldFilter(normalizeStatus(y),ce);te&&ae||(k(importFetchedStatus(y)),k(Ce?updateTimeline$1(E,y.id):updateTimelineQueue$1(E,y.id)))},updateTimeline$1=(E,y,R)=>k=>{k({type:TIMELINE_UPDATE,timeline:E,statusId:y})},updateTimelineQueue$1=(E,y,R)=>k=>{k({type:TIMELINE_UPDATE_QUEUE,timeline:E,statusId:y})},dequeueTimeline=(E,y,R)=>(k,H)=>{var ae;const te=((ae=H().timelines.get(E))==null?void 0:ae.totalQueuedItemsCount)||0;if(!(te<=0)){if(te<=MAX_QUEUED_ITEMS){k({type:TIMELINE_DEQUEUE,timeline:E});return}typeof y=="function"?(k(clearTimeline$1(E)),y()):E==="home"?(k(clearTimeline$1(E)),k(expandFollowsTimeline(R))):E==="community"&&(k(clearTimeline$1(E)),k(expandCommunityTimeline(R)))}},deleteFromTimelines=E=>(y,R)=>{var ae,ce;const k=(ce=(ae=R().statuses.get(E))==null?void 0:ae.account)==null?void 0:ce.id,H=R().statuses.filter(Ce=>Ce.reblog===E).map(Ce=>[Ce.id,Ce.account.id]),B=R().statuses.getIn([E,"reblog"],null);y({type:TIMELINE_DELETE,id:E,accountId:k,references:H,reblogOf:B})},clearTimeline$1=E=>y=>y({type:TIMELINE_CLEAR,timeline:E}),noOp$4=()=>{},noOpAsync=()=>()=>new Promise(E=>E(void 0)),parseTags=(E={},y)=>(E[y]||[]).map(R=>R.value),expandTimeline=(E,y,R={},k=noOp$4)=>(H,B)=>{const te=B().timelines.get(E)||{},ae=!!R.max_id;if(te.isLoading)return k(),H(noOpAsync());!R.max_id&&!R.pinned&&(te.items||OrderedSet()).size>0&&!y.includes("max_id=")&&(R.since_id=te.getIn(["items",0]));const ce=!!R.since_id;return H(expandTimelineRequest(E,ae)),api(B).get(y,{searchParams:R}).then(async Ce=>{const{next:Oe,prev:Le}=Ce.pagination(),Ne=await Ce.json();H(importFetchedStatuses(Ne));const Fe=Ne.filter(Ue=>!!Ue.group);H(fetchGroupRelationships(Fe.map(Ue=>{var De;return(De=Ue.group)==null?void 0:De.id}))),H(expandTimelineSuccess(E,Ne,Oe,Le,Ce.status===206,ce,ae)),k()}).catch(Ce=>{H(expandTimelineFail(E,Ce,ae)),k()})},expandFollowsTimeline=({url:E,maxId:y}={},R=noOp$4)=>{const k=E||"/api/v1/timelines/home",H={};return!E&&y&&(H.max_id=y),expandTimeline("home",k,H,R)},expandPublicTimeline=({url:E,maxId:y,onlyMedia:R,language:k}={},H=noOp$4)=>expandTimeline(`public${R?":media":""}`,E||"/api/v1/timelines/public",E?{}:{max_id:y,only_media:!!R,language:k||void 0},H),expandRemoteTimeline=(E,{url:y,maxId:R,onlyMedia:k}={},H=noOp$4)=>expandTimeline(`remote${k?":media":""}:${E}`,y||"/api/v1/timelines/public",y?{}:{local:!1,instance:E,max_id:R,only_media:!!k},H),expandCommunityTimeline=({url:E,maxId:y,onlyMedia:R}={},k=noOp$4)=>expandTimeline(`community${R?":media":""}`,E||"/api/v1/timelines/public",E?{}:{local:!0,max_id:y,only_media:!!R},k),expandDirectTimeline=({url:E,maxId:y}={},R=noOp$4)=>expandTimeline("direct",E||"/api/v1/timelines/direct",E?{}:{max_id:y},R),expandAccountTimeline=(E,{url:y,maxId:R,withReplies:k}={})=>expandTimeline(`account:${E}${k?":with_replies":""}`,y||`/api/v1/accounts/${E}/statuses`,y?{}:{exclude_replies:!k,max_id:R,with_muted:!0}),expandAccountFeaturedTimeline=E=>expandTimeline(`account:${E}:pinned`,`/api/v1/accounts/${E}/statuses`,{pinned:!0,with_muted:!0}),expandAccountMediaTimeline=(E,{url:y,maxId:R}={})=>expandTimeline(`account:${E}:media`,y||`/api/v1/accounts/${E}/statuses`,y?{}:{max_id:R,only_media:!0,limit:40,with_muted:!0}),expandListTimeline=(E,{url:y,maxId:R}={},k=noOp$4)=>expandTimeline(`list:${E}`,y||`/api/v1/timelines/list/${E}`,y?{}:{max_id:R},k),expandGroupTimeline=(E,{maxId:y}={},R=noOp$4)=>expandTimeline(`group:${E}`,`/api/v1/timelines/group/${E}`,{max_id:y},R),expandGroupFeaturedTimeline=E=>expandTimeline(`group:${E}:pinned`,`/api/v1/timelines/group/${E}`,{pinned:!0}),expandGroupTimelineFromTag=(E,y,{maxId:R}={},k=noOp$4)=>expandTimeline(`group:tags:${E}:${y}`,`/api/v1/timelines/group/${E}/tags/${y}`,{max_id:R},k),expandGroupMediaTimeline=(E,{maxId:y}={})=>expandTimeline(`group:${E}:media`,`/api/v1/timelines/group/${E}`,{max_id:y,only_media:!0,limit:40,with_muted:!0}),expandHashtagTimeline=(E,{url:y,maxId:R,tags:k}={},H=noOp$4)=>expandTimeline(`hashtag:${E}`,y||`/api/v1/timelines/tag/${E}`,y?{}:{max_id:R,any:parseTags(k,"any"),all:parseTags(k,"all"),none:parseTags(k,"none")},H),expandTimelineRequest=(E,y)=>({type:TIMELINE_EXPAND_REQUEST,timeline:E,skipLoading:!y}),expandTimelineSuccess=(E,y,R,k,H,B,te)=>({type:TIMELINE_EXPAND_SUCCESS,timeline:E,statuses:y,next:R,prev:k,partial:H,isLoadingRecent:B,skipLoading:!te}),expandTimelineFail=(E,y,R)=>({type:TIMELINE_EXPAND_FAIL,timeline:E,error:y,skipLoading:!R}),connectTimeline=E=>({type:TIMELINE_CONNECT,timeline:E}),disconnectTimeline=E=>({type:TIMELINE_DISCONNECT,timeline:E}),scrollTopTimeline=(E,y)=>({type:TIMELINE_SCROLL_TOP,timeline:E,top:y}),insertSuggestionsIntoTimeline=()=>(E,y)=>{E({type:TIMELINE_INSERT,timeline:"home"})},STATUS_CREATE_REQUEST="STATUS_CREATE_REQUEST",STATUS_CREATE_SUCCESS="STATUS_CREATE_SUCCESS",STATUS_CREATE_FAIL="STATUS_CREATE_FAIL",STATUS_FETCH_SOURCE_REQUEST="STATUS_FETCH_SOURCE_REQUEST",STATUS_FETCH_SOURCE_SUCCESS="STATUS_FETCH_SOURCE_SUCCESS",STATUS_FETCH_SOURCE_FAIL="STATUS_FETCH_SOURCE_FAIL",STATUS_FETCH_REQUEST="STATUS_FETCH_REQUEST",STATUS_FETCH_SUCCESS="STATUS_FETCH_SUCCESS",STATUS_FETCH_FAIL="STATUS_FETCH_FAIL",STATUS_DELETE_REQUEST="STATUS_DELETE_REQUEST",STATUS_DELETE_SUCCESS="STATUS_DELETE_SUCCESS",STATUS_DELETE_FAIL="STATUS_DELETE_FAIL",CONTEXT_FETCH_REQUEST="CONTEXT_FETCH_REQUEST",CONTEXT_FETCH_SUCCESS="CONTEXT_FETCH_SUCCESS",CONTEXT_FETCH_FAIL="CONTEXT_FETCH_FAIL",STATUS_MUTE_REQUEST="STATUS_MUTE_REQUEST",STATUS_MUTE_SUCCESS="STATUS_MUTE_SUCCESS",STATUS_MUTE_FAIL="STATUS_MUTE_FAIL",STATUS_UNMUTE_REQUEST="STATUS_UNMUTE_REQUEST",STATUS_UNMUTE_SUCCESS="STATUS_UNMUTE_SUCCESS",STATUS_UNMUTE_FAIL="STATUS_UNMUTE_FAIL",STATUS_REVEAL="STATUS_REVEAL",STATUS_HIDE="STATUS_HIDE",STATUS_TRANSLATE_REQUEST="STATUS_TRANSLATE_REQUEST",STATUS_TRANSLATE_SUCCESS="STATUS_TRANSLATE_SUCCESS",STATUS_TRANSLATE_FAIL="STATUS_TRANSLATE_FAIL",STATUS_TRANSLATE_UNDO="STATUS_TRANSLATE_UNDO",STATUS_UNFILTER="STATUS_UNFILTER",statusExists=(E,y)=>(E().statuses.get(y)||null)!==null,createStatus=(E,y,R)=>(k,H)=>{settingsSchema.parse(getSettings(H()).toJS()).discloseClient&&(E.disclose_client=!0),k({type:STATUS_CREATE_REQUEST,params:E,idempotencyKey:y,editing:!!R});const te=R===null?"POST":"PUT",ae=R===null?"/api/v1/statuses":`/api/v1/statuses/${R}`,ce={"Idempotency-Key":y};return api(H).request(te,ae,E,{headers:ce}).then(async Ce=>{const Oe=await Ce.json();if(!Oe.card&&shouldHaveCard(Oe)&&(Oe.expectsCard=!0),k(importFetchedStatus(Oe,y)),k({type:STATUS_CREATE_SUCCESS,status:Oe,params:E,idempotencyKey:y,editing:!!R}),Oe.expectsCard){const Ne=(Fe=5)=>{api(H).get(`/api/v1/statuses/${Oe.id}`).then(Ue=>Ue.json()).then(Ue=>{Ue!=null&&Ue.card?k(importFetchedStatus(Ue)):Fe>0&&Ce.status===200&&setTimeout(()=>Ne(Fe-1),1e3)}).catch(console.error)};setTimeout(()=>Ne(),1e3)}return Oe}).catch(Ce=>{throw k({type:STATUS_CREATE_FAIL,error:Ce,params:E,idempotencyKey:y,editing:!!R}),Ce})},editStatus=E=>(y,R)=>{let k=R().statuses.get(E);k.poll&&(k=k.set("poll",R().polls.get(k.poll))),y({type:STATUS_FETCH_SOURCE_REQUEST}),api(R).get(`/api/v1/statuses/${E}/source`).then(H=>H.json()).then(H=>{y({type:STATUS_FETCH_SOURCE_SUCCESS}),y(setComposeToStatus(k,H.text,H.spoiler_text,H.content_type,!1)),y(openModal("COMPOSE"))}).catch(H=>{y({type:STATUS_FETCH_SOURCE_FAIL,error:H})})},fetchStatus=E=>(y,R)=>{const k=statusExists(R,E);return y({type:STATUS_FETCH_REQUEST,id:E,skipLoading:k}),api(R).get(`/api/v1/statuses/${E}`).then(H=>H.json()).then(H=>(y(importFetchedStatus(H)),H.group&&y(fetchGroupRelationships([H.group.id])),y({type:STATUS_FETCH_SUCCESS,status:H,skipLoading:k}),H)).catch(H=>{y({type:STATUS_FETCH_FAIL,id:E,error:H,skipLoading:k,skipAlert:!0})})},deleteStatus$5=(E,y=!1)=>(R,k)=>{if(!isLoggedIn(k))return null;let H=k().statuses.get(E);return H.poll&&(H=H.set("poll",k().polls.get(H.poll))),R({type:STATUS_DELETE_REQUEST,params:H}),api(k).delete(`/api/v1/statuses/${E}`).then(B=>B.json()).then(B=>{var te;R({type:STATUS_DELETE_SUCCESS,id:E}),R(deleteFromTimelines(E)),y&&(R(setComposeToStatus(H,B.text,B.spoiler_text,(te=B.pleroma)==null?void 0:te.content_type,y)),R(openModal("COMPOSE")))}).catch(B=>{R({type:STATUS_DELETE_FAIL,params:H,error:B})})},updateStatus=E=>y=>y(importFetchedStatus(E)),fetchContext=E=>(y,R)=>(y({type:CONTEXT_FETCH_REQUEST,id:E}),api(R).get(`/api/v1/statuses/${E}/context`).then(k=>k.json()).then(k=>{if(Array.isArray(k))y(importFetchedStatuses(k));else if(typeof k=="object"){const{ancestors:H,descendants:B}=k,te=H.concat(B);y(importFetchedStatuses(te)),y({type:CONTEXT_FETCH_SUCCESS,id:E,ancestors:H,descendants:B})}else throw k;return k}).catch(k=>{var H;((H=k.response)==null?void 0:H.status)===404&&y(deleteFromTimelines(E)),y({type:CONTEXT_FETCH_FAIL,id:E,error:k,skipAlert:!0})})),fetchNext=(E,y)=>async(R,k)=>{const H=await api(k).get(y),B=await H.json();return R(importFetchedStatuses(B)),R({type:CONTEXT_FETCH_SUCCESS,id:E,ancestors:[],descendants:B}),{next:H.pagination().next}},fetchAncestors=E=>async(y,R)=>{const k=await api(R).get(`/api/v1/statuses/${E}/context/ancestors`),H=await k.json();return y(importFetchedStatuses(H)),k},fetchDescendants=E=>async(y,R)=>{const k=await api(R).get(`/api/v1/statuses/${E}/context/descendants`),H=await k.json();return y(importFetchedStatuses(H)),k},fetchStatusWithContext=E=>async(y,R)=>{if(getFeatures(R().instance).paginatedContext){await y(fetchStatus(E));const[H,B]=await Promise.all([y(fetchAncestors(E)),y(fetchDescendants(E))]);return y({type:CONTEXT_FETCH_SUCCESS,id:E,ancestors:await H.json(),descendants:await B.json()}),B.pagination()}else return await Promise.all([y(fetchContext(E)),y(fetchStatus(E))]),{next:null,prev:null}},muteStatus=E=>(y,R)=>{isLoggedIn(R)&&(y({type:STATUS_MUTE_REQUEST,id:E}),api(R).post(`/api/v1/statuses/${E}/mute`).then(()=>{y({type:STATUS_MUTE_SUCCESS,id:E})}).catch(k=>{y({type:STATUS_MUTE_FAIL,id:E,error:k})}))},unmuteStatus=E=>(y,R)=>{isLoggedIn(R)&&(y({type:STATUS_UNMUTE_REQUEST,id:E}),api(R).post(`/api/v1/statuses/${E}/unmute`).then(()=>{y({type:STATUS_UNMUTE_SUCCESS,id:E})}).catch(k=>{y({type:STATUS_UNMUTE_FAIL,id:E,error:k})}))},toggleMuteStatus=E=>(y,R)=>{E.muted?y(unmuteStatus(E.id)):y(muteStatus(E.id))},hideStatus=E=>(Array.isArray(E)||(E=[E]),{type:STATUS_HIDE,ids:E}),revealStatus=E=>(Array.isArray(E)||(E=[E]),{type:STATUS_REVEAL,ids:E}),toggleStatusHidden=E=>E.hidden?revealStatus(E.id):hideStatus(E.id),translateStatus=(E,y)=>(R,k)=>{R({type:STATUS_TRANSLATE_REQUEST,id:E}),api(k).post(`/api/v1/statuses/${E}/translate`,{lang:y,target_language:y}).then(H=>H.json()).then(H=>{R({type:STATUS_TRANSLATE_SUCCESS,id:E,translation:H})}).catch(H=>{R({type:STATUS_TRANSLATE_FAIL,id:E,error:H})})},undoStatusTranslation=E=>({type:STATUS_TRANSLATE_UNDO,id:E}),unfilterStatus=E=>({type:STATUS_UNFILTER,id:E}),STREAMING_CHAT_UPDATE="STREAMING_CHAT_UPDATE",removeChatMessage=E=>{const y=JSON.parse(E),R=y.chat_id,k=y.deleted_message_id;isLastMessage(k)&&queryClient.invalidateQueries({queryKey:ChatKeys.chatSearch()}),removePageItem(ChatKeys.chatMessages(R),k,(H,B)=>String(H.id)===String(B))},updateChatQuery=E=>{const y=queryClient.getQueryData(ChatKeys.chat(E.id));if(!y)return;const R={...y,latest_read_message_by_account:E.latest_read_message_by_account,latest_read_message_created_at:E.latest_read_message_created_at};queryClient.setQueryData(ChatKeys.chat(E.id),R)},updateAnnouncementReactions=({announcement_id:E,name:y,count:R})=>{queryClient.setQueryData(["announcements"],k=>k.map(H=>H.id!==E?H:announcementSchema.parse({...H,reactions:updateReactions(H.reactions,y,-1,!0)})))},updateAnnouncement=E=>queryClient.setQueryData(["announcements"],y=>{let R=!1;const k=y.map(H=>H.id===E.id?(R=!0,announcementSchema.parse(E)):H);if(!R)return[announcementSchema.parse(E),...k]}),deleteAnnouncement=E=>queryClient.setQueryData(["announcements"],y=>y.filter(R=>R.id!==E)),connectTimelineStream=(E,y,R=null,k)=>connectStream(y,(H,B)=>{const te=getLocale(B());return{onConnect(){H(connectTimeline(E))},onDisconnect(){H(disconnectTimeline(E))},onReceive(ae,ce){switch(ce.event){case"update":H(processTimelineUpdate(E,JSON.parse(ce.payload)));break;case"status.update":H(updateStatus(JSON.parse(ce.payload)));break;case"notification":messages$5[te]().then(Ce=>{H(updateNotificationsQueue$1(JSON.parse(ce.payload),Ce,te,window.location.pathname))}).catch(Ce=>{console.error(Ce)});break;case"conversation":H(updateConversations(JSON.parse(ce.payload)));break;case"filters_changed":H(fetchFilters());break;case"pleroma:chat_update":case"chat_message.created":H((Ce,Oe)=>{var De,$e;const Le=JSON.parse(ce.payload),Ne=Oe().me,Fe=((De=Le.last_message)==null?void 0:De.account_id)===Ne,Ue=getSettings(Oe());Fe||(updateChatListItem(Le),Ue.getIn(["chats","sound"])&&play(soundCache.chat),($e=k==null?void 0:k.statContext)==null||$e.setUnreadChatsCount(getUnreadChatsCount()))});break;case"chat_message.deleted":removeChatMessage(ce.payload);break;case"chat_message.read":H((Ce,Oe)=>{const Le=JSON.parse(ce.payload),Ne=Oe().me;Le.account.id!==Ne&&updateChatQuery(JSON.parse(ce.payload))});break;case"chat_message.reaction":updateChatMessage(JSON.parse(ce.payload));break;case"pleroma:follow_relationships_update":H(updateFollowRelationships(JSON.parse(ce.payload)));break;case"announcement":updateAnnouncement(JSON.parse(ce.payload));break;case"announcement.reaction":updateAnnouncementReactions(JSON.parse(ce.payload));break;case"announcement.delete":deleteAnnouncement(ce.payload);break;case"marker":H({type:MARKER_FETCH_SUCCESS,marker:JSON.parse(ce.payload)});break}}}});function followStateToRelationship(E){switch(E){case"follow_pending":return{following:!1,requested:!0};case"follow_accept":return{following:!0,requested:!1};case"follow_reject":return{following:!1,requested:!1};default:return{}}}function updateFollowRelationships(E){return(y,R)=>{const k=R().me,H=selectEntity(R(),Entities.RELATIONSHIPS,E.following.id);if(E.follower.id===k&&H){const B={...H,...followStateToRelationship(E.state)};setTimeout(()=>y(importEntities$1([B],Entities.RELATIONSHIPS)),300)}}}const initialState$j=Map$1(),idComparator=(E,y)=>Ey?1:0,updateList$1=(E,y,R)=>{const H=E.get(y,OrderedSet()).union(R).sort(idComparator);return E.set(y,H)},importMessage$1=(E,y)=>updateList$1(E,y.chat_id,[y.id]),importMessages$1=(E,y)=>E.withMutations(R=>y.forEach(k=>importMessage$1(R,k))),importLastMessages$1=(E,y)=>E.withMutations(R=>y.forEach(k=>{k.last_message&&importMessage$1(R,k.last_message)})),replaceMessage=(E,y,R,k)=>E.update(y,H=>H.delete(R).add(k).sort(idComparator));function chatMessageLists(E=initialState$j,y){switch(y.type){case CHAT_MESSAGE_SEND_REQUEST:return updateList$1(E,y.chatId,[y.uuid]);case CHATS_FETCH_SUCCESS:case CHATS_EXPAND_SUCCESS:return importLastMessages$1(E,y.chats);case STREAMING_CHAT_UPDATE:return y.chat.last_message&&y.chat.last_message.account_id!==y.me?importMessages$1(E,[y.chat.last_message]):E;case CHAT_MESSAGES_FETCH_SUCCESS:return updateList$1(E,y.chatId,y.chatMessages.map(R=>R.id));case CHAT_MESSAGE_SEND_SUCCESS:return replaceMessage(E,y.chatId,y.uuid,y.chatMessage.id);case CHAT_MESSAGE_DELETE_SUCCESS:return E.update(y.chatId,R=>R.delete(y.messageId));default:return E}}const importMessage=(E,y)=>E.set(y.id,normalizeChatMessage(y)),importMessages=(E,y)=>E.withMutations(R=>y.forEach(k=>importMessage(R,k))),importLastMessages=(E,y)=>E.withMutations(R=>y.forEach(k=>{k.last_message&&importMessage(R,k.last_message)})),initialState$i=Map$1();function chatMessages(E=initialState$i,y){switch(y.type){case CHAT_MESSAGE_SEND_REQUEST:return importMessage(E,fromJS({id:y.uuid,chat_id:y.chatId,account_id:y.me,content:y.params.content,created_at:new Date().toISOString(),pending:!0}));case CHATS_FETCH_SUCCESS:case CHATS_EXPAND_SUCCESS:return importLastMessages(E,y.chats);case CHAT_MESSAGES_FETCH_SUCCESS:return importMessages(E,y.chatMessages);case CHAT_MESSAGE_SEND_SUCCESS:return importMessage(E,fromJS(y.chatMessage)).delete(y.uuid);case STREAMING_CHAT_UPDATE:return importLastMessages(E,[y.chat]);case CHAT_MESSAGE_DELETE_REQUEST:return E.update(y.messageId,R=>R.set("pending",!0).set("deleting",!0));case CHAT_MESSAGE_DELETE_SUCCESS:return E.delete(y.messageId);default:return E}}const ReducerRecord$n=Record({next:null,isLoading:!1,items:Map$1({})}),minifyChat=E=>E.mergeWith((y,R)=>R||y,{last_message:normalizeId$1(E.getIn(["last_message","id"]))}),fixChat=E=>normalizeChat(E).withMutations(y=>{minifyChat(y)}),importChat=(E,y)=>E.setIn(["items",y.id],fixChat(y)),importChats=(E,y,R)=>E.withMutations(k=>{R!==void 0&&k.set("next",R),y.forEach(H=>importChat(k,H)),k.set("isLoading",!1)});function chats(E=ReducerRecord$n(),y){switch(y.type){case CHATS_FETCH_REQUEST:case CHATS_EXPAND_REQUEST:return E.set("isLoading",!0);case CHATS_FETCH_SUCCESS:case CHATS_EXPAND_SUCCESS:return importChats(E,y.chats,y.next);case STREAMING_CHAT_UPDATE:return importChats(E,[y.chat]);case CHAT_FETCH_SUCCESS:return importChats(E,[y.chat]);case CHAT_READ_REQUEST:return E.setIn([y.chatId,"unread"],0);case CHAT_READ_SUCCESS:return importChats(E,[y.chat]);default:return E}}const truncateFilename=(E,y)=>{const R=E.split("/").pop();return!R||R.length<=y?R:[R.substr(0,y/2),R.substr(R.length-y/2)].join("…")},formatBytes=(E,y=2)=>{if(E===0)return"0 Bytes";const R=1024,k=y<0?0:y,H=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],B=Math.floor(Math.log(E)/Math.log(R));return parseFloat((E/Math.pow(R,B)).toFixed(k))+" "+H[B]},getVideoDuration=E=>{const y=document.createElement("video"),R=new Promise((k,H)=>{y.addEventListener("loadedmetadata",()=>{y.duration===1/0?(y.currentTime=Number.MAX_SAFE_INTEGER,y.ontimeupdate=()=>{y.ontimeupdate=null,k(y.duration),y.currentTime=0}):k(y.duration)}),y.onerror=B=>H(B.target.error)});return y.src=window.URL.createObjectURL(E),R},domParser$2=new DOMParser,addAutoPlay=E=>{try{const y=domParser$2.parseFromString(E,"text/html").documentElement,R=y.querySelector("iframe");if(R&&(R.style.width="100%",R.style.height="100%"),R){const k=new URL(R.src);return new URL(R.src).host==="rumble.com"?(k.searchParams.append("pub","7a20"),k.searchParams.append("autoplay","2")):(k.searchParams.append("autoplay","1"),k.searchParams.append("auto_play","1"),R.allow="autoplay"),R.src=k.toString(),y.querySelector("body").innerHTML}}catch{return E}return E},DEFAULT_MAX_PIXELS=1920*1080,_browser_quirks={},dropOrientationIfNeeded=E=>new Promise(y=>{switch(_browser_quirks["image-orientation-automatic"]){case!0:y(1);break;case!1:y(E);break;default:const R="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==",k=new Image;k.onload=()=>{const H=k.width===1&&k.height===2;_browser_quirks["image-orientation-automatic"]=H,y(H?1:E)},k.onerror=()=>{_browser_quirks["image-orientation-automatic"]=!1,y(E)},k.src=R}}),getImageUrl=E=>new Promise((y,R)=>{var H;if((H=window.URL)!=null&&H.createObjectURL){try{y(URL.createObjectURL(E))}catch(B){R(B)}return}const k=new FileReader;k.onerror=(...B)=>R(...B),k.onload=({target:B})=>y((B==null?void 0:B.result)||""),k.readAsDataURL(E)}),loadImage=E=>new Promise((y,R)=>{getImageUrl(E).then(k=>{const H=new Image;H.onerror=(...B)=>R([...B]),H.onload=()=>y(H),H.src=k}).catch(R)});async function getOrientation(E,y="image/png"){if(!["image/jpeg","image/webp"].includes(y))return 1;try{const k=await(await __vitePreload(()=>import("./js/full.esm-Des79R19.js"),[])).orientation(E)??1;return k!==1?await dropOrientationIfNeeded(k):k}catch(R){return console.error("Failed to get orientation:",R),1}}const processImage=(E,{width:y,height:R,orientation:k,type:H="image/png",name:B="resized.png"})=>new Promise((te,ae)=>{const ce=document.createElement("canvas");4{if(!Oe){ae(Oe);return}te(new File([Oe],B,{type:H,lastModified:new Date().getTime()}))},H)}),resizeImage=(E,y,R)=>new Promise((k,H)=>{const{width:B,height:te}=E,ae=y.type||"image/png",ce=Math.round(Math.sqrt(R*(B/te))),Ce=Math.round(Math.sqrt(R*(te/B)));getOrientation(E,ae).then(Oe=>processImage(E,{width:ce,height:Ce,name:y.name,orientation:Oe,type:ae})).then(k).catch(H)}),resizeImage$1=(E,y=DEFAULT_MAX_PIXELS)=>new Promise(R=>{if(!E.type.match(/image.*/)||E.type==="image/gif"){R(E);return}loadImage(E).then(k=>{if(k.width*k.height{console.error(H),R(E)})}).catch(()=>R(E))}),messages$2={exceededImageSizeLimit:{id:"upload_error.image_size_limit",defaultMessage:"Image exceeds the current file size limit ({limit})"},exceededVideoSizeLimit:{id:"upload_error.video_size_limit",defaultMessage:"Video exceeds the current file size limit ({limit})"},exceededVideoDurationLimit:{id:"upload_error.video_duration_limit",defaultMessage:"Video exceeds the current duration limit ({limit, plural, one {# second} other {# seconds}})"}},noOp$3=E=>{},fetchMedia=E=>(y,R)=>api(R).get(`/api/v1/media/${E}`),updateMedia=(E,y)=>(R,k)=>api(k).put(`/api/v1/media/${E}`,y),uploadMediaV1=(E,y=noOp$3)=>(R,k)=>api(k).post("/api/v1/media",E,{onUploadProgress:y}),uploadMediaV2=(E,y=noOp$3)=>(R,k)=>api(k).post("/api/v2/media",E,{onUploadProgress:y}),uploadMedia=(E,y=noOp$3)=>(R,k)=>{const B=k().instance;return getFeatures(B).mediaV2?R(uploadMediaV2(E,y)):R(uploadMediaV1(E,y))},uploadFile=(E,y,R=()=>{},k=()=>{},H=()=>{})=>async(B,te)=>{if(!isLoggedIn(te))return;const ae=te().instance.configuration.media_attachments.image_size_limit,ce=te().instance.configuration.media_attachments.video_size_limit,Ce=te().instance.configuration.media_attachments.video_duration_limit,Oe=E.type.match(/image.*/),Le=E.type.match(/video.*/),Ne=Le&&Ce?await getVideoDuration(E):0;if(Oe&&ae&&E.size>ae){const Fe=formatBytes(ae),Ue=y.formatMessage(messages$2.exceededImageSizeLimit,{limit:Fe});toast.error(Ue),k(!0);return}else if(Le&&ce&&E.size>ce){const Fe=formatBytes(ce),Ue=y.formatMessage(messages$2.exceededVideoSizeLimit,{limit:Fe});toast.error(Ue),k(!0);return}else if(Le&&Ce&&Ne>Ce){const Fe=y.formatMessage(messages$2.exceededVideoDurationLimit,{limit:Ce});toast.error(Fe),k(!0);return}resizeImage$1(E).then(Fe=>{const Ue=new FormData;return Ue.append("file",Fe),B(uploadMedia(Ue,H)).then(async De=>{const{status:$e}=De,Be=await De.json();if($e===200)R(Be);else if($e===202){const Ve=()=>{B(fetchMedia(Be.id)).then(async Ke=>{const{status:st}=Ke,We=await Ke.json();st===200?R(We):st===206&&setTimeout(()=>Ve(),1e3)}).catch(Ke=>k(Ke))};Ve()}})}).catch(Fe=>k(Fe))},LOCATION_SEARCH_REQUEST="LOCATION_SEARCH_REQUEST",LOCATION_SEARCH_SUCCESS="LOCATION_SEARCH_SUCCESS",LOCATION_SEARCH_FAIL="LOCATION_SEARCH_FAIL",EDIT_EVENT_NAME_CHANGE="EDIT_EVENT_NAME_CHANGE",EDIT_EVENT_DESCRIPTION_CHANGE="EDIT_EVENT_DESCRIPTION_CHANGE",EDIT_EVENT_START_TIME_CHANGE="EDIT_EVENT_START_TIME_CHANGE",EDIT_EVENT_HAS_END_TIME_CHANGE="EDIT_EVENT_HAS_END_TIME_CHANGE",EDIT_EVENT_END_TIME_CHANGE="EDIT_EVENT_END_TIME_CHANGE",EDIT_EVENT_APPROVAL_REQUIRED_CHANGE="EDIT_EVENT_APPROVAL_REQUIRED_CHANGE",EDIT_EVENT_LOCATION_CHANGE="EDIT_EVENT_LOCATION_CHANGE",EVENT_BANNER_UPLOAD_REQUEST="EVENT_BANNER_UPLOAD_REQUEST",EVENT_BANNER_UPLOAD_PROGRESS="EVENT_BANNER_UPLOAD_PROGRESS",EVENT_BANNER_UPLOAD_SUCCESS="EVENT_BANNER_UPLOAD_SUCCESS",EVENT_BANNER_UPLOAD_FAIL="EVENT_BANNER_UPLOAD_FAIL",EVENT_BANNER_UPLOAD_UNDO="EVENT_BANNER_UPLOAD_UNDO",EVENT_SUBMIT_REQUEST="EVENT_SUBMIT_REQUEST",EVENT_SUBMIT_SUCCESS="EVENT_SUBMIT_SUCCESS",EVENT_SUBMIT_FAIL="EVENT_SUBMIT_FAIL",EVENT_JOIN_REQUEST="EVENT_JOIN_REQUEST",EVENT_JOIN_SUCCESS="EVENT_JOIN_SUCCESS",EVENT_JOIN_FAIL="EVENT_JOIN_FAIL",EVENT_LEAVE_REQUEST="EVENT_LEAVE_REQUEST",EVENT_LEAVE_SUCCESS="EVENT_LEAVE_SUCCESS",EVENT_LEAVE_FAIL="EVENT_LEAVE_FAIL",EVENT_PARTICIPATIONS_FETCH_REQUEST="EVENT_PARTICIPATIONS_FETCH_REQUEST",EVENT_PARTICIPATIONS_FETCH_SUCCESS="EVENT_PARTICIPATIONS_FETCH_SUCCESS",EVENT_PARTICIPATIONS_FETCH_FAIL="EVENT_PARTICIPATIONS_FETCH_FAIL",EVENT_PARTICIPATIONS_EXPAND_SUCCESS="EVENT_PARTICIPATIONS_EXPAND_SUCCESS",EVENT_PARTICIPATION_REQUESTS_FETCH_REQUEST="EVENT_PARTICIPATION_REQUESTS_FETCH_REQUEST",EVENT_PARTICIPATION_REQUESTS_FETCH_SUCCESS="EVENT_PARTICIPATION_REQUESTS_FETCH_SUCCESS",EVENT_PARTICIPATION_REQUESTS_FETCH_FAIL="EVENT_PARTICIPATION_REQUESTS_FETCH_FAIL",EVENT_PARTICIPATION_REQUESTS_EXPAND_SUCCESS="EVENT_PARTICIPATION_REQUESTS_EXPAND_SUCCESS",EVENT_PARTICIPATION_REQUEST_AUTHORIZE_REQUEST="EVENT_PARTICIPATION_REQUEST_AUTHORIZE_REQUEST",EVENT_PARTICIPATION_REQUEST_AUTHORIZE_SUCCESS="EVENT_PARTICIPATION_REQUEST_AUTHORIZE_SUCCESS",EVENT_PARTICIPATION_REQUEST_AUTHORIZE_FAIL="EVENT_PARTICIPATION_REQUEST_AUTHORIZE_FAIL",EVENT_PARTICIPATION_REQUEST_REJECT_REQUEST="EVENT_PARTICIPATION_REQUEST_REJECT_REQUEST",EVENT_PARTICIPATION_REQUEST_REJECT_SUCCESS="EVENT_PARTICIPATION_REQUEST_REJECT_SUCCESS",EVENT_PARTICIPATION_REQUEST_REJECT_FAIL="EVENT_PARTICIPATION_REQUEST_REJECT_FAIL",EVENT_COMPOSE_CANCEL="EVENT_COMPOSE_CANCEL",EVENT_FORM_SET="EVENT_FORM_SET",RECENT_EVENTS_FETCH_REQUEST="RECENT_EVENTS_FETCH_REQUEST",RECENT_EVENTS_FETCH_SUCCESS="RECENT_EVENTS_FETCH_SUCCESS",RECENT_EVENTS_FETCH_FAIL="RECENT_EVENTS_FETCH_FAIL",JOINED_EVENTS_FETCH_REQUEST="JOINED_EVENTS_FETCH_REQUEST",JOINED_EVENTS_FETCH_SUCCESS="JOINED_EVENTS_FETCH_SUCCESS",JOINED_EVENTS_FETCH_FAIL="JOINED_EVENTS_FETCH_FAIL",noOp$2=()=>new Promise(E=>E(void 0)),messages$1={exceededImageSizeLimit:{id:"upload_error.image_size_limit",defaultMessage:"Image exceeds the current file size limit ({limit})"},success:{id:"compose_event.submit_success",defaultMessage:"Your event was created"},editSuccess:{id:"compose_event.edit_success",defaultMessage:"Your event was edited"},joinSuccess:{id:"join_event.success",defaultMessage:"Joined the event"},joinRequestSuccess:{id:"join_event.request_success",defaultMessage:"Requested to join the event"},view:{id:"toast.view",defaultMessage:"View"},authorized:{id:"compose_event.participation_requests.authorize_success",defaultMessage:"User accepted"},rejected:{id:"compose_event.participation_requests.reject_success",defaultMessage:"User rejected"}},locationSearch=(E,y)=>(R,k)=>(R({type:LOCATION_SEARCH_REQUEST,query:E}),api(k).get("/api/v1/pleroma/search/location",{searchParams:{q:E},signal:y}).then(H=>H.json()).then(H=>(R({type:LOCATION_SEARCH_SUCCESS,locations:H}),H)).catch(H=>{throw R({type:LOCATION_SEARCH_FAIL}),H})),changeEditEventName=E=>({type:EDIT_EVENT_NAME_CHANGE,value:E}),changeEditEventDescription=E=>({type:EDIT_EVENT_DESCRIPTION_CHANGE,value:E}),changeEditEventStartTime=E=>({type:EDIT_EVENT_START_TIME_CHANGE,value:E}),changeEditEventEndTime=E=>({type:EDIT_EVENT_END_TIME_CHANGE,value:E}),changeEditEventHasEndTime=E=>({type:EDIT_EVENT_HAS_END_TIME_CHANGE,value:E}),changeEditEventApprovalRequired=E=>({type:EDIT_EVENT_APPROVAL_REQUIRED_CHANGE,value:E}),changeEditEventLocation=E=>(y,R)=>{let k=null;E&&(k=R().locations.get(E)),y({type:EDIT_EVENT_LOCATION_CHANGE,value:k})},uploadEventBanner=(E,y)=>R=>{let k=0;R(uploadEventBannerRequest()),R(uploadFile(E,y,H=>R(uploadEventBannerSuccess(H,E)),H=>R(uploadEventBannerFail(H)),({loaded:H})=>{k=H,R(uploadEventBannerProgress(k))}))},uploadEventBannerRequest=()=>({type:EVENT_BANNER_UPLOAD_REQUEST}),uploadEventBannerProgress=E=>({type:EVENT_BANNER_UPLOAD_PROGRESS,loaded:E}),uploadEventBannerSuccess=(E,y)=>({type:EVENT_BANNER_UPLOAD_SUCCESS,media:E,file:y}),uploadEventBannerFail=E=>({type:EVENT_BANNER_UPLOAD_FAIL,error:E}),undoUploadEventBanner=()=>({type:EVENT_BANNER_UPLOAD_UNDO}),submitEvent=()=>(E,y)=>{const R=y(),k=R.compose_event.id,H=R.compose_event.name,B=R.compose_event.status,te=R.compose_event.banner,ae=R.compose_event.start_time,ce=R.compose_event.end_time,Ce=R.compose_event.approval_required?"restricted":"free",Oe=R.compose_event.location;if(!H||!H.length)return;E(submitEventRequest());const Le={name:H,status:B,start_time:ae,join_mode:Ce,content_type:"text/markdown"};ce&&(Le.end_time=ce),te&&(Le.banner_id=te.id),Oe&&(Le.location_id=Oe.origin_id);const Ne=k===null?"POST":"PUT",Fe=k===null?"/api/v1/pleroma/events":`/api/v1/pleroma/events/${k}`;return api(y).request(Ne,Fe,Le).then(Ue=>Ue.json()).then(Ue=>{E(closeModal("COMPOSE_EVENT")),E(importFetchedStatus(Ue)),E(submitEventSuccess(Ue)),toast.success(k?messages$1.editSuccess:messages$1.success,{actionLabel:messages$1.view,actionLink:`/@${Ue.account.acct}/events/${Ue.id}`})}).catch(function(Ue){E(submitEventFail(Ue))})},submitEventRequest=()=>({type:EVENT_SUBMIT_REQUEST}),submitEventSuccess=E=>({type:EVENT_SUBMIT_SUCCESS,status:E}),submitEventFail=E=>({type:EVENT_SUBMIT_FAIL,error:E}),joinEvent=(E,y)=>(R,k)=>{const H=k().statuses.get(E);return!H||!H.event||H.event.join_state?R(noOp$2):(R(joinEventRequest(H)),api(k).post(`/api/v1/pleroma/events/${E}/join`,{participation_message:y}).then(B=>B.json()).then(B=>{var te;R(importFetchedStatus(B)),R(joinEventSuccess(B)),toast.success(((te=B.pleroma.event)==null?void 0:te.join_state)==="pending"?messages$1.joinRequestSuccess:messages$1.joinSuccess,{actionLabel:messages$1.view,actionLink:`/@${B.account.acct}/events/${B.id}`})}).catch(function(B){var te;R(joinEventFail(B,H,((te=H==null?void 0:H.event)==null?void 0:te.join_state)||null))}))},joinEventRequest=E=>({type:EVENT_JOIN_REQUEST,id:E.id}),joinEventSuccess=E=>({type:EVENT_JOIN_SUCCESS,id:E.id}),joinEventFail=(E,y,R)=>({type:EVENT_JOIN_FAIL,error:E,id:y.id,previousState:R}),leaveEvent=E=>(y,R)=>{const k=R().statuses.get(E);return!k||!k.event||!k.event.join_state?y(noOp$2):(y(leaveEventRequest(k)),api(R).post(`/api/v1/pleroma/events/${E}/leave`).then(H=>H.json()).then(H=>{y(importFetchedStatus(H)),y(leaveEventSuccess(H))}).catch(function(H){y(leaveEventFail(H,k))}))},leaveEventRequest=E=>({type:EVENT_LEAVE_REQUEST,id:E.id}),leaveEventSuccess=E=>({type:EVENT_LEAVE_SUCCESS,id:E.id}),leaveEventFail=(E,y)=>({type:EVENT_LEAVE_FAIL,id:y.id,error:E}),fetchEventParticipations=E=>(y,R)=>(y(fetchEventParticipationsRequest(E)),api(R).get(`/api/v1/pleroma/events/${E}/participations`).then(async k=>{const H=k.next(),B=await k.json();return y(importFetchedAccounts(B)),y(fetchEventParticipationsSuccess(E,B,H))}).catch(k=>{y(fetchEventParticipationsFail(E,k))})),fetchEventParticipationsRequest=E=>({type:EVENT_PARTICIPATIONS_FETCH_REQUEST,id:E}),fetchEventParticipationsSuccess=(E,y,R)=>({type:EVENT_PARTICIPATIONS_FETCH_SUCCESS,id:E,accounts:y,next:R}),fetchEventParticipationsFail=(E,y)=>({type:EVENT_PARTICIPATIONS_FETCH_FAIL,id:E,error:y}),fetchEventParticipationRequests=E=>(y,R)=>(y(fetchEventParticipationRequestsRequest(E)),api(R).get(`/api/v1/pleroma/events/${E}/participation_requests`).then(async k=>{const H=k.next(),B=await k.json();return y(importFetchedAccounts(B.map(({account:te})=>te))),y(fetchEventParticipationRequestsSuccess(E,B,H))}).catch(k=>{y(fetchEventParticipationRequestsFail(E,k))})),fetchEventParticipationRequestsRequest=E=>({type:EVENT_PARTICIPATION_REQUESTS_FETCH_REQUEST,id:E}),fetchEventParticipationRequestsSuccess=(E,y,R)=>({type:EVENT_PARTICIPATION_REQUESTS_FETCH_SUCCESS,id:E,participations:y,next:R}),fetchEventParticipationRequestsFail=(E,y)=>({type:EVENT_PARTICIPATION_REQUESTS_FETCH_FAIL,id:E,error:y}),authorizeEventParticipationRequest=(E,y)=>(R,k)=>(R(authorizeEventParticipationRequestRequest(E,y)),api(k).post(`/api/v1/pleroma/events/${E}/participation_requests/${y}/authorize`).then(()=>{R(authorizeEventParticipationRequestSuccess(E,y)),toast.success(messages$1.authorized)}).catch(H=>R(authorizeEventParticipationRequestFail(E,y,H)))),authorizeEventParticipationRequestRequest=(E,y)=>({type:EVENT_PARTICIPATION_REQUEST_AUTHORIZE_REQUEST,id:E,accountId:y}),authorizeEventParticipationRequestSuccess=(E,y)=>({type:EVENT_PARTICIPATION_REQUEST_AUTHORIZE_SUCCESS,id:E,accountId:y}),authorizeEventParticipationRequestFail=(E,y,R)=>({type:EVENT_PARTICIPATION_REQUEST_AUTHORIZE_FAIL,id:E,accountId:y,error:R}),rejectEventParticipationRequest=(E,y)=>(R,k)=>(R(rejectEventParticipationRequestRequest(E,y)),api(k).post(`/api/v1/pleroma/events/${E}/participation_requests/${y}/reject`).then(()=>{R(rejectEventParticipationRequestSuccess(E,y)),toast.success(messages$1.rejected)}).catch(H=>R(rejectEventParticipationRequestFail(E,y,H)))),rejectEventParticipationRequestRequest=(E,y)=>({type:EVENT_PARTICIPATION_REQUEST_REJECT_REQUEST,id:E,accountId:y}),rejectEventParticipationRequestSuccess=(E,y)=>({type:EVENT_PARTICIPATION_REQUEST_REJECT_SUCCESS,id:E,accountId:y}),rejectEventParticipationRequestFail=(E,y,R)=>({type:EVENT_PARTICIPATION_REQUEST_REJECT_FAIL,id:E,accountId:y,error:R}),fetchEventIcs=E=>(y,R)=>api(R).get(`/api/v1/pleroma/events/${E}/ics`),cancelEventCompose=()=>({type:EVENT_COMPOSE_CANCEL}),editEvent=E=>(y,R)=>{const k=R().statuses.get(E);y({type:STATUS_FETCH_SOURCE_REQUEST}),api(R).get(`/api/v1/statuses/${E}/source`).then(H=>H.json()).then(H=>{y({type:STATUS_FETCH_SOURCE_SUCCESS}),y({type:EVENT_FORM_SET,status:k,text:H.text,location:H.location}),y(openModal("COMPOSE_EVENT"))}).catch(H=>{y({type:STATUS_FETCH_SOURCE_FAIL,error:H})})},fetchRecentEvents=()=>(E,y)=>{var R;(R=y().status_lists.get("recent_events"))!=null&&R.isLoading||(E({type:RECENT_EVENTS_FETCH_REQUEST}),api(y).get("/api/v1/timelines/public?only_events=true").then(async k=>{const H=k.next(),B=await k.json();E(importFetchedStatuses(B)),E({type:RECENT_EVENTS_FETCH_SUCCESS,statuses:B,next:H})}).catch(k=>{E({type:RECENT_EVENTS_FETCH_FAIL,error:k})}))},fetchJoinedEvents=()=>(E,y)=>{var R;(R=y().status_lists.get("joined_events"))!=null&&R.isLoading||(E({type:JOINED_EVENTS_FETCH_REQUEST}),api(y).get("/api/v1/pleroma/events/joined_events").then(async k=>{const H=k.next(),B=await k.json();E(importFetchedStatuses(B)),E({type:JOINED_EVENTS_FETCH_SUCCESS,statuses:B,next:H})}).catch(k=>{E({type:JOINED_EVENTS_FETCH_FAIL,error:k})}))},ReducerRecord$m=Record({name:"",status:"",location:null,start_time:new Date,end_time:null,approval_required:!1,banner:null,progress:0,is_uploading:!1,is_submitting:!1,id:null}),setHasEndTime=E=>{const y=new Date(E.start_time);return y.setHours(y.getHours()+2),E.set("end_time",y)};function compose_event(E=ReducerRecord$m(),y){switch(y.type){case EDIT_EVENT_NAME_CHANGE:return E.set("name",y.value);case EDIT_EVENT_DESCRIPTION_CHANGE:return E.set("status",y.value);case EDIT_EVENT_START_TIME_CHANGE:return E.set("start_time",y.value);case EDIT_EVENT_END_TIME_CHANGE:return E.set("end_time",y.value);case EDIT_EVENT_HAS_END_TIME_CHANGE:return y.value?setHasEndTime(E):E.set("end_time",null);case EDIT_EVENT_APPROVAL_REQUIRED_CHANGE:return E.set("approval_required",y.value);case EDIT_EVENT_LOCATION_CHANGE:return E.set("location",y.value);case EVENT_BANNER_UPLOAD_REQUEST:return E.set("is_uploading",!0);case EVENT_BANNER_UPLOAD_SUCCESS:return E.set("banner",normalizeAttachment(fromJS(y.media))).set("is_uploading",!1);case EVENT_BANNER_UPLOAD_FAIL:return E.set("is_uploading",!1);case EVENT_BANNER_UPLOAD_UNDO:return E.set("banner",null);case EVENT_BANNER_UPLOAD_PROGRESS:return E.set("progress",y.loaded*100);case EVENT_SUBMIT_REQUEST:return E.set("is_submitting",!0);case EVENT_SUBMIT_SUCCESS:case EVENT_SUBMIT_FAIL:return E.set("is_submitting",!1);case EVENT_COMPOSE_CANCEL:return ReducerRecord$m();case EVENT_FORM_SET:return ReducerRecord$m({name:y.status.event.name,status:y.text,start_time:new Date(y.status.event.start_time),end_time:y.status.event.end_time?new Date(y.status.event.end_time):null,approval_required:y.status.event.join_mode!=="free",banner:y.status.event.banner||null,location:y.location?normalizeLocation(y.location):null,progress:0,is_uploading:!1,is_submitting:!1,id:y.status.id});default:return E}}function isCustomEmoji(E){return E.imageUrl!==void 0}function isNativeEmoji(E){return E.native!==void 0}function buildCustomEmojis(E){const y=[];return E.forEach(R=>{const k=R.shortcode,H=R.url,B=k.replace(":","");y.push({id:B,name:B,keywords:[B],skins:[{src:H}]})}),y}let Settings$1=class{constructor(y=null){Jt(this,"keyBase",null);this.keyBase=y}generateKey(y){return this.keyBase?[this.keyBase,`id${y}`].join("."):y}set(y,R){const k=this.generateKey(y);try{const H=JSON.stringify(R);return localStorage.setItem(k,H),R}catch{return null}}get(y){const R=this.generateKey(y);try{const k=localStorage.getItem(R);return k?JSON.parse(k):null}catch{return null}}remove(y){const R=this.get(y);if(R){const k=this.generateKey(y);try{localStorage.removeItem(k)}catch{}}return R}};const tagHistory=new Settings$1("soapbox_tag_history"),groupSearchHistory=new Settings$1("soapbox_group_search_history");function parse_option(E,y){return typeof E<"u"?E:y}function create_object_array(E){const y=new Array(E);for(let R=0;R1&&(E=replace(E,this.stemmer)),k&&E.length>1&&(E=collapse(E)),R||R==="")){const H=E.split(R);return this.filter?filter(H,this.filter):H}return E}const regex_whitespace=/[\p{Z}\p{S}\p{P}\p{C}]+/u;function init_filter(E){const y=create_object();for(let R=0,k=E.length;R=0;Ce--){const Oe=E[Ce],Le=Oe.length,Ne=create_object();let Fe=!te;for(let Ue=0;Ue=0;Ce--){Oe=k[Ce],Le=Oe.length;for(let Ne=0,Fe;Ne0;k--)this.queue[k]=this.queue[k-1];this.queue[0]=E}this.cache[E]=y};CacheClass.prototype.get=function(E){const y=this.cache[E];if(this.limit&&y){const R=this.queue.indexOf(E);if(R){const k=this.queue[R-1];this.queue[R-1]=this.queue[R],this.queue[R]=k}}return y};CacheClass.prototype.del=function(E){for(let y=0,R,k;y"u"&&self.exports,H=this;this.worker=create(R,k,E.worker),this.resolver=create_object(),this.worker&&(k?this.worker.on("message",function(B){H.resolver[B.id](B.msg),delete H.resolver[B.id]}):this.worker.onmessage=function(B){B=B.data,H.resolver[B.id](B.msg),delete H.resolver[B.id]},this.worker.postMessage({task:"init",factory:R,options:E}))}register("add");register("append");register("search");register("update");register("remove");function register(E){WorkerIndex.prototype[E]=WorkerIndex.prototype[E+"Async"]=function(){const y=this,R=[].slice.call(arguments),k=R[R.length-1];let H;is_function(k)&&(H=k,R.splice(R.length-1,1));const B=new Promise(function(te){setTimeout(function(){y.resolver[++pid]=te,y.worker.postMessage({task:E,id:pid,args:R})})});return H?(B.then(H),this):B}}function create(factory,is_node_js,worker_path){let worker;try{worker=is_node_js?eval('new (require("worker_threads")["Worker"])("../dist/node/node.js")'):factory?new Worker(URL.createObjectURL(new Blob(["onmessage="+handler.toString()],{type:"text/javascript"}))):new Worker(is_string(worker_path)?worker_path:"worker/worker.js",{type:"module"})}catch(E){}return worker}function Document(E){if(!(this instanceof Document))return new Document(E);const y=E.document||E.doc||E;let R;this.tree=[],this.field=[],this.marker=[],this.register=create_object(),this.key=(R=y.key||y.id)&&parse_tree(R,this.marker)||"id",this.fastupdate=parse_option(E.fastupdate,!0),this.storetree=(R=y.store)&&R!==!0&&[],this.store=R&&create_object(),this.tag=(R=y.tag)&&parse_tree(R,this.marker),this.tagindex=R&&create_object(),this.cache=(R=E.cache)&&new CacheClass(R),E.cache=!1,this.worker=E.worker,this.async=!1,this.index=parse_descriptor.call(this,E,y)}function parse_descriptor(E,y){const R=create_object();let k=y.index||y.field||y;is_string(k)&&(k=[k]);for(let H=0,B,te;H=0&&(E=E.substring(0,E.length-2),E&&(y[k]=!0)),E&&(R[k++]=E);return k1?R:R[0]}function parse_simple(E,y){if(is_string(y))E=E[y];else for(let R=0;E&&R1?R.splice(k,1):delete this.tagindex[y])}this.store&&delete this.store[E],delete this.register[E]}return this};Document.prototype.search=function(E,y,R,k){R||(!y&&is_object(E)?(R=E,E=""):is_object(y)&&(R=y,y=0));let H=[],B=[],te,ae,ce,Ce,Oe,Le,Ne=0;if(R)if(is_array(R))ce=R,R=null;else{if(E=R.query||E,te=R.pluck,ce=te||R.index||R.field,Ce=R.tag,ae=this.store&&R.enrich,Oe=R.bool==="and",y=R.limit||y||100,Le=R.offset||0,Ce&&(is_string(Ce)&&(Ce=[Ce]),!E)){for(let Ue=0,De;Ue1||Ce&&Ce.length>1);const Fe=!k&&(this.worker||this.async)&&[];for(let Ue=0,De,$e,Be;Ue0)return(B>y||R)&&(H=H.slice(R,R+y)),k&&(H=apply_enrich.call(this,H)),{tag:E,result:H}}function apply_enrich(E){const y=new Array(E.length);for(let R=0,k;R=this.minlength&&(ae||!te[Oe])){let Ne=get_score(ce,H,Ce),Fe="";switch(this.tokenize){case"full":if(Le>2){for(let Ue=0;UeUe;De--)if(De-Ue>=this.minlength){const $e=get_score(ce,H,Ce,Le,Ue);Fe=Oe.substring(Ue,De),this.push_index(te,Fe,$e,E,R)}break}case"reverse":if(Le>1){for(let Ue=Le-1;Ue>0;Ue--)if(Fe=Oe[Ue]+Fe,Fe.length>=this.minlength){const De=get_score(ce,H,Ce,Le,Ue);this.push_index(te,Fe,De,E,R)}Fe=""}case"forward":if(Le>1){for(let Ue=0;Ue=this.minlength&&this.push_index(te,Fe,Ne,E,R);break}default:if(this.boost&&(Ne=Math.min(Ne/this.boost(y,Oe,Ce)|0,ce-1)),this.push_index(te,Oe,Ne,E,R),ae&&H>1&&Ce=this.minlength&&!Ue[Oe]){Ue[Oe]=1;const Ke=get_score(De+(H/2>De?0:1),H,Ce,Be-1,Ve-1),st=this.bidirectional&&Oe>$e;this.push_index(B,st?$e:Oe,Ke,E,R,st?Oe:$e)}}}}}this.fastupdate||(this.register[E]=1)}}return this};function get_score(E,y,R,k,H){return R&&E>1?y+(k||0)<=E?R+(H||0):(E-1)/(y+(k||0))*(R+(H||0))+1|0:0}Index.prototype.push_index=function(E,y,R,k,H,B){let te=B?this.ctx:this.map;if((!E[y]||B&&!E[y][B])&&(this.optimize&&(te=te[R]),B?(E=E[y]||(E[y]=create_object()),E[B]=1,te=te[B]||(te[B]=create_object())):E[y]=1,te=te[y]||(te[y]=[]),this.optimize||(te=te[R]||(te[R]=[])),(!H||!te.includes(k))&&(te[te.length]=k,this.fastupdate))){const ae=this.register[k]||(this.register[k]=[]);ae[ae.length]=te}};Index.prototype.search=function(E,y,R){R||(!y&&is_object(E)?(R=E,E=R.query):is_object(y)&&(R=y));let k=[],H,B,te,ae=0;if(R&&(E=R.query||E,y=R.limit,ae=R.offset||0,B=R.context,te=R.suggest),E&&(E=this.encode(""+E),H=E.length,H>1)){const Le=create_object(),Ne=[];for(let Fe=0,Ue=0,De;Fe=this.minlength&&!Le[De]){if(!this.optimize&&!te&&!this.map[De])return k;Ne[Ue++]=De,Le[De]=1}E=Ne,H=E.length}if(!H)return k;y||(y=100);let ce=this.depth&&H>1&&B!==!1,Ce=0,Oe;ce?(Oe=E[0],Ce=1):H>1&&E.sort(sort_by_length_down);for(let Le,Ne;Ce=R)))));Le++);if(Ce){if(H)return single_result(ae,R,0);E[E.length]=ae;return}}return!y&&ae};function single_result(E,y,R){return E.length===1?E=E[0]:E=concat(E),R||E.length>y?E.slice(R,R+y):E}function get_array(E,y,R,k){if(R){const H=k&&y>R;E=E[H?y:R],E=E&&E[H?R:y]}else E=E[y];return E}Index.prototype.contain=function(E){return!!this.register[E]};Index.prototype.update=function(E,y){return this.remove(E).add(E,y)};Index.prototype.remove=function(E,y){const R=this.register[E];if(R){if(this.fastupdate)for(let k=0,H;k1&&(E.splice(te,1),B++):B++}else{H=Math.min(E.length,R);for(let te=0,ae;teimport("./js/data-B__uw_g8.js"),[]).then(E=>{data=E.default;const y=Object.entries(data.emojis).sort((R,k)=>R[0].localeCompare(k[0]));for(const[R,k]of y)index.add("n"+R,`${k.id} ${k.name} ${k.keywords.join(" ")}`)}).catch(console.warn);function addCustomToPool(E){for(const R in index.register)R[0]==="c"&&index.remove(R);let y=0;for(const R of E)index.add("c"+y++,R.id)}const search$1=(E,{maxResults:y=5}={},R)=>index.search(E,y).flatMap(k=>{var B;if(typeof k!="string")return;if(k[0]==="c"&&R){const te=Number(k.slice(1)),ae=R[te];if(ae)return{id:ae.shortcode,colons:":"+ae.shortcode+":",custom:!0,imageUrl:ae.url}}const H=(B=data.emojis[k.slice(1)])==null?void 0:B.skins;if(H)return{id:k.slice(1),colons:":"+k.slice(1)+":",unified:H[0].unified,native:H[0].native}}).filter(Boolean);function autosuggestPopulate(E){addCustomToPool(buildCustomEmojis(E))}const EMOJI_CHOOSE="EMOJI_CHOOSE",chooseEmoji=E=>y=>{y({type:EMOJI_CHOOSE,emoji:E}),y(saveSettings())};let cancelFetchComposeSuggestions;const COMPOSE_CHANGE="COMPOSE_CHANGE",COMPOSE_SUBMIT_REQUEST="COMPOSE_SUBMIT_REQUEST",COMPOSE_SUBMIT_SUCCESS="COMPOSE_SUBMIT_SUCCESS",COMPOSE_SUBMIT_FAIL="COMPOSE_SUBMIT_FAIL",COMPOSE_REPLY="COMPOSE_REPLY",COMPOSE_EVENT_REPLY="COMPOSE_EVENT_REPLY",COMPOSE_REPLY_CANCEL="COMPOSE_REPLY_CANCEL",COMPOSE_QUOTE="COMPOSE_QUOTE",COMPOSE_QUOTE_CANCEL="COMPOSE_QUOTE_CANCEL",COMPOSE_DIRECT="COMPOSE_DIRECT",COMPOSE_MENTION="COMPOSE_MENTION",COMPOSE_RESET="COMPOSE_RESET",COMPOSE_UPLOAD_REQUEST="COMPOSE_UPLOAD_REQUEST",COMPOSE_UPLOAD_SUCCESS="COMPOSE_UPLOAD_SUCCESS",COMPOSE_UPLOAD_FAIL="COMPOSE_UPLOAD_FAIL",COMPOSE_UPLOAD_PROGRESS="COMPOSE_UPLOAD_PROGRESS",COMPOSE_UPLOAD_UNDO="COMPOSE_UPLOAD_UNDO",COMPOSE_GROUP_POST="COMPOSE_GROUP_POST",COMPOSE_SET_GROUP_TIMELINE_VISIBLE="COMPOSE_SET_GROUP_TIMELINE_VISIBLE",COMPOSE_SUGGESTIONS_CLEAR="COMPOSE_SUGGESTIONS_CLEAR",COMPOSE_SUGGESTIONS_READY="COMPOSE_SUGGESTIONS_READY",COMPOSE_SUGGESTION_SELECT="COMPOSE_SUGGESTION_SELECT",COMPOSE_SUGGESTION_TAGS_UPDATE="COMPOSE_SUGGESTION_TAGS_UPDATE",COMPOSE_TAG_HISTORY_UPDATE="COMPOSE_TAG_HISTORY_UPDATE",COMPOSE_SPOILERNESS_CHANGE="COMPOSE_SPOILERNESS_CHANGE",COMPOSE_TYPE_CHANGE="COMPOSE_TYPE_CHANGE",COMPOSE_SPOILER_TEXT_CHANGE="COMPOSE_SPOILER_TEXT_CHANGE",COMPOSE_VISIBILITY_CHANGE="COMPOSE_VISIBILITY_CHANGE",COMPOSE_EMOJI_INSERT="COMPOSE_EMOJI_INSERT",COMPOSE_UPLOAD_CHANGE_REQUEST="COMPOSE_UPLOAD_UPDATE_REQUEST",COMPOSE_UPLOAD_CHANGE_SUCCESS="COMPOSE_UPLOAD_UPDATE_SUCCESS",COMPOSE_UPLOAD_CHANGE_FAIL="COMPOSE_UPLOAD_UPDATE_FAIL",COMPOSE_POLL_ADD="COMPOSE_POLL_ADD",COMPOSE_POLL_REMOVE="COMPOSE_POLL_REMOVE",COMPOSE_POLL_OPTION_ADD="COMPOSE_POLL_OPTION_ADD",COMPOSE_POLL_OPTION_CHANGE="COMPOSE_POLL_OPTION_CHANGE",COMPOSE_POLL_OPTION_REMOVE="COMPOSE_POLL_OPTION_REMOVE",COMPOSE_POLL_SETTINGS_CHANGE="COMPOSE_POLL_SETTINGS_CHANGE",COMPOSE_SCHEDULE_ADD="COMPOSE_SCHEDULE_ADD",COMPOSE_SCHEDULE_SET="COMPOSE_SCHEDULE_SET",COMPOSE_SCHEDULE_REMOVE="COMPOSE_SCHEDULE_REMOVE",COMPOSE_ADD_TO_MENTIONS="COMPOSE_ADD_TO_MENTIONS",COMPOSE_REMOVE_FROM_MENTIONS="COMPOSE_REMOVE_FROM_MENTIONS",COMPOSE_EDITOR_STATE_SET="COMPOSE_EDITOR_STATE_SET",COMPOSE_CHANGE_MEDIA_ORDER="COMPOSE_CHANGE_MEDIA_ORDER",messages={scheduleError:{id:"compose.invalid_schedule",defaultMessage:"You must schedule a post at least 5 minutes out."},success:{id:"compose.submit_success",defaultMessage:"Your post was sent!"},editSuccess:{id:"compose.edit_success",defaultMessage:"Your post was edited"},uploadErrorLimit:{id:"upload_error.limit",defaultMessage:"File upload limit exceeded."},uploadErrorPoll:{id:"upload_error.poll",defaultMessage:"File upload not allowed with polls."},view:{id:"toast.view",defaultMessage:"View"},replyConfirm:{id:"confirmations.reply.confirm",defaultMessage:"Reply"},replyMessage:{id:"confirmations.reply.message",defaultMessage:"Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?"}},changeCompose=(E,y)=>({type:COMPOSE_CHANGE,id:E,text:y}),replyCompose=E=>(y,R)=>{const k=R(),H=k.instance,{explicitAddressing:B}=getFeatures(H),te=!!getSettings(k).get("preserveSpoilers"),ae=selectOwnAccount(k);if(!ae)return;y({type:COMPOSE_REPLY,id:"compose-modal",status:E,account:ae,explicitAddressing:B,preserveSpoilers:te}),y(openModal("COMPOSE"))},cancelReplyCompose=()=>({type:COMPOSE_REPLY_CANCEL,id:"compose-modal"}),quoteCompose=E=>(y,R)=>{const k=R(),H=k.instance,{explicitAddressing:B}=getFeatures(H),te={type:COMPOSE_QUOTE,id:"compose-modal",status:E,account:selectOwnAccount(k),explicitAddressing:B};y(te),y(openModal("COMPOSE"))},cancelQuoteCompose=()=>({type:COMPOSE_QUOTE_CANCEL,id:"compose-modal"}),groupComposeModal=E=>(y,R)=>{const k=`group:${E.id}`;y(groupCompose(k,E.id)),y(openModal("COMPOSE",{composeId:k}))},resetCompose=(E="compose-modal")=>({type:COMPOSE_RESET,id:E}),mentionCompose=E=>y=>{y({type:COMPOSE_MENTION,id:"compose-modal",account:E}),y(openModal("COMPOSE"))},directCompose=E=>y=>{y({type:COMPOSE_DIRECT,id:"compose-modal",account:E}),y(openModal("COMPOSE"))},directComposeById=E=>(y,R)=>{const k=selectAccount(R(),E);if(!k)return;y({type:COMPOSE_DIRECT,id:"compose-modal",account:k}),y(openModal("COMPOSE"))},handleComposeSubmit=(E,y,R,k,H,B)=>{!E||!y||(E(insertIntoTagHistory(R,k.tags||[],H)),E(submitComposeSuccess(R,{...k})),toast.success(B?messages.editSuccess:messages.success,{actionLabel:messages.view,actionLink:`/@${k.account.acct}/posts/${k.id}`}))},needsDescriptions=(E,y)=>{const R=E.compose.get(y).media_attachments,k=getSettings(E).get("missingDescriptionModal"),H=R.filter(B=>!B.description).size>0;return k&&H},validateSchedule=(E,y)=>{var H;const R=(H=E.compose.get(y))==null?void 0:H.schedule;if(!R)return!0;const k=new Date(new Date().getTime()+3e5);return R.getTime()>k.getTime()},submitCompose=(E,y={})=>async(R,k)=>{const{history:H,force:B=!1}=y;if(!isLoggedIn(k))return;const te=k(),ae=te.compose.get(E),ce=ae.text,Ce=ae.media_attachments,Oe=ae.id;let Le=ae.to;if(!validateSchedule(te,E)){toast.error(messages.scheduleError);return}if((!ce||!ce.length)&&Ce.size===0)return;if(!B&&needsDescriptions(te,E)){R(openModal("MISSING_DESCRIPTION",{onContinue:()=>{R(closeModal("MISSING_DESCRIPTION")),R(submitCompose(E,{history:H,force:!0}))}}));return}const Ne=ce.match(/(?:^|\s)@([^@\s]+(?:@[^@\s]+)?)/gi);Ne&&(Le=Le.union(Ne.map(De=>De.trim().slice(1)))),R(submitComposeRequest(E)),R(closeModal());const Fe=ae.idempotencyKey,Ue={status:ce,in_reply_to_id:ae.in_reply_to,quote_id:ae.quote,media_ids:Ce.map(De=>De.id),sensitive:ae.sensitive,spoiler_text:ae.spoiler_text,visibility:ae.privacy,content_type:ae.content_type,poll:ae.poll,scheduled_at:ae.schedule,to:Le};return ae.privacy==="group"&&(Ue.group_id=ae.group_id,Ue.group_timeline_visible=ae.group_timeline_visible),R(createStatus(Ue,Fe,Oe)).then(function(De){!Oe&&De.visibility==="direct"&&k().conversations.mounted<=0&&H&&H.push("/messages"),handleComposeSubmit(R,k,E,De,ce,!!Oe)}).catch(function(De){R(submitComposeFail(E,De))})},submitComposeRequest=E=>({type:COMPOSE_SUBMIT_REQUEST,id:E}),submitComposeSuccess=(E,y)=>({type:COMPOSE_SUBMIT_SUCCESS,id:E,status:y}),submitComposeFail=(E,y)=>({type:COMPOSE_SUBMIT_FAIL,id:E,error:y}),uploadCompose=(E,y,R)=>(k,H)=>{var Ce;if(!isLoggedIn(H))return;const B=H().instance.configuration.statuses.max_media_attachments,te=(Ce=H().compose.get(E))==null?void 0:Ce.media_attachments,ae=new Array(y.length).fill(0),ce=te?te.size:0;if(y.length+ce>B){toast.error(messages.uploadErrorLimit);return}k(uploadComposeRequest(E)),Array.from(y).forEach(async(Oe,Le)=>{ce+Le>B-1||k(uploadFile(Oe,R,Ne=>k(uploadComposeSuccess(E,Ne,Oe)),Ne=>{console.error(Ne),k(uploadComposeFail(E,Ne))},Ne=>{ae[Le]=Ne.loaded,k(uploadComposeProgress(E,ae.reduce((Fe,Ue)=>Fe+Ue,0),Ne.total))}))})},uploadComposeRequest=E=>({type:COMPOSE_UPLOAD_REQUEST,id:E,skipLoading:!0}),uploadComposeProgress=(E,y,R)=>({type:COMPOSE_UPLOAD_PROGRESS,id:E,loaded:y,total:R}),uploadComposeSuccess=(E,y,R)=>({type:COMPOSE_UPLOAD_SUCCESS,id:E,media:y,file:R,skipLoading:!0}),uploadComposeFail=(E,y)=>({type:COMPOSE_UPLOAD_FAIL,id:E,error:y,skipLoading:!0}),changeUploadCompose=(E,y,R)=>(k,H)=>{isLoggedIn(H)&&(k(changeUploadComposeRequest(E)),k(updateMedia(y,R)).then(B=>B.json()).then(B=>{k(changeUploadComposeSuccess(E,B))}).catch(B=>{k(changeUploadComposeFail(E,y,B))}))},changeUploadComposeRequest=E=>({type:COMPOSE_UPLOAD_CHANGE_REQUEST,id:E,skipLoading:!0}),changeUploadComposeSuccess=(E,y)=>({type:COMPOSE_UPLOAD_CHANGE_SUCCESS,id:E,media:y,skipLoading:!0}),changeUploadComposeFail=(E,y,R)=>({type:COMPOSE_UPLOAD_CHANGE_FAIL,composeId:E,id:y,error:R,skipLoading:!0}),undoUploadCompose=(E,y)=>({type:COMPOSE_UPLOAD_UNDO,id:E,media_id:y}),groupCompose=(E,y)=>({type:COMPOSE_GROUP_POST,id:E,group_id:y}),setGroupTimelineVisible=(E,y)=>({type:COMPOSE_SET_GROUP_TIMELINE_VISIBLE,id:E,groupTimelineVisible:y}),clearComposeSuggestions=E=>({type:COMPOSE_SUGGESTIONS_CLEAR,id:E}),fetchComposeSuggestionsAccounts=throttle((E,y,R,k)=>{api(y).get("/api/v1/accounts/search",{signal:cancelFetchComposeSuggestions==null?void 0:cancelFetchComposeSuggestions.signal,searchParams:{q:k.slice(1),resolve:!1,limit:10}}).then(H=>H.json()).then(H=>{E(importFetchedAccounts(H)),E(readyComposeSuggestionsAccounts(R,k,H))}).catch(H=>{H instanceof HTTPError&&toast.showAlertForError(H)})},200,{edges:["leading","trailing"]}),fetchComposeSuggestionsEmojis=(E,y,R,k)=>{const H=search$1(R.replace(":",""),{maxResults:10},k);E(readyComposeSuggestionsEmojis(y,R,H))},fetchComposeSuggestionsTags=(E,y,R,k)=>{const H=y(),B=H.instance,{trends:te}=getFeatures(B);if(te){const ae=H.trends.items;return E(updateSuggestionTags$1(R,k,ae))}api(y).get("/api/v2/search",{signal:cancelFetchComposeSuggestions==null?void 0:cancelFetchComposeSuggestions.signal,searchParams:{q:k.slice(1),limit:10,type:"hashtags"}}).then(ae=>ae.json()).then(ae=>{E(updateSuggestionTags$1(R,k,ae==null?void 0:ae.hashtags.map(normalizeTag)))}).catch(ae=>{ae instanceof HTTPError&&toast.showAlertForError(ae)})},fetchComposeSuggestions=(E,y,R)=>(k,H)=>{switch(y[0]){case":":fetchComposeSuggestionsEmojis(k,E,y,R);break;case"#":fetchComposeSuggestionsTags(k,H,E,y);break;default:fetchComposeSuggestionsAccounts(k,H,E,y);break}},readyComposeSuggestionsEmojis=(E,y,R)=>({type:COMPOSE_SUGGESTIONS_READY,id:E,token:y,emojis:R}),readyComposeSuggestionsAccounts=(E,y,R)=>({type:COMPOSE_SUGGESTIONS_READY,id:E,token:y,accounts:R}),selectComposeSuggestion=(E,y,R,k,H)=>(B,te)=>{let ae="",ce=y;typeof k=="object"&&k.id?(ae=isNativeEmoji(k)?k.native:k.colons,ce=y-1,B(chooseEmoji(k))):typeof k=="string"&&k[0]==="#"?(ae=k,ce=y-1):typeof k=="string"&&(ae=selectAccount(te(),k).acct,ce=y),B({type:COMPOSE_SUGGESTION_SELECT,id:E,position:ce,token:R,completion:ae,path:H})},updateSuggestionTags$1=(E,y,R)=>({type:COMPOSE_SUGGESTION_TAGS_UPDATE,id:E,token:y,tags:R}),updateTagHistory=(E,y)=>({type:COMPOSE_TAG_HISTORY_UPDATE,id:E,tags:y}),insertIntoTagHistory=(E,y,R)=>(k,H)=>{const B=H(),te=B.compose.get(E).tagHistory,ae=B.me,ce=y.filter(Le=>R.match(new RegExp(`#${Le.name}`,"i"))).map(Le=>Le.name),Ce=te.filter(Le=>ce.findIndex(Ne=>Ne.toLowerCase()===Le.toLowerCase())===-1);ce.push(...Ce.toJS());const Oe=ce.slice(0,1e3);tagHistory.set(ae,Oe),k(updateTagHistory(E,Oe))},changeComposeSpoilerness=E=>({type:COMPOSE_SPOILERNESS_CHANGE,id:E}),changeComposeContentType=(E,y)=>({type:COMPOSE_TYPE_CHANGE,id:E,value:y}),changeComposeSpoilerText=(E,y)=>({type:COMPOSE_SPOILER_TEXT_CHANGE,id:E,text:y}),changeComposeVisibility=(E,y)=>({type:COMPOSE_VISIBILITY_CHANGE,id:E,value:y}),addPoll=E=>({type:COMPOSE_POLL_ADD,id:E}),removePoll=E=>({type:COMPOSE_POLL_REMOVE,id:E}),addSchedule=E=>({type:COMPOSE_SCHEDULE_ADD,id:E}),setSchedule=(E,y)=>({type:COMPOSE_SCHEDULE_SET,id:E,date:y}),removeSchedule=E=>({type:COMPOSE_SCHEDULE_REMOVE,id:E}),addPollOption=(E,y)=>({type:COMPOSE_POLL_OPTION_ADD,id:E,title:y}),changePollOption=(E,y,R)=>({type:COMPOSE_POLL_OPTION_CHANGE,id:E,index:y,title:R}),removePollOption=(E,y)=>({type:COMPOSE_POLL_OPTION_REMOVE,id:E,index:y}),changePollSettings=(E,y,R)=>({type:COMPOSE_POLL_SETTINGS_CHANGE,id:E,expiresIn:y,isMultiple:R}),openComposeWithText=(E,y="")=>R=>{R(resetCompose(E)),R(openModal("COMPOSE")),R(changeCompose(E,y))},addToMentions=(E,y)=>(R,k)=>{const H=k(),B=selectAccount(H,y);if(!B)return;const te={type:COMPOSE_ADD_TO_MENTIONS,id:E,account:B.acct};return R(te)},removeFromMentions=(E,y)=>(R,k)=>{const H=k(),B=selectAccount(H,y);if(!B)return;const te={type:COMPOSE_REMOVE_FROM_MENTIONS,id:E,account:B.acct};return R(te)},eventDiscussionCompose=(E,y)=>(R,k)=>{const H=k(),B=H.instance,{explicitAddressing:te}=getFeatures(B);return R({type:COMPOSE_EVENT_REPLY,id:E,status:y,account:selectOwnAccount(H),explicitAddressing:te})},setEditorState=(E,y)=>({type:COMPOSE_EDITOR_STATE_SET,id:E,editorState:y}),changeMediaOrder=(E,y,R)=>({type:COMPOSE_CHANGE_MEDIA_ORDER,id:E,a:y,b:R}),getResetFileKey=()=>Math.floor(Math.random()*65536),PollRecord=Record({options:List(["",""]),expires_in:24*3600,multiple:!1}),ReducerCompose=Record({caretPosition:null,content_type:"text/plain",editorState:null,focusDate:null,group_id:null,idempotencyKey:"",id:null,in_reply_to:null,is_changing_upload:!1,is_composing:!1,is_submitting:!1,is_uploading:!1,media_attachments:List(),poll:null,privacy:"public",progress:0,quote:null,resetFileKey:null,schedule:null,sensitive:!1,spoiler:!1,spoiler_text:"",suggestions:List(),suggestion_token:null,tagHistory:List(),text:"",to:OrderedSet(),group_timeline_visible:!1}),statusToTextMentions=(E,y)=>{var H;const R=E.getIn(["account","acct"]),k=((H=E.get("mentions"))==null?void 0:H.map(B=>B.acct))||[];return OrderedSet([R]).concat(k).delete(y.acct).map(B=>`@${B} `).join("")},statusToMentionsArray=(E,y)=>{var H;const R=E.getIn(["account","acct"]),k=((H=E.get("mentions"))==null?void 0:H.map(B=>B.acct))||[];return OrderedSet([R]).concat(k).delete(y.acct)},statusToMentionsAccountIdsArray=(E,y)=>{const R=E.mentions.map(k=>k.id);return OrderedSet([y.id]).concat(R).delete(y.id)},appendMedia=(E,y,R)=>{const k=E.media_attachments.size;return E.withMutations(H=>{H.update("media_attachments",B=>B.push(normalizeAttachment(y))),H.set("is_uploading",!1),H.set("resetFileKey",Math.floor(Math.random()*65536)),H.set("idempotencyKey",crypto.randomUUID()),k===0&&(R||E.spoiler)&&H.set("sensitive",!0)})},removeMedia=(E,y)=>{const R=E.media_attachments.size;return E.withMutations(k=>{k.update("media_attachments",H=>H.filterNot(B=>B.id===y)),k.set("idempotencyKey",crypto.randomUUID()),R===1&&k.set("sensitive",!1)})},insertSuggestion=(E,y,R,k,H)=>E.withMutations(B=>{B.updateIn(H,te=>`${te.slice(0,y)}${k} ${te.slice(y+((R==null?void 0:R.length)??0))}`),B.set("suggestion_token",null),B.set("suggestions",List()),H.length===1&&H[0]==="text"&&(B.set("focusDate",new Date),B.set("caretPosition",y+k.length+1)),B.set("idempotencyKey",crypto.randomUUID())}),updateSuggestionTags=(E,y,R)=>{const k=y.slice(1);return E.merge({suggestions:List(R.filter(H=>H.get("name").toLowerCase().startsWith(k.toLowerCase())).slice(0,4).map(H=>"#"+H.name)),suggestion_token:y})},insertEmoji=(E,y,R,k)=>{const H=E.text,B=isNativeEmoji(R)?R.native:R.colons,te=k?" "+B:B;return E.merge({text:`${H.slice(0,y)}${te} ${H.slice(y)}`,focusDate:new Date,caretPosition:y+te.length+1,idempotencyKey:crypto.randomUUID()})},privacyPreference=(E,y)=>{const R=["public","unlisted","private","direct"];return E==="group"?E:R[Math.max(R.indexOf(E),R.indexOf(y),0)]},domParser$1=new DOMParser,expandMentions=E=>{const y=domParser$1.parseFromString(E.get("content"),"text/html").documentElement;return E.get("mentions").forEach(R=>{const k=y.querySelector(`a[href="proxy.php?url=https%3A%2F%2Ffe.soapbox.pub%2F%24%7BR.get%28"url")}"]`);k&&(k.textContent=`@${R.get("acct")}`)}),y.innerHTML},getExplicitMentions=(E,y)=>{const R=domParser$1.parseFromString(y.content,"text/html").documentElement,k=y.get("mentions").filter(H=>!(R.querySelector(`a[href="proxy.php?url=https%3A%2F%2Ffe.soapbox.pub%2F%24%7BH.url%7D"]`)||H.id===E)).map(H=>H.acct);return OrderedSet(k)},getAccountSettings=E=>E.getIn(["pleroma","settings_store",FE_NAME],Map$1()),importAccount=(E,y)=>{const R=getAccountSettings(Map$1(fromJS(y))),k=R.get("defaultPrivacy"),H=R.get("defaultContentType");return E.withMutations(B=>{k&&B.set("privacy",k),H&&B.set("content_type",H),B.set("tagHistory",List(tagHistory.get(y.id)))})},updateSetting=(E,y,R)=>{switch(y.join(",")){case"defaultPrivacy":return E.set("privacy",R);case"defaultContentType":return E.set("content_type",R);default:return E}},updateCompose=(E,y,R)=>E.update(y,E.get("default"),R),initialState$h=Map$1({default:ReducerCompose({idempotencyKey:crypto.randomUUID(),resetFileKey:getResetFileKey()})});function compose(E=initialState$h,y){switch(y.type){case COMPOSE_TYPE_CHANGE:return updateCompose(E,y.id,R=>R.withMutations(k=>{k.set("content_type",y.value),k.set("idempotencyKey",crypto.randomUUID())}));case COMPOSE_SPOILERNESS_CHANGE:return updateCompose(E,y.id,R=>R.withMutations(k=>{k.set("spoiler_text",""),k.set("spoiler",!R.spoiler),k.set("sensitive",!R.spoiler),k.set("idempotencyKey",crypto.randomUUID())}));case COMPOSE_SPOILER_TEXT_CHANGE:return updateCompose(E,y.id,R=>R.set("spoiler_text",y.text).set("idempotencyKey",crypto.randomUUID()));case COMPOSE_VISIBILITY_CHANGE:return updateCompose(E,y.id,R=>R.set("privacy",y.value).set("idempotencyKey",crypto.randomUUID()));case COMPOSE_CHANGE:return updateCompose(E,y.id,R=>R.set("text",y.text).set("idempotencyKey",crypto.randomUUID()));case COMPOSE_REPLY:return updateCompose(E,y.id,R=>R.withMutations(k=>{const H=E.get("default");k.set("group_id",y.status.getIn(["group","id"])),k.set("in_reply_to",y.status.get("id")),k.set("to",y.explicitAddressing?statusToMentionsArray(y.status,y.account):OrderedSet()),k.set("text",y.explicitAddressing?"":statusToTextMentions(y.status,y.account)),k.set("privacy",privacyPreference(y.status.visibility,H.privacy)),k.set("focusDate",new Date),k.set("caretPosition",null),k.set("idempotencyKey",crypto.randomUUID()),k.set("content_type",H.content_type),y.preserveSpoilers&&y.status.spoiler_text&&(k.set("spoiler",!0),k.set("sensitive",!0),k.set("spoiler_text",y.status.spoiler_text))}));case COMPOSE_EVENT_REPLY:return updateCompose(E,y.id,R=>R.withMutations(k=>{k.set("in_reply_to",y.status.get("id")),k.set("to",statusToMentionsArray(y.status,y.account)),k.set("idempotencyKey",crypto.randomUUID())}));case COMPOSE_QUOTE:return updateCompose(E,"compose-modal",R=>R.withMutations(k=>{var te,ae;const H=y.status.getIn(["account","acct"]),B=E.get("default");k.set("quote",y.status.get("id")),k.set("to",OrderedSet([H])),k.set("text",""),k.set("privacy",privacyPreference(y.status.visibility,B.privacy)),k.set("focusDate",new Date),k.set("caretPosition",null),k.set("idempotencyKey",crypto.randomUUID()),k.set("content_type",B.content_type),k.set("spoiler",!1),k.set("spoiler_text",""),y.status.visibility==="group"&&(((te=y.status.group)==null?void 0:te.group_visibility)==="everyone"?k.set("privacy",privacyPreference("public",B.privacy)):((ae=y.status.group)==null?void 0:ae.group_visibility)==="members_only"&&(k.set("group_id",y.status.getIn(["group","id"])),k.set("privacy","group")))}));case COMPOSE_SUBMIT_REQUEST:return updateCompose(E,y.id,R=>R.set("is_submitting",!0));case COMPOSE_UPLOAD_CHANGE_REQUEST:return updateCompose(E,y.id,R=>R.set("is_changing_upload",!0));case COMPOSE_REPLY_CANCEL:case COMPOSE_QUOTE_CANCEL:case COMPOSE_RESET:case COMPOSE_SUBMIT_SUCCESS:return updateCompose(E,y.id,()=>E.get("default").withMutations(R=>{R.set("idempotencyKey",crypto.randomUUID()),R.set("in_reply_to",y.id.startsWith("reply:")?y.id.slice(6):null),y.id.startsWith("group:")&&(R.set("privacy","group"),R.set("group_id",y.id.slice(6)))}));case COMPOSE_SUBMIT_FAIL:return updateCompose(E,y.id,R=>R.set("is_submitting",!1));case COMPOSE_UPLOAD_CHANGE_FAIL:return updateCompose(E,y.composeId,R=>R.set("is_changing_upload",!1));case COMPOSE_UPLOAD_REQUEST:return updateCompose(E,y.id,R=>R.set("is_uploading",!0));case COMPOSE_UPLOAD_SUCCESS:return updateCompose(E,y.id,R=>appendMedia(R,fromJS(y.media),E.get("default").sensitive));case COMPOSE_UPLOAD_FAIL:return updateCompose(E,y.id,R=>R.set("is_uploading",!1));case COMPOSE_UPLOAD_UNDO:return updateCompose(E,y.id,R=>removeMedia(R,y.media_id));case COMPOSE_UPLOAD_PROGRESS:return updateCompose(E,y.id,R=>R.set("progress",Math.round(y.loaded/y.total*100)));case COMPOSE_MENTION:return updateCompose(E,"compose-modal",R=>R.withMutations(k=>{k.update("text",H=>[H.trim(),`@${y.account.acct} `].filter(B=>B.length!==0).join(" ")),k.set("focusDate",new Date),k.set("caretPosition",null),k.set("idempotencyKey",crypto.randomUUID())}));case COMPOSE_DIRECT:return updateCompose(E,"compose-modal",R=>R.withMutations(k=>{k.update("text",H=>[H.trim(),`@${y.account.acct} `].filter(B=>B.length!==0).join(" ")),k.set("privacy","direct"),k.set("focusDate",new Date),k.set("caretPosition",null),k.set("idempotencyKey",crypto.randomUUID())}));case COMPOSE_GROUP_POST:return updateCompose(E,y.id,R=>R.withMutations(k=>{k.set("privacy","group"),k.set("group_id",y.group_id),k.set("focusDate",new Date),k.set("caretPosition",null),k.set("idempotencyKey",crypto.randomUUID())}));case COMPOSE_SUGGESTIONS_CLEAR:return updateCompose(E,y.id,R=>R.update("suggestions",k=>k==null?void 0:k.clear()).set("suggestion_token",null));case COMPOSE_SUGGESTIONS_READY:return updateCompose(E,y.id,R=>R.set("suggestions",List(y.accounts?y.accounts.map(k=>k.id):y.emojis)).set("suggestion_token",y.token));case COMPOSE_SUGGESTION_SELECT:return updateCompose(E,y.id,R=>insertSuggestion(R,y.position,y.token,y.completion,y.path));case COMPOSE_SUGGESTION_TAGS_UPDATE:return updateCompose(E,y.id,R=>updateSuggestionTags(R,y.token,y.tags));case COMPOSE_TAG_HISTORY_UPDATE:return updateCompose(E,y.id,R=>R.set("tagHistory",List(fromJS(y.tags))));case TIMELINE_DELETE:return updateCompose(E,"compose-modal",R=>y.id===R.in_reply_to?R.set("in_reply_to",null):y.id===R.quote?R.set("quote",null):R);case COMPOSE_EMOJI_INSERT:return updateCompose(E,y.id,R=>insertEmoji(R,y.position,y.emoji,y.needsSpace));case COMPOSE_UPLOAD_CHANGE_SUCCESS:return updateCompose(E,y.id,R=>R.set("is_changing_upload",!1).update("media_attachments",k=>k.map(H=>H.id===y.media.id?normalizeAttachment(y.media):H)));case COMPOSE_SET_STATUS:return updateCompose(E,"compose-modal",R=>R.withMutations(k=>{var H;y.withRedraft||k.set("id",y.status.id),k.set("text",y.rawText||htmlToPlaintext(expandMentions(y.status))),k.set("to",y.explicitAddressing?getExplicitMentions(y.status.account.id,y.status):OrderedSet()),k.set("in_reply_to",y.status.get("in_reply_to_id")),k.set("privacy",y.status.get("visibility")),k.set("focusDate",new Date),k.set("caretPosition",null),k.set("idempotencyKey",crypto.randomUUID()),k.set("content_type",y.contentType||"text/plain"),k.set("quote",y.status.getIn(["quote","id"])),k.set("group_id",y.status.getIn(["group","id"])),((H=y.v)==null?void 0:H.software)===PLEROMA&&y.withRedraft&&hasIntegerMediaIds(y.status.toJS())?k.set("media_attachments",List()):k.set("media_attachments",y.status.media_attachments),y.status.get("spoiler_text").length>0?(k.set("spoiler",!0),k.set("spoiler_text",y.status.get("spoiler_text"))):(k.set("spoiler",!1),k.set("spoiler_text","")),y.status.poll&&typeof y.status.poll=="object"&&k.set("poll",PollRecord({options:List(y.status.poll.options.map(({title:B})=>B)),multiple:y.status.poll.multiple,expires_in:24*3600}))}));case COMPOSE_POLL_ADD:return updateCompose(E,y.id,R=>R.set("poll",PollRecord()));case COMPOSE_POLL_REMOVE:return updateCompose(E,y.id,R=>R.set("poll",null));case COMPOSE_SCHEDULE_ADD:return updateCompose(E,y.id,R=>R.set("schedule",new Date(Date.now()+10*60*1e3)));case COMPOSE_SCHEDULE_SET:return updateCompose(E,y.id,R=>R.set("schedule",y.date));case COMPOSE_SCHEDULE_REMOVE:return updateCompose(E,y.id,R=>R.set("schedule",null));case COMPOSE_POLL_OPTION_ADD:return updateCompose(E,y.id,R=>R.updateIn(["poll","options"],k=>k.push(y.title)));case COMPOSE_POLL_OPTION_CHANGE:return updateCompose(E,y.id,R=>R.setIn(["poll","options",y.index],y.title));case COMPOSE_POLL_OPTION_REMOVE:return updateCompose(E,y.id,R=>R.updateIn(["poll","options"],k=>k.delete(y.index)));case COMPOSE_POLL_SETTINGS_CHANGE:return updateCompose(E,y.id,R=>R.update("poll",k=>k?k.withMutations(H=>{y.expiresIn&&H.set("expires_in",y.expiresIn),typeof y.isMultiple=="boolean"&&H.set("multiple",y.isMultiple)}):null));case COMPOSE_ADD_TO_MENTIONS:return updateCompose(E,y.id,R=>R.update("to",k=>k.add(y.account)));case COMPOSE_REMOVE_FROM_MENTIONS:return updateCompose(E,y.id,R=>R.update("to",k=>k.delete(y.account)));case COMPOSE_SET_GROUP_TIMELINE_VISIBLE:return updateCompose(E,y.id,R=>R.set("group_timeline_visible",y.groupTimelineVisible));case ME_FETCH_SUCCESS:case ME_PATCH_SUCCESS:return updateCompose(E,"default",R=>importAccount(R,y.me));case SETTING_CHANGE:return updateCompose(E,"default",R=>updateSetting(R,y.path,y.value));case COMPOSE_EDITOR_STATE_SET:return updateCompose(E,y.id,R=>R.set("editorState",y.editorState));case EVENT_COMPOSE_CANCEL:return updateCompose(E,"event-compose-modal",R=>R.set("text",""));case EVENT_FORM_SET:return updateCompose(E,"event-compose-modal",R=>R.set("text",y.text));case COMPOSE_CHANGE_MEDIA_ORDER:return updateCompose(E,y.id,R=>R.update("media_attachments",k=>{const H=k.findIndex(ae=>ae.get("id")===y.a),B=k.get(H),te=k.findIndex(ae=>ae.get("id")===y.b);return k.splice(H,1).splice(te,0,B)}));default:return E}}const ReducerRecord$l=Record({inReplyTos:Map$1(),replies:Map$1()}),importStatus$4=(E,y,R)=>{const{id:k,in_reply_to_id:H}=y;return H?E.withMutations(B=>{const ae=(B.replies.get(H)||OrderedSet()).add(k).sort();B.setIn(["replies",H],ae),B.setIn(["inReplyTos",k],H),R&&deletePendingStatus(B,y,R)}):E},importStatuses$3=(E,y)=>E.withMutations(R=>{y.forEach(k=>importStatus$4(R,k))}),insertTombstone=(E,y,R)=>{const k=`${R}-tombstone`;return E.withMutations(H=>{importStatus$4(H,{id:k,in_reply_to_id:y}),importStatus$4(H,{id:R,in_reply_to_id:k})})},getRootNode=(E,y,R=y)=>{const k=E.inReplyTos.get(y);return k?k===R?k:getRootNode(E,k,R):y},connectNodes=(E,y,R)=>{const k=getRootNode(E,y),H=getRootNode(E,R);return k!==H?insertTombstone(E,R,y):E},importBranch=(E,y,R)=>E.withMutations(k=>{y.forEach((H,B)=>{const te=R&&B===0?R:(y[B-1]||{}).id;H.in_reply_to_id?(importStatus$4(k,H),R&&connectNodes(k,H.id,R)):te&&insertTombstone(k,te,H.id)})}),normalizeContext=(E,y,R,k)=>E.withMutations(H=>{importBranch(H,R),importBranch(H,k,y),R.length>0&&!H.getIn(["inReplyTos",y])&&insertTombstone(H,R[R.length-1].id,y)}),deleteStatus$4=(E,y)=>E.withMutations(R=>{const k=R.inReplyTos.get(y);if(k){const te=(R.replies.get(k)||OrderedSet()).delete(y);R.setIn(["replies",k],te)}(R.replies.get(y)||OrderedSet()).forEach(B=>R.deleteIn(["inReplyTos",B])),R.deleteIn(["inReplyTos",y]),R.deleteIn(["replies",y])}),deleteStatuses=(E,y)=>E.withMutations(R=>{y.forEach(k=>deleteStatus$4(R,k))}),filterContexts=(E,y,R)=>{const k=R.filter(H=>H.account.id===y.id).map(H=>H.id).toList().toArray();return deleteStatuses(E,k)},importPendingStatus$1=(E,y,R)=>{const k=`末pending-${R}`,{in_reply_to_id:H}=y;return importStatus$4(E,{id:k,in_reply_to_id:H})},deletePendingStatus=(E,y,R)=>{const k=`末pending-${R}`,{in_reply_to_id:H}=y;return E.withMutations(B=>{if(B.deleteIn(["inReplyTos",k]),H){const ae=(B.replies.get(H)||OrderedSet()).delete(k).sort();B.setIn(["replies",H],ae)}})};function replies(E=ReducerRecord$l(),y){switch(y.type){case ACCOUNT_BLOCK_SUCCESS:case ACCOUNT_MUTE_SUCCESS:return filterContexts(E,y.relationship,y.statuses);case CONTEXT_FETCH_SUCCESS:return normalizeContext(E,y.id,y.ancestors,y.descendants);case TIMELINE_DELETE:return deleteStatuses(E,[y.id]);case STATUS_CREATE_REQUEST:return importPendingStatus$1(E,y.params,y.idempotencyKey);case STATUS_CREATE_SUCCESS:return deletePendingStatus(E,y.status,y.idempotencyKey);case STATUS_IMPORT:return importStatus$4(E,y.status,y.idempotencyKey);case STATUSES_IMPORT:return importStatuses$3(E,y.statuses);default:return E}}const ConversationRecord=Record({id:"",unread:!1,accounts:List(),last_status:null,last_status_created_at:null}),ReducerRecord$k=Record({items:List(),isLoading:!1,hasMore:!0,mounted:0}),conversationToMap=E=>ConversationRecord({id:E.id,unread:E.unread,accounts:List(E.accounts.map(y=>y.id)),last_status:E.last_status?E.last_status.id:null,last_status_created_at:E.last_status?E.last_status.created_at:null}),updateConversation=(E,y)=>E.update("items",R=>{const k=R.findIndex(B=>B.get("id")===y.id),H=conversationToMap(y);return k===-1?R.unshift(H):R.set(k,H)}),expandNormalizedConversations=(E,y,R,k)=>{let H=List(y.map(conversationToMap));return E.withMutations(B=>{H.isEmpty()||B.update("items",te=>(te=te.map(ae=>{const ce=H.findIndex(Oe=>Oe.get("id")===ae.get("id"));if(ce===-1)return ae;const Ce=H.get(ce);return H=H.delete(ce),Ce}),te=te.concat(H),te.sortBy(ae=>ae.get("last_status_created_at"),(ae,ce)=>ae===null||ce===null?-1:compareDate(ae,ce)))),!R&&!k&&B.set("hasMore",!1),B.set("isLoading",!1)})};function conversations(E=ReducerRecord$k(),y){switch(y.type){case CONVERSATIONS_FETCH_REQUEST:return E.set("isLoading",!0);case CONVERSATIONS_FETCH_FAIL:return E.set("isLoading",!1);case CONVERSATIONS_FETCH_SUCCESS:return expandNormalizedConversations(E,y.conversations,y.next,y.isLoadingRecent);case CONVERSATIONS_UPDATE:return updateConversation(E,y.conversation);case CONVERSATIONS_MOUNT:return E.update("mounted",R=>R+1);case CONVERSATIONS_UNMOUNT:return E.update("mounted",R=>R-1);case CONVERSATIONS_READ:return E.update("items",R=>R.map(k=>k.get("id")===y.id?k.set("unread",!1):k));default:return E}}const DOMAIN_BLOCK_REQUEST="DOMAIN_BLOCK_REQUEST",DOMAIN_BLOCK_SUCCESS="DOMAIN_BLOCK_SUCCESS",DOMAIN_BLOCK_FAIL="DOMAIN_BLOCK_FAIL",DOMAIN_UNBLOCK_REQUEST="DOMAIN_UNBLOCK_REQUEST",DOMAIN_UNBLOCK_SUCCESS="DOMAIN_UNBLOCK_SUCCESS",DOMAIN_UNBLOCK_FAIL="DOMAIN_UNBLOCK_FAIL",DOMAIN_BLOCKS_FETCH_REQUEST="DOMAIN_BLOCKS_FETCH_REQUEST",DOMAIN_BLOCKS_FETCH_SUCCESS="DOMAIN_BLOCKS_FETCH_SUCCESS",DOMAIN_BLOCKS_FETCH_FAIL="DOMAIN_BLOCKS_FETCH_FAIL",DOMAIN_BLOCKS_EXPAND_REQUEST="DOMAIN_BLOCKS_EXPAND_REQUEST",DOMAIN_BLOCKS_EXPAND_SUCCESS="DOMAIN_BLOCKS_EXPAND_SUCCESS",DOMAIN_BLOCKS_EXPAND_FAIL="DOMAIN_BLOCKS_EXPAND_FAIL",blockDomain=E=>(y,R)=>{isLoggedIn(R)&&(y(blockDomainRequest(E)),api(R).post("/api/v1/domain_blocks",{domain:E}).then(()=>{const k=selectAccountsByDomain(R(),E);k&&y(blockDomainSuccess(E,k))}).catch(k=>{y(blockDomainFail(E,k))}))},blockDomainRequest=E=>({type:DOMAIN_BLOCK_REQUEST,domain:E}),blockDomainSuccess=(E,y)=>({type:DOMAIN_BLOCK_SUCCESS,domain:E,accounts:y}),blockDomainFail=(E,y)=>({type:DOMAIN_BLOCK_FAIL,domain:E,error:y}),unblockDomain=E=>(y,R)=>{if(!isLoggedIn(R))return;y(unblockDomainRequest(E));const k=new FormData;k.append("domain",E),api(R).request("DELETE","/api/v1/domain_blocks",k).then(()=>{const H=selectAccountsByDomain(R(),E);H&&y(unblockDomainSuccess(E,H))}).catch(H=>{y(unblockDomainFail(E,H))})},unblockDomainRequest=E=>({type:DOMAIN_UNBLOCK_REQUEST,domain:E}),unblockDomainSuccess=(E,y)=>({type:DOMAIN_UNBLOCK_SUCCESS,domain:E,accounts:y}),unblockDomainFail=(E,y)=>({type:DOMAIN_UNBLOCK_FAIL,domain:E,error:y}),fetchDomainBlocks=()=>(E,y)=>{isLoggedIn(y)&&(E(fetchDomainBlocksRequest()),api(y).get("/api/v1/domain_blocks").then(async R=>{const k=R.next(),H=await R.json();E(fetchDomainBlocksSuccess(H,k))}).catch(R=>{E(fetchDomainBlocksFail(R))}))},fetchDomainBlocksRequest=()=>({type:DOMAIN_BLOCKS_FETCH_REQUEST}),fetchDomainBlocksSuccess=(E,y)=>({type:DOMAIN_BLOCKS_FETCH_SUCCESS,domains:E,next:y}),fetchDomainBlocksFail=E=>({type:DOMAIN_BLOCKS_FETCH_FAIL,error:E}),expandDomainBlocks=()=>(E,y)=>{if(!isLoggedIn(y))return;const R=y().domain_lists.blocks.next;R&&(E(expandDomainBlocksRequest()),api(y).get(R).then(async k=>{const H=k.next(),B=await k.json();E(expandDomainBlocksSuccess(B,H))}).catch(k=>{E(expandDomainBlocksFail(k))}))};function selectAccountsByDomain(E,y){var B;const R=(B=E.entities[Entities.ACCOUNTS])==null?void 0:B.store,k=R?Object.entries(R):void 0;return(k==null?void 0:k.filter(([te,ae])=>ae&&ae.acct.endsWith(`@${y}`)).map(([te,ae])=>ae.id))||[]}const expandDomainBlocksRequest=()=>({type:DOMAIN_BLOCKS_EXPAND_REQUEST}),expandDomainBlocksSuccess=(E,y)=>({type:DOMAIN_BLOCKS_EXPAND_SUCCESS,domains:E,next:y}),expandDomainBlocksFail=E=>({type:DOMAIN_BLOCKS_EXPAND_FAIL,error:E}),BlocksRecord=Record({items:OrderedSet(),next:null}),ReducerRecord$j=Record({blocks:BlocksRecord()});function domainLists(E=ReducerRecord$j(),y){switch(y.type){case DOMAIN_BLOCKS_FETCH_SUCCESS:return E.setIn(["blocks","items"],OrderedSet(y.domains)).setIn(["blocks","next"],y.next);case DOMAIN_BLOCKS_EXPAND_SUCCESS:return E.updateIn(["blocks","items"],R=>R.union(y.domains)).setIn(["blocks","next"],y.next);case DOMAIN_UNBLOCK_SUCCESS:return E.updateIn(["blocks","items"],R=>R.delete(y.domain));default:return E}}const DROPDOWN_MENU_OPEN="DROPDOWN_MENU_OPEN",DROPDOWN_MENU_CLOSE="DROPDOWN_MENU_CLOSE",openDropdownMenu=()=>({type:DROPDOWN_MENU_OPEN}),closeDropdownMenu=()=>({type:DROPDOWN_MENU_CLOSE}),ReducerRecord$i=Record({isOpen:!1});function dropdownMenu(E=ReducerRecord$i(),y){switch(y.type){case DROPDOWN_MENU_OPEN:return E.set("isOpen",!0);case DROPDOWN_MENU_CLOSE:return E.set("isOpen",!1);default:return E}}const importFilters=(E,y)=>List(y.map(R=>normalizeFilter(R)));function filters(E=List(),y){switch(y.type){case FILTERS_FETCH_SUCCESS:return importFilters(E,y.filters);default:return E}}const HASHTAG_FETCH_REQUEST="HASHTAG_FETCH_REQUEST",HASHTAG_FETCH_SUCCESS="HASHTAG_FETCH_SUCCESS",HASHTAG_FETCH_FAIL="HASHTAG_FETCH_FAIL",HASHTAG_FOLLOW_REQUEST="HASHTAG_FOLLOW_REQUEST",HASHTAG_FOLLOW_SUCCESS="HASHTAG_FOLLOW_SUCCESS",HASHTAG_FOLLOW_FAIL="HASHTAG_FOLLOW_FAIL",HASHTAG_UNFOLLOW_REQUEST="HASHTAG_UNFOLLOW_REQUEST",HASHTAG_UNFOLLOW_SUCCESS="HASHTAG_UNFOLLOW_SUCCESS",HASHTAG_UNFOLLOW_FAIL="HASHTAG_UNFOLLOW_FAIL",FOLLOWED_HASHTAGS_FETCH_REQUEST="FOLLOWED_HASHTAGS_FETCH_REQUEST",FOLLOWED_HASHTAGS_FETCH_SUCCESS="FOLLOWED_HASHTAGS_FETCH_SUCCESS",FOLLOWED_HASHTAGS_FETCH_FAIL="FOLLOWED_HASHTAGS_FETCH_FAIL",FOLLOWED_HASHTAGS_EXPAND_REQUEST="FOLLOWED_HASHTAGS_EXPAND_REQUEST",FOLLOWED_HASHTAGS_EXPAND_SUCCESS="FOLLOWED_HASHTAGS_EXPAND_SUCCESS",FOLLOWED_HASHTAGS_EXPAND_FAIL="FOLLOWED_HASHTAGS_EXPAND_FAIL",fetchHashtag=E=>(y,R)=>{y(fetchHashtagRequest()),api(R).get(`/api/v1/tags/${E}`).then(k=>k.json()).then(k=>{y(fetchHashtagSuccess(E,k))}).catch(k=>{y(fetchHashtagFail(k))})},fetchHashtagRequest=()=>({type:HASHTAG_FETCH_REQUEST}),fetchHashtagSuccess=(E,y)=>({type:HASHTAG_FETCH_SUCCESS,name:E,tag:y}),fetchHashtagFail=E=>({type:HASHTAG_FETCH_FAIL,error:E}),followHashtag=E=>(y,R)=>{y(followHashtagRequest(E)),api(R).post(`/api/v1/tags/${E}/follow`).then(k=>k.json()).then(k=>{y(followHashtagSuccess(E,k))}).catch(k=>{y(followHashtagFail(E,k))})},followHashtagRequest=E=>({type:HASHTAG_FOLLOW_REQUEST,name:E}),followHashtagSuccess=(E,y)=>({type:HASHTAG_FOLLOW_SUCCESS,name:E,tag:y}),followHashtagFail=(E,y)=>({type:HASHTAG_FOLLOW_FAIL,name:E,error:y}),unfollowHashtag=E=>(y,R)=>{y(unfollowHashtagRequest(E)),api(R).post(`/api/v1/tags/${E}/unfollow`).then(k=>k.json()).then(k=>{y(unfollowHashtagSuccess(E,k))}).catch(k=>{y(unfollowHashtagFail(E,k))})},unfollowHashtagRequest=E=>({type:HASHTAG_UNFOLLOW_REQUEST,name:E}),unfollowHashtagSuccess=(E,y)=>({type:HASHTAG_UNFOLLOW_SUCCESS,name:E,tag:y}),unfollowHashtagFail=(E,y)=>({type:HASHTAG_UNFOLLOW_FAIL,name:E,error:y}),fetchFollowedHashtags=()=>(E,y)=>{E(fetchFollowedHashtagsRequest()),api(y).get("/api/v1/followed_tags").then(async R=>{const k=R.next(),H=await R.json();E(fetchFollowedHashtagsSuccess(H,k))}).catch(R=>{E(fetchFollowedHashtagsFail(R))})},fetchFollowedHashtagsRequest=()=>({type:FOLLOWED_HASHTAGS_FETCH_REQUEST}),fetchFollowedHashtagsSuccess=(E,y)=>({type:FOLLOWED_HASHTAGS_FETCH_SUCCESS,followed_tags:E,next:y}),fetchFollowedHashtagsFail=E=>({type:FOLLOWED_HASHTAGS_FETCH_FAIL,error:E}),expandFollowedHashtags=()=>(E,y)=>{const R=y().followed_tags.next;R!==null&&(E(expandFollowedHashtagsRequest()),api(y).get(R).then(async k=>{const H=k.next(),B=await k.json();E(expandFollowedHashtagsSuccess(B,H))}).catch(k=>{E(expandFollowedHashtagsFail(k))}))},expandFollowedHashtagsRequest=()=>({type:FOLLOWED_HASHTAGS_EXPAND_REQUEST}),expandFollowedHashtagsSuccess=(E,y)=>({type:FOLLOWED_HASHTAGS_EXPAND_SUCCESS,followed_tags:E,next:y}),expandFollowedHashtagsFail=E=>({type:FOLLOWED_HASHTAGS_EXPAND_FAIL,error:E}),ReducerRecord$h=Record({items:List(),isLoading:!1,next:null});function followed_tags(E=ReducerRecord$h(),y){switch(y.type){case FOLLOWED_HASHTAGS_FETCH_REQUEST:return E.set("isLoading",!0);case FOLLOWED_HASHTAGS_FETCH_SUCCESS:return E.withMutations(R=>{R.set("items",List(y.followed_tags.map(k=>normalizeTag(k)))),R.set("isLoading",!1),R.set("next",y.next)});case FOLLOWED_HASHTAGS_FETCH_FAIL:return E.set("isLoading",!1);case FOLLOWED_HASHTAGS_EXPAND_REQUEST:return E.set("isLoading",!0);case FOLLOWED_HASHTAGS_EXPAND_SUCCESS:return E.withMutations(R=>{R.update("items",k=>k.concat(y.followed_tags.map(H=>normalizeTag(H)))),R.set("isLoading",!1),R.set("next",y.next)});case FOLLOWED_HASHTAGS_EXPAND_FAIL:return E.set("isLoading",!1);default:return E}}const ListRecord$1=Record({next:null,isLoading:!1,items:OrderedSet()}),ReducerRecord$g=Record({admin:Map$1({}),moderator:Map$1({}),user:Map$1({})}),normalizeList$2=(E,y,R,k)=>E.setIn(y,ListRecord$1({next:k,items:OrderedSet(R.map(H=>H.account.id)),isLoading:!1})),appendToList$2=(E,y,R,k)=>E.updateIn(y,H=>H.set("next",k).set("isLoading",!1).update("items",B=>B.concat(R.map(te=>te.account.id)))),updateLists=(E,y,R)=>{const k=(H,B,te)=>B===te.role?H.updateIn([B,y],ae=>ae.update("items",ce=>ce.add(te.account.id))):H.updateIn([B,y],ae=>ae.update("items",ce=>ce.delete(te.account.id)));return R.forEach(H=>{E=k(E,"admin",H),E=k(E,"moderator",H),E=k(E,"user",H)}),E},removeFromList$2=(E,y,R)=>E.updateIn(y,k=>k.update("items",H=>H.delete(R)));function groupMemberships(E=ReducerRecord$g(),y){switch(y.type){case GROUP_DELETE_SUCCESS:return E.deleteIn(["admin",y.id]).deleteIn(["moderator",y.id]).deleteIn(["user",y.id]);case GROUP_MEMBERSHIPS_FETCH_REQUEST:case GROUP_MEMBERSHIPS_EXPAND_REQUEST:return E.updateIn([y.role,y.id],R=>(R||ListRecord$1()).set("isLoading",!0));case GROUP_MEMBERSHIPS_FETCH_FAIL:case GROUP_MEMBERSHIPS_EXPAND_FAIL:return E.updateIn([y.role,y.id],R=>(R||ListRecord$1()).set("isLoading",!1));case GROUP_MEMBERSHIPS_FETCH_SUCCESS:return normalizeList$2(E,[y.role,y.id],y.memberships,y.next);case GROUP_MEMBERSHIPS_EXPAND_SUCCESS:return appendToList$2(E,[y.role,y.id],y.memberships,y.next);case GROUP_PROMOTE_SUCCESS:case GROUP_DEMOTE_SUCCESS:return updateLists(E,y.groupId,y.memberships);case GROUP_KICK_SUCCESS:case GROUP_BLOCK_SUCCESS:return E=removeFromList$2(E,["admin",y.groupId],y.accountId),E=removeFromList$2(E,["moderator",y.groupId],y.accountId),E=removeFromList$2(E,["user",y.groupId],y.accountId),E;default:return E}}const normalizeRelationships$1=(E,y)=>(y.forEach(R=>{E=E.set(R.id,normalizeGroupRelationship(R))}),E);function groupRelationships(E=Map$1(),y){switch(y.type){case GROUP_CREATE_SUCCESS:case GROUP_UPDATE_SUCCESS:return E.set(y.group.id,normalizeGroupRelationship({id:y.group.id,member:!0,requested:!1,role:"admin"}));case GROUP_DELETE_SUCCESS:return E.delete(y.id);case GROUP_RELATIONSHIPS_FETCH_SUCCESS:return normalizeRelationships$1(E,y.relationships);default:return E}}const ReducerRecord$f=Record({isLoading:!0,items:Map$1({})}),normalizeGroups=(E,y)=>E.update("items",R=>y.reduce((k,H)=>k.set(H.id,normalizeGroup(H)),R)).set("isLoading",!1);function groups(E=ReducerRecord$f(),y){switch(y.type){case GROUPS_IMPORT:return normalizeGroups(E,y.groups);case GROUP_FETCH_REQUEST:return E.set("isLoading",!0);case GROUP_DELETE_SUCCESS:case GROUP_FETCH_FAIL:return E.setIn(["items",y.id],!1).set("isLoading",!1);default:return E}}const HISTORY_FETCH_REQUEST="HISTORY_FETCH_REQUEST",HISTORY_FETCH_SUCCESS="HISTORY_FETCH_SUCCESS",HISTORY_FETCH_FAIL="HISTORY_FETCH_FAIL",fetchHistory=E=>(y,R)=>{R().history.getIn([E,"loading"])||(y(fetchHistoryRequest(E)),api(R).get(`/api/v1/statuses/${E}/history`).then(H=>H.json()).then(H=>{y(importFetchedAccounts(H.map(B=>B.account))),y(fetchHistorySuccess(E,H))}).catch(H=>y(fetchHistoryFail(H))))},fetchHistoryRequest=E=>({type:HISTORY_FETCH_REQUEST,statusId:E}),fetchHistorySuccess=(E,y)=>({type:HISTORY_FETCH_SUCCESS,statusId:E,history:y}),fetchHistoryFail=E=>({type:HISTORY_FETCH_FAIL,error:E}),HistoryRecord=Record({loading:!1,items:List()}),initialState$g=Map$1();function history(E=initialState$g,y){switch(y.type){case HISTORY_FETCH_REQUEST:return E.update(y.statusId,HistoryRecord(),R=>R.withMutations(k=>{k.set("loading",!0),k.set("items",List())}));case HISTORY_FETCH_SUCCESS:return E.update(y.statusId,HistoryRecord(),R=>R.withMutations(k=>{k.set("loading",!1),k.set("items",List(y.history.map((H,B)=>({...H,account:H.account.id,original:B===0})).reverse().map(normalizeStatusEdit)))}));case HISTORY_FETCH_FAIL:return E.update(y.statusId,HistoryRecord(),R=>R.set("loading",!1));default:return E}}const getHost=E=>{const y=getMeUrl$1(E)||getAuthUserUrl(E);try{return new URL(y).host}catch{return null}},fetchInstance=createAsyncThunk("instance/fetch",async(E,{dispatch:y,getState:R,rejectWithValue:k})=>{try{const B=await(await api(R).get("/api/v1/instance")).json(),te=instanceV1Schema.parse(B);return getFeatures(te).instanceV2&&y(fetchInstanceV2(E)),{instance:te,host:E}}catch(H){return k(H)}}),fetchInstanceV2=createAsyncThunk("instanceV2/fetch",async(E,{getState:y,rejectWithValue:R})=>{try{const H=await(await api(y).get("/api/v2/instance")).json();return{instance:instanceV2Schema.parse(H),host:E}}catch(k){return R(k)}}),initialState$f=instanceV2Schema.parse({}),getConfigValue=(E,y)=>{const R=E.find(k=>k.getIn(["tuple",0])===y);return R?R.getIn(["tuple",1]):void 0},importConfigs=(E,y)=>{const R=ConfigDB.find(y,":pleroma",":instance"),k=ConfigDB.toSimplePolicy(y);return!R&&!k?E:produce(E,H=>{if(R){const B=R.get("value",List()),te=getConfigValue(B,":registrations_open"),ae=getConfigValue(B,":account_approval_required");H.registrations={enabled:te??H.registrations.enabled,approval_required:ae??H.registrations.approval_required}}k&&(H.pleroma.metadata.federation.mrf_simple=k)})};function instance(E=initialState$f,y){switch(y.type){case fetchInstanceV2.fulfilled.type:return y.payload.instance;case ADMIN_CONFIG_UPDATE_REQUEST:case ADMIN_CONFIG_UPDATE_SUCCESS:return importConfigs(E,List(fromJS(y.configs)));default:return E}}const LIST_FETCH_REQUEST="LIST_FETCH_REQUEST",LIST_FETCH_SUCCESS="LIST_FETCH_SUCCESS",LIST_FETCH_FAIL="LIST_FETCH_FAIL",LISTS_FETCH_REQUEST="LISTS_FETCH_REQUEST",LISTS_FETCH_SUCCESS="LISTS_FETCH_SUCCESS",LISTS_FETCH_FAIL="LISTS_FETCH_FAIL",LIST_EDITOR_TITLE_CHANGE="LIST_EDITOR_TITLE_CHANGE",LIST_EDITOR_RESET="LIST_EDITOR_RESET",LIST_EDITOR_SETUP="LIST_EDITOR_SETUP",LIST_CREATE_REQUEST="LIST_CREATE_REQUEST",LIST_CREATE_SUCCESS="LIST_CREATE_SUCCESS",LIST_CREATE_FAIL="LIST_CREATE_FAIL",LIST_UPDATE_REQUEST="LIST_UPDATE_REQUEST",LIST_UPDATE_SUCCESS="LIST_UPDATE_SUCCESS",LIST_UPDATE_FAIL="LIST_UPDATE_FAIL",LIST_DELETE_REQUEST="LIST_DELETE_REQUEST",LIST_DELETE_SUCCESS="LIST_DELETE_SUCCESS",LIST_DELETE_FAIL="LIST_DELETE_FAIL",LIST_ACCOUNTS_FETCH_REQUEST="LIST_ACCOUNTS_FETCH_REQUEST",LIST_ACCOUNTS_FETCH_SUCCESS="LIST_ACCOUNTS_FETCH_SUCCESS",LIST_ACCOUNTS_FETCH_FAIL="LIST_ACCOUNTS_FETCH_FAIL",LIST_EDITOR_SUGGESTIONS_CHANGE="LIST_EDITOR_SUGGESTIONS_CHANGE",LIST_EDITOR_SUGGESTIONS_READY="LIST_EDITOR_SUGGESTIONS_READY",LIST_EDITOR_SUGGESTIONS_CLEAR="LIST_EDITOR_SUGGESTIONS_CLEAR",LIST_EDITOR_ADD_REQUEST="LIST_EDITOR_ADD_REQUEST",LIST_EDITOR_ADD_SUCCESS="LIST_EDITOR_ADD_SUCCESS",LIST_EDITOR_ADD_FAIL="LIST_EDITOR_ADD_FAIL",LIST_EDITOR_REMOVE_REQUEST="LIST_EDITOR_REMOVE_REQUEST",LIST_EDITOR_REMOVE_SUCCESS="LIST_EDITOR_REMOVE_SUCCESS",LIST_EDITOR_REMOVE_FAIL="LIST_EDITOR_REMOVE_FAIL",LIST_ADDER_RESET="LIST_ADDER_RESET",LIST_ADDER_SETUP="LIST_ADDER_SETUP",LIST_ADDER_LISTS_FETCH_REQUEST="LIST_ADDER_LISTS_FETCH_REQUEST",LIST_ADDER_LISTS_FETCH_SUCCESS="LIST_ADDER_LISTS_FETCH_SUCCESS",LIST_ADDER_LISTS_FETCH_FAIL="LIST_ADDER_LISTS_FETCH_FAIL",fetchList=E=>(y,R)=>{isLoggedIn(R)&&(R().lists.get(String(E))||(y(fetchListRequest(E)),api(R).get(`/api/v1/lists/${E}`).then(k=>k.json()).then(k=>y(fetchListSuccess(k))).catch(k=>y(fetchListFail(E,k)))))},fetchListRequest=E=>({type:LIST_FETCH_REQUEST,id:E}),fetchListSuccess=E=>({type:LIST_FETCH_SUCCESS,list:E}),fetchListFail=(E,y)=>({type:LIST_FETCH_FAIL,id:E,error:y}),fetchLists=()=>(E,y)=>{isLoggedIn(y)&&(E(fetchListsRequest()),api(y).get("/api/v1/lists").then(R=>R.json()).then(R=>E(fetchListsSuccess(R))).catch(R=>E(fetchListsFail(R))))},fetchListsRequest=()=>({type:LISTS_FETCH_REQUEST}),fetchListsSuccess=E=>({type:LISTS_FETCH_SUCCESS,lists:E}),fetchListsFail=E=>({type:LISTS_FETCH_FAIL,error:E}),submitListEditor=E=>(y,R)=>{const k=R().listEditor.listId,H=R().listEditor.title;y(k===null?createList(H,E):updateList(k,H,E))},setupListEditor=E=>(y,R)=>{y({type:LIST_EDITOR_SETUP,list:R().lists.get(String(E))}),y(fetchListAccounts(E))},changeListEditorTitle=E=>({type:LIST_EDITOR_TITLE_CHANGE,value:E}),createList=(E,y)=>(R,k)=>{isLoggedIn(k)&&(R(createListRequest()),api(k).post("/api/v1/lists",{title:E}).then(H=>H.json()).then(H=>{R(createListSuccess(H)),y&&R(resetListEditor())}).catch(H=>R(createListFail(H))))},createListRequest=()=>({type:LIST_CREATE_REQUEST}),createListSuccess=E=>({type:LIST_CREATE_SUCCESS,list:E}),createListFail=E=>({type:LIST_CREATE_FAIL,error:E}),updateList=(E,y,R)=>(k,H)=>{isLoggedIn(H)&&(k(updateListRequest(E)),api(H).put(`/api/v1/lists/${E}`,{title:y}).then(B=>B.json()).then(B=>{k(updateListSuccess(B)),R&&k(resetListEditor())}).catch(B=>k(updateListFail(E,B))))},updateListRequest=E=>({type:LIST_UPDATE_REQUEST,id:E}),updateListSuccess=E=>({type:LIST_UPDATE_SUCCESS,list:E}),updateListFail=(E,y)=>({type:LIST_UPDATE_FAIL,id:E,error:y}),resetListEditor=()=>({type:LIST_EDITOR_RESET}),deleteList=E=>(y,R)=>{isLoggedIn(R)&&(y(deleteListRequest(E)),api(R).delete(`/api/v1/lists/${E}`).then(()=>y(deleteListSuccess(E))).catch(k=>y(deleteListFail(E,k))))},deleteListRequest=E=>({type:LIST_DELETE_REQUEST,id:E}),deleteListSuccess=E=>({type:LIST_DELETE_SUCCESS,id:E}),deleteListFail=(E,y)=>({type:LIST_DELETE_FAIL,id:E,error:y}),fetchListAccounts=E=>(y,R)=>{isLoggedIn(R)&&(y(fetchListAccountsRequest(E)),api(R).get(`/api/v1/lists/${E}/accounts`,{searchParams:{limit:0}}).then(k=>k.json()).then(k=>{y(importFetchedAccounts(k)),y(fetchListAccountsSuccess(E,k,null))}).catch(k=>y(fetchListAccountsFail(E,k))))},fetchListAccountsRequest=E=>({type:LIST_ACCOUNTS_FETCH_REQUEST,id:E}),fetchListAccountsSuccess=(E,y,R)=>({type:LIST_ACCOUNTS_FETCH_SUCCESS,id:E,accounts:y,next:R}),fetchListAccountsFail=(E,y)=>({type:LIST_ACCOUNTS_FETCH_FAIL,id:E,error:y}),fetchListSuggestions=E=>(y,R)=>{if(!isLoggedIn(R))return;const k={q:E,resolve:!1,limit:4,following:!0};api(R).get("/api/v1/accounts/search",{searchParams:k}).then(H=>H.json()).then(H=>{y(importFetchedAccounts(H)),y(fetchListSuggestionsReady(E,H))}).catch(H=>toast.showAlertForError(H))},fetchListSuggestionsReady=(E,y)=>({type:LIST_EDITOR_SUGGESTIONS_READY,query:E,accounts:y}),clearListSuggestions=()=>({type:LIST_EDITOR_SUGGESTIONS_CLEAR}),changeListSuggestions=E=>({type:LIST_EDITOR_SUGGESTIONS_CHANGE,value:E}),addToListEditor=E=>(y,R)=>{y(addToList(R().listEditor.listId,E))},addToList=(E,y)=>(R,k)=>{isLoggedIn(k)&&(R(addToListRequest(E,y)),api(k).post(`/api/v1/lists/${E}/accounts`,{account_ids:[y]}).then(()=>R(addToListSuccess(E,y))).catch(H=>R(addToListFail(E,y,H))))},addToListRequest=(E,y)=>({type:LIST_EDITOR_ADD_REQUEST,listId:E,accountId:y}),addToListSuccess=(E,y)=>({type:LIST_EDITOR_ADD_SUCCESS,listId:E,accountId:y}),addToListFail=(E,y,R)=>({type:LIST_EDITOR_ADD_FAIL,listId:E,accountId:y,error:R}),removeFromListEditor=E=>(y,R)=>{y(removeFromList$1(R().listEditor.listId,E))},removeFromList$1=(E,y)=>(R,k)=>{if(!isLoggedIn(k))return;R(removeFromListRequest(E,y));const H=new FormData;H.append("account_ids[]",y),api(k).request("DELETE",`/api/v1/lists/${E}/accounts`,H).then(()=>R(removeFromListSuccess(E,y))).catch(B=>R(removeFromListFail(E,y,B)))},removeFromListRequest=(E,y)=>({type:LIST_EDITOR_REMOVE_REQUEST,listId:E,accountId:y}),removeFromListSuccess=(E,y)=>({type:LIST_EDITOR_REMOVE_SUCCESS,listId:E,accountId:y}),removeFromListFail=(E,y,R)=>({type:LIST_EDITOR_REMOVE_FAIL,listId:E,accountId:y,error:R}),resetListAdder=()=>({type:LIST_ADDER_RESET}),setupListAdder=E=>(y,R)=>{y({type:LIST_ADDER_SETUP,account:selectAccount(R(),E)}),y(fetchLists()),y(fetchAccountLists(E))},fetchAccountLists=E=>(y,R)=>{isLoggedIn(R)&&(y(fetchAccountListsRequest(E)),api(R).get(`/api/v1/accounts/${E}/lists`).then(k=>k.json()).then(k=>y(fetchAccountListsSuccess(E,k))).catch(k=>y(fetchAccountListsFail(E,k))))},fetchAccountListsRequest=E=>({type:LIST_ADDER_LISTS_FETCH_REQUEST,id:E}),fetchAccountListsSuccess=(E,y)=>({type:LIST_ADDER_LISTS_FETCH_SUCCESS,id:E,lists:y}),fetchAccountListsFail=(E,y)=>({type:LIST_ADDER_LISTS_FETCH_FAIL,id:E,err:y}),addToListAdder=E=>(y,R)=>{y(addToList(E,R().listAdder.accountId))},removeFromListAdder=E=>(y,R)=>{y(removeFromList$1(E,R().listAdder.accountId))},ListsRecord=Record({items:List(),loaded:!1,isLoading:!1}),ReducerRecord$e=Record({accountId:null,lists:ListsRecord()});function listAdderReducer(E=ReducerRecord$e(),y){switch(y.type){case LIST_ADDER_RESET:return ReducerRecord$e();case LIST_ADDER_SETUP:return E.withMutations(R=>{R.set("accountId",y.account.id)});case LIST_ADDER_LISTS_FETCH_REQUEST:return E.setIn(["lists","isLoading"],!0);case LIST_ADDER_LISTS_FETCH_FAIL:return E.setIn(["lists","isLoading"],!1);case LIST_ADDER_LISTS_FETCH_SUCCESS:return E.update("lists",R=>R.withMutations(k=>{k.set("isLoading",!1),k.set("loaded",!0),k.set("items",List(y.lists.map(H=>H.id)))}));case LIST_EDITOR_ADD_SUCCESS:return E.updateIn(["lists","items"],R=>R.unshift(y.listId));case LIST_EDITOR_REMOVE_SUCCESS:return E.updateIn(["lists","items"],R=>R.filterNot(k=>k===y.listId));default:return E}}const AccountsRecord=Record({items:List(),loaded:!1,isLoading:!1}),SuggestionsRecord=Record({value:"",items:List()}),ReducerRecord$d=Record({listId:null,isSubmitting:!1,isChanged:!1,title:"",accounts:AccountsRecord(),suggestions:SuggestionsRecord()});function listEditorReducer(E=ReducerRecord$d(),y){switch(y.type){case LIST_EDITOR_RESET:return ReducerRecord$d();case LIST_EDITOR_SETUP:return E.withMutations(R=>{R.set("listId",y.list.get("id")),R.set("title",y.list.get("title")),R.set("isSubmitting",!1)});case LIST_EDITOR_TITLE_CHANGE:return E.withMutations(R=>{R.set("title",y.value),R.set("isChanged",!0)});case LIST_CREATE_REQUEST:case LIST_UPDATE_REQUEST:return E.withMutations(R=>{R.set("isSubmitting",!0),R.set("isChanged",!1)});case LIST_CREATE_FAIL:case LIST_UPDATE_FAIL:return E.set("isSubmitting",!1);case LIST_CREATE_SUCCESS:case LIST_UPDATE_SUCCESS:return E.withMutations(R=>{R.set("isSubmitting",!1),R.set("listId",y.list.id)});case LIST_ACCOUNTS_FETCH_REQUEST:return E.setIn(["accounts","isLoading"],!0);case LIST_ACCOUNTS_FETCH_FAIL:return E.setIn(["accounts","isLoading"],!1);case LIST_ACCOUNTS_FETCH_SUCCESS:return E.update("accounts",R=>R.withMutations(k=>{k.set("isLoading",!1),k.set("loaded",!0),k.set("items",List(y.accounts.map(H=>H.id)))}));case LIST_EDITOR_SUGGESTIONS_CHANGE:return E.setIn(["suggestions","value"],y.value);case LIST_EDITOR_SUGGESTIONS_READY:return E.setIn(["suggestions","items"],List(y.accounts.map(R=>R.id)));case LIST_EDITOR_SUGGESTIONS_CLEAR:return E.update("suggestions",R=>R.withMutations(k=>{k.set("items",List()),k.set("value","")}));case LIST_EDITOR_ADD_SUCCESS:return E.updateIn(["accounts","items"],R=>R.unshift(y.accountId));case LIST_EDITOR_REMOVE_SUCCESS:return E.updateIn(["accounts","items"],R=>R.filterNot(k=>k===y.accountId));default:return E}}const initialState$e=Map$1(),importList=(E,y)=>E.set(y.id,normalizeList$3(y)),importLists=(E,y)=>(y.forEach(R=>{E=importList(E,R)}),E);function lists(E=initialState$e,y){switch(y.type){case LIST_FETCH_SUCCESS:case LIST_CREATE_SUCCESS:case LIST_UPDATE_SUCCESS:return importList(E,y.list);case LISTS_FETCH_SUCCESS:return importLists(E,y.lists);case LIST_DELETE_SUCCESS:case LIST_FETCH_FAIL:return E.set(y.id,!1);default:return E}}const initialState$d=Map$1(),normalizeLocations=(E,y)=>y.reduce((R,k)=>R.set(k.origin_id,normalizeLocation(k)),E);function accounts(E=initialState$d,y){switch(y.type){case LOCATION_SEARCH_SUCCESS:return normalizeLocations(E,y.locations);default:return E}}const initialState$c=null,handleForbidden=(E,y)=>y instanceof HTTPError&&[401,403].includes(y.response.status)?!1:E;function me(E=initialState$c,y){switch(y.type){case ME_FETCH_SUCCESS:case ME_PATCH_SUCCESS:return y.me.id;case VERIFY_CREDENTIALS_SUCCESS:case AUTH_ACCOUNT_REMEMBER_SUCCESS:return E||y.account.id;case ME_FETCH_SKIP:case AUTH_LOGGED_OUT:return!1;case ME_FETCH_FAIL:return handleForbidden(E,y.error);default:return E}}class NBunker{constructor(y){Jt(this,"controller",new AbortController);Jt(this,"authorizedPubkeys",new Set);Jt(this,"waitReady");Jt(this,"setReady");this.opts=y,this.waitReady=new Promise(R=>{this.setReady=R}),this.open()}async open(){const{relay:y,bunkerSigner:R,onError:k}=this.opts,H=this.controller.signal,B=await R.getPublicKey(),te=[{kinds:[24133],"#p":[B],limit:0}],ae=y.req(te,{signal:H});this.setReady();for await(const ce of ae)if(ce[0]==="EVENT"){const[,,Ce]=ce;try{await new Promise(Ne=>setTimeout(Ne,500));const Oe=await this.decrypt(Ce.pubkey,Ce.content),Le=NSchema.json().pipe(NSchema.connectRequest()).parse(Oe);await this.handleRequest(Le,Ce)}catch(Oe){k==null||k(Oe,Ce)}}}async handleRequest(y,R){var te;const{userSigner:k,onConnect:H}=this.opts,{pubkey:B}=R;if(y.method==="connect"){if(H){const ae=await H(y,R);return this.sendResponse(B,ae)}return}if(!this.authorizedPubkeys.has(B))return this.sendResponse(B,{id:y.id,result:"",error:"Unauthorized"});switch(y.method){case"sign_event":return this.sendResponse(B,{id:y.id,result:JSON.stringify(await k.signEvent(JSON.parse(y.params[0])))});case"ping":return this.sendResponse(B,{id:y.id,result:"pong"});case"get_relays":return this.sendResponse(B,{id:y.id,result:JSON.stringify(await((te=k.getRelays)==null?void 0:te.call(k))??[])});case"get_public_key":return this.sendResponse(B,{id:y.id,result:await k.getPublicKey()});case"nip04_encrypt":return this.sendResponse(B,{id:y.id,result:await k.nip04.encrypt(y.params[0],y.params[1])});case"nip04_decrypt":return this.sendResponse(B,{id:y.id,result:await k.nip04.decrypt(y.params[0],y.params[1])});case"nip44_encrypt":return this.sendResponse(B,{id:y.id,result:await k.nip44.encrypt(y.params[0],y.params[1])});case"nip44_decrypt":return this.sendResponse(B,{id:y.id,result:await k.nip44.decrypt(y.params[0],y.params[1])});default:return this.sendResponse(B,{id:y.id,result:"",error:`Unrecognized method: ${y.method}`})}}async sendResponse(y,R){const{bunkerSigner:k,relay:H}=this.opts,B=await k.nip44.encrypt(y,JSON.stringify(R)),te=await k.signEvent({kind:24133,content:B,tags:[["p",y]],created_at:Math.floor(Date.now()/1e3)});await H.event(te)}async decrypt(y,R){const{bunkerSigner:k}=this.opts;return await k.nip44.decrypt(y,R)}authorize(y){this.authorizedPubkeys.add(y)}revoke(y){this.authorizedPubkeys.delete(y)}close(){this.controller.abort()}[Symbol.dispose](){this.close()}}const NOSTR_PUBKEY_SET="NOSTR_PUBKEY_SET";function logInNostr(E,y){return async R=>{const k=generateBunkerAuth(),H=await E.getPublicKey(),B=await k.signer.getPublicKey();let te;const ae=new NBunker({relay:y,userSigner:E,bunkerSigner:k.signer,onConnect(Le,Ne){const[,Fe]=Le.params;return Fe===k.secret?(ae.authorize(Ne.pubkey),te=Ne.pubkey,{id:Le.id,result:"ack"}):{id:Le.id,result:"",error:"Invalid secret"}}});await ae.waitReady;const ce=await R(obtainOAuthToken({grant_type:"nostr_bunker",pubkey:B,relays:[y.socket.url],secret:k.secret}));if(!te)throw new Error("Authorization failed");const Ce=R(authLoggedIn(ce)).access_token,Oe=useBunkerStore.getState();keyring.add(k.seckey),Oe.connect({pubkey:H,accessToken:Ce,authorizedPubkey:te,bunkerPubkey:B}),await R(verifyCredentials(Ce)),ae.close()}}function nostrExtensionLogIn(E){return async y=>{if(!window.nostr)throw new Error("No Nostr signer available");return y(logInNostr(window.nostr,E))}}function generateBunkerAuth(){const E=crypto.randomUUID(),y=generateSecretKey();return{secret:E,seckey:y,signer:new NSecSigner(y)}}const SW_UPDATING="SW_UPDATING",ReducerRecord$c=Record({instance_fetch_failed:!1,swUpdating:!1,pubkey:void 0});function meta(E=ReducerRecord$c(),y){var R;switch(y.type){case fetchInstance.rejected.type:return((R=y.payload.response)==null?void 0:R.status)===404?E.set("instance_fetch_failed",!0):E;case SW_UPDATING:return E.set("swUpdating",y.isUpdating);case NOSTR_PUBKEY_SET:return E.set("pubkey",y.pubkey);default:return E}}const ModalRecord=Record({modalType:"",modalProps:null});function modal(E=List(),y){switch(y.type){case MODAL_OPEN:return E.push(ModalRecord({modalType:y.modalType,modalProps:y.modalProps}));case MODAL_CLOSE:return E.size===0?E:y.modalType===void 0?E.pop():E.some(({modalType:R})=>y.modalType===R)?E.slice(0,E.findLastIndex(({modalType:R})=>y.modalType===R)):E;default:return E}}const MUTES_INIT_MODAL="MUTES_INIT_MODAL",MUTES_TOGGLE_HIDE_NOTIFICATIONS="MUTES_TOGGLE_HIDE_NOTIFICATIONS",MUTES_CHANGE_DURATION="MUTES_CHANGE_DURATION",initMuteModal=E=>y=>{y({type:MUTES_INIT_MODAL,account:E}),y(openModal("MUTE"))},toggleHideNotifications=()=>E=>{E({type:MUTES_TOGGLE_HIDE_NOTIFICATIONS})},changeMuteDuration=E=>y=>{y({type:MUTES_CHANGE_DURATION,duration:E})},NewMuteRecord=Record({isSubmitting:!1,accountId:null,notifications:!0,duration:0}),ReducerRecord$b=Record({new:NewMuteRecord()});function mutes(E=ReducerRecord$b(),y){switch(y.type){case MUTES_INIT_MODAL:return E.withMutations(R=>{R.setIn(["new","isSubmitting"],!1),R.setIn(["new","accountId"],y.account.id),R.setIn(["new","notifications"],!0)});case MUTES_TOGGLE_HIDE_NOTIFICATIONS:return E.updateIn(["new","notifications"],R=>!R);case MUTES_CHANGE_DURATION:return E.setIn(["new","duration"],y.duration);default:return E}}const QueuedNotificationRecord=Record({notification:{},intlMessages:{},intlLocale:""}),ReducerRecord$a=Record({items:OrderedMap(),hasMore:!0,top:!1,unread:0,isLoading:!1,queuedNotifications:OrderedMap(),totalQueuedNotificationsCount:0,lastRead:-1}),parseId=E=>parseInt(E,10),comparator=(E,y)=>{const R=k=>parseId(k.id);return R(E)R(y)?-1:0},minifyNotification=E=>E.mergeWith((y,R)=>R||y,{account:E.getIn(["account","id"]),target:E.getIn(["target","id"]),status:E.getIn(["status","id"])}),fixNotification=E=>minifyNotification(normalizeNotification(E)),isValid=E=>{try{return!(!validType(E.type)||!E.account.get("id")||["mention","reblog","favourite","poll","status"].includes(E.type)&&!E.getIn(["status","id"]))}catch{return!1}},countFuture=(E,y)=>E.reduce((R,k)=>parseId(k.get("id"))>parseId(y)?R+1:R,0),importNotification=(E,y)=>{const R=E.top;return R||(E=E.update("unread",k=>k+1)),E.update("items",k=>(R&&k.size>40&&(k=k.take(20)),k.set(y.id,fixNotification(y)).sort(comparator)))},processRawNotifications=E=>OrderedMap(E.map(normalizeNotification).filter(isValid).map(y=>[y.id,fixNotification(y)])),expandNormalizedNotifications=(E,y,R)=>{const k=processRawNotifications(y);return E.withMutations(H=>{H.update("items",B=>B.merge(k).sort(comparator)),R||H.set("hasMore",!1),H.set("isLoading",!1)})},filterNotifications=(E,y)=>E.update("items",R=>R.filterNot(k=>k!==null&&k.account===y.id)),filterNotificationIds=(E,y,R)=>{const k=H=>H.filterNot(B=>B!==null&&y.includes(B.account)&&R===B.type);return E.update("items",k)},updateTop$1=(E,y)=>(y&&(E=E.set("unread",0)),E.set("top",y)),deleteByStatus=(E,y)=>E.update("items",R=>R.filterNot(k=>k!==null&&k.status===y)),updateNotificationsQueue=(E,y,R,k)=>{const H=E.queuedNotifications,B=E.items,te=E.totalQueuedNotificationsCount;if(H.has(y.id)||B.has(y.id))return E;const ce=H;return E.withMutations(Ce=>{te<=MAX_QUEUED_NOTIFICATIONS&&Ce.set("queuedNotifications",ce.set(y.id,QueuedNotificationRecord({notification:y,intlMessages:R,intlLocale:k}))),Ce.set("totalQueuedNotificationsCount",te+1)})},importMarker=(E,y)=>{const R=y.getIn(["notifications","last_read_id"],-1);return R?E.withMutations(k=>{const H=k.items,B=countFuture(H,R);k.set("unread",B),k.set("lastRead",R)}):E};function notifications(E=ReducerRecord$a(),y){switch(y.type){case NOTIFICATIONS_EXPAND_REQUEST:return E.set("isLoading",!0);case NOTIFICATIONS_EXPAND_FAIL:return E.set("isLoading",!1);case NOTIFICATIONS_FILTER_SET:return E.set("items",OrderedMap()).set("hasMore",!0);case NOTIFICATIONS_SCROLL_TOP:return updateTop$1(E,y.top);case NOTIFICATIONS_UPDATE:return importNotification(E,y.notification);case NOTIFICATIONS_UPDATE_QUEUE:return updateNotificationsQueue(E,y.notification,y.intlMessages,y.intlLocale);case NOTIFICATIONS_DEQUEUE:return E.withMutations(R=>{R.delete("queuedNotifications"),R.set("totalQueuedNotificationsCount",0)});case NOTIFICATIONS_EXPAND_SUCCESS:return expandNormalizedNotifications(E,y.notifications,y.next);case ACCOUNT_BLOCK_SUCCESS:return filterNotifications(E,y.relationship);case ACCOUNT_MUTE_SUCCESS:return y.relationship.muting_notifications?filterNotifications(E,y.relationship):E;case FOLLOW_REQUEST_AUTHORIZE_SUCCESS:case FOLLOW_REQUEST_REJECT_SUCCESS:return filterNotificationIds(E,[y.id],"follow_request");case NOTIFICATIONS_CLEAR:return E.set("items",OrderedMap()).set("hasMore",!1);case NOTIFICATIONS_MARK_READ_REQUEST:return E.set("lastRead",y.lastRead);case MARKER_FETCH_SUCCESS:case MARKER_SAVE_REQUEST:case MARKER_SAVE_SUCCESS:return importMarker(E,Map$1(fromJS(y.marker)));case TIMELINE_DELETE:return deleteByStatus(E,y.id);default:return E}}const initialState$b={home:!1,public:!1,instance:!1},notificationsTab=createSlice({name:"notificationsSlice",initialState:initialState$b,reducers:{setNotification:(E,y)=>{y.payload.timelineId in E&&(E[y.payload.timelineId]=y.payload.value)},resetNotifications:E=>{E.home=!1,E.public=!1,E.instance=!1}}}),{setNotification,resetNotifications}=notificationsTab.actions,notificationsTab$1=notificationsTab.reducer,initialState$a={needsOnboarding:!1};function onboarding(E=initialState$a,y){switch(y.type){case ONBOARDING_START:return{...E,needsOnboarding:!0};case ONBOARDING_END:return{...E,needsOnboarding:!1};default:return E}}const PATRON_INSTANCE_FETCH_REQUEST="PATRON_INSTANCE_FETCH_REQUEST",PATRON_INSTANCE_FETCH_SUCCESS="PATRON_INSTANCE_FETCH_SUCCESS",PATRON_INSTANCE_FETCH_FAIL="PATRON_INSTANCE_FETCH_FAIL",PATRON_ACCOUNT_FETCH_REQUEST="PATRON_ACCOUNT_FETCH_REQUEST",PATRON_ACCOUNT_FETCH_SUCCESS="PATRON_ACCOUNT_FETCH_SUCCESS",PATRON_ACCOUNT_FETCH_FAIL="PATRON_ACCOUNT_FETCH_FAIL",fetchPatronInstance=()=>(E,y)=>(E({type:PATRON_INSTANCE_FETCH_REQUEST}),api(y).get("/api/patron/v1/instance").then(R=>R.json()).then(R=>{E(importFetchedInstance(R))}).catch(R=>{E(fetchInstanceFail(R))})),fetchPatronAccount=E=>(y,R)=>{E=encodeURIComponent(E),y({type:PATRON_ACCOUNT_FETCH_REQUEST}),api(R).get(`/api/patron/v1/accounts/${E}`).then(k=>k.json()).then(k=>{y(importFetchedAccount(k))}).catch(k=>{y(fetchAccountFail(k))})},importFetchedInstance=E=>({type:PATRON_INSTANCE_FETCH_SUCCESS,instance:E}),fetchInstanceFail=E=>({type:PATRON_INSTANCE_FETCH_FAIL,error:E,skipAlert:!0}),importFetchedAccount=E=>({type:PATRON_ACCOUNT_FETCH_SUCCESS,account:E}),fetchAccountFail=E=>({type:PATRON_ACCOUNT_FETCH_FAIL,error:E,skipAlert:!0}),PatronAccountRecord=Record({is_patron:!1,url:""}),PatronInstanceRecord=Record({funding:Map$1(),goals:List(),url:""}),ReducerRecord$9=Record({instance:PatronInstanceRecord(),accounts:Map$1()}),normalizePatronAccount=(E,y)=>{const R=PatronAccountRecord(y);return E.setIn(["accounts",R.url],R)};function patron(E=ReducerRecord$9(),y){switch(y.type){case PATRON_INSTANCE_FETCH_SUCCESS:return E.set("instance",PatronInstanceRecord(Map$1(fromJS(y.instance))));case PATRON_ACCOUNT_FETCH_SUCCESS:return normalizePatronAccount(E,y.account);default:return E}}const PendingStatusRecord=Record({content_type:"",in_reply_to_id:null,media_ids:null,quote_id:null,poll:null,sensitive:!1,spoiler_text:"",status:"",to:null,visibility:"public"}),initialState$9=Map$1(),importStatus$3=(E,y,R)=>E.set(R,PendingStatusRecord(y)),deleteStatus$3=(E,y)=>E.delete(y);function pending_statuses(E=initialState$9,y){switch(y.type){case STATUS_CREATE_REQUEST:return y.editing?E:importStatus$3(E,Map$1(fromJS(y.params)),y.idempotencyKey);case STATUS_CREATE_SUCCESS:return deleteStatus$3(E,y.idempotencyKey);default:return E}}const normalizePoll=E=>normalizeStatus({poll:E}).poll,importPolls=(E,y)=>E.withMutations(R=>y.forEach(k=>{const H=normalizePoll(k);H&&typeof H=="object"&&R.set(H.id,H)})),initialState$8=Map$1();function polls(E=initialState$8,y){switch(y.type){case POLLS_IMPORT:return importPolls(E,y.polls);default:return E}}const PROFILE_HOVER_CARD_OPEN="PROFILE_HOVER_CARD_OPEN",PROFILE_HOVER_CARD_UPDATE="PROFILE_HOVER_CARD_UPDATE",PROFILE_HOVER_CARD_CLOSE="PROFILE_HOVER_CARD_CLOSE",openProfileHoverCard=(E,y)=>({type:PROFILE_HOVER_CARD_OPEN,ref:E,accountId:y}),updateProfileHoverCard=()=>({type:PROFILE_HOVER_CARD_UPDATE}),closeProfileHoverCard=(E=!1)=>({type:PROFILE_HOVER_CARD_CLOSE,force:E}),ReducerRecord$8=Record({ref:null,accountId:"",hovered:!1});function profileHoverCard(E=ReducerRecord$8(),y){switch(y.type){case PROFILE_HOVER_CARD_OPEN:return E.withMutations(R=>{R.set("ref",y.ref),R.set("accountId",y.accountId)});case PROFILE_HOVER_CARD_UPDATE:return E.set("hovered",!0);case PROFILE_HOVER_CARD_CLOSE:return E.get("hovered")===!0&&!y.force?E:ReducerRecord$8();default:return E}}function isDeepKey(E){switch(typeof E){case"number":case"symbol":return!1;case"string":return E.includes(".")||E.includes("[")||E.includes("]")}}function toKey(E){return Object.is(E,-0)?"-0":E.toString()}function toPath(E){const y=[],R=E.length;if(R===0)return y;let k=0,H="",B="",te=!1;for(E.charCodeAt(0)===46&&(y.push(""),k++);k(R,k)=>(R(submitAccountNoteRequest()),api(k).post(`/api/v1/accounts/${E}/note`,{comment:y}).then(H=>H.json()).then(H=>{R(submitAccountNoteSuccess(H))}).catch(H=>R(submitAccountNoteFail(H)))),submitAccountNoteRequest=()=>({type:ACCOUNT_NOTE_SUBMIT_REQUEST}),submitAccountNoteSuccess=E=>({type:ACCOUNT_NOTE_SUBMIT_SUCCESS,relationship:E}),submitAccountNoteFail=E=>({type:ACCOUNT_NOTE_SUBMIT_FAIL,error:E}),normalizeRelationships=(E,y)=>(y.forEach(R=>{try{E=E.set(R.id,relationshipSchema.parse(R))}catch{}}),E),setDomainBlocking=(E,y,R)=>E.withMutations(k=>{y.forEach(H=>{k.setIn([H,"domain_blocking"],R)})}),importPleromaAccount=(E,y)=>{const R=get(y,["pleroma","relationship"],{});return R.id?normalizeRelationships(E,[R]):E},importPleromaAccounts=(E,y)=>(y.forEach(R=>{E=importPleromaAccount(E,R)}),E);function relationships(E=Map$1(),y){switch(y.type){case ACCOUNT_IMPORT:return importPleromaAccount(E,y.account);case ACCOUNTS_IMPORT:return importPleromaAccounts(E,y.accounts);case ACCOUNT_BLOCK_SUCCESS:case ACCOUNT_UNBLOCK_SUCCESS:case ACCOUNT_MUTE_SUCCESS:case ACCOUNT_UNMUTE_SUCCESS:case ACCOUNT_SUBSCRIBE_SUCCESS:case ACCOUNT_UNSUBSCRIBE_SUCCESS:case ACCOUNT_PIN_SUCCESS:case ACCOUNT_UNPIN_SUCCESS:case ACCOUNT_NOTE_SUBMIT_SUCCESS:case ACCOUNT_REMOVE_FROM_FOLLOWERS_SUCCESS:return normalizeRelationships(E,[y.relationship]);case RELATIONSHIPS_FETCH_SUCCESS:return normalizeRelationships(E,y.relationships);case DOMAIN_BLOCK_SUCCESS:return setDomainBlocking(E,y.accounts,!0);case DOMAIN_UNBLOCK_SUCCESS:return setDomainBlocking(E,y.accounts,!1);default:return E}}const REPORT_INIT="REPORT_INIT",REPORT_CANCEL="REPORT_CANCEL",REPORT_SUBMIT_REQUEST="REPORT_SUBMIT_REQUEST",REPORT_SUBMIT_SUCCESS="REPORT_SUBMIT_SUCCESS",REPORT_SUBMIT_FAIL="REPORT_SUBMIT_FAIL",REPORT_STATUS_TOGGLE="REPORT_STATUS_TOGGLE",REPORT_COMMENT_CHANGE="REPORT_COMMENT_CHANGE",REPORT_FORWARD_CHANGE="REPORT_FORWARD_CHANGE",REPORT_BLOCK_CHANGE="REPORT_BLOCK_CHANGE",REPORT_RULE_CHANGE="REPORT_RULE_CHANGE";var ReportableEntities=(E=>(E.ACCOUNT="ACCOUNT",E.CHAT_MESSAGE="CHAT_MESSAGE",E.GROUP="GROUP",E.STATUS="STATUS",E))(ReportableEntities||{});const initReport=(E,y,R)=>k=>{const{status:H,chatMessage:B,group:te}=R||{};return k({type:REPORT_INIT,entityType:E,account:y,status:H,chatMessage:B,group:te}),k(openModal("REPORT"))},cancelReport=()=>({type:REPORT_CANCEL}),toggleStatusReport=(E,y)=>({type:REPORT_STATUS_TOGGLE,statusId:E,checked:y}),submitReport=()=>(E,y)=>{E(submitReportRequest());const{reports:R}=y();return api(y).post("/api/v1/reports",{account_id:R.getIn(["new","account_id"]),status_ids:R.getIn(["new","status_ids"]),message_ids:[R.getIn(["new","chat_message","id"])].filter(Boolean),group_id:R.getIn(["new","group","id"]),rule_ids:R.getIn(["new","rule_ids"]),comment:R.getIn(["new","comment"]),forward:R.getIn(["new","forward"])})},submitReportRequest=()=>({type:REPORT_SUBMIT_REQUEST}),submitReportSuccess=()=>({type:REPORT_SUBMIT_SUCCESS}),submitReportFail=E=>({type:REPORT_SUBMIT_FAIL,error:E}),changeReportComment=E=>({type:REPORT_COMMENT_CHANGE,comment:E}),changeReportForward=E=>({type:REPORT_FORWARD_CHANGE,forward:E}),changeReportBlock=E=>({type:REPORT_BLOCK_CHANGE,block:E}),changeReportRule=E=>({type:REPORT_RULE_CHANGE,rule_id:E}),NewReportRecord=Record({isSubmitting:!1,entityType:"",account_id:null,status_ids:Set$1(),chat_message:null,group:null,comment:"",forward:!1,block:!1,rule_ids:Set$1()}),ReducerRecord$7=Record({new:NewReportRecord()});function reports(E=ReducerRecord$7(),y){switch(y.type){case REPORT_INIT:return E.withMutations(R=>{var k;R.setIn(["new","isSubmitting"],!1),R.setIn(["new","account_id"],y.account.id),R.setIn(["new","entityType"],y.entityType),y.chatMessage&&R.setIn(["new","chat_message"],y.chatMessage),y.group&&R.setIn(["new","group"],y.group),E.new.account_id!==y.account.id?(R.setIn(["new","status_ids"],y.status?Set$1([((k=y.status.reblog)==null?void 0:k.id)||y.status.id]):Set$1()),R.setIn(["new","comment"],"")):y.status&&R.updateIn(["new","status_ids"],H=>{var B;return H.add(((B=y.status.reblog)==null?void 0:B.id)||y.status.id)})});case REPORT_STATUS_TOGGLE:return E.updateIn(["new","status_ids"],R=>y.checked?R.add(y.statusId):R.remove(y.statusId));case REPORT_COMMENT_CHANGE:return E.setIn(["new","comment"],y.comment);case REPORT_FORWARD_CHANGE:return E.setIn(["new","forward"],y.forward);case REPORT_BLOCK_CHANGE:return E.setIn(["new","block"],y.block);case REPORT_RULE_CHANGE:return E.updateIn(["new","rule_ids"],R=>R.includes(y.rule_id)?R.remove(y.rule_id):R.add(y.rule_id));case REPORT_SUBMIT_REQUEST:return E.setIn(["new","isSubmitting"],!0);case REPORT_SUBMIT_FAIL:return E.setIn(["new","isSubmitting"],!1);case REPORT_CANCEL:case REPORT_SUBMIT_SUCCESS:return E.withMutations(R=>{R.setIn(["new","account_id"],null),R.setIn(["new","status_ids"],Set$1()),R.setIn(["new","chat_message"],null),R.setIn(["new","comment"],""),R.setIn(["new","isSubmitting"],!1),R.setIn(["new","rule_ids"],Set$1()),R.setIn(["new","block"],!1)});default:return E}}const SCHEDULED_STATUSES_FETCH_REQUEST="SCHEDULED_STATUSES_FETCH_REQUEST",SCHEDULED_STATUSES_FETCH_SUCCESS="SCHEDULED_STATUSES_FETCH_SUCCESS",SCHEDULED_STATUSES_FETCH_FAIL="SCHEDULED_STATUSES_FETCH_FAIL",SCHEDULED_STATUSES_EXPAND_REQUEST="SCHEDULED_STATUSES_EXPAND_REQUEST",SCHEDULED_STATUSES_EXPAND_SUCCESS="SCHEDULED_STATUSES_EXPAND_SUCCESS",SCHEDULED_STATUSES_EXPAND_FAIL="SCHEDULED_STATUSES_EXPAND_FAIL",SCHEDULED_STATUS_CANCEL_REQUEST="SCHEDULED_STATUS_CANCEL_REQUEST",SCHEDULED_STATUS_CANCEL_SUCCESS="SCHEDULED_STATUS_CANCEL_SUCCESS",SCHEDULED_STATUS_CANCEL_FAIL="SCHEDULED_STATUS_CANCEL_FAIL",fetchScheduledStatuses=()=>(E,y)=>{var B;const R=y();if((B=R.status_lists.get("scheduled_statuses"))!=null&&B.isLoading)return;const k=R.instance;getFeatures(k).scheduledStatuses&&(E(fetchScheduledStatusesRequest()),api(y).get("/api/v1/scheduled_statuses").then(async te=>{const ae=te.next(),ce=await te.json();E(fetchScheduledStatusesSuccess(ce,ae))}).catch(te=>{E(fetchScheduledStatusesFail(te))}))},cancelScheduledStatus=E=>(y,R)=>{y({type:SCHEDULED_STATUS_CANCEL_REQUEST,id:E}),api(R).delete(`/api/v1/scheduled_statuses/${E}`).then(k=>k.json()).then(k=>{y({type:SCHEDULED_STATUS_CANCEL_SUCCESS,id:E,data:k})}).catch(k=>{y({type:SCHEDULED_STATUS_CANCEL_FAIL,id:E,error:k})})},fetchScheduledStatusesRequest=()=>({type:SCHEDULED_STATUSES_FETCH_REQUEST}),fetchScheduledStatusesSuccess=(E,y)=>({type:SCHEDULED_STATUSES_FETCH_SUCCESS,statuses:E,next:y}),fetchScheduledStatusesFail=E=>({type:SCHEDULED_STATUSES_FETCH_FAIL,error:E}),expandScheduledStatuses=()=>(E,y)=>{var k,H;const R=((k=y().status_lists.get("scheduled_statuses"))==null?void 0:k.next)||null;R===null||(H=y().status_lists.get("scheduled_statuses"))!=null&&H.isLoading||(E(expandScheduledStatusesRequest()),api(y).get(R).then(async B=>{const te=B.next(),ae=await B.json();E(expandScheduledStatusesSuccess(ae,te))}).catch(B=>{E(expandScheduledStatusesFail(B))}))},expandScheduledStatusesRequest=()=>({type:SCHEDULED_STATUSES_EXPAND_REQUEST}),expandScheduledStatusesSuccess=(E,y)=>({type:SCHEDULED_STATUSES_EXPAND_SUCCESS,statuses:E,next:y}),expandScheduledStatusesFail=E=>({type:SCHEDULED_STATUSES_EXPAND_FAIL,error:E}),ScheduledStatusRecord=Record({id:"",scheduled_at:new Date,media_attachments:null,text:"",in_reply_to_id:null,media_ids:null,sensitive:!1,spoiler_text:"",visibility:"public",poll:null}),initialState$7=Map$1(),importStatus$2=(E,{params:y,...R})=>R.scheduled_at?E.set(R.id,ScheduledStatusRecord(Map$1(fromJS({...R,...y})))):E,importStatuses$2=(E,y)=>E.withMutations(R=>y.forEach(k=>importStatus$2(R,k))),deleteStatus$2=(E,y)=>E.delete(y);function scheduled_statuses(E=initialState$7,y){switch(y.type){case STATUS_IMPORT:case STATUS_CREATE_SUCCESS:return importStatus$2(E,y.status);case STATUSES_IMPORT:case SCHEDULED_STATUSES_FETCH_SUCCESS:return importStatuses$2(E,y.statuses);case SCHEDULED_STATUS_CANCEL_REQUEST:case SCHEDULED_STATUS_CANCEL_SUCCESS:return deleteStatus$2(E,y.id);default:return E}}const SEARCH_CHANGE="SEARCH_CHANGE",SEARCH_CLEAR="SEARCH_CLEAR",SEARCH_SHOW="SEARCH_SHOW",SEARCH_RESULTS_CLEAR="SEARCH_RESULTS_CLEAR",SEARCH_FETCH_REQUEST="SEARCH_FETCH_REQUEST",SEARCH_FETCH_SUCCESS="SEARCH_FETCH_SUCCESS",SEARCH_FETCH_FAIL="SEARCH_FETCH_FAIL",SEARCH_FILTER_SET="SEARCH_FILTER_SET",SEARCH_EXPAND_REQUEST="SEARCH_EXPAND_REQUEST",SEARCH_EXPAND_SUCCESS="SEARCH_EXPAND_SUCCESS",SEARCH_EXPAND_FAIL="SEARCH_EXPAND_FAIL",SEARCH_ACCOUNT_SET="SEARCH_ACCOUNT_SET",changeSearch=E=>y=>E.length===0?(y(clearSearchResults()),y({type:SEARCH_CHANGE,value:E})):y({type:SEARCH_CHANGE,value:E}),clearSearch=()=>({type:SEARCH_CLEAR}),clearSearchResults=()=>({type:SEARCH_RESULTS_CLEAR}),submitSearch=(E,y,R)=>(k,H)=>{const B=y??H().search.value,te=E||H().search.filter||"statuses",ae=H().search.accountId;if(B.length===0)return;k(fetchSearchRequest(B));const ce={q:B,resolve:!0,limit:20,type:te};ae&&(ce.account_id=ae),R&&(ce.short_videos_only=!0),api(H).get("/api/v2/search",{searchParams:ce}).then(async Ce=>{const Oe=Ce.next(),Le=await Ce.json();Le.accounts&&k(importFetchedAccounts(Le.accounts)),Le.statuses&&k(importFetchedStatuses(Le.statuses)),k(fetchSearchSuccess(Le,B,te,Oe)),k(fetchRelationships(Le.accounts.map(Ne=>Ne.id)))}).catch(Ce=>{k(fetchSearchFail(Ce))})},fetchSearchRequest=E=>({type:SEARCH_FETCH_REQUEST,value:E}),fetchSearchSuccess=(E,y,R,k)=>({type:SEARCH_FETCH_SUCCESS,results:E,searchTerm:y,searchType:R,next:k}),fetchSearchFail=E=>({type:SEARCH_FETCH_FAIL,error:E}),setFilter=E=>y=>{y(submitSearch(E)),y({type:SEARCH_FILTER_SET,path:["search","filter"],value:E})},expandSearch=E=>(y,R)=>{const k=R().search.value,H=R().search.results[E].size,B=R().search.accountId;y(expandSearchRequest(E));let te=R().search.next,ae={};te||(te="/api/v2/search",ae={q:k,type:E,offset:H},B&&(ae.account_id=B)),api(R).get(te,{searchParams:ae}).then(async ce=>{const Ce=ce.next(),Oe=await ce.json();Oe.accounts&&y(importFetchedAccounts(Oe.accounts)),Oe.statuses&&y(importFetchedStatuses(Oe.statuses)),y(expandSearchSuccess(Oe,k,E,Ce)),y(fetchRelationships(Oe.accounts.map(Le=>Le.id)))}).catch(ce=>{y(expandSearchFail(ce))})},expandSearchRequest=E=>({type:SEARCH_EXPAND_REQUEST,searchType:E}),expandSearchSuccess=(E,y,R,k)=>({type:SEARCH_EXPAND_SUCCESS,results:E,searchTerm:y,searchType:R,next:k}),expandSearchFail=E=>({type:SEARCH_EXPAND_FAIL,error:E}),showSearch=()=>({type:SEARCH_SHOW}),setSearchAccount=E=>({type:SEARCH_ACCOUNT_SET,accountId:E}),ResultsRecord=Record({accounts:OrderedSet(),statuses:OrderedSet(),groups:OrderedSet(),hashtags:OrderedSet(),accountsHasMore:!1,statusesHasMore:!1,groupsHasMore:!1,hashtagsHasMore:!1,accountsLoaded:!1,statusesLoaded:!1,groupsLoaded:!1,hashtagsLoaded:!1}),ReducerRecord$6=Record({value:"",submitted:!1,submittedValue:"",hidden:!1,results:ResultsRecord(),filter:"statuses",accountId:null,next:null}),toIds$1=(E=[])=>OrderedSet(E.map(y=>y.id)),importResults=(E,y,R,k,H)=>E.withMutations(B=>{var te;B.value===R&&B.filter===k&&(B.set("results",ResultsRecord({statuses:toIds$1(y.statuses),accounts:toIds$1(y.accounts),groups:toIds$1(y.groups),hashtags:OrderedSet(y.hashtags.map(normalizeTag)),accountsHasMore:y.accounts.length>=20,statusesHasMore:y.statuses.length>=20,groupsHasMore:((te=y.groups)==null?void 0:te.length)>=20,hashtagsHasMore:y.hashtags.length>=20,accountsLoaded:!0,statusesLoaded:!0,groupsLoaded:!0,hashtagsLoaded:!0})),B.set("submitted",!0),B.set("next",H))}),paginateResults=(E,y,R,k,H)=>E.withMutations(B=>{B.value===k&&(B.setIn(["results",`${y}HasMore`],R[y].length>=20),B.setIn(["results",`${y}Loaded`],!0),B.set("next",H),B.updateIn(["results",y],te=>{const ae=R[y];return y==="hashtags"?te.concat(fromJS(ae).map(normalizeTag)):te.concat(toIds$1(ae))}))}),handleSubmitted=(E,y)=>E.withMutations(R=>{R.set("results",ResultsRecord()),R.set("submitted",!0),R.set("submittedValue",y)});function search(E=ReducerRecord$6(),y){switch(y.type){case SEARCH_CHANGE:return E.set("value",y.value);case SEARCH_CLEAR:return ReducerRecord$6();case SEARCH_RESULTS_CLEAR:return E.merge({value:"",results:ResultsRecord(),submitted:!1,submittedValue:""});case SEARCH_SHOW:return E.set("hidden",!1);case COMPOSE_REPLY:case COMPOSE_MENTION:case COMPOSE_DIRECT:case COMPOSE_QUOTE:return E.set("hidden",!0);case SEARCH_FETCH_REQUEST:return handleSubmitted(E,y.value);case SEARCH_FETCH_SUCCESS:return importResults(E,y.results,y.searchTerm,y.searchType,y.next);case SEARCH_FILTER_SET:return E.set("filter",y.value);case SEARCH_EXPAND_REQUEST:return E.setIn(["results",`${y.searchType}Loaded`],!1);case SEARCH_EXPAND_SUCCESS:return paginateResults(E,y.searchType,y.results,y.searchTerm,y.next);case SEARCH_ACCOUNT_SET:return y.accountId?ReducerRecord$6({accountId:y.accountId,filter:"statuses"}):E.merge({results:ResultsRecord(),submitted:!1,submittedValue:"",filter:"statuses",accountId:null});default:return E}}const MFA_FETCH_REQUEST="MFA_FETCH_REQUEST",MFA_FETCH_SUCCESS="MFA_FETCH_SUCCESS",MFA_FETCH_FAIL="MFA_FETCH_FAIL",MFA_BACKUP_CODES_FETCH_REQUEST="MFA_BACKUP_CODES_FETCH_REQUEST",MFA_BACKUP_CODES_FETCH_SUCCESS="MFA_BACKUP_CODES_FETCH_SUCCESS",MFA_BACKUP_CODES_FETCH_FAIL="MFA_BACKUP_CODES_FETCH_FAIL",MFA_SETUP_REQUEST="MFA_SETUP_REQUEST",MFA_SETUP_SUCCESS="MFA_SETUP_SUCCESS",MFA_SETUP_FAIL="MFA_SETUP_FAIL",MFA_CONFIRM_REQUEST="MFA_CONFIRM_REQUEST",MFA_CONFIRM_SUCCESS="MFA_CONFIRM_SUCCESS",MFA_CONFIRM_FAIL="MFA_CONFIRM_FAIL",MFA_DISABLE_REQUEST="MFA_DISABLE_REQUEST",MFA_DISABLE_SUCCESS="MFA_DISABLE_SUCCESS",MFA_DISABLE_FAIL="MFA_DISABLE_FAIL",fetchMfa=()=>(E,y)=>(E({type:MFA_FETCH_REQUEST}),api(y).get("/api/pleroma/accounts/mfa").then(R=>R.json()).then(R=>{E({type:MFA_FETCH_SUCCESS,data:R})}).catch(()=>{E({type:MFA_FETCH_FAIL})})),fetchBackupCodes=()=>(E,y)=>(E({type:MFA_BACKUP_CODES_FETCH_REQUEST}),api(y).get("/api/pleroma/accounts/mfa/backup_codes").then(R=>R.json()).then(R=>(E({type:MFA_BACKUP_CODES_FETCH_SUCCESS,data:R}),R)).catch(()=>{E({type:MFA_BACKUP_CODES_FETCH_FAIL})})),setupMfa=E=>(y,R)=>(y({type:MFA_SETUP_REQUEST,method:E}),api(R).get(`/api/pleroma/accounts/mfa/setup/${E}`).then(k=>k.json()).then(k=>(y({type:MFA_SETUP_SUCCESS,data:k}),k)).catch(k=>{throw y({type:MFA_SETUP_FAIL}),k})),confirmMfa=(E,y,R)=>(k,H)=>{const B={code:y,password:R};return k({type:MFA_CONFIRM_REQUEST,method:E,code:y}),api(H).post(`/api/pleroma/accounts/mfa/confirm/${E}`,B).then(te=>te.json()).then(te=>(k({type:MFA_CONFIRM_SUCCESS,method:E,code:y}),te)).catch(te=>{throw k({type:MFA_CONFIRM_FAIL,method:E,code:y,error:te,skipAlert:!0}),te})},disableMfa$1=(E,y)=>(R,k)=>(R({type:MFA_DISABLE_REQUEST,method:E}),api(k).request("DELETE",`/api/pleroma/accounts/mfa/${E}`,{password:y}).then(H=>H.json()).then(H=>(R({type:MFA_DISABLE_SUCCESS,method:E}),H)).catch(H=>{throw R({type:MFA_DISABLE_FAIL,method:E,skipAlert:!0}),H})),FETCH_TOKENS_REQUEST="FETCH_TOKENS_REQUEST",FETCH_TOKENS_SUCCESS="FETCH_TOKENS_SUCCESS",FETCH_TOKENS_FAIL="FETCH_TOKENS_FAIL",REVOKE_TOKEN_REQUEST="REVOKE_TOKEN_REQUEST",REVOKE_TOKEN_SUCCESS="REVOKE_TOKEN_SUCCESS",REVOKE_TOKEN_FAIL="REVOKE_TOKEN_FAIL",RESET_PASSWORD_REQUEST="RESET_PASSWORD_REQUEST",RESET_PASSWORD_SUCCESS="RESET_PASSWORD_SUCCESS",RESET_PASSWORD_FAIL="RESET_PASSWORD_FAIL",RESET_PASSWORD_CONFIRM_REQUEST="RESET_PASSWORD_CONFIRM_REQUEST",RESET_PASSWORD_CONFIRM_SUCCESS="RESET_PASSWORD_CONFIRM_SUCCESS",RESET_PASSWORD_CONFIRM_FAIL="RESET_PASSWORD_CONFIRM_FAIL",CHANGE_PASSWORD_REQUEST="CHANGE_PASSWORD_REQUEST",CHANGE_PASSWORD_SUCCESS="CHANGE_PASSWORD_SUCCESS",CHANGE_PASSWORD_FAIL="CHANGE_PASSWORD_FAIL",CHANGE_EMAIL_REQUEST="CHANGE_EMAIL_REQUEST",CHANGE_EMAIL_SUCCESS="CHANGE_EMAIL_SUCCESS",CHANGE_EMAIL_FAIL="CHANGE_EMAIL_FAIL",DELETE_ACCOUNT_REQUEST="DELETE_ACCOUNT_REQUEST",DELETE_ACCOUNT_SUCCESS="DELETE_ACCOUNT_SUCCESS",DELETE_ACCOUNT_FAIL="DELETE_ACCOUNT_FAIL",MOVE_ACCOUNT_REQUEST="MOVE_ACCOUNT_REQUEST",MOVE_ACCOUNT_SUCCESS="MOVE_ACCOUNT_SUCCESS",MOVE_ACCOUNT_FAIL="MOVE_ACCOUNT_FAIL",fetchOAuthTokens=()=>(E,y)=>(E({type:FETCH_TOKENS_REQUEST}),api(y).get("/api/oauth_tokens").then(R=>R.json()).then(R=>{E({type:FETCH_TOKENS_SUCCESS,tokens:R})}).catch(()=>{E({type:FETCH_TOKENS_FAIL})})),revokeOAuthTokenById=E=>(y,R)=>(y({type:REVOKE_TOKEN_REQUEST,id:E}),api(R).delete(`/api/oauth_tokens/${E}`).then(()=>{y({type:REVOKE_TOKEN_SUCCESS,id:E})}).catch(()=>{y({type:REVOKE_TOKEN_FAIL,id:E})})),changePassword=(E,y,R)=>(k,H)=>(k({type:CHANGE_PASSWORD_REQUEST}),api(H).post("/api/pleroma/change_password",{password:E,new_password:y,new_password_confirmation:R}).then(B=>B.json()).then(B=>{if(B.error)throw B.error;k({type:CHANGE_PASSWORD_SUCCESS,data:B})}).catch(B=>{throw k({type:CHANGE_PASSWORD_FAIL,error:B,skipAlert:!0}),B})),resetPassword=E=>(y,R)=>{const k=normalizeUsername(E),H=R(),B=parseVersion(H.instance.version);y({type:RESET_PASSWORD_REQUEST});const te=k.includes("@")?{email:k}:{nickname:k,username:k},ae=B.software===TRUTHSOCIAL?"/api/v1/truth/password_reset/request":"/auth/password";return api(R).post(ae,te).then(()=>{y({type:RESET_PASSWORD_SUCCESS})}).catch(ce=>{throw y({type:RESET_PASSWORD_FAIL,error:ce}),ce})},resetPasswordConfirm=(E,y)=>(R,k)=>{const H={password:E,reset_password_token:y};return R({type:RESET_PASSWORD_CONFIRM_REQUEST}),api(k).post("/api/v1/truth/password_reset/confirm",H).then(()=>{R({type:RESET_PASSWORD_CONFIRM_SUCCESS})}).catch(B=>{throw R({type:RESET_PASSWORD_CONFIRM_FAIL,error:B}),B})},changeEmail=(E,y)=>(R,k)=>(R({type:CHANGE_EMAIL_REQUEST,email:E}),api(k).post("/api/pleroma/change_email",{email:E,password:y}).then(H=>H.json()).then(H=>{if(H.error)throw H.error;R({type:CHANGE_EMAIL_SUCCESS,email:E,data:H})}).catch(H=>{throw R({type:CHANGE_EMAIL_FAIL,email:E,error:H,skipAlert:!0}),H})),confirmChangedEmail=E=>(y,R)=>api(R).get(`/api/v1/truth/email/confirm?confirmation_token=${E}`),deleteAccount=E=>(y,R)=>{const k=getLoggedInAccount(R());return y({type:DELETE_ACCOUNT_REQUEST}),api(R).post("/api/pleroma/delete_account",{password:E}).then(H=>H.json()).then(H=>{if(H.error)throw H.error;y({type:DELETE_ACCOUNT_SUCCESS,data:H}),y({type:AUTH_LOGGED_OUT,account:k}),toast.success(messages$6.loggedOut)}).catch(H=>{throw y({type:DELETE_ACCOUNT_FAIL,error:H,skipAlert:!0}),H})},moveAccount=(E,y)=>(R,k)=>(R({type:MOVE_ACCOUNT_REQUEST}),api(k).post("/api/pleroma/move_account",{password:y,target_account:E}).then(H=>H.json()).then(H=>{if(H.error)throw H.error;R({type:MOVE_ACCOUNT_SUCCESS,data:H})}).catch(H=>{throw R({type:MOVE_ACCOUNT_FAIL,error:H,skipAlert:!0}),H})),TokenRecord=Record({id:0,app_name:"",valid_until:""}),ReducerRecord$5=Record({tokens:List(),mfa:Map$1({settings:Map$1({totp:!1})})}),deleteToken=(E,y)=>E.update("tokens",R=>R.filterNot(k=>k.id===y)),importMfa=(E,y)=>E.set("mfa",y),enableMfa=(E,y)=>E.setIn(["mfa","settings",y],!0),disableMfa=(E,y)=>E.setIn(["mfa","settings",y],!1);function security(E=ReducerRecord$5(),y){switch(y.type){case FETCH_TOKENS_SUCCESS:return E.set("tokens",List(y.tokens.map(TokenRecord)));case REVOKE_TOKEN_SUCCESS:return deleteToken(E,y.id);case MFA_FETCH_SUCCESS:return importMfa(E,fromJS(y.data));case MFA_CONFIRM_SUCCESS:return enableMfa(E,y.method);case MFA_DISABLE_SUCCESS:return disableMfa(E,y.method);default:return E}}const updateFrequentEmojis=(E,y)=>E.update("frequentlyUsedEmojis",Map$1(),R=>R.update(y.id,0,k=>k+1)).set("saved",!1),importSettings=(E,y)=>{y=fromJS(y);const R=y.getIn(["pleroma","settings_store",FE_NAME],Map$1());return E.merge(R)};function settings(E=Map$1({saved:!0}),y){switch(y.type){case ME_FETCH_SUCCESS:return importSettings(E,y.me);case NOTIFICATIONS_FILTER_SET:case SEARCH_FILTER_SET:case SETTING_CHANGE:return E.setIn(y.path,y.value).set("saved",!1);case EMOJI_CHOOSE:return updateFrequentEmojis(E,y.emoji);case SETTING_SAVE:return E.set("saved",!0);case SETTINGS_UPDATE:return Map$1(fromJS(y.settings));default:return E}}const SIDEBAR_OPEN="SIDEBAR_OPEN",SIDEBAR_CLOSE="SIDEBAR_CLOSE",openSidebar=()=>({type:SIDEBAR_OPEN}),closeSidebar=()=>({type:SIDEBAR_CLOSE}),initialState$6={sidebarOpen:!1};function sidebar(E=initialState$6,y){switch(y.type){case SIDEBAR_OPEN:return{sidebarOpen:!0};case SIDEBAR_CLOSE:return{sidebarOpen:!1};default:return E}}const initialState$5=Map$1(),fallbackState=Map$1({brandColor:"#0482d8"}),updateFromAdmin=(E,y)=>{try{return ConfigDB.find(y,":pleroma",":frontend_configurations").get("value").find(R=>R.getIn(["tuple",0])===":soapbox_fe").getIn(["tuple",1])}catch{return E}},preloadImport=(E,y)=>{const k=y.data["/api/pleroma/frontend_configurations"];if(k){const H=k.soapbox_fe;return H?fallbackState.mergeDeep(fromJS(H)):fallbackState}else return E},importSoapboxConfig=(E,y,R)=>y;function soapbox(E=initialState$5,y){switch(y.type){case PLEROMA_PRELOAD_IMPORT:return preloadImport(E,y);case SOAPBOX_CONFIG_REMEMBER_SUCCESS:return fromJS(y.soapboxConfig);case SOAPBOX_CONFIG_REQUEST_SUCCESS:return importSoapboxConfig(E,fromJS(y.soapboxConfig),y.host);case SOAPBOX_CONFIG_REQUEST_FAIL:return fallbackState.mergeDeep(E);case ADMIN_CONFIG_UPDATE_SUCCESS:return updateFromAdmin(E,fromJS(y.configs));default:return E}}const STATUS_HOVER_CARD_OPEN="STATUS_HOVER_CARD_OPEN",STATUS_HOVER_CARD_UPDATE="STATUS_HOVER_CARD_UPDATE",STATUS_HOVER_CARD_CLOSE="STATUS_HOVER_CARD_CLOSE",openStatusHoverCard=(E,y)=>({type:STATUS_HOVER_CARD_OPEN,ref:E,statusId:y}),updateStatusHoverCard=()=>({type:STATUS_HOVER_CARD_UPDATE}),closeStatusHoverCard=(E=!1)=>({type:STATUS_HOVER_CARD_CLOSE,force:E}),ReducerRecord$4=Record({ref:null,statusId:"",hovered:!1});function statusHoverCard(E=ReducerRecord$4(),y){switch(y.type){case STATUS_HOVER_CARD_OPEN:return E.withMutations(R=>{R.set("ref",y.ref),R.set("statusId",y.statusId)});case STATUS_HOVER_CARD_UPDATE:return E.set("hovered",!0);case STATUS_HOVER_CARD_CLOSE:return E.hovered===!0&&!y.force?E:ReducerRecord$4();default:return E}}const STATUS_QUOTES_FETCH_REQUEST="STATUS_QUOTES_FETCH_REQUEST",STATUS_QUOTES_FETCH_SUCCESS="STATUS_QUOTES_FETCH_SUCCESS",STATUS_QUOTES_FETCH_FAIL="STATUS_QUOTES_FETCH_FAIL",STATUS_QUOTES_EXPAND_REQUEST="STATUS_QUOTES_EXPAND_REQUEST",STATUS_QUOTES_EXPAND_SUCCESS="STATUS_QUOTES_EXPAND_SUCCESS",STATUS_QUOTES_EXPAND_FAIL="STATUS_QUOTES_EXPAND_FAIL",noOp$1=()=>new Promise(E=>E(null)),fetchStatusQuotes=E=>(y,R)=>R().status_lists.getIn([`quotes:${E}`,"isLoading"])?y(noOp$1):(y({statusId:E,type:STATUS_QUOTES_FETCH_REQUEST}),api(R).get(`/api/v1/pleroma/statuses/${E}/quotes`).then(async k=>{const H=k.next(),B=await k.json();return y(importFetchedStatuses(B)),y({type:STATUS_QUOTES_FETCH_SUCCESS,statusId:E,statuses:B,next:H})}).catch(k=>{y({type:STATUS_QUOTES_FETCH_FAIL,statusId:E,error:k})})),expandStatusQuotes=E=>(y,R)=>{const k=R().status_lists.getIn([`quotes:${E}`,"next"],null);return k===null||R().status_lists.getIn([`quotes:${E}`,"isLoading"])?y(noOp$1):(y({type:STATUS_QUOTES_EXPAND_REQUEST,statusId:E}),api(R).get(k).then(async H=>{const B=await H.json();y(importFetchedStatuses(B)),y({type:STATUS_QUOTES_EXPAND_SUCCESS,statusId:E,statuses:B,next:H.next()})}).catch(H=>{y({type:STATUS_QUOTES_EXPAND_FAIL,statusId:E,error:H})}))},FAVOURITED_STATUSES_FETCH_REQUEST="FAVOURITED_STATUSES_FETCH_REQUEST",FAVOURITED_STATUSES_FETCH_SUCCESS="FAVOURITED_STATUSES_FETCH_SUCCESS",FAVOURITED_STATUSES_FETCH_FAIL="FAVOURITED_STATUSES_FETCH_FAIL",FAVOURITED_STATUSES_EXPAND_REQUEST="FAVOURITED_STATUSES_EXPAND_REQUEST",FAVOURITED_STATUSES_EXPAND_SUCCESS="FAVOURITED_STATUSES_EXPAND_SUCCESS",FAVOURITED_STATUSES_EXPAND_FAIL="FAVOURITED_STATUSES_EXPAND_FAIL",ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST="ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST",ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS="ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS",ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL="ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL",ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST="ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST",ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS="ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS",ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL="ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL",fetchFavouritedStatuses=()=>(E,y)=>{var R;isLoggedIn(y)&&((R=y().status_lists.get("favourites"))!=null&&R.isLoading||(E(fetchFavouritedStatusesRequest()),api(y).get("/api/v1/favourites").then(async k=>{const H=k.next(),B=await k.json();E(importFetchedStatuses(B)),E(fetchFavouritedStatusesSuccess(B,H))}).catch(k=>{E(fetchFavouritedStatusesFail(k))})))},fetchFavouritedStatusesRequest=()=>({type:FAVOURITED_STATUSES_FETCH_REQUEST,skipLoading:!0}),fetchFavouritedStatusesSuccess=(E,y)=>({type:FAVOURITED_STATUSES_FETCH_SUCCESS,statuses:E,next:y,skipLoading:!0}),fetchFavouritedStatusesFail=E=>({type:FAVOURITED_STATUSES_FETCH_FAIL,error:E,skipLoading:!0}),expandFavouritedStatuses=()=>(E,y)=>{var k,H;if(!isLoggedIn(y))return;const R=((k=y().status_lists.get("favourites"))==null?void 0:k.next)||null;R===null||(H=y().status_lists.get("favourites"))!=null&&H.isLoading||(E(expandFavouritedStatusesRequest()),api(y).get(R).then(async B=>{const te=B.next(),ae=await B.json();E(importFetchedStatuses(ae)),E(expandFavouritedStatusesSuccess(ae,te))}).catch(B=>{E(expandFavouritedStatusesFail(B))}))},expandFavouritedStatusesRequest=()=>({type:FAVOURITED_STATUSES_EXPAND_REQUEST}),expandFavouritedStatusesSuccess=(E,y)=>({type:FAVOURITED_STATUSES_EXPAND_SUCCESS,statuses:E,next:y}),expandFavouritedStatusesFail=E=>({type:FAVOURITED_STATUSES_EXPAND_FAIL,error:E}),fetchAccountFavouritedStatuses=E=>(y,R)=>{var k;isLoggedIn(R)&&((k=R().status_lists.get(`favourites:${E}`))!=null&&k.isLoading||(y(fetchAccountFavouritedStatusesRequest(E)),api(R).get(`/api/v1/pleroma/accounts/${E}/favourites`).then(async H=>{const B=H.next(),te=await H.json();y(importFetchedStatuses(te)),y(fetchAccountFavouritedStatusesSuccess(E,te,B))}).catch(H=>{y(fetchAccountFavouritedStatusesFail(E,H))})))},fetchAccountFavouritedStatusesRequest=E=>({type:ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST,accountId:E,skipLoading:!0}),fetchAccountFavouritedStatusesSuccess=(E,y,R)=>({type:ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS,accountId:E,statuses:y,next:R,skipLoading:!0}),fetchAccountFavouritedStatusesFail=(E,y)=>({type:ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL,accountId:E,error:y,skipLoading:!0}),expandAccountFavouritedStatuses=E=>(y,R)=>{var H,B;if(!isLoggedIn(R))return;const k=((H=R().status_lists.get(`favourites:${E}`))==null?void 0:H.next)||null;k===null||(B=R().status_lists.get(`favourites:${E}`))!=null&&B.isLoading||(y(expandAccountFavouritedStatusesRequest(E)),api(R).get(k).then(async te=>{const ae=te.next(),ce=await te.json();y(importFetchedStatuses(ce)),y(expandAccountFavouritedStatusesSuccess(E,ce,ae))}).catch(te=>{y(expandAccountFavouritedStatusesFail(E,te))}))},expandAccountFavouritedStatusesRequest=E=>({type:ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST,accountId:E}),expandAccountFavouritedStatusesSuccess=(E,y,R)=>({type:ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS,accountId:E,statuses:y,next:R}),expandAccountFavouritedStatusesFail=(E,y)=>({type:ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL,accountId:E,error:y}),REBLOG_REQUEST="REBLOG_REQUEST",REBLOG_SUCCESS="REBLOG_SUCCESS",REBLOG_FAIL="REBLOG_FAIL",FAVOURITE_REQUEST="FAVOURITE_REQUEST",FAVOURITE_SUCCESS="FAVOURITE_SUCCESS",FAVOURITE_FAIL="FAVOURITE_FAIL",DISLIKE_REQUEST="DISLIKE_REQUEST",DISLIKE_SUCCESS="DISLIKE_SUCCESS",DISLIKE_FAIL="DISLIKE_FAIL",UNREBLOG_REQUEST="UNREBLOG_REQUEST",UNREBLOG_SUCCESS="UNREBLOG_SUCCESS",UNREBLOG_FAIL="UNREBLOG_FAIL",UNFAVOURITE_REQUEST="UNFAVOURITE_REQUEST",UNFAVOURITE_SUCCESS="UNFAVOURITE_SUCCESS",UNFAVOURITE_FAIL="UNFAVOURITE_FAIL",UNDISLIKE_REQUEST="UNDISLIKE_REQUEST",UNDISLIKE_SUCCESS="UNDISLIKE_SUCCESS",UNDISLIKE_FAIL="UNDISLIKE_FAIL",REBLOGS_FETCH_REQUEST="REBLOGS_FETCH_REQUEST",REBLOGS_FETCH_SUCCESS="REBLOGS_FETCH_SUCCESS",REBLOGS_FETCH_FAIL="REBLOGS_FETCH_FAIL",FAVOURITES_FETCH_REQUEST="FAVOURITES_FETCH_REQUEST",FAVOURITES_FETCH_SUCCESS="FAVOURITES_FETCH_SUCCESS",FAVOURITES_FETCH_FAIL="FAVOURITES_FETCH_FAIL",DISLIKES_FETCH_REQUEST="DISLIKES_FETCH_REQUEST",DISLIKES_FETCH_SUCCESS="DISLIKES_FETCH_SUCCESS",DISLIKES_FETCH_FAIL="DISLIKES_FETCH_FAIL",REACTIONS_FETCH_REQUEST="REACTIONS_FETCH_REQUEST",REACTIONS_FETCH_SUCCESS="REACTIONS_FETCH_SUCCESS",REACTIONS_FETCH_FAIL="REACTIONS_FETCH_FAIL",PIN_REQUEST="PIN_REQUEST",PIN_SUCCESS="PIN_SUCCESS",PIN_FAIL="PIN_FAIL",UNPIN_REQUEST="UNPIN_REQUEST",UNPIN_SUCCESS="UNPIN_SUCCESS",UNPIN_FAIL="UNPIN_FAIL",REMOTE_INTERACTION_REQUEST="REMOTE_INTERACTION_REQUEST",REMOTE_INTERACTION_SUCCESS="REMOTE_INTERACTION_SUCCESS",REMOTE_INTERACTION_FAIL="REMOTE_INTERACTION_FAIL",FAVOURITES_EXPAND_SUCCESS="FAVOURITES_EXPAND_SUCCESS",FAVOURITES_EXPAND_FAIL="FAVOURITES_EXPAND_FAIL",REBLOGS_EXPAND_SUCCESS="REBLOGS_EXPAND_SUCCESS",REBLOGS_EXPAND_FAIL="REBLOGS_EXPAND_FAIL",ZAP_REQUEST="ZAP_REQUEST",ZAP_SUCCESS="ZAP_SUCCESS",ZAP_FAIL="ZAP_FAIL",ZAPS_FETCH_REQUEST="ZAPS_FETCH_REQUEST",ZAPS_FETCH_SUCCESS="ZAPS_FETCH_SUCCESS",ZAPS_EXPAND_SUCCESS="ZAPS_EXPAND_SUCCESS",ZAPS_EXPAND_FAIL="ZAPS_EXPAND_FAIL",reblog=(E,y)=>function(R,k){isLoggedIn(k)&&(R(reblogRequest(E)),y==null||y.reblogEffect(E.id),api(k).post(`/api/v1/statuses/${E.id}/reblog`).then(H=>H.json()).then(H=>{R(importFetchedStatus(H.reblog)),R(reblogSuccess(E))}).catch(H=>{R(reblogFail(E,H)),y==null||y.unreblogEffect(E.id)}))},unreblog=(E,y)=>(R,k)=>{isLoggedIn(k)&&(R(unreblogRequest(E)),y==null||y.unreblogEffect(E.id),api(k).post(`/api/v1/statuses/${E.id}/unreblog`).then(()=>{R(unreblogSuccess(E))}).catch(H=>{R(unreblogFail(E,H)),y==null||y.reblogEffect(E.id)}))},toggleReblog=(E,y)=>R=>{E.reblogged?R(unreblog(E,y)):R(reblog(E,y))},reblogRequest=E=>({type:REBLOG_REQUEST,status:E,skipLoading:!0}),reblogSuccess=E=>({type:REBLOG_SUCCESS,status:E,skipLoading:!0}),reblogFail=(E,y)=>({type:REBLOG_FAIL,status:E,error:y,skipLoading:!0}),unreblogRequest=E=>({type:UNREBLOG_REQUEST,status:E,skipLoading:!0}),unreblogSuccess=E=>({type:UNREBLOG_SUCCESS,status:E,skipLoading:!0}),unreblogFail=(E,y)=>({type:UNREBLOG_FAIL,status:E,error:y,skipLoading:!0}),favourite=E=>(y,R)=>{isLoggedIn(R)&&(y(favouriteRequest(E)),api(R).post(`/api/v1/statuses/${E.id}/favourite`).then(function(k){y(favouriteSuccess(E))}).catch(function(k){y(favouriteFail(E,k))}))},unfavourite=E=>(y,R)=>{isLoggedIn(R)&&(y(unfavouriteRequest(E)),api(R).post(`/api/v1/statuses/${E.id}/unfavourite`).then(()=>{y(unfavouriteSuccess(E))}).catch(k=>{y(unfavouriteFail(E,k))}))},toggleFavourite=E=>y=>{E.favourited?y(unfavourite(E)):y(favourite(E))},favouriteRequest=E=>({type:FAVOURITE_REQUEST,status:E,skipLoading:!0}),favouriteSuccess=E=>({type:FAVOURITE_SUCCESS,status:E,skipLoading:!0}),favouriteFail=(E,y)=>({type:FAVOURITE_FAIL,status:E,error:y,skipLoading:!0}),unfavouriteRequest=E=>({type:UNFAVOURITE_REQUEST,status:E,skipLoading:!0}),unfavouriteSuccess=E=>({type:UNFAVOURITE_SUCCESS,status:E,skipLoading:!0}),unfavouriteFail=(E,y)=>({type:UNFAVOURITE_FAIL,status:E,error:y,skipLoading:!0}),dislike=E=>(y,R)=>{isLoggedIn(R)&&(y(dislikeRequest(E)),api(R).post(`/api/friendica/statuses/${E.id}/dislike`).then(function(){y(dislikeSuccess(E))}).catch(function(k){y(dislikeFail(E,k))}))},undislike=E=>(y,R)=>{isLoggedIn(R)&&(y(undislikeRequest(E)),api(R).post(`/api/friendica/statuses/${E.id}/undislike`).then(()=>{y(undislikeSuccess(E))}).catch(k=>{y(undislikeFail(E,k))}))},toggleDislike=E=>y=>{E.disliked?y(undislike(E)):y(dislike(E))},dislikeRequest=E=>({type:DISLIKE_REQUEST,status:E,skipLoading:!0}),dislikeSuccess=E=>({type:DISLIKE_SUCCESS,status:E,skipLoading:!0}),dislikeFail=(E,y)=>({type:DISLIKE_FAIL,status:E,error:y,skipLoading:!0}),undislikeRequest=E=>({type:UNDISLIKE_REQUEST,status:E,skipLoading:!0}),undislikeSuccess=E=>({type:UNDISLIKE_SUCCESS,status:E,skipLoading:!0}),undislikeFail=(E,y)=>({type:UNDISLIKE_FAIL,status:E,error:y,skipLoading:!0}),zap=(E,y,R,k)=>(H,B)=>{if(isLoggedIn(B))return y&&H(zapRequest(y)),api(B).post("/api/v1/ditto/zap",{amount:R,comment:k,account_id:E.id,status_id:y==null?void 0:y.id}).then(async te=>{var ce,Ce;const{invoice:ae}=await te.json();if(!ae)throw Error("Could not generate invoice");if(!window.webln)return ae;try{await((ce=window.webln)==null?void 0:ce.enable()),await((Ce=window.webln)==null?void 0:Ce.sendPayment(ae)),y&&H(zapSuccess(y));return}catch{return ae}}).catch(function(te){y&&H(zapFail(y,te))})},zapRequest=E=>({type:ZAP_REQUEST,status:E,skipLoading:!0}),zapSuccess=E=>({type:ZAP_SUCCESS,status:E,skipLoading:!0}),zapFail=(E,y)=>({type:ZAP_FAIL,status:E,error:y,skipLoading:!0}),fetchReblogs=E=>(y,R)=>{isLoggedIn(R)&&(y(fetchReblogsRequest(E)),api(R).get(`/api/v1/statuses/${E}/reblogged_by`).then(async k=>{const H=k.next(),B=await k.json();y(importFetchedAccounts(B)),y(fetchRelationships(B.map(te=>te.id))),y(fetchReblogsSuccess(E,B,H))}).catch(k=>{y(fetchReblogsFail(E,k))}))},fetchReblogsRequest=E=>({type:REBLOGS_FETCH_REQUEST,id:E}),fetchReblogsSuccess=(E,y,R)=>({type:REBLOGS_FETCH_SUCCESS,id:E,accounts:y,next:R}),fetchReblogsFail=(E,y)=>({type:REBLOGS_FETCH_FAIL,id:E,error:y}),expandReblogs=(E,y)=>(R,k)=>{api(k).get(y).then(async H=>{const B=H.next(),te=await H.json();R(importFetchedAccounts(te)),R(fetchRelationships(te.map(ae=>ae.id))),R(expandReblogsSuccess(E,te,B))}).catch(H=>{R(expandReblogsFail(E,H))})},expandReblogsSuccess=(E,y,R)=>({type:REBLOGS_EXPAND_SUCCESS,id:E,accounts:y,next:R}),expandReblogsFail=(E,y)=>({type:REBLOGS_EXPAND_FAIL,id:E,error:y}),fetchFavourites=E=>(y,R)=>{isLoggedIn(R)&&(y(fetchFavouritesRequest(E)),api(R).get(`/api/v1/statuses/${E}/favourited_by`).then(async k=>{const H=k.next(),B=await k.json();y(importFetchedAccounts(B)),y(fetchRelationships(B.map(te=>te.id))),y(fetchFavouritesSuccess(E,B,H))}).catch(k=>{y(fetchFavouritesFail(E,k))}))},fetchFavouritesRequest=E=>({type:FAVOURITES_FETCH_REQUEST,id:E}),fetchFavouritesSuccess=(E,y,R)=>({type:FAVOURITES_FETCH_SUCCESS,id:E,accounts:y,next:R}),fetchFavouritesFail=(E,y)=>({type:FAVOURITES_FETCH_FAIL,id:E,error:y}),expandFavourites=(E,y)=>(R,k)=>{api(k).get(y).then(async H=>{const B=H.next(),te=await H.json();R(importFetchedAccounts(te)),R(fetchRelationships(te.map(ae=>ae.id))),R(expandFavouritesSuccess(E,te,B))}).catch(H=>{R(expandFavouritesFail(E,H))})},expandFavouritesSuccess=(E,y,R)=>({type:FAVOURITES_EXPAND_SUCCESS,id:E,accounts:y,next:R}),expandFavouritesFail=(E,y)=>({type:FAVOURITES_EXPAND_FAIL,id:E,error:y}),fetchDislikes=E=>(y,R)=>{isLoggedIn(R)&&(y(fetchDislikesRequest(E)),api(R).get(`/api/friendica/statuses/${E}/disliked_by`).then(k=>k.json()).then(k=>{y(importFetchedAccounts(k)),y(fetchRelationships(k.map(H=>H.id))),y(fetchDislikesSuccess(E,k))}).catch(k=>{y(fetchDislikesFail(E,k))}))},fetchDislikesRequest=E=>({type:DISLIKES_FETCH_REQUEST,id:E}),fetchDislikesSuccess=(E,y)=>({type:DISLIKES_FETCH_SUCCESS,id:E,accounts:y}),fetchDislikesFail=(E,y)=>({type:DISLIKES_FETCH_FAIL,id:E,error:y}),fetchReactions=E=>(y,R)=>{y(fetchReactionsRequest(E)),api(R).get(`/api/v1/pleroma/statuses/${E}/reactions`).then(k=>k.json()).then(k=>{y(importFetchedAccounts(k.map(({accounts:H})=>H).flat())),y(fetchReactionsSuccess(E,k))}).catch(k=>{y(fetchReactionsFail(E,k))})},fetchReactionsRequest=E=>({type:REACTIONS_FETCH_REQUEST,id:E}),fetchReactionsSuccess=(E,y)=>({type:REACTIONS_FETCH_SUCCESS,id:E,reactions:y}),fetchReactionsFail=(E,y)=>({type:REACTIONS_FETCH_FAIL,id:E,error:y}),fetchZaps=E=>(y,R)=>{y(fetchZapsRequest(E)),api(R).get(`/api/v1/ditto/statuses/${E}/zapped_by`).then(async k=>{const H=k.next(),B=await k.json();y(importFetchedAccounts(B.map(({account:te})=>te).flat())),y(fetchZapsSuccess(E,B,H))}).catch(k=>{y(fetchZapsFail(E,k))})},fetchZapsRequest=E=>({type:ZAPS_FETCH_REQUEST,id:E}),fetchZapsSuccess=(E,y,R)=>({type:ZAPS_FETCH_SUCCESS,id:E,zaps:y,next:R}),fetchZapsFail=(E,y)=>({type:REACTIONS_FETCH_FAIL,id:E,error:y}),expandZaps=(E,y)=>(R,k)=>{api(k).get(y).then(async H=>{const B=H.next(),te=await H.json();R(importFetchedAccounts(te.map(ae=>ae.account))),R(fetchRelationships(te.map(ae=>ae.account.id))),R(expandZapsSuccess(E,te,B))}).catch(H=>{R(expandZapsFail(E,H))})},expandZapsSuccess=(E,y,R)=>({type:ZAPS_EXPAND_SUCCESS,id:E,zaps:y,next:R}),expandZapsFail=(E,y)=>({type:ZAPS_EXPAND_FAIL,id:E,error:y}),pin=E=>(y,R)=>{isLoggedIn(R)&&(y(pinRequest(E)),api(R).post(`/api/v1/statuses/${E.id}/pin`).then(k=>k.json()).then(k=>{y(importFetchedStatus(k)),y(pinSuccess(E))}).catch(k=>{y(pinFail(E,k))}))},pinToGroup=(E,y)=>(R,k)=>api(k).post(`/api/v1/groups/${y.id}/statuses/${E.id}/pin`).then(()=>R(expandGroupFeaturedTimeline(y.id))),unpinFromGroup=(E,y)=>(R,k)=>api(k).post(`/api/v1/groups/${y.id}/statuses/${E.id}/unpin`).then(()=>R(expandGroupFeaturedTimeline(y.id))),pinRequest=E=>({type:PIN_REQUEST,status:E,skipLoading:!0}),pinSuccess=E=>({type:PIN_SUCCESS,status:E,skipLoading:!0}),pinFail=(E,y)=>({type:PIN_FAIL,status:E,error:y,skipLoading:!0}),unpin=E=>(y,R)=>{isLoggedIn(R)&&(y(unpinRequest(E)),api(R).post(`/api/v1/statuses/${E.id}/unpin`).then(k=>k.json()).then(k=>{y(importFetchedStatus(k)),y(unpinSuccess(E))}).catch(k=>{y(unpinFail(E,k))}))},togglePin=E=>(y,R)=>{E.pinned?y(unpin(E)):y(pin(E))},unpinRequest=E=>({type:UNPIN_REQUEST,status:E,skipLoading:!0}),unpinSuccess=E=>({type:UNPIN_SUCCESS,status:E,skipLoading:!0}),unpinFail=(E,y)=>({type:UNPIN_FAIL,status:E,error:y,skipLoading:!0}),remoteInteraction=(E,y)=>(R,k)=>(R(remoteInteractionRequest(E,y)),api(k).post("/api/v1/pleroma/remote_interaction",{ap_id:E,profile:y}).then(H=>H.json()).then(H=>{if(H.error)throw new Error(H.error);return R(remoteInteractionSuccess(E,y,H.url)),H.url}).catch(H=>{throw R(remoteInteractionFail(E,y,H)),H})),remoteInteractionRequest=(E,y)=>({type:REMOTE_INTERACTION_REQUEST,ap_id:E,profile:y}),remoteInteractionSuccess=(E,y,R)=>({type:REMOTE_INTERACTION_SUCCESS,ap_id:E,profile:y,url:R}),remoteInteractionFail=(E,y,R)=>({type:REMOTE_INTERACTION_FAIL,ap_id:E,profile:y,error:R}),PINNED_STATUSES_FETCH_REQUEST="PINNED_STATUSES_FETCH_REQUEST",PINNED_STATUSES_FETCH_SUCCESS="PINNED_STATUSES_FETCH_SUCCESS",PINNED_STATUSES_FETCH_FAIL="PINNED_STATUSES_FETCH_FAIL",fetchPinnedStatuses=()=>(E,y)=>{if(!isLoggedIn(y))return;const R=y().me;E(fetchPinnedStatusesRequest()),api(y).get(`/api/v1/accounts/${R}/statuses`,{searchParams:{pinned:!0}}).then(k=>k.json()).then(k=>{E(importFetchedStatuses(k)),E(fetchPinnedStatusesSuccess(k,null))}).catch(k=>{E(fetchPinnedStatusesFail(k))})},fetchPinnedStatusesRequest=()=>({type:PINNED_STATUSES_FETCH_REQUEST}),fetchPinnedStatusesSuccess=(E,y)=>({type:PINNED_STATUSES_FETCH_SUCCESS,statuses:E,next:y}),fetchPinnedStatusesFail=E=>({type:PINNED_STATUSES_FETCH_FAIL,error:E}),StatusListRecord=Record({next:null,loaded:!1,isLoading:null,items:OrderedSet()}),initialState$4=Map$1({favourites:StatusListRecord(),pins:StatusListRecord(),scheduled_statuses:StatusListRecord(),recent_events:StatusListRecord(),joined_events:StatusListRecord()}),getStatusId=E=>typeof E=="string"?E:E.id,getStatusIds$1=(E=[])=>OrderedSet(E.map(getStatusId)),setLoading$1=(E,y,R)=>E.update(y,StatusListRecord(),k=>k.set("isLoading",R)),normalizeList$1=(E,y,R,k)=>E.update(y,StatusListRecord(),H=>H.withMutations(B=>{B.set("next",k),B.set("loaded",!0),B.set("isLoading",!1),B.set("items",getStatusIds$1(R))})),appendToList$1=(E,y,R,k)=>{const H=getStatusIds$1(R);return E.update(y,StatusListRecord(),B=>B.withMutations(te=>{te.set("next",k),te.set("isLoading",!1),te.update("items",ae=>ae.union(H))}))},prependOneToList=(E,y,R)=>{const k=getStatusId(R);return E.update(y,StatusListRecord(),H=>H.update("items",B=>OrderedSet([k]).union(B)))},removeOneFromList=(E,y,R)=>{const k=getStatusId(R);return E.update(y,StatusListRecord(),H=>H.update("items",B=>B.delete(k)))},maybeAppendScheduledStatus=(E,y)=>y.scheduled_at?prependOneToList(E,"scheduled_statuses",getStatusId(y)):E;function statusLists(E=initialState$4,y){switch(y.type){case FAVOURITED_STATUSES_FETCH_REQUEST:case FAVOURITED_STATUSES_EXPAND_REQUEST:return setLoading$1(E,"favourites",!0);case FAVOURITED_STATUSES_FETCH_FAIL:case FAVOURITED_STATUSES_EXPAND_FAIL:return setLoading$1(E,"favourites",!1);case FAVOURITED_STATUSES_FETCH_SUCCESS:return normalizeList$1(E,"favourites",y.statuses,y.next);case FAVOURITED_STATUSES_EXPAND_SUCCESS:return appendToList$1(E,"favourites",y.statuses,y.next);case ACCOUNT_FAVOURITED_STATUSES_FETCH_REQUEST:case ACCOUNT_FAVOURITED_STATUSES_EXPAND_REQUEST:return setLoading$1(E,`favourites:${y.accountId}`,!0);case ACCOUNT_FAVOURITED_STATUSES_FETCH_FAIL:case ACCOUNT_FAVOURITED_STATUSES_EXPAND_FAIL:return setLoading$1(E,`favourites:${y.accountId}`,!1);case ACCOUNT_FAVOURITED_STATUSES_FETCH_SUCCESS:return normalizeList$1(E,`favourites:${y.accountId}`,y.statuses,y.next);case ACCOUNT_FAVOURITED_STATUSES_EXPAND_SUCCESS:return appendToList$1(E,`favourites:${y.accountId}`,y.statuses,y.next);case FAVOURITE_SUCCESS:return prependOneToList(E,"favourites",y.status);case UNFAVOURITE_SUCCESS:return removeOneFromList(E,"favourites",y.status);case PINNED_STATUSES_FETCH_SUCCESS:return normalizeList$1(E,"pins",y.statuses,y.next);case PIN_SUCCESS:return prependOneToList(E,"pins",y.status);case UNPIN_SUCCESS:return removeOneFromList(E,"pins",y.status);case SCHEDULED_STATUSES_FETCH_REQUEST:case SCHEDULED_STATUSES_EXPAND_REQUEST:return setLoading$1(E,"scheduled_statuses",!0);case SCHEDULED_STATUSES_FETCH_FAIL:case SCHEDULED_STATUSES_EXPAND_FAIL:return setLoading$1(E,"scheduled_statuses",!1);case SCHEDULED_STATUSES_FETCH_SUCCESS:return normalizeList$1(E,"scheduled_statuses",y.statuses,y.next);case SCHEDULED_STATUSES_EXPAND_SUCCESS:return appendToList$1(E,"scheduled_statuses",y.statuses,y.next);case SCHEDULED_STATUS_CANCEL_REQUEST:case SCHEDULED_STATUS_CANCEL_SUCCESS:return removeOneFromList(E,"scheduled_statuses",y.id||y.status.id);case STATUS_QUOTES_FETCH_REQUEST:case STATUS_QUOTES_EXPAND_REQUEST:return setLoading$1(E,`quotes:${y.statusId}`,!0);case STATUS_QUOTES_FETCH_FAIL:case STATUS_QUOTES_EXPAND_FAIL:return setLoading$1(E,`quotes:${y.statusId}`,!1);case STATUS_QUOTES_FETCH_SUCCESS:return normalizeList$1(E,`quotes:${y.statusId}`,y.statuses,y.next);case STATUS_QUOTES_EXPAND_SUCCESS:return appendToList$1(E,`quotes:${y.statusId}`,y.statuses,y.next);case RECENT_EVENTS_FETCH_REQUEST:return setLoading$1(E,"recent_events",!0);case RECENT_EVENTS_FETCH_FAIL:return setLoading$1(E,"recent_events",!1);case RECENT_EVENTS_FETCH_SUCCESS:return normalizeList$1(E,"recent_events",y.statuses,y.next);case JOINED_EVENTS_FETCH_REQUEST:return setLoading$1(E,"joined_events",!0);case JOINED_EVENTS_FETCH_FAIL:return setLoading$1(E,"joined_events",!1);case JOINED_EVENTS_FETCH_SUCCESS:return normalizeList$1(E,"joined_events",y.statuses,y.next);case STATUS_CREATE_SUCCESS:return maybeAppendScheduledStatus(E,y.status);default:return E}}const ALLOWED_EMOJI=List(["👍","❤️","😆","😮","😢","😩"]),sortEmoji=(E,y)=>E.sortBy(R=>-((R.count||0)+Number(y.includes(R.name)))),mergeEmojiFavourites=(E,y,R)=>{if(!E)return List([emojiReactionSchema.parse({count:y,me:R,name:"👍"})]);if(!y)return E;const k=E.findIndex(H=>H.name==="👍");if(k>-1){const H=Number(E.getIn([k,"count"]));return R=R||!!E.getIn([k,"me"],!1),E.setIn([k,"count"],H+y).setIn([k,"me"],R)}else return E.push(emojiReactionSchema.parse({count:y,me:R,name:"👍"}))},reduceEmoji=(E,y,R,k=ALLOWED_EMOJI)=>sortEmoji(mergeEmojiFavourites(E,y,R),k),getReactForStatus=(E,y=ALLOWED_EMOJI)=>{if(!E.reactions)return;const R=reduceEmoji(E.reactions,E.favourites_count||0,E.favourited,y).filter(k=>k.me===!0).get(0);return typeof(R==null?void 0:R.name)=="string"?R:void 0},simulateEmojiReact=(E,y,R)=>{const k=E.findIndex(B=>B.name===y),H=E.get(k);return k>-1&&H?E.set(k,emojiReactionSchema.parse({...H,count:(H.count||0)+1,me:!0,url:R})):E.push(emojiReactionSchema.parse({count:1,me:!0,name:y,url:R}))},simulateUnEmojiReact=(E,y)=>{const R=E.findIndex(H=>H.name===y&&H.me===!0),k=E.get(R);return k?(k.count||1)-1<1?E.delete(R):E.set(R,emojiReactionSchema.parse({...k,count:(k.count||1)-1,me:!1})):E},EMOJI_REACT_REQUEST="EMOJI_REACT_REQUEST",EMOJI_REACT_SUCCESS="EMOJI_REACT_SUCCESS",EMOJI_REACT_FAIL="EMOJI_REACT_FAIL",UNEMOJI_REACT_REQUEST="UNEMOJI_REACT_REQUEST",UNEMOJI_REACT_SUCCESS="UNEMOJI_REACT_SUCCESS",UNEMOJI_REACT_FAIL="UNEMOJI_REACT_FAIL",noOp=()=>()=>new Promise(E=>E(void 0)),simpleEmojiReact=(E,y,R)=>k=>{const H=E.reactions||List();return y==="👍"&&E.favourited?k(unfavourite(E)):H.filter(te=>te.me===!0&&te.name===y).count()>0?k(unEmojiReact(E,y)):Promise.all([...H.filter(te=>te.me===!0).map(te=>k(unEmojiReact(E,te.name))).toArray(),E.favourited&&k(unfavourite(E))]).then(()=>{k(y==="👍"?favourite(E):emojiReact(E,y,R))}).catch(te=>{console.error(te)})},emojiReact=(E,y,R)=>(k,H)=>isLoggedIn(H)?(k(emojiReactRequest(E,y,R)),api(H).put(`/api/v1/pleroma/statuses/${E.id}/reactions/${y}`).then(B=>B.json()).then(B=>{k(importFetchedStatus(B)),k(emojiReactSuccess(E,y))}).catch(B=>{k(emojiReactFail(E,y,B))})):k(noOp()),unEmojiReact=(E,y)=>(R,k)=>isLoggedIn(k)?(R(unEmojiReactRequest(E,y)),api(k).delete(`/api/v1/pleroma/statuses/${E.id}/reactions/${y}`).then(H=>H.json()).then(H=>{R(importFetchedStatus(H)),R(unEmojiReactSuccess(E,y))}).catch(H=>{R(unEmojiReactFail(E,y,H))})):R(noOp()),emojiReactRequest=(E,y,R)=>({type:EMOJI_REACT_REQUEST,status:E,emoji:y,custom:R,skipLoading:!0}),emojiReactSuccess=(E,y)=>({type:EMOJI_REACT_SUCCESS,status:E,emoji:y,skipLoading:!0}),emojiReactFail=(E,y,R)=>({type:EMOJI_REACT_FAIL,status:E,emoji:y,error:R,skipLoading:!0}),unEmojiReactRequest=(E,y)=>({type:UNEMOJI_REACT_REQUEST,status:E,emoji:y,skipLoading:!0}),unEmojiReactSuccess=(E,y)=>({type:UNEMOJI_REACT_SUCCESS,status:E,emoji:y,skipLoading:!0}),unEmojiReactFail=(E,y,R)=>({type:UNEMOJI_REACT_FAIL,status:E,emoji:y,error:R,skipLoading:!0}),domParser=new DOMParser,minifyStatus=E=>E.mergeWith((y,R)=>R||y,{reblog:normalizeId$1(E.getIn(["reblog","id"])),poll:normalizeId$1(E.getIn(["poll","id"])),quote:normalizeId$1(E.getIn(["quote","id"]))}),getPollOptionTitles=({poll:E})=>E&&typeof E=="object"?E.options.map(({title:y})=>y):[],getMentionedUsernames=E=>E.mentions.map(({acct:y})=>`@${y}`),buildSearchContent=E=>{const y=getPollOptionTitles(E),R=getMentionedUsernames(E),k=List([E.spoiler_text,E.content]).concat(y).concat(R);return htmlToPlaintext(k.join(` `))||""},calculateStatus=(E,y=!1)=>{const R=buildSearchContent(E);return E.merge({search_index:domParser.parseFromString(R,"text/html").documentElement.textContent||"",content:DOMPurify.sanitize(stripCompatibilityFeatures(E.content),{USE_PROFILES:{html:!0}}),hidden:y?!1:E.spoiler_text.length>0||E.sensitive})},isQuote=E=>!!E.pleroma.get("quote_url"),fixTranslation=(E,y)=>y!=null&&y.translation&&!E.translation?E.set("translation",y.translation):E,fixQuote=(E,y)=>y&&!E.quote&&isQuote(E)?E.set("quote",y.quote).updateIn(["pleroma","quote_visible"],R=>R||y.pleroma.get("quote_visible")):E,fixStatus=(E,y,R)=>{const k=E.get(y.id);return normalizeStatus(y).withMutations(H=>{fixTranslation(H,k),fixQuote(H,k),calculateStatus(H,R),minifyStatus(H)})},importStatus$1=(E,y,R)=>E.set(y.id,fixStatus(E,y,R)),importStatuses$1=(E,y,R)=>E.withMutations(k=>y.forEach(H=>importStatus$1(k,H,R))),deleteStatus$1=(E,y,R)=>(R.forEach(k=>{E=deleteStatus$1(E,k[0],[])}),E.delete(y)),incrementReplyCount=(E,{in_reply_to_id:y})=>y?E.updateIn([y,"replies_count"],0,R=>typeof R=="number"?R+1:0):E,decrementReplyCount=(E,{in_reply_to_id:y})=>y?E.updateIn([y,"replies_count"],0,R=>typeof R=="number"?Math.max(0,R-1):0):E,simulateFavourite=(E,y,R)=>{const k=E.get(y);if(!k)return E;const H=R?1:-1,B=k.merge({favourited:R,favourites_count:Math.max(0,k.favourites_count+H)});return E.set(y,B)},simulateDislike=(E,y,R)=>{const k=E.get(y);if(!k)return E;const H=R?1:-1,B=k.merge({disliked:R,dislikes_count:Math.max(0,k.dislikes_count+H)});return E.set(y,B)},simulatePayment=(E,y,R)=>{const k=E.get(y);if(!k)return E;const H=k.merge({zapped:R});return E.set(y,H)},importTranslation=(E,y,R)=>{const k=Map$1(R),H=k.set("content",stripCompatibilityFeatures(k.get("content","")));return E.setIn([y,"translation"],H)},deleteTranslation=(E,y)=>E.deleteIn([y,"translation"]),initialState$3=Map$1();function statuses(E=initialState$3,y){switch(y.type){case STATUS_IMPORT:return importStatus$1(E,y.status,y.expandSpoilers);case STATUSES_IMPORT:return importStatuses$1(E,y.statuses,y.expandSpoilers);case STATUS_CREATE_REQUEST:return y.editing?E:incrementReplyCount(E,y.params);case STATUS_CREATE_FAIL:return y.editing?E:decrementReplyCount(E,y.params);case FAVOURITE_REQUEST:return simulateFavourite(E,y.status.id,!0);case UNFAVOURITE_REQUEST:return simulateFavourite(E,y.status.id,!1);case DISLIKE_REQUEST:return simulateDislike(E,y.status.id,!0);case UNDISLIKE_REQUEST:return simulateDislike(E,y.status.id,!1);case EMOJI_REACT_REQUEST:return E.updateIn([y.status.id,"reactions"],R=>simulateEmojiReact(R,y.emoji,y.custom));case UNEMOJI_REACT_REQUEST:return E.updateIn([y.status.id,"reactions"],R=>simulateUnEmojiReact(R,y.emoji));case FAVOURITE_FAIL:return E.get(y.status.id)===void 0?E:E.setIn([y.status.id,"favourited"],!1);case DISLIKE_FAIL:return E.get(y.status.id)===void 0?E:E.setIn([y.status.id,"disliked"],!1);case ZAP_REQUEST:return simulatePayment(E,y.status.id,!0);case ZAP_FAIL:return simulatePayment(E,y.status.id,!1);case REBLOG_REQUEST:return E.setIn([y.status.id,"reblogged"],!0);case REBLOG_FAIL:return E.get(y.status.id)===void 0?E:E.setIn([y.status.id,"reblogged"],!1);case UNREBLOG_REQUEST:return E.setIn([y.status.id,"reblogged"],!1);case UNREBLOG_FAIL:return E.get(y.status.id)===void 0?E:E.setIn([y.status.id,"reblogged"],!0);case STATUS_MUTE_SUCCESS:return E.setIn([y.id,"muted"],!0);case STATUS_UNMUTE_SUCCESS:return E.setIn([y.id,"muted"],!1);case STATUS_REVEAL:return E.withMutations(R=>{y.ids.forEach(k=>{E.get(k)!==void 0&&R.setIn([k,"hidden"],!1)})});case STATUS_HIDE:return E.withMutations(R=>{y.ids.forEach(k=>{E.get(k)!==void 0&&R.setIn([k,"hidden"],!0)})});case STATUS_DELETE_REQUEST:return decrementReplyCount(E,y.params);case STATUS_DELETE_FAIL:return incrementReplyCount(E,y.params);case STATUS_TRANSLATE_SUCCESS:return importTranslation(E,y.id,y.translation);case STATUS_TRANSLATE_UNDO:return deleteTranslation(E,y.id);case STATUS_UNFILTER:return E.setIn([y.id,"showFiltered"],!1);case TIMELINE_DELETE:return deleteStatus$1(E,y.id,y.references);case EVENT_JOIN_REQUEST:return E.setIn([y.id,"event","join_state"],"pending");case EVENT_JOIN_FAIL:case EVENT_LEAVE_REQUEST:return E.setIn([y.id,"event","join_state"],null);case EVENT_LEAVE_FAIL:return E.setIn([y.id,"event","join_state"],y.previousState);default:return E}}const SUGGESTIONS_FETCH_REQUEST="SUGGESTIONS_FETCH_REQUEST",SUGGESTIONS_FETCH_SUCCESS="SUGGESTIONS_FETCH_SUCCESS",SUGGESTIONS_FETCH_FAIL="SUGGESTIONS_FETCH_FAIL",SUGGESTIONS_DISMISS="SUGGESTIONS_DISMISS",SUGGESTIONS_V2_FETCH_REQUEST="SUGGESTIONS_V2_FETCH_REQUEST",SUGGESTIONS_V2_FETCH_SUCCESS="SUGGESTIONS_V2_FETCH_SUCCESS",SUGGESTIONS_V2_FETCH_FAIL="SUGGESTIONS_V2_FETCH_FAIL",fetchSuggestionsForTimeline=()=>(E,y)=>{E(insertSuggestionsIntoTimeline())},SuggestionRecord=Record({source:"",account:""}),ReducerRecord$3=Record({items:OrderedSet(),next:null,isLoading:!1}),accountToSuggestion=E=>({source:"past_interactions",account:E.id}),importAccounts=(E,y)=>E.withMutations(R=>{R.set("items",OrderedSet(y.map(accountToSuggestion).map(k=>SuggestionRecord(k)))),R.set("isLoading",!1)}),importSuggestions=(E,y,R)=>E.withMutations(k=>{k.update("items",H=>H.concat(y.map(B=>({...B,account:B.account.id})).map(B=>SuggestionRecord(B)))),k.set("isLoading",!1),k.set("next",R)}),dismissAccount=(E,y)=>E.update("items",R=>R.filterNot(k=>k.account===y)),dismissAccounts=(E,y)=>E.update("items",R=>R.filterNot(k=>y.includes(k.account)));function suggestionsReducer(E=ReducerRecord$3(),y){switch(y.type){case SUGGESTIONS_FETCH_REQUEST:case SUGGESTIONS_V2_FETCH_REQUEST:return E.set("isLoading",!0);case SUGGESTIONS_FETCH_SUCCESS:return importAccounts(E,y.accounts);case SUGGESTIONS_V2_FETCH_SUCCESS:return importSuggestions(E,y.suggestions,y.next);case SUGGESTIONS_FETCH_FAIL:case SUGGESTIONS_V2_FETCH_FAIL:return E.set("isLoading",!1);case SUGGESTIONS_DISMISS:return dismissAccount(E,y.id);case ACCOUNT_BLOCK_SUCCESS:case ACCOUNT_MUTE_SUCCESS:return dismissAccount(E,y.relationship.id);case DOMAIN_BLOCK_SUCCESS:return dismissAccounts(E,y.accounts);default:return E}}const initialState$2=Map$1();function tags(E=initialState$2,y){switch(y.type){case HASHTAG_FETCH_SUCCESS:return E.set(y.name,normalizeTag(y.tag));case HASHTAG_FOLLOW_REQUEST:case HASHTAG_UNFOLLOW_FAIL:return E.setIn([y.name,"following"],!0);case HASHTAG_FOLLOW_FAIL:case HASHTAG_UNFOLLOW_REQUEST:return E.setIn([y.name,"following"],!1);default:return E}}const TRUNCATE_LIMIT=40,TRUNCATE_SIZE=20,TimelineRecord=Record({unread:0,online:!1,top:!0,isLoading:!1,hasMore:!0,next:void 0,prev:void 0,items:OrderedSet(),queuedItems:OrderedSet(),totalQueuedItemsCount:0,loadingFailed:!1,isPartial:!1}),initialState$1=Map$1(),getStatusIds=(E=List())=>E.map(y=>y.get("id")).toOrderedSet(),mergeStatusIds=(E=OrderedSet(),y=OrderedSet())=>y.union(E),addStatusId=(E=OrderedSet(),y)=>mergeStatusIds(E,OrderedSet([y])),truncate=(E,y,R)=>E.size>y?E.take(R):E,truncateIds=E=>truncate(E,TRUNCATE_LIMIT,TRUNCATE_SIZE),setLoading=(E,y,R)=>E.update(y,TimelineRecord(),k=>k.set("isLoading",R)),setFailed=(E,y,R)=>E.update(y,TimelineRecord(),k=>k.set("loadingFailed",R)),expandNormalizedTimeline=(E,y,R,k,H,B,te,ae="end")=>{const ce=getStatusIds(R);return E.update(y,TimelineRecord(),Ce=>Ce.withMutations(Oe=>{if(Oe.set("isLoading",!1),Oe.set("loadingFailed",!1),Oe.set("isPartial",B),Oe.set("next",k),Oe.set("prev",H),!k&&!te&&Oe.set("hasMore",!1),y.endsWith(":pinned")){Oe.set("items",ce);return}ce.isEmpty()||Oe.update("items",Le=>ae==="end"?mergeStatusIds(ce,Le):mergeStatusIds(Le,ce))}))},updateTimeline=(E,y,R)=>{var ae,ce,Ce;const k=(ae=E.get(y))==null?void 0:ae.top,H=((ce=E.get(y))==null?void 0:ce.items)||OrderedSet(),B=((Ce=E.get(y))==null?void 0:Ce.unread)||0;if(H.includes(R))return E;const te=addStatusId(H,R);return E.update(y,TimelineRecord(),Oe=>Oe.withMutations(Le=>{k?Le.set("items",truncateIds(te)):(Le.set("unread",B+1),Le.set("items",te))}))},updateTimelineQueue=(E,y,R)=>{var te,ae,ce;const k=((te=E.get(y))==null?void 0:te.queuedItems)||OrderedSet(),H=((ae=E.get(y))==null?void 0:ae.items)||OrderedSet(),B=((ce=E.get(y))==null?void 0:ce.totalQueuedItemsCount)||0;return k.includes(R)||H.includes(R)?E:E.update(y,TimelineRecord(),Ce=>Ce.withMutations(Oe=>{Oe.set("totalQueuedItemsCount",B+1),Oe.set("queuedItems",addStatusId(k,R).take(MAX_QUEUED_ITEMS))}))},shouldDelete=(E,y)=>y?!(E===`account:${y}`||E.startsWith(`account:${y}:`)):!0,deleteStatus=(E,y,R,k,H)=>E.withMutations(B=>{B.keySeq().forEach(te=>{shouldDelete(te,H)&&(B.updateIn([te,"items"],ae=>ae.delete(y)),B.updateIn([te,"queuedItems"],ae=>ae.delete(y)))}),k.forEach(te=>{deleteStatus(B,te[0],te[1],[],H)})}),clearTimeline=(E,y)=>E.set(y,TimelineRecord()),updateTop=(E,y,R)=>E.update(y,TimelineRecord(),k=>k.withMutations(H=>{R&&H.set("unread",0),H.set("top",R)})),isReblogOf=(E,y)=>E.reblog===y.id,statusToReference=E=>[E.id,E.account],buildReferencesTo=(E,y)=>E.filter(R=>isReblogOf(R,y)).map(statusToReference),filterTimelines=(E,y,R)=>E.withMutations(k=>{R.forEach(H=>{if(H.account!==y.id)return;const B=buildReferencesTo(R,H);deleteStatus(k,H.id,H.account.id,B,y.id)})}),timelineDequeue=(E,y)=>{const R=E.getIn([y,"top"]);return E.update(y,TimelineRecord(),k=>k.withMutations(H=>{const B=H.queuedItems;H.update("items",te=>{const ae=mergeStatusIds(te,B);return R?truncateIds(ae):ae}),H.set("queuedItems",OrderedSet()),H.set("totalQueuedItemsCount",0)}))},timelineConnect=(E,y)=>E.update(y,TimelineRecord(),R=>R.set("online",!0)),timelineDisconnect=(E,y)=>E.update(y,TimelineRecord(),R=>R.withMutations(k=>{k.set("online",!1),k.get("items",OrderedSet()).isEmpty()})),getTimelinesForStatus=E=>{var y;switch(E.visibility){case"group":return[`group:${((y=E.group)==null?void 0:y.id)||E.group_id}`];case"direct":return["direct"];case"public":return["home","community","public"];default:return["home"]}},replaceId=(E,y,R)=>{const k=List(E),H=k.indexOf(y);return H>-1?OrderedSet(k.set(H,R)):E},importPendingStatus=(E,y,R)=>{const k=`末pending-${R}`;return E.withMutations(H=>{getTimelinesForStatus(y).forEach(te=>{updateTimelineQueue(H,te,k)})})},replacePendingStatus=(E,y,R)=>{const k=`末pending-${y}`;return E.withMutations(H=>{H.keySeq().forEach(B=>{H.updateIn([B,"items"],te=>replaceId(te,k,R)),H.updateIn([B,"queuedItems"],te=>replaceId(te,k,R))})})},importStatus=(E,y,R)=>E.withMutations(k=>{replacePendingStatus(k,R,y.id),getTimelinesForStatus(y).forEach(B=>{updateTimeline(k,B,y.id)})}),handleExpandFail=(E,y)=>E.withMutations(R=>{setLoading(R,y,!1),setFailed(R,y,!0)});function timelines(E=initialState$1,y){switch(y.type){case STATUS_CREATE_REQUEST:return y.params.scheduled_at?E:importPendingStatus(E,y.params,y.idempotencyKey);case STATUS_CREATE_SUCCESS:return y.status.scheduled_at||y.editing?E:importStatus(E,y.status,y.idempotencyKey);case TIMELINE_EXPAND_REQUEST:return setLoading(E,y.timeline,!0);case TIMELINE_EXPAND_FAIL:return handleExpandFail(E,y.timeline);case TIMELINE_EXPAND_SUCCESS:return expandNormalizedTimeline(E,y.timeline,fromJS(y.statuses),y.next,y.prev,y.partial,y.isLoadingRecent);case TIMELINE_UPDATE:return updateTimeline(E,y.timeline,y.statusId);case TIMELINE_UPDATE_QUEUE:return updateTimelineQueue(E,y.timeline,y.statusId);case TIMELINE_DEQUEUE:return timelineDequeue(E,y.timeline);case TIMELINE_DELETE:return deleteStatus(E,y.id,y.accountId,y.references,y.reblogOf);case TIMELINE_CLEAR:return clearTimeline(E,y.timeline);case ACCOUNT_BLOCK_SUCCESS:case ACCOUNT_MUTE_SUCCESS:return filterTimelines(E,y.relationship,y.statuses);case TIMELINE_SCROLL_TOP:return updateTop(E,y.timeline,y.top);case TIMELINE_CONNECT:return timelineConnect(E,y.timeline);case TIMELINE_DISCONNECT:return timelineDisconnect(E,y.timeline);case TIMELINE_INSERT:return E.update(y.timeline,TimelineRecord(),R=>R.withMutations(k=>{k.update("items",H=>{let B=H.toArray();B.find(ce=>ce.includes("末suggestions"))&&(B=B.slice(1));const ae=sample([5,6,7,8,9]);return H.last()&&B.splice(ae,0,`末suggestions-${H.last()}`),OrderedSet(B)})}));default:return E}}const TRENDING_STATUSES_FETCH_REQUEST="TRENDING_STATUSES_FETCH_REQUEST",TRENDING_STATUSES_FETCH_SUCCESS="TRENDING_STATUSES_FETCH_SUCCESS",TRENDING_STATUSES_FETCH_FAIL="TRENDING_STATUSES_FETCH_FAIL",TRENDING_STATUSES_EXPAND_FAIL="TRENDING_STATUSES_EXPAND_FAIL",TRENDING_STATUSES_EXPAND_SUCCESS="TRENDING_STATUSES_EXPAND_SUCCESS",fetchTrendingStatuses=()=>(E,y)=>{const k=y().instance;if(getFeatures(k).trendingStatuses)return E({type:TRENDING_STATUSES_FETCH_REQUEST}),api(y).get("/api/v1/trends/statuses").then(async B=>{const te=B.next(),ce=await B.json();return E(importFetchedStatuses(ce)),E(fetchTrendingStatusesSuccess(ce,te)),ce}).catch(B=>{E(fetchTrendingStatusesFail(B))})},fetchTrendingStatusesSuccess=(E,y)=>({type:TRENDING_STATUSES_FETCH_SUCCESS,statuses:E,next:y}),fetchTrendingStatusesFail=E=>({type:TRENDING_STATUSES_FETCH_FAIL,error:E}),expandTrendingStatuses=E=>(y,R)=>{api(R).get(E).then(async k=>{const H=k.next(),te=await k.json();y(importFetchedStatuses(te)),y(expandTrendingStatusesSuccess(te,H))}).catch(k=>{y(expandTrendingStatusesFail(k))})},expandTrendingStatusesSuccess=(E,y)=>({type:TRENDING_STATUSES_EXPAND_SUCCESS,statuses:E,next:y}),expandTrendingStatusesFail=E=>({type:TRENDING_STATUSES_EXPAND_FAIL,error:E}),ReducerRecord$2=Record({items:OrderedSet(),isLoading:!1,next:null}),toIds=E=>OrderedSet(E.map(y=>y.id)),importStatuses=(E,y,R)=>E.withMutations(k=>{k.update("items",H=>H.concat(toIds(y))),k.set("isLoading",!1),k.set("next",R||null)});function trending_statuses(E=ReducerRecord$2(),y){switch(y.type){case TRENDING_STATUSES_FETCH_REQUEST:return E.set("isLoading",!0);case TRENDING_STATUSES_EXPAND_SUCCESS:case TRENDING_STATUSES_FETCH_SUCCESS:return importStatuses(E,y.statuses,y.next);default:return E}}const TRENDS_FETCH_REQUEST="TRENDS_FETCH_REQUEST",TRENDS_FETCH_SUCCESS="TRENDS_FETCH_SUCCESS",TRENDS_FETCH_FAIL="TRENDS_FETCH_FAIL",fetchTrendsSuccess=E=>({type:TRENDS_FETCH_SUCCESS,tags:E,skipLoading:!0}),ReducerRecord$1=Record({items:List(),isLoading:!1});function trendsReducer(E=ReducerRecord$1(),y){switch(y.type){case TRENDS_FETCH_REQUEST:return E.set("isLoading",!0);case TRENDS_FETCH_SUCCESS:return E.withMutations(R=>{R.set("items",List(y.tags.map(k=>normalizeTag(k)))),R.set("isLoading",!1)});case TRENDS_FETCH_FAIL:return E.set("isLoading",!1);default:return E}}const BLOCKS_FETCH_SUCCESS="BLOCKS_FETCH_SUCCESS",BLOCKS_EXPAND_SUCCESS="BLOCKS_EXPAND_SUCCESS",DIRECTORY_FETCH_REQUEST="DIRECTORY_FETCH_REQUEST",DIRECTORY_FETCH_SUCCESS="DIRECTORY_FETCH_SUCCESS",DIRECTORY_FETCH_FAIL="DIRECTORY_FETCH_FAIL",DIRECTORY_EXPAND_REQUEST="DIRECTORY_EXPAND_REQUEST",DIRECTORY_EXPAND_SUCCESS="DIRECTORY_EXPAND_SUCCESS",DIRECTORY_EXPAND_FAIL="DIRECTORY_EXPAND_FAIL",fetchDirectory=E=>(y,R)=>{y(fetchDirectoryRequest()),api(R).get("/api/v1/directory",{searchParams:{...E,limit:20}}).then(k=>k.json()).then(k=>{y(importFetchedAccounts(k)),y(fetchDirectorySuccess(k)),y(fetchRelationships(k.map(H=>H.id)))}).catch(k=>y(fetchDirectoryFail(k)))},fetchDirectoryRequest=()=>({type:DIRECTORY_FETCH_REQUEST}),fetchDirectorySuccess=E=>({type:DIRECTORY_FETCH_SUCCESS,accounts:E}),fetchDirectoryFail=E=>({type:DIRECTORY_FETCH_FAIL,error:E}),expandDirectory=E=>(y,R)=>{y(expandDirectoryRequest());const k=R().user_lists.directory.items.size;api(R).get("/api/v1/directory",{searchParams:{...E,offset:k,limit:20}}).then(H=>H.json()).then(H=>{y(importFetchedAccounts(H)),y(expandDirectorySuccess(H)),y(fetchRelationships(H.map(B=>B.id)))}).catch(H=>y(expandDirectoryFail(H)))},expandDirectoryRequest=()=>({type:DIRECTORY_EXPAND_REQUEST}),expandDirectorySuccess=E=>({type:DIRECTORY_EXPAND_SUCCESS,accounts:E}),expandDirectoryFail=E=>({type:DIRECTORY_EXPAND_FAIL,error:E}),FAMILIAR_FOLLOWERS_FETCH_REQUEST="FAMILIAR_FOLLOWERS_FETCH_REQUEST",FAMILIAR_FOLLOWERS_FETCH_SUCCESS="FAMILIAR_FOLLOWERS_FETCH_SUCCESS",FAMILIAR_FOLLOWERS_FETCH_FAIL="FAMILIAR_FOLLOWERS_FETCH_FAIL",fetchAccountFamiliarFollowers=E=>(y,R)=>{y({type:FAMILIAR_FOLLOWERS_FETCH_REQUEST,id:E}),api(R).get(`/api/v1/accounts/familiar_followers?id[]=${E}`).then(k=>k.json()).then(k=>{const H=k.find(({id:B})=>B===E).accounts;y(importFetchedAccounts(H)),y(fetchRelationships(H.map(B=>B.id))),y({type:FAMILIAR_FOLLOWERS_FETCH_SUCCESS,id:E,accounts:H})}).catch(k=>y({type:FAMILIAR_FOLLOWERS_FETCH_FAIL,id:E,error:k,skipAlert:!0}))},ListRecord=Record({next:null,items:OrderedSet(),isLoading:!1}),ReactionRecord=Record({accounts:OrderedSet(),count:0,name:"",url:null}),ReactionListRecord=Record({next:null,items:OrderedSet(),isLoading:!1}),ZapRecord=Record({account:"",comment:"",amount:0}),ZapListRecord=Record({next:null,items:List(),isLoading:!1}),ParticipationRequestRecord=Record({account:"",participation_message:null}),ParticipationRequestListRecord=Record({next:null,items:OrderedSet(),isLoading:!1}),ReducerRecord=Record({followers:Map$1(),following:Map$1(),reblogged_by:Map$1(),favourited_by:Map$1(),disliked_by:Map$1(),reactions:Map$1(),zapped_by:Map$1(),follow_requests:ListRecord(),blocks:ListRecord(),mutes:ListRecord(),directory:ListRecord({isLoading:!0}),pinned:Map$1(),birthday_reminders:Map$1(),familiar_followers:Map$1(),event_participations:Map$1(),event_participation_requests:Map$1(),membership_requests:Map$1(),group_blocks:Map$1()}),normalizeList=(E,y,R,k)=>E.setIn(y,ListRecord({next:k,items:OrderedSet(R.map(H=>H.id))})),appendToList=(E,y,R,k)=>E.updateIn(y,H=>H.set("next",k).set("isLoading",!1).update("items",B=>B.concat(R.map(te=>te.id)))),removeFromList=(E,y,R)=>E.updateIn(y,k=>k.update("items",H=>H.filterNot(B=>B===R))),normalizeFollowRequest=(E,y)=>E.updateIn(["follow_requests","items"],R=>OrderedSet([y.account.id]).union(R));function userLists(E=ReducerRecord(),y){switch(y.type){case FOLLOWERS_FETCH_SUCCESS:return normalizeList(E,["followers",y.id],y.accounts,y.next);case FOLLOWERS_EXPAND_SUCCESS:return appendToList(E,["followers",y.id],y.accounts,y.next);case FOLLOWING_FETCH_SUCCESS:return normalizeList(E,["following",y.id],y.accounts,y.next);case FOLLOWING_EXPAND_SUCCESS:return appendToList(E,["following",y.id],y.accounts,y.next);case REBLOGS_FETCH_SUCCESS:return normalizeList(E,["reblogged_by",y.id],y.accounts,y.next);case REBLOGS_EXPAND_SUCCESS:return appendToList(E,["reblogged_by",y.id],y.accounts,y.next);case FAVOURITES_FETCH_SUCCESS:return normalizeList(E,["favourited_by",y.id],y.accounts,y.next);case FAVOURITES_EXPAND_SUCCESS:return appendToList(E,["favourited_by",y.id],y.accounts,y.next);case DISLIKES_FETCH_SUCCESS:return normalizeList(E,["disliked_by",y.id],y.accounts);case REACTIONS_FETCH_SUCCESS:return E.setIn(["reactions",y.id],ReactionListRecord({items:OrderedSet(y.reactions.map(({accounts:R,...k})=>ReactionRecord({...k,accounts:OrderedSet(R.map(H=>H.id))})))}));case ZAPS_FETCH_SUCCESS:return E.setIn(["zapped_by",y.id],ZapListRecord({items:List(y.zaps.map(({account:R,...k})=>ZapRecord({...k,account:R.id}))),next:y.next}));case ZAPS_EXPAND_SUCCESS:return E.updateIn(["zapped_by",y.id],R=>R.set("next",y.next).set("isLoading",!1).update("items",k=>k.concat(List(y.zaps.map(({account:H,...B})=>ZapRecord({...B,account:H.id}))))));case NOTIFICATIONS_UPDATE:return y.notification.type==="follow_request"?normalizeFollowRequest(E,y.notification):E;case FOLLOW_REQUESTS_FETCH_SUCCESS:return normalizeList(E,["follow_requests"],y.accounts,y.next);case FOLLOW_REQUESTS_EXPAND_SUCCESS:return appendToList(E,["follow_requests"],y.accounts,y.next);case FOLLOW_REQUEST_AUTHORIZE_SUCCESS:case FOLLOW_REQUEST_REJECT_SUCCESS:return removeFromList(E,["follow_requests"],y.id);case BLOCKS_FETCH_SUCCESS:return normalizeList(E,["blocks"],y.accounts,y.next);case BLOCKS_EXPAND_SUCCESS:return appendToList(E,["blocks"],y.accounts,y.next);case DIRECTORY_FETCH_SUCCESS:return normalizeList(E,["directory"],y.accounts,y.next);case DIRECTORY_EXPAND_SUCCESS:return appendToList(E,["directory"],y.accounts,y.next);case DIRECTORY_FETCH_REQUEST:case DIRECTORY_EXPAND_REQUEST:return E.setIn(["directory","isLoading"],!0);case DIRECTORY_FETCH_FAIL:case DIRECTORY_EXPAND_FAIL:return E.setIn(["directory","isLoading"],!1);case PINNED_ACCOUNTS_FETCH_SUCCESS:return normalizeList(E,["pinned",y.id],y.accounts,y.next);case BIRTHDAY_REMINDERS_FETCH_SUCCESS:return normalizeList(E,["birthday_reminders",y.id],y.accounts,y.next);case FAMILIAR_FOLLOWERS_FETCH_SUCCESS:return normalizeList(E,["familiar_followers",y.id],y.accounts,y.next);case EVENT_PARTICIPATIONS_FETCH_SUCCESS:return normalizeList(E,["event_participations",y.id],y.accounts,y.next);case EVENT_PARTICIPATIONS_EXPAND_SUCCESS:return appendToList(E,["event_participations",y.id],y.accounts,y.next);case EVENT_PARTICIPATION_REQUESTS_FETCH_SUCCESS:return E.setIn(["event_participation_requests",y.id],ParticipationRequestListRecord({next:y.next,items:OrderedSet(y.participations.map(({account:R,participation_message:k})=>ParticipationRequestRecord({account:R.id,participation_message:k})))}));case EVENT_PARTICIPATION_REQUESTS_EXPAND_SUCCESS:return E.updateIn(["event_participation_requests",y.id,"items"],R=>R.union(y.participations.map(({account:k,participation_message:H})=>ParticipationRequestRecord({account:k.id,participation_message:H}))));case EVENT_PARTICIPATION_REQUEST_AUTHORIZE_SUCCESS:case EVENT_PARTICIPATION_REQUEST_REJECT_SUCCESS:return E.updateIn(["event_participation_requests",y.id,"items"],R=>R.filter(({account:k})=>k!==y.accountId));case GROUP_MEMBERSHIP_REQUESTS_FETCH_SUCCESS:return normalizeList(E,["membership_requests",y.id],y.accounts,y.next);case GROUP_MEMBERSHIP_REQUESTS_EXPAND_SUCCESS:return appendToList(E,["membership_requests",y.id],y.accounts,y.next);case GROUP_MEMBERSHIP_REQUESTS_FETCH_REQUEST:case GROUP_MEMBERSHIP_REQUESTS_EXPAND_REQUEST:return E.setIn(["membership_requests",y.id,"isLoading"],!0);case GROUP_MEMBERSHIP_REQUESTS_FETCH_FAIL:case GROUP_MEMBERSHIP_REQUESTS_EXPAND_FAIL:return E.setIn(["membership_requests",y.id,"isLoading"],!1);case GROUP_MEMBERSHIP_REQUEST_AUTHORIZE_SUCCESS:case GROUP_MEMBERSHIP_REQUEST_REJECT_SUCCESS:return E.updateIn(["membership_requests",y.groupId,"items"],R=>R.filterNot(k=>k===y.accountId));case GROUP_BLOCKS_FETCH_SUCCESS:return normalizeList(E,["group_blocks",y.id],y.accounts,y.next);case GROUP_BLOCKS_EXPAND_SUCCESS:return appendToList(E,["group_blocks",y.id],y.accounts,y.next);case GROUP_BLOCKS_FETCH_REQUEST:case GROUP_BLOCKS_EXPAND_REQUEST:return E.setIn(["group_blocks",y.id,"isLoading"],!0);case GROUP_BLOCKS_FETCH_FAIL:case GROUP_BLOCKS_EXPAND_FAIL:return E.setIn(["group_blocks",y.id,"isLoading"],!1);case GROUP_UNBLOCK_SUCCESS:return E.updateIn(["group_blocks",y.groupId,"items"],R=>R.filterNot(k=>k===y.accountId));default:return E}}const appReducer=combineReducers({accounts_meta,admin,aliases:aliasesReducer,auth,backups,chat_message_lists:chatMessageLists,chat_messages:chatMessages,chats,compose,compose_event,contexts:replies,conversations,domain_lists:domainLists,dropdown_menu:dropdownMenu,entities:reducer$1,filters,followed_tags,group_memberships:groupMemberships,group_relationships:groupRelationships,groups,history,instance,listAdder:listAdderReducer,listEditor:listEditorReducer,lists,locations:accounts,me,meta,modals:modal,mutes,notifications,notificationsTab:notificationsTab$1,onboarding,patron,pending_statuses,polls,profile_hover_card:profileHoverCard,relationships,reports,scheduled_statuses,search,security,settings,sidebar,soapbox,status_hover_card:statusHoverCard,status_lists:statusLists,statuses,suggestions:suggestionsReducer,tags,timelines,trending_statuses,trends:trendsReducer,user_lists:userLists}),store=configureStore({reducer:appReducer,middleware:()=>new Tuple(thunk,errorsMiddleware(),soundsMiddleware()),devTools:!0}),RTL_LOCALES=["ar","ckb","fa","he"],useLocale=(E="en")=>{const y=useAppSelector(k=>getLocale(k,E)),R=RTL_LOCALES.includes(y)?"rtl":"ltr";return{locale:y,direction:R}},useSoapboxConfig=()=>useAppSelector(E=>getSoapboxConfig(E)),useSystemTheme=()=>{const E=window.matchMedia("(prefers-color-scheme: dark)"),[y,R]=reactExports.useState(E.matches),k=H=>{R(H.matches)};return reactExports.useEffect(()=>{try{E.addEventListener("change",k)}catch{}return()=>{try{E.removeEventListener("change",k)}catch{}}},[]),y?"dark":"light"},useTheme=()=>{const{themeMode:E}=useSettings(),y=useSystemTheme();return E==="system"?y:E},Helmet=reactExports.lazy(()=>__vitePreload(()=>import("./js/helmet-CLiZDYHd.js"),[])),SoapboxHead=({children:E})=>{const{locale:y,direction:R}=useLocale(),{demo:k,reduceMotion:H,underlineLinks:B,demetricator:te}=useSettings(),ae=useSoapboxConfig(),ce=useTheme(),Ce=generateThemeCss(k?normalizeSoapboxConfig({brandColor:"#0482d8"}):ae),Oe=ae.sentryDsn,Le=clsx("h-full bg-white text-base black:bg-black dark:bg-primary-900",{"no-reduce-motion":!H,"underline-links":B,demetricator:te,"font-sans":!0,"!font-arabic":["ar","fa"].includes(y),"!font-javanese":y==="jv"});return reactExports.useEffect(()=>{Oe&&startSentry(Oe).catch(console.error)},[Oe]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Helmet,{children:[jsxRuntimeExports.jsx("html",{lang:y,className:clsx("h-full",{dark:ce==="dark","dark black":ce==="black"})}),jsxRuntimeExports.jsx("body",{className:Le,dir:R}),Ce&&jsxRuntimeExports.jsx("style",{id:"theme",type:"text/css",children:`:root{${Ce}}`}),["dark","black"].includes(ce)&&jsxRuntimeExports.jsx("style",{type:"text/css",children:":root { color-scheme: dark; }"}),jsxRuntimeExports.jsx("meta",{name:"theme-color",content:ae.brandColor})]}),E]})},Spinner=({size:E=30,withText:y=!0})=>jsxRuntimeExports.jsxs(Stack,{space:2,justifyContent:"center",alignItems:"center",children:[jsxRuntimeExports.jsx("div",{className:"spinner",style:{width:E,height:E},children:Array.from(Array(12).keys()).map(R=>jsxRuntimeExports.jsx("div",{children:" "},R))}),y&&jsxRuntimeExports.jsx(Text,{theme:"muted",tracking:"wide",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"loading_indicator.label",defaultMessage:"Loading…"})})]}),LoadingScreen=()=>jsxRuntimeExports.jsx("div",{className:"fixed h-screen w-screen",children:jsxRuntimeExports.jsx("div",{className:"d-screen fixed z-10 flex w-screen items-center justify-center",children:jsxRuntimeExports.jsx("div",{className:"p-4",children:jsxRuntimeExports.jsx(Spinner,{size:40,withText:!1})})})});function useSigner(){const{connections:E}=useBunkerStore(),y=useAppSelector(({auth:ce})=>{var Oe;const Ce=ce.me?(Oe=ce.users[ce.me])==null?void 0:Oe.access_token:void 0;if(Ce)return E.find(Le=>Le.accessToken===Ce)}),{pubkey:R,bunkerPubkey:k,authorizedPubkey:H}=y??{},{data:B,...te}=useQuery({queryKey:["nostr","signer",R??""],queryFn:async()=>{if(!R)return null;const ce=keyring.get(R);return ce||(window.nostr&&await window.nostr.getPublicKey()===R?window.nostr:null)},enabled:!!R}),ae=reactExports.useMemo(()=>{if(k)return keyring.get(k)},[k]);return{signer:B??void 0,bunkerSigner:ae,authorizedPubkey:H,...te}}function useBunker(){const{relay:E}=useNostr(),{signer:y,bunkerSigner:R,authorizedPubkey:k}=useSigner();reactExports.useEffect(()=>{if(!E||!y||!R||!k)return;const H=new NBunker({relay:E,userSigner:y,bunkerSigner:R,onError(B,te){console.warn("Bunker error:",B,te)}});return H.authorize(k),()=>{H.close()}},[E,y,R,k])}const loadInitial=()=>async E=>{await E(fetchMe()),await E(fetchSoapboxConfig())},SoapboxLoad=({children:E})=>{const y=useAppDispatch(),R=useAppSelector(Be=>Be.me),{account:k}=useOwnAccount(),H=useInstance(),B=useAppSelector(Be=>Be.meta.swUpdating),{locale:te}=useLocale(),[ae,ce]=reactExports.useState({}),[Ce,Oe]=reactExports.useState(!0),[Le,Ne]=reactExports.useState(!1),Fe=useNostr(),Ue=useSigner(),De=!!(Fe.isRelayLoading||Ue.isLoading);useBunker();const $e=[R===null,R&&!k,!Le,Ce,H.isLoading,B,De].some(Boolean);return reactExports.useEffect(()=>{messages$5[te]().then(Be=>{ce(Be),Oe(!1)}).catch(()=>{})},[te]),reactExports.useEffect(()=>{!H.isLoading&&!De&&y(loadInitial()).then(()=>{Ne(!0)}).catch(Be=>{console.error(Be),Ne(!0)})},[H.isLoading,De]),$e?jsxRuntimeExports.jsx(LoadingScreen,{}):jsxRuntimeExports.jsx(IntlProvider,{locale:te,messages:ae,children:E})};/** * @remix-run/router v1.2.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(E){for(var y=1;y"u")throw new Error(y)}function parsePath(E){let y={};if(E){let R=E.indexOf("#");R>=0&&(y.hash=E.substr(R),E=E.substr(0,R));let k=E.indexOf("?");k>=0&&(y.search=E.substr(k),E=E.substr(0,k)),E&&(y.pathname=E)}return y}var ResultType;(function(E){E.data="data",E.deferred="deferred",E.redirect="redirect",E.error="error"})(ResultType||(ResultType={}));function matchRoutes(E,y,R){R===void 0&&(R="/");let k=typeof y=="string"?parsePath(y):y,H=stripBasename(k.pathname||"/",R);if(H==null)return null;let B=flattenRoutes(E);rankRouteBranches(B);let te=null;for(let ae=0;te==null&&ae{let ce={relativePath:ae===void 0?B.path||"":ae,caseSensitive:B.caseSensitive===!0,childrenIndex:te,route:B};ce.relativePath.startsWith("/")&&(invariant(ce.relativePath.startsWith(k),'Absolute route path "'+ce.relativePath+'" nested under path '+('"'+k+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),ce.relativePath=ce.relativePath.slice(k.length));let Ce=joinPaths([k,ce.relativePath]),Oe=R.concat(ce);B.children&&B.children.length>0&&(invariant(B.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+Ce+'".')),flattenRoutes(B.children,y,Oe,Ce)),!(B.path==null&&!B.index)&&y.push({path:Ce,score:computeScore(Ce,B.index),routesMeta:Oe})};return E.forEach((B,te)=>{var ae;if(B.path===""||!((ae=B.path)!=null&&ae.includes("?")))H(B,te);else for(let ce of explodeOptionalSegments(B.path))H(B,te,ce)}),y}function explodeOptionalSegments(E){let y=E.split("/");if(y.length===0)return[];let[R,...k]=y,H=R.endsWith("?"),B=R.replace(/\?$/,"");if(k.length===0)return H?[B,""]:[B];let te=explodeOptionalSegments(k.join("/")),ae=[];return ae.push(...te.map(ce=>ce===""?B:[B,ce].join("/"))),H&&ae.push(...te),ae.map(ce=>E.startsWith("/")&&ce===""?"/":ce)}function rankRouteBranches(E){E.sort((y,R)=>y.score!==R.score?R.score-y.score:compareIndexes(y.routesMeta.map(k=>k.childrenIndex),R.routesMeta.map(k=>k.childrenIndex)))}const paramRe=/^:\w+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=E=>E==="*";function computeScore(E,y){let R=E.split("/"),k=R.length;return R.some(isSplat)&&(k+=splatPenalty),y&&(k+=indexRouteValue),R.filter(H=>!isSplat(H)).reduce((H,B)=>H+(paramRe.test(B)?dynamicSegmentValue:B===""?emptySegmentValue:staticSegmentValue),k)}function compareIndexes(E,y){return E.length===y.length&&E.slice(0,-1).every((k,H)=>k===y[H])?E[E.length-1]-y[y.length-1]:0}function matchRouteBranch(E,y){let{routesMeta:R}=E,k={},H="/",B=[];for(let te=0;te{if(Oe==="*"){let Ne=ae[Le]||"";te=B.slice(0,B.length-Ne.length).replace(/(.)\/+$/,"$1")}return Ce[Oe]=safelyDecodeURIComponent(ae[Le]||"",Oe),Ce},{}),pathname:B,pathnameBase:te,pattern:E}}function compilePath(E,y,R){y===void 0&&(y=!1),R===void 0&&(R=!0),warning(E==="*"||!E.endsWith("*")||E.endsWith("/*"),'Route path "'+E+'" will be treated as if it were '+('"'+E.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+E.replace(/\*$/,"/*")+'".'));let k=[],H="^"+E.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(te,ae)=>(k.push(ae),"/([^\\/]+)"));return E.endsWith("*")?(k.push("*"),H+=E==="*"||E==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):R?H+="\\/*$":E!==""&&E!=="/"&&(H+="(?:(?=\\/|$))"),[new RegExp(H,y?void 0:"i"),k]}function safelyDecodeURI(E){try{return decodeURI(E)}catch(y){return warning(!1,'The URL path "'+E+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+y+").")),E}}function safelyDecodeURIComponent(E,y){try{return decodeURIComponent(E)}catch(R){return warning(!1,'The value for the URL param "'+y+'" will not be decoded because'+(' the string "'+E+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+R+").")),E}}function stripBasename(E,y){if(y==="/")return E;if(!E.toLowerCase().startsWith(y.toLowerCase()))return null;let R=y.endsWith("/")?y.length-1:y.length,k=E.charAt(R);return k&&k!=="/"?null:E.slice(R)||"/"}function warning(E,y){if(!E){typeof console<"u"&&console.warn(y);try{throw new Error(y)}catch{}}}function resolvePath(E,y){y===void 0&&(y="/");let{pathname:R,search:k="",hash:H=""}=typeof E=="string"?parsePath(E):E;return{pathname:R?R.startsWith("/")?R:resolvePathname(R,y):y,search:normalizeSearch(k),hash:normalizeHash(H)}}function resolvePathname(E,y){let R=y.replace(/\/+$/,"").split("/");return E.split("/").forEach(H=>{H===".."?R.length>1&&R.pop():H!=="."&&R.push(H)}),R.length>1?R.join("/"):"/"}function getInvalidPathError(E,y,R,k){return"Cannot include a '"+E+"' character in a manually specified "+("`to."+y+"` field ["+JSON.stringify(k)+"]. Please separate it out to the ")+("`to."+R+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function getPathContributingMatches(E){return E.filter((y,R)=>R===0||y.route.path&&y.route.path.length>0)}function resolveTo(E,y,R,k){k===void 0&&(k=!1);let H;typeof E=="string"?H=parsePath(E):(H=_extends$1({},E),invariant(!H.pathname||!H.pathname.includes("?"),getInvalidPathError("?","pathname","search",H)),invariant(!H.pathname||!H.pathname.includes("#"),getInvalidPathError("#","pathname","hash",H)),invariant(!H.search||!H.search.includes("#"),getInvalidPathError("#","search","hash",H)));let B=E===""||H.pathname==="",te=B?"/":H.pathname,ae;if(k||te==null)ae=R;else{let Le=y.length-1;if(te.startsWith("..")){let Ne=te.split("/");for(;Ne[0]==="..";)Ne.shift(),Le-=1;H.pathname=Ne.join("/")}ae=Le>=0?y[Le]:"/"}let ce=resolvePath(H,ae),Ce=te&&te!=="/"&&te.endsWith("/"),Oe=(B||te===".")&&R.endsWith("/");return!ce.pathname.endsWith("/")&&(Ce||Oe)&&(ce.pathname+="/"),ce}const joinPaths=E=>E.join("/").replace(/\/\/+/g,"/"),normalizePathname=E=>E.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=E=>!E||E==="?"?"":E.startsWith("?")?E:"?"+E,normalizeHash=E=>!E||E==="#"?"":E.startsWith("#")?E:"#"+E;class ErrorResponse{constructor(y,R,k,H){H===void 0&&(H=!1),this.status=y,this.statusText=R||"",this.internal=H,k instanceof Error?(this.data=k.toString(),this.error=k):this.data=k}}function isRouteErrorResponse(E){return E instanceof ErrorResponse}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/** * React Router v6.6.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function _extends(){return _extends=Object.assign?Object.assign.bind():function(E){for(var y=1;yae.pathnameBase)),B=reactExports.useRef(!1);return reactExports.useEffect(()=>{B.current=!0}),reactExports.useCallback(function(ae,ce){if(ce===void 0&&(ce={}),!B.current)return;if(typeof ae=="number"){y.go(ae);return}let Ce=resolveTo(ae,JSON.parse(H),k,ce.relative==="path");E!=="/"&&(Ce.pathname=Ce.pathname==="/"?E:joinPaths([E,Ce.pathname])),(ce.replace?y.replace:y.push)(Ce,ce.state,ce)},[E,y,H,k])}function useRoutes(E,y){useInRouterContext()||invariant(!1);let{navigator:R}=reactExports.useContext(NavigationContext),k=reactExports.useContext(DataRouterStateContext),{matches:H}=reactExports.useContext(RouteContext),B=H[H.length-1],te=B?B.params:{};B&&B.pathname;let ae=B?B.pathnameBase:"/";B&&B.route;let ce=useLocation(),Ce;if(y){var Oe;let De=typeof y=="string"?parsePath(y):y;ae==="/"||(Oe=De.pathname)!=null&&Oe.startsWith(ae)||invariant(!1),Ce=De}else Ce=ce;let Le=Ce.pathname||"/",Ne=ae==="/"?Le:Le.slice(ae.length)||"/",Fe=matchRoutes(E,{pathname:Ne}),Ue=_renderMatches(Fe&&Fe.map(De=>Object.assign({},De,{params:Object.assign({},te,De.params),pathname:joinPaths([ae,R.encodeLocation?R.encodeLocation(De.pathname).pathname:De.pathname]),pathnameBase:De.pathnameBase==="/"?ae:joinPaths([ae,R.encodeLocation?R.encodeLocation(De.pathnameBase).pathname:De.pathnameBase])})),H,k||void 0);return y&&Ue?reactExports.createElement(LocationContext.Provider,{value:{location:_extends({pathname:"/",search:"",hash:"",state:null,key:"default"},Ce),navigationType:Action.Pop}},Ue):Ue}function DefaultErrorElement(){let E=useRouteError(),y=isRouteErrorResponse(E)?E.status+" "+E.statusText:E instanceof Error?E.message:JSON.stringify(E),R=E instanceof Error?E.stack:null,k="rgba(200,200,200, 0.5)",H={padding:"0.5rem",backgroundColor:k},B={padding:"2px 4px",backgroundColor:k};return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unhandled Thrown Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},y),R?reactExports.createElement("pre",{style:H},R):null,reactExports.createElement("p",null,"💿 Hey developer 👋"),reactExports.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",reactExports.createElement("code",{style:B},"errorElement")," props on ",reactExports.createElement("code",{style:B},"")))}class RenderErrorBoundary extends reactExports.Component{constructor(y){super(y),this.state={location:y.location,error:y.error}}static getDerivedStateFromError(y){return{error:y}}static getDerivedStateFromProps(y,R){return R.location!==y.location?{error:y.error,location:y.location}:{error:y.error||R.error,location:R.location}}componentDidCatch(y,R){console.error("React Router caught the following error during render",y,R)}render(){return this.state.error?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(E){let{routeContext:y,match:R,children:k}=E,H=reactExports.useContext(DataRouterContext);return H&&H.static&&H.staticContext&&R.route.errorElement&&(H.staticContext._deepestRenderedBoundaryId=R.route.id),reactExports.createElement(RouteContext.Provider,{value:y},k)}function _renderMatches(E,y,R){if(y===void 0&&(y=[]),E==null)if(R!=null&&R.errors)E=R.matches;else return null;let k=E,H=R==null?void 0:R.errors;if(H!=null){let B=k.findIndex(te=>te.route.id&&(H==null?void 0:H[te.route.id]));B>=0||invariant(!1),k=k.slice(0,Math.min(k.length,B+1))}return k.reduceRight((B,te,ae)=>{let ce=te.route.id?H==null?void 0:H[te.route.id]:null,Ce=R?te.route.errorElement||reactExports.createElement(DefaultErrorElement,null):null,Oe=y.concat(k.slice(0,ae+1)),Le=()=>reactExports.createElement(RenderedRoute,{match:te,routeContext:{outlet:B,matches:Oe}},ce?Ce:te.route.element!==void 0?te.route.element:B);return R&&(te.route.errorElement||ae===0)?reactExports.createElement(RenderErrorBoundary,{location:R.location,component:Ce,error:ce,children:Le(),routeContext:{outlet:null,matches:Oe}}):Le()},null)}var DataRouterHook$1;(function(E){E.UseRevalidator="useRevalidator"})(DataRouterHook$1||(DataRouterHook$1={}));var DataRouterStateHook$1;(function(E){E.UseLoaderData="useLoaderData",E.UseActionData="useActionData",E.UseRouteError="useRouteError",E.UseNavigation="useNavigation",E.UseRouteLoaderData="useRouteLoaderData",E.UseMatches="useMatches",E.UseRevalidator="useRevalidator"})(DataRouterStateHook$1||(DataRouterStateHook$1={}));function useDataRouterState(E){let y=reactExports.useContext(DataRouterStateContext);return y||invariant(!1),y}function useRouteContext(E){let y=reactExports.useContext(RouteContext);return y||invariant(!1),y}function useCurrentRouteId(E){let y=useRouteContext(),R=y.matches[y.matches.length-1];return R.route.id||invariant(!1),R.route.id}function useRouteError(){var E;let y=reactExports.useContext(RouteErrorContext),R=useDataRouterState(DataRouterStateHook$1.UseRouteError),k=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return y||((E=R.errors)==null?void 0:E[k])}function Route(E){invariant(!1)}function Router(E){let{basename:y="/",children:R=null,location:k,navigationType:H=Action.Pop,navigator:B,static:te=!1}=E;useInRouterContext()&&invariant(!1);let ae=y.replace(/^\/*/,"/"),ce=reactExports.useMemo(()=>({basename:ae,navigator:B,static:te}),[ae,B,te]);typeof k=="string"&&(k=parsePath(k));let{pathname:Ce="/",search:Oe="",hash:Le="",state:Ne=null,key:Fe="default"}=k,Ue=reactExports.useMemo(()=>{let De=stripBasename(Ce,ae);return De==null?null:{pathname:De,search:Oe,hash:Le,state:Ne,key:Fe}},[ae,Ce,Oe,Le,Ne,Fe]);return Ue==null?null:reactExports.createElement(NavigationContext.Provider,{value:ce},reactExports.createElement(LocationContext.Provider,{children:R,value:{location:Ue,navigationType:H}}))}function Routes(E){let{children:y,location:R}=E,k=reactExports.useContext(DataRouterContext),H=k&&!y?k.router.routes:createRoutesFromChildren(y);return useRoutes(H,R)}var AwaitRenderStatus;(function(E){E[E.pending=0]="pending",E[E.success=1]="success",E[E.error=2]="error"})(AwaitRenderStatus||(AwaitRenderStatus={}));new Promise(()=>{});function createRoutesFromChildren(E,y){y===void 0&&(y=[]);let R=[];return reactExports.Children.forEach(E,(k,H)=>{if(!reactExports.isValidElement(k))return;if(k.type===reactExports.Fragment){R.push.apply(R,createRoutesFromChildren(k.props.children,y));return}k.type!==Route&&invariant(!1),!k.props.index||!k.props.children||invariant(!1);let B=[...y,H],te={id:k.props.id||B.join("-"),caseSensitive:k.props.caseSensitive,element:k.props.element,index:k.props.index,path:k.props.path,loader:k.props.loader,action:k.props.action,errorElement:k.props.errorElement,hasErrorBoundary:k.props.errorElement!=null,shouldRevalidate:k.props.shouldRevalidate,handle:k.props.handle};k.props.children&&(te.children=createRoutesFromChildren(k.props.children,B)),R.push(te)}),R}/** * React Router DOM v5 Compat v6.6.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */var DataRouterHook;(function(E){E.UseScrollRestoration="useScrollRestoration",E.UseSubmitImpl="useSubmitImpl",E.UseFetcher="useFetcher"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(E){E.UseFetchers="useFetchers",E.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function CompatRouter(E){let{children:y}=E,R=useHistory(),[k,H]=reactExports.useState(()=>({location:R.location,action:R.action}));return reactExports.useLayoutEffect(()=>{R.listen((B,te)=>H({location:B,action:te}))},[R]),reactExports.createElement(Router,{navigationType:k.action,location:k.location,navigator:R},reactExports.createElement(Routes,null,reactExports.createElement(Route,{path:"*",element:y})))}const ScrollContext=({children:E})=>{const y=useLocation$1();return reactExports.useEffect(()=>{var R;y.pathname.includes("/posts/")||(R=y.state)!=null&&R.soapboxModalKey||window.scrollTo(0,0)},[y]),E},ErrorBoundaryContext=reactExports.createContext(null),initialState={didCatch:!1,error:null};class ErrorBoundary extends reactExports.Component{constructor(y){super(y),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=initialState}static getDerivedStateFromError(y){return{didCatch:!0,error:y}}resetErrorBoundary(){const{error:y}=this.state;if(y!==null){for(var R,k,H=arguments.length,B=new Array(H),te=0;te0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return E.length!==y.length||E.some((R,k)=>!Object.is(R,y[k]))}const rtlChars=/[\u0590-\u083F]|[\u08A0-\u08FF]|[\uFB1D-\uFDFF]|[\uFE70-\uFEFF]/mg;function isRtl(E,y=.3){if(E.length===0)return!1;E=E.replace(/(?:https?|ftp|sftp|ws|wss|blob|smtp|smtps):\/\/[\S]+/g,""),E=E.replace(/(mailto:)([^\s@]+@[^\s@]+\.[^\s@]+)/g,""),E=E.replace(/(tel:)([+\d\s()-]+)/g,""),E=E.replace(/(?:^|[^/\w])@([a-z0-9_]+(@[a-z0-9.-]+)?)/ig,""),E=E.replace(/(?:^|[^/\w])#([\S]+)/ig,""),E=E.replace(/\s+/g,"");const R=E.match(rtlChars);return R?R.length/E.length>y:!1}function getTextDirection(E,{fallback:y="ltr",confidence:R}={}){return E?isRtl(E,R)?"rtl":"ltr":y}const Textarea=reactExports.forwardRef(({isCodeEditor:E=!1,hasError:y=!1,isResizeable:R=!0,onChange:k,autoGrow:H=!1,maxRows:B=10,minRows:te=1,rows:ae=4,theme:ce="default",maxLength:Ce,value:Oe,...Le},Ne)=>{const Fe=(Oe==null?void 0:Oe.length)||0,[Ue,De]=reactExports.useState(H?te:ae),$e=useLocale(),Be=Ve=>{if(H){const st=Ve.target.rows;Ve.target.rows=te;const We=~~(Ve.target.scrollHeight/20);We===st&&(Ve.target.rows=We),We>=B&&(Ve.target.rows=B,Ve.target.scrollTop=Ve.target.scrollHeight),De(We{throw new Error("ServiceWorker already registered.")})}const unregisterSW=async()=>{if(navigator.serviceWorker){const y=(await navigator.serviceWorker.getRegistrations()).map(R=>R.unregister());await Promise.all(y)}},soapboxLogoWhiteSrc="proxy.php?url=https%3A%2F%2Ffe.soapbox.pub%2Fpacks%2Fassets%2Fsoapbox-logo-white-15L-oLRO.svg",soapboxLogoSrc="proxy.php?url=https%3A%2F%2Ffe.soapbox.pub%2Fpacks%2Fassets%2Fsoapbox-logo-Cq79-0Uo.svg",SiteLogo=({className:E,theme:y,...R})=>{const{logo:k,logoDarkMode:H}=useSoapboxConfig(),{demo:B}=useSettings();let te=["dark","black"].includes(useTheme());y==="dark"&&(te=!0);const ae=te?soapboxLogoWhiteSrc:soapboxLogoSrc,ce=()=>B?ae:te&&H?H:k||H||ae;return jsxRuntimeExports.jsx("img",{className:clsx("object-contain",E),src:ce(),...R})},SiteErrorBoundary=({children:E})=>{const{links:y}=useSoapboxConfig(),R=reactExports.useRef(null),[k,H]=reactExports.useState(),[B,te]=reactExports.useState(),[ae,ce]=reactExports.useState(),Ce=String(k)+B,Oe=De=>{localStorage.clear(),sessionStorage.clear(),"serviceWorker"in navigator&&(De.preventDefault(),unregisterSW().then(Fe).catch(Fe))},Le=()=>{R.current&&(R.current.select(),R.current.setSelectionRange(0,99999),document.execCommand("copy"))};function Ne(De,$e){H(De),te($e.componentStack),captureSentryException(De,{tags:{ErrorBoundary:"yes"}}).catch(console.error),__vitePreload(async()=>{const{default:Be}=await import("./js/bowser-DUlkwOmT.js");return{default:Be}},[]).then(({default:Be})=>ce(Be.getParser(window.navigator.userAgent))).catch(()=>{})}function Fe(){location.href="proxy.php?url=https%3A%2F%2Ffe.soapbox.pub%2F"}const Ue=jsxRuntimeExports.jsxs("div",{className:"flex h-screen flex-col bg-white pb-12 pt-16 black:bg-black dark:bg-primary-900",children:[jsxRuntimeExports.jsxs("main",{className:"mx-auto flex w-full max-w-7xl grow flex-col justify-center px-4 sm:px-6 lg:px-8",children:[jsxRuntimeExports.jsx("div",{className:"flex shrink-0 justify-center",children:jsxRuntimeExports.jsx("a",{href:"/",className:"inline-flex",children:jsxRuntimeExports.jsx(SiteLogo,{alt:"Logo",className:"h-12 w-auto cursor-pointer"})})}),jsxRuntimeExports.jsxs("div",{className:"py-8",children:[jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-xl space-y-2 text-center",children:[jsxRuntimeExports.jsx("h1",{className:"text-3xl font-extrabold tracking-tight text-gray-900 dark:text-gray-500 sm:text-4xl",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"alert.unexpected.message",defaultMessage:"Something went wrong."})}),jsxRuntimeExports.jsx("p",{className:"text-lg text-gray-700 dark:text-gray-600",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"alert.unexpected.body",defaultMessage:"We're sorry for the interruption. If the problem persists, please reach out to our support team. You may also try to {clearCookies} (this will log you out).",values:{clearCookies:jsxRuntimeExports.jsx("a",{href:"/",onClick:Oe,className:"text-primary-600 hover:underline dark:text-accent-blue",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"alert.unexpected.clear_cookies",defaultMessage:"clear cookies and browser data"})})}})}),jsxRuntimeExports.jsxs(Text,{theme:"muted",children:[jsxRuntimeExports.jsxs(Text,{weight:"medium",tag:"span",theme:"muted",children:[sourceCode.displayName,":"]})," ",sourceCode.version]}),jsxRuntimeExports.jsx("div",{className:"mt-10",children:jsxRuntimeExports.jsxs("a",{href:"/",className:"text-base font-medium text-primary-600 hover:underline dark:text-accent-blue",children:[jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"alert.unexpected.return_home",defaultMessage:"Return Home"})," ",jsxRuntimeExports.jsx("span",{className:"inline-block rtl:rotate-180","aria-hidden":"true",children:"→"})]})})]}),jsxRuntimeExports.jsxs("div",{className:"mx-auto max-w-lg space-y-4 py-16",children:[Ce&&jsxRuntimeExports.jsx(Textarea,{ref:R,value:Ce,onClick:Le,isCodeEditor:!0,rows:12,readOnly:!0}),ae&&jsxRuntimeExports.jsxs(Stack,{children:[jsxRuntimeExports.jsx(Text,{weight:"semibold",children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"alert.unexpected.browser",defaultMessage:"Browser"})}),jsxRuntimeExports.jsxs(Text,{theme:"muted",children:[ae.getBrowserName()," ",ae.getBrowserVersion()]})]})]})]})]}),jsxRuntimeExports.jsx("footer",{className:"mx-auto w-full max-w-7xl shrink-0 px-4 sm:px-6 lg:px-8",children:jsxRuntimeExports.jsxs(HStack,{justifyContent:"center",space:4,element:"nav",children:[y.get("status")&&jsxRuntimeExports.jsx(SiteErrorBoundaryLink,{href:y.get("status"),children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"alert.unexpected.links.status",defaultMessage:"Status"})}),y.get("help")&&jsxRuntimeExports.jsx(SiteErrorBoundaryLink,{href:y.get("help"),children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"alert.unexpected.links.help",defaultMessage:"Help Center"})}),y.get("support")&&jsxRuntimeExports.jsx(SiteErrorBoundaryLink,{href:y.get("support"),children:jsxRuntimeExports.jsx(MemoizedFormattedMessage,{id:"alert.unexpected.links.support",defaultMessage:"Support"})})]})})]});return jsxRuntimeExports.jsx(ErrorBoundary,{fallback:Ue,onError:Ne,children:E})};function SiteErrorBoundaryLink({href:E,children:y}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"inline-block border-l border-gray-300","aria-hidden":"true"}),jsxRuntimeExports.jsx("a",{href:E,className:"text-sm font-medium text-gray-700 hover:underline dark:text-gray-600",children:y})]})}const AboutPage=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DI_ILJc_.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),EmojiPicker=reactExports.lazy(()=>__vitePreload(()=>import("./js/emoji-picker-BN3z5OdA.js"),__vite__mapDeps([15,16]))),EmojiPickerModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/emoji-picker-modal-DiZbGQrj.js"),__vite__mapDeps([17,18,2,19,20,21,22]))),Notifications=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CDVTYH_S.js"),__vite__mapDeps([23,24,25,26,27,28,1,2,29,19,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,20,91,92,93,94,95,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,135]))),LandingTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Dgk1kvM9.js"),__vite__mapDeps([136,43,137,138,24,25,30,31,1,2,139,0,3,4,5,6,7,8,9,10,11,12,13,14,140,141,142,107,79,80,42,81,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,100,101,102,103,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146]))),HomeTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BeVv_xKT.js"),__vite__mapDeps([147,57,58,59]))),PublicTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-C3KAP9x7.js"),__vite__mapDeps([148,43,138,24,25,149,14,150,151,111,48,28,107,20,32,84,30,31,1,2,47,3,4,5,6,7,8,9,10,11,12,13,152,19,140,141,142,79,80,42,81,91,143,88,87,92,93,94,112,26,27,29,135,66,67,39,40,41,44,45,46,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,85,86,89,90,95,96,97,98,99,100,101,102,103,104,105,106,108,109,110,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146]))),RemoteTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-qKochosu.js"),__vite__mapDeps([153,43,138,154,53,30,31,1,2,140,141,142,107,79,80,42,81,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146,152]))),HashtagTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-qDQHrli3.js"),__vite__mapDeps([155,43,138,4,5,6,7,8,30,31,1,2,11,140,141,142,107,79,80,42,81,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,100,101,102,103,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146]))),DirectTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CFlIl2oA.js"),__vite__mapDeps([156,43,157,138,158,159,160,161,90,162,16,79,80,42,81,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,20,91,92,93,94,19,95,163,108,109,32,164,30,31,1,2,140,141,142,107,143,112,26,27,29,135,66,67,39,40,41,44,45,46,47,49,55,68,69,70,71,72,73,74,75,76,77,34,78,96,97,98,99,5,100,101,102,103,6,104,105,106,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,133,134,144,33,35,145,146]))),Conversations=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-2xjJQ2Tc.js"),__vite__mapDeps([165,43,157,138,158,159,160,161,90,162,16,79,80,42,81,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,20,91,92,93,94,19,95,163,108,109,32,164,30,31,1,2,26,27,29,135,66,67,39,40,41,44,45,46,47,49,55,68,69,70,71,72,73,74,75,76,77,34,78,96,97,98,99,5,100,101,102,103,6,104,105,106,107,110,111,112,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,133,134]))),ListTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CHjWGURY.js"),__vite__mapDeps([166,43,138,167,1,2,19,30,31,140,141,142,107,79,80,42,81,91,143,88,87,48,28,92,93,94,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146]))),Lists=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DtG2u0VG.js"),__vite__mapDeps([168,169,65,110,53,26,27,28,1,2,29,19,30,31,20,170,9,163,108,109,87,48]))),Bookmarks=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-ChL6LShn.js"),__vite__mapDeps([171,43,24,25,142,107,79,80,42,81,1,2,91,143,88,87,48,28,92,93,94,19,112,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,97,98,5,100,115,36,116,90,60,113,114,117,118,73,119,120,121,63,65,122,123,102,124,110,125,126,127,128,101,78,82,83,84,85,86,89,20,95,129,130,131,111,132,21,22,16,133,134,6,104,103,105,106,69,70,71,72,74,75,76,77,34,96,99,108,109,26,27,29,144,33,35,145,146,30,31]))),Status=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BZ1Qizz9.js"),__vite__mapDeps([172,167,1,2,24,25,30,31,144,33,34,35,19,173,26,27,28,29,66,67,39,40,41,42,43,44,45,46,47,48,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,65,83,84,85,86,87,88,89,90,20,91,92,93,94,95,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,112,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,145,146,135]))),PinnedStatuses=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DVU0qd7r.js"),__vite__mapDeps([174,167,1,2,141,142,107,79,80,42,81,43,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146,30,31]))),AccountTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BuzN2iJ1.js"),__vite__mapDeps([175,176,42,81,80,43,167,1,2,141,142,107,79,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146]))),AccountGallery=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BTTOS_ik.js"),__vite__mapDeps([177,176,42,81,80,43,29,19,167,1,2,30,31,178,108,179,77,52,84]))),Followers=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-B58rJriC.js"),__vite__mapDeps([180,176,42,81,80,181,43,182,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,19,95,167,1,2,26,27,29,30,31]))),Following=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BQapNynt.js"),__vite__mapDeps([183,176,42,81,80,181,43,182,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,19,95,167,1,2,26,27,29,30,31]))),FollowRequests=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DjPZhJg5.js"),__vite__mapDeps([184,26,27,28,1,2,29,19,30,31,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,20,91,92,93,94,95,185,5]))),GenericNotFound=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-D4zg4m_b.js"),__vite__mapDeps([186,167,1,2]))),FavouritedStatuses=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-D3XwROy1.js"),__vite__mapDeps([187,176,42,81,80,43,167,1,2,141,142,107,79,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146,30,31]))),Blocks=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CfaHuLwi.js"),__vite__mapDeps([188,181,43,182,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,19,95,26,27,1,2,29,30,31]))),DomainBlocks=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-B965Eqb2.js"),__vite__mapDeps([189,190,20,26,27,28,1,2,29,19,30,31]))),Mutes=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BHANUSGB.js"),__vite__mapDeps([191,181,43,182,26,27,28,1,2,29,19,30,31,57,58,59,78,79,80,42,81,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,20,91,92,93,94,95,131,40,41,49]))),MuteModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/mute-modal-CtX6Jlbc.js"),__vite__mapDeps([192,79,80,42,81,43,18,2,19,20,11,193,7]))),Filters=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DNdBkOv6.js"),__vite__mapDeps([194,95,26,27,28,1,2,29,19,30,31]))),EditFilter=reactExports.lazy(()=>__vitePreload(()=>import("./js/edit-filter-B91sgSg8.js"),__vite__mapDeps([195,4,5,6,7,8,167,1,2,19,30,31,196,197,198,9,163,108,109,87,48,28,199,20,11]))),ReportModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/report-modal-BibUgszN.js"),__vite__mapDeps([200,79,80,42,81,43,72,201,202,51,45,46,47,48,28,32,203,120,204,49,50,52,53,4,5,6,7,8,103,104,85,86,87,88,89,95,19,105,18,2,20,205,206,78,82,65,83,84,90,91,92,93,94,207,197,198,11]))),AccountModerationModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/account-moderation-modal-Db76kZDQ.js"),__vite__mapDeps([208,73,127,115,110,128,101,78,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,19,95,4,5,6,7,8,167,1,2,18,11]))),MediaGallery=reactExports.lazy(()=>__vitePreload(()=>import("./js/media-gallery-bkHzS0oD.js"),__vite__mapDeps([209,210,115,76,105,77,20,206,179,52,84,211]))),Video=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-V4dzGs6n.js").then(E=>E.i),__vite__mapDeps([212,207,75,126,179,77,139,211]))),Audio$1=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CIchaYxy.js"),__vite__mapDeps([213,214,212,207,75,126,179,77,139,211]))),MediaModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/media-modal-BDDSDHSb.js"),__vite__mapDeps([215,2,216,212,207,75,126,179,77,139,211,214,217,84,167,1,66,67,39,40,41,42,43,19,44,45,46,47,48,28,32,49,50,51,52,53,55,68,69,70,71,72,73,74,76,34,78,79,80,81,82,65,83,85,86,87,88,89,90,20,91,92,93,94,95,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,112,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,127,128,129,130,131,132,21,22,16,133,134,213,144,33,35,173,26,27,29,145,146,135]))),VideoModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/video-modal-Cm8shPMQ.js"),__vite__mapDeps([218,212,207,75,126,179,77,139,211]))),BoostModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/boost-modal-C4zj8S7H.js"),__vite__mapDeps([219,55,53,18,2,19,20,220,72,85,86,87,48,28,88,89,78,79,80,42,81,43,82,65,83,84,50,51,52,90,91,92,93,94,95]))),ConfirmationModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/confirmation-modal-CfdeA9SF.js"),__vite__mapDeps([221,4,5,6,7,8,18,2,19,20,11]))),MissingDescriptionModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/missing-description-modal-BkGndnC9.js"),__vite__mapDeps([222,18,2,19,20]))),ActionsModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/actions-modal-CPv2HlPc.js"),__vite__mapDeps([223,105,220,72,85,86,87,48,28,88,89,78,79,80,42,81,43,82,65,83,84,50,51,52,53,90,20,91,92,93,94,19,95,206]))),HotkeysModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/hotkeys-modal-DMHr_U5B.js"),__vite__mapDeps([224,18,2,19,20]))),ComposeModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/compose-modal-CSF0M_Dx.js"),__vite__mapDeps([225,110,130,80,42,43,226,227,18,2,19,20,11,228,229,230,46,121,231,22,232,48,28,64,133,21,70,71,72,73,74,75,76,77,50,51,52,53,1,34,78,79,81,82,65,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,111,32,220,233,210,115,206,234,38,160,161,162,16,163,164,44,193,7,190,47,235,236,154,237,205]))),ReplyMentionsModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/reply-mentions-modal-ywAaf06Z.js"),__vite__mapDeps([238,2,18,19,20,94,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,91,92,93,95,154,228]))),UnauthorizedModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/unauthorized-modal-C4c51nAg.js"),__vite__mapDeps([239,19,9,163,108,109,87,48,28,18,2,20,240]))),EditFederationModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/edit-federation-modal--PhhMAUr.js"),__vite__mapDeps([241,4,5,6,7,8,18,2,19,20,11]))),EmbedModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/embed-modal-fs3-Q6xS.js"),__vite__mapDeps([242,243,19,163,108,109,87,48,28,44,18,2,20]))),ComponentModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/component-modal-CoaN3yGT.js"),__vite__mapDeps([244,18,2,19,20]))),ReblogsModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/reblogs-modal-D_cdQM5n.js"),__vite__mapDeps([245,26,27,28,1,2,29,19,18,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,91,92,93,94,95]))),FavouritesModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/favourites-modal-Bmv3ZeH6.js"),__vite__mapDeps([246,26,27,28,1,2,29,19,18,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,91,92,93,94,95]))),DislikesModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/dislikes-modal-Bebu5mH-.js"),__vite__mapDeps([247,26,27,28,1,2,29,19,18,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,91,92,93,94,95]))),ReactionsModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/reactions-modal-CA5Gtgwr.js"),__vite__mapDeps([248,26,27,28,1,2,29,19,90,18,20,57,58,59,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,91,92,93,94,95]))),MentionsModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/mentions-modal-KZXbPPeM.js"),__vite__mapDeps([249,26,27,28,1,2,29,19,18,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,91,92,93,94,95]))),LandingPageModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/landing-page-modal-BbWYIHUF.js"),__vite__mapDeps([250,19,18,2,20,240]))),BirthdaysModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/birthdays-modal-B0r4Q0s-.js"),__vite__mapDeps([251,26,27,28,1,2,29,19,18,20,252,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,91,92,93,94,95]))),BirthdayPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/birthday-panel-DH2WlBr4.js"),__vite__mapDeps([253,254,216,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,91,92,93,94,19,95]))),ListEditor=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BJGRbLao.js"),__vite__mapDeps([255,1,2,18,19,20,94,154,53,78,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,90,91,92,93,95,9,163,108,109,256]))),ListAdder=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-D1E96Djv.js"),__vite__mapDeps([257,1,2,18,19,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,91,92,93,94,95,170,9,163,108,109,169,154]))),Explore=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-pgROd6sC.js"),__vite__mapDeps([258,98,30,31,1,2,44,57,58,59,259,79,80,42,81,43,260,154,53,26,27,28,29,19,78,82,65,83,84,85,86,87,48,88,89,50,51,52,90,20,91,92,93,94,95,135,66,67,39,40,41,45,46,47,32,49,55,68,69,70,71,72,73,74,75,76,77,34,96,97,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,112,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,261,33,262,144,35,143,263,158,159,160,161,162,163,164,14,198,264,11,8,7,139,265]))),DivinePage=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Dtapc7e0.js"),__vite__mapDeps([266,30,31,1,2,259,79,80,42,81,43,260,154,53,26,27,28,29,19,78,82,65,83,84,85,86,87,48,88,89,50,51,52,90,20,91,92,93,94,95,135,66,67,39,40,41,44,45,46,47,32,49,55,68,69,70,71,72,73,74,75,76,77,34,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,112,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,261,33,262,144,35,143]))),LoginPage=reactExports.lazy(()=>__vitePreload(()=>import("./js/login-page-BL1uweT-.js"),__vite__mapDeps([267,268,1,2,20,87,48,28,269,19,196,197,198,9,163,108,109]))),ExternalLogin=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DFlwV3iU.js"),__vite__mapDeps([270,268,1,2,20,19,196,197,198,9,163,108,109,87,48,28]))),LogoutPage=reactExports.lazy(()=>__vitePreload(()=>import("./js/logout-BX6kETAs.js"),[])),RegistrationPage=reactExports.lazy(()=>__vitePreload(()=>import("./js/registration-page-BBHPuYrT.js"),__vite__mapDeps([271,268,1,2,20,240,272,36,5,273,237,163,108,109,87,48,28,19,198,196,197,9,7]))),Settings=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DL0MlyPH.js"),__vite__mapDeps([274,243,19,163,108,109,87,48,28,4,5,6,7,8,1,2,30,31,197,198,234,3,9,10,11,12,13,14,275]))),EditProfile=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-C4JOre4t.js"),__vite__mapDeps([276,273,237,163,108,109,87,48,28,4,5,6,7,8,19,30,31,1,2,196,197,198,9,199,20,11,277,278,50,51,52,53,229,279]))),EditEmail=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Bd5zMBEe.js"),__vite__mapDeps([280,19,30,31,1,2,196,197,198,9,163,108,109,87,48,28]))),EmailConfirmation=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Dk1rm7x7.js"),[])),EditPassword=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CS_GPRdu.js"),__vite__mapDeps([281,19,30,31,1,2,196,197,198,9,163,108,109,87,48,28]))),DeleteAccount=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DgaP0lUo.js"),__vite__mapDeps([282,19,1,2,196,197,198,9,163,108,109,87,48,28]))),SoapboxConfig=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CBAGgJQ6.js"),__vite__mapDeps([283,4,5,6,7,8,149,14,150,151,111,48,28,107,20,32,84,19,1,2,30,31,284,196,197,198,9,163,108,109,87,199,11,13,235,285]))),ExportData=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DQvFSfCp.js"),__vite__mapDeps([286,30,31,1,2,19,196,9]))),ImportData=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-C76of6jf.js"),__vite__mapDeps([287,30,31,1,2,19,284,196,197,198,9]))),Backups=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-MXnYVzym.js"),__vite__mapDeps([288,19,1,2,30,31,196]))),PasswordReset=reactExports.lazy(()=>__vitePreload(()=>import("./js/password-reset-ID_zGkzc.js"),__vite__mapDeps([289,268,1,2,20,19,196,197,198,9,163,108,109,87,48,28]))),PasswordResetConfirm=reactExports.lazy(()=>__vitePreload(()=>import("./js/password-reset-confirm-3ZNGnUKe.js"),__vite__mapDeps([290,268,1,2,20,19,196,197,198,9,163,108,109,87,48,28]))),MfaForm=reactExports.lazy(()=>__vitePreload(()=>import("./js/mfa-form-h2nxNtHZ.js"),__vite__mapDeps([291,30,31,1,2,19,196,197,198,9,163,108,109,87,48,28,292]))),ChatIndex=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DgmqsgPf.js"),__vite__mapDeps([293,2,93,294,4,5,6,7,8,50,51,52,53,20,295,296,58,28,297,87,48,91,298,19,233,210,115,76,105,77,206,164,205,27,44,34,33,86,107,119,54,110,111,32,84,104,132,90,21,22,16,133,158,163,108,109,299,88,24,25,95,300,1,9,11,10,275,118,301]))),ChatWidget=reactExports.lazy(()=>__vitePreload(()=>import("./js/chat-widget-BQxKIk4F.js"),__vite__mapDeps([302,118,299,298,19,58,296,28,20,233,210,115,76,105,77,206,164,205,27,50,51,52,53,44,34,33,86,5,107,119,54,110,111,48,32,84,104,132,90,21,22,16,133,158,163,108,109,87,91,88,24,25,294,95,300,14,150,2,93,4,6,7,8]))),ServerInfo=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-C1wp07tU.js"),__vite__mapDeps([303,30,31,1,2,44,304,305,285,254,216,20]))),Dashboard=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-D7nRbBXj.js"),__vite__mapDeps([306,30,31,1,2,57,58,59,26,27,28,29,19,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,20,91,92,93,94,95,185,5,214,73,4,6,7,8,307,151,110,127,115,128,101,78,111,107,32,149,14,150,103,104,105,71,72,74,75,76,77,34]))),ModerationLog=reactExports.lazy(()=>__vitePreload(()=>import("./js/moderation-log-CI1O7GUG.js"),__vite__mapDeps([308,26,27,28,1,2,29,19,30,31]))),ThemeEditor=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Df8zPiIA.js"),__vite__mapDeps([309,214,310,125,111,48,28,107,20,32,84,4,5,6,7,8,19,30,31,1,2,196,9,235,307,311,227]))),PromoPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/promo-panel-BUyusRvt.js"),__vite__mapDeps([305,285,254,216,20]))),SignUpPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/sign-up-panel-Bmlv8eq_.js"),__vite__mapDeps([312,19,240]))),CtaBanner=reactExports.lazy(()=>__vitePreload(()=>import("./js/cta-banner-UaEeVIY-.js"),__vite__mapDeps([313,314,19,240]))),FundingPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/funding-panel-Bg2vZ1JR.js"),__vite__mapDeps([315,19,205,105,206,254,216,20]))),TrendsPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/trends-panel-DcPPECAv.js"),__vite__mapDeps([316,260,254,216,20,34]))),ProfileInfoPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/profile-info-panel-Dpy48quO.js"),__vite__mapDeps([317,252,100,74,46,97,318,80,42,43,83,84,85,86,87,48,28,88,89,95,269,50,51,52,53,91,319,5,320,321]))),ProfileMediaPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/profile-media-panel-BUzGzsSq.js"),__vite__mapDeps([322,254,216,20,178,108,179,77,52,84]))),ProfileFieldsPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/profile-fields-panel-BpSwYHhp.js"),__vite__mapDeps([323,254,216,20,319,5,85,86,87,48,28,88,89]))),PinnedAccountsPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/pinned-accounts-panel-Dsh4VS73.js"),__vite__mapDeps([324,254,216,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,91,92,93,94,19,95]))),InstanceInfoPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/instance-info-panel-3mLu4_k8.js"),__vite__mapDeps([325,122,123,254,216,20]))),InstanceModerationPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/instance-moderation-panel-CgL3FJOy.js"),__vite__mapDeps([326,151,118,111,48,28,107,20,32,84,254,216,327,108,190,46,51,53]))),LatestAdminAccountsPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/latest-accounts-panel-LKqQRHwD.js"),__vite__mapDeps([328,329,43,330,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,19,95,254,216]))),SidebarMenu=reactExports.lazy(()=>__vitePreload(()=>import("./js/sidebar-menu-HXJqz9wf.js"),__vite__mapDeps([331,93,117,62,14,332,67,333,334,169,294,94,301,56,98,335,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,19,95,44,320,321,234]))),ModalContainer=reactExports.lazy(()=>__vitePreload(()=>import("./js/modal-container-DOkpIme9.js"),__vite__mapDeps([336,226,110,227,18,2,19,20]))),ProfileHoverCard=reactExports.lazy(()=>__vitePreload(()=>import("./js/profile-hover-card-DBoDnPLG.js"),__vite__mapDeps([337,48,28,321,100,79,80,42,81,318,43,83,84,85,86,87,88,89,52,50,51,53,1,2,91,92,93,94,19,95]))),StatusHoverCard=reactExports.lazy(()=>__vitePreload(()=>import("./js/status-hover-card-C289UBF-.js"),__vite__mapDeps([338,48,28,135,66,67,39,40,41,42,43,19,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,1,2,34,78,79,80,81,82,65,83,84,85,86,87,88,89,90,20,91,92,93,94,95,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,112,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134]))),CryptoDonate=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CyHtZKji.js"),__vite__mapDeps([339,149,14,150,151,111,48,28,107,20,32,84,30,31,1,2,340,341,73,243,19,163,108,109,87,342]))),CryptoDonatePanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/crypto-donate-panel-C0_avDBs.js"),__vite__mapDeps([343,254,216,20,340,341,73,243,19,163,108,109,87,48,28,342]))),CryptoAddress=reactExports.lazy(()=>__vitePreload(()=>import("./js/crypto-address-DUrZIHv3.js"),__vite__mapDeps([341,73,243,19,163,108,109,87,48,28,342]))),CryptoDonateModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/crypto-donate-modal-Df4gWuK2.js"),__vite__mapDeps([344,18,2,19,20,73,292,243,163,108,109,87,48,28,342]))),LightningAddress=reactExports.lazy(()=>__vitePreload(()=>import("./js/lightning-address-JoAMXx-k.js"),__vite__mapDeps([345,243,19,163,108,109,87,48,28,90]))),ScheduledStatuses=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BiAOA3vV.js"),__vite__mapDeps([346,26,27,28,1,2,29,19,30,31,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,20,91,92,93,94,43,95,72,103,6,104,5,105,106,146,236]))),UserIndex=reactExports.lazy(()=>__vitePreload(()=>import("./js/user-index-BADBna_T.js"),__vite__mapDeps([347,329,43,330,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,19,95,26,27,1,2,29,30,31]))),FederationRestrictions=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-De7N6zSE.js"),__vite__mapDeps([348,26,27,28,1,2,29,19,149,14,150,151,111,48,107,20,32,84,30,31,327,108,190,46,51,53]))),Aliases=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Crdq1HH1.js"),__vite__mapDeps([349,53,26,27,28,1,2,29,19,30,31,94,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,90,20,91,92,93,95,154,256]))),Migration=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DSDqguwe.js"),__vite__mapDeps([350,19,30,31,1,2,196,197,198,9,163,108,109,87,48,28]))),WhoToFollowPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/who-to-follow-panel-PM9VgXIU.js"),__vite__mapDeps([351,254,216,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,91,92,93,94,19,95,352,34,143]))),LatestAccountsPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/latest-accounts-panel-CvBZDH_C.js"),__vite__mapDeps([353,254,216,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,91,92,93,94,19,95,352,34,143]))),FollowRecommendations=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Cluu2Hxz.js"),__vite__mapDeps([354,26,27,28,1,2,29,19,30,31,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,20,91,92,93,94,95,143]))),Directory=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-evtfrN1S.js"),__vite__mapDeps([355,29,19,30,31,1,2,264,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,95]))),RegisterInvite=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-RUpoIdae.js"),__vite__mapDeps([356,268,1,2,20,272,36,5,273,237,163,108,109,87,48,28,19,198,196,197,9,7]))),Share=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BdwMJ3pE.js"),[])),NewStatus=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DKnROpEI.js"),[])),IntentionalError=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BTG4tgt1.js"),[])),Developers=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Cq-KjHPS.js"),__vite__mapDeps([357,19,30,31,1,2,196,197,198,9,163,108,109,87,48,28,358,294,310]))),CreateApp=reactExports.lazy(()=>__vitePreload(()=>import("./js/create-Dp0cXZEw.js"),__vite__mapDeps([359,19,30,31,1,2,196,197,198,9,163,108,109,87,48,28]))),SettingsStore=reactExports.lazy(()=>__vitePreload(()=>import("./js/settings-store-OTGvZ0Jx.js"),__vite__mapDeps([360,4,5,6,7,8,19,1,2,30,31,196,197,198,9,10,11]))),TestTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-B0iaJOrS.js"),__vite__mapDeps([361,30,31,1,2,140,141,142,107,79,80,42,81,43,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146]))),ServiceWorkerInfo=reactExports.lazy(()=>__vitePreload(()=>import("./js/service-worker-info-Cz7TsQ-3.js"),__vite__mapDeps([362,73,4,5,6,7,8,19,30,31,1,2,196,363]))),CompareHistoryModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/compare-history-modal-B4G5ldD_.js"),__vite__mapDeps([364,72,18,2,19,20,88,87,48,28]))),AuthTokenList=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CfTrAlMX.js"),__vite__mapDeps([365,115,19,1,2,30,31]))),FamiliarFollowersModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/familiar-followers-modal-veEMqvL8.js"),__vite__mapDeps([366,26,27,28,1,2,29,19,18,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,91,92,93,94,95]))),AnnouncementsPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/announcements-panel-BlmD1a0K.js"),__vite__mapDeps([367,217,1,2,254,216,20,105,232,48,28,64,133,21,22,162,16,90]))),Quotes=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DZ-i2Jas.js"),__vite__mapDeps([368,141,142,107,79,80,42,81,43,1,2,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146,30,31,139]))),ComposeEventModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/compose-event-modal-CekNCyRo.js"),__vite__mapDeps([369,97,110,256,158,160,161,90,162,16,79,80,42,81,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,20,91,92,93,94,19,95,163,108,109,32,164,226,227,237,197,198,9,18,2,57,58,59,11,78,279]))),JoinEventModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/join-event-modal-DzN0GfjC.js"),__vite__mapDeps([370,197,198,18,2,19,20]))),EventHeader=reactExports.lazy(()=>__vitePreload(()=>import("./js/event-header-Cb9xIQhw.js"),__vite__mapDeps([371,115,36,93,113,114,42,43,92,94,19,117,332,107,73,119,120,74,121,97,63,65,122,123,102,55,110,204,127,128,101,78,79,80,81,82,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,95,295,296,58,297,134,307,34,99,5,100]))),EventInformation=reactExports.lazy(()=>__vitePreload(()=>import("./js/event-information-DEoyFuKv.js"),__vite__mapDeps([372,100,74,97,167,1,2,103,6,53,104,85,86,87,48,28,88,89,95,19,5,105,71,72,73,75,76,77,50,51,52,34,68,69,70,78,79,80,42,81,43,82,65,83,84,90,20,91,92,93,94,96,98,99,101,102,106,107,108,109,110,111,32,112]))),EventDiscussion=reactExports.lazy(()=>__vitePreload(()=>import("./js/event-discussion-BQCzrL95.js"),__vite__mapDeps([373,167,1,2,26,27,28,29,19,69,70,71,72,73,74,75,76,77,50,51,52,53,34,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,90,20,91,92,93,94,95,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,32,112,144,33,35,145,146,230,46,121,231,22,232,64,133,21,228,229,227,220,233,210,115,206,234,38,160,161,162,16,163,164,44,11,193,7,190,47,235,236,154,237,205,173,66,67,39,40,41,45,49,55,68,113,114,36,116,60,117,118,119,120,63,122,123,124,125,126,127,128,129,130,131,132,134,135]))),EventMapModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/event-map-modal-BffgK0fr.js"),__vite__mapDeps([374,19,18,2,20,375]))),EventParticipantsModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/event-participants-modal-cLK-3GPI.js"),__vite__mapDeps([376,26,27,28,1,2,29,19,18,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,91,92,93,94,95]))),Events=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CTHUkE4o.js"),__vite__mapDeps([377,19,1,2,30,31,378,6,217,96,97,98,99,93,5,100,53,91,34]))),Groups=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-DEu8MUOW.js"),__vite__mapDeps([379,67,43,380,182,201,202,51,45,46,47,48,28,32,203,120,204,49,50,52,53,26,27,1,2,29,19,163,108,109,87,299,381,382,34,383,384,6,44,385,57,58,59]))),GroupsDiscover=reactExports.lazy(()=>__vitePreload(()=>import("./js/discover-rpnjWCVv.js"),__vite__mapDeps([386,2,158,20,163,108,109,87,48,28,43,387,380,182,86,378,6,34,388,49,50,51,52,53,389,41,42,40,383,19,202,45,46,47,32,390,391,299,392,27,393,394,395,385,57,58,59]))),GroupsPopular=reactExports.lazy(()=>__vitePreload(()=>import("./js/popular-NHgLnUtQ.js"),__vite__mapDeps([396,27,28,43,387,380,182,30,31,1,2,388,49,50,51,52,53,389,41,42,40,383,19,202,45,46,47,48,32,393,394]))),GroupsSuggested=reactExports.lazy(()=>__vitePreload(()=>import("./js/suggested-D10d1P1q.js"),__vite__mapDeps([397,27,28,43,395,380,182,30,31,1,2,388,49,50,51,52,53,389,41,42,40,383,19,202,45,46,47,48,32,393,394]))),GroupsTag=reactExports.lazy(()=>__vitePreload(()=>import("./js/tag-HtOasLWj.js"),__vite__mapDeps([398,388,49,50,51,52,53,389,41,42,43,40,380,182,383,19,202,45,46,47,48,28,32,27,399,80,30,31,1,2,393]))),GroupsTags=reactExports.lazy(()=>__vitePreload(()=>import("./js/tags-CWH-sNn6.js"),__vite__mapDeps([400,27,28,43,390,30,31,1,2]))),PendingGroupRequests=reactExports.lazy(()=>__vitePreload(()=>import("./js/pending-requests-COpSCEo5.js"),__vite__mapDeps([401,43,383,201,202,51,45,46,47,48,28,32,203,120,204,49,50,52,53,26,27,1,2,29,19,30,31,382,34]))),GroupMembers=reactExports.lazy(()=>__vitePreload(()=>import("./js/group-members-DhAM9agu.js"),__vite__mapDeps([402,130,80,42,43,403,404,114,384,6,26,27,28,1,2,29,19,392,261,33,34,93,61,128,79,81,129,40,41,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,20,91,92,94,95,111,107,32]))),GroupTags=reactExports.lazy(()=>__vitePreload(()=>import("./js/group-tags-DQyL8G7S.js"),__vite__mapDeps([405,334,130,80,42,43,406,26,27,28,1,2,29,19,261,33,34,108,109,122,40,41,20,87,48]))),GroupTagTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/group-tag-timeline-BF42GoE7.js"),__vite__mapDeps([407,408,130,80,42,43,399,30,31,1,2,140,141,142,107,79,81,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,131,132,21,22,16,133,134,144,33,35,145,146]))),GroupTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/group-timeline-DUBHu4NB.js"),__vite__mapDeps([409,408,130,80,42,43,138,50,51,52,53,11,230,46,121,231,22,19,232,48,28,64,20,133,21,228,229,227,70,71,72,73,74,75,76,77,1,2,34,78,79,81,82,65,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,32,220,233,210,115,206,234,38,160,161,162,16,163,164,44,193,7,190,47,235,236,154,237,205,140,141,142,143,112,26,27,29,135,66,67,39,40,41,45,49,55,68,69,113,114,36,116,60,117,118,119,120,63,122,123,124,125,126,127,128,129,131,132,134,144,33,35,145,146]))),ManageGroup=reactExports.lazy(()=>__vitePreload(()=>import("./js/manage-group-BwbB-jtZ.js"),__vite__mapDeps([410,110,40,41,42,43,130,80,4,5,6,7,8,1,2,30,31,411]))),EditGroup=reactExports.lazy(()=>__vitePreload(()=>import("./js/edit-group-BMj6HOs9.js"),__vite__mapDeps([412,46,130,80,42,43,406,41,19,30,31,1,2,196,197,198,9,163,108,109,87,48,28,277,278,50,51,52,53,229,279,20,413,414,199]))),GroupBlockedMembers=reactExports.lazy(()=>__vitePreload(()=>import("./js/group-blocked-members-UkJ14vw-.js"),__vite__mapDeps([415,79,80,42,81,130,43,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,19,95,26,27,1,2,29,30,31,411]))),GroupMembershipRequests=reactExports.lazy(()=>__vitePreload(()=>import("./js/group-membership-requests-DuA9ySdn.js"),__vite__mapDeps([416,130,80,42,43,403,404,114,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,19,95,185,5,26,27,1,2,29,30,31,411]))),GroupGallery=reactExports.lazy(()=>__vitePreload(()=>import("./js/group-gallery-DVcBd9xe.js"),__vite__mapDeps([417,130,80,42,43,29,19,167,1,2,30,31,178,108,179,77,52,84]))),CreateGroupModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/create-group-modal-D2Upfu2x.js"),__vite__mapDeps([418,41,42,43,18,2,19,20,299,74,124,50,51,52,53,44,134,197,198,9,163,108,109,87,48,28,278,229,279,414,199,4,5,6,7,8]))),NewGroupPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/new-group-panel-CI4SZUdL.js"),__vite__mapDeps([419,19,381]))),MyGroupsPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/my-groups-panel-DRgcY8-z.js"),__vite__mapDeps([420,43,380,182,254,216,20,393,46,47,49,50,51,52,53,389,41,42,40,383,19,391,34]))),SuggestedGroupsPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/suggested-groups-panel-u1LNW9gC.js"),__vite__mapDeps([421,43,395,380,182,254,216,20,393,46,47,49,50,51,52,53,389,41,42,40,383,19,391,34]))),GroupMediaPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/group-media-panel-D-yHDRu8.js"),__vite__mapDeps([422,254,216,20,178,108,179,77,52,84]))),NewEventPanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/new-event-panel-0E9yznKI.js"),__vite__mapDeps([423,62,19]))),Announcements=reactExports.lazy(()=>__vitePreload(()=>import("./js/announcements-BmAVNjfv.js"),__vite__mapDeps([424,94,425,85,86,87,48,28,88,89,26,27,1,2,29,19,30,31]))),EditAnnouncementModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/edit-announcement-modal-BYQL41CV.js"),__vite__mapDeps([426,425,237,163,108,109,87,48,28,197,198,9,18,2,19,20,11]))),FollowedTags=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-B_Z9eeuU.js"),__vite__mapDeps([427,260,26,27,28,1,2,29,19,30,31,262,34]))),AccountNotePanel=reactExports.lazy(()=>__vitePreload(()=>import("./js/account-note-panel-CJfXLSl8.js"),__vite__mapDeps([428,254,216,20]))),ComposeEditor=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-CtDQw7Ci.js"),__vite__mapDeps([429,231,430,28,85,86,87,48,88,89,22,161,90,162,16,79,80,42,81,43,82,65,83,84,50,51,52,53,20,91,92,93,94,19,95,228,164]))),OnboardingModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/onboarding-modal-C948p-hg.js"),__vite__mapDeps([431,217,18,2,19,20,94,50,51,52,53,197,198,163,108,109,87,48,28,26,27,1,29,78,79,80,42,81,43,82,65,83,84,85,86,88,89,90,91,92,93,95,143,432,36,4,5,6,7,8,30,31,9,330]))),NostrSignupModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/nostr-signup-modal-CzEYd3c1.js"),__vite__mapDeps([433,434,115,90,19,44,18,2,20,214,197,198,163,108,109,87,48,28,139,307]))),NostrLoginModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/nostr-login-modal-oF2cAL0-.js"),__vite__mapDeps([435,434,115,90,19,44,18,2,20,197,198,9,163,108,109,87,48,28]))),EditIdentity=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-C-4_8TjB.js"),__vite__mapDeps([432,36,4,5,6,7,8,19,1,2,30,31,90,9,163,108,109,87,48,28,330]))),Domains=reactExports.lazy(()=>__vitePreload(()=>import("./js/domains-P7lyuLw0.js"),__vite__mapDeps([436,94,437,95,26,27,28,1,2,29,19,30,31,363]))),EditDomainModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/edit-domain-modal-BezugQKX.js"),__vite__mapDeps([438,437,197,198,9,163,108,109,87,48,28,18,2,19,20,11]))),NostrRelays=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-Dthr6DQq.js"),__vite__mapDeps([439,19,30,31,1,2,196,9,440,163,108,109,87,48,28,7,199,20]))),Bech32Redirect=reactExports.lazy(()=>__vitePreload(()=>import("./js/Bech32Redirect-KlHnMQWM.js"),__vite__mapDeps([441,167,1,2]))),ManageZapSplit=reactExports.lazy(()=>__vitePreload(()=>import("./js/manage-zap-split-C_jL8urT.js"),__vite__mapDeps([442,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,20,91,92,93,94,43,19,95,4,5,6,7,8,30,31,1,2,163,108,109,443,311,159,160,161,162,16,79,80,42,81,32,164]))),ManageDittoServer=reactExports.lazy(()=>__vitePreload(()=>import("./js/manage-ditto-server-C_WzXsSe.js"),__vite__mapDeps([444,52,19,30,31,1,2,284,196,197,198,9,163,108,109,87,48,28,199,20]))),Relays=reactExports.lazy(()=>__vitePreload(()=>import("./js/relays-Dx-20j01.js"),__vite__mapDeps([445,26,27,28,1,2,29,19,30,31,9,163,108,109,87,48,413]))),Rules=reactExports.lazy(()=>__vitePreload(()=>import("./js/rules-4DGBsyKB.js"),__vite__mapDeps([446,94,447,26,27,28,1,2,29,19,30,31]))),EditRuleModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/edit-rule-modal-BU6uUAJt.js"),__vite__mapDeps([448,447,197,198,9,163,108,109,87,48,28,18,2,19,20,413]))),AdminNostrRelays=reactExports.lazy(()=>__vitePreload(()=>import("./js/nostr-relays-sVyeuLWX.js"),__vite__mapDeps([449,19,30,31,1,2,196,9,440,163,108,109,87,48,28,7,199,20]))),PayRequestModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/pay-request-modal-BKjqKGVf.js"),__vite__mapDeps([450,18,2,19,20,60,443,88,87,48,28,91,50,51,52,53,163,108,109,451,452]))),ZapInvoiceModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/zap-invoice-drt8ihHZ.js"),__vite__mapDeps([453,454,292,243,19,163,108,109,87,48,28,50,51,52,53,20,18,2,88]))),ZapsModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/zaps-modal-D34uN0ff.js"),__vite__mapDeps([455,26,27,28,1,2,29,19,18,20,78,79,80,42,81,43,82,65,83,84,85,86,87,48,88,89,50,51,52,53,90,91,92,93,94,95,451]))),ZapSplitModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/zap-split-modal-DCaqA5Wy.js"),__vite__mapDeps([456,18,2,19,20,454,292,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,90,91,92,93,94,43,95,243,163,108,109]))),CaptchaModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/captcha-modal-86ZaTHvK.js"),__vite__mapDeps([457,19,18,2,20]))),NostrBunkerLogin=reactExports.lazy(()=>__vitePreload(()=>import("./js/nostr-bunker-login-CW5mPtH1.js"),__vite__mapDeps([458,19,9,163,108,109,87,48,28]))),Wallet=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-BFAEhHR9.js"),__vite__mapDeps([459,460,4,5,6,7,8,19,1,2,30,31,461,292,243,163,108,109,87,48,28,44,197,198,9,451,18,20,462,196,463,199,464,452]))),WalletRelays=reactExports.lazy(()=>__vitePreload(()=>import("./js/wallet-relays-iv6h1JiT.js"),__vite__mapDeps([465,19,30,31,1,2,463,163,108,109,87,48,28,199,20,451]))),WalletMints=reactExports.lazy(()=>__vitePreload(()=>import("./js/wallet-mints-Brbh8IGo.js"),__vite__mapDeps([466,462,19,30,31,1,2,463,163,108,109,87,48,28,199,20,451]))),WalletTransactions=reactExports.lazy(()=>__vitePreload(()=>import("./js/wallet-transactions-C24PmBBe.js"),__vite__mapDeps([467,30,31,1,2,464,44,451]))),StreakModal=reactExports.lazy(()=>__vitePreload(()=>import("./js/streak-modal-DBPyhPgx.js"),__vite__mapDeps([468,321,52,50,51,53,1,2,18,19,20,91,92,93,94,43,88,87,48,28]))),FollowsTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/follows-timeline-CNo-Vlny.js"),__vite__mapDeps([469,24,25,30,31,1,2,140,141,142,107,79,80,42,81,43,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146]))),CommunityTimeline=reactExports.lazy(()=>__vitePreload(()=>import("./js/community-timeline-C2oJyF5O.js"),__vite__mapDeps([470,43,137,138,24,25,30,31,1,2,140,141,142,107,79,80,42,81,91,143,88,87,48,28,92,93,94,19,112,26,27,29,135,66,67,39,40,41,44,45,46,47,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,82,65,83,84,85,86,89,90,20,95,96,97,98,99,5,100,101,102,103,6,104,105,106,108,109,110,111,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134,144,33,35,145,146]))),PocketWallet=reactExports.lazy(()=>__vitePreload(()=>import("./js/pocket-wallet-DtPUHioh.js"),__vite__mapDeps([471,109,335,19,461,292,243,163,108,87,48,28,44,197,198,9,8,7,451,18,2,20])));function useLoggedIn(){const E=useAppSelector(y=>y.me);return{isLoggedIn:typeof E=="string",isLoginLoading:E===null,isLoginFailed:E===!1,me:E}}const LOCAL_STORAGE_REDIRECT_KEY="soapbox:redirect-uri",getRedirectUrl=()=>{let E=localStorage.getItem(LOCAL_STORAGE_REDIRECT_KEY);return E&&(E=decodeURIComponent(E)),localStorage.removeItem(LOCAL_STORAGE_REDIRECT_KEY),E||"/"},useCachedLocationHandler=()=>{const E=()=>localStorage.removeItem(LOCAL_STORAGE_REDIRECT_KEY);return reactExports.useEffect(()=>(window.addEventListener("beforeunload",E),()=>{window.removeEventListener("beforeunload",E)}),[]),null},GdprBanner=reactExports.lazy(()=>__vitePreload(()=>import("./js/gdpr-banner-B-E_CSft.js"),__vite__mapDeps([472,314,19]))),EmbeddedStatus=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-ChfgrgkU.js"),__vite__mapDeps([473,167,1,2,66,67,39,40,41,42,43,19,44,45,46,47,48,28,32,49,50,51,52,53,55,68,69,70,71,72,73,74,75,76,77,34,78,79,80,81,82,65,83,84,85,86,87,88,89,90,20,91,92,93,94,95,96,97,98,99,5,100,101,102,103,6,104,105,106,107,108,109,110,111,112,113,114,115,36,116,60,117,118,119,120,121,63,122,123,124,125,126,127,128,129,130,131,132,21,22,16,133,134]))),UI=reactExports.lazy(()=>__vitePreload(()=>import("./js/index-hDENGkyq.js"),__vite__mapDeps([474,43,138,22,116,40,41,42,90,117,62,67,333,460,358,169,121,63,158,301,56,98,335,82,65,83,84,85,86,87,48,28,88,89,50,51,52,53,20,91,92,93,94,19,95,263,159,160,161,162,16,79,80,81,163,108,109,32,164,176,130,294,295,296,58,297,133,12,13,14,7,234,111,107,229,304,30,31,1,2,57,59,144,33,34,35,110,404,114,49,389,380,182,383,45,46,47,119,124,126,131,203,120,204,139,230,231,232,64,21,228,227,70,71,72,73,74,75,76,77,78,96,97,99,5,100,101,102,103,6,104,105,106,220,233,210,115,206,38,44,11,193,190,235,236,154,237,205,36,60,332,55,125,37,61,452,134,9,240,430,112,411,310]))),SoapboxMount=()=>{var Ce;useCachedLocationHandler();const{isLoggedIn:E}=useLoggedIn(),{account:y}=useOwnAccount(),R=useAppDispatch(),k=useSoapboxConfig(),H=((Ce=y==null?void 0:y.source)==null?void 0:Ce.ditto.captcha_solved)===!1,B=useAppSelector(Oe=>Oe.onboarding.needsOnboarding),te=y&&B;reactExports.useEffect(()=>{H&&R(openModal("CAPTCHA"))},[H]),reactExports.useEffect(()=>{te&&!H&&R(openModal("ONBOARDING"))},[te,H]);const{redirectRootNoLogin:ae,gdpr:ce}=k;return jsxRuntimeExports.jsx(SiteErrorBoundary,{children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(CompatRouter,{children:jsxRuntimeExports.jsx(ScrollContext,{children:jsxRuntimeExports.jsxs(Switch,{children:[!E&&ae&&jsxRuntimeExports.jsx(Redirect,{exact:!0,from:"/",to:ae}),jsxRuntimeExports.jsx(Route$1,{path:"/embed/:statusId",render:Oe=>jsxRuntimeExports.jsx(reactExports.Suspense,{children:jsxRuntimeExports.jsx(EmbeddedStatus,{params:Oe.match.params})})}),jsxRuntimeExports.jsx(Redirect,{from:"/@:username/:statusId/embed",to:"/embed/:statusId"}),jsxRuntimeExports.jsxs(Route$1,{children:[jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(LoadingScreen,{}),children:jsxRuntimeExports.jsx(UI,{})}),jsxRuntimeExports.jsx(reactExports.Suspense,{children:jsxRuntimeExports.jsx(ModalContainer,{})}),ce&&!E&&jsxRuntimeExports.jsx(reactExports.Suspense,{children:jsxRuntimeExports.jsx(GdprBanner,{})}),jsxRuntimeExports.jsx("div",{id:"toaster",children:jsxRuntimeExports.jsx(Ie,{position:"top-right",containerClassName:"top-10",containerStyle:{top:75}})})]})]})})})})})};store.dispatch(preload());store.dispatch(checkOnboardingStatus());const Soapbox=()=>jsxRuntimeExports.jsx(Provider_default,{store,children:jsxRuntimeExports.jsx(QueryClientProvider,{client:queryClient,children:jsxRuntimeExports.jsx(StatProvider,{children:jsxRuntimeExports.jsx(NostrProvider,{children:jsxRuntimeExports.jsx(SoapboxHead,{children:jsxRuntimeExports.jsx(SoapboxLoad,{children:jsxRuntimeExports.jsx(SoapboxMount,{})})})})})})}),printConsoleWarning=()=>{console.log("%cStop!",["color: #ff0000","display: block",'font-family: system-ui, -apple-system, BlinkMacSystemFont, Ubuntu, "Helvetica Neue", sans-serif',"font-size: 50px","font-weight: 800","padding: 4px 0"].join(";")),console.log("%cThis is a browser feature intended for developers. If someone told you to copy-paste something here it is a scam and will give them access to your account.",["color: #111111","display: block",'font-family: system-ui, -apple-system, BlinkMacSystemFont, Ubuntu, "Helvetica Neue", sans-serif',"font-size: 18px","padding: 4px 0 16px"].join(";"))};let iframeId;const handleMessage=E=>{var y,R;((y=E.data)==null?void 0:y.type)==="setHeight"&&(iframeId=(R=E.data)==null?void 0:R.id)};window.addEventListener("message",handleMessage);function ready(E){["interactive","complete"].includes(document.readyState)?E():document.addEventListener("DOMContentLoaded",E)}enableMapSet();NODE_ENV==="production"&&(printConsoleWarning(),registerSW("/sw.js"),lockSW());ready(()=>{const E=document.getElementById("soapbox");clientExports.createRoot(E).render(jsxRuntimeExports.jsx(Soapbox,{}))});export{ReportableEntities as $,makeGetOtherAccounts as A,throttle as B,fetchOwnAccounts as C,defineMessages as D,Entities as E,logOut as F,switchAccount as G,HStack as H,Icon as I,useSettings as J,useOwnAccount as K,Link as L,MemoizedFormattedMessage as M,NavLink as N,Counter as O,LatestAdminAccountsPanel as P,CtaBanner as Q,SignUpPanel as R,Stack as S,Text as T,PocketWallet as U,TrendsPanel as V,WhoToFollowPanel as W,EventHeader as X,NewEventPanel as Y,GroupRoles as Z,initReport as _,useSoapboxConfig as a,EmailConfirmation as a$,toast as a0,isDefaultHeader as a1,normalizeAttachment as a2,List as a3,GroupMediaPanel as a4,SuggestedGroupsPanel as a5,NewGroupPanel as a6,Routes as a7,Route as a8,MyGroupsPanel as a9,removeFromFollowers as aA,setSearchAccount as aB,nip19_exports as aC,Redirect as aD,getAcct as aE,ProfileInfoPanel as aF,AccountNotePanel as aG,ProfileMediaPanel as aH,ProfileFieldsPanel as aI,PinnedAccountsPanel as aJ,federationRestrictionsDisclosed as aK,InstanceInfoPanel as aL,InstanceModerationPanel as aM,openSidebar as aN,logIn as aO,verifyCredentials as aP,fetchInstance as aQ,MfaRequiredError as aR,resetCompose as aS,isNetworkError as aT,Route$1 as aU,ErrorBoundary as aV,SidebarMenu as aW,ChatWidget as aX,ProfileHoverCard as aY,StatusHoverCard as aZ,Switch as a_,uploadCompose as aa,AnnouncementsPanel as ab,BirthdayPanel as ac,PromoPanel as ad,CryptoDonatePanel as ae,FundingPanel as af,LatestAccountsPanel as ag,unsubscribeAccount as ah,subscribeAccount as ai,parseVersion as aj,useChats as ak,useMutation as al,queryClient as am,ChatKeys as an,MASTODON as ao,unblockAccount as ap,blockAccount as aq,mentionCompose as ar,directCompose as as,unpinAccount as at,pinAccount as au,unmuteAccount as av,initMuteModal as aw,blockDomain as ax,unblockDomain as ay,getSettings as az,useAppDispatch as b,DeleteAccount as b$,LogoutPage as b0,HomeTimeline as b1,LandingTimeline as b2,PublicTimeline as b3,RemoteTimeline as b4,Conversations as b5,DirectTimeline as b6,Status as b7,HashtagTimeline as b8,Lists as b9,GroupsDiscover as bA,GroupsPopular as bB,GroupsSuggested as bC,GroupsTags as bD,GroupsTag as bE,PendingGroupRequests as bF,GroupTags as bG,GroupTagTimeline as bH,GroupTimeline as bI,GroupMembers as bJ,GroupGallery as bK,ManageGroup as bL,EditGroup as bM,GroupBlockedMembers as bN,GroupMembershipRequests as bO,NewStatus as bP,ScheduledStatuses as bQ,EditProfile as bR,EditIdentity as bS,ExportData as bT,ImportData as bU,Aliases as bV,Migration as bW,Backups as bX,NostrRelays as bY,EditEmail as bZ,EditPassword as b_,ListTimeline as ba,Bookmarks as bb,Notifications as bc,Explore as bd,DivinePage as be,FollowRecommendations as bf,Directory as bg,Events as bh,ChatIndex as bi,FollowRequests as bj,Blocks as bk,DomainBlocks as bl,Mutes as bm,EditFilter as bn,Filters as bo,FollowedTags as bp,AccountTimeline as bq,Followers as br,Following as bs,AccountGallery as bt,FavouritedStatuses as bu,PinnedStatuses as bv,Quotes as bw,EventInformation as bx,EventDiscussion as by,Groups as bz,clsx as c,unpinFromGroup as c$,MfaForm as c0,AuthTokenList as c1,Settings as c2,Wallet as c3,WalletRelays as c4,WalletMints as c5,WalletTransactions as c6,SoapboxConfig as c7,Dashboard as c8,ManageDittoServer as c9,RegisterInvite as cA,Bech32Redirect as cB,GenericNotFound as cC,expandFollowsTimeline as cD,expandNotifications as cE,fetchMarker as cF,fetchReports as cG,fetchUsers as cH,fetchConfig as cI,fetchFilters as cJ,fetchFollowRequests as cK,fetchScheduledStatuses as cL,fetchSuggestionsForTimeline as cM,hoistNonReactStatics as cN,requireReact as cO,getDefaultExportFromCjs as cP,React$1 as cQ,PropTypes as cR,simpleEmojiReact as cS,getReactForStatus as cT,replyCompose as cU,toggleFavourite as cV,toggleDislike as cW,quoteCompose as cX,editEvent as cY,editStatus as cZ,togglePin as c_,ModerationLog as ca,ManageZapSplit as cb,UserIndex as cc,ThemeEditor as cd,Relays as ce,AdminNostrRelays as cf,Announcements as cg,Domains as ch,Rules as ci,ServerInfo as cj,CreateApp as ck,SettingsStore as cl,TestTimeline as cm,ServiceWorkerInfo as cn,Developers as co,IntentionalError as cp,CryptoDonate as cq,FederationRestrictions as cr,Share as cs,AboutPage as ct,RegistrationPage as cu,NostrBunkerLogin as cv,ExternalLogin as cw,LoginPage as cx,PasswordReset as cy,PasswordResetConfirm as cz,useHistory as d,fetchAccountByUsername as d$,pinToGroup as d0,launchChat as d1,toggleMuteStatus as d2,deleteFromTimelines as d3,deleteStatus$5 as d4,defaultMediaVisibility as d5,getActualStatus as d6,textForScreenReader as d7,unfilterStatus as d8,toggleStatusHidden as d9,accountSchema as dA,selectEntities as dB,useListState as dC,invalidateEntityList$1 as dD,selectListState as dE,entitiesFetchRequest as dF,filteredArray as dG,realNumberSchema as dH,LinkHeader as dI,entitiesFetchSuccess as dJ,entitiesFetchFail as dK,toSchema as dL,displayFqn as dM,entitiesTransaction as dN,relationshipSchema as dO,muteAccount as dP,authorizeFollowRequest as dQ,rejectFollowRequest as dR,joinEvent as dS,leaveEvent as dT,FormattedDate as dU,InlineSVG as dV,groupRelationshipSchema as dW,shortNumberFormat as dX,selectAccount as dY,deactivateUsers as dZ,deleteUser$2 as d_,SvgIcon as da,matchPath$1 as db,undoStatusTranslation as dc,translateStatus as dd,statusSchema as de,importEntities$1 as df,reblog as dg,selectEntity as dh,normalizeStatus as di,unreblog as dj,toggleReblog as dk,api as dl,importFetchedPoll as dm,circleCheckIcon as dn,getTextDirection as dp,addAutoPlay as dq,Video as dr,Audio$1 as ds,MediaGallery as dt,debounce as du,openStatusHoverCard as dv,useDispatch as dw,closeStatusHoverCard as dx,FormattedList as dy,xIcon as dz,useAppSelector as e,submitCompose as e$,toggleStatusSensitivity as e0,deleteStatus$6 as e1,openDropdownMenu as e2,closeModal as e3,closeDropdownMenu as e4,commonjsGlobal$1 as e5,htmlToPlaintext as e6,openProfileHoverCard as e7,fetchAccount as e8,closeProfileHoverCard as e9,sourceCode as eA,cancelQuoteCompose as eB,connect_default as eC,cancelReplyCompose as eD,selectOwnAccount as eE,changeComposeContentType as eF,removePoll as eG,addPoll as eH,removePollOption as eI,changePollOption as eJ,addPollOption as eK,clearComposeSuggestions as eL,fetchComposeSuggestions as eM,selectComposeSuggestion as eN,changePollSettings as eO,changeComposeVisibility as eP,statusToMentionsAccountIdsArray as eQ,removeSchedule as eR,addSchedule as eS,setSchedule as eT,changeComposeSpoilerness as eU,changeComposeSpoilerText as eV,changeUploadCompose as eW,undoUploadCompose as eX,changeMediaOrder as eY,ComposeEditor as eZ,changeCompose as e_,hexToHsl as ea,injectIntl as eb,requireReactDom as ec,React$2 as ed,deleteEntities$1 as ee,dismissEntities$1 as ef,chooseEmoji as eg,j$1 as eh,useTheme as ei,EmojiPicker as ej,buildCustomEmojis as ek,changeSetting as el,requirePropTypes as em,useQuery as en,customEmojiSchema as eo,autosuggestPopulate as ep,getAccessToken as eq,connectTimelineStream as er,create$1 as es,produce as et,enableMapSet as eu,submitSearch as ev,changeSearch as ew,clearSearchResults as ex,showSearch as ey,clearSearch as ez,fetchStatus as f,pin as f$,findEntity as f0,useLocale as f1,OrderedSet as f2,accountSearch as f3,reactIsExports as f4,fetchGroupRelationshipsSuccess as f5,isNativeEmoji as f6,requireReactIs as f7,isCustomEmoji as f8,selectCache as f9,keepPreviousData as fA,importFetchedAccounts as fB,fetchRelationships as fC,FollowsTimeline as fD,CommunityTimeline as fE,clearTimeline$1 as fF,expandPublicTimeline as fG,expandRemoteTimeline as fH,expandHashtagTimeline as fI,fetchHashtag as fJ,unfollowHashtag as fK,followHashtag as fL,expandDirectTimeline as fM,directComposeById as fN,markConversationRead as fO,expandConversations as fP,mountConversations as fQ,unmountConversations as fR,fetchList as fS,expandListTimeline as fT,fetchLists as fU,deleteList as fV,changeListEditorTitle as fW,submitListEditor as fX,isLoggedIn as fY,dislike as fZ,undislike as f_,useParams as fa,get as fb,setFilter$1 as fc,makeGetNotification as fd,unfavourite as fe,favourite as ff,revealStatus as fg,hideStatus as fh,validType as fi,defineMessage as fj,patchMe as fk,createSelector as fl,dequeueNotifications as fm,scrollTopNotifications as fn,DOMPurify as fo,expandCommunityTimeline as fp,makeGetStatusIds as fq,dequeueTimeline as fr,setNotification as fs,scrollTopTimeline as ft,Record as fu,makeGetAccount as fv,Map$1 as fw,calculateStatus as fx,useInfiniteQuery as fy,removePageItem as fz,Spinner as g,addToListEditor as g$,unpin as g0,fetchStatusWithContext as g1,fetchNext as g2,reduceEmoji as g3,fetchPinnedStatuses as g4,expandAccountFeaturedTimeline as g5,fetchPatronAccount as g6,expandAccountTimeline as g7,getAccountGallery as g8,expandAccountMediaTimeline as g9,infoCircleIcon as gA,accountIdsToAccts as gB,badgeToTag as gC,tagToBadge as gD,setRole as gE,getBadges as gF,revokeName as gG,setBadges as gH,truncateFilename as gI,setGroupTimelineVisible as gJ,cancelEventCompose as gK,removeFromMentions as gL,addToMentions as gM,remoteInteraction as gN,ConfigDB as gO,updateConfig as gP,Set$1 as gQ,makeGetRemoteInstance as gR,fetchReblogs as gS,expandReblogs as gT,fetchFavourites as gU,expandFavourites as gV,fetchDislikes as gW,ReactionRecord as gX,fetchReactions as gY,fetchBirthdayReminders as gZ,removeFromListEditor as g_,MastodonResponse as ga,expandFollowRequests as gb,fetchFavouritedStatuses as gc,fetchAccountFavouritedStatuses as gd,expandFavouritedStatuses as ge,expandAccountFavouritedStatuses as gf,fetchDomainBlocks as gg,expandDomainBlocks as gh,toggleHideNotifications as gi,changeMuteDuration as gj,deleteFilter as gk,fetchFilter as gl,normalizeFilter as gm,updateFilter as gn,createFilter as go,getSoapboxConfig as gp,toggleStatusReport as gq,getDomain as gr,changeReportBlock as gs,changeReportForward as gt,changeReportRule as gu,Textarea as gv,changeReportComment as gw,submitReportSuccess as gx,submitReport as gy,submitReportFail as gz,SiteLogo as h,flattenPages as h$,changeListSuggestions as h0,fetchListSuggestions as h1,clearListSuggestions as h2,setupListEditor as h3,resetListEditor as h4,removeFromListAdder as h5,addToListAdder as h6,setupListAdder as h7,resetListAdder as h8,useNavigate as h9,buildErrorMessage as hA,changePassword as hB,deleteAccount as hC,normalizeSoapboxConfig as hD,defaultSettings as hE,useSystemTheme as hF,generateThemeCss as hG,fromJS as hH,updateSoapboxConfig as hI,uploadMedia as hJ,normalizeAccount as hK,fetchBackups as hL,createBackup as hM,resetPassword as hN,resetPasswordConfirm as hO,disableMfa$1 as hP,fetchBackupCodes as hQ,setupMfa as hR,confirmMfa as hS,useChat as hT,useChatContext as hU,useChatActions as hV,secondsToDays as hW,MessageExpirationValues as hX,ChatProvider as hY,search$1 as hZ,useChatMessages as h_,setFilter as ha,fetchTrendingStatuses as hb,expandSearch as hc,expandTrendingStatuses as hd,isURL as he,BACKEND_URL as hf,getScopes as hg,createApp as hh,otpVerify as hi,getRedirectUrl as hj,obtainOAuthToken as hk,authLoggedIn as hl,parseBaseURL as hm,baseClient as hn,instanceV1Schema as ho,getInstanceScopes as hp,fetchCaptcha as hq,accountLookup as hr,register$2 as hs,fetchMfa as ht,patchMeSuccess as hu,isDefaultAvatar as hv,updateNotificationSettings as hw,resizeImage$1 as hx,changeEmail as hy,confirmChangedEmail as hz,iframeId as i,ReblogsModal as i$,ChatWidgetScreens as i0,fetchChats as i1,messageExpirationOptions as i2,approveUser$1 as i3,rejectUser as i4,isNumber as i5,FormattedNumber as i6,useInstanceV1 as i7,makeGetReport as i8,closeReports as i9,CreateGroupModal as iA,CryptoDonateModal as iB,DislikesModal as iC,EditAnnouncementModal as iD,EditDomainModal as iE,EditFederationModal as iF,EditRuleModal as iG,EmbedModal as iH,EmojiPickerModal as iI,EventMapModal as iJ,EventParticipantsModal as iK,FamiliarFollowersModal as iL,FavouritesModal as iM,HotkeysModal as iN,JoinEventModal as iO,LandingPageModal as iP,ListAdder as iQ,ListEditor as iR,MediaModal as iS,MentionsModal as iT,MissingDescriptionModal as iU,MuteModal as iV,NostrLoginModal as iW,NostrSignupModal as iX,OnboardingModal as iY,PayRequestModal as iZ,ReactionsModal as i_,moderationLogEntrySchema as ia,compareId as ib,hueShift as ic,getHost as id,fetchSoapboxConfig as ie,fetchPatronInstance as ig,fetchTrendsSuccess as ih,normalizeTag as ii,fetchAccountFamiliarFollowers as ij,patronUserSchema as ik,CryptoAddress as il,LightningAddress as im,fetchPinnedAccounts as io,closeSidebar as ip,AccountModerationModal as iq,ActionsModal as ir,BirthdaysModal as is,BoostModal as it,CaptchaModal as iu,CompareHistoryModal as iv,ComponentModal as iw,ComposeModal as ix,ComposeEventModal as iy,ConfirmationModal as iz,jsxRuntimeExports as j,groupCompose as j$,ReplyMentionsModal as j0,ReportModal as j1,StreakModal as j2,UnauthorizedModal as j3,VideoModal as j4,ZapsModal as j5,ZapInvoiceModal as j6,ZapSplitModal as j7,cancelReport as j8,updateProfileHoverCard as j9,expandStatusQuotes as jA,locationSearch as jB,fetchEventParticipationRequests as jC,changeEditEventName as jD,changeEditEventStartTime as jE,changeEditEventEndTime as jF,changeEditEventHasEndTime as jG,changeEditEventApprovalRequired as jH,changeEditEventLocation as jI,uploadEventBanner as jJ,undoUploadEventBanner as jK,changeEditEventDescription as jL,submitEvent as jM,authorizeEventParticipationRequest as jN,rejectEventParticipationRequest as jO,fetchEventIcs as jP,eventDiscussionCompose as jQ,fetchEventParticipations as jR,fetchRecentEvents as jS,fetchJoinedEvents as jT,groupSearchHistory as jU,groupTagSchema as jV,groupMemberSchema as jW,groupKick as jX,expandGroupTimelineFromTag as jY,expandGroupTimeline as jZ,expandGroupFeaturedTimeline as j_,updateStatusHoverCard as ja,cancelScheduledStatus as jb,expandScheduledStatuses as jc,makeGetHosts as jd,addToAliases as je,changeAliasesSuggestions as jf,fetchAliasesSuggestions as jg,clearAliasesSuggestions as jh,fetchAliases as ji,removeFromAliases as jj,moveAccount as jk,fetchDirectory as jl,expandDirectory as jm,openComposeWithText as jn,changeSettingImmediate as jo,getBaseURL as jp,SETTINGS_UPDATE as jq,FE_NAME as jr,importFetchedStatuses as js,expandTimelineSuccess as jt,unregisterSW as ju,fetchHistory as jv,fetchOAuthTokens as jw,revokeOAuthTokenById as jx,useAnnouncements as jy,fetchStatusQuotes as jz,useApi as k,TRUTHSOCIAL as k0,fetchGroupBlocks as k1,groupUnblock as k2,getGroupGallery as k3,expandGroupMediaTimeline as k4,adminAnnouncementSchema as k5,fetchFollowedHashtags as k6,expandFollowedHashtags as k7,submitAccountNote as k8,setEditorState as k9,endOnboarding as ka,useNostr as kb,generateSecretKey as kc,getPublicKey as kd,slugify as ke,keyring as kf,logInNostr as kg,startOnboarding as kh,nostrExtensionLogIn as ki,domainSchema as kj,NSet as kk,useSigner as kl,useInstanceV2 as km,relaySchema as kn,adminRuleSchema as ko,zap as kp,NSchema as kq,useQueryClient as kr,fetchZaps as ks,expandZaps as kt,fetchMe as ku,useFeatures as l,makeGetStatus as m,groupSchema as n,useLoggedIn as o,useStatContext as p,coerceObject as q,reactExports as r,HTTPError as s,useLocation$1 as t,useInstance as u,useRouteMatch as v,openModal as w,groupComposeModal as x,useIntl as y,z$1 as z}; //# sourceMappingURL=index-DhozgANI.js.map