ghost 6.17.0 → 6.17.2
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.17.2.tgz +0 -0
- package/components/{tryghost-parse-email-address-6.17.0.tgz → tryghost-parse-email-address-6.17.2.tgz} +0 -0
- package/content/themes/source/package.json +1 -1
- package/core/built/admin/assets/{PolarAngleAxis-sYvwhg8d.js → PolarAngleAxis-B8JrAxf_.js} +1 -1
- package/core/built/admin/assets/{_baseAssignValue-DKQ9pw63.js → _baseAssignValue-Bbalamaq.js} +1 -1
- package/core/built/admin/assets/{a-large-small-CCJbivJB.js → a-large-small-CgWPeKpi.js} +1 -1
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
- package/core/built/admin/assets/admin-x-settings/{code-editor-view-CdDTmDO_.mjs → code-editor-view-BzvYs1fs.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-D19Kl7F3.mjs → index-BXChUyr6.mjs} +5703 -5668
- package/core/built/admin/assets/admin-x-settings/{index-NuuHxngw.mjs → index-DYEF3NiM.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-DWAeZxhW.mjs → index-DdMo_pvD.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{modals-C-PAZhri.mjs → modals-Ck3AHDx3.mjs} +8065 -8057
- package/core/built/admin/assets/{at-sign-BpRvqAQI.js → at-sign-BottTo2X.js} +1 -1
- package/core/built/admin/assets/{audience-DyCuv1si.js → audience-CcGOt5Fb.js} +1 -1
- package/core/built/admin/assets/{avatar-flipboard-BfziFfAR.js → avatar-flipboard-MxW2k124.js} +1 -1
- package/core/built/admin/assets/{bluesky-sharing-D-LC_G4e.js → bluesky-sharing-BBmDBlxr.js} +1 -1
- package/core/built/admin/assets/{chart-BvckKrZJ.js → chart-pimL5Chk.js} +1 -1
- package/core/built/admin/assets/{chunk.524.c76823170fc310a35d9a.js → chunk.524.9a8f5123fd3ecf3e4451.js} +7 -7
- package/core/built/admin/assets/{chunk.582.78cee8a07d88a486d8d3.js → chunk.582.41886d06af2895d571bd.js} +9 -9
- package/core/built/admin/assets/{code-editor-view-BEwQJYgg.js → code-editor-view-tCZOpc_h.js} +1 -1
- package/core/built/admin/assets/{comments-1fqIGh0f.js → comments-OXqhcC0t.js} +1 -1
- package/core/built/admin/assets/{copy-BywnwlHN.js → copy-aC0WUVtq.js} +1 -1
- package/core/built/admin/assets/{data-list--hSCIzLC.js → data-list-BOdyZGWI.js} +1 -1
- package/core/built/admin/assets/{deleted-feed-item-DYKurQBy.js → deleted-feed-item-BnUJ8bWP.js} +1 -1
- package/core/built/admin/assets/{edit-profile-yzEMlJ_t.js → edit-profile-CEgPhWMJ.js} +1 -1
- package/core/built/admin/assets/{empty-indicator-1p7S45xr.js → empty-indicator-CR_9BHAH.js} +1 -1
- package/core/built/admin/assets/{en-DtAty2DP.js → en-ajofhc7o.js} +1 -1
- package/core/built/admin/assets/{feed-DB25J9B-.js → feed-Ci-ODCHE.js} +1 -1
- package/core/built/admin/assets/{filters-cN8zP798.js → filters-CmJJOv3I.js} +1 -1
- package/core/built/admin/assets/{gh-chart-CVItDGhq.js → gh-chart-hn7wEnik.js} +1 -1
- package/core/built/admin/assets/{ghost-f424e37f7e8f90122e3a13866d2b1f91.css → ghost-78b420974adc056bf1c9570275a46535.css} +1 -1
- package/core/built/admin/assets/{ghost-10e648bbdbb5f2e55418e88f15d302e2.js → ghost-a9268074d0a9b02198594a05ecd7a626.js} +2 -2
- package/core/built/admin/assets/{growth-Lbkwu9SJ.js → growth-CQceZQ1g.js} +1 -1
- package/core/built/admin/assets/{hash-BQl75WLf.js → hash-BcaWmkw5.js} +1 -1
- package/core/built/admin/assets/{inbox-BMxFzv7J.js → inbox-D9hID-rO.js} +1 -1
- package/core/built/admin/assets/{index-BrYABbTV.js → index-B1rKIiOr.js} +1 -1
- package/core/built/admin/assets/{index-KqwA5am_.css → index-BBrewxpF.css} +1 -1
- package/core/built/admin/assets/{index-BQ6KbriB.js → index-BJS8H75W.js} +1 -1
- package/core/built/admin/assets/{index-oanahlHO.js → index-BmK6ThYl.js} +1 -1
- package/core/built/admin/assets/{index-8pnhFllL.js → index-CZ3lARQ2.js} +1 -1
- package/core/built/admin/assets/{index-SafJnMjy.js → index-Cl2eSBwg.js} +1 -1
- package/core/built/admin/assets/{index-CoyIDbjB.js → index-D8syEvSm.js} +1 -1
- package/core/built/admin/assets/{index-DR3xU0-B.js → index-DJDgMk-T.js} +1 -1
- package/core/built/admin/assets/{index-C6_sy_zU.js → index-DO76vL0R.js} +1 -1
- package/core/built/admin/assets/{index-DQny1_Ij.js → index-DYM1MbXR.js} +1 -1
- package/core/built/admin/assets/{index-CIheyf0S.js → index-Do091GLu.js} +1 -1
- package/core/built/admin/assets/{index-DG5ENBXM.js → index-d_UH71zm.js} +1 -1
- package/core/built/admin/assets/{index-BeAhXwae.js → index-f5Lv9kLb.js} +3 -3
- package/core/built/admin/assets/{index-oARkCq-e.js → index-g4BWcHhl.js} +1 -1
- package/core/built/admin/assets/{index-C5Mf4zlN.js → index-kXF42nga.js} +1 -1
- package/core/built/admin/assets/{index-voIsrI4j.js → index-rluYcfd-.js} +1 -1
- package/core/built/admin/assets/{koenig-lexical-uhDY2cN7.js → koenig-lexical-D2XHvS2J.js} +1 -1
- package/core/built/admin/assets/{kpi-card-DieTCZ1Z.js → kpi-card-Dga9rFZ5.js} +1 -1
- package/core/built/admin/assets/{kpis-Dg2Sav4t.js → kpis-BbnqD1za.js} +1 -1
- package/core/built/admin/assets/{label-Cs4FoZGu.js → label-D8WHEOe0.js} +1 -1
- package/core/built/admin/assets/{links-DwbtAH6y.js → links-dgwx7ko1.js} +1 -1
- package/core/built/admin/assets/{lucide-react-CTYGYE5A.js → lucide-react-BARFK2PZ.js} +1 -1
- package/core/built/admin/assets/{main-layout-DgFdHzFw.js → main-layout-CcjtCuF_.js} +1 -1
- package/core/built/admin/assets/{message-square-text-42zfcaLO.js → message-square-text-BxquqPhA.js} +1 -1
- package/core/built/admin/assets/{minus-vbx9q5AE.js → minus-Ziy4LSYD.js} +1 -1
- package/core/built/admin/assets/{modals-B1LK0GFs.js → modals-fMQzR7L6.js} +2 -2
- package/core/built/admin/assets/{moderation-DBHou9Tg.js → moderation-Ci9UNwiZ.js} +1 -1
- package/core/built/admin/assets/{newsletter-C_C5cbBQ.js → newsletter-DnrS7Fvi.js} +1 -1
- package/core/built/admin/assets/{newsletters-COhRGj2b.js → newsletters-D78pgnas.js} +1 -1
- package/core/built/admin/assets/{note-Bs7yEUc9.js → note-BAfNweZN.js} +1 -1
- package/core/built/admin/assets/{overview-DgkHUK_G.js → overview-CWQPNOF0.js} +1 -1
- package/core/built/admin/assets/{pagemenu-aMfaU2cA.js → pagemenu-DjSqq3Wu.js} +1 -1
- package/core/built/admin/assets/{post-analytics-BFOeo-LR.js → post-analytics-c8kRV0YB.js} +1 -1
- package/core/built/admin/assets/{post-analytics-context-BR5b-9nb.js → post-analytics-context-CEqWyqgm.js} +1 -1
- package/core/built/admin/assets/{post-analytics-header-Cj_Vf_UF.js → post-analytics-header-CpPPBAz4.js} +1 -1
- package/core/built/admin/assets/{post-share-modal-CP1NDQhS.js → post-share-modal-Dln0kZhn.js} +1 -1
- package/core/built/admin/assets/{posts-BQJit53V.js → posts-C1Eh5Ypq.js} +1 -1
- package/core/built/admin/assets/{repeat-DBbPJ4Vq.js → repeat-CN4fiG5H.js} +1 -1
- package/core/built/admin/assets/{reply-DlcWrPL1.js → reply-BfWgvH7y.js} +1 -1
- package/core/built/admin/assets/{select-wir-gl-P.js → select-B_0NBkLz.js} +1 -1
- package/core/built/admin/assets/{settings-CpDtcACU.js → settings-BqaVcJee.js} +25 -25
- package/core/built/admin/assets/{settings-CtzZEQJ2.js → settings-Dk9E7Fqv.js} +1 -1
- package/core/built/admin/assets/{sort-button-CecMSgfo.js → sort-button-C2M35dLh.js} +1 -1
- package/core/built/admin/assets/{source-icon-CveBuH3b.js → source-icon-DkGi13e_.js} +1 -1
- package/core/built/admin/assets/{sprout-Beunj00B.js → sprout-BKiwQsGn.js} +1 -1
- package/core/built/admin/assets/{square-DTB79BvA.js → square-BEpRc_fY.js} +1 -1
- package/core/built/admin/assets/{stats-C2A4PNUn.js → stats-CRgy_cWm.js} +1 -1
- package/core/built/admin/assets/{stats-view-XXduvFiP.js → stats-view-CTQ4qO3S.js} +1 -1
- package/core/built/admin/assets/{step-1-Dhctc4sb.js → step-1-CNbdmB8C.js} +1 -1
- package/core/built/admin/assets/{step-2-CfG-dkZM.js → step-2-Ddrl2uae.js} +1 -1
- package/core/built/admin/assets/{step-3-D_7ttapi.js → step-3-CbqkEtwh.js} +1 -1
- package/core/built/admin/assets/{table-D-JhwxMn.js → table-Dw9xFlFd.js} +1 -1
- package/core/built/admin/assets/{tabs-DvTZ848X.js → tabs-DCHagOip.js} +1 -1
- package/core/built/admin/assets/{tags-Pad-cSDy.js → tags-BsDlfsPN.js} +1 -1
- package/core/built/admin/assets/{tags-dgsPPBjR.js → tags-DV2SSdMK.js} +1 -1
- package/core/built/admin/assets/{tiers-DFi-MWJ-.js → tiers-tc5tafWV.js} +1 -1
- package/core/built/admin/assets/{toggle-group-DMvy3Ce1.js → toggle-group-DS-ZVhCr.js} +1 -1
- package/core/built/admin/assets/{topic-filter-Is3xj8qt.js → topic-filter-BfoEqHRD.js} +1 -1
- package/core/built/admin/assets/{trash-CT37Asdf.js → trash-CpnxYen-.js} +1 -1
- package/core/built/admin/assets/{url-helpers-Bf57BBzr.js → url-helpers-wKPPeCtD.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-DXoeaAKq.js → use-growth-stats-CbHIETF_.js} +1 -1
- package/core/built/admin/assets/{use-infinite-virtual-scroll-COKeWLQm.js → use-infinite-virtual-scroll-DU1EUhyj.js} +1 -1
- package/core/built/admin/assets/{use-simple-pagination-BQBxprZe.js → use-simple-pagination-X6kmRz2u.js} +1 -1
- package/core/built/admin/assets/{user-round-check-C5Iux98g.js → user-round-check-DYkrjHxF.js} +1 -1
- package/core/built/admin/assets/{wallet-cards-Hfikexmn.js → wallet-cards-CSdWOmJE.js} +1 -1
- package/core/built/admin/assets/{web-B-GYQeG7.js → web-C39IKnvl.js} +1 -1
- package/core/built/admin/index.html +6 -6
- package/core/server/services/email-address/email-address-service-wrapper.js +3 -0
- package/core/server/services/email-address/email-address-service.js +11 -0
- package/core/server/services/email-address/email-address-service.ts +13 -0
- package/core/server/services/members/api.js +3 -1
- package/core/server/services/members/members-api/controllers/router-controller.js +5 -2
- package/core/server/services/members/members-api/members-api.js +4 -2
- package/package.json +5 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/components/tryghost-i18n-6.17.0.tgz +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-kXF42nga.js","./minus-Ziy4LSYD.js","./deleted-feed-item-BnUJ8bWP.js","./trash-CpnxYen-.js","./topic-filter-BfoEqHRD.js","./empty-indicator-CR_9BHAH.js","./inbox-D9hID-rO.js","./feed-Ci-ODCHE.js","./hash-BcaWmkw5.js","./note-BAfNweZN.js","./index-d_UH71zm.js","./at-sign-BottTo2X.js","./user-round-check-DYkrjHxF.js","./reply-BfWgvH7y.js","./index-Do091GLu.js","./sprout-BKiwQsGn.js","./index-Cl2eSBwg.js","./tags-DV2SSdMK.js","./edit-profile-CEgPhWMJ.js","./label-D8WHEOe0.js","./tabs-DCHagOip.js","./index-DO76vL0R.js","./lucide-react-BARFK2PZ.js","./a-large-small-CgWPeKpi.js","./wallet-cards-CSdWOmJE.js","./message-square-text-BxquqPhA.js","./copy-aC0WUVtq.js","./square-BEpRc_fY.js","./repeat-CN4fiG5H.js","./settings-Dk9E7Fqv.js","./index-CZ3lARQ2.js","./toggle-group-DS-ZVhCr.js","./moderation-Ci9UNwiZ.js","./bluesky-sharing-BBmDBlxr.js","./step-1-CNbdmB8C.js","./step-2-Ddrl2uae.js","./avatar-flipboard-MxW2k124.js","./step-3-CbqkEtwh.js","./post-analytics-context-CEqWyqgm.js","./posts-C1Eh5Ypq.js","./post-analytics-c8kRV0YB.js","./main-layout-CcjtCuF_.js","./post-share-modal-Dln0kZhn.js","./overview-CWQPNOF0.js","./kpi-card-Dga9rFZ5.js","./pagemenu-DjSqq3Wu.js","./data-list-BOdyZGWI.js","./links-dgwx7ko1.js","./chart-pimL5Chk.js","./_baseAssignValue-Bbalamaq.js","./PolarAngleAxis-B8JrAxf_.js","./post-analytics-header-CpPPBAz4.js","./post-helpers-gInwAwEv.js","./kpis-BbnqD1za.js","./source-icon-DkGi13e_.js","./source-utils-B1S3ZHA2.js","./gh-chart-hn7wEnik.js","./growth-CQceZQ1g.js","./table-Dw9xFlFd.js","./currency-fEUUCkj0.js","./stats-CRgy_cWm.js","./web-C39IKnvl.js","./select-B_0NBkLz.js","./en-ajofhc7o.js","./filters-CmJJOv3I.js","./newsletter-DnrS7Fvi.js","./use-simple-pagination-X6kmRz2u.js","./tags-BsDlfsPN.js","./use-infinite-virtual-scroll-DU1EUhyj.js","./comments-OXqhcC0t.js","./index-g4BWcHhl.js","./index-rluYcfd-.js","./stats-view-CTQ4qO3S.js","./audience-CcGOt5Fb.js","./use-growth-stats-CbHIETF_.js","./index-DJDgMk-T.js","./url-helpers-wKPPeCtD.js","./index-D8syEvSm.js","./sort-button-C2M35dLh.js","./tiers-tc5tafWV.js","./index-B1rKIiOr.js","./newsletters-D78pgnas.js","./settings-BqaVcJee.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function yv(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 rn0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bz(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function wv(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 kb={exports:{}},Sc={},xb={exports:{}},c1={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -596,7 +596,7 @@ y0.version="2.24.0";CH(T1);y0.fn=h0;y0.min=AV;y0.max=hV;y0.now=qV;y0.utc=At;y0.u
|
|
|
596
596
|
* See the LICENSE file in the root directory of this source tree.
|
|
597
597
|
*/const zG=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],cd=U0("x",zG),h3=Gt("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"}}),e1=p.forwardRef(({className:e,variant:t,size:o,asChild:n=!1,children:r,...a},i)=>{const b=n?Jr:"button",l=t==="dropdown"?z.jsxs(z.Fragment,{children:[r,z.jsx(Y$,{className:"!-ml-1 !-mr-0.5 size-4 !stroke-[2px] opacity-50",strokeWidth:2})]}):r;return z.jsx(b,{ref:i,className:q0(h3({variant:t,size:o,className:e})),...a,children:l})});e1.displayName="Button";function uG(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 dG=e=>{switch(e){case"success":return AG;case"info":return qG;case"warning":return hG;case"error":return mG;default:return null}},OG=Array(12).fill(0),fG=({visible:e,className:t})=>p0.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},p0.createElement("div",{className:"sonner-spinner"},OG.map((o,n)=>p0.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),AG=p0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},p0.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"})),hG=p0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},p0.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"})),qG=p0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},p0.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"})),mG=p0.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},p0.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"})),gG=p0.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"},p0.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),p0.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),WG=()=>{const[e,t]=p0.useState(document.hidden);return p0.useEffect(()=>{const o=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),e};let lz=1;class vG{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:lz++,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],p0.isValidElement(u))a=!1,this.create({id:n,type:"default",message:u});else if(yG(u)&&!u.ok){a=!1;const O=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 O=="object"&&!p0.isValidElement(O)?O:{message:O};this.create({id:n,type:"error",description:h,...g})}else if(u instanceof Error){a=!1;const O=typeof o.error=="function"?await o.error(u):o.error,h=typeof o.description=="function"?await o.description(u):o.description,g=typeof O=="object"&&!p0.isValidElement(O)?O:{message:O};this.create({id:n,type:"error",description:h,...g})}else if(o.success!==void 0){a=!1;const O=typeof o.success=="function"?await o.success(u):o.success,h=typeof o.description=="function"?await o.description(u):o.description,g=typeof O=="object"&&!p0.isValidElement(O)?O:{message:O};this.create({id:n,type:"success",description:h,...g})}}).catch(async u=>{if(i=["reject",u],o.error!==void 0){a=!1;const f=typeof o.error=="function"?await o.error(u):o.error,O=typeof o.description=="function"?await o.description(u):o.description,m=typeof f=="object"&&!p0.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:O,...m})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),o.finally==null||o.finally.call(o)}),l=()=>new Promise((u,f)=>b.then(()=>i[0]==="reject"?f(i[1]):u(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,o)=>{const n=o?.id||lz++;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 Ze=new vG,RG=(e,t)=>{const o=t?.id||lz++;return Ze.addToast({title:e,...t,id:o}),o},yG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",wG=RG,LG=()=>Ze.toasts,kG=()=>Ze.getActiveToasts(),ge=Object.assign(wG,{success:Ze.success,info:Ze.info,warning:Ze.warning,error:Ze.error,custom:Ze.custom,message:Ze.message,promise:Ze.promise,dismiss:Ze.dismiss,loading:Ze.loading},{getHistory:LG,getToasts:kG});uG("[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 Ai(e){return e.label!==void 0}const xG=3,CG="24px",NG="16px",bf=4e3,BG=356,_G=14,EG=45,SG=200;function it(...e){return e.filter(Boolean).join(" ")}function TG(e){const[t,o]=e.split("-"),n=[];return t&&n.push(t),o&&n.push(o),n}const PG=e=>{var t,o,n,r,a,i,b,l,u;const{invert:f,toast:O,unstyled:h,interacting:m,setHeights:g,visibleToasts:W,heights:v,index:y,toasts:L,expanded:x,removeToast:k,defaultRichColors:C,closeButton:w,style:P,cancelButtonStyle:F,actionButtonStyle:e0,className:G="",descriptionClassName:Y="",duration:o0,position:K,gap:a0,expandByDefault:g0,classNames:Q,icons:A0,closeButtonAriaLabel:$="Close toast"}=e,[X,Z]=p0.useState(null),[B,I]=p0.useState(null),[b0,O0]=p0.useState(!1),[m0,W0]=p0.useState(!1),[z0,t0]=p0.useState(!1),[N0,_0]=p0.useState(!1),[V0,l1]=p0.useState(!1),[E,J]=p0.useState(0),[r0,f0]=p0.useState(0),S0=p0.useRef(O.duration||o0||bf),J0=p0.useRef(null),i1=p0.useRef(null),t1=y===0,z1=y+1<=W,L1=O.type,_e=O.dismissible!==!1,Yo=O.className||"",Yt=O.descriptionClassName||"",Ae=p0.useMemo(()=>v.findIndex($0=>$0.toastId===O.id)||0,[v,O.id]),Ee=p0.useMemo(()=>{var $0;return($0=O.closeButton)!=null?$0:w},[O.closeButton,w]),Y2=p0.useMemo(()=>O.duration||o0||bf,[O.duration,o0]),Jt=p0.useRef(0),ye=p0.useRef(0),J2=p0.useRef(0),le=p0.useRef(null),[Jo,en]=K.split("-"),tn=p0.useMemo(()=>v.reduce(($0,k1,j1)=>j1>=Ae?$0:$0+k1.height,0),[v,Ae]),eo=WG(),to=O.invert||f,p2=L1==="loading";ye.current=p0.useMemo(()=>Ae*a0+tn,[Ae,tn]),p0.useEffect(()=>{S0.current=Y2},[Y2]),p0.useEffect(()=>{O0(!0)},[]),p0.useEffect(()=>{const $0=i1.current;if($0){const k1=$0.getBoundingClientRect().height;return f0(k1),g(j1=>[{toastId:O.id,height:k1,position:O.position},...j1]),()=>g(j1=>j1.filter(ze=>ze.toastId!==O.id))}},[g,O.id]),p0.useLayoutEffect(()=>{if(!b0)return;const $0=i1.current,k1=$0.style.height;$0.style.height="auto";const j1=$0.getBoundingClientRect().height;$0.style.height=k1,f0(j1),g(ze=>ze.find(_=>_.toastId===O.id)?ze.map(_=>_.toastId===O.id?{..._,height:j1}:_):[{toastId:O.id,height:j1,position:O.position},...ze])},[b0,O.title,O.description,g,O.id,O.jsx,O.action,O.cancel]);const Se=p0.useCallback(()=>{W0(!0),J(ye.current),g($0=>$0.filter(k1=>k1.toastId!==O.id)),setTimeout(()=>{k(O)},SG)},[O,k,g,ye]);p0.useEffect(()=>{if(O.promise&&L1==="loading"||O.duration===1/0||O.type==="loading")return;let $0;return x||m||eo?(()=>{if(J2.current<Jt.current){const ze=new Date().getTime()-Jt.current;S0.current=S0.current-ze}J2.current=new Date().getTime()})():(()=>{S0.current!==1/0&&(Jt.current=new Date().getTime(),$0=setTimeout(()=>{O.onAutoClose==null||O.onAutoClose.call(O,O),Se()},S0.current))})(),()=>clearTimeout($0)},[x,m,O,L1,eo,Se]),p0.useEffect(()=>{O.delete&&(Se(),O.onDismiss==null||O.onDismiss.call(O,O))},[Se,O.delete]);function qt(){var $0;if(A0?.loading){var k1;return p0.createElement("div",{className:it(Q?.loader,O==null||(k1=O.classNames)==null?void 0:k1.loader,"sonner-loader"),"data-visible":L1==="loading"},A0.loading)}return p0.createElement(fG,{className:it(Q?.loader,O==null||($0=O.classNames)==null?void 0:$0.loader),visible:L1==="loading"})}const et=O.icon||A0?.[L1]||dG(L1);var M2,on;return p0.createElement("li",{tabIndex:0,ref:i1,className:it(G,Yo,Q?.toast,O==null||(t=O.classNames)==null?void 0:t.toast,Q?.default,Q?.[L1],O==null||(o=O.classNames)==null?void 0:o[L1]),"data-sonner-toast":"","data-rich-colors":(M2=O.richColors)!=null?M2:C,"data-styled":!(O.jsx||O.unstyled||h),"data-mounted":b0,"data-promise":!!O.promise,"data-swiped":V0,"data-removed":m0,"data-visible":z1,"data-y-position":Jo,"data-x-position":en,"data-index":y,"data-front":t1,"data-swiping":z0,"data-dismissible":_e,"data-type":L1,"data-invert":to,"data-swipe-out":N0,"data-swipe-direction":B,"data-expanded":!!(x||g0&&b0),"data-testid":O.testId,style:{"--index":y,"--toasts-before":y,"--z-index":L.length-y,"--offset":`${m0?E:ye.current}px`,"--initial-height":g0?"auto":`${r0}px`,...P,...O.style},onDragEnd:()=>{t0(!1),Z(null),le.current=null},onPointerDown:$0=>{$0.button!==2&&(p2||!_e||(J0.current=new Date,J(ye.current),$0.target.setPointerCapture($0.pointerId),$0.target.tagName!=="BUTTON"&&(t0(!0),le.current={x:$0.clientX,y:$0.clientY})))},onPointerUp:()=>{var $0,k1,j1;if(N0||!_e)return;le.current=null;const ze=Number((($0=i1.current)==null?void 0:$0.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),tt=Number(((k1=i1.current)==null?void 0:k1.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_=new Date().getTime()-((j1=J0.current)==null?void 0:j1.getTime()),j=X==="x"?ze:tt,U=Math.abs(j)/_;if(Math.abs(j)>=EG||U>.11){J(ye.current),O.onDismiss==null||O.onDismiss.call(O,O),I(X==="x"?ze>0?"right":"left":tt>0?"down":"up"),Se(),_0(!0);return}else{var c0,u0;(c0=i1.current)==null||c0.style.setProperty("--swipe-amount-x","0px"),(u0=i1.current)==null||u0.style.setProperty("--swipe-amount-y","0px")}l1(!1),t0(!1),Z(null)},onPointerMove:$0=>{var k1,j1,ze;if(!le.current||!_e||((k1=window.getSelection())==null?void 0:k1.toString().length)>0)return;const _=$0.clientY-le.current.y,j=$0.clientX-le.current.x;var U;const c0=(U=e.swipeDirections)!=null?U:TG(K);!X&&(Math.abs(j)>1||Math.abs(_)>1)&&Z(Math.abs(j)>Math.abs(_)?"x":"y");let u0={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")&&_<0||c0.includes("bottom")&&_>0)u0.y=_;else{const R0=_*k0(_);u0.y=Math.abs(R0)<Math.abs(_)?R0:_}}else if(X==="x"&&(c0.includes("left")||c0.includes("right")))if(c0.includes("left")&&j<0||c0.includes("right")&&j>0)u0.x=j;else{const R0=j*k0(j);u0.x=Math.abs(R0)<Math.abs(j)?R0:j}(Math.abs(u0.x)>0||Math.abs(u0.y)>0)&&l1(!0),(j1=i1.current)==null||j1.style.setProperty("--swipe-amount-x",`${u0.x}px`),(ze=i1.current)==null||ze.style.setProperty("--swipe-amount-y",`${u0.y}px`)}},Ee&&!O.jsx&&L1!=="loading"?p0.createElement("button",{"aria-label":$,"data-disabled":p2,"data-close-button":!0,onClick:p2||!_e?()=>{}:()=>{Se(),O.onDismiss==null||O.onDismiss.call(O,O)},className:it(Q?.closeButton,O==null||(n=O.classNames)==null?void 0:n.closeButton)},(on=A0?.close)!=null?on:gG):null,(L1||O.icon||O.promise)&&O.icon!==null&&(A0?.[L1]!==null||O.icon)?p0.createElement("div",{"data-icon":"",className:it(Q?.icon,O==null||(r=O.classNames)==null?void 0:r.icon)},O.promise||O.type==="loading"&&!O.icon?O.icon||qt():null,O.type!=="loading"?et:null):null,p0.createElement("div",{"data-content":"",className:it(Q?.content,O==null||(a=O.classNames)==null?void 0:a.content)},p0.createElement("div",{"data-title":"",className:it(Q?.title,O==null||(i=O.classNames)==null?void 0:i.title)},O.jsx?O.jsx:typeof O.title=="function"?O.title():O.title),O.description?p0.createElement("div",{"data-description":"",className:it(Y,Yt,Q?.description,O==null||(b=O.classNames)==null?void 0:b.description)},typeof O.description=="function"?O.description():O.description):null),p0.isValidElement(O.cancel)?O.cancel:O.cancel&&Ai(O.cancel)?p0.createElement("button",{"data-button":!0,"data-cancel":!0,style:O.cancelButtonStyle||F,onClick:$0=>{Ai(O.cancel)&&_e&&(O.cancel.onClick==null||O.cancel.onClick.call(O.cancel,$0),Se())},className:it(Q?.cancelButton,O==null||(l=O.classNames)==null?void 0:l.cancelButton)},O.cancel.label):null,p0.isValidElement(O.action)?O.action:O.action&&Ai(O.action)?p0.createElement("button",{"data-button":!0,"data-action":!0,style:O.actionButtonStyle||e0,onClick:$0=>{Ai(O.action)&&(O.action.onClick==null||O.action.onClick.call(O.action,$0),!$0.defaultPrevented&&Se())},className:it(Q?.actionButton,O==null||(u=O.classNames)==null?void 0:u.actionButton)},O.action.label):null)};function lf(){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 XG(e,t){const o={};return[e,t].forEach((n,r)=>{const a=r===1,i=a?"--mobile-offset":"--offset",b=a?NG:CG;function l(u){["top","right","bottom","left"].forEach(f=>{o[`${i}-${f}`]=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 jG=p0.forwardRef(function(t,o){const{id:n,invert:r,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:b,closeButton:l,className:u,offset:f,mobileOffset:O,theme:h="light",richColors:m,duration:g,style:W,visibleToasts:v=xG,toastOptions:y,dir:L=lf(),gap:x=_G,icons:k,containerAriaLabel:C="Notifications"}=t,[w,P]=p0.useState([]),F=p0.useMemo(()=>n?w.filter(b0=>b0.toasterId===n):w.filter(b0=>!b0.toasterId),[w,n]),e0=p0.useMemo(()=>Array.from(new Set([a].concat(F.filter(b0=>b0.position).map(b0=>b0.position)))),[F,a]),[G,Y]=p0.useState([]),[o0,K]=p0.useState(!1),[a0,g0]=p0.useState(!1),[Q,A0]=p0.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=p0.useRef(null),X=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),Z=p0.useRef(null),B=p0.useRef(!1),I=p0.useCallback(b0=>{P(O0=>{var m0;return(m0=O0.find(W0=>W0.id===b0.id))!=null&&m0.delete||Ze.dismiss(b0.id),O0.filter(({id:W0})=>W0!==b0.id)})},[]);return p0.useEffect(()=>Ze.subscribe(b0=>{if(b0.dismiss){requestAnimationFrame(()=>{P(O0=>O0.map(m0=>m0.id===b0.id?{...m0,delete:!0}:m0))});return}setTimeout(()=>{CA.flushSync(()=>{P(O0=>{const m0=O0.findIndex(W0=>W0.id===b0.id);return m0!==-1?[...O0.slice(0,m0),{...O0[m0],...b0},...O0.slice(m0+1)]:[b0,...O0]})})})}),[w]),p0.useEffect(()=>{if(h!=="system"){A0(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A0("dark"):A0("light")),typeof window>"u")return;const b0=window.matchMedia("(prefers-color-scheme: dark)");try{b0.addEventListener("change",({matches:O0})=>{A0(O0?"dark":"light")})}catch{b0.addListener(({matches:m0})=>{try{A0(m0?"dark":"light")}catch(W0){console.error(W0)}})}},[h]),p0.useEffect(()=>{w.length<=1&&K(!1)},[w]),p0.useEffect(()=>{const b0=O0=>{var m0;if(i.every(t0=>O0[t0]||O0.code===t0)){var z0;K(!0),(z0=$.current)==null||z0.focus()}O0.code==="Escape"&&(document.activeElement===$.current||(m0=$.current)!=null&&m0.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",b0),()=>document.removeEventListener("keydown",b0)},[i]),p0.useEffect(()=>{if($.current)return()=>{Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null,B.current=!1)}},[$.current]),p0.createElement("section",{ref:o,"aria-label":`${C} ${X}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},e0.map((b0,O0)=>{var m0;const[W0,z0]=b0.split("-");return F.length?p0.createElement("ol",{key:b0,dir:L==="auto"?lf():L,tabIndex:-1,ref:$,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":W0,"data-x-position":z0,style:{"--front-toast-height":`${((m0=G[0])==null?void 0:m0.height)||0}px`,"--width":`${BG}px`,"--gap":`${x}px`,...W,...XG(f,O)},onBlur:t0=>{B.current&&!t0.currentTarget.contains(t0.relatedTarget)&&(B.current=!1,Z.current&&(Z.current.focus({preventScroll:!0}),Z.current=null))},onFocus:t0=>{t0.target instanceof HTMLElement&&t0.target.dataset.dismissible==="false"||B.current||(B.current=!0,Z.current=t0.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{a0||K(!1)},onDragEnd:()=>K(!1),onPointerDown:t0=>{t0.target instanceof HTMLElement&&t0.target.dataset.dismissible==="false"||g0(!0)},onPointerUp:()=>g0(!1)},F.filter(t0=>!t0.position&&O0===0||t0.position===b0).map((t0,N0)=>{var _0,V0;return p0.createElement(PG,{key:t0.id,icons:k,index:N0,toast:t0,defaultRichColors:m,duration:(_0=y?.duration)!=null?_0:g,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:r,visibleToasts:v,closeButton:(V0=y?.closeButton)!=null?V0:l,interacting:a0,position:b0,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:I,toasts:F.filter(l1=>l1.position==t0.position),heights:G.filter(l1=>l1.position==t0.position),setHeights:Y,expandByDefault:b,gap:x,expanded:o0,swipeDirections:t.swipeDirections})})):null}))}),DG=({...e})=>z.jsx(jG,{className:"toaster group",style:{"--normal-bg":"hsl(var(--background))","--normal-text":"hsl(var(--foreground))","--normal-border":"hsl(var(--border))"},theme:"light",...e}),IG=p0.createContext({isDirty:!1,setGlobalDirtyState:()=>{}}),FG=({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(IG.Provider,{value:{isDirty:t.length>0,setGlobalDirtyState:n},children:e})},HG=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})),UG="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",VG=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:HG,default:UG},Symbol.toStringTag,{value:"Module"})),QG=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})),$G="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",ZG=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:QG,default:$G},Symbol.toStringTag,{value:"Module"})),GG=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}))),KG="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",YG=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:GG,default:KG},Symbol.toStringTag,{value:"Module"})),JG=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})),eK="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",tK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:JG,default:eK},Symbol.toStringTag,{value:"Module"})),oK=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})),nK="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",rK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:oK,default:nK},Symbol.toStringTag,{value:"Module"})),cK=Gt("",{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":VG,"../../assets/icons/info-fill.svg":ZG,"../../assets/icons/skull-and-bones.svg":YG,"../../assets/icons/success-fill.svg":tK,"../../assets/icons/typography.svg":rK}),Ii=Object.entries(aK).reduce((e,[t,o])=>{var n;const r=((n=t.match(/[^/]+(?=\.svg$)/))==null?void 0:n[0])??"",a=W$(r),i=b=>{const{size:l,className:u,...f}=b,O=q0(cK({size:l,className:u}));return p0.createElement(o.ReactComponent,{...f,className:O})};return i.displayName=`Icon.${a}`,e[a]=i,e},{}),kn0=Ii,sK=p.createContext({isAnyTextFieldFocused:!1,setFocusState:()=>{},darkMode:!1}),iK=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>(t(!0),()=>t(!1)),[]),e?Pp.createPortal(z.jsx("div",{className:Go,style:{width:"unset",height:"unset"},children:z.jsx(DG,{icons:{error:z.jsx(Ii.ErrorFill,{className:"text-red"}),success:z.jsx(Ii.SuccessFill,{className:"text-green"}),info:z.jsx(Ii.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},pK=({darkMode:e,children:t})=>{const[o,n]=p.useState(!1),r=a=>{n(a)};return z.jsx(sK.Provider,{value:{isAnyTextFieldFocused:o,setFocusState:r,darkMode:e},children:z.jsxs(FG,{children:[t,z.jsx(iK,{})]})})},Go="shade shade-admin shade-activitypub shade-stats shade-posts",MK=({darkMode:e,fetchKoenigLexical:t,className:o,children:n,...r})=>{const a=Z1("shade",o);return z.jsx("div",{className:a,...r,children:z.jsx(pK,{darkMode:e,children:n})})},bK=GF,lK=KF,zK=YF,t9=p.forwardRef(({className:e,...t},o)=>z.jsx(jq,{className:q0("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}));t9.displayName=jq.displayName;const o9=p.forwardRef(({className:e,...t},o)=>z.jsx(zK,{children:z.jsxs("div",{className:Go,children:[z.jsx(t9,{onClick:n=>n.stopPropagation()}),z.jsx(Dq,{ref:o,className:q0("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})]})}));o9.displayName=Dq.displayName;const n9=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col space-y-2 text-center sm:text-left",e),...t});n9.displayName="AlertDialogHeader";const r9=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 [&>button]:min-w-20",e),...t});r9.displayName="AlertDialogFooter";const c9=p.forwardRef(({className:e,...t},o)=>z.jsx(Hq,{ref:o,className:q0("text-xl font-semibold",e),...t}));c9.displayName=Hq.displayName;const a9=p.forwardRef(({className:e,...t},o)=>z.jsx(Uq,{ref:o,className:q0("text-base",e),...t}));a9.displayName=Uq.displayName;const s9=p.forwardRef(({className:e,...t},o)=>z.jsx(Iq,{ref:o,className:q0(h3(),e),...t}));s9.displayName=Iq.displayName;const i9=p.forwardRef(({className:e,...t},o)=>z.jsx(Fq,{ref:o,className:q0(h3({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));i9.displayName=Fq.displayName;const uK=p.lazy(()=>M1(()=>import("./index-DQny1_Ij.js"),[],import.meta.url)),zf=e=>z.jsx(p.Suspense,{fallback:z.jsx("div",{}),children:z.jsx(uK,{...e})}),ad=p.forwardRef(({className:e,...t},o)=>z.jsx(s7,{ref:o,className:q0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));ad.displayName=s7.displayName;const sd=p.forwardRef(({className:e,...t},o)=>z.jsx(i7,{ref:o,className:q0("aspect-square h-full w-full",e),...t}));sd.displayName=i7.displayName;const id=p.forwardRef(({className:e,...t},o)=>z.jsx(p7,{ref:o,className:q0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));id.displayName=p7.displayName;const dK=Gt("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 OK({className:e,variant:t,...o}){return z.jsx("div",{className:q0(dK({variant:t}),e),...o})}const fK=Gt("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"}}),pd=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:a,role:i="status",className:b,children:l,...u}=e,f=O=>{O.preventDefault(),O.stopPropagation(),r&&a&&a()};return z.jsxs("div",{ref:t,className:q0(fK({variant:o,size:n}),b),role:i,...u,children:[r&&z.jsx(e1,{"aria-label":"Dismiss notification",className:"absolute right-1 top-1 size-8 text-gray-600",size:"icon",variant:"ghost",onClick:f,children:z.jsx(cd,{className:"size-5"})}),l]})});pd.displayName="Banner";const q3=Nu,p9=Bu,AK=_u,hK=c3,M9=p.forwardRef(({className:e,...t},o)=>z.jsx(_a,{ref:o,className:q0("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}));M9.displayName=_a.displayName;const Da=p.forwardRef(({className:e,children:t,...o},n)=>z.jsx(AK,{children:z.jsxs("div",{className:Go,children:[z.jsx(M9,{}),z.jsx(Ea,{ref:n,className:q0("fixed left-[50%] top-[8vmin] z-50 grid w-full max-w-lg translate-x-[-50%] gap-6 bg-background dark:bg-[#101114] p-6 shadow-lg duration-200 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=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2 sm:rounded-lg outline-none",e),...o,children:t})]})}));Da.displayName=Ea.displayName;const Md=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Md.displayName="DialogHeader";const bd=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 sm:items-end [&_button]:min-w-20",e),...t});bd.displayName="DialogFooter";const ld=p.forwardRef(({className:e,...t},o)=>z.jsx(Sa,{ref:o,className:q0("text-xl font-semibold leading-none tracking-tight",e),...t}));ld.displayName=Sa.displayName;const b9=p.forwardRef(({className:e,...t},o)=>z.jsx(Ta,{ref:o,className:q0("text-sm text-muted-foreground",e),...t}));b9.displayName=Ta.displayName;var zz=["Enter"," "],qK=["ArrowDown","PageUp","Home"],l9=["ArrowUp","PageDown","End"],mK=[...qK,...l9],gK={ltr:[...zz,"ArrowRight"],rtl:[...zz,"ArrowLeft"]},WK={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ia="Menu",[za,vK,RK]=fh(Ia),[Hn,z9]=y2(Ia,[RK,$o,qh]),m3=$o(),u9=qh(),[yK,Un]=Hn(Ia),[wK,Fa]=Hn(Ia),d9=e=>{const{__scopeMenu:t,open:o=!1,children:n,dir:r,onOpenChange:a,modal:i=!0}=e,b=m3(t),[l,u]=p.useState(null),f=p.useRef(!1),O=dt(a),h=Ah(r);return p.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),z.jsx(Hp,{...b,children:z.jsx(yK,{scope:t,open:o,onOpenChange:O,content:l,onContentChange:u,children:z.jsx(wK,{scope:t,onClose:p.useCallback(()=>O(!1),[O]),isUsingKeyboardRef:f,dir:h,modal:i,children:n})})})};d9.displayName=Ia;var LK="MenuAnchor",zd=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e,r=m3(o);return z.jsx(Ra,{...r,...n,ref:t})});zd.displayName=LK;var ud="MenuPortal",[kK,O9]=Hn(ud,{forceMount:void 0}),f9=e=>{const{__scopeMenu:t,forceMount:o,children:n,container:r}=e,a=Un(ud,t);return z.jsx(kK,{scope:t,forceMount:o,children:z.jsx(s2,{present:o||a.open,children:z.jsx(ya,{asChild:!0,container:r,children:n})})})};f9.displayName=ud;var g2="MenuContent",[xK,dd]=Hn(g2),A9=p.forwardRef((e,t)=>{const o=O9(g2,e.__scopeMenu),{forceMount:n=o.forceMount,...r}=e,a=Un(g2,e.__scopeMenu),i=Fa(g2,e.__scopeMenu);return z.jsx(za.Provider,{scope:e.__scopeMenu,children:z.jsx(s2,{present:n||a.open,children:z.jsx(za.Slot,{scope:e.__scopeMenu,children:i.modal?z.jsx(CK,{...r,ref:t}):z.jsx(NK,{...r,ref:t})})})})}),CK=p.forwardRef((e,t)=>{const o=Un(g2,e.__scopeMenu),n=p.useRef(null),r=W1(t,n);return p.useEffect(()=>{const a=n.current;if(a)return fu(a)},[]),z.jsx(Od,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:L0(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),NK=p.forwardRef((e,t)=>{const o=Un(g2,e.__scopeMenu);return z.jsx(Od,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),BK=Xr("MenuContent.ScrollLock"),Od=p.forwardRef((e,t)=>{const{__scopeMenu:o,loop:n=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:b,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:O,onInteractOutside:h,onDismiss:m,disableOutsideScroll:g,...W}=e,v=Un(g2,o),y=Fa(g2,o),L=m3(o),x=u9(o),k=vK(o),[C,w]=p.useState(null),P=p.useRef(null),F=W1(t,P,v.onContentChange),e0=p.useRef(0),G=p.useRef(""),Y=p.useRef(0),o0=p.useRef(null),K=p.useRef("right"),a0=p.useRef(0),g0=g?Kp:p.Fragment,Q=g?{as:BK,allowPinchZoom:!0}:void 0,A0=X=>{const Z=G.current+X,B=k().filter(z0=>!z0.disabled),I=document.activeElement,b0=B.find(z0=>z0.ref.current===I)?.textValue,O0=B.map(z0=>z0.textValue),m0=UK(O0,Z,b0),W0=B.find(z0=>z0.textValue===m0)?.ref.current;(function z0(t0){G.current=t0,window.clearTimeout(e0.current),t0!==""&&(e0.current=window.setTimeout(()=>z0(""),1e3))})(Z),W0&&setTimeout(()=>W0.focus())};p.useEffect(()=>()=>window.clearTimeout(e0.current),[]),Ou();const $=p.useCallback(X=>K.current===o0.current?.side&&QK(X,o0.current?.area),[]);return z.jsx(xK,{scope:o,searchRef:G,onItemEnter:p.useCallback(X=>{$(X)&&X.preventDefault()},[$]),onItemLeave:p.useCallback(X=>{$(X)||(P.current?.focus(),w(null))},[$]),onTriggerLeave:p.useCallback(X=>{$(X)&&X.preventDefault()},[$]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:p.useCallback(X=>{o0.current=X},[]),children:z.jsx(g0,{...Q,children:z.jsx(Zp,{asChild:!0,trapped:r,onMountAutoFocus:L0(a,X=>{X.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:z.jsx($r,{asChild:!0,disableOutsidePointerEvents:b,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:O,onInteractOutside:h,onDismiss:m,children:z.jsx(PP,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:L0(l,X=>{y.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:z.jsx(Up,{role:"menu","aria-orientation":"vertical","data-state":_9(v.open),"data-radix-menu-content":"",dir:y.dir,...L,...W,ref:F,style:{outline:"none",...W.style},onKeyDown:L0(W.onKeyDown,X=>{const B=X.target.closest("[data-radix-menu-content]")===X.currentTarget,I=X.ctrlKey||X.altKey||X.metaKey,b0=X.key.length===1;B&&(X.key==="Tab"&&X.preventDefault(),!I&&b0&&A0(X.key));const O0=P.current;if(X.target!==O0||!mK.includes(X.key))return;X.preventDefault();const W0=k().filter(z0=>!z0.disabled).map(z0=>z0.ref.current);l9.includes(X.key)&&W0.reverse(),FK(W0)}),onBlur:L0(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(e0.current),G.current="")}),onPointerMove:L0(e.onPointerMove,ua(X=>{const Z=X.target,B=a0.current!==X.clientX;if(X.currentTarget.contains(Z)&&B){const I=X.clientX>a0.current?"right":"left";K.current=I,a0.current=X.clientX}}))})})})})})})});A9.displayName=g2;var _K="MenuGroup",fd=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return z.jsx(O1.div,{role:"group",...n,ref:t})});fd.displayName=_K;var EK="MenuLabel",h9=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return z.jsx(O1.div,{...n,ref:t})});h9.displayName=EK;var fp="MenuItem",uf="menu.itemSelect",g3=p.forwardRef((e,t)=>{const{disabled:o=!1,onSelect:n,...r}=e,a=p.useRef(null),i=Fa(fp,e.__scopeMenu),b=dd(fp,e.__scopeMenu),l=W1(t,a),u=p.useRef(!1),f=()=>{const O=a.current;if(!o&&O){const h=new CustomEvent(uf,{bubbles:!0,cancelable:!0});O.addEventListener(uf,m=>n?.(m),{once:!0}),HA(O,h),h.defaultPrevented?u.current=!1:i.onClose()}};return z.jsx(q9,{...r,ref:l,disabled:o,onClick:L0(e.onClick,f),onPointerDown:O=>{e.onPointerDown?.(O),u.current=!0},onPointerUp:L0(e.onPointerUp,O=>{u.current||O.currentTarget?.click()}),onKeyDown:L0(e.onKeyDown,O=>{const h=b.searchRef.current!=="";o||h&&O.key===" "||zz.includes(O.key)&&(O.currentTarget.click(),O.preventDefault())})})});g3.displayName=fp;var q9=p.forwardRef((e,t)=>{const{__scopeMenu:o,disabled:n=!1,textValue:r,...a}=e,i=dd(fp,o),b=u9(o),l=p.useRef(null),u=W1(t,l),[f,O]=p.useState(!1),[h,m]=p.useState("");return p.useEffect(()=>{const g=l.current;g&&m((g.textContent??"").trim())},[a.children]),z.jsx(za.ItemSlot,{scope:o,disabled:n,textValue:r??h,children:z.jsx(XP,{asChild:!0,...b,focusable:!n,children:z.jsx(O1.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...a,ref:u,onPointerMove:L0(e.onPointerMove,ua(g=>{n?i.onItemLeave(g):(i.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:L0(e.onPointerLeave,ua(g=>i.onItemLeave(g))),onFocus:L0(e.onFocus,()=>O(!0)),onBlur:L0(e.onBlur,()=>O(!1))})})})}),SK="MenuCheckboxItem",m9=p.forwardRef((e,t)=>{const{checked:o=!1,onCheckedChange:n,...r}=e;return z.jsx(y9,{scope:e.__scopeMenu,checked:o,children:z.jsx(g3,{role:"menuitemcheckbox","aria-checked":Ap(o)?"mixed":o,...r,ref:t,"data-state":hd(o),onSelect:L0(r.onSelect,()=>n?.(Ap(o)?!0:!o),{checkForDefaultPrevented:!1})})})});m9.displayName=SK;var g9="MenuRadioGroup",[TK,PK]=Hn(g9,{value:void 0,onValueChange:()=>{}}),W9=p.forwardRef((e,t)=>{const{value:o,onValueChange:n,...r}=e,a=dt(n);return z.jsx(TK,{scope:e.__scopeMenu,value:o,onValueChange:a,children:z.jsx(fd,{...r,ref:t})})});W9.displayName=g9;var v9="MenuRadioItem",R9=p.forwardRef((e,t)=>{const{value:o,...n}=e,r=PK(v9,e.__scopeMenu),a=o===r.value;return z.jsx(y9,{scope:e.__scopeMenu,checked:a,children:z.jsx(g3,{role:"menuitemradio","aria-checked":a,...n,ref:t,"data-state":hd(a),onSelect:L0(n.onSelect,()=>r.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});R9.displayName=v9;var Ad="MenuItemIndicator",[y9,XK]=Hn(Ad,{checked:!1}),w9=p.forwardRef((e,t)=>{const{__scopeMenu:o,forceMount:n,...r}=e,a=XK(Ad,o);return z.jsx(s2,{present:n||Ap(a.checked)||a.checked===!0,children:z.jsx(O1.span,{...r,ref:t,"data-state":hd(a.checked)})})});w9.displayName=Ad;var jK="MenuSeparator",L9=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return z.jsx(O1.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});L9.displayName=jK;var DK="MenuArrow",k9=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e,r=m3(o);return z.jsx(Vp,{...r,...n,ref:t})});k9.displayName=DK;var IK="MenuSub",[xn0,x9]=Hn(IK),Gc="MenuSubTrigger",C9=p.forwardRef((e,t)=>{const o=Un(Gc,e.__scopeMenu),n=Fa(Gc,e.__scopeMenu),r=x9(Gc,e.__scopeMenu),a=dd(Gc,e.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:b,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>f,[f]),p.useEffect(()=>{const O=b.current;return()=>{window.clearTimeout(O),l(null)}},[b,l]),z.jsx(zd,{asChild:!0,...u,children:z.jsx(q9,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":r.contentId,"data-state":_9(o.open),...e,ref:Tn(t,r.onTriggerChange),onClick:O=>{e.onClick?.(O),!(e.disabled||O.defaultPrevented)&&(O.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:L0(e.onPointerMove,ua(O=>{a.onItemEnter(O),!O.defaultPrevented&&!e.disabled&&!o.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{o.onOpenChange(!0),f()},100))})),onPointerLeave:L0(e.onPointerLeave,ua(O=>{f();const h=o.content?.getBoundingClientRect();if(h){const m=o.content?.dataset.side,g=m==="right",W=g?-5:5,v=h[g?"left":"right"],y=h[g?"right":"left"];a.onPointerGraceIntentChange({area:[{x:O.clientX+W,y:O.clientY},{x:v,y:h.top},{x:y,y:h.top},{x:y,y:h.bottom},{x:v,y:h.bottom}],side:m}),window.clearTimeout(b.current),b.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(O),O.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:L0(e.onKeyDown,O=>{const h=a.searchRef.current!=="";e.disabled||h&&O.key===" "||gK[n.dir].includes(O.key)&&(o.onOpenChange(!0),o.content?.focus(),O.preventDefault())})})})});C9.displayName=Gc;var N9="MenuSubContent",B9=p.forwardRef((e,t)=>{const o=O9(g2,e.__scopeMenu),{forceMount:n=o.forceMount,...r}=e,a=Un(g2,e.__scopeMenu),i=Fa(g2,e.__scopeMenu),b=x9(N9,e.__scopeMenu),l=p.useRef(null),u=W1(t,l);return z.jsx(za.Provider,{scope:e.__scopeMenu,children:z.jsx(s2,{present:n||a.open,children:z.jsx(za.Slot,{scope:e.__scopeMenu,children:z.jsx(Od,{id:b.contentId,"aria-labelledby":b.triggerId,...r,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:L0(e.onFocusOutside,f=>{f.target!==b.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:L0(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:L0(e.onKeyDown,f=>{const O=f.currentTarget.contains(f.target),h=WK[i.dir].includes(f.key);O&&h&&(a.onOpenChange(!1),b.trigger?.focus(),f.preventDefault())})})})})})});B9.displayName=N9;function _9(e){return e?"open":"closed"}function Ap(e){return e==="indeterminate"}function hd(e){return Ap(e)?"indeterminate":e?"checked":"unchecked"}function FK(e){const t=document.activeElement;for(const o of e)if(o===t||(o.focus(),document.activeElement!==t))return}function HK(e,t){return e.map((o,n)=>e[(t+n)%e.length])}function UK(e,t,o){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=o?e.indexOf(o):-1;let i=HK(e,Math.max(a,0));r.length===1&&(i=i.filter(u=>u!==o));const l=i.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==o?l:void 0}function VK(e,t){const{x:o,y:n}=e;let r=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const b=t[a],l=t[i],u=b.x,f=b.y,O=l.x,h=l.y;f>n!=h>n&&o<(O-u)*(n-f)/(h-f)+u&&(r=!r)}return r}function QK(e,t){if(!t)return!1;const o={x:e.clientX,y:e.clientY};return VK(o,t)}function ua(e){return t=>t.pointerType==="mouse"?e(t):void 0}var $K=d9,ZK=zd,GK=f9,KK=A9,YK=fd,JK=h9,eY=g3,tY=m9,oY=W9,nY=R9,rY=w9,cY=L9,aY=k9,sY=C9,iY=B9,W3="DropdownMenu",[pY]=y2(W3,[z9]),je=z9(),[MY,E9]=pY(W3),S9=e=>{const{__scopeDropdownMenu:t,children:o,dir:n,open:r,defaultOpen:a,onOpenChange:i,modal:b=!0}=e,l=je(t),u=p.useRef(null),[f,O]=Pn({prop:r,defaultProp:a??!1,onChange:i,caller:W3});return z.jsx(MY,{scope:t,triggerId:H2(),triggerRef:u,contentId:H2(),open:f,onOpenChange:O,onOpenToggle:p.useCallback(()=>O(h=>!h),[O]),modal:b,children:z.jsx($K,{...l,open:f,onOpenChange:O,dir:n,modal:b,children:o})})};S9.displayName=W3;var T9="DropdownMenuTrigger",P9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,disabled:n=!1,...r}=e,a=E9(T9,o),i=je(o);return z.jsx(ZK,{asChild:!0,...i,children:z.jsx(O1.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...r,ref:Tn(t,a.triggerRef),onPointerDown:L0(e.onPointerDown,b=>{!n&&b.button===0&&b.ctrlKey===!1&&(a.onOpenToggle(),a.open||b.preventDefault())}),onKeyDown:L0(e.onKeyDown,b=>{n||(["Enter"," "].includes(b.key)&&a.onOpenToggle(),b.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(b.key)&&b.preventDefault())})})})});P9.displayName=T9;var bY="DropdownMenuPortal",X9=e=>{const{__scopeDropdownMenu:t,...o}=e,n=je(t);return z.jsx(GK,{...n,...o})};X9.displayName=bY;var j9="DropdownMenuContent",D9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=E9(j9,o),a=je(o),i=p.useRef(!1);return z.jsx(KK,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...n,ref:t,onCloseAutoFocus:L0(e.onCloseAutoFocus,b=>{i.current||r.triggerRef.current?.focus(),i.current=!1,b.preventDefault()}),onInteractOutside:L0(e.onInteractOutside,b=>{const l=b.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});D9.displayName=j9;var lY="DropdownMenuGroup",I9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(YK,{...r,...n,ref:t})});I9.displayName=lY;var zY="DropdownMenuLabel",F9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(JK,{...r,...n,ref:t})});F9.displayName=zY;var uY="DropdownMenuItem",H9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(eY,{...r,...n,ref:t})});H9.displayName=uY;var dY="DropdownMenuCheckboxItem",U9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(tY,{...r,...n,ref:t})});U9.displayName=dY;var OY="DropdownMenuRadioGroup",fY=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(oY,{...r,...n,ref:t})});fY.displayName=OY;var AY="DropdownMenuRadioItem",V9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(nY,{...r,...n,ref:t})});V9.displayName=AY;var hY="DropdownMenuItemIndicator",Q9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(rY,{...r,...n,ref:t})});Q9.displayName=hY;var qY="DropdownMenuSeparator",$9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(cY,{...r,...n,ref:t})});$9.displayName=qY;var mY="DropdownMenuArrow",gY=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(aY,{...r,...n,ref:t})});gY.displayName=mY;var WY="DropdownMenuSubTrigger",Z9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(sY,{...r,...n,ref:t})});Z9.displayName=WY;var vY="DropdownMenuSubContent",G9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(iY,{...r,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});G9.displayName=vY;var RY=S9,yY=P9,wY=X9,K9=D9,LY=I9,Y9=F9,J9=H9,em=U9,tm=V9,om=Q9,nm=$9,rm=Z9,cm=G9;const am=RY,sm=yY,Cn0=LY,kY=p.forwardRef(({className:e,inset:t,children:o,...n},r)=>z.jsxs(rm,{ref:r,className:q0("flex cursor-default gap-2 select-none hover:bg-accent items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[o,z.jsx(Ju,{className:"ml-auto"})]}));kY.displayName=rm.displayName;const xY=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{className:Go,children:z.jsx(cm,{ref:o,className:q0("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));xY.displayName=cm.displayName;const qd=p.forwardRef(({className:e,sideOffset:t=4,...o},n)=>z.jsx(wY,{children:z.jsx("div",{className:Go,children:z.jsx(K9,{ref:n,className:q0("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),sideOffset:t,...o})})}));qd.displayName=K9.displayName;const im=p.forwardRef(({className:e,inset:t,...o},n)=>z.jsx(J9,{ref:n,className:q0("relative flex cursor-default select-none cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));im.displayName=J9.displayName;const CY=p.forwardRef(({className:e,children:t,checked:o,...n},r)=>z.jsxs(em,{ref:r,checked:o,className:q0("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[z.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:z.jsx(om,{children:z.jsx(U8,{className:"size-4"})})}),t]}));CY.displayName=em.displayName;const NY=p.forwardRef(({className:e,children:t,...o},n)=>z.jsxs(tm,{ref:n,className:q0("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[z.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:z.jsx(om,{children:z.jsx(sZ,{className:"size-2 fill-current"})})}),t]}));NY.displayName=tm.displayName;const BY=p.forwardRef(({className:e,inset:t,...o},n)=>z.jsx(Y9,{ref:n,className:q0("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));BY.displayName=Y9.displayName;const kn=p.forwardRef(({className:e,...t},o)=>z.jsx(nm,{ref:o,className:q0("-mx-1 my-1 h-px bg-muted",e),...t}));kn.displayName=nm.displayName;const pm=p.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...n},r)=>z.jsx($A,{ref:r,className:q0("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),decorative:o,orientation:t,...n}));pm.displayName=$A.displayName;const _Y=$j,EY=Zj,Ml=Gj,Mm=p.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},r)=>z.jsx(k7,{ref:r,align:t,className:q0("z-50 rounded-md bg-white dark:bg-gray-950 p-5 text-popover-foreground shadow-md border outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),sideOffset:o,...n}));Mm.displayName=k7.displayName;const SY=Gt("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-5 w-9",sm:"h-4 w-7"}},defaultVariants:{size:"default"}}),TY=Gt("pointer-events-none block rounded-full bg-background ring-0 transition-transform [filter:drop-shadow(0_1px_2px_rgba(0,0,0,0.07))] data-[state=unchecked]:translate-x-0",{variants:{size:{default:"size-4 data-[state=checked]:translate-x-4",sm:"size-3 data-[state=checked]:translate-x-3"}},defaultVariants:{size:"default"}}),bm=p.forwardRef(({className:e,size:t,...o},n)=>z.jsx(xh,{className:q0(SY({size:t,className:e})),...o,ref:n,children:z.jsx(HP,{className:q0(TY({size:t}))})}));bm.displayName=xh.displayName;const PY=kX,XY=xX,jY=CX,lm=p.forwardRef(({className:e,sideOffset:t=4,...o},n)=>z.jsx(NX,{children:z.jsx("div",{className:Go,children:z.jsx(Jh,{ref:n,className:q0("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),sideOffset:t,...o})})}));lm.displayName=Jh.displayName;var bl,v3="HoverCard",[zm]=y2(v3,[$o]),R3=$o(),[DY,y3]=zm(v3),um=e=>{const{__scopeHoverCard:t,children:o,open:n,defaultOpen:r,onOpenChange:a,openDelay:i=700,closeDelay:b=300}=e,l=R3(t),u=p.useRef(0),f=p.useRef(0),O=p.useRef(!1),h=p.useRef(!1),[m,g]=Pn({prop:n,defaultProp:r??!1,onChange:a,caller:v3}),W=p.useCallback(()=>{clearTimeout(f.current),u.current=window.setTimeout(()=>g(!0),i)},[i,g]),v=p.useCallback(()=>{clearTimeout(u.current),!O.current&&!h.current&&(f.current=window.setTimeout(()=>g(!1),b))},[b,g]),y=p.useCallback(()=>g(!1),[g]);return p.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(f.current)},[]),z.jsx(DY,{scope:t,open:m,onOpenChange:g,onOpen:W,onClose:v,onDismiss:y,hasSelectionRef:O,isPointerDownOnContentRef:h,children:z.jsx(Hp,{...l,children:o})})};um.displayName=v3;var dm="HoverCardTrigger",Om=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,...n}=e,r=y3(dm,o),a=R3(o);return z.jsx(Ra,{asChild:!0,...a,children:z.jsx(O1.a,{"data-state":r.open?"open":"closed",...n,ref:t,onPointerEnter:L0(e.onPointerEnter,qp(r.onOpen)),onPointerLeave:L0(e.onPointerLeave,qp(r.onClose)),onFocus:L0(e.onFocus,r.onOpen),onBlur:L0(e.onBlur,r.onClose),onTouchStart:L0(e.onTouchStart,i=>i.preventDefault())})})});Om.displayName=dm;var md="HoverCardPortal",[IY,FY]=zm(md,{forceMount:void 0}),fm=e=>{const{__scopeHoverCard:t,forceMount:o,children:n,container:r}=e,a=y3(md,t);return z.jsx(IY,{scope:t,forceMount:o,children:z.jsx(s2,{present:o||a.open,children:z.jsx(ya,{asChild:!0,container:r,children:n})})})};fm.displayName=md;var hp="HoverCardContent",Am=p.forwardRef((e,t)=>{const o=FY(hp,e.__scopeHoverCard),{forceMount:n=o.forceMount,...r}=e,a=y3(hp,e.__scopeHoverCard);return z.jsx(s2,{present:n||a.open,children:z.jsx(HY,{"data-state":a.open?"open":"closed",...r,onPointerEnter:L0(e.onPointerEnter,qp(a.onOpen)),onPointerLeave:L0(e.onPointerLeave,qp(a.onClose)),ref:t})})});Am.displayName=hp;var HY=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,...b}=e,l=y3(hp,o),u=R3(o),f=p.useRef(null),O=W1(t,f),[h,m]=p.useState(!1);return p.useEffect(()=>{if(h){const g=document.body;return bl=g.style.userSelect||g.style.webkitUserSelect,g.style.userSelect="none",g.style.webkitUserSelect="none",()=>{g.style.userSelect=bl,g.style.webkitUserSelect=bl}}},[h]),p.useEffect(()=>{if(f.current){const g=()=>{m(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",g),()=>{document.removeEventListener("pointerup",g),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),p.useEffect(()=>{f.current&&QY(f.current).forEach(W=>W.setAttribute("tabindex","-1"))}),z.jsx($r,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:L0(a,g=>{g.preventDefault()}),onDismiss:l.onDismiss,children:z.jsx(Up,{...u,...b,onPointerDown:L0(b.onPointerDown,g=>{g.currentTarget.contains(g.target)&&m(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:O,style:{...b.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),UY="HoverCardArrow",VY=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,...n}=e,r=R3(o);return z.jsx(Vp,{...r,...n,ref:t})});VY.displayName=UY;function qp(e){return t=>t.pointerType==="touch"?void 0:e()}function QY(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;o.nextNode();)t.push(o.currentNode);return t}var $Y=um,ZY=Om,GY=fm,hm=Am;const KY=$Y,YY=ZY,qm=p.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},r)=>z.jsx(GY,{children:z.jsx("div",{className:Go,children:z.jsx(hm,{ref:r,align:t,className:q0("pointer-events-auto z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",e),sideOffset:o,...n})})}));qm.displayName=hm.displayName;const JY=Gt("rounded-full",{variants:{variant:{neutral:"bg-muted",info:"bg-blue-500",success:"bg-green-500",error:"bg-red-500",warning:"bg-yellow-500"},state:{idle:"",active:"animate-pulse",inactive:"border-2 bg-transparent"},size:{sm:"size-2",md:"size-3",lg:"size-4"}},compoundVariants:[{variant:"neutral",state:"inactive",className:"border-muted-foreground"},{variant:"info",state:"inactive",className:"border-blue-500"},{variant:"success",state:"inactive",className:"border-green-500"},{variant:"error",state:"inactive",className:"border-red-500"},{variant:"warning",state:"inactive",className:"border-yellow-500"}],defaultVariants:{variant:"success",state:"idle",size:"sm"}});function df({className:e,variant:t,state:o,size:n,label:r,...a}){return z.jsxs("span",{className:"inline-flex items-center",...a,children:[z.jsx("span",{"aria-hidden":"true",className:q0(JY({variant:t,state:o,size:n}),e)}),r&&z.jsx("span",{className:"sr-only",children:r})]})}const w3=p.forwardRef(({className:e,type:t,...o},n)=>z.jsx("input",{ref:n,className:q0("flex h-9 w-full rounded-md border border-transparent bg-gray-150 dark:bg-gray-900 px-3 py-1 text-base transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:bg-transparent focus-visible:border-green focus-visible:shadow-[0_0_0_2px_rgba(48,207,67,.25)] disabled:cursor-not-allowed disabled:opacity-50",e),type:t,...o}));w3.displayName="Input";function eJ({className:e,...t}){return z.jsx("kbd",{className:q0("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium m-0 shadow-none border-none text-shadow-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e),"data-slot":"kbd",...t})}function w1({containerClassName:e,count:t=1,randomize:o=!1,minWidth:n=70,maxWidth:r=100,className:a,...i}){const{randomWidths:b,keys:l}=p.useMemo(()=>{const u=[],f=[];for(let O=0;O<t;O++){if(o){const h=Math.floor((r-n)/5),m=Math.floor(Math.random()*(h+1)),g=n+m*5;u.push(`${g}%`)}f.push(`skeleton-${crypto.randomUUID()}`)}return{randomWidths:u,keys:f}},[t,o,n,r]);return z.jsx("span",{className:e,children:Array.from({length:t}).map((u,f)=>z.jsxs(p0.Fragment,{children:[z.jsx("span",{className:q0("inline-flex w-full leading-none animate-pulse rounded-[2px] bg-primary/10",a),style:o?{width:b[f]}:void 0,...i,children:""}),z.jsx("br",{})]},l[f]))})}const tJ=p0.forwardRef(({className:e,lines:t=5,...o},n)=>t<1?z.jsx(z.Fragment,{}):z.jsx("div",{ref:n,className:q0("flex flex-col gap-2",e),...o,children:Array.from({length:t},(r,a)=>{let i="66%";switch(a%5){case 0:i="57%";break;case 1:i="33%";break;case 2:i="40%";break;case 3:i="48%";break;case 4:i="24%";break}return z.jsxs("div",{className:"flex justify-between gap-6",children:[z.jsx("div",{className:"grow",style:{maxWidth:i},children:z.jsx(w1,{})}),z.jsx(w1,{className:"w-[60px] self-end"})]},a)})}));tJ.displayName="SkeletonTable";const mp=({size:e="md",color:t="dark",className:o=""})=>{let n="relative mx-0 my-[-0.5] box-border inline-block animate-spin rounded-full before:z-10 before:block before:rounded-full before:content-['']";switch(e){case"sm":n+=" h-[16px] w-[16px] border-2 before:mt-[10px] before:h-[3px] before:w-[3px]";break;case"md":n+=" h-[20px] w-[20px] border-2 before:mt-[13px] before:h-[3px] before:w-[3px]";break;case"lg":default:n+=" h-[50px] w-[50px] border before:mt-[7px] before:h-[7px] before:w-[7px]";break}switch(t){case"light":n+=" border-white/20 before:bg-white dark:border-black/10 dark:before:bg-black";break;case"dark":default:n+=" border-black/10 before:bg-black dark:border-white/20 dark:before:bg-white";break}return z.jsx("div",{className:`${n} ${o}`})},Nn0=()=>z.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:z.jsx("div",{className:"flex size-20 items-center justify-center rounded-full",children:z.jsxs("div",{className:"-mt-1.5 flex items-end gap-2",children:[z.jsx(w1,{className:"h-10 w-3"}),z.jsx(w1,{className:"h-14 w-3"}),z.jsx(w1,{className:"h-6 w-3"})]})})}),oJ=({className:e="",children:t})=>z.jsx("div",{className:`my-10 flex flex-col items-center gap-1 text-sm text-grey-600 ${e}`,children:t}),nJ=({className:e="",children:t})=>z.jsx("div",{className:`text-grey-500 [&>svg]:size-8 [&>svg]:stroke-[1px] ${e}`,children:t}),rJ=Nu,Bn0=Bu,cJ=_u,mm=p.forwardRef(({className:e,...t},o)=>z.jsx(_a,{className:q0("fixed inset-0 z-50 bg-black/10 data-[state=open]:animate-in duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));mm.displayName=_a.displayName;const aJ=Gt("fixed z-50 gap-4 bg-background p-8 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),gm=p.forwardRef(({side:e="right",className:t,children:o,...n},r)=>z.jsx(cJ,{children:z.jsxs("div",{className:Go,children:[z.jsx(mm,{}),z.jsxs(Ea,{ref:r,className:q0(aJ({side:e}),t),...n,children:[z.jsxs(c3,{className:"fixed right-4 top-4 z-50 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[z.jsx(cd,{className:"size-4"}),z.jsx("span",{className:"sr-only",children:"Close"})]}),o]})]})}));gm.displayName=Ea.displayName;const sJ=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col space-y-1 text-center sm:text-left",e),...t});sJ.displayName="SheetHeader";const iJ=p.forwardRef(({className:e,...t},o)=>z.jsx(Sa,{ref:o,className:q0("text-xl font-semibold text-foreground",e),...t}));iJ.displayName=Sa.displayName;const pJ=p.forwardRef(({className:e,...t},o)=>z.jsx(Ta,{ref:o,className:q0("text-sm text-muted-foreground",e),...t}));pJ.displayName=Ta.displayName;const Wm=801;function ll(){return window.innerWidth<Wm}function MJ(){const[e,t]=p.useState(ll());return p.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Wm-1}px)`),n=()=>{t(ll())};return o.addEventListener("change",n),t(ll()),()=>o.removeEventListener("change",n)},[]),e}const bJ="sidebar:state",lJ=3600*24*7,zJ="30rem",uJ="28rem",dJ="4rem",OJ="b",L3="[34px]",vm=p.createContext(null);function Vn(){const e=p.useContext(vm);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Rm=p.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:o,className:n,style:r,children:a,...i},b)=>{const l=MJ(),[u,f]=p.useState(!1),[O,h]=p.useState(e),m=t??O,g=p.useCallback(L=>{const x=typeof L=="function"?L(m):L;o?o(x):h(x),document.cookie=`${bJ}=${x}; path=/; max-age=${lJ}`},[o,m]),W=p.useCallback(()=>l?f(L=>!L):g(L=>!L),[l,g,f]);p.useEffect(()=>{const L=x=>{x.key===OJ&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),W())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[W]);const v=m?"expanded":"collapsed",y=p.useMemo(()=>({state:v,open:m,setOpen:g,isMobile:l,openMobile:u,setOpenMobile:f,toggleSidebar:W}),[v,m,g,l,u,f,W]);return z.jsx(vm.Provider,{value:y,children:z.jsx(PY,{delayDuration:0,children:z.jsx("div",{ref:b,className:q0("group/sidebar-wrapper relative flex h-full w-full has-[[data-variant=inset]]:bg-sidebar",n),style:{"--sidebar-width":zJ,"--sidebar-width-icon":dJ,...r},...i,children:a})})})});Rm.displayName="SidebarProvider";const ym=p.forwardRef(({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:n,children:r,...a},i)=>{const{isMobile:b,state:l,openMobile:u,setOpenMobile:f}=Vn();return o==="none"?z.jsx("div",{ref:i,className:q0("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),role:"navigation",...a,children:r}):b?z.jsx(rJ,{open:u,onOpenChange:f,...a,children:z.jsx(gm,{className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",role:"navigation",side:e,style:{"--sidebar-width":uJ},children:z.jsx("div",{className:"flex size-full flex-col",children:r})})}):z.jsxs("div",{ref:i,className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":l==="collapsed"?o:"","data-side":e,"data-state":l,"data-variant":t,role:"navigation",children:[z.jsx("div",{className:q0("relative h-full w-[--sidebar-width] bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),z.jsx("div",{className:q0("absolute inset-y-0 z-10 hidden h-full w-[--sidebar-width] md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] border-sidebar-border group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...a,children:z.jsx("div",{className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:r})})]})});ym.displayName="Sidebar";const wm=p.forwardRef(({children:e,className:t,onClick:o,...n},r)=>{const{toggleSidebar:a}=Vn();return z.jsx(e1,{ref:r,className:q0("h-7 w-7",t),"data-sidebar":"trigger",size:"icon",variant:"ghost",onClick:i=>{o?.(i),a()},...n,children:e||z.jsxs(z.Fragment,{children:[z.jsx(DZ,{}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})});wm.displayName="SidebarTrigger";const fJ=p.forwardRef(({className:e,...t},o)=>{const{toggleSidebar:n}=Vn();return z.jsx("button",{ref:o,"aria-label":"Toggle Sidebar",className:q0("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),"data-sidebar":"rail",tabIndex:-1,title:"Toggle Sidebar",type:"button",onClick:n,...t})});fJ.displayName="SidebarRail";const Lm=p.forwardRef(({className:e,...t},o)=>z.jsx("main",{ref:o,className:q0("relative flex h-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Lm.displayName="SidebarInset";const AJ=p.forwardRef(({className:e,...t},o)=>z.jsx(w3,{ref:o,className:q0("w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",`h-${L3}`,e),"data-sidebar":"input",...t}));AJ.displayName="SidebarInput";const km=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("flex flex-col gap-2 p-2",e),"data-sidebar":"header",...t}));km.displayName="SidebarHeader";const xm=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("flex flex-col gap-2 p-2",e),"data-sidebar":"footer",...t}));xm.displayName="SidebarFooter";const hJ=p.forwardRef(({className:e,...t},o)=>z.jsx(pm,{ref:o,className:q0("mx-2 w-auto bg-sidebar-border",e),"data-sidebar":"separator",...t}));hJ.displayName="SidebarSeparator";const Cm=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("flex min-h-0 flex-1 flex-col gap-4 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-sidebar":"content",...t}));Cm.displayName="SidebarContent";const ec=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("relative flex w-full min-w-0 flex-col p-2",e),"data-sidebar":"group",...t}));ec.displayName="SidebarGroup";const qJ=p.forwardRef(({className:e,asChild:t=!1,...o},n)=>{const r=t?Jr:"div";return z.jsx(r,{ref:n,className:q0("duration-200 flex shrink-0 items-center rounded-md px-3 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",`h-${L3}`,e),"data-sidebar":"group-label",...o})});qJ.displayName="SidebarGroupLabel";const mJ=p.forwardRef(({className:e,asChild:t=!1,...o},n)=>{const r=t?Jr:"button";return z.jsx(r,{ref:n,className:q0("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"group-action",...o})});mJ.displayName="SidebarGroupAction";const Ha=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("w-full text-sm",e),"data-sidebar":"group-content",...t}));Ha.displayName="SidebarGroupContent";const tc=p.forwardRef(({className:e,...t},o)=>z.jsx("ul",{ref:o,className:q0("flex w-full min-w-0 flex-col gap-0.5",e),"data-sidebar":"menu",...t}));tc.displayName="SidebarMenu";const gd=p.forwardRef(({className:e,...t},o)=>z.jsx("li",{ref:o,className:q0("group/menu-item relative",e),"data-sidebar":"menu-item",...t}));gd.displayName="SidebarMenuItem";const gJ=Gt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md px-3 py-2 text-left text-md font-medium text-sidebar-foreground outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:`h-${L3} text-md`,sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),k3=p.forwardRef(({asChild:e=!1,isActive:t=!1,variant:o="default",size:n="default",tooltip:r,className:a,...i},b)=>{const l=e?Jr:"button",{isMobile:u,state:f}=Vn(),O=z.jsx(l,{ref:b,className:q0(gJ({variant:o,size:n}),a),"data-active":t,"data-sidebar":"menu-button","data-size":n,...i});return r?(typeof r=="string"&&(r={children:r}),z.jsxs(XY,{children:[z.jsx(jY,{asChild:!0,children:O}),z.jsx(lm,{align:"center",hidden:f!=="collapsed"||u,side:"right",...r})]})):O});k3.displayName="SidebarMenuButton";const WJ=p.forwardRef(({className:e,asChild:t=!1,showOnHover:o=!1,...n},r)=>{const a=t?Jr:"button";return z.jsx(a,{ref:r,className:q0("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",o&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),"data-sidebar":"menu-action",...n})});WJ.displayName="SidebarMenuAction";const Wd=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("absolute right-2 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-sm font-medium tabular-nums text-gray-600 select-none pointer-events-none","peer-hover/menu-button: peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1.5","peer-data-[size=default]/menu-button:top-2","peer-data-[size=lg]/menu-button:top-3","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-badge",...t}));Wd.displayName="SidebarMenuBadge";const vJ=p.forwardRef(({className:e,showIcon:t=!1,...o},n)=>{const r=p.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return z.jsxs("div",{ref:n,className:q0("rounded-md flex gap-2 px-3 items-center",`h-${L3}`,e),"data-sidebar":"menu-skeleton",...o,children:[t&&z.jsx(w1,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),z.jsx(w1,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});vJ.displayName="SidebarMenuSkeleton";const RJ=p.forwardRef(({className:e,...t},o)=>z.jsx("ul",{ref:o,className:q0("mx-3.5 flex min-w-0 translate-x-px flex-col gap-0.5 border-l border-sidebar-border px-3 py-0.5","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-sub",...t}));RJ.displayName="SidebarMenuSub";const yJ=p.forwardRef(({...e},t)=>z.jsx("li",{ref:t,...e}));yJ.displayName="SidebarMenuSubItem";const wJ=p.forwardRef(({asChild:e=!1,size:t="md",isActive:o,className:n,...r},a)=>{const i=e?Jr:"a";return z.jsx(i,{ref:a,className:q0("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-3 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),"data-active":o,"data-sidebar":"menu-sub-button","data-size":t,...r})});wJ.displayName="SidebarMenuSubButton";const gp=p.forwardRef(({className:e,onBackToDashboard:t,...o},n)=>z.jsx("div",{ref:n,className:q0("admin-x-container-error",e),...o,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:t,children:"← Back to the dashboard"})]})}));gp.displayName="ErrorPage";const Nm=p.forwardRef(({className:e,...t},o)=>z.jsx("h1",{ref:o,className:q0("scroll-m-20 text-3xl leading-[1.1em] tracking-tighter font-bold",e),...t}));Nm.displayName="H1";const LJ=p.forwardRef(({className:e,...t},o)=>z.jsx("h2",{ref:o,className:q0("scroll-m-20 text-2xl font-bold tracking-tighter first:mt-0",e),...t}));LJ.displayName="H2";const Bm=p.forwardRef(({className:e,...t},o)=>z.jsx("h3",{ref:o,className:q0("scroll-m-20 text-xl font-semibold tracking-tight",e),...t}));Bm.displayName="H3";const m2=p.forwardRef(({className:e,...t},o)=>z.jsx("h4",{ref:o,className:q0("scroll-m-20 text-lg font-semibold tracking-tight",e),...t}));m2.displayName="H4";const kJ=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("text-xs text-muted-foreground tracking-wide font-medium uppercase",e),...t}));kJ.displayName="HTable";const uz=new Map;p.createContext({saveScrollPosition:()=>{},getScrollPosition:()=>{},resetScrollPosition:()=>{}});function xJ(e){uz.delete(e)}function CJ({containerRef:e}){const t=Re(),o=p.useRef(null),n=p.useRef(null);return p.useEffect(()=>{const r=e.current;if(!r)return;const a=()=>{const i=r.scrollTop;uz.set(t.pathname,i),n.current=i};return r.addEventListener("scroll",a),()=>r.removeEventListener("scroll",a)},[t.pathname,e]),p.useEffect(()=>{const r=e.current;if(!r)return;const a=uz.get(t.pathname);a!==void 0&&o.current!==t.pathname&&Math.abs(a-r.scrollTop)>5&&(r.scrollTop=a)},[t.pathname,e]),p.useEffect(()=>{o.current=t.pathname},[t.pathname]),null}function NJ({routes:e,prefix:t,errorElement:o,children:n}){const r=p.useMemo(()=>{const a=`/${t?.replace(/\/+/g,"/").replace(/^\/|\/$/g,"")}`,i={element:z.jsx(xF,{children:n}),children:e.map(b=>({...b,errorElement:b.errorElement||o||z.jsx(gp,{})}))};return AF([i],{basename:a})},[e,t,o,n]);return z.jsx(HI,{router:r})}function _m(){const e=Ca(),{externalNavigate:t}=ha();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o);return}if(n?.crossApp){t({route:o,isExternal:!0});return}e(o,n)},[e,t])}function BJ(){const e=xI();return e&&Object.keys(e).length>0}function qn({to:e,replace:t,state:o,crossApp:n}){const{externalNavigate:r}=ha();return n?(r({route:e,isExternal:!0}),null):z.jsx(QI,{replace:t,state:o,to:e})}function A1(e){return()=>e().then(({default:t})=>({Component:t}))}const _J="FeaturebaseTokenResponseType",EJ={staleTime:7200*60*1e3,refetchInterval:8640*60*1e3,refetchIntervalInBackground:!0},SJ=jn({dataType:_J,path:"/featurebase/token/"}),TJ=(e={})=>SJ({...EJ,...e}),Em=p.createContext(void 0);function Sm(){const e=p.useContext(Em);if(e===void 0)throw new Error("useEmberContext must be used within an EmberProvider");return e}const Of=p0.memo(function(){const t=p.useRef(null),{isFallbackPresent:o}=Sm();return p.useLayoutEffect(()=>{if(t.current){const n=document.getElementById("ember-app");if(n)t.current.appendChild(n);else throw new Error("Ember app not found")}return()=>{const n=document.getElementById("ember-app");if(n)document.body.appendChild(n);else throw new Error("Ember app not found")}},[]),z.jsx("div",{ref:t,hidden:!o,className:"h-full w-full"})});function PJ({children:e}){const[t,o]=p.useState(0),n=p.useCallback(()=>{o(b=>b+1)},[]),r=p.useCallback(()=>{o(b=>Math.max(0,b-1))},[]),i={isFallbackPresent:t>0,registerFallback:n,unregisterFallback:r};return z.jsx(Em.Provider,{value:i,children:e})}function dz(){const{registerFallback:e,unregisterFallback:t}=Sm();return p.useEffect(()=>(e(),()=>{t()}),[e,t]),null}const Tm="ConfigResponseType",_n0=Tm,Ua=jn({dataType:Tm,path:"/config/"}),XJ=e=>{var t,o;return!!((o=(t=e?.hostSettings)==null?void 0:t.managedEmail)!=null&&o.enabled)},jJ=e=>{var t,o;const n=(o=(t=e?.hostSettings)==null?void 0:t.managedEmail)==null?void 0:o.sendingDomain;return typeof n=="string"&&n.length>0},DJ=e=>{var t,o;return(o=(t=e?.hostSettings)==null?void 0:t.managedEmail)==null?void 0:o.sendingDomain},IJ={integration:"IntegrationsResponseType",invite:"InvitesResponseType",offer:"OffersResponseType",newsletter:"NewslettersResponseType",recommendation:"RecommendationResponseType",setting:"SettingsResponseType",theme:"ThemesResponseType",tier:"TiersResponseType",user:"UsersResponseType",post:"PostsResponseType",member:"MembersResponseType",tag:"TagsResponseType",label:"LabelsResponseType",webhook:"WebhooksResponseType"};function Pm(e){if(typeof window>"u")return()=>{};if(window.EmberBridge?.state)return e(window.EmberBridge.state),()=>{};const t=setInterval(()=>{window.EmberBridge?.state&&(clearInterval(t),e(window.EmberBridge.state))},100);return()=>clearInterval(t)}function x3(e,t){let o=null,n=!0;const r=Pm(a=>{n&&(a.on(e,t),o=()=>a.off(e,t))});return()=>{n=!1,r(),o?.()}}function FJ(){const e=d1();p.useEffect(()=>x3("emberDataChange",o=>{const{modelName:n}=o,r=IJ[n];r&&e.invalidateQueries({predicate:a=>a.queryKey[0]===r})}),[e])}function HJ(){const e=d1();p.useEffect(()=>x3("emberAuthChange",o=>{o.isAuthenticated&&e.invalidateQueries()}),[e])}function Xm(){const[e,t]=p.useState(null);return p.useEffect(()=>x3("subscriptionChange",n=>{t(n)}),[]),e}function UJ(e){return x3("sidebarVisibilityChange",e)}function ff(){return window.EmberBridge?.state.sidebarVisible??!0}function jm(){return p.useSyncExternalStore(UJ,ff,ff)}const VJ={getRouteUrl:e=>e,isRouteActive:()=>!1};function Dm(){const[e,t]=p.useState(()=>window.EmberBridge?.state??null),[,o]=p.useState(0);return p.useEffect(()=>{if(!e)return Pm(t);const n=()=>{o(r=>r+1)};return e.on("routeChange",n),()=>e.off("routeChange",n)},[e]),e?{getRouteUrl:e.getRouteUrl,isRouteActive:e.isRouteActive}:VJ}function QJ(){const{data:e}=Ua(),t=Xm();return!(!e?.config?.hostSettings?.forceUpgrade||t?.subscription?.status==="active")}function $J(){const e=QJ(),o=yu().some(n=>n.handle?.allowInForceUpgrade===!0);return e&&!o?z.jsx(qn,{to:"/pro",replace:!0}):z.jsx(yn,{})}const En0=(e,t)=>(o,n)=>{if(!n)return n;const r=(a=>a[e]);if(typeof n=="object"&&"pages"in n){const{pages:a}=n,i=a[a.length-1];return{...n,pages:a.slice(0,-1).concat({...i,[e]:i[e].concat(r(o))})}}return{...n,[e]:n[e].concat(r(o))}},Im=(e,t)=>(o,n)=>{if(!n)return n;const a=(i=>i[e].reduce((l,u)=>({...l,[u.id]:u}),{}))(o);if(typeof n=="object"&&"pages"in n){const{pages:i}=n;return{...n,pages:i.map(b=>({...b,[e]:b[e].map(l=>a[l.id]||l)}))}}return{...n,[e]:n[e].map(i=>a[i.id]||i)}},ZJ=(e,t)=>(o,n,r)=>{if(!n)return n;const a=[r];if(typeof n=="object"&&"pages"in n){const{pages:i}=n;return{...n,pages:i.map(b=>({...b,[e]:b[e].filter(l=>!a.includes(l.id))}))}}return{...n,[e]:n[e].filter(i=>!a.includes(i.id))}},Va=N7,Sn0=bD({dataType:Va,path:"/users/",defaultSearchParams:{limit:"100",include:"roles"},defaultNextPageParams:(e,t)=>{var o;return{...t,page:(((o=e.meta)==null?void 0:o.pagination.next)||1).toString()}},returnData:e=>{const{pages:t}=e,o=t.flatMap(r=>r.users),n=t[t.length-1].meta;return{users:o,meta:n,isEnd:n?n.pagination.pages===n.pagination.page:!0}}}),Tn0=_7({dataType:Va,path:e=>`/users/slug/${e}/`,defaultSearchParams:{include:"roles"}}),Fm=Vt({method:"PUT",path:e=>`/users/${e.id}/`,body:e=>({users:[e]}),searchParams:()=>({include:"roles"}),updateQueries:{dataType:Va,emberUpdateType:"createOrUpdate",update:Im("users")}}),Pn0=Vt({method:"DELETE",path:e=>`/users/${e}/`,updateQueries:{dataType:Va,emberUpdateType:"delete",update:ZJ("users")}}),Xn0=Vt({method:"PUT",path:()=>"/users/password/",body:({newPassword:e,confirmNewPassword:t,userId:o,oldPassword:n})=>({password:[{user_id:o,oldPassword:n||"",newPassword:e,ne2Password:t}]})}),jn0=Vt({method:"PUT",path:()=>"/users/owner/",body:e=>({owner:[{id:e}]}),updateQueries:{dataType:Va,emberUpdateType:"createOrUpdate",update:Im("users")}});function Qa(e){return e.roles.some(t=>t.name==="Owner")}function C3(e){return e.roles.some(t=>t.name==="Administrator")}function Hm(e){return e.roles.some(o=>o.name==="Editor")||e.roles.some(o=>o.name==="Super Editor")}function GJ(e){return e.roles.some(t=>t.name==="Super Editor")}function KJ(e){return e.roles.some(t=>t.name==="Author")}function N3(e){return e.roles.some(t=>t.name==="Contributor")}function Dn0(e){return KJ(e)||N3(e)}function YJ(e){return Qa(e)||C3(e)||Hm(e)}function JJ(e){return Qa(e)||C3(e)||GJ(e)}function e00(e){return Qa(e)||C3(e)||Hm(e)}function t00(e){return Qa(e)||C3(e)}const o00="SiteResponseType",B3=jn({dataType:o00,path:"/site/"});function In0(e){const t=new URL(e.url),o=t.pathname.endsWith("/")?t.pathname:`${t.pathname}/`;return`${t.origin}${o}`}function n00(e,t){if(XJ(t)&&jJ(t))return DJ(t)||"";const o=new URL(e.url).hostname||"";return o.startsWith("www.")?o.replace(/^(www)\.(?=[^/]*\..{2,5})/,""):o}function Fn0(e,t,o){const n=n00(t,o);return e==="noreply"?`noreply@${n}`:e}const Oz=navigator.userAgent.indexOf("Mac")!==-1?"command":"ctrl",r00=Oz==="command"?"⌘K":"Ctrl+K",c00=e=>{e.preventDefault();const t=new KeyboardEvent("keydown",{key:"k",keyCode:75,metaKey:Oz==="command",ctrlKey:Oz==="ctrl"});document.dispatchEvent(t)};function a00({...e}){const{data:t}=ve(),o=B3(),n=o.data?.site.title??"",r=o.data?.site.icon??"https://static.ghost.org/v4.0.0/images/ghost-orb-1.png",a=t&&!N3(t);return z.jsx(km,{...e,children:z.jsxs("div",{className:"flex flex-col items-stretch gap-6",children:[z.jsx("div",{className:"flex items-center justify-between",children:z.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[z.jsx("div",{className:"w-8 h-8 rounded-md bg-transparent border-0 flex-shrink-0",children:z.jsx("img",{src:r,alt:"Site icon",className:"w-full h-full rounded-md object-cover"})}),z.jsx("div",{className:"font-semibold text-[15px] text-foreground overflow-hidden text-ellipsis whitespace-nowrap flex-1",children:n})]})}),a&&z.jsxs(e1,{variant:"outline",className:"flex items-center justify-between text-muted-foreground hover:text-gray-700 hover:bg-background text-base [&_svg]:stroke-2 pr-2 shadow-xs hover:shadow-sm hover:border-gray-200 dark:hover:border-gray-800 h-[38px] dark:bg-gray-950",onClick:c00,children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(od,{className:"text-muted-foreground"}),"Search site"]}),z.jsx(eJ,{className:"text-gray-500 bg-transparent shadow-none dark:text-gray-800",style:{textShadow:"none"},children:r00})]})]})})}function n0(e,t,o){function n(b,l){var u;Object.defineProperty(b,"_zod",{value:b._zod??{},enumerable:!1}),(u=b._zod).traits??(u.traits=new Set),b._zod.traits.add(e),t(b,l);for(const f in i.prototype)f in b||Object.defineProperty(b,f,{value:i.prototype[f].bind(b)});b._zod.constr=i,b._zod.def=l}const r=o?.Parent??Object;class a extends r{}Object.defineProperty(a,"name",{value:e});function i(b){var l;const u=o?.Parent?new a:this;n(u,b),(l=u._zod).deferred??(l.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:b=>o?.Parent&&b instanceof o.Parent?!0:b?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Sr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Um extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Vm={};function Ho(e){return Vm}function s00(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,r])=>t.indexOf(+n)===-1).map(([n,r])=>r)}function fz(e,t){return typeof t=="bigint"?t.toString():t}function vd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Rd(e){return e==null}function yd(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}const Af=Symbol("evaluating");function q1(e,t,o){let n;Object.defineProperty(e,t,{get(){if(n!==Af)return n===void 0&&(n=Af,n=o()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Qn(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function $n(...e){const t={};for(const o of e){const n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function hf(e){return JSON.stringify(e)}const Qm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wp(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const i00=vd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Fr(e){if(Wp(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const o=t.prototype;return!(Wp(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function $m(e){return Fr(e)?{...e}:Array.isArray(e)?[...e]:e}const p00=new Set(["string","number","symbol"]);function _3(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ko(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function D0(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function M00(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function b00(e,t){const o=e._zod.def,n=$n(e._zod.def,{get shape(){const r={};for(const a in t){if(!(a in o.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(r[a]=o.shape[a])}return Qn(this,"shape",r),r},checks:[]});return Ko(e,n)}function l00(e,t){const o=e._zod.def,n=$n(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const a in t){if(!(a in o.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete r[a]}return Qn(this,"shape",r),r},checks:[]});return Ko(e,n)}function z00(e,t){if(!Fr(t))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=$n(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Qn(this,"shape",a),a},checks:[]});return Ko(e,r)}function u00(e,t){if(!Fr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const o={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Qn(this,"shape",n),n},checks:e._zod.def.checks};return Ko(e,o)}function d00(e,t){const o=$n(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Qn(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ko(e,o)}function O00(e,t,o){const n=$n(t._zod.def,{get shape(){const r=t._zod.def.shape,a={...r};if(o)for(const i in o){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(a[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)a[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return Qn(this,"shape",a),a},checks:[]});return Ko(t,n)}function f00(e,t,o){const n=$n(t._zod.def,{get shape(){const r=t._zod.def.shape,a={...r};if(o)for(const i in o){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(a[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)a[i]=new e({type:"nonoptional",innerType:r[i]});return Qn(this,"shape",a),a},checks:[]});return Ko(t,n)}function Rr(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function yr(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function hi(e){return typeof e=="string"?e:e?.message}function Uo(e,t,o){const n={...e,path:e.path??[]};if(!e.message){const r=hi(e.inst?._zod.def?.error?.(e))??hi(t?.error?.(e))??hi(o.customError?.(e))??hi(o.localeError?.(e))??"Invalid input";n.message=r}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function wd(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function da(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const Zm=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fz,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gm=n0("$ZodError",Zm),E3=n0("$ZodError",Zm,{Parent:Error});function A00(e,t=o=>o.message){const o={},n=[];for(const r of e.issues)r.path.length>0?(o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:o}}function h00(e,t=o=>o.message){const o={_errors:[]},n=r=>{for(const a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(i=>n({issues:i}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)o._errors.push(t(a));else{let i=o,b=0;for(;b<a.path.length;){const l=a.path[b];b===a.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(t(a))):i[l]=i[l]||{_errors:[]},i=i[l],b++}}};return n(e),o}const S3=e=>(t,o,n,r)=>{const a=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:o,issues:[]},a);if(i instanceof Promise)throw new Sr;if(i.issues.length){const b=new(r?.Err??e)(i.issues.map(l=>Uo(l,a,Ho())));throw Qm(b,r?.callee),b}return i.value},Hn0=S3(E3),T3=e=>async(t,o,n,r)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:o,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const b=new(r?.Err??e)(i.issues.map(l=>Uo(l,a,Ho())));throw Qm(b,r?.callee),b}return i.value},Un0=T3(E3),P3=e=>(t,o,n)=>{const r=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Sr;return a.issues.length?{success:!1,error:new(e??Gm)(a.issues.map(i=>Uo(i,r,Ho())))}:{success:!0,data:a.value}},q00=P3(E3),X3=e=>async(t,o,n)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:o,issues:[]},r);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>Uo(i,r,Ho())))}:{success:!0,data:a.value}},m00=X3(E3),g00=e=>(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return S3(e)(t,o,r)},W00=e=>(t,o,n)=>S3(e)(t,o,n),v00=e=>async(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return T3(e)(t,o,r)},R00=e=>async(t,o,n)=>T3(e)(t,o,n),y00=e=>(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return P3(e)(t,o,r)},w00=e=>(t,o,n)=>P3(e)(t,o,n),L00=e=>async(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return X3(e)(t,o,r)},k00=e=>async(t,o,n)=>X3(e)(t,o,n),x00=/^[cC][^\s-]{8,}$/,C00=/^[0-9a-z]+$/,N00=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,B00=/^[0-9a-vA-V]{20}$/,_00=/^[A-Za-z0-9]{27}$/,E00=/^[a-zA-Z0-9_-]{21}$/,S00=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,T00=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qf=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,P00=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,X00="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function j00(){return new RegExp(X00,"u")}const D00=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,I00=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,F00=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,H00=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,U00=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Km=/^[A-Za-z0-9_-]*$/,V00=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Q00=/^\+(?:[0-9]){6,14}[0-9]$/,Ym="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",$00=new RegExp(`^${Ym}$`);function Jm(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Z00(e){return new RegExp(`^${Jm(e)}$`)}function G00(e){const t=Jm({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${Ym}T(?:${n})$`)}const K00=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Y00=/^(?:true|false)$/i,J00=/^[^A-Z]*$/,e10=/^[^a-z]*$/,x2=n0("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),eg={number:"number",bigint:"bigint",object:"date"},t10=n0("$ZodCheckLessThan",(e,t)=>{x2.init(e,t);const o=eg[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,a=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:o,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),o10=n0("$ZodCheckGreaterThan",(e,t)=>{x2.init(e,t);const o=eg[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,a=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:o,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),n10=n0("$ZodCheckMaxLength",(e,t)=>{var o;x2.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!Rd(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=wd(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),r10=n0("$ZodCheckMinLength",(e,t)=>{var o;x2.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!Rd(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=wd(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),c10=n0("$ZodCheckLengthEquals",(e,t)=>{var o;x2.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!Rd(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=n=>{const r=n.value,a=r.length;if(a===t.length)return;const i=wd(r),b=a>t.length;n.issues.push({origin:i,...b?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),j3=n0("$ZodCheckStringFormat",(e,t)=>{var o,n;x2.init(e,t),e._zod.onattach.push(r=>{const a=r._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),a10=n0("$ZodCheckRegex",(e,t)=>{j3.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),s10=n0("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=J00),j3.init(e,t)}),i10=n0("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=e10),j3.init(e,t)}),p10=n0("$ZodCheckIncludes",(e,t)=>{x2.init(e,t);const o=_3(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(r=>{const a=r._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),M10=n0("$ZodCheckStartsWith",(e,t)=>{x2.init(e,t);const o=new RegExp(`^${_3(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),b10=n0("$ZodCheckEndsWith",(e,t)=>{x2.init(e,t);const o=new RegExp(`.*${_3(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),l10=n0("$ZodCheckOverwrite",(e,t)=>{x2.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class z10{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
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}))),KG="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",YG=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:GG,default:KG},Symbol.toStringTag,{value:"Module"})),JG=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})),eK="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",tK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:JG,default:eK},Symbol.toStringTag,{value:"Module"})),oK=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})),nK="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",rK=Object.freeze(Object.defineProperty({__proto__:null,ReactComponent:oK,default:nK},Symbol.toStringTag,{value:"Module"})),cK=Gt("",{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":VG,"../../assets/icons/info-fill.svg":ZG,"../../assets/icons/skull-and-bones.svg":YG,"../../assets/icons/success-fill.svg":tK,"../../assets/icons/typography.svg":rK}),Ii=Object.entries(aK).reduce((e,[t,o])=>{var n;const r=((n=t.match(/[^/]+(?=\.svg$)/))==null?void 0:n[0])??"",a=W$(r),i=b=>{const{size:l,className:u,...f}=b,O=q0(cK({size:l,className:u}));return p0.createElement(o.ReactComponent,{...f,className:O})};return i.displayName=`Icon.${a}`,e[a]=i,e},{}),kn0=Ii,sK=p.createContext({isAnyTextFieldFocused:!1,setFocusState:()=>{},darkMode:!1}),iK=()=>{const[e,t]=p.useState(!1);return p.useEffect(()=>(t(!0),()=>t(!1)),[]),e?Pp.createPortal(z.jsx("div",{className:Go,style:{width:"unset",height:"unset"},children:z.jsx(DG,{icons:{error:z.jsx(Ii.ErrorFill,{className:"text-red"}),success:z.jsx(Ii.SuccessFill,{className:"text-green"}),info:z.jsx(Ii.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},pK=({darkMode:e,children:t})=>{const[o,n]=p.useState(!1),r=a=>{n(a)};return z.jsx(sK.Provider,{value:{isAnyTextFieldFocused:o,setFocusState:r,darkMode:e},children:z.jsxs(FG,{children:[t,z.jsx(iK,{})]})})},Go="shade shade-admin shade-activitypub shade-stats shade-posts",MK=({darkMode:e,fetchKoenigLexical:t,className:o,children:n,...r})=>{const a=Z1("shade",o);return z.jsx("div",{className:a,...r,children:z.jsx(pK,{darkMode:e,children:n})})},bK=GF,lK=KF,zK=YF,t9=p.forwardRef(({className:e,...t},o)=>z.jsx(jq,{className:q0("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}));t9.displayName=jq.displayName;const o9=p.forwardRef(({className:e,...t},o)=>z.jsx(zK,{children:z.jsxs("div",{className:Go,children:[z.jsx(t9,{onClick:n=>n.stopPropagation()}),z.jsx(Dq,{ref:o,className:q0("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})]})}));o9.displayName=Dq.displayName;const n9=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col space-y-2 text-center sm:text-left",e),...t});n9.displayName="AlertDialogHeader";const r9=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 [&>button]:min-w-20",e),...t});r9.displayName="AlertDialogFooter";const c9=p.forwardRef(({className:e,...t},o)=>z.jsx(Hq,{ref:o,className:q0("text-xl font-semibold",e),...t}));c9.displayName=Hq.displayName;const a9=p.forwardRef(({className:e,...t},o)=>z.jsx(Uq,{ref:o,className:q0("text-base",e),...t}));a9.displayName=Uq.displayName;const s9=p.forwardRef(({className:e,...t},o)=>z.jsx(Iq,{ref:o,className:q0(h3(),e),...t}));s9.displayName=Iq.displayName;const i9=p.forwardRef(({className:e,...t},o)=>z.jsx(Fq,{ref:o,className:q0(h3({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));i9.displayName=Fq.displayName;const uK=p.lazy(()=>M1(()=>import("./index-DYM1MbXR.js"),[],import.meta.url)),zf=e=>z.jsx(p.Suspense,{fallback:z.jsx("div",{}),children:z.jsx(uK,{...e})}),ad=p.forwardRef(({className:e,...t},o)=>z.jsx(s7,{ref:o,className:q0("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));ad.displayName=s7.displayName;const sd=p.forwardRef(({className:e,...t},o)=>z.jsx(i7,{ref:o,className:q0("aspect-square h-full w-full",e),...t}));sd.displayName=i7.displayName;const id=p.forwardRef(({className:e,...t},o)=>z.jsx(p7,{ref:o,className:q0("flex h-full w-full items-center justify-center rounded-full bg-muted [&_svg]:size-4",e),...t}));id.displayName=p7.displayName;const dK=Gt("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 OK({className:e,variant:t,...o}){return z.jsx("div",{className:q0(dK({variant:t}),e),...o})}const fK=Gt("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"}}),pd=p.forwardRef((e,t)=>{const{variant:o,size:n,dismissible:r=!1,onDismiss:a,role:i="status",className:b,children:l,...u}=e,f=O=>{O.preventDefault(),O.stopPropagation(),r&&a&&a()};return z.jsxs("div",{ref:t,className:q0(fK({variant:o,size:n}),b),role:i,...u,children:[r&&z.jsx(e1,{"aria-label":"Dismiss notification",className:"absolute right-1 top-1 size-8 text-gray-600",size:"icon",variant:"ghost",onClick:f,children:z.jsx(cd,{className:"size-5"})}),l]})});pd.displayName="Banner";const q3=Nu,p9=Bu,AK=_u,hK=c3,M9=p.forwardRef(({className:e,...t},o)=>z.jsx(_a,{ref:o,className:q0("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}));M9.displayName=_a.displayName;const Da=p.forwardRef(({className:e,children:t,...o},n)=>z.jsx(AK,{children:z.jsxs("div",{className:Go,children:[z.jsx(M9,{}),z.jsx(Ea,{ref:n,className:q0("fixed left-[50%] top-[8vmin] z-50 grid w-full max-w-lg translate-x-[-50%] gap-6 bg-background dark:bg-[#101114] p-6 shadow-lg duration-200 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=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2 sm:rounded-lg outline-none",e),...o,children:t})]})}));Da.displayName=Ea.displayName;const Md=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Md.displayName="DialogHeader";const bd=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 sm:items-end [&_button]:min-w-20",e),...t});bd.displayName="DialogFooter";const ld=p.forwardRef(({className:e,...t},o)=>z.jsx(Sa,{ref:o,className:q0("text-xl font-semibold leading-none tracking-tight",e),...t}));ld.displayName=Sa.displayName;const b9=p.forwardRef(({className:e,...t},o)=>z.jsx(Ta,{ref:o,className:q0("text-sm text-muted-foreground",e),...t}));b9.displayName=Ta.displayName;var zz=["Enter"," "],qK=["ArrowDown","PageUp","Home"],l9=["ArrowUp","PageDown","End"],mK=[...qK,...l9],gK={ltr:[...zz,"ArrowRight"],rtl:[...zz,"ArrowLeft"]},WK={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ia="Menu",[za,vK,RK]=fh(Ia),[Hn,z9]=y2(Ia,[RK,$o,qh]),m3=$o(),u9=qh(),[yK,Un]=Hn(Ia),[wK,Fa]=Hn(Ia),d9=e=>{const{__scopeMenu:t,open:o=!1,children:n,dir:r,onOpenChange:a,modal:i=!0}=e,b=m3(t),[l,u]=p.useState(null),f=p.useRef(!1),O=dt(a),h=Ah(r);return p.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),z.jsx(Hp,{...b,children:z.jsx(yK,{scope:t,open:o,onOpenChange:O,content:l,onContentChange:u,children:z.jsx(wK,{scope:t,onClose:p.useCallback(()=>O(!1),[O]),isUsingKeyboardRef:f,dir:h,modal:i,children:n})})})};d9.displayName=Ia;var LK="MenuAnchor",zd=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e,r=m3(o);return z.jsx(Ra,{...r,...n,ref:t})});zd.displayName=LK;var ud="MenuPortal",[kK,O9]=Hn(ud,{forceMount:void 0}),f9=e=>{const{__scopeMenu:t,forceMount:o,children:n,container:r}=e,a=Un(ud,t);return z.jsx(kK,{scope:t,forceMount:o,children:z.jsx(s2,{present:o||a.open,children:z.jsx(ya,{asChild:!0,container:r,children:n})})})};f9.displayName=ud;var g2="MenuContent",[xK,dd]=Hn(g2),A9=p.forwardRef((e,t)=>{const o=O9(g2,e.__scopeMenu),{forceMount:n=o.forceMount,...r}=e,a=Un(g2,e.__scopeMenu),i=Fa(g2,e.__scopeMenu);return z.jsx(za.Provider,{scope:e.__scopeMenu,children:z.jsx(s2,{present:n||a.open,children:z.jsx(za.Slot,{scope:e.__scopeMenu,children:i.modal?z.jsx(CK,{...r,ref:t}):z.jsx(NK,{...r,ref:t})})})})}),CK=p.forwardRef((e,t)=>{const o=Un(g2,e.__scopeMenu),n=p.useRef(null),r=W1(t,n);return p.useEffect(()=>{const a=n.current;if(a)return fu(a)},[]),z.jsx(Od,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:L0(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),NK=p.forwardRef((e,t)=>{const o=Un(g2,e.__scopeMenu);return z.jsx(Od,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),BK=Xr("MenuContent.ScrollLock"),Od=p.forwardRef((e,t)=>{const{__scopeMenu:o,loop:n=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:b,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:O,onInteractOutside:h,onDismiss:m,disableOutsideScroll:g,...W}=e,v=Un(g2,o),y=Fa(g2,o),L=m3(o),x=u9(o),k=vK(o),[C,w]=p.useState(null),P=p.useRef(null),F=W1(t,P,v.onContentChange),e0=p.useRef(0),G=p.useRef(""),Y=p.useRef(0),o0=p.useRef(null),K=p.useRef("right"),a0=p.useRef(0),g0=g?Kp:p.Fragment,Q=g?{as:BK,allowPinchZoom:!0}:void 0,A0=X=>{const Z=G.current+X,B=k().filter(z0=>!z0.disabled),I=document.activeElement,b0=B.find(z0=>z0.ref.current===I)?.textValue,O0=B.map(z0=>z0.textValue),m0=UK(O0,Z,b0),W0=B.find(z0=>z0.textValue===m0)?.ref.current;(function z0(t0){G.current=t0,window.clearTimeout(e0.current),t0!==""&&(e0.current=window.setTimeout(()=>z0(""),1e3))})(Z),W0&&setTimeout(()=>W0.focus())};p.useEffect(()=>()=>window.clearTimeout(e0.current),[]),Ou();const $=p.useCallback(X=>K.current===o0.current?.side&&QK(X,o0.current?.area),[]);return z.jsx(xK,{scope:o,searchRef:G,onItemEnter:p.useCallback(X=>{$(X)&&X.preventDefault()},[$]),onItemLeave:p.useCallback(X=>{$(X)||(P.current?.focus(),w(null))},[$]),onTriggerLeave:p.useCallback(X=>{$(X)&&X.preventDefault()},[$]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:p.useCallback(X=>{o0.current=X},[]),children:z.jsx(g0,{...Q,children:z.jsx(Zp,{asChild:!0,trapped:r,onMountAutoFocus:L0(a,X=>{X.preventDefault(),P.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:z.jsx($r,{asChild:!0,disableOutsidePointerEvents:b,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:O,onInteractOutside:h,onDismiss:m,children:z.jsx(PP,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:L0(l,X=>{y.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:z.jsx(Up,{role:"menu","aria-orientation":"vertical","data-state":_9(v.open),"data-radix-menu-content":"",dir:y.dir,...L,...W,ref:F,style:{outline:"none",...W.style},onKeyDown:L0(W.onKeyDown,X=>{const B=X.target.closest("[data-radix-menu-content]")===X.currentTarget,I=X.ctrlKey||X.altKey||X.metaKey,b0=X.key.length===1;B&&(X.key==="Tab"&&X.preventDefault(),!I&&b0&&A0(X.key));const O0=P.current;if(X.target!==O0||!mK.includes(X.key))return;X.preventDefault();const W0=k().filter(z0=>!z0.disabled).map(z0=>z0.ref.current);l9.includes(X.key)&&W0.reverse(),FK(W0)}),onBlur:L0(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(e0.current),G.current="")}),onPointerMove:L0(e.onPointerMove,ua(X=>{const Z=X.target,B=a0.current!==X.clientX;if(X.currentTarget.contains(Z)&&B){const I=X.clientX>a0.current?"right":"left";K.current=I,a0.current=X.clientX}}))})})})})})})});A9.displayName=g2;var _K="MenuGroup",fd=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return z.jsx(O1.div,{role:"group",...n,ref:t})});fd.displayName=_K;var EK="MenuLabel",h9=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return z.jsx(O1.div,{...n,ref:t})});h9.displayName=EK;var fp="MenuItem",uf="menu.itemSelect",g3=p.forwardRef((e,t)=>{const{disabled:o=!1,onSelect:n,...r}=e,a=p.useRef(null),i=Fa(fp,e.__scopeMenu),b=dd(fp,e.__scopeMenu),l=W1(t,a),u=p.useRef(!1),f=()=>{const O=a.current;if(!o&&O){const h=new CustomEvent(uf,{bubbles:!0,cancelable:!0});O.addEventListener(uf,m=>n?.(m),{once:!0}),HA(O,h),h.defaultPrevented?u.current=!1:i.onClose()}};return z.jsx(q9,{...r,ref:l,disabled:o,onClick:L0(e.onClick,f),onPointerDown:O=>{e.onPointerDown?.(O),u.current=!0},onPointerUp:L0(e.onPointerUp,O=>{u.current||O.currentTarget?.click()}),onKeyDown:L0(e.onKeyDown,O=>{const h=b.searchRef.current!=="";o||h&&O.key===" "||zz.includes(O.key)&&(O.currentTarget.click(),O.preventDefault())})})});g3.displayName=fp;var q9=p.forwardRef((e,t)=>{const{__scopeMenu:o,disabled:n=!1,textValue:r,...a}=e,i=dd(fp,o),b=u9(o),l=p.useRef(null),u=W1(t,l),[f,O]=p.useState(!1),[h,m]=p.useState("");return p.useEffect(()=>{const g=l.current;g&&m((g.textContent??"").trim())},[a.children]),z.jsx(za.ItemSlot,{scope:o,disabled:n,textValue:r??h,children:z.jsx(XP,{asChild:!0,...b,focusable:!n,children:z.jsx(O1.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...a,ref:u,onPointerMove:L0(e.onPointerMove,ua(g=>{n?i.onItemLeave(g):(i.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:L0(e.onPointerLeave,ua(g=>i.onItemLeave(g))),onFocus:L0(e.onFocus,()=>O(!0)),onBlur:L0(e.onBlur,()=>O(!1))})})})}),SK="MenuCheckboxItem",m9=p.forwardRef((e,t)=>{const{checked:o=!1,onCheckedChange:n,...r}=e;return z.jsx(y9,{scope:e.__scopeMenu,checked:o,children:z.jsx(g3,{role:"menuitemcheckbox","aria-checked":Ap(o)?"mixed":o,...r,ref:t,"data-state":hd(o),onSelect:L0(r.onSelect,()=>n?.(Ap(o)?!0:!o),{checkForDefaultPrevented:!1})})})});m9.displayName=SK;var g9="MenuRadioGroup",[TK,PK]=Hn(g9,{value:void 0,onValueChange:()=>{}}),W9=p.forwardRef((e,t)=>{const{value:o,onValueChange:n,...r}=e,a=dt(n);return z.jsx(TK,{scope:e.__scopeMenu,value:o,onValueChange:a,children:z.jsx(fd,{...r,ref:t})})});W9.displayName=g9;var v9="MenuRadioItem",R9=p.forwardRef((e,t)=>{const{value:o,...n}=e,r=PK(v9,e.__scopeMenu),a=o===r.value;return z.jsx(y9,{scope:e.__scopeMenu,checked:a,children:z.jsx(g3,{role:"menuitemradio","aria-checked":a,...n,ref:t,"data-state":hd(a),onSelect:L0(n.onSelect,()=>r.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});R9.displayName=v9;var Ad="MenuItemIndicator",[y9,XK]=Hn(Ad,{checked:!1}),w9=p.forwardRef((e,t)=>{const{__scopeMenu:o,forceMount:n,...r}=e,a=XK(Ad,o);return z.jsx(s2,{present:n||Ap(a.checked)||a.checked===!0,children:z.jsx(O1.span,{...r,ref:t,"data-state":hd(a.checked)})})});w9.displayName=Ad;var jK="MenuSeparator",L9=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e;return z.jsx(O1.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});L9.displayName=jK;var DK="MenuArrow",k9=p.forwardRef((e,t)=>{const{__scopeMenu:o,...n}=e,r=m3(o);return z.jsx(Vp,{...r,...n,ref:t})});k9.displayName=DK;var IK="MenuSub",[xn0,x9]=Hn(IK),Gc="MenuSubTrigger",C9=p.forwardRef((e,t)=>{const o=Un(Gc,e.__scopeMenu),n=Fa(Gc,e.__scopeMenu),r=x9(Gc,e.__scopeMenu),a=dd(Gc,e.__scopeMenu),i=p.useRef(null),{pointerGraceTimerRef:b,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},f=p.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return p.useEffect(()=>f,[f]),p.useEffect(()=>{const O=b.current;return()=>{window.clearTimeout(O),l(null)}},[b,l]),z.jsx(zd,{asChild:!0,...u,children:z.jsx(q9,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":r.contentId,"data-state":_9(o.open),...e,ref:Tn(t,r.onTriggerChange),onClick:O=>{e.onClick?.(O),!(e.disabled||O.defaultPrevented)&&(O.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:L0(e.onPointerMove,ua(O=>{a.onItemEnter(O),!O.defaultPrevented&&!e.disabled&&!o.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{o.onOpenChange(!0),f()},100))})),onPointerLeave:L0(e.onPointerLeave,ua(O=>{f();const h=o.content?.getBoundingClientRect();if(h){const m=o.content?.dataset.side,g=m==="right",W=g?-5:5,v=h[g?"left":"right"],y=h[g?"right":"left"];a.onPointerGraceIntentChange({area:[{x:O.clientX+W,y:O.clientY},{x:v,y:h.top},{x:y,y:h.top},{x:y,y:h.bottom},{x:v,y:h.bottom}],side:m}),window.clearTimeout(b.current),b.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(O),O.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:L0(e.onKeyDown,O=>{const h=a.searchRef.current!=="";e.disabled||h&&O.key===" "||gK[n.dir].includes(O.key)&&(o.onOpenChange(!0),o.content?.focus(),O.preventDefault())})})})});C9.displayName=Gc;var N9="MenuSubContent",B9=p.forwardRef((e,t)=>{const o=O9(g2,e.__scopeMenu),{forceMount:n=o.forceMount,...r}=e,a=Un(g2,e.__scopeMenu),i=Fa(g2,e.__scopeMenu),b=x9(N9,e.__scopeMenu),l=p.useRef(null),u=W1(t,l);return z.jsx(za.Provider,{scope:e.__scopeMenu,children:z.jsx(s2,{present:n||a.open,children:z.jsx(za.Slot,{scope:e.__scopeMenu,children:z.jsx(Od,{id:b.contentId,"aria-labelledby":b.triggerId,...r,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:L0(e.onFocusOutside,f=>{f.target!==b.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:L0(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:L0(e.onKeyDown,f=>{const O=f.currentTarget.contains(f.target),h=WK[i.dir].includes(f.key);O&&h&&(a.onOpenChange(!1),b.trigger?.focus(),f.preventDefault())})})})})})});B9.displayName=N9;function _9(e){return e?"open":"closed"}function Ap(e){return e==="indeterminate"}function hd(e){return Ap(e)?"indeterminate":e?"checked":"unchecked"}function FK(e){const t=document.activeElement;for(const o of e)if(o===t||(o.focus(),document.activeElement!==t))return}function HK(e,t){return e.map((o,n)=>e[(t+n)%e.length])}function UK(e,t,o){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=o?e.indexOf(o):-1;let i=HK(e,Math.max(a,0));r.length===1&&(i=i.filter(u=>u!==o));const l=i.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==o?l:void 0}function VK(e,t){const{x:o,y:n}=e;let r=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const b=t[a],l=t[i],u=b.x,f=b.y,O=l.x,h=l.y;f>n!=h>n&&o<(O-u)*(n-f)/(h-f)+u&&(r=!r)}return r}function QK(e,t){if(!t)return!1;const o={x:e.clientX,y:e.clientY};return VK(o,t)}function ua(e){return t=>t.pointerType==="mouse"?e(t):void 0}var $K=d9,ZK=zd,GK=f9,KK=A9,YK=fd,JK=h9,eY=g3,tY=m9,oY=W9,nY=R9,rY=w9,cY=L9,aY=k9,sY=C9,iY=B9,W3="DropdownMenu",[pY]=y2(W3,[z9]),je=z9(),[MY,E9]=pY(W3),S9=e=>{const{__scopeDropdownMenu:t,children:o,dir:n,open:r,defaultOpen:a,onOpenChange:i,modal:b=!0}=e,l=je(t),u=p.useRef(null),[f,O]=Pn({prop:r,defaultProp:a??!1,onChange:i,caller:W3});return z.jsx(MY,{scope:t,triggerId:H2(),triggerRef:u,contentId:H2(),open:f,onOpenChange:O,onOpenToggle:p.useCallback(()=>O(h=>!h),[O]),modal:b,children:z.jsx($K,{...l,open:f,onOpenChange:O,dir:n,modal:b,children:o})})};S9.displayName=W3;var T9="DropdownMenuTrigger",P9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,disabled:n=!1,...r}=e,a=E9(T9,o),i=je(o);return z.jsx(ZK,{asChild:!0,...i,children:z.jsx(O1.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...r,ref:Tn(t,a.triggerRef),onPointerDown:L0(e.onPointerDown,b=>{!n&&b.button===0&&b.ctrlKey===!1&&(a.onOpenToggle(),a.open||b.preventDefault())}),onKeyDown:L0(e.onKeyDown,b=>{n||(["Enter"," "].includes(b.key)&&a.onOpenToggle(),b.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(b.key)&&b.preventDefault())})})})});P9.displayName=T9;var bY="DropdownMenuPortal",X9=e=>{const{__scopeDropdownMenu:t,...o}=e,n=je(t);return z.jsx(GK,{...n,...o})};X9.displayName=bY;var j9="DropdownMenuContent",D9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=E9(j9,o),a=je(o),i=p.useRef(!1);return z.jsx(KK,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...n,ref:t,onCloseAutoFocus:L0(e.onCloseAutoFocus,b=>{i.current||r.triggerRef.current?.focus(),i.current=!1,b.preventDefault()}),onInteractOutside:L0(e.onInteractOutside,b=>{const l=b.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});D9.displayName=j9;var lY="DropdownMenuGroup",I9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(YK,{...r,...n,ref:t})});I9.displayName=lY;var zY="DropdownMenuLabel",F9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(JK,{...r,...n,ref:t})});F9.displayName=zY;var uY="DropdownMenuItem",H9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(eY,{...r,...n,ref:t})});H9.displayName=uY;var dY="DropdownMenuCheckboxItem",U9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(tY,{...r,...n,ref:t})});U9.displayName=dY;var OY="DropdownMenuRadioGroup",fY=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(oY,{...r,...n,ref:t})});fY.displayName=OY;var AY="DropdownMenuRadioItem",V9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(nY,{...r,...n,ref:t})});V9.displayName=AY;var hY="DropdownMenuItemIndicator",Q9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(rY,{...r,...n,ref:t})});Q9.displayName=hY;var qY="DropdownMenuSeparator",$9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(cY,{...r,...n,ref:t})});$9.displayName=qY;var mY="DropdownMenuArrow",gY=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(aY,{...r,...n,ref:t})});gY.displayName=mY;var WY="DropdownMenuSubTrigger",Z9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(sY,{...r,...n,ref:t})});Z9.displayName=WY;var vY="DropdownMenuSubContent",G9=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:o,...n}=e,r=je(o);return z.jsx(iY,{...r,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});G9.displayName=vY;var RY=S9,yY=P9,wY=X9,K9=D9,LY=I9,Y9=F9,J9=H9,em=U9,tm=V9,om=Q9,nm=$9,rm=Z9,cm=G9;const am=RY,sm=yY,Cn0=LY,kY=p.forwardRef(({className:e,inset:t,children:o,...n},r)=>z.jsxs(rm,{ref:r,className:q0("flex cursor-default gap-2 select-none hover:bg-accent items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[o,z.jsx(Ju,{className:"ml-auto"})]}));kY.displayName=rm.displayName;const xY=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{className:Go,children:z.jsx(cm,{ref:o,className:q0("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));xY.displayName=cm.displayName;const qd=p.forwardRef(({className:e,sideOffset:t=4,...o},n)=>z.jsx(wY,{children:z.jsx("div",{className:Go,children:z.jsx(K9,{ref:n,className:q0("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),sideOffset:t,...o})})}));qd.displayName=K9.displayName;const im=p.forwardRef(({className:e,inset:t,...o},n)=>z.jsx(J9,{ref:n,className:q0("relative flex cursor-default select-none cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...o}));im.displayName=J9.displayName;const CY=p.forwardRef(({className:e,children:t,checked:o,...n},r)=>z.jsxs(em,{ref:r,checked:o,className:q0("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[z.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:z.jsx(om,{children:z.jsx(U8,{className:"size-4"})})}),t]}));CY.displayName=em.displayName;const NY=p.forwardRef(({className:e,children:t,...o},n)=>z.jsxs(tm,{ref:n,className:q0("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[z.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:z.jsx(om,{children:z.jsx(sZ,{className:"size-2 fill-current"})})}),t]}));NY.displayName=tm.displayName;const BY=p.forwardRef(({className:e,inset:t,...o},n)=>z.jsx(Y9,{ref:n,className:q0("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));BY.displayName=Y9.displayName;const kn=p.forwardRef(({className:e,...t},o)=>z.jsx(nm,{ref:o,className:q0("-mx-1 my-1 h-px bg-muted",e),...t}));kn.displayName=nm.displayName;const pm=p.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...n},r)=>z.jsx($A,{ref:r,className:q0("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),decorative:o,orientation:t,...n}));pm.displayName=$A.displayName;const _Y=$j,EY=Zj,Ml=Gj,Mm=p.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},r)=>z.jsx(k7,{ref:r,align:t,className:q0("z-50 rounded-md bg-white dark:bg-gray-950 p-5 text-popover-foreground shadow-md border outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),sideOffset:o,...n}));Mm.displayName=k7.displayName;const SY=Gt("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-5 w-9",sm:"h-4 w-7"}},defaultVariants:{size:"default"}}),TY=Gt("pointer-events-none block rounded-full bg-background ring-0 transition-transform [filter:drop-shadow(0_1px_2px_rgba(0,0,0,0.07))] data-[state=unchecked]:translate-x-0",{variants:{size:{default:"size-4 data-[state=checked]:translate-x-4",sm:"size-3 data-[state=checked]:translate-x-3"}},defaultVariants:{size:"default"}}),bm=p.forwardRef(({className:e,size:t,...o},n)=>z.jsx(xh,{className:q0(SY({size:t,className:e})),...o,ref:n,children:z.jsx(HP,{className:q0(TY({size:t}))})}));bm.displayName=xh.displayName;const PY=kX,XY=xX,jY=CX,lm=p.forwardRef(({className:e,sideOffset:t=4,...o},n)=>z.jsx(NX,{children:z.jsx("div",{className:Go,children:z.jsx(Jh,{ref:n,className:q0("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),sideOffset:t,...o})})}));lm.displayName=Jh.displayName;var bl,v3="HoverCard",[zm]=y2(v3,[$o]),R3=$o(),[DY,y3]=zm(v3),um=e=>{const{__scopeHoverCard:t,children:o,open:n,defaultOpen:r,onOpenChange:a,openDelay:i=700,closeDelay:b=300}=e,l=R3(t),u=p.useRef(0),f=p.useRef(0),O=p.useRef(!1),h=p.useRef(!1),[m,g]=Pn({prop:n,defaultProp:r??!1,onChange:a,caller:v3}),W=p.useCallback(()=>{clearTimeout(f.current),u.current=window.setTimeout(()=>g(!0),i)},[i,g]),v=p.useCallback(()=>{clearTimeout(u.current),!O.current&&!h.current&&(f.current=window.setTimeout(()=>g(!1),b))},[b,g]),y=p.useCallback(()=>g(!1),[g]);return p.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(f.current)},[]),z.jsx(DY,{scope:t,open:m,onOpenChange:g,onOpen:W,onClose:v,onDismiss:y,hasSelectionRef:O,isPointerDownOnContentRef:h,children:z.jsx(Hp,{...l,children:o})})};um.displayName=v3;var dm="HoverCardTrigger",Om=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,...n}=e,r=y3(dm,o),a=R3(o);return z.jsx(Ra,{asChild:!0,...a,children:z.jsx(O1.a,{"data-state":r.open?"open":"closed",...n,ref:t,onPointerEnter:L0(e.onPointerEnter,qp(r.onOpen)),onPointerLeave:L0(e.onPointerLeave,qp(r.onClose)),onFocus:L0(e.onFocus,r.onOpen),onBlur:L0(e.onBlur,r.onClose),onTouchStart:L0(e.onTouchStart,i=>i.preventDefault())})})});Om.displayName=dm;var md="HoverCardPortal",[IY,FY]=zm(md,{forceMount:void 0}),fm=e=>{const{__scopeHoverCard:t,forceMount:o,children:n,container:r}=e,a=y3(md,t);return z.jsx(IY,{scope:t,forceMount:o,children:z.jsx(s2,{present:o||a.open,children:z.jsx(ya,{asChild:!0,container:r,children:n})})})};fm.displayName=md;var hp="HoverCardContent",Am=p.forwardRef((e,t)=>{const o=FY(hp,e.__scopeHoverCard),{forceMount:n=o.forceMount,...r}=e,a=y3(hp,e.__scopeHoverCard);return z.jsx(s2,{present:n||a.open,children:z.jsx(HY,{"data-state":a.open?"open":"closed",...r,onPointerEnter:L0(e.onPointerEnter,qp(a.onOpen)),onPointerLeave:L0(e.onPointerLeave,qp(a.onClose)),ref:t})})});Am.displayName=hp;var HY=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:i,...b}=e,l=y3(hp,o),u=R3(o),f=p.useRef(null),O=W1(t,f),[h,m]=p.useState(!1);return p.useEffect(()=>{if(h){const g=document.body;return bl=g.style.userSelect||g.style.webkitUserSelect,g.style.userSelect="none",g.style.webkitUserSelect="none",()=>{g.style.userSelect=bl,g.style.webkitUserSelect=bl}}},[h]),p.useEffect(()=>{if(f.current){const g=()=>{m(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",g),()=>{document.removeEventListener("pointerup",g),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),p.useEffect(()=>{f.current&&QY(f.current).forEach(W=>W.setAttribute("tabindex","-1"))}),z.jsx($r,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:L0(a,g=>{g.preventDefault()}),onDismiss:l.onDismiss,children:z.jsx(Up,{...u,...b,onPointerDown:L0(b.onPointerDown,g=>{g.currentTarget.contains(g.target)&&m(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:O,style:{...b.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),UY="HoverCardArrow",VY=p.forwardRef((e,t)=>{const{__scopeHoverCard:o,...n}=e,r=R3(o);return z.jsx(Vp,{...r,...n,ref:t})});VY.displayName=UY;function qp(e){return t=>t.pointerType==="touch"?void 0:e()}function QY(e){const t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;o.nextNode();)t.push(o.currentNode);return t}var $Y=um,ZY=Om,GY=fm,hm=Am;const KY=$Y,YY=ZY,qm=p.forwardRef(({className:e,align:t="center",sideOffset:o=4,...n},r)=>z.jsx(GY,{children:z.jsx("div",{className:Go,children:z.jsx(hm,{ref:r,align:t,className:q0("pointer-events-auto z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",e),sideOffset:o,...n})})}));qm.displayName=hm.displayName;const JY=Gt("rounded-full",{variants:{variant:{neutral:"bg-muted",info:"bg-blue-500",success:"bg-green-500",error:"bg-red-500",warning:"bg-yellow-500"},state:{idle:"",active:"animate-pulse",inactive:"border-2 bg-transparent"},size:{sm:"size-2",md:"size-3",lg:"size-4"}},compoundVariants:[{variant:"neutral",state:"inactive",className:"border-muted-foreground"},{variant:"info",state:"inactive",className:"border-blue-500"},{variant:"success",state:"inactive",className:"border-green-500"},{variant:"error",state:"inactive",className:"border-red-500"},{variant:"warning",state:"inactive",className:"border-yellow-500"}],defaultVariants:{variant:"success",state:"idle",size:"sm"}});function df({className:e,variant:t,state:o,size:n,label:r,...a}){return z.jsxs("span",{className:"inline-flex items-center",...a,children:[z.jsx("span",{"aria-hidden":"true",className:q0(JY({variant:t,state:o,size:n}),e)}),r&&z.jsx("span",{className:"sr-only",children:r})]})}const w3=p.forwardRef(({className:e,type:t,...o},n)=>z.jsx("input",{ref:n,className:q0("flex h-9 w-full rounded-md border border-transparent bg-gray-150 dark:bg-gray-900 px-3 py-1 text-base transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:bg-transparent focus-visible:border-green focus-visible:shadow-[0_0_0_2px_rgba(48,207,67,.25)] disabled:cursor-not-allowed disabled:opacity-50",e),type:t,...o}));w3.displayName="Input";function eJ({className:e,...t}){return z.jsx("kbd",{className:q0("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium m-0 shadow-none border-none text-shadow-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e),"data-slot":"kbd",...t})}function w1({containerClassName:e,count:t=1,randomize:o=!1,minWidth:n=70,maxWidth:r=100,className:a,...i}){const{randomWidths:b,keys:l}=p.useMemo(()=>{const u=[],f=[];for(let O=0;O<t;O++){if(o){const h=Math.floor((r-n)/5),m=Math.floor(Math.random()*(h+1)),g=n+m*5;u.push(`${g}%`)}f.push(`skeleton-${crypto.randomUUID()}`)}return{randomWidths:u,keys:f}},[t,o,n,r]);return z.jsx("span",{className:e,children:Array.from({length:t}).map((u,f)=>z.jsxs(p0.Fragment,{children:[z.jsx("span",{className:q0("inline-flex w-full leading-none animate-pulse rounded-[2px] bg-primary/10",a),style:o?{width:b[f]}:void 0,...i,children:""}),z.jsx("br",{})]},l[f]))})}const tJ=p0.forwardRef(({className:e,lines:t=5,...o},n)=>t<1?z.jsx(z.Fragment,{}):z.jsx("div",{ref:n,className:q0("flex flex-col gap-2",e),...o,children:Array.from({length:t},(r,a)=>{let i="66%";switch(a%5){case 0:i="57%";break;case 1:i="33%";break;case 2:i="40%";break;case 3:i="48%";break;case 4:i="24%";break}return z.jsxs("div",{className:"flex justify-between gap-6",children:[z.jsx("div",{className:"grow",style:{maxWidth:i},children:z.jsx(w1,{})}),z.jsx(w1,{className:"w-[60px] self-end"})]},a)})}));tJ.displayName="SkeletonTable";const mp=({size:e="md",color:t="dark",className:o=""})=>{let n="relative mx-0 my-[-0.5] box-border inline-block animate-spin rounded-full before:z-10 before:block before:rounded-full before:content-['']";switch(e){case"sm":n+=" h-[16px] w-[16px] border-2 before:mt-[10px] before:h-[3px] before:w-[3px]";break;case"md":n+=" h-[20px] w-[20px] border-2 before:mt-[13px] before:h-[3px] before:w-[3px]";break;case"lg":default:n+=" h-[50px] w-[50px] border before:mt-[7px] before:h-[7px] before:w-[7px]";break}switch(t){case"light":n+=" border-white/20 before:bg-white dark:border-black/10 dark:before:bg-black";break;case"dark":default:n+=" border-black/10 before:bg-black dark:border-white/20 dark:before:bg-white";break}return z.jsx("div",{className:`${n} ${o}`})},Nn0=()=>z.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:z.jsx("div",{className:"flex size-20 items-center justify-center rounded-full",children:z.jsxs("div",{className:"-mt-1.5 flex items-end gap-2",children:[z.jsx(w1,{className:"h-10 w-3"}),z.jsx(w1,{className:"h-14 w-3"}),z.jsx(w1,{className:"h-6 w-3"})]})})}),oJ=({className:e="",children:t})=>z.jsx("div",{className:`my-10 flex flex-col items-center gap-1 text-sm text-grey-600 ${e}`,children:t}),nJ=({className:e="",children:t})=>z.jsx("div",{className:`text-grey-500 [&>svg]:size-8 [&>svg]:stroke-[1px] ${e}`,children:t}),rJ=Nu,Bn0=Bu,cJ=_u,mm=p.forwardRef(({className:e,...t},o)=>z.jsx(_a,{className:q0("fixed inset-0 z-50 bg-black/10 data-[state=open]:animate-in duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));mm.displayName=_a.displayName;const aJ=Gt("fixed z-50 gap-4 bg-background p-8 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),gm=p.forwardRef(({side:e="right",className:t,children:o,...n},r)=>z.jsx(cJ,{children:z.jsxs("div",{className:Go,children:[z.jsx(mm,{}),z.jsxs(Ea,{ref:r,className:q0(aJ({side:e}),t),...n,children:[z.jsxs(c3,{className:"fixed right-4 top-4 z-50 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[z.jsx(cd,{className:"size-4"}),z.jsx("span",{className:"sr-only",children:"Close"})]}),o]})]})}));gm.displayName=Ea.displayName;const sJ=({className:e,...t})=>z.jsx("div",{className:q0("flex flex-col space-y-1 text-center sm:text-left",e),...t});sJ.displayName="SheetHeader";const iJ=p.forwardRef(({className:e,...t},o)=>z.jsx(Sa,{ref:o,className:q0("text-xl font-semibold text-foreground",e),...t}));iJ.displayName=Sa.displayName;const pJ=p.forwardRef(({className:e,...t},o)=>z.jsx(Ta,{ref:o,className:q0("text-sm text-muted-foreground",e),...t}));pJ.displayName=Ta.displayName;const Wm=801;function ll(){return window.innerWidth<Wm}function MJ(){const[e,t]=p.useState(ll());return p.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Wm-1}px)`),n=()=>{t(ll())};return o.addEventListener("change",n),t(ll()),()=>o.removeEventListener("change",n)},[]),e}const bJ="sidebar:state",lJ=3600*24*7,zJ="30rem",uJ="28rem",dJ="4rem",OJ="b",L3="[34px]",vm=p.createContext(null);function Vn(){const e=p.useContext(vm);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const Rm=p.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:o,className:n,style:r,children:a,...i},b)=>{const l=MJ(),[u,f]=p.useState(!1),[O,h]=p.useState(e),m=t??O,g=p.useCallback(L=>{const x=typeof L=="function"?L(m):L;o?o(x):h(x),document.cookie=`${bJ}=${x}; path=/; max-age=${lJ}`},[o,m]),W=p.useCallback(()=>l?f(L=>!L):g(L=>!L),[l,g,f]);p.useEffect(()=>{const L=x=>{x.key===OJ&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),W())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[W]);const v=m?"expanded":"collapsed",y=p.useMemo(()=>({state:v,open:m,setOpen:g,isMobile:l,openMobile:u,setOpenMobile:f,toggleSidebar:W}),[v,m,g,l,u,f,W]);return z.jsx(vm.Provider,{value:y,children:z.jsx(PY,{delayDuration:0,children:z.jsx("div",{ref:b,className:q0("group/sidebar-wrapper relative flex h-full w-full has-[[data-variant=inset]]:bg-sidebar",n),style:{"--sidebar-width":zJ,"--sidebar-width-icon":dJ,...r},...i,children:a})})})});Rm.displayName="SidebarProvider";const ym=p.forwardRef(({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:n,children:r,...a},i)=>{const{isMobile:b,state:l,openMobile:u,setOpenMobile:f}=Vn();return o==="none"?z.jsx("div",{ref:i,className:q0("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),role:"navigation",...a,children:r}):b?z.jsx(rJ,{open:u,onOpenChange:f,...a,children:z.jsx(gm,{className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",role:"navigation",side:e,style:{"--sidebar-width":uJ},children:z.jsx("div",{className:"flex size-full flex-col",children:r})})}):z.jsxs("div",{ref:i,className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":l==="collapsed"?o:"","data-side":e,"data-state":l,"data-variant":t,role:"navigation",children:[z.jsx("div",{className:q0("relative h-full w-[--sidebar-width] bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),z.jsx("div",{className:q0("absolute inset-y-0 z-10 hidden h-full w-[--sidebar-width] md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] border-sidebar-border group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...a,children:z.jsx("div",{className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:r})})]})});ym.displayName="Sidebar";const wm=p.forwardRef(({children:e,className:t,onClick:o,...n},r)=>{const{toggleSidebar:a}=Vn();return z.jsx(e1,{ref:r,className:q0("h-7 w-7",t),"data-sidebar":"trigger",size:"icon",variant:"ghost",onClick:i=>{o?.(i),a()},...n,children:e||z.jsxs(z.Fragment,{children:[z.jsx(DZ,{}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})});wm.displayName="SidebarTrigger";const fJ=p.forwardRef(({className:e,...t},o)=>{const{toggleSidebar:n}=Vn();return z.jsx("button",{ref:o,"aria-label":"Toggle Sidebar",className:q0("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),"data-sidebar":"rail",tabIndex:-1,title:"Toggle Sidebar",type:"button",onClick:n,...t})});fJ.displayName="SidebarRail";const Lm=p.forwardRef(({className:e,...t},o)=>z.jsx("main",{ref:o,className:q0("relative flex h-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Lm.displayName="SidebarInset";const AJ=p.forwardRef(({className:e,...t},o)=>z.jsx(w3,{ref:o,className:q0("w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",`h-${L3}`,e),"data-sidebar":"input",...t}));AJ.displayName="SidebarInput";const km=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("flex flex-col gap-2 p-2",e),"data-sidebar":"header",...t}));km.displayName="SidebarHeader";const xm=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("flex flex-col gap-2 p-2",e),"data-sidebar":"footer",...t}));xm.displayName="SidebarFooter";const hJ=p.forwardRef(({className:e,...t},o)=>z.jsx(pm,{ref:o,className:q0("mx-2 w-auto bg-sidebar-border",e),"data-sidebar":"separator",...t}));hJ.displayName="SidebarSeparator";const Cm=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("flex min-h-0 flex-1 flex-col gap-4 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-sidebar":"content",...t}));Cm.displayName="SidebarContent";const ec=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("relative flex w-full min-w-0 flex-col p-2",e),"data-sidebar":"group",...t}));ec.displayName="SidebarGroup";const qJ=p.forwardRef(({className:e,asChild:t=!1,...o},n)=>{const r=t?Jr:"div";return z.jsx(r,{ref:n,className:q0("duration-200 flex shrink-0 items-center rounded-md px-3 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",`h-${L3}`,e),"data-sidebar":"group-label",...o})});qJ.displayName="SidebarGroupLabel";const mJ=p.forwardRef(({className:e,asChild:t=!1,...o},n)=>{const r=t?Jr:"button";return z.jsx(r,{ref:n,className:q0("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"group-action",...o})});mJ.displayName="SidebarGroupAction";const Ha=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("w-full text-sm",e),"data-sidebar":"group-content",...t}));Ha.displayName="SidebarGroupContent";const tc=p.forwardRef(({className:e,...t},o)=>z.jsx("ul",{ref:o,className:q0("flex w-full min-w-0 flex-col gap-0.5",e),"data-sidebar":"menu",...t}));tc.displayName="SidebarMenu";const gd=p.forwardRef(({className:e,...t},o)=>z.jsx("li",{ref:o,className:q0("group/menu-item relative",e),"data-sidebar":"menu-item",...t}));gd.displayName="SidebarMenuItem";const gJ=Gt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md px-3 py-2 text-left text-md font-medium text-sidebar-foreground outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:`h-${L3} text-md`,sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),k3=p.forwardRef(({asChild:e=!1,isActive:t=!1,variant:o="default",size:n="default",tooltip:r,className:a,...i},b)=>{const l=e?Jr:"button",{isMobile:u,state:f}=Vn(),O=z.jsx(l,{ref:b,className:q0(gJ({variant:o,size:n}),a),"data-active":t,"data-sidebar":"menu-button","data-size":n,...i});return r?(typeof r=="string"&&(r={children:r}),z.jsxs(XY,{children:[z.jsx(jY,{asChild:!0,children:O}),z.jsx(lm,{align:"center",hidden:f!=="collapsed"||u,side:"right",...r})]})):O});k3.displayName="SidebarMenuButton";const WJ=p.forwardRef(({className:e,asChild:t=!1,showOnHover:o=!1,...n},r)=>{const a=t?Jr:"button";return z.jsx(a,{ref:r,className:q0("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",o&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),"data-sidebar":"menu-action",...n})});WJ.displayName="SidebarMenuAction";const Wd=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("absolute right-2 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-sm font-medium tabular-nums text-gray-600 select-none pointer-events-none","peer-hover/menu-button: peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1.5","peer-data-[size=default]/menu-button:top-2","peer-data-[size=lg]/menu-button:top-3","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-badge",...t}));Wd.displayName="SidebarMenuBadge";const vJ=p.forwardRef(({className:e,showIcon:t=!1,...o},n)=>{const r=p.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return z.jsxs("div",{ref:n,className:q0("rounded-md flex gap-2 px-3 items-center",`h-${L3}`,e),"data-sidebar":"menu-skeleton",...o,children:[t&&z.jsx(w1,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),z.jsx(w1,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});vJ.displayName="SidebarMenuSkeleton";const RJ=p.forwardRef(({className:e,...t},o)=>z.jsx("ul",{ref:o,className:q0("mx-3.5 flex min-w-0 translate-x-px flex-col gap-0.5 border-l border-sidebar-border px-3 py-0.5","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-sub",...t}));RJ.displayName="SidebarMenuSub";const yJ=p.forwardRef(({...e},t)=>z.jsx("li",{ref:t,...e}));yJ.displayName="SidebarMenuSubItem";const wJ=p.forwardRef(({asChild:e=!1,size:t="md",isActive:o,className:n,...r},a)=>{const i=e?Jr:"a";return z.jsx(i,{ref:a,className:q0("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-3 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),"data-active":o,"data-sidebar":"menu-sub-button","data-size":t,...r})});wJ.displayName="SidebarMenuSubButton";const gp=p.forwardRef(({className:e,onBackToDashboard:t,...o},n)=>z.jsx("div",{ref:n,className:q0("admin-x-container-error",e),...o,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:t,children:"← Back to the dashboard"})]})}));gp.displayName="ErrorPage";const Nm=p.forwardRef(({className:e,...t},o)=>z.jsx("h1",{ref:o,className:q0("scroll-m-20 text-3xl leading-[1.1em] tracking-tighter font-bold",e),...t}));Nm.displayName="H1";const LJ=p.forwardRef(({className:e,...t},o)=>z.jsx("h2",{ref:o,className:q0("scroll-m-20 text-2xl font-bold tracking-tighter first:mt-0",e),...t}));LJ.displayName="H2";const Bm=p.forwardRef(({className:e,...t},o)=>z.jsx("h3",{ref:o,className:q0("scroll-m-20 text-xl font-semibold tracking-tight",e),...t}));Bm.displayName="H3";const m2=p.forwardRef(({className:e,...t},o)=>z.jsx("h4",{ref:o,className:q0("scroll-m-20 text-lg font-semibold tracking-tight",e),...t}));m2.displayName="H4";const kJ=p.forwardRef(({className:e,...t},o)=>z.jsx("div",{ref:o,className:q0("text-xs text-muted-foreground tracking-wide font-medium uppercase",e),...t}));kJ.displayName="HTable";const uz=new Map;p.createContext({saveScrollPosition:()=>{},getScrollPosition:()=>{},resetScrollPosition:()=>{}});function xJ(e){uz.delete(e)}function CJ({containerRef:e}){const t=Re(),o=p.useRef(null),n=p.useRef(null);return p.useEffect(()=>{const r=e.current;if(!r)return;const a=()=>{const i=r.scrollTop;uz.set(t.pathname,i),n.current=i};return r.addEventListener("scroll",a),()=>r.removeEventListener("scroll",a)},[t.pathname,e]),p.useEffect(()=>{const r=e.current;if(!r)return;const a=uz.get(t.pathname);a!==void 0&&o.current!==t.pathname&&Math.abs(a-r.scrollTop)>5&&(r.scrollTop=a)},[t.pathname,e]),p.useEffect(()=>{o.current=t.pathname},[t.pathname]),null}function NJ({routes:e,prefix:t,errorElement:o,children:n}){const r=p.useMemo(()=>{const a=`/${t?.replace(/\/+/g,"/").replace(/^\/|\/$/g,"")}`,i={element:z.jsx(xF,{children:n}),children:e.map(b=>({...b,errorElement:b.errorElement||o||z.jsx(gp,{})}))};return AF([i],{basename:a})},[e,t,o,n]);return z.jsx(HI,{router:r})}function _m(){const e=Ca(),{externalNavigate:t}=ha();return p.useCallback((o,n)=>{if(typeof o=="number"){e(o);return}if(n?.crossApp){t({route:o,isExternal:!0});return}e(o,n)},[e,t])}function BJ(){const e=xI();return e&&Object.keys(e).length>0}function qn({to:e,replace:t,state:o,crossApp:n}){const{externalNavigate:r}=ha();return n?(r({route:e,isExternal:!0}),null):z.jsx(QI,{replace:t,state:o,to:e})}function A1(e){return()=>e().then(({default:t})=>({Component:t}))}const _J="FeaturebaseTokenResponseType",EJ={staleTime:7200*60*1e3,refetchInterval:8640*60*1e3,refetchIntervalInBackground:!0},SJ=jn({dataType:_J,path:"/featurebase/token/"}),TJ=(e={})=>SJ({...EJ,...e}),Em=p.createContext(void 0);function Sm(){const e=p.useContext(Em);if(e===void 0)throw new Error("useEmberContext must be used within an EmberProvider");return e}const Of=p0.memo(function(){const t=p.useRef(null),{isFallbackPresent:o}=Sm();return p.useLayoutEffect(()=>{if(t.current){const n=document.getElementById("ember-app");if(n)t.current.appendChild(n);else throw new Error("Ember app not found")}return()=>{const n=document.getElementById("ember-app");if(n)document.body.appendChild(n);else throw new Error("Ember app not found")}},[]),z.jsx("div",{ref:t,hidden:!o,className:"h-full w-full"})});function PJ({children:e}){const[t,o]=p.useState(0),n=p.useCallback(()=>{o(b=>b+1)},[]),r=p.useCallback(()=>{o(b=>Math.max(0,b-1))},[]),i={isFallbackPresent:t>0,registerFallback:n,unregisterFallback:r};return z.jsx(Em.Provider,{value:i,children:e})}function dz(){const{registerFallback:e,unregisterFallback:t}=Sm();return p.useEffect(()=>(e(),()=>{t()}),[e,t]),null}const Tm="ConfigResponseType",_n0=Tm,Ua=jn({dataType:Tm,path:"/config/"}),XJ=e=>{var t,o;return!!((o=(t=e?.hostSettings)==null?void 0:t.managedEmail)!=null&&o.enabled)},jJ=e=>{var t,o;const n=(o=(t=e?.hostSettings)==null?void 0:t.managedEmail)==null?void 0:o.sendingDomain;return typeof n=="string"&&n.length>0},DJ=e=>{var t,o;return(o=(t=e?.hostSettings)==null?void 0:t.managedEmail)==null?void 0:o.sendingDomain},IJ={integration:"IntegrationsResponseType",invite:"InvitesResponseType",offer:"OffersResponseType",newsletter:"NewslettersResponseType",recommendation:"RecommendationResponseType",setting:"SettingsResponseType",theme:"ThemesResponseType",tier:"TiersResponseType",user:"UsersResponseType",post:"PostsResponseType",member:"MembersResponseType",tag:"TagsResponseType",label:"LabelsResponseType",webhook:"WebhooksResponseType"};function Pm(e){if(typeof window>"u")return()=>{};if(window.EmberBridge?.state)return e(window.EmberBridge.state),()=>{};const t=setInterval(()=>{window.EmberBridge?.state&&(clearInterval(t),e(window.EmberBridge.state))},100);return()=>clearInterval(t)}function x3(e,t){let o=null,n=!0;const r=Pm(a=>{n&&(a.on(e,t),o=()=>a.off(e,t))});return()=>{n=!1,r(),o?.()}}function FJ(){const e=d1();p.useEffect(()=>x3("emberDataChange",o=>{const{modelName:n}=o,r=IJ[n];r&&e.invalidateQueries({predicate:a=>a.queryKey[0]===r})}),[e])}function HJ(){const e=d1();p.useEffect(()=>x3("emberAuthChange",o=>{o.isAuthenticated&&e.invalidateQueries()}),[e])}function Xm(){const[e,t]=p.useState(null);return p.useEffect(()=>x3("subscriptionChange",n=>{t(n)}),[]),e}function UJ(e){return x3("sidebarVisibilityChange",e)}function ff(){return window.EmberBridge?.state.sidebarVisible??!0}function jm(){return p.useSyncExternalStore(UJ,ff,ff)}const VJ={getRouteUrl:e=>e,isRouteActive:()=>!1};function Dm(){const[e,t]=p.useState(()=>window.EmberBridge?.state??null),[,o]=p.useState(0);return p.useEffect(()=>{if(!e)return Pm(t);const n=()=>{o(r=>r+1)};return e.on("routeChange",n),()=>e.off("routeChange",n)},[e]),e?{getRouteUrl:e.getRouteUrl,isRouteActive:e.isRouteActive}:VJ}function QJ(){const{data:e}=Ua(),t=Xm();return!(!e?.config?.hostSettings?.forceUpgrade||t?.subscription?.status==="active")}function $J(){const e=QJ(),o=yu().some(n=>n.handle?.allowInForceUpgrade===!0);return e&&!o?z.jsx(qn,{to:"/pro",replace:!0}):z.jsx(yn,{})}const En0=(e,t)=>(o,n)=>{if(!n)return n;const r=(a=>a[e]);if(typeof n=="object"&&"pages"in n){const{pages:a}=n,i=a[a.length-1];return{...n,pages:a.slice(0,-1).concat({...i,[e]:i[e].concat(r(o))})}}return{...n,[e]:n[e].concat(r(o))}},Im=(e,t)=>(o,n)=>{if(!n)return n;const a=(i=>i[e].reduce((l,u)=>({...l,[u.id]:u}),{}))(o);if(typeof n=="object"&&"pages"in n){const{pages:i}=n;return{...n,pages:i.map(b=>({...b,[e]:b[e].map(l=>a[l.id]||l)}))}}return{...n,[e]:n[e].map(i=>a[i.id]||i)}},ZJ=(e,t)=>(o,n,r)=>{if(!n)return n;const a=[r];if(typeof n=="object"&&"pages"in n){const{pages:i}=n;return{...n,pages:i.map(b=>({...b,[e]:b[e].filter(l=>!a.includes(l.id))}))}}return{...n,[e]:n[e].filter(i=>!a.includes(i.id))}},Va=N7,Sn0=bD({dataType:Va,path:"/users/",defaultSearchParams:{limit:"100",include:"roles"},defaultNextPageParams:(e,t)=>{var o;return{...t,page:(((o=e.meta)==null?void 0:o.pagination.next)||1).toString()}},returnData:e=>{const{pages:t}=e,o=t.flatMap(r=>r.users),n=t[t.length-1].meta;return{users:o,meta:n,isEnd:n?n.pagination.pages===n.pagination.page:!0}}}),Tn0=_7({dataType:Va,path:e=>`/users/slug/${e}/`,defaultSearchParams:{include:"roles"}}),Fm=Vt({method:"PUT",path:e=>`/users/${e.id}/`,body:e=>({users:[e]}),searchParams:()=>({include:"roles"}),updateQueries:{dataType:Va,emberUpdateType:"createOrUpdate",update:Im("users")}}),Pn0=Vt({method:"DELETE",path:e=>`/users/${e}/`,updateQueries:{dataType:Va,emberUpdateType:"delete",update:ZJ("users")}}),Xn0=Vt({method:"PUT",path:()=>"/users/password/",body:({newPassword:e,confirmNewPassword:t,userId:o,oldPassword:n})=>({password:[{user_id:o,oldPassword:n||"",newPassword:e,ne2Password:t}]})}),jn0=Vt({method:"PUT",path:()=>"/users/owner/",body:e=>({owner:[{id:e}]}),updateQueries:{dataType:Va,emberUpdateType:"createOrUpdate",update:Im("users")}});function Qa(e){return e.roles.some(t=>t.name==="Owner")}function C3(e){return e.roles.some(t=>t.name==="Administrator")}function Hm(e){return e.roles.some(o=>o.name==="Editor")||e.roles.some(o=>o.name==="Super Editor")}function GJ(e){return e.roles.some(t=>t.name==="Super Editor")}function KJ(e){return e.roles.some(t=>t.name==="Author")}function N3(e){return e.roles.some(t=>t.name==="Contributor")}function Dn0(e){return KJ(e)||N3(e)}function YJ(e){return Qa(e)||C3(e)||Hm(e)}function JJ(e){return Qa(e)||C3(e)||GJ(e)}function e00(e){return Qa(e)||C3(e)||Hm(e)}function t00(e){return Qa(e)||C3(e)}const o00="SiteResponseType",B3=jn({dataType:o00,path:"/site/"});function In0(e){const t=new URL(e.url),o=t.pathname.endsWith("/")?t.pathname:`${t.pathname}/`;return`${t.origin}${o}`}function n00(e,t){if(XJ(t)&&jJ(t))return DJ(t)||"";const o=new URL(e.url).hostname||"";return o.startsWith("www.")?o.replace(/^(www)\.(?=[^/]*\..{2,5})/,""):o}function Fn0(e,t,o){const n=n00(t,o);return e==="noreply"?`noreply@${n}`:e}const Oz=navigator.userAgent.indexOf("Mac")!==-1?"command":"ctrl",r00=Oz==="command"?"⌘K":"Ctrl+K",c00=e=>{e.preventDefault();const t=new KeyboardEvent("keydown",{key:"k",keyCode:75,metaKey:Oz==="command",ctrlKey:Oz==="ctrl"});document.dispatchEvent(t)};function a00({...e}){const{data:t}=ve(),o=B3(),n=o.data?.site.title??"",r=o.data?.site.icon??"https://static.ghost.org/v4.0.0/images/ghost-orb-1.png",a=t&&!N3(t);return z.jsx(km,{...e,children:z.jsxs("div",{className:"flex flex-col items-stretch gap-6",children:[z.jsx("div",{className:"flex items-center justify-between",children:z.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[z.jsx("div",{className:"w-8 h-8 rounded-md bg-transparent border-0 flex-shrink-0",children:z.jsx("img",{src:r,alt:"Site icon",className:"w-full h-full rounded-md object-cover"})}),z.jsx("div",{className:"font-semibold text-[15px] text-foreground overflow-hidden text-ellipsis whitespace-nowrap flex-1",children:n})]})}),a&&z.jsxs(e1,{variant:"outline",className:"flex items-center justify-between text-muted-foreground hover:text-gray-700 hover:bg-background text-base [&_svg]:stroke-2 pr-2 shadow-xs hover:shadow-sm hover:border-gray-200 dark:hover:border-gray-800 h-[38px] dark:bg-gray-950",onClick:c00,children:[z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsx(od,{className:"text-muted-foreground"}),"Search site"]}),z.jsx(eJ,{className:"text-gray-500 bg-transparent shadow-none dark:text-gray-800",style:{textShadow:"none"},children:r00})]})]})})}function n0(e,t,o){function n(b,l){var u;Object.defineProperty(b,"_zod",{value:b._zod??{},enumerable:!1}),(u=b._zod).traits??(u.traits=new Set),b._zod.traits.add(e),t(b,l);for(const f in i.prototype)f in b||Object.defineProperty(b,f,{value:i.prototype[f].bind(b)});b._zod.constr=i,b._zod.def=l}const r=o?.Parent??Object;class a extends r{}Object.defineProperty(a,"name",{value:e});function i(b){var l;const u=o?.Parent?new a:this;n(u,b),(l=u._zod).deferred??(l.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:b=>o?.Parent&&b instanceof o.Parent?!0:b?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Sr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Um extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Vm={};function Ho(e){return Vm}function s00(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,r])=>t.indexOf(+n)===-1).map(([n,r])=>r)}function fz(e,t){return typeof t=="bigint"?t.toString():t}function vd(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Rd(e){return e==null}function yd(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}const Af=Symbol("evaluating");function q1(e,t,o){let n;Object.defineProperty(e,t,{get(){if(n!==Af)return n===void 0&&(n=Af,n=o()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Qn(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function $n(...e){const t={};for(const o of e){const n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function hf(e){return JSON.stringify(e)}const Qm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wp(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const i00=vd(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Fr(e){if(Wp(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const o=t.prototype;return!(Wp(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function $m(e){return Fr(e)?{...e}:Array.isArray(e)?[...e]:e}const p00=new Set(["string","number","symbol"]);function _3(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ko(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function D0(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function M00(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function b00(e,t){const o=e._zod.def,n=$n(e._zod.def,{get shape(){const r={};for(const a in t){if(!(a in o.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(r[a]=o.shape[a])}return Qn(this,"shape",r),r},checks:[]});return Ko(e,n)}function l00(e,t){const o=e._zod.def,n=$n(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const a in t){if(!(a in o.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete r[a]}return Qn(this,"shape",r),r},checks:[]});return Ko(e,n)}function z00(e,t){if(!Fr(t))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=$n(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Qn(this,"shape",a),a},checks:[]});return Ko(e,r)}function u00(e,t){if(!Fr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const o={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Qn(this,"shape",n),n},checks:e._zod.def.checks};return Ko(e,o)}function d00(e,t){const o=$n(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Qn(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Ko(e,o)}function O00(e,t,o){const n=$n(t._zod.def,{get shape(){const r=t._zod.def.shape,a={...r};if(o)for(const i in o){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(a[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)a[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return Qn(this,"shape",a),a},checks:[]});return Ko(t,n)}function f00(e,t,o){const n=$n(t._zod.def,{get shape(){const r=t._zod.def.shape,a={...r};if(o)for(const i in o){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(a[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)a[i]=new e({type:"nonoptional",innerType:r[i]});return Qn(this,"shape",a),a},checks:[]});return Ko(t,n)}function Rr(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function yr(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function hi(e){return typeof e=="string"?e:e?.message}function Uo(e,t,o){const n={...e,path:e.path??[]};if(!e.message){const r=hi(e.inst?._zod.def?.error?.(e))??hi(t?.error?.(e))??hi(o.customError?.(e))??hi(o.localeError?.(e))??"Invalid input";n.message=r}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function wd(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function da(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const Zm=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fz,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gm=n0("$ZodError",Zm),E3=n0("$ZodError",Zm,{Parent:Error});function A00(e,t=o=>o.message){const o={},n=[];for(const r of e.issues)r.path.length>0?(o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:o}}function h00(e,t=o=>o.message){const o={_errors:[]},n=r=>{for(const a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(i=>n({issues:i}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)o._errors.push(t(a));else{let i=o,b=0;for(;b<a.path.length;){const l=a.path[b];b===a.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(t(a))):i[l]=i[l]||{_errors:[]},i=i[l],b++}}};return n(e),o}const S3=e=>(t,o,n,r)=>{const a=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:o,issues:[]},a);if(i instanceof Promise)throw new Sr;if(i.issues.length){const b=new(r?.Err??e)(i.issues.map(l=>Uo(l,a,Ho())));throw Qm(b,r?.callee),b}return i.value},Hn0=S3(E3),T3=e=>async(t,o,n,r)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:o,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const b=new(r?.Err??e)(i.issues.map(l=>Uo(l,a,Ho())));throw Qm(b,r?.callee),b}return i.value},Un0=T3(E3),P3=e=>(t,o,n)=>{const r=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Sr;return a.issues.length?{success:!1,error:new(e??Gm)(a.issues.map(i=>Uo(i,r,Ho())))}:{success:!0,data:a.value}},q00=P3(E3),X3=e=>async(t,o,n)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:o,issues:[]},r);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>Uo(i,r,Ho())))}:{success:!0,data:a.value}},m00=X3(E3),g00=e=>(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return S3(e)(t,o,r)},W00=e=>(t,o,n)=>S3(e)(t,o,n),v00=e=>async(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return T3(e)(t,o,r)},R00=e=>async(t,o,n)=>T3(e)(t,o,n),y00=e=>(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return P3(e)(t,o,r)},w00=e=>(t,o,n)=>P3(e)(t,o,n),L00=e=>async(t,o,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return X3(e)(t,o,r)},k00=e=>async(t,o,n)=>X3(e)(t,o,n),x00=/^[cC][^\s-]{8,}$/,C00=/^[0-9a-z]+$/,N00=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,B00=/^[0-9a-vA-V]{20}$/,_00=/^[A-Za-z0-9]{27}$/,E00=/^[a-zA-Z0-9_-]{21}$/,S00=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,T00=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qf=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,P00=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,X00="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function j00(){return new RegExp(X00,"u")}const D00=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,I00=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,F00=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,H00=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,U00=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Km=/^[A-Za-z0-9_-]*$/,V00=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Q00=/^\+(?:[0-9]){6,14}[0-9]$/,Ym="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",$00=new RegExp(`^${Ym}$`);function Jm(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Z00(e){return new RegExp(`^${Jm(e)}$`)}function G00(e){const t=Jm({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${Ym}T(?:${n})$`)}const K00=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Y00=/^(?:true|false)$/i,J00=/^[^A-Z]*$/,e10=/^[^a-z]*$/,x2=n0("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),eg={number:"number",bigint:"bigint",object:"date"},t10=n0("$ZodCheckLessThan",(e,t)=>{x2.init(e,t);const o=eg[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,a=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:o,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),o10=n0("$ZodCheckGreaterThan",(e,t)=>{x2.init(e,t);const o=eg[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,a=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:o,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),n10=n0("$ZodCheckMaxLength",(e,t)=>{var o;x2.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!Rd(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=wd(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),r10=n0("$ZodCheckMinLength",(e,t)=>{var o;x2.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!Rd(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=wd(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),c10=n0("$ZodCheckLengthEquals",(e,t)=>{var o;x2.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!Rd(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=n=>{const r=n.value,a=r.length;if(a===t.length)return;const i=wd(r),b=a>t.length;n.issues.push({origin:i,...b?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),j3=n0("$ZodCheckStringFormat",(e,t)=>{var o,n;x2.init(e,t),e._zod.onattach.push(r=>{const a=r._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),a10=n0("$ZodCheckRegex",(e,t)=>{j3.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),s10=n0("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=J00),j3.init(e,t)}),i10=n0("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=e10),j3.init(e,t)}),p10=n0("$ZodCheckIncludes",(e,t)=>{x2.init(e,t);const o=_3(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(r=>{const a=r._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),M10=n0("$ZodCheckStartsWith",(e,t)=>{x2.init(e,t);const o=new RegExp(`^${_3(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),b10=n0("$ZodCheckEndsWith",(e,t)=>{x2.init(e,t);const o=new RegExp(`.*${_3(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(o)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),l10=n0("$ZodCheckOverwrite",(e,t)=>{x2.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class z10{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
600
600
|
`).filter(i=>i),r=Math.min(...n.map(i=>i.length-i.trimStart().length)),a=n.map(i=>i.slice(r)).map(i=>" ".repeat(this.indent*2)+i);for(const i of a)this.content.push(i)}compile(){const t=Function,o=this?.args,r=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...o,r.join(`
|
|
601
601
|
`))}}const u10={major:4,minor:1,patch:12},V1=n0("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=u10;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const r of n)for(const a of r._zod.onattach)a(e);if(n.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(i,b,l)=>{let u=Rr(i),f;for(const O of b){if(O._zod.def.when){if(!O._zod.def.when(i))continue}else if(u)continue;const h=i.issues.length,m=O._zod.check(i);if(m instanceof Promise&&l?.async===!1)throw new Sr;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,i.issues.length!==h&&(u||(u=Rr(i,h)))});else{if(i.issues.length===h)continue;u||(u=Rr(i,h))}}return f?f.then(()=>i):i},a=(i,b,l)=>{if(Rr(i))return i.aborted=!0,i;const u=r(b,n,l);if(u instanceof Promise){if(l.async===!1)throw new Sr;return u.then(f=>e._zod.parse(f,l))}return e._zod.parse(u,l)};e._zod.run=(i,b)=>{if(b.skipChecks)return e._zod.parse(i,b);if(b.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...b,skipChecks:!0});return u instanceof Promise?u.then(f=>a(f,i,b)):a(u,i,b)}const l=e._zod.parse(i,b);if(l instanceof Promise){if(b.async===!1)throw new Sr;return l.then(u=>r(u,n,b))}return r(l,n,b)}}e["~standard"]={validate:r=>{try{const a=q00(e,r);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return m00(e,r).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),D3=n0("$ZodString",(e,t)=>{V1.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??K00(e._zod.bag),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),I1=n0("$ZodStringFormat",(e,t)=>{j3.init(e,t),D3.init(e,t)}),d10=n0("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=T00),I1.init(e,t)}),O10=n0("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=qf(n))}else t.pattern??(t.pattern=qf());I1.init(e,t)}),f10=n0("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=P00),I1.init(e,t)}),A10=n0("$ZodURL",(e,t)=>{I1.init(e,t),e._zod.check=o=>{try{const n=o.value.trim(),r=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:V00.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),t.normalize?o.value=r.href:o.value=n;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),h10=n0("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=j00()),I1.init(e,t)}),q10=n0("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=E00),I1.init(e,t)}),m10=n0("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=x00),I1.init(e,t)}),g10=n0("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=C00),I1.init(e,t)}),W10=n0("$ZodULID",(e,t)=>{t.pattern??(t.pattern=N00),I1.init(e,t)}),v10=n0("$ZodXID",(e,t)=>{t.pattern??(t.pattern=B00),I1.init(e,t)}),R10=n0("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=_00),I1.init(e,t)}),y10=n0("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=G00(t)),I1.init(e,t)}),w10=n0("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=$00),I1.init(e,t)}),L10=n0("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Z00(t)),I1.init(e,t)}),k10=n0("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=S00),I1.init(e,t)}),x10=n0("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=D00),I1.init(e,t),e._zod.onattach.push(o=>{const n=o._zod.bag;n.format="ipv4"})}),C10=n0("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=I00),I1.init(e,t),e._zod.onattach.push(o=>{const n=o._zod.bag;n.format="ipv6"}),e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),N10=n0("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=F00),I1.init(e,t)}),B10=n0("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=H00),I1.init(e,t),e._zod.check=o=>{const n=o.value.split("/");try{if(n.length!==2)throw new Error;const[r,a]=n;if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function tg(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const _10=n0("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=U00),I1.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64"}),e._zod.check=o=>{tg(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function E10(e){if(!Km.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return tg(o)}const S10=n0("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Km),I1.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64url"}),e._zod.check=o=>{E10(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),T10=n0("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Q00),I1.init(e,t)});function P10(e,t=null){try{const o=e.split(".");if(o.length!==3)return!1;const[n]=o;if(!n)return!1;const r=JSON.parse(atob(n));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const X10=n0("$ZodJWT",(e,t)=>{I1.init(e,t),e._zod.check=o=>{P10(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),og=n0("$ZodBoolean",(e,t)=>{V1.init(e,t),e._zod.pattern=Y00,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=!!o.value}catch{}const r=o.value;return typeof r=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),o}}),j10=n0("$ZodUnknown",(e,t)=>{V1.init(e,t),e._zod.parse=o=>o}),D10=n0("$ZodNever",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),I10=n0("$ZodDate",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=new Date(o.value)}catch{}const r=o.value,a=r instanceof Date;return a&&!Number.isNaN(r.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:r,...a?{received:"Invalid Date"}:{},inst:e}),o}});function mf(e,t,o){e.issues.length&&t.issues.push(...yr(o,e.issues)),t.value[o]=e.value}const F10=n0("$ZodArray",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Array.isArray(r))return o.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),o;o.value=Array(r.length);const a=[];for(let i=0;i<r.length;i++){const b=r[i],l=t.element._zod.run({value:b,issues:[]},n);l instanceof Promise?a.push(l.then(u=>mf(u,o,i))):mf(l,o,i)}return a.length?Promise.all(a).then(()=>o):o}});function vp(e,t,o,n){e.issues.length&&t.issues.push(...yr(o,e.issues)),e.value===void 0?o in n&&(t.value[o]=void 0):t.value[o]=e.value}function ng(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const o=M00(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function rg(e,t,o,n,r,a){const i=[],b=r.keySet,l=r.catchall._zod,u=l.def.type;for(const f of Object.keys(t)){if(b.has(f))continue;if(u==="never"){i.push(f);continue}const O=l.run({value:t[f],issues:[]},n);O instanceof Promise?e.push(O.then(h=>vp(h,o,f,t))):vp(O,o,f,t)}return i.length&&o.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>o):o}const H10=n0("$ZodObject",(e,t)=>{if(V1.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const b=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...b};return Object.defineProperty(t,"shape",{value:l}),l}})}const n=vd(()=>ng(t));q1(e._zod,"propValues",()=>{const b=t.shape,l={};for(const u in b){const f=b[u]._zod;if(f.values){l[u]??(l[u]=new Set);for(const O of f.values)l[u].add(O)}}return l});const r=Wp,a=t.catchall;let i;e._zod.parse=(b,l)=>{i??(i=n.value);const u=b.value;if(!r(u))return b.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),b;b.value={};const f=[],O=i.shape;for(const h of i.keys){const g=O[h]._zod.run({value:u[h],issues:[]},l);g instanceof Promise?f.push(g.then(W=>vp(W,b,h,u))):vp(g,b,h,u)}return a?rg(f,u,b,l,n.value,e):f.length?Promise.all(f).then(()=>b):b}}),U10=n0("$ZodObjectJIT",(e,t)=>{H10.init(e,t);const o=e._zod.parse,n=vd(()=>ng(t)),r=h=>{const m=new z10(["shape","payload","ctx"]),g=n.value,W=x=>{const k=hf(x);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};m.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const x of g.keys)v[x]=`key_${y++}`;m.write("const newResult = {};");for(const x of g.keys){const k=v[x],C=hf(x);m.write(`const ${k} = ${W(x)};`),m.write(`
|
|
602
602
|
if (${k}.issues.length) {
|
|
@@ -615,4 +615,4 @@ y0.version="2.24.0";CH(T1);y0.fn=h0;y0.min=AV;y0.max=hV;y0.now=qV;y0.utc=At;y0.u
|
|
|
615
615
|
newResult[${C}] = ${k}.value;
|
|
616
616
|
}
|
|
617
617
|
|
|
618
|
-
`)}m.write("payload.value = newResult;"),m.write("return payload;");const L=m.compile();return(x,k)=>L(h,x,k)};let a;const i=Wp,b=!Vm.jitless,u=b&&i00.value,f=t.catchall;let O;e._zod.parse=(h,m)=>{O??(O=n.value);const g=h.value;return i(g)?b&&u&&m?.async===!1&&m.jitless!==!0?(a||(a=r(t.shape)),h=a(h,m),f?rg([],g,h,m,O,e):h):o(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function gf(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=>!Rr(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=>Uo(i,n,Ho())))}),t)}const V10=n0("$ZodUnion",(e,t)=>{V1.init(e,t),q1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),q1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),q1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),q1(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=>yd(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=>gf(l,r,e,a)):gf(b,r,e,a)}}),Q10=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])=>Wf(o,l,u)):Wf(o,a,i)}});function Az(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=Az(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=Az(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 Wf(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),Rr(e))return e;const n=Az(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 $10=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(f=>{f.issues.length&&o.issues.push(...yr(l,f.issues)),o.value[l]=f.value})):(u.issues.length&&o.issues.push(...yr(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=>Uo(u,n,Ho())),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(...yr(i,u.issues)),o.value[b.value]=u.value})):(l.issues.length&&o.issues.push(...yr(i,l.issues)),o.value[b.value]=l.value)}}return a.length?Promise.all(a).then(()=>o):o}}),Z10=n0("$ZodEnum",(e,t)=>{V1.init(e,t);const o=s00(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>p00.has(typeof r)).map(r=>typeof r=="string"?_3(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}}),G10=n0("$ZodTransform",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new Um(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 Sr;return o.value=r,o}});function vf(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const K10=n0("$ZodOptional",(e,t)=>{V1.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${yd(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=>vf(a,o.value)):vf(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),Y10=n0("$ZodNullable",(e,t)=>{V1.init(e,t),q1(e._zod,"optin",()=>t.innerType._zod.optin),q1(e._zod,"optout",()=>t.innerType._zod.optout),q1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${yd(o.source)}|null)$`):void 0}),q1(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)}),J10=n0("$ZodDefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",q1(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=>Rf(a,t)):Rf(r,t)}});function Rf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ee0=n0("$ZodPrefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",q1(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))}),te0=n0("$ZodNonOptional",(e,t)=>{V1.init(e,t),q1(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=>yf(a,e)):yf(r,e)}});function yf(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 oe0=n0("$ZodCatch",(e,t)=>{V1.init(e,t),q1(e._zod,"optin",()=>t.innerType._zod.optin),q1(e._zod,"optout",()=>t.innerType._zod.optout),q1(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=>Uo(i,n,Ho()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(a=>Uo(a,n,Ho()))},input:o.value}),o.issues=[]),o)}}),ne0=n0("$ZodPipe",(e,t)=>{V1.init(e,t),q1(e._zod,"values",()=>t.in._zod.values),q1(e._zod,"optin",()=>t.in._zod.optin),q1(e._zod,"optout",()=>t.out._zod.optout),q1(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=>qi(i,t.in,n)):qi(a,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(a=>qi(a,t.out,n)):qi(r,t.out,n)}});function qi(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const cg=n0("$ZodCodec",(e,t)=>{V1.init(e,t),q1(e._zod,"values",()=>t.in._zod.values),q1(e._zod,"optin",()=>t.in._zod.optin),q1(e._zod,"optout",()=>t.out._zod.optout),q1(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=>mi(i,t,n)):mi(a,t,n)}else{const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>mi(i,t,n)):mi(a,t,n)}}});function mi(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=>gi(e,a,t.out,o)):gi(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>gi(e,a,t.in,o)):gi(e,r,t.in,o)}}function gi(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const re0=n0("$ZodReadonly",(e,t)=>{V1.init(e,t),q1(e._zod,"propValues",()=>t.innerType._zod.propValues),q1(e._zod,"values",()=>t.innerType._zod.values),q1(e._zod,"optin",()=>t.innerType._zod.optin),q1(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(wf):wf(r)}});function wf(e){return e.value=Object.freeze(e.value),e}const ce0=n0("$ZodCustom",(e,t)=>{x2.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=>Lf(a,o,n,e));Lf(r,o,n,e)}});function Lf(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(da(r))}}class ae0{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 se0(){return new ae0}const Wi=se0();function ie0(e,t){return new e({type:"string",...D0(t)})}function pe0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D0(t)})}function kf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D0(t)})}function Me0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D0(t)})}function be0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D0(t)})}function le0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D0(t)})}function ze0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D0(t)})}function ue0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D0(t)})}function de0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D0(t)})}function Oe0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D0(t)})}function fe0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D0(t)})}function Ae0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D0(t)})}function he0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D0(t)})}function qe0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D0(t)})}function me0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D0(t)})}function ge0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D0(t)})}function We0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D0(t)})}function ve0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D0(t)})}function Re0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D0(t)})}function ye0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D0(t)})}function we0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D0(t)})}function Le0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D0(t)})}function ke0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D0(t)})}function xe0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D0(t)})}function Ce0(e,t){return new e({type:"string",format:"date",check:"string_format",...D0(t)})}function Ne0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D0(t)})}function Be0(e,t){return new e({type:"string",format:"duration",check:"string_format",...D0(t)})}function _e0(e,t){return new e({type:"boolean",...D0(t)})}function Ee0(e){return new e({type:"unknown"})}function Se0(e,t){return new e({type:"never",...D0(t)})}function Te0(e,t){return new e({type:"date",...D0(t)})}function Pe0(e,t){return new t10({check:"less_than",...D0(t),value:e,inclusive:!0})}function Xe0(e,t){return new o10({check:"greater_than",...D0(t),value:e,inclusive:!0})}function ag(e,t){return new n10({check:"max_length",...D0(t),maximum:e})}function Rp(e,t){return new r10({check:"min_length",...D0(t),minimum:e})}function sg(e,t){return new c10({check:"length_equals",...D0(t),length:e})}function je0(e,t){return new a10({check:"string_format",format:"regex",...D0(t),pattern:e})}function De0(e){return new s10({check:"string_format",format:"lowercase",...D0(e)})}function Ie0(e){return new i10({check:"string_format",format:"uppercase",...D0(e)})}function Fe0(e,t){return new p10({check:"string_format",format:"includes",...D0(t),includes:e})}function He0(e,t){return new M10({check:"string_format",format:"starts_with",...D0(t),prefix:e})}function Ue0(e,t){return new b10({check:"string_format",format:"ends_with",...D0(t),suffix:e})}function $a(e){return new l10({check:"overwrite",tx:e})}function Ve0(e){return $a(t=>t.normalize(e))}function Qe0(){return $a(e=>e.trim())}function $e0(){return $a(e=>e.toLowerCase())}function Ze0(){return $a(e=>e.toUpperCase())}function Ge0(e,t,o){return new e({type:"array",element:t,...D0(o)})}function Ke0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...D0(o)})}function Ye0(e){const t=Je0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(da(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(da(r))}},e(o.value,o)));return t}function Je0(e,t){const o=new x2({check:"custom",...D0(t)});return o._zod.check=e,o}function e20(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(m=>typeof m=="string"?m.toLowerCase():m),r=r.map(m=>typeof m=="string"?m.toLowerCase():m));const a=new Set(n),i=new Set(r),b=e.Codec??cg,l=e.Boolean??og,u=e.String??D3,f=new u({type:"string",error:o.error}),O=new l({type:"boolean",error:o.error}),h=new b({type:"pipe",in:f,out:O,transform:((m,g)=>{let W=m;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:((m,g)=>m===!0?n[0]||"true":r[0]||"false"),error:o.error});return h}const t20=n0("ZodISODateTime",(e,t)=>{y10.init(e,t),Q1.init(e,t)});function ig(e){return xe0(t20,e)}const o20=n0("ZodISODate",(e,t)=>{w10.init(e,t),Q1.init(e,t)});function n20(e){return Ce0(o20,e)}const r20=n0("ZodISOTime",(e,t)=>{L10.init(e,t),Q1.init(e,t)});function c20(e){return Ne0(r20,e)}const a20=n0("ZodISODuration",(e,t)=>{k10.init(e,t),Q1.init(e,t)});function s20(e){return Be0(a20,e)}const i20=(e,t)=>{Gm.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>h00(e,o)},flatten:{value:o=>A00(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,fz,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,fz,2)}},isEmpty:{get(){return e.issues.length===0}}})},C2=n0("ZodError",i20,{Parent:Error}),p20=S3(C2),M20=T3(C2),b20=P3(C2),l20=X3(C2),z20=g00(C2),u20=W00(C2),d20=v00(C2),O20=R00(C2),f20=y00(C2),A20=w00(C2),h20=L00(C2),q20=k00(C2),re=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($n(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>Ko(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>p20(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>b20(e,o,n),e.parseAsync=async(o,n)=>M20(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>l20(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>z20(e,o,n),e.decode=(o,n)=>u20(e,o,n),e.encodeAsync=async(o,n)=>d20(e,o,n),e.decodeAsync=async(o,n)=>O20(e,o,n),e.safeEncode=(o,n)=>f20(e,o,n),e.safeDecode=(o,n)=>A20(e,o,n),e.safeEncodeAsync=async(o,n)=>h20(e,o,n),e.safeDecodeAsync=async(o,n)=>q20(e,o,n),e.refine=(o,n)=>e.check(bt0(o,n)),e.superRefine=o=>e.check(lt0(o)),e.overwrite=o=>e.check($a(o)),e.optional=()=>Cf(e),e.nullable=()=>Nf(e),e.nullish=()=>Cf(Nf(e)),e.nonoptional=o=>rt0(e,o),e.array=()=>Ld(e),e.or=o=>U20([e,o]),e.and=o=>Q20(e,o),e.transform=o=>Bf(e,Y20(o)),e.default=o=>tt0(e,o),e.prefault=o=>nt0(e,o),e.catch=o=>at0(e,o),e.pipe=o=>Bf(e,o),e.readonly=()=>pt0(e),e.describe=o=>{const n=e.clone();return Wi.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return Wi.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Wi.get(e);const n=e.clone();return Wi.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),pg=n0("_ZodString",(e,t)=>{D3.init(e,t),re.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(je0(...n)),e.includes=(...n)=>e.check(Fe0(...n)),e.startsWith=(...n)=>e.check(He0(...n)),e.endsWith=(...n)=>e.check(Ue0(...n)),e.min=(...n)=>e.check(Rp(...n)),e.max=(...n)=>e.check(ag(...n)),e.length=(...n)=>e.check(sg(...n)),e.nonempty=(...n)=>e.check(Rp(1,...n)),e.lowercase=n=>e.check(De0(n)),e.uppercase=n=>e.check(Ie0(n)),e.trim=()=>e.check(Qe0()),e.normalize=(...n)=>e.check(Ve0(...n)),e.toLowerCase=()=>e.check($e0()),e.toUpperCase=()=>e.check(Ze0())}),Mg=n0("ZodString",(e,t)=>{D3.init(e,t),pg.init(e,t),e.email=o=>e.check(pe0(m20,o)),e.url=o=>e.check(ue0(g20,o)),e.jwt=o=>e.check(ke0(T20,o)),e.emoji=o=>e.check(de0(W20,o)),e.guid=o=>e.check(kf(xf,o)),e.uuid=o=>e.check(Me0(vi,o)),e.uuidv4=o=>e.check(be0(vi,o)),e.uuidv6=o=>e.check(le0(vi,o)),e.uuidv7=o=>e.check(ze0(vi,o)),e.nanoid=o=>e.check(Oe0(v20,o)),e.guid=o=>e.check(kf(xf,o)),e.cuid=o=>e.check(fe0(R20,o)),e.cuid2=o=>e.check(Ae0(y20,o)),e.ulid=o=>e.check(he0(w20,o)),e.base64=o=>e.check(ye0(_20,o)),e.base64url=o=>e.check(we0(E20,o)),e.xid=o=>e.check(qe0(L20,o)),e.ksuid=o=>e.check(me0(k20,o)),e.ipv4=o=>e.check(ge0(x20,o)),e.ipv6=o=>e.check(We0(C20,o)),e.cidrv4=o=>e.check(ve0(N20,o)),e.cidrv6=o=>e.check(Re0(B20,o)),e.e164=o=>e.check(Le0(S20,o)),e.datetime=o=>e.check(ig(o)),e.date=o=>e.check(n20(o)),e.time=o=>e.check(c20(o)),e.duration=o=>e.check(s20(o))});function n2(e){return ie0(Mg,e)}const Q1=n0("ZodStringFormat",(e,t)=>{I1.init(e,t),pg.init(e,t)}),m20=n0("ZodEmail",(e,t)=>{f10.init(e,t),Q1.init(e,t)}),xf=n0("ZodGUID",(e,t)=>{d10.init(e,t),Q1.init(e,t)}),vi=n0("ZodUUID",(e,t)=>{O10.init(e,t),Q1.init(e,t)}),g20=n0("ZodURL",(e,t)=>{A10.init(e,t),Q1.init(e,t)}),W20=n0("ZodEmoji",(e,t)=>{h10.init(e,t),Q1.init(e,t)}),v20=n0("ZodNanoID",(e,t)=>{q10.init(e,t),Q1.init(e,t)}),R20=n0("ZodCUID",(e,t)=>{m10.init(e,t),Q1.init(e,t)}),y20=n0("ZodCUID2",(e,t)=>{g10.init(e,t),Q1.init(e,t)}),w20=n0("ZodULID",(e,t)=>{W10.init(e,t),Q1.init(e,t)}),L20=n0("ZodXID",(e,t)=>{v10.init(e,t),Q1.init(e,t)}),k20=n0("ZodKSUID",(e,t)=>{R10.init(e,t),Q1.init(e,t)}),x20=n0("ZodIPv4",(e,t)=>{x10.init(e,t),Q1.init(e,t)}),C20=n0("ZodIPv6",(e,t)=>{C10.init(e,t),Q1.init(e,t)}),N20=n0("ZodCIDRv4",(e,t)=>{N10.init(e,t),Q1.init(e,t)}),B20=n0("ZodCIDRv6",(e,t)=>{B10.init(e,t),Q1.init(e,t)}),_20=n0("ZodBase64",(e,t)=>{_10.init(e,t),Q1.init(e,t)}),E20=n0("ZodBase64URL",(e,t)=>{S10.init(e,t),Q1.init(e,t)}),S20=n0("ZodE164",(e,t)=>{T10.init(e,t),Q1.init(e,t)}),T20=n0("ZodJWT",(e,t)=>{X10.init(e,t),Q1.init(e,t)}),bg=n0("ZodBoolean",(e,t)=>{og.init(e,t),re.init(e,t)});function hz(e){return _e0(bg,e)}const P20=n0("ZodUnknown",(e,t)=>{j10.init(e,t),re.init(e,t)});function qz(){return Ee0(P20)}const X20=n0("ZodNever",(e,t)=>{D10.init(e,t),re.init(e,t)});function j20(e){return Se0(X20,e)}const D20=n0("ZodDate",(e,t)=>{I10.init(e,t),re.init(e,t),e.min=(n,r)=>e.check(Xe0(n,r)),e.max=(n,r)=>e.check(Pe0(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 I20(e){return Te0(D20,e)}const F20=n0("ZodArray",(e,t)=>{F10.init(e,t),re.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(Rp(o,n)),e.nonempty=o=>e.check(Rp(1,o)),e.max=(o,n)=>e.check(ag(o,n)),e.length=(o,n)=>e.check(sg(o,n)),e.unwrap=()=>e.element});function Ld(e,t){return Ge0(F20,e,t)}const lg=n0("ZodObject",(e,t)=>{U10.init(e,t),re.init(e,t),q1(e,"shape",()=>t.shape),e.keyof=()=>G20(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:qz()}),e.loose=()=>e.clone({...e._zod.def,catchall:qz()}),e.strict=()=>e.clone({...e._zod.def,catchall:j20()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>z00(e,o),e.safeExtend=o=>u00(e,o),e.merge=o=>d00(e,o),e.pick=o=>b00(e,o),e.omit=o=>l00(e,o),e.partial=(...o)=>O00(zg,e,o[0]),e.required=(...o)=>f00(ug,e,o[0])});function yp(e,t){const o={type:"object",shape:e??{},...D0(t)};return new lg(o)}function I3(e,t){return new lg({type:"object",shape:e,catchall:qz(),...D0(t)})}const H20=n0("ZodUnion",(e,t)=>{V10.init(e,t),re.init(e,t),e.options=t.options});function U20(e,t){return new H20({type:"union",options:e,...D0(t)})}const V20=n0("ZodIntersection",(e,t)=>{Q10.init(e,t),re.init(e,t)});function Q20(e,t){return new V20({type:"intersection",left:e,right:t})}const $20=n0("ZodRecord",(e,t)=>{$10.init(e,t),re.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Z20(e,t,o){return new $20({type:"record",keyType:e,valueType:t,...D0(o)})}const mz=n0("ZodEnum",(e,t)=>{Z10.init(e,t),re.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 mz({...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 mz({...t,checks:[],...D0(r),entries:a})}});function G20(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new mz({type:"enum",entries:o,...D0(t)})}const K20=n0("ZodTransform",(e,t)=>{G10.init(e,t),re.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new Um(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(da(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(da(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(a=>(o.value=a,o)):(o.value=r,o)}});function Y20(e){return new K20({type:"transform",transform:e})}const zg=n0("ZodOptional",(e,t)=>{K10.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Cf(e){return new zg({type:"optional",innerType:e})}const J20=n0("ZodNullable",(e,t)=>{Y10.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Nf(e){return new J20({type:"nullable",innerType:e})}const et0=n0("ZodDefault",(e,t)=>{J10.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tt0(e,t){return new et0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$m(t)}})}const ot0=n0("ZodPrefault",(e,t)=>{ee0.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nt0(e,t){return new ot0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$m(t)}})}const ug=n0("ZodNonOptional",(e,t)=>{te0.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rt0(e,t){return new ug({type:"nonoptional",innerType:e,...D0(t)})}const ct0=n0("ZodCatch",(e,t)=>{oe0.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function at0(e,t){return new ct0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const dg=n0("ZodPipe",(e,t)=>{ne0.init(e,t),re.init(e,t),e.in=t.in,e.out=t.out});function Bf(e,t){return new dg({type:"pipe",in:e,out:t})}const Og=n0("ZodCodec",(e,t)=>{dg.init(e,t),cg.init(e,t)});function st0(e,t,o){return new Og({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const it0=n0("ZodReadonly",(e,t)=>{re0.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pt0(e){return new it0({type:"readonly",innerType:e})}const Mt0=n0("ZodCustom",(e,t)=>{ce0.init(e,t),re.init(e,t)});function bt0(e,t={}){return Ke0(Mt0,e,t)}function lt0(e){return Ye0(e)}const zt0=(...e)=>e20({Codec:Og,Boolean:bg,String:Mg},...e),fg=st0(ig({offset:!0}),I20(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),ut0=I3({slug:n2(),title:n2(),custom_excerpt:n2(),url:n2().url(),published_at:fg,featured:zt0(),feature_image:n2().url().optional(),html:n2().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})),dt0=yp({posts:Ld(ut0).default([]),changelogUrl:n2().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),F3=()=>R2({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 dt0.parse(t)},staleTime:1/0});function _f(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ag(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&&(_f(r)&&_f(a)?o[n]=Ag(a,r):o[n]=r)}return o}const Ot0=I3({lastSeenDate:fg.optional().catch(void 0)}),Ef={expanded:{posts:!0},menu:{visible:!0}},ft0=I3({expanded:yp({posts:hz()}),menu:yp({visible:hz()})}),gz=I3({whatsNew:Ot0.optional().catch(void 0),nightShift:hz().optional(),navigation:ft0.default(Ef).catch(Ef)}),hg=e=>["userPreferences",e?.id,e?.accessibility];function H3(e){const{data:t}=ve();return R2({...e,queryKey:hg(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return gz.parse(n)},enabled:!!t,staleTime:1/0,cacheTime:0})}const U3=()=>{const e=d1(),{data:t}=ve(),{mutateAsync:o}=Fm();return Y1({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(hg(t))??gz.parse({}),a=Ag(r,n),i=gz.encode(a);await o({...t,accessibility:JSON.stringify(i)})}})};function At0(){return{lastSeenDate:new Date}}const ht0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],qg=()=>{const{data:e,isSuccess:t}=H3(),{data:o,isSuccess:n}=F3(),{mutateAsync:r}=U3(),a=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!a&&t&&r({whatsNew:At0()})},[a,t,r]);const i=o?.entries[0];return R2({queryKey:ht0(e,i),queryFn:()=>{if(!i)return{hasNew:!1};const b=e.whatsNew.lastSeenDate;return{hasNew:i.publishedAt>b}},enabled:n&&a,staleTime:1/0,cacheTime:0})},mg=()=>{const{data:e}=F3(),{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 qt0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function mt0({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:qt0(e.publishedAt)})]})]})}function gt0({open:e,onOpenChange:t}){const{data:o}=F3(),{mutate:n}=mg();return p.useEffect(()=>{e&&n()},[e,n]),z.jsx(q3,{open:e,onOpenChange:t,children:z.jsxs(Da,{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(Md,{children:z.jsx(ld,{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(mt0,{entry:r},r.slug))}),z.jsxs(bd,{className:"flex-row justify-between sm:justify-between gap-3",children:[z.jsx(e1,{asChild:!0,variant:"outline",children:z.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),z.jsx(e1,{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(mp,{size:"lg"})})]})})}function gg(){const e=Xm(),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 Wt0({children:e,...t}){return z.jsx("span",{className:"flex-1",...t,children:e})}const Xe=({children:e,...t})=>z.jsx(im,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});Xe.Label=Wt0;function wp(e){const t=ve();return z.jsxs(ad,{...e,children:[t.data?.profile_image&&z.jsx(sd,{src:t.data?.profile_image}),z.jsx(id,{className:"text-foreground-muted hover:text-foreground",children:z.jsx(rd,{})})]})}function Wg({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 flex-1 min-w-0",children:[z.jsx("span",{className:"text-base font-semibold text-foreground truncate",children:e}),z.jsx("span",{className:"text-xs text-foreground-muted -mt-px truncate",children:t})]})]})})}function vg(){const e=ve();return z.jsx(Xe,{children:z.jsxs(Ba,{to:`/settings/staff/${e.data?.slug}`,children:[z.jsx(rd,{}),z.jsx(Xe.Label,{children:"Your profile"})]})})}function Rg(){const{data:e}=H3(),{mutateAsync:t,isLoading:o}=U3(),n=r=>{t({nightShift:r})};return z.jsxs(Xe,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[z.jsx(XZ,{}),z.jsx(Xe.Label,{className:"flex-1",children:"Dark mode"}),z.jsx(bm,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function yg(){const e=()=>{fetch("/ghost/api/admin/session",{method:"DELETE"}).then(()=>{window.location.href="/ghost"}).catch(t=>{console.error(t)})};return z.jsxs(Xe,{asChild:!1,onSelect:e,children:[z.jsx(xZ,{}),z.jsx(Xe.Label,{children:"Sign out"})]})}function vt0(e){const t=ve(),{data:o}=qg(),{showUpgradeBanner:n}=gg();return z.jsxs(am,{...e,children:[z.jsx(sm,{asChild:!0,className:"focus-visible:ring-0",children:z.jsxs(k3,{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(wp,{}),o?.hasNew&&z.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:z.jsx(df,{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(nZ,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),z.jsxs(qd,{align:"start",sideOffset:10,className:`w-[var(--radix-dropdown-menu-trigger-width)] ${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(Wg,{name:t.data?.name,email:t.data?.email,children:z.jsx(wp,{})}),z.jsx(kn,{}),z.jsxs(Xe,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{e.onOpenWhatsNew?.()},children:[z.jsx(K8,{}),z.jsx(Xe.Label,{children:"What’s new?"}),o?.hasNew&&z.jsx("div",{className:"flex-1 flex justify-end",children:z.jsx(df,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),z.jsx(vg,{}),z.jsx(kn,{}),z.jsx(Xe,{children:z.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(Z$,{}),z.jsx(Xe.Label,{children:"Resources & guides"})]})}),z.jsx(Rg,{}),z.jsx(kn,{}),z.jsx(yg,{})]})]})}function Rt0(){const e=ve(),o=B3().data?.site.url??"";return z.jsxs(am,{children:[z.jsx(sm,{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(wp,{className:"w-11 h-11"})})}),z.jsxs(qd,{align:"start",side:"top",sideOffset:10,className:"w-[var(--radix-dropdown-menu-trigger-width)] mb-2",children:[z.jsx(Wg,{name:e.data?.name,email:e.data?.email,children:z.jsx(wp,{})}),z.jsx(kn,{}),z.jsx(Xe,{children:z.jsxs(Ba,{to:"/",children:[z.jsx(fZ,{}),z.jsx(Xe.Label,{children:"Posts"})]})}),z.jsx(Xe,{children:z.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(ed,{}),z.jsx(Xe.Label,{children:"View site"})]})}),z.jsx(kn,{}),z.jsx(vg,{}),z.jsx(Rg,{}),z.jsx(kn,{}),z.jsx(yg,{})]})]})}function yt0({...e}){const[t,o]=p.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsx(xm,{...e,children:z.jsx(ec,{children:z.jsx(tc,{children:z.jsx(gd,{children:z.jsx(vt0,{onOpenWhatsNew:()=>o(!0)})})})})}),z.jsx(gt0,{open:t,onOpenChange:o})]})}function wt0(){const{data:e}=qg(),{data:t}=F3(),{mutate:o}=mg(),[n,r]=p.useState(!1);if(n||!e?.hasNew)return null;const a=t?.entries[0];if(!a)return null;const i=()=>{r(!0),o()},b=()=>{o()};return z.jsx(pd,{"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(K8,{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 Lp="SettingsResponseType",V3=jn({dataType:Lp,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,transistor"}}),Vn0=Vt({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:Lp,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==Lp}}}}),Qn0=Vt({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:Lp}}),$n0=Vt({method:"POST",path:()=>"/slack/test/"});function Zn0(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 Gn0(e,t){return t.map(o=>{var n;return(n=e?.find(r=>r.key===o))==null?void 0:n.value})}function Et(e,t){if(!e)return null;const o=e.find(n=>n.key===t);return o?.value||null}function Kn0(e,t){if(!e)return;const o=e.find(n=>n.key===t);return o?.is_read_only||!1}function Yn0(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}const kd=[],wg=p.createContext(void 0),Lt0=({children:e})=>{const t=Re(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):kt0()});p.useEffect(()=>{const i=xt0(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:kd};return z.jsx(wg.Provider,{value:a,children:e})},kt0=()=>kd.reduce((e,t)=>({...e,[t]:!1}),{}),xt0=e=>{const t=new URLSearchParams(e),o={};return kd.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},Ct0=()=>{const e=p.useContext(wg);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function Q3(){const t=yu().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function Kt(){const e=_m(),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 Lg=({className:e,onClick:t})=>{const o=Kt(),{previousPath:n}=n3();return z.jsx(e1,{className:q0("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(D$,{size:24,strokeWidth:1.25})})},Nt0=()=>{const e=Re(),t=St(jg,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 kg(){const e=yu(),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 Bt0=({title:e,backIcon:t})=>t?z.jsx(Lg,{className:"-ml-2"}):z.jsx(Nm,{className:"max-md:text-[2.4rem]",children:e}),Sf=({onToggleMobileSidebar:e})=>z.jsx(e1,{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(NZ,{className:"!size-5"})}),_t0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=n3(),n=kg(),r=BJ(),a=Nt0();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(Lg,{className:"ml-6 max-md:ml-[10px]"})}),!b&&z.jsx(Sf,{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(Bt0,{backIcon:b,title:a?.pageTitle||""}),z.jsx(Sf,{onToggleMobileSidebar:e})]})})})};function So(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}var Wz=(e=>(e[e.Note=0]="Note",e[e.Article=1]="Article",e[e.Tombstone=2]="Tombstone",e))(Wz||{});const Et0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class St0{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 xg="pending-";function Cg(){return`${xg}${crypto.randomUUID()}`}function Jn0(e){return e.startsWith(xg)}function Tt0(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 Pt0(e){return e.replace(/\n/g,"<br />")}function oc(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===Wz.Article?r="Article":e.type===Wz.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 zl;async function n1(){return zl||(zl=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),zl}function r1(e,t){return new St0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function De(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){ge.error(e,{description:t})}function $3(e="Action failed",t="This user has restricted who can interact with their account."){ge.error(e,{description:t})}const M0={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 vz(e,t,o){const n=[M0.feed,M0.inbox,M0.discoveryFeed,M0.postsLikedByAccount,M0.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===M0.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:M0.postsLikedByAccount}))}function Ng(e,t,o,n){const r=[M0.feed,M0.inbox,M0.discoveryFeed,M0.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(f=>f.type!=="Announce"&&f.actor?.preferredUsername===a?{...f,actor:{...f.actor,followedByMe:n}}:f.type==="Announce"&&typeof f.object.attributedTo=="object"&&f.object.attributedTo&&!Array.isArray(f.object.attributedTo)&&"preferredUsername"in f.object.attributedTo&&f.object.attributedTo.preferredUsername===a?{...f,object:{...f.object,attributedTo:{...f.object.attributedTo,followedByMe:n}}}:f)}))});const i=M0.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 Bg(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 Rz(e,t,o){const n=M0.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(M0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function yz(e,t,o,n){const r=M0.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 wz(e,t,o,n){const r=M0.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 Lz(e,t,o,n){const r=M0.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 Tf(e,t,o){const n=[M0.feed,M0.inbox,M0.discoveryFeed,M0.profilePosts("index"),M0.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 Pf(e,t,o){const n=M0.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 er0(e){return $2({queryKey:M0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await n1();return r1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function tr0(e){return $2({queryKey:M0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await n1();return r1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function Xt0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).like(o)},onMutate:o=>{vz(t,o,!0),Rz(t,o,!0),yz(t,e,o,!0)},onError(o,n){vz(t,n,!1),Rz(t,n,!1),yz(t,e,n,!1),o.statusCode===403&&$3(),o.statusCode===429&&De()}})}function jt0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).unlike(o)},onMutate:o=>{vz(t,o,!1),Rz(t,o,!1),yz(t,e,o,!1)},onError(o){o.statusCode===429&&De()}})}function or0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(M0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&De()}})}function nr0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(M0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&De()}})}function rr0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(M0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:M0.feed}),t.invalidateQueries({queryKey:M0.inbox}),t.invalidateQueries({queryKey:M0.discoveryFeed})},onError(o){o.statusCode===429&&De()}})}function cr0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(M0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&De()}})}function kz(e,t,o){const n=[M0.feed,M0.inbox,M0.discoveryFeed,M0.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 xz(e,t,o){const n=M0.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 Dt0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).repost(o)},onMutate:o=>{kz(t,o,!0),xz(t,o,!0),wz(t,e,o,!0)},onError(o,n){kz(t,n,!1),xz(t,n,!1),wz(t,e,n,!1),o.statusCode===403&&$3(),o.statusCode===429&&De()}})}function It0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).derepost(o)},onMutate:o=>{kz(t,o,!1),xz(t,o,!1),wz(t,e,o,!1)},onError(o){o.statusCode===429&&De()}})}function Ft0(e){return R2({queryKey:M0.user(e),async queryFn(){const t=await n1();return r1(e,t).getUser()}})}function xd(e,t,o){const n=d1();return Y1({async mutationFn(r){const a=await n1();return r1(e,a).unfollow(r)},onSuccess(r,a){const i=M0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!1,followerCount:h.followerCount-1<0?0:h.followerCount-1});const b=M0.accountFollows(a,"followers");n.setQueryData(b,h=>{if(!h?.pages?.[0])return h;const m=n.getQueryData(M0.account("index"));return m?{...h,pages:h.pages.map(g=>({...g,accounts:g.accounts.filter(W=>W.name!==m.name)}))}:h});const l=M0.account("index");n.setQueryData(l,h=>h&&{...h,followingCount:h.followingCount-1});const f=M0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,h=>h?.pages?{...h,pages:h.pages.map(m=>({...m,accounts:m.accounts.filter(g=>g.handle!==a)}))}:h):n.invalidateQueries({queryKey:f}),Bg(n,a,!1),n.setQueryData(M0.exploreProfiles(e),h=>{if(!h)return h;const m=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,L])=>{const x=L.sites.map(k=>k.handle===a?{...k,followedByMe:!1,followerCount:Math.max(0,k.followerCount-1)}:k);return v[y]={...L,sites:x},v},{});return{...g,results:W}});return{...h,pages:m}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(m=>m.handle===a?{...m,followedByMe:!1,followerCount:Math.max(0,m.followerCount-1)}:m)),Ng(n,e,a,!1),t()},onError:r=>{r.statusCode===429&&De(),o()}})}function Cd(e,t,o){const n=d1();return Y1({async mutationFn(r){const a=await n1();return r1(e,a).follow(r)},onSuccess(r,a){const i=M0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!0,followerCount:h.followerCount+1});const b=M0.account("index");n.setQueryData(b,h=>h&&{...h,followingCount:h.followingCount+1});const l=M0.accountFollows(a,"followers"),f=M0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,h=>{if(!h?.pages?.[0])return h;const m=n.getQueryData(M0.account(a==="me"?"index":a));if(!m)return h;const g={id:m.id,name:m.name,handle:m.handle,avatarUrl:m.avatarUrl,blockedByMe:m.blockedByMe,domainBlockedByMe:m.domainBlockedByMe,isFollowing:!0};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}):n.invalidateQueries({queryKey:f}),Bg(n,a,!0),n.setQueryData(M0.exploreProfiles(e),h=>{if(!h)return h;const m=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,L])=>{const x=L.sites.map(k=>k.handle===a?{...k,followedByMe:!0,followerCount:k.followerCount+1}:k);return v[y]={...L,sites:x},v},{});return{...g,results:W}});return{...h,pages:m}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(m=>m.handle===a?{...m,followedByMe:!0,followerCount:m.followerCount+1}:m)),n.setQueryData(l,h=>{if(!h?.pages?.[0])return h;const m=n.getQueryData(M0.account("index"));if(!m)return h;const g={id:m.url,type:"Person",preferredUsername:"index",name:m.name,url:m.url,handle:`index@${new URL(m.url).hostname}`,icon:{type:"Image",url:m.avatarUrl},isFollowing:!1};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}),Ng(n,e,a,!0),t()},onError(r){o(),r.statusCode===429&&De(),r.statusCode===403&&$3()}})}function Ht0(e,t){const o=d1(),n=M0.searchResults(t);return{searchQuery:R2({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await n1();return r1(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 ul(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 Po(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 dl(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 Ut0(e,t){const o=d1();return Y1({async mutationFn({inReplyTo:n,content:r,imageUrl:a,altText:i}){const b=await n1(),l=r1(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=Cg();return Tf(o,n,1),Pf(o,n,1),Lz(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:M0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),Tf(o,r.inReplyTo,-1),Pf(o,r.inReplyTo,-1),Lz(o,e,r.inReplyTo,-1),n.statusCode===403&&$3(),n.statusCode===429&&De(),ge.error("An error occurred while sending your reply.")}})}function Vt0(e,t){const o=d1(),n=M0.feed,r=M0.outbox(e),a=M0.profilePosts("index");return Y1({async mutationFn({content:i,imageUrl:b,altText:l}){const u=await n1(),f=r1(e,u),O=b?{url:b,altText:l}:void 0;return f.note(i,O)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const l=Pt0(i),u=Cg(),f=Tt0(t,u,l,b);return ul(o,n,"posts",f),ul(o,r,"data",f),ul(o,a,"posts",f),{id:u}},onSuccess:(i,b,l)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=oc(i);Po(o,n,"posts",l?.id??"",()=>u),Po(o,r,"data",l?.id??"",()=>u),Po(o,a,"posts",l?.id??"",()=>u)},onError(i,b,l){console.error(i),dl(o,n,"posts",l?.id??""),dl(o,r,"data",l?.id??""),dl(o,a,"posts",l?.id??""),i.statusCode===429&&De(),ge.error("An error occurred while posting your note.")}})}function Nd(e,t,o){const n=o?.enabled!==!1;return R2({queryKey:M0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await n1();return r1(e,r).getAccount(t)}})}function ar0(e,t){const o=d1();return $2({queryKey:M0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await n1(),i=await r1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(M0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function sr0(e){const t=M0.feed,o=d1();return{feedQuery:$2({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:a}){const i=await n1();return r1("index",i).getFeed(a).then(l=>({posts:l.posts.map(oc),next:l.next}))},getNextPageParam(a){return a.next}}),updateFeedActivity:(a,i)=>{Po(o,t,"posts",a,b=>({...b,...i}))}}}function ir0(e){const t=M0.inbox,o=d1();return{inboxQuery:$2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await n1();return r1("index",i).getInbox(a).then(l=>({posts:l.posts.map(oc),next:l.next}))},getNextPageParam(a){return a.next}}),updateInboxActivity:(a,i)=>{Po(o,t,"posts",a,b=>({...b,...i}))}}}function pr0(e){const t=[...M0.discoveryFeed,e.topic],o=d1();return{discoveryFeedQuery:$2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await n1();return r1("index",i).getDiscoveryFeed(e.topic,a).then(l=>({posts:l.posts.map(oc),next:l.next}))},getNextPageParam(a){return a.next}}),updateDiscoveryFeedActivity:(a,i)=>{Po(o,t,"posts",a,b=>({...b,...i}))}}}function Mr0(e,t){const o=M0.profilePosts(e==="me"?"index":e),n=d1();return{postsByAccountQuery:$2({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await n1();return r1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(oc),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Po(n,o,"posts",i,l=>({...l,...b}))}}}function br0(e){const t=M0.postsLikedByAccount,o=d1();return{postsLikedByAccountQuery:$2({queryKey:t,enabled:e.enabled,async queryFn({pageParam:a}){const i=await n1();return r1("index",i).getPostsLikedByAccount(a).then(l=>({posts:l.posts.map(oc),next:l.next}))},getNextPageParam(a){return a.next}}),updatePostsLikedByAccount:(a,i)=>{Po(o,t,"posts",a,b=>({...b,...i}))}}}function Qt0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(M0.feed);t.setQueryData(M0.feed,k=>k&&{...k,pages:k.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(M0.inbox);t.setQueryData(M0.inbox,k=>k&&{...k,pages:k.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&&Lz(t,e,n,-1);const i=M0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,k=>k&&{...k,pages:k.pages.map(C=>({...C,data:C.data.filter(w=>w.object.id!==o)}))});const l=M0.liked(e),u=t.getQueryData(l);let f=!1;t.setQueryData(l,k=>k&&{...k,pages:k.pages.map(C=>(f=C.data.some(w=>w.object.id===o),{...C,data:C.data.filter(w=>w.object.id!==o)}))}),[M0.feed,M0.inbox,M0.discoveryFeed,M0.profilePosts("index"),M0.postsLikedByAccount].some(k=>t.getQueryData(k)?.pages.some(w=>w.posts.some(P=>P.id===o&&P.object.liked)))&&t.setQueryData(M0.account(e),k=>k&&{...k,likedCount:Math.max(0,k.likedCount-1)});const h=M0.profilePosts(null),m=t.getQueriesData(h);t.setQueriesData(h,k=>k&&{...k,pages:k.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});let g=[],W;f&&(g=M0.account(e),W=t.getQueryData(g),t.setQueryData(g,k=>k&&{...k,likedCount:k.likedCount-1<0?0:k.likedCount-1}));const v=M0.profilePosts("index"),y=t.getQueryData(v);t.setQueryData(v,k=>k&&{...k,pages:k.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});const L=M0.postsLikedByAccount,x=t.getQueryData(L);return t.setQueryData(L,k=>k&&{...k,pages:k.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},k=>{if(!k)return k;const C=k.children.filter(P=>P.post.id!==o).map(P=>({...P,chain:P.chain.filter(F=>F.id!==o)}));let w=k.post;return k.post.id===n&&(w={...k.post,replyCount:Math.max(0,(k.post.replyCount||0)-1)}),{...k,post:w,children:C}}),{previousFeed:{key:M0.feed,data:r},previousInbox:{key:M0.inbox,data:a},previousOutbox:{key:i,data:b},previousLiked:{key:l,data:u},previousProfilePosts:{key:h,data:m},previousAccount:f?{key:g,data:W}:null,previousPostsByAccount:{key:M0.profilePosts("index"),data:y},previousPostsLikedByAccount:{key:M0.postsLikedByAccount,data:x}}},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(M0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(M0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:M0.feed}),t.invalidateQueries({queryKey:M0.inbox}))}})}function lr0(e){return $2({queryKey:M0.notifications(e),async queryFn({pageParam:t}){const o=await n1();return r1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function zr0(e,t){const o=R2({queryKey:M0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const f=await n1(),O=r1(e,f);try{return await O.getReplies(t)}catch(h){if(Et0(h)&&h.statusCode===404)return await O.getPost(t),await O.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 f=await n1(),h=await r1(e,f).getReplies(n.ancestors.chain[0].id);r(m=>m&&{...m,ancestors:{chain:[...h.ancestors.chain,...m.ancestors.chain],hasMore:h.ancestors.hasMore}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),l=p.useCallback(async()=>{if(n?.next&&t)try{const f=await n1(),h=await r1(e,f).getReplies(t,n.next);r(m=>m&&{...m,children:[...m.children,...h.children],next:h.next})}catch(f){i(f instanceof Error?f:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async f=>{if(n?.children[f]?.hasMore)try{const O=await n1(),h=r1(e,O),m=n.children[f],g=m.chain.length>1?m.chain[m.chain.length-2]:m.post,W=await h.getReplies(g.id),v=W.children[0].chain;r(y=>{if(!y)return y;const L=[...y.children];return L[f]={...m,chain:[...m.chain,...v],hasMore:W.children[0].hasMore},{...y,children:L}})}catch(O){i(O instanceof Error?O: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:f=>!!n?.children[f]?.hasMore}}function ur0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:M0.account("index")})}})}async function $t0(e){const t=await n1();return r1("index",t).upload(e)}function _g(e,t=!0){const o=p.useCallback(async()=>await n1(),[]),n=p.useCallback(async()=>{const r=await o();return r1(e,r)},[e,o]);return R2({queryKey:M0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function Zt0(e){const t=d1(),o=p.useCallback(async()=>await n1(),[]),n=p.useCallback(async()=>{const r=await o();return r1(e,r)},[e,o]);return Y1({async mutationFn(){return t.setQueryData(M0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function dr0(e,t){const o=d1(),n=[...M0.exploreProfiles(e),t];return{exploreProfilesQuery:$2({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await n1(),u=await r1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(f=>{o.setQueryData(M0.account(f.handle),f)}),{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(f=>{const O=f.accounts.map(h=>h.id===i?{...h,...b}:h);return{...f,accounts:O}});return{...l,pages:u}})}}}function Bd(e,t=3){const o=d1(),n=M0.suggestedProfiles(e,t);return{suggestedProfilesQuery:R2({queryKey:n,async queryFn(){const i=await n1(),u=(await r1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(f=>{o.setQueryData(M0.account(f.handle),f)}),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 _d(){return{topicsQuery:R2({queryKey:M0.topics(),async queryFn(){const t=await n1();return r1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function Ed(e,t){const o=M0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function Or0(e){const t=d1();return Y1({async mutationFn(){const o=await n1();return r1(e,o).enableBluesky()},onSuccess(){Ed(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:M0.accountFollows("index","following")})},onError(o){o.statusCode===429&&De()}})}function fr0(e){const t=d1();return Y1({async mutationFn(){const o=await n1();return r1(e,o).disableBluesky()},onSuccess(){Ed(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:M0.accountFollows("index","following")})},onError(o){o.statusCode===429&&De()}})}function Ar0(e){const t=d1();return Y1({async mutationFn(){const o=await n1();return r1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&Ed(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&De()}})}let Fi=null;const Xf=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=p0.useReducer(l=>l+1,0),i=Fi===o&&!n,b=l=>{i?(t(l),setTimeout(()=>{Fi=null,r()},0)):(Fi=o,r(),e(l))};return z.jsx(e1,{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(U8,{className:"-mb-px !size-3 !stroke-[2.4]"}):z.jsx($8,{className:"!size-[14px] !stroke-2"})})},To=({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,f]=p.useState(e?.icon?.url),O=Kt(),h=Cd("index",()=>{ge.success(`Followed ${e?.name}`)},()=>{ge.error("Failed to follow")}),m=xd("index",()=>{ge.info(`Unfollowed ${e?.name}`)},()=>{ge.error("Failed to unfollow")});switch(p.useEffect(()=>{f(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||So(e),W=k=>{k.stopPropagation(),O(`/profile/${g}`)},v=k=>{k.stopPropagation(),h.mutate(g)},y=k=>{k.stopPropagation(),m.mutate(g)},x=a||Fi===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:()=>f(void 0)}),x&&z.jsx(Xf,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]}):z.jsxs("div",{className:b,onClick:n?void 0:W,children:[z.jsx(nd,{className:"text-gray-600",size:i,strokeWidth:1.5}),x&&z.jsx(Xf,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]})},Ol=({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 f=m=>{m.stopPropagation(),t()},O=m=>{m.stopPropagation(),o()},h=m=>{m.stopPropagation(),i?u():l()};return z.jsxs(bK,{children:[z.jsxs(_Y,{children:[z.jsx(EY,{disabled:r,asChild:!0,onClick:m=>m.stopPropagation(),children:e}),z.jsx(Mm,{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(Ml,{asChild:!0,children:z.jsxs(e1,{className:"justify-start",variant:"ghost",onClick:f,children:[z.jsx(LZ,{}),"Copy link"]})}),!b&&z.jsx(Ml,{asChild:!0,children:z.jsxs(e1,{className:"justify-start",variant:"ghost",onClick:h,children:[i?z.jsx(sG,{}):z.jsx(pG,{}),i?"Unfollow":"Follow"]})}),n&&z.jsx(lK,{asChild:!0,children:z.jsx(Ml,{asChild:!0,children:z.jsxs(e1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:m=>m.stopPropagation(),children:[z.jsx(Y8,{}),"Delete"]})})})]})})]}),z.jsxs(o9,{onClick:m=>m.stopPropagation(),children:[z.jsxs(n9,{children:[z.jsx(c9,{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(r9,{children:[z.jsx(i9,{onClick:m=>m.stopPropagation(),children:"Cancel"}),z.jsx(s9,{className:h3({variant:"destructive"}),onClick:O,children:"Delete"})]})]})]})};function Gt0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const l=Td(b);if(!l)return[];if(Array.isArray(l))return l.map((u,f)=>({url:u.url,alt:u.name||`Image-${f}`}));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(f=>f.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 fl=({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=f=>{o&&(f.key==="ArrowRight"&&!i?b():f.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(Da,{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(e1,{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(eZ,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Previous image"})]}),z.jsxs(e1,{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(Ju,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Next image"})]})]}),z.jsx(hK,{asChild:!0,children:z.jsxs(e1,{className:"absolute right-5 top-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[z.jsx(cd,{className:"!size-5"}),z.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},jf=()=>{},Sd=({className:e,following:t,handle:o,variant:n="default",onFollow:r=jf,onUnfollow:a=jf,"data-testid":i})=>{const[b,l]=p.useState(t),u=xd("index",()=>{},()=>{l(!0)}),f=Cd("index",()=>{},()=>{l(!1)}),O=async()=>{b?(l(!1),a(),u.mutate(o)):(l(!0),r(),f.mutate(o))};p.useEffect(()=>{l(t)},[t]);const h=b?"Following":"Follow";return n==="link"?z.jsx(e1,{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:m=>{m?.preventDefault(),m?.stopPropagation(),O()},children:h}):z.jsx(e1,{className:Z1("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:m=>{m?.preventDefault(),m?.stopPropagation(),O()},children:h})};function Cz(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 f=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(f,O=>{const h=`__EXCLUDED_TAG_${r+=1}__`;return n[h]=O,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,f]of Object.entries(n))l=l.replace(u,f);return l}const Hi=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},Df=e=>"preferredUsername"in e,Bo=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:a=!1})=>{const[i,b]=p.useState(!1),l=Kt();let u=e?.handle;!u&&e&&Df(e)&&(u=So(e));const f=o||!u&&!e,O=Nd("index",u||"",{enabled:i&&!!u}),h=O.isFetching||O.isLoading,m=O.error,g=O.data?typeof O.data.followerCount=="number"&&typeof O.data.followingCount=="number"&&O.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!g&&!h&&!m&&O.refetch({cancelRefetch:!1})},[O,h,m,g,i,u]),f)return z.jsx(z.Fragment,{children:t});const v=O.data||e,y=v?.handle??u??"",L=v?.name??"",x=v?.avatarUrl??(e&&Df(e)?e.icon?.url:null)??null,k=!!v?.followsMe,C=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,w=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,P=v?.bio?Hi(Cz(v.bio,["a"])):void 0,F=()=>{y&&l(`/profile/${y}`)},e0=()=>{y&&l(`/profile/${y}/following`)},G=()=>{y&&l(`/profile/${y}/followers`)};return z.jsxs(KY,{onOpenChange:b,children:[z.jsx(YY,{asChild:!0,children:t}),z.jsx(qm,{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:Y=>Y.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(ad,{className:"size-14 cursor-pointer",onClick:F,children:[x&&z.jsx(sd,{alt:L,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:x,onError:Y=>{Y.target.src="",Y.target.style.display="none"}}),z.jsx(id,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:z.jsx(nd,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!a&&z.jsx(Sd,{following:!!v?.followedByMe,handle:y,type:"primary"})]}),z.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:F,children:[z.jsx(Bm,{className:"w-full truncate",children:L}),z.jsxs("div",{className:"flex w-full gap-2",children:[z.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:y}),k&&!a&&z.jsx(OK,{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"}):!m&&z.jsxs(z.Fragment,{children:[z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:e0,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:af(C)})," ","Following"]}),z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:G,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:af(w)})," ","Followers"]})]})}),h?z.jsx(w1,{className:"h-4 w-48"}):!m&&P?z.jsx("div",{dangerouslySetInnerHTML:{__html:P},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a:hover]:underline [&_a]:text-[#00a4eb]"}):null]})})]})},Eg=(e={})=>{const[t,o]=p.useState(!1),n=Re();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:f})=>{const[O,h]=p.useState(t.liked),[m,g]=p.useState(t.reposted),[W,v]=p.useState(!1),y=p.useRef(null);Eg({isReplyAvailable:!u&&a!=="reply",onOpenReply:()=>v(!0),componentRef:y}),p.useEffect(()=>{h(t.liked),g(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{P(r)},[r]);const L=Xt0("index"),x=jt0("index"),k=Dt0("index"),C=It0("index"),[w,P]=p.useState(r),F=async Y=>{Y.stopPropagation(),O?x.mutate(t.id):L.mutate(t.id,{onError(){h(!1)}}),h(!O),l()},e0=Y=>{Y.stopPropagation(),u?u():v(!0)},G=`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(e1,{className:`${G} ${O&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${O?"Undo like":"Like"}`,variant:"ghost",onClick:Y=>{Y?.stopPropagation(),Y&&F(Y)},children:[z.jsx(gZ,{className:`${O&&"fill-pink-500 text-pink-500"}`}),a!=="inbox"&&z.jsx(zf,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),z.jsxs(e1,{className:`${G}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:e0,children:[z.jsx(td,{className:"-mr-px"}),a!=="inbox"&&n>0&&Yu(n)]}),z.jsxs(e1,{className:`${G} ${m&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${m?"Undo repost":"Repost"}`,variant:"ghost",onClick:Y=>{Y?.stopPropagation(),m?(C.mutate(t.id),P(w-1)):(k.mutate(t.id,{onError(){g(!1),P(w-1)}}),P(w+1)),g(!m)},children:[z.jsx(Z8,{className:`${m&&"text-green-500"}`}),a!=="inbox"&&z.jsx(zf,{className:w===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:w})]})]}),W&&z.jsx(Pd,{open:W,replyTo:{object:t,actor:e},onOpenChange:Y=>{v(Y)},onReply:()=>{f?.(1),v(!1)},onReplyError:()=>{f?.(-1)}})]})};function Kt0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const yo=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||So(e)}`)},Yt0=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()?Jt0(e):a.getTime()===r.getTime()?"Yesterday":eo0(e)},Jt0=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`},eo0=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 to0(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=to0(o),r=Yt0(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 Td(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 Uc(e,t,o,n){const r=Td(e);if(!r)return null;const a=l=>u=>{u.stopPropagation(),t&&t(l)},i=l=>{n&&n(l)},b=(l,u=!1)=>{const f=u?"min-h-[200px]":"";return z.jsx("div",{className:`${l} ${f} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:z.jsx(vZ,{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((f,O)=>{const h=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${l===3&&O===0?"row-span-2":""}`;return o&&o.has(f.url)?b(h,l===1):z.jsx("img",{alt:f.name||`Image-${O}`,className:`${h} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:f.url,onClick:t?a(f.url):void 0,onError:()=>i(f.url)},f.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 oo0(e,t){const o=Td(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(HZ,{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 If=()=>{},Ff=z.jsx(Z8,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),no0=({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:f,isLoading:O,isPending:h=!1,isCompact:m=!1,isChainContinuation:g=!1,isChainParent:W=!1,onClick:v=If,onDelete:y=If,showStats:L=!0})=>{const x=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"}),[,k]=p.useState(!1),[C,w]=p.useState(new Set),P=p.useRef(null),[F,e0]=p.useState(!1),G=Qt0("index"),Y=Kt(),o0=Cd("index",()=>{ge.success(`Followed ${X?.name}`)},()=>{ge.error("Failed to follow")}),K=xd("index",()=>{ge.info(`Unfollowed ${X?.name}`)},()=>{ge.error("Failed to unfollow")});p.useEffect(()=>{const V0=P.current;V0&&e0(V0.scrollHeight>V0.clientHeight)},[o?.content]),p.useEffect(()=>{const V0=P.current;if(!V0)return;const l1=E=>{const r0=E.target.closest("a[data-profile]");if(r0){const f0=r0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(f0||"")&&f0&&(E.preventDefault(),E.stopPropagation(),yo(f0,Y))}};return V0.addEventListener("click",l1),()=>{V0.removeEventListener("click",l1)}},[Y,o?.content]);const a0=()=>{},g0=()=>{h||v()},Q=()=>{G.mutate({id:o.id,parentId:n}),y()},A0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),k(!0),ge.success("Link copied"),setTimeout(()=>k(!1),2e3))},$=V0=>{w(l1=>new Set(l1).add(V0))};let X=e;a==="Announce"&&(X=typeof o.attributedTo=="object"?o.attributedTo:e);const Z=X?So(X):null,B=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,b0=a==="Announce"?o.reposted??!1:o.authored,O0=()=>{Z&&o0.mutate(Z)},m0=()=>{Z&&K.mutate(Z)},W0=z.jsx(e1,{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(V8,{})}),{lightboxState:z0,openLightbox:t0,closeLightbox:N0,navigateToIndex:_0}=Gt0(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:g0,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:[Ff,z.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[z.jsx(Bo,{actor:e,align:"center",isCurrentUser:b0,children:z.jsx("span",{className:"truncate break-anywhere hover:underline",onClick:V0=>{yo(e,Y,V0)},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(Bo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(To,{author:X,disabled:h,showFollowButton:!I&&!B}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:V0=>{h||yo(X,Y,V0)},children:[z.jsx("span",{className:`min-w-0 truncate font-semibold break-anywhere ${m?"text-lg":"text-md"} ${h?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:O?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:O?z.jsx(w1,{className:"w-56"}):So(X)}),z.jsx("div",{className:`ml-1 before:mr-1 ${!O&&'before:content-["·"]'}`,title:`${x}`,children:O?z.jsx(w1,{className:"w-4"}):yi(o,h===!1&&!o.authored)})]})]})]})}),z.jsx(Ol,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:B,layout:"feed",trigger:W0,onCopyLink:A0,onDelete:Q,onFollow:O0,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:[Uc(o,g0,C,$),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:O?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:P,onClick:V0=>{const l1=V0.target;(l1.tagName==="A"||l1.closest("a"))&&V0.stopPropagation()}})}),F&&z.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),Uc(o,t0,C,$)]})}),z.jsx("div",{className:"space-between relative z-[30] ml-[-8px] mt-1 flex",children:O?z.jsx(w1,{className:"ml-2 w-18"}):L&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]})]}),z.jsx(fl,{currentIndex:z0.currentIndex,images:z0.images,isOpen:z0.isOpen,onClose:N0,onNavigate:_0})]}):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:g0,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(To,{author:X,showFollowButton:!I&&!B})}),z.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:V0=>{h||yo(X,Y,V0)},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:So(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(m2,{className:"mb-1 leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:P,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"}),Uc(o,t0,C,$),z.jsx("div",{className:"space-between ml-[-8px] mt-3 flex",children:L&&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(fl,{currentIndex:z0.currentIndex,images:z0.images,isOpen:z0.isOpen,onClose:N0,onNavigate:_0})]}):r==="reply"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative ${m?"pb-6":g?"pb-5":"py-5"} ${h?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:g0,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(Bo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(To,{author:X,disabled:h,showFollowButton:!I&&!B}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:V0=>{h||yo(X,Y,V0)},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:So(X)})})]})]})}),!m&&z.jsx(Ol,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:B,layout:"reply",trigger:W0,onCopyLink:A0,onDelete:Q,onFollow:O0,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"&&Uc(o,g0,C,$),o.name&&z.jsx(m2,{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:Hi(o.content||"")??""},ref:P,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"&&Uc(o,t0,C,$),o.type==="Article"&&z.jsx(e1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!m&&z.jsx("div",{className:"space-between ml-[-8px] mt-2 flex",children:L&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),!f&&z.jsx("div",{className:`absolute left-[19px] ${m?"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(fl,{currentIndex:z0.currentIndex,images:z0.images,isOpen:z0.isOpen,onClose:N0,onNavigate:_0})]}):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:g0,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:O?z.jsx(w1,{className:"w-24"}):z.jsxs(z.Fragment,{children:[z.jsx(Bo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex items-center gap-1",children:[z.jsx(To,{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:V0=>{yo(X,Y,V0)},children:X.name})]})}),a==="Announce"&&z.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[Ff,z.jsx(Bo,{actor:e,align:"center",isCurrentUser:b0,children:z.jsx("span",{className:"line-clamp-1 hover:underline",onClick:V0=>{yo(e,Y,V0)},children:e.name})})," reposted"]}),z.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${x}`,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(m2,{className:"line-clamp-2 w-full max-w-[600px] text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:O?z.jsx(w1,{className:"w-full max-w-96"}):o.name?o.name:z.jsx("span",{dangerouslySetInnerHTML:{__html:Cz(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:O?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Cz(o.preview?.content??o.content??"")}})}),z.jsx("span",{className:"mt-1 shrink-0 whitespace-nowrap text-sm leading-none text-gray-600",children:O?z.jsx(w1,{className:"w-16"}):o.content&&`${Kt0(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:[L&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0}),z.jsx(Ol,{allowDelete:t,authoredByMe:I,followedByMe:B,layout:"inbox",trigger:W0,onCopyLink:A0,onDelete:Q,onFollow:O0,onUnfollow:m0})]})]})]}),oo0(o,O)]})}):z.jsx(z.Fragment,{})},Hf=5*1024*1024,Uf="Image must be less than 5MB in size.",hr0=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}},qr0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),mr0="Image must be square.",Pd=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...a})=>{const{data:i}=Ft0("index"),b=Vt0("index",i),l=Ut0("index",i),{data:u,isLoading:f}=Nd("index","me"),[O,h]=p.useState(!1),m=p.useRef(null),g=p.useRef(null),[W,v]=p.useState(null),[y,L]=p.useState(!1),x=p.useRef(null),[k,C]=p.useState(""),[w,P]=p.useState(null),[F,e0]=p.useState(""),[G,Y]=p.useState(!1),[o0,K]=p.useState(!1),[a0,g0]=p.useState(!1),Q=Kt(),A0=500;p.useEffect(()=>{a.open!==void 0&&h(a.open)},[a.open]),p.useEffect(()=>{if(a.open!==void 0?a.open:O){const N0=setTimeout(()=>{g0(!0)},300);return()=>clearTimeout(N0)}else g0(!1)},[O,a.open]);const $=!k.trim()||!i||o0||k.length>A0,X=p.useCallback(async()=>{const t0=k.trim();if(!(!t0||!i))try{K(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:t0,imageUrl:w||void 0,altText:F||void 0}),o?.()):(await b.mutateAsync({content:t0,imageUrl:w||void 0,altText:F||void 0}),Q("/notes")),h(!1),r&&r(!1),ge.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{K(!1)}},[k,i,t,l,b,w,F,o,n,h,Q,r]),Z=t0=>{C(t0.target.value)};p.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${m.current.scrollHeight}px`)},[k]),p.useEffect(()=>{if((a.open!==void 0?a.open:O)&&m.current){const N0=setTimeout(()=>{m.current?.focus()},100);return()=>clearTimeout(N0)}},[O,a.open]),p.useEffect(()=>{if(G&&g.current){const t0=setTimeout(()=>{g.current?.focus()},100);return()=>clearTimeout(t0)}},[G]),p.useEffect(()=>{const t0=_0=>{(_0.metaKey||_0.ctrlKey)&&_0.key==="Enter"&&(_0.preventDefault(),!$&&!y&&X())};if(a.open!==void 0?a.open:O)return document.addEventListener("keydown",t0),()=>document.removeEventListener("keydown",t0)},[O,a.open,$,y,X]);const B=p.useCallback(async t0=>{const N0=t0.clipboardData?.items;if(N0)for(let _0=0;_0<N0.length;_0++){const V0=N0[_0];if(V0.type.indexOf("image")!==-1){t0.preventDefault();const l1=V0.getAsFile();if(l1){if(l1.size>Hf){ge.error(Uf);return}const E=URL.createObjectURL(l1);v(E),await I(l1)}break}}},[]);p.useEffect(()=>{if(a.open!==void 0?a.open:O)return document.addEventListener("paste",B),()=>document.removeEventListener("paste",B)},[O,a.open,B]);const I=async t0=>{try{L(!0);const N0=await $t0(t0);P(N0)}catch(N0){v(null);let _0="Failed to upload image. Try again.";if(N0&&typeof N0=="object"&&"statusCode"in N0)switch(N0.statusCode){case 413:_0="Image size exceeds limit.";break;case 415:_0="The file type is not supported.";break}ge.error(_0)}finally{L(!1)}},b0=async t0=>{const N0=t0.target.files;if(N0&&N0.length>0){const _0=N0[0];if(_0.size>Hf){ge.error(Uf),t0.target.value="";return}const V0=URL.createObjectURL(_0);v(V0),await I(_0)}},O0=t0=>{t0.stopPropagation(),v(null),P(null),e0(""),Y(!1),W&&URL.revokeObjectURL(W),x.current&&(x.current.value="")},m0=t0=>{t0.stopPropagation(),Y(!G)},W0=()=>{m.current?.focus()};p.useEffect(()=>()=>{W&&URL.revokeObjectURL(W)},[W]);let z0="What's new?";if(t){const t0=t.object.attributedTo||{};typeof t0=="object"&&"preferredUsername"in t0&&"id"in t0&&(z0=`Reply to ${So(t0)}...`)}return z.jsxs(q3,{open:a.open!==void 0?a.open:O,onOpenChange:t0=>{t0&&(C(""),v(null),P(null),e0(""),Y(!1),W&&URL.revokeObjectURL(W),x.current&&(x.current.value="")),h(t0),r&&r(t0)},...a.open!==void 0?{}:a,children:[z.jsx(p9,{asChild:!0,children:e}),z.jsxs(Da,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:t0=>t0.stopPropagation(),children:[z.jsxs(Md,{className:"hidden",children:[z.jsx(ld,{children:t?"Reply":"New note"}),z.jsx(b9,{children:"Post your thoughts to the Social web"})]}),t&&z.jsx(no0,{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(To,{author:i})}),z.jsx(UT,{asChild:!0,children:z.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[f?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(c6,{name:"content",asChild:!0,children:z.jsx(a6,{asChild:!0,children:z.jsx("textarea",{ref:m,autoFocus:!0,className:"ap-textarea w-full resize-none bg-transparent text-[1.5rem] break-anywhere","data-testid":"note-textarea",placeholder:z0,rows:1,value:k,onChange:Z,onPaste:B})})}),z.jsx(c6,{name:"image",asChild:!0,children:z.jsx(a6,{asChild:!0,children:z.jsx("input",{ref:x,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:b0})})})]})})]}),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(mp,{size:"md"})}),z.jsx(e1,{className:"absolute right-3 top-3 size-8 bg-black/60 text-white opacity-0 hover:bg-black/80 group-hover:opacity-100",onClick:O0,children:z.jsx(Y8,{})}),!y&&z.jsx(e1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${G?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:m0,children:"Alt"})]}),W&&!y&&G&&z.jsx("div",{className:"mt-1",children:z.jsx(w3,{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:F,onChange:t0=>e0(t0.target.value)})}),z.jsxs(bd,{className:`${a0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[z.jsx(e1,{className:"mr-auto w-[34px] !min-w-0",variant:"outline",onClick:()=>x.current?.click(),children:z.jsx(yZ,{})}),z.jsxs("div",{className:"flex items-center space-x-3",children:[z.jsxs("div",{className:`text-sm ${k.length>=A0?"text-red-500":k.length>=A0*.9?"text-yellow-600":"text-gray-500"}`,children:[k.length,"/",A0]}),z.jsx(e1,{className:"min-w-16","data-testid":"post-button",disabled:$||y,onClick:X,children:o0?z.jsx(mp,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function Nz(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function ro0(e,t){const o=Nz(e);return JSON.stringify({...o,...t})}const Sg=()=>{const{data:e}=ve(),{mutateAsync:t}=Fm(),o=p0.useMemo(()=>e?.accessibility?Nz(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=p0.useCallback(async r=>{if(!e)return;const a=Nz(e.accessibility),i=ro0(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})}},Tg=()=>z.jsx("div",{className:"h-full pt-14",children:z.jsx(yn,{})}),co0=Object.freeze(Object.defineProperty({__proto__:null,default:Tg,useOnboardingStatus:Sg},Symbol.toStringTag,{value:"Module"})),ao0=()=>{const e=Kt();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(EZ,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(m2,{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(e1,{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"})]})]})},kp=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const a=p0.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},so0=()=>{const e=Kt(),{suggestedProfilesQuery:t}=Bd("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:a}=n3(),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(Op,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(m2,{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}`,f=b?.name||"",O=b?.handle||"",h=b?.avatarUrl||"";let m;switch(l){case 0:m="[@media(max-height:740px)]:hidden";break;case 1:m="[@media(max-height:800px)]:hidden";break;case 2:m="[@media(max-height:860px)]:hidden";break}return z.jsx(p.Fragment,{children:z.jsx("li",{className:m,children:z.jsx(Bo,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(kp,{onClick:()=>{!n&&b&&yo(b,e)},children:[n?z.jsx(w1,{className:"z-10 size-10"}):z.jsx(To,{author:{icon:{url:h},name:f,handle:O},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"}):f}),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"}):O})]})]})})})},u)},u)})}),z.jsx(e1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{a(),e("/explore")},children:"Find more →"})]})},io0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},i=Kt();return z.jsx(Bo,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(kp,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[z.jsx(To,{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(Sd,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:a})]},e.id)})})},po0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=Bd("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(p0.Fragment,{children:z.jsx(io0,{isLoading:r,profile:a||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},a?.id||`loading-${i}`))})})};function Mo0(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([]),f=p.useRef(),O=p.useRef(),h=p.useRef(e),m=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,L="maxWait"in o,x="debounceOnServer"in o&&!!o.debounceOnServer,k=L?Math.max(+o.maxWait||0,t):null;p.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var C=p.useMemo(function(){var w=function(K){var a0=u.current,g0=f.current;return u.current=f.current=null,i.current=K,b.current=b.current||K,O.current=h.current.apply(g0,a0)},P=function(K,a0){W&&cancelAnimationFrame(l.current),l.current=W?requestAnimationFrame(K):setTimeout(K,a0)},F=function(K){if(!m.current)return!1;var a0=K-a.current;return!a.current||a0>=t||a0<0||L&&K-i.current>=k},e0=function(K){return l.current=null,y&&u.current?w(K):(u.current=f.current=null,O.current)},G=function K(){var a0=Date.now();if(v&&b.current===i.current&&Y(),F(a0))return e0(a0);if(m.current){var g0=t-(a0-a.current),Q=L?Math.min(g0,k-(a0-i.current)):g0;P(K,Q)}},Y=function(){n&&n({})},o0=function(){if(g||x){var K=Date.now(),a0=F(K);if(u.current=[].slice.call(arguments),f.current=r,a.current=K,a0){if(!l.current&&m.current)return i.current=a.current,P(G,t),v?w(a.current):O.current;if(L)return P(G,t),w(a.current)}return l.current||P(G,t),O.current}};return o0.cancel=function(){var K=l.current;K&&(W?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=f.current=l.current=null,K&&n&&n({})},o0.isPending=function(){return!!l.current},o0.flush=function(){return l.current?e0(Date.now()):O.current},o0},[v,L,t,k,y,W,g,x,n]);return C}function bo0(e,t){return e===t}function lo0(e,t,o){var n=bo0,r=p.useRef(e),a=p.useState({})[1],i=Mo0(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,zo0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),a=p.useRef(0),i=Kt(),[b]=lo0(t,300),l=t.length>=2,{searchQuery:u,updateAccountSearchResult:f}=Ht0("index",l?b:""),{data:O,isFetching:h,isFetched:m}=u,{suggestedProfilesQuery:g}=Bd("index",5),{data:W,isLoading:v}=g,y=v||W&&W.length>0,{topicsQuery:L}=_d(),{data:x}=L,k=Nd("index","me"),{data:C}=k,[w,P]=p.useState([]),[F,e0]=p.useState(null),[G,Y]=p.useState(0),o0=p.useMemo(()=>{const X=x?.topics||[];if(!l||X.length===0)return[];const Z=t.toLowerCase();return X.filter(B=>B.slug==="following"?!1:B.name.toLowerCase().startsWith(Z)||B.slug.toLowerCase().startsWith(Z))},[t,l,x?.topics]),K=p.useMemo(()=>[...o0.map(X=>({type:"topic",data:X})),...w.map(X=>({type:"account",data:X}))],[o0,w]);p.useEffect(()=>{if(!l){P([]),e0(null);return}m&&(O?.accounts&&O.accounts.length>0?(P(O.accounts),e0("results"),Y(0)):(P([]),e0("none"),Y(0)))},[O?.accounts,m,l]);const a0=h&&l,g0=t.length<2||!F&&l&&o0.length===0,Q=!g0&&F==="none"&&o0.length===0,A0=!g0&&(w.length>0||o0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const X=r.current[G];if(!X)return;const Z=X.closest("[data-radix-scroll-area-viewport]")||X.closest(".overflow-y-auto");if(!Z){X.scrollIntoView({block:"nearest"});return}const B=Z.getBoundingClientRect(),I=X.getBoundingClientRect();I.top<B.top+wi?Z.scrollTo({top:Z.scrollTop-(B.top+wi-I.top),behavior:"smooth"}):I.bottom>B.bottom-wi&&Z.scrollTo({top:Z.scrollTop+(I.bottom-B.bottom+wi),behavior:"smooth"})},[G]);const $=X=>{if(!(!A0||K.length===0)){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const Z=Date.now();if(Z-a.current<50)return;a.current=Z,X.key==="ArrowDown"?Y(B=>(B+1)%K.length):Y(B=>(B-1+K.length)%K.length)}else if(X.key==="Enter"){const Z=K[G];if(!Z)return;X.preventDefault(),e?.(!1),Z.type==="topic"?i(`/explore/${Z.data.slug}`):i(`/profile/${Z.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(od,{className:"text-gray-600",size:18,strokeWidth:1.5}),z.jsx(w3,{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:$}),a0&&z.jsx(mp,{className:"!absolute right-0 mr-0.5 shrink-0",size:"sm"})]}),z.jsxs("div",{className:"h-full",children:[Q&&z.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:z.jsxs(oJ,{children:[z.jsx(nJ,{children:z.jsx(nd,{})}),"No users matching this handle or account URL"]})}),A0&&z.jsx("div",{className:"mt-[-14px] pb-2",children:K.map((X,Z)=>{const B=Z===G;if(X.type==="topic")return z.jsx("div",{ref:O0=>r.current[Z]=O0,children:z.jsxs(kp,{isSelected:B,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(Op,{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,b0=I.handle===C?.handle;return z.jsx(Bo,{actor:I,align:"center",isCurrentUser:b0,side:"left",children:z.jsx("div",{ref:O0=>r.current[Z]=O0,children:z.jsxs(kp,{isSelected:B,onClick:()=>{e?.(!1),i(`/profile/${I.handle}`)},children:[z.jsx(To,{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(e1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):b0?null:z.jsx(Sd,{className:"ml-auto",following:I.followedByMe,handle:I.handle,type:"secondary",onFollow:()=>f(I.id,{followedByMe:!0}),onUnfollow:()=>f(I.id,{followedByMe:!1})})]})})},I.id)})}),g0&&y&&z.jsxs(z.Fragment,{children:[z.jsx(m2,{children:"More people to follow"}),z.jsx(po0,{onOpenChange:e})]})]})]})},uo0=()=>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(od,{size:18,strokeWidth:1.5})," Search the social web"]}),hn=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const a=Re(),{resetStack:i}=n3(),b=Q3(),l=e&&e.startsWith("/")?`${b}${e}`:e,u=l&&(a.pathname===l||a.pathname.startsWith(`${l}/`)),f=q0("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"),O=o&&o>0?z.jsx("span",{className:q0("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:Yu(o)}):null;return l?z.jsx(e1,{className:f,variant:"ghost",asChild:!0,children:z.jsxs(Ba,{to:l,onClick:()=>{i(),xJ(l)},children:[t,O]})}):z.jsxs(e1,{ref:r,className:f,variant:"ghost",onClick:n.onClick,...n,children:[t,O]})});hn.displayName="SidebarMenuLink";const Pg=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=Ct0(),[n,r]=p.useState(!1),[a,i]=p.useState(""),{data:b}=ve(),l=Re(),u=Q3(),{data:f}=_g(b?.slug||""),O=Zt0(b?.slug||""),{topicsQuery:h}=_d(),{data:m,isLoading:g}=h,W=!g&&m&&m.topics.length===0;p.useEffect(()=>{l.pathname===`${u}/notifications`&&f&&f>0&&O.mutate()},[l.pathname,u,f,O]);const v=p.useCallback(()=>{f&&f>0&&O.mutate()},[f,O]);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(p9,{className:"mt-0.5 w-full",children:z.jsx(uo0,{})}),z.jsx(Da,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:z.jsx(zo0,{query:a,setQuery:i,onOpenChange:r})})]})}),z.jsxs("div",{className:"flex w-full flex-col gap-px",children:[z.jsxs(hn,{to:"/reader",children:[z.jsx(Q$,{size:18,strokeWidth:1.5}),"Reader"]}),z.jsxs(hn,{to:"/notes",children:[z.jsx(td,{size:18,strokeWidth:1.5}),"Notes"]}),z.jsxs(hn,{count:l.pathname!==`${u}/notifications`?f:void 0,to:"/notifications",onClick:v,children:[z.jsx(U$,{size:18,strokeWidth:1.5}),"Notifications"]}),W?z.jsx(e1,{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(Op,{size:18,strokeWidth:1.5}),"Explore",z.jsx(ed,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):z.jsxs(hn,{to:"/explore",children:[z.jsx(Op,{size:18,strokeWidth:1.5}),"Explore"]}),z.jsxs(hn,{to:"/profile",children:[z.jsx(rd,{size:18,strokeWidth:1.5}),"Profile"]}),z.jsxs(hn,{to:"/preferences",children:[z.jsx(KZ,{size:18,strokeWidth:1.5}),"Preferences"]})]}),z.jsx(Pd,{children:z.jsxs(e1,{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(dZ,{}),"New note"]})}),z.jsx(so0,{}),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(ao0,{})})]})})};Pg.displayName="Sidebar";const do0=({children:e,...t})=>{const{isOnboarded:o}=Sg(),n=Q3(),{data:r,isLoading:a}=ve(),i=p.useRef(null),[b,l]=p.useState(!1),u=kg(),{topicsQuery:f}=_d(),{data:O}=f,h=O&&O.topics.length>0,{isNewNoteModalOpen:m,setIsNewNoteModalOpen:g}=Eg(),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(CJ,{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(_t0,{showBorder:!(u==="reader"&&h)&&u!=="explore",onToggleMobileSidebar:W}),z.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),z.jsx(Pg,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&z.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):z.jsx(Tg,{})}),z.jsx(Pd,{open:m,onOpenChange:g})]}):z.jsx(qn,{to:`${n}/welcome`,replace:!0})},Vc=({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}),Qc=({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}),Xg=({statusCode:e,errorCode:t})=>{const o=oq(),n=_m(),r=a=>{a.preventDefault(),n("/analytics/",{crossApp:!0})};return o?z.jsx(do0,{children:z.jsxs(Qc,{children:[z.jsx(Vc,{children:z.jsx($Z,{})}),z.jsx(m2,{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(Qc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Vc,{children:z.jsx(cG,{})}),z.jsx(m2,{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(e1,{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(Qc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Vc,{children:z.jsx(G8,{})}),z.jsx(m2,{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(e1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):z.jsxs(Qc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Vc,{children:z.jsx(F$,{})}),z.jsx(m2,{className:"-mb-4",children:"Account suspended"}),z.jsx("div",{children:"Your account has been suspended due to policy violations."}),z.jsx(e1,{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(Qc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Vc,{children:z.jsx(pZ,{})}),z.jsx(m2,{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(e1,{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"})]})})},Oo0=Object.freeze(Object.defineProperty({__proto__:null,default:Xg},Symbol.toStringTag,{value:"Module"})),fo0="activitypub",jg=[{path:fo0,element:z.jsx(yn,{}),errorElement:z.jsx(Xg,{}),handle:"activitypub-basepath",children:[{index:!0,element:z.jsx(qn,{to:"reader"})},{path:"inbox",element:z.jsx(qn,{to:"../reader",replace:!0})},{path:"feed",element:z.jsx(qn,{to:"../notes",replace:!0})},{path:"reader",lazy:A1(()=>M1(()=>import("./index-C5Mf4zlN.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"reader/:postId",lazy:A1(()=>M1(()=>import("./index-C5Mf4zlN.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"notes",lazy:A1(()=>M1(()=>import("./feed-DB25J9B-.js"),__vite__mapDeps([7,8]),import.meta.url)),pageTitle:"Notes"},{path:"notes/:postId",lazy:A1(()=>M1(()=>import("./note-Bs7yEUc9.js"),__vite__mapDeps([9,2,3,8]),import.meta.url)),pageTitle:"Note"},{path:"notifications",lazy:A1(()=>M1(()=>import("./index-DG5ENBXM.js"),__vite__mapDeps([10,11,12,13]),import.meta.url)),pageTitle:"Notifications"},{path:"explore",lazy:A1(()=>M1(()=>import("./index-CIheyf0S.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"explore/:topic",lazy:A1(()=>M1(()=>import("./index-CIheyf0S.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"profile",lazy:A1(()=>M1(()=>import("./index-SafJnMjy.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"profile/likes",lazy:A1(()=>M1(()=>import("./index-SafJnMjy.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"profile/following",lazy:A1(()=>M1(()=>import("./index-SafJnMjy.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"profile/followers",lazy:A1(()=>M1(()=>import("./index-SafJnMjy.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:A1(()=>M1(()=>import("./index-SafJnMjy.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"preferences",lazy:A1(()=>M1(()=>import("./index-8pnhFllL.js"),__vite__mapDeps([30,31,27,26,29,18,19,11]),import.meta.url)),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:A1(()=>M1(()=>import("./moderation-DBHou9Tg.js"),__vite__mapDeps([32,20,21,22,23,24,11,25,26,8,6,1,17,27,12,28,13,15,3]),import.meta.url)),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:A1(()=>M1(()=>import("./bluesky-sharing-D-LC_G4e.js"),__vite__mapDeps([33,18,19,11,26]),import.meta.url)),showBackButton:!0},{path:"welcome",lazy:A1(()=>M1(()=>Promise.resolve().then(()=>co0),void 0,import.meta.url)),pageTitle:"Welcome",children:[{path:"",element:z.jsx(qn,{to:"1",replace:!0})},{path:"1",lazy:A1(()=>M1(()=>import("./step-1-Dhctc4sb.js"),__vite__mapDeps([34,26]),import.meta.url))},{path:"2",lazy:A1(()=>M1(()=>import("./step-2-CfG-dkZM.js"),__vite__mapDeps([35,36,13,28]),import.meta.url))},{path:"3",lazy:A1(()=>M1(()=>import("./step-3-D_7ttapi.js"),__vite__mapDeps([37,36,13,28,23,6,8]),import.meta.url))},{path:"*",element:z.jsx(qn,{to:"1",replace:!0})}]},{path:"*",lazy:A1(()=>M1(()=>Promise.resolve().then(()=>Oo0),void 0,import.meta.url))}]}];function Ao0(){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 xp({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return yI(o||"")!==null}function H0({children:e,...t}){return z.jsx(gd,{...t,children:e})}function ho0({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:a,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,l=xp({path:e,activeOnSubpath:n}),u=r!==void 0?r:l,{isMobile:f,setOpenMobile:O}=Vn(),h=()=>{f&&O(!1)};return z.jsx(k3,{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 qo0({children:e,...t}){return z.jsx("span",{...t,children:e})}function mo0({onClick:e,children:t,...o}){const{isMobile:n,setOpenMobile:r}=Vn(),a=()=>{n&&r(!1),e?.()};return z.jsx(k3,{onClick:a,...o,children:t})}H0.Link=ho0;H0.Label=qo0;H0.Button=mo0;function go0({...e}){const{data:t}=ve(),{data:o}=V3(),n=Et(o?.settings,"social_web_enabled")??!1,a=B3().data?.site.url,{data:i=0}=_g(t?.slug||"",n),b=xp({path:"network",activeOnSubpath:!0}),l=xp({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!l;return!t||!t00(t)?null:z.jsx(ec,{...e,children:z.jsx(Ha,{children:z.jsxs(tc,{children:[z.jsx(H0,{children:z.jsxs(H0.Link,{to:"analytics",activeOnSubpath:!0,children:[z.jsx(J8,{}),z.jsx(H0.Label,{children:"Analytics"})]})}),n&&z.jsxs(H0,{children:[z.jsxs(H0.Link,{to:"network",isActive:b||l,children:[z.jsx(Ao0,{}),z.jsx(H0.Label,{children:"Network"})]}),u&&z.jsx(Wd,{children:i})]}),z.jsxs(H0,{className:"relative group/viewsite",children:[z.jsxs(H0.Link,{to:"site",children:[z.jsx(X$,{}),z.jsx(H0.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(ed,{size:16})})]})]})})})}function Wo0({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 Dg="MembersResponseType",vo0=jn({dataType:Dg,path:"/members/"}),gr0=_7({dataType:Dg,path:e=>`/members/${e}/`}),Wr0=Vt({method:"POST",path:({id:e})=>`/members/${e}/commenting/disable`,body:({reason:e,hideComments:t})=>({reason:e,hide_comments:t}),invalidateQueries:{dataType:"CommentsResponseType"}}),vr0=Vt({method:"POST",path:({id:e})=>`/members/${e}/commenting/enable`,body:()=>({}),invalidateQueries:{dataType:"CommentsResponseType"}});function Ro0(){const{data:e}=vo0({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const yo0=()=>H3({select:e=>e.navigation}),wo0=()=>{const{mutateAsync:e}=U3();return Y1({mutationFn:async t=>{await e({navigation:t})}})},Lo0=e=>{const{data:t}=yo0(),{mutateAsync:o}=wo0();return[t?.expanded[e]??!0,async a=>o({expanded:{[e]:a}})]},ko0=yp({name:n2(),route:n2(),color:n2(),icon:n2().optional(),filter:Z20(n2(),n2().nullable())}),xo0=Ld(ko0);function Co0(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function No0({route:e="posts"}){const{data:t}=V3(),o=Dm(),n=p.useMemo(()=>{const r=Et(t?.settings,"shared_views")??"[]";try{const a=JSON.parse(r),i=xo0.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(H0,{children:z.jsxs(H0.Link,{className:"pl-9",to:a,isActive:i,children:[z.jsx(H0.Label,{className:"grow",children:r.name}),z.jsx("span",{className:"size-2 rounded-full shrink-0 mx-0.5",style:{backgroundColor:Co0(r.color)},"data-color":r.color,"aria-hidden":"true"})]})},a)})})}const Xd=e=>{const{data:t}=Ua();return t?.config.labs?.[e]??!1};function Bo0({...e}){const{data:t}=ve(),[o,n]=Lo0("posts"),r=Ro0(),a=Dm(),i=Xd("commentModeration"),b=t&&e00(t),l=t&&JJ(t);return z.jsx(ec,{...e,children:z.jsx(Ha,{children:z.jsxs(tc,{children:[z.jsxs(H0,{children:[z.jsx(e1,{"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(Ju,{size:16,className:`transition-all ${o&&"rotate-[90deg]"}`})}),z.jsxs(H0.Link,{to:a.getRouteUrl("posts"),isActive:a.isRouteActive("posts"),children:[z.jsx(Q8,{className:"opacity-0 sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0 pointer-events-none transition-all"}),z.jsx(H0.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($8,{size:20,className:"!stroke-[1.5px] mt-px"})})]}),z.jsxs(Wo0,{isExpanded:o,id:"posts-submenu",children:[z.jsx(H0,{children:z.jsx(H0.Link,{className:"pl-9",to:"posts?type=draft",isActive:a.isRouteActive("posts",{type:"draft"}),children:z.jsx(H0.Label,{children:"Drafts"})})}),z.jsx(H0,{children:z.jsx(H0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:a.isRouteActive("posts",{type:"scheduled"}),children:z.jsx(H0.Label,{children:"Scheduled"})})}),z.jsx(H0,{children:z.jsx(H0.Link,{className:"pl-9",to:"posts?type=published",isActive:a.isRouteActive("posts",{type:"published"}),children:z.jsx(H0.Label,{children:"Published"})})}),z.jsx(No0,{})]}),z.jsx(H0,{children:z.jsxs(H0.Link,{to:a.getRouteUrl("pages"),isActive:a.isRouteActive("pages"),children:[z.jsx(hZ,{}),z.jsx(H0.Label,{children:"Pages"})]})}),b&&z.jsx(H0,{children:z.jsxs(H0.Link,{to:"tags",isActive:a.isRouteActive(["tags","tag","tag.new"]),children:[z.jsx(tG,{}),z.jsx(H0.Label,{children:"Tags"})]})}),l&&z.jsxs(H0,{children:[z.jsxs(H0.Link,{to:a.getRouteUrl("members"),isActive:a.isRouteActive(["members","member","member.new"]),children:[z.jsx(e9,{}),z.jsx(H0.Label,{children:"Members"})]}),r!=null&&z.jsx(Wd,{children:r})]}),l&&i&&z.jsx(H0,{children:z.jsxs(H0.Link,{to:"comments",activeOnSubpath:!0,children:[z.jsx(TZ,{}),z.jsx(H0.Label,{children:"Comments"})]})})]})})})}const Vf=function(){let t,o;return{promise:new Promise((r,a)=>{t=r,o=a}),resolve:t,reject:o}},Al="https://do.featurebase.app/js/sdk.js",_o0="Feature Request";let Kc=null;function Eo0(){return Kc||(Kc=new Promise((e,t)=>{if(document.querySelector(`script[src="${Al}"]`)){e();return}const n=document.createElement("script");n.src=Al,n.onload=()=>e(),n.onerror=r=>{n.remove(),Kc=null;const a=new Error(`[Featurebase] Failed to load SDK from ${Al}`,{cause:r});console.error(a),t(a)},document.head.appendChild(n)})),Kc}function So0(){const{data:e}=Ua(),{data:t}=H3(),o=Xd("featurebaseFeedback"),[n,r]=p.useState(!1),{organization:a,enabled:i}=e?.config.featurebase??{},b=!!(o&&i),l=t?.nightShift?"dark":"light",{data:u}=TJ({enabled:b&&n}),f=u?.featurebase?.token;p.useEffect(()=>{n&&Eo0().catch(g=>{console.error("[Featurebase] Failed to load SDK:",g)})},[n]);const O=p.useRef(Vf());p.useEffect(()=>{!n||!a||!f||Kc?.then(()=>{window.Featurebase?.("initialize_feedback_widget",{organization:a,theme:l,defaultBoard:_o0,featurebaseJwt:f},g=>{g?(console.error("[Featurebase] Failed to initialize widget:",g),O.current.reject(g),O.current=Vf(),r(!1)):O.current.resolve()})})},[a,l,f,n]);const h=p.useCallback(()=>{b&&r(!0)},[b]);return{openFeedbackWidget:p.useCallback(g=>{b&&(r(!0),O.current.promise.then(()=>{window.postMessage({target:"FeaturebaseWidget",data:{action:"openFeedbackWidget",...g?.board&&{setBoard:g.board}}},"*")}))},[b]),preloadFeedbackWidget:h}}function To0({...e}){const{data:t}=ve(),{data:o}=Ua(),n=Xd("featurebaseFeedback"),{openFeedbackWidget:r,preloadFeedbackWidget:a}=So0();if(!t)return null;const b=o?.config.hostSettings?.billing?.enabled&&Qa(t),l=n&&!N3(t)&&o?.config.featurebase?.enabled;return!b&&!l?null:z.jsx(ec,{...e,children:z.jsx(Ha,{children:z.jsxs(tc,{children:[b&&z.jsx(H0,{children:z.jsxs(H0.Link,{to:"pro",children:[z.jsx(bZ,{}),z.jsx(H0.Label,{children:"Ghost(Pro)"})]})}),l&&z.jsx(H0,{children:z.jsxs(H0.Button,{onClick:r,onMouseEnter:a,onFocus:a,children:[z.jsx(td,{}),z.jsx(H0.Label,{children:"Feedback"})]})})]})})})}function Po0({...e}){const{data:t}=ve(),o=t&&YJ(t);return z.jsx(ec,{...e,children:z.jsx(Ha,{children:z.jsxs(tc,{children:[o&&z.jsx(H0,{children:z.jsxs(H0.Link,{to:"settings",children:[z.jsx(G8,{}),z.jsx(H0.Label,{children:"Settings"})]})}),z.jsx(H0,{children:z.jsxs(H0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(cZ,{}),z.jsx(H0.Label,{children:"Help"})]})})]})})})}const Xo0=""+new URL("ghost-pro-logo-B1sXD_MX.png",import.meta.url).href;function jo0({trialDaysRemaining:e}){return z.jsxs(pd,{variant:"gradient",size:"lg",className:"mx-2 my-5 flex flex-col items-stretch",children:[z.jsx("div",{children:z.jsx("img",{src:Xo0,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(e1,{asChild:!0,children:z.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function Do0(){const{showUpgradeBanner:e,trialDaysRemaining:t}=gg();return z.jsxs(Cm,{className:"px-3 pt-4 justify-between",children:[z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[z.jsx(go0,{}),z.jsx(Bo0,{}),z.jsx(To0,{})]}),z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[e?z.jsx(jo0,{trialDaysRemaining:t}):z.jsx(wt0,{}),z.jsx(Po0,{className:"pb-0"})]})]})}function Io0({...e}){return z.jsxs(ym,{...e,children:[z.jsx(a00,{className:"px-5 pt-6 pb-0"}),z.jsx(Do0,{}),z.jsx(yt0,{className:"p-3 gap-0"})]})}const Li=1.5;function hl({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=xp({path:e,activeOnSubpath:t});return z.jsx(e1,{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 Fo0(){const{isMobile:e}=Vn(),t=jm();return!e||!t?z.jsx(z.Fragment,{}):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(hl,{activeOnSubpath:!0,to:"analytics",children:[z.jsx(J8,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Analytics"})]}),z.jsxs(hl,{activeOnSubpath:!0,to:"posts",children:[z.jsx(Q8,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Posts"})]}),z.jsxs(hl,{activeOnSubpath:!0,to:"members",children:[z.jsx(e9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Members"})]}),z.jsxs(wm,{className:"rounded-full px-8 h-9 hover:bg-transparent",children:[z.jsx(V8,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})})}function Ho0({children:e}){const{data:t}=ve(),o=jm();return t&&N3(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(Rt0,{})})]}):z.jsxs(Rm,{open:!!t&&o,children:[z.jsx(Io0,{}),z.jsxs(Lm,{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(Fo0,{})]})]})}function Uo0(){const{data:e}=ve();return HJ(),FJ(),z.jsx(PJ,{children:e?z.jsxs(Ho0,{children:[z.jsx(yn,{}),z.jsx(Of,{})]}):z.jsxs(z.Fragment,{children:[z.jsx(dz,{}),z.jsx(Of,{})]})})}const Ig=p.createContext(void 0),Rr0=()=>{const e=p.useContext(Ig);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},Vo0=({children:e,value:t})=>{const o=p.useContext(Zz),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(Ig.Provider,{value:r,children:e})},Qo0=[{path:"",errorElement:z.jsx(gp,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([M1(()=>import("./post-analytics-context-BR5b-9nb.js").then(o=>o.p),__vite__mapDeps([38,39]),import.meta.url),M1(()=>import("./post-analytics-BFOeo-LR.js"),__vite__mapDeps([40,41,42,39,38]),import.meta.url)]);return{element:z.jsx(e,{children:z.jsx(t,{})})}},children:[{path:"",lazy:A1(()=>M1(()=>import("./overview-DgkHUK_G.js"),__vite__mapDeps([43,44,45,24,46,47,48,49,50,51,42,38,39,52,3,15,53,54,55,22,23,11,25,26,8,6,1,17,27,12,28,13,56,20,21,5,57,58,59,60]),import.meta.url))},{path:"web",lazy:A1(()=>M1(()=>import("./web-B-GYQeG7.js"),__vite__mapDeps([61,62,25,38,39,53,54,24,55,45,46,22,23,11,26,8,6,1,17,27,12,28,13,15,3,56,48,49,20,21,63,51,42,52,64,5]),import.meta.url))},{path:"growth",lazy:A1(()=>M1(()=>import("./growth-Lbkwu9SJ.js").then(e=>e.g),__vite__mapDeps([57,5,24,54,55,45,58,44,51,42,38,39,52,3,15,59,60]),import.meta.url))},{path:"newsletter",lazy:A1(()=>M1(()=>import("./newsletter-C_C5cbBQ.js"),__vite__mapDeps([65,45,24,66,22,23,11,25,26,8,6,1,17,27,12,28,13,15,3,20,21,44,51,42,38,39,52,46,47,48,49,50,60]),import.meta.url))}]},{path:"tags",children:[{index:!0,lazy:A1(()=>M1(()=>import("./tags-Pad-cSDy.js"),__vite__mapDeps([67,31,68,41,58,17,5]),import.meta.url))},{path:":tagSlug",element:null}]},{path:"comments",lazy:A1(()=>M1(()=>import("./comments-1fqIGh0f.js"),__vite__mapDeps([69,64,25,39,68,41,70,19,13,5]),import.meta.url))},{path:"*",element:z.jsx(gp,{onBackToDashboard:()=>{}})}]}],$o0={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 90 days",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},Zo0=Object.values($o0),Go0=2,yr0={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",unknown:"Unknown",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},wr0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],Lr0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",Tr={PUBLIC:1,FREE:2,PAID:4},kr0=Tr.PUBLIC|Tr.FREE|Tr.PAID,xr0=[{name:"Public visitors",value:"undefined",bit:Tr.PUBLIC},{name:"Free members",value:"free",bit:Tr.FREE},{name:"Paid members",value:"paid",bit:Tr.PAID}],Fg=p.createContext(void 0),Cr0=()=>{const e=p.useContext(Fg);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},Ko0=({children:e})=>{const t=V3(),o=B3(),n=Ua(),r=n.data?.config,a=!!r?.stats,i=fD({enabled:a}),[b,l]=p.useState(Zo0[Go0].value),[u,f]=p.useState(null),O=[n,t,o],h=O.map(x=>x.error).find(Boolean),m=a?i.error:null,g=h||m,W=O.some(x=>x.isLoading),v=a?i.isLoading:!1,y=W||v;if(g)throw g;const L={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return z.jsx(Fg.Provider,{value:{data:r,site:L,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:y,range:b,setRange:l,settings:t.data?.settings||[],selectedNewsletterId:u,setSelectedNewsletterId:f},children:e})},Yo0=[{path:"analytics",children:[{index:!0,lazy:A1(()=>M1(()=>import("./index-voIsrI4j.js"),__vite__mapDeps([71,72,62,25,45,24,15,22,23,11,26,8,6,1,17,27,12,28,13,3,5,42,52,56,48,49,73,74,60,59,39]),import.meta.url))},{path:"web",lazy:A1(()=>M1(()=>import("./index-DR3xU0-B.js"),__vite__mapDeps([75,72,62,25,45,24,15,22,23,11,26,8,6,1,17,27,12,28,13,3,63,46,5,66,76,55,64,73,60,20,21,56,48,49]),import.meta.url))},{path:"growth",lazy:A1(()=>M1(()=>import("./index-CoyIDbjB.js"),__vite__mapDeps([77,72,62,25,45,24,15,22,23,11,26,8,6,1,17,27,12,28,13,3,5,56,48,49,20,21,73,78,58,76,59,55,60,79,50,74]),import.meta.url))},{path:"newsletters",lazy:A1(()=>M1(()=>import("./index-BrYABbTV.js"),__vite__mapDeps([80,72,62,25,45,24,15,22,23,11,26,8,6,1,17,27,12,28,13,3,48,49,5,56,20,21,78,58,81,60]),import.meta.url))}]}],Jo0=[{element:z.jsx($J,{}),children:[{path:"/tags/:tagSlug",Component:dz,handle:{allowInForceUpgrade:!0}},{element:z.jsx(Vo0,{value:{fromAnalytics:!0},children:z.jsx(yn,{})}),children:Qo0[0].children.filter(e=>e.path!=="*")},{element:z.jsx(Ko0,{children:z.jsx(yn,{})}),children:Yo0},{path:"network",loader:()=>UD("/activitypub")},{path:"",element:z.jsx(Lt0,{children:z.jsx(yn,{})}),children:jg},{path:"settings/*",lazy:A1(()=>M1(()=>import("./settings-CpDtcACU.js").then(e=>e.bo),__vite__mapDeps([82,21,81,39,79]),import.meta.url)),handle:{allowInForceUpgrade:!0}},{path:"*",Component:dz,handle:{allowInForceUpgrade:!0}}]}],en0=["http:","https:","mailto:","tel:"];function tn0(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return en0.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 on0({children:e}){const{data:t}=V3(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Et(n,"paid_members_enabled")??!1,newslettersEnabled:Et(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Et(n,"email_track_opens")??!1,emailTrackClicks:Et(n,"email_track_clicks")??!1,membersTrackSources:Et(n,"members_track_sources")??!1,outboundLinkTagging:Et(n,"outbound_link_tagging")??!1,webAnalytics:Et(n,"web_analytics_enabled")??!1}}},[t]);return z.jsx(pL,{appSettings:o,children:e})}const nn0={ghostVersion:"",externalNavigate:e=>{tn0(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)}};Ev.createRoot(document.getElementById("root")).render(z.jsx(p.StrictMode,{children:z.jsx(iL,{...nn0,children:z.jsx(NJ,{prefix:"/",routes:Jo0,children:z.jsx(on0,{children:z.jsx(MK,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:z.jsx(Uo0,{})})})})})}));export{U8 as $,To as A,e1 as B,Ju as C,q3 as D,Qc as E,no0 as F,er0 as G,m2 as H,tr0 as I,rr0 as J,cr0 as K,do0 as L,or0 as M,nr0 as N,LJ as O,Bo as P,oJ as Q,nJ as R,w1 as S,F$ as T,kp as U,ge as V,Or0 as W,cd as X,fr0 as Y,Ar0 as Z,Bm as _,n3 as a,Hp as a$,bK as a0,o9 as a1,n9 as a2,c9 as a3,a9 as a4,r9 as a5,i9 as a6,s9 as a7,h3 as a8,b9 as a9,U0 as aA,Pp as aB,M1 as aC,CA as aD,W1 as aE,OL as aF,DA as aG,Z1 as aH,Ua as aI,B3 as aJ,V3 as aK,fD as aL,D$ as aM,Sn0 as aN,yn as aO,_m as aP,Nn0 as aQ,pm as aR,kJ as aS,Op as aT,Rr0 as aU,Wn0 as aV,Rn0 as aW,kr0 as aX,xr0 as aY,Tr as aZ,$o as a_,bd as aa,LZ as ab,jn as ac,Vt as ad,_7 as ae,vn0 as af,dn0 as ag,y0 as ah,hn0 as ai,Yu as aj,bD as ak,En0 as al,Im as am,Gt as an,J8 as ao,sm as ap,Ah as aq,Pn as ar,y2 as as,H2 as at,O1 as au,qh as av,PP as aw,XP as ax,L0 as ay,s2 as az,Kt as b,XY as b$,fh as b0,Q2 as b1,MX as b2,Ra as b3,ya as b4,dt as b5,fu as b6,Ou as b7,Kp as b8,Xr as b9,gm as bA,sJ as bB,iJ as bC,pJ as bD,tJ as bE,An0 as bF,un0 as bG,am as bH,qd as bI,im as bJ,rd as bK,Jr as bL,Au as bM,V8 as bN,Cn0 as bO,kn as bP,Nm as bQ,cf as bR,On0 as bS,Oa as bT,Tn as bU,Cr0 as bV,an0 as bW,gn0 as bX,qn as bY,hr0 as bZ,PY as b_,Zp as ba,$r as bb,Up as bc,Vp as bd,Y$ as be,Go as bf,Pd as bg,Bd as bh,eZ as bi,dZ as bj,sr0 as bk,Ft0 as bl,Et0 as bm,Xg as bn,zr0 as bo,oc as bp,gZ as bq,lr0 as br,U$ as bs,Uc as bt,Ri as bu,ad as bv,sd as bw,id as bx,rJ as by,Bn0 as bz,Vc as c,td as c$,jY as c0,lm as c1,Hn0 as c2,Un0 as c3,Gm as c4,ur0 as c5,Y8 as c6,pG as c7,w3 as c8,hK as c9,qn0 as cA,$o0 as cB,yZ as cC,af as cD,bZ as cE,Bz as cF,Zo0 as cG,r2 as cH,lK as cI,Ml as cJ,OK as cK,Mr0 as cL,ar0 as cM,br0 as cN,Cp as cO,wr0 as cP,yr0 as cQ,Q8 as cR,mn0 as cS,Lr0 as cT,yn0 as cU,lo0 as cV,vo0 as cW,sZ as cX,gr0 as cY,Wr0 as cZ,vr0 as c_,yp as ca,Hf as cb,Uf as cc,qr0 as cd,mr0 as ce,n2 as cf,$t0 as cg,kn0 as ch,e9 as ci,tG as cj,Re as ck,Nu as cl,_u as cm,_a as cn,Ea as co,od as cp,_Y as cq,EY as cr,$8 as cs,Mm as ct,bm as cu,v$ as cv,wn0 as cw,Ln0 as cx,fn0 as cy,fZ as cz,yi as d,$j as d$,EZ as d0,Lg as d1,Kt0 as d2,ir0 as d3,pr0 as d4,rn0 as d5,wv as d6,OC as d7,n6 as d8,C7 as d9,Kl as dA,Qa as dB,Tn0 as dC,Fm as dD,Pn0 as dE,jn0 as dF,YJ as dG,Hm as dH,Dn0 as dI,C3 as dJ,$A as dK,in0 as dL,UT as dM,c6 as dN,a6 as dO,Fz as dP,RP as dQ,xh as dR,HP as dS,kX as dT,xX as dU,CX as dV,Jh as dW,s7 as dX,i7 as dY,p7 as dZ,jL as d_,Vn0 as da,Gn0 as db,Gb as dc,bn0 as dd,ln0 as de,Iz as df,In0 as dg,cD as dh,Zr as di,ha as dj,Zn0 as dk,U2 as dl,XJ as dm,jJ as dn,DJ as dp,Et as dq,RT as dr,Fn0 as ds,n00 as dt,Yn0 as du,$n0 as dv,Qn0 as dw,K1 as dx,t00 as dy,Xn0 as dz,p0 as e,Mn0 as e0,Zj as e1,k7 as e2,Jp as e3,ca as e4,ve as e5,zn0 as e6,d1 as e7,GR as e8,_n0 as e9,nd as eA,sG as eB,T$ as eC,ZJ as ea,Kn0 as eb,N3 as ec,NA as ed,sn0 as ee,jA as ef,X$ as eg,Z$ as eh,Q$ as ei,nZ as ej,cZ as ek,pZ as el,hZ as em,vZ as en,xZ as eo,NZ as ep,TZ as eq,XZ as er,DZ as es,HZ as et,Z8 as eu,$Z as ev,G8 as ew,KZ as ex,K8 as ey,cG as ez,mp as f,So as g,yo as h,Jn0 as i,z as j,Sg as k,dr0 as l,Nd as m,Sd as n,Hi as o,_d as p,p9 as q,p as r,Cz as s,Da as t,xI as u,Md as v,ld as w,ed as x,q0 as y,Ba as z};
|
|
618
|
+
`)}m.write("payload.value = newResult;"),m.write("return payload;");const L=m.compile();return(x,k)=>L(h,x,k)};let a;const i=Wp,b=!Vm.jitless,u=b&&i00.value,f=t.catchall;let O;e._zod.parse=(h,m)=>{O??(O=n.value);const g=h.value;return i(g)?b&&u&&m?.async===!1&&m.jitless!==!0?(a||(a=r(t.shape)),h=a(h,m),f?rg([],g,h,m,O,e):h):o(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function gf(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=>!Rr(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=>Uo(i,n,Ho())))}),t)}const V10=n0("$ZodUnion",(e,t)=>{V1.init(e,t),q1(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),q1(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),q1(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),q1(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=>yd(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=>gf(l,r,e,a)):gf(b,r,e,a)}}),Q10=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])=>Wf(o,l,u)):Wf(o,a,i)}});function Az(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=Az(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=Az(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 Wf(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),Rr(e))return e;const n=Az(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 $10=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(f=>{f.issues.length&&o.issues.push(...yr(l,f.issues)),o.value[l]=f.value})):(u.issues.length&&o.issues.push(...yr(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=>Uo(u,n,Ho())),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(...yr(i,u.issues)),o.value[b.value]=u.value})):(l.issues.length&&o.issues.push(...yr(i,l.issues)),o.value[b.value]=l.value)}}return a.length?Promise.all(a).then(()=>o):o}}),Z10=n0("$ZodEnum",(e,t)=>{V1.init(e,t);const o=s00(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(r=>p00.has(typeof r)).map(r=>typeof r=="string"?_3(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}}),G10=n0("$ZodTransform",(e,t)=>{V1.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new Um(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 Sr;return o.value=r,o}});function vf(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const K10=n0("$ZodOptional",(e,t)=>{V1.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q1(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${yd(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=>vf(a,o.value)):vf(r,o.value)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),Y10=n0("$ZodNullable",(e,t)=>{V1.init(e,t),q1(e._zod,"optin",()=>t.innerType._zod.optin),q1(e._zod,"optout",()=>t.innerType._zod.optout),q1(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${yd(o.source)}|null)$`):void 0}),q1(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)}),J10=n0("$ZodDefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",q1(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=>Rf(a,t)):Rf(r,t)}});function Rf(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ee0=n0("$ZodPrefault",(e,t)=>{V1.init(e,t),e._zod.optin="optional",q1(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))}),te0=n0("$ZodNonOptional",(e,t)=>{V1.init(e,t),q1(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=>yf(a,e)):yf(r,e)}});function yf(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 oe0=n0("$ZodCatch",(e,t)=>{V1.init(e,t),q1(e._zod,"optin",()=>t.innerType._zod.optin),q1(e._zod,"optout",()=>t.innerType._zod.optout),q1(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=>Uo(i,n,Ho()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(a=>Uo(a,n,Ho()))},input:o.value}),o.issues=[]),o)}}),ne0=n0("$ZodPipe",(e,t)=>{V1.init(e,t),q1(e._zod,"values",()=>t.in._zod.values),q1(e._zod,"optin",()=>t.in._zod.optin),q1(e._zod,"optout",()=>t.out._zod.optout),q1(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=>qi(i,t.in,n)):qi(a,t.in,n)}const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(a=>qi(a,t.out,n)):qi(r,t.out,n)}});function qi(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},o)}const cg=n0("$ZodCodec",(e,t)=>{V1.init(e,t),q1(e._zod,"values",()=>t.in._zod.values),q1(e._zod,"optin",()=>t.in._zod.optin),q1(e._zod,"optout",()=>t.out._zod.optout),q1(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=>mi(i,t,n)):mi(a,t,n)}else{const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(i=>mi(i,t,n)):mi(a,t,n)}}});function mi(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=>gi(e,a,t.out,o)):gi(e,r,t.out,o)}else{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(a=>gi(e,a,t.in,o)):gi(e,r,t.in,o)}}function gi(e,t,o,n){return e.issues.length?(e.aborted=!0,e):o._zod.run({value:t,issues:e.issues},n)}const re0=n0("$ZodReadonly",(e,t)=>{V1.init(e,t),q1(e._zod,"propValues",()=>t.innerType._zod.propValues),q1(e._zod,"values",()=>t.innerType._zod.values),q1(e._zod,"optin",()=>t.innerType._zod.optin),q1(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(wf):wf(r)}});function wf(e){return e.value=Object.freeze(e.value),e}const ce0=n0("$ZodCustom",(e,t)=>{x2.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=>Lf(a,o,n,e));Lf(r,o,n,e)}});function Lf(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(da(r))}}class ae0{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 se0(){return new ae0}const Wi=se0();function ie0(e,t){return new e({type:"string",...D0(t)})}function pe0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...D0(t)})}function kf(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...D0(t)})}function Me0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...D0(t)})}function be0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D0(t)})}function le0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D0(t)})}function ze0(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D0(t)})}function ue0(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...D0(t)})}function de0(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...D0(t)})}function Oe0(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...D0(t)})}function fe0(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...D0(t)})}function Ae0(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...D0(t)})}function he0(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...D0(t)})}function qe0(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...D0(t)})}function me0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...D0(t)})}function ge0(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...D0(t)})}function We0(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...D0(t)})}function ve0(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D0(t)})}function Re0(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D0(t)})}function ye0(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...D0(t)})}function we0(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...D0(t)})}function Le0(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...D0(t)})}function ke0(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...D0(t)})}function xe0(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D0(t)})}function Ce0(e,t){return new e({type:"string",format:"date",check:"string_format",...D0(t)})}function Ne0(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...D0(t)})}function Be0(e,t){return new e({type:"string",format:"duration",check:"string_format",...D0(t)})}function _e0(e,t){return new e({type:"boolean",...D0(t)})}function Ee0(e){return new e({type:"unknown"})}function Se0(e,t){return new e({type:"never",...D0(t)})}function Te0(e,t){return new e({type:"date",...D0(t)})}function Pe0(e,t){return new t10({check:"less_than",...D0(t),value:e,inclusive:!0})}function Xe0(e,t){return new o10({check:"greater_than",...D0(t),value:e,inclusive:!0})}function ag(e,t){return new n10({check:"max_length",...D0(t),maximum:e})}function Rp(e,t){return new r10({check:"min_length",...D0(t),minimum:e})}function sg(e,t){return new c10({check:"length_equals",...D0(t),length:e})}function je0(e,t){return new a10({check:"string_format",format:"regex",...D0(t),pattern:e})}function De0(e){return new s10({check:"string_format",format:"lowercase",...D0(e)})}function Ie0(e){return new i10({check:"string_format",format:"uppercase",...D0(e)})}function Fe0(e,t){return new p10({check:"string_format",format:"includes",...D0(t),includes:e})}function He0(e,t){return new M10({check:"string_format",format:"starts_with",...D0(t),prefix:e})}function Ue0(e,t){return new b10({check:"string_format",format:"ends_with",...D0(t),suffix:e})}function $a(e){return new l10({check:"overwrite",tx:e})}function Ve0(e){return $a(t=>t.normalize(e))}function Qe0(){return $a(e=>e.trim())}function $e0(){return $a(e=>e.toLowerCase())}function Ze0(){return $a(e=>e.toUpperCase())}function Ge0(e,t,o){return new e({type:"array",element:t,...D0(o)})}function Ke0(e,t,o){return new e({type:"custom",check:"custom",fn:t,...D0(o)})}function Ye0(e){const t=Je0(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(da(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(da(r))}},e(o.value,o)));return t}function Je0(e,t){const o=new x2({check:"custom",...D0(t)});return o._zod.check=e,o}function e20(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(m=>typeof m=="string"?m.toLowerCase():m),r=r.map(m=>typeof m=="string"?m.toLowerCase():m));const a=new Set(n),i=new Set(r),b=e.Codec??cg,l=e.Boolean??og,u=e.String??D3,f=new u({type:"string",error:o.error}),O=new l({type:"boolean",error:o.error}),h=new b({type:"pipe",in:f,out:O,transform:((m,g)=>{let W=m;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:((m,g)=>m===!0?n[0]||"true":r[0]||"false"),error:o.error});return h}const t20=n0("ZodISODateTime",(e,t)=>{y10.init(e,t),Q1.init(e,t)});function ig(e){return xe0(t20,e)}const o20=n0("ZodISODate",(e,t)=>{w10.init(e,t),Q1.init(e,t)});function n20(e){return Ce0(o20,e)}const r20=n0("ZodISOTime",(e,t)=>{L10.init(e,t),Q1.init(e,t)});function c20(e){return Ne0(r20,e)}const a20=n0("ZodISODuration",(e,t)=>{k10.init(e,t),Q1.init(e,t)});function s20(e){return Be0(a20,e)}const i20=(e,t)=>{Gm.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>h00(e,o)},flatten:{value:o=>A00(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,fz,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,fz,2)}},isEmpty:{get(){return e.issues.length===0}}})},C2=n0("ZodError",i20,{Parent:Error}),p20=S3(C2),M20=T3(C2),b20=P3(C2),l20=X3(C2),z20=g00(C2),u20=W00(C2),d20=v00(C2),O20=R00(C2),f20=y00(C2),A20=w00(C2),h20=L00(C2),q20=k00(C2),re=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($n(t,{checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(o,n)=>Ko(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>p20(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>b20(e,o,n),e.parseAsync=async(o,n)=>M20(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>l20(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>z20(e,o,n),e.decode=(o,n)=>u20(e,o,n),e.encodeAsync=async(o,n)=>d20(e,o,n),e.decodeAsync=async(o,n)=>O20(e,o,n),e.safeEncode=(o,n)=>f20(e,o,n),e.safeDecode=(o,n)=>A20(e,o,n),e.safeEncodeAsync=async(o,n)=>h20(e,o,n),e.safeDecodeAsync=async(o,n)=>q20(e,o,n),e.refine=(o,n)=>e.check(bt0(o,n)),e.superRefine=o=>e.check(lt0(o)),e.overwrite=o=>e.check($a(o)),e.optional=()=>Cf(e),e.nullable=()=>Nf(e),e.nullish=()=>Cf(Nf(e)),e.nonoptional=o=>rt0(e,o),e.array=()=>Ld(e),e.or=o=>U20([e,o]),e.and=o=>Q20(e,o),e.transform=o=>Bf(e,Y20(o)),e.default=o=>tt0(e,o),e.prefault=o=>nt0(e,o),e.catch=o=>at0(e,o),e.pipe=o=>Bf(e,o),e.readonly=()=>pt0(e),e.describe=o=>{const n=e.clone();return Wi.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return Wi.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Wi.get(e);const n=e.clone();return Wi.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),pg=n0("_ZodString",(e,t)=>{D3.init(e,t),re.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(je0(...n)),e.includes=(...n)=>e.check(Fe0(...n)),e.startsWith=(...n)=>e.check(He0(...n)),e.endsWith=(...n)=>e.check(Ue0(...n)),e.min=(...n)=>e.check(Rp(...n)),e.max=(...n)=>e.check(ag(...n)),e.length=(...n)=>e.check(sg(...n)),e.nonempty=(...n)=>e.check(Rp(1,...n)),e.lowercase=n=>e.check(De0(n)),e.uppercase=n=>e.check(Ie0(n)),e.trim=()=>e.check(Qe0()),e.normalize=(...n)=>e.check(Ve0(...n)),e.toLowerCase=()=>e.check($e0()),e.toUpperCase=()=>e.check(Ze0())}),Mg=n0("ZodString",(e,t)=>{D3.init(e,t),pg.init(e,t),e.email=o=>e.check(pe0(m20,o)),e.url=o=>e.check(ue0(g20,o)),e.jwt=o=>e.check(ke0(T20,o)),e.emoji=o=>e.check(de0(W20,o)),e.guid=o=>e.check(kf(xf,o)),e.uuid=o=>e.check(Me0(vi,o)),e.uuidv4=o=>e.check(be0(vi,o)),e.uuidv6=o=>e.check(le0(vi,o)),e.uuidv7=o=>e.check(ze0(vi,o)),e.nanoid=o=>e.check(Oe0(v20,o)),e.guid=o=>e.check(kf(xf,o)),e.cuid=o=>e.check(fe0(R20,o)),e.cuid2=o=>e.check(Ae0(y20,o)),e.ulid=o=>e.check(he0(w20,o)),e.base64=o=>e.check(ye0(_20,o)),e.base64url=o=>e.check(we0(E20,o)),e.xid=o=>e.check(qe0(L20,o)),e.ksuid=o=>e.check(me0(k20,o)),e.ipv4=o=>e.check(ge0(x20,o)),e.ipv6=o=>e.check(We0(C20,o)),e.cidrv4=o=>e.check(ve0(N20,o)),e.cidrv6=o=>e.check(Re0(B20,o)),e.e164=o=>e.check(Le0(S20,o)),e.datetime=o=>e.check(ig(o)),e.date=o=>e.check(n20(o)),e.time=o=>e.check(c20(o)),e.duration=o=>e.check(s20(o))});function n2(e){return ie0(Mg,e)}const Q1=n0("ZodStringFormat",(e,t)=>{I1.init(e,t),pg.init(e,t)}),m20=n0("ZodEmail",(e,t)=>{f10.init(e,t),Q1.init(e,t)}),xf=n0("ZodGUID",(e,t)=>{d10.init(e,t),Q1.init(e,t)}),vi=n0("ZodUUID",(e,t)=>{O10.init(e,t),Q1.init(e,t)}),g20=n0("ZodURL",(e,t)=>{A10.init(e,t),Q1.init(e,t)}),W20=n0("ZodEmoji",(e,t)=>{h10.init(e,t),Q1.init(e,t)}),v20=n0("ZodNanoID",(e,t)=>{q10.init(e,t),Q1.init(e,t)}),R20=n0("ZodCUID",(e,t)=>{m10.init(e,t),Q1.init(e,t)}),y20=n0("ZodCUID2",(e,t)=>{g10.init(e,t),Q1.init(e,t)}),w20=n0("ZodULID",(e,t)=>{W10.init(e,t),Q1.init(e,t)}),L20=n0("ZodXID",(e,t)=>{v10.init(e,t),Q1.init(e,t)}),k20=n0("ZodKSUID",(e,t)=>{R10.init(e,t),Q1.init(e,t)}),x20=n0("ZodIPv4",(e,t)=>{x10.init(e,t),Q1.init(e,t)}),C20=n0("ZodIPv6",(e,t)=>{C10.init(e,t),Q1.init(e,t)}),N20=n0("ZodCIDRv4",(e,t)=>{N10.init(e,t),Q1.init(e,t)}),B20=n0("ZodCIDRv6",(e,t)=>{B10.init(e,t),Q1.init(e,t)}),_20=n0("ZodBase64",(e,t)=>{_10.init(e,t),Q1.init(e,t)}),E20=n0("ZodBase64URL",(e,t)=>{S10.init(e,t),Q1.init(e,t)}),S20=n0("ZodE164",(e,t)=>{T10.init(e,t),Q1.init(e,t)}),T20=n0("ZodJWT",(e,t)=>{X10.init(e,t),Q1.init(e,t)}),bg=n0("ZodBoolean",(e,t)=>{og.init(e,t),re.init(e,t)});function hz(e){return _e0(bg,e)}const P20=n0("ZodUnknown",(e,t)=>{j10.init(e,t),re.init(e,t)});function qz(){return Ee0(P20)}const X20=n0("ZodNever",(e,t)=>{D10.init(e,t),re.init(e,t)});function j20(e){return Se0(X20,e)}const D20=n0("ZodDate",(e,t)=>{I10.init(e,t),re.init(e,t),e.min=(n,r)=>e.check(Xe0(n,r)),e.max=(n,r)=>e.check(Pe0(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 I20(e){return Te0(D20,e)}const F20=n0("ZodArray",(e,t)=>{F10.init(e,t),re.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(Rp(o,n)),e.nonempty=o=>e.check(Rp(1,o)),e.max=(o,n)=>e.check(ag(o,n)),e.length=(o,n)=>e.check(sg(o,n)),e.unwrap=()=>e.element});function Ld(e,t){return Ge0(F20,e,t)}const lg=n0("ZodObject",(e,t)=>{U10.init(e,t),re.init(e,t),q1(e,"shape",()=>t.shape),e.keyof=()=>G20(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:qz()}),e.loose=()=>e.clone({...e._zod.def,catchall:qz()}),e.strict=()=>e.clone({...e._zod.def,catchall:j20()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>z00(e,o),e.safeExtend=o=>u00(e,o),e.merge=o=>d00(e,o),e.pick=o=>b00(e,o),e.omit=o=>l00(e,o),e.partial=(...o)=>O00(zg,e,o[0]),e.required=(...o)=>f00(ug,e,o[0])});function yp(e,t){const o={type:"object",shape:e??{},...D0(t)};return new lg(o)}function I3(e,t){return new lg({type:"object",shape:e,catchall:qz(),...D0(t)})}const H20=n0("ZodUnion",(e,t)=>{V10.init(e,t),re.init(e,t),e.options=t.options});function U20(e,t){return new H20({type:"union",options:e,...D0(t)})}const V20=n0("ZodIntersection",(e,t)=>{Q10.init(e,t),re.init(e,t)});function Q20(e,t){return new V20({type:"intersection",left:e,right:t})}const $20=n0("ZodRecord",(e,t)=>{$10.init(e,t),re.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Z20(e,t,o){return new $20({type:"record",keyType:e,valueType:t,...D0(o)})}const mz=n0("ZodEnum",(e,t)=>{Z10.init(e,t),re.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 mz({...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 mz({...t,checks:[],...D0(r),entries:a})}});function G20(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new mz({type:"enum",entries:o,...D0(t)})}const K20=n0("ZodTransform",(e,t)=>{G10.init(e,t),re.init(e,t),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new Um(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(da(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(da(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(a=>(o.value=a,o)):(o.value=r,o)}});function Y20(e){return new K20({type:"transform",transform:e})}const zg=n0("ZodOptional",(e,t)=>{K10.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Cf(e){return new zg({type:"optional",innerType:e})}const J20=n0("ZodNullable",(e,t)=>{Y10.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Nf(e){return new J20({type:"nullable",innerType:e})}const et0=n0("ZodDefault",(e,t)=>{J10.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tt0(e,t){return new et0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$m(t)}})}const ot0=n0("ZodPrefault",(e,t)=>{ee0.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function nt0(e,t){return new ot0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$m(t)}})}const ug=n0("ZodNonOptional",(e,t)=>{te0.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rt0(e,t){return new ug({type:"nonoptional",innerType:e,...D0(t)})}const ct0=n0("ZodCatch",(e,t)=>{oe0.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function at0(e,t){return new ct0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const dg=n0("ZodPipe",(e,t)=>{ne0.init(e,t),re.init(e,t),e.in=t.in,e.out=t.out});function Bf(e,t){return new dg({type:"pipe",in:e,out:t})}const Og=n0("ZodCodec",(e,t)=>{dg.init(e,t),cg.init(e,t)});function st0(e,t,o){return new Og({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}const it0=n0("ZodReadonly",(e,t)=>{re0.init(e,t),re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pt0(e){return new it0({type:"readonly",innerType:e})}const Mt0=n0("ZodCustom",(e,t)=>{ce0.init(e,t),re.init(e,t)});function bt0(e,t={}){return Ke0(Mt0,e,t)}function lt0(e){return Ye0(e)}const zt0=(...e)=>e20({Codec:Og,Boolean:bg,String:Mg},...e),fg=st0(ig({offset:!0}),I20(),{decode:e=>new Date(e),encode:e=>e.toISOString()}),ut0=I3({slug:n2(),title:n2(),custom_excerpt:n2(),url:n2().url(),published_at:fg,featured:zt0(),feature_image:n2().url().optional(),html:n2().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})),dt0=yp({posts:Ld(ut0).default([]),changelogUrl:n2().url().default("https://ghost.org/changelog")}).transform(e=>({entries:e.posts,changelogUrl:e.changelogUrl})),F3=()=>R2({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 dt0.parse(t)},staleTime:1/0});function _f(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ag(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&&(_f(r)&&_f(a)?o[n]=Ag(a,r):o[n]=r)}return o}const Ot0=I3({lastSeenDate:fg.optional().catch(void 0)}),Ef={expanded:{posts:!0},menu:{visible:!0}},ft0=I3({expanded:yp({posts:hz()}),menu:yp({visible:hz()})}),gz=I3({whatsNew:Ot0.optional().catch(void 0),nightShift:hz().optional(),navigation:ft0.default(Ef).catch(Ef)}),hg=e=>["userPreferences",e?.id,e?.accessibility];function H3(e){const{data:t}=ve();return R2({...e,queryKey:hg(t),queryFn:()=>{if(!t)throw new Error("User not loaded");const o=t.accessibility||"{}",n=JSON.parse(o);return gz.parse(n)},enabled:!!t,staleTime:1/0,cacheTime:0})}const U3=()=>{const e=d1(),{data:t}=ve(),{mutateAsync:o}=Fm();return Y1({mutationFn:async n=>{if(!t)throw new Error("User is not loaded");const r=e.getQueryData(hg(t))??gz.parse({}),a=Ag(r,n),i=gz.encode(a);await o({...t,accessibility:JSON.stringify(i)})}})};function At0(){return{lastSeenDate:new Date}}const ht0=(e,t)=>["whatsNew",e?.whatsNew?.lastSeenDate?.toISOString(),t?.publishedAt.toISOString()],qg=()=>{const{data:e,isSuccess:t}=H3(),{data:o,isSuccess:n}=F3(),{mutateAsync:r}=U3(),a=!!e?.whatsNew?.lastSeenDate;p.useEffect(()=>{!a&&t&&r({whatsNew:At0()})},[a,t,r]);const i=o?.entries[0];return R2({queryKey:ht0(e,i),queryFn:()=>{if(!i)return{hasNew:!1};const b=e.whatsNew.lastSeenDate;return{hasNew:i.publishedAt>b}},enabled:n&&a,staleTime:1/0,cacheTime:0})},mg=()=>{const{data:e}=F3(),{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 qt0(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})}function mt0({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:qt0(e.publishedAt)})]})]})}function gt0({open:e,onOpenChange:t}){const{data:o}=F3(),{mutate:n}=mg();return p.useEffect(()=>{e&&n()},[e,n]),z.jsx(q3,{open:e,onOpenChange:t,children:z.jsxs(Da,{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(Md,{children:z.jsx(ld,{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(mt0,{entry:r},r.slug))}),z.jsxs(bd,{className:"flex-row justify-between sm:justify-between gap-3",children:[z.jsx(e1,{asChild:!0,variant:"outline",children:z.jsx("a",{href:`${o.changelogUrl}#/portal/signup`,rel:"noopener noreferrer",target:"_blank",children:"Turn on notifications"})}),z.jsx(e1,{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(mp,{size:"lg"})})]})})}function gg(){const e=Xm(),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 Wt0({children:e,...t}){return z.jsx("span",{className:"flex-1",...t,children:e})}const Xe=({children:e,...t})=>z.jsx(im,{className:"cursor-pointer text-base",asChild:!0,...t,children:e});Xe.Label=Wt0;function wp(e){const t=ve();return z.jsxs(ad,{...e,children:[t.data?.profile_image&&z.jsx(sd,{src:t.data?.profile_image}),z.jsx(id,{className:"text-foreground-muted hover:text-foreground",children:z.jsx(rd,{})})]})}function Wg({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 flex-1 min-w-0",children:[z.jsx("span",{className:"text-base font-semibold text-foreground truncate",children:e}),z.jsx("span",{className:"text-xs text-foreground-muted -mt-px truncate",children:t})]})]})})}function vg(){const e=ve();return z.jsx(Xe,{children:z.jsxs(Ba,{to:`/settings/staff/${e.data?.slug}`,children:[z.jsx(rd,{}),z.jsx(Xe.Label,{children:"Your profile"})]})})}function Rg(){const{data:e}=H3(),{mutateAsync:t,isLoading:o}=U3(),n=r=>{t({nightShift:r})};return z.jsxs(Xe,{asChild:!1,onSelect:r=>{r.preventDefault(),n(!e?.nightShift)},children:[z.jsx(XZ,{}),z.jsx(Xe.Label,{className:"flex-1",children:"Dark mode"}),z.jsx(bm,{size:"sm",checked:e?.nightShift??!1,disabled:o,onCheckedChange:n,onClick:r=>r.stopPropagation(),tabIndex:-1})]})}function yg(){const e=()=>{fetch("/ghost/api/admin/session",{method:"DELETE"}).then(()=>{window.location.href="/ghost"}).catch(t=>{console.error(t)})};return z.jsxs(Xe,{asChild:!1,onSelect:e,children:[z.jsx(xZ,{}),z.jsx(Xe.Label,{children:"Sign out"})]})}function vt0(e){const t=ve(),{data:o}=qg(),{showUpgradeBanner:n}=gg();return z.jsxs(am,{...e,children:[z.jsx(sm,{asChild:!0,className:"focus-visible:ring-0",children:z.jsxs(k3,{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(wp,{}),o?.hasNew&&z.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:z.jsx(df,{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(nZ,{className:"ml-auto size-4 text-grey-700","data-test-nav":"arrow-down"})]})}),z.jsxs(qd,{align:"start",sideOffset:10,className:`w-[var(--radix-dropdown-menu-trigger-width)] ${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(Wg,{name:t.data?.name,email:t.data?.email,children:z.jsx(wp,{})}),z.jsx(kn,{}),z.jsxs(Xe,{"data-test-nav":"whatsnew",asChild:!1,onSelect:()=>{e.onOpenWhatsNew?.()},children:[z.jsx(K8,{}),z.jsx(Xe.Label,{children:"What’s new?"}),o?.hasNew&&z.jsx("div",{className:"flex-1 flex justify-end",children:z.jsx(df,{variant:"success",size:"sm",label:"New updates available","data-test-whats-new-menu-badge":!0})})]}),z.jsx(vg,{}),z.jsx(kn,{}),z.jsx(Xe,{children:z.jsxs("a",{href:"https://ghost.org/resources?utm_source=admin&utm_campaign=resources",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(Z$,{}),z.jsx(Xe.Label,{children:"Resources & guides"})]})}),z.jsx(Rg,{}),z.jsx(kn,{}),z.jsx(yg,{})]})]})}function Rt0(){const e=ve(),o=B3().data?.site.url??"";return z.jsxs(am,{children:[z.jsx(sm,{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(wp,{className:"w-11 h-11"})})}),z.jsxs(qd,{align:"start",side:"top",sideOffset:10,className:"w-[var(--radix-dropdown-menu-trigger-width)] mb-2",children:[z.jsx(Wg,{name:e.data?.name,email:e.data?.email,children:z.jsx(wp,{})}),z.jsx(kn,{}),z.jsx(Xe,{children:z.jsxs(Ba,{to:"/",children:[z.jsx(fZ,{}),z.jsx(Xe.Label,{children:"Posts"})]})}),z.jsx(Xe,{children:z.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[z.jsx(ed,{}),z.jsx(Xe.Label,{children:"View site"})]})}),z.jsx(kn,{}),z.jsx(vg,{}),z.jsx(Rg,{}),z.jsx(kn,{}),z.jsx(yg,{})]})]})}function yt0({...e}){const[t,o]=p.useState(!1);return z.jsxs(z.Fragment,{children:[z.jsx(xm,{...e,children:z.jsx(ec,{children:z.jsx(tc,{children:z.jsx(gd,{children:z.jsx(vt0,{onOpenWhatsNew:()=>o(!0)})})})})}),z.jsx(gt0,{open:t,onOpenChange:o})]})}function wt0(){const{data:e}=qg(),{data:t}=F3(),{mutate:o}=mg(),[n,r]=p.useState(!1);if(n||!e?.hasNew)return null;const a=t?.entries[0];if(!a)return null;const i=()=>{r(!0),o()},b=()=>{o()};return z.jsx(pd,{"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(K8,{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 Lp="SettingsResponseType",V3=jn({dataType:Lp,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,transistor"}}),Vn0=Vt({method:"PUT",path:()=>"/settings/",body:e=>({settings:e.map(({key:t,value:o})=>({key:t,value:o}))}),updateQueries:{dataType:Lp,emberUpdateType:"createOrUpdate",update:e=>({...e,settings:e.settings})},invalidateQueries:{filters:{predicate(e){return e.queryKey[0]!==Lp}}}}),Qn0=Vt({method:"DELETE",path:()=>"/settings/stripe/connect/",invalidateQueries:{dataType:Lp}}),$n0=Vt({method:"POST",path:()=>"/slack/test/"});function Zn0(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 Gn0(e,t){return t.map(o=>{var n;return(n=e?.find(r=>r.key===o))==null?void 0:n.value})}function Et(e,t){if(!e)return null;const o=e.find(n=>n.key===t);return o?.value||null}function Kn0(e,t){if(!e)return;const o=e.find(n=>n.key===t);return o?.is_read_only||!1}function Yn0(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}const kd=[],wg=p.createContext(void 0),Lt0=({children:e})=>{const t=Re(),[o,n]=p.useState(()=>{const i=localStorage.getItem("featureFlags");return i?JSON.parse(i):kt0()});p.useEffect(()=>{const i=xt0(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:kd};return z.jsx(wg.Provider,{value:a,children:e})},kt0=()=>kd.reduce((e,t)=>({...e,[t]:!1}),{}),xt0=e=>{const t=new URLSearchParams(e),o={};return kd.forEach(n=>{const r=t.get(n);r==="ON"?o[n]=!0:r==="OFF"&&(o[n]=!1)}),o},Ct0=()=>{const e=p.useContext(wg);if(e===void 0)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return e};function Q3(){const t=yu().find(o=>o.handle==="activitypub-basepath")?.pathname??"";return t.endsWith("/")?t.slice(0,-1):t}function Kt(){const e=_m(),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 Lg=({className:e,onClick:t})=>{const o=Kt(),{previousPath:n}=n3();return z.jsx(e1,{className:q0("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(D$,{size:24,strokeWidth:1.25})})},Nt0=()=>{const e=Re(),t=St(jg,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 kg(){const e=yu(),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 Bt0=({title:e,backIcon:t})=>t?z.jsx(Lg,{className:"-ml-2"}):z.jsx(Nm,{className:"max-md:text-[2.4rem]",children:e}),Sf=({onToggleMobileSidebar:e})=>z.jsx(e1,{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(NZ,{className:"!size-5"})}),_t0=({onToggleMobileSidebar:e,showBorder:t=!0})=>{const{canGoBack:o}=n3(),n=kg(),r=BJ(),a=Nt0();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(Lg,{className:"ml-6 max-md:ml-[10px]"})}),!b&&z.jsx(Sf,{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(Bt0,{backIcon:b,title:a?.pageTitle||""}),z.jsx(Sf,{onToggleMobileSidebar:e})]})})})};function So(e){if(!e.preferredUsername||!e.id)return"@unknown@unknown";try{return`@${e.preferredUsername}@${new URL(e.id).hostname.replace(/^www\./,"")}`}catch{return"@unknown@unknown"}}var Wz=(e=>(e[e.Note=0]="Note",e[e.Article=1]="Article",e[e.Tombstone=2]="Tombstone",e))(Wz||{});const Et0=e=>typeof e=="object"&&e!==null&&"statusCode"in e&&"message"in e&&typeof e.statusCode=="number"&&typeof e.message=="string";class St0{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 xg="pending-";function Cg(){return`${xg}${crypto.randomUUID()}`}function Jn0(e){return e.startsWith(xg)}function Tt0(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 Pt0(e){return e.replace(/\n/g,"<br />")}function oc(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===Wz.Article?r="Article":e.type===Wz.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 zl;async function n1(){return zl||(zl=(await(await fetch("/ghost/api/admin/site/")).json()).site.url),zl}function r1(e,t){return new St0(new URL(t),new URL("/ghost/api/admin/identities/",window.location.origin),e)}function De(e="Rate limit exceeded",t="You've made too many requests. Please try again later."){ge.error(e,{description:t})}function $3(e="Action failed",t="This user has restricted who can interact with their account."){ge.error(e,{description:t})}const M0={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 vz(e,t,o){const n=[M0.feed,M0.inbox,M0.discoveryFeed,M0.postsLikedByAccount,M0.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===M0.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:M0.postsLikedByAccount}))}function Ng(e,t,o,n){const r=[M0.feed,M0.inbox,M0.discoveryFeed,M0.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(f=>f.type!=="Announce"&&f.actor?.preferredUsername===a?{...f,actor:{...f.actor,followedByMe:n}}:f.type==="Announce"&&typeof f.object.attributedTo=="object"&&f.object.attributedTo&&!Array.isArray(f.object.attributedTo)&&"preferredUsername"in f.object.attributedTo&&f.object.attributedTo.preferredUsername===a?{...f,object:{...f.object,attributedTo:{...f.object.attributedTo,followedByMe:n}}}:f)}))});const i=M0.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 Bg(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 Rz(e,t,o){const n=M0.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(M0.account("index"),r=>r&&{...r,likedCount:Math.max(0,r.likedCount+(o?1:-1))})}function yz(e,t,o,n){const r=M0.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 wz(e,t,o,n){const r=M0.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 Lz(e,t,o,n){const r=M0.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 Tf(e,t,o){const n=[M0.feed,M0.inbox,M0.discoveryFeed,M0.profilePosts("index"),M0.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 Pf(e,t,o){const n=M0.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 er0(e){return $2({queryKey:M0.blockedAccounts(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await n1();return r1(e,o).getBlockedAccounts(t)},getNextPageParam(t){return t.next}})}function tr0(e){return $2({queryKey:M0.blockedDomains(e),refetchOnMount:"always",async queryFn({pageParam:t}){const o=await n1();return r1(e,o).getBlockedDomains(t)},getNextPageParam(t){return t.next}})}function Xt0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).like(o)},onMutate:o=>{vz(t,o,!0),Rz(t,o,!0),yz(t,e,o,!0)},onError(o,n){vz(t,n,!1),Rz(t,n,!1),yz(t,e,n,!1),o.statusCode===403&&$3(),o.statusCode===429&&De()}})}function jt0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).unlike(o)},onMutate:o=>{vz(t,o,!1),Rz(t,o,!1),yz(t,e,o,!1)},onError(o){o.statusCode===429&&De()}})}function or0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).blockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(M0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!0,followedByMe:!1,followsMe:!1})},onError(o){o.statusCode===429&&De()}})}function nr0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).unblockDomain(new URL(o.url))},onMutate:o=>{o.handle&&t.setQueryData(M0.account(o.handle),n=>n&&{...n,domainBlockedByMe:!1})},onError(o){o.statusCode===429&&De()}})}function rr0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).block(new URL(o.apId))},onMutate:o=>{t.setQueryData(M0.account(o.handle),n=>n&&{...n,blockedByMe:!0,followedByMe:!1,followsMe:!1}),t.invalidateQueries({queryKey:M0.feed}),t.invalidateQueries({queryKey:M0.inbox}),t.invalidateQueries({queryKey:M0.discoveryFeed})},onError(o){o.statusCode===429&&De()}})}function cr0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).unblock(new URL(o.apId))},onMutate:o=>{t.setQueryData(M0.account(o.handle),n=>n&&{...n,blockedByMe:!1})},onError(o){o.statusCode===429&&De()}})}function kz(e,t,o){const n=[M0.feed,M0.inbox,M0.discoveryFeed,M0.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 xz(e,t,o){const n=M0.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 Dt0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).repost(o)},onMutate:o=>{kz(t,o,!0),xz(t,o,!0),wz(t,e,o,!0)},onError(o,n){kz(t,n,!1),xz(t,n,!1),wz(t,e,n,!1),o.statusCode===403&&$3(),o.statusCode===429&&De()}})}function It0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).derepost(o)},onMutate:o=>{kz(t,o,!1),xz(t,o,!1),wz(t,e,o,!1)},onError(o){o.statusCode===429&&De()}})}function Ft0(e){return R2({queryKey:M0.user(e),async queryFn(){const t=await n1();return r1(e,t).getUser()}})}function xd(e,t,o){const n=d1();return Y1({async mutationFn(r){const a=await n1();return r1(e,a).unfollow(r)},onSuccess(r,a){const i=M0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!1,followerCount:h.followerCount-1<0?0:h.followerCount-1});const b=M0.accountFollows(a,"followers");n.setQueryData(b,h=>{if(!h?.pages?.[0])return h;const m=n.getQueryData(M0.account("index"));return m?{...h,pages:h.pages.map(g=>({...g,accounts:g.accounts.filter(W=>W.name!==m.name)}))}:h});const l=M0.account("index");n.setQueryData(l,h=>h&&{...h,followingCount:h.followingCount-1});const f=M0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,h=>h?.pages?{...h,pages:h.pages.map(m=>({...m,accounts:m.accounts.filter(g=>g.handle!==a)}))}:h):n.invalidateQueries({queryKey:f}),Bg(n,a,!1),n.setQueryData(M0.exploreProfiles(e),h=>{if(!h)return h;const m=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,L])=>{const x=L.sites.map(k=>k.handle===a?{...k,followedByMe:!1,followerCount:Math.max(0,k.followerCount-1)}:k);return v[y]={...L,sites:x},v},{});return{...g,results:W}});return{...h,pages:m}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(m=>m.handle===a?{...m,followedByMe:!1,followerCount:Math.max(0,m.followerCount-1)}:m)),Ng(n,e,a,!1),t()},onError:r=>{r.statusCode===429&&De(),o()}})}function Cd(e,t,o){const n=d1();return Y1({async mutationFn(r){const a=await n1();return r1(e,a).follow(r)},onSuccess(r,a){const i=M0.account(a==="me"?"index":a);n.setQueryData(i,h=>h&&{...h,followedByMe:!0,followerCount:h.followerCount+1});const b=M0.account("index");n.setQueryData(b,h=>h&&{...h,followingCount:h.followingCount+1});const l=M0.accountFollows(a,"followers"),f=M0.accountFollows("me","following");n.getQueryData(f)?n.setQueryData(f,h=>{if(!h?.pages?.[0])return h;const m=n.getQueryData(M0.account(a==="me"?"index":a));if(!m)return h;const g={id:m.id,name:m.name,handle:m.handle,avatarUrl:m.avatarUrl,blockedByMe:m.blockedByMe,domainBlockedByMe:m.domainBlockedByMe,isFollowing:!0};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}):n.invalidateQueries({queryKey:f}),Bg(n,a,!0),n.setQueryData(M0.exploreProfiles(e),h=>{if(!h)return h;const m=h.pages.map(g=>{const W=Object.entries(g.results).reduce((v,[y,L])=>{const x=L.sites.map(k=>k.handle===a?{...k,followedByMe:!0,followerCount:k.followerCount+1}:k);return v[y]={...L,sites:x},v},{});return{...g,results:W}});return{...h,pages:m}}),n.setQueriesData({queryKey:["suggested_profiles"],exact:!1},h=>h&&h.map(m=>m.handle===a?{...m,followedByMe:!0,followerCount:m.followerCount+1}:m)),n.setQueryData(l,h=>{if(!h?.pages?.[0])return h;const m=n.getQueryData(M0.account("index"));if(!m)return h;const g={id:m.url,type:"Person",preferredUsername:"index",name:m.name,url:m.url,handle:`index@${new URL(m.url).hostname}`,icon:{type:"Image",url:m.avatarUrl},isFollowing:!1};return{...h,pages:[{...h.pages[0],accounts:[g,...h.pages[0].accounts]},...h.pages.slice(1)]}}),Ng(n,e,a,!0),t()},onError(r){o(),r.statusCode===429&&De(),r.statusCode===403&&$3()}})}function Ht0(e,t){const o=d1(),n=M0.searchResults(t);return{searchQuery:R2({queryKey:n,enabled:t.length>0,refetchOnMount:"always",async queryFn(){const i=await n1();return r1(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 ul(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 Po(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 dl(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 Ut0(e,t){const o=d1();return Y1({async mutationFn({inReplyTo:n,content:r,imageUrl:a,altText:i}){const b=await n1(),l=r1(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=Cg();return Tf(o,n,1),Pf(o,n,1),Lz(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:M0.replyChain(r.inReplyTo)})},onError(n,r){console.error(n),Tf(o,r.inReplyTo,-1),Pf(o,r.inReplyTo,-1),Lz(o,e,r.inReplyTo,-1),n.statusCode===403&&$3(),n.statusCode===429&&De(),ge.error("An error occurred while sending your reply.")}})}function Vt0(e,t){const o=d1(),n=M0.feed,r=M0.outbox(e),a=M0.profilePosts("index");return Y1({async mutationFn({content:i,imageUrl:b,altText:l}){const u=await n1(),f=r1(e,u),O=b?{url:b,altText:l}:void 0;return f.note(i,O)},onMutate:({content:i,imageUrl:b})=>{if(!t)throw new Error("Cannot create note without actor props");const l=Pt0(i),u=Cg(),f=Tt0(t,u,l,b);return ul(o,n,"posts",f),ul(o,r,"data",f),ul(o,a,"posts",f),{id:u}},onSuccess:(i,b,l)=>{if(i.id===void 0)throw new Error("Post returned from API has no id");const u=oc(i);Po(o,n,"posts",l?.id??"",()=>u),Po(o,r,"data",l?.id??"",()=>u),Po(o,a,"posts",l?.id??"",()=>u)},onError(i,b,l){console.error(i),dl(o,n,"posts",l?.id??""),dl(o,r,"data",l?.id??""),dl(o,a,"posts",l?.id??""),i.statusCode===429&&De(),ge.error("An error occurred while posting your note.")}})}function Nd(e,t,o){const n=o?.enabled!==!1;return R2({queryKey:M0.account(t==="me"?"index":t),enabled:n,async queryFn(){const r=await n1();return r1(e,r).getAccount(t)}})}function ar0(e,t){const o=d1();return $2({queryKey:M0.accountFollows(e,t),async queryFn({pageParam:n}){const r=await n1(),i=await r1("index",r).getAccountFollows(e,t,n);return i.accounts&&i.accounts.forEach(b=>{o.setQueryData(M0.account(b.handle),b)}),i},getNextPageParam(n){return n.next}})}function sr0(e){const t=M0.feed,o=d1();return{feedQuery:$2({queryKey:t,enabled:e.enabled,staleTime:60*1e3,async queryFn({pageParam:a}){const i=await n1();return r1("index",i).getFeed(a).then(l=>({posts:l.posts.map(oc),next:l.next}))},getNextPageParam(a){return a.next}}),updateFeedActivity:(a,i)=>{Po(o,t,"posts",a,b=>({...b,...i}))}}}function ir0(e){const t=M0.inbox,o=d1();return{inboxQuery:$2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await n1();return r1("index",i).getInbox(a).then(l=>({posts:l.posts.map(oc),next:l.next}))},getNextPageParam(a){return a.next}}),updateInboxActivity:(a,i)=>{Po(o,t,"posts",a,b=>({...b,...i}))}}}function pr0(e){const t=[...M0.discoveryFeed,e.topic],o=d1();return{discoveryFeedQuery:$2({queryKey:t,enabled:e.enabled,staleTime:20*1e3,async queryFn({pageParam:a}){const i=await n1();return r1("index",i).getDiscoveryFeed(e.topic,a).then(l=>({posts:l.posts.map(oc),next:l.next}))},getNextPageParam(a){return a.next}}),updateDiscoveryFeedActivity:(a,i)=>{Po(o,t,"posts",a,b=>({...b,...i}))}}}function Mr0(e,t){const o=M0.profilePosts(e==="me"?"index":e),n=d1();return{postsByAccountQuery:$2({queryKey:o,enabled:t.enabled,async queryFn({pageParam:i}){const b=await n1();return r1("index",b).getPostsByAccount(e,i).then(u=>({posts:u.posts.map(oc),next:u.next})).catch(()=>({posts:[],next:null}))},getNextPageParam(i){return i.next}}),updatePostsByAccount:(i,b)=>{Po(n,o,"posts",i,l=>({...l,...b}))}}}function br0(e){const t=M0.postsLikedByAccount,o=d1();return{postsLikedByAccountQuery:$2({queryKey:t,enabled:e.enabled,async queryFn({pageParam:a}){const i=await n1();return r1("index",i).getPostsLikedByAccount(a).then(l=>({posts:l.posts.map(oc),next:l.next}))},getNextPageParam(a){return a.next}}),updatePostsLikedByAccount:(a,i)=>{Po(o,t,"posts",a,b=>({...b,...i}))}}}function Qt0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).delete(o.id)},onMutate:({id:o,parentId:n})=>{const r=t.getQueryData(M0.feed);t.setQueryData(M0.feed,k=>k&&{...k,pages:k.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(M0.inbox);t.setQueryData(M0.inbox,k=>k&&{...k,pages:k.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&&Lz(t,e,n,-1);const i=M0.outbox(e),b=t.getQueryData(i);t.setQueryData(i,k=>k&&{...k,pages:k.pages.map(C=>({...C,data:C.data.filter(w=>w.object.id!==o)}))});const l=M0.liked(e),u=t.getQueryData(l);let f=!1;t.setQueryData(l,k=>k&&{...k,pages:k.pages.map(C=>(f=C.data.some(w=>w.object.id===o),{...C,data:C.data.filter(w=>w.object.id!==o)}))}),[M0.feed,M0.inbox,M0.discoveryFeed,M0.profilePosts("index"),M0.postsLikedByAccount].some(k=>t.getQueryData(k)?.pages.some(w=>w.posts.some(P=>P.id===o&&P.object.liked)))&&t.setQueryData(M0.account(e),k=>k&&{...k,likedCount:Math.max(0,k.likedCount-1)});const h=M0.profilePosts(null),m=t.getQueriesData(h);t.setQueriesData(h,k=>k&&{...k,pages:k.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});let g=[],W;f&&(g=M0.account(e),W=t.getQueryData(g),t.setQueryData(g,k=>k&&{...k,likedCount:k.likedCount-1<0?0:k.likedCount-1}));const v=M0.profilePosts("index"),y=t.getQueryData(v);t.setQueryData(v,k=>k&&{...k,pages:k.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))});const L=M0.postsLikedByAccount,x=t.getQueryData(L);return t.setQueryData(L,k=>k&&{...k,pages:k.pages.map(C=>({...C,posts:C.posts.filter(w=>w.object.id!==o)}))}),n&&t.setQueriesData({queryKey:["reply_chain"],exact:!1},k=>{if(!k)return k;const C=k.children.filter(P=>P.post.id!==o).map(P=>({...P,chain:P.chain.filter(F=>F.id!==o)}));let w=k.post;return k.post.id===n&&(w={...k.post,replyCount:Math.max(0,(k.post.replyCount||0)-1)}),{...k,post:w,children:C}}),{previousFeed:{key:M0.feed,data:r},previousInbox:{key:M0.inbox,data:a},previousOutbox:{key:i,data:b},previousLiked:{key:l,data:u},previousProfilePosts:{key:h,data:m},previousAccount:f?{key:g,data:W}:null,previousPostsByAccount:{key:M0.profilePosts("index"),data:y},previousPostsLikedByAccount:{key:M0.postsLikedByAccount,data:x}}},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(M0.profilePosts("index"),r.previousPostsByAccount),r.previousPostsLikedByAccount&&t.setQueryData(M0.postsLikedByAccount,r.previousPostsLikedByAccount))},onSuccess:(o,{parentId:n})=>{t.invalidateQueries({queryKey:["reply_chain"]}),n&&(t.invalidateQueries({queryKey:M0.feed}),t.invalidateQueries({queryKey:M0.inbox}))}})}function lr0(e){return $2({queryKey:M0.notifications(e),async queryFn({pageParam:t}){const o=await n1();return r1(e,o).getNotifications(t)},getNextPageParam(t){return t.next}})}function zr0(e,t){const o=R2({queryKey:M0.replyChain(t),enabled:!!t,async queryFn(){if(!t)throw new Error("Post ID is required");const f=await n1(),O=r1(e,f);try{return await O.getReplies(t)}catch(h){if(Et0(h)&&h.statusCode===404)return await O.getPost(t),await O.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 f=await n1(),h=await r1(e,f).getReplies(n.ancestors.chain[0].id);r(m=>m&&{...m,ancestors:{chain:[...h.ancestors.chain,...m.ancestors.chain],hasMore:h.ancestors.hasMore}})}catch(f){i(f instanceof Error?f:new Error("Failed to load more ancestors"))}},[e,n?.ancestors.hasMore,n?.ancestors.chain]),l=p.useCallback(async()=>{if(n?.next&&t)try{const f=await n1(),h=await r1(e,f).getReplies(t,n.next);r(m=>m&&{...m,children:[...m.children,...h.children],next:h.next})}catch(f){i(f instanceof Error?f:new Error("Failed to load more children"))}},[e,n?.next,t]),u=p.useCallback(async f=>{if(n?.children[f]?.hasMore)try{const O=await n1(),h=r1(e,O),m=n.children[f],g=m.chain.length>1?m.chain[m.chain.length-2]:m.post,W=await h.getReplies(g.id),v=W.children[0].chain;r(y=>{if(!y)return y;const L=[...y.children];return L[f]={...m,chain:[...m.chain,...v],hasMore:W.children[0].hasMore},{...y,children:L}})}catch(O){i(O instanceof Error?O: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:f=>!!n?.children[f]?.hasMore}}function ur0(e){const t=d1();return Y1({async mutationFn(o){const n=await n1();return r1(e,n).updateAccount(o)},onSuccess(){t.invalidateQueries({queryKey:M0.account("index")})}})}async function $t0(e){const t=await n1();return r1("index",t).upload(e)}function _g(e,t=!0){const o=p.useCallback(async()=>await n1(),[]),n=p.useCallback(async()=>{const r=await o();return r1(e,r)},[e,o]);return R2({queryKey:M0.notificationsCount(e),enabled:t,async queryFn(){return(await(await n()).getNotificationsCount()).count}})}function Zt0(e){const t=d1(),o=p.useCallback(async()=>await n1(),[]),n=p.useCallback(async()=>{const r=await o();return r1(e,r)},[e,o]);return Y1({async mutationFn(){return t.setQueryData(M0.notificationsCount(e),0),(await n()).resetNotificationsCount()}})}function dr0(e,t){const o=d1(),n=[...M0.exploreProfiles(e),t];return{exploreProfilesQuery:$2({queryKey:n,staleTime:3600*1e3,async queryFn({pageParam:i}){const b=await n1(),u=await r1(e,b).getExploreAccounts(t,i);return u.accounts.forEach(f=>{o.setQueryData(M0.account(f.handle),f)}),{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(f=>{const O=f.accounts.map(h=>h.id===i?{...h,...b}:h);return{...f,accounts:O}});return{...l,pages:u}})}}}function Bd(e,t=3){const o=d1(),n=M0.suggestedProfiles(e,t);return{suggestedProfilesQuery:R2({queryKey:n,async queryFn(){const i=await n1(),u=(await r1("index",i).getRecommendations(t)).accounts;return u.length>0&&u.forEach(f=>{o.setQueryData(M0.account(f.handle),f)}),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 _d(){return{topicsQuery:R2({queryKey:M0.topics(),async queryFn(){const t=await n1();return r1("index",t).getTopics()},staleTime:864e5,retry:!1})}}function Ed(e,t){const o=M0.account("index");e.setQueryData(o,n=>n&&{...n,...t})}function Or0(e){const t=d1();return Y1({async mutationFn(){const o=await n1();return r1(e,o).enableBluesky()},onSuccess(){Ed(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:M0.accountFollows("index","following")})},onError(o){o.statusCode===429&&De()}})}function fr0(e){const t=d1();return Y1({async mutationFn(){const o=await n1();return r1(e,o).disableBluesky()},onSuccess(){Ed(t,{blueskyEnabled:!1,blueskyHandleConfirmed:!1,blueskyHandle:null}),t.invalidateQueries({queryKey:M0.accountFollows("index","following")})},onError(o){o.statusCode===429&&De()}})}function Ar0(e){const t=d1();return Y1({async mutationFn(){const o=await n1();return r1(e,o).confirmBlueskyHandle()},onSuccess(o){o!==""&&Ed(t,{blueskyEnabled:!0,blueskyHandleConfirmed:!0,blueskyHandle:o})},onError(o){o.statusCode===429&&De()}})}let Fi=null;const Xf=({onFollow:e,onUnfollow:t,authorHandle:o,followedByMe:n})=>{const[,r]=p0.useReducer(l=>l+1,0),i=Fi===o&&!n,b=l=>{i?(t(l),setTimeout(()=>{Fi=null,r()},0)):(Fi=o,r(),e(l))};return z.jsx(e1,{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(U8,{className:"-mb-px !size-3 !stroke-[2.4]"}):z.jsx($8,{className:"!size-[14px] !stroke-2"})})},To=({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,f]=p.useState(e?.icon?.url),O=Kt(),h=Cd("index",()=>{ge.success(`Followed ${e?.name}`)},()=>{ge.error("Failed to follow")}),m=xd("index",()=>{ge.info(`Unfollowed ${e?.name}`)},()=>{ge.error("Failed to unfollow")});switch(p.useEffect(()=>{f(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||So(e),W=k=>{k.stopPropagation(),O(`/profile/${g}`)},v=k=>{k.stopPropagation(),h.mutate(g)},y=k=>{k.stopPropagation(),m.mutate(g)},x=a||Fi===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:()=>f(void 0)}),x&&z.jsx(Xf,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]}):z.jsxs("div",{className:b,onClick:n?void 0:W,children:[z.jsx(nd,{className:"text-gray-600",size:i,strokeWidth:1.5}),x&&z.jsx(Xf,{authorHandle:g,followedByMe:!1,onFollow:v,onUnfollow:y})]})},Ol=({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 f=m=>{m.stopPropagation(),t()},O=m=>{m.stopPropagation(),o()},h=m=>{m.stopPropagation(),i?u():l()};return z.jsxs(bK,{children:[z.jsxs(_Y,{children:[z.jsx(EY,{disabled:r,asChild:!0,onClick:m=>m.stopPropagation(),children:e}),z.jsx(Mm,{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(Ml,{asChild:!0,children:z.jsxs(e1,{className:"justify-start",variant:"ghost",onClick:f,children:[z.jsx(LZ,{}),"Copy link"]})}),!b&&z.jsx(Ml,{asChild:!0,children:z.jsxs(e1,{className:"justify-start",variant:"ghost",onClick:h,children:[i?z.jsx(sG,{}):z.jsx(pG,{}),i?"Unfollow":"Follow"]})}),n&&z.jsx(lK,{asChild:!0,children:z.jsx(Ml,{asChild:!0,children:z.jsxs(e1,{className:"justify-start text-red hover:bg-red/5 hover:text-red",variant:"ghost",onClick:m=>m.stopPropagation(),children:[z.jsx(Y8,{}),"Delete"]})})})]})})]}),z.jsxs(o9,{onClick:m=>m.stopPropagation(),children:[z.jsxs(n9,{children:[z.jsx(c9,{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(r9,{children:[z.jsx(i9,{onClick:m=>m.stopPropagation(),children:"Cancel"}),z.jsx(s9,{className:h3({variant:"destructive"}),onClick:O,children:"Delete"})]})]})]})};function Gt0(e){const[t,o]=p.useState({images:[],currentIndex:0,isOpen:!1}),n=b=>{const l=Td(b);if(!l)return[];if(Array.isArray(l))return l.map((u,f)=>({url:u.url,alt:u.name||`Image-${f}`}));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(f=>f.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 fl=({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=f=>{o&&(f.key==="ArrowRight"&&!i?b():f.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(Da,{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(e1,{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(eZ,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Previous image"})]}),z.jsxs(e1,{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(Ju,{className:"!size-6"}),z.jsx("span",{className:"sr-only",children:"Next image"})]})]}),z.jsx(hK,{asChild:!0,children:z.jsxs(e1,{className:"absolute right-5 top-5 size-11 rounded-full bg-black/50 p-0 hover:bg-black/70",children:[z.jsx(cd,{className:"!size-5"}),z.jsx("span",{className:"sr-only",children:"Close"})]})})]})})},jf=()=>{},Sd=({className:e,following:t,handle:o,variant:n="default",onFollow:r=jf,onUnfollow:a=jf,"data-testid":i})=>{const[b,l]=p.useState(t),u=xd("index",()=>{},()=>{l(!0)}),f=Cd("index",()=>{},()=>{l(!1)}),O=async()=>{b?(l(!1),a(),u.mutate(o)):(l(!0),r(),f.mutate(o))};p.useEffect(()=>{l(t)},[t]);const h=b?"Following":"Follow";return n==="link"?z.jsx(e1,{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:m=>{m?.preventDefault(),m?.stopPropagation(),O()},children:h}):z.jsx(e1,{className:Z1("min-w-[90px]",e),"data-testid":i,title:b?"Click to unfollow":"",variant:b?"outline":"default",onClick:m=>{m?.preventDefault(),m?.stopPropagation(),O()},children:h})};function Cz(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 f=new RegExp(`<${u}[^>]*>.*?<\\/${u}>|<${u}[^>]*\\/?>`,"gis");i=i.replace(f,O=>{const h=`__EXCLUDED_TAG_${r+=1}__`;return n[h]=O,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,f]of Object.entries(n))l=l.replace(u,f);return l}const Hi=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},Df=e=>"preferredUsername"in e,Bo=({actor:e,children:t,disabled:o=!1,side:n="bottom",align:r="start",isCurrentUser:a=!1})=>{const[i,b]=p.useState(!1),l=Kt();let u=e?.handle;!u&&e&&Df(e)&&(u=So(e));const f=o||!u&&!e,O=Nd("index",u||"",{enabled:i&&!!u}),h=O.isFetching||O.isLoading,m=O.error,g=O.data?typeof O.data.followerCount=="number"&&typeof O.data.followingCount=="number"&&O.data.bio!==void 0:!1;if(p.useEffect(()=>{!i||!u||!g&&!h&&!m&&O.refetch({cancelRefetch:!1})},[O,h,m,g,i,u]),f)return z.jsx(z.Fragment,{children:t});const v=O.data||e,y=v?.handle??u??"",L=v?.name??"",x=v?.avatarUrl??(e&&Df(e)?e.icon?.url:null)??null,k=!!v?.followsMe,C=typeof v?.followingCount=="number"?v.followingCount:Number(v?.followingCount)||0,w=typeof v?.followerCount=="number"?v.followerCount:Number(v?.followerCount)||0,P=v?.bio?Hi(Cz(v.bio,["a"])):void 0,F=()=>{y&&l(`/profile/${y}`)},e0=()=>{y&&l(`/profile/${y}/following`)},G=()=>{y&&l(`/profile/${y}/followers`)};return z.jsxs(KY,{onOpenChange:b,children:[z.jsx(YY,{asChild:!0,children:t}),z.jsx(qm,{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:Y=>Y.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(ad,{className:"size-14 cursor-pointer",onClick:F,children:[x&&z.jsx(sd,{alt:L,className:"rounded-full outline outline-[0.5px] outline-offset-[-0.5px] outline-black/10",src:x,onError:Y=>{Y.target.src="",Y.target.style.display="none"}}),z.jsx(id,{className:"bg-gray-200 text-sm font-semibold text-gray-700 dark:bg-gray-800 dark:text-gray-200",children:z.jsx(nd,{className:"size-5 text-gray-500 dark:text-gray-400",strokeWidth:1.5})})]}),!a&&z.jsx(Sd,{following:!!v?.followedByMe,handle:y,type:"primary"})]}),z.jsxs("div",{className:"flex cursor-pointer flex-col items-start",onClick:F,children:[z.jsx(Bm,{className:"w-full truncate",children:L}),z.jsxs("div",{className:"flex w-full gap-2",children:[z.jsx("span",{className:"truncate text-gray-700 dark:text-gray-600",children:y}),k&&!a&&z.jsx(OK,{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"}):!m&&z.jsxs(z.Fragment,{children:[z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:e0,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:af(C)})," ","Following"]}),z.jsxs("span",{className:"cursor-pointer hover:underline",onClick:G,children:[z.jsx("span",{className:"font-bold text-black dark:text-white",children:af(w)})," ","Followers"]})]})}),h?z.jsx(w1,{className:"h-4 w-48"}):!m&&P?z.jsx("div",{dangerouslySetInnerHTML:{__html:P},className:"leading-tight dark:text-gray-300 [&_.invisible]:hidden [&_a:hover]:underline [&_a]:text-[#00a4eb]"}):null]})})]})},Eg=(e={})=>{const[t,o]=p.useState(!1),n=Re();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:f})=>{const[O,h]=p.useState(t.liked),[m,g]=p.useState(t.reposted),[W,v]=p.useState(!1),y=p.useRef(null);Eg({isReplyAvailable:!u&&a!=="reply",onOpenReply:()=>v(!0),componentRef:y}),p.useEffect(()=>{h(t.liked),g(t.reposted)},[t.liked,t.reposted]),p.useEffect(()=>{P(r)},[r]);const L=Xt0("index"),x=jt0("index"),k=Dt0("index"),C=It0("index"),[w,P]=p.useState(r),F=async Y=>{Y.stopPropagation(),O?x.mutate(t.id):L.mutate(t.id,{onError(){h(!1)}}),h(!O),l()},e0=Y=>{Y.stopPropagation(),u?u():v(!0)},G=`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(e1,{className:`${G} ${O&&"text-pink-500 hover:text-pink-500"}`,"data-testid":"like-button",disabled:i,id:"like",title:`${O?"Undo like":"Like"}`,variant:"ghost",onClick:Y=>{Y?.stopPropagation(),Y&&F(Y)},children:[z.jsx(gZ,{className:`${O&&"fill-pink-500 text-pink-500"}`}),a!=="inbox"&&z.jsx(zf,{className:o===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:o})]}),z.jsxs(e1,{className:`${G}`,"data-testid":"reply-button",disabled:i,id:"comment",title:"Reply",variant:"ghost",onClick:e0,children:[z.jsx(td,{className:"-mr-px"}),a!=="inbox"&&n>0&&Yu(n)]}),z.jsxs(e1,{className:`${G} ${m&&"text-green-500 hover:text-green-500"}`,"data-testid":"repost-button",disabled:i,id:"repost",title:`${m?"Undo repost":"Repost"}`,variant:"ghost",onClick:Y=>{Y?.stopPropagation(),m?(C.mutate(t.id),P(w-1)):(k.mutate(t.id,{onError(){g(!1),P(w-1)}}),P(w+1)),g(!m)},children:[z.jsx(Z8,{className:`${m&&"text-green-500"}`}),a!=="inbox"&&z.jsx(zf,{className:w===0?"-ml-1.5 w-0 overflow-hidden":"",spinTiming:{duration:300},value:w})]})]}),W&&z.jsx(Pd,{open:W,replyTo:{object:t,actor:e},onOpenChange:Y=>{v(Y)},onReply:()=>{f?.(1),v(!1)},onReplyError:()=>{f?.(-1)}})]})};function Kt0(e){const o=e.replace(/<[^>]*>/g,"").split(/\s+/).filter(r=>r.length>0).length;return`${Math.ceil(o/275)} min read`}const yo=(e,t,o)=>{o?.stopPropagation(),t(typeof e=="string"?`/profile/${e}`:`/profile/${e.handle||So(e)}`)},Yt0=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()?Jt0(e):a.getTime()===r.getTime()?"Yesterday":eo0(e)},Jt0=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`},eo0=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 to0(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=to0(o),r=Yt0(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 Td(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 Uc(e,t,o,n){const r=Td(e);if(!r)return null;const a=l=>u=>{u.stopPropagation(),t&&t(l)},i=l=>{n&&n(l)},b=(l,u=!1)=>{const f=u?"min-h-[200px]":"";return z.jsx("div",{className:`${l} ${f} flex w-full items-center justify-center bg-gray-100 dark:bg-gray-925/30`,children:z.jsx(vZ,{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((f,O)=>{const h=`size-full rounded-md outline outline-1 -outline-offset-1 outline-black/10 ${l===3&&O===0?"row-span-2":""}`;return o&&o.has(f.url)?b(h,l===1):z.jsx("img",{alt:f.name||`Image-${O}`,className:`${h} cursor-pointer object-cover`,referrerPolicy:"no-referrer",src:f.url,onClick:t?a(f.url):void 0,onError:()=>i(f.url)},f.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 oo0(e,t){const o=Td(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(HZ,{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 If=()=>{},Ff=z.jsx(Z8,{className:"shrink-0 text-gray-700 dark:text-gray-600",size:16,strokeWidth:1.5}),no0=({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:f,isLoading:O,isPending:h=!1,isCompact:m=!1,isChainContinuation:g=!1,isChainParent:W=!1,onClick:v=If,onDelete:y=If,showStats:L=!0})=>{const x=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"}),[,k]=p.useState(!1),[C,w]=p.useState(new Set),P=p.useRef(null),[F,e0]=p.useState(!1),G=Qt0("index"),Y=Kt(),o0=Cd("index",()=>{ge.success(`Followed ${X?.name}`)},()=>{ge.error("Failed to follow")}),K=xd("index",()=>{ge.info(`Unfollowed ${X?.name}`)},()=>{ge.error("Failed to unfollow")});p.useEffect(()=>{const V0=P.current;V0&&e0(V0.scrollHeight>V0.clientHeight)},[o?.content]),p.useEffect(()=>{const V0=P.current;if(!V0)return;const l1=E=>{const r0=E.target.closest("a[data-profile]");if(r0){const f0=r0.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(f0||"")&&f0&&(E.preventDefault(),E.stopPropagation(),yo(f0,Y))}};return V0.addEventListener("click",l1),()=>{V0.removeEventListener("click",l1)}},[Y,o?.content]);const a0=()=>{},g0=()=>{h||v()},Q=()=>{G.mutate({id:o.id,parentId:n}),y()},A0=async()=>{o?.url&&(await navigator.clipboard.writeText(o.url),k(!0),ge.success("Link copied"),setTimeout(()=>k(!1),2e3))},$=V0=>{w(l1=>new Set(l1).add(V0))};let X=e;a==="Announce"&&(X=typeof o.attributedTo=="object"?o.attributedTo:e);const Z=X?So(X):null,B=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,b0=a==="Announce"?o.reposted??!1:o.authored,O0=()=>{Z&&o0.mutate(Z)},m0=()=>{Z&&K.mutate(Z)},W0=z.jsx(e1,{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(V8,{})}),{lightboxState:z0,openLightbox:t0,closeLightbox:N0,navigateToIndex:_0}=Gt0(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:g0,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:[Ff,z.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm",children:[z.jsx(Bo,{actor:e,align:"center",isCurrentUser:b0,children:z.jsx("span",{className:"truncate break-anywhere hover:underline",onClick:V0=>{yo(e,Y,V0)},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(Bo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(To,{author:X,disabled:h,showFollowButton:!I&&!B}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:V0=>{h||yo(X,Y,V0)},children:[z.jsx("span",{className:`min-w-0 truncate font-semibold break-anywhere ${m?"text-lg":"text-md"} ${h?"":"hover-underline"} dark:text-white`,"data-test-activity-heading":!0,children:O?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:O?z.jsx(w1,{className:"w-56"}):So(X)}),z.jsx("div",{className:`ml-1 before:mr-1 ${!O&&'before:content-["·"]'}`,title:`${x}`,children:O?z.jsx(w1,{className:"w-4"}):yi(o,h===!1&&!o.authored)})]})]})]})}),z.jsx(Ol,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:B,layout:"feed",trigger:W0,onCopyLink:A0,onDelete:Q,onFollow:O0,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:[Uc(o,g0,C,$),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:O?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:P,onClick:V0=>{const l1=V0.target;(l1.tagName==="A"||l1.closest("a"))&&V0.stopPropagation()}})}),F&&z.jsx("button",{className:"mt-1 text-blue-600",type:"button",children:"Show more"}),Uc(o,t0,C,$)]})}),z.jsx("div",{className:"space-between relative z-[30] ml-[-8px] mt-1 flex",children:O?z.jsx(w1,{className:"ml-2 w-18"}):L&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]})]}),z.jsx(fl,{currentIndex:z0.currentIndex,images:z0.images,isOpen:z0.isOpen,onClose:N0,onNavigate:_0})]}):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:g0,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(To,{author:X,showFollowButton:!I&&!B})}),z.jsxs("div",{className:"relative z-10 flex w-full min-w-0 cursor-pointer flex-col overflow-visible text-[1.5rem]",onClick:V0=>{h||yo(X,Y,V0)},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:So(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(m2,{className:"mb-1 leading-tight break-anywhere","data-test-activity-heading":!0,children:o.name}),z.jsx("div",{dangerouslySetInnerHTML:{__html:Hi(o.content||"")??""},ref:P,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"}),Uc(o,t0,C,$),z.jsx("div",{className:"space-between ml-[-8px] mt-3 flex",children:L&&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(fl,{currentIndex:z0.currentIndex,images:z0.images,isOpen:z0.isOpen,onClose:N0,onNavigate:_0})]}):r==="reply"?z.jsxs(z.Fragment,{children:[o&&z.jsxs("div",{className:`group/article relative ${m?"pb-6":g?"pb-5":"py-5"} ${h?"pointer-events-none":"cursor-pointer"}`,"data-layout":"reply","data-object-id":o.id,onClick:g0,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(Bo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex min-w-0 grow items-center gap-3",children:[z.jsx(To,{author:X,disabled:h,showFollowButton:!I&&!B}),z.jsxs("div",{className:"flex min-w-0 grow flex-col",onClick:V0=>{h||yo(X,Y,V0)},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:So(X)})})]})]})}),!m&&z.jsx(Ol,{allowDelete:t,authoredByMe:I,disabled:h,followedByMe:B,layout:"reply",trigger:W0,onCopyLink:A0,onDelete:Q,onFollow:O0,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"&&Uc(o,g0,C,$),o.name&&z.jsx(m2,{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:Hi(o.content||"")??""},ref:P,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"&&Uc(o,t0,C,$),o.type==="Article"&&z.jsx(e1,{className:"mt-3 w-full",id:"read-more",variant:"secondary",children:"Read more"}),!m&&z.jsx("div",{className:"space-between ml-[-8px] mt-2 flex",children:L&&z.jsx(Ri,{actor:X,commentCount:i,disabled:h,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0})})]})})]}),!f&&z.jsx("div",{className:`absolute left-[19px] ${m?"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(fl,{currentIndex:z0.currentIndex,images:z0.images,isOpen:z0.isOpen,onClose:N0,onNavigate:_0})]}):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:g0,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:O?z.jsx(w1,{className:"w-24"}):z.jsxs(z.Fragment,{children:[z.jsx(Bo,{actor:X,isCurrentUser:I,children:z.jsxs("div",{className:"flex items-center gap-1",children:[z.jsx(To,{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:V0=>{yo(X,Y,V0)},children:X.name})]})}),a==="Announce"&&z.jsxs("span",{className:"z-10 flex items-center gap-1 text-gray-700 dark:text-gray-600",children:[Ff,z.jsx(Bo,{actor:e,align:"center",isCurrentUser:b0,children:z.jsx("span",{className:"line-clamp-1 hover:underline",onClick:V0=>{yo(e,Y,V0)},children:e.name})})," reposted"]}),z.jsx("span",{className:'shrink-0 whitespace-nowrap text-gray-600 before:mr-1 before:content-["·"]',title:`${x}`,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(m2,{className:"line-clamp-2 w-full max-w-[600px] text-pretty leading-tight break-anywhere","data-test-activity-heading":!0,children:O?z.jsx(w1,{className:"w-full max-w-96"}):o.name?o.name:z.jsx("span",{dangerouslySetInnerHTML:{__html:Cz(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:O?z.jsx(w1,{count:2}):z.jsx("div",{dangerouslySetInnerHTML:{__html:Cz(o.preview?.content??o.content??"")}})}),z.jsx("span",{className:"mt-1 shrink-0 whitespace-nowrap text-sm leading-none text-gray-600",children:O?z.jsx(w1,{className:"w-16"}):o.content&&`${Kt0(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:[L&&z.jsx(Ri,{actor:X,commentCount:i,layout:r,likeCount:l,object:o,repostCount:b,onLikeClick:a0}),z.jsx(Ol,{allowDelete:t,authoredByMe:I,followedByMe:B,layout:"inbox",trigger:W0,onCopyLink:A0,onDelete:Q,onFollow:O0,onUnfollow:m0})]})]})]}),oo0(o,O)]})}):z.jsx(z.Fragment,{})},Hf=5*1024*1024,Uf="Image must be less than 5MB in size.",hr0=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}},qr0=e=>new Promise(t=>{const o=new Image;o.onload=()=>{URL.revokeObjectURL(o.src),t(o.width===o.height)},o.src=URL.createObjectURL(e)}),mr0="Image must be square.",Pd=({children:e,replyTo:t,onReply:o,onReplyError:n,onOpenChange:r,...a})=>{const{data:i}=Ft0("index"),b=Vt0("index",i),l=Ut0("index",i),{data:u,isLoading:f}=Nd("index","me"),[O,h]=p.useState(!1),m=p.useRef(null),g=p.useRef(null),[W,v]=p.useState(null),[y,L]=p.useState(!1),x=p.useRef(null),[k,C]=p.useState(""),[w,P]=p.useState(null),[F,e0]=p.useState(""),[G,Y]=p.useState(!1),[o0,K]=p.useState(!1),[a0,g0]=p.useState(!1),Q=Kt(),A0=500;p.useEffect(()=>{a.open!==void 0&&h(a.open)},[a.open]),p.useEffect(()=>{if(a.open!==void 0?a.open:O){const N0=setTimeout(()=>{g0(!0)},300);return()=>clearTimeout(N0)}else g0(!1)},[O,a.open]);const $=!k.trim()||!i||o0||k.length>A0,X=p.useCallback(async()=>{const t0=k.trim();if(!(!t0||!i))try{K(!0),t?(await l.mutateAsync({inReplyTo:t.object.id,content:t0,imageUrl:w||void 0,altText:F||void 0}),o?.()):(await b.mutateAsync({content:t0,imageUrl:w||void 0,altText:F||void 0}),Q("/notes")),h(!1),r&&r(!1),ge.success(t?"Reply posted":"Note posted")}catch{t&&n?.()}finally{K(!1)}},[k,i,t,l,b,w,F,o,n,h,Q,r]),Z=t0=>{C(t0.target.value)};p.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${m.current.scrollHeight}px`)},[k]),p.useEffect(()=>{if((a.open!==void 0?a.open:O)&&m.current){const N0=setTimeout(()=>{m.current?.focus()},100);return()=>clearTimeout(N0)}},[O,a.open]),p.useEffect(()=>{if(G&&g.current){const t0=setTimeout(()=>{g.current?.focus()},100);return()=>clearTimeout(t0)}},[G]),p.useEffect(()=>{const t0=_0=>{(_0.metaKey||_0.ctrlKey)&&_0.key==="Enter"&&(_0.preventDefault(),!$&&!y&&X())};if(a.open!==void 0?a.open:O)return document.addEventListener("keydown",t0),()=>document.removeEventListener("keydown",t0)},[O,a.open,$,y,X]);const B=p.useCallback(async t0=>{const N0=t0.clipboardData?.items;if(N0)for(let _0=0;_0<N0.length;_0++){const V0=N0[_0];if(V0.type.indexOf("image")!==-1){t0.preventDefault();const l1=V0.getAsFile();if(l1){if(l1.size>Hf){ge.error(Uf);return}const E=URL.createObjectURL(l1);v(E),await I(l1)}break}}},[]);p.useEffect(()=>{if(a.open!==void 0?a.open:O)return document.addEventListener("paste",B),()=>document.removeEventListener("paste",B)},[O,a.open,B]);const I=async t0=>{try{L(!0);const N0=await $t0(t0);P(N0)}catch(N0){v(null);let _0="Failed to upload image. Try again.";if(N0&&typeof N0=="object"&&"statusCode"in N0)switch(N0.statusCode){case 413:_0="Image size exceeds limit.";break;case 415:_0="The file type is not supported.";break}ge.error(_0)}finally{L(!1)}},b0=async t0=>{const N0=t0.target.files;if(N0&&N0.length>0){const _0=N0[0];if(_0.size>Hf){ge.error(Uf),t0.target.value="";return}const V0=URL.createObjectURL(_0);v(V0),await I(_0)}},O0=t0=>{t0.stopPropagation(),v(null),P(null),e0(""),Y(!1),W&&URL.revokeObjectURL(W),x.current&&(x.current.value="")},m0=t0=>{t0.stopPropagation(),Y(!G)},W0=()=>{m.current?.focus()};p.useEffect(()=>()=>{W&&URL.revokeObjectURL(W)},[W]);let z0="What's new?";if(t){const t0=t.object.attributedTo||{};typeof t0=="object"&&"preferredUsername"in t0&&"id"in t0&&(z0=`Reply to ${So(t0)}...`)}return z.jsxs(q3,{open:a.open!==void 0?a.open:O,onOpenChange:t0=>{t0&&(C(""),v(null),P(null),e0(""),Y(!1),W&&URL.revokeObjectURL(W),x.current&&(x.current.value="")),h(t0),r&&r(t0)},...a.open!==void 0?{}:a,children:[z.jsx(p9,{asChild:!0,children:e}),z.jsxs(Da,{className:"max-h-[80vh] min-h-[240px] gap-0 overflow-y-auto pb-0","data-testid":"new-note-modal",onClick:t0=>t0.stopPropagation(),children:[z.jsxs(Md,{className:"hidden",children:[z.jsx(ld,{children:t?"Reply":"New note"}),z.jsx(b9,{children:"Post your thoughts to the Social web"})]}),t&&z.jsx(no0,{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(To,{author:i})}),z.jsx(UT,{asChild:!0,children:z.jsxs("div",{className:"-mt-0.5 flex w-full flex-col gap-0.5",children:[f?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(c6,{name:"content",asChild:!0,children:z.jsx(a6,{asChild:!0,children:z.jsx("textarea",{ref:m,autoFocus:!0,className:"ap-textarea w-full resize-none bg-transparent text-[1.5rem] break-anywhere","data-testid":"note-textarea",placeholder:z0,rows:1,value:k,onChange:Z,onPaste:B})})}),z.jsx(c6,{name:"image",asChild:!0,children:z.jsx(a6,{asChild:!0,children:z.jsx("input",{ref:x,accept:"image/jpeg,image/png,image/webp,image/gif",className:"hidden",type:"file",onChange:b0})})})]})})]}),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(mp,{size:"md"})}),z.jsx(e1,{className:"absolute right-3 top-3 size-8 bg-black/60 text-white opacity-0 hover:bg-black/80 group-hover:opacity-100",onClick:O0,children:z.jsx(Y8,{})}),!y&&z.jsx(e1,{className:`absolute bottom-3 left-3 h-6 px-2 py-0 text-white ${G?"bg-green-500 hover:bg-green-500":"bg-black/60 hover:bg-black/80"}`,onClick:m0,children:"Alt"})]}),W&&!y&&G&&z.jsx("div",{className:"mt-1",children:z.jsx(w3,{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:F,onChange:t0=>e0(t0.target.value)})}),z.jsxs(bd,{className:`${a0?"sticky":"static"} bottom-0 flex-row bg-background py-6 dark:bg-[#101114]`,children:[z.jsx(e1,{className:"mr-auto w-[34px] !min-w-0",variant:"outline",onClick:()=>x.current?.click(),children:z.jsx(yZ,{})}),z.jsxs("div",{className:"flex items-center space-x-3",children:[z.jsxs("div",{className:`text-sm ${k.length>=A0?"text-red-500":k.length>=A0*.9?"text-yellow-600":"text-gray-500"}`,children:[k.length,"/",A0]}),z.jsx(e1,{className:"min-w-16","data-testid":"post-button",disabled:$||y,onClick:X,children:o0?z.jsx(mp,{color:"light",size:"sm"}):"Post"})]})]})]})]})};function Nz(e){if(!e)return{};try{return JSON.parse(e)}catch{return{}}}function ro0(e,t){const o=Nz(e);return JSON.stringify({...o,...t})}const Sg=()=>{const{data:e}=ve(),{mutateAsync:t}=Fm(),o=p0.useMemo(()=>e?.accessibility?Nz(e.accessibility).apOnboarding||{}:{},[e?.accessibility]),n=p0.useCallback(async r=>{if(!e)return;const a=Nz(e.accessibility),i=ro0(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})}},Tg=()=>z.jsx("div",{className:"h-full pt-14",children:z.jsx(yn,{})}),co0=Object.freeze(Object.defineProperty({__proto__:null,default:Tg,useOnboardingStatus:Sg},Symbol.toStringTag,{value:"Module"})),ao0=()=>{const e=Kt();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(EZ,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(m2,{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(e1,{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"})]})]})},kp=({children:e,url:t=null,onClick:o,"data-testid":n,isSelected:r=!1})=>{const a=p0.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},so0=()=>{const e=Kt(),{suggestedProfilesQuery:t}=Bd("index",3),{data:o,isLoading:n}=t,r=n?Array(3).fill(null):o||[],{resetStack:a}=n3(),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(Op,{className:"text-purple-500",size:20,strokeWidth:1.5}),z.jsx(m2,{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}`,f=b?.name||"",O=b?.handle||"",h=b?.avatarUrl||"";let m;switch(l){case 0:m="[@media(max-height:740px)]:hidden";break;case 1:m="[@media(max-height:800px)]:hidden";break;case 2:m="[@media(max-height:860px)]:hidden";break}return z.jsx(p.Fragment,{children:z.jsx("li",{className:m,children:z.jsx(Bo,{actor:b,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(kp,{onClick:()=>{!n&&b&&yo(b,e)},children:[n?z.jsx(w1,{className:"z-10 size-10"}):z.jsx(To,{author:{icon:{url:h},name:f,handle:O},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"}):f}),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"}):O})]})]})})})},u)},u)})}),z.jsx(e1,{className:"p-0 font-medium text-purple hover:text-black dark:hover:text-white",variant:"link",onClick:()=>{a(),e("/explore")},children:"Find more →"})]})},io0=({profile:e,update:t,isLoading:o,onOpenChange:n})=>{const r=()=>{t(e.id,{followedByMe:!0})},a=()=>{t(e.id,{followedByMe:!1})},i=Kt();return z.jsx(Bo,{actor:e,align:"center",isCurrentUser:!1,side:"left",children:z.jsx("div",{children:z.jsxs(kp,{onClick:()=>{n?.(!1),i(`/profile/${e.handle}`)},children:[z.jsx(To,{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(Sd,{className:"ml-auto",following:e.followedByMe,handle:e.handle,type:"secondary",onFollow:r,onUnfollow:a})]},e.id)})})},po0=({onOpenChange:e})=>{const{suggestedProfilesQuery:t,updateSuggestedProfile:o}=Bd("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(p0.Fragment,{children:z.jsx(io0,{isLoading:r,profile:a||{id:"",name:"",handle:"",avatarUrl:"",bio:"",followerCount:0,followingCount:0,followedByMe:!1},update:o,onOpenChange:e})},a?.id||`loading-${i}`))})})};function Mo0(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([]),f=p.useRef(),O=p.useRef(),h=p.useRef(e),m=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,L="maxWait"in o,x="debounceOnServer"in o&&!!o.debounceOnServer,k=L?Math.max(+o.maxWait||0,t):null;p.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var C=p.useMemo(function(){var w=function(K){var a0=u.current,g0=f.current;return u.current=f.current=null,i.current=K,b.current=b.current||K,O.current=h.current.apply(g0,a0)},P=function(K,a0){W&&cancelAnimationFrame(l.current),l.current=W?requestAnimationFrame(K):setTimeout(K,a0)},F=function(K){if(!m.current)return!1;var a0=K-a.current;return!a.current||a0>=t||a0<0||L&&K-i.current>=k},e0=function(K){return l.current=null,y&&u.current?w(K):(u.current=f.current=null,O.current)},G=function K(){var a0=Date.now();if(v&&b.current===i.current&&Y(),F(a0))return e0(a0);if(m.current){var g0=t-(a0-a.current),Q=L?Math.min(g0,k-(a0-i.current)):g0;P(K,Q)}},Y=function(){n&&n({})},o0=function(){if(g||x){var K=Date.now(),a0=F(K);if(u.current=[].slice.call(arguments),f.current=r,a.current=K,a0){if(!l.current&&m.current)return i.current=a.current,P(G,t),v?w(a.current):O.current;if(L)return P(G,t),w(a.current)}return l.current||P(G,t),O.current}};return o0.cancel=function(){var K=l.current;K&&(W?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=f.current=l.current=null,K&&n&&n({})},o0.isPending=function(){return!!l.current},o0.flush=function(){return l.current?e0(Date.now()):O.current},o0},[v,L,t,k,y,W,g,x,n]);return C}function bo0(e,t){return e===t}function lo0(e,t,o){var n=bo0,r=p.useRef(e),a=p.useState({})[1],i=Mo0(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,zo0=({onOpenChange:e,query:t,setQuery:o})=>{const n=p.useRef(null),r=p.useRef([]),a=p.useRef(0),i=Kt(),[b]=lo0(t,300),l=t.length>=2,{searchQuery:u,updateAccountSearchResult:f}=Ht0("index",l?b:""),{data:O,isFetching:h,isFetched:m}=u,{suggestedProfilesQuery:g}=Bd("index",5),{data:W,isLoading:v}=g,y=v||W&&W.length>0,{topicsQuery:L}=_d(),{data:x}=L,k=Nd("index","me"),{data:C}=k,[w,P]=p.useState([]),[F,e0]=p.useState(null),[G,Y]=p.useState(0),o0=p.useMemo(()=>{const X=x?.topics||[];if(!l||X.length===0)return[];const Z=t.toLowerCase();return X.filter(B=>B.slug==="following"?!1:B.name.toLowerCase().startsWith(Z)||B.slug.toLowerCase().startsWith(Z))},[t,l,x?.topics]),K=p.useMemo(()=>[...o0.map(X=>({type:"topic",data:X})),...w.map(X=>({type:"account",data:X}))],[o0,w]);p.useEffect(()=>{if(!l){P([]),e0(null);return}m&&(O?.accounts&&O.accounts.length>0?(P(O.accounts),e0("results"),Y(0)):(P([]),e0("none"),Y(0)))},[O?.accounts,m,l]);const a0=h&&l,g0=t.length<2||!F&&l&&o0.length===0,Q=!g0&&F==="none"&&o0.length===0,A0=!g0&&(w.length>0||o0.length>0);p.useEffect(()=>{n.current?.focus()},[]),p.useEffect(()=>{const X=r.current[G];if(!X)return;const Z=X.closest("[data-radix-scroll-area-viewport]")||X.closest(".overflow-y-auto");if(!Z){X.scrollIntoView({block:"nearest"});return}const B=Z.getBoundingClientRect(),I=X.getBoundingClientRect();I.top<B.top+wi?Z.scrollTo({top:Z.scrollTop-(B.top+wi-I.top),behavior:"smooth"}):I.bottom>B.bottom-wi&&Z.scrollTo({top:Z.scrollTop+(I.bottom-B.bottom+wi),behavior:"smooth"})},[G]);const $=X=>{if(!(!A0||K.length===0)){if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault();const Z=Date.now();if(Z-a.current<50)return;a.current=Z,X.key==="ArrowDown"?Y(B=>(B+1)%K.length):Y(B=>(B-1+K.length)%K.length)}else if(X.key==="Enter"){const Z=K[G];if(!Z)return;X.preventDefault(),e?.(!1),Z.type==="topic"?i(`/explore/${Z.data.slug}`):i(`/profile/${Z.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(od,{className:"text-gray-600",size:18,strokeWidth:1.5}),z.jsx(w3,{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:$}),a0&&z.jsx(mp,{className:"!absolute right-0 mr-0.5 shrink-0",size:"sm"})]}),z.jsxs("div",{className:"h-full",children:[Q&&z.jsx("div",{className:"flex h-full items-center justify-center pb-14",children:z.jsxs(oJ,{children:[z.jsx(nJ,{children:z.jsx(nd,{})}),"No users matching this handle or account URL"]})}),A0&&z.jsx("div",{className:"mt-[-14px] pb-2",children:K.map((X,Z)=>{const B=Z===G;if(X.type==="topic")return z.jsx("div",{ref:O0=>r.current[Z]=O0,children:z.jsxs(kp,{isSelected:B,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(Op,{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,b0=I.handle===C?.handle;return z.jsx(Bo,{actor:I,align:"center",isCurrentUser:b0,side:"left",children:z.jsx("div",{ref:O0=>r.current[Z]=O0,children:z.jsxs(kp,{isSelected:B,onClick:()=>{e?.(!1),i(`/profile/${I.handle}`)},children:[z.jsx(To,{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(e1,{className:"pointer-events-none ml-auto min-w-[90px]",variant:"destructive",children:"Blocked"}):b0?null:z.jsx(Sd,{className:"ml-auto",following:I.followedByMe,handle:I.handle,type:"secondary",onFollow:()=>f(I.id,{followedByMe:!0}),onUnfollow:()=>f(I.id,{followedByMe:!1})})]})})},I.id)})}),g0&&y&&z.jsxs(z.Fragment,{children:[z.jsx(m2,{children:"More people to follow"}),z.jsx(po0,{onOpenChange:e})]})]})]})},uo0=()=>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(od,{size:18,strokeWidth:1.5})," Search the social web"]}),hn=p.forwardRef(({to:e,children:t,count:o,...n},r)=>{const a=Re(),{resetStack:i}=n3(),b=Q3(),l=e&&e.startsWith("/")?`${b}${e}`:e,u=l&&(a.pathname===l||a.pathname.startsWith(`${l}/`)),f=q0("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"),O=o&&o>0?z.jsx("span",{className:q0("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:Yu(o)}):null;return l?z.jsx(e1,{className:f,variant:"ghost",asChild:!0,children:z.jsxs(Ba,{to:l,onClick:()=>{i(),xJ(l)},children:[t,O]})}):z.jsxs(e1,{ref:r,className:f,variant:"ghost",onClick:n.onClick,...n,children:[t,O]})});hn.displayName="SidebarMenuLink";const Pg=({isMobileSidebarOpen:e})=>{const{allFlags:t,flags:o}=Ct0(),[n,r]=p.useState(!1),[a,i]=p.useState(""),{data:b}=ve(),l=Re(),u=Q3(),{data:f}=_g(b?.slug||""),O=Zt0(b?.slug||""),{topicsQuery:h}=_d(),{data:m,isLoading:g}=h,W=!g&&m&&m.topics.length===0;p.useEffect(()=>{l.pathname===`${u}/notifications`&&f&&f>0&&O.mutate()},[l.pathname,u,f,O]);const v=p.useCallback(()=>{f&&f>0&&O.mutate()},[f,O]);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(p9,{className:"mt-0.5 w-full",children:z.jsx(uo0,{})}),z.jsx(Da,{className:"flex h-full max-h-[452px] flex-col overflow-y-auto pb-0",children:z.jsx(zo0,{query:a,setQuery:i,onOpenChange:r})})]})}),z.jsxs("div",{className:"flex w-full flex-col gap-px",children:[z.jsxs(hn,{to:"/reader",children:[z.jsx(Q$,{size:18,strokeWidth:1.5}),"Reader"]}),z.jsxs(hn,{to:"/notes",children:[z.jsx(td,{size:18,strokeWidth:1.5}),"Notes"]}),z.jsxs(hn,{count:l.pathname!==`${u}/notifications`?f:void 0,to:"/notifications",onClick:v,children:[z.jsx(U$,{size:18,strokeWidth:1.5}),"Notifications"]}),W?z.jsx(e1,{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(Op,{size:18,strokeWidth:1.5}),"Explore",z.jsx(ed,{className:"ml-auto",size:14,strokeWidth:1.5})]})}):z.jsxs(hn,{to:"/explore",children:[z.jsx(Op,{size:18,strokeWidth:1.5}),"Explore"]}),z.jsxs(hn,{to:"/profile",children:[z.jsx(rd,{size:18,strokeWidth:1.5}),"Profile"]}),z.jsxs(hn,{to:"/preferences",children:[z.jsx(KZ,{size:18,strokeWidth:1.5}),"Preferences"]})]}),z.jsx(Pd,{children:z.jsxs(e1,{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(dZ,{}),"New note"]})}),z.jsx(so0,{}),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(ao0,{})})]})})};Pg.displayName="Sidebar";const do0=({children:e,...t})=>{const{isOnboarded:o}=Sg(),n=Q3(),{data:r,isLoading:a}=ve(),i=p.useRef(null),[b,l]=p.useState(!1),u=kg(),{topicsQuery:f}=_d(),{data:O}=f,h=O&&O.topics.length>0,{isNewNoteModalOpen:m,setIsNewNoteModalOpen:g}=Eg(),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(CJ,{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(_t0,{showBorder:!(u==="reader"&&h)&&u!=="explore",onToggleMobileSidebar:W}),z.jsx("div",{className:"px-[min(4vw,32px)]",children:e})]}),z.jsx(Pg,{isMobileSidebarOpen:b,onCloseMobileSidebar:v})]}),b&&z.jsx("div",{className:"fixed inset-0 z-40 lg:hidden",onClick:v})]}):z.jsx(Tg,{})}),z.jsx(Pd,{open:m,onOpenChange:g})]}):z.jsx(qn,{to:`${n}/welcome`,replace:!0})},Vc=({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}),Qc=({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}),Xg=({statusCode:e,errorCode:t})=>{const o=oq(),n=_m(),r=a=>{a.preventDefault(),n("/analytics/",{crossApp:!0})};return o?z.jsx(do0,{children:z.jsxs(Qc,{children:[z.jsx(Vc,{children:z.jsx($Z,{})}),z.jsx(m2,{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(Qc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Vc,{children:z.jsx(cG,{})}),z.jsx(m2,{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(e1,{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(Qc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Vc,{children:z.jsx(G8,{})}),z.jsx(m2,{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(e1,{asChild:!0,children:z.jsx("a",{href:"https://ghost.org/help/social-web/",rel:"noopener noreferrer",target:"_blank",children:"Learn more →"})})]}):z.jsxs(Qc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Vc,{children:z.jsx(F$,{})}),z.jsx(m2,{className:"-mb-4",children:"Account suspended"}),z.jsx("div",{children:"Your account has been suspended due to policy violations."}),z.jsx(e1,{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(Qc,{className:"mt-[50vh] -translate-y-1/2",children:[z.jsx(Vc,{children:z.jsx(pZ,{})}),z.jsx(m2,{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(e1,{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"})]})})},Oo0=Object.freeze(Object.defineProperty({__proto__:null,default:Xg},Symbol.toStringTag,{value:"Module"})),fo0="activitypub",jg=[{path:fo0,element:z.jsx(yn,{}),errorElement:z.jsx(Xg,{}),handle:"activitypub-basepath",children:[{index:!0,element:z.jsx(qn,{to:"reader"})},{path:"inbox",element:z.jsx(qn,{to:"../reader",replace:!0})},{path:"feed",element:z.jsx(qn,{to:"../notes",replace:!0})},{path:"reader",lazy:A1(()=>M1(()=>import("./index-kXF42nga.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"reader/:postId",lazy:A1(()=>M1(()=>import("./index-kXF42nga.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),pageTitle:"Reader"},{path:"notes",lazy:A1(()=>M1(()=>import("./feed-Ci-ODCHE.js"),__vite__mapDeps([7,8]),import.meta.url)),pageTitle:"Notes"},{path:"notes/:postId",lazy:A1(()=>M1(()=>import("./note-BAfNweZN.js"),__vite__mapDeps([9,2,3,8]),import.meta.url)),pageTitle:"Note"},{path:"notifications",lazy:A1(()=>M1(()=>import("./index-d_UH71zm.js"),__vite__mapDeps([10,11,12,13]),import.meta.url)),pageTitle:"Notifications"},{path:"explore",lazy:A1(()=>M1(()=>import("./index-Do091GLu.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"explore/:topic",lazy:A1(()=>M1(()=>import("./index-Do091GLu.js"),__vite__mapDeps([14,4,15]),import.meta.url)),pageTitle:"Explore"},{path:"profile",lazy:A1(()=>M1(()=>import("./index-Cl2eSBwg.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"profile/likes",lazy:A1(()=>M1(()=>import("./index-Cl2eSBwg.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"profile/following",lazy:A1(()=>M1(()=>import("./index-Cl2eSBwg.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"profile/followers",lazy:A1(()=>M1(()=>import("./index-Cl2eSBwg.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"profile/:handle/:tab?",lazy:A1(()=>M1(()=>import("./index-Cl2eSBwg.js"),__vite__mapDeps([16,17,18,19,11,20,21,22,23,24,25,26,8,6,1,27,12,28,13,15,3,29]),import.meta.url)),pageTitle:"Profile"},{path:"preferences",lazy:A1(()=>M1(()=>import("./index-CZ3lARQ2.js"),__vite__mapDeps([30,31,27,26,29,18,19,11]),import.meta.url)),pageTitle:"Preferences"},{path:"preferences/moderation",lazy:A1(()=>M1(()=>import("./moderation-Ci9UNwiZ.js"),__vite__mapDeps([32,20,21,22,23,24,11,25,26,8,6,1,17,27,12,28,13,15,3]),import.meta.url)),pageTitle:"Moderation",showBackButton:!0},{path:"preferences/bluesky-sharing",lazy:A1(()=>M1(()=>import("./bluesky-sharing-BBmDBlxr.js"),__vite__mapDeps([33,18,19,11,26]),import.meta.url)),showBackButton:!0},{path:"welcome",lazy:A1(()=>M1(()=>Promise.resolve().then(()=>co0),void 0,import.meta.url)),pageTitle:"Welcome",children:[{path:"",element:z.jsx(qn,{to:"1",replace:!0})},{path:"1",lazy:A1(()=>M1(()=>import("./step-1-CNbdmB8C.js"),__vite__mapDeps([34,26]),import.meta.url))},{path:"2",lazy:A1(()=>M1(()=>import("./step-2-Ddrl2uae.js"),__vite__mapDeps([35,36,13,28]),import.meta.url))},{path:"3",lazy:A1(()=>M1(()=>import("./step-3-CbqkEtwh.js"),__vite__mapDeps([37,36,13,28,23,6,8]),import.meta.url))},{path:"*",element:z.jsx(qn,{to:"1",replace:!0})}]},{path:"*",lazy:A1(()=>M1(()=>Promise.resolve().then(()=>Oo0),void 0,import.meta.url))}]}];function Ao0(){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 xp({path:e,activeOnSubpath:t=!1}){const o=t&&e?`${e}/*`:e;return yI(o||"")!==null}function H0({children:e,...t}){return z.jsx(gd,{...t,children:e})}function ho0({to:e,target:t,rel:o,activeOnSubpath:n=!1,isActive:r,children:a,...i}){const b=`#/${e?.replace(/^\/?#\//,"")}`,l=xp({path:e,activeOnSubpath:n}),u=r!==void 0?r:l,{isMobile:f,setOpenMobile:O}=Vn(),h=()=>{f&&O(!1)};return z.jsx(k3,{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 qo0({children:e,...t}){return z.jsx("span",{...t,children:e})}function mo0({onClick:e,children:t,...o}){const{isMobile:n,setOpenMobile:r}=Vn(),a=()=>{n&&r(!1),e?.()};return z.jsx(k3,{onClick:a,...o,children:t})}H0.Link=ho0;H0.Label=qo0;H0.Button=mo0;function go0({...e}){const{data:t}=ve(),{data:o}=V3(),n=Et(o?.settings,"social_web_enabled")??!1,a=B3().data?.site.url,{data:i=0}=_g(t?.slug||"",n),b=xp({path:"network",activeOnSubpath:!0}),l=xp({path:"activitypub",activeOnSubpath:!0}),u=i>0&&!b&&!l;return!t||!t00(t)?null:z.jsx(ec,{...e,children:z.jsx(Ha,{children:z.jsxs(tc,{children:[z.jsx(H0,{children:z.jsxs(H0.Link,{to:"analytics",activeOnSubpath:!0,children:[z.jsx(J8,{}),z.jsx(H0.Label,{children:"Analytics"})]})}),n&&z.jsxs(H0,{children:[z.jsxs(H0.Link,{to:"network",isActive:b||l,children:[z.jsx(Ao0,{}),z.jsx(H0.Label,{children:"Network"})]}),u&&z.jsx(Wd,{children:i})]}),z.jsxs(H0,{className:"relative group/viewsite",children:[z.jsxs(H0.Link,{to:"site",children:[z.jsx(X$,{}),z.jsx(H0.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(ed,{size:16})})]})]})})})}function Wo0({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 Dg="MembersResponseType",vo0=jn({dataType:Dg,path:"/members/"}),gr0=_7({dataType:Dg,path:e=>`/members/${e}/`}),Wr0=Vt({method:"POST",path:({id:e})=>`/members/${e}/commenting/disable`,body:({reason:e,hideComments:t})=>({reason:e,hide_comments:t}),invalidateQueries:{dataType:"CommentsResponseType"}}),vr0=Vt({method:"POST",path:({id:e})=>`/members/${e}/commenting/enable`,body:()=>({}),invalidateQueries:{dataType:"CommentsResponseType"}});function Ro0(){const{data:e}=vo0({searchParams:{limit:"1"}});return e?.meta?.pagination.total}const yo0=()=>H3({select:e=>e.navigation}),wo0=()=>{const{mutateAsync:e}=U3();return Y1({mutationFn:async t=>{await e({navigation:t})}})},Lo0=e=>{const{data:t}=yo0(),{mutateAsync:o}=wo0();return[t?.expanded[e]??!0,async a=>o({expanded:{[e]:a}})]},ko0=yp({name:n2(),route:n2(),color:n2(),icon:n2().optional(),filter:Z20(n2(),n2().nullable())}),xo0=Ld(ko0);function Co0(e){return{midgrey:"#7C8B9A",blue:"#14b8ff",green:"#30cf43",red:"#f50b23",teal:"#4dcddc",purple:"#8e42ff",yellow:"#ffb41f",orange:"#fe8b05",pink:"#fb2d8d"}[e]||"#7C8B9A"}function No0({route:e="posts"}){const{data:t}=V3(),o=Dm(),n=p.useMemo(()=>{const r=Et(t?.settings,"shared_views")??"[]";try{const a=JSON.parse(r),i=xo0.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(H0,{children:z.jsxs(H0.Link,{className:"pl-9",to:a,isActive:i,children:[z.jsx(H0.Label,{className:"grow",children:r.name}),z.jsx("span",{className:"size-2 rounded-full shrink-0 mx-0.5",style:{backgroundColor:Co0(r.color)},"data-color":r.color,"aria-hidden":"true"})]})},a)})})}const Xd=e=>{const{data:t}=Ua();return t?.config.labs?.[e]??!1};function Bo0({...e}){const{data:t}=ve(),[o,n]=Lo0("posts"),r=Ro0(),a=Dm(),i=Xd("commentModeration"),b=t&&e00(t),l=t&&JJ(t);return z.jsx(ec,{...e,children:z.jsx(Ha,{children:z.jsxs(tc,{children:[z.jsxs(H0,{children:[z.jsx(e1,{"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(Ju,{size:16,className:`transition-all ${o&&"rotate-[90deg]"}`})}),z.jsxs(H0.Link,{to:a.getRouteUrl("posts"),isActive:a.isRouteActive("posts"),children:[z.jsx(Q8,{className:"opacity-0 sidebar:opacity-100 sidebar:group-hover/menu-item:opacity-0 pointer-events-none transition-all"}),z.jsx(H0.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($8,{size:20,className:"!stroke-[1.5px] mt-px"})})]}),z.jsxs(Wo0,{isExpanded:o,id:"posts-submenu",children:[z.jsx(H0,{children:z.jsx(H0.Link,{className:"pl-9",to:"posts?type=draft",isActive:a.isRouteActive("posts",{type:"draft"}),children:z.jsx(H0.Label,{children:"Drafts"})})}),z.jsx(H0,{children:z.jsx(H0.Link,{className:"pl-9",to:"posts?type=scheduled",isActive:a.isRouteActive("posts",{type:"scheduled"}),children:z.jsx(H0.Label,{children:"Scheduled"})})}),z.jsx(H0,{children:z.jsx(H0.Link,{className:"pl-9",to:"posts?type=published",isActive:a.isRouteActive("posts",{type:"published"}),children:z.jsx(H0.Label,{children:"Published"})})}),z.jsx(No0,{})]}),z.jsx(H0,{children:z.jsxs(H0.Link,{to:a.getRouteUrl("pages"),isActive:a.isRouteActive("pages"),children:[z.jsx(hZ,{}),z.jsx(H0.Label,{children:"Pages"})]})}),b&&z.jsx(H0,{children:z.jsxs(H0.Link,{to:"tags",isActive:a.isRouteActive(["tags","tag","tag.new"]),children:[z.jsx(tG,{}),z.jsx(H0.Label,{children:"Tags"})]})}),l&&z.jsxs(H0,{children:[z.jsxs(H0.Link,{to:a.getRouteUrl("members"),isActive:a.isRouteActive(["members","member","member.new"]),children:[z.jsx(e9,{}),z.jsx(H0.Label,{children:"Members"})]}),r!=null&&z.jsx(Wd,{children:r})]}),l&&i&&z.jsx(H0,{children:z.jsxs(H0.Link,{to:"comments",activeOnSubpath:!0,children:[z.jsx(TZ,{}),z.jsx(H0.Label,{children:"Comments"})]})})]})})})}const Vf=function(){let t,o;return{promise:new Promise((r,a)=>{t=r,o=a}),resolve:t,reject:o}},Al="https://do.featurebase.app/js/sdk.js",_o0="Feature Request";let Kc=null;function Eo0(){return Kc||(Kc=new Promise((e,t)=>{if(document.querySelector(`script[src="${Al}"]`)){e();return}const n=document.createElement("script");n.src=Al,n.onload=()=>e(),n.onerror=r=>{n.remove(),Kc=null;const a=new Error(`[Featurebase] Failed to load SDK from ${Al}`,{cause:r});console.error(a),t(a)},document.head.appendChild(n)})),Kc}function So0(){const{data:e}=Ua(),{data:t}=H3(),o=Xd("featurebaseFeedback"),[n,r]=p.useState(!1),{organization:a,enabled:i}=e?.config.featurebase??{},b=!!(o&&i),l=t?.nightShift?"dark":"light",{data:u}=TJ({enabled:b&&n}),f=u?.featurebase?.token;p.useEffect(()=>{n&&Eo0().catch(g=>{console.error("[Featurebase] Failed to load SDK:",g)})},[n]);const O=p.useRef(Vf());p.useEffect(()=>{!n||!a||!f||Kc?.then(()=>{window.Featurebase?.("initialize_feedback_widget",{organization:a,theme:l,defaultBoard:_o0,featurebaseJwt:f},g=>{g?(console.error("[Featurebase] Failed to initialize widget:",g),O.current.reject(g),O.current=Vf(),r(!1)):O.current.resolve()})})},[a,l,f,n]);const h=p.useCallback(()=>{b&&r(!0)},[b]);return{openFeedbackWidget:p.useCallback(g=>{b&&(r(!0),O.current.promise.then(()=>{window.postMessage({target:"FeaturebaseWidget",data:{action:"openFeedbackWidget",...g?.board&&{setBoard:g.board}}},"*")}))},[b]),preloadFeedbackWidget:h}}function To0({...e}){const{data:t}=ve(),{data:o}=Ua(),n=Xd("featurebaseFeedback"),{openFeedbackWidget:r,preloadFeedbackWidget:a}=So0();if(!t)return null;const b=o?.config.hostSettings?.billing?.enabled&&Qa(t),l=n&&!N3(t)&&o?.config.featurebase?.enabled;return!b&&!l?null:z.jsx(ec,{...e,children:z.jsx(Ha,{children:z.jsxs(tc,{children:[b&&z.jsx(H0,{children:z.jsxs(H0.Link,{to:"pro",children:[z.jsx(bZ,{}),z.jsx(H0.Label,{children:"Ghost(Pro)"})]})}),l&&z.jsx(H0,{children:z.jsxs(H0.Button,{onClick:r,onMouseEnter:a,onFocus:a,children:[z.jsx(td,{}),z.jsx(H0.Label,{children:"Feedback"})]})})]})})})}function Po0({...e}){const{data:t}=ve(),o=t&&YJ(t);return z.jsx(ec,{...e,children:z.jsx(Ha,{children:z.jsxs(tc,{children:[o&&z.jsx(H0,{children:z.jsxs(H0.Link,{to:"settings",children:[z.jsx(G8,{}),z.jsx(H0.Label,{children:"Settings"})]})}),z.jsx(H0,{children:z.jsxs(H0.Link,{to:"https://ghost.org/help?utm_source=admin&utm_campaign=help",target:"_blank",rel:"noopener noreferrer",children:[z.jsx(cZ,{}),z.jsx(H0.Label,{children:"Help"})]})})]})})})}const Xo0=""+new URL("ghost-pro-logo-B1sXD_MX.png",import.meta.url).href;function jo0({trialDaysRemaining:e}){return z.jsxs(pd,{variant:"gradient",size:"lg",className:"mx-2 my-5 flex flex-col items-stretch",children:[z.jsx("div",{children:z.jsx("img",{src:Xo0,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(e1,{asChild:!0,children:z.jsx("a",{href:"#/pro/billing/plans",children:"Upgrade now"})})]})}function Do0(){const{showUpgradeBanner:e,trialDaysRemaining:t}=gg();return z.jsxs(Cm,{className:"px-3 pt-4 justify-between",children:[z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[z.jsx(go0,{}),z.jsx(Bo0,{}),z.jsx(To0,{})]}),z.jsxs("div",{className:"flex flex-col gap-2 sidebar:gap-4",children:[e?z.jsx(jo0,{trialDaysRemaining:t}):z.jsx(wt0,{}),z.jsx(Po0,{className:"pb-0"})]})]})}function Io0({...e}){return z.jsxs(ym,{...e,children:[z.jsx(a00,{className:"px-5 pt-6 pb-0"}),z.jsx(Do0,{}),z.jsx(yt0,{className:"p-3 gap-0"})]})}const Li=1.5;function hl({to:e,activeOnSubpath:t=!1,children:o,...n}){const r=xp({path:e,activeOnSubpath:t});return z.jsx(e1,{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 Fo0(){const{isMobile:e}=Vn(),t=jm();return!e||!t?z.jsx(z.Fragment,{}):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(hl,{activeOnSubpath:!0,to:"analytics",children:[z.jsx(J8,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Analytics"})]}),z.jsxs(hl,{activeOnSubpath:!0,to:"posts",children:[z.jsx(Q8,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Posts"})]}),z.jsxs(hl,{activeOnSubpath:!0,to:"members",children:[z.jsx(e9,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Members"})]}),z.jsxs(wm,{className:"rounded-full px-8 h-9 hover:bg-transparent",children:[z.jsx(V8,{strokeWidth:Li}),z.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})]})})}function Ho0({children:e}){const{data:t}=ve(),o=jm();return t&&N3(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(Rt0,{})})]}):z.jsxs(Rm,{open:!!t&&o,children:[z.jsx(Io0,{}),z.jsxs(Lm,{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(Fo0,{})]})]})}function Uo0(){const{data:e}=ve();return HJ(),FJ(),z.jsx(PJ,{children:e?z.jsxs(Ho0,{children:[z.jsx(yn,{}),z.jsx(Of,{})]}):z.jsxs(z.Fragment,{children:[z.jsx(dz,{}),z.jsx(Of,{})]})})}const Ig=p.createContext(void 0),Rr0=()=>{const e=p.useContext(Ig);if(e===void 0)throw new Error("useAppContext must be used within an AppProvider");return e},Vo0=({children:e,value:t})=>{const o=p.useContext(Zz),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(Ig.Provider,{value:r,children:e})},Qo0=[{path:"",errorElement:z.jsx(gp,{onBackToDashboard:()=>{}}),children:[{path:"posts/analytics/:postId",lazy:async()=>{const[{default:e},{default:t}]=await Promise.all([M1(()=>import("./post-analytics-context-CEqWyqgm.js").then(o=>o.p),__vite__mapDeps([38,39]),import.meta.url),M1(()=>import("./post-analytics-c8kRV0YB.js"),__vite__mapDeps([40,41,42,39,38]),import.meta.url)]);return{element:z.jsx(e,{children:z.jsx(t,{})})}},children:[{path:"",lazy:A1(()=>M1(()=>import("./overview-CWQPNOF0.js"),__vite__mapDeps([43,44,45,24,46,47,48,49,50,51,42,38,39,52,3,15,53,54,55,22,23,11,25,26,8,6,1,17,27,12,28,13,56,20,21,5,57,58,59,60]),import.meta.url))},{path:"web",lazy:A1(()=>M1(()=>import("./web-C39IKnvl.js"),__vite__mapDeps([61,62,25,38,39,53,54,24,55,45,46,22,23,11,26,8,6,1,17,27,12,28,13,15,3,56,48,49,20,21,63,51,42,52,64,5]),import.meta.url))},{path:"growth",lazy:A1(()=>M1(()=>import("./growth-CQceZQ1g.js").then(e=>e.g),__vite__mapDeps([57,5,24,54,55,45,58,44,51,42,38,39,52,3,15,59,60]),import.meta.url))},{path:"newsletter",lazy:A1(()=>M1(()=>import("./newsletter-DnrS7Fvi.js"),__vite__mapDeps([65,45,24,66,22,23,11,25,26,8,6,1,17,27,12,28,13,15,3,20,21,44,51,42,38,39,52,46,47,48,49,50,60]),import.meta.url))}]},{path:"tags",children:[{index:!0,lazy:A1(()=>M1(()=>import("./tags-BsDlfsPN.js"),__vite__mapDeps([67,31,68,41,58,17,5]),import.meta.url))},{path:":tagSlug",element:null}]},{path:"comments",lazy:A1(()=>M1(()=>import("./comments-OXqhcC0t.js"),__vite__mapDeps([69,64,25,39,68,41,70,19,13,5]),import.meta.url))},{path:"*",element:z.jsx(gp,{onBackToDashboard:()=>{}})}]}],$o0={today:{name:"Today",value:1},last7Days:{name:"Last 7 days",value:7},last30Days:{name:"Last 30 days",value:31},last3Months:{name:"Last 90 days",value:91},yearToDate:{name:"Year to date",value:-1},last12Months:{name:"Last 12 months",value:372},allTime:{name:"All time",value:1e3}},Zo0=Object.values($o0),Go0=2,yr0={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",unknown:"Unknown",Others:"Unknown",Other:"Unknown",NULL:"Unknown","ᴺᵁᴸᴸ":"Unknown"},wr0=["NULL","ᴺᵁᴸᴸ","","Others","Other"],Lr0="https://static.ghost.org/v5.0.0/images/globe-icon.svg",Tr={PUBLIC:1,FREE:2,PAID:4},kr0=Tr.PUBLIC|Tr.FREE|Tr.PAID,xr0=[{name:"Public visitors",value:"undefined",bit:Tr.PUBLIC},{name:"Free members",value:"free",bit:Tr.FREE},{name:"Paid members",value:"paid",bit:Tr.PAID}],Fg=p.createContext(void 0),Cr0=()=>{const e=p.useContext(Fg);if(e===void 0)throw new Error("useGlobalData must be used within a GlobalDataProvider");return e},Ko0=({children:e})=>{const t=V3(),o=B3(),n=Ua(),r=n.data?.config,a=!!r?.stats,i=fD({enabled:a}),[b,l]=p.useState(Zo0[Go0].value),[u,f]=p.useState(null),O=[n,t,o],h=O.map(x=>x.error).find(Boolean),m=a?i.error:null,g=h||m,W=O.some(x=>x.isLoading),v=a?i.isLoading:!1,y=W||v;if(g)throw g;const L={url:o.data?.site.url,icon:o.data?.site.icon,title:o.data?.site.title};return z.jsx(Fg.Provider,{value:{data:r,site:L,statsConfig:r?.stats,tinybirdToken:i.token,isLoading:y,range:b,setRange:l,settings:t.data?.settings||[],selectedNewsletterId:u,setSelectedNewsletterId:f},children:e})},Yo0=[{path:"analytics",children:[{index:!0,lazy:A1(()=>M1(()=>import("./index-rluYcfd-.js"),__vite__mapDeps([71,72,62,25,45,24,15,22,23,11,26,8,6,1,17,27,12,28,13,3,5,42,52,56,48,49,73,74,60,59,39]),import.meta.url))},{path:"web",lazy:A1(()=>M1(()=>import("./index-DJDgMk-T.js"),__vite__mapDeps([75,72,62,25,45,24,15,22,23,11,26,8,6,1,17,27,12,28,13,3,63,46,5,66,76,55,64,73,60,20,21,56,48,49]),import.meta.url))},{path:"growth",lazy:A1(()=>M1(()=>import("./index-D8syEvSm.js"),__vite__mapDeps([77,72,62,25,45,24,15,22,23,11,26,8,6,1,17,27,12,28,13,3,5,56,48,49,20,21,73,78,58,76,59,55,60,79,50,74]),import.meta.url))},{path:"newsletters",lazy:A1(()=>M1(()=>import("./index-B1rKIiOr.js"),__vite__mapDeps([80,72,62,25,45,24,15,22,23,11,26,8,6,1,17,27,12,28,13,3,48,49,5,56,20,21,78,58,81,60]),import.meta.url))}]}],Jo0=[{element:z.jsx($J,{}),children:[{path:"/tags/:tagSlug",Component:dz,handle:{allowInForceUpgrade:!0}},{element:z.jsx(Vo0,{value:{fromAnalytics:!0},children:z.jsx(yn,{})}),children:Qo0[0].children.filter(e=>e.path!=="*")},{element:z.jsx(Ko0,{children:z.jsx(yn,{})}),children:Yo0},{path:"network",loader:()=>UD("/activitypub")},{path:"",element:z.jsx(Lt0,{children:z.jsx(yn,{})}),children:jg},{path:"settings/*",lazy:A1(()=>M1(()=>import("./settings-BqaVcJee.js").then(e=>e.bo),__vite__mapDeps([82,21,81,39,79]),import.meta.url)),handle:{allowInForceUpgrade:!0}},{path:"*",Component:dz,handle:{allowInForceUpgrade:!0}}]}],en0=["http:","https:","mailto:","tel:"];function tn0(e){if(e.match(/^[a-z]+:/i))try{const t=new URL(e);return en0.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 on0({children:e}){const{data:t}=V3(),o=p.useMemo(()=>{if(!t?.settings)return;const n=t.settings;return{paidMembersEnabled:Et(n,"paid_members_enabled")??!1,newslettersEnabled:Et(n,"editor_default_email_recipients")!=="disabled",analytics:{emailTrackOpens:Et(n,"email_track_opens")??!1,emailTrackClicks:Et(n,"email_track_clicks")??!1,membersTrackSources:Et(n,"members_track_sources")??!1,outboundLinkTagging:Et(n,"outbound_link_tagging")??!1,webAnalytics:Et(n,"web_analytics_enabled")??!1}}},[t]);return z.jsx(pL,{appSettings:o,children:e})}const nn0={ghostVersion:"",externalNavigate:e=>{tn0(e.route)},unsplashConfig:{Authorization:"Client-ID 8672af113b0a8573edae3aa3713886265d9bb741d707f6c01a486cde8c278980","Accept-Version":"v1","Content-Type":"application/json","App-Pragma":"no-cache","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)}};Ev.createRoot(document.getElementById("root")).render(z.jsx(p.StrictMode,{children:z.jsx(iL,{...nn0,children:z.jsx(NJ,{prefix:"/",routes:Jo0,children:z.jsx(on0,{children:z.jsx(MK,{className:"shade-admin",darkMode:!1,fetchKoenigLexical:null,children:z.jsx(Uo0,{})})})})})}));export{U8 as $,To as A,e1 as B,Ju as C,q3 as D,Qc as E,no0 as F,er0 as G,m2 as H,tr0 as I,rr0 as J,cr0 as K,do0 as L,or0 as M,nr0 as N,LJ as O,Bo as P,oJ as Q,nJ as R,w1 as S,F$ as T,kp as U,ge as V,Or0 as W,cd as X,fr0 as Y,Ar0 as Z,Bm as _,n3 as a,Hp as a$,bK as a0,o9 as a1,n9 as a2,c9 as a3,a9 as a4,r9 as a5,i9 as a6,s9 as a7,h3 as a8,b9 as a9,U0 as aA,Pp as aB,M1 as aC,CA as aD,W1 as aE,OL as aF,DA as aG,Z1 as aH,Ua as aI,B3 as aJ,V3 as aK,fD as aL,D$ as aM,Sn0 as aN,yn as aO,_m as aP,Nn0 as aQ,pm as aR,kJ as aS,Op as aT,Rr0 as aU,Wn0 as aV,Rn0 as aW,kr0 as aX,xr0 as aY,Tr as aZ,$o as a_,bd as aa,LZ as ab,jn as ac,Vt as ad,_7 as ae,vn0 as af,dn0 as ag,y0 as ah,hn0 as ai,Yu as aj,bD as ak,En0 as al,Im as am,Gt as an,J8 as ao,sm as ap,Ah as aq,Pn as ar,y2 as as,H2 as at,O1 as au,qh as av,PP as aw,XP as ax,L0 as ay,s2 as az,Kt as b,XY as b$,fh as b0,Q2 as b1,MX as b2,Ra as b3,ya as b4,dt as b5,fu as b6,Ou as b7,Kp as b8,Xr as b9,gm as bA,sJ as bB,iJ as bC,pJ as bD,tJ as bE,An0 as bF,un0 as bG,am as bH,qd as bI,im as bJ,rd as bK,Jr as bL,Au as bM,V8 as bN,Cn0 as bO,kn as bP,Nm as bQ,cf as bR,On0 as bS,Oa as bT,Tn as bU,Cr0 as bV,an0 as bW,gn0 as bX,qn as bY,hr0 as bZ,PY as b_,Zp as ba,$r as bb,Up as bc,Vp as bd,Y$ as be,Go as bf,Pd as bg,Bd as bh,eZ as bi,dZ as bj,sr0 as bk,Ft0 as bl,Et0 as bm,Xg as bn,zr0 as bo,oc as bp,gZ as bq,lr0 as br,U$ as bs,Uc as bt,Ri as bu,ad as bv,sd as bw,id as bx,rJ as by,Bn0 as bz,Vc as c,td as c$,jY as c0,lm as c1,Hn0 as c2,Un0 as c3,Gm as c4,ur0 as c5,Y8 as c6,pG as c7,w3 as c8,hK as c9,qn0 as cA,$o0 as cB,yZ as cC,af as cD,bZ as cE,Bz as cF,Zo0 as cG,r2 as cH,lK as cI,Ml as cJ,OK as cK,Mr0 as cL,ar0 as cM,br0 as cN,Cp as cO,wr0 as cP,yr0 as cQ,Q8 as cR,mn0 as cS,Lr0 as cT,yn0 as cU,lo0 as cV,vo0 as cW,sZ as cX,gr0 as cY,Wr0 as cZ,vr0 as c_,yp as ca,Hf as cb,Uf as cc,qr0 as cd,mr0 as ce,n2 as cf,$t0 as cg,kn0 as ch,e9 as ci,tG as cj,Re as ck,Nu as cl,_u as cm,_a as cn,Ea as co,od as cp,_Y as cq,EY as cr,$8 as cs,Mm as ct,bm as cu,v$ as cv,wn0 as cw,Ln0 as cx,fn0 as cy,fZ as cz,yi as d,$j as d$,EZ as d0,Lg as d1,Kt0 as d2,ir0 as d3,pr0 as d4,rn0 as d5,wv as d6,OC as d7,n6 as d8,C7 as d9,Kl as dA,Qa as dB,Tn0 as dC,Fm as dD,Pn0 as dE,jn0 as dF,YJ as dG,Hm as dH,Dn0 as dI,C3 as dJ,$A as dK,in0 as dL,UT as dM,c6 as dN,a6 as dO,Fz as dP,RP as dQ,xh as dR,HP as dS,kX as dT,xX as dU,CX as dV,Jh as dW,s7 as dX,i7 as dY,p7 as dZ,jL as d_,Vn0 as da,Gn0 as db,Gb as dc,bn0 as dd,ln0 as de,Iz as df,In0 as dg,cD as dh,Zr as di,ha as dj,Zn0 as dk,U2 as dl,XJ as dm,jJ as dn,DJ as dp,Et as dq,RT as dr,Fn0 as ds,n00 as dt,Yn0 as du,$n0 as dv,Qn0 as dw,K1 as dx,t00 as dy,Xn0 as dz,p0 as e,Mn0 as e0,Zj as e1,k7 as e2,Jp as e3,ca as e4,ve as e5,zn0 as e6,d1 as e7,GR as e8,_n0 as e9,nd as eA,sG as eB,T$ as eC,ZJ as ea,Kn0 as eb,N3 as ec,NA as ed,sn0 as ee,jA as ef,X$ as eg,Z$ as eh,Q$ as ei,nZ as ej,cZ as ek,pZ as el,hZ as em,vZ as en,xZ as eo,NZ as ep,TZ as eq,XZ as er,DZ as es,HZ as et,Z8 as eu,$Z as ev,G8 as ew,KZ as ex,K8 as ey,cG as ez,mp as f,So as g,yo as h,Jn0 as i,z as j,Sg as k,dr0 as l,Nd as m,Sd as n,Hi as o,_d as p,p9 as q,p as r,Cz as s,Da as t,xI as u,Md as v,ld as w,ed as x,q0 as y,Ba as z};
|