
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="88bd28f7-9734-5f22-8478-5a175407f422")}catch(e){}}();
import{j as e}from"./jsx-runtime-BjG_zV1W.js";import{a as D,v as st,r as i,e as at,u as nt,O as rt,K as ot,J as Le}from"./index-D6da9p6-.js";import{_ as F,n as ae,I as it}from"./index-CqJN8iQq.js";import{c as T}from"./index-x2da_zcv.js";import{g as _e,aO as lt,c as ct}from"./AppGlobals-2Br-8bZs.js";import{C as be,u as dt}from"./index-W4FP4Dma.js";import{u as N}from"./useTranslation-CfKJAmGY.js";import{g as mt,w as ut,_ as ht,u as I,M as xt,x as ft,S as pt,L as S,d as me,e as Oe,F as Be,c as gt}from"./components-1fH5YjVo.js";import{F as Z}from"./index-BMPF7XpZ.js";import{B as A}from"./index-BxYGUTX4.js";import{T as y}from"./index-CJHGmWl4.js";import{u as E,S as Me,W as vt}from"./WebThemeContext-DttfuZxo.js";import{P as De}from"./PoweredByBeehiiv-BmLCj73J.js";import{S as ze,C as wt,c as qe,B as bt}from"./CreateAction-Ch8S9hjY.js";import{S as jt,m as O,T as _t,D as yt,C as V}from"./popover-GFMioMmp.js";import{u as G}from"./useIsLoggedIn-BA0Ud5Qu.js";import{T as Nt,L as kt,Y as St,a as Et,F as Pt,I as Ct}from"./YoutubeIcon-DSouMQiN.js";import{I as ye}from"./Image-ycA_AFLr.js";import{T as v}from"./index-BdpAPpdN.js";import{M as Lt}from"./index-DIU-Hrs1.js";import{B as L}from"./index-DFtJ8-cK.js";import{q as P,F as Mt}from"./XMarkIcon-DGYkrnTx.js";import{q as re}from"./transition-jWlQb9Jg.js";import{L as Ge,u as ue,r as Tt,F as Rt,S as Ft,b as It,a as $t}from"./useSetLastViewedResource-BWhmbnGz.js";import{g as he}from"./index-DcpNk-OI.js";import{F as He}from"./ChevronDownIcon-CCywpT3m.js";import{F as At}from"./XMarkIcon-Y2tO3Ykg.js";import{_ as Te}from"./dialog-Bw_il7y1.js";import{P as Wt}from"./index-BC-wdBIs.js";import{a as Ot,L as Bt,P as Dt}from"./PageProvider-UC5x2LAl.js";import{M as zt}from"./index-IxBbnf-Q.js";import{u as Ue}from"./useIsMobile-onEuuMFV.js";import{t as ge}from"./i18next-BV1g0mjb.js";import{A as ve}from"./disclosure-BMs2P2An.js";import{F as Re}from"./SparklesIcon-DA4hsc2a.js";import{u as qt}from"./useSignupRedirects-BFAE3Ey4.js";import{F as Gt}from"./CheckIcon-681VH8qr.js";import{u as Ht}from"./useTypedLoaderData-CKNseont.js";import{u as Ut}from"./useWebBuilderCommunicator-DoXoLq6Y.js";import{w as Zt}from"./performance-dfU_ZKaW.js";import"./context-CxfOs_9L.js";import"./StatusInputs-JkVhk_jg.js";import"./useToast-DK42uF07.js";import"./use-root-containers-DR-ugUuM.js";import"./keyboard-CaEu2o0u.js";import"./use-owner-vBDpJPdh.js";import"./use-is-mounted-BaHv16bB.js";import"./hidden-KuoXmiN5.js";import"./bugs-DVQzBh-s.js";import"./use-text-value-DhB3dK_j.js";import"./use-tree-walker-Inv4mdsP.js";import"./LoginWithPasswordAction-CTGTbo_j.js";import"./Input-HUlJEznR.js";import"./RedirectToHiddenInput-mUb4yii7.js";import"./description-BklOXbF-.js";import"./index-DtTWVmOQ.js";/**
 * @remix-run/react v2.9.2
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */let Fe="positions";function Vt({getKey:t,...s}){let{isSpaMode:a}=mt(),n=D(),r=st();ut({getKey:t,storageKey:Fe});let o=i.useMemo(()=>{if(!t)return null;let c=t(n,r);return c!==n.key?c:null},[]);if(a)return null;let l=((c,d)=>{if(!window.history.state||!window.history.state.key){let u=Math.random().toString(32).slice(2);window.history.replaceState({key:u},"")}try{let f=JSON.parse(sessionStorage.getItem(c)||"{}")[d||window.history.state.key];typeof f=="number"&&window.scrollTo(0,f)}catch(u){console.error(u),sessionStorage.removeItem(c)}}).toString();return i.createElement("script",ht({},s,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${l})(${JSON.stringify(Fe)}, ${JSON.stringify(o)})`}}))}const Jt=(t,s)=>{t.postMessage(s)};function Yt(t={cacheType:"jit"}){const s=D(),a=i.useRef(null),n=i.useRef(!0);i.useEffect(()=>{const r=()=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{let o,l={location:s,isSsr:n.current};switch(t.cacheType){case"jit":default:o="REMIX_NAVIGATION";break;case"precache":o="REMIX_PRECACHE";break;case"custom":o=t.eventName,l={...l,...t.payload||{}}}((c,d)=>{"serviceWorker"in navigator&&navigator.serviceWorker.controller&&Jt(navigator.serviceWorker.controller,{type:c,payload:d})})(o,l)},25)};return r(),"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("controllerchange",r),()=>{a.current&&clearTimeout(a.current),"serviceWorker"in navigator&&navigator.serviceWorker.removeEventListener("controllerchange",r),n.current&&(n.current=!1)}},[s])}const Kt=({manifestUrl:t="/manifest.webmanifest"})=>at.createElement("link",{rel:"manifest",href:t});function Xt(t,...s){const a=new String(String.raw(t,...s));return a.__sentry_template_string__=t.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),a.__sentry_template_values__=s,a}const{REACT_APP_ADNETWORK_PIXELJS_URL:Qt}=_e(),es=()=>e.jsx("script",{src:Qt,async:!0}),ts=({pixelId:t,marketingCookies:s})=>(i.useEffect(()=>{try{if(t&&s){const a=document.createElement("script");a.id="facebook-pixel",a.async=!0,a.innerHTML=`
      (function(){try{
        !function(f,b,e,v,n,t,s)
        {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
        n.callMethod.apply(n,arguments):n.queue.push(arguments)};
        if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
        n.queue=[];t=b.createElement(e);t.async=!0;
        t.src=v;s=b.getElementsByTagName(e)[0];
        s.parentNode.insertBefore(t,s)}(window, document,'script',
        'https://connect.facebook.net/en_US/fbevents.js');
        fbq('init', "${t}");
        fbq("track", "PageView");
      }catch{/*swallow exception*/}})();
      `,document.head.appendChild(a)}}catch{}},[t,s]),null),ss=({pixelId:t,marketingCookies:s})=>(i.useEffect(()=>{try{if(t&&s){const a=document.createElement("script");a.async=!0,a.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,document.head.appendChild(a);const n=document.createElement("script");n.async=!0,n.id="ga-pixel",n.innerHTML=`
        (function(){try{
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', '${t}', {
          page_path: window.location.pathname,
        });
        }catch{/*swallow exception*/}})();
      `,document.head.appendChild(n)}}catch{}},[t,s]),null),as=({pixelId:t,marketingCookies:s})=>{const a=D();return i.useEffect(()=>{try{window.gtag&&window.gtag("config",t,{page_path:a.pathname})}catch{}},[a,t]),i.useEffect(()=>{try{if(t&&s){const n=document.createElement("script");n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,document.head.appendChild(n);const r=document.createElement("script");r.async=!0,r.id="ga-pixel",r.innerHTML=`
      (function(){try{
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
      }catch{/*swallow exception*/}})();
      `,document.head.appendChild(r)}}catch{}},[t,s]),null},ns=({pixelId:t,dataProcessingCookies:s})=>(i.useEffect(()=>{try{if(t&&s){const a=document.createElement("script");a.id="gtm-pixel",a.innerHTML=`
          (function(){try{
            (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
            new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
            'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
            })(window,document,'script','dataLayer','${t}');
          }catch{/*swallow exception*/}})();
            `,document.head.appendChild(a)}}catch{}},[t,s]),null),rs=({pixelId:t})=>(i.useEffect(()=>{try{if(t){const s=document.createElement("iframe");return s.src=`https://www.googletagmanager.com/ns.html?id=${t}`,s.height="0",s.width="0",s.style.display="none",s.style.visibility="hidden",document.head.appendChild(s),()=>{try{document?.body?.removeChild(s)}catch{}}}}catch{}},[t]),null),os=({pixelId:t,marketingCookies:s})=>{const a=D();return i.useEffect(()=>{try{window.ttq&&window.ttq.page()}catch{}},[a]),t&&s?e.jsx("script",{id:"tiktok-pixel",async:!0,dangerouslySetInnerHTML:{__html:`
         (function(){try{
              !function (w, d, t) {
                w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var i="https://analytics.tiktok.com/i18n/pixel/events.js";ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=i,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=i+"?sdkid="+e+"&lib="+t;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(o,a)};
                ttq.load('${t}');
              }(window, document, 'ttq');
          }catch{/*swallow exception*/}})();
              `}}):null},is=({pixelId:t,marketingCookies:s})=>{const a=D();return i.useEffect(()=>{try{window.twq&&window.twq("track","PageView")}catch{}},[a]),i.useEffect(()=>{try{if(t&&s){const n=document.createElement("script");n.id="twitter-pixel",n.async=!0,n.innerHTML=`
      (function(){try{
        !function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments);
        },s.version='1.1',s.queue=[],u=t.createElement(n),u.async=!0,u.src='//static.ads-twitter.com/uwt.js',
        a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,'script');
        // Insert Twitter Pixel ID and Standard Event data below
        twq('init','${t}');
      }catch{/*swallow exception*/}})();
            `,document.head.appendChild(n)}}catch{}},[t,s]),null};function K(){const[t,s]=i.useState("browser tab"),a=()=>{window.matchMedia("(display-mode: standalone)").matches&&s("standalone")};return i.useEffect(()=>(t!=="standalone"&&window.matchMedia("(display-mode: standalone)").matches&&s("standalone"),window.addEventListener("DOMContentLoaded",a),()=>{window.removeEventListener("DOMContentLoaded",a)}),[t]),t}const ls=({code:t})=>t?e.jsx("meta",{name:"google-site-verification",content:t}):null,cs=()=>{const t=_e();return i.useEffect(()=>{try{if(t.REACT_APP_HUMAN_ENABLED==="true"){const s=document.createElement("script");return s.src=t.REACT_APP_HUMAN_URL||"",s.async=!0,document.head.appendChild(s),()=>{document.head.removeChild(s)}}}catch{}},[]),null},ne=({children:t,title:s,publication:a,isProdEnv:n,rootStyles:r,cookies:o,cookiesSet:l})=>{const c=D(),{i18n:d}=N(),u=K(),[f]=I(),m=f.get("version")==="draft",h=f.has("tags")||f.has("q")&&c.pathname==="/",x=c.pathname==="/subscribe",p=c.pathname==="/",g=c.pathname.startsWith("/p/"),w=c.pathname.startsWith("/c/"),j=c.pathname.startsWith("/authors"),_=c.pathname.startsWith("/t/"),k=c.pathname==="/test_home_page",M=a?.enable_cookie_banner,C=o?.beehiiv_honey;let b=!M,R=!M;M&&(b=M&&C?JSON.parse(C)?.marketing||!1:!(M&&!C),R=M&&C?JSON.parse(C)?.dataProcessing||!1:!(M&&!C));const z=a?.facebook_pixel,q=a?.twitter_pixel,W=a?.tiktok_pixel,oe=a?.google_analytics_pixel,te=a?.google_analytics_4_pixel,H=a?.gtm_pixel,fe=a?.gsc_verification_code;let se="";x&&(se="bg-wt-subscribe_background text-wt-text-on-subscribe_background"),(p||g||w||j||_)&&(se="bg-wt-background text-wt-text-on-background");const pe=`width=device-width, initial-scale=1, shrink-to-fit=no${u==="standalone"?", user-scalable=no":""}`;return e.jsxs("html",{lang:d.language,className:"h-full antialiased",children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:pe}),e.jsx("meta",{name:"mobile-web-app-capable",content:"yes"}),e.jsx("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),e.jsx("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"}),e.jsx("meta",{name:"theme-color",content:"#000000"}),e.jsx(lt,{}),e.jsx(cs,{}),s?e.jsx("title",{children:s}):null,a?.web_template?.pwa_enabled&&e.jsxs(e.Fragment,{children:[e.jsx("script",{dangerouslySetInnerHTML:{__html:`
window.addEventListener("beforeinstallprompt", (e) => {
  e.preventDefault();
  window.__DeferredPrompt__ = e;
});
          `}}),e.jsx(Kt,{})]}),e.jsx(xt,{}),e.jsx("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:r}}),e.jsx("link",{rel:"apple-touch-icon",href:a?.logo?.thumb?.url}),e.jsx("link",{rel:"apple-touch-startup-image",href:a?.thumbnail?.url}),e.jsx(ft,{}),n&&e.jsxs(be,{fallbackRender:()=>null,children:[e.jsx(ls,{code:fe}),e.jsx(ns,{dataProcessingCookies:R,pixelId:H}),e.jsx(ts,{marketingCookies:b,pixelId:z}),e.jsx(is,{marketingCookies:b,pixelId:q}),e.jsx(os,{marketingCookies:b,pixelId:W}),e.jsx(ss,{marketingCookies:b,pixelId:te}),e.jsx(as,{marketingCookies:b,pixelId:oe})]}),e.jsx(es,{}),w&&e.jsx("script",{type:"text/javascript",async:!0,src:"https://embeds.beehiiv.com/attribution.js"})]}),e.jsxs("body",{suppressHydrationWarning:!0,className:T("flex h-full flex-col",se),children:[n&&e.jsx(be,{fallbackRender:()=>null,children:e.jsx(rs,{dataProcessingCookies:R,pixelId:H})}),e.jsx("div",{className:T(m&&!k&&"pointer-events-none"),children:t}),!h&&!m&&e.jsx(Vt,{}),e.jsx(pt,{})]})]})},ds=({text:t,fontFamily:s})=>{const a=new Date().getFullYear(),{t:n}=N(),{webTheme:r}=E();return e.jsx(y,{weight:"light",className:"!text-xs",fontFamily:s,color:r.footer_text_color,children:n("footer.copyright_simple",{year:a,name:t})})},Ze=({fontFamily:t,utmSource:s,url:a,utmMedium:n,className:r,text:o})=>{const{webTheme:l}=E(),c=new URL(a);if(s){const u=Xt(s,"_");c.searchParams.append("utm_source",u)}n&&c.searchParams.append("utm_medium",n);const d=c.toString();return e.jsx("a",{href:d,target:"_blank",className:"whitespace-nowrap underline underline-offset-1 hover:opacity-80",rel:"noreferrer",style:{color:l.footer_text_color},children:e.jsx(y,{className:"!text-xs",weight:"light",fontFamily:t,color:l.footer_text_color,children:o})})},ms=({fontFamily:t,utmSource:s,utmMedium:a,className:n})=>{const{t:r}=N();return e.jsx(Ze,{fontFamily:t,className:n,utmSource:s,url:"https://beehiiv.com/tou",utmMedium:a,text:r("footer.terms_of_use")})},us=({textColor:t,fontFamily:s,utmSource:a,className:n})=>{const{t:r}=N();return e.jsx(Ze,{className:n,fontFamily:s,utmSource:a,url:"https://beehiiv.com/privacy",text:r("footer.privacy_policy")})};function hs({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15m-3 0-3-3m0 0 3-3m-3 3H15"}))}const Ie=i.forwardRef(hs);function xs({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const Ne=i.forwardRef(xs);function fs({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12a7.5 7.5 0 0 0 15 0m-15 0a7.5 7.5 0 1 1 15 0m-15 0H3m16.5 0H21m-1.5 0H12m-8.457 3.077 1.41-.513m14.095-5.13 1.41-.513M5.106 17.785l1.15-.964m11.49-9.642 1.149-.964M7.501 19.795l.75-1.3m7.5-12.99.75-1.3m-6.063 16.658.26-1.477m2.605-14.772.26-1.477m0 17.726-.26-1.477M10.698 4.614l-.26-1.477M16.5 19.794l-.75-1.299M7.5 4.205 12 12m6.894 5.785-1.149-.964M6.256 7.178l-1.15-.964m15.352 8.864-1.41-.513M4.954 9.435l-1.41-.514M12.002 12l-3.75 6.495"}))}const ps=i.forwardRef(fs);function gs({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"}))}const vs=i.forwardRef(gs);function ws({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 0 1-2.25 2.25M16.5 7.5V18a2.25 2.25 0 0 0 2.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 0 0 2.25 2.25h13.5M6 7.5h3v3H6v-3Z"}))}const bs=i.forwardRef(ws);function js({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const _s=i.forwardRef(js);function ys({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))}const Ns=i.forwardRef(ys);function ks({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"}))}const Ss=i.forwardRef(ks),xe=({href:t,children:s})=>t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:s}):e.jsx(S,{to:"/upgrade",prefetch:"intent",children:s}),ke=({children:t})=>e.jsx("div",{className:"flex grow basis-0 flex-col gap-y-3",children:t}),Se=({children:t})=>e.jsx("div",{className:"flex flex-col gap-y-2",children:t}),J=({path:t,text:s})=>{const{webTheme:a}=E();return e.jsx(S,{to:t,className:"sm:max-w-36 sm:text-wrap",children:e.jsx(y,{as:"p",size:"xs",weight:"regular",color:a.footer_text_color,fontFamilyv2:a.font_body,children:s})})},de=({text:t,color:s})=>{const{webTheme:a}=E();return e.jsx(y,{as:"p",size:"xs",weight:"semibold",color:s||a?.footer_text_color,fontFamilyv2:a?.font_header,children:t})},Es=({isPremiumEnabled:t,isLoggedIn:s,isReferralEnabled:a,publication:n,subscription:r})=>{const{t:o}=N(),{webTheme:l}=E();return e.jsxs(ke,{children:[e.jsx(de,{text:o("nav.mobile_sections.account")}),e.jsxs(Se,{children:[t&&e.jsx(xe,{href:n.web_template.external_upgrade_page_href,children:e.jsx(y,{as:"p",size:"xs",weight:"regular",color:l.footer_text_color,fontFamilyv2:l.font_body,children:o("nav.links.upgrade")})}),s&&r&&e.jsx(J,{path:`/subscribe/${r.id}/manage`,text:o("nav.links.manage")}),a&&r&&e.jsx(J,{path:`/subscribe/${r.id}/referrals`,text:o("nav.links.referrals")})]})]})},Ps=({hasMultiplePublications:t,hasAuthorsPage:s})=>{const{t:a}=N();return e.jsxs(ke,{children:[e.jsx(de,{text:a("nav.links.home")}),e.jsxs(Se,{children:[e.jsx(J,{path:"/",text:a("meta.titles.posts")}),t&&e.jsx(J,{path:"/publications",text:"Newsletters"}),s&&e.jsx(J,{path:"/authors",text:a("author.authors")})]})]})},Cs=({navGroups:t})=>{const{webTheme:s}=E();return e.jsx(e.Fragment,{children:t.map(a=>a.is_category_group||!a?.nav_links?.length?null:e.jsxs(ke,{children:[e.jsx(de,{text:a.title}),e.jsx(Se,{children:a?.nav_links?.map(o=>o.external_link?e.jsx("a",{style:{...s.footer_external_link_underline_color&&{color:s.footer_external_link_underline_color}},href:o.href,target:"_blank",rel:"nofollow noreferrer noopener",className:"underline",children:e.jsx(de,{text:o.cta_text,color:s?.footer_external_link_color})},o.id):e.jsx(J,{path:`/c/${o.href}`,text:o.cta_text},o.id))})]},a.id))})},Ls=({publication:t})=>{const{webTheme:s}=E();return e.jsxs("div",{className:"flex w-full flex-col items-center sm:items-start",children:[e.jsxs("div",{className:"flex items-center gap-x-2 py-4",children:[e.jsx("img",{src:t.logo.thumb.url,alt:t.description,width:40,height:40,className:T("overflow-hidden")}),e.jsx(y,{as:"p",size:"md",weight:"semibold",color:s?.footer_text_color,fontFamilyv2:s?.font_body,children:t.name})]}),e.jsx("div",{className:"text-center sm:text-left",children:e.jsx(y,{as:"p",size:"sm",weight:"regular",color:s?.footer_text_color,fontFamilyv2:s?.font_body,children:t.description})})]})},Ms=({publication:t,subscription:s,signupWidgetConfigs:a})=>{const{webTheme:n}=E(),{web_template:r,premium_enabled:o,has_referral_program:l}=t,c=G(),d=o,u=l,f=r?.multi_pub_ids?.length>=1,m=r?.author_ids?.length>=1,h=c||d,x=r.nav_groups?r.nav_groups.filter(p=>!p.is_category_group).slice(0,h?1:2):[];return e.jsx(A,{as:"footer",className:"py-8",style:{backgroundColor:n?.footer_background_color},children:e.jsxs("div",{className:"flex flex-col gap-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-y-6 sm:grid-cols-3",children:[e.jsx("div",{className:"sm:px-6",children:e.jsx(Ls,{publication:t})}),e.jsxs("div",{className:T("mx-auto hidden sm:flex sm:flex-row",x.length>0?"w-10/12":"w-1/2"),children:[e.jsx(Ps,{hasMultiplePublications:f,hasAuthorsPage:m}),h&&e.jsx(Es,{isPremiumEnabled:d,isLoggedIn:c,isReferralEnabled:u,publication:t,subscription:s}),e.jsx(Cs,{navGroups:x})]}),e.jsxs("div",{className:"flex flex-col items-center gap-y-4 sm:items-start sm:px-6",children:[e.jsx(ze,{signupStyles:a}),e.jsx(jt,{publication:t,bgColor:n?.footer_text_color,fillColor:n?.footer_background_color})]})]}),e.jsxs("div",{className:"flex w-full flex-col items-center gap-y-4 sm:flex-row sm:justify-between sm:px-6",children:[e.jsx("div",{className:"w-full text-center sm:w-1/2 sm:text-left",children:e.jsx(ds,{text:t?.copyright_text||t.name})}),e.jsxs("div",{className:"flex w-full flex-col items-center gap-y-4 sm:w-1/2 sm:flex-row sm:justify-end sm:gap-x-4",children:[e.jsxs("div",{className:"flex gap-x-2 sm:gap-x-5",children:[e.jsx(us,{}),e.jsx(ms,{})]}),e.jsx(De,{publication:t})]})]})]})})},Ts=()=>{const{publication:t,subscription:s,signupWidgetConfigs:a}=me("root");return e.jsx(Ms,{publication:t,subscription:s,signupWidgetConfigs:a})},Y=({path:t,text:s,asTitle:a=!1})=>e.jsx(S,{to:t,children:e.jsx(v,{as:"span",type:"body",theme:"navs",weight:"medium",className:"text-sm opacity-75 hover:text-wt-primary",children:s})}),Ee=({text:t})=>e.jsx(v,{as:"span",type:"title",theme:"navs",className:"text-md font-semibold sm:block",children:t}),Rs=({isPremiumEnabled:t,isLoggedIn:s,isReferralEnabled:a,publication:n,subscription:r})=>{const{t:o}=N();return e.jsxs("div",{className:"flex flex-col",children:[e.jsx(Ee,{text:o("nav.mobile_sections.account")}),e.jsxs("div",{className:"mb-2 flex flex-col",children:[t&&e.jsx(xe,{href:n.web_template.external_upgrade_page_href,children:e.jsx(v,{as:"span",type:"body",theme:"navs",weight:"medium",className:"text-sm opacity-75 hover:text-wt-primary",children:o("nav.links.upgrade")})}),s&&r&&e.jsx(Y,{path:`/subscribe/${r.id}/manage`,text:o("nav.links.manage")}),a&&r&&e.jsx(Y,{path:`/subscribe/${r.id}/referrals`,text:o("nav.links.referrals")})]})]})},Fs=({hasMultiplePublications:t,hasAuthorsPage:s})=>{const{t:a}=N();return e.jsxs("div",{className:"flex flex-col",children:[e.jsx(Ee,{text:a("nav.links.home")}),e.jsx(Y,{path:"/",text:a("meta.titles.posts")}),t&&e.jsx(Y,{path:"/publications",text:"Newsletters"}),s&&e.jsx(Y,{path:"/authors",text:a("author.authors")})]})},Is=({navGroups:t})=>e.jsx(e.Fragment,{children:t.map(s=>s.is_category_group||!s?.nav_links?.length?null:e.jsxs("div",{children:[e.jsx(Ee,{text:s.title}),e.jsx("div",{className:"mb-2 flex flex-col",children:s?.nav_links?.map(r=>r.external_link?e.jsx("a",{href:r.href,target:"_blank",rel:"nofollow noreferrer noopener",children:e.jsx(v,{as:"span",type:"body",theme:"navs",className:"text-sm opacity-75 hover:text-wt-primary",children:r.cta_text})},r.id):e.jsx(Y,{path:`/c/${r.href}`,text:r.cta_text},r.id))})]},s.id))}),$s=({publication:t,isLoggedIn:s,subscription:a})=>{const{web_template:n}=t,{nav_groups:r}=n,o=t.premium_enabled,l=t.has_referral_program,c=s||o,d=n?.multi_pub_ids?.length>=1,u=t?.web_template?.author_ids?.length>=1;return e.jsx("div",{children:e.jsx("div",{className:"flex w-full",children:e.jsxs("div",{className:"flex w-full justify-start space-x-6",children:[e.jsx("div",{className:"flex flex-col",children:e.jsx(Fs,{hasMultiplePublications:d,hasAuthorsPage:u})}),c&&e.jsx(Rs,{isPremiumEnabled:o,isLoggedIn:s,isReferralEnabled:l,publication:t,subscription:a}),e.jsx("div",{className:"flex space-x-6",children:r&&e.jsx(Is,{navGroups:r})})]})})})},As=({publication:t,subscription:s})=>{const a=G(),n=new Date().getFullYear(),{t:r}=N(),{web_template:o}=t,l=t.copyright_text||t.name,c=t.tiktok_url,d=t.twitter_url,u=t.youtube_url,f=t.facebook_url,m=t.instagram_url,h=t.linkedin_url,x=t.threads_url,p=t.discord_url,g=t.private&&!a,w=()=>e.jsx("div",{className:"flex flex-col space-y-1",children:e.jsx("div",{className:"flex space-x-2 transition-all",children:e.jsxs("div",{className:"flex items-end space-x-2",children:[d&&e.jsx("a",{target:"_blank",rel:"noreferrer",href:O(d),"aria-label":"X",children:e.jsx(v,{as:"span",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide",children:e.jsx(Nt,{className:"h-4 w-4 fill-current opacity-40 hover:opacity-100"})})}),h&&e.jsx("a",{target:"_blank",rel:"noreferrer",href:O(h),"aria-label":"LinkedIn",children:e.jsx(v,{as:"span",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide",children:e.jsx(kt,{className:"h-4 w-4 fill-current opacity-40 hover:opacity-100"})})}),u&&e.jsx("a",{target:"_blank",rel:"noreferrer",href:O(u),"aria-label":"Youtube",children:e.jsx(v,{as:"span",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide",children:e.jsx(St,{className:"h-4 w-4 fill-current opacity-40 hover:opacity-100"})})}),c&&e.jsx("a",{target:"_blank",rel:"noreferrer",href:O(c),"aria-label":"Tiktok",children:e.jsx(v,{as:"span",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide",children:e.jsx(Et,{className:"h-4 w-4 fill-current opacity-40 hover:opacity-100"})})}),f&&e.jsx("a",{target:"_blank",rel:"noreferrer",href:O(f),"aria-label":"Facebook",children:e.jsx(v,{as:"span",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide",children:e.jsx(Pt,{className:"h-4 w-4 fill-current opacity-40 hover:opacity-100"})})}),m&&e.jsx("a",{target:"_blank",rel:"noreferrer",href:O(m),"aria-label":"Instagram",children:e.jsx(v,{as:"span",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide",children:e.jsx(Ct,{className:"h-4 w-4 fill-current opacity-40 hover:opacity-100"})})}),x&&e.jsx("a",{target:"_blank",rel:"noreferrer",href:O(x),"aria-label":"Threads",children:e.jsx(v,{as:"span",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide",children:e.jsx(_t,{className:"h-4 w-4 fill-current opacity-40 hover:opacity-100"})})}),p&&e.jsx("a",{target:"_blank",rel:"noreferrer",href:O(p),"aria-label":"Discord",children:e.jsx(v,{as:"span",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide",children:e.jsx(yt,{className:"h-4 w-4 fill-current opacity-40 hover:opacity-100"})})})]})})});return e.jsxs("footer",{className:"flex w-full flex-col bg-wt-tertiary px-4 py-10","aria-labelledby":"footer-heading",children:[e.jsx("h2",{id:"footer-heading",className:"sr-only",children:"Footer"}),e.jsxs("div",{className:"mx-auto w-full max-w-6xl",children:[e.jsxs("div",{className:"flex flex-col-reverse justify-between space-x-0 md:flex-row md:space-x-8",children:[e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:"w-full max-w-lg",children:[e.jsxs("div",{className:"flex space-x-4",children:[e.jsx("div",{children:e.jsx("div",{className:"h-10 w-10 overflow-hidden rounded",children:t.logo.thumb.url&&e.jsx(ye,{src:t.logo.thumb.url,alt:t.name,maxWidth:200,aspectRatio:"square"})})}),e.jsxs("div",{children:[t.name&&e.jsx(v,{as:"h4",type:"title",size:"lg",theme:"navs",weight:"bold",children:t.name}),t.description&&e.jsx(v,{as:"p",type:"body",size:"sm",theme:"navs",weight:"medium",className:"text-md tracking-wide opacity-75",children:t.description})]})]}),e.jsxs("div",{className:"w-full pt-4",children:[a&&o.logged_subscribe_form?e.jsx(e.Fragment,{}):e.jsx(e.Fragment,{children:!g&&e.jsx(wt,{publication:t})}),e.jsx("div",{className:"mt-4 flex items-center",children:e.jsx("div",{children:w()})})]})]})}),e.jsx("div",{className:"flex hidden w-full flex-grow flex-col justify-between md:block",children:!g&&e.jsx($s,{publication:t,isLoggedIn:a,subscription:s})})]}),e.jsxs("div",{className:"mt-8 flex flex-col items-center justify-between space-y-4 border-t border-white/20 pt-6 sm:flex-row sm:space-y-0",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col items-center space-x-2 md:flex-row",children:[e.jsxs("div",{className:"mb-3 flex items-center space-x-0 md:mb-0 md:space-x-2",children:[e.jsx(v,{as:"span",theme:"navs",className:"extra-light text-xs",children:r("footer.copyright_simple",{year:n,name:l})}),e.jsx("div",{className:"hidden h-4 border-r border-gray-400 md:block"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(v,{as:"span",theme:"navs",className:"extra-light whitespace-nowrap text-xs underline underline-offset-1",children:e.jsx("a",{target:"_blank",rel:"noreferrer",href:`https://www.beehiiv.com/privacy?utm_source=${t.name}&utm_medium=footer`,children:r("footer.privacy_policy")})}),e.jsx("div",{className:"h-4 border-r border-gray-400"}),e.jsx(v,{as:"span",theme:"navs",className:"extra-light whitespace-nowrap text-xs underline underline-offset-1",children:e.jsx("a",{target:"_blank",rel:"noreferrer",href:`https://www.beehiiv.com/tou?utm_source=${t.name}&utm_medium=footer`,children:r("footer.terms_of_use")})})]})]})}),e.jsx(De,{publication:t})]})]})]})},Ws="origin-top-right left-0",Os="origin-top-right right-0",Bs="origin-top-center right-0",Ds=Object.freeze({right:Os,left:Ws,center:Bs}),Pe=({children:t,buttonChild:s,direction:a="right",className:n,style:r={}})=>{const{classes:o}=E();return e.jsx(e.Fragment,{children:e.jsxs(P,{as:"div",className:"relative inline-block text-left",children:[e.jsx(P.Button,{"aria-label":"Menu",className:"rounded-full transition-all",children:s}),e.jsx(re,{as:i.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e.jsx(P.Items,{className:T(o.radius,"absolute mt-2 bg-white bg-wt-tertiary shadow-lg ring-1 ring-black/5 focus:outline-none",Ds[a],n),style:r,children:t})})]})})};function zs({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{d:"M5.85 3.5a.75.75 0 0 0-1.117-1 9.719 9.719 0 0 0-2.348 4.876.75.75 0 0 0 1.479.248A8.219 8.219 0 0 1 5.85 3.5ZM19.267 2.5a.75.75 0 1 0-1.118 1 8.22 8.22 0 0 1 1.987 4.124.75.75 0 0 0 1.48-.248A9.72 9.72 0 0 0 19.266 2.5Z"}),i.createElement("path",{fillRule:"evenodd",d:"M12 2.25A6.75 6.75 0 0 0 5.25 9v.75a8.217 8.217 0 0 1-2.119 5.52.75.75 0 0 0 .298 1.206c1.544.57 3.16.99 4.831 1.243a3.75 3.75 0 1 0 7.48 0 24.583 24.583 0 0 0 4.83-1.244.75.75 0 0 0 .298-1.205 8.217 8.217 0 0 1-2.118-5.52V9A6.75 6.75 0 0 0 12 2.25ZM9.75 18c0-.034 0-.067.002-.1a25.05 25.05 0 0 0 4.496 0l.002.1a2.25 2.25 0 1 1-4.5 0Z",clipRule:"evenodd"}))}const qs=i.forwardRef(zs);function Gs({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM20.57 16.476c-.223.082-.448.161-.674.238L7.319 4.137A6.75 6.75 0 0 1 18.75 9v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206Z"}),i.createElement("path",{fillRule:"evenodd",d:"M5.25 9c0-.184.007-.366.022-.546l10.384 10.384a3.751 3.751 0 0 1-7.396-1.119 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9Zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0Z",clipRule:"evenodd"}))}const Hs=i.forwardRef(Gs);function Us({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{fillRule:"evenodd",d:"M5.25 9a6.75 6.75 0 0 1 13.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 1 1-7.48 0 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9Zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0Z",clipRule:"evenodd"}))}const $e=i.forwardRef(Us);function Zs({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{d:"M4.913 2.658c2.075-.27 4.19-.408 6.337-.408 2.147 0 4.262.139 6.337.408 1.922.25 3.291 1.861 3.405 3.727a4.403 4.403 0 0 0-1.032-.211 50.89 50.89 0 0 0-8.42 0c-2.358.196-4.04 2.19-4.04 4.434v4.286a4.47 4.47 0 0 0 2.433 3.984L7.28 21.53A.75.75 0 0 1 6 21v-4.03a48.527 48.527 0 0 1-1.087-.128C2.905 16.58 1.5 14.833 1.5 12.862V6.638c0-1.97 1.405-3.718 3.413-3.979Z"}),i.createElement("path",{d:"M15.75 7.5c-1.376 0-2.739.057-4.086.169C10.124 7.797 9 9.103 9 10.609v4.285c0 1.507 1.128 2.814 2.67 2.94 1.243.102 2.5.157 3.768.165l2.782 2.781a.75.75 0 0 0 1.28-.53v-2.39l.33-.026c1.542-.125 2.67-1.433 2.67-2.94v-4.286c0-1.505-1.125-2.811-2.664-2.94A49.392 49.392 0 0 0 15.75 7.5Z"}))}const Vs=i.forwardRef(Zs);function Js({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{fillRule:"evenodd",d:"M11.828 2.25c-.916 0-1.699.663-1.85 1.567l-.091.549a.798.798 0 0 1-.517.608 7.45 7.45 0 0 0-.478.198.798.798 0 0 1-.796-.064l-.453-.324a1.875 1.875 0 0 0-2.416.2l-.243.243a1.875 1.875 0 0 0-.2 2.416l.324.453a.798.798 0 0 1 .064.796 7.448 7.448 0 0 0-.198.478.798.798 0 0 1-.608.517l-.55.092a1.875 1.875 0 0 0-1.566 1.849v.344c0 .916.663 1.699 1.567 1.85l.549.091c.281.047.508.25.608.517.06.162.127.321.198.478a.798.798 0 0 1-.064.796l-.324.453a1.875 1.875 0 0 0 .2 2.416l.243.243c.648.648 1.67.733 2.416.2l.453-.324a.798.798 0 0 1 .796-.064c.157.071.316.137.478.198.267.1.47.327.517.608l.092.55c.15.903.932 1.566 1.849 1.566h.344c.916 0 1.699-.663 1.85-1.567l.091-.549a.798.798 0 0 1 .517-.608 7.52 7.52 0 0 0 .478-.198.798.798 0 0 1 .796.064l.453.324a1.875 1.875 0 0 0 2.416-.2l.243-.243c.648-.648.733-1.67.2-2.416l-.324-.453a.798.798 0 0 1-.064-.796c.071-.157.137-.316.198-.478.1-.267.327-.47.608-.517l.55-.091a1.875 1.875 0 0 0 1.566-1.85v-.344c0-.916-.663-1.699-1.567-1.85l-.549-.091a.798.798 0 0 1-.608-.517 7.507 7.507 0 0 0-.198-.478.798.798 0 0 1 .064-.796l.324-.453a1.875 1.875 0 0 0-.2-2.416l-.243-.243a1.875 1.875 0 0 0-2.416-.2l-.453.324a.798.798 0 0 1-.796.064 7.462 7.462 0 0 0-.478-.198.798.798 0 0 1-.517-.608l-.091-.55a1.875 1.875 0 0 0-1.85-1.566h-.344ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z",clipRule:"evenodd"}))}const Ys=i.forwardRef(Js);function Ks({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{fillRule:"evenodd",d:"M4.125 3C3.089 3 2.25 3.84 2.25 4.875V18a3 3 0 0 0 3 3h15a3 3 0 0 1-3-3V4.875C17.25 3.839 16.41 3 15.375 3H4.125ZM12 9.75a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5H12Zm-.75-2.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 0 1.5H12a.75.75 0 0 1-.75-.75ZM6 12.75a.75.75 0 0 0 0 1.5h7.5a.75.75 0 0 0 0-1.5H6Zm-.75 3.75a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5H6a.75.75 0 0 1-.75-.75ZM6 6.75a.75.75 0 0 0-.75.75v3c0 .414.336.75.75.75h3a.75.75 0 0 0 .75-.75v-3A.75.75 0 0 0 9 6.75H6Z",clipRule:"evenodd"}),i.createElement("path",{d:"M18.75 6.75h1.875c.621 0 1.125.504 1.125 1.125V18a1.5 1.5 0 0 1-3 0V6.75Z"}))}const Xs=i.forwardRef(Ks);function Qs({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{fillRule:"evenodd",d:"M8.25 6.75a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0ZM15.75 9.75a3 3 0 1 1 6 0 3 3 0 0 1-6 0ZM2.25 9.75a3 3 0 1 1 6 0 3 3 0 0 1-6 0ZM6.31 15.117A6.745 6.745 0 0 1 12 12a6.745 6.745 0 0 1 6.709 7.498.75.75 0 0 1-.372.568A12.696 12.696 0 0 1 12 21.75c-2.305 0-4.47-.612-6.337-1.684a.75.75 0 0 1-.372-.568 6.787 6.787 0 0 1 1.019-4.38Z",clipRule:"evenodd"}),i.createElement("path",{d:"M5.082 14.254a8.287 8.287 0 0 0-1.308 5.135 9.687 9.687 0 0 1-1.764-.44l-.115-.04a.563.563 0 0 1-.373-.487l-.01-.121a3.75 3.75 0 0 1 3.57-4.047ZM20.226 19.389a8.287 8.287 0 0 0-1.308-5.135 3.75 3.75 0 0 1 3.57 4.047l-.01.121a.563.563 0 0 1-.373.486l-.115.04c-.567.2-1.156.349-1.764.441Z"}))}const ea=i.forwardRef(Qs);function ta({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{d:"M5.25 6.375a4.125 4.125 0 1 1 8.25 0 4.125 4.125 0 0 1-8.25 0ZM2.25 19.125a7.125 7.125 0 0 1 14.25 0v.003l-.001.119a.75.75 0 0 1-.363.63 13.067 13.067 0 0 1-6.761 1.873c-2.472 0-4.786-.684-6.76-1.873a.75.75 0 0 1-.364-.63l-.001-.122ZM18.75 7.5a.75.75 0 0 0-1.5 0v2.25H15a.75.75 0 0 0 0 1.5h2.25v2.25a.75.75 0 0 0 1.5 0v-2.25H21a.75.75 0 0 0 0-1.5h-2.25V7.5Z"}))}const sa=i.forwardRef(ta),aa=({subscriberId:t,isReferralEnabled:s,avatarUrl:a,isPremiumEnabled:n,isPremiumTierSubscriber:r,isLoggedIn:o,publication:l})=>{const c=D(),d=nt(),[u]=I(),[f,m]=i.useState(!1),{t:h}=N(),x=Oe(),p=l?.web_template?.author_ids?.length>=1,g=l?.web_template?.multi_pub_ids?.length>=1,w=()=>{u.has("email")&&d(c.pathname),m(!1)},j=()=>{m(!0)},_=()=>{const k=new FormData;k.append("pathname",window?.location?.pathname),x(k,{method:"post",action:"/logout"})};return e.jsxs(e.Fragment,{children:[!t&&e.jsx(Ge,{isOpen:f,handleCloseModal:w,publication:l}),e.jsxs(Pe,{buttonChild:e.jsx("div",{className:"mt-1.5",children:o?e.jsx("div",{className:"h-6 w-6 overflow-hidden rounded-full",children:e.jsx("img",{className:"h-6 w-6 rounded-full",src:a,alt:"The logged in user"})}):e.jsx(Ne,{className:"h-6 w-6 stroke-1 text-wt-text-on-tertiary opacity-60 hover:opacity-100"})}),children:[e.jsx(e.Fragment,{children:n&&!r&&e.jsx(P.Item,{children:({active:k})=>e.jsx(xe,{href:l.web_template.external_upgrade_page_href,children:e.jsxs("div",{className:"group flex items-center space-x-2 rounded-wt px-3 py-2 hover:bg-black/5",children:[e.jsx(_s,{className:"h-3 w-3 text-wt-text-on-tertiary"}),e.jsx(v,{as:"span",type:"title",theme:"navs",className:"whitespace-nowrap text-xs sm:block",children:h("nav.links.upgrade")})]})})})}),g&&e.jsx(P.Item,{children:({active:k})=>e.jsx(S,{to:"/publications",prefetch:"intent",children:e.jsxs("div",{className:"group flex items-center space-x-2 rounded-wt px-3 py-2 hover:bg-black/5",children:[e.jsx(bs,{className:"h-3 w-3 text-wt-text-on-tertiary"}),e.jsx(v,{as:"span",type:"title",theme:"navs",className:"whitespace-nowrap text-xs sm:block",children:"Newsletters"})]})})}),p&&e.jsx(P.Item,{children:({active:k})=>e.jsx(S,{to:"/authors",prefetch:"intent",children:e.jsxs("div",{className:"group flex items-center space-x-2 rounded-wt px-3 py-2 hover:bg-black/5",children:[e.jsx(Ns,{className:"h-3 w-3 text-wt-text-on-tertiary"}),e.jsx(v,{as:"span",type:"title",theme:"navs",className:"whitespace-nowrap text-xs sm:block",children:h("author.authors")})]})})}),t&&e.jsx(P.Item,{children:({active:k})=>e.jsx(S,{to:`/subscribe/${t}/manage`,prefetch:"intent",children:e.jsxs("div",{className:"group flex items-center space-x-2 rounded-wt px-3 py-2 hover:bg-black/5",children:[e.jsx(ps,{className:"h-3 w-3 text-wt-text-on-tertiary"}),e.jsx(v,{as:"span",type:"title",theme:"navs",className:"whitespace-nowrap text-xs sm:block",children:h("nav.links.manage")})]})})}),s&&t&&e.jsx(P.Item,{children:({active:k})=>e.jsx(S,{to:`/subscribe/${t}/referrals`,prefetch:"intent",children:e.jsxs("div",{className:"group flex items-center space-x-2 rounded-wt px-3 py-2 hover:bg-black/5",children:[e.jsx(Ss,{className:"h-3 w-3 text-wt-text-on-tertiary"}),e.jsx(v,{as:"span",type:"title",theme:"navs",className:"whitespace-nowrap text-xs sm:block",children:h("nav.links.referrals")})]})})}),o?e.jsx(P.Item,{children:({active:k})=>e.jsx("button",{onClick:_,className:"w-full whitespace-nowrap text-xs text-wt-text-on-tertiary",children:e.jsxs("div",{className:"group flex items-center space-x-2 rounded-wt px-3 py-2 hover:bg-black/5",children:[e.jsx(Ie,{className:"h-3 w-3 text-wt-text-on-tertiary"}),e.jsx("div",{className:"whitespace-nowrap text-xs text-wt-text-on-tertiary sm:block",children:h("shared.cta.logout")})]})})}):e.jsx(P.Item,{children:({active:k})=>e.jsx("button",{onClick:j,className:"w-full whitespace-nowrap text-xs text-wt-text-on-tertiary",children:e.jsxs("div",{className:"group flex w-full items-center space-x-2 rounded-wt px-3 py-2 hover:bg-black/5",children:[e.jsx(Ie,{className:"h-3 w-3 text-wt-text-on-tertiary"}),e.jsx("div",{className:"whitespace-nowrap text-xs text-wt-text-on-tertiary sm:block",children:h("shared.cta.login")})]})})})]})]})},na=({url:t,name:s})=>e.jsx(S,{className:"transition:all rounded-wt px-2 py-1 hover:bg-black/5",to:"/",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[t&&e.jsx("div",{className:"h-8 w-8 overflow-hidden rounded-wt",children:e.jsx(ye,{className:"h-full w-full rounded-wt object-contain",src:t,alt:`${s} logo`,maxWidth:100,aspectRatio:"square"})}),e.jsx(v,{as:"span",type:"title",theme:"navs",className:"sm:text-md wt-text-primary hidden text-sm sm:block",children:s})]})}),Ve=({children:t,popoverContent:s})=>{const[a,n]=i.useState(!1);return e.jsx(V,{className:"relative cursor-pointer",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:({open:r})=>e.jsxs(e.Fragment,{children:[e.jsxs(V.Button,{className:"  inline-flex items-center rounded-wt px-2 py-2 hover:bg-black/5 focus:outline-none focus-visible:ring-2",children:[t,e.jsx(He,{className:" ml-2 h-3 w-3 text-wt-text-on-tertiary transition duration-150 ease-in-out","aria-hidden":"true"})]}),e.jsx(re,{as:i.Fragment,show:a,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e.jsx(V.Panel,{className:"absolute left-0 right-0 mt-2 min-w-36 origin-top-right rounded-md bg-white bg-wt-tertiary shadow-lg ring-1 ring-black/5 focus:outline-none",children:e.jsx("div",{className:"overflow-hidden rounded-lg ring-1 ring-black/5",children:s})})})]})})},ra=({children:t,subLinks:s,webTemplate:a})=>{const n=a.enable_customize_category_ids,r=a.category_ids;return e.jsx(Ve,{popoverContent:e.jsx(e.Fragment,{children:s.map(o=>n&&!r.includes(o.id)?null:e.jsx(S,{className:"flex rounded-wt px-3 py-2.5 hover:bg-black/5",to:`/t/${he(o.display)}`,children:e.jsx(v,{as:"span",type:"title",theme:"navs",className:"text-xs sm:block",children:o.display})},o.id))}),children:t})},oa=({children:t,subLinks:s})=>e.jsx(Ve,{popoverContent:e.jsx(e.Fragment,{children:s.map(a=>a.external_link?e.jsx("a",{className:"flex rounded-wt px-3 py-2.5 hover:bg-black/5",href:a.href,target:"_blank",rel:"nofollow noreferrer noopener",children:e.jsx(v,{as:"span",type:"title",theme:"navs",className:"text-xs sm:block",children:a.cta_text})},a.id):e.jsx(S,{className:"flex rounded-wt px-3 py-2.5 hover:bg-black/5",to:`/c/${a.href}`,children:e.jsx(v,{as:"span",type:"title",theme:"navs",className:"text-xs sm:block",children:a.cta_text})},a.id))}),children:t}),ia=({link:t})=>t.external_link?e.jsx("a",{className:"transition:all rounded-wt px-2 py-2 hover:bg-black/5",href:t.href,target:"_blank",rel:"nofollow noreferrer noopener",children:e.jsx(v,{as:"span",type:"title",theme:"navs",className:"whitespace-nowrap text-xs sm:block",children:t.cta_text})}):e.jsx(S,{className:"transition:all rounded-wt px-2 py-2 hover:bg-black/5",to:`/c/${t.href}`,children:e.jsx(v,{as:"span",type:"title",theme:"navs",className:"hidden whitespace-nowrap text-xs sm:block",children:t.cta_text})}),la=({publication:t})=>{const{content_tags:s,web_template:a}=t;return e.jsx("div",{className:"z-20 flex gap-1",children:a.nav_groups&&a.nav_groups.map(n=>n.is_category_group?e.jsx(ra,{subLinks:s,webTemplate:a,children:e.jsx(v,{as:"span",type:"title",theme:"navs",className:"text-xs sm:block",children:n.title})},n.id):n.nav_links.length===0?null:n.nav_links.length===1?e.jsx(ia,{link:n.nav_links[0]},n.id):e.jsx(oa,{subLinks:n.nav_links,children:e.jsx(v,{as:"span",type:"title",theme:"navs",className:"text-xs sm:block",children:n.title})},n.id))})},ca=({open:t,setOpen:s,title:a,children:n,bottomChildren:r})=>e.jsx(re.Root,{show:t,as:i.Fragment,children:e.jsxs(Te,{as:"div",className:"relative",onClose:s,children:[e.jsx("div",{className:"fixed inset-0"}),e.jsx("div",{className:"fixed inset-0 z-40 overflow-hidden",children:e.jsx("div",{className:"absolute inset-0 overflow-hidden",children:e.jsx("div",{className:"pointer-events-none fixed inset-y-0 right-0 flex pl-10",children:e.jsx(re.Child,{as:i.Fragment,enter:"transform transition ease-in-out duration-500 sm:duration-700",enterFrom:"translate-x-full",enterTo:"translate-x-0",leave:"transform transition ease-in-out duration-500 sm:duration-700",leaveFrom:"translate-x-0",leaveTo:"translate-x-full",children:e.jsx(Te.Panel,{className:"pointer-events-auto w-screen",children:e.jsxs("div",{className:"relative flex h-full flex-col overflow-y-auto bg-white py-6 shadow-xl",children:[e.jsx("div",{className:"px-4 sm:px-6",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsx("div",{className:"fixed bottom-4 left-0 z-20 flex w-full items-center px-4",children:r})})}),e.jsxs("div",{className:"relative flex-1 px-4 pb-40 pr-6",children:[n,e.jsx("div",{className:"fixed right-4 top-4",children:e.jsx("button",{type:"button",className:"border-gray z-40 rounded-wt border bg-white p-1 text-gray-400 hover:text-gray-500 focus:outline-none",onClick:()=>{s(!1),window.scrollTo({top:0,behavior:"smooth"})},children:e.jsx(At,{className:"h-4 w-4","aria-hidden":"true"})})})]})]})})})})})})]})}),ie=({text:t})=>e.jsx(v,{as:"span",type:"title",theme:"primary",className:"text-sm font-semibold sm:block",children:t}),B=({path:t,text:s,onClick:a,asTitle:n=!1})=>e.jsx(S,{to:t,onClick:a,children:e.jsx(v,{as:"span",type:"title",theme:n?"primary":"default",className:n?"text-sm font-semibold capitalize sm:block":"text-sm hover:text-wt-primary",children:s})}),da=({publication:t,isLoggedIn:s,subscription:a})=>{const{t:n}=N(),{handleOpenModal:r}=ue(),[o,l]=i.useState(!1),{content_tags:c,web_template:d}=t,{nav_groups:u,enable_customize_category_ids:f,category_ids:m}=d,h=t.premium_enabled,x=t.has_referral_program,p=s||h,g=d?.multi_pub_ids?.length>=1,w=t?.web_template?.author_ids?.length>=1,j=()=>{l(!1)};return e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("button",{onClick:_=>{l(!0)},children:s?e.jsx("div",{className:"h-6 w-6 overflow-hidden rounded-full",children:e.jsx("img",{className:"h-6 w-6 rounded-full",src:a?.avatar_url,alt:"The logged in user"})}):e.jsx(Ne,{className:"h-6 w-6 stroke-1 text-wt-text-on-tertiary opacity-60 hover:opacity-100"})})}),e.jsx(ca,{open:o,setOpen:l,title:n("nav.mobile_title"),bottomChildren:e.jsx("div",{className:"w-full",children:s?e.jsx(Be,{method:"post",action:"/logout",onClick:j,children:e.jsx("input",{type:"submit",value:n("shared.cta.logout")||"",className:"wt-button-font text-md inline-flex w-full cursor-pointer items-center justify-center rounded-md rounded-wt border border-gray-300 bg-white py-2 font-medium text-gray-700 focus:outline-none focus:ring-2 focus:ring-wt-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:bg-gray-400"})}):e.jsxs("div",{className:"flex w-full flex-col space-y-2 bg-white",children:[e.jsx(L,{type:"button",variant:"ghost",className:"shadow-none",onClick:()=>r("login"),children:n("shared.cta.login")}),e.jsx(L,{type:"button",variant:"primary",onClick:()=>r("signup"),children:n("shared.cta.subscribe")})]})}),children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(ie,{text:n("nav.links.home")}),e.jsx(B,{path:"/",text:n("meta.titles.posts"),onClick:j}),g&&e.jsx(B,{path:"/publications",text:"Newsletters",onClick:j}),w&&e.jsx(B,{path:"/authors",text:n("author.authors"),onClick:j})]}),p&&e.jsxs("div",{className:"flex flex-col",children:[e.jsx(ie,{text:n("nav.mobile_sections.account")}),e.jsxs("div",{className:"mb-2 flex flex-col",children:[h&&e.jsx(xe,{href:t.web_template.external_upgrade_page_href,children:e.jsx(v,{as:"span",type:"title",theme:"default",className:"text-sm hover:text-wt-primary",children:n("nav.links.upgrade")})}),s&&a&&e.jsx(B,{path:`/subscribe/${a.id}/manage`,text:n("nav.links.manage"),onClick:j}),x&&a&&e.jsx(B,{path:`/subscribe/${a.id}/referrals`,text:n("nav.links.referrals"),onClick:j})]})]}),e.jsx("div",{className:"flex flex-col space-y-2",children:u&&u.map(_=>{if(_.is_category_group)return e.jsxs("div",{children:[e.jsx(ie,{text:_.title}),e.jsx("div",{className:"mb-2 flex flex-col",children:c?.map(b=>f&&!m.includes(b.id)?null:e.jsx("div",{children:e.jsx(B,{path:`/t/${he(b.display)}`,text:b.display,onClick:j})},b.id))})]},_.id);if(!_?.nav_links?.length)return null;if(_?.nav_links?.length===1){const b=_?.nav_links?.[0];return b.external_link?e.jsx("a",{href:b.href,target:"_blank",rel:"nofollow noreferrer noopener",children:e.jsx(v,{as:"span",type:"title",theme:"primary",className:"text-sm font-semibold capitalize sm:block",children:b.cta_text})},_.id):e.jsx("div",{children:e.jsx(B,{asTitle:!0,path:`/c/${b.href}`,text:b.cta_text,onClick:j})},_.id)}return e.jsxs("div",{children:[e.jsx(ie,{text:_.title}),e.jsx("div",{className:"mb-2 flex flex-col",children:_?.nav_links?.map(b=>b.external_link?e.jsx("a",{href:b.href,target:"_blank",rel:"nofollow noreferrer noopener",children:e.jsx(v,{as:"span",type:"title",theme:"default",className:"text-sm hover:text-wt-primary",children:b.cta_text})},b.id):e.jsx(B,{path:`/c/${b.href}`,text:b.cta_text,onClick:j},b.id))})]},_.id)})})]})})]})},ma=400,ua=()=>{const t=i.useRef(null),s=i.useRef(null),[a,n]=i.useState(!1),[r,o]=i.useState(0),[l,c]=i.useState(!1),d=u=>{s.current&&(s.current.offsetWidth-u<ma?!a&&n(!0):n(!1))};return i.useEffect(()=>{!l&&s.current&&t.current&&(o(t.current.offsetWidth),d(t.current.offsetWidth),c(!0))},[l,s.current,t.current]),i.useEffect(()=>{const u=()=>{l&&d(r)};return window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[l,s.current]),{shouldUseMobileMenu:a,menuRef:t,navRef:s,isMounted:l}},ha=({publication:t,isLoggedIn:s,subscription:a,isAdminLoggedIn:n})=>{const{navRef:r,menuRef:o,isMounted:l,shouldUseMobileMenu:c}=ua(),d=a?.tier==="premium",u=!s&&!t.private;return e.jsx("nav",{ref:r,className:"flex items-center justify-between bg-wt-tertiary px-4 py-2",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-6xl justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(na,{url:t.logo.thumb.url,name:t.name}),e.jsx("div",{ref:o,className:T(!l&&"opacity-0",c?"hidden":"z-20 block"),children:e.jsx(la,{publication:t})})]}),e.jsxs("div",{className:"z-20 flex items-center",children:[u&&e.jsx("div",{className:"mr-2",children:e.jsx(L,{variant:"primary",linkProps:{to:"/subscribe",prefetch:"intent"},children:t.cta_text})}),e.jsx("div",{children:c?e.jsx(da,{publication:t,isLoggedIn:s,subscription:a}):e.jsx(aa,{isLoggedIn:s,avatarUrl:a?.avatar_url,subscriberId:a?.subscriber_id,isPremiumEnabled:t.premium_enabled,isReferralEnabled:t.has_referral_program,isPremiumTierSubscriber:d,publication:t})})]})]})})},xa=({redirects:t,currentStep:s,progress:a=0,publication:n})=>{const r=n.web_template.signup_flow_messaging.success_message,o=s?.page_message,l=t&&t?.length>1;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed z-20 flex h-14 w-full justify-center bg-white shadow-lg",children:[e.jsx("div",{className:"overflow-hidden rounded-full bg-white",children:e.jsx("img",{className:"absolute left-1/2 top-7 z-10 h-14 w-14 -translate-x-1/2 transform rounded-full",src:n.web_template.signup_flow_avatar_url,alt:"avatar"})}),l&&e.jsx("div",{className:"absolute top-14 w-full",children:e.jsx(Wt,{currentProgress:a,variant:"signup-flow"})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 h-14"}),e.jsxs("div",{className:"mx-auto flex w-full max-w-xl flex-col items-center space-y-2 pb-4 pt-8 text-center",children:[r&&e.jsx(y,{as:"p",size:"sm",className:"font-medium",children:n.web_template.signup_flow_messaging.success_message}),o&&e.jsx(y,{as:"h4",size:"xl",weight:"semibold",children:s?.page_message})]})]})]})},X=({url:t,name:s,textColor:a,fontFamily:n})=>{const{webTheme:r,classes:o}=E();return e.jsx(S,{className:T(o.radius,"transition:all px-2 py-1 hover:bg-black/5"),to:"/",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[t&&e.jsx("div",{className:"h-8 w-8 overflow-hidden rounded-wt",children:e.jsx(ye,{className:"h-full w-full rounded-wt object-contain",src:t,alt:`${s} logo`,maxWidth:100,aspectRatio:"square"})}),e.jsx(y,{as:"span",color:a,fontFamilyv2:r.navbar_font_family,className:"sm:text-md wt-text-primary hidden text-sm md:block",children:s})]})})},fa=400,pa=()=>{const t=i.useRef(null),[s,a]=i.useState(!1),[n,r]=i.useState(0),[o,l]=i.useState(!1),c=d=>{t.current&&(document.getElementsByTagName("nav")[0].offsetWidth-d<fa?!s&&a(!0):a(!1))};return i.useEffect(()=>{!o&&t.current&&(r(t.current.offsetWidth),c(t.current.offsetWidth),l(!0))},[o,t.current]),i.useEffect(()=>{const d=()=>{o&&c(n)};return window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[o]),{shouldUseMobileMenu:s,menuRef:t,isMounted:o}},Je=({children:t,popoverContent:s,theme:a})=>{const[n,r]=i.useState(!1),{classes:o}=E();return e.jsx(V,{className:"cursor-pointer",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:({open:l})=>e.jsxs("div",{className:"",children:[e.jsxs(V.Button,{style:{color:a?.navbar_text_color||"#000",fontFamily:a?.navbar_font_family,zIndex:0},className:T(o.radius,"inline-flex items-center px-2 py-2 hover:bg-black/5 focus:outline-none focus-visible:ring-2"),children:[t,e.jsx("div",{style:{color:a?.navbar_text_color||"#000"},children:e.jsx(He,{className:" ml-2 h-3 w-3 transition duration-150 ease-in-out","aria-hidden":"true"})})]}),e.jsx(re,{as:i.Fragment,show:n,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e.jsx(V.Panel,{style:{backgroundColor:a?.navbar_background_color},className:T(o.radius,"absolute z-50 w-[180px] min-w-36 origin-top-right overflow-hidden shadow-lg ring-1 ring-black/5 focus:outline-none"),children:e.jsx("div",{className:"overflow-hidden rounded-lg ring-1 ring-black/5",children:s})})})]})})},ga=({children:t,subLinks:s,webTemplate:a,theme:n})=>{const r=a.enable_customize_category_ids,o=a.category_ids;return e.jsx(Je,{theme:n,popoverContent:e.jsx(e.Fragment,{children:s.map(l=>r&&!o.includes(l.id)?null:e.jsx(S,{className:"flex rounded-wt px-3 py-2.5 hover:bg-black/5",to:`/t/${he(l.display)}`,children:e.jsx(y,{as:"span",color:n.navbar_text_color,fontFamilyv2:n.navbar_font_family,className:"text-xs sm:block",children:l.display})},l.id))}),children:t})},va=({children:t,subLinks:s,theme:a})=>e.jsx(Je,{theme:a,popoverContent:e.jsx(e.Fragment,{children:s.map(n=>n.external_link?e.jsx("a",{className:"flex rounded-wt px-3 py-2.5 hover:bg-black/5",href:n.href,target:"_blank",rel:"nofollow noreferrer noopener",children:e.jsx(y,{as:"span",color:a.navbar_text_color,fontFamily:a.navbar_font_family,className:"text-xs sm:block",children:n.cta_text})},n.id):e.jsx(S,{className:"flex rounded-wt px-3 py-2.5 hover:bg-black/5",to:`/c/${n.href}`,children:e.jsx(y,{as:"span",color:a.navbar_text_color,fontFamily:a.navbar_font_family,className:"text-xs sm:block",children:n.cta_text})},n.id))}),children:t}),wa=({href:t,children:s,className:a,isExternalLink:n})=>n?e.jsx("a",{className:a,href:t,target:"_blank",rel:"nofollow noreferrer noopener",children:s}):e.jsx(S,{className:a,to:t,children:s}),ba=({link:t,theme:s})=>{const a=t.external_link,n=a?t.href:`/c/${t.href}`;return e.jsx(wa,{href:n,isExternalLink:a,className:"transition:all rounded-wt px-2 py-2 hover:bg-black/5",children:e.jsx(y,{as:"span",color:s.navbar_text_color,fontFamilyv2:s.navbar_font_family,className:"whitespace-nowrap text-xs sm:block",children:t.cta_text})})},Q=({publication:t,theme:s})=>{const{content_tags:a,web_template:n}=t,{menuRef:r,isMounted:o,shouldUseMobileMenu:l}=pa();return e.jsx("div",{ref:r,className:T(!o&&"opacity-0",l?"hidden":"block"),children:e.jsx("div",{className:"z-20 flex gap-1",children:n.nav_groups&&n.nav_groups.map(c=>c.is_category_group?e.jsx(ga,{subLinks:a,webTemplate:n,theme:s,children:e.jsx(y,{as:"span",color:s.navbar_text_color,fontFamilyv2:s.navbar_font_family,className:"text-xs sm:block",children:c.title})},c.id):c.nav_links.length===0?null:c.nav_links.length===1?e.jsx(ba,{link:c.nav_links[0],theme:s},c.id):e.jsx(va,{subLinks:c.nav_links,theme:s,children:e.jsx(y,{as:"span",color:s.navbar_text_color,fontFamilyv2:s.navbar_font_family,className:"text-xs sm:block",children:c.title})},c.id))})})},Ce=()=>{const{cookies:t,cookiesSet:s,setCookie:a}=Ot(),[n,r]=i.useState([]);i.useEffect(()=>{s&&t?.notifications_read&&r(JSON.parse(t?.notifications_read))},[s,t]);const o=c=>{const d=JSON.stringify([...n,c]);a({name:"notifications_read",value:d,days:4})},l=c=>{const d=c.map(f=>f.id),u=JSON.stringify(d);a({name:"notifications_read",value:u,days:4})};return{readNotifications:n,readNotificationsCount:n.length,handleReadNotification:o,handleReadAllNotifications:l}},ja=()=>{const t=dt(),[s,a]=i.useState([]),[n,r]=i.useState(0),o=t.data,l=o?.pagination?.total||0,c=o?.pagination?.page||0,{readNotifications:d,readNotificationsCount:u}=Ce(),f=d.length,m=s.length+u<l,h=()=>{const g=new URLSearchParams;g.set("page",String(n+1)),t.load(`/notifications?${g.toString()}`)},x=g=>u===0?g:g.filter(w=>!d.includes(w.id)),p=i.useMemo(()=>{let g=o?.pagination?.total||0;return g-=d.length,g<0?0:g},[o,u]);return i.useEffect(()=>{h()},[]),i.useEffect(()=>{a(x(s))},[f]),i.useEffect(()=>{if(o){r(n+1);const g=[...s,...o.notifications];a(x(g))}},[c]),{notificationsCount:p,notifications:s,isLoading:t?.state!=="idle",fetchMoreNotifications:h,hasMoreToFetch:m}},_a=({fetchMoreNotifications:t})=>e.jsx("div",{className:"flex w-full justify-center px-4 pb-4",children:e.jsx(L,{type:"button",variant:"flush",className:"flex w-full justify-center",btnSize:"sm",onClick:t,children:"Load more"})}),ya=({notifications:t})=>{const{handleReadAllNotifications:s}=Ce();return e.jsx("div",{className:"flex w-full justify-center px-4 pt-4",children:e.jsx(L,{type:"button",variant:"ghost",className:"flex w-full justify-center",btnSize:"sm",onClick:()=>s(t),children:"Mark all as read"})})},Na=({children:t,notificationsCount:s,background:a,color:n})=>{const r=s>0,o=s>9;return e.jsx(Pe,{direction:"right",className:"z-50 w-[250px] sm:w-[300px]",style:{background:a||"#fff"},buttonChild:e.jsx("div",{className:"mt-1.5 rounded hover:bg-black/5",style:{color:n},children:r?e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute -right-1 -top-1 rounded-full bg-red-500 px-1 text-xs text-white",children:o?"9+":s}),e.jsx($e,{className:"h-6 w-6"})]}):e.jsx($e,{className:"h-6 w-6"})}),children:e.jsx("div",{className:"h-80 overflow-auto",children:t})})},le=()=>e.jsx("div",{className:"h-6 w-full rounded bg-gray-300/80"}),ka=()=>e.jsx("div",{className:"flex w-full animate-pulse flex-col space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(le,{}),e.jsx(le,{}),e.jsx(le,{}),e.jsx(le,{})]})}),Sa=({notifications:t,isLoading:s,textColor:a})=>{const{handleReadNotification:n}=Ce(),{webTheme:r}=E(),o=r?.navbar_text_color;return s?e.jsx("div",{className:"p-2",children:e.jsx(ka,{})}):t.length>0?e.jsx("ul",{className:"divide-y",children:e.jsx(e.Fragment,{children:t.map(c=>{const d=Tt(c.created_at);let u;try{const f=new URL(c.url);u=f.pathname+f.search}catch(f){u="/",console.error(f)}return e.jsx("li",{className:"relative first:rounded-t-md last:rounded-b-md",children:e.jsx(P.Item,{children:e.jsxs(S,{to:u,onClick:()=>n(c.id),className:"flex w-full flex-row space-x-2 px-3 py-3 hover:underline",children:[e.jsx("div",{className:"pt-1",style:{color:o},children:e.jsx(Vs,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex w-full flex-col space-y-2",children:[e.jsx(y,{as:"span",color:o,fontFamilyv2:r?.navbar_font_family,className:"text-sm sm:block",children:e.jsx(zt,{children:c.message})}),e.jsx("div",{className:"flex flex-row space-x-2",children:e.jsx(y,{as:"span",color:o,fontFamilyv2:r?.navbar_font_family,className:"text-xs sm:block",children:e.jsx("small",{className:"font-regular my-auto text-xs",children:d})})})]})]})})},c.id)})})}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-2 p-2",children:[e.jsx(y,{as:"span",color:o,fontFamilyv2:r?.navbar_font_family,children:e.jsx(vs,{className:"mx-auto h-6 w-6"})}),e.jsx(y,{as:"span",color:o,fontFamilyv2:r?.navbar_font_family,children:"No new notifications"})]})},Ye=({notificationsCount:t,isLoading:s,notifications:a,fetchMoreNotifications:n,hasMoreToFetch:r})=>{const o=t>0,{webTheme:l}=E();return e.jsx(Na,{notificationsCount:t,background:l?.navbar_background_color,color:l?.navbar_text_color,children:e.jsxs("div",{className:"flex h-full flex-col justify-between",children:[e.jsxs("div",{className:"h-full",children:[o&&e.jsx(ya,{notifications:a}),e.jsx(Sa,{isLoading:s,notifications:a,textColor:l?.navbar_text_color})]}),r&&n&&e.jsx(_a,{fetchMoreNotifications:n})]})})},Ea=()=>{const{notifications:t,isLoading:s,notificationsCount:a,fetchMoreNotifications:n,hasMoreToFetch:r}=ja();return e.jsx(Ye,{notificationsCount:a,isLoading:s,notifications:t,fetchMoreNotifications:n,hasMoreToFetch:r})},Ae=()=>e.jsx(be,{fallbackRender:()=>e.jsx(Ye,{notificationsCount:0,isLoading:!1,notifications:[],hasMoreToFetch:!1}),children:e.jsx(Ea,{})}),$=({text:t,Icon:s,link:a})=>{const{webTheme:n}=E();return a.type==="external"&&P.Item,e.jsx(P.Item,{children:({active:r})=>e.jsxs(S,{to:a.href,className:"flex items-center space-x-2 px-6 py-3",children:[s&&e.jsx("div",{style:{color:n?.navbar_text_color},children:e.jsx(s,{className:"h-4 w-4"})}),e.jsx(y,{as:"span",className:"",color:n.navbar_text_color,weight:"medium",fontFamilyv2:n.navbar_font_family,size:"sm",children:t})]})})},Pa=()=>{const[t,s]=i.useState(null),[a,n]=i.useState(!1),[r,o]=i.useState(null),[l,c]=i.useState(!1),d=()=>l?"granted":(Notification.requestPermission().then(m=>m==="granted"?(c(!0),m):(c(!1),m)),"default"),u=(m,h,x)=>{t!==null&&t.pushManager!==void 0&&t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:m}).then(p=>{n(!0),o(p),h&&h(p)},p=>{x&&x(p)})},f=(m,h)=>{t!==null&&t.pushManager!==void 0&&t.pushManager.getSubscription().then(x=>{x&&x.unsubscribe().then(()=>{n(!1),o(null),m&&m(x)},p=>{h&&h(p)})}).catch(x=>{h&&h(x)})};return i.useEffect(()=>{if(typeof window>"u")return;const m=async()=>{if("serviceWorker"in navigator)try{const x=await navigator.serviceWorker.getRegistration();s(x??null)}catch(x){console.error("Error getting service worker registration:",x)}else console.warn("Service Workers are not supported in this browser.")},h=()=>{m()};return"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("controllerchange",h),m(),()=>{"serviceWorker"in navigator&&navigator.serviceWorker.removeEventListener("controllerchange",h)}},[]),i.useEffect(()=>{if(t){if(t.pushManager===void 0)return;t.pushManager.getSubscription().then(m=>{n(!!m),o(m)}),Notification.permission==="granted"?c(!0):c(!1)}},[t]),{isSubscribed:a,pushSubscription:r,requestPermission:d,subscribeToPush:u,unsubscribeFromPush:f,canSendPush:l}};function Ke(){const t=_e(),s=G(),{subscribeToPush:a,unsubscribeFromPush:n,isSubscribed:r,canSendPush:o}=Pa();async function l(){if(!s){F.error(ge("nav.push.enable.error"));return}if(r)await n(c=>{fetch("/push/unsubscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}),F.success(ge("nav.push.disable.success"));else{if(!o&&await Notification.requestPermission()!=="granted")return;await a(t.VAPID_PUBLIC_KEY,c=>{fetch("/push/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}),F.success(ge("nav.push.enable.success"))}}return{onEnable:l,isSubscribed:r}}const Ca=()=>{const{webTheme:t}=E(),s=G(),{isSubscribed:a,onEnable:n}=Ke(),r=K(),{t:o}=N(),l=o(a?"nav.push.disable.label":"nav.push.enable.label"),c=a?Hs:qs;return r!=="standalone"?null:e.jsx(P.Item,{children:e.jsxs("div",{className:"flex cursor-pointer items-center space-x-2 px-6 py-3",onClick:n,children:[e.jsx("div",{style:{color:s?t?.navbar_text_color:"#a1a1aa"},children:e.jsx(c,{className:"h-4 w-4"})}),e.jsx(y,{as:"span",className:"",color:s?t?.navbar_text_color:"#a1a1aa",weight:"medium",fontFamilyv2:t.navbar_font_family,size:"sm",children:l})]})})},La=({className:t})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,children:e.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:32,d:"M336 192h40a40 40 0 0 1 40 40v192a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V232a40 40 0 0 1 40-40h40m160-64l-80-80l-80 80m80 193V48"})});function Xe(){const t=/android/i.test(window.navigator.userAgent),s="standalone"in window.navigator&&window.navigator.standalone||window.matchMedia("(display-mode: standalone)").matches;return t&&!s}function Qe(){const t=/iphone|ipad|ipod/i.test(window.navigator.userAgent),s=/macintosh/i.test(window.navigator.userAgent)&&navigator.maxTouchPoints>2,a="standalone"in window.navigator&&window.navigator.standalone;return(t||s)&&!a}const Ma=({debug:t=!1})=>e.jsx(qe,{children:()=>e.jsx(Ta,{debug:t})});function Ta({debug:t=!1}){const s=Xe(),a=Qe(),n=s||a,r=G(),o=K(),{publication:l}=me("root")??{},[c,d]=Ra(),[u,f]=i.useState(!c&&o!=="standalone"&&n&&r),{t:m}=N(),h=window.__DeferredPrompt__;function x(){h&&(d(!0),h.prompt(),h.userChoice.then(g=>{g.outcome==="accepted"&&console.log("Installing app"),f(!1)}))}function p(){F.success(m("pwa.install_prompt.install_success"))}return i.useEffect(()=>(window.addEventListener("appinstalled",p),()=>{window.removeEventListener("appinstalled",p)}),[]),i.useEffect(()=>{function g(w){w.preventDefault(),f(!0),d(!0)}return document.addEventListener("beehiiv:showInstallPrompt",g),()=>{document.removeEventListener("beehiiv:showInstallPrompt",g)}},[c,d,u]),!t&&!s&&!a||!u?null:e.jsx("div",{className:"fixed inset-0 z-50 bg-[rgba(0,0,0,0.5)]",children:e.jsxs("div",{className:"absolute bottom-0 w-full rounded-t-xl border bg-white p-6 text-gray-950",children:[e.jsxs("div",{className:"flex items-center justify-between",onClick:()=>{f(!1),d(!0)},children:[e.jsx("h1",{className:"text-2xl font-bold",children:m("pwa.install_prompt.install_prompt")}),e.jsx("div",{children:e.jsx(Mt,{className:"h-6 w-6"})})]}),e.jsxs("div",{className:"mt-6 flex gap-4 rounded border border-gray-200 bg-gray-100 p-4",children:[e.jsx("img",{src:l.logo.thumb.url,alt:l.name,className:"h-16 w-16 overflow-clip rounded-lg"}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:l.name}),e.jsx("p",{children:l.configured_domain})]})]}),s&&e.jsxs("div",{className:"mx-6 my-8 flex flex-col items-center",children:[e.jsx(L,{type:"button",variant:"primary",onClick:x,children:m("pwa.install_prompt.install_cta")}),e.jsx("p",{className:"mt-4",children:m("pwa.install_prompt.install_sub_cta")})]}),a&&e.jsxs("ol",{className:"mx-6 mb-4 mt-4 list-decimal space-y-6",children:[e.jsxs("li",{className:"relative pl-0",children:[m("pwa.install_prompt.tap_on")," ",e.jsx("div",{className:"relative top-2 inline-block border-gray-200 bg-gray-100 px-1 py-1 text-blue-400",children:e.jsx(La,{className:"h-6 w-6"})})," ",m("pwa.install_prompt.in_the_browser")]}),e.jsxs("li",{className:"pl-0",children:[m("pwa.install_prompt.scroll_down")," ",e.jsx("span",{className:"inline-block border-gray-200 bg-gray-100 px-1 py-1 text-sm font-semibold",children:m("pwa.install_prompt.add_to_home_screen")})]}),e.jsxs("li",{className:"pl-0",children:[m("pwa.install_prompt.look_for")," ",e.jsx("img",{src:l.logo.thumb.url,alt:l.name,className:"inline-block h-6 w-6 overflow-clip rounded-lg"})," ",m("pwa.install_prompt.icon_on_home_screen")]})]})]})})}function je(){document.dispatchEvent(new CustomEvent("beehiiv:showInstallPrompt"))}function Ra(){let t=!1;typeof document<"u"&&(t=localStorage.getItem("pwaPromptShown")==="true");const[s,a]=i.useState(t);return i.useEffect(()=>(document.addEventListener("beehiiv:showInstallPrompt",je),()=>{document.removeEventListener("beehiiv:showInstallPrompt",je)}),[]),[s,r=>{localStorage.setItem("pwaPromptShown",String(r)),a(r)}]}const Fa=({className:t})=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:t,children:e.jsx("path",{fill:"currentColor",d:"M7 23q-.825 0-1.412-.587T5 21V3q0-.825.588-1.412T7 1h7v5H7v12h10v-2h2v5q0 .825-.587 1.413T17 23zm11-9l-5-5l1.4-1.4l2.6 2.6V3h2v7.2l2.6-2.6L23 9z"})}),Ia=()=>{const{webTheme:t}=E(),s=Xe(),a=Qe(),n=s||a,r=G(),o=K(),{t:l}=N(),c=Fa,d=l("nav.install.label");return n&&o!=="standalone"?e.jsx(P.Item,{children:e.jsxs("div",{className:"flex cursor-pointer items-center space-x-2 px-6 py-3",onClick:()=>{if(!r){F.error(l("nav.install.not_logged_in"));return}je()},children:[e.jsx("div",{style:{color:r?t?.navbar_text_color:"#a1a1aa"},children:e.jsx(c,{className:"h-4 w-4"})}),e.jsx(y,{as:"span",className:"",color:r?t?.navbar_text_color:"#a1a1aa",weight:"medium",fontFamilyv2:t.navbar_font_family,size:"sm",children:d})]})}):null};function $a({title:t,titleId:s,...a},n){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":s},a),t?i.createElement("title",{id:s},t):null,i.createElement("path",{fillRule:"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",clipRule:"evenodd"}))}const Aa=i.forwardRef($a),Wa=({children:t,defaultOpen:s=!1,titleChildren:a,className:n,onClick:r,iconColor:o})=>e.jsx(ve,{defaultOpen:s,children:({open:l})=>e.jsxs("div",{className:"flex flex-col",children:[e.jsxs(ve.Button,{onClick:r,className:T("flex justify-between space-x-4",n),children:[e.jsx("div",{children:a}),e.jsx("div",{children:e.jsx("div",{className:"rounded-sm bg-transparent p-1 hover:bg-gray-50/10",style:{color:o},children:e.jsx(Aa,{className:T("transition-50 h-4 w-4 transition-transform",l?"rotate-0":"rotate-180 transform")})})})]}),e.jsx(ve.Panel,{children:t})]})}),We=({navGroup:t,children:s})=>{const{webTheme:a}=E();return e.jsx(Wa,{className:"py-2 pl-6 pr-4",iconColor:a.navbar_text_color,titleChildren:e.jsx("div",{className:"flex items-center pt-0.5",children:e.jsx(y,{as:"span",className:"",color:a.navbar_text_color,weight:"medium",fontFamilyv2:a.navbar_font_family,size:"sm",children:t.title})}),children:e.jsx("div",{className:"pl-4",children:s})})},Oa=({publication:t})=>{const s=t.web_template,a=t.content_tags,n=s.enable_customize_category_ids,r=s.category_ids,o=s.nav_groups.length>0;return e.jsx("div",{className:"",children:o&&s.nav_groups.map(l=>{if(l.is_category_group)return e.jsx(We,{navGroup:l,children:a?.map(d=>n&&!r.includes(d.id)?null:e.jsx("div",{children:e.jsx($,{link:{href:`/t/${he(d.display)}`,type:"internal"},text:d.display})},d.id))},l.id);if(l.nav_links.length===0)return null;if(l.nav_links.length===1){const d=l.nav_links[0].external_link;return e.jsx($,{text:l.nav_links[0].cta_text,link:{href:d?l.nav_links[0].href:`/c/${l.nav_links[0].href}`,type:l.nav_links[0].external_link?"external":"internal"}},l.id)}return e.jsx(We,{navGroup:l,children:l.nav_links.map(d=>{const u=d.external_link;return e.jsx($,{text:d.cta_text,link:{href:u?d.href:`/c/${d.href}`,type:u?"external":"internal"}},d.id)})},l.id)})})},et=({theme:t,dropdownDirection:s="right",publication:a})=>{const{subscription:n}=me("root"),{t:r}=N(),{handleOpenModal:o}=ue(),l=Ue(),c=!!n,{web_template:d,premium_enabled:u,has_referral_program:f}=a,m=d?.author_ids?.length>=1,h=d?.multi_pub_ids?.length>=1,x=n?.tier==="premium",p=u,g=f,w=n?.id,j=n?.avatar_url,_=()=>{o("login")},k=()=>{o("signup")};return e.jsxs(Pe,{direction:s,className:"z-50 sm:w-[300px]",style:{background:t?.navbar_background_color||"#fff",width:l?"calc(100vw - 32px)":void 0},buttonChild:e.jsx("div",{className:"mt-1.5 rounded hover:bg-black/5",style:{color:t?.navbar_text_color||"#000"},children:j?e.jsx("div",{className:"h-6 w-6 overflow-hidden rounded-full",children:e.jsx("img",{className:"h-6 w-6 rounded-full",src:j,alt:"The logged in user"})}):e.jsx(Ne,{className:"h-6 w-6"})}),children:[e.jsx(Oa,{publication:a}),e.jsxs("div",{children:[p&&!x&&e.jsx(e.Fragment,{children:a.web_template.external_upgrade_page_href?e.jsx($,{text:"Upgrade",link:{href:a.web_template.external_upgrade_page_href,type:"external"},Icon:Re}):e.jsx($,{text:"Upgrade",link:{href:"/upgrade",type:"internal"},Icon:Re})}),h&&e.jsx($,{text:"Newsletters",link:{href:"/publications",type:"internal"},Icon:Xs}),m&&e.jsx($,{text:r("author.authors"),Icon:ea,link:{href:"/authors",type:"internal"}}),c&&e.jsx($,{text:r("nav.links.manage"),link:{href:`/subscribe/${w}/manage`,type:"internal"},Icon:Ys}),g&&w&&e.jsx($,{text:r("nav.links.referrals"),link:{href:`/subscribe/${w}/referrals`,type:"internal"},Icon:sa}),d?.pwa_enabled&&e.jsx(Ia,{}),d?.pwa_enabled&&e.jsx(Ca,{})]}),c?e.jsx("div",{className:"flex w-full flex-col p-2",children:e.jsx(Be,{method:"post",action:"/logout",children:e.jsx(L,{variant:"ghost",type:"submit",style:{background:t.navbar_button_secondary_background_color,borderColor:t.navbar_button_secondary_border_color,color:t.navbar_button_secondary_text_color,fontFamily:t.font_button,fontWeight:500,width:"100%"},children:r("shared.cta.logout")})})}):e.jsxs("div",{className:"flex flex-col space-y-2 p-2",children:[e.jsx(P.Item,{children:e.jsx(L,{variant:"ghost",onClick:_,style:{background:t.navbar_button_secondary_background_color,borderColor:t.navbar_button_secondary_border_color,color:t.navbar_button_secondary_text_color,fontFamily:t.font_button,fontWeight:500},children:r("shared.cta.login")})}),e.jsx(P.Item,{children:e.jsx(L,{variant:"primary",onClick:k,style:{background:t.navbar_button_primary_background_color,border:`1px solid ${t.navbar_button_primary_background_color}`,color:t.navbar_button_primary_text_color,fontFamily:t.font_button,fontWeight:500},children:a.cta_text})})]})]})},U=(t,s)=>t||s,ee=({ctaText:t,showActions:s,hideDropdown:a=!1,publication:n})=>{const{webTheme:r}=E(),o=n.web_template?.notifications_enabled,l=Ue(),{navbar_button_primary_background_color:c,color_primary:d,navbar_button_primary_text_color:u,navbar_button_primary_border_color:f,navbar_button_secondary_border_color:m,color_text_on_primary:h,navbar_button_secondary_background_color:x,color_secondary:p,navbar_button_secondary_text_color:g,color_text_on_secondary:w,color_border:j,navbar_button_primary_shadow:_,navbar_button_secondary_shadow:k,navbar_login_button_desktop_enabled:M,font_button:C}=r,b=U(c,d),R=U(u,h),z=U(x,p),q=U(g,w),W=U(f,d),oe=U(m,j),te=Me[_||"none"],H=Me[k||"none"],{t:fe}=N(),{handleOpenModal:se}=ue(),pe=()=>{se("login")};return e.jsxs("div",{className:"flex items-center space-x-2",children:[s?e.jsxs("div",{className:"flex items-center space-x-2",children:[M&&e.jsx(L,{style:{background:z,border:`1px solid ${oe}`,color:q,fontFamily:C},variant:"ghost",onClick:pe,className:T("!text-sm !font-semibold",H),children:fe("shared.cta.login")}),e.jsx(L,{linkProps:{to:"/subscribe",prefetch:"intent"},style:{background:b,border:`1px solid ${W}`,color:R,fontFamily:C},variant:"primary",className:T("whitespace-nowrap !text-sm !font-semibold",te),children:t}),o&&e.jsx(Ae,{})]}):e.jsx("div",{className:"flex items-center",children:o&&e.jsx(Ae,{})}),!a&&e.jsx(et,{dropdownDirection:l?"center":"right",theme:r,publication:n})]})},Ba=({publication:t,showActions:s,theme:a})=>e.jsx(A,{as:"nav",className:"w-full py-2",style:{backgroundColor:a?.navbar_background_color},children:e.jsxs("div",{className:"mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(X,{fontFamily:a.navbar_font_family,url:t.logo.thumb.url,name:t.name,textColor:a.navbar_text_color}),e.jsx(Q,{publication:t,theme:a})]}),e.jsx(ee,{ctaText:t.cta_text,showActions:s,publication:t})]})}),Da=({publication:t,isLoggedIn:s,subscription:a,isAdminLoggedIn:n,showActions:r,theme:o})=>e.jsx(A,{as:"nav",className:"w-full py-2",style:{backgroundColor:o.navbar_background_color},children:e.jsxs("div",{className:"mx-auto flex items-center justify-between",children:[e.jsx(X,{url:t.logo.thumb.url,name:t.name,textColor:o.navbar_text_color}),e.jsx(Q,{publication:t,theme:o}),e.jsx(ee,{ctaText:t.cta_text,showActions:r,publication:t})]})}),za=({publication:t,isLoggedIn:s,subscription:a,isAdminLoggedIn:n,showActions:r,theme:o})=>e.jsx(A,{as:"nav",className:"w-full py-2",style:{backgroundColor:o?.navbar_background_color},children:e.jsxs("div",{className:"mx-auto flex justify-between",children:[e.jsx(X,{url:t.logo.thumb.url,name:t.name,textColor:o.navbar_text_color}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Q,{publication:t,theme:o}),e.jsx(ee,{ctaText:t.cta_text,showActions:r,publication:t})]})]})}),qa=({publication:t,isLoggedIn:s,subscription:a,isAdminLoggedIn:n,showActions:r,theme:o})=>e.jsx(A,{as:"nav",className:"w-full py-2",style:{backgroundColor:o?.navbar_background_color},children:e.jsxs("div",{className:"mx-auto flex justify-between",children:[e.jsx(Q,{publication:t,theme:o}),e.jsx(X,{url:t.logo.thumb.url,name:t.name,textColor:o.navbar_text_color}),e.jsx(ee,{ctaText:t.cta_text,showActions:r,publication:t})]})}),tt=({color:t})=>e.jsx("div",{className:"h-[1px] w-full opacity-5",style:{backgroundColor:t}}),Ga=({publication:t,isLoggedIn:s,subscription:a,isAdminLoggedIn:n,showActions:r,theme:o})=>e.jsxs("div",{className:"w-full",children:[e.jsx(A,{as:"nav",className:"py-2",style:{backgroundColor:o?.navbar_background_color},children:e.jsxs("div",{className:"mx-auto flex justify-between",children:[e.jsx(X,{url:t.logo.thumb.url,name:t.name,textColor:o.navbar_text_color}),e.jsx(ee,{ctaText:t.cta_text,showActions:r,publication:t})]})}),e.jsx(tt,{color:o?.navbar_text_color}),e.jsx(A,{as:"nav",className:"py-2",style:{backgroundColor:o?.navbar_background_color},children:e.jsx("div",{className:"mx-auto flex justify-center",children:e.jsx(Q,{publication:t,theme:o})})})]}),Ha=({publication:t,isLoggedIn:s,subscription:a,isAdminLoggedIn:n,showActions:r,theme:o})=>e.jsxs("div",{className:"w-full",children:[e.jsx(A,{as:"nav",className:"py-2",style:{backgroundColor:o?.navbar_background_color},children:e.jsxs("div",{className:"mx-auto flex items-center justify-between",children:[e.jsx("div",{className:"w-1/3",children:e.jsx(et,{theme:o,dropdownDirection:"left",publication:t})}),e.jsx("div",{className:"mx-auto flex w-1/3 justify-center",children:e.jsx(X,{url:t.logo.thumb.url,name:t.name,textColor:o.navbar_text_color})}),e.jsx("div",{className:"flex w-1/3 justify-end",children:e.jsx(ee,{hideDropdown:!0,ctaText:t.cta_text,showActions:r,publication:t})})]})}),e.jsx(tt,{color:o?.navbar_text_color}),e.jsx(A,{as:"nav",className:"py-2",style:{backgroundColor:o?.navbar_background_color},children:e.jsx("div",{className:"mx-auto flex justify-center",children:e.jsx(Q,{publication:t,theme:o})})})]}),Ua=t=>!t||!["template-1","template-2","template-3","template-4","template-5","template-6"].includes(t)?"template-1":t,Za=({publication:t,subscription:s,isAdminLoggedIn:a,isLoggedin:n})=>{const{webTheme:r}=E(),o=Ua(r?.navbar_template),l=!n&&!t.private,c={"template-1":Ba,"template-2":Da,"template-3":za,"template-4":qa,"template-5":Ga,"template-6":Ha}[o];return e.jsx(c,{publication:t,isLoggedIn:n,subscription:s,isAdminLoggedIn:a,showActions:l,theme:r})},Va=({shouldCreateVisitToken:t,setCookie:s})=>{const[a]=I(),n=gt(),r=n.data;i.useEffect(()=>{if(t){const o=document.referrer,l=new FormData;l.append("referrer",o),l.append("landing_page",window.location.href);const d="/visit_token"+(a.toString()?`?${a.toString()}`:"");n.submit(l,{method:"post",action:d})}},[t]),i.useEffect(()=>{r?.visitToken&&t&&s({name:"visit_token",value:r?.visitToken,days:.16666666666666666})},[r])},Ja=({showLoggedInToast:t})=>{const[s,a]=I(),n=s.get("subscription"),r=s.get("opt_in_email"),o=s.get("logout"),{t:l}=N();i.useEffect(()=>{n&&(n==="success"?ae.success(l("notifications.subscribe.success")):n==="error"&&ae.error(l("notifications.subscribe.error")),s.delete("subscription"),a(s))},[n,s,a,l]),i.useEffect(()=>{o&&(o==="success"&&ae.success(l("notifications.logout.success")),s.delete("logout"),a(s))},[o,s,a,l]),i.useEffect(()=>{r&&r==="error"&&(ae.success(l("notifications.optin.error")),s.delete("opt_in_email"),a(s))},[r,s,a,l]),i.useEffect(()=>{t&&ae.success(l("login.success.title"))},[t,l])},ce=t=>{const[s,a]=I(),n=s.get(t);i.useEffect(()=>{n&&(s.delete(t),a(s,{replace:!0}))},[t])},Ya=["popup_closed","email_capture_disabled","active_upgrade","language","visit_token","referral_id","form_preview_banner_disabled","last_resource_guid","admin_logged_in","notifications_read","beehiiv_honey",bt],Ka={popup_closed:{name:"popup_closed",value:"true",days:4},email_capture_disabled:{name:"email_capture_disabled",value:"true",days:30},active_upgrade:{name:"active_upgrade",value:"true",days:30}},Xa=({initialCookies:t})=>{const[s]=I(),[a,n]=i.useState({}),[r,o]=i.useState(!1),[l,c]=i.useState({}),d=()=>{const m=document.cookie.split("; "),h={};for(const x of m){const[p,g]=x.split("="),w=p||g,j=Ya.includes(p);w&&j&&(h[p]=decodeURIComponent(g))}return h},u=({name:m,value:h,days:x})=>{const p=new Date;p.setTime(p.getTime()+x*24*60*60*1e3),document.cookie=`${m}=${encodeURIComponent(h)};expires=${p.toUTCString()};path=/`,l[m]=h,c({...l})},f=m=>{document.cookie=`${m}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;const h={...l};delete h?.[m],c({...h})};return i.useEffect(()=>{n(d());for(const[h,x]of Object.entries(t)){const p=Ka[h];x&&p&&u(p)}const m=s.get("ref");m&&u({name:"referral_id",value:m,days:30}),o(!0)},[]),{setCookie:u,cookies:{...a,...l},cookiesSet:r,removeCookie:f}},Qa=()=>{const{pathname:t}=D(),[s]=I(),[a,n]=i.useState(!1),r=t==="/",o=t.startsWith("/p/"),l=t.startsWith("/c/"),d=t.startsWith("/t/")||l||r||o,u=t==="/landing_page",f=t==="/login",m=t==="/create_password",h=t==="/reset_password",x=t==="/update_password",p=t.startsWith("/forms")&&s.has("preview"),g=t.startsWith("/subscribe")&&!t.includes("/manage")&&!t.includes("/billing")&&!t.includes("/preferences")&&!t.includes("/referrals"),w=t==="/test_home_page",j=t==="/recommendations",_=t.startsWith("/polls"),M=u||f||m||h||x||g||t==="/upgrade"||j||_||p||a||w,C=t.startsWith("/forms"),b=t==="/upgrade",R=t.startsWith("/subscribe")&&t.endsWith("/manage"),z=t.startsWith("/subscribe")&&t.endsWith("/billing"),q=t.startsWith("/subscribe")&&t.endsWith("/preferences"),W=t.startsWith("/subscribe")&&t.endsWith("/referrals"),te=b||R||z||q||C||(t==="/publications"||t==="/publications/")||W;return i.useEffect(()=>{const H=!!localStorage.getItem(Bt.SIGNUP_REDIRECTS);n(H)},[t]),d?{isNavShowing:!0,isFooterShowing:!0}:M?{isNavShowing:!1,isFooterShowing:!1}:te?{isNavShowing:!0,isFooterShowing:!1}:{isNavShowing:!0,isFooterShowing:!0}},en=({justLoggedIn:t,setCookie:s})=>{const[a,n]=i.useState(!1),r=Oe(),{t:o}=N(),l=()=>{s({name:"admin_logged_in",value:"true",days:0});const c=new FormData;c.append("logout_admin","true"),r(c,{method:"post",action:"/logout"})};return i.useEffect(()=>{t&&(F.success(o("login.success.admin")),s({name:"admin_logged_in",value:"true",days:4}))},[t,s]),e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>n(!0),className:"pointer-events-auto fixed right-3 top-14 z-40 flex rounded-lg bg-white p-2 shadow-xl ring-1 ring-black ring-opacity-5 lg:right-4",children:e.jsx(Rt,{className:"h-4 w-4 text-wt-primary"})}),e.jsx(Ft,{title:`${o("admin.modal.title")}`,description:`${o("admin.modal.description")}`,isOpen:a,onClose:()=>n(!1),children:e.jsxs("div",{className:"flex w-full justify-end space-x-2",children:[e.jsx(L,{type:"button",variant:"ghost",className:"shadow-none",onClick:()=>{l(),n(!1)},children:o("shared.cta.logout")}),e.jsx(L,{type:"button",variant:"primary",onClick:()=>n(!1),children:o("shared.cta.continue")})]})})]})},we=({value:t,selectedCookies:s,setSelectedCookies:a,disabled:n})=>e.jsxs("button",{onClick:()=>{s.includes(t)?a(s.filter(r=>r!=t)):a([...s,t])},className:"flex flex-row space-x-2 "+(n&&"opacity-40"),disabled:n,children:[e.jsx("div",{className:"rounded border border-white p-0.5 "+(!s.includes(t)&&!n?"hover:bg-gray-800":"bg-white"),children:e.jsx(Gt,{className:"h-4 w-4 text-black"})}),e.jsx("p",{className:"my-auto text-sm font-semibold text-white",children:t})]}),tn=({publication:t,cookies:s,setCookie:a})=>{const[n,r]=i.useState(!1),[o,l]=i.useState(["Marketing Cookies","Data Processor Cookies"]),[c,d]=i.useState(!1),u=i.useRef(null);i.useEffect(()=>{if(s){const m=t?.enable_cookie_banner&&!s?.beehiiv_honey;r(m),setTimeout(()=>{m&&u.current&&u.current.classList.add("!opacity-100","!translate-y-[0%]")},1e3)}},[s]);const f=m=>{m.preventDefault();const h=m.target.value,x={};h=="customize"&&d(!0),h=="back"&&d(!1),h=="decline"&&(x.marketing=!1,x.dataProcessing=!1,a({name:"beehiiv_honey",value:JSON.stringify(x),days:1e3}),r(!1)),h=="accept"&&(x.marketing=!0,x.dataProcessing=!0,a({name:"beehiiv_honey",value:JSON.stringify(x),days:1e3}),r(!1)),h=="allow-selection"&&(x.marketing=o.includes("Marketing Cookies"),x.dataProcessing=o.includes("Data Processor Cookies"),a({name:"beehiiv_honey",value:JSON.stringify(x),days:1e3}),r(!1))};return n?e.jsxs("div",{ref:u,className:"fixed left-2 right-2 top-2 z-50 translate-y-[-100%] rounded bg-[#060419] p-4 text-white opacity-0 transition-all duration-200 sm:bottom-2 sm:right-[unset] sm:top-auto sm:max-w-sm sm:translate-y-[100%]",children:[c?e.jsxs("div",{className:"mb-6 flex w-full flex-col",children:[e.jsx("p",{className:"text-lg font-bold text-white",children:"Customize Cookies"}),e.jsxs("p",{className:"mt-1 text-xs text-white",children:["Select the types of cookies to use per our"," ",e.jsx("a",{href:"https://www.beehiiv.com/tou",target:"_blank",className:"underline underline-offset-1 hover:opacity-80",rel:"noreferrer",children:"terms of use"})," ","&"," ",e.jsx("a",{href:"https://www.beehiiv.com/privacy",target:"_blank",className:"underline underline-offset-1 hover:opacity-80",rel:"noreferrer",children:"privacy policy"}),"."]}),e.jsxs("div",{className:"mt-4 flex flex-col space-y-3",children:[e.jsx(we,{value:"Necessary Cookies",selectedCookies:o,setSelectedCookies:l,disabled:!0}),e.jsx(we,{value:"Marketing Cookies",selectedCookies:o,setSelectedCookies:l,disabled:!1}),e.jsx(we,{value:"Data Processor Cookies",selectedCookies:o,setSelectedCookies:l,disabled:!1})]})]}):e.jsxs("div",{className:"flex w-full flex-col space-y-1",children:[e.jsx("p",{className:"font-bold text-white",children:"This Website Uses Cookies"}),e.jsxs("p",{className:"text-sm",children:["Read our"," ",e.jsx("a",{href:"https://www.beehiiv.com/privacy",target:"_blank",className:"underline underline-offset-1 hover:opacity-80",rel:"noreferrer",children:"privacy policy"})," ","and"," ",e.jsx("a",{href:"https://www.beehiiv.com/tou",target:"_blank",className:"underline underline-offset-1 hover:opacity-80",rel:"noreferrer",children:"terms of use"})," ","for more information."]})]}),c?e.jsxs("div",{className:"mt-3 flex gap-1.5",children:[e.jsx("button",{onClick:f,value:"back",className:"flex-1 rounded-sm border border-white p-2 px-4 text-sm",children:"Back"}),e.jsx("button",{value:"allow-selection",className:"flex-1 rounded-sm border border-white p-2 px-4 text-sm",onClick:f,children:"Allow Selection"})]}):e.jsxs("div",{className:"mt-3 flex gap-1.5",children:[e.jsx("button",{className:"flex-1 rounded-sm border border-white p-2 px-4 text-sm",onClick:f,value:"accept",children:"Accept"}),e.jsx("button",{value:"customize",className:"flex-1 rounded-sm border border-white p-2 px-4 text-sm",onClick:f,children:"Customize"}),e.jsx("button",{className:"flex-1 rounded-sm border border-white p-2 px-4 text-sm",onClick:f,value:"decline",children:"Decline"})]})]}):null},sn=({publication:t,signupWidgetConfigs:s})=>{const{isLoginModalOpen:a,isSignupModalOpen:n,handleCloseModal:r}=ue(),{t:o}=N();return e.jsxs("div",{children:[a&&e.jsx(Ge,{isOpen:a,handleCloseModal:r,publication:t}),n&&e.jsx(It,{title:`${o("subscribe.modal_header")} ${t?.name||""}`,description:t?.description||"",publication:t,isOpen:n,onClose:r,alternativeAction:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"opacity-75",children:[o("login.already_a_subscriber")," "]}),e.jsx(S,{to:"/login",className:"inline-flex justify-center underline",children:o("meta.titles.login")})]}),children:e.jsx(ze,{signupStyles:s})})]})},an=({debug:t=!1})=>e.jsx(qe,{children:()=>e.jsx(nn,{debug:t})});function nn({debug:t=!1}){const s=G(),a=K(),{onEnable:n}=Ke(),{publication:r}=me("root")??{},{t:o}=N(),[l,c]=rn(),[d,u]=i.useState(!l&&s);async function f(){u(!1),await n(),c(!0)}function m(){F(o("pwa.enable_push_notification_prompt.enable_push_notifications_from_menu"),{icon:"ℹ️"}),u(!1),c(!0)}return l||a!=="standalone"||!s||!d?null:e.jsx("div",{className:"fixed inset-0 z-50 bg-[rgba(0,0,0,0.5)]",children:e.jsx("div",{className:"absolute top-0 w-full rounded-b-xl border bg-white p-6 text-gray-950",children:e.jsxs("div",{className:"flex gap-6",children:[e.jsx("img",{src:r.logo.thumb.url,alt:r.name,className:"h-16 w-16 flex-none overflow-clip rounded-lg"}),e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx("p",{children:o("pwa.enable_push_notification_prompt.enable_push_notifications_from_menu")}),e.jsxs("div",{className:"flex justify-end gap-4",children:[e.jsx(L,{type:"button",variant:"ghost",onClick:m,children:o("pwa.enable_push_notification_prompt.maybe_later")}),e.jsx(L,{type:"button",variant:"primary",onClick:f,children:o("pwa.enable_push_notification_prompt.enable")})]})]})]})})})}function rn(){let t=!1;typeof document<"u"&&(t=localStorage.getItem("enablePushNotificationPromptShown")==="true");const[s,a]=i.useState(t);return[s,r=>{localStorage.setItem("enablePushNotificationPromptShown",String(r)),a(r)}]}function on(t){i.useEffect(()=>{if(typeof window>"u")return;const s=async()=>{if("serviceWorker"in navigator)try{const n=await navigator.serviceWorker.getRegistration();n&&n.active&&n.active.postMessage({type:"update_icon",payload:{icon:t?.icon}})}catch(n){console.error("Error getting service worker registration:",n)}else console.warn("Service Workers are not supported in this browser.")},a=()=>{s()};return"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("controllerchange",a),s(),()=>{"serviceWorker"in navigator&&navigator.serviceWorker.removeEventListener("controllerchange",a)}},[t?.icon])}const ln=()=>{const[t,s]=I(),a=t.get("submission_error"),n=t.get("submission_success");i.useEffect(()=>{a&&(F.error("There was an error submitting the form. Please reload the page and try again."),t.delete("submission_error"),s(t,{replace:!0})),n&&(F.success("Success"),t.delete("submission_success"),s(t,{replace:!0}))},[a,n])},cn=()=>{const[t,s]=I(),a=t.get("toast"),n=t.get("message"),r=t.get("title");i.useEffect(()=>{if(a&&n){const o=`${r?`${r}
`:""}${n}`;a==="success"?F.success(o):F.error(o),t.delete("toast"),t.delete("message"),t.delete("title"),s(t,{replace:!0})}},[F,s])},dn=({language:t,setCookie:s})=>{const{i18n:a}=N();i.useEffect(()=>{a.changeLanguage(t),s({name:"language",value:t,days:30})},[a,t])},mn=({tier:t,isLoggedIn:s})=>{const[a]=I(),n=a.get("status")==="subscribed",r=s||n,o=a.get("upgraded")==="true";return{isLoggedInOrSubscribed:r,isPremiumSubscription:t==="premium"||o}},fr=()=>[{rel:"preconnect",href:"https://fonts.googleapis.com"},{rel:"preconnect",href:"https://fonts.gstatic.com"}],pr={i18n:["common"]},gr=({data:t})=>{if(t?.publication?.name){const s=t?.publication.tags.map(l=>l.name).join(", "),a=[`https://fonts.googleapis.com/css2?family=${t?.publication?.web_theme?.header_font.split(" ").join("+")}&display=swap`,`https://fonts.googleapis.com/css2?family=${t?.publication?.web_theme?.body_font.split(" ").join("+")}&display=swap`,`https://fonts.googleapis.com/css2?family=${t?.publication?.web_theme?.button_font.split(" ").join("+")}&display=swap`,...t?.publication?.web_template?.global_fonts],n=[...new Set(a)].map(l=>({tagName:"link",rel:"stylesheet",href:l})),r=[...new Set(a)].map(l=>({tagName:"link",rel:"preload",href:l,as:"style"})),o=[{title:t?.publication.name},{keywords:s},{author:t?.publication.email_sender_name},{description:t?.publication.description},{tagName:"link",rel:"icon",href:t?.publication?.logo?.thumb?.url,as:"image"},...n,...r];return t?.publication.noindex_enabled&&o.push({robots:"noindex"}),t?.publication?.rss_feeds?.length&&o.push({tagName:"link",rel:"alternate",type:"application/rss+xml",title:`${t?.publication.name} RSS Feed`,href:t?.publication.rss_feeds[0].url}),o}return[{title:"beehiiv"},{description:"The newsletter platform built for growth."},{keywords:"Newsletter, Email, Growth, Platform, SaaS, Creator"}]},un=()=>{const{isLoggedIn:t,subscription:s,admin:a,publication:n,rootStyles:r,isProdEnv:o,webThemev2:l,hasWebBuilderV2:c,currentPath:d,showLoggedInToast:u,isInitialLoadFromSwarm:f,signupWidgetConfigs:m,canShowCookieBanner:h,SENTRY_RELEASE:x}=Ht();Yt(),Ut({isInitialLoadFromSwarm:f,publicationId:n.id});const{isLoggedInOrSubscribed:p,isPremiumSubscription:g}=mn({isLoggedIn:t,tier:s?.tier}),{cookies:w,setCookie:j,cookiesSet:_,removeCookie:k}=Xa({initialCookies:{popup_closed:p,email_capture_disabled:p,active_upgrade:g}});dn({language:n?.language,setCookie:j});const M=!!w.visit_token;Va({shouldCreateVisitToken:_&&!M,setCookie:j}),$t({setCookie:j,cookiesSet:_}),ce("jwt_token"),ce("admin_token"),ce("status"),ce("upgraded"),ln(),cn(),Ja({showLoggedInToast:t&&u}),on({icon:n?.logo?.thumb?.url});const{isNavShowing:C,isFooterShowing:b}=Qa(),{progress:R,redirects:z,currentStep:q}=qt(n),W=K();return i.useEffect(()=>{W==="standalone"&&x!==window.__AppGlobals__?.SENTRY_RELEASE&&(console.log(`Reloading page due to new release. Old release: ${window.__AppGlobals__?.SENTRY_RELEASE}, New release: ${x}`),window.location.reload())},[x,W]),e.jsx(ne,{publication:n,rootStyles:r,isProdEnv:o,cookies:w,cookiesSet:_,children:e.jsx(vt,{webTheme:l,isEnabled:c,children:e.jsxs(Dt,{cookies:w,setCookie:j,cookiesSet:_,removeCookie:k,visitToken:w.visit_token,referralId:w.referral_id,currentPath:d,children:[a&&e.jsx(en,{setCookie:j,justLoggedIn:_&&!w.admin_logged_in&&!!a}),e.jsx(sn,{publication:n,signupWidgetConfigs:m}),e.jsx(it,{position:"top-center"}),h?e.jsx(tn,{publication:n,cookies:w,setCookie:j}):null,C&&!R?c?e.jsx(Za,{publication:n,subscription:s,isLoggedin:t,isAdminLoggedIn:!!a}):e.jsx(ha,{publication:n,isLoggedIn:t,subscription:s,isAdminLoggedIn:!!a}):e.jsx(e.Fragment,{}),R?e.jsx(xa,{progress:R,redirects:z,currentStep:q,publication:n}):null,e.jsx(Lt,{noLayout:!C&&!b,children:e.jsx(rt,{context:{publicationId:n?.id,cookies:w,setCookie:j,cookiesSet:_,removeCookie:k,visitToken:w.visit_token,referralId:w.referral_id,admin:a,isLoggedIn:t}})}),b?c?e.jsx(Ts,{}):e.jsx(As,{publication:n,subscription:s}):e.jsx(e.Fragment,{}),n?.web_template?.pwa_enabled&&e.jsxs(e.Fragment,{children:[e.jsx(Ma,{}),e.jsx(an,{})]})]})})})},vr=Zt(un,{errorBoundaryOptions:{fallback:e.jsx(Z,{errorCode:"500"})}});function wr(){const t=ot();if(i.useEffect(()=>{Le(t)||ct(t,{tags:{keyword:"remix-error-boundary"}})},[t]),Le(t))switch(t.status){case 400:return e.jsx(ne,{children:e.jsx(Z,{errorCode:"400",publicationPresent:!1})});case 404:return e.jsx(ne,{children:t.data==="DirectLinkExpired"?e.jsx(Z,{customTitle:"Uh oh, it looks like this link is expired.",customDescription:e.jsx(e.Fragment,{children:"The Publication needs to update a few things on their end to resume."}),errorCode:"404",publicationPresent:!1}):e.jsx(Z,{errorCode:"404",publicationPresent:!1})});default:return e.jsx(ne,{children:e.jsx(Z,{errorCode:`${t.status}`,error:t})})}let s="0";if(t instanceof Error){let a=t.message??"";if(a.startsWith("{"))try{let n=JSON.parse(a);s=n.status??"0",a=n.message??""}catch{}}return e.jsx(ne,{title:"Error!",children:e.jsx(Z,{errorCode:s,error:t})})}export{wr as ErrorBoundary,vr as default,pr as handle,fr as links,gr as meta};
//# sourceMappingURL=root-BVI6Hs5u.js.map

//# debugId=88bd28f7-9734-5f22-8478-5a175407f422
