ghost 6.11.0 → 6.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/tryghost-i18n-6.12.0.tgz +0 -0
- package/core/boot.js +4 -2
- package/core/built/admin/assets/{_baseAssignValue-BX8EallQ.js → _baseAssignValue-hsL6ItjC.js} +1 -1
- package/core/built/admin/assets/{a-large-small-CKZJgscl.js → a-large-small-BPPu_Iy7.js} +1 -1
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +1 -1
- package/core/built/admin/assets/admin-x-settings/{code-editor-view-n8DFeXbv.mjs → code-editor-view-Bq6l5arq.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-v6qQgUXt.mjs → index-CKaxer_o.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-CXL12uvO.mjs → index-CtYEAgeN.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-D4ye6uvI.mjs → index-D4NstoNQ.mjs} +11 -6
- package/core/built/admin/assets/admin-x-settings/{modals-CdsPaTfy.mjs → modals-BzljHVa7.mjs} +2 -2
- package/core/built/admin/assets/{at-sign-CqQzllfI.js → at-sign-CYnGzOFc.js} +1 -1
- package/core/built/admin/assets/{audience-select-DQD7iDOb.js → audience-select-DYoxiiwy.js} +1 -1
- package/core/built/admin/assets/{avatar-flipboard-uq7ptTxT.js → avatar-flipboard-C9-npfmZ.js} +1 -1
- package/core/built/admin/assets/{bluesky-sharing-qyIGv6Ny.js → bluesky-sharing-BGcmGcee.js} +1 -1
- package/core/built/admin/assets/{chart-DGA1MaFs.js → chart-CqJxisVP.js} +1 -1
- package/core/built/admin/assets/{chunk.524.1289543297329587cf8a.js → chunk.524.74a9629dd2ba0d21bbef.js} +7 -7
- package/core/built/admin/assets/{chunk.582.344ea0d0a16d671345cd.js → chunk.582.3846471396b3a7c46e66.js} +8 -8
- package/core/built/admin/assets/{code-editor-view-Bz6kXDiv.js → code-editor-view-C8l3gNnO.js} +1 -1
- package/core/built/admin/assets/{comments-C-lkEDkz.js → comments-CpHDoxov.js} +1 -1
- package/core/built/admin/assets/{copy-BFuV16bY.js → copy-DWiB-781.js} +1 -1
- package/core/built/admin/assets/{data-list-Bw1CQEZ9.js → data-list-yngXNZDF.js} +1 -1
- package/core/built/admin/assets/{deleted-feed-item-CmNbSYiO.js → deleted-feed-item-C0FcyLMN.js} +1 -1
- package/core/built/admin/assets/{edit-profile-DlIPB2km.js → edit-profile-BjtDkDAq.js} +1 -1
- package/core/built/admin/assets/{empty-indicator-DBrIZcFq.js → empty-indicator-BXWniwsl.js} +1 -1
- package/core/built/admin/assets/{en-BBc7b85q.js → en-B8qaJx-T.js} +1 -1
- package/core/built/admin/assets/{feed-B3XQzKZl.js → feed-DsCVb1SA.js} +1 -1
- package/core/built/admin/assets/{filters-DUFXZZnu.js → filters-jAXQSPq6.js} +1 -1
- package/core/built/admin/assets/{gh-chart-BV97-O7c.js → gh-chart-DwTCK8z_.js} +1 -1
- package/core/built/admin/assets/{ghost-9aa1e7c5992f122dba6932af78bf8e56.js → ghost-6367d022df9db9dacbcb9bfa30232ec7.js} +2 -2
- package/core/built/admin/assets/{growth-njR0GqK2.js → growth-DshcRqda.js} +1 -1
- package/core/built/admin/assets/{hash-CdH0ikFp.js → hash-p9dv0yuc.js} +1 -1
- package/core/built/admin/assets/{inbox-Bd0uf1Ez.js → inbox-CRoP9sy5.js} +1 -1
- package/core/built/admin/assets/{index-Kji6JKl7.js → index-6syrC9X1.js} +1 -1
- package/core/built/admin/assets/{index-C7M19LpB.js → index-BKtz3UH0.js} +1 -1
- package/core/built/admin/assets/{index-DWk7hKRR.js → index-BwY94Fb4.js} +1 -1
- package/core/built/admin/assets/{index-BFhECYgc.js → index-C3DF6aFe.js} +1 -1
- package/core/built/admin/assets/index-C6NCNp1B.js +1 -0
- package/core/built/admin/assets/{index-BYawr8p9.js → index-CJU9a2PB.js} +3 -3
- package/core/built/admin/assets/{index-CIE2_z5J.js → index-CUWE7aD1.js} +1 -1
- package/core/built/admin/assets/{index-DgRIbSpg.js → index-CuQ_II0e.js} +1 -1
- package/core/built/admin/assets/{index-Birw80cQ.js → index-DG8f-HuU.js} +1 -1
- package/core/built/admin/assets/{index-DziHC2du.js → index-DItZTRQ4.js} +1 -1
- package/core/built/admin/assets/{index-DG53N3Xt.js → index-eLx96SEn.js} +1 -1
- package/core/built/admin/assets/{index-DCw6JaEl.js → index-j2_Q-_8H.js} +1 -1
- package/core/built/admin/assets/{index-BZ21H0xH.js → index-qWpHJAMP.js} +1 -1
- package/core/built/admin/assets/{index-DXCu9e7c.js → index-sy6xRtoO.js} +1 -1
- package/core/built/admin/assets/{koenig-lexical-BDJVCHtm.js → koenig-lexical-DgAlBHHS.js} +1 -1
- package/core/built/admin/assets/{kpi-card-cv8roErt.js → kpi-card-CHZSLw4p.js} +1 -1
- package/core/built/admin/assets/{kpis-Dt4OFY3L.js → kpis-DzbAHfKK.js} +1 -1
- package/core/built/admin/assets/{links-08beB3Ij.js → links-BQHRbn46.js} +1 -1
- package/core/built/admin/assets/{lucide-react-DKlmxVQI.js → lucide-react-B7UnD_Dp.js} +1 -1
- package/core/built/admin/assets/{main-layout-Cl09wG7F.js → main-layout-9nmU5WlG.js} +1 -1
- package/core/built/admin/assets/{message-square-text-CaMVBVPr.js → message-square-text-CS3iRuPc.js} +1 -1
- package/core/built/admin/assets/{minus-2XwCoFJV.js → minus-emzwh6hq.js} +1 -1
- package/core/built/admin/assets/{modals-CIgzYQgv.js → modals-CumFuZ2d.js} +1 -1
- package/core/built/admin/assets/{moderation-FjlsSym6.js → moderation-DyfFc9m4.js} +1 -1
- package/core/built/admin/assets/{newsletter-BNOwZNlE.js → newsletter-BWul5IFc.js} +1 -1
- package/core/built/admin/assets/{newsletters-DUusEYSg.js → newsletters-N6bwI1OF.js} +1 -1
- package/core/built/admin/assets/{note-BpYwIDK6.js → note-CiBzkHzz.js} +1 -1
- package/core/built/admin/assets/{overview-Y5QYPClr.js → overview-D9gRvn7X.js} +1 -1
- package/core/built/admin/assets/{pagemenu-BMXHDXYy.js → pagemenu-aHubMPwB.js} +1 -1
- package/core/built/admin/assets/{post-analytics-UerFnJse.js → post-analytics-Bm9xH8nA.js} +1 -1
- package/core/built/admin/assets/{post-analytics-context-geHk7rOj.js → post-analytics-context-C7oW3aBz.js} +1 -1
- package/core/built/admin/assets/{post-analytics-header-DXfc4KeX.js → post-analytics-header-BjGFgN6A.js} +1 -1
- package/core/built/admin/assets/{post-share-modal-Dql4fYjR.js → post-share-modal-Su923uIc.js} +1 -1
- package/core/built/admin/assets/{posts-Bsvw11Zo.js → posts-BwP7BNcB.js} +1 -1
- package/core/built/admin/assets/{referrers-B8xJpCcR.js → referrers-n_ln9DqI.js} +1 -1
- package/core/built/admin/assets/{repeat-COP-3g8d.js → repeat-ms5ocvE0.js} +1 -1
- package/core/built/admin/assets/{reply-JE8tmvOn.js → reply-BvO85IDn.js} +1 -1
- package/core/built/admin/assets/{select-BhvNY3I-.js → select-B4QhMW5f.js} +1 -1
- package/core/built/admin/assets/{settings-BJwVfuWG.js → settings-D5rGcWJ7.js} +4 -4
- package/core/built/admin/assets/{settings-C6ZUZQe4.js → settings-QtZ6a2TL.js} +1 -1
- package/core/built/admin/assets/{sort-button-iOtR-vQ1.js → sort-button-84sYUZMN.js} +1 -1
- package/core/built/admin/assets/{source-icon-C2iFWMlV.js → source-icon-Bzw-AU8p.js} +1 -1
- package/core/built/admin/assets/{sprout-BW9HFVU8.js → sprout-C2R5CbXV.js} +1 -1
- package/core/built/admin/assets/{square-BCNGSZhW.js → square-DT1uWkxs.js} +1 -1
- package/core/built/admin/assets/stats/{audience-select-DNAWmT7R.mjs → audience-select-fTCiZ9MT.mjs} +3 -3
- package/core/built/admin/assets/stats/{index-DbGvSTMe.mjs → index-BKgioyC7.mjs} +5 -5
- package/core/built/admin/assets/stats/{index-s19ZmxbX.mjs → index-CR2t5Xd-.mjs} +5 -5
- package/core/built/admin/assets/stats/index-DEkYwR7C.mjs +739 -0
- package/core/built/admin/assets/stats/{index-BS3KMSy9.mjs → index-Djwey97a.mjs} +5 -5
- package/core/built/admin/assets/stats/{index-MOQSSYwT.mjs → index-FiU_XgEe.mjs} +6 -6
- package/core/built/admin/assets/stats/{sort-button-D76rcldr.mjs → sort-button-Bvi1wfa7.mjs} +3 -3
- package/core/built/admin/assets/stats/{stats-CJ7fhUyT.mjs → stats-Bbm6yWZq.mjs} +2 -2
- package/core/built/admin/assets/stats/stats.js +1 -1
- package/core/built/admin/assets/stats/{tabs-CkbxYgOE.mjs → tabs-BKwH5k-q.mjs} +3 -3
- package/core/built/admin/assets/stats/{url-helpers-DICtqCrE.mjs → url-helpers-DmHnUIGc.mjs} +9 -9
- package/core/built/admin/assets/stats/{use-growth-stats-DzO7zEy4.mjs → use-growth-stats-BVj3j1hb.mjs} +3 -3
- package/core/built/admin/assets/{stats-r0Bphuvi.js → stats-B1mhlQSp.js} +1 -1
- package/core/built/admin/assets/{stats-view-DzZxrBDz.js → stats-view-C6MTCwRW.js} +1 -1
- package/core/built/admin/assets/{step-1-CUoUOyMm.js → step-1-CzQmZJ93.js} +1 -1
- package/core/built/admin/assets/{step-2-CpAkPD8D.js → step-2-DXGDWSQo.js} +1 -1
- package/core/built/admin/assets/{step-3-Ci6oJDmK.js → step-3-CYuxXKac.js} +1 -1
- package/core/built/admin/assets/{table-DeBuf80X.js → table-mjAkKNdb.js} +1 -1
- package/core/built/admin/assets/{tabs-C2sFfNcp.js → tabs-BwQ-i6MY.js} +1 -1
- package/core/built/admin/assets/{tags-Bl6G5rvf.js → tags-BkUqCuvX.js} +1 -1
- package/core/built/admin/assets/{tags-BL_N4nn2.js → tags-DXDZbfxp.js} +1 -1
- package/core/built/admin/assets/{toggle-group-B2X-8giI.js → toggle-group-CqDO3Kkx.js} +1 -1
- package/core/built/admin/assets/{topic-filter-DeqMID_s.js → topic-filter-DnuJJBAE.js} +1 -1
- package/core/built/admin/assets/{trash-BglGemAb.js → trash-CZ3EXwTL.js} +1 -1
- package/core/built/admin/assets/{url-helpers-84icqAuE.js → url-helpers-BE3VXr__.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-DF-7tL8g.js → use-growth-stats-CiuWWM6O.js} +1 -1
- package/core/built/admin/assets/{use-infinite-virtual-scroll-BHH7oscK.js → use-infinite-virtual-scroll-BjATkxBj.js} +1 -1
- package/core/built/admin/assets/{use-simple-pagination-BsvYfixw.js → use-simple-pagination-C9cb7dDz.js} +1 -1
- package/core/built/admin/assets/{user-round-check-BjHbfXKY.js → user-round-check-D3ihrrKL.js} +1 -1
- package/core/built/admin/assets/{wallet-cards-KaTkgqvi.js → wallet-cards-Do7nPf3f.js} +1 -1
- package/core/built/admin/assets/{web-CUWbpFil.js → web-BEwI2Gfy.js} +1 -1
- package/core/built/admin/index-forward.html +4 -4
- package/core/built/admin/index.html +3 -3
- package/core/frontend/web/middleware/index.js +1 -0
- package/core/frontend/web/middleware/serve-indexnow-key.js +66 -0
- package/core/frontend/web/site.js +3 -0
- package/core/server/api/endpoints/authentication.js +1 -1
- package/core/server/api/endpoints/pages.js +1 -1
- package/core/server/api/endpoints/posts-public.js +1 -1
- package/core/server/api/endpoints/posts.js +1 -1
- package/core/server/api/endpoints/search-index-public.js +1 -1
- package/core/server/api/endpoints/search-index.js +1 -1
- package/core/server/api/endpoints/users.js +1 -1
- package/core/server/api/endpoints/utils/serializers/input/settings.js +2 -1
- package/core/server/api/endpoints/utils/serializers/output/mappers/posts.js +1 -1
- package/core/server/api/endpoints/utils/validators/input/settings.js +1 -1
- package/core/server/data/exporter/table-lists.js +2 -1
- package/core/server/data/migrations/versions/6.12/2026-01-08-11-48-16-add-indexnow-api-key-setting.js +9 -0
- package/core/server/data/schema/default-settings/default-settings.json +6 -0
- package/core/server/lib/lexical.js +1 -1
- package/core/server/models/settings.js +2 -1
- package/core/server/services/activitypub/{ActivityPubServiceWrapper.js → activity-pub-service-wrapper.js} +1 -1
- package/core/server/services/activitypub/{ActivityPubService.ts → activity-pub-service.ts} +1 -1
- package/core/server/services/activitypub/index.js +1 -1
- package/core/server/services/adapter-manager/index.js +1 -1
- package/core/server/services/announcement-bar-service/{AnnouncementBarSettings.js → announcement-bar-settings.js} +1 -1
- package/core/server/services/announcement-bar-service/index.js +1 -1
- package/core/server/services/audience-feedback/{AudienceFeedbackController.js → audience-feedback-controller.js} +3 -3
- package/core/server/services/audience-feedback/index.js +4 -4
- package/core/server/services/auth/session/express-session.js +1 -1
- package/core/server/services/comments/{CommentsController.js → comments-controller.js} +2 -2
- package/core/server/services/comments/{CommentsServiceEmails.js → comments-service-emails.js} +1 -1
- package/core/server/services/comments/{CommentsService.js → comments-service.js} +1 -1
- package/core/server/services/comments/index.js +3 -3
- package/core/server/services/custom-redirects/index.js +2 -2
- package/core/server/services/donations/{DonationBookshelfRepository.ts → donation-bookshelf-repository.ts} +1 -1
- package/core/server/services/donations/{DonationServiceWrapper.js → donation-service-wrapper.js} +1 -1
- package/core/server/services/donations/index.js +1 -1
- package/core/server/services/email-address/{EmailAddressServiceWrapper.js → email-address-service-wrapper.js} +2 -2
- package/core/server/services/email-address/{EmailAddressService.js → email-address-service.js} +4 -4
- package/core/server/services/email-address/{EmailAddressService.ts → email-address-service.ts} +1 -1
- package/core/server/services/email-address/index.js +1 -1
- package/core/server/services/email-analytics/{EmailAnalyticsProviderMailgun.js → email-analytics-provider-mailgun.js} +1 -1
- package/core/server/services/email-analytics/{EmailAnalyticsServiceWrapper.js → email-analytics-service-wrapper.js} +5 -5
- package/core/server/services/email-analytics/{EmailAnalyticsService.js → email-analytics-service.js} +2 -2
- package/core/server/services/email-analytics/index.js +1 -1
- package/core/server/services/email-analytics/jobs/fetch-latest/index.js +1 -1
- package/core/server/services/email-service/{BatchSendingService.js → batch-sending-service.js} +8 -8
- package/core/server/services/email-service/{EmailEventProcessor.js → email-event-processor.js} +6 -6
- package/core/server/services/email-service/{EmailEventStorage.js → email-event-storage.js} +1 -1
- package/core/server/services/email-service/{EmailRenderer.js → email-renderer.js} +1 -1
- package/core/server/services/email-service/{EmailServiceWrapper.js → email-service-wrapper.js} +9 -9
- package/core/server/services/email-service/{EmailService.js → email-service.js} +13 -13
- package/core/server/services/email-service/index.js +1 -1
- package/core/server/services/email-service/{MailgunEmailProvider.js → mailgun-email-provider.js} +1 -1
- package/core/server/services/email-service/{SendingService.js → sending-service.js} +6 -6
- package/core/server/services/email-suppression-list/{InMemoryEmailSuppressionList.js → in-memory-email-suppression-list.js} +1 -1
- package/core/server/services/email-suppression-list/{MailgunEmailSuppressionList.js → mailgun-email-suppression-list.js} +3 -3
- package/core/server/services/email-suppression-list/service.js +2 -2
- package/core/server/services/explore/index.js +2 -2
- package/core/server/services/explore-ping/index.js +2 -2
- package/core/server/services/frontend-data-service/index.js +1 -1
- package/core/server/services/identity-tokens/{IdentityTokenServiceWrapper.js → identity-token-service-wrapper.js} +1 -1
- package/core/server/services/identity-tokens/index.js +1 -1
- package/core/server/services/indexnow.js +212 -0
- package/core/server/services/invites/index.js +1 -1
- package/core/server/services/link-redirection/index.js +2 -2
- package/core/server/services/link-redirection/{LinkRedirectRepository.js → link-redirect-repository.js} +1 -1
- package/core/server/services/link-redirection/{LinkRedirectsService.js → link-redirects-service.js} +2 -2
- package/core/server/services/link-redirection/{RedirectEvent.js → redirect-event.js} +1 -1
- package/core/server/services/link-tracking/index.js +3 -3
- package/core/server/services/link-tracking/{LinkClickRepository.js → link-click-repository.js} +1 -1
- package/core/server/services/link-tracking/{LinkClickTrackingService.js → link-click-tracking-service.js} +4 -4
- package/core/server/services/link-tracking/{PostLinkRepository.js → post-link-repository.js} +7 -7
- package/core/server/services/mail/{GhostMailer.js → ghost-mailer.js} +1 -1
- package/core/server/services/mail/index.js +2 -2
- package/core/server/services/media-inliner/service.js +1 -1
- package/core/server/services/member-attribution/README.md +6 -6
- package/core/server/services/member-attribution/{AttributionBuilder.js → attribution-builder.js} +4 -4
- package/core/server/services/member-attribution/index.js +5 -5
- package/core/server/services/member-attribution/{MemberAttributionService.js → member-attribution-service.js} +9 -9
- package/core/server/services/member-attribution/{ReferrerTranslator.js → referrer-translator.js} +1 -1
- package/core/server/services/member-attribution/{UrlTranslator.js → url-translator.js} +1 -1
- package/core/server/services/member-welcome-emails/constants.js +22 -1
- package/core/server/services/member-welcome-emails/service.js +23 -5
- package/core/server/services/members/api.js +1 -1
- package/core/server/services/members/importer/index.js +3 -3
- package/core/server/services/members/importer/{MembersCSVImporter.js → members-csv-importer.js} +2 -2
- package/core/server/services/members/members-api/members-api.js +14 -14
- package/core/server/services/members/members-api/repositories/{MemberRepository.js → member-repository.js} +17 -8
- package/core/server/services/members/members-api/services/{MemberBREADService.js → member-bread-service.js} +1 -1
- package/core/server/services/members/members-api/services/{PaymentsService.js → payments-service.js} +12 -12
- package/core/server/services/members/service.js +4 -4
- package/core/server/services/members-events/index.js +3 -3
- package/core/server/services/members-events/{LastSeenAtUpdater.js → last-seen-at-updater.js} +2 -2
- package/core/server/services/mentions/{BookshelfMentionRepository.js → bookshelf-mention-repository.js} +9 -9
- package/core/server/services/mentions/{InMemoryMentionRepository.js → in-memory-mention-repository.js} +4 -4
- package/core/server/services/mentions/{MentionController.js → mention-controller.js} +5 -5
- package/core/server/services/mentions/{MentionCreatedEvent.js → mention-created-event.js} +1 -1
- package/core/server/services/mentions/{Mention.js → mention.js} +1 -1
- package/core/server/services/mentions/{MentionsAPI.js → mentions-api.js} +1 -1
- package/core/server/services/mentions/{ResourceService.js → resource-service.js} +2 -2
- package/core/server/services/mentions/{RoutingService.js → routing-service.js} +2 -2
- package/core/server/services/mentions/service.js +11 -11
- package/core/server/services/mentions/{WebmentionMetadata.js → webmention-metadata.js} +1 -1
- package/core/server/services/mentions-email-report/job.js +1 -1
- package/core/server/services/mentions-email-report/{MentionEmailReportJob.js → mention-email-report-job.js} +1 -1
- package/core/server/services/mentions-email-report/service.js +2 -2
- package/core/server/services/milestones/{BookshelfMilestoneRepository.js → bookshelf-milestone-repository.js} +2 -2
- package/core/server/services/milestones/{InMemoryMilestoneRepository.js → in-memory-milestone-repository.js} +2 -2
- package/core/server/services/milestones/{Milestone.js → milestone.js} +1 -1
- package/core/server/services/milestones/{MilestonesService.js → milestones-service.js} +1 -1
- package/core/server/services/milestones/service.js +4 -4
- package/core/server/services/newsletters/index.js +2 -2
- package/core/server/services/newsletters/{NewslettersService.js → newsletters-service.js} +1 -1
- package/core/server/services/notifications/index.js +1 -1
- package/core/server/services/oembed/service.js +3 -3
- package/core/server/services/offers/application/{OfferMapper.js → offer-mapper.js} +1 -1
- package/core/server/services/offers/application/{OffersAPI.js → offers-api.js} +9 -9
- package/core/server/services/offers/application/{UniqueChecker.js → unique-checker.js} +2 -2
- package/core/server/services/offers/domain/events/{OfferCodeChangeEvent.js → offer-code-change-event.js} +1 -1
- package/core/server/services/offers/domain/events/{OfferCreatedEvent.js → offer-created-event.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferAmount.js → offer-amount.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferCadence.js → offer-cadence.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferCode.js → offer-code.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferCreatedAt.js → offer-created-at.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferCurrency.js → offer-currency.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferDescription.js → offer-description.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferDuration.js → offer-duration.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferName.js → offer-name.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferStatus.js → offer-status.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferTitle.js → offer-title.js} +1 -1
- package/core/server/services/offers/domain/models/{OfferType.js → offer-type.js} +1 -1
- package/core/server/services/offers/domain/models/{Offer.js → offer.js} +14 -14
- package/core/server/services/offers/domain/models/{StripeCoupon.js → stripe-coupon.js} +1 -1
- package/core/server/services/offers/{OfferBookshelfRepository.js → offer-bookshelf-repository.js} +6 -6
- package/core/server/services/offers/{OffersModule.js → offers-module.js} +4 -4
- package/core/server/services/offers/service.js +3 -3
- package/core/server/services/outbox/index.js +2 -2
- package/core/server/services/outbox/jobs/outbox-job.js +2 -2
- package/core/server/services/posts/posts-service-instance.js +47 -0
- package/core/server/services/posts/posts-service.js +572 -45
- package/core/server/services/recommendations/index.js +1 -1
- package/core/server/services/recommendations/{RecommendationEnablerService.js → recommendation-enabler-service.js} +2 -2
- package/core/server/services/recommendations/{RecommendationServiceWrapper.js → recommendation-service-wrapper.js} +2 -2
- package/core/server/services/recommendations/service/{BookshelfClickEventRepository.js → bookshelf-click-event-repository.js} +4 -4
- package/core/server/services/recommendations/service/{BookshelfClickEventRepository.ts → bookshelf-click-event-repository.ts} +2 -2
- package/core/server/services/recommendations/service/{BookshelfRecommendationRepository.js → bookshelf-recommendation-repository.js} +4 -4
- package/core/server/services/recommendations/service/{BookshelfRecommendationRepository.ts → bookshelf-recommendation-repository.ts} +3 -3
- package/core/server/services/recommendations/service/{BookshelfSubscribeEventRepository.js → bookshelf-subscribe-event-repository.js} +4 -4
- package/core/server/services/recommendations/service/{BookshelfSubscribeEventRepository.ts → bookshelf-subscribe-event-repository.ts} +2 -2
- package/core/server/services/recommendations/service/{InMemoryRecommendationRepository.js → in-memory-recommendation-repository.js} +2 -2
- package/core/server/services/recommendations/service/{InMemoryRecommendationRepository.ts → in-memory-recommendation-repository.ts} +3 -3
- package/core/server/services/recommendations/service/{IncomingRecommendationController.js → incoming-recommendation-controller.js} +2 -2
- package/core/server/services/recommendations/service/{IncomingRecommendationController.ts → incoming-recommendation-controller.ts} +3 -3
- package/core/server/services/recommendations/service/{IncomingRecommendationEmailRenderer.ts → incoming-recommendation-email-renderer.ts} +2 -2
- package/core/server/services/recommendations/service/{IncomingRecommendationService.ts → incoming-recommendation-service.ts} +2 -2
- package/core/server/services/recommendations/service/index.js +15 -15
- package/core/server/services/recommendations/service/index.ts +15 -15
- package/core/server/services/recommendations/service/{RecommendationController.js → recommendation-controller.js} +13 -13
- package/core/server/services/recommendations/service/{RecommendationController.ts → recommendation-controller.ts} +4 -4
- package/core/server/services/recommendations/service/{RecommendationRepository.ts → recommendation-repository.ts} +3 -3
- package/core/server/services/recommendations/service/{RecommendationService.js → recommendation-service.js} +6 -6
- package/core/server/services/recommendations/service/{RecommendationService.ts → recommendation-service.ts} +8 -8
- package/core/server/services/recommendations/service/{Recommendation.js → recommendation.js} +4 -4
- package/core/server/services/recommendations/service/{Recommendation.ts → recommendation.ts} +1 -1
- package/core/server/services/recommendations/service/{WellknownService.ts → well-known-service.ts} +1 -1
- package/core/server/services/route-settings/index.js +4 -4
- package/core/server/services/settings/{SettingsBREADService.js → settings-bread-service.js} +1 -1
- package/core/server/services/settings/settings-service.js +2 -2
- package/core/server/services/settings-helpers/index.js +1 -1
- package/core/server/services/settings-helpers/{SettingsHelpers.js → settings-helpers.js} +5 -5
- package/core/server/services/slack-notifications/service.js +4 -4
- package/core/server/services/slack-notifications/{SlackNotificationsService.js → slack-notifications-service.js} +2 -2
- package/core/server/services/slack-notifications/{SlackNotifications.js → slack-notifications.js} +2 -2
- package/core/server/services/staff/index.js +1 -1
- package/core/server/services/staff/{StaffServiceEmails.js → staff-service-emails.js} +2 -2
- package/core/server/services/staff/{StaffService.js → staff-service.js} +2 -2
- package/core/server/services/stats/{PostsStatsService.js → posts-stats-service.js} +25 -25
- package/core/server/services/stats/{ReferrersStatsService.js → referrers-stats-service.js} +3 -3
- package/core/server/services/stats/service.js +1 -1
- package/core/server/services/stats/{StatsService.js → stats-service.js} +23 -23
- package/core/server/services/stripe/events/index.js +2 -2
- package/core/server/services/stripe/service.js +1 -1
- package/core/server/services/stripe/services/webhook/{CheckoutSessionEventService.js → checkout-session-event-service.js} +2 -2
- package/core/server/services/stripe/{StripeMigrations.js → stripe-migrations.js} +1 -1
- package/core/server/services/stripe/{StripeService.js → stripe-service.js} +8 -8
- package/core/server/services/stripe/{WebhookController.js → webhook-controller.js} +4 -4
- package/core/server/services/stripe/{WebhookManager.js → webhook-manager.js} +5 -5
- package/core/server/services/themes/storage.js +1 -1
- package/core/server/services/tiers/{InMemoryTierRepository.js → in-memory-tier-repository.js} +1 -1
- package/core/server/services/tiers/service.js +2 -2
- package/core/server/services/tiers/{TierActivatedEvent.js → tier-activated-event.js} +1 -1
- package/core/server/services/tiers/{TierArchivedEvent.js → tier-archived-event.js} +1 -1
- package/core/server/services/tiers/{TierCreatedEvent.js → tier-created-event.js} +1 -1
- package/core/server/services/tiers/{TierNameChangeEvent.js → tier-name-change-event.js} +1 -1
- package/core/server/services/tiers/{TierPriceChangeEvent.js → tier-price-change-event.js} +1 -1
- package/core/server/services/tiers/{TierRepository.js → tier-repository.js} +7 -7
- package/core/server/services/tiers/{Tier.js → tier.js} +5 -5
- package/core/server/services/tiers/{TiersAPI.js → tiers-api.js} +1 -1
- package/core/server/services/tinybird/index.js +1 -1
- package/core/server/services/tinybird/{TinybirdServiceWrapper.js → tinybird-service-wrapper.js} +2 -2
- package/core/server/services/update-check/index.js +1 -1
- package/core/server/services/url/index.js +2 -2
- package/core/server/services/url/{Resources.js → resources.js} +1 -1
- package/core/server/services/url/{UrlGenerator.js → url-generator.js} +1 -1
- package/core/server/services/url/{UrlService.js → url-service.js} +4 -4
- package/core/server/services/url/{Urls.js → urls.js} +1 -1
- package/core/server/services/webhooks/listen.js +1 -1
- package/core/shared/labs.js +2 -1
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/components/tryghost-i18n-6.11.0.tgz +0 -0
- package/core/built/admin/assets/index-Cr_YX9yU.js +0 -1
- package/core/built/admin/assets/stats/index-BBCJ2EZo.mjs +0 -733
- package/core/server/services/posts/PostsService.js +0 -574
- /package/core/server/{GhostServer.js → ghost-server.js} +0 -0
- /package/core/server/services/activitypub/{ActivityPubService.js → activity-pub-service.js} +0 -0
- /package/core/server/services/adapter-manager/{AdapterManager.js → adapter-manager.js} +0 -0
- /package/core/server/services/announcement-bar-service/{AnnouncementVisibilityValues.js → announcement-visibility-values.js} +0 -0
- /package/core/server/services/audience-feedback/{AudienceFeedbackService.js → audience-feedback-service.js} +0 -0
- /package/core/server/services/audience-feedback/{FeedbackRepository.js → feedback-repository.js} +0 -0
- /package/core/server/services/audience-feedback/{Feedback.js → feedback.js} +0 -0
- /package/core/server/services/auth/session/{SessionStore.js → session-store.js} +0 -0
- /package/core/server/services/comments/{CommentsServiceEmailRenderer.js → comments-service-email-renderer.js} +0 -0
- /package/core/server/services/comments/{CommentsStatsService.js → comments-stats-service.js} +0 -0
- /package/core/server/services/custom-redirects/{CustomRedirectsAPI.js → custom-redirects-api.js} +0 -0
- /package/core/server/services/donations/{DonationBookshelfRepository.js → donation-bookshelf-repository.js} +0 -0
- /package/core/server/services/donations/{DonationPaymentEvent.js → donation-payment-event.js} +0 -0
- /package/core/server/services/donations/{DonationPaymentEvent.ts → donation-payment-event.ts} +0 -0
- /package/core/server/services/email-address/{EmailAddressParser.js → email-address-parser.js} +0 -0
- /package/core/server/services/email-address/{EmailAddressParser.js.d.ts → email-address-parser.js.d.ts} +0 -0
- /package/core/server/services/email-analytics/{EventProcessingResult.js → event-processing-result.js} +0 -0
- /package/core/server/services/email-analytics/events/{StartEmailAnalyticsJobEvent.js → start-email-analytics-job-event.js} +0 -0
- /package/core/server/services/email-service/{DomainWarmingService.js → domain-warming-service.js} +0 -0
- /package/core/server/services/email-service/{DomainWarmingService.ts → domain-warming-service.ts} +0 -0
- /package/core/server/services/email-service/{EmailBodyCache.js → email-body-cache.js} +0 -0
- /package/core/server/services/email-service/{EmailController.js → email-controller.js} +0 -0
- /package/core/server/services/email-service/{EmailSegmenter.js → email-segmenter.js} +0 -0
- /package/core/server/services/email-service/events/{EmailBouncedEvent.js → email-bounced-event.js} +0 -0
- /package/core/server/services/email-service/events/{EmailDeliveredEvent.js → email-delivered-event.js} +0 -0
- /package/core/server/services/email-service/events/{EmailOpenedEvent.js → email-opened-event.js} +0 -0
- /package/core/server/services/email-service/events/{EmailTemporaryBouncedEvent.js → email-temporary-bounced-event.js} +0 -0
- /package/core/server/services/email-service/events/{EmailUnsubscribedEvent.js → email-unsubscribed-event.js} +0 -0
- /package/core/server/services/email-service/events/{SpamComplaintEvent.js → spam-complaint-event.js} +0 -0
- /package/core/server/services/email-suppression-list/{EmailSuppressionList.js → email-suppression-list.js} +0 -0
- /package/core/server/services/explore/{ExploreService.js → explore-service.js} +0 -0
- /package/core/server/services/explore-ping/{ExplorePingService.js → explore-ping-service.js} +0 -0
- /package/core/server/services/frontend-data-service/{FrontendDataService.js → front-end-data-service.js} +0 -0
- /package/core/server/services/identity-tokens/{IdentityTokenService.js → identity-token-service.js} +0 -0
- /package/core/server/services/identity-tokens/{IdentityTokenService.ts → identity-token-service.ts} +0 -0
- /package/core/server/services/invites/{Invites.js → invites.js} +0 -0
- /package/core/server/services/lib/{DynamicRedirectManager.js → dynamic-redirect-manager.js} +0 -0
- /package/core/server/services/lib/{EmailContentGenerator.js → email-content-generator.js} +0 -0
- /package/core/server/services/lib/{InMemoryRepository.js → in-memory-repository.js} +0 -0
- /package/core/server/services/lib/{InMemoryRepository.ts → in-memory-repository.ts} +0 -0
- /package/core/server/services/lib/magic-link/{MagicLink.js → magic-link.js} +0 -0
- /package/core/server/services/lib/{MailgunClient.js → mailgun-client.js} +0 -0
- /package/core/server/services/link-redirection/{LinkRedirect.js → link-redirect.js} +0 -0
- /package/core/server/services/link-tracking/{ClickEvent.js → click-event.js} +0 -0
- /package/core/server/services/link-tracking/{FullPostLink.js → full-post-link.js} +0 -0
- /package/core/server/services/link-tracking/{PostLink.js → post-link.js} +0 -0
- /package/core/server/services/media-inliner/{ExternalMediaInliner.js → external-media-inliner.js} +0 -0
- /package/core/server/services/member-attribution/{OutboundLinkTagger.js → outbound-link-tagger.js} +0 -0
- /package/core/server/services/member-attribution/{UrlHistory.js → url-history.js} +0 -0
- /package/core/server/services/member-welcome-emails/{MemberWelcomeEmailRenderer.js → member-welcome-email-renderer.js} +0 -0
- /package/core/server/services/members/importer/{MembersCSVImporterStripeUtils.js → members-csv-importer-stripe-utils.js} +0 -0
- /package/core/server/services/members/members-api/controllers/{MemberController.js → member-controller.js} +0 -0
- /package/core/server/services/members/members-api/controllers/{RouterController.js → router-controller.js} +0 -0
- /package/core/server/services/members/members-api/controllers/{WellKnownController.js → well-known-controller.js} +0 -0
- /package/core/server/services/members/members-api/repositories/{EventRepository.js → event-repository.js} +0 -0
- /package/core/server/services/members/members-api/repositories/{ProductRepository.js → product-repository.js} +0 -0
- /package/core/server/services/members/members-api/services/{GeolocationService.js → geolocation-service.js} +0 -0
- /package/core/server/services/members/members-api/services/{TokenService.js → token-service.js} +0 -0
- /package/core/server/services/members/{MembersConfigProvider.js → members-config-provider.js} +0 -0
- /package/core/server/services/members/{RequestIntegrityTokenProvider.js → request-integrity-token-provider.js} +0 -0
- /package/core/server/services/members/{SingleUseTokenProvider.js → single-use-token-provider.js} +0 -0
- /package/core/server/services/members/stats/{MembersStats.js → members-stats.js} +0 -0
- /package/core/server/services/members-events/{EventStorage.js → event-storage.js} +0 -0
- /package/core/server/services/members-events/{LastSeenAtCache.js → last-seen-at-cache.js} +0 -0
- /package/core/server/services/mentions/{MentionDiscoveryService.js → mention-discovery-service.js} +0 -0
- /package/core/server/services/mentions/{MentionSendingService.js → mention-sending-service.js} +0 -0
- /package/core/server/services/mentions-email-report/{StartMentionEmailReportJob.js → start-mention-email-report-job.js} +0 -0
- /package/core/server/services/milestones/{MilestoneCreatedEvent.js → milestone-created-event.js} +0 -0
- /package/core/server/services/milestones/{MilestoneQueries.js → milestone-queries.js} +0 -0
- /package/core/server/services/notifications/{Notifications.js → notifications.js} +0 -0
- /package/core/server/services/oembed/{NFTOEmbedProvider.js → nft-oembed-provider.js} +0 -0
- /package/core/server/services/oembed/{OEmbedService.js → oembed-service.js} +0 -0
- /package/core/server/services/oembed/{TwitterOEmbedProvider.js → twitter-oembed-provider.js} +0 -0
- /package/core/server/services/offers/domain/models/shared/{ValueObject.js → value-object.js} +0 -0
- /package/core/server/services/outbox/events/{StartOutboxProcessingEvent.js → start-outbox-processing-event.js} +0 -0
- /package/core/server/services/posts/{PostsExporter.js → posts-exporter.js} +0 -0
- /package/core/server/services/posts/stats/{PostStats.js → post-stats.js} +0 -0
- /package/core/server/services/recommendations/service/{BookshelfRepository.js → bookshelf-repository.js} +0 -0
- /package/core/server/services/recommendations/service/{BookshelfRepository.ts → bookshelf-repository.ts} +0 -0
- /package/core/server/services/recommendations/service/{ClickEvent.js → click-event.js} +0 -0
- /package/core/server/services/recommendations/service/{ClickEvent.ts → click-event.ts} +0 -0
- /package/core/server/services/recommendations/service/{IncomingRecommendationEmailRenderer.js → incoming-recommendation-email-renderer.js} +0 -0
- /package/core/server/services/recommendations/service/{IncomingRecommendationService.js → incoming-recommendation-service.js} +0 -0
- /package/core/server/services/recommendations/service/{RecommendationMetadataService.js → recommendation-metadata-service.js} +0 -0
- /package/core/server/services/recommendations/service/{RecommendationMetadataService.ts → recommendation-metadata-service.ts} +0 -0
- /package/core/server/services/recommendations/service/{RecommendationRepository.js → recommendation-repository.js} +0 -0
- /package/core/server/services/recommendations/service/{SubscribeEvent.js → subscribe-event.js} +0 -0
- /package/core/server/services/recommendations/service/{SubscribeEvent.ts → subscribe-event.ts} +0 -0
- /package/core/server/services/recommendations/service/{UnsafeData.js → unsafe-data.js} +0 -0
- /package/core/server/services/recommendations/service/{UnsafeData.ts → unsafe-data.ts} +0 -0
- /package/core/server/services/recommendations/service/{WellknownService.js → well-known-service.js} +0 -0
- /package/core/server/services/route-settings/{DefaultSettingsManager.js → default-settings-manager.js} +0 -0
- /package/core/server/services/route-settings/{RouteSettings.js → route-settings.js} +0 -0
- /package/core/server/services/route-settings/{SettingsLoader.js → settings-loader.js} +0 -0
- /package/core/server/services/route-settings/{SettingsPathManager.js → settings-path-manager.js} +0 -0
- /package/core/server/services/stats/{ContentStatsService.js → content-stats-service.js} +0 -0
- /package/core/server/services/stats/{MembersStatsService.js → members-stats-service.js} +0 -0
- /package/core/server/services/stats/{MrrStatsService.js → mrr-stats-service.js} +0 -0
- /package/core/server/services/stats/{SubscriptionStatsService.js → subscription-stats-service.js} +0 -0
- /package/core/server/services/stripe/events/{StripeLiveDisabledEvent.js → stripe-live-disabled-event.js} +0 -0
- /package/core/server/services/stripe/events/{StripeLiveEnabledEvent.js → stripe-live-enabled-event.js} +0 -0
- /package/core/server/services/stripe/services/webhook/{InvoiceEventService.js → invoice-event-service.js} +0 -0
- /package/core/server/services/stripe/services/webhook/{SubscriptionEventService.js → subscription-event-service.js} +0 -0
- /package/core/server/services/stripe/{StripeAPI.js → stripe-api.js} +0 -0
- /package/core/server/services/themes/{ThemeStorage.js → theme-storage.js} +0 -0
- /package/core/server/services/tinybird/{TinybirdService.js → tinybird-service.js} +0 -0
- /package/core/server/services/update-check/{UpdateCheckService.js → update-check-service.js} +0 -0
- /package/core/server/services/url/{LocalFileCache.js → local-file-cache.js} +0 -0
- /package/core/server/services/url/{Queue.js → queue.js} +0 -0
- /package/core/server/services/url/{Resource.js → resource.js} +0 -0
- /package/core/server/services/{Users.js → users.js} +0 -0
- /package/core/server/services/{VerificationTrigger.js → verification-trigger.js} +0 -0
- /package/core/server/services/webhooks/{WebhookTrigger.js → webhook-trigger.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DG8f-HuU.js","assets/minus-emzwh6hq.js","assets/deleted-feed-item-C0FcyLMN.js","assets/trash-CZ3EXwTL.js","assets/topic-filter-DnuJJBAE.js","assets/empty-indicator-BXWniwsl.js","assets/inbox-CRoP9sy5.js","assets/feed-DsCVb1SA.js","assets/hash-p9dv0yuc.js","assets/note-CiBzkHzz.js","assets/index-DItZTRQ4.js","assets/at-sign-CYnGzOFc.js","assets/user-round-check-D3ihrrKL.js","assets/reply-BvO85IDn.js","assets/index-BwY94Fb4.js","assets/sprout-C2R5CbXV.js","assets/index-CuQ_II0e.js","assets/tags-DXDZbfxp.js","assets/edit-profile-BjtDkDAq.js","assets/tabs-BwQ-i6MY.js","assets/index-6syrC9X1.js","assets/lucide-react-B7UnD_Dp.js","assets/a-large-small-BPPu_Iy7.js","assets/wallet-cards-Do7nPf3f.js","assets/message-square-text-CS3iRuPc.js","assets/copy-DWiB-781.js","assets/square-DT1uWkxs.js","assets/repeat-ms5ocvE0.js","assets/settings-QtZ6a2TL.js","assets/index-BKtz3UH0.js","assets/toggle-group-CqDO3Kkx.js","assets/moderation-DyfFc9m4.js","assets/bluesky-sharing-BGcmGcee.js","assets/step-1-CzQmZJ93.js","assets/step-2-DXGDWSQo.js","assets/avatar-flipboard-C9-npfmZ.js","assets/step-3-CYuxXKac.js","assets/post-analytics-context-C7oW3aBz.js","assets/posts-BwP7BNcB.js","assets/post-analytics-Bm9xH8nA.js","assets/main-layout-9nmU5WlG.js","assets/post-share-modal-Su923uIc.js","assets/overview-D9gRvn7X.js","assets/kpi-card-CHZSLw4p.js","assets/pagemenu-aHubMPwB.js","assets/data-list-yngXNZDF.js","assets/links-BQHRbn46.js","assets/chart-CqJxisVP.js","assets/_baseAssignValue-hsL6ItjC.js","assets/post-analytics-header-BjGFgN6A.js","assets/post-helpers-gInwAwEv.js","assets/kpis-DzbAHfKK.js","assets/source-icon-Bzw-AU8p.js","assets/source-utils-B1S3ZHA2.js","assets/gh-chart-DwTCK8z_.js","assets/growth-DshcRqda.js","assets/table-mjAkKNdb.js","assets/currency-fEUUCkj0.js","assets/stats-B1mhlQSp.js","assets/web-BEwI2Gfy.js","assets/select-B4QhMW5f.js","assets/en-B8qaJx-T.js","assets/filters-jAXQSPq6.js","assets/newsletter-BWul5IFc.js","assets/use-simple-pagination-C9cb7dDz.js","assets/tags-BkUqCuvX.js","assets/use-infinite-virtual-scroll-BjATkxBj.js","assets/comments-CpHDoxov.js","assets/index-sy6xRtoO.js","assets/stats-view-C6MTCwRW.js","assets/audience-select-DYoxiiwy.js","assets/use-growth-stats-CiuWWM6O.js","assets/index-C3DF6aFe.js","assets/url-helpers-BE3VXr__.js","assets/index-C6NCNp1B.js","assets/sort-button-84sYUZMN.js","assets/referrers-n_ln9DqI.js","assets/index-CUWE7aD1.js","assets/newsletters-N6bwI1OF.js","assets/settings-D5rGcWJ7.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function UR(e,t){for(var o=0;o<t.length;o++){const n=t[o];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(n,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function o(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=o(r);fetch(r.href,a)}})();var Dr0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sz(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function VR(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var o=function n(){var r=!1;try{r=this instanceof n}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};o.prototype=t.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),o}var xb={exports:{}},Pc={},kb={exports:{}},s1={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -596,7 +596,7 @@ y0.version="2.24.0";KH(T1);y0.fn=h0;y0.min=PV;y0.max=XV;y0.now=jV;y0.utc=qt;y0.u
|
|
|
596
596
|
* See the LICENSE file in the root directory of this source tree.
|
|
597
597
|
*/const RG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bd=U0("x",RG),z3=Yt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",{variants:{variant:{default:"bg-primary font-medium text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive font-medium text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background font-medium hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary font-medium text-secondary-foreground hover:bg-secondary/80 dark:bg-gray-925/70 dark:hover:bg-gray-900",ghost:"font-medium hover:bg-accent hover:text-accent-foreground",link:"font-medium text-primary underline-offset-4 hover:underline",dropdown:"border border-input bg-background hover:bg-accent hover:text-accent-foreground"},size:{default:"h-[34px] px-3 py-2",sm:"h-7 rounded-md px-3 text-xs [&_svg]:size-3",lg:"h-11 rounded-md px-8 text-md font-semibold",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),o1=p.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,children:r,...a},i)=>{const b=n?Vr:"button",l=t==="dropdown"?z.jsxs(z.Fragment,{children:[r,z.jsx(MZ,{className:"!-ml-1 !-mr-0.5 size-4 !stroke-[2px] opacity-50",strokeWidth:2})]}):r;return z.jsx(b,{ref:i,className:g0(z3({variant:t,size:o,className:e})),...a,children:l})});o1.displayName="Button";function yG(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}const wG=e=>{switch(e){case"success":return kG;case"info":return NG;case"warning":return CG;case"error":return BG;default:return null}},LG=Array(12).fill(0),xG=({visible:e,className:t})=>b0.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},b0.createElement("div",{className:"sonner-spinner"},LG.map((o,n)=>b0.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),kG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),CG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),NG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),BG=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},b0.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),_G=b0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},b0.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),b0.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),EG=()=>{const[e,t]=b0.useState(document.hidden);return b0.useEffect(()=>{const o=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),e};let Mz=1;class SG{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const o=this.subscribers.indexOf(t);this.subscribers.splice(o,1)}),this.publish=t=>{this.subscribers.forEach(o=>o(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var o;const{message:n,...r}=t,a=typeof t?.id=="number"||((o=t.id)==null?void 0:o.length)>0?t.id:Mz++,i=this.toasts.find(l=>l.id===a),b=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:n}),{...l,...t,id:a,dismissible:b,title:n}):l):this.addToast({title:n,...r,dismissible:b,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(o=>o({id:t,dismiss:!0})))):this.toasts.forEach(o=>{this.subscribers.forEach(n=>n({id:o.id,dismiss:!0}))}),t),this.message=(t,o)=>this.create({...o,message:t}),this.error=(t,o)=>this.create({...o,message:t,type:"error"}),this.success=(t,o)=>this.create({...o,type:"success",message:t}),this.info=(t,o)=>this.create({...o,type:"info",message:t}),this.warning=(t,o)=>this.create({...o,type:"warning",message:t}),this.loading=(t,o)=>this.create({...o,type:"loading",message:t}),this.promise=(t,o)=>{if(!o)return;let n;o.loading!==void 0&&(n=this.create({...o,promise:t,type:"loading",message:o.loading,description:typeof o.description!="function"?o.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let a=n!==void 0,i;const b=r.then(async u=>{if(i=["resolve",u],b0.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(PG(u)&&!u.ok){a=!1;const f=typeof o.error=="function"?await o.error(`HTTP error! status: ${u.status}`):o.error,h=typeof o.description=="function"?await o.description(`HTTP error! status: ${u.status}`):o.description,g=typeof f=="object"&&!b0.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...g})}else if(u instanceof Error){a=!1;const f=typeof o.error=="function"?await o.error(u):o.error,h=typeof o.description=="function"?await o.description(u):o.description,g=typeof f=="object"&&!b0.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:h,...g})}else if(o.success!==void 0){a=!1;const f=typeof o.success=="function"?await o.success(u):o.success,h=typeof o.description=="function"?await o.description(u):o.description,g=typeof f=="object"&&!b0.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:h,...g})}}).catch(async u=>{if(i=["reject",u],o.error!==void 0){a=!1;const O=typeof o.error=="function"?await o.error(u):o.error,f=typeof o.description=="function"?await o.description(u):o.description,q=typeof O=="object"&&!b0.isValidElement(O)?O:{message:O};this.create({id:n,type:"error",description:f,...q})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),o.finally==null||o.finally.call(o)}),l=()=>new Promise((u,O)=>b.then(()=>i[0]==="reject"?O(i[1]):u(i[1])).catch(O));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,o)=>{const n=o?.id||Mz++;return this.create({jsx:t(n),id:n,...o}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ye=new SG,TG=(e,t)=>{const o=t?.id||Mz++;return Ye.addToast({title:e,...t,id:o}),o},PG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",XG=TG,jG=()=>Ye.toasts,DG=()=>Ye.getActiveToasts(),ve=Object.assign(XG,{success:Ye.success,info:Ye.info,warning:Ye.warning,error:Ye.error,custom:Ye.custom,message:Ye.message,promise:Ye.promise,dismiss:Ye.dismiss,loading:Ye.loading},{getHistory:jG,getToasts:DG});yG("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ui(e){return e.label!==void 0}const IG=3,FG="24px",HG="16px",Cf=4e3,UG=356,VG=14,$G=45,QG=200;function pt(...e){return e.filter(Boolean).join(" ")}function ZG(e){const[t,o]=e.split("-"),n=[];return t&&n.push(t),o&&n.push(o),n}const GG=e=>{var t,o,n,r,a,i,b,l,u;const{invert:O,toast:f,unstyled:h,interacting:q,setHeights:g,visibleToasts:W,heights:v,index:y,toasts:x,expanded:k,removeToast:L,defaultRichColors:C,closeButton:w,style:N,cancelButtonStyle:D,actionButtonStyle:Y,className:V="",descriptionClassName:J="",duration:t0,position:K,gap:a0,expandByDefault:q0,classNames:Z,icons:z0,closeButtonAriaLabel:U="Close toast"}=e,[X,G]=b0.useState(null),[_,I]=b0.useState(null),[i0,d0]=b0.useState(!1),[m0,W0]=b0.useState(!1),[s0,e0]=b0.useState(!1),[w0,x0]=b0.useState(!1),[j0,p1]=b0.useState(!1),[S,o0]=b0.useState(0),[r0,A0]=b0.useState(0),E0=b0.useRef(f.duration||t0||Cf),t1=b0.useRef(null),b1=b0.useRef(null),n1=y===0,d1=y+1<=W,L1=f.type,Te=f.dismissible!==!1,on=f.className||"",eo=f.descriptionClassName||"",qe=b0.useMemo(()=>v.findIndex(Q0=>Q0.toastId===f.id)||0,[v,f.id]),Pe=b0.useMemo(()=>{var Q0;return(Q0=f.closeButton)!=null?Q0:w},[f.closeButton,w]),J2=b0.useMemo(()=>f.duration||t0||Cf,[f.duration,t0]),to=b0.useRef(0),Le=b0.useRef(0),et=b0.useRef(0),ze=b0.useRef(null),[nn,rn]=K.split("-"),cn=b0.useMemo(()=>v.reduce((Q0,x1,j1)=>j1>=qe?Q0:Q0+x1.height,0),[v,qe]),oo=EG(),no=f.invert||O,b2=L1==="loading";Le.current=b0.useMemo(()=>qe*a0+cn,[qe,cn]),b0.useEffect(()=>{E0.current=J2},[J2]),b0.useEffect(()=>{d0(!0)},[]),b0.useEffect(()=>{const Q0=b1.current;if(Q0){const x1=Q0.getBoundingClientRect().height;return A0(x1),g(j1=>[{toastId:f.id,height:x1,position:f.position},...j1]),()=>g(j1=>j1.filter(ue=>ue.toastId!==f.id))}},[g,f.id]),b0.useLayoutEffect(()=>{if(!i0)return;const Q0=b1.current,x1=Q0.style.height;Q0.style.height="auto";const j1=Q0.getBoundingClientRect().height;Q0.style.height=x1,A0(j1),g(ue=>ue.find(E=>E.toastId===f.id)?ue.map(E=>E.toastId===f.id?{...E,height:j1}:E):[{toastId:f.id,height:j1,position:f.position},...ue])},[i0,f.title,f.description,g,f.id,f.jsx,f.action,f.cancel]);const Xe=b0.useCallback(()=>{W0(!0),o0(Le.current),g(Q0=>Q0.filter(x1=>x1.toastId!==f.id)),setTimeout(()=>{L(f)},QG)},[f,L,g,Le]);b0.useEffect(()=>{if(f.promise&&L1==="loading"||f.duration===1/0||f.type==="loading")return;let Q0;return k||q||oo?(()=>{if(et.current<to.current){const ue=new Date().getTime()-to.current;E0.current=E0.current-ue}et.current=new Date().getTime()})():(()=>{E0.current!==1/0&&(to.current=new Date().getTime(),Q0=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Xe()},E0.current))})(),()=>clearTimeout(Q0)},[k,q,f,L1,oo,Xe]),b0.useEffect(()=>{f.delete&&(Xe(),f.onDismiss==null||f.onDismiss.call(f,f))},[Xe,f.delete]);function gt(){var Q0;if(z0?.loading){var x1;return b0.createElement("div",{className:pt(Z?.loader,f==null||(x1=f.classNames)==null?void 0:x1.loader,"sonner-loader"),"data-visible":L1==="loading"},z0.loading)}return b0.createElement(xG,{className:pt(Z?.loader,f==null||(Q0=f.classNames)==null?void 0:Q0.loader),visible:L1==="loading"})}const tt=f.icon||z0?.[L1]||wG(L1);var l2,an;return b0.createElement("li",{tabIndex:0,ref:b1,className:pt(V,on,Z?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,Z?.default,Z?.[L1],f==null||(o=f.classNames)==null?void 0:o[L1]),"data-sonner-toast":"","data-rich-colors":(l2=f.richColors)!=null?l2:C,"data-styled":!(f.jsx||f.unstyled||h),"data-mounted":i0,"data-promise":!!f.promise,"data-swiped":j0,"data-removed":m0,"data-visible":d1,"data-y-position":nn,"data-x-position":rn,"data-index":y,"data-front":n1,"data-swiping":s0,"data-dismissible":Te,"data-type":L1,"data-invert":no,"data-swipe-out":w0,"data-swipe-direction":_,"data-expanded":!!(k||q0&&i0),"data-testid":f.testId,style:{"--index":y,"--toasts-before":y,"--z-index":x.length-y,"--offset":`${m0?S:Le.current}px`,"--initial-height":q0?"auto":`${r0}px`,...N,...f.style},onDragEnd:()=>{e0(!1),G(null),ze.current=null},onPointerDown:Q0=>{Q0.button!==2&&(b2||!Te||(t1.current=new Date,o0(Le.current),Q0.target.setPointerCapture(Q0.pointerId),Q0.target.tagName!=="BUTTON"&&(e0(!0),ze.current={x:Q0.clientX,y:Q0.clientY})))},onPointerUp:()=>{var Q0,x1,j1;if(w0||!Te)return;ze.current=null;const ue=Number(((Q0=b1.current)==null?void 0:Q0.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ot=Number(((x1=b1.current)==null?void 0:x1.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),E=new Date().getTime()-((j1=t1.current)==null?void 0:j1.getTime()),j=X==="x"?ue:ot,$=Math.abs(j)/E;if(Math.abs(j)>=$G||$>.11){o0(Le.current),f.onDismiss==null||f.onDismiss.call(f,f),I(X==="x"?ue>0?"right":"left":ot>0?"down":"up"),Xe(),x0(!0);return}else{var c0,O0;(c0=b1.current)==null||c0.style.setProperty("--swipe-amount-x","0px"),(O0=b1.current)==null||O0.style.setProperty("--swipe-amount-y","0px")}p1(!1),e0(!1),G(null)},onPointerMove:Q0=>{var x1,j1,ue;if(!ze.current||!Te||((x1=window.getSelection())==null?void 0:x1.toString().length)>0)return;const E=Q0.clientY-ze.current.y,j=Q0.clientX-ze.current.x;var $;const c0=($=e.swipeDirections)!=null?$:ZG(K);!X&&(Math.abs(j)>1||Math.abs(E)>1)&&G(Math.abs(j)>Math.abs(E)?"x":"y");let O0={x:0,y:0};const k0=R0=>1/(1.5+Math.abs(R0)/20);if(X==="y"){if(c0.includes("top")||c0.includes("bottom"))if(c0.includes("top")&&E<0||c0.includes("bottom")&&E>0)O0.y=E;else{const R0=E*k0(E);O0.y=Math.abs(R0)<Math.abs(E)?R0:E}}else if(X==="x"&&(c0.includes("left")||c0.includes("right")))if(c0.includes("left")&&j<0||c0.includes("right")&&j>0)O0.x=j;else{const R0=j*k0(j);O0.x=Math.abs(R0)<Math.abs(j)?R0:j}(Math.abs(O0.x)>0||Math.abs(O0.y)>0)&&p1(!0),(j1=b1.current)==null||j1.style.setProperty("--swipe-amount-x",`${O0.x}px`),(ue=b1.current)==null||ue.style.setProperty("--swipe-amount-y",`${O0.y}px`)}},Pe&&!f.jsx&&L1!=="loading"?b0.createElement("button",{"aria-label":U,"data-disabled":b2,"data-close-button":!0,onClick:b2||!Te?()=>{}:()=>{Xe(),f.onDismiss==null||f.onDismiss.call(f,f)},className:pt(Z?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(an=z0?.close)!=null?an:_G):null,(L1||f.icon||f.promise)&&f.icon!==null&&(z0?.[L1]!==null||f.icon)?b0.createElement("div",{"data-icon":"",className:pt(Z?.icon,f==null||(r=f.classNames)==null?void 0:r.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||gt():null,f.type!=="loading"?tt:null):null,b0.createElement("div",{"data-content":"",className:pt(Z?.content,f==null||(a=f.classNames)==null?void 0:a.content)},b0.createElement("div",{"data-title":"",className:pt(Z?.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?b0.createElement("div",{"data-description":"",className:pt(J,eo,Z?.description,f==null||(b=f.classNames)==null?void 0:b.description)},typeof f.description=="function"?f.description():f.description):null),b0.isValidElement(f.cancel)?f.cancel:f.cancel&&ui(f.cancel)?b0.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||D,onClick:Q0=>{ui(f.cancel)&&Te&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Q0),Xe())},className:pt(Z?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,b0.isValidElement(f.action)?f.action:f.action&&ui(f.action)?b0.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||Y,onClick:Q0=>{ui(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Q0),!Q0.defaultPrevented&&Xe())},className:pt(Z?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function Nf(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function KG(e,t){const o={};return[e,t].forEach((n,r)=>{const a=r===1,i=a?"--mobile-offset":"--offset",b=a?HG:FG;function l(u){["top","right","bottom","left"].forEach(O=>{o[`${i}-${O}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?o[`${i}-${u}`]=b:o[`${i}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(b)}),o}const YG=b0.forwardRef(function(t,o){const{id:n,invert:r,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:b,closeButton:l,className:u,offset:O,mobileOffset:f,theme:h="light",richColors:q,duration:g,style:W,visibleToasts:v=IG,toastOptions:y,dir:x=Nf(),gap:k=VG,icons:L,containerAriaLabel:C="Notifications"}=t,[w,N]=b0.useState([]),D=b0.useMemo(()=>n?w.filter(i0=>i0.toasterId===n):w.filter(i0=>!i0.toasterId),[w,n]),Y=b0.useMemo(()=>Array.from(new Set([a].concat(D.filter(i0=>i0.position).map(i0=>i0.position)))),[D,a]),[V,J]=b0.useState([]),[t0,K]=b0.useState(!1),[a0,q0]=b0.useState(!1),[Z,z0]=b0.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=b0.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=b0.useRef(null),_=b0.useRef(!1),I=b0.useCallback(i0=>{N(d0=>{var m0;return(m0=d0.find(W0=>W0.id===i0.id))!=null&&m0.delete||Ye.dismiss(i0.id),d0.filter(({id:W0})=>W0!==i0.id)})},[]);return b0.useEffect(()=>Ye.subscribe(i0=>{if(i0.dismiss){requestAnimationFrame(()=>{N(d0=>d0.map(m0=>m0.id===i0.id?{...m0,delete:!0}:m0))});return}setTimeout(()=>{rh.flushSync(()=>{N(d0=>{const m0=d0.findIndex(W0=>W0.id===i0.id);return m0!==-1?[...d0.slice(0,m0),{...d0[m0],...i0},...d0.slice(m0+1)]:[i0,...d0]})})})}),[w]),b0.useEffect(()=>{if(h!=="system"){z0(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z0("dark"):z0("light")),typeof window>"u")return;const i0=window.matchMedia("(prefers-color-scheme: dark)");try{i0.addEventListener("change",({matches:d0})=>{z0(d0?"dark":"light")})}catch{i0.addListener(({matches:m0})=>{try{z0(m0?"dark":"light")}catch(W0){console.error(W0)}})}},[h]),b0.useEffect(()=>{w.length<=1&&K(!1)},[w]),b0.useEffect(()=>{const i0=d0=>{var m0;if(i.every(e0=>d0[e0]||d0.code===e0)){var s0;K(!0),(s0=U.current)==null||s0.focus()}d0.code==="Escape"&&(document.activeElement===U.current||(m0=U.current)!=null&&m0.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",i0),()=>document.removeEventListener("keydown",i0)},[i]),b0.useEffect(()=>{if(U.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,_.current=!1)}},[U.current]),b0.createElement("section",{ref:o,"aria-label":`${C} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},Y.map((i0,d0)=>{var m0;const[W0,s0]=i0.split("-");return D.length?b0.createElement("ol",{key:i0,dir:x==="auto"?Nf():x,tabIndex:-1,ref:U,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Z,"data-y-position":W0,"data-x-position":s0,style:{"--front-toast-height":`${((m0=V[0])==null?void 0:m0.height)||0}px`,"--width":`${UG}px`,"--gap":`${k}px`,...W,...KG(O,f)},onBlur:e0=>{_.current&&!e0.currentTarget.contains(e0.relatedTarget)&&(_.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:e0=>{e0.target instanceof HTMLElement&&e0.target.dataset.dismissible==="false"||_.current||(_.current=!0,G.current=e0.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{a0||K(!1)},onDragEnd:()=>K(!1),onPointerDown:e0=>{e0.target instanceof HTMLElement&&e0.target.dataset.dismissible==="false"||q0(!0)},onPointerUp:()=>q0(!1)},D.filter(e0=>!e0.position&&d0===0||e0.position===i0).map((e0,w0)=>{var x0,j0;return b0.createElement(GG,{key:e0.id,icons:L,index:w0,toast:e0,defaultRichColors:q,duration:(x0=y?.duration)!=null?x0:g,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:r,visibleToasts:v,closeButton:(j0=y?.closeButton)!=null?j0:l,interacting:a0,position:i0,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:I,toasts:D.filter(p1=>p1.position==e0.position),heights:V.filter(p1=>p1.position==e0.position),setHeights:J,expandByDefault:b,gap:k,expanded:t0,swipeDirections:t.swipeDirections})})):null}))}),JG=({...e})=>z.jsx(YG,{className:"toaster group",style:{"--normal-bg":"hsl(var(--background))","--normal-text":"hsl(var(--foreground))","--normal-border":"hsl(var(--border))"},theme:"light",...e}),eK=b0.createContext({isDirty:!1,setGlobalDirtyState:()=>{}}),tK=({children:e})=>{const[t,o]=p.useState([]),n=p.useCallback((r,a)=>{o(i=>a&&!i.includes(r)?[...i,r]:!a&&i.includes(r)?i.filter(b=>b!==r):i)},[]);return z.jsx(eK.Provider,{value:{isDirty:t.length>0,setGlobalDirtyState:n},children:e})},oK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Alert-Triangle--Streamline-Ultimate",...e},p.createElement("desc",null,"Alert Triangle Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"m23.77 20.57 -10 -19A2 2 0 0 0 12 0.5a2 2 0 0 0 -1.77 1.07l-10 19a2 2 0 0 0 0.06 2A2 2 0 0 0 2 23.5h20a2 2 0 0 0 1.77 -2.93ZM11 8.5a1 1 0 0 1 2 0v6a1 1 0 0 1 -2 0ZM12.05 20a1.53 1.53 0 0 1 -1.52 -1.47A1.48 1.48 0 0 1 12 17a1.53 1.53 0 0 1 1.52 1.47A1.48 1.48 0 0 1 12.05 20Z",fill:"currentColor",strokeWidth:1})),nK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Alert-Triangle--Streamline-Ultimate'%3e%3cdesc%3eAlert%20Triangle%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='m23.77%2020.57%20-10%20-19A2%202%200%200%200%2012%200.5a2%202%200%200%200%20-1.77%201.07l-10%2019a2%202%200%200%200%200.06%202A2%202%200%200%200%202%2023.5h20a2%202%200%200%200%201.77%20-2.93ZM11%208.5a1%201%200%200%201%202%200v6a1%201%200%200%201%20-2%200ZM12.05%2020a1.53%201.53%200%200%201%20-1.52%20-1.47A1.48%201.48%200%200%201%2012%2017a1.53%201.53%200%200%201%201.52%201.47A1.48%201.48%200%200%201%2012.05%2020Z'%20fill='currentColor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",rK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:oK,default:nK},Symbol.toStringTag,{value:"Module"})),cK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Information-Circle--Streamline-Ultimate",...e},p.createElement("desc",null,"Information Circle Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm0.25 5a1.5 1.5 0 1 1 -1.5 1.5 1.5 1.5 0 0 1 1.5 -1.5Zm2.25 13.5h-4a1 1 0 0 1 0 -2h0.75a0.25 0.25 0 0 0 0.25 -0.25v-4.5a0.25 0.25 0 0 0 -0.25 -0.25h-0.75a1 1 0 0 1 0 -2h1a2 2 0 0 1 2 2v4.75a0.25 0.25 0 0 0 0.25 0.25h0.75a1 1 0 0 1 0 2Z",fill:"currentcolor",strokeWidth:1})),aK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Information-Circle--Streamline-Ultimate'%3e%3cdesc%3eInformation%20Circle%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm0.25%205a1.5%201.5%200%201%201%20-1.5%201.5%201.5%201.5%200%200%201%201.5%20-1.5Zm2.25%2013.5h-4a1%201%200%200%201%200%20-2h0.75a0.25%200.25%200%200%200%200.25%20-0.25v-4.5a0.25%200.25%200%200%200%20-0.25%20-0.25h-0.75a1%201%200%200%201%200%20-2h1a2%202%200%200%201%202%202v4.75a0.25%200.25%200%200%200%200.25%200.25h0.75a1%201%200%200%201%200%202Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",sK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:cK,default:aK},Symbol.toStringTag,{value:"Module"})),iK=e=>p.createElement("svg",{height:16,id:"Skull-2--Streamline-Ultimate",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...e},p.createElement("desc",null,`
|
|
598
598
|
Skull 2 Streamline Icon: https://streamlinehq.com
|
|
599
|
-
`),p.createElement("g",null,p.createElement("path",{d:"M12.333333333333332 7.333333333333333a4.333333333333333 4.333333333333333 0 1 0 -7.333333333333333 3.126666666666667v1.88a1 1 0 0 0 2 0 1 1 0 0 0 2 0 1 1 0 1 0 2 0v-1.88a4.326666666666666 4.326666666666666 0 0 0 1.3333333333333333 -3.126666666666667Zm-6.253333333333334 1a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Zm4 0a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m1.8666666666666665 3.28 1.22 1.22a0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 0.09333333333333334 0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 -0.14666666666666667 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 -0.9733333333333333 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 -0.2333333333333333 0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 -0.24666666666666665L3.28 1.8666666666666665A1.1666666666666665 1.1666666666666665 0 0 0 1.8399999999999999 0.11333333333333334a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 0.48l-0.09999999999999999 0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 0.26666666666666666l-0.52 0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 -0.48 0.3666666666666667A1.1666666666666665 1.1666666666666665 0 0 0 1.8666666666666665 3.28Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M12.4 4.446666666666666a0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 0.14666666666666667 0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 -0.09333333333333334l1.22 -1.22a1.1666666666666665 1.1666666666666665 0 0 0 1.7533333333333332 -1.44 0.6666666666666666 0.6666666666666666 0 0 0 -0.48 -0.3666666666666667l-0.52 -0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 -0.26666666666666666l-0.09999999999999999 -0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 -0.48 1.1666666666666665 1.1666666666666665 0 0 0 -1.44 1.7533333333333332l-1.1333333333333333 1.1266666666666665a0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 0.24666666666666665 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 0.2333333333333333 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 0.9733333333333333Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M3.6 11.559999999999999a0.33999999999999997 0.33999999999999997 0 0 0 -0.26666666666666666 -0.15333333333333332 0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 0.09333333333333334l-1.2 1.22a1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 1.44 0.6666666666666666 0.6666666666666666 0 0 0 0.48 0.3666666666666667l0.52 0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 0.26 0.26666666666666666l0.09999999999999999 0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 0.48 1.1666666666666665 1.1666666666666665 0 0 0 1.44 -1.7533333333333332l1.1333333333333333 -1.1266666666666665a0.36 0.36 0 0 0 0.09333333333333334 -0.24 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 -0.24 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 -0.9666666666666666Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m14.133333333333333 12.719999999999999 -1.22 -1.22a0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 -0.09333333333333334 0.33999999999999997 0.33999999999999997 0 0 0 -0.24666666666666665 0.15333333333333332 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 0.9666666666666666 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 0.24 0.36 0.36 0 0 0 0.09333333333333334 0.24l1.1333333333333333 1.1266666666666665a1.1666666666666665 1.1666666666666665 0 0 0 1.44 1.7533333333333332 0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 -0.48l0.09999999999999999 -0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 0.26 -0.26666666666666666l0.52 -0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 0.48 -0.3666666666666667 1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 -1.44Z",fill:"currentColor",strokeWidth:.6667}))),pK="data:image/svg+xml,%3csvg%20height='16'%20id='Skull-2--Streamline-Ultimate'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdesc%3e%20Skull%202%20Streamline%20Icon:%20https://streamlinehq.com%20%3c/desc%3e%3cg%3e%3cpath%20d='M12.333333333333332%207.333333333333333a4.333333333333333%204.333333333333333%200%201%200%20-7.333333333333333%203.126666666666667v1.88a1%201%200%200%200%202%200%201%201%200%200%200%202%200%201%201%200%201%200%202%200v-1.88a4.326666666666666%204.326666666666666%200%200%200%201.3333333333333333%20-3.126666666666667Zm-6.253333333333334%201a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Zm4%200a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m1.8666666666666665%203.28%201.22%201.22a0.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%200.09333333333333334%200.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%20-0.14666666666666667%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%20-0.9733333333333333%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%20-0.2333333333333333%200.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%20-0.24666666666666665L3.28%201.8666666666666665A1.1666666666666665%201.1666666666666665%200%200%200%201.8399999999999999%200.11333333333333334a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%200.48l-0.09999999999999999%200.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%200.26666666666666666l-0.52%200.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%20-0.48%200.3666666666666667A1.1666666666666665%201.1666666666666665%200%200%200%201.8666666666666665%203.28Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M12.4%204.446666666666666a0.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%200.14666666666666667%200.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%20-0.09333333333333334l1.22%20-1.22a1.1666666666666665%201.1666666666666665%200%200%200%201.7533333333333332%20-1.44%200.6666666666666666%200.6666666666666666%200%200%200%20-0.48%20-0.3666666666666667l-0.52%20-0.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%20-0.26666666666666666l-0.09999999999999999%20-0.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%20-0.48%201.1666666666666665%201.1666666666666665%200%200%200%20-1.44%201.7533333333333332l-1.1333333333333333%201.1266666666666665a0.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%200.24666666666666665%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%200.2333333333333333%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%200.9733333333333333Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M3.6%2011.559999999999999a0.33999999999999997%200.33999999999999997%200%200%200%20-0.26666666666666666%20-0.15333333333333332%200.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%200.09333333333333334l-1.2%201.22a1.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%201.44%200.6666666666666666%200.6666666666666666%200%200%200%200.48%200.3666666666666667l0.52%200.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%200.26%200.26666666666666666l0.09999999999999999%200.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%200.48%201.1666666666666665%201.1666666666666665%200%200%200%201.44%20-1.7533333333333332l1.1333333333333333%20-1.1266666666666665a0.36%200.36%200%200%200%200.09333333333333334%20-0.24%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%20-0.24%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%20-0.9666666666666666Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m14.133333333333333%2012.719999999999999%20-1.22%20-1.22a0.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%20-0.09333333333333334%200.33999999999999997%200.33999999999999997%200%200%200%20-0.24666666666666665%200.15333333333333332%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%200.9666666666666666%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%200.24%200.36%200.36%200%200%200%200.09333333333333334%200.24l1.1333333333333333%201.1266666666666665a1.1666666666666665%201.1666666666666665%200%200%200%201.44%201.7533333333333332%200.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%20-0.48l0.09999999999999999%20-0.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%200.26%20-0.26666666666666666l0.52%20-0.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%200.48%20-0.3666666666666667%201.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%20-1.44Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",MK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:iK,default:pK},Symbol.toStringTag,{value:"Module"})),bK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Check-Circle-1--Streamline-Ultimate",...e},p.createElement("desc",null,"Check Circle 1 Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm6.93 8.2 -6.85 9.29a1 1 0 0 1 -1.43 0.19l-4.89 -3.91a1 1 0 0 1 -0.15 -1.41A1 1 0 0 1 7 12.21l4.08 3.26L17.32 7a1 1 0 0 1 1.39 -0.21 1 1 0 0 1 0.22 1.41Z",fill:"currentcolor",strokeWidth:1})),lK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Check-Circle-1--Streamline-Ultimate'%3e%3cdesc%3eCheck%20Circle%201%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm6.93%208.2%20-6.85%209.29a1%201%200%200%201%20-1.43%200.19l-4.89%20-3.91a1%201%200%200%201%20-0.15%20-1.41A1%201%200%200%201%207%2012.21l4.08%203.26L17.32%207a1%201%200%200%201%201.39%20-0.21%201%201%200%200%201%200.22%201.41Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",zK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:bK,default:lK},Symbol.toStringTag,{value:"Module"})),uK=e=>p.createElement("svg",{viewBox:"-0.75 -0.75 20 20",xmlns:"http://www.w3.org/2000/svg",height:24,width:24,...e},p.createElement("desc",null,"Typography"),p.createElement("path",{d:"m0.578125 9.827354166666668 8.09375 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"m12.140625 13.296104166666666 5.78125 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M12.140625 16.764854166666666V10.40625a2.890625 2.890625 0 0 1 5.78125 0v6.359375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M0.578125 16.764854166666666V5.78125a4.046875 4.046875 0 0 1 8.09375 0v10.984375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),dK="data:image/svg+xml,%3csvg%20viewBox='-0.75%20-0.75%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20width='24'%3e%3cdesc%3eTypography%3c/desc%3e%3cpath%20d='m0.578125%209.827354166666668%208.09375%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='m12.140625%2013.296104166666666%205.78125%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M12.140625%2016.764854166666666V10.40625a2.890625%202.890625%200%200%201%205.78125%200v6.359375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M0.578125%2016.764854166666666V5.78125a4.046875%204.046875%200%200%201%208.09375%200v10.984375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3c/svg%3e",OK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:uK,default:dK},Symbol.toStringTag,{value:"Module"})),fK=Yt("",{variants:{size:{sm:"size-3",md:"size-4",lg:"size-6",xl:"size-8"}},defaultVariants:{size:"md"}}),AK=Object.assign({"../../assets/icons/error-fill.svg":rK,"../../assets/icons/info-fill.svg":sK,"../../assets/icons/skull-and-bones.svg":MK,"../../assets/icons/success-fill.svg":zK,"../../assets/icons/typography.svg":OK}),Di=Object.entries(AK).reduce((e,[t,o])=>{var n;const r=((n=t.match(/[^/]+(?=\.svg$)/))==null?void 0:n[0])??"",a=FQ(r),i=b=>{const{size:l,className:u,...O}=b,f=g0(fK({size:l,className:u}));return b0.createElement(o.ReactComponent,{...O,className:f})};return i.displayName=`Icon.${a}`,e[a]=i,e},{}),lc0=Di,hK=p.createContext({isAnyTextFieldFocused:!1,setFocusState:()=>{},darkMode:!1}),qK=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>(t(!0),()=>t(!1)),[]),e?Ep.createPortal(z.jsx("div",{className:en,style:{width:"unset",height:"unset"},children:z.jsx(JG,{icons:{error:z.jsx(Di.ErrorFill,{className:"text-red"}),success:z.jsx(Di.SuccessFill,{className:"text-green"}),info:z.jsx(Di.InfoFill,{className:"text-gray-500"})},position:"bottom-left",toastOptions:{classNames:{title:"!mt-[-1px] !text-md !font-semibold !leading-tighter !tracking-[0.1px]",description:"!text-gray-900 dark:!text-gray-300 !text-sm !mt-px",icon:"!ml-0"},style:{alignItems:"flex-start",maxWidth:"290px"}}})}),document.body):null},mK=({darkMode:e,children:t})=>{const[o,n]=p.useState(!1),r=a=>{n(a)};return z.jsx(hK.Provider,{value:{isAnyTextFieldFocused:o,setFocusState:r,darkMode:e},children:z.jsxs(tK,{children:[t,z.jsx(qK,{})]})})},en="shade shade-admin shade-activitypub shade-stats shade-posts",gK=({darkMode:e,fetchKoenigLexical:t,className:o,children:n,...r})=>{const a=Z1("shade",o);return z.jsx("div",{className:a,...r,children:z.jsx(mK,{darkMode:e,children:n})})},WK=OH,vK=fH,RK=AH,z9=p.forwardRef(({className:e,...t},o)=>z.jsx(Y7,{className:g0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t,ref:o}));z9.displayName=Y7.displayName;const u9=p.forwardRef(({className:e,...t},o)=>z.jsx(RK,{children:z.jsxs("div",{className:en,children:[z.jsx(z9,{onClick:n=>n.stopPropagation()}),z.jsx(J7,{ref:o,className:g0("fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg",e),...t})]})}));u9.displayName=J7.displayName;const d9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col space-y-2 text-center sm:text-left",e),...t});d9.displayName="AlertDialogHeader";const O9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 [&>button]:min-w-20",e),...t});O9.displayName="AlertDialogFooter";const f9=p.forwardRef(({className:e,...t},o)=>z.jsx(o8,{ref:o,className:g0("text-xl font-semibold",e),...t}));f9.displayName=o8.displayName;const A9=p.forwardRef(({className:e,...t},o)=>z.jsx(n8,{ref:o,className:g0("text-base",e),...t}));A9.displayName=n8.displayName;const h9=p.forwardRef(({className:e,...t},o)=>z.jsx(e8,{ref:o,className:g0(z3(),e),...t}));h9.displayName=e8.displayName;const q9=p.forwardRef(({className:e,...t},o)=>z.jsx(t8,{ref:o,className:g0(z3({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));q9.displayName=t8.displayName;const yK=p.lazy(()=>z1(()=>import("./index-BZ21H0xH.js"),[])),Bf=e=>z.jsx(p.Suspense,{fallback:z.jsx("div",{}),children:z.jsx(yK,{...e})}),ld=p.forwardRef(({className:e,...t},o)=>z.jsx(Aq,{ref:o,className:g0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));ld.displayName=Aq.displayName;const zd=p.forwardRef(({className:e,...t},o)=>z.jsx(hq,{ref:o,className:g0("aspect-square h-full w-full",e),...t}));zd.displayName=hq.displayName;const ud=p.forwardRef(({className:e,...t},o)=>z.jsx(qq,{ref:o,className:g0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));ud.displayName=qq.displayName;const wK=Yt("inline-flex items-center rounded-sm border px-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground/70",destructive:"border-transparent bg-destructive/20 text-destructive",success:"border-transparent bg-green/20 text-green",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function LK({className:e,variant:t,...o}){return z.jsx("div",{className:g0(wK({variant:t}),e),...o})}const xK=Yt("relative block rounded-lg transition-all duration-300",{variants:{variant:{default:"border border-border bg-background shadow-sm hover:shadow-md",gradient:["cursor-pointer border border-gray-100 bg-white","shadow-[rgb(75_225_226_/_28%)_-7px_-6px_42px_8px,rgb(202_103_255_/_32%)_7px_6px_42px_8px]","hover:shadow-[rgb(75_225_226_/_38%)_-7px_-4px_42px_10px,rgb(202_103_255_/_42%)_7px_8px_42px_10px]","hover:translate-y-[-2px] hover:scale-[1.01]"],info:"bg-blue-50 border-blue-200 dark:bg-blue-950/30 dark:border-blue-800 border",success:"bg-green-50 border-green-200 dark:bg-green-950/30 dark:border-green-800 border",warning:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/30 dark:border-yellow-800 border",destructive:"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800 border"},size:{sm:"p-2 text-sm",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),dd=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:a,role:i="status",className:b,children:l,...u}=e,O=f=>{f.preventDefault(),f.stopPropagation(),r&&a&&a()};return z.jsxs("div",{ref:t,className:g0(xK({variant:o,size:n}),b),role:i,...u,children:[r&&z.jsx(o1,{"aria-label":"Dismiss notification",className:"absolute right-1 top-1 size-8 text-gray-600",size:"icon",variant:"ghost",onClick:O,children:z.jsx(bd,{className:"size-5"})}),l]})});dd.displayName="Banner";function jo(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}var kK="DismissableLayer",bz="dismissableLayer.update",CK="dismissableLayer.pointerDownOutside",NK="dismissableLayer.focusOutside",_f,m9=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),g9=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:b,...l}=e,u=p.useContext(m9),[O,f]=p.useState(null),h=O?.ownerDocument??globalThis?.document,[,q]=p.useState({}),g=Y0(t,N=>f(N)),W=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=W.indexOf(v),x=O?W.indexOf(O):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,L=x>=y,C=EK(N=>{const D=N.target,Y=[...u.branches].some(V=>V.contains(D));!L||Y||(r?.(N),i?.(N),N.defaultPrevented||b?.())},h),w=SK(N=>{const D=N.target;[...u.branches].some(V=>V.contains(D))||(a?.(N),i?.(N),N.defaultPrevented||b?.())},h);return Ip(N=>{x===u.layers.size-1&&(n?.(N),!N.defaultPrevented&&b&&(N.preventDefault(),b()))},h),p.useEffect(()=>{if(O)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(_f=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(O)),u.layers.add(O),Ef(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=_f)}},[O,h,o,u]),p.useEffect(()=>()=>{O&&(u.layers.delete(O),u.layersWithOutsidePointerEventsDisabled.delete(O),Ef())},[O,u]),p.useEffect(()=>{const N=()=>q({});return document.addEventListener(bz,N),()=>document.removeEventListener(bz,N)},[]),z.jsx(H0.div,{...l,ref:g,style:{pointerEvents:k?L?"auto":"none":void 0,...e.style},onFocusCapture:jo(e.onFocusCapture,w.onFocusCapture),onBlurCapture:jo(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:jo(e.onPointerDownCapture,C.onPointerDownCapture)})});g9.displayName=kK;var BK="DismissableLayerBranch",_K=p.forwardRef((e,t)=>{const o=p.useContext(m9),n=p.useRef(null),r=Y0(t,n);return p.useEffect(()=>{const a=n.current;if(a)return o.branches.add(a),()=>{o.branches.delete(a)}},[o.branches]),z.jsx(H0.div,{...e,ref:r})});_K.displayName=BK;function EK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1),r=p.useRef(()=>{});return p.useEffect(()=>{const a=b=>{if(b.target&&!n.current){let l=function(){W9(CK,o,u,{discrete:!0})};const u={originalEvent:b};b.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,o]),{onPointerDownCapture:()=>n.current=!0}}function SK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1);return p.useEffect(()=>{const r=a=>{a.target&&!n.current&&W9(NK,o,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ef(){const e=new CustomEvent(bz);document.dispatchEvent(e)}function W9(e,t,o,{discrete:n}){const r=o.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&r.addEventListener(e,t,{once:!0}),n?qa(r,a):r.dispatchEvent(a)}function TK(e,t){return p.useReducer((o,n)=>t[o][n]??o,e)}var u3=e=>{const{present:t,children:o}=e,n=PK(t),r=typeof o=="function"?o({present:n.isPresent}):p.Children.only(o),a=Y0(n.ref,XK(r));return typeof o=="function"||n.isPresent?p.cloneElement(r,{ref:a}):null};u3.displayName="Presence";function PK(e){const[t,o]=p.useState(),n=p.useRef(null),r=p.useRef(e),a=p.useRef("none"),i=e?"mounted":"unmounted",[b,l]=TK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=di(n.current);a.current=b==="mounted"?u:"none"},[b]),re(()=>{const u=n.current,O=r.current;if(O!==e){const h=a.current,q=di(u);e?l("MOUNT"):q==="none"||u?.display==="none"?l("UNMOUNT"):l(O&&h!==q?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),re(()=>{if(t){let u;const O=t.ownerDocument.defaultView??window,f=q=>{const W=di(n.current).includes(CSS.escape(q.animationName));if(q.target===t&&W&&(l("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=O.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=q=>{q.target===t&&(a.current=di(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{O.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(b),ref:p.useCallback(u=>{n.current=u?getComputedStyle(u):null,o(u)},[])}}function di(e){return e?.animationName||"none"}function XK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Ml=0;function jK(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sf()),document.body.insertAdjacentElement("beforeend",e[1]??Sf()),Ml++,()=>{Ml===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ml--}},[])}function Sf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var d3="Dialog",[v9]=_e(d3),[DK,Y2]=v9(d3),R9=e=>{const{__scopeDialog:t,children:o,open:n,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,b=p.useRef(null),l=p.useRef(null),[u,O]=Ko({prop:n,defaultProp:r??!1,onChange:a,caller:d3});return z.jsx(DK,{scope:t,triggerRef:b,contentRef:l,contentId:e2(),titleId:e2(),descriptionId:e2(),open:u,onOpenChange:O,onOpenToggle:p.useCallback(()=>O(f=>!f),[O]),modal:i,children:o})};R9.displayName=d3;var y9="DialogTrigger",w9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(y9,o),a=Y0(t,r.triggerRef);return z.jsx(H0.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Ad(r.open),...n,ref:a,onClick:jo(e.onClick,r.onOpenToggle)})});w9.displayName=y9;var Od="DialogPortal",[IK,L9]=v9(Od,{forceMount:void 0}),x9=e=>{const{__scopeDialog:t,forceMount:o,children:n,container:r}=e,a=Y2(Od,t);return z.jsx(IK,{scope:t,forceMount:o,children:p.Children.map(n,i=>z.jsx(u3,{present:o||a.open,children:z.jsx(Zr,{asChild:!0,container:r,children:i})}))})};x9.displayName=Od;var zp="DialogOverlay",k9=p.forwardRef((e,t)=>{const o=L9(zp,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=Y2(zp,e.__scopeDialog);return a.modal?z.jsx(u3,{present:n||a.open,children:z.jsx(HK,{...r,ref:t})}):null});k9.displayName=zp;var FK=Fo("DialogOverlay.RemoveScroll"),HK=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(zp,o);return z.jsx(wa,{as:FK,allowPinchZoom:!0,shards:[r.contentRef],children:z.jsx(H0.div,{"data-state":Ad(r.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Tn="DialogContent",C9=p.forwardRef((e,t)=>{const o=L9(Tn,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=Y2(Tn,e.__scopeDialog);return z.jsx(u3,{present:n||a.open,children:a.modal?z.jsx(UK,{...r,ref:t}):z.jsx(VK,{...r,ref:t})})});C9.displayName=Tn;var UK=p.forwardRef((e,t)=>{const o=Y2(Tn,e.__scopeDialog),n=p.useRef(null),r=Y0(t,o.contentRef,n);return p.useEffect(()=>{const a=n.current;if(a)return Up(a)},[]),z.jsx(N9,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:jo(e.onCloseAutoFocus,a=>{a.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:jo(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,b=i.button===0&&i.ctrlKey===!0;(i.button===2||b)&&a.preventDefault()}),onFocusOutside:jo(e.onFocusOutside,a=>a.preventDefault())})}),VK=p.forwardRef((e,t)=>{const o=Y2(Tn,e.__scopeDialog),n=p.useRef(!1),r=p.useRef(!1);return z.jsx(N9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||o.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;o.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),N9=p.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,b=Y2(Tn,o),l=p.useRef(null),u=Y0(t,l);return jK(),z.jsxs(z.Fragment,{children:[z.jsx(ya,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:z.jsx(g9,{role:"dialog",id:b.contentId,"aria-describedby":b.descriptionId,"aria-labelledby":b.titleId,"data-state":Ad(b.open),...i,ref:u,onDismiss:()=>b.onOpenChange(!1)})}),z.jsxs(z.Fragment,{children:[z.jsx($K,{titleId:b.titleId}),z.jsx(ZK,{contentRef:l,descriptionId:b.descriptionId})]})]})}),fd="DialogTitle",B9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(fd,o);return z.jsx(H0.h2,{id:r.titleId,...n,ref:t})});B9.displayName=fd;var _9="DialogDescription",E9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(_9,o);return z.jsx(H0.p,{id:r.descriptionId,...n,ref:t})});E9.displayName=_9;var S9="DialogClose",T9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(S9,o);return z.jsx(H0.button,{type:"button",...n,ref:t,onClick:jo(e.onClick,()=>r.onOpenChange(!1))})});T9.displayName=S9;function Ad(e){return e?"open":"closed"}var P9="DialogTitleWarning",[zc0,X9]=uh(P9,{contentName:Tn,titleName:fd,docsSlug:"dialog"}),$K=({titleId:e})=>{const t=X9(P9),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
599
|
+
`),p.createElement("g",null,p.createElement("path",{d:"M12.333333333333332 7.333333333333333a4.333333333333333 4.333333333333333 0 1 0 -7.333333333333333 3.126666666666667v1.88a1 1 0 0 0 2 0 1 1 0 0 0 2 0 1 1 0 1 0 2 0v-1.88a4.326666666666666 4.326666666666666 0 0 0 1.3333333333333333 -3.126666666666667Zm-6.253333333333334 1a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Zm4 0a1 1 0 1 1 1 -1 1 1 0 0 1 -1 1Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m1.8666666666666665 3.28 1.22 1.22a0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 0.09333333333333334 0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 -0.14666666666666667 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 -0.9733333333333333 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 -0.2333333333333333 0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 -0.24666666666666665L3.28 1.8666666666666665A1.1666666666666665 1.1666666666666665 0 0 0 1.8399999999999999 0.11333333333333334a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 0.48l-0.09999999999999999 0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 0.26666666666666666l-0.52 0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 -0.48 0.3666666666666667A1.1666666666666665 1.1666666666666665 0 0 0 1.8666666666666665 3.28Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M12.4 4.446666666666666a0.35333333333333333 0.35333333333333333 0 0 0 0.24666666666666665 0.14666666666666667 0.3466666666666667 0.3466666666666667 0 0 0 0.26666666666666666 -0.09333333333333334l1.22 -1.22a1.1666666666666665 1.1666666666666665 0 0 0 1.7533333333333332 -1.44 0.6666666666666666 0.6666666666666666 0 0 0 -0.48 -0.3666666666666667l-0.52 -0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 -0.26 -0.26666666666666666l-0.09999999999999999 -0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 -0.3666666666666667 -0.48 1.1666666666666665 1.1666666666666665 0 0 0 -1.44 1.7533333333333332l-1.1333333333333333 1.1266666666666665a0.3666666666666667 0.3666666666666667 0 0 0 -0.09333333333333334 0.24666666666666665 0.3133333333333333 0.3133333333333333 0 0 0 0.09999999999999999 0.2333333333333333 5.133333333333333 5.133333333333333 0 0 1 0.8066666666666666 0.9733333333333333Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"M3.6 11.559999999999999a0.33999999999999997 0.33999999999999997 0 0 0 -0.26666666666666666 -0.15333333333333332 0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 0.09333333333333334l-1.2 1.22a1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 1.44 0.6666666666666666 0.6666666666666666 0 0 0 0.48 0.3666666666666667l0.52 0.09999999999999999a0.31999999999999995 0.31999999999999995 0 0 1 0.26 0.26666666666666666l0.09999999999999999 0.5133333333333333a0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 0.48 1.1666666666666665 1.1666666666666665 0 0 0 1.44 -1.7533333333333332l1.1333333333333333 -1.1266666666666665a0.36 0.36 0 0 0 0.09333333333333334 -0.24 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 -0.24 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 -0.9666666666666666Z",fill:"currentColor",strokeWidth:.6667}),p.createElement("path",{d:"m14.133333333333333 12.719999999999999 -1.22 -1.22a0.3466666666666667 0.3466666666666667 0 0 0 -0.26666666666666666 -0.09333333333333334 0.33999999999999997 0.33999999999999997 0 0 0 -0.24666666666666665 0.15333333333333332 5.333333333333333 5.333333333333333 0 0 1 -0.8066666666666666 0.9666666666666666 0.31999999999999995 0.31999999999999995 0 0 0 -0.09999999999999999 0.24 0.36 0.36 0 0 0 0.09333333333333334 0.24l1.1333333333333333 1.1266666666666665a1.1666666666666665 1.1666666666666665 0 0 0 1.44 1.7533333333333332 0.6666666666666666 0.6666666666666666 0 0 0 0.3666666666666667 -0.48l0.09999999999999999 -0.5133333333333333a0.31999999999999995 0.31999999999999995 0 0 1 0.26 -0.26666666666666666l0.52 -0.09999999999999999a0.6666666666666666 0.6666666666666666 0 0 0 0.48 -0.3666666666666667 1.1666666666666665 1.1666666666666665 0 0 0 -1.7533333333333332 -1.44Z",fill:"currentColor",strokeWidth:.6667}))),pK="data:image/svg+xml,%3csvg%20height='16'%20id='Skull-2--Streamline-Ultimate'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdesc%3e%20Skull%202%20Streamline%20Icon:%20https://streamlinehq.com%20%3c/desc%3e%3cg%3e%3cpath%20d='M12.333333333333332%207.333333333333333a4.333333333333333%204.333333333333333%200%201%200%20-7.333333333333333%203.126666666666667v1.88a1%201%200%200%200%202%200%201%201%200%200%200%202%200%201%201%200%201%200%202%200v-1.88a4.326666666666666%204.326666666666666%200%200%200%201.3333333333333333%20-3.126666666666667Zm-6.253333333333334%201a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Zm4%200a1%201%200%201%201%201%20-1%201%201%200%200%201%20-1%201Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m1.8666666666666665%203.28%201.22%201.22a0.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%200.09333333333333334%200.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%20-0.14666666666666667%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%20-0.9733333333333333%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%20-0.2333333333333333%200.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%20-0.24666666666666665L3.28%201.8666666666666665A1.1666666666666665%201.1666666666666665%200%200%200%201.8399999999999999%200.11333333333333334a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%200.48l-0.09999999999999999%200.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%200.26666666666666666l-0.52%200.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%20-0.48%200.3666666666666667A1.1666666666666665%201.1666666666666665%200%200%200%201.8666666666666665%203.28Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M12.4%204.446666666666666a0.35333333333333333%200.35333333333333333%200%200%200%200.24666666666666665%200.14666666666666667%200.3466666666666667%200.3466666666666667%200%200%200%200.26666666666666666%20-0.09333333333333334l1.22%20-1.22a1.1666666666666665%201.1666666666666665%200%200%200%201.7533333333333332%20-1.44%200.6666666666666666%200.6666666666666666%200%200%200%20-0.48%20-0.3666666666666667l-0.52%20-0.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%20-0.26%20-0.26666666666666666l-0.09999999999999999%20-0.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%20-0.3666666666666667%20-0.48%201.1666666666666665%201.1666666666666665%200%200%200%20-1.44%201.7533333333333332l-1.1333333333333333%201.1266666666666665a0.3666666666666667%200.3666666666666667%200%200%200%20-0.09333333333333334%200.24666666666666665%200.3133333333333333%200.3133333333333333%200%200%200%200.09999999999999999%200.2333333333333333%205.133333333333333%205.133333333333333%200%200%201%200.8066666666666666%200.9733333333333333Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='M3.6%2011.559999999999999a0.33999999999999997%200.33999999999999997%200%200%200%20-0.26666666666666666%20-0.15333333333333332%200.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%200.09333333333333334l-1.2%201.22a1.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%201.44%200.6666666666666666%200.6666666666666666%200%200%200%200.48%200.3666666666666667l0.52%200.09999999999999999a0.31999999999999995%200.31999999999999995%200%200%201%200.26%200.26666666666666666l0.09999999999999999%200.5133333333333333a0.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%200.48%201.1666666666666665%201.1666666666666665%200%200%200%201.44%20-1.7533333333333332l1.1333333333333333%20-1.1266666666666665a0.36%200.36%200%200%200%200.09333333333333334%20-0.24%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%20-0.24%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%20-0.9666666666666666Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3cpath%20d='m14.133333333333333%2012.719999999999999%20-1.22%20-1.22a0.3466666666666667%200.3466666666666667%200%200%200%20-0.26666666666666666%20-0.09333333333333334%200.33999999999999997%200.33999999999999997%200%200%200%20-0.24666666666666665%200.15333333333333332%205.333333333333333%205.333333333333333%200%200%201%20-0.8066666666666666%200.9666666666666666%200.31999999999999995%200.31999999999999995%200%200%200%20-0.09999999999999999%200.24%200.36%200.36%200%200%200%200.09333333333333334%200.24l1.1333333333333333%201.1266666666666665a1.1666666666666665%201.1666666666666665%200%200%200%201.44%201.7533333333333332%200.6666666666666666%200.6666666666666666%200%200%200%200.3666666666666667%20-0.48l0.09999999999999999%20-0.5133333333333333a0.31999999999999995%200.31999999999999995%200%200%201%200.26%20-0.26666666666666666l0.52%20-0.09999999999999999a0.6666666666666666%200.6666666666666666%200%200%200%200.48%20-0.3666666666666667%201.1666666666666665%201.1666666666666665%200%200%200%20-1.7533333333333332%20-1.44Z'%20fill='currentColor'%20strokeWidth='0.6667'%3e%3c/path%3e%3c/g%3e%3c/svg%3e",MK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:iK,default:pK},Symbol.toStringTag,{value:"Module"})),bK=e=>p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",height:24,width:24,id:"Check-Circle-1--Streamline-Ultimate",...e},p.createElement("desc",null,"Check Circle 1 Streamline Icon: https://streamlinehq.com"),p.createElement("path",{d:"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm6.93 8.2 -6.85 9.29a1 1 0 0 1 -1.43 0.19l-4.89 -3.91a1 1 0 0 1 -0.15 -1.41A1 1 0 0 1 7 12.21l4.08 3.26L17.32 7a1 1 0 0 1 1.39 -0.21 1 1 0 0 1 0.22 1.41Z",fill:"currentcolor",strokeWidth:1})),lK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20height='24'%20width='24'%20id='Check-Circle-1--Streamline-Ultimate'%3e%3cdesc%3eCheck%20Circle%201%20Streamline%20Icon:%20https://streamlinehq.com%3c/desc%3e%3cpath%20d='M12%200a12%2012%200%201%200%2012%2012A12%2012%200%200%200%2012%200Zm6.93%208.2%20-6.85%209.29a1%201%200%200%201%20-1.43%200.19l-4.89%20-3.91a1%201%200%200%201%20-0.15%20-1.41A1%201%200%200%201%207%2012.21l4.08%203.26L17.32%207a1%201%200%200%201%201.39%20-0.21%201%201%200%200%201%200.22%201.41Z'%20fill='currentcolor'%20stroke-width='1'%3e%3c/path%3e%3c/svg%3e",zK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:bK,default:lK},Symbol.toStringTag,{value:"Module"})),uK=e=>p.createElement("svg",{viewBox:"-0.75 -0.75 20 20",xmlns:"http://www.w3.org/2000/svg",height:24,width:24,...e},p.createElement("desc",null,"Typography"),p.createElement("path",{d:"m0.578125 9.827354166666668 8.09375 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"m12.140625 13.296104166666666 5.78125 0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M12.140625 16.764854166666666V10.40625a2.890625 2.890625 0 0 1 5.78125 0v6.359375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.createElement("path",{d:"M0.578125 16.764854166666666V5.78125a4.046875 4.046875 0 0 1 8.09375 0v10.984375",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5})),dK="data:image/svg+xml,%3csvg%20viewBox='-0.75%20-0.75%2020%2020'%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20width='24'%3e%3cdesc%3eTypography%3c/desc%3e%3cpath%20d='m0.578125%209.827354166666668%208.09375%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='m12.140625%2013.296104166666666%205.78125%200'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M12.140625%2016.764854166666666V10.40625a2.890625%202.890625%200%200%201%205.78125%200v6.359375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3cpath%20d='M0.578125%2016.764854166666666V5.78125a4.046875%204.046875%200%200%201%208.09375%200v10.984375'%20fill='none'%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='1.5'%3e%3c/path%3e%3c/svg%3e",OK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:uK,default:dK},Symbol.toStringTag,{value:"Module"})),fK=Yt("",{variants:{size:{sm:"size-3",md:"size-4",lg:"size-6",xl:"size-8"}},defaultVariants:{size:"md"}}),AK=Object.assign({"../../assets/icons/error-fill.svg":rK,"../../assets/icons/info-fill.svg":sK,"../../assets/icons/skull-and-bones.svg":MK,"../../assets/icons/success-fill.svg":zK,"../../assets/icons/typography.svg":OK}),Di=Object.entries(AK).reduce((e,[t,o])=>{var n;const r=((n=t.match(/[^/]+(?=\.svg$)/))==null?void 0:n[0])??"",a=FQ(r),i=b=>{const{size:l,className:u,...O}=b,f=g0(fK({size:l,className:u}));return b0.createElement(o.ReactComponent,{...O,className:f})};return i.displayName=`Icon.${a}`,e[a]=i,e},{}),lc0=Di,hK=p.createContext({isAnyTextFieldFocused:!1,setFocusState:()=>{},darkMode:!1}),qK=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>(t(!0),()=>t(!1)),[]),e?Ep.createPortal(z.jsx("div",{className:en,style:{width:"unset",height:"unset"},children:z.jsx(JG,{icons:{error:z.jsx(Di.ErrorFill,{className:"text-red"}),success:z.jsx(Di.SuccessFill,{className:"text-green"}),info:z.jsx(Di.InfoFill,{className:"text-gray-500"})},position:"bottom-left",toastOptions:{classNames:{title:"!mt-[-1px] !text-md !font-semibold !leading-tighter !tracking-[0.1px]",description:"!text-gray-900 dark:!text-gray-300 !text-sm !mt-px",icon:"!ml-0"},style:{alignItems:"flex-start",maxWidth:"290px"}}})}),document.body):null},mK=({darkMode:e,children:t})=>{const[o,n]=p.useState(!1),r=a=>{n(a)};return z.jsx(hK.Provider,{value:{isAnyTextFieldFocused:o,setFocusState:r,darkMode:e},children:z.jsxs(tK,{children:[t,z.jsx(qK,{})]})})},en="shade shade-admin shade-activitypub shade-stats shade-posts",gK=({darkMode:e,fetchKoenigLexical:t,className:o,children:n,...r})=>{const a=Z1("shade",o);return z.jsx("div",{className:a,...r,children:z.jsx(mK,{darkMode:e,children:n})})},WK=OH,vK=fH,RK=AH,z9=p.forwardRef(({className:e,...t},o)=>z.jsx(Y7,{className:g0("fixed inset-0 z-50 bg-black/30 backdrop-blur-none transform-gpu data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:backdrop-blur-[3px]",e),...t,ref:o}));z9.displayName=Y7.displayName;const u9=p.forwardRef(({className:e,...t},o)=>z.jsx(RK,{children:z.jsxs("div",{className:en,children:[z.jsx(z9,{onClick:n=>n.stopPropagation()}),z.jsx(J7,{ref:o,className:g0("fixed left-[50%] top-[20%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg",e),...t})]})}));u9.displayName=J7.displayName;const d9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col space-y-2 text-center sm:text-left",e),...t});d9.displayName="AlertDialogHeader";const O9=({className:e,...t})=>z.jsx("div",{className:g0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 [&>button]:min-w-20",e),...t});O9.displayName="AlertDialogFooter";const f9=p.forwardRef(({className:e,...t},o)=>z.jsx(o8,{ref:o,className:g0("text-xl font-semibold",e),...t}));f9.displayName=o8.displayName;const A9=p.forwardRef(({className:e,...t},o)=>z.jsx(n8,{ref:o,className:g0("text-base",e),...t}));A9.displayName=n8.displayName;const h9=p.forwardRef(({className:e,...t},o)=>z.jsx(e8,{ref:o,className:g0(z3(),e),...t}));h9.displayName=e8.displayName;const q9=p.forwardRef(({className:e,...t},o)=>z.jsx(t8,{ref:o,className:g0(z3({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));q9.displayName=t8.displayName;const yK=p.lazy(()=>z1(()=>import("./index-qWpHJAMP.js"),[])),Bf=e=>z.jsx(p.Suspense,{fallback:z.jsx("div",{}),children:z.jsx(yK,{...e})}),ld=p.forwardRef(({className:e,...t},o)=>z.jsx(Aq,{ref:o,className:g0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));ld.displayName=Aq.displayName;const zd=p.forwardRef(({className:e,...t},o)=>z.jsx(hq,{ref:o,className:g0("aspect-square h-full w-full",e),...t}));zd.displayName=hq.displayName;const ud=p.forwardRef(({className:e,...t},o)=>z.jsx(qq,{ref:o,className:g0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));ud.displayName=qq.displayName;const wK=Yt("inline-flex items-center rounded-sm border px-1.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground/70",destructive:"border-transparent bg-destructive/20 text-destructive",success:"border-transparent bg-green/20 text-green",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function LK({className:e,variant:t,...o}){return z.jsx("div",{className:g0(wK({variant:t}),e),...o})}const xK=Yt("relative block rounded-lg transition-all duration-300",{variants:{variant:{default:"border border-border bg-background shadow-sm hover:shadow-md",gradient:["cursor-pointer border border-gray-100 bg-white","shadow-[rgb(75_225_226_/_28%)_-7px_-6px_42px_8px,rgb(202_103_255_/_32%)_7px_6px_42px_8px]","hover:shadow-[rgb(75_225_226_/_38%)_-7px_-4px_42px_10px,rgb(202_103_255_/_42%)_7px_8px_42px_10px]","hover:translate-y-[-2px] hover:scale-[1.01]"],info:"bg-blue-50 border-blue-200 dark:bg-blue-950/30 dark:border-blue-800 border",success:"bg-green-50 border-green-200 dark:bg-green-950/30 dark:border-green-800 border",warning:"bg-yellow-50 border-yellow-200 dark:bg-yellow-950/30 dark:border-yellow-800 border",destructive:"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800 border"},size:{sm:"p-2 text-sm",md:"p-3",lg:"p-4"}},defaultVariants:{variant:"default",size:"md"}}),dd=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:a,role:i="status",className:b,children:l,...u}=e,O=f=>{f.preventDefault(),f.stopPropagation(),r&&a&&a()};return z.jsxs("div",{ref:t,className:g0(xK({variant:o,size:n}),b),role:i,...u,children:[r&&z.jsx(o1,{"aria-label":"Dismiss notification",className:"absolute right-1 top-1 size-8 text-gray-600",size:"icon",variant:"ghost",onClick:O,children:z.jsx(bd,{className:"size-5"})}),l]})});dd.displayName="Banner";function jo(e,t,{checkForDefaultPrevented:o=!0}={}){return function(r){if(e?.(r),o===!1||!r.defaultPrevented)return t?.(r)}}var kK="DismissableLayer",bz="dismissableLayer.update",CK="dismissableLayer.pointerDownOutside",NK="dismissableLayer.focusOutside",_f,m9=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),g9=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,onDismiss:b,...l}=e,u=p.useContext(m9),[O,f]=p.useState(null),h=O?.ownerDocument??globalThis?.document,[,q]=p.useState({}),g=Y0(t,N=>f(N)),W=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=W.indexOf(v),x=O?W.indexOf(O):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,L=x>=y,C=EK(N=>{const D=N.target,Y=[...u.branches].some(V=>V.contains(D));!L||Y||(r?.(N),i?.(N),N.defaultPrevented||b?.())},h),w=SK(N=>{const D=N.target;[...u.branches].some(V=>V.contains(D))||(a?.(N),i?.(N),N.defaultPrevented||b?.())},h);return Ip(N=>{x===u.layers.size-1&&(n?.(N),!N.defaultPrevented&&b&&(N.preventDefault(),b()))},h),p.useEffect(()=>{if(O)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(_f=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(O)),u.layers.add(O),Ef(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=_f)}},[O,h,o,u]),p.useEffect(()=>()=>{O&&(u.layers.delete(O),u.layersWithOutsidePointerEventsDisabled.delete(O),Ef())},[O,u]),p.useEffect(()=>{const N=()=>q({});return document.addEventListener(bz,N),()=>document.removeEventListener(bz,N)},[]),z.jsx(H0.div,{...l,ref:g,style:{pointerEvents:k?L?"auto":"none":void 0,...e.style},onFocusCapture:jo(e.onFocusCapture,w.onFocusCapture),onBlurCapture:jo(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:jo(e.onPointerDownCapture,C.onPointerDownCapture)})});g9.displayName=kK;var BK="DismissableLayerBranch",_K=p.forwardRef((e,t)=>{const o=p.useContext(m9),n=p.useRef(null),r=Y0(t,n);return p.useEffect(()=>{const a=n.current;if(a)return o.branches.add(a),()=>{o.branches.delete(a)}},[o.branches]),z.jsx(H0.div,{...e,ref:r})});_K.displayName=BK;function EK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1),r=p.useRef(()=>{});return p.useEffect(()=>{const a=b=>{if(b.target&&!n.current){let l=function(){W9(CK,o,u,{discrete:!0})};const u={originalEvent:b};b.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,o]),{onPointerDownCapture:()=>n.current=!0}}function SK(e,t=globalThis?.document){const o=he(e),n=p.useRef(!1);return p.useEffect(()=>{const r=a=>{a.target&&!n.current&&W9(NK,o,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,o]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ef(){const e=new CustomEvent(bz);document.dispatchEvent(e)}function W9(e,t,o,{discrete:n}){const r=o.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:o});t&&r.addEventListener(e,t,{once:!0}),n?qa(r,a):r.dispatchEvent(a)}function TK(e,t){return p.useReducer((o,n)=>t[o][n]??o,e)}var u3=e=>{const{present:t,children:o}=e,n=PK(t),r=typeof o=="function"?o({present:n.isPresent}):p.Children.only(o),a=Y0(n.ref,XK(r));return typeof o=="function"||n.isPresent?p.cloneElement(r,{ref:a}):null};u3.displayName="Presence";function PK(e){const[t,o]=p.useState(),n=p.useRef(null),r=p.useRef(e),a=p.useRef("none"),i=e?"mounted":"unmounted",[b,l]=TK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=di(n.current);a.current=b==="mounted"?u:"none"},[b]),re(()=>{const u=n.current,O=r.current;if(O!==e){const h=a.current,q=di(u);e?l("MOUNT"):q==="none"||u?.display==="none"?l("UNMOUNT"):l(O&&h!==q?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),re(()=>{if(t){let u;const O=t.ownerDocument.defaultView??window,f=q=>{const W=di(n.current).includes(CSS.escape(q.animationName));if(q.target===t&&W&&(l("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=O.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=q=>{q.target===t&&(a.current=di(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{O.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(b),ref:p.useCallback(u=>{n.current=u?getComputedStyle(u):null,o(u)},[])}}function di(e){return e?.animationName||"none"}function XK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Ml=0;function jK(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sf()),document.body.insertAdjacentElement("beforeend",e[1]??Sf()),Ml++,()=>{Ml===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ml--}},[])}function Sf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var d3="Dialog",[v9]=_e(d3),[DK,Y2]=v9(d3),R9=e=>{const{__scopeDialog:t,children:o,open:n,defaultOpen:r,onOpenChange:a,modal:i=!0}=e,b=p.useRef(null),l=p.useRef(null),[u,O]=Ko({prop:n,defaultProp:r??!1,onChange:a,caller:d3});return z.jsx(DK,{scope:t,triggerRef:b,contentRef:l,contentId:e2(),titleId:e2(),descriptionId:e2(),open:u,onOpenChange:O,onOpenToggle:p.useCallback(()=>O(f=>!f),[O]),modal:i,children:o})};R9.displayName=d3;var y9="DialogTrigger",w9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(y9,o),a=Y0(t,r.triggerRef);return z.jsx(H0.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Ad(r.open),...n,ref:a,onClick:jo(e.onClick,r.onOpenToggle)})});w9.displayName=y9;var Od="DialogPortal",[IK,L9]=v9(Od,{forceMount:void 0}),x9=e=>{const{__scopeDialog:t,forceMount:o,children:n,container:r}=e,a=Y2(Od,t);return z.jsx(IK,{scope:t,forceMount:o,children:p.Children.map(n,i=>z.jsx(u3,{present:o||a.open,children:z.jsx(Zr,{asChild:!0,container:r,children:i})}))})};x9.displayName=Od;var zp="DialogOverlay",k9=p.forwardRef((e,t)=>{const o=L9(zp,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=Y2(zp,e.__scopeDialog);return a.modal?z.jsx(u3,{present:n||a.open,children:z.jsx(HK,{...r,ref:t})}):null});k9.displayName=zp;var FK=Fo("DialogOverlay.RemoveScroll"),HK=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(zp,o);return z.jsx(wa,{as:FK,allowPinchZoom:!0,shards:[r.contentRef],children:z.jsx(H0.div,{"data-state":Ad(r.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Tn="DialogContent",C9=p.forwardRef((e,t)=>{const o=L9(Tn,e.__scopeDialog),{forceMount:n=o.forceMount,...r}=e,a=Y2(Tn,e.__scopeDialog);return z.jsx(u3,{present:n||a.open,children:a.modal?z.jsx(UK,{...r,ref:t}):z.jsx(VK,{...r,ref:t})})});C9.displayName=Tn;var UK=p.forwardRef((e,t)=>{const o=Y2(Tn,e.__scopeDialog),n=p.useRef(null),r=Y0(t,o.contentRef,n);return p.useEffect(()=>{const a=n.current;if(a)return Up(a)},[]),z.jsx(N9,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:jo(e.onCloseAutoFocus,a=>{a.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:jo(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,b=i.button===0&&i.ctrlKey===!0;(i.button===2||b)&&a.preventDefault()}),onFocusOutside:jo(e.onFocusOutside,a=>a.preventDefault())})}),VK=p.forwardRef((e,t)=>{const o=Y2(Tn,e.__scopeDialog),n=p.useRef(!1),r=p.useRef(!1);return z.jsx(N9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(n.current||o.triggerRef.current?.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=a.target;o.triggerRef.current?.contains(i)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),N9=p.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,...i}=e,b=Y2(Tn,o),l=p.useRef(null),u=Y0(t,l);return jK(),z.jsxs(z.Fragment,{children:[z.jsx(ya,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:z.jsx(g9,{role:"dialog",id:b.contentId,"aria-describedby":b.descriptionId,"aria-labelledby":b.titleId,"data-state":Ad(b.open),...i,ref:u,onDismiss:()=>b.onOpenChange(!1)})}),z.jsxs(z.Fragment,{children:[z.jsx($K,{titleId:b.titleId}),z.jsx(ZK,{contentRef:l,descriptionId:b.descriptionId})]})]})}),fd="DialogTitle",B9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(fd,o);return z.jsx(H0.h2,{id:r.titleId,...n,ref:t})});B9.displayName=fd;var _9="DialogDescription",E9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(_9,o);return z.jsx(H0.p,{id:r.descriptionId,...n,ref:t})});E9.displayName=_9;var S9="DialogClose",T9=p.forwardRef((e,t)=>{const{__scopeDialog:o,...n}=e,r=Y2(S9,o);return z.jsx(H0.button,{type:"button",...n,ref:t,onClick:jo(e.onClick,()=>r.onOpenChange(!1))})});T9.displayName=S9;function Ad(e){return e?"open":"closed"}var P9="DialogTitleWarning",[zc0,X9]=uh(P9,{contentName:Tn,titleName:fd,docsSlug:"dialog"}),$K=({titleId:e})=>{const t=X9(P9),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
600
600
|
|
|
601
601
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
602
602
|
|
|
@@ -619,4 +619,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
619
619
|
newResult[${C}] = ${L}.value;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
-
`)}q.write("payload.value = newResult;"),q.write("return payload;");const x=q.compile();return(k,L)=>x(h,k,L)};let a;const i=qp,b=!lW.jitless,u=b&&$10.value,O=t.catchall;let f;e._zod.parse=(h,q)=>{f??(f=n.value);const g=h.value;return i(g)?b&&u&&q?.async===!1&&q.jitless!==!0?(a||(a=r(t.shape)),h=a(h,q),O?vW([],g,h,q,f,e):h):o(h,q):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function Zf(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const r=e.filter(a=>!yr(a));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(i=>Zo(i,n,Qo())))}),t)}const C20=n0("$ZodUnion",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),m1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),m1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),m1(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${r.map(a=>Vd(a.source)).join("|")})$`)}});const o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,a)=>{if(o)return n(r,a);let i=!1;const b=[];for(const l of t.options){const u=l._zod.run({value:r.value,issues:[]},a);if(u instanceof Promise)b.push(u),i=!0;else{if(u.issues.length===0)return u;b.push(u)}}return i?Promise.all(b).then(l=>Zf(l,r,e,a)):Zf(b,r,e,a)}}),N20=n0("$ZodIntersection",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value,a=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([l,u])=>Gf(o,l,u)):Gf(o,a,i)}});function mz(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Fr(e)&&Fr(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),r={...e,...t};for(const a of n){const i=mz(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r[a]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const r=e[n],a=t[n],i=mz(r,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Gf(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),yr(e))return e;const n=mz(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const B20=n0("$ZodRecord",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Fr(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;const a=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:r[l],issues:[]},n);u instanceof Promise?a.push(u.then(O=>{O.issues.length&&o.issues.push(...wr(l,O.issues)),o.value[l]=O.value})):(u.issues.length&&o.issues.push(...wr(l,u.issues)),o.value[l]=u.value)}let b;for(const l in r)i.has(l)||(b=b??[],b.push(l));b&&b.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:b})}else{o.value={};for(const i of Reflect.ownKeys(r)){if(i==="__proto__")continue;const b=t.keyType._zod.run({value:i,issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(b.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(u=>Zo(u,n,Qo())),input:i,path:[i],inst:e}),o.value[b.value]=b.value;continue}const l=t.valueType._zod.run({value:r[i],issues:[]},n);l instanceof Promise?a.push(l.then(u=>{u.issues.length&&o.issues.push(...wr(i,u.issues)),o.value[b.value]=u.value})):(l.issues.length&&o.issues.push(...wr(i,l.issues)),o.value[b.value]=l.value)}}return a.length?Promise.all(a).then(()=>o):o}}),_20=n0("$ZodEnum",(e,t)=>{V1.init(e,t);const o=V10(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>Q10.has(typeof r)).map(r=>typeof r=="string"?E3(r):r.toString()).join("|")})$`),e._zod.parse=(r,a)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:o,input:i,inst:e}),r}}),E20=n0("$ZodTransform",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new bW(e.constructor.name);const r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(o.value=i,o));if(r instanceof Promise)throw new Pr;return o.value=r,o}});function Kf(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const S20=n0("$ZodOptional",(e,t)=>{V1.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Vd(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>Kf(a,o.value)):Kf(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),T20=n0("$ZodNullable",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Vd(o.source)}|null)$`):void 0}),m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),P20=n0("$ZodDefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>Yf(a,t)):Yf(r,t)}});function Yf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const X20=n0("$ZodPrefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),j20=n0("$ZodNonOptional",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>Jf(a,e)):Jf(r,e)}});function Jf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const D20=n0("$ZodCatch",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(i=>Zo(i,n,Qo()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(a=>Zo(a,n,Qo()))},input:o.value}),o.issues=[]),o)}}),I20=n0("$ZodPipe",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>hi(i,t.in,n)):hi(a,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(a=>hi(a,t.out,n)):hi(r,t.out,n)}});function hi(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const RW=n0("$ZodCodec",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){const a=t.in._zod.run(o,n);return a instanceof Promise?a.then(i=>qi(i,t,n)):qi(a,t,n)}else{const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>qi(i,t,n)):qi(a,t,n)}}});function qi(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(a=>mi(e,a,t.out,o)):mi(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>mi(e,a,t.in,o)):mi(e,r,t.in,o)}}function mi(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const F20=n0("$ZodReadonly",(e,t)=>{V1.init(e,t),m1(e._zod,"propValues",()=>t.innerType._zod.propValues),m1(e._zod,"values",()=>t.innerType._zod.values),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(eA):eA(r)}});function eA(e){return e.value=Object.freeze(e.value),e}const H20=n0("$ZodCustom",(e,t)=>{N2.init(e,t),V1.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then(a=>tA(a,o,n,e));tA(r,o,n,e)}});function tA(e,t,o,n){if(!e){const r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(Oa(r))}}class U20{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const r={...n,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function V20(){return new U20}const gi=V20();function $20(e,t){return new e({type:"string",...D0(t)})}function Q20(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D0(t)})}function oA(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D0(t)})}function Z20(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D0(t)})}function G20(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D0(t)})}function K20(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D0(t)})}function Y20(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D0(t)})}function J20(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D0(t)})}function et0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D0(t)})}function tt0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D0(t)})}function ot0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D0(t)})}function nt0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D0(t)})}function rt0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D0(t)})}function ct0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D0(t)})}function at0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D0(t)})}function st0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D0(t)})}function it0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D0(t)})}function pt0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D0(t)})}function Mt0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D0(t)})}function bt0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D0(t)})}function lt0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D0(t)})}function zt0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D0(t)})}function ut0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D0(t)})}function dt0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D0(t)})}function Ot0(e,t){return new e({type:"string",format:"date",check:"string_format",...D0(t)})}function ft0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D0(t)})}function At0(e,t){return new e({type:"string",format:"duration",check:"string_format",...D0(t)})}function ht0(e,t){return new e({type:"boolean",...D0(t)})}function qt0(e){return new e({type:"unknown"})}function mt0(e,t){return new e({type:"never",...D0(t)})}function gt0(e,t){return new e({type:"date",...D0(t)})}function Wt0(e,t){return new je0({check:"less_than",...D0(t),value:e,inclusive:!0})}function vt0(e,t){return new De0({check:"greater_than",...D0(t),value:e,inclusive:!0})}function yW(e,t){return new Ie0({check:"max_length",...D0(t),maximum:e})}function gp(e,t){return new Fe0({check:"min_length",...D0(t),minimum:e})}function wW(e,t){return new He0({check:"length_equals",...D0(t),length:e})}function Rt0(e,t){return new Ue0({check:"string_format",format:"regex",...D0(t),pattern:e})}function yt0(e){return new Ve0({check:"string_format",format:"lowercase",...D0(e)})}function wt0(e){return new $e0({check:"string_format",format:"uppercase",...D0(e)})}function Lt0(e,t){return new Qe0({check:"string_format",format:"includes",...D0(t),includes:e})}function xt0(e,t){return new Ze0({check:"string_format",format:"starts_with",...D0(t),prefix:e})}function kt0(e,t){return new Ge0({check:"string_format",format:"ends_with",...D0(t),suffix:e})}function Ha(e){return new Ke0({check:"overwrite",tx:e})}function Ct0(e){return Ha(t=>t.normalize(e))}function Nt0(){return Ha(e=>e.trim())}function Bt0(){return Ha(e=>e.toLowerCase())}function _t0(){return Ha(e=>e.toUpperCase())}function Et0(e,t,o){return new e({type:"array",element:t,...D0(o)})}function St0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...D0(o)})}function Tt0(e){const t=Pt0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Oa(n,o.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(Oa(r))}},e(o.value,o)));return t}function Pt0(e,t){const o=new N2({check:"custom",...D0(t)});return o._zod.check=e,o}function Xt0(e,t){const o=D0(t);let n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(n=n.map(q=>typeof q=="string"?q.toLowerCase():q),r=r.map(q=>typeof q=="string"?q.toLowerCase():q));const a=new Set(n),i=new Set(r),b=e.Codec??RW,l=e.Boolean??gW,u=e.String??I3,O=new u({type:"string",error:o.error}),f=new l({type:"boolean",error:o.error}),h=new b({type:"pipe",in:O,out:f,transform:((q,g)=>{let W=q;return o.case!=="sensitive"&&(W=W.toLowerCase()),a.has(W)?!0:i.has(W)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...i],input:g.value,inst:h,continue:!1}),{})}),reverseTransform:((q,g)=>q===!0?n[0]||"true":r[0]||"false"),error:o.error});return h}const jt0=n0("ZodISODateTime",(e,t)=>{b20.init(e,t),$1.init(e,t)});function LW(e){return dt0(jt0,e)}const Dt0=n0("ZodISODate",(e,t)=>{l20.init(e,t),$1.init(e,t)});function It0(e){return Ot0(Dt0,e)}const Ft0=n0("ZodISOTime",(e,t)=>{z20.init(e,t),$1.init(e,t)});function Ht0(e){return ft0(Ft0,e)}const Ut0=n0("ZodISODuration",(e,t)=>{u20.init(e,t),$1.init(e,t)});function Vt0(e){return At0(Ut0,e)}const $t0=(e,t)=>{OW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>re0(e,o)},flatten:{value:o=>ne0(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,qz,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,qz,2)}},isEmpty:{get(){return e.issues.length===0}}})},B2=n0("ZodError",$t0,{Parent:Error}),Qt0=T3(B2),Zt0=P3(B2),Gt0=X3(B2),Kt0=j3(B2),Yt0=se0(B2),Jt0=ie0(B2),eo0=pe0(B2),to0=Me0(B2),oo0=be0(B2),no0=le0(B2),ro0=ze0(B2),co0=ue0(B2),ce=n0("ZodType",(e,t)=>(V1.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone(Qn(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>tn(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>Qt0(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>Gt0(e,o,n),e.parseAsync=async(o,n)=>Zt0(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>Kt0(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>Yt0(e,o,n),e.decode=(o,n)=>Jt0(e,o,n),e.encodeAsync=async(o,n)=>eo0(e,o,n),e.decodeAsync=async(o,n)=>to0(e,o,n),e.safeEncode=(o,n)=>oo0(e,o,n),e.safeDecode=(o,n)=>no0(e,o,n),e.safeEncodeAsync=async(o,n)=>ro0(e,o,n),e.safeDecodeAsync=async(o,n)=>co0(e,o,n),e.refine=(o,n)=>e.check(Go0(o,n)),e.superRefine=o=>e.check(Ko0(o)),e.overwrite=o=>e.check(Ha(o)),e.optional=()=>rA(e),e.nullable=()=>cA(e),e.nullish=()=>rA(cA(e)),e.nonoptional=o=>Fo0(e,o),e.array=()=>Qd(e),e.or=o=>ko0([e,o]),e.and=o=>No0(e,o),e.transform=o=>aA(e,To0(o)),e.default=o=>jo0(e,o),e.prefault=o=>Io0(e,o),e.catch=o=>Uo0(e,o),e.pipe=o=>aA(e,o),e.readonly=()=>Qo0(e),e.describe=o=>{const n=e.clone();return gi.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return gi.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return gi.get(e);const n=e.clone();return gi.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),xW=n0("_ZodString",(e,t)=>{I3.init(e,t),ce.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(Rt0(...n)),e.includes=(...n)=>e.check(Lt0(...n)),e.startsWith=(...n)=>e.check(xt0(...n)),e.endsWith=(...n)=>e.check(kt0(...n)),e.min=(...n)=>e.check(gp(...n)),e.max=(...n)=>e.check(yW(...n)),e.length=(...n)=>e.check(wW(...n)),e.nonempty=(...n)=>e.check(gp(1,...n)),e.lowercase=n=>e.check(yt0(n)),e.uppercase=n=>e.check(wt0(n)),e.trim=()=>e.check(Nt0()),e.normalize=(...n)=>e.check(Ct0(...n)),e.toLowerCase=()=>e.check(Bt0()),e.toUpperCase=()=>e.check(_t0())}),kW=n0("ZodString",(e,t)=>{I3.init(e,t),xW.init(e,t),e.email=o=>e.check(Q20(ao0,o)),e.url=o=>e.check(J20(so0,o)),e.jwt=o=>e.check(ut0(go0,o)),e.emoji=o=>e.check(et0(io0,o)),e.guid=o=>e.check(oA(nA,o)),e.uuid=o=>e.check(Z20(Wi,o)),e.uuidv4=o=>e.check(G20(Wi,o)),e.uuidv6=o=>e.check(K20(Wi,o)),e.uuidv7=o=>e.check(Y20(Wi,o)),e.nanoid=o=>e.check(tt0(po0,o)),e.guid=o=>e.check(oA(nA,o)),e.cuid=o=>e.check(ot0(Mo0,o)),e.cuid2=o=>e.check(nt0(bo0,o)),e.ulid=o=>e.check(rt0(lo0,o)),e.base64=o=>e.check(bt0(ho0,o)),e.base64url=o=>e.check(lt0(qo0,o)),e.xid=o=>e.check(ct0(zo0,o)),e.ksuid=o=>e.check(at0(uo0,o)),e.ipv4=o=>e.check(st0(do0,o)),e.ipv6=o=>e.check(it0(Oo0,o)),e.cidrv4=o=>e.check(pt0(fo0,o)),e.cidrv6=o=>e.check(Mt0(Ao0,o)),e.e164=o=>e.check(zt0(mo0,o)),e.datetime=o=>e.check(LW(o)),e.date=o=>e.check(It0(o)),e.time=o=>e.check(Ht0(o)),e.duration=o=>e.check(Vt0(o))});function s2(e){return $20(kW,e)}const $1=n0("ZodStringFormat",(e,t)=>{I1.init(e,t),xW.init(e,t)}),ao0=n0("ZodEmail",(e,t)=>{o20.init(e,t),$1.init(e,t)}),nA=n0("ZodGUID",(e,t)=>{e20.init(e,t),$1.init(e,t)}),Wi=n0("ZodUUID",(e,t)=>{t20.init(e,t),$1.init(e,t)}),so0=n0("ZodURL",(e,t)=>{n20.init(e,t),$1.init(e,t)}),io0=n0("ZodEmoji",(e,t)=>{r20.init(e,t),$1.init(e,t)}),po0=n0("ZodNanoID",(e,t)=>{c20.init(e,t),$1.init(e,t)}),Mo0=n0("ZodCUID",(e,t)=>{a20.init(e,t),$1.init(e,t)}),bo0=n0("ZodCUID2",(e,t)=>{s20.init(e,t),$1.init(e,t)}),lo0=n0("ZodULID",(e,t)=>{i20.init(e,t),$1.init(e,t)}),zo0=n0("ZodXID",(e,t)=>{p20.init(e,t),$1.init(e,t)}),uo0=n0("ZodKSUID",(e,t)=>{M20.init(e,t),$1.init(e,t)}),do0=n0("ZodIPv4",(e,t)=>{d20.init(e,t),$1.init(e,t)}),Oo0=n0("ZodIPv6",(e,t)=>{O20.init(e,t),$1.init(e,t)}),fo0=n0("ZodCIDRv4",(e,t)=>{f20.init(e,t),$1.init(e,t)}),Ao0=n0("ZodCIDRv6",(e,t)=>{A20.init(e,t),$1.init(e,t)}),ho0=n0("ZodBase64",(e,t)=>{h20.init(e,t),$1.init(e,t)}),qo0=n0("ZodBase64URL",(e,t)=>{m20.init(e,t),$1.init(e,t)}),mo0=n0("ZodE164",(e,t)=>{g20.init(e,t),$1.init(e,t)}),go0=n0("ZodJWT",(e,t)=>{v20.init(e,t),$1.init(e,t)}),CW=n0("ZodBoolean",(e,t)=>{gW.init(e,t),ce.init(e,t)});function gz(e){return ht0(CW,e)}const Wo0=n0("ZodUnknown",(e,t)=>{R20.init(e,t),ce.init(e,t)});function Wz(){return qt0(Wo0)}const vo0=n0("ZodNever",(e,t)=>{y20.init(e,t),ce.init(e,t)});function Ro0(e){return mt0(vo0,e)}const yo0=n0("ZodDate",(e,t)=>{w20.init(e,t),ce.init(e,t),e.min=(n,r)=>e.check(vt0(n,r)),e.max=(n,r)=>e.check(Wt0(n,r));const o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function wo0(e){return gt0(yo0,e)}const Lo0=n0("ZodArray",(e,t)=>{L20.init(e,t),ce.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(gp(o,n)),e.nonempty=o=>e.check(gp(1,o)),e.max=(o,n)=>e.check(yW(o,n)),e.length=(o,n)=>e.check(wW(o,n)),e.unwrap=()=>e.element});function Qd(e,t){return Et0(Lo0,e,t)}const NW=n0("ZodObject",(e,t)=>{k20.init(e,t),ce.init(e,t),m1(e,"shape",()=>t.shape),e.keyof=()=>Eo0(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Wz()}),e.loose=()=>e.clone({...e._zod.def,catchall:Wz()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ro0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>Y10(e,o),e.safeExtend=o=>J10(e,o),e.merge=o=>ee0(e,o),e.pick=o=>G10(e,o),e.omit=o=>K10(e,o),e.partial=(...o)=>te0(BW,e,o[0]),e.required=(...o)=>oe0(_W,e,o[0])});function Wp(e,t){const o={type:"object",shape:e??{},...D0(t)};return new NW(o)}function F3(e,t){return new NW({type:"object",shape:e,catchall:Wz(),...D0(t)})}const xo0=n0("ZodUnion",(e,t)=>{C20.init(e,t),ce.init(e,t),e.options=t.options});function ko0(e,t){return new xo0({type:"union",options:e,...D0(t)})}const Co0=n0("ZodIntersection",(e,t)=>{N20.init(e,t),ce.init(e,t)});function No0(e,t){return new Co0({type:"intersection",left:e,right:t})}const Bo0=n0("ZodRecord",(e,t)=>{B20.init(e,t),ce.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function _o0(e,t,o){return new Bo0({type:"record",keyType:e,valueType:t,...D0(o)})}const vz=n0("ZodEnum",(e,t)=>{_20.init(e,t),ce.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const a={};for(const i of n)if(o.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new vz({...t,checks:[],...D0(r),entries:a})},e.exclude=(n,r)=>{const a={...t.entries};for(const i of n)if(o.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new vz({...t,checks:[],...D0(r),entries:a})}});function Eo0(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new vz({type:"enum",entries:o,...D0(t)})}const So0=n0("ZodTransform",(e,t)=>{E20.init(e,t),ce.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new bW(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Oa(a,o.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(Oa(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(a=>(o.value=a,o)):(o.value=r,o)}});function To0(e){return new So0({type:"transform",transform:e})}const BW=n0("ZodOptional",(e,t)=>{S20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rA(e){return new BW({type:"optional",innerType:e})}const Po0=n0("ZodNullable",(e,t)=>{T20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cA(e){return new Po0({type:"nullable",innerType:e})}const Xo0=n0("ZodDefault",(e,t)=>{P20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jo0(e,t){return new Xo0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():uW(t)}})}const Do0=n0("ZodPrefault",(e,t)=>{X20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Io0(e,t){return new Do0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():uW(t)}})}const _W=n0("ZodNonOptional",(e,t)=>{j20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fo0(e,t){return new _W({type:"nonoptional",innerType:e,...D0(t)})}const Ho0=n0("ZodCatch",(e,t)=>{D20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Uo0(e,t){return new Ho0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const EW=n0("ZodPipe",(e,t)=>{I20.init(e,t),ce.init(e,t),e.in=t.in,e.out=t.out});function aA(e,t){return new EW({type:"pipe",in:e,out:t})}const SW=n0("ZodCodec",(e,t)=>{EW.init(e,t),RW.init(e,t)});function Vo0(e,t,o){return new SW({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const $o0=n0("ZodReadonly",(e,t)=>{F20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qo0(e){return new $o0({type:"readonly",innerType:e})}const Zo0=n0("ZodCustom",(e,t)=>{H20.init(e,t),ce.init(e,t)});function Go0(e,t={}){return St0(Zo0,e,t)}function Ko0(e){return Tt0(e)}const Yo0=(...e)=>Xt0({Codec:SW,Boolean:CW,String:kW},...e),TW=Vo0(LW({offset:!0}),wo0(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),Jo0=F3({slug:s2(),title:s2(),custom_excerpt:s2(),url:s2().url(),published_at:TW,featured:Yo0(),feature_image:s2().url().optional(),html:s2().optional()}).transform(e=>({slug:e.slug,title:e.title,customExcerpt:e.custom_excerpt,url:e.url,publishedAt:e.published_at,featured:e.featured,featureImage:e.feature_image,html:e.html})),en0=Wp({posts:Qd(Jo0).default([]),changelogUrl:s2().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),H3=()=>L2({queryKey:["changelog"],queryFn:async()=>{const e=await fetch("https://ghost.org/changelog.json");if(!e.ok)throw new Error(`Failed to fetch changelog: ${e.status}`);const t=await e.json();return en0.parse(t)},staleTime:1/0});function sA(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function PW(e,t){const o={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n],a=e[n];r!==void 0&&(sA(r)&&sA(a)?o[n]=PW(a,r):o[n]=r)}return o}const tn0=F3({lastSeenDate:TW.optional().catch(void 0)}),iA={expanded:{posts:!0},menu:{visible:!0}},on0=F3({expanded:Wp({posts:gz()}),menu:Wp({visible:gz()})}),Rz=F3({whatsNew:tn0.optional().catch(void 0),nightShift:gz().optional(),navigation:on0.default(iA).catch(iA)}),XW=e=>["userPreferences",e?.id,e?.accessibility];function Zd(e){const{data:t}=ye();return L2({...e,queryKey:XW(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return Rz.parse(n)},enabled:!!t,staleTime:1/0,cacheTime:0})}const U3=()=>{const e=f1(),{data:t}=ye(),{mutateAsync:o}=iW();return Y1({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(XW(t))??Rz.parse({}),a=PW(r,n),i=Rz.encode(a);await o({...t,accessibility:JSON.stringify(i)})}})};function nn0(){return{lastSeenDate:new Date}}const rn0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],jW=()=>{const{data:e,isSuccess:t}=Zd(),{data:o,isSuccess:n}=H3(),{mutateAsync:r}=U3(),a=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!a&&t&&r({whatsNew:nn0()})},[a,t,r]);const i=o?.entries[0];return L2({queryKey:rn0(e,i),queryFn:()=>{if(!i)return{hasNew:!1,hasNewFeatured:!1};const b=e.whatsNew.lastSeenDate,l=i.publishedAt>b,u=l&&i.featured===!0;return{hasNew:l,hasNewFeatured:u}},enabled:n&&a,staleTime:1/0,cacheTime:0})},DW=()=>{const{data:e}=H3(),{mutateAsync:t}=U3();return Y1({mutationFn:async()=>{const o=e?.entries[0];if(!o)return;const n={lastSeenDate:o.publishedAt};await t({whatsNew:n})}})};function cn0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function an0({entry:e}){return z.jsxs("a",{className:"flex items-start gap-6 p-2 -mx-2 rounded-md hover:bg-muted/80 transition-colors","data-test-entry":!0,href:e.url,rel:"noopener noreferrer",target:"_blank",children:[e.featureImage&&z.jsx("img",{alt:e.title,className:"flex-shrink-0 w-40 h-[110px] object-cover rounded","data-test-entry-image":!0,src:e.featureImage}),z.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[z.jsx("h2",{className:"text-[17px] font-semibold text-foreground mt-1.5","data-test-entry-title":!0,children:e.title}),z.jsx("p",{className:"text-sm text-gray-700 leading-[1.45] line-clamp-2","data-test-entry-excerpt":!0,children:e.customExcerpt}),z.jsx("span",{className:"text-sm text-gray-600","data-test-entry-date":!0,children:cn0(e.publishedAt)})]})]})}function sn0({open:e,onOpenChange:t}){const{data:o}=H3(),{mutate:n}=DW();return p.useEffect(()=>{e&&n()},[e,n]),z.jsx(q3,{open:e,onOpenChange:t,children:z.jsxs(Ta,{className:"max-w-2xl max-h-[85vh] flex flex-col","data-test-modal":"whats-new",role:"dialog","aria-modal":"true","aria-labelledby":"whats-new-modal-title",children:[z.jsx(hd,{children:z.jsx(md,{id:"whats-new-modal-title","data-test-modal-title":!0,className:"text-2xl tracking-tighter",children:"What’s new?"})}),o?z.jsxs(z.Fragment,{children:[z.jsx("section",{className:"flex-1 overflow-y-auto space-y-2 -mx-6 px-6","data-test-entries":!0,children:o.entries.map(r=>z.jsx(an0,{entry:r},r.slug))}),z.jsxs(qd,{className:"flex-row justify-between sm:justify-between gap-3",children:[z.jsx(o1,{asChild:!0,variant:"outline",children:z.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:o.changelogUrl,rel:"noopener noreferrer",target:"_blank",children:"All updates →"})})]})]}):z.jsx("div",{className:"flex-1 flex items-center justify-center py-12",children:z.jsx(Ap,{size:"lg"})})]})})}function IW(){const e=w10(),t=!!e?.subscription.isActiveTrial,o=e?.subscription.trial_end?Math.ceil((new Date(e.subscription.trial_end).getTime()-Date.now())/(1e3*60*60*24)):0;return{showUpgradeBanner:t,trialDaysRemaining:o}}function in0({children:e,...t}){return z.jsx("span",{className:"flex-1",...t,children:e})}const Ie=({children:e,...t})=>z.jsx(Fm,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});Ie.Label=in0;function vp(e){const t=ye();return z.jsxs(ld,{...e,children:[t.data?.profile_image&&z.jsx(zd,{src:t.data?.profile_image}),z.jsx(ud,{className:"text-foreground-muted hover:text-foreground",children:z.jsx(Md,{})})]})}function FW({name:e,email:t,children:o}){return z.jsx("div",{className:"p-3",children:z.jsxs("div",{className:"flex items-center gap-3",children:[o,z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"text-base font-semibold text-foreground",children:e}),z.jsx("span",{className:"text-xs text-foreground-muted -mt-px",children:t})]})]})})}function HW(){const e=ye();return z.jsx(Ie,{children:z.jsxs(Ba,{to:`/settings/staff/${e.data?.slug}`,children:[z.jsx(Md,{}),z.jsx(Ie.Label,{children:"Your profile"})]})})}function UW(){const{data:e}=Zd(),{mutateAsync:t,isLoading:o}=U3(),n=r=>{t({nightShift:r})};return z.jsxs(Ie,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[z.jsx(KZ,{}),z.jsx(Ie.Label,{className:"flex-1",children:"Dark mode"}),z.jsx(Ym,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function VW(){const e=()=>{fetch("/ghost/api/admin/session",{method:"DELETE"}).then(()=>{window.location.href="/ghost"}).catch(t=>{console.error(t)})};return z.jsxs(Ie,{asChild:!1,onSelect:e,children:[z.jsx(IZ,{}),z.jsx(Ie.Label,{children:"Sign out"})]})}function pn0(e){const t=ye(),{data:o}=jW(),{showUpgradeBanner:n}=IW();return z.jsxs(Dm,{...e,children:[z.jsx(Im,{asChild:!0,className:"focus-visible:ring-0",children:z.jsxs(jd,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground","aria-label":"User menu",children:[z.jsxs("div",{className:"relative",children:[z.jsx(vp,{}),o?.hasNew&&z.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:z.jsx(If,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-avatar-badge":!0})})]}),z.jsxs("div",{className:"grid flex-1 text-left text-base leading-tight",children:[z.jsx("span",{className:"truncate font-semibold",children:t.data?.name}),z.jsx("span",{className:"text-muted-foreground truncate text-xs -mt-px",children:t.data?.email})]}),z.jsx(dZ,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),z.jsxs(xd,{align:"end",sideOffset:10,className:`w-full min-w-[240px] sidebar:min-w-[260px] ${n?"shadow-[0_18px_80px_0_rgba(0,0,0,0.07),0_7.52px_33.422px_0_rgba(0,0,0,0.05),0_4.021px_17.869px_0_rgba(0,0,0,0.04),0_2.254px_10.017px_0_rgba(0,0,0,0.04),0_1.197px_5.32px_0_rgba(0,0,0,0.03),0_0.498px_2.214px_0_rgba(0,0,0,0.02)]":""}`,children:[z.jsx(FW,{name:t.data?.name,email:t.data?.email,children:z.jsx(vp,{})}),z.jsx(Cn,{}),z.jsxs(Ie,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{queueMicrotask(()=>e.onOpenWhatsNew?.())},children:[z.jsx(p9,{}),z.jsx(Ie.Label,{children:"What’s new?"}),o?.hasNew&&z.jsx("div",{className:"flex-1 flex justify-end",children:z.jsx(If,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),z.jsx(HW,{}),z.jsx(Cn,{}),z.jsx(Ie,{children:z.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(sZ,{}),z.jsx(Ie.Label,{children:"Resources & guides"})]})}),z.jsx(UW,{}),z.jsx(Cn,{}),z.jsx(VW,{})]})]})}function Mn0(){const e=ye(),o=_3().data?.site.url??"";return z.jsxs(Dm,{children:[z.jsx(Im,{asChild:!0,children:z.jsx("button",{className:"rounded-full shadow-lg hover:shadow-xl transition-shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 p-0.5 flex items-center justify-center border border-border dark:bg-muted bg-background","aria-label":"Open user menu",children:z.jsx(vp,{className:"w-11 h-11"})})}),z.jsxs(xd,{align:"start",side:"top",sideOffset:10,className:"w-full min-w-[240px] mb-2",children:[z.jsx(FW,{name:e.data?.name,email:e.data?.email,children:z.jsx(vp,{})}),z.jsx(Cn,{}),z.jsx(Ie,{children:z.jsxs(Ba,{to:"/",children:[z.jsx(xZ,{}),z.jsx(Ie.Label,{children:"Posts"})]})}),z.jsx(Ie,{children:z.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(sd,{}),z.jsx(Ie.Label,{children:"View site"})]})}),z.jsx(Cn,{}),z.jsx(HW,{}),z.jsx(UW,{}),z.jsx(Cn,{}),z.jsx(VW,{})]})]})}function bn0({...e}){const[t,o]=p.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsx(Yg,{...e,children:z.jsx(oc,{children:z.jsx(nc,{children:z.jsx(Xd,{children:z.jsx(pn0,{onOpenWhatsNew:()=>o(!0)})})})})}),z.jsx(sn0,{open:t,onOpenChange:o})]})}function ln0(){const{data:e}=jW(),{data:t}=H3(),{mutate:o}=DW(),[n,r]=p.useState(!1);if(n||!e?.hasNewFeatured)return null;const a=t?.entries[0];if(!a)return null;const i=()=>{r(!0),o()},b=()=>{o()};return z.jsx(dd,{"data-test-toast":"whats-new",role:"status","aria-label":"What’s new notification","aria-live":"polite",variant:"gradient",dismissible:!0,onDismiss:i,children:z.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"block pr-8",onClick:b,"data-test-toast-link":!0,children:[z.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[z.jsx(p9,{className:"size-4 text-purple-600"}),z.jsx("span",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide",children:"What’s new?"})]}),z.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1","data-test-toast-title":!0,children:a.title}),z.jsx("div",{className:"text-sm text-gray-700","data-test-toast-excerpt":!0,children:a.customExcerpt})]})})}const Rp="SettingsResponseType",V3=Kr({dataType:Rp,path:"/settings/",defaultSearchParams:{group:"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore"}}),kc0=Dn({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:Rp,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==Rp}}}}),Cc0=Dn({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:Rp}}),Nc0=Dn({method:"POST",path:()=>"/slack/test/"});function Bc0(e){const t=["API","CTA","RSS"];return e.replace(/^[a-z]/,o=>o.toUpperCase()).replace(/_/g," ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"ig"),o=>o.toUpperCase())}function _c0(e,t){return t.map(o=>{var n;return(n=e?.find(r=>r.key===o))==null?void 0:n.value})}function Tt(e,t){if(!e)return null;const o=e.find(n=>n.key===t);return o?.value||null}function Ec0(e,t){if(!e)return;const o=e.find(n=>n.key===t);return o?.is_read_only||!1}function Sc0(e,t){const o=a=>e.some(i=>i.key===a&&i.value),n=o("stripe_secret_key")&&o("stripe_publishable_key"),r=o("stripe_connect_secret_key")&&o("stripe_connect_publishable_key");return t.stripeDirect?n:r||n}var yz=(e=>(e[e.Note=0]="Note",e[e.Article=1]="Article",e[e.Tombstone=2]="Tombstone",e))(yz||{});const zn0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class un0{constructor(t,o,n,r=window.fetch.bind(window)){this.apiUrl=t,this.authApiUrl=o,this.handle=n,this.fetch=r}async getToken(){try{return(await(await this.fetch(this.authApiUrl)).json())?.identities?.[0]?.token||null}catch{return null}}async fetchJSON(t,o="GET",n){const r=await this.getToken(),a={method:o,headers:{Authorization:`Bearer ${r}`,Accept:"application/activity+json"}};n&&(a.body=JSON.stringify(n),a.headers["Content-Type"]="application/json");const i=await this.fetch(t,a);if(i.status===204||i.status===202)return null;if(!i.ok){const b={message:"Something went wrong, please try again.",statusCode:i.status};try{const l=await i.json(),u=l.message||l.error;u&&(b.message=u),l.code&&(b.code=l.code)}catch{}throw b}return await i.json()}async blockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/block/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async block(t){const o=new URL(`.ghost/activitypub/v1/actions/block/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblock(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async follow(t){const o=new URL(`.ghost/activitypub/v1/actions/follow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async unfollow(t){const o=new URL(`.ghost/activitypub/v1/actions/unfollow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async like(t){const o=new URL(`.ghost/activitypub/v1/actions/like/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async unlike(t){const o=new URL(`.ghost/activitypub/v1/actions/unlike/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async repost(t){const o=new URL(`.ghost/activitypub/v1/actions/repost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async derepost(t){const o=new URL(`.ghost/activitypub/v1/actions/derepost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async reply(t,o,n){const r=new URL(`.ghost/activitypub/v1/actions/reply/${encodeURIComponent(t)}`,this.apiUrl),a={content:o};return n&&(a.image=n),await this.fetchJSON(r,"POST",a)}async note(t,o){const n=new URL(".ghost/activitypub/v1/actions/note",this.apiUrl),r={content:t};return o&&(r.image=o),(await this.fetchJSON(n,"POST",r)).post}async delete(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"DELETE")}get userApiUrl(){return new URL(`.ghost/activitypub/users/${this.handle}`,this.apiUrl)}async getUser(){return await this.fetchJSON(this.userApiUrl)}get searchApiUrl(){return new URL(".ghost/activitypub/v1/actions/search",this.apiUrl)}async search(t){const o=this.searchApiUrl;o.searchParams.set("query",t);const n=await this.fetchJSON(o,"GET");return n&&"accounts"in n?n:{accounts:[]}}async getThread(t){const o=new URL(`.ghost/activitypub/v1/thread/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getAccount(t){const o=new URL(`.ghost/activitypub/v1/account/${t}`,this.apiUrl);return await this.fetchJSON(o)}async getAccountFollows(t,o,n){const r=new URL(`.ghost/activitypub/v1/account/${t}/follows/${o}`,this.apiUrl);n&&r.searchParams.set("next",n);const a=await this.fetchJSON(r);if(a===null)return{accounts:[],next:null};if(!("accounts"in a))return{accounts:[],next:null};const i=Array.isArray(a.accounts)?a.accounts:[],b="next"in a&&typeof a.next=="string"?a.next:null;return{accounts:i,next:b}}async getFeed(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/notes",t)}async getInbox(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/reader",t)}async getDiscoveryFeed(t,o){const n=`.ghost/activitypub/v1/feed/discover/${t}`;return this.getPaginatedPosts(n,o)}async getExploreAccounts(t,o){const n=`.ghost/activitypub/v1/explore/${t}`;return this.getPaginatedExploreAccounts(n,o)}async getTopics(){const t=new URL(".ghost/activitypub/v1/topics",this.apiUrl),o=await this.fetchJSON(t);return{topics:o&&"topics"in o&&Array.isArray(o.topics)?o.topics:[]}}async getRecommendations(t){const o=new URL(".ghost/activitypub/v1/recommendations",this.apiUrl);t&&o.searchParams.set("limit",t.toString());const n=await this.fetchJSON(o);return{accounts:n&&"accounts"in n&&Array.isArray(n.accounts)?n.accounts:[]}}async getPostsByAccount(t,o){return this.getPaginatedPosts(`.ghost/activitypub/v1/posts/${t}`,o)}async getPostsLikedByAccount(t){return this.getPaginatedPosts(".ghost/activitypub/v1/posts/me/liked",t)}async getPaginatedPosts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("posts"in r))return{posts:[],next:null};const a=Array.isArray(r.posts)?r.posts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{posts:a,next:i}}async getNotifications(t){const o=new URL(".ghost/activitypub/v1/notifications",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{notifications:[],next:null};if(!("notifications"in n))return{notifications:[],next:null};const r=Array.isArray(n.notifications)?n.notifications:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{notifications:r,next:a}}async getNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/count",this.apiUrl),o=await this.fetchJSON(t);return o===null?{count:0}:{count:typeof o.count=="number"?o.count:0}}async resetNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/reset",this.apiUrl);return await this.fetchJSON(t,"PUT"),!0}async getBlockedAccounts(t){const o=new URL(".ghost/activitypub/v1/blocks/accounts",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{accounts:[],next:null};const r="blocked_accounts"in n&&Array.isArray(n.blocked_accounts)?n.blocked_accounts:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{accounts:r,next:a}}async getBlockedDomains(t){const o=new URL(".ghost/activitypub/v1/blocks/domains",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{domains:[],next:null};const r="blocked_domains"in n&&Array.isArray(n.blocked_domains)?n.blocked_domains:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{domains:r,next:a}}async getPaginatedExploreAccounts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("accounts"in r))return{accounts:[],next:null};const a=Array.isArray(r.accounts)?r.accounts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{accounts:a,next:i}}async getPost(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getReplies(t,o){const n=new URL(`.ghost/activitypub/v1/replies/${encodeURIComponent(t)}`,this.apiUrl);return o&&n.searchParams.set("next",o),await this.fetchJSON(n)}async updateAccount({name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a}){const i=new URL(".ghost/activitypub/v1/account",this.apiUrl);await this.fetchJSON(i,"PUT",{name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a})}async upload(t){const o=new URL(".ghost/activitypub/v1/upload/image",this.apiUrl),n=new FormData;n.append("file",t);const r=await this.getToken(),a=await this.fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`},body:n});if(!a.ok)throw{message:"Upload failed",statusCode:a.status};return(await a.json()).fileUrl}async enableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/enable",this.apiUrl);await this.fetchJSON(t,"POST")}async disableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/disable",this.apiUrl);await this.fetchJSON(t,"POST")}async confirmBlueskyHandle(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/confirm-handle",this.apiUrl),o=await this.fetchJSON(t,"POST");return o===null||!("handle"in o)||typeof o.handle!="string"?"":String(o.handle)}}const $W="pending-";function QW(){return`${$W}${crypto.randomUUID()}`}function Tc0(e){return e.startsWith($W)}function dn0(e,t,o,n){const r={id:e.url,icon:e.icon,name:e.name,preferredUsername:e.preferredUsername,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};return{id:t,type:"Create",actor:r,object:{type:"Note",name:"",content:o,summary:null,url:"",attributedTo:r,image:n||"",published:new Date().toISOString(),attachment:[],preview:{type:"Note",content:o},id:t,replyCount:0,liked:!1,reposted:!1,repostCount:0,authored:!0,"@context":""},"@context":"",to:""}}function On0(e){return e.replace(/\n/g,"<br />")}function rc(e){let t="";e.repostedBy!==null?t="Announce":t="Create";const o={id:e.author.url,icon:{url:e.author.avatarUrl},name:e.author.name,preferredUsername:e.author.handle.split("@")[1],followedByMe:e.author.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};let n=null;e.repostedBy!==null&&(n={id:e.repostedBy.url,icon:{url:e.repostedBy.avatarUrl},name:e.repostedBy.name,preferredUsername:e.repostedBy.handle.split("@")[1],followedByMe:e.repostedBy.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""});let r="Note";e.type===yz.Article?r="Article":e.type===yz.Tombstone&&(r="Tombstone");const a={type:r,name:e.title,content:e.content,summary:e.summary,url:e.url,attributedTo:o,image:e.featureImageUrl??"",published:e.publishedAt,attachment:e.attachments,preview:{type:"",content:e.excerpt},id:e.id,replyCount:e.replyCount,likeCount:e.likeCount,liked:e.likedByMe,reposted:e.repostedByMe,repostCount:e.repostCount,authored:e.authoredByMe===!0,metadata:e.metadata,"@context":""};return{id:e.id,type:t,actor:n!==null?n:o,object:a,"@context":"",to:""}}let ul;async function c1(){return ul||(ul=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),ul}function a1(e,t){return new un0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function He(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){ve.error(e,{description:t})}function $3(e="Action failed",t="This user has restricted who can interact with their account."){ve.error(e,{description:t})}const l0={outbox:e=>["outbox",e],liked:e=>["liked",e],user:e=>["user",e],profilePosts:e=>e===null?["profile_posts"]:["profile_posts",e],account:e=>["account",e],accountFollows:(e,t)=>["account_follows",e,t],searchResults:e=>["search_results",e],suggestedProfiles:(e,t)=>["suggested_profiles",e,t],exploreProfiles:e=>["explore_profiles",e],replyChain:e=>e===null?["reply_chain"]:["reply_chain",e],feed:["feed"],inbox:["inbox"],discoveryFeed:["discovery_feed"],postsByAccount:["account_posts"],postsLikedByAccount:["account_liked_posts"],notifications:e=>["notifications",e],notificationsCount:e=>["notifications_count",e],blockedAccounts:e=>["blocked_accounts",e],blockedDomains:e=>["blocked_domains",e],topics:()=>["topics"]};function wz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.postsLikedByAccount,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,liked:o,likeCount:Math.max(o?(b.object.likeCount||0)+1:(b.object.likeCount||0)-1,0)}}:b)}))}),r===l0.postsLikedByAccount&&(e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:o?i.posts:i.posts.filter(b=>b.object.id!==t)}))}),o&&e.invalidateQueries({queryKey:l0.postsLikedByAccount}))}function ZW(e,t,o,n){const r=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index")],a=o.split("@")[1];for(const b of r)e.setQueriesData(b,l=>l===void 0?l:{...l,pages:l.pages.map(u=>({...u,posts:u.posts.map(O=>O.type!=="Announce"&&O.actor?.preferredUsername===a?{...O,actor:{...O.actor,followedByMe:n}}:O.type==="Announce"&&typeof O.object.attributedTo=="object"&&O.object.attributedTo&&!Array.isArray(O.object.attributedTo)&&"preferredUsername"in O.object.attributedTo&&O.object.attributedTo.preferredUsername===a?{...O,object:{...O.object,attributedTo:{...O.object.attributedTo,followedByMe:n}}}:O)}))});const i=l0.replyChain(null);e.setQueriesData(i,b=>{if(!b)return b;const l=u=>u.author.handle===o?{...u,author:{...u.author,followedByMe:n}}:u;return{...b,post:l(b.post),ancestors:{...b.ancestors,chain:b.ancestors.chain.map(l)},children:b.children.map(u=>({...u,post:l(u.post),chain:u.chain.map(l)}))}})}function GW(e,t,o){e.getQueryCache().getAll().forEach(a=>{const i=a.queryKey;Array.isArray(i)&&i[0]==="account_follows"&&e.setQueryData(i,b=>b?.pages?{...b,pages:b.pages.map(l=>({...l,accounts:l.accounts.map(u=>u.handle===t?{...u,isFollowing:o}:u)}))}:b)})}function Lz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,likedByMe:o,likeCount:Math.max(o?(i.likeCount||0)+1:(i.likeCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}}),e.setQueryData(l0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function xz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,likedByMe:n,likeCount:Math.max(n?b.post.likeCount+1:b.post.likeCount-1,0)}}:b)})}}catch{return a}})}function kz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,repostedByMe:n,repostCount:Math.max(n?b.post.repostCount+1:b.post.repostCount-1,0)}}:b)})}}catch{return a}})}function Cz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,replyCount:Math.max((b.post.replyCount??0)+n,0)}}:b)})}}catch{return a}})}function pA(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount];for(const r of n)e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,replyCount:Math.max((b.object.replyCount??0)+o,0)}}:b)}))})}function MA(e,t,o){const n=l0.replyChain(null);e.setQueriesData({queryKey:n,exact:!1},r=>{if(!r)return r;const a=i=>i.id===t?{...i,replyCount:Math.max((i.replyCount||0)+o,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function Pc0(e){return Q2({queryKey:l0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function Xc0(e){return Q2({queryKey:l0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function fn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).like(o)},onMutate:o=>{wz(t,o,!0),Lz(t,o,!0),xz(t,e,o,!0)},onError(o,n){wz(t,n,!1),Lz(t,n,!1),xz(t,e,n,!1),o.statusCode===403&&$3(),o.statusCode===429&&He()}})}function An0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unlike(o)},onMutate:o=>{wz(t,o,!1),Lz(t,o,!1),xz(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function jc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&He()}})}function Dc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Ic0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}),t.invalidateQueries({queryKey:l0.discoveryFeed})},onError(o){o.statusCode===429&&He()}})}function Fc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Nz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,reposted:o,repostCount:Math.max(o?b.object.repostCount+1:b.object.repostCount-1,0)}}:b)}))})}function Bz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,repostedByMe:o,repostCount:Math.max(o?(i.repostCount||0)+1:(i.repostCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function hn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).repost(o)},onMutate:o=>{Nz(t,o,!0),Bz(t,o,!0),kz(t,e,o,!0)},onError(o,n){Nz(t,n,!1),Bz(t,n,!1),kz(t,e,n,!1),o.statusCode===403&&$3(),o.statusCode===429&&He()}})}function qn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).derepost(o)},onMutate:o=>{Nz(t,o,!1),Bz(t,o,!1),kz(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function mn0(e){return L2({queryKey:l0.user(e),async queryFn(){const t=await c1();return a1(e,t).getUser()}})}function Gd(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).unfollow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!1,followerCount:h.followerCount-1<0?0:h.followerCount-1});const b=l0.accountFollows(a,"followers");n.setQueryData(b,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));return q?{...h,pages:h.pages.map(g=>({...g,accounts:g.accounts.filter(W=>W.name!==q.name)}))}:h});const l=l0.account("index");n.setQueryData(l,h=>h&&{...h,followingCount:h.followingCount-1});const O=l0.accountFollows("me","following");n.getQueryData(O)?n.setQueryData(O,h=>h?.pages?{...h,pages:h.pages.map(q=>({...q,accounts:q.accounts.filter(g=>g.handle!==a)}))}:h):n.invalidateQueries({queryKey:O}),GW(n,a,!1),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!1,followerCount:Math.max(0,L.followerCount-1)}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!1,followerCount:Math.max(0,q.followerCount-1)}:q)),ZW(n,e,a,!1),t()},onError:r=>{r.statusCode===429&&He(),o()}})}function Kd(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).follow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!0,followerCount:h.followerCount+1});const b=l0.account("index");n.setQueryData(b,h=>h&&{...h,followingCount:h.followingCount+1});const l=l0.accountFollows(a,"followers"),O=l0.accountFollows("me","following");n.getQueryData(O)?n.setQueryData(O,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account(a==="me"?"index":a));if(!q)return h;const g={id:q.id,name:q.name,handle:q.handle,avatarUrl:q.avatarUrl,blockedByMe:q.blockedByMe,domainBlockedByMe:q.domainBlockedByMe,isFollowing:!0};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}):n.invalidateQueries({queryKey:O}),GW(n,a,!0),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!0,followerCount:L.followerCount+1}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!0,followerCount:q.followerCount+1}:q)),n.setQueryData(l,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));if(!q)return h;const g={id:q.url,type:"Person",preferredUsername:"index",name:q.name,url:q.url,handle:`index@${new URL(q.url).hostname}`,icon:{type:"Image",url:q.avatarUrl},isFollowing:!1};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}),ZW(n,e,a,!0),t()},onError(r){o(),r.statusCode===429&&He(),r.statusCode===403&&$3()}})}function gn0(e,t){const o=f1(),n=l0.searchResults(t);return{searchQuery:L2({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await c1();return a1(e,i).search(t)}}),updateAccountSearchResult:(i,b)=>{o.setQueryData(n,l=>l&&{...l,accounts:l.accounts.map(u=>u.id===i?{...u,...b}:u)})}}}function dl(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map((a,i)=>i===0?{...a,[o]:[n,...a[o]]}:a)})}function Do(e,t,o,n,r){e.setQueryData(t,a=>a&&{...a,pages:a.pages.map(i=>({...i,[o]:i[o].map(b=>b.id===n?r(b):b)}))})}function Ol(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map(a=>({...a,[o]:a[o].filter(i=>i.id!==n)}))})}function Wn0(e,t){const o=f1();return Y1({async mutationFn({inReplyTo:n,content:r,imageUrl:a,altText:i}){const b=await c1(),l=a1(e,b),u=a?{url:a,altText:i}:void 0;return l.reply(n,r,u)},onMutate:({inReplyTo:n})=>{if(!t)throw new Error("Cannot create reply without actor props");const r=QW();return pA(o,n,1),MA(o,n,1),Cz(o,e,n,1),{id:r}},onSuccess:(n,r)=>{if(n.id===void 0)throw new Error("Activity returned from API has no id");o.invalidateQueries({queryKey:l0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),pA(o,r.inReplyTo,-1),MA(o,r.inReplyTo,-1),Cz(o,e,r.inReplyTo,-1),n.statusCode===403&&$3(),n.statusCode===429&&He(),ve.error("An error occurred while sending your reply.")}})}function vn0(e,t){const o=f1(),n=l0.feed,r=l0.outbox(e),a=l0.profilePosts("index");return Y1({async mutationFn({content:i,imageUrl:b,altText:l}){const u=await c1(),O=a1(e,u),f=b?{url:b,altText:l}:void 0;return O.note(i,f)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const l=On0(i),u=QW(),O=dn0(t,u,l,b);return dl(o,n,"posts",O),dl(o,r,"data",O),dl(o,a,"posts",O),{id:u}},onSuccess:(i,b,l)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=rc(i);Do(o,n,"posts",l?.id??"",()=>u),Do(o,r,"data",l?.id??"",()=>u),Do(o,a,"posts",l?.id??"",()=>u)},onError(i,b,l){console.error(i),Ol(o,n,"posts",l?.id??""),Ol(o,r,"data",l?.id??""),Ol(o,a,"posts",l?.id??""),i.statusCode===429&&He(),ve.error("An error occurred while posting your note.")}})}function Yd(e,t,o){const n=o?.enabled!==!1;return L2({queryKey:l0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await c1();return a1(e,r).getAccount(t)}})}function Hc0(e,t){const o=f1();return Q2({queryKey:l0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await c1(),i=await a1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(l0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function Uc0(e){const t=l0.feed,o=f1();return{feedQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getFeed(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateFeedActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function Vc0(e){const t=l0.inbox,o=f1();return{inboxQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getInbox(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateInboxActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function $c0(e){const t=[...l0.discoveryFeed,e.topic],o=f1();return{discoveryFeedQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getDiscoveryFeed(e.topic,a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateDiscoveryFeedActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function Qc0(e,t){const o=l0.profilePosts(e==="me"?"index":e),n=f1();return{postsByAccountQuery:Q2({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await c1();return a1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(rc),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Do(n,o,"posts",i,l=>({...l,...b}))}}}function Zc0(e){const t=l0.postsLikedByAccount,o=f1();return{postsLikedByAccountQuery:Q2({queryKey:t,enabled:e.enabled,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getPostsLikedByAccount(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updatePostsLikedByAccount:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function Rn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(l0.feed);t.setQueryData(l0.feed,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))});const a=t.getQueryData(l0.inbox);t.setQueryData(l0.inbox,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))}),n&&Cz(t,e,n,-1);const i=l0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,L=>L&&{...L,pages:L.pages.map(C=>({...C,data:C.data.filter(w=>w.object.id!==o)}))});const l=l0.liked(e),u=t.getQueryData(l);let O=!1;t.setQueryData(l,L=>L&&{...L,pages:L.pages.map(C=>(O=C.data.some(w=>w.object.id===o),{...C,data:C.data.filter(w=>w.object.id!==o)}))}),[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount].some(L=>t.getQueryData(L)?.pages.some(w=>w.posts.some(N=>N.id===o&&N.object.liked)))&&t.setQueryData(l0.account(e),L=>L&&{...L,likedCount:Math.max(0,L.likedCount-1)});const h=l0.profilePosts(null),q=t.getQueriesData(h);t.setQueriesData(h,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});let g=[],W;O&&(g=l0.account(e),W=t.getQueryData(g),t.setQueryData(g,L=>L&&{...L,likedCount:L.likedCount-1<0?0:L.likedCount-1}));const v=l0.profilePosts("index"),y=t.getQueryData(v);t.setQueryData(v,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});const x=l0.postsLikedByAccount,k=t.getQueryData(x);return t.setQueryData(x,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},L=>{if(!L)return L;const C=L.children.filter(N=>N.post.id!==o).map(N=>({...N,chain:N.chain.filter(D=>D.id!==o)}));let w=L.post;return L.post.id===n&&(w={...L.post,replyCount:Math.max(0,(L.post.replyCount||0)-1)}),{...L,post:w,children:C}}),{previousFeed:{key:l0.feed,data:r},previousInbox:{key:l0.inbox,data:a},previousOutbox:{key:i,data:b},previousLiked:{key:l,data:u},previousProfilePosts:{key:h,data:q},previousAccount:O?{key:g,data:W}:null,previousPostsByAccount:{key:l0.profilePosts("index"),data:y},previousPostsLikedByAccount:{key:l0.postsLikedByAccount,data:k}}},onError:(o,n,r)=>{r&&(t.setQueryData(r.previousFeed.key,r.previousFeed.data),t.setQueryData(r.previousInbox.key,r.previousInbox.data),t.setQueryData(r.previousOutbox.key,r.previousOutbox.data),t.setQueryData(r.previousLiked.key,r.previousLiked.data),t.setQueriesData(r.previousProfilePosts.key,r.previousProfilePosts.data),r.previousAccount&&t.setQueryData(r.previousAccount.key,r.previousAccount.data),r.previousPostsByAccount&&t.setQueryData(l0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(l0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}))}})}function Gc0(e){return Q2({queryKey:l0.notifications(e),async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function Kc0(e,t){const o=L2({queryKey:l0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const O=await c1(),f=a1(e,O);try{return await f.getReplies(t)}catch(h){if(zn0(h)&&h.statusCode===404)return await f.getPost(t),await f.getReplies(t);throw h}}}),[n,r]=p.useState(null),[a,i]=p.useState(null);p.useEffect(()=>{o.data?r(o.data):o.error&&i(o.error)},[o.data,o.error]);const b=p.useCallback(async()=>{if(!(!n?.ancestors.hasMore||!n?.ancestors.chain[0]))try{const O=await c1(),h=await a1(e,O).getReplies(n.ancestors.chain[0].id);r(q=>q&&{...q,ancestors:{chain:[...h.ancestors.chain,...q.ancestors.chain],hasMore:h.ancestors.hasMore}})}catch(O){i(O instanceof Error?O:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),l=p.useCallback(async()=>{if(n?.next&&t)try{const O=await c1(),h=await a1(e,O).getReplies(t,n.next);r(q=>q&&{...q,children:[...q.children,...h.children],next:h.next})}catch(O){i(O instanceof Error?O:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async O=>{if(n?.children[O]?.hasMore)try{const f=await c1(),h=a1(e,f),q=n.children[O],g=q.chain.length>1?q.chain[q.chain.length-2]:q.post,W=await h.getReplies(g.id),v=W.children[0].chain;r(y=>{if(!y)return y;const x=[...y.children];return x[O]={...q,chain:[...q.chain,...v],hasMore:W.children[0].hasMore},{...y,children:x}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more child replies"))}},[e,n]);return{data:n,isLoading:o.isLoading,error:a,loadMoreAncestors:b,loadMoreChildren:l,loadMoreChildReplies:u,hasMoreAncestors:!!n?.ancestors.hasMore,hasMoreChildren:!!n?.next,hasMoreChildReplies:O=>!!n?.children[O]?.hasMore}}function Yc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:l0.account("index")})}})}async function yn0(e){const t=await c1();return a1("index",t).upload(e)}function KW(e,t=!0){const o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return L2({queryKey:l0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function wn0(e){const t=f1(),o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return Y1({async mutationFn(){return t.setQueryData(l0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function Jc0(e,t){const o=f1(),n=[...l0.exploreProfiles(e),t];return{exploreProfilesQuery:Q2({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await c1(),u=await a1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(O=>{o.setQueryData(l0.account(O.handle),O)}),{accounts:u.accounts,next:u.next}},getNextPageParam(i){return i.next}}),updateExploreProfile:(i,b)=>{o.setQueryData(n,l=>{if(!l)return l;const u=l.pages.map(O=>{const f=O.accounts.map(h=>h.id===i?{...h,...b}:h);return{...O,accounts:f}});return{...l,pages:u}})}}}function Jd(e,t=3){const o=f1(),n=l0.suggestedProfiles(e,t);return{suggestedProfilesQuery:L2({queryKey:n,async queryFn(){const i=await c1(),u=(await a1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(O=>{o.setQueryData(l0.account(O.handle),O)}),u.length>0?u:null},retry:!1,staleTime:3600*1e3}),updateSuggestedProfile:(i,b)=>{o.setQueryData(n,l=>l&&l.map(u=>u.id===i?{...u,...b}:u))}}}function e5(){return{topicsQuery:L2({queryKey:l0.topics(),async queryFn(){const t=await c1();return a1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function t5(e,t){const o=l0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function ea0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).enableBluesky()},onSuccess(){t5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function ta0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).disableBluesky()},onSuccess(){t5(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function oa0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&t5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&He()}})}function Ln0(){return z.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("path",{d:"M3.6349 20.3723C3.80192 20.5393 4.00019 20.6718 4.21841 20.7622C4.43663 20.8525 4.67052 20.8991 4.90672 20.8991C5.14291 20.8991 5.3768 20.8525 5.59502 20.7622C5.81324 20.6718 6.01152 20.5393 6.17853 20.3723C6.34555 20.2052 6.47804 20.007 6.56843 19.7888C6.65882 19.5705 6.70534 19.3366 6.70534 19.1004C6.70534 18.8643 6.65882 18.6304 6.56843 18.4121C6.47804 18.1939 6.34555 17.9956 6.17853 17.8286C5.84123 17.4913 5.38374 17.3018 4.90672 17.3018C4.42969 17.3018 3.9722 17.4913 3.6349 17.8286C3.29759 18.1659 3.10809 18.6234 3.10809 19.1004C3.10809 19.5775 3.29759 20.035 3.6349 20.3723ZM17.7153 6.17951C17.8823 6.34653 18.0806 6.47901 18.2988 6.5694C18.517 6.65979 18.7509 6.70632 18.9871 6.70632C19.2233 6.70632 19.4572 6.65979 19.6754 6.5694C19.8936 6.47901 20.0919 6.34653 20.2589 6.17951C20.4259 6.01249 20.5584 5.81421 20.6488 5.596C20.7392 5.37778 20.7857 5.14389 20.7857 4.90769C20.7857 4.67149 20.7392 4.43761 20.6488 4.21939C20.5584 4.00117 20.4259 3.80289 20.2589 3.63587C19.9216 3.29857 19.4641 3.10907 18.9871 3.10907C18.5101 3.10907 18.0526 3.29857 17.7153 3.63587C17.378 3.97318 17.1885 4.43067 17.1885 4.90769C17.1885 5.38472 17.378 5.8422 17.7153 6.17951ZM7.50655 12.0023C7.50655 13.1946 7.98019 14.3381 8.82329 15.1812C9.66639 16.0243 10.8099 16.4979 12.0022 16.4979C13.1945 16.4979 14.338 16.0243 15.1811 15.1812C16.0242 14.3381 16.4978 13.1946 16.4978 12.0023C16.4978 10.81 16.0242 9.66647 15.1811 8.82337C14.338 7.98027 13.1945 7.50663 12.0022 7.50663C10.8099 7.50663 9.66639 7.98027 8.82329 8.82337C7.98019 9.66647 7.50655 10.81 7.50655 12.0023Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),z.jsx("path",{d:"M8.79319 21.5246C10.5669 22.1224 12.4724 22.2127 14.2947 21.7854C16.1171 21.3581 17.7838 20.4302 19.1069 19.1062C20.4302 17.7827 21.3577 16.116 21.7848 14.2937C22.2119 12.4715 22.1217 10.5662 21.5243 8.79251M2.47582 15.2081C1.87829 13.4342 1.78805 11.5287 2.21527 9.70622C2.64249 7.88378 3.57019 6.21687 4.89383 4.89332C6.21747 3.56977 7.88445 2.64219 9.70692 2.21511C11.5294 1.78802 13.4349 1.87839 15.2088 2.47605",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function yp({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return XI(o||"")!==null}function G0({children:e,...t}){return z.jsx(Xd,{...t,children:e})}function xn0({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:a,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,l=yp({path:e,activeOnSubpath:n}),u=r!==void 0?r:l,{isMobile:O,setOpenMobile:f}=tc(),h=()=>{O&&f(!1)};return z.jsx(jd,{asChild:!0,isActive:u,...i,children:z.jsx("a",{href:t==="_blank"?e:b,rel:t==="_blank"?o??"noopener noreferrer":o,target:t,"aria-current":u?"page":void 0,onClick:h,children:a})})}function kn0({children:e,...t}){return z.jsx("span",{...t,children:e})}G0.Link=xn0;G0.Label=kn0;function Cn0({...e}){const{data:t}=ye(),{data:o}=V3(),n=Tt(o?.settings,"social_web_enabled")??!1,a=_3().data?.site.url,{data:i=0}=KW(t?.slug||"",n),b=yp({path:"network",activeOnSubpath:!0}),l=yp({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!l;return!t||!T10(t)?null:z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[z.jsx(G0,{children:z.jsxs(G0.Link,{to:"analytics",activeOnSubpath:!0,children:[z.jsx(b9,{}),z.jsx(G0.Label,{children:"Analytics"})]})}),n&&z.jsxs(G0,{children:[z.jsxs(G0.Link,{to:"network",isActive:b||l,children:[z.jsx(Ln0,{}),z.jsx(G0.Label,{children:"Network"})]}),u&&z.jsx(Dd,{children:i})]}),z.jsxs(G0,{className:"relative group/viewsite",children:[z.jsxs(G0.Link,{to:"site",children:[z.jsx(KQ,{}),z.jsx(G0.Label,{children:"View site"})]}),z.jsx("a",{href:a,target:"_blank","aria-label":"View site in new tab",rel:"noopener noreferrer",className:"absolute opacity-0 group-hover/viewsite:opacity-100 right-0 top-0 size-8 hover:bg-sidebar-accent flex items-center justify-center rounded-full text-gray-700 hover:text-sidebar-accent-foreground transition-all",children:z.jsx(sd,{size:16})})]})]})})})}function Nn0({isExpanded:e,children:t,id:o}){return z.jsx("div",{id:o,className:`grid transition-all duration-200 ease-out ${e?"grid-rows-[1fr] mb-5":"grid-rows-[0fr] mb-0"}`,children:z.jsx("div",{className:"overflow-hidden",children:t})})}const Bn0="MembersResponseType",_n0=Kr({dataType:Bn0,path:"/members/"});function En0(){const{data:e}=_n0({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const Sn0=()=>Zd({select:e=>e.navigation}),Tn0=()=>{const{mutateAsync:e}=U3();return Y1({mutationFn:async t=>{await e({navigation:t})}})},Pn0=e=>{const{data:t}=Sn0(),{mutateAsync:o}=Tn0();return[t?.expanded[e]??!0,async a=>o({expanded:{[e]:a}})]},Xn0=Wp({name:s2(),route:s2(),color:s2(),icon:s2().optional(),filter:_o0(s2(),s2().nullable())}),jn0=Qd(Xn0);function Dn0(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function In0({route:e="posts"}){const{data:t}=V3(),o=aW(),n=p.useMemo(()=>{const r=Tt(t?.settings,"shared_views")??"[]";try{const a=JSON.parse(r),i=jn0.safeParse(a);return i.success?i.data.filter(b=>b.route===e):(console.error("Failed to validate shared_views setting:",i.error),[])}catch(a){return console.error("Failed to parse shared_views setting:",a),[]}},[t,e]);return n.length===0?null:z.jsx(z.Fragment,{children:n.map(r=>{const a=o.getRouteUrl(e,r.filter),i=o.isRouteActive(e,r.filter);return z.jsx(G0,{children:z.jsxs(G0.Link,{className:"pl-9",to:a,isActive:i,children:[z.jsx(G0.Label,{className:"grow",children:r.name}),z.jsx("span",{className:"size-2 rounded-full shrink-0 mx-0.5",style:{backgroundColor:Dn0(r.color)},"data-color":r.color,"aria-hidden":"true"})]})},a)})})}const Fn0=e=>{const{data:t}=Fd();return t?.config.labs?.[e]??!1};function Hn0({...e}){const{data:t}=ye(),[o,n]=Pn0("posts"),r=En0(),a=aW(),i=Fn0("commentModeration"),b=t&&S10(t),l=t&&E10(t);return z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[z.jsxs(G0,{children:[z.jsx(o1,{"aria-controls":"posts-submenu","aria-expanded":o,"aria-label":"Toggle post views",variant:"ghost",size:"icon",className:"!h-[34px] absolute sidebar:opacity-0 group-hover/menu-item:opacity-100 focus-visible:opacity-100 transition-all left-3 top-0 p-0 h-9 w-auto text-sidebar-accent-foreground hover:text-gray-black hover:bg-transparent",onClick:()=>void n(!o),children:z.jsx(ad,{size:16,className:`transition-all ${o&&"rotate-[90deg]"}`})}),z.jsxs(G0.Link,{to:a.getRouteUrl("posts"),isActive:a.isRouteActive("posts"),children:[z.jsx(c9,{className:"opacity-0 sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0 pointer-events-none transition-all"}),z.jsx(G0.Label,{children:"Posts"})]}),z.jsx("a",{href:"#/editor/post","aria-label":"Create new post",className:"flex items-center justify-center absolute hover:bg-sidebar-accent transition-all rounded-full right-0 top-0 p-0 size-8 text-gray-700 hover:text-sidebar-accent-foreground",children:z.jsx(a9,{size:20,className:"!stroke-[1.5px] mt-px"})})]}),z.jsxs(Nn0,{isExpanded:o,id:"posts-submenu",children:[z.jsx(G0,{children:z.jsx(G0.Link,{className:"pl-9",to:"posts?type=draft",isActive:a.isRouteActive("posts",{type:"draft"}),children:z.jsx(G0.Label,{children:"Drafts"})})}),z.jsx(G0,{children:z.jsx(G0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:a.isRouteActive("posts",{type:"scheduled"}),children:z.jsx(G0.Label,{children:"Scheduled"})})}),z.jsx(G0,{children:z.jsx(G0.Link,{className:"pl-9",to:"posts?type=published",isActive:a.isRouteActive("posts",{type:"published"}),children:z.jsx(G0.Label,{children:"Published"})})}),z.jsx(In0,{})]}),z.jsx(G0,{children:z.jsxs(G0.Link,{to:a.getRouteUrl("pages"),isActive:a.isRouteActive("pages"),children:[z.jsx(CZ,{}),z.jsx(G0.Label,{children:"Pages"})]})}),b&&z.jsx(G0,{children:z.jsxs(G0.Link,{to:"tags",isActive:a.isRouteActive(["tags","tag","tag.new"]),children:[z.jsx(zG,{}),z.jsx(G0.Label,{children:"Tags"})]})}),l&&z.jsxs(G0,{children:[z.jsxs(G0.Link,{to:a.getRouteUrl("members"),isActive:a.isRouteActive(["members","member","member.new"]),children:[z.jsx(l9,{}),z.jsx(G0.Label,{children:"Members"})]}),r!=null&&z.jsx(Dd,{children:r})]}),l&&i&&z.jsx(G0,{children:z.jsxs(G0.Link,{to:"comments",activeOnSubpath:!0,children:[z.jsx(ZZ,{}),z.jsx(G0.Label,{children:"Comments"})]})})]})})})}function Un0({...e}){const{data:t}=ye(),{data:o}=Fd();return!t||!Fa(t)||!o?.config.hostSettings?.billing?.enabled?null:z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsx(nc,{children:z.jsx(G0,{children:z.jsxs(G0.Link,{to:"pro",children:[z.jsx(WZ,{}),z.jsx(G0.Label,{children:"Ghost(Pro)"})]})})})})})}function Vn0({...e}){const{data:t}=ye(),o=t&&_10(t);return z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[o&&z.jsx(G0,{children:z.jsxs(G0.Link,{to:"settings",children:[z.jsx(i9,{}),z.jsx(G0.Label,{children:"Settings"})]})}),z.jsx(G0,{children:z.jsxs(G0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(fZ,{}),z.jsx(G0.Label,{children:"Help"})]})})]})})})}const $n0="/ghost/assets/ghost-pro-logo-B1sXD_MX.png";function Qn0({trialDaysRemaining:e}){return z.jsxs(dd,{variant:"gradient",size:"lg",className:"mx-2 my-5 flex flex-col items-stretch",children:[z.jsx("div",{children:z.jsx("img",{src:$n0,alt:"Ghost Pro",className:"max-h-[33px]"})}),z.jsx("div",{className:"text-base mt-3 font-semibold",children:"Unlock every feature"}),z.jsxs("div",{className:"mt-2 text-gray-700 text-sm mb-4",children:["Choose a plan to access the full power of Ghost right away, you have ",z.jsxs("span",{className:"font-semibold text-black",children:[e," days"]})," free trial remaining."]}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function Zn0(){const{showUpgradeBanner:e,trialDaysRemaining:t}=IW();return z.jsxs(Jg,{className:"px-3 pt-4 justify-between",children:[z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[z.jsx(Cn0,{}),z.jsx(Hn0,{}),z.jsx(Un0,{})]}),z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[e?z.jsx(Qn0,{trialDaysRemaining:t}):z.jsx(ln0,{}),z.jsx(Vn0,{className:"pb-0"})]})]})}function Gn0({...e}){return z.jsxs(Qg,{...e,children:[z.jsx(U10,{className:"px-5 pt-6 pb-0"}),z.jsx(Zn0,{}),z.jsx(bn0,{className:"p-3 gap-0"})]})}const vi=1.5;function fl({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=yp({path:e,activeOnSubpath:t});return z.jsx(o1,{asChild:!0,className:`rounded-full w-full max-w-16 min-w-9 hover:bg-gray-200 ${r?"bg-gray-200":"bg-transparent"}`,...n,variant:"ghost",size:"icon","data-active":r,children:z.jsx("a",{href:e,children:o})})}function Kn0(){const{isMobile:e}=tc();return e?z.jsx("div",{className:"fixed sidebar:hidden bottom-0 left-0 right-0 h-[var(--mobile-navbar-height)] bg-sidebar/80 backdrop-blur-md border-t border-sidebar-border z-50 safe-area-inset-bottom",children:z.jsxs("div",{className:"grid grid-cols-4 items-center w-full justify-items-center max-w-[300px] h-full mx-auto px-5",children:[z.jsxs(fl,{activeOnSubpath:!0,to:"analytics",children:[z.jsx(b9,{strokeWidth:vi}),z.jsx("span",{className:"sr-only",children:"Analytics"})]}),z.jsxs(fl,{activeOnSubpath:!0,to:"posts",children:[z.jsx(c9,{strokeWidth:vi}),z.jsx("span",{className:"sr-only",children:"Posts"})]}),z.jsxs(fl,{activeOnSubpath:!0,to:"members",children:[z.jsx(l9,{strokeWidth:vi}),z.jsx("span",{className:"sr-only",children:"Members"})]}),z.jsxs(Zg,{className:"rounded-full px-8 h-9 hover:bg-transparent",children:[z.jsx(n9,{strokeWidth:vi}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})}):z.jsx(z.Fragment,{})}function Yn0({children:e}){const{data:t}=ye(),o=x10();return t&&Id(t)?z.jsxs("div",{className:"relative h-full bg-background",children:[z.jsx("main",{className:"h-full overflow-auto",children:e}),z.jsx("div",{className:"fixed bottom-3.5 left-3.5 lg:bottom-8 lg:left-8 z-20",children:z.jsx(Mn0,{})})]}):z.jsxs($g,{open:!!t&&o,children:[z.jsx(Gn0,{}),z.jsxs(Gg,{className:"bg-background overflow-y-scroll max-h-[calc(100%-var(--mobile-navbar-height))] sidebar:max-h-full",children:[z.jsx("main",{className:"flex-1",children:e}),z.jsx(Kn0,{})]})]})}function Jn0(){const{data:e}=ye();return y10(),R10(),z.jsx(W10,{children:e?z.jsxs(Yn0,{children:[z.jsx(Nr,{}),z.jsx(Ff,{})]}):z.jsxs(z.Fragment,{children:[z.jsx(Az,{}),z.jsx(Ff,{})]})})}const o5=[],YW=p.createContext(void 0),er0=({children:e})=>{const t=we(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):tr0()});p.useEffect(()=>{const i=or0(t.search);Object.keys(i).length>0&&n(b=>{const l={...b,...i};return localStorage.setItem("featureFlags",JSON.stringify(l)),l})},[t.search]);const a={isEnabled:i=>o[i]??!1,flags:o,allFlags:o5};return z.jsx(YW.Provider,{value:a,children:e})},tr0=()=>o5.reduce((e,t)=>({...e,[t]:!1}),{}),or0=e=>{const t=new URLSearchParams(e),o={};return o5.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},nr0=()=>{const e=p.useContext(YW);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function Q3(){const t=l7().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function Jt(){const e=oW(),t=Q3();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o,n);return}o.startsWith("/")?e(`${t}${o}`,n):e(o,n)},[e,t])}const JW=({className:e,onClick:t})=>{const o=Jt(),{previousPath:n}=Yp();return z.jsx(o1,{className:g0("size-9 rounded-full bg-white/85 px-2 backdrop-blur-md dark:bg-black/85 dark:text-white [&_svg]:size-6 focus-visible:ring-0",e),variant:"ghost",onClick:()=>{if(t){t();return}o(n?-1:"/")},children:z.jsx(JQ,{size:24,strokeWidth:1.25})})},rr0=()=>{const e=we(),t=Pt(av,e.pathname);if(!t)return null;const o=t.map(n=>n.route).filter(n=>n.pageTitle);return o[o.length-1]||t[t.length-1].route};function ev(){const e=l7(),t=e.findIndex(l=>l.handle==="activitypub-basepath");if(t===-1)return"";const o=e[t+1];if(!o)return"";const r=e[t].pathname,a=o.pathname;let i=a.startsWith(r)?a.slice(r.length):a;return i=i.replace(/^\//,""),i.split("/")[0]}const cr0=({title:e,backIcon:t})=>t?z.jsx(JW,{className:"-ml-2"}):z.jsx(eW,{className:"max-md:text-[2.4rem]",children:e}),bA=({onToggleMobileSidebar:e})=>z.jsx(o1,{className:"px:0 mr-[-9px] w-[34px] rounded-full bg-white/85 backdrop-blur-md lg:hidden dark:bg-black/85 dark:text-white",variant:"ghost",onClick:e,children:z.jsx(HZ,{className:"!size-5"})}),ar0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=Yp(),n=ev(),r=g10(),a=rr0();let i=!1;n==="profile"&&(i=!0),n==="notes"&&o&&(i=!0);const b=o&&r||a?.showBackButton===!0;return z.jsx(z.Fragment,{children:i?z.jsxs("div",{className:"sticky left-0 top-8 z-50 inline-block max-lg:flex max-lg:items-center max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4",children:[z.jsx("div",{children:b&&z.jsx(JW,{className:"ml-6 max-md:ml-[10px]"})}),!b&&z.jsx(bA,{onToggleMobileSidebar:e})]}):z.jsx("div",{className:"sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-black",children:z.jsxs("div",{className:`relative flex h-[102px] items-center justify-between gap-5 px-[min(4vw,32px)] max-md:h-[68px] ${t?'before:absolute before:inset-x-[min(4vw,32px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] before:dark:border-gray-950':""}`,children:[z.jsx(cr0,{backIcon:b,title:a?.pageTitle||""}),z.jsx(bA,{onToggleMobileSidebar:e})]})})})};function Po(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}let Ii=null;const lA=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=b0.useReducer(l=>l+1,0),i=Ii===o&&!n,b=l=>{i?(t(l),setTimeout(()=>{Ii=null,r()},0)):(Ii=o,r(),e(l))};return z.jsx(o1,{className:"absolute -right-1.5 bottom-px z-10 flex size-4 items-center justify-center rounded-full p-0 outline outline-2 outline-white transition-transform hover:scale-105 active:scale-100 dark:outline-black",title:i?"Unfollow":"Follow",onClick:b,children:i?z.jsx(o9,{className:"-mb-px !size-3 !stroke-[2.4]"}):z.jsx(a9,{className:"!size-[14px] !stroke-2"})})},Xo=({author:e,size:t,isLoading:o=!1,disabled:n=!1,className:r="",showFollowButton:a=!1})=>{let i=20,b=`shrink-0 items-center justify-center rounded-full relative z-10 flex bg-black/5 dark:bg-gray-900 ${t==="lg"||n?"":"cursor-pointer"} ${r}`,l="z-10 object-cover rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10";const[u,O]=p.useState(e?.icon?.url),f=Jt(),h=Kd("index",()=>{ve.success(`Followed ${e?.name}`)},()=>{ve.error("Failed to follow")}),q=Gd("index",()=>{ve.info(`Unfollowed ${e?.name}`)},()=>{ve.error("Failed to unfollow")});switch(p.useEffect(()=>{O(e?.icon?.url)},[e?.icon?.url]),t){case"2xs":i=10,b=Z1("size-4",b),l=Z1("size-4",l);break;case"xs":i=12,b=Z1("size-6",b),l=Z1("size-6",l);break;case"notification":i=16,b=Z1("size-9",b),l=Z1("size-9",l);break;case"sm":b=Z1("size-10",b),l=Z1("size-10",l);break;case"md":b=Z1("size-[60px]",b),l=Z1("size-[60px]",l);break;case"lg":i=32,b=Z1("size-22",b),l=Z1("size-22",l);break;default:b=Z1("size-10",b),l=Z1("size-10",l);break}if(!e||o)return z.jsx(w1,{className:l,containerClassName:b});const g=e?.handle||Po(e),W=L=>{L.stopPropagation(),f(`/profile/${g}`)},v=L=>{L.stopPropagation(),h.mutate(g)},y=L=>{L.stopPropagation(),q.mutate(g)},k=a||Ii===g;return u?z.jsxs("div",{className:b,onClick:t==="lg"||n?void 0:W,children:[z.jsx("img",{className:l,referrerPolicy:"no-referrer",src:u,onError:()=>O(void 0)}),k&&z.jsx(lA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]}):z.jsxs("div",{className:b,onClick:n?void 0:W,children:[z.jsx(pd,{className:"text-gray-600",size:i,strokeWidth:1.5}),k&&z.jsx(lA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]})},Al=({trigger:e,onCopyLink:t,onDelete:o,allowDelete:n=!1,disabled:r=!1,layout:a,followedByMe:i=!1,authoredByMe:b=!1,onFollow:l=()=>{},onUnfollow:u=()=>{}})=>{const O=q=>{q.stopPropagation(),t()},f=q=>{q.stopPropagation(),o()},h=q=>{q.stopPropagation(),i?u():l()};return z.jsxs(WK,{children:[z.jsxs(lJ,{children:[z.jsx(zJ,{disabled:r,asChild:!0,onClick:q=>q.stopPropagation(),children:e}),z.jsx(Um,{align:`${a==="modal"?"start":"end"}`,alignOffset:a==="modal"?-12:0,className:"p-2",children:z.jsxs("div",{className:"flex w-48 flex-col",children:[(!n||a==="inbox")&&z.jsx(bl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:O,children:[z.jsx(jZ,{}),"Copy link"]})}),!b&&z.jsx(bl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:h,children:[i?z.jsx(hG,{}):z.jsx(mG,{}),i?"Unfollow":"Follow"]})}),n&&z.jsx(vK,{asChild:!0,children:z.jsx(bl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:q=>q.stopPropagation(),children:[z.jsx(M9,{}),"Delete"]})})})]})})]}),z.jsxs(u9,{onClick:q=>q.stopPropagation(),children:[z.jsxs(d9,{children:[z.jsx(f9,{children:"Delete this post?"}),z.jsx(A9,{children:a==="inbox"?"This will remove the post from the Ghost social web, but it will remain on your website.":z.jsx(z.Fragment,{children:"If you delete this post, you won't be able to restore it."})})]}),z.jsxs(O9,{children:[z.jsx(q9,{onClick:q=>q.stopPropagation(),children:"Cancel"}),z.jsx(h9,{className:z3({variant:"destructive"}),onClick:f,children:"Delete"})]})]})]})};function sr0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const l=r5(b);if(!l)return[];if(Array.isArray(l))return l.map((u,O)=>({url:u.url,alt:u.name||`Image-${O}`}));if(l.mediaType?.startsWith("image/")||l.type==="Image")return[{url:l.url,alt:l.name||"Image"}];if(b.image){let u;if(typeof b.image=="string"?u=b.image:u=b.image?.url,u)return[{url:u,alt:"Image"}]}return[]};return{lightboxState:t,openLightbox:b=>{if(!e)return;const l=n(e),u=l.findIndex(O=>O.url===b);u!==-1&&o({images:l,currentIndex:u,isOpen:!0})},closeLightbox:()=>{o(b=>({...b,isOpen:!1}))},navigateToIndex:b=>{o(l=>({...l,currentIndex:b}))}}}const hl=({images:e,currentIndex:t,isOpen:o,onClose:n,onNavigate:r})=>{const a=t===0,i=t===e.length-1,b=p.useCallback(()=>{if(e.length<=1||i)return;const u=(t+1)%e.length;r(u)},[e.length,i,t,r]),l=p.useCallback(()=>{if(e.length<=1||a)return;const u=(t-1+e.length)%e.length;r(u)},[e.length,a,t,r]);return p.useEffect(()=>{const u=O=>{o&&(O.key==="ArrowRight"&&!i?b():O.key==="ArrowLeft"&&!a&&l())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[o,t,e.length,b,l,i,a]),!o||e.length===0?null:z.jsx(q3,{open:o,onOpenChange:u=>{u||n()},children:z.jsxs(Ta,{className:"top-[50%] h-[100vh] max-h-[100vh] w-[100vw] max-w-[100vw] translate-y-[-50%] items-center border-none bg-transparent p-0 shadow-none data-[state=closed]:zoom-out-100 data-[state=open]:zoom-in-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:slide-in-from-top-[50%]",onClick:()=>n(),children:[z.jsx("img",{alt:e[t].alt,className:"mx-auto max-h-[90vh] max-w-[90vw] object-contain",src:e[t].url,onClick:u=>u.stopPropagation()}),e.length>1&&z.jsxs(z.Fragment,{children:[z.jsxs(o1,{className:"absolute left-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70",disabled:a,onClick:u=>{u.stopPropagation(),l()},children:[z.jsx(lZ,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Previous image"})]}),z.jsxs(o1,{className:"absolute right-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70",disabled:i,onClick:u=>{u.stopPropagation(),b()},children:[z.jsx(ad,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Next image"})]})]}),z.jsx(KK,{asChild:!0,children:z.jsxs(o1,{className:"absolute right-5 top-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[z.jsx(bd,{className:"!size-5"}),z.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},zA=()=>{},n5=({className:e,following:t,handle:o,variant:n="default",onFollow:r=zA,onUnfollow:a=zA,"data-testid":i})=>{const[b,l]=p.useState(t),u=Gd("index",()=>{},()=>{l(!0)}),O=Kd("index",()=>{},()=>{l(!1)}),f=async()=>{b?(l(!1),a(),u.mutate(o)):(l(!0),r(),O.mutate(o))};p.useEffect(()=>{l(t)},[t]);const h=b?"Following":"Follow";return n==="link"?z.jsx(o1,{className:Z1("p-0 font-medium",b?"text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white":"text-purple hover:text-black dark:hover:text-white",e),"data-testid":i,variant:"link",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),f()},children:h}):z.jsx(o1,{className:Z1("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),f()},children:h})};function _z(e,t=[]){if(t.length===0)return e.replace(/<br\s*\/?>/gi," ").replace(/<\/p>\s*<p>|<\/div>\s*<div>|<\/h[1-6]>\s*<|<\/li>\s*<li>|<\/a>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();const o=t.map(u=>u.toLowerCase()),n={};let r=0,i=e.replace(/<\/(h[1-6]|p|div|li|blockquote|pre)>/gi,"<br>");for(const u of o){const O=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(O,f=>{const h=`__EXCLUDED_TAG_${r+=1}__`;return n[h]=f,h})}let b=i;o.includes("br")||(b=i.replace(/<br\s*\/?>/gi," "));let l=b.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();for(const[u,O]of Object.entries(n))l=l.replace(u,O);return l}const Fi=e=>{const t=document.createElement("div");t.innerHTML=e;const o=t.getElementsByTagName("a");for(let n=0;n<o.length;n++)(o[n].getAttribute("href")||"").match(/^\s*(javascript|data|vbscript):/i)&&o[n].removeAttribute("href"),o[n].setAttribute("target","_blank"),o[n].setAttribute("rel","noopener noreferrer");return t.innerHTML},uA=e=>"preferredUsername"in e,Eo=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:a=!1})=>{const[i,b]=p.useState(!1),l=Jt();let u=e?.handle;!u&&e&&uA(e)&&(u=Po(e));const O=o||!u&&!e,f=Yd("index",u||"",{enabled:i&&!!u}),h=f.isFetching||f.isLoading,q=f.error,g=f.data?typeof f.data.followerCount=="number"&&typeof f.data.followingCount=="number"&&f.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!g&&!h&&!q&&f.refetch({cancelRefetch:!1})},[f,h,q,g,i,u]),O)return z.jsx(z.Fragment,{children:t});const v=f.data||e,y=v?.handle??u??"",x=v?.name??"",k=v?.avatarUrl??(e&&uA(e)?e.icon?.url:null)??null,L=!!v?.followsMe,C=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,w=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,N=v?.bio?Fi(_z(v.bio,["a"])):void 0,D=()=>{y&&l(`/profile/${y}`)},Y=()=>{y&&l(`/profile/${y}/following`)},V=()=>{y&&l(`/profile/${y}/followers`)};return z.jsxs(j00,{onOpenChange:b,children:[z.jsx(D00,{asChild:!0,children:t}),z.jsx(Ig,{align:r,className:"w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-[0_5px_24px_0px_rgba(0,0,0,0.02),0px_2px_5px_0px_rgba(0,0,0,0.07),0px_0px_1px_0px_rgba(0,0,0,0.25)] outline-none dark:bg-[#101114] dark:shadow-none",side:n,sideOffset:12,onClick:J=>J.stopPropagation(),children:z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex justify-between",children:[z.jsxs(ld,{className:"size-14 cursor-pointer",onClick:D,children:[k&&z.jsx(zd,{alt:x,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:k,onError:J=>{J.target.src="",J.target.style.display="none"}}),z.jsx(ud,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:z.jsx(pd,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!a&&z.jsx(n5,{following:!!v?.followedByMe,handle:y,type:"primary"})]}),z.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:D,children:[z.jsx(tW,{className:"w-full truncate",children:x}),z.jsxs("div",{className:"flex w-full gap-2",children:[z.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:y}),L&&!a&&z.jsx(LK,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]})]})]}),z.jsx("div",{className:"flex gap-3 dark:text-gray-300",children:h?z.jsx(w1,{className:"h-4 w-32"}):!q&&z.jsxs(z.Fragment,{children:[z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:Y,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:wf(C)})," ","Following"]}),z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:V,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:wf(w)})," ","Followers"]})]})}),h?z.jsx(w1,{className:"h-4 w-48"}):!q&&N?z.jsx("div",{dangerouslySetInnerHTML:{__html:N},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a:hover]:underline [&_a]:text-[#00a4eb]"}):null]})})]})},tv=(e={})=>{const[t,o]=p.useState(!1),n=we();return p.useEffect(()=>{const r=a=>{if(a.target instanceof HTMLInputElement||a.target instanceof HTMLTextAreaElement||a.target instanceof HTMLElement&&a.target.isContentEditable||a.target instanceof HTMLSelectElement||a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;const i=document.querySelector('[role="dialog"][data-state="open"]');if(!(i&&!(e.componentRef?.current?.closest('[role="dialog"]')===i)))switch(a.key.toLowerCase()){case"n":i||(a.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():o(!0));break;case"r":e.isReplyAvailable&&e.onOpenReply&&(n.pathname.includes("/notes/")||n.pathname.includes("/reader/"))&&(a.preventDefault(),e.onOpenReply());break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:o}},Ri=({actor:e,object:t,likeCount:o,commentCount:n,repostCount:r,layout:a,disabled:i=!1,buttonClassName:b="",onLikeClick:l,onCommentClick:u,onReplyCountChange:O})=>{const[f,h]=p.useState(t.liked),[q,g]=p.useState(t.reposted),[W,v]=p.useState(!1),y=p.useRef(null);tv({isReplyAvailable:!u&&a!=="reply",onOpenReply:()=>v(!0),componentRef:y}),p.useEffect(()=>{h(t.liked),g(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{N(r)},[r]);const x=fn0("index"),k=An0("index"),L=hn0("index"),C=qn0("index"),[w,N]=p.useState(r),D=async J=>{J.stopPropagation(),f?k.mutate(t.id):x.mutate(t.id,{onError(){h(!1)}}),h(!f),l()},Y=J=>{J.stopPropagation(),u?u():v(!0)},V=`px-2 gap-1.5 font-normal text-md [&_svg]:size-[18px] transition-color ap-action-button text-gray-900 hover:text-gray-900 hover:bg-black/[3%] dark:bg-black dark:hover:bg-gray-950 dark:text-gray-600 ${b}`;return z.jsxs(z.Fragment,{children:[z.jsxs("div",{ref:y,className:`flex ${a!=="inbox"&&"gap-1"}`,children:[z.jsxs(o1,{className:`${V} ${f&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${f?"Undo like":"Like"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),J&&D(J)},children:[z.jsx(_Z,{className:`${f&&"fill-pink-500 text-pink-500"}`}),a!=="inbox"&&z.jsx(Bf,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),z.jsxs(o1,{className:`${V}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:Y,children:[z.jsx(r9,{className:"-mr-px"}),a!=="inbox"&&n>0&&cd(n)]}),z.jsxs(o1,{className:`${V} ${q&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${q?"Undo repost":"Repost"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),q?(C.mutate(t.id),N(w-1)):(L.mutate(t.id,{onError(){g(!1),N(w-1)}}),N(w+1)),g(!q)},children:[z.jsx(s9,{className:`${q&&"text-green-500"}`}),a!=="inbox"&&z.jsx(Bf,{className:w===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:w})]})]}),W&&z.jsx(c5,{open:W,replyTo:{object:t,actor:e},onOpenChange:J=>{v(J)},onReply:()=>{O?.(1),v(!1)},onReplyError:()=>{O?.(-1)}})]})};function ir0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const Lo=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||Po(e)}`)},pr0=e=>{const t=new Date,o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=o(t),r=o(new Date(t.getTime()-1440*60*1e3)),a=o(e);return a.getTime()===n.getTime()?Mr0(e):a.getTime()===r.getTime()?"Yesterday":br0(e)},Mr0=e=>{const o=Math.floor((new Date().getTime()-e.getTime())/1e3);if(o<1)return"Just now";if(o<60)return`${o}s`;const n=Math.floor(o/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},br0=e=>{const t=new Date,o=e.getDate(),n=e.toLocaleString("default",{month:"short"});return e.getFullYear()===t.getFullYear()?`${o} ${n}`:`${o} ${n} ${e.getFullYear()}`};function lr0(e){return new Date(e).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(e).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"})}function yi(e,t=!0){const o=new Date(e?.published??e?.createdAt??new Date),n=lr0(o),r=pr0(o);return t&&!e.url?.includes("/.ghost/activitypub")?z.jsx("a",{className:"whitespace-nowrap text-gray-700 hover:underline",href:e.url,rel:"noreferrer",target:"_blank",title:n,onClick:a=>a.stopPropagation(),children:r}):z.jsx("span",{className:"whitespace-nowrap text-gray-700",children:r})}function r5(e){let t;if(e.image&&(t=e.image),e.type==="Note"&&!t&&(t=e.attachment),!t)return null;if(Array.isArray(t)){if(t.length===0)return null;if(t.length===1)return t[0]}return t}function $c(e,t,o,n){const r=r5(e);if(!r)return null;const a=l=>u=>{u.stopPropagation(),t&&t(l)},i=l=>{n&&n(l)},b=(l,u=!1)=>{const O=u?"min-h-[200px]":"";return z.jsx("div",{className:`${l} ${O} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:z.jsx(SZ,{className:"text-gray-400",size:24,strokeWidth:1.5})})};if(Array.isArray(r)){const l=r.length;let u="";return l===1?u="grid-cols-1":l>=2&&l<=4?u="grid-cols-2 auto-rows-[150px]":l>4&&(u="grid-cols-3 auto-rows-[150px]"),z.jsx("div",{className:`attachment-gallery mt-3 grid w-full ${u} gap-2`,children:r.map((O,f)=>{const h=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${l===3&&f===0?"row-span-2":""}`;return o&&o.has(O.url)?b(h,l===1):z.jsx("img",{alt:O.name||`Image-${f}`,className:`${h} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:O.url,onClick:t?a(O.url):void 0,onError:()=>i(O.url)},O.url)})})}switch(r.mediaType){case"image/jpeg":case"image/png":case"image/gif":case"image/webp":return o&&o.has(r.url)?b(`${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,!0):z.jsx("img",{alt:r.name||"Image",className:`cursor-pointer ${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,referrerPolicy:"no-referrer",src:r.url,onClick:t?a(r.url):void 0,onError:()=>i(r.url)});case"video/mp4":case"video/webm":return z.jsx("div",{className:"relative mb-4 mt-3",children:z.jsx("video",{className:"h-[300px] w-full rounded object-cover",src:r.url,controls:!0})});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:r.url,controls:!0})});default:if(e.image||r.type==="Image"){const l=e.type==="Article"?"cursor-pointer aspect-[16/7.55] w-full rounded-t-md object-cover":"cursor-pointer mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10";let u;return e.image?typeof e.image=="string"?u=e.image:u=e.image?.url:u=r.url,o&&o.has(u)?b(l,!0):z.jsx("img",{alt:r.name||"Image",className:l,referrerPolicy:"no-referrer",src:u,onClick:t?a(u):void 0,onError:()=>i(u)})}return null}}function zr0(e,t){const o=r5(e),n="ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative",r=Z1("object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]",n);if(t)return z.jsx(w1,{className:`${r} outline-0`});if(!o)return null;if(Array.isArray(o))return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o[0].url});switch(o.mediaType){case"image/jpeg":case"image/png":case"image/gif":return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o.url});case"video/mp4":case"video/webm":return z.jsxs("div",{className:n,children:[z.jsx("video",{className:"h-[80px] w-full rounded object-cover",src:o.url}),z.jsx("div",{className:"absolute inset-0 rounded bg-gray-900 opacity-50"}),z.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:z.jsx(oG,{color:"white",fill:"white",size:40})})]});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"ml-8 w-[120px]",children:z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:o.url,controls:!0})})});default:return e.image?z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:typeof e.image=="string"?e.image:e.image?.url}):null}}const dA=()=>{},OA=z.jsx(s9,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),ur0=({actor:e,allowDelete:t=!1,object:o,parentId:n=void 0,layout:r,type:a,commentCount:i=0,repostCount:b=0,likeCount:l=0,showHeader:u=!0,last:O,isLoading:f,isPending:h=!1,isCompact:q=!1,isChainContinuation:g=!1,isChainParent:W=!1,onClick:v=dA,onDelete:y=dA,showStats:x=!0})=>{const k=new Date(o?.published??new Date).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(o?.published??new Date).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"}),[,L]=p.useState(!1),[C,w]=p.useState(new Set),N=p.useRef(null),[D,Y]=p.useState(!1),V=Rn0("index"),J=Jt(),t0=Kd("index",()=>{ve.success(`Followed ${X?.name}`)},()=>{ve.error("Failed to follow")}),K=Gd("index",()=>{ve.info(`Unfollowed ${X?.name}`)},()=>{ve.error("Failed to unfollow")});p.useEffect(()=>{const j0=N.current;j0&&Y(j0.scrollHeight>j0.clientHeight)},[o?.content]),p.useEffect(()=>{const j0=N.current;if(!j0)return;const p1=S=>{const r0=S.target.closest("a[data-profile]");if(r0){const A0=r0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(A0||"")&&A0&&(S.preventDefault(),S.stopPropagation(),Lo(A0,J))}};return j0.addEventListener("click",p1),()=>{j0.removeEventListener("click",p1)}},[J,o?.content]);const a0=()=>{},q0=()=>{h||v()},Z=()=>{V.mutate({id:o.id,parentId:n}),y()},z0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),L(!0),ve.success("Link copied"),setTimeout(()=>L(!1),2e3))},U=j0=>{w(p1=>new Set(p1).add(j0))};let X=e;a==="Announce"&&(X=typeof o.attributedTo=="object"?o.attributedTo:e);const G=X?Po(X):null,_=X?.followedByMe||!1,I=a==="Announce"?typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&"authored"in o.attributedTo?o.attributedTo.authored:typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&typeof e=="object"&&e&&o.attributedTo.id===e.id:o.authored,i0=a==="Announce"?o.reposted??!1:o.authored,d0=()=>{G&&t0.mutate(G)},m0=()=>{G&&K.mutate(G)},W0=z.jsx(o1,{className:`relative z-10 size-[34px] rounded-md ${r==="inbox"||r==="modal"?"text-gray-900 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-600":"text-gray-500 hover:text-gray-500"} dark:bg-black dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":"menu-button",variant:"ghost",children:z.jsx(n9,{})}),{lightboxState:s0,openLightbox:e0,closeLightbox:w0,navigateToIndex:x0}=sr0(o);return r==="feed"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative -mx-4 ${h?"pointer-events-none":"cursor-pointer"} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":"feed","data-object-id":o.id,onClick:q0,children:[a==="Announce"&&z.jsxs("div",{className:"z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600",children:[OA,z.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[z.jsx(Eo,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"truncate break-anywhere hover:underline",onClick:j0=>{Lo(e,J,j0)},children:e.name})}),"reposted"]})]}),z.jsxs("div",{className:"border-1 flex flex-col gap-2.5","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(Xo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsx("span",{className:`min-w-0 truncate font-semibold break-anywhere ${q?"text-lg":"text-md"} ${h?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:f?z.jsx(w1,{className:"w-24"}):X.name}),z.jsxs("div",{className:"flex w-full text-md text-gray-700 dark:text-gray-600",children:[z.jsx("span",{className:`truncate ${h?"":"hover-underline"}`,children:f?z.jsx(w1,{className:"w-56"}):Po(X)}),z.jsx("div",{className:`ml-1 before:mr-1 ${!f&&'before:content-["·"]'}`,title:`${k}`,children:f?z.jsx(w1,{className:"w-4"}):yi(o,h===!1&&!o.authored)})]})]})]})}),z.jsx(Al,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"feed",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col",children:[z.jsx("div",{className:"",children:o.type==="Article"?z.jsxs("div",{className:"rounded-md border border-gray-150 transition-colors hover:bg-gray-75 dark:border-gray-950 dark:hover:bg-gray-950",children:[$c(o,q0,C,U),z.jsxs("div",{className:"p-5",children:[z.jsx("div",{className:"mb-1 line-clamp-2 text-pretty text-lg font-semibold leading-tight tracking-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{className:"line-clamp-3 leading-[1.4em] break-anywhere",children:o.preview?.content})]})]}):z.jsxs("div",{className:"relative",children:[z.jsx("div",{className:"ap-note-content line-clamp-[10] text-pretty leading-[1.4285714286] tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:f?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Fi(o.content||"")??""},ref:N,onClick:j0=>{const p1=j0.target;(p1.tagName==="A"||p1.closest("a"))&&j0.stopPropagation()}})}),D&&z.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),$c(o,e0,C,U)]})}),z.jsx("div",{className:"space-between relative z-[30] ml-[-8px] mt-1 flex",children:f?z.jsx(w1,{className:"ml-2 w-18"}):x&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]})]}),z.jsx(hl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="modal"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{"data-object-id":o.id,children:[z.jsxs("div",{className:"group/article relative","data-layout":"modal",onClick:q0,children:[z.jsxs("div",{className:"z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pb-3 pt-4","data-test-activity":!0,children:[u&&z.jsxs(z.Fragment,{children:[z.jsx("div",{className:"relative z-10 pt-[3px]",children:z.jsx(Xo,{author:X,showFollowButton:!I&&!_})}),z.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsxs("div",{className:"flex w-full",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:yi(o,!o.authored)})]}),z.jsx("div",{className:"flex w-full",children:z.jsx("span",{className:"min-w-0 truncate text-gray-700 dark:text-gray-600",children:Po(X)})})]})]}),z.jsx("div",{className:"relative z-10 col-start-1 col-end-3 w-full gap-4",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.name&&z.jsx(v2,{className:"mb-1 leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{dangerouslySetInnerHTML:{__html:Fi(o.content||"")??""},ref:N,className:"ap-note-content-large text-pretty text-[1.6rem] tracking-[-0.011em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),$c(o,e0,C,U),z.jsx("div",{className:"space-between ml-[-8px] mt-3 flex",children:x&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),z.jsx("div",{className:"absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden"})]}),z.jsx("div",{className:"mt-3 h-px bg-gray-200 dark:bg-gray-950"})]}),z.jsx(hl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="reply"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative ${q?"pb-6":g?"pb-5":"py-5"} ${h?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"border-1 flex flex-col gap-2.5 border-b-gray-200","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(Xo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsxs("div",{className:"flex",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:yi(o,h===!1&&!o.authored)})]}),z.jsx("div",{className:"flex",children:z.jsx("span",{className:"truncate text-gray-700",children:Po(X)})})]})]})}),!q&&z.jsx(Al,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"reply",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.type==="Article"&&$c(o,q0,C,U),o.name&&z.jsx(v2,{className:"mt-2.5 text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),o.preview&&o.type==="Article"?z.jsx("div",{className:"mt-1 line-clamp-3 leading-tight",children:o.preview.content}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Fi(o.content||"")??""},ref:N,className:"ap-note-content text-pretty tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),o.type==="Note"&&$c(o,e0,C,U),o.type==="Article"&&z.jsx(o1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!q&&z.jsx("div",{className:"space-between ml-[-8px] mt-2 flex",children:x&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),!O&&z.jsx("div",{className:`absolute left-[19px] ${q?"bottom-[8px] top-[51px]":g?"bottom-[5px] top-[51px]":W?"bottom-[5px] top-[71px]":"bottom-[-7px] top-[71px]"} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),z.jsx(hl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="inbox"?z.jsx(z.Fragment,{children:o&&z.jsxs("div",{className:"group/article relative -mx-4 -my-px flex min-h-[112px] min-w-0 cursor-pointer items-center justify-between rounded-lg p-6 hover:bg-gray-75 dark:hover:bg-gray-950/50","data-layout":"inbox","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"w-full min-w-0",children:[z.jsx("div",{className:"z-10 mb-1.5 flex w-full min-w-0 items-center gap-1.5 text-sm group-hover/article:border-transparent",children:f?z.jsx(w1,{className:"w-24"}):z.jsxs(z.Fragment,{children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex items-center gap-1",children:[z.jsx(Xo,{author:X,size:"2xs"}),z.jsx("span",{className:"min-w-0 font-semibold text-gray-900 break-anywhere hover:underline dark:text-gray-600","data-test-activity-heading":!0,onClick:j0=>{Lo(X,J,j0)},children:X.name})]})}),a==="Announce"&&z.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[OA,z.jsx(Eo,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"line-clamp-1 hover:underline",onClick:j0=>{Lo(e,J,j0)},children:e.name})})," reposted"]}),z.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${k}`,children:yi(o,!o.authored)})]})}),z.jsxs("div",{className:"flex",children:[z.jsxs("div",{className:"flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1",children:[z.jsx(v2,{className:"line-clamp-2 w-full max-w-[600px] text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:f?z.jsx(w1,{className:"w-full max-w-96"}):o.name?o.name:z.jsx("span",{dangerouslySetInnerHTML:{__html:_z(o.content||"")}})}),z.jsx("div",{className:"ap-note-content line-clamp-2 w-full max-w-[600px] text-pretty text-base leading-normal text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:f?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:_z(o.preview?.content??o.content??"")}})}),z.jsx("span",{className:"mt-1 shrink-0 whitespace-nowrap text-sm leading-none text-gray-600",children:f?z.jsx(w1,{className:"w-16"}):o.content&&`${ir0(o.content)}`})]}),z.jsxs("div",{className:"invisible absolute right-3 top-8 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black",children:[x&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0}),z.jsx(Al,{allowDelete:t,authoredByMe:I,followedByMe:_,layout:"inbox",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]})]})]}),zr0(o,f)]})}):z.jsx(z.Fragment,{})},fA=5*1024*1024,AA="Image must be less than 5MB in size.",na0=async e=>{try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);const o=await t.blob();return new Promise((n,r)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=r,a.readAsDataURL(o)})}catch{return e}},ra0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),ca0="Image must be square.",c5=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...a})=>{const{data:i}=mn0("index"),b=vn0("index",i),l=Wn0("index",i),{data:u,isLoading:O}=Yd("index","me"),[f,h]=p.useState(!1),q=p.useRef(null),g=p.useRef(null),[W,v]=p.useState(null),[y,x]=p.useState(!1),k=p.useRef(null),[L,C]=p.useState(""),[w,N]=p.useState(null),[D,Y]=p.useState(""),[V,J]=p.useState(!1),[t0,K]=p.useState(!1),[a0,q0]=p.useState(!1),Z=Jt(),z0=500;p.useEffect(()=>{a.open!==void 0&&h(a.open)},[a.open]),p.useEffect(()=>{if(a.open!==void 0?a.open:f){const w0=setTimeout(()=>{q0(!0)},300);return()=>clearTimeout(w0)}else q0(!1)},[f,a.open]);const U=!L.trim()||!i||t0||L.length>z0,X=p.useCallback(async()=>{const e0=L.trim();if(!(!e0||!i))try{K(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:e0,imageUrl:w||void 0,altText:D||void 0}),o?.()):(await b.mutateAsync({content:e0,imageUrl:w||void 0,altText:D||void 0}),Z("/notes")),h(!1),r&&r(!1),ve.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{K(!1)}},[L,i,t,l,b,w,D,o,n,h,Z,r]),G=e0=>{C(e0.target.value)};p.useEffect(()=>{q.current&&(q.current.style.height="auto",q.current.style.height=`${q.current.scrollHeight}px`)},[L]),p.useEffect(()=>{if((a.open!==void 0?a.open:f)&&q.current){const w0=setTimeout(()=>{q.current?.focus()},100);return()=>clearTimeout(w0)}},[f,a.open]),p.useEffect(()=>{if(V&&g.current){const e0=setTimeout(()=>{g.current?.focus()},100);return()=>clearTimeout(e0)}},[V]),p.useEffect(()=>{const e0=x0=>{(x0.metaKey||x0.ctrlKey)&&x0.key==="Enter"&&(x0.preventDefault(),!U&&!y&&X())};if(a.open!==void 0?a.open:f)return document.addEventListener("keydown",e0),()=>document.removeEventListener("keydown",e0)},[f,a.open,U,y,X]);const _=p.useCallback(async e0=>{const w0=e0.clipboardData?.items;if(w0)for(let x0=0;x0<w0.length;x0++){const j0=w0[x0];if(j0.type.indexOf("image")!==-1){e0.preventDefault();const p1=j0.getAsFile();if(p1){if(p1.size>fA){ve.error(AA);return}const S=URL.createObjectURL(p1);v(S),await I(p1)}break}}},[]);p.useEffect(()=>{if(a.open!==void 0?a.open:f)return document.addEventListener("paste",_),()=>document.removeEventListener("paste",_)},[f,a.open,_]);const I=async e0=>{try{x(!0);const w0=await yn0(e0);N(w0)}catch(w0){v(null);let x0="Failed to upload image. Try again.";if(w0&&typeof w0=="object"&&"statusCode"in w0)switch(w0.statusCode){case 413:x0="Image size exceeds limit.";break;case 415:x0="The file type is not supported.";break}ve.error(x0)}finally{x(!1)}},i0=async e0=>{const w0=e0.target.files;if(w0&&w0.length>0){const x0=w0[0];if(x0.size>fA){ve.error(AA),e0.target.value="";return}const j0=URL.createObjectURL(x0);v(j0),await I(x0)}},d0=e0=>{e0.stopPropagation(),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")},m0=e0=>{e0.stopPropagation(),J(!V)},W0=()=>{q.current?.focus()};p.useEffect(()=>()=>{W&&URL.revokeObjectURL(W)},[W]);let s0="What's new?";if(t){const e0=t.object.attributedTo||{};typeof e0=="object"&&"preferredUsername"in e0&&"id"in e0&&(s0=`Reply to ${Po(e0)}...`)}return z.jsxs(q3,{open:a.open!==void 0?a.open:f,onOpenChange:e0=>{e0&&(C(""),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")),h(e0),r&&r(e0)},...a.open!==void 0?{}:a,children:[z.jsx(H9,{asChild:!0,children:e}),z.jsxs(Ta,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:e0=>e0.stopPropagation(),children:[z.jsxs(hd,{className:"hidden",children:[z.jsx(md,{children:t?"Reply":"New note"}),z.jsx(V9,{children:"Post your thoughts to the Social web"})]}),t&&z.jsx(ur0,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,isCompact:!0,layout:"reply",likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:t.object.type==="Article"?"Article":"Note",onClick:()=>{}}),z.jsxs("div",{className:`flex ${W?"":"min-h-36"} cursor-text items-start gap-3`,onClick:W0,children:[z.jsx("div",{className:"sticky top-0",children:z.jsx(Xo,{author:i})}),z.jsx(GP,{asChild:!0,children:z.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[O?z.jsx(w1,{className:"w-10"}):z.jsx("span",{className:"min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere dark:text-white",children:u?.name}),z.jsx(R6,{name:"content",asChild:!0,children:z.jsx(y6,{asChild:!0,children:z.jsx("textarea",{ref:q,autoFocus:!0,className:"ap-textarea w-full resize-none bg-transparent text-[1.5rem] break-anywhere","data-testid":"note-textarea",placeholder:s0,rows:1,value:L,onChange:G,onPaste:_})})}),z.jsx(R6,{name:"image",asChild:!0,children:z.jsx(y6,{asChild:!0,children:z.jsx("input",{ref:k,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:i0})})})]})})]}),W&&z.jsxs("div",{className:"group relative mt-6 flex min-h-[200px] w-full items-center justify-center",children:[z.jsx("img",{alt:"Image attachment preview",className:`max-h-[320px] w-full rounded-sm object-cover outline outline-1 -outline-offset-1 outline-black/10 ${y&&"opacity-10"}`,src:W}),y&&z.jsx("div",{className:"absolute leading-[0]",children:z.jsx(Ap,{size:"md"})}),z.jsx(o1,{className:"absolute right-3 top-3 size-8 bg-black/60 text-white opacity-0 hover:bg-black/80 group-hover:opacity-100",onClick:d0,children:z.jsx(M9,{})}),!y&&z.jsx(o1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${V?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:m0,children:"Alt"})]}),W&&!y&&V&&z.jsx("div",{className:"mt-1",children:z.jsx(k3,{ref:g,className:"w-full border-0 bg-transparent px-0 focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Type alt text for image (optional)",type:"text",value:D,onChange:e0=>Y(e0.target.value)})}),z.jsxs(qd,{className:`${a0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[z.jsx(o1,{className:"mr-auto w-[34px] !min-w-0",variant:"outline",onClick:()=>k.current?.click(),children:z.jsx(PZ,{})}),z.jsxs("div",{className:"flex items-center space-x-3",children:[z.jsxs("div",{className:`text-sm ${L.length>=z0?"text-red-500":L.length>=z0*.9?"text-yellow-600":"text-gray-500"}`,children:[L.length,"/",z0]}),z.jsx(o1,{className:"min-w-16","data-testid":"post-button",disabled:U||y,onClick:X,children:t0?z.jsx(Ap,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function Ez(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function dr0(e,t){const o=Ez(e);return JSON.stringify({...o,...t})}const ov=()=>{const{data:e}=ye(),{mutateAsync:t}=iW(),o=b0.useMemo(()=>e?.accessibility?Ez(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=b0.useCallback(async r=>{if(!e)return;const a=Ez(e.accessibility),i=dr0(e.accessibility,{apOnboarding:{...a.apOnboarding,...r}});await t({...e,accessibility:i})},[e,t]);return{isOnboarded:!!o.welcomeStepsFinished,isExplainerClosed:!!o.exploreExplainerClosed,setOnboarded:r=>n({welcomeStepsFinished:r}),setExplainerClosed:r=>n({exploreExplainerClosed:r})}},nv=()=>z.jsx("div",{className:"h-full pt-14",children:z.jsx(Nr,{})}),Or0=Object.freeze(Object.defineProperty({__proto__:null,default:nv,useOnboardingStatus:ov},Symbol.toStringTag,{value:"Module"})),fr0=()=>{const e=Jt();function t(){e(`/notes/${encodeURIComponent("https://activitypub.ghost.org/.ghost/activitypub/note/6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb")}`)}return z.jsxs("div",{className:"z-20 w-full bg-white dark:bg-black",children:[z.jsxs("div",{className:"flex w-full flex-col gap-0.5 border-t border-gray-200 bg-white px-3 pt-6 dark:border-gray-950 dark:bg-black",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx($Z,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Beta feedback"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Something not working? Let us know"}),z.jsx(o1,{className:"mt-2 dark:bg-gray-925/70 dark:hover:bg-gray-900",variant:"secondary",onClick:t,children:"Send feedback"})]}),z.jsxs("div",{className:"-mb-1 ml-3 flex items-center gap-1.5 pb-2 pt-4 text-xs text-gray-400",children:[z.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://ghost.org/help/social-web/",rel:"noreferrer",target:"_blank",children:"Help"}),"⋅",z.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://activitypub.ghost.org/archive",rel:"noreferrer",target:"_blank",children:"Updates"})]})]})},wp=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const a=b0.Children.toArray(e),i=z.jsx("div",{className:`relative flex w-full max-w-[620px] cursor-pointer flex-col before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:transition-opacity hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950 ${r?"z-10 before:opacity-100":"before:opacity-0"}`,"data-testid":n,onClick:()=>{!t&&o&&o()},children:z.jsxs("div",{className:"relative z-10 flex w-full items-center gap-3 py-3",children:[a[0],a[1],a[2]]})});return t?z.jsx("a",{href:t,rel:"noreferrer",target:"_blank",onClick:b=>{o&&(b.preventDefault(),o())},children:i}):i},Ar0=()=>{const e=Jt(),{suggestedProfilesQuery:t}=Jd("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:a}=Yp(),i="[@media(max-height:740px)]:hidden";return!n&&(!o||o.length===0)?null:z.jsxs("div",{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 ${i}`,children:[z.jsxs("div",{className:"mb-3 flex flex-col gap-0.5",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(lp,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Follow suggestions"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Accounts you might be interested in"})]}),z.jsx("ul",{className:"grow",children:r.map((b,l)=>{const u=b?.id||`loading-${l}`,O=b?.name||"",f=b?.handle||"",h=b?.avatarUrl||"";let q;switch(l){case 0:q="[@media(max-height:740px)]:hidden";break;case 1:q="[@media(max-height:800px)]:hidden";break;case 2:q="[@media(max-height:860px)]:hidden";break}return z.jsx(p.Fragment,{children:z.jsx("li",{className:q,children:z.jsx(Eo,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(wp,{onClick:()=>{!n&&b&&Lo(b,e)},children:[n?z.jsx(w1,{className:"z-10 size-10"}):z.jsx(Xo,{author:{icon:{url:h},name:O,handle:f},showFollowButton:!0}),z.jsxs("div",{className:"flex min-w-0 flex-col",children:[z.jsx("span",{className:"block max-w-[190px] truncate font-semibold text-black dark:text-white",children:n?z.jsx(w1,{className:"w-24"}):O}),z.jsx("span",{className:"block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600",children:n?z.jsx(w1,{className:"w-40"}):f})]})]})})})},u)},u)})}),z.jsx(o1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{a(),e("/explore")},children:"Find more →"})]})},hr0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},i=Jt();return z.jsx(Eo,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(wp,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[z.jsx(Xo,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>n?.(!1)}),z.jsxs("div",{className:"flex grow flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:o?z.jsx(w1,{className:"w-full max-w-64"}):e.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:o?z.jsx(w1,{className:"w-24"}):e.handle})]}),o?z.jsx("div",{className:"inline-flex items-center",children:z.jsx(w1,{className:"w-12"})}):z.jsx(n5,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:a})]},e.id)})})},qr0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=Jd("index",5),{data:n=[],isLoading:r}=t;return!r&&(!n||n.length===0)?null:z.jsx("div",{className:"mb-[-15px] flex flex-col gap-3 pt-2",children:z.jsx("div",{className:"flex flex-col",children:(r?Array(5).fill(null):n||[]).map((a,i)=>z.jsx(b0.Fragment,{children:z.jsx(hr0,{isLoading:r,profile:a||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},a?.id||`loading-${i}`))})})};function mr0(e,t,o,n){var r=this,a=p.useRef(null),i=p.useRef(0),b=p.useRef(0),l=p.useRef(null),u=p.useRef([]),O=p.useRef(),f=p.useRef(),h=p.useRef(e),q=p.useRef(!0);h.current=e;var g=typeof window<"u",W=!t&&t!==0&&g;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(o=o||{}).leading,y=!("trailing"in o)||!!o.trailing,x="maxWait"in o,k="debounceOnServer"in o&&!!o.debounceOnServer,L=x?Math.max(+o.maxWait||0,t):null;p.useEffect(function(){return q.current=!0,function(){q.current=!1}},[]);var C=p.useMemo(function(){var w=function(K){var a0=u.current,q0=O.current;return u.current=O.current=null,i.current=K,b.current=b.current||K,f.current=h.current.apply(q0,a0)},N=function(K,a0){W&&cancelAnimationFrame(l.current),l.current=W?requestAnimationFrame(K):setTimeout(K,a0)},D=function(K){if(!q.current)return!1;var a0=K-a.current;return!a.current||a0>=t||a0<0||x&&K-i.current>=L},Y=function(K){return l.current=null,y&&u.current?w(K):(u.current=O.current=null,f.current)},V=function K(){var a0=Date.now();if(v&&b.current===i.current&&J(),D(a0))return Y(a0);if(q.current){var q0=t-(a0-a.current),Z=x?Math.min(q0,L-(a0-i.current)):q0;N(K,Z)}},J=function(){n&&n({})},t0=function(){if(g||k){var K=Date.now(),a0=D(K);if(u.current=[].slice.call(arguments),O.current=r,a.current=K,a0){if(!l.current&&q.current)return i.current=a.current,N(V,t),v?w(a.current):f.current;if(x)return N(V,t),w(a.current)}return l.current||N(V,t),f.current}};return t0.cancel=function(){var K=l.current;K&&(W?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=O.current=l.current=null,K&&n&&n({})},t0.isPending=function(){return!!l.current},t0.flush=function(){return l.current?Y(Date.now()):f.current},t0},[v,x,t,L,y,W,g,k,n]);return C}function gr0(e,t){return e===t}function Wr0(e,t,o){var n=gr0,r=p.useRef(e),a=p.useState({})[1],i=mr0(p.useCallback(function(l){r.current=l,a({})},[a]),t,o,a),b=p.useRef(e);return n(b.current,e)||(i(e),b.current=e),[r.current,i]}const wi=80,vr0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),a=p.useRef(0),i=Jt(),[b]=Wr0(t,300),l=t.length>=2,{searchQuery:u,updateAccountSearchResult:O}=gn0("index",l?b:""),{data:f,isFetching:h,isFetched:q}=u,{suggestedProfilesQuery:g}=Jd("index",5),{data:W,isLoading:v}=g,y=v||W&&W.length>0,{topicsQuery:x}=e5(),{data:k}=x,L=Yd("index","me"),{data:C}=L,[w,N]=p.useState([]),[D,Y]=p.useState(null),[V,J]=p.useState(0),t0=p.useMemo(()=>{const X=k?.topics||[];if(!l||X.length===0)return[];const G=t.toLowerCase();return X.filter(_=>_.slug==="following"?!1:_.name.toLowerCase().startsWith(G)||_.slug.toLowerCase().startsWith(G))},[t,l,k?.topics]),K=p.useMemo(()=>[...t0.map(X=>({type:"topic",data:X})),...w.map(X=>({type:"account",data:X}))],[t0,w]);p.useEffect(()=>{if(!l){N([]),Y(null);return}q&&(f?.accounts&&f.accounts.length>0?(N(f.accounts),Y("results"),J(0)):(N([]),Y("none"),J(0)))},[f?.accounts,q,l]);const a0=h&&l,q0=t.length<2||!D&&l&&t0.length===0,Z=!q0&&D==="none"&&t0.length===0,z0=!q0&&(w.length>0||t0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const X=r.current[V];if(!X)return;const G=X.closest("[data-radix-scroll-area-viewport]")||X.closest(".overflow-y-auto");if(!G){X.scrollIntoView({block:"nearest"});return}const _=G.getBoundingClientRect(),I=X.getBoundingClientRect();I.top<_.top+wi?G.scrollTo({top:G.scrollTop-(_.top+wi-I.top),behavior:"smooth"}):I.bottom>_.bottom-wi&&G.scrollTo({top:G.scrollTop+(I.bottom-_.bottom+wi),behavior:"smooth"})},[V]);const U=X=>{if(!(!z0||K.length===0)){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const G=Date.now();if(G-a.current<50)return;a.current=G,X.key==="ArrowDown"?J(_=>(_+1)%K.length):J(_=>(_-1+K.length)%K.length)}else if(X.key==="Enter"){const G=K[V];if(!G)return;X.preventDefault(),e?.(!1),G.type==="topic"?i(`/explore/${G.data.slug}`):i(`/profile/${G.data.handle}`)}}};return z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:'sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pb-2 pt-3 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-150 before:content-[""] dark:bg-[#101114] dark:before:border-b-gray-950',children:[z.jsx(id,{className:"text-gray-600",size:18,strokeWidth:1.5}),z.jsx(k3,{ref:n,autoComplete:"off",className:"flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Search by name, handle, or URL...",title:"Search",type:"text",value:t,onChange:X=>o(X.target.value),onKeyDown:U}),a0&&z.jsx(Ap,{className:"!absolute right-0 mr-0.5 shrink-0",size:"sm"})]}),z.jsxs("div",{className:"h-full",children:[Z&&z.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:z.jsxs(U00,{children:[z.jsx(V00,{children:z.jsx(pd,{})}),"No users matching this handle or account URL"]})}),z0&&z.jsx("div",{className:"mt-[-14px] pb-2",children:K.map((X,G)=>{const _=G===V;if(X.type==="topic")return z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(wp,{isSelected:_,onClick:()=>{e?.(!1),i(`/explore/${X.data.slug}`)},children:[z.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900",children:z.jsx(lp,{className:"text-gray-700 dark:text-gray-500",size:18,strokeWidth:1.5})}),z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"font-semibold text-black dark:text-white",children:X.data.name}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Topic"})]})]})},X.data.slug);const I=X.data,i0=I.handle===C?.handle;return z.jsx(Eo,{actor:I,align:"center",isCurrentUser:i0,side:"left",children:z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(wp,{isSelected:_,onClick:()=>{e?.(!1),i(`/profile/${I.handle}`)},children:[z.jsx(Xo,{author:{icon:{url:I.avatarUrl},name:I.name,handle:I.handle}}),z.jsxs("div",{className:"flex flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:I.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:I.handle})]}),I.blockedByMe||I.domainBlockedByMe?z.jsx(o1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):i0?null:z.jsx(n5,{className:"ml-auto",following:I.followedByMe,handle:I.handle,type:"secondary",onFollow:()=>O(I.id,{followedByMe:!0}),onUnfollow:()=>O(I.id,{followedByMe:!1})})]})})},I.id)})}),q0&&y&&z.jsxs(z.Fragment,{children:[z.jsx(v2,{children:"More people to follow"}),z.jsx(qr0,{onOpenChange:e})]})]})]})},Rr0=()=>z.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 text-md font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-925/70 dark:text-gray-700 dark:hover:bg-gray-925 [&_svg]:size-[18px]",children:[z.jsx(id,{size:18,strokeWidth:1.5})," Search the social web"]}),Wn=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const a=we(),{resetStack:i}=Yp(),b=Q3(),l=e&&e.startsWith("/")?`${b}${e}`:e,u=l&&(a.pathname===l||a.pathname.startsWith(`${l}/`)),O=g0("justify-start text-md font-medium text-gray-800 dark:hover:bg-gray-925/70 dark:text-gray-500 h-9 [&_svg]:size-[18px]",u&&"bg-gray-100 dark:bg-gray-925/70 dark:text-white text-black font-semibold"),f=o&&o>0?z.jsx("span",{className:g0("ml-auto bg-purple-500 text-white text-xs font-semibold py-1 px-1.5 rounded-full min-w-[20px] h-5 flex items-center justify-center"),children:cd(o)}):null;return l?z.jsx(o1,{className:O,variant:"ghost",asChild:!0,children:z.jsxs(Ba,{to:l,onClick:()=>{i(),h10(l)},children:[t,f]})}):z.jsxs(o1,{ref:r,className:O,variant:"ghost",onClick:n.onClick,...n,children:[t,f]})});Wn.displayName="SidebarMenuLink";const rv=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=nr0(),[n,r]=p.useState(!1),[a,i]=p.useState(""),{data:b}=ye(),l=we(),u=Q3(),{data:O}=KW(b?.slug||""),f=wn0(b?.slug||""),{topicsQuery:h}=e5(),{data:q,isLoading:g}=h,W=!g&&q&&q.topics.length===0;p.useEffect(()=>{l.pathname===`${u}/notifications`&&O&&O>0&&f.mutate()},[l.pathname,u,O,f]);const v=p.useCallback(()=>{O&&O>0&&f.mutate()},[O,f]);return z.jsx("div",{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-8 transition-transform duration-300 ease-in-out max-lg:fixed max-lg:inset-y-0 max-lg:right-0 max-lg:z-50 max-lg:border-0 max-lg:bg-white max-lg:shadow-xl max-md:bottom-[72px] max-md:min-h-[auto] max-md:overflow-y-scroll dark:border-gray-950 max-lg:dark:bg-black ${e?"max-lg:translate-x-0":"max-lg:translate-x-full"}`,children:z.jsxs("div",{className:"flex grow flex-col justify-between",children:[z.jsxs("div",{className:"isolate flex w-full flex-col items-start gap-6 pl-6 pt-6",children:[z.jsx("div",{className:"flex h-[52px] w-full items-center",children:z.jsxs(q3,{open:n,onOpenChange:r,children:[z.jsx(H9,{className:"mt-0.5 w-full",children:z.jsx(Rr0,{})}),z.jsx(Ta,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:z.jsx(vr0,{query:a,setQuery:i,onOpenChange:r})})]})}),z.jsxs("div",{className:"flex w-full flex-col gap-px",children:[z.jsxs(Wn,{to:"/reader",children:[z.jsx(cZ,{size:18,strokeWidth:1.5}),"Reader"]}),z.jsxs(Wn,{to:"/notes",children:[z.jsx(r9,{size:18,strokeWidth:1.5}),"Notes"]}),z.jsxs(Wn,{count:l.pathname!==`${u}/notifications`?O:void 0,to:"/notifications",onClick:v,children:[z.jsx(nZ,{size:18,strokeWidth:1.5}),"Notifications"]}),W?z.jsx(o1,{className:"inline-flex w-full items-center gap-2 rounded-sm px-3 py-2.5 text-left text-md font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-925/70",variant:"ghost",asChild:!0,children:z.jsxs("a",{href:"https://explore.ghost.org/social-web",rel:"noopener noreferrer",target:"_blank",children:[z.jsx(lp,{size:18,strokeWidth:1.5}),"Explore",z.jsx(sd,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):z.jsxs(Wn,{to:"/explore",children:[z.jsx(lp,{size:18,strokeWidth:1.5}),"Explore"]}),z.jsxs(Wn,{to:"/profile",children:[z.jsx(Md,{size:18,strokeWidth:1.5}),"Profile"]}),z.jsxs(Wn,{to:"/preferences",children:[z.jsx(pG,{size:18,strokeWidth:1.5}),"Preferences"]})]}),z.jsx(c5,{children:z.jsxs(o1,{className:"h-9 rounded-full bg-purple-500 px-3 text-md text-white hover:bg-purple-600 dark:hover:bg-purple-600",children:[z.jsx(wZ,{}),"New note"]})}),z.jsx(Ar0,{}),t.map(y=>o[y]?z.jsxs("div",{className:"flex items-center justify-between gap-1 pl-3 opacity-50",children:[z.jsx("span",{className:"font-mono text-xs",children:y}),z.jsx("span",{className:"text-green-800 inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium",children:"ON"})]},y):z.jsx(z.Fragment,{}))]}),z.jsx("div",{className:"sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-black",children:z.jsx(fr0,{})})]})})};rv.displayName="Sidebar";const yr0=({children:e,...t})=>{const{isOnboarded:o}=ov(),n=Q3(),{data:r,isLoading:a}=ye(),i=p.useRef(null),[b,l]=p.useState(!1),u=ev(),{topicsQuery:O}=e5(),{data:f}=O,h=f&&f.topics.length>0,{isNewNoteModalOpen:q,setIsNewNoteModalOpen:g}=tv(),W=()=>{l(!b)},v=()=>{l(!1)};return a||!r?null:o?z.jsxs("div",{ref:i,className:`h-screen w-full ${o&&"overflow-y-auto"}`,"data-scrollable-container":!0,children:[z.jsx(q10,{containerRef:i}),z.jsx("div",{className:"relative mx-auto flex max-w-page flex-col",...t,children:o?z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:"block grid-cols-[auto_320px] items-start lg:grid",children:[z.jsxs("div",{className:"z-0 min-w-0",children:[z.jsx(ar0,{showBorder:!(u==="reader"&&h)&&u!=="explore",onToggleMobileSidebar:W}),z.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),z.jsx(rv,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&z.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):z.jsx(nv,{})}),z.jsx(c5,{open:q,onOpenChange:g})]}):z.jsx(vr,{to:`${n}/welcome`,replace:!0})},Qc=({children:e})=>z.jsx("div",{className:"flex max-h-12 max-w-12 grow-0 items-center justify-center rounded-full bg-gray-100 p-3 text-gray-700 dark:bg-gray-925/70 [&_svg]:size-8 [&_svg]:stroke-1",children:e}),Zc=({children:e,className:t})=>z.jsx("div",{className:`mx-auto mt-[24vh] flex max-w-[500px] flex-col items-center gap-5 text-center text-gray-700 ${t||""}`,children:e}),cv=({statusCode:e,errorCode:t})=>{const o=z7(),n=oW(),r=a=>{a.preventDefault(),n("/analytics/",{crossApp:!0})};return o?z.jsx(yr0,{children:z.jsxs(Zc,{children:[z.jsx(Qc,{children:z.jsx(aG,{})}),z.jsx(v2,{className:"-mb-4",children:"Oops, page not found!"}),z.jsx("div",{children:"We couldn't find the page you were looking for. It may have been moved, deleted, or never existed in the first place."})]})}):e===429?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(fG,{})}),z.jsx(v2,{className:"-mb-4",children:"Rate limit exceeded"}),z.jsx("div",{children:"You've made too many requests. Please try again in a moment."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===403?t==="ROLE_MISSING"||t==="SITE_MISSING"?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(i9,{})}),z.jsx(v2,{className:"-mb-4",children:"Site not configured correctly"}),z.jsx("div",{children:"This feature can't be used because the site isn't set up correctly. If you manage this site, check your settings or server logs, or contact support."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(tZ,{})}),z.jsx(v2,{className:"-mb-4",children:"Account suspended"}),z.jsx("div",{children:"Your account has been suspended due to policy violations."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===410&&t==="INVALID_VERSION"?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(mZ,{})}),z.jsx(v2,{className:"-mb-4",children:"New version available"}),z.jsx("div",{children:"We've made some updates! Refresh your page to see what's new"}),z.jsx(o1,{asChild:!0,children:z.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Refresh your page"})})]}):z.jsx("div",{className:"admin-x-container-error",children:z.jsxs("div",{className:"admin-x-error max-w-xl",children:[z.jsx("h1",{children:"Loading interrupted"}),z.jsx("p",{children:"They say life is a series of trials and tribulations. This moment right here? It's a tribulation. Our app was supposed to load, and yet here we are. Loadless. Click back to the dashboard to try again."}),z.jsx("a",{className:"cursor-pointer text-green",onClick:r,children:"← Back to the homepage"})]})})},wr0=Object.freeze(Object.defineProperty({__proto__:null,default:cv},Symbol.toStringTag,{value:"Module"})),Lr0="activitypub",av=[{path:Lr0,element:z.jsx(Nr,{}),errorElement:z.jsx(cv,{}),handle:"activitypub-basepath",children:[{index:!0,element:z.jsx(vr,{to:"reader"})},{path:"inbox",element:z.jsx(vr,{to:"../reader",replace:!0})},{path:"feed",element:z.jsx(vr,{to:"../notes",replace:!0})},{path:"reader",lazy:h1(()=>z1(()=>import("./index-Birw80cQ.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),pageTitle:"Reader"},{path:"reader/:postId",lazy:h1(()=>z1(()=>import("./index-Birw80cQ.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),pageTitle:"Reader"},{path:"notes",lazy:h1(()=>z1(()=>import("./feed-B3XQzKZl.js"),__vite__mapDeps([7,8]))),pageTitle:"Notes"},{path:"notes/:postId",lazy:h1(()=>z1(()=>import("./note-BpYwIDK6.js"),__vite__mapDeps([9,2,3,8]))),pageTitle:"Note"},{path:"notifications",lazy:h1(()=>z1(()=>import("./index-DziHC2du.js"),__vite__mapDeps([10,11,12,13]))),pageTitle:"Notifications"},{path:"explore",lazy:h1(()=>z1(()=>import("./index-DWk7hKRR.js"),__vite__mapDeps([14,4,15]))),pageTitle:"Explore"},{path:"explore/:topic",lazy:h1(()=>z1(()=>import("./index-DWk7hKRR.js"),__vite__mapDeps([14,4,15]))),pageTitle:"Explore"},{path:"profile",lazy:h1(()=>z1(()=>import("./index-DgRIbSpg.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/likes",lazy:h1(()=>z1(()=>import("./index-DgRIbSpg.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/following",lazy:h1(()=>z1(()=>import("./index-DgRIbSpg.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/followers",lazy:h1(()=>z1(()=>import("./index-DgRIbSpg.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:h1(()=>z1(()=>import("./index-DgRIbSpg.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"preferences",lazy:h1(()=>z1(()=>import("./index-C7M19LpB.js"),__vite__mapDeps([29,30,26,25,28,18,11]))),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:h1(()=>z1(()=>import("./moderation-FjlsSym6.js"),__vite__mapDeps([31,19,20,21,22,23,11,24,25,8,6,1,17,26,12,27,13,15,3]))),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:h1(()=>z1(()=>import("./bluesky-sharing-qyIGv6Ny.js"),__vite__mapDeps([32,18,11,25]))),showBackButton:!0},{path:"welcome",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>Or0),void 0)),pageTitle:"Welcome",children:[{path:"",element:z.jsx(vr,{to:"1",replace:!0})},{path:"1",lazy:h1(()=>z1(()=>import("./step-1-CUoUOyMm.js"),__vite__mapDeps([33,25])))},{path:"2",lazy:h1(()=>z1(()=>import("./step-2-CpAkPD8D.js"),__vite__mapDeps([34,35,13,27])))},{path:"3",lazy:h1(()=>z1(()=>import("./step-3-Ci6oJDmK.js"),__vite__mapDeps([36,35,13,27,22,6,8])))},{path:"*",element:z.jsx(vr,{to:"1",replace:!0})}]},{path:"*",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>wr0),void 0))}]}],sv=p.createContext(void 0),aa0=()=>{const e=p.useContext(sv);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},xr0=({children:e,value:t})=>{const o=p.useContext(Yz),n=t.externalNavigate??o?.externalNavigate;if(!n)throw new Error("External navigate function is required");const r={externalNavigate:n,fromAnalytics:!1,...o,...t};return z.jsx(sv.Provider,{value:r,children:e})},kr0=[{path:"",errorElement:z.jsx(hp,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([z1(()=>import("./post-analytics-context-geHk7rOj.js").then(o=>o.p),__vite__mapDeps([37,38])),z1(()=>import("./post-analytics-UerFnJse.js"),__vite__mapDeps([39,40,41,38,37]))]);return{element:z.jsx(e,{children:z.jsx(t,{})})}},children:[{path:"",lazy:h1(()=>z1(()=>import("./overview-Y5QYPClr.js"),__vite__mapDeps([42,43,44,23,45,46,47,48,49,41,37,38,50,3,15,51,52,53,21,22,11,24,25,8,6,1,17,26,12,27,13,54,19,20,5,55,56,57,58])))},{path:"web",lazy:h1(()=>z1(()=>import("./web-CUWbpFil.js"),__vite__mapDeps([59,37,38,60,24,51,52,23,53,44,45,21,22,11,25,8,6,1,17,26,12,27,13,15,3,54,47,48,19,20,61,49,41,50,62,5])))},{path:"growth",lazy:h1(()=>z1(()=>import("./growth-njR0GqK2.js").then(e=>e.g),__vite__mapDeps([55,5,23,52,53,44,56,43,49,41,37,38,50,3,15,57,58])))},{path:"newsletter",lazy:h1(()=>z1(()=>import("./newsletter-BNOwZNlE.js"),__vite__mapDeps([63,44,23,64,21,22,11,24,25,8,6,1,17,26,12,27,13,15,3,19,20,43,49,41,37,38,50,45,46,47,48,58])))}]},{path:"tags",children:[{index:!0,lazy:h1(()=>z1(()=>import("./tags-Bl6G5rvf.js"),__vite__mapDeps([65,30,66,40,56,17,5])))},{path:":tagSlug",element:null}]},{path:"comments",lazy:h1(()=>z1(()=>import("./comments-C-lkEDkz.js"),__vite__mapDeps([67,62,24,38,66,40,56,13,5])))},{path:"*",element:z.jsx(hp,{onBackToDashboard:()=>{}})}]}],Cr0={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 3 months",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},Nr0=Object.values(Cr0),Br0=2,sa0={US:"United States",TWN:"Taiwan",TW:"Taiwan","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},ia0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],pa0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",Ma0={PUBLIC:1,FREE:2,PAID:4},iv=p.createContext(void 0),ba0=()=>{const e=p.useContext(iv);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},_r0=({children:e})=>{const t=V3(),o=_3(),n=Fd(),r=n.data?.config,a=!!r?.stats,i=kD({enabled:a}),[b,l]=p.useState(Nr0[Br0].value),[u,O]=p.useState(7),[f,h]=p.useState(null),q=[n,t,o],g=q.map(C=>C.error).find(Boolean),W=a?i.error:null,v=g||W,y=q.some(C=>C.isLoading),x=a?i.isLoading:!1,k=y||x;if(v)throw v;const L={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return z.jsx(iv.Provider,{value:{data:r,site:L,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:k,range:b,setRange:l,audience:u,setAudience:O,settings:t.data?.settings||[],selectedNewsletterId:f,setSelectedNewsletterId:h},children:e})},Er0=[{path:"analytics",children:[{index:!0,lazy:h1(()=>z1(()=>import("./index-DXCu9e7c.js"),__vite__mapDeps([68,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,41,50,54,47,48,70,71,58,57,38])))},{path:"web",lazy:h1(()=>z1(()=>import("./index-BFhECYgc.js"),__vite__mapDeps([72,70,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,61,45,5,64,73,53,62,58,19,20,54,47,48])))},{path:"growth",lazy:h1(()=>z1(()=>import("./index-Cr_YX9yU.js"),__vite__mapDeps([74,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,47,48,54,19,20,70,75,56,73,57,53,58,76,71])))},{path:"newsletters",lazy:h1(()=>z1(()=>import("./index-CIE2_z5J.js"),__vite__mapDeps([77,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,47,48,5,54,19,20,75,56,78,58])))}]}],Sr0=[{path:"/tags/:tagSlug",Component:Az},{element:z.jsx(xr0,{value:{fromAnalytics:!0},children:z.jsx(Nr,{})}),children:kr0[0].children.filter(e=>e.path!=="*")},{element:z.jsx(_r0,{children:z.jsx(Nr,{})}),children:Er0},{path:"network",loader:()=>rI("/activitypub")},{path:"",element:z.jsx(er0,{children:z.jsx(Nr,{})}),children:av},{path:"settings/*",lazy:h1(()=>z1(()=>import("./settings-BJwVfuWG.js").then(e=>e.bs),__vite__mapDeps([79,20,78,38,76])))},{path:"*",Component:Az}],Tr0=["http:","https:","mailto:","tel:"];function Pr0(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return Tr0.includes(t.protocol)?(window.location.href=e,!0):!1}catch{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}else{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}}function Xr0({children:e}){const{data:t}=V3(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Tt(n,"paid_members_enabled")??!1,newslettersEnabled:Tt(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Tt(n,"email_track_opens")??!1,emailTrackClicks:Tt(n,"email_track_clicks")??!1,membersTrackSources:Tt(n,"members_track_sources")??!1,outboundLinkTagging:Tt(n,"outbound_link_tagging")??!1,webAnalytics:Tt(n,"web_analytics_enabled")??!1}}},[t]);return z.jsx(Lx,{appSettings:o,children:e})}const jr0={ghostVersion:"",externalNavigate:e=>{Pr0(e.route)},unsplashConfig:{Authorization:"","Accept-Version":"","Content-Type":"","App-Pragma":"","X-Unsplash-Cache":!0},sentryDSN:null,onUpdate:(e,t)=>{window.EmberBridge?.state.onUpdate(e,t)},onInvalidate:e=>{window.EmberBridge?.state.onInvalidate(e)},onDelete:(e,t)=>{window.EmberBridge?.state.onDelete(e,t)}};ey.createRoot(document.getElementById("root")).render(z.jsx(p.StrictMode,{children:z.jsx(wx,{...jr0,children:z.jsx(m10,{prefix:"/",routes:Sr0,children:z.jsx(Xr0,{children:z.jsx(gK,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:z.jsx(Jn0,{})})})})})}));export{o9 as $,Xo as A,o1 as B,ad as C,q3 as D,Zc as E,ur0 as F,Pc0 as G,v2 as H,Xc0 as I,Ic0 as J,Fc0 as K,yr0 as L,jc0 as M,Dc0 as N,f10 as O,Eo as P,U00 as Q,V00 as R,w1 as S,tZ as T,wp as U,ve as V,ea0 as W,bd as X,ta0 as Y,oa0 as Z,tW as _,Yp as a,Cn as a$,WK as a0,u9 as a1,d9 as a2,f9 as a3,A9 as a4,O9 as a5,q9 as a6,h9 as a7,z3 as a8,V9 as a9,U0 as aA,Ep as aB,z1 as aC,rh as aD,Z1 as aE,Fd as aF,_3 as aG,V3 as aH,kD as aI,JQ as aJ,hc0 as aK,Nr as aL,oW as aM,Oc0 as aN,Hm as aO,A10 as aP,lp as aQ,aa0 as aR,ac0 as aS,ic0 as aT,Vr as aU,xu as aV,Dm as aW,n9 as aX,xd as aY,dc0 as aZ,Fm as a_,qd as aa,jZ as ab,Kr as ac,Dn as ad,vD as ae,sc0 as af,Jr0 as ag,y0 as ah,oc0 as ai,cd as aj,WD as ak,Ac0 as al,sW as am,Yt as an,b9 as ao,Im as ap,Ih as aq,Ko as ar,_e as as,e2 as at,H0 as au,Hh as av,SX as aw,TX as ax,$0 as ay,$t as az,Jt as b,lc0 as b$,eW as b0,dt as b1,Ma0 as b2,ba0 as b3,Fr0 as b4,pd as b5,pJ as b6,Hp as b7,iq as b8,Dh as b9,rc as bA,_Z as bB,Gc0 as bC,nZ as bD,$c as bE,Ri as bF,ld as bG,zd as bH,ud as bI,$00 as bJ,fc0 as bK,Hg as bL,G00 as bM,K00 as bN,Y00 as bO,H00 as bP,tc0 as bQ,Yr0 as bR,Md as bS,cc0 as bT,yf as bU,vr as bV,na0 as bW,s00 as bX,i00 as bY,p00 as bZ,mg as b_,Y0 as ba,re as bb,_x as bc,JX as bd,yu as be,Zr as bf,he as bg,Up as bh,Lu as bi,wa as bj,Fo as bk,ya as bl,Fp as bm,pq as bn,Mq as bo,MZ as bp,en as bq,c5 as br,Jd as bs,lZ as bt,wZ as bu,Uc0 as bv,mn0 as bw,zn0 as bx,cv as by,Kc0 as bz,Qc as c,Vc0 as c$,l9 as c0,zG as c1,we as c2,hA as c3,Sp as c4,j9 as c5,I9 as c6,O3 as c7,f3 as c8,id as c9,Mc0 as cA,bc0 as cB,ec0 as cC,PZ as cD,wf as cE,WZ as cF,Nr0 as cG,vK as cH,bl as cI,LK as cJ,Qc0 as cK,Hc0 as cL,Zc0 as cM,Lp as cN,ia0 as cO,sa0 as cP,c9 as cQ,rc0 as cR,pa0 as cS,Sz as cT,Wr0 as cU,_n0 as cV,hZ as cW,fG as cX,$Z as cY,JW as cZ,ir0 as c_,lJ as ca,zJ as cb,a9 as cc,Um as cd,Ym as ce,nc0 as cf,pc0 as cg,Cr0 as ch,xZ as ci,Vr0 as cj,Lc0 as ck,xc0 as cl,OW as cm,Yc0 as cn,M9 as co,mG as cp,k3 as cq,KK as cr,Wp as cs,fA as ct,AA as cu,ra0 as cv,ca0 as cw,s2 as cx,yn0 as cy,HQ as cz,yi as d,Kr0 as d$,$c0 as d0,Dr0 as d1,VR as d2,Tp as d3,vN as d4,W6 as d5,Iq as d6,kc0 as d7,_c0 as d8,Gb as d9,iW as dA,mc0 as dB,Wc0 as dC,_10 as dD,pW as dE,vc0 as dF,B3 as dG,hh as dH,Ur0 as dI,GP as dJ,R6 as dK,y6 as dL,Vz as dM,qu as dN,Oh as dO,tj as dP,Aq as dQ,hq as dR,qq as dS,Qx as dT,aD as dU,Qr0 as dV,sD as dW,jq as dX,Qp as dY,ca as dZ,ye as d_,Zr0 as da,Gr0 as db,Uz as dc,yc0 as dd,fD as de,Gr as df,ha as dg,Bc0 as dh,V2 as di,P10 as dj,X10 as dk,j10 as dl,Tt as dm,kP as dn,wc0 as dp,I10 as dq,Sc0 as dr,Nc0 as ds,Cc0 as dt,K1 as du,T10 as dv,gc0 as dw,Zl as dx,Fa as dy,qc0 as dz,b0 as e,f1 as e0,dw as e1,Rc0 as e2,C10 as e3,Ec0 as e4,Id as e5,ch as e6,Hr0 as e7,zh as e8,KQ as e9,sZ as ea,cZ as eb,dZ as ec,fZ as ed,mZ as ee,CZ as ef,SZ as eg,IZ as eh,HZ as ei,r9 as ej,ZZ as ek,KZ as el,JZ as em,oG as en,s9 as eo,aG as ep,i9 as eq,pG as er,p9 as es,hG as et,ZQ as eu,Ap as f,Po as g,Lo as h,Tc0 as i,z as j,ov as k,Jc0 as l,Yd as m,n5 as n,Fi as o,e5 as p,H9 as q,p as r,_z as s,Ta as t,FI as u,hd as v,md as w,sd as x,g0 as y,Ba as z};
|
|
622
|
+
`)}q.write("payload.value = newResult;"),q.write("return payload;");const x=q.compile();return(k,L)=>x(h,k,L)};let a;const i=qp,b=!lW.jitless,u=b&&$10.value,O=t.catchall;let f;e._zod.parse=(h,q)=>{f??(f=n.value);const g=h.value;return i(g)?b&&u&&q?.async===!1&&q.jitless!==!0?(a||(a=r(t.shape)),h=a(h,q),O?vW([],g,h,q,f,e):h):o(h,q):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function Zf(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const r=e.filter(a=>!yr(a));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(i=>Zo(i,n,Qo())))}),t)}const C20=n0("$ZodUnion",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),m1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),m1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),m1(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${r.map(a=>Vd(a.source)).join("|")})$`)}});const o=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(r,a)=>{if(o)return n(r,a);let i=!1;const b=[];for(const l of t.options){const u=l._zod.run({value:r.value,issues:[]},a);if(u instanceof Promise)b.push(u),i=!0;else{if(u.issues.length===0)return u;b.push(u)}}return i?Promise.all(b).then(l=>Zf(l,r,e,a)):Zf(b,r,e,a)}}),N20=n0("$ZodIntersection",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value,a=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([l,u])=>Gf(o,l,u)):Gf(o,a,i)}});function mz(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Fr(e)&&Fr(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),r={...e,...t};for(const a of n){const i=mz(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r[a]=i.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const r=e[n],a=t[n],i=mz(r,a);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Gf(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),yr(e))return e;const n=mz(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const B20=n0("$ZodRecord",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Fr(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;const a=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:r[l],issues:[]},n);u instanceof Promise?a.push(u.then(O=>{O.issues.length&&o.issues.push(...wr(l,O.issues)),o.value[l]=O.value})):(u.issues.length&&o.issues.push(...wr(l,u.issues)),o.value[l]=u.value)}let b;for(const l in r)i.has(l)||(b=b??[],b.push(l));b&&b.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:b})}else{o.value={};for(const i of Reflect.ownKeys(r)){if(i==="__proto__")continue;const b=t.keyType._zod.run({value:i,issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(b.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:b.issues.map(u=>Zo(u,n,Qo())),input:i,path:[i],inst:e}),o.value[b.value]=b.value;continue}const l=t.valueType._zod.run({value:r[i],issues:[]},n);l instanceof Promise?a.push(l.then(u=>{u.issues.length&&o.issues.push(...wr(i,u.issues)),o.value[b.value]=u.value})):(l.issues.length&&o.issues.push(...wr(i,l.issues)),o.value[b.value]=l.value)}}return a.length?Promise.all(a).then(()=>o):o}}),_20=n0("$ZodEnum",(e,t)=>{V1.init(e,t);const o=V10(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>Q10.has(typeof r)).map(r=>typeof r=="string"?E3(r):r.toString()).join("|")})$`),e._zod.parse=(r,a)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:o,input:i,inst:e}),r}}),E20=n0("$ZodTransform",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new bW(e.constructor.name);const r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(o.value=i,o));if(r instanceof Promise)throw new Pr;return o.value=r,o}});function Kf(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const S20=n0("$ZodOptional",(e,t)=>{V1.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Vd(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>Kf(a,o.value)):Kf(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),T20=n0("$ZodNullable",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Vd(o.source)}|null)$`):void 0}),m1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),P20=n0("$ZodDefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>Yf(a,t)):Yf(r,t)}});function Yf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const X20=n0("$ZodPrefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),j20=n0("$ZodNonOptional",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>Jf(a,e)):Jf(r,e)}});function Jf(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const D20=n0("$ZodCatch",(e,t)=>{V1.init(e,t),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),m1(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(i=>Zo(i,n,Qo()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(a=>Zo(a,n,Qo()))},input:o.value}),o.issues=[]),o)}}),I20=n0("$ZodPipe",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>hi(i,t.in,n)):hi(a,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(a=>hi(a,t.out,n)):hi(r,t.out,n)}});function hi(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const RW=n0("$ZodCodec",(e,t)=>{V1.init(e,t),m1(e._zod,"values",()=>t.in._zod.values),m1(e._zod,"optin",()=>t.in._zod.optin),m1(e._zod,"optout",()=>t.out._zod.optout),m1(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if((n.direction||"forward")==="forward"){const a=t.in._zod.run(o,n);return a instanceof Promise?a.then(i=>qi(i,t,n)):qi(a,t,n)}else{const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>qi(i,t,n)):qi(a,t,n)}}});function qi(e,t,o){if(e.issues.length)return e.aborted=!0,e;if((o.direction||"forward")==="forward"){const r=t.transform(e.value,e);return r instanceof Promise?r.then(a=>mi(e,a,t.out,o)):mi(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>mi(e,a,t.in,o)):mi(e,r,t.in,o)}}function mi(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const F20=n0("$ZodReadonly",(e,t)=>{V1.init(e,t),m1(e._zod,"propValues",()=>t.innerType._zod.propValues),m1(e._zod,"values",()=>t.innerType._zod.values),m1(e._zod,"optin",()=>t.innerType._zod.optin),m1(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(eA):eA(r)}});function eA(e){return e.value=Object.freeze(e.value),e}const H20=n0("$ZodCustom",(e,t)=>{N2.init(e,t),V1.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then(a=>tA(a,o,n,e));tA(r,o,n,e)}});function tA(e,t,o,n){if(!e){const r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(Oa(r))}}class U20{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const r={...n,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function V20(){return new U20}const gi=V20();function $20(e,t){return new e({type:"string",...D0(t)})}function Q20(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D0(t)})}function oA(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D0(t)})}function Z20(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D0(t)})}function G20(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D0(t)})}function K20(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D0(t)})}function Y20(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D0(t)})}function J20(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D0(t)})}function et0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D0(t)})}function tt0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D0(t)})}function ot0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D0(t)})}function nt0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D0(t)})}function rt0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D0(t)})}function ct0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D0(t)})}function at0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D0(t)})}function st0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D0(t)})}function it0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D0(t)})}function pt0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D0(t)})}function Mt0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D0(t)})}function bt0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D0(t)})}function lt0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D0(t)})}function zt0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D0(t)})}function ut0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D0(t)})}function dt0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D0(t)})}function Ot0(e,t){return new e({type:"string",format:"date",check:"string_format",...D0(t)})}function ft0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D0(t)})}function At0(e,t){return new e({type:"string",format:"duration",check:"string_format",...D0(t)})}function ht0(e,t){return new e({type:"boolean",...D0(t)})}function qt0(e){return new e({type:"unknown"})}function mt0(e,t){return new e({type:"never",...D0(t)})}function gt0(e,t){return new e({type:"date",...D0(t)})}function Wt0(e,t){return new je0({check:"less_than",...D0(t),value:e,inclusive:!0})}function vt0(e,t){return new De0({check:"greater_than",...D0(t),value:e,inclusive:!0})}function yW(e,t){return new Ie0({check:"max_length",...D0(t),maximum:e})}function gp(e,t){return new Fe0({check:"min_length",...D0(t),minimum:e})}function wW(e,t){return new He0({check:"length_equals",...D0(t),length:e})}function Rt0(e,t){return new Ue0({check:"string_format",format:"regex",...D0(t),pattern:e})}function yt0(e){return new Ve0({check:"string_format",format:"lowercase",...D0(e)})}function wt0(e){return new $e0({check:"string_format",format:"uppercase",...D0(e)})}function Lt0(e,t){return new Qe0({check:"string_format",format:"includes",...D0(t),includes:e})}function xt0(e,t){return new Ze0({check:"string_format",format:"starts_with",...D0(t),prefix:e})}function kt0(e,t){return new Ge0({check:"string_format",format:"ends_with",...D0(t),suffix:e})}function Ha(e){return new Ke0({check:"overwrite",tx:e})}function Ct0(e){return Ha(t=>t.normalize(e))}function Nt0(){return Ha(e=>e.trim())}function Bt0(){return Ha(e=>e.toLowerCase())}function _t0(){return Ha(e=>e.toUpperCase())}function Et0(e,t,o){return new e({type:"array",element:t,...D0(o)})}function St0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...D0(o)})}function Tt0(e){const t=Pt0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Oa(n,o.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(Oa(r))}},e(o.value,o)));return t}function Pt0(e,t){const o=new N2({check:"custom",...D0(t)});return o._zod.check=e,o}function Xt0(e,t){const o=D0(t);let n=o.truthy??["true","1","yes","on","y","enabled"],r=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(n=n.map(q=>typeof q=="string"?q.toLowerCase():q),r=r.map(q=>typeof q=="string"?q.toLowerCase():q));const a=new Set(n),i=new Set(r),b=e.Codec??RW,l=e.Boolean??gW,u=e.String??I3,O=new u({type:"string",error:o.error}),f=new l({type:"boolean",error:o.error}),h=new b({type:"pipe",in:O,out:f,transform:((q,g)=>{let W=q;return o.case!=="sensitive"&&(W=W.toLowerCase()),a.has(W)?!0:i.has(W)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...i],input:g.value,inst:h,continue:!1}),{})}),reverseTransform:((q,g)=>q===!0?n[0]||"true":r[0]||"false"),error:o.error});return h}const jt0=n0("ZodISODateTime",(e,t)=>{b20.init(e,t),$1.init(e,t)});function LW(e){return dt0(jt0,e)}const Dt0=n0("ZodISODate",(e,t)=>{l20.init(e,t),$1.init(e,t)});function It0(e){return Ot0(Dt0,e)}const Ft0=n0("ZodISOTime",(e,t)=>{z20.init(e,t),$1.init(e,t)});function Ht0(e){return ft0(Ft0,e)}const Ut0=n0("ZodISODuration",(e,t)=>{u20.init(e,t),$1.init(e,t)});function Vt0(e){return At0(Ut0,e)}const $t0=(e,t)=>{OW.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>re0(e,o)},flatten:{value:o=>ne0(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,qz,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,qz,2)}},isEmpty:{get(){return e.issues.length===0}}})},B2=n0("ZodError",$t0,{Parent:Error}),Qt0=T3(B2),Zt0=P3(B2),Gt0=X3(B2),Kt0=j3(B2),Yt0=se0(B2),Jt0=ie0(B2),eo0=pe0(B2),to0=Me0(B2),oo0=be0(B2),no0=le0(B2),ro0=ze0(B2),co0=ue0(B2),ce=n0("ZodType",(e,t)=>(V1.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone(Qn(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>tn(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>Qt0(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>Gt0(e,o,n),e.parseAsync=async(o,n)=>Zt0(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>Kt0(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>Yt0(e,o,n),e.decode=(o,n)=>Jt0(e,o,n),e.encodeAsync=async(o,n)=>eo0(e,o,n),e.decodeAsync=async(o,n)=>to0(e,o,n),e.safeEncode=(o,n)=>oo0(e,o,n),e.safeDecode=(o,n)=>no0(e,o,n),e.safeEncodeAsync=async(o,n)=>ro0(e,o,n),e.safeDecodeAsync=async(o,n)=>co0(e,o,n),e.refine=(o,n)=>e.check(Go0(o,n)),e.superRefine=o=>e.check(Ko0(o)),e.overwrite=o=>e.check(Ha(o)),e.optional=()=>rA(e),e.nullable=()=>cA(e),e.nullish=()=>rA(cA(e)),e.nonoptional=o=>Fo0(e,o),e.array=()=>Qd(e),e.or=o=>ko0([e,o]),e.and=o=>No0(e,o),e.transform=o=>aA(e,To0(o)),e.default=o=>jo0(e,o),e.prefault=o=>Io0(e,o),e.catch=o=>Uo0(e,o),e.pipe=o=>aA(e,o),e.readonly=()=>Qo0(e),e.describe=o=>{const n=e.clone();return gi.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return gi.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return gi.get(e);const n=e.clone();return gi.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),xW=n0("_ZodString",(e,t)=>{I3.init(e,t),ce.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(Rt0(...n)),e.includes=(...n)=>e.check(Lt0(...n)),e.startsWith=(...n)=>e.check(xt0(...n)),e.endsWith=(...n)=>e.check(kt0(...n)),e.min=(...n)=>e.check(gp(...n)),e.max=(...n)=>e.check(yW(...n)),e.length=(...n)=>e.check(wW(...n)),e.nonempty=(...n)=>e.check(gp(1,...n)),e.lowercase=n=>e.check(yt0(n)),e.uppercase=n=>e.check(wt0(n)),e.trim=()=>e.check(Nt0()),e.normalize=(...n)=>e.check(Ct0(...n)),e.toLowerCase=()=>e.check(Bt0()),e.toUpperCase=()=>e.check(_t0())}),kW=n0("ZodString",(e,t)=>{I3.init(e,t),xW.init(e,t),e.email=o=>e.check(Q20(ao0,o)),e.url=o=>e.check(J20(so0,o)),e.jwt=o=>e.check(ut0(go0,o)),e.emoji=o=>e.check(et0(io0,o)),e.guid=o=>e.check(oA(nA,o)),e.uuid=o=>e.check(Z20(Wi,o)),e.uuidv4=o=>e.check(G20(Wi,o)),e.uuidv6=o=>e.check(K20(Wi,o)),e.uuidv7=o=>e.check(Y20(Wi,o)),e.nanoid=o=>e.check(tt0(po0,o)),e.guid=o=>e.check(oA(nA,o)),e.cuid=o=>e.check(ot0(Mo0,o)),e.cuid2=o=>e.check(nt0(bo0,o)),e.ulid=o=>e.check(rt0(lo0,o)),e.base64=o=>e.check(bt0(ho0,o)),e.base64url=o=>e.check(lt0(qo0,o)),e.xid=o=>e.check(ct0(zo0,o)),e.ksuid=o=>e.check(at0(uo0,o)),e.ipv4=o=>e.check(st0(do0,o)),e.ipv6=o=>e.check(it0(Oo0,o)),e.cidrv4=o=>e.check(pt0(fo0,o)),e.cidrv6=o=>e.check(Mt0(Ao0,o)),e.e164=o=>e.check(zt0(mo0,o)),e.datetime=o=>e.check(LW(o)),e.date=o=>e.check(It0(o)),e.time=o=>e.check(Ht0(o)),e.duration=o=>e.check(Vt0(o))});function s2(e){return $20(kW,e)}const $1=n0("ZodStringFormat",(e,t)=>{I1.init(e,t),xW.init(e,t)}),ao0=n0("ZodEmail",(e,t)=>{o20.init(e,t),$1.init(e,t)}),nA=n0("ZodGUID",(e,t)=>{e20.init(e,t),$1.init(e,t)}),Wi=n0("ZodUUID",(e,t)=>{t20.init(e,t),$1.init(e,t)}),so0=n0("ZodURL",(e,t)=>{n20.init(e,t),$1.init(e,t)}),io0=n0("ZodEmoji",(e,t)=>{r20.init(e,t),$1.init(e,t)}),po0=n0("ZodNanoID",(e,t)=>{c20.init(e,t),$1.init(e,t)}),Mo0=n0("ZodCUID",(e,t)=>{a20.init(e,t),$1.init(e,t)}),bo0=n0("ZodCUID2",(e,t)=>{s20.init(e,t),$1.init(e,t)}),lo0=n0("ZodULID",(e,t)=>{i20.init(e,t),$1.init(e,t)}),zo0=n0("ZodXID",(e,t)=>{p20.init(e,t),$1.init(e,t)}),uo0=n0("ZodKSUID",(e,t)=>{M20.init(e,t),$1.init(e,t)}),do0=n0("ZodIPv4",(e,t)=>{d20.init(e,t),$1.init(e,t)}),Oo0=n0("ZodIPv6",(e,t)=>{O20.init(e,t),$1.init(e,t)}),fo0=n0("ZodCIDRv4",(e,t)=>{f20.init(e,t),$1.init(e,t)}),Ao0=n0("ZodCIDRv6",(e,t)=>{A20.init(e,t),$1.init(e,t)}),ho0=n0("ZodBase64",(e,t)=>{h20.init(e,t),$1.init(e,t)}),qo0=n0("ZodBase64URL",(e,t)=>{m20.init(e,t),$1.init(e,t)}),mo0=n0("ZodE164",(e,t)=>{g20.init(e,t),$1.init(e,t)}),go0=n0("ZodJWT",(e,t)=>{v20.init(e,t),$1.init(e,t)}),CW=n0("ZodBoolean",(e,t)=>{gW.init(e,t),ce.init(e,t)});function gz(e){return ht0(CW,e)}const Wo0=n0("ZodUnknown",(e,t)=>{R20.init(e,t),ce.init(e,t)});function Wz(){return qt0(Wo0)}const vo0=n0("ZodNever",(e,t)=>{y20.init(e,t),ce.init(e,t)});function Ro0(e){return mt0(vo0,e)}const yo0=n0("ZodDate",(e,t)=>{w20.init(e,t),ce.init(e,t),e.min=(n,r)=>e.check(vt0(n,r)),e.max=(n,r)=>e.check(Wt0(n,r));const o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function wo0(e){return gt0(yo0,e)}const Lo0=n0("ZodArray",(e,t)=>{L20.init(e,t),ce.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(gp(o,n)),e.nonempty=o=>e.check(gp(1,o)),e.max=(o,n)=>e.check(yW(o,n)),e.length=(o,n)=>e.check(wW(o,n)),e.unwrap=()=>e.element});function Qd(e,t){return Et0(Lo0,e,t)}const NW=n0("ZodObject",(e,t)=>{k20.init(e,t),ce.init(e,t),m1(e,"shape",()=>t.shape),e.keyof=()=>Eo0(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Wz()}),e.loose=()=>e.clone({...e._zod.def,catchall:Wz()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ro0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>Y10(e,o),e.safeExtend=o=>J10(e,o),e.merge=o=>ee0(e,o),e.pick=o=>G10(e,o),e.omit=o=>K10(e,o),e.partial=(...o)=>te0(BW,e,o[0]),e.required=(...o)=>oe0(_W,e,o[0])});function Wp(e,t){const o={type:"object",shape:e??{},...D0(t)};return new NW(o)}function F3(e,t){return new NW({type:"object",shape:e,catchall:Wz(),...D0(t)})}const xo0=n0("ZodUnion",(e,t)=>{C20.init(e,t),ce.init(e,t),e.options=t.options});function ko0(e,t){return new xo0({type:"union",options:e,...D0(t)})}const Co0=n0("ZodIntersection",(e,t)=>{N20.init(e,t),ce.init(e,t)});function No0(e,t){return new Co0({type:"intersection",left:e,right:t})}const Bo0=n0("ZodRecord",(e,t)=>{B20.init(e,t),ce.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function _o0(e,t,o){return new Bo0({type:"record",keyType:e,valueType:t,...D0(o)})}const vz=n0("ZodEnum",(e,t)=>{_20.init(e,t),ce.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const a={};for(const i of n)if(o.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new vz({...t,checks:[],...D0(r),entries:a})},e.exclude=(n,r)=>{const a={...t.entries};for(const i of n)if(o.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new vz({...t,checks:[],...D0(r),entries:a})}});function Eo0(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new vz({type:"enum",entries:o,...D0(t)})}const So0=n0("ZodTransform",(e,t)=>{E20.init(e,t),ce.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new bW(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Oa(a,o.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(Oa(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(a=>(o.value=a,o)):(o.value=r,o)}});function To0(e){return new So0({type:"transform",transform:e})}const BW=n0("ZodOptional",(e,t)=>{S20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rA(e){return new BW({type:"optional",innerType:e})}const Po0=n0("ZodNullable",(e,t)=>{T20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function cA(e){return new Po0({type:"nullable",innerType:e})}const Xo0=n0("ZodDefault",(e,t)=>{P20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jo0(e,t){return new Xo0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():uW(t)}})}const Do0=n0("ZodPrefault",(e,t)=>{X20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Io0(e,t){return new Do0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():uW(t)}})}const _W=n0("ZodNonOptional",(e,t)=>{j20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fo0(e,t){return new _W({type:"nonoptional",innerType:e,...D0(t)})}const Ho0=n0("ZodCatch",(e,t)=>{D20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Uo0(e,t){return new Ho0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const EW=n0("ZodPipe",(e,t)=>{I20.init(e,t),ce.init(e,t),e.in=t.in,e.out=t.out});function aA(e,t){return new EW({type:"pipe",in:e,out:t})}const SW=n0("ZodCodec",(e,t)=>{EW.init(e,t),RW.init(e,t)});function Vo0(e,t,o){return new SW({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const $o0=n0("ZodReadonly",(e,t)=>{F20.init(e,t),ce.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qo0(e){return new $o0({type:"readonly",innerType:e})}const Zo0=n0("ZodCustom",(e,t)=>{H20.init(e,t),ce.init(e,t)});function Go0(e,t={}){return St0(Zo0,e,t)}function Ko0(e){return Tt0(e)}const Yo0=(...e)=>Xt0({Codec:SW,Boolean:CW,String:kW},...e),TW=Vo0(LW({offset:!0}),wo0(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),Jo0=F3({slug:s2(),title:s2(),custom_excerpt:s2(),url:s2().url(),published_at:TW,featured:Yo0(),feature_image:s2().url().optional(),html:s2().optional()}).transform(e=>({slug:e.slug,title:e.title,customExcerpt:e.custom_excerpt,url:e.url,publishedAt:e.published_at,featured:e.featured,featureImage:e.feature_image,html:e.html})),en0=Wp({posts:Qd(Jo0).default([]),changelogUrl:s2().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),H3=()=>L2({queryKey:["changelog"],queryFn:async()=>{const e=await fetch("https://ghost.org/changelog.json");if(!e.ok)throw new Error(`Failed to fetch changelog: ${e.status}`);const t=await e.json();return en0.parse(t)},staleTime:1/0});function sA(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function PW(e,t){const o={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n],a=e[n];r!==void 0&&(sA(r)&&sA(a)?o[n]=PW(a,r):o[n]=r)}return o}const tn0=F3({lastSeenDate:TW.optional().catch(void 0)}),iA={expanded:{posts:!0},menu:{visible:!0}},on0=F3({expanded:Wp({posts:gz()}),menu:Wp({visible:gz()})}),Rz=F3({whatsNew:tn0.optional().catch(void 0),nightShift:gz().optional(),navigation:on0.default(iA).catch(iA)}),XW=e=>["userPreferences",e?.id,e?.accessibility];function Zd(e){const{data:t}=ye();return L2({...e,queryKey:XW(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return Rz.parse(n)},enabled:!!t,staleTime:1/0,cacheTime:0})}const U3=()=>{const e=f1(),{data:t}=ye(),{mutateAsync:o}=iW();return Y1({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(XW(t))??Rz.parse({}),a=PW(r,n),i=Rz.encode(a);await o({...t,accessibility:JSON.stringify(i)})}})};function nn0(){return{lastSeenDate:new Date}}const rn0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],jW=()=>{const{data:e,isSuccess:t}=Zd(),{data:o,isSuccess:n}=H3(),{mutateAsync:r}=U3(),a=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!a&&t&&r({whatsNew:nn0()})},[a,t,r]);const i=o?.entries[0];return L2({queryKey:rn0(e,i),queryFn:()=>{if(!i)return{hasNew:!1,hasNewFeatured:!1};const b=e.whatsNew.lastSeenDate,l=i.publishedAt>b,u=l&&i.featured===!0;return{hasNew:l,hasNewFeatured:u}},enabled:n&&a,staleTime:1/0,cacheTime:0})},DW=()=>{const{data:e}=H3(),{mutateAsync:t}=U3();return Y1({mutationFn:async()=>{const o=e?.entries[0];if(!o)return;const n={lastSeenDate:o.publishedAt};await t({whatsNew:n})}})};function cn0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function an0({entry:e}){return z.jsxs("a",{className:"flex items-start gap-6 p-2 -mx-2 rounded-md hover:bg-muted/80 transition-colors","data-test-entry":!0,href:e.url,rel:"noopener noreferrer",target:"_blank",children:[e.featureImage&&z.jsx("img",{alt:e.title,className:"flex-shrink-0 w-40 h-[110px] object-cover rounded","data-test-entry-image":!0,src:e.featureImage}),z.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[z.jsx("h2",{className:"text-[17px] font-semibold text-foreground mt-1.5","data-test-entry-title":!0,children:e.title}),z.jsx("p",{className:"text-sm text-gray-700 leading-[1.45] line-clamp-2","data-test-entry-excerpt":!0,children:e.customExcerpt}),z.jsx("span",{className:"text-sm text-gray-600","data-test-entry-date":!0,children:cn0(e.publishedAt)})]})]})}function sn0({open:e,onOpenChange:t}){const{data:o}=H3(),{mutate:n}=DW();return p.useEffect(()=>{e&&n()},[e,n]),z.jsx(q3,{open:e,onOpenChange:t,children:z.jsxs(Ta,{className:"max-w-2xl max-h-[85vh] flex flex-col","data-test-modal":"whats-new",role:"dialog","aria-modal":"true","aria-labelledby":"whats-new-modal-title",children:[z.jsx(hd,{children:z.jsx(md,{id:"whats-new-modal-title","data-test-modal-title":!0,className:"text-2xl tracking-tighter",children:"What’s new?"})}),o?z.jsxs(z.Fragment,{children:[z.jsx("section",{className:"flex-1 overflow-y-auto space-y-2 -mx-6 px-6","data-test-entries":!0,children:o.entries.map(r=>z.jsx(an0,{entry:r},r.slug))}),z.jsxs(qd,{className:"flex-row justify-between sm:justify-between gap-3",children:[z.jsx(o1,{asChild:!0,variant:"outline",children:z.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:o.changelogUrl,rel:"noopener noreferrer",target:"_blank",children:"All updates →"})})]})]}):z.jsx("div",{className:"flex-1 flex items-center justify-center py-12",children:z.jsx(Ap,{size:"lg"})})]})})}function IW(){const e=w10(),t=!!e?.subscription.isActiveTrial,o=e?.subscription.trial_end?Math.ceil((new Date(e.subscription.trial_end).getTime()-Date.now())/(1e3*60*60*24)):0;return{showUpgradeBanner:t,trialDaysRemaining:o}}function in0({children:e,...t}){return z.jsx("span",{className:"flex-1",...t,children:e})}const Ie=({children:e,...t})=>z.jsx(Fm,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});Ie.Label=in0;function vp(e){const t=ye();return z.jsxs(ld,{...e,children:[t.data?.profile_image&&z.jsx(zd,{src:t.data?.profile_image}),z.jsx(ud,{className:"text-foreground-muted hover:text-foreground",children:z.jsx(Md,{})})]})}function FW({name:e,email:t,children:o}){return z.jsx("div",{className:"p-3",children:z.jsxs("div",{className:"flex items-center gap-3",children:[o,z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"text-base font-semibold text-foreground",children:e}),z.jsx("span",{className:"text-xs text-foreground-muted -mt-px",children:t})]})]})})}function HW(){const e=ye();return z.jsx(Ie,{children:z.jsxs(Ba,{to:`/settings/staff/${e.data?.slug}`,children:[z.jsx(Md,{}),z.jsx(Ie.Label,{children:"Your profile"})]})})}function UW(){const{data:e}=Zd(),{mutateAsync:t,isLoading:o}=U3(),n=r=>{t({nightShift:r})};return z.jsxs(Ie,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[z.jsx(KZ,{}),z.jsx(Ie.Label,{className:"flex-1",children:"Dark mode"}),z.jsx(Ym,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function VW(){const e=()=>{fetch("/ghost/api/admin/session",{method:"DELETE"}).then(()=>{window.location.href="/ghost"}).catch(t=>{console.error(t)})};return z.jsxs(Ie,{asChild:!1,onSelect:e,children:[z.jsx(IZ,{}),z.jsx(Ie.Label,{children:"Sign out"})]})}function pn0(e){const t=ye(),{data:o}=jW(),{showUpgradeBanner:n}=IW();return z.jsxs(Dm,{...e,children:[z.jsx(Im,{asChild:!0,className:"focus-visible:ring-0",children:z.jsxs(jd,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground","aria-label":"User menu",children:[z.jsxs("div",{className:"relative",children:[z.jsx(vp,{}),o?.hasNew&&z.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:z.jsx(If,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-avatar-badge":!0})})]}),z.jsxs("div",{className:"grid flex-1 text-left text-base leading-tight",children:[z.jsx("span",{className:"truncate font-semibold",children:t.data?.name}),z.jsx("span",{className:"text-muted-foreground truncate text-xs -mt-px",children:t.data?.email})]}),z.jsx(dZ,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),z.jsxs(xd,{align:"end",sideOffset:10,className:`w-full min-w-[240px] sidebar:min-w-[260px] ${n?"shadow-[0_18px_80px_0_rgba(0,0,0,0.07),0_7.52px_33.422px_0_rgba(0,0,0,0.05),0_4.021px_17.869px_0_rgba(0,0,0,0.04),0_2.254px_10.017px_0_rgba(0,0,0,0.04),0_1.197px_5.32px_0_rgba(0,0,0,0.03),0_0.498px_2.214px_0_rgba(0,0,0,0.02)]":""}`,children:[z.jsx(FW,{name:t.data?.name,email:t.data?.email,children:z.jsx(vp,{})}),z.jsx(Cn,{}),z.jsxs(Ie,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{queueMicrotask(()=>e.onOpenWhatsNew?.())},children:[z.jsx(p9,{}),z.jsx(Ie.Label,{children:"What’s new?"}),o?.hasNew&&z.jsx("div",{className:"flex-1 flex justify-end",children:z.jsx(If,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),z.jsx(HW,{}),z.jsx(Cn,{}),z.jsx(Ie,{children:z.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(sZ,{}),z.jsx(Ie.Label,{children:"Resources & guides"})]})}),z.jsx(UW,{}),z.jsx(Cn,{}),z.jsx(VW,{})]})]})}function Mn0(){const e=ye(),o=_3().data?.site.url??"";return z.jsxs(Dm,{children:[z.jsx(Im,{asChild:!0,children:z.jsx("button",{className:"rounded-full shadow-lg hover:shadow-xl transition-shadow focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 p-0.5 flex items-center justify-center border border-border dark:bg-muted bg-background","aria-label":"Open user menu",children:z.jsx(vp,{className:"w-11 h-11"})})}),z.jsxs(xd,{align:"start",side:"top",sideOffset:10,className:"w-full min-w-[240px] mb-2",children:[z.jsx(FW,{name:e.data?.name,email:e.data?.email,children:z.jsx(vp,{})}),z.jsx(Cn,{}),z.jsx(Ie,{children:z.jsxs(Ba,{to:"/",children:[z.jsx(xZ,{}),z.jsx(Ie.Label,{children:"Posts"})]})}),z.jsx(Ie,{children:z.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(sd,{}),z.jsx(Ie.Label,{children:"View site"})]})}),z.jsx(Cn,{}),z.jsx(HW,{}),z.jsx(UW,{}),z.jsx(Cn,{}),z.jsx(VW,{})]})]})}function bn0({...e}){const[t,o]=p.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsx(Yg,{...e,children:z.jsx(oc,{children:z.jsx(nc,{children:z.jsx(Xd,{children:z.jsx(pn0,{onOpenWhatsNew:()=>o(!0)})})})})}),z.jsx(sn0,{open:t,onOpenChange:o})]})}function ln0(){const{data:e}=jW(),{data:t}=H3(),{mutate:o}=DW(),[n,r]=p.useState(!1);if(n||!e?.hasNewFeatured)return null;const a=t?.entries[0];if(!a)return null;const i=()=>{r(!0),o()},b=()=>{o()};return z.jsx(dd,{"data-test-toast":"whats-new",role:"status","aria-label":"What’s new notification","aria-live":"polite",variant:"gradient",dismissible:!0,onDismiss:i,children:z.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"block pr-8",onClick:b,"data-test-toast-link":!0,children:[z.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[z.jsx(p9,{className:"size-4 text-purple-600"}),z.jsx("span",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide",children:"What’s new?"})]}),z.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1","data-test-toast-title":!0,children:a.title}),z.jsx("div",{className:"text-sm text-gray-700","data-test-toast-excerpt":!0,children:a.customExcerpt})]})})}const Rp="SettingsResponseType",V3=Kr({dataType:Rp,path:"/settings/",defaultSearchParams:{group:"site,theme,private,members,portal,newsletter,email,labs,slack,unsplash,views,firstpromoter,editor,comments,analytics,announcement,pintura,donations,security,social_web,explore"}}),kc0=Dn({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:Rp,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==Rp}}}}),Cc0=Dn({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:Rp}}),Nc0=Dn({method:"POST",path:()=>"/slack/test/"});function Bc0(e){const t=["API","CTA","RSS"];return e.replace(/^[a-z]/,o=>o.toUpperCase()).replace(/_/g," ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"ig"),o=>o.toUpperCase())}function _c0(e,t){return t.map(o=>{var n;return(n=e?.find(r=>r.key===o))==null?void 0:n.value})}function Tt(e,t){if(!e)return null;const o=e.find(n=>n.key===t);return o?.value||null}function Ec0(e,t){if(!e)return;const o=e.find(n=>n.key===t);return o?.is_read_only||!1}function Sc0(e,t){const o=a=>e.some(i=>i.key===a&&i.value),n=o("stripe_secret_key")&&o("stripe_publishable_key"),r=o("stripe_connect_secret_key")&&o("stripe_connect_publishable_key");return t.stripeDirect?n:r||n}var yz=(e=>(e[e.Note=0]="Note",e[e.Article=1]="Article",e[e.Tombstone=2]="Tombstone",e))(yz||{});const zn0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class un0{constructor(t,o,n,r=window.fetch.bind(window)){this.apiUrl=t,this.authApiUrl=o,this.handle=n,this.fetch=r}async getToken(){try{return(await(await this.fetch(this.authApiUrl)).json())?.identities?.[0]?.token||null}catch{return null}}async fetchJSON(t,o="GET",n){const r=await this.getToken(),a={method:o,headers:{Authorization:`Bearer ${r}`,Accept:"application/activity+json"}};n&&(a.body=JSON.stringify(n),a.headers["Content-Type"]="application/json");const i=await this.fetch(t,a);if(i.status===204||i.status===202)return null;if(!i.ok){const b={message:"Something went wrong, please try again.",statusCode:i.status};try{const l=await i.json(),u=l.message||l.error;u&&(b.message=u),l.code&&(b.code=l.code)}catch{}throw b}return await i.json()}async blockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/block/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblockDomain(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/domain/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async block(t){const o=new URL(`.ghost/activitypub/v1/actions/block/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async unblock(t){const o=new URL(`.ghost/activitypub/v1/actions/unblock/${encodeURIComponent(t.href)}`,this.apiUrl);return await this.fetchJSON(o,"POST"),!0}async follow(t){const o=new URL(`.ghost/activitypub/v1/actions/follow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async unfollow(t){const o=new URL(`.ghost/activitypub/v1/actions/unfollow/${t}`,this.apiUrl);return await this.fetchJSON(o,"POST")}async like(t){const o=new URL(`.ghost/activitypub/v1/actions/like/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async unlike(t){const o=new URL(`.ghost/activitypub/v1/actions/unlike/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async repost(t){const o=new URL(`.ghost/activitypub/v1/actions/repost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async derepost(t){const o=new URL(`.ghost/activitypub/v1/actions/derepost/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"POST")}async reply(t,o,n){const r=new URL(`.ghost/activitypub/v1/actions/reply/${encodeURIComponent(t)}`,this.apiUrl),a={content:o};return n&&(a.image=n),await this.fetchJSON(r,"POST",a)}async note(t,o){const n=new URL(".ghost/activitypub/v1/actions/note",this.apiUrl),r={content:t};return o&&(r.image=o),(await this.fetchJSON(n,"POST",r)).post}async delete(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);await this.fetchJSON(o,"DELETE")}get userApiUrl(){return new URL(`.ghost/activitypub/users/${this.handle}`,this.apiUrl)}async getUser(){return await this.fetchJSON(this.userApiUrl)}get searchApiUrl(){return new URL(".ghost/activitypub/v1/actions/search",this.apiUrl)}async search(t){const o=this.searchApiUrl;o.searchParams.set("query",t);const n=await this.fetchJSON(o,"GET");return n&&"accounts"in n?n:{accounts:[]}}async getThread(t){const o=new URL(`.ghost/activitypub/v1/thread/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getAccount(t){const o=new URL(`.ghost/activitypub/v1/account/${t}`,this.apiUrl);return await this.fetchJSON(o)}async getAccountFollows(t,o,n){const r=new URL(`.ghost/activitypub/v1/account/${t}/follows/${o}`,this.apiUrl);n&&r.searchParams.set("next",n);const a=await this.fetchJSON(r);if(a===null)return{accounts:[],next:null};if(!("accounts"in a))return{accounts:[],next:null};const i=Array.isArray(a.accounts)?a.accounts:[],b="next"in a&&typeof a.next=="string"?a.next:null;return{accounts:i,next:b}}async getFeed(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/notes",t)}async getInbox(t){return this.getPaginatedPosts(".ghost/activitypub/v1/feed/reader",t)}async getDiscoveryFeed(t,o){const n=`.ghost/activitypub/v1/feed/discover/${t}`;return this.getPaginatedPosts(n,o)}async getExploreAccounts(t,o){const n=`.ghost/activitypub/v1/explore/${t}`;return this.getPaginatedExploreAccounts(n,o)}async getTopics(){const t=new URL(".ghost/activitypub/v1/topics",this.apiUrl),o=await this.fetchJSON(t);return{topics:o&&"topics"in o&&Array.isArray(o.topics)?o.topics:[]}}async getRecommendations(t){const o=new URL(".ghost/activitypub/v1/recommendations",this.apiUrl);t&&o.searchParams.set("limit",t.toString());const n=await this.fetchJSON(o);return{accounts:n&&"accounts"in n&&Array.isArray(n.accounts)?n.accounts:[]}}async getPostsByAccount(t,o){return this.getPaginatedPosts(`.ghost/activitypub/v1/posts/${t}`,o)}async getPostsLikedByAccount(t){return this.getPaginatedPosts(".ghost/activitypub/v1/posts/me/liked",t)}async getPaginatedPosts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("posts"in r))return{posts:[],next:null};const a=Array.isArray(r.posts)?r.posts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{posts:a,next:i}}async getNotifications(t){const o=new URL(".ghost/activitypub/v1/notifications",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{notifications:[],next:null};if(!("notifications"in n))return{notifications:[],next:null};const r=Array.isArray(n.notifications)?n.notifications:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{notifications:r,next:a}}async getNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/count",this.apiUrl),o=await this.fetchJSON(t);return o===null?{count:0}:{count:typeof o.count=="number"?o.count:0}}async resetNotificationsCount(){const t=new URL(".ghost/activitypub/v1/notifications/unread/reset",this.apiUrl);return await this.fetchJSON(t,"PUT"),!0}async getBlockedAccounts(t){const o=new URL(".ghost/activitypub/v1/blocks/accounts",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{accounts:[],next:null};const r="blocked_accounts"in n&&Array.isArray(n.blocked_accounts)?n.blocked_accounts:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{accounts:r,next:a}}async getBlockedDomains(t){const o=new URL(".ghost/activitypub/v1/blocks/domains",this.apiUrl);t&&o.searchParams.set("next",t);const n=await this.fetchJSON(o);if(n===null)return{domains:[],next:null};const r="blocked_domains"in n&&Array.isArray(n.blocked_domains)?n.blocked_domains:[],a="next"in n&&typeof n.next=="string"?n.next:null;return{domains:r,next:a}}async getPaginatedExploreAccounts(t,o){const n=new URL(t,this.apiUrl);o&&n.searchParams.set("next",o);const r=await this.fetchJSON(n);if(r===null||!("accounts"in r))return{accounts:[],next:null};const a=Array.isArray(r.accounts)?r.accounts:[],i="next"in r&&typeof r.next=="string"?r.next:null;return{accounts:a,next:i}}async getPost(t){const o=new URL(`.ghost/activitypub/v1/post/${encodeURIComponent(t)}`,this.apiUrl);return await this.fetchJSON(o)}async getReplies(t,o){const n=new URL(`.ghost/activitypub/v1/replies/${encodeURIComponent(t)}`,this.apiUrl);return o&&n.searchParams.set("next",o),await this.fetchJSON(n)}async updateAccount({name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a}){const i=new URL(".ghost/activitypub/v1/account",this.apiUrl);await this.fetchJSON(i,"PUT",{name:t,username:o,bio:n,avatarUrl:r,bannerImageUrl:a})}async upload(t){const o=new URL(".ghost/activitypub/v1/upload/image",this.apiUrl),n=new FormData;n.append("file",t);const r=await this.getToken(),a=await this.fetch(o,{method:"POST",headers:{Authorization:`Bearer ${r}`},body:n});if(!a.ok)throw{message:"Upload failed",statusCode:a.status};return(await a.json()).fileUrl}async enableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/enable",this.apiUrl);await this.fetchJSON(t,"POST")}async disableBluesky(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/disable",this.apiUrl);await this.fetchJSON(t,"POST")}async confirmBlueskyHandle(){const t=new URL(".ghost/activitypub/v2/actions/bluesky/confirm-handle",this.apiUrl),o=await this.fetchJSON(t,"POST");return o===null||!("handle"in o)||typeof o.handle!="string"?"":String(o.handle)}}const $W="pending-";function QW(){return`${$W}${crypto.randomUUID()}`}function Tc0(e){return e.startsWith($W)}function dn0(e,t,o,n){const r={id:e.url,icon:e.icon,name:e.name,preferredUsername:e.preferredUsername,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};return{id:t,type:"Create",actor:r,object:{type:"Note",name:"",content:o,summary:null,url:"",attributedTo:r,image:n||"",published:new Date().toISOString(),attachment:[],preview:{type:"Note",content:o},id:t,replyCount:0,liked:!1,reposted:!1,repostCount:0,authored:!0,"@context":""},"@context":"",to:""}}function On0(e){return e.replace(/\n/g,"<br />")}function rc(e){let t="";e.repostedBy!==null?t="Announce":t="Create";const o={id:e.author.url,icon:{url:e.author.avatarUrl},name:e.author.name,preferredUsername:e.author.handle.split("@")[1],followedByMe:e.author.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""};let n=null;e.repostedBy!==null&&(n={id:e.repostedBy.url,icon:{url:e.repostedBy.avatarUrl},name:e.repostedBy.name,preferredUsername:e.repostedBy.handle.split("@")[1],followedByMe:e.repostedBy.followedByMe,"@context":"",discoverable:!1,featured:"",followers:"",following:"",image:{url:""},inbox:"",manuallyApprovesFollowers:!1,outbox:"",publicKey:{id:"",owner:"",publicKeyPem:""},published:"",summary:"",type:"Person",url:""});let r="Note";e.type===yz.Article?r="Article":e.type===yz.Tombstone&&(r="Tombstone");const a={type:r,name:e.title,content:e.content,summary:e.summary,url:e.url,attributedTo:o,image:e.featureImageUrl??"",published:e.publishedAt,attachment:e.attachments,preview:{type:"",content:e.excerpt},id:e.id,replyCount:e.replyCount,likeCount:e.likeCount,liked:e.likedByMe,reposted:e.repostedByMe,repostCount:e.repostCount,authored:e.authoredByMe===!0,metadata:e.metadata,"@context":""};return{id:e.id,type:t,actor:n!==null?n:o,object:a,"@context":"",to:""}}let ul;async function c1(){return ul||(ul=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),ul}function a1(e,t){return new un0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function He(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){ve.error(e,{description:t})}function $3(e="Action failed",t="This user has restricted who can interact with their account."){ve.error(e,{description:t})}const l0={outbox:e=>["outbox",e],liked:e=>["liked",e],user:e=>["user",e],profilePosts:e=>e===null?["profile_posts"]:["profile_posts",e],account:e=>["account",e],accountFollows:(e,t)=>["account_follows",e,t],searchResults:e=>["search_results",e],suggestedProfiles:(e,t)=>["suggested_profiles",e,t],exploreProfiles:e=>["explore_profiles",e],replyChain:e=>e===null?["reply_chain"]:["reply_chain",e],feed:["feed"],inbox:["inbox"],discoveryFeed:["discovery_feed"],postsByAccount:["account_posts"],postsLikedByAccount:["account_liked_posts"],notifications:e=>["notifications",e],notificationsCount:e=>["notifications_count",e],blockedAccounts:e=>["blocked_accounts",e],blockedDomains:e=>["blocked_domains",e],topics:()=>["topics"]};function wz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.postsLikedByAccount,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,liked:o,likeCount:Math.max(o?(b.object.likeCount||0)+1:(b.object.likeCount||0)-1,0)}}:b)}))}),r===l0.postsLikedByAccount&&(e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:o?i.posts:i.posts.filter(b=>b.object.id!==t)}))}),o&&e.invalidateQueries({queryKey:l0.postsLikedByAccount}))}function ZW(e,t,o,n){const r=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index")],a=o.split("@")[1];for(const b of r)e.setQueriesData(b,l=>l===void 0?l:{...l,pages:l.pages.map(u=>({...u,posts:u.posts.map(O=>O.type!=="Announce"&&O.actor?.preferredUsername===a?{...O,actor:{...O.actor,followedByMe:n}}:O.type==="Announce"&&typeof O.object.attributedTo=="object"&&O.object.attributedTo&&!Array.isArray(O.object.attributedTo)&&"preferredUsername"in O.object.attributedTo&&O.object.attributedTo.preferredUsername===a?{...O,object:{...O.object,attributedTo:{...O.object.attributedTo,followedByMe:n}}}:O)}))});const i=l0.replyChain(null);e.setQueriesData(i,b=>{if(!b)return b;const l=u=>u.author.handle===o?{...u,author:{...u.author,followedByMe:n}}:u;return{...b,post:l(b.post),ancestors:{...b.ancestors,chain:b.ancestors.chain.map(l)},children:b.children.map(u=>({...u,post:l(u.post),chain:u.chain.map(l)}))}})}function GW(e,t,o){e.getQueryCache().getAll().forEach(a=>{const i=a.queryKey;Array.isArray(i)&&i[0]==="account_follows"&&e.setQueryData(i,b=>b?.pages?{...b,pages:b.pages.map(l=>({...l,accounts:l.accounts.map(u=>u.handle===t?{...u,isFollowing:o}:u)}))}:b)})}function Lz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,likedByMe:o,likeCount:Math.max(o?(i.likeCount||0)+1:(i.likeCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}}),e.setQueryData(l0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function xz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,likedByMe:n,likeCount:Math.max(n?b.post.likeCount+1:b.post.likeCount-1,0)}}:b)})}}catch{return a}})}function kz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,repostedByMe:n,repostCount:Math.max(n?b.post.repostCount+1:b.post.repostCount-1,0)}}:b)})}}catch{return a}})}function Cz(e,t,o,n){const r=l0.notifications(t);e.setQueriesData({queryKey:r},a=>{if(!a||!a.pages)return a;try{return{...a,pages:a.pages.map(i=>!i||!i.notifications?i:{...i,notifications:i.notifications.map(b=>!b||!b.post?b:b.post.id===o?{...b,post:{...b.post,replyCount:Math.max((b.post.replyCount??0)+n,0)}}:b)})}}catch{return a}})}function pA(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount];for(const r of n)e.setQueriesData(r,a=>a&&{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,replyCount:Math.max((b.object.replyCount??0)+o,0)}}:b)}))})}function MA(e,t,o){const n=l0.replyChain(null);e.setQueriesData({queryKey:n,exact:!1},r=>{if(!r)return r;const a=i=>i.id===t?{...i,replyCount:Math.max((i.replyCount||0)+o,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function Pc0(e){return Q2({queryKey:l0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function Xc0(e){return Q2({queryKey:l0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function fn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).like(o)},onMutate:o=>{wz(t,o,!0),Lz(t,o,!0),xz(t,e,o,!0)},onError(o,n){wz(t,n,!1),Lz(t,n,!1),xz(t,e,n,!1),o.statusCode===403&&$3(),o.statusCode===429&&He()}})}function An0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unlike(o)},onMutate:o=>{wz(t,o,!1),Lz(t,o,!1),xz(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function jc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&He()}})}function Dc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(l0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Ic0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}),t.invalidateQueries({queryKey:l0.discoveryFeed})},onError(o){o.statusCode===429&&He()}})}function Fc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(l0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&He()}})}function Nz(e,t,o){const n=[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts(null)];for(const r of n)e.setQueriesData(r,a=>a===void 0?a:{...a,pages:a.pages.map(i=>({...i,posts:i.posts.map(b=>b.object.id===t?{...b,object:{...b.object,reposted:o,repostCount:Math.max(o?b.object.repostCount+1:b.object.repostCount-1,0)}}:b)}))})}function Bz(e,t,o){const n=l0.replyChain(null);e.setQueriesData(n,r=>{if(!r)return r;const a=i=>i.id===t?{...i,repostedByMe:o,repostCount:Math.max(o?(i.repostCount||0)+1:(i.repostCount||0)-1,0)}:i;return{...r,post:a(r.post),ancestors:{...r.ancestors,chain:r.ancestors.chain.map(a)},children:r.children.map(i=>({...i,post:a(i.post),chain:i.chain.map(a)}))}})}function hn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).repost(o)},onMutate:o=>{Nz(t,o,!0),Bz(t,o,!0),kz(t,e,o,!0)},onError(o,n){Nz(t,n,!1),Bz(t,n,!1),kz(t,e,n,!1),o.statusCode===403&&$3(),o.statusCode===429&&He()}})}function qn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).derepost(o)},onMutate:o=>{Nz(t,o,!1),Bz(t,o,!1),kz(t,e,o,!1)},onError(o){o.statusCode===429&&He()}})}function mn0(e){return L2({queryKey:l0.user(e),async queryFn(){const t=await c1();return a1(e,t).getUser()}})}function Gd(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).unfollow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!1,followerCount:h.followerCount-1<0?0:h.followerCount-1});const b=l0.accountFollows(a,"followers");n.setQueryData(b,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));return q?{...h,pages:h.pages.map(g=>({...g,accounts:g.accounts.filter(W=>W.name!==q.name)}))}:h});const l=l0.account("index");n.setQueryData(l,h=>h&&{...h,followingCount:h.followingCount-1});const O=l0.accountFollows("me","following");n.getQueryData(O)?n.setQueryData(O,h=>h?.pages?{...h,pages:h.pages.map(q=>({...q,accounts:q.accounts.filter(g=>g.handle!==a)}))}:h):n.invalidateQueries({queryKey:O}),GW(n,a,!1),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!1,followerCount:Math.max(0,L.followerCount-1)}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!1,followerCount:Math.max(0,q.followerCount-1)}:q)),ZW(n,e,a,!1),t()},onError:r=>{r.statusCode===429&&He(),o()}})}function Kd(e,t,o){const n=f1();return Y1({async mutationFn(r){const a=await c1();return a1(e,a).follow(r)},onSuccess(r,a){const i=l0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!0,followerCount:h.followerCount+1});const b=l0.account("index");n.setQueryData(b,h=>h&&{...h,followingCount:h.followingCount+1});const l=l0.accountFollows(a,"followers"),O=l0.accountFollows("me","following");n.getQueryData(O)?n.setQueryData(O,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account(a==="me"?"index":a));if(!q)return h;const g={id:q.id,name:q.name,handle:q.handle,avatarUrl:q.avatarUrl,blockedByMe:q.blockedByMe,domainBlockedByMe:q.domainBlockedByMe,isFollowing:!0};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}):n.invalidateQueries({queryKey:O}),GW(n,a,!0),n.setQueryData(l0.exploreProfiles(e),h=>{if(!h)return h;const q=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,x])=>{const k=x.sites.map(L=>L.handle===a?{...L,followedByMe:!0,followerCount:L.followerCount+1}:L);return v[y]={...x,sites:k},v},{});return{...g,results:W}});return{...h,pages:q}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(q=>q.handle===a?{...q,followedByMe:!0,followerCount:q.followerCount+1}:q)),n.setQueryData(l,h=>{if(!h?.pages?.[0])return h;const q=n.getQueryData(l0.account("index"));if(!q)return h;const g={id:q.url,type:"Person",preferredUsername:"index",name:q.name,url:q.url,handle:`index@${new URL(q.url).hostname}`,icon:{type:"Image",url:q.avatarUrl},isFollowing:!1};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}),ZW(n,e,a,!0),t()},onError(r){o(),r.statusCode===429&&He(),r.statusCode===403&&$3()}})}function gn0(e,t){const o=f1(),n=l0.searchResults(t);return{searchQuery:L2({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await c1();return a1(e,i).search(t)}}),updateAccountSearchResult:(i,b)=>{o.setQueryData(n,l=>l&&{...l,accounts:l.accounts.map(u=>u.id===i?{...u,...b}:u)})}}}function dl(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map((a,i)=>i===0?{...a,[o]:[n,...a[o]]}:a)})}function Do(e,t,o,n,r){e.setQueryData(t,a=>a&&{...a,pages:a.pages.map(i=>({...i,[o]:i[o].map(b=>b.id===n?r(b):b)}))})}function Ol(e,t,o,n){e.setQueryData(t,r=>r&&{...r,pages:r.pages.map(a=>({...a,[o]:a[o].filter(i=>i.id!==n)}))})}function Wn0(e,t){const o=f1();return Y1({async mutationFn({inReplyTo:n,content:r,imageUrl:a,altText:i}){const b=await c1(),l=a1(e,b),u=a?{url:a,altText:i}:void 0;return l.reply(n,r,u)},onMutate:({inReplyTo:n})=>{if(!t)throw new Error("Cannot create reply without actor props");const r=QW();return pA(o,n,1),MA(o,n,1),Cz(o,e,n,1),{id:r}},onSuccess:(n,r)=>{if(n.id===void 0)throw new Error("Activity returned from API has no id");o.invalidateQueries({queryKey:l0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),pA(o,r.inReplyTo,-1),MA(o,r.inReplyTo,-1),Cz(o,e,r.inReplyTo,-1),n.statusCode===403&&$3(),n.statusCode===429&&He(),ve.error("An error occurred while sending your reply.")}})}function vn0(e,t){const o=f1(),n=l0.feed,r=l0.outbox(e),a=l0.profilePosts("index");return Y1({async mutationFn({content:i,imageUrl:b,altText:l}){const u=await c1(),O=a1(e,u),f=b?{url:b,altText:l}:void 0;return O.note(i,f)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const l=On0(i),u=QW(),O=dn0(t,u,l,b);return dl(o,n,"posts",O),dl(o,r,"data",O),dl(o,a,"posts",O),{id:u}},onSuccess:(i,b,l)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=rc(i);Do(o,n,"posts",l?.id??"",()=>u),Do(o,r,"data",l?.id??"",()=>u),Do(o,a,"posts",l?.id??"",()=>u)},onError(i,b,l){console.error(i),Ol(o,n,"posts",l?.id??""),Ol(o,r,"data",l?.id??""),Ol(o,a,"posts",l?.id??""),i.statusCode===429&&He(),ve.error("An error occurred while posting your note.")}})}function Yd(e,t,o){const n=o?.enabled!==!1;return L2({queryKey:l0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await c1();return a1(e,r).getAccount(t)}})}function Hc0(e,t){const o=f1();return Q2({queryKey:l0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await c1(),i=await a1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(l0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function Uc0(e){const t=l0.feed,o=f1();return{feedQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getFeed(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateFeedActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function Vc0(e){const t=l0.inbox,o=f1();return{inboxQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getInbox(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateInboxActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function $c0(e){const t=[...l0.discoveryFeed,e.topic],o=f1();return{discoveryFeedQuery:Q2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getDiscoveryFeed(e.topic,a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updateDiscoveryFeedActivity:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function Qc0(e,t){const o=l0.profilePosts(e==="me"?"index":e),n=f1();return{postsByAccountQuery:Q2({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await c1();return a1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(rc),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Do(n,o,"posts",i,l=>({...l,...b}))}}}function Zc0(e){const t=l0.postsLikedByAccount,o=f1();return{postsLikedByAccountQuery:Q2({queryKey:t,enabled:e.enabled,async queryFn({pageParam:a}){const i=await c1();return a1("index",i).getPostsLikedByAccount(a).then(l=>({posts:l.posts.map(rc),next:l.next}))},getNextPageParam(a){return a.next}}),updatePostsLikedByAccount:(a,i)=>{Do(o,t,"posts",a,b=>({...b,...i}))}}}function Rn0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(l0.feed);t.setQueryData(l0.feed,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))});const a=t.getQueryData(l0.inbox);t.setQueryData(l0.inbox,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.id!==o).map(w=>w.object.id===n?{...w,object:{...w.object,replyCount:w.object.replyCount-1}}:w)}))}),n&&Cz(t,e,n,-1);const i=l0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,L=>L&&{...L,pages:L.pages.map(C=>({...C,data:C.data.filter(w=>w.object.id!==o)}))});const l=l0.liked(e),u=t.getQueryData(l);let O=!1;t.setQueryData(l,L=>L&&{...L,pages:L.pages.map(C=>(O=C.data.some(w=>w.object.id===o),{...C,data:C.data.filter(w=>w.object.id!==o)}))}),[l0.feed,l0.inbox,l0.discoveryFeed,l0.profilePosts("index"),l0.postsLikedByAccount].some(L=>t.getQueryData(L)?.pages.some(w=>w.posts.some(N=>N.id===o&&N.object.liked)))&&t.setQueryData(l0.account(e),L=>L&&{...L,likedCount:Math.max(0,L.likedCount-1)});const h=l0.profilePosts(null),q=t.getQueriesData(h);t.setQueriesData(h,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});let g=[],W;O&&(g=l0.account(e),W=t.getQueryData(g),t.setQueryData(g,L=>L&&{...L,likedCount:L.likedCount-1<0?0:L.likedCount-1}));const v=l0.profilePosts("index"),y=t.getQueryData(v);t.setQueryData(v,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});const x=l0.postsLikedByAccount,k=t.getQueryData(x);return t.setQueryData(x,L=>L&&{...L,pages:L.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},L=>{if(!L)return L;const C=L.children.filter(N=>N.post.id!==o).map(N=>({...N,chain:N.chain.filter(D=>D.id!==o)}));let w=L.post;return L.post.id===n&&(w={...L.post,replyCount:Math.max(0,(L.post.replyCount||0)-1)}),{...L,post:w,children:C}}),{previousFeed:{key:l0.feed,data:r},previousInbox:{key:l0.inbox,data:a},previousOutbox:{key:i,data:b},previousLiked:{key:l,data:u},previousProfilePosts:{key:h,data:q},previousAccount:O?{key:g,data:W}:null,previousPostsByAccount:{key:l0.profilePosts("index"),data:y},previousPostsLikedByAccount:{key:l0.postsLikedByAccount,data:k}}},onError:(o,n,r)=>{r&&(t.setQueryData(r.previousFeed.key,r.previousFeed.data),t.setQueryData(r.previousInbox.key,r.previousInbox.data),t.setQueryData(r.previousOutbox.key,r.previousOutbox.data),t.setQueryData(r.previousLiked.key,r.previousLiked.data),t.setQueriesData(r.previousProfilePosts.key,r.previousProfilePosts.data),r.previousAccount&&t.setQueryData(r.previousAccount.key,r.previousAccount.data),r.previousPostsByAccount&&t.setQueryData(l0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(l0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:l0.feed}),t.invalidateQueries({queryKey:l0.inbox}))}})}function Gc0(e){return Q2({queryKey:l0.notifications(e),async queryFn({pageParam:t}){const o=await c1();return a1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function Kc0(e,t){const o=L2({queryKey:l0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const O=await c1(),f=a1(e,O);try{return await f.getReplies(t)}catch(h){if(zn0(h)&&h.statusCode===404)return await f.getPost(t),await f.getReplies(t);throw h}}}),[n,r]=p.useState(null),[a,i]=p.useState(null);p.useEffect(()=>{o.data?r(o.data):o.error&&i(o.error)},[o.data,o.error]);const b=p.useCallback(async()=>{if(!(!n?.ancestors.hasMore||!n?.ancestors.chain[0]))try{const O=await c1(),h=await a1(e,O).getReplies(n.ancestors.chain[0].id);r(q=>q&&{...q,ancestors:{chain:[...h.ancestors.chain,...q.ancestors.chain],hasMore:h.ancestors.hasMore}})}catch(O){i(O instanceof Error?O:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),l=p.useCallback(async()=>{if(n?.next&&t)try{const O=await c1(),h=await a1(e,O).getReplies(t,n.next);r(q=>q&&{...q,children:[...q.children,...h.children],next:h.next})}catch(O){i(O instanceof Error?O:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async O=>{if(n?.children[O]?.hasMore)try{const f=await c1(),h=a1(e,f),q=n.children[O],g=q.chain.length>1?q.chain[q.chain.length-2]:q.post,W=await h.getReplies(g.id),v=W.children[0].chain;r(y=>{if(!y)return y;const x=[...y.children];return x[O]={...q,chain:[...q.chain,...v],hasMore:W.children[0].hasMore},{...y,children:x}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more child replies"))}},[e,n]);return{data:n,isLoading:o.isLoading,error:a,loadMoreAncestors:b,loadMoreChildren:l,loadMoreChildReplies:u,hasMoreAncestors:!!n?.ancestors.hasMore,hasMoreChildren:!!n?.next,hasMoreChildReplies:O=>!!n?.children[O]?.hasMore}}function Yc0(e){const t=f1();return Y1({async mutationFn(o){const n=await c1();return a1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:l0.account("index")})}})}async function yn0(e){const t=await c1();return a1("index",t).upload(e)}function KW(e,t=!0){const o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return L2({queryKey:l0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function wn0(e){const t=f1(),o=p.useCallback(async()=>await c1(),[]),n=p.useCallback(async()=>{const r=await o();return a1(e,r)},[e,o]);return Y1({async mutationFn(){return t.setQueryData(l0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function Jc0(e,t){const o=f1(),n=[...l0.exploreProfiles(e),t];return{exploreProfilesQuery:Q2({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await c1(),u=await a1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(O=>{o.setQueryData(l0.account(O.handle),O)}),{accounts:u.accounts,next:u.next}},getNextPageParam(i){return i.next}}),updateExploreProfile:(i,b)=>{o.setQueryData(n,l=>{if(!l)return l;const u=l.pages.map(O=>{const f=O.accounts.map(h=>h.id===i?{...h,...b}:h);return{...O,accounts:f}});return{...l,pages:u}})}}}function Jd(e,t=3){const o=f1(),n=l0.suggestedProfiles(e,t);return{suggestedProfilesQuery:L2({queryKey:n,async queryFn(){const i=await c1(),u=(await a1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(O=>{o.setQueryData(l0.account(O.handle),O)}),u.length>0?u:null},retry:!1,staleTime:3600*1e3}),updateSuggestedProfile:(i,b)=>{o.setQueryData(n,l=>l&&l.map(u=>u.id===i?{...u,...b}:u))}}}function e5(){return{topicsQuery:L2({queryKey:l0.topics(),async queryFn(){const t=await c1();return a1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function t5(e,t){const o=l0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function ea0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).enableBluesky()},onSuccess(){t5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function ta0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).disableBluesky()},onSuccess(){t5(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:l0.accountFollows("index","following")})},onError(o){o.statusCode===429&&He()}})}function oa0(e){const t=f1();return Y1({async mutationFn(){const o=await c1();return a1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&t5(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&He()}})}function Ln0(){return z.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[z.jsx("path",{d:"M3.6349 20.3723C3.80192 20.5393 4.00019 20.6718 4.21841 20.7622C4.43663 20.8525 4.67052 20.8991 4.90672 20.8991C5.14291 20.8991 5.3768 20.8525 5.59502 20.7622C5.81324 20.6718 6.01152 20.5393 6.17853 20.3723C6.34555 20.2052 6.47804 20.007 6.56843 19.7888C6.65882 19.5705 6.70534 19.3366 6.70534 19.1004C6.70534 18.8643 6.65882 18.6304 6.56843 18.4121C6.47804 18.1939 6.34555 17.9956 6.17853 17.8286C5.84123 17.4913 5.38374 17.3018 4.90672 17.3018C4.42969 17.3018 3.9722 17.4913 3.6349 17.8286C3.29759 18.1659 3.10809 18.6234 3.10809 19.1004C3.10809 19.5775 3.29759 20.035 3.6349 20.3723ZM17.7153 6.17951C17.8823 6.34653 18.0806 6.47901 18.2988 6.5694C18.517 6.65979 18.7509 6.70632 18.9871 6.70632C19.2233 6.70632 19.4572 6.65979 19.6754 6.5694C19.8936 6.47901 20.0919 6.34653 20.2589 6.17951C20.4259 6.01249 20.5584 5.81421 20.6488 5.596C20.7392 5.37778 20.7857 5.14389 20.7857 4.90769C20.7857 4.67149 20.7392 4.43761 20.6488 4.21939C20.5584 4.00117 20.4259 3.80289 20.2589 3.63587C19.9216 3.29857 19.4641 3.10907 18.9871 3.10907C18.5101 3.10907 18.0526 3.29857 17.7153 3.63587C17.378 3.97318 17.1885 4.43067 17.1885 4.90769C17.1885 5.38472 17.378 5.8422 17.7153 6.17951ZM7.50655 12.0023C7.50655 13.1946 7.98019 14.3381 8.82329 15.1812C9.66639 16.0243 10.8099 16.4979 12.0022 16.4979C13.1945 16.4979 14.338 16.0243 15.1811 15.1812C16.0242 14.3381 16.4978 13.1946 16.4978 12.0023C16.4978 10.81 16.0242 9.66647 15.1811 8.82337C14.338 7.98027 13.1945 7.50663 12.0022 7.50663C10.8099 7.50663 9.66639 7.98027 8.82329 8.82337C7.98019 9.66647 7.50655 10.81 7.50655 12.0023Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),z.jsx("path",{d:"M8.79319 21.5246C10.5669 22.1224 12.4724 22.2127 14.2947 21.7854C16.1171 21.3581 17.7838 20.4302 19.1069 19.1062C20.4302 17.7827 21.3577 16.116 21.7848 14.2937C22.2119 12.4715 22.1217 10.5662 21.5243 8.79251M2.47582 15.2081C1.87829 13.4342 1.78805 11.5287 2.21527 9.70622C2.64249 7.88378 3.57019 6.21687 4.89383 4.89332C6.21747 3.56977 7.88445 2.64219 9.70692 2.21511C11.5294 1.78802 13.4349 1.87839 15.2088 2.47605",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function yp({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return XI(o||"")!==null}function G0({children:e,...t}){return z.jsx(Xd,{...t,children:e})}function xn0({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:a,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,l=yp({path:e,activeOnSubpath:n}),u=r!==void 0?r:l,{isMobile:O,setOpenMobile:f}=tc(),h=()=>{O&&f(!1)};return z.jsx(jd,{asChild:!0,isActive:u,...i,children:z.jsx("a",{href:t==="_blank"?e:b,rel:t==="_blank"?o??"noopener noreferrer":o,target:t,"aria-current":u?"page":void 0,onClick:h,children:a})})}function kn0({children:e,...t}){return z.jsx("span",{...t,children:e})}G0.Link=xn0;G0.Label=kn0;function Cn0({...e}){const{data:t}=ye(),{data:o}=V3(),n=Tt(o?.settings,"social_web_enabled")??!1,a=_3().data?.site.url,{data:i=0}=KW(t?.slug||"",n),b=yp({path:"network",activeOnSubpath:!0}),l=yp({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!l;return!t||!T10(t)?null:z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[z.jsx(G0,{children:z.jsxs(G0.Link,{to:"analytics",activeOnSubpath:!0,children:[z.jsx(b9,{}),z.jsx(G0.Label,{children:"Analytics"})]})}),n&&z.jsxs(G0,{children:[z.jsxs(G0.Link,{to:"network",isActive:b||l,children:[z.jsx(Ln0,{}),z.jsx(G0.Label,{children:"Network"})]}),u&&z.jsx(Dd,{children:i})]}),z.jsxs(G0,{className:"relative group/viewsite",children:[z.jsxs(G0.Link,{to:"site",children:[z.jsx(KQ,{}),z.jsx(G0.Label,{children:"View site"})]}),z.jsx("a",{href:a,target:"_blank","aria-label":"View site in new tab",rel:"noopener noreferrer",className:"absolute opacity-0 group-hover/viewsite:opacity-100 right-0 top-0 size-8 hover:bg-sidebar-accent flex items-center justify-center rounded-full text-gray-700 hover:text-sidebar-accent-foreground transition-all",children:z.jsx(sd,{size:16})})]})]})})})}function Nn0({isExpanded:e,children:t,id:o}){return z.jsx("div",{id:o,className:`grid transition-all duration-200 ease-out ${e?"grid-rows-[1fr] mb-5":"grid-rows-[0fr] mb-0"}`,children:z.jsx("div",{className:"overflow-hidden",children:t})})}const Bn0="MembersResponseType",_n0=Kr({dataType:Bn0,path:"/members/"});function En0(){const{data:e}=_n0({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const Sn0=()=>Zd({select:e=>e.navigation}),Tn0=()=>{const{mutateAsync:e}=U3();return Y1({mutationFn:async t=>{await e({navigation:t})}})},Pn0=e=>{const{data:t}=Sn0(),{mutateAsync:o}=Tn0();return[t?.expanded[e]??!0,async a=>o({expanded:{[e]:a}})]},Xn0=Wp({name:s2(),route:s2(),color:s2(),icon:s2().optional(),filter:_o0(s2(),s2().nullable())}),jn0=Qd(Xn0);function Dn0(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function In0({route:e="posts"}){const{data:t}=V3(),o=aW(),n=p.useMemo(()=>{const r=Tt(t?.settings,"shared_views")??"[]";try{const a=JSON.parse(r),i=jn0.safeParse(a);return i.success?i.data.filter(b=>b.route===e):(console.error("Failed to validate shared_views setting:",i.error),[])}catch(a){return console.error("Failed to parse shared_views setting:",a),[]}},[t,e]);return n.length===0?null:z.jsx(z.Fragment,{children:n.map(r=>{const a=o.getRouteUrl(e,r.filter),i=o.isRouteActive(e,r.filter);return z.jsx(G0,{children:z.jsxs(G0.Link,{className:"pl-9",to:a,isActive:i,children:[z.jsx(G0.Label,{className:"grow",children:r.name}),z.jsx("span",{className:"size-2 rounded-full shrink-0 mx-0.5",style:{backgroundColor:Dn0(r.color)},"data-color":r.color,"aria-hidden":"true"})]})},a)})})}const Fn0=e=>{const{data:t}=Fd();return t?.config.labs?.[e]??!1};function Hn0({...e}){const{data:t}=ye(),[o,n]=Pn0("posts"),r=En0(),a=aW(),i=Fn0("commentModeration"),b=t&&S10(t),l=t&&E10(t);return z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[z.jsxs(G0,{children:[z.jsx(o1,{"aria-controls":"posts-submenu","aria-expanded":o,"aria-label":"Toggle post views",variant:"ghost",size:"icon",className:"!h-[34px] absolute sidebar:opacity-0 group-hover/menu-item:opacity-100 focus-visible:opacity-100 transition-all left-3 top-0 p-0 h-9 w-auto text-sidebar-accent-foreground hover:text-gray-black hover:bg-transparent",onClick:()=>void n(!o),children:z.jsx(ad,{size:16,className:`transition-all ${o&&"rotate-[90deg]"}`})}),z.jsxs(G0.Link,{to:a.getRouteUrl("posts"),isActive:a.isRouteActive("posts"),children:[z.jsx(c9,{className:"opacity-0 sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0 pointer-events-none transition-all"}),z.jsx(G0.Label,{children:"Posts"})]}),z.jsx("a",{href:"#/editor/post","aria-label":"Create new post",className:"flex items-center justify-center absolute hover:bg-sidebar-accent transition-all rounded-full right-0 top-0 p-0 size-8 text-gray-700 hover:text-sidebar-accent-foreground",children:z.jsx(a9,{size:20,className:"!stroke-[1.5px] mt-px"})})]}),z.jsxs(Nn0,{isExpanded:o,id:"posts-submenu",children:[z.jsx(G0,{children:z.jsx(G0.Link,{className:"pl-9",to:"posts?type=draft",isActive:a.isRouteActive("posts",{type:"draft"}),children:z.jsx(G0.Label,{children:"Drafts"})})}),z.jsx(G0,{children:z.jsx(G0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:a.isRouteActive("posts",{type:"scheduled"}),children:z.jsx(G0.Label,{children:"Scheduled"})})}),z.jsx(G0,{children:z.jsx(G0.Link,{className:"pl-9",to:"posts?type=published",isActive:a.isRouteActive("posts",{type:"published"}),children:z.jsx(G0.Label,{children:"Published"})})}),z.jsx(In0,{})]}),z.jsx(G0,{children:z.jsxs(G0.Link,{to:a.getRouteUrl("pages"),isActive:a.isRouteActive("pages"),children:[z.jsx(CZ,{}),z.jsx(G0.Label,{children:"Pages"})]})}),b&&z.jsx(G0,{children:z.jsxs(G0.Link,{to:"tags",isActive:a.isRouteActive(["tags","tag","tag.new"]),children:[z.jsx(zG,{}),z.jsx(G0.Label,{children:"Tags"})]})}),l&&z.jsxs(G0,{children:[z.jsxs(G0.Link,{to:a.getRouteUrl("members"),isActive:a.isRouteActive(["members","member","member.new"]),children:[z.jsx(l9,{}),z.jsx(G0.Label,{children:"Members"})]}),r!=null&&z.jsx(Dd,{children:r})]}),l&&i&&z.jsx(G0,{children:z.jsxs(G0.Link,{to:"comments",activeOnSubpath:!0,children:[z.jsx(ZZ,{}),z.jsx(G0.Label,{children:"Comments"})]})})]})})})}function Un0({...e}){const{data:t}=ye(),{data:o}=Fd();return!t||!Fa(t)||!o?.config.hostSettings?.billing?.enabled?null:z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsx(nc,{children:z.jsx(G0,{children:z.jsxs(G0.Link,{to:"pro",children:[z.jsx(WZ,{}),z.jsx(G0.Label,{children:"Ghost(Pro)"})]})})})})})}function Vn0({...e}){const{data:t}=ye(),o=t&&_10(t);return z.jsx(oc,{...e,children:z.jsx(Da,{children:z.jsxs(nc,{children:[o&&z.jsx(G0,{children:z.jsxs(G0.Link,{to:"settings",children:[z.jsx(i9,{}),z.jsx(G0.Label,{children:"Settings"})]})}),z.jsx(G0,{children:z.jsxs(G0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(fZ,{}),z.jsx(G0.Label,{children:"Help"})]})})]})})})}const $n0="/ghost/assets/ghost-pro-logo-B1sXD_MX.png";function Qn0({trialDaysRemaining:e}){return z.jsxs(dd,{variant:"gradient",size:"lg",className:"mx-2 my-5 flex flex-col items-stretch",children:[z.jsx("div",{children:z.jsx("img",{src:$n0,alt:"Ghost Pro",className:"max-h-[33px]"})}),z.jsx("div",{className:"text-base mt-3 font-semibold",children:"Unlock every feature"}),z.jsxs("div",{className:"mt-2 text-gray-700 text-sm mb-4",children:["Choose a plan to access the full power of Ghost right away, you have ",z.jsxs("span",{className:"font-semibold text-black",children:[e," days"]})," free trial remaining."]}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function Zn0(){const{showUpgradeBanner:e,trialDaysRemaining:t}=IW();return z.jsxs(Jg,{className:"px-3 pt-4 justify-between",children:[z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[z.jsx(Cn0,{}),z.jsx(Hn0,{}),z.jsx(Un0,{})]}),z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[e?z.jsx(Qn0,{trialDaysRemaining:t}):z.jsx(ln0,{}),z.jsx(Vn0,{className:"pb-0"})]})]})}function Gn0({...e}){return z.jsxs(Qg,{...e,children:[z.jsx(U10,{className:"px-5 pt-6 pb-0"}),z.jsx(Zn0,{}),z.jsx(bn0,{className:"p-3 gap-0"})]})}const vi=1.5;function fl({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=yp({path:e,activeOnSubpath:t});return z.jsx(o1,{asChild:!0,className:`rounded-full w-full max-w-16 min-w-9 hover:bg-gray-200 ${r?"bg-gray-200":"bg-transparent"}`,...n,variant:"ghost",size:"icon","data-active":r,children:z.jsx("a",{href:e,children:o})})}function Kn0(){const{isMobile:e}=tc();return e?z.jsx("div",{className:"fixed sidebar:hidden bottom-0 left-0 right-0 h-[var(--mobile-navbar-height)] bg-sidebar/80 backdrop-blur-md border-t border-sidebar-border z-50 safe-area-inset-bottom",children:z.jsxs("div",{className:"grid grid-cols-4 items-center w-full justify-items-center max-w-[300px] h-full mx-auto px-5",children:[z.jsxs(fl,{activeOnSubpath:!0,to:"analytics",children:[z.jsx(b9,{strokeWidth:vi}),z.jsx("span",{className:"sr-only",children:"Analytics"})]}),z.jsxs(fl,{activeOnSubpath:!0,to:"posts",children:[z.jsx(c9,{strokeWidth:vi}),z.jsx("span",{className:"sr-only",children:"Posts"})]}),z.jsxs(fl,{activeOnSubpath:!0,to:"members",children:[z.jsx(l9,{strokeWidth:vi}),z.jsx("span",{className:"sr-only",children:"Members"})]}),z.jsxs(Zg,{className:"rounded-full px-8 h-9 hover:bg-transparent",children:[z.jsx(n9,{strokeWidth:vi}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})}):z.jsx(z.Fragment,{})}function Yn0({children:e}){const{data:t}=ye(),o=x10();return t&&Id(t)?z.jsxs("div",{className:"relative h-full bg-background",children:[z.jsx("main",{className:"h-full overflow-auto",children:e}),z.jsx("div",{className:"fixed bottom-3.5 left-3.5 lg:bottom-8 lg:left-8 z-20",children:z.jsx(Mn0,{})})]}):z.jsxs($g,{open:!!t&&o,children:[z.jsx(Gn0,{}),z.jsxs(Gg,{className:"bg-background overflow-y-scroll max-h-[calc(100%-var(--mobile-navbar-height))] sidebar:max-h-full",children:[z.jsx("main",{className:"flex-1",children:e}),z.jsx(Kn0,{})]})]})}function Jn0(){const{data:e}=ye();return y10(),R10(),z.jsx(W10,{children:e?z.jsxs(Yn0,{children:[z.jsx(Nr,{}),z.jsx(Ff,{})]}):z.jsxs(z.Fragment,{children:[z.jsx(Az,{}),z.jsx(Ff,{})]})})}const o5=[],YW=p.createContext(void 0),er0=({children:e})=>{const t=we(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):tr0()});p.useEffect(()=>{const i=or0(t.search);Object.keys(i).length>0&&n(b=>{const l={...b,...i};return localStorage.setItem("featureFlags",JSON.stringify(l)),l})},[t.search]);const a={isEnabled:i=>o[i]??!1,flags:o,allFlags:o5};return z.jsx(YW.Provider,{value:a,children:e})},tr0=()=>o5.reduce((e,t)=>({...e,[t]:!1}),{}),or0=e=>{const t=new URLSearchParams(e),o={};return o5.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},nr0=()=>{const e=p.useContext(YW);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function Q3(){const t=l7().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function Jt(){const e=oW(),t=Q3();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o,n);return}o.startsWith("/")?e(`${t}${o}`,n):e(o,n)},[e,t])}const JW=({className:e,onClick:t})=>{const o=Jt(),{previousPath:n}=Yp();return z.jsx(o1,{className:g0("size-9 rounded-full bg-white/85 px-2 backdrop-blur-md dark:bg-black/85 dark:text-white [&_svg]:size-6 focus-visible:ring-0",e),variant:"ghost",onClick:()=>{if(t){t();return}o(n?-1:"/")},children:z.jsx(JQ,{size:24,strokeWidth:1.25})})},rr0=()=>{const e=we(),t=Pt(av,e.pathname);if(!t)return null;const o=t.map(n=>n.route).filter(n=>n.pageTitle);return o[o.length-1]||t[t.length-1].route};function ev(){const e=l7(),t=e.findIndex(l=>l.handle==="activitypub-basepath");if(t===-1)return"";const o=e[t+1];if(!o)return"";const r=e[t].pathname,a=o.pathname;let i=a.startsWith(r)?a.slice(r.length):a;return i=i.replace(/^\//,""),i.split("/")[0]}const cr0=({title:e,backIcon:t})=>t?z.jsx(JW,{className:"-ml-2"}):z.jsx(eW,{className:"max-md:text-[2.4rem]",children:e}),bA=({onToggleMobileSidebar:e})=>z.jsx(o1,{className:"px:0 mr-[-9px] w-[34px] rounded-full bg-white/85 backdrop-blur-md lg:hidden dark:bg-black/85 dark:text-white",variant:"ghost",onClick:e,children:z.jsx(HZ,{className:"!size-5"})}),ar0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=Yp(),n=ev(),r=g10(),a=rr0();let i=!1;n==="profile"&&(i=!0),n==="notes"&&o&&(i=!0);const b=o&&r||a?.showBackButton===!0;return z.jsx(z.Fragment,{children:i?z.jsxs("div",{className:"sticky left-0 top-8 z-50 inline-block max-lg:flex max-lg:items-center max-lg:justify-between max-lg:pr-[15.5px] max-md:top-4",children:[z.jsx("div",{children:b&&z.jsx(JW,{className:"ml-6 max-md:ml-[10px]"})}),!b&&z.jsx(bA,{onToggleMobileSidebar:e})]}):z.jsx("div",{className:"sticky top-0 z-50 bg-white/85 backdrop-blur-md dark:bg-black",children:z.jsxs("div",{className:`relative flex h-[102px] items-center justify-between gap-5 px-[min(4vw,32px)] max-md:h-[68px] ${t?'before:absolute before:inset-x-[min(4vw,32px)] before:bottom-0 before:block before:border-b before:border-gray-200 before:content-[""] before:dark:border-gray-950':""}`,children:[z.jsx(cr0,{backIcon:b,title:a?.pageTitle||""}),z.jsx(bA,{onToggleMobileSidebar:e})]})})})};function Po(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}let Ii=null;const lA=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=b0.useReducer(l=>l+1,0),i=Ii===o&&!n,b=l=>{i?(t(l),setTimeout(()=>{Ii=null,r()},0)):(Ii=o,r(),e(l))};return z.jsx(o1,{className:"absolute -right-1.5 bottom-px z-10 flex size-4 items-center justify-center rounded-full p-0 outline outline-2 outline-white transition-transform hover:scale-105 active:scale-100 dark:outline-black",title:i?"Unfollow":"Follow",onClick:b,children:i?z.jsx(o9,{className:"-mb-px !size-3 !stroke-[2.4]"}):z.jsx(a9,{className:"!size-[14px] !stroke-2"})})},Xo=({author:e,size:t,isLoading:o=!1,disabled:n=!1,className:r="",showFollowButton:a=!1})=>{let i=20,b=`shrink-0 items-center justify-center rounded-full relative z-10 flex bg-black/5 dark:bg-gray-900 ${t==="lg"||n?"":"cursor-pointer"} ${r}`,l="z-10 object-cover rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10";const[u,O]=p.useState(e?.icon?.url),f=Jt(),h=Kd("index",()=>{ve.success(`Followed ${e?.name}`)},()=>{ve.error("Failed to follow")}),q=Gd("index",()=>{ve.info(`Unfollowed ${e?.name}`)},()=>{ve.error("Failed to unfollow")});switch(p.useEffect(()=>{O(e?.icon?.url)},[e?.icon?.url]),t){case"2xs":i=10,b=Z1("size-4",b),l=Z1("size-4",l);break;case"xs":i=12,b=Z1("size-6",b),l=Z1("size-6",l);break;case"notification":i=16,b=Z1("size-9",b),l=Z1("size-9",l);break;case"sm":b=Z1("size-10",b),l=Z1("size-10",l);break;case"md":b=Z1("size-[60px]",b),l=Z1("size-[60px]",l);break;case"lg":i=32,b=Z1("size-22",b),l=Z1("size-22",l);break;default:b=Z1("size-10",b),l=Z1("size-10",l);break}if(!e||o)return z.jsx(w1,{className:l,containerClassName:b});const g=e?.handle||Po(e),W=L=>{L.stopPropagation(),f(`/profile/${g}`)},v=L=>{L.stopPropagation(),h.mutate(g)},y=L=>{L.stopPropagation(),q.mutate(g)},k=a||Ii===g;return u?z.jsxs("div",{className:b,onClick:t==="lg"||n?void 0:W,children:[z.jsx("img",{className:l,referrerPolicy:"no-referrer",src:u,onError:()=>O(void 0)}),k&&z.jsx(lA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]}):z.jsxs("div",{className:b,onClick:n?void 0:W,children:[z.jsx(pd,{className:"text-gray-600",size:i,strokeWidth:1.5}),k&&z.jsx(lA,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]})},Al=({trigger:e,onCopyLink:t,onDelete:o,allowDelete:n=!1,disabled:r=!1,layout:a,followedByMe:i=!1,authoredByMe:b=!1,onFollow:l=()=>{},onUnfollow:u=()=>{}})=>{const O=q=>{q.stopPropagation(),t()},f=q=>{q.stopPropagation(),o()},h=q=>{q.stopPropagation(),i?u():l()};return z.jsxs(WK,{children:[z.jsxs(lJ,{children:[z.jsx(zJ,{disabled:r,asChild:!0,onClick:q=>q.stopPropagation(),children:e}),z.jsx(Um,{align:`${a==="modal"?"start":"end"}`,alignOffset:a==="modal"?-12:0,className:"p-2",children:z.jsxs("div",{className:"flex w-48 flex-col",children:[(!n||a==="inbox")&&z.jsx(bl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:O,children:[z.jsx(jZ,{}),"Copy link"]})}),!b&&z.jsx(bl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start",variant:"ghost",onClick:h,children:[i?z.jsx(hG,{}):z.jsx(mG,{}),i?"Unfollow":"Follow"]})}),n&&z.jsx(vK,{asChild:!0,children:z.jsx(bl,{asChild:!0,children:z.jsxs(o1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:q=>q.stopPropagation(),children:[z.jsx(M9,{}),"Delete"]})})})]})})]}),z.jsxs(u9,{onClick:q=>q.stopPropagation(),children:[z.jsxs(d9,{children:[z.jsx(f9,{children:"Delete this post?"}),z.jsx(A9,{children:a==="inbox"?"This will remove the post from the Ghost social web, but it will remain on your website.":z.jsx(z.Fragment,{children:"If you delete this post, you won't be able to restore it."})})]}),z.jsxs(O9,{children:[z.jsx(q9,{onClick:q=>q.stopPropagation(),children:"Cancel"}),z.jsx(h9,{className:z3({variant:"destructive"}),onClick:f,children:"Delete"})]})]})]})};function sr0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const l=r5(b);if(!l)return[];if(Array.isArray(l))return l.map((u,O)=>({url:u.url,alt:u.name||`Image-${O}`}));if(l.mediaType?.startsWith("image/")||l.type==="Image")return[{url:l.url,alt:l.name||"Image"}];if(b.image){let u;if(typeof b.image=="string"?u=b.image:u=b.image?.url,u)return[{url:u,alt:"Image"}]}return[]};return{lightboxState:t,openLightbox:b=>{if(!e)return;const l=n(e),u=l.findIndex(O=>O.url===b);u!==-1&&o({images:l,currentIndex:u,isOpen:!0})},closeLightbox:()=>{o(b=>({...b,isOpen:!1}))},navigateToIndex:b=>{o(l=>({...l,currentIndex:b}))}}}const hl=({images:e,currentIndex:t,isOpen:o,onClose:n,onNavigate:r})=>{const a=t===0,i=t===e.length-1,b=p.useCallback(()=>{if(e.length<=1||i)return;const u=(t+1)%e.length;r(u)},[e.length,i,t,r]),l=p.useCallback(()=>{if(e.length<=1||a)return;const u=(t-1+e.length)%e.length;r(u)},[e.length,a,t,r]);return p.useEffect(()=>{const u=O=>{o&&(O.key==="ArrowRight"&&!i?b():O.key==="ArrowLeft"&&!a&&l())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[o,t,e.length,b,l,i,a]),!o||e.length===0?null:z.jsx(q3,{open:o,onOpenChange:u=>{u||n()},children:z.jsxs(Ta,{className:"top-[50%] h-[100vh] max-h-[100vh] w-[100vw] max-w-[100vw] translate-y-[-50%] items-center border-none bg-transparent p-0 shadow-none data-[state=closed]:zoom-out-100 data-[state=open]:zoom-in-100 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:slide-in-from-top-[50%]",onClick:()=>n(),children:[z.jsx("img",{alt:e[t].alt,className:"mx-auto max-h-[90vh] max-w-[90vw] object-contain",src:e[t].url,onClick:u=>u.stopPropagation()}),e.length>1&&z.jsxs(z.Fragment,{children:[z.jsxs(o1,{className:"absolute left-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pr-0.5 hover:bg-black/70",disabled:a,onClick:u=>{u.stopPropagation(),l()},children:[z.jsx(lZ,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Previous image"})]}),z.jsxs(o1,{className:"absolute right-5 top-1/2 size-11 -translate-y-1/2 rounded-full bg-black/50 p-0 pl-0.5 hover:bg-black/70",disabled:i,onClick:u=>{u.stopPropagation(),b()},children:[z.jsx(ad,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Next image"})]})]}),z.jsx(KK,{asChild:!0,children:z.jsxs(o1,{className:"absolute right-5 top-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[z.jsx(bd,{className:"!size-5"}),z.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},zA=()=>{},n5=({className:e,following:t,handle:o,variant:n="default",onFollow:r=zA,onUnfollow:a=zA,"data-testid":i})=>{const[b,l]=p.useState(t),u=Gd("index",()=>{},()=>{l(!0)}),O=Kd("index",()=>{},()=>{l(!1)}),f=async()=>{b?(l(!1),a(),u.mutate(o)):(l(!0),r(),O.mutate(o))};p.useEffect(()=>{l(t)},[t]);const h=b?"Following":"Follow";return n==="link"?z.jsx(o1,{className:Z1("p-0 font-medium",b?"text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white":"text-purple hover:text-black dark:hover:text-white",e),"data-testid":i,variant:"link",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),f()},children:h}):z.jsx(o1,{className:Z1("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:q=>{q?.preventDefault(),q?.stopPropagation(),f()},children:h})};function _z(e,t=[]){if(t.length===0)return e.replace(/<br\s*\/?>/gi," ").replace(/<\/p>\s*<p>|<\/div>\s*<div>|<\/h[1-6]>\s*<|<\/li>\s*<li>|<\/a>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();const o=t.map(u=>u.toLowerCase()),n={};let r=0,i=e.replace(/<\/(h[1-6]|p|div|li|blockquote|pre)>/gi,"<br>");for(const u of o){const O=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(O,f=>{const h=`__EXCLUDED_TAG_${r+=1}__`;return n[h]=f,h})}let b=i;o.includes("br")||(b=i.replace(/<br\s*\/?>/gi," "));let l=b.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim();for(const[u,O]of Object.entries(n))l=l.replace(u,O);return l}const Fi=e=>{const t=document.createElement("div");t.innerHTML=e;const o=t.getElementsByTagName("a");for(let n=0;n<o.length;n++)(o[n].getAttribute("href")||"").match(/^\s*(javascript|data|vbscript):/i)&&o[n].removeAttribute("href"),o[n].setAttribute("target","_blank"),o[n].setAttribute("rel","noopener noreferrer");return t.innerHTML},uA=e=>"preferredUsername"in e,Eo=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:a=!1})=>{const[i,b]=p.useState(!1),l=Jt();let u=e?.handle;!u&&e&&uA(e)&&(u=Po(e));const O=o||!u&&!e,f=Yd("index",u||"",{enabled:i&&!!u}),h=f.isFetching||f.isLoading,q=f.error,g=f.data?typeof f.data.followerCount=="number"&&typeof f.data.followingCount=="number"&&f.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!g&&!h&&!q&&f.refetch({cancelRefetch:!1})},[f,h,q,g,i,u]),O)return z.jsx(z.Fragment,{children:t});const v=f.data||e,y=v?.handle??u??"",x=v?.name??"",k=v?.avatarUrl??(e&&uA(e)?e.icon?.url:null)??null,L=!!v?.followsMe,C=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,w=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,N=v?.bio?Fi(_z(v.bio,["a"])):void 0,D=()=>{y&&l(`/profile/${y}`)},Y=()=>{y&&l(`/profile/${y}/following`)},V=()=>{y&&l(`/profile/${y}/followers`)};return z.jsxs(j00,{onOpenChange:b,children:[z.jsx(D00,{asChild:!0,children:t}),z.jsx(Ig,{align:r,className:"w-[320px] cursor-default rounded-2xl border-0 p-5 text-left text-gray-900 shadow-[0_5px_24px_0px_rgba(0,0,0,0.02),0px_2px_5px_0px_rgba(0,0,0,0.07),0px_0px_1px_0px_rgba(0,0,0,0.25)] outline-none dark:bg-[#101114] dark:shadow-none",side:n,sideOffset:12,onClick:J=>J.stopPropagation(),children:z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex flex-col gap-2",children:[z.jsxs("div",{className:"flex justify-between",children:[z.jsxs(ld,{className:"size-14 cursor-pointer",onClick:D,children:[k&&z.jsx(zd,{alt:x,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:k,onError:J=>{J.target.src="",J.target.style.display="none"}}),z.jsx(ud,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:z.jsx(pd,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!a&&z.jsx(n5,{following:!!v?.followedByMe,handle:y,type:"primary"})]}),z.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:D,children:[z.jsx(tW,{className:"w-full truncate",children:x}),z.jsxs("div",{className:"flex w-full gap-2",children:[z.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:y}),L&&!a&&z.jsx(LK,{className:"mt-px whitespace-nowrap",variant:"secondary",children:"Follows you"})]})]})]}),z.jsx("div",{className:"flex gap-3 dark:text-gray-300",children:h?z.jsx(w1,{className:"h-4 w-32"}):!q&&z.jsxs(z.Fragment,{children:[z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:Y,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:wf(C)})," ","Following"]}),z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:V,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:wf(w)})," ","Followers"]})]})}),h?z.jsx(w1,{className:"h-4 w-48"}):!q&&N?z.jsx("div",{dangerouslySetInnerHTML:{__html:N},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a:hover]:underline [&_a]:text-[#00a4eb]"}):null]})})]})},tv=(e={})=>{const[t,o]=p.useState(!1),n=we();return p.useEffect(()=>{const r=a=>{if(a.target instanceof HTMLInputElement||a.target instanceof HTMLTextAreaElement||a.target instanceof HTMLElement&&a.target.isContentEditable||a.target instanceof HTMLSelectElement||a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;const i=document.querySelector('[role="dialog"][data-state="open"]');if(!(i&&!(e.componentRef?.current?.closest('[role="dialog"]')===i)))switch(a.key.toLowerCase()){case"n":i||(a.preventDefault(),e.onOpenNewNote?e.onOpenNewNote():o(!0));break;case"r":e.isReplyAvailable&&e.onOpenReply&&(n.pathname.includes("/notes/")||n.pathname.includes("/reader/"))&&(a.preventDefault(),e.onOpenReply());break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n.pathname]),{isNewNoteModalOpen:t,setIsNewNoteModalOpen:o}},Ri=({actor:e,object:t,likeCount:o,commentCount:n,repostCount:r,layout:a,disabled:i=!1,buttonClassName:b="",onLikeClick:l,onCommentClick:u,onReplyCountChange:O})=>{const[f,h]=p.useState(t.liked),[q,g]=p.useState(t.reposted),[W,v]=p.useState(!1),y=p.useRef(null);tv({isReplyAvailable:!u&&a!=="reply",onOpenReply:()=>v(!0),componentRef:y}),p.useEffect(()=>{h(t.liked),g(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{N(r)},[r]);const x=fn0("index"),k=An0("index"),L=hn0("index"),C=qn0("index"),[w,N]=p.useState(r),D=async J=>{J.stopPropagation(),f?k.mutate(t.id):x.mutate(t.id,{onError(){h(!1)}}),h(!f),l()},Y=J=>{J.stopPropagation(),u?u():v(!0)},V=`px-2 gap-1.5 font-normal text-md [&_svg]:size-[18px] transition-color ap-action-button text-gray-900 hover:text-gray-900 hover:bg-black/[3%] dark:bg-black dark:hover:bg-gray-950 dark:text-gray-600 ${b}`;return z.jsxs(z.Fragment,{children:[z.jsxs("div",{ref:y,className:`flex ${a!=="inbox"&&"gap-1"}`,children:[z.jsxs(o1,{className:`${V} ${f&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${f?"Undo like":"Like"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),J&&D(J)},children:[z.jsx(_Z,{className:`${f&&"fill-pink-500 text-pink-500"}`}),a!=="inbox"&&z.jsx(Bf,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),z.jsxs(o1,{className:`${V}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:Y,children:[z.jsx(r9,{className:"-mr-px"}),a!=="inbox"&&n>0&&cd(n)]}),z.jsxs(o1,{className:`${V} ${q&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${q?"Undo repost":"Repost"}`,variant:"ghost",onClick:J=>{J?.stopPropagation(),q?(C.mutate(t.id),N(w-1)):(L.mutate(t.id,{onError(){g(!1),N(w-1)}}),N(w+1)),g(!q)},children:[z.jsx(s9,{className:`${q&&"text-green-500"}`}),a!=="inbox"&&z.jsx(Bf,{className:w===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:w})]})]}),W&&z.jsx(c5,{open:W,replyTo:{object:t,actor:e},onOpenChange:J=>{v(J)},onReply:()=>{O?.(1),v(!1)},onReplyError:()=>{O?.(-1)}})]})};function ir0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const Lo=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||Po(e)}`)},pr0=e=>{const t=new Date,o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=o(t),r=o(new Date(t.getTime()-1440*60*1e3)),a=o(e);return a.getTime()===n.getTime()?Mr0(e):a.getTime()===r.getTime()?"Yesterday":br0(e)},Mr0=e=>{const o=Math.floor((new Date().getTime()-e.getTime())/1e3);if(o<1)return"Just now";if(o<60)return`${o}s`;const n=Math.floor(o/60);return n<60?`${n}m`:`${Math.floor(n/60)}h`},br0=e=>{const t=new Date,o=e.getDate(),n=e.toLocaleString("default",{month:"short"});return e.getFullYear()===t.getFullYear()?`${o} ${n}`:`${o} ${n} ${e.getFullYear()}`};function lr0(e){return new Date(e).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(e).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"})}function yi(e,t=!0){const o=new Date(e?.published??e?.createdAt??new Date),n=lr0(o),r=pr0(o);return t&&!e.url?.includes("/.ghost/activitypub")?z.jsx("a",{className:"whitespace-nowrap text-gray-700 hover:underline",href:e.url,rel:"noreferrer",target:"_blank",title:n,onClick:a=>a.stopPropagation(),children:r}):z.jsx("span",{className:"whitespace-nowrap text-gray-700",children:r})}function r5(e){let t;if(e.image&&(t=e.image),e.type==="Note"&&!t&&(t=e.attachment),!t)return null;if(Array.isArray(t)){if(t.length===0)return null;if(t.length===1)return t[0]}return t}function $c(e,t,o,n){const r=r5(e);if(!r)return null;const a=l=>u=>{u.stopPropagation(),t&&t(l)},i=l=>{n&&n(l)},b=(l,u=!1)=>{const O=u?"min-h-[200px]":"";return z.jsx("div",{className:`${l} ${O} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:z.jsx(SZ,{className:"text-gray-400",size:24,strokeWidth:1.5})})};if(Array.isArray(r)){const l=r.length;let u="";return l===1?u="grid-cols-1":l>=2&&l<=4?u="grid-cols-2 auto-rows-[150px]":l>4&&(u="grid-cols-3 auto-rows-[150px]"),z.jsx("div",{className:`attachment-gallery mt-3 grid w-full ${u} gap-2`,children:r.map((O,f)=>{const h=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${l===3&&f===0?"row-span-2":""}`;return o&&o.has(O.url)?b(h,l===1):z.jsx("img",{alt:O.name||`Image-${f}`,className:`${h} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:O.url,onClick:t?a(O.url):void 0,onError:()=>i(O.url)},O.url)})})}switch(r.mediaType){case"image/jpeg":case"image/png":case"image/gif":case"image/webp":return o&&o.has(r.url)?b(`${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,!0):z.jsx("img",{alt:r.name||"Image",className:`cursor-pointer ${e.type==="Article"?"w-full rounded-t-md":"mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10"}`,referrerPolicy:"no-referrer",src:r.url,onClick:t?a(r.url):void 0,onError:()=>i(r.url)});case"video/mp4":case"video/webm":return z.jsx("div",{className:"relative mb-4 mt-3",children:z.jsx("video",{className:"h-[300px] w-full rounded object-cover",src:r.url,controls:!0})});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:r.url,controls:!0})});default:if(e.image||r.type==="Image"){const l=e.type==="Article"?"cursor-pointer aspect-[16/7.55] w-full rounded-t-md object-cover":"cursor-pointer mt-3 max-h-[420px] rounded-md outline outline-1 -outline-offset-1 outline-black/10";let u;return e.image?typeof e.image=="string"?u=e.image:u=e.image?.url:u=r.url,o&&o.has(u)?b(l,!0):z.jsx("img",{alt:r.name||"Image",className:l,referrerPolicy:"no-referrer",src:u,onClick:t?a(u):void 0,onError:()=>i(u)})}return null}}function zr0(e,t){const o=r5(e),n="ml-8 md:ml-9 shrink-0 rounded-md h-[91px] w-[121px] relative",r=Z1("object-cover outline outline-1 -outline-offset-1 outline-black/[0.05]",n);if(t)return z.jsx(w1,{className:`${r} outline-0`});if(!o)return null;if(Array.isArray(o))return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o[0].url});switch(o.mediaType){case"image/jpeg":case"image/png":case"image/gif":return z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:o.url});case"video/mp4":case"video/webm":return z.jsxs("div",{className:n,children:[z.jsx("video",{className:"h-[80px] w-full rounded object-cover",src:o.url}),z.jsx("div",{className:"absolute inset-0 rounded bg-gray-900 opacity-50"}),z.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:z.jsx(oG,{color:"white",fill:"white",size:40})})]});case"audio/mpeg":case"audio/ogg":return z.jsx("div",{className:"ml-8 w-[120px]",children:z.jsx("div",{className:"relative mb-4 mt-2 w-full",children:z.jsx("audio",{className:"w-full",src:o.url,controls:!0})})});default:return e.image?z.jsx("img",{className:r,referrerPolicy:"no-referrer",src:typeof e.image=="string"?e.image:e.image?.url}):null}}const dA=()=>{},OA=z.jsx(s9,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),ur0=({actor:e,allowDelete:t=!1,object:o,parentId:n=void 0,layout:r,type:a,commentCount:i=0,repostCount:b=0,likeCount:l=0,showHeader:u=!0,last:O,isLoading:f,isPending:h=!1,isCompact:q=!1,isChainContinuation:g=!1,isChainParent:W=!1,onClick:v=dA,onDelete:y=dA,showStats:x=!0})=>{const k=new Date(o?.published??new Date).toLocaleDateString("default",{year:"numeric",month:"short",day:"2-digit"})+", "+new Date(o?.published??new Date).toLocaleTimeString("default",{hour:"2-digit",minute:"2-digit"}),[,L]=p.useState(!1),[C,w]=p.useState(new Set),N=p.useRef(null),[D,Y]=p.useState(!1),V=Rn0("index"),J=Jt(),t0=Kd("index",()=>{ve.success(`Followed ${X?.name}`)},()=>{ve.error("Failed to follow")}),K=Gd("index",()=>{ve.info(`Unfollowed ${X?.name}`)},()=>{ve.error("Failed to unfollow")});p.useEffect(()=>{const j0=N.current;j0&&Y(j0.scrollHeight>j0.clientHeight)},[o?.content]),p.useEffect(()=>{const j0=N.current;if(!j0)return;const p1=S=>{const r0=S.target.closest("a[data-profile]");if(r0){const A0=r0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(A0||"")&&A0&&(S.preventDefault(),S.stopPropagation(),Lo(A0,J))}};return j0.addEventListener("click",p1),()=>{j0.removeEventListener("click",p1)}},[J,o?.content]);const a0=()=>{},q0=()=>{h||v()},Z=()=>{V.mutate({id:o.id,parentId:n}),y()},z0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),L(!0),ve.success("Link copied"),setTimeout(()=>L(!1),2e3))},U=j0=>{w(p1=>new Set(p1).add(j0))};let X=e;a==="Announce"&&(X=typeof o.attributedTo=="object"?o.attributedTo:e);const G=X?Po(X):null,_=X?.followedByMe||!1,I=a==="Announce"?typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&"authored"in o.attributedTo?o.attributedTo.authored:typeof o.attributedTo=="object"&&o.attributedTo&&!Array.isArray(o.attributedTo)&&typeof e=="object"&&e&&o.attributedTo.id===e.id:o.authored,i0=a==="Announce"?o.reposted??!1:o.authored,d0=()=>{G&&t0.mutate(G)},m0=()=>{G&&K.mutate(G)},W0=z.jsx(o1,{className:`relative z-10 size-[34px] rounded-md ${r==="inbox"||r==="modal"?"text-gray-900 hover:text-gray-900 dark:text-gray-600 dark:hover:text-gray-600":"text-gray-500 hover:text-gray-500"} dark:bg-black dark:hover:bg-gray-950 [&_svg]:size-5`,"data-testid":"menu-button",variant:"ghost",children:z.jsx(n9,{})}),{lightboxState:s0,openLightbox:e0,closeLightbox:w0,navigateToIndex:x0}=sr0(o);return r==="feed"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative -mx-4 ${h?"pointer-events-none":"cursor-pointer"} rounded-lg p-6 px-4 pb-[18px]`,"data-layout":"feed","data-object-id":o.id,onClick:q0,children:[a==="Announce"&&z.jsxs("div",{className:"z-10 mb-2 flex items-center gap-1.5 text-gray-700 dark:text-gray-600",children:[OA,z.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[z.jsx(Eo,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"truncate break-anywhere hover:underline",onClick:j0=>{Lo(e,J,j0)},children:e.name})}),"reposted"]})]}),z.jsxs("div",{className:"border-1 flex flex-col gap-2.5","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(Xo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsx("span",{className:`min-w-0 truncate font-semibold break-anywhere ${q?"text-lg":"text-md"} ${h?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:f?z.jsx(w1,{className:"w-24"}):X.name}),z.jsxs("div",{className:"flex w-full text-md text-gray-700 dark:text-gray-600",children:[z.jsx("span",{className:`truncate ${h?"":"hover-underline"}`,children:f?z.jsx(w1,{className:"w-56"}):Po(X)}),z.jsx("div",{className:`ml-1 before:mr-1 ${!f&&'before:content-["·"]'}`,title:`${k}`,children:f?z.jsx(w1,{className:"w-4"}):yi(o,h===!1&&!o.authored)})]})]})]})}),z.jsx(Al,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"feed",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col",children:[z.jsx("div",{className:"",children:o.type==="Article"?z.jsxs("div",{className:"rounded-md border border-gray-150 transition-colors hover:bg-gray-75 dark:border-gray-950 dark:hover:bg-gray-950",children:[$c(o,q0,C,U),z.jsxs("div",{className:"p-5",children:[z.jsx("div",{className:"mb-1 line-clamp-2 text-pretty text-lg font-semibold leading-tight tracking-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{className:"line-clamp-3 leading-[1.4em] break-anywhere",children:o.preview?.content})]})]}):z.jsxs("div",{className:"relative",children:[z.jsx("div",{className:"ap-note-content line-clamp-[10] text-pretty leading-[1.4285714286] tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:f?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Fi(o.content||"")??""},ref:N,onClick:j0=>{const p1=j0.target;(p1.tagName==="A"||p1.closest("a"))&&j0.stopPropagation()}})}),D&&z.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),$c(o,e0,C,U)]})}),z.jsx("div",{className:"space-between relative z-[30] ml-[-8px] mt-1 flex",children:f?z.jsx(w1,{className:"ml-2 w-18"}):x&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]})]}),z.jsx(hl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="modal"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{"data-object-id":o.id,children:[z.jsxs("div",{className:"group/article relative","data-layout":"modal",onClick:q0,children:[z.jsxs("div",{className:"z-10 -my-1 grid grid-cols-[auto_1fr] grid-rows-[auto_1fr] gap-3 pb-3 pt-4","data-test-activity":!0,children:[u&&z.jsxs(z.Fragment,{children:[z.jsx("div",{className:"relative z-10 pt-[3px]",children:z.jsx(Xo,{author:X,showFollowButton:!I&&!_})}),z.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsxs("div",{className:"flex w-full",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] after:dark:text-gray-600',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:yi(o,!o.authored)})]}),z.jsx("div",{className:"flex w-full",children:z.jsx("span",{className:"min-w-0 truncate text-gray-700 dark:text-gray-600",children:Po(X)})})]})]}),z.jsx("div",{className:"relative z-10 col-start-1 col-end-3 w-full gap-4",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.name&&z.jsx(v2,{className:"mb-1 leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{dangerouslySetInnerHTML:{__html:Fi(o.content||"")??""},ref:N,className:"ap-note-content-large text-pretty text-[1.6rem] tracking-[-0.011em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),$c(o,e0,C,U),z.jsx("div",{className:"space-between ml-[-8px] mt-3 flex",children:x&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),z.jsx("div",{className:"absolute -inset-x-3 -inset-y-0 z-0 rounded transition-colors max-lg:hidden"})]}),z.jsx("div",{className:"mt-3 h-px bg-gray-200 dark:bg-gray-950"})]}),z.jsx(hl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="reply"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative ${q?"pb-6":g?"pb-5":"py-5"} ${h?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"border-1 flex flex-col gap-2.5 border-b-gray-200","data-test-activity":!0,children:[z.jsxs("div",{className:"flex items-center justify-between",children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(Xo,{author:X,disabled:h,showFollowButton:!I&&!_}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:j0=>{h||Lo(X,J,j0)},children:[z.jsxs("div",{className:"flex",children:[z.jsx("span",{className:'min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere after:mx-1 after:font-normal after:text-gray-700 after:content-["·"] dark:text-white',"data-test-activity-heading":!0,children:X.name}),z.jsx("div",{children:yi(o,h===!1&&!o.authored)})]}),z.jsx("div",{className:"flex",children:z.jsx("span",{className:"truncate text-gray-700",children:Po(X)})})]})]})}),!q&&z.jsx(Al,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:_,layout:"reply",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]}),z.jsx("div",{className:"relative z-10 col-start-2 col-end-3 w-full gap-4 pl-[52px]",children:z.jsxs("div",{className:"flex flex-col items-start",children:[o.type==="Article"&&$c(o,q0,C,U),o.name&&z.jsx(v2,{className:"mt-2.5 text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),o.preview&&o.type==="Article"?z.jsx("div",{className:"mt-1 line-clamp-3 leading-tight",children:o.preview.content}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Fi(o.content||"")??""},ref:N,className:"ap-note-content text-pretty tracking-[-0.006em] text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3"}),o.type==="Note"&&$c(o,e0,C,U),o.type==="Article"&&z.jsx(o1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!q&&z.jsx("div",{className:"space-between ml-[-8px] mt-2 flex",children:x&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),!O&&z.jsx("div",{className:`absolute left-[19px] ${q?"bottom-[8px] top-[51px]":g?"bottom-[5px] top-[51px]":W?"bottom-[5px] top-[71px]":"bottom-[-7px] top-[71px]"} z-0 w-[2px] rounded-sm bg-gray-200 dark:bg-gray-950`})]}),z.jsx(hl,{currentIndex:s0.currentIndex,images:s0.images,isOpen:s0.isOpen,onClose:w0,onNavigate:x0})]}):r==="inbox"?z.jsx(z.Fragment,{children:o&&z.jsxs("div",{className:"group/article relative -mx-4 -my-px flex min-h-[112px] min-w-0 cursor-pointer items-center justify-between rounded-lg p-6 hover:bg-gray-75 dark:hover:bg-gray-950/50","data-layout":"inbox","data-object-id":o.id,onClick:q0,children:[z.jsxs("div",{className:"w-full min-w-0",children:[z.jsx("div",{className:"z-10 mb-1.5 flex w-full min-w-0 items-center gap-1.5 text-sm group-hover/article:border-transparent",children:f?z.jsx(w1,{className:"w-24"}):z.jsxs(z.Fragment,{children:[z.jsx(Eo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex items-center gap-1",children:[z.jsx(Xo,{author:X,size:"2xs"}),z.jsx("span",{className:"min-w-0 font-semibold text-gray-900 break-anywhere hover:underline dark:text-gray-600","data-test-activity-heading":!0,onClick:j0=>{Lo(X,J,j0)},children:X.name})]})}),a==="Announce"&&z.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[OA,z.jsx(Eo,{actor:e,align:"center",isCurrentUser:i0,children:z.jsx("span",{className:"line-clamp-1 hover:underline",onClick:j0=>{Lo(e,J,j0)},children:e.name})})," reposted"]}),z.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${k}`,children:yi(o,!o.authored)})]})}),z.jsxs("div",{className:"flex",children:[z.jsxs("div",{className:"flex min-h-[73px] w-full min-w-0 flex-col items-start justify-start gap-1",children:[z.jsx(v2,{className:"line-clamp-2 w-full max-w-[600px] text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:f?z.jsx(w1,{className:"w-full max-w-96"}):o.name?o.name:z.jsx("span",{dangerouslySetInnerHTML:{__html:_z(o.content||"")}})}),z.jsx("div",{className:"ap-note-content line-clamp-2 w-full max-w-[600px] text-pretty text-base leading-normal text-gray-900 break-anywhere dark:text-gray-300 [&_p+p]:mt-3",children:f?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:_z(o.preview?.content??o.content??"")}})}),z.jsx("span",{className:"mt-1 shrink-0 whitespace-nowrap text-sm leading-none text-gray-600",children:f?z.jsx(w1,{className:"w-16"}):o.content&&`${ir0(o.content)}`})]}),z.jsxs("div",{className:"invisible absolute right-3 top-8 z-[49] flex -translate-y-1/2 rounded-lg bg-white p-1 shadow-md group-hover/article:visible dark:bg-black",children:[x&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0}),z.jsx(Al,{allowDelete:t,authoredByMe:I,followedByMe:_,layout:"inbox",trigger:W0,onCopyLink:z0,onDelete:Z,onFollow:d0,onUnfollow:m0})]})]})]}),zr0(o,f)]})}):z.jsx(z.Fragment,{})},fA=5*1024*1024,AA="Image must be less than 5MB in size.",na0=async e=>{try{const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Error(`Failed to fetch image: ${t.status}`);const o=await t.blob();return new Promise((n,r)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=r,a.readAsDataURL(o)})}catch{return e}},ra0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),ca0="Image must be square.",c5=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...a})=>{const{data:i}=mn0("index"),b=vn0("index",i),l=Wn0("index",i),{data:u,isLoading:O}=Yd("index","me"),[f,h]=p.useState(!1),q=p.useRef(null),g=p.useRef(null),[W,v]=p.useState(null),[y,x]=p.useState(!1),k=p.useRef(null),[L,C]=p.useState(""),[w,N]=p.useState(null),[D,Y]=p.useState(""),[V,J]=p.useState(!1),[t0,K]=p.useState(!1),[a0,q0]=p.useState(!1),Z=Jt(),z0=500;p.useEffect(()=>{a.open!==void 0&&h(a.open)},[a.open]),p.useEffect(()=>{if(a.open!==void 0?a.open:f){const w0=setTimeout(()=>{q0(!0)},300);return()=>clearTimeout(w0)}else q0(!1)},[f,a.open]);const U=!L.trim()||!i||t0||L.length>z0,X=p.useCallback(async()=>{const e0=L.trim();if(!(!e0||!i))try{K(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:e0,imageUrl:w||void 0,altText:D||void 0}),o?.()):(await b.mutateAsync({content:e0,imageUrl:w||void 0,altText:D||void 0}),Z("/notes")),h(!1),r&&r(!1),ve.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{K(!1)}},[L,i,t,l,b,w,D,o,n,h,Z,r]),G=e0=>{C(e0.target.value)};p.useEffect(()=>{q.current&&(q.current.style.height="auto",q.current.style.height=`${q.current.scrollHeight}px`)},[L]),p.useEffect(()=>{if((a.open!==void 0?a.open:f)&&q.current){const w0=setTimeout(()=>{q.current?.focus()},100);return()=>clearTimeout(w0)}},[f,a.open]),p.useEffect(()=>{if(V&&g.current){const e0=setTimeout(()=>{g.current?.focus()},100);return()=>clearTimeout(e0)}},[V]),p.useEffect(()=>{const e0=x0=>{(x0.metaKey||x0.ctrlKey)&&x0.key==="Enter"&&(x0.preventDefault(),!U&&!y&&X())};if(a.open!==void 0?a.open:f)return document.addEventListener("keydown",e0),()=>document.removeEventListener("keydown",e0)},[f,a.open,U,y,X]);const _=p.useCallback(async e0=>{const w0=e0.clipboardData?.items;if(w0)for(let x0=0;x0<w0.length;x0++){const j0=w0[x0];if(j0.type.indexOf("image")!==-1){e0.preventDefault();const p1=j0.getAsFile();if(p1){if(p1.size>fA){ve.error(AA);return}const S=URL.createObjectURL(p1);v(S),await I(p1)}break}}},[]);p.useEffect(()=>{if(a.open!==void 0?a.open:f)return document.addEventListener("paste",_),()=>document.removeEventListener("paste",_)},[f,a.open,_]);const I=async e0=>{try{x(!0);const w0=await yn0(e0);N(w0)}catch(w0){v(null);let x0="Failed to upload image. Try again.";if(w0&&typeof w0=="object"&&"statusCode"in w0)switch(w0.statusCode){case 413:x0="Image size exceeds limit.";break;case 415:x0="The file type is not supported.";break}ve.error(x0)}finally{x(!1)}},i0=async e0=>{const w0=e0.target.files;if(w0&&w0.length>0){const x0=w0[0];if(x0.size>fA){ve.error(AA),e0.target.value="";return}const j0=URL.createObjectURL(x0);v(j0),await I(x0)}},d0=e0=>{e0.stopPropagation(),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")},m0=e0=>{e0.stopPropagation(),J(!V)},W0=()=>{q.current?.focus()};p.useEffect(()=>()=>{W&&URL.revokeObjectURL(W)},[W]);let s0="What's new?";if(t){const e0=t.object.attributedTo||{};typeof e0=="object"&&"preferredUsername"in e0&&"id"in e0&&(s0=`Reply to ${Po(e0)}...`)}return z.jsxs(q3,{open:a.open!==void 0?a.open:f,onOpenChange:e0=>{e0&&(C(""),v(null),N(null),Y(""),J(!1),W&&URL.revokeObjectURL(W),k.current&&(k.current.value="")),h(e0),r&&r(e0)},...a.open!==void 0?{}:a,children:[z.jsx(H9,{asChild:!0,children:e}),z.jsxs(Ta,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:e0=>e0.stopPropagation(),children:[z.jsxs(hd,{className:"hidden",children:[z.jsx(md,{children:t?"Reply":"New note"}),z.jsx(V9,{children:"Post your thoughts to the Social web"})]}),t&&z.jsx(ur0,{actor:t.actor,allowDelete:!1,commentCount:t.object.replyCount??0,isCompact:!0,layout:"reply",likeCount:t.object.likeCount??0,object:t.object,repostCount:t.object.repostCount??0,type:t.object.type==="Article"?"Article":"Note",onClick:()=>{}}),z.jsxs("div",{className:`flex ${W?"":"min-h-36"} cursor-text items-start gap-3`,onClick:W0,children:[z.jsx("div",{className:"sticky top-0",children:z.jsx(Xo,{author:i})}),z.jsx(GP,{asChild:!0,children:z.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[O?z.jsx(w1,{className:"w-10"}):z.jsx("span",{className:"min-w-0 truncate whitespace-nowrap font-semibold text-black break-anywhere dark:text-white",children:u?.name}),z.jsx(R6,{name:"content",asChild:!0,children:z.jsx(y6,{asChild:!0,children:z.jsx("textarea",{ref:q,autoFocus:!0,className:"ap-textarea w-full resize-none bg-transparent text-[1.5rem] break-anywhere","data-testid":"note-textarea",placeholder:s0,rows:1,value:L,onChange:G,onPaste:_})})}),z.jsx(R6,{name:"image",asChild:!0,children:z.jsx(y6,{asChild:!0,children:z.jsx("input",{ref:k,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:i0})})})]})})]}),W&&z.jsxs("div",{className:"group relative mt-6 flex min-h-[200px] w-full items-center justify-center",children:[z.jsx("img",{alt:"Image attachment preview",className:`max-h-[320px] w-full rounded-sm object-cover outline outline-1 -outline-offset-1 outline-black/10 ${y&&"opacity-10"}`,src:W}),y&&z.jsx("div",{className:"absolute leading-[0]",children:z.jsx(Ap,{size:"md"})}),z.jsx(o1,{className:"absolute right-3 top-3 size-8 bg-black/60 text-white opacity-0 hover:bg-black/80 group-hover:opacity-100",onClick:d0,children:z.jsx(M9,{})}),!y&&z.jsx(o1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${V?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:m0,children:"Alt"})]}),W&&!y&&V&&z.jsx("div",{className:"mt-1",children:z.jsx(k3,{ref:g,className:"w-full border-0 bg-transparent px-0 focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Type alt text for image (optional)",type:"text",value:D,onChange:e0=>Y(e0.target.value)})}),z.jsxs(qd,{className:`${a0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[z.jsx(o1,{className:"mr-auto w-[34px] !min-w-0",variant:"outline",onClick:()=>k.current?.click(),children:z.jsx(PZ,{})}),z.jsxs("div",{className:"flex items-center space-x-3",children:[z.jsxs("div",{className:`text-sm ${L.length>=z0?"text-red-500":L.length>=z0*.9?"text-yellow-600":"text-gray-500"}`,children:[L.length,"/",z0]}),z.jsx(o1,{className:"min-w-16","data-testid":"post-button",disabled:U||y,onClick:X,children:t0?z.jsx(Ap,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function Ez(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function dr0(e,t){const o=Ez(e);return JSON.stringify({...o,...t})}const ov=()=>{const{data:e}=ye(),{mutateAsync:t}=iW(),o=b0.useMemo(()=>e?.accessibility?Ez(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=b0.useCallback(async r=>{if(!e)return;const a=Ez(e.accessibility),i=dr0(e.accessibility,{apOnboarding:{...a.apOnboarding,...r}});await t({...e,accessibility:i})},[e,t]);return{isOnboarded:!!o.welcomeStepsFinished,isExplainerClosed:!!o.exploreExplainerClosed,setOnboarded:r=>n({welcomeStepsFinished:r}),setExplainerClosed:r=>n({exploreExplainerClosed:r})}},nv=()=>z.jsx("div",{className:"h-full pt-14",children:z.jsx(Nr,{})}),Or0=Object.freeze(Object.defineProperty({__proto__:null,default:nv,useOnboardingStatus:ov},Symbol.toStringTag,{value:"Module"})),fr0=()=>{const e=Jt();function t(){e(`/notes/${encodeURIComponent("https://activitypub.ghost.org/.ghost/activitypub/note/6d6d7f57-b656-4caa-ba9e-efa1d9a4b3fb")}`)}return z.jsxs("div",{className:"z-20 w-full bg-white dark:bg-black",children:[z.jsxs("div",{className:"flex w-full flex-col gap-0.5 border-t border-gray-200 bg-white px-3 pt-6 dark:border-gray-950 dark:bg-black",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx($Z,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Beta feedback"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Something not working? Let us know"}),z.jsx(o1,{className:"mt-2 dark:bg-gray-925/70 dark:hover:bg-gray-900",variant:"secondary",onClick:t,children:"Send feedback"})]}),z.jsxs("div",{className:"-mb-1 ml-3 flex items-center gap-1.5 pb-2 pt-4 text-xs text-gray-400",children:[z.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://ghost.org/help/social-web/",rel:"noreferrer",target:"_blank",children:"Help"}),"⋅",z.jsx("a",{className:"text-xs font-medium text-gray-700 hover:text-black dark:text-gray-600 dark:hover:text-white",href:"https://activitypub.ghost.org/archive",rel:"noreferrer",target:"_blank",children:"Updates"})]})]})},wp=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const a=b0.Children.toArray(e),i=z.jsx("div",{className:`relative flex w-full max-w-[620px] cursor-pointer flex-col before:absolute before:inset-x-[-16px] before:inset-y-[-1px] before:rounded-md before:bg-gray-50 before:transition-opacity hover:z-10 hover:cursor-pointer hover:border-b-transparent hover:before:opacity-100 dark:before:bg-gray-950 ${r?"z-10 before:opacity-100":"before:opacity-0"}`,"data-testid":n,onClick:()=>{!t&&o&&o()},children:z.jsxs("div",{className:"relative z-10 flex w-full items-center gap-3 py-3",children:[a[0],a[1],a[2]]})});return t?z.jsx("a",{href:t,rel:"noreferrer",target:"_blank",onClick:b=>{o&&(b.preventDefault(),o())},children:i}):i},Ar0=()=>{const e=Jt(),{suggestedProfilesQuery:t}=Jd("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:a}=Yp(),i="[@media(max-height:740px)]:hidden";return!n&&(!o||o.length===0)?null:z.jsxs("div",{className:`border-t border-gray-200 px-3 pt-6 dark:border-gray-950 ${i}`,children:[z.jsxs("div",{className:"mb-3 flex flex-col gap-0.5",children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(lp,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(v2,{children:"Follow suggestions"})]}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Accounts you might be interested in"})]}),z.jsx("ul",{className:"grow",children:r.map((b,l)=>{const u=b?.id||`loading-${l}`,O=b?.name||"",f=b?.handle||"",h=b?.avatarUrl||"";let q;switch(l){case 0:q="[@media(max-height:740px)]:hidden";break;case 1:q="[@media(max-height:800px)]:hidden";break;case 2:q="[@media(max-height:860px)]:hidden";break}return z.jsx(p.Fragment,{children:z.jsx("li",{className:q,children:z.jsx(Eo,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(wp,{onClick:()=>{!n&&b&&Lo(b,e)},children:[n?z.jsx(w1,{className:"z-10 size-10"}):z.jsx(Xo,{author:{icon:{url:h},name:O,handle:f},showFollowButton:!0}),z.jsxs("div",{className:"flex min-w-0 flex-col",children:[z.jsx("span",{className:"block max-w-[190px] truncate font-semibold text-black dark:text-white",children:n?z.jsx(w1,{className:"w-24"}):O}),z.jsx("span",{className:"block max-w-[190px] truncate text-sm text-gray-700 dark:text-gray-600",children:n?z.jsx(w1,{className:"w-40"}):f})]})]})})})},u)},u)})}),z.jsx(o1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{a(),e("/explore")},children:"Find more →"})]})},hr0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},i=Jt();return z.jsx(Eo,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(wp,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[z.jsx(Xo,{author:{icon:{url:e.avatarUrl},name:e.name,handle:e.handle},onClick:()=>n?.(!1)}),z.jsxs("div",{className:"flex grow flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:o?z.jsx(w1,{className:"w-full max-w-64"}):e.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:o?z.jsx(w1,{className:"w-24"}):e.handle})]}),o?z.jsx("div",{className:"inline-flex items-center",children:z.jsx(w1,{className:"w-12"})}):z.jsx(n5,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:a})]},e.id)})})},qr0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=Jd("index",5),{data:n=[],isLoading:r}=t;return!r&&(!n||n.length===0)?null:z.jsx("div",{className:"mb-[-15px] flex flex-col gap-3 pt-2",children:z.jsx("div",{className:"flex flex-col",children:(r?Array(5).fill(null):n||[]).map((a,i)=>z.jsx(b0.Fragment,{children:z.jsx(hr0,{isLoading:r,profile:a||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},a?.id||`loading-${i}`))})})};function mr0(e,t,o,n){var r=this,a=p.useRef(null),i=p.useRef(0),b=p.useRef(0),l=p.useRef(null),u=p.useRef([]),O=p.useRef(),f=p.useRef(),h=p.useRef(e),q=p.useRef(!0);h.current=e;var g=typeof window<"u",W=!t&&t!==0&&g;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(o=o||{}).leading,y=!("trailing"in o)||!!o.trailing,x="maxWait"in o,k="debounceOnServer"in o&&!!o.debounceOnServer,L=x?Math.max(+o.maxWait||0,t):null;p.useEffect(function(){return q.current=!0,function(){q.current=!1}},[]);var C=p.useMemo(function(){var w=function(K){var a0=u.current,q0=O.current;return u.current=O.current=null,i.current=K,b.current=b.current||K,f.current=h.current.apply(q0,a0)},N=function(K,a0){W&&cancelAnimationFrame(l.current),l.current=W?requestAnimationFrame(K):setTimeout(K,a0)},D=function(K){if(!q.current)return!1;var a0=K-a.current;return!a.current||a0>=t||a0<0||x&&K-i.current>=L},Y=function(K){return l.current=null,y&&u.current?w(K):(u.current=O.current=null,f.current)},V=function K(){var a0=Date.now();if(v&&b.current===i.current&&J(),D(a0))return Y(a0);if(q.current){var q0=t-(a0-a.current),Z=x?Math.min(q0,L-(a0-i.current)):q0;N(K,Z)}},J=function(){n&&n({})},t0=function(){if(g||k){var K=Date.now(),a0=D(K);if(u.current=[].slice.call(arguments),O.current=r,a.current=K,a0){if(!l.current&&q.current)return i.current=a.current,N(V,t),v?w(a.current):f.current;if(x)return N(V,t),w(a.current)}return l.current||N(V,t),f.current}};return t0.cancel=function(){var K=l.current;K&&(W?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=O.current=l.current=null,K&&n&&n({})},t0.isPending=function(){return!!l.current},t0.flush=function(){return l.current?Y(Date.now()):f.current},t0},[v,x,t,L,y,W,g,k,n]);return C}function gr0(e,t){return e===t}function Wr0(e,t,o){var n=gr0,r=p.useRef(e),a=p.useState({})[1],i=mr0(p.useCallback(function(l){r.current=l,a({})},[a]),t,o,a),b=p.useRef(e);return n(b.current,e)||(i(e),b.current=e),[r.current,i]}const wi=80,vr0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),a=p.useRef(0),i=Jt(),[b]=Wr0(t,300),l=t.length>=2,{searchQuery:u,updateAccountSearchResult:O}=gn0("index",l?b:""),{data:f,isFetching:h,isFetched:q}=u,{suggestedProfilesQuery:g}=Jd("index",5),{data:W,isLoading:v}=g,y=v||W&&W.length>0,{topicsQuery:x}=e5(),{data:k}=x,L=Yd("index","me"),{data:C}=L,[w,N]=p.useState([]),[D,Y]=p.useState(null),[V,J]=p.useState(0),t0=p.useMemo(()=>{const X=k?.topics||[];if(!l||X.length===0)return[];const G=t.toLowerCase();return X.filter(_=>_.slug==="following"?!1:_.name.toLowerCase().startsWith(G)||_.slug.toLowerCase().startsWith(G))},[t,l,k?.topics]),K=p.useMemo(()=>[...t0.map(X=>({type:"topic",data:X})),...w.map(X=>({type:"account",data:X}))],[t0,w]);p.useEffect(()=>{if(!l){N([]),Y(null);return}q&&(f?.accounts&&f.accounts.length>0?(N(f.accounts),Y("results"),J(0)):(N([]),Y("none"),J(0)))},[f?.accounts,q,l]);const a0=h&&l,q0=t.length<2||!D&&l&&t0.length===0,Z=!q0&&D==="none"&&t0.length===0,z0=!q0&&(w.length>0||t0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const X=r.current[V];if(!X)return;const G=X.closest("[data-radix-scroll-area-viewport]")||X.closest(".overflow-y-auto");if(!G){X.scrollIntoView({block:"nearest"});return}const _=G.getBoundingClientRect(),I=X.getBoundingClientRect();I.top<_.top+wi?G.scrollTo({top:G.scrollTop-(_.top+wi-I.top),behavior:"smooth"}):I.bottom>_.bottom-wi&&G.scrollTo({top:G.scrollTop+(I.bottom-_.bottom+wi),behavior:"smooth"})},[V]);const U=X=>{if(!(!z0||K.length===0)){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const G=Date.now();if(G-a.current<50)return;a.current=G,X.key==="ArrowDown"?J(_=>(_+1)%K.length):J(_=>(_-1+K.length)%K.length)}else if(X.key==="Enter"){const G=K[V];if(!G)return;X.preventDefault(),e?.(!1),G.type==="topic"?i(`/explore/${G.data.slug}`):i(`/profile/${G.data.handle}`)}}};return z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:'sticky -top-6 z-30 -mt-6 flex h-[72px] shrink-0 items-center gap-2 bg-white pb-2 pt-3 before:pointer-events-none before:absolute before:-inset-x-6 before:bottom-0 before:h-0 before:border-b before:border-b-gray-150 before:content-[""] dark:bg-[#101114] dark:before:border-b-gray-950',children:[z.jsx(id,{className:"text-gray-600",size:18,strokeWidth:1.5}),z.jsx(k3,{ref:n,autoComplete:"off",className:"flex h-10 w-full items-center rounded-lg border-0 bg-transparent px-0 py-1.5 text-lg focus-visible:border-0 focus-visible:bg-transparent focus-visible:shadow-none focus-visible:outline-0 dark:bg-[#101114] dark:text-white dark:placeholder:text-gray-800",placeholder:"Search by name, handle, or URL...",title:"Search",type:"text",value:t,onChange:X=>o(X.target.value),onKeyDown:U}),a0&&z.jsx(Ap,{className:"!absolute right-0 mr-0.5 shrink-0",size:"sm"})]}),z.jsxs("div",{className:"h-full",children:[Z&&z.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:z.jsxs(U00,{children:[z.jsx(V00,{children:z.jsx(pd,{})}),"No users matching this handle or account URL"]})}),z0&&z.jsx("div",{className:"mt-[-14px] pb-2",children:K.map((X,G)=>{const _=G===V;if(X.type==="topic")return z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(wp,{isSelected:_,onClick:()=>{e?.(!1),i(`/explore/${X.data.slug}`)},children:[z.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-gray-100 dark:bg-gray-900",children:z.jsx(lp,{className:"text-gray-700 dark:text-gray-500",size:18,strokeWidth:1.5})}),z.jsxs("div",{className:"flex flex-col",children:[z.jsx("span",{className:"font-semibold text-black dark:text-white",children:X.data.name}),z.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-600",children:"Topic"})]})]})},X.data.slug);const I=X.data,i0=I.handle===C?.handle;return z.jsx(Eo,{actor:I,align:"center",isCurrentUser:i0,side:"left",children:z.jsx("div",{ref:d0=>r.current[G]=d0,children:z.jsxs(wp,{isSelected:_,onClick:()=>{e?.(!1),i(`/profile/${I.handle}`)},children:[z.jsx(Xo,{author:{icon:{url:I.avatarUrl},name:I.name,handle:I.handle}}),z.jsxs("div",{className:"flex flex-col break-anywhere",children:[z.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:I.name}),z.jsx("span",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-600",children:I.handle})]}),I.blockedByMe||I.domainBlockedByMe?z.jsx(o1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):i0?null:z.jsx(n5,{className:"ml-auto",following:I.followedByMe,handle:I.handle,type:"secondary",onFollow:()=>O(I.id,{followedByMe:!0}),onUnfollow:()=>O(I.id,{followedByMe:!1})})]})})},I.id)})}),q0&&y&&z.jsxs(z.Fragment,{children:[z.jsx(v2,{children:"More people to follow"}),z.jsx(qr0,{onOpenChange:e})]})]})]})},Rr0=()=>z.jsxs("div",{className:"inline-flex h-9 w-full items-center justify-start gap-2 rounded-full bg-gray-100 px-3 text-md font-normal text-gray-600 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-925/70 dark:text-gray-700 dark:hover:bg-gray-925 [&_svg]:size-[18px]",children:[z.jsx(id,{size:18,strokeWidth:1.5})," Search the social web"]}),Wn=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const a=we(),{resetStack:i}=Yp(),b=Q3(),l=e&&e.startsWith("/")?`${b}${e}`:e,u=l&&(a.pathname===l||a.pathname.startsWith(`${l}/`)),O=g0("justify-start text-md font-medium text-gray-800 dark:hover:bg-gray-925/70 dark:text-gray-500 h-9 [&_svg]:size-[18px]",u&&"bg-gray-100 dark:bg-gray-925/70 dark:text-white text-black font-semibold"),f=o&&o>0?z.jsx("span",{className:g0("ml-auto bg-purple-500 text-white text-xs font-semibold py-1 px-1.5 rounded-full min-w-[20px] h-5 flex items-center justify-center"),children:cd(o)}):null;return l?z.jsx(o1,{className:O,variant:"ghost",asChild:!0,children:z.jsxs(Ba,{to:l,onClick:()=>{i(),h10(l)},children:[t,f]})}):z.jsxs(o1,{ref:r,className:O,variant:"ghost",onClick:n.onClick,...n,children:[t,f]})});Wn.displayName="SidebarMenuLink";const rv=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=nr0(),[n,r]=p.useState(!1),[a,i]=p.useState(""),{data:b}=ye(),l=we(),u=Q3(),{data:O}=KW(b?.slug||""),f=wn0(b?.slug||""),{topicsQuery:h}=e5(),{data:q,isLoading:g}=h,W=!g&&q&&q.topics.length===0;p.useEffect(()=>{l.pathname===`${u}/notifications`&&O&&O>0&&f.mutate()},[l.pathname,u,O,f]);const v=p.useCallback(()=>{O&&O>0&&f.mutate()},[O,f]);return z.jsx("div",{className:`sticky top-0 flex min-h-screen w-[320px] flex-col border-l border-gray-200 pr-8 transition-transform duration-300 ease-in-out max-lg:fixed max-lg:inset-y-0 max-lg:right-0 max-lg:z-50 max-lg:border-0 max-lg:bg-white max-lg:shadow-xl max-md:bottom-[72px] max-md:min-h-[auto] max-md:overflow-y-scroll dark:border-gray-950 max-lg:dark:bg-black ${e?"max-lg:translate-x-0":"max-lg:translate-x-full"}`,children:z.jsxs("div",{className:"flex grow flex-col justify-between",children:[z.jsxs("div",{className:"isolate flex w-full flex-col items-start gap-6 pl-6 pt-6",children:[z.jsx("div",{className:"flex h-[52px] w-full items-center",children:z.jsxs(q3,{open:n,onOpenChange:r,children:[z.jsx(H9,{className:"mt-0.5 w-full",children:z.jsx(Rr0,{})}),z.jsx(Ta,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:z.jsx(vr0,{query:a,setQuery:i,onOpenChange:r})})]})}),z.jsxs("div",{className:"flex w-full flex-col gap-px",children:[z.jsxs(Wn,{to:"/reader",children:[z.jsx(cZ,{size:18,strokeWidth:1.5}),"Reader"]}),z.jsxs(Wn,{to:"/notes",children:[z.jsx(r9,{size:18,strokeWidth:1.5}),"Notes"]}),z.jsxs(Wn,{count:l.pathname!==`${u}/notifications`?O:void 0,to:"/notifications",onClick:v,children:[z.jsx(nZ,{size:18,strokeWidth:1.5}),"Notifications"]}),W?z.jsx(o1,{className:"inline-flex w-full items-center gap-2 rounded-sm px-3 py-2.5 text-left text-md font-medium text-gray-800 transition-colors hover:bg-gray-100 dark:text-gray-500 dark:hover:bg-gray-925/70",variant:"ghost",asChild:!0,children:z.jsxs("a",{href:"https://explore.ghost.org/social-web",rel:"noopener noreferrer",target:"_blank",children:[z.jsx(lp,{size:18,strokeWidth:1.5}),"Explore",z.jsx(sd,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):z.jsxs(Wn,{to:"/explore",children:[z.jsx(lp,{size:18,strokeWidth:1.5}),"Explore"]}),z.jsxs(Wn,{to:"/profile",children:[z.jsx(Md,{size:18,strokeWidth:1.5}),"Profile"]}),z.jsxs(Wn,{to:"/preferences",children:[z.jsx(pG,{size:18,strokeWidth:1.5}),"Preferences"]})]}),z.jsx(c5,{children:z.jsxs(o1,{className:"h-9 rounded-full bg-purple-500 px-3 text-md text-white hover:bg-purple-600 dark:hover:bg-purple-600",children:[z.jsx(wZ,{}),"New note"]})}),z.jsx(Ar0,{}),t.map(y=>o[y]?z.jsxs("div",{className:"flex items-center justify-between gap-1 pl-3 opacity-50",children:[z.jsx("span",{className:"font-mono text-xs",children:y}),z.jsx("span",{className:"text-green-800 inline-flex items-center rounded bg-green-100 px-1 py-0.5 text-xs font-medium",children:"ON"})]},y):z.jsx(z.Fragment,{}))]}),z.jsx("div",{className:"sticky bottom-0 flex items-center gap-2 bg-white pb-4 pl-4 dark:bg-black",children:z.jsx(fr0,{})})]})})};rv.displayName="Sidebar";const yr0=({children:e,...t})=>{const{isOnboarded:o}=ov(),n=Q3(),{data:r,isLoading:a}=ye(),i=p.useRef(null),[b,l]=p.useState(!1),u=ev(),{topicsQuery:O}=e5(),{data:f}=O,h=f&&f.topics.length>0,{isNewNoteModalOpen:q,setIsNewNoteModalOpen:g}=tv(),W=()=>{l(!b)},v=()=>{l(!1)};return a||!r?null:o?z.jsxs("div",{ref:i,className:`h-screen w-full ${o&&"overflow-y-auto"}`,"data-scrollable-container":!0,children:[z.jsx(q10,{containerRef:i}),z.jsx("div",{className:"relative mx-auto flex max-w-page flex-col",...t,children:o?z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:"block grid-cols-[auto_320px] items-start lg:grid",children:[z.jsxs("div",{className:"z-0 min-w-0",children:[z.jsx(ar0,{showBorder:!(u==="reader"&&h)&&u!=="explore",onToggleMobileSidebar:W}),z.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),z.jsx(rv,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&z.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):z.jsx(nv,{})}),z.jsx(c5,{open:q,onOpenChange:g})]}):z.jsx(vr,{to:`${n}/welcome`,replace:!0})},Qc=({children:e})=>z.jsx("div",{className:"flex max-h-12 max-w-12 grow-0 items-center justify-center rounded-full bg-gray-100 p-3 text-gray-700 dark:bg-gray-925/70 [&_svg]:size-8 [&_svg]:stroke-1",children:e}),Zc=({children:e,className:t})=>z.jsx("div",{className:`mx-auto mt-[24vh] flex max-w-[500px] flex-col items-center gap-5 text-center text-gray-700 ${t||""}`,children:e}),cv=({statusCode:e,errorCode:t})=>{const o=z7(),n=oW(),r=a=>{a.preventDefault(),n("/analytics/",{crossApp:!0})};return o?z.jsx(yr0,{children:z.jsxs(Zc,{children:[z.jsx(Qc,{children:z.jsx(aG,{})}),z.jsx(v2,{className:"-mb-4",children:"Oops, page not found!"}),z.jsx("div",{children:"We couldn't find the page you were looking for. It may have been moved, deleted, or never existed in the first place."})]})}):e===429?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(fG,{})}),z.jsx(v2,{className:"-mb-4",children:"Rate limit exceeded"}),z.jsx("div",{children:"You've made too many requests. Please try again in a moment."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===403?t==="ROLE_MISSING"||t==="SITE_MISSING"?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(i9,{})}),z.jsx(v2,{className:"-mb-4",children:"Site not configured correctly"}),z.jsx("div",{children:"This feature can't be used because the site isn't set up correctly. If you manage this site, check your settings or server logs, or contact support."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(tZ,{})}),z.jsx(v2,{className:"-mb-4",children:"Account suspended"}),z.jsx("div",{children:"Your account has been suspended due to policy violations."}),z.jsx(o1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):e===410&&t==="INVALID_VERSION"?z.jsxs(Zc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Qc,{children:z.jsx(mZ,{})}),z.jsx(v2,{className:"-mb-4",children:"New version available"}),z.jsx("div",{children:"We've made some updates! Refresh your page to see what's new"}),z.jsx(o1,{asChild:!0,children:z.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Refresh your page"})})]}):z.jsx("div",{className:"admin-x-container-error",children:z.jsxs("div",{className:"admin-x-error max-w-xl",children:[z.jsx("h1",{children:"Loading interrupted"}),z.jsx("p",{children:"They say life is a series of trials and tribulations. This moment right here? It's a tribulation. Our app was supposed to load, and yet here we are. Loadless. Click back to the dashboard to try again."}),z.jsx("a",{className:"cursor-pointer text-green",onClick:r,children:"← Back to the homepage"})]})})},wr0=Object.freeze(Object.defineProperty({__proto__:null,default:cv},Symbol.toStringTag,{value:"Module"})),Lr0="activitypub",av=[{path:Lr0,element:z.jsx(Nr,{}),errorElement:z.jsx(cv,{}),handle:"activitypub-basepath",children:[{index:!0,element:z.jsx(vr,{to:"reader"})},{path:"inbox",element:z.jsx(vr,{to:"../reader",replace:!0})},{path:"feed",element:z.jsx(vr,{to:"../notes",replace:!0})},{path:"reader",lazy:h1(()=>z1(()=>import("./index-DG8f-HuU.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),pageTitle:"Reader"},{path:"reader/:postId",lazy:h1(()=>z1(()=>import("./index-DG8f-HuU.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),pageTitle:"Reader"},{path:"notes",lazy:h1(()=>z1(()=>import("./feed-DsCVb1SA.js"),__vite__mapDeps([7,8]))),pageTitle:"Notes"},{path:"notes/:postId",lazy:h1(()=>z1(()=>import("./note-CiBzkHzz.js"),__vite__mapDeps([9,2,3,8]))),pageTitle:"Note"},{path:"notifications",lazy:h1(()=>z1(()=>import("./index-DItZTRQ4.js"),__vite__mapDeps([10,11,12,13]))),pageTitle:"Notifications"},{path:"explore",lazy:h1(()=>z1(()=>import("./index-BwY94Fb4.js"),__vite__mapDeps([14,4,15]))),pageTitle:"Explore"},{path:"explore/:topic",lazy:h1(()=>z1(()=>import("./index-BwY94Fb4.js"),__vite__mapDeps([14,4,15]))),pageTitle:"Explore"},{path:"profile",lazy:h1(()=>z1(()=>import("./index-CuQ_II0e.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/likes",lazy:h1(()=>z1(()=>import("./index-CuQ_II0e.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/following",lazy:h1(()=>z1(()=>import("./index-CuQ_II0e.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/followers",lazy:h1(()=>z1(()=>import("./index-CuQ_II0e.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:h1(()=>z1(()=>import("./index-CuQ_II0e.js"),__vite__mapDeps([16,17,18,11,19,20,21,22,23,24,25,8,6,1,26,12,27,13,15,3,28]))),pageTitle:"Profile"},{path:"preferences",lazy:h1(()=>z1(()=>import("./index-BKtz3UH0.js"),__vite__mapDeps([29,30,26,25,28,18,11]))),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:h1(()=>z1(()=>import("./moderation-DyfFc9m4.js"),__vite__mapDeps([31,19,20,21,22,23,11,24,25,8,6,1,17,26,12,27,13,15,3]))),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:h1(()=>z1(()=>import("./bluesky-sharing-BGcmGcee.js"),__vite__mapDeps([32,18,11,25]))),showBackButton:!0},{path:"welcome",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>Or0),void 0)),pageTitle:"Welcome",children:[{path:"",element:z.jsx(vr,{to:"1",replace:!0})},{path:"1",lazy:h1(()=>z1(()=>import("./step-1-CzQmZJ93.js"),__vite__mapDeps([33,25])))},{path:"2",lazy:h1(()=>z1(()=>import("./step-2-DXGDWSQo.js"),__vite__mapDeps([34,35,13,27])))},{path:"3",lazy:h1(()=>z1(()=>import("./step-3-CYuxXKac.js"),__vite__mapDeps([36,35,13,27,22,6,8])))},{path:"*",element:z.jsx(vr,{to:"1",replace:!0})}]},{path:"*",lazy:h1(()=>z1(()=>Promise.resolve().then(()=>wr0),void 0))}]}],sv=p.createContext(void 0),aa0=()=>{const e=p.useContext(sv);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},xr0=({children:e,value:t})=>{const o=p.useContext(Yz),n=t.externalNavigate??o?.externalNavigate;if(!n)throw new Error("External navigate function is required");const r={externalNavigate:n,fromAnalytics:!1,...o,...t};return z.jsx(sv.Provider,{value:r,children:e})},kr0=[{path:"",errorElement:z.jsx(hp,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([z1(()=>import("./post-analytics-context-C7oW3aBz.js").then(o=>o.p),__vite__mapDeps([37,38])),z1(()=>import("./post-analytics-Bm9xH8nA.js"),__vite__mapDeps([39,40,41,38,37]))]);return{element:z.jsx(e,{children:z.jsx(t,{})})}},children:[{path:"",lazy:h1(()=>z1(()=>import("./overview-D9gRvn7X.js"),__vite__mapDeps([42,43,44,23,45,46,47,48,49,41,37,38,50,3,15,51,52,53,21,22,11,24,25,8,6,1,17,26,12,27,13,54,19,20,5,55,56,57,58])))},{path:"web",lazy:h1(()=>z1(()=>import("./web-BEwI2Gfy.js"),__vite__mapDeps([59,37,38,60,24,51,52,23,53,44,45,21,22,11,25,8,6,1,17,26,12,27,13,15,3,54,47,48,19,20,61,49,41,50,62,5])))},{path:"growth",lazy:h1(()=>z1(()=>import("./growth-DshcRqda.js").then(e=>e.g),__vite__mapDeps([55,5,23,52,53,44,56,43,49,41,37,38,50,3,15,57,58])))},{path:"newsletter",lazy:h1(()=>z1(()=>import("./newsletter-BWul5IFc.js"),__vite__mapDeps([63,44,23,64,21,22,11,24,25,8,6,1,17,26,12,27,13,15,3,19,20,43,49,41,37,38,50,45,46,47,48,58])))}]},{path:"tags",children:[{index:!0,lazy:h1(()=>z1(()=>import("./tags-BkUqCuvX.js"),__vite__mapDeps([65,30,66,40,56,17,5])))},{path:":tagSlug",element:null}]},{path:"comments",lazy:h1(()=>z1(()=>import("./comments-CpHDoxov.js"),__vite__mapDeps([67,62,24,38,66,40,56,13,5])))},{path:"*",element:z.jsx(hp,{onBackToDashboard:()=>{}})}]}],Cr0={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 3 months",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},Nr0=Object.values(Cr0),Br0=2,sa0={US:"United States",TWN:"Taiwan",TW:"Taiwan","mobile-ios":"iOS","mobile-android":"Android",macos:"macOS","google.com":"Google","ghost.org":"Ghost","bing.com":"Bing","bsky.app":"Bluesky","yahoo.com":"Yahoo","duckduckgo.com":"DuckDuckGo",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},ia0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],pa0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",Ma0={PUBLIC:1,FREE:2,PAID:4},iv=p.createContext(void 0),ba0=()=>{const e=p.useContext(iv);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},_r0=({children:e})=>{const t=V3(),o=_3(),n=Fd(),r=n.data?.config,a=!!r?.stats,i=kD({enabled:a}),[b,l]=p.useState(Nr0[Br0].value),[u,O]=p.useState(7),[f,h]=p.useState(null),q=[n,t,o],g=q.map(C=>C.error).find(Boolean),W=a?i.error:null,v=g||W,y=q.some(C=>C.isLoading),x=a?i.isLoading:!1,k=y||x;if(v)throw v;const L={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return z.jsx(iv.Provider,{value:{data:r,site:L,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:k,range:b,setRange:l,audience:u,setAudience:O,settings:t.data?.settings||[],selectedNewsletterId:f,setSelectedNewsletterId:h},children:e})},Er0=[{path:"analytics",children:[{index:!0,lazy:h1(()=>z1(()=>import("./index-sy6xRtoO.js"),__vite__mapDeps([68,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,41,50,54,47,48,70,71,58,57,38])))},{path:"web",lazy:h1(()=>z1(()=>import("./index-C3DF6aFe.js"),__vite__mapDeps([72,70,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,61,45,5,64,73,53,62,58,19,20,54,47,48])))},{path:"growth",lazy:h1(()=>z1(()=>import("./index-C6NCNp1B.js"),__vite__mapDeps([74,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,5,47,48,54,19,20,70,75,56,73,57,53,58,76,71])))},{path:"newsletters",lazy:h1(()=>z1(()=>import("./index-CUWE7aD1.js"),__vite__mapDeps([77,69,60,24,44,23,15,21,22,11,25,8,6,1,17,26,12,27,13,3,47,48,5,54,19,20,75,56,78,58])))}]}],Sr0=[{path:"/tags/:tagSlug",Component:Az},{element:z.jsx(xr0,{value:{fromAnalytics:!0},children:z.jsx(Nr,{})}),children:kr0[0].children.filter(e=>e.path!=="*")},{element:z.jsx(_r0,{children:z.jsx(Nr,{})}),children:Er0},{path:"network",loader:()=>rI("/activitypub")},{path:"",element:z.jsx(er0,{children:z.jsx(Nr,{})}),children:av},{path:"settings/*",lazy:h1(()=>z1(()=>import("./settings-D5rGcWJ7.js").then(e=>e.bs),__vite__mapDeps([79,20,78,38,76])))},{path:"*",Component:Az}],Tr0=["http:","https:","mailto:","tel:"];function Pr0(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return Tr0.includes(t.protocol)?(window.location.href=e,!0):!1}catch{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}else{const t=e.startsWith("/")?e:`/${e}`;return window.location.hash=t,!0}}function Xr0({children:e}){const{data:t}=V3(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Tt(n,"paid_members_enabled")??!1,newslettersEnabled:Tt(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Tt(n,"email_track_opens")??!1,emailTrackClicks:Tt(n,"email_track_clicks")??!1,membersTrackSources:Tt(n,"members_track_sources")??!1,outboundLinkTagging:Tt(n,"outbound_link_tagging")??!1,webAnalytics:Tt(n,"web_analytics_enabled")??!1}}},[t]);return z.jsx(Lx,{appSettings:o,children:e})}const jr0={ghostVersion:"",externalNavigate:e=>{Pr0(e.route)},unsplashConfig:{Authorization:"","Accept-Version":"","Content-Type":"","App-Pragma":"","X-Unsplash-Cache":!0},sentryDSN:null,onUpdate:(e,t)=>{window.EmberBridge?.state.onUpdate(e,t)},onInvalidate:e=>{window.EmberBridge?.state.onInvalidate(e)},onDelete:(e,t)=>{window.EmberBridge?.state.onDelete(e,t)}};ey.createRoot(document.getElementById("root")).render(z.jsx(p.StrictMode,{children:z.jsx(wx,{...jr0,children:z.jsx(m10,{prefix:"/",routes:Sr0,children:z.jsx(Xr0,{children:z.jsx(gK,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:z.jsx(Jn0,{})})})})})}));export{o9 as $,Xo as A,o1 as B,ad as C,q3 as D,Zc as E,ur0 as F,Pc0 as G,v2 as H,Xc0 as I,Ic0 as J,Fc0 as K,yr0 as L,jc0 as M,Dc0 as N,f10 as O,Eo as P,U00 as Q,V00 as R,w1 as S,tZ as T,wp as U,ve as V,ea0 as W,bd as X,ta0 as Y,oa0 as Z,tW as _,Yp as a,Cn as a$,WK as a0,u9 as a1,d9 as a2,f9 as a3,A9 as a4,O9 as a5,q9 as a6,h9 as a7,z3 as a8,V9 as a9,U0 as aA,Ep as aB,z1 as aC,rh as aD,Z1 as aE,Fd as aF,_3 as aG,V3 as aH,kD as aI,JQ as aJ,hc0 as aK,Nr as aL,oW as aM,Oc0 as aN,Hm as aO,A10 as aP,lp as aQ,aa0 as aR,ac0 as aS,ic0 as aT,Vr as aU,xu as aV,Dm as aW,n9 as aX,xd as aY,dc0 as aZ,Fm as a_,qd as aa,jZ as ab,Kr as ac,Dn as ad,vD as ae,sc0 as af,Jr0 as ag,y0 as ah,oc0 as ai,cd as aj,WD as ak,Ac0 as al,sW as am,Yt as an,b9 as ao,Im as ap,Ih as aq,Ko as ar,_e as as,e2 as at,H0 as au,Hh as av,SX as aw,TX as ax,$0 as ay,$t as az,Jt as b,lc0 as b$,eW as b0,dt as b1,Ma0 as b2,ba0 as b3,Fr0 as b4,pd as b5,pJ as b6,Hp as b7,iq as b8,Dh as b9,rc as bA,_Z as bB,Gc0 as bC,nZ as bD,$c as bE,Ri as bF,ld as bG,zd as bH,ud as bI,$00 as bJ,fc0 as bK,Hg as bL,G00 as bM,K00 as bN,Y00 as bO,H00 as bP,tc0 as bQ,Yr0 as bR,Md as bS,cc0 as bT,yf as bU,vr as bV,na0 as bW,s00 as bX,i00 as bY,p00 as bZ,mg as b_,Y0 as ba,re as bb,_x as bc,JX as bd,yu as be,Zr as bf,he as bg,Up as bh,Lu as bi,wa as bj,Fo as bk,ya as bl,Fp as bm,pq as bn,Mq as bo,MZ as bp,en as bq,c5 as br,Jd as bs,lZ as bt,wZ as bu,Uc0 as bv,mn0 as bw,zn0 as bx,cv as by,Kc0 as bz,Qc as c,Vc0 as c$,l9 as c0,zG as c1,we as c2,hA as c3,Sp as c4,j9 as c5,I9 as c6,O3 as c7,f3 as c8,id as c9,Mc0 as cA,bc0 as cB,ec0 as cC,PZ as cD,wf as cE,WZ as cF,Nr0 as cG,vK as cH,bl as cI,LK as cJ,Qc0 as cK,Hc0 as cL,Zc0 as cM,Lp as cN,ia0 as cO,sa0 as cP,c9 as cQ,rc0 as cR,pa0 as cS,Sz as cT,Wr0 as cU,_n0 as cV,hZ as cW,fG as cX,$Z as cY,JW as cZ,ir0 as c_,lJ as ca,zJ as cb,a9 as cc,Um as cd,Ym as ce,nc0 as cf,pc0 as cg,Cr0 as ch,xZ as ci,Vr0 as cj,Lc0 as ck,xc0 as cl,OW as cm,Yc0 as cn,M9 as co,mG as cp,k3 as cq,KK as cr,Wp as cs,fA as ct,AA as cu,ra0 as cv,ca0 as cw,s2 as cx,yn0 as cy,HQ as cz,yi as d,Kr0 as d$,$c0 as d0,Dr0 as d1,VR as d2,Tp as d3,vN as d4,W6 as d5,Iq as d6,kc0 as d7,_c0 as d8,Gb as d9,iW as dA,mc0 as dB,Wc0 as dC,_10 as dD,pW as dE,vc0 as dF,B3 as dG,hh as dH,Ur0 as dI,GP as dJ,R6 as dK,y6 as dL,Vz as dM,qu as dN,Oh as dO,tj as dP,Aq as dQ,hq as dR,qq as dS,Qx as dT,aD as dU,Qr0 as dV,sD as dW,jq as dX,Qp as dY,ca as dZ,ye as d_,Zr0 as da,Gr0 as db,Uz as dc,yc0 as dd,fD as de,Gr as df,ha as dg,Bc0 as dh,V2 as di,P10 as dj,X10 as dk,j10 as dl,Tt as dm,kP as dn,wc0 as dp,I10 as dq,Sc0 as dr,Nc0 as ds,Cc0 as dt,K1 as du,T10 as dv,gc0 as dw,Zl as dx,Fa as dy,qc0 as dz,b0 as e,f1 as e0,dw as e1,Rc0 as e2,C10 as e3,Ec0 as e4,Id as e5,ch as e6,Hr0 as e7,zh as e8,KQ as e9,sZ as ea,cZ as eb,dZ as ec,fZ as ed,mZ as ee,CZ as ef,SZ as eg,IZ as eh,HZ as ei,r9 as ej,ZZ as ek,KZ as el,JZ as em,oG as en,s9 as eo,aG as ep,i9 as eq,pG as er,p9 as es,hG as et,ZQ as eu,Ap as f,Po as g,Lo as h,Tc0 as i,z as j,ov as k,Jc0 as l,Yd as m,n5 as n,Fi as o,e5 as p,H9 as q,p as r,_z as s,Ta as t,FI as u,hd as v,md as w,sd as x,g0 as y,Ba as z};
|